@notectl/core 2.4.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (757) hide show
  1. package/README.md +1 -1
  2. package/dist/chunks/AlignmentPlugin-C26pIVcw.mjs +2 -0
  3. package/dist/chunks/AlignmentPlugin-C26pIVcw.mjs.map +1 -0
  4. package/dist/chunks/AttrRegistry-Di936wMv.mjs.map +1 -1
  5. package/dist/chunks/AttributedMarkCommands-DKHuhZA7.mjs.map +1 -1
  6. package/dist/chunks/BidiIsolationPlugin-nWd1NEF-.mjs +2 -0
  7. package/dist/chunks/BidiIsolationPlugin-nWd1NEF-.mjs.map +1 -0
  8. package/dist/chunks/BlockAlignment-BqyBQ4uV.mjs.map +1 -1
  9. package/dist/chunks/BlockInsertion-CXfXqUZl.mjs +2 -0
  10. package/dist/chunks/BlockInsertion-CXfXqUZl.mjs.map +1 -0
  11. package/dist/chunks/BlockTypePickerRegistry-BTET9jM-.mjs.map +1 -1
  12. package/dist/chunks/BlockquotePlugin-Bag42Zc0.mjs +2 -0
  13. package/dist/chunks/BlockquotePlugin-Bag42Zc0.mjs.map +1 -0
  14. package/dist/chunks/CSSValueEquivalence-DeyUKPQ7.mjs.map +1 -1
  15. package/dist/chunks/CaretNavigationPlugin-DUAoHygg.mjs +2 -0
  16. package/dist/chunks/CaretNavigationPlugin-DUAoHygg.mjs.map +1 -0
  17. package/dist/chunks/CodeBlockPlugin-Dk_J8NAl.mjs +2 -0
  18. package/dist/chunks/CodeBlockPlugin-Dk_J8NAl.mjs.map +1 -0
  19. package/dist/chunks/ColorGrid-DAs0--ty.mjs.map +1 -1
  20. package/dist/chunks/ColorPickerPopup-B6340f3p.mjs.map +1 -1
  21. package/dist/chunks/ColorValidation-ZBKZ_gTr.mjs.map +1 -1
  22. package/dist/chunks/Commands-vqbwh6Ic.mjs +2 -0
  23. package/dist/chunks/Commands-vqbwh6Ic.mjs.map +1 -0
  24. package/dist/chunks/ContentModel-dkGOh3N7.mjs +2 -0
  25. package/dist/chunks/ContentModel-dkGOh3N7.mjs.map +1 -0
  26. package/dist/chunks/CursorMarks-CqHLzGNI.mjs.map +1 -1
  27. package/dist/chunks/Decoration-BoFcdSXk.mjs.map +1 -1
  28. package/dist/chunks/DirectionDetection-a-1iksmh.mjs.map +1 -1
  29. package/dist/chunks/DirectionIcons-Bbawl9ei.mjs.map +1 -1
  30. package/dist/chunks/Document-ssR6hBzG.mjs.map +1 -1
  31. package/dist/chunks/DocumentParser-D4g5npEi.mjs +2 -0
  32. package/dist/chunks/DocumentParser-D4g5npEi.mjs.map +1 -0
  33. package/dist/chunks/DomUtils-Bf7JLFlx.mjs.map +1 -1
  34. package/dist/chunks/EditorEventBoundary-zpYRxryo.mjs.map +1 -1
  35. package/dist/chunks/EditorUI-DrQI95FW.mjs +2 -0
  36. package/dist/chunks/EditorUI-DrQI95FW.mjs.map +1 -0
  37. package/dist/chunks/FontPlugin-Bzlluh1_.mjs +2 -0
  38. package/dist/chunks/FontPlugin-Bzlluh1_.mjs.map +1 -0
  39. package/dist/chunks/FontSizePlugin-kv3zHG0f.mjs +2 -0
  40. package/dist/chunks/FontSizePlugin-kv3zHG0f.mjs.map +1 -0
  41. package/dist/chunks/FormulaPlugin-20vW4Gge.mjs +2 -0
  42. package/dist/chunks/FormulaPlugin-20vW4Gge.mjs.map +1 -0
  43. package/dist/chunks/GapCursorPlugin-BPyNXY4H.mjs +2 -0
  44. package/dist/chunks/GapCursorPlugin-BPyNXY4H.mjs.map +1 -0
  45. package/dist/chunks/HTMLSanitization-BRipXyhI.mjs +2 -0
  46. package/dist/chunks/HTMLSanitization-BRipXyhI.mjs.map +1 -0
  47. package/dist/chunks/HTMLUtils-DTpsjZyK.mjs.map +1 -1
  48. package/dist/chunks/{HardBreakPlugin-svNnJ9Xj.mjs → HardBreakPlugin-lo8Mcg9G.mjs} +2 -2
  49. package/dist/chunks/HardBreakPlugin-lo8Mcg9G.mjs.map +1 -0
  50. package/dist/chunks/HeadingPlugin-CEZF5DBM.mjs +2 -0
  51. package/dist/chunks/HeadingPlugin-CEZF5DBM.mjs.map +1 -0
  52. package/dist/chunks/HighlightPlugin-yH44UWoe.mjs +2 -0
  53. package/dist/chunks/HighlightPlugin-yH44UWoe.mjs.map +1 -0
  54. package/dist/chunks/HorizontalRulePlugin-SNNum-9V.mjs +2 -0
  55. package/dist/chunks/HorizontalRulePlugin-SNNum-9V.mjs.map +1 -0
  56. package/dist/chunks/ImagePlugin-aeqHr5zx.mjs +2 -0
  57. package/dist/chunks/ImagePlugin-aeqHr5zx.mjs.map +1 -0
  58. package/dist/chunks/InlineCodePlugin-CIks06ti.mjs +2 -0
  59. package/dist/chunks/InlineCodePlugin-CIks06ti.mjs.map +1 -0
  60. package/dist/chunks/InlineStyleMarkSpec-BhfGgfH9.mjs.map +1 -1
  61. package/dist/chunks/KeyboardNav-D0my3wuy.mjs.map +1 -1
  62. package/dist/chunks/LinkPlugin-CFw22a9X.mjs +2 -0
  63. package/dist/chunks/LinkPlugin-CFw22a9X.mjs.map +1 -0
  64. package/dist/chunks/ListPlugin-ZNEx8pvk.mjs +2 -0
  65. package/dist/chunks/ListPlugin-ZNEx8pvk.mjs.map +1 -0
  66. package/dist/chunks/LocaleLoader-DEpTFuVc.mjs +2 -0
  67. package/dist/chunks/LocaleLoader-DEpTFuVc.mjs.map +1 -0
  68. package/dist/chunks/MarkCommands-C0ps9h0z.mjs.map +1 -1
  69. package/dist/chunks/MarkInputRule-DNneF2gp.mjs.map +1 -1
  70. package/dist/chunks/{MarkdownHTMLRegistry-BunUDiza.mjs → MarkdownHTMLRegistry-Cj7N2wqs.mjs} +2 -2
  71. package/dist/chunks/MarkdownHTMLRegistry-Cj7N2wqs.mjs.map +1 -0
  72. package/dist/chunks/{MarkdownParser-CvYOvU3d.mjs → MarkdownParser-JOfPSvGv.mjs} +2 -2
  73. package/dist/chunks/MarkdownParser-JOfPSvGv.mjs.map +1 -0
  74. package/dist/chunks/{MarkdownSerializer-CdUBWWGI.mjs → MarkdownSerializer-Y6saYClE.mjs} +2 -2
  75. package/dist/chunks/MarkdownSerializer-Y6saYClE.mjs.map +1 -0
  76. package/dist/chunks/MathFont-BS8IwYh2.mjs.map +1 -1
  77. package/dist/chunks/NavigationQueries-CaKfccu7.mjs.map +1 -1
  78. package/dist/chunks/NodeResolver-F4RtpoEd.mjs.map +1 -1
  79. package/dist/chunks/{NodeSelectionCommands-B0Sb4ux4.mjs → NodeSelectionCommands-CAqIHW_6.mjs} +2 -2
  80. package/dist/chunks/NodeSelectionCommands-CAqIHW_6.mjs.map +1 -0
  81. package/dist/chunks/NodeSpecPatching-BrjPAbqe.mjs.map +1 -1
  82. package/dist/chunks/Platform-ByobkiCc.mjs.map +1 -1
  83. package/dist/chunks/PopupKeyboardPatterns-BcwdDxRq.mjs.map +1 -1
  84. package/dist/chunks/PopupManager-DpxoBl54.mjs +2 -0
  85. package/dist/chunks/PopupManager-DpxoBl54.mjs.map +1 -0
  86. package/dist/chunks/PopupPositioning-CIqgpqlW.mjs.map +1 -1
  87. package/dist/chunks/PrintPlugin-CYkdUy-m.mjs +2 -0
  88. package/dist/chunks/PrintPlugin-CYkdUy-m.mjs.map +1 -0
  89. package/dist/chunks/RangeIterator-sJ_c9MNr.mjs.map +1 -1
  90. package/dist/chunks/Schema-BSM4YLNT.mjs.map +1 -1
  91. package/dist/chunks/{SchemaRegistry-Cs7rxafF.mjs → SchemaRegistry-CT3T7S1i.mjs} +2 -2
  92. package/dist/chunks/SchemaRegistry-CT3T7S1i.mjs.map +1 -0
  93. package/dist/chunks/Selection-DC6AOGgF.mjs.map +1 -1
  94. package/dist/chunks/SelectionReplacement-Cj4FLlPz.mjs +2 -0
  95. package/dist/chunks/SelectionReplacement-Cj4FLlPz.mjs.map +1 -0
  96. package/dist/chunks/{SelectionSync-BkjCwGp-.mjs → SelectionSync-8y0nbBHZ.mjs} +2 -2
  97. package/dist/chunks/SelectionSync-8y0nbBHZ.mjs.map +1 -0
  98. package/dist/chunks/SelectionTransactions-mQ1NfMEg.mjs.map +1 -1
  99. package/dist/chunks/ShortcutFormatting-TwiufqeV.mjs.map +1 -1
  100. package/dist/chunks/SimpleMark-DPTsIl9w.mjs +2 -0
  101. package/dist/chunks/SimpleMark-DPTsIl9w.mjs.map +1 -0
  102. package/dist/chunks/SmartPastePlugin-BSMHDDQ2.mjs +2 -0
  103. package/dist/chunks/SmartPastePlugin-BSMHDDQ2.mjs.map +1 -0
  104. package/dist/chunks/StarterFonts-BDQPg-cu.mjs.map +1 -1
  105. package/dist/chunks/StrikethroughPlugin-CqqIF3Zk.mjs +2 -0
  106. package/dist/chunks/StrikethroughPlugin-CqqIF3Zk.mjs.map +1 -0
  107. package/dist/chunks/StyleClassNames-BsAx7k5T.mjs.map +1 -1
  108. package/dist/chunks/StyleRuntime-C0RSqKzG.mjs.map +1 -1
  109. package/dist/chunks/SuperSubPlugin-5ZFM6wdU.mjs +2 -0
  110. package/dist/chunks/SuperSubPlugin-5ZFM6wdU.mjs.map +1 -0
  111. package/dist/chunks/SyntaxTokenTypes-BUCOMtL8.mjs.map +1 -1
  112. package/dist/chunks/{TableDimensions-BSEOEox2.mjs → TableDimensions-B-OWjTuW.mjs} +2 -2
  113. package/dist/chunks/TableDimensions-B-OWjTuW.mjs.map +1 -0
  114. package/dist/chunks/TablePlugin-D1Wg-pjl.mjs +2 -0
  115. package/dist/chunks/TablePlugin-D1Wg-pjl.mjs.map +1 -0
  116. package/dist/chunks/TableSelectionTypes-t2cLhe16.mjs +2 -0
  117. package/dist/chunks/TableSelectionTypes-t2cLhe16.mjs.map +1 -0
  118. package/dist/chunks/TextColorPlugin-Dwp7eW7F.mjs +2 -0
  119. package/dist/chunks/TextColorPlugin-Dwp7eW7F.mjs.map +1 -0
  120. package/dist/chunks/{TextDirectionAutoPlugin-DOH5cfyy.mjs → TextDirectionAutoPlugin-CkIETM5n.mjs} +2 -2
  121. package/dist/chunks/TextDirectionAutoPlugin-CkIETM5n.mjs.map +1 -0
  122. package/dist/chunks/TextDirectionPlugin-DAcPR5Qc.mjs +2 -0
  123. package/dist/chunks/TextDirectionPlugin-DAcPR5Qc.mjs.map +1 -0
  124. package/dist/chunks/TextDirectionService-OFOU6r_s.mjs +2 -0
  125. package/dist/chunks/TextDirectionService-OFOU6r_s.mjs.map +1 -0
  126. package/dist/chunks/TextFormattingPlugin-vml-lduV.mjs +2 -0
  127. package/dist/chunks/TextFormattingPlugin-vml-lduV.mjs.map +1 -0
  128. package/dist/chunks/ThemeEngine-kIXtSRkI.mjs.map +1 -1
  129. package/dist/chunks/ToolbarPlugin-Cxmb0MFr.mjs +2 -0
  130. package/dist/chunks/ToolbarPlugin-Cxmb0MFr.mjs.map +1 -0
  131. package/dist/chunks/TypeBrands-Ch9856Gb.mjs.map +1 -1
  132. package/dist/chunks/TypedKeys-CA4bfw9O.mjs.map +1 -1
  133. package/dist/chunks/VideoPlugin-lZCBlIon.mjs +2 -0
  134. package/dist/chunks/VideoPlugin-lZCBlIon.mjs.map +1 -0
  135. package/dist/chunks/XmlPatterns-RN32-0ob.mjs.map +1 -1
  136. package/dist/chunks/XmlSupport-3Za6SIqF.mjs.map +1 -1
  137. package/dist/chunks/ar--Isa9OHJ.mjs.map +1 -1
  138. package/dist/chunks/ar--O0A9OTR.mjs.map +1 -1
  139. package/dist/chunks/ar-0g2bmXTn.mjs.map +1 -1
  140. package/dist/chunks/ar-4b8e2YSc.mjs.map +1 -1
  141. package/dist/chunks/ar-B03uY4xr.mjs.map +1 -1
  142. package/dist/chunks/ar-BAfInw85.mjs.map +1 -1
  143. package/dist/chunks/ar-BRX5E_Pw.mjs.map +1 -1
  144. package/dist/chunks/ar-BWOue6jG.mjs.map +1 -1
  145. package/dist/chunks/ar-Bdmunk5h.mjs.map +1 -1
  146. package/dist/chunks/ar-BwaoCUVN.mjs.map +1 -1
  147. package/dist/chunks/ar-BzqAYGER.mjs.map +1 -1
  148. package/dist/chunks/ar-C9lO1jsY.mjs.map +1 -1
  149. package/dist/chunks/ar-CMXjVzFx.mjs.map +1 -1
  150. package/dist/chunks/ar-CR6UdFL9.mjs.map +1 -1
  151. package/dist/chunks/ar-CrOb0jL2.mjs.map +1 -1
  152. package/dist/chunks/ar-Cy_77yRf.mjs.map +1 -1
  153. package/dist/chunks/ar-D1jFXqLJ.mjs.map +1 -1
  154. package/dist/chunks/ar-DahJwMI9.mjs.map +1 -1
  155. package/dist/chunks/ar-Dcl3kgtd.mjs.map +1 -1
  156. package/dist/chunks/ar-Dg9PdDet.mjs.map +1 -1
  157. package/dist/chunks/ar-Dp1oBWyG.mjs +2 -0
  158. package/dist/chunks/ar-Dp1oBWyG.mjs.map +1 -0
  159. package/dist/chunks/ar-Dx2lO0Nm.mjs.map +1 -1
  160. package/dist/chunks/ar-NV_puwI2.mjs.map +1 -1
  161. package/dist/chunks/ar-Uzo1Azdw.mjs.map +1 -1
  162. package/dist/chunks/ar-XmSFrtmd.mjs.map +1 -1
  163. package/dist/chunks/ar-eOA3UmiE.mjs.map +1 -1
  164. package/dist/chunks/ar-sGZ-oZqB.mjs.map +1 -1
  165. package/dist/chunks/color-picker-D6HrTsDM.mjs.map +1 -1
  166. package/dist/chunks/de-B8-w9gPi.mjs.map +1 -1
  167. package/dist/chunks/de-B9zSHWqY.mjs.map +1 -1
  168. package/dist/chunks/de-BX4y4PlH.mjs.map +1 -1
  169. package/dist/chunks/de-BXQBXxFJ.mjs.map +1 -1
  170. package/dist/chunks/de-BcPntcnr.mjs.map +1 -1
  171. package/dist/chunks/de-BdD3DpUB.mjs.map +1 -1
  172. package/dist/chunks/de-Bwxlcuee.mjs.map +1 -1
  173. package/dist/chunks/de-BxQIt_1Y.mjs.map +1 -1
  174. package/dist/chunks/de-C-Yf378-.mjs.map +1 -1
  175. package/dist/chunks/de-C7uehgMu.mjs.map +1 -1
  176. package/dist/chunks/de-C9ZhDqPi.mjs.map +1 -1
  177. package/dist/chunks/de-CHcv_Vmf.mjs.map +1 -1
  178. package/dist/chunks/de-CTzAMkXC.mjs.map +1 -1
  179. package/dist/chunks/de-CaeEIyzV.mjs.map +1 -1
  180. package/dist/chunks/de-D3J8XPCR.mjs +2 -0
  181. package/dist/chunks/de-D3J8XPCR.mjs.map +1 -0
  182. package/dist/chunks/de-DHs9i4af.mjs.map +1 -1
  183. package/dist/chunks/de-DJ5EkXQo.mjs.map +1 -1
  184. package/dist/chunks/de-DRbhnS4T.mjs.map +1 -1
  185. package/dist/chunks/de-DViI26lG.mjs.map +1 -1
  186. package/dist/chunks/de-DY3obIAF.mjs.map +1 -1
  187. package/dist/chunks/de-DcMhfRBu.mjs.map +1 -1
  188. package/dist/chunks/de-DiPz7abS.mjs.map +1 -1
  189. package/dist/chunks/de-Dl4QFHMa.mjs.map +1 -1
  190. package/dist/chunks/de-XCCpWyg0.mjs.map +1 -1
  191. package/dist/chunks/de-e6J6nvAD.mjs.map +1 -1
  192. package/dist/chunks/de-i95F9SDy.mjs.map +1 -1
  193. package/dist/chunks/de-uKR7koQe.mjs.map +1 -1
  194. package/dist/chunks/es-B0Za939C.mjs.map +1 -1
  195. package/dist/chunks/es-B8K3Yvf3.mjs.map +1 -1
  196. package/dist/chunks/es-BIXm2Coj.mjs.map +1 -1
  197. package/dist/chunks/es-BJHF95J_.mjs.map +1 -1
  198. package/dist/chunks/es-BMm9kqjC.mjs.map +1 -1
  199. package/dist/chunks/es-BQ9dox_E.mjs.map +1 -1
  200. package/dist/chunks/es-BQweZX6P.mjs.map +1 -1
  201. package/dist/chunks/es-Bbz885DZ.mjs +2 -0
  202. package/dist/chunks/es-Bbz885DZ.mjs.map +1 -0
  203. package/dist/chunks/es-BdpTTRuX.mjs.map +1 -1
  204. package/dist/chunks/es-C7uVqFYr.mjs.map +1 -1
  205. package/dist/chunks/es-CCQFu1t1.mjs.map +1 -1
  206. package/dist/chunks/es-CEAJj7aB.mjs.map +1 -1
  207. package/dist/chunks/es-CUKJujcb.mjs.map +1 -1
  208. package/dist/chunks/es-CXuMz87y.mjs.map +1 -1
  209. package/dist/chunks/es-CgMfhkJJ.mjs.map +1 -1
  210. package/dist/chunks/es-CtOtKQCP.mjs.map +1 -1
  211. package/dist/chunks/es-DD01rZ6N.mjs.map +1 -1
  212. package/dist/chunks/es-DDoqchUq.mjs.map +1 -1
  213. package/dist/chunks/es-DFokqQst.mjs.map +1 -1
  214. package/dist/chunks/es-DHxdoEzR.mjs.map +1 -1
  215. package/dist/chunks/es-DehVGwQ8.mjs.map +1 -1
  216. package/dist/chunks/es-DrJyl38L.mjs.map +1 -1
  217. package/dist/chunks/es-fTW0TkYV.mjs.map +1 -1
  218. package/dist/chunks/es-kfKiqpyD.mjs.map +1 -1
  219. package/dist/chunks/es-nRLq7bgP.mjs.map +1 -1
  220. package/dist/chunks/es-paXY7HFt.mjs.map +1 -1
  221. package/dist/chunks/es-xuahrvJN.mjs.map +1 -1
  222. package/dist/chunks/fr-0qEo3bRP.mjs.map +1 -1
  223. package/dist/chunks/fr-5HkMazAf.mjs.map +1 -1
  224. package/dist/chunks/fr-B9pBLaVx.mjs.map +1 -1
  225. package/dist/chunks/fr-BRXUnq3R.mjs.map +1 -1
  226. package/dist/chunks/fr-BSUKEtTk.mjs.map +1 -1
  227. package/dist/chunks/fr-BeRlON1t.mjs.map +1 -1
  228. package/dist/chunks/fr-Bg937iAy.mjs.map +1 -1
  229. package/dist/chunks/fr-BwWrFThE.mjs.map +1 -1
  230. package/dist/chunks/fr-C3EKRThN.mjs.map +1 -1
  231. package/dist/chunks/fr-CKjH6tJI.mjs.map +1 -1
  232. package/dist/chunks/fr-CQs0-pNX.mjs.map +1 -1
  233. package/dist/chunks/fr-CfhyYN-t.mjs.map +1 -1
  234. package/dist/chunks/fr-D0MDdoir.mjs.map +1 -1
  235. package/dist/chunks/fr-D5ulA3Z6.mjs.map +1 -1
  236. package/dist/chunks/fr-DEZ_oxzS.mjs.map +1 -1
  237. package/dist/chunks/fr-DciSEykY.mjs.map +1 -1
  238. package/dist/chunks/fr-DhWQzZy3.mjs.map +1 -1
  239. package/dist/chunks/fr-DiDhVhyV.mjs.map +1 -1
  240. package/dist/chunks/fr-DjMZ-3K5.mjs.map +1 -1
  241. package/dist/chunks/fr-F2ZrfVaF.mjs.map +1 -1
  242. package/dist/chunks/fr-GEgM1j3w.mjs +2 -0
  243. package/dist/chunks/fr-GEgM1j3w.mjs.map +1 -0
  244. package/dist/chunks/fr-KXmbys88.mjs.map +1 -1
  245. package/dist/chunks/fr-NVOinLyF.mjs.map +1 -1
  246. package/dist/chunks/fr-SbpHNrQ-.mjs.map +1 -1
  247. package/dist/chunks/fr-ZsRdLuys.mjs.map +1 -1
  248. package/dist/chunks/fr-eC0UdAPu.mjs.map +1 -1
  249. package/dist/chunks/fr-fshsDD66.mjs.map +1 -1
  250. package/dist/chunks/full-wDTdOuGt.mjs +2 -0
  251. package/dist/chunks/full-wDTdOuGt.mjs.map +1 -0
  252. package/dist/chunks/hi-4CiAKVjT.mjs.map +1 -1
  253. package/dist/chunks/hi-B-ZuX4aN.mjs.map +1 -1
  254. package/dist/chunks/hi-B2YB3Bo4.mjs.map +1 -1
  255. package/dist/chunks/hi-B2uhiPCN.mjs.map +1 -1
  256. package/dist/chunks/hi-B5cl8TWK.mjs.map +1 -1
  257. package/dist/chunks/hi-BNJIGWQQ.mjs.map +1 -1
  258. package/dist/chunks/hi-BOMkDPqC.mjs.map +1 -1
  259. package/dist/chunks/hi-Bl-yeeOI.mjs.map +1 -1
  260. package/dist/chunks/hi-BsZzSMfL.mjs.map +1 -1
  261. package/dist/chunks/hi-By8YwVIX.mjs.map +1 -1
  262. package/dist/chunks/hi-BzbMD_cP.mjs.map +1 -1
  263. package/dist/chunks/hi-C2jEsf8v.mjs.map +1 -1
  264. package/dist/chunks/hi-CKg8i4Mm.mjs +2 -0
  265. package/dist/chunks/hi-CKg8i4Mm.mjs.map +1 -0
  266. package/dist/chunks/hi-CTWubxLY.mjs.map +1 -1
  267. package/dist/chunks/hi-CoclKAUM.mjs.map +1 -1
  268. package/dist/chunks/hi-CrmakMVj.mjs.map +1 -1
  269. package/dist/chunks/hi-DWX6k5ZD.mjs.map +1 -1
  270. package/dist/chunks/hi-DY55FuDK.mjs.map +1 -1
  271. package/dist/chunks/hi-DrC2H81d.mjs.map +1 -1
  272. package/dist/chunks/hi-DsdXcOB6.mjs.map +1 -1
  273. package/dist/chunks/hi-Dt89SxNy.mjs.map +1 -1
  274. package/dist/chunks/hi-J8ErB5nB.mjs.map +1 -1
  275. package/dist/chunks/hi-L6pJxZam.mjs.map +1 -1
  276. package/dist/chunks/hi-SECtQQzq.mjs.map +1 -1
  277. package/dist/chunks/hi-j3TDLMYd.mjs.map +1 -1
  278. package/dist/chunks/hi-l6DA-aOw.mjs.map +1 -1
  279. package/dist/chunks/hi-uACJUw53.mjs.map +1 -1
  280. package/dist/chunks/minimal-FfmHwMGU.mjs +2 -0
  281. package/dist/chunks/minimal-FfmHwMGU.mjs.map +1 -0
  282. package/dist/chunks/nl-2IdjTNeJ.mjs +2 -0
  283. package/dist/chunks/nl-2IdjTNeJ.mjs.map +1 -0
  284. package/dist/chunks/nl-B1i04NvZ.mjs +2 -0
  285. package/dist/chunks/nl-B1i04NvZ.mjs.map +1 -0
  286. package/dist/chunks/nl-BEmzpzKO.mjs +2 -0
  287. package/dist/chunks/nl-BEmzpzKO.mjs.map +1 -0
  288. package/dist/chunks/nl-B_U0D3Qq.mjs +2 -0
  289. package/dist/chunks/nl-B_U0D3Qq.mjs.map +1 -0
  290. package/dist/chunks/nl-C437Xz6z.mjs +2 -0
  291. package/dist/chunks/nl-C437Xz6z.mjs.map +1 -0
  292. package/dist/chunks/nl-C5P8Fogm.mjs +2 -0
  293. package/dist/chunks/nl-C5P8Fogm.mjs.map +1 -0
  294. package/dist/chunks/nl-CST62bzx.mjs +2 -0
  295. package/dist/chunks/nl-CST62bzx.mjs.map +1 -0
  296. package/dist/chunks/nl-CWQT-W-6.mjs +2 -0
  297. package/dist/chunks/nl-CWQT-W-6.mjs.map +1 -0
  298. package/dist/chunks/nl-CdpcDkbM.mjs +2 -0
  299. package/dist/chunks/nl-CdpcDkbM.mjs.map +1 -0
  300. package/dist/chunks/nl-CgYWZnga.mjs +2 -0
  301. package/dist/chunks/nl-CgYWZnga.mjs.map +1 -0
  302. package/dist/chunks/nl-Cr--x8bX.mjs +2 -0
  303. package/dist/chunks/nl-Cr--x8bX.mjs.map +1 -0
  304. package/dist/chunks/nl-Cwl5dxFZ.mjs +2 -0
  305. package/dist/chunks/nl-Cwl5dxFZ.mjs.map +1 -0
  306. package/dist/chunks/nl-Czjd9Bw9.mjs +2 -0
  307. package/dist/chunks/nl-Czjd9Bw9.mjs.map +1 -0
  308. package/dist/chunks/nl-DUOT2ZMQ.mjs +2 -0
  309. package/dist/chunks/nl-DUOT2ZMQ.mjs.map +1 -0
  310. package/dist/chunks/nl-DYnRYvZ5.mjs +2 -0
  311. package/dist/chunks/nl-DYnRYvZ5.mjs.map +1 -0
  312. package/dist/chunks/nl-DaNJ-ffX.mjs +2 -0
  313. package/dist/chunks/nl-DaNJ-ffX.mjs.map +1 -0
  314. package/dist/chunks/nl-DeOJ64xy.mjs +2 -0
  315. package/dist/chunks/nl-DeOJ64xy.mjs.map +1 -0
  316. package/dist/chunks/nl-DwZajfpP.mjs +2 -0
  317. package/dist/chunks/nl-DwZajfpP.mjs.map +1 -0
  318. package/dist/chunks/nl-Dyjc9M7o.mjs +2 -0
  319. package/dist/chunks/nl-Dyjc9M7o.mjs.map +1 -0
  320. package/dist/chunks/nl-GBpv7W4L.mjs +2 -0
  321. package/dist/chunks/nl-GBpv7W4L.mjs.map +1 -0
  322. package/dist/chunks/nl-HFfWJOEo.mjs +2 -0
  323. package/dist/chunks/nl-HFfWJOEo.mjs.map +1 -0
  324. package/dist/chunks/nl-KqmiCeD7.mjs +2 -0
  325. package/dist/chunks/nl-KqmiCeD7.mjs.map +1 -0
  326. package/dist/chunks/nl-_QT7e2Qt.mjs +2 -0
  327. package/dist/chunks/nl-_QT7e2Qt.mjs.map +1 -0
  328. package/dist/chunks/nl-i79IajbC.mjs +2 -0
  329. package/dist/chunks/nl-i79IajbC.mjs.map +1 -0
  330. package/dist/chunks/nl-lcZvrAz6.mjs +2 -0
  331. package/dist/chunks/nl-lcZvrAz6.mjs.map +1 -0
  332. package/dist/chunks/nl-tWJ2imhe.mjs +2 -0
  333. package/dist/chunks/nl-tWJ2imhe.mjs.map +1 -0
  334. package/dist/chunks/nl-xfiNOCgg.mjs +2 -0
  335. package/dist/chunks/nl-xfiNOCgg.mjs.map +1 -0
  336. package/dist/chunks/pt-5VeuNDd2.mjs.map +1 -1
  337. package/dist/chunks/pt-BCXgUDiU.mjs.map +1 -1
  338. package/dist/chunks/pt-BDam9cDu.mjs.map +1 -1
  339. package/dist/chunks/pt-Bb908r0n.mjs.map +1 -1
  340. package/dist/chunks/pt-BkpVtod-.mjs.map +1 -1
  341. package/dist/chunks/pt-BlFAJZo7.mjs.map +1 -1
  342. package/dist/chunks/pt-Bu7Mbz67.mjs.map +1 -1
  343. package/dist/chunks/pt-BuZ7acHF.mjs.map +1 -1
  344. package/dist/chunks/pt-C8sOyw0V.mjs.map +1 -1
  345. package/dist/chunks/pt-CEUgbrii.mjs.map +1 -1
  346. package/dist/chunks/pt-CFrcl1v_.mjs.map +1 -1
  347. package/dist/chunks/pt-CMrFpUWS.mjs.map +1 -1
  348. package/dist/chunks/pt-CMx2wPPY.mjs.map +1 -1
  349. package/dist/chunks/pt-CR4j8gtE.mjs.map +1 -1
  350. package/dist/chunks/pt-Cc4zysaT.mjs.map +1 -1
  351. package/dist/chunks/pt-Cv6q7x5x.mjs.map +1 -1
  352. package/dist/chunks/pt-DFKJVh7k.mjs.map +1 -1
  353. package/dist/chunks/pt-DP5c76Vo.mjs +2 -0
  354. package/dist/chunks/pt-DP5c76Vo.mjs.map +1 -0
  355. package/dist/chunks/pt-DYMyMgKQ.mjs.map +1 -1
  356. package/dist/chunks/pt-D__tcM2T.mjs.map +1 -1
  357. package/dist/chunks/pt-Dg2ctkug.mjs.map +1 -1
  358. package/dist/chunks/pt-DgfMoLWR.mjs.map +1 -1
  359. package/dist/chunks/pt-OXa_IR4Q.mjs.map +1 -1
  360. package/dist/chunks/pt-UPF7DBlz.mjs.map +1 -1
  361. package/dist/chunks/pt-_qxIe7zX.mjs.map +1 -1
  362. package/dist/chunks/pt-paXY7HFt.mjs.map +1 -1
  363. package/dist/chunks/pt-zMHcNGPk.mjs.map +1 -1
  364. package/dist/chunks/register-DSRtHVkk.mjs +3 -0
  365. package/dist/chunks/register-DSRtHVkk.mjs.map +1 -0
  366. package/dist/chunks/ru--iYEtsT5.mjs +2 -0
  367. package/dist/chunks/ru--iYEtsT5.mjs.map +1 -0
  368. package/dist/chunks/ru-B1m8J9dl.mjs.map +1 -1
  369. package/dist/chunks/ru-BNPUT-3S.mjs.map +1 -1
  370. package/dist/chunks/ru-BotG0MFT.mjs.map +1 -1
  371. package/dist/chunks/ru-C-APN_dm.mjs.map +1 -1
  372. package/dist/chunks/ru-C9yFslEG.mjs.map +1 -1
  373. package/dist/chunks/ru-CkG_bpfo.mjs.map +1 -1
  374. package/dist/chunks/ru-Cs8KCNyq.mjs.map +1 -1
  375. package/dist/chunks/ru-CsP6mLxp.mjs.map +1 -1
  376. package/dist/chunks/ru-CvDl-yEd.mjs.map +1 -1
  377. package/dist/chunks/ru-CwyPz2Va.mjs.map +1 -1
  378. package/dist/chunks/ru-D53d-_UB.mjs.map +1 -1
  379. package/dist/chunks/ru-DJMpeuey.mjs.map +1 -1
  380. package/dist/chunks/ru-DSRv3_Rg.mjs.map +1 -1
  381. package/dist/chunks/ru-DV-lgEtM.mjs.map +1 -1
  382. package/dist/chunks/ru-DiwQV30V.mjs.map +1 -1
  383. package/dist/chunks/ru-DkW9XZFy.mjs.map +1 -1
  384. package/dist/chunks/ru-DyCTlhjg.mjs.map +1 -1
  385. package/dist/chunks/ru-QGX8lOTs.mjs.map +1 -1
  386. package/dist/chunks/ru-QcTo2yoL.mjs.map +1 -1
  387. package/dist/chunks/ru-Y11wuxOB.mjs.map +1 -1
  388. package/dist/chunks/ru-Yngw7nFP.mjs.map +1 -1
  389. package/dist/chunks/ru-d68SZpEe.mjs.map +1 -1
  390. package/dist/chunks/ru-gxbzqLL8.mjs.map +1 -1
  391. package/dist/chunks/ru-k7o3Qks3.mjs.map +1 -1
  392. package/dist/chunks/ru-l73diFXn.mjs.map +1 -1
  393. package/dist/chunks/ru-q8kz-237.mjs.map +1 -1
  394. package/dist/chunks/src-DDkRstYh.mjs +2 -0
  395. package/dist/chunks/src-DDkRstYh.mjs.map +1 -0
  396. package/dist/chunks/xml-BsV44TrJ.mjs.map +1 -1
  397. package/dist/chunks/zh-BFZOM3lF.mjs.map +1 -1
  398. package/dist/chunks/zh-BGYJXxVl.mjs.map +1 -1
  399. package/dist/chunks/zh-BP97XjlS.mjs.map +1 -1
  400. package/dist/chunks/zh-BQ73oqxc.mjs.map +1 -1
  401. package/dist/chunks/zh-BQqf3wJZ.mjs.map +1 -1
  402. package/dist/chunks/zh-Baxh6v0j.mjs.map +1 -1
  403. package/dist/chunks/zh-BvuAbM2S.mjs.map +1 -1
  404. package/dist/chunks/zh-C-wHnDo5.mjs.map +1 -1
  405. package/dist/chunks/zh-C7iCgCRP.mjs.map +1 -1
  406. package/dist/chunks/zh-CRsDvfPR.mjs.map +1 -1
  407. package/dist/chunks/zh-CWGAPVei.mjs.map +1 -1
  408. package/dist/chunks/zh-CWIzJcXi.mjs.map +1 -1
  409. package/dist/chunks/zh-CYV-db-K.mjs.map +1 -1
  410. package/dist/chunks/zh-CiIyOm6U.mjs.map +1 -1
  411. package/dist/chunks/zh-CnW44JEw.mjs.map +1 -1
  412. package/dist/chunks/zh-D1HSmSOf.mjs.map +1 -1
  413. package/dist/chunks/zh-DUS7JduA.mjs +2 -0
  414. package/dist/chunks/zh-DUS7JduA.mjs.map +1 -0
  415. package/dist/chunks/zh-DWN1Jqn3.mjs.map +1 -1
  416. package/dist/chunks/zh-DYD476c5.mjs.map +1 -1
  417. package/dist/chunks/zh-DdzgYD7k.mjs.map +1 -1
  418. package/dist/chunks/zh-DgSmvLyw.mjs.map +1 -1
  419. package/dist/chunks/zh-DlVfQn4z.mjs.map +1 -1
  420. package/dist/chunks/zh-Oj-qSUEp.mjs.map +1 -1
  421. package/dist/chunks/zh-YfuE_m2y.mjs.map +1 -1
  422. package/dist/chunks/zh-dGSDBBzb.mjs.map +1 -1
  423. package/dist/chunks/zh-ikm3rSTR.mjs.map +1 -1
  424. package/dist/chunks/zh-oZl1P_p0.mjs.map +1 -1
  425. package/dist/commands/BlockInsertion.d.ts +15 -19
  426. package/dist/commands/BlockInsertion.d.ts.map +1 -1
  427. package/dist/commands/Commands.d.ts +3 -0
  428. package/dist/commands/Commands.d.ts.map +1 -1
  429. package/dist/commands/CompositionCommands.d.ts +14 -8
  430. package/dist/commands/CompositionCommands.d.ts.map +1 -1
  431. package/dist/commands/CompositionFallback.d.ts +13 -0
  432. package/dist/commands/CompositionFallback.d.ts.map +1 -0
  433. package/dist/commands/CompositionRebase.d.ts +17 -10
  434. package/dist/commands/CompositionRebase.d.ts.map +1 -1
  435. package/dist/commands/PasteCommand.d.ts.map +1 -1
  436. package/dist/commands/SelectionDeletion.d.ts +7 -5
  437. package/dist/commands/SelectionDeletion.d.ts.map +1 -1
  438. package/dist/commands/SelectionReplacement.d.ts +42 -0
  439. package/dist/commands/SelectionReplacement.d.ts.map +1 -0
  440. package/dist/editor/BlockIdentity.d.ts +16 -0
  441. package/dist/editor/BlockIdentity.d.ts.map +1 -0
  442. package/dist/editor/ContentSerializer.d.ts +13 -11
  443. package/dist/editor/ContentSerializer.d.ts.map +1 -1
  444. package/dist/editor/NotectlEditor.d.ts +6 -5
  445. package/dist/editor/NotectlEditor.d.ts.map +1 -1
  446. package/dist/editor/locales/nl.d.ts +4 -0
  447. package/dist/editor/locales/nl.d.ts.map +1 -0
  448. package/dist/editor/styles/link.d.ts +3 -0
  449. package/dist/editor/styles/link.d.ts.map +1 -0
  450. package/dist/fonts/math.mjs +1 -1
  451. package/dist/fonts.mjs +1 -1
  452. package/dist/full.mjs +1 -1
  453. package/dist/html.mjs +1 -1
  454. package/dist/i18n/Locale.d.ts +1 -0
  455. package/dist/i18n/Locale.d.ts.map +1 -1
  456. package/dist/index.d.ts +1 -1
  457. package/dist/index.d.ts.map +1 -1
  458. package/dist/input/CompositionController.d.ts.map +1 -1
  459. package/dist/input/HTMLLineBreaks.d.ts +14 -0
  460. package/dist/input/HTMLLineBreaks.d.ts.map +1 -0
  461. package/dist/input/HTMLParser.d.ts +1 -7
  462. package/dist/input/HTMLParser.d.ts.map +1 -1
  463. package/dist/input/PasteHTMLHandler.d.ts +0 -1
  464. package/dist/input/PasteHTMLHandler.d.ts.map +1 -1
  465. package/dist/input/PasteHandler.d.ts.map +1 -1
  466. package/dist/input/PasteRichBlockHandler.d.ts +10 -17
  467. package/dist/input/PasteRichBlockHandler.d.ts.map +1 -1
  468. package/dist/markdown.mjs +1 -1
  469. package/dist/model/ContentModel.d.ts +6 -1
  470. package/dist/model/ContentModel.d.ts.map +1 -1
  471. package/dist/model/FileHandlerDispatcher.d.ts +3 -1
  472. package/dist/model/FileHandlerDispatcher.d.ts.map +1 -1
  473. package/dist/model/FileHandlerRegistry.d.ts +11 -2
  474. package/dist/model/FileHandlerRegistry.d.ts.map +1 -1
  475. package/dist/notectl-core.mjs +1 -1
  476. package/dist/notectl-core.umd.js +1 -1
  477. package/dist/notectl-core.umd.js.map +1 -1
  478. package/dist/plugins/PluginContextFactory.d.ts +1 -0
  479. package/dist/plugins/PluginContextFactory.d.ts.map +1 -1
  480. package/dist/plugins/PluginManager.d.ts +5 -0
  481. package/dist/plugins/PluginManager.d.ts.map +1 -1
  482. package/dist/plugins/alignment/locales/nl.d.ts +4 -0
  483. package/dist/plugins/alignment/locales/nl.d.ts.map +1 -0
  484. package/dist/plugins/alignment.mjs +1 -1
  485. package/dist/plugins/bidi-isolation/locales/nl.d.ts +4 -0
  486. package/dist/plugins/bidi-isolation/locales/nl.d.ts.map +1 -0
  487. package/dist/plugins/bidi-isolation.mjs +1 -1
  488. package/dist/plugins/blockquote/locales/nl.d.ts +4 -0
  489. package/dist/plugins/blockquote/locales/nl.d.ts.map +1 -0
  490. package/dist/plugins/blockquote.mjs +1 -1
  491. package/dist/plugins/caret-navigation/locales/nl.d.ts +4 -0
  492. package/dist/plugins/caret-navigation/locales/nl.d.ts.map +1 -0
  493. package/dist/plugins/caret-navigation.mjs +1 -1
  494. package/dist/plugins/code-block/CodeBlockSchema.d.ts.map +1 -1
  495. package/dist/plugins/code-block/locales/nl.d.ts +4 -0
  496. package/dist/plugins/code-block/locales/nl.d.ts.map +1 -0
  497. package/dist/plugins/code-block.mjs +1 -1
  498. package/dist/plugins/editor-ui/EditorUI.d.ts +50 -0
  499. package/dist/plugins/editor-ui/EditorUI.d.ts.map +1 -0
  500. package/dist/plugins/editor-ui/EditorUIRuntime.d.ts +44 -0
  501. package/dist/plugins/editor-ui/EditorUIRuntime.d.ts.map +1 -0
  502. package/dist/plugins/editor-ui/index.d.ts +6 -0
  503. package/dist/plugins/editor-ui/index.d.ts.map +1 -0
  504. package/dist/plugins/font/locales/nl.d.ts +4 -0
  505. package/dist/plugins/font/locales/nl.d.ts.map +1 -0
  506. package/dist/plugins/font-size/locales/nl.d.ts +4 -0
  507. package/dist/plugins/font-size/locales/nl.d.ts.map +1 -0
  508. package/dist/plugins/font-size.mjs +1 -1
  509. package/dist/plugins/font.mjs +1 -1
  510. package/dist/plugins/formula/FormulaCommands.d.ts +6 -4
  511. package/dist/plugins/formula/FormulaCommands.d.ts.map +1 -1
  512. package/dist/plugins/formula/locales/nl.d.ts +4 -0
  513. package/dist/plugins/formula/locales/nl.d.ts.map +1 -0
  514. package/dist/plugins/formula.mjs +1 -1
  515. package/dist/plugins/gap-cursor/locales/nl.d.ts +4 -0
  516. package/dist/plugins/gap-cursor/locales/nl.d.ts.map +1 -0
  517. package/dist/plugins/gap-cursor.mjs +1 -1
  518. package/dist/plugins/hard-break.mjs +1 -1
  519. package/dist/plugins/heading/locales/nl.d.ts +4 -0
  520. package/dist/plugins/heading/locales/nl.d.ts.map +1 -0
  521. package/dist/plugins/heading.mjs +1 -1
  522. package/dist/plugins/highlight/locales/nl.d.ts +4 -0
  523. package/dist/plugins/highlight/locales/nl.d.ts.map +1 -0
  524. package/dist/plugins/highlight.mjs +1 -1
  525. package/dist/plugins/horizontal-rule/locales/nl.d.ts +4 -0
  526. package/dist/plugins/horizontal-rule/locales/nl.d.ts.map +1 -0
  527. package/dist/plugins/horizontal-rule.mjs +1 -1
  528. package/dist/plugins/image/ImageCommands.d.ts +15 -3
  529. package/dist/plugins/image/ImageCommands.d.ts.map +1 -1
  530. package/dist/plugins/image/ImagePlugin.d.ts.map +1 -1
  531. package/dist/plugins/image/locales/nl.d.ts +4 -0
  532. package/dist/plugins/image/locales/nl.d.ts.map +1 -0
  533. package/dist/plugins/image.mjs +1 -1
  534. package/dist/plugins/inline-code/locales/nl.d.ts +4 -0
  535. package/dist/plugins/inline-code/locales/nl.d.ts.map +1 -0
  536. package/dist/plugins/inline-code.mjs +1 -1
  537. package/dist/plugins/link/LinkBubble.d.ts +31 -0
  538. package/dist/plugins/link/LinkBubble.d.ts.map +1 -0
  539. package/dist/plugins/link/LinkBubbleContent.d.ts +4 -0
  540. package/dist/plugins/link/LinkBubbleContent.d.ts.map +1 -0
  541. package/dist/plugins/link/LinkInteractionController.d.ts +40 -0
  542. package/dist/plugins/link/LinkInteractionController.d.ts.map +1 -0
  543. package/dist/plugins/link/LinkLocale.d.ts +10 -1
  544. package/dist/plugins/link/LinkLocale.d.ts.map +1 -1
  545. package/dist/plugins/link/LinkNavigation.d.ts +12 -0
  546. package/dist/plugins/link/LinkNavigation.d.ts.map +1 -0
  547. package/dist/plugins/link/LinkPlugin.d.ts +4 -5
  548. package/dist/plugins/link/LinkPlugin.d.ts.map +1 -1
  549. package/dist/plugins/link/LinkRange.d.ts +12 -0
  550. package/dist/plugins/link/LinkRange.d.ts.map +1 -0
  551. package/dist/plugins/link/locales/ar.d.ts.map +1 -1
  552. package/dist/plugins/link/locales/de.d.ts.map +1 -1
  553. package/dist/plugins/link/locales/es.d.ts.map +1 -1
  554. package/dist/plugins/link/locales/fr.d.ts.map +1 -1
  555. package/dist/plugins/link/locales/hi.d.ts.map +1 -1
  556. package/dist/plugins/link/locales/nl.d.ts +4 -0
  557. package/dist/plugins/link/locales/nl.d.ts.map +1 -0
  558. package/dist/plugins/link/locales/pt.d.ts.map +1 -1
  559. package/dist/plugins/link/locales/ru.d.ts.map +1 -1
  560. package/dist/plugins/link/locales/zh.d.ts.map +1 -1
  561. package/dist/plugins/link.mjs +1 -1
  562. package/dist/plugins/list/locales/nl.d.ts +4 -0
  563. package/dist/plugins/list/locales/nl.d.ts.map +1 -0
  564. package/dist/plugins/list.mjs +1 -1
  565. package/dist/plugins/print/locales/nl.d.ts +4 -0
  566. package/dist/plugins/print/locales/nl.d.ts.map +1 -0
  567. package/dist/plugins/print.mjs +1 -1
  568. package/dist/plugins/shared/PopupManager.d.ts +20 -2
  569. package/dist/plugins/shared/PopupManager.d.ts.map +1 -1
  570. package/dist/plugins/shared/PopupPositioning.d.ts +2 -6
  571. package/dist/plugins/shared/PopupPositioning.d.ts.map +1 -1
  572. package/dist/plugins/shared/index.d.ts +1 -1
  573. package/dist/plugins/shared/index.d.ts.map +1 -1
  574. package/dist/plugins/shared.mjs +1 -1
  575. package/dist/plugins/smart-paste/SmartPastePlugin.d.ts +0 -1
  576. package/dist/plugins/smart-paste/SmartPastePlugin.d.ts.map +1 -1
  577. package/dist/plugins/smart-paste/locales/nl.d.ts +4 -0
  578. package/dist/plugins/smart-paste/locales/nl.d.ts.map +1 -0
  579. package/dist/plugins/smart-paste.mjs +1 -1
  580. package/dist/plugins/strikethrough/locales/nl.d.ts +4 -0
  581. package/dist/plugins/strikethrough/locales/nl.d.ts.map +1 -0
  582. package/dist/plugins/strikethrough.mjs +1 -1
  583. package/dist/plugins/super-sub/locales/nl.d.ts +4 -0
  584. package/dist/plugins/super-sub/locales/nl.d.ts.map +1 -0
  585. package/dist/plugins/super-sub.mjs +1 -1
  586. package/dist/plugins/table/TableContextMenu.d.ts.map +1 -1
  587. package/dist/plugins/table/TableSelection.d.ts +4 -20
  588. package/dist/plugins/table/TableSelection.d.ts.map +1 -1
  589. package/dist/plugins/table/TableSelectionTypes.d.ts +21 -0
  590. package/dist/plugins/table/TableSelectionTypes.d.ts.map +1 -0
  591. package/dist/plugins/table/locales/nl.d.ts +4 -0
  592. package/dist/plugins/table/locales/nl.d.ts.map +1 -0
  593. package/dist/plugins/table.mjs +1 -1
  594. package/dist/plugins/text-color/locales/nl.d.ts +4 -0
  595. package/dist/plugins/text-color/locales/nl.d.ts.map +1 -0
  596. package/dist/plugins/text-color.mjs +1 -1
  597. package/dist/plugins/text-direction/locales/nl.d.ts +4 -0
  598. package/dist/plugins/text-direction/locales/nl.d.ts.map +1 -0
  599. package/dist/plugins/text-direction-auto.mjs +1 -1
  600. package/dist/plugins/text-direction.mjs +1 -1
  601. package/dist/plugins/text-formatting/locales/nl.d.ts +4 -0
  602. package/dist/plugins/text-formatting/locales/nl.d.ts.map +1 -0
  603. package/dist/plugins/text-formatting.mjs +1 -1
  604. package/dist/plugins/toolbar/ToolbarOverflowController.d.ts +2 -2
  605. package/dist/plugins/toolbar/ToolbarOverflowController.d.ts.map +1 -1
  606. package/dist/plugins/toolbar/ToolbarPlugin.d.ts +2 -1
  607. package/dist/plugins/toolbar/ToolbarPlugin.d.ts.map +1 -1
  608. package/dist/plugins/toolbar/ToolbarPopupController.d.ts +8 -3
  609. package/dist/plugins/toolbar/ToolbarPopupController.d.ts.map +1 -1
  610. package/dist/plugins/toolbar/ToolbarRegistry.d.ts +4 -0
  611. package/dist/plugins/toolbar/ToolbarRegistry.d.ts.map +1 -1
  612. package/dist/plugins/toolbar/locales/nl.d.ts +4 -0
  613. package/dist/plugins/toolbar/locales/nl.d.ts.map +1 -0
  614. package/dist/plugins/toolbar.mjs +1 -1
  615. package/dist/plugins/video/locales/nl.d.ts +4 -0
  616. package/dist/plugins/video/locales/nl.d.ts.map +1 -0
  617. package/dist/plugins/video.mjs +1 -1
  618. package/dist/presets/full.mjs +1 -1
  619. package/dist/presets/minimal.mjs +1 -1
  620. package/dist/presets.mjs +1 -1
  621. package/dist/register.mjs +1 -1
  622. package/dist/serialization/DocumentParser.d.ts +2 -2
  623. package/dist/serialization/DocumentParser.d.ts.map +1 -1
  624. package/dist/serialization/HTMLParseRules.d.ts.map +1 -1
  625. package/dist/serialization/HTMLSanitization.d.ts +6 -0
  626. package/dist/serialization/HTMLSanitization.d.ts.map +1 -1
  627. package/dist/serialization/PreformattedText.d.ts +3 -0
  628. package/dist/serialization/PreformattedText.d.ts.map +1 -0
  629. package/dist/state/History.d.ts.map +1 -1
  630. package/dist/state/RangeMapping.d.ts +10 -0
  631. package/dist/state/RangeMapping.d.ts.map +1 -0
  632. package/dist/state/StepApplication.d.ts.map +1 -1
  633. package/dist/state/Steps.d.ts +3 -0
  634. package/dist/state/Steps.d.ts.map +1 -1
  635. package/dist/state/StructuralPositions.d.ts +15 -0
  636. package/dist/state/StructuralPositions.d.ts.map +1 -0
  637. package/dist/state/TransactionBuilder.d.ts +6 -14
  638. package/dist/state/TransactionBuilder.d.ts.map +1 -1
  639. package/dist/test/TestUtils.d.ts.map +1 -1
  640. package/dist/ui.d.ts +3 -0
  641. package/dist/ui.d.ts.map +1 -0
  642. package/dist/ui.mjs +1 -0
  643. package/dist/view/EditorInteraction.d.ts +23 -0
  644. package/dist/view/EditorInteraction.d.ts.map +1 -0
  645. package/dist/view/EditorView.d.ts +2 -0
  646. package/dist/view/EditorView.d.ts.map +1 -1
  647. package/dist/view/EditorViewEvents.d.ts.map +1 -1
  648. package/dist/view/SelectionGeometry.d.ts +29 -0
  649. package/dist/view/SelectionGeometry.d.ts.map +1 -0
  650. package/dist/view/SelectionObserver.d.ts +19 -0
  651. package/dist/view/SelectionObserver.d.ts.map +1 -0
  652. package/dist/view/SelectionSync.d.ts +7 -0
  653. package/dist/view/SelectionSync.d.ts.map +1 -1
  654. package/package.json +12 -8
  655. package/dist/chunks/AlignmentPlugin-Cp7HYGaH.mjs +0 -2
  656. package/dist/chunks/AlignmentPlugin-Cp7HYGaH.mjs.map +0 -1
  657. package/dist/chunks/BidiIsolationPlugin-GWukKdgJ.mjs +0 -2
  658. package/dist/chunks/BidiIsolationPlugin-GWukKdgJ.mjs.map +0 -1
  659. package/dist/chunks/BlockInsertion-CxKdCKJd.mjs +0 -2
  660. package/dist/chunks/BlockInsertion-CxKdCKJd.mjs.map +0 -1
  661. package/dist/chunks/BlockquotePlugin-CSL_7Yit.mjs +0 -2
  662. package/dist/chunks/BlockquotePlugin-CSL_7Yit.mjs.map +0 -1
  663. package/dist/chunks/CaretNavigationPlugin-BxWjR7SN.mjs +0 -2
  664. package/dist/chunks/CaretNavigationPlugin-BxWjR7SN.mjs.map +0 -1
  665. package/dist/chunks/CodeBlockPlugin-BIrkK4ER.mjs +0 -2
  666. package/dist/chunks/CodeBlockPlugin-BIrkK4ER.mjs.map +0 -1
  667. package/dist/chunks/Commands-DBBCAYBn.mjs +0 -2
  668. package/dist/chunks/Commands-DBBCAYBn.mjs.map +0 -1
  669. package/dist/chunks/ContentModel-BLC3Tez8.mjs +0 -2
  670. package/dist/chunks/ContentModel-BLC3Tez8.mjs.map +0 -1
  671. package/dist/chunks/DocumentParser-BKUrtgw1.mjs +0 -2
  672. package/dist/chunks/DocumentParser-BKUrtgw1.mjs.map +0 -1
  673. package/dist/chunks/FontPlugin-BcXNFqqO.mjs +0 -2
  674. package/dist/chunks/FontPlugin-BcXNFqqO.mjs.map +0 -1
  675. package/dist/chunks/FontSizePlugin-BQ9Aj8cT.mjs +0 -2
  676. package/dist/chunks/FontSizePlugin-BQ9Aj8cT.mjs.map +0 -1
  677. package/dist/chunks/FormulaPlugin-Bw_sO_lq.mjs +0 -2
  678. package/dist/chunks/FormulaPlugin-Bw_sO_lq.mjs.map +0 -1
  679. package/dist/chunks/GapCursorPlugin-QDGwnaRR.mjs +0 -2
  680. package/dist/chunks/GapCursorPlugin-QDGwnaRR.mjs.map +0 -1
  681. package/dist/chunks/HTMLSanitization-Ce9dVT1q.mjs +0 -2
  682. package/dist/chunks/HTMLSanitization-Ce9dVT1q.mjs.map +0 -1
  683. package/dist/chunks/HardBreakPlugin-svNnJ9Xj.mjs.map +0 -1
  684. package/dist/chunks/HeadingPlugin-B7EfynaH.mjs +0 -2
  685. package/dist/chunks/HeadingPlugin-B7EfynaH.mjs.map +0 -1
  686. package/dist/chunks/HighlightPlugin-LdO0INtJ.mjs +0 -2
  687. package/dist/chunks/HighlightPlugin-LdO0INtJ.mjs.map +0 -1
  688. package/dist/chunks/HorizontalRulePlugin-CQ5NT2Mo.mjs +0 -2
  689. package/dist/chunks/HorizontalRulePlugin-CQ5NT2Mo.mjs.map +0 -1
  690. package/dist/chunks/ImagePlugin-BzLvPXGo.mjs +0 -2
  691. package/dist/chunks/ImagePlugin-BzLvPXGo.mjs.map +0 -1
  692. package/dist/chunks/InlineCodePlugin-Bu9-rE4B.mjs +0 -2
  693. package/dist/chunks/InlineCodePlugin-Bu9-rE4B.mjs.map +0 -1
  694. package/dist/chunks/LinkPlugin-BuzrXo2c.mjs +0 -2
  695. package/dist/chunks/LinkPlugin-BuzrXo2c.mjs.map +0 -1
  696. package/dist/chunks/ListPlugin-DTgpvBEt.mjs +0 -2
  697. package/dist/chunks/ListPlugin-DTgpvBEt.mjs.map +0 -1
  698. package/dist/chunks/MarkdownHTMLRegistry-BunUDiza.mjs.map +0 -1
  699. package/dist/chunks/MarkdownParser-CvYOvU3d.mjs.map +0 -1
  700. package/dist/chunks/MarkdownSerializer-CdUBWWGI.mjs.map +0 -1
  701. package/dist/chunks/NodeSelectionCommands-B0Sb4ux4.mjs.map +0 -1
  702. package/dist/chunks/PluginHelpers-B3gk3VB3.mjs +0 -2
  703. package/dist/chunks/PluginHelpers-B3gk3VB3.mjs.map +0 -1
  704. package/dist/chunks/PopupManager-Jz5JrUdC.mjs +0 -2
  705. package/dist/chunks/PopupManager-Jz5JrUdC.mjs.map +0 -1
  706. package/dist/chunks/PrintPlugin-BxNlFk2c.mjs +0 -2
  707. package/dist/chunks/PrintPlugin-BxNlFk2c.mjs.map +0 -1
  708. package/dist/chunks/SchemaRegistry-Cs7rxafF.mjs.map +0 -1
  709. package/dist/chunks/SelectionSync-BkjCwGp-.mjs.map +0 -1
  710. package/dist/chunks/SimpleMark-D6vz3Nfd.mjs +0 -2
  711. package/dist/chunks/SimpleMark-D6vz3Nfd.mjs.map +0 -1
  712. package/dist/chunks/SmartPastePlugin-C3SVKkWK.mjs +0 -2
  713. package/dist/chunks/SmartPastePlugin-C3SVKkWK.mjs.map +0 -1
  714. package/dist/chunks/StrikethroughPlugin-v-VJZzUZ.mjs +0 -2
  715. package/dist/chunks/StrikethroughPlugin-v-VJZzUZ.mjs.map +0 -1
  716. package/dist/chunks/SuperSubPlugin-x1iPnZyt.mjs +0 -2
  717. package/dist/chunks/SuperSubPlugin-x1iPnZyt.mjs.map +0 -1
  718. package/dist/chunks/TableDimensions-BSEOEox2.mjs.map +0 -1
  719. package/dist/chunks/TablePlugin-WPwp902E.mjs +0 -2
  720. package/dist/chunks/TablePlugin-WPwp902E.mjs.map +0 -1
  721. package/dist/chunks/TextColorPlugin-Bnl9of9E.mjs +0 -2
  722. package/dist/chunks/TextColorPlugin-Bnl9of9E.mjs.map +0 -1
  723. package/dist/chunks/TextDirectionAutoPlugin-DOH5cfyy.mjs.map +0 -1
  724. package/dist/chunks/TextDirectionPlugin-JwlR-R-b.mjs +0 -2
  725. package/dist/chunks/TextDirectionPlugin-JwlR-R-b.mjs.map +0 -1
  726. package/dist/chunks/TextDirectionService-BcX07mw2.mjs +0 -2
  727. package/dist/chunks/TextDirectionService-BcX07mw2.mjs.map +0 -1
  728. package/dist/chunks/TextFormattingPlugin-Kc_UNoOz.mjs +0 -2
  729. package/dist/chunks/TextFormattingPlugin-Kc_UNoOz.mjs.map +0 -1
  730. package/dist/chunks/ToolbarPlugin-DmVI7MN9.mjs +0 -2
  731. package/dist/chunks/ToolbarPlugin-DmVI7MN9.mjs.map +0 -1
  732. package/dist/chunks/VideoPlugin-D3zGQ6QV.mjs +0 -2
  733. package/dist/chunks/VideoPlugin-D3zGQ6QV.mjs.map +0 -1
  734. package/dist/chunks/ar-Ctrv6cIi.mjs +0 -2
  735. package/dist/chunks/ar-Ctrv6cIi.mjs.map +0 -1
  736. package/dist/chunks/de-JhGflzS5.mjs +0 -2
  737. package/dist/chunks/de-JhGflzS5.mjs.map +0 -1
  738. package/dist/chunks/es-Bv7bDbMp.mjs +0 -2
  739. package/dist/chunks/es-Bv7bDbMp.mjs.map +0 -1
  740. package/dist/chunks/fr-DtzIu6tU.mjs +0 -2
  741. package/dist/chunks/fr-DtzIu6tU.mjs.map +0 -1
  742. package/dist/chunks/full-BiQ93ERr.mjs +0 -2
  743. package/dist/chunks/full-BiQ93ERr.mjs.map +0 -1
  744. package/dist/chunks/hi-Bu799xIO.mjs +0 -2
  745. package/dist/chunks/hi-Bu799xIO.mjs.map +0 -1
  746. package/dist/chunks/minimal-DO7LiFTa.mjs +0 -2
  747. package/dist/chunks/minimal-DO7LiFTa.mjs.map +0 -1
  748. package/dist/chunks/pt-DmN9u3NX.mjs +0 -2
  749. package/dist/chunks/pt-DmN9u3NX.mjs.map +0 -1
  750. package/dist/chunks/register-Cb1YTAN4.mjs +0 -3
  751. package/dist/chunks/register-Cb1YTAN4.mjs.map +0 -1
  752. package/dist/chunks/ru-BxySx7an.mjs +0 -2
  753. package/dist/chunks/ru-BxySx7an.mjs.map +0 -1
  754. package/dist/chunks/src-5GKFQ2mQ.mjs +0 -2
  755. package/dist/chunks/src-5GKFQ2mQ.mjs.map +0 -1
  756. package/dist/chunks/zh-DuucmOns.mjs +0 -2
  757. package/dist/chunks/zh-DuucmOns.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"SelectionTransactions-mQ1NfMEg.mjs","names":[],"sources":["../../src/state/SelectionTransactions.ts"],"sourcesContent":["/**\n * Shared transaction builders for cursor and selection movement.\n *\n * These helpers encapsulate the common pattern of building a transaction\n * that sets a new selection and clears storedMarks.\n */\n\nimport { findNodePath } from '../model/NodeResolver.js';\nimport {\n\tcreateCollapsedSelection,\n\tcreateNodeSelection,\n\tcreateSelection,\n} from '../model/Selection.js';\nimport type { BlockId } from '../model/TypeBrands.js';\nimport type { EditorState } from './EditorState.js';\nimport type { Transaction } from './Transaction.js';\n\n/** Builds a collapsed-cursor transaction that clears storedMarks. */\nexport function moveTx(state: EditorState, blockId: BlockId, offset: number): Transaction {\n\treturn state\n\t\t.transaction('input')\n\t\t.setSelection(createCollapsedSelection(blockId, offset))\n\t\t.setStoredMarks(null, state.storedMarks)\n\t\t.build();\n}\n\n/** Builds a NodeSelection transaction that clears storedMarks. */\nexport function nodeSelTx(state: EditorState, targetId: BlockId): Transaction {\n\tconst path: BlockId[] = (findNodePath(state.doc, targetId) ?? []) as BlockId[];\n\treturn state\n\t\t.transaction('input')\n\t\t.setSelection(createNodeSelection(targetId, path))\n\t\t.setStoredMarks(null, state.storedMarks)\n\t\t.build();\n}\n\n/** Builds a range-selection transaction that clears storedMarks. */\nexport function extendTx(\n\tstate: EditorState,\n\tanchorBlockId: BlockId,\n\tanchorOffset: number,\n\theadBlockId: BlockId,\n\theadOffset: number,\n): Transaction {\n\treturn state\n\t\t.transaction('input')\n\t\t.setSelection(\n\t\t\tcreateSelection(\n\t\t\t\t{ blockId: anchorBlockId, offset: anchorOffset },\n\t\t\t\t{ blockId: headBlockId, offset: headOffset },\n\t\t\t),\n\t\t)\n\t\t.setStoredMarks(null, state.storedMarks)\n\t\t.build();\n}\n"],"mappings":"2GAkBA,SAAgB,EAAO,EAAoB,EAAkB,GAC5D,OAAO,EACL,YAAY,SACZ,aAAa,EAAyB,EAAS,IAC/C,eAAe,KAAM,EAAM,aAC3B,OACH,CAGA,SAAgB,EAAU,EAAoB,GAC7C,MAAM,EAAmB,EAAa,EAAM,IAAK,IAAa,GAC9D,OAAO,EACL,YAAY,SACZ,aAAa,EAAoB,EAAU,IAC3C,eAAe,KAAM,EAAM,aAC3B,OACH,CAGA,SAAgB,EACf,EACA,EACA,EACA,EACA,GAEA,OAAO,EACL,YAAY,SACZ,aACA,EACC,CAAE,QAAS,EAAe,OAAQ,GAClC,CAAE,QAAS,EAAa,OAAQ,KAGjC,eAAe,KAAM,EAAM,aAC3B,OACH"}
1
+ {"version":3,"file":"SelectionTransactions-mQ1NfMEg.mjs","names":["findNodePath","createNodeSelection","createCollapsedSelection","createSelection","moveTx","state","blockId","offset","transaction","setSelection","setStoredMarks","storedMarks","build","nodeSelTx","targetId","path","doc","extendTx","anchorBlockId","anchorOffset","headBlockId","headOffset"],"sources":["../../src/state/SelectionTransactions.ts"],"sourcesContent":["/**\n * Shared transaction builders for cursor and selection movement.\n *\n * These helpers encapsulate the common pattern of building a transaction\n * that sets a new selection and clears storedMarks.\n */\n\nimport { findNodePath } from '../model/NodeResolver.js';\nimport {\n\tcreateCollapsedSelection,\n\tcreateNodeSelection,\n\tcreateSelection,\n} from '../model/Selection.js';\nimport type { BlockId } from '../model/TypeBrands.js';\nimport type { EditorState } from './EditorState.js';\nimport type { Transaction } from './Transaction.js';\n\n/** Builds a collapsed-cursor transaction that clears storedMarks. */\nexport function moveTx(state: EditorState, blockId: BlockId, offset: number): Transaction {\n\treturn state\n\t\t.transaction('input')\n\t\t.setSelection(createCollapsedSelection(blockId, offset))\n\t\t.setStoredMarks(null, state.storedMarks)\n\t\t.build();\n}\n\n/** Builds a NodeSelection transaction that clears storedMarks. */\nexport function nodeSelTx(state: EditorState, targetId: BlockId): Transaction {\n\tconst path: BlockId[] = (findNodePath(state.doc, targetId) ?? []) as BlockId[];\n\treturn state\n\t\t.transaction('input')\n\t\t.setSelection(createNodeSelection(targetId, path))\n\t\t.setStoredMarks(null, state.storedMarks)\n\t\t.build();\n}\n\n/** Builds a range-selection transaction that clears storedMarks. */\nexport function extendTx(\n\tstate: EditorState,\n\tanchorBlockId: BlockId,\n\tanchorOffset: number,\n\theadBlockId: BlockId,\n\theadOffset: number,\n): Transaction {\n\treturn state\n\t\t.transaction('input')\n\t\t.setSelection(\n\t\t\tcreateSelection(\n\t\t\t\t{ blockId: anchorBlockId, offset: anchorOffset },\n\t\t\t\t{ blockId: headBlockId, offset: headOffset },\n\t\t\t),\n\t\t)\n\t\t.setStoredMarks(null, state.storedMarks)\n\t\t.build();\n}\n"],"mappings":"Y,+FAkBA,SAAgBI,EAAOC,EAAoBC,EAAkBC,GAC5D,OAAOF,EACLG,YAAY,SACZC,aAAaP,EAAyBI,EAASC,IAC/CG,eAAe,KAAML,EAAMM,aAC3BC,OACH,CAGA,SAAgBC,EAAUR,EAAoBS,GAC7C,MAAMC,EAAmBf,EAAaK,EAAMW,IAAKF,IAAa,GAC9D,OAAOT,EACLG,YAAY,SACZC,aAAaR,EAAoBa,EAAUC,IAC3CL,eAAe,KAAML,EAAMM,aAC3BC,OACH,CAGA,SAAgBK,EACfZ,EACAa,EACAC,EACAC,EACAC,GAEA,OAAOhB,EACLG,YAAY,SACZC,aACAN,EACC,CAAEG,QAASY,EAAeX,OAAQY,GAClC,CAAEb,QAASc,EAAab,OAAQc,KAGjCX,eAAe,KAAML,EAAMM,aAC3BC,OACH,Q"}
@@ -1 +1 @@
1
- {"version":3,"file":"ShortcutFormatting-TwiufqeV.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,IACtD"}
1
+ {"version":3,"file":"ShortcutFormatting-TwiufqeV.mjs","names":["isMac","formatShortcut","binding","replace"],"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":"Y,gCASA,SAAgBC,EAAeC,GAC9B,OAAIF,IACIE,EACLC,QAAQ,OAAQ,KAChBA,QAAQ,SAAU,KAClBA,QAAQ,OAAQ,KAChBA,QAAQ,KAAM,IAEVD,EAAQC,QAAQ,OAAQ,QAAQA,QAAQ,KAAM,IACtD,Q"}
@@ -0,0 +1,2 @@
1
+ import{i as o}from"./TypeBrands-Ch9856Gb.mjs";import{i as r,t as a}from"./MarkCommands-C0ps9h0z.mjs";import{r as t}from"./LocaleLoader-DEpTFuVc.mjs";function e(e,m){const i=o(m.markSpec.type);e.registerMarkSpec(m.markSpec),e.registerCommand(m.command,()=>t(e,r(e.getState(),i))),m.keyBinding&&e.registerKeymap({[m.keyBinding]:()=>e.executeCommand(m.command)}),m.toolbar&&e.registerToolbarItem({id:m.toolbar.id,group:m.toolbar.group,icon:m.toolbar.icon,label:m.toolbar.label,tooltip:m.toolbar.tooltip,command:m.command,isActive:o=>a(o,i)})}export{e as t};
2
+ //# sourceMappingURL=SimpleMark-DPTsIl9w.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SimpleMark-DPTsIl9w.mjs","names":["markType","toggleMark","isMarkActive","dispatchIfPresent","registerSimpleMark","context","def","type","markSpec","registerMarkSpec","registerCommand","command","getState","keyBinding","registerKeymap","executeCommand","toolbar","registerToolbarItem","id","group","icon","label","tooltip","isActive","state"],"sources":["../../src/plugins/shared/SimpleMark.ts"],"sourcesContent":["/**\n * Registers the common core of a simple toggle mark: its MarkSpec, a toggle\n * command, an optional keyboard shortcut, and an optional toolbar button.\n *\n * Plugins that need more (input rules, exclusivity middleware, config-driven\n * variants) layer those on top after calling this — it deliberately models only\n * the shared core, not every mark plugin.\n */\n\nimport { isMarkActive, toggleMark } from '../../commands/Commands.js';\nimport type { MarkSpec } from '../../model/MarkSpec.js';\nimport { markType } from '../../model/TypeBrands.js';\nimport type { PluginContext } from '../Plugin.js';\nimport { dispatchIfPresent } from './PluginHelpers.js';\n\nexport interface SimpleMarkToolbar {\n\treadonly id: string;\n\treadonly group: string;\n\treadonly icon: string;\n\treadonly label: string;\n\treadonly tooltip: string;\n}\n\nexport interface SimpleMarkDefinition {\n\t/** The mark spec to register (defines DOM/HTML rendering and parsing). */\n\treadonly markSpec: MarkSpec;\n\t/** Toggle command name, e.g. `'toggleStrikethrough'`. */\n\treadonly command: string;\n\t/** Keyboard shortcut bound to the command; omit or `null` to skip. */\n\treadonly keyBinding?: string | null;\n\t/** Toolbar button; omit to skip. */\n\treadonly toolbar?: SimpleMarkToolbar;\n}\n\n/** Registers a simple toggle mark's spec, command, keymap, and toolbar item. */\nexport function registerSimpleMark(context: PluginContext, def: SimpleMarkDefinition): void {\n\tconst type = markType(def.markSpec.type);\n\n\tcontext.registerMarkSpec(def.markSpec);\n\n\tcontext.registerCommand(def.command, () =>\n\t\tdispatchIfPresent(context, toggleMark(context.getState(), type)),\n\t);\n\n\tif (def.keyBinding) {\n\t\tcontext.registerKeymap({ [def.keyBinding]: () => context.executeCommand(def.command) });\n\t}\n\n\tif (def.toolbar) {\n\t\tcontext.registerToolbarItem({\n\t\t\tid: def.toolbar.id,\n\t\t\tgroup: def.toolbar.group,\n\t\t\ticon: def.toolbar.icon,\n\t\t\tlabel: def.toolbar.label,\n\t\t\ttooltip: def.toolbar.tooltip,\n\t\t\tcommand: def.command,\n\t\t\tisActive: (state) => isMarkActive(state, type),\n\t\t});\n\t}\n}\n"],"mappings":"Y,yIAmCA,SAAgBI,EAAmBC,EAAwBC,GAC1D,MAAMC,EAAOP,EAASM,EAAIE,SAASD,MAEnCF,EAAQI,iBAAiBH,EAAIE,UAE7BH,EAAQK,gBAAgBJ,EAAIK,QAAA,IAC3BR,EAAkBE,EAASJ,EAAWI,EAAQO,WAAYL,KAGvDD,EAAIO,YACPR,EAAQS,eAAe,CAAA,CAAGR,EAAIO,YAAA,IAAmBR,EAAQU,eAAeT,EAAIK,WAGzEL,EAAIU,SACPX,EAAQY,oBAAoB,CAC3BC,GAAIZ,EAAIU,QAAQE,GAChBC,MAAOb,EAAIU,QAAQG,MACnBC,KAAMd,EAAIU,QAAQI,KAClBC,MAAOf,EAAIU,QAAQK,MACnBC,QAAShB,EAAIU,QAAQM,QACrBX,QAASL,EAAIK,QACbY,SAAWC,GAAUtB,EAAasB,EAAOjB,IAG5C,Q"}
@@ -0,0 +1,2 @@
1
+ import{E as t,_ as e,k as n,p as o}from"./Document-ssR6hBzG.mjs";import{n as s}from"./Selection-DC6AOGgF.mjs";import{a as c}from"./TypeBrands-Ch9856Gb.mjs";import{s as i}from"./BlockInsertion-CXfXqUZl.mjs";import{n as r}from"./TypedKeys-CA4bfw9O.mjs";import{s as a,t as l}from"./LocaleLoader-DEpTFuVc.mjs";import{n as d,t as u}from"./SelectionReplacement-Cj4FLlPz.mjs";import{o as h}from"./xml-BsV44TrJ.mjs";import{i as m,o as g,r as f,t as p}from"./XmlSupport-3Za6SIqF.mjs";var x=/\n(?:[ \t]*\n)+/;function j(t,e){return!t.detection&&!e.detection||!(!t.detection||!e.detection)&&t.detection.language===e.detection.language}function k(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 ")}.`}},C=/* #__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-BWOue6jG.mjs"),"./locales/de.ts":()=>import("./de-CTzAMkXC.mjs"),"./locales/es.ts":()=>import("./es-DDoqchUq.mjs"),"./locales/fr.ts":()=>import("./fr-eC0UdAPu.mjs"),"./locales/hi.ts":()=>import("./hi-DY55FuDK.mjs"),"./locales/nl.ts":()=>import("./nl-GBpv7W4L.mjs"),"./locales/pt.ts":()=>import("./pt-Bu7Mbz67.mjs"),"./locales/ru.ts":()=>import("./ru-DyCTlhjg.mjs"),"./locales/zh.ts":()=>import("./zh-D1HSmSOf.mjs")});async function B(t){return l(C,t,b)}var S=new r("smartPaste"),y=[g,m,f,p],T=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 a(t,this.config.locale,b,B);const e=t.getService(h);if(e){for(const t of y){const n=e.get(t.id);e.register(n?{...n,detection:t.detection}:t)}e.onRegister(t=>{t.detection&&this.detectors.push(t.detection)})}if(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(S,{registerDetector:t=>{this.detectors.push(t)}})}destroy(){this.context=null,this.detectors.length=0}handlePaste=(t,e,n)=>{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||e.confidence===n.confidence&&e.language<n.language)&&(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];j(s,o)?e[e.length-1]=k(s,o):e.push(o)}return e}(s):null}(t,this.detectors);if(!o)return null;const s=n.transaction("paste"),c=d(n,s);if("code_block"===u(c)?.type)return null;const i={builder:s,target:c,selection:n.selection};return 1===o.length&&o[0]?.detection?this.handleSingleCodeBlock(i,o[0].detection):this.handleMixedContent(i,o)};handleSingleCodeBlock(t,e){const n=this.buildCodeBlockTransaction(t,e);return n&&this.context&&this.context.announce(this.locale.detectedAsCodeBlock(e.language)),n}buildCodeBlockTransaction(t,e){const{builder:n,target:o,selection:c}=t,r=this.createCodeBlockNode(e);return i(o.state,n,o.blockId,[r],c,this.context?.getSchemaRegistry())?(n.setSelection(s(r.id,e.formattedText.length)),n.build()):null}handleMixedContent(t,e){const n=this.buildMultiBlockTransaction(t,e);return n&&this.context&&this.announceMixedContent(e),n}buildMultiBlockTransaction(t,e){const{builder:o,selection:c}=t,{state:r,blockId:a}=t.target,l=e.map(t=>t.detection?this.createCodeBlockNode(t.detection):this.createParagraphNode(t.text));if(!i(r,o,a,l,c,this.context?.getSchemaRegistry()))return null;const d=l[l.length-1];return d&&o.setSelection(s(d.id,n(d))),o.build()}createCodeBlockNode(n){return o(c("code_block"),[e(n.formattedText)],t(),{language:n.language,backgroundColor:""})}createParagraphNode(n){return o(c("paragraph"),[e(n)],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,S as n,b as r,T as t};
2
+ //# sourceMappingURL=SmartPastePlugin-BSMHDDQ2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SmartPastePlugin-BSMHDDQ2.mjs","names":["generateBlockId","createTextNode","getBlockLength","createBlockNode","createCollapsedSelection","nodeType","insertBlocksAfterAnchor","ServiceKey","resolveLocale","loadLocaleModule","resolveReplacementTarget","getReceivingBlock","LANGUAGE_REGISTRY_SERVICE_KEY","JSON_SUPPORT","JAVA_SUPPORT","TYPESCRIPT_SUPPORT","XML_SUPPORT","BLANK_LINE_SPLIT","canMerge","a","b","detection","language","merge","joinedText","text","detA","detB","formattedText","confidence","Math","max","SMART_PASTE_LOCALE_EN","detectedAsCodeBlock","detectedMixedContent","textCount","codeCount","languages","parts","push","langList","join","localeModules","Object","assign","async","loadSmartPasteLocale","lang","SMART_PASTE_SERVICE_KEY","BUILTIN_LANGUAGE_SUPPORTS","SmartPastePlugin","id","name","dependencies","config","detectors","context","locale","constructor","this","init","registry","getService","support","existing","get","register","onRegister","detector","registerPasteInterceptor","handlePaste","priority","registerService","registerDetector","destroy","length","plainText","_html","state","segments","trimmed","split","map","s","trim","filter","hasCode","segmentText","best","result","detect","detectBest","merged","i","current","previous","mergeAdjacentSegments","splitAndClassify","builder","transaction","target","type","paste","selection","handleSingleCodeBlock","handleMixedContent","tr","buildCodeBlockTransaction","announce","codeBlock","createCodeBlockNode","blockId","getSchemaRegistry","setSelection","build","buildMultiBlockTransaction","announceMixedContent","working","anchorBlockId","blocks","segment","createParagraphNode","lastBlock","backgroundColor","includes"],"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/**\n * Picks the highest-confidence detection result from all detectors.\n * Ties are broken deterministically by lexicographic language id so the\n * outcome does not depend on detector registration order.\n */\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) continue;\n\t\tif (\n\t\t\tbest === null ||\n\t\t\tresult.confidence > best.confidence ||\n\t\t\t(result.confidence === best.confidence && result.language < best.language)\n\t\t) {\n\t\t\tbest = result;\n\t\t}\n\t}\n\n\treturn best;\n}\n\n/** Two segments can merge if both are text or both are code of the same language. */\nfunction canMerge(a: PasteSegment, b: PasteSegment): boolean {\n\tif (!a.detection && !b.detection) return true;\n\tif (a.detection && b.detection) return a.detection.language === b.detection.language;\n\treturn false;\n}\n\n/** Merges two compatible segments into one. */\nfunction merge(a: PasteSegment, b: PasteSegment): PasteSegment {\n\tconst joinedText: string = `${a.text}\\n\\n${b.text}`;\n\n\tif (!a.detection && !b.detection) {\n\t\treturn { text: joinedText, detection: null };\n\t}\n\n\tconst detA: DetectionResult = a.detection as DetectionResult;\n\tconst detB: DetectionResult = b.detection as DetectionResult;\n\n\treturn {\n\t\ttext: joinedText,\n\t\tdetection: {\n\t\t\tlanguage: detA.language,\n\t\t\tformattedText: `${detA.formattedText}\\n\\n${detB.formattedText}`,\n\t\t\tconfidence: Math.max(detA.confidence, detB.confidence),\n\t\t},\n\t};\n}\n","/** Locale interface and default English locale for the SmartPastePlugin. */\n\nimport { type LocaleModuleMap, loadLocaleModule } from '../shared/LocaleLoader.js';\n\nexport interface SmartPasteLocale {\n\treadonly detectedAsCodeBlock: (language: string) => string;\n\treadonly detectedMixedContent: (\n\t\ttextCount: number,\n\t\tcodeCount: number,\n\t\tlanguages: readonly string[],\n\t) => string;\n}\n\nexport const SMART_PASTE_LOCALE_EN: SmartPasteLocale = {\n\tdetectedAsCodeBlock: (language: string) =>\n\t\t`Pasted as ${language} code block with syntax highlighting.`,\n\tdetectedMixedContent: (textCount: number, codeCount: number, languages: readonly string[]) => {\n\t\tconst parts: string[] = [];\n\t\tif (textCount > 0) {\n\t\t\tparts.push(`${textCount} paragraph${textCount > 1 ? 's' : ''}`);\n\t\t}\n\t\tif (codeCount > 0) {\n\t\t\tconst langList: string = languages.join(', ');\n\t\t\tparts.push(`${codeCount} code block${codeCount > 1 ? 's' : ''} (${langList})`);\n\t\t}\n\t\treturn `Pasted as ${parts.join(' and ')}.`;\n\t},\n};\n\nconst localeModules: LocaleModuleMap<SmartPasteLocale> = import.meta.glob<{\n\tdefault: SmartPasteLocale;\n}>('./locales/*.ts', { eager: false });\n\nexport async function loadSmartPasteLocale(lang: string): Promise<SmartPasteLocale> {\n\treturn loadLocaleModule(localeModules, lang, SMART_PASTE_LOCALE_EN);\n}\n","/**\n * Types for the smart paste plugin — content detection and formatting.\n */\n\nimport { ServiceKey } from '../Plugin.js';\nimport type { SmartPasteLocale } from './SmartPasteLocale.js';\n\n/** Result of detecting structured content in pasted text. */\nexport interface DetectionResult {\n\treadonly language: string;\n\treadonly formattedText: string;\n\treadonly confidence: number;\n}\n\n/** A classified segment of pasted text — either plain text or detected code. */\nexport interface PasteSegment {\n\treadonly text: string;\n\treadonly detection: DetectionResult | null;\n}\n\n/** Interface for content detectors that identify and format pasted text. */\nexport interface ContentDetector {\n\treadonly id: string;\n\tdetect(text: string): DetectionResult | null;\n}\n\n/** Configuration for the SmartPastePlugin. */\nexport interface SmartPasteConfig {\n\treadonly detectors?: readonly ContentDetector[];\n\treadonly locale?: SmartPasteLocale;\n}\n\n/** Public service for registering additional content detectors at runtime. */\nexport interface SmartPasteService {\n\tregisterDetector(detector: ContentDetector): void;\n}\n\nexport const SMART_PASTE_SERVICE_KEY = new ServiceKey<SmartPasteService>('smartPaste');\n","/**\n * SmartPastePlugin: detects structured content in clipboard text\n * and inserts it as formatted code blocks with syntax highlighting.\n * Mixed content (text + code) is split into separate blocks.\n */\n\nimport { insertBlocksAfterAnchor } from '../../commands/BlockInsertion.js';\nimport {\n\ttype ReplacementTarget,\n\tgetReceivingBlock,\n\tresolveReplacementTarget,\n} from '../../commands/SelectionReplacement.js';\nimport {\n\ttype BlockNode,\n\tcreateBlockNode,\n\tcreateTextNode,\n\tgenerateBlockId,\n\tgetBlockLength,\n} from '../../model/Document.js';\nimport { type EditorSelection, createCollapsedSelection } from '../../model/Selection.js';\nimport { nodeType } from '../../model/TypeBrands.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { Transaction, TransactionBuilder } from '../../state/Transaction.js';\nimport type { PasteInterceptor, Plugin, PluginContext } from '../Plugin.js';\nimport { LANGUAGE_REGISTRY_SERVICE_KEY } from '../language/LanguageTypes.js';\nimport {\n\tJAVA_SUPPORT,\n\tJSON_SUPPORT,\n\tTYPESCRIPT_SUPPORT,\n\tXML_SUPPORT,\n} from '../language/bundles/index.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\nconst BUILTIN_LANGUAGE_SUPPORTS = [\n\tJAVA_SUPPORT,\n\tJSON_SUPPORT,\n\tTYPESCRIPT_SUPPORT,\n\tXML_SUPPORT,\n] as const;\n\n/** A paste whose selection deletion is already recorded in `builder`. */\ninterface ReplacementPaste {\n\treadonly builder: TransactionBuilder;\n\treadonly target: ReplacementTarget;\n\treadonly selection: EditorSelection;\n}\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// Detection belongs to Smart Paste, while Code Block contributes only\n\t\t// highlighting. Preserve those existing capabilities when adding detectors.\n\t\tconst registry = context.getService(LANGUAGE_REGISTRY_SERVICE_KEY);\n\t\tif (registry) {\n\t\t\tfor (const support of BUILTIN_LANGUAGE_SUPPORTS) {\n\t\t\t\tconst existing = registry.get(support.id);\n\t\t\t\tregistry.register(existing ? { ...existing, detection: support.detection } : support);\n\t\t\t}\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\tconst segments: readonly PasteSegment[] | null = splitAndClassify(plainText, this.detectors);\n\t\tif (!segments) return null;\n\n\t\t// Text that lands in a code block is pasted literally by the code block.\n\t\tconst builder: TransactionBuilder = state.transaction('paste');\n\t\tconst target: ReplacementTarget = resolveReplacementTarget(state, builder);\n\t\tif (getReceivingBlock(target)?.type === 'code_block') return null;\n\n\t\tconst paste: ReplacementPaste = { builder, target, selection: state.selection };\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(paste, segments[0].detection);\n\t\t}\n\n\t\t// Mixed content: create multiple blocks\n\t\treturn this.handleMixedContent(paste, segments);\n\t};\n\n\t// --- Single Code Block (existing behavior) ---\n\n\tprivate handleSingleCodeBlock(\n\t\tpaste: ReplacementPaste,\n\t\tdetection: DetectionResult,\n\t): Transaction | null {\n\t\tconst tr: Transaction | null = this.buildCodeBlockTransaction(paste, 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\tpaste: ReplacementPaste,\n\t\tdetection: DetectionResult,\n\t): Transaction | null {\n\t\tconst { builder, target, selection } = paste;\n\n\t\t// Create the code block node\n\t\tconst codeBlock: BlockNode = this.createCodeBlockNode(detection);\n\n\t\t// Insert at cursor (actual parent or root escape, empty anchor removal)\n\t\tif (\n\t\t\t!insertBlocksAfterAnchor(\n\t\t\t\ttarget.state,\n\t\t\t\tbuilder,\n\t\t\t\ttarget.blockId,\n\t\t\t\t[codeBlock],\n\t\t\t\tselection,\n\t\t\t\tthis.context?.getSchemaRegistry(),\n\t\t\t)\n\t\t) {\n\t\t\treturn null;\n\t\t}\n\n\t\tbuilder.setSelection(createCollapsedSelection(codeBlock.id, detection.formattedText.length));\n\n\t\treturn builder.build();\n\t}\n\n\t// --- Mixed Content (multiple blocks) ---\n\n\tprivate handleMixedContent(\n\t\tpaste: ReplacementPaste,\n\t\tsegments: readonly PasteSegment[],\n\t): Transaction | null {\n\t\tconst tr: Transaction | null = this.buildMultiBlockTransaction(paste, 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\tpaste: ReplacementPaste,\n\t\tsegments: readonly PasteSegment[],\n\t): Transaction | null {\n\t\tconst { builder, selection } = paste;\n\t\tconst { state: working, blockId: anchorBlockId } = paste.target;\n\t\tconst blocks: readonly BlockNode[] = segments.map((segment) =>\n\t\t\tsegment.detection\n\t\t\t\t? this.createCodeBlockNode(segment.detection)\n\t\t\t\t: this.createParagraphNode(segment.text),\n\t\t);\n\t\tif (\n\t\t\t!insertBlocksAfterAnchor(\n\t\t\t\tworking,\n\t\t\t\tbuilder,\n\t\t\t\tanchorBlockId,\n\t\t\t\tblocks,\n\t\t\t\tselection,\n\t\t\t\tthis.context?.getSchemaRegistry(),\n\t\t\t)\n\t\t) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst lastBlock = blocks[blocks.length - 1];\n\t\tif (lastBlock) {\n\t\t\tbuilder.setSelection(createCollapsedSelection(lastBlock.id, getBlockLength(lastBlock)));\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'),\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(nodeType('paragraph'), [createTextNode(text)], generateBlockId());\n\t}\n\n\tprivate announceMixedContent(segments: readonly PasteSegment[]): void {\n\t\tlet textCount = 0;\n\t\tlet codeCount = 0;\n\t\tconst languages: string[] = [];\n\n\t\tfor (const segment of segments) {\n\t\t\tif (segment.detection) {\n\t\t\t\tcodeCount++;\n\t\t\t\tif (!languages.includes(segment.detection.language)) {\n\t\t\t\t\tlanguages.push(segment.detection.language);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttextCount++;\n\t\t\t}\n\t\t}\n\n\t\tthis.context?.announce(this.locale.detectedMixedContent(textCount, codeCount, languages));\n\t}\n}\n"],"mappings":"Y,+cAQA,IAAMiB,EAA2B,kBA8EjC,SAASC,EAASC,EAAiBC,GAClC,OAAKD,EAAEE,YAAcD,EAAEC,cACnBF,EAAEE,YAAaD,EAAEC,YAAkBF,EAAEE,UAAUC,WAAaF,EAAEC,UAAUC,QAE7E,CAGA,SAASC,EAAMJ,EAAiBC,GAC/B,MAAMI,EAAqB,GAAGL,EAAEM,WAAWL,EAAEK,OAE7C,IAAKN,EAAEE,YAAcD,EAAEC,UACtB,MAAO,CAAEI,KAAMD,EAAYH,UAAW,MAGvC,MAAMK,EAAwBP,EAAEE,UAC1BM,EAAwBP,EAAEC,UAEhC,MAAO,CACNI,KAAMD,EACNH,UAAW,CACVC,SAAUI,EAAKJ,SACfM,cAAe,GAAGF,EAAKE,oBAAoBD,EAAKC,gBAChDC,WAAYC,KAAKC,IAAIL,EAAKG,WAAYF,EAAKE,aAG9C,CClGA,IAAaG,EAA0C,CACtDC,oBAAsBX,GACrB,aAAaA,yCACdY,qBAAA,CAAuBC,EAAmBC,EAAmBC,KAC5D,MAAMC,EAAkB,GAIxB,GAHIH,EAAY,GACfG,EAAMC,KAAK,GAAGJ,cAAsBA,EAAY,EAAI,IAAM,MAEvDC,EAAY,EAAG,CAClB,MAAMI,EAAmBH,EAAUI,KAAK,MACxCH,EAAMC,KAAK,GAAGH,eAAuBA,EAAY,EAAI,IAAM,OAAOI,KACnE,CACA,MAAO,aAAaF,EAAMG,KAAK,cAI3BC,iBAAmDC,OAAAC,OAAA,CAAA,kBAAA,WAAA,qBAAA,kBAAA,WAAA,qBAAA,kBAAA,WAAA,qBAAA,kBAAA,WAAA,qBAAA,kBAAA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E,EAAS,cACT,CAACJ,EAAeoB,EAAUO,gBAC1B5B,IACA,CAAEsB,SAAUD,EAAUC,SAAUqG,gBAAiB,IAEnD,CAEA,mBAAAF,CAA4BhG,GAC3B,OAAOtB,EAAgBE,EAAS,aAAc,CAACJ,EAAewB,IAAQzB,IACvE,CAEA,oBAAAoH,CAA6BrC,GAC5B,IAAI5C,EAAY,EACZC,EAAY,EAChB,MAAMC,EAAsB,GAE5B,IAAK,MAAMmF,KAAWzC,EACjByC,EAAQnG,WACXe,IACKC,EAAUuF,SAASJ,EAAQnG,UAAUC,WACzCe,EAAUE,KAAKiF,EAAQnG,UAAUC,WAGlCa,IAIFwB,KAAKH,SAASoD,SAASjD,KAAKF,OAAOvB,qBAAqBC,EAAWC,EAAWC,GAC/E,U"}
@@ -1 +1 @@
1
- {"version":3,"file":"StarterFonts-BDQPg-cu.mjs","names":[],"sources":["../../src/plugins/font/StarterFonts.ts"],"sourcesContent":[null],"mappings":"AAQA,IAOa,EAA4B,CACxC,KAAM,YACN,OAAQ,yBACR,SAAU,YACV,UAAW,CACV,CACC,IAAK,u+sIACL,OAAQ,MACR,MAAO,YAMG,EAA4B,CACxC,KAAM,YACN,OAAQ,0BACR,SAAU,aACV,UAAW,CACV,CACC,IAAK,+rgLACL,OAAQ,MACR,MAAO,YAMG,EAA2C,CAAC,EAAW"}
1
+ {"version":3,"file":"StarterFonts-BDQPg-cu.mjs","names":["FIRA_CODE","name","family","category","fontFaces","src","weight","style","FIRA_SANS","STARTER_FONTS"],"sources":["../../src/plugins/font/StarterFonts.ts"],"sourcesContent":[null],"mappings":"AAQA,IAOaA,EAA4B,CACxCC,KAAM,YACNC,OAAQ,yBACRC,SAAU,YACVC,UAAW,CACV,CACCC,IAAK,u+sIACLC,OAAQ,MACRC,MAAO,YAMGC,EAA4B,CACxCP,KAAM,YACNC,OAAQ,0BACRC,SAAU,aACVC,UAAW,CACV,CACCC,IAAK,+rgLACLC,OAAQ,MACRC,MAAO,YAMGE,EAA2C,CAACD,EAAWR,U"}
@@ -0,0 +1,2 @@
1
+ import{s as t,t as s}from"./LocaleLoader-DEpTFuVc.mjs";import{t as o}from"./MarkInputRule-DNneF2gp.mjs";import{t as r}from"./ShortcutFormatting-TwiufqeV.mjs";import{t as i}from"./SimpleMark-DPTsIl9w.mjs";var e={label:"Strikethrough",tooltip:t=>`Strikethrough (${t})`},a=/* #__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-XmSFrtmd.mjs"),"./locales/de.ts":()=>import("./de-DViI26lG.mjs"),"./locales/es.ts":()=>import("./es-paXY7HFt.mjs"),"./locales/fr.ts":()=>import("./fr-ZsRdLuys.mjs"),"./locales/hi.ts":()=>import("./hi-CTWubxLY.mjs"),"./locales/nl.ts":()=>import("./nl-Cwl5dxFZ.mjs"),"./locales/pt.ts":()=>import("./pt-paXY7HFt.mjs"),"./locales/ru.ts":()=>import("./ru-Y11wuxOB.mjs"),"./locales/zh.ts":()=>import("./zh-C7iCgCRP.mjs")});async function l(t){return s(a,t,e)}var h={},m=class{id="strikethrough";name="Strikethrough";priority=22;config;locale;constructor(t){this.config={...h,...t}}async init(s){this.locale=await t(s,this.config.locale,e,l),i(s,{markSpec:{type:"strikethrough",rank:3,toDOM:()=>document.createElement("s"),toHTMLString:(t,s)=>`<s>${s}</s>`,parseHTML:[{tag:"s"},{tag:"strike"},{tag:"del"},{tag:"span",getAttrs:t=>!!t.style.textDecoration.includes("line-through")&&{}}],sanitize:{tags:["s"]}},command:"toggleStrikethrough",keyBinding:"Mod-Shift-X",toolbar:{id:"strikethrough",group:"format",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 19h4v-3h-4v3zM5 4v3h5v3h4V7h5V4H5zM3 14h18v-2H3v2z"/></svg>',label:this.locale.label,tooltip:this.locale.tooltip(r("Mod-Shift-X"))}}),!1!==this.config.inputRule&&s.registerInputRule(o("strikethrough","~~"))}};export{e as n,l as r,m as t};
2
+ //# sourceMappingURL=StrikethroughPlugin-CqqIF3Zk.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StrikethroughPlugin-CqqIF3Zk.mjs","names":["resolveLocale","loadLocaleModule","createMarkInputRule","formatShortcut","registerSimpleMark","STRIKETHROUGH_LOCALE_EN","label","tooltip","shortcut","localeModules","Object","assign","async","loadStrikethroughLocale","lang","DEFAULT_CONFIG","StrikethroughPlugin","id","name","priority","config","locale","constructor","this","init","context","markSpec","type","rank","toDOM","document","createElement","toHTMLString","_mark","content","parseHTML","tag","getAttrs","el","style","textDecoration","includes","sanitize","tags","command","keyBinding","toolbar","group","icon","inputRule","registerInputRule"],"sources":["../../src/plugins/strikethrough/StrikethroughLocale.ts","../../src/plugins/strikethrough/StrikethroughPlugin.ts"],"sourcesContent":["/**\n * Locale interface and default English locale for the StrikethroughPlugin.\n */\n\nimport { type LocaleModuleMap, loadLocaleModule } from '../shared/LocaleLoader.js';\n\n// --- Locale Interface ---\n\nexport interface StrikethroughLocale {\n\treadonly label: string;\n\treadonly tooltip: (shortcut: string) => string;\n}\n\n// --- Default English Locale ---\n\nexport const STRIKETHROUGH_LOCALE_EN: StrikethroughLocale = {\n\tlabel: 'Strikethrough',\n\ttooltip: (shortcut: string) => `Strikethrough (${shortcut})`,\n};\n\n// --- Lazy Locale Loader ---\n\nconst localeModules: LocaleModuleMap<StrikethroughLocale> = import.meta.glob<{\n\tdefault: StrikethroughLocale;\n}>('./locales/*.ts', { eager: false });\n\nexport async function loadStrikethroughLocale(lang: string): Promise<StrikethroughLocale> {\n\treturn loadLocaleModule(localeModules, lang, STRIKETHROUGH_LOCALE_EN);\n}\n","/**\n * StrikethroughPlugin: registers a strikethrough inline mark with MarkSpec,\n * toggle command, keyboard shortcut (Mod-Shift-X), and a toolbar button.\n */\n\nimport type { Plugin, PluginContext } from '../Plugin.js';\nimport { createMarkInputRule } from '../shared/MarkInputRule.js';\nimport { resolveLocale } from '../shared/PluginHelpers.js';\nimport { formatShortcut } from '../shared/ShortcutFormatting.js';\nimport { registerSimpleMark } from '../shared/SimpleMark.js';\nimport {\n\tSTRIKETHROUGH_LOCALE_EN,\n\ttype StrikethroughLocale,\n\tloadStrikethroughLocale,\n} from './StrikethroughLocale.js';\n\n// --- Attribute Registry Augmentation ---\n\ndeclare module '../../model/AttrRegistry.js' {\n\tinterface MarkAttrRegistry {\n\t\tstrikethrough: Record<string, never>;\n\t}\n}\n\n// --- Configuration ---\n\nexport interface StrikethroughConfig {\n\t/** Live Markdown shortcut: `~~x~~` to strikethrough. Default true. */\n\treadonly inputRule?: boolean;\n\treadonly locale?: StrikethroughLocale;\n}\n\nconst DEFAULT_CONFIG: StrikethroughConfig = {};\n\n// --- Plugin ---\n\nexport class StrikethroughPlugin implements Plugin {\n\treadonly id = 'strikethrough';\n\treadonly name = 'Strikethrough';\n\treadonly priority = 22;\n\n\tprivate readonly config: StrikethroughConfig;\n\tprivate locale!: StrikethroughLocale;\n\n\tconstructor(config?: Partial<StrikethroughConfig>) {\n\t\tthis.config = { ...DEFAULT_CONFIG, ...config };\n\t}\n\n\tasync init(context: PluginContext): Promise<void> {\n\t\tthis.locale = await resolveLocale(\n\t\t\tcontext,\n\t\t\tthis.config.locale,\n\t\t\tSTRIKETHROUGH_LOCALE_EN,\n\t\t\tloadStrikethroughLocale,\n\t\t);\n\t\tconst icon =\n\t\t\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M10 19h4v-3h-4v3zM5 4v3h5v3h4V7h5V4H5zM3 14h18v-2H3v2z\"/></svg>';\n\n\t\tregisterSimpleMark(context, {\n\t\t\tmarkSpec: {\n\t\t\t\ttype: 'strikethrough',\n\t\t\t\trank: 3,\n\t\t\t\ttoDOM() {\n\t\t\t\t\treturn document.createElement('s');\n\t\t\t\t},\n\t\t\t\ttoHTMLString: (_mark, content) => `<s>${content}</s>`,\n\t\t\t\tparseHTML: [\n\t\t\t\t\t{ tag: 's' },\n\t\t\t\t\t{ tag: 'strike' },\n\t\t\t\t\t{ tag: 'del' },\n\t\t\t\t\t{\n\t\t\t\t\t\ttag: 'span',\n\t\t\t\t\t\tgetAttrs: (el: HTMLElement) => {\n\t\t\t\t\t\t\treturn el.style.textDecoration.includes('line-through') ? {} : false;\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tsanitize: { tags: ['s'] },\n\t\t\t},\n\t\t\tcommand: 'toggleStrikethrough',\n\t\t\tkeyBinding: 'Mod-Shift-X',\n\t\t\ttoolbar: {\n\t\t\t\tid: 'strikethrough',\n\t\t\t\tgroup: 'format',\n\t\t\t\ticon,\n\t\t\t\tlabel: this.locale.label,\n\t\t\t\ttooltip: this.locale.tooltip(formatShortcut('Mod-Shift-X')),\n\t\t\t},\n\t\t});\n\n\t\tif (this.config.inputRule !== false) {\n\t\t\tcontext.registerInputRule(createMarkInputRule('strikethrough', '~~'));\n\t\t}\n\t}\n}\n"],"mappings":"Y,gMAeA,IAAaK,EAA+C,CAC3DC,MAAO,gBACPC,QAAUC,GAAqB,kBAAkBA,MAK5CC,iBAAsDC,OAAAC,OAAA,CAAA,kBAAA,WAAA,qBAAA,kBAAA,WAAA,qBAAA,kBAAA,WAAA,qBAAA,kBAAA,WAAA,qBAAA,kBAAA,WAAA,qBAAA,kBAAA,WAAA,qBAAA,kBAAA,WAAA,qBAAA,kBAAA,WAAA,qBAAA,kBAAA,WAAA,uBAI5DC,eAAsBC,EAAwBC,GAC7C,OAAOb,EAAiBQ,EAAeK,EAAMT,EAC9C,CCIA,IAAMU,EAAsC,CAAC,EAIhCC,EAAb,MACCC,GAAc,gBACdC,KAAgB,gBAChBC,SAAoB,GAEpBC,OACAC,OAEA,WAAAC,CAAYF,GACXG,KAAKH,OAAS,IAAKL,KAAmBK,EACvC,CAEA,UAAMI,CAAKC,GACVF,KAAKF,aAAerB,EACnByB,EACAF,KAAKH,OAAOC,OACZhB,EACAQ,GAKDT,EAAmBqB,EAAS,CAC3BC,SAAU,CACTC,KAAM,gBACNC,KAAM,EACNC,MAAA,IACQC,SAASC,cAAc,KAE/BC,aAAA,CAAeC,EAAOC,IAAY,MAAMA,QACxCC,UAAW,CACV,CAAEC,IAAK,KACP,CAAEA,IAAK,UACP,CAAEA,IAAK,OACP,CACCA,IAAK,OACLC,SAAWC,KACHA,EAAGC,MAAMC,eAAeC,SAAS,iBAAkB,CAAC,IAI9DC,SAAU,CAAEC,KAAM,CAAC,OAEpBC,QAAS,sBACTC,WAAY,cACZC,QAAS,CACR7B,GAAI,gBACJ8B,MAAO,SACPC,KAAA,uIACA1C,MAAOiB,KAAKF,OAAOf,MACnBC,QAASgB,KAAKF,OAAOd,QAAQJ,EAAe,oBAIhB,IAA1BoB,KAAKH,OAAO6B,WACfxB,EAAQyB,kBAAkBhD,EAAoB,gBAAiB,MAEjE,U"}
@@ -1 +1 @@
1
- {"version":3,"file":"StyleClassNames-BsAx7k5T.mjs","names":[],"sources":["../../src/plugins/shared/StyleClassNames.ts"],"sourcesContent":["/**\n * The `styleClasses` option of formatting plugins (#269): application CSS\n * classes keyed by the plugin's own values, registered as one style class per\n * entry. Kept out of `PluginHelpers` so only plugins that offer the option load it.\n */\n\nimport type { StyleClassNames } from '../../model/StyleClass.js';\nimport type { PluginContext } from '../Plugin.js';\n\n/**\n * Registers a plugin's `styleClasses` option. `declarationFor` turns a key into\n * the declaration the plugin exports for that value, with the same function\n * its export uses, and throws a `TypeError` for a key that is not a valid value.\n * Errors name the plugin, so a misconfiguration fails `init()` with a clear fix.\n */\nexport function registerStyleClassNames(\n\tcontext: PluginContext,\n\towner: string,\n\tstyleClasses: StyleClassNames<PropertyKey> | undefined,\n\tdeclarationFor: (key: string) => string,\n): void {\n\tif (!styleClasses) return;\n\tfor (const [key, className] of Object.entries(styleClasses)) {\n\t\tif (className === undefined) continue;\n\t\ttry {\n\t\t\tcontext.registerStyleClass({ className, declaration: declarationFor(key) });\n\t\t} catch (error: unknown) {\n\t\t\tif (!(error instanceof TypeError)) throw error;\n\t\t\tthrow new TypeError(`${owner} styleClasses: ${error.message}`);\n\t\t}\n\t}\n}\n"],"mappings":"AAeA,SAAgB,EACf,EACA,EACA,EACA,GAEA,GAAK,EACL,IAAK,MAAO,EAAK,KAAc,OAAO,QAAQ,GAC7C,QAAkB,IAAd,EACJ,IACC,EAAQ,mBAAmB,CAAE,YAAW,YAAa,EAAe,IACrE,CAAA,MAAS,GACR,KAAM,aAAiB,WAAY,MAAM,EACzC,MAAM,IAAI,UAAU,GAAG,mBAAuB,EAAM,UACrD,CAEF"}
1
+ {"version":3,"file":"StyleClassNames-BsAx7k5T.mjs","names":["registerStyleClassNames","context","owner","styleClasses","declarationFor","key","className","Object","entries","registerStyleClass","declaration","error","TypeError","message"],"sources":["../../src/plugins/shared/StyleClassNames.ts"],"sourcesContent":["/**\n * The `styleClasses` option of formatting plugins (#269): application CSS\n * classes keyed by the plugin's own values, registered as one style class per\n * entry. Kept out of `PluginHelpers` so only plugins that offer the option load it.\n */\n\nimport type { StyleClassNames } from '../../model/StyleClass.js';\nimport type { PluginContext } from '../Plugin.js';\n\n/**\n * Registers a plugin's `styleClasses` option. `declarationFor` turns a key into\n * the declaration the plugin exports for that value, with the same function\n * its export uses, and throws a `TypeError` for a key that is not a valid value.\n * Errors name the plugin, so a misconfiguration fails `init()` with a clear fix.\n */\nexport function registerStyleClassNames(\n\tcontext: PluginContext,\n\towner: string,\n\tstyleClasses: StyleClassNames<PropertyKey> | undefined,\n\tdeclarationFor: (key: string) => string,\n): void {\n\tif (!styleClasses) return;\n\tfor (const [key, className] of Object.entries(styleClasses)) {\n\t\tif (className === undefined) continue;\n\t\ttry {\n\t\t\tcontext.registerStyleClass({ className, declaration: declarationFor(key) });\n\t\t} catch (error: unknown) {\n\t\t\tif (!(error instanceof TypeError)) throw error;\n\t\t\tthrow new TypeError(`${owner} styleClasses: ${error.message}`);\n\t\t}\n\t}\n}\n"],"mappings":"AAeA,SAAgBA,EACfC,EACAC,EACAC,EACAC,GAEA,GAAKD,EACL,IAAK,MAAOE,EAAKC,KAAcC,OAAOC,QAAQL,GAC7C,QAAkB,IAAdG,EACJ,IACCL,EAAQQ,mBAAmB,CAAEH,YAAWI,YAAaN,EAAeC,IACrE,CAAA,MAASM,GACR,KAAMA,aAAiBC,WAAY,MAAMD,EACzC,MAAM,IAAIC,UAAU,GAAGV,mBAAuBS,EAAME,UACrD,CAEF,Q"}
@@ -1 +1 @@
1
- {"version":3,"file":"StyleRuntime-C0RSqKzG.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();\nconst runtimeSheets: WeakSet<CSSStyleSheet> = new WeakSet();\n\n/**\n * True when the sheet holds runtime style-token rules, i.e. element styling\n * that would be inline `style` attributes outside strict-CSP mode. Consumers\n * (e.g. print) can use this to treat such rules as content styling rather\n * than editor base styles.\n */\nexport function isRuntimeStyleSheet(sheet: CSSStyleSheet): boolean {\n\treturn runtimeSheets.has(sheet);\n}\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\tconst sheet = new CSSStyleSheet();\n\t\truntimeSheets.add(sheet);\n\t\treturn sheet;\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\tif (options.sheet) {\n\t\truntimeSheets.add(options.sheet);\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\tremoveInlineProperty(el, name);\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\tremoveInlineProperty(el, name);\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\tel.removeAttribute('style');\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\tremoveInlineProperty(el, property);\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\truntimeSheets.add(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\tif (this.sheet) {\n\t\t\truntimeSheets.add(this.sheet);\n\t\t}\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 removeInlineProperty(el: HTMLElement, property: string): void {\n\tif (!property) return;\n\tel.style.removeProperty(property);\n\tif (el.getAttribute('style') === '') el.removeAttribute('style');\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,QAC3D,iBAAwC,IAAI,QAQlD,SAAgB,EAAoB,GACnC,OAAO,EAAc,IAAI,EAC1B,CAGA,SAAgB,IACf,GAA6B,oBAAlB,cAA+B,OAAO,KACjD,IACC,MAAM,EAAQ,IAAI,cAElB,OADA,EAAc,IAAI,GACX,CACR,CAAA,MACC,OAAO,IACR,CACD,CAGA,SAAgB,EAAkB,EAAiB,GAClD,MAAM,EAAW,EAAc,IAAI,GAC/B,IACH,EAAS,UACT,EAAc,OAAO,IAElB,EAAQ,OACX,EAAc,IAAI,EAAQ,OAE3B,EAAY,IAAI,EAAM,CACrB,MAAO,EAAQ,MACf,MAAO,EAAQ,OAAS,MAE1B,CAGA,SAAgB,EAAoB,GACnC,MAAM,EAAS,EAAc,IAAI,GAC7B,IACH,EAAO,UACP,EAAc,OAAO,IAEtB,EAAY,OAAO,EACpB,CAGA,SAAgB,EAAiB,EAAiB,EAAkB,GACnE,MAAM,EAAS,EAAc,GACxB,EAIL,EAAgB,EAAO,KAAM,EAAO,UAAU,YAAY,EAAI,EAAU,GAHvE,EAAkB,EAAI,EAAU,EAIlC,CAGA,SAAgB,EAAoB,EAAiB,GACpD,EAAiB,EAAI,EAAU,GAChC,CAGA,SAAgB,EACf,EACA,GAEA,MAAM,EAAS,EAAc,GAC7B,GAAK,EAML,EAA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C3B,MAAO,IAAI,MAAqB,KACjC,CAEA,SAAS,EAAqB,EAAe,GAC5C,MAA4B,oBAAjB,cAAgC,aAAgB,aACnD,EAAK,eAAiB,EAEvB,EAAK,QAAQ,SAAS,EAC9B"}
1
+ {"version":3,"file":"StyleRuntime-C0RSqKzG.mjs","names":["STYLE_TOKEN_ATTR","rootConfigs","WeakMap","strictEngines","runtimeSheets","WeakSet","isRuntimeStyleSheet","sheet","has","createRuntimeStyleSheet","CSSStyleSheet","add","registerStyleRoot","root","options","previous","get","destroy","delete","set","nonce","unregisterStyleRoot","engine","setStyleProperty","el","property","value","config","resolveConfig","getStrictEngine","settings","setProperty","setInlineProperty","removeStyleProperty","setStyleProperties","properties","setProperties","Object","entries","setStyleText","cssText","style","getStyleText","getStyleNonceForNode","node","resolveStyleRootFromNode","startsWith","includes","removeProperty","resolveStyleRoot","cached","StrictStyleEngine","isShadowRoot","ShadowRoot","isDocument","Document","rootNode","getRootNode","document","declarationByElement","tokenByDeclaration","Map","declarationByToken","tokenRefCount","tokenByElement","tokenCounter","fallbackStyleElement","ownsAdoptedSheet","constructor","this","clearRuntimeRules","adoptedStyleSheets","filter","adoptedSheet","remove","clear","declarations","getOrCreateDeclarations","name","normalizePropertyName","removeInlineProperty","syncElementToken","parseStyleText","removeAttribute","size","clearElementStyles","appendStyleText","parsed","serializeDeclarations","existing","created","previousToken","declarationText","token","toString","insertRule","retainToken","releaseToken","setAttribute","rule","buildTokenSelector","ensureSheet","cssRules","length","adopted","ensureFallbackStyleElement","current","declaration","deleteRule","selector","index","isTokenSelectorMatch","createElement","appendChild","head","documentElement","styleText","rawPart","split","part","trim","separator","indexOf","slice","Array","from","sort","a","b","localeCompare","map","join","trimmed","toLowerCase","replace","char","getAttribute","CSSStyleRule","selectorText"],"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();\nconst runtimeSheets: WeakSet<CSSStyleSheet> = new WeakSet();\n\n/**\n * True when the sheet holds runtime style-token rules, i.e. element styling\n * that would be inline `style` attributes outside strict-CSP mode. Consumers\n * (e.g. print) can use this to treat such rules as content styling rather\n * than editor base styles.\n */\nexport function isRuntimeStyleSheet(sheet: CSSStyleSheet): boolean {\n\treturn runtimeSheets.has(sheet);\n}\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\tconst sheet = new CSSStyleSheet();\n\t\truntimeSheets.add(sheet);\n\t\treturn sheet;\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\tif (options.sheet) {\n\t\truntimeSheets.add(options.sheet);\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\tremoveInlineProperty(el, name);\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\tremoveInlineProperty(el, name);\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\tel.removeAttribute('style');\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\tremoveInlineProperty(el, property);\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\truntimeSheets.add(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\tif (this.sheet) {\n\t\t\truntimeSheets.add(this.sheet);\n\t\t}\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 removeInlineProperty(el: HTMLElement, property: string): void {\n\tif (!property) return;\n\tel.style.removeProperty(property);\n\tif (el.getAttribute('style') === '') el.removeAttribute('style');\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,IAAMA,EAAmB,2BAGnBC,iBAA8C,IAAIC,QAClDC,iBAA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pTFuVc.mjs";import{t as c}from"./ShortcutFormatting-TwiufqeV.mjs";var a={superscriptLabel:"Superscript",superscriptTooltip:s=>`Superscript (${s})`,subscriptLabel:"Subscript",subscriptTooltip:s=>`Subscript (${s})`},n=/* #__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-NV_puwI2.mjs"),"./locales/de.ts":()=>import("./de-BX4y4PlH.mjs"),"./locales/es.ts":()=>import("./es-BdpTTRuX.mjs"),"./locales/fr.ts":()=>import("./fr-CKjH6tJI.mjs"),"./locales/hi.ts":()=>import("./hi-DsdXcOB6.mjs"),"./locales/nl.ts":()=>import("./nl-xfiNOCgg.mjs"),"./locales/pt.ts":()=>import("./pt-OXa_IR4Q.mjs"),"./locales/ru.ts":()=>import("./ru-d68SZpEe.mjs"),"./locales/zh.ts":()=>import("./zh-BP97XjlS.mjs")});async function l(s){return p(n,s,a)}var u={superscript:!0,subscript:!0},m=[{type:"superscript",opposite:"subscript",configKey:"superscript",rank:4,tag:"sup",icon:['<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">','<path d="M16 7.41L11.41 12 16 16.59 14.59 18l-6-6 6-6z"',' fill="none"/>','<path d="M9.64 7.64c.23-.5.36-1.05.36-1.64'," 0-2.21-1.79-4-4-4H2v14h4.36c2.34 0 4.24-1.9"," 4.24-4.24 0-1.6-.89-2.99-2.2-3.71zM4.5 4.5H6c.83"," 0 1.5.67 1.5 1.5S6.83 7.5 6 7.5H4.5v-3zm2 9H4.5v-3H6.5c.83",' 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z" fill="none"/>','<path d="M15.97 3.84c0-.47.19-.91.53-1.21.34-.31.8-.49'," 1.3-.49.5 0 .95.18 1.28.48.32.3.5.7.51 1.15h1.59c-.02","-.96-.43-1.83-1.13-2.42C19.36.77 18.45.44 17.5.44c-.88"," 0-1.74.28-2.39.8-.67.53-1.06 1.28-1.06 2.1 0 .76.34"," 1.47.93 1.97.59.49 1.41.84 2.32 1.15.7.24 1.26.5 1.62.8.35.3.53.64.53"," 1.02 0 .48-.2.93-.55 1.24-.36.3-.84.48-1.37.48-.55 0-1.04-.2-1.39-.54","-.34-.33-.53-.8-.53-1.32h-1.58c.01 1.02.43 1.95 1.16 2.57.72.62 1.67.96"," 2.67.96.92 0 1.81-.3 2.46-.84.67-.56 1.04-1.33 1.04-2.18 0-.81-.36-1.56","-.99-2.08-.62-.51-1.48-.88-2.43-1.2-.67-.23-1.2-.47-1.52-.75-.32-.27-.46",'-.59-.46-.94z"/>','<path d="M5.88 20h2.66l3.4-5.42L15.3 20h2.67l-4.73-7.38',' 4.37-6.62h-2.6l-3.07 4.98L8.92 6h-2.6l4.26 6.58z"/>',"</svg>"].join(""),keyBinding:"Mod-.",toHTMLString:s=>`<sup>${s}</sup>`,parseHTML:[{tag:"sup"}],sanitize:{tags:["sup"]}},{type:"subscript",opposite:"superscript",configKey:"subscript",rank:4,tag:"sub",icon:['<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">','<path d="M15.97 16.84c0-.47.19-.91.53-1.21.34-.31.8-.49'," 1.3-.49.5 0 .95.18 1.28.48.32.3.5.7.51 1.15h1.59c-.02","-.96-.43-1.83-1.13-2.42-.7-.58-1.61-.91-2.56-.91-.88"," 0-1.74.28-2.39.8-.67.53-1.06 1.28-1.06 2.1 0 .76.34"," 1.47.93 1.97.59.49 1.41.84 2.32 1.15.7.24 1.26.5 1.62.8.35.3.53.64.53"," 1.02 0 .48-.2.93-.55 1.24-.36.3-.84.48-1.37.48-.55 0-1.04-.2-1.39-.54","-.34-.33-.53-.8-.53-1.32h-1.58c.01 1.02.43 1.95 1.16 2.57.72.62 1.67.96"," 2.67.96.92 0 1.81-.3 2.46-.84.67-.56 1.04-1.33 1.04-2.18 0-.81-.36-1.56","-.99-2.08-.62-.51-1.48-.88-2.43-1.2-.67-.23-1.2-.47-1.52-.75-.32-.27-.46",'-.59-.46-.94z"/>','<path d="M5.88 18h2.66l3.4-5.42L15.3 18h2.67l-4.73-7.38',' 4.37-6.62h-2.6l-3.07 4.98L8.92 4h-2.6l4.26 6.58z"/>',"</svg>"].join(""),keyBinding:"Mod-,",toHTMLString:s=>`<sub>${s}</sub>`,parseHTML:[{tag:"sub"}],sanitize:{tags:["sub"]}}],g=class{id="super-sub";name="Superscript & Subscript";priority=23;config;locale;constructor(s){this.config={...u,...s}}async init(s){this.locale=await o(s,this.config.locale,a,l);const t=m.filter(s=>this.config[s.configKey]);for(const e of t)this.registerMark(s,e);this.registerKeymaps(s,t),this.registerExclusivityMiddleware(s,t),this.registerDisabledToolbarItems(s)}registerMark(o,p){const a=i(p.type),n=this.isToolbarVisible(p.configKey);if(o.registerMarkSpec({type:p.type,rank:p.rank,toDOM:()=>document.createElement(p.tag),toHTMLString:(s,t)=>p.toHTMLString(t),parseHTML:p.parseHTML,sanitize:p.sanitize}),o.registerCommand(a,()=>r(o,t(o.getState(),s(p.type)))),n){const t="superscript"===p.type?this.locale.superscriptLabel:this.locale.subscriptLabel,i="superscript"===p.type?this.locale.superscriptTooltip(c(p.keyBinding)):this.locale.subscriptTooltip(c(p.keyBinding));o.registerToolbarItem({id:p.type,group:"format",icon:p.icon,label:t,tooltip:i,command:a,isActive:t=>e(t,s(p.type))})}}registerKeymaps(s,t){const e={};for(const r of t){const t=i(r.type);e[r.keyBinding]=()=>s.executeCommand(t)}Object.keys(e).length>0&&s.registerKeymap(e)}registerExclusivityMiddleware(t,e){e.some(s=>"superscript"===s.type)&&e.some(s=>"subscript"===s.type)&&t.registerMiddleware((t,e,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,e=m.find(s=>s.type===t);if(!e){o.push(c);continue}r=!0;const i={type:"removeMark",blockId:c.blockId,from:c.from,to:c.to,mark:{type:s(e.opposite)},...c.path?{path:c.path}:{}};o.push(i,c)}let p=t.storedMarksAfter;if(p){const s=p.some(s=>"superscript"===s.type),t=p.some(s=>"subscript"===s.type);if(s&&t){const s=p.findLastIndex(s=>"superscript"===s.type)>p.findLastIndex(s=>"subscript"===s.type)?"subscript":"superscript";p=p.filter(t=>t.type!==s),r=!0}}i(r?{...t,steps:o,storedMarksAfter:p}:t)},{name:"super-sub:exclusivity"})}registerDisabledToolbarItems(s){if(this.config.toolbar)for(const t of m){const e=this.config[t.configKey],r=this.config.toolbar[t.configKey]??!0;if(!e&&r){const e="superscript"===t.type?this.locale.superscriptLabel:this.locale.subscriptLabel;s.registerToolbarItem({id:t.type,group:"format",icon:t.icon,label:e,command:i(t.type),isEnabled:()=>!1})}}}isToolbarVisible(s){return!this.config.toolbar||(this.config.toolbar[s]??!0)}};export{a as n,l as r,g as t};
2
+ //# sourceMappingURL=SuperSubPlugin-5ZFM6wdU.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SuperSubPlugin-5ZFM6wdU.mjs","names":["mkType","markType","toggleMark","isMarkActive","toCommandName","dispatchIfPresent","resolveLocale","loadLocaleModule","formatShortcut","SUPER_SUB_LOCALE_EN","superscriptLabel","superscriptTooltip","shortcut","subscriptLabel","subscriptTooltip","localeModules","Object","assign","async","loadSuperSubLocale","lang","DEFAULT_CONFIG","superscript","subscript","MARK_DEFINITIONS","type","opposite","configKey","rank","tag","icon","join","keyBinding","toHTMLString","content","parseHTML","sanitize","tags","SuperSubPlugin","id","name","priority","config","locale","constructor","this","init","context","enabledMarks","filter","def","registerMark","registerKeymaps","registerExclusivityMiddleware","registerDisabledToolbarItems","commandName","toolbarVisible","isToolbarVisible","registerMarkSpec","toDOM","document","createElement","_mark","registerCommand","getState","label","tooltip","registerToolbarItem","group","command","isActive","state","marks","keymap","executeCommand","keys","length","registerKeymap","some","d","registerMiddleware","tr","_state","next","patched","patchedSteps","step","steps","push","markName","mark","find","removeStep","blockId","from","to","path","storedMarksAfter","hasSup","m","hasSub","removeType","findLastIndex","toolbar","featureEnabled","isEnabled"],"sources":["../../src/plugins/super-sub/SuperSubLocale.ts","../../src/plugins/super-sub/SuperSubPlugin.ts"],"sourcesContent":["/**\n * Locale interface and default English locale for the SuperSubPlugin.\n */\n\nimport { type LocaleModuleMap, loadLocaleModule } from '../shared/LocaleLoader.js';\n\n// --- Locale Interface ---\n\nexport interface SuperSubLocale {\n\treadonly superscriptLabel: string;\n\treadonly superscriptTooltip: (shortcut: string) => string;\n\treadonly subscriptLabel: string;\n\treadonly subscriptTooltip: (shortcut: string) => string;\n}\n\n// --- Default English Locale ---\n\nexport const SUPER_SUB_LOCALE_EN: SuperSubLocale = {\n\tsuperscriptLabel: 'Superscript',\n\tsuperscriptTooltip: (shortcut: string) => `Superscript (${shortcut})`,\n\tsubscriptLabel: 'Subscript',\n\tsubscriptTooltip: (shortcut: string) => `Subscript (${shortcut})`,\n};\n\n// --- Lazy Locale Loader ---\n\nconst localeModules: LocaleModuleMap<SuperSubLocale> = import.meta.glob<{\n\tdefault: SuperSubLocale;\n}>('./locales/*.ts', { eager: false });\n\nexport async function loadSuperSubLocale(lang: string): Promise<SuperSubLocale> {\n\treturn loadLocaleModule(localeModules, lang, SUPER_SUB_LOCALE_EN);\n}\n","/**\n * SuperSubPlugin: registers superscript and subscript inline marks with\n * MarkSpecs, toggle commands, keyboard shortcuts, toolbar buttons, and\n * a middleware that enforces mutual exclusivity between the two marks.\n *\n * Data-driven — each mark type is defined declaratively and all\n * registrations are derived from the same definition table.\n */\n\nimport { isMarkActive, toggleMark } from '../../commands/Commands.js';\nimport type { Mark } from '../../model/Document.js';\nimport type { ParseRule } from '../../model/ParseRule.js';\nimport type { SanitizeConfig } from '../../model/SanitizeConfig.js';\nimport { markType as mkType } from '../../model/TypeBrands.js';\nimport type { RemoveMarkStep, Step } from '../../state/Transaction.js';\nimport type { Plugin, PluginContext } from '../Plugin.js';\nimport { dispatchIfPresent, 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\tdispatchIfPresent(context, toggleMark(context.getState(), mkType(def.type))),\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":"Y,+MAiBA,IAAaS,EAAsC,CAClDC,iBAAkB,cAClBC,mBAAqBC,GAAqB,gBAAgBA,KAC1DC,eAAgB,YAChBC,iBAAmBF,GAAqB,cAAcA,MAKjDG,iBAAiDC,OAAAC,OAAA,CAAA,kBAAA,WAAA,qBAAA,kBAAA,WAAA,qBAAA,kBAAA,WAAA,qBAAA,kBAAA,WAAA,qBAAA,kBAAA,WAAA,qBAAA,kBAAA,WAAA,qBAAA,kBAAA,WAAA,qBAAA,kBAAA,WAAA,qBAAA,kBAAA,WAAA,uBAIvDC,eAAsBC,EAAmBC,GACxC,OAAOb,EAAiBQ,EAAeK,EAAMX,EAC9C,CCaA,IAAMY,EAAiC,CACtCC,aAAa,EACbC,WAAW,GA2DNC,EAA8C,CACnD,CACCC,KAAM,cACNC,SAAU,YACVC,UAAW,cACXC,KAAM,EACNC,IAAK,MACLC,KAhD+B,CAChC,+DACA,0DACA,iBACA,6CACA,+CACA,oDACA,8DACA,qDACA,yDACA,yDACA,yDACA,uDACA,yEACA,yEACA,0EACA,2EACA,2EACA,mBACA,0DACA,uDACA,UACCC,KAAK,IA2BLC,WAAY,QACZC,aAAeC,GAAY,QAAQA,UACnCC,UAAW,CAAC,CAAEN,IAAK,QACnBO,SAAU,CAAEC,KAAM,CAAC,SAEpB,CACCZ,KAAM,YACNC,SAAU,cACVC,UAAW,YACXC,KAAM,EACNC,IAAK,MACLC,KApC6B,CAC9B,+DACA,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GA,IAAIW,EAA2ChB,EAAGgB,iBAClD,GAAIA,EAAkB,CACrB,MAAMC,EAAkBD,EAAiBnB,KAAMqB,GAAiB,gBAAXA,EAAE1E,MACjD2E,EAAkBH,EAAiBnB,KAAMqB,GAAiB,cAAXA,EAAE1E,MAEvD,GAAIyE,GAAUE,EAAQ,CAQrB,MAAMC,EANqBJ,EAAiBK,cAC1CH,GAAiB,gBAAXA,EAAE1E,MAEiBwE,EAAiBK,cAC1CH,GAAiB,cAAXA,EAAE1E,MAE2C,YAAc,cAEnEwE,EAAmBA,EAAiBhD,OAAQkD,GAAMA,EAAE1E,OAAS4E,GAC7DjB,GAAU,CACX,CACD,CAEAD,EAAKC,EAAU,IAAKH,EAAIM,MAAOF,EAAcY,oBAAqBhB,IAEnE,CAAEzC,KAAM,yBAEV,CAMA,4BAAAc,CAAqCP,GACpC,GAAKF,KAAKH,OAAO6D,QAEjB,IAAK,MAAMrD,KAAO1B,EAAkB,CACnC,MAAMgF,EAA0B3D,KAAKH,OAAOQ,EAAIvB,WAC1C6B,EAA0BX,KAAKH,OAAO6D,QAAQrD,EAAIvB,aAAc,EAEtE,IAAK6E,GAAkBhD,EAAgB,CACtC,MAAMS,EACQ,gBAAbf,EAAIzB,KAAyBoB,KAAKF,OAAOjC,iBAAmBmC,KAAKF,OAAO9B,eACzEkC,EAAQoB,oBAAoB,CAC3B5B,GAAIW,EAAIzB,KACR2C,MAAO,SACPtC,KAAMoB,EAAIpB,KACVmC,QACAI,QAASjE,EAAc8C,EAAIzB,MAC3BgF,UAAA,KAAiB,GAEnB,CACD,CACD,CAEA,gBAAAhD,CAAyB9B,GACxB,OAAKkB,KAAKH,OAAO6D,UACV1D,KAAKH,OAAO6D,QAAQ5E,KAAc,EAC1C,U"}
@@ -1 +1 @@
1
- {"version":3,"file":"SyntaxTokenTypes-BUCOMtL8.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,KAClD,CAGA,SAAgB,EAAsB,GACrC,MAAwB,iBAAV,EAAqB,EAAM,eAAY,CACtD,CAGA,SAAgB,EAAuB,GACtC,MAAwB,iBAAV,EAAqB,EAAM,gBAAa,CACvD"}
1
+ {"version":3,"file":"SyntaxTokenTypes-BUCOMtL8.mjs","names":["SYNTAX_TOKEN_TYPES","resolveTokenColor","value","color","resolveTokenFontStyle","fontStyle","resolveTokenFontWeight","fontWeight"],"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,IAAaA,EAAqB,CACjC,UACA,SACA,UACA,SACA,WACA,WACA,cACA,UACA,OACA,WACA,OACA,aACA,MACA,YACA,WACA,SAiBD,SAAgBC,EAAkBC,GACjC,MAAwB,iBAAVA,EAAqBA,EAAQA,EAAMC,KAClD,CAGA,SAAgBC,EAAsBF,GACrC,MAAwB,iBAAVA,EAAqBA,EAAMG,eAAY,CACtD,CAGA,SAAgBC,EAAuBJ,GACtC,MAAwB,iBAAVA,EAAqBA,EAAMK,gBAAa,CACvD,Q"}
@@ -1,2 +1,2 @@
1
- import{c as t,i as e,n,r as s,t as r,u as o}from"./HTMLUtils-DTpsjZyK.mjs";import{B as i,D as a,H as c,P as l,V as u,z as f}from"./Document-ssR6hBzG.mjs";import{t as d}from"./TypeBrands-Ch9856Gb.mjs";import{r as h}from"./AttrRegistry-Di936wMv.mjs";import{n as p,r as g,t as m}from"./BlockAlignment-BqyBQ4uV.mjs";import{n as y,t as $}from"./HTMLSanitization-Ce9dVT1q.mjs";import{t as v}from"./CSSValueEquivalence-DeyUKPQ7.mjs";var x=new Set(m),A=/* @__PURE__ */new Map([["left","start"],["right","end"]]),C="notectl-align-",S="start";function k(t){return g(t)?t:"string"==typeof t?A.get(t):void 0}var M=new Map(m.map(t=>[p(t),`${C}${t}`]));function b(t){return M.get(t)}function L(t){return k(t.style?.textAlign)}var N=/^[A-Za-z0-9_-]{1,64}$/;function T(t){return N.test(t)}function w(t,e){const n=t.getAttribute("data-block-id");if(n&&T(n)&&!e.has(n))return e.add(n),d(n)}var H=/^-{0,2}[A-Za-z_][A-Za-z0-9_-]*$/,j=/!\s*important/i,_=/[{}<>]/;function E(t){const e=t.indexOf(":");if(e<0)return;const n=t.slice(0,e).trim();if(!H.test(n))return;const s=function(t){return t.endsWith(";")?t.slice(0,-1).trimEnd():t}(t.slice(e+1).trim());return function(t){if(""===t||W(t))return!1;const e=O(t);return 1===e.length&&e[0]===t}(s)&&!j.test(s)?{property:n.startsWith("--")?n:n.toLowerCase(),value:s}:void 0}function W(t){return _.test(t)}function I(t){return`${t.property}: ${t.value}`}function O(t){const e=[];let n,s=0,r=0;for(let o=0;o<t.length;o++){const i=t.charAt(o);n?i===n&&(n=void 0):'"'===i||"'"===i?n=i:"("===i?s++:")"===i?s=Math.max(0,s-1):";"===i&&0===s&&(e.push(t.slice(r,o)),r=o+1)}return e.push(t.slice(r)),e.map(t=>t.trim()).filter(t=>t.length>0)}function B(t){let e=2166136261;for(let n=0;n<t.length;n++)e^=t.charCodeAt(n),e=Math.imul(e,16777619);return(e>>>0).toString(36).padStart(6,"0")}var D=class{lookup;defaultClassName;rules=/* @__PURE__ */new Map;hashedClassNames=/* @__PURE__ */new Map;usedHashes=/* @__PURE__ */new Set;constructor(t=()=>{},e=()=>{}){this.lookup=t,this.defaultClassName=e}getClassNames(t){const e=[],n=[];for(const s of O(t).sort()){if(W(s))continue;const t=this.lookup(s);t?(this.rules.set(t.className,t.declaration),e.includes(t.className)||e.push(t.className)):n.push(s)}return n.length>0&&e.push(this.notectlClassName(n.join("; "))),e.join(" ")}toCSS(){return[...this.rules].map(([t,e])=>`.${t} { ${e}; }`).join("\n")}toStyleMap(){return new Map(this.rules)}notectlClassName(t){const e=this.defaultClassName(t)??this.hashedClassName(t);return this.rules.has(e)||this.rules.set(e,t),e}hashedClassName(t){const e=this.hashedClassNames.get(t);if(e)return e;let n=B(t),s=0;for(;this.usedHashes.has(n);)s++,n=B(t+String(s));this.usedHashes.add(n);const r=`notectl-s-${n}`;return this.hashedClassNames.set(t,r),r}};function R(t,e,n){const s=G(t);if(!s)return t;const r=t.slice(s.start,s.end+1),o=new RegExp(`\\s${e}\\s*=\\s*("([^"]*)"|'([^']*)')`),i=r.match(o);if(i){const a=i[2]??i[3]??"";if("style"===e&&/(?:^|;)\s*text-align\s*:/i.test(a))return t;const c=` ${e}="${a}${"style"===e?"; ":" "}${n}"`,l=r.replace(o,c);return`${t.slice(0,s.start)}${l}${t.slice(s.end+1)}`}const a=r.endsWith("/>")?`${r.slice(0,-2)} ${e}="${n}"/>`:`${r.slice(0,-1)} ${e}="${n}">`;return`${t.slice(0,s.start)}${a}${t.slice(s.end+1)}`}function z(t){return" "===t||"\t"===t||"\n"===t||"\f"===t||"\r"===t}function P(e,n){const r=t(n);return r?function(t,e,n){const s=G(t);if(!s)return t;const r=` ${e}="${n}"`,o=function(t,e){const n=[];let s=1;for(;s<t.length&&!z(t[s]??"")&&">"!==t[s]&&"/"!==t[s];)s++;for(;s<t.length;){for(;z(t[s]??"");)s++;if(">"===t[s]||void 0===t[s])break;if("/"===t[s]&&">"===t[s+1])break;const r=s;for(;s<t.length&&!z(t[s]??"")&&"="!==t[s]&&">"!==t[s]&&"/"!==t[s];)s++;const o=t.slice(r,s);if(""!==o){for(;z(t[s]??"");)s++;if("="===t[s]){for(s++;z(t[s]??"");)s++;const e=t[s];if('"'===e||"'"===e){for(s++;s<t.length&&t[s]!==e;)s++;t[s]===e&&s++}else for(;s<t.length&&!z(t[s]??"")&&">"!==t[s]&&("/"!==t[s]||">"!==t[s+1]);)s++}o.toLowerCase()===e.toLowerCase()&&n.push({start:r,end:s})}else s++}let r=t;for(let o=n.length-1;o>=0;o--){const t=n[o];t&&(r=`${r.slice(0,t.start)}${r.slice(t.end)}`)}return r}(t.slice(s.start,s.end+1),e),i=o.endsWith("/>")?`${o.slice(0,-2)}${r}/>`:`${o.slice(0,-1)}${r}>`;return`${t.slice(0,s.start)}${i}${t.slice(s.end+1)}`}(e,"id",s(r)):e}function G(t){let e=t.indexOf("<");for(;e>=0;){const n=t[e+1];if(n&&/[A-Za-z]/.test(n)){let n;for(let s=e+2;s<t.length;s++){const r=t[s]??"";if(n)r===n&&(n=void 0);else if('"'!==r&&"'"!==r){if(">"===r)return{start:e,end:s}}else n=r}return}e=t.indexOf("<",e+1)}}function V(t){const e=G(t);return e?t.slice(e.start,e.end+1):""}function Z(t){const e=t.getMarkTypes(),n=/* @__PURE__ */new Map;for(const s of e){const e=t.getMarkSpec(s);e&&n.set(s,e.rank??99)}return n}function F(t,e,n,s,r,o){if(0===e.length)return t;const i=s??Z(n),a=[...e].sort((t,e)=>(i.get(t.type)??99)-(i.get(e.type)??99)),c=[],l=[];for(const f of a){const t=n.getMarkSpec(f.type);if(t?.toHTMLStyle){const e=t.toHTMLStyle(f);e&&c.push(e)}else l.push(f)}let u=t;c.length>0&&(u=o(u,c.join("; ")));for(const f of l){const t=n.getMarkSpec(f.type);t?.toHTMLString&&(u=t.toHTMLString(f,u,r))}return u}function U(t,n,s,r,o,i){return""===t?"":F(e(t),n,s,r,o,i)}function q(t){return(e,n)=>{const s=o(n,t);return s?`<span${s}>${e}</span>`:e}}function X(t){return(e,n)=>{const r=t.getClassNames(n);return r?`<span class="${s(r)}">${e}</span>`:e}}function J(t,e,n,s,r){return U(t,e,n,s,r,q(r))}function K(t,e,n,s,r){return F(t,e,n,s,r,q(r))}function Q(t,e,n,s,r,o){return U(t,e,n,r,o,X(s))}function Y(t,e,n,s,r,o){return F(t,e,n,r,o,X(s))}function tt(t,e){return n=>e?.get(n)??t?.getStyleClass(n)?.declaration??function(t){if(!t.startsWith(C))return;const e=k(t.slice(14));return e?p(e):void 0}(n)}function et(t,e,n){for(const s of Array.from(t.querySelectorAll("[class]"))){const t=nt(s,e,n);t&&st(s,t)}}function nt(t,e,n){const s=[];for(const r of Array.from(t.classList)){const t=e(r);if(!t)continue;const o=O(t);if(s.length+o.length>n)return;s.push(...o)}return s}function st(t,e){const n=t.style;if(n)for(const s of e){const t=E(s);t&&!n.getPropertyValue(t.property)&&n.setProperty(t.property,t.value)}}var rt=/* @__PURE__ */new Set(["ltr","rtl"]);function ot(t){return{styleAttr(e){const n=t.getClassNames(e);return n?` class="${s(n)}"`:""}}}function it(t){return $(...t?[]:["data-block-id"])}function at(t,e,s){const o=!1!==s?.includeBlockIds,i={registry:e,exportCtx:r,includeBlockIds:o},a=lt(t.children,i),c=e?e.getAllowedTags():["p","br","div","span"],l=e?e.getAllowedAttrs():["style","dir","id"];return y(a,{ALLOWED_TAGS:c,ALLOWED_ATTR:l,ALLOWED_URI_REGEXP:n,...it(o)},e)}function ct(t,e,s){const r=!1!==s?.includeBlockIds,o=function(t,e=function(){const t=v();return({property:e,value:n})=>I({property:e,value:t(e,n)})}()){if(0===t.length)return()=>{};const n=/* @__PURE__ */new Map,s=t=>{if(!n.has(t)){const s=E(t);n.set(t,s?e(s):void 0)}return n.get(t)},r=/* @__PURE__ */new Map;for(const o of t){const t=s(o.declaration);void 0===t||r.has(t)||r.set(t,o)}return t=>{const e=s(t);return void 0===e?void 0:r.get(e)}}(e?.getStyleClasses()??[]),i=new D(o,b),a={registry:e,collector:i,exportCtx:ot(i),includeBlockIds:r,startHasClass:void 0!==o(p("start"))},c=lt(t.children,a),l=e?e.getAllowedTags():["p","br","div","span"],u=e?e.getAllowedAttrs():["style","class","dir","id"],f=(u.includes("class")?[...u]:[...u,"class"]).filter(t=>"style"!==t);return{html:y(c,{ALLOWED_TAGS:l,ALLOWED_ATTR:f,ALLOWED_URI_REGEXP:n,...it(r)},e),css:i.toCSS(),styleMap:i.toStyleMap()}}function lt(t,e){const n=[];let s=0;for(;s<t.length;){const r=t[s];if(r)if(h(r,"list_item")){const r=[];for(;s<t.length;){const e=t[s];if(!e||!h(e,"list_item"))break;r.push(e),s++}n.push(ut(r,e))}else n.push(dt(r,e)),s++;else s++}return n.join("")}function ut(t,e){const n=[],s=[];for(let r=0;r<t.length;r++){const o=t[r];if(!o)continue;const i=o.attrs?.listType??"bullet",a=o.attrs?.indent??0,c="ordered"===i?"ol":"ul";for(;s.length>0;){const t=s[s.length-1];if(!t)break;if(t.indent>a)n.push(`</${t.tag}></li>`),s.pop();else{if(t.indent!==a||t.tag===c)break;n.push(`</${t.tag}></li>`),s.pop()}}if(0===s.length)n.push(`<${c}>`),s.push({tag:c,indent:a});else{const t=s[s.length-1];t&&a>t.indent&&(n.push(`<${c}>`),s.push({tag:c,indent:a}))}const l=dt(o,e),u=t[r+1],f=u?u.attrs?.indent??0:void 0;void 0!==f&&f>a?n.push(ft(l)):n.push(l)}for(;s.length>0;){const t=s.pop();if(!t)break;n.push(`</${t.tag}>`),s.length>0&&n.push("</li>")}return n.join("")}function ft(t){return t.endsWith("</li>")?t.slice(0,-5):t}function dt(t,n){const r=n.registry?.getNodeSpec(t.type),o=function(t,e,n={}){const s=k(e?.attrs?.align?.default)??S,r=k(t.attrs?.align),o=r??(e?.attrs?.align?s:void 0);if(o)return o!==S||o!==s||r&&void 0!==n.inherited||!0===n.startHasClass&&void 0===n.inherited?o:void 0}(t,r,{startHasClass:n.startHasClass,inherited:n.inheritedAlignment}),d=i(t)?function(t,n){const s=function(t){if(t.length<=1)return t;const e=[];for(const n of t){if(f(n)){e.push(n);continue}const t=e[e.length-1];t&&u(t)&&c(t.marks,n.marks)?e[e.length-1]={type:"text",text:t.text+n.text,marks:t.marks}:e.push(n)}return e}(l(t)),r=[],o=n.registry?Z(n.registry):void 0;for(const i of s)if(f(i)){const t=n.registry?.getInlineNodeSpec(i.inlineType);if(t?.toHTMLString){const e=t.toHTMLString(i);n.registry&&i.marks.length>0?r.push(n.collector?Y(e,i.marks,n.registry,n.collector,o,n.exportCtx):K(e,i.marks,n.registry,o,n.exportCtx)):r.push(e)}}else n.registry&&n.collector?r.push(Q(i.text,i.marks,n.registry,n.collector,o,n.exportCtx)):n.registry?r.push(J(i.text,i.marks,n.registry,o,n.exportCtx)):""!==i.text&&r.push(e(i.text));return r.join("")}(t,n):lt(a(t),function(t,e){return e?{...t,inheritedAlignment:e}:t}(n,o));let h;h=r?.toHTML?r.toHTML(t,d,n.exportCtx):`<p>${d||"<br>"}</p>`,n.includeBlockIds&&T(t.id)&&(V(h).includes(" data-block-id=")||(h=R(h,"data-block-id",s(t.id)))),h=P(h,t.htmlId),h=function(t,e,n){if(!e)return t;const r=p(e);return n.collector?R(t,"class",s(n.collector.getClassNames(r))):R(t,"style",s(r))}(h,o,n);const g=t.attrs?.dir;return g&&rt.has(g)&&(V(h).includes(" dir=")||(h=R(h,"dir",s(g)))),h}var ht=1e4;function pt(t,e=1,n=1e4){if("number"!=typeof t||!Number.isFinite(t))return null;const s=gt(e,1),r=Math.max(s,gt(n,ht));return Math.min(r,Math.max(s,t))}function gt(t,e){return Number.isFinite(t)?Math.min(ht,Math.max(1,t)):e}var mt="data-notectl-width-px",yt="data-notectl-min-height-px",$t=1e3,vt=/^\d+(?:\.\d+)?$/,xt=/^(\d+(?:\.\d+)?)px$/i,At=/^\d+$/;function Ct(t){if("number"==typeof t&&Number.isFinite(t)&&!(t<1||t>1e4))return pt(t)??void 0}function St(t){if(null===t)return;const e=t.trim().match(xt);return e?.[1]?wt(e[1]):void 0}function kt(t,e,n,s){const r=Tt(t.getAttribute(e),!1);if(void 0!==r)return r;for(const o of n){const e=St(t.style.getPropertyValue(o));if(void 0!==e)return e}return Tt(t.getAttribute(s),!0)}function Mt(t){if(null===t)return 1;const e=t.trim();if(!At.test(e))return 1;const n=Number(e);return!Number.isSafeInteger(n)||n<1||n>1e3?1:n}function bt(t){if(!Array.isArray(t))return;const e=Array.from(t.slice(0,1e3),t=>Ct(t)??null);return e.some(t=>null!==t)?e:void 0}function Lt(t){return void 0!==bt(t)}function Nt(t,e,n,s){const r=Ct(n);if(void 0===r)return"";const i=`${e}: ${String(r)}px`;return` ${t}="${String(r)}"${o(i,s)}`}function Tt(t,e){if(null===t)return;const n=t.trim();if(vt.test(n))return wt(n);if(!e)return;const s=n.match(xt);return s?.[1]?wt(s[1]):void 0}function wt(t){return Ct(Number(t))}export{w as C,O as S,L as T,Z as _,Ct as a,I as b,kt as c,pt as d,rt as f,et as g,tt as h,Lt as i,Nt as l,at as m,mt as n,bt as o,ct as p,yt as r,Mt as s,$t as t,ht as u,J as v,x as w,E as x,P as y};
2
- //# sourceMappingURL=TableDimensions-BSEOEox2.mjs.map
1
+ import{c as t,i as e,n,r as s,t as r,u as o}from"./HTMLUtils-DTpsjZyK.mjs";import{B as i,D as a,H as c,P as l,V as u,z as f}from"./Document-ssR6hBzG.mjs";import{t as d}from"./TypeBrands-Ch9856Gb.mjs";import{r as h}from"./AttrRegistry-Di936wMv.mjs";import{n as p,r as g,t as m}from"./BlockAlignment-BqyBQ4uV.mjs";import{n as y,t as $}from"./HTMLSanitization-BRipXyhI.mjs";import{t as v}from"./CSSValueEquivalence-DeyUKPQ7.mjs";var x=new Set(m),A=/* @__PURE__ */new Map([["left","start"],["right","end"]]),C="notectl-align-",S="start";function k(t){return g(t)?t:"string"==typeof t?A.get(t):void 0}var M=new Map(m.map(t=>[p(t),`${C}${t}`]));function b(t){return M.get(t)}function L(t){return k(t.style?.textAlign)}var N=/^[A-Za-z0-9_-]{1,64}$/;function T(t){return N.test(t)}function w(t,e){const n=t.getAttribute("data-block-id");if(n&&T(n)&&!e.has(n))return e.add(n),d(n)}var H=/^-{0,2}[A-Za-z_][A-Za-z0-9_-]*$/,j=/!\s*important/i,_=/[{}<>]/;function E(t){const e=t.indexOf(":");if(e<0)return;const n=t.slice(0,e).trim();if(!H.test(n))return;const s=function(t){return t.endsWith(";")?t.slice(0,-1).trimEnd():t}(t.slice(e+1).trim());return function(t){if(""===t||W(t))return!1;const e=O(t);return 1===e.length&&e[0]===t}(s)&&!j.test(s)?{property:n.startsWith("--")?n:n.toLowerCase(),value:s}:void 0}function W(t){return _.test(t)}function I(t){return`${t.property}: ${t.value}`}function O(t){const e=[];let n,s=0,r=0;for(let o=0;o<t.length;o++){const i=t.charAt(o);n?i===n&&(n=void 0):'"'===i||"'"===i?n=i:"("===i?s++:")"===i?s=Math.max(0,s-1):";"===i&&0===s&&(e.push(t.slice(r,o)),r=o+1)}return e.push(t.slice(r)),e.map(t=>t.trim()).filter(t=>t.length>0)}function B(t){let e=2166136261;for(let n=0;n<t.length;n++)e^=t.charCodeAt(n),e=Math.imul(e,16777619);return(e>>>0).toString(36).padStart(6,"0")}var D=class{lookup;defaultClassName;rules=/* @__PURE__ */new Map;hashedClassNames=/* @__PURE__ */new Map;usedHashes=/* @__PURE__ */new Set;constructor(t=()=>{},e=()=>{}){this.lookup=t,this.defaultClassName=e}getClassNames(t){const e=[],n=[];for(const s of O(t).sort()){if(W(s))continue;const t=this.lookup(s);t?(this.rules.set(t.className,t.declaration),e.includes(t.className)||e.push(t.className)):n.push(s)}return n.length>0&&e.push(this.notectlClassName(n.join("; "))),e.join(" ")}toCSS(){return[...this.rules].map(([t,e])=>`.${t} { ${e}; }`).join("\n")}toStyleMap(){return new Map(this.rules)}notectlClassName(t){const e=this.defaultClassName(t)??this.hashedClassName(t);return this.rules.has(e)||this.rules.set(e,t),e}hashedClassName(t){const e=this.hashedClassNames.get(t);if(e)return e;let n=B(t),s=0;for(;this.usedHashes.has(n);)s++,n=B(t+String(s));this.usedHashes.add(n);const r=`notectl-s-${n}`;return this.hashedClassNames.set(t,r),r}};function R(t,e,n){const s=G(t);if(!s)return t;const r=t.slice(s.start,s.end+1),o=new RegExp(`\\s${e}\\s*=\\s*("([^"]*)"|'([^']*)')`),i=r.match(o);if(i){const a=i[2]??i[3]??"";if("style"===e&&/(?:^|;)\s*text-align\s*:/i.test(a))return t;const c=` ${e}="${a}${"style"===e?"; ":" "}${n}"`,l=r.replace(o,c);return`${t.slice(0,s.start)}${l}${t.slice(s.end+1)}`}const a=r.endsWith("/>")?`${r.slice(0,-2)} ${e}="${n}"/>`:`${r.slice(0,-1)} ${e}="${n}">`;return`${t.slice(0,s.start)}${a}${t.slice(s.end+1)}`}function z(t){return" "===t||"\t"===t||"\n"===t||"\f"===t||"\r"===t}function P(e,n){const r=t(n);return r?function(t,e,n){const s=G(t);if(!s)return t;const r=` ${e}="${n}"`,o=function(t,e){const n=[];let s=1;for(;s<t.length&&!z(t[s]??"")&&">"!==t[s]&&"/"!==t[s];)s++;for(;s<t.length;){for(;z(t[s]??"");)s++;if(">"===t[s]||void 0===t[s])break;if("/"===t[s]&&">"===t[s+1])break;const r=s;for(;s<t.length&&!z(t[s]??"")&&"="!==t[s]&&">"!==t[s]&&"/"!==t[s];)s++;const o=t.slice(r,s);if(""!==o){for(;z(t[s]??"");)s++;if("="===t[s]){for(s++;z(t[s]??"");)s++;const e=t[s];if('"'===e||"'"===e){for(s++;s<t.length&&t[s]!==e;)s++;t[s]===e&&s++}else for(;s<t.length&&!z(t[s]??"")&&">"!==t[s]&&("/"!==t[s]||">"!==t[s+1]);)s++}o.toLowerCase()===e.toLowerCase()&&n.push({start:r,end:s})}else s++}let r=t;for(let o=n.length-1;o>=0;o--){const t=n[o];t&&(r=`${r.slice(0,t.start)}${r.slice(t.end)}`)}return r}(t.slice(s.start,s.end+1),e),i=o.endsWith("/>")?`${o.slice(0,-2)}${r}/>`:`${o.slice(0,-1)}${r}>`;return`${t.slice(0,s.start)}${i}${t.slice(s.end+1)}`}(e,"id",s(r)):e}function G(t){let e=t.indexOf("<");for(;e>=0;){const n=t[e+1];if(n&&/[A-Za-z]/.test(n)){let n;for(let s=e+2;s<t.length;s++){const r=t[s]??"";if(n)r===n&&(n=void 0);else if('"'!==r&&"'"!==r){if(">"===r)return{start:e,end:s}}else n=r}return}e=t.indexOf("<",e+1)}}function V(t){const e=G(t);return e?t.slice(e.start,e.end+1):""}function Z(t){const e=t.getMarkTypes(),n=/* @__PURE__ */new Map;for(const s of e){const e=t.getMarkSpec(s);e&&n.set(s,e.rank??99)}return n}function F(t,e,n,s,r,o){if(0===e.length)return t;const i=s??Z(n),a=[...e].sort((t,e)=>(i.get(t.type)??99)-(i.get(e.type)??99)),c=[],l=[];for(const f of a){const t=n.getMarkSpec(f.type);if(t?.toHTMLStyle){const e=t.toHTMLStyle(f);e&&c.push(e)}else l.push(f)}let u=t;c.length>0&&(u=o(u,c.join("; ")));for(const f of l){const t=n.getMarkSpec(f.type);t?.toHTMLString&&(u=t.toHTMLString(f,u,r))}return u}function U(t,n,s,r,o,i){return""===t?"":F(e(t),n,s,r,o,i)}function q(t){return(e,n)=>{const s=o(n,t);return s?`<span${s}>${e}</span>`:e}}function X(t){return(e,n)=>{const r=t.getClassNames(n);return r?`<span class="${s(r)}">${e}</span>`:e}}function J(t,e,n,s,r){return U(t,e,n,s,r,q(r))}function K(t,e,n,s,r){return F(t,e,n,s,r,q(r))}function Q(t,e,n,s,r,o){return U(t,e,n,r,o,X(s))}function Y(t,e,n,s,r,o){return F(t,e,n,r,o,X(s))}function tt(t,e){return n=>e?.get(n)??t?.getStyleClass(n)?.declaration??function(t){if(!t.startsWith(C))return;const e=k(t.slice(14));return e?p(e):void 0}(n)}function et(t,e,n){for(const s of Array.from(t.querySelectorAll("[class]"))){const t=nt(s,e,n);t&&st(s,t)}}function nt(t,e,n){const s=[];for(const r of Array.from(t.classList)){const t=e(r);if(!t)continue;const o=O(t);if(s.length+o.length>n)return;s.push(...o)}return s}function st(t,e){const n=t.style;if(n)for(const s of e){const t=E(s);t&&!n.getPropertyValue(t.property)&&n.setProperty(t.property,t.value)}}var rt=/* @__PURE__ */new Set(["ltr","rtl"]);function ot(t){return{styleAttr(e){const n=t.getClassNames(e);return n?` class="${s(n)}"`:""}}}function it(t){return $(...t?[]:["data-block-id"])}function at(t,e,s){const o=!1!==s?.includeBlockIds,i={registry:e,exportCtx:r,includeBlockIds:o},a=lt(t.children,i),c=e?e.getAllowedTags():["p","br","div","span"],l=e?e.getAllowedAttrs():["style","dir","id"];return y(a,{ALLOWED_TAGS:c,ALLOWED_ATTR:l,ALLOWED_URI_REGEXP:n,...it(o)},e)}function ct(t,e,s){const r=!1!==s?.includeBlockIds,o=function(t,e=function(){const t=v();return({property:e,value:n})=>I({property:e,value:t(e,n)})}()){if(0===t.length)return()=>{};const n=/* @__PURE__ */new Map,s=t=>{if(!n.has(t)){const s=E(t);n.set(t,s?e(s):void 0)}return n.get(t)},r=/* @__PURE__ */new Map;for(const o of t){const t=s(o.declaration);void 0===t||r.has(t)||r.set(t,o)}return t=>{const e=s(t);return void 0===e?void 0:r.get(e)}}(e?.getStyleClasses()??[]),i=new D(o,b),a={registry:e,collector:i,exportCtx:ot(i),includeBlockIds:r,startHasClass:void 0!==o(p("start"))},c=lt(t.children,a),l=e?e.getAllowedTags():["p","br","div","span"],u=e?e.getAllowedAttrs():["style","class","dir","id"],f=(u.includes("class")?[...u]:[...u,"class"]).filter(t=>"style"!==t);return{html:y(c,{ALLOWED_TAGS:l,ALLOWED_ATTR:f,ALLOWED_URI_REGEXP:n,...it(r)},e),css:i.toCSS(),styleMap:i.toStyleMap()}}function lt(t,e){const n=[];let s=0;for(;s<t.length;){const r=t[s];if(r)if(h(r,"list_item")){const r=[];for(;s<t.length;){const e=t[s];if(!e||!h(e,"list_item"))break;r.push(e),s++}n.push(ut(r,e))}else n.push(dt(r,e)),s++;else s++}return n.join("")}function ut(t,e){const n=[],s=[];for(let r=0;r<t.length;r++){const o=t[r];if(!o)continue;const i=o.attrs?.listType??"bullet",a=o.attrs?.indent??0,c="ordered"===i?"ol":"ul";for(;s.length>0;){const t=s[s.length-1];if(!t)break;if(t.indent>a)n.push(`</${t.tag}></li>`),s.pop();else{if(t.indent!==a||t.tag===c)break;n.push(`</${t.tag}></li>`),s.pop()}}if(0===s.length)n.push(`<${c}>`),s.push({tag:c,indent:a});else{const t=s[s.length-1];t&&a>t.indent&&(n.push(`<${c}>`),s.push({tag:c,indent:a}))}const l=dt(o,e),u=t[r+1],f=u?u.attrs?.indent??0:void 0;void 0!==f&&f>a?n.push(ft(l)):n.push(l)}for(;s.length>0;){const t=s.pop();if(!t)break;n.push(`</${t.tag}>`),s.length>0&&n.push("</li>")}return n.join("")}function ft(t){return t.endsWith("</li>")?t.slice(0,-5):t}function dt(t,n){const r=n.registry?.getNodeSpec(t.type),o=function(t,e,n={}){const s=k(e?.attrs?.align?.default)??S,r=k(t.attrs?.align),o=r??(e?.attrs?.align?s:void 0);if(o)return o!==S||o!==s||r&&void 0!==n.inherited||!0===n.startHasClass&&void 0===n.inherited?o:void 0}(t,r,{startHasClass:n.startHasClass,inherited:n.inheritedAlignment}),d=i(t)?function(t,n){const s=function(t){if(t.length<=1)return t;const e=[];for(const n of t){if(f(n)){e.push(n);continue}const t=e[e.length-1];t&&u(t)&&c(t.marks,n.marks)?e[e.length-1]={type:"text",text:t.text+n.text,marks:t.marks}:e.push(n)}return e}(l(t)),r=[],o=n.registry?Z(n.registry):void 0;for(const i of s)if(f(i)){const t=n.registry?.getInlineNodeSpec(i.inlineType);if(t?.toHTMLString){const e=t.toHTMLString(i);n.registry&&i.marks.length>0?r.push(n.collector?Y(e,i.marks,n.registry,n.collector,o,n.exportCtx):K(e,i.marks,n.registry,o,n.exportCtx)):r.push(e)}}else n.registry&&n.collector?r.push(Q(i.text,i.marks,n.registry,n.collector,o,n.exportCtx)):n.registry?r.push(J(i.text,i.marks,n.registry,o,n.exportCtx)):""!==i.text&&r.push(e(i.text));return r.join("")}(t,n):lt(a(t),function(t,e){return e?{...t,inheritedAlignment:e}:t}(n,o));let h;h=r?.toHTML?r.toHTML(t,d,n.exportCtx):`<p>${d||"<br>"}</p>`,n.includeBlockIds&&T(t.id)&&(V(h).includes(" data-block-id=")||(h=R(h,"data-block-id",s(t.id)))),h=P(h,t.htmlId),h=function(t,e,n){if(!e)return t;const r=p(e);return n.collector?R(t,"class",s(n.collector.getClassNames(r))):R(t,"style",s(r))}(h,o,n);const g=t.attrs?.dir;return g&&rt.has(g)&&(V(h).includes(" dir=")||(h=R(h,"dir",s(g)))),h}var ht=1e4;function pt(t,e=1,n=1e4){if("number"!=typeof t||!Number.isFinite(t))return null;const s=gt(e,1),r=Math.max(s,gt(n,ht));return Math.min(r,Math.max(s,t))}function gt(t,e){return Number.isFinite(t)?Math.min(ht,Math.max(1,t)):e}var mt="data-notectl-width-px",yt="data-notectl-min-height-px",$t=1e3,vt=/^\d+(?:\.\d+)?$/,xt=/^(\d+(?:\.\d+)?)px$/i,At=/^\d+$/;function Ct(t){if("number"==typeof t&&Number.isFinite(t)&&!(t<1||t>1e4))return pt(t)??void 0}function St(t){if(null===t)return;const e=t.trim().match(xt);return e?.[1]?wt(e[1]):void 0}function kt(t,e,n,s){const r=Tt(t.getAttribute(e),!1);if(void 0!==r)return r;for(const o of n){const e=St(t.style.getPropertyValue(o));if(void 0!==e)return e}return Tt(t.getAttribute(s),!0)}function Mt(t){if(null===t)return 1;const e=t.trim();if(!At.test(e))return 1;const n=Number(e);return!Number.isSafeInteger(n)||n<1||n>1e3?1:n}function bt(t){if(!Array.isArray(t))return;const e=Array.from(t.slice(0,1e3),t=>Ct(t)??null);return e.some(t=>null!==t)?e:void 0}function Lt(t){return void 0!==bt(t)}function Nt(t,e,n,s){const r=Ct(n);if(void 0===r)return"";const i=`${e}: ${String(r)}px`;return` ${t}="${String(r)}"${o(i,s)}`}function Tt(t,e){if(null===t)return;const n=t.trim();if(vt.test(n))return wt(n);if(!e)return;const s=n.match(xt);return s?.[1]?wt(s[1]):void 0}function wt(t){return Ct(Number(t))}export{w as C,O as S,L as T,Z as _,Ct as a,I as b,kt as c,pt as d,rt as f,et as g,tt as h,Lt as i,Nt as l,at as m,mt as n,bt as o,ct as p,yt as r,Mt as s,$t as t,ht as u,J as v,x as w,E as x,P as y};
2
+ //# sourceMappingURL=TableDimensions-B-OWjTuW.mjs.map