@notectl/core 2.2.1 → 2.2.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 (1279) hide show
  1. package/README.md +2 -0
  2. package/dist/chunks/AlignmentPlugin-h6sx-yIf.mjs +2 -0
  3. package/dist/chunks/AlignmentPlugin-h6sx-yIf.mjs.map +1 -0
  4. package/dist/chunks/AttrRegistry-DcDVyzLm.mjs +2 -0
  5. package/dist/chunks/AttrRegistry-DcDVyzLm.mjs.map +1 -0
  6. package/dist/chunks/AttributedMarkCommands-D4W2Jgpj.mjs +2 -0
  7. package/dist/chunks/AttributedMarkCommands-D4W2Jgpj.mjs.map +1 -0
  8. package/dist/chunks/BidiIsolationPlugin-Bm3h9J15.mjs +2 -0
  9. package/dist/chunks/BidiIsolationPlugin-Bm3h9J15.mjs.map +1 -0
  10. package/dist/chunks/BlockInsertion-6rR9tIGP.mjs +2 -0
  11. package/dist/chunks/BlockInsertion-6rR9tIGP.mjs.map +1 -0
  12. package/dist/chunks/BlockTypePickerRegistry-BTET9jM-.mjs +2 -0
  13. package/dist/chunks/BlockTypePickerRegistry-BTET9jM-.mjs.map +1 -0
  14. package/dist/chunks/BlockquotePlugin-CxrCA0vY.mjs +2 -0
  15. package/dist/chunks/BlockquotePlugin-CxrCA0vY.mjs.map +1 -0
  16. package/dist/chunks/CaretNavigationPlugin-Bb7W_FMg.mjs +2 -0
  17. package/dist/chunks/CaretNavigationPlugin-Bb7W_FMg.mjs.map +1 -0
  18. package/dist/chunks/CodeBlockPlugin-Uv6EXaH1.mjs +2 -0
  19. package/dist/chunks/CodeBlockPlugin-Uv6EXaH1.mjs.map +1 -0
  20. package/dist/chunks/ColorGrid-CXRdpP_n.mjs +2 -0
  21. package/dist/chunks/ColorGrid-CXRdpP_n.mjs.map +1 -0
  22. package/dist/chunks/ColorPickerPopup-C_74bqid.mjs +2 -0
  23. package/dist/chunks/ColorPickerPopup-C_74bqid.mjs.map +1 -0
  24. package/dist/chunks/ColorValidation-DAijTjG9.mjs +2 -0
  25. package/dist/chunks/ColorValidation-DAijTjG9.mjs.map +1 -0
  26. package/dist/chunks/Commands-CyT1Li7_.mjs +2 -0
  27. package/dist/chunks/Commands-CyT1Li7_.mjs.map +1 -0
  28. package/dist/chunks/Decoration-ZeyVfwJB.mjs +2 -0
  29. package/dist/chunks/Decoration-ZeyVfwJB.mjs.map +1 -0
  30. package/dist/chunks/DirectionDetection-C7XE0nxW.mjs +2 -0
  31. package/dist/chunks/DirectionDetection-C7XE0nxW.mjs.map +1 -0
  32. package/dist/chunks/DirectionIcons-Bbawl9ei.mjs +2 -0
  33. package/dist/chunks/DirectionIcons-Bbawl9ei.mjs.map +1 -0
  34. package/dist/chunks/Document-r7vLOAGA.mjs +2 -0
  35. package/dist/chunks/Document-r7vLOAGA.mjs.map +1 -0
  36. package/dist/chunks/DocumentParser-CcTSeT1B.mjs +2 -0
  37. package/dist/chunks/DocumentParser-CcTSeT1B.mjs.map +1 -0
  38. package/dist/chunks/DomUtils-Bf7JLFlx.mjs +2 -0
  39. package/dist/chunks/DomUtils-Bf7JLFlx.mjs.map +1 -0
  40. package/dist/chunks/FontPlugin-1VYDwETg.mjs +2 -0
  41. package/dist/chunks/FontPlugin-1VYDwETg.mjs.map +1 -0
  42. package/dist/chunks/FontSizePlugin-L1uDVsKY.mjs +2 -0
  43. package/dist/chunks/FontSizePlugin-L1uDVsKY.mjs.map +1 -0
  44. package/dist/chunks/FormulaPlugin-UA-9tRpY.mjs +2 -0
  45. package/dist/chunks/FormulaPlugin-UA-9tRpY.mjs.map +1 -0
  46. package/dist/chunks/GapCursorNavigation-ycNzuQVH.mjs +2 -0
  47. package/dist/chunks/GapCursorNavigation-ycNzuQVH.mjs.map +1 -0
  48. package/dist/chunks/GapCursorPlugin-B29ieXel.mjs +2 -0
  49. package/dist/chunks/GapCursorPlugin-B29ieXel.mjs.map +1 -0
  50. package/dist/chunks/HTMLUtils-C6B4UT00.mjs +2 -0
  51. package/dist/chunks/HTMLUtils-C6B4UT00.mjs.map +1 -0
  52. package/dist/chunks/HardBreakPlugin-BkgoJkjC.mjs +2 -0
  53. package/dist/chunks/HardBreakPlugin-BkgoJkjC.mjs.map +1 -0
  54. package/dist/chunks/HeadingPlugin-SICF6Tm0.mjs +2 -0
  55. package/dist/chunks/HeadingPlugin-SICF6Tm0.mjs.map +1 -0
  56. package/dist/chunks/HighlightPlugin-B3b_qe68.mjs +2 -0
  57. package/dist/chunks/HighlightPlugin-B3b_qe68.mjs.map +1 -0
  58. package/dist/chunks/HorizontalRulePlugin-BrFlrpmb.mjs +2 -0
  59. package/dist/chunks/HorizontalRulePlugin-BrFlrpmb.mjs.map +1 -0
  60. package/dist/chunks/ImagePlugin-eRVtFFou.mjs +2 -0
  61. package/dist/chunks/ImagePlugin-eRVtFFou.mjs.map +1 -0
  62. package/dist/chunks/InlineCodePlugin-D3QulApr.mjs +2 -0
  63. package/dist/chunks/InlineCodePlugin-D3QulApr.mjs.map +1 -0
  64. package/dist/chunks/InlineStyleMarkSpec-4R6DC7ij.mjs +2 -0
  65. package/dist/chunks/InlineStyleMarkSpec-4R6DC7ij.mjs.map +1 -0
  66. package/dist/chunks/KeyboardNav-D0my3wuy.mjs +2 -0
  67. package/dist/chunks/KeyboardNav-D0my3wuy.mjs.map +1 -0
  68. package/dist/chunks/LinkPlugin-B_ysjORS.mjs +2 -0
  69. package/dist/chunks/LinkPlugin-B_ysjORS.mjs.map +1 -0
  70. package/dist/chunks/ListPlugin-C0BV8CnQ.mjs +2 -0
  71. package/dist/chunks/ListPlugin-C0BV8CnQ.mjs.map +1 -0
  72. package/dist/chunks/NavigationQueries-Bt4zZ17v.mjs +2 -0
  73. package/dist/chunks/NavigationQueries-Bt4zZ17v.mjs.map +1 -0
  74. package/dist/chunks/NodeResolver-ChgLF_IP.mjs +2 -0
  75. package/dist/chunks/NodeResolver-ChgLF_IP.mjs.map +1 -0
  76. package/dist/chunks/NodeSelectionCommands-Dj4VxLdD.mjs +2 -0
  77. package/dist/chunks/NodeSelectionCommands-Dj4VxLdD.mjs.map +1 -0
  78. package/dist/chunks/NodeSpecPatching-B_yLknTl.mjs +2 -0
  79. package/dist/chunks/NodeSpecPatching-B_yLknTl.mjs.map +1 -0
  80. package/dist/chunks/Platform-ByobkiCc.mjs +2 -0
  81. package/dist/chunks/Platform-ByobkiCc.mjs.map +1 -0
  82. package/dist/chunks/PluginHelpers-D4quRJ5a.mjs +2 -0
  83. package/dist/chunks/PluginHelpers-D4quRJ5a.mjs.map +1 -0
  84. package/dist/chunks/PopupKeyboardPatterns-tUrT9TyV.mjs +2 -0
  85. package/dist/chunks/PopupKeyboardPatterns-tUrT9TyV.mjs.map +1 -0
  86. package/dist/chunks/PopupManager-CyOfZUab.mjs +2 -0
  87. package/dist/chunks/PopupManager-CyOfZUab.mjs.map +1 -0
  88. package/dist/chunks/PopupPositioning-DtUrY9bh.mjs +2 -0
  89. package/dist/chunks/PopupPositioning-DtUrY9bh.mjs.map +1 -0
  90. package/dist/chunks/PrintPlugin-CXDFFzWB.mjs +2 -0
  91. package/dist/chunks/PrintPlugin-CXDFFzWB.mjs.map +1 -0
  92. package/dist/chunks/PrintTypes-WdtgSj74.mjs +2 -0
  93. package/dist/chunks/PrintTypes-WdtgSj74.mjs.map +1 -0
  94. package/dist/chunks/RangeIterator-o8v3msQe.mjs +2 -0
  95. package/dist/chunks/RangeIterator-o8v3msQe.mjs.map +1 -0
  96. package/dist/chunks/Selection-HYoVFpAx.mjs +2 -0
  97. package/dist/chunks/Selection-HYoVFpAx.mjs.map +1 -0
  98. package/dist/chunks/SelectionSync-BSHIw1EE.mjs +2 -0
  99. package/dist/chunks/SelectionSync-BSHIw1EE.mjs.map +1 -0
  100. package/dist/chunks/ShortcutFormatting-TwiufqeV.mjs +2 -0
  101. package/dist/chunks/ShortcutFormatting-TwiufqeV.mjs.map +1 -0
  102. package/dist/chunks/SimpleMark-Db8ir_z2.mjs +2 -0
  103. package/dist/chunks/SimpleMark-Db8ir_z2.mjs.map +1 -0
  104. package/dist/chunks/SmartPastePlugin-Db1RcNJf.mjs +2 -0
  105. package/dist/chunks/SmartPastePlugin-Db1RcNJf.mjs.map +1 -0
  106. package/dist/chunks/StrikethroughPlugin-Bsg7Ma4I.mjs +2 -0
  107. package/dist/chunks/StrikethroughPlugin-Bsg7Ma4I.mjs.map +1 -0
  108. package/dist/chunks/StyleRuntime-BAutwDZT.mjs +2 -0
  109. package/dist/chunks/StyleRuntime-BAutwDZT.mjs.map +1 -0
  110. package/dist/chunks/SuperSubPlugin-ChEga-b_.mjs +2 -0
  111. package/dist/chunks/SuperSubPlugin-ChEga-b_.mjs.map +1 -0
  112. package/dist/chunks/SyntaxTokenTypes-BUCOMtL8.mjs +2 -0
  113. package/dist/chunks/SyntaxTokenTypes-BUCOMtL8.mjs.map +1 -0
  114. package/dist/chunks/TablePlugin-CRp4qSZE.mjs +2 -0
  115. package/dist/chunks/TablePlugin-CRp4qSZE.mjs.map +1 -0
  116. package/dist/chunks/TextColorPlugin-CViEiYZk.mjs +2 -0
  117. package/dist/chunks/TextColorPlugin-CViEiYZk.mjs.map +1 -0
  118. package/dist/chunks/TextDirectionAutoPlugin-CzWJjrvG.mjs +2 -0
  119. package/dist/chunks/TextDirectionAutoPlugin-CzWJjrvG.mjs.map +1 -0
  120. package/dist/chunks/TextDirectionPlugin-CQGkaS2s.mjs +2 -0
  121. package/dist/chunks/TextDirectionPlugin-CQGkaS2s.mjs.map +1 -0
  122. package/dist/chunks/TextDirectionService-OFOU6r_s.mjs +2 -0
  123. package/dist/chunks/TextDirectionService-OFOU6r_s.mjs.map +1 -0
  124. package/dist/chunks/TextFormattingPlugin-Db5SCNOF.mjs +2 -0
  125. package/dist/chunks/TextFormattingPlugin-Db5SCNOF.mjs.map +1 -0
  126. package/dist/chunks/ToolbarPlugin-B5UUc6dY.mjs +2 -0
  127. package/dist/chunks/ToolbarPlugin-B5UUc6dY.mjs.map +1 -0
  128. package/dist/chunks/TypeBrands-Ch9856Gb.mjs +2 -0
  129. package/dist/chunks/TypeBrands-Ch9856Gb.mjs.map +1 -0
  130. package/dist/chunks/TypedKeys-CA4bfw9O.mjs +2 -0
  131. package/dist/chunks/TypedKeys-CA4bfw9O.mjs.map +1 -0
  132. package/dist/chunks/VideoPlugin-mXIDODzC.mjs +2 -0
  133. package/dist/chunks/VideoPlugin-mXIDODzC.mjs.map +1 -0
  134. package/dist/chunks/WordBoundary-DxeMBRyP.mjs +2 -0
  135. package/dist/chunks/WordBoundary-DxeMBRyP.mjs.map +1 -0
  136. package/dist/chunks/XmlDetector-D7TQpw-e.mjs +2 -0
  137. package/dist/chunks/XmlDetector-D7TQpw-e.mjs.map +1 -0
  138. package/dist/chunks/XmlPatterns-RN32-0ob.mjs +2 -0
  139. package/dist/chunks/XmlPatterns-RN32-0ob.mjs.map +1 -0
  140. package/dist/chunks/XmlSupport-BYiRwlkK.mjs +2 -0
  141. package/dist/chunks/XmlSupport-BYiRwlkK.mjs.map +1 -0
  142. package/dist/chunks/ar--Isa9OHJ.mjs +2 -0
  143. package/dist/chunks/ar--Isa9OHJ.mjs.map +1 -0
  144. package/dist/chunks/ar--O0A9OTR.mjs +2 -0
  145. package/dist/chunks/ar--O0A9OTR.mjs.map +1 -0
  146. package/dist/chunks/ar-0g2bmXTn.mjs +2 -0
  147. package/dist/chunks/ar-0g2bmXTn.mjs.map +1 -0
  148. package/dist/chunks/ar-4b8e2YSc.mjs +2 -0
  149. package/dist/chunks/ar-4b8e2YSc.mjs.map +1 -0
  150. package/dist/chunks/ar-B03uY4xr.mjs +2 -0
  151. package/dist/chunks/ar-B03uY4xr.mjs.map +1 -0
  152. package/dist/chunks/ar-BAfInw85.mjs +2 -0
  153. package/dist/chunks/ar-BAfInw85.mjs.map +1 -0
  154. package/dist/chunks/ar-BRX5E_Pw.mjs +2 -0
  155. package/dist/chunks/ar-BRX5E_Pw.mjs.map +1 -0
  156. package/dist/chunks/ar-BTShmP2E.mjs +2 -0
  157. package/dist/chunks/ar-BTShmP2E.mjs.map +1 -0
  158. package/dist/chunks/ar-BWOue6jG.mjs +2 -0
  159. package/dist/chunks/ar-BWOue6jG.mjs.map +1 -0
  160. package/dist/chunks/ar-Bdmunk5h.mjs +2 -0
  161. package/dist/chunks/ar-Bdmunk5h.mjs.map +1 -0
  162. package/dist/chunks/ar-BwaoCUVN.mjs +2 -0
  163. package/dist/chunks/ar-BwaoCUVN.mjs.map +1 -0
  164. package/dist/chunks/ar-BzqAYGER.mjs +2 -0
  165. package/dist/chunks/ar-BzqAYGER.mjs.map +1 -0
  166. package/dist/chunks/ar-C9lO1jsY.mjs +2 -0
  167. package/dist/chunks/ar-C9lO1jsY.mjs.map +1 -0
  168. package/dist/chunks/ar-CMXjVzFx.mjs +2 -0
  169. package/dist/chunks/ar-CMXjVzFx.mjs.map +1 -0
  170. package/dist/chunks/ar-CR6UdFL9.mjs +2 -0
  171. package/dist/chunks/ar-CR6UdFL9.mjs.map +1 -0
  172. package/dist/chunks/ar-CrOb0jL2.mjs +2 -0
  173. package/dist/chunks/ar-CrOb0jL2.mjs.map +1 -0
  174. package/dist/chunks/ar-Ctrv6cIi.mjs +2 -0
  175. package/dist/chunks/ar-Ctrv6cIi.mjs.map +1 -0
  176. package/dist/chunks/ar-Cy_77yRf.mjs +2 -0
  177. package/dist/chunks/ar-Cy_77yRf.mjs.map +1 -0
  178. package/dist/chunks/ar-D1jFXqLJ.mjs +2 -0
  179. package/dist/chunks/ar-D1jFXqLJ.mjs.map +1 -0
  180. package/dist/chunks/ar-DahJwMI9.mjs +2 -0
  181. package/dist/chunks/ar-DahJwMI9.mjs.map +1 -0
  182. package/dist/chunks/ar-Dcl3kgtd.mjs +2 -0
  183. package/dist/chunks/ar-Dcl3kgtd.mjs.map +1 -0
  184. package/dist/chunks/ar-Dx2lO0Nm.mjs +2 -0
  185. package/dist/chunks/ar-Dx2lO0Nm.mjs.map +1 -0
  186. package/dist/chunks/ar-NV_puwI2.mjs +2 -0
  187. package/dist/chunks/ar-NV_puwI2.mjs.map +1 -0
  188. package/dist/chunks/ar-Uzo1Azdw.mjs +2 -0
  189. package/dist/chunks/ar-Uzo1Azdw.mjs.map +1 -0
  190. package/dist/chunks/ar-XmSFrtmd.mjs +2 -0
  191. package/dist/chunks/ar-XmSFrtmd.mjs.map +1 -0
  192. package/dist/chunks/ar-jbplYWkC.mjs +2 -0
  193. package/dist/chunks/ar-jbplYWkC.mjs.map +1 -0
  194. package/dist/chunks/ar-sGZ-oZqB.mjs +2 -0
  195. package/dist/chunks/ar-sGZ-oZqB.mjs.map +1 -0
  196. package/dist/chunks/color-picker-C9B2rYw-.mjs +2 -0
  197. package/dist/chunks/color-picker-C9B2rYw-.mjs.map +1 -0
  198. package/dist/chunks/de-B8-w9gPi.mjs +2 -0
  199. package/dist/chunks/de-B8-w9gPi.mjs.map +1 -0
  200. package/dist/chunks/de-B9zSHWqY.mjs +2 -0
  201. package/dist/chunks/de-B9zSHWqY.mjs.map +1 -0
  202. package/dist/chunks/de-BX4y4PlH.mjs +2 -0
  203. package/dist/chunks/de-BX4y4PlH.mjs.map +1 -0
  204. package/dist/chunks/de-BXQBXxFJ.mjs +2 -0
  205. package/dist/chunks/de-BXQBXxFJ.mjs.map +1 -0
  206. package/dist/chunks/de-BcPntcnr.mjs +2 -0
  207. package/dist/chunks/de-BcPntcnr.mjs.map +1 -0
  208. package/dist/chunks/de-BdD3DpUB.mjs +2 -0
  209. package/dist/chunks/de-BdD3DpUB.mjs.map +1 -0
  210. package/dist/chunks/de-Bwxlcuee.mjs +2 -0
  211. package/dist/chunks/de-Bwxlcuee.mjs.map +1 -0
  212. package/dist/chunks/de-BxQIt_1Y.mjs +2 -0
  213. package/dist/chunks/de-BxQIt_1Y.mjs.map +1 -0
  214. package/dist/chunks/de-C--bRmjW.mjs +2 -0
  215. package/dist/chunks/de-C--bRmjW.mjs.map +1 -0
  216. package/dist/chunks/de-C-Yf378-.mjs +2 -0
  217. package/dist/chunks/de-C-Yf378-.mjs.map +1 -0
  218. package/dist/chunks/de-C7uehgMu.mjs +2 -0
  219. package/dist/chunks/de-C7uehgMu.mjs.map +1 -0
  220. package/dist/chunks/de-C9ZhDqPi.mjs +2 -0
  221. package/dist/chunks/de-C9ZhDqPi.mjs.map +1 -0
  222. package/dist/chunks/de-CHcv_Vmf.mjs +2 -0
  223. package/dist/chunks/de-CHcv_Vmf.mjs.map +1 -0
  224. package/dist/chunks/de-CTzAMkXC.mjs +2 -0
  225. package/dist/chunks/de-CTzAMkXC.mjs.map +1 -0
  226. package/dist/chunks/de-CaeEIyzV.mjs +2 -0
  227. package/dist/chunks/de-CaeEIyzV.mjs.map +1 -0
  228. package/dist/chunks/de-DHs9i4af.mjs +2 -0
  229. package/dist/chunks/de-DHs9i4af.mjs.map +1 -0
  230. package/dist/chunks/de-DN-e6G5A.mjs +2 -0
  231. package/dist/chunks/de-DN-e6G5A.mjs.map +1 -0
  232. package/dist/chunks/de-DViI26lG.mjs +2 -0
  233. package/dist/chunks/de-DViI26lG.mjs.map +1 -0
  234. package/dist/chunks/de-DY3obIAF.mjs +2 -0
  235. package/dist/chunks/de-DY3obIAF.mjs.map +1 -0
  236. package/dist/chunks/de-DcMhfRBu.mjs +2 -0
  237. package/dist/chunks/de-DcMhfRBu.mjs.map +1 -0
  238. package/dist/chunks/de-DiPz7abS.mjs +2 -0
  239. package/dist/chunks/de-DiPz7abS.mjs.map +1 -0
  240. package/dist/chunks/de-Dl4QFHMa.mjs +2 -0
  241. package/dist/chunks/de-Dl4QFHMa.mjs.map +1 -0
  242. package/dist/chunks/de-JhGflzS5.mjs +2 -0
  243. package/dist/chunks/de-JhGflzS5.mjs.map +1 -0
  244. package/dist/chunks/de-XCCpWyg0.mjs +2 -0
  245. package/dist/chunks/de-XCCpWyg0.mjs.map +1 -0
  246. package/dist/chunks/de-e6J6nvAD.mjs +2 -0
  247. package/dist/chunks/de-e6J6nvAD.mjs.map +1 -0
  248. package/dist/chunks/de-i95F9SDy.mjs +2 -0
  249. package/dist/chunks/de-i95F9SDy.mjs.map +1 -0
  250. package/dist/chunks/de-uKR7koQe.mjs +2 -0
  251. package/dist/chunks/de-uKR7koQe.mjs.map +1 -0
  252. package/dist/chunks/es-B0Za939C.mjs +2 -0
  253. package/dist/chunks/es-B0Za939C.mjs.map +1 -0
  254. package/dist/chunks/es-B8K3Yvf3.mjs +2 -0
  255. package/dist/chunks/es-B8K3Yvf3.mjs.map +1 -0
  256. package/dist/chunks/es-BIXm2Coj.mjs +2 -0
  257. package/dist/chunks/es-BIXm2Coj.mjs.map +1 -0
  258. package/dist/chunks/es-BJHF95J_.mjs +2 -0
  259. package/dist/chunks/es-BJHF95J_.mjs.map +1 -0
  260. package/dist/chunks/es-BMm9kqjC.mjs +2 -0
  261. package/dist/chunks/es-BMm9kqjC.mjs.map +1 -0
  262. package/dist/chunks/es-BQweZX6P.mjs +2 -0
  263. package/dist/chunks/es-BQweZX6P.mjs.map +1 -0
  264. package/dist/chunks/es-BdpTTRuX.mjs +2 -0
  265. package/dist/chunks/es-BdpTTRuX.mjs.map +1 -0
  266. package/dist/chunks/es-Bv7bDbMp.mjs +2 -0
  267. package/dist/chunks/es-Bv7bDbMp.mjs.map +1 -0
  268. package/dist/chunks/es-C7uVqFYr.mjs +2 -0
  269. package/dist/chunks/es-C7uVqFYr.mjs.map +1 -0
  270. package/dist/chunks/es-CCQFu1t1.mjs +2 -0
  271. package/dist/chunks/es-CCQFu1t1.mjs.map +1 -0
  272. package/dist/chunks/es-CM55WeEN.mjs +2 -0
  273. package/dist/chunks/es-CM55WeEN.mjs.map +1 -0
  274. package/dist/chunks/es-CUKJujcb.mjs +2 -0
  275. package/dist/chunks/es-CUKJujcb.mjs.map +1 -0
  276. package/dist/chunks/es-CXuMz87y.mjs +2 -0
  277. package/dist/chunks/es-CXuMz87y.mjs.map +1 -0
  278. package/dist/chunks/es-CgMfhkJJ.mjs +2 -0
  279. package/dist/chunks/es-CgMfhkJJ.mjs.map +1 -0
  280. package/dist/chunks/es-CtOtKQCP.mjs +2 -0
  281. package/dist/chunks/es-CtOtKQCP.mjs.map +1 -0
  282. package/dist/chunks/es-DD01rZ6N.mjs +2 -0
  283. package/dist/chunks/es-DD01rZ6N.mjs.map +1 -0
  284. package/dist/chunks/es-DDoqchUq.mjs +2 -0
  285. package/dist/chunks/es-DDoqchUq.mjs.map +1 -0
  286. package/dist/chunks/es-DFUVd7eO.mjs +2 -0
  287. package/dist/chunks/es-DFUVd7eO.mjs.map +1 -0
  288. package/dist/chunks/es-DFokqQst.mjs +2 -0
  289. package/dist/chunks/es-DFokqQst.mjs.map +1 -0
  290. package/dist/chunks/es-DHxdoEzR.mjs +2 -0
  291. package/dist/chunks/es-DHxdoEzR.mjs.map +1 -0
  292. package/dist/chunks/es-DehVGwQ8.mjs +2 -0
  293. package/dist/chunks/es-DehVGwQ8.mjs.map +1 -0
  294. package/dist/chunks/es-DrJyl38L.mjs +2 -0
  295. package/dist/chunks/es-DrJyl38L.mjs.map +1 -0
  296. package/dist/chunks/es-fTW0TkYV.mjs +2 -0
  297. package/dist/chunks/es-fTW0TkYV.mjs.map +1 -0
  298. package/dist/chunks/es-kfKiqpyD.mjs +2 -0
  299. package/dist/chunks/es-kfKiqpyD.mjs.map +1 -0
  300. package/dist/chunks/es-nRLq7bgP.mjs +2 -0
  301. package/dist/chunks/es-nRLq7bgP.mjs.map +1 -0
  302. package/dist/chunks/es-paXY7HFt.mjs +2 -0
  303. package/dist/chunks/es-paXY7HFt.mjs.map +1 -0
  304. package/dist/chunks/es-xuahrvJN.mjs +2 -0
  305. package/dist/chunks/es-xuahrvJN.mjs.map +1 -0
  306. package/dist/chunks/fonts-DQC6Uj4r.mjs +2 -0
  307. package/dist/chunks/fonts-DQC6Uj4r.mjs.map +1 -0
  308. package/dist/chunks/fr-0qEo3bRP.mjs +2 -0
  309. package/dist/chunks/fr-0qEo3bRP.mjs.map +1 -0
  310. package/dist/chunks/fr-5HkMazAf.mjs +2 -0
  311. package/dist/chunks/fr-5HkMazAf.mjs.map +1 -0
  312. package/dist/chunks/fr-B9pBLaVx.mjs +2 -0
  313. package/dist/chunks/fr-B9pBLaVx.mjs.map +1 -0
  314. package/dist/chunks/fr-BRXUnq3R.mjs +2 -0
  315. package/dist/chunks/fr-BRXUnq3R.mjs.map +1 -0
  316. package/dist/chunks/fr-BSUKEtTk.mjs +2 -0
  317. package/dist/chunks/fr-BSUKEtTk.mjs.map +1 -0
  318. package/dist/chunks/fr-BaXKyPmX.mjs +2 -0
  319. package/dist/chunks/fr-BaXKyPmX.mjs.map +1 -0
  320. package/dist/chunks/fr-BeRlON1t.mjs +2 -0
  321. package/dist/chunks/fr-BeRlON1t.mjs.map +1 -0
  322. package/dist/chunks/fr-Bg937iAy.mjs +2 -0
  323. package/dist/chunks/fr-Bg937iAy.mjs.map +1 -0
  324. package/dist/chunks/fr-BwWrFThE.mjs +2 -0
  325. package/dist/chunks/fr-BwWrFThE.mjs.map +1 -0
  326. package/dist/chunks/fr-C3EKRThN.mjs +2 -0
  327. package/dist/chunks/fr-C3EKRThN.mjs.map +1 -0
  328. package/dist/chunks/fr-CKjH6tJI.mjs +2 -0
  329. package/dist/chunks/fr-CKjH6tJI.mjs.map +1 -0
  330. package/dist/chunks/fr-CQs0-pNX.mjs +2 -0
  331. package/dist/chunks/fr-CQs0-pNX.mjs.map +1 -0
  332. package/dist/chunks/fr-C_2i5Ono.mjs +2 -0
  333. package/dist/chunks/fr-C_2i5Ono.mjs.map +1 -0
  334. package/dist/chunks/fr-CfhyYN-t.mjs +2 -0
  335. package/dist/chunks/fr-CfhyYN-t.mjs.map +1 -0
  336. package/dist/chunks/fr-D0MDdoir.mjs +2 -0
  337. package/dist/chunks/fr-D0MDdoir.mjs.map +1 -0
  338. package/dist/chunks/fr-D5ulA3Z6.mjs +2 -0
  339. package/dist/chunks/fr-D5ulA3Z6.mjs.map +1 -0
  340. package/dist/chunks/fr-DEZ_oxzS.mjs +2 -0
  341. package/dist/chunks/fr-DEZ_oxzS.mjs.map +1 -0
  342. package/dist/chunks/fr-DciSEykY.mjs +2 -0
  343. package/dist/chunks/fr-DciSEykY.mjs.map +1 -0
  344. package/dist/chunks/fr-DiDhVhyV.mjs +2 -0
  345. package/dist/chunks/fr-DiDhVhyV.mjs.map +1 -0
  346. package/dist/chunks/fr-DjMZ-3K5.mjs +2 -0
  347. package/dist/chunks/fr-DjMZ-3K5.mjs.map +1 -0
  348. package/dist/chunks/fr-DtzIu6tU.mjs +2 -0
  349. package/dist/chunks/fr-DtzIu6tU.mjs.map +1 -0
  350. package/dist/chunks/fr-F2ZrfVaF.mjs +2 -0
  351. package/dist/chunks/fr-F2ZrfVaF.mjs.map +1 -0
  352. package/dist/chunks/fr-KXmbys88.mjs +2 -0
  353. package/dist/chunks/fr-KXmbys88.mjs.map +1 -0
  354. package/dist/chunks/fr-SbpHNrQ-.mjs +2 -0
  355. package/dist/chunks/fr-SbpHNrQ-.mjs.map +1 -0
  356. package/dist/chunks/fr-ZsRdLuys.mjs +2 -0
  357. package/dist/chunks/fr-ZsRdLuys.mjs.map +1 -0
  358. package/dist/chunks/fr-eC0UdAPu.mjs +2 -0
  359. package/dist/chunks/fr-eC0UdAPu.mjs.map +1 -0
  360. package/dist/chunks/fr-fshsDD66.mjs +2 -0
  361. package/dist/chunks/fr-fshsDD66.mjs.map +1 -0
  362. package/dist/chunks/full--GEBZ2xU.mjs +2 -0
  363. package/dist/chunks/full--GEBZ2xU.mjs.map +1 -0
  364. package/dist/chunks/hi-4CiAKVjT.mjs +2 -0
  365. package/dist/chunks/hi-4CiAKVjT.mjs.map +1 -0
  366. package/dist/chunks/hi-B-ZuX4aN.mjs +2 -0
  367. package/dist/chunks/hi-B-ZuX4aN.mjs.map +1 -0
  368. package/dist/chunks/hi-B2YB3Bo4.mjs +2 -0
  369. package/dist/chunks/hi-B2YB3Bo4.mjs.map +1 -0
  370. package/dist/chunks/hi-B2uhiPCN.mjs +2 -0
  371. package/dist/chunks/hi-B2uhiPCN.mjs.map +1 -0
  372. package/dist/chunks/hi-B5cl8TWK.mjs +2 -0
  373. package/dist/chunks/hi-B5cl8TWK.mjs.map +1 -0
  374. package/dist/chunks/hi-BNJIGWQQ.mjs +2 -0
  375. package/dist/chunks/hi-BNJIGWQQ.mjs.map +1 -0
  376. package/dist/chunks/hi-BOMkDPqC.mjs +2 -0
  377. package/dist/chunks/hi-BOMkDPqC.mjs.map +1 -0
  378. package/dist/chunks/hi-Bl-yeeOI.mjs +2 -0
  379. package/dist/chunks/hi-Bl-yeeOI.mjs.map +1 -0
  380. package/dist/chunks/hi-Bu799xIO.mjs +2 -0
  381. package/dist/chunks/hi-Bu799xIO.mjs.map +1 -0
  382. package/dist/chunks/hi-By8YwVIX.mjs +2 -0
  383. package/dist/chunks/hi-By8YwVIX.mjs.map +1 -0
  384. package/dist/chunks/hi-BzbMD_cP.mjs +2 -0
  385. package/dist/chunks/hi-BzbMD_cP.mjs.map +1 -0
  386. package/dist/chunks/hi-C2jEsf8v.mjs +2 -0
  387. package/dist/chunks/hi-C2jEsf8v.mjs.map +1 -0
  388. package/dist/chunks/hi-C9fvG91d.mjs +2 -0
  389. package/dist/chunks/hi-C9fvG91d.mjs.map +1 -0
  390. package/dist/chunks/hi-CTWubxLY.mjs +2 -0
  391. package/dist/chunks/hi-CTWubxLY.mjs.map +1 -0
  392. package/dist/chunks/hi-CoclKAUM.mjs +2 -0
  393. package/dist/chunks/hi-CoclKAUM.mjs.map +1 -0
  394. package/dist/chunks/hi-CrmakMVj.mjs +2 -0
  395. package/dist/chunks/hi-CrmakMVj.mjs.map +1 -0
  396. package/dist/chunks/hi-DWX6k5ZD.mjs +2 -0
  397. package/dist/chunks/hi-DWX6k5ZD.mjs.map +1 -0
  398. package/dist/chunks/hi-DY55FuDK.mjs +2 -0
  399. package/dist/chunks/hi-DY55FuDK.mjs.map +1 -0
  400. package/dist/chunks/hi-DsdXcOB6.mjs +2 -0
  401. package/dist/chunks/hi-DsdXcOB6.mjs.map +1 -0
  402. package/dist/chunks/hi-Dt89SxNy.mjs +2 -0
  403. package/dist/chunks/hi-Dt89SxNy.mjs.map +1 -0
  404. package/dist/chunks/hi-J8ErB5nB.mjs +2 -0
  405. package/dist/chunks/hi-J8ErB5nB.mjs.map +1 -0
  406. package/dist/chunks/hi-L6pJxZam.mjs +2 -0
  407. package/dist/chunks/hi-L6pJxZam.mjs.map +1 -0
  408. package/dist/chunks/hi-SECtQQzq.mjs +2 -0
  409. package/dist/chunks/hi-SECtQQzq.mjs.map +1 -0
  410. package/dist/chunks/hi-aH9HZG23.mjs +2 -0
  411. package/dist/chunks/hi-aH9HZG23.mjs.map +1 -0
  412. package/dist/chunks/hi-j3TDLMYd.mjs +2 -0
  413. package/dist/chunks/hi-j3TDLMYd.mjs.map +1 -0
  414. package/dist/chunks/hi-l6DA-aOw.mjs +2 -0
  415. package/dist/chunks/hi-l6DA-aOw.mjs.map +1 -0
  416. package/dist/chunks/hi-uACJUw53.mjs +2 -0
  417. package/dist/chunks/hi-uACJUw53.mjs.map +1 -0
  418. package/dist/chunks/minimal-D5v-raei.mjs +2 -0
  419. package/dist/chunks/minimal-D5v-raei.mjs.map +1 -0
  420. package/dist/chunks/pt-5VeuNDd2.mjs +2 -0
  421. package/dist/chunks/pt-5VeuNDd2.mjs.map +1 -0
  422. package/dist/chunks/pt-BCXgUDiU.mjs +2 -0
  423. package/dist/chunks/pt-BCXgUDiU.mjs.map +1 -0
  424. package/dist/chunks/pt-BDam9cDu.mjs +2 -0
  425. package/dist/chunks/pt-BDam9cDu.mjs.map +1 -0
  426. package/dist/chunks/pt-Bb908r0n.mjs +2 -0
  427. package/dist/chunks/pt-Bb908r0n.mjs.map +1 -0
  428. package/dist/chunks/pt-BkpVtod-.mjs +2 -0
  429. package/dist/chunks/pt-BkpVtod-.mjs.map +1 -0
  430. package/dist/chunks/pt-BlFAJZo7.mjs +2 -0
  431. package/dist/chunks/pt-BlFAJZo7.mjs.map +1 -0
  432. package/dist/chunks/pt-Bu7Mbz67.mjs +2 -0
  433. package/dist/chunks/pt-Bu7Mbz67.mjs.map +1 -0
  434. package/dist/chunks/pt-C8sOyw0V.mjs +2 -0
  435. package/dist/chunks/pt-C8sOyw0V.mjs.map +1 -0
  436. package/dist/chunks/pt-CEUgbrii.mjs +2 -0
  437. package/dist/chunks/pt-CEUgbrii.mjs.map +1 -0
  438. package/dist/chunks/pt-CMrFpUWS.mjs +2 -0
  439. package/dist/chunks/pt-CMrFpUWS.mjs.map +1 -0
  440. package/dist/chunks/pt-CMx2wPPY.mjs +2 -0
  441. package/dist/chunks/pt-CMx2wPPY.mjs.map +1 -0
  442. package/dist/chunks/pt-CR4j8gtE.mjs +2 -0
  443. package/dist/chunks/pt-CR4j8gtE.mjs.map +1 -0
  444. package/dist/chunks/pt-Cc4zysaT.mjs +2 -0
  445. package/dist/chunks/pt-Cc4zysaT.mjs.map +1 -0
  446. package/dist/chunks/pt-Cv6q7x5x.mjs +2 -0
  447. package/dist/chunks/pt-Cv6q7x5x.mjs.map +1 -0
  448. package/dist/chunks/pt-DFKJVh7k.mjs +2 -0
  449. package/dist/chunks/pt-DFKJVh7k.mjs.map +1 -0
  450. package/dist/chunks/pt-DYMyMgKQ.mjs +2 -0
  451. package/dist/chunks/pt-DYMyMgKQ.mjs.map +1 -0
  452. package/dist/chunks/pt-D__tcM2T.mjs +2 -0
  453. package/dist/chunks/pt-D__tcM2T.mjs.map +1 -0
  454. package/dist/chunks/pt-Dg2ctkug.mjs +2 -0
  455. package/dist/chunks/pt-Dg2ctkug.mjs.map +1 -0
  456. package/dist/chunks/pt-DgfMoLWR.mjs +2 -0
  457. package/dist/chunks/pt-DgfMoLWR.mjs.map +1 -0
  458. package/dist/chunks/pt-DmN9u3NX.mjs +2 -0
  459. package/dist/chunks/pt-DmN9u3NX.mjs.map +1 -0
  460. package/dist/chunks/pt-GqLw5tN0.mjs +2 -0
  461. package/dist/chunks/pt-GqLw5tN0.mjs.map +1 -0
  462. package/dist/chunks/pt-Hy-0Xnnc.mjs +2 -0
  463. package/dist/chunks/pt-Hy-0Xnnc.mjs.map +1 -0
  464. package/dist/chunks/pt-OXa_IR4Q.mjs +2 -0
  465. package/dist/chunks/pt-OXa_IR4Q.mjs.map +1 -0
  466. package/dist/chunks/pt-UPF7DBlz.mjs +2 -0
  467. package/dist/chunks/pt-UPF7DBlz.mjs.map +1 -0
  468. package/dist/chunks/pt-_qxIe7zX.mjs +2 -0
  469. package/dist/chunks/pt-_qxIe7zX.mjs.map +1 -0
  470. package/dist/chunks/pt-paXY7HFt.mjs +2 -0
  471. package/dist/chunks/pt-paXY7HFt.mjs.map +1 -0
  472. package/dist/chunks/pt-zMHcNGPk.mjs +2 -0
  473. package/dist/chunks/pt-zMHcNGPk.mjs.map +1 -0
  474. package/dist/chunks/ru-4g_qsaLr.mjs +2 -0
  475. package/dist/chunks/ru-4g_qsaLr.mjs.map +1 -0
  476. package/dist/chunks/ru-B1m8J9dl.mjs +2 -0
  477. package/dist/chunks/ru-B1m8J9dl.mjs.map +1 -0
  478. package/dist/chunks/ru-BFpEOrVp.mjs +2 -0
  479. package/dist/chunks/ru-BFpEOrVp.mjs.map +1 -0
  480. package/dist/chunks/ru-BNPUT-3S.mjs +2 -0
  481. package/dist/chunks/ru-BNPUT-3S.mjs.map +1 -0
  482. package/dist/chunks/ru-BotG0MFT.mjs +2 -0
  483. package/dist/chunks/ru-BotG0MFT.mjs.map +1 -0
  484. package/dist/chunks/ru-BxySx7an.mjs +2 -0
  485. package/dist/chunks/ru-BxySx7an.mjs.map +1 -0
  486. package/dist/chunks/ru-C-APN_dm.mjs +2 -0
  487. package/dist/chunks/ru-C-APN_dm.mjs.map +1 -0
  488. package/dist/chunks/ru-C9yFslEG.mjs +2 -0
  489. package/dist/chunks/ru-C9yFslEG.mjs.map +1 -0
  490. package/dist/chunks/ru-CkG_bpfo.mjs +2 -0
  491. package/dist/chunks/ru-CkG_bpfo.mjs.map +1 -0
  492. package/dist/chunks/ru-Cs8KCNyq.mjs +2 -0
  493. package/dist/chunks/ru-Cs8KCNyq.mjs.map +1 -0
  494. package/dist/chunks/ru-CvDl-yEd.mjs +2 -0
  495. package/dist/chunks/ru-CvDl-yEd.mjs.map +1 -0
  496. package/dist/chunks/ru-CwyPz2Va.mjs +2 -0
  497. package/dist/chunks/ru-CwyPz2Va.mjs.map +1 -0
  498. package/dist/chunks/ru-D53d-_UB.mjs +2 -0
  499. package/dist/chunks/ru-D53d-_UB.mjs.map +1 -0
  500. package/dist/chunks/ru-DJMpeuey.mjs +2 -0
  501. package/dist/chunks/ru-DJMpeuey.mjs.map +1 -0
  502. package/dist/chunks/ru-DSRv3_Rg.mjs +2 -0
  503. package/dist/chunks/ru-DSRv3_Rg.mjs.map +1 -0
  504. package/dist/chunks/ru-DV-lgEtM.mjs +2 -0
  505. package/dist/chunks/ru-DV-lgEtM.mjs.map +1 -0
  506. package/dist/chunks/ru-DiwQV30V.mjs +2 -0
  507. package/dist/chunks/ru-DiwQV30V.mjs.map +1 -0
  508. package/dist/chunks/ru-DkW9XZFy.mjs +2 -0
  509. package/dist/chunks/ru-DkW9XZFy.mjs.map +1 -0
  510. package/dist/chunks/ru-DyCTlhjg.mjs +2 -0
  511. package/dist/chunks/ru-DyCTlhjg.mjs.map +1 -0
  512. package/dist/chunks/ru-QGX8lOTs.mjs +2 -0
  513. package/dist/chunks/ru-QGX8lOTs.mjs.map +1 -0
  514. package/dist/chunks/ru-QcTo2yoL.mjs +2 -0
  515. package/dist/chunks/ru-QcTo2yoL.mjs.map +1 -0
  516. package/dist/chunks/ru-Y11wuxOB.mjs +2 -0
  517. package/dist/chunks/ru-Y11wuxOB.mjs.map +1 -0
  518. package/dist/chunks/ru-Yngw7nFP.mjs +2 -0
  519. package/dist/chunks/ru-Yngw7nFP.mjs.map +1 -0
  520. package/dist/chunks/ru-d68SZpEe.mjs +2 -0
  521. package/dist/chunks/ru-d68SZpEe.mjs.map +1 -0
  522. package/dist/chunks/ru-k7o3Qks3.mjs +2 -0
  523. package/dist/chunks/ru-k7o3Qks3.mjs.map +1 -0
  524. package/dist/chunks/ru-l73diFXn.mjs +2 -0
  525. package/dist/chunks/ru-l73diFXn.mjs.map +1 -0
  526. package/dist/chunks/ru-q8kz-237.mjs +2 -0
  527. package/dist/chunks/ru-q8kz-237.mjs.map +1 -0
  528. package/dist/chunks/src-C5Lblp2i.mjs +2 -0
  529. package/dist/chunks/src-C5Lblp2i.mjs.map +1 -0
  530. package/dist/chunks/zh-BGYJXxVl.mjs +2 -0
  531. package/dist/chunks/zh-BGYJXxVl.mjs.map +1 -0
  532. package/dist/chunks/zh-BP97XjlS.mjs +2 -0
  533. package/dist/chunks/zh-BP97XjlS.mjs.map +1 -0
  534. package/dist/chunks/zh-BQ73oqxc.mjs +2 -0
  535. package/dist/chunks/zh-BQ73oqxc.mjs.map +1 -0
  536. package/dist/chunks/zh-BQqf3wJZ.mjs +2 -0
  537. package/dist/chunks/zh-BQqf3wJZ.mjs.map +1 -0
  538. package/dist/chunks/zh-Baxh6v0j.mjs +2 -0
  539. package/dist/chunks/zh-Baxh6v0j.mjs.map +1 -0
  540. package/dist/chunks/zh-BjoyjClN.mjs +2 -0
  541. package/dist/chunks/zh-BjoyjClN.mjs.map +1 -0
  542. package/dist/chunks/zh-BvuAbM2S.mjs +2 -0
  543. package/dist/chunks/zh-BvuAbM2S.mjs.map +1 -0
  544. package/dist/chunks/zh-C-wHnDo5.mjs +2 -0
  545. package/dist/chunks/zh-C-wHnDo5.mjs.map +1 -0
  546. package/dist/chunks/zh-C7iCgCRP.mjs +2 -0
  547. package/dist/chunks/zh-C7iCgCRP.mjs.map +1 -0
  548. package/dist/chunks/zh-CRsDvfPR.mjs +2 -0
  549. package/dist/chunks/zh-CRsDvfPR.mjs.map +1 -0
  550. package/dist/chunks/zh-CWGAPVei.mjs +2 -0
  551. package/dist/chunks/zh-CWGAPVei.mjs.map +1 -0
  552. package/dist/chunks/zh-CWIzJcXi.mjs +2 -0
  553. package/dist/chunks/zh-CWIzJcXi.mjs.map +1 -0
  554. package/dist/chunks/zh-CYV-db-K.mjs +2 -0
  555. package/dist/chunks/zh-CYV-db-K.mjs.map +1 -0
  556. package/dist/chunks/zh-CnW44JEw.mjs +2 -0
  557. package/dist/chunks/zh-CnW44JEw.mjs.map +1 -0
  558. package/dist/chunks/zh-D1HSmSOf.mjs +2 -0
  559. package/dist/chunks/zh-D1HSmSOf.mjs.map +1 -0
  560. package/dist/chunks/zh-DWN1Jqn3.mjs +2 -0
  561. package/dist/chunks/zh-DWN1Jqn3.mjs.map +1 -0
  562. package/dist/chunks/zh-DYD476c5.mjs +2 -0
  563. package/dist/chunks/zh-DYD476c5.mjs.map +1 -0
  564. package/dist/chunks/zh-DdzgYD7k.mjs +2 -0
  565. package/dist/chunks/zh-DdzgYD7k.mjs.map +1 -0
  566. package/dist/chunks/zh-DeZP08HI.mjs +2 -0
  567. package/dist/chunks/zh-DeZP08HI.mjs.map +1 -0
  568. package/dist/chunks/zh-DgSmvLyw.mjs +2 -0
  569. package/dist/chunks/zh-DgSmvLyw.mjs.map +1 -0
  570. package/dist/chunks/zh-DlVfQn4z.mjs +2 -0
  571. package/dist/chunks/zh-DlVfQn4z.mjs.map +1 -0
  572. package/dist/chunks/zh-DuucmOns.mjs +2 -0
  573. package/dist/chunks/zh-DuucmOns.mjs.map +1 -0
  574. package/dist/chunks/zh-Oj-qSUEp.mjs +2 -0
  575. package/dist/chunks/zh-Oj-qSUEp.mjs.map +1 -0
  576. package/dist/chunks/zh-YfuE_m2y.mjs +2 -0
  577. package/dist/chunks/zh-YfuE_m2y.mjs.map +1 -0
  578. package/dist/chunks/zh-dGSDBBzb.mjs +2 -0
  579. package/dist/chunks/zh-dGSDBBzb.mjs.map +1 -0
  580. package/dist/chunks/zh-ikm3rSTR.mjs +2 -0
  581. package/dist/chunks/zh-ikm3rSTR.mjs.map +1 -0
  582. package/dist/chunks/zh-oZl1P_p0.mjs +2 -0
  583. package/dist/chunks/zh-oZl1P_p0.mjs.map +1 -0
  584. package/dist/commands/BlockInsertion.d.ts +49 -2
  585. package/dist/commands/BlockInsertion.d.ts.map +1 -1
  586. package/dist/commands/NodeSelectionCommands.d.ts +10 -2
  587. package/dist/commands/NodeSelectionCommands.d.ts.map +1 -1
  588. package/dist/editor/styles/list.d.ts +1 -1
  589. package/dist/editor/styles/list.d.ts.map +1 -1
  590. package/dist/fonts.mjs +1 -1
  591. package/dist/full.mjs +1 -1
  592. package/dist/html.mjs +1 -1
  593. package/dist/index.d.ts +1 -1
  594. package/dist/index.d.ts.map +1 -1
  595. package/dist/input/KeyDescriptor.d.ts +40 -0
  596. package/dist/input/KeyDescriptor.d.ts.map +1 -0
  597. package/dist/input/KeyboardHandler.d.ts +17 -5
  598. package/dist/input/KeyboardHandler.d.ts.map +1 -1
  599. package/dist/input/PasteHTMLHandler.d.ts.map +1 -1
  600. package/dist/input/PasteRichBlockHandler.d.ts +22 -3
  601. package/dist/input/PasteRichBlockHandler.d.ts.map +1 -1
  602. package/dist/model/Document.d.ts +2 -2
  603. package/dist/model/Document.d.ts.map +1 -1
  604. package/dist/notectl-core.mjs +1 -1
  605. package/dist/notectl-core.umd.js +1 -1
  606. package/dist/notectl-core.umd.js.map +1 -1
  607. package/dist/plugins/alignment.mjs +1 -1
  608. package/dist/plugins/bidi-isolation.mjs +1 -1
  609. package/dist/plugins/blockquote.mjs +1 -1
  610. package/dist/plugins/caret-navigation.mjs +1 -1
  611. package/dist/plugins/code-block.mjs +1 -1
  612. package/dist/plugins/font-size.mjs +1 -1
  613. package/dist/plugins/font.mjs +1 -1
  614. package/dist/plugins/formula/DisplayMathNodeSpec.d.ts.map +1 -1
  615. package/dist/plugins/formula/FormulaCommands.d.ts +14 -0
  616. package/dist/plugins/formula/FormulaCommands.d.ts.map +1 -1
  617. package/dist/plugins/formula/FormulaEditorMount.d.ts.map +1 -1
  618. package/dist/plugins/formula/FormulaLocale.d.ts +7 -1
  619. package/dist/plugins/formula/FormulaLocale.d.ts.map +1 -1
  620. package/dist/plugins/formula/FormulaPasteInterceptor.d.ts +12 -3
  621. package/dist/plugins/formula/FormulaPasteInterceptor.d.ts.map +1 -1
  622. package/dist/plugins/formula/FormulaSerialization.d.ts +17 -0
  623. package/dist/plugins/formula/FormulaSerialization.d.ts.map +1 -0
  624. package/dist/plugins/formula/FormulaStyles.d.ts +1 -1
  625. package/dist/plugins/formula/FormulaStyles.d.ts.map +1 -1
  626. package/dist/plugins/formula/InlineMathNodeSpec.d.ts.map +1 -1
  627. package/dist/plugins/formula/locales/ar.d.ts.map +1 -1
  628. package/dist/plugins/formula/locales/de.d.ts.map +1 -1
  629. package/dist/plugins/formula/locales/es.d.ts.map +1 -1
  630. package/dist/plugins/formula/locales/fr.d.ts.map +1 -1
  631. package/dist/plugins/formula/locales/hi.d.ts.map +1 -1
  632. package/dist/plugins/formula/locales/pt.d.ts.map +1 -1
  633. package/dist/plugins/formula/locales/ru.d.ts.map +1 -1
  634. package/dist/plugins/formula/locales/zh.d.ts.map +1 -1
  635. package/dist/plugins/formula/math-field/MathPalette.d.ts.map +1 -1
  636. package/dist/plugins/formula/math-field/MathPaletteData.d.ts +7 -1
  637. package/dist/plugins/formula/math-field/MathPaletteData.d.ts.map +1 -1
  638. package/dist/plugins/formula/mathml/MathMLDocument.d.ts +13 -0
  639. package/dist/plugins/formula/mathml/MathMLDocument.d.ts.map +1 -1
  640. package/dist/plugins/formula.mjs +1 -1
  641. package/dist/plugins/gap-cursor.mjs +1 -1
  642. package/dist/plugins/hard-break.mjs +1 -1
  643. package/dist/plugins/heading.mjs +1 -1
  644. package/dist/plugins/highlight.mjs +1 -1
  645. package/dist/plugins/horizontal-rule.mjs +1 -1
  646. package/dist/plugins/image.mjs +1 -1
  647. package/dist/plugins/inline-code.mjs +1 -1
  648. package/dist/plugins/language.mjs +1 -1
  649. package/dist/plugins/link.mjs +1 -1
  650. package/dist/plugins/list/ListCommands.d.ts +16 -3
  651. package/dist/plugins/list/ListCommands.d.ts.map +1 -1
  652. package/dist/plugins/list/ListLocale.d.ts +6 -0
  653. package/dist/plugins/list/ListLocale.d.ts.map +1 -1
  654. package/dist/plugins/list/ListMarker.d.ts +14 -0
  655. package/dist/plugins/list/ListMarker.d.ts.map +1 -0
  656. package/dist/plugins/list/ListPlugin.d.ts.map +1 -1
  657. package/dist/plugins/list/locales/ar.d.ts.map +1 -1
  658. package/dist/plugins/list/locales/de.d.ts.map +1 -1
  659. package/dist/plugins/list/locales/es.d.ts.map +1 -1
  660. package/dist/plugins/list/locales/fr.d.ts.map +1 -1
  661. package/dist/plugins/list/locales/hi.d.ts.map +1 -1
  662. package/dist/plugins/list/locales/pt.d.ts.map +1 -1
  663. package/dist/plugins/list/locales/ru.d.ts.map +1 -1
  664. package/dist/plugins/list/locales/zh.d.ts.map +1 -1
  665. package/dist/plugins/list.mjs +1 -1
  666. package/dist/plugins/print.mjs +1 -1
  667. package/dist/plugins/shared.mjs +1 -1
  668. package/dist/plugins/smart-paste.mjs +1 -1
  669. package/dist/plugins/strikethrough.mjs +1 -1
  670. package/dist/plugins/super-sub.mjs +1 -1
  671. package/dist/plugins/table/TableCommands.d.ts.map +1 -1
  672. package/dist/plugins/table.mjs +1 -1
  673. package/dist/plugins/text-color.mjs +1 -1
  674. package/dist/plugins/text-direction-auto.mjs +1 -1
  675. package/dist/plugins/text-direction.mjs +1 -1
  676. package/dist/plugins/text-formatting.mjs +1 -1
  677. package/dist/plugins/toolbar/ToolbarPopupController.d.ts.map +1 -1
  678. package/dist/plugins/toolbar.mjs +1 -1
  679. package/dist/plugins/video/VideoCommands.d.ts.map +1 -1
  680. package/dist/plugins/video.mjs +1 -1
  681. package/dist/presets/full.mjs +1 -1
  682. package/dist/presets/minimal.mjs +1 -1
  683. package/dist/presets.mjs +1 -1
  684. package/dist/state/InlineContentOps.d.ts +5 -3
  685. package/dist/state/InlineContentOps.d.ts.map +1 -1
  686. package/dist/state/StepInversion.d.ts.map +1 -1
  687. package/dist/state/StepMaps.d.ts.map +1 -1
  688. package/dist/state/Steps.d.ts +20 -3
  689. package/dist/state/Steps.d.ts.map +1 -1
  690. package/dist/state/TransactionBuilder.d.ts +3 -3
  691. package/dist/state/TransactionBuilder.d.ts.map +1 -1
  692. package/dist/test/TestUtils.d.ts +2 -0
  693. package/dist/test/TestUtils.d.ts.map +1 -1
  694. package/dist/view/SelectionSync.d.ts.map +1 -1
  695. package/package.json +423 -415
  696. package/dist/chunks/AlignmentPlugin-BLzRjrUl.mjs +0 -2
  697. package/dist/chunks/AlignmentPlugin-BLzRjrUl.mjs.map +0 -1
  698. package/dist/chunks/AttrRegistry-CRnXTPha.mjs +0 -2
  699. package/dist/chunks/AttrRegistry-CRnXTPha.mjs.map +0 -1
  700. package/dist/chunks/AttributedMarkCommands-CxhdUsuE.mjs +0 -2
  701. package/dist/chunks/AttributedMarkCommands-CxhdUsuE.mjs.map +0 -1
  702. package/dist/chunks/BidiIsolationPlugin-DNPXe5ga.mjs +0 -2
  703. package/dist/chunks/BidiIsolationPlugin-DNPXe5ga.mjs.map +0 -1
  704. package/dist/chunks/BlockInsertion-C7jFEeYB.mjs +0 -2
  705. package/dist/chunks/BlockInsertion-C7jFEeYB.mjs.map +0 -1
  706. package/dist/chunks/BlockTypePickerRegistry-U4uY7-lN.mjs +0 -2
  707. package/dist/chunks/BlockTypePickerRegistry-U4uY7-lN.mjs.map +0 -1
  708. package/dist/chunks/BlockquotePlugin-YgXcV4mT.mjs +0 -2
  709. package/dist/chunks/BlockquotePlugin-YgXcV4mT.mjs.map +0 -1
  710. package/dist/chunks/CaretNavigationPlugin-P6OYaTSq.mjs +0 -2
  711. package/dist/chunks/CaretNavigationPlugin-P6OYaTSq.mjs.map +0 -1
  712. package/dist/chunks/CodeBlockPlugin-ChPv3Edf.mjs +0 -2
  713. package/dist/chunks/CodeBlockPlugin-ChPv3Edf.mjs.map +0 -1
  714. package/dist/chunks/ColorGrid-D5-teEjD.mjs +0 -2
  715. package/dist/chunks/ColorGrid-D5-teEjD.mjs.map +0 -1
  716. package/dist/chunks/ColorPickerPopup-_Gp09pdx.mjs +0 -2
  717. package/dist/chunks/ColorPickerPopup-_Gp09pdx.mjs.map +0 -1
  718. package/dist/chunks/ColorValidation-okAvytHQ.mjs +0 -2
  719. package/dist/chunks/ColorValidation-okAvytHQ.mjs.map +0 -1
  720. package/dist/chunks/CommandHelpers-NV80Ff1G.mjs +0 -2
  721. package/dist/chunks/CommandHelpers-NV80Ff1G.mjs.map +0 -1
  722. package/dist/chunks/Commands-ixGhPiRG.mjs +0 -2
  723. package/dist/chunks/Commands-ixGhPiRG.mjs.map +0 -1
  724. package/dist/chunks/Decoration-DZK7hrL1.mjs +0 -2
  725. package/dist/chunks/Decoration-DZK7hrL1.mjs.map +0 -1
  726. package/dist/chunks/DirectionDetection-7HmMUZrx.mjs +0 -2
  727. package/dist/chunks/DirectionDetection-7HmMUZrx.mjs.map +0 -1
  728. package/dist/chunks/DirectionIcons-DhRvPVoz.mjs +0 -2
  729. package/dist/chunks/DirectionIcons-DhRvPVoz.mjs.map +0 -1
  730. package/dist/chunks/Document-znhIcvM9.mjs +0 -2
  731. package/dist/chunks/Document-znhIcvM9.mjs.map +0 -1
  732. package/dist/chunks/DocumentParser-DCjOW3us.mjs +0 -2
  733. package/dist/chunks/DocumentParser-DCjOW3us.mjs.map +0 -1
  734. package/dist/chunks/DomUtils-RKbAVBQz.mjs +0 -2
  735. package/dist/chunks/DomUtils-RKbAVBQz.mjs.map +0 -1
  736. package/dist/chunks/FontPlugin-COYtG1Uo.mjs +0 -2
  737. package/dist/chunks/FontPlugin-COYtG1Uo.mjs.map +0 -1
  738. package/dist/chunks/FontSizePlugin-CLcfdTm3.mjs +0 -2
  739. package/dist/chunks/FontSizePlugin-CLcfdTm3.mjs.map +0 -1
  740. package/dist/chunks/FormulaPlugin-DphHU4Rn.mjs +0 -2
  741. package/dist/chunks/FormulaPlugin-DphHU4Rn.mjs.map +0 -1
  742. package/dist/chunks/GapCursorNavigation-Bkuu_Ek8.mjs +0 -2
  743. package/dist/chunks/GapCursorNavigation-Bkuu_Ek8.mjs.map +0 -1
  744. package/dist/chunks/GapCursorPlugin-CRDmQEi1.mjs +0 -2
  745. package/dist/chunks/GapCursorPlugin-CRDmQEi1.mjs.map +0 -1
  746. package/dist/chunks/HTMLUtils-brwcaufP.mjs +0 -2
  747. package/dist/chunks/HTMLUtils-brwcaufP.mjs.map +0 -1
  748. package/dist/chunks/HardBreakPlugin-Cr6dMQ-H.mjs +0 -2
  749. package/dist/chunks/HardBreakPlugin-Cr6dMQ-H.mjs.map +0 -1
  750. package/dist/chunks/HeadingPlugin-3NL4ARPp.mjs +0 -2
  751. package/dist/chunks/HeadingPlugin-3NL4ARPp.mjs.map +0 -1
  752. package/dist/chunks/HighlightPlugin-dHxnAuoW.mjs +0 -2
  753. package/dist/chunks/HighlightPlugin-dHxnAuoW.mjs.map +0 -1
  754. package/dist/chunks/HorizontalRulePlugin-BYPaI4TR.mjs +0 -2
  755. package/dist/chunks/HorizontalRulePlugin-BYPaI4TR.mjs.map +0 -1
  756. package/dist/chunks/ImagePlugin-kgokm-a1.mjs +0 -2
  757. package/dist/chunks/ImagePlugin-kgokm-a1.mjs.map +0 -1
  758. package/dist/chunks/InlineCodePlugin-Bl1jyDwk.mjs +0 -2
  759. package/dist/chunks/InlineCodePlugin-Bl1jyDwk.mjs.map +0 -1
  760. package/dist/chunks/InlineStyleMarkSpec-Cc-b1tlm.mjs +0 -2
  761. package/dist/chunks/InlineStyleMarkSpec-Cc-b1tlm.mjs.map +0 -1
  762. package/dist/chunks/KeyboardNav-DZXdTg-_.mjs +0 -2
  763. package/dist/chunks/KeyboardNav-DZXdTg-_.mjs.map +0 -1
  764. package/dist/chunks/LinkPlugin-Dmcfo3On.mjs +0 -2
  765. package/dist/chunks/LinkPlugin-Dmcfo3On.mjs.map +0 -1
  766. package/dist/chunks/ListPlugin-Ch-5CsFc.mjs +0 -2
  767. package/dist/chunks/ListPlugin-Ch-5CsFc.mjs.map +0 -1
  768. package/dist/chunks/NavigationQueries-3zTaNBlp.mjs +0 -2
  769. package/dist/chunks/NavigationQueries-3zTaNBlp.mjs.map +0 -1
  770. package/dist/chunks/NodeResolver-BplmzA7c.mjs +0 -2
  771. package/dist/chunks/NodeResolver-BplmzA7c.mjs.map +0 -1
  772. package/dist/chunks/NodeSelectionCommands-dUmbRoZ2.mjs +0 -2
  773. package/dist/chunks/NodeSelectionCommands-dUmbRoZ2.mjs.map +0 -1
  774. package/dist/chunks/NodeSpecPatching-DToX09gc.mjs +0 -2
  775. package/dist/chunks/NodeSpecPatching-DToX09gc.mjs.map +0 -1
  776. package/dist/chunks/Platform-wPvKFB9m.mjs +0 -2
  777. package/dist/chunks/Platform-wPvKFB9m.mjs.map +0 -1
  778. package/dist/chunks/PluginHelpers-C3aCCGfX.mjs +0 -2
  779. package/dist/chunks/PluginHelpers-C3aCCGfX.mjs.map +0 -1
  780. package/dist/chunks/PopupKeyboardPatterns-ZdAQB78m.mjs +0 -2
  781. package/dist/chunks/PopupKeyboardPatterns-ZdAQB78m.mjs.map +0 -1
  782. package/dist/chunks/PopupManager-DsT1uRWi.mjs +0 -2
  783. package/dist/chunks/PopupManager-DsT1uRWi.mjs.map +0 -1
  784. package/dist/chunks/PopupPositioning-BEnz90Oh.mjs +0 -2
  785. package/dist/chunks/PopupPositioning-BEnz90Oh.mjs.map +0 -1
  786. package/dist/chunks/PrintPlugin-Bq-Z14K1.mjs +0 -2
  787. package/dist/chunks/PrintPlugin-Bq-Z14K1.mjs.map +0 -1
  788. package/dist/chunks/PrintTypes-DA0Cc--M.mjs +0 -2
  789. package/dist/chunks/PrintTypes-DA0Cc--M.mjs.map +0 -1
  790. package/dist/chunks/RangeIterator-Cl4_k8cx.mjs +0 -2
  791. package/dist/chunks/RangeIterator-Cl4_k8cx.mjs.map +0 -1
  792. package/dist/chunks/Selection-aeiSsvhe.mjs +0 -2
  793. package/dist/chunks/Selection-aeiSsvhe.mjs.map +0 -1
  794. package/dist/chunks/SelectionSync-DCJpNFat.mjs +0 -2
  795. package/dist/chunks/SelectionSync-DCJpNFat.mjs.map +0 -1
  796. package/dist/chunks/ShortcutFormatting-DZK70CN9.mjs +0 -2
  797. package/dist/chunks/ShortcutFormatting-DZK70CN9.mjs.map +0 -1
  798. package/dist/chunks/SimpleMark-CezTJnXh.mjs +0 -2
  799. package/dist/chunks/SimpleMark-CezTJnXh.mjs.map +0 -1
  800. package/dist/chunks/SmartPastePlugin-DlApY6Vw.mjs +0 -2
  801. package/dist/chunks/SmartPastePlugin-DlApY6Vw.mjs.map +0 -1
  802. package/dist/chunks/StrikethroughPlugin-BuFDABvz.mjs +0 -2
  803. package/dist/chunks/StrikethroughPlugin-BuFDABvz.mjs.map +0 -1
  804. package/dist/chunks/StyleRuntime-Bwde5icB.mjs +0 -2
  805. package/dist/chunks/StyleRuntime-Bwde5icB.mjs.map +0 -1
  806. package/dist/chunks/SuperSubPlugin-CiLJ7i4s.mjs +0 -2
  807. package/dist/chunks/SuperSubPlugin-CiLJ7i4s.mjs.map +0 -1
  808. package/dist/chunks/SyntaxTokenTypes-C9dGwufi.mjs +0 -2
  809. package/dist/chunks/SyntaxTokenTypes-C9dGwufi.mjs.map +0 -1
  810. package/dist/chunks/TablePlugin-5ru-y-YX.mjs +0 -2
  811. package/dist/chunks/TablePlugin-5ru-y-YX.mjs.map +0 -1
  812. package/dist/chunks/TextColorPlugin-Vz-Nz8aH.mjs +0 -2
  813. package/dist/chunks/TextColorPlugin-Vz-Nz8aH.mjs.map +0 -1
  814. package/dist/chunks/TextDirectionAutoPlugin-Behl6KMe.mjs +0 -2
  815. package/dist/chunks/TextDirectionAutoPlugin-Behl6KMe.mjs.map +0 -1
  816. package/dist/chunks/TextDirectionPlugin-C3h1n-aA.mjs +0 -2
  817. package/dist/chunks/TextDirectionPlugin-C3h1n-aA.mjs.map +0 -1
  818. package/dist/chunks/TextDirectionService-DRfeQnF6.mjs +0 -2
  819. package/dist/chunks/TextDirectionService-DRfeQnF6.mjs.map +0 -1
  820. package/dist/chunks/TextFormattingPlugin-D_nRMeBn.mjs +0 -2
  821. package/dist/chunks/TextFormattingPlugin-D_nRMeBn.mjs.map +0 -1
  822. package/dist/chunks/ToolbarPlugin-CSMSgjPM.mjs +0 -2
  823. package/dist/chunks/ToolbarPlugin-CSMSgjPM.mjs.map +0 -1
  824. package/dist/chunks/TypeBrands-BZDKMjR-.mjs +0 -2
  825. package/dist/chunks/TypeBrands-BZDKMjR-.mjs.map +0 -1
  826. package/dist/chunks/TypedKeys-E3jOGByL.mjs +0 -2
  827. package/dist/chunks/TypedKeys-E3jOGByL.mjs.map +0 -1
  828. package/dist/chunks/VideoPlugin-BUCGIYXr.mjs +0 -2
  829. package/dist/chunks/VideoPlugin-BUCGIYXr.mjs.map +0 -1
  830. package/dist/chunks/WordBoundary-CYDAtEks.mjs +0 -2
  831. package/dist/chunks/WordBoundary-CYDAtEks.mjs.map +0 -1
  832. package/dist/chunks/XmlDetector-DxBGXqua.mjs +0 -2
  833. package/dist/chunks/XmlDetector-DxBGXqua.mjs.map +0 -1
  834. package/dist/chunks/XmlPatterns-BiHS8w3k.mjs +0 -2
  835. package/dist/chunks/XmlPatterns-BiHS8w3k.mjs.map +0 -1
  836. package/dist/chunks/XmlSupport-B_F65M8G.mjs +0 -2
  837. package/dist/chunks/XmlSupport-B_F65M8G.mjs.map +0 -1
  838. package/dist/chunks/ar-B38MlRRN.mjs +0 -2
  839. package/dist/chunks/ar-B38MlRRN.mjs.map +0 -1
  840. package/dist/chunks/ar-BIeE0C5A.mjs +0 -2
  841. package/dist/chunks/ar-BIeE0C5A.mjs.map +0 -1
  842. package/dist/chunks/ar-BK0rFxF_.mjs +0 -2
  843. package/dist/chunks/ar-BK0rFxF_.mjs.map +0 -1
  844. package/dist/chunks/ar-BK4O36ep.mjs +0 -2
  845. package/dist/chunks/ar-BK4O36ep.mjs.map +0 -1
  846. package/dist/chunks/ar-BNUWuZe3.mjs +0 -2
  847. package/dist/chunks/ar-BNUWuZe3.mjs.map +0 -1
  848. package/dist/chunks/ar-BSXH8acw.mjs +0 -2
  849. package/dist/chunks/ar-BSXH8acw.mjs.map +0 -1
  850. package/dist/chunks/ar-BY8yNlGe.mjs +0 -2
  851. package/dist/chunks/ar-BY8yNlGe.mjs.map +0 -1
  852. package/dist/chunks/ar-BgHkduPE.mjs +0 -2
  853. package/dist/chunks/ar-BgHkduPE.mjs.map +0 -1
  854. package/dist/chunks/ar-BnfWtLhK.mjs +0 -2
  855. package/dist/chunks/ar-BnfWtLhK.mjs.map +0 -1
  856. package/dist/chunks/ar-BwCPhCf6.mjs +0 -2
  857. package/dist/chunks/ar-BwCPhCf6.mjs.map +0 -1
  858. package/dist/chunks/ar-Bymjd9Z_.mjs +0 -2
  859. package/dist/chunks/ar-Bymjd9Z_.mjs.map +0 -1
  860. package/dist/chunks/ar-CKPpdJ7F.mjs +0 -2
  861. package/dist/chunks/ar-CKPpdJ7F.mjs.map +0 -1
  862. package/dist/chunks/ar-C_ir5Uf4.mjs +0 -2
  863. package/dist/chunks/ar-C_ir5Uf4.mjs.map +0 -1
  864. package/dist/chunks/ar-CkE6GDVA.mjs +0 -2
  865. package/dist/chunks/ar-CkE6GDVA.mjs.map +0 -1
  866. package/dist/chunks/ar-ClgA1KQM.mjs +0 -2
  867. package/dist/chunks/ar-ClgA1KQM.mjs.map +0 -1
  868. package/dist/chunks/ar-Cm1DOK74.mjs +0 -2
  869. package/dist/chunks/ar-Cm1DOK74.mjs.map +0 -1
  870. package/dist/chunks/ar-CseGhQtS.mjs +0 -2
  871. package/dist/chunks/ar-CseGhQtS.mjs.map +0 -1
  872. package/dist/chunks/ar-D0bqkviV.mjs +0 -2
  873. package/dist/chunks/ar-D0bqkviV.mjs.map +0 -1
  874. package/dist/chunks/ar-D5d185g0.mjs +0 -2
  875. package/dist/chunks/ar-D5d185g0.mjs.map +0 -1
  876. package/dist/chunks/ar-DSwUyX47.mjs +0 -2
  877. package/dist/chunks/ar-DSwUyX47.mjs.map +0 -1
  878. package/dist/chunks/ar-DfSNWZX7.mjs +0 -2
  879. package/dist/chunks/ar-DfSNWZX7.mjs.map +0 -1
  880. package/dist/chunks/ar-Dghtfs46.mjs +0 -2
  881. package/dist/chunks/ar-Dghtfs46.mjs.map +0 -1
  882. package/dist/chunks/ar-DvNKBrJd.mjs +0 -2
  883. package/dist/chunks/ar-DvNKBrJd.mjs.map +0 -1
  884. package/dist/chunks/ar-KNULRI8r.mjs +0 -2
  885. package/dist/chunks/ar-KNULRI8r.mjs.map +0 -1
  886. package/dist/chunks/ar-NtGRavHz.mjs +0 -2
  887. package/dist/chunks/ar-NtGRavHz.mjs.map +0 -1
  888. package/dist/chunks/ar-Y9KjJLX8.mjs +0 -2
  889. package/dist/chunks/ar-Y9KjJLX8.mjs.map +0 -1
  890. package/dist/chunks/ar-odM5gkvw.mjs +0 -2
  891. package/dist/chunks/ar-odM5gkvw.mjs.map +0 -1
  892. package/dist/chunks/color-picker-C89H4SVX.mjs +0 -2
  893. package/dist/chunks/color-picker-C89H4SVX.mjs.map +0 -1
  894. package/dist/chunks/de-B1TXiyll.mjs +0 -2
  895. package/dist/chunks/de-B1TXiyll.mjs.map +0 -1
  896. package/dist/chunks/de-BDRaxLyi.mjs +0 -2
  897. package/dist/chunks/de-BDRaxLyi.mjs.map +0 -1
  898. package/dist/chunks/de-BGOpZ8Ls.mjs +0 -2
  899. package/dist/chunks/de-BGOpZ8Ls.mjs.map +0 -1
  900. package/dist/chunks/de-BfZ5qXWz.mjs +0 -2
  901. package/dist/chunks/de-BfZ5qXWz.mjs.map +0 -1
  902. package/dist/chunks/de-BibufNIa.mjs +0 -2
  903. package/dist/chunks/de-BibufNIa.mjs.map +0 -1
  904. package/dist/chunks/de-BkZqCmzL.mjs +0 -2
  905. package/dist/chunks/de-BkZqCmzL.mjs.map +0 -1
  906. package/dist/chunks/de-BzRd2oyR.mjs +0 -2
  907. package/dist/chunks/de-BzRd2oyR.mjs.map +0 -1
  908. package/dist/chunks/de-C4gnHDmk.mjs +0 -2
  909. package/dist/chunks/de-C4gnHDmk.mjs.map +0 -1
  910. package/dist/chunks/de-C4iw9SEp.mjs +0 -2
  911. package/dist/chunks/de-C4iw9SEp.mjs.map +0 -1
  912. package/dist/chunks/de-CLWzcDoW.mjs +0 -2
  913. package/dist/chunks/de-CLWzcDoW.mjs.map +0 -1
  914. package/dist/chunks/de-Cbv0otYM.mjs +0 -2
  915. package/dist/chunks/de-Cbv0otYM.mjs.map +0 -1
  916. package/dist/chunks/de-Cinp7zmo.mjs +0 -2
  917. package/dist/chunks/de-Cinp7zmo.mjs.map +0 -1
  918. package/dist/chunks/de-CvnyjI_X.mjs +0 -2
  919. package/dist/chunks/de-CvnyjI_X.mjs.map +0 -1
  920. package/dist/chunks/de-DCx3Shj3.mjs +0 -2
  921. package/dist/chunks/de-DCx3Shj3.mjs.map +0 -1
  922. package/dist/chunks/de-Dav2GzjV.mjs +0 -2
  923. package/dist/chunks/de-Dav2GzjV.mjs.map +0 -1
  924. package/dist/chunks/de-Dc7GRbWc.mjs +0 -2
  925. package/dist/chunks/de-Dc7GRbWc.mjs.map +0 -1
  926. package/dist/chunks/de-DdntlpT3.mjs +0 -2
  927. package/dist/chunks/de-DdntlpT3.mjs.map +0 -1
  928. package/dist/chunks/de-DefykdF-.mjs +0 -2
  929. package/dist/chunks/de-DefykdF-.mjs.map +0 -1
  930. package/dist/chunks/de-DfQQIP8Y.mjs +0 -2
  931. package/dist/chunks/de-DfQQIP8Y.mjs.map +0 -1
  932. package/dist/chunks/de-DkcKDkbA.mjs +0 -2
  933. package/dist/chunks/de-DkcKDkbA.mjs.map +0 -1
  934. package/dist/chunks/de-DqGfLfeV.mjs +0 -2
  935. package/dist/chunks/de-DqGfLfeV.mjs.map +0 -1
  936. package/dist/chunks/de-DudqIJho.mjs +0 -2
  937. package/dist/chunks/de-DudqIJho.mjs.map +0 -1
  938. package/dist/chunks/de-LCXA2xWj.mjs +0 -2
  939. package/dist/chunks/de-LCXA2xWj.mjs.map +0 -1
  940. package/dist/chunks/de-YygmrxGp.mjs +0 -2
  941. package/dist/chunks/de-YygmrxGp.mjs.map +0 -1
  942. package/dist/chunks/de-asI3UlFG.mjs +0 -2
  943. package/dist/chunks/de-asI3UlFG.mjs.map +0 -1
  944. package/dist/chunks/de-kvMvD3AJ.mjs +0 -2
  945. package/dist/chunks/de-kvMvD3AJ.mjs.map +0 -1
  946. package/dist/chunks/de-pnfTnS03.mjs +0 -2
  947. package/dist/chunks/de-pnfTnS03.mjs.map +0 -1
  948. package/dist/chunks/es-4tbAR0If.mjs +0 -2
  949. package/dist/chunks/es-4tbAR0If.mjs.map +0 -1
  950. package/dist/chunks/es-B9z2Xwj0.mjs +0 -2
  951. package/dist/chunks/es-B9z2Xwj0.mjs.map +0 -1
  952. package/dist/chunks/es-BJxjRQSg.mjs +0 -2
  953. package/dist/chunks/es-BJxjRQSg.mjs.map +0 -1
  954. package/dist/chunks/es-BSyxBRjn.mjs +0 -2
  955. package/dist/chunks/es-BSyxBRjn.mjs.map +0 -1
  956. package/dist/chunks/es-Bcpq2xfU.mjs +0 -2
  957. package/dist/chunks/es-Bcpq2xfU.mjs.map +0 -1
  958. package/dist/chunks/es-BhUjc8mO.mjs +0 -2
  959. package/dist/chunks/es-BhUjc8mO.mjs.map +0 -1
  960. package/dist/chunks/es-Bm7hoJSI.mjs +0 -2
  961. package/dist/chunks/es-Bm7hoJSI.mjs.map +0 -1
  962. package/dist/chunks/es-C0E-lFIC.mjs +0 -2
  963. package/dist/chunks/es-C0E-lFIC.mjs.map +0 -1
  964. package/dist/chunks/es-C2wBBQ7N.mjs +0 -2
  965. package/dist/chunks/es-C2wBBQ7N.mjs.map +0 -1
  966. package/dist/chunks/es-C9vhYpfP.mjs +0 -2
  967. package/dist/chunks/es-C9vhYpfP.mjs.map +0 -1
  968. package/dist/chunks/es-Cgslt0Hp.mjs +0 -2
  969. package/dist/chunks/es-Cgslt0Hp.mjs.map +0 -1
  970. package/dist/chunks/es-CksXDFxg.mjs +0 -2
  971. package/dist/chunks/es-CksXDFxg.mjs.map +0 -1
  972. package/dist/chunks/es-CnQUZlfY.mjs +0 -2
  973. package/dist/chunks/es-CnQUZlfY.mjs.map +0 -1
  974. package/dist/chunks/es-CrRNOn2Q.mjs +0 -2
  975. package/dist/chunks/es-CrRNOn2Q.mjs.map +0 -1
  976. package/dist/chunks/es-D0427MIH.mjs +0 -2
  977. package/dist/chunks/es-D0427MIH.mjs.map +0 -1
  978. package/dist/chunks/es-D19xfXus.mjs +0 -2
  979. package/dist/chunks/es-D19xfXus.mjs.map +0 -1
  980. package/dist/chunks/es-Dk6lCcOt.mjs +0 -2
  981. package/dist/chunks/es-Dk6lCcOt.mjs.map +0 -1
  982. package/dist/chunks/es-Dls_xPCW.mjs +0 -2
  983. package/dist/chunks/es-Dls_xPCW.mjs.map +0 -1
  984. package/dist/chunks/es-DrcsyDvI.mjs +0 -2
  985. package/dist/chunks/es-DrcsyDvI.mjs.map +0 -1
  986. package/dist/chunks/es-DwKejbO9.mjs +0 -2
  987. package/dist/chunks/es-DwKejbO9.mjs.map +0 -1
  988. package/dist/chunks/es-NcrWuNe1.mjs +0 -2
  989. package/dist/chunks/es-NcrWuNe1.mjs.map +0 -1
  990. package/dist/chunks/es-RaZerssd.mjs +0 -2
  991. package/dist/chunks/es-RaZerssd.mjs.map +0 -1
  992. package/dist/chunks/es-TIjHCFNF.mjs +0 -2
  993. package/dist/chunks/es-TIjHCFNF.mjs.map +0 -1
  994. package/dist/chunks/es-eZcDkBb-.mjs +0 -2
  995. package/dist/chunks/es-eZcDkBb-.mjs.map +0 -1
  996. package/dist/chunks/es-j_-KW9-4.mjs +0 -2
  997. package/dist/chunks/es-j_-KW9-4.mjs.map +0 -1
  998. package/dist/chunks/es-kGLwn8EB.mjs +0 -2
  999. package/dist/chunks/es-kGLwn8EB.mjs.map +0 -1
  1000. package/dist/chunks/es-qQRDC0Ge.mjs +0 -2
  1001. package/dist/chunks/es-qQRDC0Ge.mjs.map +0 -1
  1002. package/dist/chunks/fonts-ZXAIMT3b.mjs +0 -2
  1003. package/dist/chunks/fonts-ZXAIMT3b.mjs.map +0 -1
  1004. package/dist/chunks/fr-B27zAq0X.mjs +0 -2
  1005. package/dist/chunks/fr-B27zAq0X.mjs.map +0 -1
  1006. package/dist/chunks/fr-BEd3ZHO4.mjs +0 -2
  1007. package/dist/chunks/fr-BEd3ZHO4.mjs.map +0 -1
  1008. package/dist/chunks/fr-BHXLpdaH.mjs +0 -2
  1009. package/dist/chunks/fr-BHXLpdaH.mjs.map +0 -1
  1010. package/dist/chunks/fr-BKu4eU3V.mjs +0 -2
  1011. package/dist/chunks/fr-BKu4eU3V.mjs.map +0 -1
  1012. package/dist/chunks/fr-BUrUZ5UQ.mjs +0 -2
  1013. package/dist/chunks/fr-BUrUZ5UQ.mjs.map +0 -1
  1014. package/dist/chunks/fr-BlqlUQ3b.mjs +0 -2
  1015. package/dist/chunks/fr-BlqlUQ3b.mjs.map +0 -1
  1016. package/dist/chunks/fr-BruEqDw1.mjs +0 -2
  1017. package/dist/chunks/fr-BruEqDw1.mjs.map +0 -1
  1018. package/dist/chunks/fr-BwuuFBkA.mjs +0 -2
  1019. package/dist/chunks/fr-BwuuFBkA.mjs.map +0 -1
  1020. package/dist/chunks/fr-C2lLh5Ti.mjs +0 -2
  1021. package/dist/chunks/fr-C2lLh5Ti.mjs.map +0 -1
  1022. package/dist/chunks/fr-C7N2_AlK.mjs +0 -2
  1023. package/dist/chunks/fr-C7N2_AlK.mjs.map +0 -1
  1024. package/dist/chunks/fr-COfd6sLW.mjs +0 -2
  1025. package/dist/chunks/fr-COfd6sLW.mjs.map +0 -1
  1026. package/dist/chunks/fr-COx4cSxc.mjs +0 -2
  1027. package/dist/chunks/fr-COx4cSxc.mjs.map +0 -1
  1028. package/dist/chunks/fr-CX37XjPO.mjs +0 -2
  1029. package/dist/chunks/fr-CX37XjPO.mjs.map +0 -1
  1030. package/dist/chunks/fr-CYn6fMiH.mjs +0 -2
  1031. package/dist/chunks/fr-CYn6fMiH.mjs.map +0 -1
  1032. package/dist/chunks/fr-CbsiyDEa.mjs +0 -2
  1033. package/dist/chunks/fr-CbsiyDEa.mjs.map +0 -1
  1034. package/dist/chunks/fr-CcZiELJY.mjs +0 -2
  1035. package/dist/chunks/fr-CcZiELJY.mjs.map +0 -1
  1036. package/dist/chunks/fr-CeHzUPVT.mjs +0 -2
  1037. package/dist/chunks/fr-CeHzUPVT.mjs.map +0 -1
  1038. package/dist/chunks/fr-Cv73J4QZ.mjs +0 -2
  1039. package/dist/chunks/fr-Cv73J4QZ.mjs.map +0 -1
  1040. package/dist/chunks/fr-DDLuorz7.mjs +0 -2
  1041. package/dist/chunks/fr-DDLuorz7.mjs.map +0 -1
  1042. package/dist/chunks/fr-DMA4CAyo.mjs +0 -2
  1043. package/dist/chunks/fr-DMA4CAyo.mjs.map +0 -1
  1044. package/dist/chunks/fr-DNJuGtO1.mjs +0 -2
  1045. package/dist/chunks/fr-DNJuGtO1.mjs.map +0 -1
  1046. package/dist/chunks/fr-DQOE8O6_.mjs +0 -2
  1047. package/dist/chunks/fr-DQOE8O6_.mjs.map +0 -1
  1048. package/dist/chunks/fr-DXjOwGew.mjs +0 -2
  1049. package/dist/chunks/fr-DXjOwGew.mjs.map +0 -1
  1050. package/dist/chunks/fr-DilrEvE_.mjs +0 -2
  1051. package/dist/chunks/fr-DilrEvE_.mjs.map +0 -1
  1052. package/dist/chunks/fr-P7iY3ntE.mjs +0 -2
  1053. package/dist/chunks/fr-P7iY3ntE.mjs.map +0 -1
  1054. package/dist/chunks/fr-ViUNGo_J.mjs +0 -2
  1055. package/dist/chunks/fr-ViUNGo_J.mjs.map +0 -1
  1056. package/dist/chunks/fr-gdIyLcGC.mjs +0 -2
  1057. package/dist/chunks/fr-gdIyLcGC.mjs.map +0 -1
  1058. package/dist/chunks/full-h88Sb2MR.mjs +0 -2
  1059. package/dist/chunks/full-h88Sb2MR.mjs.map +0 -1
  1060. package/dist/chunks/hi-BC82Jxjl.mjs +0 -2
  1061. package/dist/chunks/hi-BC82Jxjl.mjs.map +0 -1
  1062. package/dist/chunks/hi-BCTarnem.mjs +0 -2
  1063. package/dist/chunks/hi-BCTarnem.mjs.map +0 -1
  1064. package/dist/chunks/hi-BMStjhJF.mjs +0 -2
  1065. package/dist/chunks/hi-BMStjhJF.mjs.map +0 -1
  1066. package/dist/chunks/hi-BQ2Fyx7t.mjs +0 -2
  1067. package/dist/chunks/hi-BQ2Fyx7t.mjs.map +0 -1
  1068. package/dist/chunks/hi-Bg4-z2Os.mjs +0 -2
  1069. package/dist/chunks/hi-Bg4-z2Os.mjs.map +0 -1
  1070. package/dist/chunks/hi-BgqI_gOH.mjs +0 -2
  1071. package/dist/chunks/hi-BgqI_gOH.mjs.map +0 -1
  1072. package/dist/chunks/hi-CEPSeUBX.mjs +0 -2
  1073. package/dist/chunks/hi-CEPSeUBX.mjs.map +0 -1
  1074. package/dist/chunks/hi-CRaZj5Uo.mjs +0 -2
  1075. package/dist/chunks/hi-CRaZj5Uo.mjs.map +0 -1
  1076. package/dist/chunks/hi-CT0uK1Me.mjs +0 -2
  1077. package/dist/chunks/hi-CT0uK1Me.mjs.map +0 -1
  1078. package/dist/chunks/hi-CnIpMd8L.mjs +0 -2
  1079. package/dist/chunks/hi-CnIpMd8L.mjs.map +0 -1
  1080. package/dist/chunks/hi-CnSv0JhL.mjs +0 -2
  1081. package/dist/chunks/hi-CnSv0JhL.mjs.map +0 -1
  1082. package/dist/chunks/hi-DLLBZu67.mjs +0 -2
  1083. package/dist/chunks/hi-DLLBZu67.mjs.map +0 -1
  1084. package/dist/chunks/hi-DMg_aiSR.mjs +0 -2
  1085. package/dist/chunks/hi-DMg_aiSR.mjs.map +0 -1
  1086. package/dist/chunks/hi-DWwLzOX5.mjs +0 -2
  1087. package/dist/chunks/hi-DWwLzOX5.mjs.map +0 -1
  1088. package/dist/chunks/hi-D_4Xi4Nv.mjs +0 -2
  1089. package/dist/chunks/hi-D_4Xi4Nv.mjs.map +0 -1
  1090. package/dist/chunks/hi-D_Jtykmj.mjs +0 -2
  1091. package/dist/chunks/hi-D_Jtykmj.mjs.map +0 -1
  1092. package/dist/chunks/hi-Da5pRz8E.mjs +0 -2
  1093. package/dist/chunks/hi-Da5pRz8E.mjs.map +0 -1
  1094. package/dist/chunks/hi-DqL20WmM.mjs +0 -2
  1095. package/dist/chunks/hi-DqL20WmM.mjs.map +0 -1
  1096. package/dist/chunks/hi-DwQopxRg.mjs +0 -2
  1097. package/dist/chunks/hi-DwQopxRg.mjs.map +0 -1
  1098. package/dist/chunks/hi-IuMohSSw.mjs +0 -2
  1099. package/dist/chunks/hi-IuMohSSw.mjs.map +0 -1
  1100. package/dist/chunks/hi-PUX7dDPm.mjs +0 -2
  1101. package/dist/chunks/hi-PUX7dDPm.mjs.map +0 -1
  1102. package/dist/chunks/hi-RmfZAmwT.mjs +0 -2
  1103. package/dist/chunks/hi-RmfZAmwT.mjs.map +0 -1
  1104. package/dist/chunks/hi-UIBrTEVu.mjs +0 -2
  1105. package/dist/chunks/hi-UIBrTEVu.mjs.map +0 -1
  1106. package/dist/chunks/hi-_SjWnfeh.mjs +0 -2
  1107. package/dist/chunks/hi-_SjWnfeh.mjs.map +0 -1
  1108. package/dist/chunks/hi-dV2GZgH_.mjs +0 -2
  1109. package/dist/chunks/hi-dV2GZgH_.mjs.map +0 -1
  1110. package/dist/chunks/hi-ehh5oKz3.mjs +0 -2
  1111. package/dist/chunks/hi-ehh5oKz3.mjs.map +0 -1
  1112. package/dist/chunks/hi-yXnRBFJK.mjs +0 -2
  1113. package/dist/chunks/hi-yXnRBFJK.mjs.map +0 -1
  1114. package/dist/chunks/minimal-a40NeBQ_.mjs +0 -2
  1115. package/dist/chunks/minimal-a40NeBQ_.mjs.map +0 -1
  1116. package/dist/chunks/pt-2a8Oto6x.mjs +0 -2
  1117. package/dist/chunks/pt-2a8Oto6x.mjs.map +0 -1
  1118. package/dist/chunks/pt-ALzIyTiI.mjs +0 -2
  1119. package/dist/chunks/pt-ALzIyTiI.mjs.map +0 -1
  1120. package/dist/chunks/pt-B2hMlTc6.mjs +0 -2
  1121. package/dist/chunks/pt-B2hMlTc6.mjs.map +0 -1
  1122. package/dist/chunks/pt-BCIkSb0w.mjs +0 -2
  1123. package/dist/chunks/pt-BCIkSb0w.mjs.map +0 -1
  1124. package/dist/chunks/pt-BFotmq5x.mjs +0 -2
  1125. package/dist/chunks/pt-BFotmq5x.mjs.map +0 -1
  1126. package/dist/chunks/pt-BM7OScX6.mjs +0 -2
  1127. package/dist/chunks/pt-BM7OScX6.mjs.map +0 -1
  1128. package/dist/chunks/pt-BM7zXWxW.mjs +0 -2
  1129. package/dist/chunks/pt-BM7zXWxW.mjs.map +0 -1
  1130. package/dist/chunks/pt-BchCuzFq.mjs +0 -2
  1131. package/dist/chunks/pt-BchCuzFq.mjs.map +0 -1
  1132. package/dist/chunks/pt-BmcHFWoR.mjs +0 -2
  1133. package/dist/chunks/pt-BmcHFWoR.mjs.map +0 -1
  1134. package/dist/chunks/pt-C53W99RV.mjs +0 -2
  1135. package/dist/chunks/pt-C53W99RV.mjs.map +0 -1
  1136. package/dist/chunks/pt-CORQy8qv.mjs +0 -2
  1137. package/dist/chunks/pt-CORQy8qv.mjs.map +0 -1
  1138. package/dist/chunks/pt-CUPKr943.mjs +0 -2
  1139. package/dist/chunks/pt-CUPKr943.mjs.map +0 -1
  1140. package/dist/chunks/pt-CYkKDsLa.mjs +0 -2
  1141. package/dist/chunks/pt-CYkKDsLa.mjs.map +0 -1
  1142. package/dist/chunks/pt-Cd_SXHKt.mjs +0 -2
  1143. package/dist/chunks/pt-Cd_SXHKt.mjs.map +0 -1
  1144. package/dist/chunks/pt-CjN3Oq-6.mjs +0 -2
  1145. package/dist/chunks/pt-CjN3Oq-6.mjs.map +0 -1
  1146. package/dist/chunks/pt-CrKrgktr.mjs +0 -2
  1147. package/dist/chunks/pt-CrKrgktr.mjs.map +0 -1
  1148. package/dist/chunks/pt-Crmbkj0e.mjs +0 -2
  1149. package/dist/chunks/pt-Crmbkj0e.mjs.map +0 -1
  1150. package/dist/chunks/pt-D19IWOM_.mjs +0 -2
  1151. package/dist/chunks/pt-D19IWOM_.mjs.map +0 -1
  1152. package/dist/chunks/pt-D6zY7l2E.mjs +0 -2
  1153. package/dist/chunks/pt-D6zY7l2E.mjs.map +0 -1
  1154. package/dist/chunks/pt-DA5hufLZ.mjs +0 -2
  1155. package/dist/chunks/pt-DA5hufLZ.mjs.map +0 -1
  1156. package/dist/chunks/pt-DEfBqu-c.mjs +0 -2
  1157. package/dist/chunks/pt-DEfBqu-c.mjs.map +0 -1
  1158. package/dist/chunks/pt-DG3rw6nK.mjs +0 -2
  1159. package/dist/chunks/pt-DG3rw6nK.mjs.map +0 -1
  1160. package/dist/chunks/pt-DRoAHNZi.mjs +0 -2
  1161. package/dist/chunks/pt-DRoAHNZi.mjs.map +0 -1
  1162. package/dist/chunks/pt-Eml9QiUL.mjs +0 -2
  1163. package/dist/chunks/pt-Eml9QiUL.mjs.map +0 -1
  1164. package/dist/chunks/pt-Haa3wVmA.mjs +0 -2
  1165. package/dist/chunks/pt-Haa3wVmA.mjs.map +0 -1
  1166. package/dist/chunks/pt-aj7zOxTg.mjs +0 -2
  1167. package/dist/chunks/pt-aj7zOxTg.mjs.map +0 -1
  1168. package/dist/chunks/pt-l6dTmkQk.mjs +0 -2
  1169. package/dist/chunks/pt-l6dTmkQk.mjs.map +0 -1
  1170. package/dist/chunks/ru--JPEpdcJ.mjs +0 -2
  1171. package/dist/chunks/ru--JPEpdcJ.mjs.map +0 -1
  1172. package/dist/chunks/ru-B76ORyqe.mjs +0 -2
  1173. package/dist/chunks/ru-B76ORyqe.mjs.map +0 -1
  1174. package/dist/chunks/ru-BDQ62WuE.mjs +0 -2
  1175. package/dist/chunks/ru-BDQ62WuE.mjs.map +0 -1
  1176. package/dist/chunks/ru-BQ6W3lwr.mjs +0 -2
  1177. package/dist/chunks/ru-BQ6W3lwr.mjs.map +0 -1
  1178. package/dist/chunks/ru-BQpaitci.mjs +0 -2
  1179. package/dist/chunks/ru-BQpaitci.mjs.map +0 -1
  1180. package/dist/chunks/ru-Bm9VwJLu.mjs +0 -2
  1181. package/dist/chunks/ru-Bm9VwJLu.mjs.map +0 -1
  1182. package/dist/chunks/ru-BnNdik6i.mjs +0 -2
  1183. package/dist/chunks/ru-BnNdik6i.mjs.map +0 -1
  1184. package/dist/chunks/ru-Bo4am8cd.mjs +0 -2
  1185. package/dist/chunks/ru-Bo4am8cd.mjs.map +0 -1
  1186. package/dist/chunks/ru-C1k56xWQ.mjs +0 -2
  1187. package/dist/chunks/ru-C1k56xWQ.mjs.map +0 -1
  1188. package/dist/chunks/ru-C4rnSQlI.mjs +0 -2
  1189. package/dist/chunks/ru-C4rnSQlI.mjs.map +0 -1
  1190. package/dist/chunks/ru-CKM3t1sv.mjs +0 -2
  1191. package/dist/chunks/ru-CKM3t1sv.mjs.map +0 -1
  1192. package/dist/chunks/ru-CO6eCsxU.mjs +0 -2
  1193. package/dist/chunks/ru-CO6eCsxU.mjs.map +0 -1
  1194. package/dist/chunks/ru-CTaYpQ9_.mjs +0 -2
  1195. package/dist/chunks/ru-CTaYpQ9_.mjs.map +0 -1
  1196. package/dist/chunks/ru-CdY8d80t.mjs +0 -2
  1197. package/dist/chunks/ru-CdY8d80t.mjs.map +0 -1
  1198. package/dist/chunks/ru-CsDtaWRd.mjs +0 -2
  1199. package/dist/chunks/ru-CsDtaWRd.mjs.map +0 -1
  1200. package/dist/chunks/ru-Cy_4nn8h.mjs +0 -2
  1201. package/dist/chunks/ru-Cy_4nn8h.mjs.map +0 -1
  1202. package/dist/chunks/ru-DACtjNuJ.mjs +0 -2
  1203. package/dist/chunks/ru-DACtjNuJ.mjs.map +0 -1
  1204. package/dist/chunks/ru-DN6yN_w9.mjs +0 -2
  1205. package/dist/chunks/ru-DN6yN_w9.mjs.map +0 -1
  1206. package/dist/chunks/ru-DThFtd76.mjs +0 -2
  1207. package/dist/chunks/ru-DThFtd76.mjs.map +0 -1
  1208. package/dist/chunks/ru-Dd_P7hP7.mjs +0 -2
  1209. package/dist/chunks/ru-Dd_P7hP7.mjs.map +0 -1
  1210. package/dist/chunks/ru-Dhuxwzwy.mjs +0 -2
  1211. package/dist/chunks/ru-Dhuxwzwy.mjs.map +0 -1
  1212. package/dist/chunks/ru-Dn6UDGIG.mjs +0 -2
  1213. package/dist/chunks/ru-Dn6UDGIG.mjs.map +0 -1
  1214. package/dist/chunks/ru-DojHc5wu.mjs +0 -2
  1215. package/dist/chunks/ru-DojHc5wu.mjs.map +0 -1
  1216. package/dist/chunks/ru-DyWzWBjV.mjs +0 -2
  1217. package/dist/chunks/ru-DyWzWBjV.mjs.map +0 -1
  1218. package/dist/chunks/ru-NBxCkjlP.mjs +0 -2
  1219. package/dist/chunks/ru-NBxCkjlP.mjs.map +0 -1
  1220. package/dist/chunks/ru-_MQaVHam.mjs +0 -2
  1221. package/dist/chunks/ru-_MQaVHam.mjs.map +0 -1
  1222. package/dist/chunks/ru-wv17PPrd.mjs +0 -2
  1223. package/dist/chunks/ru-wv17PPrd.mjs.map +0 -1
  1224. package/dist/chunks/src-ooaZ_Egu.mjs +0 -2
  1225. package/dist/chunks/src-ooaZ_Egu.mjs.map +0 -1
  1226. package/dist/chunks/zh-2-Y3Limy.mjs +0 -2
  1227. package/dist/chunks/zh-2-Y3Limy.mjs.map +0 -1
  1228. package/dist/chunks/zh-B02VPMqX.mjs +0 -2
  1229. package/dist/chunks/zh-B02VPMqX.mjs.map +0 -1
  1230. package/dist/chunks/zh-BYjLBWWN.mjs +0 -2
  1231. package/dist/chunks/zh-BYjLBWWN.mjs.map +0 -1
  1232. package/dist/chunks/zh-Bt2ZdHcS.mjs +0 -2
  1233. package/dist/chunks/zh-Bt2ZdHcS.mjs.map +0 -1
  1234. package/dist/chunks/zh-BuN_C4o-.mjs +0 -2
  1235. package/dist/chunks/zh-BuN_C4o-.mjs.map +0 -1
  1236. package/dist/chunks/zh-CA3BDj0Y.mjs +0 -2
  1237. package/dist/chunks/zh-CA3BDj0Y.mjs.map +0 -1
  1238. package/dist/chunks/zh-CHuGP7RS.mjs +0 -2
  1239. package/dist/chunks/zh-CHuGP7RS.mjs.map +0 -1
  1240. package/dist/chunks/zh-CIPsF5P8.mjs +0 -2
  1241. package/dist/chunks/zh-CIPsF5P8.mjs.map +0 -1
  1242. package/dist/chunks/zh-C_YS18re.mjs +0 -2
  1243. package/dist/chunks/zh-C_YS18re.mjs.map +0 -1
  1244. package/dist/chunks/zh-CfMPFWUg.mjs +0 -2
  1245. package/dist/chunks/zh-CfMPFWUg.mjs.map +0 -1
  1246. package/dist/chunks/zh-CfjCcBIB.mjs +0 -2
  1247. package/dist/chunks/zh-CfjCcBIB.mjs.map +0 -1
  1248. package/dist/chunks/zh-CqQph809.mjs +0 -2
  1249. package/dist/chunks/zh-CqQph809.mjs.map +0 -1
  1250. package/dist/chunks/zh-Cxe42GC5.mjs +0 -2
  1251. package/dist/chunks/zh-Cxe42GC5.mjs.map +0 -1
  1252. package/dist/chunks/zh-CyMU2cTf.mjs +0 -2
  1253. package/dist/chunks/zh-CyMU2cTf.mjs.map +0 -1
  1254. package/dist/chunks/zh-Cynz1sBa.mjs +0 -2
  1255. package/dist/chunks/zh-Cynz1sBa.mjs.map +0 -1
  1256. package/dist/chunks/zh-DRKs6Q0a.mjs +0 -2
  1257. package/dist/chunks/zh-DRKs6Q0a.mjs.map +0 -1
  1258. package/dist/chunks/zh-DTuIJjx6.mjs +0 -2
  1259. package/dist/chunks/zh-DTuIJjx6.mjs.map +0 -1
  1260. package/dist/chunks/zh-DTz9l6mp.mjs +0 -2
  1261. package/dist/chunks/zh-DTz9l6mp.mjs.map +0 -1
  1262. package/dist/chunks/zh-DZwjiJmn.mjs +0 -2
  1263. package/dist/chunks/zh-DZwjiJmn.mjs.map +0 -1
  1264. package/dist/chunks/zh-D_VJDQl4.mjs +0 -2
  1265. package/dist/chunks/zh-D_VJDQl4.mjs.map +0 -1
  1266. package/dist/chunks/zh-Dt20Om7Z.mjs +0 -2
  1267. package/dist/chunks/zh-Dt20Om7Z.mjs.map +0 -1
  1268. package/dist/chunks/zh-SgsZ9f-W.mjs +0 -2
  1269. package/dist/chunks/zh-SgsZ9f-W.mjs.map +0 -1
  1270. package/dist/chunks/zh-XR7Ls7m-.mjs +0 -2
  1271. package/dist/chunks/zh-XR7Ls7m-.mjs.map +0 -1
  1272. package/dist/chunks/zh-aXPI9lKF.mjs +0 -2
  1273. package/dist/chunks/zh-aXPI9lKF.mjs.map +0 -1
  1274. package/dist/chunks/zh-cLXIKkZQ.mjs +0 -2
  1275. package/dist/chunks/zh-cLXIKkZQ.mjs.map +0 -1
  1276. package/dist/chunks/zh-cZUtN871.mjs +0 -2
  1277. package/dist/chunks/zh-cZUtN871.mjs.map +0 -1
  1278. package/dist/chunks/zh-hcdnCGUp.mjs +0 -2
  1279. package/dist/chunks/zh-hcdnCGUp.mjs.map +0 -1
package/README.md CHANGED
@@ -299,6 +299,8 @@ notectl ships plugins for:
299
299
  - Tables
300
300
  - Code blocks
301
301
  - Images
302
+ - Math and formulas (MathML)
303
+ - Video embeds
302
304
  - Text color and highlight
303
305
  - Alignment and text direction
304
306
  - Fonts and font sizes
@@ -0,0 +1,2 @@
1
+ import{s as t}from"./StyleRuntime-BAutwDZT.mjs";import{a as e,i as s,r as i,s as n,t as a}from"./PluginHelpers-D4quRJ5a.mjs";import{t as l}from"./NodeSpecPatching-B_yLknTl.mjs";var r={alignStart:"Align Start",alignCenter:"Align Center",alignEnd:"Align End",justify:"Justify",toolbarLabel:"Alignment",toolbarTooltip:"Alignment"},o=/* #__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-Bdmunk5h.mjs"),"./locales/de.ts":()=>import("./de-B8-w9gPi.mjs"),"./locales/es.ts":()=>import("./es-B8K3Yvf3.mjs"),"./locales/fr.ts":()=>import("./fr-BeRlON1t.mjs"),"./locales/hi.ts":()=>import("./hi-Bl-yeeOI.mjs"),"./locales/pt.ts":()=>import("./pt-5VeuNDd2.mjs"),"./locales/ru.ts":()=>import("./ru-Yngw7nFP.mjs"),"./locales/zh.ts":()=>import("./zh-BvuAbM2S.mjs")});async function g(t){return n(o,t,r)}var m={alignments:["start","center","end","justify"],alignableTypes:["paragraph","heading","title","subtitle","table_cell","image"],defaults:{image:"center"}},c={start:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15 15H3v2h12v-2zm0-8H3v2h12V7zM3 13h18v-2H3v2zm0 8h18v-2H3v2zM3 3v2h18V3H3z"/></svg>',center:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 15v2h10v-2H7zm-4 6h18v-2H3v2zm0-8h18v-2H3v2zm4-6v2h10V7H7zM3 3v2h18V3H3z"/></svg>',end:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 21h18v-2H3v2zm6-4h12v-2H9v2zm-6-4h18v-2H3v2zm6-4h12V7H9v2zM3 3v2h18V3H3z"/></svg>',justify:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 21h18v-2H3v2zm0-4h18v-2H3v2zm0-4h18v-2H3v2zm0-4h18V7H3v2zM3 3v2h18V3H3z"/></svg>'},h=class{id="alignment";name="Alignment";priority=90;config;locale;alignableTypes;constructor(t){this.config={...m,...t,defaults:{...m.defaults,...t?.defaults}}}async init(t){this.locale=await e(t,this.config.locale,r,g),this.alignableTypes=new Set(this.config.alignableTypes),this.patchNodeSpecs(t),this.registerCommands(t),this.registerKeymaps(t),this.registerToolbarItem(t),this.registerMiddleware(t)}patchNodeSpecs(t){l(t.getSchemaRegistry(),this.config.alignableTypes,{attrName:"align",getDefault:t=>this.config.defaults[t]??"start",applyToDOM:p})}registerCommands(t){for(const e of this.config.alignments)t.registerCommand(`align${a(e)}`,()=>this.setAlignment(t,e))}registerKeymaps(t){const e={};this.config.alignments.includes("start")&&(e["Mod-Shift-L"]=()=>t.executeCommand("alignStart")),this.config.alignments.includes("center")&&(e["Mod-Shift-E"]=()=>t.executeCommand("alignCenter")),this.config.alignments.includes("end")&&(e["Mod-Shift-R"]=()=>t.executeCommand("alignEnd")),this.config.alignments.includes("justify")&&(e["Mod-Shift-J"]=()=>t.executeCommand("alignJustify")),Object.keys(e).length>0&&t.registerKeymap(e)}registerToolbarItem(t){const e=this.config.alignments.map(t=>({label:this.getAlignmentLabel(t),command:`align${a(t)}`,icon:c[t]}));t.registerToolbarItem({id:"alignment",group:"block",icon:c.start,label:this.locale.toolbarLabel,tooltip:this.locale.toolbarTooltip,command:"alignStart",popupType:"dropdown",popupConfig:{items:e},isActive:t=>this.isNonDefaultAlignment(t),isEnabled:t=>this.isAlignable(t)})}getAlignmentLabel(t){return{start:this.locale.alignStart,center:this.locale.alignCenter,end:this.locale.alignEnd,justify:this.locale.justify}[t]}registerMiddleware(t){t.registerMiddleware((t,e,s)=>{let i=!1;const n=t.steps.map(t=>{if("setBlockType"!==t.type)return t;if(!this.alignableTypes.has(t.nodeType))return t;const e=t.previousAttrs?.align;return e&&"start"!==e?(i=!0,{...t,attrs:{...t.attrs,align:e}}):t});s(i?{...t,steps:n}:t)},{name:"alignment:preserve-align"})}setAlignment(t,e){const n=t.getState(),a=i(n);if(!a||!this.alignableTypes.has(a.type))return!1;const l=s(n);if(!l)return!1;const r=n.getNodePath(l);if(!r)return!1;const o={...a.attrs,align:e},g=n.transaction("command").setNodeAttr(r,o).setSelection(n.selection).build();return t.dispatch(g),!0}isNonDefaultAlignment(t){const e=i(t);if(!e||!this.alignableTypes.has(e.type))return!1;const s=e.attrs?.align,n=this.config.defaults[e.type]??"start";return null!=s&&s!==n}isAlignable(t){const e=i(t);return null!=e&&this.alignableTypes.has(e.type)}};function p(e,s){const i=s.attrs?.align;"string"==typeof i&&"start"!==i&&t(e,"textAlign",i)}export{g as i,h as n,r,c as t};
2
+ //# sourceMappingURL=AlignmentPlugin-h6sx-yIf.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AlignmentPlugin-h6sx-yIf.mjs","names":[],"sources":["../../src/plugins/alignment/AlignmentLocale.ts","../../src/plugins/alignment/AlignmentPlugin.ts"],"sourcesContent":["/** Locale interface and default English locale for the AlignmentPlugin. */\n\nimport { type LocaleModuleMap, loadLocaleModule } from '../shared/LocaleLoader.js';\n\nexport interface AlignmentLocale {\n\treadonly alignStart: string;\n\treadonly alignCenter: string;\n\treadonly alignEnd: string;\n\treadonly justify: string;\n\treadonly toolbarLabel: string;\n\treadonly toolbarTooltip: string;\n}\n\n// --- Default English Locale ---\n\nexport const ALIGNMENT_LOCALE_EN: AlignmentLocale = {\n\talignStart: 'Align Start',\n\talignCenter: 'Align Center',\n\talignEnd: 'Align End',\n\tjustify: 'Justify',\n\ttoolbarLabel: 'Alignment',\n\ttoolbarTooltip: 'Alignment',\n};\n\n// --- Lazy Locale Loader ---\n\nconst localeModules: LocaleModuleMap<AlignmentLocale> = import.meta.glob<{\n\tdefault: AlignmentLocale;\n}>('./locales/*.ts', { eager: false });\n\nexport async function loadAlignmentLocale(lang: string): Promise<AlignmentLocale> {\n\treturn loadLocaleModule(localeModules, lang, ALIGNMENT_LOCALE_EN);\n}\n","/**\n * AlignmentPlugin: adds start/center/end/justify alignment as a block\n * attribute on paragraphs, headings, images, and other alignable types.\n * Uses logical values (`start`/`end`) instead of physical (`left`/`right`)\n * for correct behavior with RTL text direction. Patches NodeSpecs to render\n * the `align` attribute via inline `text-align` style and provides toggle\n * commands, keyboard shortcuts, and a toolbar dropdown.\n */\n\nimport type { BlockAlignment } from '../../model/BlockAlignment.js';\nimport type { BlockNode } from '../../model/Document.js';\nimport type { BlockId } from '../../model/TypeBrands.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport { setStyleProperty } from '../../style/StyleRuntime.js';\nimport type { Plugin, PluginContext } from '../Plugin.js';\nimport { patchNodeSpecAttr } from '../shared/NodeSpecPatching.js';\nimport {\n\tcapitalize,\n\tgetSelectedBlock,\n\tgetSelectedBlockId,\n\tresolveLocale,\n} from '../shared/PluginHelpers.js';\nimport {\n\tALIGNMENT_LOCALE_EN,\n\ttype AlignmentLocale,\n\tloadAlignmentLocale,\n} from './AlignmentLocale.js';\n\n// --- Public Types ---\n\nexport interface AlignmentConfig {\n\t/** Which alignments to expose. Defaults to all four. */\n\treadonly alignments: readonly BlockAlignment[];\n\t/** Block types that support alignment. Defaults to paragraph + heading + title + subtitle + table_cell + image. */\n\treadonly alignableTypes: readonly string[];\n\t/** Per-type default alignment (e.g. `{ image: 'center' }`). Falls back to `'start'`. */\n\treadonly defaults: Readonly<Record<string, BlockAlignment>>;\n\treadonly locale?: AlignmentLocale;\n}\n\n// --- Constants ---\n\nconst DEFAULT_CONFIG: AlignmentConfig = {\n\talignments: ['start', 'center', 'end', 'justify'],\n\talignableTypes: ['paragraph', 'heading', 'title', 'subtitle', 'table_cell', 'image'],\n\tdefaults: { image: 'center' },\n};\n\nexport const ALIGNMENT_ICONS: Readonly<Record<BlockAlignment, string>> = {\n\tstart:\n\t\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M15 15H3v2h12v-2zm0-8H3v2h12V7zM3 13h18v-2H3v2zm0 8h18v-2H3v2zM3 3v2h18V3H3z\"/></svg>',\n\tcenter:\n\t\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M7 15v2h10v-2H7zm-4 6h18v-2H3v2zm0-8h18v-2H3v2zm4-6v2h10V7H7zM3 3v2h18V3H3z\"/></svg>',\n\tend: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M3 21h18v-2H3v2zm6-4h12v-2H9v2zm-6-4h18v-2H3v2zm6-4h12V7H9v2zM3 3v2h18V3H3z\"/></svg>',\n\tjustify:\n\t\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M3 21h18v-2H3v2zm0-4h18v-2H3v2zm0-4h18v-2H3v2zm0-4h18V7H3v2zM3 3v2h18V3H3z\"/></svg>',\n};\n\n// --- Plugin ---\n\nexport class AlignmentPlugin implements Plugin {\n\treadonly id = 'alignment';\n\treadonly name = 'Alignment';\n\treadonly priority = 90;\n\n\tprivate readonly config: AlignmentConfig;\n\tprivate locale!: AlignmentLocale;\n\tprivate alignableTypes!: ReadonlySet<string>;\n\n\tconstructor(config?: Partial<AlignmentConfig>) {\n\t\tthis.config = {\n\t\t\t...DEFAULT_CONFIG,\n\t\t\t...config,\n\t\t\tdefaults: { ...DEFAULT_CONFIG.defaults, ...config?.defaults },\n\t\t};\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\tALIGNMENT_LOCALE_EN,\n\t\t\tloadAlignmentLocale,\n\t\t);\n\n\t\tthis.alignableTypes = new Set(this.config.alignableTypes);\n\t\tthis.patchNodeSpecs(context);\n\t\tthis.registerCommands(context);\n\t\tthis.registerKeymaps(context);\n\t\tthis.registerToolbarItem(context);\n\t\tthis.registerMiddleware(context);\n\t}\n\n\t// --- NodeSpec Patching ---\n\n\t/**\n\t * Patches existing NodeSpecs for alignable block types to support the\n\t * `align` attribute and render it as an inline style. Skips types\n\t * that already define an `align` attribute in their spec.\n\t */\n\tprivate patchNodeSpecs(context: PluginContext): void {\n\t\tpatchNodeSpecAttr(context.getSchemaRegistry(), this.config.alignableTypes, {\n\t\t\tattrName: 'align',\n\t\t\tgetDefault: (type) => this.config.defaults[type] ?? 'start',\n\t\t\tapplyToDOM: applyAlignment,\n\t\t});\n\t}\n\n\t// --- Commands ---\n\n\tprivate registerCommands(context: PluginContext): void {\n\t\tfor (const alignment of this.config.alignments) {\n\t\t\tcontext.registerCommand(`align${capitalize(alignment)}`, () => {\n\t\t\t\treturn this.setAlignment(context, alignment);\n\t\t\t});\n\t\t}\n\t}\n\n\t// --- Keymaps ---\n\n\tprivate registerKeymaps(context: PluginContext): void {\n\t\tconst bindings: Record<string, () => boolean> = {};\n\n\t\tif (this.config.alignments.includes('start')) {\n\t\t\tbindings['Mod-Shift-L'] = () => context.executeCommand('alignStart');\n\t\t}\n\t\tif (this.config.alignments.includes('center')) {\n\t\t\tbindings['Mod-Shift-E'] = () => context.executeCommand('alignCenter');\n\t\t}\n\t\tif (this.config.alignments.includes('end')) {\n\t\t\tbindings['Mod-Shift-R'] = () => context.executeCommand('alignEnd');\n\t\t}\n\t\tif (this.config.alignments.includes('justify')) {\n\t\t\tbindings['Mod-Shift-J'] = () => context.executeCommand('alignJustify');\n\t\t}\n\n\t\tif (Object.keys(bindings).length > 0) {\n\t\t\tcontext.registerKeymap(bindings);\n\t\t}\n\t}\n\n\t// --- Toolbar ---\n\n\tprivate registerToolbarItem(context: PluginContext): void {\n\t\tconst dropdownItems = this.config.alignments.map((alignment) => ({\n\t\t\tlabel: this.getAlignmentLabel(alignment),\n\t\t\tcommand: `align${capitalize(alignment)}`,\n\t\t\ticon: ALIGNMENT_ICONS[alignment],\n\t\t}));\n\n\t\tcontext.registerToolbarItem({\n\t\t\tid: 'alignment',\n\t\t\tgroup: 'block',\n\t\t\ticon: ALIGNMENT_ICONS.start,\n\t\t\tlabel: this.locale.toolbarLabel,\n\t\t\ttooltip: this.locale.toolbarTooltip,\n\t\t\tcommand: 'alignStart',\n\t\t\tpopupType: 'dropdown',\n\t\t\tpopupConfig: { items: dropdownItems },\n\t\t\tisActive: (state) => this.isNonDefaultAlignment(state),\n\t\t\tisEnabled: (state) => this.isAlignable(state),\n\t\t});\n\t}\n\n\tprivate getAlignmentLabel(alignment: BlockAlignment): string {\n\t\tconst labels: Record<BlockAlignment, string> = {\n\t\t\tstart: this.locale.alignStart,\n\t\t\tcenter: this.locale.alignCenter,\n\t\t\tend: this.locale.alignEnd,\n\t\t\tjustify: this.locale.justify,\n\t\t};\n\t\treturn labels[alignment];\n\t}\n\n\t// --- Middleware ---\n\n\t/**\n\t * Preserves the `align` attribute when other plugins change the block\n\t * type (e.g. paragraph → heading) via `setBlockType`, which replaces attrs.\n\t */\n\tprivate registerMiddleware(context: PluginContext): void {\n\t\tcontext.registerMiddleware(\n\t\t\t(tr, _state, next) => {\n\t\t\t\tlet patched = false;\n\n\t\t\t\tconst patchedSteps = tr.steps.map((step) => {\n\t\t\t\t\tif (step.type !== 'setBlockType') return step;\n\t\t\t\t\tif (!this.alignableTypes.has(step.nodeType)) return step;\n\n\t\t\t\t\tconst prevAlign = step.previousAttrs?.align;\n\t\t\t\t\tif (!prevAlign || prevAlign === 'start') return step;\n\n\t\t\t\t\t// Carry forward align into new attrs\n\t\t\t\t\tpatched = true;\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...step,\n\t\t\t\t\t\tattrs: { ...step.attrs, align: prevAlign },\n\t\t\t\t\t};\n\t\t\t\t});\n\n\t\t\t\tnext(patched ? { ...tr, steps: patchedSteps } : tr);\n\t\t\t},\n\t\t\t{ name: 'alignment:preserve-align' },\n\t\t);\n\t}\n\n\t// --- Alignment Logic ---\n\n\tprivate setAlignment(context: PluginContext, alignment: BlockAlignment): boolean {\n\t\tconst state = context.getState();\n\t\tconst block = getSelectedBlock(state);\n\t\tif (!block || !this.alignableTypes.has(block.type)) return false;\n\n\t\tconst id = getSelectedBlockId(state);\n\t\tif (!id) return false;\n\n\t\tconst path = state.getNodePath(id);\n\t\tif (!path) return false;\n\n\t\tconst newAttrs = { ...block.attrs, align: alignment };\n\n\t\tconst tr = state\n\t\t\t.transaction('command')\n\t\t\t.setNodeAttr(path as BlockId[], newAttrs)\n\t\t\t.setSelection(state.selection)\n\t\t\t.build();\n\n\t\tcontext.dispatch(tr);\n\t\treturn true;\n\t}\n\n\tprivate isNonDefaultAlignment(state: EditorState): boolean {\n\t\tconst block = getSelectedBlock(state);\n\t\tif (!block || !this.alignableTypes.has(block.type)) return false;\n\t\tconst align = block.attrs?.align;\n\t\tconst defaultAlign: BlockAlignment = this.config.defaults[block.type] ?? 'start';\n\t\treturn align != null && align !== defaultAlign;\n\t}\n\n\tprivate isAlignable(state: EditorState): boolean {\n\t\tconst block = getSelectedBlock(state);\n\t\treturn block != null && this.alignableTypes.has(block.type);\n\t}\n}\n\n// --- Helpers ---\n\nfunction applyAlignment(el: HTMLElement, node: BlockNode): void {\n\tconst align = node.attrs?.align;\n\tif (typeof align === 'string' && align !== 'start') {\n\t\tsetStyleProperty(el, 'textAlign', align);\n\t}\n}\n"],"mappings":"iLAeA,IAAa,EAAuC,CACnD,WAAY,cACZ,YAAa,eACb,SAAU,YACV,QAAS,UACT,aAAc,YACd,eAAgB,aAKX,iBAAkD,OAAA,OAAA,CAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,uBAIxD,eAAsB,EAAoB,GACzC,OAAO,EAAiB,EAAe,EAAM,EAC9C,CCUA,IAAM,EAAkC,CACvC,WAAY,CAAC,QAAS,SAAU,MAAO,WACvC,eAAgB,CAAC,YAAa,UAAW,QAAS,WAAY,aAAc,SAC5E,SAAU,CAAE,MAAO,WAGP,EAA4D,CACxE,MACC,6JACD,OACC,4JACD,IAAK,4JACL,QACC,4JAKW,EAAb,MACC,GAAc,YACd,KAAgB,YAChB,SAAoB,GAEpB,OACA,OACA,eAEA,WAAA,CAAY,GACX,KAAK,OAAS,IACV,KACA,EACH,SAAU,IAAK,EAAe,YAAa,GAAQ,UAErD,CAEA,UAAM,CAAK,GACV,KAAK,aAAe,EACnB,EACA,KAAK,OAAO,OACZ,EACA,GAGD,KAAK,eAAiB,IAAI,IAAI,KAAK,OAAO,gBAC1C,KAAK,eAAe,GACpB,KAAK,iBAAiB,GACtB,KAAK,gBAAgB,GACrB,KAAK,oBAAoB,GACzB,KAAK,mBAAmB,EACzB,CASA,cAAA,CAAuB,GACtB,EAAkB,EAAQ,oBAAqB,KAAK,OAAO,eAAgB,CAC1E,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,KAAyB,OAAO,EACzC,IAAK,KAAK,eAAe,IAAI,EAAK,UAAW,OAAO,EAEpD,MAAM,EAAY,EAAK,eAAe,MACtC,OAAK,GAA2B,UAAd,GAGlB,GAAU,EACH,IACH,EACH,MAAO,IAAK,EAAK,MAAO,MAAO,KANgB,IAUjD,EAAK,EAAU,IAAK,EAAI,MAAO,GAAiB,IAEjD,CAAE,KAAM,4BAEV,CAIA,YAAA,CAAqB,EAAwB,GAC5C,MAAM,EAAQ,EAAQ,WAChB,EAAQ,EAAiB,GAC/B,IAAK,IAAU,KAAK,eAAe,IAAI,EAAM,MAAO,OAAO,EAE3D,MAAM,EAAK,EAAmB,GAC9B,IAAK,EAAI,OAAO,EAEhB,MAAM,EAAO,EAAM,YAAY,GAC/B,IAAK,EAAM,OAAO,EAElB,MAAM,EAAW,IAAK,EAAM,MAAO,MAAO,GAEpC,EAAK,EACT,YAAY,WACZ,YAAY,EAAmB,GAC/B,aAAa,EAAM,WACnB,QAGF,OADA,EAAQ,SAAS,IACV,CACR,CAEA,qBAAA,CAA8B,GAC7B,MAAM,EAAQ,EAAiB,GAC/B,IAAK,IAAU,KAAK,eAAe,IAAI,EAAM,MAAO,OAAO,EAC3D,MAAM,EAAQ,EAAM,OAAO,MACrB,EAA+B,KAAK,OAAO,SAAS,EAAM,OAAS,QACzE,OAAgB,MAAT,GAAiB,IAAU,CACnC,CAEA,WAAA,CAAoB,GACnB,MAAM,EAAQ,EAAiB,GAC/B,OAAgB,MAAT,GAAiB,KAAK,eAAe,IAAI,EAAM,KACvD,GAKD,SAAS,EAAe,EAAiB,GACxC,MAAM,EAAQ,EAAK,OAAO,MACL,iBAAV,GAAgC,UAAV,GAChC,EAAiB,EAAI,YAAa,EAEpC"}
@@ -0,0 +1,2 @@
1
+ import{C as n}from"./Document-r7vLOAGA.mjs";function t(n,t){return n.type===t}function r(n,t){return n.type===t}function e(t,r){return n(t)&&t.inlineType===r}export{r as n,t as r,e as t};
2
+ //# sourceMappingURL=AttrRegistry-DcDVyzLm.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AttrRegistry-DcDVyzLm.mjs","names":[],"sources":["../../src/model/AttrRegistry.ts"],"sourcesContent":["/**\n * Module-augmentable attribute registries for type-safe node/mark attributes.\n *\n * Plugins extend these interfaces via `declare module`:\n * @example\n * declare module '../../model/AttrRegistry.js' {\n * interface NodeAttrRegistry {\n * heading: { level: HeadingLevel; align?: BlockAlignment };\n * }\n * }\n */\n\nimport type { BlockAlignment } from './BlockAlignment.js';\nimport type { BlockNode, InlineNode, Mark } from './Document.js';\nimport { isInlineNode } from './Document.js';\n\n/** Plugins augment this interface to register typed node attributes. */\nexport interface NodeAttrRegistry {\n\tparagraph: { align?: BlockAlignment };\n}\n\n/** Plugins augment this interface to register typed mark attributes. */\nexport interface MarkAttrRegistry {\n\tbold: Record<string, never>;\n\titalic: Record<string, never>;\n\tunderline: Record<string, never>;\n}\n\n/** Resolves typed attributes for known node types, falls back for unknown. */\nexport type NodeAttrsFor<T extends string> = T extends keyof NodeAttrRegistry\n\t? NodeAttrRegistry[T]\n\t: Record<string, string | number | boolean>;\n\n/** Resolves typed attributes for known mark types, falls back for unknown. */\nexport type MarkAttrsFor<T extends string> = T extends keyof MarkAttrRegistry\n\t? MarkAttrRegistry[T]\n\t: Record<string, string | number | boolean>;\n\n/** Narrows a BlockNode to a typed variant with known attributes. */\nexport function isNodeOfType<T extends keyof NodeAttrRegistry>(\n\tnode: BlockNode,\n\ttype: T,\n): node is BlockNode & { readonly type: T; readonly attrs: NodeAttrRegistry[T] } {\n\treturn (node.type as string) === type;\n}\n\n/** Narrows a Mark to a typed variant with known attributes. */\nexport function isMarkOfType<T extends keyof MarkAttrRegistry>(\n\tmark: Mark,\n\ttype: T,\n): mark is Mark & { readonly type: T; readonly attrs: MarkAttrRegistry[T] } {\n\treturn (mark.type as string) === type;\n}\n\n// --- InlineNode Attribute Registry ---\n\n/** Plugins augment this interface to register typed inline node attributes. */\n// biome-ignore lint/suspicious/noEmptyInterface: module augmentation requires interface\nexport interface InlineNodeAttrRegistry {}\n\n/** Resolves typed attributes for known inline node types, falls back for unknown. */\nexport type InlineNodeAttrsFor<T extends string> = T extends keyof InlineNodeAttrRegistry\n\t? InlineNodeAttrRegistry[T]\n\t: Record<string, string | number | boolean>;\n\n/** Narrows an InlineNode to a typed variant with known attributes. */\nexport function isInlineNodeOfType<T extends keyof InlineNodeAttrRegistry>(\n\tnode: InlineNode,\n\tinlineNodeType: T,\n): node is InlineNode & {\n\treadonly inlineType: T;\n\treadonly attrs: InlineNodeAttrRegistry[T];\n} {\n\treturn isInlineNode(node) && (node.inlineType as string) === inlineNodeType;\n}\n"],"mappings":"4CAuCA,SAAgB,EACf,EACA,GAEA,OAAQ,EAAK,OAAoB,CAClC,CAGA,SAAgB,EACf,EACA,GAEA,OAAQ,EAAK,OAAoB,CAClC,CAcA,SAAgB,EACf,EACA,GAKA,OAAO,EAAa,IAAU,EAAK,aAA0B,CAC9D"}
@@ -0,0 +1,2 @@
1
+ import{T as t,_ as n,b as o,m as e,v as r}from"./Document-r7vLOAGA.mjs";import{d as s,o as c,u as i}from"./Selection-HYoVFpAx.mjs";import{i as a}from"./TypeBrands-Ch9856Gb.mjs";import{n as l}from"./AttrRegistry-DcDVyzLm.mjs";import{n as u}from"./RangeIterator-o8v3msQe.mjs";function f(t,n){return!1!==t.getMarkSpec?.(n)?.inclusive}function m(t){if(t.storedMarks)return t.storedMarks;const o=t.selection;if(!i(o)||!c(o))return[];const e=t.getBlock(o.anchor.blockId);return e?n(e,o.anchor.offset,n=>f(t.schema,n)):[]}function d(t,n){const o=t.selection;if(!i(o))return null;const e=a(n.type);if(c(o)){if(!t.getBlock(o.anchor.blockId))return null;const r=[...m(t).filter(t=>t.type!==e),n];return t.transaction("command").setStoredMarks(r,t.storedMarks).setSelection(o).build()}const r=s(o,t.getBlockOrder()),l=t.transaction("command");return u(t,r,(o,r,s)=>{const c=t.getBlock(o);if(c){const t=M(c,e,r,s);t&&l.removeMark(o,r,s,t)}l.addMark(o,r,s,n)}),l.setSelection(o),l.build()}function k(t,n){const e=t.selection;if(!i(e))return null;if(c(e)){if(!t.getBlock(e.anchor.blockId))return null;const r=m(t);if(!o(r,n))return null;const s=r.filter(t=>t.type!==n);return t.transaction("command").setStoredMarks(s,t.storedMarks).setSelection(e).build()}const r=s(e,t.getBlockOrder()),a=t.transaction("command");return u(t,r,(o,e,r)=>{const s=t.getBlock(o),c=s?M(s,n,e,r):void 0;a.removeMark(o,e,r,c??{type:n})}),a.setSelection(e),a.build()}function p(t,n,o){const r=t.selection;if(!i(r))return null;let s;if(c(r))s=m(t);else{const n=t.getBlock(r.anchor.blockId);if(!n)return null;s=e(n,r.anchor.offset)}const a=s.find(t=>t.type===n);return a&&l(a,n)?o(a):null}function g(t,n){return null!==p(t,n,()=>!0)}function M(n,o,e,s){const c=r(n);let i=0;for(const r of c){if(!t(r)){i+=1;continue}const n=i+r.text.length;if(n>e&&i<s){const t=r.marks.find(t=>t.type===o);if(t)return t}i=n}}export{f as a,k as i,p as n,m as o,g as r,d as t};
2
+ //# sourceMappingURL=AttributedMarkCommands-D4W2Jgpj.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AttributedMarkCommands-D4W2Jgpj.mjs","names":[],"sources":["../../src/commands/CursorMarks.ts","../../src/commands/AttributedMarkCommands.ts"],"sourcesContent":["/**\n * Resolves the marks active at a collapsed cursor for insertion and toolbar\n * state. Centralizes the `storedMarks ?? derived-marks` lookup that several\n * command modules previously duplicated, and makes that derivation honor\n * mark inclusivity (see {@link MarkSpec.inclusive}) so non-inclusive marks\n * such as links do not bleed onto text typed at their right boundary.\n */\n\nimport type { Mark } from '../model/Document.js';\nimport { getCursorMarks } from '../model/Document.js';\nimport type { Schema } from '../model/Schema.js';\nimport { isCollapsed, isTextSelection } from '../model/Selection.js';\nimport type { MarkTypeName } from '../model/TypeBrands.js';\nimport type { EditorState } from '../state/EditorState.js';\n\n/** A mark extends onto adjacent typing unless its spec opts out via `inclusive: false`. */\nexport function isMarkInclusive(schema: Schema, type: MarkTypeName): boolean {\n\treturn schema.getMarkSpec?.(type)?.inclusive !== false;\n}\n\n/**\n * Returns the marks a collapsed cursor carries: stored marks when present,\n * otherwise the inclusivity-aware marks derived from the surrounding content.\n * Returns an empty set for non-text or non-collapsed selections.\n */\nexport function resolveCursorMarks(state: EditorState): readonly Mark[] {\n\tif (state.storedMarks) return state.storedMarks;\n\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel) || !isCollapsed(sel)) return [];\n\n\tconst block = state.getBlock(sel.anchor.blockId);\n\tif (!block) return [];\n\n\treturn getCursorMarks(block, sel.anchor.offset, (type) => isMarkInclusive(state.schema, type));\n}\n","/**\n * Generic helpers for attributed marks (marks with key/value attrs).\n *\n * Unlike boolean marks (`bold`, `italic`) that toggle on/off, attributed\n * marks (`font`, `fontSize`, `textColor`, `highlight`) carry data and use\n * **replace** semantics: applying a new value removes the old one first.\n *\n * These helpers extract the duplicated collapsed-vs-range branching that\n * was previously copy-pasted across ColorMarkOperations, FontSizeOperations,\n * and FontPlugin.\n */\n\nimport { isMarkOfType } from '../model/AttrRegistry.js';\nimport type { MarkAttrRegistry } from '../model/AttrRegistry.js';\nimport type { BlockNode, Mark, TextNode } from '../model/Document.js';\nimport {\n\tgetBlockMarksAtOffset,\n\tgetInlineChildren,\n\thasMark,\n\tisTextNode,\n} from '../model/Document.js';\nimport type { InlineNode } from '../model/Document.js';\nimport { isCollapsed, isTextSelection, selectionRange } from '../model/Selection.js';\nimport { markType } from '../model/TypeBrands.js';\nimport type { MarkTypeName } 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/**\n * Applies an attributed mark to the current selection.\n *\n * - **Collapsed cursor**: replaces stored marks (filters out old mark of the\n * same type, appends the new one).\n * - **Range selection**: removes then re-adds the mark in every block span.\n *\n * Returns the built `Transaction`, or `null` when the selection is\n * unsupported (node-selection / gap-cursor) or the anchor block is missing.\n */\nexport function applyAttributedMark(state: EditorState, mark: Mark): Transaction | null {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return null;\n\n\tconst typeName: MarkTypeName = markType(mark.type as string);\n\n\tif (isCollapsed(sel)) {\n\t\tconst anchorBlock = state.getBlock(sel.anchor.blockId);\n\t\tif (!anchorBlock) return null;\n\t\tconst currentMarks: readonly Mark[] = resolveCursorMarks(state);\n\t\tconst withoutMark: readonly Mark[] = currentMarks.filter((m) => m.type !== typeName);\n\t\tconst newMarks: readonly Mark[] = [...withoutMark, 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\tconst range = selectionRange(sel, state.getBlockOrder());\n\tconst builder = state.transaction('command');\n\n\tforEachBlockInRange(state, range, (blockId, from, to) => {\n\t\tconst block: BlockNode | undefined = state.getBlock(blockId);\n\t\tif (block) {\n\t\t\tconst existing: Mark | undefined = findMarkInRange(block, typeName, from, to);\n\t\t\tif (existing) {\n\t\t\t\tbuilder.removeMark(blockId, from, to, existing);\n\t\t\t}\n\t\t}\n\t\tbuilder.addMark(blockId, from, to, mark);\n\t});\n\n\tbuilder.setSelection(sel);\n\treturn builder.build();\n}\n\n/**\n * Removes an attributed mark from the current selection.\n *\n * - **Collapsed cursor**: filters the mark out of stored marks.\n * Returns `null` when the mark was not present.\n * - **Range selection**: removes the mark across all block spans.\n *\n * Returns the built `Transaction`, or `null` when the selection is\n * unsupported or the mark is absent at a collapsed cursor.\n */\nexport function removeAttributedMark(\n\tstate: EditorState,\n\tmarkTypeName: MarkTypeName,\n): Transaction | null {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return null;\n\n\tif (isCollapsed(sel)) {\n\t\tconst anchorBlock = state.getBlock(sel.anchor.blockId);\n\t\tif (!anchorBlock) return null;\n\t\tconst currentMarks: readonly Mark[] = resolveCursorMarks(state);\n\t\tif (!hasMark(currentMarks, markTypeName)) return null;\n\n\t\tconst newMarks: readonly Mark[] = currentMarks.filter((m) => m.type !== markTypeName);\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\tconst range = selectionRange(sel, state.getBlockOrder());\n\tconst builder = state.transaction('command');\n\n\tforEachBlockInRange(state, range, (blockId, from, to) => {\n\t\tconst block: BlockNode | undefined = state.getBlock(blockId);\n\t\tconst existing: Mark | undefined = block\n\t\t\t? findMarkInRange(block, markTypeName, from, to)\n\t\t\t: undefined;\n\t\tbuilder.removeMark(blockId, from, to, existing ?? { type: markTypeName });\n\t});\n\n\tbuilder.setSelection(sel);\n\treturn builder.build();\n}\n\n/**\n * Extracts a typed attribute value from the mark at the current selection.\n *\n * Looks at stored marks (collapsed w/ stored), block marks at cursor offset\n * (collapsed w/o stored), or anchor-block marks (range).\n *\n * @param extractFn — Narrows the found mark and returns the desired value,\n * or `null` when the mark's attrs don't match expectations.\n */\nexport function getMarkAttrAtSelection<K extends keyof MarkAttrRegistry, V>(\n\tstate: EditorState,\n\tmarkTypeName: K,\n\textractFn: (mark: Mark & { readonly type: K; readonly attrs: MarkAttrRegistry[K] }) => V | null,\n): V | null {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return null;\n\n\t// Collapsed cursor honors stored marks and right-boundary inclusivity; a\n\t// range reads the raw content marks at its anchor.\n\tlet marks: readonly Mark[];\n\tif (isCollapsed(sel)) {\n\t\tmarks = resolveCursorMarks(state);\n\t} else {\n\t\tconst block = state.getBlock(sel.anchor.blockId);\n\t\tif (!block) return null;\n\t\tmarks = getBlockMarksAtOffset(block, sel.anchor.offset);\n\t}\n\n\tconst found = marks.find((m) => (m.type as string) === markTypeName);\n\treturn found && isMarkOfType(found, markTypeName) ? extractFn(found) : null;\n}\n\n/**\n * Returns `true` when the given attributed mark type is present at the\n * current selection (collapsed or range).\n */\nexport function isAttributedMarkActive<K extends keyof MarkAttrRegistry>(\n\tstate: EditorState,\n\tmarkTypeName: K,\n): boolean {\n\treturn getMarkAttrAtSelection(state, markTypeName, () => true as const) !== null;\n}\n\n/**\n * Finds the first mark of the given type within an offset range of a block.\n *\n * Returns the full mark (including attrs) so callers can pass it to\n * `removeMark` for correct undo inversion, or `undefined` when absent.\n */\nfunction findMarkInRange(\n\tblock: BlockNode,\n\ttypeName: MarkTypeName,\n\tfrom: number,\n\tto: number,\n): Mark | undefined {\n\tconst children: readonly (TextNode | InlineNode)[] = getInlineChildren(block);\n\tlet pos = 0;\n\n\tfor (const child of children) {\n\t\tif (!isTextNode(child)) {\n\t\t\tpos += 1;\n\t\t\tcontinue;\n\t\t}\n\t\tconst nodeEnd: number = pos + child.text.length;\n\t\tif (nodeEnd > from && pos < to) {\n\t\t\tconst found: Mark | undefined = child.marks.find((m) => m.type === typeName);\n\t\t\tif (found) return found;\n\t\t}\n\t\tpos = nodeEnd;\n\t}\n\treturn undefined;\n}\n"],"mappings":"kRAgBA,SAAgB,EAAgB,EAAgB,GAC/C,OAAiD,IAA1C,EAAO,cAAc,IAAO,SACpC,CAOA,SAAgB,EAAmB,GAClC,GAAI,EAAM,YAAa,OAAO,EAAM,YAEpC,MAAM,EAAM,EAAM,UAClB,IAAK,EAAgB,KAAS,EAAY,GAAM,MAAO,GAEvD,MAAM,EAAQ,EAAM,SAAS,EAAI,OAAO,SACxC,OAAK,EAEE,EAAe,EAAO,EAAI,OAAO,OAAS,GAAS,EAAgB,EAAM,OAAQ,IAFrE,EAGpB,CCKA,SAAgB,EAAoB,EAAoB,GACvD,MAAM,EAAM,EAAM,UAClB,IAAK,EAAgB,GAAM,OAAO,KAElC,MAAM,EAAyB,EAAS,EAAK,MAE7C,GAAI,EAAY,GAAM,CAErB,IADoB,EAAM,SAAS,EAAI,OAAO,SAC5B,OAAO,KAGzB,MAAM,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M,EAAQ,EAAM,SAAS,EAAI,OAAO,SACxC,IAAK,EAAO,OAAO,KACnB,EAAQ,EAAsB,EAAO,EAAI,OAAO,OACjD,CAEA,MAAM,EAAQ,EAAM,KAAM,GAAO,EAAE,OAAoB,GACvD,OAAO,GAAS,EAAa,EAAO,GAAgB,EAAU,GAAS,IACxE,CAMA,SAAgB,EACf,EACA,GAEA,OAA4E,OAArE,EAAuB,EAAO,EAAA,KAAoB,EAC1D,CAQA,SAAS,EACR,EACA,EACA,EACA,GAEA,MAAM,EAA+C,EAAkB,GACvE,IAAI,EAAM,EAEV,IAAK,MAAM,KAAS,EAAU,CAC7B,IAAK,EAAW,GAAQ,CACvB,GAAO,EACP,QACD,CACA,MAAM,EAAkB,EAAM,EAAM,KAAK,OACzC,GAAI,EAAU,GAAQ,EAAM,EAAI,CAC/B,MAAM,EAA0B,EAAM,MAAM,KAAM,GAAM,EAAE,OAAS,GACnE,GAAI,EAAO,OAAO,CACnB,CACA,EAAM,CACP,CAED"}
@@ -0,0 +1,2 @@
1
+ import{o as i,u as t}from"./Selection-HYoVFpAx.mjs";import{i as e}from"./TypeBrands-Ch9856Gb.mjs";import{r as o}from"./HTMLUtils-C6B4UT00.mjs";import{i as n,r,t as s}from"./AttributedMarkCommands-D4W2Jgpj.mjs";import{a as l,n as a,r as m,s as c}from"./PluginHelpers-D4quRJ5a.mjs";import{t as d}from"./ShortcutFormatting-TwiufqeV.mjs";import{t as g}from"./DirectionIcons-Bbawl9ei.mjs";import{t as p}from"./TextDirectionService-OFOU6r_s.mjs";var u={inlineLTR:"Inline LTR",inlineRTL:"Inline RTL",inlineAuto:"Inline Auto",inlineLabel:"Inline Direction",inlineTooltip:"Inline Direction",announceRemoveBidi:"Inline direction isolation removed"},h=/* #__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-B03uY4xr.mjs"),"./locales/de.ts":()=>import("./de-XCCpWyg0.mjs"),"./locales/es.ts":()=>import("./es-B0Za939C.mjs"),"./locales/fr.ts":()=>import("./fr-DciSEykY.mjs"),"./locales/hi.ts":()=>import("./hi-j3TDLMYd.mjs"),"./locales/pt.ts":()=>import("./pt-CEUgbrii.mjs"),"./locales/ru.ts":()=>import("./ru-BNPUT-3S.mjs"),"./locales/zh.ts":()=>import("./zh-Oj-qSUEp.mjs")});async function B(i){return c(h,i,u)}var v=class{id="bidi-isolation";name="Bidi Isolation";priority=92;config;locale;constructor(i){this.config={...i}}async init(i){this.locale=await l(i,this.config.locale,u,B),this.registerBdiMark(i),this.registerCommands(i),this.registerKeymaps(i),this.registerInlineToolbarItem(i)}registerBdiMark(i){i.registerMarkSpec({type:"bdi",rank:10,attrs:{dir:{default:"auto"}},toDOM(i){const t=document.createElement("bdi"),e=String(i.attrs?.dir??"auto");return t.setAttribute("dir",e),t},toHTMLString:(i,t)=>`<bdi dir="${o(String(i.attrs?.dir??"auto"))}">${t}</bdi>`,parseHTML:[{tag:"bdi",getAttrs:i=>{const t=i.getAttribute("dir");return"ltr"===t||"rtl"===t?{dir:t}:{dir:"auto"}}}],sanitize:{tags:["bdi"],attrs:["dir"]}})}registerCommands(i){i.registerCommand("toggleBidiLTR",()=>{const t=this.applyBdi(i,"ltr");return t&&i.announce(this.locale.inlineLTR),t}),i.registerCommand("toggleBidiRTL",()=>{const t=this.applyBdi(i,"rtl");return t&&i.announce(this.locale.inlineRTL),t}),i.registerCommand("toggleBidiAuto",()=>{const t=this.applyBdi(i,"auto");return t&&i.announce(this.locale.inlineAuto),t}),i.registerCommand("removeBidi",()=>{const t=this.removeBdi(i);return t&&i.announce(this.locale.announceRemoveBidi),t}),i.registerCommand("toggleBidiIsolation",()=>this.toggleBidiIsolation(i))}registerKeymaps(i){i.registerKeymap({"Mod-Shift-B":()=>i.executeCommand("toggleBidiIsolation")})}registerInlineToolbarItem(e){const o=[{label:this.locale.inlineLTR,command:"toggleBidiLTR",icon:g.ltr},{label:this.locale.inlineRTL,command:"toggleBidiRTL",icon:g.rtl},{label:this.locale.inlineAuto,command:"toggleBidiAuto",icon:g.auto},{label:this.locale.announceRemoveBidi,command:"removeBidi"}];e.registerToolbarItem({id:"inline-direction",group:"format",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 4v7h2V4h2v7h2V4h1V2H10a3 3 0 1 0 0 6zm-3.5 9.5L3 17l3.5 3.5V18h3v-2h-3v-2.5zm14 0L17 17l3.5 3.5V18h-3v-2h3v-2.5zM11 16h2v6h-2z"/></svg>',label:this.locale.inlineLabel,tooltip:`${this.locale.inlineTooltip} (${d("Mod-Shift-B")})`,command:"toggleBidiIsolation",popupType:"dropdown",popupConfig:{items:o},isActive:i=>r(i,"bdi"),isEnabled:e=>{const o=e.selection;return t(o)&&!i(o)}})}toggleBidiIsolation(i){const t=i.getState();if(r(t,"bdi")){const t=this.removeBdi(i);return t&&i.announce(this.locale.announceRemoveBidi),t}const e=m(t),o=i.getService(p),n="rtl"===(e&&o?o.getBlockDir(e):"auto")?"ltr":"rtl",s=this.applyBdi(i,n);if(s){const t="ltr"===n?this.locale.inlineLTR:this.locale.inlineRTL;i.announce(t)}return s}applyBdi(i,t){return a(i,s(i.getState(),{type:e("bdi"),attrs:{dir:t}}))}removeBdi(i){return a(i,n(i.getState(),e("bdi")))}};export{u as n,B as r,v as t};
2
+ //# sourceMappingURL=BidiIsolationPlugin-Bm3h9J15.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BidiIsolationPlugin-Bm3h9J15.mjs","names":[],"sources":["../../src/plugins/bidi-isolation/BidiIsolationLocale.ts","../../src/plugins/bidi-isolation/BidiIsolationPlugin.ts"],"sourcesContent":["/** Locale interface and default English locale for the BidiIsolationPlugin. */\n\nimport { type LocaleModuleMap, loadLocaleModule } from '../shared/LocaleLoader.js';\n\nexport interface BidiIsolationLocale {\n\treadonly inlineLTR: string;\n\treadonly inlineRTL: string;\n\treadonly inlineAuto: string;\n\treadonly inlineLabel: string;\n\treadonly inlineTooltip: string;\n\treadonly announceRemoveBidi: string;\n}\n\nexport const BIDI_ISOLATION_LOCALE_EN: BidiIsolationLocale = {\n\tinlineLTR: 'Inline LTR',\n\tinlineRTL: 'Inline RTL',\n\tinlineAuto: 'Inline Auto',\n\tinlineLabel: 'Inline Direction',\n\tinlineTooltip: 'Inline Direction',\n\tannounceRemoveBidi: 'Inline direction isolation removed',\n};\n\nconst localeModules: LocaleModuleMap<BidiIsolationLocale> = import.meta.glob<{\n\tdefault: BidiIsolationLocale;\n}>('./locales/*.ts', { eager: false });\n\nexport async function loadBidiIsolationLocale(lang: string): Promise<BidiIsolationLocale> {\n\treturn loadLocaleModule(localeModules, lang, BIDI_ISOLATION_LOCALE_EN);\n}\n","/**\n * Inline bidi isolation plugin: registers a `<bdi>` mark and the inline\n * commands / toolbar / keymap that wrap selected text in a `<bdi>` element\n * with an explicit `dir` attribute.\n *\n * Use alongside {@link TextDirectionPlugin} for the full RTL story:\n * block-level direction lives there, the optional `TextDirectionService`\n * lets this plugin pick the inline direction opposite to the block direction\n * in `toggleBidiIsolation`. Without `TextDirectionPlugin`, this plugin\n * still works — `toggleBidiIsolation` falls back to applying `'rtl'`.\n */\n\nimport {\n\tapplyAttributedMark,\n\tisAttributedMarkActive,\n\tremoveAttributedMark,\n} from '../../commands/AttributedMarkCommands.js';\nimport { escapeHTML } from '../../model/HTMLUtils.js';\nimport { isCollapsed, isTextSelection } from '../../model/Selection.js';\nimport { markType } from '../../model/TypeBrands.js';\nimport type { Plugin, PluginContext } from '../Plugin.js';\nimport { dispatchIfPresent, getSelectedBlock, resolveLocale } from '../shared/PluginHelpers.js';\nimport { formatShortcut } from '../shared/ShortcutFormatting.js';\nimport { DIRECTION_ICONS } from '../text-direction/DirectionIcons.js';\nimport {\n\tTEXT_DIRECTION_SERVICE_KEY,\n\ttype TextDirection,\n\ttype TextDirectionService,\n} from '../text-direction/TextDirectionService.js';\nimport {\n\tBIDI_ISOLATION_LOCALE_EN,\n\ttype BidiIsolationLocale,\n\tloadBidiIsolationLocale,\n} from './BidiIsolationLocale.js';\n\ndeclare module '../../model/AttrRegistry.js' {\n\tinterface MarkAttrRegistry {\n\t\tbdi: { dir: 'ltr' | 'rtl' | 'auto' };\n\t}\n}\n\nexport interface BidiIsolationConfig {\n\treadonly locale?: BidiIsolationLocale;\n}\n\nconst INLINE_BDI_ICON: string =\n\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M10 4v7h2V4h2v7h2V4h1V2H10a3 3 0 1 0 0 6zm-3.5 9.5L3 17l3.5 3.5V18h3v-2h-3v-2.5zm14 0L17 17l3.5 3.5V18h-3v-2h3v-2.5zM11 16h2v6h-2z\"/></svg>';\n\nexport class BidiIsolationPlugin implements Plugin {\n\treadonly id = 'bidi-isolation';\n\treadonly name = 'Bidi Isolation';\n\treadonly priority = 92;\n\n\tprivate readonly config: BidiIsolationConfig;\n\tprivate locale!: BidiIsolationLocale;\n\n\tconstructor(config?: Partial<BidiIsolationConfig>) {\n\t\tthis.config = { ...config };\n\t}\n\n\tasync init(context: PluginContext): Promise<void> {\n\t\tthis.locale = await resolveLocale(\n\t\t\tcontext,\n\t\t\tthis.config.locale,\n\t\t\tBIDI_ISOLATION_LOCALE_EN,\n\t\t\tloadBidiIsolationLocale,\n\t\t);\n\n\t\tthis.registerBdiMark(context);\n\t\tthis.registerCommands(context);\n\t\tthis.registerKeymaps(context);\n\t\tthis.registerInlineToolbarItem(context);\n\t}\n\n\tprivate registerBdiMark(context: PluginContext): void {\n\t\tcontext.registerMarkSpec({\n\t\t\ttype: 'bdi',\n\t\t\trank: 10,\n\t\t\tattrs: {\n\t\t\t\tdir: { default: 'auto' },\n\t\t\t},\n\t\t\ttoDOM(mark) {\n\t\t\t\tconst el: HTMLElement = document.createElement('bdi');\n\t\t\t\tconst dir: string = String(mark.attrs?.dir ?? 'auto');\n\t\t\t\tel.setAttribute('dir', dir);\n\t\t\t\treturn el;\n\t\t\t},\n\t\t\ttoHTMLString: (mark, content) => {\n\t\t\t\tconst dir: string = escapeHTML(String(mark.attrs?.dir ?? 'auto'));\n\t\t\t\treturn `<bdi dir=\"${dir}\">${content}</bdi>`;\n\t\t\t},\n\t\t\tparseHTML: [\n\t\t\t\t{\n\t\t\t\t\ttag: 'bdi',\n\t\t\t\t\tgetAttrs: (el) => {\n\t\t\t\t\t\tconst dir: string | null = el.getAttribute('dir');\n\t\t\t\t\t\tif (dir === 'ltr' || dir === 'rtl') return { dir };\n\t\t\t\t\t\treturn { dir: 'auto' };\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t\tsanitize: { tags: ['bdi'], attrs: ['dir'] },\n\t\t});\n\t}\n\n\tprivate registerCommands(context: PluginContext): void {\n\t\tcontext.registerCommand('toggleBidiLTR', () => {\n\t\t\tconst result: boolean = this.applyBdi(context, 'ltr');\n\t\t\tif (result) context.announce(this.locale.inlineLTR);\n\t\t\treturn result;\n\t\t});\n\n\t\tcontext.registerCommand('toggleBidiRTL', () => {\n\t\t\tconst result: boolean = this.applyBdi(context, 'rtl');\n\t\t\tif (result) context.announce(this.locale.inlineRTL);\n\t\t\treturn result;\n\t\t});\n\n\t\tcontext.registerCommand('toggleBidiAuto', () => {\n\t\t\tconst result: boolean = this.applyBdi(context, 'auto');\n\t\t\tif (result) context.announce(this.locale.inlineAuto);\n\t\t\treturn result;\n\t\t});\n\n\t\tcontext.registerCommand('removeBidi', () => {\n\t\t\tconst result: boolean = this.removeBdi(context);\n\t\t\tif (result) context.announce(this.locale.announceRemoveBidi);\n\t\t\treturn result;\n\t\t});\n\n\t\tcontext.registerCommand('toggleBidiIsolation', () => {\n\t\t\treturn this.toggleBidiIsolation(context);\n\t\t});\n\t}\n\n\tprivate registerKeymaps(context: PluginContext): void {\n\t\tcontext.registerKeymap({\n\t\t\t'Mod-Shift-B': () => context.executeCommand('toggleBidiIsolation'),\n\t\t});\n\t}\n\n\tprivate registerInlineToolbarItem(context: PluginContext): void {\n\t\tconst inlineItems = [\n\t\t\t{ label: this.locale.inlineLTR, command: 'toggleBidiLTR', icon: DIRECTION_ICONS.ltr },\n\t\t\t{ label: this.locale.inlineRTL, command: 'toggleBidiRTL', icon: DIRECTION_ICONS.rtl },\n\t\t\t{ label: this.locale.inlineAuto, command: 'toggleBidiAuto', icon: DIRECTION_ICONS.auto },\n\t\t\t{ label: this.locale.announceRemoveBidi, command: 'removeBidi' },\n\t\t];\n\n\t\tcontext.registerToolbarItem({\n\t\t\tid: 'inline-direction',\n\t\t\tgroup: 'format',\n\t\t\ticon: INLINE_BDI_ICON,\n\t\t\tlabel: this.locale.inlineLabel,\n\t\t\ttooltip: `${this.locale.inlineTooltip} (${formatShortcut('Mod-Shift-B')})`,\n\t\t\tcommand: 'toggleBidiIsolation',\n\t\t\tpopupType: 'dropdown',\n\t\t\tpopupConfig: { items: inlineItems },\n\t\t\tisActive: (state) => isAttributedMarkActive(state, 'bdi'),\n\t\t\tisEnabled: (state) => {\n\t\t\t\tconst sel = state.selection;\n\t\t\t\treturn isTextSelection(sel) && !isCollapsed(sel);\n\t\t\t},\n\t\t});\n\t}\n\n\t/**\n\t * Cycles inline bidi isolation: no-bdi → bdi (opposite of block dir) →\n\t * remove. When the {@link TextDirectionService} is registered, picks the\n\t * direction opposite to the current block; otherwise defaults to `'rtl'`.\n\t */\n\tprivate toggleBidiIsolation(context: PluginContext): boolean {\n\t\tconst state = context.getState();\n\t\tif (isAttributedMarkActive(state, 'bdi')) {\n\t\t\tconst result: boolean = this.removeBdi(context);\n\t\t\tif (result) context.announce(this.locale.announceRemoveBidi);\n\t\t\treturn result;\n\t\t}\n\n\t\tconst block = getSelectedBlock(state);\n\t\tconst directionService: TextDirectionService | undefined = context.getService(\n\t\t\tTEXT_DIRECTION_SERVICE_KEY,\n\t\t);\n\t\tconst blockDir: TextDirection =\n\t\t\tblock && directionService ? directionService.getBlockDir(block) : 'auto';\n\t\tconst bdiDir: TextDirection = blockDir === 'rtl' ? 'ltr' : 'rtl';\n\n\t\tconst result: boolean = this.applyBdi(context, bdiDir);\n\t\tif (result) {\n\t\t\tconst announcement: string = bdiDir === 'ltr' ? this.locale.inlineLTR : this.locale.inlineRTL;\n\t\t\tcontext.announce(announcement);\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate applyBdi(context: PluginContext, dir: TextDirection): boolean {\n\t\tconst state = context.getState();\n\t\tconst mark = { type: markType('bdi'), attrs: { dir } };\n\t\treturn dispatchIfPresent(context, applyAttributedMark(state, mark));\n\t}\n\n\tprivate removeBdi(context: PluginContext): boolean {\n\t\tconst state = context.getState();\n\t\treturn dispatchIfPresent(context, removeAttributedMark(state, markType('bdi')));\n\t}\n}\n"],"mappings":"wbAaA,IAAa,EAAgD,CAC5D,UAAW,aACX,UAAW,aACX,WAAY,cACZ,YAAa,mBACb,cAAe,mBACf,mBAAoB,sCAGf,iBAAsD,OAAA,OAAA,CAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,uBAI5D,eAAsB,EAAwB,GAC7C,OAAO,EAAiB,EAAe,EAAM,EAC9C,CCiBA,IAGa,EAAb,MACC,GAAc,iBACd,KAAgB,iBAChB,SAAoB,GAEpB,OACA,OAEA,WAAA,CAAY,GACX,KAAK,OAAS,IAAK,EACpB,CAEA,UAAM,CAAK,GACV,KAAK,aAAe,EACnB,EACA,KAAK,OAAO,OACZ,EACA,GAGD,KAAK,gBAAgB,GACrB,KAAK,iBAAiB,GACtB,KAAK,gBAAgB,GACrB,KAAK,0BAA0B,EAChC,CAEA,eAAA,CAAwB,GACvB,EAAQ,iBAAiB,CACxB,KAAM,MACN,KAAM,GACN,MAAO,CACN,IAAK,CAAE,QAAS,SAEjB,KAAA,CAAM,GACL,MAAM,EAAkB,SAAS,cAAc,OACzC,EAAc,OAAO,EAAK,OAAO,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I,mBACJ,MAAO,SACP,KA1GF,mNA2GE,MAAO,KAAK,OAAO,YACnB,QAAS,GAAG,KAAK,OAAO,kBAAkB,EAAe,kBACzD,QAAS,sBACT,UAAW,WACX,YAAa,CAAE,MAAO,GACtB,SAAW,GAAU,EAAuB,EAAO,OACnD,UAAY,IACX,MAAM,EAAM,EAAM,UAClB,OAAO,EAAgB,KAAS,EAAY,KAG/C,CAOA,mBAAA,CAA4B,GAC3B,MAAM,EAAQ,EAAQ,WACtB,GAAI,EAAuB,EAAO,OAAQ,CACzC,MAAM,EAAkB,KAAK,UAAU,GAEvC,OADI,GAAQ,EAAQ,SAAS,KAAK,OAAO,oBAClC,CACR,CAEA,MAAM,EAAQ,EAAiB,GACzB,EAAqD,EAAQ,WAClE,GAIK,EAAqC,SAD1C,GAAS,EAAmB,EAAiB,YAAY,GAAS,QAChB,MAAQ,MAErD,EAAkB,KAAK,SAAS,EAAS,GAC/C,GAAI,EAAQ,CACX,MAAM,EAAkC,QAAX,EAAmB,KAAK,OAAO,UAAY,KAAK,OAAO,UACpF,EAAQ,SAAS,EAClB,CACA,OAAO,CACR,CAEA,QAAA,CAAiB,EAAwB,GAGxC,OAAO,EAAkB,EAAS,EAFpB,EAAQ,WAEuC,CAD9C,KAAM,EAAS,OAAQ,MAAO,CAAE,SAEhD,CAEA,SAAA,CAAkB,GAEjB,OAAO,EAAkB,EAAS,EADpB,EAAQ,WACwC,EAAS,QACxE"}
@@ -0,0 +1,2 @@
1
+ import{A as n,S as t,h as e,i as r,j as o,p as s,s as c,u as i,w as f,x as u}from"./Document-r7vLOAGA.mjs";import{c as a,d,l,o as p,r as h,t as m}from"./Selection-HYoVFpAx.mjs";import{a as g,r as y}from"./TypeBrands-Ch9856Gb.mjs";import{r as I}from"./NodeResolver-ChgLF_IP.mjs";import{i as x}from"./NavigationQueries-Bt4zZ17v.mjs";function k(n,t,e){const r=n.getNodeSpec(t);if(!r?.content)return!0;const o=n.getNodeSpec(e)?.group;for(const s of r.content.allow){if(s===e)return!0;if("text"!==s&&o&&s===o)return!0}return!1}function N(n,t,e){const r=n.getNodeSpec(t);if(!r?.content)return!0;const{min:o=0,max:s=Number.POSITIVE_INFINITY}=r.content,c=e.filter(n=>"text"!==n);if(c.length<o||c.length>s)return!1;for(const i of c)if(!k(n,t,i))return!1;return!0}function b(n,t){if(0===t.length)return n.doc.children;const e=n.getBlock(t[t.length-1]);return e?e.children:[]}function v(n,t){if(p(n))return{blockId:n.anchor.blockId,offset:n.anchor.offset};const e=d(n,t);return{blockId:e.from.blockId,offset:e.from.offset}}function P(n){return n&&n.length>1?n.slice(0,-1):[]}function S(n,e){return n.findIndex(n=>t(n)&&n.id===e)}function B(n,t){const e=P(I(n.doc,t)),r=b(n,e);return{parentPath:e,siblings:r,index:S(r,t)}}function T(n){if(f(n))return n.id;for(const e of n.children)if(t(e))return T(e);return n.id}function j(n){if(f(n))return n.id;for(let e=n.children.length-1;e>=0;e--){const r=n.children[e];if(r&&t(r))return j(r)}return n.id}function E(n,t,e){const r=n.getBlock(t);if(!r)return null;if(x(n,t)){const e=n.getNodePath(t);return e?h(t,e):null}const o="start"===e?T(r):j(r),c=n.getBlock(o);return c?m(o,"start"===e?0:s(c)):null}function A(n,e,r){const o=n.doc.children,s="start"===e?o.map((n,t)=>t):o.map((n,t)=>o.length-1-t);for(const c of s){const s=o[c];if(!s||!t(s))continue;if(void 0!==r&&s.id===r)continue;const i=E(n,s.id,e);if(i)return i}return null}function _(n,t,e){const r=P(I(n.doc,t)),o=S(b(n,r),t);if(!(o<0))return{parentPath:r,anchorIndex:o,isAnchorEmpty:J(n,t,e)}}function w(n,e,r,o){const s=I(n.doc,r);if(!s)return;const c=n.getBlock(r);return c?{parentPath:s,anchorIndex:c.children.findIndex(n=>t(n)&&n.id===e),isAnchorEmpty:J(n,e,o)}:void 0}function D(n,t){if("table_cell"===n.getBlock(t)?.type)return t;const e=I(n.doc,t);if(e)for(const r of e)if("table_cell"===n.getBlock(r)?.type)return r}function O(n){return l(n)?n.nodeId:a(n)?n.blockId:n.anchor.blockId}function V(n,t,e,r,o,s){const c=D(n,e);if(c){const o=w(n,e,c,s);if(!o)return!1;const i=o.anchorIndex+1;t.insertNode(o.parentPath,i,r),o.isAnchorEmpty&&o.anchorIndex>=0&&t.removeNode(o.parentPath,o.anchorIndex)}else{const c=_(n,e,s);if(!c)return!1;const i=a(o)&&"before"===o.side?0:1;t.insertNode(c.parentPath,c.anchorIndex+i,r),c.isAnchorEmpty&&!a(o)&&t.removeNode(c.parentPath,c.anchorIndex)}return!0}function C(n,t){const e=I(n.doc,t),r=e&&e.length>0?e[0]:t;return n.doc.children.findIndex(n=>n.id===r)}function F(n,t,e){return!t||e.every(e=>k(n,t,e.type))}function Q(n,t){const e=C(n,t);if(-1!==e)return{parentPath:[],anchorIndex:e,isAnchorEmpty:!1}}function R(n){return"paragraph"===n.type&&0===s(n)}function Y(n,t,e,r){return q(n,t,e,[r])}function q(n,t,e,o){if(0===o.length)return;const s=C(n,e);if(-1===s)return;const c=n.doc.children[s],i=n.doc.children[s+1];let f=s+1;for(const r of o)t.insertNode([],f,r),f++;const u=c&&x(n,c.id)&&i&&R(i)?i:void 0;let a;return u?a=u:(a=r(g("paragraph")),t.insertNode([],f,a)),c&&R(c)&&t.removeNode([],s),a}function z(n,e){const o=n.children.map(n=>t(n)?z(n,i()):n);return r(n.type,o,e,n.attrs)}function G(n,e){if(n.id===e)return n;for(const r of n.children){if(!t(r))continue;const n=G(r,e);if(n)return n}}function H(n,t){if(!t)return;const e={};let r=!1;for(const o of Object.keys(t)){const s=t[o],c=n?.[o];"string"==typeof c||"number"==typeof c||"boolean"==typeof c?e[o]=c:void 0!==s.default&&(e[o]=s.default),o in e&&(r=!0)}return r?e:void 0}function J(n,t,r){const o=n.getBlock(t);return!!o&&!(r?.getNodeSpec(o.type))?.isVoid&&""===e(o)}function K(n,t){if(!n.type)return;if(!t)return n;const e=t.getNodeSpec(n.type);if(!e)return;const r=H(n.attrs,e.attrs),o=n.segments?function(n,t){const e=[];for(const r of n){if("inline"===r.kind){const n=t.getInlineNodeSpec(r.inlineType);if(!n)continue;const o=H(r.attrs,n.attrs);e.push({kind:"inline",inlineType:r.inlineType,...o?{attrs:o}:{}});continue}e.push(r)}return e}(n.segments,t):void 0;return{...n,...r?{attrs:r}:{},...o?{segments:o}:n.segments?{segments:[]}:{}}}function L(t){const e=i(),o=function(t){const e=W(t);return 0===e.length?void 0:n(e)}(t),s=t.attrs?t.attrs:void 0;return r(g(t.type),o,e,s)}function M(n,t){const e=[];for(const r of n){const n=K(r,t);n&&e.push(U(n))}return{blocks:e}}function U(n){const t=n.attrs?n.attrs:void 0;return{type:g(n.type),...t?{attrs:t}:{},segments:W(n)}}function W(n){if(n.segments&&n.segments.length>0)return function(n){const t=[];for(const e of n){if("inline"===e.kind){t.push(u(c(y(e.inlineType),e.attrs)));continue}if(0===e.text.length)continue;const n=e.marks.map(n=>({type:n.type,...n.attrs?{attrs:n.attrs}:{}}));t.push(o(e.text,n))}return t}(n.segments);const t=n.text??"";return t?[o(t)]:[]}export{b as C,N as D,k as E,S,B as T,E as _,D as a,T as b,q as c,w as d,Q as f,K as g,H as h,G as i,R as l,M as m,z as n,V as o,_ as p,L as r,Y as s,F as t,O as u,A as v,v as w,j as x,P as y};
2
+ //# sourceMappingURL=BlockInsertion-6rR9tIGP.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlockInsertion-6rR9tIGP.mjs","names":[],"sources":["../../src/model/ContentModel.ts","../../src/commands/CommandHelpers.ts","../../src/commands/BlockInsertion.ts"],"sourcesContent":["/**\n * Content model validation for nested document structures.\n * Validates whether a parent node type can contain given child types.\n */\n\nimport type { SchemaRegistry } from './SchemaRegistry.js';\n\n/**\n * Checks if a parent node type can contain a child node type,\n * using the content rules and group system from NodeSpec.\n */\nexport function canContain(\n\tregistry: SchemaRegistry,\n\tparentType: string,\n\tchildType: string,\n): boolean {\n\tconst parentSpec = registry.getNodeSpec(parentType);\n\tif (!parentSpec?.content) return true; // No content rule = anything allowed\n\n\tconst childSpec = registry.getNodeSpec(childType);\n\tconst childGroup = childSpec?.group;\n\n\tfor (const allowed of parentSpec.content.allow) {\n\t\tif (allowed === childType) return true;\n\t\tif (allowed === 'text') continue; // 'text' refers to TextNodes, not BlockNodes\n\t\tif (childGroup && allowed === childGroup) return true;\n\t}\n\n\treturn false;\n}\n\n/**\n * Validates whether the given children types are valid for a parent node type.\n * Checks allow list, min/max constraints.\n */\nexport function validateContent(\n\tregistry: SchemaRegistry,\n\tparentType: string,\n\tchildTypes: readonly string[],\n): boolean {\n\tconst parentSpec = registry.getNodeSpec(parentType);\n\tif (!parentSpec?.content) return true;\n\n\tconst { min = 0, max = Number.POSITIVE_INFINITY } = parentSpec.content;\n\n\t// Check count constraints (only for block children, not text)\n\tconst blockChildTypes = childTypes.filter((t) => t !== 'text');\n\tif (blockChildTypes.length < min || blockChildTypes.length > max) return false;\n\n\t// Check each child is allowed\n\tfor (const childType of blockChildTypes) {\n\t\tif (!canContain(registry, parentType, childType)) return false;\n\t}\n\n\treturn true;\n}\n","/**\n * Shared helpers used across multiple command modules.\n *\n * - {@link getSiblings} — resolves a parent path to its child list\n * - {@link resolveInsertPoint} — normalizes a text selection to a single insert position\n */\n\nimport type { BlockNode, ChildNode, Document } from '../model/Document.js';\nimport { getBlockLength, isBlockNode, isLeafBlock } from '../model/Document.js';\nimport { findNodePath } from '../model/NodeResolver.js';\nimport {\n\tcreateCollapsedSelection,\n\tcreateNodeSelection,\n\tisCollapsed,\n\tselectionRange,\n} from '../model/Selection.js';\nimport type { EditorSelection, Selection } from '../model/Selection.js';\nimport type { BlockId } from '../model/TypeBrands.js';\nimport type { EditorState } from '../state/EditorState.js';\nimport { isVoidBlock } from '../state/NavigationQueries.js';\n\n/** The resolved insert position within a single block. */\nexport interface InsertPoint {\n\treadonly blockId: BlockId;\n\treadonly offset: number;\n}\n\n/** Resolves the children of a parent path: doc root or a nested block. */\nexport function getSiblings(\n\tstate: EditorState,\n\tparentPath: readonly BlockId[],\n): readonly ChildNode[] {\n\tif (parentPath.length === 0) return state.doc.children;\n\tconst parent: BlockNode | undefined = state.getBlock(\n\t\tparentPath[parentPath.length - 1] as BlockId,\n\t);\n\treturn parent ? parent.children : [];\n}\n\n/**\n * Normalizes a text selection to a single insert point.\n *\n * - Collapsed selection → anchor position.\n * - Range selection → normalized `from` position (document-order start).\n */\nexport function resolveInsertPoint(sel: Selection, blockOrder: readonly BlockId[]): InsertPoint {\n\tif (isCollapsed(sel)) {\n\t\treturn { blockId: sel.anchor.blockId, offset: sel.anchor.offset };\n\t}\n\tconst range = selectionRange(sel, blockOrder);\n\treturn { blockId: range.from.blockId, offset: range.from.offset };\n}\n\n/** Extracts the parent path from a full node path (all elements except the last). */\nexport function extractParentPath(path: readonly string[] | undefined): BlockId[] {\n\treturn path && path.length > 1 ? (path.slice(0, -1) as BlockId[]) : [];\n}\n\n/** Finds the index of a block by ID within a sibling list. */\nexport function findSiblingIndex(siblings: readonly ChildNode[], targetId: BlockId): number {\n\treturn siblings.findIndex((c) => isBlockNode(c) && c.id === targetId);\n}\n\n/** A block's parent path, its sibling list, and its index within that list. */\nexport interface SiblingContext {\n\treadonly parentPath: BlockId[];\n\treadonly siblings: readonly ChildNode[];\n\treadonly index: number;\n}\n\n/**\n * Resolves a node's parent path, sibling list, and index among its siblings.\n * `index` is `-1` when the node is not found; callers that require the node to\n * exist should guard on `index < 0`.\n */\nexport function resolveSiblingContext(state: EditorState, nodeId: BlockId): SiblingContext {\n\tconst parentPath: BlockId[] = extractParentPath(findNodePath(state.doc, nodeId));\n\tconst siblings: readonly ChildNode[] = getSiblings(state, parentPath);\n\tconst index: number = findSiblingIndex(siblings, nodeId);\n\treturn { parentPath, siblings, index };\n}\n\n/** Finds the first leaf block ID in a subtree. */\nexport function findFirstLeafBlockId(node: BlockNode): BlockId {\n\tif (isLeafBlock(node)) return node.id;\n\n\tfor (const child of node.children) {\n\t\tif (!isBlockNode(child)) continue;\n\t\treturn findFirstLeafBlockId(child);\n\t}\n\n\treturn node.id;\n}\n\n/** Finds the last leaf block ID in a subtree. */\nexport function findLastLeafBlockId(node: BlockNode): BlockId {\n\tif (isLeafBlock(node)) return node.id;\n\n\tfor (let i = node.children.length - 1; i >= 0; i--) {\n\t\tconst child = node.children[i];\n\t\tif (child && isBlockNode(child)) {\n\t\t\treturn findLastLeafBlockId(child);\n\t\t}\n\t}\n\n\treturn node.id;\n}\n\n/**\n * Resolves a valid editor selection at the start or end of a block subtree.\n * Void blocks become NodeSelections; text-capable blocks resolve to leaf cursors.\n */\nexport function createSelectionForBlockBoundary(\n\tstate: EditorState,\n\tblockId: BlockId,\n\tboundary: 'start' | 'end',\n): EditorSelection | null {\n\tconst block = state.getBlock(blockId);\n\tif (!block) return null;\n\n\tif (isVoidBlock(state, blockId)) {\n\t\tconst path = state.getNodePath(blockId);\n\t\treturn path ? createNodeSelection(blockId, path) : null;\n\t}\n\n\tconst leafId: BlockId =\n\t\tboundary === 'start' ? findFirstLeafBlockId(block) : findLastLeafBlockId(block);\n\tconst leaf = state.getBlock(leafId);\n\tif (!leaf) return null;\n\n\tconst offset = boundary === 'start' ? 0 : getBlockLength(leaf);\n\treturn createCollapsedSelection(leafId, offset);\n}\n\n/**\n * Resolves a valid editor selection anywhere in the document, starting from\n * the first (or last) top-level block and deferring per-block resolution to\n * {@link createSelectionForBlockBoundary}. Useful as a last-resort fallback\n * after deletions when neighbouring siblings cannot provide a selection.\n *\n * @param state The editor state to query.\n * @param boundary `'start'` walks document order; `'end'` walks reverse.\n * @param excludeBlockId Optional block id to skip (e.g. the block about to\n * be removed by the caller's transaction).\n * @returns A valid selection, or `null` if no selectable block exists.\n */\nexport function createSelectionForDocumentBoundary(\n\tstate: EditorState,\n\tboundary: 'start' | 'end',\n\texcludeBlockId?: BlockId,\n): EditorSelection | null {\n\tconst children: readonly ChildNode[] = state.doc.children;\n\tconst indices: readonly number[] =\n\t\tboundary === 'start'\n\t\t\t? children.map((_, i) => i)\n\t\t\t: children.map((_, i) => children.length - 1 - i);\n\n\tfor (const i of indices) {\n\t\tconst child = children[i];\n\t\tif (!child || !isBlockNode(child)) continue;\n\t\tif (excludeBlockId !== undefined && child.id === excludeBlockId) continue;\n\n\t\tconst sel = createSelectionForBlockBoundary(state, child.id, boundary);\n\t\tif (sel) return sel;\n\t}\n\n\treturn null;\n}\n\n/** Returns the root-level block IDs in document order. */\nexport function getRootBlockIds(doc: Document): readonly BlockId[] {\n\treturn doc.children.map((child) => child.id);\n}\n","/**\n * Block insertion utilities for paste/clipboard operations and block-object\n * commands (table, image, horizontal rule, display formula).\n *\n * Provides context resolution (parent path, anchor index, empty detection)\n * for inserting blocks into the document tree — both at root level and\n * inside table cells — plus the shared primitive that drops a block-level\n * object onto its own line. Also contains pure helpers for block cloning,\n * recursive lookup, and attribute sanitization against a NodeSpec.\n */\n\nimport { canContain } from '../model/ContentModel.js';\nimport type { ContentSlice, SliceBlock } from '../model/ContentSlice.js';\nimport {\n\ttype BlockAttrs,\n\ttype BlockNode,\n\ttype ChildNode,\n\ttype ContentSegment,\n\ttype InlineNode,\n\ttype Mark,\n\ttype TextNode,\n\tcreateBlockNode,\n\tcreateInlineNode,\n\tgenerateBlockId,\n\tgetBlockLength,\n\tgetBlockText,\n\tinlineSegment,\n\tisBlockNode,\n\tsegmentsToInlineChildren,\n\ttextSegment,\n} from '../model/Document.js';\nimport { findNodePath } from '../model/NodeResolver.js';\nimport type { AttrSpec } from '../model/NodeSpec.js';\nimport type { RichBlockData, RichSegment } from '../model/RichBlockData.js';\nimport type { SchemaRegistry } from '../model/SchemaRegistry.js';\nimport type { EditorSelection } from '../model/Selection.js';\nimport { isGapCursor, isNodeSelection } from '../model/Selection.js';\nimport type { BlockId, NodeTypeName } from '../model/TypeBrands.js';\nimport { inlineType, nodeType } from '../model/TypeBrands.js';\nimport type { EditorState } from '../state/EditorState.js';\nimport { isVoidBlock } from '../state/NavigationQueries.js';\nimport type { TransactionBuilder } from '../state/Transaction.js';\nimport { extractParentPath, findSiblingIndex, getSiblings } from './CommandHelpers.js';\n\n/**\n * Resolved insertion target within the document tree.\n * Contains everything needed to insert blocks at a specific anchor position.\n */\nexport interface InsertionContext {\n\treadonly parentPath: readonly BlockId[];\n\treadonly anchorIndex: number;\n\treadonly isAnchorEmpty: boolean;\n}\n\n/**\n * Resolves an insertion context for root-level (or nested-parent-level) insertion.\n * Computes the parent path, anchor index among siblings, and whether the anchor is empty.\n */\nexport function resolveRootInsertionContext(\n\tstate: EditorState,\n\tanchorBlockId: BlockId,\n\tschemaRegistry?: SchemaRegistry,\n): InsertionContext | undefined {\n\tconst path: readonly string[] | undefined = findNodePath(state.doc, anchorBlockId);\n\tconst parentPath: BlockId[] = extractParentPath(path);\n\n\tconst siblings: readonly ChildNode[] = getSiblings(state, parentPath);\n\tconst anchorIndex: number = findSiblingIndex(siblings, anchorBlockId);\n\tif (anchorIndex < 0) return undefined;\n\n\tconst isAnchorEmpty: boolean = isBlockEmpty(state, anchorBlockId, schemaRegistry);\n\treturn { parentPath, anchorIndex, isAnchorEmpty };\n}\n\n/**\n * Resolves an insertion context within a table cell.\n * The parent path points to the cell itself; siblings are the cell's children.\n */\nexport function resolveCellInsertionContext(\n\tstate: EditorState,\n\tanchorBlockId: BlockId,\n\tcellId: BlockId,\n\tschemaRegistry?: SchemaRegistry,\n): InsertionContext | undefined {\n\tconst cellPath: BlockId[] | undefined = findNodePath(state.doc, cellId) as BlockId[] | undefined;\n\tif (!cellPath) return undefined;\n\n\tconst cell: BlockNode | undefined = state.getBlock(cellId);\n\tif (!cell) return undefined;\n\n\tconst anchorIndex: number = cell.children.findIndex(\n\t\t(c) => isBlockNode(c) && c.id === anchorBlockId,\n\t);\n\n\tconst isAnchorEmpty: boolean = isBlockEmpty(state, anchorBlockId, schemaRegistry);\n\treturn { parentPath: cellPath, anchorIndex, isAnchorEmpty };\n}\n\n/**\n * Finds a table_cell ancestor for the given block.\n * Walks the node path upward, returning the first table_cell BlockId found.\n */\nexport function findTableCellAncestor(state: EditorState, blockId: BlockId): BlockId | undefined {\n\tconst block: BlockNode | undefined = state.getBlock(blockId);\n\tif (block?.type === 'table_cell') return blockId;\n\n\tconst path: BlockId[] | undefined = findNodePath(state.doc, blockId) as BlockId[] | undefined;\n\tif (!path) return undefined;\n\n\tfor (const id of path) {\n\t\tconst node: BlockNode | undefined = state.getBlock(id as BlockId);\n\t\tif (node?.type === 'table_cell') return id as BlockId;\n\t}\n\treturn undefined;\n}\n\n/**\n * Resolves the anchor block ID from the current editor selection.\n * Handles text selection, node selection, and gap cursor uniformly.\n */\nexport function resolveAnchorBlockId(selection: EditorSelection): BlockId {\n\tif (isNodeSelection(selection)) return selection.nodeId;\n\tif (isGapCursor(selection)) return selection.blockId;\n\treturn selection.anchor.blockId;\n}\n\n/**\n * Inserts a block node after the anchor position, resolving cell vs root context.\n * Removes the anchor block if it is empty (matching standard paste behavior).\n * Returns true on success, false if context resolution fails.\n */\nexport function insertBlockAfterAnchor(\n\tstate: EditorState,\n\tbuilder: TransactionBuilder,\n\tanchorBlockId: BlockId,\n\tblock: BlockNode,\n\tselection: EditorSelection,\n\tschemaRegistry?: SchemaRegistry,\n): boolean {\n\tconst cellId: BlockId | undefined = findTableCellAncestor(state, anchorBlockId);\n\n\tif (cellId) {\n\t\tconst ctx: InsertionContext | undefined = resolveCellInsertionContext(\n\t\t\tstate,\n\t\t\tanchorBlockId,\n\t\t\tcellId,\n\t\t\tschemaRegistry,\n\t\t);\n\t\tif (!ctx) return false;\n\n\t\tconst insertIndex: number = ctx.anchorIndex + 1;\n\t\tbuilder.insertNode(ctx.parentPath, insertIndex, block);\n\n\t\tif (ctx.isAnchorEmpty && ctx.anchorIndex >= 0) {\n\t\t\tbuilder.removeNode(ctx.parentPath, ctx.anchorIndex);\n\t\t}\n\t} else {\n\t\tconst ctx: InsertionContext | undefined = resolveRootInsertionContext(\n\t\t\tstate,\n\t\t\tanchorBlockId,\n\t\t\tschemaRegistry,\n\t\t);\n\t\tif (!ctx) return false;\n\n\t\tconst insertOffset: number = isGapCursor(selection) && selection.side === 'before' ? 0 : 1;\n\t\tbuilder.insertNode(ctx.parentPath, ctx.anchorIndex + insertOffset, block);\n\n\t\tif (ctx.isAnchorEmpty && !isGapCursor(selection)) {\n\t\t\tbuilder.removeNode(ctx.parentPath, ctx.anchorIndex);\n\t\t}\n\t}\n\n\treturn true;\n}\n\n/**\n * Document-root index of the top-level block that contains `blockId` — the block\n * itself when it already lives at the document root. Returns -1 when the block is\n * not part of the document. Block-level objects always live at the root, so an\n * insertion triggered from inside a container (e.g. a table cell) escapes to the\n * top level via this lookup.\n */\nexport function topLevelBlockIndex(state: EditorState, blockId: BlockId): number {\n\tconst path: readonly string[] | undefined = findNodePath(state.doc, blockId);\n\tconst topId: BlockId = path && path.length > 0 ? (path[0] as BlockId) : blockId;\n\treturn state.doc.children.findIndex((b) => b.id === topId);\n}\n\n/**\n * True when a container of `containerType` may hold every block in `blocks`,\n * per its {@link import('../model/NodeSpec.js').NodeSpec} content rule. An\n * undefined `containerType` denotes the document root, which imposes no\n * restriction. Used to keep paste from creating schema-invalid nesting, such as\n * a `table` dropped into a `table_cell` (#166).\n */\nexport function canContainerHoldBlocks(\n\tregistry: SchemaRegistry,\n\tcontainerType: string | undefined,\n\tblocks: readonly BlockNode[],\n): boolean {\n\tif (!containerType) return true;\n\treturn blocks.every((block) => canContain(registry, containerType, block.type));\n}\n\n/**\n * Insertion context that escapes to the document root: blocks are placed after\n * the top-level ancestor of `anchorBlockId` (e.g. the outer table when the caret\n * sits inside a cell). The anchor is never treated as empty, so the originating\n * container keeps its own content. Returns undefined when the anchor is not part\n * of the document.\n */\nexport function resolveRootEscapeContext(\n\tstate: EditorState,\n\tanchorBlockId: BlockId,\n): InsertionContext | undefined {\n\tconst topIndex: number = topLevelBlockIndex(state, anchorBlockId);\n\tif (topIndex === -1) return undefined;\n\treturn { parentPath: [], anchorIndex: topIndex, isAnchorEmpty: false };\n}\n\n/**\n * True when the block is a blank-line paragraph. Inline-aware: a paragraph that\n * holds only an atomic inline node (e.g. an inline formula) has width > 0 and is\n * therefore never treated as blank, so it is never silently removed.\n */\nexport function isEmptyParagraph(block: BlockNode): boolean {\n\treturn block.type === 'paragraph' && getBlockLength(block) === 0;\n}\n\n/**\n * Places a block-level object on its own line at the document root: the object\n * followed by a trailing empty paragraph, so a void/atomic object always has an\n * editable line after it. The object is inserted after the top-level ancestor of\n * the current selection; when that ancestor is a blank-line paragraph it is\n * consumed, so the object is never preceded by a stray empty paragraph (#152).\n *\n * Only an empty *paragraph* is consumed — an empty heading or list item is\n * deliberate structure — and the emptiness test is inline-aware (see\n * {@link isEmptyParagraph}). This is intentionally stricter than\n * {@link insertBlockAfterAnchor}, which the paste pipeline uses with a text-only\n * emptiness notion.\n *\n * A void anchor (image, display formula) already owns a trailing empty paragraph\n * as its escape line. In that case the object is placed before that paragraph and\n * the paragraph is reused as the object's trailing line, so a second blank line\n * never stacks up (#158).\n *\n * Selection is the caller's concern, since objects differ (a cursor inside a new\n * table vs. a node selection on an image or display formula). Returns the\n * trailing paragraph after the object, or undefined when the selection has no\n * resolvable anchor.\n */\nexport function insertBlockObjectOnOwnLine(\n\tstate: EditorState,\n\tbuilder: TransactionBuilder,\n\tanchorBlockId: BlockId,\n\tobject: BlockNode,\n): BlockNode | undefined {\n\treturn insertBlockObjectsOnOwnLines(state, builder, anchorBlockId, [object]);\n}\n\n/**\n * Places a sequence of block-level objects on their own lines at the document\n * root, sharing a single trailing empty paragraph. Generalizes\n * {@link insertBlockObjectOnOwnLine} for inserting several objects at once (e.g.\n * pasting two or more standalone formulas, #159); for a single object the two\n * behave identically. The anchor-consumption (#152) and void-anchor trailing\n * reuse (#158) rules apply once, around the whole run.\n *\n * Returns the trailing paragraph after the last object, or undefined when the\n * anchor or object list is empty.\n */\nexport function insertBlockObjectsOnOwnLines(\n\tstate: EditorState,\n\tbuilder: TransactionBuilder,\n\tanchorBlockId: BlockId,\n\tobjects: readonly BlockNode[],\n): BlockNode | undefined {\n\tif (objects.length === 0) return undefined;\n\n\tconst topIndex: number = topLevelBlockIndex(state, anchorBlockId);\n\tif (topIndex === -1) return undefined;\n\n\tconst anchor: BlockNode | undefined = state.doc.children[topIndex];\n\tconst following: BlockNode | undefined = state.doc.children[topIndex + 1];\n\n\tlet insertAt: number = topIndex + 1;\n\tfor (const object of objects) {\n\t\tbuilder.insertNode([], insertAt, object);\n\t\tinsertAt++;\n\t}\n\n\t// A void anchor already owns a trailing empty paragraph as its escape line;\n\t// reuse it so a second blank line never stacks up (#158). Otherwise add one.\n\tconst reusableTrailing: BlockNode | undefined =\n\t\tanchor && isVoidBlock(state, anchor.id) && following && isEmptyParagraph(following)\n\t\t\t? following\n\t\t\t: undefined;\n\tlet trailing: BlockNode;\n\tif (reusableTrailing) {\n\t\ttrailing = reusableTrailing;\n\t} else {\n\t\ttrailing = createBlockNode(nodeType('paragraph'));\n\t\tbuilder.insertNode([], insertAt, trailing);\n\t}\n\n\t// Drop a blank-line paragraph anchor so the objects are not preceded by a\n\t// stray empty paragraph (#152).\n\tif (anchor && isEmptyParagraph(anchor)) {\n\t\tbuilder.removeNode([], topIndex);\n\t}\n\n\treturn trailing;\n}\n\n/** Recursively clones a block tree, assigning new IDs to all block nodes. */\nexport function cloneBlockWithNewIds(block: BlockNode, newId: BlockId): BlockNode {\n\tconst children = block.children.map((child) => {\n\t\tif (isBlockNode(child)) {\n\t\t\treturn cloneBlockWithNewIds(child, generateBlockId());\n\t\t}\n\t\treturn child;\n\t});\n\treturn createBlockNode(block.type, children, newId, block.attrs);\n}\n\n/** Recursively searches a block tree for a block with the given ID (DFS). */\nexport function findBlockRecursive(block: BlockNode, blockId: BlockId): BlockNode | undefined {\n\tif (block.id === blockId) return block;\n\tfor (const child of block.children) {\n\t\tif (!isBlockNode(child)) continue;\n\t\tconst found: BlockNode | undefined = findBlockRecursive(child, blockId);\n\t\tif (found) return found;\n\t}\n\treturn undefined;\n}\n\n/**\n * Validates incoming attributes against the declared AttrSpec.\n * Only keys declared in the spec are kept; non-primitive values fall back to defaults.\n */\nexport function sanitizeAttrs(\n\tincoming: Record<string, unknown> | undefined,\n\tspecAttrs: Readonly<Record<string, AttrSpec>> | undefined,\n): Record<string, string | number | boolean> | undefined {\n\tif (!specAttrs) return undefined;\n\n\tconst result: Record<string, string | number | boolean> = {};\n\tlet hasKeys = false;\n\n\tfor (const key of Object.keys(specAttrs)) {\n\t\tconst spec: AttrSpec = specAttrs[key] as AttrSpec;\n\t\tconst raw: unknown = incoming?.[key];\n\n\t\tif (typeof raw === 'string' || typeof raw === 'number' || typeof raw === 'boolean') {\n\t\t\tresult[key] = raw;\n\t\t} else if (spec.default !== undefined) {\n\t\t\tresult[key] = spec.default;\n\t\t}\n\t\tif (key in result) hasKeys = true;\n\t}\n\n\treturn hasKeys ? result : undefined;\n}\n\n/** Checks whether a block is empty (has no text and is not a void block). */\nfunction isBlockEmpty(\n\tstate: EditorState,\n\tblockId: BlockId,\n\tschemaRegistry?: SchemaRegistry,\n): boolean {\n\tconst block: BlockNode | undefined = state.getBlock(blockId);\n\tif (!block) return false;\n\n\tconst spec = schemaRegistry?.getNodeSpec(block.type);\n\treturn !spec?.isVoid && getBlockText(block) === '';\n}\n\n// --- Rich block creation ---\n\n/**\n * Validates a rich block against the schema registry.\n * Returns undefined for blocks with unknown types; sanitizes attributes\n * against the declared spec.\n */\nexport function validateRichBlockData(\n\traw: RichBlockData,\n\tschemaRegistry?: SchemaRegistry,\n): RichBlockData | undefined {\n\tif (!raw.type) return undefined;\n\tif (!schemaRegistry) return raw;\n\n\tconst spec = schemaRegistry.getNodeSpec(raw.type);\n\tif (!spec) return undefined;\n\n\tconst attrs: Record<string, string | number | boolean> | undefined = sanitizeAttrs(\n\t\traw.attrs,\n\t\tspec.attrs,\n\t);\n\tconst segments: RichSegment[] | undefined = raw.segments\n\t\t? sanitizeRichSegments(raw.segments, schemaRegistry)\n\t\t: undefined;\n\treturn {\n\t\t...raw,\n\t\t...(attrs ? { attrs } : {}),\n\t\t...(segments ? { segments } : raw.segments ? { segments: [] } : {}),\n\t};\n}\n\n/**\n * Creates a BlockNode from validated rich block data.\n * Converts segments or plain text into inline children.\n */\nexport function createBlockFromRichData(blockData: RichBlockData): BlockNode {\n\tconst newId: BlockId = generateBlockId();\n\tconst children: readonly (TextNode | InlineNode)[] | undefined =\n\t\tcreateChildrenFromRichBlock(blockData);\n\tconst attrs: BlockAttrs | undefined = blockData.attrs\n\t\t? (blockData.attrs as BlockAttrs)\n\t\t: undefined;\n\n\treturn createBlockNode(nodeType(blockData.type) as NodeTypeName, children, newId, attrs);\n}\n\n/**\n * Creates inline children from rich block data.\n * Uses mark-preserving segments when available, falls back to plain text.\n * Returns undefined for content-free blocks (e.g. void blocks).\n */\nfunction createChildrenFromRichBlock(\n\tblockData: RichBlockData,\n): readonly (TextNode | InlineNode)[] | undefined {\n\tconst segments: readonly ContentSegment[] = richBlockToContentSegments(blockData);\n\tif (segments.length === 0) return undefined;\n\treturn segmentsToInlineChildren(segments);\n}\n\n/**\n * Converts rich block data into a paste {@link ContentSlice}. Blocks that fail\n * schema validation (unknown type or filtered attributes) are dropped, so the\n * resulting slice can be fed straight into the canonical paste strategy\n * ({@link import('./PasteCommand.js').pasteSlice}).\n */\nexport function richBlocksToSlice(\n\tblocks: readonly RichBlockData[],\n\tschemaRegistry?: SchemaRegistry,\n): ContentSlice {\n\tconst sliceBlocks: SliceBlock[] = [];\n\tfor (const raw of blocks) {\n\t\tconst blockData: RichBlockData | undefined = validateRichBlockData(raw, schemaRegistry);\n\t\tif (!blockData) continue;\n\t\tsliceBlocks.push(richBlockToSliceBlock(blockData));\n\t}\n\treturn { blocks: sliceBlocks };\n}\n\n/** Converts a single validated rich block into a {@link SliceBlock}. */\nfunction richBlockToSliceBlock(blockData: RichBlockData): SliceBlock {\n\tconst attrs: BlockAttrs | undefined = blockData.attrs\n\t\t? (blockData.attrs as BlockAttrs)\n\t\t: undefined;\n\treturn {\n\t\ttype: nodeType(blockData.type) as NodeTypeName,\n\t\t...(attrs ? { attrs } : {}),\n\t\tsegments: richBlockToContentSegments(blockData),\n\t};\n}\n\n/** Builds content segments from a rich block, falling back to plain text. */\nfunction richBlockToContentSegments(blockData: RichBlockData): readonly ContentSegment[] {\n\tif (blockData.segments && blockData.segments.length > 0) {\n\t\treturn richSegmentsToContentSegments(blockData.segments);\n\t}\n\tconst text: string = blockData.text ?? '';\n\treturn text ? [textSegment(text)] : [];\n}\n\n/** Converts rich segments into content segments (marked text and inline nodes). */\nfunction richSegmentsToContentSegments(\n\tsegments: readonly RichSegment[],\n): readonly ContentSegment[] {\n\tconst result: ContentSegment[] = [];\n\tfor (const seg of segments) {\n\t\tif (seg.kind === 'inline') {\n\t\t\tresult.push(\n\t\t\t\tinlineSegment(\n\t\t\t\t\tcreateInlineNode(\n\t\t\t\t\t\tinlineType(seg.inlineType),\n\t\t\t\t\t\tseg.attrs as Readonly<Record<string, string | number | boolean>> | undefined,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t);\n\t\t\tcontinue;\n\t\t}\n\t\tif (seg.text.length === 0) continue;\n\t\tconst marks: readonly Mark[] = seg.marks.map((m) => ({\n\t\t\ttype: m.type as Mark['type'],\n\t\t\t...(m.attrs ? { attrs: m.attrs as Mark['attrs'] } : {}),\n\t\t}));\n\t\tresult.push(textSegment(seg.text, marks));\n\t}\n\treturn result;\n}\n\nfunction sanitizeRichSegments(\n\tsegments: readonly RichSegment[],\n\tschemaRegistry: SchemaRegistry,\n): RichSegment[] {\n\tconst sanitized: RichSegment[] = [];\n\tfor (const segment of segments) {\n\t\tif (segment.kind === 'inline') {\n\t\t\tconst spec = schemaRegistry.getInlineNodeSpec(segment.inlineType);\n\t\t\tif (!spec) continue;\n\t\t\tconst attrs = sanitizeAttrs(segment.attrs, spec.attrs);\n\t\t\tsanitized.push({\n\t\t\t\tkind: 'inline',\n\t\t\t\tinlineType: segment.inlineType,\n\t\t\t\t...(attrs ? { attrs } : {}),\n\t\t\t});\n\t\t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AM,EAAe,EAAU,MAAQ,GACvC,OAAO,EAAO,CAAC,EAAY,IAAS,EACrC"}
@@ -0,0 +1,2 @@
1
+ var e=class{_entries=/* @__PURE__ */new Map;registerBlockTypePickerEntry(e){if(this._entries.has(e.id))throw new Error(`BlockTypePickerEntry with id "${e.id}" is already registered.`);this._entries.set(e.id,e)}getBlockTypePickerEntries(){return[...this._entries.values()].sort((e,r)=>e.priority-r.priority)}removeBlockTypePickerEntry(e){this._entries.delete(e)}clear(){this._entries.clear()}};export{e as t};
2
+ //# sourceMappingURL=BlockTypePickerRegistry-BTET9jM-.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlockTypePickerRegistry-BTET9jM-.mjs","names":[],"sources":["../../src/plugins/heading/BlockTypePickerRegistry.ts"],"sourcesContent":["/**\n * BlockTypePickerRegistry: manages plugin-registered block type picker entries\n * displayed in the heading/block type dropdown, sorted by priority.\n */\n\nimport type { BlockTypePickerEntry } from './BlockTypePickerEntry.js';\n\nexport class BlockTypePickerRegistry {\n\tprivate readonly _entries = new Map<string, BlockTypePickerEntry>();\n\n\tregisterBlockTypePickerEntry(entry: BlockTypePickerEntry): void {\n\t\tif (this._entries.has(entry.id)) {\n\t\t\tthrow new Error(`BlockTypePickerEntry with id \"${entry.id}\" is already registered.`);\n\t\t}\n\t\tthis._entries.set(entry.id, entry);\n\t}\n\n\tgetBlockTypePickerEntries(): readonly BlockTypePickerEntry[] {\n\t\treturn [...this._entries.values()].sort((a, b) => a.priority - b.priority);\n\t}\n\n\tremoveBlockTypePickerEntry(id: string): void {\n\t\tthis._entries.delete(id);\n\t}\n\n\tclear(): void {\n\t\tthis._entries.clear();\n\t}\n}\n"],"mappings":"AAOA,IAAa,EAAb,MACC,wBAA4B,IAAI,IAEhC,4BAAA,CAA6B,GAC5B,GAAI,KAAK,SAAS,IAAI,EAAM,IAC3B,MAAM,IAAI,MAAM,iCAAiC,EAAM,8BAExD,KAAK,SAAS,IAAI,EAAM,GAAI,EAC7B,CAEA,yBAAA,GACC,MAAO,IAAI,KAAK,SAAS,UAAU,KAAA,CAAM,EAAG,IAAM,EAAE,SAAW,EAAE,SAClE,CAEA,0BAAA,CAA2B,GAC1B,KAAK,SAAS,OAAO,EACtB,CAEA,KAAA,GACC,KAAK,SAAS,OACf"}
@@ -0,0 +1,2 @@
1
+ import{d as t,i as e,o,p as n,u as r}from"./Document-r7vLOAGA.mjs";import{d as i,o as c,t as s,u as l}from"./Selection-HYoVFpAx.mjs";import{a}from"./TypeBrands-Ch9856Gb.mjs";import{n as u}from"./DomUtils-Bf7JLFlx.mjs";import{a as d,c as h,t as m}from"./NodeResolver-ChgLF_IP.mjs";import{a as p,s as g}from"./PluginHelpers-D4quRJ5a.mjs";import{t as f}from"./ShortcutFormatting-TwiufqeV.mjs";function b(t,e){const o=t.getNodePath(e)?.[0];return o?t.doc.children.findIndex(t=>t.id===o):-1}function q(t,o,n,c){const s=i(n,t.getBlockOrder()),l=b(t,s.from.blockId),a=b(t,s.to.blockId);if(l<0||a<0)return null;const u=Math.min(l,a),d=Math.max(l,a),h=t.doc.children.slice(u,d+1),m=c??(()=>!0),p=[];let g=[],f=!1;const q=()=>{0!==g.length&&(p.push(e(o,g,r())),f=!0,g=[])};for(const e of h)m(e)?g.push(e):(q(),p.push(e));if(q(),!f)return null;const k=t.transaction("command");for(let e=d;e>=u;e--)k.removeNode([],e);return p.forEach((t,e)=>{k.insertNode([],u+e,t)}),k.setSelection(n),k.build()}function k(e,o){const n=e.getState();if(!l(n.selection))return!1;const r=n.selection;if(!c(r))return!1;const i=r.anchor.blockId,s=n.getParent(i);if(!s||"blockquote"!==s.type)return!1;const a=n.getBlock(i);if(!a)return!1;const u=n.getNodePath(s.id);if(!u)return!1;const d=h(n.doc,u);if(!d)return!1;const m=t(s),p=m.findIndex(t=>t.id===i);return!(p<0)&&o({state:n,quotePath:u,quoteParentPath:u.slice(0,-1),quoteIndex:d.index,child:a,childIndex:p,childCount:m.length,offset:r.anchor.offset})}var I={label:"Blockquote",tooltip:t=>`Blockquote (${t})`},x=/* #__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-sGZ-oZqB.mjs"),"./locales/de.ts":()=>import("./de-uKR7koQe.mjs"),"./locales/es.ts":()=>import("./es-DrJyl38L.mjs"),"./locales/fr.ts":()=>import("./fr-BRXUnq3R.mjs"),"./locales/hi.ts":()=>import("./hi-SECtQQzq.mjs"),"./locales/pt.ts":()=>import("./pt-Cv6q7x5x.mjs"),"./locales/ru.ts":()=>import("./ru-DSRv3_Rg.mjs"),"./locales/zh.ts":()=>import("./zh-DYD476c5.mjs")});async function v(t){return g(x,t,I)}var N={},P=class{id="blockquote";name="Blockquote";priority=35;config;locale;constructor(t){this.config={...N,...t}}async init(t){this.locale=await p(t,this.config.locale,I,v),t.registerStyleSheet("\n.notectl-content blockquote {\n\tmargin: 0;\n\tpadding: 2px 0;\n\tpadding-inline-start: 16px;\n\tborder-inline-start: 3px solid var(--notectl-blockquote-border, var(--notectl-border));\n\tbackground: var(--notectl-blockquote-bg, transparent);\n\tcolor: var(--notectl-blockquote-fg, inherit);\n\tmin-height: 1.6em;\n}\n"),this.registerNodeSpec(t),this.registerCommands(t),this.registerKeymap(t),this.registerInputRule(t),this.registerToolbarItem(t)}registerNodeSpec(t){t.registerNodeSpec({type:"blockquote",group:"block",content:{allow:["paragraph","heading","list_item","blockquote","horizontal_rule","code_block"],min:1},toDOM(t){const e=u("blockquote",t.id);return e.setAttribute("part","blockquote"),e},toHTML:(t,e)=>`<blockquote>${e||"<br>"}</blockquote>`,parseHTML:[{tag:"blockquote"}],sanitize:{tags:["blockquote"]}})}registerCommands(t){t.registerCommand("toggleBlockquote",()=>this.toggleBlockquote(t)),t.registerCommand("setBlockquote",()=>this.wrapInBlockquote(t))}registerKeymap(t){t.registerKeymap({"Mod-Shift->":()=>t.executeCommand("toggleBlockquote")}),function(t){t.registerKeymap({Enter:()=>function(t){return k(t,e=>{if("list_item"===e.child.type)return!1;if(e.childIndex!==e.childCount-1||n(e.child)>0)return!1;const r=o(),i=e.state.transaction("input");return 1===e.childCount?(i.removeNode(e.quoteParentPath,e.quoteIndex),i.insertNode(e.quoteParentPath,e.quoteIndex,r)):(i.removeNode(e.quotePath,e.childIndex),i.insertNode(e.quoteParentPath,e.quoteIndex+1,r)),i.setSelection(s(r.id,0)),t.dispatch(i.build()),!0})}(t),Backspace:()=>function(t){return k(t,e=>{if(0!==e.offset||0!==e.childIndex)return!1;if("list_item"===e.child.type)return!1;const o=e.state.transaction("input");return 1===e.childCount?(o.removeNode(e.quoteParentPath,e.quoteIndex),o.insertNode(e.quoteParentPath,e.quoteIndex,e.child)):(o.removeNode(e.quotePath,0),o.insertNode(e.quoteParentPath,e.quoteIndex,e.child)),o.setSelection(s(e.child.id,0)),t.dispatch(o.build()),!0})}(t)},{priority:"context"})}(t)}registerInputRule(t){t.registerInputRule({pattern:/^> $/,handler(t,o,n,i){const s=t.selection;if(!l(s))return null;if(!c(s))return null;const u=t.getBlock(s.anchor.blockId);if(!u||"paragraph"!==u.type)return null;const d=t.doc.children.findIndex(t=>t.id===u.id);if(d<0)return null;const h=e(a("blockquote"),[u],r());return t.transaction("input").removeNode([],d).insertNode([],d,h).deleteTextAt(s.anchor.blockId,n,n+2).setSelection(s).build()}})}registerToolbarItem(t){t.registerToolbarItem({id:"blockquote",group:"block",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z"/></svg>',label:this.locale.label,tooltip:this.locale.tooltip(f("Mod-Shift->")),command:"toggleBlockquote",isActive:t=>!!l(t.selection)&&d(t.doc,t.selection.anchor.blockId,"blockquote")})}toggleBlockquote(e){const o=e.getState(),n=o.selection;if(!l(n))return!1;const r=d(o.doc,n.anchor.blockId,"blockquote")?function(e,o,n){const r=m(e.doc,n.anchor.blockId,o);if(!r||1!==r.path.length)return null;const i=e.doc.children.findIndex(t=>t.id===r.node.id);if(i<0)return null;const c=t(r.node),s=e.transaction("command");return s.removeNode([],i),c.forEach((t,e)=>{s.insertNode([],i+e,t)}),s.setSelection(n),s.build()}(o,a("blockquote"),n):q(o,a("blockquote"),n,this.isQuoteChild(e));return!!r&&(e.dispatch(r),!0)}wrapInBlockquote(t){const e=t.getState(),o=e.selection;if(!l(o))return!1;const n=q(e,a("blockquote"),o,this.isQuoteChild(t));return!!n&&(t.dispatch(n),!0)}isQuoteChild(t){const e=t.getSchemaRegistry(),o=new Set(e.getNodeSpec(a("blockquote"))?.content?.allow??[]);return t=>{if(o.has(t.type))return!0;const n=e.getNodeSpec(t.type)?.group;return void 0!==n&&o.has(n)}}};export{I as n,v as r,P as t};
2
+ //# sourceMappingURL=BlockquotePlugin-CxrCA0vY.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlockquotePlugin-CxrCA0vY.mjs","names":[],"sources":["../../src/commands/ContainerCommands.ts","../../src/plugins/blockquote/BlockquoteKeyboardHandlers.ts","../../src/plugins/blockquote/BlockquoteLocale.ts","../../src/plugins/blockquote/BlockquoteStyles.ts","../../src/plugins/blockquote/BlockquotePlugin.ts"],"sourcesContent":["/**\n * Generic wrap/lift commands for container blocks (issue #136).\n *\n * A container block (e.g. `blockquote`) holds other blocks as children, mirroring\n * HTML flow-content semantics. Wrapping moves the selected top-level blocks into a\n * new container; lifting dissolves a container and returns its children to the\n * parent. Block identity (IDs) is preserved across both operations so the active\n * selection survives the structural change.\n *\n * Scope: operations act on top-level containers. Nested containers (quote-in-quote,\n * quote-in-cell) are intentionally out of scope here and return `null`.\n */\n\nimport type { BlockNode } from '../model/Document.js';\nimport { createBlockNode, generateBlockId, getBlockChildren } from '../model/Document.js';\nimport { findAncestorOfType } from '../model/NodeResolver.js';\nimport type { Selection } from '../model/Selection.js';\nimport { selectionRange } from '../model/Selection.js';\nimport type { BlockId, NodeTypeName } from '../model/TypeBrands.js';\nimport type { EditorState } from '../state/EditorState.js';\nimport type { Transaction } from '../state/Transaction.js';\n\n/** Returns the index in `doc.children` of the top-level ancestor of the given block. */\nfunction topLevelIndexOf(state: EditorState, blockId: BlockId): number {\n\tconst topId: BlockId | undefined = state.getNodePath(blockId)?.[0];\n\tif (!topId) return -1;\n\treturn state.doc.children.findIndex((b) => b.id === topId);\n}\n\n/**\n * Wraps the top-level blocks spanned by `selection` into new container blocks of\n * `containerType`. Returns `null` when the range cannot be resolved.\n *\n * `isAllowedChild` guards the container's schema (`content.allow`): blocks the\n * container cannot legally hold (e.g. a `table` inside a `blockquote`) are left at\n * the top level instead of being nested into an invalid document. Disallowed blocks\n * therefore split the range into separate contiguous runs, each wrapped in its own\n * container, mirroring `wrapIn`. Defaults to wrapping everything when omitted.\n * Returns `null` when no block in the range is wrappable.\n */\nexport function wrapSelectionInContainer(\n\tstate: EditorState,\n\tcontainerType: NodeTypeName,\n\tselection: Selection,\n\tisAllowedChild?: (block: BlockNode) => boolean,\n): Transaction | null {\n\tconst range = selectionRange(selection, state.getBlockOrder());\n\tconst fromIdx: number = topLevelIndexOf(state, range.from.blockId);\n\tconst toIdx: number = topLevelIndexOf(state, range.to.blockId);\n\tif (fromIdx < 0 || toIdx < 0) return null;\n\n\tconst lo: number = Math.min(fromIdx, toIdx);\n\tconst hi: number = Math.max(fromIdx, toIdx);\n\n\tconst blocks: readonly BlockNode[] = state.doc.children.slice(lo, hi + 1);\n\tconst allowed: (block: BlockNode) => boolean = isAllowedChild ?? (() => true);\n\n\t// Group the range into maximal runs of wrappable blocks; each run becomes one\n\t// container, disallowed blocks pass through unchanged and break the run.\n\tconst sequence: BlockNode[] = [];\n\tlet run: BlockNode[] = [];\n\tlet wrappedAny = false;\n\tconst flushRun = (): void => {\n\t\tif (run.length === 0) return;\n\t\tsequence.push(createBlockNode(containerType, run, generateBlockId()));\n\t\twrappedAny = true;\n\t\trun = [];\n\t};\n\tfor (const block of blocks) {\n\t\tif (allowed(block)) {\n\t\t\trun.push(block);\n\t\t} else {\n\t\t\tflushRun();\n\t\t\tsequence.push(block);\n\t\t}\n\t}\n\tflushRun();\n\n\tif (!wrappedAny) return null;\n\n\tconst builder = state.transaction('command');\n\tfor (let i: number = hi; i >= lo; i--) {\n\t\tbuilder.removeNode([], i);\n\t}\n\tsequence.forEach((node, i) => {\n\t\tbuilder.insertNode([], lo + i, node);\n\t});\n\tbuilder.setSelection(selection);\n\treturn builder.build();\n}\n\n/**\n * Lifts the children of the nearest top-level `containerType` ancestor of the\n * selection anchor back out to the top level, dissolving the container. Returns\n * `null` when no such top-level container surrounds the selection.\n */\nexport function liftSelectionFromContainer(\n\tstate: EditorState,\n\tcontainerType: NodeTypeName,\n\tselection: Selection,\n): Transaction | null {\n\tconst ancestor = findAncestorOfType(state.doc, selection.anchor.blockId, containerType);\n\t// Only top-level containers are dissolved (path === [containerId]).\n\tif (!ancestor || ancestor.path.length !== 1) return null;\n\n\tconst containerIdx: number = state.doc.children.findIndex((b) => b.id === ancestor.node.id);\n\tif (containerIdx < 0) return null;\n\n\tconst children: readonly BlockNode[] = getBlockChildren(ancestor.node);\n\n\tconst builder = state.transaction('command');\n\tbuilder.removeNode([], containerIdx);\n\tchildren.forEach((child, i) => {\n\t\tbuilder.insertNode([], containerIdx + i, child);\n\t});\n\tbuilder.setSelection(selection);\n\treturn builder.build();\n}\n","/**\n * Keyboard handlers for the blockquote container (issue #136, B2 model).\n *\n * Under the container model the caret lives in a child block of the blockquote,\n * not in the blockquote itself. These handlers manage the two container\n * boundaries; everything in between (splitting, merging, arrow navigation) is\n * left to the default commands, which already operate correctly on the nested\n * child blocks:\n *\n * - Enter in an empty last child → exit the blockquote (paragraph after it).\n * - Backspace at start of the first child → lift that child out of the quote.\n *\n * List items are deferred to the list plugin's own handlers.\n */\n\nimport type { BlockNode } from '../../model/Document.js';\nimport { createEmptyParagraph, getBlockChildren, getBlockLength } from '../../model/Document.js';\nimport { resolveParentByPath } from '../../model/NodeResolver.js';\nimport { createCollapsedSelection, isCollapsed, isTextSelection } from '../../model/Selection.js';\nimport type { BlockId } from '../../model/TypeBrands.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { PluginContext } from '../Plugin.js';\n\n// --- Context Guard ---\n\ninterface QuoteChildContext {\n\treadonly state: EditorState;\n\treadonly quotePath: readonly BlockId[];\n\treadonly quoteParentPath: readonly BlockId[];\n\treadonly quoteIndex: number;\n\treadonly child: BlockNode;\n\treadonly childIndex: number;\n\treadonly childCount: number;\n\treadonly offset: number;\n}\n\n/**\n * Resolves the caret context when the cursor sits in a direct child of a\n * blockquote. Returns false (not handled) otherwise, so the default keymap and\n * other plugins keep their behavior.\n */\nfunction withBlockquoteChildContext(\n\tcontext: PluginContext,\n\thandler: (ctx: QuoteChildContext) => boolean,\n): boolean {\n\tconst state: EditorState = context.getState();\n\tif (!isTextSelection(state.selection)) return false;\n\tconst sel = state.selection;\n\tif (!isCollapsed(sel)) return false;\n\n\tconst childId: BlockId = sel.anchor.blockId;\n\tconst quote: BlockNode | undefined = state.getParent(childId);\n\tif (!quote || quote.type !== 'blockquote') return false;\n\n\tconst child: BlockNode | undefined = state.getBlock(childId);\n\tif (!child) return false;\n\n\tconst quotePath: BlockId[] | undefined = state.getNodePath(quote.id);\n\tif (!quotePath) return false;\n\tconst parentRef = resolveParentByPath(state.doc, quotePath);\n\tif (!parentRef) return false;\n\n\tconst children: readonly BlockNode[] = getBlockChildren(quote);\n\tconst childIndex: number = children.findIndex((b) => b.id === childId);\n\tif (childIndex < 0) return false;\n\n\treturn handler({\n\t\tstate,\n\t\tquotePath,\n\t\tquoteParentPath: quotePath.slice(0, -1),\n\t\tquoteIndex: parentRef.index,\n\t\tchild,\n\t\tchildIndex,\n\t\tchildCount: children.length,\n\t\toffset: sel.anchor.offset,\n\t});\n}\n\n/** Registers the blockquote container keyboard handlers at context priority. */\nexport function registerBlockquoteKeymaps(context: PluginContext): void {\n\tcontext.registerKeymap(\n\t\t{\n\t\t\tEnter: () => handleEnterExit(context),\n\t\t\tBackspace: () => handleBackspaceLift(context),\n\t\t},\n\t\t{ priority: 'context' },\n\t);\n}\n\n// --- Handlers ---\n\n/**\n * Enter in an empty last child of the blockquote exits the container: a fresh\n * paragraph is created after the quote (or, when that child is the quote's only\n * child, the quote dissolves into that paragraph). Any other case returns false\n * so the default splitBlock creates a new line inside the quote.\n */\nfunction handleEnterExit(context: PluginContext): boolean {\n\treturn withBlockquoteChildContext(context, (ctx) => {\n\t\tif (ctx.child.type === 'list_item') return false;\n\t\tconst isLast: boolean = ctx.childIndex === ctx.childCount - 1;\n\t\tif (!isLast || getBlockLength(ctx.child) > 0) return false;\n\n\t\tconst paragraph: BlockNode = createEmptyParagraph();\n\t\tconst builder = ctx.state.transaction('input');\n\n\t\tif (ctx.childCount === 1) {\n\t\t\t// Sole child: dissolve the quote, replacing it with the paragraph.\n\t\t\tbuilder.removeNode(ctx.quoteParentPath, ctx.quoteIndex);\n\t\t\tbuilder.insertNode(ctx.quoteParentPath, ctx.quoteIndex, paragraph);\n\t\t} else {\n\t\t\t// Drop the empty trailing child and continue after the quote.\n\t\t\tbuilder.removeNode(ctx.quotePath, ctx.childIndex);\n\t\t\tbuilder.insertNode(ctx.quoteParentPath, ctx.quoteIndex + 1, paragraph);\n\t\t}\n\n\t\tbuilder.setSelection(createCollapsedSelection(paragraph.id, 0));\n\t\tcontext.dispatch(builder.build());\n\t\treturn true;\n\t});\n}\n\n/**\n * Backspace at the start of the blockquote's first child lifts that child out of\n * the quote (placing it directly before the quote, or dissolving the quote when\n * it was the only child). Inner children at offset 0 fall through to the default\n * merge, which joins adjacent siblings within the quote.\n */\nfunction handleBackspaceLift(context: PluginContext): boolean {\n\treturn withBlockquoteChildContext(context, (ctx) => {\n\t\tif (ctx.offset !== 0 || ctx.childIndex !== 0) return false;\n\t\tif (ctx.child.type === 'list_item') return false;\n\n\t\tconst builder = ctx.state.transaction('input');\n\n\t\tif (ctx.childCount === 1) {\n\t\t\t// Sole child: dissolve the quote, the child takes its place.\n\t\t\tbuilder.removeNode(ctx.quoteParentPath, ctx.quoteIndex);\n\t\t\tbuilder.insertNode(ctx.quoteParentPath, ctx.quoteIndex, ctx.child);\n\t\t} else {\n\t\t\t// Lift the first child out, immediately before the quote.\n\t\t\tbuilder.removeNode(ctx.quotePath, 0);\n\t\t\tbuilder.insertNode(ctx.quoteParentPath, ctx.quoteIndex, ctx.child);\n\t\t}\n\n\t\tbuilder.setSelection(createCollapsedSelection(ctx.child.id, 0));\n\t\tcontext.dispatch(builder.build());\n\t\treturn true;\n\t});\n}\n","/**\n * Locale interface and default English locale for the BlockquotePlugin.\n */\n\nimport { type LocaleModuleMap, loadLocaleModule } from '../shared/LocaleLoader.js';\n\n// --- Locale Interface ---\n\nexport interface BlockquoteLocale {\n\treadonly label: string;\n\treadonly tooltip: (shortcut: string) => string;\n}\n\n// --- Default English Locale ---\n\nexport const BLOCKQUOTE_LOCALE_EN: BlockquoteLocale = {\n\tlabel: 'Blockquote',\n\ttooltip: (shortcut: string) => `Blockquote (${shortcut})`,\n};\n\n// --- Lazy Locale Loader ---\n\nconst localeModules: LocaleModuleMap<BlockquoteLocale> = import.meta.glob<{\n\tdefault: BlockquoteLocale;\n}>('./locales/*.ts', { eager: false });\n\nexport async function loadBlockquoteLocale(lang: string): Promise<BlockquoteLocale> {\n\treturn loadLocaleModule(localeModules, lang, BLOCKQUOTE_LOCALE_EN);\n}\n","/** Blockquote styles using CSS logical properties for RTL support. */\nexport const BLOCKQUOTE_CSS = `\n.notectl-content blockquote {\n\tmargin: 0;\n\tpadding: 2px 0;\n\tpadding-inline-start: 16px;\n\tborder-inline-start: 3px solid var(--notectl-blockquote-border, var(--notectl-border));\n\tbackground: var(--notectl-blockquote-bg, transparent);\n\tcolor: var(--notectl-blockquote-fg, inherit);\n\tmin-height: 1.6em;\n}\n`;\n","/**\n * BlockquotePlugin: registers a blockquote block type with NodeSpec,\n * toggle command, keyboard shortcut, input rule, and a toolbar button.\n */\n\nimport {\n\tliftSelectionFromContainer,\n\twrapSelectionInContainer,\n} from '../../commands/ContainerCommands.js';\nimport type { BlockNode } from '../../model/Document.js';\nimport { createBlockNode, generateBlockId } from '../../model/Document.js';\nimport { hasAncestorOfType } from '../../model/NodeResolver.js';\nimport { isCollapsed, isTextSelection } from '../../model/Selection.js';\nimport { nodeType } from '../../model/TypeBrands.js';\nimport { createBlockElement } from '../../view/DomUtils.js';\nimport type { Plugin, PluginContext } from '../Plugin.js';\nimport { resolveLocale } from '../shared/PluginHelpers.js';\nimport { formatShortcut } from '../shared/ShortcutFormatting.js';\nimport { registerBlockquoteKeymaps } from './BlockquoteKeyboardHandlers.js';\nimport {\n\tBLOCKQUOTE_LOCALE_EN,\n\ttype BlockquoteLocale,\n\tloadBlockquoteLocale,\n} from './BlockquoteLocale.js';\nimport { BLOCKQUOTE_CSS } from './BlockquoteStyles.js';\n\n// --- Attribute Registry Augmentation ---\n\ndeclare module '../../model/AttrRegistry.js' {\n\tinterface NodeAttrRegistry {\n\t\tblockquote: Record<string, never>;\n\t}\n}\n\n// --- Configuration ---\n\nexport interface BlockquoteConfig {\n\treadonly locale?: BlockquoteLocale;\n}\n\nconst DEFAULT_CONFIG: BlockquoteConfig = {};\n\n// --- Plugin ---\n\nexport class BlockquotePlugin implements Plugin {\n\treadonly id = 'blockquote';\n\treadonly name = 'Blockquote';\n\treadonly priority = 35;\n\n\tprivate readonly config: BlockquoteConfig;\n\tprivate locale!: BlockquoteLocale;\n\n\tconstructor(config?: Partial<BlockquoteConfig>) {\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\tBLOCKQUOTE_LOCALE_EN,\n\t\t\tloadBlockquoteLocale,\n\t\t);\n\t\tcontext.registerStyleSheet(BLOCKQUOTE_CSS);\n\t\tthis.registerNodeSpec(context);\n\t\tthis.registerCommands(context);\n\t\tthis.registerKeymap(context);\n\t\tthis.registerInputRule(context);\n\t\tthis.registerToolbarItem(context);\n\t}\n\n\tprivate registerNodeSpec(context: PluginContext): void {\n\t\tcontext.registerNodeSpec({\n\t\t\ttype: 'blockquote',\n\t\t\tgroup: 'block',\n\t\t\t// Container block (issue #136): a blockquote wraps other blocks, mirroring\n\t\t\t// HTML flow-content semantics. `isolating` is intentionally NOT set so the\n\t\t\t// caret can flow across the container boundary (unlike table_cell).\n\t\t\tcontent: {\n\t\t\t\tallow: ['paragraph', 'heading', 'list_item', 'blockquote', 'horizontal_rule', 'code_block'],\n\t\t\t\tmin: 1,\n\t\t\t},\n\t\t\ttoDOM(node) {\n\t\t\t\tconst el = createBlockElement('blockquote', node.id);\n\t\t\t\tel.setAttribute('part', 'blockquote');\n\t\t\t\treturn el;\n\t\t\t},\n\t\t\ttoHTML(_node, content) {\n\t\t\t\treturn `<blockquote>${content || '<br>'}</blockquote>`;\n\t\t\t},\n\t\t\tparseHTML: [{ tag: 'blockquote' }],\n\t\t\tsanitize: { tags: ['blockquote'] },\n\t\t});\n\t}\n\n\tprivate registerCommands(context: PluginContext): void {\n\t\tcontext.registerCommand('toggleBlockquote', () => {\n\t\t\treturn this.toggleBlockquote(context);\n\t\t});\n\n\t\tcontext.registerCommand('setBlockquote', () => {\n\t\t\treturn this.wrapInBlockquote(context);\n\t\t});\n\t}\n\n\tprivate registerKeymap(context: PluginContext): void {\n\t\tcontext.registerKeymap({\n\t\t\t'Mod-Shift->': () => context.executeCommand('toggleBlockquote'),\n\t\t});\n\t\tregisterBlockquoteKeymaps(context);\n\t}\n\n\tprivate registerInputRule(context: PluginContext): void {\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 = state.getBlock(sel.anchor.blockId);\n\t\t\t\tif (!block || block.type !== 'paragraph') return null;\n\n\t\t\t\tconst index: number = state.doc.children.findIndex((b) => b.id === block.id);\n\t\t\t\tif (index < 0) return null;\n\n\t\t\t\t// B2: wrap the paragraph into a blockquote container, then strip the\n\t\t\t\t// \"> \" marker from the (now nested) paragraph in the same transaction.\n\t\t\t\tconst container = createBlockNode(nodeType('blockquote'), [block], generateBlockId());\n\t\t\t\treturn state\n\t\t\t\t\t.transaction('input')\n\t\t\t\t\t.removeNode([], index)\n\t\t\t\t\t.insertNode([], index, container)\n\t\t\t\t\t.deleteTextAt(sel.anchor.blockId, start, start + 2)\n\t\t\t\t\t.setSelection(sel)\n\t\t\t\t\t.build();\n\t\t\t},\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=\"M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z\"/></svg>';\n\n\t\tcontext.registerToolbarItem({\n\t\t\tid: 'blockquote',\n\t\t\tgroup: 'block',\n\t\t\ticon,\n\t\t\tlabel: this.locale.label,\n\t\t\ttooltip: this.locale.tooltip(formatShortcut('Mod-Shift->')),\n\t\t\tcommand: 'toggleBlockquote',\n\t\t\tisActive: (state) => {\n\t\t\t\tif (!isTextSelection(state.selection)) return false;\n\t\t\t\treturn hasAncestorOfType(state.doc, state.selection.anchor.blockId, 'blockquote');\n\t\t\t},\n\t\t});\n\t}\n\n\t/**\n\t * Toggles the blockquote container around the selection.\n\t * If the selection already lives inside a blockquote, its blocks are lifted\n\t * back out; otherwise the selected blocks are wrapped into one blockquote.\n\t */\n\tprivate toggleBlockquote(context: PluginContext): boolean {\n\t\tconst state = context.getState();\n\t\tconst sel = state.selection;\n\t\tif (!isTextSelection(sel)) return false;\n\n\t\tconst tr = hasAncestorOfType(state.doc, sel.anchor.blockId, 'blockquote')\n\t\t\t? liftSelectionFromContainer(state, nodeType('blockquote'), sel)\n\t\t\t: wrapSelectionInContainer(state, nodeType('blockquote'), sel, this.isQuoteChild(context));\n\n\t\tif (!tr) return false;\n\t\tcontext.dispatch(tr);\n\t\treturn true;\n\t}\n\n\t/** Wraps the selected blocks into a blockquote container (no toggle-off). */\n\tprivate wrapInBlockquote(context: PluginContext): boolean {\n\t\tconst state = context.getState();\n\t\tconst sel = state.selection;\n\t\tif (!isTextSelection(sel)) return false;\n\n\t\tconst tr = wrapSelectionInContainer(\n\t\t\tstate,\n\t\t\tnodeType('blockquote'),\n\t\t\tsel,\n\t\t\tthis.isQuoteChild(context),\n\t\t);\n\t\tif (!tr) return false;\n\t\tcontext.dispatch(tr);\n\t\treturn true;\n\t}\n\n\t/**\n\t * Builds a predicate that reports whether a block may legally become a direct\n\t * child of the blockquote container, derived from the registered NodeSpec's\n\t * `content.allow` (single source of truth). Matches both concrete child types\n\t * and group names (e.g. `block`), so blocks the quote cannot hold (e.g. a\n\t * `table`) are excluded rather than nested into an invalid document.\n\t */\n\tprivate isQuoteChild(context: PluginContext): (block: BlockNode) => boolean {\n\t\tconst registry = context.getSchemaRegistry();\n\t\tconst allow: ReadonlySet<string> = new Set(\n\t\t\tregistry.getNodeSpec(nodeType('blockquote'))?.content?.allow ?? [],\n\t\t);\n\t\treturn (block: BlockNode): boolean => {\n\t\t\tif (allow.has(block.type)) return true;\n\t\t\tconst group: string | undefined = registry.getNodeSpec(block.type)?.group;\n\t\t\treturn group !== undefined && allow.has(group);\n\t\t};\n\t}\n}\n"],"mappings":"sYAuBA,SAAS,EAAgB,EAAoB,GAC5C,MAAM,EAA6B,EAAM,YAAY,KAAW,GAChE,OAAK,EACE,EAAM,IAAI,SAAS,UAAW,GAAM,EAAE,KAAO,IADjC,CAEpB,CAaA,SAAgB,EACf,EACA,EACA,EACA,GAEA,MAAM,EAAQ,EAAe,EAAW,EAAM,iBACxC,EAAkB,EAAgB,EAAO,EAAM,KAAK,SACpD,EAAgB,EAAgB,EAAO,EAAM,GAAG,SACtD,GAAI,EAAU,GAAK,EAAQ,EAAG,OAAO,KAErC,MAAM,EAAa,KAAK,IAAI,EAAS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,CIoDK,CAA2B,EAAO,EAAS,cAAe,GAC1D,EAAyB,EAAO,EAAS,cAAe,EAAK,KAAK,aAAa,IAElF,QAAK,IACL,EAAQ,SAAS,IACV,EACR,CAGA,gBAAA,CAAyB,GACxB,MAAM,EAAQ,EAAQ,WAChB,EAAM,EAAM,UAClB,IAAK,EAAgB,GAAM,OAAO,EAElC,MAAM,EAAK,EACV,EACA,EAAS,cACT,EACA,KAAK,aAAa,IAEnB,QAAK,IACL,EAAQ,SAAS,IACV,EACR,CASA,YAAA,CAAqB,GACpB,MAAM,EAAW,EAAQ,oBACnB,EAA6B,IAAI,IACtC,EAAS,YAAY,EAAS,gBAAgB,SAAS,OAAS,IAEjE,OAAQ,IACP,GAAI,EAAM,IAAI,EAAM,MAAO,OAAO,EAClC,MAAM,EAA4B,EAAS,YAAY,EAAM,OAAO,MACpE,YAAiB,IAAV,GAAuB,EAAM,IAAI,GAE1C"}
@@ -0,0 +1,2 @@
1
+ import{g as n,h as t,n as o,p as e}from"./Document-r7vLOAGA.mjs";import{i as r,n as i,r as l,t as c}from"./WordBoundary-DxeMBRyP.mjs";import{o as a,u as s}from"./Selection-HYoVFpAx.mjs";import{r as u}from"./DomUtils-Bf7JLFlx.mjs";import{i as f,n as d,r as h}from"./GapCursorNavigation-ycNzuQVH.mjs";import{a as m,i as w,t as g}from"./NavigationQueries-Bt4zZ17v.mjs";import{r as k,t as b}from"./Platform-ByobkiCc.mjs";import{a as I,i as p,n as v,t as y}from"./SelectionSync-BSHIw1EE.mjs";import{a as x,s as B}from"./PluginHelpers-D4quRJ5a.mjs";function C(n){const t=n.selection;if(!s(t))return null;const o=a(t)?t.anchor.blockId:t.head.blockId;return 0===(a(t)?t.anchor.offset:t.head.offset)?null:h(n,o,0)}function M(n){const t=n.selection;if(!s(t))return null;const o=a(t)?t.anchor.blockId:t.head.blockId,r=n.getBlock(o);if(!r)return null;const i=e(r);return(a(t)?t.anchor.offset:t.head.offset)===i?null:h(n,o,i)}function A(n){const t=n.selection;return s(t)?{blockId:t.head.blockId,offset:t.head.offset}:null}function S(n,t,o){const e=n.getBlockOrder(),r=e.indexOf(t);if(r<0)return null;const i="forward"===o?r+1:r-1;return i<0||i>=e.length?null:e[i]??null}function E(r){const i=r.selection;if(!s(i))return null;if(!a(i))return h(r,i.head.blockId,i.head.offset);const c=i.anchor.blockId,u=r.getBlock(c);if(!u)return null;const d=i.anchor.offset;if(d<e(u))return"inline"===n(u,d)?.kind?h(r,c,d+1):h(r,c,d+(l(t(u),o(u,d))||1));const m=S(r,c,"forward");return m&&g(r,c,m)?w(r,m)?f(r,m):h(r,m,0):null}function V(i){const l=i.selection;if(!s(l))return null;if(!a(l))return h(i,l.head.blockId,l.head.offset);const c=l.anchor.blockId,u=i.getBlock(c);if(!u)return null;const d=l.anchor.offset;if(d>0)return"inline"===n(u,d-1)?.kind?h(i,c,d-1):h(i,c,d-(r(t(u),o(u,d))||1));const m=S(i,c,"backward");if(!m)return null;if(!g(i,c,m))return null;if(w(i,m))return f(i,m);const k=i.getBlock(m);return k?h(i,m,e(k)):null}function N(n){const t=n.selection;if(!s(t))return null;const o=n.getBlockOrder()[0];return o?w(n,o)?f(n,o):h(n,o,0):null}function T(n){const t=n.selection;if(!s(t))return null;const o=n.getBlockOrder(),r=o[o.length-1];if(!r)return null;if(w(n,r))return f(n,r);const i=n.getBlock(r);return i?h(n,r,e(i)):null}function j(r){const i=A(r);if(!i)return null;const c=r.selection;if(!s(c))return null;const a=r.getBlock(i.blockId);if(!a)return null;const u=e(a);if(i.offset<u){const e="inline"===n(a,i.offset)?.kind?1:l(t(a),o(a,i.offset))||1;return d(r,c.anchor.blockId,c.anchor.offset,i.blockId,i.offset+e)}const f=S(r,i.blockId,"forward");return f&&g(r,i.blockId,f)?d(r,c.anchor.blockId,c.anchor.offset,f,0):null}function H(i){const l=A(i);if(!l)return null;const c=i.selection;if(!s(c))return null;if(l.offset>0){const e=i.getBlock(l.blockId);if(!e)return null;const a="inline"===n(e,l.offset-1)?.kind?1:r(t(e),o(e,l.offset))||1;return d(i,c.anchor.blockId,c.anchor.offset,l.blockId,l.offset-a)}const a=S(i,l.blockId,"backward");if(!a)return null;if(!g(i,l.blockId,a))return null;const u=i.getBlock(a);return u?d(i,c.anchor.blockId,c.anchor.offset,a,e(u)):null}function O(n){const t=A(n);if(!t)return null;const o=n.selection;return s(o)?0===t.offset?null:d(n,o.anchor.blockId,o.anchor.offset,t.blockId,0):null}function R(n){const t=A(n);if(!t)return null;const o=n.selection;if(!s(o))return null;const r=n.getBlock(t.blockId);if(!r)return null;const i=e(r);return t.offset===i?null:d(n,o.anchor.blockId,o.anchor.offset,t.blockId,i)}function L(n){const t=n.selection;if(!s(t))return null;const o=n.getBlockOrder()[0];return o?t.head.blockId===o&&0===t.head.offset?null:d(n,t.anchor.blockId,t.anchor.offset,o,0):null}function D(n){const t=n.selection;if(!s(t))return null;const o=n.getBlockOrder(),r=o[o.length-1];if(!r)return null;const i=n.getBlock(r);if(!i)return null;const l=e(i);return t.head.blockId===r&&t.head.offset===l?null:d(n,t.anchor.blockId,t.anchor.offset,r,l)}function z(n,t,o){if("caretPositionFromPoint"in n){const e=n.caretPositionFromPoint(t,o);if(e)return{node:e.offsetNode,offset:e.offset}}if("caretRangeFromPoint"in n){const e=n.caretRangeFromPoint(t,o);if(e)return{node:e.startContainer,offset:e.startOffset}}return null}function P(n,t,o,e){return z(n,t,o)??(e&&n!==e?z(e,t,o):null)}function F(n,t,o,r){const i=t.selection;if(!s(i))return!1;if(!a(i))return!1;const l=t.getBlock(i.anchor.blockId);if(!l)return!1;const c=i.anchor.offset,f=e(l),d=n.querySelector(`[data-block-id="${i.anchor.blockId}"]`),h=d instanceof HTMLElement&&"rtl"===b(d);if("left"===o)return h?c===f:0===c;if("right"===o)return h?0===c:c===f;if("up"===o&&0===c)return!0;if("down"===o&&c===f)return!0;const m=v();return m&&m.modify?function(n,t,o,e){const r=p(n,t);if(!r)return!1;const i=e??_(t,n),l="up"===o?"backward":"forward";try{t.modify("move",l,"line");const o=p(n,t);if(!o)return!1;if(u(n,r.focusNode)!==u(n,o.focusNode))return!0;if(o.anchorNode===r.anchorNode&&o.anchorOffset===r.anchorOffset&&o.focusNode===r.focusNode&&o.focusOffset===r.focusOffset)return!0;if(i){const o=_(t,n);if(o&&Math.abs(o.top-i.top)<1)return!0}return!1}finally{try{t.setBaseAndExtent(r.anchorNode,r.anchorOffset,r.focusNode,r.focusOffset)}catch{}}}(n,m,o,r):"up"===o?0===c:c===f}function q(n,t){const o=K(n,t);if(!o)return null;if(o.isVoid)return f(n,o.targetId);const r=n.getBlock(o.targetId);if(!r)return null;const i="right"===t||"down"===t?0:e(r);return h(n,o.targetId,i)}function $(n,t,o,r){const i=K(t,o);if(!i)return null;if(i.isVoid)return f(t,i.targetId);const l=t.getBlock(i.targetId);if(!l)return null;const c=e(l);if(null!==r){const e=function(n,t,o,e){const r=n.querySelector(`[data-block-id="${t}"]`);if(!r)return null;const i=r.getBoundingClientRect(),l=function(n,t,o){if(!(n instanceof HTMLElement))return"down"===o?t.top+2:t.bottom-2;const e=getComputedStyle(n),r=Number.parseFloat(e.paddingTop)||0,i=Number.parseFloat(e.paddingBottom)||0;return"down"===o?t.top+r+2:t.bottom-i-2}(r,i,o),c=Math.min(Math.max(e,i.left),i.right-1),a=P(n.getRootNode(),c,l,n.ownerDocument);if(!a)return null;if(!r.contains(a.node))return null;const s=y(n,a.node,a.offset);return s?s.blockId!==t?null:s:null}(n,i.targetId,o,r);if(e)return h(t,e.blockId,e.offset)}if(s(t.selection)&&a(t.selection)){const n=t.selection.anchor.offset,o=Math.min(n,c);return h(t,i.targetId,o)}const u="down"===o?0:c;return h(t,i.targetId,u)}function U(t,o){if("up"===o||"down"===o)return null;const e=t.selection;if(!s(e))return null;if(!a(e))return null;const r=e.anchor.blockId,i=t.getBlock(r);if(!i)return null;const l=e.anchor.offset;return"right"===o?function(t,o,e,r){const i=n(e,r);return i&&"inline"===i.kind?h(t,o,r+1):null}(t,r,i,l):function(t,o,e,r){if(0===r)return null;const i=n(e,r-1);return i&&"inline"===i.kind?h(t,o,r-1):null}(t,r,i,l)}function _(n,t){if(n.rangeCount>0){const o=n.getRangeAt(0);if(!t||t.contains(o.startContainer)){const n=o.getClientRects();if(n.length>0)return n[0]??null;const t=o.getBoundingClientRect();if(t.height>0)return t}}if(t){const o=p(t,n);if(o)try{const n=document.createRange();n.setStart(o.anchorNode,o.anchorOffset),n.setEnd(o.focusNode,o.focusOffset);const t=n.getClientRects();return t.length>0?t[0]??null:n.getBoundingClientRect()}catch{}}return null}function K(n,t){const o=n.selection;if(!s(o))return null;const e="right"===t||"down"===t;return m(n,o.anchor.blockId,e)}function Q(n,t,o,e){return J(n,t,"move",o,e)}function G(n,t,o,e){return J(n,t,"extend",o,e)}function J(t,o,r,i,l){const c=o.selection;if(!s(c))return null;const a="move"===r?W:X,u=v();if(!u?.modify)return a(o,i,l);const m=p(t,u);if(!m)return a(o,i,l);try{u.modify(r,i,l);const a=I(t);if(!a)return null;const s="move"===r?c.anchor.blockId:c.head.blockId,m="move"===r?a.anchor:a.head,k=m.blockId;if(k!==s&&!g(o,s,k))return null;let b=m.offset;const p=o.getBlock(k);return p&&"inline"===n(p,b)?.kind&&"forward"===i&&(b=Math.min(b+1,e(p))),"move"===r?w(o,k)?f(o,k):h(o,k,b):d(o,c.anchor.blockId,c.anchor.offset,k,b)}finally{try{u.setBaseAndExtent(m.anchorNode,m.anchorOffset,m.focusNode,m.focusOffset)}catch{}}}function W(n,t,o){return"word"===o?function(n,t){const o=n.selection;if(!s(o))return null;const r=a(o)?o.anchor.blockId:o.head.blockId,l=a(o)?o.anchor.offset:o.head.offset,u=n.getBlock(r);if(!u)return null;const d="forward"===t?i(u,l):c(u,l);return d===l?function(n,t,o){const r=m(n,t,"forward"===o);if(!r)return null;if(r.isVoid)return f(n,r.targetId);const i=n.getBlock(r.targetId);if(!i)return null;const l="forward"===o?0:e(i);return h(n,r.targetId,l)}(n,r,t):h(n,r,d)}(n,t):"lineboundary"===o?"forward"===t?M(n):C(n):q(n,"forward"===t?"down":"up")}function X(n,t,o){const r=n.selection;if(!s(r))return null;const l=r.head,a=n.getBlock(l.blockId);if(!a)return null;let u=l.offset;if("word"===o)u="forward"===t?i(a,l.offset):c(a,l.offset);else{if("lineboundary"!==o){const o=m(n,l.blockId,"forward"===t);if(!o)return null;if(o.isVoid)return null;const i=n.getBlock(o.targetId);if(!i)return null;const c="forward"===t?0:e(i);return d(n,r.anchor.blockId,r.anchor.offset,o.targetId,c)}u="forward"===t?e(a):0}return d(n,r.anchor.blockId,r.anchor.offset,l.blockId,u)}function Y(n,t){return Q(n,t,"forward","word")}function Z(n,t){return Q(n,t,"backward","word")}function nn(n,t){return Q(n,t,"backward","lineboundary")}function tn(n,t){return Q(n,t,"forward","lineboundary")}function on(n,t){return Q(n,t,"backward","line")}function en(n,t){return Q(n,t,"forward","line")}function rn(n,t){return G(n,t,"forward","word")}function ln(n,t){return G(n,t,"backward","word")}function cn(n,t){return G(n,t,"backward","lineboundary")}function an(n,t){return G(n,t,"forward","lineboundary")}function sn(n,t){return G(n,t,"backward","line")}function un(n,t){return G(n,t,"forward","line")}var fn={paragraph:"Paragraph",heading1:"Heading 1",heading2:"Heading 2",heading3:"Heading 3",heading4:"Heading 4",heading5:"Heading 5",heading6:"Heading 6",codeBlock:"Code Block",blockquote:"Block Quote",listItem:"List Item",horizontalRule:"Horizontal Rule",image:"Image",table:"Table"},dn={paragraph:"paragraph",code_block:"codeBlock",blockquote:"blockquote",list_item:"listItem",horizontal_rule:"horizontalRule",image:"image",table:"table"},hn=/* #__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-BRX5E_Pw.mjs"),"./locales/de.ts":()=>import("./de-B9zSHWqY.mjs"),"./locales/es.ts":()=>import("./es-CgMfhkJJ.mjs"),"./locales/fr.ts":()=>import("./fr-0qEo3bRP.mjs"),"./locales/hi.ts":()=>import("./hi-CoclKAUM.mjs"),"./locales/pt.ts":()=>import("./pt-CMx2wPPY.mjs"),"./locales/ru.ts":()=>import("./ru-QGX8lOTs.mjs"),"./locales/zh.ts":()=>import("./zh-YfuE_m2y.mjs")});async function mn(n){return B(hn,n,fn)}var wn={"word:forward":Y,"word:backward":Z,"lineboundary:forward":tn,"lineboundary:backward":nn,"line:forward":en,"line:backward":on},gn={"word:forward":rn,"word:backward":ln,"lineboundary:forward":an,"lineboundary:backward":cn,"line:forward":un,"line:backward":sn},kn=class{id="caret-navigation";name="Caret Navigation";priority=4;context=null;lastAnnouncedBlockId=null;announceTimer=null;announce=null;locale=fn;async init(n){this.locale=await x(n,void 0,fn,mn),this.context=n,this.announce=t=>n.announce(t);const t=k(),o={"Shift-ArrowRight":()=>this.extendCharacterVisual("right"),"Shift-ArrowLeft":()=>this.extendCharacterVisual("left"),"Shift-ArrowUp":()=>this.viewExtendCommand("backward","line"),"Shift-ArrowDown":()=>this.viewExtendCommand("forward","line"),...t?{"Alt-ArrowRight":()=>this.viewMoveVisual("right","word"),"Alt-ArrowLeft":()=>this.viewMoveVisual("left","word"),"Shift-Alt-ArrowRight":()=>this.viewExtendVisual("right","word"),"Shift-Alt-ArrowLeft":()=>this.viewExtendVisual("left","word")}:{"Mod-ArrowRight":()=>this.viewMoveVisual("right","word"),"Mod-ArrowLeft":()=>this.viewMoveVisual("left","word"),"Mod-Shift-ArrowRight":()=>this.viewExtendVisual("right","word"),"Mod-Shift-ArrowLeft":()=>this.viewExtendVisual("left","word")},...t?{"Mod-ArrowLeft":()=>this.viewMoveVisual("left","lineboundary"),"Mod-ArrowRight":()=>this.viewMoveVisual("right","lineboundary"),"Mod-Shift-ArrowLeft":()=>this.viewExtendVisual("left","lineboundary"),"Mod-Shift-ArrowRight":()=>this.viewExtendVisual("right","lineboundary")}:{Home:()=>this.viewMoveCommand("backward","lineboundary"),End:()=>this.viewMoveCommand("forward","lineboundary"),"Shift-Home":()=>this.viewExtendCommand("backward","lineboundary"),"Shift-End":()=>this.viewExtendCommand("forward","lineboundary")},...t?{"Mod-ArrowUp":()=>this.modelCommand(N),"Mod-ArrowDown":()=>this.modelCommand(T),"Mod-Shift-ArrowUp":()=>this.modelCommand(L),"Mod-Shift-ArrowDown":()=>this.modelCommand(D)}:{"Mod-Home":()=>this.modelCommand(N),"Mod-End":()=>this.modelCommand(T),"Mod-Shift-Home":()=>this.modelCommand(L),"Mod-Shift-End":()=>this.modelCommand(D)}};n.registerKeymap(o,{priority:"navigation"})}onStateChange(n,t,o){const e=t.selection;if(!a(e)||!s(e))return null!==this.announceTimer&&(clearTimeout(this.announceTimer),this.announceTimer=null),void(this.lastAnnouncedBlockId=null);const r=e.anchor.blockId;r!==this.lastAnnouncedBlockId&&(null!==this.lastAnnouncedBlockId?(this.lastAnnouncedBlockId=r,null!==this.announceTimer&&clearTimeout(this.announceTimer),this.announceTimer=setTimeout(()=>{if(this.announceTimer=null,this.context?.hasAnnouncement())return;const n=t.getBlock(r);if(!n)return;const o=function(n,t,o){if("heading"===t&&o?.level){const t=`heading${o.level}`;if(t in n)return n[t]}const e=dn[t];return e?n[e]:t}(this.locale,n.type,n.attrs);this.announce?.(o)},150)):this.lastAnnouncedBlockId=r)}destroy(){null!==this.announceTimer&&clearTimeout(this.announceTimer),this.announceTimer=null,this.announce=null,this.context=null}modelCommand(n){if(!this.context)return!1;const t=n(this.context.getState());return!!t&&(this.context.dispatch(t),!0)}extendCharacterVisual(n){if(!this.context)return!1;const t=this.context.getState(),o="forward"===this.resolveLogicalHorizontalDirection(t,n)?j(t):H(t);return!!o&&(this.context.dispatch(o),!0)}viewMoveCommand(n,t){return this.dispatchViewCommand(wn,n,t)}viewMoveVisual(n,t){if(!this.context)return!1;const o=this.resolveLogicalHorizontalDirection(this.context.getState(),n);return this.viewMoveCommand(o,t)}viewExtendCommand(n,t){return this.dispatchViewCommand(gn,n,t)}dispatchViewCommand(n,t,o){if(!this.context)return!1;const e=n[`${o}:${t}`];if(!e)return!1;const r=e(this.context.getContainer(),this.context.getState());return!!r&&(this.context.dispatch(r),!0)}viewExtendVisual(n,t){if(!this.context)return!1;const o=this.resolveLogicalHorizontalDirection(this.context.getState(),n);return this.viewExtendCommand(o,t)}resolveLogicalHorizontalDirection(n,t){const o=n.selection;if(!s(o))return"left"===t?"backward":"forward";const e=this.context?.getContainer();if(!e)return"left"===t?"backward":"forward";const r=e.querySelector(`[data-block-id="${o.head.blockId}"]`);return r instanceof HTMLElement&&"rtl"===b(r)?"left"===t?"forward":"backward":"left"===t?"backward":"forward"}};export{V as A,P as C,O as D,R as E,C as F,T as M,N,D as O,M as P,U as S,j as T,Q as _,sn as a,q as b,ln as c,on as d,tn as f,G as g,Y as h,un as i,E as j,L as k,rn as l,Z as m,fn as n,an as o,nn as p,mn as r,cn as s,kn as t,en as u,F as v,H as w,$ as x,_ as y};
2
+ //# sourceMappingURL=CaretNavigationPlugin-Bb7W_FMg.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CaretNavigationPlugin-Bb7W_FMg.mjs","names":[],"sources":["../../src/state/BlockBoundaryMovement.ts","../../src/commands/MovementCommands.ts","../../src/view/DomPointUtils.ts","../../src/view/CaretNavigation.ts","../../src/view/ViewMovementCommands.ts","../../src/plugins/caret-navigation/CaretNavigationLocale.ts","../../src/plugins/caret-navigation/CaretNavigationPlugin.ts"],"sourcesContent":["/**\n * Block boundary movement: pure state-level functions for moving\n * the cursor to the start or end of the current block.\n *\n * These only depend on model/ and state/ types, so they belong\n * at the state layer rather than in commands/.\n */\n\nimport { getBlockLength } from '../model/Document.js';\nimport { isCollapsed, isTextSelection } from '../model/Selection.js';\nimport type { BlockId } from '../model/TypeBrands.js';\nimport type { EditorState } from './EditorState.js';\nimport { moveTx } from './SelectionTransactions.js';\nimport type { Transaction } from './Transaction.js';\n\n/** Moves the cursor to the start of the current block. */\nexport function moveToBlockStart(state: EditorState): Transaction | null {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return null;\n\n\tconst blockId: BlockId = isCollapsed(sel) ? sel.anchor.blockId : sel.head.blockId;\n\tconst offset: number = isCollapsed(sel) ? sel.anchor.offset : sel.head.offset;\n\n\tif (offset === 0) return null;\n\treturn moveTx(state, blockId, 0);\n}\n\n/** Moves the cursor to the end of the current block. */\nexport function moveToBlockEnd(state: EditorState): Transaction | null {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return null;\n\n\tconst blockId: BlockId = isCollapsed(sel) ? sel.anchor.blockId : sel.head.blockId;\n\tconst block = state.getBlock(blockId);\n\tif (!block) return null;\n\n\tconst blockLen: number = getBlockLength(block);\n\tconst offset: number = isCollapsed(sel) ? sel.anchor.offset : sel.head.offset;\n\n\tif (offset === blockLen) return null;\n\treturn moveTx(state, blockId, blockLen);\n}\n","/**\n * Model-based movement commands for programmatic cursor navigation.\n *\n * All functions are pure: they take an EditorState and return a Transaction\n * or `null` (when the movement is not applicable). None touch the DOM.\n *\n * Move commands produce a collapsed cursor. Extend commands keep the anchor\n * and move the head, producing a range selection. All clear storedMarks.\n */\n\nimport {\n\tblockOffsetToTextOffset,\n\tgetBlockLength,\n\tgetBlockText,\n\tgetContentAtOffset,\n} from '../model/Document.js';\nimport { nextGraphemeSize, prevGraphemeSize } from '../model/GraphemeUtils.js';\nimport { isCollapsed, isTextSelection } from '../model/Selection.js';\nimport type { BlockId } from '../model/TypeBrands.js';\nimport type { EditorState } from '../state/EditorState.js';\nimport { canCrossBlockBoundary, isVoidBlock } from '../state/NavigationQueries.js';\nimport { extendTx, moveTx, nodeSelTx } from '../state/SelectionTransactions.js';\nimport type { Transaction } from '../state/Transaction.js';\n\n// Re-export block boundary movement from state layer\nexport { moveToBlockEnd, moveToBlockStart } from '../state/BlockBoundaryMovement.js';\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\n/** Resolves the effective head position from any text selection. */\nfunction resolveHead(state: EditorState): { blockId: BlockId; offset: number } | null {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return null;\n\treturn { blockId: sel.head.blockId, offset: sel.head.offset };\n}\n\n/** Returns the adjacent block ID in the given direction, or `null`. */\nfunction adjacentBlockId(\n\tstate: EditorState,\n\tcurrentBlockId: BlockId,\n\tdirection: 'forward' | 'backward',\n): BlockId | null {\n\tconst blockOrder: readonly BlockId[] = state.getBlockOrder();\n\tconst idx: number = blockOrder.indexOf(currentBlockId);\n\tif (idx < 0) return null;\n\tconst targetIdx: number = direction === 'forward' ? idx + 1 : idx - 1;\n\tif (targetIdx < 0 || targetIdx >= blockOrder.length) return null;\n\treturn blockOrder[targetIdx] ?? null;\n}\n\n// ---------------------------------------------------------------------------\n// Character Movement\n// ---------------------------------------------------------------------------\n\n/** Moves the cursor one character forward, skipping InlineNodes atomically. */\nexport function moveCharacterForward(state: EditorState): Transaction | null {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return null;\n\n\t// If range selection, collapse to head\n\tif (!isCollapsed(sel)) {\n\t\treturn moveTx(state, sel.head.blockId, sel.head.offset);\n\t}\n\n\tconst blockId: BlockId = sel.anchor.blockId;\n\tconst block = state.getBlock(blockId);\n\tif (!block) return null;\n\n\tconst offset: number = sel.anchor.offset;\n\tconst blockLen: number = getBlockLength(block);\n\n\tif (offset < blockLen) {\n\t\t// InlineNode: skip atomically (+1)\n\t\tconst content = getContentAtOffset(block, offset);\n\t\tif (content?.kind === 'inline') {\n\t\t\treturn moveTx(state, blockId, offset + 1);\n\t\t}\n\t\t// Text: advance by one grapheme cluster\n\t\tconst text: string = getBlockText(block);\n\t\tconst textOffset: number = blockOffsetToTextOffset(block, offset);\n\t\tconst step: number = nextGraphemeSize(text, textOffset) || 1;\n\t\treturn moveTx(state, blockId, offset + step);\n\t}\n\n\t// At block end → cross-block\n\tconst nextId: BlockId | null = adjacentBlockId(state, blockId, 'forward');\n\tif (!nextId) return null;\n\tif (!canCrossBlockBoundary(state, blockId, nextId)) return null;\n\n\tif (isVoidBlock(state, nextId)) return nodeSelTx(state, nextId);\n\n\treturn moveTx(state, nextId, 0);\n}\n\n/** Moves the cursor one character backward, skipping InlineNodes atomically. */\nexport function moveCharacterBackward(state: EditorState): Transaction | null {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return null;\n\n\t// If range selection, collapse to head\n\tif (!isCollapsed(sel)) {\n\t\treturn moveTx(state, sel.head.blockId, sel.head.offset);\n\t}\n\n\tconst blockId: BlockId = sel.anchor.blockId;\n\tconst block = state.getBlock(blockId);\n\tif (!block) return null;\n\n\tconst offset: number = sel.anchor.offset;\n\n\tif (offset > 0) {\n\t\t// InlineNode: skip atomically (-1)\n\t\tconst content = getContentAtOffset(block, offset - 1);\n\t\tif (content?.kind === 'inline') {\n\t\t\treturn moveTx(state, blockId, offset - 1);\n\t\t}\n\t\t// Text: retreat by one grapheme cluster\n\t\tconst text: string = getBlockText(block);\n\t\tconst textOffset: number = blockOffsetToTextOffset(block, offset);\n\t\tconst step: number = prevGraphemeSize(text, textOffset) || 1;\n\t\treturn moveTx(state, blockId, offset - step);\n\t}\n\n\t// At block start → cross-block\n\tconst prevId: BlockId | null = adjacentBlockId(state, blockId, 'backward');\n\tif (!prevId) return null;\n\tif (!canCrossBlockBoundary(state, blockId, prevId)) return null;\n\n\tif (isVoidBlock(state, prevId)) return nodeSelTx(state, prevId);\n\n\tconst prevBlock = state.getBlock(prevId);\n\tif (!prevBlock) return null;\n\treturn moveTx(state, prevId, getBlockLength(prevBlock));\n}\n\n// ---------------------------------------------------------------------------\n// Document Boundary Movement\n// ---------------------------------------------------------------------------\n\n/** Moves the cursor to the beginning of the document. */\nexport function moveToDocumentStart(state: EditorState): Transaction | null {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return null;\n\n\tconst blockOrder: readonly BlockId[] = state.getBlockOrder();\n\tconst firstId: BlockId | undefined = blockOrder[0];\n\tif (!firstId) return null;\n\n\tif (isVoidBlock(state, firstId)) return nodeSelTx(state, firstId);\n\n\treturn moveTx(state, firstId, 0);\n}\n\n/** Moves the cursor to the end of the document. */\nexport function moveToDocumentEnd(state: EditorState): Transaction | null {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return null;\n\n\tconst blockOrder: readonly BlockId[] = state.getBlockOrder();\n\tconst lastId: BlockId | undefined = blockOrder[blockOrder.length - 1];\n\tif (!lastId) return null;\n\n\tif (isVoidBlock(state, lastId)) return nodeSelTx(state, lastId);\n\n\tconst lastBlock = state.getBlock(lastId);\n\tif (!lastBlock) return null;\n\treturn moveTx(state, lastId, getBlockLength(lastBlock));\n}\n\n// ---------------------------------------------------------------------------\n// Extend (Selection Extension) Commands\n// ---------------------------------------------------------------------------\n\n/** Extends the selection one character forward. */\nexport function extendCharacterForward(state: EditorState): Transaction | null {\n\tconst head = resolveHead(state);\n\tif (!head) return null;\n\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return null;\n\n\tconst block = state.getBlock(head.blockId);\n\tif (!block) return null;\n\n\tconst blockLen: number = getBlockLength(block);\n\n\tif (head.offset < blockLen) {\n\t\tconst content = getContentAtOffset(block, head.offset);\n\t\tconst step: number =\n\t\t\tcontent?.kind === 'inline'\n\t\t\t\t? 1\n\t\t\t\t: nextGraphemeSize(getBlockText(block), blockOffsetToTextOffset(block, head.offset)) || 1;\n\t\treturn extendTx(state, sel.anchor.blockId, sel.anchor.offset, head.blockId, head.offset + step);\n\t}\n\n\t// Cross-block\n\tconst nextId: BlockId | null = adjacentBlockId(state, head.blockId, 'forward');\n\tif (!nextId) return null;\n\tif (!canCrossBlockBoundary(state, head.blockId, nextId)) return null;\n\n\treturn extendTx(state, sel.anchor.blockId, sel.anchor.offset, nextId, 0);\n}\n\n/** Extends the selection one character backward. */\nexport function extendCharacterBackward(state: EditorState): Transaction | null {\n\tconst head = resolveHead(state);\n\tif (!head) return null;\n\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return null;\n\n\tif (head.offset > 0) {\n\t\tconst block = state.getBlock(head.blockId);\n\t\tif (!block) return null;\n\t\tconst content = getContentAtOffset(block, head.offset - 1);\n\t\tconst step: number =\n\t\t\tcontent?.kind === 'inline'\n\t\t\t\t? 1\n\t\t\t\t: prevGraphemeSize(getBlockText(block), blockOffsetToTextOffset(block, head.offset)) || 1;\n\t\treturn extendTx(state, sel.anchor.blockId, sel.anchor.offset, head.blockId, head.offset - step);\n\t}\n\n\t// Cross-block\n\tconst prevId: BlockId | null = adjacentBlockId(state, head.blockId, 'backward');\n\tif (!prevId) return null;\n\tif (!canCrossBlockBoundary(state, head.blockId, prevId)) return null;\n\n\tconst prevBlock = state.getBlock(prevId);\n\tif (!prevBlock) return null;\n\n\treturn extendTx(state, sel.anchor.blockId, sel.anchor.offset, prevId, getBlockLength(prevBlock));\n}\n\n/** Extends the selection to the start of the current block. */\nexport function extendToBlockStart(state: EditorState): Transaction | null {\n\tconst head = resolveHead(state);\n\tif (!head) return null;\n\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return null;\n\n\tif (head.offset === 0) return null;\n\treturn extendTx(state, sel.anchor.blockId, sel.anchor.offset, head.blockId, 0);\n}\n\n/** Extends the selection to the end of the current block. */\nexport function extendToBlockEnd(state: EditorState): Transaction | null {\n\tconst head = resolveHead(state);\n\tif (!head) return null;\n\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return null;\n\n\tconst block = state.getBlock(head.blockId);\n\tif (!block) return null;\n\n\tconst blockLen: number = getBlockLength(block);\n\tif (head.offset === blockLen) return null;\n\n\treturn extendTx(state, sel.anchor.blockId, sel.anchor.offset, head.blockId, blockLen);\n}\n\n/** Extends the selection to the start of the document. */\nexport function extendToDocumentStart(state: EditorState): Transaction | null {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return null;\n\n\tconst blockOrder: readonly BlockId[] = state.getBlockOrder();\n\tconst firstId: BlockId | undefined = blockOrder[0];\n\tif (!firstId) return null;\n\n\t// No-op if head is already at document start\n\tif (sel.head.blockId === firstId && sel.head.offset === 0) return null;\n\n\treturn extendTx(state, sel.anchor.blockId, sel.anchor.offset, firstId, 0);\n}\n\n/** Extends the selection to the end of the document. */\nexport function extendToDocumentEnd(state: EditorState): Transaction | null {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return null;\n\n\tconst blockOrder: readonly BlockId[] = state.getBlockOrder();\n\tconst lastId: BlockId | undefined = blockOrder[blockOrder.length - 1];\n\tif (!lastId) return null;\n\n\tconst lastBlock = state.getBlock(lastId);\n\tif (!lastBlock) return null;\n\n\tconst lastBlockLen: number = getBlockLength(lastBlock);\n\n\t// No-op if head is already at document end\n\tif (sel.head.blockId === lastId && sel.head.offset === lastBlockLen) return null;\n\n\treturn extendTx(state, sel.anchor.blockId, sel.anchor.offset, lastId, lastBlockLen);\n}\n","/**\n * Utilities for resolving a DOM position from screen coordinates.\n *\n * Provides a fallback chain: `caretPositionFromPoint` → `caretRangeFromPoint`\n * → document fallback (when root is a ShadowRoot).\n */\n\n/** Result of resolving a DOM position from screen coordinates. */\nexport interface DomPoint {\n\treadonly node: Node;\n\treadonly offset: number;\n}\n\n/**\n * Tries `caretPositionFromPoint` (standard) then `caretRangeFromPoint`\n * (WebKit fallback) on a single target to resolve a DOM position.\n */\nfunction tryCaretFromPoint(target: Document | ShadowRoot, x: number, y: number): DomPoint | null {\n\tif ('caretPositionFromPoint' in target) {\n\t\tconst cp = (target as Document).caretPositionFromPoint(x, y);\n\t\tif (cp) {\n\t\t\treturn { node: cp.offsetNode, offset: cp.offset };\n\t\t}\n\t}\n\n\tif ('caretRangeFromPoint' in target) {\n\t\tconst range = (target as Document).caretRangeFromPoint(x, y);\n\t\tif (range) {\n\t\t\treturn { node: range.startContainer, offset: range.startOffset };\n\t\t}\n\t}\n\n\treturn null;\n}\n\n/**\n * Resolves a DOM position from screen coordinates using the best available API.\n *\n * Tries the given root first, then falls back to the ownerDocument when the\n * root is a ShadowRoot and the first attempt returned nothing.\n */\nexport function domPositionFromPoint(\n\troot: Document | ShadowRoot,\n\tx: number,\n\ty: number,\n\townerDoc?: Document,\n): DomPoint | null {\n\treturn (\n\t\ttryCaretFromPoint(root, x, y) ??\n\t\t(ownerDoc && root !== ownerDoc ? tryCaretFromPoint(ownerDoc, x, y) : null)\n\t);\n}\n","/**\n * Caret navigation utilities for layout-aware cursor movement.\n *\n * Provides `endOfTextblock()` for detecting visual block boundaries,\n * `navigateAcrossBlocks()` for cross-block cursor transitions, and\n * `navigateVerticalWithGoalColumn()` for column-preserving vertical nav.\n */\n\nimport { type BlockNode, getBlockLength, getContentAtOffset } from '../model/Document.js';\nimport { isCollapsed, isTextSelection } from '../model/Selection.js';\nimport type { BlockId } from '../model/TypeBrands.js';\nimport { getTextDirection } from '../platform/Platform.js';\nimport type { EditorState } from '../state/EditorState.js';\nimport { type AdjacentBlock, resolveAdjacentBlock } from '../state/NavigationQueries.js';\nimport { moveTx, nodeSelTx } from '../state/SelectionTransactions.js';\nimport type { Transaction } from '../state/Transaction.js';\nimport { domPositionFromPoint } from './DomPointUtils.js';\nimport { findBlockAncestor } from './DomUtils.js';\nimport type { SelectionEndpoints } from './SelectionSync.js';\nimport { domPositionToState, getSelection, readDOMSelectionEndpoints } from './SelectionSync.js';\n\nexport { navigateFromGapCursor } from './GapCursorNavigation.js';\n\n/** Inset in pixels from block edge for vertical goal-column probing. */\nconst BLOCK_EDGE_INSET_PX = 2;\n\n/** Minimum vertical movement (pixels) for a Selection.modify probe to be considered a real move. */\nconst VERTICAL_MOVEMENT_THRESHOLD_PX = 1;\n\nexport type CaretDirection = 'left' | 'right' | 'up' | 'down';\n\n/**\n * Checks whether the cursor is at the visual edge of its text block.\n *\n * For horizontal directions (left/right), uses a pure offset check.\n * For vertical directions (up/down), tries `Selection.modify` probing\n * to detect visual line boundaries, falling back to offset heuristic.\n *\n * An optional `caretRect` parameter avoids redundant `getBoundingClientRect`\n * calls when the caller already measured the caret position.\n */\nexport function endOfTextblock(\n\tcontainer: HTMLElement,\n\tstate: EditorState,\n\tdirection: CaretDirection,\n\tcaretRect?: DOMRect | null,\n): boolean {\n\tconst sel = state.selection;\n\n\tif (!isTextSelection(sel)) return false;\n\tif (!isCollapsed(sel)) return false;\n\n\tconst block = state.getBlock(sel.anchor.blockId);\n\tif (!block) return false;\n\n\tconst offset: number = sel.anchor.offset;\n\tconst blockLength: number = getBlockLength(block);\n\n\t// Horizontal: direction-aware offset check\n\tconst blockEl: Element | null = container.querySelector(\n\t\t`[data-block-id=\"${sel.anchor.blockId}\"]`,\n\t);\n\tconst isRtl: boolean = blockEl instanceof HTMLElement && getTextDirection(blockEl) === 'rtl';\n\n\tif (direction === 'left') return isRtl ? offset === blockLength : offset === 0;\n\tif (direction === 'right') return isRtl ? offset === 0 : offset === blockLength;\n\n\t// Vertical: quick offset check first\n\tif (direction === 'up' && offset === 0) return true;\n\tif (direction === 'down' && offset === blockLength) return true;\n\n\t// Vertical: try Selection.modify probing for multi-line blocks\n\tconst domSel: globalThis.Selection | null = getSelection();\n\tif (!domSel || !domSel.modify) {\n\t\t// Fallback: offset heuristic (no Selection.modify in test environments)\n\t\treturn direction === 'up' ? offset === 0 : offset === blockLength;\n\t}\n\n\treturn probeVerticalBoundary(container, domSel, direction, caretRect);\n}\n\n/**\n * Creates a transaction to move the cursor to an adjacent block.\n *\n * Returns `null` if navigation is not possible (document boundary,\n * isolating boundary, or no adjacent block).\n */\nexport function navigateAcrossBlocks(\n\tstate: EditorState,\n\tdirection: CaretDirection,\n): Transaction | null {\n\tconst target: AdjacentBlock | null = resolveNavigationTarget(state, direction);\n\tif (!target) return null;\n\n\tif (target.isVoid) return nodeSelTx(state, target.targetId);\n\n\t// Target is text → collapsed selection at start or end\n\tconst targetBlock = state.getBlock(target.targetId);\n\tif (!targetBlock) return null;\n\n\tconst targetOffset: number =\n\t\tdirection === 'right' || direction === 'down' ? 0 : getBlockLength(targetBlock);\n\n\treturn moveTx(state, target.targetId, targetOffset);\n}\n\n/**\n * Navigates vertically using a goal column for visual column preservation.\n *\n * Uses `caretPositionFromPoint` / `caretRangeFromPoint` to find the offset\n * in the target block that is closest to the given goalColumn X coordinate.\n * Falls back to start/end offset when goal column positioning is unavailable.\n */\nexport function navigateVerticalWithGoalColumn(\n\tcontainer: HTMLElement,\n\tstate: EditorState,\n\tdirection: 'up' | 'down',\n\tgoalColumn: number | null,\n): Transaction | null {\n\tconst target: AdjacentBlock | null = resolveNavigationTarget(state, direction);\n\tif (!target) return null;\n\n\t// Void → NodeSelection (goalColumn irrelevant)\n\tif (target.isVoid) return nodeSelTx(state, target.targetId);\n\n\tconst targetBlock = state.getBlock(target.targetId);\n\tif (!targetBlock) return null;\n\tconst blockLen: number = getBlockLength(targetBlock);\n\n\t// Try to resolve position using goalColumn\n\tif (goalColumn !== null) {\n\t\tconst position = resolveGoalColumnPosition(container, target.targetId, direction, goalColumn);\n\t\tif (position) return moveTx(state, position.blockId, position.offset);\n\t}\n\n\t// Offset-clamp fallback: preserve the absolute character offset, clamped to\n\t// the target block length. This handles cases where DOM-based goal column\n\t// resolution fails (e.g. Shadow DOM <li> elements) by keeping the cursor\n\t// at the same character column when possible.\n\tif (isTextSelection(state.selection) && isCollapsed(state.selection)) {\n\t\tconst sourceOffset: number = state.selection.anchor.offset;\n\t\tconst clampedOffset: number = Math.min(sourceOffset, blockLen);\n\t\treturn moveTx(state, target.targetId, clampedOffset);\n\t}\n\n\t// Final fallback: start (down) or end (up)\n\tconst fallbackOffset: number = direction === 'down' ? 0 : blockLen;\n\treturn moveTx(state, target.targetId, fallbackOffset);\n}\n\n/**\n * Skips over an InlineNode atomically when arrowing left/right.\n *\n * Returns a transaction moving the cursor past the InlineNode,\n * or `null` if the adjacent content is not an InlineNode (or\n * the direction is vertical).\n */\nexport function skipInlineNode(state: EditorState, direction: CaretDirection): Transaction | null {\n\tif (direction === 'up' || direction === 'down') return null;\n\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return null;\n\tif (!isCollapsed(sel)) return null;\n\n\tconst blockId: BlockId = sel.anchor.blockId;\n\tconst block = state.getBlock(blockId);\n\tif (!block) return null;\n\n\tconst offset: number = sel.anchor.offset;\n\n\treturn direction === 'right'\n\t\t? skipInlineNodeRight(state, blockId, block, offset)\n\t\t: skipInlineNodeLeft(state, blockId, block, offset);\n}\n\nfunction skipInlineNodeRight(\n\tstate: EditorState,\n\tblockId: BlockId,\n\tblock: BlockNode,\n\toffset: number,\n): Transaction | null {\n\tconst content = getContentAtOffset(block, offset);\n\tif (!content || content.kind !== 'inline') return null;\n\treturn moveTx(state, blockId, offset + 1);\n}\n\nfunction skipInlineNodeLeft(\n\tstate: EditorState,\n\tblockId: BlockId,\n\tblock: BlockNode,\n\toffset: number,\n): Transaction | null {\n\tif (offset === 0) return null;\n\tconst content = getContentAtOffset(block, offset - 1);\n\tif (!content || content.kind !== 'inline') return null;\n\treturn moveTx(state, blockId, offset - 1);\n}\n\n/**\n * Returns the bounding rect of the current caret position, or null.\n *\n * When `container` is provided, validates that `getRangeAt(0)` is inside\n * the container before using its rects. In Shadow DOM, `getRangeAt(0)` may\n * return a cross-boundary range whose rects reflect the shadow host position\n * rather than the actual caret position (e.g. inside `<li>` elements).\n * Falls back to composed selection endpoints via `readDOMSelectionEndpoints()`.\n */\nexport function getCaretRectFromSelection(\n\tdomSel: globalThis.Selection,\n\tcontainer?: HTMLElement,\n): DOMRect | null {\n\t// Standard path: use getRangeAt(0) directly, but only if the range\n\t// is inside the container (avoids cross-boundary rects in Shadow DOM)\n\tif (domSel.rangeCount > 0) {\n\t\tconst range: Range = domSel.getRangeAt(0);\n\t\tconst rangeInContainer: boolean = !container || container.contains(range.startContainer);\n\n\t\tif (rangeInContainer) {\n\t\t\tconst rects: DOMRectList = range.getClientRects();\n\t\t\tif (rects.length > 0) return rects[0] ?? null;\n\t\t\tconst rect: DOMRect = range.getBoundingClientRect();\n\t\t\tif (rect.height > 0) return rect;\n\t\t}\n\t}\n\n\t// Composed endpoint path: handles Shadow DOM cases where getRangeAt(0)\n\t// crosses the shadow boundary (e.g. <li> elements in wrapper <ul>/<ol>)\n\tif (container) {\n\t\tconst endpoints: SelectionEndpoints | null = readDOMSelectionEndpoints(container, domSel);\n\t\tif (endpoints) {\n\t\t\ttry {\n\t\t\t\tconst range: Range = document.createRange();\n\t\t\t\trange.setStart(endpoints.anchorNode, endpoints.anchorOffset);\n\t\t\t\trange.setEnd(endpoints.focusNode, endpoints.focusOffset);\n\t\t\t\tconst rects: DOMRectList = range.getClientRects();\n\t\t\t\tif (rects.length > 0) return rects[0] ?? null;\n\t\t\t\treturn range.getBoundingClientRect();\n\t\t\t} catch {\n\t\t\t\t// Unable to create range from endpoints\n\t\t\t}\n\t\t}\n\t}\n\n\treturn null;\n}\n\n// ---------------------------------------------------------------------------\n// Internal helpers\n// ---------------------------------------------------------------------------\n\n/**\n * Resolves the adjacent block in the given direction for cross-block navigation.\n * Performs boundary checks, isolating checks, and void detection.\n */\nfunction resolveNavigationTarget(\n\tstate: EditorState,\n\tdirection: CaretDirection,\n): AdjacentBlock | null {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return null;\n\tconst forward: boolean = direction === 'right' || direction === 'down';\n\treturn resolveAdjacentBlock(state, sel.anchor.blockId, forward);\n}\n\n/**\n * Computes the Y coordinate for vertical goal-column probing.\n *\n * Uses the block element's computed padding to ensure the probe point\n * lands inside the text content area, not in the padding zone.\n * Firefox's `caretPositionFromPoint` returns the end-of-text position\n * when probing in the padding area below the content, which breaks\n * ArrowUp column preservation.\n */\nfunction computeProbeY(blockEl: Element, rect: DOMRect, direction: 'up' | 'down'): number {\n\tif (!(blockEl instanceof HTMLElement)) {\n\t\treturn direction === 'down'\n\t\t\t? rect.top + BLOCK_EDGE_INSET_PX\n\t\t\t: rect.bottom - BLOCK_EDGE_INSET_PX;\n\t}\n\n\tconst style: CSSStyleDeclaration = getComputedStyle(blockEl);\n\tconst paddingTop: number = Number.parseFloat(style.paddingTop) || 0;\n\tconst paddingBottom: number = Number.parseFloat(style.paddingBottom) || 0;\n\n\treturn direction === 'down'\n\t\t? rect.top + paddingTop + BLOCK_EDGE_INSET_PX\n\t\t: rect.bottom - paddingBottom - BLOCK_EDGE_INSET_PX;\n}\n\n/**\n * Resolves an editor position in the target block by using the goalColumn\n * X coordinate and `caretPositionFromPoint` / `caretRangeFromPoint`.\n *\n * Returns `null` when the point-to-caret API is unavailable, when the\n * resolved DOM node falls outside the target block, or when the resulting\n * position doesn't belong to the target block — triggering the fallback\n * (block-end for up, block-start for down) in `navigateVerticalWithGoalColumn`.\n */\nfunction resolveGoalColumnPosition(\n\tcontainer: HTMLElement,\n\ttargetId: BlockId,\n\tdirection: 'up' | 'down',\n\tgoalColumn: number,\n): { blockId: BlockId; offset: number } | null {\n\tconst blockEl: Element | null = container.querySelector(`[data-block-id=\"${targetId}\"]`);\n\tif (!blockEl) return null;\n\n\tconst rect: DOMRect = blockEl.getBoundingClientRect();\n\tconst y: number = computeProbeY(blockEl, rect, direction);\n\t// Clamp goalColumn within the block's horizontal bounds to avoid\n\t// caretPositionFromPoint returning unexpected results for out-of-bounds X.\n\tconst clampedX: number = Math.min(Math.max(goalColumn, rect.left), rect.right - 1);\n\n\tconst root: Document | ShadowRoot = container.getRootNode() as Document | ShadowRoot;\n\tconst domPoint = domPositionFromPoint(root, clampedX, y, container.ownerDocument);\n\tif (!domPoint) return null;\n\n\t// Verify the DOM node is inside the target block\n\tif (!blockEl.contains(domPoint.node)) return null;\n\n\tconst position = domPositionToState(container, domPoint.node, domPoint.offset);\n\tif (!position) return null;\n\n\t// Ensure the resolved position is in the target block\n\tif (position.blockId !== targetId) return null;\n\n\treturn position;\n}\n\n/**\n * Probes whether the cursor is at the top/bottom visual line of a block.\n *\n * Strategy:\n * 1. `Selection.modify('move', direction, 'line')` — moves one visual line.\n * 2. If the cursor left the block or didn't move, it's at the boundary.\n * 3. Cross-check with `getBoundingClientRect`: compare the caret rect before\n * and after the probe. If the vertical position didn't change, the probe\n * hit the block edge even though `Selection.modify` reported movement\n * (can happen with certain inline element layouts).\n *\n * Original DOM selection is always restored before returning.\n */\nfunction probeVerticalBoundary(\n\tcontainer: HTMLElement,\n\tdomSel: globalThis.Selection,\n\tdirection: 'up' | 'down',\n\tpreReadRect?: DOMRect | null,\n): boolean {\n\t// Save original DOM selection (using composed ranges for Shadow DOM)\n\tconst origEndpoints: SelectionEndpoints | null = readDOMSelectionEndpoints(container, domSel);\n\n\t// Cannot determine position → safe default: not at boundary (let browser handle)\n\tif (!origEndpoints) return false;\n\n\tconst origRect: DOMRect | null = preReadRect ?? getCaretRectFromSelection(domSel, container);\n\tconst dirStr: string = direction === 'up' ? 'backward' : 'forward';\n\n\ttry {\n\t\tdomSel.modify('move', dirStr, 'line');\n\n\t\t// Read post-modify endpoints via composed ranges\n\t\tconst postEndpoints: SelectionEndpoints | null = readDOMSelectionEndpoints(container, domSel);\n\t\tif (!postEndpoints) return false;\n\n\t\t// Check if the new position is still within the same block\n\t\tconst origBlock: HTMLElement | null = findBlockAncestor(container, origEndpoints.focusNode);\n\t\tconst newBlock: HTMLElement | null = findBlockAncestor(container, postEndpoints.focusNode);\n\n\t\t// Moved to a different block → definitely at boundary\n\t\tif (origBlock !== newBlock) return true;\n\n\t\t// Selection didn't move at all → at boundary\n\t\tconst didNotMove: boolean =\n\t\t\tpostEndpoints.anchorNode === origEndpoints.anchorNode &&\n\t\t\tpostEndpoints.anchorOffset === origEndpoints.anchorOffset &&\n\t\t\tpostEndpoints.focusNode === origEndpoints.focusNode &&\n\t\t\tpostEndpoints.focusOffset === origEndpoints.focusOffset;\n\t\tif (didNotMove) return true;\n\n\t\t// Cross-check with getBoundingClientRect: if vertical position unchanged,\n\t\t// the probe was a no-op visually (edge case with inline elements)\n\t\tif (origRect) {\n\t\t\tconst newRect: DOMRect | null = getCaretRectFromSelection(domSel, container);\n\t\t\tif (newRect) {\n\t\t\t\tconst verticalDelta: number = Math.abs(newRect.top - origRect.top);\n\t\t\t\tif (verticalDelta < VERTICAL_MOVEMENT_THRESHOLD_PX) return true;\n\t\t\t}\n\t\t}\n\n\t\t// Stayed in same block and moved vertically → not at boundary\n\t\treturn false;\n\t} finally {\n\t\t// Restore original selection\n\t\ttry {\n\t\t\tdomSel.setBaseAndExtent(\n\t\t\t\torigEndpoints.anchorNode,\n\t\t\t\torigEndpoints.anchorOffset,\n\t\t\t\torigEndpoints.focusNode,\n\t\t\t\torigEndpoints.focusOffset,\n\t\t\t);\n\t\t} catch {\n\t\t\t// Selection restore may fail if DOM changed\n\t\t}\n\t}\n}\n","/**\n * View-based movement commands that use the browser's `Selection.modify()` API\n * for word, line-boundary, and line granularity movement.\n *\n * Falls back to model-based commands when `Selection.modify` is unavailable\n * (e.g. in happy-dom test environments).\n */\n\nimport { getBlockLength, getContentAtOffset } from '../model/Document.js';\nimport { isCollapsed, isTextSelection } from '../model/Selection.js';\nimport type { BlockId } from '../model/TypeBrands.js';\nimport { findWordBoundaryBackward, findWordBoundaryForward } from '../model/WordBoundary.js';\nimport { moveToBlockEnd, moveToBlockStart } from '../state/BlockBoundaryMovement.js';\nimport type { EditorState } from '../state/EditorState.js';\nimport {\n\tcanCrossBlockBoundary,\n\tisVoidBlock,\n\tresolveAdjacentBlock,\n} from '../state/NavigationQueries.js';\nimport { extendTx, moveTx, nodeSelTx } from '../state/SelectionTransactions.js';\nimport type { Transaction } from '../state/Transaction.js';\nimport { navigateAcrossBlocks } from './CaretNavigation.js';\nimport type { SelectionEndpoints } from './SelectionSync.js';\nimport { getSelection, readDOMSelectionEndpoints, readSelectionFromDOM } from './SelectionSync.js';\n\ntype Direction = 'forward' | 'backward';\ntype Granularity = 'word' | 'lineboundary' | 'line';\n\n// ---------------------------------------------------------------------------\n// Core view movement\n// ---------------------------------------------------------------------------\n\n/**\n * Moves the cursor using `Selection.modify('move', direction, granularity)`.\n * Falls back to model-based movement when the API is unavailable.\n */\nexport function viewMove(\n\tcontainer: HTMLElement,\n\tstate: EditorState,\n\tdirection: Direction,\n\tgranularity: Granularity,\n): Transaction | null {\n\treturn viewModifySelection(container, state, 'move', direction, granularity);\n}\n\n/**\n * Extends the selection using `Selection.modify('extend', direction, granularity)`.\n * Falls back to model-based extension when the API is unavailable.\n */\nexport function viewExtend(\n\tcontainer: HTMLElement,\n\tstate: EditorState,\n\tdirection: Direction,\n\tgranularity: Granularity,\n): Transaction | null {\n\treturn viewModifySelection(container, state, 'extend', direction, granularity);\n}\n\n/**\n * Shared implementation for viewMove and viewExtend.\n * Uses Selection.modify() with save/restore of DOM selection,\n * with fallback to model-based movement.\n */\nfunction viewModifySelection(\n\tcontainer: HTMLElement,\n\tstate: EditorState,\n\tmode: 'move' | 'extend',\n\tdirection: Direction,\n\tgranularity: Granularity,\n): Transaction | null {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return null;\n\n\tconst fallback = mode === 'move' ? fallbackMove : fallbackExtend;\n\n\tconst domSel: globalThis.Selection | null = getSelection();\n\tif (!domSel?.modify) {\n\t\treturn fallback(state, direction, granularity);\n\t}\n\n\tconst origEndpoints: SelectionEndpoints | null = readDOMSelectionEndpoints(container, domSel);\n\tif (!origEndpoints) return fallback(state, direction, granularity);\n\n\ttry {\n\t\tdomSel.modify(mode, direction, granularity);\n\n\t\tconst newSel = readSelectionFromDOM(container);\n\t\tif (!newSel) return null;\n\n\t\t// For move: check anchor; for extend: check head\n\t\tconst oldBlockId: BlockId = mode === 'move' ? sel.anchor.blockId : sel.head.blockId;\n\t\tconst newPosition = mode === 'move' ? newSel.anchor : newSel.head;\n\t\tconst newBlockId: BlockId = newPosition.blockId;\n\n\t\tif (newBlockId !== oldBlockId && !canCrossBlockBoundary(state, oldBlockId, newBlockId)) {\n\t\t\treturn null;\n\t\t}\n\n\t\tlet newOffset: number = newPosition.offset;\n\n\t\t// InlineNode boundary correction\n\t\tconst block = state.getBlock(newBlockId);\n\t\tif (block) {\n\t\t\tconst content = getContentAtOffset(block, newOffset);\n\t\t\tif (content?.kind === 'inline' && direction === 'forward') {\n\t\t\t\tnewOffset = Math.min(newOffset + 1, getBlockLength(block));\n\t\t\t}\n\t\t}\n\n\t\tif (mode === 'move') {\n\t\t\tif (isVoidBlock(state, newBlockId)) return nodeSelTx(state, newBlockId);\n\t\t\treturn moveTx(state, newBlockId, newOffset);\n\t\t}\n\n\t\treturn extendTx(state, sel.anchor.blockId, sel.anchor.offset, newBlockId, newOffset);\n\t} finally {\n\t\ttry {\n\t\t\tdomSel.setBaseAndExtent(\n\t\t\t\torigEndpoints.anchorNode,\n\t\t\t\torigEndpoints.anchorOffset,\n\t\t\t\torigEndpoints.focusNode,\n\t\t\t\torigEndpoints.focusOffset,\n\t\t\t);\n\t\t} catch {\n\t\t\t// Restore may fail if DOM changed\n\t\t}\n\t}\n}\n\n// ---------------------------------------------------------------------------\n// Fallback (model-based) when Selection.modify is unavailable\n// ---------------------------------------------------------------------------\n\nfunction fallbackMove(\n\tstate: EditorState,\n\tdirection: Direction,\n\tgranularity: Granularity,\n): Transaction | null {\n\tif (granularity === 'word') {\n\t\treturn fallbackWordMove(state, direction);\n\t}\n\tif (granularity === 'lineboundary') {\n\t\treturn direction === 'forward' ? moveToBlockEnd(state) : moveToBlockStart(state);\n\t}\n\t// granularity === 'line' → cross-block\n\tconst caretDir = direction === 'forward' ? 'down' : 'up';\n\treturn navigateAcrossBlocks(state, caretDir);\n}\n\nfunction fallbackExtend(\n\tstate: EditorState,\n\tdirection: Direction,\n\tgranularity: Granularity,\n): Transaction | null {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return null;\n\n\tconst head = sel.head;\n\tconst block = state.getBlock(head.blockId);\n\tif (!block) return null;\n\n\tlet newOffset: number = head.offset;\n\n\tif (granularity === 'word') {\n\t\tnewOffset =\n\t\t\tdirection === 'forward'\n\t\t\t\t? findWordBoundaryForward(block, head.offset)\n\t\t\t\t: findWordBoundaryBackward(block, head.offset);\n\t} else if (granularity === 'lineboundary') {\n\t\tnewOffset = direction === 'forward' ? getBlockLength(block) : 0;\n\t} else {\n\t\t// line: extend to next block boundary\n\t\tconst adj = resolveAdjacentBlock(state, head.blockId, direction === 'forward');\n\t\tif (!adj) return null;\n\t\t// Cannot extend a text selection into a void block\n\t\tif (adj.isVoid) return null;\n\n\t\tconst targetBlock = state.getBlock(adj.targetId);\n\t\tif (!targetBlock) return null;\n\n\t\tconst targetOffset: number = direction === 'forward' ? 0 : getBlockLength(targetBlock);\n\t\treturn extendTx(state, sel.anchor.blockId, sel.anchor.offset, adj.targetId, targetOffset);\n\t}\n\n\treturn extendTx(state, sel.anchor.blockId, sel.anchor.offset, head.blockId, newOffset);\n}\n\nfunction fallbackWordMove(state: EditorState, direction: Direction): Transaction | null {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return null;\n\n\tconst blockId: BlockId = isCollapsed(sel) ? sel.anchor.blockId : sel.head.blockId;\n\tconst offset: number = isCollapsed(sel) ? sel.anchor.offset : sel.head.offset;\n\tconst block = state.getBlock(blockId);\n\tif (!block) return null;\n\n\tconst newOffset: number =\n\t\tdirection === 'forward'\n\t\t\t? findWordBoundaryForward(block, offset)\n\t\t\t: findWordBoundaryBackward(block, offset);\n\n\tif (newOffset === offset) {\n\t\t// At block boundary — try crossing blocks\n\t\treturn fallbackCrossBlock(state, blockId, direction);\n\t}\n\n\treturn moveTx(state, blockId, newOffset);\n}\n\n/**\n * Crosses a block boundary from `blockId` in the given direction.\n * Checks `canCrossBlockBoundary` and handles void blocks (→ NodeSelection).\n */\nfunction fallbackCrossBlock(\n\tstate: EditorState,\n\tblockId: BlockId,\n\tdirection: Direction,\n): Transaction | null {\n\tconst adj = resolveAdjacentBlock(state, blockId, direction === 'forward');\n\tif (!adj) return null;\n\n\tif (adj.isVoid) return nodeSelTx(state, adj.targetId);\n\n\tconst targetBlock = state.getBlock(adj.targetId);\n\tif (!targetBlock) return null;\n\n\tconst targetOffset: number = direction === 'forward' ? 0 : getBlockLength(targetBlock);\n\treturn moveTx(state, adj.targetId, targetOffset);\n}\n\n// ---------------------------------------------------------------------------\n// Convenience wrappers\n// ---------------------------------------------------------------------------\n\n/** Moves the cursor one word forward. */\nexport function moveWordForward(container: HTMLElement, state: EditorState): Transaction | null {\n\treturn viewMove(container, state, 'forward', 'word');\n}\n\n/** Moves the cursor one word backward. */\nexport function moveWordBackward(container: HTMLElement, state: EditorState): Transaction | null {\n\treturn viewMove(container, state, 'backward', 'word');\n}\n\n/** Moves the cursor to the start of the line (visual). */\nexport function moveToLineStart(container: HTMLElement, state: EditorState): Transaction | null {\n\treturn viewMove(container, state, 'backward', 'lineboundary');\n}\n\n/** Moves the cursor to the end of the line (visual). */\nexport function moveToLineEnd(container: HTMLElement, state: EditorState): Transaction | null {\n\treturn viewMove(container, state, 'forward', 'lineboundary');\n}\n\n/** Moves the cursor one visual line up. */\nexport function moveLineUp(container: HTMLElement, state: EditorState): Transaction | null {\n\treturn viewMove(container, state, 'backward', 'line');\n}\n\n/** Moves the cursor one visual line down. */\nexport function moveLineDown(container: HTMLElement, state: EditorState): Transaction | null {\n\treturn viewMove(container, state, 'forward', 'line');\n}\n\n/** Extends the selection one word forward. */\nexport function extendWordForward(container: HTMLElement, state: EditorState): Transaction | null {\n\treturn viewExtend(container, state, 'forward', 'word');\n}\n\n/** Extends the selection one word backward. */\nexport function extendWordBackward(container: HTMLElement, state: EditorState): Transaction | null {\n\treturn viewExtend(container, state, 'backward', 'word');\n}\n\n/** Extends the selection to the start of the line. */\nexport function extendToLineStart(container: HTMLElement, state: EditorState): Transaction | null {\n\treturn viewExtend(container, state, 'backward', 'lineboundary');\n}\n\n/** Extends the selection to the end of the line. */\nexport function extendToLineEnd(container: HTMLElement, state: EditorState): Transaction | null {\n\treturn viewExtend(container, state, 'forward', 'lineboundary');\n}\n\n/** Extends the selection one visual line up. */\nexport function extendLineUp(container: HTMLElement, state: EditorState): Transaction | null {\n\treturn viewExtend(container, state, 'backward', 'line');\n}\n\n/** Extends the selection one visual line down. */\nexport function extendLineDown(container: HTMLElement, state: EditorState): Transaction | null {\n\treturn viewExtend(container, state, 'forward', 'line');\n}\n","/** Locale interface and default English locale for the CaretNavigationPlugin. */\n\nimport { type LocaleModuleMap, loadLocaleModule } from '../shared/LocaleLoader.js';\n\n// --- Locale Interface ---\n\nexport interface CaretNavigationLocale {\n\treadonly paragraph: string;\n\treadonly heading1: string;\n\treadonly heading2: string;\n\treadonly heading3: string;\n\treadonly heading4: string;\n\treadonly heading5: string;\n\treadonly heading6: string;\n\treadonly codeBlock: string;\n\treadonly blockquote: string;\n\treadonly listItem: string;\n\treadonly horizontalRule: string;\n\treadonly image: string;\n\treadonly table: string;\n}\n\n// --- Default English Locale ---\n\nexport const CARET_NAVIGATION_LOCALE_EN: CaretNavigationLocale = {\n\tparagraph: 'Paragraph',\n\theading1: 'Heading 1',\n\theading2: 'Heading 2',\n\theading3: 'Heading 3',\n\theading4: 'Heading 4',\n\theading5: 'Heading 5',\n\theading6: 'Heading 6',\n\tcodeBlock: 'Code Block',\n\tblockquote: 'Block Quote',\n\tlistItem: 'List Item',\n\thorizontalRule: 'Horizontal Rule',\n\timage: 'Image',\n\ttable: 'Table',\n};\n\n// --- Block Type → Locale Key Mapping ---\n\nconst BLOCK_TYPE_KEY_MAP: Readonly<Record<string, keyof CaretNavigationLocale>> = {\n\tparagraph: 'paragraph',\n\tcode_block: 'codeBlock',\n\tblockquote: 'blockquote',\n\tlist_item: 'listItem',\n\thorizontal_rule: 'horizontalRule',\n\timage: 'image',\n\ttable: 'table',\n};\n\n/** Resolves a block type + attrs to a localized label string. */\nexport function resolveBlockLabel(\n\tlocale: CaretNavigationLocale,\n\ttypeName: string,\n\tattrs?: Record<string, unknown>,\n): string {\n\tif (typeName === 'heading' && attrs?.level) {\n\t\tconst key = `heading${attrs.level}` as keyof CaretNavigationLocale;\n\t\tif (key in locale) return locale[key];\n\t}\n\tconst key: keyof CaretNavigationLocale | undefined = BLOCK_TYPE_KEY_MAP[typeName];\n\treturn key ? locale[key] : typeName;\n}\n\n// --- Lazy Locale Loader ---\n\nconst localeModules: LocaleModuleMap<CaretNavigationLocale> = import.meta.glob<{\n\tdefault: CaretNavigationLocale;\n}>('./locales/*.ts', { eager: false });\n\nexport async function loadCaretNavigationLocale(lang: string): Promise<CaretNavigationLocale> {\n\treturn loadLocaleModule(localeModules, lang, CARET_NAVIGATION_LOCALE_EN);\n}\n","/**\n * CaretNavigationPlugin: registers platform-aware keymaps for all\n * programmatic movement commands (character, word, line, document).\n *\n * Movement priorities use 'navigation' to match GapCursorPlugin.\n * Also announces block-type changes to screen readers on cross-block navigation.\n */\n\nimport {\n\textendCharacterBackward,\n\textendCharacterForward,\n\textendToDocumentEnd,\n\textendToDocumentStart,\n\tmoveToDocumentEnd,\n\tmoveToDocumentStart,\n} from '../../commands/MovementCommands.js';\nimport { isCollapsed, isTextSelection } from '../../model/Selection.js';\nimport type { BlockId } from '../../model/TypeBrands.js';\nimport { getTextDirection, isMac } from '../../platform/Platform.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { Transaction } from '../../state/Transaction.js';\nimport {\n\textendLineDown,\n\textendLineUp,\n\textendToLineEnd,\n\textendToLineStart,\n\textendWordBackward,\n\textendWordForward,\n\tmoveLineDown,\n\tmoveLineUp,\n\tmoveToLineEnd,\n\tmoveToLineStart,\n\tmoveWordBackward,\n\tmoveWordForward,\n} from '../../view/ViewMovementCommands.js';\nimport type { Plugin, PluginContext } from '../Plugin.js';\nimport { resolveLocale } from '../shared/PluginHelpers.js';\nimport {\n\tCARET_NAVIGATION_LOCALE_EN,\n\ttype CaretNavigationLocale,\n\tloadCaretNavigationLocale,\n\tresolveBlockLabel,\n} from './CaretNavigationLocale.js';\n\ntype ViewCommandFn = (container: HTMLElement, state: EditorState) => Transaction | null;\ntype ViewCommandKey = `${'word' | 'lineboundary' | 'line'}:${'forward' | 'backward'}`;\ntype ViewCommandLookup = Readonly<Record<ViewCommandKey, ViewCommandFn>>;\n\nconst VIEW_MOVE_FNS: ViewCommandLookup = {\n\t'word:forward': moveWordForward,\n\t'word:backward': moveWordBackward,\n\t'lineboundary:forward': moveToLineEnd,\n\t'lineboundary:backward': moveToLineStart,\n\t'line:forward': moveLineDown,\n\t'line:backward': moveLineUp,\n};\n\nconst VIEW_EXTEND_FNS: ViewCommandLookup = {\n\t'word:forward': extendWordForward,\n\t'word:backward': extendWordBackward,\n\t'lineboundary:forward': extendToLineEnd,\n\t'lineboundary:backward': extendToLineStart,\n\t'line:forward': extendLineDown,\n\t'line:backward': extendLineUp,\n};\n\n/** Debounce delay for block-type announcements (ms). */\nconst ANNOUNCE_DEBOUNCE_MS = 150;\n\nexport class CaretNavigationPlugin implements Plugin {\n\treadonly id = 'caret-navigation';\n\treadonly name = 'Caret Navigation';\n\treadonly priority = 4;\n\n\tprivate context: PluginContext | null = null;\n\tprivate lastAnnouncedBlockId: BlockId | null = null;\n\tprivate announceTimer: ReturnType<typeof setTimeout> | null = null;\n\tprivate announce: ((text: string) => void) | null = null;\n\tprivate locale: CaretNavigationLocale = CARET_NAVIGATION_LOCALE_EN;\n\n\tasync init(context: PluginContext): Promise<void> {\n\t\tthis.locale = await resolveLocale(\n\t\t\tcontext,\n\t\t\tundefined,\n\t\t\tCARET_NAVIGATION_LOCALE_EN,\n\t\t\tloadCaretNavigationLocale,\n\t\t);\n\n\t\tthis.context = context;\n\t\tthis.announce = (text: string) => context.announce(text);\n\t\tconst mac: boolean = isMac();\n\n\t\tconst keymap: Record<string, () => boolean> = {\n\t\t\t// --- Character movement (no modifier) ---\n\t\t\t// Handled natively by browser for basic cases, but Shift+Arrow\n\t\t\t// needs programmatic extend to correctly clear storedMarks.\n\n\t\t\t// --- Character extend ---\n\t\t\t'Shift-ArrowRight': () => this.extendCharacterVisual('right'),\n\t\t\t'Shift-ArrowLeft': () => this.extendCharacterVisual('left'),\n\n\t\t\t// --- Line extend ---\n\t\t\t'Shift-ArrowUp': () => this.viewExtendCommand('backward', 'line'),\n\t\t\t'Shift-ArrowDown': () => this.viewExtendCommand('forward', 'line'),\n\n\t\t\t// --- Word movement (platform-aware) ---\n\t\t\t...(mac\n\t\t\t\t? {\n\t\t\t\t\t\t'Alt-ArrowRight': () => this.viewMoveVisual('right', 'word'),\n\t\t\t\t\t\t'Alt-ArrowLeft': () => this.viewMoveVisual('left', 'word'),\n\t\t\t\t\t\t'Shift-Alt-ArrowRight': () => this.viewExtendVisual('right', 'word'),\n\t\t\t\t\t\t'Shift-Alt-ArrowLeft': () => this.viewExtendVisual('left', 'word'),\n\t\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\t\t'Mod-ArrowRight': () => this.viewMoveVisual('right', 'word'),\n\t\t\t\t\t\t'Mod-ArrowLeft': () => this.viewMoveVisual('left', 'word'),\n\t\t\t\t\t\t'Mod-Shift-ArrowRight': () => this.viewExtendVisual('right', 'word'),\n\t\t\t\t\t\t'Mod-Shift-ArrowLeft': () => this.viewExtendVisual('left', 'word'),\n\t\t\t\t\t}),\n\n\t\t\t// --- Line boundary movement (platform-aware) ---\n\t\t\t...(mac\n\t\t\t\t? {\n\t\t\t\t\t\t'Mod-ArrowLeft': () => this.viewMoveVisual('left', 'lineboundary'),\n\t\t\t\t\t\t'Mod-ArrowRight': () => this.viewMoveVisual('right', 'lineboundary'),\n\t\t\t\t\t\t'Mod-Shift-ArrowLeft': () => this.viewExtendVisual('left', 'lineboundary'),\n\t\t\t\t\t\t'Mod-Shift-ArrowRight': () => this.viewExtendVisual('right', 'lineboundary'),\n\t\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\t\tHome: () => this.viewMoveCommand('backward', 'lineboundary'),\n\t\t\t\t\t\tEnd: () => this.viewMoveCommand('forward', 'lineboundary'),\n\t\t\t\t\t\t'Shift-Home': () => this.viewExtendCommand('backward', 'lineboundary'),\n\t\t\t\t\t\t'Shift-End': () => this.viewExtendCommand('forward', 'lineboundary'),\n\t\t\t\t\t}),\n\n\t\t\t// --- Document boundary movement (platform-aware) ---\n\t\t\t...(mac\n\t\t\t\t? {\n\t\t\t\t\t\t'Mod-ArrowUp': () => this.modelCommand(moveToDocumentStart),\n\t\t\t\t\t\t'Mod-ArrowDown': () => this.modelCommand(moveToDocumentEnd),\n\t\t\t\t\t\t'Mod-Shift-ArrowUp': () => this.modelCommand(extendToDocumentStart),\n\t\t\t\t\t\t'Mod-Shift-ArrowDown': () => this.modelCommand(extendToDocumentEnd),\n\t\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\t\t'Mod-Home': () => this.modelCommand(moveToDocumentStart),\n\t\t\t\t\t\t'Mod-End': () => this.modelCommand(moveToDocumentEnd),\n\t\t\t\t\t\t'Mod-Shift-Home': () => this.modelCommand(extendToDocumentStart),\n\t\t\t\t\t\t'Mod-Shift-End': () => this.modelCommand(extendToDocumentEnd),\n\t\t\t\t\t}),\n\t\t};\n\n\t\tcontext.registerKeymap(keymap, { priority: 'navigation' });\n\t}\n\n\t/** Announces block-type on cross-block cursor movement (debounced). */\n\tonStateChange(_oldState: EditorState, newState: EditorState, _tr: Transaction): void {\n\t\tconst newSel = newState.selection;\n\n\t\t// Only announce for collapsed text selections\n\t\tif (!isCollapsed(newSel) || !isTextSelection(newSel)) {\n\t\t\tif (this.announceTimer !== null) {\n\t\t\t\tclearTimeout(this.announceTimer);\n\t\t\t\tthis.announceTimer = null;\n\t\t\t}\n\t\t\tthis.lastAnnouncedBlockId = null;\n\t\t\treturn;\n\t\t}\n\n\t\tconst newBlockId: BlockId = newSel.anchor.blockId;\n\t\tif (newBlockId === this.lastAnnouncedBlockId) return;\n\n\t\t// First observed block (initial focus) — remember but don't announce\n\t\tif (this.lastAnnouncedBlockId === null) {\n\t\t\tthis.lastAnnouncedBlockId = newBlockId;\n\t\t\treturn;\n\t\t}\n\n\t\tthis.lastAnnouncedBlockId = newBlockId;\n\n\t\t// Debounce rapid navigation\n\t\tif (this.announceTimer !== null) clearTimeout(this.announceTimer);\n\t\tthis.announceTimer = setTimeout(() => {\n\t\t\tthis.announceTimer = null;\n\t\t\t// Skip if another plugin already announced (e.g. CodeBlockPlugin's \"Left code block\")\n\t\t\tif (this.context?.hasAnnouncement()) return;\n\t\t\tconst block = newState.getBlock(newBlockId);\n\t\t\tif (!block) return;\n\t\t\tconst label: string = resolveBlockLabel(\n\t\t\t\tthis.locale,\n\t\t\t\tblock.type,\n\t\t\t\tblock.attrs as Record<string, unknown> | undefined,\n\t\t\t);\n\t\t\tthis.announce?.(label);\n\t\t}, ANNOUNCE_DEBOUNCE_MS);\n\t}\n\n\tdestroy(): void {\n\t\tif (this.announceTimer !== null) clearTimeout(this.announceTimer);\n\t\tthis.announceTimer = null;\n\t\tthis.announce = null;\n\t\tthis.context = null;\n\t}\n\n\t/** Dispatches a model-based movement command (no DOM needed). */\n\tprivate modelCommand(fn: (state: EditorState) => Transaction | null): boolean {\n\t\tif (!this.context) return false;\n\t\tconst tr: Transaction | null = fn(this.context.getState());\n\t\tif (tr) {\n\t\t\tthis.context.dispatch(tr);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\t/** Extends selection by one character based on visual left/right intent. */\n\tprivate extendCharacterVisual(visual: 'left' | 'right'): boolean {\n\t\tif (!this.context) return false;\n\t\tconst state: EditorState = this.context.getState();\n\t\tconst dir: 'forward' | 'backward' = this.resolveLogicalHorizontalDirection(state, visual);\n\t\tconst tr: Transaction | null =\n\t\t\tdir === 'forward' ? extendCharacterForward(state) : extendCharacterBackward(state);\n\t\tif (tr) {\n\t\t\tthis.context.dispatch(tr);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\t/** Dispatches a view-based movement command (uses container + Selection.modify). */\n\tprivate viewMoveCommand(\n\t\tdirection: 'forward' | 'backward',\n\t\tgranularity: 'word' | 'lineboundary' | 'line',\n\t): boolean {\n\t\treturn this.dispatchViewCommand(VIEW_MOVE_FNS, direction, granularity);\n\t}\n\n\t/** Dispatches a view-based move command with visual direction mapping for RTL. */\n\tprivate viewMoveVisual(visual: 'left' | 'right', granularity: 'word' | 'lineboundary'): boolean {\n\t\tif (!this.context) return false;\n\t\tconst dir: 'forward' | 'backward' = this.resolveLogicalHorizontalDirection(\n\t\t\tthis.context.getState(),\n\t\t\tvisual,\n\t\t);\n\t\treturn this.viewMoveCommand(dir, granularity);\n\t}\n\n\t/** Dispatches a view-based extend command. */\n\tprivate viewExtendCommand(\n\t\tdirection: 'forward' | 'backward',\n\t\tgranularity: 'word' | 'lineboundary' | 'line',\n\t): boolean {\n\t\treturn this.dispatchViewCommand(VIEW_EXTEND_FNS, direction, granularity);\n\t}\n\n\tprivate dispatchViewCommand(\n\t\tlookup: ViewCommandLookup,\n\t\tdirection: 'forward' | 'backward',\n\t\tgranularity: 'word' | 'lineboundary' | 'line',\n\t): boolean {\n\t\tif (!this.context) return false;\n\t\tconst fn: ViewCommandFn | undefined = lookup[`${granularity}:${direction}`];\n\t\tif (!fn) return false;\n\t\tconst tr: Transaction | null = fn(this.context.getContainer(), this.context.getState());\n\t\tif (tr) {\n\t\t\tthis.context.dispatch(tr);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\t/** Dispatches a view-based extend command with visual direction mapping for RTL. */\n\tprivate viewExtendVisual(\n\t\tvisual: 'left' | 'right',\n\t\tgranularity: 'word' | 'lineboundary',\n\t): boolean {\n\t\tif (!this.context) return false;\n\t\tconst dir: 'forward' | 'backward' = this.resolveLogicalHorizontalDirection(\n\t\t\tthis.context.getState(),\n\t\t\tvisual,\n\t\t);\n\t\treturn this.viewExtendCommand(dir, granularity);\n\t}\n\n\t/**\n\t * Resolves logical movement direction from visual left/right intent.\n\t * In RTL blocks, visual directions are mirrored in offset space.\n\t */\n\tprivate resolveLogicalHorizontalDirection(\n\t\tstate: EditorState,\n\t\tvisual: 'left' | 'right',\n\t): 'forward' | 'backward' {\n\t\tconst sel = state.selection;\n\t\tif (!isTextSelection(sel)) {\n\t\t\treturn visual === 'left' ? 'backward' : 'forward';\n\t\t}\n\t\tconst container: HTMLElement | undefined = this.context?.getContainer();\n\t\tif (!container) return visual === 'left' ? 'backward' : 'forward';\n\t\tconst blockEl: Element | null = container.querySelector(\n\t\t\t`[data-block-id=\"${sel.head.blockId}\"]`,\n\t\t);\n\t\tconst isRtl: boolean = blockEl instanceof HTMLElement && getTextDirection(blockEl) === 'rtl';\n\t\tif (!isRtl) return visual === 'left' ? 'backward'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