@notectl/core 2.0.6 → 2.0.7

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 (1112) hide show
  1. package/dist/chunks/AlignmentPlugin-CD11uRY3.mjs +2 -0
  2. package/dist/chunks/AlignmentPlugin-CD11uRY3.mjs.map +1 -0
  3. package/dist/chunks/AttrRegistry-nDKtHK87.mjs +2 -0
  4. package/dist/chunks/AttrRegistry-nDKtHK87.mjs.map +1 -0
  5. package/dist/chunks/AttributedMarkCommands-D_PYkbBt.mjs +2 -0
  6. package/dist/chunks/AttributedMarkCommands-D_PYkbBt.mjs.map +1 -0
  7. package/dist/chunks/BlockInsertion-DaG_4D31.mjs +2 -0
  8. package/dist/chunks/BlockInsertion-DaG_4D31.mjs.map +1 -0
  9. package/dist/chunks/BlockTypePickerRegistry-C_jLddOz.mjs +2 -0
  10. package/dist/chunks/BlockTypePickerRegistry-C_jLddOz.mjs.map +1 -0
  11. package/dist/chunks/BlockquotePlugin-DpMA33pk.mjs +2 -0
  12. package/dist/chunks/BlockquotePlugin-DpMA33pk.mjs.map +1 -0
  13. package/dist/chunks/CaretNavigationPlugin-BxU2lMwX.mjs +2 -0
  14. package/dist/chunks/CaretNavigationPlugin-BxU2lMwX.mjs.map +1 -0
  15. package/dist/chunks/CodeBlockPlugin-CSb6Fxce.mjs +2 -0
  16. package/dist/chunks/CodeBlockPlugin-CSb6Fxce.mjs.map +1 -0
  17. package/dist/chunks/ColorGrid-BNDaG3b2.mjs +2 -0
  18. package/dist/chunks/ColorGrid-BNDaG3b2.mjs.map +1 -0
  19. package/dist/chunks/ColorPickerPopup-BwU_WZHh.mjs +2 -0
  20. package/dist/chunks/ColorPickerPopup-BwU_WZHh.mjs.map +1 -0
  21. package/dist/chunks/ColorValidation-CiGxVsqd.mjs +2 -0
  22. package/dist/chunks/ColorValidation-CiGxVsqd.mjs.map +1 -0
  23. package/dist/chunks/CommandHelpers-BoRO1KfE.mjs +2 -0
  24. package/dist/chunks/CommandHelpers-BoRO1KfE.mjs.map +1 -0
  25. package/dist/chunks/Commands-C7zBYmhA.mjs +2 -0
  26. package/dist/chunks/Commands-C7zBYmhA.mjs.map +1 -0
  27. package/dist/chunks/Decoration-oeHDjWWq.mjs +2 -0
  28. package/dist/chunks/Decoration-oeHDjWWq.mjs.map +1 -0
  29. package/dist/chunks/Document-_qdGR4vh.mjs +2 -0
  30. package/dist/chunks/Document-_qdGR4vh.mjs.map +1 -0
  31. package/dist/chunks/DocumentParser-Cq_bFYAS.mjs +2 -0
  32. package/dist/chunks/DocumentParser-Cq_bFYAS.mjs.map +1 -0
  33. package/dist/chunks/DomUtils-RKbAVBQz.mjs +2 -0
  34. package/dist/chunks/DomUtils-RKbAVBQz.mjs.map +1 -0
  35. package/dist/chunks/FontPlugin-CUVcS-40.mjs +2 -0
  36. package/dist/chunks/FontPlugin-CUVcS-40.mjs.map +1 -0
  37. package/dist/chunks/FontSizePlugin-a8YyFsjf.mjs +2 -0
  38. package/dist/chunks/FontSizePlugin-a8YyFsjf.mjs.map +1 -0
  39. package/dist/chunks/GapCursorNavigation-PhJeqELx.mjs +2 -0
  40. package/dist/chunks/GapCursorNavigation-PhJeqELx.mjs.map +1 -0
  41. package/dist/chunks/GapCursorPlugin-9V0Ne0Sw.mjs +2 -0
  42. package/dist/chunks/GapCursorPlugin-9V0Ne0Sw.mjs.map +1 -0
  43. package/dist/chunks/HTMLUtils-B8xj8Z1x.mjs +2 -0
  44. package/dist/chunks/HTMLUtils-B8xj8Z1x.mjs.map +1 -0
  45. package/dist/chunks/HardBreakPlugin-BzAU3DoJ.mjs +2 -0
  46. package/dist/chunks/HardBreakPlugin-BzAU3DoJ.mjs.map +1 -0
  47. package/dist/chunks/HeadingPlugin-1BVn57NF.mjs +2 -0
  48. package/dist/chunks/HeadingPlugin-1BVn57NF.mjs.map +1 -0
  49. package/dist/chunks/HighlightPlugin-7S6Y_IFY.mjs +2 -0
  50. package/dist/chunks/HighlightPlugin-7S6Y_IFY.mjs.map +1 -0
  51. package/dist/chunks/HorizontalRulePlugin-bZ4nat7E.mjs +2 -0
  52. package/dist/chunks/HorizontalRulePlugin-bZ4nat7E.mjs.map +1 -0
  53. package/dist/chunks/ImagePlugin-wz0SBhFQ.mjs +2 -0
  54. package/dist/chunks/ImagePlugin-wz0SBhFQ.mjs.map +1 -0
  55. package/dist/chunks/InlineCodePlugin-DW5_oiac.mjs +2 -0
  56. package/dist/chunks/InlineCodePlugin-DW5_oiac.mjs.map +1 -0
  57. package/dist/chunks/KeyboardNav-CsdlWnNl.mjs +2 -0
  58. package/dist/chunks/KeyboardNav-CsdlWnNl.mjs.map +1 -0
  59. package/dist/chunks/LinkPlugin-pWzPs-dS.mjs +2 -0
  60. package/dist/chunks/LinkPlugin-pWzPs-dS.mjs.map +1 -0
  61. package/dist/chunks/ListPlugin-Datp4nPR.mjs +2 -0
  62. package/dist/chunks/ListPlugin-Datp4nPR.mjs.map +1 -0
  63. package/dist/chunks/NavigationQueries-_xQtPALX.mjs +2 -0
  64. package/dist/chunks/NavigationQueries-_xQtPALX.mjs.map +1 -0
  65. package/dist/chunks/NodeResolver-DVPpO5nC.mjs +2 -0
  66. package/dist/chunks/NodeResolver-DVPpO5nC.mjs.map +1 -0
  67. package/dist/chunks/NodeSelectionCommands-BFHLrE5I.mjs +2 -0
  68. package/dist/chunks/NodeSelectionCommands-BFHLrE5I.mjs.map +1 -0
  69. package/dist/chunks/Platform-D9TRT4Mn.mjs +2 -0
  70. package/dist/chunks/Platform-D9TRT4Mn.mjs.map +1 -0
  71. package/dist/chunks/Plugin-BUNGKupW.mjs +2 -0
  72. package/dist/chunks/Plugin-BUNGKupW.mjs.map +1 -0
  73. package/dist/chunks/PluginHelpers-Db50-BRE.mjs +2 -0
  74. package/dist/chunks/PluginHelpers-Db50-BRE.mjs.map +1 -0
  75. package/dist/chunks/PopupManager-DaTySyZl.mjs +2 -0
  76. package/dist/chunks/PopupManager-DaTySyZl.mjs.map +1 -0
  77. package/dist/chunks/PopupPositioning-DRNwWB0U.mjs +2 -0
  78. package/dist/chunks/PopupPositioning-DRNwWB0U.mjs.map +1 -0
  79. package/dist/chunks/PrintPlugin-Dv8_E40e.mjs +2 -0
  80. package/dist/chunks/PrintPlugin-Dv8_E40e.mjs.map +1 -0
  81. package/dist/chunks/PrintTypes-DTV3-mSe.mjs +2 -0
  82. package/dist/chunks/PrintTypes-DTV3-mSe.mjs.map +1 -0
  83. package/dist/chunks/RangeIterator-CVUeIB4P.mjs +2 -0
  84. package/dist/chunks/RangeIterator-CVUeIB4P.mjs.map +1 -0
  85. package/dist/chunks/Selection-aeiSsvhe.mjs +2 -0
  86. package/dist/chunks/Selection-aeiSsvhe.mjs.map +1 -0
  87. package/dist/chunks/ShortcutFormatting-DE6B8iGs.mjs +2 -0
  88. package/dist/chunks/ShortcutFormatting-DE6B8iGs.mjs.map +1 -0
  89. package/dist/chunks/SmartPastePlugin-PCLFN5yA.mjs +2 -0
  90. package/dist/chunks/SmartPastePlugin-PCLFN5yA.mjs.map +1 -0
  91. package/dist/chunks/StrikethroughPlugin-J5eDn_sY.mjs +2 -0
  92. package/dist/chunks/StrikethroughPlugin-J5eDn_sY.mjs.map +1 -0
  93. package/dist/chunks/StyleRuntime-D3d1XFFe.mjs +2 -0
  94. package/dist/chunks/StyleRuntime-D3d1XFFe.mjs.map +1 -0
  95. package/dist/chunks/SuperSubPlugin-uSLscUwN.mjs +2 -0
  96. package/dist/chunks/SuperSubPlugin-uSLscUwN.mjs.map +1 -0
  97. package/dist/chunks/SyntaxTokenTypes-CVUAMov0.mjs +2 -0
  98. package/dist/chunks/SyntaxTokenTypes-CVUAMov0.mjs.map +1 -0
  99. package/dist/chunks/TablePlugin-DJHHWTD2.mjs +2 -0
  100. package/dist/chunks/TablePlugin-DJHHWTD2.mjs.map +1 -0
  101. package/dist/chunks/TextColorPlugin-CawTv5pV.mjs +2 -0
  102. package/dist/chunks/TextColorPlugin-CawTv5pV.mjs.map +1 -0
  103. package/dist/chunks/TextDirectionCorePlugin-CXCxX532.mjs +2 -0
  104. package/dist/chunks/TextDirectionCorePlugin-CXCxX532.mjs.map +1 -0
  105. package/dist/chunks/TextDirectionLocale-Kh3r4XQS.mjs +2 -0
  106. package/dist/chunks/TextDirectionLocale-Kh3r4XQS.mjs.map +1 -0
  107. package/dist/chunks/TextFormattingPlugin-DKgwX4Gy.mjs +2 -0
  108. package/dist/chunks/TextFormattingPlugin-DKgwX4Gy.mjs.map +1 -0
  109. package/dist/chunks/ToolbarPlugin-BipA0zez.mjs +2 -0
  110. package/dist/chunks/ToolbarPlugin-BipA0zez.mjs.map +1 -0
  111. package/dist/chunks/TypeBrands-BZDKMjR-.mjs +2 -0
  112. package/dist/chunks/TypeBrands-BZDKMjR-.mjs.map +1 -0
  113. package/dist/chunks/WordBoundary-DI0G6Wk2.mjs +2 -0
  114. package/dist/chunks/WordBoundary-DI0G6Wk2.mjs.map +1 -0
  115. package/dist/chunks/XmlDetector-DlRdJOIX.mjs +2 -0
  116. package/dist/chunks/XmlDetector-DlRdJOIX.mjs.map +1 -0
  117. package/dist/chunks/XmlPatterns-Dwmn4nrg.mjs +2 -0
  118. package/dist/chunks/XmlPatterns-Dwmn4nrg.mjs.map +1 -0
  119. package/dist/chunks/XmlSupport-UA-iNWTl.mjs +2 -0
  120. package/dist/chunks/XmlSupport-UA-iNWTl.mjs.map +1 -0
  121. package/dist/chunks/ar-13q9ejck.mjs +2 -0
  122. package/dist/chunks/ar-13q9ejck.mjs.map +1 -0
  123. package/dist/chunks/ar-7XO2HmsM.mjs +2 -0
  124. package/dist/chunks/ar-7XO2HmsM.mjs.map +1 -0
  125. package/dist/chunks/ar-B-n_gMXb.mjs +2 -0
  126. package/dist/chunks/ar-B-n_gMXb.mjs.map +1 -0
  127. package/dist/chunks/ar-BXeE6tKj.mjs +2 -0
  128. package/dist/chunks/ar-BXeE6tKj.mjs.map +1 -0
  129. package/dist/chunks/ar-Bs3sx3Oz.mjs +2 -0
  130. package/dist/chunks/ar-Bs3sx3Oz.mjs.map +1 -0
  131. package/dist/chunks/ar-ByNQ-o3t.mjs +2 -0
  132. package/dist/chunks/ar-ByNQ-o3t.mjs.map +1 -0
  133. package/dist/chunks/ar-C9AnO0uV.mjs +2 -0
  134. package/dist/chunks/ar-C9AnO0uV.mjs.map +1 -0
  135. package/dist/chunks/ar-CL-NsFoh.mjs +2 -0
  136. package/dist/chunks/ar-CL-NsFoh.mjs.map +1 -0
  137. package/dist/chunks/ar-COx4cFpT.mjs +2 -0
  138. package/dist/chunks/ar-COx4cFpT.mjs.map +1 -0
  139. package/dist/chunks/ar-CYZYoqcc.mjs +2 -0
  140. package/dist/chunks/ar-CYZYoqcc.mjs.map +1 -0
  141. package/dist/chunks/ar-ChOxTdPI.mjs +2 -0
  142. package/dist/chunks/ar-ChOxTdPI.mjs.map +1 -0
  143. package/dist/chunks/ar-Cj6amEs9.mjs +2 -0
  144. package/dist/chunks/ar-Cj6amEs9.mjs.map +1 -0
  145. package/dist/chunks/ar-CsH2S6Vd.mjs +2 -0
  146. package/dist/chunks/ar-CsH2S6Vd.mjs.map +1 -0
  147. package/dist/chunks/ar-D2y_YvMP.mjs +2 -0
  148. package/dist/chunks/ar-D2y_YvMP.mjs.map +1 -0
  149. package/dist/chunks/ar-D57VZrg2.mjs +2 -0
  150. package/dist/chunks/ar-D57VZrg2.mjs.map +1 -0
  151. package/dist/chunks/ar-DH06YQkP.mjs +2 -0
  152. package/dist/chunks/ar-DH06YQkP.mjs.map +1 -0
  153. package/dist/chunks/ar-DJ6K9HnU.mjs +2 -0
  154. package/dist/chunks/ar-DJ6K9HnU.mjs.map +1 -0
  155. package/dist/chunks/ar-DLxmSv7R.mjs +2 -0
  156. package/dist/chunks/ar-DLxmSv7R.mjs.map +1 -0
  157. package/dist/chunks/ar-DMNNIim-.mjs +2 -0
  158. package/dist/chunks/ar-DMNNIim-.mjs.map +1 -0
  159. package/dist/chunks/ar-DW0Inc7r.mjs +2 -0
  160. package/dist/chunks/ar-DW0Inc7r.mjs.map +1 -0
  161. package/dist/chunks/ar-SwJ-tyIu.mjs +2 -0
  162. package/dist/chunks/ar-SwJ-tyIu.mjs.map +1 -0
  163. package/dist/chunks/ar-Vfk7XFaz.mjs +2 -0
  164. package/dist/chunks/ar-Vfk7XFaz.mjs.map +1 -0
  165. package/dist/chunks/ar-izXCtb2I.mjs +2 -0
  166. package/dist/chunks/ar-izXCtb2I.mjs.map +1 -0
  167. package/dist/chunks/ar-jsznaXQ0.mjs +2 -0
  168. package/dist/chunks/ar-jsznaXQ0.mjs.map +1 -0
  169. package/dist/chunks/color-picker-D4Vi72Z_.mjs +2 -0
  170. package/dist/chunks/color-picker-D4Vi72Z_.mjs.map +1 -0
  171. package/dist/chunks/de-3PJCshB7.mjs +2 -0
  172. package/dist/chunks/de-3PJCshB7.mjs.map +1 -0
  173. package/dist/chunks/de-B92lssMU.mjs +2 -0
  174. package/dist/chunks/de-B92lssMU.mjs.map +1 -0
  175. package/dist/chunks/de-BJ8Lo9rY.mjs +2 -0
  176. package/dist/chunks/de-BJ8Lo9rY.mjs.map +1 -0
  177. package/dist/chunks/de-BjNoeX05.mjs +2 -0
  178. package/dist/chunks/de-BjNoeX05.mjs.map +1 -0
  179. package/dist/chunks/de-Bktm7FKk.mjs +2 -0
  180. package/dist/chunks/de-Bktm7FKk.mjs.map +1 -0
  181. package/dist/chunks/de-BnhP65y3.mjs +2 -0
  182. package/dist/chunks/de-BnhP65y3.mjs.map +1 -0
  183. package/dist/chunks/de-BqHw2LVH.mjs +2 -0
  184. package/dist/chunks/de-BqHw2LVH.mjs.map +1 -0
  185. package/dist/chunks/de-BzjqF_j0.mjs +2 -0
  186. package/dist/chunks/de-BzjqF_j0.mjs.map +1 -0
  187. package/dist/chunks/de-CWsXH4_J.mjs +2 -0
  188. package/dist/chunks/de-CWsXH4_J.mjs.map +1 -0
  189. package/dist/chunks/de-CWwHCIzX.mjs +2 -0
  190. package/dist/chunks/de-CWwHCIzX.mjs.map +1 -0
  191. package/dist/chunks/de-ChHR-g0q.mjs +2 -0
  192. package/dist/chunks/de-ChHR-g0q.mjs.map +1 -0
  193. package/dist/chunks/de-CqJFzINs.mjs +2 -0
  194. package/dist/chunks/de-CqJFzINs.mjs.map +1 -0
  195. package/dist/chunks/de-DAPQek-i.mjs +2 -0
  196. package/dist/chunks/de-DAPQek-i.mjs.map +1 -0
  197. package/dist/chunks/de-DPzOP2Ge.mjs +2 -0
  198. package/dist/chunks/de-DPzOP2Ge.mjs.map +1 -0
  199. package/dist/chunks/de-DhenqH4M.mjs +2 -0
  200. package/dist/chunks/de-DhenqH4M.mjs.map +1 -0
  201. package/dist/chunks/de-Ds6tfD71.mjs +2 -0
  202. package/dist/chunks/de-Ds6tfD71.mjs.map +1 -0
  203. package/dist/chunks/de-DxyfCVlM.mjs +2 -0
  204. package/dist/chunks/de-DxyfCVlM.mjs.map +1 -0
  205. package/dist/chunks/de-RSzW4zsb.mjs +2 -0
  206. package/dist/chunks/de-RSzW4zsb.mjs.map +1 -0
  207. package/dist/chunks/de-YiJZ87p6.mjs +2 -0
  208. package/dist/chunks/de-YiJZ87p6.mjs.map +1 -0
  209. package/dist/chunks/de-e7G64WBM.mjs +2 -0
  210. package/dist/chunks/de-e7G64WBM.mjs.map +1 -0
  211. package/dist/chunks/de-oeen0lTL.mjs +2 -0
  212. package/dist/chunks/de-oeen0lTL.mjs.map +1 -0
  213. package/dist/chunks/de-p1zboXJW.mjs +2 -0
  214. package/dist/chunks/de-p1zboXJW.mjs.map +1 -0
  215. package/dist/chunks/de-q2xHBWVU.mjs +2 -0
  216. package/dist/chunks/de-q2xHBWVU.mjs.map +1 -0
  217. package/dist/chunks/de-zjzkzZs9.mjs +2 -0
  218. package/dist/chunks/de-zjzkzZs9.mjs.map +1 -0
  219. package/dist/chunks/es-2U-tuiWo.mjs +2 -0
  220. package/dist/chunks/es-2U-tuiWo.mjs.map +1 -0
  221. package/dist/chunks/es-8kEYE5eN.mjs +2 -0
  222. package/dist/chunks/es-8kEYE5eN.mjs.map +1 -0
  223. package/dist/chunks/es-B2B0W46I.mjs +2 -0
  224. package/dist/chunks/es-B2B0W46I.mjs.map +1 -0
  225. package/dist/chunks/es-B8Ne6vhS.mjs +2 -0
  226. package/dist/chunks/es-B8Ne6vhS.mjs.map +1 -0
  227. package/dist/chunks/es-BBaS8xrI.mjs +2 -0
  228. package/dist/chunks/es-BBaS8xrI.mjs.map +1 -0
  229. package/dist/chunks/es-BJibD3UW.mjs +2 -0
  230. package/dist/chunks/es-BJibD3UW.mjs.map +1 -0
  231. package/dist/chunks/es-BL7KuLOg.mjs +2 -0
  232. package/dist/chunks/es-BL7KuLOg.mjs.map +1 -0
  233. package/dist/chunks/es-BUIOf37N.mjs +2 -0
  234. package/dist/chunks/es-BUIOf37N.mjs.map +1 -0
  235. package/dist/chunks/es-BcEc0JEI.mjs +2 -0
  236. package/dist/chunks/es-BcEc0JEI.mjs.map +1 -0
  237. package/dist/chunks/es-BjomAlG3.mjs +2 -0
  238. package/dist/chunks/es-BjomAlG3.mjs.map +1 -0
  239. package/dist/chunks/es-BpgE28ol.mjs +2 -0
  240. package/dist/chunks/es-BpgE28ol.mjs.map +1 -0
  241. package/dist/chunks/es-Bq_XkuDG.mjs +2 -0
  242. package/dist/chunks/es-Bq_XkuDG.mjs.map +1 -0
  243. package/dist/chunks/es-BtTQw2t5.mjs +2 -0
  244. package/dist/chunks/es-BtTQw2t5.mjs.map +1 -0
  245. package/dist/chunks/es-Bwy7v223.mjs +2 -0
  246. package/dist/chunks/es-Bwy7v223.mjs.map +1 -0
  247. package/dist/chunks/es-C0Jm_n57.mjs +2 -0
  248. package/dist/chunks/es-C0Jm_n57.mjs.map +1 -0
  249. package/dist/chunks/es-C49UmQIT.mjs +2 -0
  250. package/dist/chunks/es-C49UmQIT.mjs.map +1 -0
  251. package/dist/chunks/es-CCAT_-nb.mjs +2 -0
  252. package/dist/chunks/es-CCAT_-nb.mjs.map +1 -0
  253. package/dist/chunks/es-CGGqdLIQ.mjs +2 -0
  254. package/dist/chunks/es-CGGqdLIQ.mjs.map +1 -0
  255. package/dist/chunks/es-CYKm6CQM.mjs +2 -0
  256. package/dist/chunks/es-CYKm6CQM.mjs.map +1 -0
  257. package/dist/chunks/es-C_L1Wdfi.mjs +2 -0
  258. package/dist/chunks/es-C_L1Wdfi.mjs.map +1 -0
  259. package/dist/chunks/es-DEo4yDI6.mjs +2 -0
  260. package/dist/chunks/es-DEo4yDI6.mjs.map +1 -0
  261. package/dist/chunks/es-D_6MYvFK.mjs +2 -0
  262. package/dist/chunks/es-D_6MYvFK.mjs.map +1 -0
  263. package/dist/chunks/es-DcYIJR0T.mjs +2 -0
  264. package/dist/chunks/es-DcYIJR0T.mjs.map +1 -0
  265. package/dist/chunks/es-y2SZmX3P.mjs +2 -0
  266. package/dist/chunks/es-y2SZmX3P.mjs.map +1 -0
  267. package/dist/chunks/fonts-B3hiRKxQ.mjs +2 -0
  268. package/dist/chunks/fonts-B3hiRKxQ.mjs.map +1 -0
  269. package/dist/chunks/fr-Ame1k629.mjs +2 -0
  270. package/dist/chunks/fr-Ame1k629.mjs.map +1 -0
  271. package/dist/chunks/fr-BCN045Ph.mjs +2 -0
  272. package/dist/chunks/fr-BCN045Ph.mjs.map +1 -0
  273. package/dist/chunks/fr-BQaiAAa6.mjs +2 -0
  274. package/dist/chunks/fr-BQaiAAa6.mjs.map +1 -0
  275. package/dist/chunks/fr-BR61Uevp.mjs +2 -0
  276. package/dist/chunks/fr-BR61Uevp.mjs.map +1 -0
  277. package/dist/chunks/fr-Bb-xVkAd.mjs +2 -0
  278. package/dist/chunks/fr-Bb-xVkAd.mjs.map +1 -0
  279. package/dist/chunks/fr-BhM3Ykql.mjs +2 -0
  280. package/dist/chunks/fr-BhM3Ykql.mjs.map +1 -0
  281. package/dist/chunks/fr-BqQRlsfW.mjs +2 -0
  282. package/dist/chunks/fr-BqQRlsfW.mjs.map +1 -0
  283. package/dist/chunks/fr-C81THS0v.mjs +2 -0
  284. package/dist/chunks/fr-C81THS0v.mjs.map +1 -0
  285. package/dist/chunks/fr-CXzpB6GU.mjs +2 -0
  286. package/dist/chunks/fr-CXzpB6GU.mjs.map +1 -0
  287. package/dist/chunks/fr-CjLyVnG3.mjs +2 -0
  288. package/dist/chunks/fr-CjLyVnG3.mjs.map +1 -0
  289. package/dist/chunks/fr-D66EEW9-.mjs +2 -0
  290. package/dist/chunks/fr-D66EEW9-.mjs.map +1 -0
  291. package/dist/chunks/fr-DHDNGQpl.mjs +2 -0
  292. package/dist/chunks/fr-DHDNGQpl.mjs.map +1 -0
  293. package/dist/chunks/fr-DOcFqSiX.mjs +2 -0
  294. package/dist/chunks/fr-DOcFqSiX.mjs.map +1 -0
  295. package/dist/chunks/fr-DPPHZ6H7.mjs +2 -0
  296. package/dist/chunks/fr-DPPHZ6H7.mjs.map +1 -0
  297. package/dist/chunks/fr-DVteHTTh.mjs +2 -0
  298. package/dist/chunks/fr-DVteHTTh.mjs.map +1 -0
  299. package/dist/chunks/fr-Dkeg9Am0.mjs +2 -0
  300. package/dist/chunks/fr-Dkeg9Am0.mjs.map +1 -0
  301. package/dist/chunks/fr-DnP_hh5Q.mjs +2 -0
  302. package/dist/chunks/fr-DnP_hh5Q.mjs.map +1 -0
  303. package/dist/chunks/fr-GSoPohxY.mjs +2 -0
  304. package/dist/chunks/fr-GSoPohxY.mjs.map +1 -0
  305. package/dist/chunks/fr-aDJE54Is.mjs +2 -0
  306. package/dist/chunks/fr-aDJE54Is.mjs.map +1 -0
  307. package/dist/chunks/fr-hStmLXCS.mjs +2 -0
  308. package/dist/chunks/fr-hStmLXCS.mjs.map +1 -0
  309. package/dist/chunks/fr-hUF51sR5.mjs +2 -0
  310. package/dist/chunks/fr-hUF51sR5.mjs.map +1 -0
  311. package/dist/chunks/fr-tK6rWhoz.mjs +2 -0
  312. package/dist/chunks/fr-tK6rWhoz.mjs.map +1 -0
  313. package/dist/chunks/fr-wqbTMwkj.mjs +2 -0
  314. package/dist/chunks/fr-wqbTMwkj.mjs.map +1 -0
  315. package/dist/chunks/fr-zO4UIZj_.mjs +2 -0
  316. package/dist/chunks/fr-zO4UIZj_.mjs.map +1 -0
  317. package/dist/chunks/full-DCZ8MMpe.mjs +2 -0
  318. package/dist/chunks/full-DCZ8MMpe.mjs.map +1 -0
  319. package/dist/chunks/hi-B7zs2lw-.mjs +2 -0
  320. package/dist/chunks/hi-B7zs2lw-.mjs.map +1 -0
  321. package/dist/chunks/hi-BE4pkSYX.mjs +2 -0
  322. package/dist/chunks/hi-BE4pkSYX.mjs.map +1 -0
  323. package/dist/chunks/hi-BEBdteKo.mjs +2 -0
  324. package/dist/chunks/hi-BEBdteKo.mjs.map +1 -0
  325. package/dist/chunks/hi-BFBRjxgB.mjs +2 -0
  326. package/dist/chunks/hi-BFBRjxgB.mjs.map +1 -0
  327. package/dist/chunks/hi-BGMkRr1l.mjs +2 -0
  328. package/dist/chunks/hi-BGMkRr1l.mjs.map +1 -0
  329. package/dist/chunks/hi-BKJbF0k9.mjs +2 -0
  330. package/dist/chunks/hi-BKJbF0k9.mjs.map +1 -0
  331. package/dist/chunks/hi-Bj-wENIe.mjs +2 -0
  332. package/dist/chunks/hi-Bj-wENIe.mjs.map +1 -0
  333. package/dist/chunks/hi-Bo_sc83d.mjs +2 -0
  334. package/dist/chunks/hi-Bo_sc83d.mjs.map +1 -0
  335. package/dist/chunks/hi-BqdojmVi.mjs +2 -0
  336. package/dist/chunks/hi-BqdojmVi.mjs.map +1 -0
  337. package/dist/chunks/hi-C2HFcJ8H.mjs +2 -0
  338. package/dist/chunks/hi-C2HFcJ8H.mjs.map +1 -0
  339. package/dist/chunks/hi-C9hGhR9D.mjs +2 -0
  340. package/dist/chunks/hi-C9hGhR9D.mjs.map +1 -0
  341. package/dist/chunks/hi-CRsCP_UU.mjs +2 -0
  342. package/dist/chunks/hi-CRsCP_UU.mjs.map +1 -0
  343. package/dist/chunks/hi-CSatC6e_.mjs +2 -0
  344. package/dist/chunks/hi-CSatC6e_.mjs.map +1 -0
  345. package/dist/chunks/hi-CTb2tu17.mjs +2 -0
  346. package/dist/chunks/hi-CTb2tu17.mjs.map +1 -0
  347. package/dist/chunks/hi-Cik-gmhU.mjs +2 -0
  348. package/dist/chunks/hi-Cik-gmhU.mjs.map +1 -0
  349. package/dist/chunks/hi-Co2ThMh7.mjs +2 -0
  350. package/dist/chunks/hi-Co2ThMh7.mjs.map +1 -0
  351. package/dist/chunks/hi-CrATuZJr.mjs +2 -0
  352. package/dist/chunks/hi-CrATuZJr.mjs.map +1 -0
  353. package/dist/chunks/hi-D-r5tA_n.mjs +2 -0
  354. package/dist/chunks/hi-D-r5tA_n.mjs.map +1 -0
  355. package/dist/chunks/hi-D0RKvhDO.mjs +2 -0
  356. package/dist/chunks/hi-D0RKvhDO.mjs.map +1 -0
  357. package/dist/chunks/hi-DOSbCXy_.mjs +2 -0
  358. package/dist/chunks/hi-DOSbCXy_.mjs.map +1 -0
  359. package/dist/chunks/hi-DTUY7wlZ.mjs +2 -0
  360. package/dist/chunks/hi-DTUY7wlZ.mjs.map +1 -0
  361. package/dist/chunks/hi-FhcxnL2S.mjs +2 -0
  362. package/dist/chunks/hi-FhcxnL2S.mjs.map +1 -0
  363. package/dist/chunks/hi-K71sKi2-.mjs +2 -0
  364. package/dist/chunks/hi-K71sKi2-.mjs.map +1 -0
  365. package/dist/chunks/hi-xjChf5ZY.mjs +2 -0
  366. package/dist/chunks/hi-xjChf5ZY.mjs.map +1 -0
  367. package/dist/chunks/minimal-DmYfqOxb.mjs +2 -0
  368. package/dist/chunks/minimal-DmYfqOxb.mjs.map +1 -0
  369. package/dist/chunks/pt-6uTV9TBd.mjs +2 -0
  370. package/dist/chunks/pt-6uTV9TBd.mjs.map +1 -0
  371. package/dist/chunks/pt-7ZYOqmC4.mjs +2 -0
  372. package/dist/chunks/pt-7ZYOqmC4.mjs.map +1 -0
  373. package/dist/chunks/pt-B65Mk0F_.mjs +2 -0
  374. package/dist/chunks/pt-B65Mk0F_.mjs.map +1 -0
  375. package/dist/chunks/pt-B9c20zi-.mjs +2 -0
  376. package/dist/chunks/pt-B9c20zi-.mjs.map +1 -0
  377. package/dist/chunks/pt-BRQRHBoW.mjs +2 -0
  378. package/dist/chunks/pt-BRQRHBoW.mjs.map +1 -0
  379. package/dist/chunks/pt-BYsPmDNG.mjs +2 -0
  380. package/dist/chunks/pt-BYsPmDNG.mjs.map +1 -0
  381. package/dist/chunks/pt-BattAVOq.mjs +2 -0
  382. package/dist/chunks/pt-BattAVOq.mjs.map +1 -0
  383. package/dist/chunks/pt-Bau_d96t.mjs +2 -0
  384. package/dist/chunks/pt-Bau_d96t.mjs.map +1 -0
  385. package/dist/chunks/pt-Bb3sODVO.mjs +2 -0
  386. package/dist/chunks/pt-Bb3sODVO.mjs.map +1 -0
  387. package/dist/chunks/pt-BieXcDHi.mjs +2 -0
  388. package/dist/chunks/pt-BieXcDHi.mjs.map +1 -0
  389. package/dist/chunks/pt-BzJZ6tis.mjs +2 -0
  390. package/dist/chunks/pt-BzJZ6tis.mjs.map +1 -0
  391. package/dist/chunks/pt-CDBahjbg.mjs +2 -0
  392. package/dist/chunks/pt-CDBahjbg.mjs.map +1 -0
  393. package/dist/chunks/pt-CQIn2xA5.mjs +2 -0
  394. package/dist/chunks/pt-CQIn2xA5.mjs.map +1 -0
  395. package/dist/chunks/pt-Cx3gdB5p.mjs +2 -0
  396. package/dist/chunks/pt-Cx3gdB5p.mjs.map +1 -0
  397. package/dist/chunks/pt-D7n_VUMD.mjs +2 -0
  398. package/dist/chunks/pt-D7n_VUMD.mjs.map +1 -0
  399. package/dist/chunks/pt-DEg_u7oB.mjs +2 -0
  400. package/dist/chunks/pt-DEg_u7oB.mjs.map +1 -0
  401. package/dist/chunks/pt-DchozfDf.mjs +2 -0
  402. package/dist/chunks/pt-DchozfDf.mjs.map +1 -0
  403. package/dist/chunks/pt-DnHYzWZI.mjs +2 -0
  404. package/dist/chunks/pt-DnHYzWZI.mjs.map +1 -0
  405. package/dist/chunks/pt-Dne18ay-.mjs +2 -0
  406. package/dist/chunks/pt-Dne18ay-.mjs.map +1 -0
  407. package/dist/chunks/pt-DxTZELCn.mjs +2 -0
  408. package/dist/chunks/pt-DxTZELCn.mjs.map +1 -0
  409. package/dist/chunks/pt-FnLj_fwL.mjs +2 -0
  410. package/dist/chunks/pt-FnLj_fwL.mjs.map +1 -0
  411. package/dist/chunks/pt-QZcGM_AW.mjs +2 -0
  412. package/dist/chunks/pt-QZcGM_AW.mjs.map +1 -0
  413. package/dist/chunks/pt-X4oj0zCg.mjs +2 -0
  414. package/dist/chunks/pt-X4oj0zCg.mjs.map +1 -0
  415. package/dist/chunks/pt-hgZhGt5D.mjs +2 -0
  416. package/dist/chunks/pt-hgZhGt5D.mjs.map +1 -0
  417. package/dist/chunks/ru-333jycve.mjs +2 -0
  418. package/dist/chunks/ru-333jycve.mjs.map +1 -0
  419. package/dist/chunks/ru-B278yBd4.mjs +2 -0
  420. package/dist/chunks/ru-B278yBd4.mjs.map +1 -0
  421. package/dist/chunks/ru-B2dlVf3F.mjs +2 -0
  422. package/dist/chunks/ru-B2dlVf3F.mjs.map +1 -0
  423. package/dist/chunks/ru-BHZdR6yk.mjs +2 -0
  424. package/dist/chunks/ru-BHZdR6yk.mjs.map +1 -0
  425. package/dist/chunks/ru-BhXqR_wI.mjs +2 -0
  426. package/dist/chunks/ru-BhXqR_wI.mjs.map +1 -0
  427. package/dist/chunks/ru-BkhY_-Tu.mjs +2 -0
  428. package/dist/chunks/ru-BkhY_-Tu.mjs.map +1 -0
  429. package/dist/chunks/ru-BqJmK6DG.mjs +2 -0
  430. package/dist/chunks/ru-BqJmK6DG.mjs.map +1 -0
  431. package/dist/chunks/ru-BscEW-yr.mjs +2 -0
  432. package/dist/chunks/ru-BscEW-yr.mjs.map +1 -0
  433. package/dist/chunks/ru-C91kg2w_.mjs +2 -0
  434. package/dist/chunks/ru-C91kg2w_.mjs.map +1 -0
  435. package/dist/chunks/ru-CQoFJYQk.mjs +2 -0
  436. package/dist/chunks/ru-CQoFJYQk.mjs.map +1 -0
  437. package/dist/chunks/ru-CYMaDdFA.mjs +2 -0
  438. package/dist/chunks/ru-CYMaDdFA.mjs.map +1 -0
  439. package/dist/chunks/ru-ClE-ByL-.mjs +2 -0
  440. package/dist/chunks/ru-ClE-ByL-.mjs.map +1 -0
  441. package/dist/chunks/ru-CmLLEJJV.mjs +2 -0
  442. package/dist/chunks/ru-CmLLEJJV.mjs.map +1 -0
  443. package/dist/chunks/ru-CmlYwIPH.mjs +2 -0
  444. package/dist/chunks/ru-CmlYwIPH.mjs.map +1 -0
  445. package/dist/chunks/ru-D74ItjLR.mjs +2 -0
  446. package/dist/chunks/ru-D74ItjLR.mjs.map +1 -0
  447. package/dist/chunks/ru-DR7ji_U_.mjs +2 -0
  448. package/dist/chunks/ru-DR7ji_U_.mjs.map +1 -0
  449. package/dist/chunks/ru-DZ0titlK.mjs +2 -0
  450. package/dist/chunks/ru-DZ0titlK.mjs.map +1 -0
  451. package/dist/chunks/ru-DftPghQ8.mjs +2 -0
  452. package/dist/chunks/ru-DftPghQ8.mjs.map +1 -0
  453. package/dist/chunks/ru-L3ML505C.mjs +2 -0
  454. package/dist/chunks/ru-L3ML505C.mjs.map +1 -0
  455. package/dist/chunks/ru-U-UhwubV.mjs +2 -0
  456. package/dist/chunks/ru-U-UhwubV.mjs.map +1 -0
  457. package/dist/chunks/ru-VAZhjO4q.mjs +2 -0
  458. package/dist/chunks/ru-VAZhjO4q.mjs.map +1 -0
  459. package/dist/chunks/ru-afocv3DK.mjs +2 -0
  460. package/dist/chunks/ru-afocv3DK.mjs.map +1 -0
  461. package/dist/chunks/ru-gUXymxbh.mjs +2 -0
  462. package/dist/chunks/ru-gUXymxbh.mjs.map +1 -0
  463. package/dist/chunks/ru-qL1ebv4O.mjs +2 -0
  464. package/dist/chunks/ru-qL1ebv4O.mjs.map +1 -0
  465. package/dist/chunks/shared-BLU27F7-.mjs +2 -0
  466. package/dist/chunks/shared-BLU27F7-.mjs.map +1 -0
  467. package/dist/chunks/src-CgbuJfYr.mjs +2 -0
  468. package/dist/chunks/src-CgbuJfYr.mjs.map +1 -0
  469. package/dist/chunks/text-direction-advanced-CkFu0K_I.mjs +2 -0
  470. package/dist/chunks/text-direction-advanced-CkFu0K_I.mjs.map +1 -0
  471. package/dist/chunks/zh-B3geJFGW.mjs +2 -0
  472. package/dist/chunks/zh-B3geJFGW.mjs.map +1 -0
  473. package/dist/chunks/zh-B4p7M6XB.mjs +2 -0
  474. package/dist/chunks/zh-B4p7M6XB.mjs.map +1 -0
  475. package/dist/chunks/zh-BkwaMj9a.mjs +2 -0
  476. package/dist/chunks/zh-BkwaMj9a.mjs.map +1 -0
  477. package/dist/chunks/zh-BogAT6ZW.mjs +2 -0
  478. package/dist/chunks/zh-BogAT6ZW.mjs.map +1 -0
  479. package/dist/chunks/zh-BvMEmsyF.mjs +2 -0
  480. package/dist/chunks/zh-BvMEmsyF.mjs.map +1 -0
  481. package/dist/chunks/zh-BzLh1p5b.mjs +2 -0
  482. package/dist/chunks/zh-BzLh1p5b.mjs.map +1 -0
  483. package/dist/chunks/zh-CBMpL9ha.mjs +2 -0
  484. package/dist/chunks/zh-CBMpL9ha.mjs.map +1 -0
  485. package/dist/chunks/zh-CIFsVnFl.mjs +2 -0
  486. package/dist/chunks/zh-CIFsVnFl.mjs.map +1 -0
  487. package/dist/chunks/zh-CP6_YzAc.mjs +2 -0
  488. package/dist/chunks/zh-CP6_YzAc.mjs.map +1 -0
  489. package/dist/chunks/zh-CT4V3EmW.mjs +2 -0
  490. package/dist/chunks/zh-CT4V3EmW.mjs.map +1 -0
  491. package/dist/chunks/zh-CZCIluI_.mjs +2 -0
  492. package/dist/chunks/zh-CZCIluI_.mjs.map +1 -0
  493. package/dist/chunks/zh-CcMLjYrk.mjs +2 -0
  494. package/dist/chunks/zh-CcMLjYrk.mjs.map +1 -0
  495. package/dist/chunks/zh-CfCQsLZa.mjs +2 -0
  496. package/dist/chunks/zh-CfCQsLZa.mjs.map +1 -0
  497. package/dist/chunks/zh-CsyBlhtm.mjs +2 -0
  498. package/dist/chunks/zh-CsyBlhtm.mjs.map +1 -0
  499. package/dist/chunks/zh-DSfxjb4Y.mjs +2 -0
  500. package/dist/chunks/zh-DSfxjb4Y.mjs.map +1 -0
  501. package/dist/chunks/zh-Dj5jzeIJ.mjs +2 -0
  502. package/dist/chunks/zh-Dj5jzeIJ.mjs.map +1 -0
  503. package/dist/chunks/zh-DjY-jmYn.mjs +2 -0
  504. package/dist/chunks/zh-DjY-jmYn.mjs.map +1 -0
  505. package/dist/chunks/zh-Dt7zL1Bl.mjs +2 -0
  506. package/dist/chunks/zh-Dt7zL1Bl.mjs.map +1 -0
  507. package/dist/chunks/zh-TXVgSc3H.mjs +2 -0
  508. package/dist/chunks/zh-TXVgSc3H.mjs.map +1 -0
  509. package/dist/chunks/zh-bkCXy34A.mjs +2 -0
  510. package/dist/chunks/zh-bkCXy34A.mjs.map +1 -0
  511. package/dist/chunks/zh-cRqBrQM8.mjs +2 -0
  512. package/dist/chunks/zh-cRqBrQM8.mjs.map +1 -0
  513. package/dist/chunks/zh-cUJdRfxu.mjs +2 -0
  514. package/dist/chunks/zh-cUJdRfxu.mjs.map +1 -0
  515. package/dist/chunks/zh-qo4_i9Vd.mjs +2 -0
  516. package/dist/chunks/zh-qo4_i9Vd.mjs.map +1 -0
  517. package/dist/chunks/zh-tpUU3oJa.mjs +2 -0
  518. package/dist/chunks/zh-tpUU3oJa.mjs.map +1 -0
  519. package/dist/editor/ContentSerializer.d.ts +2 -2
  520. package/dist/editor/ContentSerializer.d.ts.map +1 -1
  521. package/dist/editor/styles/base.d.ts +1 -1
  522. package/dist/editor/styles/base.d.ts.map +1 -1
  523. package/dist/editor/theme/ThemeEngine.d.ts.map +1 -1
  524. package/dist/editor/theme/ThemeTokens.d.ts +7 -0
  525. package/dist/editor/theme/ThemeTokens.d.ts.map +1 -1
  526. package/dist/fonts.mjs +1 -1
  527. package/dist/full.d.ts +1 -0
  528. package/dist/full.d.ts.map +1 -1
  529. package/dist/full.mjs +1 -1
  530. package/dist/html.mjs +1 -1
  531. package/dist/notectl-core.mjs +1 -1
  532. package/dist/notectl-core.umd.js +1 -1
  533. package/dist/notectl-core.umd.js.map +1 -1
  534. package/dist/plugins/CommandRegistry.d.ts +19 -0
  535. package/dist/plugins/CommandRegistry.d.ts.map +1 -0
  536. package/dist/plugins/MiddlewareChain.d.ts +39 -0
  537. package/dist/plugins/MiddlewareChain.d.ts.map +1 -0
  538. package/dist/plugins/PluginLifecycle.d.ts +56 -0
  539. package/dist/plugins/PluginLifecycle.d.ts.map +1 -0
  540. package/dist/plugins/PluginManager.d.ts +9 -63
  541. package/dist/plugins/PluginManager.d.ts.map +1 -1
  542. package/dist/plugins/RegistrationTracker.d.ts +38 -0
  543. package/dist/plugins/RegistrationTracker.d.ts.map +1 -0
  544. package/dist/plugins/ServiceRegistry.d.ts +14 -0
  545. package/dist/plugins/ServiceRegistry.d.ts.map +1 -0
  546. package/dist/plugins/alignment.mjs +1 -1
  547. package/dist/plugins/blockquote.mjs +1 -1
  548. package/dist/plugins/caret-navigation.mjs +1 -1
  549. package/dist/plugins/code-block/CodeBlockTypes.d.ts +1 -1
  550. package/dist/plugins/code-block/CodeBlockTypes.d.ts.map +1 -1
  551. package/dist/plugins/code-block.mjs +1 -1
  552. package/dist/plugins/font-size.mjs +1 -1
  553. package/dist/plugins/font.mjs +1 -1
  554. package/dist/plugins/gap-cursor.mjs +1 -1
  555. package/dist/plugins/hard-break.mjs +1 -1
  556. package/dist/plugins/heading.mjs +1 -1
  557. package/dist/plugins/highlight.mjs +1 -1
  558. package/dist/plugins/horizontal-rule.mjs +1 -1
  559. package/dist/plugins/image.mjs +1 -1
  560. package/dist/plugins/inline-code/InlineCodeLocale.d.ts +10 -0
  561. package/dist/plugins/inline-code/InlineCodeLocale.d.ts.map +1 -0
  562. package/dist/plugins/inline-code/InlineCodePlugin.d.ts +39 -0
  563. package/dist/plugins/inline-code/InlineCodePlugin.d.ts.map +1 -0
  564. package/dist/plugins/inline-code/index.d.ts +4 -0
  565. package/dist/plugins/inline-code/index.d.ts.map +1 -0
  566. package/dist/plugins/inline-code/locales/ar.d.ts +4 -0
  567. package/dist/plugins/inline-code/locales/ar.d.ts.map +1 -0
  568. package/dist/plugins/inline-code/locales/de.d.ts +4 -0
  569. package/dist/plugins/inline-code/locales/de.d.ts.map +1 -0
  570. package/dist/plugins/inline-code/locales/es.d.ts +4 -0
  571. package/dist/plugins/inline-code/locales/es.d.ts.map +1 -0
  572. package/dist/plugins/inline-code/locales/fr.d.ts +4 -0
  573. package/dist/plugins/inline-code/locales/fr.d.ts.map +1 -0
  574. package/dist/plugins/inline-code/locales/hi.d.ts +4 -0
  575. package/dist/plugins/inline-code/locales/hi.d.ts.map +1 -0
  576. package/dist/plugins/inline-code/locales/pt.d.ts +4 -0
  577. package/dist/plugins/inline-code/locales/pt.d.ts.map +1 -0
  578. package/dist/plugins/inline-code/locales/ru.d.ts +4 -0
  579. package/dist/plugins/inline-code/locales/ru.d.ts.map +1 -0
  580. package/dist/plugins/inline-code/locales/zh.d.ts +4 -0
  581. package/dist/plugins/inline-code/locales/zh.d.ts.map +1 -0
  582. package/dist/plugins/inline-code.mjs +1 -0
  583. package/dist/plugins/language.mjs +1 -1
  584. package/dist/plugins/link.mjs +1 -1
  585. package/dist/plugins/list.mjs +1 -1
  586. package/dist/plugins/print/PrintStyleCollector.d.ts +7 -1
  587. package/dist/plugins/print/PrintStyleCollector.d.ts.map +1 -1
  588. package/dist/plugins/print/PrintTypes.d.ts +5 -0
  589. package/dist/plugins/print/PrintTypes.d.ts.map +1 -1
  590. package/dist/plugins/print.mjs +1 -1
  591. package/dist/plugins/shared.mjs +1 -1
  592. package/dist/plugins/smart-paste.mjs +1 -1
  593. package/dist/plugins/strikethrough.mjs +1 -1
  594. package/dist/plugins/super-sub.mjs +1 -1
  595. package/dist/plugins/table.mjs +1 -1
  596. package/dist/plugins/text-color.mjs +1 -1
  597. package/dist/plugins/text-direction-advanced.mjs +1 -1
  598. package/dist/plugins/text-direction.mjs +1 -1
  599. package/dist/plugins/text-formatting.mjs +1 -1
  600. package/dist/plugins/toolbar.mjs +1 -1
  601. package/dist/presets/FullPreset.d.ts +1 -1
  602. package/dist/presets/FullPreset.d.ts.map +1 -1
  603. package/dist/presets/PresetTypes.d.ts +2 -0
  604. package/dist/presets/PresetTypes.d.ts.map +1 -1
  605. package/dist/presets/full.mjs +1 -1
  606. package/dist/presets/minimal.mjs +1 -1
  607. package/dist/presets.mjs +1 -1
  608. package/dist/serialization/DocumentParser.d.ts.map +1 -1
  609. package/package.json +11 -1
  610. package/dist/chunks/AlignmentPlugin-DGb1VtCU.mjs +0 -2
  611. package/dist/chunks/AlignmentPlugin-DGb1VtCU.mjs.map +0 -1
  612. package/dist/chunks/AttrRegistry-DvqbnJ6T.mjs +0 -2
  613. package/dist/chunks/AttrRegistry-DvqbnJ6T.mjs.map +0 -1
  614. package/dist/chunks/AttributedMarkCommands-BiJtiHpx.mjs +0 -2
  615. package/dist/chunks/AttributedMarkCommands-BiJtiHpx.mjs.map +0 -1
  616. package/dist/chunks/BlockInsertion-Q8B21SaG.mjs +0 -2
  617. package/dist/chunks/BlockInsertion-Q8B21SaG.mjs.map +0 -1
  618. package/dist/chunks/BlockTypePickerRegistry-5fFlS2i0.mjs +0 -2
  619. package/dist/chunks/BlockTypePickerRegistry-5fFlS2i0.mjs.map +0 -1
  620. package/dist/chunks/BlockquotePlugin-Dz8Pny1r.mjs +0 -2
  621. package/dist/chunks/BlockquotePlugin-Dz8Pny1r.mjs.map +0 -1
  622. package/dist/chunks/CaretNavigationPlugin-C-6zNBbl.mjs +0 -2
  623. package/dist/chunks/CaretNavigationPlugin-C-6zNBbl.mjs.map +0 -1
  624. package/dist/chunks/CodeBlockPlugin-C8H0nfF6.mjs +0 -2
  625. package/dist/chunks/CodeBlockPlugin-C8H0nfF6.mjs.map +0 -1
  626. package/dist/chunks/ColorGrid-CcF0bH26.mjs +0 -2
  627. package/dist/chunks/ColorGrid-CcF0bH26.mjs.map +0 -1
  628. package/dist/chunks/ColorPickerPopup-BZxMBDxy.mjs +0 -2
  629. package/dist/chunks/ColorPickerPopup-BZxMBDxy.mjs.map +0 -1
  630. package/dist/chunks/ColorValidation-rOrJxBBt.mjs +0 -2
  631. package/dist/chunks/ColorValidation-rOrJxBBt.mjs.map +0 -1
  632. package/dist/chunks/CommandHelpers-G6M-qXJR.mjs +0 -2
  633. package/dist/chunks/CommandHelpers-G6M-qXJR.mjs.map +0 -1
  634. package/dist/chunks/Commands-ByBjgD3-.mjs +0 -2
  635. package/dist/chunks/Commands-ByBjgD3-.mjs.map +0 -1
  636. package/dist/chunks/Decoration-D-yB-H5v.mjs +0 -2
  637. package/dist/chunks/Decoration-D-yB-H5v.mjs.map +0 -1
  638. package/dist/chunks/Document-DnPKbcPE.mjs +0 -2
  639. package/dist/chunks/Document-DnPKbcPE.mjs.map +0 -1
  640. package/dist/chunks/DocumentParser-KuBaEZN6.mjs +0 -2
  641. package/dist/chunks/DocumentParser-KuBaEZN6.mjs.map +0 -1
  642. package/dist/chunks/DocumentSerializer-DgdiJsES.mjs +0 -2
  643. package/dist/chunks/DocumentSerializer-DgdiJsES.mjs.map +0 -1
  644. package/dist/chunks/DomUtils-BkyCg-OO.mjs +0 -2
  645. package/dist/chunks/DomUtils-BkyCg-OO.mjs.map +0 -1
  646. package/dist/chunks/FontPlugin-BDjM9v3y.mjs +0 -2
  647. package/dist/chunks/FontPlugin-BDjM9v3y.mjs.map +0 -1
  648. package/dist/chunks/FontSizePlugin-CGlH-S6g.mjs +0 -2
  649. package/dist/chunks/FontSizePlugin-CGlH-S6g.mjs.map +0 -1
  650. package/dist/chunks/GapCursorNavigation-uytzcZ6C.mjs +0 -2
  651. package/dist/chunks/GapCursorNavigation-uytzcZ6C.mjs.map +0 -1
  652. package/dist/chunks/GapCursorPlugin-BQ2_-7i6.mjs +0 -2
  653. package/dist/chunks/GapCursorPlugin-BQ2_-7i6.mjs.map +0 -1
  654. package/dist/chunks/HTMLUtils-BLwp5G4f.mjs +0 -2
  655. package/dist/chunks/HTMLUtils-BLwp5G4f.mjs.map +0 -1
  656. package/dist/chunks/HardBreakPlugin-CCrP_Kec.mjs +0 -2
  657. package/dist/chunks/HardBreakPlugin-CCrP_Kec.mjs.map +0 -1
  658. package/dist/chunks/HeadingPlugin-BiDNuBmw.mjs +0 -2
  659. package/dist/chunks/HeadingPlugin-BiDNuBmw.mjs.map +0 -1
  660. package/dist/chunks/HighlightPlugin-CwrtRVfS.mjs +0 -2
  661. package/dist/chunks/HighlightPlugin-CwrtRVfS.mjs.map +0 -1
  662. package/dist/chunks/HorizontalRulePlugin-CKIkbVwn.mjs +0 -2
  663. package/dist/chunks/HorizontalRulePlugin-CKIkbVwn.mjs.map +0 -1
  664. package/dist/chunks/ImagePlugin-BqRAKlG1.mjs +0 -2
  665. package/dist/chunks/ImagePlugin-BqRAKlG1.mjs.map +0 -1
  666. package/dist/chunks/KeyboardNav-IMWHB6wc.mjs +0 -2
  667. package/dist/chunks/KeyboardNav-IMWHB6wc.mjs.map +0 -1
  668. package/dist/chunks/LinkPlugin-Cb2cpFe8.mjs +0 -2
  669. package/dist/chunks/LinkPlugin-Cb2cpFe8.mjs.map +0 -1
  670. package/dist/chunks/ListPlugin-C_YjbVjT.mjs +0 -2
  671. package/dist/chunks/ListPlugin-C_YjbVjT.mjs.map +0 -1
  672. package/dist/chunks/NavigationQueries-CgYPG6oY.mjs +0 -2
  673. package/dist/chunks/NavigationQueries-CgYPG6oY.mjs.map +0 -1
  674. package/dist/chunks/NodeResolver-BkOsZnuU.mjs +0 -2
  675. package/dist/chunks/NodeResolver-BkOsZnuU.mjs.map +0 -1
  676. package/dist/chunks/NodeSelectionCommands-U8xEdaE4.mjs +0 -2
  677. package/dist/chunks/NodeSelectionCommands-U8xEdaE4.mjs.map +0 -1
  678. package/dist/chunks/Platform-wPvKFB9m.mjs +0 -2
  679. package/dist/chunks/Platform-wPvKFB9m.mjs.map +0 -1
  680. package/dist/chunks/Plugin-C4cBw3bs.mjs +0 -2
  681. package/dist/chunks/Plugin-C4cBw3bs.mjs.map +0 -1
  682. package/dist/chunks/PluginHelpers-BZU5rE44.mjs +0 -2
  683. package/dist/chunks/PluginHelpers-BZU5rE44.mjs.map +0 -1
  684. package/dist/chunks/PopupManager-S2qQtTxR.mjs +0 -2
  685. package/dist/chunks/PopupManager-S2qQtTxR.mjs.map +0 -1
  686. package/dist/chunks/PopupPositioning-BdSCai19.mjs +0 -2
  687. package/dist/chunks/PopupPositioning-BdSCai19.mjs.map +0 -1
  688. package/dist/chunks/PrintPlugin-80SINLGF.mjs +0 -2
  689. package/dist/chunks/PrintPlugin-80SINLGF.mjs.map +0 -1
  690. package/dist/chunks/PrintTypes-CWIAfEaX.mjs +0 -2
  691. package/dist/chunks/PrintTypes-CWIAfEaX.mjs.map +0 -1
  692. package/dist/chunks/RangeIterator-DEuX1xKV.mjs +0 -2
  693. package/dist/chunks/RangeIterator-DEuX1xKV.mjs.map +0 -1
  694. package/dist/chunks/Selection-B14e7gd0.mjs +0 -2
  695. package/dist/chunks/Selection-B14e7gd0.mjs.map +0 -1
  696. package/dist/chunks/ShortcutFormatting-c0IajwWG.mjs +0 -2
  697. package/dist/chunks/ShortcutFormatting-c0IajwWG.mjs.map +0 -1
  698. package/dist/chunks/SmartPastePlugin-pejM1Zyk.mjs +0 -2
  699. package/dist/chunks/SmartPastePlugin-pejM1Zyk.mjs.map +0 -1
  700. package/dist/chunks/StrikethroughPlugin-XBOGv5Oi.mjs +0 -2
  701. package/dist/chunks/StrikethroughPlugin-XBOGv5Oi.mjs.map +0 -1
  702. package/dist/chunks/StyleRuntime-Bwde5icB.mjs +0 -2
  703. package/dist/chunks/StyleRuntime-Bwde5icB.mjs.map +0 -1
  704. package/dist/chunks/SuperSubPlugin-CVjU4W9y.mjs +0 -2
  705. package/dist/chunks/SuperSubPlugin-CVjU4W9y.mjs.map +0 -1
  706. package/dist/chunks/SyntaxTokenTypes-CY2-rJCA.mjs +0 -2
  707. package/dist/chunks/SyntaxTokenTypes-CY2-rJCA.mjs.map +0 -1
  708. package/dist/chunks/TablePlugin-BHpp6h9H.mjs +0 -2
  709. package/dist/chunks/TablePlugin-BHpp6h9H.mjs.map +0 -1
  710. package/dist/chunks/TextColorPlugin-CGbyMGTr.mjs +0 -2
  711. package/dist/chunks/TextColorPlugin-CGbyMGTr.mjs.map +0 -1
  712. package/dist/chunks/TextDirectionCorePlugin-DPU7wy6g.mjs +0 -2
  713. package/dist/chunks/TextDirectionCorePlugin-DPU7wy6g.mjs.map +0 -1
  714. package/dist/chunks/TextDirectionLocale-DxOfFixh.mjs +0 -2
  715. package/dist/chunks/TextDirectionLocale-DxOfFixh.mjs.map +0 -1
  716. package/dist/chunks/TextFormattingPlugin-CYVnhHH4.mjs +0 -2
  717. package/dist/chunks/TextFormattingPlugin-CYVnhHH4.mjs.map +0 -1
  718. package/dist/chunks/ToolbarPlugin-CWDkWXE8.mjs +0 -2
  719. package/dist/chunks/ToolbarPlugin-CWDkWXE8.mjs.map +0 -1
  720. package/dist/chunks/TypeBrands-BQR8dEYU.mjs +0 -2
  721. package/dist/chunks/TypeBrands-BQR8dEYU.mjs.map +0 -1
  722. package/dist/chunks/WordBoundary-BkxXn2JA.mjs +0 -2
  723. package/dist/chunks/WordBoundary-BkxXn2JA.mjs.map +0 -1
  724. package/dist/chunks/XmlDetector-B1y1NzDL.mjs +0 -2
  725. package/dist/chunks/XmlDetector-B1y1NzDL.mjs.map +0 -1
  726. package/dist/chunks/XmlPatterns-B-V-mHF4.mjs +0 -2
  727. package/dist/chunks/XmlPatterns-B-V-mHF4.mjs.map +0 -1
  728. package/dist/chunks/XmlSupport-DRkIIe34.mjs +0 -2
  729. package/dist/chunks/XmlSupport-DRkIIe34.mjs.map +0 -1
  730. package/dist/chunks/ar-BARk0vUs.mjs +0 -2
  731. package/dist/chunks/ar-BARk0vUs.mjs.map +0 -1
  732. package/dist/chunks/ar-BVnwjtBO.mjs +0 -2
  733. package/dist/chunks/ar-BVnwjtBO.mjs.map +0 -1
  734. package/dist/chunks/ar-BaLVMaVO.mjs +0 -2
  735. package/dist/chunks/ar-BaLVMaVO.mjs.map +0 -1
  736. package/dist/chunks/ar-BbXyJVxi.mjs +0 -2
  737. package/dist/chunks/ar-BbXyJVxi.mjs.map +0 -1
  738. package/dist/chunks/ar-Bj_U3O6Y.mjs +0 -2
  739. package/dist/chunks/ar-Bj_U3O6Y.mjs.map +0 -1
  740. package/dist/chunks/ar-CLEiZlfu.mjs +0 -2
  741. package/dist/chunks/ar-CLEiZlfu.mjs.map +0 -1
  742. package/dist/chunks/ar-CaE825oi.mjs +0 -2
  743. package/dist/chunks/ar-CaE825oi.mjs.map +0 -1
  744. package/dist/chunks/ar-CaRHAfkM.mjs +0 -2
  745. package/dist/chunks/ar-CaRHAfkM.mjs.map +0 -1
  746. package/dist/chunks/ar-Cg1wGAxo.mjs +0 -2
  747. package/dist/chunks/ar-Cg1wGAxo.mjs.map +0 -1
  748. package/dist/chunks/ar-Cp9qv7la.mjs +0 -2
  749. package/dist/chunks/ar-Cp9qv7la.mjs.map +0 -1
  750. package/dist/chunks/ar-CpZXocgF.mjs +0 -2
  751. package/dist/chunks/ar-CpZXocgF.mjs.map +0 -1
  752. package/dist/chunks/ar-CqD9pUY0.mjs +0 -2
  753. package/dist/chunks/ar-CqD9pUY0.mjs.map +0 -1
  754. package/dist/chunks/ar-D1DiKwV_.mjs +0 -2
  755. package/dist/chunks/ar-D1DiKwV_.mjs.map +0 -1
  756. package/dist/chunks/ar-D714r_62.mjs +0 -2
  757. package/dist/chunks/ar-D714r_62.mjs.map +0 -1
  758. package/dist/chunks/ar-D8hT58sd.mjs +0 -2
  759. package/dist/chunks/ar-D8hT58sd.mjs.map +0 -1
  760. package/dist/chunks/ar-DYA1zADy.mjs +0 -2
  761. package/dist/chunks/ar-DYA1zADy.mjs.map +0 -1
  762. package/dist/chunks/ar-Dc2VufjD.mjs +0 -2
  763. package/dist/chunks/ar-Dc2VufjD.mjs.map +0 -1
  764. package/dist/chunks/ar-DsmIDxDt.mjs +0 -2
  765. package/dist/chunks/ar-DsmIDxDt.mjs.map +0 -1
  766. package/dist/chunks/ar-M3QzJIS8.mjs +0 -2
  767. package/dist/chunks/ar-M3QzJIS8.mjs.map +0 -1
  768. package/dist/chunks/ar-UKi-TYFz.mjs +0 -2
  769. package/dist/chunks/ar-UKi-TYFz.mjs.map +0 -1
  770. package/dist/chunks/ar-UfrdJzT6.mjs +0 -2
  771. package/dist/chunks/ar-UfrdJzT6.mjs.map +0 -1
  772. package/dist/chunks/ar-fGsuiCw5.mjs +0 -2
  773. package/dist/chunks/ar-fGsuiCw5.mjs.map +0 -1
  774. package/dist/chunks/ar-fSElw9mJ.mjs +0 -2
  775. package/dist/chunks/ar-fSElw9mJ.mjs.map +0 -1
  776. package/dist/chunks/color-picker-iPmE48jm.mjs +0 -2
  777. package/dist/chunks/color-picker-iPmE48jm.mjs.map +0 -1
  778. package/dist/chunks/de-B4BcTYnc.mjs +0 -2
  779. package/dist/chunks/de-B4BcTYnc.mjs.map +0 -1
  780. package/dist/chunks/de-B7H06L3l.mjs +0 -2
  781. package/dist/chunks/de-B7H06L3l.mjs.map +0 -1
  782. package/dist/chunks/de-BWk2-9In.mjs +0 -2
  783. package/dist/chunks/de-BWk2-9In.mjs.map +0 -1
  784. package/dist/chunks/de-ByDTr_of.mjs +0 -2
  785. package/dist/chunks/de-ByDTr_of.mjs.map +0 -1
  786. package/dist/chunks/de-C5If_e7l.mjs +0 -2
  787. package/dist/chunks/de-C5If_e7l.mjs.map +0 -1
  788. package/dist/chunks/de-CAmM7IT5.mjs +0 -2
  789. package/dist/chunks/de-CAmM7IT5.mjs.map +0 -1
  790. package/dist/chunks/de-CF7zshOE.mjs +0 -2
  791. package/dist/chunks/de-CF7zshOE.mjs.map +0 -1
  792. package/dist/chunks/de-CXAESa_f.mjs +0 -2
  793. package/dist/chunks/de-CXAESa_f.mjs.map +0 -1
  794. package/dist/chunks/de-ChvJQZeC.mjs +0 -2
  795. package/dist/chunks/de-ChvJQZeC.mjs.map +0 -1
  796. package/dist/chunks/de-ClJaNWJr.mjs +0 -2
  797. package/dist/chunks/de-ClJaNWJr.mjs.map +0 -1
  798. package/dist/chunks/de-CpNFM0EP.mjs +0 -2
  799. package/dist/chunks/de-CpNFM0EP.mjs.map +0 -1
  800. package/dist/chunks/de-CwSQIBLx.mjs +0 -2
  801. package/dist/chunks/de-CwSQIBLx.mjs.map +0 -1
  802. package/dist/chunks/de-D3lxYgJa.mjs +0 -2
  803. package/dist/chunks/de-D3lxYgJa.mjs.map +0 -1
  804. package/dist/chunks/de-D8gRtvU4.mjs +0 -2
  805. package/dist/chunks/de-D8gRtvU4.mjs.map +0 -1
  806. package/dist/chunks/de-D_9IOrAk.mjs +0 -2
  807. package/dist/chunks/de-D_9IOrAk.mjs.map +0 -1
  808. package/dist/chunks/de-DcwZkO0v.mjs +0 -2
  809. package/dist/chunks/de-DcwZkO0v.mjs.map +0 -1
  810. package/dist/chunks/de-DeSVCxbd.mjs +0 -2
  811. package/dist/chunks/de-DeSVCxbd.mjs.map +0 -1
  812. package/dist/chunks/de-DqxnR2Y8.mjs +0 -2
  813. package/dist/chunks/de-DqxnR2Y8.mjs.map +0 -1
  814. package/dist/chunks/de-J82qPFkV.mjs +0 -2
  815. package/dist/chunks/de-J82qPFkV.mjs.map +0 -1
  816. package/dist/chunks/de-QDbUiCAO.mjs +0 -2
  817. package/dist/chunks/de-QDbUiCAO.mjs.map +0 -1
  818. package/dist/chunks/de-eAQXJdL9.mjs +0 -2
  819. package/dist/chunks/de-eAQXJdL9.mjs.map +0 -1
  820. package/dist/chunks/de-hneXQd4z.mjs +0 -2
  821. package/dist/chunks/de-hneXQd4z.mjs.map +0 -1
  822. package/dist/chunks/de-wXAi5Jyt.mjs +0 -2
  823. package/dist/chunks/de-wXAi5Jyt.mjs.map +0 -1
  824. package/dist/chunks/es-5c_5O95N.mjs +0 -2
  825. package/dist/chunks/es-5c_5O95N.mjs.map +0 -1
  826. package/dist/chunks/es-B2QB6DHA.mjs +0 -2
  827. package/dist/chunks/es-B2QB6DHA.mjs.map +0 -1
  828. package/dist/chunks/es-BEcu8DtV.mjs +0 -2
  829. package/dist/chunks/es-BEcu8DtV.mjs.map +0 -1
  830. package/dist/chunks/es-BXTkzYVW.mjs +0 -2
  831. package/dist/chunks/es-BXTkzYVW.mjs.map +0 -1
  832. package/dist/chunks/es-BemQV8dI.mjs +0 -2
  833. package/dist/chunks/es-BemQV8dI.mjs.map +0 -1
  834. package/dist/chunks/es-BfJM5zJ5.mjs +0 -2
  835. package/dist/chunks/es-BfJM5zJ5.mjs.map +0 -1
  836. package/dist/chunks/es-CnqxzYfU.mjs +0 -2
  837. package/dist/chunks/es-CnqxzYfU.mjs.map +0 -1
  838. package/dist/chunks/es-CrZtAd3-.mjs +0 -2
  839. package/dist/chunks/es-CrZtAd3-.mjs.map +0 -1
  840. package/dist/chunks/es-CsCCy0S5.mjs +0 -2
  841. package/dist/chunks/es-CsCCy0S5.mjs.map +0 -1
  842. package/dist/chunks/es-D62AfyHC.mjs +0 -2
  843. package/dist/chunks/es-D62AfyHC.mjs.map +0 -1
  844. package/dist/chunks/es-DA_zUbSs.mjs +0 -2
  845. package/dist/chunks/es-DA_zUbSs.mjs.map +0 -1
  846. package/dist/chunks/es-DFCDhXJb.mjs +0 -2
  847. package/dist/chunks/es-DFCDhXJb.mjs.map +0 -1
  848. package/dist/chunks/es-DHMIpSfB.mjs +0 -2
  849. package/dist/chunks/es-DHMIpSfB.mjs.map +0 -1
  850. package/dist/chunks/es-DIH9KVn1.mjs +0 -2
  851. package/dist/chunks/es-DIH9KVn1.mjs.map +0 -1
  852. package/dist/chunks/es-DOHIPZYT.mjs +0 -2
  853. package/dist/chunks/es-DOHIPZYT.mjs.map +0 -1
  854. package/dist/chunks/es-DPyejgTk.mjs +0 -2
  855. package/dist/chunks/es-DPyejgTk.mjs.map +0 -1
  856. package/dist/chunks/es-DUVk_Wkc.mjs +0 -2
  857. package/dist/chunks/es-DUVk_Wkc.mjs.map +0 -1
  858. package/dist/chunks/es-Di4t0cUf.mjs +0 -2
  859. package/dist/chunks/es-Di4t0cUf.mjs.map +0 -1
  860. package/dist/chunks/es-DjwvgN1j.mjs +0 -2
  861. package/dist/chunks/es-DjwvgN1j.mjs.map +0 -1
  862. package/dist/chunks/es-Nawgghri.mjs +0 -2
  863. package/dist/chunks/es-Nawgghri.mjs.map +0 -1
  864. package/dist/chunks/es-SuOzBFT7.mjs +0 -2
  865. package/dist/chunks/es-SuOzBFT7.mjs.map +0 -1
  866. package/dist/chunks/es-gB6GcNGB.mjs +0 -2
  867. package/dist/chunks/es-gB6GcNGB.mjs.map +0 -1
  868. package/dist/chunks/es-xSr9miNk.mjs +0 -2
  869. package/dist/chunks/es-xSr9miNk.mjs.map +0 -1
  870. package/dist/chunks/fonts-CG_dDwvT.mjs +0 -2
  871. package/dist/chunks/fonts-CG_dDwvT.mjs.map +0 -1
  872. package/dist/chunks/fr-B35gBW5Z.mjs +0 -2
  873. package/dist/chunks/fr-B35gBW5Z.mjs.map +0 -1
  874. package/dist/chunks/fr-BFngqWSa.mjs +0 -2
  875. package/dist/chunks/fr-BFngqWSa.mjs.map +0 -1
  876. package/dist/chunks/fr-BZRak2_s.mjs +0 -2
  877. package/dist/chunks/fr-BZRak2_s.mjs.map +0 -1
  878. package/dist/chunks/fr-Bj_GziCv.mjs +0 -2
  879. package/dist/chunks/fr-Bj_GziCv.mjs.map +0 -1
  880. package/dist/chunks/fr-BushvDBo.mjs +0 -2
  881. package/dist/chunks/fr-BushvDBo.mjs.map +0 -1
  882. package/dist/chunks/fr-Bz2JMdw5.mjs +0 -2
  883. package/dist/chunks/fr-Bz2JMdw5.mjs.map +0 -1
  884. package/dist/chunks/fr-C2y-quYa.mjs +0 -2
  885. package/dist/chunks/fr-C2y-quYa.mjs.map +0 -1
  886. package/dist/chunks/fr-C5g40qHr.mjs +0 -2
  887. package/dist/chunks/fr-C5g40qHr.mjs.map +0 -1
  888. package/dist/chunks/fr-CRPVlCtC.mjs +0 -2
  889. package/dist/chunks/fr-CRPVlCtC.mjs.map +0 -1
  890. package/dist/chunks/fr-Cf0xNw5j.mjs +0 -2
  891. package/dist/chunks/fr-Cf0xNw5j.mjs.map +0 -1
  892. package/dist/chunks/fr-Cr62KfH7.mjs +0 -2
  893. package/dist/chunks/fr-Cr62KfH7.mjs.map +0 -1
  894. package/dist/chunks/fr-D6XZTFJa.mjs +0 -2
  895. package/dist/chunks/fr-D6XZTFJa.mjs.map +0 -1
  896. package/dist/chunks/fr-D9u2mcht.mjs +0 -2
  897. package/dist/chunks/fr-D9u2mcht.mjs.map +0 -1
  898. package/dist/chunks/fr-DEWFKFrW.mjs +0 -2
  899. package/dist/chunks/fr-DEWFKFrW.mjs.map +0 -1
  900. package/dist/chunks/fr-DGBuhK3D.mjs +0 -2
  901. package/dist/chunks/fr-DGBuhK3D.mjs.map +0 -1
  902. package/dist/chunks/fr-DQBLPLlz.mjs +0 -2
  903. package/dist/chunks/fr-DQBLPLlz.mjs.map +0 -1
  904. package/dist/chunks/fr-DQM130Rf.mjs +0 -2
  905. package/dist/chunks/fr-DQM130Rf.mjs.map +0 -1
  906. package/dist/chunks/fr-Dg5SMkMo.mjs +0 -2
  907. package/dist/chunks/fr-Dg5SMkMo.mjs.map +0 -1
  908. package/dist/chunks/fr-Dv0GIx7Q.mjs +0 -2
  909. package/dist/chunks/fr-Dv0GIx7Q.mjs.map +0 -1
  910. package/dist/chunks/fr-DyGGhKFe.mjs +0 -2
  911. package/dist/chunks/fr-DyGGhKFe.mjs.map +0 -1
  912. package/dist/chunks/fr-DzQfRP8y.mjs +0 -2
  913. package/dist/chunks/fr-DzQfRP8y.mjs.map +0 -1
  914. package/dist/chunks/fr-SxdLDSEQ.mjs +0 -2
  915. package/dist/chunks/fr-SxdLDSEQ.mjs.map +0 -1
  916. package/dist/chunks/fr-VGC8qZxr.mjs +0 -2
  917. package/dist/chunks/fr-VGC8qZxr.mjs.map +0 -1
  918. package/dist/chunks/full-NtKyNKJ6.mjs +0 -2
  919. package/dist/chunks/full-NtKyNKJ6.mjs.map +0 -1
  920. package/dist/chunks/hi-8AQg9KKV.mjs +0 -2
  921. package/dist/chunks/hi-8AQg9KKV.mjs.map +0 -1
  922. package/dist/chunks/hi-B0EvMNl3.mjs +0 -2
  923. package/dist/chunks/hi-B0EvMNl3.mjs.map +0 -1
  924. package/dist/chunks/hi-B5sPMUNb.mjs +0 -2
  925. package/dist/chunks/hi-B5sPMUNb.mjs.map +0 -1
  926. package/dist/chunks/hi-BOfcnulc.mjs +0 -2
  927. package/dist/chunks/hi-BOfcnulc.mjs.map +0 -1
  928. package/dist/chunks/hi-BUveHWCk.mjs +0 -2
  929. package/dist/chunks/hi-BUveHWCk.mjs.map +0 -1
  930. package/dist/chunks/hi-BZ_n8-zx.mjs +0 -2
  931. package/dist/chunks/hi-BZ_n8-zx.mjs.map +0 -1
  932. package/dist/chunks/hi-BeLhPZ5d.mjs +0 -2
  933. package/dist/chunks/hi-BeLhPZ5d.mjs.map +0 -1
  934. package/dist/chunks/hi-Bg8jWcjX.mjs +0 -2
  935. package/dist/chunks/hi-Bg8jWcjX.mjs.map +0 -1
  936. package/dist/chunks/hi-BktVy4Yc.mjs +0 -2
  937. package/dist/chunks/hi-BktVy4Yc.mjs.map +0 -1
  938. package/dist/chunks/hi-Btg6DNgW.mjs +0 -2
  939. package/dist/chunks/hi-Btg6DNgW.mjs.map +0 -1
  940. package/dist/chunks/hi-C20PmckT.mjs +0 -2
  941. package/dist/chunks/hi-C20PmckT.mjs.map +0 -1
  942. package/dist/chunks/hi-C2DDsttW.mjs +0 -2
  943. package/dist/chunks/hi-C2DDsttW.mjs.map +0 -1
  944. package/dist/chunks/hi-CCDCfQV0.mjs +0 -2
  945. package/dist/chunks/hi-CCDCfQV0.mjs.map +0 -1
  946. package/dist/chunks/hi-CWX5sDy1.mjs +0 -2
  947. package/dist/chunks/hi-CWX5sDy1.mjs.map +0 -1
  948. package/dist/chunks/hi-ClSwgZfK.mjs +0 -2
  949. package/dist/chunks/hi-ClSwgZfK.mjs.map +0 -1
  950. package/dist/chunks/hi-D-apR3ri.mjs +0 -2
  951. package/dist/chunks/hi-D-apR3ri.mjs.map +0 -1
  952. package/dist/chunks/hi-D6ZQ_R6m.mjs +0 -2
  953. package/dist/chunks/hi-D6ZQ_R6m.mjs.map +0 -1
  954. package/dist/chunks/hi-D_rhcSL3.mjs +0 -2
  955. package/dist/chunks/hi-D_rhcSL3.mjs.map +0 -1
  956. package/dist/chunks/hi-DcA0CxZR.mjs +0 -2
  957. package/dist/chunks/hi-DcA0CxZR.mjs.map +0 -1
  958. package/dist/chunks/hi-Dd2GOD9r.mjs +0 -2
  959. package/dist/chunks/hi-Dd2GOD9r.mjs.map +0 -1
  960. package/dist/chunks/hi-DkEmvBok.mjs +0 -2
  961. package/dist/chunks/hi-DkEmvBok.mjs.map +0 -1
  962. package/dist/chunks/hi-nfmm9uwI.mjs +0 -2
  963. package/dist/chunks/hi-nfmm9uwI.mjs.map +0 -1
  964. package/dist/chunks/hi-wBX612X_.mjs +0 -2
  965. package/dist/chunks/hi-wBX612X_.mjs.map +0 -1
  966. package/dist/chunks/minimal-gSvMMQTU.mjs +0 -2
  967. package/dist/chunks/minimal-gSvMMQTU.mjs.map +0 -1
  968. package/dist/chunks/pt-BGQ7Sh6p.mjs +0 -2
  969. package/dist/chunks/pt-BGQ7Sh6p.mjs.map +0 -1
  970. package/dist/chunks/pt-BGQj9xok.mjs +0 -2
  971. package/dist/chunks/pt-BGQj9xok.mjs.map +0 -1
  972. package/dist/chunks/pt-BL5xNIhC.mjs +0 -2
  973. package/dist/chunks/pt-BL5xNIhC.mjs.map +0 -1
  974. package/dist/chunks/pt-BM8sUzpI.mjs +0 -2
  975. package/dist/chunks/pt-BM8sUzpI.mjs.map +0 -1
  976. package/dist/chunks/pt-BVLuZULN.mjs +0 -2
  977. package/dist/chunks/pt-BVLuZULN.mjs.map +0 -1
  978. package/dist/chunks/pt-BlGlrx3M.mjs +0 -2
  979. package/dist/chunks/pt-BlGlrx3M.mjs.map +0 -1
  980. package/dist/chunks/pt-CKaXK1FK.mjs +0 -2
  981. package/dist/chunks/pt-CKaXK1FK.mjs.map +0 -1
  982. package/dist/chunks/pt-CMpzmrVu.mjs +0 -2
  983. package/dist/chunks/pt-CMpzmrVu.mjs.map +0 -1
  984. package/dist/chunks/pt-Cw77qSTP.mjs +0 -2
  985. package/dist/chunks/pt-Cw77qSTP.mjs.map +0 -1
  986. package/dist/chunks/pt-DBNe2BiX.mjs +0 -2
  987. package/dist/chunks/pt-DBNe2BiX.mjs.map +0 -1
  988. package/dist/chunks/pt-DCfJFt-v.mjs +0 -2
  989. package/dist/chunks/pt-DCfJFt-v.mjs.map +0 -1
  990. package/dist/chunks/pt-DEs0I6eo.mjs +0 -2
  991. package/dist/chunks/pt-DEs0I6eo.mjs.map +0 -1
  992. package/dist/chunks/pt-DKONqS4g.mjs +0 -2
  993. package/dist/chunks/pt-DKONqS4g.mjs.map +0 -1
  994. package/dist/chunks/pt-DO4FbPvV.mjs +0 -2
  995. package/dist/chunks/pt-DO4FbPvV.mjs.map +0 -1
  996. package/dist/chunks/pt-DbDOQjV-.mjs +0 -2
  997. package/dist/chunks/pt-DbDOQjV-.mjs.map +0 -1
  998. package/dist/chunks/pt-DiYv0Ubf.mjs +0 -2
  999. package/dist/chunks/pt-DiYv0Ubf.mjs.map +0 -1
  1000. package/dist/chunks/pt-Dk4Mr4yC.mjs +0 -2
  1001. package/dist/chunks/pt-Dk4Mr4yC.mjs.map +0 -1
  1002. package/dist/chunks/pt-DpLB51hL.mjs +0 -2
  1003. package/dist/chunks/pt-DpLB51hL.mjs.map +0 -1
  1004. package/dist/chunks/pt-Q5jXPjWo.mjs +0 -2
  1005. package/dist/chunks/pt-Q5jXPjWo.mjs.map +0 -1
  1006. package/dist/chunks/pt-kFy3gqNp.mjs +0 -2
  1007. package/dist/chunks/pt-kFy3gqNp.mjs.map +0 -1
  1008. package/dist/chunks/pt-ncNSxrVp.mjs +0 -2
  1009. package/dist/chunks/pt-ncNSxrVp.mjs.map +0 -1
  1010. package/dist/chunks/pt-tUVNk-7W.mjs +0 -2
  1011. package/dist/chunks/pt-tUVNk-7W.mjs.map +0 -1
  1012. package/dist/chunks/pt-zzij5vS0.mjs +0 -2
  1013. package/dist/chunks/pt-zzij5vS0.mjs.map +0 -1
  1014. package/dist/chunks/rolldown-runtime-B8Ku5yk6.mjs +0 -1
  1015. package/dist/chunks/ru-B-XR4L6x.mjs +0 -2
  1016. package/dist/chunks/ru-B-XR4L6x.mjs.map +0 -1
  1017. package/dist/chunks/ru-B00ZXSqu.mjs +0 -2
  1018. package/dist/chunks/ru-B00ZXSqu.mjs.map +0 -1
  1019. package/dist/chunks/ru-B5wvkAtV.mjs +0 -2
  1020. package/dist/chunks/ru-B5wvkAtV.mjs.map +0 -1
  1021. package/dist/chunks/ru-BA5-gdMK.mjs +0 -2
  1022. package/dist/chunks/ru-BA5-gdMK.mjs.map +0 -1
  1023. package/dist/chunks/ru-BNTSKpWh.mjs +0 -2
  1024. package/dist/chunks/ru-BNTSKpWh.mjs.map +0 -1
  1025. package/dist/chunks/ru-BRy-L-TF.mjs +0 -2
  1026. package/dist/chunks/ru-BRy-L-TF.mjs.map +0 -1
  1027. package/dist/chunks/ru-BZrPeSDg.mjs +0 -2
  1028. package/dist/chunks/ru-BZrPeSDg.mjs.map +0 -1
  1029. package/dist/chunks/ru-B_8ujIHK.mjs +0 -2
  1030. package/dist/chunks/ru-B_8ujIHK.mjs.map +0 -1
  1031. package/dist/chunks/ru-BbgvH6r3.mjs +0 -2
  1032. package/dist/chunks/ru-BbgvH6r3.mjs.map +0 -1
  1033. package/dist/chunks/ru-CDm5R5CV.mjs +0 -2
  1034. package/dist/chunks/ru-CDm5R5CV.mjs.map +0 -1
  1035. package/dist/chunks/ru-CWLFWYwd.mjs +0 -2
  1036. package/dist/chunks/ru-CWLFWYwd.mjs.map +0 -1
  1037. package/dist/chunks/ru-CqsCwBQ_.mjs +0 -2
  1038. package/dist/chunks/ru-CqsCwBQ_.mjs.map +0 -1
  1039. package/dist/chunks/ru-CsFv_mi4.mjs +0 -2
  1040. package/dist/chunks/ru-CsFv_mi4.mjs.map +0 -1
  1041. package/dist/chunks/ru-Cv9Zbbn2.mjs +0 -2
  1042. package/dist/chunks/ru-Cv9Zbbn2.mjs.map +0 -1
  1043. package/dist/chunks/ru-CyTNK9dE.mjs +0 -2
  1044. package/dist/chunks/ru-CyTNK9dE.mjs.map +0 -1
  1045. package/dist/chunks/ru-DEkLlarB.mjs +0 -2
  1046. package/dist/chunks/ru-DEkLlarB.mjs.map +0 -1
  1047. package/dist/chunks/ru-DZge62_-.mjs +0 -2
  1048. package/dist/chunks/ru-DZge62_-.mjs.map +0 -1
  1049. package/dist/chunks/ru-DiVRD-Ds.mjs +0 -2
  1050. package/dist/chunks/ru-DiVRD-Ds.mjs.map +0 -1
  1051. package/dist/chunks/ru-DkP8YLYT.mjs +0 -2
  1052. package/dist/chunks/ru-DkP8YLYT.mjs.map +0 -1
  1053. package/dist/chunks/ru-OKZRZ5c-.mjs +0 -2
  1054. package/dist/chunks/ru-OKZRZ5c-.mjs.map +0 -1
  1055. package/dist/chunks/ru-aYY1QVJS.mjs +0 -2
  1056. package/dist/chunks/ru-aYY1QVJS.mjs.map +0 -1
  1057. package/dist/chunks/ru-ejPBB15H.mjs +0 -2
  1058. package/dist/chunks/ru-ejPBB15H.mjs.map +0 -1
  1059. package/dist/chunks/ru-tp62bXSj.mjs +0 -2
  1060. package/dist/chunks/ru-tp62bXSj.mjs.map +0 -1
  1061. package/dist/chunks/shared-DJ08jwra.mjs +0 -2
  1062. package/dist/chunks/shared-DJ08jwra.mjs.map +0 -1
  1063. package/dist/chunks/src-CHVVMZB_.mjs +0 -2
  1064. package/dist/chunks/src-CHVVMZB_.mjs.map +0 -1
  1065. package/dist/chunks/text-direction-advanced-B71gUwvk.mjs +0 -2
  1066. package/dist/chunks/text-direction-advanced-B71gUwvk.mjs.map +0 -1
  1067. package/dist/chunks/zh-2gEqF3OX.mjs +0 -2
  1068. package/dist/chunks/zh-2gEqF3OX.mjs.map +0 -1
  1069. package/dist/chunks/zh-B5J1sSsk.mjs +0 -2
  1070. package/dist/chunks/zh-B5J1sSsk.mjs.map +0 -1
  1071. package/dist/chunks/zh-B5LmYVQ2.mjs +0 -2
  1072. package/dist/chunks/zh-B5LmYVQ2.mjs.map +0 -1
  1073. package/dist/chunks/zh-BBOheLpv.mjs +0 -2
  1074. package/dist/chunks/zh-BBOheLpv.mjs.map +0 -1
  1075. package/dist/chunks/zh-BOy5F5Jq.mjs +0 -2
  1076. package/dist/chunks/zh-BOy5F5Jq.mjs.map +0 -1
  1077. package/dist/chunks/zh-BRlo0ayI.mjs +0 -2
  1078. package/dist/chunks/zh-BRlo0ayI.mjs.map +0 -1
  1079. package/dist/chunks/zh-BgTAzt6l.mjs +0 -2
  1080. package/dist/chunks/zh-BgTAzt6l.mjs.map +0 -1
  1081. package/dist/chunks/zh-BjY4TNQf.mjs +0 -2
  1082. package/dist/chunks/zh-BjY4TNQf.mjs.map +0 -1
  1083. package/dist/chunks/zh-BtD9NFJS.mjs +0 -2
  1084. package/dist/chunks/zh-BtD9NFJS.mjs.map +0 -1
  1085. package/dist/chunks/zh-BvSLqJFE.mjs +0 -2
  1086. package/dist/chunks/zh-BvSLqJFE.mjs.map +0 -1
  1087. package/dist/chunks/zh-C4rxe0Zk.mjs +0 -2
  1088. package/dist/chunks/zh-C4rxe0Zk.mjs.map +0 -1
  1089. package/dist/chunks/zh-CyX2tIRP.mjs +0 -2
  1090. package/dist/chunks/zh-CyX2tIRP.mjs.map +0 -1
  1091. package/dist/chunks/zh-D9QN2C7q.mjs +0 -2
  1092. package/dist/chunks/zh-D9QN2C7q.mjs.map +0 -1
  1093. package/dist/chunks/zh-DTnSCP1F.mjs +0 -2
  1094. package/dist/chunks/zh-DTnSCP1F.mjs.map +0 -1
  1095. package/dist/chunks/zh-DWlBkrGZ.mjs +0 -2
  1096. package/dist/chunks/zh-DWlBkrGZ.mjs.map +0 -1
  1097. package/dist/chunks/zh-DcY4Ouin.mjs +0 -2
  1098. package/dist/chunks/zh-DcY4Ouin.mjs.map +0 -1
  1099. package/dist/chunks/zh-DovMZIDF.mjs +0 -2
  1100. package/dist/chunks/zh-DovMZIDF.mjs.map +0 -1
  1101. package/dist/chunks/zh-DtzwqBHS.mjs +0 -2
  1102. package/dist/chunks/zh-DtzwqBHS.mjs.map +0 -1
  1103. package/dist/chunks/zh-DunJzfVR.mjs +0 -2
  1104. package/dist/chunks/zh-DunJzfVR.mjs.map +0 -1
  1105. package/dist/chunks/zh-Pd1HqYSs.mjs +0 -2
  1106. package/dist/chunks/zh-Pd1HqYSs.mjs.map +0 -1
  1107. package/dist/chunks/zh-Yvqfkdln.mjs +0 -2
  1108. package/dist/chunks/zh-Yvqfkdln.mjs.map +0 -1
  1109. package/dist/chunks/zh-Z9seusJc.mjs +0 -2
  1110. package/dist/chunks/zh-Z9seusJc.mjs.map +0 -1
  1111. package/dist/chunks/zh-fAa_AbWI.mjs +0 -2
  1112. package/dist/chunks/zh-fAa_AbWI.mjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"PopupPositioning-BdSCai19.mjs","names":[],"sources":["../../src/plugins/shared/PopupPositioning.ts"],"sourcesContent":["/**\n * Shared popup positioning logic. Positions a popup element relative to an\n * anchor rectangle, clamping to the viewport. Also provides a shadow DOM-aware\n * append helper.\n */\n\nimport { setStyleProperties } from '../../style/StyleRuntime.js';\n\n// --- Types ---\n\nexport type PopupPosition = 'below-start' | 'below-end' | 'right';\n\nexport interface PositionOptions {\n\treadonly position: PopupPosition;\n\treadonly offset?: number;\n\treadonly isRtl?: boolean;\n}\n\nexport interface ContainingBlockOffset {\n\treadonly x: number;\n\treadonly y: number;\n\treadonly rightX: number;\n}\n\n// --- Constants ---\n\nconst DEFAULT_OFFSET = 2;\nconst Z_INDEX = '10000';\nconst POPUP_MIN_MARGIN = 4;\n\n// --- Containing Block Offset ---\n\n/**\n * Measures the offset between the popup's CSS containing block and the\n * viewport. When an ancestor has `transform`, `will-change: transform`,\n * `filter`, or `perspective`, `position: fixed` resolves relative to that\n * ancestor — not the viewport. This probe detects the shift so callers\n * can compensate.\n *\n * Technique: temporarily set `top: 0; left: 0` on the fixed-position\n * element and read `getBoundingClientRect()`. If no containing-block\n * ancestor exists the rect origin is `(0, 0)`; otherwise it equals the\n * ancestor's offset.\n */\nexport function measureContainingBlockOffset(popup: HTMLElement): ContainingBlockOffset {\n\tconst prevTop: string = popup.style.top;\n\tconst prevLeft: string = popup.style.left;\n\tconst prevRight: string = popup.style.right;\n\n\t// Probe 1: left-edge offset\n\tpopup.style.top = '0px';\n\tpopup.style.left = '0px';\n\tpopup.style.right = 'auto';\n\n\tconst leftRect: DOMRect = popup.getBoundingClientRect();\n\tconst x: number = leftRect.left;\n\tconst y: number = leftRect.top;\n\n\t// Probe 2: right-edge offset\n\tpopup.style.left = 'auto';\n\tpopup.style.right = '0px';\n\n\tconst rightRect: DOMRect = popup.getBoundingClientRect();\n\tconst rightX: number = window.innerWidth - rightRect.right;\n\n\tpopup.style.top = prevTop;\n\tpopup.style.left = prevLeft;\n\tpopup.style.right = prevRight;\n\n\treturn { x, y, rightX };\n}\n\n// --- Positioning ---\n\n/**\n * Positions a popup element relative to the given anchor rectangle.\n * Uses fixed positioning and clamps to the viewport edges.\n * Automatically compensates for ancestors that create a new containing\n * block (e.g. `transform`, `will-change: transform`).\n */\nexport function positionPopup(popup: HTMLElement, anchor: DOMRect, options: PositionOptions): void {\n\tconst offset: number = options.offset ?? DEFAULT_OFFSET;\n\tconst vpWidth: number = window.innerWidth;\n\tconst vpHeight: number = window.innerHeight;\n\n\t// Apply fixed positioning first so offsetWidth/offsetHeight reflect\n\t// shrink-to-fit sizing rather than normal-flow block width.\n\tsetStyleProperties(popup, { position: 'fixed', zIndex: Z_INDEX });\n\n\t// Detect containing-block offset caused by ancestor transforms etc.\n\tconst cbOffset: ContainingBlockOffset = measureContainingBlockOffset(popup);\n\n\tconst popupWidth: number = popup.offsetWidth;\n\tconst popupHeight: number = popup.offsetHeight;\n\n\tconst styles: Record<string, string> = {};\n\n\tswitch (options.position) {\n\t\tcase 'below-start': {\n\t\t\tlet top: number = anchor.bottom + offset;\n\n\t\t\tif (options.isRtl) {\n\t\t\t\t// RTL: anchor to physical right edge (visual start)\n\t\t\t\tlet right: number = vpWidth - anchor.right;\n\t\t\t\tif (right + popupWidth > vpWidth - POPUP_MIN_MARGIN) {\n\t\t\t\t\tright = vpWidth - popupWidth - POPUP_MIN_MARGIN;\n\t\t\t\t}\n\t\t\t\tif (top + popupHeight > vpHeight - POPUP_MIN_MARGIN) {\n\t\t\t\t\ttop = anchor.top - popupHeight - offset;\n\t\t\t\t}\n\t\t\t\tif (right < POPUP_MIN_MARGIN) right = POPUP_MIN_MARGIN;\n\t\t\t\tif (top < POPUP_MIN_MARGIN) top = POPUP_MIN_MARGIN;\n\t\t\t\tstyles.top = `${top - cbOffset.y}px`;\n\t\t\t\tstyles.right = `${right - cbOffset.rightX}px`;\n\t\t\t\tstyles.left = 'auto';\n\t\t\t} else {\n\t\t\t\tlet left: number = anchor.left;\n\t\t\t\tif (left + popupWidth > vpWidth - POPUP_MIN_MARGIN) {\n\t\t\t\t\tleft = vpWidth - popupWidth - POPUP_MIN_MARGIN;\n\t\t\t\t}\n\t\t\t\tif (top + popupHeight > vpHeight - POPUP_MIN_MARGIN) {\n\t\t\t\t\ttop = anchor.top - popupHeight - offset;\n\t\t\t\t}\n\t\t\t\tif (left < POPUP_MIN_MARGIN) left = POPUP_MIN_MARGIN;\n\t\t\t\tif (top < POPUP_MIN_MARGIN) top = POPUP_MIN_MARGIN;\n\t\t\t\tstyles.top = `${top - cbOffset.y}px`;\n\t\t\t\tstyles.left = `${left - cbOffset.x}px`;\n\t\t\t\tstyles.right = 'auto';\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase 'below-end': {\n\t\t\tlet top: number = anchor.bottom + offset;\n\n\t\t\tif (options.isRtl) {\n\t\t\t\t// RTL: \"end\" = physical left edge\n\t\t\t\tlet left: number = anchor.left;\n\t\t\t\tif (left + popupWidth > vpWidth - POPUP_MIN_MARGIN) {\n\t\t\t\t\tleft = vpWidth - popupWidth - POPUP_MIN_MARGIN;\n\t\t\t\t}\n\t\t\t\tif (top + popupHeight > vpHeight - POPUP_MIN_MARGIN) {\n\t\t\t\t\ttop = anchor.top - popupHeight - offset;\n\t\t\t\t}\n\t\t\t\tif (left < POPUP_MIN_MARGIN) left = POPUP_MIN_MARGIN;\n\t\t\t\tif (top < POPUP_MIN_MARGIN) top = POPUP_MIN_MARGIN;\n\t\t\t\tstyles.top = `${top - cbOffset.y}px`;\n\t\t\t\tstyles.left = `${left - cbOffset.x}px`;\n\t\t\t\tstyles.right = 'auto';\n\t\t\t} else {\n\t\t\t\t// LTR: \"end\" = physical right edge\n\t\t\t\tlet right: number = vpWidth - anchor.right;\n\t\t\t\tif (right + popupWidth > vpWidth - POPUP_MIN_MARGIN) {\n\t\t\t\t\tright = vpWidth - popupWidth - POPUP_MIN_MARGIN;\n\t\t\t\t}\n\t\t\t\tif (top + popupHeight > vpHeight - POPUP_MIN_MARGIN) {\n\t\t\t\t\ttop = anchor.top - popupHeight - offset;\n\t\t\t\t}\n\t\t\t\tif (right < POPUP_MIN_MARGIN) right = POPUP_MIN_MARGIN;\n\t\t\t\tif (top < POPUP_MIN_MARGIN) top = POPUP_MIN_MARGIN;\n\t\t\t\tstyles.top = `${top - cbOffset.y}px`;\n\t\t\t\tstyles.right = `${right - cbOffset.rightX}px`;\n\t\t\t\tstyles.left = 'auto';\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase 'right': {\n\t\t\tlet top: number = anchor.top;\n\n\t\t\tif (options.isRtl) {\n\t\t\t\t// RTL: open submenu to the physical left\n\t\t\t\tlet left: number = anchor.left - popupWidth - offset;\n\t\t\t\tif (left < POPUP_MIN_MARGIN) {\n\t\t\t\t\tleft = anchor.right + offset;\n\t\t\t\t}\n\t\t\t\tif (top + popupHeight > vpHeight - POPUP_MIN_MARGIN) {\n\t\t\t\t\ttop = vpHeight - popupHeight - POPUP_MIN_MARGIN;\n\t\t\t\t}\n\t\t\t\tif (left < POPUP_MIN_MARGIN) left = POPUP_MIN_MARGIN;\n\t\t\t\tif (top < POPUP_MIN_MARGIN) top = POPUP_MIN_MARGIN;\n\t\t\t\tstyles.top = `${top - cbOffset.y}px`;\n\t\t\t\tstyles.left = `${left - cbOffset.x}px`;\n\t\t\t\tstyles.right = 'auto';\n\t\t\t} else {\n\t\t\t\tlet left: number = anchor.right + offset;\n\t\t\t\tif (left + popupWidth > vpWidth - POPUP_MIN_MARGIN) {\n\t\t\t\t\tleft = anchor.left - popupWidth - offset;\n\t\t\t\t}\n\t\t\t\tif (top + popupHeight > vpHeight - POPUP_MIN_MARGIN) {\n\t\t\t\t\ttop = vpHeight - popupHeight - POPUP_MIN_MARGIN;\n\t\t\t\t}\n\t\t\t\tif (left < POPUP_MIN_MARGIN) left = POPUP_MIN_MARGIN;\n\t\t\t\tif (top < POPUP_MIN_MARGIN) top = POPUP_MIN_MARGIN;\n\t\t\t\tstyles.top = `${top - cbOffset.y}px`;\n\t\t\t\tstyles.left = `${left - cbOffset.x}px`;\n\t\t\t\tstyles.right = 'auto';\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tsetStyleProperties(popup, styles);\n}\n\n/**\n * Appends an element to the appropriate root: the shadow root if the\n * reference node lives inside one, otherwise `document.body`.\n */\nexport function appendToRoot(element: HTMLElement, referenceNode: Node): void {\n\tconst root: Node = referenceNode.getRootNode();\n\tif (root instanceof ShadowRoot) {\n\t\troot.appendChild(element);\n\t} else {\n\t\tdocument.body.appendChild(element);\n\t}\n}\n"],"mappings":"gDA4CA,SAAgB,EAA6B,GAC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Aa,EA5JH,IA6JpB,EAAO,EAAO,KAAO,EAAa,GAE/B,EAAM,EAAc,EA/JH,IAgKpB,EAAM,EAAW,EAhKG,GAkKjB,EAlKiB,IAkKQ,EAlKR,GAmKjB,EAnKiB,IAmKO,EAnKP,GAoKrB,EAAO,IAAS,EAAM,EAAS,EAAlB,KACb,EAAO,KAAU,EAAO,EAAS,EAAnB,KACd,EAAO,MAAQ,OAEhB,OAIF,EAAmB,EAAO,GAO3B,SAAgB,EAAa,EAAsB,GAClD,MAAM,EAAa,EAAc,cAC7B,aAAgB,WACnB,EAAK,YAAY,GAEjB,SAAS,KAAK,YAAY"}
@@ -1,2 +0,0 @@
1
- import{c as t,o as e}from"./StyleRuntime-Bwde5icB.mjs";import{a as n,c as o,i as r,n as i,r as s,t as c}from"./PrintTypes-CWIAfEaX.mjs";import{i as a}from"./PluginHelpers-BZU5rE44.mjs";import{t as l}from"./ShortcutFormatting-c0IajwWG.mjs";import p from"dompurify";var u={label:"Print",tooltip:t=>`Print (${t})`,printingAnnouncement:"Printing"},m=/* @__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-D1DiKwV_.mjs"),"./locales/de.ts":()=>import("./de-CAmM7IT5.mjs"),"./locales/es.ts":()=>import("./es-Nawgghri.mjs"),"./locales/fr.ts":()=>import("./fr-C5g40qHr.mjs"),"./locales/hi.ts":()=>import("./hi-BOfcnulc.mjs"),"./locales/pt.ts":()=>import("./pt-BL5xNIhC.mjs"),"./locales/ru.ts":()=>import("./ru-BbgvH6r3.mjs"),"./locales/zh.ts":()=>import("./zh-Yvqfkdln.mjs")});async function h(t){if("en"===t)return u;const e=m[`./locales/${t}.ts`];if(!e)return u;try{return(await e()).default}catch{return u}}var d=["h1","h2","h3","h4","h5","h6","p","div","span","br","hr","strong","b","em","i","u","s","sub","sup","small","ul","ol","li","table","thead","tbody","tr","th","td","img"],f=["style","class","src","alt","width","height","colspan","rowspan"];function g(t){const e="function"==typeof t?t():t;return p.sanitize(e,{ALLOWED_TAGS:[...d],ALLOWED_ATTR:[...f]})}var v={print(){},toHTML:()=>""},y=class{id="print";name="Print";config;service=null;locale;constructor(t){this.config=t??{}}async init(n){this.locale=await a(n,this.config.locale,u,h);const r=n.getContainer(),p=r.getRootNode();if(p instanceof ShadowRoot){const s=p.host;this.service=function(n,r,s,a){function l(t){return t??{}}function p(t){const l={options:t,cancelled:!1};if(a.emit(i,l),l.cancelled)return null;const p=l.options,u=function(t,e,n,o="en"){return["<!DOCTYPE html>",`<html lang="${o}">`,"<head>",'<meta charset="utf-8">',`<title>${n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}</title>`,`<style>${t}</style>`,"</head>",`<body>${e}</body>`,"</html>"].join("\n")}(function(t,e,n){const r=[],i=function(t){const e=[];for(const n of t.adoptedStyleSheets)for(const t of n.cssRules)e.push(t.cssText);return e.join("\n")}(t);i&&r.push(i);const s=function(t){const e=getComputedStyle(t),n=[];for(let o=0;o<e.length;o++){const t=e[o]??"";if(t.startsWith("--notectl-")){const o=e.getPropertyValue(t).trim();o&&n.push(` ${t}: ${o};`)}}return 0===n.length?"":`:root {\n${n.join("\n")}\n}`}(e);s&&r.push(s),r.push(function(t){const e=getComputedStyle(t),n=["font-family","font-size","font-weight","line-height","letter-spacing","word-spacing","color"],o=[" margin: 0;"];for(const r of n){const t=e.getPropertyValue(r).trim();t&&o.push(` ${r}: ${t};`)}return`body {\n${o.join("\n")}\n}`}(e));const c=function(t){const e=[],n=[];if(t.margin?n.push(` margin: ${t.margin};`):t.paperSize&&n.push(" margin: 0;"),t.paperSize||t.orientation){const e=[t.paperSize?o(t.paperSize):"A4"];t.orientation&&e.push(t.orientation),n.push(` size: ${e.join(" ")};`)}n.length>0&&e.push(`@page {\n${n.join("\n")}\n}`),t.paperSize&&e.push(".notectl-content { padding: 48px 56px !important; }");const r=[];return r.push("[data-notectl-no-print] { display: none !important; }"),r.push(".notectl-code-block { white-space: pre-wrap !important; word-break: break-all !important; page-break-inside: avoid; }"),r.push("img { page-break-inside: avoid; }"),r.push(".notectl-table { break-inside: avoid; }"),!1!==t.printBackground&&r.push("* { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }"),e.push(`@media print {\n ${r.join("\n ")}\n}`),e.join("\n\n")}(n);return c&&r.push(c),n.customCSS&&r.push(n.customCSS),r.join("\n\n")}(n,r,p),function(t,n){const o=function(t){return(t.querySelector(".notectl-content")??t).cloneNode(!0)}(t);return function(t){t.removeAttribute("contenteditable");for(const e of["notectl-node-selected","notectl-content--empty"]){t.classList.remove(e);for(const n of t.querySelectorAll(`.${e}`))n.classList.remove(e)}t.removeAttribute("data-placeholder")}(o),function(t,n){if(n.excludeBlockTypes)for(const e of n.excludeBlockTypes){const n=t.querySelectorAll(`[data-block-type="${e}"]`);for(const t of n)t.remove()}if(n.pageBreakBefore)for(const o of n.pageBreakBefore){const n=t.querySelectorAll(`[data-block-type="${o}"]`);for(const t of n)e(t,{breakBefore:"page",pageBreakBefore:"always"})}}(o,n),function(t,e){if(e.header){const n=document.createElement("div");n.className="notectl-print-header",n.innerHTML=g(e.header),t.insertBefore(n,t.firstChild)}if(e.footer){const n=document.createElement("div");n.className="notectl-print-footer",n.innerHTML=g(e.footer),t.appendChild(n)}}(o,n),o}(s,p).outerHTML,p.title??"",r.closest("[lang]")?.getAttribute("lang")??(document.documentElement.lang||"en")),m={html:u};return a.emit(c,m),u}return{print(e){const n=p(l(e));if(!n)return;const o=document.createElement("iframe");t(o,"position:fixed;left:-9999px;width:0;height:0;border:none"),document.body.appendChild(o);const r=o.contentDocument;if(!r)return void document.body.removeChild(o);r.open(),r.write(n),r.close();const i=()=>{o.remove()};o.contentWindow?(o.contentWindow.addEventListener("afterprint",i,{once:!0}),o.contentWindow.print()):i()},toHTML:t=>p(l(t))??""}}(p,s,r,n.getEventBus())}else this.service=v;n.registerService(s,this.service);const m=this.config.defaults??{},d=this.service,f=this.locale;n.registerCommand("print",()=>(n.announce(f.printingAnnouncement),d.print(m),!0));const y=this.config.keyBinding??"Mod-P";if(n.registerKeymap({[y]:()=>(n.executeCommand("print"),!0)}),!1!==this.config.showToolbarItem){const t=l(y);n.registerToolbarItem({id:"print",group:"actions",label:this.locale.label,tooltip:this.locale.tooltip(t),icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-1-9H6v4h12V3z"/></svg>',command:"print"})}}destroy(){this.service=null}};export{u as n,h as r,y as t};
2
- //# sourceMappingURL=PrintPlugin-80SINLGF.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PrintPlugin-80SINLGF.mjs","names":[],"sources":["../../src/plugins/print/PrintLocale.ts","../../src/plugins/print/PrintContentPreparer.ts","../../src/plugins/print/PrintStyleCollector.ts","../../src/plugins/print/PrintServiceImpl.ts","../../src/plugins/print/PrintPlugin.ts"],"sourcesContent":["/** Locale interface and default English locale for the PrintPlugin. */\n\n// --- Locale Interface ---\n\nexport interface PrintLocale {\n\treadonly label: string;\n\treadonly tooltip: (shortcut: string) => string;\n\treadonly printingAnnouncement: string;\n}\n\n// --- Default English Locale ---\n\nexport const PRINT_LOCALE_EN: PrintLocale = {\n\tlabel: 'Print',\n\ttooltip: (shortcut: string) => `Print (${shortcut})`,\n\tprintingAnnouncement: 'Printing',\n};\n\n// --- Lazy Locale Loader ---\n\nconst localeModules: Record<string, () => Promise<{ default: PrintLocale }>> = import.meta.glob<{\n\tdefault: PrintLocale;\n}>('./locales/*.ts', { eager: false });\n\nexport async function loadPrintLocale(lang: string): Promise<PrintLocale> {\n\tif (lang === 'en') return PRINT_LOCALE_EN;\n\tconst loader = localeModules[`./locales/${lang}.ts`];\n\tif (!loader) return PRINT_LOCALE_EN;\n\ttry {\n\t\tconst mod = await loader();\n\t\treturn mod.default;\n\t} catch {\n\t\treturn PRINT_LOCALE_EN;\n\t}\n}\n","/**\n * Prepares editor content for print output.\n * Clones the DOM, sanitizes interactive attributes, applies block filters,\n * and inserts header/footer elements.\n */\n\nimport DOMPurify from 'dompurify';\nimport { setStyleProperties } from '../../style/StyleRuntime.js';\nimport type { PrintOptions } from './PrintTypes.js';\n\n/** Deep-clones the .notectl-content element from the editor container. */\nexport function cloneContent(container: HTMLElement): HTMLElement {\n\tconst content: HTMLElement | null = container.querySelector('.notectl-content');\n\tconst source: HTMLElement = content ?? container;\n\treturn source.cloneNode(true) as HTMLElement;\n}\n\n/** Sanitizes the cloned content for print: removes interactive attributes and selection styling. */\nexport function sanitize(clone: HTMLElement): void {\n\t// Remove contenteditable from the root\n\tclone.removeAttribute('contenteditable');\n\n\t// Remove selection-related CSS classes\n\tconst selectionClasses: readonly string[] = ['notectl-node-selected', 'notectl-content--empty'];\n\tfor (const cls of selectionClasses) {\n\t\tclone.classList.remove(cls);\n\t\tfor (const el of clone.querySelectorAll(`.${cls}`)) {\n\t\t\tel.classList.remove(cls);\n\t\t}\n\t}\n\n\t// Remove data-placeholder to avoid showing placeholder in print\n\tclone.removeAttribute('data-placeholder');\n}\n\n/** Removes excluded block types and applies page-break-before to configured block types. */\nexport function applyBlockFilters(clone: HTMLElement, options: PrintOptions): void {\n\tif (options.excludeBlockTypes) {\n\t\tfor (const type of options.excludeBlockTypes) {\n\t\t\tconst elements: NodeListOf<Element> = clone.querySelectorAll(`[data-block-type=\"${type}\"]`);\n\t\t\tfor (const el of elements) {\n\t\t\t\tel.remove();\n\t\t\t}\n\t\t}\n\t}\n\n\tif (options.pageBreakBefore) {\n\t\tfor (const type of options.pageBreakBefore) {\n\t\t\tconst elements: NodeListOf<Element> = clone.querySelectorAll(`[data-block-type=\"${type}\"]`);\n\t\t\tfor (const el of elements) {\n\t\t\t\tsetStyleProperties(el as HTMLElement, {\n\t\t\t\t\tbreakBefore: 'page',\n\t\t\t\t\tpageBreakBefore: 'always',\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n}\n\n/** Tags allowed in print header/footer content. */\nconst HEADER_FOOTER_ALLOWED_TAGS: readonly string[] = [\n\t'h1',\n\t'h2',\n\t'h3',\n\t'h4',\n\t'h5',\n\t'h6',\n\t'p',\n\t'div',\n\t'span',\n\t'br',\n\t'hr',\n\t'strong',\n\t'b',\n\t'em',\n\t'i',\n\t'u',\n\t's',\n\t'sub',\n\t'sup',\n\t'small',\n\t'ul',\n\t'ol',\n\t'li',\n\t'table',\n\t'thead',\n\t'tbody',\n\t'tr',\n\t'th',\n\t'td',\n\t'img',\n];\n\n/** Attributes allowed in print header/footer content. */\nconst HEADER_FOOTER_ALLOWED_ATTRS: readonly string[] = [\n\t'style',\n\t'class',\n\t'src',\n\t'alt',\n\t'width',\n\t'height',\n\t'colspan',\n\t'rowspan',\n];\n\n/** Resolves a header/footer value to a sanitized HTML string. */\nfunction resolveContent(value: string | (() => string)): string {\n\tconst raw: string = typeof value === 'function' ? value() : value;\n\treturn DOMPurify.sanitize(raw, {\n\t\tALLOWED_TAGS: [...HEADER_FOOTER_ALLOWED_TAGS],\n\t\tALLOWED_ATTR: [...HEADER_FOOTER_ALLOWED_ATTRS],\n\t});\n}\n\n/** Inserts header and footer elements into the cloned content. */\nexport function insertHeaderFooter(clone: HTMLElement, options: PrintOptions): void {\n\tif (options.header) {\n\t\tconst headerEl: HTMLDivElement = document.createElement('div');\n\t\theaderEl.className = 'notectl-print-header';\n\t\theaderEl.innerHTML = resolveContent(options.header);\n\t\tclone.insertBefore(headerEl, clone.firstChild);\n\t}\n\n\tif (options.footer) {\n\t\tconst footerEl: HTMLDivElement = document.createElement('div');\n\t\tfooterEl.className = 'notectl-print-footer';\n\t\tfooterEl.innerHTML = resolveContent(options.footer);\n\t\tclone.appendChild(footerEl);\n\t}\n}\n\n/** Orchestrates all content preparation steps. Returns a ready-to-print DOM element. */\nexport function prepare(container: HTMLElement, options: PrintOptions): HTMLElement {\n\tconst clone: HTMLElement = cloneContent(container);\n\tsanitize(clone);\n\tapplyBlockFilters(clone, options);\n\tinsertHeaderFooter(clone, options);\n\treturn clone;\n}\n","/**\n * Collects and aggregates CSS for print output.\n * Extracts adopted stylesheets, snapshots theme tokens, and generates print-specific CSS.\n */\n\nimport {\n\tPAPER_MARGIN_HORIZONTAL_PX,\n\tPAPER_MARGIN_TOP_PX,\n\tgetPaperCSSSize,\n} from '../../model/PaperSize.js';\nimport type { PrintOptions } from './PrintTypes.js';\n\n/** Extracts CSS text from all adopted stylesheets on a ShadowRoot. */\nexport function extractAdoptedStyles(shadowRoot: ShadowRoot): string {\n\tconst parts: string[] = [];\n\tfor (const sheet of shadowRoot.adoptedStyleSheets) {\n\t\tfor (const rule of sheet.cssRules) {\n\t\t\tparts.push(rule.cssText);\n\t\t}\n\t}\n\treturn parts.join('\\n');\n}\n\n/** Snapshots --notectl-* CSS custom properties from the host element into a :root block. */\nexport function snapshotThemeTokens(host: HTMLElement): string {\n\tconst computed: CSSStyleDeclaration = getComputedStyle(host);\n\tconst tokens: string[] = [];\n\n\tfor (let i = 0; i < computed.length; i++) {\n\t\tconst prop: string = computed[i] ?? '';\n\t\tif (prop.startsWith('--notectl-')) {\n\t\t\tconst value: string = computed.getPropertyValue(prop).trim();\n\t\t\tif (value) {\n\t\t\t\ttokens.push(` ${prop}: ${value};`);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (tokens.length === 0) return '';\n\treturn `:root {\\n${tokens.join('\\n')}\\n}`;\n}\n\n/**\n * Snapshots computed typography from the host element into a `body` rule.\n * In the editor, typography is inherited from `:host` (shadow DOM).\n * The print iframe is a regular document where `:host` doesn't match,\n * so we must apply the same font/line-height explicitly.\n */\nexport function snapshotTypography(host: HTMLElement): string {\n\tconst computed: CSSStyleDeclaration = getComputedStyle(host);\n\tconst props: string[] = [\n\t\t'font-family',\n\t\t'font-size',\n\t\t'font-weight',\n\t\t'line-height',\n\t\t'letter-spacing',\n\t\t'word-spacing',\n\t\t'color',\n\t];\n\tconst rules: string[] = [' margin: 0;'];\n\tfor (const prop of props) {\n\t\tconst value: string = computed.getPropertyValue(prop).trim();\n\t\tif (value) {\n\t\t\trules.push(` ${prop}: ${value};`);\n\t\t}\n\t}\n\treturn `body {\\n${rules.join('\\n')}\\n}`;\n}\n\n/** Generates print-specific CSS rules based on PrintOptions. */\nexport function generatePrintCSS(options: PrintOptions): string {\n\tconst parts: string[] = [];\n\n\t// @page rule\n\tconst pageProps: string[] = [];\n\tif (options.margin) {\n\t\tpageProps.push(` margin: ${options.margin};`);\n\t} else if (options.paperSize) {\n\t\t// WYSIWYG: zero @page margin so body = full paper width;\n\t\t// document margins are applied as content padding below.\n\t\tpageProps.push(' margin: 0;');\n\t}\n\tif (options.paperSize || options.orientation) {\n\t\tconst sizeKeyword: string = options.paperSize ? getPaperCSSSize(options.paperSize) : 'A4';\n\t\tconst sizeParts: string[] = [sizeKeyword];\n\t\tif (options.orientation) {\n\t\t\tsizeParts.push(options.orientation);\n\t\t}\n\t\tpageProps.push(` size: ${sizeParts.join(' ')};`);\n\t}\n\tif (pageProps.length > 0) {\n\t\tparts.push(`@page {\\n${pageProps.join('\\n')}\\n}`);\n\t}\n\n\t// WYSIWYG: apply paper-mode document margins to print content\n\tif (options.paperSize) {\n\t\tparts.push(\n\t\t\t`.notectl-content { padding: ${PAPER_MARGIN_TOP_PX}px ${PAPER_MARGIN_HORIZONTAL_PX}px !important; }`,\n\t\t);\n\t}\n\n\t// Print media rules\n\tconst printRules: string[] = [];\n\n\t// Hide non-printable elements\n\tprintRules.push('[data-notectl-no-print] { display: none !important; }');\n\n\t// Code blocks: preserve background, force wrapping\n\tprintRules.push(\n\t\t'.notectl-code-block { white-space: pre-wrap !important; ' +\n\t\t\t'word-break: break-all !important; page-break-inside: avoid; }',\n\t);\n\n\t// Images: avoid page breaks\n\tprintRules.push('img { page-break-inside: avoid; }');\n\n\t// Tables: avoid page breaks\n\tprintRules.push('.notectl-table { break-inside: avoid; }');\n\n\t// Preserve background colors and images in print output (WYSIWYG default).\n\t// Only omitted when the consumer explicitly opts out via printBackground: false.\n\tif (options.printBackground !== false) {\n\t\tprintRules.push(\n\t\t\t'* { -webkit-print-color-adjust: exact !important; ' +\n\t\t\t\t'print-color-adjust: exact !important; }',\n\t\t);\n\t}\n\n\tparts.push(`@media print {\\n ${printRules.join('\\n ')}\\n}`);\n\n\treturn parts.join('\\n\\n');\n}\n\n/** Collects all CSS needed for print: adopted styles, theme tokens, print CSS, and custom CSS. */\nexport function collectAll(\n\tshadowRoot: ShadowRoot,\n\thost: HTMLElement,\n\toptions: PrintOptions,\n): string {\n\tconst parts: string[] = [];\n\n\tconst adopted: string = extractAdoptedStyles(shadowRoot);\n\tif (adopted) parts.push(adopted);\n\n\tconst theme: string = snapshotThemeTokens(host);\n\tif (theme) parts.push(theme);\n\n\t// WYSIWYG: snapshot host typography so the print iframe matches the editor.\n\t// In the editor, .notectl-content inherits font from :host (shadow DOM).\n\t// The print iframe is a regular document where :host doesn't apply.\n\tparts.push(snapshotTypography(host));\n\n\tconst printCSS: string = generatePrintCSS(options);\n\tif (printCSS) parts.push(printCSS);\n\n\tif (options.customCSS) {\n\t\tparts.push(options.customCSS);\n\t}\n\n\treturn parts.join('\\n\\n');\n}\n","/**\n * PrintService implementation.\n * Handles the synchronous print flow: event emission, style collection,\n * content preparation, iframe creation, and cleanup.\n */\n\nimport { setStyleText } from '../../style/StyleRuntime.js';\nimport type { PluginEventBus } from '../Plugin.js';\nimport { prepare } from './PrintContentPreparer.js';\nimport { collectAll } from './PrintStyleCollector.js';\nimport {\n\tAFTER_PRINT,\n\ttype AfterPrintEvent,\n\tBEFORE_PRINT,\n\ttype BeforePrintEvent,\n\ttype PrintOptions,\n\ttype PrintService,\n} from './PrintTypes.js';\n\n/** Escapes HTML special characters in a plain-text string. */\nfunction escapeHTML(text: string): string {\n\treturn text.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\n}\n\n/** Builds a complete HTML document string from CSS, body content, and title. */\nexport function buildHTMLDocument(\n\tcss: string,\n\tcontent: string,\n\ttitle: string,\n\tlang = 'en',\n): string {\n\tconst safeTitle: string = escapeHTML(title);\n\treturn [\n\t\t'<!DOCTYPE html>',\n\t\t`<html lang=\"${lang}\">`,\n\t\t'<head>',\n\t\t`<meta charset=\"utf-8\">`,\n\t\t`<title>${safeTitle}</title>`,\n\t\t`<style>${css}</style>`,\n\t\t'</head>',\n\t\t`<body>${content}</body>`,\n\t\t'</html>',\n\t].join('\\n');\n}\n\n/** Creates and returns the PrintService implementation. */\nexport function createPrintService(\n\tshadowRoot: ShadowRoot,\n\thost: HTMLElement,\n\tcontainer: HTMLElement,\n\teventBus: PluginEventBus,\n): PrintService {\n\tfunction mergeOptions(options?: PrintOptions): PrintOptions {\n\t\treturn options ?? {};\n\t}\n\n\tfunction executePrint(options: PrintOptions): string | null {\n\t\t// 1. Emit BEFORE_PRINT — listeners can mutate options or cancel\n\t\tconst beforeEvent: BeforePrintEvent = {\n\t\t\toptions,\n\t\t\tcancelled: false,\n\t\t};\n\t\teventBus.emit(BEFORE_PRINT, beforeEvent);\n\n\t\tif (beforeEvent.cancelled) return null;\n\n\t\tconst finalOptions: PrintOptions = beforeEvent.options;\n\n\t\t// 2. Collect styles\n\t\tconst css: string = collectAll(shadowRoot, host, finalOptions);\n\n\t\t// 3. Prepare content\n\t\tconst clone: HTMLElement = prepare(container, finalOptions);\n\t\tconst contentHTML: string = clone.outerHTML;\n\n\t\t// 4. Build HTML document\n\t\tconst title: string = finalOptions.title ?? '';\n\t\tconst lang: string =\n\t\t\thost.closest('[lang]')?.getAttribute('lang') ?? (document.documentElement.lang || 'en');\n\t\tconst html: string = buildHTMLDocument(css, contentHTML, title, lang);\n\n\t\t// 5. Emit AFTER_PRINT\n\t\tconst afterEvent: AfterPrintEvent = { html };\n\t\teventBus.emit(AFTER_PRINT, afterEvent);\n\n\t\treturn html;\n\t}\n\n\treturn {\n\t\tprint(options?: PrintOptions): void {\n\t\t\tconst resolved: PrintOptions = mergeOptions(options);\n\t\t\tconst html: string | null = executePrint(resolved);\n\t\t\tif (!html) return;\n\n\t\t\t// Create hidden iframe\n\t\t\tconst iframe: HTMLIFrameElement = document.createElement('iframe');\n\t\t\tsetStyleText(iframe, 'position:fixed;left:-9999px;width:0;height:0;border:none');\n\t\t\tdocument.body.appendChild(iframe);\n\n\t\t\tconst iframeDoc: Document | null = iframe.contentDocument;\n\t\t\tif (!iframeDoc) {\n\t\t\t\tdocument.body.removeChild(iframe);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tiframeDoc.open();\n\t\t\tiframeDoc.write(html);\n\t\t\tiframeDoc.close();\n\n\t\t\tconst cleanup = (): void => {\n\t\t\t\tiframe.remove();\n\t\t\t};\n\n\t\t\t// Defer cleanup until print dialog closes\n\t\t\tif (iframe.contentWindow) {\n\t\t\t\tiframe.contentWindow.addEventListener('afterprint', cleanup, { once: true });\n\t\t\t\tiframe.contentWindow.print();\n\t\t\t} else {\n\t\t\t\tcleanup();\n\t\t\t}\n\t\t},\n\n\t\ttoHTML(options?: PrintOptions): string {\n\t\t\tconst resolved: PrintOptions = mergeOptions(options);\n\t\t\treturn executePrint(resolved) ?? '';\n\t\t},\n\t};\n}\n","/**\n * PrintPlugin: provides print functionality for the notectl editor.\n * Registers a command, keymap, toolbar item, and exposes a PrintService.\n * Orchestrator only — delegates all logic to PrintServiceImpl, PrintStyleCollector,\n * and PrintContentPreparer.\n */\n\nimport type { Plugin, PluginContext } from '../Plugin.js';\nimport { resolveLocale } from '../shared/PluginHelpers.js';\nimport { formatShortcut } from '../shared/ShortcutFormatting.js';\nimport { PRINT_LOCALE_EN, type PrintLocale, loadPrintLocale } from './PrintLocale.js';\nimport { createPrintService } from './PrintServiceImpl.js';\nimport type { PrintOptions, PrintPluginConfig, PrintService } from './PrintTypes.js';\nimport { PRINT_SERVICE_KEY } from './PrintTypes.js';\n\nconst PRINT_ICON: string =\n\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">' +\n\t'<path d=\"M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3' +\n\t' 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-1-9H6v4h12V3z\"/>' +\n\t'</svg>';\n\n/** No-op fallback service for environments without ShadowRoot. */\nconst NOOP_SERVICE: PrintService = {\n\tprint(): void {},\n\ttoHTML(): string {\n\t\treturn '';\n\t},\n};\n\nexport class PrintPlugin implements Plugin {\n\treadonly id = 'print';\n\treadonly name = 'Print';\n\n\tprivate readonly config: PrintPluginConfig;\n\tprivate service: PrintService | null = null;\n\tprivate locale!: PrintLocale;\n\n\tconstructor(config?: PrintPluginConfig) {\n\t\tthis.config = config ?? {};\n\t}\n\n\tasync init(context: PluginContext): Promise<void> {\n\t\tthis.locale = await resolveLocale(\n\t\t\tcontext,\n\t\t\tthis.config.locale,\n\t\t\tPRINT_LOCALE_EN,\n\t\t\tloadPrintLocale,\n\t\t);\n\t\tconst container: HTMLElement = context.getContainer();\n\t\tconst rootNode: Node = container.getRootNode();\n\n\t\tif (rootNode instanceof ShadowRoot) {\n\t\t\tconst host: HTMLElement = rootNode.host as HTMLElement;\n\t\t\tconst eventBus = context.getEventBus();\n\t\t\tthis.service = createPrintService(rootNode, host, container, eventBus);\n\t\t} else {\n\t\t\tthis.service = NOOP_SERVICE;\n\t\t}\n\n\t\tcontext.registerService(PRINT_SERVICE_KEY, this.service);\n\n\t\tconst defaults: PrintOptions = this.config.defaults ?? {};\n\t\tconst service: PrintService = this.service;\n\n\t\tconst printLocale = this.locale;\n\t\tcontext.registerCommand('print', () => {\n\t\t\tcontext.announce(printLocale.printingAnnouncement);\n\t\t\tservice.print(defaults);\n\t\t\treturn true;\n\t\t});\n\n\t\tconst keyBinding: string = this.config.keyBinding ?? 'Mod-P';\n\t\tcontext.registerKeymap({\n\t\t\t[keyBinding]: () => {\n\t\t\t\tcontext.executeCommand('print');\n\t\t\t\treturn true;\n\t\t\t},\n\t\t});\n\n\t\tif (this.config.showToolbarItem !== false) {\n\t\t\tconst shortcut: string = formatShortcut(keyBinding);\n\t\t\tcontext.registerToolbarItem({\n\t\t\t\tid: 'print',\n\t\t\t\tgroup: 'actions',\n\t\t\t\tlabel: this.locale.label,\n\t\t\t\ttooltip: this.locale.tooltip(shortcut),\n\t\t\t\ticon: PRINT_ICON,\n\t\t\t\tcommand: 'print',\n\t\t\t});\n\t\t}\n\t}\n\n\tdestroy(): void {\n\t\tthis.service = null;\n\t}\n}\n"],"mappings":"wQAYA,IAAa,EAA+B,CAC3C,MAAO,QACP,QAAU,GAAqB,UAAU,KACzC,qBAAsB,YAKjB,iBAAyE,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,uBAI/E,eAAsB,EAAgB,GACrC,GAAa,OAAT,EAAe,OAAO,EAC1B,MAAM,EAAS,EAAc,aAAa,QAC1C,IAAK,EAAQ,OAAO,EACpB,IAEC,aADkB,KACP,cAEX,OAAO,GC4BT,IAAM,EAAgD,CACrD,KACA,KACA,KACA,KACA,KACA,KACA,IACA,MACA,OACA,KACA,KACA,SACA,IACA,KACA,IACA,IACA,IACA,MACA,MACA,QACA,KACA,KACA,KACA,QACA,QACA,QACA,KACA,KACA,KACA,OAIK,EAAiD,CACtD,QACA,QACA,MACA,MACA,QACA,SACA,UACA,WAID,SAAS,EAAe,GACvB,MAAM,EAA+B,mBAAV,EAAuB,IAAU,EAC5D,OAAO,EAAU,SAAS,EAAK,CAC9B,aAAc,IAAI,GAClB,aAAc,IAAI,KG/FpB,IAOM,EAA6B,CAClC,KAAA,G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,YAAY,GAI3B,EAAU,OACV,EAAU,MAAM,GAChB,EAAU,QAEV,MAAM,EAAA,KACL,EAAO,UAIJ,EAAO,eACV,EAAO,cAAc,iBAAiB,aAAc,EAAS,CAAE,MAAM,IACrE,EAAO,cAAc,SAErB,KAIF,OAAO,GAEC,EADwB,EAAa,KACX,ICtElB,CAAmB,EAAU,EAAM,EADjC,EAAQ,oBAGzB,KAAK,QAAU,EAGhB,EAAQ,gBAAgB,EAAmB,KAAK,SAEhD,MAAM,EAAyB,KAAK,OAAO,UAAY,CAAA,EACjD,EAAwB,KAAK,QAE7B,EAAc,KAAK,OACzB,EAAQ,gBAAgB,QAAA,KACvB,EAAQ,SAAS,EAAY,sBAC7B,EAAQ,MAAM,IACP,IAGR,MAAM,EAAqB,KAAK,OAAO,YAAc,QAQrD,GAPA,EAAQ,eAAe,CAAA,CACrB,GAAA,KACA,EAAQ,eAAe,UAChB,MAI2B,IAAhC,KAAK,OAAO,gBAA2B,CAC1C,MAAM,EAAmB,EAAe,GACxC,EAAQ,oBAAoB,CAC3B,GAAI,QACJ,MAAO,UACP,MAAO,KAAK,OAAO,MACnB,QAAS,KAAK,OAAO,QAAQ,GAC7B,KAtEH,sPAuEG,QAAS,WAKZ,OAAA,GACC,KAAK,QAAU"}
@@ -1,2 +0,0 @@
1
- import{n as t,t as e}from"./Plugin-C4cBw3bs.mjs";var n=96/25.4,r={DINA4:"din-a4",DINA5:"din-a5",USLetter:"us-letter",USLegal:"us-legal"};function i(t){return Math.round(t*n)}var a=new Map([[r.DINA4,{widthMm:210,heightMm:297,widthPx:i(210),heightPx:i(297)}],[r.DINA5,{widthMm:148,heightMm:210,widthPx:i(148),heightPx:i(210)}],[r.USLetter,{widthMm:215.9,heightMm:279.4,widthPx:i(215.9),heightPx:i(279.4)}],[r.USLegal,{widthMm:215.9,heightMm:355.6,widthPx:i(215.9),heightPx:i(355.6)}]]),h=new Map([[r.DINA4,"A4"],[r.DINA5,"A5"],[r.USLetter,"letter"],[r.USLegal,"legal"]]);function s(t){const e=a.get(t);if(!e)throw new Error(`Unknown paper size: ${t}`);return e}var w=48,o=56,g=24;function u(t){return Object.values(r).includes(t)}function l(t){const e=h.get(t);if(!e)throw new Error(`Unknown paper size: ${t}`);return e}var d=new t("print"),m=new e("print:before"),p=new e("print:after");export{w as a,l as c,o as i,s as l,m as n,g as o,d as r,r as s,p as t,u};
2
- //# sourceMappingURL=PrintTypes-CWIAfEaX.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PrintTypes-CWIAfEaX.mjs","names":[],"sources":["../../src/model/PaperSize.ts","../../src/plugins/print/PrintTypes.ts"],"sourcesContent":["/**\n * Paper size definitions and dimension helpers.\n * Used by PaperLayoutController for WYSIWYG page layout\n * and by PrintStyleCollector for @page CSS rules.\n */\n\n/** Conversion factor: 1mm = 96/25.4 px at CSS reference pixel (96 DPI). */\nconst MM_TO_PX: number = 96 / 25.4;\n\n/** Physical dimensions of a paper size. */\nexport interface PaperDimensions {\n\treadonly widthMm: number;\n\treadonly heightMm: number;\n\treadonly widthPx: number;\n\treadonly heightPx: number;\n}\n\n/** Available paper size presets. */\nexport const PaperSize = {\n\tDINA4: 'din-a4',\n\tDINA5: 'din-a5',\n\tUSLetter: 'us-letter',\n\tUSLegal: 'us-legal',\n} as const;\nexport type PaperSize = (typeof PaperSize)[keyof typeof PaperSize];\n\n/** Rounds to nearest integer for pixel dimensions. */\nfunction mmToPx(mm: number): number {\n\treturn Math.round(mm * MM_TO_PX);\n}\n\n/** Lookup table for paper dimensions. */\nconst PAPER_DIMENSIONS: ReadonlyMap<PaperSize, PaperDimensions> = new Map<\n\tPaperSize,\n\tPaperDimensions\n>([\n\t[PaperSize.DINA4, { widthMm: 210, heightMm: 297, widthPx: mmToPx(210), heightPx: mmToPx(297) }],\n\t[PaperSize.DINA5, { widthMm: 148, heightMm: 210, widthPx: mmToPx(148), heightPx: mmToPx(210) }],\n\t[\n\t\tPaperSize.USLetter,\n\t\t{ widthMm: 215.9, heightMm: 279.4, widthPx: mmToPx(215.9), heightPx: mmToPx(279.4) },\n\t],\n\t[\n\t\tPaperSize.USLegal,\n\t\t{ widthMm: 215.9, heightMm: 355.6, widthPx: mmToPx(215.9), heightPx: mmToPx(355.6) },\n\t],\n]);\n\n/** CSS @page size keywords for each paper size. */\nconst CSS_SIZE_KEYWORDS: ReadonlyMap<PaperSize, string> = new Map<PaperSize, string>([\n\t[PaperSize.DINA4, 'A4'],\n\t[PaperSize.DINA5, 'A5'],\n\t[PaperSize.USLetter, 'letter'],\n\t[PaperSize.USLegal, 'legal'],\n]);\n\n/** Returns the physical and pixel dimensions for a paper size. */\nexport function getPaperDimensions(size: PaperSize): PaperDimensions {\n\tconst dims: PaperDimensions | undefined = PAPER_DIMENSIONS.get(size);\n\tif (!dims) {\n\t\tthrow new Error(`Unknown paper size: ${size}`);\n\t}\n\treturn dims;\n}\n\n/**\n * Document margin constants for paper mode (in px).\n * These define the content padding inside the paper surface in the editor,\n * and become @page margins in print output to ensure WYSIWYG fidelity.\n */\nexport const PAPER_MARGIN_TOP_PX: number = 48;\nexport const PAPER_MARGIN_HORIZONTAL_PX: number = 56;\nexport const PAPER_VIEWPORT_PADDING_PX: number = 24;\n\n/** Type guard: returns true if the value is a valid PaperSize string. */\nexport function isValidPaperSize(value: string): value is PaperSize {\n\treturn (Object.values(PaperSize) as string[]).includes(value);\n}\n\n/** Returns the CSS @page size keyword (e.g. 'A4', 'letter') for a paper size. */\nexport function getPaperCSSSize(size: PaperSize): string {\n\tconst keyword: string | undefined = CSS_SIZE_KEYWORDS.get(size);\n\tif (!keyword) {\n\t\tthrow new Error(`Unknown paper size: ${size}`);\n\t}\n\treturn keyword;\n}\n","/**\n * Type definitions, service keys, and event keys for the PrintPlugin.\n */\n\nimport type { PaperSize } from '../../model/PaperSize.js';\nimport type { NodeTypeName } from '../../model/TypeBrands.js';\nimport { EventKey, ServiceKey } from '../Plugin.js';\n\n// --- Print Options ---\n\nexport interface PrintOptions {\n\t/** Page title shown in the browser print header. */\n\treadonly title?: string;\n\n\t/** Additional CSS appended to the print stylesheet. */\n\treadonly customCSS?: string;\n\n\t/**\n\t * Header HTML inserted once at the top of the print document.\n\t * For repeating per-page headers, use toHTML() with server-side PDF generation.\n\t */\n\treadonly header?: string | (() => string);\n\n\t/**\n\t * Footer HTML inserted once at the bottom of the print document.\n\t * For repeating per-page footers, use toHTML() with server-side PDF generation.\n\t */\n\treadonly footer?: string | (() => string);\n\n\t/** Page margins as CSS value (e.g. '2cm'). */\n\treadonly margin?: string;\n\n\t/** Force page break before these block types. */\n\treadonly pageBreakBefore?: readonly NodeTypeName[];\n\n\t/** Exclude these block types from print output. */\n\treadonly excludeBlockTypes?: readonly NodeTypeName[];\n\n\t/**\n\t * Whether to preserve background colors and images in print output.\n\t * Defaults to `true` (WYSIWYG). Set to `false` to let the browser strip\n\t * backgrounds (e.g. to save ink).\n\t */\n\treadonly printBackground?: boolean;\n\n\t/** Page orientation. */\n\treadonly orientation?: 'portrait' | 'landscape';\n\n\t/** Paper size for @page CSS rule. When set, overrides the default A4 page size. */\n\treadonly paperSize?: PaperSize;\n}\n\n// --- Plugin Configuration ---\n\nexport interface PrintPluginConfig {\n\t/** Default options applied to every print() call. */\n\treadonly defaults?: PrintOptions;\n\n\t/** Keyboard shortcut (default: 'Mod-P'). */\n\treadonly keyBinding?: string;\n\n\t/** Show toolbar button (default: true). */\n\treadonly showToolbarItem?: boolean;\n\n\t/** Locale override for user-facing strings. */\n\treadonly locale?: import('./PrintLocale.js').PrintLocale;\n}\n\n// --- Service Interface ---\n\nexport interface PrintService {\n\t/** Prints the editor content with optional configuration. */\n\tprint(options?: PrintOptions): void;\n\n\t/** Generates print-ready HTML as a complete document string. */\n\ttoHTML(options?: PrintOptions): string;\n}\n\n// --- Service & Event Keys ---\n\nexport const PRINT_SERVICE_KEY: ServiceKey<PrintService> = new ServiceKey<PrintService>('print');\n\nexport const BEFORE_PRINT: EventKey<BeforePrintEvent> = new EventKey<BeforePrintEvent>(\n\t'print:before',\n);\n\nexport const AFTER_PRINT: EventKey<AfterPrintEvent> = new EventKey<AfterPrintEvent>('print:after');\n\n// --- Event Payloads ---\n\nexport interface BeforePrintEvent {\n\t/** Options can be mutated — EventBus passes by reference. */\n\toptions: PrintOptions;\n\t/** Set to true to cancel the print. */\n\tcancelled: boolean;\n}\n\nexport interface AfterPrintEvent {\n\t/** The generated HTML (read-only). */\n\treadonly html: string;\n}\n"],"mappings":"iDAOA,IAAM,EAAmB,GAAK,KAWjB,EAAY,CACxB,MAAO,SACP,MAAO,SACP,SAAU,YACV,QAAS,YAKV,SAAS,EAAO,GACf,OAAO,KAAK,MAAM,EAAK,GAIxB,IAAM,EAA4D,IAAI,IAGpE,CACD,CAAC,EAAU,MAAO,CAAE,QAAS,IAAK,SAAU,IAAK,QAAS,EAAO,KAAM,SAAU,EAAO,OACxF,CAAC,EAAU,MAAO,CAAE,QAAS,IAAK,SAAU,IAAK,QAAS,EAAO,KAAM,SAAU,EAAO,OACxF,CACC,EAAU,SACV,CAAE,QAAS,MAAO,SAAU,MAAO,QAAS,EAAO,OAAQ,SAAU,EAAO,SAE7E,CACC,EAAU,QACV,CAAE,QAAS,MAAO,SAAU,MAAO,QAAS,EAAO,OAAQ,SAAU,EAAO,WAKxE,EAAoD,IAAI,IAAuB,CACpF,CAAC,EAAU,MAAO,MAClB,CAAC,EAAU,MAAO,MAClB,CAAC,EAAU,SAAU,UACrB,CAAC,EAAU,QAAS,WAIrB,SAAgB,EAAmB,GAClC,MAAM,EAAoC,EAAiB,IAAI,GAC/D,IAAK,EACJ,MAAM,IAAI,MAAM,uBAAuB,KAExC,OAAO,EAQR,IAAa,EAA8B,GAC9B,EAAqC,GACrC,EAAoC,GAGjD,SAAgB,EAAiB,GAChC,OAAQ,OAAO,OAAO,GAAwB,SAAS,GAIxD,SAAgB,EAAgB,GAC/B,MAAM,EAA8B,EAAkB,IAAI,GAC1D,IAAK,EACJ,MAAM,IAAI,MAAM,uBAAuB,KAExC,OAAO,ECLR,IAAa,EAA8C,IAAI,EAAyB,SAE3E,EAA2C,IAAI,EAC3D,gBAGY,EAAyC,IAAI,EAA0B"}
@@ -1,2 +0,0 @@
1
- import{d as o}from"./Document-DnPKbcPE.mjs";function t(o,t,n){const c=o.getBlockOrder(),f=c.indexOf(t.from.blockId),e=c.indexOf(t.to.blockId);for(let r=f;r<=e;r++){const o=c[r];o&&n(o)}}function n(t,n,c){const f=t.getBlockOrder(),e=f.indexOf(n.from.blockId),r=f.indexOf(n.to.blockId);for(let s=e;s<=r;s++){const d=f[s];if(!d)continue;const i=t.getBlock(d);if(!i)continue;const l=s===e?n.from.offset:0,k=s===r?n.to.offset:o(i);l!==k&&c(d,l,k)}}export{n,t};
2
- //# sourceMappingURL=RangeIterator-DEuX1xKV.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RangeIterator-DEuX1xKV.mjs","names":[],"sources":["../../src/commands/RangeIterator.ts"],"sourcesContent":["/**\n * Utility for iterating over blocks within a selection range.\n *\n * Extracted from Commands.ts to break circular dependencies:\n * Commands.ts re-exports from MarkCommands.ts / AttributedMarkCommands.ts,\n * which in turn import forEachBlockInRange from Commands.ts.\n */\n\nimport { getBlockLength } from '../model/Document.js';\nimport type { SelectionRange } from '../model/Selection.js';\nimport type { BlockId } from '../model/TypeBrands.js';\nimport type { EditorState } from '../state/EditorState.js';\n\n/**\n * Iterates over every block ID in the given selection range, including\n * empty blocks and boundary blocks regardless of offset span.\n * Designed for block-level operations (e.g. setBlockType) where offsets are irrelevant.\n */\nexport function forEachBlockIdInRange(\n\tstate: EditorState,\n\trange: SelectionRange,\n\tcallback: (blockId: BlockId) => void,\n): void {\n\tconst blockOrder: readonly BlockId[] = state.getBlockOrder();\n\tconst fromIdx: number = blockOrder.indexOf(range.from.blockId);\n\tconst toIdx: number = blockOrder.indexOf(range.to.blockId);\n\n\tfor (let i: number = fromIdx; i <= toIdx; i++) {\n\t\tconst blockId: BlockId | undefined = blockOrder[i];\n\t\tif (!blockId) continue;\n\t\tcallback(blockId);\n\t}\n}\n\n/**\n * Iterates over each block in the given selection range, invoking the callback\n * with the block ID, per-block start offset, and per-block end offset.\n * Blocks where `from === to` are skipped automatically.\n */\nexport function forEachBlockInRange(\n\tstate: EditorState,\n\trange: SelectionRange,\n\tcallback: (blockId: BlockId, from: number, to: number) => void,\n): void {\n\tconst blockOrder: readonly BlockId[] = state.getBlockOrder();\n\tconst fromIdx: number = blockOrder.indexOf(range.from.blockId);\n\tconst toIdx: number = blockOrder.indexOf(range.to.blockId);\n\n\tfor (let i: number = fromIdx; i <= toIdx; i++) {\n\t\tconst blockId: BlockId | undefined = blockOrder[i];\n\t\tif (!blockId) continue;\n\t\tconst block = state.getBlock(blockId);\n\t\tif (!block) continue;\n\n\t\tconst from: number = i === fromIdx ? range.from.offset : 0;\n\t\tconst to: number = i === toIdx ? range.to.offset : getBlockLength(block);\n\n\t\tif (from === to) continue;\n\t\tcallback(blockId, from, to);\n\t}\n}\n"],"mappings":"4CAkBA,SAAgB,EACf,EACA,EACA,GAEA,MAAM,EAAiC,EAAM,gBACvC,EAAkB,EAAW,QAAQ,EAAM,KAAK,SAChD,EAAgB,EAAW,QAAQ,EAAM,GAAG,SAElD,IAAK,IAAI,EAAY,EAAS,GAAK,EAAO,IAAK,CAC9C,MAAM,EAA+B,EAAW,GAC3C,GACL,EAAS,IASX,SAAgB,EACf,EACA,EACA,GAEA,MAAM,EAAiC,EAAM,gBACvC,EAAkB,EAAW,QAAQ,EAAM,KAAK,SAChD,EAAgB,EAAW,QAAQ,EAAM,GAAG,SAElD,IAAK,IAAI,EAAY,EAAS,GAAK,EAAO,IAAK,CAC9C,MAAM,EAA+B,EAAW,GAChD,IAAK,EAAS,SACd,MAAM,EAAQ,EAAM,SAAS,GAC7B,IAAK,EAAO,SAEZ,MAAM,EAAe,IAAM,EAAU,EAAM,KAAK,OAAS,EACnD,EAAa,IAAM,EAAQ,EAAM,GAAG,OAAS,EAAe,GAE9D,IAAS,GACb,EAAS,EAAS,EAAM"}
@@ -1,2 +0,0 @@
1
- function o(o,n){return{type:"node",nodeId:o,path:n}}function n(o,n,e){return{type:"gap",side:n,blockId:o,path:e}}function e(o){return"type"in o&&"node"===o.type}function t(o){return"type"in o&&"gap"===o.type}function a(o){return!("type"in o)}function c(o,n){return e(o)&&e(n)?o.nodeId===n.nodeId:t(o)&&t(n)?o.blockId===n.blockId&&o.side===n.side:!(!a(o)||!a(n))&&o.anchor.blockId===n.anchor.blockId&&o.anchor.offset===n.anchor.offset&&o.head.blockId===n.head.blockId&&o.head.offset===n.head.offset}function d(o,n,e){return e?{blockId:o,offset:n,path:e}:{blockId:o,offset:n}}function r(o,n){return{anchor:o,head:n}}function f(o,n){const e={blockId:o,offset:n};return{anchor:e,head:e}}function h(o){return!!a(o)&&o.anchor.blockId===o.head.blockId&&o.anchor.offset===o.head.offset}function s(o,n){return!a(o)||(o.anchor.blockId===o.head.blockId?o.anchor.offset<=o.head.offset:!n||n.indexOf(o.anchor.blockId)<=n.indexOf(o.head.blockId))}function u(o,n){return s(o,n)?{from:o.anchor,to:o.head}:{from:o.head,to:o.anchor}}export{r as a,t as c,u as d,c as f,d as i,e as l,n,h as o,o as r,s,f as t,a as u};
2
- //# sourceMappingURL=Selection-B14e7gd0.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Selection-B14e7gd0.mjs","names":[],"sources":["../../src/model/Selection.ts"],"sourcesContent":["/**\n * Selection model for the Notectl editor.\n * A selection is defined by an anchor and head position within the document.\n */\n\nimport type { BlockId } from './TypeBrands.js';\n\nexport interface Position {\n\treadonly blockId: BlockId;\n\treadonly offset: number;\n\t/** Path from root block to leaf block (optional, for nested structures). */\n\treadonly path?: readonly BlockId[];\n}\n\nexport interface Selection {\n\treadonly anchor: Position;\n\treadonly head: Position;\n}\n\nexport interface SelectionRange {\n\treadonly from: Position;\n\treadonly to: Position;\n}\n\n/** A selection that selects an entire node (e.g. void blocks, table selection). */\nexport interface NodeSelection {\n\treadonly type: 'node';\n\treadonly nodeId: BlockId;\n\treadonly path: readonly BlockId[];\n}\n\n/** A virtual cursor at the boundary of a void block where no native caret can exist. */\nexport interface GapCursorSelection {\n\treadonly type: 'gap';\n\treadonly side: 'before' | 'after';\n\treadonly blockId: BlockId;\n\treadonly path: readonly BlockId[];\n}\n\n/** Union type representing a text selection, node selection, or gap cursor. */\nexport type EditorSelection = Selection | NodeSelection | GapCursorSelection;\n\n/** Creates a NodeSelection for the given block. */\nexport function createNodeSelection(nodeId: BlockId, path: readonly BlockId[]): NodeSelection {\n\treturn { type: 'node', nodeId, path };\n}\n\n/** Creates a GapCursorSelection at the boundary of a void block. */\nexport function createGapCursor(\n\tblockId: BlockId,\n\tside: 'before' | 'after',\n\tpath: readonly BlockId[],\n): GapCursorSelection {\n\treturn { type: 'gap', side, blockId, path };\n}\n\n/** Type guard: returns true if the selection is a NodeSelection. */\nexport function isNodeSelection(sel: EditorSelection): sel is NodeSelection {\n\treturn 'type' in sel && sel.type === 'node';\n}\n\n/** Type guard: returns true if the selection is a GapCursorSelection. */\nexport function isGapCursor(sel: EditorSelection): sel is GapCursorSelection {\n\treturn 'type' in sel && sel.type === 'gap';\n}\n\n/** Type guard: returns true if the selection is a text Selection. */\nexport function isTextSelection(sel: EditorSelection): sel is Selection {\n\treturn !('type' in sel);\n}\n\n/** Compares two EditorSelections for equality. */\nexport function selectionsEqual(a: EditorSelection, b: EditorSelection): boolean {\n\tif (isNodeSelection(a) && isNodeSelection(b)) {\n\t\treturn a.nodeId === b.nodeId;\n\t}\n\tif (isGapCursor(a) && isGapCursor(b)) {\n\t\treturn a.blockId === b.blockId && a.side === b.side;\n\t}\n\tif (isTextSelection(a) && isTextSelection(b)) {\n\t\treturn (\n\t\t\ta.anchor.blockId === b.anchor.blockId &&\n\t\t\ta.anchor.offset === b.anchor.offset &&\n\t\t\ta.head.blockId === b.head.blockId &&\n\t\t\ta.head.offset === b.head.offset\n\t\t);\n\t}\n\treturn false;\n}\n\n/** Creates a Position, optionally with a path. */\nexport function createPosition(\n\tblockId: BlockId,\n\toffset: number,\n\tpath?: readonly BlockId[],\n): Position {\n\treturn path ? { blockId, offset, path } : { blockId, offset };\n}\n\n/** Creates a selection with distinct anchor and head. */\nexport function createSelection(anchor: Position, head: Position): Selection {\n\treturn { anchor, head };\n}\n\n/** Creates a collapsed selection (cursor) at the given position. */\nexport function createCollapsedSelection(blockId: BlockId, offset: number): Selection {\n\tconst pos: Position = { blockId, offset };\n\treturn { anchor: pos, head: pos };\n}\n\n/** Returns true if the selection is collapsed (cursor with no range). NodeSelection and GapCursor are never collapsed. */\nexport function isCollapsed(sel: EditorSelection): boolean {\n\tif (!isTextSelection(sel)) return false;\n\treturn sel.anchor.blockId === sel.head.blockId && sel.anchor.offset === sel.head.offset;\n}\n\n/**\n * Returns true if the selection direction is forward (anchor before head).\n * When anchor and head are in the same block, compares offsets.\n * Cross-block ordering uses document order (not determinable here — caller provides block order).\n * For NodeSelection, always returns true.\n */\nexport function isForward(sel: EditorSelection, blockOrder?: readonly BlockId[]): boolean {\n\tif (!isTextSelection(sel)) return true;\n\tif (sel.anchor.blockId === sel.head.blockId) {\n\t\treturn sel.anchor.offset <= sel.head.offset;\n\t}\n\tif (blockOrder) {\n\t\tconst anchorIdx = blockOrder.indexOf(sel.anchor.blockId);\n\t\tconst headIdx = blockOrder.indexOf(sel.head.blockId);\n\t\treturn anchorIdx <= headIdx;\n\t}\n\treturn true;\n}\n\n/**\n * Returns a normalized range where `from` is always before `to`.\n * Throws for NodeSelection — use isNodeSelection() guard first.\n */\nexport function selectionRange(sel: Selection, blockOrder?: readonly BlockId[]): SelectionRange {\n\tif (isForward(sel, blockOrder)) {\n\t\treturn { from: sel.anchor, to: sel.head };\n\t}\n\treturn { from: sel.head, to: sel.anchor };\n}\n"],"mappings":"AA2CA,SAAgB,EAAoB,EAAiB,GACpD,MAAO,CAAE,KAAM,OAAQ,SAAQ,QAIhC,SAAgB,EACf,EACA,EACA,GAEA,MAAO,CAAE,KAAM,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FB9m.mjs";function r(r){return e()?r.replace(/Mod/g,"⌘").replace(/Shift/g,"⇧").replace(/Alt/g,"⌥").replace(/-/g,""):r.replace(/Mod/g,"Ctrl").replace(/-/g,"+")}export{r as t};
2
- //# sourceMappingURL=ShortcutFormatting-c0IajwWG.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ShortcutFormatting-c0IajwWG.mjs","names":[],"sources":["../../src/plugins/shared/ShortcutFormatting.ts"],"sourcesContent":["import { isMac } from '../../platform/Platform.js';\n\n/**\n * Formats a keymap binding string into a human-readable shortcut,\n * using platform-appropriate modifier symbols (⌘ on Mac, Ctrl on others).\n *\n * @example formatShortcut('Mod-B') → \"Ctrl+B\" or \"⌘B\"\n * @example formatShortcut('Mod-Shift-X') → \"Ctrl+Shift+X\" or \"⌘⇧X\"\n */\nexport function formatShortcut(binding: string): string {\n\tif (isMac()) {\n\t\treturn binding\n\t\t\t.replace(/Mod/g, '⌘')\n\t\t\t.replace(/Shift/g, '⇧')\n\t\t\t.replace(/Alt/g, '⌥')\n\t\t\t.replace(/-/g, '');\n\t}\n\treturn binding.replace(/Mod/g, 'Ctrl').replace(/-/g, '+');\n}\n"],"mappings":"4CASA,SAAgB,EAAe,GAC9B,OAAI,IACI,EACL,QAAQ,OAAQ,KAChB,QAAQ,SAAU,KAClB,QAAQ,OAAQ,KAChB,QAAQ,KAAM,IAEV,EAAQ,QAAQ,OAAQ,QAAQ,QAAQ,KAAM"}
@@ -1,2 +0,0 @@
1
- import{c as t,r as e,s as n}from"./Document-DnPKbcPE.mjs";import{c as o,o as s,t as c,u as r}from"./Selection-B14e7gd0.mjs";import{t as i}from"./Commands-ByBjgD3-.mjs";import{a}from"./TypeBrands-BQR8dEYU.mjs";import{a as l,c as d,i as u,o as h,s as m}from"./BlockInsertion-Q8B21SaG.mjs";import{n as g}from"./Plugin-C4cBw3bs.mjs";import{i as f}from"./PluginHelpers-BZU5rE44.mjs";import{i as p}from"./XmlDetector-B1y1NzDL.mjs";var x=/\n(?:[ \t]*\n)+/;function k(t,e){return!t.detection&&!e.detection||!(!t.detection||!e.detection)&&t.detection.language===e.detection.language}function C(t,e){const n=`${t.text}\n\n${e.text}`;if(!t.detection&&!e.detection)return{text:n,detection:null};const o=t.detection,s=e.detection;return{text:n,detection:{language:o.language,formattedText:`${o.formattedText}\n\n${s.formattedText}`,confidence:Math.max(o.confidence,s.confidence)}}}var b={detectedAsCodeBlock:t=>`Pasted as ${t} code block with syntax highlighting.`,detectedMixedContent:(t,e,n)=>{const o=[];if(t>0&&o.push(`${t} paragraph${t>1?"s":""}`),e>0){const t=n.join(", ");o.push(`${e} code block${e>1?"s":""} (${t})`)}return`Pasted as ${o.join(" and ")}.`}},j=/* @__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-UKi-TYFz.mjs"),"./locales/de.ts":()=>import("./de-CwSQIBLx.mjs"),"./locales/es.ts":()=>import("./es-Di4t0cUf.mjs"),"./locales/fr.ts":()=>import("./fr-SxdLDSEQ.mjs"),"./locales/hi.ts":()=>import("./hi-B0EvMNl3.mjs"),"./locales/pt.ts":()=>import("./pt-DEs0I6eo.mjs"),"./locales/ru.ts":()=>import("./ru-B_8ujIHK.mjs"),"./locales/zh.ts":()=>import("./zh-DtzwqBHS.mjs")});async function B(t){if("en"===t)return b;const e=j[`./locales/${t}.ts`];if(!e)return b;try{return(await e()).default}catch{return b}}var P=new g("smartPaste"),$=class{id="smart-paste";name="Smart Paste";dependencies=["code-block"];config;detectors=[];context=null;locale=b;constructor(t){this.config={...t}}async init(t){this.context=t,this.locale=await f(t,this.config.locale,b,B);const e=t.getService(p);if(e&&e.onRegister(t=>{t.detection&&this.detectors.push(t.detection)}),this.config.detectors)for(const n of this.config.detectors)this.detectors.push(n);t.registerPasteInterceptor(this.handlePaste,{name:"smart-paste",priority:50}),t.registerService(P,{registerDetector:t=>{this.detectors.push(t)}})}destroy(){this.context=null,this.detectors.length=0}handlePaste=(t,e,n)=>{if(this.isCursorInCodeBlock(n))return null;const o=function(t,e){const n=t.split(x).map(t=>t.trim()).filter(t=>t.length>0);if(0===n.length)return null;let o=!1;const s=n.map(t=>{const n=function(t,e){let n=null;for(const o of e){const e=o.detect(t);e&&(null===n||e.confidence>n.confidence)&&(n=e)}return n}(t,e);return n&&(o=!0),{text:t,detection:n}});return o?function(t){if(t.length<=1)return t;const e=[t[0]];for(let n=1;n<t.length;n++){const o=t[n],s=e[e.length-1];k(s,o)?e[e.length-1]=C(s,o):e.push(o)}return e}(s):null}(t,this.detectors);return o?1===o.length&&o[0]?.detection?this.handleSingleCodeBlock(n,o[0].detection):this.handleMixedContent(n,o):null};isCursorInCodeBlock(t){const e=t.selection;return!!r(e)&&"code_block"===t.getBlock(e.anchor.blockId)?.type}handleSingleCodeBlock(t,e){const n=this.buildCodeBlockTransaction(t,e);return n&&this.context&&this.context.announce(this.locale.detectedAsCodeBlock(e.language)),n}buildCodeBlockTransaction(o,d){const u=o.selection,m=o.transaction("paste");let g;g=r(u)&&!s(u)?i(o,m)??u.anchor.blockId:h(u);const f=t(),p=e(a("code_block"),[n(d.formattedText)],f,{language:d.language,backgroundColor:""});return l(o,m,g,p,u,this.context?.getSchemaRegistry())?(m.setSelection(c(f,d.formattedText.length)),m.build()):null}handleMixedContent(t,e){const n=this.buildMultiBlockTransaction(t,e);return n&&this.context&&this.announceMixedContent(e),n}buildMultiBlockTransaction(t,e){const n=t.selection,a=t.transaction("paste");let l;l=r(n)&&!s(n)?i(t,a)??n.anchor.blockId:h(n);const g=u(t,l),f=this.context?.getSchemaRegistry(),p=g?m(t,l,g,f):d(t,l,f);if(!p)return null;const x=!g&&o(n)&&"before"===n.side?0:1;let k,C=p.anchorIndex+x,b=0;for(const o of e){const t=o.detection?this.createCodeBlockNode(o.detection):this.createParagraphNode(o.text);a.insertNode(p.parentPath,C,t),C++,k=t.id,b=o.detection?o.detection.formattedText.length:o.text.length}return(g?p.isAnchorEmpty&&p.anchorIndex>=0:p.isAnchorEmpty&&!o(n))&&a.removeNode(p.parentPath,p.anchorIndex),k&&a.setSelection(c(k,b)),a.build()}createCodeBlockNode(o){return e(a("code_block"),[n(o.formattedText)],t(),{language:o.language,backgroundColor:""})}createParagraphNode(o){return e(a("paragraph"),[n(o)],t())}announceMixedContent(t){let e=0,n=0;const o=[];for(const s of t)s.detection?(n++,o.includes(s.detection.language)||o.push(s.detection.language)):e++;this.context?.announce(this.locale.detectedMixedContent(e,n,o))}};export{B as i,P as n,b as r,$ as t};
2
- //# sourceMappingURL=SmartPastePlugin-pejM1Zyk.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SmartPastePlugin-pejM1Zyk.mjs","names":[],"sources":["../../src/plugins/smart-paste/ContentSplitter.ts","../../src/plugins/smart-paste/SmartPasteLocale.ts","../../src/plugins/smart-paste/SmartPasteTypes.ts","../../src/plugins/smart-paste/SmartPastePlugin.ts"],"sourcesContent":["/**\n * Splits pasted text at blank-line boundaries and classifies each segment\n * using content detectors. Adjacent segments of the same type are merged.\n */\n\nimport type { ContentDetector, DetectionResult, PasteSegment } from './SmartPasteTypes.js';\n\n/** Pattern matching one or more consecutive blank lines (may contain whitespace). */\nconst BLANK_LINE_SPLIT: RegExp = /\\n(?:[ \\t]*\\n)+/;\n\n/**\n * Splits text at blank-line boundaries and classifies each segment\n * using the provided detectors. Returns null if no code is detected\n * in any segment (the paste should fall through to default handling).\n */\nexport function splitAndClassify(\n\ttext: string,\n\tdetectors: readonly ContentDetector[],\n): readonly PasteSegment[] | null {\n\tconst rawSegments: readonly string[] = text.split(BLANK_LINE_SPLIT);\n\tconst trimmed: readonly string[] = rawSegments\n\t\t.map((s: string) => s.trim())\n\t\t.filter((s: string) => s.length > 0);\n\n\tif (trimmed.length === 0) return null;\n\n\tlet hasCode = false;\n\tconst segments: PasteSegment[] = trimmed.map((segmentText: string): PasteSegment => {\n\t\tconst detection: DetectionResult | null = detectBest(segmentText, detectors);\n\t\tif (detection) hasCode = true;\n\t\treturn { text: segmentText, detection };\n\t});\n\n\tif (!hasCode) return null;\n\n\treturn mergeAdjacentSegments(segments);\n}\n\n/**\n * Merges adjacent segments that share the same classification:\n * consecutive text segments become one paragraph, consecutive code\n * segments of the same language become one code block.\n */\nexport function mergeAdjacentSegments(segments: readonly PasteSegment[]): readonly PasteSegment[] {\n\tif (segments.length <= 1) return segments;\n\n\tconst merged: PasteSegment[] = [segments[0] as PasteSegment];\n\n\tfor (let i = 1; i < segments.length; i++) {\n\t\tconst current: PasteSegment = segments[i] as PasteSegment;\n\t\tconst previous: PasteSegment = merged[merged.length - 1] as PasteSegment;\n\n\t\tif (canMerge(previous, current)) {\n\t\t\tmerged[merged.length - 1] = merge(previous, current);\n\t\t} else {\n\t\t\tmerged.push(current);\n\t\t}\n\t}\n\n\treturn merged;\n}\n\n/** Picks the highest-confidence detection result from all detectors. */\nfunction detectBest(text: string, detectors: readonly ContentDetector[]): DetectionResult | null {\n\tlet best: DetectionResult | null = null;\n\n\tfor (const detector of detectors) {\n\t\tconst result: DetectionResult | null = detector.detect(text);\n\t\tif (result && (best === null || result.confidence > best.confidence)) {\n\t\t\tbest = result;\n\t\t}\n\t}\n\n\treturn best;\n}\n\n/** Two segments can merge if both are text or both are code of the same language. */\nfunction canMerge(a: PasteSegment, b: PasteSegment): boolean {\n\tif (!a.detection && !b.detection) return true;\n\tif (a.detection && b.detection) return a.detection.language === b.detection.language;\n\treturn false;\n}\n\n/** Merges two compatible segments into one. */\nfunction merge(a: PasteSegment, b: PasteSegment): PasteSegment {\n\tconst joinedText: string = `${a.text}\\n\\n${b.text}`;\n\n\tif (!a.detection && !b.detection) {\n\t\treturn { text: joinedText, detection: null };\n\t}\n\n\tconst detA: DetectionResult = a.detection as DetectionResult;\n\tconst detB: DetectionResult = b.detection as DetectionResult;\n\n\treturn {\n\t\ttext: joinedText,\n\t\tdetection: {\n\t\t\tlanguage: detA.language,\n\t\t\tformattedText: `${detA.formattedText}\\n\\n${detB.formattedText}`,\n\t\t\tconfidence: Math.max(detA.confidence, detB.confidence),\n\t\t},\n\t};\n}\n","/** Locale interface and default English locale for the SmartPastePlugin. */\n\nexport interface SmartPasteLocale {\n\treadonly detectedAsCodeBlock: (language: string) => string;\n\treadonly detectedMixedContent: (\n\t\ttextCount: number,\n\t\tcodeCount: number,\n\t\tlanguages: readonly string[],\n\t) => string;\n}\n\nexport const SMART_PASTE_LOCALE_EN: SmartPasteLocale = {\n\tdetectedAsCodeBlock: (language: string) =>\n\t\t`Pasted as ${language} code block with syntax highlighting.`,\n\tdetectedMixedContent: (textCount: number, codeCount: number, languages: readonly string[]) => {\n\t\tconst parts: string[] = [];\n\t\tif (textCount > 0) {\n\t\t\tparts.push(`${textCount} paragraph${textCount > 1 ? 's' : ''}`);\n\t\t}\n\t\tif (codeCount > 0) {\n\t\t\tconst langList: string = languages.join(', ');\n\t\t\tparts.push(`${codeCount} code block${codeCount > 1 ? 's' : ''} (${langList})`);\n\t\t}\n\t\treturn `Pasted as ${parts.join(' and ')}.`;\n\t},\n};\n\nconst localeModules: Record<string, () => Promise<{ default: SmartPasteLocale }>> =\n\timport.meta.glob<{ default: SmartPasteLocale }>('./locales/*.ts', { eager: false });\n\nexport async function loadSmartPasteLocale(lang: string): Promise<SmartPasteLocale> {\n\tif (lang === 'en') return SMART_PASTE_LOCALE_EN;\n\tconst loader = localeModules[`./locales/${lang}.ts`];\n\tif (!loader) return SMART_PASTE_LOCALE_EN;\n\ttry {\n\t\tconst mod = await loader();\n\t\treturn mod.default;\n\t} catch {\n\t\treturn SMART_PASTE_LOCALE_EN;\n\t}\n}\n","/**\n * Types for the smart paste plugin — content detection and formatting.\n */\n\nimport { ServiceKey } from '../Plugin.js';\nimport type { SmartPasteLocale } from './SmartPasteLocale.js';\n\n/** Result of detecting structured content in pasted text. */\nexport interface DetectionResult {\n\treadonly language: string;\n\treadonly formattedText: string;\n\treadonly confidence: number;\n}\n\n/** A classified segment of pasted text — either plain text or detected code. */\nexport interface PasteSegment {\n\treadonly text: string;\n\treadonly detection: DetectionResult | null;\n}\n\n/** Interface for content detectors that identify and format pasted text. */\nexport interface ContentDetector {\n\treadonly id: string;\n\tdetect(text: string): DetectionResult | null;\n}\n\n/** Configuration for the SmartPastePlugin. */\nexport interface SmartPasteConfig {\n\treadonly detectors?: readonly ContentDetector[];\n\treadonly locale?: SmartPasteLocale;\n}\n\n/** Public service for registering additional content detectors at runtime. */\nexport interface SmartPasteService {\n\tregisterDetector(detector: ContentDetector): void;\n}\n\nexport const SMART_PASTE_SERVICE_KEY = new ServiceKey<SmartPasteService>('smartPaste');\n","/**\n * SmartPastePlugin: detects structured content in clipboard text\n * and inserts it as formatted code blocks with syntax highlighting.\n * Mixed content (text + code) is split into separate blocks.\n */\n\nimport {\n\ttype InsertionContext,\n\tfindTableCellAncestor,\n\tinsertBlockAfterAnchor,\n\tresolveAnchorBlockId,\n\tresolveCellInsertionContext,\n\tresolveRootInsertionContext,\n} from '../../commands/BlockInsertion.js';\nimport { addDeleteSelectionSteps } from '../../commands/Commands.js';\nimport {\n\ttype BlockNode,\n\tcreateBlockNode,\n\tcreateTextNode,\n\tgenerateBlockId,\n} from '../../model/Document.js';\nimport {\n\tcreateCollapsedSelection,\n\tisCollapsed,\n\tisGapCursor,\n\tisTextSelection,\n} from '../../model/Selection.js';\nimport type { BlockId, NodeTypeName } from '../../model/TypeBrands.js';\nimport { nodeType } from '../../model/TypeBrands.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { Transaction } from '../../state/Transaction.js';\nimport type { PasteInterceptor, Plugin, PluginContext } from '../Plugin.js';\nimport { LANGUAGE_REGISTRY_SERVICE_KEY } from '../language/LanguageTypes.js';\nimport { resolveLocale } from '../shared/PluginHelpers.js';\nimport { splitAndClassify } from './ContentSplitter.js';\nimport {\n\tSMART_PASTE_LOCALE_EN,\n\ttype SmartPasteLocale,\n\tloadSmartPasteLocale,\n} from './SmartPasteLocale.js';\nimport type {\n\tContentDetector,\n\tDetectionResult,\n\tPasteSegment,\n\tSmartPasteConfig,\n} from './SmartPasteTypes.js';\nimport { SMART_PASTE_SERVICE_KEY } from './SmartPasteTypes.js';\n\nexport class SmartPastePlugin implements Plugin {\n\treadonly id = 'smart-paste';\n\treadonly name = 'Smart Paste';\n\treadonly dependencies = ['code-block'] as const;\n\n\tprivate readonly config: SmartPasteConfig;\n\tprivate readonly detectors: ContentDetector[] = [];\n\tprivate context: PluginContext | null = null;\n\tprivate locale: SmartPasteLocale = SMART_PASTE_LOCALE_EN;\n\n\tconstructor(config?: Partial<SmartPasteConfig>) {\n\t\tthis.config = { ...config };\n\t}\n\n\tasync init(context: PluginContext): Promise<void> {\n\t\tthis.context = context;\n\n\t\tthis.locale = await resolveLocale(\n\t\t\tcontext,\n\t\t\tthis.config.locale,\n\t\t\tSMART_PASTE_LOCALE_EN,\n\t\t\tloadSmartPasteLocale,\n\t\t);\n\n\t\t// Subscribe to language registry for detectors (replay provides built-ins)\n\t\tconst registry = context.getService(LANGUAGE_REGISTRY_SERVICE_KEY);\n\t\tif (registry) {\n\t\t\tregistry.onRegister((support) => {\n\t\t\t\tif (support.detection) {\n\t\t\t\t\tthis.detectors.push(support.detection);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\t// Register config-provided detectors\n\t\tif (this.config.detectors) {\n\t\t\tfor (const detector of this.config.detectors) {\n\t\t\t\tthis.detectors.push(detector);\n\t\t\t}\n\t\t}\n\n\t\t// Register paste interceptor\n\t\tcontext.registerPasteInterceptor(this.handlePaste, { name: 'smart-paste', priority: 50 });\n\n\t\t// Register service for external detector registration\n\t\tcontext.registerService(SMART_PASTE_SERVICE_KEY, {\n\t\t\tregisterDetector: (detector: ContentDetector) => {\n\t\t\t\tthis.detectors.push(detector);\n\t\t\t},\n\t\t});\n\t}\n\n\tdestroy(): void {\n\t\tthis.context = null;\n\t\tthis.detectors.length = 0;\n\t}\n\n\t// --- Paste Interceptor ---\n\n\tprivate readonly handlePaste: PasteInterceptor = (\n\t\tplainText: string,\n\t\t_html: string,\n\t\tstate: EditorState,\n\t): Transaction | null => {\n\t\tif (this.isCursorInCodeBlock(state)) return null;\n\n\t\tconst segments: readonly PasteSegment[] | null = splitAndClassify(plainText, this.detectors);\n\t\tif (!segments) return null;\n\n\t\t// Single code-only segment: use existing fast path\n\t\tif (segments.length === 1 && segments[0]?.detection) {\n\t\t\treturn this.handleSingleCodeBlock(state, segments[0].detection);\n\t\t}\n\n\t\t// Mixed content: create multiple blocks\n\t\treturn this.handleMixedContent(state, segments);\n\t};\n\n\tprivate isCursorInCodeBlock(state: EditorState): boolean {\n\t\tconst sel = state.selection;\n\t\tif (!isTextSelection(sel)) return false;\n\n\t\tconst block: BlockNode | undefined = state.getBlock(sel.anchor.blockId);\n\t\treturn block?.type === 'code_block';\n\t}\n\n\t// --- Single Code Block (existing behavior) ---\n\n\tprivate handleSingleCodeBlock(\n\t\tstate: EditorState,\n\t\tdetection: DetectionResult,\n\t): Transaction | null {\n\t\tconst tr: Transaction | null = this.buildCodeBlockTransaction(state, detection);\n\t\tif (tr && this.context) {\n\t\t\tthis.context.announce(this.locale.detectedAsCodeBlock(detection.language));\n\t\t}\n\t\treturn tr;\n\t}\n\n\tprivate buildCodeBlockTransaction(\n\t\tstate: EditorState,\n\t\tdetection: DetectionResult,\n\t): Transaction | null {\n\t\tconst sel = state.selection;\n\t\tconst builder = state.transaction('paste');\n\n\t\t// Delete selection if range-selected\n\t\tlet anchorBlockId: BlockId;\n\t\tif (isTextSelection(sel) && !isCollapsed(sel)) {\n\t\t\tconst landingId: BlockId | undefined = addDeleteSelectionSteps(state, builder);\n\t\t\tanchorBlockId = landingId ?? sel.anchor.blockId;\n\t\t} else {\n\t\t\tanchorBlockId = resolveAnchorBlockId(sel);\n\t\t}\n\n\t\t// Create the code block node\n\t\tconst newBlockId: BlockId = generateBlockId();\n\t\tconst codeBlock: BlockNode = createBlockNode(\n\t\t\tnodeType('code_block') as NodeTypeName,\n\t\t\t[createTextNode(detection.formattedText)],\n\t\t\tnewBlockId,\n\t\t\t{ language: detection.language, backgroundColor: '' },\n\t\t);\n\n\t\t// Insert at cursor (handles cell vs root, empty anchor removal)\n\t\tconst inserted: boolean = insertBlockAfterAnchor(\n\t\t\tstate,\n\t\t\tbuilder,\n\t\t\tanchorBlockId,\n\t\t\tcodeBlock,\n\t\t\tsel,\n\t\t\tthis.context?.getSchemaRegistry(),\n\t\t);\n\t\tif (!inserted) return null;\n\n\t\tbuilder.setSelection(createCollapsedSelection(newBlockId, detection.formattedText.length));\n\n\t\treturn builder.build();\n\t}\n\n\t// --- Mixed Content (multiple blocks) ---\n\n\tprivate handleMixedContent(\n\t\tstate: EditorState,\n\t\tsegments: readonly PasteSegment[],\n\t): Transaction | null {\n\t\tconst tr: Transaction | null = this.buildMultiBlockTransaction(state, segments);\n\t\tif (tr && this.context) {\n\t\t\tthis.announceMixedContent(segments);\n\t\t}\n\t\treturn tr;\n\t}\n\n\tprivate buildMultiBlockTransaction(\n\t\tstate: EditorState,\n\t\tsegments: readonly PasteSegment[],\n\t): Transaction | null {\n\t\tconst sel = state.selection;\n\t\tconst builder = state.transaction('paste');\n\n\t\tlet anchorBlockId: BlockId;\n\t\tif (isTextSelection(sel) && !isCollapsed(sel)) {\n\t\t\tconst landingId: BlockId | undefined = addDeleteSelectionSteps(state, builder);\n\t\t\tanchorBlockId = landingId ?? sel.anchor.blockId;\n\t\t} else {\n\t\t\tanchorBlockId = resolveAnchorBlockId(sel);\n\t\t}\n\n\t\tconst cellId: BlockId | undefined = findTableCellAncestor(state, anchorBlockId);\n\t\tconst schemaRegistry = this.context?.getSchemaRegistry();\n\n\t\tconst ctx: InsertionContext | undefined = cellId\n\t\t\t? resolveCellInsertionContext(state, anchorBlockId, cellId, schemaRegistry)\n\t\t\t: resolveRootInsertionContext(state, anchorBlockId, schemaRegistry);\n\t\tif (!ctx) return null;\n\n\t\tconst insertOffset: number = !cellId && isGapCursor(sel) && sel.side === 'before' ? 0 : 1;\n\t\tlet insertIndex: number = ctx.anchorIndex + insertOffset;\n\t\tlet lastBlockId: BlockId | undefined;\n\t\tlet lastBlockTextLen = 0;\n\n\t\tfor (const segment of segments) {\n\t\t\tconst block: BlockNode = segment.detection\n\t\t\t\t? this.createCodeBlockNode(segment.detection)\n\t\t\t\t: this.createParagraphNode(segment.text);\n\n\t\t\tbuilder.insertNode(ctx.parentPath, insertIndex, block);\n\t\t\tinsertIndex++;\n\t\t\tlastBlockId = block.id;\n\t\t\tlastBlockTextLen = segment.detection\n\t\t\t\t? segment.detection.formattedText.length\n\t\t\t\t: segment.text.length;\n\t\t}\n\n\t\tconst shouldRemoveAnchor: boolean = cellId\n\t\t\t? ctx.isAnchorEmpty && ctx.anchorIndex >= 0\n\t\t\t: ctx.isAnchorEmpty && !isGapCursor(sel);\n\n\t\tif (shouldRemoveAnchor) {\n\t\t\tbuilder.removeNode(ctx.parentPath, ctx.anchorIndex);\n\t\t}\n\n\t\tif (lastBlockId) {\n\t\t\tbuilder.setSelection(createCollapsedSelection(lastBlockId, lastBlockTextLen));\n\t\t}\n\n\t\treturn builder.build();\n\t}\n\n\tprivate createCodeBlockNode(detection: DetectionResult): BlockNode {\n\t\treturn createBlockNode(\n\t\t\tnodeType('code_block') as NodeTypeName,\n\t\t\t[createTextNode(detection.formattedText)],\n\t\t\tgenerateBlockId(),\n\t\t\t{ language: detection.language, backgroundColor: '' },\n\t\t);\n\t}\n\n\tprivate createParagraphNode(text: string): BlockNode {\n\t\treturn createBlockNode(\n\t\t\tnodeType('paragraph') as NodeTypeName,\n\t\t\t[createTextNode(text)],\n\t\t\tgenerateBlockId(),\n\t\t);\n\t}\n\n\tprivate announceMixedContent(segments: readonly PasteSegment[]): void {\n\t\tlet textCount = 0;\n\t\tlet codeCount = 0;\n\t\tconst languages: string[] = [];\n\n\t\tfor (const segment of segments) {\n\t\t\tif (segment.detection) {\n\t\t\t\tcodeCount++;\n\t\t\t\tif (!languages.includes(segment.detection.language)) {\n\t\t\t\t\tlanguages.push(segment.detection.language);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttextCount++;\n\t\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-ByBjgD3-.mjs";import{i as e}from"./TypeBrands-BQR8dEYU.mjs";import{i as s}from"./PluginHelpers-BZU5rE44.mjs";import{t as o}from"./ShortcutFormatting-c0IajwWG.mjs";var i={label:"Strikethrough",tooltip:t=>`Strikethrough (${t})`},a=/* @__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-DYA1zADy.mjs"),"./locales/de.ts":()=>import("./de-CpNFM0EP.mjs"),"./locales/es.ts":()=>import("./es-BXTkzYVW.mjs"),"./locales/fr.ts":()=>import("./fr-C2y-quYa.mjs"),"./locales/hi.ts":()=>import("./hi-D-apR3ri.mjs"),"./locales/pt.ts":()=>import("./pt-zzij5vS0.mjs"),"./locales/ru.ts":()=>import("./ru-DiVRD-Ds.mjs"),"./locales/zh.ts":()=>import("./zh-DovMZIDF.mjs")});async function l(t){if("en"===t)return i;const r=a[`./locales/${t}.ts`];if(!r)return i;try{return(await r()).default}catch{return i}}var m={},h=class{id="strikethrough";name="Strikethrough";priority=22;config;locale;constructor(t){this.config={...m,...t}}async init(t){this.locale=await s(t,this.config.locale,i,l),this.registerMarkSpec(t),this.registerCommand(t),this.registerKeymap(t),this.registerToolbarItem(t)}registerMarkSpec(t){t.registerMarkSpec({type:"strikethrough",rank:3,toDOM:()=>document.createElement("s"),toHTMLString:(t,r)=>`<s>${r}</s>`,parseHTML:[{tag:"s"},{tag:"strike"},{tag:"del"},{tag:"span",getAttrs:t=>!!t.style.textDecoration.includes("line-through")&&{}}],sanitize:{tags:["s"]}})}registerCommand(r){r.registerCommand("toggleStrikethrough",()=>{const s=t(r.getState(),e("strikethrough"));return!!s&&(r.dispatch(s),!0)})}registerKeymap(t){t.registerKeymap({"Mod-Shift-X":()=>t.executeCommand("toggleStrikethrough")})}registerToolbarItem(t){t.registerToolbarItem({id:"strikethrough",group:"format",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 19h4v-3h-4v3zM5 4v3h5v3h4V7h5V4H5zM3 14h18v-2H3v2z"/></svg>',label:this.locale.label,tooltip:this.locale.tooltip(o("Mod-Shift-X")),command:"toggleStrikethrough",isActive:t=>r(t,e("strikethrough"))})}};export{i as n,l as r,h as t};
2
- //# sourceMappingURL=StrikethroughPlugin-XBOGv5Oi.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StrikethroughPlugin-XBOGv5Oi.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\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: Record<string, () => Promise<{ default: StrikethroughLocale }>> =\n\timport.meta.glob<{ default: StrikethroughLocale }>('./locales/*.ts', { eager: false });\n\nexport async function loadStrikethroughLocale(lang: string): Promise<StrikethroughLocale> {\n\tif (lang === 'en') return STRIKETHROUGH_LOCALE_EN;\n\tconst loader = localeModules[`./locales/${lang}.ts`];\n\tif (!loader) return STRIKETHROUGH_LOCALE_EN;\n\ttry {\n\t\tconst mod = await loader();\n\t\treturn mod.default;\n\t} catch {\n\t\treturn STRIKETHROUGH_LOCALE_EN;\n\t}\n}\n","/**\n * StrikethroughPlugin: registers a strikethrough inline mark with MarkSpec,\n * toggle command, keyboard shortcut (Mod-Shift-X), and a toolbar button.\n */\n\nimport { isMarkActive, toggleMark } from '../../commands/Commands.js';\nimport { markType } from '../../model/TypeBrands.js';\nimport type { Plugin, PluginContext } from '../Plugin.js';\nimport { resolveLocale } from '../shared/PluginHelpers.js';\nimport { formatShortcut } from '../shared/ShortcutFormatting.js';\nimport {\n\tSTRIKETHROUGH_LOCALE_EN,\n\ttype StrikethroughLocale,\n\tloadStrikethroughLocale,\n} from './StrikethroughLocale.js';\n\n// --- Attribute Registry Augmentation ---\n\ndeclare module '../../model/AttrRegistry.js' {\n\tinterface MarkAttrRegistry {\n\t\tstrikethrough: Record<string, never>;\n\t}\n}\n\n// --- Configuration ---\n\nexport interface StrikethroughConfig {\n\treadonly locale?: StrikethroughLocale;\n}\n\nconst DEFAULT_CONFIG: StrikethroughConfig = {};\n\n// --- Plugin ---\n\nexport class StrikethroughPlugin implements Plugin {\n\treadonly id = 'strikethrough';\n\treadonly name = 'Strikethrough';\n\treadonly priority = 22;\n\n\tprivate readonly config: StrikethroughConfig;\n\tprivate locale!: StrikethroughLocale;\n\n\tconstructor(config?: Partial<StrikethroughConfig>) {\n\t\tthis.config = { ...DEFAULT_CONFIG, ...config };\n\t}\n\n\tasync init(context: PluginContext): Promise<void> {\n\t\tthis.locale = await resolveLocale(\n\t\t\tcontext,\n\t\t\tthis.config.locale,\n\t\t\tSTRIKETHROUGH_LOCALE_EN,\n\t\t\tloadStrikethroughLocale,\n\t\t);\n\t\tthis.registerMarkSpec(context);\n\t\tthis.registerCommand(context);\n\t\tthis.registerKeymap(context);\n\t\tthis.registerToolbarItem(context);\n\t}\n\n\tprivate registerMarkSpec(context: PluginContext): void {\n\t\tcontext.registerMarkSpec({\n\t\t\ttype: 'strikethrough',\n\t\t\trank: 3,\n\t\t\ttoDOM() {\n\t\t\t\treturn document.createElement('s');\n\t\t\t},\n\t\t\ttoHTMLString: (_mark, content) => `<s>${content}</s>`,\n\t\t\tparseHTML: [\n\t\t\t\t{ tag: 's' },\n\t\t\t\t{ tag: 'strike' },\n\t\t\t\t{ tag: 'del' },\n\t\t\t\t{\n\t\t\t\t\ttag: 'span',\n\t\t\t\t\tgetAttrs: (el: HTMLElement) => {\n\t\t\t\t\t\treturn el.style.textDecoration.includes('line-through') ? {} : false;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t\tsanitize: { tags: ['s'] },\n\t\t});\n\t}\n\n\tprivate registerCommand(context: PluginContext): void {\n\t\tcontext.registerCommand('toggleStrikethrough', () => {\n\t\t\tconst tr = toggleMark(context.getState(), markType('strikethrough'));\n\t\t\tif (tr) {\n\t\t\t\tcontext.dispatch(tr);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\t}\n\n\tprivate registerKeymap(context: PluginContext): void {\n\t\tcontext.registerKeymap({\n\t\t\t'Mod-Shift-X': () => context.executeCommand('toggleStrikethrough'),\n\t\t});\n\t}\n\n\tprivate registerToolbarItem(context: PluginContext): void {\n\t\tconst icon =\n\t\t\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M10 19h4v-3h-4v3zM5 4v3h5v3h4V7h5V4H5zM3 14h18v-2H3v2z\"/></svg>';\n\n\t\tcontext.registerToolbarItem({\n\t\t\tid: 'strikethrough',\n\t\t\tgroup: 'format',\n\t\t\ticon,\n\t\t\tlabel: this.locale.label,\n\t\t\ttooltip: this.locale.tooltip(formatShortcut('Mod-Shift-X')),\n\t\t\tcommand: 'toggleStrikethrough',\n\t\t\tisActive: (state) => isMarkActive(state, markType('strikethrough')),\n\t\t});\n\t}\n}\n"],"mappings":"wMAaA,IAAa,EAA+C,CAC3D,MAAO,gBACP,QAAU,GAAqB,kBAAkB,MAK5C,iBACL,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,uBAED,eAAsB,EAAwB,GAC7C,GAAa,OAAT,EAAe,OAAO,EAC1B,MAAM,EAAS,EAAc,aAAa,QAC1C,IAAK,EAAQ,OAAO,EACpB,IAEC,aADkB,KACP,cAEX,OAAO,GCDT,IAAM,EAAsC,CAAA,EAI/B,EAAb,MACC,GAAc,gBACd,KAAgB,gBAChB,SAAoB,GAEpB,OACA,OAEA,WAAA,CAAY,GACX,KAAK,OAAS,IAAK,KAAmB,GAGvC,UAAM,CAAK,GACV,KAAK,aAAe,EACnB,EACA,KAAK,OAAO,OACZ,EACA,GAED,KAAK,iBAAiB,GACtB,KAAK,gBAAgB,GACrB,KAAK,eAAe,GACpB,KAAK,oBAAoB,GAG1B,gBAAA,CAAyB,GACxB,EAAQ,iBAAiB,CACxB,KAAM,gBACN,KAAM,EACN,MAAA,IACQ,SAAS,cAAc,KAE/B,aAAA,CAAe,EAAO,IAAY,MAAM,QACxC,UAAW,CACV,CAAE,IAAK,KACP,CAAE,IAAK,UACP,CAAE,IAAK,OACP,CACC,IAAK,OACL,SAAW,KACH,EAAG,MAAM,eAAe,SAAS,iBAAkB,CAAA,IAI7D,SAAU,CAAE,KAAM,CAAC,QAIrB,eAAA,CAAwB,GACvB,EAAQ,gBAAgB,sBAAA,KACvB,MAAM,EAAK,EAAW,EAAQ,WAAY,EAAS,kBACnD,QAAI,IACH,EAAQ,SAAS,IACV,KAMV,cAAA,CAAuB,GACtB,EAAQ,eAAe,CACtB,cAAA,IAAqB,EAAQ,eAAe,yBAI9C,mBAAA,CAA4B,GAI3B,EAAQ,oBAAoB,CAC3B,GAAI,gBACJ,MAAO,SACP,KALA,uIAMA,MAAO,KAAK,OAAO,MACnB,QAAS,KAAK,OAAO,QAAQ,EAAe,gBAC5C,QAAS,sBACT,SAAW,GAAU,EAAa,EAAO,EAAS"}
@@ -1,2 +0,0 @@
1
- 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{}return this.sheet=this.ensureFallbackStyleElement().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-Bwde5icB.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StyleRuntime-Bwde5icB.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":"AAoBA,IAAM,EAAmB,2BAGnB,iBAA8C,IAAI,QAClD,iBAAuD,IAAI,QAGjE,SAAgB,IACf,GAA6B,oBAAlB,cAA+B,OAAO,KACjD,IACC,OAAO,IAAI,oBAEX,OAAO,MAKT,SAAgB,EAAkB,EAAiB,GAClD,MAAM,EAAW,EAAc,IAAI,GAC/B,IACH,EAAS,UACT,EAAc,OAAO,IAEtB,EAAY,IAAI,EAAM,CACrB,MAAO,EAAQ,MACf,MAAO,EAAQ,OAAS,OAK1B,SAAgB,EAAoB,GACnC,MAAM,EAAS,EAAc,IAAI,GAC7B,IACH,EAAO,UACP,EAAc,OAAO,IAEtB,EAAY,OAAO,GAIpB,SAAgB,EAAiB,EAAiB,EAAkB,GACnE,MAAM,EAAS,EAAc,GACxB,EAIL,EAAgB,EAAO,KAAM,EAAO,UAAU,YAAY,EAAI,EAAU,GAHvE,EAAkB,EAAI,EAAU,GAOlC,SAAgB,EAAoB,EAAiB,GACpD,EAAiB,EAAI,EAAU,IAIhC,SAAgB,EACf,EACA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,SAYvD,OAXA,EAAM,aA5XmB,8BA4Xc,IACnC,KAAK,OACR,EAAM,aAAa,QAAS,KAAK,OAE9B,EAAa,KAAK,MACrB,KAAK,KAAK,YAAY,IAET,KAAK,KAAK,MAAQ,KAAK,KAAK,iBACpC,YAAY,GAElB,KAAK,qBAAuB,EACrB,IAIT,SAAS,EAAe,GACvB,MAAM,iBAAe,IAAI,IACzB,IAAK,MAAM,KAAW,EAAU,MAAM,KAAM,CAC3C,MAAM,EAAO,EAAQ,OACrB,IAAK,EAAM,SACX,MAAM,EAAY,EAAK,QAAQ,KAC/B,GAAI,GAAa,EAAG,SACpB,MAAM,EAAW,EAAsB,EAAK,MAAM,EAAG,IAC/C,EAAQ,EAAK,MAAM,EAAY,GAAG,OACnC,EAGJ,EAAa,IAAI,EAAU,GAF3B,EAAa,OAAO,GAKtB,OAAO,EAGR,SAAS,EAAsB,GAI9B,OAHoC,MAAM,KAAK,EAAa,WAAW,KAAA,EAAO,IAAK,KAClF,EAAE,cAAc,IAEF,IAAA,EAAM,EAAU,KAAW,GAAG,MAAa,KAAS,KAAK,MAGzE,SAAS,EAAsB,GAC9B,MAAM,EAAU,EAAS,OACzB,OAAK,EACD,EAAQ,WAAW,MAAc,EACjC,EAAQ,SAAS,KAAa,EAAQ,cACnC,EAAQ,QAAQ,SAAW,GAAiB,IAAI,EAAK,iBAAiB,cAHxD,GAMtB,SAAS,EAAmB,GAC3B,MAAO,IAAI,MAAqB,MAGjC,SAAS,EAAqB,EAAe,GAC5C,MAA4B,oBAAjB,cAAgC,aAAgB,aACnD,EAAK,eAAiB,EAEvB,EAAK,QAAQ,SAAS"}
@@ -1,2 +0,0 @@
1
- import{_ as t,m as s}from"./Commands-ByBjgD3-.mjs";import{i as e}from"./TypeBrands-BQR8dEYU.mjs";import{a as i,i as r}from"./PluginHelpers-BZU5rE44.mjs";import{t as o}from"./ShortcutFormatting-c0IajwWG.mjs";var p={superscriptLabel:"Superscript",superscriptTooltip:t=>`Superscript (${t})`,subscriptLabel:"Subscript",subscriptTooltip:t=>`Subscript (${t})`},c=/* @__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-CpZXocgF.mjs"),"./locales/de.ts":()=>import("./de-ChvJQZeC.mjs"),"./locales/es.ts":()=>import("./es-DPyejgTk.mjs"),"./locales/fr.ts":()=>import("./fr-DyGGhKFe.mjs"),"./locales/hi.ts":()=>import("./hi-B5sPMUNb.mjs"),"./locales/pt.ts":()=>import("./pt-DBNe2BiX.mjs"),"./locales/ru.ts":()=>import("./ru-BNTSKpWh.mjs"),"./locales/zh.ts":()=>import("./zh-DunJzfVR.mjs")});async function a(t){if("en"===t)return p;const s=c[`./locales/${t}.ts`];if(!s)return p;try{return(await s()).default}catch{return p}}var n={superscript:!0,subscript:!0},l=[{type:"superscript",opposite:"subscript",configKey:"superscript",rank:4,tag:"sup",icon:['<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">','<path d="M16 7.41L11.41 12 16 16.59 14.59 18l-6-6 6-6z"',' fill="none"/>','<path d="M9.64 7.64c.23-.5.36-1.05.36-1.64'," 0-2.21-1.79-4-4-4H2v14h4.36c2.34 0 4.24-1.9"," 4.24-4.24 0-1.6-.89-2.99-2.2-3.71zM4.5 4.5H6c.83"," 0 1.5.67 1.5 1.5S6.83 7.5 6 7.5H4.5v-3zm2 9H4.5v-3H6.5c.83",' 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z" fill="none"/>','<path d="M15.97 3.84c0-.47.19-.91.53-1.21.34-.31.8-.49'," 1.3-.49.5 0 .95.18 1.28.48.32.3.5.7.51 1.15h1.59c-.02","-.96-.43-1.83-1.13-2.42C19.36.77 18.45.44 17.5.44c-.88"," 0-1.74.28-2.39.8-.67.53-1.06 1.28-1.06 2.1 0 .76.34"," 1.47.93 1.97.59.49 1.41.84 2.32 1.15.7.24 1.26.5 1.62.8.35.3.53.64.53"," 1.02 0 .48-.2.93-.55 1.24-.36.3-.84.48-1.37.48-.55 0-1.04-.2-1.39-.54","-.34-.33-.53-.8-.53-1.32h-1.58c.01 1.02.43 1.95 1.16 2.57.72.62 1.67.96"," 2.67.96.92 0 1.81-.3 2.46-.84.67-.56 1.04-1.33 1.04-2.18 0-.81-.36-1.56","-.99-2.08-.62-.51-1.48-.88-2.43-1.2-.67-.23-1.2-.47-1.52-.75-.32-.27-.46",'-.59-.46-.94z"/>','<path d="M5.88 20h2.66l3.4-5.42L15.3 20h2.67l-4.73-7.38',' 4.37-6.62h-2.6l-3.07 4.98L8.92 6h-2.6l4.26 6.58z"/>',"</svg>"].join(""),keyBinding:"Mod-.",toHTMLString:t=>`<sup>${t}</sup>`,parseHTML:[{tag:"sup"}],sanitize:{tags:["sup"]}},{type:"subscript",opposite:"superscript",configKey:"subscript",rank:4,tag:"sub",icon:['<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">','<path d="M15.97 16.84c0-.47.19-.91.53-1.21.34-.31.8-.49'," 1.3-.49.5 0 .95.18 1.28.48.32.3.5.7.51 1.15h1.59c-.02","-.96-.43-1.83-1.13-2.42-.7-.58-1.61-.91-2.56-.91-.88"," 0-1.74.28-2.39.8-.67.53-1.06 1.28-1.06 2.1 0 .76.34"," 1.47.93 1.97.59.49 1.41.84 2.32 1.15.7.24 1.26.5 1.62.8.35.3.53.64.53"," 1.02 0 .48-.2.93-.55 1.24-.36.3-.84.48-1.37.48-.55 0-1.04-.2-1.39-.54","-.34-.33-.53-.8-.53-1.32h-1.58c.01 1.02.43 1.95 1.16 2.57.72.62 1.67.96"," 2.67.96.92 0 1.81-.3 2.46-.84.67-.56 1.04-1.33 1.04-2.18 0-.81-.36-1.56","-.99-2.08-.62-.51-1.48-.88-2.43-1.2-.67-.23-1.2-.47-1.52-.75-.32-.27-.46",'-.59-.46-.94z"/>','<path d="M5.88 18h2.66l3.4-5.42L15.3 18h2.67l-4.73-7.38',' 4.37-6.62h-2.6l-3.07 4.98L8.92 4h-2.6l4.26 6.58z"/>',"</svg>"].join(""),keyBinding:"Mod-,",toHTMLString:t=>`<sub>${t}</sub>`,parseHTML:[{tag:"sub"}],sanitize:{tags:["sub"]}}],u=class{id="super-sub";name="Superscript & Subscript";priority=23;config;locale;constructor(t){this.config={...n,...t}}async init(t){this.locale=await r(t,this.config.locale,p,a);const s=l.filter(t=>this.config[t.configKey]);for(const e of s)this.registerMark(t,e);this.registerKeymaps(t,s),this.registerExclusivityMiddleware(t,s),this.registerDisabledToolbarItems(t)}registerMark(r,p){const c=i(p.type),a=this.isToolbarVisible(p.configKey);if(r.registerMarkSpec({type:p.type,rank:p.rank,toDOM:()=>document.createElement(p.tag),toHTMLString:(t,s)=>p.toHTMLString(s),parseHTML:p.parseHTML,sanitize:p.sanitize}),r.registerCommand(c,()=>{const s=t(r.getState(),e(p.type));return!!s&&(r.dispatch(s),!0)}),a){const t="superscript"===p.type?this.locale.superscriptLabel:this.locale.subscriptLabel,i="superscript"===p.type?this.locale.superscriptTooltip(o(p.keyBinding)):this.locale.subscriptTooltip(o(p.keyBinding));r.registerToolbarItem({id:p.type,group:"format",icon:p.icon,label:t,tooltip:i,command:c,isActive:t=>s(t,e(p.type))})}}registerKeymaps(t,s){const e={};for(const r of s){const s=i(r.type);e[r.keyBinding]=()=>t.executeCommand(s)}Object.keys(e).length>0&&t.registerKeymap(e)}registerExclusivityMiddleware(t,s){s.some(t=>"superscript"===t.type)&&s.some(t=>"subscript"===t.type)&&t.registerMiddleware((t,s,i)=>{let r=!1;const o=[];for(const c of t.steps){if("addMark"!==c.type){o.push(c);continue}const t=c.mark.type,s=l.find(s=>s.type===t);if(!s){o.push(c);continue}r=!0;const i={type:"removeMark",blockId:c.blockId,from:c.from,to:c.to,mark:{type:e(s.opposite)},...c.path?{path:c.path}:{}};o.push(i,c)}let p=t.storedMarksAfter;if(p){const t=p.some(t=>"superscript"===t.type),s=p.some(t=>"subscript"===t.type);if(t&&s){const t=p.findLastIndex(t=>"superscript"===t.type)>p.findLastIndex(t=>"subscript"===t.type)?"subscript":"superscript";p=p.filter(s=>s.type!==t),r=!0}}i(r?{...t,steps:o,storedMarksAfter:p}:t)},{name:"super-sub:exclusivity"})}registerDisabledToolbarItems(t){if(this.config.toolbar)for(const s of l){const e=this.config[s.configKey],r=this.config.toolbar[s.configKey]??!0;if(!e&&r){const e="superscript"===s.type?this.locale.superscriptLabel:this.locale.subscriptLabel;t.registerToolbarItem({id:s.type,group:"format",icon:s.icon,label:e,command:i(s.type),isEnabled:()=>!1})}}}isToolbarVisible(t){return!this.config.toolbar||(this.config.toolbar[t]??!0)}};export{p as n,a as r,u as t};
2
- //# sourceMappingURL=SuperSubPlugin-CVjU4W9y.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SuperSubPlugin-CVjU4W9y.mjs","names":[],"sources":["../../src/plugins/super-sub/SuperSubLocale.ts","../../src/plugins/super-sub/SuperSubPlugin.ts"],"sourcesContent":["/**\n * Locale interface and default English locale for the SuperSubPlugin.\n */\n\n// --- Locale Interface ---\n\nexport interface SuperSubLocale {\n\treadonly superscriptLabel: string;\n\treadonly superscriptTooltip: (shortcut: string) => string;\n\treadonly subscriptLabel: string;\n\treadonly subscriptTooltip: (shortcut: string) => string;\n}\n\n// --- Default English Locale ---\n\nexport const SUPER_SUB_LOCALE_EN: SuperSubLocale = {\n\tsuperscriptLabel: 'Superscript',\n\tsuperscriptTooltip: (shortcut: string) => `Superscript (${shortcut})`,\n\tsubscriptLabel: 'Subscript',\n\tsubscriptTooltip: (shortcut: string) => `Subscript (${shortcut})`,\n};\n\n// --- Lazy Locale Loader ---\n\nconst localeModules: Record<string, () => Promise<{ default: SuperSubLocale }>> = import.meta.glob<{\n\tdefault: SuperSubLocale;\n}>('./locales/*.ts', { eager: false });\n\nexport async function loadSuperSubLocale(lang: string): Promise<SuperSubLocale> {\n\tif (lang === 'en') return SUPER_SUB_LOCALE_EN;\n\tconst loader = localeModules[`./locales/${lang}.ts`];\n\tif (!loader) return SUPER_SUB_LOCALE_EN;\n\ttry {\n\t\tconst mod = await loader();\n\t\treturn mod.default;\n\t} catch {\n\t\treturn SUPER_SUB_LOCALE_EN;\n\t}\n}\n","/**\n * SuperSubPlugin: registers superscript and subscript inline marks with\n * MarkSpecs, toggle commands, keyboard shortcuts, toolbar buttons, and\n * a middleware that enforces mutual exclusivity between the two marks.\n *\n * Data-driven — each mark type is defined declaratively and all\n * registrations are derived from the same definition table.\n */\n\nimport { isMarkActive, toggleMark } from '../../commands/Commands.js';\nimport type { Mark } from '../../model/Document.js';\nimport type { ParseRule } from '../../model/ParseRule.js';\nimport type { SanitizeConfig } from '../../model/SanitizeConfig.js';\nimport { markType as mkType } from '../../model/TypeBrands.js';\nimport type { RemoveMarkStep, Step } from '../../state/Transaction.js';\nimport type { Plugin, PluginContext } from '../Plugin.js';\nimport { resolveLocale, toCommandName } from '../shared/PluginHelpers.js';\nimport { formatShortcut } from '../shared/ShortcutFormatting.js';\nimport { SUPER_SUB_LOCALE_EN, type SuperSubLocale, loadSuperSubLocale } from './SuperSubLocale.js';\n\n// --- Attribute Registry Augmentation ---\n\ndeclare module '../../model/AttrRegistry.js' {\n\tinterface MarkAttrRegistry {\n\t\tsuperscript: Record<string, never>;\n\t\tsubscript: Record<string, never>;\n\t}\n}\n\n// --- Configuration ---\n\n/** Controls toolbar button visibility per mark. */\nexport interface SuperSubToolbarConfig {\n\treadonly superscript?: boolean;\n\treadonly subscript?: boolean;\n}\n\n/** Controls which marks are enabled and which toolbar buttons are shown. */\nexport interface SuperSubConfig {\n\treadonly superscript: boolean;\n\treadonly subscript: boolean;\n\treadonly toolbar?: SuperSubToolbarConfig;\n\treadonly locale?: SuperSubLocale;\n}\n\nconst DEFAULT_CONFIG: SuperSubConfig = {\n\tsuperscript: true,\n\tsubscript: true,\n};\n\n// --- Mark Definitions ---\n\ninterface MarkDefinition {\n\treadonly type: 'superscript' | 'subscript';\n\treadonly opposite: 'superscript' | 'subscript';\n\treadonly configKey: keyof Omit<SuperSubConfig, 'toolbar' | 'locale'>;\n\treadonly rank: number;\n\treadonly tag: string;\n\treadonly icon: string;\n\treadonly keyBinding: string;\n\treadonly toHTMLString: (content: string) => string;\n\treadonly parseHTML: readonly ParseRule[];\n\treadonly sanitize: SanitizeConfig;\n}\n\nconst SUPERSCRIPT_ICON: string = [\n\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">',\n\t'<path d=\"M16 7.41L11.41 12 16 16.59 14.59 18l-6-6 6-6z\"',\n\t' fill=\"none\"/>',\n\t'<path d=\"M9.64 7.64c.23-.5.36-1.05.36-1.64',\n\t' 0-2.21-1.79-4-4-4H2v14h4.36c2.34 0 4.24-1.9',\n\t' 4.24-4.24 0-1.6-.89-2.99-2.2-3.71zM4.5 4.5H6c.83',\n\t' 0 1.5.67 1.5 1.5S6.83 7.5 6 7.5H4.5v-3zm2 9H4.5v-3H6.5c.83',\n\t' 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z\" fill=\"none\"/>',\n\t'<path d=\"M15.97 3.84c0-.47.19-.91.53-1.21.34-.31.8-.49',\n\t' 1.3-.49.5 0 .95.18 1.28.48.32.3.5.7.51 1.15h1.59c-.02',\n\t'-.96-.43-1.83-1.13-2.42C19.36.77 18.45.44 17.5.44c-.88',\n\t' 0-1.74.28-2.39.8-.67.53-1.06 1.28-1.06 2.1 0 .76.34',\n\t' 1.47.93 1.97.59.49 1.41.84 2.32 1.15.7.24 1.26.5 1.62.8.35.3.53.64.53',\n\t' 1.02 0 .48-.2.93-.55 1.24-.36.3-.84.48-1.37.48-.55 0-1.04-.2-1.39-.54',\n\t'-.34-.33-.53-.8-.53-1.32h-1.58c.01 1.02.43 1.95 1.16 2.57.72.62 1.67.96',\n\t' 2.67.96.92 0 1.81-.3 2.46-.84.67-.56 1.04-1.33 1.04-2.18 0-.81-.36-1.56',\n\t'-.99-2.08-.62-.51-1.48-.88-2.43-1.2-.67-.23-1.2-.47-1.52-.75-.32-.27-.46',\n\t'-.59-.46-.94z\"/>',\n\t'<path d=\"M5.88 20h2.66l3.4-5.42L15.3 20h2.67l-4.73-7.38',\n\t' 4.37-6.62h-2.6l-3.07 4.98L8.92 6h-2.6l4.26 6.58z\"/>',\n\t'</svg>',\n].join('');\n\nconst SUBSCRIPT_ICON: string = [\n\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">',\n\t'<path d=\"M15.97 16.84c0-.47.19-.91.53-1.21.34-.31.8-.49',\n\t' 1.3-.49.5 0 .95.18 1.28.48.32.3.5.7.51 1.15h1.59c-.02',\n\t'-.96-.43-1.83-1.13-2.42-.7-.58-1.61-.91-2.56-.91-.88',\n\t' 0-1.74.28-2.39.8-.67.53-1.06 1.28-1.06 2.1 0 .76.34',\n\t' 1.47.93 1.97.59.49 1.41.84 2.32 1.15.7.24 1.26.5 1.62.8.35.3.53.64.53',\n\t' 1.02 0 .48-.2.93-.55 1.24-.36.3-.84.48-1.37.48-.55 0-1.04-.2-1.39-.54',\n\t'-.34-.33-.53-.8-.53-1.32h-1.58c.01 1.02.43 1.95 1.16 2.57.72.62 1.67.96',\n\t' 2.67.96.92 0 1.81-.3 2.46-.84.67-.56 1.04-1.33 1.04-2.18 0-.81-.36-1.56',\n\t'-.99-2.08-.62-.51-1.48-.88-2.43-1.2-.67-.23-1.2-.47-1.52-.75-.32-.27-.46',\n\t'-.59-.46-.94z\"/>',\n\t'<path d=\"M5.88 18h2.66l3.4-5.42L15.3 18h2.67l-4.73-7.38',\n\t' 4.37-6.62h-2.6l-3.07 4.98L8.92 4h-2.6l4.26 6.58z\"/>',\n\t'</svg>',\n].join('');\n\nconst MARK_DEFINITIONS: readonly MarkDefinition[] = [\n\t{\n\t\ttype: 'superscript',\n\t\topposite: 'subscript',\n\t\tconfigKey: 'superscript',\n\t\trank: 4,\n\t\ttag: 'sup',\n\t\ticon: SUPERSCRIPT_ICON,\n\t\tkeyBinding: 'Mod-.',\n\t\ttoHTMLString: (content) => `<sup>${content}</sup>`,\n\t\tparseHTML: [{ tag: 'sup' }],\n\t\tsanitize: { tags: ['sup'] },\n\t},\n\t{\n\t\ttype: 'subscript',\n\t\topposite: 'superscript',\n\t\tconfigKey: 'subscript',\n\t\trank: 4,\n\t\ttag: 'sub',\n\t\ticon: SUBSCRIPT_ICON,\n\t\tkeyBinding: 'Mod-,',\n\t\ttoHTMLString: (content) => `<sub>${content}</sub>`,\n\t\tparseHTML: [{ tag: 'sub' }],\n\t\tsanitize: { tags: ['sub'] },\n\t},\n];\n\n// --- Plugin ---\n\nexport class SuperSubPlugin implements Plugin {\n\treadonly id = 'super-sub';\n\treadonly name = 'Superscript & Subscript';\n\treadonly priority = 23;\n\n\tprivate readonly config: SuperSubConfig;\n\tprivate locale!: SuperSubLocale;\n\n\tconstructor(config?: Partial<SuperSubConfig>) {\n\t\tthis.config = { ...DEFAULT_CONFIG, ...config };\n\t}\n\n\tasync init(context: PluginContext): Promise<void> {\n\t\tthis.locale = await resolveLocale(\n\t\t\tcontext,\n\t\t\tthis.config.locale,\n\t\t\tSUPER_SUB_LOCALE_EN,\n\t\t\tloadSuperSubLocale,\n\t\t);\n\n\t\tconst enabledMarks: MarkDefinition[] = MARK_DEFINITIONS.filter(\n\t\t\t(def) => this.config[def.configKey],\n\t\t);\n\n\t\tfor (const def of enabledMarks) {\n\t\t\tthis.registerMark(context, def);\n\t\t}\n\n\t\tthis.registerKeymaps(context, enabledMarks);\n\t\tthis.registerExclusivityMiddleware(context, enabledMarks);\n\t\tthis.registerDisabledToolbarItems(context);\n\t}\n\n\tprivate registerMark(context: PluginContext, def: MarkDefinition): void {\n\t\tconst commandName: string = toCommandName(def.type);\n\t\tconst toolbarVisible: boolean = this.isToolbarVisible(def.configKey);\n\n\t\tcontext.registerMarkSpec({\n\t\t\ttype: def.type,\n\t\t\trank: def.rank,\n\t\t\ttoDOM() {\n\t\t\t\treturn document.createElement(def.tag);\n\t\t\t},\n\t\t\ttoHTMLString: (_mark, content) => def.toHTMLString(content),\n\t\t\tparseHTML: def.parseHTML,\n\t\t\tsanitize: def.sanitize,\n\t\t});\n\n\t\tcontext.registerCommand(commandName, () => {\n\t\t\tconst tr = toggleMark(context.getState(), mkType(def.type));\n\t\t\tif (tr) {\n\t\t\t\tcontext.dispatch(tr);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\n\t\tif (toolbarVisible) {\n\t\t\tconst label: string =\n\t\t\t\tdef.type === 'superscript' ? this.locale.superscriptLabel : this.locale.subscriptLabel;\n\t\t\tconst tooltip: string =\n\t\t\t\tdef.type === 'superscript'\n\t\t\t\t\t? this.locale.superscriptTooltip(formatShortcut(def.keyBinding))\n\t\t\t\t\t: this.locale.subscriptTooltip(formatShortcut(def.keyBinding));\n\t\t\tcontext.registerToolbarItem({\n\t\t\t\tid: def.type,\n\t\t\t\tgroup: 'format',\n\t\t\t\ticon: def.icon,\n\t\t\t\tlabel,\n\t\t\t\ttooltip,\n\t\t\t\tcommand: commandName,\n\t\t\t\tisActive: (state) => isMarkActive(state, mkType(def.type)),\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate registerKeymaps(context: PluginContext, marks: readonly MarkDefinition[]): void {\n\t\tconst keymap: Record<string, () => boolean> = {};\n\t\tfor (const def of marks) {\n\t\t\tconst commandName: string = toCommandName(def.type);\n\t\t\tkeymap[def.keyBinding] = () => context.executeCommand(commandName);\n\t\t}\n\t\tif (Object.keys(keymap).length > 0) {\n\t\t\tcontext.registerKeymap(keymap);\n\t\t}\n\t}\n\n\t/**\n\t * Ensures superscript and subscript are mutually exclusive.\n\t * When an addMark step for one type is found, a removeMark step\n\t * for the opposite type is injected. For stored marks, the opposite\n\t * mark is filtered out.\n\t */\n\tprivate registerExclusivityMiddleware(\n\t\tcontext: PluginContext,\n\t\tenabledMarks: readonly MarkDefinition[],\n\t): void {\n\t\tconst bothEnabled: boolean =\n\t\t\tenabledMarks.some((d) => d.type === 'superscript') &&\n\t\t\tenabledMarks.some((d) => d.type === 'subscript');\n\n\t\tif (!bothEnabled) return;\n\n\t\tcontext.registerMiddleware(\n\t\t\t(tr, _state, next) => {\n\t\t\t\tlet patched = false;\n\n\t\t\t\t// Handle addMark steps: inject removeMark for the opposite type\n\t\t\t\tconst patchedSteps: Step[] = [];\n\t\t\t\tfor (const step of tr.steps) {\n\t\t\t\t\tif (step.type !== 'addMark') {\n\t\t\t\t\t\tpatchedSteps.push(step);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst markName: string = step.mark.type;\n\t\t\t\t\tconst def: MarkDefinition | undefined = MARK_DEFINITIONS.find((d) => d.type === markName);\n\t\t\t\t\tif (!def) {\n\t\t\t\t\t\tpatchedSteps.push(step);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tpatched = true;\n\t\t\t\t\tconst removeStep: RemoveMarkStep = {\n\t\t\t\t\t\ttype: 'removeMark',\n\t\t\t\t\t\tblockId: step.blockId,\n\t\t\t\t\t\tfrom: step.from,\n\t\t\t\t\t\tto: step.to,\n\t\t\t\t\t\tmark: { type: mkType(def.opposite) },\n\t\t\t\t\t\t...(step.path ? { path: step.path } : {}),\n\t\t\t\t\t};\n\t\t\t\t\tpatchedSteps.push(removeStep, step);\n\t\t\t\t}\n\n\t\t\t\t// Handle stored marks: remove the opposite mark\n\t\t\t\tlet storedMarksAfter: readonly Mark[] | null = tr.storedMarksAfter;\n\t\t\t\tif (storedMarksAfter) {\n\t\t\t\t\tconst hasSup: boolean = storedMarksAfter.some((m) => m.type === 'superscript');\n\t\t\t\t\tconst hasSub: boolean = storedMarksAfter.some((m) => m.type === 'subscript');\n\n\t\t\t\t\tif (hasSup && hasSub) {\n\t\t\t\t\t\t// Keep the one that was most recently added (last in array)\n\t\t\t\t\t\tconst lastSupIdx: number = storedMarksAfter.findLastIndex(\n\t\t\t\t\t\t\t(m) => m.type === 'superscript',\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst lastSubIdx: number = storedMarksAfter.findLastIndex(\n\t\t\t\t\t\t\t(m) => m.type === 'subscript',\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst removeType: string = lastSupIdx > lastSubIdx ? 'subscript' : 'superscript';\n\n\t\t\t\t\t\tstoredMarksAfter = storedMarksAfter.filter((m) => m.type !== removeType);\n\t\t\t\t\t\tpatched = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tnext(patched ? { ...tr, steps: patchedSteps, storedMarksAfter } : tr);\n\t\t\t},\n\t\t\t{ name: 'super-sub:exclusivity' },\n\t\t);\n\t}\n\n\t/**\n\t * Registers disabled toolbar buttons for marks whose feature is disabled\n\t * but whose toolbar button is explicitly requested.\n\t */\n\tprivate registerDisabledToolbarItems(context: PluginContext): void {\n\t\tif (!this.config.toolbar) return;\n\n\t\tfor (const def of MARK_DEFINITIONS) {\n\t\t\tconst featureEnabled: boolean = this.config[def.configKey];\n\t\t\tconst toolbarVisible: boolean = this.config.toolbar[def.configKey] ?? true;\n\n\t\t\tif (!featureEnabled && toolbarVisible) {\n\t\t\t\tconst label: string =\n\t\t\t\t\tdef.type === 'superscript' ? this.locale.superscriptLabel : this.locale.subscriptLabel;\n\t\t\t\tcontext.registerToolbarItem({\n\t\t\t\t\tid: def.type,\n\t\t\t\t\tgroup: 'format',\n\t\t\t\t\ticon: def.icon,\n\t\t\t\t\tlabel,\n\t\t\t\t\tcommand: toCommandName(def.type),\n\t\t\t\t\tisEnabled: () => false,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate isToolbarVisible(configKey: keyof Omit<SuperSubConfig, 'toolbar' | 'locale'>): boolean {\n\t\tif (!this.config.toolbar) return true;\n\t\treturn this.config.toolbar[configKey] ?? true;\n\t}\n}\n"],"mappings":"+MAeA,IAAa,EAAsC,CAClD,iBAAkB,cAClB,mBAAqB,GAAqB,gBAAgB,KAC1D,eAAgB,YAChB,iBAAmB,GAAqB,cAAc,MAKjD,iBAA4E,OAAA,OAAA,CAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA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keyword","string","comment","number","function","operator","punctuation","boolean","null","property","type","annotation","tag","attribute","constant","regex"];function n(t){return"string"==typeof t?t:t.color}function o(t){return"object"==typeof t?t.fontStyle:void 0}function e(t){return"object"==typeof t?t.fontWeight:void 0}export{e as i,n,o as r,t};
2
- //# sourceMappingURL=SyntaxTokenTypes-CY2-rJCA.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SyntaxTokenTypes-CY2-rJCA.mjs","names":[],"sources":["../../src/editor/theme/SyntaxTokenTypes.ts"],"sourcesContent":["/**\n * Canonical syntax token type list and style resolution utilities.\n *\n * Single source of truth for all syntax highlighting token types.\n * Adding a new token type here automatically propagates to themes,\n * CSS variables, and token CSS classes.\n */\n\n/** All supported syntax token types. */\nexport const SYNTAX_TOKEN_TYPES = [\n\t'keyword',\n\t'string',\n\t'comment',\n\t'number',\n\t'function',\n\t'operator',\n\t'punctuation',\n\t'boolean',\n\t'null',\n\t'property',\n\t'type',\n\t'annotation',\n\t'tag',\n\t'attribute',\n\t'constant',\n\t'regex',\n] as const;\n\n/** A syntax token type from the canonical list. */\nexport type SyntaxTokenType = (typeof SYNTAX_TOKEN_TYPES)[number];\n\n/** Per-token style: color plus optional font weight and style. */\nexport interface TokenStyle {\n\treadonly color: string;\n\treadonly fontWeight?: 'normal' | 'bold';\n\treadonly fontStyle?: 'normal' | 'italic';\n}\n\n/** A token style value is either a plain color string or a full TokenStyle object. */\nexport type TokenStyleValue = string | TokenStyle;\n\n/** Extracts the color from a TokenStyleValue. */\nexport function resolveTokenColor(value: TokenStyleValue): string {\n\treturn typeof value === 'string' ? value : value.color;\n}\n\n/** Extracts the font-style from a TokenStyleValue, or undefined if not set. */\nexport function resolveTokenFontStyle(value: TokenStyleValue): string | undefined {\n\treturn typeof value === 'object' ? value.fontStyle : undefined;\n}\n\n/** Extracts the font-weight from a TokenStyleValue, or undefined if not set. */\nexport function resolveTokenFontWeight(value: TokenStyleValue): string | undefined {\n\treturn typeof value === 'object' ? value.fontWeight : undefined;\n}\n"],"mappings":"AASA,IAAa,EAAqB,CACjC,UACA,SACA,UACA,SACA,WACA,WACA,cACA,UACA,OACA,WACA,OACA,aACA,MACA,YACA,WACA,SAiBD,SAAgB,EAAkB,GACjC,MAAwB,iBAAV,EAAqB,EAAQ,EAAM,MAIlD,SAAgB,EAAsB,GACrC,MAAwB,iBAAV,EAAqB,EAAM,eAAY,EAItD,SAAgB,EAAuB,GACtC,MAAwB,iBAAV,EAAqB,EAAM,gBAAa"}
@@ -1,2 +0,0 @@
1
- import{a as t,c as e,d as n,l as o,r,s as l}from"./Document-DnPKbcPE.mjs";import{c as i,l as s,o as a,r as c,t as d,u}from"./Selection-B14e7gd0.mjs";import{a as b}from"./TypeBrands-BQR8dEYU.mjs";import{r as p}from"./HTMLUtils-BLwp5G4f.mjs";import{t as h}from"./CommandHelpers-G6M-qXJR.mjs";import{a as m,o as f,s as g}from"./StyleRuntime-Bwde5icB.mjs";import{n as v}from"./Plugin-C4cBw3bs.mjs";import{i as x,t as w}from"./Decoration-D-yB-H5v.mjs";import{i as C}from"./PluginHelpers-BZU5rE44.mjs";import{t as I}from"./KeyboardNav-IMWHB6wc.mjs";import{r as y}from"./PopupPositioning-BdSCai19.mjs";import{i as k}from"./ColorValidation-rOrJxBBt.mjs";import{n as S,t as L}from"./ColorGrid-CcF0bH26.mjs";function A(){const t=r(b("paragraph"),[l("")],e());return r(b("table_cell"),[t],e())}function R(t,e){const n=t.getNodePath(e);if(!n)return null;let r=null,l=null,i=null,s=null;for(const o of n){const e=t.getBlock(o);e&&("table"===e.type?(r=o,l=e):"table_row"===e.type?i=o:"table_cell"===e.type&&(s=o))}if("table_cell"===t.getBlock(e)?.type&&(s=e),!(r&&l&&s&&i))return null;const a=t.doc.children.findIndex(t=>t.id===r),c=o(l),d=c.findIndex(t=>t.id===i);if(-1===d)return null;const u=c[d];if(!u)return null;const b=o(u),p=b.findIndex(t=>t.id===s);if(-1===p)return null;const h=b.length,m=c.length;return{tableId:r,tableIndex:a,rowId:i,rowIndex:d,cellId:s,colIndex:p,totalRows:m,totalCols:h}}function B(t,e,n,r){const l=t.getBlock(e);if(!l)return null;const i=o(l)[n];return i?o(i)[r]?.id??null:null}function E(t,e){const n=t.getBlock(e);if(!n)return e;const r=o(n)[0];if(!r)return e;let l=r;for(;;){const t=o(l)[0];if(!t)return l.id;l=t}}function T(t,e){const n=t.getBlock(e);if(!n)return e;const r=o(n),l=r[r.length-1];if(!l)return e;let i=l;for(;;){const t=o(i),e=t[t.length-1];if(!e)return i.id;i=e}}function M(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 N={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"},H=/* @__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-CaE825oi.mjs"),"./locales/de.ts":()=>import("./de-D8gRtvU4.mjs"),"./locales/es.ts":()=>import("./es-DA_zUbSs.mjs"),"./locales/fr.ts":()=>import("./fr-Bj_GziCv.mjs"),"./locales/hi.ts":()=>import("./hi-CWX5sDy1.mjs"),"./locales/pt.ts":()=>import("./pt-DiYv0Ubf.mjs"),"./locales/ru.ts":()=>import("./ru-CDm5R5CV.mjs"),"./locales/zh.ts":()=>import("./zh-fAa_AbWI.mjs")});async function P(t){if("en"===t)return N;const e=H[`./locales/${t}.ts`];if(!e)return N;try{return(await e()).default}catch{return N}}var D=["#000000","#434343","#666666","#999999","#b7b7b7","#cccccc","#d9d9d9","#efefef","#980000","#cc0000","#e69138","#f1c232","#6aa84f","#45818e","#3c78d8","#3d85c6","#674ea7","#a64d79","#0b5394","#38761d"];function z(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 $(t,e,n=N){const o=t.getState();if(!u(o.selection))return!1;const r=R(o,o.selection.anchor.blockId);if(!r)return!1;const l=z(o,r.tableId,e);if(!l)return!1;t.dispatch(l);const i="none"===e?"none":S(e);return t.announce(n.announceBorderColorSet(i)),!0}function j(t,e=N){const n=t.getState();if(!u(n.selection))return!1;const o=R(n,n.selection.anchor.blockId);if(!o)return!1;const r=z(n,o.tableId,void 0);return!!r&&(t.dispatch(r),t.announce(e.announceBorderReset),!0)}function _(t,e){const n=t.getBlock(e);if(n)return n.attrs?.borderColor}function V(t,e,n,o,r=N){t.classList.add("notectl-color-picker");const l=_(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(),j(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(),$(e,"none",r),o()}),s.addEventListener("keydown",t=>{"Escape"===t.key&&(t.preventDefault(),o())}),t.appendChild(s),L(t,{colors:D,columns:5,ariaLabel:r.borderColorPicker,ariaLabelPrefix:"",activeColor:l??null,swatchLabel:r.borderSwatchLabel,titleAsName:!0,onSelect:t=>{$(e,t,r),o()},onClose:o})}function O(t,n,l){const i=t.getBlock(n);if(!i)return null;const s=o(i),a=s[0]?o(s[0]).length:0;if(0===a)return null;const c=function(t){const n=[];for(let e=0;e<t;e++)n.push(A());return r(b("table_row"),n,e())}(a),u=t.transaction("command").insertNode([n],l,c),p=o(c)[0],h=p?o(p)[0]:void 0;return h?u.setSelection(d(h.id,0)):p&&u.setSelection(d(p.id,0)),u.build()}function q(t,e,n){const r=t.getBlock(e);if(!r)return null;const l=o(r),i=t.transaction("command");for(const o of l){const t=A();i.insertNode([e,o.id],n,t)}return i.setSelection(t.selection),i.build()}function F(t,e,n,r=0){const l=t.getBlock(e);if(!l)return null;if(o(l).length<=1)return Y(t,e);const i=t.transaction("command").removeNode([e],n),s=B(t,e,n>0?n-1:1,r);if(s){const e=E(t,s);i.setSelection(d(e,0))}return i.build()}function Z(t,e,n,r=0){const l=t.getBlock(e);if(!l)return null;const i=o(l);if((i[0]?o(i[0]).length:0)<=1)return Y(t,e);const s=t.transaction("command");for(let o=i.length-1;o>=0;o--){const t=i[o];t&&s.removeNode([e,t.id],n)}const a=B(t,e,r,n>0?n-1:1);if(a){const e=E(t,a);s.setSelection(d(e,0))}return s.build()}function Y(n,o){const r=n.doc.children.findIndex(t=>t.id===o);if(-1===r)return null;if(1===n.doc.children.length){const o=t(e());return n.transaction("command").insertNode([],0,o).removeNode([],1).setSelection(d(o.id,0)).build()}const l=n.transaction("command").removeNode([],r),i=n.doc.children[r+1];if(i){const t=h(n,i.id,"start");if(t)return l.setSelection(t),l.build()}const s=n.doc.children[r-1];if(s){const t=h(n,s.id,"end");t&&l.setSelection(t)}return l.build()}function K(t,n,l){const i=t.getState(),s=i.selection;if(!u(s))return!1;const a=s.anchor.blockId;let c=-1;for(let e=0;e<i.doc.children.length;e++){const t=i.doc.children[e];if(!t)continue;if(t.id===a){c=e;break}const n=i.getNodePath(a);if(n&&n[0]===t.id){c=e;break}}-1===c&&(c=i.doc.children.length-1);const p=function(t,n){const o=e(),l=[];for(let i=0;i<t;i++){const t=[];for(let e=0;e<n;e++)t.push(A());l.push(r(b("table_row"),t,e()))}return r(b("table"),l,o)}(n,l),h=r(b("paragraph")),m=c+1,f=i.transaction("command").insertNode([],m,p).insertNode([],m+1,h),g=o(p)[0],v=g?o(g)[0]:void 0,x=v?o(v)[0]:void 0;return x?f.setSelection(d(x.id,0)):v&&f.setSelection(d(v.id,0)),t.dispatch(f.build()),!0}function X(t,e){const n=t.getState();if(!u(n.selection))return!1;const o=R(n,n.selection.anchor.blockId);if(!o)return!1;const r=O(n,o.tableId,o.rowIndex+1);return!!r&&(t.dispatch(r),t.announce(e.announceRowInsertedBelow),!0)}function W(t,e,n){const o=t.getState();if(!u(o.selection))return!1;const r=R(o,o.selection.anchor.blockId);if(!r)return!1;const l="left"===e?r.colIndex:r.colIndex+1,i=q(o,r.tableId,l);return!!i&&(t.dispatch(i),t.announce(n.announceColumnInserted(e)),!0)}function U(t,e){t.registerCommand("insertTable",()=>K(t,3,3)),t.registerCommand("addRowAbove",()=>function(t,e){const n=t.getState();if(!u(n.selection))return!1;const o=R(n,n.selection.anchor.blockId);if(!o)return!1;const r=O(n,o.tableId,o.rowIndex);return!!r&&(t.dispatch(r),t.announce(e.announceRowInsertedAbove),!0)}(t,e)),t.registerCommand("addRowBelow",()=>X(t,e)),t.registerCommand("addColumnLeft",()=>function(t,e){return W(t,"left",e)}(t,e)),t.registerCommand("addColumnRight",()=>function(t,e){return W(t,"right",e)}(t,e)),t.registerCommand("deleteRow",()=>function(t,e){const n=t.getState();if(!u(n.selection))return!1;const o=R(n,n.selection.anchor.blockId);if(!o)return!1;const r=F(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=R(n,n.selection.anchor.blockId);if(!o)return!1;const r=Z(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=R(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=R(t,t.selection.anchor.blockId);return e?{tableId:e.tableId}:null}(n);if(!o)return!1;const r=Y(n,o.tableId);return!!r&&(t.dispatch(r),t.announce(e.announceTableDeleted),!0)}(t,e))}function G(t,e,n,o,r,l=N,i){let s=!0,a=null,c=null;const d=document.createElement("div");d.className="notectl-table-context-menu",d.setAttribute("role","menu"),d.setAttribute("aria-label",l.tableActions),d.setAttribute("contenteditable","false");const u=[];let b=0;const p=function(t){return[{type:"item",label:t.insertRowAbove,command:"addRowAbove"},{type:"item",label:t.insertRowBelow,command:"addRowBelow"},{type:"separator"},{type:"item",label:t.insertColumnLeft,command:"addColumnLeft"},{type:"item",label:t.insertColumnRight,command:"addColumnRight"},{type:"separator"},{type:"item",label:t.deleteRow,command:"deleteRow"},{type:"item",label:t.deleteColumn,command:"deleteColumn"},{type:"separator"},{type:"submenu",label:t.borderColorLabel,id:"borderColor"},{type:"separator"},{type:"item",label:t.deleteTable,command:"deleteTable"}]}(l);for(const I of p){if("separator"===I.type){const t=document.createElement("div");t.setAttribute("role","separator"),d.appendChild(t);continue}const t=document.createElement("button");t.type="button",t.setAttribute("role","menuitem"),t.textContent=I.label,"submenu"===I.type&&(t.dataset.submenu=I.id,t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded","false")),"item"===I.type&&(t.dataset.command=I.command),t.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation()}),t.addEventListener("click",n=>{n.stopPropagation(),"item"===I.type?(e.executeCommand(I.command),C()):"submenu"===I.type&&m(t)}),u.push(t),d.appendChild(t)}const h=document.createElement("div");function m(o){if(f(),o.setAttribute("aria-expanded","true"),i)c=i.open({anchor:o,position:"right",referenceNode:d,parent:{close:()=>C(),getElement:()=>d},onClose:()=>{c=null,a=null,g()},content:(t,r)=>{t.className="notectl-table-context-menu",t.setAttribute("contenteditable","false"),a=t,t.addEventListener("keydown",t=>{t.stopPropagation();const e="rtl"===getComputedStyle(d).direction?"ArrowRight":"ArrowLeft";t.key===e&&(t.preventDefault(),r(),o.focus())}),V(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())}),V(a,e,n,()=>C(),l),t.appendChild(a);const r=d.getBoundingClientRect(),i="rtl"===getComputedStyle(d).direction;y(a,r,{position:"right",isRtl:i}),requestAnimationFrame(()=>{(a?.querySelector("button"))?.focus()})}}function f(){c?(c.close(),c=null,a=null):a&&(a.remove(),a=null),g()}function g(){for(const t of u)t.dataset.submenu&&t.setAttribute("aria-expanded","false")}h.className="notectl-table-context-menu__hint",h.setAttribute("aria-hidden","true"),h.textContent=l.menuKeyboardHint,d.appendChild(h),I(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,I(u,b),void u[b]?.focus();case"ArrowUp":return t.preventDefault(),b=(b-1+u.length)%u.length,I(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,I(u,b),void u[b]?.focus();case"End":return t.preventDefault(),b=u.length-1,I(u,b),void u[b]?.focus()}}),y(d,o,{position:"below-start"}),t.appendChild(d),u[0]?.focus(),requestAnimationFrame(()=>{s&&u[0]&&u[0].focus()});const v=t=>{const e=t.composedPath();e.includes(d)||a&&e.includes(a)||C()};let x=null,w=!1;function C(){s&&(s=!1,f(),d.remove(),null!==x&&(clearTimeout(x),x=null),w&&(document.removeEventListener("mousedown",v,!0),w=!1),r?.())}return x=setTimeout(()=>{x=null,document.addEventListener("mousedown",v,!0),w=!0},0),{isOpen:()=>s,close:C,destroy:C}}function J(t,e){const n=t.getState();if(!u(n.selection))return!1;const o=n.selection,r=R(n,o.anchor.blockId);return!!r&&e(n,o,r)}function Q(t){return J(t,(e,n,o)=>{const r=o.tableIndex+1;if(r>=e.doc.children.length)return!1;const l=e.doc.children[r];if(!l)return!1;const i=e.transaction("command").setSelection(d(l.id,0)).build();return t.dispatch(i),!0})}var tt=null;function et(t,e,n,o){const r=t.getState(),l=B(r,e,n,o);if(!l)return!1;const i=E(r,l),s=r.transaction("command").setSelection(d(i,0)).build();return t.dispatch(s),!0}function nt(t,e,o,r){const l=t.getState(),i=B(l,e,o,r);if(!i)return!1;const s=T(l,i),a=l.getBlock(s);if(!a)return!1;const c=n(a),u=l.transaction("command").setSelection(d(s,c)).build();return t.dispatch(u),!0}function ot(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 rt='<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 lt(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 it(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=lt("ntbl-insert-btn",rt,e);return n.appendChild(o),n}function st(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=rt,n.appendChild(o),n.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation()}),n}function at(t){const e=document.createElement("div");return e.className=t,e.setAttribute("contenteditable","false"),e.setAttribute("data-notectl-no-print",""),e}function ct(t,e){f(t,"none"===e?{backgroundColor:"transparent",border:"1px dashed rgba(128,128,128,0.4)"}:e?{backgroundColor:e,border:"1px solid rgba(0,0,0,0.15)"}:{backgroundColor:"var(--notectl-border)",border:"1px solid rgba(0,0,0,0.15)"})}function dt(t,e,n,o){const r=document.createElement("div");r.className=`ntbl-handle ${t}`,r.dataset.index=String(e);const l=lt("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 ut(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 bt=class{tableId;numRows;numCols;activeRowIndex=-1;activeColIndex=-1;colBar;rowBar;insertLineH;insertLineV;addRowZone;addColZone;deleteTableBtn;borderColorBtn;actionsBtn;contextHint;observer;borderColorPopup=null;activeContextMenu=null;container;tableEl;getState;dispatchFn;pluginContext;locale;onMouseMove=t=>{const e=this.tableEl.getBoundingClientRect(),n=t.clientX-e.left,o=t.clientY-e.top;if(!(n>=-10&&n<=e.width+10&&o>=-10&&o<=e.height+10))return void this.hideInsertLines();const r=function(t,e,n,o){let r=Number.POSITIVE_INFINITY,l=null;for(const a of n){const t=Math.abs(e-a.position);t<r&&t<10&&(r=t,l=a)}let i=Number.POSITIVE_INFINITY,s=null;for(const a of o){const e=Math.abs(t-a.position);e<i&&e<10&&(i=e,s=a)}return l&&(!s||r<=i)?{type:"row",border:l}:s?{type:"col",border:s}:{type:"none",border:null}}(n,o,function(t){const e=t.querySelectorAll(":scope > tbody > tr"),n=t.offsetTop,o=[];for(let r=1;r<e.length;r++){const t=e[r];t&&o.push({position:t.offsetTop-n,index:r})}return o}(this.tableEl),function(t,e){if(e<=1)return[];const n=t/e,o=[];for(let r=1;r<e;r++)o.push({position:Math.round(n*r),index:r});return o}(this.tableEl.offsetWidth,this.numCols));"row"===r.type&&r.border?(this.showHorizontalLine(r.border),this.hideVerticalLine()):"col"===r.type&&r.border?(this.showVerticalLine(r.border),this.hideHorizontalLine()):this.hideInsertLines()};onMouseLeave=()=>{this.hideInsertLines()};constructor(t,e,n,r,l,i,s=N){if(this.container=t,this.tableEl=e,this.getState=r,this.dispatchFn=l,this.pluginContext=i??null,this.locale=s,this.tableId=n.id,this.numRows=o(n).length,this.numCols=this.countCols(n),this.colBar=at("ntbl-col-bar"),this.rowBar=at("ntbl-row-bar"),this.insertLineH=it("horizontal",s.insertRow),this.insertLineV=it("vertical",s.insertColumn),this.addRowZone=st("ntbl-add-row",s.addRow),this.addColZone=st("ntbl-add-col",s.addColumn),this.deleteTableBtn=lt("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=_(r(),this.tableId);this.borderColorBtn=function(t,e){const n=lt("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",ct(o,e),n.appendChild(o),n}(s.borderColor,t),this.actionsBtn=function(t){const e=lt("ntbl-actions-btn",'<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="currentColor"><circle cx="12" cy="5" r="2"/><circle cx="12" cy="12" r="2"/><circle cx="12" cy="19" r="2"/></svg>',t);return e.setAttribute("data-notectl-no-print",""),e}(s.tableActionsHint)}else this.borderColorBtn=null,this.actionsBtn=null;t.append(this.colBar,this.rowBar,this.insertLineH,this.insertLineV,this.addRowZone,this.addColZone,this.deleteTableBtn),this.borderColorBtn&&t.appendChild(this.borderColorBtn),this.actionsBtn&&t.appendChild(this.actionsBtn),this.contextHint=function(t){const e=document.createElement("div");return e.className="ntbl-context-hint",e.setAttribute("aria-hidden","true"),e.setAttribute("contenteditable","false"),e.setAttribute("data-notectl-no-print",""),e.textContent=t,e}(s.contextMenuHint),t.appendChild(this.contextHint),this.rebuildColHandles(),this.rebuildRowHandles(),this.bindEventListeners(),this.observer=new ResizeObserver(()=>{this.positionControls()}),this.observer.observe(e),requestAnimationFrame(()=>this.positionControls())}update(t){this.tableId=t.id;const e=o(t).length,n=this.countCols(t);if(e===this.numRows&&n===this.numCols||(this.numRows=e,this.numCols=n,this.rebuildColHandles(),this.rebuildRowHandles()),this.borderColorBtn){const e=this.borderColorBtn.querySelector(".ntbl-border-color-swatch");if(e){const n=t.attrs?.borderColor;ct(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(O(this.getState(),this.tableId,this.activeRowIndex))}),e.addEventListener("click",()=>{this.activeColIndex>=0&&this.dispatchTransaction(q(this.getState(),this.tableId,this.activeColIndex))}),this.addRowZone.addEventListener("click",()=>{this.dispatchTransaction(O(this.getState(),this.tableId,this.numRows))}),this.addColZone.addEventListener("click",()=>{this.dispatchTransaction(q(this.getState(),this.tableId,this.numCols))}),this.deleteTableBtn.addEventListener("click",()=>{this.dispatchTransaction(Y(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=G(this.container,t,this.tableId,n,()=>{this.activeContextMenu=null},this.locale)}toggleBorderColorPopup(t){this.borderColorPopup?this.closeBorderColorPopup():(this.borderColorPopup=document.createElement("div"),this.borderColorPopup.className="notectl-table-context-menu",f(this.borderColorPopup,{position:"absolute",top:"24px",left:"24px",zIndex:"10000"}),this.borderColorPopup.setAttribute("contenteditable","false"),V(this.borderColorPopup,t,this.tableId,()=>{this.closeBorderColorPopup()},this.locale),this.container.appendChild(this.borderColorPopup))}closeBorderColorPopup(){this.borderColorPopup&&(this.borderColorPopup.remove(),this.borderColorPopup=null)}dispatchTransaction(t){t&&this.dispatchFn(t)}countCols(t){const e=o(t);return e[0]?o(e[0]).length:0}positionControls(){!function(t,e,n){const o=t.children;if(0===o.length)return;const r=e/n;for(let l=0;l<o.length;l++){const t=o[l];f(t,{left:`${Math.round(r*l)}px`,width:`${Math.round(r)}px`})}g(t,"width",`${e}px`)}(this.colBar,this.tableEl.offsetWidth,this.numCols),function(t,e){const n=t.children;if(0===n.length)return;const o=e.querySelectorAll(":scope > tbody > tr"),r=e.offsetTop;let l=0;for(let i=0;i<n.length;i++){const t=n[i],e=o[i];if(e){const n=e.offsetTop-r,o=e.offsetHeight;f(t,{top:`${n}px`,height:`${o}px`}),l=n+o}}g(t,"height",`${l}px`)}(this.rowBar,this.tableEl),function(t,e,n,o){const r=ut(n,o),l=n.offsetHeight,i=n.offsetWidth;f(t,{width:`${i}px`,left:`${r.left}px`}),f(e,{height:`${l}px`,top:`${r.top}px`})}(this.addRowZone,this.addColZone,this.tableEl,this.container)}showHorizontalLine(t){this.activeRowIndex=t.index;const e=ut(this.tableEl,this.container);f(this.insertLineH,{top:e.top+t.position-1+"px",left:`${e.left}px`,width:`${this.tableEl.offsetWidth}px`}),this.insertLineH.classList.add("ntbl-insert-line--visible")}showVerticalLine(t){this.activeColIndex=t.index;const e=ut(this.tableEl,this.container);f(this.insertLineV,{left:e.left+t.position-1+"px",top:`${e.top}px`,height:`${this.tableEl.offsetHeight}px`}),this.insertLineV.classList.add("ntbl-insert-line--visible")}hideInsertLines(){this.hideHorizontalLine(),this.hideVerticalLine()}hideHorizontalLine(){this.insertLineH.classList.remove("ntbl-insert-line--visible"),this.activeRowIndex=-1}hideVerticalLine(){this.insertLineV.classList.remove("ntbl-insert-line--visible"),this.activeColIndex=-1}rebuildColHandles(){this.colBar.innerHTML="";for(let t=0;t<this.numCols;t++){const e=dt("ntbl-col-handle",t,this.locale.deleteColumn,t=>{this.dispatchTransaction(Z(this.getState(),this.tableId,t))});this.colBar.appendChild(e)}}rebuildRowHandles(){this.rowBar.innerHTML="";for(let t=0;t<this.numRows;t++){const e=dt("ntbl-row-handle",t,this.locale.deleteRow,t=>{this.dispatchTransaction(F(this.getState(),this.tableId,t))});this.rowBar.appendChild(e)}}};function pt(t,e){"none"===e?(g(t,"--ntbl-border-color","transparent"),t.classList.add("notectl-table--borderless")):e?(g(t,"--ntbl-border-color",e),t.classList.remove("notectl-table--borderless")):(m(t,"--ntbl-border-color"),t.classList.remove("notectl-table--borderless"))}var ht=new v("tableSelection"),mt={maxPickerRows:8,maxPickerCols:8},ft="border-collapse: collapse; width: 100%; table-layout: fixed",gt="border: 1px solid var(--ntbl-bc, #d0d0d0); padding: 8px 12px; vertical-align: top",vt=class{id="table";name="Table";priority=40;config;locale;selectionService=null;cleanupMouseSelection=null;context=null;constructor(t){this.config={...mt,...t}}async init(t){this.locale=await C(t,this.config.locale,N,P),t.registerStyleSheet('\n/* Table */\n.notectl-table-wrapper {\n\tmargin: 8px 0;\n\toverflow-x: auto;\n\tposition: relative;\n}\n\n.notectl-table {\n\twidth: 100%;\n\tborder-collapse: collapse;\n\ttable-layout: fixed;\n}\n\n.notectl-table td {\n\tborder: 1px solid var(--ntbl-border-color, var(--notectl-border));\n\tpadding: 8px 12px;\n\tmin-width: 60px;\n\tvertical-align: top;\n\tmin-height: 1.6em;\n}\n\n.notectl-table--borderless td {\n\tborder: 1px dashed rgba(128, 128, 128, 0.15);\n}\n\n@media print {\n\t.notectl-table--borderless td {\n\t\tborder: none;\n\t}\n}\n\n.notectl-table td:focus-within {\n\toutline: 2px solid var(--notectl-primary);\n\toutline-offset: -2px;\n}\n\n.notectl-table-cell--selected {\n\tbackground: var(--notectl-primary-muted);\n}\n\n/* Table Context Menu */\n.notectl-table-context-menu {\n\tbackground: var(--notectl-surface-overlay);\n\tborder: 1px solid var(--notectl-border);\n\tborder-radius: 6px;\n\tbox-shadow: 0 4px 12px var(--notectl-shadow);\n\tpadding: 4px 0;\n\tmin-width: 180px;\n\tz-index: 10000;\n}\n\n.notectl-table-context-menu button {\n\tdisplay: block;\n\twidth: 100%;\n\tpadding: 8px 12px;\n\ttext-align: start;\n\tborder: none;\n\tbackground: none;\n\tcursor: pointer;\n\tfont-size: 14px;\n\tcolor: var(--notectl-fg);\n\tfont-family: inherit;\n}\n\n.notectl-table-context-menu button:hover {\n\tbackground: var(--notectl-hover-bg);\n}\n\n.notectl-table-context-menu hr {\n\tborder: none;\n\tborder-top: 1px solid var(--notectl-border);\n\tmargin: 4px 0;\n}\n\n/* === Table Controls === */\n\n/* Outer container for table + controls */\n.ntbl-container {\n\tposition: relative;\n\tmargin: 8px 0;\n\tpadding-block-start: 24px;\n\tpadding-inline-start: 24px;\n}\n\n.ntbl-container .notectl-table-wrapper {\n\tmargin: 0;\n}\n\n.ntbl-container.notectl-table--selected .notectl-table-wrapper {\n\toutline: 2px solid var(--notectl-primary-fg);\n\toutline-offset: 2px;\n\tborder-radius: 6px;\n}\n\n/* --- Column Handle Bar --- */\n.ntbl-col-bar {\n\tposition: absolute;\n\ttop: 0;\n\tinset-inline-start: 24px;\n\theight: 20px;\n\tdisplay: flex;\n\topacity: 0;\n\ttransition: opacity 0.2s ease;\n\tz-index: 3;\n\tpointer-events: none;\n}\n\n.ntbl-container:hover .ntbl-col-bar,\n.ntbl-container:focus-within .ntbl-col-bar {\n\topacity: 1;\n\tpointer-events: auto;\n}\n\n.ntbl-container.notectl-table--selected .ntbl-col-bar {\n\topacity: 1;\n\tpointer-events: auto;\n}\n\n/* --- Row Handle Bar --- */\n.ntbl-row-bar {\n\tposition: absolute;\n\ttop: 24px;\n\tinset-inline-start: 0;\n\twidth: 20px;\n\tdisplay: flex;\n\tflex-direction: column;\n\topacity: 0;\n\ttransition: opacity 0.2s ease;\n\tz-index: 3;\n\tpointer-events: none;\n}\n\n.ntbl-container:hover .ntbl-row-bar,\n.ntbl-container:focus-within .ntbl-row-bar {\n\topacity: 1;\n\tpointer-events: auto;\n}\n\n.ntbl-container.notectl-table--selected .ntbl-row-bar {\n\topacity: 1;\n\tpointer-events: auto;\n}\n\n/* --- Handle (shared base) --- */\n.ntbl-handle {\n\tposition: absolute;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tcursor: pointer;\n\ttransition: background 0.15s ease;\n\tborder-radius: 3px;\n}\n\n.ntbl-col-handle {\n\theight: 100%;\n\tbackground: var(--notectl-hover-bg);\n\tborder-radius: 4px 4px 0 0;\n}\n\n.ntbl-col-handle:hover {\n\tbackground: var(--notectl-border);\n}\n\n.ntbl-row-handle {\n\twidth: 100%;\n\tbackground: var(--notectl-hover-bg);\n\tborder-start-start-radius: 4px;\n\tborder-end-start-radius: 4px;\n}\n\n.ntbl-row-handle:hover {\n\tbackground: var(--notectl-border);\n}\n\n/* --- Handle Delete Button --- */\n.ntbl-handle-delete {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 16px;\n\theight: 16px;\n\tborder: none;\n\tbackground: transparent;\n\tcolor: var(--notectl-fg-muted);\n\tcursor: pointer;\n\tborder-radius: 3px;\n\tpadding: 0;\n\topacity: 0;\n\ttransform: scale(0.7);\n\ttransition: opacity 0.15s, transform 0.15s,\n\t\tbackground 0.15s, color 0.15s;\n}\n\n.ntbl-handle:hover .ntbl-handle-delete,\n.ntbl-handle:focus-within .ntbl-handle-delete {\n\topacity: 1;\n\ttransform: scale(1);\n}\n\n.ntbl-handle-delete:hover,\n.ntbl-handle-delete:focus-visible {\n\tbackground: var(--notectl-danger-muted);\n\tcolor: var(--notectl-danger);\n}\n\n.ntbl-handle-delete:focus-visible {\n\toutline: none;\n\tbox-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n/* --- Insert Lines --- */\n.ntbl-insert-line {\n\tposition: absolute;\n\tpointer-events: none;\n\topacity: 0;\n\ttransition: opacity 0.15s ease;\n\tz-index: 6;\n}\n\n.ntbl-insert-line--visible {\n\topacity: 1;\n\tpointer-events: auto;\n}\n\n.ntbl-insert-line--horizontal {\n\theight: 2px;\n\tbackground: linear-gradient(\n\t\t90deg,\n\t\ttransparent,\n\t\tvar(--notectl-primary) 8%,\n\t\tvar(--notectl-primary) 92%,\n\t\ttransparent\n\t);\n\tbox-shadow: 0 0 6px var(--notectl-focus-ring);\n}\n\n.ntbl-insert-line--vertical {\n\twidth: 2px;\n\tbackground: linear-gradient(\n\t\t180deg,\n\t\ttransparent,\n\t\tvar(--notectl-primary) 8%,\n\t\tvar(--notectl-primary) 92%,\n\t\ttransparent\n\t);\n\tbox-shadow: 0 0 6px var(--notectl-focus-ring);\n}\n\n/* --- Insert Button on Line --- */\n.ntbl-insert-btn {\n\tposition: absolute;\n\twidth: 20px;\n\theight: 20px;\n\tborder-radius: 50%;\n\tbackground: var(--notectl-surface-raised);\n\tborder: 2px solid var(--notectl-primary);\n\tcolor: var(--notectl-primary);\n\tcursor: pointer;\n\tpointer-events: all;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tpadding: 0;\n\tbox-shadow: 0 2px 8px var(--notectl-focus-ring);\n\ttransition: background 0.15s, color 0.15s,\n\t\ttransform 0.15s, box-shadow 0.15s;\n}\n\n.ntbl-insert-line--horizontal .ntbl-insert-btn {\n\tleft: 50%;\n\ttop: -9px;\n\ttransform: translateX(-50%);\n}\n\n.ntbl-insert-line--vertical .ntbl-insert-btn {\n\ttop: 50%;\n\tinset-inline-start: -9px;\n\ttransform: translateY(-50%);\n}\n\n.ntbl-insert-btn:hover,\n.ntbl-insert-btn:focus-visible {\n\tbackground: var(--notectl-primary);\n\tcolor: var(--notectl-primary-fg);\n\tbox-shadow: 0 2px 12px var(--notectl-focus-ring);\n}\n\n.ntbl-insert-btn:focus-visible {\n\toutline: none;\n\tbox-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n.ntbl-insert-line--horizontal .ntbl-insert-btn:hover {\n\ttransform: translateX(-50%) scale(1.2);\n}\n\n.ntbl-insert-line--vertical .ntbl-insert-btn:hover {\n\ttransform: translateY(-50%) scale(1.2);\n}\n\n/* --- Add Row / Add Column Zones --- */\n.ntbl-add-zone {\n\tposition: absolute;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tcursor: pointer;\n\tuser-select: none;\n\topacity: 0;\n\ttransition: opacity 0.2s ease, background 0.2s ease,\n\t\tborder-color 0.2s ease;\n}\n\n.ntbl-container:hover .ntbl-add-zone,\n.ntbl-container:focus-within .ntbl-add-zone {\n\topacity: 1;\n}\n\n.ntbl-container.notectl-table--selected .ntbl-add-zone {\n\topacity: 1;\n}\n\n.ntbl-delete-table-btn {\n\tposition: absolute;\n\ttop: 0;\n\tinset-inline-start: 0;\n\twidth: 20px;\n\theight: 20px;\n\tborder: 1px solid var(--notectl-danger);\n\tborder-radius: 4px;\n\tbackground: var(--notectl-surface-raised);\n\tcolor: var(--notectl-danger);\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\topacity: 0;\n\ttransition: opacity 0.2s ease, background 0.15s, border-color 0.15s;\n\tz-index: 7;\n}\n\n.ntbl-container:hover .ntbl-delete-table-btn,\n.ntbl-container:focus-within .ntbl-delete-table-btn,\n.ntbl-container.notectl-table--selected .ntbl-delete-table-btn {\n\topacity: 1;\n}\n\n.ntbl-delete-table-btn:hover,\n.ntbl-delete-table-btn:focus-visible {\n\tbackground: var(--notectl-danger-muted);\n\tborder-color: var(--notectl-danger);\n}\n\n.ntbl-delete-table-btn:focus-visible {\n\toutline: none;\n\tbox-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n/* --- Context Menu Discovery Hint --- */\n.ntbl-context-hint {\n\tposition: absolute;\n\ttop: 4px;\n\tinset-inline-end: 0;\n\tfont-size: 11px;\n\tcolor: var(--notectl-fg-muted);\n\tpadding: 2px 8px;\n\tborder-radius: 4px;\n\topacity: 0;\n\ttransition: opacity 0.2s ease;\n\tpointer-events: none;\n\twhite-space: nowrap;\n\tz-index: 5;\n}\n\n.ntbl-container:hover .ntbl-context-hint,\n.ntbl-container:focus-within .ntbl-context-hint,\n.ntbl-container.notectl-table--selected .ntbl-context-hint {\n\topacity: 1;\n}\n\n/* --- Table Actions Button --- */\n.ntbl-actions-btn {\n\tposition: absolute;\n\ttop: 0;\n\tinset-inline-start: 48px;\n\twidth: 20px;\n\theight: 20px;\n\tborder: 1px solid var(--notectl-border);\n\tborder-radius: 4px;\n\tbackground: var(--notectl-surface-raised);\n\tcolor: var(--notectl-fg-muted);\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\topacity: 0;\n\ttransition: opacity 0.2s ease, background 0.15s, border-color 0.15s;\n\tz-index: 7;\n\tcursor: pointer;\n\tpadding: 0;\n}\n\n.ntbl-container:hover .ntbl-actions-btn,\n.ntbl-container:focus-within .ntbl-actions-btn,\n.ntbl-container.notectl-table--selected .ntbl-actions-btn {\n\topacity: 1;\n}\n\n.ntbl-actions-btn:hover,\n.ntbl-actions-btn:focus-visible {\n\tbackground: var(--notectl-hover-bg);\n\tborder-color: var(--notectl-primary);\n}\n\n.ntbl-actions-btn:focus-visible {\n\toutline: none;\n\tbox-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n/* --- Border Color Button --- */\n.ntbl-border-color-btn {\n\tposition: absolute;\n\ttop: 0;\n\tinset-inline-start: 24px;\n\twidth: 20px;\n\theight: 20px;\n\tborder: 1px solid var(--notectl-border);\n\tborder-radius: 4px;\n\tbackground: var(--notectl-surface-raised);\n\tcolor: var(--notectl-fg-muted);\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\topacity: 0;\n\ttransition: opacity 0.2s ease, background 0.15s, border-color 0.15s;\n\tz-index: 7;\n\tcursor: pointer;\n\tpadding: 0;\n}\n\n.ntbl-container:hover .ntbl-border-color-btn,\n.ntbl-container:focus-within .ntbl-border-color-btn,\n.ntbl-container.notectl-table--selected .ntbl-border-color-btn {\n\topacity: 1;\n}\n\n.ntbl-border-color-btn:hover,\n.ntbl-border-color-btn:focus-visible {\n\tbackground: var(--notectl-hover-bg);\n\tborder-color: var(--notectl-primary);\n}\n\n.ntbl-border-color-btn:focus-visible {\n\toutline: none;\n\tbox-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n.ntbl-border-color-swatch {\n\twidth: 10px;\n\theight: 10px;\n\tborder-radius: 2px;\n\tborder: 1px solid rgba(0, 0, 0, 0.15);\n}\n\n/* --- Context Menu Keyboard Hint --- */\n.notectl-table-context-menu__hint {\n\tpadding: 4px 12px 6px;\n\tfont-size: 11px;\n\tcolor: var(--notectl-fg-muted);\n\tborder-top: 1px solid var(--notectl-border);\n\tmargin-top: 4px;\n\ttext-align: center;\n\tuser-select: none;\n}\n\n/* --- Context Menu Focus --- */\n.notectl-table-context-menu button:focus-visible {\n\toutline: none;\n\tbackground: var(--notectl-primary-muted);\n\tbox-shadow: inset 0 0 0 2px var(--notectl-focus-ring);\n}\n\n.notectl-table-context-menu [role="separator"] {\n\tborder: none;\n\tborder-top: 1px solid var(--notectl-border);\n\tmargin: 4px 0;\n\theight: 0;\n}\n\n.ntbl-add-row {\n\tbottom: 0;\n\theight: 24px;\n\tborder: 1px dashed var(--notectl-border);\n\tborder-end-start-radius: 6px;\n\tborder-end-end-radius: 6px;\n\tborder-block-start: none;\n\tcolor: var(--notectl-fg-muted);\n\ttransform: translateY(100%);\n}\n\n.ntbl-add-row:hover,\n.ntbl-add-row:focus-visible {\n\tbackground: var(--notectl-primary-muted);\n\tborder-color: var(--notectl-primary);\n\tcolor: var(--notectl-primary);\n}\n\n.ntbl-add-row:focus-visible {\n\toutline: none;\n\tbox-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n.ntbl-add-col {\n\tinset-inline-end: 0;\n\ttop: 24px;\n\twidth: 24px;\n\tborder: 1px dashed var(--notectl-border);\n\tborder-start-end-radius: 6px;\n\tborder-end-end-radius: 6px;\n\tborder-inline-start: none;\n\tcolor: var(--notectl-fg-muted);\n\ttransform: translateX(100%);\n}\n\n[dir="rtl"] .ntbl-add-col {\n\ttransform: translateX(-100%);\n}\n\n.ntbl-add-col:hover,\n.ntbl-add-col:focus-visible {\n\tbackground: var(--notectl-primary-muted);\n\tborder-color: var(--notectl-primary);\n\tcolor: var(--notectl-primary);\n}\n\n.ntbl-add-col:focus-visible {\n\toutline: none;\n\tbox-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n.ntbl-add-icon {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\ttransition: transform 0.2s ease;\n}\n\n.ntbl-add-zone:hover .ntbl-add-icon {\n\ttransform: scale(1.15);\n}\n'),this.context=t,this.registerNodeSpecs(t),this.registerNodeViews(t),U(t,this.locale),t.registerCommand("resetTableBorderColor",()=>j(t,this.locale)),function(t,e){t.registerKeymap({Tab:()=>function(t,e){return J(t,(n,o,r)=>r.colIndex<r.totalCols-1?et(t,r.tableId,r.rowIndex,r.colIndex+1):r.rowIndex<r.totalRows-1?et(t,r.tableId,r.rowIndex+1,0):(X(t,e),!0))}(t,e),"Shift-Tab":()=>function(t){return J(t,(e,n,o)=>o.colIndex>0?et(t,o.tableId,o.rowIndex,o.colIndex-1):!(o.rowIndex>0)||et(t,o.tableId,o.rowIndex-1,o.totalCols-1))}(t),Backspace:()=>function(t){return J(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=E(e,o.cellId);return n.anchor.blockId===r&&ot(t,o.tableId)})}(t),Delete:()=>function(t){return J(t,(e,o,r)=>{if(!a(o))return!1;const l=e.getBlock(o.anchor.blockId);if(!l)return!1;const i=n(l);if(o.anchor.offset!==i)return!1;if(r.rowIndex!==r.totalRows-1||r.colIndex!==r.totalCols-1)return!1;const s=T(e,r.cellId);return o.anchor.blockId===s&&ot(t,r.tableId)})}(t),ArrowDown:()=>function(t){return J(t,(e,n,o)=>{const r=T(e,o.cellId);return n.anchor.blockId===r&&(o.rowIndex>=o.totalRows-1?Q(t):et(t,o.tableId,o.rowIndex+1,o.colIndex))})}(t),ArrowUp:()=>function(t){return J(t,(e,n,o)=>{const r=E(e,o.cellId);return n.anchor.blockId===r&&!(o.rowIndex<=0)&&et(t,o.tableId,o.rowIndex-1,o.colIndex)})}(t),ArrowRight:()=>function(t){return J(t,(e,o,r)=>{if(!a(o))return!1;const l=e.getBlock(o.anchor.blockId);if(!l)return!1;const i=n(l);if(o.anchor.offset!==i)return!1;const s=T(e,r.cellId);return o.anchor.blockId===s&&(r.colIndex<r.totalCols-1?et(t,r.tableId,r.rowIndex,r.colIndex+1):!(r.rowIndex<r.totalRows-1)||et(t,r.tableId,r.rowIndex+1,0))})}(t),ArrowLeft:()=>function(t){return J(t,(e,n,o)=>{if(!a(n))return!1;if(0!==n.anchor.offset)return!1;const r=E(e,o.cellId);return n.anchor.blockId===r&&(o.colIndex>0?nt(t,o.tableId,o.rowIndex,o.colIndex-1):!(o.rowIndex>0)||nt(t,o.tableId,o.rowIndex-1,o.totalCols-1))})}(t),Escape:()=>Q(t),"Shift-F10":()=>function(t){return J(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 tt?.close(),tt=G(a,t,o.tableId,s,()=>{tt=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=B(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(ht,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=R(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=R(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=R(t.getState(),l.getAttribute("data-block-id"));i&&i.tableId===o.tableId&&(i.rowIndex===o.row&&i.colIndex===o.col||(n.preventDefault(),e.setSelectedRange({tableId:o.tableId,fromRow:o.row,fromCol:o.col,toRow:i.rowIndex,toCol:i.colIndex})))}function s(){r=!1}return n.addEventListener("mousedown",l),n.addEventListener("mousemove",i),document.addEventListener("mouseup",s),()=>{n.removeEventListener("mousedown",l),n.removeEventListener("mousemove",i),document.removeEventListener("mouseup",s)}}(this.context,this.selectionService))}destroy(){this.cleanupMouseSelection?.(),this.cleanupMouseSelection=null,this.selectionService=null,this.context=null}decorations(t){if(!this.selectionService)return w.empty;if(!this.selectionService.getSelectedRange())return w.empty;const e=t.selection;if(!u(e)||!M(t,e.anchor.blockId))return this.selectionService.clearSelectionSilent(),w.empty;const n=this.selectionService.getSelectedCellIds();if(0===n.length)return w.empty;const o=[];for(const r of n)o.push(x(r,{class:"notectl-table-cell--selected"}));return w.create(o)}registerNodeSpecs(t){t.registerNodeSpec({type:"table",group:"block",content:{allow:["table_row"],min:1},isolating:!0,selectable:!0,toDOM(t){const e=document.createElement("div");return e.className="notectl-table-wrapper",e.setAttribute("data-block-id",t.id),e},toHTML(t,e,n){const o=t.attrs?.borderColor,r=function(t){return t?"none"===t?`${ft}; --ntbl-bc: transparent`:k(t)?`${ft}; --ntbl-bc: ${p(t)}`:ft:ft}(o);return`<table${n?.styleAttr(r)??` style="${r}"`}>${e}</table>`},sanitize:{tags:["table","tbody"]}}),t.registerNodeSpec({type:"table_row",group:"table_content",content:{allow:["table_cell"],min:1},toDOM(t){const e=document.createElement("tr");return e.setAttribute("data-block-id",t.id),e.setAttribute("role","row"),e},toHTML:(t,e)=>`<tr>${e}</tr>`,sanitize:{tags:["tr"]}}),t.registerNodeSpec({type:"table_cell",group:"table_content",content:{allow:["paragraph","list_item","heading","blockquote","image","horizontal_rule"]},isolating:!0,toDOM(t){const e=document.createElement("td");return e.setAttribute("data-block-id",t.id),e.setAttribute("role","cell"),e},toHTML(t,e,n){const o=t.attrs?.colspan??1,r=t.attrs?.rowspan??1,l=[n?.styleAttr(gt)??` style="${gt}"`];return o>1&&l.push(` colspan="${o}"`),r>1&&l.push(` rowspan="${r}"`),`<td${l.join("")}>${e}</td>`},sanitize:{tags:["td"],attrs:["colspan","rowspan"]}})}registerNodeViews(t){t.getSchemaRegistry(),t.registerNodeView("table",function(t,e,n=N){return(t,r,l)=>{const i=document.createElement("div");i.className="ntbl-container",i.setAttribute("data-block-id",t.id),i.setAttribute("data-selectable","true");const s=document.createElement("div");s.className="notectl-table-wrapper";const a=document.createElement("table");a.className="notectl-table",a.setAttribute("role","table");const c=o(t),d=c.length,u=c[0]?o(c[0]).length:0;a.setAttribute("aria-label",n.tableAriaLabel(d,u)),a.setAttribute("aria-description",n.tableAriaDescription);const b=document.createElement("tbody");a.appendChild(b),s.appendChild(a),i.appendChild(s),pt(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 bt(t,e,n,o,r,l,i)}(i,a,t,r,l,e,n);let m=null,f=t.id;const g=t=>{if(!e)return;t.preventDefault(),t.stopPropagation(),m?.close();const o=new DOMRect(t.clientX,t.clientY,0,0);m=G(i,e,f,o,()=>{m=null},n)};return a.addEventListener("contextmenu",g),{dom:i,contentDOM:b,update(t){if("table"!==t.type)return!1;f=t.id,i.setAttribute("data-block-id",t.id),i.setAttribute("data-selectable","true");const e=o(t),r=e.length,l=e[0]?o(e[0]).length:0;return a.setAttribute("aria-label",n.tableAriaLabel(r,l)),pt(a,t.attrs?.borderColor),h.update(t),!1},destroy(){m?.destroy(),a.removeEventListener("contextmenu",g),h.destroy()},selectNode(){i.classList.add("notectl-table--selected")},deselectNode(){i.classList.remove("notectl-table--selected")}}}}(0,t,this.locale)),t.registerNodeView("table_row",(t,e,n)=>{const o=document.createElement("tr");return o.setAttribute("data-block-id",t.id),o.setAttribute("role","row"),{dom:o,contentDOM:o,update:t=>("table_row"!==t.type||o.setAttribute("data-block-id",t.id),!1),destroy(){}}}),t.registerNodeView("table_cell",(t,e,n)=>{const o=document.createElement("td");o.setAttribute("data-block-id",t.id),o.setAttribute("role","cell");const r=t.attrs?.colspan??1,l=t.attrs?.rowspan??1;r>1&&(o.colSpan=r),l>1&&(o.rowSpan=l);const i=t.attrs?.align;return i&&"left"!==i&&g(o,"textAlign",i),{dom:o,contentDOM:o,update(t){if("table_cell"!==t.type)return!1;o.setAttribute("data-block-id",t.id);const e=t.attrs?.colspan??1,n=t.attrs?.rowspan??1;return e>1?o.colSpan=e:o.removeAttribute("colspan"),n>1?o.rowSpan=n:o.removeAttribute("rowspan"),!1},destroy(){}}})}registerToolbarItem(t){const e=this.config.maxPickerRows??8,n=this.config.maxPickerCols??8;t.registerToolbarItem({id:"table",group:"insert",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 3h18v18H3V3zm2 2v4h6V5H5zm8 0v4h6V5h-6zm-8 6v4h6v-4H5zm8 0v4h6v-4h-6zm-8 6v4h6v-4H5zm8 0v4h6v-4h-6z"/></svg>',label:this.locale.insertTable,tooltip:this.locale.insertTable,command:"insertTable",popupType:"gridPicker",popupConfig:{maxRows:e,maxCols:n,onSelect:(e,n)=>{K(t,e,n)}},isActive:t=>!!u(t.selection)&&M(t,t.selection.anchor.blockId)})}};export{ht as n,vt as t};
2
- //# sourceMappingURL=TablePlugin-BHpp6h9H.mjs.map