المحاذاة
تحاذي الفقرة الحالية والفقرات الواقعة ضمن التحديد إلى اليسار أو الوسط أو اليمين. وتُحاذى العناصر الموجودة داخل الفقرة، مثل الصور ومقاطع الفيديو والجداول، بحسب الفقرة التي تحتويها.
تُحفظ المحاذاة كخاصية للفقرة لا كتنسيق للحروف. وتُستثنى كتل الشفرة لأن للمسافة البادئة فيها معنى بذاتها.
داخل الخلية، تُطبّق المحاذاة على الفقرة الداخلية أو الصورة عند المؤشر. وعند سحب التحديد عبر عدة خلايا، تُطبّق على كل الفقرات والصور القابلة للمحاذاة فيها. إذا جمع التحديد محاذاة مختلفة، فلا يظهر أي زر محاذاة على أنه محدد.
لمحاذاة الجدول نفسه، اضغط تحديد الجدول في أدواته السياقية، أو ضع المؤشر قبل الجدول أو بعده داخل الفقرة المحيطة به، ثم استخدم أزرار المحاذاة في الشريط الرئيسي. غيّر موضع المنطقة العائمة يمينًا أو يسارًا من أدواتها السياقية بدل أزرار المحاذاة.
npm install nabi-noteimport {
createLocale, createNabiWith, mountSurface, mountToolbar,
mountContextToolbar, mountHints, watchSettle, alignWing, dropCapWing,
mountViewTools,
} from 'nabi-note'
const selected = [
alignWing,
dropCapWing,
]
const locale = createLocale('ar')
const { nabi, registry } = createNabiWith(selected, { locale })
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 })
const settle = watchSettle(document, { surface: content })
const shared = { nabi, registry, surface: content, settle, locale }
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()))
// Call from your language selector. Content and editing history stay intact.
// locale.setLocale('ko')const selected = wings().use('align').build()لتطبيق أمر على التحديد الحالي، استخدم l لليسار وc للوسط وr لليمين.
nabi.applyCommand('setAlign', { value: 'c' })