@notectl/core 2.3.1 → 2.3.4
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/README.md +1 -1
- package/THIRD-PARTY-NOTICES.md +129 -0
- package/dist/chunks/AlignmentPlugin-DIwrRsHd.mjs +2 -0
- package/dist/chunks/AlignmentPlugin-DIwrRsHd.mjs.map +1 -0
- package/dist/chunks/{AttrRegistry-B3zB02z9.mjs → AttrRegistry-CtNhf2EF.mjs} +2 -2
- package/dist/chunks/{AttrRegistry-B3zB02z9.mjs.map → AttrRegistry-CtNhf2EF.mjs.map} +1 -1
- package/dist/chunks/AttributedMarkCommands-B3MQdob_.mjs +2 -0
- package/dist/chunks/AttributedMarkCommands-B3MQdob_.mjs.map +1 -0
- package/dist/chunks/{BidiIsolationPlugin-DBXyXpgm.mjs → BidiIsolationPlugin-cOLlL3Y9.mjs} +2 -2
- package/dist/chunks/{BidiIsolationPlugin-DBXyXpgm.mjs.map → BidiIsolationPlugin-cOLlL3Y9.mjs.map} +1 -1
- package/dist/chunks/BlockInsertion-O5pAFKid.mjs +2 -0
- package/dist/chunks/{BlockInsertion-CJusvrDL.mjs.map → BlockInsertion-O5pAFKid.mjs.map} +1 -1
- package/dist/chunks/BlockquotePlugin-D-jRWLQB.mjs +2 -0
- package/dist/chunks/{BlockquotePlugin-Bz2glHwX.mjs.map → BlockquotePlugin-D-jRWLQB.mjs.map} +1 -1
- package/dist/chunks/CaretNavigationPlugin-Clv8dzR5.mjs +2 -0
- package/dist/chunks/CaretNavigationPlugin-Clv8dzR5.mjs.map +1 -0
- package/dist/chunks/CodeBlockPlugin-BandNM3t.mjs +2 -0
- package/dist/chunks/{CodeBlockPlugin-C1hrdbSZ.mjs.map → CodeBlockPlugin-BandNM3t.mjs.map} +1 -1
- package/dist/chunks/ColorGrid-D0vLHsG6.mjs +2 -0
- package/dist/chunks/{ColorGrid-C9RQoEWF.mjs.map → ColorGrid-D0vLHsG6.mjs.map} +1 -1
- package/dist/chunks/ColorPickerPopup-_C5JZhki.mjs +2 -0
- package/dist/chunks/{ColorPickerPopup-DiA68Pzz.mjs.map → ColorPickerPopup-_C5JZhki.mjs.map} +1 -1
- package/dist/chunks/ColorValidation-B9d_umnf.mjs +2 -0
- package/dist/chunks/{ColorValidation-DAijTjG9.mjs.map → ColorValidation-B9d_umnf.mjs.map} +1 -1
- package/dist/chunks/Commands-D-0UXYvo.mjs +2 -0
- package/dist/chunks/Commands-D-0UXYvo.mjs.map +1 -0
- package/dist/chunks/ContentModel-Bzmzeqwg.mjs +2 -0
- package/dist/chunks/{ContentModel-NpAj7vGW.mjs.map → ContentModel-Bzmzeqwg.mjs.map} +1 -1
- package/dist/chunks/CursorMarks-dx51OGBf.mjs +2 -0
- package/dist/chunks/CursorMarks-dx51OGBf.mjs.map +1 -0
- package/dist/chunks/Decoration-BwhoA4MU.mjs +3 -0
- package/dist/chunks/Decoration-BwhoA4MU.mjs.map +1 -0
- package/dist/chunks/{DirectionDetection-CDVSEWQ6.mjs → DirectionDetection-ZrkMhyaL.mjs} +2 -2
- package/dist/chunks/{DirectionDetection-CDVSEWQ6.mjs.map → DirectionDetection-ZrkMhyaL.mjs.map} +1 -1
- package/dist/chunks/Document-D_2cIBJG.mjs +2 -0
- package/dist/chunks/Document-D_2cIBJG.mjs.map +1 -0
- package/dist/chunks/DocumentParser-i-CreJ48.mjs +2 -0
- package/dist/chunks/DocumentParser-i-CreJ48.mjs.map +1 -0
- package/dist/chunks/{FontPlugin-By-TGrQo.mjs → FontPlugin-B4Ouhmpe.mjs} +2 -2
- package/dist/chunks/{FontPlugin-By-TGrQo.mjs.map → FontPlugin-B4Ouhmpe.mjs.map} +1 -1
- package/dist/chunks/FontSizePlugin-CZB-AwZQ.mjs +2 -0
- package/dist/chunks/{FontSizePlugin-Dln-tYXV.mjs.map → FontSizePlugin-CZB-AwZQ.mjs.map} +1 -1
- package/dist/chunks/FormulaPlugin-C7N3QXDx.mjs +2 -0
- package/dist/chunks/FormulaPlugin-C7N3QXDx.mjs.map +1 -0
- package/dist/chunks/GapCursorPlugin-NozsEK9J.mjs +2 -0
- package/dist/chunks/GapCursorPlugin-NozsEK9J.mjs.map +1 -0
- package/dist/chunks/HTMLSanitization-Ce9dVT1q.mjs +2 -0
- package/dist/chunks/HTMLSanitization-Ce9dVT1q.mjs.map +1 -0
- package/dist/chunks/HTMLUtils-B0nGyFLb.mjs +2 -0
- package/dist/chunks/{HTMLUtils-Bhg3_P8B.mjs.map → HTMLUtils-B0nGyFLb.mjs.map} +1 -1
- package/dist/chunks/HardBreakPlugin-CC4rntSX.mjs +2 -0
- package/dist/chunks/{HardBreakPlugin-DlbSlrdq.mjs.map → HardBreakPlugin-CC4rntSX.mjs.map} +1 -1
- package/dist/chunks/HeadingPlugin-hubN_Ebt.mjs +2 -0
- package/dist/chunks/{HeadingPlugin-uMAjPOk5.mjs.map → HeadingPlugin-hubN_Ebt.mjs.map} +1 -1
- package/dist/chunks/{HighlightPlugin-Bj7FPkIQ.mjs → HighlightPlugin-CE_MgFNz.mjs} +2 -2
- package/dist/chunks/{HighlightPlugin-Bj7FPkIQ.mjs.map → HighlightPlugin-CE_MgFNz.mjs.map} +1 -1
- package/dist/chunks/{HorizontalRulePlugin-DUVmTQpX.mjs → HorizontalRulePlugin-CxmUMM34.mjs} +2 -2
- package/dist/chunks/{HorizontalRulePlugin-DUVmTQpX.mjs.map → HorizontalRulePlugin-CxmUMM34.mjs.map} +1 -1
- package/dist/chunks/{ImagePlugin-FToCOjd5.mjs → ImagePlugin-B_y4STEr.mjs} +2 -2
- package/dist/chunks/{ImagePlugin-FToCOjd5.mjs.map → ImagePlugin-B_y4STEr.mjs.map} +1 -1
- package/dist/chunks/InlineCodePlugin-C1SqGfv5.mjs +2 -0
- package/dist/chunks/{InlineCodePlugin-pISIoGQE.mjs.map → InlineCodePlugin-C1SqGfv5.mjs.map} +1 -1
- package/dist/chunks/{InlineStyleMarkSpec-CjSRj4f_.mjs → InlineStyleMarkSpec-Cx3goc3W.mjs} +2 -2
- package/dist/chunks/{InlineStyleMarkSpec-CjSRj4f_.mjs.map → InlineStyleMarkSpec-Cx3goc3W.mjs.map} +1 -1
- package/dist/chunks/{LinkPlugin-Ct5Z180S.mjs → LinkPlugin-BwXDGHPe.mjs} +2 -2
- package/dist/chunks/{LinkPlugin-Ct5Z180S.mjs.map → LinkPlugin-BwXDGHPe.mjs.map} +1 -1
- package/dist/chunks/ListPlugin-DSFPSWQC.mjs +2 -0
- package/dist/chunks/ListPlugin-DSFPSWQC.mjs.map +1 -0
- package/dist/chunks/MarkCommands-CJvLGL5G.mjs +2 -0
- package/dist/chunks/MarkCommands-CJvLGL5G.mjs.map +1 -0
- package/dist/chunks/{MarkInputRule-Bdi8KPus.mjs → MarkInputRule-DNneF2gp.mjs} +2 -2
- package/dist/chunks/{MarkInputRule-Bdi8KPus.mjs.map → MarkInputRule-DNneF2gp.mjs.map} +1 -1
- package/dist/chunks/MarkdownHTMLRegistry-CISsC0lH.mjs +2 -0
- package/dist/chunks/{MarkdownHTMLRegistry-CKEx7LkR.mjs.map → MarkdownHTMLRegistry-CISsC0lH.mjs.map} +1 -1
- package/dist/chunks/MarkdownParser-D1d9zB0R.mjs +2 -0
- package/dist/chunks/{MarkdownParser-CWt3M6jR.mjs.map → MarkdownParser-D1d9zB0R.mjs.map} +1 -1
- package/dist/chunks/MarkdownSerializer-Oex2RzNw.mjs +2 -0
- package/dist/chunks/{MarkdownSerializer-J-i28out.mjs.map → MarkdownSerializer-Oex2RzNw.mjs.map} +1 -1
- package/dist/chunks/MathFont-BS8IwYh2.mjs +2 -0
- package/dist/chunks/MathFont-BS8IwYh2.mjs.map +1 -0
- package/dist/chunks/{NodeResolver-Dleih-8R.mjs → NodeResolver-BtIknXqD.mjs} +2 -2
- package/dist/chunks/{NodeResolver-Dleih-8R.mjs.map → NodeResolver-BtIknXqD.mjs.map} +1 -1
- package/dist/chunks/NodeSelectionCommands-DK3iEh18.mjs +2 -0
- package/dist/chunks/{NodeSelectionCommands-1PjwUDTJ.mjs.map → NodeSelectionCommands-DK3iEh18.mjs.map} +1 -1
- package/dist/chunks/NodeSpecPatching-BrjPAbqe.mjs +2 -0
- package/dist/chunks/NodeSpecPatching-BrjPAbqe.mjs.map +1 -0
- package/dist/chunks/PluginHelpers-WG1Lzzh3.mjs +2 -0
- package/dist/chunks/{PluginHelpers-Dx_0hfDe.mjs.map → PluginHelpers-WG1Lzzh3.mjs.map} +1 -1
- package/dist/chunks/PopupKeyboardPatterns-BcwdDxRq.mjs +2 -0
- package/dist/chunks/{PopupKeyboardPatterns-tUrT9TyV.mjs.map → PopupKeyboardPatterns-BcwdDxRq.mjs.map} +1 -1
- package/dist/chunks/PopupManager-Jz5JrUdC.mjs +2 -0
- package/dist/chunks/{PopupManager-CT-fMZJn.mjs.map → PopupManager-Jz5JrUdC.mjs.map} +1 -1
- package/dist/chunks/{PopupPositioning-BFh6Ed1D.mjs → PopupPositioning-CIqgpqlW.mjs} +2 -2
- package/dist/chunks/{PopupPositioning-BFh6Ed1D.mjs.map → PopupPositioning-CIqgpqlW.mjs.map} +1 -1
- package/dist/chunks/PrintPlugin-1m54b2-Y.mjs +2 -0
- package/dist/chunks/PrintPlugin-1m54b2-Y.mjs.map +1 -0
- package/dist/chunks/{RangeIterator-DP7Ud3Gp.mjs → RangeIterator-DDOxTQIf.mjs} +2 -2
- package/dist/chunks/{RangeIterator-DP7Ud3Gp.mjs.map → RangeIterator-DDOxTQIf.mjs.map} +1 -1
- package/dist/chunks/SchemaRegistry-acc6q_5x.mjs +2 -0
- package/dist/chunks/SchemaRegistry-acc6q_5x.mjs.map +1 -0
- package/dist/chunks/Selection-DC6AOGgF.mjs +2 -0
- package/dist/chunks/Selection-DC6AOGgF.mjs.map +1 -0
- package/dist/chunks/{SelectionSync-BSHIw1EE.mjs → SelectionSync-CcvoRrNd.mjs} +2 -2
- package/dist/chunks/{SelectionSync-BSHIw1EE.mjs.map → SelectionSync-CcvoRrNd.mjs.map} +1 -1
- package/dist/chunks/SelectionTransactions-DNCzsl_b.mjs +2 -0
- package/dist/chunks/SelectionTransactions-DNCzsl_b.mjs.map +1 -0
- package/dist/chunks/SimpleMark-CTDtEIMV.mjs +2 -0
- package/dist/chunks/{SimpleMark-7CQcA4RK.mjs.map → SimpleMark-CTDtEIMV.mjs.map} +1 -1
- package/dist/chunks/SmartPastePlugin-CjExbE9Q.mjs +2 -0
- package/dist/chunks/SmartPastePlugin-CjExbE9Q.mjs.map +1 -0
- package/dist/chunks/StarterFonts-BDQPg-cu.mjs +2 -0
- package/dist/chunks/StarterFonts-BDQPg-cu.mjs.map +1 -0
- package/dist/chunks/{StrikethroughPlugin-C2oWvGc3.mjs → StrikethroughPlugin-d-EW2YYx.mjs} +2 -2
- package/dist/chunks/{StrikethroughPlugin-C2oWvGc3.mjs.map → StrikethroughPlugin-d-EW2YYx.mjs.map} +1 -1
- package/dist/chunks/StyleRuntime-C0RSqKzG.mjs +2 -0
- package/dist/chunks/{StyleRuntime-DW6omotc.mjs.map → StyleRuntime-C0RSqKzG.mjs.map} +1 -1
- package/dist/chunks/SuperSubPlugin-C-kvFQyx.mjs +2 -0
- package/dist/chunks/{SuperSubPlugin-D1xaKrSu.mjs.map → SuperSubPlugin-C-kvFQyx.mjs.map} +1 -1
- package/dist/chunks/TableDimensions-BcARMxQB.mjs +2 -0
- package/dist/chunks/TableDimensions-BcARMxQB.mjs.map +1 -0
- package/dist/chunks/TablePlugin-B894cIXW.mjs +2 -0
- package/dist/chunks/{TablePlugin-PJe3zwr-.mjs.map → TablePlugin-B894cIXW.mjs.map} +1 -1
- package/dist/chunks/{TextColorPlugin-CTd9tfeG.mjs → TextColorPlugin-B6YoN9mR.mjs} +2 -2
- package/dist/chunks/{TextColorPlugin-CTd9tfeG.mjs.map → TextColorPlugin-B6YoN9mR.mjs.map} +1 -1
- package/dist/chunks/TextDirectionAutoPlugin-LVDkKdDX.mjs +2 -0
- package/dist/chunks/{TextDirectionAutoPlugin-CPnKVVuI.mjs.map → TextDirectionAutoPlugin-LVDkKdDX.mjs.map} +1 -1
- package/dist/chunks/TextDirectionPlugin-CtGwof7i.mjs +2 -0
- package/dist/chunks/TextDirectionPlugin-CtGwof7i.mjs.map +1 -0
- package/dist/chunks/TextDirectionService-OFOU6r_s.mjs +2 -0
- package/dist/chunks/{TextDirectionService-BcX07mw2.mjs.map → TextDirectionService-OFOU6r_s.mjs.map} +1 -1
- package/dist/chunks/TextFormattingPlugin-DlS0SeW7.mjs +2 -0
- package/dist/chunks/{TextFormattingPlugin-DBVlePqj.mjs.map → TextFormattingPlugin-DlS0SeW7.mjs.map} +1 -1
- package/dist/chunks/ThemeEngine-D4W6Y80e.mjs +3 -0
- package/dist/chunks/ThemeEngine-D4W6Y80e.mjs.map +1 -0
- package/dist/chunks/ToolbarPlugin-ClKY-LiT.mjs +2 -0
- package/dist/chunks/{ToolbarPlugin-DtfGTO_V.mjs.map → ToolbarPlugin-ClKY-LiT.mjs.map} +1 -1
- package/dist/chunks/VideoPlugin-C9z4JfP_.mjs +2 -0
- package/dist/chunks/VideoPlugin-C9z4JfP_.mjs.map +1 -0
- package/dist/chunks/XmlSupport-3Za6SIqF.mjs +2 -0
- package/dist/chunks/XmlSupport-3Za6SIqF.mjs.map +1 -0
- package/dist/chunks/full-CNi2CaF3.mjs +2 -0
- package/dist/chunks/{full-DSWM4cKQ.mjs.map → full-CNi2CaF3.mjs.map} +1 -1
- package/dist/chunks/minimal-Bykbo9So.mjs +2 -0
- package/dist/chunks/{minimal-CFkkPXef.mjs.map → minimal-Bykbo9So.mjs.map} +1 -1
- package/dist/chunks/register-CF80zDgl.mjs +3 -0
- package/dist/chunks/register-CF80zDgl.mjs.map +1 -0
- package/dist/chunks/src-5GKFQ2mQ.mjs +2 -0
- package/dist/chunks/src-5GKFQ2mQ.mjs.map +1 -0
- package/dist/chunks/xml-BsV44TrJ.mjs +2 -0
- package/dist/chunks/xml-BsV44TrJ.mjs.map +1 -0
- package/dist/decorations/Decoration.d.ts +9 -0
- package/dist/decorations/Decoration.d.ts.map +1 -1
- package/dist/editor/ContentSerializer.d.ts +2 -7
- package/dist/editor/ContentSerializer.d.ts.map +1 -1
- package/dist/editor/EditorEventEmitter.d.ts +10 -2
- package/dist/editor/EditorEventEmitter.d.ts.map +1 -1
- package/dist/editor/EditorInitializer.d.ts +2 -4
- package/dist/editor/EditorInitializer.d.ts.map +1 -1
- package/dist/editor/EditorLifecycleCoordinator.d.ts +16 -1
- package/dist/editor/EditorLifecycleCoordinator.d.ts.map +1 -1
- package/dist/editor/EditorStyleCoordinator.d.ts +11 -3
- package/dist/editor/EditorStyleCoordinator.d.ts.map +1 -1
- package/dist/editor/NotectlEditor.d.ts +15 -3
- package/dist/editor/NotectlEditor.d.ts.map +1 -1
- package/dist/fonts/math.d.ts +3 -0
- package/dist/fonts/math.d.ts.map +1 -0
- package/dist/fonts/math.mjs +1 -0
- package/dist/fonts/starter.d.ts +3 -0
- package/dist/fonts/starter.d.ts.map +1 -0
- package/dist/fonts/starter.mjs +1 -0
- package/dist/fonts.d.ts +4 -4
- package/dist/fonts.mjs +1 -1
- package/dist/full.d.ts +1 -1
- package/dist/full.mjs +1 -1
- package/dist/html.mjs +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/input/InputHandler.d.ts +4 -0
- package/dist/input/InputHandler.d.ts.map +1 -1
- package/dist/input/InputManager.d.ts +5 -0
- package/dist/input/InputManager.d.ts.map +1 -1
- package/dist/input/KeyboardHandler.d.ts +4 -0
- package/dist/input/KeyboardHandler.d.ts.map +1 -1
- package/dist/input/PasteHTMLHandler.d.ts +7 -4
- package/dist/input/PasteHTMLHandler.d.ts.map +1 -1
- package/dist/input/PasteHandler.d.ts +33 -6
- package/dist/input/PasteHandler.d.ts.map +1 -1
- package/dist/input/PasteRichBlockHandler.d.ts +3 -2
- package/dist/input/PasteRichBlockHandler.d.ts.map +1 -1
- package/dist/markdown.mjs +1 -1
- package/dist/model/Document.d.ts +42 -0
- package/dist/model/Document.d.ts.map +1 -1
- package/dist/model/DocumentNormalization.d.ts +10 -0
- package/dist/model/DocumentNormalization.d.ts.map +1 -0
- package/dist/model/FileHandlerDispatcher.d.ts +27 -0
- package/dist/model/FileHandlerDispatcher.d.ts.map +1 -0
- package/dist/model/FileHandlerRegistry.d.ts +6 -1
- package/dist/model/FileHandlerRegistry.d.ts.map +1 -1
- package/dist/model/InputRuleRegistry.d.ts +9 -1
- package/dist/model/InputRuleRegistry.d.ts.map +1 -1
- package/dist/model/KeymapRegistry.d.ts +14 -1
- package/dist/model/KeymapRegistry.d.ts.map +1 -1
- package/dist/model/MarkdownSyntaxRegistry.d.ts +2 -0
- package/dist/model/MarkdownSyntaxRegistry.d.ts.map +1 -1
- package/dist/model/PluginCallbackExecutor.d.ts +44 -0
- package/dist/model/PluginCallbackExecutor.d.ts.map +1 -0
- package/dist/model/SanitizeConfig.d.ts +8 -0
- package/dist/model/SanitizeConfig.d.ts.map +1 -1
- package/dist/model/SchemaRegistry.d.ts +24 -0
- package/dist/model/SchemaRegistry.d.ts.map +1 -1
- package/dist/model/Selection.d.ts +4 -0
- package/dist/model/Selection.d.ts.map +1 -1
- package/dist/notectl-core.mjs +1 -1
- package/dist/notectl-core.umd.js +1 -1
- package/dist/notectl-core.umd.js.map +1 -1
- package/dist/plugins/Plugin.d.ts +3 -1
- package/dist/plugins/Plugin.d.ts.map +1 -1
- package/dist/plugins/PluginContextFactory.d.ts +9 -2
- package/dist/plugins/PluginContextFactory.d.ts.map +1 -1
- package/dist/plugins/PluginLifecycle.d.ts +6 -0
- package/dist/plugins/PluginLifecycle.d.ts.map +1 -1
- package/dist/plugins/PluginManager.d.ts +9 -2
- package/dist/plugins/PluginManager.d.ts.map +1 -1
- package/dist/plugins/RegistrationTracker.d.ts +2 -0
- package/dist/plugins/RegistrationTracker.d.ts.map +1 -1
- package/dist/plugins/alignment.mjs +1 -1
- package/dist/plugins/bidi-isolation.mjs +1 -1
- package/dist/plugins/blockquote.mjs +1 -1
- package/dist/plugins/caret-navigation.mjs +1 -1
- package/dist/plugins/code-block/CodeBlockHighlighting.d.ts.map +1 -1
- package/dist/plugins/code-block/CodeBlockSchema.d.ts +6 -2
- package/dist/plugins/code-block/CodeBlockSchema.d.ts.map +1 -1
- package/dist/plugins/code-block.mjs +1 -1
- package/dist/plugins/font-size.mjs +1 -1
- package/dist/plugins/font.mjs +1 -1
- package/dist/plugins/formula/FormulaPasteInterceptor.d.ts.map +1 -1
- package/dist/plugins/formula/FormulaTypes.d.ts +1 -1
- package/dist/plugins/formula.mjs +1 -1
- package/dist/plugins/gap-cursor.mjs +1 -1
- package/dist/plugins/hard-break.mjs +1 -1
- package/dist/plugins/heading.mjs +1 -1
- package/dist/plugins/highlight.mjs +1 -1
- package/dist/plugins/horizontal-rule.mjs +1 -1
- package/dist/plugins/image.mjs +1 -1
- package/dist/plugins/inline-code.mjs +1 -1
- package/dist/plugins/language.mjs +1 -1
- package/dist/plugins/link.mjs +1 -1
- package/dist/plugins/list/ListCommands.d.ts.map +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.mjs +1 -1
- package/dist/plugins/shared/NodeSpecPatching.d.ts +2 -2
- package/dist/plugins/shared/NodeSpecPatching.d.ts.map +1 -1
- package/dist/plugins/shared.mjs +1 -1
- package/dist/plugins/smart-paste/SmartPastePlugin.d.ts.map +1 -1
- package/dist/plugins/smart-paste.mjs +1 -1
- package/dist/plugins/strikethrough.mjs +1 -1
- package/dist/plugins/super-sub.mjs +1 -1
- package/dist/plugins/table.mjs +1 -1
- package/dist/plugins/text-color.mjs +1 -1
- package/dist/plugins/text-direction-auto.mjs +1 -1
- package/dist/plugins/text-direction.mjs +1 -1
- package/dist/plugins/text-formatting.mjs +1 -1
- package/dist/plugins/toolbar.mjs +1 -1
- package/dist/plugins/video/VideoNodeSpec.d.ts.map +1 -1
- package/dist/plugins/video/VideoPlugin.d.ts.map +1 -1
- package/dist/plugins/video/VideoProviders.d.ts +3 -3
- package/dist/plugins/video/VideoSanitizeHook.d.ts +4 -20
- package/dist/plugins/video/VideoSanitizeHook.d.ts.map +1 -1
- package/dist/plugins/video.mjs +1 -1
- package/dist/presets/full.d.ts +1 -1
- package/dist/presets/full.mjs +1 -1
- package/dist/presets/minimal.d.ts +1 -1
- package/dist/presets/minimal.mjs +1 -1
- package/dist/presets.d.ts +1 -1
- package/dist/presets.mjs +1 -1
- package/dist/register.d.ts +3 -0
- package/dist/register.d.ts.map +1 -0
- package/dist/register.mjs +1 -0
- package/dist/serialization/DocumentParser.d.ts.map +1 -1
- package/dist/serialization/DocumentSerializer.d.ts.map +1 -1
- package/dist/serialization/HTMLSanitization.d.ts +12 -0
- package/dist/serialization/HTMLSanitization.d.ts.map +1 -1
- package/dist/state/EditorState.d.ts.map +1 -1
- package/dist/state/History.d.ts.map +1 -1
- package/dist/state/Mapping.d.ts +2 -0
- package/dist/state/Mapping.d.ts.map +1 -1
- package/dist/state/StepHandlers.d.ts.map +1 -1
- package/dist/state/TransactionBuilder.d.ts +2 -0
- package/dist/state/TransactionBuilder.d.ts.map +1 -1
- package/dist/state/TransactionFinalizer.d.ts +10 -0
- package/dist/state/TransactionFinalizer.d.ts.map +1 -0
- package/dist/state/TransactionSnapshot.d.ts +32 -0
- package/dist/state/TransactionSnapshot.d.ts.map +1 -0
- package/dist/test/TestUtils.d.ts.map +1 -1
- package/dist/view/BlockRendering.d.ts +13 -2
- package/dist/view/BlockRendering.d.ts.map +1 -1
- package/dist/view/DecorationRendering.d.ts +19 -8
- package/dist/view/DecorationRendering.d.ts.map +1 -1
- package/dist/view/EditorView.d.ts +4 -0
- package/dist/view/EditorView.d.ts.map +1 -1
- package/dist/view/EditorViewEvents.d.ts +8 -0
- package/dist/view/EditorViewEvents.d.ts.map +1 -1
- package/dist/view/NodeViewCallbackBoundary.d.ts +12 -0
- package/dist/view/NodeViewCallbackBoundary.d.ts.map +1 -0
- package/dist/view/NodeViewOwnership.d.ts +12 -0
- package/dist/view/NodeViewOwnership.d.ts.map +1 -0
- package/dist/view/NodeViewRegistry.d.ts +7 -1
- package/dist/view/NodeViewRegistry.d.ts.map +1 -1
- package/dist/view/Reconciler.d.ts +6 -0
- package/dist/view/Reconciler.d.ts.map +1 -1
- package/package.json +29 -228
- package/dist/chunks/AlignmentPlugin--xAFlRqE.mjs +0 -2
- package/dist/chunks/AlignmentPlugin--xAFlRqE.mjs.map +0 -1
- package/dist/chunks/AttributedMarkCommands-bagbH8Qt.mjs +0 -2
- package/dist/chunks/AttributedMarkCommands-bagbH8Qt.mjs.map +0 -1
- package/dist/chunks/BlockInsertion-CJusvrDL.mjs +0 -2
- package/dist/chunks/BlockquotePlugin-Bz2glHwX.mjs +0 -2
- package/dist/chunks/CaretNavigationPlugin-CNsT0eb4.mjs +0 -2
- package/dist/chunks/CaretNavigationPlugin-CNsT0eb4.mjs.map +0 -1
- package/dist/chunks/CodeBlockPlugin-C1hrdbSZ.mjs +0 -2
- package/dist/chunks/ColorGrid-C9RQoEWF.mjs +0 -2
- package/dist/chunks/ColorPickerPopup-DiA68Pzz.mjs +0 -2
- package/dist/chunks/ColorValidation-DAijTjG9.mjs +0 -2
- package/dist/chunks/Commands-1dFFldi7.mjs +0 -2
- package/dist/chunks/Commands-1dFFldi7.mjs.map +0 -1
- package/dist/chunks/ContentModel-NpAj7vGW.mjs +0 -2
- package/dist/chunks/Decoration-BpoEOANl.mjs +0 -2
- package/dist/chunks/Decoration-BpoEOANl.mjs.map +0 -1
- package/dist/chunks/Document-827l3P80.mjs +0 -2
- package/dist/chunks/Document-827l3P80.mjs.map +0 -1
- package/dist/chunks/DocumentParser-D2tr3ZKn.mjs +0 -2
- package/dist/chunks/DocumentParser-D2tr3ZKn.mjs.map +0 -1
- package/dist/chunks/FontSizePlugin-Dln-tYXV.mjs +0 -2
- package/dist/chunks/FormulaPlugin-By1befrR.mjs +0 -2
- package/dist/chunks/FormulaPlugin-By1befrR.mjs.map +0 -1
- package/dist/chunks/GapCursorNavigation-BuXngVu-.mjs +0 -2
- package/dist/chunks/GapCursorNavigation-BuXngVu-.mjs.map +0 -1
- package/dist/chunks/GapCursorPlugin-DAxVzXRs.mjs +0 -2
- package/dist/chunks/GapCursorPlugin-DAxVzXRs.mjs.map +0 -1
- package/dist/chunks/HTMLUtils-Bhg3_P8B.mjs +0 -2
- package/dist/chunks/HardBreakPlugin-DlbSlrdq.mjs +0 -2
- package/dist/chunks/HeadingPlugin-uMAjPOk5.mjs +0 -2
- package/dist/chunks/InlineCodePlugin-pISIoGQE.mjs +0 -2
- package/dist/chunks/ListPlugin-DAY5ezNs.mjs +0 -2
- package/dist/chunks/ListPlugin-DAY5ezNs.mjs.map +0 -1
- package/dist/chunks/MarkdownHTMLRegistry-CKEx7LkR.mjs +0 -2
- package/dist/chunks/MarkdownParser-CWt3M6jR.mjs +0 -2
- package/dist/chunks/MarkdownSerializer-J-i28out.mjs +0 -2
- package/dist/chunks/NodeSelectionCommands-1PjwUDTJ.mjs +0 -2
- package/dist/chunks/NodeSpecPatching-B_yLknTl.mjs +0 -2
- package/dist/chunks/NodeSpecPatching-B_yLknTl.mjs.map +0 -1
- package/dist/chunks/PluginHelpers-Dx_0hfDe.mjs +0 -2
- package/dist/chunks/PopupKeyboardPatterns-tUrT9TyV.mjs +0 -2
- package/dist/chunks/PopupManager-CT-fMZJn.mjs +0 -2
- package/dist/chunks/PrintPlugin-7zz9mhhU.mjs +0 -2
- package/dist/chunks/PrintPlugin-7zz9mhhU.mjs.map +0 -1
- package/dist/chunks/PrintTypes-CxU69qu3.mjs +0 -3
- package/dist/chunks/PrintTypes-CxU69qu3.mjs.map +0 -1
- package/dist/chunks/SchemaRegistry-CkBN-1yW.mjs +0 -2
- package/dist/chunks/SchemaRegistry-CkBN-1yW.mjs.map +0 -1
- package/dist/chunks/Selection-HYoVFpAx.mjs +0 -2
- package/dist/chunks/Selection-HYoVFpAx.mjs.map +0 -1
- package/dist/chunks/SimpleMark-7CQcA4RK.mjs +0 -2
- package/dist/chunks/SmartPastePlugin-CYa_nD9v.mjs +0 -2
- package/dist/chunks/SmartPastePlugin-CYa_nD9v.mjs.map +0 -1
- package/dist/chunks/StyleRuntime-DW6omotc.mjs +0 -2
- package/dist/chunks/SuperSubPlugin-D1xaKrSu.mjs +0 -2
- package/dist/chunks/TableDimensions-BBhjHNjQ.mjs +0 -2
- package/dist/chunks/TableDimensions-BBhjHNjQ.mjs.map +0 -1
- package/dist/chunks/TablePlugin-PJe3zwr-.mjs +0 -2
- package/dist/chunks/TextDirectionAutoPlugin-CPnKVVuI.mjs +0 -2
- package/dist/chunks/TextDirectionPlugin-Bns_03vL.mjs +0 -2
- package/dist/chunks/TextDirectionPlugin-Bns_03vL.mjs.map +0 -1
- package/dist/chunks/TextDirectionService-BcX07mw2.mjs +0 -2
- package/dist/chunks/TextFormattingPlugin-DBVlePqj.mjs +0 -2
- package/dist/chunks/ToolbarPlugin-DtfGTO_V.mjs +0 -2
- package/dist/chunks/VideoPlugin-BrR8g6Rz.mjs +0 -2
- package/dist/chunks/VideoPlugin-BrR8g6Rz.mjs.map +0 -1
- package/dist/chunks/WordBoundary-CFpIJDNP.mjs +0 -2
- package/dist/chunks/WordBoundary-CFpIJDNP.mjs.map +0 -1
- package/dist/chunks/XmlDetector-D7TQpw-e.mjs +0 -2
- package/dist/chunks/XmlDetector-D7TQpw-e.mjs.map +0 -1
- package/dist/chunks/XmlSupport-BYiRwlkK.mjs +0 -2
- package/dist/chunks/XmlSupport-BYiRwlkK.mjs.map +0 -1
- package/dist/chunks/fonts-DQC6Uj4r.mjs +0 -2
- package/dist/chunks/fonts-DQC6Uj4r.mjs.map +0 -1
- package/dist/chunks/full-DSWM4cKQ.mjs +0 -2
- package/dist/chunks/minimal-CFkkPXef.mjs +0 -2
- package/dist/chunks/src-DiAOfuOT.mjs +0 -2
- package/dist/chunks/src-DiAOfuOT.mjs.map +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{h as t}from"./Document-827l3P80.mjs";import{a as r,c as e,r as n,t as o}from"./Selection-HYoVFpAx.mjs";import{r as s}from"./NodeResolver-Dleih-8R.mjs";import{i}from"./NavigationQueries-Bt4zZ17v.mjs";import{t as l}from"./Platform-ByobkiCc.mjs";function u(t,r,e){return t.transaction("input").setSelection(o(r,e)).setStoredMarks(null,t.storedMarks).build()}function c(t,r){const e=s(t.doc,r)??[];return t.transaction("input").setSelection(n(r,e)).setStoredMarks(null,t.storedMarks).build()}function a(t,e,n,o,s){return t.transaction("input").setSelection(r({blockId:e,offset:n},{blockId:o,offset:s})).setStoredMarks(null,t.storedMarks).build()}function f(r,n,o){const s=r.selection;if(!e(s))return null;const a=r.getBlockOrder(),f=a.indexOf(s.blockId);if(f<0)return null;const d=function(t,r,e){if(!e)return t;if("left"!==t&&"right"!==t)return t;const n=e.querySelector(`[data-block-id="${r}"]`);return n instanceof HTMLElement?"rtl"!==l(n)?t:"left"===t?"right":"left":t}(n,s.blockId,o);if("before"===s.side&&("right"===d||"down"===d)||"after"===s.side&&("left"===d||"up"===d))return c(r,s.blockId);const m="before"===s.side?f-1:f+1;if(m<0||m>=a.length)return null;const k=a[m];if(!k)return null;if(i(r,k))return c(r,k);const b=r.getBlock(k);return b?u(r,k,"left"===d||"up"===d?t(b):0):null}export{c as i,a as n,u as r,f as t};
|
|
2
|
-
//# sourceMappingURL=GapCursorNavigation-BuXngVu-.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GapCursorNavigation-BuXngVu-.mjs","names":[],"sources":["../../src/state/SelectionTransactions.ts","../../src/view/GapCursorNavigation.ts"],"sourcesContent":["/**\n * Shared transaction builders for cursor and selection movement.\n *\n * These helpers encapsulate the common pattern of building a transaction\n * that sets a new selection and clears storedMarks.\n */\n\nimport { findNodePath } from '../model/NodeResolver.js';\nimport {\n\tcreateCollapsedSelection,\n\tcreateNodeSelection,\n\tcreateSelection,\n} from '../model/Selection.js';\nimport type { BlockId } from '../model/TypeBrands.js';\nimport type { EditorState } from './EditorState.js';\nimport type { Transaction } from './Transaction.js';\n\n/** Builds a collapsed-cursor transaction that clears storedMarks. */\nexport function moveTx(state: EditorState, blockId: BlockId, offset: number): Transaction {\n\treturn state\n\t\t.transaction('input')\n\t\t.setSelection(createCollapsedSelection(blockId, offset))\n\t\t.setStoredMarks(null, state.storedMarks)\n\t\t.build();\n}\n\n/** Builds a NodeSelection transaction that clears storedMarks. */\nexport function nodeSelTx(state: EditorState, targetId: BlockId): Transaction {\n\tconst path: BlockId[] = (findNodePath(state.doc, targetId) ?? []) as BlockId[];\n\treturn state\n\t\t.transaction('input')\n\t\t.setSelection(createNodeSelection(targetId, path))\n\t\t.setStoredMarks(null, state.storedMarks)\n\t\t.build();\n}\n\n/** Builds a range-selection transaction that clears storedMarks. */\nexport function extendTx(\n\tstate: EditorState,\n\tanchorBlockId: BlockId,\n\tanchorOffset: number,\n\theadBlockId: BlockId,\n\theadOffset: number,\n): Transaction {\n\treturn state\n\t\t.transaction('input')\n\t\t.setSelection(\n\t\t\tcreateSelection(\n\t\t\t\t{ blockId: anchorBlockId, offset: anchorOffset },\n\t\t\t\t{ blockId: headBlockId, offset: headOffset },\n\t\t\t),\n\t\t)\n\t\t.setStoredMarks(null, state.storedMarks)\n\t\t.build();\n}\n","import { getBlockLength } from '../model/Document.js';\nimport { isGapCursor } from '../model/Selection.js';\nimport type { BlockId } from '../model/TypeBrands.js';\nimport { getTextDirection } from '../platform/Platform.js';\nimport type { EditorState } from '../state/EditorState.js';\nimport { isVoidBlock } from '../state/NavigationQueries.js';\nimport { moveTx, nodeSelTx } from '../state/SelectionTransactions.js';\nimport type { Transaction } from '../state/Transaction.js';\n\nexport type GapCursorDirection = 'left' | 'right' | 'up' | 'down';\n\n/**\n * Navigates from a GapCursor position.\n *\n * - Arrow toward the adjacent void block -> NodeSelection of that block.\n * - Arrow away from the void block -> find next block: void -> NodeSelection,\n * text -> TextSelection, document boundary -> no-op.\n */\nexport function navigateFromGapCursor(\n\tstate: EditorState,\n\tdirection: GapCursorDirection,\n\tcontainer?: HTMLElement,\n): Transaction | null {\n\tconst sel = state.selection;\n\tif (!isGapCursor(sel)) return null;\n\n\tconst blockOrder: readonly BlockId[] = state.getBlockOrder();\n\tconst blockIdx: number = blockOrder.indexOf(sel.blockId);\n\tif (blockIdx < 0) return null;\n\n\t// Resolve effective horizontal direction for RTL blocks\n\tconst effectiveDir: GapCursorDirection = resolveEffectiveDirection(\n\t\tdirection,\n\t\tsel.blockId,\n\t\tcontainer,\n\t);\n\n\tconst towardVoid: boolean =\n\t\t(sel.side === 'before' && (effectiveDir === 'right' || effectiveDir === 'down')) ||\n\t\t(sel.side === 'after' && (effectiveDir === 'left' || effectiveDir === 'up'));\n\n\tif (towardVoid) return nodeSelTx(state, sel.blockId);\n\n\t// Moving away from the void block - find the neighbor in the other direction\n\tconst awayIdx: number = sel.side === 'before' ? blockIdx - 1 : blockIdx + 1;\n\tif (awayIdx < 0 || awayIdx >= blockOrder.length) return null;\n\n\tconst targetId: BlockId | undefined = blockOrder[awayIdx];\n\tif (!targetId) return null;\n\n\tif (isVoidBlock(state, targetId)) return nodeSelTx(state, targetId);\n\n\t// Text block: place cursor at start or end\n\tconst targetBlock = state.getBlock(targetId);\n\tif (!targetBlock) return null;\n\n\tconst targetOffset: number =\n\t\teffectiveDir === 'left' || effectiveDir === 'up' ? getBlockLength(targetBlock) : 0;\n\treturn moveTx(state, targetId, targetOffset);\n}\n\n/**\n * Resolves the effective navigation direction by flipping left/right\n * when the block is RTL. Vertical directions are unaffected.\n */\nfunction resolveEffectiveDirection(\n\tdirection: GapCursorDirection,\n\tblockId: BlockId,\n\tcontainer?: HTMLElement,\n): GapCursorDirection {\n\tif (!container) return direction;\n\tif (direction !== 'left' && direction !== 'right') return direction;\n\n\tconst blockEl: Element | null = container.querySelector(`[data-block-id=\"${blockId}\"]`);\n\tif (!(blockEl instanceof HTMLElement)) return direction;\n\n\tconst isRtl: boolean = getTextDirection(blockEl) === 'rtl';\n\tif (!isRtl) return direction;\n\n\treturn direction === 'left' ? 'right' : 'left';\n}\n"],"mappings":"0PAkBA,SAAgB,EAAO,EAAoB,EAAkB,GAC5D,OAAO,EACL,YAAY,SACZ,aAAa,EAAyB,EAAS,IAC/C,eAAe,KAAM,EAAM,aAC3B,OACH,CAGA,SAAgB,EAAU,EAAoB,GAC7C,MAAM,EAAmB,EAAa,EAAM,IAAK,IAAa,GAC9D,OAAO,EACL,YAAY,SACZ,aAAa,EAAoB,EAAU,IAC3C,eAAe,KAAM,EAAM,aAC3B,OACH,CAGA,SAAgB,EACf,EACA,EACA,EACA,EACA,GAEA,OAAO,EACL,YAAY,SACZ,aACA,EACC,CAAE,QAAS,EAAe,OAAQ,GAClC,CAAE,QAAS,EAAa,OAAQ,KAGjC,eAAe,KAAM,EAAM,aAC3B,OACH,CCpCA,SAAgB,EACf,EACA,EACA,GAEA,MAAM,EAAM,EAAM,UAClB,IAAK,EAAY,GAAM,OAAO,KAE9B,MAAM,EAAiC,EAAM,gBACvC,EAAmB,EAAW,QAAQ,EAAI,SAChD,GAAI,EAAW,EAAG,OAAO,KAGzB,MAAM,EAkCP,SACC,EACA,EACA,GAEA,IAAK,EAAW,OAAO,EACvB,GAAkB,SAAd,GAAsC,UAAd,EAAuB,OAAO,EAE1D,MAAM,EAA0B,EAAU,cAAc,mBAAmB,OAC3E,OAAM,aAAmB,YAE4B,QAA9B,EAAiB,GACrB,EAEE,SAAd,EAAuB,QAAU,OALM,CAM/C,CAjD0C,CACxC,EACA,EAAI,QACJ,GAOD,GAHe,WAAb,EAAI,OAAuC,UAAjB,GAA6C,SAAjB,IACzC,UAAb,EAAI,OAAsC,SAAjB,GAA4C,OAAjB,GAEtC,OAAO,EAAU,EAAO,EAAI,SAG5C,MAAM,EAA+B,WAAb,EAAI,KAAoB,EAAW,EAAI,EAAW,EAC1E,GAAI,EAAU,GAAK,GAAW,EAAW,OAAQ,OAAO,KAExD,MAAM,EAAgC,EAAW,GACjD,IAAK,EAAU,OAAO,KAEtB,GAAI,EAAY,EAAO,GAAW,OAAO,EAAU,EAAO,GAG1D,MAAM,EAAc,EAAM,SAAS,GACnC,OAAK,EAIE,EAAO,EAAO,EADH,SAAjB,GAA4C,OAAjB,EAAwB,EAAe,GAAe,GAHzD,IAK1B"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as t}from"./Selection-HYoVFpAx.mjs";import{t as e}from"./GapCursorNavigation-BuXngVu-.mjs";import{c as n,o}from"./PluginHelpers-Dx_0hfDe.mjs";var r={gapCursorActive:"Gap cursor active. Type to insert new paragraph."},s=/* #__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-CR6UdFL9.mjs"),"./locales/de.ts":()=>import("./de-CHcv_Vmf.mjs"),"./locales/es.ts":()=>import("./es-BIXm2Coj.mjs"),"./locales/fr.ts":()=>import("./fr-Bg937iAy.mjs"),"./locales/hi.ts":()=>import("./hi-B5cl8TWK.mjs"),"./locales/pt.ts":()=>import("./pt-UPF7DBlz.mjs"),"./locales/ru.ts":()=>import("./ru-CkG_bpfo.mjs"),"./locales/zh.ts":()=>import("./zh-CWIzJcXi.mjs")});async function i(t){return n(s,t,r)}var a=class{id="gap-cursor";name="Gap Cursor";priority=5;context=null;activeCursorBlockId=null;activeCursorSide=null;locale=r;async init(n){this.locale=await o(n,void 0,r,i),this.context=n,n.registerStyleSheet("\n.notectl-gap-cursor--before,\n.notectl-gap-cursor--after {\n\tposition: relative;\n}\n.notectl-gap-cursor--before::before {\n\tcontent: '';\n\tdisplay: block;\n\tposition: absolute;\n\ttop: 0;\n\tinset-inline-start: 0;\n\twidth: 100%;\n\theight: 1px;\n\tbackground: currentColor;\n\ttransform: translateY(-50%);\n\tpointer-events: none;\n\tz-index: 1;\n\tanimation: notectl-gap-blink 1.1s step-end infinite;\n}\n.notectl-gap-cursor--after::after {\n\tcontent: '';\n\tdisplay: block;\n\tposition: absolute;\n\tbottom: 0;\n\tinset-inline-start: 0;\n\twidth: 100%;\n\theight: 1px;\n\tbackground: currentColor;\n\ttransform: translateY(50%);\n\tpointer-events: none;\n\tz-index: 1;\n\tanimation: notectl-gap-blink 1.1s step-end infinite;\n}\n@media (prefers-reduced-motion: reduce) {\n\t.notectl-gap-cursor--before::before,\n\t.notectl-gap-cursor--after::after {\n\t\tanimation: none;\n\t}\n}\n@keyframes notectl-gap-blink {\n\t50% { opacity: 0; }\n}\n");const s={ArrowLeft:"left",ArrowRight:"right",ArrowUp:"up",ArrowDown:"down"},a={};for(const[o,r]of Object.entries(s))a[o]=()=>{const o=n.getState();if(!t(o.selection))return!1;const s=e(o,r,n.getContainer());return!!s&&(n.dispatch(s),!0)};n.registerKeymap(a,{priority:"navigation"})}onReady(){this.context&&this.syncCursorClass(this.context.getState())}onStateChange(e,n,o){this.context&&(this.syncCursorClass(n),!t(e.selection)&&t(n.selection)&&this.context.announce(this.locale.gapCursorActive))}destroy(){this.clearCursorClass(),this.context=null}syncCursorClass(e){if(this.clearCursorClass(),!t(e.selection)||!this.context)return;const n="before"===e.selection.side?"notectl-gap-cursor--before":"notectl-gap-cursor--after",o=this.context.getContainer().querySelector(`[data-block-id="${e.selection.blockId}"]`);o instanceof HTMLElement&&(o.classList.add(n),this.activeCursorBlockId=e.selection.blockId,this.activeCursorSide=e.selection.side)}clearCursorClass(){if(!this.context||!this.activeCursorBlockId||!this.activeCursorSide)return;const t=this.context.getContainer().querySelector(`[data-block-id="${this.activeCursorBlockId}"]`);t instanceof HTMLElement&&t.classList.remove("notectl-gap-cursor--before","notectl-gap-cursor--after"),this.activeCursorBlockId=null,this.activeCursorSide=null}};export{a as t};
|
|
2
|
-
//# sourceMappingURL=GapCursorPlugin-DAxVzXRs.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GapCursorPlugin-DAxVzXRs.mjs","names":[],"sources":["../../src/plugins/gap-cursor/GapCursorLocale.ts","../../src/plugins/gap-cursor/GapCursorPlugin.ts"],"sourcesContent":["/** Locale interface and default English locale for the GapCursorPlugin. */\n\nimport { type LocaleModuleMap, loadLocaleModule } from '../shared/LocaleLoader.js';\n\n// --- Locale Interface ---\n\nexport interface GapCursorLocale {\n\treadonly gapCursorActive: string;\n}\n\n// --- Default English Locale ---\n\nexport const GAP_CURSOR_LOCALE_EN: GapCursorLocale = {\n\tgapCursorActive: 'Gap cursor active. Type to insert new paragraph.',\n};\n\n// --- Lazy Locale Loader ---\n\nconst localeModules: LocaleModuleMap<GapCursorLocale> = import.meta.glob<{\n\tdefault: GapCursorLocale;\n}>('./locales/*.ts', { eager: false });\n\nexport async function loadGapCursorLocale(lang: string): Promise<GapCursorLocale> {\n\treturn loadLocaleModule(localeModules, lang, GAP_CURSOR_LOCALE_EN);\n}\n","/**\n * GapCursorPlugin: renders a virtual cursor at boundaries of void blocks\n * where no native browser caret can exist (e.g. between two HRs or at\n * the document edge adjacent to a void block).\n */\n\nimport { isGapCursor } from '../../model/Selection.js';\nimport type { BlockId } from '../../model/TypeBrands.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { Transaction } from '../../state/Transaction.js';\nimport { navigateFromGapCursor } from '../../view/GapCursorNavigation.js';\nimport type { Plugin, PluginContext } from '../Plugin.js';\nimport { resolveLocale } from '../shared/PluginHelpers.js';\nimport {\n\tGAP_CURSOR_LOCALE_EN,\n\ttype GapCursorLocale,\n\tloadGapCursorLocale,\n} from './GapCursorLocale.js';\n\nconst GAP_CURSOR_CSS = `\n.notectl-gap-cursor--before,\n.notectl-gap-cursor--after {\n\tposition: relative;\n}\n.notectl-gap-cursor--before::before {\n\tcontent: '';\n\tdisplay: block;\n\tposition: absolute;\n\ttop: 0;\n\tinset-inline-start: 0;\n\twidth: 100%;\n\theight: 1px;\n\tbackground: currentColor;\n\ttransform: translateY(-50%);\n\tpointer-events: none;\n\tz-index: 1;\n\tanimation: notectl-gap-blink 1.1s step-end infinite;\n}\n.notectl-gap-cursor--after::after {\n\tcontent: '';\n\tdisplay: block;\n\tposition: absolute;\n\tbottom: 0;\n\tinset-inline-start: 0;\n\twidth: 100%;\n\theight: 1px;\n\tbackground: currentColor;\n\ttransform: translateY(50%);\n\tpointer-events: none;\n\tz-index: 1;\n\tanimation: notectl-gap-blink 1.1s step-end infinite;\n}\n@media (prefers-reduced-motion: reduce) {\n\t.notectl-gap-cursor--before::before,\n\t.notectl-gap-cursor--after::after {\n\t\tanimation: none;\n\t}\n}\n@keyframes notectl-gap-blink {\n\t50% { opacity: 0; }\n}\n`;\n\nexport class GapCursorPlugin implements Plugin {\n\treadonly id = 'gap-cursor';\n\treadonly name = 'Gap Cursor';\n\treadonly priority = 5;\n\n\tprivate context: PluginContext | null = null;\n\tprivate activeCursorBlockId: BlockId | null = null;\n\tprivate activeCursorSide: 'before' | 'after' | null = null;\n\tprivate locale: GapCursorLocale = GAP_CURSOR_LOCALE_EN;\n\n\tasync init(context: PluginContext): Promise<void> {\n\t\tthis.locale = await resolveLocale(\n\t\t\tcontext,\n\t\t\tundefined,\n\t\t\tGAP_CURSOR_LOCALE_EN,\n\t\t\tloadGapCursorLocale,\n\t\t);\n\n\t\tthis.context = context;\n\n\t\tcontext.registerStyleSheet(GAP_CURSOR_CSS);\n\n\t\tconst directions: Record<string, 'left' | 'right' | 'up' | 'down'> = {\n\t\t\tArrowLeft: 'left',\n\t\t\tArrowRight: 'right',\n\t\t\tArrowUp: 'up',\n\t\t\tArrowDown: 'down',\n\t\t};\n\n\t\tconst keymap: Record<string, () => boolean> = {};\n\t\tfor (const [key, dir] of Object.entries(directions)) {\n\t\t\tkeymap[key] = (): boolean => {\n\t\t\t\tconst state: EditorState = context.getState();\n\t\t\t\tif (!isGapCursor(state.selection)) return false;\n\n\t\t\t\tconst container: HTMLElement = context.getContainer();\n\t\t\t\tconst tr: Transaction | null = navigateFromGapCursor(state, dir, container);\n\t\t\t\tif (tr) {\n\t\t\t\t\tcontext.dispatch(tr);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t};\n\t\t}\n\n\t\tcontext.registerKeymap(keymap, { priority: 'navigation' });\n\t}\n\n\tonReady(): void {\n\t\tif (!this.context) return;\n\t\tthis.syncCursorClass(this.context.getState());\n\t}\n\n\tonStateChange(oldState: EditorState, newState: EditorState, _tr: Transaction): void {\n\t\tif (!this.context) return;\n\n\t\tthis.syncCursorClass(newState);\n\n\t\tif (!isGapCursor(oldState.selection) && isGapCursor(newState.selection)) {\n\t\t\tthis.context.announce(this.locale.gapCursorActive);\n\t\t}\n\t}\n\n\tdestroy(): void {\n\t\tthis.clearCursorClass();\n\t\tthis.context = null;\n\t}\n\n\tprivate syncCursorClass(state: EditorState): void {\n\t\tthis.clearCursorClass();\n\t\tif (!isGapCursor(state.selection) || !this.context) return;\n\n\t\tconst className: string =\n\t\t\tstate.selection.side === 'before'\n\t\t\t\t? 'notectl-gap-cursor--before'\n\t\t\t\t: 'notectl-gap-cursor--after';\n\n\t\tconst blockEl: Element | null = this.context\n\t\t\t.getContainer()\n\t\t\t.querySelector(`[data-block-id=\"${state.selection.blockId}\"]`);\n\t\tif (!(blockEl instanceof HTMLElement)) return;\n\n\t\tblockEl.classList.add(className);\n\t\tthis.activeCursorBlockId = state.selection.blockId;\n\t\tthis.activeCursorSide = state.selection.side;\n\t}\n\n\tprivate clearCursorClass(): void {\n\t\tif (!this.context || !this.activeCursorBlockId || !this.activeCursorSide) return;\n\n\t\tconst blockEl: Element | null = this.context\n\t\t\t.getContainer()\n\t\t\t.querySelector(`[data-block-id=\"${this.activeCursorBlockId}\"]`);\n\t\tif (blockEl instanceof HTMLElement) {\n\t\t\tblockEl.classList.remove('notectl-gap-cursor--before', 'notectl-gap-cursor--after');\n\t\t}\n\n\t\tthis.activeCursorBlockId = null;\n\t\tthis.activeCursorSide = null;\n\t}\n}\n"],"mappings":"uJAYA,IAAa,EAAwC,CACpD,gBAAiB,oDAKZ,iBAAkD,OAAA,OAAA,CAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,uBAIxD,eAAsB,EAAoB,GACzC,OAAO,EAAiB,EAAe,EAAM,EAC9C,CCLA,IA4Ca,EAAb,MACC,GAAc,aACd,KAAgB,aAChB,SAAoB,EAEpB,QAAwC,KACxC,oBAA8C,KAC9C,iBAAsD,KACtD,OAAkC,EAElC,UAAM,CAAK,GACV,KAAK,aAAe,EACnB,OACA,EACA,EACA,GAGD,KAAK,QAAU,EAEf,EAAQ,mBAhEa,07BAkErB,MAAM,EAA+D,CACpE,UAAW,OACX,WAAY,QACZ,QAAS,KACT,UAAW,QAGN,EAAwC,CAAC,EAC/C,IAAK,MAAO,EAAK,KAAQ,OAAO,QAAQ,GACvC,EAAO,GAAA,KACN,MAAM,EAAqB,EAAQ,WACnC,IAAK,EAAY,EAAM,WAAY,OAAO,EAG1C,MAAM,EAAyB,EAAsB,EAAO,EAD7B,EAAQ,gBAEvC,QAAI,IACH,EAAQ,SAAS,IACV,IAMV,EAAQ,eAAe,EAAQ,CAAE,SAAU,cAC5C,CAEA,OAAA,GACM,KAAK,SACV,KAAK,gBAAgB,KAAK,QAAQ,WACnC,CAEA,aAAA,CAAc,EAAuB,EAAuB,GACtD,KAAK,UAEV,KAAK,gBAAgB,IAEhB,EAAY,EAAS,YAAc,EAAY,EAAS,YAC5D,KAAK,QAAQ,SAAS,KAAK,OAAO,iBAEpC,CAEA,OAAA,GACC,KAAK,mBACL,KAAK,QAAU,IAChB,CAEA,eAAA,CAAwB,GAEvB,GADA,KAAK,oBACA,EAAY,EAAM,aAAe,KAAK,QAAS,OAEpD,MAAM,EACoB,WAAzB,EAAM,UAAU,KACb,6BACA,4BAEE,EAA0B,KAAK,QACnC,eACA,cAAc,mBAAmB,EAAM,UAAU,aAC7C,aAAmB,cAEzB,EAAQ,UAAU,IAAI,GACtB,KAAK,oBAAsB,EAAM,UAAU,QAC3C,KAAK,iBAAmB,EAAM,UAAU,KACzC,CAEA,gBAAA,GACC,IAAK,KAAK,UAAY,KAAK,sBAAwB,KAAK,iBAAkB,OAE1E,MAAM,EAA0B,KAAK,QACnC,eACA,cAAc,mBAAmB,KAAK,yBACpC,aAAmB,aACtB,EAAQ,UAAU,OAAO,6BAA8B,6BAGxD,KAAK,oBAAsB,KAC3B,KAAK,iBAAmB,IACzB"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var t=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|blob|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;function e(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}var n=e,r=/[\t\n\f\r ]/;function o(t){return"string"==typeof t&&t.length>0&&!r.test(t)?t:void 0}function i(t){if(!t.startsWith("#")||1===t.length)return[];const e=new URL(t,"https://notectl.invalid/").hash.slice(1);if(""===e)return[];const n=function(t){const e=[],n=new TextEncoder;for(let r=0;r<t.length;){const o=t[r+1],i=t[r+2];if("%"===t[r]&&o&&i&&s(o)&&s(i)){e.push(Number.parseInt(`${o}${i}`,16)),r+=3;continue}const a=t.codePointAt(r);if(void 0===a)break;const c=String.fromCodePoint(a);e.push(...n.encode(c)),r+=c.length}return(new TextDecoder).decode(Uint8Array.from(e))}(e);return n===e?[e]:[e,n]}function s(t){return t>="0"&&t<="9"||t>="a"&&t<="f"||t>="A"&&t<="F"}var a=new Set(["http:","https:","mailto:","tel:"]),c=/[\u0000-\u001F\u007F]/g;function l(t){const e=t.replace(c,"").trim();if(""===e)return"";if(e.startsWith("#")||e.startsWith("/"))return e;try{const t=new URL(e,"http://_invalid_base_/");return a.has(t.protocol)?e:""}catch{return""}}var u=new Set(["p","div","h1","h2","h3","h4","h5","h6","ul","ol","li","blockquote","table","colgroup","thead","tbody","tfoot","tr","td","th","pre","figure","figcaption","section","article","header","footer"]),h=new Set(["br","hr","img","input","col","area","meta","link"]);function f(t,e=" "){const n=function(t){const e=[];let n=0,r=0;for(;r<t.length;){if("<"!==t[r]){r+=1;continue}let o=r+1;o<t.length&&"/"===t[o]&&(o+=1);const i=t[o];if(o>=t.length||!i||!g(i)){r+=1;continue}const s=p(t,o+1);if(void 0===s)break;r>n&&e.push(t.slice(n,r)),e.push(t.slice(r,s+1)),r=s+1,n=r}return n<t.length&&e.push(t.slice(n)),e}(t),r=[];let o=0,i="";const s=()=>{const t=i.trim();t.length>0&&r.push(`${e.repeat(o)}${t}`),i=""};for(const a of n){const t=a.startsWith("<")?d(a):"",n=u.has(t),c=h.has(t);n||c?(s(),a.startsWith("</")?(o=Math.max(0,o-1),r.push(`${e.repeat(o)}${a}`)):(r.push(`${e.repeat(o)}${a}`),!n||c||a.endsWith("/>")||(o+=1))):i+=a}return s(),r.join("\n")}function p(t,e){let n;for(let r=e;r<t.length;r+=1){const e=t[r]??"";if(n)e===n&&(n=void 0);else if('"'!==e&&"'"!==e){if(">"===e)return r}else n=e}}function g(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"}function d(t){return t.match(/^<\/?([a-zA-Z][a-zA-Z0-9]*)/)?.[1]?.toLowerCase()??""}export{i as a,f as i,n,o,e as r,l as s,t};
|
|
2
|
-
//# sourceMappingURL=HTMLUtils-Bhg3_P8B.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./Commands-1dFFldi7.mjs";var r=class{id="hard-break";name="Hard Break";priority=10;init(e){this.registerInlineNodeSpec(e),this.registerCommands(e),this.registerKeymap(e)}registerInlineNodeSpec(e){e.registerInlineNodeSpec({type:"hard_break",toDOM:()=>document.createElement("br"),toHTMLString:()=>"<br>",parseHTML:[{tag:"br"}],sanitize:{tags:["br"]}})}registerCommands(r){r.registerCommand("insertHardBreak",()=>{const t=e(r.getState());return!!t&&(r.dispatch(t),!0)})}registerKeymap(r){r.registerKeymap({"Shift-Enter":()=>{const t=e(r.getState());return!!t&&(r.dispatch(t),!0)}})}};export{r as t};
|
|
2
|
-
//# sourceMappingURL=HardBreakPlugin-DlbSlrdq.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{D as t,_ as e,b as n,f as o,h as i}from"./Document-827l3P80.mjs";import{o as r,t as a,u as s}from"./Selection-HYoVFpAx.mjs";import{a as c}from"./TypeBrands-Ch9856Gb.mjs";import{n as l}from"./DomUtils-Bf7JLFlx.mjs";import{s as g}from"./StyleRuntime-DW6omotc.mjs";import{c as p,o as d}from"./PluginHelpers-Dx_0hfDe.mjs";function h(t,e,n,o){const i=document.createElement("button");i.type="button",i.className="notectl-heading-picker__item",i.setAttribute("role","option"),i.setAttribute("aria-selected",String(e)),e&&i.classList.add("notectl-heading-picker__item--active");const r=document.createElement("span");r.className="notectl-heading-picker__check",r.textContent=e?"✓":"",i.appendChild(r);const a=document.createElement("span");return a.className="notectl-heading-picker__label",a.textContent=t,o&&g(a,{fontSize:o.fontSize,fontWeight:o.fontWeight}),i.appendChild(a),i.addEventListener("mousedown",n),i}function u(t,e){return t[`heading${e}`]}function f(t,e){const n=t.getState();if(!s(n.selection))return!1;const o=n.getBlock(n.selection.anchor.blockId);return!!o&&(o.type===e?k(t,c("paragraph")):k(t,c(e)))}function m(t,e){const n=t.getState(),o=n.selection;if(!s(o))return!1;const i=n.getBlock(o.anchor.blockId);return!!i&&("heading"===i.type&&i.attrs?.level===e?k(t,c("paragraph")):k(t,c("heading"),{level:e}))}function k(e,o,r){const a=e.getState(),c=a.selection;if(!s(c))return!1;const l=a.getBlock(c.anchor.blockId);if(!l)return!1;const g=a.transaction("command"),p=e.getSchemaRegistry().getNodeSpec(o);p?.excludeMarks&&p.excludeMarks.length>0&&(function(e,o,r){if(0===i(o))return;const a=new Set(r),s=n(o);let c=0;for(const n of s)if(t(n)){if(n.text.length>0)for(const t of n.marks)a.has(t.type)&&e.removeMark(o.id,c,c+n.text.length,t);c+=n.text.length}else c+=1}(g,l,p.excludeMarks),function(t,e,n){if(!e.storedMarks)return;const o=new Set(n),i=e.storedMarks.filter(t=>!o.has(t.type));i.length!==e.storedMarks.length&&t.setStoredMarks(i.length>0?i:null,e.storedMarks)}(g,a,p.excludeMarks));const d=g.setBlockType(c.anchor.blockId,o,r).setSelection(c).build();return e.dispatch(d),!0}var b=new Set(["heading","title","subtitle"]);var y={paragraph:"Paragraph",title:"Title",subtitle:"Subtitle",heading1:"Heading 1",heading2:"Heading 2",heading3:"Heading 3",heading4:"Heading 4",heading5:"Heading 5",heading6:"Heading 6",blockTypeLabel:"Block Type",blockTypesAria:"Block types"},v=/* #__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-0g2bmXTn.mjs"),"./locales/de.ts":()=>import("./de-Bwxlcuee.mjs"),"./locales/es.ts":()=>import("./es-C7uVqFYr.mjs"),"./locales/fr.ts":()=>import("./fr-D5ulA3Z6.mjs"),"./locales/hi.ts":()=>import("./hi-CrmakMVj.mjs"),"./locales/pt.ts":()=>import("./pt-_qxIe7zX.mjs"),"./locales/ru.ts":()=>import("./ru-Cs8KCNyq.mjs"),"./locales/zh.ts":()=>import("./zh-BQ73oqxc.mjs")});async function x(t){return p(v,t,y)}var S={levels:[1,2,3,4,5,6]},T={1:"h1",2:"h2",3:"h3",4:"h4",5:"h5",6:"h6"},B=class{id="heading";name="Heading";priority=30;config;locale;constructor(t){this.config={...S,...t}}async init(t){this.locale=await d(t,this.config.locale,y,x),t.registerStyleSheet("\n/* Heading Select — Width overrides for combobox button */\n.notectl-toolbar-btn--heading {\n\tmin-width: 100px;\n\tmax-width: 160px;\n}\n\n/* Heading Picker Popup */\n.notectl-heading-picker {\n\tmin-width: 200px;\n\tmax-height: 320px;\n\toverflow-y: auto;\n}\n\n.notectl-heading-picker__list {\n\tpadding: 4px 0;\n}\n\n.notectl-heading-picker__item {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\twidth: 100%;\n\tpadding: 7px 12px;\n\tborder: none;\n\tbackground: none;\n\tcursor: pointer;\n\tfont-size: 14px;\n\tcolor: var(--notectl-fg);\n\ttext-align: start;\n\twhite-space: nowrap;\n\tfont-family: inherit;\n\ttransition: background 0.1s;\n}\n\n@media (hover: hover) {\n\t.notectl-heading-picker__item:hover {\n\t\tbackground: var(--notectl-hover-bg);\n\t}\n}\n\n.notectl-heading-picker__item--active {\n\tbackground: var(--notectl-active-bg);\n\tcolor: var(--notectl-primary-fg);\n}\n\n@media (hover: hover) {\n\t.notectl-heading-picker__item--active:hover {\n\t\tbackground: var(--notectl-active-bg);\n\t}\n}\n\n.notectl-heading-picker__check {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 16px;\n\tflex-shrink: 0;\n\tfont-size: 13px;\n\tfont-weight: 600;\n\tcolor: var(--notectl-primary-fg);\n}\n\n.notectl-heading-picker__label {\n\tflex: 1;\n}\n"),this.registerNodeSpecs(t),function(t,e){t.registerCommand("setTitle",()=>f(t,"title")),t.registerCommand("setSubtitle",()=>f(t,"subtitle"));for(const n of e.levels)t.registerCommand(`setHeading${n}`,()=>m(t,n));t.registerCommand("toggleHeading",()=>m(t,1)),t.registerCommand("setParagraph",()=>k(t,c("paragraph")))}(t,this.config),function(t,n){const l={Enter:()=>function(t){return function(t,e){const n=t.getState();if(!s(n.selection))return!1;const o=n.selection;if(!r(o))return!1;const i=n.getBlock(o.anchor.blockId);return!(!i||!b.has(i.type))&&e({state:n,block:i,blockId:o.anchor.blockId,offset:o.anchor.offset})}(t,n=>{if(""===e(n.block)){const e=n.state.transaction("input").setBlockType(n.blockId,c("paragraph")).setSelection(n.state.selection).build();return t.dispatch(e),!0}const r=i(n.block);if(n.offset>=r){const e=o(),i=n.state.transaction("input").splitBlock(n.blockId,n.offset,e).setBlockType(e,c("paragraph")).setSelection(a(e,0)).build();return t.dispatch(i),!0}return!1})}(t)};for(const e of n.levels)e<=6&&(l[`Mod-Shift-${e}`]=()=>t.executeCommand(`setHeading${e}`));t.registerKeymap(l)}(t,this.config),!1!==this.config.inputRule&&function(t,e){for(const n of e.levels){const e="#".repeat(n),o=new RegExp(`^${e} $`);t.registerInputRule({pattern:o,handler(t,e,o,i){const l=t.selection;if(!s(l))return null;if(!r(l))return null;const g=t.getBlock(l.anchor.blockId);return g&&"paragraph"===g.type?t.transaction("input").deleteTextAt(l.anchor.blockId,o,o+n+1).setBlockType(l.anchor.blockId,c("heading"),{level:n}).setSelection(a(l.anchor.blockId,0)).build():null}})}}(t,this.config),function(t,e,n){t.registerBlockTypePickerEntry({id:"paragraph",label:n.paragraph,command:"setParagraph",priority:10,isActive:t=>!!s(t.selection)&&"paragraph"===t.getBlock(t.selection.anchor.blockId)?.type}),t.registerBlockTypePickerEntry({id:"title",label:n.title,command:"setTitle",priority:20,style:{fontSize:"1.6em",fontWeight:"700"},isActive:t=>!!s(t.selection)&&"title"===t.getBlock(t.selection.anchor.blockId)?.type}),t.registerBlockTypePickerEntry({id:"subtitle",label:n.subtitle,command:"setSubtitle",priority:30,style:{fontSize:"1.3em",fontWeight:"500"},isActive:t=>!!s(t.selection)&&"subtitle"===t.getBlock(t.selection.anchor.blockId)?.type});for(const o of e.levels)t.registerBlockTypePickerEntry({id:`heading-${o}`,label:u(n,o),command:`setHeading${o}`,priority:100+o,style:{fontSize:1.4-.1*o+"em",fontWeight:"600"},isActive:t=>{if(!s(t.selection))return!1;const e=t.getBlock(t.selection.anchor.blockId);return"heading"===e?.type&&e.attrs?.level===o}})}(t,this.config,this.locale),function(t,e){t.registerToolbarItem({id:"heading",group:"block",label:e.blockTypeLabel,tooltip:e.blockTypeLabel,command:"setParagraph",popupType:"combobox",getLabel:n=>function(t,e,n){if(!s(t.selection))return n.paragraph;const o=e.getBlockTypePickerRegistry().getBlockTypePickerEntries();for(const i of o)if(i.isActive(t))return i.label;return n.paragraph}(n,t,e),renderPopup:(t,n,o)=>{!function(t,e,n,o){t.classList.add("notectl-heading-picker");const i=e.getState();if(!s(i.selection))return;const r=e.getContainer(),a=document.createElement("div");a.className="notectl-heading-picker__list",a.setAttribute("role","listbox"),a.setAttribute("aria-label",n.blockTypesAria);const c=e.getBlockTypePickerRegistry().getBlockTypePickerEntries();for(const s of c){const t=s.isActive(i);a.appendChild(h(s.label,t,t=>{t.preventDefault(),t.stopPropagation(),e.executeCommand(s.command),o({restoreFocusTo:r})},s.style))}t.appendChild(a)}(t,n,e,o)},isActive:e=>t.getBlockTypePickerRegistry().getBlockTypePickerEntries().some(t=>"paragraph"!==t.id&&t.isActive(e))})}(t,this.locale)}registerNodeSpecs(t){t.registerNodeSpec({type:"title",group:"block",content:{allow:["text"]},excludeMarks:["fontSize"],toDOM(t){const e=l("h1",t.id);return e.classList.add("notectl-title"),e},toHTML:(t,e)=>`<h1 class="notectl-title">${e||"<br>"}</h1>`,parseHTML:[{tag:"h1",priority:60,getAttrs:t=>!!t.classList.contains("notectl-title")&&{}}],sanitize:{tags:["h1"],attrs:["class"]}}),t.registerNodeSpec({type:"subtitle",group:"block",content:{allow:["text"]},excludeMarks:["fontSize"],toDOM(t){const e=l("h2",t.id);return e.classList.add("notectl-subtitle"),e},toHTML:(t,e)=>`<h2 class="notectl-subtitle">${e||"<br>"}</h2>`,parseHTML:[{tag:"h2",priority:60,getAttrs:t=>!!t.classList.contains("notectl-subtitle")&&{}}],sanitize:{tags:["h2"],attrs:["class"]}}),t.registerNodeSpec({type:"heading",group:"block",content:{allow:["text"]},excludeMarks:["fontSize"],attrs:{level:{default:1}},toDOM:t=>l(T[t.attrs?.level??1]??"h1",t.id),toHTML(t,e){const n=T[t.attrs?.level??1]??"h1";return`<${n}>${e||"<br>"}</${n}>`},parseHTML:[{tag:"h1",getAttrs:()=>({level:1})},{tag:"h2",getAttrs:()=>({level:2})},{tag:"h3",getAttrs:()=>({level:3})},{tag:"h4",getAttrs:()=>({level:4})},{tag:"h5",getAttrs:()=>({level:5})},{tag:"h6",getAttrs:()=>({level:6})}],sanitize:{tags:["h1","h2","h3","h4","h5","h6"]}})}};export{y as n,x as r,B as t};
|
|
2
|
-
//# sourceMappingURL=HeadingPlugin-uMAjPOk5.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{m as t}from"./Document-827l3P80.mjs";import{o as e,t as o,u as r}from"./Selection-HYoVFpAx.mjs";import{i as n}from"./TypeBrands-Ch9856Gb.mjs";import{c as s,o as i}from"./PluginHelpers-Dx_0hfDe.mjs";import{t as l}from"./ShortcutFormatting-TwiufqeV.mjs";import{t as a}from"./SimpleMark-7CQcA4RK.mjs";var c={label:"Inline Code",tooltip:t=>`Inline Code (${t})`},m=/* #__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-CMXjVzFx.mjs"),"./locales/de.ts":()=>import("./de-e6J6nvAD.mjs"),"./locales/es.ts":()=>import("./es-fTW0TkYV.mjs"),"./locales/fr.ts":()=>import("./fr-CQs0-pNX.mjs"),"./locales/hi.ts":()=>import("./hi-C2jEsf8v.mjs"),"./locales/pt.ts":()=>import("./pt-BDam9cDu.mjs"),"./locales/ru.ts":()=>import("./ru-QcTo2yoL.mjs"),"./locales/zh.ts":()=>import("./zh-DWN1Jqn3.mjs")});async function d(t){return s(m,t,c)}var p={toolbar:!0,keymap:"Mod-E",inputRule:!0},u=new Set(["bold","italic","underline","strikethrough","highlight","font","fontSize","superscript","subscript"]),f=class{id="inline-code";name="Inline Code";priority=22;config;locale;constructor(t){this.config={...p,...t}}async init(t){this.locale=await i(t,this.config.locale,c,d),t.registerStyleSheet("\n.notectl-content code {\n\tfont-family: ui-monospace, 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;\n\tfont-size: 0.9em;\n\tpadding: 0.15em 0.35em;\n\tborder-radius: 4px;\n\tbackground-color: var(--notectl-code-bg);\n\tcolor: var(--notectl-code-color);\n\tword-break: break-word;\n}\n@media (forced-colors: active) {\n\t.notectl-content code {\n\t\tborder: 1px solid LinkText;\n\t}\n}\n"),this.registerMark(t),!1!==this.config.inputRule&&this.registerInputRule(t),this.registerExclusivityMiddleware(t)}registerMark(t){a(t,{markSpec:{type:"code",rank:3,toDOM:()=>document.createElement("code"),toHTMLString:(t,e)=>`<code>${e}</code>`,parseHTML:[{tag:"code",getAttrs:t=>"PRE"!==t.parentElement?.tagName&&{}},{tag:"span",getAttrs:t=>{const e=t.style.fontFamily.replace(/['"]/g,"").trim();return!!/^monospace$/i.test(e)&&{}}}],sanitize:{tags:["code"]}},command:"toggleInlineCode",keyBinding:null!==this.config.keymap?this.config.keymap??"Mod-E":null,toolbar:!1!==this.config.toolbar?{id:"inline_code",group:"format",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0L19.2 12l-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"/></svg>',label:this.locale.label,tooltip:this.locale.tooltip(l(this.config.keymap??"Mod-E"))}:void 0})}registerInputRule(t){t.registerInputRule({pattern:/(?:^|[^`])(`([^`\uFFFC]+)`)$/,handler(t,s,i,l){const a=t.selection;if(!r(a))return null;if(!e(a))return null;const c=t.getBlock(a.anchor.blockId);if(!c||"code_block"===c.type)return null;const m=s[2],d=s[1];if(!m||!d)return null;const p=l-d.length;return t.transaction("input").deleteTextAt(a.anchor.blockId,p,l).insertText(a.anchor.blockId,p,m,[{type:n("code")}]).setSelection(o(a.anchor.blockId,p+m.length)).build()}})}registerExclusivityMiddleware(e){e.registerMiddleware((e,o,r)=>{let s=!1;const i=[];for(const a of e.steps){if("addMark"!==a.type){i.push(a);continue}const e=a.mark.type;if("code"===e){const e=o.getBlock(a.blockId);if(e){const o=t(e,a.from,a.to),r=/* @__PURE__ */new Set;for(const t of o)if("text"===t.kind)for(const e of t.marks)u.has(e.type)&&r.add(e.type);for(const t of r)s=!0,i.push({type:"removeMark",blockId:a.blockId,from:a.from,to:a.to,mark:{type:n(t)},...a.path?{path:a.path}:{}})}i.push(a);continue}if(u.has(e)){const e=o.getBlock(a.blockId);if(e&&t(e,a.from,a.to).some(t=>"text"===t.kind&&t.marks.some(t=>"code"===t.type))){s=!0;continue}}i.push(a)}let l=e.storedMarksAfter;if(l){const t=l.some(t=>"code"===t.type),e=l.some(t=>u.has(t.type));t&&e&&(l=l.filter(t=>!u.has(t.type)),s=!0)}r(s?{...e,steps:i,storedMarksAfter:l}:e)},{name:"inline-code:mark-exclusivity",priority:50})}};export{c as n,d as r,f as t};
|
|
2
|
-
//# sourceMappingURL=InlineCodePlugin-pISIoGQE.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{E as t,_ as e,f as n,o as i,p as s,u as c}from"./Document-827l3P80.mjs";import{d as r,o,t as l,u as a}from"./Selection-HYoVFpAx.mjs";import{a as d,t as h}from"./TypeBrands-Ch9856Gb.mjs";import{r as u}from"./AttrRegistry-B3zB02z9.mjs";import{n as m}from"./DomUtils-Bf7JLFlx.mjs";import{l as p}from"./BlockInsertion-CJusvrDL.mjs";import{t as k}from"./RangeIterator-DP7Ud3Gp.mjs";import{c as f}from"./StyleRuntime-DW6omotc.mjs";import{c as b,o as g}from"./PluginHelpers-Dx_0hfDe.mjs";function y(t,e,n){return"checklist"===t?{listType:t,indent:e,checked:n??!1}:{listType:t,indent:e}}function v(t,e){const n=t.getBlock(e);if("list_item"===n?.type)return n;const i=t.getNodePath(e);if(i)for(let s=i.length-2;s>=0;s--){const e=i[s],n=e?t.getBlock(e):void 0;if("list_item"===n?.type)return n}}function x(t,e){const n=t.getBlock(e);if(!n||"list_item"!==n.type)return;const i=t.getNodePath(e);if(!i)return;const c=i.slice(0,-1),r=c[c.length-1],o=(r?s(t.getBlock(r)):t.doc.children).findIndex(t=>t.id===e);return o<0?void 0:{item:n,parentPath:c,index:o}}function I(t,e){t.removeNode(e.parentPath,e.index),s(e.item).forEach((n,i)=>{t.insertNode(e.parentPath,e.index+i,n)})}function T(e,n){const i=e.getState(),s=i.selection;return!!a(s)&&(s.anchor.blockId!==s.head.blockId?function(e,n,i){const s=n.selection;if(!a(s))return!1;const c=r(s,n.getBlockOrder()),o=w(n,c,i),l=n.transaction("command"),h=function(t,e){const n=[],i=/* @__PURE__ */new Set;return k(t,e,e=>{const s=t.getBlock(e);if(!s)return;const c=v(t,e)??s;i.has(c.id)||(i.add(c.id),n.push(c))}),n}(n,c);for(let r=h.length-1;r>=0;r--){const e=h[r];if(e)if(o)if(t(e))l.setBlockType(e.id,d("paragraph"));else{const t=x(n,e.id);t&&I(l,t)}else{const t=u(e,"list_item")?e.attrs.indent:0,n=u(e,"list_item")&&"checklist"===e.attrs.listType&&e.attrs.checked;l.setBlockType(e.id,d("list_item"),y(i,t,n))}}return l.setSelection(s),e.dispatch(l.build()),!0}(e,i,n):function(e,n,i){const s=n.selection;if(!a(s))return!1;const c=n.getBlock(s.anchor.blockId);if(!c)return!1;const r=v(n,s.anchor.blockId),o=r??c;if(r&&r.attrs?.listType===i){const i=n.transaction("command");if(t(r))i.setBlockType(r.id,d("paragraph"));else{const t=x(n,r.id);if(!t)return!1;I(i,t)}return i.setSelection(s),e.dispatch(i.build()),!0}const l=y(i,u(o,"list_item")?o.attrs.indent:0),h=n.transaction("command").setBlockType(o.id,d("list_item"),l).setSelection(s).build();return e.dispatch(h),!0}(e,i,n))}function S(t,e,n){const i=t.getState();if(!a(i.selection))return!1;if(i.selection.anchor.blockId!==i.selection.head.blockId)return function(t,e,n,i){const s=e.selection;if(!a(s))return!1;const c=r(s,e.getBlockOrder()),o=e.transaction("command");let l=!1;const h=/* @__PURE__ */new Set;return k(e,c,t=>{const s=v(e,t);if(!s||!u(s,"list_item"))return;if(h.has(s.id))return;h.add(s.id);const c=s.attrs.indent+n;c<0||c>i||(o.setBlockType(s.id,d("list_item"),y(s.attrs.listType,c,s.attrs.checked)),l=!0)}),!!l&&(o.setSelection(s),t.dispatch(o.build()),!0)}(t,i,e,n);const s=i.selection,c=v(i,s.anchor.blockId);if(!c||!u(c,"list_item"))return!1;const o=c.attrs.indent+e;if(o<0||o>n)return!1;const l=y(c.attrs.listType,o,c.attrs.checked),h=i.transaction("command").setBlockType(c.id,d("list_item"),l).setSelection(s).build();return t.dispatch(h),!0}function C(t,e){const{interactiveCheckboxes:n,targetId:i,locale:s}=e;if(t.isReadOnly()&&!n)return!1;const c=t.getState(),r=i??(a(c.selection)?c.selection.anchor.blockId:null);if(!r)return!1;const o=v(c,r);if(!o||!u(o,"list_item")||"checklist"!==o.attrs.listType)return!1;const l=!o.attrs.checked,h=y(o.attrs.listType,o.attrs.indent,l),m=c.transaction("command").setBlockType(o.id,d("list_item"),h).setSelection(c.selection).build();return t.dispatch(m),t.announce(l?s.checkedAnnouncement:s.uncheckedAnnouncement),!0}function w(t,e,n){let i=!0;return k(t,e,e=>{const s=v(t,e);s&&"list_item"===s.type&&s.attrs?.listType===n||(i=!1)}),i}var B=[{type:"bullet",icon:'<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>',inputPattern:/^[-*] $/,inputPrefix:"- "},{type:"ordered",icon:'<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>',inputPattern:/^\d+\. $/,inputPrefix:"1. "},{type:"checklist",icon:'<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>',inputPattern:/^\[[ x]] $/,inputPrefix:"[ ] "}];function L(t,e){const n=t.getState();if(!a(n.selection))return!1;const i=n.selection;if(!o(i))return!1;const c=n.getBlock(i.anchor.blockId);if(!c)return!1;if("list_item"===c.type)return e({state:n,item:c,child:void 0,childIndex:-1,childCount:0,blockId:i.anchor.blockId,offset:i.anchor.offset});const r=n.getParent(i.anchor.blockId);if(!r||"list_item"!==r.type)return!1;const l=s(r),d=l.findIndex(t=>t.id===c.id);return!(d<0)&&e({state:n,item:r,child:c,childIndex:d,childCount:l.length,blockId:i.anchor.blockId,offset:i.anchor.offset})}var _={bulletList:"Bullet List",numberedList:"Numbered List",checklist:"Checklist",checkboxLabel:"To-do item",checkedAnnouncement:"Checked",uncheckedAnnouncement:"Unchecked"},H=/* #__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-Cy_77yRf.mjs"),"./locales/de.ts":()=>import("./de-CaeEIyzV.mjs"),"./locales/es.ts":()=>import("./es-DFokqQst.mjs"),"./locales/fr.ts":()=>import("./fr-5HkMazAf.mjs"),"./locales/hi.ts":()=>import("./hi-BzbMD_cP.mjs"),"./locales/pt.ts":()=>import("./pt-CR4j8gtE.mjs"),"./locales/ru.ts":()=>import("./ru-DiwQV30V.mjs"),"./locales/zh.ts":()=>import("./zh-BQqf3wJZ.mjs")});async function z(t){return b(H,t,_)}var A="notectl-checklist-marker";function j(t,e){return{bullet:e.bulletList,ordered:e.numberedList,checklist:e.checklist}[t]}function P(t,e){if(!a(t.selection))return!1;if(t.selection.anchor.blockId!==t.selection.head.blockId)return w(t,r(t.selection,t.getBlockOrder()),e);const n=v(t,t.selection.anchor.blockId);return"list_item"===n?.type&&n.attrs?.listType===e}var $={types:["bullet","ordered","checklist"],maxIndent:4},N=class{id="list";name="List";priority=35;config;locale;context=null;checkboxClickHandler=null;constructor(t){this.config={...$,...t}}async init(t){this.context=t,this.locale=await g(t,this.config.locale,_,z);const s=this.getEnabledTypes();t.registerStyleSheet("\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;\n\tpadding-inline-start: 24px;\n\tmin-height: 1.6em;\n\tposition: relative;\n}\n\n.notectl-list-item::before {\n\tposition: absolute;\n\tinset-inline-start: 0;\n\tdisplay: inline-block;\n\twidth: 24px;\n\ttext-align: center;\n\t-webkit-user-select: none;\n\tuser-select: none;\n\tpointer-events: none;\n}\n\n/* Container items (#194): block children inherit the item's start padding.\n Trim the first/last child paragraph padding so the first text line sits on\n the marker's line and the item keeps the leaf item's vertical rhythm. */\n.notectl-list-item > p:first-of-type {\n\tpadding-top: 0;\n}\n\n.notectl-list-item > p:last-of-type {\n\tpadding-bottom: 0;\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 — the marker is a real role=\"checkbox\" element (see ListMarker.ts)\n positioned over the reserved marker zone. inline-block keeps the parent's\n line-through (on checked items) from striking the glyph. */\n.notectl-checklist-marker {\n\tposition: absolute;\n\tinset-inline-start: 0;\n\tdisplay: inline-block;\n\twidth: 24px;\n\ttext-align: center;\n\tfont-size: 16px;\n\tcolor: var(--notectl-fg-muted);\n\tcursor: pointer;\n\ttext-decoration: none;\n\t-webkit-user-select: none;\n\tuser-select: none;\n}\n\n.notectl-checklist-marker::before {\n\tcontent: '\\2610';\n}\n\n.notectl-list-item--checklist[data-checked=\"true\"] .notectl-checklist-marker {\n\tcolor: var(--notectl-success);\n}\n\n.notectl-list-item--checklist[data-checked=\"true\"] .notectl-checklist-marker::before {\n\tcontent: '\\2611';\n}\n\n.notectl-list-item--checklist[data-checked=\"true\"] {\n\tcolor: var(--notectl-fg-muted);\n\ttext-decoration: line-through;\n}\n"),this.registerNodeSpec(t),function(t,e,n,i){for(const s of n)t.registerCommand(`toggleList:${s.type}`,()=>T(t,s.type));if(t.registerCommand("indentListItem",()=>S(t,1,e.maxIndent)),t.registerCommand("outdentListItem",()=>S(t,-1,e.maxIndent)),e.types.includes("checklist")){const n=()=>C(t,{interactiveCheckboxes:e.interactiveCheckboxes,locale:i});t.registerCommand("toggleChecklistItem",n,{readonlyAllowed:!0}),t.registerKeymap({"Mod-Enter":n},{priority:"navigation"})}t.registerKeymap({Tab:()=>S(t,1,e.maxIndent),"Shift-Tab":()=>S(t,-1,e.maxIndent)})}(t,this.config,s,this.locale),function(t){t.registerKeymap({Enter:()=>function(t){return L(t,s=>{if(s.child)return function(t,e,s){if(!p(s))return!1;if(e.childIndex!==e.childCount-1)return!1;const r=x(e.state,e.item.id);if(!r)return!1;const o=e.state.transaction("input");if(1===e.childCount)return I(o,r),o.setSelection(e.state.selection),t.dispatch(o.build()),!0;const a=u(e.item,"list_item")?e.item.attrs.listType:"bullet",h=u(e.item,"list_item")?e.item.attrs.indent:0,m=n(),k=i(d("list_item"),[c("")],m,y(a,h));return o.removeNode([...r.parentPath,e.item.id],e.childIndex).insertNode(r.parentPath,r.index+1,k).setSelection(l(m,0)),t.dispatch(o.build()),!0}(t,s,s.child);if(""===e(s.item)){const e=s.state.transaction("input").setBlockType(s.blockId,d("paragraph")).setSelection(s.state.selection).build();return t.dispatch(e),!0}const r=n(),o=y(u(s.item,"list_item")?s.item.attrs.listType:"bullet",u(s.item,"list_item")?s.item.attrs.indent:0),a=s.state.transaction("input").splitBlock(s.blockId,s.offset,r).setBlockType(r,d("list_item"),o).setSelection(l(r,0)).build();return t.dispatch(a),!0})}(t),Backspace:()=>function(t){return L(t,e=>{if(0!==e.offset)return!1;if(e.child){if(0!==e.childIndex)return!1;const n=x(e.state,e.item.id);if(!n)return!1;const i=e.state.transaction("input");return I(i,n),i.setSelection(e.state.selection),t.dispatch(i.build()),!0}const n=e.state.transaction("input").setBlockType(e.blockId,d("paragraph")).setSelection(e.state.selection).build();return t.dispatch(n),!0})}(t)})}(t),!1!==this.config.inputRule&&function(t,e){for(const n of e)t.registerInputRule({pattern:n.inputPattern,handler:(t,e,i,s)=>{const c=t.selection;if(!a(c))return null;if(!o(c))return null;const r=t.getBlock(c.anchor.blockId);if(!r||"paragraph"!==r.type)return null;if("list_item"===t.getParent(c.anchor.blockId)?.type)return null;const h=e[0]??"",u=h.length,m=y(n.type,0,h.includes("[x]"));return t.transaction("input").deleteTextAt(c.anchor.blockId,i,i+u).setBlockType(c.anchor.blockId,d("list_item"),m).setSelection(l(c.anchor.blockId,0)).build()}})}(t,s),function(t,e,n){for(const i of e)t.registerToolbarItem({id:`list-${i.type}`,group:"block",icon:i.icon,label:j(i.type,n),command:`toggleList:${i.type}`,isActive:t=>P(t,i.type)})}(t,s,this.locale),this.registerCheckboxClickHandler(t)}destroy(){this.checkboxClickHandler&&this.context&&this.context.getContainer().removeEventListener("mousedown",this.checkboxClickHandler),this.checkboxClickHandler=null,this.context=null}registerNodeSpec(t){const e=this.locale.checkboxLabel;t.registerNodeSpec({type:"list_item",group:"block",content:{allow:["text","paragraph","heading","code_block","blockquote","horizontal_rule"]},attrs:{listType:{default:"bullet"},indent:{default:0},checked:{default:!1}},toDOM(t){const n=t.attrs?.listType??"bullet",i=t.attrs?.indent??0,s=t.attrs?.checked??!1,c=m("li",t.id);return c.setAttribute("role","listitem"),c.setAttribute("data-list-type",n),c.setAttribute("data-indent",String(i)),c.className=`notectl-list-item notectl-list-item--${n}`,i>0&&f(c,"marginLeft",24*i+"px"),"checklist"===n&&(c.setAttribute("data-checked",String(s)),c.appendChild(function(t,e){const n=document.createElement("span");return n.className=A,n.setAttribute("role","checkbox"),n.setAttribute("aria-checked",String(t)),n.setAttribute("aria-label",e),n.setAttribute("contenteditable","false"),n.setAttribute("data-widget","true"),n}(s,e))),c.setAttribute("aria-level",String(i+1)),c},wrapper(t){const e=t.attrs?.listType??"bullet";return{tag:"ordered"===e?"ol":"ul",key:`list-${e}`,className:`notectl-list notectl-list--${e}`,attrs:{role:"list"}}},toHTML(t,e){const n=t.attrs?.listType??"bullet",i=t.attrs?.checked??!1;return"checklist"===n?`<li role="checkbox" aria-checked="${String(i)}"><input type="checkbox" disabled${i?" checked":""}>${e||"<br>"}</li>`:`<li>${e||"<br>"}</li>`},parseHTML:[{tag:"li"}],sanitize:{tags:["ul","ol","li","input"],attrs:["type","disabled","checked","role","aria-checked"]}})}registerCheckboxClickHandler(t){this.config.types.includes("checklist")&&(this.checkboxClickHandler=e=>{if(t.isReadOnly()&&!this.config.interactiveCheckboxes)return;const n=e.target;if(!(n instanceof HTMLElement))return;const i=n.closest(`.${A}`);if(!i)return;const s=i.closest(".notectl-list-item--checklist");if(!s)return;e.preventDefault();const c=s.getAttribute("data-block-id");c&&C(t,{interactiveCheckboxes:this.config.interactiveCheckboxes,targetId:h(c),locale:this.locale})},t.getContainer().addEventListener("mousedown",this.checkboxClickHandler))}getEnabledTypes(){return B.filter(t=>this.config.types.includes(t.type))}};export{_ as n,z as r,N as t};
|
|
2
|
-
//# sourceMappingURL=ListPlugin-DAY5ezNs.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ListPlugin-DAY5ezNs.mjs","names":[],"sources":["../../src/editor/styles/list.ts","../../src/plugins/list/ListAttrsFactory.ts","../../src/plugins/list/ListItemContext.ts","../../src/plugins/list/ListCommands.ts","../../src/plugins/list/ListDefinitions.ts","../../src/plugins/list/ListInputRules.ts","../../src/plugins/list/ListKeyboardHandlers.ts","../../src/plugins/list/ListLocale.ts","../../src/plugins/list/ListMarker.ts","../../src/plugins/list/ListToolbarItems.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;\n\tpadding-inline-start: ${LIST_MARKER_WIDTH}px;\n\tmin-height: 1.6em;\n\tposition: relative;\n}\n\n.notectl-list-item::before {\n\tposition: absolute;\n\tinset-inline-start: 0;\n\tdisplay: inline-block;\n\twidth: ${LIST_MARKER_WIDTH}px;\n\ttext-align: center;\n\t-webkit-user-select: none;\n\tuser-select: none;\n\tpointer-events: none;\n}\n\n/* Container items (#194): block children inherit the item's start padding.\n Trim the first/last child paragraph padding so the first text line sits on\n the marker's line and the item keeps the leaf item's vertical rhythm. */\n.notectl-list-item > p:first-of-type {\n\tpadding-top: 0;\n}\n\n.notectl-list-item > p:last-of-type {\n\tpadding-bottom: 0;\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 — the marker is a real role=\"checkbox\" element (see ListMarker.ts)\n positioned over the reserved marker zone. inline-block keeps the parent's\n line-through (on checked items) from striking the glyph. */\n.notectl-checklist-marker {\n\tposition: absolute;\n\tinset-inline-start: 0;\n\tdisplay: inline-block;\n\twidth: ${LIST_MARKER_WIDTH}px;\n\ttext-align: center;\n\tfont-size: 16px;\n\tcolor: var(--notectl-fg-muted);\n\tcursor: pointer;\n\ttext-decoration: none;\n\t-webkit-user-select: none;\n\tuser-select: none;\n}\n\n.notectl-checklist-marker::before {\n\tcontent: '\\\\2610';\n}\n\n.notectl-list-item--checklist[data-checked=\"true\"] .notectl-checklist-marker {\n\tcolor: var(--notectl-success);\n}\n\n.notectl-list-item--checklist[data-checked=\"true\"] .notectl-checklist-marker::before {\n\tcontent: '\\\\2611';\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 * Factory for building list item block attributes.\n * Centralizes attribute construction to avoid repetitive inline object literals.\n */\n\nimport type { BlockAttrs } from '../../model/Document.js';\nimport type { ListType } from './ListPlugin.js';\n\n/** Builds a `BlockAttrs` object for a list_item block. */\nexport function buildListItemAttrs(\n\tlistType: ListType,\n\tindent: number,\n\tchecked?: boolean,\n): BlockAttrs {\n\tif (listType === 'checklist') {\n\t\treturn { listType, indent, checked: checked ?? false };\n\t}\n\treturn { listType, indent };\n}\n","/**\n * Shared resolution helpers for container list items (#194).\n *\n * With `list_item` a hybrid leaf/container block, the caret may sit inside a\n * block child of an item. Commands and keyboard handlers resolve the owning\n * item through the ancestor chain and address structural edits through the\n * item's location (parent path + child index), mirroring the blockquote\n * container conventions.\n */\n\nimport type { BlockNode } from '../../model/Document.js';\nimport { getBlockChildren } from '../../model/Document.js';\nimport type { BlockId } from '../../model/TypeBrands.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { TransactionBuilder } from '../../state/TransactionBuilder.js';\n\n/** A list item's structural address: its parent path and child index. */\nexport interface ListItemLocation {\n\treadonly item: BlockNode;\n\t/** Path from the document root to the item's parent ([] = root). */\n\treadonly parentPath: readonly BlockId[];\n\t/** The item's index among its parent's block children. */\n\treadonly index: number;\n}\n\n/**\n * Resolves the list item owning a block: the block itself when it is a\n * `list_item`, otherwise its nearest `list_item` ancestor.\n */\nexport function resolveListItem(state: EditorState, id: BlockId): BlockNode | undefined {\n\tconst block: BlockNode | undefined = state.getBlock(id);\n\tif (block?.type === 'list_item') return block;\n\tconst path: readonly BlockId[] | undefined = state.getNodePath(id);\n\tif (!path) return undefined;\n\tfor (let i = path.length - 2; i >= 0; i--) {\n\t\tconst ancestorId: BlockId | undefined = path[i];\n\t\tconst ancestor: BlockNode | undefined = ancestorId ? state.getBlock(ancestorId) : undefined;\n\t\tif (ancestor?.type === 'list_item') return ancestor;\n\t}\n\treturn undefined;\n}\n\n/** Locates a list item's structural address, or undefined if it is not found. */\nexport function locateListItem(state: EditorState, itemId: BlockId): ListItemLocation | undefined {\n\tconst item: BlockNode | undefined = state.getBlock(itemId);\n\tif (!item || item.type !== 'list_item') return undefined;\n\tconst path: readonly BlockId[] | undefined = state.getNodePath(itemId);\n\tif (!path) return undefined;\n\n\tconst parentPath: readonly BlockId[] = path.slice(0, -1);\n\tconst parentId: BlockId | undefined = parentPath[parentPath.length - 1];\n\tconst siblings: readonly BlockNode[] = parentId\n\t\t? getBlockChildren(state.getBlock(parentId) as BlockNode)\n\t\t: state.doc.children;\n\tconst index: number = siblings.findIndex((sibling) => sibling.id === itemId);\n\tif (index < 0) return undefined;\n\treturn { item, parentPath, index };\n}\n\n/**\n * Replaces a container list item with its block children in place. The\n * children keep their IDs, so a selection inside them survives the lift.\n * Leaf items must not be dissolved (their inline content is not a block);\n * convert those via `setBlockType` instead.\n */\nexport function dissolveListItem(builder: TransactionBuilder, location: ListItemLocation): void {\n\tbuilder.removeNode(location.parentPath, location.index);\n\tconst children: readonly BlockNode[] = getBlockChildren(location.item);\n\tchildren.forEach((child, offset) => {\n\t\tbuilder.insertNode(location.parentPath, location.index + offset, child);\n\t});\n}\n","/**\n * Command registration and implementations for list block types.\n * Handles toggle between list types and paragraph, indent/outdent,\n * and checklist toggle.\n */\n\nimport { forEachBlockIdInRange } from '../../commands/RangeIterator.js';\nimport { isNodeOfType } from '../../model/AttrRegistry.js';\nimport type { BlockNode } from '../../model/Document.js';\nimport { isLeafBlock } from '../../model/Document.js';\nimport { isTextSelection, selectionRange } from '../../model/Selection.js';\nimport { type BlockId, nodeType } from '../../model/TypeBrands.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { PluginContext } from '../Plugin.js';\nimport { buildListItemAttrs } from './ListAttrsFactory.js';\nimport type { ListTypeDefinition } from './ListDefinitions.js';\nimport { dissolveListItem, locateListItem, resolveListItem } from './ListItemContext.js';\nimport type { ListLocale } from './ListLocale.js';\nimport type { ListConfig, ListType } from './ListPlugin.js';\n\n/** Registers all list commands (toggleList:*, indent, outdent, toggleChecklistItem). */\nexport function registerListCommands(\n\tcontext: PluginContext,\n\tconfig: ListConfig,\n\tenabledTypes: readonly ListTypeDefinition[],\n\tlocale: ListLocale,\n): void {\n\tfor (const def of enabledTypes) {\n\t\tcontext.registerCommand(`toggleList:${def.type}`, () => {\n\t\t\treturn toggleList(context, def.type);\n\t\t});\n\t}\n\n\tcontext.registerCommand('indentListItem', () => changeIndent(context, 1, config.maxIndent));\n\n\tcontext.registerCommand('outdentListItem', () => changeIndent(context, -1, config.maxIndent));\n\n\tif (config.types.includes('checklist')) {\n\t\tconst toggleChecklistItem = (): boolean =>\n\t\t\ttoggleChecked(context, { interactiveCheckboxes: config.interactiveCheckboxes, locale });\n\n\t\tcontext.registerCommand('toggleChecklistItem', toggleChecklistItem, {\n\t\t\treadonlyAllowed: true,\n\t\t});\n\n\t\t// Mod-Enter gives keyboard-only users a way to toggle a checklist item\n\t\t// (WCAG 2.1.1). The handler declines on non-checklist blocks, so it falls\n\t\t// through to other Mod-Enter bindings (e.g. code-block insert-after).\n\t\t// Registered at navigation priority so it stays reachable in read-only mode\n\t\t// when interactiveCheckboxes is enabled, matching the mouse handler.\n\t\tcontext.registerKeymap({ 'Mod-Enter': toggleChecklistItem }, { priority: 'navigation' });\n\t}\n\n\tcontext.registerKeymap({\n\t\tTab: () => changeIndent(context, 1, config.maxIndent),\n\t\t'Shift-Tab': () => changeIndent(context, -1, config.maxIndent),\n\t});\n}\n\n// --- Command Implementations ---\n\nfunction toggleList(context: PluginContext, listType: ListType): boolean {\n\tconst state: EditorState = context.getState();\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return false;\n\n\tif (sel.anchor.blockId !== sel.head.blockId) {\n\t\treturn toggleListRange(context, state, listType);\n\t}\n\treturn toggleListSingleBlock(context, state, listType);\n}\n\nfunction toggleListSingleBlock(\n\tcontext: PluginContext,\n\tstate: EditorState,\n\tlistType: ListType,\n): boolean {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return false;\n\tconst block = state.getBlock(sel.anchor.blockId);\n\tif (!block) return false;\n\n\t// The caret may sit inside a block child of a container item (#194):\n\t// toggling always targets the owning item, never the child.\n\tconst item: BlockNode | undefined = resolveListItem(state, sel.anchor.blockId);\n\tconst target: BlockNode = item ?? block;\n\n\tif (item && item.attrs?.listType === listType) {\n\t\tconst builder = state.transaction('command');\n\t\tif (isLeafBlock(item)) {\n\t\t\tbuilder.setBlockType(item.id, nodeType('paragraph'));\n\t\t} else {\n\t\t\t// A container item cannot become a paragraph (its children are\n\t\t\t// blocks) — dissolve it into those children instead.\n\t\t\tconst location = locateListItem(state, item.id);\n\t\t\tif (!location) return false;\n\t\t\tdissolveListItem(builder, location);\n\t\t}\n\t\tbuilder.setSelection(sel);\n\t\tcontext.dispatch(builder.build());\n\t\treturn true;\n\t}\n\n\tconst existingIndent: number = isNodeOfType(target, 'list_item') ? target.attrs.indent : 0;\n\tconst attrs = buildListItemAttrs(listType, existingIndent);\n\n\tconst tr = state\n\t\t.transaction('command')\n\t\t.setBlockType(target.id, nodeType('list_item'), attrs)\n\t\t.setSelection(sel)\n\t\t.build();\n\tcontext.dispatch(tr);\n\treturn true;\n}\n\nfunction toggleListRange(context: PluginContext, state: EditorState, listType: ListType): boolean {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return false;\n\n\tconst range = selectionRange(sel, state.getBlockOrder());\n\tconst toggleOff: boolean = allBlocksMatchListType(state, range, listType);\n\tconst builder = state.transaction('command');\n\n\t// Children of a container item resolve to their owning item (#194), so a\n\t// range over its paragraphs toggles the item once, not each child.\n\tconst targets: BlockNode[] = collectToggleTargets(state, range);\n\n\t// Dissolving replaces one node with several, shifting later sibling\n\t// indices — process targets back-to-front so earlier addresses stay valid.\n\tfor (let i = targets.length - 1; i >= 0; i--) {\n\t\tconst target: BlockNode | undefined = targets[i];\n\t\tif (!target) continue;\n\n\t\tif (toggleOff) {\n\t\t\tif (isLeafBlock(target)) {\n\t\t\t\tbuilder.setBlockType(target.id, nodeType('paragraph'));\n\t\t\t} else {\n\t\t\t\tconst location = locateListItem(state, target.id);\n\t\t\t\tif (location) dissolveListItem(builder, location);\n\t\t\t}\n\t\t} else {\n\t\t\tconst existingIndent: number = isNodeOfType(target, 'list_item') ? target.attrs.indent : 0;\n\t\t\tconst existingChecked: boolean =\n\t\t\t\tisNodeOfType(target, 'list_item') &&\n\t\t\t\ttarget.attrs.listType === 'checklist' &&\n\t\t\t\ttarget.attrs.checked;\n\t\t\tbuilder.setBlockType(\n\t\t\t\ttarget.id,\n\t\t\t\tnodeType('list_item'),\n\t\t\t\tbuildListItemAttrs(listType, existingIndent, existingChecked),\n\t\t\t);\n\t\t}\n\t}\n\n\tbuilder.setSelection(sel);\n\tcontext.dispatch(builder.build());\n\treturn true;\n}\n\n/** Collects unique toggle targets: each leaf block or its owning list item. */\nfunction collectToggleTargets(\n\tstate: EditorState,\n\trange: ReturnType<typeof selectionRange>,\n): BlockNode[] {\n\tconst targets: BlockNode[] = [];\n\tconst seen = new Set<BlockId>();\n\tforEachBlockIdInRange(state, range, (bid: BlockId) => {\n\t\tconst block = state.getBlock(bid);\n\t\tif (!block) return;\n\t\tconst target: BlockNode = resolveListItem(state, bid) ?? block;\n\t\tif (seen.has(target.id)) return;\n\t\tseen.add(target.id);\n\t\ttargets.push(target);\n\t});\n\treturn targets;\n}\n\n// --- Indent / Outdent ---\n\nfunction changeIndent(context: PluginContext, delta: 1 | -1, maxIndent: number): boolean {\n\tconst state: EditorState = context.getState();\n\tif (!isTextSelection(state.selection)) return false;\n\n\tif (state.selection.anchor.blockId !== state.selection.head.blockId) {\n\t\treturn changeIndentRange(context, state, delta, maxIndent);\n\t}\n\n\tconst sel = state.selection;\n\tconst block = resolveListItem(state, sel.anchor.blockId);\n\tif (!block || !isNodeOfType(block, 'list_item')) return false;\n\n\tconst newIndent: number = block.attrs.indent + delta;\n\tif (newIndent < 0 || newIndent > maxIndent) return false;\n\n\tconst attrs = buildListItemAttrs(block.attrs.listType, newIndent, block.attrs.checked);\n\tconst tr = state\n\t\t.transaction('command')\n\t\t.setBlockType(block.id, nodeType('list_item'), attrs)\n\t\t.setSelection(sel)\n\t\t.build();\n\tcontext.dispatch(tr);\n\treturn true;\n}\n\nfunction changeIndentRange(\n\tcontext: PluginContext,\n\tstate: EditorState,\n\tdelta: 1 | -1,\n\tmaxIndent: number,\n): boolean {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return false;\n\n\tconst range = selectionRange(sel, state.getBlockOrder());\n\tconst builder = state.transaction('command');\n\tlet changed = false;\n\tconst seen = new Set<BlockId>();\n\n\tforEachBlockIdInRange(state, range, (bid: BlockId) => {\n\t\tconst block = resolveListItem(state, bid);\n\t\tif (!block || !isNodeOfType(block, 'list_item')) return;\n\t\tif (seen.has(block.id)) return;\n\t\tseen.add(block.id);\n\n\t\tconst newIndent: number = block.attrs.indent + delta;\n\t\tif (newIndent < 0 || newIndent > maxIndent) return;\n\n\t\tbuilder.setBlockType(\n\t\t\tblock.id,\n\t\t\tnodeType('list_item'),\n\t\t\tbuildListItemAttrs(block.attrs.listType, newIndent, block.attrs.checked),\n\t\t);\n\t\tchanged = true;\n\t});\n\n\tif (!changed) return false;\n\n\tbuilder.setSelection(sel);\n\tcontext.dispatch(builder.build());\n\treturn true;\n}\n\n// --- Checklist Toggle ---\n\n/** Options for {@link toggleChecked}. */\nexport interface ToggleCheckedOptions {\n\t/** When true, the toggle is allowed even in read-only mode. */\n\treadonly interactiveCheckboxes?: boolean;\n\t/** Specific checklist item to toggle. Defaults to the selection's block. */\n\treadonly targetId?: BlockId;\n\t/** Locale used for the screen-reader announcement of the new state. */\n\treadonly locale: ListLocale;\n}\n\n/**\n * Toggles the checked state of a checklist item and announces the new state to\n * screen readers. Exported for use in the checkbox click handler.\n */\nexport function toggleChecked(context: PluginContext, options: ToggleCheckedOptions): boolean {\n\tconst { interactiveCheckboxes, targetId, locale } = options;\n\tif (context.isReadOnly() && !interactiveCheckboxes) return false;\n\n\tconst state: EditorState = context.getState();\n\tconst bid: BlockId | null =\n\t\ttargetId ?? (!isTextSelection(state.selection) ? null : state.selection.anchor.blockId);\n\tif (!bid) return false;\n\n\tconst block = resolveListItem(state, bid);\n\tif (!block || !isNodeOfType(block, 'list_item') || block.attrs.listType !== 'checklist') {\n\t\treturn false;\n\t}\n\n\tconst nextChecked: boolean = !block.attrs.checked;\n\tconst attrs = buildListItemAttrs(block.attrs.listType, block.attrs.indent, nextChecked);\n\n\tconst tr = state\n\t\t.transaction('command')\n\t\t.setBlockType(block.id, nodeType('list_item'), attrs)\n\t\t.setSelection(state.selection)\n\t\t.build();\n\tcontext.dispatch(tr);\n\n\t// The marker is not focused while editing, so the aria-checked change alone is\n\t// not spoken — announce the new state explicitly (WCAG 4.1.3).\n\tcontext.announce(nextChecked ? locale.checkedAnnouncement : locale.uncheckedAnnouncement);\n\treturn true;\n}\n\n// --- Helpers ---\n\n/**\n * Checks whether all blocks in a range belong to list items of the given type\n * (children of container items resolve to their owning item, #194). Exported\n * for toolbar active-state detection.\n */\nexport function allBlocksMatchListType(\n\tstate: EditorState,\n\trange: ReturnType<typeof selectionRange>,\n\tlistType: ListType,\n): boolean {\n\tlet allMatch = true;\n\tforEachBlockIdInRange(state, range, (bid: BlockId) => {\n\t\tconst block = resolveListItem(state, bid);\n\t\tif (!block || block.type !== 'list_item' || block.attrs?.listType !== listType) {\n\t\t\tallMatch = false;\n\t\t}\n\t});\n\treturn allMatch;\n}\n","/**\n * List type metadata: icons, patterns, and type definitions.\n * Pure data constants shared across list plugin modules.\n */\n\nimport type { ListType } from './ListPlugin.js';\n\n// --- List Type Metadata ---\n\nexport interface ListTypeDefinition {\n\treadonly type: ListType;\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\nexport const LIST_TYPE_DEFINITIONS: readonly ListTypeDefinition[] = [\n\t{\n\t\ttype: 'bullet',\n\t\ticon: BULLET_LIST_ICON,\n\t\tinputPattern: /^[-*] $/,\n\t\tinputPrefix: '- ',\n\t},\n\t{\n\t\ttype: 'ordered',\n\t\ticon: NUMBERED_LIST_ICON,\n\t\tinputPattern: /^\\d+\\. $/,\n\t\tinputPrefix: '1. ',\n\t},\n\t{\n\t\ttype: 'checklist',\n\t\ticon: CHECKLIST_ICON,\n\t\tinputPattern: /^\\[[ x]] $/,\n\t\tinputPrefix: '[ ] ',\n\t},\n];\n","/**\n * Input rule registration for list block types.\n * Converts `- `, `* `, `1. `, `[ ] `, `[x] ` at the start of a paragraph into list items.\n */\n\nimport { createCollapsedSelection, isCollapsed, isTextSelection } from '../../model/Selection.js';\nimport { nodeType } from '../../model/TypeBrands.js';\nimport type { PluginContext } from '../Plugin.js';\nimport { buildListItemAttrs } from './ListAttrsFactory.js';\nimport type { ListTypeDefinition } from './ListDefinitions.js';\n\n/** Registers markdown-style input rules for configured list types. */\nexport function registerListInputRules(\n\tcontext: PluginContext,\n\tenabledTypes: readonly ListTypeDefinition[],\n): void {\n\tfor (const def of enabledTypes) {\n\t\tcontext.registerInputRule({\n\t\t\tpattern: def.inputPattern,\n\t\t\thandler: (state, match, start, _end) => {\n\t\t\t\tconst sel = state.selection;\n\t\t\t\tif (!isTextSelection(sel)) return null;\n\t\t\t\tif (!isCollapsed(sel)) return null;\n\n\t\t\t\tconst block = state.getBlock(sel.anchor.blockId);\n\t\t\t\tif (!block || block.type !== 'paragraph') return null;\n\n\t\t\t\t// Inside a container list item (#194) the rule must not fire: it\n\t\t\t\t// would nest a list_item into a list_item, which the schema forbids.\n\t\t\t\tconst parent = state.getParent(sel.anchor.blockId);\n\t\t\t\tif (parent?.type === 'list_item') return null;\n\n\t\t\t\tconst matchStr = match[0] ?? '';\n\t\t\t\tconst matchLen = matchStr.length;\n\t\t\t\tconst attrs = buildListItemAttrs(def.type, 0, matchStr.includes('[x]'));\n\n\t\t\t\treturn state\n\t\t\t\t\t.transaction('input')\n\t\t\t\t\t.deleteTextAt(sel.anchor.blockId, start, start + matchLen)\n\t\t\t\t\t.setBlockType(sel.anchor.blockId, nodeType('list_item'), attrs)\n\t\t\t\t\t.setSelection(createCollapsedSelection(sel.anchor.blockId, 0))\n\t\t\t\t\t.build();\n\t\t\t},\n\t\t});\n\t}\n}\n","/**\n * Keyboard handlers for list block types.\n *\n * Leaf items: Enter splits into a new item (or exits an empty item),\n * Backspace at the start converts back to a paragraph.\n *\n * Container items (#194): the caret sits inside a block child. Enter on an\n * empty trailing child exits into a new sibling item (Enter-Enter continues\n * the list); Backspace at the start of the first child dissolves the item\n * into its children — both mirroring the blockquote container conventions.\n * Everything else falls through to the default split/merge behavior.\n */\n\nimport { isEmptyParagraph } from '../../commands/BlockInsertion.js';\nimport { isNodeOfType } from '../../model/AttrRegistry.js';\nimport type { BlockNode } from '../../model/Document.js';\nimport { generateBlockId, getBlockChildren, getBlockText } from '../../model/Document.js';\nimport { createBlockNode, createTextNode } from '../../model/Document.js';\nimport { createCollapsedSelection, isCollapsed, isTextSelection } from '../../model/Selection.js';\nimport type { BlockId } from '../../model/TypeBrands.js';\nimport { nodeType } from '../../model/TypeBrands.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { PluginContext } from '../Plugin.js';\nimport { buildListItemAttrs } from './ListAttrsFactory.js';\nimport { type ListItemLocation, dissolveListItem, locateListItem } from './ListItemContext.js';\n\n// --- Context Guard ---\n\ninterface ListContext {\n\treadonly state: EditorState;\n\t/** The list item owning the caret (the caret block itself for leaf items). */\n\treadonly item: BlockNode;\n\t/** The caret's block child of a container item; undefined for leaf items. */\n\treadonly child: BlockNode | undefined;\n\treadonly childIndex: number;\n\treadonly childCount: number;\n\treadonly blockId: BlockId;\n\treadonly offset: number;\n}\n\n/**\n * Guards against NodeSelection, non-collapsed selections, and carets outside\n * list items. Resolves both leaf items (caret directly inside the item) and\n * container items (caret inside a direct block child of the item).\n */\nfunction withListContext(context: PluginContext, handler: (ctx: ListContext) => boolean): boolean {\n\tconst state: EditorState = context.getState();\n\tif (!isTextSelection(state.selection)) return false;\n\n\tconst sel = state.selection;\n\tif (!isCollapsed(sel)) return false;\n\n\tconst block: BlockNode | undefined = state.getBlock(sel.anchor.blockId);\n\tif (!block) return false;\n\n\tif (block.type === 'list_item') {\n\t\treturn handler({\n\t\t\tstate,\n\t\t\titem: block,\n\t\t\tchild: undefined,\n\t\t\tchildIndex: -1,\n\t\t\tchildCount: 0,\n\t\t\tblockId: sel.anchor.blockId,\n\t\t\toffset: sel.anchor.offset,\n\t\t});\n\t}\n\n\tconst parent: BlockNode | undefined = state.getParent(sel.anchor.blockId);\n\tif (!parent || parent.type !== 'list_item') return false;\n\tconst children: readonly BlockNode[] = getBlockChildren(parent);\n\tconst childIndex: number = children.findIndex((c) => c.id === block.id);\n\tif (childIndex < 0) return false;\n\n\treturn handler({\n\t\tstate,\n\t\titem: parent,\n\t\tchild: block,\n\t\tchildIndex,\n\t\tchildCount: children.length,\n\t\tblockId: sel.anchor.blockId,\n\t\toffset: sel.anchor.offset,\n\t});\n}\n\n/** Registers Enter and Backspace keymaps for list items. */\nexport function registerListKeymaps(context: PluginContext): void {\n\tcontext.registerKeymap({\n\t\tEnter: () => handleEnter(context),\n\t\tBackspace: () => handleBackspace(context),\n\t});\n}\n\n// --- Enter Handler ---\n\n/**\n * Handles Enter inside a list item.\n * Leaf items: empty → exit list (convert to paragraph); non-empty → split\n * into a new item of the same type.\n * Container items: an empty trailing child exits into a new sibling item;\n * a lone empty child dissolves the item. Everything else falls through to\n * the default split (which grows the item's children).\n */\nfunction handleEnter(context: PluginContext): boolean {\n\treturn withListContext(context, (ctx) => {\n\t\tif (ctx.child) return handleEnterInContainerChild(context, ctx, ctx.child);\n\n\t\tconst text: string = getBlockText(ctx.item);\n\n\t\tif (text === '') {\n\t\t\tconst tr = ctx.state\n\t\t\t\t.transaction('input')\n\t\t\t\t.setBlockType(ctx.blockId, nodeType('paragraph'))\n\t\t\t\t.setSelection(ctx.state.selection)\n\t\t\t\t.build();\n\t\t\tcontext.dispatch(tr);\n\t\t\treturn true;\n\t\t}\n\n\t\tconst newBlockId = generateBlockId();\n\t\tconst listType = isNodeOfType(ctx.item, 'list_item') ? ctx.item.attrs.listType : 'bullet';\n\t\tconst indent: number = isNodeOfType(ctx.item, 'list_item') ? ctx.item.attrs.indent : 0;\n\t\tconst attrs = buildListItemAttrs(listType, indent);\n\n\t\tconst tr = ctx.state\n\t\t\t.transaction('input')\n\t\t\t.splitBlock(ctx.blockId, ctx.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\n/** Enter inside a container item's child: exit on an empty trailing child. */\nfunction handleEnterInContainerChild(\n\tcontext: PluginContext,\n\tctx: ListContext,\n\tchild: BlockNode,\n): boolean {\n\tif (!isEmptyParagraph(child)) return false;\n\tif (ctx.childIndex !== ctx.childCount - 1) return false;\n\n\tconst location: ListItemLocation | undefined = locateListItem(ctx.state, ctx.item.id);\n\tif (!location) return false;\n\n\tconst builder = ctx.state.transaction('input');\n\n\tif (ctx.childCount === 1) {\n\t\t// A lone empty child: the item has no content left — dissolve it and\n\t\t// keep the paragraph (same ID, so the caret stays put).\n\t\tdissolveListItem(builder, location);\n\t\tbuilder.setSelection(ctx.state.selection);\n\t\tcontext.dispatch(builder.build());\n\t\treturn true;\n\t}\n\n\t// Drop the empty trailing child and continue the list with a fresh item.\n\tconst listType = isNodeOfType(ctx.item, 'list_item') ? ctx.item.attrs.listType : 'bullet';\n\tconst indent: number = isNodeOfType(ctx.item, 'list_item') ? ctx.item.attrs.indent : 0;\n\tconst newItemId = generateBlockId();\n\tconst newItem: BlockNode = createBlockNode(\n\t\tnodeType('list_item'),\n\t\t[createTextNode('')],\n\t\tnewItemId,\n\t\tbuildListItemAttrs(listType, indent),\n\t);\n\n\tbuilder\n\t\t.removeNode([...location.parentPath, ctx.item.id], ctx.childIndex)\n\t\t.insertNode(location.parentPath, location.index + 1, newItem)\n\t\t.setSelection(createCollapsedSelection(newItemId, 0));\n\tcontext.dispatch(builder.build());\n\treturn true;\n}\n\n// --- Backspace Handler ---\n\n/**\n * Handles Backspace at the start of a list item.\n * Leaf items convert back to a paragraph. Container items dissolve into\n * their block children when the caret sits at the very start of the first\n * child (the un-list gesture); later children fall through to the default\n * sibling merge.\n */\nfunction handleBackspace(context: PluginContext): boolean {\n\treturn withListContext(context, (ctx) => {\n\t\tif (ctx.offset !== 0) return false;\n\n\t\tif (ctx.child) {\n\t\t\tif (ctx.childIndex !== 0) return false;\n\t\t\tconst location: ListItemLocation | undefined = locateListItem(ctx.state, ctx.item.id);\n\t\t\tif (!location) return false;\n\t\t\tconst builder = ctx.state.transaction('input');\n\t\t\tdissolveListItem(builder, location);\n\t\t\tbuilder.setSelection(ctx.state.selection);\n\t\t\tcontext.dispatch(builder.build());\n\t\t\treturn true;\n\t\t}\n\n\t\tconst tr = ctx.state\n\t\t\t.transaction('input')\n\t\t\t.setBlockType(ctx.blockId, nodeType('paragraph'))\n\t\t\t.setSelection(ctx.state.selection)\n\t\t\t.build();\n\t\tcontext.dispatch(tr);\n\t\treturn true;\n\t});\n}\n","/**\n * Locale interface and default English locale for the ListPlugin.\n */\n\nimport { type LocaleModuleMap, loadLocaleModule } from '../shared/LocaleLoader.js';\n\n// --- Locale Interface ---\n\nexport interface ListLocale {\n\treadonly bulletList: string;\n\treadonly numberedList: string;\n\treadonly checklist: string;\n\t/** Accessible name for the checklist item's checkbox marker (screen readers). */\n\treadonly checkboxLabel: string;\n\t/** Announced when a checklist item is toggled on. */\n\treadonly checkedAnnouncement: string;\n\t/** Announced when a checklist item is toggled off. */\n\treadonly uncheckedAnnouncement: 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\tcheckboxLabel: 'To-do item',\n\tcheckedAnnouncement: 'Checked',\n\tuncheckedAnnouncement: 'Unchecked',\n};\n\n// --- Lazy Locale Loader ---\n\nconst localeModules: LocaleModuleMap<ListLocale> = import.meta.glob<{\n\tdefault: ListLocale;\n}>('./locales/*.ts', { eager: false });\n\nexport async function loadListLocale(lang: string): Promise<ListLocale> {\n\treturn loadLocaleModule(localeModules, lang, LIST_LOCALE_EN);\n}\n","/**\n * Accessible checkbox marker for checklist items.\n *\n * The marker is a real `role=\"checkbox\"` element so assistive technology can\n * announce the item's checked state (WCAG 4.1.2 Name, Role, Value). It is\n * rendered `contenteditable=\"false\"` and flagged `data-widget` so the selection\n * layer treats it as zero-width view chrome, never as document content or a caret\n * position. The visible checkbox glyph is drawn in CSS.\n */\n\n/** CSS class identifying the checklist checkbox marker element. */\nexport const CHECKLIST_MARKER_CLASS = 'notectl-checklist-marker';\n\n/** Creates the accessible checkbox marker for a checklist item. */\nexport function createChecklistMarker(checked: boolean, label: string): HTMLElement {\n\tconst marker: HTMLElement = document.createElement('span');\n\tmarker.className = CHECKLIST_MARKER_CLASS;\n\tmarker.setAttribute('role', 'checkbox');\n\tmarker.setAttribute('aria-checked', String(checked));\n\tmarker.setAttribute('aria-label', label);\n\tmarker.setAttribute('contenteditable', 'false');\n\tmarker.setAttribute('data-widget', 'true');\n\treturn marker;\n}\n","/**\n * Toolbar item registration for list block types.\n * Registers bullet, ordered, and checklist toolbar buttons with active-state detection.\n */\n\nimport { isTextSelection, selectionRange } from '../../model/Selection.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { PluginContext } from '../Plugin.js';\nimport { allBlocksMatchListType } from './ListCommands.js';\nimport type { ListTypeDefinition } from './ListDefinitions.js';\nimport { resolveListItem } from './ListItemContext.js';\nimport type { ListLocale } from './ListLocale.js';\nimport type { ListType } from './ListPlugin.js';\n\n/** Registers toolbar items for each enabled list type. */\nexport function registerListToolbarItems(\n\tcontext: PluginContext,\n\tenabledTypes: readonly ListTypeDefinition[],\n\tlocale: ListLocale,\n): void {\n\tfor (const def of enabledTypes) {\n\t\tcontext.registerToolbarItem({\n\t\t\tid: `list-${def.type}`,\n\t\t\tgroup: 'block',\n\t\t\ticon: def.icon,\n\t\t\tlabel: getListLabel(def.type, locale),\n\t\t\tcommand: `toggleList:${def.type}`,\n\t\t\tisActive: (state) => isListActive(state, def.type),\n\t\t});\n\t}\n}\n\n// --- Helpers ---\n\nfunction getListLabel(type: ListType, locale: ListLocale): string {\n\tconst labels: Record<ListType, string> = {\n\t\tbullet: locale.bulletList,\n\t\tordered: locale.numberedList,\n\t\tchecklist: locale.checklist,\n\t};\n\treturn labels[type];\n}\n\nfunction isListActive(state: EditorState, listType: ListType): boolean {\n\tif (!isTextSelection(state.selection)) return false;\n\n\tif (state.selection.anchor.blockId !== state.selection.head.blockId) {\n\t\tconst range = selectionRange(state.selection, state.getBlockOrder());\n\t\treturn allBlocksMatchListType(state, range, listType);\n\t}\n\n\t// Children of container items resolve to their owning item (#194).\n\tconst block = resolveListItem(state, state.selection.anchor.blockId);\n\treturn block?.type === 'list_item' && block.attrs?.listType === listType;\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 * This file is a thin orchestrator — command logic, input rules, keyboard\n * handlers, and toolbar rendering are delegated to dedicated modules.\n *\n * Sibling structure is modeled flat: every item carries a `listType` and an\n * `indent` attribute, so nesting between items needs no deep tree. Item\n * content is hybrid (#194): a single-paragraph item is a leaf with inline\n * children, while a multi-block item (second paragraph, code block, quote,\n * heading) is a container whose children are blocks.\n */\n\nimport { LIST_CSS, LIST_MARKER_WIDTH } from '../../editor/styles/list.js';\nimport { blockId } from '../../model/TypeBrands.js';\nimport { setStyleProperty } from '../../style/StyleRuntime.js';\nimport { createBlockElement } from '../../view/DomUtils.js';\nimport type { Plugin, PluginContext } from '../Plugin.js';\nimport { resolveLocale } from '../shared/PluginHelpers.js';\nimport { registerListCommands, toggleChecked } from './ListCommands.js';\nimport { LIST_TYPE_DEFINITIONS, type ListTypeDefinition } from './ListDefinitions.js';\nimport { registerListInputRules } from './ListInputRules.js';\nimport { registerListKeymaps } from './ListKeyboardHandlers.js';\nimport { LIST_LOCALE_EN, type ListLocale, loadListLocale } from './ListLocale.js';\nimport { CHECKLIST_MARKER_CLASS, createChecklistMarker } from './ListMarker.js';\nimport { registerListToolbarItems } from './ListToolbarItems.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/** Live Markdown shortcuts: `- `/`* ` (bullet), `1. ` (ordered), `[ ] ` (checklist). Default true. */\n\treadonly inputRule?: 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// --- 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\tasync init(context: PluginContext): Promise<void> {\n\t\tthis.context = context;\n\t\tthis.locale = await resolveLocale(context, this.config.locale, LIST_LOCALE_EN, loadListLocale);\n\t\tconst enabledTypes = this.getEnabledTypes();\n\n\t\tcontext.registerStyleSheet(LIST_CSS);\n\t\tthis.registerNodeSpec(context);\n\t\tregisterListCommands(context, this.config, enabledTypes, this.locale);\n\t\tregisterListKeymaps(context);\n\t\tif (this.config.inputRule !== false) registerListInputRules(context, enabledTypes);\n\t\tregisterListToolbarItems(context, enabledTypes, this.locale);\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\tconst checkboxLabel: string = this.locale.checkboxLabel;\n\n\t\tcontext.registerNodeSpec({\n\t\t\ttype: 'list_item',\n\t\t\tgroup: 'block',\n\t\t\t// Hybrid content model (#194): the common single-paragraph item is a\n\t\t\t// leaf (inline text children); multi-block items are containers with\n\t\t\t// block children. Sibling nesting stays flat-with-indent, so list_item\n\t\t\t// itself is deliberately not an allowed child.\n\t\t\tcontent: {\n\t\t\t\tallow: ['text', 'paragraph', 'heading', 'code_block', 'blockquote', 'horizontal_rule'],\n\t\t\t},\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\tsetStyleProperty(li, 'marginLeft', `${indent * LIST_MARKER_WIDTH}px`);\n\t\t\t\t}\n\n\t\t\t\tif (listType === 'checklist') {\n\t\t\t\t\t// `data-checked` drives the CSS glyph; the checked state is exposed to\n\t\t\t\t\t// assistive technology via the marker's own role=\"checkbox\", not via an\n\t\t\t\t\t// (invalid) aria-checked on the listitem. The marker is the first child\n\t\t\t\t\t// so reconciled inline content is appended after it.\n\t\t\t\t\tli.setAttribute('data-checked', String(checked));\n\t\t\t\t\tli.appendChild(createChecklistMarker(checked, checkboxLabel));\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\tconst listType: string = (node.attrs?.listType as string) ?? 'bullet';\n\t\t\t\tconst checked: boolean = (node.attrs?.checked as boolean) ?? false;\n\n\t\t\t\tif (listType === 'checklist') {\n\t\t\t\t\tconst checkedAttr: string = checked ? ' checked' : '';\n\t\t\t\t\tconst ariaChecked: string = String(checked);\n\t\t\t\t\treturn (\n\t\t\t\t\t\t`<li role=\"checkbox\" aria-checked=\"${ariaChecked}\">` +\n\t\t\t\t\t\t`<input type=\"checkbox\" disabled${checkedAttr}>` +\n\t\t\t\t\t\t`${content || '<br>'}</li>`\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn `<li>${content || '<br>'}</li>`;\n\t\t\t},\n\t\t\tparseHTML: [{ tag: 'li' }],\n\t\t\tsanitize: {\n\t\t\t\ttags: ['ul', 'ol', 'li', 'input'],\n\t\t\t\tattrs: ['type', 'disabled', 'checked', 'role', 'aria-checked'],\n\t\t\t},\n\t\t});\n\t}\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\t// Toggle only when the checkbox marker itself is clicked. The marker is a\n\t\t\t// real element, so this is precise — no geometry/RTL math needed.\n\t\t\tconst marker: Element | null = target.closest(`.${CHECKLIST_MARKER_CLASS}`);\n\t\t\tif (!marker) return;\n\n\t\t\tconst li: Element | null = marker.closest('.notectl-list-item--checklist');\n\t\t\tif (!li) 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\ttoggleChecked(context, {\n\t\t\t\tinteractiveCheckboxes: this.config.interactiveCheckboxes,\n\t\t\t\ttargetId: blockId(bid),\n\t\t\t\tlocale: this.locale,\n\t\t\t});\n\t\t};\n\n\t\tconst container: HTMLElement = context.getContainer();\n\t\tcontainer.addEventListener('mousedown', this.checkboxClickHandler);\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"],"mappings":"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"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{n as t,s as e}from"./HTMLUtils-Bhg3_P8B.mjs";import{t as n}from"./SchemaRegistry-CkBN-1yW.mjs";import{l as r,n as i,o as s,r as o}from"./TableDimensions-BBhjHNjQ.mjs";var a=/^\s*\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)*\|?\s*$/;function c(t){let e=t.trim();e.startsWith("|")&&(e=e.slice(1)),e.endsWith("|")&&!e.endsWith("\\|")&&(e=e.slice(0,-1));const n=[];let r="";for(let i=0;i<e.length;i++){const t=e[i]??"";"\\"!==t||"|"!==e[i+1]?"|"!==t?r+=t:(n.push(r.trim()),r=""):(r+="|",i++)}return n.push(r.trim()),n}function l(t){const e=t.trim(),n=e.startsWith(":"),r=e.endsWith(":");return n&&r?"center":r?"end":n?"start":null}function u(t,e,n){const r=t[e]??"",i=t[e+1]??"";if(!r.includes("|"))return null;if(!a.test(i))return null;const s=c(r),o=c(i).map(l);if(o.length!==s.length)return null;const u=[];let g=e+2;for(;g<t.length;){const e=t[g]??"";if(""===e.trim())break;if(!e.includes("|")&&(!n||n(e)))break;u.push(c(e)),g++}return{aligns:o,header:s,rows:u,linesConsumed:g-e}}var g=/[!-/:-@[-`{-~]/,h=/&(#[xX][0-9a-fA-F]{1,6}|#[0-9]{1,7}|[a-zA-Z][a-zA-Z0-9]{1,31});/y,f={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" ",copy:"©",reg:"®",hellip:"…",mdash:"—",ndash:"–"};function p(t){if("#"===t[0]){const e="x"===t[1]||"X"===t[1],n=Number.parseInt(t.slice(e?2:1),e?16:10);if(!Number.isFinite(n)||n<0||n>1114111)return`&${t};`;if(0===n)return"�";try{const t=String.fromCodePoint(n);return"\n"===t||"\r"===t?" ":t}catch{return"�"}}return f[t]??function(t){if("undefined"==typeof document)return null;const e=m.get(t);if(void 0!==e)return e;const n=document.createElement("div");n.innerHTML=`&${t};`;const r=n.textContent??"",i=""!==r&&r!==`&${t};`?r:null;return m.set(t,i),i}(t)??`&${t};`}function d(t,e){return h.lastIndex=e,h.exec(t)}var m=/* @__PURE__ */new Map;function b(t){let e="",n=0;for(;n<t.length;){const r=t[n]??"";if("\\"===r&&g.test(t[n+1]??""))e+=t[n+1],n+=2;else{if("&"===r){const r=d(t,n);if(r?.[1]){e+=p(r[1]),n+=r[0].length;continue}}e+=r,n++}}return e}function $(t){let e="",n=0;for(;n<t.length;){const r=t[n]??"";if("&"===r){const r=d(t,n);if(r?.[1]){e+=p(r[1]),n+=r[0].length;continue}}e+=r,n++}return e}var y,k=new Set(["address","article","aside","blockquote","details","div","dl","dd","dt","figure","figcaption","footer","form","h1","h2","h3","h4","h5","h6","header","hr","iframe","main","nav","ol","p","pre","section","table","tbody","td","tfoot","th","thead","tr","ul","video"]),M=/^ {0,3}(#{1,6})(?:[ \t]+(.*?))?(?:[ \t]+#+)?[ \t]*$/,T=/^ {0,3}(`{3,}|~{3,})[ \t]*(.*)$/,S=/^ {0,3}([-*_])[ \t]*(?:\1[ \t]*){2,}$/,x=/^ {0,3}>[ ]?/,L=/^([ \t]*)([-*+])(?:([ \t]+)(.*))?$/,H=/^([ \t]*)(\d{1,9})([.)])(?:([ \t]+)(.*))?$/,w=/^\[([ xX])\][ \t]+(.*)$/,N=/^ {0,3}=+[ \t]*$/,z=/^ {0,3}-+[ \t]*$/,A=/^ {0,3}<(\/?)([a-zA-Z][a-zA-Z0-9-]*)|^ {0,3}<!--/;function v(t){return""===t.trim()}function D(t){const e=t.match(T);return e?"`"===(e[1]??"")[0]&&(e[2]??"").includes("`")?null:e:null}function O(t,e=!0,n=[]){return _(t.replace(/\r\n?/g,"\n").replace(/\n$/,"").split("\n"),e,n)}function _(t,e,n,r=0){const i=[];let s=0;for(;s<t.length;){const o=t[s]??"";if(v(o)){s++;continue}const a=P(n,t,s,i);if(a>0){s+=a;continue}if(e){const e=u(t,s,J);if(e){i.push({type:"table",aligns:e.aligns,header:e.header,rows:e.rows}),s+=e.linesConsumed;continue}}const c=D(o);if(c){s=C(t,s,c,i);continue}const l=o.match(M);if(l){const t=(l[2]??"").trim(),e=/^#+$/.test(t)?"":t;i.push({type:"heading",level:(l[1]??"#").length,text:e}),s++;continue}if(S.test(o)){i.push({type:"hr"}),s++;continue}if(x.test(o)){if(r>=32){s=K(t,s,i);continue}s=R(t,s,i,e,n,r);continue}const g=r<32?X(o):null;s=g?V(t,s,g,i,e,n,r):j(o)?I(t,s,i):U(o)?G(t,s,i):K(t,s,i)}return i}function C(t,e,n,r){const i=n[1]??"```",s=i[0]??"`",o=b((n[2]??"").trim().split(/\s+/)[0]??""),a=new RegExp(`^ {0,3}\\${s}{${i.length},}[ \\t]*$`),c=t[e]??"",l=c.length-c.trimStart().length,u=[];let g=e+1;for(;g<t.length;){const e=t[g]??"";if(a.test(e)){g++;break}u.push(q(e,l)),g++}return r.push({type:"code_block",language:o,code:u.join("\n")}),g}function q(t,e){let n=0;for(;n<e&&" "===t[n];)n++;return t.slice(n)}function j(t){return W(t)>=4}function W(t){let e=0;for(const n of t)if(" "===n)e++;else{if("\t"!==n)break;e+=4-e%4}return e}function E(t,e){let n=0,r=0;for(;r<t.length;){const e=t[r]??"";if(" "===e)n++;else{if("\t"!==e)break;n+=4-n%4}r++}return" ".repeat(Math.max(0,n-e))+t.slice(r)}function F(t,e){let n=0,r=0;for(;r<t.length&&n<e;){const i=t[r]??"";if(" "===i)n++,r++;else{if("\t"!==i)break;{const i=n+4-n%4;if(i>e)return" ".repeat(i-e)+t.slice(r+1);n=i,r++}}}return t.slice(r)}function I(t,e,n){const r=[],i=[];let s=e;for(;s<t.length;){const e=t[s]??"";if(v(e))i.push(F(e,4)),s++;else{if(W(e)<4)break;for(;i.length>0;)r.push(i.shift()??"");r.push(F(e,4)),s++}}return n.push({type:"code_block",language:"",code:r.join("\n")}),s-i.length}function P(t,e,n,r){for(const i of t){const t=i.matchBlock?.(e,n);if(t&&t.linesConsumed>0)return r.push({type:"extension_block",nodeType:t.type,attrs:t.attrs}),t.linesConsumed}return 0}function R(t,e,n,r,i,s){const o=[];let a=e,c=!1;for(;a<t.length;){const e=t[a]??"";if(x.test(e)){const t=e.replace(x,"");o.push(t),c=Z(t),a++;continue}if(!c||v(e)||J(e)||r&&u(t,a,J))break;o.push(e),a++}return n.push({type:"blockquote",children:_(o,r,i,s+1)}),a}function Z(t){let e=t;for(;;){if(x.test(e)){e=e.replace(x,"");continue}const t=X(e);if(!t||""===t.firstText)break;e=t.firstText}return""!==e.trim()&&!J(e)&&W(e)<4}function X(t){const e=t.match(L),n=e?null:t.match(H),r=e??n;if(!r)return null;const i=W(r[1]??"");if(i>3)return null;const s=i+((e?r[2]:`${r[2]}${r[3]}`)??"-").length,o=function(t,e){let n=t;for(const r of e)if(" "===r)n++;else{if("\t"!==r)break;n+=4-n%4}return n-t}(s,(e?r[3]:r[4])??""),a=(e?r[4]:r[5])??"",c=n?Number.parseInt(r[2]??"1",10):1;let l,u;""===a.trim()?(l=s+1,u=""):o>=5?(l=s+1,u=" ".repeat(o-1)+a):(l=s+o,u=a);const g=u.match(w);return g?{listType:"checklist",checked:"x"===(g[1]??" ").toLowerCase(),contentColumn:l,firstText:g[2]??"",startNumber:c}:{listType:n?"ordered":"bullet",checked:!1,contentColumn:l,firstText:u,startNumber:c}}function V(t,e,n,r,i,s,o){const a=[],c=function(){let t=null;return(e,n)=>{if(t)return t.test(e)&&(t=null),!1;const r=D(e);if(r){const e=r[1]??"```",n=e[0]??"`";return t=new RegExp(`^ {0,3}\\${n}{${e.length},}[ \\t]*$`),!1}return!v(e)&&(x.test(e)||X(e)?Z(e):W(e)>=4?n:!J(e))}}();let l=n.firstText,g=""!==l&&c(l,!1),h=0,f=e+1;for(;f<t.length;){const e=t[f]??"";if(v(e)){if(""===l&&0===a.length)break;h++,g=!1,f++;continue}if(W(e)>=n.contentColumn){for(;h>0;)a.push(""),h--;const t=E(e,n.contentColumn);a.push(t),g=c(t,g),f++;continue}if(X(e))break;if(!g)break;if(J(e))break;if(i&&u(t,f,J))break;const r=e.trimStart(),s=a[a.length-1];void 0!==s?a[a.length-1]=`${s}\n${r}`:l=""===l?r:`${l}\n${r}`,g=c(r,g),f++}return function(t,e,n,r,i,s,o){const a=""===e?[...n]:[e,...n],c=0===a.length?[]:_(a,i,s,o+1),l=[],u=[];for(const h of c)"list_item"===h.type?l.push({...h,indent:h.indent+1}):u.push(h);const g=u[0];1===u.length&&"paragraph"===g?.type?r.push(B(t,g.text)):0===u.length?r.push(B(t,"")):r.push(B(t,"",u)),r.push(...l)}(n,l,a,r,i,s,o),f}function B(t,e,n){const r={type:"list_item",listType:t.listType,indent:0,checked:t.checked,text:e};return n?{...r,children:n}:r}function U(t){const e=t.match(A);if(!e)return!1;if(t.trimStart().startsWith("\x3c!--"))return!0;const n=(e[2]??"").toLowerCase();return k.has(n)}function G(t,e,n){const r=[];let i=e;for(;i<t.length;){const e=t[i]??"";if(v(e))break;r.push(e),i++}return n.push({type:"html",html:r.join("\n")}),i}function J(t){return!!(v(t)||M.test(t)||D(t)||S.test(t)||x.test(t)||function(t){const e=X(t);return!!e&&""!==e.firstText.trim()&&("ordered"!==e.listType||1===e.startNumber)}(t)||U(t))}function K(t,e,n){const r=[t[e]??""];let i=e+1;for(;i<t.length;){const e=t[i]??"";if(N.test(e))return n.push({type:"heading",level:1,text:Y(r)}),i+1;if(z.test(e))return n.push({type:"heading",level:2,text:Y(r)}),i+1;if(J(e))break;r.push(e),i++}return n.push({type:"paragraph",text:Q(r)}),i}function Q(t){return t.map((e,n)=>n===t.length-1?e.trim():e.trimStart()).join("\n")}function Y(t){return t.map(t=>t.trim()).join(" ").trim()}function tt(a){return a||(y??=function(){const a=new n;return function(e){e.registerNodeSpec({type:"paragraph",toDOM:et,toHTML:(t,e)=>`<p>${e||"<br>"}</p>`,parseHTML:[{tag:"p"},{tag:"div",priority:10}],sanitize:{tags:["p"]}}),e.registerNodeSpec({type:"heading",toDOM:et,toHTML(t,e){const n=t.attrs?.level,r="number"==typeof n&&Number.isFinite(n)?Math.max(1,Math.min(6,Math.floor(n))):1;return`<h${r}>${e||"<br>"}</h${r}>`},parseHTML:[1,2,3,4,5,6].map(t=>({tag:`h${t}`,getAttrs:()=>({level:t})})),sanitize:{tags:["h1","h2","h3","h4","h5","h6"]}}),e.registerNodeSpec({type:"list_item",toDOM:et,toHTML(t,e){if("checklist"!==t.attrs?.listType)return`<li>${e||"<br>"}</li>`;const n=!0===t.attrs.checked;return`<li role="checkbox" aria-checked="${String(n)}"><input type="checkbox" disabled${n?" checked":""}>${e||"<br>"}</li>`},parseHTML:[{tag:"li"}],sanitize:{tags:["ul","ol","li","input"],attrs:["type","disabled","checked","role","aria-checked"]}}),e.registerNodeSpec({type:"blockquote",toDOM:et,toHTML:(t,e)=>`<blockquote>${e||"<br>"}</blockquote>`,parseHTML:[{tag:"blockquote"}],sanitize:{tags:["blockquote"]}}),e.registerNodeSpec({type:"code_block",toDOM:et,toHTML(e,n){const r=String(e.attrs?.language??"");return`<pre><code${r?` class="language-${t(r)}"`:""}>${n}</code></pre>`},parseHTML:[{tag:"pre",getAttrs:t=>({language:t.querySelector("code")?.className.match(/(?:^|\s)language-(\S+)/)?.[1]??""})}],sanitize:{tags:["pre","code"],attrs:["class"]}}),e.registerNodeSpec({type:"horizontal_rule",isVoid:!0,toDOM:et,toHTML:()=>"<hr>",parseHTML:[{tag:"hr"}],sanitize:{tags:["hr"]}}),e.registerNodeSpec({type:"image",isVoid:!0,attrs:{src:{default:""},alt:{default:""},title:{default:""},align:{default:"center"}},toDOM:et,toHTML(e){const n=t(String(e.attrs?.src??"")),r=t(String(e.attrs?.alt??"")),i=String(e.attrs?.title??""),s=(t,e)=>"number"==typeof e&&Number.isFinite(e)&&e>0?` ${t}="${String(e)}"`:"";return`<figure><img src="${n}" alt="${r}"${i?` title="${t(i)}"`:""}${s("width",e.attrs?.width)}${s("height",e.attrs?.height)}></figure>`},parseHTML:[{tag:"figure",getAttrs(t){const e=t.querySelector("img");return!!e&&nt(e)}},{tag:"img",getAttrs:t=>nt(t)}],sanitize:{tags:["figure","img"],attrs:["src","alt","title","width","height"]}}),e.registerNodeSpec({type:"table",toDOM:et,toHTML(t,e,n){const o=s(t.attrs?.columnWidthsPx),a=o?`<colgroup>${o.map(t=>`<col${r(i,"width",t,n)}>`).join("")}</colgroup>`:"";return`<table${o?function(t,e){const n=t.reduce((t,e)=>t+(e??60),0),r=t.every(t=>null!==t)?`width: ${String(n)}px; min-width: ${String(n)}px; table-layout: fixed`:`width: 100%; min-width: ${String(n)}px; table-layout: fixed`;return e?.styleAttr(r)??` style="${r}"`}(o,n):""}>${a}<tbody>${e}</tbody></table>`},sanitize:{tags:["table","colgroup","col","thead","tbody","tfoot"],attrs:["span","width",i]}}),e.registerNodeSpec({type:"table_row",toDOM:et,toHTML:(t,e,n)=>`<tr${r(o,"height",t.attrs?.minHeightPx,n)}>${e}</tr>`,sanitize:{tags:["tr"],attrs:["height",o]}}),e.registerNodeSpec({type:"table_cell",toDOM:et,toHTML(t,e){const n=(t,e)=>"number"==typeof e&&Number.isInteger(e)&&e>1?` ${t}="${String(e)}"`:"";return`<td${n("colspan",t.attrs?.colspan)}${n("rowspan",t.attrs?.rowspan)}>${e}</td>`},sanitize:{tags:["td","th"],attrs:["colspan","rowspan"]}})}(a),function(n){for(const t of[{type:"bold",rank:0,tag:"strong",parseTags:["strong","b"]},{type:"italic",rank:1,tag:"em",parseTags:["em","i"]},{type:"underline",rank:2,tag:"u",parseTags:["u"]},{type:"code",rank:3,tag:"code",parseTags:["code"]},{type:"strikethrough",rank:4,tag:"s",parseTags:["s","strike","del"]}])n.registerMarkSpec({type:t.type,rank:t.rank,toDOM:et,toHTMLString:(e,n)=>`<${t.tag}>${n}</${t.tag}>`,parseHTML:t.parseTags.map(t=>({tag:t,getAttrs:"code"===t?t=>"PRE"!==t.parentElement?.tagName&&{}:void 0})),sanitize:{tags:t.parseTags}});n.registerMarkSpec({type:"link",rank:10,toDOM:et,toHTMLString(n,r){const i=t(e(String(n.attrs?.href??""))),s=String(n.attrs?.title??"");return`<a href="${i}"${s?` title="${t(s)}"`:""}>${r}</a>`},parseHTML:[{tag:"a",getAttrs(t){const n=e(t.getAttribute("href")??""),r=t.getAttribute("title");return r?{href:n,title:r}:{href:n}}}],sanitize:{tags:["a"],attrs:["href","title"]}})}(a),function(e){e.registerInlineNodeSpec({type:"hard_break",toDOM:et,toHTMLString:()=>"<br>",parseHTML:[{tag:"br"}],sanitize:{tags:["br"]}}),e.registerInlineNodeSpec({type:"image_inline",toDOM:et,toHTMLString(e){const n=t(String(e.attrs.src??"")),r=t(String(e.attrs.alt??"")),i=String(e.attrs.title??"");return`<img src="${n}" alt="${r}"${i?` title="${t(i)}"`:""}>`},parseHTML:[{tag:"img",getAttrs:t=>rt(t)}],sanitize:{tags:["img"],attrs:["src","alt","title"]}})}(a),a}(),y)}function et(){throw new Error("The Markdown HTML registry cannot render editor DOM.")}function nt(t){const e={...rt(t),align:"center"};for(const n of["width","height"]){const r=Number.parseFloat(t.getAttribute(n)??"");Number.isFinite(r)&&r>0&&(e[n]=r)}return e}function rt(t){const e={src:t.getAttribute("src")??"",alt:t.getAttribute("alt")??""},n=t.getAttribute("title");return n&&(e.title=n),e}export{z as a,O as c,b as d,d as f,N as i,$ as l,M as n,S as o,T as r,D as s,tt as t,p as u};
|
|
2
|
-
//# sourceMappingURL=MarkdownHTMLRegistry-CKEx7LkR.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{t}from"./rolldown-runtime-H_PjY6_i.mjs";import{T as e,l as s,o as n,s as i,u as r}from"./Document-827l3P80.mjs";import{a as o,i as l,r as h}from"./TypeBrands-Ch9856Gb.mjs";import{n as c}from"./ContentModel-NpAj7vGW.mjs";import{t as a}from"./DocumentParser-D2tr3ZKn.mjs";import{c as u,d as p,f,l as m,n as d,o as x,s as g,t as k,u as v}from"./MarkdownHTMLRegistry-CKEx7LkR.mjs";function y(t,e=""){return{type:t,literal:e,children:[],href:"",title:"",alt:"",inlineType:"",attrs:{},prev:null,next:null}}function b(t,e){e.prev=t,e.next=t.next,t.next&&(t.next.prev=e),t.next=e}function _(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t.prev=null,t.next=null}var w=/[\s*_~(]/,S=/^[a-zA-Z0-9_-]+$/,A=/[a-zA-Z0-9.+_-]+@[a-zA-Z0-9_-]+(?:\.[a-zA-Z0-9_-]+)+/y,D=/[a-zA-Z0-9.+_-]/,T=/[a-zA-Z0-9_-]/;function W(t,e){const s=t[e]??"";return("h"===s||"w"===s||"m"===s||"x"===s||"f"===s)&&!(e>0&&!w.test(t[e-1]??""))&&(t.startsWith("http://",e)||t.startsWith("https://",e)||t.startsWith("ftp://",e)||t.startsWith("www.",e)||t.startsWith("mailto:",e)||t.startsWith("xmpp:",e))}function z(t,e){let s=e;for(;s<t.length;){const e=t[s]??"";if("<"===e||/\s/.test(e))break;s++}return function(t){let e=0,s=0;for(const i of t)"("===i?e++:")"===i&&s++;let n=t.length;for(;n>0;){const i=t[n-1]??"";if("?!.,:*_~".includes(i))n--;else{if(!(")"===i&&s>e)){if(";"===i){let e=n-2;for(;e>0&&/[a-zA-Z0-9]/.test(t[e]??"");)e--;if("&"===t[e]&&e<n-2){n=e;continue}}break}n--,s--}}return t.slice(0,n)}(t.slice(e,s))}function O(t){const e=t.search(/[/?#:]/);return-1===e?t:t.slice(0,e)}function Z(t){const e=t.split(".");return!(e.length<2||!e.every(t=>S.test(t))||e.slice(-2).some(t=>t.includes("_")))}function $(t){return!t.endsWith("-")&&!t.endsWith("_")}function E(t){!function(t){let e=0;for(const s of t){const n=e>0?t[e-1]:void 0;n&&"text"===n.type&&"text"===s.type?n.literal+=s.literal:(t[e]=s,e++)}t.length=e}(t);for(let e=0;e<t.length;e++){const s=t[e];if(s&&!C(s.type)){if("text"===s.type){const n=I(s.literal);n&&(t.splice(e,1,...n),e+=n.length-1);continue}s.children.length>0&&E(s.children)}}}function C(t){return"link"===t||"image"===t||"code"===t||"html_inline"===t||"inline_node"===t}function I(t){const e=[];let s=0,n=t.indexOf("@");for(;-1!==n;){let i=n;for(;i>s&&D.test(t[i-1]??"");)i--;let r=n+1;for(;r<t.length&&(T.test(t[r]??"")||"."===t[r]);)r++;for(;r>n+1&&"."===t[r-1];)r--;const o=t.slice(i,r);if(i<n&&B(o,r-n-1)){i>s&&e.push(y("text",t.slice(s,i)));const l=y("link");l.href=`mailto:${o}`,l.children=[y("text",o)],e.push(l),s=r,n=t.indexOf("@",r);continue}n=t.indexOf("@",n+1)}return 0===e.length?null:(s<t.length&&e.push(y("text",t.slice(s))),e)}function B(t,e){if(e<=0)return!1;const s=t.slice(t.indexOf("@")+1).split(".");return!(s.length<2)&&!s.some(t=>""===t)&&$(t)}var M=/^ {0,3}\[((?:\\.|[^\\[\]])+)\]:(.*)$/,L=/^( {0,3}(?:> ?)+)(.*)$/,N=/^[ \t]*(?:"((?:\\.|[^"\\])*)"|'((?:\\.|[^'\\])*)'|\(((?:\\.|[^()\\])*)\))[ \t]*$/,j=/^ {0,3}(`{3,}|~{3,})[ \t]*$/;function R(t){return t.trim().replace(/[ \t\n]+/g," ").toLowerCase().toUpperCase().toLowerCase()}function G(t,e,s,n,i){const r=t[e]??"",o=r.match(M);if(!o){if(""===s){const t=r.match(L);if(t?.[1]&&M.test(t[2]??"")&&G([t[2]??""],0,t[1],n,[])>0)return i.push(t[1].trimEnd()),1}return 0}const l=o[1]??"";let h=(o[2]??"").trim(),c=1;if(""===h&&""===s){const s=t[e+c]??"";if(""===s.trim())return 0;h=s.trim(),c++}if(""===h)return 0;const a=function(t){if("<"===t[0]){let e=1;for(;e<t.length;){const s=t[e]??"";if("\\"!==s){if(">"===s)return{href:p(t.slice(1,e)),end:e+1};if("<"===s)return null;e++}else e+=2}return null}let e=0,s=0;for(;s<t.length;){const n=t[s]??"";if(" "===n||"\t"===n)break;if("\\"!==n){if("("===n&&e++,")"===n){if(0===e)break;e--}s++}else s+=2}return 0===s?null:{href:p(t.slice(0,s)),end:s}}(h);if(!a)return 0;const u=h.slice(a.end).trim();let f;if(""!==u){const t=u.match(N);if(!t)return 0;f=H(t)}else if(""===s){const s=(t[e+c]??"").match(N);s&&(f=H(s),c++)}const m=R(l);return""===m||n.has(m)||n.set(m,void 0!==f?{href:a.href,title:f}:{href:a.href}),c}function H(t){return p(t[1]??t[2]??t[3]??"")}var q=8192,F=/[\p{P}\p{S}]/u,K=/[!-/:-@[-`{-~]/,P=/[!-/:-@[-`{-~]/,J=new Set(["u","sup","sub","span","mark","b","i","em","strong","code","s","del","small","abbr","kbd","a"]);function U(t){return""===t||/\s/.test(t)}function Q(t){return""!==t&&(t.charCodeAt(0)<128?K.test(t):F.test(t))}var V=class{pos=0;text;len;ctx;delimiters=null;brackets=null;tail=null;constructor(t,e){this.text=t,this.len=t.length,this.ctx=e}parse(){const t=y("text");for(this.tail=t;this.pos<this.len;){const t=this.parseToken();t&&this.appendNode(t)}return this.processEmphasis(null),function(t){const e=[];let s=t.next;for(;s;)e.push(s),s=s.next;return e}(t)}appendNode(t){this.tail&&b(this.tail,t),this.tail=t}parseToken(){const t=this.text[this.pos]??"";switch(t){case"\n":return this.parseNewline();case"\\":return this.parseBackslash();case"`":return this.parseBackticks();case"*":case"_":case"~":case"=":case"^":return this.parseDelimiterRun(t);case"[":return this.parseOpenBracket(!1);case"!":return"["===this.text[this.pos+1]?this.parseOpenBracket(!0):(this.pos++,y("text","!"));case"]":return this.parseCloseBracket();case"<":return this.parseLessThan();case"&":return this.parseEntity();default:{const t=this.parseGfmAutolink();if(t)return t;return this.parseExtension()||this.parseString()}}}parseString(){const t=this.pos;for(this.pos++;this.pos<this.len;){const t=this.text[this.pos]??"";if("\n\\`*_~=^[]!<&".includes(t))break;if(this.matchesGfmAutolinkStart())break;if(this.matchesExtensionStart())break;this.pos++}return y("text",this.text.slice(t,this.pos))}parseGfmAutolink(){if(!this.ctx.opts.gfm||this.brackets)return null;const t=(e=this.text,s=this.pos,W(e,s)?e.startsWith("http://",s)||e.startsWith("https://",s)||e.startsWith("ftp://",s)?function(t,e){const s=z(t,e),n=t.startsWith("https://",e)?8:t.startsWith("http://",e)?7:6;return Z(O(s.slice(n)))?{href:s,display:s,length:s.length}:null}(e,s):e.startsWith("www.",s)?function(t,e){const s=z(t,e);return Z(O(s))?{href:`http://${s}`,display:s,length:s.length}:null}(e,s):function(t,e){const s=t.startsWith("mailto:",e)?7:5;A.lastIndex=e+s;const n=A.exec(t)?.[0];if(!n||!$(n))return null;const i=t.slice(e,e+s+n.length);return{href:i,display:i,length:i.length}}(e,s):null);var e,s;if(!t)return null;this.pos+=t.length;const n=y("link");return n.href=t.href,n.children=[y("text",t.display)],n}matchesGfmAutolinkStart(){return!(!this.ctx.opts.gfm||this.brackets)&&W(this.text,this.pos)}parseExtension(){for(const t of this.ctx.opts.syntaxExtensions){const e=t.matchInline?.(this.text,this.pos);if(e){this.pos+=e.length;const t=y("inline_node");return t.inlineType=e.type,t.attrs=e.attrs,t}}return null}matchesExtensionStart(){for(const t of this.ctx.opts.syntaxExtensions)if(t.matchInline?.(this.text,this.pos))return!0;return!1}parseNewline(){for(this.pos++;" "===this.text[this.pos];)this.pos++;const t=this.tail;if(t&&"text"===t.type&&t.literal.endsWith(" ")){const e=t.literal.endsWith(" ");return t.literal=t.literal.replace(/[ \t]+$/,""),y(e?"hardbreak":"softbreak")}return y("softbreak")}parseBackslash(){this.pos++;const t=this.text[this.pos]??"";if("\n"===t){for(this.pos++;" "===this.text[this.pos];)this.pos++;return y("hardbreak")}return P.test(t)?(this.pos++,y("text",t)):y("text","\\")}parseBackticks(){const t=this.pos;let e=0;for(;"`"===this.text[this.pos];)e++,this.pos++;const s="`".repeat(e),n=this.pos;let i=n;for(;i<this.len;){const t=this.text.indexOf(s,i);if(-1===t)break;if("`"!==this.text[t-1]&&"`"!==this.text[t+e]){let s=this.text.slice(n,t).replace(/\n/g," ");return s.length>2&&s.startsWith(" ")&&s.endsWith(" ")&&""!==s.trim()&&(s=s.slice(1,-1)),this.pos=t+e,y("code",s)}i=t+1}return this.pos=n,y("text",this.text.slice(t,n))}parseDelimiterRun(t){const{numdelims:e,canOpen:s,canClose:n}=this.scanDelims(t),i=y("text",t.repeat(e)),r={cc:t,numdelims:e,origdelims:e,node:i,canOpen:s,canClose:n,prev:this.delimiters,next:null};return this.delimiters&&(this.delimiters.next=r),this.delimiters=r,i}scanDelims(t){const e=this.pos;for(;this.text[this.pos]===t;)this.pos++;const s=this.pos-e,n=0===e?"":this.text[e-1]??"",i=this.text[this.pos]??"",r=U(n),o=U(i),l=Q(n),h=Q(i),c=!o&&(!h||r||l),a=!r&&(!l||o||h);let u,p;return"_"===t?(u=c&&(!a||l),p=a&&(!c||h)):(u=c,p=a),{numdelims:s,canOpen:u,canClose:p}}parseOpenBracket(t){const e=t?"![":"[";this.pos+=e.length;const s=y("text",e);return this.brackets={node:s,prev:this.brackets,prevDelim:this.delimiters,index:this.pos,image:t,active:!0},s}parseCloseBracket(){this.pos++;const t=this.brackets;if(!t||!t.active)return t&&(this.brackets=t.prev),y("text","]");const e=this.parseLinkTarget(t);if(!e)return this.brackets=t.prev,y("text","]");const s=y(t.image?"image":"link");s.href=e.href,s.title=e.title,this.processEmphasis(t.prevDelim);let n=t.node.next;for(;n;){const t=n.next;_(n),s.children.push(n),n=t}if(t.image&&(s.alt=tt(s.children),s.children=[]),b(t.node,s),_(t.node),this.tail=s,!t.image){let e=t.prev;for(;e;)e.image||(e.active=!1),e=e.prev}return this.brackets=t.prev,null}parseLinkTarget(t){if("("===this.text[this.pos]){const t=this.parseInlineDestination();if(t)return t}let e=this.text.slice(t.index,this.pos-1),s=!1,n=this.pos;if("["===this.text[this.pos]){const t=this.text.indexOf("]",this.pos+1);if(-1!==t){const i=this.text.slice(this.pos+1,t);""!==i.trim()&&(e=i,s=!0),n=t+1}}if(!s&&e.includes("["))return null;const i=this.ctx.linkRefs.get(R(e));return i?(this.pos=n,{href:i.href,title:i.title??""}):null}parseInlineDestination(){let t=this.pos+1;for(;" "===this.text[t]||"\n"===this.text[t];)t++;let e="";if("<"===this.text[t]){let s=t+1;const n=Math.min(this.len,t+1+q);for(;s<n;){const t=this.text[s]??"";if("\\"===t&&P.test(this.text[s+1]??""))s+=2;else{if(">"===t||"<"===t||"\n"===t)break;s++}}if(">"!==this.text[s])return null;e=p(this.text.slice(t+1,s)),t=s+1}else{let s=0;const n=Math.min(this.len,t+q);for(;t<n;){const n=this.text[t]??"";if("\\"===n&&P.test(this.text[t+1]??""))e+=this.text[t+1],t+=2;else{if("("===n)s++;else if(")"===n){if(0===s)break;s--}else if(" "===n||"\t"===n||"\n"===n||"["===n||"]"===n)break;e+=n,t++}}if(t>=n&&")"!==this.text[t])return null;e=m(e)}for(;" "===this.text[t]||"\n"===this.text[t];)t++;let s="";const n=this.text[t]??"";if('"'===n||"'"===n||"("===n){const e=this.parseLinkTitle(t);if(!e)return null;s=e.title,t=e.next}for(;" "===this.text[t]||"\n"===this.text[t];)t++;return")"!==this.text[t]?null:(this.pos=t+1,{href:e,title:s})}parseLinkTitle(t){const e=this.text[t]??"",s="("===e?")":e;let n="",i=t+1;const r=Math.min(this.len,t+1+q);for(;i<r;){const t=this.text[i]??"";if("\\"===t&&P.test(this.text[i+1]??""))n+=this.text[i+1],i+=2;else{if(t===s)return{title:m(n),next:i+1};n+=t,i++}}return null}parseEntity(){const t=f(this.text,this.pos);return t?.[1]?(this.pos+=t[0].length,y("text",v(t[1]))):(this.pos++,y("text","&"))}parseLessThan(){const t=this.parseAutolink();if(t)return t;return this.parseInlineHtml()||(this.pos++,y("text","<"))}parseAutolink(){const t=this.text.slice(this.pos),e=t.match(/^<([a-zA-Z][a-zA-Z0-9+.-]{1,31}:[^<>\s]*)>/);if(e?.[1]){this.pos+=e[0].length;const t=y("link");return t.href=e[1],t.children=[y("text",e[1])],t}const s=t.match(/^<([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/);if(s?.[1]){this.pos+=s[0].length;const t=y("link");return t.href=`mailto:${s[1]}`,t.children=[y("text",s[1])],t}return null}parseInlineHtml(){const t=this.text.slice(this.pos),e=t.match(/^<([a-zA-Z][a-zA-Z0-9-]*)(?:\s[^<>]*)?>/);if(!e?.[1]){const e=t.match(/^<!--[\s\S]*?-->/);return e?(this.pos+=e[0].length,y("html_inline",Y(e[0]))):null}const s=e[1].toLowerCase();if(J.has(s)){const t=`</${s}>`,n=this.text.toLowerCase().indexOf(t,this.pos+e[0].length);if(-1!==n){const e=n+t.length,s=this.text.slice(this.pos,e);return this.pos=e,y("html_inline",Y(s))}}return this.pos+=e[0].length,y("html_inline",Y(e[0]))}processEmphasis(t){const e=/* @__PURE__ */new Map,s=s=>{const n=X(s);return e.has(n)?e.get(n)??null:t};let n=t?t.next:this.firstDelimiter();for(;n;){if(!n.canClose){n=n.next;continue}const i=n.cc;let r=n.prev,o=!1;const l=s(n);for(;r&&r!==t&&r!==l;){if(r.cc===i&&r.canOpen&&this.emphMatches(r,n)){o=!0;break}r=r.prev}if(!o){e.set(X(n),n.prev),n.canOpen||this.removeDelimiter(n),n=n.next;continue}const h=r,c=this.wrapCount(i,h,n);if(0!==c){if(this.wrapEmphasis(i,h,n,c),h.numdelims-=c,n.numdelims-=c,h.node.literal=h.node.literal.slice(c),n.node.literal=n.node.literal.slice(c),this.removeDelimitersBetween(h,n),0===h.numdelims&&this.removeDelimiter(h),0===n.numdelims){const t=n.next;this.removeDelimiter(n),n=t}}else n=n.next}for(;this.delimiters&&this.delimiters!==t;)this.removeDelimiter(this.delimiters)}firstDelimiter(){let t=this.delimiters;for(;t?.prev;)t=t.prev;return t}emphMatches(t,e){return"*"!==t.cc&&"_"!==t.cc||!((e.canOpen||t.canClose)&&e.origdelims%3!=0&&(t.origdelims+e.origdelims)%3==0)}wrapCount(t,e,s){const n=e.numdelims>=2&&s.numdelims>=2;return"*"===t||"_"===t?n?2:1:"~"===t?this.ctx.opts.gfm&&n?2:this.ctx.opts.extendedInlineSyntax?1:0:"="===t?this.ctx.opts.extendedInlineSyntax&&n?2:0:"^"===t&&this.ctx.opts.extendedInlineSyntax?1:0}wrapKind(t,e){return"*"===t||"_"===t?2===e?"strong":"emph":"~"===t?2===e?"strike":"sub":"="===t?"highlight":"sup"}wrapEmphasis(t,e,s,n){const i=y(this.wrapKind(t,n));let r=e.node.next;for(;r&&r!==s.node;){const t=r.next;_(r),i.children.push(r),r=t}b(e.node,i)}removeDelimitersBetween(t,e){let s=e.prev;for(;s&&s!==t;){const t=s.prev;this.removeDelimiter(s),s=t}}removeDelimiter(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t.next||(this.delimiters=t.prev)}};function X(t){return`${t.cc}${t.canOpen?1:0}${t.origdelims%3}`}function Y(t){return t.replace(/\n[ \t]*/g," ")}function tt(t){let e="";for(const s of t)"text"===s.type||"code"===s.type?e+=s.literal:"softbreak"===s.type||"hardbreak"===s.type?e+=" ":s.children.length?e+=tt(s.children):s.alt&&(e+=s.alt);return e}var et={emph:"italic",strong:"bold",strike:"strikethrough",highlight:"highlight",sup:"superscript",sub:"subscript"};function st(t,e,s,n){for(const i of t)nt(i,e,s,n)}function nt(t,e,n,i){switch(t.type){case"text":return void(t.literal&&i.push(r(t.literal,[...e])));case"softbreak":return void i.push(r(" ",[...e]));case"hardbreak":return void i.push(s(h("hard_break"),{}));case"code":return void i.push(r(t.literal,it(e,n,"code")));case"link":{const s={href:t.href};return t.title&&(s.title=t.title),void st(t.children,it(e,n,"link",s),n,i)}case"image":return void function(t,e,n,i){if(!n.registry||void 0!==n.registry.getInlineNodeSpec("image_inline")){const n={src:t.href,alt:t.alt};return t.title&&(n.title=t.title),void i.push(s(h("image_inline"),n,[...e]))}t.alt&&i.push(r(t.alt,[...e]))}(t,e,n,i);case"inline_node":return void i.push(s(h(t.inlineType),t.attrs,[...e]));case"html_inline":return void function(t,e,n,i){if((!n.registry||void 0!==n.registry.getInlineNodeSpec("hard_break"))&&/^<br\s*\/?>$/i.test(t.trim()))return void i.push(s(h("hard_break"),{},[...e]));const o=a(`<p>${t}</p>`,k(n.registry)).children[0];if(!o)return;let l=!1;for(const h of o.children)"text"in h&&""!==h.text?(i.push(r(h.text,rt(e,h.marks))),l=!0):"inlineType"in h&&(i.push(s(h.inlineType,h.attrs,rt(e,h.marks))),l=!0);l||n.registry||i.push(r(t,[...e]))}(t.literal,e,n,i);default:{const s=et[t.type];st(t.children,s?it(e,n,s):e,n,i)}}}function it(t,e,s,n){if(!function(t,e){return!t.registry||void 0!==t.registry.getMarkSpec(e)}(e,s))return[...t];const i=n?{type:l(s),attrs:n}:{type:l(s)};return[...t,i]}function rt(t,e){const s=[...t];for(const n of e)s.some(t=>t.type===n.type)||s.push(n);return s}function ot(t,e){if(t.length!==e.length)return!1;const s=t=>`${t.type}:${JSON.stringify(t.attrs??{})}`,n=new Set(e.map(s));return t.every(t=>n.has(s(t)))}function lt(t,e){const s=new V(t,e).parse();e.opts.gfm&&E(s);const n=[];st(s,[],e,n);const i=function(t){const e=[];for(const s of t){const t=e[e.length-1];"text"in s&&t&&"text"in t&&ot(t.marks,s.marks)?e[e.length-1]={type:"text",text:t.text+s.text,marks:t.marks}:e.push(s)}return e}(n);return i.length>0?i:[r("")]}function ht(t){const e=t?.flavor??"gfm";return{flavor:e,gfm:"gfm"===e,extendedInlineSyntax:t?.extendedInlineSyntax??!1,htmlFallback:!1!==t?.htmlFallback,syntaxExtensions:t?.syntaxExtensions??[]}}var ct=/* @__PURE__ */t({parseMarkdownToDocument:()=>at});function at(t,e,s){const{source:n,linkRefs:r}=function(t){const e=/* @__PURE__ */new Map,s=t.split("\n"),n=[];let i=null,r=!1,o=0;for(;o<s.length;){const t=s[o]??"";if(i){n.push(t);const e=t.match(j)?.[1];e&&e[0]===i.char&&e.length>=i.len&&(i=null),r=!1,o++;continue}const l=g(t);if(l?.[1]){i={char:l[1][0]??"`",len:l[1].length},n.push(t),r=!1,o++;continue}const h=r?0:G(s,o,"",e,n);h>0?o+=h:(n.push(t),r=""!==t.trim()&&!d.test(t)&&!x.test(t),o++)}return{source:n.join("\n"),linkRefs:e}}(t.replace(/\r\n?/g,"\n")),o={registry:e,opts:ht(s),linkRefs:r},l=ut(u(n,o.opts.gfm,o.opts.syntaxExtensions),o);if(0===l.length)return i();const h=i(l);return e?c(h,e):h}function ut(t,e){const s=[];for(const n of t)pt(n,s,e);return s}function pt(t,s,i){switch(t.type){case"heading":return void s.push(ft("heading",lt(t.text,i),i,{level:t.level}));case"paragraph":{const l=lt(t.text,i),h=function(t,s){if(1!==t.length)return null;const i=t[0];if(!i||!e(i)||"image_inline"!==i.inlineType)return null;if(i.marks.length>0)return null;if(s.registry&&!s.registry.getNodeSpec("image"))return null;const l={src:String(i.attrs.src??""),alt:String(i.attrs.alt??""),align:"center"};return i.attrs.title&&(l.title=String(i.attrs.title)),n(o("image"),[r("")],void 0,l)}(l,i);return void s.push(h??ft("paragraph",l,i))}case"table":return void s.push(function(t,e,s,i){if(i.registry&&!i.registry.getNodeSpec("table"))return ft("paragraph",lt([e,...s].map(t=>t.join(" | ")).join("\n"),i),i);const r=e=>{const s=e.map((e,s)=>{const r=t[s]??null,l=n(o("paragraph"),lt(e,i),void 0,r?{align:r}:void 0);return n(o("table_cell"),[l])});return n(o("table_row"),s)},l=e.length,h=[r(e),...s.map(t=>r((t=>{if(t.length===l)return t;const e=t.slice(0,l);for(;e.length<l;)e.push("");return e})(t)))];return n(o("table"),h)}(t.aligns,t.header,t.rows,i));case"extension_block":return void s.push(ft(t.nodeType,[r("")],i,t.attrs));case"code_block":return void s.push(ft("code_block",[r(t.code)],i,{language:t.language}));case"hr":return void s.push(ft("horizontal_rule",[r("")],i));case"list_item":{const e={listType:t.listType,indent:t.indent,checked:t.checked};if(t.children&&t.children.length>0){const r=ut(t.children,i);return i.registry&&!i.registry.getNodeSpec("list_item")?void s.push(...r):void s.push(n(o("list_item"),r,void 0,e))}return void s.push(ft("list_item",lt(t.text,i),i,e))}case"blockquote":{const e=ut(t.children,i);return 0===e.length&&e.push(n(o("paragraph"),[r("")])),void s.push(function(t,e,s){const i=mt(t,s);return i!==o(t)?e[0]??n(o("paragraph"),[r("")]):n(i,e)}("blockquote",e,i))}case"html":if(function(t){let e=t.trim();for(;e.startsWith("\x3c!--");){const t=e.indexOf("--\x3e");if(-1===t)return!1;e=e.slice(t+3).trim()}return""===e}(t.html))return;for(const e of a(t.html,k(i.registry)).children)s.push(e);return}}function ft(t,e,s,i){const l=mt(t,s);return n(l,e.length>0?e:[r("")],void 0,i&&l===o(t)?i:void 0)}function mt(t,e){return e.registry&&!e.registry.getNodeSpec(t)?o("paragraph"):o(t)}export{at as n,ct as t};
|
|
2
|
-
//# sourceMappingURL=MarkdownParser-CWt3M6jR.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{t}from"./rolldown-runtime-H_PjY6_i.mjs";import{o as n}from"./HTMLUtils-Bhg3_P8B.mjs";import{E as e,O as r,T as o,_ as s,b as i,p as l,u as c}from"./Document-827l3P80.mjs";import{r as a}from"./AttrRegistry-B3zB02z9.mjs";import{_ as u,a as f,h as p,i as h,v as m}from"./TableDimensions-BBhjHNjQ.mjs";import{a as g,i as $,o as d,r as k,t as y}from"./MarkdownHTMLRegistry-CKEx7LkR.mjs";function b(t){const n=t?.flavor??"gfm";return{flavor:n,gfm:"gfm"===n,htmlFallback:!1!==t?.htmlFallback,headingStyle:t?.headingStyle??"atx",bullet:t?.bullet??"-",emphasis:t?.emphasis??"*",codeFence:t?.codeFence??"```",listIndent:t?.listIndent??2}}function S(t){return{flavor:t.flavor,htmlFallback:t.htmlFallback}}var x=new Set(["\\","`","*","[","]","<",">"]);function v(t,n){const e=t[n-1],r=t[n+1];return void 0!==e&&void 0!==r&&/\w/.test(e)&&/\w/.test(r)}function M(t,n){let e="";for(let r=0;r<t.length;r++){const o=t[r]??"";x.has(o)?e+=`\\${o}`:"_"!==o||v(t,r)?e+="~"===o&&n?"\\~":"&"!==o?o:"&":e+="\\_"}return e}var F=/^(\s*)([#>])/,T=/^(\s*)([-*+])(\s)/,j=/^(\s*)(\d{1,9})([.)])(\s)/;function w(t){return F.test(t)?t.replace(F,(t,n,e)=>`${n}\\${e}`):T.test(t)?t.replace(T,(t,n,e,r)=>`${n}\\${e}${r}`):j.test(t)?t.replace(j,(t,n,e,r,o)=>`${n}${e}\\${r}${o}`):function(t){return d.test(t)||$.test(t)||g.test(t)||k.test(t)}(t)?t.replace(/\S/,t=>`\\${t}`):t}function L(t){return/[\s()]/.test(t)?`<${t.replace(/([<>])/g,"\\$1")}>`:t}function _(t){return t.replace(/(["\\])/g,"\\$1")}var H={styleAttr:t=>t?` style="${t}"`:""};function I(t,n){const e=t.type;return"link"===e||"bold"===e||"italic"===e||!("strikethrough"!==e||!n)}function N(t,n){const e=n.opts.emphasis;switch(t.type){case"bold":return{open:e.repeat(2),close:e.repeat(2)};case"italic":return{open:e,close:e};case"strikethrough":return{open:"~~",close:"~~"};default:{const n=String(t.attrs?.href??""),e=String(t.attrs?.title??"");return{open:"[",close:`](${L(n)}${e?` "${_(e)}"`:""})`}}}}function O(t){return"link"!==t.type}function A(t,n){return t.type===n.type&&JSON.stringify(t.attrs??{})===JSON.stringify(n.attrs??{})}function D(t,n){const e=[],r=[];for(const o of t.marks)I(o,n)&&("link"===o.type?e.push(o):r.push(o));return[...e,...r]}function W(t,n){const e=[],r=[...t];for(let o=r.length-1;o>=0;o--){const t=r[o];t&&!O(t)&&(e.push(t),r.splice(o,1))}for(const o of n){if(!O(o))continue;const t=r.findIndex(t=>A(t,o));if(-1!==t){const n=r[t];n&&e.push(n),r.splice(t,1)}}for(const o of r)e.push(o);return e}function z(t,n){if(""===t.text)return"";if(t.marks.some(t=>"code"===t.type))return function(t){const n=function(t){let n=0,e=0;for(const r of t)"`"===r?(e++,n=Math.max(n,e)):e=0;return"`".repeat(n+1)}(t);return`${n}${t.startsWith("`")||t.endsWith("`")||t.length>0&&0===t.trim().length?` ${t} `:t}${n}`}(t.text);const e=n.opts.gfm,r=t.marks.filter(t=>!I(t,e)&&"code"!==t.type);return r.length>0&&n.opts.htmlFallback?m(t.text,r,y(n.registry),n.markOrder,H):M(t.text,e)}function J(t,n){if("hard_break"===t.inlineType)return"\\\n";if("image_inline"===t.inlineType)return function(t,n){const e=String(t.attrs.src??""),r=String(t.attrs.alt??""),o=String(t.attrs.title??""),s=o?` "${_(o)}"`:"";return`}${s})`}(t,n);const e=n.registry?.getInlineNodeSpec(t.inlineType),r=e?.toMarkdown?.(t,S(n.opts));return null!=r?r:n.opts.htmlFallback&&e?.toHTMLString?e.toHTMLString(t):""}function P(t){const n=[];for(const e of t){const t=n[n.length-1];!o(e)&&t&&!o(t)&&r(t.marks,e.marks)?n[n.length-1]={type:"text",text:t.text+e.text,marks:t.marks}:n.push(e)}return n}function R(t,n){return!(!t||o(t))&&t.marks.some(t=>A(t,n))}function q(t,n){return 0===n.length?[...t]:t.filter(t=>!n.some(n=>A(n,t)))}function B(t,n,e,r,o){const s=t.marks.filter(t=>function(t,n){return I(t,n)&&"link"!==t.type}(t,r));if(0===s.length)return void o.push(t);const i=t.text,l=function(t){let n=0;for(;n<t.length&&/\s/.test(t[n]);)n++;return n}(i);if(l===i.length){const r=s.filter(t=>!(R(n,t)&&R(e,t)));return void o.push(c(i,q(t.marks,r)))}const a=function(t){let n=t.length;for(;n>0&&/\s/.test(t[n-1]);)n--;return t.length-n}(i),u=i.slice(0,l),f=i.slice(l,i.length-a),p=i.slice(i.length-a);if(u){const e=s.filter(t=>!R(n,t));o.push(c(u,q(t.marks,e)))}if(o.push(c(f,t.marks)),p){const n=s.filter(t=>!R(e,t));o.push(c(p,q(t.marks,n)))}}function E(t,n){const e=n.opts.gfm,r=function(t,n){const e=[];for(let r=0;r<t.length;r++){const s=t[r];s&&(o(s)?e.push(s):B(s,t[r-1],t[r+1],n,e))}return P(e)}(P(t),e);let s="",i=[];const l=t=>{for(let e=i.length-1;e>=t;e--){const t=i[e];t&&(s+=N(t,n).close)}i=i.slice(0,t)};for(const c of r){const t=W(D(c,e),i);let r=0;for(;r<i.length&&r<t.length&&A(i[r],t[r]);)r++;l(r);for(let e=r;e<t.length;e++){const r=t[e];r&&(s+=N(r,n).open,i.push(r))}s+=o(c)?J(c,n):z(c,n)}return l(0),s}function U(t,n){const e=[];let r=0;for(;r<t.length;){const o=t[r];if(o)if(a(o,"list_item")){const o=[];for(;r<t.length;){const n=t[r];if(!n||!a(n,"list_item"))break;o.push(n),r++}e.push(n.opts.htmlFallback&&o.some(G)?K(o,n):V(o,n))}else e.push(C(o,n)),r++;else r++}return e.filter(t=>t.length>0).join("\n\n")}function C(t,n){if(n.opts.htmlFallback&&G(t))return K([t],n);const r=t.type;return"paragraph"===r?function(t,n){const e=E(i(t),n);return""===e.trim()?"":e.split("\n").map(w).join("\n")}(t,n):"heading"===r?function(t,n){const e=function(t){return t<1?1:t>6?6:Math.floor(t)}(t.attrs?.level??1),r=E(i(t),n).replace(/\n/g," ");if("setext"===n.opts.headingStyle&&e<=2&&""!==r)return`${r}\n${(1===e?"=":"-").repeat(Math.max(3,r.length))}`;const o="#".repeat(e);return r?`${o} ${r}`:o}(t,n):"code_block"===r?function(t,n){const e=String(t.attrs?.language??""),r=s(t),o=n.opts.codeFence[0]??"`",i=o.repeat(Math.max(3,function(t,n){let e=0,r=0;for(const o of t)o===n?(r++,e=Math.max(e,r)):r=0;return e}(r,o)+1));return`${i}${e}\n${r}\n${i}`}(t,n):"horizontal_rule"===r?n.inListItem?"***":"---":"image"===r?function(t,n){const e=String(t.attrs?.src??""),r=String(t.attrs?.alt??""),o=String(t.attrs?.title??""),s=t.attrs?.width,i=t.attrs?.height,l=t.attrs?.align;if((void 0!==s||void 0!==i||void 0!==l&&"center"!==l)&&n.opts.htmlFallback){const e=n.registry?.getNodeSpec("image")?.toHTML?.(t,"");if(e)return e}const c=o?` "${_(o)}"`:"";return`}${c})`}(t,n):"blockquote"===r?function(t,n){return U(l(t),n).split("\n").map(t=>""===t?">":`> ${t}`).join("\n")}(t,n):"table"===r?function(t,n){const e=l(t);if(0===e.length)return"";if(!n.opts.gfm&&n.opts.htmlFallback)return K([t],n);if(n.opts.htmlFallback&&(function(t){for(const n of t)for(const t of l(n)){const n=t.attrs?.colspan,e=t.attrs?.rowspan;if((n??1)>1||(e??1)>1)return!0}return!1}(e)||function(t,n){return!!h(t.attrs?.columnWidthsPx)||n.some(t=>void 0!==f(t.attrs?.minHeightPx))}(t,e)))return K([t],n);const r=e.map(t=>l(t).map(t=>function(t,n){return l(t).map(t=>E(i(t),n)).join(" ").replace(/\n/g," ").replace(/\|/g,"\\|").trim()}(t,n))),o=r.reduce((t,n)=>Math.max(t,n.length),0);if(0===o)return"";const s=t=>{const n=[...t];for(;n.length<o;)n.push("");return`| ${n.join(" | ")} |`},c=e[0],a=Array.from({length:o},(t,n)=>{return e=function(t,n){if(!t)return;const e=l(t)[n];return e?l(e)[0]?.attrs?.align:void 0}(c,n),"start"===e?":---":"center"===e?":---:":"end"===e?"---:":"---";var e}),u=[];u.push(s(r[0]??[])),u.push(`| ${a.join(" | ")} |`);for(let i=1;i<r.length;i++)u.push(s(r[i]??[]));return u.join("\n")}(t,n):"title"===r?Q(t,n,1):"subtitle"===r?Q(t,n,2):function(t,n){const r=n.registry?.getNodeSpec(t.type),o=e(t)?E(i(t),n):U(l(t),n),s=r?.toMarkdown?.(t,o,S(n.opts));return null!=s?s:n.opts.htmlFallback&&r?.toHTML?r.toHTML(t,o):o}(t,n)}function G(t){return!!n(t.htmlId)||l(t).some(G)}function K(t,n){return p({children:t},y(n.registry),{includeBlockIds:!1})}function Q(t,n,e){if(n.opts.htmlFallback){const e=E(i(t),n),r=n.registry?.getNodeSpec(t.type)?.toHTML?.(t,e);if(r)return r}const r=E(i(t),n).replace(/\n/g," "),o="#".repeat(e);return r?`${o} ${r}`:o}function V(t,n){const r=[],o=[],s=[];let c=-1;for(const a of t){const t=String(a.attrs?.listType??"bullet"),u=Math.max(0,a.attrs?.indent??0),f=Math.min(u,c+1);c=f;const p=0===f?0:s[f-1]??0,h=" ".repeat(p);let m;if(o.length=f+1,s.length=f+1,"ordered"===t)o[f]=(o[f]??0)+1,m=`${o[f]}.`;else if("checklist"===t){const t=!0===a.attrs?.checked;m=`${n.opts.bullet} [${t?"x":" "}]`}else m=n.opts.bullet;const g="checklist"===t?n.opts.bullet.length+1:m.length+1;if(s[f]=p+g,e(a)){const t=w(E(i(a),n).replace(/\n/g," "));r.push(t?`${h}${m} ${t}`:`${h}${m}`);continue}const $=U(l(a),{...n,inListItem:!0});if(""===$){r.push(`${h}${m}`);continue}const d=" ".repeat(s[f]??p+g),k=$.split("\n");r.push(`${h}${m} ${k[0]??""}`);for(let n=1;n<k.length;n++){const t=k[n]??"";r.push(""===t?"":`${d}${t}`)}}return r.join("\n")}var X=/* @__PURE__ */t({serializeDocumentToMarkdown:()=>Y});function Y(t,n,e){const r={registry:n,opts:b(e),markOrder:n?u(n):void 0};return function(t){const n=t.trim();return n.length>0?`${n}\n`:""}(U(t.children,r))}export{Y as n,X as t};
|
|
2
|
-
//# sourceMappingURL=MarkdownSerializer-J-i28out.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as t,f as n,h as e,w as i}from"./Document-827l3P80.mjs";import{c as o,l as r,n as s,o as c,r as l,t as u}from"./Selection-HYoVFpAx.mjs";import{r as a}from"./NodeResolver-Dleih-8R.mjs";import{i as d}from"./NavigationQueries-Bt4zZ17v.mjs";import{T as f,_ as b,l as p}from"./BlockInsertion-CJusvrDL.mjs";function h(e,o){const{parentPath:r,siblings:s,index:c}=f(e,o.nodeId);if(c<0)return null;const l=e.transaction("input");if(1===s.length){const e=n();return l.insertNode(r,0,t(e)),l.removeNode(r,1),l.setSelection(u(e,0)),l.build()}l.removeNode(r,c);const a=s[c-1];if(a&&i(a)){const t=b(e,a.id,"end");if(t)return l.setSelection(t),l.build()}const d=s[c+1];if(d&&i(d)){const t=b(e,d.id,"start");if(t)return l.setSelection(t),l.build()}return null}function m(t,n){if(n<0)return;const e=t[n+1];return e&&i(e)&&p(e)?e:void 0}function g(e,i){const{parentPath:o,siblings:r,index:s}=f(e,i.nodeId);if(s<0)return null;const c=m(r,s);if(c)return e.transaction("input").setSelection(u(c.id,0)).build();const l=n(),a=e.transaction("input");return a.insertNode(o,s+1,t(l)),a.setSelection(u(l,0)),a.build()}function S(e,i,o,r){const{parentPath:s,siblings:c,index:l}=f(e,i.nodeId),a=e.transaction(r),d=m(c,l);if(d)return a.insertText(d.id,0,o,[]),a.setSelection(u(d.id,o.length)),a.build();const b=n(),p=l>=0?l+1:c.length;return a.insertNode(s,p,t(b)),a.insertText(b,0,o,[]),a.setSelection(u(b,o.length)),a.build()}function I(t,n,i){const f=t.selection,b=t.getBlockOrder(),p=!i||"left"!==n&&"right"!==n?n:"left"===n?"right":"left";return r(f)?function(t,n,i,o){const r=o.indexOf(n.nodeId),c=a(t.doc,n.nodeId)??[];if("left"===i||"up"===i){if(r>0){const i=o[r-1];if(!i)return null;if(d(t,i))return t.transaction("input").setSelection(s(n.nodeId,"before",c)).build();const l=t.getBlock(i),a=l?e(l):0;return t.transaction("input").setSelection(u(i,a)).build()}return t.transaction("input").setSelection(s(n.nodeId,"before",c)).build()}if(r<o.length-1){const e=o[r+1];return e?d(t,e)?t.transaction("input").setSelection(s(n.nodeId,"after",c)).build():t.transaction("input").setSelection(u(e,0)).build():null}return t.transaction("input").setSelection(s(n.nodeId,"after",c)).build()}(t,f,p,b):o(f)?null:c(f)?function(t,n,i,o){const r=o.indexOf(n.anchor.blockId),s=t.getBlock(n.anchor.blockId);if(!s)return null;const c=e(s);if(("right"===i||"down"===i)&&n.anchor.offset===c&&r<o.length-1){const n=o[r+1];if(n&&d(t,n)){const e=a(t.doc,n)??[];return t.transaction("input").setSelection(l(n,e)).build()}}if(("left"===i||"up"===i)&&0===n.anchor.offset&&r>0){const n=o[r-1];if(n&&d(t,n)){const e=a(t.doc,n)??[];return t.transaction("input").setSelection(l(n,e)).build()}}return null}(t,f,p,b):null}export{I as i,g as n,S as r,h as t};
|
|
2
|
-
//# sourceMappingURL=NodeSelectionCommands-1PjwUDTJ.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function t(t,e,o){for(const a of e){const e=t.getNodeSpec(a);if(!e)continue;if(e.attrs?.[o.attrName])continue;const r=e.toDOM;t.removeNodeSpec(a),t.registerNodeSpec({...e,attrs:{...e.attrs,[o.attrName]:{default:o.getDefault(a)}},toDOM(t){const a=r.call(e,t);return o.applyToDOM(a,t),a}})}}export{t};
|
|
2
|
-
//# sourceMappingURL=NodeSpecPatching-B_yLknTl.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NodeSpecPatching-B_yLknTl.mjs","names":[],"sources":["../../src/plugins/shared/NodeSpecPatching.ts"],"sourcesContent":["/**\n * Helper for plugins that augment existing block NodeSpecs with an extra\n * attribute rendered as a DOM effect (e.g. alignment's `align`, text\n * direction's `dir`). Re-registers each target spec with the added attribute\n * and a `toDOM` wrapper that applies the effect after the original render.\n */\n\nimport type { BlockNode } from '../../model/Document.js';\nimport type { SchemaRegistry } from '../../model/SchemaRegistry.js';\n\nexport interface NodeSpecAttrPatch {\n\t/** Attribute name to add (skipped for specs that already declare it). */\n\treadonly attrName: string;\n\t/** Default value for the attribute, possibly per block type. */\n\treadonly getDefault: (type: string) => string;\n\t/** Applies the attribute-derived effect to the rendered element. */\n\treadonly applyToDOM: (el: HTMLElement, node: BlockNode) => void;\n}\n\n/**\n * Adds `patch.attrName` to each of `types` whose NodeSpec does not already\n * declare it, wrapping `toDOM` so `patch.applyToDOM` runs after the original.\n */\nexport function patchNodeSpecAttr(\n\tregistry: SchemaRegistry,\n\ttypes: Iterable<string>,\n\tpatch: NodeSpecAttrPatch,\n): void {\n\tfor (const type of types) {\n\t\tconst spec = registry.getNodeSpec(type);\n\t\tif (!spec) continue;\n\t\tif (spec.attrs?.[patch.attrName]) continue;\n\n\t\tconst originalToDOM = spec.toDOM;\n\n\t\tregistry.removeNodeSpec(type);\n\t\tregistry.registerNodeSpec({\n\t\t\t...spec,\n\t\t\tattrs: {\n\t\t\t\t...spec.attrs,\n\t\t\t\t[patch.attrName]: { default: patch.getDefault(type) },\n\t\t\t},\n\t\t\ttoDOM(node) {\n\t\t\t\tconst el = originalToDOM.call(spec, node);\n\t\t\t\tpatch.applyToDOM(el, node);\n\t\t\t\treturn el;\n\t\t\t},\n\t\t});\n\t}\n}\n"],"mappings":"AAuBA,SAAgB,EACf,EACA,EACA,GAEA,IAAK,MAAM,KAAQ,EAAO,CACzB,MAAM,EAAO,EAAS,YAAY,GAClC,IAAK,EAAM,SACX,GAAI,EAAK,QAAQ,EAAM,UAAW,SAElC,MAAM,EAAgB,EAAK,MAE3B,EAAS,eAAe,GACxB,EAAS,iBAAiB,IACtB,EACH,MAAO,IACH,EAAK,OACP,EAAM,UAAW,CAAE,QAAS,EAAM,WAAW,KAE/C,KAAA,CAAM,GACL,MAAM,EAAK,EAAc,KAAK,EAAM,GAEpC,OADA,EAAM,WAAW,EAAI,GACd,CACR,GAEF,CACD"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{l as e,u as n}from"./Selection-HYoVFpAx.mjs";import{n as t}from"./TypedKeys-CA4bfw9O.mjs";var r=class{resolvedLocale;constructor(e){this.resolvedLocale="browser"===e?"undefined"!=typeof navigator?navigator.language.split("-")[0]??"en":"en":e}getLocale(){return this.resolvedLocale}},o=new t("locale");async function c(e,n,t){if("en"===n)return t;const r=e[`./locales/${n}.ts`];if(!r)return t;try{return(await r()).default}catch{return t}}function s(e,n){return!!n&&(e.dispatch(n),!0)}function a(e){return e.charAt(0).toUpperCase()+e.slice(1)}function i(e){return`toggle${a(e)}`}async function l(e,n,t,r){if(n)return n;const c=e.getService(o)?.getLocale()??"en";return"en"===c?t:r(c)}function u(t){const r=t.selection;return e(r)?t.getBlock(r.nodeId):n(r)?t.getBlock(r.anchor.blockId):void 0}function d(t){const r=t.selection;return e(r)?r.nodeId:n(r)?r.anchor.blockId:void 0}function f(t){const r=t.selection;if(e(r))return[r.nodeId];if(!n(r))return[];const o=r.anchor.blockId,c=r.head.blockId;if(o===c)return[o];const s=t.getBlockOrder(),a=s.indexOf(o),i=s.indexOf(c);if(-1===a||-1===i)return[];const l=Math.min(a,i),u=Math.max(a,i);return s.slice(l,u+1)}export{f as a,c,d as i,r as l,s as n,l as o,u as r,i as s,a as t,o as u};
|
|
2
|
-
//# sourceMappingURL=PluginHelpers-Dx_0hfDe.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t,t as r}from"./KeyboardNav-D0my3wuy.mjs";var n=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]);function o(t){let n=0;const o=o=>{o.stopPropagation();const a=Array.from(t.container.querySelectorAll(t.itemSelector));if(0!==a.length)switch(o.key){case"Escape":return o.preventDefault(),void t.onClose();case"ArrowDown":return o.preventDefault(),n=e(a,n,1),r(a,n),void a[n]?.focus();case"ArrowUp":return o.preventDefault(),n=e(a,n,-1),r(a,n),void a[n]?.focus();case"Enter":case" ":{o.preventDefault();const e=a[n];return void(e&&t.onActivate(e))}case"Home":return o.preventDefault(),n=0,r(a,n),void a[n]?.focus();case"End":return o.preventDefault(),n=a.length-1,r(a,n),void a[n]?.focus()}};return t.container.addEventListener("keydown",o),()=>t.container.removeEventListener("keydown",o)}function a(t){let n=0;const o=o=>{const a=Array.from(t.container.querySelectorAll(t.itemSelector));if(0!==a.length)switch(o.key){case"Escape":return o.preventDefault(),void t.onClose();case"ArrowDown":return o.preventDefault(),n=e(a,n,1),r(a,n),void a[n]?.focus();case"ArrowUp":return o.preventDefault(),n=e(a,n,-1),r(a,n),void a[n]?.focus();case"Enter":case" ":{o.preventDefault();const e=a[n];return void(e&&t.onSelect(e))}}};return t.container.addEventListener("keydown",o),()=>t.container.removeEventListener("keydown",o)}function c(e){let o=0;const a=e.columns,c=e.totalCells,s=Math.ceil(c/a),i=i=>{const l=Array.from(e.container.querySelectorAll(e.cellSelector));if(0!==l.length){if("Escape"===i.key)return i.preventDefault(),void e.onClose();if("Enter"===i.key||" "===i.key){i.preventDefault();const t=l[o];return void(t&&e.onSelect(t))}if(n.has(i.key)){i.preventDefault();const[n,u]=t(Math.floor(o/a)+1,o%a+1,s,a,i.key);let v=(n-1)*a+(u-1);return v>=c&&(v=c-1),o=v,r(l,o),l[o]?.focus(),void e.onNavigate?.(o)}if("Home"===i.key||"End"===i.key){i.preventDefault();const t=Math.floor(o/a)*a,n=Math.min(t+a-1,c-1);o="Home"===i.key?t:n,r(l,o),l[o]?.focus(),e.onNavigate?.(o)}}};return e.container.addEventListener("keydown",i),()=>e.container.removeEventListener("keydown",i)}export{a as n,o as r,c as t};
|
|
2
|
-
//# sourceMappingURL=PopupKeyboardPatterns-tUrT9TyV.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./Platform-ByobkiCc.mjs";import{n as t}from"./TypedKeys-CA4bfw9O.mjs";import{a as s,i as n,t as o}from"./PopupPositioning-BFh6Ed1D.mjs";var r=new t("popup"),i=class{stack=[];referenceNode;constructor(e){this.referenceNode=e}open(e){const t=document.createElement("div");t.className=e.className?`notectl-popup ${e.className}`:"notectl-popup",e.ariaRole&&t.setAttribute("role",e.ariaRole),e.ariaLabel&&t.setAttribute("aria-label",e.ariaLabel);const r=e.parent?this.findEntryByHandle(e.parent):null;let i;const c={close:e=>this.closeEntry(i,e),getElement:()=>t},l=s=>{const n=s.composedPath();if(!n.includes(t)){for(const e of this.stack)if(n.includes(e.element))return;e.anchor instanceof HTMLElement&&n.includes(e.anchor)||this.closeEntry(i)}};i={element:t,config:e,clickOutsideHandler:l,parent:r,listenerRegistrationTimer:null,documentListenerAttached:!1},this.stack.push(i);try{e.content(t,e=>this.closeEntry(i,e))}catch(a){throw this.removeEntry(i),a}return this.stack.includes(i)?(o(t,e.referenceNode??this.referenceNode),s(t),n(t,e.anchor instanceof HTMLElement?e.anchor.getBoundingClientRect():e.anchor,{position:e.position??"below-start",isRtl:this.isRtlContext()}),i.listenerRegistrationTimer=setTimeout(()=>{i.listenerRegistrationTimer=null,this.stack.includes(i)&&(document.addEventListener("mousedown",l),i.documentListenerAttached=!0)},0),this.focusFirstItem(t),c):c}close(){const e=this.stack[this.stack.length-1];e&&this.closeEntry(e)}closeAll(){for(;this.stack.length>0;){const e=this.stack[this.stack.length-1];e&&this.closeEntry(e)}}isOpen(){return this.stack.length>0}destroy(){this.closeAll()}closeEntry(e,t){const s=this.stack.indexOf(e);if(-1!==s){for(;this.stack.length>s+1;){const e=this.stack[this.stack.length-1];e&&this.removeEntry(e)}this.removeEntry(e),void 0!==t&&"restoreFocusTo"in t?t.restoreFocusTo?.focus():e.config.restoreFocusTo&&e.config.restoreFocusTo.focus(),e.config.onClose?.()}}removeEntry(e){const t=this.stack.indexOf(e);-1!==t&&(this.stack.splice(t,1),null!==e.listenerRegistrationTimer&&(clearTimeout(e.listenerRegistrationTimer),e.listenerRegistrationTimer=null),e.element.remove(),e.documentListenerAttached&&(document.removeEventListener("mousedown",e.clickOutsideHandler),e.documentListenerAttached=!1))}findEntryByHandle(e){const t=e.getElement();return this.stack.find(e=>e.element===t)??null}isRtlContext(){return this.referenceNode instanceof HTMLElement&&e(this.referenceNode)}focusFirstItem(e){requestAnimationFrame(()=>{(e.querySelector('[role="menuitem"]')??e.querySelector('[role="option"]')??e.querySelector('[role="gridcell"]')??e.querySelector("input, textarea")??e.querySelector("button"))?.focus()})}};export{r as n,i as t};
|
|
2
|
-
//# sourceMappingURL=PopupManager-CT-fMZJn.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as t,n as e,r as n}from"./HTMLUtils-Bhg3_P8B.mjs";import{i as o,l as r,r as s,s as i}from"./StyleRuntime-DW6omotc.mjs";import{_ as a,c,d as l,h as u,i as d,n as p,r as f,s as h,t as m}from"./PrintTypes-CxU69qu3.mjs";import{c as g,o as y}from"./PluginHelpers-Dx_0hfDe.mjs";import{t as b}from"./ShortcutFormatting-TwiufqeV.mjs";import v from"dompurify";var $={label:"Print",tooltip:t=>`Print (${t})`,printingAnnouncement:"Printing"},S=/* #__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-Uzo1Azdw.mjs"),"./locales/de.ts":()=>import("./de-DcMhfRBu.mjs"),"./locales/es.ts":()=>import("./es-BJHF95J_.mjs"),"./locales/fr.ts":()=>import("./fr-KXmbys88.mjs"),"./locales/hi.ts":()=>import("./hi-l6DA-aOw.mjs"),"./locales/pt.ts":()=>import("./pt-C8sOyw0V.mjs"),"./locales/ru.ts":()=>import("./ru-B1m8J9dl.mjs"),"./locales/zh.ts":()=>import("./zh-dGSDBBzb.mjs")});async function w(t){return g(S,t,$)}var k=["h1","h2","h3","h4","h5","h6","p","div","span","br","hr","strong","b","em","i","u","s","sub","sup","small","ul","ol","li","table","thead","tbody","tr","th","td","img"],T=["style","class","src","alt","width","height","colspan","rowspan"];function C(t){const e="function"==typeof t?t():t;return v.sanitize(e,{ALLOWED_TAGS:[...k],ALLOWED_ATTR:[...T]})}var j=new Set(["AREA","BASE","BR","COL","EMBED","HR","IMG","INPUT","LINK","META","PARAM","SOURCE","TRACK","WBR"]),A=new Set(["TABLE","THEAD","TBODY","TFOOT","TR"]),L=new Set(["AUDIO","CANVAS","EMBED","IFRAME","IMG","INPUT","METER","OBJECT","PROGRESS","SELECT","TEXTAREA","VIDEO"]);function x(t,e){let n;do{n=`${t}-${crypto.randomUUID()}`}while(e.has(n));return e.add(n),n}function E(t){const e=/* @__PURE__ */new Map;t.matches("[data-block-id][id]")&&""!==t.id&&e.set(t.id,t);for(const n of t.querySelectorAll("[data-block-id][id]")){const t=n.id;""===t||e.has(t)||e.set(t,n)}return e}function M(e,n){for(const o of t(n)){const t=e.get(o);if(t)return t}}function R(t,e,n,o){const r=x("notectl-print-destination",n),s=x("notectl-print-destination-slot",o),i=e.createElement("slot");i.name=s,i.setAttribute("data-notectl-print-destination-slot",""),function(t,e){if(j.has(t.tagName)||L.has(t.tagName))t.before(e);else{if(A.has(t.tagName)){const n=t.querySelector("th, td");if(n)return void n.insertBefore(e,n.firstChild);const o=t.closest("table");if(o?.parentNode)return void o.before(e)}t.insertBefore(e,t.firstChild)}}(t,i);const a=e.createElement("a");return a.id=r,a.setAttribute("href",`#${r}`),a.slot=s,a.tabIndex=-1,a.setAttribute("aria-hidden","true"),a.setAttribute("data-notectl-print-destination",""),function(t){for(const[e,n]of Object.entries({all:"initial",display:"block",position:"absolute",width:"0",height:"0",margin:"0",padding:"0",border:"0",overflow:"hidden","pointer-events":"none","font-size":"0","line-height":"0",color:"transparent",background:"transparent"}))t.style.setProperty(e,n,"important")}(a),{id:r,marker:a}}var N="notectl-host";function B(t){const e=Array.from(t.styleSheets),n=t.adoptedStyleSheets;return n&&e.push(...n),e}function H(t,e){const n=t[e]??'"';let o=e+1;for(;o<t.length;){const e=t[o]??"";if("\\"!==e){if(e===n)return o+1;o++}else o+=2}return t.length}function z(t,e){if("url("!==t.slice(e,e+4).toLowerCase())return!1;const n=e>0?t[e-1]??"":"";return!/[\w-]/.test(n)}function P(t,e){let n=e+4;for(;n<t.length&&/\s/.test(t[n]??"");)n++;const o=t[n]??"";let r;if('"'===o||"'"===o){const e=H(t,n);r=t.slice(n+1,e-1),n=e}else{const e=t.indexOf(")",n);if(-1===e)return null;r=t.slice(n,e).trim(),n=e}for(;n<t.length&&/\s/.test(t[n]??"");)n++;return")"!==t[n]?null:{end:n+1,url:(s=r,s.replace(/\\([0-9a-f]{1,6}\s?|[\s\S])/gi,(t,e)=>{const n=e.trim();if(/^[0-9a-f]{1,6}$/i.test(n)){const t=Number.parseInt(n,16);return t>0&&t<=1114111?String.fromCodePoint(t):"�"}return e}))};var s}function q(t,e,n){if(!e||!function(t){return!t.startsWith("#")&&!t.startsWith("//")&&!/^[a-z][a-z0-9+.-]*:/i.test(t)}(e))return t;try{return`url("${new URL(e,n).href}")`}catch{return t}}function D(t,e){if(!t.toLowerCase().includes("url("))return t;let n="",o=0;for(;o<t.length;){const r=t[o]??"";if('"'===r||"'"===r){const e=H(t,o);n+=t.slice(o,e),o=e;continue}if(z(t,o)){const r=P(t,o);if(r){n+=q(t.slice(o,r.end),r.url,e),o=r.end;continue}}n+=r,o++}return n}function O(t){return t.anonymousLayerCount+=1,`notectl-anonymous-${t.anonymousLayerCount}`}var I={media:[],layers:[],supports:[]};function U(t,e,n,o){const r=e.trim(),s=o?.trim()??"";return{media:r&&"all"!==r?[...t.media,r]:t.media,layers:null===n?t.layers:[...t.layers,""===n?null:n],supports:s?[...t.supports,s]:t.supports}}function W(t,e,n){const o=[N];for(const c of n.layers)o.push(c??O(t));const r=0===(s=n.supports).length?"":1===s.length?` supports(${s[0]})`:` supports(${s.map(t=>`(${t})`).join(" and ")})`;var s;const i=n.media.length?` ${n.media.join(" and ")}`:"";var a;t.segments.push({kind:"import",statement:`@import url("${a=e,a.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}") layer(${o.join(".")})${r}${i};`})}function V(t,e){const n=e.trim();return n&&"all"!==n?`@media ${n} {\n${t}\n}`:t}function G(t,e){if(e.seen.has(t))return;if(e.seen.add(t),t.disabled)return;const n=U(I,t.media.mediaText,null,null);let o;try{o=t.cssRules}catch{return void(t.href&&W(e,t.href,n))}const r=t.href??e.baseURL,s=[];for(const a of o)3!==a.type?s.push(D(a.cssText,r)):F(a,e,s,n);const i=s.join("\n");i&&function(t,e){const n=t.segments[t.segments.length-1];"rules"!==n?.kind?t.segments.push({kind:"rules",css:e}):t.segments[t.segments.length-1]={kind:"rules",css:`${n.css}\n${e}`}}(e,V(i,t.media.mediaText))}function F(t,e,n,o){const r=t.layerName??null,s=t.supportsText??null,i=U(o,t.media.mediaText,r,s),a=t.styleSheet;if(a&&!e.seen.has(a)){let o;try{o=a.cssRules}catch{o=null}if(o){e.seen.add(a);const c=a.href??e.baseURL,l=[];for(const t of o)3!==t.type?l.push(D(t.cssText,c)):F(t,e,l,i);let u=l.join("\n");return void(u&&(null!==r&&(u=""===r?`@layer {\n${u}\n}`:`@layer ${r} {\n${u}\n}`),s?.trim()&&(u=`@supports (${s.trim()}) {\n${u}\n}`),n.push(V(u,t.media.mediaText))))}}const c=a?.href??t.href;c&&W(e,c,i)}var K="notectl-print",_="notectl-custom";function Y(t){return t.replace(/;$/gm," !important;")}function J(t){return Y(u(a).replace(":host {",`${t} {`))}function X(t,e){const n=getComputedStyle(t),o=[];for(let r=0;r<n.length;r++){const t=n[r]??"";if(t.startsWith("--notectl-")){const e=n.getPropertyValue(t).trim();e&&o.push(` ${t}: ${e};`)}}return 0===o.length?"":`${e} {\n${o.join("\n")}\n}`}var Q=["","transparent","rgba(0, 0, 0, 0)"];function Z(t){let e=t;for(;e;){const t=getComputedStyle(e).getPropertyValue("background-color").trim();if(!Q.includes(t))return t;const n=e.getRootNode();e=e.parentElement??(n instanceof ShadowRoot?n.host:null)}return"#ffffff"}function tt(t,e,n="#ffffff",o="body"){const r=getComputedStyle(t),s=["font-family","font-size","font-weight","line-height","letter-spacing","word-spacing","color"],i=[" margin: 0;",` background: ${n};`];for(const a of s){if("color"===a&&e){i.push(` color: ${e};`);continue}const t=r.getPropertyValue(a).trim();t&&i.push(` ${a}: ${t};`)}return`${o} {\n${i.join("\n")}\n}`}var et=["display: block","position: static","inset: auto","width: auto","height: auto","min-width: 0","min-height: 0","max-width: none","max-height: none","margin: 0","padding: 0","border: none","border-radius: 0","outline: none","box-shadow: none","background: transparent","overflow: visible","transform: none","filter: none","opacity: 1","contain: none","float: none","visibility: visible","clip: auto","clip-path: none","content-visibility: visible"],nt=["display: block","visibility: visible","opacity: 1","position: static","height: auto","min-height: 0","max-height: none","overflow: visible","transform: none","filter: none","contain: none","clip: auto","clip-path: none","content-visibility: visible"];function ot(t){return[`${t} {`,...et.map(t=>` ${t} !important;`),"}"].join("\n")}function rt(t,e,n){const o=t.tagName.toLowerCase(),r=[],s=!1!==n.forceLightTheme,i=[ot(o),["html, body {",...nt.map(t=>` ${t} !important;`),"}"].join("\n")];if(s&&i.push(J(`:root, ${o}`)),!1!==n.printBackground&&i.push("* {\n -webkit-print-color-adjust: exact !important;\n print-color-adjust: exact !important;\n}"),r.push(`@layer ${K} {\n${i.join("\n\n")}\n}`),!s){const e=X(t,`:root, ${o}`);e&&r.push(e)}const c=s?a.primitives.foreground:void 0,u=s?"#ffffff":Z(e);r.push(tt(t,c,u));const d=function(t){const e=[];if(t.margin?e.push(` margin: ${t.margin};`):t.paperSize&&e.push(" margin: 0;"),t.paperSize||t.orientation){const n=[t.paperSize?l(t.paperSize):"A4"];t.orientation&&n.push(t.orientation),e.push(` size: ${n.join(" ")};`)}return 0===e.length?"":`@page {\n${e.join("\n")}\n}`}(n);return d&&r.push(d),n.customCSS&&(r.push(n.customCSS),r.push(`@layer ${_} {\n${n.customCSS}\n}`)),r.join("\n\n")}function st(t,e,n,o){const r=`${t.tagName.toLowerCase()}[${o}]`,s=!1!==n.forceLightTheme,i=[ot(r)];s&&i.push(J(r)),!1!==n.printBackground&&i.push(`${r}, ${r} * {\n -webkit-print-color-adjust: exact !important;\n print-color-adjust: exact !important;\n}`);const c=s?a.primitives.foreground:void 0,l=s?"#ffffff":Z(e);i.push(Y(tt(t,c,l,r)));const u=[`@layer ${K} {\n${i.join("\n\n")}\n}`];if(!s){const e=X(t,r);e&&u.push(e)}return u.join("\n\n")}var it="data-notectl-print-fallback",at=["(function () {"," var head = document.head;"," if (head && head.querySelector('meta[name=\"notectl-print-export\"]')) {"," var bundles = document.querySelectorAll('template[data-notectl-print-styles]');"," for (var b = 0; b < bundles.length; b++) {"," if (bundles[b].content) head.appendChild(bundles[b].content);"," bundles[b].parentNode.removeChild(bundles[b]);"," }"," }"," var statics = document.querySelectorAll('[data-notectl-static]');"," for (var i = 0; i < statics.length; i++) {"," var host = statics[i];"," if (!host.shadowRoot && host.attachShadow) {"," for (var j = 0; j < host.children.length; j++) {"," var child = host.children[j];"," if (child.tagName !== 'TEMPLATE') continue;"," if (!child.getAttribute('shadowrootmode') || !child.content) continue;"," host.attachShadow({ mode: 'open' }).appendChild(child.content);"," host.removeChild(child);"," break;"," }"," }"," if (!host.shadowRoot) continue;"," var fallbacks = host.querySelectorAll('[data-notectl-print-fallback]');"," for (var k = 0; k < fallbacks.length; k++) {"," fallbacks[k].parentNode.removeChild(fallbacks[k]);"," }"," }","})();"].join("\n");function ct(t){return t.replace(/<\//g,"<\\/")}function lt(t,n){const o=[];for(const r of Array.from(t.attributes))n(r.name)&&o.push(""===r.value?r.name:`${r.name}="${e(r.value)}"`);return o.length>0?` ${o.join(" ")}`:""}function ut(t){return t?lt(t,t=>"class"===t||t.startsWith("data-")):""}function dt(t){const n=function(t){if(!(t instanceof HTMLElement))return"";const e=[];for(let n=0;n<t.style.length;n++){const o=t.style[n]??"";if(!o.startsWith("--notectl-"))continue;const r=t.style.getPropertyValue(o).trim();r&&e.push(`${o}: ${r}`)}return e.join("; ")}(t);return n?` style="${e(n)}"`:""}function pt(t){const o=t.host.ownerDocument,r=t.host.tagName.toLowerCase(),s="export"===t.variant,i=s?["style","id",d]:["style",d],a=(c=t.host,l=i,lt(c,t=>!l.includes(t)));var c,l;const u=t.carryThemeContext?dt(t.host):"",p=t.carryThemeContext?ut(o.documentElement)+dt(o.documentElement):"",f=t.carryThemeContext?ut(o.body)+dt(o.body):"",h=t.styleNonce?` nonce="${e(t.styleNonce)}"`:"",m=['<meta charset="utf-8">',`<title>${n(t.title)}</title>`];s&&m.push('<meta name="notectl-print-export">'),m.push(`<style${h}>@layer ${_}, ${K}, ${N};</style>`),m.push(`<style${h}>${ct(t.documentCSS)}</style>`);const g=t.hostSegments.map(t=>`<style${h}>${ct("import"===t.kind?t.statement:`@layer ${N} {\n${t.css}\n}`)}</style>`);s||m.push(...g);const y=s?`<template data-notectl-print-styles><style>${ct(t.standaloneCSS)}</style>${g.join("")}</template>`:"",b=s?`<div ${it}><style>@scope ([${it}]) {\n${ct(t.shadowCSS)}\n}</style>${t.fallbackContentHTML}</div>`:"",v=s?`<script>${at}<\/script>`:"",$=[`<${r}${a}${u} ${d}>`,'<template shadowrootmode="open">',`<style${h}>${ct(t.shadowCSS)}</style>`,t.contentHTML,"</template>",...b?[b]:[],...t.destinationMarkersHTML?[t.destinationMarkersHTML]:[],`</${r}>`,...y?[y]:[],...v?[v]:[]];return["<!DOCTYPE html>",`<html lang="${e(t.lang)}"${p}>`,"<head>",...m,"</head>",`<body${f}>`,...$,"</body>","</html>"].join("\n")}function ft(t,e,n,a){const c=/* @__PURE__ */new Set;function l(t){return t??{}}function u(r){const s={options:r,cancelled:!1};if(a.emit(p,s),s.cancelled)return null;const c=s.options,l=function(t,e){const n=[],r=function(t){const e=[],n=[];for(const r of t.adoptedStyleSheets){const t=o(r)?n:e;for(const e of r.cssRules)t.push(e.cssText)}return{base:e.join("\n"),runtime:n.join("\n")}}(t);r.base&&n.push(`@layer notectl-base {\n${r.base}\n}`),r.runtime&&n.push(r.runtime);const s=function(t){const e=[];e.push(".notectl-content { height: auto !important; max-height: none !important; min-height: 0 !important; overflow: visible !important; }"),t.paperSize&&e.push(".notectl-content { padding: 48px 56px !important; }");const n=[];return n.push("[data-notectl-no-print] { display: none !important; }"),n.push(".notectl-code-block { white-space: pre-wrap !important; word-break: break-all !important; page-break-inside: avoid; }"),n.push("img { page-break-inside: avoid; }"),n.push(".notectl-table { break-inside: avoid; }"),!1!==t.printBackground&&n.push("* { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }"),e.push(`@media print {\n ${n.join("\n ")}\n}`),e.join("\n\n")}(e);return s&&n.push(s),e.customCSS&&n.push(e.customCSS),n.join("\n\n")}(t,c),u=function(t){const e={segments:[],seen:/* @__PURE__ */new Set,baseURL:t.ownerDocument.baseURI??"",anonymousLayerCount:0};for(const n of function(t){const e=[];let n=t.getRootNode();for(;n instanceof ShadowRoot;)e.push(n),n=n.host.getRootNode();return e.push(t.ownerDocument),e.reverse()}(t))for(const t of B(n))G(t,e);return e.segments}(e),f=function(t,e){const n=function(t){return(t.querySelector(".notectl-content")??t).cloneNode(!0)}(t);return function(t){t.removeAttribute("contenteditable");for(const e of["notectl-node-selected","notectl-content--empty","notectl-table-cell--selected"]){t.classList.remove(e);for(const n of t.querySelectorAll(`.${e}`))n.classList.remove(e)}t.removeAttribute("data-placeholder")}(n),function(t,e){if(e.excludeBlockTypes)for(const n of e.excludeBlockTypes){const e=t.querySelectorAll(`[data-block-type="${n}"]`);for(const t of e)t.remove()}if(e.pageBreakBefore)for(const n of e.pageBreakBefore){const e=t.querySelectorAll(`[data-block-type="${n}"]`);for(const t of e)i(t,{breakBefore:"page",pageBreakBefore:"always"})}}(n,e),function(t,e){if(e.header){const n=document.createElement("div");n.className="notectl-print-header",n.innerHTML=C(e.header),t.insertBefore(n,t.firstChild)}if(e.footer){const n=document.createElement("div");n.className="notectl-print-footer",n.innerHTML=C(e.footer),t.appendChild(n)}}(n,e),n}(n,c),h=f.cloneNode(!0);!function(t){const e=E(t);if(0===e.size)return;const n=/* @__PURE__ */new Set;""!==t.id&&n.add(t.id);for(const r of t.querySelectorAll("[id]"))n.add(r.id);const o=/* @__PURE__ */new Map;for(const r of function(t){const e=[];return t.matches("[data-block-id][id]")&&""!==t.id&&e.push(t),e.push(...t.querySelectorAll("[data-block-id][id]")),e}(t)){const t=x("notectl-print-fallback-destination",n);o.set(r,t),r.id=t}for(const r of t.querySelectorAll("a[href]")){const t=M(e,r.getAttribute("href")??""),n=t?o.get(t):void 0;n&&r.setAttribute("href",`#${n}`)}}(h);const g=h.outerHTML,y=function(t){const e=E(t);if(0===e.size)return{markers:[]};const n=t.ownerDocument,o=/* @__PURE__ */new Set;""!==t.id&&o.add(t.id);for(const a of t.querySelectorAll("[id]"))o.add(a.id);const r=/* @__PURE__ */new Set;for(const a of t.querySelectorAll("slot[name]"))r.add(a.name);const s=/* @__PURE__ */new Map,i=[];for(const a of t.querySelectorAll("a[href]")){const t=a.getAttribute("href")??"";if(!t.startsWith("#"))continue;const c=M(e,t);if(!c)continue;let l=s.get(c);l||(l=R(c,n,o,r),s.set(c,l),i.push(l.marker)),a.setAttribute("href",`#${l.id}`)}return{markers:i}}(f),b=f.outerHTML,v=y.markers.map(t=>t.outerHTML).join(""),$=c.title??"",S=e.ownerDocument,w=e.closest("[lang]")?.getAttribute("lang")??(S.documentElement.lang||"en"),k={documentCSS:st(e,n,c,d),standaloneCSS:rt(e,n,c),hostSegments:u,shadowCSS:l,host:e,contentHTML:b,fallbackContentHTML:g,destinationMarkersHTML:v,title:$,lang:w,carryThemeContext:!1===c.forceLightTheme,variant:"export"},T=pt(k),j={html:T};return a.emit(m,j),{html:T,input:k}}return{print(t){const e=u(l(t));if(!e)return;const o=pt({...e.input,documentCSS:e.input.standaloneCSS,variant:"internal",styleNonce:s(n)}),i=document.createElement("iframe");r(i,"position:fixed;left:-9999px;width:0;height:0;border:none"),document.body.appendChild(i);const a=i.contentDocument,d=i.contentWindow;if(!a||!d)return void document.body.removeChild(i);a.open(),a.write(o),a.close();const p=()=>{i.remove()},f=()=>{d.addEventListener("afterprint",p,{once:!0}),d.print()};if("complete"===a.readyState)return void f();let h=!1;const m=()=>{h||(h=!0,c.delete(g),window.clearTimeout(y),f())},g=()=>{h=!0,window.clearTimeout(y),d.removeEventListener("load",m),i.remove()},y=window.setTimeout(m,4e3);c.add(g),d.addEventListener("load",m,{once:!0})},toHTML:t=>u(l(t))?.html??"",dispose(){for(const t of c)t();c.clear()}}}var ht={print(){},toHTML:()=>"",dispose(){}},mt=class{id="print";name="Print";config;service=null;locale;constructor(t){this.config=t??{}}async init(t){this.locale=await y(t,this.config.locale,$,w);const e=t.getContainer(),n=e.getRootNode();if(n instanceof ShadowRoot){const o=n.host,r=t.getEventBus();this.service=ft(n,o,e,r)}else this.service=ht;t.registerService(f,this.service);const o=this.config.defaults??{},r=this.service,s=this.locale;t.registerCommand("print",()=>(t.announce(s.printingAnnouncement),r.print(o),!0));const i=this.config.keyBinding??"Mod-P";if(t.registerKeymap({[i]:()=>(t.executeCommand("print"),!0)}),!1!==this.config.showToolbarItem){const e=b(i);t.registerToolbarItem({id:"print",group:"actions",label:this.locale.label,tooltip:this.locale.tooltip(e),icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-1-9H6v4h12V3z"/></svg>',command:"print"})}}destroy(){this.service?.dispose(),this.service=null}};export{$ as n,w as r,mt as t};
|
|
2
|
-
//# sourceMappingURL=PrintPlugin-7zz9mhhU.mjs.map
|