@notectl/core 2.0.9 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/AlignmentPlugin-bqK6ze-E.mjs +2 -0
- package/dist/chunks/AlignmentPlugin-bqK6ze-E.mjs.map +1 -0
- package/dist/chunks/BidiIsolationPlugin-SIKxfWXp.mjs +2 -0
- package/dist/chunks/BidiIsolationPlugin-SIKxfWXp.mjs.map +1 -0
- package/dist/chunks/BlockquotePlugin-BEaZSoVT.mjs +2 -0
- package/dist/chunks/BlockquotePlugin-BEaZSoVT.mjs.map +1 -0
- package/dist/chunks/CaretNavigationPlugin-DHl61oc6.mjs +2 -0
- package/dist/chunks/CaretNavigationPlugin-DHl61oc6.mjs.map +1 -0
- package/dist/chunks/CodeBlockPlugin-DglqiSNK.mjs +2 -0
- package/dist/chunks/CodeBlockPlugin-DglqiSNK.mjs.map +1 -0
- package/dist/chunks/ColorGrid-Czm0p2E9.mjs +2 -0
- package/dist/chunks/ColorGrid-Czm0p2E9.mjs.map +1 -0
- package/dist/chunks/ColorPickerPopup-CL-W380M.mjs +2 -0
- package/dist/chunks/ColorPickerPopup-CL-W380M.mjs.map +1 -0
- package/dist/chunks/DirectionDetection-Hun6-7ER.mjs +2 -0
- package/dist/chunks/DirectionDetection-Hun6-7ER.mjs.map +1 -0
- package/dist/chunks/DirectionIcons-CfaDcQ9a.mjs +2 -0
- package/dist/chunks/DirectionIcons-CfaDcQ9a.mjs.map +1 -0
- package/dist/chunks/DocumentParser-CyATBOz-.mjs +2 -0
- package/dist/chunks/DocumentParser-CyATBOz-.mjs.map +1 -0
- package/dist/chunks/FontPlugin-B-Sxa0UW.mjs +2 -0
- package/dist/chunks/FontPlugin-B-Sxa0UW.mjs.map +1 -0
- package/dist/chunks/FontSizePlugin-C1zlyXL2.mjs +2 -0
- package/dist/chunks/FontSizePlugin-C1zlyXL2.mjs.map +1 -0
- package/dist/chunks/GapCursorPlugin-nldun8cE.mjs +2 -0
- package/dist/chunks/GapCursorPlugin-nldun8cE.mjs.map +1 -0
- package/dist/chunks/HTMLUtils-brwcaufP.mjs +2 -0
- package/dist/chunks/HTMLUtils-brwcaufP.mjs.map +1 -0
- package/dist/chunks/HardBreakPlugin-DZRdsE15.mjs +2 -0
- package/dist/chunks/HardBreakPlugin-DZRdsE15.mjs.map +1 -0
- package/dist/chunks/HeadingPlugin-EPAmsEGt.mjs +2 -0
- package/dist/chunks/HeadingPlugin-EPAmsEGt.mjs.map +1 -0
- package/dist/chunks/HighlightPlugin-RN3l6pVJ.mjs +2 -0
- package/dist/chunks/HighlightPlugin-RN3l6pVJ.mjs.map +1 -0
- package/dist/chunks/HorizontalRulePlugin-BJPXzTtJ.mjs +2 -0
- package/dist/chunks/HorizontalRulePlugin-BJPXzTtJ.mjs.map +1 -0
- package/dist/chunks/ImagePlugin-CCEevNfJ.mjs +2 -0
- package/dist/chunks/ImagePlugin-CCEevNfJ.mjs.map +1 -0
- package/dist/chunks/InlineCodePlugin-B7IOgUSI.mjs +2 -0
- package/dist/chunks/InlineCodePlugin-B7IOgUSI.mjs.map +1 -0
- package/dist/chunks/LinkPlugin-Bhwg24lH.mjs +2 -0
- package/dist/chunks/LinkPlugin-Bhwg24lH.mjs.map +1 -0
- package/dist/chunks/ListPlugin-BkG6UO4x.mjs +2 -0
- package/dist/chunks/ListPlugin-BkG6UO4x.mjs.map +1 -0
- package/dist/chunks/PluginHelpers-D-MvWR98.mjs +2 -0
- package/dist/chunks/PluginHelpers-D-MvWR98.mjs.map +1 -0
- package/dist/chunks/PopupKeyboardPatterns-DQdL7RHx.mjs +2 -0
- package/dist/chunks/PopupKeyboardPatterns-DQdL7RHx.mjs.map +1 -0
- package/dist/chunks/PopupManager-CxPzNm-P.mjs +2 -0
- package/dist/chunks/PopupManager-CxPzNm-P.mjs.map +1 -0
- package/dist/chunks/PrintPlugin-DOk5IZRO.mjs +2 -0
- package/dist/chunks/PrintPlugin-DOk5IZRO.mjs.map +1 -0
- package/dist/chunks/PrintTypes-Drk6kLcl.mjs +2 -0
- package/dist/chunks/PrintTypes-Drk6kLcl.mjs.map +1 -0
- package/dist/chunks/SmartPastePlugin-DqKx94sH.mjs +2 -0
- package/dist/chunks/SmartPastePlugin-DqKx94sH.mjs.map +1 -0
- package/dist/chunks/StrikethroughPlugin-vYNzfxdy.mjs +2 -0
- package/dist/chunks/StrikethroughPlugin-vYNzfxdy.mjs.map +1 -0
- package/dist/chunks/SuperSubPlugin-BNsoXWHS.mjs +2 -0
- package/dist/chunks/SuperSubPlugin-BNsoXWHS.mjs.map +1 -0
- package/dist/chunks/TablePlugin-R-hmydrM.mjs +2 -0
- package/dist/chunks/TablePlugin-R-hmydrM.mjs.map +1 -0
- package/dist/chunks/TextColorPlugin-DQ-CB9cr.mjs +2 -0
- package/dist/chunks/TextColorPlugin-DQ-CB9cr.mjs.map +1 -0
- package/dist/chunks/TextDirectionAutoPlugin-DS_gpI8N.mjs +2 -0
- package/dist/chunks/TextDirectionAutoPlugin-DS_gpI8N.mjs.map +1 -0
- package/dist/chunks/TextDirectionPlugin-Bk3CkbYh.mjs +2 -0
- package/dist/chunks/TextDirectionPlugin-Bk3CkbYh.mjs.map +1 -0
- package/dist/chunks/TextDirectionService-DY4M8EwU.mjs +2 -0
- package/dist/chunks/TextDirectionService-DY4M8EwU.mjs.map +1 -0
- package/dist/chunks/TextFormattingPlugin-D13eP6nF.mjs +2 -0
- package/dist/chunks/TextFormattingPlugin-D13eP6nF.mjs.map +1 -0
- package/dist/chunks/ToolbarPlugin-DeH8n5d2.mjs +2 -0
- package/dist/chunks/ToolbarPlugin-DeH8n5d2.mjs.map +1 -0
- package/dist/chunks/TypedKeys-CU7aToqY.mjs +2 -0
- package/dist/chunks/TypedKeys-CU7aToqY.mjs.map +1 -0
- package/dist/chunks/XmlDetector-BtYxzBDa.mjs +2 -0
- package/dist/chunks/XmlDetector-BtYxzBDa.mjs.map +1 -0
- package/dist/chunks/XmlPatterns-DuP8GWVt.mjs +2 -0
- package/dist/chunks/XmlPatterns-DuP8GWVt.mjs.map +1 -0
- package/dist/chunks/XmlSupport-D54BdAJZ.mjs +2 -0
- package/dist/chunks/XmlSupport-D54BdAJZ.mjs.map +1 -0
- package/dist/chunks/ar-2Fkz_6nI.mjs +2 -0
- package/dist/chunks/ar-2Fkz_6nI.mjs.map +1 -0
- package/dist/chunks/ar-4ZPC8daa.mjs +2 -0
- package/dist/chunks/ar-4ZPC8daa.mjs.map +1 -0
- package/dist/chunks/ar-6I20_Djq.mjs +2 -0
- package/dist/chunks/ar-6I20_Djq.mjs.map +1 -0
- package/dist/chunks/ar-B7-Dm70S.mjs +2 -0
- package/dist/chunks/ar-B7-Dm70S.mjs.map +1 -0
- package/dist/chunks/ar-BRe0t96G.mjs +2 -0
- package/dist/chunks/ar-BRe0t96G.mjs.map +1 -0
- package/dist/chunks/ar-BnNyrtdi.mjs +2 -0
- package/dist/chunks/ar-BnNyrtdi.mjs.map +1 -0
- package/dist/chunks/ar-BsMfhWs5.mjs +2 -0
- package/dist/chunks/ar-BsMfhWs5.mjs.map +1 -0
- package/dist/chunks/ar-Bvja-bjE.mjs +2 -0
- package/dist/chunks/ar-Bvja-bjE.mjs.map +1 -0
- package/dist/chunks/ar-BxVbBvSa.mjs +2 -0
- package/dist/chunks/ar-BxVbBvSa.mjs.map +1 -0
- package/dist/chunks/ar-C5dW-co3.mjs +2 -0
- package/dist/chunks/ar-C5dW-co3.mjs.map +1 -0
- package/dist/chunks/ar-CARMr30L.mjs +2 -0
- package/dist/chunks/ar-CARMr30L.mjs.map +1 -0
- package/dist/chunks/ar-CB-pehGw.mjs +2 -0
- package/dist/chunks/ar-CB-pehGw.mjs.map +1 -0
- package/dist/chunks/ar-CEYgAxTM.mjs +2 -0
- package/dist/chunks/ar-CEYgAxTM.mjs.map +1 -0
- package/dist/chunks/ar-CO60qpZJ.mjs +2 -0
- package/dist/chunks/ar-CO60qpZJ.mjs.map +1 -0
- package/dist/chunks/ar-CtI_snUM.mjs +2 -0
- package/dist/chunks/ar-CtI_snUM.mjs.map +1 -0
- package/dist/chunks/ar-Cv1RQvhK.mjs +2 -0
- package/dist/chunks/ar-Cv1RQvhK.mjs.map +1 -0
- package/dist/chunks/ar-D5jV20Tu.mjs +2 -0
- package/dist/chunks/ar-D5jV20Tu.mjs.map +1 -0
- package/dist/chunks/ar-DJN9fQ7Z.mjs +2 -0
- package/dist/chunks/ar-DJN9fQ7Z.mjs.map +1 -0
- package/dist/chunks/ar-DPTsUnwA.mjs +2 -0
- package/dist/chunks/ar-DPTsUnwA.mjs.map +1 -0
- package/dist/chunks/ar-DZJIBD1Q.mjs +2 -0
- package/dist/chunks/ar-DZJIBD1Q.mjs.map +1 -0
- package/dist/chunks/ar-DkkbwV93.mjs +2 -0
- package/dist/chunks/ar-DkkbwV93.mjs.map +1 -0
- package/dist/chunks/ar-DmeMor8Y.mjs +2 -0
- package/dist/chunks/ar-DmeMor8Y.mjs.map +1 -0
- package/dist/chunks/ar-LnE7jPai.mjs +2 -0
- package/dist/chunks/ar-LnE7jPai.mjs.map +1 -0
- package/dist/chunks/ar-P3wW0fmA.mjs +2 -0
- package/dist/chunks/ar-P3wW0fmA.mjs.map +1 -0
- package/dist/chunks/ar-uum0DCfv.mjs +2 -0
- package/dist/chunks/ar-uum0DCfv.mjs.map +1 -0
- package/dist/chunks/color-picker-DlXhHBZ6.mjs +2 -0
- package/dist/chunks/color-picker-DlXhHBZ6.mjs.map +1 -0
- package/dist/chunks/de-8SHQu0rr.mjs +2 -0
- package/dist/chunks/de-8SHQu0rr.mjs.map +1 -0
- package/dist/chunks/de-B8a71A0X.mjs +2 -0
- package/dist/chunks/de-B8a71A0X.mjs.map +1 -0
- package/dist/chunks/de-B9weXoA1.mjs +2 -0
- package/dist/chunks/de-B9weXoA1.mjs.map +1 -0
- package/dist/chunks/de-BKm53tVU.mjs +2 -0
- package/dist/chunks/de-BKm53tVU.mjs.map +1 -0
- package/dist/chunks/de-BLWrnMfX.mjs +2 -0
- package/dist/chunks/de-BLWrnMfX.mjs.map +1 -0
- package/dist/chunks/de-BOujs1pF.mjs +2 -0
- package/dist/chunks/de-BOujs1pF.mjs.map +1 -0
- package/dist/chunks/de-B_1XleAG.mjs +2 -0
- package/dist/chunks/de-B_1XleAG.mjs.map +1 -0
- package/dist/chunks/de-BpmjrOMc.mjs +2 -0
- package/dist/chunks/de-BpmjrOMc.mjs.map +1 -0
- package/dist/chunks/de-C8OHD1fm.mjs +2 -0
- package/dist/chunks/de-C8OHD1fm.mjs.map +1 -0
- package/dist/chunks/de-CAVCXBBR.mjs +2 -0
- package/dist/chunks/de-CAVCXBBR.mjs.map +1 -0
- package/dist/chunks/de-CkMnuozT.mjs +2 -0
- package/dist/chunks/de-CkMnuozT.mjs.map +1 -0
- package/dist/chunks/de-CtDnvnnm.mjs +2 -0
- package/dist/chunks/de-CtDnvnnm.mjs.map +1 -0
- package/dist/chunks/de-Cz26vtXW.mjs +2 -0
- package/dist/chunks/de-Cz26vtXW.mjs.map +1 -0
- package/dist/chunks/de-D0BPSP3j.mjs +2 -0
- package/dist/chunks/de-D0BPSP3j.mjs.map +1 -0
- package/dist/chunks/de-D74v0paw.mjs +2 -0
- package/dist/chunks/de-D74v0paw.mjs.map +1 -0
- package/dist/chunks/de-DKj55F9g.mjs +2 -0
- package/dist/chunks/de-DKj55F9g.mjs.map +1 -0
- package/dist/chunks/de-DYuRb98l.mjs +2 -0
- package/dist/chunks/de-DYuRb98l.mjs.map +1 -0
- package/dist/chunks/de-DaK0-sdo.mjs +2 -0
- package/dist/chunks/de-DaK0-sdo.mjs.map +1 -0
- package/dist/chunks/de-Dia08Wsq.mjs +2 -0
- package/dist/chunks/de-Dia08Wsq.mjs.map +1 -0
- package/dist/chunks/de-Dp_uj2Z3.mjs +2 -0
- package/dist/chunks/de-Dp_uj2Z3.mjs.map +1 -0
- package/dist/chunks/de-DwX1CDNO.mjs +2 -0
- package/dist/chunks/de-DwX1CDNO.mjs.map +1 -0
- package/dist/chunks/de-DyF2mRfw.mjs +2 -0
- package/dist/chunks/de-DyF2mRfw.mjs.map +1 -0
- package/dist/chunks/de-X3BLBlF8.mjs +2 -0
- package/dist/chunks/de-X3BLBlF8.mjs.map +1 -0
- package/dist/chunks/de-dPC3Qk7N.mjs +2 -0
- package/dist/chunks/de-dPC3Qk7N.mjs.map +1 -0
- package/dist/chunks/de-pLGt5S7j.mjs +2 -0
- package/dist/chunks/de-pLGt5S7j.mjs.map +1 -0
- package/dist/chunks/es--xozZF4T.mjs +2 -0
- package/dist/chunks/es--xozZF4T.mjs.map +1 -0
- package/dist/chunks/es-2BjtTusm.mjs +2 -0
- package/dist/chunks/es-2BjtTusm.mjs.map +1 -0
- package/dist/chunks/es-B2rEK7_f.mjs +2 -0
- package/dist/chunks/es-B2rEK7_f.mjs.map +1 -0
- package/dist/chunks/es-B9esmUm1.mjs +2 -0
- package/dist/chunks/es-B9esmUm1.mjs.map +1 -0
- package/dist/chunks/es-BJxkHalP.mjs +2 -0
- package/dist/chunks/es-BJxkHalP.mjs.map +1 -0
- package/dist/chunks/es-BMKsnh3y.mjs +2 -0
- package/dist/chunks/es-BMKsnh3y.mjs.map +1 -0
- package/dist/chunks/es-BXFflrrU.mjs +2 -0
- package/dist/chunks/es-BXFflrrU.mjs.map +1 -0
- package/dist/chunks/es-BbX_lEEN.mjs +2 -0
- package/dist/chunks/es-BbX_lEEN.mjs.map +1 -0
- package/dist/chunks/es-BlHe_tc0.mjs +2 -0
- package/dist/chunks/es-BlHe_tc0.mjs.map +1 -0
- package/dist/chunks/es-Bu6nnEeT.mjs +2 -0
- package/dist/chunks/es-Bu6nnEeT.mjs.map +1 -0
- package/dist/chunks/es-Bx0CbUoY.mjs +2 -0
- package/dist/chunks/es-Bx0CbUoY.mjs.map +1 -0
- package/dist/chunks/es-CE9Tbsb7.mjs +2 -0
- package/dist/chunks/es-CE9Tbsb7.mjs.map +1 -0
- package/dist/chunks/es-COSomns3.mjs +2 -0
- package/dist/chunks/es-COSomns3.mjs.map +1 -0
- package/dist/chunks/es-C_7qthHu.mjs +2 -0
- package/dist/chunks/es-C_7qthHu.mjs.map +1 -0
- package/dist/chunks/es-CirfP3x1.mjs +2 -0
- package/dist/chunks/es-CirfP3x1.mjs.map +1 -0
- package/dist/chunks/es-CpF8eiPr.mjs +2 -0
- package/dist/chunks/es-CpF8eiPr.mjs.map +1 -0
- package/dist/chunks/es-D787y0ui.mjs +2 -0
- package/dist/chunks/es-D787y0ui.mjs.map +1 -0
- package/dist/chunks/es-D8iB5vwQ.mjs +2 -0
- package/dist/chunks/es-D8iB5vwQ.mjs.map +1 -0
- package/dist/chunks/es-DBb78XWu.mjs +2 -0
- package/dist/chunks/es-DBb78XWu.mjs.map +1 -0
- package/dist/chunks/es-DC6mYTD3.mjs +2 -0
- package/dist/chunks/es-DC6mYTD3.mjs.map +1 -0
- package/dist/chunks/es-Dh--mRZs.mjs +2 -0
- package/dist/chunks/es-Dh--mRZs.mjs.map +1 -0
- package/dist/chunks/es-DvPsYqFj.mjs +2 -0
- package/dist/chunks/es-DvPsYqFj.mjs.map +1 -0
- package/dist/chunks/es-DxXimuUa.mjs +2 -0
- package/dist/chunks/es-DxXimuUa.mjs.map +1 -0
- package/dist/chunks/es-mWJptxq3.mjs +2 -0
- package/dist/chunks/es-mWJptxq3.mjs.map +1 -0
- package/dist/chunks/es-qYV--o6U.mjs +2 -0
- package/dist/chunks/es-qYV--o6U.mjs.map +1 -0
- package/dist/chunks/fonts-CxtWyeNB.mjs +2 -0
- package/dist/chunks/fonts-CxtWyeNB.mjs.map +1 -0
- package/dist/chunks/fr--F426oao.mjs +2 -0
- package/dist/chunks/fr--F426oao.mjs.map +1 -0
- package/dist/chunks/fr-B0BPbbNB.mjs +2 -0
- package/dist/chunks/fr-B0BPbbNB.mjs.map +1 -0
- package/dist/chunks/fr-B4UQy0j-.mjs +2 -0
- package/dist/chunks/fr-B4UQy0j-.mjs.map +1 -0
- package/dist/chunks/fr-B4XLxkci.mjs +2 -0
- package/dist/chunks/fr-B4XLxkci.mjs.map +1 -0
- package/dist/chunks/fr-BC1Rfp9S.mjs +2 -0
- package/dist/chunks/fr-BC1Rfp9S.mjs.map +1 -0
- package/dist/chunks/fr-BRGGu0E2.mjs +2 -0
- package/dist/chunks/fr-BRGGu0E2.mjs.map +1 -0
- package/dist/chunks/fr-BoSz1pa9.mjs +2 -0
- package/dist/chunks/fr-BoSz1pa9.mjs.map +1 -0
- package/dist/chunks/fr-Bom3RFIN.mjs +2 -0
- package/dist/chunks/fr-Bom3RFIN.mjs.map +1 -0
- package/dist/chunks/fr-BtnwMUII.mjs +2 -0
- package/dist/chunks/fr-BtnwMUII.mjs.map +1 -0
- package/dist/chunks/fr-C6pglM3H.mjs +2 -0
- package/dist/chunks/fr-C6pglM3H.mjs.map +1 -0
- package/dist/chunks/fr-CDBpS6xE.mjs +2 -0
- package/dist/chunks/fr-CDBpS6xE.mjs.map +1 -0
- package/dist/chunks/fr-CN0ihkUg.mjs +2 -0
- package/dist/chunks/fr-CN0ihkUg.mjs.map +1 -0
- package/dist/chunks/fr-CNNBBeLM.mjs +2 -0
- package/dist/chunks/fr-CNNBBeLM.mjs.map +1 -0
- package/dist/chunks/fr-CVOY2y07.mjs +2 -0
- package/dist/chunks/fr-CVOY2y07.mjs.map +1 -0
- package/dist/chunks/fr-CZAbL_o0.mjs +2 -0
- package/dist/chunks/fr-CZAbL_o0.mjs.map +1 -0
- package/dist/chunks/fr-DJkPmQG_.mjs +2 -0
- package/dist/chunks/fr-DJkPmQG_.mjs.map +1 -0
- package/dist/chunks/fr-DkWdFDsR.mjs +2 -0
- package/dist/chunks/fr-DkWdFDsR.mjs.map +1 -0
- package/dist/chunks/fr-DnQHoPVo.mjs +2 -0
- package/dist/chunks/fr-DnQHoPVo.mjs.map +1 -0
- package/dist/chunks/fr-DsdueaiG.mjs +2 -0
- package/dist/chunks/fr-DsdueaiG.mjs.map +1 -0
- package/dist/chunks/fr-DxNdsa11.mjs +2 -0
- package/dist/chunks/fr-DxNdsa11.mjs.map +1 -0
- package/dist/chunks/fr-IO4_LYvE.mjs +2 -0
- package/dist/chunks/fr-IO4_LYvE.mjs.map +1 -0
- package/dist/chunks/fr-ZKDCEpww.mjs +2 -0
- package/dist/chunks/fr-ZKDCEpww.mjs.map +1 -0
- package/dist/chunks/fr-coufP_et.mjs +2 -0
- package/dist/chunks/fr-coufP_et.mjs.map +1 -0
- package/dist/chunks/fr-lYSOgOK7.mjs +2 -0
- package/dist/chunks/fr-lYSOgOK7.mjs.map +1 -0
- package/dist/chunks/fr-wobtRjcF.mjs +2 -0
- package/dist/chunks/fr-wobtRjcF.mjs.map +1 -0
- package/dist/chunks/full-BMvrL5dE.mjs +2 -0
- package/dist/chunks/full-BMvrL5dE.mjs.map +1 -0
- package/dist/chunks/hi-B0o90MFd.mjs +2 -0
- package/dist/chunks/hi-B0o90MFd.mjs.map +1 -0
- package/dist/chunks/hi-BFko34WG.mjs +2 -0
- package/dist/chunks/hi-BFko34WG.mjs.map +1 -0
- package/dist/chunks/hi-BVxSgaNT.mjs +2 -0
- package/dist/chunks/hi-BVxSgaNT.mjs.map +1 -0
- package/dist/chunks/hi-BirBQ5Ef.mjs +2 -0
- package/dist/chunks/hi-BirBQ5Ef.mjs.map +1 -0
- package/dist/chunks/hi-BnsbcSIX.mjs +2 -0
- package/dist/chunks/hi-BnsbcSIX.mjs.map +1 -0
- package/dist/chunks/hi-BoFuxLtG.mjs +2 -0
- package/dist/chunks/hi-BoFuxLtG.mjs.map +1 -0
- package/dist/chunks/hi-BptyTwAv.mjs +2 -0
- package/dist/chunks/hi-BptyTwAv.mjs.map +1 -0
- package/dist/chunks/hi-BulaYhi_.mjs +2 -0
- package/dist/chunks/hi-BulaYhi_.mjs.map +1 -0
- package/dist/chunks/hi-BzflHG6Y.mjs +2 -0
- package/dist/chunks/hi-BzflHG6Y.mjs.map +1 -0
- package/dist/chunks/hi-C7Hb-gQ_.mjs +2 -0
- package/dist/chunks/hi-C7Hb-gQ_.mjs.map +1 -0
- package/dist/chunks/hi-C_lY7kA9.mjs +2 -0
- package/dist/chunks/hi-C_lY7kA9.mjs.map +1 -0
- package/dist/chunks/hi-CkylXoIm.mjs +2 -0
- package/dist/chunks/hi-CkylXoIm.mjs.map +1 -0
- package/dist/chunks/hi-DGJTbrQi.mjs +2 -0
- package/dist/chunks/hi-DGJTbrQi.mjs.map +1 -0
- package/dist/chunks/hi-DGJgX0fG.mjs +2 -0
- package/dist/chunks/hi-DGJgX0fG.mjs.map +1 -0
- package/dist/chunks/hi-DKDYpjdr.mjs +2 -0
- package/dist/chunks/hi-DKDYpjdr.mjs.map +1 -0
- package/dist/chunks/hi-DfAX8S-T.mjs +2 -0
- package/dist/chunks/hi-DfAX8S-T.mjs.map +1 -0
- package/dist/chunks/hi-Dhq91ipt.mjs +2 -0
- package/dist/chunks/hi-Dhq91ipt.mjs.map +1 -0
- package/dist/chunks/hi-Dup389dM.mjs +2 -0
- package/dist/chunks/hi-Dup389dM.mjs.map +1 -0
- package/dist/chunks/hi-DzRFsYYN.mjs +2 -0
- package/dist/chunks/hi-DzRFsYYN.mjs.map +1 -0
- package/dist/chunks/hi-ObZRwITd.mjs +2 -0
- package/dist/chunks/hi-ObZRwITd.mjs.map +1 -0
- package/dist/chunks/hi-VvUzjfH_.mjs +2 -0
- package/dist/chunks/hi-VvUzjfH_.mjs.map +1 -0
- package/dist/chunks/hi-jWQDQkOX.mjs +2 -0
- package/dist/chunks/hi-jWQDQkOX.mjs.map +1 -0
- package/dist/chunks/hi-l3hIrp8J.mjs +2 -0
- package/dist/chunks/hi-l3hIrp8J.mjs.map +1 -0
- package/dist/chunks/hi-o8Gsu5Ly.mjs +2 -0
- package/dist/chunks/hi-o8Gsu5Ly.mjs.map +1 -0
- package/dist/chunks/hi-sxC2nk3h.mjs +2 -0
- package/dist/chunks/hi-sxC2nk3h.mjs.map +1 -0
- package/dist/chunks/minimal-pBhi4EJI.mjs +2 -0
- package/dist/chunks/minimal-pBhi4EJI.mjs.map +1 -0
- package/dist/chunks/pt--57Ug7ig.mjs +2 -0
- package/dist/chunks/pt--57Ug7ig.mjs.map +1 -0
- package/dist/chunks/pt-4j8Km9Db.mjs +2 -0
- package/dist/chunks/pt-4j8Km9Db.mjs.map +1 -0
- package/dist/chunks/pt-BTGFKCns.mjs +2 -0
- package/dist/chunks/pt-BTGFKCns.mjs.map +1 -0
- package/dist/chunks/pt-BU8Qfuoz.mjs +2 -0
- package/dist/chunks/pt-BU8Qfuoz.mjs.map +1 -0
- package/dist/chunks/pt-BYAOJxIB.mjs +2 -0
- package/dist/chunks/pt-BYAOJxIB.mjs.map +1 -0
- package/dist/chunks/pt-BjNWQm9A.mjs +2 -0
- package/dist/chunks/pt-BjNWQm9A.mjs.map +1 -0
- package/dist/chunks/pt-Bvnb_NpT.mjs +2 -0
- package/dist/chunks/pt-Bvnb_NpT.mjs.map +1 -0
- package/dist/chunks/pt-C2pkn7vo.mjs +2 -0
- package/dist/chunks/pt-C2pkn7vo.mjs.map +1 -0
- package/dist/chunks/pt-C8MhLnWx.mjs +2 -0
- package/dist/chunks/pt-C8MhLnWx.mjs.map +1 -0
- package/dist/chunks/pt-CJfYLSTe.mjs +2 -0
- package/dist/chunks/pt-CJfYLSTe.mjs.map +1 -0
- package/dist/chunks/pt-CdwVIYOK.mjs +2 -0
- package/dist/chunks/pt-CdwVIYOK.mjs.map +1 -0
- package/dist/chunks/pt-CwrVo90O.mjs +2 -0
- package/dist/chunks/pt-CwrVo90O.mjs.map +1 -0
- package/dist/chunks/pt-DD26CKCA.mjs +2 -0
- package/dist/chunks/pt-DD26CKCA.mjs.map +1 -0
- package/dist/chunks/pt-DLbf6uoo.mjs +2 -0
- package/dist/chunks/pt-DLbf6uoo.mjs.map +1 -0
- package/dist/chunks/pt-DNyNHwKh.mjs +2 -0
- package/dist/chunks/pt-DNyNHwKh.mjs.map +1 -0
- package/dist/chunks/pt-DVfMAcXb.mjs +2 -0
- package/dist/chunks/pt-DVfMAcXb.mjs.map +1 -0
- package/dist/chunks/pt-DWSFad3n.mjs +2 -0
- package/dist/chunks/pt-DWSFad3n.mjs.map +1 -0
- package/dist/chunks/pt-DZXY4i4G.mjs +2 -0
- package/dist/chunks/pt-DZXY4i4G.mjs.map +1 -0
- package/dist/chunks/pt-DfUpRhK1.mjs +2 -0
- package/dist/chunks/pt-DfUpRhK1.mjs.map +1 -0
- package/dist/chunks/pt-DlvNEDeW.mjs +2 -0
- package/dist/chunks/pt-DlvNEDeW.mjs.map +1 -0
- package/dist/chunks/pt-DzFyGwB4.mjs +2 -0
- package/dist/chunks/pt-DzFyGwB4.mjs.map +1 -0
- package/dist/chunks/pt-HhQcARW6.mjs +2 -0
- package/dist/chunks/pt-HhQcARW6.mjs.map +1 -0
- package/dist/chunks/pt-SjvTF40s.mjs +2 -0
- package/dist/chunks/pt-SjvTF40s.mjs.map +1 -0
- package/dist/chunks/pt-ihNE0VQJ.mjs +2 -0
- package/dist/chunks/pt-ihNE0VQJ.mjs.map +1 -0
- package/dist/chunks/pt-zfCjhIgy.mjs +2 -0
- package/dist/chunks/pt-zfCjhIgy.mjs.map +1 -0
- package/dist/chunks/ru-0AHodbWv.mjs +2 -0
- package/dist/chunks/ru-0AHodbWv.mjs.map +1 -0
- package/dist/chunks/ru-2MDGmLw0.mjs +2 -0
- package/dist/chunks/ru-2MDGmLw0.mjs.map +1 -0
- package/dist/chunks/ru-3VfYKfTm.mjs +2 -0
- package/dist/chunks/ru-3VfYKfTm.mjs.map +1 -0
- package/dist/chunks/ru-B-gRJ6nQ.mjs +2 -0
- package/dist/chunks/ru-B-gRJ6nQ.mjs.map +1 -0
- package/dist/chunks/ru-B6ITUB-Y.mjs +2 -0
- package/dist/chunks/ru-B6ITUB-Y.mjs.map +1 -0
- package/dist/chunks/ru-BKDWkabk.mjs +2 -0
- package/dist/chunks/ru-BKDWkabk.mjs.map +1 -0
- package/dist/chunks/ru-BMxJsSe3.mjs +2 -0
- package/dist/chunks/ru-BMxJsSe3.mjs.map +1 -0
- package/dist/chunks/ru-Bep1iHQL.mjs +2 -0
- package/dist/chunks/ru-Bep1iHQL.mjs.map +1 -0
- package/dist/chunks/ru-Blj0nqoL.mjs +2 -0
- package/dist/chunks/ru-Blj0nqoL.mjs.map +1 -0
- package/dist/chunks/ru-BqnHkmii.mjs +2 -0
- package/dist/chunks/ru-BqnHkmii.mjs.map +1 -0
- package/dist/chunks/ru-C-4AaPUK.mjs +2 -0
- package/dist/chunks/ru-C-4AaPUK.mjs.map +1 -0
- package/dist/chunks/ru-C9Nv7JJI.mjs +2 -0
- package/dist/chunks/ru-C9Nv7JJI.mjs.map +1 -0
- package/dist/chunks/ru-CJFtr1Ks.mjs +2 -0
- package/dist/chunks/ru-CJFtr1Ks.mjs.map +1 -0
- package/dist/chunks/ru-CN63yWk_.mjs +2 -0
- package/dist/chunks/ru-CN63yWk_.mjs.map +1 -0
- package/dist/chunks/ru-CcFX97-2.mjs +2 -0
- package/dist/chunks/ru-CcFX97-2.mjs.map +1 -0
- package/dist/chunks/ru-D8PhWFSp.mjs +2 -0
- package/dist/chunks/ru-D8PhWFSp.mjs.map +1 -0
- package/dist/chunks/ru-DYAncidS.mjs +2 -0
- package/dist/chunks/ru-DYAncidS.mjs.map +1 -0
- package/dist/chunks/ru-D_zXo-FA.mjs +2 -0
- package/dist/chunks/ru-D_zXo-FA.mjs.map +1 -0
- package/dist/chunks/ru-DhSPV6m0.mjs +2 -0
- package/dist/chunks/ru-DhSPV6m0.mjs.map +1 -0
- package/dist/chunks/ru-LNbpjKCw.mjs +2 -0
- package/dist/chunks/ru-LNbpjKCw.mjs.map +1 -0
- package/dist/chunks/ru-LXi1ONW4.mjs +2 -0
- package/dist/chunks/ru-LXi1ONW4.mjs.map +1 -0
- package/dist/chunks/ru-db7wsWkx.mjs +2 -0
- package/dist/chunks/ru-db7wsWkx.mjs.map +1 -0
- package/dist/chunks/ru-nZ4BjiD0.mjs +2 -0
- package/dist/chunks/ru-nZ4BjiD0.mjs.map +1 -0
- package/dist/chunks/ru-v9zumXd2.mjs +2 -0
- package/dist/chunks/ru-v9zumXd2.mjs.map +1 -0
- package/dist/chunks/ru-wK2ytv3A.mjs +2 -0
- package/dist/chunks/ru-wK2ytv3A.mjs.map +1 -0
- package/dist/chunks/src-CNK6vpUU.mjs +2 -0
- package/dist/chunks/src-CNK6vpUU.mjs.map +1 -0
- package/dist/chunks/zh-9AcCSFm0.mjs +2 -0
- package/dist/chunks/zh-9AcCSFm0.mjs.map +1 -0
- package/dist/chunks/zh-B3bJCfdB.mjs +2 -0
- package/dist/chunks/zh-B3bJCfdB.mjs.map +1 -0
- package/dist/chunks/zh-B46Dt1h7.mjs +2 -0
- package/dist/chunks/zh-B46Dt1h7.mjs.map +1 -0
- package/dist/chunks/zh-BRy2B6Og.mjs +2 -0
- package/dist/chunks/zh-BRy2B6Og.mjs.map +1 -0
- package/dist/chunks/zh-BfYi8wB2.mjs +2 -0
- package/dist/chunks/zh-BfYi8wB2.mjs.map +1 -0
- package/dist/chunks/zh-C0I3L6NA.mjs +2 -0
- package/dist/chunks/zh-C0I3L6NA.mjs.map +1 -0
- package/dist/chunks/zh-C33e4gfg.mjs +2 -0
- package/dist/chunks/zh-C33e4gfg.mjs.map +1 -0
- package/dist/chunks/zh-C9sNwnC1.mjs +2 -0
- package/dist/chunks/zh-C9sNwnC1.mjs.map +1 -0
- package/dist/chunks/zh-CACr0qSo.mjs +2 -0
- package/dist/chunks/zh-CACr0qSo.mjs.map +1 -0
- package/dist/chunks/zh-CU0hd8zq.mjs +2 -0
- package/dist/chunks/zh-CU0hd8zq.mjs.map +1 -0
- package/dist/chunks/zh-CX2zUoWR.mjs +2 -0
- package/dist/chunks/zh-CX2zUoWR.mjs.map +1 -0
- package/dist/chunks/zh-CblZ-34H.mjs +2 -0
- package/dist/chunks/zh-CblZ-34H.mjs.map +1 -0
- package/dist/chunks/zh-CicpU0g8.mjs +2 -0
- package/dist/chunks/zh-CicpU0g8.mjs.map +1 -0
- package/dist/chunks/zh-Cr3KdEZV.mjs +2 -0
- package/dist/chunks/zh-Cr3KdEZV.mjs.map +1 -0
- package/dist/chunks/zh-D24dsCiw.mjs +2 -0
- package/dist/chunks/zh-D24dsCiw.mjs.map +1 -0
- package/dist/chunks/zh-DQtLxQ3s.mjs +2 -0
- package/dist/chunks/zh-DQtLxQ3s.mjs.map +1 -0
- package/dist/chunks/zh-DR1OF5vm.mjs +2 -0
- package/dist/chunks/zh-DR1OF5vm.mjs.map +1 -0
- package/dist/chunks/zh-DS82x1KL.mjs +2 -0
- package/dist/chunks/zh-DS82x1KL.mjs.map +1 -0
- package/dist/chunks/zh-DdJA-AEY.mjs +2 -0
- package/dist/chunks/zh-DdJA-AEY.mjs.map +1 -0
- package/dist/chunks/zh-DpVlDZ9n.mjs +2 -0
- package/dist/chunks/zh-DpVlDZ9n.mjs.map +1 -0
- package/dist/chunks/zh-OWVKcbVR.mjs +2 -0
- package/dist/chunks/zh-OWVKcbVR.mjs.map +1 -0
- package/dist/chunks/zh-d19V68ib.mjs +2 -0
- package/dist/chunks/zh-d19V68ib.mjs.map +1 -0
- package/dist/chunks/zh-fSMt1FnB.mjs +2 -0
- package/dist/chunks/zh-fSMt1FnB.mjs.map +1 -0
- package/dist/chunks/zh-mLlk9Wki.mjs +2 -0
- package/dist/chunks/zh-mLlk9Wki.mjs.map +1 -0
- package/dist/chunks/zh-nnMt8E6m.mjs +2 -0
- package/dist/chunks/zh-nnMt8E6m.mjs.map +1 -0
- package/dist/editor/ContentSerializer.d.ts +10 -0
- package/dist/editor/ContentSerializer.d.ts.map +1 -1
- package/dist/editor/EditorInitializer.d.ts.map +1 -1
- package/dist/editor/NotectlEditor.d.ts +25 -2
- package/dist/editor/NotectlEditor.d.ts.map +1 -1
- package/dist/editor/styles/base.d.ts +1 -1
- package/dist/editor/styles/base.d.ts.map +1 -1
- package/dist/editor/styles/toolbar.d.ts +1 -1
- package/dist/editor/styles/toolbar.d.ts.map +1 -1
- package/dist/fonts.mjs +1 -1
- package/dist/full.d.ts +2 -1
- package/dist/full.d.ts.map +1 -1
- package/dist/full.mjs +1 -1
- package/dist/html.mjs +1 -1
- package/dist/i18n/LocaleService.d.ts +1 -1
- package/dist/i18n/LocaleService.d.ts.map +1 -1
- package/dist/input/HTMLParser.d.ts.map +1 -1
- package/dist/model/HTMLUtils.d.ts +11 -0
- package/dist/model/HTMLUtils.d.ts.map +1 -1
- package/dist/model/TypedKeys.d.ts +23 -0
- package/dist/model/TypedKeys.d.ts.map +1 -0
- 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 +2 -12
- package/dist/plugins/Plugin.d.ts.map +1 -1
- package/dist/plugins/alignment.mjs +1 -1
- package/dist/plugins/bidi-isolation/BidiIsolationLocale.d.ts +12 -0
- package/dist/plugins/bidi-isolation/BidiIsolationLocale.d.ts.map +1 -0
- package/dist/plugins/bidi-isolation/BidiIsolationPlugin.d.ts +34 -0
- package/dist/plugins/bidi-isolation/BidiIsolationPlugin.d.ts.map +1 -0
- package/dist/plugins/bidi-isolation/index.d.ts +4 -0
- package/dist/plugins/bidi-isolation/index.d.ts.map +1 -0
- package/dist/plugins/bidi-isolation/locales/ar.d.ts +4 -0
- package/dist/plugins/bidi-isolation/locales/ar.d.ts.map +1 -0
- package/dist/plugins/bidi-isolation/locales/de.d.ts +4 -0
- package/dist/plugins/bidi-isolation/locales/de.d.ts.map +1 -0
- package/dist/plugins/bidi-isolation/locales/es.d.ts +4 -0
- package/dist/plugins/bidi-isolation/locales/es.d.ts.map +1 -0
- package/dist/plugins/bidi-isolation/locales/fr.d.ts +4 -0
- package/dist/plugins/bidi-isolation/locales/fr.d.ts.map +1 -0
- package/dist/plugins/bidi-isolation/locales/hi.d.ts +4 -0
- package/dist/plugins/bidi-isolation/locales/hi.d.ts.map +1 -0
- package/dist/plugins/bidi-isolation/locales/pt.d.ts +4 -0
- package/dist/plugins/bidi-isolation/locales/pt.d.ts.map +1 -0
- package/dist/plugins/bidi-isolation/locales/ru.d.ts +4 -0
- package/dist/plugins/bidi-isolation/locales/ru.d.ts.map +1 -0
- package/dist/plugins/bidi-isolation/locales/zh.d.ts +4 -0
- package/dist/plugins/bidi-isolation/locales/zh.d.ts.map +1 -0
- package/dist/plugins/bidi-isolation.mjs +1 -0
- package/dist/plugins/blockquote.mjs +1 -1
- package/dist/plugins/caret-navigation.mjs +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/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/LinkLocale.d.ts +1 -0
- package/dist/plugins/link/LinkLocale.d.ts.map +1 -1
- package/dist/plugins/link/LinkPlugin.d.ts.map +1 -1
- package/dist/plugins/link/locales/ar.d.ts.map +1 -1
- package/dist/plugins/link/locales/de.d.ts.map +1 -1
- package/dist/plugins/link/locales/es.d.ts.map +1 -1
- package/dist/plugins/link/locales/fr.d.ts.map +1 -1
- package/dist/plugins/link/locales/hi.d.ts.map +1 -1
- package/dist/plugins/link/locales/pt.d.ts.map +1 -1
- package/dist/plugins/link/locales/ru.d.ts.map +1 -1
- package/dist/plugins/link/locales/zh.d.ts.map +1 -1
- package/dist/plugins/link.mjs +1 -1
- package/dist/plugins/list.mjs +1 -1
- package/dist/plugins/print.mjs +1 -1
- package/dist/plugins/shared.mjs +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/DirectionIcons.d.ts +3 -0
- package/dist/plugins/text-direction/DirectionIcons.d.ts.map +1 -0
- package/dist/plugins/text-direction/TextDirectionLocale.d.ts +0 -6
- package/dist/plugins/text-direction/TextDirectionLocale.d.ts.map +1 -1
- package/dist/plugins/text-direction/TextDirectionPlugin.d.ts +3 -30
- package/dist/plugins/text-direction/TextDirectionPlugin.d.ts.map +1 -1
- package/dist/plugins/text-direction/TextDirectionService.d.ts +9 -0
- package/dist/plugins/text-direction/TextDirectionService.d.ts.map +1 -0
- package/dist/plugins/text-direction/index.d.ts +3 -1
- package/dist/plugins/text-direction/index.d.ts.map +1 -1
- package/dist/plugins/text-direction/locales/ar.d.ts.map +1 -1
- package/dist/plugins/text-direction/locales/de.d.ts.map +1 -1
- package/dist/plugins/text-direction/locales/es.d.ts.map +1 -1
- package/dist/plugins/text-direction/locales/fr.d.ts.map +1 -1
- package/dist/plugins/text-direction/locales/hi.d.ts.map +1 -1
- package/dist/plugins/text-direction/locales/pt.d.ts.map +1 -1
- package/dist/plugins/text-direction/locales/ru.d.ts.map +1 -1
- package/dist/plugins/text-direction/locales/zh.d.ts.map +1 -1
- package/dist/plugins/text-direction-auto/TextDirectionAutoMiddleware.d.ts +5 -0
- package/dist/plugins/text-direction-auto/TextDirectionAutoMiddleware.d.ts.map +1 -0
- package/dist/plugins/text-direction-auto/TextDirectionAutoPlugin.d.ts +28 -0
- package/dist/plugins/text-direction-auto/TextDirectionAutoPlugin.d.ts.map +1 -0
- package/dist/plugins/text-direction-auto/index.d.ts +2 -0
- package/dist/plugins/text-direction-auto/index.d.ts.map +1 -0
- package/dist/plugins/text-direction-auto.mjs +1 -0
- 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/presets/FullPreset.d.ts +3 -1
- package/dist/presets/FullPreset.d.ts.map +1 -1
- package/dist/presets/PresetTypes.d.ts +5 -1
- package/dist/presets/PresetTypes.d.ts.map +1 -1
- package/dist/presets/full.mjs +1 -1
- package/dist/presets/minimal.mjs +1 -1
- package/dist/presets.mjs +1 -1
- package/dist/serialization/BlockIdHTML.d.ts +21 -0
- package/dist/serialization/BlockIdHTML.d.ts.map +1 -0
- package/dist/serialization/DocumentParser.d.ts.map +1 -1
- package/dist/serialization/DocumentSerializer.d.ts.map +1 -1
- package/dist/test/TestUtils.d.ts +17 -0
- package/dist/test/TestUtils.d.ts.map +1 -1
- package/dist/view/EditorView.d.ts +7 -0
- package/dist/view/EditorView.d.ts.map +1 -1
- package/package.json +18 -8
- package/dist/chunks/AlignmentPlugin-D1wmhWE6.mjs +0 -2
- package/dist/chunks/AlignmentPlugin-D1wmhWE6.mjs.map +0 -1
- package/dist/chunks/BlockquotePlugin-Bwny0CP6.mjs +0 -2
- package/dist/chunks/BlockquotePlugin-Bwny0CP6.mjs.map +0 -1
- package/dist/chunks/CaretNavigationPlugin-C-rCDbu0.mjs +0 -2
- package/dist/chunks/CaretNavigationPlugin-C-rCDbu0.mjs.map +0 -1
- package/dist/chunks/CodeBlockPlugin-CNC290_q.mjs +0 -2
- package/dist/chunks/CodeBlockPlugin-CNC290_q.mjs.map +0 -1
- package/dist/chunks/ColorGrid-BUSIBKZH.mjs +0 -2
- package/dist/chunks/ColorGrid-BUSIBKZH.mjs.map +0 -1
- package/dist/chunks/ColorPickerPopup-CvE90IAu.mjs +0 -2
- package/dist/chunks/ColorPickerPopup-CvE90IAu.mjs.map +0 -1
- package/dist/chunks/DocumentParser-Cq_bFYAS.mjs +0 -2
- package/dist/chunks/DocumentParser-Cq_bFYAS.mjs.map +0 -1
- package/dist/chunks/FontPlugin-z0QF1M5q.mjs +0 -2
- package/dist/chunks/FontPlugin-z0QF1M5q.mjs.map +0 -1
- package/dist/chunks/FontSizePlugin-DYKvhu9w.mjs +0 -2
- package/dist/chunks/FontSizePlugin-DYKvhu9w.mjs.map +0 -1
- package/dist/chunks/GapCursorPlugin-uxw7W7vj.mjs +0 -2
- package/dist/chunks/GapCursorPlugin-uxw7W7vj.mjs.map +0 -1
- package/dist/chunks/HTMLUtils-B8xj8Z1x.mjs +0 -2
- package/dist/chunks/HTMLUtils-B8xj8Z1x.mjs.map +0 -1
- package/dist/chunks/HardBreakPlugin-BpXipf8h.mjs +0 -2
- package/dist/chunks/HardBreakPlugin-BpXipf8h.mjs.map +0 -1
- package/dist/chunks/HeadingPlugin-CUN746aD.mjs +0 -2
- package/dist/chunks/HeadingPlugin-CUN746aD.mjs.map +0 -1
- package/dist/chunks/HighlightPlugin-bbAi6W6k.mjs +0 -2
- package/dist/chunks/HighlightPlugin-bbAi6W6k.mjs.map +0 -1
- package/dist/chunks/HorizontalRulePlugin-D8w6paMa.mjs +0 -2
- package/dist/chunks/HorizontalRulePlugin-D8w6paMa.mjs.map +0 -1
- package/dist/chunks/ImagePlugin-De7lWcZ7.mjs +0 -2
- package/dist/chunks/ImagePlugin-De7lWcZ7.mjs.map +0 -1
- package/dist/chunks/InlineCodePlugin-DKQIYhTb.mjs +0 -2
- package/dist/chunks/InlineCodePlugin-DKQIYhTb.mjs.map +0 -1
- package/dist/chunks/LinkPlugin-BD7mcRHS.mjs +0 -2
- package/dist/chunks/LinkPlugin-BD7mcRHS.mjs.map +0 -1
- package/dist/chunks/ListPlugin-DbixSqMH.mjs +0 -2
- package/dist/chunks/ListPlugin-DbixSqMH.mjs.map +0 -1
- package/dist/chunks/Plugin-BUNGKupW.mjs +0 -2
- package/dist/chunks/Plugin-BUNGKupW.mjs.map +0 -1
- package/dist/chunks/PluginHelpers-D1QF-YaF.mjs +0 -2
- package/dist/chunks/PluginHelpers-D1QF-YaF.mjs.map +0 -1
- package/dist/chunks/PopupKeyboardPatterns-DhcUe29m.mjs +0 -2
- package/dist/chunks/PopupKeyboardPatterns-DhcUe29m.mjs.map +0 -1
- package/dist/chunks/PopupManager-DaTySyZl.mjs +0 -2
- package/dist/chunks/PopupManager-DaTySyZl.mjs.map +0 -1
- package/dist/chunks/PrintPlugin-DVRybXSN.mjs +0 -2
- package/dist/chunks/PrintPlugin-DVRybXSN.mjs.map +0 -1
- package/dist/chunks/PrintTypes-DTV3-mSe.mjs +0 -2
- package/dist/chunks/PrintTypes-DTV3-mSe.mjs.map +0 -1
- package/dist/chunks/SmartPastePlugin-i96yAnXZ.mjs +0 -2
- package/dist/chunks/SmartPastePlugin-i96yAnXZ.mjs.map +0 -1
- package/dist/chunks/StrikethroughPlugin-RGZATXUZ.mjs +0 -2
- package/dist/chunks/StrikethroughPlugin-RGZATXUZ.mjs.map +0 -1
- package/dist/chunks/SuperSubPlugin-BOWFP1Kr.mjs +0 -2
- package/dist/chunks/SuperSubPlugin-BOWFP1Kr.mjs.map +0 -1
- package/dist/chunks/TablePlugin-DZTMBkyu.mjs +0 -2
- package/dist/chunks/TablePlugin-DZTMBkyu.mjs.map +0 -1
- package/dist/chunks/TextColorPlugin-CB3RpTSQ.mjs +0 -2
- package/dist/chunks/TextColorPlugin-CB3RpTSQ.mjs.map +0 -1
- package/dist/chunks/TextDirectionCorePlugin-tNecTcrX.mjs +0 -2
- package/dist/chunks/TextDirectionCorePlugin-tNecTcrX.mjs.map +0 -1
- package/dist/chunks/TextDirectionLocale-_AUfZu9j.mjs +0 -2
- package/dist/chunks/TextDirectionLocale-_AUfZu9j.mjs.map +0 -1
- package/dist/chunks/TextFormattingPlugin-CZ6D-luc.mjs +0 -2
- package/dist/chunks/TextFormattingPlugin-CZ6D-luc.mjs.map +0 -1
- package/dist/chunks/ToolbarPlugin-2K96zYut.mjs +0 -2
- package/dist/chunks/ToolbarPlugin-2K96zYut.mjs.map +0 -1
- package/dist/chunks/XmlDetector-DlRdJOIX.mjs +0 -2
- package/dist/chunks/XmlDetector-DlRdJOIX.mjs.map +0 -1
- package/dist/chunks/XmlPatterns-Dwmn4nrg.mjs +0 -2
- package/dist/chunks/XmlPatterns-Dwmn4nrg.mjs.map +0 -1
- package/dist/chunks/XmlSupport-DG8PEZhO.mjs +0 -2
- package/dist/chunks/XmlSupport-DG8PEZhO.mjs.map +0 -1
- package/dist/chunks/ar--dzNQRg4.mjs +0 -2
- package/dist/chunks/ar--dzNQRg4.mjs.map +0 -1
- package/dist/chunks/ar-13q9ejck.mjs +0 -2
- package/dist/chunks/ar-13q9ejck.mjs.map +0 -1
- package/dist/chunks/ar-7XO2HmsM.mjs +0 -2
- package/dist/chunks/ar-7XO2HmsM.mjs.map +0 -1
- package/dist/chunks/ar-B-n_gMXb.mjs +0 -2
- package/dist/chunks/ar-B-n_gMXb.mjs.map +0 -1
- package/dist/chunks/ar-BXeE6tKj.mjs +0 -2
- package/dist/chunks/ar-BXeE6tKj.mjs.map +0 -1
- package/dist/chunks/ar-Bs3sx3Oz.mjs +0 -2
- package/dist/chunks/ar-Bs3sx3Oz.mjs.map +0 -1
- package/dist/chunks/ar-ByNQ-o3t.mjs +0 -2
- package/dist/chunks/ar-ByNQ-o3t.mjs.map +0 -1
- package/dist/chunks/ar-C9AnO0uV.mjs +0 -2
- package/dist/chunks/ar-C9AnO0uV.mjs.map +0 -1
- package/dist/chunks/ar-CL-NsFoh.mjs +0 -2
- package/dist/chunks/ar-CL-NsFoh.mjs.map +0 -1
- package/dist/chunks/ar-COx4cFpT.mjs +0 -2
- package/dist/chunks/ar-COx4cFpT.mjs.map +0 -1
- package/dist/chunks/ar-CYZYoqcc.mjs +0 -2
- package/dist/chunks/ar-CYZYoqcc.mjs.map +0 -1
- package/dist/chunks/ar-ChOxTdPI.mjs +0 -2
- package/dist/chunks/ar-ChOxTdPI.mjs.map +0 -1
- package/dist/chunks/ar-Cj6amEs9.mjs +0 -2
- package/dist/chunks/ar-Cj6amEs9.mjs.map +0 -1
- package/dist/chunks/ar-CsH2S6Vd.mjs +0 -2
- package/dist/chunks/ar-CsH2S6Vd.mjs.map +0 -1
- package/dist/chunks/ar-D2y_YvMP.mjs +0 -2
- package/dist/chunks/ar-D2y_YvMP.mjs.map +0 -1
- package/dist/chunks/ar-D57VZrg2.mjs +0 -2
- package/dist/chunks/ar-D57VZrg2.mjs.map +0 -1
- package/dist/chunks/ar-DH06YQkP.mjs +0 -2
- package/dist/chunks/ar-DH06YQkP.mjs.map +0 -1
- package/dist/chunks/ar-DJ6K9HnU.mjs +0 -2
- package/dist/chunks/ar-DJ6K9HnU.mjs.map +0 -1
- package/dist/chunks/ar-DMNNIim-.mjs +0 -2
- package/dist/chunks/ar-DMNNIim-.mjs.map +0 -1
- package/dist/chunks/ar-DW0Inc7r.mjs +0 -2
- package/dist/chunks/ar-DW0Inc7r.mjs.map +0 -1
- package/dist/chunks/ar-SwJ-tyIu.mjs +0 -2
- package/dist/chunks/ar-SwJ-tyIu.mjs.map +0 -1
- package/dist/chunks/ar-Vfk7XFaz.mjs +0 -2
- package/dist/chunks/ar-Vfk7XFaz.mjs.map +0 -1
- package/dist/chunks/ar-izXCtb2I.mjs +0 -2
- package/dist/chunks/ar-izXCtb2I.mjs.map +0 -1
- package/dist/chunks/ar-jsznaXQ0.mjs +0 -2
- package/dist/chunks/ar-jsznaXQ0.mjs.map +0 -1
- package/dist/chunks/color-picker-ChYYdC-r.mjs +0 -2
- package/dist/chunks/color-picker-ChYYdC-r.mjs.map +0 -1
- package/dist/chunks/de-3PJCshB7.mjs +0 -2
- package/dist/chunks/de-3PJCshB7.mjs.map +0 -1
- package/dist/chunks/de-B92lssMU.mjs +0 -2
- package/dist/chunks/de-B92lssMU.mjs.map +0 -1
- package/dist/chunks/de-BJ8Lo9rY.mjs +0 -2
- package/dist/chunks/de-BJ8Lo9rY.mjs.map +0 -1
- package/dist/chunks/de-BjNoeX05.mjs +0 -2
- package/dist/chunks/de-BjNoeX05.mjs.map +0 -1
- package/dist/chunks/de-Bktm7FKk.mjs +0 -2
- package/dist/chunks/de-Bktm7FKk.mjs.map +0 -1
- package/dist/chunks/de-BqHw2LVH.mjs +0 -2
- package/dist/chunks/de-BqHw2LVH.mjs.map +0 -1
- package/dist/chunks/de-BzjqF_j0.mjs +0 -2
- package/dist/chunks/de-BzjqF_j0.mjs.map +0 -1
- package/dist/chunks/de-C7Grl0t1.mjs +0 -2
- package/dist/chunks/de-C7Grl0t1.mjs.map +0 -1
- package/dist/chunks/de-CWsXH4_J.mjs +0 -2
- package/dist/chunks/de-CWsXH4_J.mjs.map +0 -1
- package/dist/chunks/de-CWwHCIzX.mjs +0 -2
- package/dist/chunks/de-CWwHCIzX.mjs.map +0 -1
- package/dist/chunks/de-ChHR-g0q.mjs +0 -2
- package/dist/chunks/de-ChHR-g0q.mjs.map +0 -1
- package/dist/chunks/de-CqJFzINs.mjs +0 -2
- package/dist/chunks/de-CqJFzINs.mjs.map +0 -1
- package/dist/chunks/de-DAPQek-i.mjs +0 -2
- package/dist/chunks/de-DAPQek-i.mjs.map +0 -1
- package/dist/chunks/de-DPzOP2Ge.mjs +0 -2
- package/dist/chunks/de-DPzOP2Ge.mjs.map +0 -1
- package/dist/chunks/de-DhenqH4M.mjs +0 -2
- package/dist/chunks/de-DhenqH4M.mjs.map +0 -1
- package/dist/chunks/de-Ds6tfD71.mjs +0 -2
- package/dist/chunks/de-Ds6tfD71.mjs.map +0 -1
- package/dist/chunks/de-DxyfCVlM.mjs +0 -2
- package/dist/chunks/de-DxyfCVlM.mjs.map +0 -1
- package/dist/chunks/de-RSzW4zsb.mjs +0 -2
- package/dist/chunks/de-RSzW4zsb.mjs.map +0 -1
- package/dist/chunks/de-YiJZ87p6.mjs +0 -2
- package/dist/chunks/de-YiJZ87p6.mjs.map +0 -1
- package/dist/chunks/de-e7G64WBM.mjs +0 -2
- package/dist/chunks/de-e7G64WBM.mjs.map +0 -1
- package/dist/chunks/de-oeen0lTL.mjs +0 -2
- package/dist/chunks/de-oeen0lTL.mjs.map +0 -1
- package/dist/chunks/de-p1zboXJW.mjs +0 -2
- package/dist/chunks/de-p1zboXJW.mjs.map +0 -1
- package/dist/chunks/de-q2xHBWVU.mjs +0 -2
- package/dist/chunks/de-q2xHBWVU.mjs.map +0 -1
- package/dist/chunks/de-zjzkzZs9.mjs +0 -2
- package/dist/chunks/de-zjzkzZs9.mjs.map +0 -1
- package/dist/chunks/es-2U-tuiWo.mjs +0 -2
- package/dist/chunks/es-2U-tuiWo.mjs.map +0 -1
- package/dist/chunks/es-8kEYE5eN.mjs +0 -2
- package/dist/chunks/es-8kEYE5eN.mjs.map +0 -1
- package/dist/chunks/es-B2B0W46I.mjs +0 -2
- package/dist/chunks/es-B2B0W46I.mjs.map +0 -1
- package/dist/chunks/es-B8Ne6vhS.mjs +0 -2
- package/dist/chunks/es-B8Ne6vhS.mjs.map +0 -1
- package/dist/chunks/es-BBaS8xrI.mjs +0 -2
- package/dist/chunks/es-BBaS8xrI.mjs.map +0 -1
- package/dist/chunks/es-BJibD3UW.mjs +0 -2
- package/dist/chunks/es-BJibD3UW.mjs.map +0 -1
- package/dist/chunks/es-BUIOf37N.mjs +0 -2
- package/dist/chunks/es-BUIOf37N.mjs.map +0 -1
- package/dist/chunks/es-BcEc0JEI.mjs +0 -2
- package/dist/chunks/es-BcEc0JEI.mjs.map +0 -1
- package/dist/chunks/es-BjomAlG3.mjs +0 -2
- package/dist/chunks/es-BjomAlG3.mjs.map +0 -1
- package/dist/chunks/es-BpgE28ol.mjs +0 -2
- package/dist/chunks/es-BpgE28ol.mjs.map +0 -1
- package/dist/chunks/es-Bq_XkuDG.mjs +0 -2
- package/dist/chunks/es-Bq_XkuDG.mjs.map +0 -1
- package/dist/chunks/es-BtTQw2t5.mjs +0 -2
- package/dist/chunks/es-BtTQw2t5.mjs.map +0 -1
- package/dist/chunks/es-BwmzRdDZ.mjs +0 -2
- package/dist/chunks/es-BwmzRdDZ.mjs.map +0 -1
- package/dist/chunks/es-Bwy7v223.mjs +0 -2
- package/dist/chunks/es-Bwy7v223.mjs.map +0 -1
- package/dist/chunks/es-C0Jm_n57.mjs +0 -2
- package/dist/chunks/es-C0Jm_n57.mjs.map +0 -1
- package/dist/chunks/es-C49UmQIT.mjs +0 -2
- package/dist/chunks/es-C49UmQIT.mjs.map +0 -1
- package/dist/chunks/es-CCAT_-nb.mjs +0 -2
- package/dist/chunks/es-CCAT_-nb.mjs.map +0 -1
- package/dist/chunks/es-CGGqdLIQ.mjs +0 -2
- package/dist/chunks/es-CGGqdLIQ.mjs.map +0 -1
- package/dist/chunks/es-CYKm6CQM.mjs +0 -2
- package/dist/chunks/es-CYKm6CQM.mjs.map +0 -1
- package/dist/chunks/es-C_L1Wdfi.mjs +0 -2
- package/dist/chunks/es-C_L1Wdfi.mjs.map +0 -1
- package/dist/chunks/es-DEo4yDI6.mjs +0 -2
- package/dist/chunks/es-DEo4yDI6.mjs.map +0 -1
- package/dist/chunks/es-D_6MYvFK.mjs +0 -2
- package/dist/chunks/es-D_6MYvFK.mjs.map +0 -1
- package/dist/chunks/es-DcYIJR0T.mjs +0 -2
- package/dist/chunks/es-DcYIJR0T.mjs.map +0 -1
- package/dist/chunks/es-y2SZmX3P.mjs +0 -2
- package/dist/chunks/es-y2SZmX3P.mjs.map +0 -1
- package/dist/chunks/fonts-CG_dDwvT.mjs +0 -2
- package/dist/chunks/fonts-CG_dDwvT.mjs.map +0 -1
- package/dist/chunks/fr-Ame1k629.mjs +0 -2
- package/dist/chunks/fr-Ame1k629.mjs.map +0 -1
- package/dist/chunks/fr-BCN045Ph.mjs +0 -2
- package/dist/chunks/fr-BCN045Ph.mjs.map +0 -1
- package/dist/chunks/fr-BQaiAAa6.mjs +0 -2
- package/dist/chunks/fr-BQaiAAa6.mjs.map +0 -1
- package/dist/chunks/fr-BR61Uevp.mjs +0 -2
- package/dist/chunks/fr-BR61Uevp.mjs.map +0 -1
- package/dist/chunks/fr-Bb-xVkAd.mjs +0 -2
- package/dist/chunks/fr-Bb-xVkAd.mjs.map +0 -1
- package/dist/chunks/fr-BhM3Ykql.mjs +0 -2
- package/dist/chunks/fr-BhM3Ykql.mjs.map +0 -1
- package/dist/chunks/fr-BqQRlsfW.mjs +0 -2
- package/dist/chunks/fr-BqQRlsfW.mjs.map +0 -1
- package/dist/chunks/fr-C81THS0v.mjs +0 -2
- package/dist/chunks/fr-C81THS0v.mjs.map +0 -1
- package/dist/chunks/fr-CC7TYK5K.mjs +0 -2
- package/dist/chunks/fr-CC7TYK5K.mjs.map +0 -1
- package/dist/chunks/fr-CXzpB6GU.mjs +0 -2
- package/dist/chunks/fr-CXzpB6GU.mjs.map +0 -1
- package/dist/chunks/fr-CjLyVnG3.mjs +0 -2
- package/dist/chunks/fr-CjLyVnG3.mjs.map +0 -1
- package/dist/chunks/fr-D66EEW9-.mjs +0 -2
- package/dist/chunks/fr-D66EEW9-.mjs.map +0 -1
- package/dist/chunks/fr-DHDNGQpl.mjs +0 -2
- package/dist/chunks/fr-DHDNGQpl.mjs.map +0 -1
- package/dist/chunks/fr-DOcFqSiX.mjs +0 -2
- package/dist/chunks/fr-DOcFqSiX.mjs.map +0 -1
- package/dist/chunks/fr-DPPHZ6H7.mjs +0 -2
- package/dist/chunks/fr-DPPHZ6H7.mjs.map +0 -1
- package/dist/chunks/fr-DVteHTTh.mjs +0 -2
- package/dist/chunks/fr-DVteHTTh.mjs.map +0 -1
- package/dist/chunks/fr-Dkeg9Am0.mjs +0 -2
- package/dist/chunks/fr-Dkeg9Am0.mjs.map +0 -1
- package/dist/chunks/fr-DnP_hh5Q.mjs +0 -2
- package/dist/chunks/fr-DnP_hh5Q.mjs.map +0 -1
- package/dist/chunks/fr-aDJE54Is.mjs +0 -2
- package/dist/chunks/fr-aDJE54Is.mjs.map +0 -1
- package/dist/chunks/fr-hStmLXCS.mjs +0 -2
- package/dist/chunks/fr-hStmLXCS.mjs.map +0 -1
- package/dist/chunks/fr-hUF51sR5.mjs +0 -2
- package/dist/chunks/fr-hUF51sR5.mjs.map +0 -1
- package/dist/chunks/fr-tK6rWhoz.mjs +0 -2
- package/dist/chunks/fr-tK6rWhoz.mjs.map +0 -1
- package/dist/chunks/fr-wqbTMwkj.mjs +0 -2
- package/dist/chunks/fr-wqbTMwkj.mjs.map +0 -1
- package/dist/chunks/fr-zO4UIZj_.mjs +0 -2
- package/dist/chunks/fr-zO4UIZj_.mjs.map +0 -1
- package/dist/chunks/full-B9IqlP6u.mjs +0 -2
- package/dist/chunks/full-B9IqlP6u.mjs.map +0 -1
- package/dist/chunks/hi-B7zs2lw-.mjs +0 -2
- package/dist/chunks/hi-B7zs2lw-.mjs.map +0 -1
- package/dist/chunks/hi-BE4pkSYX.mjs +0 -2
- package/dist/chunks/hi-BE4pkSYX.mjs.map +0 -1
- package/dist/chunks/hi-BEBdteKo.mjs +0 -2
- package/dist/chunks/hi-BEBdteKo.mjs.map +0 -1
- package/dist/chunks/hi-BFBRjxgB.mjs +0 -2
- package/dist/chunks/hi-BFBRjxgB.mjs.map +0 -1
- package/dist/chunks/hi-BGMkRr1l.mjs +0 -2
- package/dist/chunks/hi-BGMkRr1l.mjs.map +0 -1
- package/dist/chunks/hi-BKJbF0k9.mjs +0 -2
- package/dist/chunks/hi-BKJbF0k9.mjs.map +0 -1
- package/dist/chunks/hi-Bj-wENIe.mjs +0 -2
- package/dist/chunks/hi-Bj-wENIe.mjs.map +0 -1
- package/dist/chunks/hi-Bo_sc83d.mjs +0 -2
- package/dist/chunks/hi-Bo_sc83d.mjs.map +0 -1
- package/dist/chunks/hi-BqdojmVi.mjs +0 -2
- package/dist/chunks/hi-BqdojmVi.mjs.map +0 -1
- package/dist/chunks/hi-BtN2T9la.mjs +0 -2
- package/dist/chunks/hi-BtN2T9la.mjs.map +0 -1
- package/dist/chunks/hi-C2HFcJ8H.mjs +0 -2
- package/dist/chunks/hi-C2HFcJ8H.mjs.map +0 -1
- package/dist/chunks/hi-C9hGhR9D.mjs +0 -2
- package/dist/chunks/hi-C9hGhR9D.mjs.map +0 -1
- package/dist/chunks/hi-CRsCP_UU.mjs +0 -2
- package/dist/chunks/hi-CRsCP_UU.mjs.map +0 -1
- package/dist/chunks/hi-CSatC6e_.mjs +0 -2
- package/dist/chunks/hi-CSatC6e_.mjs.map +0 -1
- package/dist/chunks/hi-Cik-gmhU.mjs +0 -2
- package/dist/chunks/hi-Cik-gmhU.mjs.map +0 -1
- package/dist/chunks/hi-Co2ThMh7.mjs +0 -2
- package/dist/chunks/hi-Co2ThMh7.mjs.map +0 -1
- package/dist/chunks/hi-CrATuZJr.mjs +0 -2
- package/dist/chunks/hi-CrATuZJr.mjs.map +0 -1
- package/dist/chunks/hi-D-r5tA_n.mjs +0 -2
- package/dist/chunks/hi-D-r5tA_n.mjs.map +0 -1
- package/dist/chunks/hi-D0RKvhDO.mjs +0 -2
- package/dist/chunks/hi-D0RKvhDO.mjs.map +0 -1
- package/dist/chunks/hi-DOSbCXy_.mjs +0 -2
- package/dist/chunks/hi-DOSbCXy_.mjs.map +0 -1
- package/dist/chunks/hi-DTUY7wlZ.mjs +0 -2
- package/dist/chunks/hi-DTUY7wlZ.mjs.map +0 -1
- package/dist/chunks/hi-FhcxnL2S.mjs +0 -2
- package/dist/chunks/hi-FhcxnL2S.mjs.map +0 -1
- package/dist/chunks/hi-K71sKi2-.mjs +0 -2
- package/dist/chunks/hi-K71sKi2-.mjs.map +0 -1
- package/dist/chunks/hi-xjChf5ZY.mjs +0 -2
- package/dist/chunks/hi-xjChf5ZY.mjs.map +0 -1
- package/dist/chunks/minimal-J-u7e_pr.mjs +0 -2
- package/dist/chunks/minimal-J-u7e_pr.mjs.map +0 -1
- package/dist/chunks/pt-6uTV9TBd.mjs +0 -2
- package/dist/chunks/pt-6uTV9TBd.mjs.map +0 -1
- package/dist/chunks/pt-7ZYOqmC4.mjs +0 -2
- package/dist/chunks/pt-7ZYOqmC4.mjs.map +0 -1
- package/dist/chunks/pt-B59gJzMS.mjs +0 -2
- package/dist/chunks/pt-B59gJzMS.mjs.map +0 -1
- package/dist/chunks/pt-B65Mk0F_.mjs +0 -2
- package/dist/chunks/pt-B65Mk0F_.mjs.map +0 -1
- package/dist/chunks/pt-B9c20zi-.mjs +0 -2
- package/dist/chunks/pt-B9c20zi-.mjs.map +0 -1
- package/dist/chunks/pt-BRQRHBoW.mjs +0 -2
- package/dist/chunks/pt-BRQRHBoW.mjs.map +0 -1
- package/dist/chunks/pt-BYsPmDNG.mjs +0 -2
- package/dist/chunks/pt-BYsPmDNG.mjs.map +0 -1
- package/dist/chunks/pt-Bau_d96t.mjs +0 -2
- package/dist/chunks/pt-Bau_d96t.mjs.map +0 -1
- package/dist/chunks/pt-Bb3sODVO.mjs +0 -2
- package/dist/chunks/pt-Bb3sODVO.mjs.map +0 -1
- package/dist/chunks/pt-BieXcDHi.mjs +0 -2
- package/dist/chunks/pt-BieXcDHi.mjs.map +0 -1
- package/dist/chunks/pt-BzJZ6tis.mjs +0 -2
- package/dist/chunks/pt-BzJZ6tis.mjs.map +0 -1
- package/dist/chunks/pt-CDBahjbg.mjs +0 -2
- package/dist/chunks/pt-CDBahjbg.mjs.map +0 -1
- package/dist/chunks/pt-CQIn2xA5.mjs +0 -2
- package/dist/chunks/pt-CQIn2xA5.mjs.map +0 -1
- package/dist/chunks/pt-Cx3gdB5p.mjs +0 -2
- package/dist/chunks/pt-Cx3gdB5p.mjs.map +0 -1
- package/dist/chunks/pt-D7n_VUMD.mjs +0 -2
- package/dist/chunks/pt-D7n_VUMD.mjs.map +0 -1
- package/dist/chunks/pt-DEg_u7oB.mjs +0 -2
- package/dist/chunks/pt-DEg_u7oB.mjs.map +0 -1
- package/dist/chunks/pt-DchozfDf.mjs +0 -2
- package/dist/chunks/pt-DchozfDf.mjs.map +0 -1
- package/dist/chunks/pt-DnHYzWZI.mjs +0 -2
- package/dist/chunks/pt-DnHYzWZI.mjs.map +0 -1
- package/dist/chunks/pt-Dne18ay-.mjs +0 -2
- package/dist/chunks/pt-Dne18ay-.mjs.map +0 -1
- package/dist/chunks/pt-DxTZELCn.mjs +0 -2
- package/dist/chunks/pt-DxTZELCn.mjs.map +0 -1
- package/dist/chunks/pt-FnLj_fwL.mjs +0 -2
- package/dist/chunks/pt-FnLj_fwL.mjs.map +0 -1
- package/dist/chunks/pt-QZcGM_AW.mjs +0 -2
- package/dist/chunks/pt-QZcGM_AW.mjs.map +0 -1
- package/dist/chunks/pt-X4oj0zCg.mjs +0 -2
- package/dist/chunks/pt-X4oj0zCg.mjs.map +0 -1
- package/dist/chunks/pt-hgZhGt5D.mjs +0 -2
- package/dist/chunks/pt-hgZhGt5D.mjs.map +0 -1
- package/dist/chunks/ru-333jycve.mjs +0 -2
- package/dist/chunks/ru-333jycve.mjs.map +0 -1
- package/dist/chunks/ru-B278yBd4.mjs +0 -2
- package/dist/chunks/ru-B278yBd4.mjs.map +0 -1
- package/dist/chunks/ru-B2dlVf3F.mjs +0 -2
- package/dist/chunks/ru-B2dlVf3F.mjs.map +0 -1
- package/dist/chunks/ru-BHZdR6yk.mjs +0 -2
- package/dist/chunks/ru-BHZdR6yk.mjs.map +0 -1
- package/dist/chunks/ru-BhXqR_wI.mjs +0 -2
- package/dist/chunks/ru-BhXqR_wI.mjs.map +0 -1
- package/dist/chunks/ru-BkhY_-Tu.mjs +0 -2
- package/dist/chunks/ru-BkhY_-Tu.mjs.map +0 -1
- package/dist/chunks/ru-BqJmK6DG.mjs +0 -2
- package/dist/chunks/ru-BqJmK6DG.mjs.map +0 -1
- package/dist/chunks/ru-BscEW-yr.mjs +0 -2
- package/dist/chunks/ru-BscEW-yr.mjs.map +0 -1
- package/dist/chunks/ru-C91kg2w_.mjs +0 -2
- package/dist/chunks/ru-C91kg2w_.mjs.map +0 -1
- package/dist/chunks/ru-CQoFJYQk.mjs +0 -2
- package/dist/chunks/ru-CQoFJYQk.mjs.map +0 -1
- package/dist/chunks/ru-CYMaDdFA.mjs +0 -2
- package/dist/chunks/ru-CYMaDdFA.mjs.map +0 -1
- package/dist/chunks/ru-ClE-ByL-.mjs +0 -2
- package/dist/chunks/ru-ClE-ByL-.mjs.map +0 -1
- package/dist/chunks/ru-CmLLEJJV.mjs +0 -2
- package/dist/chunks/ru-CmLLEJJV.mjs.map +0 -1
- package/dist/chunks/ru-CmlYwIPH.mjs +0 -2
- package/dist/chunks/ru-CmlYwIPH.mjs.map +0 -1
- package/dist/chunks/ru-D74ItjLR.mjs +0 -2
- package/dist/chunks/ru-D74ItjLR.mjs.map +0 -1
- package/dist/chunks/ru-DR7ji_U_.mjs +0 -2
- package/dist/chunks/ru-DR7ji_U_.mjs.map +0 -1
- package/dist/chunks/ru-DZ0titlK.mjs +0 -2
- package/dist/chunks/ru-DZ0titlK.mjs.map +0 -1
- package/dist/chunks/ru-DftPghQ8.mjs +0 -2
- package/dist/chunks/ru-DftPghQ8.mjs.map +0 -1
- package/dist/chunks/ru-KBX9Y7TT.mjs +0 -2
- package/dist/chunks/ru-KBX9Y7TT.mjs.map +0 -1
- package/dist/chunks/ru-L3ML505C.mjs +0 -2
- package/dist/chunks/ru-L3ML505C.mjs.map +0 -1
- package/dist/chunks/ru-VAZhjO4q.mjs +0 -2
- package/dist/chunks/ru-VAZhjO4q.mjs.map +0 -1
- package/dist/chunks/ru-afocv3DK.mjs +0 -2
- package/dist/chunks/ru-afocv3DK.mjs.map +0 -1
- package/dist/chunks/ru-gUXymxbh.mjs +0 -2
- package/dist/chunks/ru-gUXymxbh.mjs.map +0 -1
- package/dist/chunks/ru-qL1ebv4O.mjs +0 -2
- package/dist/chunks/ru-qL1ebv4O.mjs.map +0 -1
- package/dist/chunks/src-DPhUQ25M.mjs +0 -2
- package/dist/chunks/src-DPhUQ25M.mjs.map +0 -1
- package/dist/chunks/text-direction-advanced-S4MgVMLX.mjs +0 -2
- package/dist/chunks/text-direction-advanced-S4MgVMLX.mjs.map +0 -1
- package/dist/chunks/zh-B3geJFGW.mjs +0 -2
- package/dist/chunks/zh-B3geJFGW.mjs.map +0 -1
- package/dist/chunks/zh-B4p7M6XB.mjs +0 -2
- package/dist/chunks/zh-B4p7M6XB.mjs.map +0 -1
- package/dist/chunks/zh-BkwaMj9a.mjs +0 -2
- package/dist/chunks/zh-BkwaMj9a.mjs.map +0 -1
- package/dist/chunks/zh-BogAT6ZW.mjs +0 -2
- package/dist/chunks/zh-BogAT6ZW.mjs.map +0 -1
- package/dist/chunks/zh-BvMEmsyF.mjs +0 -2
- package/dist/chunks/zh-BvMEmsyF.mjs.map +0 -1
- package/dist/chunks/zh-BzLh1p5b.mjs +0 -2
- package/dist/chunks/zh-BzLh1p5b.mjs.map +0 -1
- package/dist/chunks/zh-CBMpL9ha.mjs +0 -2
- package/dist/chunks/zh-CBMpL9ha.mjs.map +0 -1
- package/dist/chunks/zh-CIFsVnFl.mjs +0 -2
- package/dist/chunks/zh-CIFsVnFl.mjs.map +0 -1
- package/dist/chunks/zh-CP6_YzAc.mjs +0 -2
- package/dist/chunks/zh-CP6_YzAc.mjs.map +0 -1
- package/dist/chunks/zh-CT4V3EmW.mjs +0 -2
- package/dist/chunks/zh-CT4V3EmW.mjs.map +0 -1
- package/dist/chunks/zh-CZCIluI_.mjs +0 -2
- package/dist/chunks/zh-CZCIluI_.mjs.map +0 -1
- package/dist/chunks/zh-CcMLjYrk.mjs +0 -2
- package/dist/chunks/zh-CcMLjYrk.mjs.map +0 -1
- package/dist/chunks/zh-CfCQsLZa.mjs +0 -2
- package/dist/chunks/zh-CfCQsLZa.mjs.map +0 -1
- package/dist/chunks/zh-CsyBlhtm.mjs +0 -2
- package/dist/chunks/zh-CsyBlhtm.mjs.map +0 -1
- package/dist/chunks/zh-D4eu30KQ.mjs +0 -2
- package/dist/chunks/zh-D4eu30KQ.mjs.map +0 -1
- package/dist/chunks/zh-DSfxjb4Y.mjs +0 -2
- package/dist/chunks/zh-DSfxjb4Y.mjs.map +0 -1
- package/dist/chunks/zh-Dj5jzeIJ.mjs +0 -2
- package/dist/chunks/zh-Dj5jzeIJ.mjs.map +0 -1
- package/dist/chunks/zh-DjY-jmYn.mjs +0 -2
- package/dist/chunks/zh-DjY-jmYn.mjs.map +0 -1
- package/dist/chunks/zh-Dt7zL1Bl.mjs +0 -2
- package/dist/chunks/zh-Dt7zL1Bl.mjs.map +0 -1
- package/dist/chunks/zh-bkCXy34A.mjs +0 -2
- package/dist/chunks/zh-bkCXy34A.mjs.map +0 -1
- package/dist/chunks/zh-cRqBrQM8.mjs +0 -2
- package/dist/chunks/zh-cRqBrQM8.mjs.map +0 -1
- package/dist/chunks/zh-cUJdRfxu.mjs +0 -2
- package/dist/chunks/zh-cUJdRfxu.mjs.map +0 -1
- package/dist/chunks/zh-qo4_i9Vd.mjs +0 -2
- package/dist/chunks/zh-qo4_i9Vd.mjs.map +0 -1
- package/dist/chunks/zh-tpUU3oJa.mjs +0 -2
- package/dist/chunks/zh-tpUU3oJa.mjs.map +0 -1
- package/dist/plugins/text-direction/TextDirectionCorePlugin.d.ts +0 -35
- package/dist/plugins/text-direction/TextDirectionCorePlugin.d.ts.map +0 -1
- package/dist/plugins/text-direction/TextDirectionMiddleware.d.ts +0 -18
- package/dist/plugins/text-direction/TextDirectionMiddleware.d.ts.map +0 -1
- package/dist/plugins/text-direction-advanced/index.d.ts +0 -5
- package/dist/plugins/text-direction-advanced/index.d.ts.map +0 -1
- package/dist/plugins/text-direction-advanced.mjs +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PluginHelpers-D1QF-YaF.mjs","names":[],"sources":["../../src/i18n/LocaleService.ts","../../src/plugins/shared/LocaleLoader.ts","../../src/plugins/shared/PluginHelpers.ts"],"sourcesContent":["/**\n * Global locale service that resolves the active language.\n * Registered as a system-level service before plugin init.\n */\n\nimport { ServiceKey } from '../plugins/Plugin.js';\n\nexport class LocaleService {\n\tprivate readonly resolvedLocale: string;\n\n\tconstructor(locale: string) {\n\t\tthis.resolvedLocale =\n\t\t\tlocale === 'browser'\n\t\t\t\t? typeof navigator !== 'undefined'\n\t\t\t\t\t? (navigator.language.split('-')[0] ?? 'en')\n\t\t\t\t\t: 'en'\n\t\t\t\t: locale;\n\t}\n\n\tgetLocale(): string {\n\t\treturn this.resolvedLocale;\n\t}\n}\n\nexport const LocaleServiceKey = new ServiceKey<LocaleService>('locale');\n","/**\n * Shared helper for loading plugin locale bundles.\n *\n * Rationale:\n * Every notectl plugin used to ship its own copy of a ~15-line locale\n * loader: English shortcut, glob lookup, lazy import, try/catch fallback.\n * The logic is identical across ~23 plugins — only the locale type and\n * the default value change. This helper centralizes the pattern so each\n * plugin's `XxxLocale.ts` shrinks to a handful of lines.\n *\n * Why the glob map still lives in the plugin:\n * `import.meta.glob` is statically resolved by the bundler **relative to\n * the file that calls it**. The helper therefore cannot build the glob\n * itself — each plugin must pass in its own `import.meta.glob(...)`\n * result, and the helper takes care of everything else.\n */\n\n/**\n * Signature of a single locale loader as produced by `import.meta.glob`.\n * The bundler wraps each matched module in a thunk returning a Promise\n * that resolves to an ES module whose default export is the locale.\n */\nexport type LocaleModuleLoader<TLocale> = () => Promise<{ default: TLocale }>;\n\n/**\n * Map from the path string emitted by `import.meta.glob` (e.g.\n * `./locales/de.ts`) to its corresponding lazy loader.\n */\nexport type LocaleModuleMap<TLocale> = Record<string, LocaleModuleLoader<TLocale>>;\n\n/**\n * Loads a plugin locale for the requested language with three fallbacks:\n *\n * 1. `lang === 'en'` — returns the default locale immediately, no import.\n * 2. No matching module in the map — returns the default locale.\n * 3. Module import throws — returns the default locale.\n *\n * This is the exact behavior every plugin needs; sharing it removes ~15\n * lines of boilerplate per plugin and guarantees consistent fallback\n * semantics across the entire editor.\n *\n * @param modules The `import.meta.glob('./locales/*.ts', ...)` map from\n * the caller's module. Passing this in from the plugin\n * is mandatory — globs are resolved at the call site.\n * @param lang IETF-style language tag, e.g. `'de'`, `'zh'`, `'en'`.\n * @param fallback English default locale to return when lookup or\n * import fails. Must already be a fully-formed locale.\n */\nexport async function loadLocaleModule<TLocale>(\n\tmodules: LocaleModuleMap<TLocale>,\n\tlang: string,\n\tfallback: TLocale,\n): Promise<TLocale> {\n\tif (lang === 'en') return fallback;\n\n\tconst loader: LocaleModuleLoader<TLocale> | undefined = modules[`./locales/${lang}.ts`];\n\tif (!loader) return fallback;\n\n\ttry {\n\t\tconst mod = await loader();\n\t\treturn mod.default;\n\t} catch {\n\t\treturn fallback;\n\t}\n}\n","/**\n * Shared helper utilities for plugins.\n * Common operations extracted to avoid code duplication across plugins.\n */\n\nimport { LocaleServiceKey } from '../../i18n/LocaleService.js';\nimport type { BlockNode } from '../../model/Document.js';\nimport { isNodeSelection, isTextSelection } from '../../model/Selection.js';\nimport type { BlockId } from '../../model/TypeBrands.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { PluginContext } from '../Plugin.js';\n\n/** Capitalizes the first character of a string. */\nexport function capitalize(s: string): string {\n\treturn s.charAt(0).toUpperCase() + s.slice(1);\n}\n\n/** Converts a mark type to its toggle command name (e.g. 'bold' → 'toggleBold'). */\nexport function toCommandName(markType: string): string {\n\treturn `toggle${capitalize(markType)}`;\n}\n\n/**\n * Resolves the locale for a plugin, using config override, default, or dynamic loader.\n * Plugins provide their config locale, a default English locale, and a loader for other languages.\n */\nexport async function resolveLocale<T>(\n\tcontext: PluginContext,\n\tconfigLocale: T | undefined,\n\tdefaultLocale: T,\n\tloader: (lang: string) => Promise<T>,\n): Promise<T> {\n\tif (configLocale) return configLocale;\n\tconst service = context.getService(LocaleServiceKey);\n\tconst lang: string = service?.getLocale() ?? 'en';\n\treturn lang === 'en' ? defaultLocale : loader(lang);\n}\n\n/** Returns the block under the cursor, handling both TextSelection and NodeSelection. */\nexport function getSelectedBlock(state: EditorState): BlockNode | undefined {\n\tconst sel = state.selection;\n\tif (isNodeSelection(sel)) return state.getBlock(sel.nodeId);\n\tif (isTextSelection(sel)) return state.getBlock(sel.anchor.blockId);\n\treturn undefined;\n}\n\n/** Returns the block ID under the cursor, handling both TextSelection and NodeSelection. */\nexport function getSelectedBlockId(state: EditorState): BlockId | undefined {\n\tconst sel = state.selection;\n\tif (isNodeSelection(sel)) return sel.nodeId;\n\tif (isTextSelection(sel)) return sel.anchor.blockId;\n\treturn undefined;\n}\n"],"mappings":"8FAOA,IAAa,EAAb,MACC,eAEA,WAAA,CAAY,GACX,KAAK,eACO,YAAX,EACwB,oBAAd,UACL,UAAU,SAAS,MAAM,KAAK,IAAM,KACrC,KACD,EAGL,SAAA,GACC,OAAO,KAAK,iBAID,EAAmB,IAAI,EAA0B,UCwB9D,eAAsB,EACrB,EACA,EACA,GAEA,GAAa,OAAT,EAAe,OAAO,EAE1B,MAAM,EAAkD,EAAQ,aAAa,QAC7E,IAAK,EAAQ,OAAO,EAEpB,IAEC,aADkB,KACP,cAEX,OAAO,GCjDT,SAAgB,EAAW,GAC1B,OAAO,EAAE,OAAO,GAAG,cAAgB,EAAE,MAAM,GAI5C,SAAgB,EAAc,GAC7B,MAAO,SAAS,EAAW,KAO5B,eAAsB,EACrB,EACA,EACA,EACA,GAEA,GAAI,EAAc,OAAO,EAEzB,MAAM,EADU,EAAQ,WAAW,IACL,aAAe,KAC7C,MAAgB,OAAT,EAAgB,EAAgB,EAAO,GAI/C,SAAgB,EAAiB,GAChC,MAAM,EAAM,EAAM,UAClB,OAAI,EAAgB,GAAa,EAAM,SAAS,EAAI,QAChD,EAAgB,GAAa,EAAM,SAAS,EAAI,OAAO,cAA3D,EAKD,SAAgB,EAAmB,GAClC,MAAM,EAAM,EAAM,UAClB,OAAI,EAAgB,GAAa,EAAI,OACjC,EAAgB,GAAa,EAAI,OAAO,aAA5C"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t,t as r}from"./KeyboardNav-CsdlWnNl.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-DhcUe29m.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PopupKeyboardPatterns-DhcUe29m.mjs","names":[],"sources":["../../src/plugins/shared/PopupKeyboardPatterns.ts"],"sourcesContent":["/**\n * Pure functions that attach WAI-ARIA keyboard patterns to popup containers.\n * Supports menu, listbox, and grid navigation patterns.\n * Delegates to shared keyboard navigation helpers.\n */\n\nimport { applyRovingTabindex, findNextDropdownItem, navigateGrid } from './KeyboardNav.js';\n\n// --- Types ---\n\nexport interface MenuKeyboardConfig {\n\treadonly container: HTMLElement;\n\treadonly itemSelector: string;\n\treadonly onActivate: (item: HTMLElement) => void;\n\treadonly onClose: () => void;\n\treadonly getActiveElement: () => Element | null;\n}\n\nexport interface ListboxKeyboardConfig {\n\treadonly container: HTMLElement;\n\treadonly itemSelector: string;\n\treadonly onSelect: (item: HTMLElement) => void;\n\treadonly onClose: () => void;\n}\n\nexport interface GridKeyboardConfig {\n\treadonly container: HTMLElement;\n\treadonly cellSelector: string;\n\treadonly columns: number;\n\treadonly totalCells: number;\n\treadonly onSelect: (cell: HTMLElement) => void;\n\treadonly onClose: () => void;\n\treadonly onNavigate?: (index: number) => void;\n}\n\n// --- Constants ---\n\nconst GRID_NAV_KEYS: ReadonlySet<string> = new Set([\n\t'ArrowUp',\n\t'ArrowDown',\n\t'ArrowLeft',\n\t'ArrowRight',\n]);\n\n// --- Menu Keyboard ---\n\n/**\n * Attaches menu keyboard navigation (ArrowUp/Down, Enter/Space, Home/End, Escape).\n * Returns a cleanup function that removes the event listener.\n */\nexport function attachMenuKeyboard(config: MenuKeyboardConfig): () => void {\n\tlet focusedIndex = 0;\n\n\tconst handler = (e: KeyboardEvent): void => {\n\t\te.stopPropagation();\n\t\tconst items: HTMLElement[] = Array.from(\n\t\t\tconfig.container.querySelectorAll(config.itemSelector),\n\t\t) as HTMLElement[];\n\t\tif (items.length === 0) return;\n\n\t\tswitch (e.key) {\n\t\t\tcase 'Escape': {\n\t\t\t\te.preventDefault();\n\t\t\t\tconfig.onClose();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase 'ArrowDown': {\n\t\t\t\te.preventDefault();\n\t\t\t\tfocusedIndex = findNextDropdownItem(items, focusedIndex, 1);\n\t\t\t\tapplyRovingTabindex(items as HTMLButtonElement[], focusedIndex);\n\t\t\t\titems[focusedIndex]?.focus();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase 'ArrowUp': {\n\t\t\t\te.preventDefault();\n\t\t\t\tfocusedIndex = findNextDropdownItem(items, focusedIndex, -1);\n\t\t\t\tapplyRovingTabindex(items as HTMLButtonElement[], focusedIndex);\n\t\t\t\titems[focusedIndex]?.focus();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase 'Enter':\n\t\t\tcase ' ': {\n\t\t\t\te.preventDefault();\n\t\t\t\tconst item: HTMLElement | undefined = items[focusedIndex];\n\t\t\t\tif (item) config.onActivate(item);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase 'Home': {\n\t\t\t\te.preventDefault();\n\t\t\t\tfocusedIndex = 0;\n\t\t\t\tapplyRovingTabindex(items as HTMLButtonElement[], focusedIndex);\n\t\t\t\titems[focusedIndex]?.focus();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase 'End': {\n\t\t\t\te.preventDefault();\n\t\t\t\tfocusedIndex = items.length - 1;\n\t\t\t\tapplyRovingTabindex(items as HTMLButtonElement[], focusedIndex);\n\t\t\t\titems[focusedIndex]?.focus();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t};\n\n\tconfig.container.addEventListener('keydown', handler);\n\treturn () => config.container.removeEventListener('keydown', handler);\n}\n\n// --- Listbox Keyboard ---\n\n/**\n * Attaches listbox keyboard navigation (ArrowUp/Down, Enter/Space, Escape).\n * Returns a cleanup function.\n */\nexport function attachListboxKeyboard(config: ListboxKeyboardConfig): () => void {\n\tlet focusedIndex = 0;\n\n\tconst handler = (e: KeyboardEvent): void => {\n\t\tconst items: HTMLElement[] = Array.from(\n\t\t\tconfig.container.querySelectorAll(config.itemSelector),\n\t\t) as HTMLElement[];\n\t\tif (items.length === 0) return;\n\n\t\tswitch (e.key) {\n\t\t\tcase 'Escape': {\n\t\t\t\te.preventDefault();\n\t\t\t\tconfig.onClose();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase 'ArrowDown': {\n\t\t\t\te.preventDefault();\n\t\t\t\tfocusedIndex = findNextDropdownItem(items, focusedIndex, 1);\n\t\t\t\tapplyRovingTabindex(items as HTMLButtonElement[], focusedIndex);\n\t\t\t\titems[focusedIndex]?.focus();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase 'ArrowUp': {\n\t\t\t\te.preventDefault();\n\t\t\t\tfocusedIndex = findNextDropdownItem(items, focusedIndex, -1);\n\t\t\t\tapplyRovingTabindex(items as HTMLButtonElement[], focusedIndex);\n\t\t\t\titems[focusedIndex]?.focus();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase 'Enter':\n\t\t\tcase ' ': {\n\t\t\t\te.preventDefault();\n\t\t\t\tconst item: HTMLElement | undefined = items[focusedIndex];\n\t\t\t\tif (item) config.onSelect(item);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t};\n\n\tconfig.container.addEventListener('keydown', handler);\n\treturn () => config.container.removeEventListener('keydown', handler);\n}\n\n// --- Grid Keyboard ---\n\n/**\n * Attaches grid keyboard navigation (2D arrows, Home/End per row, Enter/Space, Escape).\n * Returns a cleanup function.\n */\nexport function attachGridKeyboard(config: GridKeyboardConfig): () => void {\n\tlet focusedIndex = 0;\n\tconst columns: number = config.columns;\n\tconst totalCells: number = config.totalCells;\n\tconst totalRows: number = Math.ceil(totalCells / columns);\n\n\tconst handler = (e: KeyboardEvent): void => {\n\t\tconst cells: HTMLElement[] = Array.from(\n\t\t\tconfig.container.querySelectorAll(config.cellSelector),\n\t\t) as HTMLElement[];\n\t\tif (cells.length === 0) return;\n\n\t\tif (e.key === 'Escape') {\n\t\t\te.preventDefault();\n\t\t\tconfig.onClose();\n\t\t\treturn;\n\t\t}\n\n\t\tif (e.key === 'Enter' || e.key === ' ') {\n\t\t\te.preventDefault();\n\t\t\tconst cell: HTMLElement | undefined = cells[focusedIndex];\n\t\t\tif (cell) config.onSelect(cell);\n\t\t\treturn;\n\t\t}\n\n\t\tif (GRID_NAV_KEYS.has(e.key)) {\n\t\t\te.preventDefault();\n\t\t\tconst currentRow: number = Math.floor(focusedIndex / columns) + 1;\n\t\t\tconst currentCol: number = (focusedIndex % columns) + 1;\n\n\t\t\tconst [newRow, newCol] = navigateGrid(\n\t\t\t\tcurrentRow,\n\t\t\t\tcurrentCol,\n\t\t\t\ttotalRows,\n\t\t\t\tcolumns,\n\t\t\t\te.key as 'ArrowUp' | 'ArrowDown' | 'ArrowLeft' | 'ArrowRight',\n\t\t\t);\n\n\t\t\tlet newIdx: number = (newRow - 1) * columns + (newCol - 1);\n\t\t\tif (newIdx >= totalCells) {\n\t\t\t\tnewIdx = totalCells - 1;\n\t\t\t}\n\n\t\t\tfocusedIndex = newIdx;\n\t\t\tapplyRovingTabindex(cells as HTMLButtonElement[], focusedIndex);\n\t\t\tcells[focusedIndex]?.focus();\n\t\t\tconfig.onNavigate?.(focusedIndex);\n\t\t\treturn;\n\t\t}\n\n\t\tif (e.key === 'Home' || e.key === 'End') {\n\t\t\te.preventDefault();\n\t\t\tconst currentRow: number = Math.floor(focusedIndex / columns);\n\t\t\tconst rowStart: number = currentRow * columns;\n\t\t\tconst rowEnd: number = Math.min(rowStart + columns - 1, totalCells - 1);\n\n\t\t\tfocusedIndex = e.key === 'Home' ? rowStart : rowEnd;\n\t\t\tapplyRovingTabindex(cells as HTMLButtonElement[], focusedIndex);\n\t\t\tcells[focusedIndex]?.focus();\n\t\t\tconfig.onNavigate?.(focusedIndex);\n\t\t}\n\t};\n\n\tconfig.container.addEventListener('keydown', handler);\n\treturn () => config.container.removeEventListener('keydown', handler);\n}\n"],"mappings":"6DAqCA,IAAM,EAAqC,IAAI,IAAI,CAClD,UACA,YACA,YACA,eASD,SAAgB,EAAmB,GAClC,IAAI,EAAe,EAEnB,MAAM,EAAW,IAChB,EAAE,kBACF,MAAM,EAAuB,MAAM,KAClC,EAAO,UAAU,iBAAiB,EAAO,eAE1C,GAAqB,IAAjB,EAAM,OAEV,OAAQ,EAAE,KACT,IAAK,SAGJ,OAFA,EAAE,sBACF,EAAO,UAGR,IAAK,YAKJ,OAJA,EAAE,iBACF,EAAe,EAAqB,EAAO,EAAc,GACzD,EAAoB,EAA8B,QAClD,EAAM,IAAe,QAGtB,IAAK,UAKJ,OAJA,EAAE,iBACF,EAAe,EAAqB,EAAO,GAAc,GACzD,EAAoB,EAA8B,QAClD,EAAM,IAAe,QAGtB,IAAK,QACL,IAAK,IAAK,CACT,EAAE,iBACF,MAAM,EAAgC,EAAM,GAE5C,YADI,GAAM,EAAO,WAAW,IAG7B,IAAK,OAKJ,OAJA,EAAE,iBACF,EAAe,EACf,EAAoB,EAA8B,QAClD,EAAM,IAAe,QAGtB,IAAK,MAKJ,OAJA,EAAE,iBACF,EAAe,EAAM,OAAS,EAC9B,EAAoB,EAA8B,QAClD,EAAM,IAAe,UAOxB,OADA,EAAO,UAAU,iBAAiB,UAAW,GAC7C,IAAa,EAAO,UAAU,oBAAoB,UAAW,GAS9D,SAAgB,EAAsB,GACrC,IAAI,EAAe,EAEnB,MAAM,EAAW,IAChB,MAAM,EAAuB,MAAM,KAClC,EAAO,UAAU,iBAAiB,EAAO,eAE1C,GAAqB,IAAjB,EAAM,OAEV,OAAQ,EAAE,KACT,IAAK,SAGJ,OAFA,EAAE,sBACF,EAAO,UAGR,IAAK,YAKJ,OAJA,EAAE,iBACF,EAAe,EAAqB,EAAO,EAAc,GACzD,EAAoB,EAA8B,QAClD,EAAM,IAAe,QAGtB,IAAK,UAKJ,OAJA,EAAE,iBACF,EAAe,EAAqB,EAAO,GAAc,GACzD,EAAoB,EAA8B,QAClD,EAAM,IAAe,QAGtB,IAAK,QACL,IAAK,IAAK,CACT,EAAE,iBACF,MAAM,EAAgC,EAAM,GAE5C,YADI,GAAM,EAAO,SAAS,OAO7B,OADA,EAAO,UAAU,iBAAiB,UAAW,GAC7C,IAAa,EAAO,UAAU,oBAAoB,UAAW,GAS9D,SAAgB,EAAmB,GAClC,IAAI,EAAe,EACnB,MAAM,EAAkB,EAAO,QACzB,EAAqB,EAAO,WAC5B,EAAoB,KAAK,KAAK,EAAa,GAE3C,EAAW,IAChB,MAAM,EAAuB,MAAM,KAClC,EAAO,UAAU,iBAAiB,EAAO,eAE1C,GAAqB,IAAjB,EAAM,OAAV,CAEA,GAAc,WAAV,EAAE,IAGL,OAFA,EAAE,sBACF,EAAO,UAIR,GAAc,UAAV,EAAE,KAA6B,MAAV,EAAE,IAAa,CACvC,EAAE,iBACF,MAAM,EAAgC,EAAM,GAE5C,YADI,GAAM,EAAO,SAAS,IAI3B,GAAI,EAAc,IAAI,EAAE,KAAM,CAC7B,EAAE,iBAIF,MAAO,EAAQ,GAAU,EAHE,KAAK,MAAM,EAAe,GAAW,EACpC,EAAe,EAAW,EAKrD,EACA,EACA,EAAE,KAGH,IAAI,GAAkB,EAAS,GAAK,GAAW,EAAS,GASxD,OARI,GAAU,IACb,EAAS,EAAa,GAGvB,EAAe,EACf,EAAoB,EAA8B,GAClD,EAAM,IAAe,aACrB,EAAO,aAAa,GAIrB,GAAc,SAAV,EAAE,KAA4B,QAAV,EAAE,IAAe,CACxC,EAAE,iBAEF,MAAM,EADqB,KAAK,MAAM,EAAe,GACf,EAChC,EAAiB,KAAK,IAAI,EAAW,EAAU,EAAG,EAAa,GAErE,EAAyB,SAAV,EAAE,IAAiB,EAAW,EAC7C,EAAoB,EAA8B,GAClD,EAAM,IAAe,QACrB,EAAO,aAAa,GAjDG,GAsDzB,OADA,EAAO,UAAU,iBAAiB,UAAW,GAC7C,IAAa,EAAO,UAAU,oBAAoB,UAAW"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./Platform-D9TRT4Mn.mjs";import{n as t}from"./Plugin-BUNGKupW.mjs";import{r as s,t as n}from"./PopupPositioning-DRNwWB0U.mjs";var o=new t("popup"),r=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 o=e.parent?this.findEntryByHandle(e.parent):null;let r;const i={close:e=>this.closeEntry(r,e),getElement:()=>t},c=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(r)}};r={element:t,config:e,clickOutsideHandler:c,parent:o,listenerRegistrationTimer:null,documentListenerAttached:!1},this.stack.push(r);try{e.content(t,e=>this.closeEntry(r,e))}catch(l){throw this.removeEntry(r),l}return this.stack.includes(r)?(n(t,e.referenceNode??this.referenceNode),s(t,e.anchor instanceof HTMLElement?e.anchor.getBoundingClientRect():e.anchor,{position:e.position??"below-start",isRtl:this.isRtlContext()}),r.listenerRegistrationTimer=setTimeout(()=>{r.listenerRegistrationTimer=null,this.stack.includes(r)&&(document.addEventListener("mousedown",c),r.documentListenerAttached=!0)},0),this.focusFirstItem(t),i):i}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")??e.querySelector("button"))?.focus()})}};export{o as n,r as t};
|
|
2
|
-
//# sourceMappingURL=PopupManager-DaTySyZl.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PopupManager-DaTySyZl.mjs","names":[],"sources":["../../src/plugins/shared/PopupManager.ts"],"sourcesContent":["/**\n * Central popup lifecycle manager. Handles creation, positioning,\n * click-outside closing, Escape key, focus restoration, and popup stacking\n * for submenus/nested popups.\n */\n\nimport { isRtlContext } from '../../platform/Platform.js';\nimport { ServiceKey } from '../Plugin.js';\nimport { type PopupPosition, appendToRoot, positionPopup } from './PopupPositioning.js';\n\n// --- Types ---\n\n/** Options for overriding focus restoration when closing a popup. */\nexport interface PopupCloseOptions {\n\t/**\n\t * Override the default focus target on close.\n\t * - `HTMLElement` → focus that element instead of `config.restoreFocusTo`\n\t * - `null` → skip focus restoration entirely\n\t * - `undefined` / omitted → use default `config.restoreFocusTo`\n\t */\n\treadonly restoreFocusTo?: HTMLElement | null;\n}\n\nexport interface PopupConfig {\n\treadonly anchor: HTMLElement | DOMRect;\n\treadonly content: (container: HTMLElement, close: (options?: PopupCloseOptions) => void) => void;\n\treadonly className?: string;\n\treadonly ariaRole?: 'menu' | 'listbox' | 'grid' | 'dialog';\n\treadonly ariaLabel?: string;\n\treadonly restoreFocusTo?: HTMLElement;\n\treadonly onClose?: () => void;\n\treadonly position?: PopupPosition;\n\treadonly parent?: PopupHandle;\n\treadonly referenceNode?: Node;\n}\n\nexport interface PopupHandle {\n\tclose(options?: PopupCloseOptions): void;\n\tgetElement(): HTMLElement;\n}\n\nexport interface PopupServiceAPI {\n\topen(config: PopupConfig): PopupHandle;\n\tclose(): void;\n\tcloseAll(): void;\n\tisOpen(): boolean;\n}\n\nexport const PopupServiceKey = new ServiceKey<PopupServiceAPI>('popup');\n\n// --- Internal Entry ---\n\ninterface PopupEntry {\n\treadonly element: HTMLElement;\n\treadonly config: PopupConfig;\n\treadonly clickOutsideHandler: (e: MouseEvent) => void;\n\treadonly parent: PopupEntry | null;\n\tlistenerRegistrationTimer: ReturnType<typeof setTimeout> | null;\n\tdocumentListenerAttached: boolean;\n}\n\n// --- Manager ---\n\nexport class PopupManager implements PopupServiceAPI {\n\tprivate readonly stack: PopupEntry[] = [];\n\tprivate readonly referenceNode: Node;\n\n\tconstructor(referenceNode: Node) {\n\t\tthis.referenceNode = referenceNode;\n\t}\n\n\t/** Opens a popup with the given configuration. Returns a handle for closing it. */\n\topen(config: PopupConfig): PopupHandle {\n\t\tconst popup: HTMLDivElement = document.createElement('div');\n\t\tpopup.className = config.className ? `notectl-popup ${config.className}` : 'notectl-popup';\n\n\t\tif (config.ariaRole) {\n\t\t\tpopup.setAttribute('role', config.ariaRole);\n\t\t}\n\t\tif (config.ariaLabel) {\n\t\t\tpopup.setAttribute('aria-label', config.ariaLabel);\n\t\t}\n\n\t\tconst parentEntry: PopupEntry | null = config.parent\n\t\t\t? this.findEntryByHandle(config.parent)\n\t\t\t: null;\n\n\t\tlet entry!: PopupEntry;\n\t\tconst handle: PopupHandle = {\n\t\t\tclose: (options?: PopupCloseOptions) => this.closeEntry(entry, options),\n\t\t\tgetElement: () => popup,\n\t\t};\n\n\t\tconst clickOutsideHandler = (e: MouseEvent): void => {\n\t\t\tconst path: EventTarget[] = e.composedPath();\n\t\t\tif (path.includes(popup)) return;\n\n\t\t\t// Don't close if click is inside any ancestor popup in the stack\n\t\t\tfor (const stackEntry of this.stack) {\n\t\t\t\tif (path.includes(stackEntry.element)) return;\n\t\t\t}\n\n\t\t\t// Don't close if click is on the anchor element\n\t\t\tif (config.anchor instanceof HTMLElement && path.includes(config.anchor)) return;\n\n\t\t\tthis.closeEntry(entry);\n\t\t};\n\n\t\tentry = {\n\t\t\telement: popup,\n\t\t\tconfig,\n\t\t\tclickOutsideHandler,\n\t\t\tparent: parentEntry,\n\t\t\tlistenerRegistrationTimer: null,\n\t\t\tdocumentListenerAttached: false,\n\t\t};\n\n\t\tthis.stack.push(entry);\n\n\t\ttry {\n\t\t\tconfig.content(popup, (options?: PopupCloseOptions) => this.closeEntry(entry, options));\n\t\t} catch (error) {\n\t\t\tthis.removeEntry(entry);\n\t\t\tthrow error;\n\t\t}\n\n\t\tif (!this.stack.includes(entry)) {\n\t\t\treturn handle;\n\t\t}\n\n\t\tconst refNode: Node = config.referenceNode ?? this.referenceNode;\n\t\tappendToRoot(popup, refNode);\n\n\t\tconst anchorRect: DOMRect =\n\t\t\tconfig.anchor instanceof HTMLElement ? config.anchor.getBoundingClientRect() : config.anchor;\n\t\tpositionPopup(popup, anchorRect, {\n\t\t\tposition: config.position ?? 'below-start',\n\t\t\tisRtl: this.isRtlContext(),\n\t\t});\n\n\t\tentry.listenerRegistrationTimer = setTimeout(() => {\n\t\t\tentry.listenerRegistrationTimer = null;\n\t\t\tif (!this.stack.includes(entry)) return;\n\t\t\tdocument.addEventListener('mousedown', clickOutsideHandler);\n\t\t\tentry.documentListenerAttached = true;\n\t\t}, 0);\n\n\t\tthis.focusFirstItem(popup);\n\n\t\treturn handle;\n\t}\n\n\t/** Closes the topmost popup in the stack. */\n\tclose(): void {\n\t\tconst top: PopupEntry | undefined = this.stack[this.stack.length - 1];\n\t\tif (top) {\n\t\t\tthis.closeEntry(top);\n\t\t}\n\t}\n\n\t/** Closes all open popups. */\n\tcloseAll(): void {\n\t\twhile (this.stack.length > 0) {\n\t\t\tconst top: PopupEntry | undefined = this.stack[this.stack.length - 1];\n\t\t\tif (top) {\n\t\t\t\tthis.closeEntry(top);\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Returns true if any popup is currently open. */\n\tisOpen(): boolean {\n\t\treturn this.stack.length > 0;\n\t}\n\n\t/** Cleans up all popups and event listeners. */\n\tdestroy(): void {\n\t\tthis.closeAll();\n\t}\n\n\t// --- Internal ---\n\n\tprivate closeEntry(entry: PopupEntry, options?: PopupCloseOptions): void {\n\t\tconst index: number = this.stack.indexOf(entry);\n\t\tif (index === -1) return;\n\n\t\t// Close all child popups first (anything above this entry in the stack)\n\t\twhile (this.stack.length > index + 1) {\n\t\t\tconst child: PopupEntry | undefined = this.stack[this.stack.length - 1];\n\t\t\tif (child) {\n\t\t\t\tthis.removeEntry(child);\n\t\t\t}\n\t\t}\n\n\t\tthis.removeEntry(entry);\n\n\t\tif (options !== undefined && 'restoreFocusTo' in options) {\n\t\t\toptions.restoreFocusTo?.focus();\n\t\t} else if (entry.config.restoreFocusTo) {\n\t\t\tentry.config.restoreFocusTo.focus();\n\t\t}\n\t\tentry.config.onClose?.();\n\t}\n\n\tprivate removeEntry(entry: PopupEntry): void {\n\t\tconst index: number = this.stack.indexOf(entry);\n\t\tif (index === -1) return;\n\n\t\tthis.stack.splice(index, 1);\n\t\tif (entry.listenerRegistrationTimer !== null) {\n\t\t\tclearTimeout(entry.listenerRegistrationTimer);\n\t\t\tentry.listenerRegistrationTimer = null;\n\t\t}\n\t\tentry.element.remove();\n\t\tif (entry.documentListenerAttached) {\n\t\t\tdocument.removeEventListener('mousedown', entry.clickOutsideHandler);\n\t\t\tentry.documentListenerAttached = false;\n\t\t}\n\t}\n\n\tprivate findEntryByHandle(handle: PopupHandle): PopupEntry | null {\n\t\tconst element: HTMLElement = handle.getElement();\n\t\treturn this.stack.find((e) => e.element === element) ?? null;\n\t}\n\n\t/** Detects whether the editor context is RTL from the computed style. */\n\tprivate isRtlContext(): boolean {\n\t\tif (this.referenceNode instanceof HTMLElement) {\n\t\t\treturn isRtlContext(this.referenceNode);\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate focusFirstItem(popup: HTMLElement): void {\n\t\trequestAnimationFrame(() => {\n\t\t\tconst firstFocusable: HTMLElement | null =\n\t\t\t\tpopup.querySelector('[role=\"menuitem\"]') ??\n\t\t\t\tpopup.querySelector('[role=\"option\"]') ??\n\t\t\t\tpopup.querySelector('[role=\"gridcell\"]') ??\n\t\t\t\tpopup.querySelector('input') ??\n\t\t\t\tpopup.querySelector('button');\n\t\t\tfirstFocusable?.focus();\n\t\t});\n\t}\n}\n"],"mappings":"iJAgDA,IAAa,EAAkB,IAAI,EAA4B,SAelD,EAAb,MACC,MAAuC,GACvC,cAEA,WAAA,CAAY,GACX,KAAK,cAAgB,EAItB,IAAA,CAAK,GACJ,MAAM,EAAwB,SAAS,cAAc,OACrD,EAAM,UAAY,EAAO,UAAY,iBAAiB,EAAO,YAAc,gBAEvE,EAAO,UACV,EAAM,aAAa,OAAQ,EAAO,UAE/B,EAAO,WACV,EAAM,aAAa,aAAc,EAAO,WAGzC,MAAM,EAAiC,EAAO,OAC3C,KAAK,kBAAkB,EAAO,QAC9B,KAEH,IAAI,EACJ,MAAM,EAAsB,CAC3B,MAAQ,GAAgC,KAAK,WAAW,EAAO,GAC/D,WAAA,IAAkB,GAGb,EAAuB,IAC5B,MAAM,EAAsB,EAAE,eAC9B,IAAI,EAAK,SAAS,GAAlB,CAGA,IAAK,MAAM,KAAc,KAAK,MAC7B,GAAI,EAAK,SAAS,EAAW,SAAU,OAIpC,EAAO,kBAAkB,aAAe,EAAK,SAAS,EAAO,SAEjE,KAAK,WAAW,EAVU,GAa3B,EAAQ,CACP,QAAS,EACT,SACA,sBACA,OAAQ,EACR,0BAA2B,KAC3B,0BAA0B,GAG3B,KAAK,MAAM,KAAK,GAEhB,IACC,EAAO,QAAQ,EAAQ,GAAgC,KAAK,WAAW,EAAO,UACtE,GAER,MADA,KAAK,YAAY,GACX,EAGP,OAAK,KAAK,MAAM,SAAS,IAKzB,EAAa,EADS,EAAO,eAAiB,KAAK,eAKnD,EAAc,EADb,EAAO,kBAAkB,YAAc,EAAO,OAAO,wBAA0B,EAAO,OACtD,CAChC,SAAU,EAAO,UAAY,cAC7B,MAAO,KAAK,iBAGb,EAAM,0BAA4B,WAAA,KACjC,EAAM,0BAA4B,KAC7B,KAAK,MAAM,SAAS,KACzB,SAAS,iBAAiB,YAAa,GACvC,EAAM,0BAA2B,IAC/B,GAEH,KAAK,eAAe,GAEb,GAtBC,EA0BT,KAAA,GACC,MAAM,EAA8B,KAAK,MAAM,KAAK,MAAM,OAAS,GAC/D,GACH,KAAK,WAAW,GAKlB,QAAA,GACC,KAAO,KAAK,MAAM,OAAS,GAAG,CAC7B,MAAM,EAA8B,KAAK,MAAM,KAAK,MAAM,OAAS,GAC/D,GACH,KAAK,WAAW,IAMnB,MAAA,GACC,OAAO,KAAK,MAAM,OAAS,EAI5B,OAAA,GACC,KAAK,WAKN,UAAA,CAAmB,EAAmB,GACrC,MAAM,EAAgB,KAAK,MAAM,QAAQ,GACzC,IAAc,IAAV,EAAJ,CAGA,KAAO,KAAK,MAAM,OAAS,EAAQ,GAAG,CACrC,MAAM,EAAgC,KAAK,MAAM,KAAK,MAAM,OAAS,GACjE,GACH,KAAK,YAAY,GAInB,KAAK,YAAY,QAED,IAAZ,GAAyB,mBAAoB,EAChD,EAAQ,gBAAgB,QACd,EAAM,OAAO,gBACvB,EAAM,OAAO,eAAe,QAE7B,EAAM,OAAO,WAjBK,EAoBnB,WAAA,CAAoB,GACnB,MAAM,EAAgB,KAAK,MAAM,QAAQ,IAC3B,IAAV,IAEJ,KAAK,MAAM,OAAO,EAAO,GACe,OAApC,EAAM,4BACT,aAAa,EAAM,2BACnB,EAAM,0BAA4B,MAEnC,EAAM,QAAQ,SACV,EAAM,2BACT,SAAS,oBAAoB,YAAa,EAAM,qBAChD,EAAM,0BAA2B,IAInC,iBAAA,CAA0B,GACzB,MAAM,EAAuB,EAAO,aACpC,OAAO,KAAK,MAAM,KAAM,GAAM,EAAE,UAAY,IAAY,KAIzD,YAAA,GACC,OAAI,KAAK,yBAAyB,aAC1B,EAAa,KAAK,eAK3B,cAAA,CAAuB,GACtB,sBAAA,MAEE,EAAM,cAAc,sBACpB,EAAM,cAAc,oBACpB,EAAM,cAAc,sBACpB,EAAM,cAAc,UACpB,EAAM,cAAc,YACL"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as t,o as e}from"./StyleRuntime-D3d1XFFe.mjs";import{a as o,c as n,f as r,i,m as s,n as c,r as a,t as l}from"./PrintTypes-DTV3-mSe.mjs";import{i as p,o as u}from"./PluginHelpers-D1QF-YaF.mjs";import{t as m}from"./ShortcutFormatting-DE6B8iGs.mjs";import h from"dompurify";var d={label:"Print",tooltip:t=>`Print (${t})`,printingAnnouncement:"Printing"},f=/* @__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-7XO2HmsM.mjs"),"./locales/de.ts":()=>import("./de-DPzOP2Ge.mjs"),"./locales/es.ts":()=>import("./es-Bq_XkuDG.mjs"),"./locales/fr.ts":()=>import("./fr-CXzpB6GU.mjs"),"./locales/hi.ts":()=>import("./hi-xjChf5ZY.mjs"),"./locales/pt.ts":()=>import("./pt-B9c20zi-.mjs"),"./locales/ru.ts":()=>import("./ru-qL1ebv4O.mjs"),"./locales/zh.ts":()=>import("./zh-CT4V3EmW.mjs")});async function g(t){return u(f,t,d)}var v=["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"],y=["style","class","src","alt","width","height","colspan","rowspan"];function b(t){const e="function"==typeof t?t():t;return h.sanitize(e,{ALLOWED_TAGS:[...v],ALLOWED_ATTR:[...y]})}var j={print(){},toHTML:()=>""},w=class{id="print";name="Print";config;service=null;locale;constructor(t){this.config=t??{}}async init(o){this.locale=await p(o,this.config.locale,d,g);const i=o.getContainer(),u=i.getRootNode();if(u instanceof ShadowRoot){const a=u.host;this.service=function(o,i,a,p){function u(t){return t??{}}function m(t){const u={options:t,cancelled:!1};if(p.emit(c,u),u.cancelled)return null;const m=u.options,h=function(t,e,o,n="en"){return["<!DOCTYPE html>",`<html lang="${n}">`,"<head>",'<meta charset="utf-8">',`<title>${o.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}</title>`,`<style>${t}</style>`,"</head>",`<body>${e}</body>`,"</html>"].join("\n")}(function(t,e,o){const i=[],c=function(t){const e=[];for(const o of t.adoptedStyleSheets)for(const t of o.cssRules)e.push(t.cssText);return e.join("\n")}(t);c&&i.push(c);const a=!1!==o.forceLightTheme;if(a)i.push(r(s).replace(":host {",":root {"));else{const t=function(t){const e=getComputedStyle(t),o=[];for(let n=0;n<e.length;n++){const t=e[n]??"";if(t.startsWith("--notectl-")){const n=e.getPropertyValue(t).trim();n&&o.push(` ${t}: ${n};`)}}return 0===o.length?"":`:root {\n${o.join("\n")}\n}`}(e);t&&i.push(t)}const l=a?s.primitives.foreground:void 0;i.push(function(t,e){const o=getComputedStyle(t),n=["font-family","font-size","font-weight","line-height","letter-spacing","word-spacing","color"],r=[" margin: 0;"];for(const i of n){if("color"===i&&e){r.push(` color: ${e};`);continue}const t=o.getPropertyValue(i).trim();t&&r.push(` ${i}: ${t};`)}return`body {\n${r.join("\n")}\n}`}(e,l));const p=function(t){const e=[],o=[];if(t.margin?o.push(` margin: ${t.margin};`):t.paperSize&&o.push(" margin: 0;"),t.paperSize||t.orientation){const e=[t.paperSize?n(t.paperSize):"A4"];t.orientation&&e.push(t.orientation),o.push(` size: ${e.join(" ")};`)}o.length>0&&e.push(`@page {\n${o.join("\n")}\n}`),t.paperSize&&e.push(".notectl-content { padding: 48px 56px !important; }");const r=[];return r.push("[data-notectl-no-print] { display: none !important; }"),r.push(".notectl-code-block { white-space: pre-wrap !important; word-break: break-all !important; page-break-inside: avoid; }"),r.push("img { page-break-inside: avoid; }"),r.push(".notectl-table { break-inside: avoid; }"),!1!==t.printBackground&&r.push("* { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }"),e.push(`@media print {\n ${r.join("\n ")}\n}`),e.join("\n\n")}(o);return p&&i.push(p),o.customCSS&&i.push(o.customCSS),i.join("\n\n")}(o,i,m),function(t,o){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"]){t.classList.remove(e);for(const o of t.querySelectorAll(`.${e}`))o.classList.remove(e)}t.removeAttribute("data-placeholder")}(n),function(t,o){if(o.excludeBlockTypes)for(const e of o.excludeBlockTypes){const o=t.querySelectorAll(`[data-block-type="${e}"]`);for(const t of o)t.remove()}if(o.pageBreakBefore)for(const n of o.pageBreakBefore){const o=t.querySelectorAll(`[data-block-type="${n}"]`);for(const t of o)e(t,{breakBefore:"page",pageBreakBefore:"always"})}}(n,o),function(t,e){if(e.header){const o=document.createElement("div");o.className="notectl-print-header",o.innerHTML=b(e.header),t.insertBefore(o,t.firstChild)}if(e.footer){const o=document.createElement("div");o.className="notectl-print-footer",o.innerHTML=b(e.footer),t.appendChild(o)}}(n,o),n}(a,m).outerHTML,m.title??"",i.closest("[lang]")?.getAttribute("lang")??(document.documentElement.lang||"en")),d={html:h};return p.emit(l,d),h}return{print(e){const o=m(u(e));if(!o)return;const n=document.createElement("iframe");t(n,"position:fixed;left:-9999px;width:0;height:0;border:none"),document.body.appendChild(n);const r=n.contentDocument;if(!r)return void document.body.removeChild(n);r.open(),r.write(o),r.close();const i=()=>{n.remove()};n.contentWindow?(n.contentWindow.addEventListener("afterprint",i,{once:!0}),n.contentWindow.print()):i()},toHTML:t=>m(u(t))??""}}(u,a,i,o.getEventBus())}else this.service=j;o.registerService(a,this.service);const h=this.config.defaults??{},f=this.service,v=this.locale;o.registerCommand("print",()=>(o.announce(v.printingAnnouncement),f.print(h),!0));const y=this.config.keyBinding??"Mod-P";if(o.registerKeymap({[y]:()=>(o.executeCommand("print"),!0)}),!1!==this.config.showToolbarItem){const t=m(y);o.registerToolbarItem({id:"print",group:"actions",label:this.locale.label,tooltip:this.locale.tooltip(t),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=null}};export{d as n,g as r,w as t};
|
|
2
|
-
//# sourceMappingURL=PrintPlugin-DVRybXSN.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PrintPlugin-DVRybXSN.mjs","names":[],"sources":["../../src/plugins/print/PrintLocale.ts","../../src/plugins/print/PrintContentPreparer.ts","../../src/plugins/print/PrintStyleCollector.ts","../../src/plugins/print/PrintServiceImpl.ts","../../src/plugins/print/PrintPlugin.ts"],"sourcesContent":["/** Locale interface and default English locale for the PrintPlugin. */\n\nimport { type LocaleModuleMap, loadLocaleModule } from '../shared/LocaleLoader.js';\n\n// --- Locale Interface ---\n\nexport interface PrintLocale {\n\treadonly label: string;\n\treadonly tooltip: (shortcut: string) => string;\n\treadonly printingAnnouncement: string;\n}\n\n// --- Default English Locale ---\n\nexport const PRINT_LOCALE_EN: PrintLocale = {\n\tlabel: 'Print',\n\ttooltip: (shortcut: string) => `Print (${shortcut})`,\n\tprintingAnnouncement: 'Printing',\n};\n\n// --- Lazy Locale Loader ---\n\nconst localeModules: LocaleModuleMap<PrintLocale> = import.meta.glob<{\n\tdefault: PrintLocale;\n}>('./locales/*.ts', { eager: false });\n\nexport async function loadPrintLocale(lang: string): Promise<PrintLocale> {\n\treturn loadLocaleModule(localeModules, lang, PRINT_LOCALE_EN);\n}\n","/**\n * Prepares editor content for print output.\n * Clones the DOM, sanitizes interactive attributes, applies block filters,\n * and inserts header/footer elements.\n */\n\nimport DOMPurify from 'dompurify';\nimport { setStyleProperties } from '../../style/StyleRuntime.js';\nimport type { PrintOptions } from './PrintTypes.js';\n\n/** Deep-clones the .notectl-content element from the editor container. */\nexport function cloneContent(container: HTMLElement): HTMLElement {\n\tconst content: HTMLElement | null = container.querySelector('.notectl-content');\n\tconst source: HTMLElement = content ?? container;\n\treturn source.cloneNode(true) as HTMLElement;\n}\n\n/** Sanitizes the cloned content for print: removes interactive attributes and selection styling. */\nexport function sanitize(clone: HTMLElement): void {\n\t// Remove contenteditable from the root\n\tclone.removeAttribute('contenteditable');\n\n\t// Remove selection-related CSS classes\n\tconst selectionClasses: readonly string[] = ['notectl-node-selected', 'notectl-content--empty'];\n\tfor (const cls of selectionClasses) {\n\t\tclone.classList.remove(cls);\n\t\tfor (const el of clone.querySelectorAll(`.${cls}`)) {\n\t\t\tel.classList.remove(cls);\n\t\t}\n\t}\n\n\t// Remove data-placeholder to avoid showing placeholder in print\n\tclone.removeAttribute('data-placeholder');\n}\n\n/** Removes excluded block types and applies page-break-before to configured block types. */\nexport function applyBlockFilters(clone: HTMLElement, options: PrintOptions): void {\n\tif (options.excludeBlockTypes) {\n\t\tfor (const type of options.excludeBlockTypes) {\n\t\t\tconst elements: NodeListOf<Element> = clone.querySelectorAll(`[data-block-type=\"${type}\"]`);\n\t\t\tfor (const el of elements) {\n\t\t\t\tel.remove();\n\t\t\t}\n\t\t}\n\t}\n\n\tif (options.pageBreakBefore) {\n\t\tfor (const type of options.pageBreakBefore) {\n\t\t\tconst elements: NodeListOf<Element> = clone.querySelectorAll(`[data-block-type=\"${type}\"]`);\n\t\t\tfor (const el of elements) {\n\t\t\t\tsetStyleProperties(el as HTMLElement, {\n\t\t\t\t\tbreakBefore: 'page',\n\t\t\t\t\tpageBreakBefore: 'always',\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n}\n\n/** Tags allowed in print header/footer content. */\nconst HEADER_FOOTER_ALLOWED_TAGS: readonly string[] = [\n\t'h1',\n\t'h2',\n\t'h3',\n\t'h4',\n\t'h5',\n\t'h6',\n\t'p',\n\t'div',\n\t'span',\n\t'br',\n\t'hr',\n\t'strong',\n\t'b',\n\t'em',\n\t'i',\n\t'u',\n\t's',\n\t'sub',\n\t'sup',\n\t'small',\n\t'ul',\n\t'ol',\n\t'li',\n\t'table',\n\t'thead',\n\t'tbody',\n\t'tr',\n\t'th',\n\t'td',\n\t'img',\n];\n\n/** Attributes allowed in print header/footer content. */\nconst HEADER_FOOTER_ALLOWED_ATTRS: readonly string[] = [\n\t'style',\n\t'class',\n\t'src',\n\t'alt',\n\t'width',\n\t'height',\n\t'colspan',\n\t'rowspan',\n];\n\n/** Resolves a header/footer value to a sanitized HTML string. */\nfunction resolveContent(value: string | (() => string)): string {\n\tconst raw: string = typeof value === 'function' ? value() : value;\n\treturn DOMPurify.sanitize(raw, {\n\t\tALLOWED_TAGS: [...HEADER_FOOTER_ALLOWED_TAGS],\n\t\tALLOWED_ATTR: [...HEADER_FOOTER_ALLOWED_ATTRS],\n\t});\n}\n\n/** Inserts header and footer elements into the cloned content. */\nexport function insertHeaderFooter(clone: HTMLElement, options: PrintOptions): void {\n\tif (options.header) {\n\t\tconst headerEl: HTMLDivElement = document.createElement('div');\n\t\theaderEl.className = 'notectl-print-header';\n\t\theaderEl.innerHTML = resolveContent(options.header);\n\t\tclone.insertBefore(headerEl, clone.firstChild);\n\t}\n\n\tif (options.footer) {\n\t\tconst footerEl: HTMLDivElement = document.createElement('div');\n\t\tfooterEl.className = 'notectl-print-footer';\n\t\tfooterEl.innerHTML = resolveContent(options.footer);\n\t\tclone.appendChild(footerEl);\n\t}\n}\n\n/** Orchestrates all content preparation steps. Returns a ready-to-print DOM element. */\nexport function prepare(container: HTMLElement, options: PrintOptions): HTMLElement {\n\tconst clone: HTMLElement = cloneContent(container);\n\tsanitize(clone);\n\tapplyBlockFilters(clone, options);\n\tinsertHeaderFooter(clone, options);\n\treturn clone;\n}\n","/**\n * Collects and aggregates CSS for print output.\n * Extracts adopted stylesheets, snapshots theme tokens, and generates print-specific CSS.\n */\n\nimport { generateThemeCSS } from '../../editor/theme/ThemeEngine.js';\nimport { LIGHT_THEME } from '../../editor/theme/ThemeTokens.js';\nimport {\n\tPAPER_MARGIN_HORIZONTAL_PX,\n\tPAPER_MARGIN_TOP_PX,\n\tgetPaperCSSSize,\n} from '../../model/PaperSize.js';\nimport type { PrintOptions } from './PrintTypes.js';\n\n/** Extracts CSS text from all adopted stylesheets on a ShadowRoot. */\nexport function extractAdoptedStyles(shadowRoot: ShadowRoot): string {\n\tconst parts: string[] = [];\n\tfor (const sheet of shadowRoot.adoptedStyleSheets) {\n\t\tfor (const rule of sheet.cssRules) {\n\t\t\tparts.push(rule.cssText);\n\t\t}\n\t}\n\treturn parts.join('\\n');\n}\n\n/**\n * Generates light theme CSS custom properties for print output.\n * Uses the static LIGHT_THEME definition rather than reading computed styles,\n * ensuring print output is always readable on paper regardless of the active editor theme.\n */\nexport function generateLightThemeTokens(): string {\n\treturn generateThemeCSS(LIGHT_THEME).replace(':host {', ':root {');\n}\n\n/** Snapshots --notectl-* CSS custom properties from the host element into a :root block. */\nexport function snapshotThemeTokens(host: HTMLElement): string {\n\tconst computed: CSSStyleDeclaration = getComputedStyle(host);\n\tconst tokens: string[] = [];\n\n\tfor (let i = 0; i < computed.length; i++) {\n\t\tconst prop: string = computed[i] ?? '';\n\t\tif (prop.startsWith('--notectl-')) {\n\t\t\tconst value: string = computed.getPropertyValue(prop).trim();\n\t\t\tif (value) {\n\t\t\t\ttokens.push(` ${prop}: ${value};`);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (tokens.length === 0) return '';\n\treturn `:root {\\n${tokens.join('\\n')}\\n}`;\n}\n\n/**\n * Snapshots computed typography from the host element into a `body` rule.\n * In the editor, typography is inherited from `:host` (shadow DOM).\n * The print iframe is a regular document where `:host` doesn't match,\n * so we must apply the same font/line-height explicitly.\n */\nexport function snapshotTypography(host: HTMLElement, colorOverride?: string): string {\n\tconst computed: CSSStyleDeclaration = getComputedStyle(host);\n\tconst props: string[] = [\n\t\t'font-family',\n\t\t'font-size',\n\t\t'font-weight',\n\t\t'line-height',\n\t\t'letter-spacing',\n\t\t'word-spacing',\n\t\t'color',\n\t];\n\tconst rules: string[] = [' margin: 0;'];\n\tfor (const prop of props) {\n\t\tif (prop === 'color' && colorOverride) {\n\t\t\trules.push(` color: ${colorOverride};`);\n\t\t\tcontinue;\n\t\t}\n\t\tconst value: string = computed.getPropertyValue(prop).trim();\n\t\tif (value) {\n\t\t\trules.push(` ${prop}: ${value};`);\n\t\t}\n\t}\n\treturn `body {\\n${rules.join('\\n')}\\n}`;\n}\n\n/** Generates print-specific CSS rules based on PrintOptions. */\nexport function generatePrintCSS(options: PrintOptions): string {\n\tconst parts: string[] = [];\n\n\t// @page rule\n\tconst pageProps: string[] = [];\n\tif (options.margin) {\n\t\tpageProps.push(` margin: ${options.margin};`);\n\t} else if (options.paperSize) {\n\t\t// WYSIWYG: zero @page margin so body = full paper width;\n\t\t// document margins are applied as content padding below.\n\t\tpageProps.push(' margin: 0;');\n\t}\n\tif (options.paperSize || options.orientation) {\n\t\tconst sizeKeyword: string = options.paperSize ? getPaperCSSSize(options.paperSize) : 'A4';\n\t\tconst sizeParts: string[] = [sizeKeyword];\n\t\tif (options.orientation) {\n\t\t\tsizeParts.push(options.orientation);\n\t\t}\n\t\tpageProps.push(` size: ${sizeParts.join(' ')};`);\n\t}\n\tif (pageProps.length > 0) {\n\t\tparts.push(`@page {\\n${pageProps.join('\\n')}\\n}`);\n\t}\n\n\t// WYSIWYG: apply paper-mode document margins to print content\n\tif (options.paperSize) {\n\t\tparts.push(\n\t\t\t`.notectl-content { padding: ${PAPER_MARGIN_TOP_PX}px ${PAPER_MARGIN_HORIZONTAL_PX}px !important; }`,\n\t\t);\n\t}\n\n\t// Print media rules\n\tconst printRules: string[] = [];\n\n\t// Hide non-printable elements\n\tprintRules.push('[data-notectl-no-print] { display: none !important; }');\n\n\t// Code blocks: preserve background, force wrapping\n\tprintRules.push(\n\t\t'.notectl-code-block { white-space: pre-wrap !important; ' +\n\t\t\t'word-break: break-all !important; page-break-inside: avoid; }',\n\t);\n\n\t// Images: avoid page breaks\n\tprintRules.push('img { page-break-inside: avoid; }');\n\n\t// Tables: avoid page breaks\n\tprintRules.push('.notectl-table { break-inside: avoid; }');\n\n\t// Preserve background colors and images in print output (WYSIWYG default).\n\t// Only omitted when the consumer explicitly opts out via printBackground: false.\n\tif (options.printBackground !== false) {\n\t\tprintRules.push(\n\t\t\t'* { -webkit-print-color-adjust: exact !important; ' +\n\t\t\t\t'print-color-adjust: exact !important; }',\n\t\t);\n\t}\n\n\tparts.push(`@media print {\\n ${printRules.join('\\n ')}\\n}`);\n\n\treturn parts.join('\\n\\n');\n}\n\n/** Collects all CSS needed for print: adopted styles, theme tokens, print CSS, and custom CSS. */\nexport function collectAll(\n\tshadowRoot: ShadowRoot,\n\thost: HTMLElement,\n\toptions: PrintOptions,\n): string {\n\tconst parts: string[] = [];\n\n\tconst adopted: string = extractAdoptedStyles(shadowRoot);\n\tif (adopted) parts.push(adopted);\n\n\tconst forceLightTheme: boolean = options.forceLightTheme !== false;\n\n\tif (forceLightTheme) {\n\t\tparts.push(generateLightThemeTokens());\n\t} else {\n\t\tconst theme: string = snapshotThemeTokens(host);\n\t\tif (theme) parts.push(theme);\n\t}\n\n\t// WYSIWYG: snapshot host typography so the print iframe matches the editor.\n\t// In the editor, .notectl-content inherits font from :host (shadow DOM).\n\t// The print iframe is a regular document where :host doesn't apply.\n\tconst colorOverride: string | undefined = forceLightTheme\n\t\t? LIGHT_THEME.primitives.foreground\n\t\t: undefined;\n\tparts.push(snapshotTypography(host, colorOverride));\n\n\tconst printCSS: string = generatePrintCSS(options);\n\tif (printCSS) parts.push(printCSS);\n\n\tif (options.customCSS) {\n\t\tparts.push(options.customCSS);\n\t}\n\n\treturn parts.join('\\n\\n');\n}\n","/**\n * PrintService implementation.\n * Handles the synchronous print flow: event emission, style collection,\n * content preparation, iframe creation, and cleanup.\n */\n\nimport { setStyleText } from '../../style/StyleRuntime.js';\nimport type { PluginEventBus } from '../Plugin.js';\nimport { prepare } from './PrintContentPreparer.js';\nimport { collectAll } from './PrintStyleCollector.js';\nimport {\n\tAFTER_PRINT,\n\ttype AfterPrintEvent,\n\tBEFORE_PRINT,\n\ttype BeforePrintEvent,\n\ttype PrintOptions,\n\ttype PrintService,\n} from './PrintTypes.js';\n\n/** Escapes HTML special characters in a plain-text string. */\nfunction escapeHTML(text: string): string {\n\treturn text.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');\n}\n\n/** Builds a complete HTML document string from CSS, body content, and title. */\nexport function buildHTMLDocument(\n\tcss: string,\n\tcontent: string,\n\ttitle: string,\n\tlang = 'en',\n): string {\n\tconst safeTitle: string = escapeHTML(title);\n\treturn [\n\t\t'<!DOCTYPE html>',\n\t\t`<html lang=\"${lang}\">`,\n\t\t'<head>',\n\t\t`<meta charset=\"utf-8\">`,\n\t\t`<title>${safeTitle}</title>`,\n\t\t`<style>${css}</style>`,\n\t\t'</head>',\n\t\t`<body>${content}</body>`,\n\t\t'</html>',\n\t].join('\\n');\n}\n\n/** Creates and returns the PrintService implementation. */\nexport function createPrintService(\n\tshadowRoot: ShadowRoot,\n\thost: HTMLElement,\n\tcontainer: HTMLElement,\n\teventBus: PluginEventBus,\n): PrintService {\n\tfunction mergeOptions(options?: PrintOptions): PrintOptions {\n\t\treturn options ?? {};\n\t}\n\n\tfunction executePrint(options: PrintOptions): string | null {\n\t\t// 1. Emit BEFORE_PRINT — listeners can mutate options or cancel\n\t\tconst beforeEvent: BeforePrintEvent = {\n\t\t\toptions,\n\t\t\tcancelled: false,\n\t\t};\n\t\teventBus.emit(BEFORE_PRINT, beforeEvent);\n\n\t\tif (beforeEvent.cancelled) return null;\n\n\t\tconst finalOptions: PrintOptions = beforeEvent.options;\n\n\t\t// 2. Collect styles\n\t\tconst css: string = collectAll(shadowRoot, host, finalOptions);\n\n\t\t// 3. Prepare content\n\t\tconst clone: HTMLElement = prepare(container, finalOptions);\n\t\tconst contentHTML: string = clone.outerHTML;\n\n\t\t// 4. Build HTML document\n\t\tconst title: string = finalOptions.title ?? '';\n\t\tconst lang: string =\n\t\t\thost.closest('[lang]')?.getAttribute('lang') ?? (document.documentElement.lang || 'en');\n\t\tconst html: string = buildHTMLDocument(css, contentHTML, title, lang);\n\n\t\t// 5. Emit AFTER_PRINT\n\t\tconst afterEvent: AfterPrintEvent = { html };\n\t\teventBus.emit(AFTER_PRINT, afterEvent);\n\n\t\treturn html;\n\t}\n\n\treturn {\n\t\tprint(options?: PrintOptions): void {\n\t\t\tconst resolved: PrintOptions = mergeOptions(options);\n\t\t\tconst html: string | null = executePrint(resolved);\n\t\t\tif (!html) return;\n\n\t\t\t// Create hidden iframe\n\t\t\tconst iframe: HTMLIFrameElement = document.createElement('iframe');\n\t\t\tsetStyleText(iframe, 'position:fixed;left:-9999px;width:0;height:0;border:none');\n\t\t\tdocument.body.appendChild(iframe);\n\n\t\t\tconst iframeDoc: Document | null = iframe.contentDocument;\n\t\t\tif (!iframeDoc) {\n\t\t\t\tdocument.body.removeChild(iframe);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tiframeDoc.open();\n\t\t\tiframeDoc.write(html);\n\t\t\tiframeDoc.close();\n\n\t\t\tconst cleanup = (): void => {\n\t\t\t\tiframe.remove();\n\t\t\t};\n\n\t\t\t// Defer cleanup until print dialog closes\n\t\t\tif (iframe.contentWindow) {\n\t\t\t\tiframe.contentWindow.addEventListener('afterprint', cleanup, { once: true });\n\t\t\t\tiframe.contentWindow.print();\n\t\t\t} else {\n\t\t\t\tcleanup();\n\t\t\t}\n\t\t},\n\n\t\ttoHTML(options?: PrintOptions): string {\n\t\t\tconst resolved: PrintOptions = mergeOptions(options);\n\t\t\treturn executePrint(resolved) ?? '';\n\t\t},\n\t};\n}\n","/**\n * PrintPlugin: provides print functionality for the notectl editor.\n * Registers a command, keymap, toolbar item, and exposes a PrintService.\n * Orchestrator only — delegates all logic to PrintServiceImpl, PrintStyleCollector,\n * and PrintContentPreparer.\n */\n\nimport type { Plugin, PluginContext } from '../Plugin.js';\nimport { resolveLocale } from '../shared/PluginHelpers.js';\nimport { formatShortcut } from '../shared/ShortcutFormatting.js';\nimport { PRINT_LOCALE_EN, type PrintLocale, loadPrintLocale } from './PrintLocale.js';\nimport { createPrintService } from './PrintServiceImpl.js';\nimport type { PrintOptions, PrintPluginConfig, PrintService } from './PrintTypes.js';\nimport { PRINT_SERVICE_KEY } from './PrintTypes.js';\n\nconst PRINT_ICON: string =\n\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">' +\n\t'<path d=\"M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3' +\n\t' 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-1-9H6v4h12V3z\"/>' +\n\t'</svg>';\n\n/** No-op fallback service for environments without ShadowRoot. */\nconst NOOP_SERVICE: PrintService = {\n\tprint(): void {},\n\ttoHTML(): string {\n\t\treturn '';\n\t},\n};\n\nexport class PrintPlugin implements Plugin {\n\treadonly id = 'print';\n\treadonly name = 'Print';\n\n\tprivate readonly config: PrintPluginConfig;\n\tprivate service: PrintService | null = null;\n\tprivate locale!: PrintLocale;\n\n\tconstructor(config?: PrintPluginConfig) {\n\t\tthis.config = config ?? {};\n\t}\n\n\tasync init(context: PluginContext): Promise<void> {\n\t\tthis.locale = await resolveLocale(\n\t\t\tcontext,\n\t\t\tthis.config.locale,\n\t\t\tPRINT_LOCALE_EN,\n\t\t\tloadPrintLocale,\n\t\t);\n\t\tconst container: HTMLElement = context.getContainer();\n\t\tconst rootNode: Node = container.getRootNode();\n\n\t\tif (rootNode instanceof ShadowRoot) {\n\t\t\tconst host: HTMLElement = rootNode.host as HTMLElement;\n\t\t\tconst eventBus = context.getEventBus();\n\t\t\tthis.service = createPrintService(rootNode, host, container, eventBus);\n\t\t} else {\n\t\t\tthis.service = NOOP_SERVICE;\n\t\t}\n\n\t\tcontext.registerService(PRINT_SERVICE_KEY, this.service);\n\n\t\tconst defaults: PrintOptions = this.config.defaults ?? {};\n\t\tconst service: PrintService = this.service;\n\n\t\tconst printLocale = this.locale;\n\t\tcontext.registerCommand('print', () => {\n\t\t\tcontext.announce(printLocale.printingAnnouncement);\n\t\t\tservice.print(defaults);\n\t\t\treturn true;\n\t\t});\n\n\t\tconst keyBinding: string = this.config.keyBinding ?? 'Mod-P';\n\t\tcontext.registerKeymap({\n\t\t\t[keyBinding]: () => {\n\t\t\t\tcontext.executeCommand('print');\n\t\t\t\treturn true;\n\t\t\t},\n\t\t});\n\n\t\tif (this.config.showToolbarItem !== false) {\n\t\t\tconst shortcut: string = formatShortcut(keyBinding);\n\t\t\tcontext.registerToolbarItem({\n\t\t\t\tid: 'print',\n\t\t\t\tgroup: 'actions',\n\t\t\t\tlabel: this.locale.label,\n\t\t\t\ttooltip: this.locale.tooltip(shortcut),\n\t\t\t\ticon: PRINT_ICON,\n\t\t\t\tcommand: 'print',\n\t\t\t});\n\t\t}\n\t}\n\n\tdestroy(): void {\n\t\tthis.service = null;\n\t}\n}\n"],"mappings":"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"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{n as e,t as o}from"./Plugin-BUNGKupW.mjs";import{i as t,n as r,r as n,t as c}from"./SyntaxTokenTypes-CVUAMov0.mjs";var a={Light:"light",Dark:"dark",System:"system"},d={name:"light",primitives:{background:"#ffffff",foreground:"#1a1a1a",mutedForeground:"#666666",border:"#d0d0d0",borderFocus:"#4a90d9",primary:"#4a90d9",primaryForeground:"#1a5fa0",primaryMuted:"#d0e0f0",surfaceRaised:"#f8f8f8",surfaceOverlay:"#ffffff",hoverBackground:"#e8e8e8",activeBackground:"#d0e0f0",danger:"#dc2626",dangerMuted:"#fee2e2",success:"#1a8c1a",shadow:"rgba(0, 0, 0, 0.15)",focusRing:"rgba(74, 144, 217, 0.2)"},inlineCode:{background:"#edf0f5",foreground:"#334155"},codeBlock:{background:"#f8fafc",foreground:"#334155",headerBackground:"#f1f5f9",headerForeground:"#64748b",headerBorder:"#e2e8f0",syntax:{keyword:"#d73a49",string:"#032f62",comment:{color:"#6a737d",fontStyle:"italic"},number:"#005cc5",function:"#6f42c1",operator:"#d73a49",punctuation:"#24292e",boolean:"#005cc5",null:"#005cc5",property:"#005cc5",type:"#e36209",annotation:"#6f42c1",tag:"#22863a",attribute:"#6f42c1",constant:"#005cc5",regex:"#032f62"}},tooltip:{background:"#1a1a1a",foreground:"#ffffff"}},i={name:"dark",primitives:{background:"#1e1e2e",foreground:"#cdd6f4",mutedForeground:"#7f849c",border:"#45475a",borderFocus:"#89b4fa",primary:"#89b4fa",primaryForeground:"#89b4fa",primaryMuted:"rgba(137, 180, 250, 0.15)",surfaceRaised:"#313244",surfaceOverlay:"#313244",hoverBackground:"#45475a",activeBackground:"rgba(137, 180, 250, 0.15)",danger:"#f38ba8",dangerMuted:"rgba(243, 139, 168, 0.15)",success:"#a6e3a1",shadow:"rgba(0, 0, 0, 0.4)",focusRing:"rgba(137, 180, 250, 0.25)"},inlineCode:{background:"#313244",foreground:"#cdd6f4"},codeBlock:{background:"#313244",foreground:"#cdd6f4",headerBackground:"#45475a",headerForeground:"#bac2de",headerBorder:"#585b70",syntax:{keyword:"#cba6f7",string:"#a6e3a1",comment:{color:"#9399b2",fontStyle:"italic"},number:"#fab387",function:"#89b4fa",operator:"#89dceb",punctuation:"#bac2de",boolean:"#fab387",null:"#f38ba8",property:"#89b4fa",type:"#fab387",annotation:"#cba6f7",tag:"#a6e3a1",attribute:"#89b4fa",constant:"#f9e2af",regex:"#a6e3a1"}},tooltip:{background:"#585b70",foreground:"#cdd6f4"}};function l(e,o){return{name:o.name,primitives:{...e.primitives,...o.primitives},toolbar:o.toolbar?{...e.toolbar,...o.toolbar}:e.toolbar,inlineCode:o.inlineCode?{...e.inlineCode,...o.inlineCode}:e.inlineCode,codeBlock:o.codeBlock?{...e.codeBlock,...o.codeBlock,syntax:o.codeBlock?.syntax?e.codeBlock?.syntax?{...e.codeBlock.syntax,...o.codeBlock.syntax}:void 0:e.codeBlock?.syntax}:e.codeBlock,tooltip:o.tooltip?{...e.tooltip,...o.tooltip}:e.tooltip}}function s(e){if("object"==typeof e)return e;switch(e){case a.Light:return d;case a.Dark:return i;default:return d}}var f=[["primitives.background","--notectl-bg"],["primitives.foreground","--notectl-fg"],["primitives.mutedForeground","--notectl-fg-muted"],["primitives.border","--notectl-border"],["primitives.borderFocus","--notectl-border-focus"],["primitives.primary","--notectl-primary"],["primitives.primaryForeground","--notectl-primary-fg"],["primitives.primaryMuted","--notectl-primary-muted"],["primitives.surfaceRaised","--notectl-surface-raised"],["primitives.surfaceOverlay","--notectl-surface-overlay"],["primitives.hoverBackground","--notectl-hover-bg"],["primitives.activeBackground","--notectl-active-bg"],["primitives.danger","--notectl-danger"],["primitives.dangerMuted","--notectl-danger-muted"],["primitives.success","--notectl-success"],["primitives.shadow","--notectl-shadow"],["primitives.focusRing","--notectl-focus-ring"],["toolbar.background","--notectl-toolbar-bg"],["toolbar.borderColor","--notectl-toolbar-border"],["inlineCode.background","--notectl-code-bg"],["inlineCode.foreground","--notectl-code-color"],["codeBlock.background","--notectl-code-block-bg"],["codeBlock.foreground","--notectl-code-block-color"],["codeBlock.headerBackground","--notectl-code-block-header-bg"],["codeBlock.headerForeground","--notectl-code-block-header-color"],["codeBlock.headerBorder","--notectl-code-block-header-border"],["tooltip.background","--notectl-tooltip-bg"],["tooltip.foreground","--notectl-tooltip-fg"],...c.map(e=>[`codeBlock.syntax.${e}`,`--notectl-code-token-${e}`])],u=c.map(e=>[`--notectl-code-token-${e}`,"var(--notectl-code-block-color)"]),g=new Map([["--notectl-toolbar-bg","var(--notectl-surface-raised)"],["--notectl-toolbar-border","var(--notectl-border)"],["--notectl-code-bg","var(--notectl-surface-raised)"],["--notectl-code-color","var(--notectl-fg)"],["--notectl-code-block-bg","var(--notectl-surface-raised)"],["--notectl-code-block-color","var(--notectl-fg)"],["--notectl-code-block-header-bg","var(--notectl-surface-raised)"],["--notectl-code-block-header-color","var(--notectl-fg-muted)"],["--notectl-code-block-header-border","var(--notectl-border)"],["--notectl-tooltip-bg","var(--notectl-fg)"],["--notectl-tooltip-fg","var(--notectl-bg)"],...u]);function b(e,o){const t=o.split(".");let n=e;for(const r of t){if(null==n)return;if("object"!=typeof n)return;n=n[r]}return"string"==typeof n?n:"object"==typeof n&&null!==n&&"color"in n?r(n):void 0}function p(e){const o=[":host {"];for(const[t,r]of f){const n=b(e,t);if(void 0!==n)o.push(`\t${r}: ${n};`);else{const e=g.get(r);e&&o.push(`\t${r}: ${e};`)}}return e.codeBlock?.syntax&&function(e,o){for(const r of c){const c=e[r];if("object"!=typeof c)continue;const a=n(c);a&&o.push(`\t--notectl-code-token-${r}-font-style: ${a};`);const d=t(c);d&&o.push(`\t--notectl-code-token-${r}-font-weight: ${d};`)}}(e.codeBlock.syntax,o),o.push("}"),o.join("\n")}function m(e){const o=new CSSStyleSheet;return o.replaceSync(p(e)),o}var k=96/25.4,h={DINA4:"din-a4",DINA5:"din-a5",USLetter:"us-letter",USLegal:"us-legal"};function v(e){return Math.round(e*k)}var y=new Map([[h.DINA4,{widthMm:210,heightMm:297,widthPx:v(210),heightPx:v(297)}],[h.DINA5,{widthMm:148,heightMm:210,widthPx:v(148),heightPx:v(210)}],[h.USLetter,{widthMm:215.9,heightMm:279.4,widthPx:v(215.9),heightPx:v(279.4)}],[h.USLegal,{widthMm:215.9,heightMm:355.6,widthPx:v(215.9),heightPx:v(355.6)}]]),B=new Map([[h.DINA4,"A4"],[h.DINA5,"A5"],[h.USLetter,"letter"],[h.USLegal,"legal"]]);function w(e){const o=y.get(e);if(!o)throw new Error(`Unknown paper size: ${e}`);return o}var x=48,M=56,S=24;function $(e){return Object.values(h).includes(e)}function F(e){const o=B.get(e);if(!o)throw new Error(`Unknown paper size: ${e}`);return o}var C=new e("print"),P=new o("print:before"),j=new o("print:after");export{s as _,x as a,F as c,m as d,p as f,l as g,a as h,M as i,w as l,d as m,P as n,S as o,i as p,C as r,h as s,j as t,$ as u};
|
|
2
|
-
//# sourceMappingURL=PrintTypes-DTV3-mSe.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PrintTypes-DTV3-mSe.mjs","names":[],"sources":["../../src/editor/theme/ThemeTokens.ts","../../src/editor/theme/ThemeEngine.ts","../../src/model/PaperSize.ts","../../src/plugins/print/PrintTypes.ts"],"sourcesContent":["/**\n * Theme token types, built-in themes, and theme creation helpers.\n */\n\nimport type { SyntaxTokenType, TokenStyleValue } from './SyntaxTokenTypes.js';\nimport { resolveTokenColor } from './SyntaxTokenTypes.js';\n\n/** Primitive color palette a theme defines. */\nexport interface ThemePrimitives {\n\treadonly background: string;\n\treadonly foreground: string;\n\treadonly mutedForeground: string;\n\treadonly border: string;\n\treadonly borderFocus: string;\n\treadonly primary: string;\n\treadonly primaryForeground: string;\n\treadonly primaryMuted: string;\n\treadonly surfaceRaised: string;\n\treadonly surfaceOverlay: string;\n\treadonly hoverBackground: string;\n\treadonly activeBackground: string;\n\treadonly danger: string;\n\treadonly dangerMuted: string;\n\treadonly success: string;\n\treadonly shadow: string;\n\treadonly focusRing: string;\n}\n\n/** Component-level toolbar overrides. */\nexport interface ThemeToolbar {\n\treadonly background: string;\n\treadonly borderColor: string;\n}\n\n/** Syntax highlighting token styles — one entry per canonical token type. */\nexport type ThemeSyntax = { readonly [K in SyntaxTokenType]: TokenStyleValue };\n\n/** Component-level code block overrides. */\nexport interface ThemeCodeBlock {\n\treadonly background: string;\n\treadonly foreground: string;\n\treadonly headerBackground: string;\n\treadonly headerForeground: string;\n\treadonly headerBorder: string;\n\treadonly syntax?: ThemeSyntax;\n}\n\n/** Component-level inline code overrides. */\nexport interface ThemeInlineCode {\n\treadonly background: string;\n\treadonly foreground: string;\n}\n\n/** Component-level tooltip overrides. */\nexport interface ThemeTooltip {\n\treadonly background: string;\n\treadonly foreground: string;\n}\n\n/** Full theme definition. */\nexport interface Theme {\n\treadonly name: string;\n\treadonly primitives: ThemePrimitives;\n\treadonly toolbar?: Partial<ThemeToolbar>;\n\treadonly inlineCode?: Partial<ThemeInlineCode>;\n\treadonly codeBlock?: Partial<ThemeCodeBlock>;\n\treadonly tooltip?: Partial<ThemeTooltip>;\n}\n\n/** Partial custom theme — deeply partial for creating overrides. */\nexport interface PartialTheme {\n\treadonly name: string;\n\treadonly primitives?: Partial<ThemePrimitives>;\n\treadonly toolbar?: Partial<ThemeToolbar>;\n\treadonly inlineCode?: Partial<ThemeInlineCode>;\n\treadonly codeBlock?: Partial<Omit<ThemeCodeBlock, 'syntax'>> & {\n\t\treadonly syntax?: Partial<ThemeSyntax>;\n\t};\n\treadonly tooltip?: Partial<ThemeTooltip>;\n}\n\n/** Built-in theme presets. */\nexport const ThemePreset = {\n\tLight: 'light',\n\tDark: 'dark',\n\tSystem: 'system',\n} as const;\nexport type ThemePreset = (typeof ThemePreset)[keyof typeof ThemePreset];\n\n/** Built-in light theme. */\nexport const LIGHT_THEME: Theme = {\n\tname: 'light',\n\tprimitives: {\n\t\tbackground: '#ffffff',\n\t\tforeground: '#1a1a1a',\n\t\tmutedForeground: '#666666',\n\t\tborder: '#d0d0d0',\n\t\tborderFocus: '#4a90d9',\n\t\tprimary: '#4a90d9',\n\t\tprimaryForeground: '#1a5fa0',\n\t\tprimaryMuted: '#d0e0f0',\n\t\tsurfaceRaised: '#f8f8f8',\n\t\tsurfaceOverlay: '#ffffff',\n\t\thoverBackground: '#e8e8e8',\n\t\tactiveBackground: '#d0e0f0',\n\t\tdanger: '#dc2626',\n\t\tdangerMuted: '#fee2e2',\n\t\tsuccess: '#1a8c1a',\n\t\tshadow: 'rgba(0, 0, 0, 0.15)',\n\t\tfocusRing: 'rgba(74, 144, 217, 0.2)',\n\t},\n\tinlineCode: {\n\t\tbackground: '#edf0f5',\n\t\tforeground: '#334155',\n\t},\n\tcodeBlock: {\n\t\tbackground: '#f8fafc',\n\t\tforeground: '#334155',\n\t\theaderBackground: '#f1f5f9',\n\t\theaderForeground: '#64748b',\n\t\theaderBorder: '#e2e8f0',\n\t\tsyntax: {\n\t\t\tkeyword: '#d73a49',\n\t\t\tstring: '#032f62',\n\t\t\tcomment: { color: '#6a737d', fontStyle: 'italic' },\n\t\t\tnumber: '#005cc5',\n\t\t\tfunction: '#6f42c1',\n\t\t\toperator: '#d73a49',\n\t\t\tpunctuation: '#24292e',\n\t\t\tboolean: '#005cc5',\n\t\t\tnull: '#005cc5',\n\t\t\tproperty: '#005cc5',\n\t\t\ttype: '#e36209',\n\t\t\tannotation: '#6f42c1',\n\t\t\ttag: '#22863a',\n\t\t\tattribute: '#6f42c1',\n\t\t\tconstant: '#005cc5',\n\t\t\tregex: '#032f62',\n\t\t},\n\t},\n\ttooltip: {\n\t\tbackground: '#1a1a1a',\n\t\tforeground: '#ffffff',\n\t},\n};\n\n/** Built-in dark theme. */\nexport const DARK_THEME: Theme = {\n\tname: 'dark',\n\tprimitives: {\n\t\tbackground: '#1e1e2e',\n\t\tforeground: '#cdd6f4',\n\t\tmutedForeground: '#7f849c',\n\t\tborder: '#45475a',\n\t\tborderFocus: '#89b4fa',\n\t\tprimary: '#89b4fa',\n\t\tprimaryForeground: '#89b4fa',\n\t\tprimaryMuted: 'rgba(137, 180, 250, 0.15)',\n\t\tsurfaceRaised: '#313244',\n\t\tsurfaceOverlay: '#313244',\n\t\thoverBackground: '#45475a',\n\t\tactiveBackground: 'rgba(137, 180, 250, 0.15)',\n\t\tdanger: '#f38ba8',\n\t\tdangerMuted: 'rgba(243, 139, 168, 0.15)',\n\t\tsuccess: '#a6e3a1',\n\t\tshadow: 'rgba(0, 0, 0, 0.4)',\n\t\tfocusRing: 'rgba(137, 180, 250, 0.25)',\n\t},\n\tinlineCode: {\n\t\tbackground: '#313244',\n\t\tforeground: '#cdd6f4',\n\t},\n\tcodeBlock: {\n\t\tbackground: '#313244',\n\t\tforeground: '#cdd6f4',\n\t\theaderBackground: '#45475a',\n\t\theaderForeground: '#bac2de',\n\t\theaderBorder: '#585b70',\n\t\tsyntax: {\n\t\t\tkeyword: '#cba6f7',\n\t\t\tstring: '#a6e3a1',\n\t\t\tcomment: { color: '#9399b2', fontStyle: 'italic' },\n\t\t\tnumber: '#fab387',\n\t\t\tfunction: '#89b4fa',\n\t\t\toperator: '#89dceb',\n\t\t\tpunctuation: '#bac2de',\n\t\t\tboolean: '#fab387',\n\t\t\tnull: '#f38ba8',\n\t\t\tproperty: '#89b4fa',\n\t\t\ttype: '#fab387',\n\t\t\tannotation: '#cba6f7',\n\t\t\ttag: '#a6e3a1',\n\t\t\tattribute: '#89b4fa',\n\t\t\tconstant: '#f9e2af',\n\t\t\tregex: '#a6e3a1',\n\t\t},\n\t},\n\ttooltip: {\n\t\tbackground: '#585b70',\n\t\tforeground: '#cdd6f4',\n\t},\n};\n\n/** Creates a custom theme by extending a base theme with partial overrides. */\nexport function createTheme(base: Theme, overrides: PartialTheme): Theme {\n\tconst mergeSyntax = (): ThemeSyntax | undefined => {\n\t\tif (!overrides.codeBlock?.syntax) return base.codeBlock?.syntax;\n\t\tif (!base.codeBlock?.syntax) return undefined;\n\t\treturn { ...base.codeBlock.syntax, ...overrides.codeBlock.syntax } as ThemeSyntax;\n\t};\n\n\treturn {\n\t\tname: overrides.name,\n\t\tprimitives: { ...base.primitives, ...overrides.primitives },\n\t\ttoolbar: overrides.toolbar ? { ...base.toolbar, ...overrides.toolbar } : base.toolbar,\n\t\tinlineCode: overrides.inlineCode\n\t\t\t? { ...base.inlineCode, ...overrides.inlineCode }\n\t\t\t: base.inlineCode,\n\t\tcodeBlock: overrides.codeBlock\n\t\t\t? {\n\t\t\t\t\t...base.codeBlock,\n\t\t\t\t\t...overrides.codeBlock,\n\t\t\t\t\tsyntax: mergeSyntax(),\n\t\t\t\t}\n\t\t\t: base.codeBlock,\n\t\ttooltip: overrides.tooltip ? { ...base.tooltip, ...overrides.tooltip } : base.tooltip,\n\t};\n}\n\n// Re-export for convenience — avoids extra imports in consumer code.\nexport { resolveTokenColor };\n\n/** Resolves a ThemePreset string or Theme object to a full Theme. */\nexport function resolveTheme(theme: ThemePreset | Theme): Theme {\n\tif (typeof theme === 'object') return theme;\n\tswitch (theme) {\n\t\tcase ThemePreset.Light:\n\t\t\treturn LIGHT_THEME;\n\t\tcase ThemePreset.Dark:\n\t\t\treturn DARK_THEME;\n\t\tcase ThemePreset.System:\n\t\t\t// System is resolved externally via matchMedia; default to light.\n\t\t\treturn LIGHT_THEME;\n\t\tdefault:\n\t\t\treturn LIGHT_THEME;\n\t}\n}\n","/**\n * Theme engine — converts a Theme object into CSS custom properties.\n */\n\nimport {\n\tSYNTAX_TOKEN_TYPES,\n\tresolveTokenColor,\n\tresolveTokenFontStyle,\n\tresolveTokenFontWeight,\n} from './SyntaxTokenTypes.js';\nimport type { TokenStyleValue } from './SyntaxTokenTypes.js';\nimport type { Theme, ThemeSyntax } from './ThemeTokens.js';\n\n// --- Static entries (non-syntax) ---\n\nconst STATIC_ENTRIES: ReadonlyArray<readonly [string, string]> = [\n\t// Primitives\n\t['primitives.background', '--notectl-bg'],\n\t['primitives.foreground', '--notectl-fg'],\n\t['primitives.mutedForeground', '--notectl-fg-muted'],\n\t['primitives.border', '--notectl-border'],\n\t['primitives.borderFocus', '--notectl-border-focus'],\n\t['primitives.primary', '--notectl-primary'],\n\t['primitives.primaryForeground', '--notectl-primary-fg'],\n\t['primitives.primaryMuted', '--notectl-primary-muted'],\n\t['primitives.surfaceRaised', '--notectl-surface-raised'],\n\t['primitives.surfaceOverlay', '--notectl-surface-overlay'],\n\t['primitives.hoverBackground', '--notectl-hover-bg'],\n\t['primitives.activeBackground', '--notectl-active-bg'],\n\t['primitives.danger', '--notectl-danger'],\n\t['primitives.dangerMuted', '--notectl-danger-muted'],\n\t['primitives.success', '--notectl-success'],\n\t['primitives.shadow', '--notectl-shadow'],\n\t['primitives.focusRing', '--notectl-focus-ring'],\n\t// Component: toolbar\n\t['toolbar.background', '--notectl-toolbar-bg'],\n\t['toolbar.borderColor', '--notectl-toolbar-border'],\n\t// Component: inlineCode\n\t['inlineCode.background', '--notectl-code-bg'],\n\t['inlineCode.foreground', '--notectl-code-color'],\n\t// Component: codeBlock (non-syntax)\n\t['codeBlock.background', '--notectl-code-block-bg'],\n\t['codeBlock.foreground', '--notectl-code-block-color'],\n\t['codeBlock.headerBackground', '--notectl-code-block-header-bg'],\n\t['codeBlock.headerForeground', '--notectl-code-block-header-color'],\n\t['codeBlock.headerBorder', '--notectl-code-block-header-border'],\n\t// Component: tooltip\n\t['tooltip.background', '--notectl-tooltip-bg'],\n\t['tooltip.foreground', '--notectl-tooltip-fg'],\n];\n\n// --- Generated syntax variable map (derived from SYNTAX_TOKEN_TYPES) ---\n\nconst SYNTAX_VARIABLE_MAP: ReadonlyArray<readonly [string, string]> = SYNTAX_TOKEN_TYPES.map(\n\t(type) => [`codeBlock.syntax.${type}`, `--notectl-code-token-${type}`] as const,\n);\n\n/** Full variable map: static entries + syntax entries. */\nconst VARIABLE_MAP: ReadonlyArray<readonly [string, string]> = [\n\t...STATIC_ENTRIES,\n\t...SYNTAX_VARIABLE_MAP,\n];\n\n// --- Static fallbacks (non-syntax) ---\n\nconst STATIC_FALLBACKS: ReadonlyArray<readonly [string, string]> = [\n\t['--notectl-toolbar-bg', 'var(--notectl-surface-raised)'],\n\t['--notectl-toolbar-border', 'var(--notectl-border)'],\n\t['--notectl-code-bg', 'var(--notectl-surface-raised)'],\n\t['--notectl-code-color', 'var(--notectl-fg)'],\n\t['--notectl-code-block-bg', 'var(--notectl-surface-raised)'],\n\t['--notectl-code-block-color', 'var(--notectl-fg)'],\n\t['--notectl-code-block-header-bg', 'var(--notectl-surface-raised)'],\n\t['--notectl-code-block-header-color', 'var(--notectl-fg-muted)'],\n\t['--notectl-code-block-header-border', 'var(--notectl-border)'],\n\t['--notectl-tooltip-bg', 'var(--notectl-fg)'],\n\t['--notectl-tooltip-fg', 'var(--notectl-bg)'],\n];\n\n// --- Generated syntax fallbacks (derived from SYNTAX_TOKEN_TYPES) ---\n\nconst SYNTAX_FALLBACKS: ReadonlyArray<readonly [string, string]> = SYNTAX_TOKEN_TYPES.map(\n\t(type) => [`--notectl-code-token-${type}`, 'var(--notectl-code-block-color)'] as const,\n);\n\n/** Fallbacks for component tokens when not explicitly set. */\nconst COMPONENT_FALLBACKS: ReadonlyMap<string, string> = new Map([\n\t...STATIC_FALLBACKS,\n\t...SYNTAX_FALLBACKS,\n]);\n\n/** Resolves a dotted path like 'primitives.background' from a Theme. */\nfunction resolvePath(theme: Theme, path: string): string | undefined {\n\tconst parts: string[] = path.split('.');\n\tlet current: unknown = theme;\n\tfor (const part of parts) {\n\t\tif (current === undefined || current === null) return undefined;\n\t\tif (typeof current !== 'object') return undefined;\n\t\tcurrent = (current as Record<string, unknown>)[part];\n\t}\n\tif (typeof current === 'string') return current;\n\tif (typeof current === 'object' && current !== null && 'color' in current) {\n\t\treturn resolveTokenColor(current as TokenStyleValue);\n\t}\n\treturn undefined;\n}\n\n/** Emits font-style/font-weight CSS vars for syntax tokens that use TokenStyle objects. */\nfunction emitTokenStyleVars(syntax: ThemeSyntax, lines: string[]): void {\n\tfor (const type of SYNTAX_TOKEN_TYPES) {\n\t\tconst value: TokenStyleValue = syntax[type];\n\t\tif (typeof value !== 'object') continue;\n\n\t\tconst fontStyle: string | undefined = resolveTokenFontStyle(value);\n\t\tif (fontStyle) {\n\t\t\tlines.push(`\\t--notectl-code-token-${type}-font-style: ${fontStyle};`);\n\t\t}\n\t\tconst fontWeight: string | undefined = resolveTokenFontWeight(value);\n\t\tif (fontWeight) {\n\t\t\tlines.push(`\\t--notectl-code-token-${type}-font-weight: ${fontWeight};`);\n\t\t}\n\t}\n}\n\n/** Generates CSS text with all theme custom properties on :host. */\nexport function generateThemeCSS(theme: Theme): string {\n\tconst lines: string[] = [':host {'];\n\n\tfor (const [path, cssVar] of VARIABLE_MAP) {\n\t\tconst value: string | undefined = resolvePath(theme, path);\n\t\tif (value !== undefined) {\n\t\t\tlines.push(`\\t${cssVar}: ${value};`);\n\t\t} else {\n\t\t\tconst fallback: string | undefined = COMPONENT_FALLBACKS.get(cssVar);\n\t\t\tif (fallback) {\n\t\t\t\tlines.push(`\\t${cssVar}: ${fallback};`);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Emit font-style / font-weight vars for TokenStyle entries\n\tif (theme.codeBlock?.syntax) {\n\t\temitTokenStyleVars(theme.codeBlock.syntax, lines);\n\t}\n\n\tlines.push('}');\n\treturn lines.join('\\n');\n}\n\n/** Creates a CSSStyleSheet populated with theme CSS variables. */\nexport function createThemeStyleSheet(theme: Theme): CSSStyleSheet {\n\tconst sheet: CSSStyleSheet = new CSSStyleSheet();\n\tsheet.replaceSync(generateThemeCSS(theme));\n\treturn sheet;\n}\n","/**\n * Paper size definitions and dimension helpers.\n * Used by PaperLayoutController for WYSIWYG page layout\n * and by PrintStyleCollector for @page CSS rules.\n */\n\n/** Conversion factor: 1mm = 96/25.4 px at CSS reference pixel (96 DPI). */\nconst MM_TO_PX: number = 96 / 25.4;\n\n/** Physical dimensions of a paper size. */\nexport interface PaperDimensions {\n\treadonly widthMm: number;\n\treadonly heightMm: number;\n\treadonly widthPx: number;\n\treadonly heightPx: number;\n}\n\n/** Available paper size presets. */\nexport const PaperSize = {\n\tDINA4: 'din-a4',\n\tDINA5: 'din-a5',\n\tUSLetter: 'us-letter',\n\tUSLegal: 'us-legal',\n} as const;\nexport type PaperSize = (typeof PaperSize)[keyof typeof PaperSize];\n\n/** Rounds to nearest integer for pixel dimensions. */\nfunction mmToPx(mm: number): number {\n\treturn Math.round(mm * MM_TO_PX);\n}\n\n/** Lookup table for paper dimensions. */\nconst PAPER_DIMENSIONS: ReadonlyMap<PaperSize, PaperDimensions> = new Map<\n\tPaperSize,\n\tPaperDimensions\n>([\n\t[PaperSize.DINA4, { widthMm: 210, heightMm: 297, widthPx: mmToPx(210), heightPx: mmToPx(297) }],\n\t[PaperSize.DINA5, { widthMm: 148, heightMm: 210, widthPx: mmToPx(148), heightPx: mmToPx(210) }],\n\t[\n\t\tPaperSize.USLetter,\n\t\t{ widthMm: 215.9, heightMm: 279.4, widthPx: mmToPx(215.9), heightPx: mmToPx(279.4) },\n\t],\n\t[\n\t\tPaperSize.USLegal,\n\t\t{ widthMm: 215.9, heightMm: 355.6, widthPx: mmToPx(215.9), heightPx: mmToPx(355.6) },\n\t],\n]);\n\n/** CSS @page size keywords for each paper size. */\nconst CSS_SIZE_KEYWORDS: ReadonlyMap<PaperSize, string> = new Map<PaperSize, string>([\n\t[PaperSize.DINA4, 'A4'],\n\t[PaperSize.DINA5, 'A5'],\n\t[PaperSize.USLetter, 'letter'],\n\t[PaperSize.USLegal, 'legal'],\n]);\n\n/** Returns the physical and pixel dimensions for a paper size. */\nexport function getPaperDimensions(size: PaperSize): PaperDimensions {\n\tconst dims: PaperDimensions | undefined = PAPER_DIMENSIONS.get(size);\n\tif (!dims) {\n\t\tthrow new Error(`Unknown paper size: ${size}`);\n\t}\n\treturn dims;\n}\n\n/**\n * Document margin constants for paper mode (in px).\n * These define the content padding inside the paper surface in the editor,\n * and become @page margins in print output to ensure WYSIWYG fidelity.\n */\nexport const PAPER_MARGIN_TOP_PX: number = 48;\nexport const PAPER_MARGIN_HORIZONTAL_PX: number = 56;\nexport const PAPER_VIEWPORT_PADDING_PX: number = 24;\n\n/** Type guard: returns true if the value is a valid PaperSize string. */\nexport function isValidPaperSize(value: string): value is PaperSize {\n\treturn (Object.values(PaperSize) as string[]).includes(value);\n}\n\n/** Returns the CSS @page size keyword (e.g. 'A4', 'letter') for a paper size. */\nexport function getPaperCSSSize(size: PaperSize): string {\n\tconst keyword: string | undefined = CSS_SIZE_KEYWORDS.get(size);\n\tif (!keyword) {\n\t\tthrow new Error(`Unknown paper size: ${size}`);\n\t}\n\treturn keyword;\n}\n","/**\n * Type definitions, service keys, and event keys for the PrintPlugin.\n */\n\nimport type { PaperSize } from '../../model/PaperSize.js';\nimport type { NodeTypeName } from '../../model/TypeBrands.js';\nimport { EventKey, ServiceKey } from '../Plugin.js';\n\n// --- Print Options ---\n\nexport interface PrintOptions {\n\t/** Page title shown in the browser print header. */\n\treadonly title?: string;\n\n\t/** Additional CSS appended to the print stylesheet. */\n\treadonly customCSS?: string;\n\n\t/**\n\t * Header HTML inserted once at the top of the print document.\n\t * For repeating per-page headers, use toHTML() with server-side PDF generation.\n\t */\n\treadonly header?: string | (() => string);\n\n\t/**\n\t * Footer HTML inserted once at the bottom of the print document.\n\t * For repeating per-page footers, use toHTML() with server-side PDF generation.\n\t */\n\treadonly footer?: string | (() => string);\n\n\t/** Page margins as CSS value (e.g. '2cm'). */\n\treadonly margin?: string;\n\n\t/** Force page break before these block types. */\n\treadonly pageBreakBefore?: readonly NodeTypeName[];\n\n\t/** Exclude these block types from print output. */\n\treadonly excludeBlockTypes?: readonly NodeTypeName[];\n\n\t/**\n\t * Whether to preserve background colors and images in print output.\n\t * Defaults to `true` (WYSIWYG). Set to `false` to let the browser strip\n\t * backgrounds (e.g. to save ink).\n\t */\n\treadonly printBackground?: boolean;\n\n\t/**\n\t * Force light theme tokens in print output for readability on paper.\n\t * Defaults to `true`. Set to `false` to print with the current editor theme.\n\t */\n\treadonly forceLightTheme?: boolean;\n\n\t/** Page orientation. */\n\treadonly orientation?: 'portrait' | 'landscape';\n\n\t/** Paper size for @page CSS rule. When set, overrides the default A4 page size. */\n\treadonly paperSize?: PaperSize;\n}\n\n// --- Plugin Configuration ---\n\nexport interface PrintPluginConfig {\n\t/** Default options applied to every print() call. */\n\treadonly defaults?: PrintOptions;\n\n\t/** Keyboard shortcut (default: 'Mod-P'). */\n\treadonly keyBinding?: string;\n\n\t/** Show toolbar button (default: true). */\n\treadonly showToolbarItem?: boolean;\n\n\t/** Locale override for user-facing strings. */\n\treadonly locale?: import('./PrintLocale.js').PrintLocale;\n}\n\n// --- Service Interface ---\n\nexport interface PrintService {\n\t/** Prints the editor content with optional configuration. */\n\tprint(options?: PrintOptions): void;\n\n\t/** Generates print-ready HTML as a complete document string. */\n\ttoHTML(options?: PrintOptions): string;\n}\n\n// --- Service & Event Keys ---\n\nexport const PRINT_SERVICE_KEY: ServiceKey<PrintService> = new ServiceKey<PrintService>('print');\n\nexport const BEFORE_PRINT: EventKey<BeforePrintEvent> = new EventKey<BeforePrintEvent>(\n\t'print:before',\n);\n\nexport const AFTER_PRINT: EventKey<AfterPrintEvent> = new EventKey<AfterPrintEvent>('print:after');\n\n// --- Event Payloads ---\n\nexport interface BeforePrintEvent {\n\t/** Options can be mutated — EventBus passes by reference. */\n\toptions: PrintOptions;\n\t/** Set to true to cancel the print. */\n\tcancelled: boolean;\n}\n\nexport interface AfterPrintEvent {\n\t/** The generated HTML (read-only). */\n\treadonly html: string;\n}\n"],"mappings":"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"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as t,r as e,s as n}from"./Document-_qdGR4vh.mjs";import{c as o,o as s,t as c,u as r}from"./Selection-aeiSsvhe.mjs";import{t as i}from"./Commands-BuYF23lf.mjs";import{a}from"./TypeBrands-BZDKMjR-.mjs";import{a as l,c as d,i as u,o as h,s as m}from"./BlockInsertion-DsnHLcvM.mjs";import{n as g}from"./Plugin-BUNGKupW.mjs";import{i as f,o as p}from"./PluginHelpers-D1QF-YaF.mjs";import{i as x}from"./XmlDetector-DlRdJOIX.mjs";var k=/\n(?:[ \t]*\n)+/;function C(t,e){return!t.detection&&!e.detection||!(!t.detection||!e.detection)&&t.detection.language===e.detection.language}function j(t,e){const n=`${t.text}\n\n${e.text}`;if(!t.detection&&!e.detection)return{text:n,detection:null};const o=t.detection,s=e.detection;return{text:n,detection:{language:o.language,formattedText:`${o.formattedText}\n\n${s.formattedText}`,confidence:Math.max(o.confidence,s.confidence)}}}var b={detectedAsCodeBlock:t=>`Pasted as ${t} code block with syntax highlighting.`,detectedMixedContent:(t,e,n)=>{const o=[];if(t>0&&o.push(`${t} paragraph${t>1?"s":""}`),e>0){const t=n.join(", ");o.push(`${e} code block${e>1?"s":""} (${t})`)}return`Pasted as ${o.join(" and ")}.`}},B=/* @__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-ChOxTdPI.mjs"),"./locales/de.ts":()=>import("./de-B92lssMU.mjs"),"./locales/es.ts":()=>import("./es-BJibD3UW.mjs"),"./locales/fr.ts":()=>import("./fr-DPPHZ6H7.mjs"),"./locales/hi.ts":()=>import("./hi-CRsCP_UU.mjs"),"./locales/pt.ts":()=>import("./pt-QZcGM_AW.mjs"),"./locales/ru.ts":()=>import("./ru-CQoFJYQk.mjs"),"./locales/zh.ts":()=>import("./zh-BogAT6ZW.mjs")});async function P(t){return p(B,t,b)}var T=new g("smartPaste"),y=class{id="smart-paste";name="Smart Paste";dependencies=["code-block"];config;detectors=[];context=null;locale=b;constructor(t){this.config={...t}}async init(t){this.context=t,this.locale=await f(t,this.config.locale,b,P);const e=t.getService(x);if(e&&e.onRegister(t=>{t.detection&&this.detectors.push(t.detection)}),this.config.detectors)for(const n of this.config.detectors)this.detectors.push(n);t.registerPasteInterceptor(this.handlePaste,{name:"smart-paste",priority:50}),t.registerService(T,{registerDetector:t=>{this.detectors.push(t)}})}destroy(){this.context=null,this.detectors.length=0}handlePaste=(t,e,n)=>{if(this.isCursorInCodeBlock(n))return null;const o=function(t,e){const n=t.split(k).map(t=>t.trim()).filter(t=>t.length>0);if(0===n.length)return null;let o=!1;const s=n.map(t=>{const n=function(t,e){let n=null;for(const o of e){const e=o.detect(t);e&&(null===n||e.confidence>n.confidence)&&(n=e)}return n}(t,e);return n&&(o=!0),{text:t,detection:n}});return o?function(t){if(t.length<=1)return t;const e=[t[0]];for(let n=1;n<t.length;n++){const o=t[n],s=e[e.length-1];C(s,o)?e[e.length-1]=j(s,o):e.push(o)}return e}(s):null}(t,this.detectors);return o?1===o.length&&o[0]?.detection?this.handleSingleCodeBlock(n,o[0].detection):this.handleMixedContent(n,o):null};isCursorInCodeBlock(t){const e=t.selection;return!!r(e)&&"code_block"===t.getBlock(e.anchor.blockId)?.type}handleSingleCodeBlock(t,e){const n=this.buildCodeBlockTransaction(t,e);return n&&this.context&&this.context.announce(this.locale.detectedAsCodeBlock(e.language)),n}buildCodeBlockTransaction(o,d){const u=o.selection,m=o.transaction("paste");let g;g=r(u)&&!s(u)?i(o,m)??u.anchor.blockId:h(u);const f=t(),p=e(a("code_block"),[n(d.formattedText)],f,{language:d.language,backgroundColor:""});return l(o,m,g,p,u,this.context?.getSchemaRegistry())?(m.setSelection(c(f,d.formattedText.length)),m.build()):null}handleMixedContent(t,e){const n=this.buildMultiBlockTransaction(t,e);return n&&this.context&&this.announceMixedContent(e),n}buildMultiBlockTransaction(t,e){const n=t.selection,a=t.transaction("paste");let l;l=r(n)&&!s(n)?i(t,a)??n.anchor.blockId:h(n);const g=u(t,l),f=this.context?.getSchemaRegistry(),p=g?m(t,l,g,f):d(t,l,f);if(!p)return null;const x=!g&&o(n)&&"before"===n.side?0:1;let k,C=p.anchorIndex+x,j=0;for(const o of e){const t=o.detection?this.createCodeBlockNode(o.detection):this.createParagraphNode(o.text);a.insertNode(p.parentPath,C,t),C++,k=t.id,j=o.detection?o.detection.formattedText.length:o.text.length}return(g?p.isAnchorEmpty&&p.anchorIndex>=0:p.isAnchorEmpty&&!o(n))&&a.removeNode(p.parentPath,p.anchorIndex),k&&a.setSelection(c(k,j)),a.build()}createCodeBlockNode(o){return e(a("code_block"),[n(o.formattedText)],t(),{language:o.language,backgroundColor:""})}createParagraphNode(o){return e(a("paragraph"),[n(o)],t())}announceMixedContent(t){let e=0,n=0;const o=[];for(const s of t)s.detection?(n++,o.includes(s.detection.language)||o.push(s.detection.language)):e++;this.context?.announce(this.locale.detectedMixedContent(e,n,o))}};export{P as i,T as n,b as r,y as t};
|
|
2
|
-
//# sourceMappingURL=SmartPastePlugin-i96yAnXZ.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SmartPastePlugin-i96yAnXZ.mjs","names":[],"sources":["../../src/plugins/smart-paste/ContentSplitter.ts","../../src/plugins/smart-paste/SmartPasteLocale.ts","../../src/plugins/smart-paste/SmartPasteTypes.ts","../../src/plugins/smart-paste/SmartPastePlugin.ts"],"sourcesContent":["/**\n * Splits pasted text at blank-line boundaries and classifies each segment\n * using content detectors. Adjacent segments of the same type are merged.\n */\n\nimport type { ContentDetector, DetectionResult, PasteSegment } from './SmartPasteTypes.js';\n\n/** Pattern matching one or more consecutive blank lines (may contain whitespace). */\nconst BLANK_LINE_SPLIT: RegExp = /\\n(?:[ \\t]*\\n)+/;\n\n/**\n * Splits text at blank-line boundaries and classifies each segment\n * using the provided detectors. Returns null if no code is detected\n * in any segment (the paste should fall through to default handling).\n */\nexport function splitAndClassify(\n\ttext: string,\n\tdetectors: readonly ContentDetector[],\n): readonly PasteSegment[] | null {\n\tconst rawSegments: readonly string[] = text.split(BLANK_LINE_SPLIT);\n\tconst trimmed: readonly string[] = rawSegments\n\t\t.map((s: string) => s.trim())\n\t\t.filter((s: string) => s.length > 0);\n\n\tif (trimmed.length === 0) return null;\n\n\tlet hasCode = false;\n\tconst segments: PasteSegment[] = trimmed.map((segmentText: string): PasteSegment => {\n\t\tconst detection: DetectionResult | null = detectBest(segmentText, detectors);\n\t\tif (detection) hasCode = true;\n\t\treturn { text: segmentText, detection };\n\t});\n\n\tif (!hasCode) return null;\n\n\treturn mergeAdjacentSegments(segments);\n}\n\n/**\n * Merges adjacent segments that share the same classification:\n * consecutive text segments become one paragraph, consecutive code\n * segments of the same language become one code block.\n */\nexport function mergeAdjacentSegments(segments: readonly PasteSegment[]): readonly PasteSegment[] {\n\tif (segments.length <= 1) return segments;\n\n\tconst merged: PasteSegment[] = [segments[0] as PasteSegment];\n\n\tfor (let i = 1; i < segments.length; i++) {\n\t\tconst current: PasteSegment = segments[i] as PasteSegment;\n\t\tconst previous: PasteSegment = merged[merged.length - 1] as PasteSegment;\n\n\t\tif (canMerge(previous, current)) {\n\t\t\tmerged[merged.length - 1] = merge(previous, current);\n\t\t} else {\n\t\t\tmerged.push(current);\n\t\t}\n\t}\n\n\treturn merged;\n}\n\n/** Picks the highest-confidence detection result from all detectors. */\nfunction detectBest(text: string, detectors: readonly ContentDetector[]): DetectionResult | null {\n\tlet best: DetectionResult | null = null;\n\n\tfor (const detector of detectors) {\n\t\tconst result: DetectionResult | null = detector.detect(text);\n\t\tif (result && (best === null || result.confidence > best.confidence)) {\n\t\t\tbest = result;\n\t\t}\n\t}\n\n\treturn best;\n}\n\n/** Two segments can merge if both are text or both are code of the same language. */\nfunction canMerge(a: PasteSegment, b: PasteSegment): boolean {\n\tif (!a.detection && !b.detection) return true;\n\tif (a.detection && b.detection) return a.detection.language === b.detection.language;\n\treturn false;\n}\n\n/** Merges two compatible segments into one. */\nfunction merge(a: PasteSegment, b: PasteSegment): PasteSegment {\n\tconst joinedText: string = `${a.text}\\n\\n${b.text}`;\n\n\tif (!a.detection && !b.detection) {\n\t\treturn { text: joinedText, detection: null };\n\t}\n\n\tconst detA: DetectionResult = a.detection as DetectionResult;\n\tconst detB: DetectionResult = b.detection as DetectionResult;\n\n\treturn {\n\t\ttext: joinedText,\n\t\tdetection: {\n\t\t\tlanguage: detA.language,\n\t\t\tformattedText: `${detA.formattedText}\\n\\n${detB.formattedText}`,\n\t\t\tconfidence: Math.max(detA.confidence, detB.confidence),\n\t\t},\n\t};\n}\n","/** Locale interface and default English locale for the SmartPastePlugin. */\n\nimport { type LocaleModuleMap, loadLocaleModule } from '../shared/LocaleLoader.js';\n\nexport interface SmartPasteLocale {\n\treadonly detectedAsCodeBlock: (language: string) => string;\n\treadonly detectedMixedContent: (\n\t\ttextCount: number,\n\t\tcodeCount: number,\n\t\tlanguages: readonly string[],\n\t) => string;\n}\n\nexport const SMART_PASTE_LOCALE_EN: SmartPasteLocale = {\n\tdetectedAsCodeBlock: (language: string) =>\n\t\t`Pasted as ${language} code block with syntax highlighting.`,\n\tdetectedMixedContent: (textCount: number, codeCount: number, languages: readonly string[]) => {\n\t\tconst parts: string[] = [];\n\t\tif (textCount > 0) {\n\t\t\tparts.push(`${textCount} paragraph${textCount > 1 ? 's' : ''}`);\n\t\t}\n\t\tif (codeCount > 0) {\n\t\t\tconst langList: string = languages.join(', ');\n\t\t\tparts.push(`${codeCount} code block${codeCount > 1 ? 's' : ''} (${langList})`);\n\t\t}\n\t\treturn `Pasted as ${parts.join(' and ')}.`;\n\t},\n};\n\nconst localeModules: LocaleModuleMap<SmartPasteLocale> = import.meta.glob<{\n\tdefault: SmartPasteLocale;\n}>('./locales/*.ts', { eager: false });\n\nexport async function loadSmartPasteLocale(lang: string): Promise<SmartPasteLocale> {\n\treturn loadLocaleModule(localeModules, lang, SMART_PASTE_LOCALE_EN);\n}\n","/**\n * Types for the smart paste plugin — content detection and formatting.\n */\n\nimport { ServiceKey } from '../Plugin.js';\nimport type { SmartPasteLocale } from './SmartPasteLocale.js';\n\n/** Result of detecting structured content in pasted text. */\nexport interface DetectionResult {\n\treadonly language: string;\n\treadonly formattedText: string;\n\treadonly confidence: number;\n}\n\n/** A classified segment of pasted text — either plain text or detected code. */\nexport interface PasteSegment {\n\treadonly text: string;\n\treadonly detection: DetectionResult | null;\n}\n\n/** Interface for content detectors that identify and format pasted text. */\nexport interface ContentDetector {\n\treadonly id: string;\n\tdetect(text: string): DetectionResult | null;\n}\n\n/** Configuration for the SmartPastePlugin. */\nexport interface SmartPasteConfig {\n\treadonly detectors?: readonly ContentDetector[];\n\treadonly locale?: SmartPasteLocale;\n}\n\n/** Public service for registering additional content detectors at runtime. */\nexport interface SmartPasteService {\n\tregisterDetector(detector: ContentDetector): void;\n}\n\nexport const SMART_PASTE_SERVICE_KEY = new ServiceKey<SmartPasteService>('smartPaste');\n","/**\n * SmartPastePlugin: detects structured content in clipboard text\n * and inserts it as formatted code blocks with syntax highlighting.\n * Mixed content (text + code) is split into separate blocks.\n */\n\nimport {\n\ttype InsertionContext,\n\tfindTableCellAncestor,\n\tinsertBlockAfterAnchor,\n\tresolveAnchorBlockId,\n\tresolveCellInsertionContext,\n\tresolveRootInsertionContext,\n} from '../../commands/BlockInsertion.js';\nimport { addDeleteSelectionSteps } from '../../commands/Commands.js';\nimport {\n\ttype BlockNode,\n\tcreateBlockNode,\n\tcreateTextNode,\n\tgenerateBlockId,\n} from '../../model/Document.js';\nimport {\n\tcreateCollapsedSelection,\n\tisCollapsed,\n\tisGapCursor,\n\tisTextSelection,\n} from '../../model/Selection.js';\nimport type { BlockId, NodeTypeName } from '../../model/TypeBrands.js';\nimport { nodeType } from '../../model/TypeBrands.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { Transaction } from '../../state/Transaction.js';\nimport type { PasteInterceptor, Plugin, PluginContext } from '../Plugin.js';\nimport { LANGUAGE_REGISTRY_SERVICE_KEY } from '../language/LanguageTypes.js';\nimport { resolveLocale } from '../shared/PluginHelpers.js';\nimport { splitAndClassify } from './ContentSplitter.js';\nimport {\n\tSMART_PASTE_LOCALE_EN,\n\ttype SmartPasteLocale,\n\tloadSmartPasteLocale,\n} from './SmartPasteLocale.js';\nimport type {\n\tContentDetector,\n\tDetectionResult,\n\tPasteSegment,\n\tSmartPasteConfig,\n} from './SmartPasteTypes.js';\nimport { SMART_PASTE_SERVICE_KEY } from './SmartPasteTypes.js';\n\nexport class SmartPastePlugin implements Plugin {\n\treadonly id = 'smart-paste';\n\treadonly name = 'Smart Paste';\n\treadonly dependencies = ['code-block'] as const;\n\n\tprivate readonly config: SmartPasteConfig;\n\tprivate readonly detectors: ContentDetector[] = [];\n\tprivate context: PluginContext | null = null;\n\tprivate locale: SmartPasteLocale = SMART_PASTE_LOCALE_EN;\n\n\tconstructor(config?: Partial<SmartPasteConfig>) {\n\t\tthis.config = { ...config };\n\t}\n\n\tasync init(context: PluginContext): Promise<void> {\n\t\tthis.context = context;\n\n\t\tthis.locale = await resolveLocale(\n\t\t\tcontext,\n\t\t\tthis.config.locale,\n\t\t\tSMART_PASTE_LOCALE_EN,\n\t\t\tloadSmartPasteLocale,\n\t\t);\n\n\t\t// Subscribe to language registry for detectors (replay provides built-ins)\n\t\tconst registry = context.getService(LANGUAGE_REGISTRY_SERVICE_KEY);\n\t\tif (registry) {\n\t\t\tregistry.onRegister((support) => {\n\t\t\t\tif (support.detection) {\n\t\t\t\t\tthis.detectors.push(support.detection);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\t// Register config-provided detectors\n\t\tif (this.config.detectors) {\n\t\t\tfor (const detector of this.config.detectors) {\n\t\t\t\tthis.detectors.push(detector);\n\t\t\t}\n\t\t}\n\n\t\t// Register paste interceptor\n\t\tcontext.registerPasteInterceptor(this.handlePaste, { name: 'smart-paste', priority: 50 });\n\n\t\t// Register service for external detector registration\n\t\tcontext.registerService(SMART_PASTE_SERVICE_KEY, {\n\t\t\tregisterDetector: (detector: ContentDetector) => {\n\t\t\t\tthis.detectors.push(detector);\n\t\t\t},\n\t\t});\n\t}\n\n\tdestroy(): void {\n\t\tthis.context = null;\n\t\tthis.detectors.length = 0;\n\t}\n\n\t// --- Paste Interceptor ---\n\n\tprivate readonly handlePaste: PasteInterceptor = (\n\t\tplainText: string,\n\t\t_html: string,\n\t\tstate: EditorState,\n\t): Transaction | null => {\n\t\tif (this.isCursorInCodeBlock(state)) return null;\n\n\t\tconst segments: readonly PasteSegment[] | null = splitAndClassify(plainText, this.detectors);\n\t\tif (!segments) return null;\n\n\t\t// Single code-only segment: use existing fast path\n\t\tif (segments.length === 1 && segments[0]?.detection) {\n\t\t\treturn this.handleSingleCodeBlock(state, segments[0].detection);\n\t\t}\n\n\t\t// Mixed content: create multiple blocks\n\t\treturn this.handleMixedContent(state, segments);\n\t};\n\n\tprivate isCursorInCodeBlock(state: EditorState): boolean {\n\t\tconst sel = state.selection;\n\t\tif (!isTextSelection(sel)) return false;\n\n\t\tconst block: BlockNode | undefined = state.getBlock(sel.anchor.blockId);\n\t\treturn block?.type === 'code_block';\n\t}\n\n\t// --- Single Code Block (existing behavior) ---\n\n\tprivate handleSingleCodeBlock(\n\t\tstate: EditorState,\n\t\tdetection: DetectionResult,\n\t): Transaction | null {\n\t\tconst tr: Transaction | null = this.buildCodeBlockTransaction(state, detection);\n\t\tif (tr && this.context) {\n\t\t\tthis.context.announce(this.locale.detectedAsCodeBlock(detection.language));\n\t\t}\n\t\treturn tr;\n\t}\n\n\tprivate buildCodeBlockTransaction(\n\t\tstate: EditorState,\n\t\tdetection: DetectionResult,\n\t): Transaction | null {\n\t\tconst sel = state.selection;\n\t\tconst builder = state.transaction('paste');\n\n\t\t// Delete selection if range-selected\n\t\tlet anchorBlockId: BlockId;\n\t\tif (isTextSelection(sel) && !isCollapsed(sel)) {\n\t\t\tconst landingId: BlockId | undefined = addDeleteSelectionSteps(state, builder);\n\t\t\tanchorBlockId = landingId ?? sel.anchor.blockId;\n\t\t} else {\n\t\t\tanchorBlockId = resolveAnchorBlockId(sel);\n\t\t}\n\n\t\t// Create the code block node\n\t\tconst newBlockId: BlockId = generateBlockId();\n\t\tconst codeBlock: BlockNode = createBlockNode(\n\t\t\tnodeType('code_block') as NodeTypeName,\n\t\t\t[createTextNode(detection.formattedText)],\n\t\t\tnewBlockId,\n\t\t\t{ language: detection.language, backgroundColor: '' },\n\t\t);\n\n\t\t// Insert at cursor (handles cell vs root, empty anchor removal)\n\t\tconst inserted: boolean = insertBlockAfterAnchor(\n\t\t\tstate,\n\t\t\tbuilder,\n\t\t\tanchorBlockId,\n\t\t\tcodeBlock,\n\t\t\tsel,\n\t\t\tthis.context?.getSchemaRegistry(),\n\t\t);\n\t\tif (!inserted) return null;\n\n\t\tbuilder.setSelection(createCollapsedSelection(newBlockId, detection.formattedText.length));\n\n\t\treturn builder.build();\n\t}\n\n\t// --- Mixed Content (multiple blocks) ---\n\n\tprivate handleMixedContent(\n\t\tstate: EditorState,\n\t\tsegments: readonly PasteSegment[],\n\t): Transaction | null {\n\t\tconst tr: Transaction | null = this.buildMultiBlockTransaction(state, segments);\n\t\tif (tr && this.context) {\n\t\t\tthis.announceMixedContent(segments);\n\t\t}\n\t\treturn tr;\n\t}\n\n\tprivate buildMultiBlockTransaction(\n\t\tstate: EditorState,\n\t\tsegments: readonly PasteSegment[],\n\t): Transaction | null {\n\t\tconst sel = state.selection;\n\t\tconst builder = state.transaction('paste');\n\n\t\tlet anchorBlockId: BlockId;\n\t\tif (isTextSelection(sel) && !isCollapsed(sel)) {\n\t\t\tconst landingId: BlockId | undefined = addDeleteSelectionSteps(state, builder);\n\t\t\tanchorBlockId = landingId ?? sel.anchor.blockId;\n\t\t} else {\n\t\t\tanchorBlockId = resolveAnchorBlockId(sel);\n\t\t}\n\n\t\tconst cellId: BlockId | undefined = findTableCellAncestor(state, anchorBlockId);\n\t\tconst schemaRegistry = this.context?.getSchemaRegistry();\n\n\t\tconst ctx: InsertionContext | undefined = cellId\n\t\t\t? resolveCellInsertionContext(state, anchorBlockId, cellId, schemaRegistry)\n\t\t\t: resolveRootInsertionContext(state, anchorBlockId, schemaRegistry);\n\t\tif (!ctx) return null;\n\n\t\tconst insertOffset: number = !cellId && isGapCursor(sel) && sel.side === 'before' ? 0 : 1;\n\t\tlet insertIndex: number = ctx.anchorIndex + insertOffset;\n\t\tlet lastBlockId: BlockId | undefined;\n\t\tlet lastBlockTextLen = 0;\n\n\t\tfor (const segment of segments) {\n\t\t\tconst block: BlockNode = segment.detection\n\t\t\t\t? this.createCodeBlockNode(segment.detection)\n\t\t\t\t: this.createParagraphNode(segment.text);\n\n\t\t\tbuilder.insertNode(ctx.parentPath, insertIndex, block);\n\t\t\tinsertIndex++;\n\t\t\tlastBlockId = block.id;\n\t\t\tlastBlockTextLen = segment.detection\n\t\t\t\t? segment.detection.formattedText.length\n\t\t\t\t: segment.text.length;\n\t\t}\n\n\t\tconst shouldRemoveAnchor: boolean = cellId\n\t\t\t? ctx.isAnchorEmpty && ctx.anchorIndex >= 0\n\t\t\t: ctx.isAnchorEmpty && !isGapCursor(sel);\n\n\t\tif (shouldRemoveAnchor) {\n\t\t\tbuilder.removeNode(ctx.parentPath, ctx.anchorIndex);\n\t\t}\n\n\t\tif (lastBlockId) {\n\t\t\tbuilder.setSelection(createCollapsedSelection(lastBlockId, lastBlockTextLen));\n\t\t}\n\n\t\treturn builder.build();\n\t}\n\n\tprivate createCodeBlockNode(detection: DetectionResult): BlockNode {\n\t\treturn createBlockNode(\n\t\t\tnodeType('code_block') as NodeTypeName,\n\t\t\t[createTextNode(detection.formattedText)],\n\t\t\tgenerateBlockId(),\n\t\t\t{ language: detection.language, backgroundColor: '' },\n\t\t);\n\t}\n\n\tprivate createParagraphNode(text: string): BlockNode {\n\t\treturn createBlockNode(\n\t\t\tnodeType('paragraph') as NodeTypeName,\n\t\t\t[createTextNode(text)],\n\t\t\tgenerateBlockId(),\n\t\t);\n\t}\n\n\tprivate announceMixedContent(segments: readonly PasteSegment[]): void {\n\t\tlet textCount = 0;\n\t\tlet codeCount = 0;\n\t\tconst languages: string[] = [];\n\n\t\tfor (const segment of segments) {\n\t\t\tif (segment.detection) {\n\t\t\t\tcodeCount++;\n\t\t\t\tif (!languages.includes(segment.detection.language)) {\n\t\t\t\t\tlanguages.push(segment.detection.language);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttextCount++;\n\t\t\t}\n\t\t}\n\n\t\tthis.context?.announce(this.locale.detectedMixedContent(textCount, codeCount, languages));\n\t}\n}\n"],"mappings":"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"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{_ as t,m as r}from"./Commands-BuYF23lf.mjs";import{i as e}from"./TypeBrands-BZDKMjR-.mjs";import{i as s,o}from"./PluginHelpers-D1QF-YaF.mjs";import{t as i}from"./ShortcutFormatting-DE6B8iGs.mjs";var a={label:"Strikethrough",tooltip:t=>`Strikethrough (${t})`},m=/* @__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-BXeE6tKj.mjs"),"./locales/de.ts":()=>import("./de-BqHw2LVH.mjs"),"./locales/es.ts":()=>import("./es-2U-tuiWo.mjs"),"./locales/fr.ts":()=>import("./fr-aDJE54Is.mjs"),"./locales/hi.ts":()=>import("./hi-BGMkRr1l.mjs"),"./locales/pt.ts":()=>import("./pt-BYsPmDNG.mjs"),"./locales/ru.ts":()=>import("./ru-VAZhjO4q.mjs"),"./locales/zh.ts":()=>import("./zh-Dj5jzeIJ.mjs")});async function g(t){return o(m,t,a)}var h={},l=class{id="strikethrough";name="Strikethrough";priority=22;config;locale;constructor(t){this.config={...h,...t}}async init(t){this.locale=await s(t,this.config.locale,a,g),this.registerMarkSpec(t),this.registerCommand(t),this.registerKeymap(t),this.registerToolbarItem(t)}registerMarkSpec(t){t.registerMarkSpec({type:"strikethrough",rank:3,toDOM:()=>document.createElement("s"),toHTMLString:(t,r)=>`<s>${r}</s>`,parseHTML:[{tag:"s"},{tag:"strike"},{tag:"del"},{tag:"span",getAttrs:t=>!!t.style.textDecoration.includes("line-through")&&{}}],sanitize:{tags:["s"]}})}registerCommand(r){r.registerCommand("toggleStrikethrough",()=>{const s=t(r.getState(),e("strikethrough"));return!!s&&(r.dispatch(s),!0)})}registerKeymap(t){t.registerKeymap({"Mod-Shift-X":()=>t.executeCommand("toggleStrikethrough")})}registerToolbarItem(t){t.registerToolbarItem({id:"strikethrough",group:"format",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 19h4v-3h-4v3zM5 4v3h5v3h4V7h5V4H5zM3 14h18v-2H3v2z"/></svg>',label:this.locale.label,tooltip:this.locale.tooltip(i("Mod-Shift-X")),command:"toggleStrikethrough",isActive:t=>r(t,e("strikethrough"))})}};export{a as n,g as r,l as t};
|
|
2
|
-
//# sourceMappingURL=StrikethroughPlugin-RGZATXUZ.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StrikethroughPlugin-RGZATXUZ.mjs","names":[],"sources":["../../src/plugins/strikethrough/StrikethroughLocale.ts","../../src/plugins/strikethrough/StrikethroughPlugin.ts"],"sourcesContent":["/**\n * Locale interface and default English locale for the StrikethroughPlugin.\n */\n\nimport { type LocaleModuleMap, loadLocaleModule } from '../shared/LocaleLoader.js';\n\n// --- Locale Interface ---\n\nexport interface StrikethroughLocale {\n\treadonly label: string;\n\treadonly tooltip: (shortcut: string) => string;\n}\n\n// --- Default English Locale ---\n\nexport const STRIKETHROUGH_LOCALE_EN: StrikethroughLocale = {\n\tlabel: 'Strikethrough',\n\ttooltip: (shortcut: string) => `Strikethrough (${shortcut})`,\n};\n\n// --- Lazy Locale Loader ---\n\nconst localeModules: LocaleModuleMap<StrikethroughLocale> = import.meta.glob<{\n\tdefault: StrikethroughLocale;\n}>('./locales/*.ts', { eager: false });\n\nexport async function loadStrikethroughLocale(lang: string): Promise<StrikethroughLocale> {\n\treturn loadLocaleModule(localeModules, lang, STRIKETHROUGH_LOCALE_EN);\n}\n","/**\n * StrikethroughPlugin: registers a strikethrough inline mark with MarkSpec,\n * toggle command, keyboard shortcut (Mod-Shift-X), and a toolbar button.\n */\n\nimport { isMarkActive, toggleMark } from '../../commands/Commands.js';\nimport { markType } from '../../model/TypeBrands.js';\nimport type { Plugin, PluginContext } from '../Plugin.js';\nimport { resolveLocale } from '../shared/PluginHelpers.js';\nimport { formatShortcut } from '../shared/ShortcutFormatting.js';\nimport {\n\tSTRIKETHROUGH_LOCALE_EN,\n\ttype StrikethroughLocale,\n\tloadStrikethroughLocale,\n} from './StrikethroughLocale.js';\n\n// --- Attribute Registry Augmentation ---\n\ndeclare module '../../model/AttrRegistry.js' {\n\tinterface MarkAttrRegistry {\n\t\tstrikethrough: Record<string, never>;\n\t}\n}\n\n// --- Configuration ---\n\nexport interface StrikethroughConfig {\n\treadonly locale?: StrikethroughLocale;\n}\n\nconst DEFAULT_CONFIG: StrikethroughConfig = {};\n\n// --- Plugin ---\n\nexport class StrikethroughPlugin implements Plugin {\n\treadonly id = 'strikethrough';\n\treadonly name = 'Strikethrough';\n\treadonly priority = 22;\n\n\tprivate readonly config: StrikethroughConfig;\n\tprivate locale!: StrikethroughLocale;\n\n\tconstructor(config?: Partial<StrikethroughConfig>) {\n\t\tthis.config = { ...DEFAULT_CONFIG, ...config };\n\t}\n\n\tasync init(context: PluginContext): Promise<void> {\n\t\tthis.locale = await resolveLocale(\n\t\t\tcontext,\n\t\t\tthis.config.locale,\n\t\t\tSTRIKETHROUGH_LOCALE_EN,\n\t\t\tloadStrikethroughLocale,\n\t\t);\n\t\tthis.registerMarkSpec(context);\n\t\tthis.registerCommand(context);\n\t\tthis.registerKeymap(context);\n\t\tthis.registerToolbarItem(context);\n\t}\n\n\tprivate registerMarkSpec(context: PluginContext): void {\n\t\tcontext.registerMarkSpec({\n\t\t\ttype: 'strikethrough',\n\t\t\trank: 3,\n\t\t\ttoDOM() {\n\t\t\t\treturn document.createElement('s');\n\t\t\t},\n\t\t\ttoHTMLString: (_mark, content) => `<s>${content}</s>`,\n\t\t\tparseHTML: [\n\t\t\t\t{ tag: 's' },\n\t\t\t\t{ tag: 'strike' },\n\t\t\t\t{ tag: 'del' },\n\t\t\t\t{\n\t\t\t\t\ttag: 'span',\n\t\t\t\t\tgetAttrs: (el: HTMLElement) => {\n\t\t\t\t\t\treturn el.style.textDecoration.includes('line-through') ? {} : false;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t\tsanitize: { tags: ['s'] },\n\t\t});\n\t}\n\n\tprivate registerCommand(context: PluginContext): void {\n\t\tcontext.registerCommand('toggleStrikethrough', () => {\n\t\t\tconst tr = toggleMark(context.getState(), markType('strikethrough'));\n\t\t\tif (tr) {\n\t\t\t\tcontext.dispatch(tr);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\t}\n\n\tprivate registerKeymap(context: PluginContext): void {\n\t\tcontext.registerKeymap({\n\t\t\t'Mod-Shift-X': () => context.executeCommand('toggleStrikethrough'),\n\t\t});\n\t}\n\n\tprivate registerToolbarItem(context: PluginContext): void {\n\t\tconst icon =\n\t\t\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M10 19h4v-3h-4v3zM5 4v3h5v3h4V7h5V4H5zM3 14h18v-2H3v2z\"/></svg>';\n\n\t\tcontext.registerToolbarItem({\n\t\t\tid: 'strikethrough',\n\t\t\tgroup: 'format',\n\t\t\ticon,\n\t\t\tlabel: this.locale.label,\n\t\t\ttooltip: this.locale.tooltip(formatShortcut('Mod-Shift-X')),\n\t\t\tcommand: 'toggleStrikethrough',\n\t\t\tisActive: (state) => isMarkActive(state, markType('strikethrough')),\n\t\t});\n\t}\n}\n"],"mappings":"0MAeA,IAAa,EAA+C,CAC3D,MAAO,gBACP,QAAU,GAAqB,kBAAkB,MAK5C,iBAAsD,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,uBAI5D,eAAsB,EAAwB,GAC7C,OAAO,EAAiB,EAAe,EAAM,GCG9C,IAAM,EAAsC,CAAA,EAI/B,EAAb,MACC,GAAc,gBACd,KAAgB,gBAChB,SAAoB,GAEpB,OACA,OAEA,WAAA,CAAY,GACX,KAAK,OAAS,IAAK,KAAmB,GAGvC,UAAM,CAAK,GACV,KAAK,aAAe,EACnB,EACA,KAAK,OAAO,OACZ,EACA,GAED,KAAK,iBAAiB,GACtB,KAAK,gBAAgB,GACrB,KAAK,eAAe,GACpB,KAAK,oBAAoB,GAG1B,gBAAA,CAAyB,GACxB,EAAQ,iBAAiB,CACxB,KAAM,gBACN,KAAM,EACN,MAAA,IACQ,SAAS,cAAc,KAE/B,aAAA,CAAe,EAAO,IAAY,MAAM,QACxC,UAAW,CACV,CAAE,IAAK,KACP,CAAE,IAAK,UACP,CAAE,IAAK,OACP,CACC,IAAK,OACL,SAAW,KACH,EAAG,MAAM,eAAe,SAAS,iBAAkB,CAAA,IAI7D,SAAU,CAAE,KAAM,CAAC,QAIrB,eAAA,CAAwB,GACvB,EAAQ,gBAAgB,sBAAA,KACvB,MAAM,EAAK,EAAW,EAAQ,WAAY,EAAS,kBACnD,QAAI,IACH,EAAQ,SAAS,IACV,KAMV,cAAA,CAAuB,GACtB,EAAQ,eAAe,CACtB,cAAA,IAAqB,EAAQ,eAAe,yBAI9C,mBAAA,CAA4B,GAI3B,EAAQ,oBAAoB,CAC3B,GAAI,gBACJ,MAAO,SACP,KALA,uIAMA,MAAO,KAAK,OAAO,MACnB,QAAS,KAAK,OAAO,QAAQ,EAAe,gBAC5C,QAAS,sBACT,SAAW,GAAU,EAAa,EAAO,EAAS"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{_ as s,m as t}from"./Commands-BuYF23lf.mjs";import{i as e}from"./TypeBrands-BZDKMjR-.mjs";import{a as i,i as r,o}from"./PluginHelpers-D1QF-YaF.mjs";import{t as p}from"./ShortcutFormatting-DE6B8iGs.mjs";var c={superscriptLabel:"Superscript",superscriptTooltip:s=>`Superscript (${s})`,subscriptLabel:"Subscript",subscriptTooltip:s=>`Subscript (${s})`},a=/* @__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-Cj6amEs9.mjs"),"./locales/de.ts":()=>import("./de-ChHR-g0q.mjs"),"./locales/es.ts":()=>import("./es-BUIOf37N.mjs"),"./locales/fr.ts":()=>import("./fr-tK6rWhoz.mjs"),"./locales/hi.ts":()=>import("./hi-K71sKi2-.mjs"),"./locales/pt.ts":()=>import("./pt-Dne18ay-.mjs"),"./locales/ru.ts":()=>import("./ru-L3ML505C.mjs"),"./locales/zh.ts":()=>import("./zh-DjY-jmYn.mjs")});async function n(s){return o(a,s,c)}var l={superscript:!0,subscript:!0},u=[{type:"superscript",opposite:"subscript",configKey:"superscript",rank:4,tag:"sup",icon:['<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">','<path d="M16 7.41L11.41 12 16 16.59 14.59 18l-6-6 6-6z"',' fill="none"/>','<path d="M9.64 7.64c.23-.5.36-1.05.36-1.64'," 0-2.21-1.79-4-4-4H2v14h4.36c2.34 0 4.24-1.9"," 4.24-4.24 0-1.6-.89-2.99-2.2-3.71zM4.5 4.5H6c.83"," 0 1.5.67 1.5 1.5S6.83 7.5 6 7.5H4.5v-3zm2 9H4.5v-3H6.5c.83",' 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z" fill="none"/>','<path d="M15.97 3.84c0-.47.19-.91.53-1.21.34-.31.8-.49'," 1.3-.49.5 0 .95.18 1.28.48.32.3.5.7.51 1.15h1.59c-.02","-.96-.43-1.83-1.13-2.42C19.36.77 18.45.44 17.5.44c-.88"," 0-1.74.28-2.39.8-.67.53-1.06 1.28-1.06 2.1 0 .76.34"," 1.47.93 1.97.59.49 1.41.84 2.32 1.15.7.24 1.26.5 1.62.8.35.3.53.64.53"," 1.02 0 .48-.2.93-.55 1.24-.36.3-.84.48-1.37.48-.55 0-1.04-.2-1.39-.54","-.34-.33-.53-.8-.53-1.32h-1.58c.01 1.02.43 1.95 1.16 2.57.72.62 1.67.96"," 2.67.96.92 0 1.81-.3 2.46-.84.67-.56 1.04-1.33 1.04-2.18 0-.81-.36-1.56","-.99-2.08-.62-.51-1.48-.88-2.43-1.2-.67-.23-1.2-.47-1.52-.75-.32-.27-.46",'-.59-.46-.94z"/>','<path d="M5.88 20h2.66l3.4-5.42L15.3 20h2.67l-4.73-7.38',' 4.37-6.62h-2.6l-3.07 4.98L8.92 6h-2.6l4.26 6.58z"/>',"</svg>"].join(""),keyBinding:"Mod-.",toHTMLString:s=>`<sup>${s}</sup>`,parseHTML:[{tag:"sup"}],sanitize:{tags:["sup"]}},{type:"subscript",opposite:"superscript",configKey:"subscript",rank:4,tag:"sub",icon:['<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">','<path d="M15.97 16.84c0-.47.19-.91.53-1.21.34-.31.8-.49'," 1.3-.49.5 0 .95.18 1.28.48.32.3.5.7.51 1.15h1.59c-.02","-.96-.43-1.83-1.13-2.42-.7-.58-1.61-.91-2.56-.91-.88"," 0-1.74.28-2.39.8-.67.53-1.06 1.28-1.06 2.1 0 .76.34"," 1.47.93 1.97.59.49 1.41.84 2.32 1.15.7.24 1.26.5 1.62.8.35.3.53.64.53"," 1.02 0 .48-.2.93-.55 1.24-.36.3-.84.48-1.37.48-.55 0-1.04-.2-1.39-.54","-.34-.33-.53-.8-.53-1.32h-1.58c.01 1.02.43 1.95 1.16 2.57.72.62 1.67.96"," 2.67.96.92 0 1.81-.3 2.46-.84.67-.56 1.04-1.33 1.04-2.18 0-.81-.36-1.56","-.99-2.08-.62-.51-1.48-.88-2.43-1.2-.67-.23-1.2-.47-1.52-.75-.32-.27-.46",'-.59-.46-.94z"/>','<path d="M5.88 18h2.66l3.4-5.42L15.3 18h2.67l-4.73-7.38',' 4.37-6.62h-2.6l-3.07 4.98L8.92 4h-2.6l4.26 6.58z"/>',"</svg>"].join(""),keyBinding:"Mod-,",toHTMLString:s=>`<sub>${s}</sub>`,parseHTML:[{tag:"sub"}],sanitize:{tags:["sub"]}}],m=class{id="super-sub";name="Superscript & Subscript";priority=23;config;locale;constructor(s){this.config={...l,...s}}async init(s){this.locale=await r(s,this.config.locale,c,n);const t=u.filter(s=>this.config[s.configKey]);for(const e of t)this.registerMark(s,e);this.registerKeymaps(s,t),this.registerExclusivityMiddleware(s,t),this.registerDisabledToolbarItems(s)}registerMark(r,o){const c=i(o.type),a=this.isToolbarVisible(o.configKey);if(r.registerMarkSpec({type:o.type,rank:o.rank,toDOM:()=>document.createElement(o.tag),toHTMLString:(s,t)=>o.toHTMLString(t),parseHTML:o.parseHTML,sanitize:o.sanitize}),r.registerCommand(c,()=>{const t=s(r.getState(),e(o.type));return!!t&&(r.dispatch(t),!0)}),a){const s="superscript"===o.type?this.locale.superscriptLabel:this.locale.subscriptLabel,i="superscript"===o.type?this.locale.superscriptTooltip(p(o.keyBinding)):this.locale.subscriptTooltip(p(o.keyBinding));r.registerToolbarItem({id:o.type,group:"format",icon:o.icon,label:s,tooltip:i,command:c,isActive:s=>t(s,e(o.type))})}}registerKeymaps(s,t){const e={};for(const r of t){const t=i(r.type);e[r.keyBinding]=()=>s.executeCommand(t)}Object.keys(e).length>0&&s.registerKeymap(e)}registerExclusivityMiddleware(s,t){t.some(s=>"superscript"===s.type)&&t.some(s=>"subscript"===s.type)&&s.registerMiddleware((s,t,i)=>{let r=!1;const o=[];for(const c of s.steps){if("addMark"!==c.type){o.push(c);continue}const s=c.mark.type,t=u.find(t=>t.type===s);if(!t){o.push(c);continue}r=!0;const i={type:"removeMark",blockId:c.blockId,from:c.from,to:c.to,mark:{type:e(t.opposite)},...c.path?{path:c.path}:{}};o.push(i,c)}let p=s.storedMarksAfter;if(p){const s=p.some(s=>"superscript"===s.type),t=p.some(s=>"subscript"===s.type);if(s&&t){const s=p.findLastIndex(s=>"superscript"===s.type)>p.findLastIndex(s=>"subscript"===s.type)?"subscript":"superscript";p=p.filter(t=>t.type!==s),r=!0}}i(r?{...s,steps:o,storedMarksAfter:p}:s)},{name:"super-sub:exclusivity"})}registerDisabledToolbarItems(s){if(this.config.toolbar)for(const t of u){const e=this.config[t.configKey],r=this.config.toolbar[t.configKey]??!0;if(!e&&r){const e="superscript"===t.type?this.locale.superscriptLabel:this.locale.subscriptLabel;s.registerToolbarItem({id:t.type,group:"format",icon:t.icon,label:e,command:i(t.type),isEnabled:()=>!1})}}}isToolbarVisible(s){return!this.config.toolbar||(this.config.toolbar[s]??!0)}};export{c as n,n as r,m as t};
|
|
2
|
-
//# sourceMappingURL=SuperSubPlugin-BOWFP1Kr.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SuperSubPlugin-BOWFP1Kr.mjs","names":[],"sources":["../../src/plugins/super-sub/SuperSubLocale.ts","../../src/plugins/super-sub/SuperSubPlugin.ts"],"sourcesContent":["/**\n * Locale interface and default English locale for the SuperSubPlugin.\n */\n\nimport { type LocaleModuleMap, loadLocaleModule } from '../shared/LocaleLoader.js';\n\n// --- Locale Interface ---\n\nexport interface SuperSubLocale {\n\treadonly superscriptLabel: string;\n\treadonly superscriptTooltip: (shortcut: string) => string;\n\treadonly subscriptLabel: string;\n\treadonly subscriptTooltip: (shortcut: string) => string;\n}\n\n// --- Default English Locale ---\n\nexport const SUPER_SUB_LOCALE_EN: SuperSubLocale = {\n\tsuperscriptLabel: 'Superscript',\n\tsuperscriptTooltip: (shortcut: string) => `Superscript (${shortcut})`,\n\tsubscriptLabel: 'Subscript',\n\tsubscriptTooltip: (shortcut: string) => `Subscript (${shortcut})`,\n};\n\n// --- Lazy Locale Loader ---\n\nconst localeModules: LocaleModuleMap<SuperSubLocale> = import.meta.glob<{\n\tdefault: SuperSubLocale;\n}>('./locales/*.ts', { eager: false });\n\nexport async function loadSuperSubLocale(lang: string): Promise<SuperSubLocale> {\n\treturn loadLocaleModule(localeModules, lang, SUPER_SUB_LOCALE_EN);\n}\n","/**\n * SuperSubPlugin: registers superscript and subscript inline marks with\n * MarkSpecs, toggle commands, keyboard shortcuts, toolbar buttons, and\n * a middleware that enforces mutual exclusivity between the two marks.\n *\n * Data-driven — each mark type is defined declaratively and all\n * registrations are derived from the same definition table.\n */\n\nimport { isMarkActive, toggleMark } from '../../commands/Commands.js';\nimport type { Mark } from '../../model/Document.js';\nimport type { ParseRule } from '../../model/ParseRule.js';\nimport type { SanitizeConfig } from '../../model/SanitizeConfig.js';\nimport { markType as mkType } from '../../model/TypeBrands.js';\nimport type { RemoveMarkStep, Step } from '../../state/Transaction.js';\nimport type { Plugin, PluginContext } from '../Plugin.js';\nimport { resolveLocale, toCommandName } from '../shared/PluginHelpers.js';\nimport { formatShortcut } from '../shared/ShortcutFormatting.js';\nimport { SUPER_SUB_LOCALE_EN, type SuperSubLocale, loadSuperSubLocale } from './SuperSubLocale.js';\n\n// --- Attribute Registry Augmentation ---\n\ndeclare module '../../model/AttrRegistry.js' {\n\tinterface MarkAttrRegistry {\n\t\tsuperscript: Record<string, never>;\n\t\tsubscript: Record<string, never>;\n\t}\n}\n\n// --- Configuration ---\n\n/** Controls toolbar button visibility per mark. */\nexport interface SuperSubToolbarConfig {\n\treadonly superscript?: boolean;\n\treadonly subscript?: boolean;\n}\n\n/** Controls which marks are enabled and which toolbar buttons are shown. */\nexport interface SuperSubConfig {\n\treadonly superscript: boolean;\n\treadonly subscript: boolean;\n\treadonly toolbar?: SuperSubToolbarConfig;\n\treadonly locale?: SuperSubLocale;\n}\n\nconst DEFAULT_CONFIG: SuperSubConfig = {\n\tsuperscript: true,\n\tsubscript: true,\n};\n\n// --- Mark Definitions ---\n\ninterface MarkDefinition {\n\treadonly type: 'superscript' | 'subscript';\n\treadonly opposite: 'superscript' | 'subscript';\n\treadonly configKey: keyof Omit<SuperSubConfig, 'toolbar' | 'locale'>;\n\treadonly rank: number;\n\treadonly tag: string;\n\treadonly icon: string;\n\treadonly keyBinding: string;\n\treadonly toHTMLString: (content: string) => string;\n\treadonly parseHTML: readonly ParseRule[];\n\treadonly sanitize: SanitizeConfig;\n}\n\nconst SUPERSCRIPT_ICON: string = [\n\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">',\n\t'<path d=\"M16 7.41L11.41 12 16 16.59 14.59 18l-6-6 6-6z\"',\n\t' fill=\"none\"/>',\n\t'<path d=\"M9.64 7.64c.23-.5.36-1.05.36-1.64',\n\t' 0-2.21-1.79-4-4-4H2v14h4.36c2.34 0 4.24-1.9',\n\t' 4.24-4.24 0-1.6-.89-2.99-2.2-3.71zM4.5 4.5H6c.83',\n\t' 0 1.5.67 1.5 1.5S6.83 7.5 6 7.5H4.5v-3zm2 9H4.5v-3H6.5c.83',\n\t' 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z\" fill=\"none\"/>',\n\t'<path d=\"M15.97 3.84c0-.47.19-.91.53-1.21.34-.31.8-.49',\n\t' 1.3-.49.5 0 .95.18 1.28.48.32.3.5.7.51 1.15h1.59c-.02',\n\t'-.96-.43-1.83-1.13-2.42C19.36.77 18.45.44 17.5.44c-.88',\n\t' 0-1.74.28-2.39.8-.67.53-1.06 1.28-1.06 2.1 0 .76.34',\n\t' 1.47.93 1.97.59.49 1.41.84 2.32 1.15.7.24 1.26.5 1.62.8.35.3.53.64.53',\n\t' 1.02 0 .48-.2.93-.55 1.24-.36.3-.84.48-1.37.48-.55 0-1.04-.2-1.39-.54',\n\t'-.34-.33-.53-.8-.53-1.32h-1.58c.01 1.02.43 1.95 1.16 2.57.72.62 1.67.96',\n\t' 2.67.96.92 0 1.81-.3 2.46-.84.67-.56 1.04-1.33 1.04-2.18 0-.81-.36-1.56',\n\t'-.99-2.08-.62-.51-1.48-.88-2.43-1.2-.67-.23-1.2-.47-1.52-.75-.32-.27-.46',\n\t'-.59-.46-.94z\"/>',\n\t'<path d=\"M5.88 20h2.66l3.4-5.42L15.3 20h2.67l-4.73-7.38',\n\t' 4.37-6.62h-2.6l-3.07 4.98L8.92 6h-2.6l4.26 6.58z\"/>',\n\t'</svg>',\n].join('');\n\nconst SUBSCRIPT_ICON: string = [\n\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">',\n\t'<path d=\"M15.97 16.84c0-.47.19-.91.53-1.21.34-.31.8-.49',\n\t' 1.3-.49.5 0 .95.18 1.28.48.32.3.5.7.51 1.15h1.59c-.02',\n\t'-.96-.43-1.83-1.13-2.42-.7-.58-1.61-.91-2.56-.91-.88',\n\t' 0-1.74.28-2.39.8-.67.53-1.06 1.28-1.06 2.1 0 .76.34',\n\t' 1.47.93 1.97.59.49 1.41.84 2.32 1.15.7.24 1.26.5 1.62.8.35.3.53.64.53',\n\t' 1.02 0 .48-.2.93-.55 1.24-.36.3-.84.48-1.37.48-.55 0-1.04-.2-1.39-.54',\n\t'-.34-.33-.53-.8-.53-1.32h-1.58c.01 1.02.43 1.95 1.16 2.57.72.62 1.67.96',\n\t' 2.67.96.92 0 1.81-.3 2.46-.84.67-.56 1.04-1.33 1.04-2.18 0-.81-.36-1.56',\n\t'-.99-2.08-.62-.51-1.48-.88-2.43-1.2-.67-.23-1.2-.47-1.52-.75-.32-.27-.46',\n\t'-.59-.46-.94z\"/>',\n\t'<path d=\"M5.88 18h2.66l3.4-5.42L15.3 18h2.67l-4.73-7.38',\n\t' 4.37-6.62h-2.6l-3.07 4.98L8.92 4h-2.6l4.26 6.58z\"/>',\n\t'</svg>',\n].join('');\n\nconst MARK_DEFINITIONS: readonly MarkDefinition[] = [\n\t{\n\t\ttype: 'superscript',\n\t\topposite: 'subscript',\n\t\tconfigKey: 'superscript',\n\t\trank: 4,\n\t\ttag: 'sup',\n\t\ticon: SUPERSCRIPT_ICON,\n\t\tkeyBinding: 'Mod-.',\n\t\ttoHTMLString: (content) => `<sup>${content}</sup>`,\n\t\tparseHTML: [{ tag: 'sup' }],\n\t\tsanitize: { tags: ['sup'] },\n\t},\n\t{\n\t\ttype: 'subscript',\n\t\topposite: 'superscript',\n\t\tconfigKey: 'subscript',\n\t\trank: 4,\n\t\ttag: 'sub',\n\t\ticon: SUBSCRIPT_ICON,\n\t\tkeyBinding: 'Mod-,',\n\t\ttoHTMLString: (content) => `<sub>${content}</sub>`,\n\t\tparseHTML: [{ tag: 'sub' }],\n\t\tsanitize: { tags: ['sub'] },\n\t},\n];\n\n// --- Plugin ---\n\nexport class SuperSubPlugin implements Plugin {\n\treadonly id = 'super-sub';\n\treadonly name = 'Superscript & Subscript';\n\treadonly priority = 23;\n\n\tprivate readonly config: SuperSubConfig;\n\tprivate locale!: SuperSubLocale;\n\n\tconstructor(config?: Partial<SuperSubConfig>) {\n\t\tthis.config = { ...DEFAULT_CONFIG, ...config };\n\t}\n\n\tasync init(context: PluginContext): Promise<void> {\n\t\tthis.locale = await resolveLocale(\n\t\t\tcontext,\n\t\t\tthis.config.locale,\n\t\t\tSUPER_SUB_LOCALE_EN,\n\t\t\tloadSuperSubLocale,\n\t\t);\n\n\t\tconst enabledMarks: MarkDefinition[] = MARK_DEFINITIONS.filter(\n\t\t\t(def) => this.config[def.configKey],\n\t\t);\n\n\t\tfor (const def of enabledMarks) {\n\t\t\tthis.registerMark(context, def);\n\t\t}\n\n\t\tthis.registerKeymaps(context, enabledMarks);\n\t\tthis.registerExclusivityMiddleware(context, enabledMarks);\n\t\tthis.registerDisabledToolbarItems(context);\n\t}\n\n\tprivate registerMark(context: PluginContext, def: MarkDefinition): void {\n\t\tconst commandName: string = toCommandName(def.type);\n\t\tconst toolbarVisible: boolean = this.isToolbarVisible(def.configKey);\n\n\t\tcontext.registerMarkSpec({\n\t\t\ttype: def.type,\n\t\t\trank: def.rank,\n\t\t\ttoDOM() {\n\t\t\t\treturn document.createElement(def.tag);\n\t\t\t},\n\t\t\ttoHTMLString: (_mark, content) => def.toHTMLString(content),\n\t\t\tparseHTML: def.parseHTML,\n\t\t\tsanitize: def.sanitize,\n\t\t});\n\n\t\tcontext.registerCommand(commandName, () => {\n\t\t\tconst tr = toggleMark(context.getState(), mkType(def.type));\n\t\t\tif (tr) {\n\t\t\t\tcontext.dispatch(tr);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\n\t\tif (toolbarVisible) {\n\t\t\tconst label: string =\n\t\t\t\tdef.type === 'superscript' ? this.locale.superscriptLabel : this.locale.subscriptLabel;\n\t\t\tconst tooltip: string =\n\t\t\t\tdef.type === 'superscript'\n\t\t\t\t\t? this.locale.superscriptTooltip(formatShortcut(def.keyBinding))\n\t\t\t\t\t: this.locale.subscriptTooltip(formatShortcut(def.keyBinding));\n\t\t\tcontext.registerToolbarItem({\n\t\t\t\tid: def.type,\n\t\t\t\tgroup: 'format',\n\t\t\t\ticon: def.icon,\n\t\t\t\tlabel,\n\t\t\t\ttooltip,\n\t\t\t\tcommand: commandName,\n\t\t\t\tisActive: (state) => isMarkActive(state, mkType(def.type)),\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate registerKeymaps(context: PluginContext, marks: readonly MarkDefinition[]): void {\n\t\tconst keymap: Record<string, () => boolean> = {};\n\t\tfor (const def of marks) {\n\t\t\tconst commandName: string = toCommandName(def.type);\n\t\t\tkeymap[def.keyBinding] = () => context.executeCommand(commandName);\n\t\t}\n\t\tif (Object.keys(keymap).length > 0) {\n\t\t\tcontext.registerKeymap(keymap);\n\t\t}\n\t}\n\n\t/**\n\t * Ensures superscript and subscript are mutually exclusive.\n\t * When an addMark step for one type is found, a removeMark step\n\t * for the opposite type is injected. For stored marks, the opposite\n\t * mark is filtered out.\n\t */\n\tprivate registerExclusivityMiddleware(\n\t\tcontext: PluginContext,\n\t\tenabledMarks: readonly MarkDefinition[],\n\t): void {\n\t\tconst bothEnabled: boolean =\n\t\t\tenabledMarks.some((d) => d.type === 'superscript') &&\n\t\t\tenabledMarks.some((d) => d.type === 'subscript');\n\n\t\tif (!bothEnabled) return;\n\n\t\tcontext.registerMiddleware(\n\t\t\t(tr, _state, next) => {\n\t\t\t\tlet patched = false;\n\n\t\t\t\t// Handle addMark steps: inject removeMark for the opposite type\n\t\t\t\tconst patchedSteps: Step[] = [];\n\t\t\t\tfor (const step of tr.steps) {\n\t\t\t\t\tif (step.type !== 'addMark') {\n\t\t\t\t\t\tpatchedSteps.push(step);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst markName: string = step.mark.type;\n\t\t\t\t\tconst def: MarkDefinition | undefined = MARK_DEFINITIONS.find((d) => d.type === markName);\n\t\t\t\t\tif (!def) {\n\t\t\t\t\t\tpatchedSteps.push(step);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tpatched = true;\n\t\t\t\t\tconst removeStep: RemoveMarkStep = {\n\t\t\t\t\t\ttype: 'removeMark',\n\t\t\t\t\t\tblockId: step.blockId,\n\t\t\t\t\t\tfrom: step.from,\n\t\t\t\t\t\tto: step.to,\n\t\t\t\t\t\tmark: { type: mkType(def.opposite) },\n\t\t\t\t\t\t...(step.path ? { path: step.path } : {}),\n\t\t\t\t\t};\n\t\t\t\t\tpatchedSteps.push(removeStep, step);\n\t\t\t\t}\n\n\t\t\t\t// Handle stored marks: remove the opposite mark\n\t\t\t\tlet storedMarksAfter: readonly Mark[] | null = tr.storedMarksAfter;\n\t\t\t\tif (storedMarksAfter) {\n\t\t\t\t\tconst hasSup: boolean = storedMarksAfter.some((m) => m.type === 'superscript');\n\t\t\t\t\tconst hasSub: boolean = storedMarksAfter.some((m) => m.type === 'subscript');\n\n\t\t\t\t\tif (hasSup && hasSub) {\n\t\t\t\t\t\t// Keep the one that was most recently added (last in array)\n\t\t\t\t\t\tconst lastSupIdx: number = storedMarksAfter.findLastIndex(\n\t\t\t\t\t\t\t(m) => m.type === 'superscript',\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst lastSubIdx: number = storedMarksAfter.findLastIndex(\n\t\t\t\t\t\t\t(m) => m.type === 'subscript',\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst removeType: string = lastSupIdx > lastSubIdx ? 'subscript' : 'superscript';\n\n\t\t\t\t\t\tstoredMarksAfter = storedMarksAfter.filter((m) => m.type !== removeType);\n\t\t\t\t\t\tpatched = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tnext(patched ? { ...tr, steps: patchedSteps, storedMarksAfter } : tr);\n\t\t\t},\n\t\t\t{ name: 'super-sub:exclusivity' },\n\t\t);\n\t}\n\n\t/**\n\t * Registers disabled toolbar buttons for marks whose feature is disabled\n\t * but whose toolbar button is explicitly requested.\n\t */\n\tprivate registerDisabledToolbarItems(context: PluginContext): void {\n\t\tif (!this.config.toolbar) return;\n\n\t\tfor (const def of MARK_DEFINITIONS) {\n\t\t\tconst featureEnabled: boolean = this.config[def.configKey];\n\t\t\tconst toolbarVisible: boolean = this.config.toolbar[def.configKey] ?? true;\n\n\t\t\tif (!featureEnabled && toolbarVisible) {\n\t\t\t\tconst label: string =\n\t\t\t\t\tdef.type === 'superscript' ? this.locale.superscriptLabel : this.locale.subscriptLabel;\n\t\t\t\tcontext.registerToolbarItem({\n\t\t\t\t\tid: def.type,\n\t\t\t\t\tgroup: 'format',\n\t\t\t\t\ticon: def.icon,\n\t\t\t\t\tlabel,\n\t\t\t\t\tcommand: toCommandName(def.type),\n\t\t\t\t\tisEnabled: () => false,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate isToolbarVisible(configKey: keyof Omit<SuperSubConfig, 'toolbar' | 'locale'>): boolean {\n\t\tif (!this.config.toolbar) return true;\n\t\treturn this.config.toolbar[configKey] ?? true;\n\t}\n}\n"],"mappings":"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"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as t,c as e,d as n,l as o,r,s as l}from"./Document-_qdGR4vh.mjs";import{c as i,l as s,o as a,r as c,t as d,u}from"./Selection-aeiSsvhe.mjs";import{a as b}from"./TypeBrands-BZDKMjR-.mjs";import{r as p}from"./HTMLUtils-B8xj8Z1x.mjs";import{t as h}from"./CommandHelpers-DTlQcGv5.mjs";import{a as m,o as f,s as g}from"./StyleRuntime-D3d1XFFe.mjs";import{n as v}from"./Plugin-BUNGKupW.mjs";import{i as x,t as w}from"./Decoration-oeHDjWWq.mjs";import{i as C,o as I}from"./PluginHelpers-D1QF-YaF.mjs";import{t as y}from"./KeyboardNav-CsdlWnNl.mjs";import{r as k}from"./PopupPositioning-DRNwWB0U.mjs";import{i as S}from"./ColorValidation-CiGxVsqd.mjs";import{n as L,t as A}from"./ColorGrid-BUSIBKZH.mjs";function R(){const t=r(b("paragraph"),[l("")],e());return r(b("table_cell"),[t],e())}function B(t,e){const n=t.getNodePath(e);if(!n)return null;let r=null,l=null,i=null,s=null;for(const o of n){const e=t.getBlock(o);e&&("table"===e.type?(r=o,l=e):"table_row"===e.type?i=o:"table_cell"===e.type&&(s=o))}if("table_cell"===t.getBlock(e)?.type&&(s=e),!(r&&l&&s&&i))return null;const a=t.doc.children.findIndex(t=>t.id===r),c=o(l),d=c.findIndex(t=>t.id===i);if(-1===d)return null;const u=c[d];if(!u)return null;const b=o(u),p=b.findIndex(t=>t.id===s);if(-1===p)return null;const h=b.length,m=c.length;return{tableId:r,tableIndex:a,rowId:i,rowIndex:d,cellId:s,colIndex:p,totalRows:m,totalCols:h}}function E(t,e,n,r){const l=t.getBlock(e);if(!l)return null;const i=o(l)[n];return i?o(i)[r]?.id??null:null}function T(t,e){const n=t.getBlock(e);if(!n)return e;const r=o(n)[0];if(!r)return e;let l=r;for(;;){const t=o(l)[0];if(!t)return l.id;l=t}}function M(t,e){const n=t.getBlock(e);if(!n)return e;const r=o(n),l=r[r.length-1];if(!l)return e;let i=l;for(;;){const t=o(i),e=t[t.length-1];if(!e)return i.id;i=e}}function N(t,e){const n=t.getNodePath(e);if(!n)return!1;for(const o of n)if("table"===t.getBlock(o)?.type)return!0;return!1}var H={insertRowAbove:"Insert Row Above",insertRowBelow:"Insert Row Below",insertColumnLeft:"Insert Column Left",insertColumnRight:"Insert Column Right",deleteRow:"Delete Row",deleteColumn:"Delete Column",borderColorLabel:"Border Color...",deleteTable:"Delete Table",tableActions:"Table actions",menuKeyboardHint:"↑↓ Navigate · Enter Select · Esc Close",insertRow:"Insert row",insertColumn:"Insert column",addRow:"Add row",addColumn:"Add column",tableActionsHint:"Table actions (Right-click or Shift+F10)",contextMenuHint:"Right-click or Shift+F10 for table actions",borderColor:"Border color",defaultColor:"Default",noBorders:"No borders",borderColorPicker:"Border color picker",announceBorderColorSet:t=>`Table border color set to ${t}`,announceBorderReset:"Table borders reset to default",borderSwatchLabel:t=>`Border ${t}`,announceRowInsertedAbove:"Row inserted above",announceRowInsertedBelow:"Row inserted below",announceColumnInserted:t=>`Column inserted ${t}`,announceRowDeleted:"Row deleted",announceColumnDeleted:"Column deleted",announceTableDeleted:"Table deleted",insertTable:"Insert Table",tableAriaLabel:(t,e)=>`Table with ${t} rows and ${e} columns`,tableAriaDescription:"Right-click or press Shift+F10 for table actions"},P=/* @__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-COx4cFpT.mjs"),"./locales/de.ts":()=>import("./de-DxyfCVlM.mjs"),"./locales/es.ts":()=>import("./es-CCAT_-nb.mjs"),"./locales/fr.ts":()=>import("./fr-BhM3Ykql.mjs"),"./locales/hi.ts":()=>import("./hi-FhcxnL2S.mjs"),"./locales/pt.ts":()=>import("./pt-CQIn2xA5.mjs"),"./locales/ru.ts":()=>import("./ru-afocv3DK.mjs"),"./locales/zh.ts":()=>import("./zh-bkCXy34A.mjs")});async function D(t){return I(P,t,H)}var z=["#000000","#434343","#666666","#999999","#b7b7b7","#cccccc","#d9d9d9","#efefef","#980000","#cc0000","#e69138","#f1c232","#6aa84f","#45818e","#3c78d8","#3d85c6","#674ea7","#a64d79","#0b5394","#38761d"];function $(t,e,n){const o=t.getBlock(e);if(!o||"table"!==o.type)return null;const r=t.getNodePath(e);if(!r)return null;if(void 0===n){const{borderColor:e,...n}=o.attrs??{},l=n;return t.transaction("command").setNodeAttr(r,l).setSelection(t.selection).build()}const l={...o.attrs,borderColor:n};return t.transaction("command").setNodeAttr(r,l).setSelection(t.selection).build()}function j(t,e,n=H){const o=t.getState();if(!u(o.selection))return!1;const r=B(o,o.selection.anchor.blockId);if(!r)return!1;const l=$(o,r.tableId,e);if(!l)return!1;t.dispatch(l);const i="none"===e?"none":L(e);return t.announce(n.announceBorderColorSet(i)),!0}function _(t,e=H){const n=t.getState();if(!u(n.selection))return!1;const o=B(n,n.selection.anchor.blockId);if(!o)return!1;const r=$(n,o.tableId,void 0);return!!r&&(t.dispatch(r),t.announce(e.announceBorderReset),!0)}function V(t,e){const n=t.getBlock(e);if(n)return n.attrs?.borderColor}function O(t,e,n,o,r=H){t.classList.add("notectl-color-picker");const l=V(e.getState(),n),i=document.createElement("button");i.type="button",i.className="notectl-color-picker__default",i.textContent=r.defaultColor,i.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation(),_(e,r),o()}),i.addEventListener("keydown",t=>{"Escape"===t.key&&(t.preventDefault(),o())}),t.appendChild(i);const s=document.createElement("button");s.type="button",s.className="notectl-color-picker__default",s.textContent=r.noBorders,s.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation(),j(e,"none",r),o()}),s.addEventListener("keydown",t=>{"Escape"===t.key&&(t.preventDefault(),o())}),t.appendChild(s),A(t,{colors:z,columns:5,ariaLabel:r.borderColorPicker,ariaLabelPrefix:"",activeColor:l??null,swatchLabel:r.borderSwatchLabel,titleAsName:!0,onSelect:t=>{j(e,t,r),o()},onClose:o})}function F(t,n,l){const i=t.getBlock(n);if(!i)return null;const s=o(i),a=s[0]?o(s[0]).length:0;if(0===a)return null;const c=function(t){const n=[];for(let e=0;e<t;e++)n.push(R());return r(b("table_row"),n,e())}(a),u=t.transaction("command").insertNode([n],l,c),p=o(c)[0],h=p?o(p)[0]:void 0;return h?u.setSelection(d(h.id,0)):p&&u.setSelection(d(p.id,0)),u.build()}function q(t,e,n){const r=t.getBlock(e);if(!r)return null;const l=o(r),i=t.transaction("command");for(const o of l){const t=R();i.insertNode([e,o.id],n,t)}return i.setSelection(t.selection),i.build()}function Z(t,e,n,r=0){const l=t.getBlock(e);if(!l)return null;if(o(l).length<=1)return K(t,e);const i=t.transaction("command").removeNode([e],n),s=E(t,e,n>0?n-1:1,r);if(s){const e=T(t,s);i.setSelection(d(e,0))}return i.build()}function Y(t,e,n,r=0){const l=t.getBlock(e);if(!l)return null;const i=o(l);if((i[0]?o(i[0]).length:0)<=1)return K(t,e);const s=t.transaction("command");for(let o=i.length-1;o>=0;o--){const t=i[o];t&&s.removeNode([e,t.id],n)}const a=E(t,e,r,n>0?n-1:1);if(a){const e=T(t,a);s.setSelection(d(e,0))}return s.build()}function K(n,o){const r=n.doc.children.findIndex(t=>t.id===o);if(-1===r)return null;if(1===n.doc.children.length){const o=t(e());return n.transaction("command").insertNode([],0,o).removeNode([],1).setSelection(d(o.id,0)).build()}const l=n.transaction("command").removeNode([],r),i=n.doc.children[r+1];if(i){const t=h(n,i.id,"start");if(t)return l.setSelection(t),l.build()}const s=n.doc.children[r-1];if(s){const t=h(n,s.id,"end");if(t)return l.setSelection(t),l.build()}return null}function X(t,n,l){const i=t.getState(),s=i.selection;if(!u(s))return!1;const a=s.anchor.blockId;let c=-1;for(let e=0;e<i.doc.children.length;e++){const t=i.doc.children[e];if(!t)continue;if(t.id===a){c=e;break}const n=i.getNodePath(a);if(n&&n[0]===t.id){c=e;break}}-1===c&&(c=i.doc.children.length-1);const p=function(t,n){const o=e(),l=[];for(let i=0;i<t;i++){const t=[];for(let e=0;e<n;e++)t.push(R());l.push(r(b("table_row"),t,e()))}return r(b("table"),l,o)}(n,l),h=r(b("paragraph")),m=c+1,f=i.transaction("command").insertNode([],m,p).insertNode([],m+1,h),g=o(p)[0],v=g?o(g)[0]:void 0,x=v?o(v)[0]:void 0;return x?f.setSelection(d(x.id,0)):v&&f.setSelection(d(v.id,0)),t.dispatch(f.build()),!0}function W(t,e){const n=t.getState();if(!u(n.selection))return!1;const o=B(n,n.selection.anchor.blockId);if(!o)return!1;const r=F(n,o.tableId,o.rowIndex+1);return!!r&&(t.dispatch(r),t.announce(e.announceRowInsertedBelow),!0)}function U(t,e,n){const o=t.getState();if(!u(o.selection))return!1;const r=B(o,o.selection.anchor.blockId);if(!r)return!1;const l="left"===e?r.colIndex:r.colIndex+1,i=q(o,r.tableId,l);return!!i&&(t.dispatch(i),t.announce(n.announceColumnInserted(e)),!0)}function G(t,e){t.registerCommand("insertTable",()=>X(t,3,3)),t.registerCommand("addRowAbove",()=>function(t,e){const n=t.getState();if(!u(n.selection))return!1;const o=B(n,n.selection.anchor.blockId);if(!o)return!1;const r=F(n,o.tableId,o.rowIndex);return!!r&&(t.dispatch(r),t.announce(e.announceRowInsertedAbove),!0)}(t,e)),t.registerCommand("addRowBelow",()=>W(t,e)),t.registerCommand("addColumnLeft",()=>function(t,e){return U(t,"left",e)}(t,e)),t.registerCommand("addColumnRight",()=>function(t,e){return U(t,"right",e)}(t,e)),t.registerCommand("deleteRow",()=>function(t,e){const n=t.getState();if(!u(n.selection))return!1;const o=B(n,n.selection.anchor.blockId);if(!o)return!1;const r=Z(n,o.tableId,o.rowIndex,o.colIndex);return!!r&&(t.dispatch(r),t.announce(e.announceRowDeleted),!0)}(t,e)),t.registerCommand("deleteColumn",()=>function(t,e){const n=t.getState();if(!u(n.selection))return!1;const o=B(n,n.selection.anchor.blockId);if(!o)return!1;const r=Y(n,o.tableId,o.colIndex,o.rowIndex);return!!r&&(t.dispatch(r),t.announce(e.announceColumnDeleted),!0)}(t,e)),t.registerCommand("selectTable",()=>function(t){const e=t.getState(),n=e.selection;if(s(n))return"table"===e.getBlock(n.nodeId)?.type;if(i(n))return!1;const o=B(e,n.anchor.blockId);if(!o)return!1;const r=e.getNodePath(o.tableId);if(!r)return!1;const l=e.transaction("command").setSelection(c(o.tableId,r)).build();return t.dispatch(l),!0}(t)),t.registerCommand("deleteTable",()=>function(t,e){const n=t.getState(),o=function(t){if(s(t.selection)){const e=t.getBlock(t.selection.nodeId);return"table"!==e?.type?null:{tableId:e.id}}if(i(t.selection))return null;const e=B(t,t.selection.anchor.blockId);return e?{tableId:e.tableId}:null}(n);if(!o)return!1;const r=K(n,o.tableId);return!!r&&(t.dispatch(r),t.announce(e.announceTableDeleted),!0)}(t,e))}function J(t,e,n,o,r,l=H,i){let s=!0,a=null,c=null;const d=document.createElement("div");d.className="notectl-table-context-menu",d.setAttribute("role","menu"),d.setAttribute("aria-label",l.tableActions),d.setAttribute("contenteditable","false");const u=[];let b=0;const p=function(t){return[{type:"item",label:t.insertRowAbove,command:"addRowAbove"},{type:"item",label:t.insertRowBelow,command:"addRowBelow"},{type:"separator"},{type:"item",label:t.insertColumnLeft,command:"addColumnLeft"},{type:"item",label:t.insertColumnRight,command:"addColumnRight"},{type:"separator"},{type:"item",label:t.deleteRow,command:"deleteRow"},{type:"item",label:t.deleteColumn,command:"deleteColumn"},{type:"separator"},{type:"submenu",label:t.borderColorLabel,id:"borderColor"},{type:"separator"},{type:"item",label:t.deleteTable,command:"deleteTable"}]}(l);for(const I of p){if("separator"===I.type){const t=document.createElement("div");t.setAttribute("role","separator"),d.appendChild(t);continue}const t=document.createElement("button");t.type="button",t.setAttribute("role","menuitem"),t.textContent=I.label,"submenu"===I.type&&(t.dataset.submenu=I.id,t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded","false")),"item"===I.type&&(t.dataset.command=I.command),t.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation()}),t.addEventListener("click",n=>{n.stopPropagation(),"item"===I.type?(e.executeCommand(I.command),C()):"submenu"===I.type&&m(t)}),u.push(t),d.appendChild(t)}const h=document.createElement("div");function m(o){if(f(),o.setAttribute("aria-expanded","true"),i)c=i.open({anchor:o,position:"right",referenceNode:d,parent:{close:()=>C(),getElement:()=>d},onClose:()=>{c=null,a=null,g()},content:(t,r)=>{t.className="notectl-table-context-menu",t.setAttribute("contenteditable","false"),a=t,t.addEventListener("keydown",t=>{t.stopPropagation();const e="rtl"===getComputedStyle(d).direction?"ArrowRight":"ArrowLeft";t.key===e&&(t.preventDefault(),r(),o.focus())}),O(t,e,n,()=>C(),l)}});else{a=document.createElement("div"),a.className="notectl-table-context-menu",a.setAttribute("contenteditable","false"),a.addEventListener("keydown",t=>{t.stopPropagation();const e="rtl"===getComputedStyle(d).direction?"ArrowRight":"ArrowLeft";t.key===e&&(t.preventDefault(),f(),o.focus())}),O(a,e,n,()=>C(),l),t.appendChild(a);const r=d.getBoundingClientRect(),i="rtl"===getComputedStyle(d).direction;k(a,r,{position:"right",isRtl:i}),requestAnimationFrame(()=>{(a?.querySelector("button"))?.focus()})}}function f(){c?(c.close(),c=null,a=null):a&&(a.remove(),a=null),g()}function g(){for(const t of u)t.dataset.submenu&&t.setAttribute("aria-expanded","false")}h.className="notectl-table-context-menu__hint",h.setAttribute("aria-hidden","true"),h.textContent=l.menuKeyboardHint,d.appendChild(h),y(u,b),d.addEventListener("keydown",t=>{switch(t.stopPropagation(),t.key){case"Escape":return t.preventDefault(),void C();case"ArrowDown":return t.preventDefault(),b=(b+1)%u.length,y(u,b),void u[b]?.focus();case"ArrowUp":return t.preventDefault(),b=(b-1+u.length)%u.length,y(u,b),void u[b]?.focus();case"ArrowRight":case"ArrowLeft":{t.preventDefault();const e="rtl"===getComputedStyle(d).direction?"ArrowLeft":"ArrowRight";if(t.key===e){const t=u[b];t?.dataset.submenu&&m(t)}else f(),u[b]?.focus();return}case"Enter":case" ":{t.preventDefault();const n=u[b];if(!n)return;return void(n.dataset.submenu?m(n):n.dataset.command&&(e.executeCommand(n.dataset.command),C()))}case"Home":return t.preventDefault(),b=0,y(u,b),void u[b]?.focus();case"End":return t.preventDefault(),b=u.length-1,y(u,b),void u[b]?.focus()}}),k(d,o,{position:"below-start"}),t.appendChild(d),u[0]?.focus(),requestAnimationFrame(()=>{s&&u[0]&&u[0].focus()});const v=t=>{const e=t.composedPath();e.includes(d)||a&&e.includes(a)||C()};let x=null,w=!1;function C(){s&&(s=!1,f(),d.remove(),null!==x&&(clearTimeout(x),x=null),w&&(document.removeEventListener("mousedown",v,!0),w=!1),r?.())}return x=setTimeout(()=>{x=null,document.addEventListener("mousedown",v,!0),w=!0},0),{isOpen:()=>s,close:C,destroy:C}}function Q(t,e){const n=t.getState();if(!u(n.selection))return!1;const o=n.selection,r=B(n,o.anchor.blockId);return!!r&&e(n,o,r)}function tt(t){return Q(t,(e,n,o)=>{const r=o.tableIndex+1;if(r>=e.doc.children.length)return!1;const l=e.doc.children[r];if(!l)return!1;const i=e.transaction("command").setSelection(d(l.id,0)).build();return t.dispatch(i),!0})}var et=null;function nt(t,e,n,o){const r=t.getState(),l=E(r,e,n,o);if(!l)return!1;const i=T(r,l),s=r.transaction("command").setSelection(d(i,0)).build();return t.dispatch(s),!0}function ot(t,e,o,r){const l=t.getState(),i=E(l,e,o,r);if(!i)return!1;const s=M(l,i),a=l.getBlock(s);if(!a)return!1;const c=n(a),u=l.transaction("command").setSelection(d(s,c)).build();return t.dispatch(u),!0}function rt(t,e){const n=t.getState(),o=n.getNodePath(e);if(!o)return!1;const r=n.transaction("input").setSelection(c(e,o)).build();return t.dispatch(r),!0}var lt='<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none"><path d="M6 1v10M1 6h10" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/></svg>';function it(t,e,n){const o=document.createElement("button");return o.className=t,o.innerHTML=e,o.title=n,o.type="button",o.setAttribute("aria-label",n),o.setAttribute("contenteditable","false"),o.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation()}),o}function st(t,e){const n=document.createElement("div");n.className=`ntbl-insert-line ntbl-insert-line--${t}`,n.setAttribute("contenteditable","false"),n.setAttribute("data-notectl-no-print","");const o=it("ntbl-insert-btn",lt,e);return n.appendChild(o),n}function at(t,e){const n=document.createElement("button");n.className=`ntbl-add-zone ${t}`,n.type="button",n.setAttribute("contenteditable","false"),n.setAttribute("aria-label",e),n.setAttribute("data-notectl-no-print",""),n.title=e;const o=document.createElement("span");return o.className="ntbl-add-icon",o.innerHTML=lt,n.appendChild(o),n.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation()}),n}function ct(t){const e=document.createElement("div");return e.className=t,e.setAttribute("contenteditable","false"),e.setAttribute("data-notectl-no-print",""),e}function dt(t,e){f(t,"none"===e?{backgroundColor:"transparent",border:"1px dashed rgba(128,128,128,0.4)"}:e?{backgroundColor:e,border:"1px solid rgba(0,0,0,0.15)"}:{backgroundColor:"var(--notectl-border)",border:"1px solid rgba(0,0,0,0.15)"})}function ut(t,e,n,o){const r=document.createElement("div");r.className=`ntbl-handle ${t}`,r.dataset.index=String(e);const l=it("ntbl-handle-delete",'<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 10 10" fill="none"><path d="M2 2l6 6M8 2l-6 6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>',n);return l.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation(),o(e)}),r.appendChild(l),r}function bt(t,e){let n=0,o=0,r=t;for(;r&&r!==e;)n+=r.offsetTop,o+=r.offsetLeft,r=r.offsetParent;return{top:n,left:o}}var pt=class{tableId;numRows;numCols;activeRowIndex=-1;activeColIndex=-1;colBar;rowBar;insertLineH;insertLineV;addRowZone;addColZone;deleteTableBtn;borderColorBtn;actionsBtn;contextHint;observer;borderColorPopup=null;activeContextMenu=null;container;tableEl;getState;dispatchFn;pluginContext;locale;onMouseMove=t=>{const e=this.tableEl.getBoundingClientRect(),n=t.clientX-e.left,o=t.clientY-e.top;if(!(n>=-10&&n<=e.width+10&&o>=-10&&o<=e.height+10))return void this.hideInsertLines();const r=function(t,e,n,o){let r=Number.POSITIVE_INFINITY,l=null;for(const a of n){const t=Math.abs(e-a.position);t<r&&t<10&&(r=t,l=a)}let i=Number.POSITIVE_INFINITY,s=null;for(const a of o){const e=Math.abs(t-a.position);e<i&&e<10&&(i=e,s=a)}return l&&(!s||r<=i)?{type:"row",border:l}:s?{type:"col",border:s}:{type:"none",border:null}}(n,o,function(t){const e=t.querySelectorAll(":scope > tbody > tr"),n=t.offsetTop,o=[];for(let r=1;r<e.length;r++){const t=e[r];t&&o.push({position:t.offsetTop-n,index:r})}return o}(this.tableEl),function(t,e){if(e<=1)return[];const n=t/e,o=[];for(let r=1;r<e;r++)o.push({position:Math.round(n*r),index:r});return o}(this.tableEl.offsetWidth,this.numCols));"row"===r.type&&r.border?(this.showHorizontalLine(r.border),this.hideVerticalLine()):"col"===r.type&&r.border?(this.showVerticalLine(r.border),this.hideHorizontalLine()):this.hideInsertLines()};onMouseLeave=()=>{this.hideInsertLines()};constructor(t,e,n,r,l,i,s=H){if(this.container=t,this.tableEl=e,this.getState=r,this.dispatchFn=l,this.pluginContext=i??null,this.locale=s,this.tableId=n.id,this.numRows=o(n).length,this.numCols=this.countCols(n),this.colBar=ct("ntbl-col-bar"),this.rowBar=ct("ntbl-row-bar"),this.insertLineH=st("horizontal",s.insertRow),this.insertLineV=st("vertical",s.insertColumn),this.addRowZone=at("ntbl-add-row",s.addRow),this.addColZone=at("ntbl-add-col",s.addColumn),this.deleteTableBtn=it("ntbl-delete-table-btn",'<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none"><path d="M9 3h6m-9 4h12M10 11v6m4-6v6m-9 3h14l-1-13H6L5 20z" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"/></svg>',s.deleteTable),this.deleteTableBtn.setAttribute("data-notectl-no-print",""),i){const t=V(r(),this.tableId);this.borderColorBtn=function(t,e){const n=it("ntbl-border-color-btn",'<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none"><path d="M3 3h18v18H3V3zm0 6h18M3 15h18M9 3v18M15 3v18" stroke="currentColor" stroke-width="1.5"/></svg>',t);n.setAttribute("data-notectl-no-print","");const o=document.createElement("span");return o.className="ntbl-border-color-swatch",dt(o,e),n.appendChild(o),n}(s.borderColor,t),this.actionsBtn=function(t){const e=it("ntbl-actions-btn",'<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="currentColor"><circle cx="12" cy="5" r="2"/><circle cx="12" cy="12" r="2"/><circle cx="12" cy="19" r="2"/></svg>',t);return e.setAttribute("data-notectl-no-print",""),e}(s.tableActionsHint)}else this.borderColorBtn=null,this.actionsBtn=null;t.append(this.colBar,this.rowBar,this.insertLineH,this.insertLineV,this.addRowZone,this.addColZone,this.deleteTableBtn),this.borderColorBtn&&t.appendChild(this.borderColorBtn),this.actionsBtn&&t.appendChild(this.actionsBtn),this.contextHint=function(t){const e=document.createElement("div");return e.className="ntbl-context-hint",e.setAttribute("aria-hidden","true"),e.setAttribute("contenteditable","false"),e.setAttribute("data-notectl-no-print",""),e.textContent=t,e}(s.contextMenuHint),t.appendChild(this.contextHint),this.rebuildColHandles(),this.rebuildRowHandles(),this.bindEventListeners(),this.observer=new ResizeObserver(()=>{this.positionControls()}),this.observer.observe(e),requestAnimationFrame(()=>this.positionControls())}update(t){this.tableId=t.id;const e=o(t).length,n=this.countCols(t);if(e===this.numRows&&n===this.numCols||(this.numRows=e,this.numCols=n,this.rebuildColHandles(),this.rebuildRowHandles()),this.borderColorBtn){const e=this.borderColorBtn.querySelector(".ntbl-border-color-swatch");if(e){const n=t.attrs?.borderColor;dt(e,n)}}requestAnimationFrame(()=>this.positionControls())}destroy(){this.activeContextMenu?.destroy(),this.closeBorderColorPopup(),this.observer.disconnect(),this.container.removeEventListener("mousemove",this.onMouseMove),this.container.removeEventListener("mouseleave",this.onMouseLeave),this.colBar.remove(),this.rowBar.remove(),this.insertLineH.remove(),this.insertLineV.remove(),this.addRowZone.remove(),this.addColZone.remove(),this.deleteTableBtn.remove(),this.borderColorBtn?.remove(),this.actionsBtn?.remove(),this.contextHint.remove()}bindEventListeners(){const t=this.insertLineH.querySelector(".ntbl-insert-btn"),e=this.insertLineV.querySelector(".ntbl-insert-btn");if(t.addEventListener("click",()=>{this.activeRowIndex>=0&&this.dispatchTransaction(F(this.getState(),this.tableId,this.activeRowIndex))}),e.addEventListener("click",()=>{this.activeColIndex>=0&&this.dispatchTransaction(q(this.getState(),this.tableId,this.activeColIndex))}),this.addRowZone.addEventListener("click",()=>{this.dispatchTransaction(F(this.getState(),this.tableId,this.numRows))}),this.addColZone.addEventListener("click",()=>{this.dispatchTransaction(q(this.getState(),this.tableId,this.numCols))}),this.deleteTableBtn.addEventListener("click",()=>{this.dispatchTransaction(K(this.getState(),this.tableId))}),this.borderColorBtn&&this.pluginContext){const t=this.pluginContext;this.borderColorBtn.addEventListener("click",()=>{this.toggleBorderColorPopup(t)})}if(this.actionsBtn&&this.pluginContext){const t=this.pluginContext;this.actionsBtn.addEventListener("click",()=>{this.openActionsMenu(t)})}this.container.addEventListener("mousemove",this.onMouseMove),this.container.addEventListener("mouseleave",this.onMouseLeave)}openActionsMenu(t){if(this.activeContextMenu?.isOpen())return this.activeContextMenu.close(),void(this.activeContextMenu=null);if(!this.actionsBtn)return;const e=this.actionsBtn.getBoundingClientRect(),n=new DOMRect(e.left,e.bottom+4,0,0);this.activeContextMenu=J(this.container,t,this.tableId,n,()=>{this.activeContextMenu=null},this.locale)}toggleBorderColorPopup(t){this.borderColorPopup?this.closeBorderColorPopup():(this.borderColorPopup=document.createElement("div"),this.borderColorPopup.className="notectl-table-context-menu",f(this.borderColorPopup,{position:"absolute",top:"24px",left:"24px",zIndex:"10000"}),this.borderColorPopup.setAttribute("contenteditable","false"),O(this.borderColorPopup,t,this.tableId,()=>{this.closeBorderColorPopup()},this.locale),this.container.appendChild(this.borderColorPopup))}closeBorderColorPopup(){this.borderColorPopup&&(this.borderColorPopup.remove(),this.borderColorPopup=null)}dispatchTransaction(t){t&&this.dispatchFn(t)}countCols(t){const e=o(t);return e[0]?o(e[0]).length:0}positionControls(){!function(t,e,n){const o=t.children;if(0===o.length)return;const r=e/n;for(let l=0;l<o.length;l++){const t=o[l];f(t,{left:`${Math.round(r*l)}px`,width:`${Math.round(r)}px`})}g(t,"width",`${e}px`)}(this.colBar,this.tableEl.offsetWidth,this.numCols),function(t,e){const n=t.children;if(0===n.length)return;const o=e.querySelectorAll(":scope > tbody > tr"),r=e.offsetTop;let l=0;for(let i=0;i<n.length;i++){const t=n[i],e=o[i];if(e){const n=e.offsetTop-r,o=e.offsetHeight;f(t,{top:`${n}px`,height:`${o}px`}),l=n+o}}g(t,"height",`${l}px`)}(this.rowBar,this.tableEl),function(t,e,n,o){const r=bt(n,o),l=n.offsetHeight,i=n.offsetWidth;f(t,{width:`${i}px`,left:`${r.left}px`}),f(e,{height:`${l}px`,top:`${r.top}px`})}(this.addRowZone,this.addColZone,this.tableEl,this.container)}showHorizontalLine(t){this.activeRowIndex=t.index;const e=bt(this.tableEl,this.container);f(this.insertLineH,{top:e.top+t.position-1+"px",left:`${e.left}px`,width:`${this.tableEl.offsetWidth}px`}),this.insertLineH.classList.add("ntbl-insert-line--visible")}showVerticalLine(t){this.activeColIndex=t.index;const e=bt(this.tableEl,this.container);f(this.insertLineV,{left:e.left+t.position-1+"px",top:`${e.top}px`,height:`${this.tableEl.offsetHeight}px`}),this.insertLineV.classList.add("ntbl-insert-line--visible")}hideInsertLines(){this.hideHorizontalLine(),this.hideVerticalLine()}hideHorizontalLine(){this.insertLineH.classList.remove("ntbl-insert-line--visible"),this.activeRowIndex=-1}hideVerticalLine(){this.insertLineV.classList.remove("ntbl-insert-line--visible"),this.activeColIndex=-1}rebuildColHandles(){this.colBar.innerHTML="";for(let t=0;t<this.numCols;t++){const e=ut("ntbl-col-handle",t,this.locale.deleteColumn,t=>{this.dispatchTransaction(Y(this.getState(),this.tableId,t))});this.colBar.appendChild(e)}}rebuildRowHandles(){this.rowBar.innerHTML="";for(let t=0;t<this.numRows;t++){const e=ut("ntbl-row-handle",t,this.locale.deleteRow,t=>{this.dispatchTransaction(Z(this.getState(),this.tableId,t))});this.rowBar.appendChild(e)}}};function ht(t,e){"none"===e?(g(t,"--ntbl-border-color","transparent"),t.classList.add("notectl-table--borderless")):e?(g(t,"--ntbl-border-color",e),t.classList.remove("notectl-table--borderless")):(m(t,"--ntbl-border-color"),t.classList.remove("notectl-table--borderless"))}var mt=new v("tableSelection"),ft={maxPickerRows:8,maxPickerCols:8},gt="border-collapse: collapse; width: 100%; table-layout: fixed",vt="border: 1px solid var(--ntbl-bc, #d0d0d0); padding: 8px 12px; vertical-align: top",xt=class{id="table";name="Table";priority=40;config;locale;selectionService=null;cleanupMouseSelection=null;context=null;constructor(t){this.config={...ft,...t}}async init(t){this.locale=await C(t,this.config.locale,H,D),t.registerStyleSheet('\n/* Table */\n.notectl-table-wrapper {\n\tmargin: 8px 0;\n\toverflow-x: auto;\n\tposition: relative;\n}\n\n.notectl-table {\n\twidth: 100%;\n\tborder-collapse: collapse;\n\ttable-layout: fixed;\n}\n\n.notectl-table td {\n\tborder: 1px solid var(--ntbl-border-color, var(--notectl-border));\n\tpadding: 8px 12px;\n\tmin-width: 60px;\n\tvertical-align: top;\n\tmin-height: 1.6em;\n}\n\n.notectl-table--borderless td {\n\tborder: 1px dashed rgba(128, 128, 128, 0.15);\n}\n\n@media print {\n\t.notectl-table--borderless td {\n\t\tborder: none;\n\t}\n}\n\n.notectl-table td:focus-within {\n\toutline: 2px solid var(--notectl-primary);\n\toutline-offset: -2px;\n}\n\n.notectl-table-cell--selected {\n\tbackground: var(--notectl-primary-muted);\n}\n\n/* Table Context Menu */\n.notectl-table-context-menu {\n\tbackground: var(--notectl-surface-overlay);\n\tborder: 1px solid var(--notectl-border);\n\tborder-radius: 6px;\n\tbox-shadow: 0 4px 12px var(--notectl-shadow);\n\tpadding: 4px 0;\n\tmin-width: 180px;\n\tz-index: 10000;\n}\n\n.notectl-table-context-menu button {\n\tdisplay: block;\n\twidth: 100%;\n\tpadding: 8px 12px;\n\ttext-align: start;\n\tborder: none;\n\tbackground: none;\n\tcursor: pointer;\n\tfont-size: 14px;\n\tcolor: var(--notectl-fg);\n\tfont-family: inherit;\n}\n\n.notectl-table-context-menu button:hover {\n\tbackground: var(--notectl-hover-bg);\n}\n\n.notectl-table-context-menu hr {\n\tborder: none;\n\tborder-top: 1px solid var(--notectl-border);\n\tmargin: 4px 0;\n}\n\n/* === Table Controls === */\n\n/* Outer container for table + controls */\n.ntbl-container {\n\tposition: relative;\n\tmargin: 8px 0;\n\tpadding-block-start: 24px;\n\tpadding-inline-start: 24px;\n}\n\n.ntbl-container .notectl-table-wrapper {\n\tmargin: 0;\n}\n\n.ntbl-container.notectl-table--selected .notectl-table-wrapper {\n\toutline: 2px solid var(--notectl-primary-fg);\n\toutline-offset: 2px;\n\tborder-radius: 6px;\n}\n\n/* --- Column Handle Bar --- */\n.ntbl-col-bar {\n\tposition: absolute;\n\ttop: 0;\n\tinset-inline-start: 24px;\n\theight: 20px;\n\tdisplay: flex;\n\topacity: 0;\n\ttransition: opacity 0.2s ease;\n\tz-index: 3;\n\tpointer-events: none;\n}\n\n.ntbl-container:hover .ntbl-col-bar,\n.ntbl-container:focus-within .ntbl-col-bar {\n\topacity: 1;\n\tpointer-events: auto;\n}\n\n.ntbl-container.notectl-table--selected .ntbl-col-bar {\n\topacity: 1;\n\tpointer-events: auto;\n}\n\n/* --- Row Handle Bar --- */\n.ntbl-row-bar {\n\tposition: absolute;\n\ttop: 24px;\n\tinset-inline-start: 0;\n\twidth: 20px;\n\tdisplay: flex;\n\tflex-direction: column;\n\topacity: 0;\n\ttransition: opacity 0.2s ease;\n\tz-index: 3;\n\tpointer-events: none;\n}\n\n.ntbl-container:hover .ntbl-row-bar,\n.ntbl-container:focus-within .ntbl-row-bar {\n\topacity: 1;\n\tpointer-events: auto;\n}\n\n.ntbl-container.notectl-table--selected .ntbl-row-bar {\n\topacity: 1;\n\tpointer-events: auto;\n}\n\n/* --- Handle (shared base) --- */\n.ntbl-handle {\n\tposition: absolute;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tcursor: pointer;\n\ttransition: background 0.15s ease;\n\tborder-radius: 3px;\n}\n\n.ntbl-col-handle {\n\theight: 100%;\n\tbackground: var(--notectl-hover-bg);\n\tborder-radius: 4px 4px 0 0;\n}\n\n.ntbl-col-handle:hover {\n\tbackground: var(--notectl-border);\n}\n\n.ntbl-row-handle {\n\twidth: 100%;\n\tbackground: var(--notectl-hover-bg);\n\tborder-start-start-radius: 4px;\n\tborder-end-start-radius: 4px;\n}\n\n.ntbl-row-handle:hover {\n\tbackground: var(--notectl-border);\n}\n\n/* --- Handle Delete Button --- */\n.ntbl-handle-delete {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 16px;\n\theight: 16px;\n\tborder: none;\n\tbackground: transparent;\n\tcolor: var(--notectl-fg-muted);\n\tcursor: pointer;\n\tborder-radius: 3px;\n\tpadding: 0;\n\topacity: 0;\n\ttransform: scale(0.7);\n\ttransition: opacity 0.15s, transform 0.15s,\n\t\tbackground 0.15s, color 0.15s;\n}\n\n.ntbl-handle:hover .ntbl-handle-delete,\n.ntbl-handle:focus-within .ntbl-handle-delete {\n\topacity: 1;\n\ttransform: scale(1);\n}\n\n.ntbl-handle-delete:hover,\n.ntbl-handle-delete:focus-visible {\n\tbackground: var(--notectl-danger-muted);\n\tcolor: var(--notectl-danger);\n}\n\n.ntbl-handle-delete:focus-visible {\n\toutline: none;\n\tbox-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n/* --- Insert Lines --- */\n.ntbl-insert-line {\n\tposition: absolute;\n\tpointer-events: none;\n\topacity: 0;\n\ttransition: opacity 0.15s ease;\n\tz-index: 6;\n}\n\n.ntbl-insert-line--visible {\n\topacity: 1;\n\tpointer-events: auto;\n}\n\n.ntbl-insert-line--horizontal {\n\theight: 2px;\n\tbackground: linear-gradient(\n\t\t90deg,\n\t\ttransparent,\n\t\tvar(--notectl-primary) 8%,\n\t\tvar(--notectl-primary) 92%,\n\t\ttransparent\n\t);\n\tbox-shadow: 0 0 6px var(--notectl-focus-ring);\n}\n\n.ntbl-insert-line--vertical {\n\twidth: 2px;\n\tbackground: linear-gradient(\n\t\t180deg,\n\t\ttransparent,\n\t\tvar(--notectl-primary) 8%,\n\t\tvar(--notectl-primary) 92%,\n\t\ttransparent\n\t);\n\tbox-shadow: 0 0 6px var(--notectl-focus-ring);\n}\n\n/* --- Insert Button on Line --- */\n.ntbl-insert-btn {\n\tposition: absolute;\n\twidth: 20px;\n\theight: 20px;\n\tborder-radius: 50%;\n\tbackground: var(--notectl-surface-raised);\n\tborder: 2px solid var(--notectl-primary);\n\tcolor: var(--notectl-primary);\n\tcursor: pointer;\n\tpointer-events: all;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tpadding: 0;\n\tbox-shadow: 0 2px 8px var(--notectl-focus-ring);\n\ttransition: background 0.15s, color 0.15s,\n\t\ttransform 0.15s, box-shadow 0.15s;\n}\n\n.ntbl-insert-line--horizontal .ntbl-insert-btn {\n\tleft: 50%;\n\ttop: -9px;\n\ttransform: translateX(-50%);\n}\n\n.ntbl-insert-line--vertical .ntbl-insert-btn {\n\ttop: 50%;\n\tinset-inline-start: -9px;\n\ttransform: translateY(-50%);\n}\n\n.ntbl-insert-btn:hover,\n.ntbl-insert-btn:focus-visible {\n\tbackground: var(--notectl-primary);\n\tcolor: var(--notectl-primary-fg);\n\tbox-shadow: 0 2px 12px var(--notectl-focus-ring);\n}\n\n.ntbl-insert-btn:focus-visible {\n\toutline: none;\n\tbox-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n.ntbl-insert-line--horizontal .ntbl-insert-btn:hover {\n\ttransform: translateX(-50%) scale(1.2);\n}\n\n.ntbl-insert-line--vertical .ntbl-insert-btn:hover {\n\ttransform: translateY(-50%) scale(1.2);\n}\n\n/* --- Add Row / Add Column Zones --- */\n.ntbl-add-zone {\n\tposition: absolute;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tcursor: pointer;\n\tuser-select: none;\n\topacity: 0;\n\ttransition: opacity 0.2s ease, background 0.2s ease,\n\t\tborder-color 0.2s ease;\n}\n\n.ntbl-container:hover .ntbl-add-zone,\n.ntbl-container:focus-within .ntbl-add-zone {\n\topacity: 1;\n}\n\n.ntbl-container.notectl-table--selected .ntbl-add-zone {\n\topacity: 1;\n}\n\n.ntbl-delete-table-btn {\n\tposition: absolute;\n\ttop: 0;\n\tinset-inline-start: 0;\n\twidth: 20px;\n\theight: 20px;\n\tborder: 1px solid var(--notectl-danger);\n\tborder-radius: 4px;\n\tbackground: var(--notectl-surface-raised);\n\tcolor: var(--notectl-danger);\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\topacity: 0;\n\ttransition: opacity 0.2s ease, background 0.15s, border-color 0.15s;\n\tz-index: 7;\n}\n\n.ntbl-container:hover .ntbl-delete-table-btn,\n.ntbl-container:focus-within .ntbl-delete-table-btn,\n.ntbl-container.notectl-table--selected .ntbl-delete-table-btn {\n\topacity: 1;\n}\n\n.ntbl-delete-table-btn:hover,\n.ntbl-delete-table-btn:focus-visible {\n\tbackground: var(--notectl-danger-muted);\n\tborder-color: var(--notectl-danger);\n}\n\n.ntbl-delete-table-btn:focus-visible {\n\toutline: none;\n\tbox-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n/* --- Context Menu Discovery Hint --- */\n.ntbl-context-hint {\n\tposition: absolute;\n\ttop: 4px;\n\tinset-inline-end: 0;\n\tfont-size: 11px;\n\tcolor: var(--notectl-fg-muted);\n\tpadding: 2px 8px;\n\tborder-radius: 4px;\n\topacity: 0;\n\ttransition: opacity 0.2s ease;\n\tpointer-events: none;\n\twhite-space: nowrap;\n\tz-index: 5;\n}\n\n.ntbl-container:hover .ntbl-context-hint,\n.ntbl-container:focus-within .ntbl-context-hint,\n.ntbl-container.notectl-table--selected .ntbl-context-hint {\n\topacity: 1;\n}\n\n/* --- Table Actions Button --- */\n.ntbl-actions-btn {\n\tposition: absolute;\n\ttop: 0;\n\tinset-inline-start: 48px;\n\twidth: 20px;\n\theight: 20px;\n\tborder: 1px solid var(--notectl-border);\n\tborder-radius: 4px;\n\tbackground: var(--notectl-surface-raised);\n\tcolor: var(--notectl-fg-muted);\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\topacity: 0;\n\ttransition: opacity 0.2s ease, background 0.15s, border-color 0.15s;\n\tz-index: 7;\n\tcursor: pointer;\n\tpadding: 0;\n}\n\n.ntbl-container:hover .ntbl-actions-btn,\n.ntbl-container:focus-within .ntbl-actions-btn,\n.ntbl-container.notectl-table--selected .ntbl-actions-btn {\n\topacity: 1;\n}\n\n.ntbl-actions-btn:hover,\n.ntbl-actions-btn:focus-visible {\n\tbackground: var(--notectl-hover-bg);\n\tborder-color: var(--notectl-primary);\n}\n\n.ntbl-actions-btn:focus-visible {\n\toutline: none;\n\tbox-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n/* --- Border Color Button --- */\n.ntbl-border-color-btn {\n\tposition: absolute;\n\ttop: 0;\n\tinset-inline-start: 24px;\n\twidth: 20px;\n\theight: 20px;\n\tborder: 1px solid var(--notectl-border);\n\tborder-radius: 4px;\n\tbackground: var(--notectl-surface-raised);\n\tcolor: var(--notectl-fg-muted);\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\topacity: 0;\n\ttransition: opacity 0.2s ease, background 0.15s, border-color 0.15s;\n\tz-index: 7;\n\tcursor: pointer;\n\tpadding: 0;\n}\n\n.ntbl-container:hover .ntbl-border-color-btn,\n.ntbl-container:focus-within .ntbl-border-color-btn,\n.ntbl-container.notectl-table--selected .ntbl-border-color-btn {\n\topacity: 1;\n}\n\n.ntbl-border-color-btn:hover,\n.ntbl-border-color-btn:focus-visible {\n\tbackground: var(--notectl-hover-bg);\n\tborder-color: var(--notectl-primary);\n}\n\n.ntbl-border-color-btn:focus-visible {\n\toutline: none;\n\tbox-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n.ntbl-border-color-swatch {\n\twidth: 10px;\n\theight: 10px;\n\tborder-radius: 2px;\n\tborder: 1px solid rgba(0, 0, 0, 0.15);\n}\n\n/* --- Context Menu Keyboard Hint --- */\n.notectl-table-context-menu__hint {\n\tpadding: 4px 12px 6px;\n\tfont-size: 11px;\n\tcolor: var(--notectl-fg-muted);\n\tborder-top: 1px solid var(--notectl-border);\n\tmargin-top: 4px;\n\ttext-align: center;\n\tuser-select: none;\n}\n\n/* --- Context Menu Focus --- */\n.notectl-table-context-menu button:focus-visible {\n\toutline: none;\n\tbackground: var(--notectl-primary-muted);\n\tbox-shadow: inset 0 0 0 2px var(--notectl-focus-ring);\n}\n\n.notectl-table-context-menu [role="separator"] {\n\tborder: none;\n\tborder-top: 1px solid var(--notectl-border);\n\tmargin: 4px 0;\n\theight: 0;\n}\n\n.ntbl-add-row {\n\tbottom: 0;\n\theight: 24px;\n\tborder: 1px dashed var(--notectl-border);\n\tborder-end-start-radius: 6px;\n\tborder-end-end-radius: 6px;\n\tborder-block-start: none;\n\tcolor: var(--notectl-fg-muted);\n\ttransform: translateY(100%);\n}\n\n.ntbl-add-row:hover,\n.ntbl-add-row:focus-visible {\n\tbackground: var(--notectl-primary-muted);\n\tborder-color: var(--notectl-primary);\n\tcolor: var(--notectl-primary);\n}\n\n.ntbl-add-row:focus-visible {\n\toutline: none;\n\tbox-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n.ntbl-add-col {\n\tinset-inline-end: 0;\n\ttop: 24px;\n\twidth: 24px;\n\tborder: 1px dashed var(--notectl-border);\n\tborder-start-end-radius: 6px;\n\tborder-end-end-radius: 6px;\n\tborder-inline-start: none;\n\tcolor: var(--notectl-fg-muted);\n\ttransform: translateX(100%);\n}\n\n[dir="rtl"] .ntbl-add-col {\n\ttransform: translateX(-100%);\n}\n\n.ntbl-add-col:hover,\n.ntbl-add-col:focus-visible {\n\tbackground: var(--notectl-primary-muted);\n\tborder-color: var(--notectl-primary);\n\tcolor: var(--notectl-primary);\n}\n\n.ntbl-add-col:focus-visible {\n\toutline: none;\n\tbox-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n.ntbl-add-icon {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\ttransition: transform 0.2s ease;\n}\n\n.ntbl-add-zone:hover .ntbl-add-icon {\n\ttransform: scale(1.15);\n}\n'),this.context=t,this.registerNodeSpecs(t),this.registerNodeViews(t),G(t,this.locale),t.registerCommand("resetTableBorderColor",()=>_(t,this.locale)),function(t,e){t.registerKeymap({Tab:()=>function(t,e){return Q(t,(n,o,r)=>r.colIndex<r.totalCols-1?nt(t,r.tableId,r.rowIndex,r.colIndex+1):r.rowIndex<r.totalRows-1?nt(t,r.tableId,r.rowIndex+1,0):(W(t,e),!0))}(t,e),"Shift-Tab":()=>function(t){return Q(t,(e,n,o)=>o.colIndex>0?nt(t,o.tableId,o.rowIndex,o.colIndex-1):!(o.rowIndex>0)||nt(t,o.tableId,o.rowIndex-1,o.totalCols-1))}(t),Backspace:()=>function(t){return Q(t,(e,n,o)=>{if(!a(n))return!1;if(0!==n.anchor.offset)return!1;if(0!==o.rowIndex||0!==o.colIndex)return!1;const r=T(e,o.cellId);return n.anchor.blockId===r&&rt(t,o.tableId)})}(t),Delete:()=>function(t){return Q(t,(e,o,r)=>{if(!a(o))return!1;const l=e.getBlock(o.anchor.blockId);if(!l)return!1;const i=n(l);if(o.anchor.offset!==i)return!1;if(r.rowIndex!==r.totalRows-1||r.colIndex!==r.totalCols-1)return!1;const s=M(e,r.cellId);return o.anchor.blockId===s&&rt(t,r.tableId)})}(t),ArrowDown:()=>function(t){return Q(t,(e,n,o)=>{const r=M(e,o.cellId);return n.anchor.blockId===r&&(o.rowIndex>=o.totalRows-1?tt(t):nt(t,o.tableId,o.rowIndex+1,o.colIndex))})}(t),ArrowUp:()=>function(t){return Q(t,(e,n,o)=>{const r=T(e,o.cellId);return n.anchor.blockId===r&&!(o.rowIndex<=0)&&nt(t,o.tableId,o.rowIndex-1,o.colIndex)})}(t),ArrowRight:()=>function(t){return Q(t,(e,o,r)=>{if(!a(o))return!1;const l=e.getBlock(o.anchor.blockId);if(!l)return!1;const i=n(l);if(o.anchor.offset!==i)return!1;const s=M(e,r.cellId);return o.anchor.blockId===s&&(r.colIndex<r.totalCols-1?nt(t,r.tableId,r.rowIndex,r.colIndex+1):!(r.rowIndex<r.totalRows-1)||nt(t,r.tableId,r.rowIndex+1,0))})}(t),ArrowLeft:()=>function(t){return Q(t,(e,n,o)=>{if(!a(n))return!1;if(0!==n.anchor.offset)return!1;const r=T(e,o.cellId);return n.anchor.blockId===r&&(o.colIndex>0?ot(t,o.tableId,o.rowIndex,o.colIndex-1):!(o.rowIndex>0)||ot(t,o.tableId,o.rowIndex-1,o.totalCols-1))})}(t),Escape:()=>tt(t),"Shift-F10":()=>function(t){return Q(t,(e,n,o)=>{const r=t.getContainer(),l=r.querySelector(`[data-block-id="${o.cellId}"]`);if(!l)return!1;const i=l.getBoundingClientRect(),s=new DOMRect(i.left+i.width/2,i.bottom,0,0),a=r.querySelector(`[data-block-id="${o.tableId}"].ntbl-container`)??r;return et?.close(),et=J(a,t,o.tableId,s,()=>{et=null}),!0})}(t)},{priority:"context"})}(t,this.locale),this.registerToolbarItem(t),this.selectionService=function(t){let e=null,n=[],o=/* @__PURE__ */new Set;function r(){if(!e)return n=[],void(o=/* @__PURE__ */new Set);const r=t.getState(),l=[],i=Math.min(e.fromRow,e.toRow),s=Math.max(e.fromRow,e.toRow),a=Math.min(e.fromCol,e.toCol),c=Math.max(e.fromCol,e.toCol);for(let t=i;t<=s;t++)for(let n=a;n<=c;n++){const o=E(r,e.tableId,t,n);o&&l.push(o)}n=l,o=new Set(l)}const l={getSelectedRange:()=>e,setSelectedRange(n){e=n,r();const o=t.getState();t.dispatch(o.transaction("api").setSelection(o.selection).build())},clearSelectionSilent(){e=null,r()},getSelectedCellIds:()=>n,isSelected:t=>o.has(t)};return t.registerService(mt,l),l}(t)}onReady(){this.context&&this.selectionService&&(this.cleanupMouseSelection=function(t,e){const n=t.getContainer();let o=null,r=!1;function l(n){const l=n.target.closest("td[data-block-id]");if(!l)return o=null,r=!1,void e.setSelectedRange(null);if(n.shiftKey){if(o){const r=B(t.getState(),l.getAttribute("data-block-id"));if(!r||r.tableId!==o.tableId)return o=null,void e.setSelectedRange(null);n.preventDefault(),e.setSelectedRange({tableId:o.tableId,fromRow:o.row,fromCol:o.col,toRow:r.rowIndex,toCol:r.colIndex})}}else{e.setSelectedRange(null);const n=B(t.getState(),l.getAttribute("data-block-id"));if(!n)return o=null,void(r=!1);o={tableId:n.tableId,row:n.rowIndex,col:n.colIndex},r=!0}}function i(n){if(!r||!o)return;const l=n.target.closest("td[data-block-id]");if(!l)return;const i=B(t.getState(),l.getAttribute("data-block-id"));i&&i.tableId===o.tableId&&(i.rowIndex===o.row&&i.colIndex===o.col||(n.preventDefault(),e.setSelectedRange({tableId:o.tableId,fromRow:o.row,fromCol:o.col,toRow:i.rowIndex,toCol:i.colIndex})))}function s(){r=!1}return n.addEventListener("mousedown",l),n.addEventListener("mousemove",i),document.addEventListener("mouseup",s),()=>{n.removeEventListener("mousedown",l),n.removeEventListener("mousemove",i),document.removeEventListener("mouseup",s)}}(this.context,this.selectionService))}destroy(){this.cleanupMouseSelection?.(),this.cleanupMouseSelection=null,this.selectionService=null,this.context=null}decorations(t){if(!this.selectionService)return w.empty;if(!this.selectionService.getSelectedRange())return w.empty;const e=t.selection;if(!u(e)||!N(t,e.anchor.blockId))return this.selectionService.clearSelectionSilent(),w.empty;const n=this.selectionService.getSelectedCellIds();if(0===n.length)return w.empty;const o=[];for(const r of n)o.push(x(r,{class:"notectl-table-cell--selected"}));return w.create(o)}registerNodeSpecs(t){t.registerNodeSpec({type:"table",group:"block",content:{allow:["table_row"],min:1},isolating:!0,selectable:!0,toDOM(t){const e=document.createElement("div");return e.className="notectl-table-wrapper",e.setAttribute("data-block-id",t.id),e},toHTML(t,e,n){const o=t.attrs?.borderColor,r=function(t){return t?"none"===t?`${gt}; --ntbl-bc: transparent`:S(t)?`${gt}; --ntbl-bc: ${p(t)}`:gt:gt}(o);return`<table${n?.styleAttr(r)??` style="${r}"`}>${e}</table>`},sanitize:{tags:["table","tbody"]}}),t.registerNodeSpec({type:"table_row",group:"table_content",content:{allow:["table_cell"],min:1},toDOM(t){const e=document.createElement("tr");return e.setAttribute("data-block-id",t.id),e.setAttribute("role","row"),e},toHTML:(t,e)=>`<tr>${e}</tr>`,sanitize:{tags:["tr"]}}),t.registerNodeSpec({type:"table_cell",group:"table_content",content:{allow:["paragraph","list_item","heading","blockquote","image","horizontal_rule"]},isolating:!0,toDOM(t){const e=document.createElement("td");return e.setAttribute("data-block-id",t.id),e.setAttribute("role","cell"),e},toHTML(t,e,n){const o=t.attrs?.colspan??1,r=t.attrs?.rowspan??1,l=[n?.styleAttr(vt)??` style="${vt}"`];return o>1&&l.push(` colspan="${o}"`),r>1&&l.push(` rowspan="${r}"`),`<td${l.join("")}>${e}</td>`},sanitize:{tags:["td"],attrs:["colspan","rowspan"]}})}registerNodeViews(t){t.getSchemaRegistry(),t.registerNodeView("table",function(t,e,n=H){return(t,r,l)=>{const i=document.createElement("div");i.className="ntbl-container",i.setAttribute("data-block-id",t.id),i.setAttribute("data-selectable","true");const s=document.createElement("div");s.className="notectl-table-wrapper";const a=document.createElement("table");a.className="notectl-table",a.setAttribute("role","table");const c=o(t),d=c.length,u=c[0]?o(c[0]).length:0;a.setAttribute("aria-label",n.tableAriaLabel(d,u)),a.setAttribute("aria-description",n.tableAriaDescription);const b=document.createElement("tbody");a.appendChild(b),s.appendChild(a),i.appendChild(s),ht(a,t.attrs?.borderColor);const p=document.createElement("div");p.className="notectl-sr-only",p.setAttribute("aria-live","polite"),p.setAttribute("aria-atomic","true"),i.appendChild(p);const h=function(t,e,n,o,r,l,i){return new pt(t,e,n,o,r,l,i)}(i,a,t,r,l,e,n);let m=null,f=t.id;const g=t=>{if(!e)return;t.preventDefault(),t.stopPropagation(),m?.close();const o=new DOMRect(t.clientX,t.clientY,0,0);m=J(i,e,f,o,()=>{m=null},n)};return a.addEventListener("contextmenu",g),{dom:i,contentDOM:b,update(t){if("table"!==t.type)return!1;f=t.id,i.setAttribute("data-block-id",t.id),i.setAttribute("data-selectable","true");const e=o(t),r=e.length,l=e[0]?o(e[0]).length:0;return a.setAttribute("aria-label",n.tableAriaLabel(r,l)),ht(a,t.attrs?.borderColor),h.update(t),!1},destroy(){m?.destroy(),a.removeEventListener("contextmenu",g),h.destroy()},selectNode(){i.classList.add("notectl-table--selected")},deselectNode(){i.classList.remove("notectl-table--selected")}}}}(0,t,this.locale)),t.registerNodeView("table_row",(t,e,n)=>{const o=document.createElement("tr");return o.setAttribute("data-block-id",t.id),o.setAttribute("role","row"),{dom:o,contentDOM:o,update:t=>("table_row"!==t.type||o.setAttribute("data-block-id",t.id),!1),destroy(){}}}),t.registerNodeView("table_cell",(t,e,n)=>{const o=document.createElement("td");o.setAttribute("data-block-id",t.id),o.setAttribute("role","cell");const r=t.attrs?.colspan??1,l=t.attrs?.rowspan??1;r>1&&(o.colSpan=r),l>1&&(o.rowSpan=l);const i=t.attrs?.align;return i&&"left"!==i&&g(o,"textAlign",i),{dom:o,contentDOM:o,update(t){if("table_cell"!==t.type)return!1;o.setAttribute("data-block-id",t.id);const e=t.attrs?.colspan??1,n=t.attrs?.rowspan??1;return e>1?o.colSpan=e:o.removeAttribute("colspan"),n>1?o.rowSpan=n:o.removeAttribute("rowspan"),!1},destroy(){}}})}registerToolbarItem(t){const e=this.config.maxPickerRows??8,n=this.config.maxPickerCols??8;t.registerToolbarItem({id:"table",group:"insert",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 3h18v18H3V3zm2 2v4h6V5H5zm8 0v4h6V5h-6zm-8 6v4h6v-4H5zm8 0v4h6v-4h-6zm-8 6v4h6v-4H5zm8 0v4h6v-4h-6z"/></svg>',label:this.locale.insertTable,tooltip:this.locale.insertTable,command:"insertTable",popupType:"gridPicker",popupConfig:{maxRows:e,maxCols:n,onSelect:(e,n)=>{X(t,e,n)}},isActive:t=>!!u(t.selection)&&N(t,t.selection.anchor.blockId)})}};export{mt as n,xt as t};
|
|
2
|
-
//# sourceMappingURL=TablePlugin-DZTMBkyu.mjs.map
|