@notectl/core 1.0.8 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{AttrRegistry-D-przlzb.mjs → AttrRegistry-I-VdmRnN.mjs} +2 -2
- package/dist/chunks/{AttrRegistry-D-przlzb.mjs.map → AttrRegistry-I-VdmRnN.mjs.map} +1 -1
- package/dist/chunks/CaretNavigation-CAJXoaae.mjs +311 -0
- package/dist/chunks/CaretNavigation-CAJXoaae.mjs.map +1 -0
- package/dist/chunks/ColorNames-BdsHwA2f.mjs +59 -0
- package/dist/chunks/ColorNames-BdsHwA2f.mjs.map +1 -0
- package/dist/chunks/ColorPickerPopup-xL8ZUfpB.mjs +125 -0
- package/dist/chunks/ColorPickerPopup-xL8ZUfpB.mjs.map +1 -0
- package/dist/chunks/Commands-CicwYoTQ.mjs +286 -0
- package/dist/chunks/Commands-CicwYoTQ.mjs.map +1 -0
- package/dist/chunks/{Document-CI3iCwEP.mjs → Document-CuwE73FF.mjs} +35 -22
- package/dist/chunks/{Document-CI3iCwEP.mjs.map → Document-CuwE73FF.mjs.map} +1 -1
- package/dist/chunks/HTMLUtils-DTqQzcKR.mjs +35 -0
- package/dist/chunks/HTMLUtils-DTqQzcKR.mjs.map +1 -0
- package/dist/chunks/MarkCommands-CC37WA7Z.mjs +94 -0
- package/dist/chunks/MarkCommands-CC37WA7Z.mjs.map +1 -0
- package/dist/chunks/NavigationUtils-CyW0Vo8A.mjs +47 -0
- package/dist/chunks/NavigationUtils-CyW0Vo8A.mjs.map +1 -0
- package/dist/chunks/{NodeResolver-D68ZLXti.mjs → NodeResolver-B-wzthAQ.mjs} +2 -2
- package/dist/chunks/{NodeResolver-D68ZLXti.mjs.map → NodeResolver-B-wzthAQ.mjs.map} +1 -1
- package/dist/chunks/Platform-S_xqIqcM.mjs +26 -0
- package/dist/chunks/Platform-S_xqIqcM.mjs.map +1 -0
- package/dist/chunks/Selection-DmFDwiPJ.mjs +52 -0
- package/dist/chunks/Selection-DmFDwiPJ.mjs.map +1 -0
- package/dist/chunks/ToolbarItem-BpZggUGo.mjs +8 -0
- package/dist/chunks/ToolbarItem-BpZggUGo.mjs.map +1 -0
- package/dist/chunks/ToolbarPlugin-B6JETWaw.mjs +818 -0
- package/dist/chunks/ToolbarPlugin-B6JETWaw.mjs.map +1 -0
- package/dist/chunks/index--z_Txzej.mjs +467 -0
- package/dist/chunks/index--z_Txzej.mjs.map +1 -0
- package/dist/chunks/{index-o6hDR07y.mjs → index-83QoUENW.mjs} +25 -20
- package/dist/chunks/index-83QoUENW.mjs.map +1 -0
- package/dist/chunks/{index-CT3HGdQt.mjs → index-B0UFAfyb.mjs} +13 -13
- package/dist/chunks/{index-CT3HGdQt.mjs.map → index-B0UFAfyb.mjs.map} +1 -1
- package/dist/chunks/{index-C2GQoHot.mjs → index-BDMP86F4.mjs} +40 -40
- package/dist/chunks/{index-C2GQoHot.mjs.map → index-BDMP86F4.mjs.map} +1 -1
- package/dist/chunks/{index-Bsp4LC5t.mjs → index-BWXkaC2Z.mjs} +36 -36
- package/dist/chunks/index-BWXkaC2Z.mjs.map +1 -0
- package/dist/chunks/{index-C-YWHOcC.mjs → index-BigJ0z6n.mjs} +22 -22
- package/dist/chunks/{index-C-YWHOcC.mjs.map → index-BigJ0z6n.mjs.map} +1 -1
- package/dist/chunks/{index-uTnc9y7M.mjs → index-CPjf45-o.mjs} +28 -28
- package/dist/chunks/index-CPjf45-o.mjs.map +1 -0
- package/dist/chunks/{index-BAk1EG1x.mjs → index-CPyHuEzh.mjs} +106 -106
- package/dist/chunks/index-CPyHuEzh.mjs.map +1 -0
- package/dist/chunks/{index-Ct0ivLhO.mjs → index-D4GKlc-A.mjs} +256 -259
- package/dist/chunks/index-D4GKlc-A.mjs.map +1 -0
- package/dist/chunks/{index-BRYzYOYC.mjs → index-D67mP19g.mjs} +29 -29
- package/dist/chunks/index-D67mP19g.mjs.map +1 -0
- package/dist/chunks/index-D8tbbW97.mjs +73 -0
- package/dist/chunks/index-D8tbbW97.mjs.map +1 -0
- package/dist/chunks/{index-DC1EK22F.mjs → index-DIAXWwgJ.mjs} +24 -19
- package/dist/chunks/index-DIAXWwgJ.mjs.map +1 -0
- package/dist/chunks/{index-BSFLNveF.mjs → index-DQryjfJs.mjs} +352 -341
- package/dist/chunks/index-DQryjfJs.mjs.map +1 -0
- package/dist/chunks/index-DRZwd-1W.mjs +187 -0
- package/dist/chunks/index-DRZwd-1W.mjs.map +1 -0
- package/dist/chunks/{index-BYgspns5.mjs → index-DUC1X43Z.mjs} +54 -54
- package/dist/chunks/index-DUC1X43Z.mjs.map +1 -0
- package/dist/chunks/{index-CxiWyUho.mjs → index-DipAT_Q9.mjs} +31 -31
- package/dist/chunks/index-DipAT_Q9.mjs.map +1 -0
- package/dist/chunks/{index-D3CQWJiw.mjs → index-tBDVaSjG.mjs} +81 -61
- package/dist/chunks/index-tBDVaSjG.mjs.map +1 -0
- package/dist/chunks/resolvePluginLocale-B4w1OkPy.mjs.map +1 -1
- package/dist/commands/Commands.d.ts +13 -45
- package/dist/commands/Commands.d.ts.map +1 -1
- package/dist/commands/DeleteCommands.d.ts +15 -0
- package/dist/commands/DeleteCommands.d.ts.map +1 -0
- package/dist/commands/GapCursorCommands.d.ts +24 -0
- package/dist/commands/GapCursorCommands.d.ts.map +1 -0
- package/dist/commands/MarkCommands.d.ts +19 -0
- package/dist/commands/MarkCommands.d.ts.map +1 -0
- package/dist/commands/MovementCommands.d.ts +27 -0
- package/dist/commands/MovementCommands.d.ts.map +1 -0
- package/dist/commands/NodeSelectionCommands.d.ts +24 -0
- package/dist/commands/NodeSelectionCommands.d.ts.map +1 -0
- package/dist/commands/PasteCommand.d.ts.map +1 -1
- package/dist/commands/WordBoundary.d.ts +12 -0
- package/dist/commands/WordBoundary.d.ts.map +1 -0
- package/dist/editor/DocumentSerializer.d.ts.map +1 -1
- package/dist/editor/NotectlEditor.d.ts +34 -6
- package/dist/editor/NotectlEditor.d.ts.map +1 -1
- package/dist/editor/styles/list.d.ts +2 -0
- package/dist/editor/styles/list.d.ts.map +1 -1
- package/dist/editor/styles/toolbar.d.ts +1 -1
- package/dist/editor/styles/toolbar.d.ts.map +1 -1
- package/dist/index.d.ts +31 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/input/ClipboardHandler.d.ts +2 -0
- package/dist/input/ClipboardHandler.d.ts.map +1 -1
- package/dist/input/CompositionTracker.d.ts +14 -0
- package/dist/input/CompositionTracker.d.ts.map +1 -0
- package/dist/input/FileHandlerRegistry.d.ts +16 -0
- package/dist/input/FileHandlerRegistry.d.ts.map +1 -0
- package/dist/input/InputHandler.d.ts +8 -4
- package/dist/input/InputHandler.d.ts.map +1 -1
- package/dist/input/InputRuleRegistry.d.ts +9 -0
- package/dist/input/InputRuleRegistry.d.ts.map +1 -0
- package/dist/input/KeyboardHandler.d.ts +22 -5
- package/dist/input/KeyboardHandler.d.ts.map +1 -1
- package/dist/input/Keymap.d.ts +11 -0
- package/dist/input/Keymap.d.ts.map +1 -1
- package/dist/input/KeymapRegistry.d.ts +19 -0
- package/dist/input/KeymapRegistry.d.ts.map +1 -0
- package/dist/input/LegacyHTMLNormalizer.d.ts +18 -0
- package/dist/input/LegacyHTMLNormalizer.d.ts.map +1 -0
- package/dist/input/PasteHandler.d.ts +7 -0
- package/dist/input/PasteHandler.d.ts.map +1 -1
- package/dist/model/Document.d.ts +8 -0
- package/dist/model/Document.d.ts.map +1 -1
- package/dist/model/GraphemeUtils.d.ts +20 -0
- package/dist/model/GraphemeUtils.d.ts.map +1 -0
- package/dist/model/HTMLParser.d.ts +13 -0
- package/dist/model/HTMLParser.d.ts.map +1 -1
- package/dist/model/HTMLUtils.d.ts +6 -1
- package/dist/model/HTMLUtils.d.ts.map +1 -1
- package/dist/model/NavigationUtils.d.ts +16 -0
- package/dist/model/NavigationUtils.d.ts.map +1 -0
- package/dist/model/SchemaRegistry.d.ts +0 -39
- package/dist/model/SchemaRegistry.d.ts.map +1 -1
- package/dist/model/Selection.d.ts +14 -3
- package/dist/model/Selection.d.ts.map +1 -1
- package/dist/notectl-core.mjs +2831 -2420
- package/dist/notectl-core.mjs.map +1 -1
- package/dist/notectl-core.umd.js +3616 -2013
- package/dist/notectl-core.umd.js.map +1 -1
- package/dist/plugins/Plugin.d.ts +34 -5
- package/dist/plugins/Plugin.d.ts.map +1 -1
- package/dist/plugins/PluginManager.d.ts +31 -1
- package/dist/plugins/PluginManager.d.ts.map +1 -1
- package/dist/plugins/alignment/AlignmentPlugin.d.ts.map +1 -1
- package/dist/plugins/alignment.mjs +1 -1
- package/dist/plugins/blockquote.mjs +1 -1
- package/dist/plugins/caret-navigation/CaretNavigationPlugin.d.ts +35 -0
- package/dist/plugins/caret-navigation/CaretNavigationPlugin.d.ts.map +1 -0
- package/dist/plugins/caret-navigation/index.d.ts +2 -0
- package/dist/plugins/caret-navigation/index.d.ts.map +1 -0
- package/dist/plugins/caret-navigation.mjs +5 -0
- package/dist/plugins/caret-navigation.mjs.map +1 -0
- package/dist/plugins/code-block/CodeBlockKeyboardHandlers.d.ts.map +1 -1
- package/dist/plugins/code-block/CodeBlockPlugin.d.ts.map +1 -1
- package/dist/plugins/code-block.mjs +1 -1
- package/dist/plugins/font/FontPlugin.d.ts.map +1 -1
- package/dist/plugins/font-size/FontSizeOperations.d.ts.map +1 -1
- package/dist/plugins/font-size.mjs +1 -1
- package/dist/plugins/font.mjs +1 -1
- package/dist/plugins/gap-cursor/GapCursorPlugin.d.ts +15 -0
- package/dist/plugins/gap-cursor/GapCursorPlugin.d.ts.map +1 -0
- package/dist/plugins/gap-cursor/index.d.ts +2 -0
- package/dist/plugins/gap-cursor/index.d.ts.map +1 -0
- package/dist/plugins/gap-cursor.mjs +65 -0
- package/dist/plugins/gap-cursor.mjs.map +1 -0
- package/dist/plugins/hard-break.mjs +1 -1
- package/dist/plugins/heading/BlockTypePickerRegistry.d.ts +9 -0
- package/dist/plugins/heading/BlockTypePickerRegistry.d.ts.map +1 -0
- package/dist/plugins/heading/HeadingBlockTypePicker.d.ts +14 -0
- package/dist/plugins/heading/HeadingBlockTypePicker.d.ts.map +1 -0
- package/dist/plugins/heading/HeadingCommands.d.ts +5 -0
- package/dist/plugins/heading/HeadingCommands.d.ts.map +1 -0
- package/dist/plugins/heading/HeadingInputRules.d.ts +5 -0
- package/dist/plugins/heading/HeadingInputRules.d.ts.map +1 -0
- package/dist/plugins/heading/HeadingKeyboardHandlers.d.ts +5 -0
- package/dist/plugins/heading/HeadingKeyboardHandlers.d.ts.map +1 -0
- package/dist/plugins/heading/HeadingPlugin.d.ts +1 -41
- package/dist/plugins/heading/HeadingPlugin.d.ts.map +1 -1
- package/dist/plugins/heading.mjs +1 -1
- package/dist/plugins/highlight/HighlightPlugin.d.ts.map +1 -1
- package/dist/plugins/highlight.mjs +1 -1
- package/dist/plugins/horizontal-rule/HorizontalRulePlugin.d.ts.map +1 -1
- package/dist/plugins/horizontal-rule.mjs +1 -1
- package/dist/plugins/image/ImageCommands.d.ts.map +1 -1
- package/dist/plugins/image/ImagePlugin.d.ts.map +1 -1
- package/dist/plugins/image.mjs +1 -1
- package/dist/plugins/link/LinkPlugin.d.ts.map +1 -1
- package/dist/plugins/link.mjs +1 -1
- package/dist/plugins/list/ListPlugin.d.ts +9 -0
- package/dist/plugins/list/ListPlugin.d.ts.map +1 -1
- package/dist/plugins/list.mjs +1 -1
- package/dist/plugins/print/PrintStyleCollector.d.ts.map +1 -1
- package/dist/plugins/print/PrintTypes.d.ts +5 -1
- package/dist/plugins/print/PrintTypes.d.ts.map +1 -1
- package/dist/plugins/shared/ColorMarkOperations.d.ts.map +1 -1
- package/dist/plugins/shared/ColorValidation.d.ts +7 -0
- package/dist/plugins/shared/ColorValidation.d.ts.map +1 -1
- package/dist/plugins/strikethrough/StrikethroughPlugin.d.ts.map +1 -1
- package/dist/plugins/strikethrough.mjs +1 -1
- package/dist/plugins/super-sub/SuperSubPlugin.d.ts.map +1 -1
- package/dist/plugins/super-sub.mjs +1 -1
- package/dist/plugins/table/TableCommands.d.ts.map +1 -1
- package/dist/plugins/table/TableNavigation.d.ts.map +1 -1
- package/dist/plugins/table/TablePlugin.d.ts.map +1 -1
- package/dist/plugins/table.mjs +1 -1
- package/dist/plugins/text-color/TextColorPlugin.d.ts.map +1 -1
- package/dist/plugins/text-color.mjs +1 -1
- package/dist/plugins/text-formatting/TextFormattingPlugin.d.ts.map +1 -1
- package/dist/plugins/text-formatting.mjs +1 -1
- package/dist/plugins/toolbar/ToolbarItem.d.ts.map +1 -1
- package/dist/plugins/toolbar/ToolbarLocale.d.ts +1 -0
- package/dist/plugins/toolbar/ToolbarLocale.d.ts.map +1 -1
- package/dist/plugins/toolbar/ToolbarOverflowBehavior.d.ts +23 -0
- package/dist/plugins/toolbar/ToolbarOverflowBehavior.d.ts.map +1 -0
- package/dist/plugins/toolbar/ToolbarOverflowController.d.ts +56 -0
- package/dist/plugins/toolbar/ToolbarOverflowController.d.ts.map +1 -0
- package/dist/plugins/toolbar/ToolbarPlugin.d.ts +17 -0
- package/dist/plugins/toolbar/ToolbarPlugin.d.ts.map +1 -1
- package/dist/plugins/toolbar/ToolbarRegistry.d.ts +12 -0
- package/dist/plugins/toolbar/ToolbarRegistry.d.ts.map +1 -0
- package/dist/plugins/toolbar.mjs +2 -2
- package/dist/state/EditorState.d.ts.map +1 -1
- package/dist/state/History.d.ts.map +1 -1
- package/dist/state/ReadonlyGuard.d.ts +6 -0
- package/dist/state/ReadonlyGuard.d.ts.map +1 -0
- package/dist/state/SelectionTransactions.d.ts +10 -0
- package/dist/state/SelectionTransactions.d.ts.map +1 -0
- package/dist/state/Transaction.d.ts +4 -0
- package/dist/state/Transaction.d.ts.map +1 -1
- package/dist/test/TestUtils.d.ts +23 -0
- package/dist/test/TestUtils.d.ts.map +1 -1
- package/dist/view/CaretNavigation.d.ts +48 -0
- package/dist/view/CaretNavigation.d.ts.map +1 -0
- package/dist/view/CursorWrapper.d.ts +19 -0
- package/dist/view/CursorWrapper.d.ts.map +1 -0
- package/dist/view/DomPointUtils.d.ts +20 -0
- package/dist/view/DomPointUtils.d.ts.map +1 -0
- package/dist/view/EditorView.d.ts +45 -0
- package/dist/view/EditorView.d.ts.map +1 -1
- package/dist/view/MarkRendering.d.ts +7 -0
- package/dist/view/MarkRendering.d.ts.map +1 -0
- package/dist/view/NodeViewRegistry.d.ts +9 -0
- package/dist/view/NodeViewRegistry.d.ts.map +1 -0
- package/dist/view/Platform.d.ts +29 -0
- package/dist/view/Platform.d.ts.map +1 -0
- package/dist/view/Reconciler.d.ts +4 -0
- package/dist/view/Reconciler.d.ts.map +1 -1
- package/dist/view/SelectionSync.d.ts +2 -0
- package/dist/view/SelectionSync.d.ts.map +1 -1
- package/dist/view/ViewMovementCommands.d.ts +40 -0
- package/dist/view/ViewMovementCommands.d.ts.map +1 -0
- package/package.json +10 -2
- package/dist/chunks/ColorNames-iaWsSZx1.mjs +0 -35
- package/dist/chunks/ColorNames-iaWsSZx1.mjs.map +0 -1
- package/dist/chunks/ColorValidation-Dyy4Bye8.mjs +0 -140
- package/dist/chunks/ColorValidation-Dyy4Bye8.mjs.map +0 -1
- package/dist/chunks/Commands-CSpSwGXv.mjs +0 -461
- package/dist/chunks/Commands-CSpSwGXv.mjs.map +0 -1
- package/dist/chunks/HTMLUtils-0wvCRvJc.mjs +0 -7
- package/dist/chunks/HTMLUtils-0wvCRvJc.mjs.map +0 -1
- package/dist/chunks/Selection-D5ZjXoB7.mjs +0 -44
- package/dist/chunks/Selection-D5ZjXoB7.mjs.map +0 -1
- package/dist/chunks/ToolbarItem-ugDymuXi.mjs +0 -7
- package/dist/chunks/ToolbarItem-ugDymuXi.mjs.map +0 -1
- package/dist/chunks/ToolbarPlugin-DY2xaJiu.mjs +0 -368
- package/dist/chunks/ToolbarPlugin-DY2xaJiu.mjs.map +0 -1
- package/dist/chunks/index-BAk1EG1x.mjs.map +0 -1
- package/dist/chunks/index-BRYzYOYC.mjs.map +0 -1
- package/dist/chunks/index-BSFLNveF.mjs.map +0 -1
- package/dist/chunks/index-BYgspns5.mjs.map +0 -1
- package/dist/chunks/index-B_3qDrUN.mjs +0 -64
- package/dist/chunks/index-B_3qDrUN.mjs.map +0 -1
- package/dist/chunks/index-Bsp4LC5t.mjs.map +0 -1
- package/dist/chunks/index-Ct0ivLhO.mjs.map +0 -1
- package/dist/chunks/index-CxiWyUho.mjs.map +0 -1
- package/dist/chunks/index-D3CQWJiw.mjs.map +0 -1
- package/dist/chunks/index-DC1EK22F.mjs.map +0 -1
- package/dist/chunks/index-Dh76rR13.mjs +0 -196
- package/dist/chunks/index-Dh76rR13.mjs.map +0 -1
- package/dist/chunks/index-o6hDR07y.mjs.map +0 -1
- package/dist/chunks/index-uTnc9y7M.mjs.map +0 -1
- package/dist/input/SourceNormalizer.d.ts +0 -7
- package/dist/input/SourceNormalizer.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-tBDVaSjG.mjs","sources":["../../src/editor/styles/list.ts","../../src/plugins/list/ListLocale.ts","../../src/plugins/list/ListPlugin.ts"],"sourcesContent":["/** Width of the list marker / checkbox area in pixels. */\nexport const LIST_MARKER_WIDTH = 24;\n\n/** List styles — bullet, ordered, checklist items. */\nexport const LIST_CSS = `\n/* List Wrappers — suppress native markers, we use ::before pseudo-elements */\n.notectl-list {\n\tlist-style: none;\n\tmargin: 0;\n\tpadding: 0;\n}\n\n/* Ordered List — each <ol> wrapper resets the counter */\n.notectl-list--ordered {\n\tcounter-reset: notectl-ordered;\n}\n\n/* List Items */\n.notectl-list-item {\n\tmargin: 0;\n\tpadding: 2px 0 2px ${LIST_MARKER_WIDTH}px;\n\tmin-height: 1.6em;\n\tposition: relative;\n}\n\n.notectl-list-item::before {\n\tposition: absolute;\n\tleft: 0;\n\tdisplay: inline-block;\n\twidth: ${LIST_MARKER_WIDTH}px;\n\ttext-align: center;\n}\n\n/* Bullet List */\n.notectl-list-item--bullet::before {\n\tcontent: '\\\\2022';\n\tcolor: var(--notectl-fg);\n}\n\n/* Ordered List — counter increment per item */\n.notectl-list-item--ordered {\n\tcounter-increment: notectl-ordered;\n}\n\n.notectl-list-item--ordered::before {\n\tcontent: counter(notectl-ordered) '.';\n\tcolor: var(--notectl-fg);\n\tfont-size: 14px;\n}\n\n/* Checklist */\n.notectl-list-item--checklist::before {\n\tcontent: '\\\\2610';\n\tfont-size: 16px;\n\tcolor: var(--notectl-fg-muted);\n\tcursor: pointer;\n}\n\n.notectl-list-item--checklist[data-checked=\"true\"]::before {\n\tcontent: '\\\\2611';\n\tcolor: var(--notectl-success);\n}\n\n.notectl-list-item--checklist[data-checked=\"true\"] {\n\tcolor: var(--notectl-fg-muted);\n\ttext-decoration: line-through;\n}\n`;\n","/**\n * Locale interface and default English locale for the ListPlugin.\n */\n\n// --- Locale Interface ---\n\nexport interface ListLocale {\n\treadonly bulletList: string;\n\treadonly numberedList: string;\n\treadonly checklist: string;\n}\n\n// --- Default English Locale ---\n\nexport const LIST_LOCALE_EN: ListLocale = {\n\tbulletList: 'Bullet List',\n\tnumberedList: 'Numbered List',\n\tchecklist: 'Checklist',\n};\n\n// --- German Locale ---\n\nexport const LIST_LOCALE_DE: ListLocale = {\n\tbulletList: 'Aufzählung',\n\tnumberedList: 'Nummerierte Liste',\n\tchecklist: 'Checkliste',\n};\n\n// --- Spanish Locale ---\n\nexport const LIST_LOCALE_ES: ListLocale = {\n\tbulletList: 'Lista con viñetas',\n\tnumberedList: 'Lista numerada',\n\tchecklist: 'Lista de verificación',\n};\n\n// --- French Locale ---\n\nexport const LIST_LOCALE_FR: ListLocale = {\n\tbulletList: 'Liste à puces',\n\tnumberedList: 'Liste numérotée',\n\tchecklist: 'Liste de contrôle',\n};\n\n// --- Chinese (Simplified) Locale ---\n\nexport const LIST_LOCALE_ZH: ListLocale = {\n\tbulletList: '无序列表',\n\tnumberedList: '有序列表',\n\tchecklist: '清单',\n};\n\n// --- Russian Locale ---\n\nexport const LIST_LOCALE_RU: ListLocale = {\n\tbulletList: 'Маркированный список',\n\tnumberedList: 'Нумерованный список',\n\tchecklist: 'Чек-лист',\n};\n\n// --- Arabic Locale ---\n\nexport const LIST_LOCALE_AR: ListLocale = {\n\tbulletList: 'قائمة نقطية',\n\tnumberedList: 'قائمة مرقمة',\n\tchecklist: 'قائمة تحقق',\n};\n\n// --- Hindi Locale ---\n\nexport const LIST_LOCALE_HI: ListLocale = {\n\tbulletList: 'बुलेट सूची',\n\tnumberedList: 'क्रमांकित सूची',\n\tchecklist: 'चेकलिस्ट',\n};\n\n// --- Locale Map ---\n\nexport const LIST_LOCALES: Record<string, ListLocale> = {\n\ten: LIST_LOCALE_EN,\n\tde: LIST_LOCALE_DE,\n\tes: LIST_LOCALE_ES,\n\tfr: LIST_LOCALE_FR,\n\tzh: LIST_LOCALE_ZH,\n\tru: LIST_LOCALE_RU,\n\tar: LIST_LOCALE_AR,\n\thi: LIST_LOCALE_HI,\n};\n","/**\n * ListPlugin: registers ordered, unordered, and checklist block types\n * with NodeSpecs, toggle commands, indent/outdent (Tab/Shift-Tab),\n * input rules, and toolbar buttons.\n *\n * List items are modeled as flat blocks with a `listType` and `indent` attribute,\n * allowing simple nesting representation without deep tree structures.\n */\n\nimport { LIST_CSS, LIST_MARKER_WIDTH } from '../../editor/styles/list.js';\nimport { resolvePluginLocale } from '../../i18n/resolvePluginLocale.js';\nimport { isNodeOfType } from '../../model/AttrRegistry.js';\nimport { generateBlockId, getBlockText } from '../../model/Document.js';\nimport { createBlockElement } from '../../model/NodeSpec.js';\nimport {\n\tcreateCollapsedSelection,\n\tisCollapsed,\n\tisGapCursor,\n\tisNodeSelection,\n} from '../../model/Selection.js';\nimport { type BlockId, blockId, nodeType } from '../../model/TypeBrands.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { Plugin, PluginContext } from '../Plugin.js';\nimport { LIST_LOCALES, type ListLocale } from './ListLocale.js';\n\n// --- Attribute Registry Augmentation ---\n\nexport type ListType = 'bullet' | 'ordered' | 'checklist';\n\ndeclare module '../../model/AttrRegistry.js' {\n\tinterface NodeAttrRegistry {\n\t\tlist_item: { listType: ListType; indent: number; checked: boolean };\n\t}\n}\n\n// --- Configuration ---\n\nexport interface ListConfig {\n\t/** Which list types to enable. Defaults to all. */\n\treadonly types: readonly ListType[];\n\t/** Maximum indent depth. Defaults to 4. */\n\treadonly maxIndent: number;\n\t/** When true, a separator is rendered after the last list toolbar item. */\n\treadonly separatorAfter?: boolean;\n\t/**\n\t * When true, checklist checkboxes remain interactive even in read-only mode.\n\t * Defaults to false (checkboxes are fully read-only).\n\t */\n\treadonly interactiveCheckboxes?: boolean;\n\treadonly locale?: ListLocale;\n}\n\nconst DEFAULT_CONFIG: ListConfig = {\n\ttypes: ['bullet', 'ordered', 'checklist'],\n\tmaxIndent: 4,\n};\n\n// --- List Type Metadata ---\n\ninterface ListTypeDefinition {\n\treadonly type: ListType;\n\treadonly label: string;\n\treadonly icon: string;\n\treadonly inputPattern: RegExp;\n\treadonly inputPrefix: string;\n}\n\nconst BULLET_LIST_ICON =\n\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M4 10.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5zm0-6c-.83 0-1.5.67-1.5 1.5S3.17 7.5 4 7.5 5.5 6.83 5.5 6 4.83 4.5 4 4.5zm0 12c-.83 0-1.5.68-1.5 1.5s.68 1.5 1.5 1.5 1.5-.68 1.5-1.5-.67-1.5-1.5-1.5zM7 19h14v-2H7v2zm0-6h14v-2H7v2zm0-8v2h14V5H7z\"/></svg>';\nconst NUMBERED_LIST_ICON =\n\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M2 17h2v.5H3v1h1v.5H2v1h3v-4H2v1zm1-9h1V4H2v1h1v3zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2v1zm5-6v2h14V5H7zm0 14h14v-2H7v2zm0-6h14v-2H7v2z\"/></svg>';\nconst CHECKLIST_ICON =\n\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M22 7h-9v2h9V7zm0 8h-9v2h9v-2zM5.54 11L2 7.46l1.41-1.41 2.12 2.12 4.24-4.24 1.41 1.41L5.54 11zm0 8L2 15.46l1.41-1.41 2.12 2.12 4.24-4.24 1.41 1.41L5.54 19z\"/></svg>';\n\nconst LIST_TYPE_DEFINITIONS: readonly ListTypeDefinition[] = [\n\t{\n\t\ttype: 'bullet',\n\t\tlabel: 'Bullet List',\n\t\ticon: BULLET_LIST_ICON,\n\t\tinputPattern: /^[-*] $/,\n\t\tinputPrefix: '- ',\n\t},\n\t{\n\t\ttype: 'ordered',\n\t\tlabel: 'Numbered List',\n\t\ticon: NUMBERED_LIST_ICON,\n\t\tinputPattern: /^\\d+\\. $/,\n\t\tinputPrefix: '1. ',\n\t},\n\t{\n\t\ttype: 'checklist',\n\t\tlabel: 'Checklist',\n\t\ticon: CHECKLIST_ICON,\n\t\tinputPattern: /^\\[[ x]] $/,\n\t\tinputPrefix: '[ ] ',\n\t},\n];\n\n// --- Plugin ---\n\nexport class ListPlugin implements Plugin {\n\treadonly id = 'list';\n\treadonly name = 'List';\n\treadonly priority = 35;\n\n\tprivate readonly config: ListConfig;\n\tprivate locale!: ListLocale;\n\tprivate context: PluginContext | null = null;\n\tprivate checkboxClickHandler: ((e: MouseEvent) => void) | null = null;\n\n\tconstructor(config?: Partial<ListConfig>) {\n\t\tthis.config = { ...DEFAULT_CONFIG, ...config };\n\t}\n\n\tinit(context: PluginContext): void {\n\t\tthis.context = context;\n\t\tthis.locale = resolvePluginLocale(LIST_LOCALES, context, this.config.locale);\n\t\tcontext.registerStyleSheet(LIST_CSS);\n\t\tthis.registerNodeSpec(context);\n\t\tthis.registerCommands(context);\n\t\tthis.registerKeymaps(context);\n\t\tthis.registerInputRules(context);\n\t\tthis.registerToolbarItems(context);\n\t\tthis.registerCheckboxClickHandler(context);\n\t}\n\n\tdestroy(): void {\n\t\tif (this.checkboxClickHandler && this.context) {\n\t\t\tconst container: HTMLElement = this.context.getContainer();\n\t\t\tcontainer.removeEventListener('mousedown', this.checkboxClickHandler);\n\t\t}\n\t\tthis.checkboxClickHandler = null;\n\t\tthis.context = null;\n\t}\n\n\tprivate registerNodeSpec(context: PluginContext): void {\n\t\tcontext.registerNodeSpec({\n\t\t\ttype: 'list_item',\n\t\t\tgroup: 'block',\n\t\t\tcontent: { allow: ['text'] },\n\t\t\tattrs: {\n\t\t\t\tlistType: { default: 'bullet' },\n\t\t\t\tindent: { default: 0 },\n\t\t\t\tchecked: { default: false },\n\t\t\t},\n\t\t\ttoDOM(node) {\n\t\t\t\tconst listType = node.attrs?.listType ?? 'bullet';\n\t\t\t\tconst indent = node.attrs?.indent ?? 0;\n\t\t\t\tconst checked = node.attrs?.checked ?? false;\n\n\t\t\t\tconst li = createBlockElement('li', node.id);\n\t\t\t\tli.setAttribute('role', 'listitem');\n\t\t\t\tli.setAttribute('data-list-type', listType);\n\t\t\t\tli.setAttribute('data-indent', String(indent));\n\t\t\t\tli.className = `notectl-list-item notectl-list-item--${listType}`;\n\n\t\t\t\tif (indent > 0) {\n\t\t\t\t\tli.style.marginLeft = `${indent * LIST_MARKER_WIDTH}px`;\n\t\t\t\t}\n\n\t\t\t\tif (listType === 'checklist') {\n\t\t\t\t\tli.setAttribute('data-checked', String(checked));\n\t\t\t\t\tli.setAttribute('aria-checked', String(checked));\n\t\t\t\t}\n\t\t\t\tli.setAttribute('aria-level', String(indent + 1));\n\n\t\t\t\treturn li;\n\t\t\t},\n\t\t\twrapper(node) {\n\t\t\t\tconst listType = node.attrs?.listType ?? 'bullet';\n\t\t\t\tconst tag = listType === 'ordered' ? 'ol' : 'ul';\n\t\t\t\treturn {\n\t\t\t\t\ttag,\n\t\t\t\t\tkey: `list-${listType}`,\n\t\t\t\t\tclassName: `notectl-list notectl-list--${listType}`,\n\t\t\t\t\tattrs: { role: 'list' },\n\t\t\t\t};\n\t\t\t},\n\t\t\ttoHTML(_node, content) {\n\t\t\t\treturn `<li>${content || '<br>'}</li>`;\n\t\t\t},\n\t\t\tparseHTML: [{ tag: 'li' }],\n\t\t\tsanitize: { tags: ['ul', 'ol', 'li'] },\n\t\t});\n\t}\n\n\tprivate registerCommands(context: PluginContext): void {\n\t\tconst enabledTypes = this.getEnabledTypes();\n\n\t\tfor (const def of enabledTypes) {\n\t\t\tcontext.registerCommand(`toggleList:${def.type}`, () => {\n\t\t\t\treturn this.toggleList(context, def.type);\n\t\t\t});\n\t\t}\n\n\t\tcontext.registerCommand('indentListItem', () => {\n\t\t\treturn this.indent(context);\n\t\t});\n\n\t\tcontext.registerCommand('outdentListItem', () => {\n\t\t\treturn this.outdent(context);\n\t\t});\n\n\t\tif (this.config.types.includes('checklist')) {\n\t\t\tcontext.registerCommand('toggleChecklistItem', () => this.toggleChecked(context), {\n\t\t\t\treadonlyAllowed: true,\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate registerKeymaps(context: PluginContext): void {\n\t\tcontext.registerKeymap({\n\t\t\tEnter: () => this.handleEnter(context),\n\t\t\tBackspace: () => this.handleBackspace(context),\n\t\t\tTab: () => this.indent(context),\n\t\t\t'Shift-Tab': () => this.outdent(context),\n\t\t});\n\t}\n\n\tprivate registerInputRules(context: PluginContext): void {\n\t\tconst enabledTypes = this.getEnabledTypes();\n\n\t\tfor (const def of enabledTypes) {\n\t\t\tcontext.registerInputRule({\n\t\t\t\tpattern: def.inputPattern,\n\t\t\t\thandler: (state, match, start, _end) => {\n\t\t\t\t\tconst sel = state.selection;\n\t\t\t\t\tif (isNodeSelection(sel) || isGapCursor(sel)) return null;\n\t\t\t\t\tif (!isCollapsed(sel)) return null;\n\n\t\t\t\t\tconst block = state.getBlock(sel.anchor.blockId);\n\t\t\t\t\tif (!block || block.type !== 'paragraph') return null;\n\n\t\t\t\t\tconst matchStr = match[0] ?? '';\n\t\t\t\t\tconst matchLen = matchStr.length;\n\t\t\t\t\tconst attrs: Record<string, string | number | boolean> = {\n\t\t\t\t\t\tlistType: def.type,\n\t\t\t\t\t\tindent: 0,\n\t\t\t\t\t};\n\t\t\t\t\tif (def.type === 'checklist') {\n\t\t\t\t\t\tattrs.checked = matchStr.includes('[x]');\n\t\t\t\t\t}\n\n\t\t\t\t\treturn state\n\t\t\t\t\t\t.transaction('input')\n\t\t\t\t\t\t.deleteTextAt(sel.anchor.blockId, start, start + matchLen)\n\t\t\t\t\t\t.setBlockType(sel.anchor.blockId, nodeType('list_item'), attrs)\n\t\t\t\t\t\t.setSelection(createCollapsedSelection(sel.anchor.blockId, 0))\n\t\t\t\t\t\t.build();\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate getListLabel(type: ListType): string {\n\t\tconst labels: Record<ListType, string> = {\n\t\t\tbullet: this.locale.bulletList,\n\t\t\tordered: this.locale.numberedList,\n\t\t\tchecklist: this.locale.checklist,\n\t\t};\n\t\treturn labels[type];\n\t}\n\n\tprivate registerToolbarItems(context: PluginContext): void {\n\t\tconst enabledTypes = this.getEnabledTypes();\n\t\tconst lastType = enabledTypes.at(-1);\n\n\t\tfor (const def of enabledTypes) {\n\t\t\tcontext.registerToolbarItem({\n\t\t\t\tid: `list-${def.type}`,\n\t\t\t\tgroup: 'block',\n\t\t\t\ticon: def.icon,\n\t\t\t\tlabel: this.getListLabel(def.type),\n\t\t\t\tcommand: `toggleList:${def.type}`,\n\t\t\t\tpriority: def.type === 'bullet' ? 70 : def.type === 'ordered' ? 71 : 72,\n\t\t\t\tseparatorAfter: this.config.separatorAfter && def === lastType,\n\t\t\t\tisActive: (state) => this.isListActive(state, def.type),\n\t\t\t});\n\t\t}\n\t}\n\n\t// --- Command Implementations ---\n\n\tprivate toggleList(context: PluginContext, listType: ListType): boolean {\n\t\tconst state = context.getState();\n\t\tconst sel = state.selection;\n\t\tif (isNodeSelection(sel) || isGapCursor(sel)) return false;\n\t\tconst block = state.getBlock(sel.anchor.blockId);\n\t\tif (!block) return false;\n\n\t\t// If already this list type, convert back to paragraph\n\t\tif (block.type === 'list_item' && block.attrs?.listType === listType) {\n\t\t\tconst tr = state\n\t\t\t\t.transaction('command')\n\t\t\t\t.setBlockType(sel.anchor.blockId, nodeType('paragraph'))\n\t\t\t\t.setSelection(sel)\n\t\t\t\t.build();\n\t\t\tcontext.dispatch(tr);\n\t\t\treturn true;\n\t\t}\n\n\t\t// Convert to list item\n\t\tconst attrs: Record<string, string | number | boolean> = {\n\t\t\tlistType,\n\t\t\tindent: isNodeOfType(block, 'list_item') ? block.attrs.indent : 0,\n\t\t};\n\t\tif (listType === 'checklist') {\n\t\t\tattrs.checked = false;\n\t\t}\n\n\t\tconst tr = state\n\t\t\t.transaction('command')\n\t\t\t.setBlockType(sel.anchor.blockId, nodeType('list_item'), attrs)\n\t\t\t.setSelection(sel)\n\t\t\t.build();\n\t\tcontext.dispatch(tr);\n\t\treturn true;\n\t}\n\n\tprivate indent(context: PluginContext): boolean {\n\t\tconst state = context.getState();\n\t\tif (isNodeSelection(state.selection) || isGapCursor(state.selection)) return false;\n\t\tconst block = state.getBlock(state.selection.anchor.blockId);\n\t\tif (!block || !isNodeOfType(block, 'list_item')) return false;\n\n\t\tif (block.attrs.indent >= this.config.maxIndent) return false;\n\n\t\treturn this.setIndent(context, state, block.attrs.indent + 1);\n\t}\n\n\tprivate outdent(context: PluginContext): boolean {\n\t\tconst state = context.getState();\n\t\tif (isNodeSelection(state.selection) || isGapCursor(state.selection)) return false;\n\t\tconst block = state.getBlock(state.selection.anchor.blockId);\n\t\tif (!block || !isNodeOfType(block, 'list_item')) return false;\n\n\t\tif (block.attrs.indent <= 0) return false;\n\n\t\treturn this.setIndent(context, state, block.attrs.indent - 1);\n\t}\n\n\tprivate setIndent(context: PluginContext, state: EditorState, indent: number): boolean {\n\t\tconst sel = state.selection;\n\t\tif (isNodeSelection(sel) || isGapCursor(sel)) return false;\n\t\tconst block = state.getBlock(sel.anchor.blockId);\n\t\tif (!block) return false;\n\n\t\tconst attrs = { ...block.attrs, indent } as Record<string, string | number | boolean>;\n\n\t\tconst tr = state\n\t\t\t.transaction('command')\n\t\t\t.setBlockType(sel.anchor.blockId, nodeType('list_item'), attrs)\n\t\t\t.setSelection(sel)\n\t\t\t.build();\n\t\tcontext.dispatch(tr);\n\t\treturn true;\n\t}\n\n\tprivate toggleChecked(context: PluginContext, targetId?: BlockId): boolean {\n\t\tif (context.isReadOnly() && !this.config.interactiveCheckboxes) return false;\n\n\t\tconst state = context.getState();\n\t\tconst bid: BlockId | null =\n\t\t\ttargetId ??\n\t\t\t(isNodeSelection(state.selection) || isGapCursor(state.selection)\n\t\t\t\t? null\n\t\t\t\t: state.selection.anchor.blockId);\n\t\tif (!bid) return false;\n\n\t\tconst block = state.getBlock(bid);\n\t\tif (!block || block.type !== 'list_item' || block.attrs?.listType !== 'checklist') {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst checked: boolean = !block.attrs?.checked;\n\t\tconst attrs = { ...block.attrs, checked } as Record<string, string | number | boolean>;\n\n\t\tconst tr = state\n\t\t\t.transaction('command')\n\t\t\t.setBlockType(bid, nodeType('list_item'), attrs)\n\t\t\t.setSelection(state.selection)\n\t\t\t.build();\n\t\tcontext.dispatch(tr);\n\t\treturn true;\n\t}\n\n\t/**\n\t * Handles Backspace at the start of a list item.\n\t * Converts the list item back to a paragraph, preserving text.\n\t */\n\tprivate handleBackspace(context: PluginContext): boolean {\n\t\tconst state = context.getState();\n\t\tconst sel = state.selection;\n\t\tif (isNodeSelection(sel) || isGapCursor(sel)) return false;\n\t\tif (!isCollapsed(sel)) return false;\n\n\t\tconst block = state.getBlock(sel.anchor.blockId);\n\t\tif (!block || block.type !== 'list_item') return false;\n\t\tif (sel.anchor.offset !== 0) return false;\n\n\t\tconst tr = state\n\t\t\t.transaction('input')\n\t\t\t.setBlockType(sel.anchor.blockId, nodeType('paragraph'))\n\t\t\t.setSelection(sel)\n\t\t\t.build();\n\t\tcontext.dispatch(tr);\n\t\treturn true;\n\t}\n\n\t/**\n\t * Handles Enter inside a list item.\n\t * Empty item → exit list (convert to paragraph).\n\t * Non-empty item → split and create a new list item with the same type.\n\t */\n\tprivate handleEnter(context: PluginContext): boolean {\n\t\tconst state = context.getState();\n\t\tconst sel = state.selection;\n\t\tif (isNodeSelection(sel) || isGapCursor(sel)) return false;\n\t\tif (!isCollapsed(sel)) return false;\n\n\t\tconst block = state.getBlock(sel.anchor.blockId);\n\t\tif (!block || block.type !== 'list_item') return false;\n\n\t\tconst text = getBlockText(block);\n\n\t\tif (text === '') {\n\t\t\t// Empty list item → convert to paragraph (exit list)\n\t\t\tconst tr = state\n\t\t\t\t.transaction('input')\n\t\t\t\t.setBlockType(sel.anchor.blockId, nodeType('paragraph'))\n\t\t\t\t.setSelection(sel)\n\t\t\t\t.build();\n\t\t\tcontext.dispatch(tr);\n\t\t\treturn true;\n\t\t}\n\n\t\t// Non-empty → split block and set new block to same list type\n\t\tconst newBlockId = generateBlockId();\n\t\tconst attrs: Record<string, string | number | boolean> = {\n\t\t\tlistType: isNodeOfType(block, 'list_item') ? block.attrs.listType : 'bullet',\n\t\t\tindent: isNodeOfType(block, 'list_item') ? block.attrs.indent : 0,\n\t\t};\n\t\tif (attrs.listType === 'checklist') {\n\t\t\tattrs.checked = false;\n\t\t}\n\n\t\tconst tr = state\n\t\t\t.transaction('input')\n\t\t\t.splitBlock(sel.anchor.blockId, sel.anchor.offset, newBlockId)\n\t\t\t.setBlockType(newBlockId, nodeType('list_item'), attrs)\n\t\t\t.setSelection(createCollapsedSelection(newBlockId, 0))\n\t\t\t.build();\n\t\tcontext.dispatch(tr);\n\t\treturn true;\n\t}\n\n\t// --- Checkbox Click Handling ---\n\n\tprivate registerCheckboxClickHandler(context: PluginContext): void {\n\t\tif (!this.config.types.includes('checklist')) return;\n\n\t\tthis.checkboxClickHandler = (e: MouseEvent) => {\n\t\t\tif (context.isReadOnly() && !this.config.interactiveCheckboxes) return;\n\n\t\t\tconst target: EventTarget | null = e.target;\n\t\t\tif (!(target instanceof HTMLElement)) return;\n\n\t\t\tconst li: HTMLElement | null = target.closest('.notectl-list-item--checklist');\n\t\t\tif (!li) return;\n\n\t\t\tconst rect: DOMRect = li.getBoundingClientRect();\n\t\t\tif (e.clientX - rect.left >= LIST_MARKER_WIDTH) return;\n\n\t\t\te.preventDefault();\n\n\t\t\tconst bid: string | null = li.getAttribute('data-block-id');\n\t\t\tif (!bid) return;\n\n\t\t\tthis.toggleChecked(context, blockId(bid));\n\t\t};\n\n\t\tconst container: HTMLElement = context.getContainer();\n\t\tcontainer.addEventListener('mousedown', this.checkboxClickHandler);\n\t}\n\n\t// --- Helpers ---\n\n\tprivate isListActive(state: EditorState, listType: ListType): boolean {\n\t\tif (isNodeSelection(state.selection) || isGapCursor(state.selection)) return false;\n\t\tconst block = state.getBlock(state.selection.anchor.blockId);\n\t\treturn block?.type === 'list_item' && block.attrs?.listType === listType;\n\t}\n\n\tprivate getEnabledTypes(): readonly ListTypeDefinition[] {\n\t\treturn LIST_TYPE_DEFINITIONS.filter((def) => this.config.types.includes(def.type));\n\t}\n}\n"],"names":["LIST_LOCALE_EN","bulletList","numberedList","checklist","LIST_LOCALES","en","de","es","fr","zh","ru","ar","hi","DEFAULT_CONFIG","types","maxIndent","LIST_TYPE_DEFINITIONS","type","label","icon","inputPattern","inputPrefix","ListPlugin","id","name","priority","config","locale","context","checkboxClickHandler","this","resolvePluginLocale","registerStyleSheet","registerNodeSpec","registerCommands","registerKeymaps","registerInputRules","registerToolbarItems","registerCheckboxClickHandler","destroy","getContainer","removeEventListener","group","content","allow","attrs","listType","default","indent","checked","node","li","createBlockElement","setAttribute","String","className","style","marginLeft","tag","key","role","toHTML","_node","parseHTML","sanitize","tags","enabledTypes","getEnabledTypes","def","registerCommand","toggleList","outdent","includes","toggleChecked","readonlyAllowed","registerKeymap","Enter","handleEnter","Backspace","handleBackspace","Tab","registerInputRule","pattern","handler","state","match","start","_end","sel","selection","isNodeSelection","isGapCursor","isCollapsed","block","getBlock","anchor","blockId","matchStr","matchLen","length","transaction","deleteTextAt","setBlockType","nodeType","setSelection","createCollapsedSelection","build","bullet","ordered","lastType","at","registerToolbarItem","getListLabel","command","separatorAfter","isActive","isListActive","getState","tr","dispatch","isNodeOfType","setIndent","targetId","isReadOnly","interactiveCheckboxes","bid","offset","getBlockText","newBlockId","generateBlockId","splitBlock","e","target","HTMLElement","closest","rect","getBoundingClientRect","clientX","left","preventDefault","getAttribute","addEventListener","filter"],"mappings":";;;;;;AACO,MCaMA,IAA6B,EACzCC,YAAY,eACZC,cAAc,iBACdC,WAAW,YAAA,GA6DCC,IAA2C,EACvDC,IAAIL,GACJM,IA1DyC,EACzCL,YAAY,cACZC,cAAc,qBACdC,WAAW,aAAA,GAwDXI,IAnDyC,EACzCN,YAAY,qBACZC,cAAc,kBACdC,WAAW,wBAAA,GAiDXK,IA5CyC,EACzCP,YAAY,iBACZC,cAAc,mBACdC,WAAW,uBA0CXM,IArCyC,EACzCR,YAAY,QACZC,cAAc,QACdC,WAAW,KAAA,GAmCXO,IA9ByC,EACzCT,YAAY,wBACZC,cAAc,uBACdC,WAAW,WAAA,GA4BXQ,IAvByC,EACzCV,YAAY,eACZC,cAAc,eACdC,WAAW,aAAA,GAqBXS,IAhByC,EACzCX,YAAY,cACZC,cAAc,kBACdC,WAAW,WAAA,EAAA,GCrBNU,IAA6B,EAClCC,OAAO,CAAC,UAAU,WAAW,WAAA,GAC7BC,WAAW,EAAA,GAoBNC,IAAuD,CAC5D,EACCC,MAAM,UACNC,OAAO,eACPC,MAVD,iWAWCC,cAAc,WACdC,aAAa,KAAA,GAEd,EACCJ,MAAM,WACNC,OAAO,iBACPC,MAfD,4NAgBCC,cAAc,YACdC,aAAa,MAAA,GAEd,EACCJ,MAAM,aACNC,OAAO,aACPC,MApBD,6OAqBCC,cAAc,cACdC,aAAa;AAMR,MAAMC,EAAAA;AAAAA,EACHC,KAAK;AAAA,EACLC,OAAO;AAAA,EACPC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AM0D,SAASJ,GAAInD,IAAAA,CAAAA;AAAAA,EAC7E;AAAA;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolvePluginLocale-B4w1OkPy.mjs","sources":["../../src/plugins/Plugin.ts","../../src/i18n/LocaleService.ts","../../src/i18n/resolvePluginLocale.ts"],"sourcesContent":["/**\n * Plugin system types for the Notectl editor.\n */\n\nimport type { DecorationSet } from '../decorations/Decoration.js';\nimport type { InputRule } from '../input/InputRule.js';\nimport type { Keymap } from '../input/Keymap.js';\nimport type {
|
|
1
|
+
{"version":3,"file":"resolvePluginLocale-B4w1OkPy.mjs","sources":["../../src/plugins/Plugin.ts","../../src/i18n/LocaleService.ts","../../src/i18n/resolvePluginLocale.ts"],"sourcesContent":["/**\n * Plugin system types for the Notectl editor.\n */\n\nimport type { DecorationSet } from '../decorations/Decoration.js';\nimport type { FileHandler } from '../input/FileHandlerRegistry.js';\nimport type { FileHandlerRegistry } from '../input/FileHandlerRegistry.js';\nimport type { InputRule } from '../input/InputRule.js';\nimport type { InputRuleRegistry } from '../input/InputRuleRegistry.js';\nimport type { Keymap, KeymapOptions } from '../input/Keymap.js';\nimport type { KeymapRegistry } from '../input/KeymapRegistry.js';\nimport type { InlineNodeSpec } from '../model/InlineNodeSpec.js';\nimport type { MarkSpec } from '../model/MarkSpec.js';\nimport type { NodeSpec } from '../model/NodeSpec.js';\nimport type { SchemaRegistry } from '../model/SchemaRegistry.js';\nimport type { EditorState } from '../state/EditorState.js';\nimport type { Transaction } from '../state/Transaction.js';\nimport type { NodeViewFactory } from '../view/NodeView.js';\nimport type { NodeViewRegistry } from '../view/NodeViewRegistry.js';\nimport type { BlockTypePickerEntry } from './heading/BlockTypePickerEntry.js';\nimport type { BlockTypePickerRegistry } from './heading/BlockTypePickerRegistry.js';\nimport type { ToolbarItem } from './toolbar/ToolbarItem.js';\nimport type { ToolbarRegistry } from './toolbar/ToolbarRegistry.js';\n\n// --- Type-Safe Keys ---\n\n/** Type-safe event key for compile-time payload checking. */\nexport class EventKey<T> {\n\tdeclare readonly _type: T;\n\tconstructor(public readonly id: string) {}\n}\n\n/** Type-safe service key for compile-time type checking. */\nexport class ServiceKey<T> {\n\tdeclare readonly _type: T;\n\tconstructor(public readonly id: string) {}\n}\n\n// --- Command System ---\n\nexport type CommandHandler = () => boolean;\n\nexport interface CommandOptions {\n\t/** When true, the command may execute even if the editor is in read-only mode. */\n\treadonly readonlyAllowed?: boolean;\n}\n\nexport interface CommandEntry {\n\treadonly name: string;\n\treadonly handler: CommandHandler;\n\treadonly pluginId: string;\n\treadonly readonlyAllowed: boolean;\n}\n\n// --- Event System ---\n\nexport type PluginEventCallback<T = unknown> = (payload: T) => void;\n\nexport interface PluginEventBus {\n\temit<T>(key: EventKey<T>, payload: T): void;\n\ton<T>(key: EventKey<T>, callback: PluginEventCallback<T>): () => void;\n\toff<T>(key: EventKey<T>, callback: PluginEventCallback<T>): void;\n}\n\n// --- Configuration ---\n\nexport type PluginConfig = Record<string, unknown>;\n\n// --- Middleware ---\n\nexport type MiddlewareNext = (tr: Transaction) => void;\nexport type TransactionMiddleware = (\n\ttr: Transaction,\n\tstate: EditorState,\n\tnext: MiddlewareNext,\n) => void;\n\nexport interface MiddlewareOptions {\n\t/** Human-readable name for debugging and introspection. */\n\treadonly name?: string;\n\t/** Execution priority (lower values run first). Defaults to 100. */\n\treadonly priority?: number;\n}\n\n// --- Plugin Context ---\n\nexport interface PluginContext {\n\tgetState(): EditorState;\n\tdispatch(transaction: Transaction): void;\n\tgetContainer(): HTMLElement;\n\tgetPluginContainer(position: 'top' | 'bottom'): HTMLElement;\n\tregisterCommand(name: string, handler: CommandHandler, options?: CommandOptions): void;\n\texecuteCommand(name: string): boolean;\n\tgetEventBus(): PluginEventBus;\n\tregisterMiddleware(middleware: TransactionMiddleware, options?: MiddlewareOptions): void;\n\tregisterService<T>(key: ServiceKey<T>, service: T): void;\n\tgetService<T>(key: ServiceKey<T>): T | undefined;\n\tupdateConfig(config: PluginConfig): void;\n\n\t// --- Schema Extension ---\n\tregisterNodeSpec<T extends string>(spec: NodeSpec<T>): void;\n\tregisterMarkSpec<T extends string>(spec: MarkSpec<T>): void;\n\tregisterNodeView(type: string, factory: NodeViewFactory): void;\n\tregisterKeymap(keymap: Keymap, options?: KeymapOptions): void;\n\tregisterInputRule(rule: InputRule): void;\n\tregisterToolbarItem(item: ToolbarItem): void;\n\tregisterInlineNodeSpec<T extends string>(spec: InlineNodeSpec<T>): void;\n\tregisterFileHandler(pattern: string, handler: FileHandler): void;\n\tregisterBlockTypePickerEntry(entry: BlockTypePickerEntry): void;\n\tgetSchemaRegistry(): SchemaRegistry;\n\tgetKeymapRegistry(): KeymapRegistry;\n\tgetInputRuleRegistry(): InputRuleRegistry;\n\tgetFileHandlerRegistry(): FileHandlerRegistry;\n\tgetNodeViewRegistry(): NodeViewRegistry;\n\tgetToolbarRegistry(): ToolbarRegistry;\n\tgetBlockTypePickerRegistry(): BlockTypePickerRegistry;\n\n\t/** Registers a CSS string to be added to the editor's adopted stylesheets. */\n\tregisterStyleSheet(css: string): void;\n\n\t/** Returns whether the editor is currently in read-only mode. */\n\tisReadOnly(): boolean;\n\n\t/** Pushes a screen reader announcement via the editor's aria-live region. */\n\tannounce(text: string): void;\n\n\t/** Returns whether the announcer live region currently has content. */\n\thasAnnouncement(): boolean;\n}\n\n// --- Plugin Interface ---\n\nexport interface Plugin<TConfig extends Record<string, unknown> = Record<string, unknown>> {\n\treadonly id: string;\n\treadonly name: string;\n\treadonly priority?: number;\n\treadonly dependencies?: readonly string[];\n\n\tinit(context: PluginContext): void | Promise<void>;\n\tdestroy?(): void | Promise<void>;\n\tonStateChange?(oldState: EditorState, newState: EditorState, tr: Transaction): void;\n\tonConfigure?(config: TConfig): void;\n\t/** Called after ALL plugins have been initialized. */\n\tonReady?(): void | Promise<void>;\n\t/** Called when the editor's read-only mode changes. */\n\tonReadOnlyChange?(readonly: boolean): void;\n\t/**\n\t * Returns decorations for the given state.\n\t * Called after state.apply() but BEFORE reconciliation.\n\t * Plugins should cache and only recompute when needed.\n\t */\n\tdecorations?(state: EditorState, tr?: Transaction): DecorationSet;\n}\n","/**\n * Global locale service that resolves the active language.\n * Registered as a system-level service before plugin init.\n */\n\nimport { ServiceKey } from '../plugins/Plugin.js';\n\nexport class LocaleService {\n\tprivate readonly resolvedLocale: string;\n\n\tconstructor(locale: string) {\n\t\tthis.resolvedLocale =\n\t\t\tlocale === 'browser'\n\t\t\t\t? typeof navigator !== 'undefined'\n\t\t\t\t\t? (navigator.language.split('-')[0] ?? 'en')\n\t\t\t\t\t: 'en'\n\t\t\t\t: locale;\n\t}\n\n\tgetLocale(): string {\n\t\treturn this.resolvedLocale;\n\t}\n}\n\nexport const LocaleServiceKey = new ServiceKey<LocaleService>('locale');\n","/**\n * Shared helper for resolving a plugin's locale.\n * Priority: per-plugin config override > global LocaleService > English fallback.\n */\n\nimport type { PluginContext } from '../plugins/Plugin.js';\nimport { LocaleServiceKey } from './LocaleService.js';\n\nexport function resolvePluginLocale<T>(\n\tlocaleMap: Readonly<Record<string, T>>,\n\tcontext: PluginContext,\n\tconfigOverride?: T,\n): T {\n\tif (configOverride) return configOverride;\n\tconst service = context.getService(LocaleServiceKey);\n\tconst lang: string = service?.getLocale() ?? 'en';\n\tconst resolved: T | undefined = localeMap[lang] ?? localeMap.en;\n\tif (!resolved) {\n\t\tthrow new Error('Locale map must contain an \"en\" entry');\n\t}\n\treturn resolved;\n}\n"],"names":["EventKey","id","this","ServiceKey","LocaleService","resolvedLocale","locale","navigator","language","split","getLocale","LocaleServiceKey","resolvePluginLocale","localeMap","context","configOverride","service","getService","resolved","en","Error"],"mappings":"AA2BO,MAAMA;EAEZ,YAA4BC,IAAAA;AAAAC,SAAAD,KAAAA;AAAAA,EAAa;AAAA;AAInC,MAAME,EAAAA;AAAAA,EAEZ,YAA4BF,IAAAA;AAAAC,SAAAD,KAAAA;AAAAA,EAAa;;AC5BnC,MAAMG,EAAAA;AAAAA,EACKC;AAAAA,EAEjB,YAAYC,IAAAA;AACXJ,SAAKG,iBACO,cAAXC,KACwB,sBAAdC,YACLA,UAAUC,SAASC,MAAM,KAAK,CAAA,KAAM,OACrC,OACDH;AAAAA,EACL;AAAA,EAEA,YAAAI;AACC,WAAOR,KAAKG;AAAAA,EACb;;AAGM,MAAMM,IAAmB,IAAIR,EAA0B;AChBvD,SAASS,EACfC,IACAC,IACAC;AAEA,MAAIA,GAAgB,QAAOA;AAC3B,QAAMC,KAAUF,GAAQG,WAAWN,CAAAA,GAE7BO,IAA0BL,GADXG,IAASN,UAAAA,KAAe,SACMG,GAAUM;AAC7D,OAAKD,EACJ,OAAM,IAAIE,MAAM;AAEjB,SAAOF;AACR;"}
|
|
@@ -1,71 +1,39 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { NodeSelection, SelectionRange } from '../model/Selection.js';
|
|
1
|
+
import { SelectionRange } from '../model/Selection.js';
|
|
3
2
|
import { BlockId } from '../model/TypeBrands.js';
|
|
4
3
|
import { EditorState } from '../state/EditorState.js';
|
|
5
4
|
import { Transaction, TransactionBuilder } from '../state/Transaction.js';
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export
|
|
13
|
-
/**
|
|
14
|
-
* Deletes the void block targeted by a NodeSelection and places cursor
|
|
15
|
-
* on the adjacent block. If it's the only block, replaces with empty paragraph.
|
|
16
|
-
*/
|
|
17
|
-
export declare function deleteNodeSelection(state: EditorState, sel: NodeSelection): Transaction | null;
|
|
5
|
+
export { canCrossBlockBoundary, isInsideIsolating, isIsolatingBlock, isVoidBlock, sharesParent, } from '../model/NavigationUtils.js';
|
|
6
|
+
export type { FeatureConfig } from './MarkCommands.js';
|
|
7
|
+
export { isMarkActive, toggleBold, toggleItalic, toggleMark, toggleUnderline, } from './MarkCommands.js';
|
|
8
|
+
export { deleteBackward, deleteForward, deleteSoftLineBackward, deleteSoftLineForward, deleteWordBackward, deleteWordForward, } from './DeleteCommands.js';
|
|
9
|
+
export { deleteNodeSelection, findFirstLeafBlockId, findLastLeafBlockId, insertParagraphAfterNodeSelection, insertTextAfterNodeSelection, navigateArrowIntoVoid, } from './NodeSelectionCommands.js';
|
|
10
|
+
export { deleteBackwardAtGap, deleteForwardAtGap, insertParagraphAtGap, insertTextAtGap, } from './GapCursorCommands.js';
|
|
11
|
+
export { findWordBoundaryBackward, findWordBoundaryForward, } from './WordBoundary.js';
|
|
18
12
|
/**
|
|
19
13
|
* Iterates over each block in the given selection range, invoking the callback
|
|
20
14
|
* with the block ID, per-block start offset, and per-block end offset.
|
|
21
15
|
* Blocks where `from === to` are skipped automatically.
|
|
22
16
|
*/
|
|
23
17
|
export declare function forEachBlockInRange(state: EditorState, range: SelectionRange, callback: (blockId: BlockId, from: number, to: number) => void): void;
|
|
24
|
-
/**
|
|
25
|
-
* Toggles a mark on the current selection.
|
|
26
|
-
* If collapsed, toggles stored marks. If range, applies/removes from text.
|
|
27
|
-
*/
|
|
28
|
-
export declare function toggleMark(state: EditorState, markType: MarkType, features?: FeatureConfig): Transaction | null;
|
|
29
|
-
export declare function toggleBold(state: EditorState, features?: FeatureConfig): Transaction | null;
|
|
30
|
-
export declare function toggleItalic(state: EditorState, features?: FeatureConfig): Transaction | null;
|
|
31
|
-
export declare function toggleUnderline(state: EditorState, features?: FeatureConfig): Transaction | null;
|
|
32
18
|
/** Inserts text at the current selection, replacing any selected range. */
|
|
33
19
|
export declare function insertTextCommand(state: EditorState, text: string, origin?: 'input' | 'paste'): Transaction;
|
|
34
20
|
/** Deletes the current selection. */
|
|
35
21
|
export declare function deleteSelectionCommand(state: EditorState): Transaction | null;
|
|
36
|
-
/** Handles backspace key. */
|
|
37
|
-
export declare function deleteBackward(state: EditorState): Transaction | null;
|
|
38
|
-
/** Handles delete key. */
|
|
39
|
-
export declare function deleteForward(state: EditorState): Transaction | null;
|
|
40
|
-
/** Handles Ctrl+Backspace: delete word backward. */
|
|
41
|
-
export declare function deleteWordBackward(state: EditorState): Transaction | null;
|
|
42
|
-
/** Handles Ctrl+Delete: delete word forward. */
|
|
43
|
-
export declare function deleteWordForward(state: EditorState): Transaction | null;
|
|
44
|
-
/** Handles Cmd+Backspace: delete to start of line/block. */
|
|
45
|
-
export declare function deleteSoftLineBackward(state: EditorState): Transaction | null;
|
|
46
|
-
/** Handles Cmd+Delete: delete to end of line/block. */
|
|
47
|
-
export declare function deleteSoftLineForward(state: EditorState): Transaction | null;
|
|
48
22
|
/** Splits the current block at the cursor position (Enter key). */
|
|
49
23
|
export declare function splitBlockCommand(state: EditorState): Transaction | null;
|
|
50
24
|
/** Inserts a hard line break (InlineNode) at the current cursor position. */
|
|
51
25
|
export declare function insertHardBreakCommand(state: EditorState): Transaction | null;
|
|
52
|
-
/** Checks whether two blocks share the same parent in the document tree. */
|
|
53
|
-
export declare function sharesParent(state: EditorState, blockIdA: BlockId, blockIdB: BlockId): boolean;
|
|
54
|
-
/** Checks whether a block is inside an isolating node (e.g. table_cell). */
|
|
55
|
-
export declare function isInsideIsolating(state: EditorState, blockId: BlockId): boolean;
|
|
56
26
|
/**
|
|
57
27
|
* Merges the current block with the previous block, respecting
|
|
58
28
|
* isolating boundaries and void blocks.
|
|
59
29
|
*/
|
|
60
30
|
export declare function mergeBlockBackward(state: EditorState): Transaction | null;
|
|
31
|
+
/**
|
|
32
|
+
* Merges the next block into the current block, respecting
|
|
33
|
+
* isolating boundaries and void blocks.
|
|
34
|
+
*/
|
|
35
|
+
export declare function mergeBlockForward(state: EditorState): Transaction | null;
|
|
61
36
|
/** Selects all content in the editor. */
|
|
62
37
|
export declare function selectAll(state: EditorState): Transaction;
|
|
63
|
-
/** Checks if a mark is active at the current selection. */
|
|
64
|
-
export declare function isMarkActive(state: EditorState, markType: MarkType): boolean;
|
|
65
38
|
export declare function addDeleteSelectionSteps(state: EditorState, builder: TransactionBuilder): void;
|
|
66
|
-
/**
|
|
67
|
-
* Navigates arrow keys into/out of void blocks.
|
|
68
|
-
* Returns a transaction if navigation should create a NodeSelection, or null.
|
|
69
|
-
*/
|
|
70
|
-
export declare function navigateArrowIntoVoid(state: EditorState, direction: 'left' | 'right' | 'up' | 'down'): Transaction | null;
|
|
71
39
|
//# sourceMappingURL=Commands.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Commands.d.ts","sourceRoot":"","sources":["../../src/commands/Commands.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"Commands.d.ts","sourceRoot":"","sources":["../../src/commands/Commands.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAgBH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAU5D,OAAO,EAAE,KAAK,OAAO,EAAc,MAAM,wBAAwB,CAAC;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAUlE,OAAO,EACN,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,EACX,YAAY,GACZ,MAAM,6BAA6B,CAAC;AAErC,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EACN,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,UAAU,EACV,eAAe,GACf,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACN,cAAc,EACd,aAAa,EACb,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,EAClB,iBAAiB,GACjB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACN,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,iCAAiC,EACjC,4BAA4B,EAC5B,qBAAqB,GACrB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACN,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,eAAe,GACf,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACN,wBAAwB,EACxB,uBAAuB,GACvB,MAAM,mBAAmB,CAAC;AAI3B;;;;GAIG;AACH,wBAAgB,mBAAmB,CAClC,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,cAAc,EACrB,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,IAAI,GAC5D,IAAI,CAiBN;AAID,2EAA2E;AAC3E,wBAAgB,iBAAiB,CAChC,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,MAAM,EACZ,MAAM,GAAE,OAAO,GAAG,OAAiB,GACjC,WAAW,CA4Bb;AAED,qCAAqC;AACrC,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW,GAAG,IAAI,CAc7E;AAED,mEAAmE;AACnE,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW,GAAG,IAAI,CAkCxE;AAED,6EAA6E;AAC7E,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW,GAAG,IAAI,CAoB7E;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW,GAAG,IAAI,CAuCzE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW,GAAG,IAAI,CAmCxE;AAED,yCAAyC;AACzC,wBAAgB,SAAS,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW,CAiBzD;AAcD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAwC7F"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { EditorState } from '../state/EditorState.js';
|
|
2
|
+
import { Transaction } from '../state/Transaction.js';
|
|
3
|
+
/** Handles backspace key. */
|
|
4
|
+
export declare function deleteBackward(state: EditorState): Transaction | null;
|
|
5
|
+
/** Handles delete key. */
|
|
6
|
+
export declare function deleteForward(state: EditorState): Transaction | null;
|
|
7
|
+
/** Handles Ctrl+Backspace: delete word backward. */
|
|
8
|
+
export declare function deleteWordBackward(state: EditorState): Transaction | null;
|
|
9
|
+
/** Handles Ctrl+Delete: delete word forward. */
|
|
10
|
+
export declare function deleteWordForward(state: EditorState): Transaction | null;
|
|
11
|
+
/** Handles Cmd+Backspace: delete to start of line/block. */
|
|
12
|
+
export declare function deleteSoftLineBackward(state: EditorState): Transaction | null;
|
|
13
|
+
/** Handles Cmd+Delete: delete to end of line/block. */
|
|
14
|
+
export declare function deleteSoftLineForward(state: EditorState): Transaction | null;
|
|
15
|
+
//# sourceMappingURL=DeleteCommands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeleteCommands.d.ts","sourceRoot":"","sources":["../../src/commands/DeleteCommands.ts"],"names":[],"mappings":"AAAA;;GAEG;AASH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAK3D,6BAA6B;AAC7B,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW,GAAG,IAAI,CAyBrE;AAED,0BAA0B;AAC1B,wBAAgB,aAAa,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW,GAAG,IAAI,CA2BpE;AAED,oDAAoD;AACpD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW,GAAG,IAAI,CA0BzE;AAED,gDAAgD;AAChD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW,GAAG,IAAI,CA2BxE;AAED,4DAA4D;AAC5D,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW,GAAG,IAAI,CAwB7E;AAED,uDAAuD;AACvD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW,GAAG,IAAI,CAyB5E"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { GapCursorSelection } from '../model/Selection.js';
|
|
2
|
+
import { EditorState } from '../state/EditorState.js';
|
|
3
|
+
import { Transaction } from '../state/Transaction.js';
|
|
4
|
+
/**
|
|
5
|
+
* Deletes the void block adjacent to a GapCursor when pressing Backspace.
|
|
6
|
+
*
|
|
7
|
+
* - `side === 'after'` → void block is behind the cursor → delete it.
|
|
8
|
+
* - `side === 'before'` → void block is ahead → navigate backward (to previous block).
|
|
9
|
+
* - At document start with `side === 'before'` → `null` (no-op).
|
|
10
|
+
*/
|
|
11
|
+
export declare function deleteBackwardAtGap(state: EditorState, sel: GapCursorSelection): Transaction | null;
|
|
12
|
+
/**
|
|
13
|
+
* Deletes the void block adjacent to a GapCursor when pressing Delete.
|
|
14
|
+
*
|
|
15
|
+
* - `side === 'before'` → void block is ahead of the cursor → delete it.
|
|
16
|
+
* - `side === 'after'` → void block is behind → navigate forward (to next block).
|
|
17
|
+
* - At document end with `side === 'after'` → `null` (no-op).
|
|
18
|
+
*/
|
|
19
|
+
export declare function deleteForwardAtGap(state: EditorState, sel: GapCursorSelection): Transaction | null;
|
|
20
|
+
/** Inserts a new paragraph at a GapCursor position (before or after the void block). */
|
|
21
|
+
export declare function insertParagraphAtGap(state: EditorState, sel: GapCursorSelection): Transaction | null;
|
|
22
|
+
/** Inserts text in a new paragraph at a GapCursor position. */
|
|
23
|
+
export declare function insertTextAtGap(state: EditorState, sel: GapCursorSelection, text: string, origin: 'input' | 'paste'): Transaction;
|
|
24
|
+
//# sourceMappingURL=GapCursorCommands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GapCursorCommands.d.ts","sourceRoot":"","sources":["../../src/commands/GapCursorCommands.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,OAAO,KAAK,EAAE,kBAAkB,EAAiB,MAAM,uBAAuB,CAAC;AAG/E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAG3D;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAClC,KAAK,EAAE,WAAW,EAClB,GAAG,EAAE,kBAAkB,GACrB,WAAW,GAAG,IAAI,CA0BpB;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CACjC,KAAK,EAAE,WAAW,EAClB,GAAG,EAAE,kBAAkB,GACrB,WAAW,GAAG,IAAI,CAuBpB;AASD,wFAAwF;AACxF,wBAAgB,oBAAoB,CACnC,KAAK,EAAE,WAAW,EAClB,GAAG,EAAE,kBAAkB,GACrB,WAAW,GAAG,IAAI,CAgBpB;AAED,+DAA+D;AAC/D,wBAAgB,eAAe,CAC9B,KAAK,EAAE,WAAW,EAClB,GAAG,EAAE,kBAAkB,EACvB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,OAAO,GAAG,OAAO,GACvB,WAAW,CAeb"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { MarkType } from '../model/Document.js';
|
|
2
|
+
import { EditorState } from '../state/EditorState.js';
|
|
3
|
+
import { Transaction } from '../state/Transaction.js';
|
|
4
|
+
export interface FeatureConfig {
|
|
5
|
+
readonly bold: boolean;
|
|
6
|
+
readonly italic: boolean;
|
|
7
|
+
readonly underline: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Toggles a mark on the current selection.
|
|
11
|
+
* If collapsed, toggles stored marks. If range, applies/removes from text.
|
|
12
|
+
*/
|
|
13
|
+
export declare function toggleMark(state: EditorState, markType: MarkType, features?: FeatureConfig): Transaction | null;
|
|
14
|
+
export declare function toggleBold(state: EditorState, features?: FeatureConfig): Transaction | null;
|
|
15
|
+
export declare function toggleItalic(state: EditorState, features?: FeatureConfig): Transaction | null;
|
|
16
|
+
export declare function toggleUnderline(state: EditorState, features?: FeatureConfig): Transaction | null;
|
|
17
|
+
/** Checks if a mark is active at the current selection. */
|
|
18
|
+
export declare function isMarkActive(state: EditorState, markType: MarkType): boolean;
|
|
19
|
+
//# sourceMappingURL=MarkCommands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarkCommands.d.ts","sourceRoot":"","sources":["../../src/commands/MarkCommands.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAGN,KAAK,QAAQ,EAMb,MAAM,sBAAsB,CAAC;AAI9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAK3D,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC5B;AAID;;;GAGG;AACH,wBAAgB,UAAU,CACzB,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,GAAE,aAA+B,GACvC,WAAW,GAAG,IAAI,CA0CpB;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,aAAa,GAAG,WAAW,GAAG,IAAI,CAE3F;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,aAAa,GAAG,WAAW,GAAG,IAAI,CAE7F;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,aAAa,GAAG,WAAW,GAAG,IAAI,CAEhG;AAED,2DAA2D;AAC3D,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAe5E"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { EditorState } from '../state/EditorState.js';
|
|
2
|
+
import { Transaction } from '../state/Transaction.js';
|
|
3
|
+
/** Moves the cursor one character forward, skipping InlineNodes atomically. */
|
|
4
|
+
export declare function moveCharacterForward(state: EditorState): Transaction | null;
|
|
5
|
+
/** Moves the cursor one character backward, skipping InlineNodes atomically. */
|
|
6
|
+
export declare function moveCharacterBackward(state: EditorState): Transaction | null;
|
|
7
|
+
/** Moves the cursor to the start of the current block. */
|
|
8
|
+
export declare function moveToBlockStart(state: EditorState): Transaction | null;
|
|
9
|
+
/** Moves the cursor to the end of the current block. */
|
|
10
|
+
export declare function moveToBlockEnd(state: EditorState): Transaction | null;
|
|
11
|
+
/** Moves the cursor to the beginning of the document. */
|
|
12
|
+
export declare function moveToDocumentStart(state: EditorState): Transaction | null;
|
|
13
|
+
/** Moves the cursor to the end of the document. */
|
|
14
|
+
export declare function moveToDocumentEnd(state: EditorState): Transaction | null;
|
|
15
|
+
/** Extends the selection one character forward. */
|
|
16
|
+
export declare function extendCharacterForward(state: EditorState): Transaction | null;
|
|
17
|
+
/** Extends the selection one character backward. */
|
|
18
|
+
export declare function extendCharacterBackward(state: EditorState): Transaction | null;
|
|
19
|
+
/** Extends the selection to the start of the current block. */
|
|
20
|
+
export declare function extendToBlockStart(state: EditorState): Transaction | null;
|
|
21
|
+
/** Extends the selection to the end of the current block. */
|
|
22
|
+
export declare function extendToBlockEnd(state: EditorState): Transaction | null;
|
|
23
|
+
/** Extends the selection to the start of the document. */
|
|
24
|
+
export declare function extendToDocumentStart(state: EditorState): Transaction | null;
|
|
25
|
+
/** Extends the selection to the end of the document. */
|
|
26
|
+
export declare function extendToDocumentEnd(state: EditorState): Transaction | null;
|
|
27
|
+
//# sourceMappingURL=MovementCommands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MovementCommands.d.ts","sourceRoot":"","sources":["../../src/commands/MovementCommands.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAYH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yB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'../model/Document.js';
|
|
2
|
+
import { NodeSelection } from '../model/Selection.js';
|
|
3
|
+
import { BlockId } from '../model/TypeBrands.js';
|
|
4
|
+
import { EditorState } from '../state/EditorState.js';
|
|
5
|
+
import { Transaction } from '../state/Transaction.js';
|
|
6
|
+
/**
|
|
7
|
+
* Deletes the void block targeted by a NodeSelection and places cursor
|
|
8
|
+
* on the adjacent block. If it's the only block, replaces with empty paragraph.
|
|
9
|
+
*/
|
|
10
|
+
export declare function deleteNodeSelection(state: EditorState, sel: NodeSelection): Transaction | null;
|
|
11
|
+
/** Inserts a new paragraph after a NodeSelection-targeted void block. */
|
|
12
|
+
export declare function insertParagraphAfterNodeSelection(state: EditorState, sel: NodeSelection): Transaction | null;
|
|
13
|
+
/** Inserts text in a new paragraph after a NodeSelection-targeted void block. */
|
|
14
|
+
export declare function insertTextAfterNodeSelection(state: EditorState, sel: NodeSelection, text: string, origin: 'input' | 'paste'): Transaction;
|
|
15
|
+
/**
|
|
16
|
+
* Navigates arrow keys into/out of void blocks.
|
|
17
|
+
* Returns a transaction if navigation should create a NodeSelection, or null.
|
|
18
|
+
*/
|
|
19
|
+
export declare function navigateArrowIntoVoid(state: EditorState, direction: 'left' | 'right' | 'up' | 'down'): Transaction | null;
|
|
20
|
+
/** Finds the first leaf (deepest-first-child) block ID in a subtree. */
|
|
21
|
+
export declare function findFirstLeafBlockId(node: BlockNode): BlockId;
|
|
22
|
+
/** Finds the last leaf (deepest-last-child) block ID in a subtree. */
|
|
23
|
+
export declare function findLastLeafBlockId(node: BlockNode): BlockId;
|
|
24
|
+
//# sourceMappingURL=NodeSelectionCommands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NodeSelectionCommands.d.ts","sourceRoot":"","sources":["../../src/commands/NodeSelectionCommands.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,SAAS,EAMd,MAAM,sBAAsB,CAAC;AAG9B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAS3D,OAAO,EAAE,KAAK,OAAO,EAAY,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,GAAG,IAAI,CA2C9F;AAED,yEAAyE;AACzE,wBAAgB,iCAAiC,CAChD,KAAK,EAAE,WAAW,EAClB,GAAG,EAAE,aAAa,GAChB,WAAW,GAAG,IAAI,CAepB;AAED,iFAAiF;AACjF,wBAAgB,4BAA4B,CAC3C,KAAK,EAAE,WAAW,EAClB,GAAG,EAAE,aAAa,EAClB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,OAAO,GAAG,OAAO,GACvB,WAAW,CAeb;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACpC,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,MAAM,GACzC,WAAW,GAAG,IAAI,CAgBpB;AAED,wEAAwE;AACxE,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAS7D;AAED,sEAAsE;AACtE,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAc5D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PasteCommand.d.ts","sourceRoot":"","sources":["../../src/commands/PasteCommand.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAc,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"PasteCommand.d.ts","sourceRoot":"","sources":["../../src/commands/PasteCommand.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAc,MAAM,0BAA0B,CAAC;AAoBzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAsB,MAAM,yBAAyB,CAAC;AAG/E;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,YAAY,GAAG,WAAW,CAiB/E"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BlockNode } from '../model/Document.js';
|
|
2
|
+
/**
|
|
3
|
+
* Finds the word boundary backward from the given offset.
|
|
4
|
+
* InlineNodes act as word boundaries.
|
|
5
|
+
*/
|
|
6
|
+
export declare function findWordBoundaryBackward(block: BlockNode, offset: number): number;
|
|
7
|
+
/**
|
|
8
|
+
* Finds the word boundary forward from the given offset.
|
|
9
|
+
* InlineNodes act as word boundaries.
|
|
10
|
+
*/
|
|
11
|
+
export declare function findWordBoundaryForward(block: BlockNode, offset: number): number;
|
|
12
|
+
//# sourceMappingURL=WordBoundary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WordBoundary.d.ts","sourceRoot":"","sources":["../../src/commands/WordBoundary.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,SAAS,EAAsC,MAAM,sBAAsB,CAAC;AAE1F;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAsBjF;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAuBhF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentSerializer.d.ts","sourceRoot":"","sources":["../../src/editor/DocumentSerializer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAa,QAAQ,EAA8B,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"DocumentSerializer.d.ts","sourceRoot":"","sources":["../../src/editor/DocumentSerializer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAa,QAAQ,EAA8B,MAAM,sBAAsB,CAAC;AAQ5F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAKjE,0FAA0F;AAC1F,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,cAAc,GAAG,MAAM,CAUxF"}
|
|
@@ -2,20 +2,39 @@ import { Locale } from '../i18n/Locale.js';
|
|
|
2
2
|
import { Document } from '../model/Document.js';
|
|
3
3
|
import { EventKey, Plugin, PluginConfig, PluginEventCallback, ServiceKey } from '../plugins/Plugin.js';
|
|
4
4
|
import { TextFormattingConfig } from '../plugins/text-formatting/TextFormattingPlugin.js';
|
|
5
|
+
import { ToolbarOverflowBehavior } from '../plugins/toolbar/ToolbarOverflowBehavior.js';
|
|
5
6
|
import { EditorState } from '../state/EditorState.js';
|
|
6
7
|
import { Transaction } from '../state/Transaction.js';
|
|
7
8
|
import { PaperSize } from './PaperSize.js';
|
|
8
9
|
import { Theme, ThemePreset } from './theme/ThemeTokens.js';
|
|
10
|
+
/**
|
|
11
|
+
* Expanded toolbar configuration for `createEditor`.
|
|
12
|
+
* Allows specifying both the plugin layout and overflow behavior.
|
|
13
|
+
*/
|
|
14
|
+
export interface ToolbarConfig {
|
|
15
|
+
/**
|
|
16
|
+
* Plugin groups defining toolbar layout. Each inner array is a visual group;
|
|
17
|
+
* separators are rendered between groups. Order = array order.
|
|
18
|
+
*/
|
|
19
|
+
readonly groups: ReadonlyArray<ReadonlyArray<Plugin>>;
|
|
20
|
+
/**
|
|
21
|
+
* Controls responsive overflow behavior when items exceed available width.
|
|
22
|
+
* Defaults to `ToolbarOverflowBehavior.BurgerMenu`.
|
|
23
|
+
*/
|
|
24
|
+
readonly overflow?: ToolbarOverflowBehavior;
|
|
25
|
+
}
|
|
9
26
|
export interface NotectlEditorConfig {
|
|
10
27
|
/** Controls which inline marks are enabled. Used to auto-configure TextFormattingPlugin. */
|
|
11
28
|
features?: Partial<TextFormattingConfig>;
|
|
12
29
|
plugins?: Plugin[];
|
|
13
30
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
31
|
+
* Toolbar configuration. Accepts either:
|
|
32
|
+
* - A shorthand array of plugin groups: `[[BoldPlugin, ItalicPlugin], [HeadingPlugin]]`
|
|
33
|
+
* - A full config object: `{ groups: [...], overflow: ToolbarOverflowBehavior.Flow }`
|
|
34
|
+
*
|
|
16
35
|
* When set, a ToolbarPlugin is created internally — do not add one to `plugins`.
|
|
17
36
|
*/
|
|
18
|
-
toolbar?: ReadonlyArray<ReadonlyArray<Plugin
|
|
37
|
+
toolbar?: ReadonlyArray<ReadonlyArray<Plugin>> | ToolbarConfig;
|
|
19
38
|
placeholder?: string;
|
|
20
39
|
readonly?: boolean;
|
|
21
40
|
autofocus?: boolean;
|
|
@@ -67,12 +86,16 @@ export declare class NotectlEditor extends HTMLElement {
|
|
|
67
86
|
registerPlugin(plugin: Plugin): void;
|
|
68
87
|
/** Initializes the editor with the given config. */
|
|
69
88
|
init(config?: NotectlEditorConfig): Promise<void>;
|
|
89
|
+
/** Returns whether the editor is in read-only mode. */
|
|
90
|
+
get isReadOnly(): boolean;
|
|
70
91
|
/** Returns the document as JSON. */
|
|
71
92
|
getJSON(): Document;
|
|
72
93
|
/** Sets the document from JSON. */
|
|
73
94
|
setJSON(doc: Document): void;
|
|
74
95
|
/** Returns sanitized HTML representation of the document. */
|
|
75
|
-
getHTML(
|
|
96
|
+
getHTML(options?: GetHTMLOptions & {
|
|
97
|
+
pretty?: boolean;
|
|
98
|
+
}): string;
|
|
76
99
|
/** Sets content from HTML (sanitized). */
|
|
77
100
|
setHTML(html: string): void;
|
|
78
101
|
/** Returns plain text content. */
|
|
@@ -83,8 +106,8 @@ export declare class NotectlEditor extends HTMLElement {
|
|
|
83
106
|
toggleBold: () => boolean;
|
|
84
107
|
toggleItalic: () => boolean;
|
|
85
108
|
toggleUnderline: () => boolean;
|
|
86
|
-
undo: () => void
|
|
87
|
-
redo: () => void
|
|
109
|
+
undo: () => void;
|
|
110
|
+
redo: () => void;
|
|
88
111
|
selectAll: () => void;
|
|
89
112
|
};
|
|
90
113
|
/** Checks whether a command can be executed. */
|
|
@@ -126,6 +149,7 @@ export declare class NotectlEditor extends HTMLElement {
|
|
|
126
149
|
/**
|
|
127
150
|
* Processes the declarative `toolbar` config: registers a ToolbarPlugin
|
|
128
151
|
* with layout groups, then registers all plugins from the toolbar groups.
|
|
152
|
+
* Accepts both the shorthand array and the full ToolbarConfig object.
|
|
129
153
|
*/
|
|
130
154
|
private processToolbarConfig;
|
|
131
155
|
/**
|
|
@@ -133,6 +157,10 @@ export declare class NotectlEditor extends HTMLElement {
|
|
|
133
157
|
* was explicitly registered. Uses the `features` config to determine which marks to enable.
|
|
134
158
|
*/
|
|
135
159
|
private ensureTextFormattingPlugin;
|
|
160
|
+
/** Auto-registers CaretNavigationPlugin if not explicitly provided. */
|
|
161
|
+
private ensureCaretNavigationPlugin;
|
|
162
|
+
/** Auto-registers GapCursorPlugin if not explicitly provided. */
|
|
163
|
+
private ensureGapCursorPlugin;
|
|
136
164
|
private applyPaperSize;
|
|
137
165
|
private emit;
|
|
138
166
|
private onStateChange;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotectlEditor.d.ts","sourceRoot":"","sources":["../../src/editor/NotectlEditor.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,KAAK,QAAQ,EAAgB,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"NotectlEditor.d.ts","sourceRoot":"","sources":["../../src/editor/NotectlEditor.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,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EAAE,mBAAmB,GAAG,OAAO,CAAC,aAAa,CAAC,CAIvF"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/** Width of the list marker / checkbox area in pixels. */
|
|
2
|
+
export declare const LIST_MARKER_WIDTH = 24;
|
|
1
3
|
/** List styles — bullet, ordered, checklist items. */
|
|
2
4
|
export declare const LIST_CSS = "\n/* List Wrappers \u2014 suppress native markers, we use ::before pseudo-elements */\n.notectl-list {\n\tlist-style: none;\n\tmargin: 0;\n\tpadding: 0;\n}\n\n/* Ordered List \u2014 each <ol> wrapper resets the counter */\n.notectl-list--ordered {\n\tcounter-reset: notectl-ordered;\n}\n\n/* List Items */\n.notectl-list-item {\n\tmargin: 0;\n\tpadding: 2px 0 2px 24px;\n\tmin-height: 1.6em;\n\tposition: relative;\n}\n\n.notectl-list-item::before {\n\tposition: absolute;\n\tleft: 0;\n\tdisplay: inline-block;\n\twidth: 24px;\n\ttext-align: center;\n}\n\n/* Bullet List */\n.notectl-list-item--bullet::before {\n\tcontent: '\\2022';\n\tcolor: var(--notectl-fg);\n}\n\n/* Ordered List \u2014 counter increment per item */\n.notectl-list-item--ordered {\n\tcounter-increment: notectl-ordered;\n}\n\n.notectl-list-item--ordered::before {\n\tcontent: counter(notectl-ordered) '.';\n\tcolor: var(--notectl-fg);\n\tfont-size: 14px;\n}\n\n/* Checklist */\n.notectl-list-item--checklist::before {\n\tcontent: '\\2610';\n\tfont-size: 16px;\n\tcolor: var(--notectl-fg-muted);\n\tcursor: pointer;\n}\n\n.notectl-list-item--checklist[data-checked=\"true\"]::before {\n\tcontent: '\\2611';\n\tcolor: var(--notectl-success);\n}\n\n.notectl-list-item--checklist[data-checked=\"true\"] {\n\tcolor: var(--notectl-fg-muted);\n\ttext-decoration: line-through;\n}\n";
|
|
3
5
|
//# sourceMappingURL=list.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/editor/styles/list.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,eAAO,MAAM,QAAQ,u0CA+DpB,CAAC"}
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/editor/styles/list.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAEpC,sDAAsD;AACtD,eAAO,MAAM,QAAQ,u0CA+DpB,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/** Toolbar styles — buttons, separators, tooltips, popups, dropdowns. */
|
|
2
|
-
export declare const TOOLBAR_CSS = "\n/* Toolbar */\n.notectl-plugin-container--top {\n\tdisplay: flex;\n\talign-items: center;\n\tflex-wrap:
|
|
2
|
+
export declare const TOOLBAR_CSS = "\n/* Toolbar */\n.notectl-plugin-container--top {\n\tdisplay: flex;\n\talign-items: center;\n\tflex-wrap: nowrap;\n\tborder-bottom: 1px solid var(--notectl-border);\n\tbackground: var(--notectl-toolbar-bg, var(--notectl-surface-raised));\n\tmin-height: 40px;\n}\n\n.notectl-toolbar {\n\tdisplay: flex;\n\talign-items: center;\n\tflex-wrap: nowrap;\n\toverflow: hidden;\n\tflex: 1;\n\tmin-width: 0;\n\tgap: 2px;\n\tpadding: 4px 8px;\n}\n\n.notectl-toolbar[hidden] {\n\tdisplay: none;\n}\n\n.notectl-toolbar-btn {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 32px;\n\theight: 32px;\n\tborder: 1px solid transparent;\n\tborder-radius: 4px;\n\tbackground: transparent;\n\tcursor: pointer;\n\tcolor: var(--notectl-fg);\n\tfont-size: 14px;\n\tline-height: 1;\n\tpadding: 0;\n\tflex-shrink: 0;\n\ttransition: background 0.1s, border-color 0.1s;\n}\n\n.notectl-toolbar-btn:hover {\n\tbackground: var(--notectl-hover-bg);\n\tborder-color: var(--notectl-border);\n}\n\n.notectl-toolbar-btn--active {\n\tbackground: var(--notectl-active-bg);\n\tborder-color: var(--notectl-primary-muted);\n\tcolor: var(--notectl-primary-fg);\n}\n\n.notectl-toolbar-btn:focus-visible {\n\tbox-shadow: 0 0 0 2px var(--notectl-focus-ring);\n\toutline: none;\n}\n\n.notectl-toolbar-btn:disabled {\n\topacity: 0.4;\n\tcursor: not-allowed;\n}\n\n.notectl-toolbar-btn:disabled:hover {\n\tbackground: transparent;\n\tborder-color: transparent;\n}\n\n.notectl-toolbar-btn__icon {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\tpointer-events: none;\n}\n\n.notectl-toolbar-btn__icon svg {\n\tdisplay: block;\n\twidth: 18px;\n\theight: 18px;\n\tfill: currentColor;\n}\n\n/* Tooltip (rendered as fixed-position element in shadow root) */\n.notectl-toolbar-tooltip {\n\tposition: fixed;\n\tpadding: 4px 8px;\n\tborder-radius: 4px;\n\tbackground: var(--notectl-tooltip-bg);\n\tcolor: var(--notectl-tooltip-fg);\n\tfont-size: 11px;\n\tfont-weight: 500;\n\twhite-space: nowrap;\n\tpointer-events: none;\n\tz-index: 10001;\n\tline-height: 1.4;\n\tletter-spacing: 0.01em;\n\tfont-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n}\n\n.notectl-toolbar-separator {\n\tdisplay: inline-block;\n\twidth: 1px;\n\theight: 20px;\n\tbackground: var(--notectl-border);\n\tmargin: 0 4px;\n\tvertical-align: middle;\n}\n\n/* Toolbar Popups */\n.notectl-toolbar-popup {\n\tbackground: var(--notectl-surface-overlay);\n\tborder: 1px solid var(--notectl-border);\n\tborder-radius: 6px;\n\tbox-shadow: 0 4px 12px var(--notectl-shadow);\n\toverflow: hidden;\n}\n\n/* Grid Picker */\n.notectl-grid-picker__cell:focus-visible {\n\toutline: 2px solid var(--notectl-focus-ring);\n\toutline-offset: -1px;\n}\n\n.notectl-grid-picker__cell--highlighted {\n\tbackground: var(--notectl-primary-muted);\n\tborder-color: var(--notectl-primary);\n}\n\n/* Dropdown */\n.notectl-dropdown {\n\tmin-width: 160px;\n\tpadding: 4px 0;\n}\n\n.notectl-dropdown__item {\n\tdisplay: flex;\n\talign-items: center;\n\twidth: 100%;\n\tpadding: 8px 12px;\n\ttext-align: left;\n\tborder: none;\n\tbackground: none;\n\tcursor: pointer;\n\tfont-size: 14px;\n\tcolor: var(--notectl-fg);\n\tline-height: 1.4;\n\tfont-family: inherit;\n\twhite-space: nowrap;\n}\n\n.notectl-dropdown__item:hover,\n.notectl-dropdown__item:focus-visible {\n\tbackground: var(--notectl-hover-bg);\n}\n\n.notectl-dropdown__item:focus-visible {\n\toutline: none;\n}\n\n.notectl-dropdown__item-icon {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 28px;\n\tfont-weight: 600;\n\tcolor: var(--notectl-fg-muted);\n\tflex-shrink: 0;\n}\n\n.notectl-dropdown__item-label {\n\tflex: 1;\n}\n\n/* Overflow behavior: flow mode \u2014 toolbar wraps to additional rows */\n.notectl-toolbar[data-overflow=\"flow\"] {\n\tflex-wrap: wrap;\n\toverflow: visible;\n}\n\n/* Overflow behavior: none \u2014 toolbar clips without any responsive behavior */\n.notectl-toolbar[data-overflow=\"none\"] {\n\tflex-wrap: nowrap;\n\toverflow: hidden;\n}\n\n/* Overflow: hidden items (burger-menu mode) */\n.notectl-toolbar-btn--overflow-hidden,\n.notectl-toolbar-separator--overflow-hidden {\n\tdisplay: none;\n}\n\n/* Overflow \"more\" button */\n.notectl-toolbar-overflow-btn {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 32px;\n\theight: 32px;\n\tborder: 1px solid transparent;\n\tborder-radius: 4px;\n\tbackground: transparent;\n\tcursor: pointer;\n\tcolor: var(--notectl-fg);\n\tfont-size: 16px;\n\tline-height: 1;\n\tpadding: 0;\n\tflex-shrink: 0;\n\tmargin-left: auto;\n\ttransition: background 0.1s, border-color 0.1s;\n}\n\n.notectl-toolbar-overflow-btn:hover {\n\tbackground: var(--notectl-hover-bg);\n\tborder-color: var(--notectl-border);\n}\n\n.notectl-toolbar-overflow-btn--hidden {\n\tdisplay: none;\n}\n\n.notectl-toolbar-overflow-btn:focus-visible {\n\tbox-shadow: 0 0 0 2px var(--notectl-focus-ring);\n\toutline: none;\n}\n\n/* Dropdown item states shared by all dropdown menus (including overflow) */\n.notectl-dropdown__item:disabled {\n\topacity: 0.4;\n\tcursor: not-allowed;\n}\n\n.notectl-dropdown__item:disabled:hover {\n\tbackground: none;\n}\n\n.notectl-dropdown__item--active {\n\tcolor: var(--notectl-primary-fg);\n}\n\n.notectl-dropdown__item-icon svg {\n\tdisplay: block;\n\twidth: 16px;\n\theight: 16px;\n\tfill: currentColor;\n}\n\n.notectl-dropdown__separator {\n\theight: 1px;\n\tbackground: var(--notectl-border);\n\tmargin: 4px 0;\n}\n";
|
|
3
3
|
//# sourceMappingURL=toolbar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbar.d.ts","sourceRoot":"","sources":["../../../src/editor/styles/toolbar.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"toolbar.d.ts","sourceRoot":"","sources":["../../../src/editor/styles/toolbar.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,eAAO,MAAM,WAAW,04KA6PvB,CAAC"}
|