@notectl/core 2.3.7 → 2.4.2

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 (751) hide show
  1. package/README.md +1 -1
  2. package/dist/chunks/AlignmentPlugin-Cp7HYGaH.mjs +2 -0
  3. package/dist/chunks/AlignmentPlugin-Cp7HYGaH.mjs.map +1 -0
  4. package/dist/chunks/{AttrRegistry-CtNhf2EF.mjs → AttrRegistry-Di936wMv.mjs} +2 -2
  5. package/dist/chunks/AttrRegistry-Di936wMv.mjs.map +1 -0
  6. package/dist/chunks/{AttributedMarkCommands-B3MQdob_.mjs → AttributedMarkCommands-DKHuhZA7.mjs} +2 -2
  7. package/dist/chunks/AttributedMarkCommands-DKHuhZA7.mjs.map +1 -0
  8. package/dist/chunks/BidiIsolationPlugin-GWukKdgJ.mjs +2 -0
  9. package/dist/chunks/BidiIsolationPlugin-GWukKdgJ.mjs.map +1 -0
  10. package/dist/chunks/BlockAlignment-BqyBQ4uV.mjs +2 -0
  11. package/dist/chunks/BlockAlignment-BqyBQ4uV.mjs.map +1 -0
  12. package/dist/chunks/BlockInsertion-CXfXqUZl.mjs +2 -0
  13. package/dist/chunks/BlockInsertion-CXfXqUZl.mjs.map +1 -0
  14. package/dist/chunks/BlockTypePickerRegistry-BTET9jM-.mjs.map +1 -1
  15. package/dist/chunks/BlockquotePlugin-CSL_7Yit.mjs +2 -0
  16. package/dist/chunks/BlockquotePlugin-CSL_7Yit.mjs.map +1 -0
  17. package/dist/chunks/CSSValueEquivalence-DeyUKPQ7.mjs +2 -0
  18. package/dist/chunks/CSSValueEquivalence-DeyUKPQ7.mjs.map +1 -0
  19. package/dist/chunks/{CaretNavigationPlugin-DEZU09LJ.mjs → CaretNavigationPlugin-BQPqqK4n.mjs} +2 -2
  20. package/dist/chunks/CaretNavigationPlugin-BQPqqK4n.mjs.map +1 -0
  21. package/dist/chunks/CodeBlockPlugin-B4AcDJRK.mjs +2 -0
  22. package/dist/chunks/CodeBlockPlugin-B4AcDJRK.mjs.map +1 -0
  23. package/dist/chunks/ColorGrid-DAs0--ty.mjs.map +1 -1
  24. package/dist/chunks/ColorPickerPopup-B6340f3p.mjs +2 -0
  25. package/dist/chunks/ColorPickerPopup-B6340f3p.mjs.map +1 -0
  26. package/dist/chunks/{ColorValidation-B9d_umnf.mjs → ColorValidation-ZBKZ_gTr.mjs} +2 -2
  27. package/dist/chunks/ColorValidation-ZBKZ_gTr.mjs.map +1 -0
  28. package/dist/chunks/Commands-Bk7Cl1nH.mjs +2 -0
  29. package/dist/chunks/Commands-Bk7Cl1nH.mjs.map +1 -0
  30. package/dist/chunks/ContentModel-dkGOh3N7.mjs +2 -0
  31. package/dist/chunks/ContentModel-dkGOh3N7.mjs.map +1 -0
  32. package/dist/chunks/{CursorMarks-dx51OGBf.mjs → CursorMarks-CqHLzGNI.mjs} +2 -2
  33. package/dist/chunks/CursorMarks-CqHLzGNI.mjs.map +1 -0
  34. package/dist/chunks/{Decoration-BwhoA4MU.mjs → Decoration-BoFcdSXk.mjs} +2 -2
  35. package/dist/chunks/Decoration-BoFcdSXk.mjs.map +1 -0
  36. package/dist/chunks/{DirectionDetection-ZrkMhyaL.mjs → DirectionDetection-a-1iksmh.mjs} +2 -2
  37. package/dist/chunks/DirectionDetection-a-1iksmh.mjs.map +1 -0
  38. package/dist/chunks/DirectionIcons-Bbawl9ei.mjs.map +1 -1
  39. package/dist/chunks/{Document-D_2cIBJG.mjs → Document-ssR6hBzG.mjs} +2 -2
  40. package/dist/chunks/Document-ssR6hBzG.mjs.map +1 -0
  41. package/dist/chunks/DocumentParser-C99N0MWF.mjs +2 -0
  42. package/dist/chunks/DocumentParser-C99N0MWF.mjs.map +1 -0
  43. package/dist/chunks/DomUtils-Bf7JLFlx.mjs.map +1 -1
  44. package/dist/chunks/EditorEventBoundary-zpYRxryo.mjs.map +1 -1
  45. package/dist/chunks/FontPlugin-BcXNFqqO.mjs +2 -0
  46. package/dist/chunks/FontPlugin-BcXNFqqO.mjs.map +1 -0
  47. package/dist/chunks/FontSizePlugin-Dswra3oU.mjs +2 -0
  48. package/dist/chunks/FontSizePlugin-Dswra3oU.mjs.map +1 -0
  49. package/dist/chunks/FormulaPlugin-DVpLaKi5.mjs +2 -0
  50. package/dist/chunks/FormulaPlugin-DVpLaKi5.mjs.map +1 -0
  51. package/dist/chunks/GapCursorPlugin-QDGwnaRR.mjs +2 -0
  52. package/dist/chunks/GapCursorPlugin-QDGwnaRR.mjs.map +1 -0
  53. package/dist/chunks/HTMLSanitization-Ce9dVT1q.mjs.map +1 -1
  54. package/dist/chunks/HTMLUtils-DTpsjZyK.mjs +2 -0
  55. package/dist/chunks/HTMLUtils-DTpsjZyK.mjs.map +1 -0
  56. package/dist/chunks/{HardBreakPlugin-CC4rntSX.mjs → HardBreakPlugin-gjCq8prD.mjs} +2 -2
  57. package/dist/chunks/HardBreakPlugin-gjCq8prD.mjs.map +1 -0
  58. package/dist/chunks/HeadingPlugin-B7EfynaH.mjs +2 -0
  59. package/dist/chunks/HeadingPlugin-B7EfynaH.mjs.map +1 -0
  60. package/dist/chunks/HighlightPlugin-LdO0INtJ.mjs +2 -0
  61. package/dist/chunks/HighlightPlugin-LdO0INtJ.mjs.map +1 -0
  62. package/dist/chunks/HorizontalRulePlugin-YywXVZYr.mjs +2 -0
  63. package/dist/chunks/HorizontalRulePlugin-YywXVZYr.mjs.map +1 -0
  64. package/dist/chunks/ImagePlugin-BAhZuVdE.mjs +2 -0
  65. package/dist/chunks/ImagePlugin-BAhZuVdE.mjs.map +1 -0
  66. package/dist/chunks/InlineCodePlugin-Bu9-rE4B.mjs +2 -0
  67. package/dist/chunks/InlineCodePlugin-Bu9-rE4B.mjs.map +1 -0
  68. package/dist/chunks/InlineStyleMarkSpec-BhfGgfH9.mjs +2 -0
  69. package/dist/chunks/InlineStyleMarkSpec-BhfGgfH9.mjs.map +1 -0
  70. package/dist/chunks/KeyboardNav-D0my3wuy.mjs.map +1 -1
  71. package/dist/chunks/LinkPlugin-CAUaWW5-.mjs +2 -0
  72. package/dist/chunks/LinkPlugin-CAUaWW5-.mjs.map +1 -0
  73. package/dist/chunks/{ListPlugin--dqEctgn.mjs → ListPlugin-U1r4p_fE.mjs} +2 -2
  74. package/dist/chunks/ListPlugin-U1r4p_fE.mjs.map +1 -0
  75. package/dist/chunks/MarkCommands-C0ps9h0z.mjs +2 -0
  76. package/dist/chunks/MarkCommands-C0ps9h0z.mjs.map +1 -0
  77. package/dist/chunks/MarkInputRule-DNneF2gp.mjs.map +1 -1
  78. package/dist/chunks/MarkdownHTMLRegistry-BunUDiza.mjs +2 -0
  79. package/dist/chunks/MarkdownHTMLRegistry-BunUDiza.mjs.map +1 -0
  80. package/dist/chunks/{MarkdownParser-D1d9zB0R.mjs → MarkdownParser-uX1p_GQk.mjs} +2 -2
  81. package/dist/chunks/MarkdownParser-uX1p_GQk.mjs.map +1 -0
  82. package/dist/chunks/MarkdownSerializer--MrgJTdJ.mjs +2 -0
  83. package/dist/chunks/MarkdownSerializer--MrgJTdJ.mjs.map +1 -0
  84. package/dist/chunks/MathFont-BS8IwYh2.mjs.map +1 -1
  85. package/dist/chunks/NavigationQueries-CaKfccu7.mjs +2 -0
  86. package/dist/chunks/NavigationQueries-CaKfccu7.mjs.map +1 -0
  87. package/dist/chunks/NodeResolver-F4RtpoEd.mjs +2 -0
  88. package/dist/chunks/NodeResolver-F4RtpoEd.mjs.map +1 -0
  89. package/dist/chunks/{NodeSelectionCommands-DK3iEh18.mjs → NodeSelectionCommands-CAqIHW_6.mjs} +2 -2
  90. package/dist/chunks/NodeSelectionCommands-CAqIHW_6.mjs.map +1 -0
  91. package/dist/chunks/NodeSpecPatching-BrjPAbqe.mjs.map +1 -1
  92. package/dist/chunks/Platform-ByobkiCc.mjs.map +1 -1
  93. package/dist/chunks/PluginHelpers-B3gk3VB3.mjs +2 -0
  94. package/dist/chunks/PluginHelpers-B3gk3VB3.mjs.map +1 -0
  95. package/dist/chunks/PopupKeyboardPatterns-BcwdDxRq.mjs.map +1 -1
  96. package/dist/chunks/PopupManager-Dxv0OVMo.mjs +2 -0
  97. package/dist/chunks/PopupManager-Dxv0OVMo.mjs.map +1 -0
  98. package/dist/chunks/PopupPositioning-CIqgpqlW.mjs.map +1 -1
  99. package/dist/chunks/{PrintPlugin-BQ7LWbEB.mjs → PrintPlugin-DAEiEyKQ.mjs} +2 -2
  100. package/dist/chunks/PrintPlugin-DAEiEyKQ.mjs.map +1 -0
  101. package/dist/chunks/{RangeIterator-DDOxTQIf.mjs → RangeIterator-sJ_c9MNr.mjs} +2 -2
  102. package/dist/chunks/RangeIterator-sJ_c9MNr.mjs.map +1 -0
  103. package/dist/chunks/Schema-BSM4YLNT.mjs +2 -0
  104. package/dist/chunks/Schema-BSM4YLNT.mjs.map +1 -0
  105. package/dist/chunks/SchemaRegistry-Cs7rxafF.mjs +2 -0
  106. package/dist/chunks/SchemaRegistry-Cs7rxafF.mjs.map +1 -0
  107. package/dist/chunks/Selection-DC6AOGgF.mjs.map +1 -1
  108. package/dist/chunks/SelectionReplacement-vC1xhFS0.mjs +2 -0
  109. package/dist/chunks/SelectionReplacement-vC1xhFS0.mjs.map +1 -0
  110. package/dist/chunks/SelectionSync-BkjCwGp-.mjs +2 -0
  111. package/dist/chunks/SelectionSync-BkjCwGp-.mjs.map +1 -0
  112. package/dist/chunks/{SelectionTransactions-DNCzsl_b.mjs → SelectionTransactions-mQ1NfMEg.mjs} +2 -2
  113. package/dist/chunks/SelectionTransactions-mQ1NfMEg.mjs.map +1 -0
  114. package/dist/chunks/ShortcutFormatting-TwiufqeV.mjs.map +1 -1
  115. package/dist/chunks/SimpleMark-D6vz3Nfd.mjs +2 -0
  116. package/dist/chunks/SimpleMark-D6vz3Nfd.mjs.map +1 -0
  117. package/dist/chunks/SmartPastePlugin-BHsYKbgd.mjs +2 -0
  118. package/dist/chunks/SmartPastePlugin-BHsYKbgd.mjs.map +1 -0
  119. package/dist/chunks/StarterFonts-BDQPg-cu.mjs.map +1 -1
  120. package/dist/chunks/{StrikethroughPlugin-d-EW2YYx.mjs → StrikethroughPlugin-v-VJZzUZ.mjs} +2 -2
  121. package/dist/chunks/StrikethroughPlugin-v-VJZzUZ.mjs.map +1 -0
  122. package/dist/chunks/StyleClassNames-BsAx7k5T.mjs +2 -0
  123. package/dist/chunks/StyleClassNames-BsAx7k5T.mjs.map +1 -0
  124. package/dist/chunks/StyleRuntime-C0RSqKzG.mjs.map +1 -1
  125. package/dist/chunks/{SuperSubPlugin-C-kvFQyx.mjs → SuperSubPlugin-x1iPnZyt.mjs} +2 -2
  126. package/dist/chunks/SuperSubPlugin-x1iPnZyt.mjs.map +1 -0
  127. package/dist/chunks/SyntaxTokenTypes-BUCOMtL8.mjs.map +1 -1
  128. package/dist/chunks/TableDimensions-BSEOEox2.mjs +2 -0
  129. package/dist/chunks/TableDimensions-BSEOEox2.mjs.map +1 -0
  130. package/dist/chunks/TablePlugin-CjKThPug.mjs +2 -0
  131. package/dist/chunks/TablePlugin-CjKThPug.mjs.map +1 -0
  132. package/dist/chunks/TextColorPlugin-Bnl9of9E.mjs +2 -0
  133. package/dist/chunks/TextColorPlugin-Bnl9of9E.mjs.map +1 -0
  134. package/dist/chunks/{TextDirectionAutoPlugin-LVDkKdDX.mjs → TextDirectionAutoPlugin-DOH5cfyy.mjs} +2 -2
  135. package/dist/chunks/TextDirectionAutoPlugin-DOH5cfyy.mjs.map +1 -0
  136. package/dist/chunks/{TextDirectionPlugin-CtGwof7i.mjs → TextDirectionPlugin-JwlR-R-b.mjs} +2 -2
  137. package/dist/chunks/TextDirectionPlugin-JwlR-R-b.mjs.map +1 -0
  138. package/dist/chunks/TextDirectionService-BcX07mw2.mjs +2 -0
  139. package/dist/chunks/TextDirectionService-BcX07mw2.mjs.map +1 -0
  140. package/dist/chunks/{TextFormattingPlugin-DlS0SeW7.mjs → TextFormattingPlugin-Kc_UNoOz.mjs} +2 -2
  141. package/dist/chunks/TextFormattingPlugin-Kc_UNoOz.mjs.map +1 -0
  142. package/dist/chunks/ThemeEngine-kIXtSRkI.mjs.map +1 -1
  143. package/dist/chunks/ToolbarPlugin-CgZA2hz8.mjs +2 -0
  144. package/dist/chunks/ToolbarPlugin-CgZA2hz8.mjs.map +1 -0
  145. package/dist/chunks/TypeBrands-Ch9856Gb.mjs.map +1 -1
  146. package/dist/chunks/TypedKeys-CA4bfw9O.mjs.map +1 -1
  147. package/dist/chunks/VideoPlugin-DJXfuNA9.mjs +2 -0
  148. package/dist/chunks/VideoPlugin-DJXfuNA9.mjs.map +1 -0
  149. package/dist/chunks/XmlPatterns-RN32-0ob.mjs.map +1 -1
  150. package/dist/chunks/XmlSupport-3Za6SIqF.mjs.map +1 -1
  151. package/dist/chunks/ar--Isa9OHJ.mjs.map +1 -1
  152. package/dist/chunks/ar--O0A9OTR.mjs.map +1 -1
  153. package/dist/chunks/ar-0g2bmXTn.mjs.map +1 -1
  154. package/dist/chunks/ar-4b8e2YSc.mjs.map +1 -1
  155. package/dist/chunks/ar-B03uY4xr.mjs.map +1 -1
  156. package/dist/chunks/ar-BAfInw85.mjs.map +1 -1
  157. package/dist/chunks/ar-BRX5E_Pw.mjs.map +1 -1
  158. package/dist/chunks/ar-BWOue6jG.mjs.map +1 -1
  159. package/dist/chunks/ar-Bdmunk5h.mjs.map +1 -1
  160. package/dist/chunks/ar-BwaoCUVN.mjs.map +1 -1
  161. package/dist/chunks/ar-BzqAYGER.mjs.map +1 -1
  162. package/dist/chunks/ar-C9lO1jsY.mjs.map +1 -1
  163. package/dist/chunks/ar-CMXjVzFx.mjs.map +1 -1
  164. package/dist/chunks/ar-CR6UdFL9.mjs.map +1 -1
  165. package/dist/chunks/ar-CrOb0jL2.mjs.map +1 -1
  166. package/dist/chunks/ar-Cy_77yRf.mjs.map +1 -1
  167. package/dist/chunks/ar-D1jFXqLJ.mjs.map +1 -1
  168. package/dist/chunks/ar-DahJwMI9.mjs.map +1 -1
  169. package/dist/chunks/ar-Dcl3kgtd.mjs.map +1 -1
  170. package/dist/chunks/ar-Dg9PdDet.mjs.map +1 -1
  171. package/dist/chunks/ar-DhwCFHql.mjs +2 -0
  172. package/dist/chunks/ar-DhwCFHql.mjs.map +1 -0
  173. package/dist/chunks/ar-Dx2lO0Nm.mjs.map +1 -1
  174. package/dist/chunks/ar-NV_puwI2.mjs.map +1 -1
  175. package/dist/chunks/ar-Uzo1Azdw.mjs.map +1 -1
  176. package/dist/chunks/ar-XmSFrtmd.mjs.map +1 -1
  177. package/dist/chunks/ar-eOA3UmiE.mjs.map +1 -1
  178. package/dist/chunks/ar-sGZ-oZqB.mjs.map +1 -1
  179. package/dist/chunks/color-picker-D6HrTsDM.mjs +2 -0
  180. package/dist/chunks/color-picker-D6HrTsDM.mjs.map +1 -0
  181. package/dist/chunks/de-B8-w9gPi.mjs.map +1 -1
  182. package/dist/chunks/de-B9zSHWqY.mjs.map +1 -1
  183. package/dist/chunks/de-BX4y4PlH.mjs.map +1 -1
  184. package/dist/chunks/de-BXQBXxFJ.mjs.map +1 -1
  185. package/dist/chunks/de-BcPntcnr.mjs.map +1 -1
  186. package/dist/chunks/de-BdD3DpUB.mjs.map +1 -1
  187. package/dist/chunks/de-Bwxlcuee.mjs.map +1 -1
  188. package/dist/chunks/de-BxQIt_1Y.mjs.map +1 -1
  189. package/dist/chunks/de-C-Yf378-.mjs.map +1 -1
  190. package/dist/chunks/de-C7uehgMu.mjs.map +1 -1
  191. package/dist/chunks/de-C9ZhDqPi.mjs.map +1 -1
  192. package/dist/chunks/de-CHcv_Vmf.mjs.map +1 -1
  193. package/dist/chunks/de-CTzAMkXC.mjs.map +1 -1
  194. package/dist/chunks/de-CaeEIyzV.mjs.map +1 -1
  195. package/dist/chunks/de-CjLUbQmg.mjs +2 -0
  196. package/dist/chunks/de-CjLUbQmg.mjs.map +1 -0
  197. package/dist/chunks/de-DHs9i4af.mjs.map +1 -1
  198. package/dist/chunks/de-DJ5EkXQo.mjs.map +1 -1
  199. package/dist/chunks/de-DRbhnS4T.mjs.map +1 -1
  200. package/dist/chunks/de-DViI26lG.mjs.map +1 -1
  201. package/dist/chunks/de-DY3obIAF.mjs.map +1 -1
  202. package/dist/chunks/de-DcMhfRBu.mjs.map +1 -1
  203. package/dist/chunks/de-DiPz7abS.mjs.map +1 -1
  204. package/dist/chunks/de-Dl4QFHMa.mjs.map +1 -1
  205. package/dist/chunks/de-XCCpWyg0.mjs.map +1 -1
  206. package/dist/chunks/de-e6J6nvAD.mjs.map +1 -1
  207. package/dist/chunks/de-i95F9SDy.mjs.map +1 -1
  208. package/dist/chunks/de-uKR7koQe.mjs.map +1 -1
  209. package/dist/chunks/es-B0Za939C.mjs.map +1 -1
  210. package/dist/chunks/es-B8K3Yvf3.mjs.map +1 -1
  211. package/dist/chunks/es-BIXm2Coj.mjs.map +1 -1
  212. package/dist/chunks/es-BJHF95J_.mjs.map +1 -1
  213. package/dist/chunks/es-BMm9kqjC.mjs.map +1 -1
  214. package/dist/chunks/es-BQ9dox_E.mjs.map +1 -1
  215. package/dist/chunks/es-BQweZX6P.mjs.map +1 -1
  216. package/dist/chunks/es-BdpTTRuX.mjs.map +1 -1
  217. package/dist/chunks/es-C7uVqFYr.mjs.map +1 -1
  218. package/dist/chunks/es-CCQFu1t1.mjs.map +1 -1
  219. package/dist/chunks/es-CEAJj7aB.mjs.map +1 -1
  220. package/dist/chunks/es-CMSzvjOT.mjs +2 -0
  221. package/dist/chunks/es-CMSzvjOT.mjs.map +1 -0
  222. package/dist/chunks/es-CUKJujcb.mjs.map +1 -1
  223. package/dist/chunks/es-CXuMz87y.mjs.map +1 -1
  224. package/dist/chunks/es-CgMfhkJJ.mjs.map +1 -1
  225. package/dist/chunks/es-CtOtKQCP.mjs.map +1 -1
  226. package/dist/chunks/es-DD01rZ6N.mjs.map +1 -1
  227. package/dist/chunks/es-DDoqchUq.mjs.map +1 -1
  228. package/dist/chunks/es-DFokqQst.mjs.map +1 -1
  229. package/dist/chunks/es-DHxdoEzR.mjs.map +1 -1
  230. package/dist/chunks/es-DehVGwQ8.mjs.map +1 -1
  231. package/dist/chunks/es-DrJyl38L.mjs.map +1 -1
  232. package/dist/chunks/es-fTW0TkYV.mjs.map +1 -1
  233. package/dist/chunks/es-kfKiqpyD.mjs.map +1 -1
  234. package/dist/chunks/es-nRLq7bgP.mjs.map +1 -1
  235. package/dist/chunks/es-paXY7HFt.mjs.map +1 -1
  236. package/dist/chunks/es-xuahrvJN.mjs.map +1 -1
  237. package/dist/chunks/fr-0qEo3bRP.mjs.map +1 -1
  238. package/dist/chunks/fr-5HkMazAf.mjs.map +1 -1
  239. package/dist/chunks/fr-B9pBLaVx.mjs.map +1 -1
  240. package/dist/chunks/fr-BRXUnq3R.mjs.map +1 -1
  241. package/dist/chunks/fr-BSUKEtTk.mjs.map +1 -1
  242. package/dist/chunks/fr-BeRlON1t.mjs.map +1 -1
  243. package/dist/chunks/fr-Bg937iAy.mjs.map +1 -1
  244. package/dist/chunks/fr-BwWrFThE.mjs.map +1 -1
  245. package/dist/chunks/fr-C3EKRThN.mjs.map +1 -1
  246. package/dist/chunks/fr-CKjH6tJI.mjs.map +1 -1
  247. package/dist/chunks/fr-CQs0-pNX.mjs.map +1 -1
  248. package/dist/chunks/fr-CfhyYN-t.mjs.map +1 -1
  249. package/dist/chunks/fr-D0MDdoir.mjs.map +1 -1
  250. package/dist/chunks/fr-D5ulA3Z6.mjs.map +1 -1
  251. package/dist/chunks/fr-DB_OvHWH.mjs +2 -0
  252. package/dist/chunks/fr-DB_OvHWH.mjs.map +1 -0
  253. package/dist/chunks/fr-DEZ_oxzS.mjs.map +1 -1
  254. package/dist/chunks/fr-DciSEykY.mjs.map +1 -1
  255. package/dist/chunks/fr-DhWQzZy3.mjs.map +1 -1
  256. package/dist/chunks/fr-DiDhVhyV.mjs.map +1 -1
  257. package/dist/chunks/fr-DjMZ-3K5.mjs.map +1 -1
  258. package/dist/chunks/fr-F2ZrfVaF.mjs.map +1 -1
  259. package/dist/chunks/fr-KXmbys88.mjs.map +1 -1
  260. package/dist/chunks/fr-NVOinLyF.mjs.map +1 -1
  261. package/dist/chunks/fr-SbpHNrQ-.mjs.map +1 -1
  262. package/dist/chunks/fr-ZsRdLuys.mjs.map +1 -1
  263. package/dist/chunks/fr-eC0UdAPu.mjs.map +1 -1
  264. package/dist/chunks/fr-fshsDD66.mjs.map +1 -1
  265. package/dist/chunks/full-BsWAZr1w.mjs +2 -0
  266. package/dist/chunks/full-BsWAZr1w.mjs.map +1 -0
  267. package/dist/chunks/hi-4CiAKVjT.mjs.map +1 -1
  268. package/dist/chunks/hi-B-ZuX4aN.mjs.map +1 -1
  269. package/dist/chunks/hi-B2YB3Bo4.mjs.map +1 -1
  270. package/dist/chunks/hi-B2uhiPCN.mjs.map +1 -1
  271. package/dist/chunks/hi-B5cl8TWK.mjs.map +1 -1
  272. package/dist/chunks/hi-BNJIGWQQ.mjs.map +1 -1
  273. package/dist/chunks/hi-BOMkDPqC.mjs.map +1 -1
  274. package/dist/chunks/hi-Bl-yeeOI.mjs.map +1 -1
  275. package/dist/chunks/hi-BsZzSMfL.mjs.map +1 -1
  276. package/dist/chunks/hi-By8YwVIX.mjs.map +1 -1
  277. package/dist/chunks/hi-BzbMD_cP.mjs.map +1 -1
  278. package/dist/chunks/hi-C2jEsf8v.mjs.map +1 -1
  279. package/dist/chunks/hi-CTWubxLY.mjs.map +1 -1
  280. package/dist/chunks/hi-ChNQZZ1z.mjs +2 -0
  281. package/dist/chunks/hi-ChNQZZ1z.mjs.map +1 -0
  282. package/dist/chunks/hi-CoclKAUM.mjs.map +1 -1
  283. package/dist/chunks/hi-CrmakMVj.mjs.map +1 -1
  284. package/dist/chunks/hi-DWX6k5ZD.mjs.map +1 -1
  285. package/dist/chunks/hi-DY55FuDK.mjs.map +1 -1
  286. package/dist/chunks/hi-DrC2H81d.mjs.map +1 -1
  287. package/dist/chunks/hi-DsdXcOB6.mjs.map +1 -1
  288. package/dist/chunks/hi-Dt89SxNy.mjs.map +1 -1
  289. package/dist/chunks/hi-J8ErB5nB.mjs.map +1 -1
  290. package/dist/chunks/hi-L6pJxZam.mjs.map +1 -1
  291. package/dist/chunks/hi-SECtQQzq.mjs.map +1 -1
  292. package/dist/chunks/hi-j3TDLMYd.mjs.map +1 -1
  293. package/dist/chunks/hi-l6DA-aOw.mjs.map +1 -1
  294. package/dist/chunks/hi-uACJUw53.mjs.map +1 -1
  295. package/dist/chunks/minimal-DO7LiFTa.mjs +2 -0
  296. package/dist/chunks/minimal-DO7LiFTa.mjs.map +1 -0
  297. package/dist/chunks/pt-5VeuNDd2.mjs.map +1 -1
  298. package/dist/chunks/pt-BCXgUDiU.mjs.map +1 -1
  299. package/dist/chunks/pt-BDam9cDu.mjs.map +1 -1
  300. package/dist/chunks/pt-Bb908r0n.mjs.map +1 -1
  301. package/dist/chunks/pt-BkpVtod-.mjs.map +1 -1
  302. package/dist/chunks/pt-BlFAJZo7.mjs.map +1 -1
  303. package/dist/chunks/pt-Bu7Mbz67.mjs.map +1 -1
  304. package/dist/chunks/pt-BuZ7acHF.mjs.map +1 -1
  305. package/dist/chunks/pt-C8sOyw0V.mjs.map +1 -1
  306. package/dist/chunks/pt-CEUgbrii.mjs.map +1 -1
  307. package/dist/chunks/pt-CFrcl1v_.mjs.map +1 -1
  308. package/dist/chunks/pt-CI8t6oul.mjs +2 -0
  309. package/dist/chunks/pt-CI8t6oul.mjs.map +1 -0
  310. package/dist/chunks/pt-CMrFpUWS.mjs.map +1 -1
  311. package/dist/chunks/pt-CMx2wPPY.mjs.map +1 -1
  312. package/dist/chunks/pt-CR4j8gtE.mjs.map +1 -1
  313. package/dist/chunks/pt-Cc4zysaT.mjs.map +1 -1
  314. package/dist/chunks/pt-Cv6q7x5x.mjs.map +1 -1
  315. package/dist/chunks/pt-DFKJVh7k.mjs.map +1 -1
  316. package/dist/chunks/pt-DYMyMgKQ.mjs.map +1 -1
  317. package/dist/chunks/pt-D__tcM2T.mjs.map +1 -1
  318. package/dist/chunks/pt-Dg2ctkug.mjs.map +1 -1
  319. package/dist/chunks/pt-DgfMoLWR.mjs.map +1 -1
  320. package/dist/chunks/pt-OXa_IR4Q.mjs.map +1 -1
  321. package/dist/chunks/pt-UPF7DBlz.mjs.map +1 -1
  322. package/dist/chunks/pt-_qxIe7zX.mjs.map +1 -1
  323. package/dist/chunks/pt-paXY7HFt.mjs.map +1 -1
  324. package/dist/chunks/pt-zMHcNGPk.mjs.map +1 -1
  325. package/dist/chunks/register-DXLu8Njp.mjs +3 -0
  326. package/dist/chunks/register-DXLu8Njp.mjs.map +1 -0
  327. package/dist/chunks/ru-9WtNGZtl.mjs +2 -0
  328. package/dist/chunks/ru-9WtNGZtl.mjs.map +1 -0
  329. package/dist/chunks/ru-B1m8J9dl.mjs.map +1 -1
  330. package/dist/chunks/ru-BNPUT-3S.mjs.map +1 -1
  331. package/dist/chunks/ru-BotG0MFT.mjs.map +1 -1
  332. package/dist/chunks/ru-C-APN_dm.mjs.map +1 -1
  333. package/dist/chunks/ru-C9yFslEG.mjs.map +1 -1
  334. package/dist/chunks/ru-CkG_bpfo.mjs.map +1 -1
  335. package/dist/chunks/ru-Cs8KCNyq.mjs.map +1 -1
  336. package/dist/chunks/ru-CsP6mLxp.mjs.map +1 -1
  337. package/dist/chunks/ru-CvDl-yEd.mjs.map +1 -1
  338. package/dist/chunks/ru-CwyPz2Va.mjs.map +1 -1
  339. package/dist/chunks/ru-D53d-_UB.mjs.map +1 -1
  340. package/dist/chunks/ru-DJMpeuey.mjs.map +1 -1
  341. package/dist/chunks/ru-DSRv3_Rg.mjs.map +1 -1
  342. package/dist/chunks/ru-DV-lgEtM.mjs.map +1 -1
  343. package/dist/chunks/ru-DiwQV30V.mjs.map +1 -1
  344. package/dist/chunks/ru-DkW9XZFy.mjs.map +1 -1
  345. package/dist/chunks/ru-DyCTlhjg.mjs.map +1 -1
  346. package/dist/chunks/ru-QGX8lOTs.mjs.map +1 -1
  347. package/dist/chunks/ru-QcTo2yoL.mjs.map +1 -1
  348. package/dist/chunks/ru-Y11wuxOB.mjs.map +1 -1
  349. package/dist/chunks/ru-Yngw7nFP.mjs.map +1 -1
  350. package/dist/chunks/ru-d68SZpEe.mjs.map +1 -1
  351. package/dist/chunks/ru-gxbzqLL8.mjs.map +1 -1
  352. package/dist/chunks/ru-k7o3Qks3.mjs.map +1 -1
  353. package/dist/chunks/ru-l73diFXn.mjs.map +1 -1
  354. package/dist/chunks/ru-q8kz-237.mjs.map +1 -1
  355. package/dist/chunks/src-5GKFQ2mQ.mjs.map +1 -1
  356. package/dist/chunks/xml-BsV44TrJ.mjs.map +1 -1
  357. package/dist/chunks/zh-BFZOM3lF.mjs.map +1 -1
  358. package/dist/chunks/zh-BGYJXxVl.mjs.map +1 -1
  359. package/dist/chunks/zh-BP97XjlS.mjs.map +1 -1
  360. package/dist/chunks/zh-BQ73oqxc.mjs.map +1 -1
  361. package/dist/chunks/zh-BQqf3wJZ.mjs.map +1 -1
  362. package/dist/chunks/zh-Baxh6v0j.mjs.map +1 -1
  363. package/dist/chunks/zh-BrqJ4ywP.mjs +2 -0
  364. package/dist/chunks/zh-BrqJ4ywP.mjs.map +1 -0
  365. package/dist/chunks/zh-BvuAbM2S.mjs.map +1 -1
  366. package/dist/chunks/zh-C-wHnDo5.mjs.map +1 -1
  367. package/dist/chunks/zh-C7iCgCRP.mjs.map +1 -1
  368. package/dist/chunks/zh-CRsDvfPR.mjs.map +1 -1
  369. package/dist/chunks/zh-CWGAPVei.mjs.map +1 -1
  370. package/dist/chunks/zh-CWIzJcXi.mjs.map +1 -1
  371. package/dist/chunks/zh-CYV-db-K.mjs.map +1 -1
  372. package/dist/chunks/zh-CiIyOm6U.mjs.map +1 -1
  373. package/dist/chunks/zh-CnW44JEw.mjs.map +1 -1
  374. package/dist/chunks/zh-D1HSmSOf.mjs.map +1 -1
  375. package/dist/chunks/zh-DWN1Jqn3.mjs.map +1 -1
  376. package/dist/chunks/zh-DYD476c5.mjs.map +1 -1
  377. package/dist/chunks/zh-DdzgYD7k.mjs.map +1 -1
  378. package/dist/chunks/zh-DgSmvLyw.mjs.map +1 -1
  379. package/dist/chunks/zh-DlVfQn4z.mjs.map +1 -1
  380. package/dist/chunks/zh-Oj-qSUEp.mjs.map +1 -1
  381. package/dist/chunks/zh-YfuE_m2y.mjs.map +1 -1
  382. package/dist/chunks/zh-dGSDBBzb.mjs.map +1 -1
  383. package/dist/chunks/zh-ikm3rSTR.mjs.map +1 -1
  384. package/dist/chunks/zh-oZl1P_p0.mjs.map +1 -1
  385. package/dist/commands/BlockInsertion.d.ts +15 -19
  386. package/dist/commands/BlockInsertion.d.ts.map +1 -1
  387. package/dist/commands/Commands.d.ts.map +1 -1
  388. package/dist/commands/CompositionCommands.d.ts +47 -0
  389. package/dist/commands/CompositionCommands.d.ts.map +1 -0
  390. package/dist/commands/CompositionRebase.d.ts +24 -0
  391. package/dist/commands/CompositionRebase.d.ts.map +1 -0
  392. package/dist/commands/PasteCommand.d.ts.map +1 -1
  393. package/dist/commands/SelectionDeletion.d.ts +20 -8
  394. package/dist/commands/SelectionDeletion.d.ts.map +1 -1
  395. package/dist/commands/SelectionReplacement.d.ts +42 -0
  396. package/dist/commands/SelectionReplacement.d.ts.map +1 -0
  397. package/dist/editor/BlockIdentity.d.ts +16 -0
  398. package/dist/editor/BlockIdentity.d.ts.map +1 -0
  399. package/dist/editor/ContentSerializer.d.ts +13 -11
  400. package/dist/editor/ContentSerializer.d.ts.map +1 -1
  401. package/dist/editor/NotectlEditor.d.ts +6 -5
  402. package/dist/editor/NotectlEditor.d.ts.map +1 -1
  403. package/dist/editor/styles/link.d.ts +3 -0
  404. package/dist/editor/styles/link.d.ts.map +1 -0
  405. package/dist/fonts.mjs +1 -1
  406. package/dist/full.mjs +1 -1
  407. package/dist/html.mjs +1 -1
  408. package/dist/index.d.ts +2 -1
  409. package/dist/index.d.ts.map +1 -1
  410. package/dist/input/CompositionController.d.ts +78 -0
  411. package/dist/input/CompositionController.d.ts.map +1 -0
  412. package/dist/input/HTMLParser.d.ts +15 -2
  413. package/dist/input/HTMLParser.d.ts.map +1 -1
  414. package/dist/input/InputHandler.d.ts +34 -1
  415. package/dist/input/InputHandler.d.ts.map +1 -1
  416. package/dist/input/InputManager.d.ts +3 -0
  417. package/dist/input/InputManager.d.ts.map +1 -1
  418. package/dist/input/PasteHTMLHandler.d.ts.map +1 -1
  419. package/dist/input/PasteHandler.d.ts.map +1 -1
  420. package/dist/input/PasteRichBlockHandler.d.ts +10 -17
  421. package/dist/input/PasteRichBlockHandler.d.ts.map +1 -1
  422. package/dist/markdown.mjs +1 -1
  423. package/dist/model/BlockAlignment.d.ts +6 -0
  424. package/dist/model/BlockAlignment.d.ts.map +1 -1
  425. package/dist/model/BlockOffsetText.d.ts +11 -0
  426. package/dist/model/BlockOffsetText.d.ts.map +1 -0
  427. package/dist/model/CompositionState.d.ts +14 -0
  428. package/dist/model/CompositionState.d.ts.map +1 -1
  429. package/dist/model/ContentModel.d.ts +6 -1
  430. package/dist/model/ContentModel.d.ts.map +1 -1
  431. package/dist/model/FileHandlerDispatcher.d.ts +3 -1
  432. package/dist/model/FileHandlerDispatcher.d.ts.map +1 -1
  433. package/dist/model/FileHandlerRegistry.d.ts +11 -2
  434. package/dist/model/FileHandlerRegistry.d.ts.map +1 -1
  435. package/dist/model/HTMLUtils.d.ts +16 -3
  436. package/dist/model/HTMLUtils.d.ts.map +1 -1
  437. package/dist/model/MarkSpec.d.ts +5 -3
  438. package/dist/model/MarkSpec.d.ts.map +1 -1
  439. package/dist/model/NodeResolver.d.ts +2 -0
  440. package/dist/model/NodeResolver.d.ts.map +1 -1
  441. package/dist/model/NodeSpec.d.ts +2 -1
  442. package/dist/model/NodeSpec.d.ts.map +1 -1
  443. package/dist/model/Schema.d.ts +2 -0
  444. package/dist/model/Schema.d.ts.map +1 -1
  445. package/dist/model/SchemaRegistry.d.ts +26 -1
  446. package/dist/model/SchemaRegistry.d.ts.map +1 -1
  447. package/dist/model/StyleClass.d.ts +45 -0
  448. package/dist/model/StyleClass.d.ts.map +1 -0
  449. package/dist/model/StyleClassRegistry.d.ts +28 -0
  450. package/dist/model/StyleClassRegistry.d.ts.map +1 -0
  451. package/dist/model/TextChange.d.ts +40 -0
  452. package/dist/model/TextChange.d.ts.map +1 -0
  453. package/dist/notectl-core.mjs +1 -1
  454. package/dist/notectl-core.umd.js +1 -1
  455. package/dist/notectl-core.umd.js.map +1 -1
  456. package/dist/plugins/Plugin.d.ts +11 -0
  457. package/dist/plugins/Plugin.d.ts.map +1 -1
  458. package/dist/plugins/PluginContextFactory.d.ts +2 -0
  459. package/dist/plugins/PluginContextFactory.d.ts.map +1 -1
  460. package/dist/plugins/RegistrationTracker.d.ts.map +1 -1
  461. package/dist/plugins/alignment/AlignmentPlugin.d.ts +17 -0
  462. package/dist/plugins/alignment/AlignmentPlugin.d.ts.map +1 -1
  463. package/dist/plugins/alignment.mjs +1 -1
  464. package/dist/plugins/bidi-isolation.mjs +1 -1
  465. package/dist/plugins/blockquote.mjs +1 -1
  466. package/dist/plugins/caret-navigation.mjs +1 -1
  467. package/dist/plugins/code-block/CodeBlockSchema.d.ts.map +1 -1
  468. package/dist/plugins/code-block.mjs +1 -1
  469. package/dist/plugins/font/FontPlugin.d.ts +13 -0
  470. package/dist/plugins/font/FontPlugin.d.ts.map +1 -1
  471. package/dist/plugins/font-size/FontSizeOperations.d.ts +2 -0
  472. package/dist/plugins/font-size/FontSizeOperations.d.ts.map +1 -1
  473. package/dist/plugins/font-size/FontSizePlugin.d.ts +11 -0
  474. package/dist/plugins/font-size/FontSizePlugin.d.ts.map +1 -1
  475. package/dist/plugins/font-size.mjs +1 -1
  476. package/dist/plugins/font.mjs +1 -1
  477. package/dist/plugins/formula/FormulaCommands.d.ts +6 -4
  478. package/dist/plugins/formula/FormulaCommands.d.ts.map +1 -1
  479. package/dist/plugins/formula/FormulaPlugin.d.ts.map +1 -1
  480. package/dist/plugins/formula/latex/LatexParser.d.ts.map +1 -1
  481. package/dist/plugins/formula/latex/LatexSymbols.d.ts.map +1 -1
  482. package/dist/plugins/formula/latex/LookupOwn.d.ts +6 -0
  483. package/dist/plugins/formula/latex/LookupOwn.d.ts.map +1 -0
  484. package/dist/plugins/formula/latex/handlers/Accents.d.ts.map +1 -1
  485. package/dist/plugins/formula/latex/handlers/Delimiters.d.ts.map +1 -1
  486. package/dist/plugins/formula/latex/handlers/Environments.d.ts.map +1 -1
  487. package/dist/plugins/formula/latex/handlers/Fonts.d.ts.map +1 -1
  488. package/dist/plugins/formula/latex/handlers/Spacing.d.ts.map +1 -1
  489. package/dist/plugins/formula.mjs +1 -1
  490. package/dist/plugins/gap-cursor/GapCursorPlugin.d.ts.map +1 -1
  491. package/dist/plugins/gap-cursor.mjs +1 -1
  492. package/dist/plugins/hard-break.mjs +1 -1
  493. package/dist/plugins/heading.mjs +1 -1
  494. package/dist/plugins/highlight/HighlightPlugin.d.ts +11 -0
  495. package/dist/plugins/highlight/HighlightPlugin.d.ts.map +1 -1
  496. package/dist/plugins/highlight.mjs +1 -1
  497. package/dist/plugins/horizontal-rule.mjs +1 -1
  498. package/dist/plugins/image/ImageCommands.d.ts +15 -3
  499. package/dist/plugins/image/ImageCommands.d.ts.map +1 -1
  500. package/dist/plugins/image/ImagePlugin.d.ts.map +1 -1
  501. package/dist/plugins/image.mjs +1 -1
  502. package/dist/plugins/inline-code/InlineCodePlugin.d.ts.map +1 -1
  503. package/dist/plugins/inline-code.mjs +1 -1
  504. package/dist/plugins/link/LinkInteractionController.d.ts +26 -0
  505. package/dist/plugins/link/LinkInteractionController.d.ts.map +1 -0
  506. package/dist/plugins/link/LinkLocale.d.ts +7 -1
  507. package/dist/plugins/link/LinkLocale.d.ts.map +1 -1
  508. package/dist/plugins/link/LinkNavigation.d.ts +12 -0
  509. package/dist/plugins/link/LinkNavigation.d.ts.map +1 -0
  510. package/dist/plugins/link/LinkPlugin.d.ts +4 -4
  511. package/dist/plugins/link/LinkPlugin.d.ts.map +1 -1
  512. package/dist/plugins/link/LinkPreview.d.ts +28 -0
  513. package/dist/plugins/link/LinkPreview.d.ts.map +1 -0
  514. package/dist/plugins/link/locales/ar.d.ts.map +1 -1
  515. package/dist/plugins/link/locales/de.d.ts.map +1 -1
  516. package/dist/plugins/link/locales/es.d.ts.map +1 -1
  517. package/dist/plugins/link/locales/fr.d.ts.map +1 -1
  518. package/dist/plugins/link/locales/hi.d.ts.map +1 -1
  519. package/dist/plugins/link/locales/pt.d.ts.map +1 -1
  520. package/dist/plugins/link/locales/ru.d.ts.map +1 -1
  521. package/dist/plugins/link/locales/zh.d.ts.map +1 -1
  522. package/dist/plugins/link.mjs +1 -1
  523. package/dist/plugins/list.mjs +1 -1
  524. package/dist/plugins/print.mjs +1 -1
  525. package/dist/plugins/shared/ColorValidation.d.ts +12 -4
  526. package/dist/plugins/shared/ColorValidation.d.ts.map +1 -1
  527. package/dist/plugins/shared/InlineStyleMarkSpec.d.ts +10 -0
  528. package/dist/plugins/shared/InlineStyleMarkSpec.d.ts.map +1 -1
  529. package/dist/plugins/shared/PopupManager.d.ts +5 -0
  530. package/dist/plugins/shared/PopupManager.d.ts.map +1 -1
  531. package/dist/plugins/shared/StyleClassNames.d.ts +10 -0
  532. package/dist/plugins/shared/StyleClassNames.d.ts.map +1 -0
  533. package/dist/plugins/shared.mjs +1 -1
  534. package/dist/plugins/smart-paste/SmartPastePlugin.d.ts +0 -1
  535. package/dist/plugins/smart-paste/SmartPastePlugin.d.ts.map +1 -1
  536. package/dist/plugins/smart-paste.mjs +1 -1
  537. package/dist/plugins/strikethrough.mjs +1 -1
  538. package/dist/plugins/super-sub.mjs +1 -1
  539. package/dist/plugins/table.mjs +1 -1
  540. package/dist/plugins/text-color/TextColorPlugin.d.ts +11 -0
  541. package/dist/plugins/text-color/TextColorPlugin.d.ts.map +1 -1
  542. package/dist/plugins/text-color.mjs +1 -1
  543. package/dist/plugins/text-direction-auto.mjs +1 -1
  544. package/dist/plugins/text-direction.mjs +1 -1
  545. package/dist/plugins/text-formatting.mjs +1 -1
  546. package/dist/plugins/toolbar.mjs +1 -1
  547. package/dist/plugins/video.mjs +1 -1
  548. package/dist/presets/full.mjs +1 -1
  549. package/dist/presets/minimal.mjs +1 -1
  550. package/dist/presets.mjs +1 -1
  551. package/dist/register.mjs +1 -1
  552. package/dist/serialization/AlignmentHTML.d.ts +43 -0
  553. package/dist/serialization/AlignmentHTML.d.ts.map +1 -0
  554. package/dist/serialization/CSSClassCollector.d.ts +20 -17
  555. package/dist/serialization/CSSClassCollector.d.ts.map +1 -1
  556. package/dist/serialization/CSSValueEquivalence.d.ts +24 -0
  557. package/dist/serialization/CSSValueEquivalence.d.ts.map +1 -0
  558. package/dist/serialization/DocumentParser.d.ts +2 -1
  559. package/dist/serialization/DocumentParser.d.ts.map +1 -1
  560. package/dist/serialization/DocumentSerializer.d.ts +0 -4
  561. package/dist/serialization/DocumentSerializer.d.ts.map +1 -1
  562. package/dist/serialization/FirstTagAttributes.d.ts +16 -0
  563. package/dist/serialization/FirstTagAttributes.d.ts.map +1 -0
  564. package/dist/serialization/HTMLParseRules.d.ts +32 -0
  565. package/dist/serialization/HTMLParseRules.d.ts.map +1 -0
  566. package/dist/serialization/HTMLParseSession.d.ts +21 -0
  567. package/dist/serialization/HTMLParseSession.d.ts.map +1 -0
  568. package/dist/serialization/MarkSerializer.d.ts.map +1 -1
  569. package/dist/serialization/StyleClassHTML.d.ts +37 -0
  570. package/dist/serialization/StyleClassHTML.d.ts.map +1 -0
  571. package/dist/serialization/StyleRehydration.d.ts +16 -0
  572. package/dist/serialization/StyleRehydration.d.ts.map +1 -0
  573. package/dist/serialization/TableDimensions.d.ts.map +1 -1
  574. package/dist/serialization/index.d.ts +2 -1
  575. package/dist/serialization/index.d.ts.map +1 -1
  576. package/dist/serialization/markdown/InlineSerializers.d.ts.map +1 -1
  577. package/dist/state/EditorState.d.ts.map +1 -1
  578. package/dist/state/History.d.ts +2 -1
  579. package/dist/state/History.d.ts.map +1 -1
  580. package/dist/state/NavigationQueries.d.ts.map +1 -1
  581. package/dist/state/SelectionValidation.d.ts +12 -0
  582. package/dist/state/SelectionValidation.d.ts.map +1 -0
  583. package/dist/state/StepApplication.d.ts.map +1 -1
  584. package/dist/state/StepMapping.d.ts.map +1 -1
  585. package/dist/state/Steps.d.ts +3 -0
  586. package/dist/state/Steps.d.ts.map +1 -1
  587. package/dist/state/StructuralPositions.d.ts +15 -0
  588. package/dist/state/StructuralPositions.d.ts.map +1 -0
  589. package/dist/state/TransactionBuilder.d.ts +13 -15
  590. package/dist/state/TransactionBuilder.d.ts.map +1 -1
  591. package/dist/test/TestUtils.d.ts.map +1 -1
  592. package/dist/view/CursorWrapper.d.ts.map +1 -1
  593. package/dist/view/EditorView.d.ts +25 -1
  594. package/dist/view/EditorView.d.ts.map +1 -1
  595. package/dist/view/EditorViewEvents.d.ts.map +1 -1
  596. package/dist/view/InlineContentDOM.d.ts +44 -0
  597. package/dist/view/InlineContentDOM.d.ts.map +1 -0
  598. package/dist/view/Reconciler.d.ts +20 -1
  599. package/dist/view/Reconciler.d.ts.map +1 -1
  600. package/dist/view/RenderedBlockText.d.ts +27 -0
  601. package/dist/view/RenderedBlockText.d.ts.map +1 -0
  602. package/dist/view/SelectionSync.d.ts.map +1 -1
  603. package/package.json +9 -8
  604. package/dist/chunks/AlignmentPlugin-DIwrRsHd.mjs +0 -2
  605. package/dist/chunks/AlignmentPlugin-DIwrRsHd.mjs.map +0 -1
  606. package/dist/chunks/AttrRegistry-CtNhf2EF.mjs.map +0 -1
  607. package/dist/chunks/AttributedMarkCommands-B3MQdob_.mjs.map +0 -1
  608. package/dist/chunks/BidiIsolationPlugin-cOLlL3Y9.mjs +0 -2
  609. package/dist/chunks/BidiIsolationPlugin-cOLlL3Y9.mjs.map +0 -1
  610. package/dist/chunks/BlockInsertion-O5pAFKid.mjs +0 -2
  611. package/dist/chunks/BlockInsertion-O5pAFKid.mjs.map +0 -1
  612. package/dist/chunks/BlockquotePlugin-D-jRWLQB.mjs +0 -2
  613. package/dist/chunks/BlockquotePlugin-D-jRWLQB.mjs.map +0 -1
  614. package/dist/chunks/CaretNavigationPlugin-DEZU09LJ.mjs.map +0 -1
  615. package/dist/chunks/CodeBlockPlugin-BandNM3t.mjs +0 -2
  616. package/dist/chunks/CodeBlockPlugin-BandNM3t.mjs.map +0 -1
  617. package/dist/chunks/ColorPickerPopup-CFYCCN7m.mjs +0 -2
  618. package/dist/chunks/ColorPickerPopup-CFYCCN7m.mjs.map +0 -1
  619. package/dist/chunks/ColorValidation-B9d_umnf.mjs.map +0 -1
  620. package/dist/chunks/Commands-D-0UXYvo.mjs +0 -2
  621. package/dist/chunks/Commands-D-0UXYvo.mjs.map +0 -1
  622. package/dist/chunks/ContentModel-Bzmzeqwg.mjs +0 -2
  623. package/dist/chunks/ContentModel-Bzmzeqwg.mjs.map +0 -1
  624. package/dist/chunks/CursorMarks-dx51OGBf.mjs.map +0 -1
  625. package/dist/chunks/Decoration-BwhoA4MU.mjs.map +0 -1
  626. package/dist/chunks/DirectionDetection-ZrkMhyaL.mjs.map +0 -1
  627. package/dist/chunks/Document-D_2cIBJG.mjs.map +0 -1
  628. package/dist/chunks/DocumentParser-i-CreJ48.mjs +0 -2
  629. package/dist/chunks/DocumentParser-i-CreJ48.mjs.map +0 -1
  630. package/dist/chunks/FontPlugin-BySgRcF3.mjs +0 -2
  631. package/dist/chunks/FontPlugin-BySgRcF3.mjs.map +0 -1
  632. package/dist/chunks/FontSizePlugin-zJDiyhUv.mjs +0 -2
  633. package/dist/chunks/FontSizePlugin-zJDiyhUv.mjs.map +0 -1
  634. package/dist/chunks/FormulaPlugin-CI0r4X1o.mjs +0 -2
  635. package/dist/chunks/FormulaPlugin-CI0r4X1o.mjs.map +0 -1
  636. package/dist/chunks/GapCursorPlugin-NozsEK9J.mjs +0 -2
  637. package/dist/chunks/GapCursorPlugin-NozsEK9J.mjs.map +0 -1
  638. package/dist/chunks/HTMLUtils-B0nGyFLb.mjs +0 -2
  639. package/dist/chunks/HTMLUtils-B0nGyFLb.mjs.map +0 -1
  640. package/dist/chunks/HardBreakPlugin-CC4rntSX.mjs.map +0 -1
  641. package/dist/chunks/HeadingPlugin-BCh12hFT.mjs +0 -2
  642. package/dist/chunks/HeadingPlugin-BCh12hFT.mjs.map +0 -1
  643. package/dist/chunks/HighlightPlugin-By7CWUss.mjs +0 -2
  644. package/dist/chunks/HighlightPlugin-By7CWUss.mjs.map +0 -1
  645. package/dist/chunks/HorizontalRulePlugin-CxmUMM34.mjs +0 -2
  646. package/dist/chunks/HorizontalRulePlugin-CxmUMM34.mjs.map +0 -1
  647. package/dist/chunks/ImagePlugin-C_MuvfYo.mjs +0 -2
  648. package/dist/chunks/ImagePlugin-C_MuvfYo.mjs.map +0 -1
  649. package/dist/chunks/InlineCodePlugin-C1SqGfv5.mjs +0 -2
  650. package/dist/chunks/InlineCodePlugin-C1SqGfv5.mjs.map +0 -1
  651. package/dist/chunks/InlineStyleMarkSpec-Cx3goc3W.mjs +0 -2
  652. package/dist/chunks/InlineStyleMarkSpec-Cx3goc3W.mjs.map +0 -1
  653. package/dist/chunks/LinkPlugin-Bsmt97Kw.mjs +0 -2
  654. package/dist/chunks/LinkPlugin-Bsmt97Kw.mjs.map +0 -1
  655. package/dist/chunks/ListPlugin--dqEctgn.mjs.map +0 -1
  656. package/dist/chunks/MarkCommands-CJvLGL5G.mjs +0 -2
  657. package/dist/chunks/MarkCommands-CJvLGL5G.mjs.map +0 -1
  658. package/dist/chunks/MarkdownHTMLRegistry-CISsC0lH.mjs +0 -2
  659. package/dist/chunks/MarkdownHTMLRegistry-CISsC0lH.mjs.map +0 -1
  660. package/dist/chunks/MarkdownParser-D1d9zB0R.mjs.map +0 -1
  661. package/dist/chunks/MarkdownSerializer-Oex2RzNw.mjs +0 -2
  662. package/dist/chunks/MarkdownSerializer-Oex2RzNw.mjs.map +0 -1
  663. package/dist/chunks/NavigationQueries-Bt4zZ17v.mjs +0 -2
  664. package/dist/chunks/NavigationQueries-Bt4zZ17v.mjs.map +0 -1
  665. package/dist/chunks/NodeResolver-BtIknXqD.mjs +0 -2
  666. package/dist/chunks/NodeResolver-BtIknXqD.mjs.map +0 -1
  667. package/dist/chunks/NodeSelectionCommands-DK3iEh18.mjs.map +0 -1
  668. package/dist/chunks/PluginHelpers-WG1Lzzh3.mjs +0 -2
  669. package/dist/chunks/PluginHelpers-WG1Lzzh3.mjs.map +0 -1
  670. package/dist/chunks/PopupManager-Jz5JrUdC.mjs +0 -2
  671. package/dist/chunks/PopupManager-Jz5JrUdC.mjs.map +0 -1
  672. package/dist/chunks/PrintPlugin-BQ7LWbEB.mjs.map +0 -1
  673. package/dist/chunks/RangeIterator-DDOxTQIf.mjs.map +0 -1
  674. package/dist/chunks/SchemaRegistry-acc6q_5x.mjs +0 -2
  675. package/dist/chunks/SchemaRegistry-acc6q_5x.mjs.map +0 -1
  676. package/dist/chunks/SelectionSync-CwOHMMfI.mjs +0 -2
  677. package/dist/chunks/SelectionSync-CwOHMMfI.mjs.map +0 -1
  678. package/dist/chunks/SelectionTransactions-DNCzsl_b.mjs.map +0 -1
  679. package/dist/chunks/SimpleMark-CTDtEIMV.mjs +0 -2
  680. package/dist/chunks/SimpleMark-CTDtEIMV.mjs.map +0 -1
  681. package/dist/chunks/SmartPastePlugin-CjExbE9Q.mjs +0 -2
  682. package/dist/chunks/SmartPastePlugin-CjExbE9Q.mjs.map +0 -1
  683. package/dist/chunks/StrikethroughPlugin-d-EW2YYx.mjs.map +0 -1
  684. package/dist/chunks/SuperSubPlugin-C-kvFQyx.mjs.map +0 -1
  685. package/dist/chunks/TableDimensions-BcARMxQB.mjs +0 -2
  686. package/dist/chunks/TableDimensions-BcARMxQB.mjs.map +0 -1
  687. package/dist/chunks/TablePlugin-CdXY0Px5.mjs +0 -2
  688. package/dist/chunks/TablePlugin-CdXY0Px5.mjs.map +0 -1
  689. package/dist/chunks/TextColorPlugin-BLTKft_Z.mjs +0 -2
  690. package/dist/chunks/TextColorPlugin-BLTKft_Z.mjs.map +0 -1
  691. package/dist/chunks/TextDirectionAutoPlugin-LVDkKdDX.mjs.map +0 -1
  692. package/dist/chunks/TextDirectionPlugin-CtGwof7i.mjs.map +0 -1
  693. package/dist/chunks/TextDirectionService-OFOU6r_s.mjs +0 -2
  694. package/dist/chunks/TextDirectionService-OFOU6r_s.mjs.map +0 -1
  695. package/dist/chunks/TextFormattingPlugin-DlS0SeW7.mjs.map +0 -1
  696. package/dist/chunks/ToolbarPlugin-CMHJCdYY.mjs +0 -2
  697. package/dist/chunks/ToolbarPlugin-CMHJCdYY.mjs.map +0 -1
  698. package/dist/chunks/VideoPlugin-C9z4JfP_.mjs +0 -2
  699. package/dist/chunks/VideoPlugin-C9z4JfP_.mjs.map +0 -1
  700. package/dist/chunks/ar-Ctrv6cIi.mjs +0 -2
  701. package/dist/chunks/ar-Ctrv6cIi.mjs.map +0 -1
  702. package/dist/chunks/color-picker-DJ05ey9o.mjs +0 -2
  703. package/dist/chunks/color-picker-DJ05ey9o.mjs.map +0 -1
  704. package/dist/chunks/de-JhGflzS5.mjs +0 -2
  705. package/dist/chunks/de-JhGflzS5.mjs.map +0 -1
  706. package/dist/chunks/es-Bv7bDbMp.mjs +0 -2
  707. package/dist/chunks/es-Bv7bDbMp.mjs.map +0 -1
  708. package/dist/chunks/fr-DtzIu6tU.mjs +0 -2
  709. package/dist/chunks/fr-DtzIu6tU.mjs.map +0 -1
  710. package/dist/chunks/full-9sO5JbWG.mjs +0 -2
  711. package/dist/chunks/full-9sO5JbWG.mjs.map +0 -1
  712. package/dist/chunks/hi-Bu799xIO.mjs +0 -2
  713. package/dist/chunks/hi-Bu799xIO.mjs.map +0 -1
  714. package/dist/chunks/minimal-C07d5reO.mjs +0 -2
  715. package/dist/chunks/minimal-C07d5reO.mjs.map +0 -1
  716. package/dist/chunks/pt-DmN9u3NX.mjs +0 -2
  717. package/dist/chunks/pt-DmN9u3NX.mjs.map +0 -1
  718. package/dist/chunks/register-DMdtiQ_Z.mjs +0 -3
  719. package/dist/chunks/register-DMdtiQ_Z.mjs.map +0 -1
  720. package/dist/chunks/ru-BxySx7an.mjs +0 -2
  721. package/dist/chunks/ru-BxySx7an.mjs.map +0 -1
  722. package/dist/chunks/zh-DuucmOns.mjs +0 -2
  723. package/dist/chunks/zh-DuucmOns.mjs.map +0 -1
  724. package/dist/editor/styles/base.d.ts +0 -3
  725. package/dist/editor/styles/base.d.ts.map +0 -1
  726. package/dist/editor/styles/color-picker.d.ts +0 -3
  727. package/dist/editor/styles/color-picker.d.ts.map +0 -1
  728. package/dist/editor/styles/font-select.d.ts +0 -3
  729. package/dist/editor/styles/font-select.d.ts.map +0 -1
  730. package/dist/editor/styles/font-size-select.d.ts +0 -3
  731. package/dist/editor/styles/font-size-select.d.ts.map +0 -1
  732. package/dist/editor/styles/heading-select.d.ts +0 -3
  733. package/dist/editor/styles/heading-select.d.ts.map +0 -1
  734. package/dist/editor/styles/image.d.ts +0 -3
  735. package/dist/editor/styles/image.d.ts.map +0 -1
  736. package/dist/editor/styles/reduced-motion.d.ts +0 -3
  737. package/dist/editor/styles/reduced-motion.d.ts.map +0 -1
  738. package/dist/editor/styles/table.d.ts +0 -3
  739. package/dist/editor/styles/table.d.ts.map +0 -1
  740. package/dist/editor/styles/toolbar.d.ts +0 -3
  741. package/dist/editor/styles/toolbar.d.ts.map +0 -1
  742. package/dist/plugins/blockquote/BlockquoteStyles.d.ts +0 -3
  743. package/dist/plugins/blockquote/BlockquoteStyles.d.ts.map +0 -1
  744. package/dist/plugins/formula/FormulaStyles.d.ts +0 -12
  745. package/dist/plugins/formula/FormulaStyles.d.ts.map +0 -1
  746. package/dist/plugins/image/ImagePopupStyles.d.ts +0 -3
  747. package/dist/plugins/image/ImagePopupStyles.d.ts.map +0 -1
  748. package/dist/plugins/video/VideoPopupStyles.d.ts +0 -3
  749. package/dist/plugins/video/VideoPopupStyles.d.ts.map +0 -1
  750. package/dist/plugins/video/VideoStyles.d.ts +0 -3
  751. package/dist/plugins/video/VideoStyles.d.ts.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"InlineCodePlugin-C1SqGfv5.mjs","names":[],"sources":["../../src/plugins/inline-code/InlineCodeLocale.ts","../../src/plugins/inline-code/InlineCodePlugin.ts"],"sourcesContent":["/**\n * Locale interface and default English locale for the InlineCodePlugin.\n */\n\nimport { type LocaleModuleMap, loadLocaleModule } from '../shared/LocaleLoader.js';\n\n// --- Locale Interface ---\n\nexport interface InlineCodeLocale {\n\treadonly label: string;\n\treadonly tooltip: (shortcut: string) => string;\n}\n\n// --- Default English Locale ---\n\nexport const INLINE_CODE_LOCALE_EN: InlineCodeLocale = {\n\tlabel: 'Inline Code',\n\ttooltip: (shortcut: string) => `Inline Code (${shortcut})`,\n};\n\n// --- Lazy Locale Loader ---\n\nconst localeModules: LocaleModuleMap<InlineCodeLocale> = import.meta.glob<{\n\tdefault: InlineCodeLocale;\n}>('./locales/*.ts', { eager: false });\n\nexport async function loadInlineCodeLocale(lang: string): Promise<InlineCodeLocale> {\n\treturn loadLocaleModule(localeModules, lang, INLINE_CODE_LOCALE_EN);\n}\n","/**\n * InlineCodePlugin: registers an inline code mark with MarkSpec,\n * toggle command, keyboard shortcut (Mod-E), backtick InputRule,\n * toolbar button, and mark exclusivity middleware.\n */\n\nimport type { BlockNode, Mark } from '../../model/Document.js';\nimport { getBlockContentSegmentsInRange } from '../../model/Document.js';\nimport { createCollapsedSelection, isCollapsed, isTextSelection } from '../../model/Selection.js';\nimport { markType } from '../../model/TypeBrands.js';\nimport type { Step } from '../../state/Steps.js';\nimport type { Plugin, PluginContext } from '../Plugin.js';\nimport { resolveLocale } from '../shared/PluginHelpers.js';\nimport { formatShortcut } from '../shared/ShortcutFormatting.js';\nimport { registerSimpleMark } from '../shared/SimpleMark.js';\nimport {\n\tINLINE_CODE_LOCALE_EN,\n\ttype InlineCodeLocale,\n\tloadInlineCodeLocale,\n} from './InlineCodeLocale.js';\n\n// --- Attribute Registry Augmentation ---\n\ndeclare module '../../model/AttrRegistry.js' {\n\tinterface MarkAttrRegistry {\n\t\tcode: Record<string, never>;\n\t}\n}\n\n// --- Configuration ---\n\nexport interface InlineCodeConfig {\n\t/** Show toolbar button. Default: true */\n\treadonly toolbar?: boolean;\n\t/** Override keyboard shortcut. Set to null to disable. Default: 'Mod-E' */\n\treadonly keymap?: string | null;\n\t/** Enable backtick InputRule. Default: true */\n\treadonly inputRule?: boolean;\n\t/** Override locale strings */\n\treadonly locale?: InlineCodeLocale;\n}\n\nconst DEFAULT_CONFIG: InlineCodeConfig = {\n\ttoolbar: true,\n\tkeymap: 'Mod-E',\n\tinputRule: true,\n};\n\n// --- CSS ---\n\nconst INLINE_CODE_CSS = `\n.notectl-content code {\n\tfont-family: ui-monospace, 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;\n\tfont-size: 0.9em;\n\tpadding: 0.15em 0.35em;\n\tborder-radius: 4px;\n\tbackground-color: var(--notectl-code-bg);\n\tcolor: var(--notectl-code-color);\n\tword-break: break-word;\n}\n@media (forced-colors: active) {\n\t.notectl-content code {\n\t\tborder: 1px solid LinkText;\n\t}\n}\n`;\n\n// --- Mark Exclusivity ---\n\nconst EXCLUDED_WITH_CODE: ReadonlySet<string> = new Set([\n\t'bold',\n\t'italic',\n\t'underline',\n\t'strikethrough',\n\t'highlight',\n\t'font',\n\t'fontSize',\n\t'superscript',\n\t'subscript',\n]);\n\n// --- Plugin ---\n\nexport class InlineCodePlugin implements Plugin {\n\treadonly id = 'inline-code';\n\treadonly name = 'Inline Code';\n\treadonly priority = 22;\n\n\tprivate readonly config: InlineCodeConfig;\n\tprivate locale!: InlineCodeLocale;\n\n\tconstructor(config?: Partial<InlineCodeConfig>) {\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\tINLINE_CODE_LOCALE_EN,\n\t\t\tloadInlineCodeLocale,\n\t\t);\n\t\tcontext.registerStyleSheet(INLINE_CODE_CSS);\n\t\tthis.registerMark(context);\n\n\t\tif (this.config.inputRule !== false) {\n\t\t\tthis.registerInputRule(context);\n\t\t}\n\t\tthis.registerExclusivityMiddleware(context);\n\t}\n\n\tprivate registerMark(context: PluginContext): void {\n\t\tconst icon =\n\t\t\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0L19.2 12l-4.6-4.6L16 6l6 6-6 6-1.4-1.4z\"/></svg>';\n\n\t\tregisterSimpleMark(context, {\n\t\t\tmarkSpec: {\n\t\t\t\ttype: 'code',\n\t\t\t\trank: 3,\n\t\t\t\ttoDOM() {\n\t\t\t\t\treturn document.createElement('code');\n\t\t\t\t},\n\t\t\t\ttoHTMLString: (_mark, content) => `<code>${content}</code>`,\n\t\t\t\tparseHTML: [\n\t\t\t\t\t{\n\t\t\t\t\t\ttag: 'code',\n\t\t\t\t\t\tgetAttrs: (el: HTMLElement) => {\n\t\t\t\t\t\t\tif (el.parentElement?.tagName === 'PRE') return false;\n\t\t\t\t\t\t\treturn {};\n\t\t\t\t\t\t},\n\t\t\t\t\t},\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\tconst fontFamily: string = el.style.fontFamily.replace(/['\"]/g, '').trim();\n\t\t\t\t\t\t\tif (/^monospace$/i.test(fontFamily)) return {};\n\t\t\t\t\t\t\treturn 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: ['code'] },\n\t\t\t},\n\t\t\tcommand: 'toggleInlineCode',\n\t\t\tkeyBinding: this.config.keymap !== null ? (this.config.keymap ?? 'Mod-E') : null,\n\t\t\ttoolbar:\n\t\t\t\tthis.config.toolbar !== false\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tid: 'inline_code',\n\t\t\t\t\t\t\tgroup: 'format',\n\t\t\t\t\t\t\ticon,\n\t\t\t\t\t\t\tlabel: this.locale.label,\n\t\t\t\t\t\t\ttooltip: this.locale.tooltip(formatShortcut(this.config.keymap ?? 'Mod-E')),\n\t\t\t\t\t\t}\n\t\t\t\t\t: undefined,\n\t\t});\n\t}\n\n\tprivate registerInputRule(context: PluginContext): void {\n\t\t// The inline-node placeholder (U+FFFC) is excluded from the span body so\n\t\t// the rule never matches across an inline node nor re-inserts it.\n\t\tconst pattern: RegExp = /(?:^|[^`])(`([^`\\uFFFC]+)`)$/;\n\n\t\tcontext.registerInputRule({\n\t\t\tpattern,\n\t\t\thandler(state, match, _start, end) {\n\t\t\t\tconst sel = state.selection;\n\t\t\t\tif (!isTextSelection(sel)) return null;\n\t\t\t\tif (!isCollapsed(sel)) return null;\n\n\t\t\t\tconst block: BlockNode | undefined = state.getBlock(sel.anchor.blockId);\n\t\t\t\tif (!block || block.type === 'code_block') return null;\n\n\t\t\t\tconst innerText: string | undefined = match[2];\n\t\t\t\tconst backtickExpr: string | undefined = match[1];\n\t\t\t\tif (!innerText || !backtickExpr) return null;\n\n\t\t\t\tconst backtickExprStart: number = end - backtickExpr.length;\n\n\t\t\t\treturn state\n\t\t\t\t\t.transaction('input')\n\t\t\t\t\t.deleteTextAt(sel.anchor.blockId, backtickExprStart, end)\n\t\t\t\t\t.insertText(sel.anchor.blockId, backtickExprStart, innerText, [\n\t\t\t\t\t\t{ type: markType('code') },\n\t\t\t\t\t])\n\t\t\t\t\t.setSelection(\n\t\t\t\t\t\tcreateCollapsedSelection(sel.anchor.blockId, backtickExprStart + innerText.length),\n\t\t\t\t\t)\n\t\t\t\t\t.build();\n\t\t\t},\n\t\t});\n\t}\n\n\t/**\n\t * Prevents formatting marks from coexisting with the code mark.\n\t * Bold, italic, underline, etc. are stripped when code is applied,\n\t * and code is blocked on text that already has formatting marks.\n\t * The link mark is allowed to coexist.\n\t */\n\tprivate registerExclusivityMiddleware(context: PluginContext): void {\n\t\tcontext.registerMiddleware(\n\t\t\t(tr, state, next) => {\n\t\t\t\tlet patched = false;\n\t\t\t\tconst patchedSteps: Step[] = [];\n\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 stepMarkType: string = step.mark.type;\n\n\t\t\t\t\tif (stepMarkType === 'code') {\n\t\t\t\t\t\t// Adding code mark: inject removeMark steps for excluded marks\n\t\t\t\t\t\tconst block: BlockNode | undefined = state.getBlock(step.blockId);\n\t\t\t\t\t\tif (block) {\n\t\t\t\t\t\t\tconst segments = getBlockContentSegmentsInRange(block, step.from, step.to);\n\t\t\t\t\t\t\tconst marksToRemove: Set<string> = new Set();\n\t\t\t\t\t\t\tfor (const seg of segments) {\n\t\t\t\t\t\t\t\tif (seg.kind !== 'text') continue;\n\t\t\t\t\t\t\t\tfor (const m of seg.marks) {\n\t\t\t\t\t\t\t\t\tif (EXCLUDED_WITH_CODE.has(m.type)) {\n\t\t\t\t\t\t\t\t\t\tmarksToRemove.add(m.type);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfor (const mt of marksToRemove) {\n\t\t\t\t\t\t\t\tpatched = true;\n\t\t\t\t\t\t\t\tpatchedSteps.push({\n\t\t\t\t\t\t\t\t\ttype: 'removeMark',\n\t\t\t\t\t\t\t\t\tblockId: step.blockId,\n\t\t\t\t\t\t\t\t\tfrom: step.from,\n\t\t\t\t\t\t\t\t\tto: step.to,\n\t\t\t\t\t\t\t\t\tmark: { type: markType(mt) },\n\t\t\t\t\t\t\t\t\t...(step.path ? { path: step.path } : {}),\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\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\tif (EXCLUDED_WITH_CODE.has(stepMarkType)) {\n\t\t\t\t\t\t// Adding a formatting mark: block if target range has code mark\n\t\t\t\t\t\tconst block: BlockNode | undefined = state.getBlock(step.blockId);\n\t\t\t\t\t\tif (block) {\n\t\t\t\t\t\t\tconst segments = getBlockContentSegmentsInRange(block, step.from, step.to);\n\t\t\t\t\t\t\tconst hasCode: boolean = segments.some(\n\t\t\t\t\t\t\t\t(seg) => seg.kind === 'text' && seg.marks.some((m) => m.type === 'code'),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tif (hasCode) {\n\t\t\t\t\t\t\t\tpatched = true;\n\t\t\t\t\t\t\t\tcontinue; // skip this step\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tpatchedSteps.push(step);\n\t\t\t\t}\n\n\t\t\t\t// Handle stored marks\n\t\t\t\tlet storedMarksAfter: readonly Mark[] | null = tr.storedMarksAfter;\n\t\t\t\tif (storedMarksAfter) {\n\t\t\t\t\tconst hasCode: boolean = storedMarksAfter.some((m) => m.type === 'code');\n\t\t\t\t\tconst hasExcluded: boolean = storedMarksAfter.some((m) => EXCLUDED_WITH_CODE.has(m.type));\n\n\t\t\t\t\tif (hasCode && hasExcluded) {\n\t\t\t\t\t\t// Keep code, strip formatting marks\n\t\t\t\t\t\tstoredMarksAfter = storedMarksAfter.filter((m) => !EXCLUDED_WITH_CODE.has(m.type));\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: 'inline-code:mark-exclusivity', priority: 50 },\n\t\t);\n\t}\n}\n"],"mappings":"iTAeA,IAAa,EAA0C,CACtD,MAAO,cACP,QAAU,GAAqB,gBAAgB,MAK1C,iBAAmD,OAAA,OAAA,CAAA,kBAAA,WAAA,qBAAA,kBAAA,WAAA,qBAAA,kBAAA,W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,MAAS,CAAC,GAG1C,CACA,EAAa,KAAK,GAClB,QACD,CAEA,GAAI,EAAmB,IAAI,GAAe,CAEzC,MAAM,EAA+B,EAAM,SAAS,EAAK,SACzD,GAAI,GACc,EAA+B,EAAO,EAAK,KAAM,EAAK,IACrC,KAChC,GAAqB,SAAb,EAAI,MAAmB,EAAI,MAAM,KAAM,GAAiB,SAAX,EAAE,OAE5C,CACZ,GAAU,EACV,QACD,CAEF,CAEA,EAAa,KAAK,EACnB,CAGA,IAAI,EAA2C,EAAG,iBAClD,GAAI,EAAkB,CACrB,MAAM,EAAmB,EAAiB,KAAM,GAAiB,SAAX,EAAE,MAClD,EAAuB,EAAiB,KAAM,GAAM,EAAmB,IAAI,EAAE,OAE/E,GAAW,IAEd,EAAmB,EAAiB,OAAQ,IAAO,EAAmB,IAAI,EAAE,OAC5E,GAAU,EAEZ,CAEA,EAAK,EAAU,IAAK,EAAI,MAAO,EAAc,oBAAqB,IAEnE,CAAE,KAAM,+BAAgC,SAAU,IAEpD"}
@@ -1,2 +0,0 @@
1
- import{r as t}from"./HTMLUtils-B0nGyFLb.mjs";import{c as r}from"./StyleRuntime-C0RSqKzG.mjs";function e(e){const{type:n,rank:s,valueAttr:a,domStyleProperty:o,cssProperty:i,validate:l,validateOnParse:u,transformParsed:p}=e,c=t=>String(t.attrs?.[a]??"");return{type:n,rank:s,attrs:{[a]:{default:""}},toDOM(t){const e=document.createElement("span"),n=c(t);return n&&r(e,o,n),e},toHTMLString:(r,e,n)=>{const s=c(r);if(!s||!l(s))return e;const a=`${i}: ${t(s)}`;return`<span${n?.styleAttr(a)??` style="${a}"`}>${e}</span>`},toHTMLStyle:r=>{const e=c(r);return e&&l(e)?`${i}: ${t(e)}`:null},parseHTML:[{tag:"span",getAttrs:t=>{const r=t.style[o]??"";if(!r)return!1;if(u&&!l(r))return!1;const e=p?p(r):r;return{[a]:e}}}],sanitize:{tags:["span"]}}}export{e as t};
2
- //# sourceMappingURL=InlineStyleMarkSpec-Cx3goc3W.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InlineStyleMarkSpec-Cx3goc3W.mjs","names":[],"sources":["../../src/plugins/shared/InlineStyleMarkSpec.ts"],"sourcesContent":["/**\n * Factory for inline marks that carry a single CSS style declaration (text\n * color, highlight, font family, font size). These marks share the same DOM\n * rendering, HTML import/export, and `<span>`-based parse shape and differ only\n * in the attribute name, CSS property, and validation.\n */\n\nimport type { Mark } from '../../model/Document.js';\nimport { escapeHTML } from '../../model/HTMLUtils.js';\nimport type { MarkSpec } from '../../model/MarkSpec.js';\nimport type { HTMLExportContext } from '../../model/NodeSpec.js';\nimport { setStyleProperty } from '../../style/StyleRuntime.js';\n\nexport interface InlineStyleMarkConfig {\n\t/** Mark type name, e.g. `'textColor'`. */\n\treadonly type: string;\n\t/** Nesting rank (lower renders closer to the text). */\n\treadonly rank: number;\n\t/** Attribute key holding the value, e.g. `'color'` / `'family'` / `'size'`. */\n\treadonly valueAttr: string;\n\t/** camelCase DOM style property, e.g. `'backgroundColor'`. */\n\treadonly domStyleProperty: string;\n\t/** kebab-case CSS property for HTML export, e.g. `'background-color'`. */\n\treadonly cssProperty: string;\n\t/** Validates a value for HTML export (and optionally on parse). */\n\treadonly validate: (value: string) => boolean;\n\t/** When true, `validate` is also enforced while parsing HTML. */\n\treadonly validateOnParse?: boolean;\n\t/** Optional transform applied to a parsed value (e.g. CSS quote normalization). */\n\treadonly transformParsed?: (value: string) => string;\n}\n\n/** Builds a MarkSpec for a single-CSS-property inline mark. */\nexport function createInlineStyleMarkSpec(config: InlineStyleMarkConfig): MarkSpec {\n\tconst {\n\t\ttype,\n\t\trank,\n\t\tvalueAttr,\n\t\tdomStyleProperty,\n\t\tcssProperty,\n\t\tvalidate,\n\t\tvalidateOnParse,\n\t\ttransformParsed,\n\t} = config;\n\n\tconst readValue = (mark: Mark): string => String(mark.attrs?.[valueAttr] ?? '');\n\n\treturn {\n\t\ttype,\n\t\trank,\n\t\tattrs: { [valueAttr]: { default: '' } },\n\t\ttoDOM(mark) {\n\t\t\tconst span: HTMLElement = document.createElement('span');\n\t\t\tconst value: string = readValue(mark);\n\t\t\tif (value) {\n\t\t\t\tsetStyleProperty(span, domStyleProperty, value);\n\t\t\t}\n\t\t\treturn span;\n\t\t},\n\t\ttoHTMLString: (mark: Mark, content: string, ctx?: HTMLExportContext) => {\n\t\t\tconst value: string = readValue(mark);\n\t\t\tif (!value || !validate(value)) return content;\n\t\t\tconst decl: string = `${cssProperty}: ${escapeHTML(value)}`;\n\t\t\tconst attr: string = ctx?.styleAttr(decl) ?? ` style=\"${decl}\"`;\n\t\t\treturn `<span${attr}>${content}</span>`;\n\t\t},\n\t\ttoHTMLStyle: (mark: Mark) => {\n\t\t\tconst value: string = readValue(mark);\n\t\t\tif (!value || !validate(value)) return null;\n\t\t\treturn `${cssProperty}: ${escapeHTML(value)}`;\n\t\t},\n\t\tparseHTML: [\n\t\t\t{\n\t\t\t\ttag: 'span',\n\t\t\t\tgetAttrs: (el: HTMLElement) => {\n\t\t\t\t\tconst raw: string =\n\t\t\t\t\t\t(el.style as unknown as Record<string, string>)[domStyleProperty] ?? '';\n\t\t\t\t\tif (!raw) return false;\n\t\t\t\t\tif (validateOnParse && !validate(raw)) return false;\n\t\t\t\t\tconst value: string = transformParsed ? transformParsed(raw) : raw;\n\t\t\t\t\treturn { [valueAttr]: value };\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t\tsanitize: { tags: ['span'] },\n\t};\n}\n"],"mappings":"6FAiCA,SAAgB,EAA0B,GACzC,MAAM,KACL,EAAA,KACA,EAAA,UACA,EAAA,iBACA,EAAA,YACA,EAAA,SACA,EAAA,gBACA,EAAA,gBACA,GACG,EAEE,EAAa,GAAuB,OAAO,EAAK,QAAQ,IAAc,IAE5E,MAAO,CACN,OACA,OACA,MAAO,CAAA,CAAG,GAAY,CAAE,QAAS,KACjC,KAAA,CAAM,GACL,MAAM,EAAoB,SAAS,cAAc,QAC3C,EAAgB,EAAU,GAIhC,OAHI,GACH,EAAiB,EAAM,EAAkB,GAEnC,CACR,EACA,aAAA,CAAe,EAAY,EAAiB,KAC3C,MAAM,EAAgB,EAAU,GAChC,IAAK,IAAU,EAAS,GAAQ,OAAO,EACvC,MAAM,EAAe,GAAG,MAAgB,EAAW,KAEnD,MAAO,QADc,GAAK,UAAU,IAAS,WAAW,QACjC,YAExB,YAAc,IACb,MAAM,EAAgB,EAAU,GAChC,OAAK,GAAU,EAAS,GACjB,GAAG,MAAgB,EAAW,KADE,MAGxC,UAAW,CACV,CACC,IAAK,OACL,SAAW,IACV,MAAM,EACJ,EAAG,MAA4C,IAAqB,GACtE,IAAK,EAAK,OAAO,EACjB,GAAI,IAAoB,EAAS,GAAM,OAAO,EAC9C,MAAM,EAAgB,EAAkB,EAAgB,GAAO,EAC/D,MAAO,CAAA,CAAG,GAAY,MAIzB,SAAU,CAAE,KAAM,CAAC,SAErB"}
@@ -1,2 +0,0 @@
1
- import{a as t,r as e,s as n}from"./HTMLUtils-B0nGyFLb.mjs";import{I as r}from"./Document-D_2cIBJG.mjs";import{c as i,f as o,n as l}from"./Selection-DC6AOGgF.mjs";import{i as s}from"./TypeBrands-Ch9856Gb.mjs";import{i as a,r as c,t as u}from"./AttributedMarkCommands-B3MQdob_.mjs";import{c as m,n as p,o as d}from"./PluginHelpers-WG1Lzzh3.mjs";import{t as h}from"./ShortcutFormatting-TwiufqeV.mjs";var f={label:"Link",tooltip:t=>`Insert Link (${t})`,removeLink:"Remove Link",removeLinkAria:"Remove link",urlPlaceholder:"https://...",urlAria:"Link URL",apply:"Apply",applyAria:"Apply link",invalidUrl:"Only http(s), mailto, tel, fragments, and relative paths are allowed."},g=/* #__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-Ctrv6cIi.mjs"),"./locales/de.ts":()=>import("./de-JhGflzS5.mjs"),"./locales/es.ts":()=>import("./es-Bv7bDbMp.mjs"),"./locales/fr.ts":()=>import("./fr-DtzIu6tU.mjs"),"./locales/hi.ts":()=>import("./hi-Bu799xIO.mjs"),"./locales/pt.ts":()=>import("./pt-DmN9u3NX.mjs"),"./locales/ru.ts":()=>import("./ru-BxySx7an.mjs"),"./locales/zh.ts":()=>import("./zh-DuucmOns.mjs")});async function k(t){return m(g,t,f)}var v={openInNewTab:!0},b=/(?:^|[^!])(\[([^\]\uFFFC]+)\]\(([^)\s\uFFFC]+)(?:\s+"([^"\uFFFC]*)")?\))$/,L=/(<([a-zA-Z][a-zA-Z0-9+.-]{1,31}:[^<>\s\uFFFC]+)>)$/;function C(t,e){return e&&!t.startsWith("#")}var A=class{id="link";name="Link";priority=25;config;locale;fragmentClickContainer=null;fragmentClickHandler=null;constructor(t){this.config={...v,...t}}async init(t){this.locale=await d(t,this.config.locale,f,k),this.registerMarkSpec(t),this.registerCommands(t),this.registerKeymap(t),this.registerToolbarItem(t),!1!==this.config.inputRule&&this.registerInputRules(t),this.installFragmentClickHandler(t)}destroy(){this.removeFragmentClickHandler()}registerInputRules(t){const e=(t,e,n,r,i,o,a)=>{const c={href:o};return a&&(c.title=a),t.transaction("input").deleteTextAt(e,n,r).insertText(e,n,i,[{type:s("link"),attrs:c}]).setSelection(l(e,n+i.length)).build()};t.registerInputRule({pattern:b,handler(t,r,l,s){const a=t.selection;if(!o(a)||!i(a))return null;const c=t.getBlock(a.anchor.blockId);if(!c||"code_block"===c.type)return null;const u=r[1],m=r[2],p=r[3],d=r[4];if(!u||!m||!p)return null;const h=n(p);return""===h?null:e(t,a.anchor.blockId,s-u.length,s,m,h,d)}}),t.registerInputRule({pattern:L,handler(t,r,l,s){const a=t.selection;if(!o(a)||!i(a))return null;const c=t.getBlock(a.anchor.blockId);if(!c||"code_block"===c.type)return null;const u=r[1],m=r[2];if(!u||!m)return null;const p=n(m);return""===p?null:e(t,a.anchor.blockId,s-u.length,s,m,p)}})}registerMarkSpec(t){const r=this.config.openInNewTab;t.registerMarkSpec({type:"link",rank:10,inclusive:!1,attrs:{href:{default:""},title:{default:""}},toDOM(t){const e=document.createElement("a"),i=n(String(t.attrs?.href??""));e.setAttribute("href",i);const o=String(t.attrs?.title??"");return o&&e.setAttribute("title",o),C(i,r)&&(e.setAttribute("target","_blank"),e.setAttribute("rel","noopener noreferrer")),e},toHTMLString:(t,i)=>{const o=n(String(t.attrs?.href??"")),l=e(o),s=String(t.attrs?.title??""),a=s?` title="${e(s)}"`:"";return C(o,r)?`<a href="${l}"${a} target="_blank" rel="noopener noreferrer">${i}</a>`:`<a href="${l}"${a}>${i}</a>`},parseHTML:[{tag:"a",getAttrs:t=>{const e=n(t.getAttribute("href")??""),r=t.getAttribute("title")??"";return r?{href:e,title:r}:{href:e}}}],sanitize:{tags:["a"],attrs:["href","title","target","rel"]}})}installFragmentClickHandler(e){this.removeFragmentClickHandler();const n=e.getContainer(),r=e=>{if(e.defaultPrevented||0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;const r=function(t,e){let n=e instanceof Element?e:e instanceof Node?e.parentElement:null;for(;n&&t.contains(n);){if(n instanceof HTMLAnchorElement)return n;if(n===t)break;n=n.parentElement}return null}(n,e.target);if(!r)return;const i=t(r.getAttribute("href")??"");if(0===i.length)return;const o=function(t,e){for(const n of e){if(t.id===n)return t;const e=t.getElementsByTagName("*");for(let t=0;t<e.length;t++){const r=e.item(t);if(r?.id===n)return r}}return null}(n,i);o&&(e.preventDefault(),o.scrollIntoView())};this.fragmentClickContainer=n,this.fragmentClickHandler=r,n.addEventListener("click",r)}removeFragmentClickHandler(){this.fragmentClickContainer&&this.fragmentClickHandler&&this.fragmentClickContainer.removeEventListener("click",this.fragmentClickHandler),this.fragmentClickContainer=null,this.fragmentClickHandler=null}registerCommands(t){t.registerCommand("toggleLink",()=>{const e=t.getState();return this.toggleLink(t,e)}),t.registerCommand("setLink",()=>!1),t.registerCommand("removeLink",()=>{const e=t.getState();return this.removeLink(t,e)})}registerKeymap(t){t.registerKeymap({"Mod-K":()=>t.executeCommand("toggleLink")})}registerToolbarItem(t){t.registerToolbarItem({id:"link",group:"insert",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg>',label:this.locale.label,tooltip:this.locale.tooltip(h("Mod-K")),command:"toggleLink",popupType:"custom",renderPopup:(t,e,n)=>{this.renderLinkPopup(t,e,n)},isActive:t=>this.isLinkActive(t),isEnabled:t=>!i(t.selection)})}isLinkActive(t){return c(t,"link")}toggleLink(t,e){return!!this.isLinkActive(e)&&this.removeLink(t,e)}addLink(t,e,n){const r=e.selection;if(!o(r))return!1;if(i(r))return!1;const l={type:s("link"),attrs:{href:n}};return p(t,u(e,l))}removeLink(t,e){const n=e.selection;if(!o(n))return!1;if(i(n)){const i=e.getBlock(n.anchor.blockId);if(!i)return!1;const o=[];let l=0;for(const t of i.children){if(!("text"in t))continue;const e=l+t.text.length;o.push({pos:l,end:e,hasLink:r(t.marks,s("link"))}),l=e}const a=o.findIndex(t=>n.anchor.offset>=t.pos&&n.anchor.offset<=t.end),c=a>=0?o[a]:void 0;if(-1===a||!c?.hasLink)return!1;let u=a;for(;u>0&&o[u-1]?.hasLink;)u--;let m=a;for(;m<o.length-1&&o[m+1]?.hasLink;)m++;const p=o[u],d=o[m];if(!p||!d)return!1;const h=p.pos,f=d.end,g=e.transaction("command");return g.removeMark(n.anchor.blockId,h,f,{type:s("link")}),g.setSelection(n),t.dispatch(g.build()),!0}return p(t,a(e,s("link")))}renderLinkPopup(t,e,r){t.classList.add("notectl-link-popup");const i=e.getState();if(this.isLinkActive(i)){const n=document.createElement("button");n.type="button",n.className="notectl-link-popup__button",n.textContent=this.locale.removeLink,n.setAttribute("aria-label",this.locale.removeLinkAria),n.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation()}),n.addEventListener("click",()=>{e.executeCommand("removeLink"),r(),e.getContainer().focus()}),t.appendChild(n)}else{const i=document.createElement("input");i.type="url",i.className="notectl-link-popup__input",i.placeholder=this.locale.urlPlaceholder,i.setAttribute("aria-label",this.locale.urlAria);const o=document.createElement("button");o.type="button",o.className="notectl-link-popup__button notectl-link-popup__button--apply",o.textContent=this.locale.apply,o.setAttribute("aria-label",this.locale.applyAria);const l=document.createElement("div");l.className="notectl-link-popup__error",l.setAttribute("role","alert"),l.hidden=!0;const s=()=>{const t=i.value.trim();if(""===t)return;const o=n(t);if(""===o)return l.textContent=this.locale.invalidUrl,l.hidden=!1,i.setAttribute("aria-invalid","true"),void i.focus();l.hidden=!0,i.removeAttribute("aria-invalid"),this.addLink(e,e.getState(),o),r(),e.getContainer().focus()};o.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation()}),o.addEventListener("click",()=>{s()}),i.addEventListener("keydown",t=>{"Enter"===t.key&&(t.preventDefault(),s())}),i.addEventListener("input",()=>{l.hidden||(l.hidden=!0,i.removeAttribute("aria-invalid"))}),t.appendChild(i),t.appendChild(o),t.appendChild(l),requestAnimationFrame(()=>i.focus())}}};export{f as n,k as r,A as t};
2
- //# sourceMappingURL=LinkPlugin-Bsmt97Kw.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LinkPlugin-Bsmt97Kw.mjs","names":[],"sources":["../../src/plugins/link/LinkLocale.ts","../../src/plugins/link/LinkPlugin.ts"],"sourcesContent":["/**\n * Locale interface and default English locale for the LinkPlugin.\n */\n\nimport { type LocaleModuleMap, loadLocaleModule } from '../shared/LocaleLoader.js';\n\n// --- Locale Interface ---\n\nexport interface LinkLocale {\n\treadonly label: string;\n\treadonly tooltip: (shortcut: string) => string;\n\treadonly removeLink: string;\n\treadonly removeLinkAria: string;\n\treadonly urlPlaceholder: string;\n\treadonly urlAria: string;\n\treadonly apply: string;\n\treadonly applyAria: string;\n\treadonly invalidUrl: string;\n}\n\n// --- Default English Locale ---\n\nexport const LINK_LOCALE_EN: LinkLocale = {\n\tlabel: 'Link',\n\ttooltip: (shortcut: string) => `Insert Link (${shortcut})`,\n\tremoveLink: 'Remove Link',\n\tremoveLinkAria: 'Remove link',\n\turlPlaceholder: 'https://...',\n\turlAria: 'Link URL',\n\tapply: 'Apply',\n\tapplyAria: 'Apply link',\n\tinvalidUrl: 'Only http(s), mailto, tel, fragments, and relative paths are allowed.',\n};\n\n// --- Lazy Locale Loader ---\n\nconst localeModules: LocaleModuleMap<LinkLocale> = import.meta.glob<{\n\tdefault: LinkLocale;\n}>('./locales/*.ts', { eager: false });\n\nexport async function loadLinkLocale(lang: string): Promise<LinkLocale> {\n\treturn loadLocaleModule(localeModules, lang, LINK_LOCALE_EN);\n}\n","/**\n * LinkPlugin: registers a link mark type with href attribute,\n * toggle command, keyboard shortcut (Mod-K), and toolbar button\n * with a URL input popup.\n */\n\nimport {\n\tapplyAttributedMark,\n\tisAttributedMarkActive,\n\tremoveAttributedMark,\n} from '../../commands/AttributedMarkCommands.js';\nimport type { BlockNode } from '../../model/Document.js';\nimport { hasMark } from '../../model/Document.js';\nimport { escapeHTML, fragmentIdentifiers, sanitizeHref } from '../../model/HTMLUtils.js';\nimport { createCollapsedSelection, isCollapsed, isTextSelection } from '../../model/Selection.js';\nimport { markType } from '../../model/TypeBrands.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { Plugin, PluginContext } from '../Plugin.js';\nimport { dispatchIfPresent, resolveLocale } from '../shared/PluginHelpers.js';\nimport { formatShortcut } from '../shared/ShortcutFormatting.js';\nimport { LINK_LOCALE_EN, type LinkLocale, loadLinkLocale } from './LinkLocale.js';\n\n// --- Attribute Registry Augmentation ---\n\ndeclare module '../../model/AttrRegistry.js' {\n\tinterface MarkAttrRegistry {\n\t\tlink: { href: string; title?: string };\n\t}\n}\n\n// --- Configuration ---\n\nexport interface LinkConfig {\n\t/** Whether to add rel=\"noopener noreferrer\" and target=\"_blank\" by default. */\n\treadonly openInNewTab: boolean;\n\t/** Live Markdown shortcuts: `[text](url \"title\")` and `<url>` autolink. Default true. */\n\treadonly inputRule?: boolean;\n\treadonly locale?: LinkLocale;\n}\n\nconst DEFAULT_CONFIG: LinkConfig = {\n\topenInNewTab: true,\n};\n\n// The inline-node placeholder (U+FFFC) is excluded from every re-inserted\n// capture so a live link rule never spans an inline node nor writes the\n// sentinel back as literal text.\n/** `[text](url \"optional title\")`, not preceded by `!` (which would be an image). */\nconst LINK_RULE = /(?:^|[^!])(\\[([^\\]\\uFFFC]+)\\]\\(([^)\\s\\uFFFC]+)(?:\\s+\"([^\"\\uFFFC]*)\")?\\))$/;\n/** `<scheme:...>` autolink. */\nconst AUTOLINK_RULE = /(<([a-zA-Z][a-zA-Z0-9+.-]{1,31}:[^<>\\s\\uFFFC]+)>)$/;\n\n/** Fragment-only links stay in the current editor even when external links open in a new tab. */\nfunction shouldOpenInNewTab(href: string, openInNewTab: boolean): boolean {\n\treturn openInNewTab && !href.startsWith('#');\n}\n\n/** Finds the clicked anchor without interpolating user-controlled data into a CSS selector. */\nfunction findClickedAnchor(\n\tcontainer: HTMLElement,\n\ttarget: EventTarget | null,\n): HTMLAnchorElement | null {\n\tlet element: Element | null =\n\t\ttarget instanceof Element ? target : target instanceof Node ? target.parentElement : null;\n\n\twhile (element && container.contains(element)) {\n\t\tif (element instanceof HTMLAnchorElement) return element;\n\t\tif (element === container) break;\n\t\telement = element.parentElement;\n\t}\n\n\treturn null;\n}\n\n/** Resolves an ID inside this editor by direct string comparison, never through a CSS selector. */\nfunction findFragmentTarget(\n\tcontainer: HTMLElement,\n\tidentifiers: readonly string[],\n): Element | null {\n\tfor (const identifier of identifiers) {\n\t\tif (container.id === identifier) return container;\n\n\t\tconst descendants: HTMLCollectionOf<Element> = container.getElementsByTagName('*');\n\t\tfor (let index = 0; index < descendants.length; index++) {\n\t\t\tconst descendant: Element | null = descendants.item(index);\n\t\t\tif (descendant?.id === identifier) return descendant;\n\t\t}\n\t}\n\n\treturn null;\n}\n\n// --- Plugin ---\n\nexport class LinkPlugin implements Plugin {\n\treadonly id = 'link';\n\treadonly name = 'Link';\n\treadonly priority = 25;\n\n\tprivate readonly config: LinkConfig;\n\tprivate locale!: LinkLocale;\n\tprivate fragmentClickContainer: HTMLElement | null = null;\n\tprivate fragmentClickHandler: ((event: MouseEvent) => void) | null = null;\n\n\tconstructor(config?: Partial<LinkConfig>) {\n\t\tthis.config = { ...DEFAULT_CONFIG, ...config };\n\t}\n\n\tasync init(context: PluginContext): Promise<void> {\n\t\tthis.locale = await resolveLocale(context, this.config.locale, LINK_LOCALE_EN, loadLinkLocale);\n\t\tthis.registerMarkSpec(context);\n\t\tthis.registerCommands(context);\n\t\tthis.registerKeymap(context);\n\t\tthis.registerToolbarItem(context);\n\t\tif (this.config.inputRule !== false) {\n\t\t\tthis.registerInputRules(context);\n\t\t}\n\t\tthis.installFragmentClickHandler(context);\n\t}\n\n\tdestroy(): void {\n\t\tthis.removeFragmentClickHandler();\n\t}\n\n\t/**\n\t * Live Markdown link rules: `[text](url \"title\")` and `<url>` autolink. Bespoke\n\t * (not the shared wrapping-mark helper) because links carry an `href`/`title`\n\t * attribute and two capture groups (D6).\n\t */\n\tprivate registerInputRules(context: PluginContext): void {\n\t\tconst buildLink = (\n\t\t\tstate: EditorState,\n\t\t\tblockId: BlockNode['id'],\n\t\t\tstart: number,\n\t\t\tend: number,\n\t\t\ttext: string,\n\t\t\thref: string,\n\t\t\ttitle?: string,\n\t\t) => {\n\t\t\tconst attrs: Record<string, string> = { href };\n\t\t\tif (title) attrs.title = title;\n\t\t\treturn state\n\t\t\t\t.transaction('input')\n\t\t\t\t.deleteTextAt(blockId, start, end)\n\t\t\t\t.insertText(blockId, start, text, [{ type: markType('link'), attrs }])\n\t\t\t\t.setSelection(createCollapsedSelection(blockId, start + text.length))\n\t\t\t\t.build();\n\t\t};\n\n\t\tcontext.registerInputRule({\n\t\t\tpattern: LINK_RULE,\n\t\t\thandler(state, match, _start, end) {\n\t\t\t\tconst sel = state.selection;\n\t\t\t\tif (!isTextSelection(sel) || !isCollapsed(sel)) return null;\n\t\t\t\tconst block: BlockNode | undefined = state.getBlock(sel.anchor.blockId);\n\t\t\t\tif (!block || block.type === 'code_block') return null;\n\n\t\t\t\tconst expr = match[1];\n\t\t\t\tconst text = match[2];\n\t\t\t\tconst rawHref = match[3];\n\t\t\t\tconst title = match[4];\n\t\t\t\tif (!expr || !text || !rawHref) return null;\n\t\t\t\tconst href: string = sanitizeHref(rawHref);\n\t\t\t\tif (href === '') return null;\n\n\t\t\t\treturn buildLink(state, sel.anchor.blockId, end - expr.length, end, text, href, title);\n\t\t\t},\n\t\t});\n\n\t\tcontext.registerInputRule({\n\t\t\tpattern: AUTOLINK_RULE,\n\t\t\thandler(state, match, _start, end) {\n\t\t\t\tconst sel = state.selection;\n\t\t\t\tif (!isTextSelection(sel) || !isCollapsed(sel)) return null;\n\t\t\t\tconst block: BlockNode | undefined = state.getBlock(sel.anchor.blockId);\n\t\t\t\tif (!block || block.type === 'code_block') return null;\n\n\t\t\t\tconst expr = match[1];\n\t\t\t\tconst url = match[2];\n\t\t\t\tif (!expr || !url) return null;\n\t\t\t\tconst href: string = sanitizeHref(url);\n\t\t\t\tif (href === '') return null;\n\n\t\t\t\treturn buildLink(state, sel.anchor.blockId, end - expr.length, end, url, href);\n\t\t\t},\n\t\t});\n\t}\n\n\tprivate registerMarkSpec(context: PluginContext): void {\n\t\tconst openInNewTab = this.config.openInNewTab;\n\n\t\tcontext.registerMarkSpec({\n\t\t\ttype: 'link',\n\t\t\trank: 10,\n\t\t\tinclusive: false,\n\t\t\tattrs: {\n\t\t\t\thref: { default: '' },\n\t\t\t\ttitle: { default: '' },\n\t\t\t},\n\t\t\ttoDOM(mark) {\n\t\t\t\tconst a = document.createElement('a');\n\t\t\t\tconst href: string = sanitizeHref(String(mark.attrs?.href ?? ''));\n\t\t\t\ta.setAttribute('href', href);\n\t\t\t\tconst title: string = String(mark.attrs?.title ?? '');\n\t\t\t\tif (title) a.setAttribute('title', title);\n\t\t\t\tif (shouldOpenInNewTab(href, openInNewTab)) {\n\t\t\t\t\ta.setAttribute('target', '_blank');\n\t\t\t\t\ta.setAttribute('rel', 'noopener noreferrer');\n\t\t\t\t}\n\t\t\t\treturn a;\n\t\t\t},\n\t\t\ttoHTMLString: (mark, content) => {\n\t\t\t\tconst safeHref: string = sanitizeHref(String(mark.attrs?.href ?? ''));\n\t\t\t\tconst href: string = escapeHTML(safeHref);\n\t\t\t\tconst titleValue: string = String(mark.attrs?.title ?? '');\n\t\t\t\tconst titleAttr: string = titleValue ? ` title=\"${escapeHTML(titleValue)}\"` : '';\n\t\t\t\tif (shouldOpenInNewTab(safeHref, openInNewTab)) {\n\t\t\t\t\treturn `<a href=\"${href}\"${titleAttr} target=\"_blank\" rel=\"noopener noreferrer\">${content}</a>`;\n\t\t\t\t}\n\t\t\t\treturn `<a href=\"${href}\"${titleAttr}>${content}</a>`;\n\t\t\t},\n\t\t\tparseHTML: [\n\t\t\t\t{\n\t\t\t\t\ttag: 'a',\n\t\t\t\t\tgetAttrs: (el) => {\n\t\t\t\t\t\t// Returning an empty href (instead of `false`) keeps the link mark\n\t\t\t\t\t\t// applied so the parser does not fall back to the core HTMLParser's\n\t\t\t\t\t\t// raw-href default; the empty value renders as a no-op anchor.\n\t\t\t\t\t\tconst href: string = sanitizeHref(el.getAttribute('href') ?? '');\n\t\t\t\t\t\tconst title: string = el.getAttribute('title') ?? '';\n\t\t\t\t\t\treturn title ? { href, title } : { href };\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t\tsanitize: { tags: ['a'], attrs: ['href', 'title', 'target', 'rel'] },\n\t\t});\n\t}\n\n\tprivate installFragmentClickHandler(context: PluginContext): void {\n\t\tthis.removeFragmentClickHandler();\n\n\t\tconst container: HTMLElement = context.getContainer();\n\t\tconst handler = (event: MouseEvent): void => {\n\t\t\tif (\n\t\t\t\tevent.defaultPrevented ||\n\t\t\t\tevent.button !== 0 ||\n\t\t\t\tevent.metaKey ||\n\t\t\t\tevent.ctrlKey ||\n\t\t\t\tevent.shiftKey ||\n\t\t\t\tevent.altKey\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst anchor: HTMLAnchorElement | null = findClickedAnchor(container, event.target);\n\t\t\tif (!anchor) return;\n\n\t\t\tconst identifiers: readonly string[] = fragmentIdentifiers(anchor.getAttribute('href') ?? '');\n\t\t\tif (identifiers.length === 0) return;\n\n\t\t\tconst target: Element | null = findFragmentTarget(container, identifiers);\n\t\t\tif (!target) return;\n\n\t\t\tevent.preventDefault();\n\t\t\ttarget.scrollIntoView();\n\t\t};\n\n\t\tthis.fragmentClickContainer = container;\n\t\tthis.fragmentClickHandler = handler;\n\t\tcontainer.addEventListener('click', handler);\n\t}\n\n\tprivate removeFragmentClickHandler(): void {\n\t\tif (this.fragmentClickContainer && this.fragmentClickHandler) {\n\t\t\tthis.fragmentClickContainer.removeEventListener('click', this.fragmentClickHandler);\n\t\t}\n\t\tthis.fragmentClickContainer = null;\n\t\tthis.fragmentClickHandler = null;\n\t}\n\n\tprivate registerCommands(context: PluginContext): void {\n\t\tcontext.registerCommand('toggleLink', () => {\n\t\t\tconst state = context.getState();\n\t\t\treturn this.toggleLink(context, state);\n\t\t});\n\n\t\tcontext.registerCommand('setLink', () => {\n\t\t\t// setLink is called by the popup after URL input\n\t\t\t// The actual URL is set via the popup's custom render\n\t\t\treturn false;\n\t\t});\n\n\t\tcontext.registerCommand('removeLink', () => {\n\t\t\tconst state = context.getState();\n\t\t\treturn this.removeLink(context, state);\n\t\t});\n\t}\n\n\tprivate registerKeymap(context: PluginContext): void {\n\t\tcontext.registerKeymap({\n\t\t\t'Mod-K': () => context.executeCommand('toggleLink'),\n\t\t});\n\t}\n\n\tprivate registerToolbarItem(context: PluginContext): void {\n\t\tconst icon =\n\t\t\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z\"/></svg>';\n\n\t\tcontext.registerToolbarItem({\n\t\t\tid: 'link',\n\t\t\tgroup: 'insert',\n\t\t\ticon,\n\t\t\tlabel: this.locale.label,\n\t\t\ttooltip: this.locale.tooltip(formatShortcut('Mod-K')),\n\t\t\tcommand: 'toggleLink',\n\t\t\tpopupType: 'custom',\n\t\t\trenderPopup: (container, ctx, onClose) => {\n\t\t\t\tthis.renderLinkPopup(container, ctx, onClose);\n\t\t\t},\n\t\t\tisActive: (state) => this.isLinkActive(state),\n\t\t\tisEnabled: (state) => !isCollapsed(state.selection),\n\t\t});\n\t}\n\n\tprivate isLinkActive(state: EditorState): boolean {\n\t\treturn isAttributedMarkActive(state, 'link');\n\t}\n\n\tprivate toggleLink(context: PluginContext, state: EditorState): boolean {\n\t\tif (this.isLinkActive(state)) {\n\t\t\treturn this.removeLink(context, state);\n\t\t}\n\t\t// Adding links requires the toolbar popup for URL input\n\t\treturn false;\n\t}\n\n\tprivate addLink(context: PluginContext, state: EditorState, href: string): boolean {\n\t\tconst sel = state.selection;\n\t\tif (!isTextSelection(sel)) return false;\n\t\tif (isCollapsed(sel)) return false;\n\n\t\tconst mark = { type: markType('link'), attrs: { href } };\n\t\treturn dispatchIfPresent(context, applyAttributedMark(state, mark));\n\t}\n\n\tprivate removeLink(context: PluginContext, state: EditorState): boolean {\n\t\tconst sel = state.selection;\n\t\tif (!isTextSelection(sel)) return false;\n\n\t\tif (isCollapsed(sel)) {\n\t\t\t// Remove link from entire link span around cursor (plugin-specific extent scan)\n\t\t\tconst block = state.getBlock(sel.anchor.blockId);\n\t\t\tif (!block) return false;\n\n\t\t\tconst textChildren: { pos: number; end: number; hasLink: boolean }[] = [];\n\t\t\tlet pos = 0;\n\t\t\tfor (const child of block.children) {\n\t\t\t\tif (!('text' in child)) continue;\n\t\t\t\tconst end = pos + child.text.length;\n\t\t\t\ttextChildren.push({ pos, end, hasLink: hasMark(child.marks, markType('link')) });\n\t\t\t\tpos = end;\n\t\t\t}\n\n\t\t\tconst cursorIdx = textChildren.findIndex(\n\t\t\t\t(c) => sel.anchor.offset >= c.pos && sel.anchor.offset <= c.end,\n\t\t\t);\n\t\t\tconst cursorEntry = cursorIdx >= 0 ? textChildren[cursorIdx] : undefined;\n\t\t\tif (cursorIdx === -1 || !cursorEntry?.hasLink) return false;\n\n\t\t\tlet startIdx = cursorIdx;\n\t\t\twhile (startIdx > 0 && textChildren[startIdx - 1]?.hasLink) {\n\t\t\t\tstartIdx--;\n\t\t\t}\n\n\t\t\tlet endIdx = cursorIdx;\n\t\t\twhile (endIdx < textChildren.length - 1 && textChildren[endIdx + 1]?.hasLink) {\n\t\t\t\tendIdx++;\n\t\t\t}\n\n\t\t\tconst startEntry = textChildren[startIdx];\n\t\t\tconst endEntry = textChildren[endIdx];\n\t\t\tif (!startEntry || !endEntry) return false;\n\n\t\t\tconst linkStart = startEntry.pos;\n\t\t\tconst linkEnd = endEntry.end;\n\n\t\t\tconst builder = state.transaction('command');\n\t\t\tbuilder.removeMark(sel.anchor.blockId, linkStart, linkEnd, { type: markType('link') });\n\t\t\tbuilder.setSelection(sel);\n\t\t\tcontext.dispatch(builder.build());\n\t\t\treturn true;\n\t\t}\n\n\t\t// Range selection: delegate to shared helper\n\t\treturn dispatchIfPresent(context, removeAttributedMark(state, markType('link')));\n\t}\n\n\tprivate renderLinkPopup(\n\t\tcontainer: HTMLElement,\n\t\tcontext: PluginContext,\n\t\tonClose: () => void,\n\t): void {\n\t\tcontainer.classList.add('notectl-link-popup');\n\n\t\tconst state = context.getState();\n\t\tconst isActive = this.isLinkActive(state);\n\n\t\tif (isActive) {\n\t\t\t// Show remove link button\n\t\t\tconst removeBtn = document.createElement('button');\n\t\t\tremoveBtn.type = 'button';\n\t\t\tremoveBtn.className = 'notectl-link-popup__button';\n\t\t\tremoveBtn.textContent = this.locale.removeLink;\n\t\t\tremoveBtn.setAttribute('aria-label', this.locale.removeLinkAria);\n\t\t\tremoveBtn.addEventListener('mousedown', (e) => {\n\t\t\t\te.preventDefault();\n\t\t\t\te.stopPropagation();\n\t\t\t});\n\t\t\tremoveBtn.addEventListener('click', () => {\n\t\t\t\tcontext.executeCommand('removeLink');\n\t\t\t\tonClose();\n\t\t\t\tcontext.getContainer().focus();\n\t\t\t});\n\t\t\tcontainer.appendChild(removeBtn);\n\t\t} else {\n\t\t\t// Show URL input\n\t\t\tconst input = document.createElement('input');\n\t\t\tinput.type = 'url';\n\t\t\tinput.className = 'notectl-link-popup__input';\n\t\t\tinput.placeholder = this.locale.urlPlaceholder;\n\t\t\tinput.setAttribute('aria-label', this.locale.urlAria);\n\n\t\t\tconst applyBtn = document.createElement('button');\n\t\t\tapplyBtn.type = 'button';\n\t\t\tapplyBtn.className = 'notectl-link-popup__button notectl-link-popup__button--apply';\n\t\t\tapplyBtn.textContent = this.locale.apply;\n\t\t\tapplyBtn.setAttribute('aria-label', this.locale.applyAria);\n\n\t\t\tconst errorMsg = document.createElement('div');\n\t\t\terrorMsg.className = 'notectl-link-popup__error';\n\t\t\terrorMsg.setAttribute('role', 'alert');\n\t\t\terrorMsg.hidden = true;\n\n\t\t\tconst applyLink = (): void => {\n\t\t\t\tconst raw: string = input.value.trim();\n\t\t\t\tif (raw === '') return;\n\t\t\t\tconst sanitized: string = sanitizeHref(raw);\n\t\t\t\tif (sanitized === '') {\n\t\t\t\t\terrorMsg.textContent = this.locale.invalidUrl;\n\t\t\t\t\terrorMsg.hidden = false;\n\t\t\t\t\tinput.setAttribute('aria-invalid', 'true');\n\t\t\t\t\tinput.focus();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\terrorMsg.hidden = true;\n\t\t\t\tinput.removeAttribute('aria-invalid');\n\t\t\t\tthis.addLink(context, context.getState(), sanitized);\n\t\t\t\tonClose();\n\t\t\t\tcontext.getContainer().focus();\n\t\t\t};\n\n\t\t\tapplyBtn.addEventListener('mousedown', (e) => {\n\t\t\t\te.preventDefault();\n\t\t\t\te.stopPropagation();\n\t\t\t});\n\t\t\tapplyBtn.addEventListener('click', () => {\n\t\t\t\tapplyLink();\n\t\t\t});\n\n\t\t\tinput.addEventListener('keydown', (e) => {\n\t\t\t\tif (e.key === 'Enter') {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tapplyLink();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tinput.addEventListener('input', () => {\n\t\t\t\tif (!errorMsg.hidden) {\n\t\t\t\t\terrorMsg.hidden = true;\n\t\t\t\t\tinput.removeAttribute('aria-invalid');\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tcontainer.appendChild(input);\n\t\t\tcontainer.appendChild(applyBtn);\n\t\t\tcontainer.appendChild(errorMsg);\n\n\t\t\t// Auto-focus input\n\t\t\trequestAnimationFrame(() => input.focus());\n\t\t}\n\t}\n}\n"],"mappings":"6YAsBA,IAAa,EAA6B,CACzC,MAAO,OACP,QAAU,GAAqB,gBAAgB,KAC/C,WAAY,cACZ,eAAgB,cAChB,eAAgB,cAChB,QAAS,WACT,MAAO,QACP,UAAW,aACX,WAAY,yEAKP,iBAA6C,OAAA,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,uBAInD,eAAsB,EAAe,GACpC,OAAO,EAAiB,EAAe,EAAM,EAC9C,CCFA,IAAM,EAA6B,CAClC,cAAc,GAOT,EAAY,4EAEZ,EAAgB,qDAGtB,SAAS,EAAmB,EAAc,GACzC,OAAO,IAAi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,KAAO,SAChB,EAAS,UAAY,+DACrB,EAAS,YAAc,KAAK,OAAO,MACnC,EAAS,aAAa,aAAc,KAAK,OAAO,WAEhD,MAAM,EAAW,SAAS,cAAc,OACxC,EAAS,UAAY,4BACrB,EAAS,aAAa,OAAQ,SAC9B,EAAS,QAAS,EAElB,MAAM,EAAA,KACL,MAAM,EAAc,EAAM,MAAM,OAChC,GAAY,KAAR,EAAY,OAChB,MAAM,EAAoB,EAAa,GACvC,GAAkB,KAAd,EAKH,OAJA,EAAS,YAAc,KAAK,OAAO,WACnC,EAAS,QAAS,EAClB,EAAM,aAAa,eAAgB,aACnC,EAAM,QAGP,EAAS,QAAS,EAClB,EAAM,gBAAgB,gBACtB,KAAK,QAAQ,EAAS,EAAQ,WAAY,GAC1C,IACA,EAAQ,eAAe,SAGxB,EAAS,iBAAiB,YAAc,IACvC,EAAE,iBACF,EAAE,oBAEH,EAAS,iBAAiB,QAAA,KACzB,MAGD,EAAM,iBAAiB,UAAY,IACpB,UAAV,EAAE,MACL,EAAE,iBACF,OAIF,EAAM,iBAAiB,QAAA,KACjB,EAAS,SACb,EAAS,QAAS,EAClB,EAAM,gBAAgB,mBAIxB,EAAU,YAAY,GACtB,EAAU,YAAY,GACtB,EAAU,YAAY,GAGtB,sBAAA,IAA4B,EAAM,QACnC,CACD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ListPlugin--dqEctgn.mjs","names":[],"sources":["../../src/editor/styles/list.ts","../../src/plugins/list/ListAttrsFactory.ts","../../src/plugins/list/ListItemContext.ts","../../src/plugins/list/ListCommands.ts","../../src/plugins/list/ListDefinitions.ts","../../src/plugins/list/ListInputRules.ts","../../src/plugins/list/ListKeyboardHandlers.ts","../../src/plugins/list/ListLocale.ts","../../src/plugins/list/ListMarker.ts","../../src/plugins/list/ListToolbarItems.ts","../../src/plugins/list/ListPlugin.ts"],"sourcesContent":["/** Width of the list marker / checkbox area in pixels. */\nexport const LIST_MARKER_WIDTH = 24;\n\n/** List styles — bullet, ordered, checklist items. */\nexport const LIST_CSS = `\n/* List Wrappers — suppress native markers, we use ::before pseudo-elements */\n.notectl-list {\n\tlist-style: none;\n\tmargin: 0;\n\tpadding: 0;\n}\n\n/* Ordered List — each <ol> wrapper resets the counter */\n.notectl-list--ordered {\n\tcounter-reset: notectl-ordered;\n}\n\n/* List Items */\n.notectl-list-item {\n\tmargin: 0;\n\tpadding: 2px 0;\n\tpadding-inline-start: ${LIST_MARKER_WIDTH}px;\n\tmin-height: 1.6em;\n\tposition: relative;\n}\n\n.notectl-list-item::before {\n\tposition: absolute;\n\tinset-inline-start: 0;\n\tdisplay: inline-block;\n\twidth: ${LIST_MARKER_WIDTH}px;\n\ttext-align: center;\n\t-webkit-user-select: none;\n\tuser-select: none;\n\tpointer-events: none;\n}\n\n/* Container items (#194): block children inherit the item's start padding.\n Trim the first/last child paragraph padding so the first text line sits on\n the marker's line and the item keeps the leaf item's vertical rhythm. */\n.notectl-list-item > p:first-of-type {\n\tpadding-top: 0;\n}\n\n.notectl-list-item > p:last-of-type {\n\tpadding-bottom: 0;\n}\n\n/* Bullet List */\n.notectl-list-item--bullet::before {\n\tcontent: '\\\\2022';\n\tcolor: var(--notectl-fg);\n}\n\n/* Ordered List — counter increment per item */\n.notectl-list-item--ordered {\n\tcounter-increment: notectl-ordered;\n}\n\n.notectl-list-item--ordered::before {\n\tcontent: counter(notectl-ordered) '.';\n\tcolor: var(--notectl-fg);\n\tfont-size: 14px;\n}\n\n/* Checklist — the marker is a real role=\"checkbox\" element (see ListMarker.ts)\n positioned over the reserved marker zone. inline-block keeps the parent's\n line-through (on checked items) from striking the glyph. */\n.notectl-checklist-marker {\n\tposition: absolute;\n\tinset-inline-start: 0;\n\tdisplay: inline-block;\n\twidth: ${LIST_MARKER_WIDTH}px;\n\ttext-align: center;\n\tfont-size: 16px;\n\tcolor: var(--notectl-fg-muted);\n\tcursor: pointer;\n\ttext-decoration: none;\n\t-webkit-user-select: none;\n\tuser-select: none;\n}\n\n.notectl-checklist-marker::before {\n\tcontent: '\\\\2610';\n}\n\n.notectl-list-item--checklist[data-checked=\"true\"] .notectl-checklist-marker {\n\tcolor: var(--notectl-success);\n}\n\n.notectl-list-item--checklist[data-checked=\"true\"] .notectl-checklist-marker::before {\n\tcontent: '\\\\2611';\n}\n\n.notectl-list-item--checklist[data-checked=\"true\"] {\n\tcolor: var(--notectl-fg-muted);\n\ttext-decoration: line-through;\n}\n`;\n","/**\n * Factory for building list item block attributes.\n * Centralizes attribute construction to avoid repetitive inline object literals.\n */\n\nimport type { BlockAttrs } from '../../model/Document.js';\nimport type { ListType } from './ListPlugin.js';\n\n/** Builds a `BlockAttrs` object for a list_item block. */\nexport function buildListItemAttrs(\n\tlistType: ListType,\n\tindent: number,\n\tchecked?: boolean,\n): BlockAttrs {\n\tif (listType === 'checklist') {\n\t\treturn { listType, indent, checked: checked ?? false };\n\t}\n\treturn { listType, indent };\n}\n","/**\n * Shared resolution helpers for container list items (#194).\n *\n * With `list_item` a hybrid leaf/container block, the caret may sit inside a\n * block child of an item. Commands and keyboard handlers resolve the owning\n * item through the ancestor chain and address structural edits through the\n * item's location (parent path + child index), mirroring the blockquote\n * container conventions.\n */\n\nimport type { BlockNode } from '../../model/Document.js';\nimport { getBlockChildren } from '../../model/Document.js';\nimport type { BlockId } from '../../model/TypeBrands.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { TransactionBuilder } from '../../state/TransactionBuilder.js';\n\n/** A list item's structural address: its parent path and child index. */\nexport interface ListItemLocation {\n\treadonly item: BlockNode;\n\t/** Path from the document root to the item's parent ([] = root). */\n\treadonly parentPath: readonly BlockId[];\n\t/** The item's index among its parent's block children. */\n\treadonly index: number;\n}\n\n/**\n * Resolves the list item owning a block: the block itself when it is a\n * `list_item`, otherwise its nearest `list_item` ancestor.\n */\nexport function resolveListItem(state: EditorState, id: BlockId): BlockNode | undefined {\n\tconst block: BlockNode | undefined = state.getBlock(id);\n\tif (block?.type === 'list_item') return block;\n\tconst path: readonly BlockId[] | undefined = state.getNodePath(id);\n\tif (!path) return undefined;\n\tfor (let i = path.length - 2; i >= 0; i--) {\n\t\tconst ancestorId: BlockId | undefined = path[i];\n\t\tconst ancestor: BlockNode | undefined = ancestorId ? state.getBlock(ancestorId) : undefined;\n\t\tif (ancestor?.type === 'list_item') return ancestor;\n\t}\n\treturn undefined;\n}\n\n/** Locates a list item's structural address, or undefined if it is not found. */\nexport function locateListItem(state: EditorState, itemId: BlockId): ListItemLocation | undefined {\n\tconst item: BlockNode | undefined = state.getBlock(itemId);\n\tif (!item || item.type !== 'list_item') return undefined;\n\tconst path: readonly BlockId[] | undefined = state.getNodePath(itemId);\n\tif (!path) return undefined;\n\n\tconst parentPath: readonly BlockId[] = path.slice(0, -1);\n\tconst parentId: BlockId | undefined = parentPath[parentPath.length - 1];\n\tconst siblings: readonly BlockNode[] = parentId\n\t\t? getBlockChildren(state.getBlock(parentId) as BlockNode)\n\t\t: state.doc.children;\n\tconst index: number = siblings.findIndex((sibling) => sibling.id === itemId);\n\tif (index < 0) return undefined;\n\treturn { item, parentPath, index };\n}\n\n/**\n * Replaces a container list item with its block children in place. The\n * children keep their IDs, so a selection inside them survives the lift.\n * Leaf items must not be dissolved (their inline content is not a block);\n * convert those via `setBlockType` instead.\n */\nexport function dissolveListItem(builder: TransactionBuilder, location: ListItemLocation): void {\n\tbuilder.removeNode(location.parentPath, location.index);\n\tconst children: readonly BlockNode[] = getBlockChildren(location.item);\n\tchildren.forEach((child, offset) => {\n\t\tbuilder.insertNode(location.parentPath, location.index + offset, child);\n\t});\n}\n","/**\n * Command registration and implementations for list block types.\n * Handles toggle between list types and paragraph, indent/outdent,\n * and checklist toggle.\n */\n\nimport { forEachBlockIdInRange } from '../../commands/RangeIterator.js';\nimport { isNodeOfType } from '../../model/AttrRegistry.js';\nimport type { BlockNode } from '../../model/Document.js';\nimport { isLeafBlock } from '../../model/Document.js';\nimport { isTextSelection, selectionRange } from '../../model/Selection.js';\nimport { type BlockId, nodeType } from '../../model/TypeBrands.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { PluginContext } from '../Plugin.js';\nimport { buildListItemAttrs } from './ListAttrsFactory.js';\nimport type { ListTypeDefinition } from './ListDefinitions.js';\nimport { dissolveListItem, locateListItem, resolveListItem } from './ListItemContext.js';\nimport type { ListLocale } from './ListLocale.js';\nimport type { ListConfig, ListType } from './ListPlugin.js';\n\n/** Registers all list commands (toggleList:*, indent, outdent, toggleChecklistItem). */\nexport function registerListCommands(\n\tcontext: PluginContext,\n\tconfig: ListConfig,\n\tenabledTypes: readonly ListTypeDefinition[],\n\tlocale: ListLocale,\n): void {\n\tfor (const def of enabledTypes) {\n\t\tcontext.registerCommand(`toggleList:${def.type}`, () => {\n\t\t\treturn toggleList(context, def.type);\n\t\t});\n\t}\n\n\tcontext.registerCommand('indentListItem', () => changeIndent(context, 1, config.maxIndent));\n\n\tcontext.registerCommand('outdentListItem', () => changeIndent(context, -1, config.maxIndent));\n\n\tif (config.types.includes('checklist')) {\n\t\tconst toggleChecklistItem = (): boolean =>\n\t\t\ttoggleChecked(context, { interactiveCheckboxes: config.interactiveCheckboxes, locale });\n\n\t\tcontext.registerCommand('toggleChecklistItem', toggleChecklistItem, {\n\t\t\treadonlyAllowed: config.interactiveCheckboxes,\n\t\t});\n\n\t\t// Mod-Enter gives keyboard-only users a way to toggle a checklist item\n\t\t// (WCAG 2.1.1). The handler declines on non-checklist blocks, so it falls\n\t\t// through to other Mod-Enter bindings (e.g. code-block insert-after).\n\t\t// Registered at navigation priority so it stays reachable in read-only mode\n\t\t// when interactiveCheckboxes is enabled, matching the mouse handler.\n\t\tcontext.registerKeymap({ 'Mod-Enter': toggleChecklistItem }, { priority: 'navigation' });\n\t}\n\n\tcontext.registerKeymap({\n\t\tTab: () => changeIndent(context, 1, config.maxIndent),\n\t\t'Shift-Tab': () => changeIndent(context, -1, config.maxIndent),\n\t});\n}\n\n// --- Command Implementations ---\n\nfunction toggleList(context: PluginContext, listType: ListType): boolean {\n\tconst state: EditorState = context.getState();\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return false;\n\n\tif (sel.anchor.blockId !== sel.head.blockId) {\n\t\treturn toggleListRange(context, state, listType);\n\t}\n\treturn toggleListSingleBlock(context, state, listType);\n}\n\nfunction toggleListSingleBlock(\n\tcontext: PluginContext,\n\tstate: EditorState,\n\tlistType: ListType,\n): boolean {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return false;\n\tconst block = state.getBlock(sel.anchor.blockId);\n\tif (!block) return false;\n\n\t// The caret may sit inside a block child of a container item (#194):\n\t// toggling always targets the owning item, never the child.\n\tconst item: BlockNode | undefined = resolveListItem(state, sel.anchor.blockId);\n\tconst target: BlockNode = item ?? block;\n\n\tif (item && item.attrs?.listType === listType) {\n\t\tconst builder = state.transaction('command');\n\t\tif (isLeafBlock(item)) {\n\t\t\tbuilder.setBlockType(item.id, nodeType('paragraph'));\n\t\t} else {\n\t\t\t// A container item cannot become a paragraph (its children are\n\t\t\t// blocks) — dissolve it into those children instead.\n\t\t\tconst location = locateListItem(state, item.id);\n\t\t\tif (!location) return false;\n\t\t\tdissolveListItem(builder, location);\n\t\t}\n\t\tbuilder.setSelection(sel);\n\t\tcontext.dispatch(builder.build());\n\t\treturn true;\n\t}\n\n\tconst existingIndent: number = isNodeOfType(target, 'list_item') ? target.attrs.indent : 0;\n\tconst attrs = buildListItemAttrs(listType, existingIndent);\n\n\tconst tr = state\n\t\t.transaction('command')\n\t\t.setBlockType(target.id, nodeType('list_item'), attrs)\n\t\t.setSelection(sel)\n\t\t.build();\n\tcontext.dispatch(tr);\n\treturn true;\n}\n\nfunction toggleListRange(context: PluginContext, state: EditorState, listType: ListType): boolean {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return false;\n\n\tconst range = selectionRange(sel, state.getBlockOrder());\n\tconst toggleOff: boolean = allBlocksMatchListType(state, range, listType);\n\tconst builder = state.transaction('command');\n\n\t// Children of a container item resolve to their owning item (#194), so a\n\t// range over its paragraphs toggles the item once, not each child.\n\tconst targets: BlockNode[] = collectToggleTargets(state, range);\n\n\t// Dissolving replaces one node with several, shifting later sibling\n\t// indices — process targets back-to-front so earlier addresses stay valid.\n\tfor (let i = targets.length - 1; i >= 0; i--) {\n\t\tconst target: BlockNode | undefined = targets[i];\n\t\tif (!target) continue;\n\n\t\tif (toggleOff) {\n\t\t\tif (isLeafBlock(target)) {\n\t\t\t\tbuilder.setBlockType(target.id, nodeType('paragraph'));\n\t\t\t} else {\n\t\t\t\tconst location = locateListItem(state, target.id);\n\t\t\t\tif (location) dissolveListItem(builder, location);\n\t\t\t}\n\t\t} else {\n\t\t\tconst existingIndent: number = isNodeOfType(target, 'list_item') ? target.attrs.indent : 0;\n\t\t\tconst existingChecked: boolean =\n\t\t\t\tisNodeOfType(target, 'list_item') &&\n\t\t\t\ttarget.attrs.listType === 'checklist' &&\n\t\t\t\ttarget.attrs.checked;\n\t\t\tbuilder.setBlockType(\n\t\t\t\ttarget.id,\n\t\t\t\tnodeType('list_item'),\n\t\t\t\tbuildListItemAttrs(listType, existingIndent, existingChecked),\n\t\t\t);\n\t\t}\n\t}\n\n\tbuilder.setSelection(sel);\n\tcontext.dispatch(builder.build());\n\treturn true;\n}\n\n/** Collects unique toggle targets: each leaf block or its owning list item. */\nfunction collectToggleTargets(\n\tstate: EditorState,\n\trange: ReturnType<typeof selectionRange>,\n): BlockNode[] {\n\tconst targets: BlockNode[] = [];\n\tconst seen = new Set<BlockId>();\n\tforEachBlockIdInRange(state, range, (bid: BlockId) => {\n\t\tconst block = state.getBlock(bid);\n\t\tif (!block) return;\n\t\tconst target: BlockNode = resolveListItem(state, bid) ?? block;\n\t\tif (seen.has(target.id)) return;\n\t\tseen.add(target.id);\n\t\ttargets.push(target);\n\t});\n\treturn targets;\n}\n\n// --- Indent / Outdent ---\n\nfunction changeIndent(context: PluginContext, delta: 1 | -1, maxIndent: number): boolean {\n\tconst state: EditorState = context.getState();\n\tif (!isTextSelection(state.selection)) return false;\n\n\tif (state.selection.anchor.blockId !== state.selection.head.blockId) {\n\t\treturn changeIndentRange(context, state, delta, maxIndent);\n\t}\n\n\tconst sel = state.selection;\n\tconst block = resolveListItem(state, sel.anchor.blockId);\n\tif (!block || !isNodeOfType(block, 'list_item')) return false;\n\n\tconst newIndent: number = block.attrs.indent + delta;\n\tif (newIndent < 0 || newIndent > maxIndent) return false;\n\n\tconst attrs = buildListItemAttrs(block.attrs.listType, newIndent, block.attrs.checked);\n\tconst tr = state\n\t\t.transaction('command')\n\t\t.setBlockType(block.id, nodeType('list_item'), attrs)\n\t\t.setSelection(sel)\n\t\t.build();\n\tcontext.dispatch(tr);\n\treturn true;\n}\n\nfunction changeIndentRange(\n\tcontext: PluginContext,\n\tstate: EditorState,\n\tdelta: 1 | -1,\n\tmaxIndent: number,\n): boolean {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return false;\n\n\tconst range = selectionRange(sel, state.getBlockOrder());\n\tconst builder = state.transaction('command');\n\tlet changed = false;\n\tconst seen = new Set<BlockId>();\n\n\tforEachBlockIdInRange(state, range, (bid: BlockId) => {\n\t\tconst block = resolveListItem(state, bid);\n\t\tif (!block || !isNodeOfType(block, 'list_item')) return;\n\t\tif (seen.has(block.id)) return;\n\t\tseen.add(block.id);\n\n\t\tconst newIndent: number = block.attrs.indent + delta;\n\t\tif (newIndent < 0 || newIndent > maxIndent) return;\n\n\t\tbuilder.setBlockType(\n\t\t\tblock.id,\n\t\t\tnodeType('list_item'),\n\t\t\tbuildListItemAttrs(block.attrs.listType, newIndent, block.attrs.checked),\n\t\t);\n\t\tchanged = true;\n\t});\n\n\tif (!changed) return false;\n\n\tbuilder.setSelection(sel);\n\tcontext.dispatch(builder.build());\n\treturn true;\n}\n\n// --- Checklist Toggle ---\n\n/** Options for {@link toggleChecked}. */\nexport interface ToggleCheckedOptions {\n\t/** When true, the toggle is allowed even in read-only mode. */\n\treadonly interactiveCheckboxes?: boolean;\n\t/** Specific checklist item to toggle. Defaults to the selection's block. */\n\treadonly targetId?: BlockId;\n\t/** Locale used for the screen-reader announcement of the new state. */\n\treadonly locale: ListLocale;\n}\n\n/**\n * Toggles the checked state of a checklist item and announces the new state to\n * screen readers. Exported for use in the checkbox click handler.\n */\nexport function toggleChecked(context: PluginContext, options: ToggleCheckedOptions): boolean {\n\tconst { interactiveCheckboxes, targetId, locale } = options;\n\tif (context.isReadOnly() && !interactiveCheckboxes) return false;\n\n\tconst state: EditorState = context.getState();\n\tconst bid: BlockId | null =\n\t\ttargetId ?? (!isTextSelection(state.selection) ? null : state.selection.anchor.blockId);\n\tif (!bid) return false;\n\n\tconst block = resolveListItem(state, bid);\n\tif (!block || !isNodeOfType(block, 'list_item') || block.attrs.listType !== 'checklist') {\n\t\treturn false;\n\t}\n\n\tconst nextChecked: boolean = !block.attrs.checked;\n\tconst attrs = buildListItemAttrs(block.attrs.listType, block.attrs.indent, nextChecked);\n\n\tconst builder = state\n\t\t.transaction('command')\n\t\t.setBlockType(block.id, nodeType('list_item'), attrs)\n\t\t.setSelection(state.selection);\n\tif (context.isReadOnly() && interactiveCheckboxes) builder.readonlyAllowed();\n\tcontext.dispatch(builder.build());\n\n\t// Dispatch is synchronous, but the production EditorView may reject a\n\t// transaction (read-only guard or re-entrant update). Only report/announce a\n\t// state transition that actually reached the authoritative editor state.\n\tconst applied = context.getState().getBlock(block.id);\n\tif (\n\t\t!applied ||\n\t\t!isNodeOfType(applied, 'list_item') ||\n\t\tapplied.attrs.listType !== 'checklist' ||\n\t\tapplied.attrs.checked !== nextChecked\n\t) {\n\t\treturn false;\n\t}\n\n\t// The marker is not focused while editing, so the aria-checked change alone is\n\t// not spoken — announce the new state explicitly (WCAG 4.1.3).\n\tcontext.announce(nextChecked ? locale.checkedAnnouncement : locale.uncheckedAnnouncement);\n\treturn true;\n}\n\n// --- Helpers ---\n\n/**\n * Checks whether all blocks in a range belong to list items of the given type\n * (children of container items resolve to their owning item, #194). Exported\n * for toolbar active-state detection.\n */\nexport function allBlocksMatchListType(\n\tstate: EditorState,\n\trange: ReturnType<typeof selectionRange>,\n\tlistType: ListType,\n): boolean {\n\tlet allMatch = true;\n\tforEachBlockIdInRange(state, range, (bid: BlockId) => {\n\t\tconst block = resolveListItem(state, bid);\n\t\tif (!block || block.type !== 'list_item' || block.attrs?.listType !== listType) {\n\t\t\tallMatch = false;\n\t\t}\n\t});\n\treturn allMatch;\n}\n","/**\n * List type metadata: icons, patterns, and type definitions.\n * Pure data constants shared across list plugin modules.\n */\n\nimport type { ListType } from './ListPlugin.js';\n\n// --- List Type Metadata ---\n\nexport interface ListTypeDefinition {\n\treadonly type: ListType;\n\treadonly icon: string;\n\treadonly inputPattern: RegExp;\n\treadonly inputPrefix: string;\n}\n\nconst BULLET_LIST_ICON =\n\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M4 10.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5zm0-6c-.83 0-1.5.67-1.5 1.5S3.17 7.5 4 7.5 5.5 6.83 5.5 6 4.83 4.5 4 4.5zm0 12c-.83 0-1.5.68-1.5 1.5s.68 1.5 1.5 1.5 1.5-.68 1.5-1.5-.67-1.5-1.5-1.5zM7 19h14v-2H7v2zm0-6h14v-2H7v2zm0-8v2h14V5H7z\"/></svg>';\nconst NUMBERED_LIST_ICON =\n\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M2 17h2v.5H3v1h1v.5H2v1h3v-4H2v1zm1-9h1V4H2v1h1v3zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2v1zm5-6v2h14V5H7zm0 14h14v-2H7v2zm0-6h14v-2H7v2z\"/></svg>';\nconst CHECKLIST_ICON =\n\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M22 7h-9v2h9V7zm0 8h-9v2h9v-2zM5.54 11L2 7.46l1.41-1.41 2.12 2.12 4.24-4.24 1.41 1.41L5.54 11zm0 8L2 15.46l1.41-1.41 2.12 2.12 4.24-4.24 1.41 1.41L5.54 19z\"/></svg>';\n\nexport const LIST_TYPE_DEFINITIONS: readonly ListTypeDefinition[] = [\n\t{\n\t\ttype: 'bullet',\n\t\ticon: BULLET_LIST_ICON,\n\t\tinputPattern: /^[-*] $/,\n\t\tinputPrefix: '- ',\n\t},\n\t{\n\t\ttype: 'ordered',\n\t\ticon: NUMBERED_LIST_ICON,\n\t\tinputPattern: /^\\d+\\. $/,\n\t\tinputPrefix: '1. ',\n\t},\n\t{\n\t\ttype: 'checklist',\n\t\ticon: CHECKLIST_ICON,\n\t\tinputPattern: /^\\[[ x]] $/,\n\t\tinputPrefix: '[ ] ',\n\t},\n];\n","/**\n * Input rule registration for list block types.\n * Converts `- `, `* `, `1. `, `[ ] `, `[x] ` at the start of a paragraph into list items.\n */\n\nimport { createCollapsedSelection, isCollapsed, isTextSelection } from '../../model/Selection.js';\nimport { nodeType } from '../../model/TypeBrands.js';\nimport type { PluginContext } from '../Plugin.js';\nimport { buildListItemAttrs } from './ListAttrsFactory.js';\nimport type { ListTypeDefinition } from './ListDefinitions.js';\n\n/** Registers markdown-style input rules for configured list types. */\nexport function registerListInputRules(\n\tcontext: PluginContext,\n\tenabledTypes: readonly ListTypeDefinition[],\n): void {\n\tfor (const def of enabledTypes) {\n\t\tcontext.registerInputRule({\n\t\t\tpattern: def.inputPattern,\n\t\t\thandler: (state, match, start, _end) => {\n\t\t\t\tconst sel = state.selection;\n\t\t\t\tif (!isTextSelection(sel)) return null;\n\t\t\t\tif (!isCollapsed(sel)) return null;\n\n\t\t\t\tconst block = state.getBlock(sel.anchor.blockId);\n\t\t\t\tif (!block || block.type !== 'paragraph') return null;\n\n\t\t\t\t// Inside a container list item (#194) the rule must not fire: it\n\t\t\t\t// would nest a list_item into a list_item, which the schema forbids.\n\t\t\t\tconst parent = state.getParent(sel.anchor.blockId);\n\t\t\t\tif (parent?.type === 'list_item') return null;\n\n\t\t\t\tconst matchStr = match[0] ?? '';\n\t\t\t\tconst matchLen = matchStr.length;\n\t\t\t\tconst attrs = buildListItemAttrs(def.type, 0, matchStr.includes('[x]'));\n\n\t\t\t\treturn state\n\t\t\t\t\t.transaction('input')\n\t\t\t\t\t.deleteTextAt(sel.anchor.blockId, start, start + matchLen)\n\t\t\t\t\t.setBlockType(sel.anchor.blockId, nodeType('list_item'), attrs)\n\t\t\t\t\t.setSelection(createCollapsedSelection(sel.anchor.blockId, 0))\n\t\t\t\t\t.build();\n\t\t\t},\n\t\t});\n\t}\n}\n","/**\n * Keyboard handlers for list block types.\n *\n * Leaf items: Enter splits into a new item (or exits an empty item),\n * Backspace at the start converts back to a paragraph.\n *\n * Container items (#194): the caret sits inside a block child. Enter on an\n * empty trailing child exits into a new sibling item (Enter-Enter continues\n * the list); Backspace at the start of the first child dissolves the item\n * into its children — both mirroring the blockquote container conventions.\n * Everything else falls through to the default split/merge behavior.\n */\n\nimport { isEmptyParagraph } from '../../commands/BlockInsertion.js';\nimport { isNodeOfType } from '../../model/AttrRegistry.js';\nimport type { BlockNode } from '../../model/Document.js';\nimport { generateBlockId, getBlockChildren, getBlockText } from '../../model/Document.js';\nimport { createBlockNode, createTextNode } from '../../model/Document.js';\nimport { createCollapsedSelection, isCollapsed, isTextSelection } from '../../model/Selection.js';\nimport type { BlockId } from '../../model/TypeBrands.js';\nimport { nodeType } from '../../model/TypeBrands.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { PluginContext } from '../Plugin.js';\nimport { buildListItemAttrs } from './ListAttrsFactory.js';\nimport { type ListItemLocation, dissolveListItem, locateListItem } from './ListItemContext.js';\n\n// --- Context Guard ---\n\ninterface ListContext {\n\treadonly state: EditorState;\n\t/** The list item owning the caret (the caret block itself for leaf items). */\n\treadonly item: BlockNode;\n\t/** The caret's block child of a container item; undefined for leaf items. */\n\treadonly child: BlockNode | undefined;\n\treadonly childIndex: number;\n\treadonly childCount: number;\n\treadonly blockId: BlockId;\n\treadonly offset: number;\n}\n\n/**\n * Guards against NodeSelection, non-collapsed selections, and carets outside\n * list items. Resolves both leaf items (caret directly inside the item) and\n * container items (caret inside a direct block child of the item).\n */\nfunction withListContext(context: PluginContext, handler: (ctx: ListContext) => boolean): boolean {\n\tconst state: EditorState = context.getState();\n\tif (!isTextSelection(state.selection)) return false;\n\n\tconst sel = state.selection;\n\tif (!isCollapsed(sel)) return false;\n\n\tconst block: BlockNode | undefined = state.getBlock(sel.anchor.blockId);\n\tif (!block) return false;\n\n\tif (block.type === 'list_item') {\n\t\treturn handler({\n\t\t\tstate,\n\t\t\titem: block,\n\t\t\tchild: undefined,\n\t\t\tchildIndex: -1,\n\t\t\tchildCount: 0,\n\t\t\tblockId: sel.anchor.blockId,\n\t\t\toffset: sel.anchor.offset,\n\t\t});\n\t}\n\n\tconst parent: BlockNode | undefined = state.getParent(sel.anchor.blockId);\n\tif (!parent || parent.type !== 'list_item') return false;\n\tconst children: readonly BlockNode[] = getBlockChildren(parent);\n\tconst childIndex: number = children.findIndex((c) => c.id === block.id);\n\tif (childIndex < 0) return false;\n\n\treturn handler({\n\t\tstate,\n\t\titem: parent,\n\t\tchild: block,\n\t\tchildIndex,\n\t\tchildCount: children.length,\n\t\tblockId: sel.anchor.blockId,\n\t\toffset: sel.anchor.offset,\n\t});\n}\n\n/** Registers Enter and Backspace keymaps for list items. */\nexport function registerListKeymaps(context: PluginContext): void {\n\tcontext.registerKeymap({\n\t\tEnter: () => handleEnter(context),\n\t\tBackspace: () => handleBackspace(context),\n\t});\n}\n\n// --- Enter Handler ---\n\n/**\n * Handles Enter inside a list item.\n * Leaf items: empty → exit list (convert to paragraph); non-empty → split\n * into a new item of the same type.\n * Container items: an empty trailing child exits into a new sibling item;\n * a lone empty child dissolves the item. Everything else falls through to\n * the default split (which grows the item's children).\n */\nfunction handleEnter(context: PluginContext): boolean {\n\treturn withListContext(context, (ctx) => {\n\t\tif (ctx.child) return handleEnterInContainerChild(context, ctx, ctx.child);\n\n\t\tconst text: string = getBlockText(ctx.item);\n\n\t\tif (text === '') {\n\t\t\tconst tr = ctx.state\n\t\t\t\t.transaction('input')\n\t\t\t\t.setBlockType(ctx.blockId, nodeType('paragraph'))\n\t\t\t\t.setSelection(ctx.state.selection)\n\t\t\t\t.build();\n\t\t\tcontext.dispatch(tr);\n\t\t\treturn true;\n\t\t}\n\n\t\tconst newBlockId = generateBlockId();\n\t\tconst listType = isNodeOfType(ctx.item, 'list_item') ? ctx.item.attrs.listType : 'bullet';\n\t\tconst indent: number = isNodeOfType(ctx.item, 'list_item') ? ctx.item.attrs.indent : 0;\n\t\tconst attrs = buildListItemAttrs(listType, indent);\n\n\t\tconst tr = ctx.state\n\t\t\t.transaction('input')\n\t\t\t.splitBlock(ctx.blockId, ctx.offset, newBlockId)\n\t\t\t.setBlockType(newBlockId, nodeType('list_item'), attrs)\n\t\t\t.setSelection(createCollapsedSelection(newBlockId, 0))\n\t\t\t.build();\n\t\tcontext.dispatch(tr);\n\t\treturn true;\n\t});\n}\n\n/** Enter inside a container item's child: exit on an empty trailing child. */\nfunction handleEnterInContainerChild(\n\tcontext: PluginContext,\n\tctx: ListContext,\n\tchild: BlockNode,\n): boolean {\n\tif (!isEmptyParagraph(child)) return false;\n\tif (ctx.childIndex !== ctx.childCount - 1) return false;\n\n\tconst location: ListItemLocation | undefined = locateListItem(ctx.state, ctx.item.id);\n\tif (!location) return false;\n\n\tconst builder = ctx.state.transaction('input');\n\n\tif (ctx.childCount === 1) {\n\t\t// A lone empty child: the item has no content left — dissolve it and\n\t\t// keep the paragraph (same ID, so the caret stays put).\n\t\tdissolveListItem(builder, location);\n\t\tbuilder.setSelection(ctx.state.selection);\n\t\tcontext.dispatch(builder.build());\n\t\treturn true;\n\t}\n\n\t// Drop the empty trailing child and continue the list with a fresh item.\n\tconst listType = isNodeOfType(ctx.item, 'list_item') ? ctx.item.attrs.listType : 'bullet';\n\tconst indent: number = isNodeOfType(ctx.item, 'list_item') ? ctx.item.attrs.indent : 0;\n\tconst newItemId = generateBlockId();\n\tconst newItem: BlockNode = createBlockNode(\n\t\tnodeType('list_item'),\n\t\t[createTextNode('')],\n\t\tnewItemId,\n\t\tbuildListItemAttrs(listType, indent),\n\t);\n\n\tbuilder\n\t\t.removeNode([...location.parentPath, ctx.item.id], ctx.childIndex)\n\t\t.insertNode(location.parentPath, location.index + 1, newItem)\n\t\t.setSelection(createCollapsedSelection(newItemId, 0));\n\tcontext.dispatch(builder.build());\n\treturn true;\n}\n\n// --- Backspace Handler ---\n\n/**\n * Handles Backspace at the start of a list item.\n * Leaf items convert back to a paragraph. Container items dissolve into\n * their block children when the caret sits at the very start of the first\n * child (the un-list gesture); later children fall through to the default\n * sibling merge.\n */\nfunction handleBackspace(context: PluginContext): boolean {\n\treturn withListContext(context, (ctx) => {\n\t\tif (ctx.offset !== 0) return false;\n\n\t\tif (ctx.child) {\n\t\t\tif (ctx.childIndex !== 0) return false;\n\t\t\tconst location: ListItemLocation | undefined = locateListItem(ctx.state, ctx.item.id);\n\t\t\tif (!location) return false;\n\t\t\tconst builder = ctx.state.transaction('input');\n\t\t\tdissolveListItem(builder, location);\n\t\t\tbuilder.setSelection(ctx.state.selection);\n\t\t\tcontext.dispatch(builder.build());\n\t\t\treturn true;\n\t\t}\n\n\t\tconst tr = ctx.state\n\t\t\t.transaction('input')\n\t\t\t.setBlockType(ctx.blockId, nodeType('paragraph'))\n\t\t\t.setSelection(ctx.state.selection)\n\t\t\t.build();\n\t\tcontext.dispatch(tr);\n\t\treturn true;\n\t});\n}\n","/**\n * Locale interface and default English locale for the ListPlugin.\n */\n\nimport { type LocaleModuleMap, loadLocaleModule } from '../shared/LocaleLoader.js';\n\n// --- Locale Interface ---\n\nexport interface ListLocale {\n\treadonly bulletList: string;\n\treadonly numberedList: string;\n\treadonly checklist: string;\n\t/** Accessible name for the checklist item's checkbox marker (screen readers). */\n\treadonly checkboxLabel: string;\n\t/** Announced when a checklist item is toggled on. */\n\treadonly checkedAnnouncement: string;\n\t/** Announced when a checklist item is toggled off. */\n\treadonly uncheckedAnnouncement: string;\n}\n\n// --- Default English Locale ---\n\nexport const LIST_LOCALE_EN: ListLocale = {\n\tbulletList: 'Bullet List',\n\tnumberedList: 'Numbered List',\n\tchecklist: 'Checklist',\n\tcheckboxLabel: 'To-do item',\n\tcheckedAnnouncement: 'Checked',\n\tuncheckedAnnouncement: 'Unchecked',\n};\n\n// --- Lazy Locale Loader ---\n\nconst localeModules: LocaleModuleMap<ListLocale> = import.meta.glob<{\n\tdefault: ListLocale;\n}>('./locales/*.ts', { eager: false });\n\nexport async function loadListLocale(lang: string): Promise<ListLocale> {\n\treturn loadLocaleModule(localeModules, lang, LIST_LOCALE_EN);\n}\n","/**\n * Accessible checkbox marker for checklist items.\n *\n * The marker is a real `role=\"checkbox\"` element so assistive technology can\n * announce the item's checked state (WCAG 4.1.2 Name, Role, Value). It is\n * rendered `contenteditable=\"false\"` and flagged `data-widget` so the selection\n * layer treats it as zero-width view chrome, never as document content or a caret\n * position. The visible checkbox glyph is drawn in CSS.\n */\n\n/** CSS class identifying the checklist checkbox marker element. */\nexport const CHECKLIST_MARKER_CLASS = 'notectl-checklist-marker';\n\n/** Creates the accessible checkbox marker for a checklist item. */\nexport function createChecklistMarker(checked: boolean, label: string): HTMLElement {\n\tconst marker: HTMLElement = document.createElement('span');\n\tmarker.className = CHECKLIST_MARKER_CLASS;\n\tmarker.setAttribute('role', 'checkbox');\n\tmarker.setAttribute('aria-checked', String(checked));\n\tmarker.setAttribute('aria-label', label);\n\tmarker.setAttribute('contenteditable', 'false');\n\tmarker.setAttribute('data-widget', 'true');\n\treturn marker;\n}\n","/**\n * Toolbar item registration for list block types.\n * Registers bullet, ordered, and checklist toolbar buttons with active-state detection.\n */\n\nimport { isTextSelection, selectionRange } from '../../model/Selection.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { PluginContext } from '../Plugin.js';\nimport { allBlocksMatchListType } from './ListCommands.js';\nimport type { ListTypeDefinition } from './ListDefinitions.js';\nimport { resolveListItem } from './ListItemContext.js';\nimport type { ListLocale } from './ListLocale.js';\nimport type { ListType } from './ListPlugin.js';\n\n/** Registers toolbar items for each enabled list type. */\nexport function registerListToolbarItems(\n\tcontext: PluginContext,\n\tenabledTypes: readonly ListTypeDefinition[],\n\tlocale: ListLocale,\n): void {\n\tfor (const def of enabledTypes) {\n\t\tcontext.registerToolbarItem({\n\t\t\tid: `list-${def.type}`,\n\t\t\tgroup: 'block',\n\t\t\ticon: def.icon,\n\t\t\tlabel: getListLabel(def.type, locale),\n\t\t\tcommand: `toggleList:${def.type}`,\n\t\t\tisActive: (state) => isListActive(state, def.type),\n\t\t});\n\t}\n}\n\n// --- Helpers ---\n\nfunction getListLabel(type: ListType, locale: ListLocale): string {\n\tconst labels: Record<ListType, string> = {\n\t\tbullet: locale.bulletList,\n\t\tordered: locale.numberedList,\n\t\tchecklist: locale.checklist,\n\t};\n\treturn labels[type];\n}\n\nfunction isListActive(state: EditorState, listType: ListType): boolean {\n\tif (!isTextSelection(state.selection)) return false;\n\n\tif (state.selection.anchor.blockId !== state.selection.head.blockId) {\n\t\tconst range = selectionRange(state.selection, state.getBlockOrder());\n\t\treturn allBlocksMatchListType(state, range, listType);\n\t}\n\n\t// Children of container items resolve to their owning item (#194).\n\tconst block = resolveListItem(state, state.selection.anchor.blockId);\n\treturn block?.type === 'list_item' && block.attrs?.listType === listType;\n}\n","/**\n * ListPlugin: registers ordered, unordered, and checklist block types\n * with NodeSpecs, toggle commands, indent/outdent (Tab/Shift-Tab),\n * input rules, and toolbar buttons.\n *\n * This file is a thin orchestrator — command logic, input rules, keyboard\n * handlers, and toolbar rendering are delegated to dedicated modules.\n *\n * Sibling structure is modeled flat: every item carries a `listType` and an\n * `indent` attribute, so nesting between items needs no deep tree. Item\n * content is hybrid (#194): a single-paragraph item is a leaf with inline\n * children, while a multi-block item (second paragraph, code block, quote,\n * heading) is a container whose children are blocks.\n */\n\nimport { DecorationSet, type WidgetDecoration, widget } from '../../decorations/Decoration.js';\nimport { LIST_CSS, LIST_MARKER_WIDTH } from '../../editor/styles/list.js';\nimport { isNodeOfType } from '../../model/AttrRegistry.js';\nimport { blockId } from '../../model/TypeBrands.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport { setStyleProperty } from '../../style/StyleRuntime.js';\nimport { createBlockElement } from '../../view/DomUtils.js';\nimport type { Plugin, PluginContext } from '../Plugin.js';\nimport { resolveLocale } from '../shared/PluginHelpers.js';\nimport { registerListCommands, toggleChecked } from './ListCommands.js';\nimport { LIST_TYPE_DEFINITIONS, type ListTypeDefinition } from './ListDefinitions.js';\nimport { registerListInputRules } from './ListInputRules.js';\nimport { registerListKeymaps } from './ListKeyboardHandlers.js';\nimport { LIST_LOCALE_EN, type ListLocale, loadListLocale } from './ListLocale.js';\nimport { CHECKLIST_MARKER_CLASS, createChecklistMarker } from './ListMarker.js';\nimport { registerListToolbarItems } from './ListToolbarItems.js';\n\n// --- Attribute Registry Augmentation ---\n\nexport type ListType = 'bullet' | 'ordered' | 'checklist';\n\ndeclare module '../../model/AttrRegistry.js' {\n\tinterface NodeAttrRegistry {\n\t\tlist_item: { listType: ListType; indent: number; checked: boolean };\n\t}\n}\n\n// --- Configuration ---\n\nexport interface ListConfig {\n\t/** Which list types to enable. Defaults to all. */\n\treadonly types: readonly ListType[];\n\t/** Maximum indent depth. Defaults to 4. */\n\treadonly maxIndent: number;\n\t/** Live Markdown shortcuts: `- `/`* ` (bullet), `1. ` (ordered), `[ ] ` (checklist). Default true. */\n\treadonly inputRule?: boolean;\n\t/**\n\t * When true, checklist checkboxes remain interactive even in read-only mode.\n\t * Defaults to false (checkboxes are fully read-only).\n\t */\n\treadonly interactiveCheckboxes?: boolean;\n\treadonly locale?: ListLocale;\n}\n\nconst DEFAULT_CONFIG: ListConfig = {\n\ttypes: ['bullet', 'ordered', 'checklist'],\n\tmaxIndent: 4,\n};\n\n// --- Plugin ---\n\nexport class ListPlugin implements Plugin {\n\treadonly id = 'list';\n\treadonly name = 'List';\n\treadonly priority = 35;\n\n\tprivate readonly config: ListConfig;\n\tprivate locale!: ListLocale;\n\tprivate context: PluginContext | null = null;\n\tprivate checkboxMouseDownHandler: ((e: MouseEvent) => void) | null = null;\n\tprivate checkboxClickHandler: ((e: MouseEvent) => void) | null = null;\n\n\tconstructor(config?: Partial<ListConfig>) {\n\t\tthis.config = { ...DEFAULT_CONFIG, ...config };\n\t}\n\n\tasync init(context: PluginContext): Promise<void> {\n\t\tthis.context = context;\n\t\tthis.locale = await resolveLocale(context, this.config.locale, LIST_LOCALE_EN, loadListLocale);\n\t\tconst enabledTypes = this.getEnabledTypes();\n\n\t\tcontext.registerStyleSheet(LIST_CSS);\n\t\tthis.registerNodeSpec(context);\n\t\tregisterListCommands(context, this.config, enabledTypes, this.locale);\n\t\tregisterListKeymaps(context);\n\t\tif (this.config.inputRule !== false) registerListInputRules(context, enabledTypes);\n\t\tregisterListToolbarItems(context, enabledTypes, this.locale);\n\t\tthis.registerCheckboxHandlers(context);\n\t}\n\n\t/**\n\t * Leaf content rendering replaces a NodeSpec element's children, so the\n\t * checklist marker is declared as zero-width view chrome at offset zero.\n\t * Container list items retain the marker created by `toDOM`; only leaf IDs\n\t * occur in `getBlockOrder()` and therefore receive this decoration.\n\t */\n\tdecorations(state: EditorState): DecorationSet {\n\t\tconst markers: WidgetDecoration[] = [];\n\t\tfor (const id of state.getBlockOrder()) {\n\t\t\tconst block = state.getBlock(id);\n\t\t\tif (!block || !isNodeOfType(block, 'list_item') || block.attrs.listType !== 'checklist') {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst checked = block.attrs.checked;\n\t\t\tmarkers.push(\n\t\t\t\twidget(id, 0, () => createChecklistMarker(checked, this.locale.checkboxLabel), {\n\t\t\t\t\tkey: `checklist-marker:${checked}`,\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t\treturn DecorationSet.create(markers);\n\t}\n\n\tdestroy(): void {\n\t\tif (this.context) {\n\t\t\tconst container: HTMLElement = this.context.getContainer();\n\t\t\tif (this.checkboxMouseDownHandler) {\n\t\t\t\tcontainer.removeEventListener('mousedown', this.checkboxMouseDownHandler);\n\t\t\t}\n\t\t\tif (this.checkboxClickHandler) {\n\t\t\t\tcontainer.removeEventListener('click', this.checkboxClickHandler);\n\t\t\t}\n\t\t}\n\t\tthis.checkboxMouseDownHandler = null;\n\t\tthis.checkboxClickHandler = null;\n\t\tthis.context = null;\n\t}\n\n\tprivate registerNodeSpec(context: PluginContext): void {\n\t\tconst checkboxLabel: string = this.locale.checkboxLabel;\n\n\t\tcontext.registerNodeSpec({\n\t\t\ttype: 'list_item',\n\t\t\tgroup: 'block',\n\t\t\t// Hybrid content model (#194): the common single-paragraph item is a\n\t\t\t// leaf (inline text children); multi-block items are containers with\n\t\t\t// block children. Sibling nesting stays flat-with-indent, so list_item\n\t\t\t// itself is deliberately not an allowed child.\n\t\t\tcontent: {\n\t\t\t\tallow: ['text', 'paragraph', 'heading', 'code_block', 'blockquote', 'horizontal_rule'],\n\t\t\t},\n\t\t\tattrs: {\n\t\t\t\tlistType: { default: 'bullet' },\n\t\t\t\tindent: { default: 0 },\n\t\t\t\tchecked: { default: false },\n\t\t\t},\n\t\t\ttoDOM(node) {\n\t\t\t\tconst listType = node.attrs?.listType ?? 'bullet';\n\t\t\t\tconst indent = node.attrs?.indent ?? 0;\n\t\t\t\tconst checked = node.attrs?.checked ?? false;\n\n\t\t\t\tconst li = createBlockElement('li', node.id);\n\t\t\t\tli.setAttribute('role', 'listitem');\n\t\t\t\tli.setAttribute('data-list-type', listType);\n\t\t\t\tli.setAttribute('data-indent', String(indent));\n\t\t\t\tli.className = `notectl-list-item notectl-list-item--${listType}`;\n\n\t\t\t\tif (indent > 0) {\n\t\t\t\t\tsetStyleProperty(li, 'marginLeft', `${indent * LIST_MARKER_WIDTH}px`);\n\t\t\t\t}\n\n\t\t\t\tif (listType === 'checklist') {\n\t\t\t\t\t// `data-checked` drives the CSS glyph; the checked state is exposed to\n\t\t\t\t\t// assistive technology via the marker's own role=\"checkbox\", not via an\n\t\t\t\t\t// (invalid) aria-checked on the listitem. The marker is the first child\n\t\t\t\t\t// so reconciled inline content is appended after it.\n\t\t\t\t\tli.setAttribute('data-checked', String(checked));\n\t\t\t\t\tli.appendChild(createChecklistMarker(checked, checkboxLabel));\n\t\t\t\t}\n\t\t\t\tli.setAttribute('aria-level', String(indent + 1));\n\n\t\t\t\treturn li;\n\t\t\t},\n\t\t\twrapper(node) {\n\t\t\t\tconst listType = node.attrs?.listType ?? 'bullet';\n\t\t\t\tconst tag = listType === 'ordered' ? 'ol' : 'ul';\n\t\t\t\treturn {\n\t\t\t\t\ttag,\n\t\t\t\t\tkey: `list-${listType}`,\n\t\t\t\t\tclassName: `notectl-list notectl-list--${listType}`,\n\t\t\t\t\tattrs: { role: 'list' },\n\t\t\t\t};\n\t\t\t},\n\t\t\ttoHTML(node, content) {\n\t\t\t\tconst listType: string = (node.attrs?.listType as string) ?? 'bullet';\n\t\t\t\tconst checked: boolean = (node.attrs?.checked as boolean) ?? false;\n\n\t\t\t\tif (listType === 'checklist') {\n\t\t\t\t\tconst checkedAttr: string = checked ? ' checked' : '';\n\t\t\t\t\tconst ariaChecked: string = String(checked);\n\t\t\t\t\treturn (\n\t\t\t\t\t\t`<li role=\"checkbox\" aria-checked=\"${ariaChecked}\">` +\n\t\t\t\t\t\t`<input type=\"checkbox\" disabled${checkedAttr}>` +\n\t\t\t\t\t\t`${content || '<br>'}</li>`\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn `<li>${content || '<br>'}</li>`;\n\t\t\t},\n\t\t\tparseHTML: [{ tag: 'li' }],\n\t\t\tsanitize: {\n\t\t\t\ttags: ['ul', 'ol', 'li', 'input'],\n\t\t\t\tattrs: ['type', 'disabled', 'checked', 'role', 'aria-checked'],\n\t\t\t},\n\t\t});\n\t}\n\n\tprivate registerCheckboxHandlers(context: PluginContext): void {\n\t\tif (!this.config.types.includes('checklist')) return;\n\n\t\tconst findChecklistItem = (target: EventTarget | null): Element | null => {\n\t\t\tif (!(target instanceof HTMLElement)) return null;\n\t\t\tconst marker: Element | null = target.closest(`.${CHECKLIST_MARKER_CLASS}`);\n\t\t\tif (!marker) return null;\n\t\t\treturn marker.closest('.notectl-list-item--checklist');\n\t\t};\n\n\t\tthis.checkboxMouseDownHandler = (e: MouseEvent) => {\n\t\t\tif (context.isReadOnly() && !this.config.interactiveCheckboxes) return;\n\t\t\tif (!findChecklistItem(e.target)) return;\n\t\t\te.preventDefault();\n\t\t};\n\n\t\tthis.checkboxClickHandler = (e: MouseEvent) => {\n\t\t\tif (context.isReadOnly() && !this.config.interactiveCheckboxes) return;\n\t\t\tconst li: Element | null = findChecklistItem(e.target);\n\t\t\tif (!li) return;\n\n\t\t\te.preventDefault();\n\n\t\t\tconst bid: string | null = li.getAttribute('data-block-id');\n\t\t\tif (!bid) return;\n\n\t\t\ttoggleChecked(context, {\n\t\t\t\tinteractiveCheckboxes: this.config.interactiveCheckboxes,\n\t\t\t\ttargetId: blockId(bid),\n\t\t\t\tlocale: this.locale,\n\t\t\t});\n\t\t};\n\n\t\tconst container: HTMLElement = context.getContainer();\n\t\tcontainer.addEventListener('mousedown', this.checkboxMouseDownHandler);\n\t\tcontainer.addEventListener('click', this.checkboxClickHandler);\n\t}\n\n\tprivate getEnabledTypes(): readonly ListTypeDefinition[] {\n\t\treturn LIST_TYPE_DEFINITIONS.filter((def) => this.config.types.includes(def.type));\n\t}\n}\n"],"mappings":"kiBCSA,SAAgB,EACf,EACA,EACA,GAEA,MAAiB,cAAb,EACI,CAAE,WAAU,SAAQ,QAAS,IAAW,GAEzC,CAAE,WAAU,SACpB,CCWA,SAAgB,EAAgB,EAAoB,GACnD,MAAM,EAA+B,EAAM,SAAS,GACpD,GAAoB,cAAhB,GAAO,KAAsB,OAAO,EACxC,MAAM,EAAuC,EAAM,YAAY,GAC/D,GAAK,EACL,IAAK,IAAI,EAAI,EAAK,OAAS,EAAG,GAA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EAAkB,EAAE,QAC/C,IAAK,EAAI,OAET,EAAE,iBAEF,MAAM,EAAqB,EAAG,aAAa,iBACtC,GAEL,EAAc,EAAS,CACtB,sBAAuB,KAAK,OAAO,sBACnC,SAAU,EAAQ,GAClB,OAAQ,KAAK,UAIf,MAAM,EAAyB,EAAQ,eACvC,EAAU,iBAAiB,YAAa,KAAK,0BAC7C,EAAU,iBAAiB,QAAS,KAAK,qBAC1C,CAEA,eAAA,GACC,OAAO,EAAsB,OAAQ,GAAQ,KAAK,OAAO,MAAM,SAAS,EAAI,MAC7E"}
@@ -1,2 +0,0 @@
1
- import{I as e,P as n,V as t,k as r}from"./Document-D_2cIBJG.mjs";import{c as o,f as s,p as i}from"./Selection-DC6AOGgF.mjs";import{i as c}from"./TypeBrands-Ch9856Gb.mjs";import{n as a}from"./CursorMarks-dx51OGBf.mjs";import{n as l}from"./RangeIterator-DDOxTQIf.mjs";function u(){return{nodeTypes:["paragraph"],markTypes:["bold","italic","underline"],getNodeSpec:()=>{}}}function f(e){return{nodeTypes:e.getNodeTypes(),markTypes:e.getMarkTypes(),getNodeSpec:n=>e.getNodeSpec(n),getInlineNodeSpec:n=>e.getInlineNodeSpec(n),getMarkSpec:n=>e.getMarkSpec(n)}}function d(e,n){return e.markTypes.includes(n)}function m(e,n){return e.nodeTypes.includes(n)}var p={bold:!0,italic:!0,underline:!0};function k(n,t,r=p){if(function(e,n){const t=e;return"bold"===t?!n.bold:"italic"===t?!n.italic:"underline"===t&&!n.underline}(t,r))return null;if(!d(n.schema,t))return null;if(!s(n.selection))return null;const c={type:t},u=n.selection;if(o(u)){if(!n.getBlock(u.anchor.blockId))return null;const r=a(n),o=e(r,t)?r.filter(e=>e.type!==t):[...r,c];return n.transaction("command").setStoredMarks(o,n.storedMarks).setSelection(u).build()}const f=i(u,n.getBlockOrder()),m=n.transaction("command"),k=T(n,t);return l(n,f,(e,n,t)=>{k?m.removeMark(e,n,t,c):m.addMark(e,n,t,c)}),m.setSelection(u),m.build()}function g(e,n){return k(e,c("bold"),n)}function y(e,n){return k(e,c("italic"),n)}function S(e,n){return k(e,c("underline"),n)}function b(n,t){const r=n.selection;return!!s(r)&&(o(r)?e(a(n),t):T(n,t))}function T(e,n){const t=e.selection;if(!s(t))return!1;const o=e.getBlockOrder(),c=i(t,o),a=o.indexOf(c.from.blockId),l=o.indexOf(c.to.blockId);let u=!1;for(let s=a;s<=l;s++){const t=o[s];if(!t)continue;const i=e.getBlock(t);if(!i)continue;const f=r(i),d=M(i,s===a?c.from.offset:0,s===l?c.to.offset:f,n);if("missing"===d)return!1;"present"===d&&(u=!0)}return u}function M(r,o,s,i){let c=0,a=!1;for(const l of n(r))if(t(l)){const n=c+l.text.length;if(n>o&&c<s&&(a=!0,!e(l.marks,i)))return"missing";c=n}else c+=1;return a?"present":"empty"}export{S as a,m as c,k as i,f as l,g as n,u as o,y as r,d as s,b as t};
2
- //# sourceMappingURL=MarkCommands-CJvLGL5G.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MarkCommands-CJvLGL5G.mjs","names":[],"sources":["../../src/model/Schema.ts","../../src/commands/MarkCommands.ts"],"sourcesContent":["/**\n * Schema definition for the Notectl editor.\n * Defines which node types and marks are allowed.\n */\n\nimport type { InlineNodeSpec } from './InlineNodeSpec.js';\nimport type { MarkSpec } from './MarkSpec.js';\nimport type { NodeSpec } from './NodeSpec.js';\nimport type { SchemaRegistry } from './SchemaRegistry.js';\n\nexport interface Schema {\n\treadonly nodeTypes: readonly string[];\n\treadonly markTypes: readonly string[];\n\t/** Looks up the full NodeSpec for a given type. Available when created via schemaFromRegistry. */\n\treadonly getNodeSpec?: (type: string) => NodeSpec | undefined;\n\t/** Looks up the full InlineNodeSpec for a given type. Available via schemaFromRegistry. */\n\treadonly getInlineNodeSpec?: (type: string) => InlineNodeSpec | undefined;\n\t/** Looks up the full MarkSpec for a given type. Available via schemaFromRegistry. */\n\treadonly getMarkSpec?: (type: string) => MarkSpec | undefined;\n}\n\n/** Creates the default schema with paragraph nodes and bold/italic/underline marks. */\nexport function defaultSchema(): Schema {\n\treturn {\n\t\tnodeTypes: ['paragraph'],\n\t\tmarkTypes: ['bold', 'italic', 'underline'],\n\t\tgetNodeSpec: () => undefined,\n\t};\n}\n\n/** Derives a Schema from a SchemaRegistry's registered specs. */\nexport function schemaFromRegistry(registry: SchemaRegistry): Schema {\n\treturn {\n\t\tnodeTypes: registry.getNodeTypes(),\n\t\tmarkTypes: registry.getMarkTypes(),\n\t\tgetNodeSpec: (type: string) => registry.getNodeSpec(type),\n\t\tgetInlineNodeSpec: (type: string) => registry.getInlineNodeSpec(type),\n\t\tgetMarkSpec: (type: string) => registry.getMarkSpec(type),\n\t};\n}\n\n/** Checks whether the given mark type is allowed by the schema. */\nexport function isMarkAllowed(schema: Schema, markType: string): boolean {\n\treturn schema.markTypes.includes(markType);\n}\n\n/** Checks whether the given node type is allowed by the schema. */\nexport function isNodeTypeAllowed(schema: Schema, nodeType: string): boolean {\n\treturn schema.nodeTypes.includes(nodeType);\n}\n","/**\n * Mark-related commands: toggling bold/italic/underline and checking\n * whether a mark is active.\n */\n\nimport {\n\ttype BlockNode,\n\ttype Mark,\n\tgetBlockLength,\n\tgetInlineChildren,\n\thasMark,\n\tisTextNode,\n} from '../model/Document.js';\nimport { isMarkAllowed } from '../model/Schema.js';\nimport { isCollapsed, isTextSelection, selectionRange } from '../model/Selection.js';\nimport type { MarkTypeName } from '../model/TypeBrands.js';\nimport { markType as mkType } from '../model/TypeBrands.js';\nimport type { EditorState } from '../state/EditorState.js';\nimport type { Transaction } from '../state/Transaction.js';\nimport { resolveCursorMarks } from './CursorMarks.js';\nimport { forEachBlockInRange } from './RangeIterator.js';\n\n// --- Feature Configuration ---\n\nexport interface FeatureConfig {\n\treadonly bold: boolean;\n\treadonly italic: boolean;\n\treadonly underline: boolean;\n}\n\nconst defaultFeatures: FeatureConfig = { bold: true, italic: true, underline: true };\n\n/**\n * Toggles a mark on the current selection.\n * If collapsed, toggles stored marks. If range, applies/removes from text.\n */\nexport function toggleMark(\n\tstate: EditorState,\n\tmarkType: MarkTypeName,\n\tfeatures: FeatureConfig = defaultFeatures,\n): Transaction | null {\n\tif (isFeatureGated(markType, features)) return null;\n\tif (!isMarkAllowed(state.schema, markType)) return null;\n\tif (!isTextSelection(state.selection)) return null;\n\n\tconst mark: Mark = { type: markType };\n\tconst sel = state.selection;\n\n\tif (isCollapsed(sel)) {\n\t\t// Toggle stored marks\n\t\tconst anchorBlock = state.getBlock(sel.anchor.blockId);\n\t\tif (!anchorBlock) return null;\n\t\tconst currentMarks = resolveCursorMarks(state);\n\t\tconst hasIt = hasMark(currentMarks, markType);\n\t\tconst newMarks = hasIt\n\t\t\t? currentMarks.filter((m) => m.type !== markType)\n\t\t\t: [...currentMarks, mark];\n\n\t\treturn state\n\t\t\t.transaction('command')\n\t\t\t.setStoredMarks(newMarks, state.storedMarks)\n\t\t\t.setSelection(sel)\n\t\t\t.build();\n\t}\n\n\t// Range selection — apply/remove mark to all blocks in range\n\tconst range = selectionRange(sel, state.getBlockOrder());\n\tconst builder = state.transaction('command');\n\n\t// Determine if we should add or remove\n\tconst shouldRemove = isMarkActiveInRange(state, markType);\n\n\tforEachBlockInRange(state, range, (blockId, from, to) => {\n\t\tif (shouldRemove) {\n\t\t\tbuilder.removeMark(blockId, from, to, mark);\n\t\t} else {\n\t\t\tbuilder.addMark(blockId, from, to, mark);\n\t\t}\n\t});\n\n\tbuilder.setSelection(sel);\n\treturn builder.build();\n}\n\nexport function toggleBold(state: EditorState, features?: FeatureConfig): Transaction | null {\n\treturn toggleMark(state, mkType('bold'), features);\n}\n\nexport function toggleItalic(state: EditorState, features?: FeatureConfig): Transaction | null {\n\treturn toggleMark(state, mkType('italic'), features);\n}\n\nexport function toggleUnderline(state: EditorState, features?: FeatureConfig): Transaction | null {\n\treturn toggleMark(state, mkType('underline'), features);\n}\n\n/** Checks if a mark is active at the current selection. */\nexport function isMarkActive(state: EditorState, markType: MarkTypeName): boolean {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return false;\n\n\tif (isCollapsed(sel)) {\n\t\treturn hasMark(resolveCursorMarks(state), markType);\n\t}\n\n\treturn isMarkActiveInRange(state, markType);\n}\n\n/** Per-slice result of scanning a block for a mark. */\ntype SliceMarkStatus = 'present' | 'missing' | 'empty';\n\n/** Checks if a mark is active across the entire selection range. */\nfunction isMarkActiveInRange(state: EditorState, markType: MarkTypeName): boolean {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return false;\n\tconst blockOrder = state.getBlockOrder();\n\tconst range = selectionRange(sel, blockOrder);\n\n\tconst fromIdx = blockOrder.indexOf(range.from.blockId);\n\tconst toIdx = blockOrder.indexOf(range.to.blockId);\n\n\tlet sawMarkedText = false;\n\tfor (let i = fromIdx; i <= toIdx; i++) {\n\t\tconst blockId = blockOrder[i];\n\t\tif (!blockId) continue;\n\t\tconst block = state.getBlock(blockId);\n\t\tif (!block) continue;\n\t\tconst blockLen = getBlockLength(block);\n\t\tconst from = i === fromIdx ? range.from.offset : 0;\n\t\tconst to = i === toIdx ? range.to.offset : blockLen;\n\n\t\tconst status = markStatusInBlock(block, from, to, markType);\n\t\tif (status === 'missing') return false;\n\t\tif (status === 'present') sawMarkedText = true;\n\t}\n\n\t// Active only when the range actually contains text that carries the mark.\n\t// A range with no markable text (only empty blocks, or a void block such as a\n\t// lone display formula on Ctrl+A) is NOT active — returning true there would\n\t// light up every toolbar format button.\n\treturn sawMarkedText;\n}\n\n/**\n * Scans a block's `[from, to)` slice for `markType`. Returns:\n * - `missing` when some text character in the slice lacks the mark,\n * - `present` when the slice has text and all of it carries the mark,\n * - `empty` when the slice has no markable text (empty slice or only InlineNodes).\n *\n * An `empty` slice is neutral: it neither activates nor inverts the range check,\n * so an empty paragraph in the middle of a multi-block selection does not flip\n * the result (regression #130).\n */\nfunction markStatusInBlock(\n\tblock: BlockNode,\n\tfrom: number,\n\tto: number,\n\tmarkType: MarkTypeName,\n): SliceMarkStatus {\n\tlet pos = 0;\n\tlet sawText = false;\n\tfor (const child of getInlineChildren(block)) {\n\t\tif (isTextNode(child)) {\n\t\t\tconst childEnd = pos + child.text.length;\n\t\t\tif (childEnd > from && pos < to) {\n\t\t\t\tsawText = true;\n\t\t\t\tif (!hasMark(child.marks, markType)) return 'missing';\n\t\t\t}\n\t\t\tpos = childEnd;\n\t\t} else {\n\t\t\t// InlineNode: atomic, width 1, carries no marks.\n\t\t\tpos += 1;\n\t\t}\n\t}\n\treturn sawText ? 'present' : 'empty';\n}\n\nfunction isFeatureGated(type: MarkTypeName, features: FeatureConfig): boolean {\n\tconst key = type as string;\n\tif (key === 'bold') return !features.bold;\n\tif (key === 'italic') return !features.italic;\n\tif (key === 'underline') return !features.underline;\n\treturn false;\n}\n"],"mappings":"0QAsBA,SAAgB,IACf,MAAO,CACN,UAAW,CAAC,aACZ,UAAW,CAAC,OAAQ,SAAU,aAC9B,YAAA,OAEF,CAGA,SAAgB,EAAmB,GAClC,MAAO,CACN,UAAW,EAAS,eACpB,UAAW,EAAS,eACpB,YAAc,GAAiB,EAAS,YAAY,GACpD,kBAAoB,GAAiB,EAAS,kBAAkB,GAChE,YAAc,GAAiB,EAAS,YAAY,GAEtD,CAGA,SAAgB,EAAc,EAAgB,GAC7C,OAAO,EAAO,UAAU,SAAS,EAClC,CAGA,SAAgB,EAAkB,EAAgB,GACjD,OAAO,EAAO,UAAU,SAAS,EAClC,CCnBA,IAAM,EAAiC,CAAE,MAAM,EAAM,QAAQ,EAAM,WAAW,GAM9E,SAAgB,EACf,EACA,EACA,EAA0B,GAE1B,GAwID,SAAwB,EAAoB,GAC3C,MAAM,EAAM,EACZ,MAAY,SAAR,GAAwB,EAAS,KACzB,WAAR,GAA0B,EAAS,OAC3B,cAAR,IAA6B,EAAS,SAE3C,CA9IK,CAAe,EAAU,GAAW,OAAO,KAC/C,IAAK,EAAc,EAAM,OAAQ,GAAW,OAAO,KACnD,IAAK,EAAgB,EAAM,WAAY,OAAO,KAE9C,MAAM,EAA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EAAM,SAAS,GAC7B,IAAK,EAAO,SACZ,MAAM,EAAW,EAAe,GAI1B,EAAS,EAAkB,EAHpB,IAAM,EAAU,EAAM,KAAK,OAAS,EACtC,IAAM,EAAQ,EAAM,GAAG,OAAS,EAEO,GAClD,GAAe,YAAX,EAAsB,OAAO,EAClB,YAAX,IAAsB,GAAgB,EAC3C,CAMA,OAAO,CACR,CAYA,SAAS,EACR,EACA,EACA,EACA,GAEA,IAAI,EAAM,EACN,GAAU,EACd,IAAK,MAAM,KAAS,EAAkB,GACrC,GAAI,EAAW,GAAQ,CACtB,MAAM,EAAW,EAAM,EAAM,KAAK,OAClC,GAAI,EAAW,GAAQ,EAAM,IAC5B,GAAU,GACL,EAAQ,EAAM,MAAO,IAAW,MAAO,UAE7C,EAAM,CACP,MAEC,GAAO,EAGT,OAAO,EAAU,UAAY,OAC9B"}
@@ -1,2 +0,0 @@
1
- import{n as t,s as e}from"./HTMLUtils-B0nGyFLb.mjs";import{l as n,n as r,o as i,r as s}from"./TableDimensions-BcARMxQB.mjs";import{t as o}from"./SchemaRegistry-acc6q_5x.mjs";var a=/^\s*\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)*\|?\s*$/;function c(t){let e=t.trim();e.startsWith("|")&&(e=e.slice(1)),e.endsWith("|")&&!e.endsWith("\\|")&&(e=e.slice(0,-1));const n=[];let r="";for(let i=0;i<e.length;i++){const t=e[i]??"";"\\"!==t||"|"!==e[i+1]?"|"!==t?r+=t:(n.push(r.trim()),r=""):(r+="|",i++)}return n.push(r.trim()),n}function l(t){const e=t.trim(),n=e.startsWith(":"),r=e.endsWith(":");return n&&r?"center":r?"end":n?"start":null}function u(t,e,n){const r=t[e]??"",i=t[e+1]??"";if(!r.includes("|"))return null;if(!a.test(i))return null;const s=c(r),o=c(i).map(l);if(o.length!==s.length)return null;const u=[];let g=e+2;for(;g<t.length;){const e=t[g]??"";if(""===e.trim())break;if(!e.includes("|")&&(!n||n(e)))break;u.push(c(e)),g++}return{aligns:o,header:s,rows:u,linesConsumed:g-e}}var g=/[!-/:-@[-`{-~]/,h=/&(#[xX][0-9a-fA-F]{1,6}|#[0-9]{1,7}|[a-zA-Z][a-zA-Z0-9]{1,31});/y,f={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" ",copy:"©",reg:"®",hellip:"…",mdash:"—",ndash:"–"};function p(t){if("#"===t[0]){const e="x"===t[1]||"X"===t[1],n=Number.parseInt(t.slice(e?2:1),e?16:10);if(!Number.isFinite(n)||n<0||n>1114111)return`&${t};`;if(0===n)return"�";try{const t=String.fromCodePoint(n);return"\n"===t||"\r"===t?" ":t}catch{return"�"}}return f[t]??function(t){if("undefined"==typeof document)return null;const e=m.get(t);if(void 0!==e)return e;const n=document.createElement("div");n.innerHTML=`&${t};`;const r=n.textContent??"",i=""!==r&&r!==`&${t};`?r:null;return m.set(t,i),i}(t)??`&${t};`}function d(t,e){return h.lastIndex=e,h.exec(t)}var m=/* @__PURE__ */new Map;function b(t){let e="",n=0;for(;n<t.length;){const r=t[n]??"";if("\\"===r&&g.test(t[n+1]??""))e+=t[n+1],n+=2;else{if("&"===r){const r=d(t,n);if(r?.[1]){e+=p(r[1]),n+=r[0].length;continue}}e+=r,n++}}return e}function $(t){let e="",n=0;for(;n<t.length;){const r=t[n]??"";if("&"===r){const r=d(t,n);if(r?.[1]){e+=p(r[1]),n+=r[0].length;continue}}e+=r,n++}return e}var y,k=/* @__PURE__ */new Set(["address","article","aside","blockquote","details","div","dl","dd","dt","figure","figcaption","footer","form","h1","h2","h3","h4","h5","h6","header","hr","iframe","main","nav","ol","p","pre","section","table","tbody","td","tfoot","th","thead","tr","ul","video"]),M=/^ {0,3}(#{1,6})(?:[ \t]+(.*?))?(?:[ \t]+#+)?[ \t]*$/,T=/^ {0,3}(`{3,}|~{3,})[ \t]*(.*)$/,S=/^ {0,3}([-*_])[ \t]*(?:\1[ \t]*){2,}$/,x=/^ {0,3}>[ ]?/,L=/^([ \t]*)([-*+])(?:([ \t]+)(.*))?$/,H=/^([ \t]*)(\d{1,9})([.)])(?:([ \t]+)(.*))?$/,w=/^\[([ xX])\][ \t]+(.*)$/,N=/^ {0,3}=+[ \t]*$/,z=/^ {0,3}-+[ \t]*$/,A=/^ {0,3}<(\/?)([a-zA-Z][a-zA-Z0-9-]*)|^ {0,3}<!--/;function v(t){return""===t.trim()}function D(t){const e=t.match(T);return e?"`"===(e[1]??"")[0]&&(e[2]??"").includes("`")?null:e:null}function O(t,e=!0,n=[]){return _(t.replace(/\r\n?/g,"\n").replace(/\n$/,"").split("\n"),e,n)}function _(t,e,n,r=0){const i=[];let s=0;for(;s<t.length;){const o=t[s]??"";if(v(o)){s++;continue}const a=P(n,t,s,i);if(a>0){s+=a;continue}if(e){const e=u(t,s,J);if(e){i.push({type:"table",aligns:e.aligns,header:e.header,rows:e.rows}),s+=e.linesConsumed;continue}}const c=D(o);if(c){s=C(t,s,c,i);continue}const l=o.match(M);if(l){const t=(l[2]??"").trim(),e=/^#+$/.test(t)?"":t;i.push({type:"heading",level:(l[1]??"#").length,text:e}),s++;continue}if(S.test(o)){i.push({type:"hr"}),s++;continue}if(x.test(o)){if(r>=32){s=K(t,s,i);continue}s=R(t,s,i,e,n,r);continue}const g=r<32?X(o):null;s=g?V(t,s,g,i,e,n,r):q(o)?I(t,s,i):U(o)?G(t,s,i):K(t,s,i)}return i}function C(t,e,n,r){const i=n[1]??"```",s=i[0]??"`",o=b((n[2]??"").trim().split(/\s+/)[0]??""),a=new RegExp(`^ {0,3}\\${s}{${i.length},}[ \\t]*$`),c=t[e]??"",l=c.length-c.trimStart().length,u=[];let g=e+1;for(;g<t.length;){const e=t[g]??"";if(a.test(e)){g++;break}u.push(j(e,l)),g++}return r.push({type:"code_block",language:o,code:u.join("\n")}),g}function j(t,e){let n=0;for(;n<e&&" "===t[n];)n++;return t.slice(n)}function q(t){return W(t)>=4}function W(t){let e=0;for(const n of t)if(" "===n)e++;else{if("\t"!==n)break;e+=4-e%4}return e}function E(t,e){let n=0,r=0;for(;r<t.length;){const e=t[r]??"";if(" "===e)n++;else{if("\t"!==e)break;n+=4-n%4}r++}return" ".repeat(Math.max(0,n-e))+t.slice(r)}function F(t,e){let n=0,r=0;for(;r<t.length&&n<e;){const i=t[r]??"";if(" "===i)n++,r++;else{if("\t"!==i)break;{const i=n+4-n%4;if(i>e)return" ".repeat(i-e)+t.slice(r+1);n=i,r++}}}return t.slice(r)}function I(t,e,n){const r=[],i=[];let s=e;for(;s<t.length;){const e=t[s]??"";if(v(e))i.push(F(e,4)),s++;else{if(W(e)<4)break;for(;i.length>0;)r.push(i.shift()??"");r.push(F(e,4)),s++}}return n.push({type:"code_block",language:"",code:r.join("\n")}),s-i.length}function P(t,e,n,r){for(const i of t){const t=i.matchBlock?.(e,n);if(t&&t.linesConsumed>0)return r.push({type:"extension_block",nodeType:t.type,attrs:t.attrs}),t.linesConsumed}return 0}function R(t,e,n,r,i,s){const o=[];let a=e,c=!1;for(;a<t.length;){const e=t[a]??"";if(x.test(e)){const t=e.replace(x,"");o.push(t),c=Z(t),a++;continue}if(!c||v(e)||J(e)||r&&u(t,a,J))break;o.push(e),a++}return n.push({type:"blockquote",children:_(o,r,i,s+1)}),a}function Z(t){let e=t;for(;;){if(x.test(e)){e=e.replace(x,"");continue}const t=X(e);if(!t||""===t.firstText)break;e=t.firstText}return""!==e.trim()&&!J(e)&&W(e)<4}function X(t){const e=t.match(L),n=e?null:t.match(H),r=e??n;if(!r)return null;const i=W(r[1]??"");if(i>3)return null;const s=i+((e?r[2]:`${r[2]}${r[3]}`)??"-").length,o=function(t,e){let n=t;for(const r of e)if(" "===r)n++;else{if("\t"!==r)break;n+=4-n%4}return n-t}(s,(e?r[3]:r[4])??""),a=(e?r[4]:r[5])??"",c=n?Number.parseInt(r[2]??"1",10):1;let l,u;""===a.trim()?(l=s+1,u=""):o>=5?(l=s+1,u=" ".repeat(o-1)+a):(l=s+o,u=a);const g=u.match(w);return g?{listType:"checklist",checked:"x"===(g[1]??" ").toLowerCase(),contentColumn:l,firstText:g[2]??"",startNumber:c}:{listType:n?"ordered":"bullet",checked:!1,contentColumn:l,firstText:u,startNumber:c}}function V(t,e,n,r,i,s,o){const a=[],c=function(){let t=null;return(e,n)=>{if(t)return t.test(e)&&(t=null),!1;const r=D(e);if(r){const e=r[1]??"```",n=e[0]??"`";return t=new RegExp(`^ {0,3}\\${n}{${e.length},}[ \\t]*$`),!1}return!v(e)&&(x.test(e)||X(e)?Z(e):W(e)>=4?n:!J(e))}}();let l=n.firstText,g=""!==l&&c(l,!1),h=0,f=e+1;for(;f<t.length;){const e=t[f]??"";if(v(e)){if(""===l&&0===a.length)break;h++,g=!1,f++;continue}if(W(e)>=n.contentColumn){for(;h>0;)a.push(""),h--;const t=E(e,n.contentColumn);a.push(t),g=c(t,g),f++;continue}if(X(e))break;if(!g)break;if(J(e))break;if(i&&u(t,f,J))break;const r=e.trimStart(),s=a[a.length-1];void 0!==s?a[a.length-1]=`${s}\n${r}`:l=""===l?r:`${l}\n${r}`,g=c(r,g),f++}return function(t,e,n,r,i,s,o){const a=""===e?[...n]:[e,...n],c=0===a.length?[]:_(a,i,s,o+1),l=[],u=[];for(const h of c)"list_item"===h.type?l.push({...h,indent:h.indent+1}):u.push(h);const g=u[0];1===u.length&&"paragraph"===g?.type?r.push(B(t,g.text)):0===u.length?r.push(B(t,"")):r.push(B(t,"",u)),r.push(...l)}(n,l,a,r,i,s,o),f}function B(t,e,n){const r={type:"list_item",listType:t.listType,indent:0,checked:t.checked,text:e};return n?{...r,children:n}:r}function U(t){const e=t.match(A);if(!e)return!1;if(t.trimStart().startsWith("\x3c!--"))return!0;const n=(e[2]??"").toLowerCase();return k.has(n)}function G(t,e,n){const r=[];let i=e;for(;i<t.length;){const e=t[i]??"";if(v(e))break;r.push(e),i++}return n.push({type:"html",html:r.join("\n")}),i}function J(t){return!!(v(t)||M.test(t)||D(t)||S.test(t)||x.test(t)||function(t){const e=X(t);return!!e&&""!==e.firstText.trim()&&("ordered"!==e.listType||1===e.startNumber)}(t)||U(t))}function K(t,e,n){const r=[t[e]??""];let i=e+1;for(;i<t.length;){const e=t[i]??"";if(N.test(e))return n.push({type:"heading",level:1,text:Y(r)}),i+1;if(z.test(e))return n.push({type:"heading",level:2,text:Y(r)}),i+1;if(J(e))break;r.push(e),i++}return n.push({type:"paragraph",text:Q(r)}),i}function Q(t){return t.map((e,n)=>n===t.length-1?e.trim():e.trimStart()).join("\n")}function Y(t){return t.map(t=>t.trim()).join(" ").trim()}function tt(a){return a||(y??=function(){const a=new o;return function(e){e.registerNodeSpec({type:"paragraph",toDOM:et,toHTML:(t,e)=>`<p>${e||"<br>"}</p>`,parseHTML:[{tag:"p"},{tag:"div",priority:10}],sanitize:{tags:["p"]}}),e.registerNodeSpec({type:"heading",toDOM:et,toHTML(t,e){const n=t.attrs?.level,r="number"==typeof n&&Number.isFinite(n)?Math.max(1,Math.min(6,Math.floor(n))):1;return`<h${r}>${e||"<br>"}</h${r}>`},parseHTML:[1,2,3,4,5,6].map(t=>({tag:`h${t}`,getAttrs:()=>({level:t})})),sanitize:{tags:["h1","h2","h3","h4","h5","h6"]}}),e.registerNodeSpec({type:"list_item",toDOM:et,toHTML(t,e){if("checklist"!==t.attrs?.listType)return`<li>${e||"<br>"}</li>`;const n=!0===t.attrs.checked;return`<li role="checkbox" aria-checked="${String(n)}"><input type="checkbox" disabled${n?" checked":""}>${e||"<br>"}</li>`},parseHTML:[{tag:"li"}],sanitize:{tags:["ul","ol","li","input"],attrs:["type","disabled","checked","role","aria-checked"]}}),e.registerNodeSpec({type:"blockquote",toDOM:et,toHTML:(t,e)=>`<blockquote>${e||"<br>"}</blockquote>`,parseHTML:[{tag:"blockquote"}],sanitize:{tags:["blockquote"]}}),e.registerNodeSpec({type:"code_block",toDOM:et,toHTML(e,n){const r=String(e.attrs?.language??"");return`<pre><code${r?` class="language-${t(r)}"`:""}>${n}</code></pre>`},parseHTML:[{tag:"pre",getAttrs:t=>({language:t.querySelector("code")?.className.match(/(?:^|\s)language-(\S+)/)?.[1]??""})}],sanitize:{tags:["pre","code"],attrs:["class"]}}),e.registerNodeSpec({type:"horizontal_rule",isVoid:!0,toDOM:et,toHTML:()=>"<hr>",parseHTML:[{tag:"hr"}],sanitize:{tags:["hr"]}}),e.registerNodeSpec({type:"image",isVoid:!0,attrs:{src:{default:""},alt:{default:""},title:{default:""},align:{default:"center"}},toDOM:et,toHTML(e){const n=t(String(e.attrs?.src??"")),r=t(String(e.attrs?.alt??"")),i=String(e.attrs?.title??""),s=(t,e)=>"number"==typeof e&&Number.isFinite(e)&&e>0?` ${t}="${String(e)}"`:"";return`<figure><img src="${n}" alt="${r}"${i?` title="${t(i)}"`:""}${s("width",e.attrs?.width)}${s("height",e.attrs?.height)}></figure>`},parseHTML:[{tag:"figure",getAttrs(t){const e=t.querySelector("img");return!!e&&nt(e)}},{tag:"img",getAttrs:t=>nt(t)}],sanitize:{tags:["figure","img"],attrs:["src","alt","title","width","height"]}}),e.registerNodeSpec({type:"table",toDOM:et,toHTML(t,e,s){const o=i(t.attrs?.columnWidthsPx),a=o?`<colgroup>${o.map(t=>`<col${n(r,"width",t,s)}>`).join("")}</colgroup>`:"";return`<table${o?function(t,e){const n=t.reduce((t,e)=>t+(e??60),0),r=t.every(t=>null!==t)?`width: ${String(n)}px; min-width: ${String(n)}px; table-layout: fixed`:`width: 100%; min-width: ${String(n)}px; table-layout: fixed`;return e?.styleAttr(r)??` style="${r}"`}(o,s):""}>${a}<tbody>${e}</tbody></table>`},sanitize:{tags:["table","colgroup","col","thead","tbody","tfoot"],attrs:["span","width",r]}}),e.registerNodeSpec({type:"table_row",toDOM:et,toHTML:(t,e,r)=>`<tr${n(s,"height",t.attrs?.minHeightPx,r)}>${e}</tr>`,sanitize:{tags:["tr"],attrs:["height",s]}}),e.registerNodeSpec({type:"table_cell",toDOM:et,toHTML(t,e){const n=(t,e)=>"number"==typeof e&&Number.isInteger(e)&&e>1?` ${t}="${String(e)}"`:"";return`<td${n("colspan",t.attrs?.colspan)}${n("rowspan",t.attrs?.rowspan)}>${e}</td>`},sanitize:{tags:["td","th"],attrs:["colspan","rowspan"]}})}(a),function(n){for(const t of[{type:"bold",rank:0,tag:"strong",parseTags:["strong","b"]},{type:"italic",rank:1,tag:"em",parseTags:["em","i"]},{type:"underline",rank:2,tag:"u",parseTags:["u"]},{type:"code",rank:3,tag:"code",parseTags:["code"]},{type:"strikethrough",rank:4,tag:"s",parseTags:["s","strike","del"]}])n.registerMarkSpec({type:t.type,rank:t.rank,toDOM:et,toHTMLString:(e,n)=>`<${t.tag}>${n}</${t.tag}>`,parseHTML:t.parseTags.map(t=>({tag:t,getAttrs:"code"===t?t=>"PRE"!==t.parentElement?.tagName&&{}:void 0})),sanitize:{tags:t.parseTags}});n.registerMarkSpec({type:"link",rank:10,toDOM:et,toHTMLString(n,r){const i=t(e(String(n.attrs?.href??""))),s=String(n.attrs?.title??"");return`<a href="${i}"${s?` title="${t(s)}"`:""}>${r}</a>`},parseHTML:[{tag:"a",getAttrs(t){const n=e(t.getAttribute("href")??""),r=t.getAttribute("title");return r?{href:n,title:r}:{href:n}}}],sanitize:{tags:["a"],attrs:["href","title"]}})}(a),function(e){e.registerInlineNodeSpec({type:"hard_break",toDOM:et,toHTMLString:()=>"<br>",parseHTML:[{tag:"br"}],sanitize:{tags:["br"]}}),e.registerInlineNodeSpec({type:"image_inline",toDOM:et,toHTMLString(e){const n=t(String(e.attrs.src??"")),r=t(String(e.attrs.alt??"")),i=String(e.attrs.title??"");return`<img src="${n}" alt="${r}"${i?` title="${t(i)}"`:""}>`},parseHTML:[{tag:"img",getAttrs:t=>rt(t)}],sanitize:{tags:["img"],attrs:["src","alt","title"]}})}(a),a}(),y)}function et(){throw new Error("The Markdown HTML registry cannot render editor DOM.")}function nt(t){const e={...rt(t),align:"center"};for(const n of["width","height"]){const r=Number.parseFloat(t.getAttribute(n)??"");Number.isFinite(r)&&r>0&&(e[n]=r)}return e}function rt(t){const e={src:t.getAttribute("src")??"",alt:t.getAttribute("alt")??""},n=t.getAttribute("title");return n&&(e.title=n),e}export{z as a,O as c,b as d,d as f,N as i,$ as l,M as n,S as o,T as r,D as s,tt as t,p as u};
2
- //# sourceMappingURL=MarkdownHTMLRegistry-CISsC0lH.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MarkdownHTMLRegistry-CISsC0lH.mjs","names":[],"sources":["../../src/serialization/markdown/GfmTableParser.ts","../../src/serialization/markdown/MarkdownEntities.ts","../../src/serialization/markdown/BlockTokenizer.ts","../../src/serialization/markdown/MarkdownHTMLRegistry.ts"],"sourcesContent":["/**\n * GFM table detection and row parsing.\n *\n * A table is a header row, a delimiter row (`| --- | :--: |`), and zero or more\n * body rows. Column alignment is derived from the colons in the delimiter row.\n * Cells hold raw inline text, parsed later by the inline tokenizer.\n */\n\n/** Column alignment derived from the delimiter row. */\nexport type ColumnAlign = 'start' | 'center' | 'end' | null;\n\n/** A parsed GFM table (cells are raw inline strings). */\nexport interface TableData {\n\treadonly aligns: readonly ColumnAlign[];\n\treadonly header: readonly string[];\n\treadonly rows: readonly (readonly string[])[];\n\treadonly linesConsumed: number;\n}\n\nconst DELIMITER_ROW = /^\\s*\\|?\\s*:?-+:?\\s*(\\|\\s*:?-+:?\\s*)*\\|?\\s*$/;\n\n/** Splits a table row into trimmed cells, honoring escaped `\\|` and outer pipes. */\nfunction splitRow(line: string): string[] {\n\tlet s: string = line.trim();\n\tif (s.startsWith('|')) s = s.slice(1);\n\tif (s.endsWith('|') && !s.endsWith('\\\\|')) s = s.slice(0, -1);\n\n\tconst cells: string[] = [];\n\tlet current = '';\n\tfor (let i = 0; i < s.length; i++) {\n\t\tconst ch: string = s[i] ?? '';\n\t\tif (ch === '\\\\' && s[i + 1] === '|') {\n\t\t\tcurrent += '|';\n\t\t\ti++;\n\t\t\tcontinue;\n\t\t}\n\t\tif (ch === '|') {\n\t\t\tcells.push(current.trim());\n\t\t\tcurrent = '';\n\t\t\tcontinue;\n\t\t}\n\t\tcurrent += ch;\n\t}\n\tcells.push(current.trim());\n\treturn cells;\n}\n\n/** Reads the alignment of a single delimiter cell (`:--`, `--:`, `:-:`, `--`). */\nfunction cellAlign(cell: string): ColumnAlign {\n\tconst trimmed: string = cell.trim();\n\tconst left: boolean = trimmed.startsWith(':');\n\tconst right: boolean = trimmed.endsWith(':');\n\tif (left && right) return 'center';\n\tif (right) return 'end';\n\tif (left) return 'start';\n\treturn null;\n}\n\n/**\n * Attempts to parse a GFM table beginning at `start`. Returns the table data or\n * null when the two leading lines are not a header + delimiter pair. The body\n * extends until a blank line or the start of another block (`interrupts`); a\n * plain paragraph-like line inside that range is a lazy single-cell row, per\n * the GFM spec (\"the table is broken at the first empty line or beginning of\n * another block-level structural element\").\n */\nexport function matchTable(\n\tlines: readonly string[],\n\tstart: number,\n\tinterrupts?: (line: string) => boolean,\n): TableData | null {\n\tconst headerLine: string = lines[start] ?? '';\n\tconst delimLine: string = lines[start + 1] ?? '';\n\tif (!headerLine.includes('|')) return null;\n\tif (!DELIMITER_ROW.test(delimLine)) return null;\n\n\tconst header: string[] = splitRow(headerLine);\n\tconst aligns: ColumnAlign[] = splitRow(delimLine).map(cellAlign);\n\tif (aligns.length !== header.length) return null;\n\n\tconst rows: string[][] = [];\n\tlet i: number = start + 2;\n\twhile (i < lines.length) {\n\t\tconst line: string = lines[i] ?? '';\n\t\tif (line.trim() === '') break;\n\t\tif (!line.includes('|') && (!interrupts || interrupts(line))) break;\n\t\trows.push(splitRow(line));\n\t\ti++;\n\t}\n\n\treturn { aligns, header, rows, linesConsumed: i - start };\n}\n","/**\n * HTML entity and backslash-escape decoding shared by the Markdown parser.\n *\n * CommonMark recognizes entity and numeric character references (and backslash\n * escapes) not only in inline text but also inside link destinations, link\n * titles, link reference definitions, and code-fence info strings. The small\n * built-in table covers the common names; uncommon names are decoded through\n * the environment's HTML parser when a DOM is available (browser, happy-dom),\n * because embedding the full HTML5 table (~2200 names) would bloat the chunk.\n * Without a DOM (pure Node) unknown entities stay literal, which never loses\n * content.\n */\n\n/** Characters a backslash may escape (CommonMark ASCII punctuation). */\nexport const ESCAPABLE = /[!-/:-@[-`{-~]/;\n\n/** Sticky matcher so callers scan at an index without slicing (linear-time, D1). */\nconst ENTITY_AT = /&(#[xX][0-9a-fA-F]{1,6}|#[0-9]{1,7}|[a-zA-Z][a-zA-Z0-9]{1,31});/y;\n\nconst NAMED_ENTITIES: Readonly<Record<string, string>> = {\n\tamp: '&',\n\tlt: '<',\n\tgt: '>',\n\tquot: '\"',\n\tapos: \"'\",\n\tnbsp: ' ',\n\tcopy: '©',\n\treg: '®',\n\thellip: '…',\n\tmdash: '—',\n\tndash: '–',\n};\n\n/**\n * Decodes a single HTML entity body (without `&`/`;`), or returns it verbatim.\n * Per CommonMark, U+0000 and invalid code points decode to U+FFFD; decoded\n * line separators become plain spaces so a text node never carries a raw\n * newline (block boundaries are structural in the editor model).\n */\nexport function decodeEntity(body: string): string {\n\tif (body[0] === '#') {\n\t\tconst isHex: boolean = body[1] === 'x' || body[1] === 'X';\n\t\tconst code: number = Number.parseInt(body.slice(isHex ? 2 : 1), isHex ? 16 : 10);\n\t\tif (!Number.isFinite(code) || code < 0 || code > 0x10ffff) return `&${body};`;\n\t\tif (code === 0) return '�';\n\t\ttry {\n\t\t\tconst decoded: string = String.fromCodePoint(code);\n\t\t\treturn decoded === '\\n' || decoded === '\\r' ? ' ' : decoded;\n\t\t} catch {\n\t\t\treturn '�';\n\t\t}\n\t}\n\treturn NAMED_ENTITIES[body] ?? decodeNamedEntityViaDom(body) ?? `&${body};`;\n}\n\n/** Matches an entity reference at `pos` in `text`, or null. */\nexport function matchEntityAt(text: string, pos: number): RegExpExecArray | null {\n\tENTITY_AT.lastIndex = pos;\n\treturn ENTITY_AT.exec(text);\n}\n\nconst domEntityCache = new Map<string, string | null>();\n\nfunction decodeNamedEntityViaDom(body: string): string | null {\n\tif (typeof document === 'undefined') return null;\n\tconst cached: string | null | undefined = domEntityCache.get(body);\n\tif (cached !== undefined) return cached;\n\t// `body` is regex-restricted to alphanumerics, so this cannot inject markup.\n\tconst holder: HTMLElement = document.createElement('div');\n\tholder.innerHTML = `&${body};`;\n\tconst text: string = holder.textContent ?? '';\n\tconst decoded: string | null = text !== '' && text !== `&${body};` ? text : null;\n\tdomEntityCache.set(body, decoded);\n\treturn decoded;\n}\n\n/**\n * Decodes backslash escapes and entity references in a single left-to-right\n * pass (an escaped `&` therefore never starts an entity). Used for the string\n * contexts CommonMark decodes outside inline text: link destinations, titles,\n * reference definitions, and fence info strings.\n */\nexport function decodeEscapesAndEntities(text: string): string {\n\tlet out = '';\n\tlet i = 0;\n\twhile (i < text.length) {\n\t\tconst ch: string = text[i] ?? '';\n\t\tif (ch === '\\\\' && ESCAPABLE.test(text[i + 1] ?? '')) {\n\t\t\tout += text[i + 1];\n\t\t\ti += 2;\n\t\t\tcontinue;\n\t\t}\n\t\tif (ch === '&') {\n\t\t\tconst match: RegExpExecArray | null = matchEntityAt(text, i);\n\t\t\tif (match?.[1]) {\n\t\t\t\tout += decodeEntity(match[1]);\n\t\t\t\ti += match[0].length;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tout += ch;\n\t\ti++;\n\t}\n\treturn out;\n}\n\n/** Decodes only entity references (escapes were already consumed by the caller). */\nexport function decodeEntitiesOnly(text: string): string {\n\tlet out = '';\n\tlet i = 0;\n\twhile (i < text.length) {\n\t\tconst ch: string = text[i] ?? '';\n\t\tif (ch === '&') {\n\t\t\tconst match: RegExpExecArray | null = matchEntityAt(text, i);\n\t\t\tif (match?.[1]) {\n\t\t\t\tout += decodeEntity(match[1]);\n\t\t\t\ti += match[0].length;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tout += ch;\n\t\ti++;\n\t}\n\treturn out;\n}\n","/**\n * Block-level Markdown tokenizer.\n *\n * A line scanner that turns Markdown source into a flat (recursive for\n * blockquotes) list of block tokens. The grammar is centralized here, by\n * necessity: CommonMark block structure is global and context-sensitive and\n * cannot be decomposed into per-spec rules (D4). `MarkdownParser` maps these\n * tokens to schema node types by name.\n *\n * List items follow CommonMark content-column semantics (#194): each item owns\n * a content column derived from its marker; subsequent lines indented at least\n * that far are the item's own content region, dedented and tokenized\n * recursively. A region that yields a single paragraph keeps the item a leaf;\n * anything else makes the item a container with block children. Nested list\n * items are hoisted out of the region into flat siblings (the editor's\n * flat-with-indent sibling model, indent = nesting level). Markers indented\n * four or more columns are not markers (indented code / lazy text, per spec).\n * Blockquotes support lazy paragraph continuation, and so do list items.\n */\n\nimport type { MarkdownSyntaxExtension } from '../../model/MarkdownSyntaxRegistry.js';\nimport { type ColumnAlign, type TableData, matchTable } from './GfmTableParser.js';\nimport { decodeEscapesAndEntities } from './MarkdownEntities.js';\n\n/** A parsed block-level token. Inline text is left raw for the inline parser. */\nexport type BlockToken =\n\t| { readonly type: 'heading'; readonly level: number; readonly text: string }\n\t| { readonly type: 'paragraph'; readonly text: string }\n\t| { readonly type: 'code_block'; readonly language: string; readonly code: string }\n\t| { readonly type: 'hr' }\n\t| { readonly type: 'blockquote'; readonly children: readonly BlockToken[] }\n\t| {\n\t\t\treadonly type: 'list_item';\n\t\t\treadonly listType: 'bullet' | 'ordered' | 'checklist';\n\t\t\treadonly indent: number;\n\t\t\treadonly checked: boolean;\n\t\t\t/** Inline text of a leaf item; empty when `children` is present. */\n\t\t\treadonly text: string;\n\t\t\t/** Block children of a multi-block (container) item, absent for leaves. */\n\t\t\treadonly children?: readonly BlockToken[];\n\t }\n\t| { readonly type: 'html'; readonly html: string }\n\t| {\n\t\t\treadonly type: 'table';\n\t\t\treadonly aligns: readonly ColumnAlign[];\n\t\t\treadonly header: readonly string[];\n\t\t\treadonly rows: readonly (readonly string[])[];\n\t }\n\t| {\n\t\t\treadonly type: 'extension_block';\n\t\t\treadonly nodeType: string;\n\t\t\treadonly attrs: Record<string, string | number | boolean>;\n\t };\n\n/** Block-level HTML tags that begin an HTML block; inline tags fall through to paragraphs. */\nconst BLOCK_HTML_TAGS: ReadonlySet<string> = new Set([\n\t'address',\n\t'article',\n\t'aside',\n\t'blockquote',\n\t'details',\n\t'div',\n\t'dl',\n\t'dd',\n\t'dt',\n\t'figure',\n\t'figcaption',\n\t'footer',\n\t'form',\n\t'h1',\n\t'h2',\n\t'h3',\n\t'h4',\n\t'h5',\n\t'h6',\n\t'header',\n\t'hr',\n\t'iframe',\n\t'main',\n\t'nav',\n\t'ol',\n\t'p',\n\t'pre',\n\t'section',\n\t'table',\n\t'tbody',\n\t'td',\n\t'tfoot',\n\t'th',\n\t'thead',\n\t'tr',\n\t'ul',\n\t'video',\n]);\n\n// Exported so the parser's link-reference pre-pass can reuse the exact grammar\n// when deciding block boundaries (single source of truth for the syntax).\nexport const ATX_HEADING = /^ {0,3}(#{1,6})(?:[ \\t]+(.*?))?(?:[ \\t]+#+)?[ \\t]*$/;\nexport const FENCE_OPEN = /^ {0,3}(`{3,}|~{3,})[ \\t]*(.*)$/;\nexport const THEMATIC_BREAK = /^ {0,3}([-*_])[ \\t]*(?:\\1[ \\t]*){2,}$/;\nconst BLOCKQUOTE = /^ {0,3}>[ ]?/;\nconst BULLET_ITEM = /^([ \\t]*)([-*+])(?:([ \\t]+)(.*))?$/;\nconst ORDERED_ITEM = /^([ \\t]*)(\\d{1,9})([.)])(?:([ \\t]+)(.*))?$/;\nconst TASK_PREFIX = /^\\[([ xX])\\][ \\t]+(.*)$/;\n// Exported alongside the other grammar patterns so the serializer's line-start\n// escaping re-parses paragraph lines with the exact same rules (single source of\n// truth: a line the tokenizer would read as a setext underline gets escaped).\nexport const SETEXT_H1 = /^ {0,3}=+[ \\t]*$/;\nexport const SETEXT_H2 = /^ {0,3}-+[ \\t]*$/;\nconst HTML_BLOCK_START = /^ {0,3}<(\\/?)([a-zA-Z][a-zA-Z0-9-]*)|^ {0,3}<!--/;\n\n/** Leading-whitespace columns that open an indented code block (CommonMark). */\nconst INDENTED_CODE_COLUMNS = 4;\n\n/** Maximum leading columns of a list marker; deeper markers are code/lazy text. */\nconst MAX_MARKER_INDENT_COLUMNS = 3;\n\n/**\n * Maximum container nesting (blockquotes, list-item regions) before the\n * construct is treated as literal text. Each level recurses\n * (`tokenizeLines` → container consumer → `tokenizeLines`), so an adversarial\n * paste of thousands of `>`/`-` prefixes would overflow the stack. The cap\n * keeps recursion bounded; deeper content degrades to a paragraph (no data\n * loss, the marker characters are preserved). Real documents never nest this\n * deep.\n */\nconst MAX_CONTAINER_DEPTH = 32;\n\nfunction isBlank(line: string): boolean {\n\treturn line.trim() === '';\n}\n\n/**\n * Matches a fence opener. A backtick fence whose info string contains a\n * backtick is not a fence per CommonMark (it reads as an inline code span).\n */\nexport function matchFenceOpen(line: string): RegExpMatchArray | null {\n\tconst match: RegExpMatchArray | null = line.match(FENCE_OPEN);\n\tif (!match) return null;\n\tif ((match[1] ?? '')[0] === '`' && (match[2] ?? '').includes('`')) return null;\n\treturn match;\n}\n\n/** Tokenizes a full Markdown source string into block tokens. */\nexport function tokenizeBlocks(\n\tsource: string,\n\tgfm = true,\n\textensions: readonly MarkdownSyntaxExtension[] = [],\n): BlockToken[] {\n\t// A single trailing newline closes the last line; it is not an extra line\n\t// (otherwise an unclosed fence at EOF would gain a phantom blank line).\n\tconst normalized: string = source.replace(/\\r\\n?/g, '\\n').replace(/\\n$/, '');\n\treturn tokenizeLines(normalized.split('\\n'), gfm, extensions);\n}\n\nfunction tokenizeLines(\n\tlines: readonly string[],\n\tgfm: boolean,\n\textensions: readonly MarkdownSyntaxExtension[],\n\tdepth = 0,\n): BlockToken[] {\n\tconst tokens: BlockToken[] = [];\n\tlet i = 0;\n\n\twhile (i < lines.length) {\n\t\tconst line: string = lines[i] ?? '';\n\n\t\tif (isBlank(line)) {\n\t\t\ti++;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst extension: number = tryExtensionBlock(extensions, lines, i, tokens);\n\t\tif (extension > 0) {\n\t\t\ti += extension;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (gfm) {\n\t\t\tconst table: TableData | null = matchTable(lines, i, interruptsParagraph);\n\t\t\tif (table) {\n\t\t\t\ttokens.push({\n\t\t\t\t\ttype: 'table',\n\t\t\t\t\taligns: table.aligns,\n\t\t\t\t\theader: table.header,\n\t\t\t\t\trows: table.rows,\n\t\t\t\t});\n\t\t\t\ti += table.linesConsumed;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tconst fence: RegExpMatchArray | null = matchFenceOpen(line);\n\t\tif (fence) {\n\t\t\ti = consumeFencedCode(lines, i, fence, tokens);\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst atx: RegExpMatchArray | null = line.match(ATX_HEADING);\n\t\tif (atx) {\n\t\t\tconst rawText: string = (atx[2] ?? '').trim();\n\t\t\t// Content that is only `#`s is a closing sequence, not text (`### ###`).\n\t\t\tconst text: string = /^#+$/.test(rawText) ? '' : rawText;\n\t\t\ttokens.push({ type: 'heading', level: (atx[1] ?? '#').length, text });\n\t\t\ti++;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (THEMATIC_BREAK.test(line)) {\n\t\t\ttokens.push({ type: 'hr' });\n\t\t\ti++;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (BLOCKQUOTE.test(line)) {\n\t\t\t// Depth guard: past the cap, stop recursing and keep the `>` lines as\n\t\t\t// literal paragraph text rather than overflowing the stack.\n\t\t\tif (depth >= MAX_CONTAINER_DEPTH) {\n\t\t\t\ti = consumeParagraph(lines, i, tokens);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\ti = consumeBlockquote(lines, i, tokens, gfm, extensions, depth);\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst marker: ListMarker | null = depth < MAX_CONTAINER_DEPTH ? matchListMarker(line) : null;\n\t\tif (marker) {\n\t\t\ti = consumeListItem(lines, i, marker, tokens, gfm, extensions, depth);\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (canStartIndentedCode(line)) {\n\t\t\ti = consumeIndentedCode(lines, i, tokens);\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (isHtmlBlockStart(line)) {\n\t\t\ti = consumeHtmlBlock(lines, i, tokens);\n\t\t\tcontinue;\n\t\t}\n\n\t\ti = consumeParagraph(lines, i, tokens);\n\t}\n\n\treturn tokens;\n}\n\n/** Consumes a fenced code block; returns the next line index. */\nfunction consumeFencedCode(\n\tlines: readonly string[],\n\tstart: number,\n\tfence: RegExpMatchArray,\n\ttokens: BlockToken[],\n): number {\n\tconst fenceStr: string = fence[1] ?? '```';\n\tconst fenceChar: string = fenceStr[0] ?? '`';\n\tconst language: string = decodeEscapesAndEntities((fence[2] ?? '').trim().split(/\\s+/)[0] ?? '');\n\tconst closeRe = new RegExp(`^ {0,3}${`\\\\${fenceChar}`}{${fenceStr.length},}[ \\\\t]*$`);\n\t// An indented opening fence strips up to that indentation from each body line.\n\tconst openLine: string = lines[start] ?? '';\n\tconst openIndent: number = openLine.length - openLine.trimStart().length;\n\n\tconst body: string[] = [];\n\tlet i: number = start + 1;\n\twhile (i < lines.length) {\n\t\tconst line: string = lines[i] ?? '';\n\t\tif (closeRe.test(line)) {\n\t\t\ti++;\n\t\t\tbreak;\n\t\t}\n\t\tbody.push(stripLeadingSpaces(line, openIndent));\n\t\ti++;\n\t}\n\ttokens.push({ type: 'code_block', language, code: body.join('\\n') });\n\treturn i;\n}\n\n/** Removes up to `max` leading spaces from a line. */\nfunction stripLeadingSpaces(line: string, max: number): string {\n\tlet i = 0;\n\twhile (i < max && line[i] === ' ') i++;\n\treturn line.slice(i);\n}\n\n/**\n * Whether a line opens an indented code block (#195): at least four columns of\n * leading whitespace (tab-aware). Indented content that belongs to an open\n * list item never reaches this check — it is consumed into the item's content\n * region first (#194).\n */\nfunction canStartIndentedCode(line: string): boolean {\n\treturn indentColumns(line) >= INDENTED_CODE_COLUMNS;\n}\n\n/** Columns of leading whitespace, with tabs advancing to 4-column tab stops. */\nfunction indentColumns(line: string): number {\n\tlet col = 0;\n\tfor (const ch of line) {\n\t\tif (ch === ' ') col++;\n\t\telse if (ch === '\\t') col += 4 - (col % 4);\n\t\telse break;\n\t}\n\treturn col;\n}\n\n/**\n * Strips `columns` columns of leading whitespace (tab-aware). The remaining\n * leading whitespace is re-emitted as spaces measured in absolute columns:\n * tab stops depend on the column a tab starts in, so dedented lines must not\n * carry raw tabs whose width would be recomputed in the wrong context.\n */\nfunction stripIndent(line: string, columns: number): string {\n\tlet col = 0;\n\tlet i = 0;\n\twhile (i < line.length) {\n\t\tconst ch: string = line[i] ?? '';\n\t\tif (ch === ' ') col++;\n\t\telse if (ch === '\\t') col += 4 - (col % 4);\n\t\telse break;\n\t\ti++;\n\t}\n\treturn ' '.repeat(Math.max(0, col - columns)) + line.slice(i);\n}\n\n/**\n * Strips `columns` columns of leading whitespace from a code line, preserving\n * literal tabs beyond the strip boundary. Indented-code content is literal, so\n * tabs are significant (Makefiles, Go) and must survive verbatim — unlike\n * {@link stripIndent}, which normalizes re-tokenized structural whitespace to\n * spaces. Only a tab straddling the strip boundary contributes spaces (the part\n * of its width past `columns`); tabs fully past the boundary are kept as-is.\n */\nfunction stripCodeIndent(line: string, columns: number): string {\n\tlet col = 0;\n\tlet i = 0;\n\twhile (i < line.length && col < columns) {\n\t\tconst ch: string = line[i] ?? '';\n\t\tif (ch === ' ') {\n\t\t\tcol++;\n\t\t\ti++;\n\t\t} else if (ch === '\\t') {\n\t\t\tconst next: number = col + 4 - (col % 4);\n\t\t\tif (next > columns) {\n\t\t\t\t// Straddling tab: emit only its overflow past the boundary as spaces\n\t\t\t\t// and keep the remainder of the line (including later tabs) verbatim.\n\t\t\t\treturn ' '.repeat(next - columns) + line.slice(i + 1);\n\t\t\t}\n\t\t\tcol = next;\n\t\t\ti++;\n\t\t} else {\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn line.slice(i);\n}\n\n/**\n * Consumes an indented code block: all subsequent lines indented by at least\n * four columns, keeping interior blank lines but not trailing ones (they\n * separate the block from what follows). Returns the next line index.\n */\nfunction consumeIndentedCode(\n\tlines: readonly string[],\n\tstart: number,\n\ttokens: BlockToken[],\n): number {\n\tconst body: string[] = [];\n\tconst pendingBlanks: string[] = [];\n\tlet i: number = start;\n\twhile (i < lines.length) {\n\t\tconst line: string = lines[i] ?? '';\n\t\tif (isBlank(line)) {\n\t\t\t// Interior blank lines keep their content beyond the stripped columns.\n\t\t\tpendingBlanks.push(stripCodeIndent(line, INDENTED_CODE_COLUMNS));\n\t\t\ti++;\n\t\t\tcontinue;\n\t\t}\n\t\tif (indentColumns(line) < INDENTED_CODE_COLUMNS) break;\n\t\twhile (pendingBlanks.length > 0) body.push(pendingBlanks.shift() ?? '');\n\t\tbody.push(stripCodeIndent(line, INDENTED_CODE_COLUMNS));\n\t\ti++;\n\t}\n\ttokens.push({ type: 'code_block', language: '', code: body.join('\\n') });\n\treturn i - pendingBlanks.length;\n}\n\n/** Tries each extension's `matchBlock`; pushes a token and returns lines consumed (0 = no match). */\nfunction tryExtensionBlock(\n\textensions: readonly MarkdownSyntaxExtension[],\n\tlines: readonly string[],\n\tlineIndex: number,\n\ttokens: BlockToken[],\n): number {\n\tfor (const ext of extensions) {\n\t\tconst match = ext.matchBlock?.(lines, lineIndex);\n\t\tif (match && match.linesConsumed > 0) {\n\t\t\ttokens.push({ type: 'extension_block', nodeType: match.type, attrs: match.attrs });\n\t\t\treturn match.linesConsumed;\n\t\t}\n\t}\n\treturn 0;\n}\n\n/**\n * Consumes consecutive `>`-prefixed lines (plus lazy paragraph continuation\n * lines, per CommonMark) and recurses into their content. A plain line\n * continues the quote only while the innermost open block is a paragraph.\n */\nfunction consumeBlockquote(\n\tlines: readonly string[],\n\tstart: number,\n\ttokens: BlockToken[],\n\tgfm: boolean,\n\textensions: readonly MarkdownSyntaxExtension[],\n\tdepth: number,\n): number {\n\tconst inner: string[] = [];\n\tlet i: number = start;\n\tlet lazyOk = false;\n\twhile (i < lines.length) {\n\t\tconst line: string = lines[i] ?? '';\n\t\tif (BLOCKQUOTE.test(line)) {\n\t\t\tconst stripped: string = line.replace(BLOCKQUOTE, '');\n\t\t\tinner.push(stripped);\n\t\t\tlazyOk = continuesAsParagraph(stripped);\n\t\t\ti++;\n\t\t\tcontinue;\n\t\t}\n\t\tif (\n\t\t\tlazyOk &&\n\t\t\t!isBlank(line) &&\n\t\t\t!interruptsParagraph(line) &&\n\t\t\t!(gfm && matchTable(lines, i, interruptsParagraph))\n\t\t) {\n\t\t\tinner.push(line);\n\t\t\ti++;\n\t\t\tcontinue;\n\t\t}\n\t\tbreak;\n\t}\n\ttokens.push({ type: 'blockquote', children: tokenizeLines(inner, gfm, extensions, depth + 1) });\n\treturn i;\n}\n\n/**\n * Whether a stripped container line leaves a paragraph open at its innermost\n * level: quote prefixes and list markers are peeled off (`> 1. > text` opens a\n * paragraph two containers deep, which a lazy line may continue).\n */\nfunction continuesAsParagraph(stripped: string): boolean {\n\tlet content: string = stripped;\n\tfor (;;) {\n\t\tif (BLOCKQUOTE.test(content)) {\n\t\t\tcontent = content.replace(BLOCKQUOTE, '');\n\t\t\tcontinue;\n\t\t}\n\t\tconst marker: ListMarker | null = matchListMarker(content);\n\t\tif (marker && marker.firstText !== '') {\n\t\t\tcontent = marker.firstText;\n\t\t\tcontinue;\n\t\t}\n\t\tbreak;\n\t}\n\tif (content.trim() === '' || interruptsParagraph(content)) return false;\n\t// An indented-code line is not a paragraph, so nothing can lazily continue it.\n\treturn indentColumns(content) < INDENTED_CODE_COLUMNS;\n}\n\n/** Geometry and metadata of a single list-marker line. */\ninterface ListMarker {\n\treadonly listType: 'bullet' | 'ordered' | 'checklist';\n\treadonly checked: boolean;\n\t/** Column where the item's content begins; region lines must reach it. */\n\treadonly contentColumn: number;\n\t/** The marker line's own content (task prefix stripped), '' for empty items. */\n\treadonly firstText: string;\n\t/** The ordered start number (1 for bullets). */\n\treadonly startNumber: number;\n}\n\n/** Columns spanned by a whitespace run starting at an absolute column. */\nfunction columnsFrom(start: number, whitespace: string): number {\n\tlet col: number = start;\n\tfor (const ch of whitespace) {\n\t\tif (ch === ' ') col++;\n\t\telse if (ch === '\\t') col += 4 - (col % 4);\n\t\telse break;\n\t}\n\treturn col - start;\n}\n\n/**\n * Parses a list-marker line into its content-column geometry, or null when the\n * line is not a valid marker: markers indented four or more columns are\n * indented code or lazy text, never list items (CommonMark).\n */\nfunction matchListMarker(line: string): ListMarker | null {\n\tconst bullet: RegExpMatchArray | null = line.match(BULLET_ITEM);\n\tconst ordered: RegExpMatchArray | null = bullet ? null : line.match(ORDERED_ITEM);\n\tconst match: RegExpMatchArray | null = bullet ?? ordered;\n\tif (!match) return null;\n\n\tconst leadingColumns: number = indentColumns(match[1] ?? '');\n\tif (leadingColumns > MAX_MARKER_INDENT_COLUMNS) return null;\n\n\tconst markerText: string = (bullet ? match[2] : `${match[2]}${match[3]}`) ?? '-';\n\tconst markerEnd: number = leadingColumns + markerText.length;\n\tconst spacing: string = (bullet ? match[3] : match[4]) ?? '';\n\tconst spacingColumns: number = columnsFrom(markerEnd, spacing);\n\tconst rawContent: string = (bullet ? match[4] : match[5]) ?? '';\n\tconst startNumber: number = ordered ? Number.parseInt(match[2] ?? '1', 10) : 1;\n\n\tlet contentColumn: number;\n\tlet firstText: string;\n\tif (rawContent.trim() === '') {\n\t\tcontentColumn = markerEnd + 1;\n\t\tfirstText = '';\n\t} else if (spacingColumns >= 5) {\n\t\t// Content five or more columns past the marker starts as indented code;\n\t\t// the content column sits one past the marker (CommonMark).\n\t\tcontentColumn = markerEnd + 1;\n\t\tfirstText = ' '.repeat(spacingColumns - 1) + rawContent;\n\t} else {\n\t\tcontentColumn = markerEnd + spacingColumns;\n\t\tfirstText = rawContent;\n\t}\n\n\tconst task: RegExpMatchArray | null = firstText.match(TASK_PREFIX);\n\tif (task) {\n\t\treturn {\n\t\t\tlistType: 'checklist',\n\t\t\tchecked: (task[1] ?? ' ').toLowerCase() === 'x',\n\t\t\tcontentColumn,\n\t\t\tfirstText: task[2] ?? '',\n\t\t\tstartNumber,\n\t\t};\n\t}\n\treturn {\n\t\tlistType: ordered ? 'ordered' : 'bullet',\n\t\tchecked: false,\n\t\tcontentColumn,\n\t\tfirstText,\n\t\tstartNumber,\n\t};\n}\n\n/**\n * Consumes one list item: the marker line plus its content region — every\n * following line indented to the content column (dedented), interior blank\n * lines, and lazy paragraph continuation lines. The collected content is\n * tokenized recursively; nested list items are hoisted into flat siblings.\n * Returns the next line index.\n */\nfunction consumeListItem(\n\tlines: readonly string[],\n\tstart: number,\n\tmarker: ListMarker,\n\ttokens: BlockToken[],\n\tgfm: boolean,\n\textensions: readonly MarkdownSyntaxExtension[],\n\tdepth: number,\n): number {\n\tconst region: string[] = [];\n\tconst tracker: (line: string, paragraphOpen: boolean) => boolean = createParagraphTracker();\n\tlet firstText: string = marker.firstText;\n\tlet paragraphOpen: boolean = firstText === '' ? false : tracker(firstText, false);\n\tlet pendingBlanks = 0;\n\tlet i: number = start + 1;\n\n\twhile (i < lines.length) {\n\t\tconst line: string = lines[i] ?? '';\n\n\t\tif (isBlank(line)) {\n\t\t\t// An item may begin with at most one blank line: a marker with no\n\t\t\t// content followed by a blank line stays an empty item (CommonMark).\n\t\t\tif (firstText === '' && region.length === 0) break;\n\t\t\tpendingBlanks++;\n\t\t\tparagraphOpen = false;\n\t\t\ti++;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (indentColumns(line) >= marker.contentColumn) {\n\t\t\twhile (pendingBlanks > 0) {\n\t\t\t\tregion.push('');\n\t\t\t\tpendingBlanks--;\n\t\t\t}\n\t\t\tconst dedented: string = stripIndent(line, marker.contentColumn);\n\t\t\tregion.push(dedented);\n\t\t\tparagraphOpen = tracker(dedented, paragraphOpen);\n\t\t\ti++;\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Under-indented: only a lazy paragraph continuation keeps the item open.\n\t\t// Any valid marker line is a sibling item, never lazy text (the\n\t\t// ordered-must-start-at-1 interrupt rule applies to paragraphs only).\n\t\tif (matchListMarker(line)) break;\n\t\tif (!paragraphOpen) break;\n\t\tif (interruptsParagraph(line)) break;\n\t\tif (gfm && matchTable(lines, i, interruptsParagraph)) break;\n\t\t// A lazy line belongs textually to the open paragraph: fold it into the\n\t\t// previous logical line so it can never re-parse as a block start in the\n\t\t// item's sub-document (`- d\\n - e` keeps \"- e\" as paragraph text).\n\t\tconst lazy: string = line.trimStart();\n\t\tconst lastRegionLine: string | undefined = region[region.length - 1];\n\t\tif (lastRegionLine !== undefined) {\n\t\t\tregion[region.length - 1] = `${lastRegionLine}\\n${lazy}`;\n\t\t} else {\n\t\t\tfirstText = firstText === '' ? lazy : `${firstText}\\n${lazy}`;\n\t\t}\n\t\tparagraphOpen = tracker(lazy, paragraphOpen);\n\t\ti++;\n\t}\n\n\tappendListItemTokens(marker, firstText, region, tokens, gfm, extensions, depth);\n\treturn i;\n}\n\n/**\n * Tracks whether the innermost open block of an item's content region is a\n * paragraph — the precondition for lazy continuation. Fenced code suspends\n * laziness until the fence closes; block starters close the paragraph. The\n * caller passes whether a paragraph is currently open, because an indented line\n * cannot start an indented code block while a paragraph is open (CommonMark): it\n * continues that paragraph instead, and only opens a code block from a closed\n * state.\n */\nfunction createParagraphTracker(): (line: string, paragraphOpen: boolean) => boolean {\n\tlet closeRe: RegExp | null = null;\n\treturn (line: string, paragraphOpen: boolean): boolean => {\n\t\tif (closeRe) {\n\t\t\tif (closeRe.test(line)) closeRe = null;\n\t\t\treturn false;\n\t\t}\n\t\tconst fence: RegExpMatchArray | null = matchFenceOpen(line);\n\t\tif (fence) {\n\t\t\tconst fenceStr: string = fence[1] ?? '```';\n\t\t\tconst fenceChar: string = fenceStr[0] ?? '`';\n\t\t\tcloseRe = new RegExp(`^ {0,3}${`\\\\${fenceChar}`}{${fenceStr.length},}[ \\\\t]*$`);\n\t\t\treturn false;\n\t\t}\n\t\tif (isBlank(line)) return false;\n\t\tif (BLOCKQUOTE.test(line) || matchListMarker(line)) return continuesAsParagraph(line);\n\t\t// Indented code cannot interrupt an open paragraph: an indented line keeps\n\t\t// the paragraph open, and only opens a code block when none is open.\n\t\tif (indentColumns(line) >= INDENTED_CODE_COLUMNS) return paragraphOpen;\n\t\treturn !interruptsParagraph(line);\n\t};\n}\n\n/**\n * Builds the item token(s) from the marker line and its dedented content\n * region: the content is tokenized recursively; a single-paragraph result\n * keeps the item a leaf, anything else becomes a container with block\n * children. Nested list items are hoisted out into flat siblings one indent\n * deeper (the editor's flat-with-indent sibling model).\n */\nfunction appendListItemTokens(\n\tmarker: ListMarker,\n\tfirstText: string,\n\tregion: readonly string[],\n\ttokens: BlockToken[],\n\tgfm: boolean,\n\textensions: readonly MarkdownSyntaxExtension[],\n\tdepth: number,\n): void {\n\tconst subLines: string[] = firstText === '' ? [...region] : [firstText, ...region];\n\tconst subTokens: BlockToken[] =\n\t\tsubLines.length === 0 ? [] : tokenizeLines(subLines, gfm, extensions, depth + 1);\n\n\tconst lifted: BlockToken[] = [];\n\tconst own: BlockToken[] = [];\n\tfor (const token of subTokens) {\n\t\tif (token.type === 'list_item') {\n\t\t\tlifted.push({ ...token, indent: token.indent + 1 });\n\t\t} else {\n\t\t\town.push(token);\n\t\t}\n\t}\n\n\tconst first: BlockToken | undefined = own[0];\n\tif (own.length === 1 && first?.type === 'paragraph') {\n\t\ttokens.push(makeListItemToken(marker, first.text));\n\t} else if (own.length === 0) {\n\t\ttokens.push(makeListItemToken(marker, ''));\n\t} else {\n\t\ttokens.push(makeListItemToken(marker, '', own));\n\t}\n\ttokens.push(...lifted);\n}\n\n/** Builds a `list_item` token at indent 0 of the current tokenization level. */\nfunction makeListItemToken(\n\tmarker: ListMarker,\n\ttext: string,\n\tchildren?: readonly BlockToken[],\n): BlockToken {\n\tconst base = {\n\t\ttype: 'list_item' as const,\n\t\tlistType: marker.listType,\n\t\tindent: 0,\n\t\tchecked: marker.checked,\n\t\ttext,\n\t};\n\treturn children ? { ...base, children } : base;\n}\n\n/**\n * Whether a list-item line may interrupt an open paragraph: CommonMark forbids\n * empty items and ordered items not starting at 1 from doing so (`14.` in prose\n * must not begin a list).\n */\nfunction listItemInterrupts(line: string): boolean {\n\tconst marker: ListMarker | null = matchListMarker(line);\n\tif (!marker) return false;\n\tif (marker.firstText.trim() === '') return false;\n\tif (marker.listType === 'ordered') return marker.startNumber === 1;\n\treturn true;\n}\n\n/** Whether a line begins a block-level HTML element (inline tags fall through). */\nfunction isHtmlBlockStart(line: string): boolean {\n\tconst match: RegExpMatchArray | null = line.match(HTML_BLOCK_START);\n\tif (!match) return false;\n\tif (line.trimStart().startsWith('<!--')) return true;\n\tconst tag: string = (match[2] ?? '').toLowerCase();\n\treturn BLOCK_HTML_TAGS.has(tag);\n}\n\n/** Consumes an HTML block up to the next blank line. */\nfunction consumeHtmlBlock(lines: readonly string[], start: number, tokens: BlockToken[]): number {\n\tconst html: string[] = [];\n\tlet i: number = start;\n\twhile (i < lines.length) {\n\t\tconst line: string = lines[i] ?? '';\n\t\tif (isBlank(line)) break;\n\t\thtml.push(line);\n\t\ti++;\n\t}\n\ttokens.push({ type: 'html', html: html.join('\\n') });\n\treturn i;\n}\n\n/** Whether a line would interrupt an open paragraph (begins another block). */\nfunction interruptsParagraph(line: string): boolean {\n\tif (isBlank(line)) return true;\n\tif (ATX_HEADING.test(line)) return true;\n\tif (matchFenceOpen(line)) return true;\n\tif (THEMATIC_BREAK.test(line)) return true;\n\tif (BLOCKQUOTE.test(line)) return true;\n\tif (listItemInterrupts(line)) return true;\n\tif (isHtmlBlockStart(line)) return true;\n\treturn false;\n}\n\n/** Consumes a paragraph (with lazy continuation) or a setext heading. */\nfunction consumeParagraph(lines: readonly string[], start: number, tokens: BlockToken[]): number {\n\tconst collected: string[] = [lines[start] ?? ''];\n\tlet i: number = start + 1;\n\n\twhile (i < lines.length) {\n\t\tconst line: string = lines[i] ?? '';\n\n\t\t// A setext underline turns the collected paragraph into a heading.\n\t\tif (SETEXT_H1.test(line)) {\n\t\t\ttokens.push({ type: 'heading', level: 1, text: joinParagraph(collected) });\n\t\t\treturn i + 1;\n\t\t}\n\t\t// A `-` underline outranks a thematic break when a paragraph sits above it.\n\t\tif (SETEXT_H2.test(line)) {\n\t\t\ttokens.push({ type: 'heading', level: 2, text: joinParagraph(collected) });\n\t\t\treturn i + 1;\n\t\t}\n\n\t\tif (interruptsParagraph(line)) break;\n\t\tcollected.push(line);\n\t\ti++;\n\t}\n\n\ttokens.push({ type: 'paragraph', text: joinParagraphText(collected) });\n\treturn i;\n}\n\n/**\n * Joins collected paragraph lines for inline parsing. Leading indentation is\n * insignificant and stripped, but trailing spaces on interior lines are kept:\n * two or more of them encode a hard break, which the inline parser consumes\n * (#193). The final line's trailing whitespace carries no meaning and is\n * dropped.\n */\nfunction joinParagraphText(lines: readonly string[]): string {\n\treturn lines\n\t\t.map((line, index) => (index === lines.length - 1 ? line.trim() : line.trimStart()))\n\t\t.join('\\n');\n}\n\n/** Joins multi-line paragraph text into a single-line heading string. */\nfunction joinParagraph(lines: readonly string[]): string {\n\treturn lines\n\t\t.map((l) => l.trim())\n\t\t.join(' ')\n\t\t.trim();\n}\n","/**\n * Minimal HTML-only schema for Markdown's raw-HTML seam.\n *\n * Registry-free Markdown calls still need the portable structures owned by the\n * codec when a block must become raw HTML (for example to retain an `htmlId`).\n * An explicitly supplied registry is returned unchanged and remains the sole\n * authority. No plugin or view module is imported here.\n */\n\nimport { escapeAttr, sanitizeHref } from '../../model/HTMLUtils.js';\nimport type { HTMLExportContext } from '../../model/NodeSpec.js';\nimport { SchemaRegistry } from '../../model/SchemaRegistry.js';\nimport {\n\tTABLE_COLUMN_WIDTH_DATA_ATTRIBUTE,\n\tTABLE_ROW_MIN_HEIGHT_DATA_ATTRIBUTE,\n\tnormalizeTableColumnWidthsPx,\n\tserializeTableDimensionAttrs,\n} from '../TableDimensions.js';\n\nlet baselineRegistry: SchemaRegistry | undefined;\n\n/** Resolves the schema at an HTML boundary without supplementing an explicit schema. */\nexport function resolveMarkdownHTMLRegistry(registry?: SchemaRegistry): SchemaRegistry {\n\tif (registry) return registry;\n\tbaselineRegistry ??= createBaselineRegistry();\n\treturn baselineRegistry;\n}\n\nfunction htmlOnlyDOM(): HTMLElement {\n\tthrow new Error('The Markdown HTML registry cannot render editor DOM.');\n}\n\nfunction createBaselineRegistry(): SchemaRegistry {\n\tconst registry = new SchemaRegistry();\n\tregisterBlocks(registry);\n\tregisterMarks(registry);\n\tregisterInlineNodes(registry);\n\treturn registry;\n}\n\nfunction registerBlocks(registry: SchemaRegistry): void {\n\tregistry.registerNodeSpec({\n\t\ttype: 'paragraph',\n\t\ttoDOM: htmlOnlyDOM,\n\t\ttoHTML: (_node, content) => `<p>${content || '<br>'}</p>`,\n\t\tparseHTML: [{ tag: 'p' }, { tag: 'div', priority: 10 }],\n\t\tsanitize: { tags: ['p'] },\n\t});\n\n\tregistry.registerNodeSpec({\n\t\ttype: 'heading',\n\t\ttoDOM: htmlOnlyDOM,\n\t\ttoHTML(node, content) {\n\t\t\tconst raw: unknown = node.attrs?.level;\n\t\t\tconst level: number =\n\t\t\t\ttypeof raw === 'number' && Number.isFinite(raw)\n\t\t\t\t\t? Math.max(1, Math.min(6, Math.floor(raw)))\n\t\t\t\t\t: 1;\n\t\t\treturn `<h${level}>${content || '<br>'}</h${level}>`;\n\t\t},\n\t\tparseHTML: [1, 2, 3, 4, 5, 6].map((level) => ({\n\t\t\ttag: `h${level}`,\n\t\t\tgetAttrs: () => ({ level }),\n\t\t})),\n\t\tsanitize: { tags: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] },\n\t});\n\n\tregistry.registerNodeSpec({\n\t\ttype: 'list_item',\n\t\ttoDOM: htmlOnlyDOM,\n\t\ttoHTML(node, content) {\n\t\t\tif (node.attrs?.listType !== 'checklist') return `<li>${content || '<br>'}</li>`;\n\t\t\tconst checked: boolean = node.attrs.checked === true;\n\t\t\treturn (\n\t\t\t\t`<li role=\"checkbox\" aria-checked=\"${String(checked)}\">` +\n\t\t\t\t`<input type=\"checkbox\" disabled${checked ? ' checked' : ''}>` +\n\t\t\t\t`${content || '<br>'}</li>`\n\t\t\t);\n\t\t},\n\t\tparseHTML: [{ tag: 'li' }],\n\t\tsanitize: {\n\t\t\ttags: ['ul', 'ol', 'li', 'input'],\n\t\t\tattrs: ['type', 'disabled', 'checked', 'role', 'aria-checked'],\n\t\t},\n\t});\n\n\tregistry.registerNodeSpec({\n\t\ttype: 'blockquote',\n\t\ttoDOM: htmlOnlyDOM,\n\t\ttoHTML: (_node, content) => `<blockquote>${content || '<br>'}</blockquote>`,\n\t\tparseHTML: [{ tag: 'blockquote' }],\n\t\tsanitize: { tags: ['blockquote'] },\n\t});\n\n\tregistry.registerNodeSpec({\n\t\ttype: 'code_block',\n\t\ttoDOM: htmlOnlyDOM,\n\t\ttoHTML(node, content) {\n\t\t\tconst language: string = String(node.attrs?.language ?? '');\n\t\t\tconst languageClass: string = language ? ` class=\"language-${escapeAttr(language)}\"` : '';\n\t\t\treturn `<pre><code${languageClass}>${content}</code></pre>`;\n\t\t},\n\t\tparseHTML: [\n\t\t\t{\n\t\t\t\ttag: 'pre',\n\t\t\t\tgetAttrs(el) {\n\t\t\t\t\tconst code: HTMLElement | null = el.querySelector('code');\n\t\t\t\t\tconst language: string = code?.className.match(/(?:^|\\s)language-(\\S+)/)?.[1] ?? '';\n\t\t\t\t\treturn { language };\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t\tsanitize: { tags: ['pre', 'code'], attrs: ['class'] },\n\t});\n\n\tregistry.registerNodeSpec({\n\t\ttype: 'horizontal_rule',\n\t\tisVoid: true,\n\t\ttoDOM: htmlOnlyDOM,\n\t\ttoHTML: () => '<hr>',\n\t\tparseHTML: [{ tag: 'hr' }],\n\t\tsanitize: { tags: ['hr'] },\n\t});\n\n\tregistry.registerNodeSpec({\n\t\ttype: 'image',\n\t\tisVoid: true,\n\t\tattrs: {\n\t\t\tsrc: { default: '' },\n\t\t\talt: { default: '' },\n\t\t\ttitle: { default: '' },\n\t\t\talign: { default: 'center' },\n\t\t},\n\t\ttoDOM: htmlOnlyDOM,\n\t\ttoHTML(node) {\n\t\t\tconst src: string = escapeAttr(String(node.attrs?.src ?? ''));\n\t\t\tconst alt: string = escapeAttr(String(node.attrs?.alt ?? ''));\n\t\t\tconst title: string = String(node.attrs?.title ?? '');\n\t\t\tconst titleAttr: string = title ? ` title=\"${escapeAttr(title)}\"` : '';\n\t\t\tconst dimension = (name: string, value: unknown): string =>\n\t\t\t\ttypeof value === 'number' && Number.isFinite(value) && value > 0\n\t\t\t\t\t? ` ${name}=\"${String(value)}\"`\n\t\t\t\t\t: '';\n\t\t\treturn (\n\t\t\t\t`<figure><img src=\"${src}\" alt=\"${alt}\"${titleAttr}` +\n\t\t\t\t`${dimension('width', node.attrs?.width)}${dimension('height', node.attrs?.height)}></figure>`\n\t\t\t);\n\t\t},\n\t\tparseHTML: [\n\t\t\t{\n\t\t\t\ttag: 'figure',\n\t\t\t\tgetAttrs(el) {\n\t\t\t\t\tconst image: HTMLImageElement | null = el.querySelector('img');\n\t\t\t\t\treturn image ? imageAttrs(image) : false;\n\t\t\t\t},\n\t\t\t},\n\t\t\t{ tag: 'img', getAttrs: (el) => imageAttrs(el as HTMLImageElement) },\n\t\t],\n\t\tsanitize: {\n\t\t\ttags: ['figure', 'img'],\n\t\t\tattrs: ['src', 'alt', 'title', 'width', 'height'],\n\t\t},\n\t});\n\n\tregistry.registerNodeSpec({\n\t\ttype: 'table',\n\t\ttoDOM: htmlOnlyDOM,\n\t\ttoHTML(node, content, ctx?: HTMLExportContext) {\n\t\t\tconst widths: readonly (number | null)[] | undefined = normalizeTableColumnWidthsPx(\n\t\t\t\tnode.attrs?.columnWidthsPx,\n\t\t\t);\n\t\t\tconst colgroup: string = widths\n\t\t\t\t? `<colgroup>${widths\n\t\t\t\t\t\t.map((width: number | null): string => {\n\t\t\t\t\t\t\tconst attrs: string = serializeTableDimensionAttrs(\n\t\t\t\t\t\t\t\tTABLE_COLUMN_WIDTH_DATA_ATTRIBUTE,\n\t\t\t\t\t\t\t\t'width',\n\t\t\t\t\t\t\t\twidth,\n\t\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn `<col${attrs}>`;\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.join('')}</colgroup>`\n\t\t\t\t: '';\n\t\t\tconst tableAttrs: string = widths ? tableDimensionStyle(widths, ctx) : '';\n\t\t\treturn `<table${tableAttrs}>${colgroup}<tbody>${content}</tbody></table>`;\n\t\t},\n\t\tsanitize: {\n\t\t\ttags: ['table', 'colgroup', 'col', 'thead', 'tbody', 'tfoot'],\n\t\t\tattrs: ['span', 'width', TABLE_COLUMN_WIDTH_DATA_ATTRIBUTE],\n\t\t},\n\t});\n\n\tregistry.registerNodeSpec({\n\t\ttype: 'table_row',\n\t\ttoDOM: htmlOnlyDOM,\n\t\ttoHTML(node, content, ctx?: HTMLExportContext) {\n\t\t\tconst attrs: string = serializeTableDimensionAttrs(\n\t\t\t\tTABLE_ROW_MIN_HEIGHT_DATA_ATTRIBUTE,\n\t\t\t\t'height',\n\t\t\t\tnode.attrs?.minHeightPx,\n\t\t\t\tctx,\n\t\t\t);\n\t\t\treturn `<tr${attrs}>${content}</tr>`;\n\t\t},\n\t\tsanitize: {\n\t\t\ttags: ['tr'],\n\t\t\tattrs: ['height', TABLE_ROW_MIN_HEIGHT_DATA_ATTRIBUTE],\n\t\t},\n\t});\n\n\tregistry.registerNodeSpec({\n\t\ttype: 'table_cell',\n\t\ttoDOM: htmlOnlyDOM,\n\t\ttoHTML(node, content) {\n\t\t\tconst span = (name: string, value: unknown): string =>\n\t\t\t\ttypeof value === 'number' && Number.isInteger(value) && value > 1\n\t\t\t\t\t? ` ${name}=\"${String(value)}\"`\n\t\t\t\t\t: '';\n\t\t\treturn `<td${span('colspan', node.attrs?.colspan)}${span(\n\t\t\t\t'rowspan',\n\t\t\t\tnode.attrs?.rowspan,\n\t\t\t)}>${content}</td>`;\n\t\t},\n\t\tsanitize: { tags: ['td', 'th'], attrs: ['colspan', 'rowspan'] },\n\t});\n}\n\nfunction tableDimensionStyle(widths: readonly (number | null)[], ctx?: HTMLExportContext): string {\n\tconst minimumWidthPx: number = widths.reduce<number>(\n\t\t(total: number, width: number | null): number => total + (width ?? 60),\n\t\t0,\n\t);\n\tconst allExplicit: boolean = widths.every(\n\t\t(width: number | null): width is number => width !== null,\n\t);\n\tconst declarations: string = allExplicit\n\t\t? `width: ${String(minimumWidthPx)}px; min-width: ${String(minimumWidthPx)}px; table-layout: fixed`\n\t\t: `width: 100%; min-width: ${String(minimumWidthPx)}px; table-layout: fixed`;\n\treturn ctx?.styleAttr(declarations) ?? ` style=\"${declarations}\"`;\n}\n\nfunction imageAttrs(image: HTMLImageElement): Record<string, string | number | boolean> {\n\tconst attrs: Record<string, string | number | boolean> = {\n\t\t...inlineImageAttrs(image),\n\t\talign: 'center',\n\t};\n\tfor (const name of ['width', 'height'] as const) {\n\t\tconst value: number = Number.parseFloat(image.getAttribute(name) ?? '');\n\t\tif (Number.isFinite(value) && value > 0) attrs[name] = value;\n\t}\n\treturn attrs;\n}\n\nfunction inlineImageAttrs(image: HTMLImageElement): Record<string, string> {\n\tconst attrs: Record<string, string> = {\n\t\tsrc: image.getAttribute('src') ?? '',\n\t\talt: image.getAttribute('alt') ?? '',\n\t};\n\tconst title: string | null = image.getAttribute('title');\n\tif (title) attrs.title = title;\n\treturn attrs;\n}\n\nfunction registerMarks(registry: SchemaRegistry): void {\n\tconst tagMarks: readonly {\n\t\treadonly type: string;\n\t\treadonly rank: number;\n\t\treadonly tag: string;\n\t\treadonly parseTags: readonly string[];\n\t}[] = [\n\t\t{ type: 'bold', rank: 0, tag: 'strong', parseTags: ['strong', 'b'] },\n\t\t{ type: 'italic', rank: 1, tag: 'em', parseTags: ['em', 'i'] },\n\t\t{ type: 'underline', rank: 2, tag: 'u', parseTags: ['u'] },\n\t\t{ type: 'code', rank: 3, tag: 'code', parseTags: ['code'] },\n\t\t{ type: 'strikethrough', rank: 4, tag: 's', parseTags: ['s', 'strike', 'del'] },\n\t];\n\n\tfor (const mark of tagMarks) {\n\t\tregistry.registerMarkSpec({\n\t\t\ttype: mark.type,\n\t\t\trank: mark.rank,\n\t\t\ttoDOM: htmlOnlyDOM,\n\t\t\ttoHTMLString: (_value, content) => `<${mark.tag}>${content}</${mark.tag}>`,\n\t\t\tparseHTML: mark.parseTags.map((tag) => ({\n\t\t\t\ttag,\n\t\t\t\tgetAttrs:\n\t\t\t\t\ttag === 'code' ? (el) => (el.parentElement?.tagName === 'PRE' ? false : {}) : undefined,\n\t\t\t})),\n\t\t\tsanitize: { tags: mark.parseTags },\n\t\t});\n\t}\n\n\tregistry.registerMarkSpec({\n\t\ttype: 'link',\n\t\trank: 10,\n\t\ttoDOM: htmlOnlyDOM,\n\t\ttoHTMLString(mark, content) {\n\t\t\tconst href: string = escapeAttr(sanitizeHref(String(mark.attrs?.href ?? '')));\n\t\t\tconst title: string = String(mark.attrs?.title ?? '');\n\t\t\tconst titleAttr: string = title ? ` title=\"${escapeAttr(title)}\"` : '';\n\t\t\treturn `<a href=\"${href}\"${titleAttr}>${content}</a>`;\n\t\t},\n\t\tparseHTML: [\n\t\t\t{\n\t\t\t\ttag: 'a',\n\t\t\t\tgetAttrs(el) {\n\t\t\t\t\tconst href: string = sanitizeHref(el.getAttribute('href') ?? '');\n\t\t\t\t\tconst title: string | null = el.getAttribute('title');\n\t\t\t\t\treturn title ? { href, title } : { href };\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t\tsanitize: { tags: ['a'], attrs: ['href', 'title'] },\n\t});\n}\n\nfunction registerInlineNodes(registry: SchemaRegistry): void {\n\tregistry.registerInlineNodeSpec({\n\t\ttype: 'hard_break',\n\t\ttoDOM: htmlOnlyDOM,\n\t\ttoHTMLString: () => '<br>',\n\t\tparseHTML: [{ tag: 'br' }],\n\t\tsanitize: { tags: ['br'] },\n\t});\n\n\tregistry.registerInlineNodeSpec({\n\t\ttype: 'image_inline',\n\t\ttoDOM: htmlOnlyDOM,\n\t\ttoHTMLString(node) {\n\t\t\tconst src: string = escapeAttr(String(node.attrs.src ?? ''));\n\t\t\tconst alt: string = escapeAttr(String(node.attrs.alt ?? ''));\n\t\t\tconst title: string = String(node.attrs.title ?? '');\n\t\t\tconst titleAttr: string = title ? ` title=\"${escapeAttr(title)}\"` : '';\n\t\t\treturn `<img src=\"${src}\" alt=\"${alt}\"${titleAttr}>`;\n\t\t},\n\t\tparseHTML: [{ tag: 'img', getAttrs: (el) => inlineImageAttrs(el as HTMLImageElement) }],\n\t\tsanitize: { tags: ['img'], attrs: ['src', 'alt', 'title'] },\n\t});\n}\n"],"mappings":"8KAmBA,IAAM,EAAgB,8CAGtB,SAAS,EAAS,GACjB,IAAI,EAAY,EAAK,OACjB,EAAE,WAAW,OAAM,EAAI,EAAE,MAAM,IAC/B,EAAE,SAAS,OAAS,EAAE,SAAS,SAAQ,EAAI,EAAE,MAAM,GAAG,IAE1D,MAAM,EAAkB,GACxB,IAAI,EAAU,GACd,IAAK,IAAI,EAAI,EAAG,EAAI,EAAE,OAAQ,IAAK,CAClC,MAAM,EAAa,EAAE,IAAM,GAChB,OAAP,GAA4B,MAAb,EAAE,EAAI,GAKd,MAAP,EAKJ,GAAW,GAJV,EAAM,KAAK,EAAQ,QACnB,EAAU,KANV,GAAW,IACX,IASF,CAEA,OADA,EAAM,KAAK,EAAQ,QACZ,CACR,CAGA,SAAS,EAAU,GAClB,MAAM,EAAkB,EAAK,OACvB,EAAgB,EAAQ,WAAW,KACnC,EAAiB,EAAQ,SAAS,KACxC,OAAI,GAAQ,EAAc,SACtB,EAAc,MACd,EAAa,QACV,IACR,CAUA,SAAgB,EACf,EACA,EACA,GAEA,MAAM,EAAqB,EAAM,IAAU,GACrC,EAAoB,EAAM,EAAQ,IAAM,GAC9C,IAAK,EAAW,SAAS,KAAM,OAAO,KACtC,IAAK,EAAc,KAAK,GAAY,OAAO,KAE3C,MAAM,EAAmB,EAAS,GAC5B,EAAwB,EAAS,GAAW,IAAI,GACtD,GAAI,EAAO,SAAW,EAAO,OAAQ,OAAO,KAE5C,MAAM,EAAmB,GACzB,IAAI,EAAY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