प्रतिमा
image URL घाला आणि त्याची width व alignment समायोजित करा. default ने addresses http:, https: किंवा त्याच site च्या paths पुरते मर्यादित असतात आणि नवी image 60% width वर मध्यभागी सुरू होते.
width फक्त ठराविक steps मध्ये साठवली जाते आणि alignment image ला wrap करणाऱ्या paragraph वर साठवले जाते. blob: किंवा data:image/... previews साठी image wing आणि editor assembly दोन्हींमध्ये local URLs स्पष्टपणे allow करा. SVG data URLs ला परवानगी नाही.
npm install nabi-noteimport {
createNabiWith, mountSurface, mountToolbar, mountContextToolbar,
mountHints, watchSettle, tableWings, imageWing, youtubeWing,
mountViewTools,
} from 'nabi-note'
const selected = [
...tableWings,
imageWing,
youtubeWing,
]
const { nabi, registry } = createNabiWith(selected)
const root = document.querySelector('.nabi')!
const content = document.querySelector('.nabi-content')!
// The locale also sets the direction — Arabic and Urdu run right to left
mountSurface({ nabi, registry, root: content, locale: 'mr' })
const settle = watchSettle(document, { surface: content })
const shared = { nabi, registry, surface: content, settle, locale: 'mr' }
const toolbar = mountToolbar({ ...shared, root: document.querySelector('#toolbar')! })
const context = mountContextToolbar({ ...shared, root: document.querySelector('#context')! })
mountHints({ toolbar, context, root, surface: content })
// The preview and fullscreen buttons — they stand their own box at the end of the row
mountViewTools({ ...shared, root, container: document.querySelector('#toolbar')! })
// on every change — hook up your own code here
// nabi.onChange(() => user_callback(nabi.getHtml()))const selected = wings().use('img', {
allowLocalUrls: false,
}).build()हा wing document मध्ये address घालतो; तो files upload करत नाही. server वर files पाठवण्यासाठी upload wing जोडा.
CSS शैली
.nabi-content img ने images style करा. साठवलेली width आणि alignment जशी आहे तशी ठेवा व borders किंवा shadows सारखे दृश्य तपशीलच बदला.
.article-body img {
border-radius: 12px;
box-shadow: 0 8px 24px rgb(0 0 0 / 12%);
}
.dark .article-body img { box-shadow: 0 8px 24px rgb(0 0 0 / 35%); }max-inline-size, block-size, width आणि alignment यांचे default rules ठेवा. image size document मध्ये साठवली जाते, म्हणून निश्चित CSS width सक्तीने लावल्यास लेखकाने निवडलेल्या width शी संघर्ष होऊ शकतो.