@notectl/core 2.2.5 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (513) hide show
  1. package/dist/chunks/{AlignmentPlugin-BCHxo16v.mjs → AlignmentPlugin--xAFlRqE.mjs} +2 -2
  2. package/dist/chunks/{AlignmentPlugin-BCHxo16v.mjs.map → AlignmentPlugin--xAFlRqE.mjs.map} +1 -1
  3. package/dist/chunks/{AttrRegistry-DcDVyzLm.mjs → AttrRegistry-B3zB02z9.mjs} +2 -2
  4. package/dist/chunks/AttrRegistry-B3zB02z9.mjs.map +1 -0
  5. package/dist/chunks/{AttributedMarkCommands-D4W2Jgpj.mjs → AttributedMarkCommands-bagbH8Qt.mjs} +2 -2
  6. package/dist/chunks/{AttributedMarkCommands-D4W2Jgpj.mjs.map → AttributedMarkCommands-bagbH8Qt.mjs.map} +1 -1
  7. package/dist/chunks/{BidiIsolationPlugin-BddRbDCN.mjs → BidiIsolationPlugin-DBXyXpgm.mjs} +2 -2
  8. package/dist/chunks/{BidiIsolationPlugin-BddRbDCN.mjs.map → BidiIsolationPlugin-DBXyXpgm.mjs.map} +1 -1
  9. package/dist/chunks/BlockInsertion-CJusvrDL.mjs +2 -0
  10. package/dist/chunks/BlockInsertion-CJusvrDL.mjs.map +1 -0
  11. package/dist/chunks/BlockquotePlugin-Bz2glHwX.mjs +2 -0
  12. package/dist/chunks/{BlockquotePlugin-4V7KV_Sb.mjs.map → BlockquotePlugin-Bz2glHwX.mjs.map} +1 -1
  13. package/dist/chunks/{CaretNavigationPlugin-C6XBwp0N.mjs → CaretNavigationPlugin-CNsT0eb4.mjs} +2 -2
  14. package/dist/chunks/{CaretNavigationPlugin-C6XBwp0N.mjs.map → CaretNavigationPlugin-CNsT0eb4.mjs.map} +1 -1
  15. package/dist/chunks/CodeBlockPlugin-C1hrdbSZ.mjs +2 -0
  16. package/dist/chunks/CodeBlockPlugin-C1hrdbSZ.mjs.map +1 -0
  17. package/dist/chunks/{ColorGrid-CXRdpP_n.mjs → ColorGrid-C9RQoEWF.mjs} +2 -2
  18. package/dist/chunks/{ColorGrid-CXRdpP_n.mjs.map → ColorGrid-C9RQoEWF.mjs.map} +1 -1
  19. package/dist/chunks/ColorPickerPopup-DiA68Pzz.mjs +2 -0
  20. package/dist/chunks/{ColorPickerPopup-C_74bqid.mjs.map → ColorPickerPopup-DiA68Pzz.mjs.map} +1 -1
  21. package/dist/chunks/Commands-1dFFldi7.mjs +2 -0
  22. package/dist/chunks/Commands-1dFFldi7.mjs.map +1 -0
  23. package/dist/chunks/ContentModel-NpAj7vGW.mjs +2 -0
  24. package/dist/chunks/ContentModel-NpAj7vGW.mjs.map +1 -0
  25. package/dist/chunks/Decoration-BpoEOANl.mjs +2 -0
  26. package/dist/chunks/Decoration-BpoEOANl.mjs.map +1 -0
  27. package/dist/chunks/{DirectionDetection-C7XE0nxW.mjs → DirectionDetection-CDVSEWQ6.mjs} +2 -2
  28. package/dist/chunks/{DirectionDetection-C7XE0nxW.mjs.map → DirectionDetection-CDVSEWQ6.mjs.map} +1 -1
  29. package/dist/chunks/Document-827l3P80.mjs +2 -0
  30. package/dist/chunks/Document-827l3P80.mjs.map +1 -0
  31. package/dist/chunks/DocumentParser-D2tr3ZKn.mjs +2 -0
  32. package/dist/chunks/DocumentParser-D2tr3ZKn.mjs.map +1 -0
  33. package/dist/chunks/EditorEventBoundary-zpYRxryo.mjs +2 -0
  34. package/dist/chunks/EditorEventBoundary-zpYRxryo.mjs.map +1 -0
  35. package/dist/chunks/FontPlugin-By-TGrQo.mjs +2 -0
  36. package/dist/chunks/{FontPlugin-DB1_bgam.mjs.map → FontPlugin-By-TGrQo.mjs.map} +1 -1
  37. package/dist/chunks/{FontSizePlugin-DFvp7Ki9.mjs → FontSizePlugin-Dln-tYXV.mjs} +2 -2
  38. package/dist/chunks/FontSizePlugin-Dln-tYXV.mjs.map +1 -0
  39. package/dist/chunks/FormulaPlugin-By1befrR.mjs +2 -0
  40. package/dist/chunks/FormulaPlugin-By1befrR.mjs.map +1 -0
  41. package/dist/chunks/GapCursorNavigation-BuXngVu-.mjs +2 -0
  42. package/dist/chunks/{GapCursorNavigation-ycNzuQVH.mjs.map → GapCursorNavigation-BuXngVu-.mjs.map} +1 -1
  43. package/dist/chunks/{GapCursorPlugin-Zvxjnr82.mjs → GapCursorPlugin-DAxVzXRs.mjs} +2 -2
  44. package/dist/chunks/{GapCursorPlugin-Zvxjnr82.mjs.map → GapCursorPlugin-DAxVzXRs.mjs.map} +1 -1
  45. package/dist/chunks/HTMLUtils-Bhg3_P8B.mjs +2 -0
  46. package/dist/chunks/HTMLUtils-Bhg3_P8B.mjs.map +1 -0
  47. package/dist/chunks/{HardBreakPlugin-9DOyCyyM.mjs → HardBreakPlugin-DlbSlrdq.mjs} +2 -2
  48. package/dist/chunks/{HardBreakPlugin-9DOyCyyM.mjs.map → HardBreakPlugin-DlbSlrdq.mjs.map} +1 -1
  49. package/dist/chunks/HeadingPlugin-uMAjPOk5.mjs +2 -0
  50. package/dist/chunks/{HeadingPlugin-D9yvG2Aw.mjs.map → HeadingPlugin-uMAjPOk5.mjs.map} +1 -1
  51. package/dist/chunks/{HighlightPlugin-D4gh4RP7.mjs → HighlightPlugin-Bj7FPkIQ.mjs} +2 -2
  52. package/dist/chunks/{HighlightPlugin-D4gh4RP7.mjs.map → HighlightPlugin-Bj7FPkIQ.mjs.map} +1 -1
  53. package/dist/chunks/HorizontalRulePlugin-DUVmTQpX.mjs +2 -0
  54. package/dist/chunks/HorizontalRulePlugin-DUVmTQpX.mjs.map +1 -0
  55. package/dist/chunks/ImagePlugin-FToCOjd5.mjs +2 -0
  56. package/dist/chunks/{ImagePlugin-Cp_RINtc.mjs.map → ImagePlugin-FToCOjd5.mjs.map} +1 -1
  57. package/dist/chunks/{InlineCodePlugin-DMr4O7c7.mjs → InlineCodePlugin-pISIoGQE.mjs} +2 -2
  58. package/dist/chunks/InlineCodePlugin-pISIoGQE.mjs.map +1 -0
  59. package/dist/chunks/InlineStyleMarkSpec-CjSRj4f_.mjs +2 -0
  60. package/dist/chunks/{InlineStyleMarkSpec-4R6DC7ij.mjs.map → InlineStyleMarkSpec-CjSRj4f_.mjs.map} +1 -1
  61. package/dist/chunks/LinkPlugin-Ct5Z180S.mjs +2 -0
  62. package/dist/chunks/LinkPlugin-Ct5Z180S.mjs.map +1 -0
  63. package/dist/chunks/ListPlugin-DAY5ezNs.mjs +2 -0
  64. package/dist/chunks/ListPlugin-DAY5ezNs.mjs.map +1 -0
  65. package/dist/chunks/MarkInputRule-Bdi8KPus.mjs +2 -0
  66. package/dist/chunks/MarkInputRule-Bdi8KPus.mjs.map +1 -0
  67. package/dist/chunks/MarkdownHTMLRegistry-CKEx7LkR.mjs +2 -0
  68. package/dist/chunks/MarkdownHTMLRegistry-CKEx7LkR.mjs.map +1 -0
  69. package/dist/chunks/MarkdownParser-CWt3M6jR.mjs +2 -0
  70. package/dist/chunks/MarkdownParser-CWt3M6jR.mjs.map +1 -0
  71. package/dist/chunks/MarkdownSerializer-J-i28out.mjs +2 -0
  72. package/dist/chunks/MarkdownSerializer-J-i28out.mjs.map +1 -0
  73. package/dist/chunks/{NodeResolver-ChgLF_IP.mjs → NodeResolver-Dleih-8R.mjs} +2 -2
  74. package/dist/chunks/{NodeResolver-ChgLF_IP.mjs.map → NodeResolver-Dleih-8R.mjs.map} +1 -1
  75. package/dist/chunks/NodeSelectionCommands-1PjwUDTJ.mjs +2 -0
  76. package/dist/chunks/{NodeSelectionCommands-Dj4VxLdD.mjs.map → NodeSelectionCommands-1PjwUDTJ.mjs.map} +1 -1
  77. package/dist/chunks/PluginHelpers-Dx_0hfDe.mjs +2 -0
  78. package/dist/chunks/{PluginHelpers-KDuTlmXm.mjs.map → PluginHelpers-Dx_0hfDe.mjs.map} +1 -1
  79. package/dist/chunks/{PopupManager-CyOfZUab.mjs → PopupManager-CT-fMZJn.mjs} +2 -2
  80. package/dist/chunks/{PopupManager-CyOfZUab.mjs.map → PopupManager-CT-fMZJn.mjs.map} +1 -1
  81. package/dist/chunks/PopupPositioning-BFh6Ed1D.mjs +2 -0
  82. package/dist/chunks/{PopupPositioning-DtUrY9bh.mjs.map → PopupPositioning-BFh6Ed1D.mjs.map} +1 -1
  83. package/dist/chunks/PrintPlugin-7zz9mhhU.mjs +2 -0
  84. package/dist/chunks/PrintPlugin-7zz9mhhU.mjs.map +1 -0
  85. package/dist/chunks/{PrintTypes-WdtgSj74.mjs → PrintTypes-CxU69qu3.mjs} +3 -2
  86. package/dist/chunks/PrintTypes-CxU69qu3.mjs.map +1 -0
  87. package/dist/chunks/{RangeIterator-o8v3msQe.mjs → RangeIterator-DP7Ud3Gp.mjs} +2 -2
  88. package/dist/chunks/{RangeIterator-o8v3msQe.mjs.map → RangeIterator-DP7Ud3Gp.mjs.map} +1 -1
  89. package/dist/chunks/SchemaRegistry-CkBN-1yW.mjs +2 -0
  90. package/dist/chunks/SchemaRegistry-CkBN-1yW.mjs.map +1 -0
  91. package/dist/chunks/{SimpleMark-CaQtFAau.mjs → SimpleMark-7CQcA4RK.mjs} +2 -2
  92. package/dist/chunks/{SimpleMark-CaQtFAau.mjs.map → SimpleMark-7CQcA4RK.mjs.map} +1 -1
  93. package/dist/chunks/{SmartPastePlugin-Bi_wpTCV.mjs → SmartPastePlugin-CYa_nD9v.mjs} +2 -2
  94. package/dist/chunks/{SmartPastePlugin-Bi_wpTCV.mjs.map → SmartPastePlugin-CYa_nD9v.mjs.map} +1 -1
  95. package/dist/chunks/StrikethroughPlugin-C2oWvGc3.mjs +2 -0
  96. package/dist/chunks/StrikethroughPlugin-C2oWvGc3.mjs.map +1 -0
  97. package/dist/chunks/StyleRuntime-DW6omotc.mjs +2 -0
  98. package/dist/chunks/StyleRuntime-DW6omotc.mjs.map +1 -0
  99. package/dist/chunks/{SuperSubPlugin-DVP7VnIz.mjs → SuperSubPlugin-D1xaKrSu.mjs} +2 -2
  100. package/dist/chunks/{SuperSubPlugin-DVP7VnIz.mjs.map → SuperSubPlugin-D1xaKrSu.mjs.map} +1 -1
  101. package/dist/chunks/TableDimensions-BBhjHNjQ.mjs +2 -0
  102. package/dist/chunks/TableDimensions-BBhjHNjQ.mjs.map +1 -0
  103. package/dist/chunks/TablePlugin-PJe3zwr-.mjs +2 -0
  104. package/dist/chunks/TablePlugin-PJe3zwr-.mjs.map +1 -0
  105. package/dist/chunks/TextColorPlugin-CTd9tfeG.mjs +2 -0
  106. package/dist/chunks/{TextColorPlugin-C1qpzEOa.mjs.map → TextColorPlugin-CTd9tfeG.mjs.map} +1 -1
  107. package/dist/chunks/TextDirectionAutoPlugin-CPnKVVuI.mjs +2 -0
  108. package/dist/chunks/{TextDirectionAutoPlugin-CzWJjrvG.mjs.map → TextDirectionAutoPlugin-CPnKVVuI.mjs.map} +1 -1
  109. package/dist/chunks/{TextDirectionPlugin-DHB88HKf.mjs → TextDirectionPlugin-Bns_03vL.mjs} +2 -2
  110. package/dist/chunks/{TextDirectionPlugin-DHB88HKf.mjs.map → TextDirectionPlugin-Bns_03vL.mjs.map} +1 -1
  111. package/dist/chunks/TextDirectionService-BcX07mw2.mjs +2 -0
  112. package/dist/chunks/{TextDirectionService-OFOU6r_s.mjs.map → TextDirectionService-BcX07mw2.mjs.map} +1 -1
  113. package/dist/chunks/TextFormattingPlugin-DBVlePqj.mjs +2 -0
  114. package/dist/chunks/TextFormattingPlugin-DBVlePqj.mjs.map +1 -0
  115. package/dist/chunks/{ToolbarPlugin-CLz2wa2c.mjs → ToolbarPlugin-DtfGTO_V.mjs} +2 -2
  116. package/dist/chunks/{ToolbarPlugin-CLz2wa2c.mjs.map → ToolbarPlugin-DtfGTO_V.mjs.map} +1 -1
  117. package/dist/chunks/VideoPlugin-BrR8g6Rz.mjs +2 -0
  118. package/dist/chunks/VideoPlugin-BrR8g6Rz.mjs.map +1 -0
  119. package/dist/chunks/WordBoundary-CFpIJDNP.mjs +2 -0
  120. package/dist/chunks/{WordBoundary-DxeMBRyP.mjs.map → WordBoundary-CFpIJDNP.mjs.map} +1 -1
  121. package/dist/chunks/ar-Dg9PdDet.mjs +2 -0
  122. package/dist/chunks/ar-Dg9PdDet.mjs.map +1 -0
  123. package/dist/chunks/ar-eOA3UmiE.mjs +2 -0
  124. package/dist/chunks/{ar-BTShmP2E.mjs.map → ar-eOA3UmiE.mjs.map} +1 -1
  125. package/dist/chunks/de-DJ5EkXQo.mjs +2 -0
  126. package/dist/chunks/de-DJ5EkXQo.mjs.map +1 -0
  127. package/dist/chunks/{de-C--bRmjW.mjs → de-DRbhnS4T.mjs} +2 -2
  128. package/dist/chunks/{de-C--bRmjW.mjs.map → de-DRbhnS4T.mjs.map} +1 -1
  129. package/dist/chunks/{es-DFUVd7eO.mjs → es-BQ9dox_E.mjs} +2 -2
  130. package/dist/chunks/{es-DFUVd7eO.mjs.map → es-BQ9dox_E.mjs.map} +1 -1
  131. package/dist/chunks/es-CEAJj7aB.mjs +2 -0
  132. package/dist/chunks/es-CEAJj7aB.mjs.map +1 -0
  133. package/dist/chunks/fr-DhWQzZy3.mjs +2 -0
  134. package/dist/chunks/fr-DhWQzZy3.mjs.map +1 -0
  135. package/dist/chunks/{fr-BaXKyPmX.mjs → fr-NVOinLyF.mjs} +2 -2
  136. package/dist/chunks/{fr-BaXKyPmX.mjs.map → fr-NVOinLyF.mjs.map} +1 -1
  137. package/dist/chunks/full-DSWM4cKQ.mjs +2 -0
  138. package/dist/chunks/{full-Cah3qjCT.mjs.map → full-DSWM4cKQ.mjs.map} +1 -1
  139. package/dist/chunks/hi-BsZzSMfL.mjs +2 -0
  140. package/dist/chunks/hi-BsZzSMfL.mjs.map +1 -0
  141. package/dist/chunks/{hi-aH9HZG23.mjs → hi-DrC2H81d.mjs} +2 -2
  142. package/dist/chunks/{hi-aH9HZG23.mjs.map → hi-DrC2H81d.mjs.map} +1 -1
  143. package/dist/chunks/minimal-CFkkPXef.mjs +2 -0
  144. package/dist/chunks/{minimal-DqATlnAL.mjs.map → minimal-CFkkPXef.mjs.map} +1 -1
  145. package/dist/chunks/pt-BuZ7acHF.mjs +2 -0
  146. package/dist/chunks/pt-BuZ7acHF.mjs.map +1 -0
  147. package/dist/chunks/{pt-Hy-0Xnnc.mjs → pt-CFrcl1v_.mjs} +2 -2
  148. package/dist/chunks/{pt-Hy-0Xnnc.mjs.map → pt-CFrcl1v_.mjs.map} +1 -1
  149. package/dist/chunks/rolldown-runtime-H_PjY6_i.mjs +1 -0
  150. package/dist/chunks/ru-CsP6mLxp.mjs +2 -0
  151. package/dist/chunks/ru-CsP6mLxp.mjs.map +1 -0
  152. package/dist/chunks/{ru-BFpEOrVp.mjs → ru-gxbzqLL8.mjs} +2 -2
  153. package/dist/chunks/{ru-BFpEOrVp.mjs.map → ru-gxbzqLL8.mjs.map} +1 -1
  154. package/dist/chunks/src-DiAOfuOT.mjs +2 -0
  155. package/dist/chunks/src-DiAOfuOT.mjs.map +1 -0
  156. package/dist/chunks/zh-BFZOM3lF.mjs +2 -0
  157. package/dist/chunks/{zh-BjoyjClN.mjs.map → zh-BFZOM3lF.mjs.map} +1 -1
  158. package/dist/chunks/zh-CiIyOm6U.mjs +2 -0
  159. package/dist/chunks/zh-CiIyOm6U.mjs.map +1 -0
  160. package/dist/commands/BlockInsertion.d.ts +5 -3
  161. package/dist/commands/BlockInsertion.d.ts.map +1 -1
  162. package/dist/commands/SelectionDeletion.d.ts +13 -2
  163. package/dist/commands/SelectionDeletion.d.ts.map +1 -1
  164. package/dist/editor/ContentSerializer.d.ts +21 -0
  165. package/dist/editor/ContentSerializer.d.ts.map +1 -1
  166. package/dist/editor/EditorConfig.d.ts +17 -0
  167. package/dist/editor/EditorConfig.d.ts.map +1 -1
  168. package/dist/editor/EditorConfigController.d.ts +10 -0
  169. package/dist/editor/EditorConfigController.d.ts.map +1 -1
  170. package/dist/editor/EditorInitializer.d.ts +4 -0
  171. package/dist/editor/EditorInitializer.d.ts.map +1 -1
  172. package/dist/editor/EditorLocale.d.ts +2 -0
  173. package/dist/editor/EditorLocale.d.ts.map +1 -1
  174. package/dist/editor/MarkdownMode.d.ts +46 -0
  175. package/dist/editor/MarkdownMode.d.ts.map +1 -0
  176. package/dist/editor/NotectlEditor.d.ts +46 -3
  177. package/dist/editor/NotectlEditor.d.ts.map +1 -1
  178. package/dist/editor/locales/ar.d.ts.map +1 -1
  179. package/dist/editor/locales/de.d.ts.map +1 -1
  180. package/dist/editor/locales/es.d.ts.map +1 -1
  181. package/dist/editor/locales/fr.d.ts.map +1 -1
  182. package/dist/editor/locales/hi.d.ts.map +1 -1
  183. package/dist/editor/locales/pt.d.ts.map +1 -1
  184. package/dist/editor/locales/ru.d.ts.map +1 -1
  185. package/dist/editor/locales/zh.d.ts.map +1 -1
  186. package/dist/editor/styles/list.d.ts +1 -1
  187. package/dist/editor/styles/list.d.ts.map +1 -1
  188. package/dist/editor/styles/table.d.ts +1 -1
  189. package/dist/editor/styles/table.d.ts.map +1 -1
  190. package/dist/full.mjs +1 -1
  191. package/dist/html.d.ts +1 -0
  192. package/dist/html.d.ts.map +1 -1
  193. package/dist/html.mjs +1 -1
  194. package/dist/index.d.ts +5 -5
  195. package/dist/index.d.ts.map +1 -1
  196. package/dist/input/ClipboardHandler.d.ts +2 -0
  197. package/dist/input/ClipboardHandler.d.ts.map +1 -1
  198. package/dist/input/InputHandler.d.ts +7 -0
  199. package/dist/input/InputHandler.d.ts.map +1 -1
  200. package/dist/input/InputManager.d.ts +10 -0
  201. package/dist/input/InputManager.d.ts.map +1 -1
  202. package/dist/input/KeyboardHandler.d.ts.map +1 -1
  203. package/dist/input/MarkdownPasteDetector.d.ts +26 -0
  204. package/dist/input/MarkdownPasteDetector.d.ts.map +1 -0
  205. package/dist/input/PasteHTMLHandler.d.ts +18 -1
  206. package/dist/input/PasteHTMLHandler.d.ts.map +1 -1
  207. package/dist/input/PasteHandler.d.ts +30 -0
  208. package/dist/input/PasteHandler.d.ts.map +1 -1
  209. package/dist/input/PasteRichBlockHandler.d.ts.map +1 -1
  210. package/dist/input/SelectionDocument.d.ts +2 -1
  211. package/dist/input/SelectionDocument.d.ts.map +1 -1
  212. package/dist/markdown.d.ts +17 -0
  213. package/dist/markdown.d.ts.map +1 -0
  214. package/dist/markdown.mjs +1 -0
  215. package/dist/model/AttrRegistry.d.ts +2 -2
  216. package/dist/model/AttrRegistry.d.ts.map +1 -1
  217. package/dist/model/ContentModel.d.ts +12 -0
  218. package/dist/model/ContentModel.d.ts.map +1 -1
  219. package/dist/model/Document.d.ts +28 -3
  220. package/dist/model/Document.d.ts.map +1 -1
  221. package/dist/model/HTMLUtils.d.ts +15 -0
  222. package/dist/model/HTMLUtils.d.ts.map +1 -1
  223. package/dist/model/InlineNodeSpec.d.ts +7 -1
  224. package/dist/model/InlineNodeSpec.d.ts.map +1 -1
  225. package/dist/model/InputRule.d.ts +11 -0
  226. package/dist/model/InputRule.d.ts.map +1 -1
  227. package/dist/model/MarkSpec.d.ts +7 -1
  228. package/dist/model/MarkSpec.d.ts.map +1 -1
  229. package/dist/model/MarkdownSyntaxRegistry.d.ts +51 -0
  230. package/dist/model/MarkdownSyntaxRegistry.d.ts.map +1 -0
  231. package/dist/model/NodeSpec.d.ts +47 -1
  232. package/dist/model/NodeSpec.d.ts.map +1 -1
  233. package/dist/model/RichBlockData.d.ts +2 -0
  234. package/dist/model/RichBlockData.d.ts.map +1 -1
  235. package/dist/model/SchemaRegistry.d.ts.map +1 -1
  236. package/dist/model/TableDimensions.d.ts +11 -0
  237. package/dist/model/TableDimensions.d.ts.map +1 -0
  238. package/dist/notectl-core.mjs +1 -1
  239. package/dist/notectl-core.umd.js +1 -1
  240. package/dist/notectl-core.umd.js.map +1 -1
  241. package/dist/platform/EditorEventBoundary.d.ts +12 -0
  242. package/dist/platform/EditorEventBoundary.d.ts.map +1 -0
  243. package/dist/plugins/Plugin.d.ts +7 -0
  244. package/dist/plugins/Plugin.d.ts.map +1 -1
  245. package/dist/plugins/PluginContextFactory.d.ts +2 -0
  246. package/dist/plugins/PluginContextFactory.d.ts.map +1 -1
  247. package/dist/plugins/PluginManager.d.ts +2 -0
  248. package/dist/plugins/PluginManager.d.ts.map +1 -1
  249. package/dist/plugins/alignment.mjs +1 -1
  250. package/dist/plugins/bidi-isolation.mjs +1 -1
  251. package/dist/plugins/blockquote/BlockquotePlugin.d.ts +2 -0
  252. package/dist/plugins/blockquote/BlockquotePlugin.d.ts.map +1 -1
  253. package/dist/plugins/blockquote.mjs +1 -1
  254. package/dist/plugins/caret-navigation.mjs +1 -1
  255. package/dist/plugins/code-block/CodeBlockTypes.d.ts +2 -0
  256. package/dist/plugins/code-block/CodeBlockTypes.d.ts.map +1 -1
  257. package/dist/plugins/code-block.mjs +1 -1
  258. package/dist/plugins/font-size/FontSizeOperations.d.ts.map +1 -1
  259. package/dist/plugins/font-size.mjs +1 -1
  260. package/dist/plugins/font.mjs +1 -1
  261. package/dist/plugins/formula/DisplayMathNodeSpec.d.ts.map +1 -1
  262. package/dist/plugins/formula/FormulaInputRules.d.ts.map +1 -1
  263. package/dist/plugins/formula/FormulaMarkdownSyntax.d.ts +4 -0
  264. package/dist/plugins/formula/FormulaMarkdownSyntax.d.ts.map +1 -0
  265. package/dist/plugins/formula/FormulaPlugin.d.ts.map +1 -1
  266. package/dist/plugins/formula/FormulaTypes.d.ts +2 -0
  267. package/dist/plugins/formula/FormulaTypes.d.ts.map +1 -1
  268. package/dist/plugins/formula/InlineMathNodeSpec.d.ts.map +1 -1
  269. package/dist/plugins/formula.mjs +1 -1
  270. package/dist/plugins/gap-cursor.mjs +1 -1
  271. package/dist/plugins/hard-break.mjs +1 -1
  272. package/dist/plugins/heading/HeadingPlugin.d.ts +2 -0
  273. package/dist/plugins/heading/HeadingPlugin.d.ts.map +1 -1
  274. package/dist/plugins/heading.mjs +1 -1
  275. package/dist/plugins/highlight.mjs +1 -1
  276. package/dist/plugins/horizontal-rule/HorizontalRulePlugin.d.ts +2 -0
  277. package/dist/plugins/horizontal-rule/HorizontalRulePlugin.d.ts.map +1 -1
  278. package/dist/plugins/horizontal-rule.mjs +1 -1
  279. package/dist/plugins/image/ImagePlugin.d.ts +14 -0
  280. package/dist/plugins/image/ImagePlugin.d.ts.map +1 -1
  281. package/dist/plugins/image.mjs +1 -1
  282. package/dist/plugins/inline-code/InlineCodePlugin.d.ts.map +1 -1
  283. package/dist/plugins/inline-code.mjs +1 -1
  284. package/dist/plugins/link/LinkPlugin.d.ts +14 -0
  285. package/dist/plugins/link/LinkPlugin.d.ts.map +1 -1
  286. package/dist/plugins/link.mjs +1 -1
  287. package/dist/plugins/list/ListCommands.d.ts +5 -1
  288. package/dist/plugins/list/ListCommands.d.ts.map +1 -1
  289. package/dist/plugins/list/ListInputRules.d.ts.map +1 -1
  290. package/dist/plugins/list/ListItemContext.d.ts +27 -0
  291. package/dist/plugins/list/ListItemContext.d.ts.map +1 -0
  292. package/dist/plugins/list/ListKeyboardHandlers.d.ts.map +1 -1
  293. package/dist/plugins/list/ListPlugin.d.ts +2 -0
  294. package/dist/plugins/list/ListPlugin.d.ts.map +1 -1
  295. package/dist/plugins/list/ListToolbarItems.d.ts.map +1 -1
  296. package/dist/plugins/list.mjs +1 -1
  297. package/dist/plugins/print/PrintContentPreparer.d.ts.map +1 -1
  298. package/dist/plugins/print/PrintDestinationBridge.d.ts +23 -0
  299. package/dist/plugins/print/PrintDestinationBridge.d.ts.map +1 -0
  300. package/dist/plugins/print/PrintHostStyles.d.ts +50 -0
  301. package/dist/plugins/print/PrintHostStyles.d.ts.map +1 -0
  302. package/dist/plugins/print/PrintPlugin.d.ts.map +1 -1
  303. package/dist/plugins/print/PrintServiceImpl.d.ts +76 -3
  304. package/dist/plugins/print/PrintServiceImpl.d.ts.map +1 -1
  305. package/dist/plugins/print/PrintStyleCollector.d.ts +150 -21
  306. package/dist/plugins/print/PrintStyleCollector.d.ts.map +1 -1
  307. package/dist/plugins/print/StaticHostMarker.d.ts +18 -0
  308. package/dist/plugins/print/StaticHostMarker.d.ts.map +1 -0
  309. package/dist/plugins/print.mjs +1 -1
  310. package/dist/plugins/shared/MarkInputRule.d.ts +9 -0
  311. package/dist/plugins/shared/MarkInputRule.d.ts.map +1 -0
  312. package/dist/plugins/shared/PopupPositioning.d.ts +2 -0
  313. package/dist/plugins/shared/PopupPositioning.d.ts.map +1 -1
  314. package/dist/plugins/shared/index.d.ts +1 -0
  315. package/dist/plugins/shared/index.d.ts.map +1 -1
  316. package/dist/plugins/shared.mjs +1 -1
  317. package/dist/plugins/smart-paste.mjs +1 -1
  318. package/dist/plugins/strikethrough/StrikethroughPlugin.d.ts +2 -0
  319. package/dist/plugins/strikethrough/StrikethroughPlugin.d.ts.map +1 -1
  320. package/dist/plugins/strikethrough.mjs +1 -1
  321. package/dist/plugins/super-sub.mjs +1 -1
  322. package/dist/plugins/table/TableClipboard.d.ts +8 -0
  323. package/dist/plugins/table/TableClipboard.d.ts.map +1 -0
  324. package/dist/plugins/table/TableCommands.d.ts.map +1 -1
  325. package/dist/plugins/table/TableContextMenu.d.ts +11 -1
  326. package/dist/plugins/table/TableContextMenu.d.ts.map +1 -1
  327. package/dist/plugins/table/TableControls.d.ts +6 -1
  328. package/dist/plugins/table/TableControls.d.ts.map +1 -1
  329. package/dist/plugins/table/TableControlsDOM.d.ts +11 -2
  330. package/dist/plugins/table/TableControlsDOM.d.ts.map +1 -1
  331. package/dist/plugins/table/TableControlsLayout.d.ts +12 -3
  332. package/dist/plugins/table/TableControlsLayout.d.ts.map +1 -1
  333. package/dist/plugins/table/TableGrid.d.ts +57 -0
  334. package/dist/plugins/table/TableGrid.d.ts.map +1 -0
  335. package/dist/plugins/table/TableHelpers.d.ts +4 -0
  336. package/dist/plugins/table/TableHelpers.d.ts.map +1 -1
  337. package/dist/plugins/table/TableLocale.d.ts +30 -0
  338. package/dist/plugins/table/TableLocale.d.ts.map +1 -1
  339. package/dist/plugins/table/TableNavigation.d.ts +5 -1
  340. package/dist/plugins/table/TableNavigation.d.ts.map +1 -1
  341. package/dist/plugins/table/TableNodeViews.d.ts +13 -1
  342. package/dist/plugins/table/TableNodeViews.d.ts.map +1 -1
  343. package/dist/plugins/table/TablePlugin.d.ts +21 -1
  344. package/dist/plugins/table/TablePlugin.d.ts.map +1 -1
  345. package/dist/plugins/table/TableSelection.d.ts.map +1 -1
  346. package/dist/plugins/table/TableSizeEditor.d.ts +11 -0
  347. package/dist/plugins/table/TableSizeEditor.d.ts.map +1 -0
  348. package/dist/plugins/table/TableSizing.d.ts +70 -0
  349. package/dist/plugins/table/TableSizing.d.ts.map +1 -0
  350. package/dist/plugins/table/index.d.ts +3 -1
  351. package/dist/plugins/table/index.d.ts.map +1 -1
  352. package/dist/plugins/table/locales/ar.d.ts.map +1 -1
  353. package/dist/plugins/table/locales/de.d.ts.map +1 -1
  354. package/dist/plugins/table/locales/es.d.ts.map +1 -1
  355. package/dist/plugins/table/locales/fr.d.ts.map +1 -1
  356. package/dist/plugins/table/locales/hi.d.ts.map +1 -1
  357. package/dist/plugins/table/locales/pt.d.ts.map +1 -1
  358. package/dist/plugins/table/locales/ru.d.ts.map +1 -1
  359. package/dist/plugins/table/locales/zh.d.ts.map +1 -1
  360. package/dist/plugins/table.mjs +1 -1
  361. package/dist/plugins/text-color.mjs +1 -1
  362. package/dist/plugins/text-direction-auto.mjs +1 -1
  363. package/dist/plugins/text-direction.mjs +1 -1
  364. package/dist/plugins/text-formatting/TextFormattingPlugin.d.ts +9 -0
  365. package/dist/plugins/text-formatting/TextFormattingPlugin.d.ts.map +1 -1
  366. package/dist/plugins/text-formatting.mjs +1 -1
  367. package/dist/plugins/toolbar.mjs +1 -1
  368. package/dist/plugins/video/VideoCommands.d.ts.map +1 -1
  369. package/dist/plugins/video.mjs +1 -1
  370. package/dist/presets/full.mjs +1 -1
  371. package/dist/presets/minimal.mjs +1 -1
  372. package/dist/presets.mjs +1 -1
  373. package/dist/serialization/DocumentParser.d.ts.map +1 -1
  374. package/dist/serialization/DocumentSerializer.d.ts +2 -0
  375. package/dist/serialization/DocumentSerializer.d.ts.map +1 -1
  376. package/dist/serialization/HTMLSanitization.d.ts +15 -0
  377. package/dist/serialization/HTMLSanitization.d.ts.map +1 -0
  378. package/dist/serialization/MarkSerializer.d.ts +12 -0
  379. package/dist/serialization/MarkSerializer.d.ts.map +1 -1
  380. package/dist/serialization/MarkdownParser.d.ts +6 -0
  381. package/dist/serialization/MarkdownParser.d.ts.map +1 -0
  382. package/dist/serialization/MarkdownSerializer.d.ts +12 -0
  383. package/dist/serialization/MarkdownSerializer.d.ts.map +1 -0
  384. package/dist/serialization/MarkdownTypes.d.ts +59 -0
  385. package/dist/serialization/MarkdownTypes.d.ts.map +1 -0
  386. package/dist/serialization/TableDimensions.d.ts +37 -0
  387. package/dist/serialization/TableDimensions.d.ts.map +1 -0
  388. package/dist/serialization/markdown/BlockSerializers.d.ts +7 -0
  389. package/dist/serialization/markdown/BlockSerializers.d.ts.map +1 -0
  390. package/dist/serialization/markdown/BlockTokenizer.d.ts +54 -0
  391. package/dist/serialization/markdown/BlockTokenizer.d.ts.map +1 -0
  392. package/dist/serialization/markdown/GfmAutolink.d.ts +20 -0
  393. package/dist/serialization/markdown/GfmAutolink.d.ts.map +1 -0
  394. package/dist/serialization/markdown/GfmTableParser.d.ts +26 -0
  395. package/dist/serialization/markdown/GfmTableParser.d.ts.map +1 -0
  396. package/dist/serialization/markdown/InlineAst.d.ts +34 -0
  397. package/dist/serialization/markdown/InlineAst.d.ts.map +1 -0
  398. package/dist/serialization/markdown/InlineSerializers.d.ts +5 -0
  399. package/dist/serialization/markdown/InlineSerializers.d.ts.map +1 -0
  400. package/dist/serialization/markdown/InlineTokenizer.d.ts +5 -0
  401. package/dist/serialization/markdown/InlineTokenizer.d.ts.map +1 -0
  402. package/dist/serialization/markdown/LinkReferenceExtractor.d.ts +37 -0
  403. package/dist/serialization/markdown/LinkReferenceExtractor.d.ts.map +1 -0
  404. package/dist/serialization/markdown/MarkdownContext.d.ts +32 -0
  405. package/dist/serialization/markdown/MarkdownContext.d.ts.map +1 -0
  406. package/dist/serialization/markdown/MarkdownEntities.d.ts +33 -0
  407. package/dist/serialization/markdown/MarkdownEntities.d.ts.map +1 -0
  408. package/dist/serialization/markdown/MarkdownEscape.d.ts +33 -0
  409. package/dist/serialization/markdown/MarkdownEscape.d.ts.map +1 -0
  410. package/dist/serialization/markdown/MarkdownHTMLRegistry.d.ts +4 -0
  411. package/dist/serialization/markdown/MarkdownHTMLRegistry.d.ts.map +1 -0
  412. package/dist/serialization/markdown/MarkdownParseContext.d.ts +23 -0
  413. package/dist/serialization/markdown/MarkdownParseContext.d.ts.map +1 -0
  414. package/dist/state/Mapping.d.ts +33 -10
  415. package/dist/state/Mapping.d.ts.map +1 -1
  416. package/dist/state/StepApplication.d.ts +3 -1
  417. package/dist/state/StepApplication.d.ts.map +1 -1
  418. package/dist/state/StepHandlers.d.ts.map +1 -1
  419. package/dist/state/StepInversion.d.ts +2 -1
  420. package/dist/state/StepInversion.d.ts.map +1 -1
  421. package/dist/state/StepMapping.d.ts +3 -2
  422. package/dist/state/StepMapping.d.ts.map +1 -1
  423. package/dist/state/StepMaps.d.ts +3 -2
  424. package/dist/state/StepMaps.d.ts.map +1 -1
  425. package/dist/state/Steps.d.ts +34 -2
  426. package/dist/state/Steps.d.ts.map +1 -1
  427. package/dist/state/TransactionBuilder.d.ts +7 -1
  428. package/dist/state/TransactionBuilder.d.ts.map +1 -1
  429. package/dist/style/StyleRuntime.d.ts +7 -0
  430. package/dist/style/StyleRuntime.d.ts.map +1 -1
  431. package/dist/test/MarkdownConformanceUtils.d.ts +12 -0
  432. package/dist/test/MarkdownConformanceUtils.d.ts.map +1 -0
  433. package/dist/view/BlockRendering.d.ts +5 -0
  434. package/dist/view/BlockRendering.d.ts.map +1 -1
  435. package/dist/view/DecorationRendering.d.ts +6 -0
  436. package/dist/view/DecorationRendering.d.ts.map +1 -1
  437. package/dist/view/EditorViewEvents.d.ts.map +1 -1
  438. package/dist/view/Reconciler.d.ts.map +1 -1
  439. package/package.json +14 -1
  440. package/dist/chunks/AttrRegistry-DcDVyzLm.mjs.map +0 -1
  441. package/dist/chunks/BlockInsertion-6rR9tIGP.mjs +0 -2
  442. package/dist/chunks/BlockInsertion-6rR9tIGP.mjs.map +0 -1
  443. package/dist/chunks/BlockquotePlugin-4V7KV_Sb.mjs +0 -2
  444. package/dist/chunks/CodeBlockPlugin-DC0-BnNy.mjs +0 -2
  445. package/dist/chunks/CodeBlockPlugin-DC0-BnNy.mjs.map +0 -1
  446. package/dist/chunks/ColorPickerPopup-C_74bqid.mjs +0 -2
  447. package/dist/chunks/Commands-BIIpx_Zd.mjs +0 -2
  448. package/dist/chunks/Commands-BIIpx_Zd.mjs.map +0 -1
  449. package/dist/chunks/Decoration-ZeyVfwJB.mjs +0 -2
  450. package/dist/chunks/Decoration-ZeyVfwJB.mjs.map +0 -1
  451. package/dist/chunks/Document-r7vLOAGA.mjs +0 -2
  452. package/dist/chunks/Document-r7vLOAGA.mjs.map +0 -1
  453. package/dist/chunks/DocumentParser-CcTSeT1B.mjs +0 -2
  454. package/dist/chunks/DocumentParser-CcTSeT1B.mjs.map +0 -1
  455. package/dist/chunks/FontPlugin-DB1_bgam.mjs +0 -2
  456. package/dist/chunks/FontSizePlugin-DFvp7Ki9.mjs.map +0 -1
  457. package/dist/chunks/FormulaPlugin-BLEcyazj.mjs +0 -2
  458. package/dist/chunks/FormulaPlugin-BLEcyazj.mjs.map +0 -1
  459. package/dist/chunks/GapCursorNavigation-ycNzuQVH.mjs +0 -2
  460. package/dist/chunks/HTMLUtils-C6B4UT00.mjs +0 -2
  461. package/dist/chunks/HTMLUtils-C6B4UT00.mjs.map +0 -1
  462. package/dist/chunks/HeadingPlugin-D9yvG2Aw.mjs +0 -2
  463. package/dist/chunks/HorizontalRulePlugin-0FjHPZuA.mjs +0 -2
  464. package/dist/chunks/HorizontalRulePlugin-0FjHPZuA.mjs.map +0 -1
  465. package/dist/chunks/ImagePlugin-Cp_RINtc.mjs +0 -2
  466. package/dist/chunks/InlineCodePlugin-DMr4O7c7.mjs.map +0 -1
  467. package/dist/chunks/InlineStyleMarkSpec-4R6DC7ij.mjs +0 -2
  468. package/dist/chunks/LinkPlugin-DvZ3MPgL.mjs +0 -2
  469. package/dist/chunks/LinkPlugin-DvZ3MPgL.mjs.map +0 -1
  470. package/dist/chunks/ListPlugin-CVId2dE0.mjs +0 -2
  471. package/dist/chunks/ListPlugin-CVId2dE0.mjs.map +0 -1
  472. package/dist/chunks/NodeSelectionCommands-Dj4VxLdD.mjs +0 -2
  473. package/dist/chunks/PluginHelpers-KDuTlmXm.mjs +0 -2
  474. package/dist/chunks/PopupPositioning-DtUrY9bh.mjs +0 -2
  475. package/dist/chunks/PrintPlugin-C6gOJT6d.mjs +0 -2
  476. package/dist/chunks/PrintPlugin-C6gOJT6d.mjs.map +0 -1
  477. package/dist/chunks/PrintTypes-WdtgSj74.mjs.map +0 -1
  478. package/dist/chunks/StrikethroughPlugin-BLKDRWtf.mjs +0 -2
  479. package/dist/chunks/StrikethroughPlugin-BLKDRWtf.mjs.map +0 -1
  480. package/dist/chunks/StyleRuntime-BAutwDZT.mjs +0 -2
  481. package/dist/chunks/StyleRuntime-BAutwDZT.mjs.map +0 -1
  482. package/dist/chunks/TablePlugin-D93RR5xH.mjs +0 -2
  483. package/dist/chunks/TablePlugin-D93RR5xH.mjs.map +0 -1
  484. package/dist/chunks/TextColorPlugin-C1qpzEOa.mjs +0 -2
  485. package/dist/chunks/TextDirectionAutoPlugin-CzWJjrvG.mjs +0 -2
  486. package/dist/chunks/TextDirectionService-OFOU6r_s.mjs +0 -2
  487. package/dist/chunks/TextFormattingPlugin-Cubp3e7f.mjs +0 -2
  488. package/dist/chunks/TextFormattingPlugin-Cubp3e7f.mjs.map +0 -1
  489. package/dist/chunks/VideoPlugin-D9rQZol6.mjs +0 -2
  490. package/dist/chunks/VideoPlugin-D9rQZol6.mjs.map +0 -1
  491. package/dist/chunks/WordBoundary-DxeMBRyP.mjs +0 -2
  492. package/dist/chunks/ar-BTShmP2E.mjs +0 -2
  493. package/dist/chunks/ar-jbplYWkC.mjs +0 -2
  494. package/dist/chunks/ar-jbplYWkC.mjs.map +0 -1
  495. package/dist/chunks/de-DN-e6G5A.mjs +0 -2
  496. package/dist/chunks/de-DN-e6G5A.mjs.map +0 -1
  497. package/dist/chunks/es-CM55WeEN.mjs +0 -2
  498. package/dist/chunks/es-CM55WeEN.mjs.map +0 -1
  499. package/dist/chunks/fr-C_2i5Ono.mjs +0 -2
  500. package/dist/chunks/fr-C_2i5Ono.mjs.map +0 -1
  501. package/dist/chunks/full-Cah3qjCT.mjs +0 -2
  502. package/dist/chunks/hi-C9fvG91d.mjs +0 -2
  503. package/dist/chunks/hi-C9fvG91d.mjs.map +0 -1
  504. package/dist/chunks/minimal-DqATlnAL.mjs +0 -2
  505. package/dist/chunks/pt-GqLw5tN0.mjs +0 -2
  506. package/dist/chunks/pt-GqLw5tN0.mjs.map +0 -1
  507. package/dist/chunks/ru-4g_qsaLr.mjs +0 -2
  508. package/dist/chunks/ru-4g_qsaLr.mjs.map +0 -1
  509. package/dist/chunks/src-YY6n2SmV.mjs +0 -2
  510. package/dist/chunks/src-YY6n2SmV.mjs.map +0 -1
  511. package/dist/chunks/zh-BjoyjClN.mjs +0 -2
  512. package/dist/chunks/zh-DeZP08HI.mjs +0 -2
  513. package/dist/chunks/zh-DeZP08HI.mjs.map +0 -1
@@ -1,2 +0,0 @@
1
- import{c as t,o as s}from"./PluginHelpers-KDuTlmXm.mjs";import{t as o}from"./ShortcutFormatting-TwiufqeV.mjs";import{t as r}from"./SimpleMark-CaQtFAau.mjs";var i={label:"Strikethrough",tooltip:t=>`Strikethrough (${t})`},e=/* #__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-XmSFrtmd.mjs"),"./locales/de.ts":()=>import("./de-DViI26lG.mjs"),"./locales/es.ts":()=>import("./es-paXY7HFt.mjs"),"./locales/fr.ts":()=>import("./fr-ZsRdLuys.mjs"),"./locales/hi.ts":()=>import("./hi-CTWubxLY.mjs"),"./locales/pt.ts":()=>import("./pt-paXY7HFt.mjs"),"./locales/ru.ts":()=>import("./ru-Y11wuxOB.mjs"),"./locales/zh.ts":()=>import("./zh-C7iCgCRP.mjs")});async function a(s){return t(e,s,i)}var l={},h=class{id="strikethrough";name="Strikethrough";priority=22;config;locale;constructor(t){this.config={...l,...t}}async init(t){this.locale=await s(t,this.config.locale,i,a),r(t,{markSpec:{type:"strikethrough",rank:3,toDOM:()=>document.createElement("s"),toHTMLString:(t,s)=>`<s>${s}</s>`,parseHTML:[{tag:"s"},{tag:"strike"},{tag:"del"},{tag:"span",getAttrs:t=>!!t.style.textDecoration.includes("line-through")&&{}}],sanitize:{tags:["s"]}},command:"toggleStrikethrough",keyBinding:"Mod-Shift-X",toolbar:{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(o("Mod-Shift-X"))}})}};export{i as n,a as r,h as t};
2
- //# sourceMappingURL=StrikethroughPlugin-BLKDRWtf.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StrikethroughPlugin-BLKDRWtf.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 type { Plugin, PluginContext } from '../Plugin.js';\nimport { resolveLocale } from '../shared/PluginHelpers.js';\nimport { formatShortcut } from '../shared/ShortcutFormatting.js';\nimport { registerSimpleMark } from '../shared/SimpleMark.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\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\tregisterSimpleMark(context, {\n\t\t\tmarkSpec: {\n\t\t\t\ttype: 'strikethrough',\n\t\t\t\trank: 3,\n\t\t\t\ttoDOM() {\n\t\t\t\t\treturn document.createElement('s');\n\t\t\t\t},\n\t\t\t\ttoHTMLString: (_mark, content) => `<s>${content}</s>`,\n\t\t\t\tparseHTML: [\n\t\t\t\t\t{ tag: 's' },\n\t\t\t\t\t{ tag: 'strike' },\n\t\t\t\t\t{ tag: 'del' },\n\t\t\t\t\t{\n\t\t\t\t\t\ttag: 'span',\n\t\t\t\t\t\tgetAttrs: (el: HTMLElement) => {\n\t\t\t\t\t\t\treturn el.style.textDecoration.includes('line-through') ? {} : false;\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tsanitize: { tags: ['s'] },\n\t\t\t},\n\t\t\tcommand: 'toggleStrikethrough',\n\t\t\tkeyBinding: 'Mod-Shift-X',\n\t\t\ttoolbar: {\n\t\t\t\tid: 'strikethrough',\n\t\t\t\tgroup: 'format',\n\t\t\t\ticon,\n\t\t\t\tlabel: this.locale.label,\n\t\t\t\ttooltip: this.locale.tooltip(formatShortcut('Mod-Shift-X')),\n\t\t\t},\n\t\t});\n\t}\n}\n"],"mappings":"4JAeA,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,EAC9C,CCCA,IAAM,EAAsC,CAAC,EAIhC,EAAb,MACC,GAAc,gBACd,KAAgB,gBAChB,SAAoB,GAEpB,OACA,OAEA,WAAA,CAAY,GACX,KAAK,OAAS,IAAK,KAAmB,EACvC,CAEA,UAAM,CAAK,GACV,KAAK,aAAe,EACnB,EACA,KAAK,OAAO,OACZ,EACA,GAKD,EAAmB,EAAS,CAC3B,SAAU,CACT,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,CAAC,IAI9D,SAAU,CAAE,KAAM,CAAC,OAEpB,QAAS,sBACT,WAAY,cACZ,QAAS,CACR,GAAI,gBACJ,MAAO,SACP,KAAA,uIACA,MAAO,KAAK,OAAO,MACnB,QAAS,KAAK,OAAO,QAAQ,EAAe,kBAG/C"}
@@ -1,2 +0,0 @@
1
- var e="data-notectl-style-token",t=/* @__PURE__ */new WeakMap,n=/* @__PURE__ */new WeakMap;function s(){if("undefined"==typeof CSSStyleSheet)return null;try{return new CSSStyleSheet}catch{return null}}function o(e,s){const o=n.get(e);o&&(o.destroy(),n.delete(e)),t.set(e,{nonce:s.nonce,sheet:s.sheet??null})}function i(e){const s=n.get(e);s&&(s.destroy(),n.delete(e)),t.delete(e)}function r(e,t,n){const s=f(e);s?y(s.root,s.settings).setProperty(e,t,n):d(e,t,n)}function l(e,t){r(e,t,"")}function c(e,t){const n=f(e);if(n)y(n.root,n.settings).setProperties(e,t);else for(const[s,o]of Object.entries(t))d(e,s,o??"")}function a(e,t){const n=f(e);n?y(n.root,n.settings).setStyleText(e,t):e.style.cssText=t}function h(e,t){const n=f(e);if(!n){const n=e.style.cssText;return void(e.style.cssText=n?`${n}; ${t}`:t)}y(n.root,n.settings).appendStyleText(e,t)}function u(e){const n=m(e);if(n)return t.get(n)?.nonce}function d(e,t,n){t.startsWith("--")||t.includes("-")?n?e.style.setProperty(t,n):e.style.removeProperty(t):e.style[t]=n}function f(e){const n=function(e){return m(e)}(e);if(!n)return null;const s=t.get(n);return s?{root:n,settings:s}:null}function y(e,t){const s=n.get(e);if(s)return s;const o=new p(e,t);return n.set(e,o),o}function S(e){return"undefined"!=typeof ShadowRoot&&e instanceof ShadowRoot}function k(e){return"undefined"!=typeof Document&&e instanceof Document}function m(e){const t=S(e)||k(e)?e:e.getRootNode();return S(t)||k(t)?t:"undefined"!=typeof document?document:null}var p=class{declarationByElement=/* @__PURE__ */new WeakMap;tokenByDeclaration=/* @__PURE__ */new Map;declarationByToken=/* @__PURE__ */new Map;tokenRefCount=/* @__PURE__ */new Map;tokenByElement=/* @__PURE__ */new WeakMap;tokenCounter=0;root;nonce;sheet;fallbackStyleElement=null;ownsAdoptedSheet=!1;constructor(e,t){this.root=e,this.nonce=t.nonce,this.sheet=t.sheet??null}destroy(){this.clearRuntimeRules(),this.ownsAdoptedSheet&&this.sheet&&"adoptedStyleSheets"in this.root&&(this.root.adoptedStyleSheets=this.root.adoptedStyleSheets.filter(e=>e!==this.sheet)),this.fallbackStyleElement?.remove(),this.fallbackStyleElement=null,this.sheet=null,this.ownsAdoptedSheet=!1,this.tokenByDeclaration.clear(),this.declarationByToken.clear(),this.tokenRefCount.clear(),this.tokenCounter=0}setProperty(e,t,n){const s=this.getOrCreateDeclarations(e),o=R(t);n?s.set(o,n):s.delete(o),this.syncElementToken(e,s)}setProperties(e,t){const n=this.getOrCreateDeclarations(e);for(const[s,o]of Object.entries(t)){const e=R(s);o?n.set(e,o):n.delete(e)}this.syncElementToken(e,n)}setStyleText(e,t){const n=g(t);0!==n.size?(this.declarationByElement.set(e,n),this.syncElementToken(e,n)):this.clearElementStyles(e)}appendStyleText(e,t){const n=g(t);if(0===n.size)return;const s=this.getOrCreateDeclarations(e);for(const[o,i]of n)s.set(o,i);this.syncElementToken(e,s)}getStyleText(e){const t=this.declarationByElement.get(e);return t&&0!==t.size?E(t):""}getOrCreateDeclarations(e){const t=this.declarationByElement.get(e);if(t)return t;const n=/* @__PURE__ */new Map;return this.declarationByElement.set(e,n),n}syncElementToken(t,n){const s=this.tokenByElement.get(t);if(0===n.size)return void this.clearElementStyles(t);const o=E(n);let i=this.tokenByDeclaration.get(o);i||(i=`s${this.tokenCounter.toString(36)}`,this.tokenCounter+=1,this.tokenByDeclaration.set(o,i),this.declarationByToken.set(i,o),this.insertRule(i,o)),s!==i&&(this.retainToken(i),s&&this.releaseToken(s),this.tokenByElement.set(t,i)),t.setAttribute(e,i)}insertRule(e,t){const n=`${C(e)} { ${t}; }`,s=this.ensureSheet();if(s)try{s.insertRule(n,s.cssRules.length)}catch{}}ensureSheet(){if(this.sheet)return this.sheet;if("undefined"!=typeof CSSStyleSheet)try{const e=new CSSStyleSheet;if("adoptedStyleSheets"in this.root){const t=this.root.adoptedStyleSheets;return this.root.adoptedStyleSheets=[...t,e],this.sheet=e,this.ownsAdoptedSheet=!0,e}}catch{}const e=this.ensureFallbackStyleElement();return this.sheet=e.sheet??null,this.sheet}clearElementStyles(t){this.declarationByElement.delete(t);const n=this.tokenByElement.get(t);n&&(this.tokenByElement.delete(t),this.releaseToken(n)),t.removeAttribute(e)}retainToken(e){const t=this.tokenRefCount.get(e)??0;this.tokenRefCount.set(e,t+1)}releaseToken(e){const t=this.tokenRefCount.get(e);if(!t)return;if(t>1)return void this.tokenRefCount.set(e,t-1);this.tokenRefCount.delete(e);const n=this.declarationByToken.get(e);n&&(this.declarationByToken.delete(e),this.tokenByDeclaration.delete(n)),this.deleteRule(e)}deleteRule(e){const t=this.sheet;if(!t)return;const n=C(e);for(let s=t.cssRules.length-1;s>=0;s-=1){const e=t.cssRules[s];if(e&&T(e,n)){try{t.deleteRule(s)}catch{}return}}}clearRuntimeRules(){const t=this.sheet;if(t)for(let n=t.cssRules.length-1;n>=0;n-=1){const s=t.cssRules[n];if(s&&s.cssText.includes(`[${e}="`))try{t.deleteRule(n)}catch{}}}ensureFallbackStyleElement(){if(this.fallbackStyleElement)return this.fallbackStyleElement;const e=document.createElement("style");return e.setAttribute("data-notectl-runtime-styles",""),this.nonce&&e.setAttribute("nonce",this.nonce),S(this.root)?this.root.appendChild(e):(this.root.head??this.root.documentElement).appendChild(e),this.fallbackStyleElement=e,e}};function g(e){const t=/* @__PURE__ */new Map;for(const n of e.split(";")){const e=n.trim();if(!e)continue;const s=e.indexOf(":");if(s<=0)continue;const o=R(e.slice(0,s)),i=e.slice(s+1).trim();i?t.set(o,i):t.delete(o)}return t}function E(e){return Array.from(e.entries()).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>`${e}: ${t}`).join("; ")}function R(e){const t=e.trim();return t?t.startsWith("--")?t:t.includes("-")?t.toLowerCase():t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`).toLowerCase():""}function C(t){return`[${e}="${t}"]`}function T(e,t){return"undefined"!=typeof CSSStyleRule&&e instanceof CSSStyleRule?e.selectorText===t:e.cssText.includes(t)}export{l as a,a as c,o as i,i as l,s as n,c as o,u as r,r as s,h as t};
2
- //# sourceMappingURL=StyleRuntime-BAutwDZT.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StyleRuntime-BAutwDZT.mjs","names":[],"sources":["../../src/style/StyleRuntime.ts"],"sourcesContent":["/**\n * Runtime style abstraction.\n *\n * Writes no inline styles and instead assigns token attributes\n * backed by dynamic CSS rules in a stylesheet.\n * Elements outside a registered root fall back to inline styles.\n */\n\nexport interface StyleRootOptions {\n\treadonly nonce?: string;\n\treadonly sheet?: CSSStyleSheet | null;\n}\n\ntype StyleRoot = ShadowRoot | Document;\n\ninterface RootConfig {\n\treadonly nonce?: string;\n\treadonly sheet: CSSStyleSheet | null;\n}\n\nconst STYLE_TOKEN_ATTR = 'data-notectl-style-token';\nconst STYLE_ELEMENT_ATTR = 'data-notectl-runtime-styles';\n\nconst rootConfigs: WeakMap<StyleRoot, RootConfig> = new WeakMap();\nconst strictEngines: WeakMap<StyleRoot, StrictStyleEngine> = new WeakMap();\n\n/** Creates a constructable stylesheet when the environment supports it. */\nexport function createRuntimeStyleSheet(): CSSStyleSheet | null {\n\tif (typeof CSSStyleSheet === 'undefined') return null;\n\ttry {\n\t\treturn new CSSStyleSheet();\n\t} catch {\n\t\treturn null;\n\t}\n}\n\n/** Registers styling mode for a root (shadow root or document). */\nexport function registerStyleRoot(root: StyleRoot, options: StyleRootOptions): void {\n\tconst previous = strictEngines.get(root);\n\tif (previous) {\n\t\tprevious.destroy();\n\t\tstrictEngines.delete(root);\n\t}\n\trootConfigs.set(root, {\n\t\tnonce: options.nonce,\n\t\tsheet: options.sheet ?? null,\n\t});\n}\n\n/** Unregisters root styling and tears down strict runtime state if present. */\nexport function unregisterStyleRoot(root: StyleRoot): void {\n\tconst engine = strictEngines.get(root);\n\tif (engine) {\n\t\tengine.destroy();\n\t\tstrictEngines.delete(root);\n\t}\n\trootConfigs.delete(root);\n}\n\n/** Sets a single style property. Empty value removes the property. */\nexport function setStyleProperty(el: HTMLElement, property: string, value: string): void {\n\tconst config = resolveConfig(el);\n\tif (!config) {\n\t\tsetInlineProperty(el, property, value);\n\t\treturn;\n\t}\n\tgetStrictEngine(config.root, config.settings).setProperty(el, property, value);\n}\n\n/** Removes a single style property. */\nexport function removeStyleProperty(el: HTMLElement, property: string): void {\n\tsetStyleProperty(el, property, '');\n}\n\n/** Sets multiple style properties in one call. */\nexport function setStyleProperties(\n\tel: HTMLElement,\n\tproperties: Readonly<Record<string, string | undefined | null>>,\n): void {\n\tconst config = resolveConfig(el);\n\tif (!config) {\n\t\tfor (const [property, value] of Object.entries(properties)) {\n\t\t\tsetInlineProperty(el, property, value ?? '');\n\t\t}\n\t\treturn;\n\t}\n\tgetStrictEngine(config.root, config.settings).setProperties(el, properties);\n}\n\n/** Replaces the element style text. */\nexport function setStyleText(el: HTMLElement, cssText: string): void {\n\tconst config = resolveConfig(el);\n\tif (!config) {\n\t\tel.style.cssText = cssText;\n\t\treturn;\n\t}\n\tgetStrictEngine(config.root, config.settings).setStyleText(el, cssText);\n}\n\n/** Merges a cssText fragment into current element styles. */\nexport function appendStyleText(el: HTMLElement, cssText: string): void {\n\tconst config = resolveConfig(el);\n\tif (!config) {\n\t\tconst current = el.style.cssText;\n\t\tel.style.cssText = current ? `${current}; ${cssText}` : cssText;\n\t\treturn;\n\t}\n\tgetStrictEngine(config.root, config.settings).appendStyleText(el, cssText);\n}\n\n/** Returns serialized styles for an element. */\nexport function getStyleText(el: HTMLElement): string {\n\tconst config = resolveConfig(el);\n\tif (!config) return el.style.cssText;\n\treturn getStrictEngine(config.root, config.settings).getStyleText(el);\n}\n\n/** Returns the configured CSP nonce for the node's style root (if any). */\nexport function getStyleNonceForNode(node: Node): string | undefined {\n\tconst root = resolveStyleRootFromNode(node);\n\tif (!root) return undefined;\n\treturn rootConfigs.get(root)?.nonce;\n}\n\nfunction setInlineProperty(el: HTMLElement, property: string, value: string): void {\n\tif (property.startsWith('--')) {\n\t\tif (value) {\n\t\t\tel.style.setProperty(property, value);\n\t\t} else {\n\t\t\tel.style.removeProperty(property);\n\t\t}\n\t\treturn;\n\t}\n\tif (property.includes('-')) {\n\t\tif (value) {\n\t\t\tel.style.setProperty(property, value);\n\t\t} else {\n\t\t\tel.style.removeProperty(property);\n\t\t}\n\t\treturn;\n\t}\n\t(el.style as CSSStyleDeclaration & Record<string, string>)[property] = value;\n}\n\nfunction resolveConfig(el: HTMLElement): { root: StyleRoot; settings: RootConfig } | null {\n\tconst root = resolveStyleRoot(el);\n\tif (!root) return null;\n\tconst settings = rootConfigs.get(root);\n\tif (!settings) return null;\n\treturn { root, settings };\n}\n\nfunction resolveStyleRoot(el: HTMLElement): StyleRoot | null {\n\treturn resolveStyleRootFromNode(el);\n}\n\nfunction getStrictEngine(root: StyleRoot, config: RootConfig): StrictStyleEngine {\n\tconst cached = strictEngines.get(root);\n\tif (cached) return cached;\n\tconst engine = new StrictStyleEngine(root, config);\n\tstrictEngines.set(root, engine);\n\treturn engine;\n}\n\nfunction isShadowRoot(value: unknown): value is ShadowRoot {\n\treturn typeof ShadowRoot !== 'undefined' && value instanceof ShadowRoot;\n}\n\nfunction isDocument(value: unknown): value is Document {\n\treturn typeof Document !== 'undefined' && value instanceof Document;\n}\n\nfunction resolveStyleRootFromNode(node: Node): StyleRoot | null {\n\tconst rootNode: Node = isShadowRoot(node) || isDocument(node) ? node : node.getRootNode();\n\tif (isShadowRoot(rootNode)) return rootNode;\n\tif (isDocument(rootNode)) return rootNode;\n\tif (typeof document !== 'undefined') return document;\n\treturn null;\n}\n\nclass StrictStyleEngine {\n\tprivate readonly declarationByElement: WeakMap<HTMLElement, Map<string, string>> = new WeakMap();\n\tprivate readonly tokenByDeclaration: Map<string, string> = new Map();\n\tprivate readonly declarationByToken: Map<string, string> = new Map();\n\tprivate readonly tokenRefCount: Map<string, number> = new Map();\n\tprivate readonly tokenByElement: WeakMap<HTMLElement, string> = new WeakMap();\n\tprivate tokenCounter = 0;\n\tprivate readonly root: StyleRoot;\n\tprivate readonly nonce?: string;\n\tprivate sheet: CSSStyleSheet | null;\n\tprivate fallbackStyleElement: HTMLStyleElement | null = null;\n\tprivate ownsAdoptedSheet = false;\n\n\tconstructor(root: StyleRoot, config: RootConfig) {\n\t\tthis.root = root;\n\t\tthis.nonce = config.nonce;\n\t\tthis.sheet = config.sheet ?? null;\n\t}\n\n\tdestroy(): void {\n\t\tthis.clearRuntimeRules();\n\t\tif (this.ownsAdoptedSheet && this.sheet && 'adoptedStyleSheets' in this.root) {\n\t\t\tthis.root.adoptedStyleSheets = this.root.adoptedStyleSheets.filter(\n\t\t\t\t(adoptedSheet: CSSStyleSheet): boolean => adoptedSheet !== this.sheet,\n\t\t\t);\n\t\t}\n\t\tthis.fallbackStyleElement?.remove();\n\t\tthis.fallbackStyleElement = null;\n\t\tthis.sheet = null;\n\t\tthis.ownsAdoptedSheet = false;\n\t\tthis.tokenByDeclaration.clear();\n\t\tthis.declarationByToken.clear();\n\t\tthis.tokenRefCount.clear();\n\t\tthis.tokenCounter = 0;\n\t}\n\n\tsetProperty(el: HTMLElement, property: string, value: string): void {\n\t\tconst declarations = this.getOrCreateDeclarations(el);\n\t\tconst name = normalizePropertyName(property);\n\t\tif (!value) {\n\t\t\tdeclarations.delete(name);\n\t\t} else {\n\t\t\tdeclarations.set(name, value);\n\t\t}\n\t\tthis.syncElementToken(el, declarations);\n\t}\n\n\tsetProperties(\n\t\tel: HTMLElement,\n\t\tproperties: Readonly<Record<string, string | undefined | null>>,\n\t): void {\n\t\tconst declarations = this.getOrCreateDeclarations(el);\n\t\tfor (const [property, value] of Object.entries(properties)) {\n\t\t\tconst name = normalizePropertyName(property);\n\t\t\tif (!value) {\n\t\t\t\tdeclarations.delete(name);\n\t\t\t} else {\n\t\t\t\tdeclarations.set(name, value);\n\t\t\t}\n\t\t}\n\t\tthis.syncElementToken(el, declarations);\n\t}\n\n\tsetStyleText(el: HTMLElement, cssText: string): void {\n\t\tconst declarations = parseStyleText(cssText);\n\t\tif (declarations.size === 0) {\n\t\t\tthis.clearElementStyles(el);\n\t\t\treturn;\n\t\t}\n\t\tthis.declarationByElement.set(el, declarations);\n\t\tthis.syncElementToken(el, declarations);\n\t}\n\n\tappendStyleText(el: HTMLElement, cssText: string): void {\n\t\tconst parsed = parseStyleText(cssText);\n\t\tif (parsed.size === 0) return;\n\t\tconst declarations = this.getOrCreateDeclarations(el);\n\t\tfor (const [property, value] of parsed) {\n\t\t\tdeclarations.set(property, value);\n\t\t}\n\t\tthis.syncElementToken(el, declarations);\n\t}\n\n\tgetStyleText(el: HTMLElement): string {\n\t\tconst declarations = this.declarationByElement.get(el);\n\t\tif (!declarations || declarations.size === 0) return '';\n\t\treturn serializeDeclarations(declarations);\n\t}\n\n\tprivate getOrCreateDeclarations(el: HTMLElement): Map<string, string> {\n\t\tconst existing = this.declarationByElement.get(el);\n\t\tif (existing) return existing;\n\t\tconst created = new Map<string, string>();\n\t\tthis.declarationByElement.set(el, created);\n\t\treturn created;\n\t}\n\n\tprivate syncElementToken(el: HTMLElement, declarations: Map<string, string>): void {\n\t\tconst previousToken = this.tokenByElement.get(el);\n\t\tif (declarations.size === 0) {\n\t\t\tthis.clearElementStyles(el);\n\t\t\treturn;\n\t\t}\n\n\t\tconst declarationText = serializeDeclarations(declarations);\n\t\tlet token = this.tokenByDeclaration.get(declarationText);\n\t\tif (!token) {\n\t\t\ttoken = `s${this.tokenCounter.toString(36)}`;\n\t\t\tthis.tokenCounter += 1;\n\t\t\tthis.tokenByDeclaration.set(declarationText, token);\n\t\t\tthis.declarationByToken.set(token, declarationText);\n\t\t\tthis.insertRule(token, declarationText);\n\t\t}\n\t\tif (previousToken !== token) {\n\t\t\tthis.retainToken(token);\n\t\t\tif (previousToken) {\n\t\t\t\tthis.releaseToken(previousToken);\n\t\t\t}\n\t\t\tthis.tokenByElement.set(el, token);\n\t\t}\n\t\tel.setAttribute(STYLE_TOKEN_ATTR, token);\n\t}\n\n\tprivate insertRule(token: string, declarationText: string): void {\n\t\tconst rule = `${buildTokenSelector(token)} { ${declarationText}; }`;\n\t\tconst sheet = this.ensureSheet();\n\t\tif (!sheet) return;\n\t\ttry {\n\t\t\tsheet.insertRule(rule, sheet.cssRules.length);\n\t\t} catch {\n\t\t\t// Ignore malformed declarations from third-party plugin attrs.\n\t\t}\n\t}\n\n\tprivate ensureSheet(): CSSStyleSheet | null {\n\t\tif (this.sheet) return this.sheet;\n\n\t\tif (typeof CSSStyleSheet !== 'undefined') {\n\t\t\ttry {\n\t\t\t\tconst sheet = new CSSStyleSheet();\n\t\t\t\tif ('adoptedStyleSheets' in this.root) {\n\t\t\t\t\tconst adopted = this.root.adoptedStyleSheets;\n\t\t\t\t\tthis.root.adoptedStyleSheets = [...adopted, sheet];\n\t\t\t\t\tthis.sheet = sheet;\n\t\t\t\t\tthis.ownsAdoptedSheet = true;\n\t\t\t\t\treturn sheet;\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\t// Fall through to style element fallback.\n\t\t\t}\n\t\t}\n\n\t\tconst style = this.ensureFallbackStyleElement();\n\t\tthis.sheet = (style.sheet as CSSStyleSheet | null) ?? null;\n\t\treturn this.sheet;\n\t}\n\n\tprivate clearElementStyles(el: HTMLElement): void {\n\t\tthis.declarationByElement.delete(el);\n\t\tconst token = this.tokenByElement.get(el);\n\t\tif (token) {\n\t\t\tthis.tokenByElement.delete(el);\n\t\t\tthis.releaseToken(token);\n\t\t}\n\t\tel.removeAttribute(STYLE_TOKEN_ATTR);\n\t}\n\n\tprivate retainToken(token: string): void {\n\t\tconst current = this.tokenRefCount.get(token) ?? 0;\n\t\tthis.tokenRefCount.set(token, current + 1);\n\t}\n\n\tprivate releaseToken(token: string): void {\n\t\tconst current = this.tokenRefCount.get(token);\n\t\tif (!current) return;\n\t\tif (current > 1) {\n\t\t\tthis.tokenRefCount.set(token, current - 1);\n\t\t\treturn;\n\t\t}\n\t\tthis.tokenRefCount.delete(token);\n\t\tconst declaration = this.declarationByToken.get(token);\n\t\tif (declaration) {\n\t\t\tthis.declarationByToken.delete(token);\n\t\t\tthis.tokenByDeclaration.delete(declaration);\n\t\t}\n\t\tthis.deleteRule(token);\n\t}\n\n\tprivate deleteRule(token: string): void {\n\t\tconst sheet = this.sheet;\n\t\tif (!sheet) return;\n\t\tconst selector = buildTokenSelector(token);\n\t\tfor (let index = sheet.cssRules.length - 1; index >= 0; index -= 1) {\n\t\t\tconst rule = sheet.cssRules[index];\n\t\t\tif (!rule || !isTokenSelectorMatch(rule, selector)) continue;\n\t\t\ttry {\n\t\t\t\tsheet.deleteRule(index);\n\t\t\t} catch {\n\t\t\t\t// Ignore parser/runtime discrepancies in unsupported environments.\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t}\n\n\tprivate clearRuntimeRules(): void {\n\t\tconst sheet = this.sheet;\n\t\tif (!sheet) return;\n\t\tfor (let index = sheet.cssRules.length - 1; index >= 0; index -= 1) {\n\t\t\tconst rule = sheet.cssRules[index];\n\t\t\tif (!rule || !rule.cssText.includes(`[${STYLE_TOKEN_ATTR}=\"`)) continue;\n\t\t\ttry {\n\t\t\t\tsheet.deleteRule(index);\n\t\t\t} catch {\n\t\t\t\t// Ignore parser/runtime discrepancies in unsupported environments.\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate ensureFallbackStyleElement(): HTMLStyleElement {\n\t\tif (this.fallbackStyleElement) return this.fallbackStyleElement;\n\t\tconst style: HTMLStyleElement = document.createElement('style');\n\t\tstyle.setAttribute(STYLE_ELEMENT_ATTR, '');\n\t\tif (this.nonce) {\n\t\t\tstyle.setAttribute('nonce', this.nonce);\n\t\t}\n\t\tif (isShadowRoot(this.root)) {\n\t\t\tthis.root.appendChild(style);\n\t\t} else {\n\t\t\tconst host = this.root.head ?? this.root.documentElement;\n\t\t\thost.appendChild(style);\n\t\t}\n\t\tthis.fallbackStyleElement = style;\n\t\treturn style;\n\t}\n}\n\nfunction parseStyleText(styleText: string): Map<string, string> {\n\tconst declarations = new Map<string, string>();\n\tfor (const rawPart of styleText.split(';')) {\n\t\tconst part = rawPart.trim();\n\t\tif (!part) continue;\n\t\tconst separator = part.indexOf(':');\n\t\tif (separator <= 0) continue;\n\t\tconst property = normalizePropertyName(part.slice(0, separator));\n\t\tconst value = part.slice(separator + 1).trim();\n\t\tif (!value) {\n\t\t\tdeclarations.delete(property);\n\t\t} else {\n\t\t\tdeclarations.set(property, value);\n\t\t}\n\t}\n\treturn declarations;\n}\n\nfunction serializeDeclarations(declarations: Map<string, string>): string {\n\tconst ordered: [string, string][] = Array.from(declarations.entries()).sort(([a], [b]) =>\n\t\ta.localeCompare(b),\n\t);\n\treturn ordered.map(([property, value]) => `${property}: ${value}`).join('; ');\n}\n\nfunction normalizePropertyName(property: string): string {\n\tconst trimmed = property.trim();\n\tif (!trimmed) return '';\n\tif (trimmed.startsWith('--')) return trimmed;\n\tif (trimmed.includes('-')) return trimmed.toLowerCase();\n\treturn trimmed.replace(/[A-Z]/g, (char: string) => `-${char.toLowerCase()}`).toLowerCase();\n}\n\nfunction buildTokenSelector(token: string): string {\n\treturn `[${STYLE_TOKEN_ATTR}=\"${token}\"]`;\n}\n\nfunction isTokenSelectorMatch(rule: CSSRule, selector: string): boolean {\n\tif (typeof CSSStyleRule !== 'undefined' && rule instanceof CSSStyleRule) {\n\t\treturn rule.selectorText === selector;\n\t}\n\treturn rule.cssText.includes(selector);\n}\n"],"mappings":"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"}
@@ -1,2 +0,0 @@
1
- import{c as t,d as e,i as n,o,p as r,u as l}from"./Document-r7vLOAGA.mjs";import{c as i,l as s,o as a,r as c,t as d,u}from"./Selection-HYoVFpAx.mjs";import{a as b}from"./TypeBrands-Ch9856Gb.mjs";import{r as p}from"./HTMLUtils-C6B4UT00.mjs";import{_ as h,s as m}from"./BlockInsertion-6rR9tIGP.mjs";import{i as f,t as v}from"./Decoration-ZeyVfwJB.mjs";import{a as g,o as x,s as w}from"./StyleRuntime-BAutwDZT.mjs";import{n as C}from"./TypedKeys-CA4bfw9O.mjs";import{c as I,i as y,o as k}from"./PluginHelpers-KDuTlmXm.mjs";import{t as S}from"./KeyboardNav-D0my3wuy.mjs";import{r as A}from"./PopupPositioning-DtUrY9bh.mjs";import{i as L}from"./ColorValidation-DAijTjG9.mjs";import{n as R,t as B}from"./ColorGrid-CXRdpP_n.mjs";function E(){const e=n(b("paragraph"),[t("")],l());return n(b("table_cell"),[e],l())}function T(t,n){const o=t.getNodePath(n);if(!o)return null;let r=null,l=null,i=null,s=null;for(const e of o){const n=t.getBlock(e);n&&("table"===n.type?(r=e,l=n):"table_row"===n.type?i=e:"table_cell"===n.type&&(s=e))}if("table_cell"===t.getBlock(n)?.type&&(s=n),!(r&&l&&s&&i))return null;const a=t.doc.children.findIndex(t=>t.id===r),c=e(l),d=c.findIndex(t=>t.id===i);if(-1===d)return null;const u=c[d];if(!u)return null;const b=e(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 M(t,n,o,r){const l=t.getBlock(n);if(!l)return null;const i=e(l)[o];return i?e(i)[r]?.id??null:null}function N(t,n){const o=t.getBlock(n);if(!o)return n;const r=e(o)[0];if(!r)return n;let l=r;for(;;){const t=e(l)[0];if(!t)return l.id;l=t}}function H(t,n){const o=t.getBlock(n);if(!o)return n;const r=e(o),l=r[r.length-1];if(!l)return n;let i=l;for(;;){const t=e(i),n=t[t.length-1];if(!n)return i.id;i=n}}function P(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 D={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"},z=/* #__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-jbplYWkC.mjs"),"./locales/de.ts":()=>import("./de-DN-e6G5A.mjs"),"./locales/es.ts":()=>import("./es-CM55WeEN.mjs"),"./locales/fr.ts":()=>import("./fr-C_2i5Ono.mjs"),"./locales/hi.ts":()=>import("./hi-C9fvG91d.mjs"),"./locales/pt.ts":()=>import("./pt-GqLw5tN0.mjs"),"./locales/ru.ts":()=>import("./ru-4g_qsaLr.mjs"),"./locales/zh.ts":()=>import("./zh-DeZP08HI.mjs")});async function $(t){return I(z,t,D)}var j=["#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 V(t,e,n=D){const o=t.getState();if(!u(o.selection))return!1;const r=T(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":R(e);return t.announce(n.announceBorderColorSet(i)),!0}function O(t,e=D){const n=t.getState();if(!u(n.selection))return!1;const o=T(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 F(t,e){const n=t.getBlock(e);if(n)return n.attrs?.borderColor}function q(t,e,n,o,r=D){t.classList.add("notectl-color-picker");const l=F(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(),O(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(),V(e,"none",r),o()}),s.addEventListener("keydown",t=>{"Escape"===t.key&&(t.preventDefault(),o())}),t.appendChild(s),B(t,{colors:j,columns:5,ariaLabel:r.borderColorPicker,ariaLabelPrefix:"",activeColor:l??null,swatchLabel:r.borderSwatchLabel,titleAsName:!0,onSelect:t=>{V(e,t,r),o()},onClose:o})}function Z(t,o,r){const i=t.getBlock(o);if(!i)return null;const s=e(i),a=s[0]?e(s[0]).length:0;if(0===a)return null;const c=function(t){const e=[];for(let n=0;n<t;n++)e.push(E());return n(b("table_row"),e,l())}(a),u=t.transaction("command").insertNode([o],r,c),p=e(c)[0],h=p?e(p)[0]:void 0;return h?u.setSelection(d(h.id,0)):p&&u.setSelection(d(p.id,0)),u.build()}function K(t,n,o){const r=t.getBlock(n);if(!r)return null;const l=e(r),i=t.transaction("command");for(const e of l){const t=E();i.insertNode([n,e.id],o,t)}return i.setSelection(t.selection),i.build()}function Y(t,n,o,r=0){const l=t.getBlock(n);if(!l)return null;if(e(l).length<=1)return W(t,n);const i=t.transaction("command").removeNode([n],o),s=M(t,n,o>0?o-1:1,r);if(s){const e=N(t,s);i.setSelection(d(e,0))}return i.build()}function X(t,n,o,r=0){const l=t.getBlock(n);if(!l)return null;const i=e(l);if((i[0]?e(i[0]).length:0)<=1)return W(t,n);const s=t.transaction("command");for(let e=i.length-1;e>=0;e--){const t=i[e];t&&s.removeNode([n,t.id],o)}const a=M(t,n,r,o>0?o-1:1);if(a){const e=N(t,a);s.setSelection(d(e,0))}return s.build()}function W(t,e){const n=t.doc.children.findIndex(t=>t.id===e);if(-1===n)return null;if(1===t.doc.children.length){const e=o(l());return t.transaction("command").insertNode([],0,e).removeNode([],1).setSelection(d(e.id,0)).build()}const r=t.transaction("command").removeNode([],n),i=t.doc.children[n+1];if(i){const e=h(t,i.id,"start");if(e)return r.setSelection(e),r.build()}const s=t.doc.children[n-1];if(s){const e=h(t,s.id,"end");if(e)return r.setSelection(e),r.build()}return null}function U(t,o,r){const i=t.getState(),s=y(i);if(!s)return!1;const a=function(t,e){const o=l(),r=[];for(let i=0;i<t;i++){const t=[];for(let n=0;n<e;n++)t.push(E());r.push(n(b("table_row"),t,l()))}return n(b("table"),r,o)}(o,r),c=i.transaction("command");if(!m(i,c,s,a))return!1;const u=e(a)[0],p=u?e(u)[0]:void 0,h=p?e(p)[0]:void 0;return h?c.setSelection(d(h.id,0)):p&&c.setSelection(d(p.id,0)),t.dispatch(c.build()),!0}function G(t,e){const n=t.getState();if(!u(n.selection))return!1;const o=T(n,n.selection.anchor.blockId);if(!o)return!1;const r=Z(n,o.tableId,o.rowIndex+1);return!!r&&(t.dispatch(r),t.announce(e.announceRowInsertedBelow),!0)}function Q(t,e,n){const o=t.getState();if(!u(o.selection))return!1;const r=T(o,o.selection.anchor.blockId);if(!r)return!1;const l="left"===e?r.colIndex:r.colIndex+1,i=K(o,r.tableId,l);return!!i&&(t.dispatch(i),t.announce(n.announceColumnInserted(e)),!0)}function J(t,e){t.registerCommand("insertTable",()=>U(t,3,3)),t.registerCommand("addRowAbove",()=>function(t,e){const n=t.getState();if(!u(n.selection))return!1;const o=T(n,n.selection.anchor.blockId);if(!o)return!1;const r=Z(n,o.tableId,o.rowIndex);return!!r&&(t.dispatch(r),t.announce(e.announceRowInsertedAbove),!0)}(t,e)),t.registerCommand("addRowBelow",()=>G(t,e)),t.registerCommand("addColumnLeft",()=>function(t,e){return Q(t,"left",e)}(t,e)),t.registerCommand("addColumnRight",()=>function(t,e){return Q(t,"right",e)}(t,e)),t.registerCommand("deleteRow",()=>function(t,e){const n=t.getState();if(!u(n.selection))return!1;const o=T(n,n.selection.anchor.blockId);if(!o)return!1;const r=Y(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=T(n,n.selection.anchor.blockId);if(!o)return!1;const r=X(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=T(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=T(t,t.selection.anchor.blockId);return e?{tableId:e.tableId}:null}(n);if(!o)return!1;const r=W(n,o.tableId);return!!r&&(t.dispatch(r),t.announce(e.announceTableDeleted),!0)}(t,e))}function tt(t,e,n,o,r,l=D,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,v()},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())}),q(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())}),q(a,e,n,()=>C(),l),t.appendChild(a);const r=d.getBoundingClientRect(),i="rtl"===getComputedStyle(d).direction;A(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),v()}function v(){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),S(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,S(u,b),void u[b]?.focus();case"ArrowUp":return t.preventDefault(),b=(b-1+u.length)%u.length,S(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,S(u,b),void u[b]?.focus();case"End":return t.preventDefault(),b=u.length-1,S(u,b),void u[b]?.focus()}}),A(d,o,{position:"below-start"}),t.appendChild(d),u[0]?.focus(),requestAnimationFrame(()=>{s&&u[0]&&u[0].focus()});const g=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",g,!0),w=!1),r?.())}return x=setTimeout(()=>{x=null,document.addEventListener("mousedown",g,!0),w=!0},0),{isOpen:()=>s,close:C,destroy:C}}var et=null;function nt(t,e){const n=t.getState();if(!u(n.selection))return!1;const o=n.selection,r=T(n,o.anchor.blockId);return!!r&&e(n,o,r)}function ot(t){return nt(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})}function rt(t,e,n,o){const r=t.getState(),l=M(r,e,n,o);if(!l)return!1;const i=N(r,l),s=r.transaction("command").setSelection(d(i,0)).build();return t.dispatch(s),!0}function lt(t,e,n,o){const l=t.getState(),i=M(l,e,n,o);if(!i)return!1;const s=H(l,i),a=l.getBlock(s);if(!a)return!1;const c=r(a),u=l.transaction("command").setSelection(d(s,c)).build();return t.dispatch(u),!0}function it(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 st='<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 at(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 ct(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=at("ntbl-insert-btn",st,e);return n.appendChild(o),n}function dt(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=st,n.appendChild(o),n.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation()}),n}function ut(t){const e=document.createElement("div");return e.className=t,e.setAttribute("contenteditable","false"),e.setAttribute("data-notectl-no-print",""),e}function bt(t,e){x(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 pt(t,e,n,o){const r=document.createElement("div");r.className=`ntbl-handle ${t}`,r.dataset.index=String(e);const l=at("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 ht(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 mt=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,n,o,r,l,i,s=D){if(this.container=t,this.tableEl=n,this.getState=r,this.dispatchFn=l,this.pluginContext=i??null,this.locale=s,this.tableId=o.id,this.numRows=e(o).length,this.numCols=this.countCols(o),this.colBar=ut("ntbl-col-bar"),this.rowBar=ut("ntbl-row-bar"),this.insertLineH=ct("horizontal",s.insertRow),this.insertLineV=ct("vertical",s.insertColumn),this.addRowZone=dt("ntbl-add-row",s.addRow),this.addColZone=dt("ntbl-add-col",s.addColumn),this.deleteTableBtn=at("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=F(r(),this.tableId);this.borderColorBtn=function(t,e){const n=at("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",bt(o,e),n.appendChild(o),n}(s.borderColor,t),this.actionsBtn=function(t){const e=at("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(n),requestAnimationFrame(()=>this.positionControls())}update(t){this.tableId=t.id;const n=e(t).length,o=this.countCols(t);if(n===this.numRows&&o===this.numCols||(this.numRows=n,this.numCols=o,this.rebuildColHandles(),this.rebuildRowHandles()),this.borderColorBtn){const e=this.borderColorBtn.querySelector(".ntbl-border-color-swatch");if(e){const n=t.attrs?.borderColor;bt(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(Z(this.getState(),this.tableId,this.activeRowIndex))}),e.addEventListener("click",()=>{this.activeColIndex>=0&&this.dispatchTransaction(K(this.getState(),this.tableId,this.activeColIndex))}),this.addRowZone.addEventListener("click",()=>{this.dispatchTransaction(Z(this.getState(),this.tableId,this.numRows))}),this.addColZone.addEventListener("click",()=>{this.dispatchTransaction(K(this.getState(),this.tableId,this.numCols))}),this.deleteTableBtn.addEventListener("click",()=>{this.dispatchTransaction(W(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=tt(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",x(this.borderColorPopup,{position:"absolute",top:"24px",left:"24px",zIndex:"10000"}),this.borderColorPopup.setAttribute("contenteditable","false"),q(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 n=e(t);return n[0]?e(n[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];x(t,{left:`${Math.round(r*l)}px`,width:`${Math.round(r)}px`})}w(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;x(t,{top:`${n}px`,height:`${o}px`}),l=n+o}}w(t,"height",`${l}px`)}(this.rowBar,this.tableEl),function(t,e,n,o){const r=ht(n,o),l=n.offsetHeight,i=n.offsetWidth;x(t,{width:`${i}px`,left:`${r.left}px`}),x(e,{height:`${l}px`,top:`${r.top}px`})}(this.addRowZone,this.addColZone,this.tableEl,this.container)}showHorizontalLine(t){this.activeRowIndex=t.index;const e=ht(this.tableEl,this.container);x(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=ht(this.tableEl,this.container);x(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=pt("ntbl-col-handle",t,this.locale.deleteColumn,t=>{this.dispatchTransaction(X(this.getState(),this.tableId,t))});this.colBar.appendChild(e)}}rebuildRowHandles(){this.rowBar.innerHTML="";for(let t=0;t<this.numRows;t++){const e=pt("ntbl-row-handle",t,this.locale.deleteRow,t=>{this.dispatchTransaction(Y(this.getState(),this.tableId,t))});this.rowBar.appendChild(e)}}};function ft(t,e){"none"===e?(w(t,"--ntbl-border-color","transparent"),t.classList.add("notectl-table--borderless")):e?(w(t,"--ntbl-border-color",e),t.classList.remove("notectl-table--borderless")):(g(t,"--ntbl-border-color"),t.classList.remove("notectl-table--borderless"))}var vt=new C("tableSelection"),gt={maxPickerRows:8,maxPickerCols:8},xt="border-collapse: collapse; width: 100%; table-layout: fixed",wt="border: 1px solid var(--ntbl-bc, #d0d0d0); padding: 8px 12px; vertical-align: top",Ct=class{id="table";name="Table";priority=40;config;locale;selectionService=null;cleanupMouseSelection=null;context=null;constructor(t){this.config={...gt,...t}}async init(t){this.locale=await k(t,this.config.locale,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/* Border resolution order: per-table local override → theme component token → theme global token.\n * The inline --ntbl-border-color is set by the toolbar\'s "border color" action and must win\n * over the theme so per-table customizations remain visible after a theme switch.\n */\n.notectl-table td {\n\tborder: 1px solid var(--ntbl-border-color, var(--notectl-table-border, var(--notectl-border)));\n\tbackground: var(--notectl-table-cell-bg, transparent);\n\tpadding: 8px 12px;\n\tmin-width: 60px;\n\tvertical-align: top;\n\tmin-height: 1.6em;\n}\n\n.notectl-table th {\n\tborder: 1px solid var(--ntbl-border-color, var(--notectl-table-border, var(--notectl-border)));\n\tbackground: var(--notectl-table-header-bg, var(--notectl-surface-raised));\n\tpadding: 8px 12px;\n\tmin-width: 60px;\n\tvertical-align: top;\n\ttext-align: start;\n\tfont-weight: 600;\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),J(t,this.locale),t.registerCommand("resetTableBorderColor",()=>O(t,this.locale)),function(t,e){t.registerKeymap({Tab:()=>function(t,e){return nt(t,(n,o,r)=>r.colIndex<r.totalCols-1?rt(t,r.tableId,r.rowIndex,r.colIndex+1):r.rowIndex<r.totalRows-1?rt(t,r.tableId,r.rowIndex+1,0):(G(t,e),!0))}(t,e),"Shift-Tab":()=>function(t){return nt(t,(e,n,o)=>o.colIndex>0?rt(t,o.tableId,o.rowIndex,o.colIndex-1):!(o.rowIndex>0)||rt(t,o.tableId,o.rowIndex-1,o.totalCols-1))}(t),Backspace:()=>function(t){return nt(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=N(e,o.cellId);return n.anchor.blockId===r&&it(t,o.tableId)})}(t),Delete:()=>function(t){return nt(t,(e,n,o)=>{if(!a(n))return!1;const l=e.getBlock(n.anchor.blockId);if(!l)return!1;const i=r(l);if(n.anchor.offset!==i)return!1;if(o.rowIndex!==o.totalRows-1||o.colIndex!==o.totalCols-1)return!1;const s=H(e,o.cellId);return n.anchor.blockId===s&&it(t,o.tableId)})}(t),ArrowDown:()=>function(t){return nt(t,(e,n,o)=>{const r=H(e,o.cellId);return n.anchor.blockId===r&&(o.rowIndex>=o.totalRows-1?ot(t):rt(t,o.tableId,o.rowIndex+1,o.colIndex))})}(t),ArrowUp:()=>function(t){return nt(t,(e,n,o)=>{const r=N(e,o.cellId);return n.anchor.blockId===r&&!(o.rowIndex<=0)&&rt(t,o.tableId,o.rowIndex-1,o.colIndex)})}(t),ArrowRight:()=>function(t){return nt(t,(e,n,o)=>{if(!a(n))return!1;const l=e.getBlock(n.anchor.blockId);if(!l)return!1;const i=r(l);if(n.anchor.offset!==i)return!1;const s=H(e,o.cellId);return n.anchor.blockId===s&&(o.colIndex<o.totalCols-1?rt(t,o.tableId,o.rowIndex,o.colIndex+1):!(o.rowIndex<o.totalRows-1)||rt(t,o.tableId,o.rowIndex+1,0))})}(t),ArrowLeft:()=>function(t){return nt(t,(e,n,o)=>{if(!a(n))return!1;if(0!==n.anchor.offset)return!1;const r=N(e,o.cellId);return n.anchor.blockId===r&&(o.colIndex>0?lt(t,o.tableId,o.rowIndex,o.colIndex-1):!(o.rowIndex>0)||lt(t,o.tableId,o.rowIndex-1,o.totalCols-1))})}(t),Escape:()=>ot(t),"Shift-F10":()=>function(t){return nt(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=tt(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=M(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(vt,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=T(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=T(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=T(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 v.empty;if(!this.selectionService.getSelectedRange())return v.empty;const e=t.selection;if(!u(e)||!P(t,e.anchor.blockId))return this.selectionService.clearSelectionSilent(),v.empty;const n=this.selectionService.getSelectedCellIds();if(0===n.length)return v.empty;const o=[];for(const r of n)o.push(f(r,{class:"notectl-table-cell--selected"}));return v.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.setAttribute("part","table"),e},toHTML(t,e,n){const o=t.attrs?.borderColor,r=function(t){return t?"none"===t?`${xt}; --ntbl-bc: transparent`:L(t)?`${xt}; --ntbl-bc: ${p(t)}`:xt:xt}(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.setAttribute("part","table-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","video","horizontal_rule"]},isolating:!0,toDOM(t){const e=document.createElement("td");return e.setAttribute("data-block-id",t.id),e.setAttribute("role","cell"),e.setAttribute("part","table-cell"),e},toHTML(t,e,n){const o=t.attrs?.colspan??1,r=t.attrs?.rowspan??1,l=[n?.styleAttr(wt)??` style="${wt}"`];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,n,o=D){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",s.setAttribute("part","table");const a=document.createElement("table");a.className="notectl-table",a.setAttribute("role","table");const c=e(t),d=c.length,u=c[0]?e(c[0]).length:0;a.setAttribute("aria-label",o.tableAriaLabel(d,u)),a.setAttribute("aria-description",o.tableAriaDescription);const b=document.createElement("tbody");a.appendChild(b),s.appendChild(a),i.appendChild(s),ft(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 mt(t,e,n,o,r,l,i)}(i,a,t,r,l,n,o);let m=null,f=t.id;const v=t=>{if(!n)return;t.preventDefault(),t.stopPropagation(),m?.close();const e=new DOMRect(t.clientX,t.clientY,0,0);m=tt(i,n,f,e,()=>{m=null},o)};return a.addEventListener("contextmenu",v),{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 n=e(t),r=n.length,l=n[0]?e(n[0]).length:0;return a.setAttribute("aria-label",o.tableAriaLabel(r,l)),ft(a,t.attrs?.borderColor),h.update(t),!1},destroy(){m?.destroy(),a.removeEventListener("contextmenu",v),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"),o.setAttribute("part","table-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"),o.setAttribute("part","table-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&&w(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)=>{U(t,e,n)}},isActive:t=>!!u(t.selection)&&P(t,t.selection.anchor.blockId)})}};export{vt as n,Ct as t};
2
- //# sourceMappingURL=TablePlugin-D93RR5xH.mjs.map