@notectl/core 2.0.2 → 2.0.3

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 (1004) hide show
  1. package/README.md +258 -123
  2. package/dist/chunks/AlignmentPlugin-CIkPaP2h.mjs +2 -0
  3. package/dist/chunks/AlignmentPlugin-CIkPaP2h.mjs.map +1 -0
  4. package/dist/chunks/AttrRegistry-B1iBFcKO.mjs +2 -0
  5. package/dist/chunks/AttrRegistry-B1iBFcKO.mjs.map +1 -0
  6. package/dist/chunks/AttributedMarkCommands-Cmet1IuC.mjs +2 -0
  7. package/dist/chunks/AttributedMarkCommands-Cmet1IuC.mjs.map +1 -0
  8. package/dist/chunks/BlockInsertion-DTIE2BiH.mjs +2 -0
  9. package/dist/chunks/BlockInsertion-DTIE2BiH.mjs.map +1 -0
  10. package/dist/chunks/BlockTypePickerRegistry-U4uY7-lN.mjs +2 -0
  11. package/dist/chunks/BlockTypePickerRegistry-U4uY7-lN.mjs.map +1 -0
  12. package/dist/chunks/BlockquotePlugin-DmbnFmNj.mjs +2 -0
  13. package/dist/chunks/BlockquotePlugin-DmbnFmNj.mjs.map +1 -0
  14. package/dist/chunks/CaretNavigationPlugin-4EaHvYXR.mjs +2 -0
  15. package/dist/chunks/CaretNavigationPlugin-4EaHvYXR.mjs.map +1 -0
  16. package/dist/chunks/CodeBlockPlugin-BP3XaOGj.mjs +2 -0
  17. package/dist/chunks/CodeBlockPlugin-BP3XaOGj.mjs.map +1 -0
  18. package/dist/chunks/ColorGrid-taTKtdsm.mjs +2 -0
  19. package/dist/chunks/ColorGrid-taTKtdsm.mjs.map +1 -0
  20. package/dist/chunks/ColorPickerPopup-JJQ-gMBN.mjs +2 -0
  21. package/dist/chunks/ColorPickerPopup-JJQ-gMBN.mjs.map +1 -0
  22. package/dist/chunks/ColorValidation-3viVw_tK.mjs +2 -0
  23. package/dist/chunks/ColorValidation-3viVw_tK.mjs.map +1 -0
  24. package/dist/chunks/CommandHelpers-D0LIFM4O.mjs +2 -0
  25. package/dist/chunks/CommandHelpers-D0LIFM4O.mjs.map +1 -0
  26. package/dist/chunks/Commands-DJSVqp7b.mjs +2 -0
  27. package/dist/chunks/Commands-DJSVqp7b.mjs.map +1 -0
  28. package/dist/chunks/Decoration-6dhb8k3b.mjs +2 -0
  29. package/dist/chunks/Decoration-6dhb8k3b.mjs.map +1 -0
  30. package/dist/chunks/Document-CkQLx84k.mjs +2 -0
  31. package/dist/chunks/Document-CkQLx84k.mjs.map +1 -0
  32. package/dist/chunks/DocumentParser-QJUmtPp9.mjs +2 -0
  33. package/dist/chunks/DocumentParser-QJUmtPp9.mjs.map +1 -0
  34. package/dist/chunks/DocumentSerializer-bwcxM9WV.mjs +2 -0
  35. package/dist/chunks/DocumentSerializer-bwcxM9WV.mjs.map +1 -0
  36. package/dist/chunks/DomUtils-BkyCg-OO.mjs +2 -0
  37. package/dist/chunks/DomUtils-BkyCg-OO.mjs.map +1 -0
  38. package/dist/chunks/FontPlugin-Cz4qEYGh.mjs +2 -0
  39. package/dist/chunks/FontPlugin-Cz4qEYGh.mjs.map +1 -0
  40. package/dist/chunks/FontSizePlugin-D1WtDqrH.mjs +2 -0
  41. package/dist/chunks/FontSizePlugin-D1WtDqrH.mjs.map +1 -0
  42. package/dist/chunks/GapCursorNavigation-CKKq42kA.mjs +2 -0
  43. package/dist/chunks/GapCursorNavigation-CKKq42kA.mjs.map +1 -0
  44. package/dist/chunks/GapCursorPlugin-0CyOaciK.mjs +2 -0
  45. package/dist/chunks/GapCursorPlugin-0CyOaciK.mjs.map +1 -0
  46. package/dist/chunks/HTMLUtils-BLwp5G4f.mjs +2 -0
  47. package/dist/chunks/HTMLUtils-BLwp5G4f.mjs.map +1 -0
  48. package/dist/chunks/HardBreakPlugin-BOz-L53p.mjs +2 -0
  49. package/dist/chunks/HardBreakPlugin-BOz-L53p.mjs.map +1 -0
  50. package/dist/chunks/HeadingPlugin-C1F-5Ail.mjs +2 -0
  51. package/dist/chunks/HeadingPlugin-C1F-5Ail.mjs.map +1 -0
  52. package/dist/chunks/HighlightPlugin-LYARYuDC.mjs +2 -0
  53. package/dist/chunks/HighlightPlugin-LYARYuDC.mjs.map +1 -0
  54. package/dist/chunks/HorizontalRulePlugin-fmdbzWDQ.mjs +2 -0
  55. package/dist/chunks/HorizontalRulePlugin-fmdbzWDQ.mjs.map +1 -0
  56. package/dist/chunks/ImagePlugin-CrfnT1sD.mjs +2 -0
  57. package/dist/chunks/ImagePlugin-CrfnT1sD.mjs.map +1 -0
  58. package/dist/chunks/KeyboardNav-BZIHDPDV.mjs +2 -0
  59. package/dist/chunks/KeyboardNav-BZIHDPDV.mjs.map +1 -0
  60. package/dist/chunks/LinkPlugin-DzFJLnfQ.mjs +2 -0
  61. package/dist/chunks/LinkPlugin-DzFJLnfQ.mjs.map +1 -0
  62. package/dist/chunks/ListPlugin-C_Rcz3bV.mjs +2 -0
  63. package/dist/chunks/ListPlugin-C_Rcz3bV.mjs.map +1 -0
  64. package/dist/chunks/NavigationQueries-CgYPG6oY.mjs +2 -0
  65. package/dist/chunks/NavigationQueries-CgYPG6oY.mjs.map +1 -0
  66. package/dist/chunks/NodeResolver-CCA8UVRr.mjs +2 -0
  67. package/dist/chunks/NodeResolver-CCA8UVRr.mjs.map +1 -0
  68. package/dist/chunks/NodeSelectionCommands-CE_73CxF.mjs +2 -0
  69. package/dist/chunks/NodeSelectionCommands-CE_73CxF.mjs.map +1 -0
  70. package/dist/chunks/Platform-D9TRT4Mn.mjs +2 -0
  71. package/dist/chunks/Platform-D9TRT4Mn.mjs.map +1 -0
  72. package/dist/chunks/PluginHelpers-DLKHJWJn.mjs +2 -0
  73. package/dist/chunks/PluginHelpers-DLKHJWJn.mjs.map +1 -0
  74. package/dist/chunks/PopupManager-RWOaksC0.mjs +2 -0
  75. package/dist/chunks/PopupManager-RWOaksC0.mjs.map +1 -0
  76. package/dist/chunks/PopupPositioning-a1ADYSmx.mjs +2 -0
  77. package/dist/chunks/PopupPositioning-a1ADYSmx.mjs.map +1 -0
  78. package/dist/chunks/PrintPlugin-CwbEz3eP.mjs +2 -0
  79. package/dist/chunks/PrintPlugin-CwbEz3eP.mjs.map +1 -0
  80. package/dist/chunks/PrintTypes-B2DXeAEG.mjs +2 -0
  81. package/dist/chunks/PrintTypes-B2DXeAEG.mjs.map +1 -0
  82. package/dist/chunks/Selection-B14e7gd0.mjs +2 -0
  83. package/dist/chunks/Selection-B14e7gd0.mjs.map +1 -0
  84. package/dist/chunks/ShortcutFormatting-DQPMvupx.mjs +2 -0
  85. package/dist/chunks/ShortcutFormatting-DQPMvupx.mjs.map +1 -0
  86. package/dist/chunks/SmartPastePlugin-CXqJ0CPO.mjs +2 -0
  87. package/dist/chunks/SmartPastePlugin-CXqJ0CPO.mjs.map +1 -0
  88. package/dist/chunks/StrikethroughPlugin-CRl69jm3.mjs +2 -0
  89. package/dist/chunks/StrikethroughPlugin-CRl69jm3.mjs.map +1 -0
  90. package/dist/chunks/StyleRuntime-0yPPJK9H.mjs +2 -0
  91. package/dist/chunks/StyleRuntime-0yPPJK9H.mjs.map +1 -0
  92. package/dist/chunks/SuperSubPlugin-CAnaTJVm.mjs +2 -0
  93. package/dist/chunks/SuperSubPlugin-CAnaTJVm.mjs.map +1 -0
  94. package/dist/chunks/TablePlugin-D_7bgrqm.mjs +2 -0
  95. package/dist/chunks/TablePlugin-D_7bgrqm.mjs.map +1 -0
  96. package/dist/chunks/TextColorPlugin-Dfhvl1qG.mjs +2 -0
  97. package/dist/chunks/TextColorPlugin-Dfhvl1qG.mjs.map +1 -0
  98. package/dist/chunks/TextDirectionCorePlugin-CyKw-C8X.mjs +2 -0
  99. package/dist/chunks/TextDirectionCorePlugin-CyKw-C8X.mjs.map +1 -0
  100. package/dist/chunks/TextDirectionLocale-rlU1yNly.mjs +2 -0
  101. package/dist/chunks/TextDirectionLocale-rlU1yNly.mjs.map +1 -0
  102. package/dist/chunks/TextFormattingPlugin-xtQczzCs.mjs +2 -0
  103. package/dist/chunks/TextFormattingPlugin-xtQczzCs.mjs.map +1 -0
  104. package/dist/chunks/ToolbarPlugin-BFEniyH-.mjs +2 -0
  105. package/dist/chunks/ToolbarPlugin-BFEniyH-.mjs.map +1 -0
  106. package/dist/chunks/TypeBrands-BQR8dEYU.mjs +2 -0
  107. package/dist/chunks/TypeBrands-BQR8dEYU.mjs.map +1 -0
  108. package/dist/chunks/WordBoundary-iZXLMFyk.mjs +2 -0
  109. package/dist/chunks/WordBoundary-iZXLMFyk.mjs.map +1 -0
  110. package/dist/chunks/XmlPatterns-Ub8I1jdE.mjs +2 -0
  111. package/dist/chunks/XmlPatterns-Ub8I1jdE.mjs.map +1 -0
  112. package/dist/chunks/ar-3-z4mZhh.mjs +2 -0
  113. package/dist/chunks/ar-3-z4mZhh.mjs.map +1 -0
  114. package/dist/chunks/ar-B-l6wR4D.mjs +2 -0
  115. package/dist/chunks/ar-B-l6wR4D.mjs.map +1 -0
  116. package/dist/chunks/ar-B3NByR5H.mjs +2 -0
  117. package/dist/chunks/ar-B3NByR5H.mjs.map +1 -0
  118. package/dist/chunks/ar-BRvm4F78.mjs +2 -0
  119. package/dist/chunks/ar-BRvm4F78.mjs.map +1 -0
  120. package/dist/chunks/ar-BUMXujtS.mjs +2 -0
  121. package/dist/chunks/ar-BUMXujtS.mjs.map +1 -0
  122. package/dist/chunks/ar-BhVHv8Lx.mjs +2 -0
  123. package/dist/chunks/ar-BhVHv8Lx.mjs.map +1 -0
  124. package/dist/chunks/ar-BhwRD9Cg.mjs +2 -0
  125. package/dist/chunks/ar-BhwRD9Cg.mjs.map +1 -0
  126. package/dist/chunks/ar-Bm8ORJ3H.mjs +2 -0
  127. package/dist/chunks/ar-Bm8ORJ3H.mjs.map +1 -0
  128. package/dist/chunks/ar-BpxuRQB2.mjs +2 -0
  129. package/dist/chunks/ar-BpxuRQB2.mjs.map +1 -0
  130. package/dist/chunks/ar-CA0-ysCj.mjs +2 -0
  131. package/dist/chunks/ar-CA0-ysCj.mjs.map +1 -0
  132. package/dist/chunks/ar-CAkFpIju.mjs +2 -0
  133. package/dist/chunks/ar-CAkFpIju.mjs.map +1 -0
  134. package/dist/chunks/ar-CU6qxyFp.mjs +2 -0
  135. package/dist/chunks/ar-CU6qxyFp.mjs.map +1 -0
  136. package/dist/chunks/ar-CXcTrZVc.mjs +2 -0
  137. package/dist/chunks/ar-CXcTrZVc.mjs.map +1 -0
  138. package/dist/chunks/ar-CeO_osWz.mjs +2 -0
  139. package/dist/chunks/ar-CeO_osWz.mjs.map +1 -0
  140. package/dist/chunks/ar-CxRSPJDE.mjs +2 -0
  141. package/dist/chunks/ar-CxRSPJDE.mjs.map +1 -0
  142. package/dist/chunks/ar-DHes6Igy.mjs +2 -0
  143. package/dist/chunks/ar-DHes6Igy.mjs.map +1 -0
  144. package/dist/chunks/ar-DN1aHdqb.mjs +2 -0
  145. package/dist/chunks/ar-DN1aHdqb.mjs.map +1 -0
  146. package/dist/chunks/ar-DNzmHN3q.mjs +2 -0
  147. package/dist/chunks/ar-DNzmHN3q.mjs.map +1 -0
  148. package/dist/chunks/ar-DVdWier2.mjs +2 -0
  149. package/dist/chunks/ar-DVdWier2.mjs.map +1 -0
  150. package/dist/chunks/ar-G_ADWoCx.mjs +2 -0
  151. package/dist/chunks/ar-G_ADWoCx.mjs.map +1 -0
  152. package/dist/chunks/ar-KAaQxKMo.mjs +2 -0
  153. package/dist/chunks/ar-KAaQxKMo.mjs.map +1 -0
  154. package/dist/chunks/ar-MHdV5PAO.mjs +2 -0
  155. package/dist/chunks/ar-MHdV5PAO.mjs.map +1 -0
  156. package/dist/chunks/ar-S2VfgLMv.mjs +2 -0
  157. package/dist/chunks/ar-S2VfgLMv.mjs.map +1 -0
  158. package/dist/chunks/color-picker-DumtHdqh.mjs +2 -0
  159. package/dist/chunks/color-picker-DumtHdqh.mjs.map +1 -0
  160. package/dist/chunks/de-0x8V-vch.mjs +2 -0
  161. package/dist/chunks/de-0x8V-vch.mjs.map +1 -0
  162. package/dist/chunks/de-B5xIP9en.mjs +2 -0
  163. package/dist/chunks/de-B5xIP9en.mjs.map +1 -0
  164. package/dist/chunks/de-BBohFIqw.mjs +2 -0
  165. package/dist/chunks/de-BBohFIqw.mjs.map +1 -0
  166. package/dist/chunks/de-BWPmC-2S.mjs +2 -0
  167. package/dist/chunks/de-BWPmC-2S.mjs.map +1 -0
  168. package/dist/chunks/de-Bo1kM9rb.mjs +2 -0
  169. package/dist/chunks/de-Bo1kM9rb.mjs.map +1 -0
  170. package/dist/chunks/de-BqzR2XMP.mjs +2 -0
  171. package/dist/chunks/de-BqzR2XMP.mjs.map +1 -0
  172. package/dist/chunks/de-CIZibvOC.mjs +2 -0
  173. package/dist/chunks/de-CIZibvOC.mjs.map +1 -0
  174. package/dist/chunks/de-CLToQn0o.mjs +2 -0
  175. package/dist/chunks/de-CLToQn0o.mjs.map +1 -0
  176. package/dist/chunks/de-CNoAAJul.mjs +2 -0
  177. package/dist/chunks/de-CNoAAJul.mjs.map +1 -0
  178. package/dist/chunks/de-CPb7rgkk.mjs +2 -0
  179. package/dist/chunks/de-CPb7rgkk.mjs.map +1 -0
  180. package/dist/chunks/de-CdmBKVDW.mjs +2 -0
  181. package/dist/chunks/de-CdmBKVDW.mjs.map +1 -0
  182. package/dist/chunks/de-DDgeyWgp.mjs +2 -0
  183. package/dist/chunks/de-DDgeyWgp.mjs.map +1 -0
  184. package/dist/chunks/de-DGXQ4OiR.mjs +2 -0
  185. package/dist/chunks/de-DGXQ4OiR.mjs.map +1 -0
  186. package/dist/chunks/de-DJbvKl4E.mjs +2 -0
  187. package/dist/chunks/de-DJbvKl4E.mjs.map +1 -0
  188. package/dist/chunks/de-DKNvYM_G.mjs +2 -0
  189. package/dist/chunks/de-DKNvYM_G.mjs.map +1 -0
  190. package/dist/chunks/de-DOHm_P4A.mjs +2 -0
  191. package/dist/chunks/de-DOHm_P4A.mjs.map +1 -0
  192. package/dist/chunks/de-DTMX75rn.mjs +2 -0
  193. package/dist/chunks/de-DTMX75rn.mjs.map +1 -0
  194. package/dist/chunks/de-DfkQds5F.mjs +2 -0
  195. package/dist/chunks/de-DfkQds5F.mjs.map +1 -0
  196. package/dist/chunks/de-TEQW-F4t.mjs +2 -0
  197. package/dist/chunks/de-TEQW-F4t.mjs.map +1 -0
  198. package/dist/chunks/de-WzdZ_NJ6.mjs +2 -0
  199. package/dist/chunks/de-WzdZ_NJ6.mjs.map +1 -0
  200. package/dist/chunks/de-_vqVfXeo.mjs +2 -0
  201. package/dist/chunks/de-_vqVfXeo.mjs.map +1 -0
  202. package/dist/chunks/de-gR6jt-sS.mjs +2 -0
  203. package/dist/chunks/de-gR6jt-sS.mjs.map +1 -0
  204. package/dist/chunks/de-qOBFRCGL.mjs +2 -0
  205. package/dist/chunks/de-qOBFRCGL.mjs.map +1 -0
  206. package/dist/chunks/es-1udUsTJd.mjs +2 -0
  207. package/dist/chunks/es-1udUsTJd.mjs.map +1 -0
  208. package/dist/chunks/es-3H7h0_G5.mjs +2 -0
  209. package/dist/chunks/es-3H7h0_G5.mjs.map +1 -0
  210. package/dist/chunks/es-4-5iRK0M.mjs +2 -0
  211. package/dist/chunks/es-4-5iRK0M.mjs.map +1 -0
  212. package/dist/chunks/es-89LD3TlT.mjs +2 -0
  213. package/dist/chunks/es-89LD3TlT.mjs.map +1 -0
  214. package/dist/chunks/es-B2KFVoHa.mjs +2 -0
  215. package/dist/chunks/es-B2KFVoHa.mjs.map +1 -0
  216. package/dist/chunks/es-BUP1scLX.mjs +2 -0
  217. package/dist/chunks/es-BUP1scLX.mjs.map +1 -0
  218. package/dist/chunks/es-Bhhj-yh0.mjs +2 -0
  219. package/dist/chunks/es-Bhhj-yh0.mjs.map +1 -0
  220. package/dist/chunks/es-Bo0NTtQH.mjs +2 -0
  221. package/dist/chunks/es-Bo0NTtQH.mjs.map +1 -0
  222. package/dist/chunks/es-Bovw7l2W.mjs +2 -0
  223. package/dist/chunks/es-Bovw7l2W.mjs.map +1 -0
  224. package/dist/chunks/es-C7xAs1yn.mjs +2 -0
  225. package/dist/chunks/es-C7xAs1yn.mjs.map +1 -0
  226. package/dist/chunks/es-CIdF7MzV.mjs +2 -0
  227. package/dist/chunks/es-CIdF7MzV.mjs.map +1 -0
  228. package/dist/chunks/es-CPit7Z6w.mjs +2 -0
  229. package/dist/chunks/es-CPit7Z6w.mjs.map +1 -0
  230. package/dist/chunks/es-CQzgvQI6.mjs +2 -0
  231. package/dist/chunks/es-CQzgvQI6.mjs.map +1 -0
  232. package/dist/chunks/es-CSteuqi5.mjs +2 -0
  233. package/dist/chunks/es-CSteuqi5.mjs.map +1 -0
  234. package/dist/chunks/es-ClJxqhu_.mjs +2 -0
  235. package/dist/chunks/es-ClJxqhu_.mjs.map +1 -0
  236. package/dist/chunks/es-CrmqYoVh.mjs +2 -0
  237. package/dist/chunks/es-CrmqYoVh.mjs.map +1 -0
  238. package/dist/chunks/es-CwRwLkfr.mjs +2 -0
  239. package/dist/chunks/es-CwRwLkfr.mjs.map +1 -0
  240. package/dist/chunks/es-D7DRGnkZ.mjs +2 -0
  241. package/dist/chunks/es-D7DRGnkZ.mjs.map +1 -0
  242. package/dist/chunks/es-DET1uMu-.mjs +2 -0
  243. package/dist/chunks/es-DET1uMu-.mjs.map +1 -0
  244. package/dist/chunks/es-Dj83hJxy.mjs +2 -0
  245. package/dist/chunks/es-Dj83hJxy.mjs.map +1 -0
  246. package/dist/chunks/es-DwYWucI6.mjs +2 -0
  247. package/dist/chunks/es-DwYWucI6.mjs.map +1 -0
  248. package/dist/chunks/es-DwrcpThR.mjs +2 -0
  249. package/dist/chunks/es-DwrcpThR.mjs.map +1 -0
  250. package/dist/chunks/es-z7xjgDdk.mjs +2 -0
  251. package/dist/chunks/es-z7xjgDdk.mjs.map +1 -0
  252. package/dist/chunks/fonts-CG5ZnGux.mjs +2 -0
  253. package/dist/chunks/fonts-CG5ZnGux.mjs.map +1 -0
  254. package/dist/chunks/fr-B73tOEzO.mjs +2 -0
  255. package/dist/chunks/fr-B73tOEzO.mjs.map +1 -0
  256. package/dist/chunks/fr-BEbsFEkX.mjs +2 -0
  257. package/dist/chunks/fr-BEbsFEkX.mjs.map +1 -0
  258. package/dist/chunks/fr-BFCaEBSV.mjs +2 -0
  259. package/dist/chunks/fr-BFCaEBSV.mjs.map +1 -0
  260. package/dist/chunks/fr-BJ69XrDO.mjs +2 -0
  261. package/dist/chunks/fr-BJ69XrDO.mjs.map +1 -0
  262. package/dist/chunks/fr-BdQ_-Iwg.mjs +2 -0
  263. package/dist/chunks/fr-BdQ_-Iwg.mjs.map +1 -0
  264. package/dist/chunks/fr-BhnuBA0i.mjs +2 -0
  265. package/dist/chunks/fr-BhnuBA0i.mjs.map +1 -0
  266. package/dist/chunks/fr-BiLmpXZ9.mjs +2 -0
  267. package/dist/chunks/fr-BiLmpXZ9.mjs.map +1 -0
  268. package/dist/chunks/fr-C1Pak7kS.mjs +2 -0
  269. package/dist/chunks/fr-C1Pak7kS.mjs.map +1 -0
  270. package/dist/chunks/fr-CFDoFELm.mjs +2 -0
  271. package/dist/chunks/fr-CFDoFELm.mjs.map +1 -0
  272. package/dist/chunks/fr-CmsH8BnY.mjs +2 -0
  273. package/dist/chunks/fr-CmsH8BnY.mjs.map +1 -0
  274. package/dist/chunks/fr-Cz2qWiuV.mjs +2 -0
  275. package/dist/chunks/fr-Cz2qWiuV.mjs.map +1 -0
  276. package/dist/chunks/fr-CzTPuD1P.mjs +2 -0
  277. package/dist/chunks/fr-CzTPuD1P.mjs.map +1 -0
  278. package/dist/chunks/fr-D1LQMsjB.mjs +2 -0
  279. package/dist/chunks/fr-D1LQMsjB.mjs.map +1 -0
  280. package/dist/chunks/fr-D84mXQrZ.mjs +2 -0
  281. package/dist/chunks/fr-D84mXQrZ.mjs.map +1 -0
  282. package/dist/chunks/fr-DX7z_ld0.mjs +2 -0
  283. package/dist/chunks/fr-DX7z_ld0.mjs.map +1 -0
  284. package/dist/chunks/fr-DXkQUerf.mjs +2 -0
  285. package/dist/chunks/fr-DXkQUerf.mjs.map +1 -0
  286. package/dist/chunks/fr-Di5gv5P8.mjs +2 -0
  287. package/dist/chunks/fr-Di5gv5P8.mjs.map +1 -0
  288. package/dist/chunks/fr-Dq5MrVWd.mjs +2 -0
  289. package/dist/chunks/fr-Dq5MrVWd.mjs.map +1 -0
  290. package/dist/chunks/fr-DtfEjLSL.mjs +2 -0
  291. package/dist/chunks/fr-DtfEjLSL.mjs.map +1 -0
  292. package/dist/chunks/fr-DvW-dpp3.mjs +2 -0
  293. package/dist/chunks/fr-DvW-dpp3.mjs.map +1 -0
  294. package/dist/chunks/fr-UJFNrn-V.mjs +2 -0
  295. package/dist/chunks/fr-UJFNrn-V.mjs.map +1 -0
  296. package/dist/chunks/fr-hK8X-sM6.mjs +2 -0
  297. package/dist/chunks/fr-hK8X-sM6.mjs.map +1 -0
  298. package/dist/chunks/fr-uuOSXj4L.mjs +2 -0
  299. package/dist/chunks/fr-uuOSXj4L.mjs.map +1 -0
  300. package/dist/chunks/full-216JgIG1.mjs +2 -0
  301. package/dist/chunks/full-216JgIG1.mjs.map +1 -0
  302. package/dist/chunks/hi-B2kXjElO.mjs +2 -0
  303. package/dist/chunks/hi-B2kXjElO.mjs.map +1 -0
  304. package/dist/chunks/hi-B2mEQ5gX.mjs +2 -0
  305. package/dist/chunks/hi-B2mEQ5gX.mjs.map +1 -0
  306. package/dist/chunks/hi-B61lTO2W.mjs +2 -0
  307. package/dist/chunks/hi-B61lTO2W.mjs.map +1 -0
  308. package/dist/chunks/hi-BD5HrbxU.mjs +2 -0
  309. package/dist/chunks/hi-BD5HrbxU.mjs.map +1 -0
  310. package/dist/chunks/hi-BHTvSWXw.mjs +2 -0
  311. package/dist/chunks/hi-BHTvSWXw.mjs.map +1 -0
  312. package/dist/chunks/hi-BYyaOBqY.mjs +2 -0
  313. package/dist/chunks/hi-BYyaOBqY.mjs.map +1 -0
  314. package/dist/chunks/hi-Bhlbz5gX.mjs +2 -0
  315. package/dist/chunks/hi-Bhlbz5gX.mjs.map +1 -0
  316. package/dist/chunks/hi-BniuSk3L.mjs +2 -0
  317. package/dist/chunks/hi-BniuSk3L.mjs.map +1 -0
  318. package/dist/chunks/hi-CBODdhOq.mjs +2 -0
  319. package/dist/chunks/hi-CBODdhOq.mjs.map +1 -0
  320. package/dist/chunks/hi-CKWQCooT.mjs +2 -0
  321. package/dist/chunks/hi-CKWQCooT.mjs.map +1 -0
  322. package/dist/chunks/hi-CkoruGVs.mjs +2 -0
  323. package/dist/chunks/hi-CkoruGVs.mjs.map +1 -0
  324. package/dist/chunks/hi-D6Ge3Lp5.mjs +2 -0
  325. package/dist/chunks/hi-D6Ge3Lp5.mjs.map +1 -0
  326. package/dist/chunks/hi-DEreeBFj.mjs +2 -0
  327. package/dist/chunks/hi-DEreeBFj.mjs.map +1 -0
  328. package/dist/chunks/hi-Dj4JW-9k.mjs +2 -0
  329. package/dist/chunks/hi-Dj4JW-9k.mjs.map +1 -0
  330. package/dist/chunks/hi-DkP4pHSX.mjs +2 -0
  331. package/dist/chunks/hi-DkP4pHSX.mjs.map +1 -0
  332. package/dist/chunks/hi-DknCX8Nx.mjs +2 -0
  333. package/dist/chunks/hi-DknCX8Nx.mjs.map +1 -0
  334. package/dist/chunks/hi-Dm1KJQQ5.mjs +2 -0
  335. package/dist/chunks/hi-Dm1KJQQ5.mjs.map +1 -0
  336. package/dist/chunks/hi-Dx-LTWg-.mjs +2 -0
  337. package/dist/chunks/hi-Dx-LTWg-.mjs.map +1 -0
  338. package/dist/chunks/hi-RDoZtwMm.mjs +2 -0
  339. package/dist/chunks/hi-RDoZtwMm.mjs.map +1 -0
  340. package/dist/chunks/hi-Tq9eDRk7.mjs +2 -0
  341. package/dist/chunks/hi-Tq9eDRk7.mjs.map +1 -0
  342. package/dist/chunks/hi-_vJ_Eo4p.mjs +2 -0
  343. package/dist/chunks/hi-_vJ_Eo4p.mjs.map +1 -0
  344. package/dist/chunks/hi-l8E-czFm.mjs +2 -0
  345. package/dist/chunks/hi-l8E-czFm.mjs.map +1 -0
  346. package/dist/chunks/hi-ydmPh3HB.mjs +2 -0
  347. package/dist/chunks/hi-ydmPh3HB.mjs.map +1 -0
  348. package/dist/chunks/minimal-D-QxXO1C.mjs +2 -0
  349. package/dist/chunks/minimal-D-QxXO1C.mjs.map +1 -0
  350. package/dist/chunks/pt-B4NUSLW8.mjs +2 -0
  351. package/dist/chunks/pt-B4NUSLW8.mjs.map +1 -0
  352. package/dist/chunks/pt-B8VKEboV.mjs +2 -0
  353. package/dist/chunks/pt-B8VKEboV.mjs.map +1 -0
  354. package/dist/chunks/pt-BMDKykEi.mjs +2 -0
  355. package/dist/chunks/pt-BMDKykEi.mjs.map +1 -0
  356. package/dist/chunks/pt-BmWE3xXF.mjs +2 -0
  357. package/dist/chunks/pt-BmWE3xXF.mjs.map +1 -0
  358. package/dist/chunks/pt-CJWKE1SW.mjs +2 -0
  359. package/dist/chunks/pt-CJWKE1SW.mjs.map +1 -0
  360. package/dist/chunks/pt-CKETXoPa.mjs +2 -0
  361. package/dist/chunks/pt-CKETXoPa.mjs.map +1 -0
  362. package/dist/chunks/pt-CKRs16QH.mjs +2 -0
  363. package/dist/chunks/pt-CKRs16QH.mjs.map +1 -0
  364. package/dist/chunks/pt-Cb-1GHq4.mjs +2 -0
  365. package/dist/chunks/pt-Cb-1GHq4.mjs.map +1 -0
  366. package/dist/chunks/pt-CgpU74p4.mjs +2 -0
  367. package/dist/chunks/pt-CgpU74p4.mjs.map +1 -0
  368. package/dist/chunks/pt-CtOdAphq.mjs +2 -0
  369. package/dist/chunks/pt-CtOdAphq.mjs.map +1 -0
  370. package/dist/chunks/pt-CzaPFMSx.mjs +2 -0
  371. package/dist/chunks/pt-CzaPFMSx.mjs.map +1 -0
  372. package/dist/chunks/pt-DGuLcW0m.mjs +2 -0
  373. package/dist/chunks/pt-DGuLcW0m.mjs.map +1 -0
  374. package/dist/chunks/pt-DHzSXzlf.mjs +2 -0
  375. package/dist/chunks/pt-DHzSXzlf.mjs.map +1 -0
  376. package/dist/chunks/pt-DWDdBfLk.mjs +2 -0
  377. package/dist/chunks/pt-DWDdBfLk.mjs.map +1 -0
  378. package/dist/chunks/pt-DZ6Liq_x.mjs +2 -0
  379. package/dist/chunks/pt-DZ6Liq_x.mjs.map +1 -0
  380. package/dist/chunks/pt-D_MD7MJu.mjs +2 -0
  381. package/dist/chunks/pt-D_MD7MJu.mjs.map +1 -0
  382. package/dist/chunks/pt-DgaY_yNG.mjs +2 -0
  383. package/dist/chunks/pt-DgaY_yNG.mjs.map +1 -0
  384. package/dist/chunks/pt-DgzgCxdH.mjs +2 -0
  385. package/dist/chunks/pt-DgzgCxdH.mjs.map +1 -0
  386. package/dist/chunks/pt-Dh7nUcAM.mjs +2 -0
  387. package/dist/chunks/pt-Dh7nUcAM.mjs.map +1 -0
  388. package/dist/chunks/pt-P914L5AX.mjs +2 -0
  389. package/dist/chunks/pt-P914L5AX.mjs.map +1 -0
  390. package/dist/chunks/pt-XT1vsWZj.mjs +2 -0
  391. package/dist/chunks/pt-XT1vsWZj.mjs.map +1 -0
  392. package/dist/chunks/pt-jJ0XXSVz.mjs +2 -0
  393. package/dist/chunks/pt-jJ0XXSVz.mjs.map +1 -0
  394. package/dist/chunks/pt-tuOLwYkM.mjs +2 -0
  395. package/dist/chunks/pt-tuOLwYkM.mjs.map +1 -0
  396. package/dist/chunks/rolldown-runtime-B8Ku5yk6.mjs +1 -0
  397. package/dist/chunks/ru-7m8CMM17.mjs +2 -0
  398. package/dist/chunks/ru-7m8CMM17.mjs.map +1 -0
  399. package/dist/chunks/ru-9Qh1fR-K.mjs +2 -0
  400. package/dist/chunks/ru-9Qh1fR-K.mjs.map +1 -0
  401. package/dist/chunks/ru-B5gK8OLp.mjs +2 -0
  402. package/dist/chunks/ru-B5gK8OLp.mjs.map +1 -0
  403. package/dist/chunks/ru-BRNN6ldH.mjs +2 -0
  404. package/dist/chunks/ru-BRNN6ldH.mjs.map +1 -0
  405. package/dist/chunks/ru-BiyE9o-D.mjs +2 -0
  406. package/dist/chunks/ru-BiyE9o-D.mjs.map +1 -0
  407. package/dist/chunks/ru-BpGTIPbv.mjs +2 -0
  408. package/dist/chunks/ru-BpGTIPbv.mjs.map +1 -0
  409. package/dist/chunks/ru-CAzMaI4y.mjs +2 -0
  410. package/dist/chunks/ru-CAzMaI4y.mjs.map +1 -0
  411. package/dist/chunks/ru-COo6HpcD.mjs +2 -0
  412. package/dist/chunks/ru-COo6HpcD.mjs.map +1 -0
  413. package/dist/chunks/ru-CgEOZsUs.mjs +2 -0
  414. package/dist/chunks/ru-CgEOZsUs.mjs.map +1 -0
  415. package/dist/chunks/ru-CptzezhV.mjs +2 -0
  416. package/dist/chunks/ru-CptzezhV.mjs.map +1 -0
  417. package/dist/chunks/ru-Ct0qNMLS.mjs +2 -0
  418. package/dist/chunks/ru-Ct0qNMLS.mjs.map +1 -0
  419. package/dist/chunks/ru-Ct2IrzbA.mjs +2 -0
  420. package/dist/chunks/ru-Ct2IrzbA.mjs.map +1 -0
  421. package/dist/chunks/ru-CyHnlWLN.mjs +2 -0
  422. package/dist/chunks/ru-CyHnlWLN.mjs.map +1 -0
  423. package/dist/chunks/ru-DF0vhzeC.mjs +2 -0
  424. package/dist/chunks/ru-DF0vhzeC.mjs.map +1 -0
  425. package/dist/chunks/ru-DH6rsOWL.mjs +2 -0
  426. package/dist/chunks/ru-DH6rsOWL.mjs.map +1 -0
  427. package/dist/chunks/ru-DHH8k6G8.mjs +2 -0
  428. package/dist/chunks/ru-DHH8k6G8.mjs.map +1 -0
  429. package/dist/chunks/ru-GVReqjM4.mjs +2 -0
  430. package/dist/chunks/ru-GVReqjM4.mjs.map +1 -0
  431. package/dist/chunks/ru-IzloX5CY.mjs +2 -0
  432. package/dist/chunks/ru-IzloX5CY.mjs.map +1 -0
  433. package/dist/chunks/ru-ZrzXB0f6.mjs +2 -0
  434. package/dist/chunks/ru-ZrzXB0f6.mjs.map +1 -0
  435. package/dist/chunks/ru-asRKygvE.mjs +2 -0
  436. package/dist/chunks/ru-asRKygvE.mjs.map +1 -0
  437. package/dist/chunks/ru-m19l8nRA.mjs +2 -0
  438. package/dist/chunks/ru-m19l8nRA.mjs.map +1 -0
  439. package/dist/chunks/ru-vfQ5Xaz4.mjs +2 -0
  440. package/dist/chunks/ru-vfQ5Xaz4.mjs.map +1 -0
  441. package/dist/chunks/ru-wVOlNily.mjs +2 -0
  442. package/dist/chunks/ru-wVOlNily.mjs.map +1 -0
  443. package/dist/chunks/shared-DxmfXZH7.mjs +2 -0
  444. package/dist/chunks/shared-DxmfXZH7.mjs.map +1 -0
  445. package/dist/chunks/src-DFXIsulM.mjs +2 -0
  446. package/dist/chunks/src-DFXIsulM.mjs.map +1 -0
  447. package/dist/chunks/text-direction-advanced-B5JuIs0P.mjs +2 -0
  448. package/dist/chunks/text-direction-advanced-B5JuIs0P.mjs.map +1 -0
  449. package/dist/chunks/zh-0uhsRxfq.mjs +2 -0
  450. package/dist/chunks/zh-0uhsRxfq.mjs.map +1 -0
  451. package/dist/chunks/zh-1BrLr5Wk.mjs +2 -0
  452. package/dist/chunks/zh-1BrLr5Wk.mjs.map +1 -0
  453. package/dist/chunks/zh-BNHeXa_M.mjs +2 -0
  454. package/dist/chunks/zh-BNHeXa_M.mjs.map +1 -0
  455. package/dist/chunks/zh-BOpBzSX3.mjs +2 -0
  456. package/dist/chunks/zh-BOpBzSX3.mjs.map +1 -0
  457. package/dist/chunks/zh-BV2uDDGf.mjs +2 -0
  458. package/dist/chunks/zh-BV2uDDGf.mjs.map +1 -0
  459. package/dist/chunks/zh-BkoPteNb.mjs +2 -0
  460. package/dist/chunks/zh-BkoPteNb.mjs.map +1 -0
  461. package/dist/chunks/zh-C2z0g7OC.mjs +2 -0
  462. package/dist/chunks/zh-C2z0g7OC.mjs.map +1 -0
  463. package/dist/chunks/zh-CeJw45yo.mjs +2 -0
  464. package/dist/chunks/zh-CeJw45yo.mjs.map +1 -0
  465. package/dist/chunks/zh-CwVkxL4q.mjs +2 -0
  466. package/dist/chunks/zh-CwVkxL4q.mjs.map +1 -0
  467. package/dist/chunks/zh-Cy7mujpx.mjs +2 -0
  468. package/dist/chunks/zh-Cy7mujpx.mjs.map +1 -0
  469. package/dist/chunks/zh-D-P00ENX.mjs +2 -0
  470. package/dist/chunks/zh-D-P00ENX.mjs.map +1 -0
  471. package/dist/chunks/zh-D5d-NAuv.mjs +2 -0
  472. package/dist/chunks/zh-D5d-NAuv.mjs.map +1 -0
  473. package/dist/chunks/zh-D6gTQA2W.mjs +2 -0
  474. package/dist/chunks/zh-D6gTQA2W.mjs.map +1 -0
  475. package/dist/chunks/zh-DLwq4e4-.mjs +2 -0
  476. package/dist/chunks/zh-DLwq4e4-.mjs.map +1 -0
  477. package/dist/chunks/zh-D_Yb8Eg6.mjs +2 -0
  478. package/dist/chunks/zh-D_Yb8Eg6.mjs.map +1 -0
  479. package/dist/chunks/zh-DaNHqNDY.mjs +2 -0
  480. package/dist/chunks/zh-DaNHqNDY.mjs.map +1 -0
  481. package/dist/chunks/zh-De7-Y4O5.mjs +2 -0
  482. package/dist/chunks/zh-De7-Y4O5.mjs.map +1 -0
  483. package/dist/chunks/zh-Dj7kHEcp.mjs +2 -0
  484. package/dist/chunks/zh-Dj7kHEcp.mjs.map +1 -0
  485. package/dist/chunks/zh-Dl0oVWiK.mjs +2 -0
  486. package/dist/chunks/zh-Dl0oVWiK.mjs.map +1 -0
  487. package/dist/chunks/zh-Do0plBjM.mjs +2 -0
  488. package/dist/chunks/zh-Do0plBjM.mjs.map +1 -0
  489. package/dist/chunks/zh-Q0aDk5UA.mjs +2 -0
  490. package/dist/chunks/zh-Q0aDk5UA.mjs.map +1 -0
  491. package/dist/chunks/zh-eSgs8mzc.mjs +2 -0
  492. package/dist/chunks/zh-eSgs8mzc.mjs.map +1 -0
  493. package/dist/chunks/zh-giWyGMSZ.mjs +2 -0
  494. package/dist/chunks/zh-giWyGMSZ.mjs.map +1 -0
  495. package/dist/fonts.mjs +1 -2
  496. package/dist/full.mjs +1 -2
  497. package/dist/html.mjs +1 -2
  498. package/dist/notectl-core.mjs +1 -2
  499. package/dist/notectl-core.umd.js +2 -2
  500. package/dist/notectl-core.umd.js.map +1 -1
  501. package/dist/plugins/alignment.mjs +1 -2
  502. package/dist/plugins/blockquote.mjs +1 -2
  503. package/dist/plugins/caret-navigation.mjs +1 -2
  504. package/dist/plugins/code-block.mjs +1 -2
  505. package/dist/plugins/font-size.mjs +1 -2
  506. package/dist/plugins/font.mjs +1 -2
  507. package/dist/plugins/gap-cursor.mjs +1 -2
  508. package/dist/plugins/hard-break.mjs +1 -2
  509. package/dist/plugins/heading.mjs +1 -2
  510. package/dist/plugins/highlight.mjs +1 -2
  511. package/dist/plugins/horizontal-rule.mjs +1 -2
  512. package/dist/plugins/image.mjs +1 -2
  513. package/dist/plugins/link.mjs +1 -2
  514. package/dist/plugins/list.mjs +1 -2
  515. package/dist/plugins/print/PrintContentPreparer.d.ts.map +1 -1
  516. package/dist/plugins/print.mjs +1 -2
  517. package/dist/plugins/shared.mjs +1 -2
  518. package/dist/plugins/smart-paste.mjs +1 -2
  519. package/dist/plugins/strikethrough.mjs +1 -2
  520. package/dist/plugins/super-sub.mjs +1 -2
  521. package/dist/plugins/table.mjs +1 -2
  522. package/dist/plugins/text-color.mjs +1 -2
  523. package/dist/plugins/text-direction-advanced.mjs +1 -2
  524. package/dist/plugins/text-direction.mjs +1 -2
  525. package/dist/plugins/text-formatting.mjs +1 -2
  526. package/dist/plugins/toolbar.mjs +1 -2
  527. package/dist/presets/full.mjs +1 -2
  528. package/dist/presets/minimal.mjs +1 -2
  529. package/dist/presets.mjs +1 -2
  530. package/package.json +4 -4
  531. package/dist/chunks/AttrRegistry-iNpjvcSG.mjs +0 -2
  532. package/dist/chunks/AttrRegistry-iNpjvcSG.mjs.map +0 -1
  533. package/dist/chunks/AttributedMarkCommands-BY1BSYWM.mjs +0 -2
  534. package/dist/chunks/AttributedMarkCommands-BY1BSYWM.mjs.map +0 -1
  535. package/dist/chunks/BlockInsertion-BJFhE0jA.mjs +0 -2
  536. package/dist/chunks/BlockInsertion-BJFhE0jA.mjs.map +0 -1
  537. package/dist/chunks/BlockTypePickerRegistry-DcSE6IXB.mjs +0 -2
  538. package/dist/chunks/BlockTypePickerRegistry-DcSE6IXB.mjs.map +0 -1
  539. package/dist/chunks/ColorGrid-CpkbKfXg.mjs +0 -2
  540. package/dist/chunks/ColorGrid-CpkbKfXg.mjs.map +0 -1
  541. package/dist/chunks/ColorPickerPopup-D6XjShhv.mjs +0 -2
  542. package/dist/chunks/ColorPickerPopup-D6XjShhv.mjs.map +0 -1
  543. package/dist/chunks/ColorValidation-DCSKq9B2.mjs +0 -2
  544. package/dist/chunks/ColorValidation-DCSKq9B2.mjs.map +0 -1
  545. package/dist/chunks/CommandHelpers-M6mPS6Ww.mjs +0 -2
  546. package/dist/chunks/CommandHelpers-M6mPS6Ww.mjs.map +0 -1
  547. package/dist/chunks/Commands-D_gMCnVa.mjs +0 -2
  548. package/dist/chunks/Commands-D_gMCnVa.mjs.map +0 -1
  549. package/dist/chunks/Decoration-D49mFXrH.mjs +0 -2
  550. package/dist/chunks/Decoration-D49mFXrH.mjs.map +0 -1
  551. package/dist/chunks/Document-3pNX7ear.mjs +0 -2
  552. package/dist/chunks/Document-3pNX7ear.mjs.map +0 -1
  553. package/dist/chunks/DocumentParser-LvzDQOd1.mjs +0 -2
  554. package/dist/chunks/DocumentParser-LvzDQOd1.mjs.map +0 -1
  555. package/dist/chunks/DomUtils-CznMAZZg.mjs +0 -2
  556. package/dist/chunks/DomUtils-CznMAZZg.mjs.map +0 -1
  557. package/dist/chunks/HTMLUtils-Cxy99Ak2.mjs +0 -2
  558. package/dist/chunks/HTMLUtils-Cxy99Ak2.mjs.map +0 -1
  559. package/dist/chunks/HeadingPlugin-BmkeUXj8.mjs +0 -2
  560. package/dist/chunks/HeadingPlugin-BmkeUXj8.mjs.map +0 -1
  561. package/dist/chunks/KeyboardNav-DsYhKKuV.mjs +0 -2
  562. package/dist/chunks/KeyboardNav-DsYhKKuV.mjs.map +0 -1
  563. package/dist/chunks/MarkCommands-CeCa4WSC.mjs +0 -2
  564. package/dist/chunks/MarkCommands-CeCa4WSC.mjs.map +0 -1
  565. package/dist/chunks/NavigationQueries-11qe4j9x.mjs +0 -2
  566. package/dist/chunks/NavigationQueries-11qe4j9x.mjs.map +0 -1
  567. package/dist/chunks/NodeResolver-z0ReCR34.mjs +0 -2
  568. package/dist/chunks/NodeResolver-z0ReCR34.mjs.map +0 -1
  569. package/dist/chunks/NodeSelectionCommands-CXrOcPtG.mjs +0 -2
  570. package/dist/chunks/NodeSelectionCommands-CXrOcPtG.mjs.map +0 -1
  571. package/dist/chunks/NotectlEditor-BJD7-FFx.mjs +0 -4
  572. package/dist/chunks/NotectlEditor-BJD7-FFx.mjs.map +0 -1
  573. package/dist/chunks/Platform-CU6itXZo.mjs +0 -2
  574. package/dist/chunks/Platform-CU6itXZo.mjs.map +0 -1
  575. package/dist/chunks/PluginHelpers-CdPR0MuT.mjs +0 -2
  576. package/dist/chunks/PluginHelpers-CdPR0MuT.mjs.map +0 -1
  577. package/dist/chunks/PopupManager-0b_Q0m7K.mjs +0 -2
  578. package/dist/chunks/PopupManager-0b_Q0m7K.mjs.map +0 -1
  579. package/dist/chunks/PopupPositioning-DtvqMSop.mjs +0 -2
  580. package/dist/chunks/PopupPositioning-DtvqMSop.mjs.map +0 -1
  581. package/dist/chunks/PrintTypes-DukwDSWS.mjs +0 -2
  582. package/dist/chunks/PrintTypes-DukwDSWS.mjs.map +0 -1
  583. package/dist/chunks/RangeIterator-XFN5FaYf.mjs +0 -2
  584. package/dist/chunks/RangeIterator-XFN5FaYf.mjs.map +0 -1
  585. package/dist/chunks/Selection-DhbizDM4.mjs +0 -2
  586. package/dist/chunks/Selection-DhbizDM4.mjs.map +0 -1
  587. package/dist/chunks/SelectionTransactions-DzIZxcuN.mjs +0 -2
  588. package/dist/chunks/SelectionTransactions-DzIZxcuN.mjs.map +0 -1
  589. package/dist/chunks/ShortcutFormatting-BLKS0Gys.mjs +0 -2
  590. package/dist/chunks/ShortcutFormatting-BLKS0Gys.mjs.map +0 -1
  591. package/dist/chunks/StyleRuntime-BmsLoEa8.mjs +0 -2
  592. package/dist/chunks/StyleRuntime-BmsLoEa8.mjs.map +0 -1
  593. package/dist/chunks/TextDirectionLocale-CKz0ZrH_.mjs +0 -2
  594. package/dist/chunks/TextDirectionLocale-CKz0ZrH_.mjs.map +0 -1
  595. package/dist/chunks/TypeBrands-Bp_Z_o5Y.mjs +0 -2
  596. package/dist/chunks/TypeBrands-Bp_Z_o5Y.mjs.map +0 -1
  597. package/dist/chunks/XmlPatterns-DxQXGjP8.mjs +0 -2
  598. package/dist/chunks/XmlPatterns-DxQXGjP8.mjs.map +0 -1
  599. package/dist/chunks/ar-B93SPJT7.mjs +0 -2
  600. package/dist/chunks/ar-B93SPJT7.mjs.map +0 -1
  601. package/dist/chunks/ar-BAmGa08u.mjs +0 -2
  602. package/dist/chunks/ar-BAmGa08u.mjs.map +0 -1
  603. package/dist/chunks/ar-BYNFEVLc.mjs +0 -2
  604. package/dist/chunks/ar-BYNFEVLc.mjs.map +0 -1
  605. package/dist/chunks/ar-Bnc7y8BP.mjs +0 -2
  606. package/dist/chunks/ar-Bnc7y8BP.mjs.map +0 -1
  607. package/dist/chunks/ar-Bp3rDZky.mjs +0 -2
  608. package/dist/chunks/ar-Bp3rDZky.mjs.map +0 -1
  609. package/dist/chunks/ar-BtOQ7lro.mjs +0 -2
  610. package/dist/chunks/ar-BtOQ7lro.mjs.map +0 -1
  611. package/dist/chunks/ar-C5JEHhw9.mjs +0 -2
  612. package/dist/chunks/ar-C5JEHhw9.mjs.map +0 -1
  613. package/dist/chunks/ar-CL3QL0tw.mjs +0 -2
  614. package/dist/chunks/ar-CL3QL0tw.mjs.map +0 -1
  615. package/dist/chunks/ar-CYtG-XlN.mjs +0 -2
  616. package/dist/chunks/ar-CYtG-XlN.mjs.map +0 -1
  617. package/dist/chunks/ar-CzVj8p__.mjs +0 -2
  618. package/dist/chunks/ar-CzVj8p__.mjs.map +0 -1
  619. package/dist/chunks/ar-D7PS3e2g.mjs +0 -2
  620. package/dist/chunks/ar-D7PS3e2g.mjs.map +0 -1
  621. package/dist/chunks/ar-D8adM2Uy.mjs +0 -2
  622. package/dist/chunks/ar-D8adM2Uy.mjs.map +0 -1
  623. package/dist/chunks/ar-D9jyShaB.mjs +0 -2
  624. package/dist/chunks/ar-D9jyShaB.mjs.map +0 -1
  625. package/dist/chunks/ar-DR6OA3ZO.mjs +0 -2
  626. package/dist/chunks/ar-DR6OA3ZO.mjs.map +0 -1
  627. package/dist/chunks/ar-Deibepjm.mjs +0 -2
  628. package/dist/chunks/ar-Deibepjm.mjs.map +0 -1
  629. package/dist/chunks/ar-Dlb5riUN.mjs +0 -2
  630. package/dist/chunks/ar-Dlb5riUN.mjs.map +0 -1
  631. package/dist/chunks/ar-DmmxE2W7.mjs +0 -2
  632. package/dist/chunks/ar-DmmxE2W7.mjs.map +0 -1
  633. package/dist/chunks/ar-Ds6Z2Gzf.mjs +0 -2
  634. package/dist/chunks/ar-Ds6Z2Gzf.mjs.map +0 -1
  635. package/dist/chunks/ar-DtIHQ8nU.mjs +0 -2
  636. package/dist/chunks/ar-DtIHQ8nU.mjs.map +0 -1
  637. package/dist/chunks/ar-J8B-on-0.mjs +0 -2
  638. package/dist/chunks/ar-J8B-on-0.mjs.map +0 -1
  639. package/dist/chunks/ar-b6VdnxAs.mjs +0 -2
  640. package/dist/chunks/ar-b6VdnxAs.mjs.map +0 -1
  641. package/dist/chunks/ar-iU02mRe5.mjs +0 -2
  642. package/dist/chunks/ar-iU02mRe5.mjs.map +0 -1
  643. package/dist/chunks/ar-mSCYQYnL.mjs +0 -2
  644. package/dist/chunks/ar-mSCYQYnL.mjs.map +0 -1
  645. package/dist/chunks/color-picker-Byjl_xr9.mjs +0 -2
  646. package/dist/chunks/color-picker-Byjl_xr9.mjs.map +0 -1
  647. package/dist/chunks/de-8aCC5jBM.mjs +0 -2
  648. package/dist/chunks/de-8aCC5jBM.mjs.map +0 -1
  649. package/dist/chunks/de-B4y4ndUw.mjs +0 -2
  650. package/dist/chunks/de-B4y4ndUw.mjs.map +0 -1
  651. package/dist/chunks/de-B5fcZ0FQ.mjs +0 -2
  652. package/dist/chunks/de-B5fcZ0FQ.mjs.map +0 -1
  653. package/dist/chunks/de-BT9VmwoJ.mjs +0 -2
  654. package/dist/chunks/de-BT9VmwoJ.mjs.map +0 -1
  655. package/dist/chunks/de-BZWSyJTG.mjs +0 -2
  656. package/dist/chunks/de-BZWSyJTG.mjs.map +0 -1
  657. package/dist/chunks/de-CFD_Wgik.mjs +0 -2
  658. package/dist/chunks/de-CFD_Wgik.mjs.map +0 -1
  659. package/dist/chunks/de-CLYtb6kD.mjs +0 -2
  660. package/dist/chunks/de-CLYtb6kD.mjs.map +0 -1
  661. package/dist/chunks/de-CP5v-98M.mjs +0 -2
  662. package/dist/chunks/de-CP5v-98M.mjs.map +0 -1
  663. package/dist/chunks/de-CYJ6uWno.mjs +0 -2
  664. package/dist/chunks/de-CYJ6uWno.mjs.map +0 -1
  665. package/dist/chunks/de-ChcKkF7A.mjs +0 -2
  666. package/dist/chunks/de-ChcKkF7A.mjs.map +0 -1
  667. package/dist/chunks/de-CicoU066.mjs +0 -2
  668. package/dist/chunks/de-CicoU066.mjs.map +0 -1
  669. package/dist/chunks/de-CjLAdBt2.mjs +0 -2
  670. package/dist/chunks/de-CjLAdBt2.mjs.map +0 -1
  671. package/dist/chunks/de-CtFvAXwF.mjs +0 -2
  672. package/dist/chunks/de-CtFvAXwF.mjs.map +0 -1
  673. package/dist/chunks/de-D1OAXtxJ.mjs +0 -2
  674. package/dist/chunks/de-D1OAXtxJ.mjs.map +0 -1
  675. package/dist/chunks/de-DBbzCQrm.mjs +0 -2
  676. package/dist/chunks/de-DBbzCQrm.mjs.map +0 -1
  677. package/dist/chunks/de-DOLwx_M7.mjs +0 -2
  678. package/dist/chunks/de-DOLwx_M7.mjs.map +0 -1
  679. package/dist/chunks/de-De2miMxo.mjs +0 -2
  680. package/dist/chunks/de-De2miMxo.mjs.map +0 -1
  681. package/dist/chunks/de-OTfhhinm.mjs +0 -2
  682. package/dist/chunks/de-OTfhhinm.mjs.map +0 -1
  683. package/dist/chunks/de-PZ9-LlBp.mjs +0 -2
  684. package/dist/chunks/de-PZ9-LlBp.mjs.map +0 -1
  685. package/dist/chunks/de-UREymH-5.mjs +0 -2
  686. package/dist/chunks/de-UREymH-5.mjs.map +0 -1
  687. package/dist/chunks/de-chYdoK9q.mjs +0 -2
  688. package/dist/chunks/de-chYdoK9q.mjs.map +0 -1
  689. package/dist/chunks/de-fXvs5vQT.mjs +0 -2
  690. package/dist/chunks/de-fXvs5vQT.mjs.map +0 -1
  691. package/dist/chunks/de-xJh5C_pk.mjs +0 -2
  692. package/dist/chunks/de-xJh5C_pk.mjs.map +0 -1
  693. package/dist/chunks/es-B9UhsaEI.mjs +0 -2
  694. package/dist/chunks/es-B9UhsaEI.mjs.map +0 -1
  695. package/dist/chunks/es-BHGwPgrP.mjs +0 -2
  696. package/dist/chunks/es-BHGwPgrP.mjs.map +0 -1
  697. package/dist/chunks/es-BTqy_aQ4.mjs +0 -2
  698. package/dist/chunks/es-BTqy_aQ4.mjs.map +0 -1
  699. package/dist/chunks/es-BbGOZGS_.mjs +0 -2
  700. package/dist/chunks/es-BbGOZGS_.mjs.map +0 -1
  701. package/dist/chunks/es-BjPsub0k.mjs +0 -2
  702. package/dist/chunks/es-BjPsub0k.mjs.map +0 -1
  703. package/dist/chunks/es-Bk0bRDFE.mjs +0 -2
  704. package/dist/chunks/es-Bk0bRDFE.mjs.map +0 -1
  705. package/dist/chunks/es-BkS6DsrM.mjs +0 -2
  706. package/dist/chunks/es-BkS6DsrM.mjs.map +0 -1
  707. package/dist/chunks/es-BzEpr4Bk.mjs +0 -2
  708. package/dist/chunks/es-BzEpr4Bk.mjs.map +0 -1
  709. package/dist/chunks/es-C2lnWyA0.mjs +0 -2
  710. package/dist/chunks/es-C2lnWyA0.mjs.map +0 -1
  711. package/dist/chunks/es-C7e35Muh.mjs +0 -2
  712. package/dist/chunks/es-C7e35Muh.mjs.map +0 -1
  713. package/dist/chunks/es-CBk43isB.mjs +0 -2
  714. package/dist/chunks/es-CBk43isB.mjs.map +0 -1
  715. package/dist/chunks/es-CE8t9fuM.mjs +0 -2
  716. package/dist/chunks/es-CE8t9fuM.mjs.map +0 -1
  717. package/dist/chunks/es-CFjzqIbS.mjs +0 -2
  718. package/dist/chunks/es-CFjzqIbS.mjs.map +0 -1
  719. package/dist/chunks/es-Ce-AEYxc.mjs +0 -2
  720. package/dist/chunks/es-Ce-AEYxc.mjs.map +0 -1
  721. package/dist/chunks/es-Co4AJr8Y.mjs +0 -2
  722. package/dist/chunks/es-Co4AJr8Y.mjs.map +0 -1
  723. package/dist/chunks/es-Cu5_OA4X.mjs +0 -2
  724. package/dist/chunks/es-Cu5_OA4X.mjs.map +0 -1
  725. package/dist/chunks/es-Cud6JXHf.mjs +0 -2
  726. package/dist/chunks/es-Cud6JXHf.mjs.map +0 -1
  727. package/dist/chunks/es-D-II7LZC.mjs +0 -2
  728. package/dist/chunks/es-D-II7LZC.mjs.map +0 -1
  729. package/dist/chunks/es-DBBSeOaD.mjs +0 -2
  730. package/dist/chunks/es-DBBSeOaD.mjs.map +0 -1
  731. package/dist/chunks/es-DCwjeUUu.mjs +0 -2
  732. package/dist/chunks/es-DCwjeUUu.mjs.map +0 -1
  733. package/dist/chunks/es-DvgH3-WZ.mjs +0 -2
  734. package/dist/chunks/es-DvgH3-WZ.mjs.map +0 -1
  735. package/dist/chunks/es-MgguVgIs.mjs +0 -2
  736. package/dist/chunks/es-MgguVgIs.mjs.map +0 -1
  737. package/dist/chunks/es-yXjjcxgb.mjs +0 -2
  738. package/dist/chunks/es-yXjjcxgb.mjs.map +0 -1
  739. package/dist/chunks/fr-B-_yKIAY.mjs +0 -2
  740. package/dist/chunks/fr-B-_yKIAY.mjs.map +0 -1
  741. package/dist/chunks/fr-BGyF2ym0.mjs +0 -2
  742. package/dist/chunks/fr-BGyF2ym0.mjs.map +0 -1
  743. package/dist/chunks/fr-BoRJ3B2-.mjs +0 -2
  744. package/dist/chunks/fr-BoRJ3B2-.mjs.map +0 -1
  745. package/dist/chunks/fr-BrKk4SPg.mjs +0 -2
  746. package/dist/chunks/fr-BrKk4SPg.mjs.map +0 -1
  747. package/dist/chunks/fr-C-y09LKg.mjs +0 -2
  748. package/dist/chunks/fr-C-y09LKg.mjs.map +0 -1
  749. package/dist/chunks/fr-C1W7jyd6.mjs +0 -2
  750. package/dist/chunks/fr-C1W7jyd6.mjs.map +0 -1
  751. package/dist/chunks/fr-C8CtmWBj.mjs +0 -2
  752. package/dist/chunks/fr-C8CtmWBj.mjs.map +0 -1
  753. package/dist/chunks/fr-C9oiPW0k.mjs +0 -2
  754. package/dist/chunks/fr-C9oiPW0k.mjs.map +0 -1
  755. package/dist/chunks/fr-CEkk4UyZ.mjs +0 -2
  756. package/dist/chunks/fr-CEkk4UyZ.mjs.map +0 -1
  757. package/dist/chunks/fr-Ccaetiwi.mjs +0 -2
  758. package/dist/chunks/fr-Ccaetiwi.mjs.map +0 -1
  759. package/dist/chunks/fr-Ccku5KzA.mjs +0 -2
  760. package/dist/chunks/fr-Ccku5KzA.mjs.map +0 -1
  761. package/dist/chunks/fr-CfUg1FxU.mjs +0 -2
  762. package/dist/chunks/fr-CfUg1FxU.mjs.map +0 -1
  763. package/dist/chunks/fr-DDkBcjmO.mjs +0 -2
  764. package/dist/chunks/fr-DDkBcjmO.mjs.map +0 -1
  765. package/dist/chunks/fr-DNwLChcm.mjs +0 -2
  766. package/dist/chunks/fr-DNwLChcm.mjs.map +0 -1
  767. package/dist/chunks/fr-DvneSjCf.mjs +0 -2
  768. package/dist/chunks/fr-DvneSjCf.mjs.map +0 -1
  769. package/dist/chunks/fr-Dx4Qqimj.mjs +0 -2
  770. package/dist/chunks/fr-Dx4Qqimj.mjs.map +0 -1
  771. package/dist/chunks/fr-RHXmueoO.mjs +0 -2
  772. package/dist/chunks/fr-RHXmueoO.mjs.map +0 -1
  773. package/dist/chunks/fr-VdiCNF4J.mjs +0 -2
  774. package/dist/chunks/fr-VdiCNF4J.mjs.map +0 -1
  775. package/dist/chunks/fr-Wiobfk5s.mjs +0 -2
  776. package/dist/chunks/fr-Wiobfk5s.mjs.map +0 -1
  777. package/dist/chunks/fr-YMiDtWuG.mjs +0 -2
  778. package/dist/chunks/fr-YMiDtWuG.mjs.map +0 -1
  779. package/dist/chunks/fr-_Oxf0k66.mjs +0 -2
  780. package/dist/chunks/fr-_Oxf0k66.mjs.map +0 -1
  781. package/dist/chunks/fr-gurfH-7T.mjs +0 -2
  782. package/dist/chunks/fr-gurfH-7T.mjs.map +0 -1
  783. package/dist/chunks/fr-zP7EjxDL.mjs +0 -2
  784. package/dist/chunks/fr-zP7EjxDL.mjs.map +0 -1
  785. package/dist/chunks/hi-B2W8pFqK.mjs +0 -2
  786. package/dist/chunks/hi-B2W8pFqK.mjs.map +0 -1
  787. package/dist/chunks/hi-B2m69ZCq.mjs +0 -2
  788. package/dist/chunks/hi-B2m69ZCq.mjs.map +0 -1
  789. package/dist/chunks/hi-BMIt3y_-.mjs +0 -2
  790. package/dist/chunks/hi-BMIt3y_-.mjs.map +0 -1
  791. package/dist/chunks/hi-BdtVhAzs.mjs +0 -2
  792. package/dist/chunks/hi-BdtVhAzs.mjs.map +0 -1
  793. package/dist/chunks/hi-BmkfaZpg.mjs +0 -2
  794. package/dist/chunks/hi-BmkfaZpg.mjs.map +0 -1
  795. package/dist/chunks/hi-C-l_R2SO.mjs +0 -2
  796. package/dist/chunks/hi-C-l_R2SO.mjs.map +0 -1
  797. package/dist/chunks/hi-C1LhM-oY.mjs +0 -2
  798. package/dist/chunks/hi-C1LhM-oY.mjs.map +0 -1
  799. package/dist/chunks/hi-CGEbGI1l.mjs +0 -2
  800. package/dist/chunks/hi-CGEbGI1l.mjs.map +0 -1
  801. package/dist/chunks/hi-CPuhj7IA.mjs +0 -2
  802. package/dist/chunks/hi-CPuhj7IA.mjs.map +0 -1
  803. package/dist/chunks/hi-CT5WERqi.mjs +0 -2
  804. package/dist/chunks/hi-CT5WERqi.mjs.map +0 -1
  805. package/dist/chunks/hi-CbLPPQ0b.mjs +0 -2
  806. package/dist/chunks/hi-CbLPPQ0b.mjs.map +0 -1
  807. package/dist/chunks/hi-ClvEtEKe.mjs +0 -2
  808. package/dist/chunks/hi-ClvEtEKe.mjs.map +0 -1
  809. package/dist/chunks/hi-CpBWHmYH.mjs +0 -2
  810. package/dist/chunks/hi-CpBWHmYH.mjs.map +0 -1
  811. package/dist/chunks/hi-DAfl8nU_.mjs +0 -2
  812. package/dist/chunks/hi-DAfl8nU_.mjs.map +0 -1
  813. package/dist/chunks/hi-DVof3w0y.mjs +0 -2
  814. package/dist/chunks/hi-DVof3w0y.mjs.map +0 -1
  815. package/dist/chunks/hi-DtlvSQkD.mjs +0 -2
  816. package/dist/chunks/hi-DtlvSQkD.mjs.map +0 -1
  817. package/dist/chunks/hi-FH3CAJuR.mjs +0 -2
  818. package/dist/chunks/hi-FH3CAJuR.mjs.map +0 -1
  819. package/dist/chunks/hi-Ga9h9a_1.mjs +0 -2
  820. package/dist/chunks/hi-Ga9h9a_1.mjs.map +0 -1
  821. package/dist/chunks/hi-Zc17M1T-.mjs +0 -2
  822. package/dist/chunks/hi-Zc17M1T-.mjs.map +0 -1
  823. package/dist/chunks/hi-g7i0bmig.mjs +0 -2
  824. package/dist/chunks/hi-g7i0bmig.mjs.map +0 -1
  825. package/dist/chunks/hi-js2P6byR.mjs +0 -2
  826. package/dist/chunks/hi-js2P6byR.mjs.map +0 -1
  827. package/dist/chunks/hi-ntUsOspQ.mjs +0 -2
  828. package/dist/chunks/hi-ntUsOspQ.mjs.map +0 -1
  829. package/dist/chunks/hi-yxAcR3w6.mjs +0 -2
  830. package/dist/chunks/hi-yxAcR3w6.mjs.map +0 -1
  831. package/dist/chunks/index-C-L4awHz.mjs +0 -2
  832. package/dist/chunks/index-C-L4awHz.mjs.map +0 -1
  833. package/dist/chunks/index-Cs9iqxhF.mjs +0 -2
  834. package/dist/chunks/index-Cs9iqxhF.mjs.map +0 -1
  835. package/dist/chunks/pt--IiroJQw.mjs +0 -2
  836. package/dist/chunks/pt--IiroJQw.mjs.map +0 -1
  837. package/dist/chunks/pt-BF72W8M5.mjs +0 -2
  838. package/dist/chunks/pt-BF72W8M5.mjs.map +0 -1
  839. package/dist/chunks/pt-BX_t4luI.mjs +0 -2
  840. package/dist/chunks/pt-BX_t4luI.mjs.map +0 -1
  841. package/dist/chunks/pt-B_XJ2s9X.mjs +0 -2
  842. package/dist/chunks/pt-B_XJ2s9X.mjs.map +0 -1
  843. package/dist/chunks/pt-C-Vp7Rxj.mjs +0 -2
  844. package/dist/chunks/pt-C-Vp7Rxj.mjs.map +0 -1
  845. package/dist/chunks/pt-CD2aCZXf.mjs +0 -2
  846. package/dist/chunks/pt-CD2aCZXf.mjs.map +0 -1
  847. package/dist/chunks/pt-CFjzqIbS.mjs +0 -2
  848. package/dist/chunks/pt-CFjzqIbS.mjs.map +0 -1
  849. package/dist/chunks/pt-CHjmBegF.mjs +0 -2
  850. package/dist/chunks/pt-CHjmBegF.mjs.map +0 -1
  851. package/dist/chunks/pt-CQRzEocL.mjs +0 -2
  852. package/dist/chunks/pt-CQRzEocL.mjs.map +0 -1
  853. package/dist/chunks/pt-Cem2WxUk.mjs +0 -2
  854. package/dist/chunks/pt-Cem2WxUk.mjs.map +0 -1
  855. package/dist/chunks/pt-D6kdF3fH.mjs +0 -2
  856. package/dist/chunks/pt-D6kdF3fH.mjs.map +0 -1
  857. package/dist/chunks/pt-DJfJVeY8.mjs +0 -2
  858. package/dist/chunks/pt-DJfJVeY8.mjs.map +0 -1
  859. package/dist/chunks/pt-DfB-IaYi.mjs +0 -2
  860. package/dist/chunks/pt-DfB-IaYi.mjs.map +0 -1
  861. package/dist/chunks/pt-DlNdH9pu.mjs +0 -2
  862. package/dist/chunks/pt-DlNdH9pu.mjs.map +0 -1
  863. package/dist/chunks/pt-DrJ0-8Yo.mjs +0 -2
  864. package/dist/chunks/pt-DrJ0-8Yo.mjs.map +0 -1
  865. package/dist/chunks/pt-DsBJpgpe.mjs +0 -2
  866. package/dist/chunks/pt-DsBJpgpe.mjs.map +0 -1
  867. package/dist/chunks/pt-DwdSYJzC.mjs +0 -2
  868. package/dist/chunks/pt-DwdSYJzC.mjs.map +0 -1
  869. package/dist/chunks/pt-Dx9UkZ3j.mjs +0 -2
  870. package/dist/chunks/pt-Dx9UkZ3j.mjs.map +0 -1
  871. package/dist/chunks/pt-K0BUlM9X.mjs +0 -2
  872. package/dist/chunks/pt-K0BUlM9X.mjs.map +0 -1
  873. package/dist/chunks/pt-TuA3_GDM.mjs +0 -2
  874. package/dist/chunks/pt-TuA3_GDM.mjs.map +0 -1
  875. package/dist/chunks/pt-cN6r-f7f.mjs +0 -2
  876. package/dist/chunks/pt-cN6r-f7f.mjs.map +0 -1
  877. package/dist/chunks/pt-uNGpVM3D.mjs +0 -2
  878. package/dist/chunks/pt-uNGpVM3D.mjs.map +0 -1
  879. package/dist/chunks/pt-v1E9u-Jx.mjs +0 -2
  880. package/dist/chunks/pt-v1E9u-Jx.mjs.map +0 -1
  881. package/dist/chunks/ru-0h51zrqE.mjs +0 -2
  882. package/dist/chunks/ru-0h51zrqE.mjs.map +0 -1
  883. package/dist/chunks/ru-4S8w6UN_.mjs +0 -2
  884. package/dist/chunks/ru-4S8w6UN_.mjs.map +0 -1
  885. package/dist/chunks/ru-B0cRw90L.mjs +0 -2
  886. package/dist/chunks/ru-B0cRw90L.mjs.map +0 -1
  887. package/dist/chunks/ru-B3O7WXNM.mjs +0 -2
  888. package/dist/chunks/ru-B3O7WXNM.mjs.map +0 -1
  889. package/dist/chunks/ru-B6zVAzvI.mjs +0 -2
  890. package/dist/chunks/ru-B6zVAzvI.mjs.map +0 -1
  891. package/dist/chunks/ru-B8teJin_.mjs +0 -2
  892. package/dist/chunks/ru-B8teJin_.mjs.map +0 -1
  893. package/dist/chunks/ru-BCriPw-8.mjs +0 -2
  894. package/dist/chunks/ru-BCriPw-8.mjs.map +0 -1
  895. package/dist/chunks/ru-BNOU16E5.mjs +0 -2
  896. package/dist/chunks/ru-BNOU16E5.mjs.map +0 -1
  897. package/dist/chunks/ru-BO6BIS5W.mjs +0 -2
  898. package/dist/chunks/ru-BO6BIS5W.mjs.map +0 -1
  899. package/dist/chunks/ru-Bdy1lLuc.mjs +0 -2
  900. package/dist/chunks/ru-Bdy1lLuc.mjs.map +0 -1
  901. package/dist/chunks/ru-BgBctNVm.mjs +0 -2
  902. package/dist/chunks/ru-BgBctNVm.mjs.map +0 -1
  903. package/dist/chunks/ru-CNLx7T3O.mjs +0 -2
  904. package/dist/chunks/ru-CNLx7T3O.mjs.map +0 -1
  905. package/dist/chunks/ru-CVSCT776.mjs +0 -2
  906. package/dist/chunks/ru-CVSCT776.mjs.map +0 -1
  907. package/dist/chunks/ru-CZvkdGnf.mjs +0 -2
  908. package/dist/chunks/ru-CZvkdGnf.mjs.map +0 -1
  909. package/dist/chunks/ru-CegMPuML.mjs +0 -2
  910. package/dist/chunks/ru-CegMPuML.mjs.map +0 -1
  911. package/dist/chunks/ru-CiLrD2Nz.mjs +0 -2
  912. package/dist/chunks/ru-CiLrD2Nz.mjs.map +0 -1
  913. package/dist/chunks/ru-ClEM6OKY.mjs +0 -2
  914. package/dist/chunks/ru-ClEM6OKY.mjs.map +0 -1
  915. package/dist/chunks/ru-CrbxCeQf.mjs +0 -2
  916. package/dist/chunks/ru-CrbxCeQf.mjs.map +0 -1
  917. package/dist/chunks/ru-D3j2x2xu.mjs +0 -2
  918. package/dist/chunks/ru-D3j2x2xu.mjs.map +0 -1
  919. package/dist/chunks/ru-DdHqb4Mh.mjs +0 -2
  920. package/dist/chunks/ru-DdHqb4Mh.mjs.map +0 -1
  921. package/dist/chunks/ru-DjgNdOdJ.mjs +0 -2
  922. package/dist/chunks/ru-DjgNdOdJ.mjs.map +0 -1
  923. package/dist/chunks/ru-Tzd5N37W.mjs +0 -2
  924. package/dist/chunks/ru-Tzd5N37W.mjs.map +0 -1
  925. package/dist/chunks/ru-XKNCzkR2.mjs +0 -2
  926. package/dist/chunks/ru-XKNCzkR2.mjs.map +0 -1
  927. package/dist/chunks/zh--oNSMazK.mjs +0 -2
  928. package/dist/chunks/zh--oNSMazK.mjs.map +0 -1
  929. package/dist/chunks/zh-BfeWdPIz.mjs +0 -2
  930. package/dist/chunks/zh-BfeWdPIz.mjs.map +0 -1
  931. package/dist/chunks/zh-BnOxGKxF.mjs +0 -2
  932. package/dist/chunks/zh-BnOxGKxF.mjs.map +0 -1
  933. package/dist/chunks/zh-BqMtE-jN.mjs +0 -2
  934. package/dist/chunks/zh-BqMtE-jN.mjs.map +0 -1
  935. package/dist/chunks/zh-C3aI7A2o.mjs +0 -2
  936. package/dist/chunks/zh-C3aI7A2o.mjs.map +0 -1
  937. package/dist/chunks/zh-C6YALJZt.mjs +0 -2
  938. package/dist/chunks/zh-C6YALJZt.mjs.map +0 -1
  939. package/dist/chunks/zh-CWdTbUOP.mjs +0 -2
  940. package/dist/chunks/zh-CWdTbUOP.mjs.map +0 -1
  941. package/dist/chunks/zh-CY01pMD4.mjs +0 -2
  942. package/dist/chunks/zh-CY01pMD4.mjs.map +0 -1
  943. package/dist/chunks/zh-Cmt7n9FY.mjs +0 -2
  944. package/dist/chunks/zh-Cmt7n9FY.mjs.map +0 -1
  945. package/dist/chunks/zh-CpP2kee3.mjs +0 -2
  946. package/dist/chunks/zh-CpP2kee3.mjs.map +0 -1
  947. package/dist/chunks/zh-Cpbg4evx.mjs +0 -2
  948. package/dist/chunks/zh-Cpbg4evx.mjs.map +0 -1
  949. package/dist/chunks/zh-Cqb55JWa.mjs +0 -2
  950. package/dist/chunks/zh-Cqb55JWa.mjs.map +0 -1
  951. package/dist/chunks/zh-DCQZ6gss.mjs +0 -2
  952. package/dist/chunks/zh-DCQZ6gss.mjs.map +0 -1
  953. package/dist/chunks/zh-DG2CNTUU.mjs +0 -2
  954. package/dist/chunks/zh-DG2CNTUU.mjs.map +0 -1
  955. package/dist/chunks/zh-DTiTJbzz.mjs +0 -2
  956. package/dist/chunks/zh-DTiTJbzz.mjs.map +0 -1
  957. package/dist/chunks/zh-Da1z6qbB.mjs +0 -2
  958. package/dist/chunks/zh-Da1z6qbB.mjs.map +0 -1
  959. package/dist/chunks/zh-Di3WqY4_.mjs +0 -2
  960. package/dist/chunks/zh-Di3WqY4_.mjs.map +0 -1
  961. package/dist/chunks/zh-DlBt06Pr.mjs +0 -2
  962. package/dist/chunks/zh-DlBt06Pr.mjs.map +0 -1
  963. package/dist/chunks/zh-Dt-wVrNr.mjs +0 -2
  964. package/dist/chunks/zh-Dt-wVrNr.mjs.map +0 -1
  965. package/dist/chunks/zh-ND6vW2M-.mjs +0 -2
  966. package/dist/chunks/zh-ND6vW2M-.mjs.map +0 -1
  967. package/dist/chunks/zh-Yd3GNsa0.mjs +0 -2
  968. package/dist/chunks/zh-Yd3GNsa0.mjs.map +0 -1
  969. package/dist/chunks/zh-lhynyH6Q.mjs +0 -2
  970. package/dist/chunks/zh-lhynyH6Q.mjs.map +0 -1
  971. package/dist/chunks/zh-v9NmlEIN.mjs +0 -2
  972. package/dist/chunks/zh-v9NmlEIN.mjs.map +0 -1
  973. package/dist/fonts.mjs.map +0 -1
  974. package/dist/full.mjs.map +0 -1
  975. package/dist/html.mjs.map +0 -1
  976. package/dist/notectl-core.mjs.map +0 -1
  977. package/dist/plugins/alignment.mjs.map +0 -1
  978. package/dist/plugins/blockquote.mjs.map +0 -1
  979. package/dist/plugins/caret-navigation.mjs.map +0 -1
  980. package/dist/plugins/code-block.mjs.map +0 -1
  981. package/dist/plugins/font-size.mjs.map +0 -1
  982. package/dist/plugins/font.mjs.map +0 -1
  983. package/dist/plugins/gap-cursor.mjs.map +0 -1
  984. package/dist/plugins/hard-break.mjs.map +0 -1
  985. package/dist/plugins/heading.mjs.map +0 -1
  986. package/dist/plugins/highlight.mjs.map +0 -1
  987. package/dist/plugins/horizontal-rule.mjs.map +0 -1
  988. package/dist/plugins/image.mjs.map +0 -1
  989. package/dist/plugins/link.mjs.map +0 -1
  990. package/dist/plugins/list.mjs.map +0 -1
  991. package/dist/plugins/print.mjs.map +0 -1
  992. package/dist/plugins/shared.mjs.map +0 -1
  993. package/dist/plugins/smart-paste.mjs.map +0 -1
  994. package/dist/plugins/strikethrough.mjs.map +0 -1
  995. package/dist/plugins/super-sub.mjs.map +0 -1
  996. package/dist/plugins/table.mjs.map +0 -1
  997. package/dist/plugins/text-color.mjs.map +0 -1
  998. package/dist/plugins/text-direction-advanced.mjs.map +0 -1
  999. package/dist/plugins/text-direction.mjs.map +0 -1
  1000. package/dist/plugins/text-formatting.mjs.map +0 -1
  1001. package/dist/plugins/toolbar.mjs.map +0 -1
  1002. package/dist/presets/full.mjs.map +0 -1
  1003. package/dist/presets/minimal.mjs.map +0 -1
  1004. package/dist/presets.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlockquotePlugin-DmbnFmNj.mjs","names":[],"sources":["../../src/plugins/blockquote/BlockquoteKeyboardHandlers.ts","../../src/plugins/blockquote/BlockquoteLocale.ts","../../src/plugins/blockquote/BlockquoteStyles.ts","../../src/plugins/blockquote/BlockquotePlugin.ts"],"sourcesContent":["/**\n * Keyboard handlers for blockquote boundary navigation and escape.\n *\n * Handles ArrowDown/ArrowUp at block boundaries, Enter on empty blockquote\n * (converts to paragraph), and Backspace at offset 0 (reverts to paragraph).\n */\n\nimport type { BlockNode } from '../../model/Document.js';\nimport { generateBlockId, getBlockLength } from '../../model/Document.js';\nimport { createCollapsedSelection, isCollapsed, isTextSelection } from '../../model/Selection.js';\nimport type { BlockId } from '../../model/TypeBrands.js';\nimport { nodeType } from '../../model/TypeBrands.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { Transaction } from '../../state/Transaction.js';\nimport type { PluginContext } from '../Plugin.js';\n\n// --- Context Guard ---\n\ninterface BlockquoteContext {\n\treadonly state: EditorState;\n\treadonly block: BlockNode;\n\treadonly blockId: BlockId;\n\treadonly offset: number;\n}\n\n/**\n * Guards against non-blockquote contexts.\n * Returns false (not handled) if the cursor is not inside a blockquote.\n */\nfunction withBlockquoteContext(\n\tcontext: PluginContext,\n\thandler: (ctx: BlockquoteContext) => boolean,\n): boolean {\n\tconst state: EditorState = context.getState();\n\tif (!isTextSelection(state.selection)) return false;\n\n\tconst sel = state.selection;\n\tif (!isCollapsed(sel)) return false;\n\n\tconst block: BlockNode | undefined = state.getBlock(sel.anchor.blockId);\n\tif (!block || block.type !== 'blockquote') return false;\n\n\treturn handler({\n\t\tstate,\n\t\tblock,\n\t\tblockId: sel.anchor.blockId,\n\t\toffset: sel.anchor.offset,\n\t});\n}\n\n/** Registers blockquote keyboard handlers at context priority. */\nexport function registerBlockquoteKeymaps(context: PluginContext): void {\n\tcontext.registerKeymap(\n\t\t{\n\t\t\tArrowDown: () => handleArrowDown(context),\n\t\t\tArrowUp: () => handleArrowUp(context),\n\t\t\tEnter: () => handleEnterOnEmpty(context),\n\t\t\tBackspace: () => handleBackspaceAtStart(context),\n\t\t},\n\t\t{ priority: 'context' },\n\t);\n}\n\n// --- Handler Functions ---\n\n/**\n * Moves cursor to the next block when at the end of the blockquote text.\n * If no next block exists, inserts a new paragraph after the blockquote.\n */\nfunction handleArrowDown(context: PluginContext): boolean {\n\treturn withBlockquoteContext(context, ({ state, block, blockId, offset }) => {\n\t\tconst textLength: number = getBlockLength(block);\n\t\tif (offset !== textLength) return false;\n\n\t\tconst blockOrder: readonly BlockId[] = state.getBlockOrder();\n\t\tconst idx: number = blockOrder.indexOf(blockId);\n\n\t\tif (idx < blockOrder.length - 1) {\n\t\t\tconst nextId: BlockId = blockOrder[idx + 1] as BlockId;\n\t\t\tconst tr: Transaction = state\n\t\t\t\t.transaction('command')\n\t\t\t\t.setSelection(createCollapsedSelection(nextId, 0))\n\t\t\t\t.build();\n\t\t\tcontext.dispatch(tr);\n\t\t} else {\n\t\t\tinsertParagraphAfter(context, blockId);\n\t\t}\n\n\t\treturn true;\n\t});\n}\n\n/**\n * Moves cursor to the previous block when at the start of the blockquote text.\n * Returns false if no previous block exists.\n */\nfunction handleArrowUp(context: PluginContext): boolean {\n\treturn withBlockquoteContext(context, ({ state, blockId, offset }) => {\n\t\tif (offset !== 0) return false;\n\n\t\tconst blockOrder: readonly BlockId[] = state.getBlockOrder();\n\t\tconst idx: number = blockOrder.indexOf(blockId);\n\n\t\tif (idx > 0) {\n\t\t\tconst prevId: BlockId = blockOrder[idx - 1] as BlockId;\n\t\t\tconst prevBlock: BlockNode | undefined = state.getBlock(prevId);\n\t\t\tconst prevLen: number = prevBlock ? getBlockLength(prevBlock) : 0;\n\t\t\tconst tr: Transaction = state\n\t\t\t\t.transaction('command')\n\t\t\t\t.setSelection(createCollapsedSelection(prevId, prevLen))\n\t\t\t\t.build();\n\t\t\tcontext.dispatch(tr);\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t});\n}\n\n/**\n * Converts an empty blockquote to a paragraph on Enter.\n * Returns false for non-empty blockquotes, letting splitBlock handle them.\n */\nfunction handleEnterOnEmpty(context: PluginContext): boolean {\n\treturn withBlockquoteContext(context, ({ state, block, blockId }) => {\n\t\tif (getBlockLength(block) > 0) return false;\n\n\t\tconst tr: Transaction = state\n\t\t\t.transaction('command')\n\t\t\t.setBlockType(blockId, nodeType('paragraph'))\n\t\t\t.setSelection(createCollapsedSelection(blockId, 0))\n\t\t\t.build();\n\t\tcontext.dispatch(tr);\n\t\treturn true;\n\t});\n}\n\n/**\n * Converts a blockquote to a paragraph when Backspace is pressed at offset 0.\n */\nfunction handleBackspaceAtStart(context: PluginContext): boolean {\n\treturn withBlockquoteContext(context, ({ state, blockId, offset }) => {\n\t\tif (offset !== 0) return false;\n\n\t\tconst tr: Transaction = state\n\t\t\t.transaction('input')\n\t\t\t.setBlockType(blockId, nodeType('paragraph'))\n\t\t\t.setSelection(state.selection)\n\t\t\t.build();\n\t\tcontext.dispatch(tr);\n\t\treturn true;\n\t});\n}\n\n// --- Shared Helpers ---\n\nfunction insertParagraphAfter(context: PluginContext, bid: BlockId): void {\n\tconst state: EditorState = context.getState();\n\tconst block: BlockNode | undefined = state.getBlock(bid);\n\tif (!block) return;\n\n\tconst blockLength: number = getBlockLength(block);\n\tconst newId: BlockId = generateBlockId();\n\n\tconst tr: Transaction = state\n\t\t.transaction('command')\n\t\t.splitBlock(bid, blockLength, newId)\n\t\t.setBlockType(newId, nodeType('paragraph'))\n\t\t.setSelection(createCollapsedSelection(newId, 0))\n\t\t.build();\n\n\tcontext.dispatch(tr);\n}\n","/**\n * Locale interface and default English locale for the BlockquotePlugin.\n */\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: Record<string, () => Promise<{ default: BlockquoteLocale }>> =\n\timport.meta.glob<{ default: BlockquoteLocale }>('./locales/*.ts', { eager: false });\n\nexport async function loadBlockquoteLocale(lang: string): Promise<BlockquoteLocale> {\n\tif (lang === 'en') return BLOCKQUOTE_LOCALE_EN;\n\tconst loader = localeModules[`./locales/${lang}.ts`];\n\tif (!loader) return BLOCKQUOTE_LOCALE_EN;\n\ttry {\n\t\tconst mod = await loader();\n\t\treturn mod.default;\n\t} catch {\n\t\treturn BLOCKQUOTE_LOCALE_EN;\n\t}\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-border);\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 { isCollapsed, isTextSelection } from '../../model/Selection.js';\nimport { type NodeTypeName, 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\tcontent: { allow: ['text'] },\n\t\t\ttoDOM(node) {\n\t\t\t\treturn createBlockElement('blockquote', node.id);\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.setBlockType(context, nodeType('blockquote'));\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\treturn state\n\t\t\t\t\t.transaction('input')\n\t\t\t\t\t.deleteTextAt(sel.anchor.blockId, start, start + 2)\n\t\t\t\t\t.setBlockType(sel.anchor.blockId, nodeType('blockquote'))\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\tconst block = state.getBlock(state.selection.anchor.blockId);\n\t\t\t\treturn block?.type === 'blockquote';\n\t\t\t},\n\t\t});\n\t}\n\n\t/**\n\t * Toggles between blockquote and paragraph.\n\t * If the block is already a blockquote, resets to paragraph.\n\t */\n\tprivate toggleBlockquote(context: PluginContext): boolean {\n\t\tconst state = context.getState();\n\t\tif (!isTextSelection(state.selection)) return false;\n\t\tconst block = state.getBlock(state.selection.anchor.blockId);\n\t\tif (!block) return false;\n\n\t\tif (block.type === 'blockquote') {\n\t\t\treturn this.setBlockType(context, nodeType('paragraph'));\n\t\t}\n\n\t\treturn this.setBlockType(context, nodeType('blockquote'));\n\t}\n\n\tprivate setBlockType(\n\t\tcontext: PluginContext,\n\t\ttype: NodeTypeName,\n\t\tattrs?: Record<string, string | number | boolean>,\n\t): 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 = state\n\t\t\t.transaction('command')\n\t\t\t.setBlockType(sel.anchor.blockId, type, attrs)\n\t\t\t.setSelection(sel)\n\t\t\t.build();\n\n\t\tcontext.dispatch(tr);\n\t\treturn true;\n\t}\n}\n"],"mappings":"qSA6BA,SAAS,EACR,EACA,GAEA,MAAM,EAAqB,EAAQ,WACnC,IAAK,EAAgB,EAAM,WAAY,OAAO,EAE9C,MAAM,EAAM,EAAM,UAClB,IAAK,EAAY,GAAM,OAAO,EAE9B,MAAM,EAA+B,EAAM,SAAS,E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gBAG5C,YAAA,CACC,EACA,EACA,GAEA,MAAM,EAAQ,EAAQ,WAChB,EAAM,EAAM,UAClB,IAAK,EAAgB,GAAM,OAAO,EAElC,MAAM,EAAK,EACT,YAAY,WACZ,aAAa,EAAI,OAAO,QAAS,EAAM,GACvC,aAAa,GACb,QAGF,OADA,EAAQ,SAAS,IACV"}
@@ -0,0 +1,2 @@
1
+ import{m as t,n,p as e,u as o}from"./Document-CkQLx84k.mjs";import{a as r,c as i,i as l,l as c,o as s,u as a}from"./Selection-B14e7gd0.mjs";import{t as f}from"./TypeBrands-BQR8dEYU.mjs";import{r as u,t as d}from"./DomUtils-BkyCg-OO.mjs";import{i as h,n as m,r as g}from"./GapCursorNavigation-CKKq42kA.mjs";import{i as k,t as w}from"./NavigationQueries-CgYPG6oY.mjs";import{n as b,t as I}from"./WordBoundary-iZXLMFyk.mjs";import{r as p,t as v}from"./Platform-D9TRT4Mn.mjs";import{i as y}from"./PluginHelpers-DLKHJWJn.mjs";var N="undefined"!=typeof Intl&&"Segmenter"in Intl?new Intl.Segmenter(void 0,{granularity:"grapheme"}):null;function x(t,n){if(n>=t.length||0===t.length)return 0;if(N){for(const e of N.segment(t))if(e.index>=n)return e.segment.length;return 0}return 1}function C(t,n){if(n<=0||0===t.length)return 0;if(N){let e=1;for(const o of N.segment(t)){if(o.index+o.segment.length>=n){e=o.segment.length;break}e=o.segment.length}return e}return 1}function A(t){const n=t.selection;if(!a(n))return null;const e=s(n)?n.anchor.blockId:n.head.blockId;return 0===(s(n)?n.anchor.offset:n.head.offset)?null:g(t,e,0)}function E(t){const n=t.selection;if(!a(n))return null;const e=s(n)?n.anchor.blockId:n.head.blockId,r=t.getBlock(e);if(!r)return null;const i=o(r);return(s(n)?n.anchor.offset:n.head.offset)===i?null:g(t,e,i)}function T(t){const n=t.selection;return a(n)?{blockId:n.head.blockId,offset:n.head.offset}:null}function B(t,n,e){const o=t.getBlockOrder(),r=o.indexOf(n);if(r<0)return null;const i="forward"===e?r+1:r-1;return i<0||i>=o.length?null:o[i]??null}function O(r){const i=r.selection;if(!a(i))return null;if(!s(i))return g(r,i.head.blockId,i.head.offset);const l=i.anchor.blockId,c=r.getBlock(l);if(!c)return null;const f=i.anchor.offset;if(f<o(c))return"inline"===t(c,f)?.kind?g(r,l,f+1):g(r,l,f+(x(e(c),n(c,f))||1));const u=B(r,l,"forward");return u&&w(r,l,u)?k(r,u)?h(r,u):g(r,u,0):null}function M(r){const i=r.selection;if(!a(i))return null;if(!s(i))return g(r,i.head.blockId,i.head.offset);const l=i.anchor.blockId,c=r.getBlock(l);if(!c)return null;const f=i.anchor.offset;if(f>0)return"inline"===t(c,f-1)?.kind?g(r,l,f-1):g(r,l,f-(C(e(c),n(c,f))||1));const u=B(r,l,"backward");if(!u)return null;if(!w(r,l,u))return null;if(k(r,u))return h(r,u);const d=r.getBlock(u);return d?g(r,u,o(d)):null}function S(t){const n=t.selection;if(!a(n))return null;const e=t.getBlockOrder()[0];return e?k(t,e)?h(t,e):g(t,e,0):null}function R(t){const n=t.selection;if(!a(n))return null;const e=t.getBlockOrder(),r=e[e.length-1];if(!r)return null;if(k(t,r))return h(t,r);const i=t.getBlock(r);return i?g(t,r,o(i)):null}function L(r){const i=T(r);if(!i)return null;const l=r.selection;if(!a(l))return null;const c=r.getBlock(i.blockId);if(!c)return null;const s=o(c);if(i.offset<s){const o="inline"===t(c,i.offset)?.kind?1:x(e(c),n(c,i.offset))||1;return m(r,l.anchor.blockId,l.anchor.offset,i.blockId,i.offset+o)}const f=B(r,i.blockId,"forward");return f&&w(r,i.blockId,f)?m(r,l.anchor.blockId,l.anchor.offset,f,0):null}function H(r){const i=T(r);if(!i)return null;const l=r.selection;if(!a(l))return null;if(i.offset>0){const o=r.getBlock(i.blockId);if(!o)return null;const c="inline"===t(o,i.offset-1)?.kind?1:C(e(o),n(o,i.offset))||1;return m(r,l.anchor.blockId,l.anchor.offset,i.blockId,i.offset-c)}const c=B(r,i.blockId,"backward");if(!c)return null;if(!w(r,i.blockId,c))return null;const s=r.getBlock(c);return s?m(r,l.anchor.blockId,l.anchor.offset,c,o(s)):null}function V(t){const n=T(t);if(!n)return null;const e=t.selection;return a(e)?0===n.offset?null:m(t,e.anchor.blockId,e.anchor.offset,n.blockId,0):null}function j(t){const n=T(t);if(!n)return null;const e=t.selection;if(!a(e))return null;const r=t.getBlock(n.blockId);if(!r)return null;const i=o(r);return n.offset===i?null:m(t,e.anchor.blockId,e.anchor.offset,n.blockId,i)}function D(t){const n=t.selection;if(!a(n))return null;const e=t.getBlockOrder()[0];return e?n.head.blockId===e&&0===n.head.offset?null:m(t,n.anchor.blockId,n.anchor.offset,e,0):null}function _(t){const n=t.selection;if(!a(n))return null;const e=t.getBlockOrder(),r=e[e.length-1];if(!r)return null;const i=t.getBlock(r);if(!i)return null;const l=o(i);return n.head.blockId===r&&n.head.offset===l?null:m(t,n.anchor.blockId,n.anchor.offset,r,l)}function F(t,n,e,o){let r=null,i=0;if("caretPositionFromPoint"in t){const o=t.caretPositionFromPoint(n,e);o&&(r=o.offsetNode,i=o.offset)}if(!r&&"caretRangeFromPoint"in t){const o=t.caretRangeFromPoint(n,e);o&&(r=o.startContainer,i=o.startOffset)}if(!r&&o&&t!==o&&"caretRangeFromPoint"in o){const t=o.caretRangeFromPoint(n,e);t&&(r=t.startContainer,i=t.startOffset)}return r?{node:r,offset:i}:null}function P(){return window.getSelection()}function q(t,n){const e=t.getRootNode();if(!(e instanceof ShadowRoot))return null;if(!("getComposedRanges"in n))return null;let o;try{o=n.getComposedRanges({shadowRoots:[e]})}catch{try{o=n.getComposedRanges(e)}catch{return null}}const r=o[0];if(!r)return null;const i="direction"in n&&"backward"===n.direction;return{anchorNode:i?r.endContainer:r.startContainer,anchorOffset:i?r.endOffset:r.startOffset,focusNode:i?r.startContainer:r.endContainer,focusOffset:i?r.startOffset:r.endOffset}}function z(t,n){const e=q(t,n);if(e)return e;const o=n.anchorNode;if(!o)return null;const r=n.focusNode;return r?{anchorNode:o,anchorOffset:n.anchorOffset,focusNode:r,focusOffset:n.focusOffset}:null}function $(t,n){const e=P();if(!e)return;if(i(n))return void e.removeAllRanges();if(c(n)){const o=t.querySelector(`[data-block-id="${n.nodeId}"]`);if(!o)return;const r=o.parentNode;if(!r)return;const i=Q(r,o);try{e.setBaseAndExtent(r,i,r,i+1)}catch{}return}const o=U(t,n.anchor),r=U(t,n.head);if(o&&r)try{e.setBaseAndExtent(o.node,o.offset,r.node,r.offset)}catch{}}function X(t){const n=P();if(!n||0===n.rangeCount)return null;const e=z(t,n);if(!e)return null;if(!t.contains(e.anchorNode)||!t.contains(e.focusNode))return null;const o=W(t,e.anchorNode,e.anchorOffset),i=W(t,e.focusNode,e.focusOffset);return o&&i?r(o,i):null}function U(t,n){let e=null;if(n.path&&n.path.length>0){let o=t;for(const t of n.path){const n=o.querySelector(`:scope [data-block-id="${t}"]`);if(!n)break;o=n}o!==t&&o.getAttribute("data-block-id")===n.blockId&&(e=o)}if(e??=t.querySelector(`[data-block-id="${n.blockId}"]`),!e)return null;const o=G(e);if(1===o.childNodes.length&&"BR"===o.firstChild?.nodeName)return{node:o,offset:0};let r=n.offset;const i=K(o);let l=i.nextNode();for(;l;){if(l.nodeType===Node.TEXT_NODE){const t=l.textContent?.length??0;if(r<=t)return{node:l,offset:r};r-=t}else if(l instanceof HTMLElement&&"false"===l.getAttribute("contenteditable")){if(0===r){const t=l.parentNode;if(t)return{node:t,offset:Q(t,l)}}r-=1}l=i.nextNode()}const c=o.lastChild;return c?c.nodeType===Node.TEXT_NODE?{node:c,offset:c.textContent?.length??0}:{node:o,offset:o.childNodes.length}:{node:o,offset:0}}function W(t,n,e){const o=u(t,n);if(!o)return null;const r=o.getAttribute("data-block-id");if(!r)return null;const i=f(r),c=d(t,o),s=G(o);if(n===o||n===s){const t=n===s?s:o;let r=0,a=0;for(const n of Array.from(t.childNodes)){if(a>=e)break;r+=J(n),a++}return l(i,r,c.length>1?c:void 0)}if(s!==o&&!s.contains(n))return l(i,0,c.length>1?c:void 0);let a=0;const h=K(s);let m=h.nextNode();for(;m;){if(m===n)return m.nodeType===Node.TEXT_NODE?l(i,a+e,c.length>1?c:void 0):l(i,a,c.length>1?c:void 0);m.nodeType===Node.TEXT_NODE?a+=m.textContent?.length??0:m instanceof HTMLElement&&"false"===m.getAttribute("contenteditable")&&(a+=1),m=h.nextNode()}if(n.nodeType===Node.ELEMENT_NODE){const t=function(t,n){let e=0,o=0;for(const r of Array.from(t.childNodes)){if(o>=n)break;e+=J(r),o++}return e}(n,e),o=function(t,n){let e=0,o=n;for(;o&&o!==t;){const t=o.parentNode;if(!t)return null;for(const n of Array.from(t.childNodes)){if(n===o)break;e+=J(n)}o=t}return o===t?e:null}(s,n);return l(i,null===o?t:o+t,c.length>1?c:void 0)}return l(i,0,c.length>1?c:void 0)}function K(t){return document.createTreeWalker(t,NodeFilter.SHOW_ALL,{acceptNode:n=>n instanceof HTMLElement&&n.hasAttribute("data-cursor-wrapper")||function(t,n){let e=t.parentNode;for(;e&&e!==n;){if(e instanceof HTMLElement&&"false"===e.getAttribute("contenteditable"))return!0;e=e.parentNode}return!1}(n,t)||n instanceof HTMLElement&&n.hasAttribute("data-block-id")&&n!==t?NodeFilter.FILTER_REJECT:n.nodeType===Node.TEXT_NODE||n instanceof HTMLElement&&"false"===n.getAttribute("contenteditable")?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP})}function Q(t,n){let e=0;for(const o of Array.from(t.childNodes)){if(o===n)return e;e++}return e}function G(t){return t.querySelector("[data-content-dom]")??t}function J(t){if(t.nodeType===Node.TEXT_NODE)return t.textContent?.length??0;if(t instanceof HTMLElement&&"false"===t.getAttribute("contenteditable"))return 1;let n=0;for(const e of Array.from(t.childNodes))n+=J(e);return n}function Y(t,n,e,r){const i=n.selection;if(!a(i))return!1;if(!s(i))return!1;const l=n.getBlock(i.anchor.blockId);if(!l)return!1;const c=i.anchor.offset,f=o(l),d=t.querySelector(`[data-block-id="${i.anchor.blockId}"]`),h=d instanceof HTMLElement&&"rtl"===v(d);if("left"===e)return h?c===f:0===c;if("right"===e)return h?0===c:c===f;if("up"===e&&0===c)return!0;if("down"===e&&c===f)return!0;const m=P();return m&&m.modify?function(t,n,e,o){const r=z(t,n);if(!r)return!1;const i=o??et(n),l="up"===e?"backward":"forward";try{n.modify("move",l,"line");const e=z(t,n);if(!e)return!1;if(u(t,r.focusNode)!==u(t,e.focusNode))return!0;if(e.anchorNode===r.anchorNode&&e.anchorOffset===r.anchorOffset&&e.focusNode===r.focusNode&&e.focusOffset===r.focusOffset)return!0;if(i){const t=et(n);if(t&&Math.abs(t.top-i.top)<1)return!0}return!1}finally{try{n.setBaseAndExtent(r.anchorNode,r.anchorOffset,r.focusNode,r.focusOffset)}catch{}}}(t,m,e,r):"up"===e?0===c:c===f}function Z(t,n){const e=ot(t,n);if(!e)return null;if(e.isVoid)return h(t,e.targetId);const r=t.getBlock(e.targetId);if(!r)return null;const i="right"===n||"down"===n?0:o(r);return g(t,e.targetId,i)}function tt(t,n,e,r){const i=ot(n,e);if(!i)return null;if(i.isVoid)return h(n,i.targetId);const l=n.getBlock(i.targetId);if(!l)return null;const c=o(l);if(null!==r){const o=function(t,n,e,o){const r=t.querySelector(`[data-block-id="${n}"]`);if(!r)return null;const i=r.getBoundingClientRect(),l="down"===e?i.top+2:i.bottom-2,c=Math.min(Math.max(o,i.left),i.right-1),s=F(t.getRootNode(),c,l,t.ownerDocument);if(!s)return null;if(!r.contains(s.node))return null;const a=W(t,s.node,s.offset);return a?a.blockId!==n?null:a:null}(t,i.targetId,e,r);if(o)return g(n,o.blockId,o.offset)}const s="down"===e?0:c;return g(n,i.targetId,s)}function nt(n,e){if("up"===e||"down"===e)return null;const o=n.selection;if(!a(o))return null;if(!s(o))return null;const r=o.anchor.blockId,i=n.getBlock(r);if(!i)return null;const l=o.anchor.offset;return"right"===e?function(n,e,o,r){const i=t(o,r);return i&&"inline"===i.kind?g(n,e,r+1):null}(n,r,i,l):function(n,e,o,r){if(0===r)return null;const i=t(o,r-1);return i&&"inline"===i.kind?g(n,e,r-1):null}(n,r,i,l)}function et(t){if(0===t.rangeCount)return null;const n=t.getRangeAt(0),e=n.getClientRects();return e.length>0?e[0]??null:n.getBoundingClientRect()}function ot(t,n){const e=t.getBlockOrder(),o=t.selection;if(!a(o))return null;const r=e.indexOf(o.anchor.blockId);if(r<0)return null;const i="left"===n||"up"===n?r-1:r+1;if(i<0||i>=e.length)return null;const l=e[i];return l&&w(t,o.anchor.blockId,l)?{targetId:l,isVoid:k(t,l)}:null}function rt(t,n,e,o){return lt(t,n,"move",e,o)}function it(t,n,e,o){return lt(t,n,"extend",e,o)}function lt(n,e,r,i,l){const c=e.selection;if(!a(c))return null;const s="move"===r?ct:st,f=P();if(!f?.modify)return s(e,i,l);const u=z(n,f);if(!u)return s(e,i,l);try{f.modify(r,i,l);const s=X(n);if(!s)return null;const a="move"===r?c.anchor.blockId:c.head.blockId,u="move"===r?s.anchor:s.head,d=u.blockId;if(d!==a&&!w(e,a,d))return null;let b=u.offset;const I=e.getBlock(d);return I&&"inline"===t(I,b)?.kind&&"forward"===i&&(b=Math.min(b+1,o(I))),"move"===r?k(e,d)?h(e,d):g(e,d,b):m(e,c.anchor.blockId,c.anchor.offset,d,b)}finally{try{f.setBaseAndExtent(u.anchorNode,u.anchorOffset,u.focusNode,u.focusOffset)}catch{}}}function ct(t,n,e){return"word"===e?function(t,n){const e=t.selection;if(!a(e))return null;const r=s(e)?e.anchor.blockId:e.head.blockId,i=s(e)?e.anchor.offset:e.head.offset,l=t.getBlock(r);if(!l)return null;const c="forward"===n?b(l,i):I(l,i);return c===i?function(t,n,e){const r=t.getBlockOrder(),i=r.indexOf(n),l="forward"===e?i+1:i-1;if(l<0||l>=r.length)return null;const c=r[l];if(!c)return null;if(!w(t,n,c))return null;if(k(t,c))return h(t,c);const s=t.getBlock(c);return s?g(t,c,"forward"===e?0:o(s)):null}(t,r,n):g(t,r,c)}(t,n):"lineboundary"===e?"forward"===n?E(t):A(t):Z(t,"forward"===n?"down":"up")}function st(t,n,e){const r=t.selection;if(!a(r))return null;const i=r.head,l=t.getBlock(i.blockId);if(!l)return null;let c=i.offset;if("word"===e)c="forward"===n?b(l,i.offset):I(l,i.offset);else{if("lineboundary"!==e){const e=t.getBlockOrder(),l=e.indexOf(i.blockId),c="forward"===n?l+1:l-1;if(c<0||c>=e.length)return null;const s=e[c];if(!s)return null;if(!w(t,i.blockId,s))return null;if(k(t,s))return null;const a=t.getBlock(s);if(!a)return null;const f="forward"===n?0:o(a);return m(t,r.anchor.blockId,r.anchor.offset,s,f)}c="forward"===n?o(l):0}return m(t,r.anchor.blockId,r.anchor.offset,i.blockId,c)}function at(t,n){return rt(t,n,"forward","word")}function ft(t,n){return rt(t,n,"backward","word")}function ut(t,n){return rt(t,n,"backward","lineboundary")}function dt(t,n){return rt(t,n,"forward","lineboundary")}function ht(t,n){return rt(t,n,"backward","line")}function mt(t,n){return rt(t,n,"forward","line")}function gt(t,n){return it(t,n,"forward","word")}function kt(t,n){return it(t,n,"backward","word")}function wt(t,n){return it(t,n,"backward","lineboundary")}function bt(t,n){return it(t,n,"forward","lineboundary")}function It(t,n){return it(t,n,"backward","line")}function pt(t,n){return it(t,n,"forward","line")}var vt={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"},yt={paragraph:"paragraph",code_block:"codeBlock",blockquote:"blockquote",list_item:"listItem",horizontal_rule:"horizontalRule",image:"image",table:"table"},Nt=/* @__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-BhVHv8Lx.mjs"),"./locales/de.ts":()=>import("./de-DKNvYM_G.mjs"),"./locales/es.ts":()=>import("./es-BUP1scLX.mjs"),"./locales/fr.ts":()=>import("./fr-Cz2qWiuV.mjs"),"./locales/hi.ts":()=>import("./hi-CBODdhOq.mjs"),"./locales/pt.ts":()=>import("./pt-P914L5AX.mjs"),"./locales/ru.ts":()=>import("./ru-wVOlNily.mjs"),"./locales/zh.ts":()=>import("./zh-C2z0g7OC.mjs")});async function xt(t){if("en"===t)return vt;const n=Nt[`./locales/${t}.ts`];if(!n)return vt;try{return(await n()).default}catch{return vt}}var Ct={"word:forward":at,"word:backward":ft,"lineboundary:forward":dt,"lineboundary:backward":ut,"line:forward":mt,"line:backward":ht},At={"word:forward":gt,"word:backward":kt,"lineboundary:forward":bt,"lineboundary:backward":wt,"line:forward":pt,"line:backward":It},Et=class{id="caret-navigation";name="Caret Navigation";priority=4;context=null;lastAnnouncedBlockId=null;announceTimer=null;announce=null;locale=vt;async init(t){this.locale=await y(t,void 0,vt,xt),this.context=t,this.announce=n=>t.announce(n);const n=p(),e={"Shift-ArrowRight":()=>this.extendCharacterVisual("right"),"Shift-ArrowLeft":()=>this.extendCharacterVisual("left"),"Shift-ArrowUp":()=>this.viewExtendCommand("backward","line"),"Shift-ArrowDown":()=>this.viewExtendCommand("forward","line"),...n?{"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")},...n?{"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")},...n?{"Mod-ArrowUp":()=>this.modelCommand(S),"Mod-ArrowDown":()=>this.modelCommand(R),"Mod-Shift-ArrowUp":()=>this.modelCommand(D),"Mod-Shift-ArrowDown":()=>this.modelCommand(_)}:{"Mod-Home":()=>this.modelCommand(S),"Mod-End":()=>this.modelCommand(R),"Mod-Shift-Home":()=>this.modelCommand(D),"Mod-Shift-End":()=>this.modelCommand(_)}};t.registerKeymap(e,{priority:"navigation"})}onStateChange(t,n,e){const o=n.selection;if(!s(o)||!a(o))return null!==this.announceTimer&&(clearTimeout(this.announceTimer),this.announceTimer=null),void(this.lastAnnouncedBlockId=null);const r=o.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 t=n.getBlock(r);if(!t)return;const e=function(t,n,e){if("heading"===n&&e?.level){const n=`heading${e.level}`;if(n in t)return t[n]}const o=yt[n];return o?t[o]:n}(this.locale,t.type,t.attrs);this.announce?.(e)},150)):this.lastAnnouncedBlockId=r)}destroy(){null!==this.announceTimer&&clearTimeout(this.announceTimer),this.announceTimer=null,this.announce=null,this.context=null}modelCommand(t){if(!this.context)return!1;const n=t(this.context.getState());return!!n&&(this.context.dispatch(n),!0)}extendCharacterVisual(t){if(!this.context)return!1;const n=this.context.getState(),e="forward"===this.resolveLogicalHorizontalDirection(n,t)?L(n):H(n);return!!e&&(this.context.dispatch(e),!0)}viewMoveCommand(t,n){return this.dispatchViewCommand(Ct,t,n)}viewMoveVisual(t,n){if(!this.context)return!1;const e=this.resolveLogicalHorizontalDirection(this.context.getState(),t);return this.viewMoveCommand(e,n)}viewExtendCommand(t,n){return this.dispatchViewCommand(At,t,n)}dispatchViewCommand(t,n,e){if(!this.context)return!1;const o=t[`${e}:${n}`];if(!o)return!1;const r=o(this.context.getContainer(),this.context.getState());return!!r&&(this.context.dispatch(r),!0)}viewExtendVisual(t,n){if(!this.context)return!1;const e=this.resolveLogicalHorizontalDirection(this.context.getState(),t);return this.viewExtendCommand(e,n)}resolveLogicalHorizontalDirection(t,n){const e=t.selection;if(!a(e))return"left"===n?"backward":"forward";const o=this.context?.getContainer();if(!o)return"left"===n?"backward":"forward";const r=o.querySelector(`[data-block-id="${e.head.blockId}"]`);return r instanceof HTMLElement&&"rtl"===v(r)?"left"===n?"forward":"backward":"left"===n?"backward":"forward"}};export{L as A,A as B,W as C,$ as D,X as E,M as F,C as H,O as I,R as L,V as M,_ as N,F as O,D as P,S as R,nt as S,q as T,x as V,rt as _,It as a,Z as b,kt as c,ht as d,dt as f,it as g,at as h,pt as i,j,H as k,gt as l,ft as m,vt as n,bt as o,ut as p,xt as r,wt as s,Et as t,mt as u,Y as v,P as w,tt as x,et as y,E as z};
2
+ //# sourceMappingURL=CaretNavigationPlugin-4EaHvYXR.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CaretNavigationPlugin-4EaHvYXR.mjs","names":[],"sources":["../../src/model/GraphemeUtils.ts","../../src/state/BlockBoundaryMovement.ts","../../src/commands/MovementCommands.ts","../../src/view/DomPointUtils.ts","../../src/view/SelectionSync.ts","../../src/view/CaretNavigation.ts","../../src/view/ViewMovementCommands.ts","../../src/plugins/caret-navigation/CaretNavigationLocale.ts","../../src/plugins/caret-navigation/CaretNavigationPlugin.ts"],"sourcesContent":["/**\n * Grapheme-cluster utilities for correct character navigation.\n *\n * Uses `Intl.Segmenter` (with `granularity: 'grapheme'`) to correctly\n * handle multi-code-unit characters such as emoji, ZWJ sequences, and\n * combining characters. Falls back to +1/-1 when `Intl.Segmenter` is\n * not available.\n */\n\nconst SEGMENTER_SUPPORTED: boolean = typeof Intl !== 'undefined' && 'Segmenter' in Intl;\nconst SEGMENTER: Intl.Segmenter | null = SEGMENTER_SUPPORTED\n\t? new Intl.Segmenter(undefined, { granularity: 'grapheme' })\n\t: null;\n\n/**\n * Returns the number of UTF-16 code units in the next grapheme cluster\n * starting at `offset`. Returns 0 if `offset` is at or past the end.\n */\nexport function nextGraphemeSize(text: string, offset: number): number {\n\tif (offset >= text.length || text.length === 0) return 0;\n\n\tif (SEGMENTER) {\n\t\tfor (const segment of SEGMENTER.segment(text)) {\n\t\t\tif (segment.index >= offset) {\n\t\t\t\treturn segment.segment.length;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\n\treturn 1;\n}\n\n/**\n * Returns the number of UTF-16 code units in the grapheme cluster\n * immediately before `offset`. Returns 0 if `offset` is 0 or the\n * string is empty.\n */\nexport function prevGraphemeSize(text: string, offset: number): number {\n\tif (offset <= 0 || text.length === 0) return 0;\n\n\tif (SEGMENTER) {\n\t\tlet lastSize = 1;\n\t\tfor (const segment of SEGMENTER.segment(text)) {\n\t\t\tif (segment.index + segment.segment.length >= offset) {\n\t\t\t\tlastSize = segment.segment.length;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tlastSize = segment.segment.length;\n\t\t}\n\t\treturn lastSize;\n\t}\n\n\treturn 1;\n}\n","/**\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 * Resolves a DOM position from screen coordinates using the best available API.\n *\n * Tries `caretPositionFromPoint` first (standard), then `caretRangeFromPoint`\n * (WebKit fallback), and finally tries the ownerDocument when the root is\n * a ShadowRoot and the first two returned nothing.\n */\nexport function domPositionFromPoint(\n\troot: Document | ShadowRoot,\n\tx: number,\n\ty: number,\n\townerDoc?: Document,\n): DomPoint | null {\n\tlet domNode: Node | null = null;\n\tlet domOffset = 0;\n\n\t// Standard API\n\tif ('caretPositionFromPoint' in root) {\n\t\tconst cp = (root as Document).caretPositionFromPoint(x, y);\n\t\tif (cp) {\n\t\t\tdomNode = cp.offsetNode;\n\t\t\tdomOffset = cp.offset;\n\t\t}\n\t}\n\n\t// Fallback\n\tif (!domNode && 'caretRangeFromPoint' in root) {\n\t\tconst range = (root as Document).caretRangeFromPoint(x, y);\n\t\tif (range) {\n\t\t\tdomNode = range.startContainer;\n\t\t\tdomOffset = range.startOffset;\n\t\t}\n\t}\n\n\t// Also try on the document when the root is a ShadowRoot and returned nothing\n\tif (!domNode && ownerDoc && root !== ownerDoc) {\n\t\tif ('caretRangeFromPoint' in ownerDoc) {\n\t\t\tconst range = ownerDoc.caretRangeFromPoint(x, y);\n\t\t\tif (range) {\n\t\t\t\tdomNode = range.startContainer;\n\t\t\t\tdomOffset = range.startOffset;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (!domNode) return null;\n\treturn { node: domNode, offset: domOffset };\n}\n","/**\n * Selection synchronization between editor state and DOM.\n */\n\nimport type { EditorSelection, Position, Selection } from '../model/Selection.js';\nimport {\n\tcreatePosition,\n\tcreateSelection,\n\tisGapCursor,\n\tisNodeSelection,\n} from '../model/Selection.js';\nimport { blockId as toBlockId } from '../model/TypeBrands.js';\nimport { buildBlockPath, findBlockAncestor } from './DomUtils.js';\n\ninterface DOMPosition {\n\tnode: Node;\n\toffset: number;\n}\n\n/** Gets the selection object for writing (collapse, setBaseAndExtent). */\nexport function getSelection(): globalThis.Selection | null {\n\treturn window.getSelection();\n}\n\n/**\n * Endpoints returned by reading selection via getComposedRanges().\n * Used to correctly read selection inside Shadow DOM on Safari 17+,\n * Chrome 137+, and Firefox 142+.\n */\nexport interface SelectionEndpoints {\n\tanchorNode: Node;\n\tanchorOffset: number;\n\tfocusNode: Node;\n\tfocusOffset: number;\n}\n\n/**\n * Reads the selection endpoints using getComposedRanges() when inside a\n * Shadow DOM. Returns null if not in a shadow root or the API is unavailable.\n *\n * Handles two call signatures:\n * - Modern (Chrome 137+, Firefox 142+): sel.getComposedRanges({ shadowRoots: [root] })\n * - Legacy (Safari 17+): sel.getComposedRanges(root)\n *\n * StaticRange always uses document order. When `Selection.direction` is\n * `\"backward\"`, anchor/focus are swapped to reconstruct the correct\n * directional endpoints. When direction is `\"none\"` or absent the\n * forward (document-order) mapping is used.\n *\n * Note: Safari 17–18 supports getComposedRanges but not\n * Selection.direction — backward selections will be read as forward.\n */\nexport function readComposedSelection(\n\tcontainer: HTMLElement,\n\tsel: globalThis.Selection,\n): SelectionEndpoints | null {\n\tconst root = container.getRootNode();\n\tif (!(root instanceof ShadowRoot)) return null;\n\tif (!('getComposedRanges' in sel)) return null;\n\n\tlet ranges: StaticRange[];\n\ttry {\n\t\t// Modern syntax (Chrome 137+, Firefox 142+)\n\t\tranges = (\n\t\t\tsel as unknown as {\n\t\t\t\tgetComposedRanges(opts: { shadowRoots: ShadowRoot[] }): StaticRange[];\n\t\t\t}\n\t\t).getComposedRanges({ shadowRoots: [root] });\n\t} catch {\n\t\ttry {\n\t\t\t// Legacy syntax (Safari 17+)\n\t\t\tranges = (\n\t\t\t\tsel as unknown as {\n\t\t\t\t\tgetComposedRanges(...roots: ShadowRoot[]): StaticRange[];\n\t\t\t\t}\n\t\t\t).getComposedRanges(root);\n\t\t} catch {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tconst range = ranges[0];\n\tif (!range) return null;\n\n\tconst isBackward: boolean =\n\t\t'direction' in sel && (sel as unknown as { direction: string }).direction === 'backward';\n\n\treturn {\n\t\tanchorNode: isBackward ? range.endContainer : range.startContainer,\n\t\tanchorOffset: isBackward ? range.endOffset : range.startOffset,\n\t\tfocusNode: isBackward ? range.startContainer : range.endContainer,\n\t\tfocusOffset: isBackward ? range.startOffset : range.endOffset,\n\t};\n}\n\n/**\n * Reads the DOM selection endpoints, preferring `getComposedRanges()` when\n * the container is inside a Shadow DOM.\n *\n * Returns `null` when `anchorNode` is unavailable (no selection).\n *\n * In Shadow DOM mode the endpoints come from a `StaticRange` which uses\n * document order. `Selection.direction` is used to reconstruct anchor/focus\n * for backward selections.\n */\nexport function readDOMSelectionEndpoints(\n\tcontainer: HTMLElement,\n\tdomSel: globalThis.Selection,\n): SelectionEndpoints | null {\n\tconst composed: SelectionEndpoints | null = readComposedSelection(container, domSel);\n\tif (composed) return composed;\n\n\tconst anchorNode: Node | null = domSel.anchorNode;\n\tif (!anchorNode) return null;\n\tconst focusNode: Node | null = domSel.focusNode;\n\tif (!focusNode) return null;\n\n\treturn {\n\t\tanchorNode,\n\t\tanchorOffset: domSel.anchorOffset,\n\t\tfocusNode,\n\t\tfocusOffset: domSel.focusOffset,\n\t};\n}\n\n/** Syncs the editor state selection to the DOM. */\nexport function syncSelectionToDOM(container: HTMLElement, selection: EditorSelection): void {\n\tconst domSel = getSelection();\n\tif (!domSel) return;\n\n\t// GapCursor: clear browser selection (gap cursor has no DOM equivalent)\n\tif (isGapCursor(selection)) {\n\t\tdomSel.removeAllRanges();\n\t\treturn;\n\t}\n\n\t// NodeSelection: select the entire block element\n\tif (isNodeSelection(selection)) {\n\t\tconst blockEl = container.querySelector(`[data-block-id=\"${selection.nodeId}\"]`);\n\t\tif (!blockEl) return;\n\t\tconst parent = blockEl.parentNode;\n\t\tif (!parent) return;\n\t\tconst childIdx = childIndexOf(parent, blockEl);\n\t\ttry {\n\t\t\tdomSel.setBaseAndExtent(parent, childIdx, parent, childIdx + 1);\n\t\t} catch {\n\t\t\t// Selection may fail if DOM is not yet rendered\n\t\t}\n\t\treturn;\n\t}\n\n\tconst anchorPos = statePositionToDOM(container, selection.anchor);\n\tconst headPos = statePositionToDOM(container, selection.head);\n\n\tif (!anchorPos || !headPos) return;\n\n\ttry {\n\t\tdomSel.setBaseAndExtent(anchorPos.node, anchorPos.offset, headPos.node, headPos.offset);\n\t} catch {\n\t\t// Selection may fail if DOM is not yet rendered\n\t}\n}\n\n/** Reads the current DOM selection and converts it to a state selection. */\nexport function readSelectionFromDOM(container: HTMLElement): Selection | null {\n\tconst domSel = getSelection();\n\tif (!domSel || domSel.rangeCount === 0) return null;\n\n\tconst endpoints: SelectionEndpoints | null = readDOMSelectionEndpoints(container, domSel);\n\tif (!endpoints) return null;\n\n\tif (!container.contains(endpoints.anchorNode) || !container.contains(endpoints.focusNode)) {\n\t\treturn null;\n\t}\n\n\tconst anchor = domPositionToState(container, endpoints.anchorNode, endpoints.anchorOffset);\n\tconst head = domPositionToState(container, endpoints.focusNode, endpoints.focusOffset);\n\n\tif (!anchor || !head) return null;\n\n\treturn createSelection(anchor, head);\n}\n\n/** Converts a state position (blockId + offset) to a DOM position (node + offset). */\nfunction statePositionToDOM(container: HTMLElement, pos: Position): DOMPosition | null {\n\t// If path is available, navigate directly to the leaf block\n\tlet blockEl: Element | null = null;\n\tif (pos.path && pos.path.length > 0) {\n\t\tlet current: Element = container;\n\t\tfor (const id of pos.path) {\n\t\t\tconst found = current.querySelector(`:scope [data-block-id=\"${id}\"]`);\n\t\t\tif (!found) break;\n\t\t\tcurrent = found;\n\t\t}\n\t\tif (current !== container && current.getAttribute('data-block-id') === pos.blockId) {\n\t\t\tblockEl = current;\n\t\t}\n\t}\n\tblockEl ??= container.querySelector(`[data-block-id=\"${pos.blockId}\"]`);\n\tif (!blockEl) return null;\n\n\t// Use contentDOM if available (NodeView blocks like code_block)\n\tconst contentEl: Element = resolveContentRoot(blockEl);\n\n\t// Handle empty paragraphs with <br>\n\tif (contentEl.childNodes.length === 1 && contentEl.firstChild?.nodeName === 'BR') {\n\t\treturn { node: contentEl, offset: 0 };\n\t}\n\n\t// Walk through text nodes and inline elements to find the correct position\n\tlet remaining = pos.offset;\n\tconst walker = createInlineContentWalker(contentEl);\n\n\tlet current = walker.nextNode();\n\twhile (current) {\n\t\tif (current.nodeType === Node.TEXT_NODE) {\n\t\t\tconst len = current.textContent?.length ?? 0;\n\t\t\tif (remaining <= len) {\n\t\t\t\treturn { node: current, offset: remaining };\n\t\t\t}\n\t\t\tremaining -= len;\n\t\t} else if (\n\t\t\tcurrent instanceof HTMLElement &&\n\t\t\tcurrent.getAttribute('contenteditable') === 'false'\n\t\t) {\n\t\t\t// InlineNode element — width 1 in state offset space\n\t\t\tif (remaining === 0) {\n\t\t\t\t// Position before this inline element\n\t\t\t\tconst parent = current.parentNode;\n\t\t\t\tif (parent) {\n\t\t\t\t\tconst childIndex = childIndexOf(parent, current);\n\t\t\t\t\treturn { node: parent, offset: childIndex };\n\t\t\t\t}\n\t\t\t}\n\t\t\tremaining -= 1;\n\t\t}\n\t\tcurrent = walker.nextNode();\n\t}\n\n\t// Fallback: position at end of block\n\tconst lastChild = contentEl.lastChild;\n\tif (lastChild) {\n\t\tif (lastChild.nodeType === Node.TEXT_NODE) {\n\t\t\treturn { node: lastChild, offset: lastChild.textContent?.length ?? 0 };\n\t\t}\n\t\treturn { node: contentEl, offset: contentEl.childNodes.length };\n\t}\n\n\treturn { node: contentEl, offset: 0 };\n}\n\n/** Converts a DOM position to a state position, including nested path. */\nexport function domPositionToState(\n\tcontainer: HTMLElement,\n\tnode: Node,\n\tdomOffset: number,\n): Position | null {\n\t// Find the innermost block element\n\tconst blockEl = findBlockAncestor(container, node);\n\tif (!blockEl) return null;\n\n\tconst rawBlockId = blockEl.getAttribute('data-block-id');\n\tif (!rawBlockId) return null;\n\tconst bid = toBlockId(rawBlockId);\n\n\t// Build path by collecting all data-block-id ancestors from leaf to root\n\tconst path = buildBlockPath(container, blockEl);\n\n\t// Use contentDOM if available (NodeView blocks like code_block)\n\tconst contentEl: Element = resolveContentRoot(blockEl);\n\n\t// Handle clicks on the block or content element itself (e.g. empty paragraph with <br>)\n\tif (node === blockEl || node === contentEl) {\n\t\tconst targetEl: Element = node === contentEl ? contentEl : blockEl;\n\t\tlet childOffset = 0;\n\t\tlet childIdx = 0;\n\t\tfor (const child of Array.from(targetEl.childNodes)) {\n\t\t\tif (childIdx >= domOffset) break;\n\t\t\tchildOffset += inlineContentWidth(child);\n\t\t\tchildIdx++;\n\t\t}\n\t\treturn createPosition(bid, childOffset, path.length > 1 ? path : undefined);\n\t}\n\n\t// If node is outside the contentDOM (e.g. in NodeView header), map to offset 0\n\tif (contentEl !== blockEl && !contentEl.contains(node)) {\n\t\treturn createPosition(bid, 0, path.length > 1 ? path : undefined);\n\t}\n\n\t// Calculate offset by walking text nodes and inline elements\n\tlet offset = 0;\n\tconst walker = createInlineContentWalker(contentEl);\n\n\tlet walkerNode = walker.nextNode();\n\twhile (walkerNode) {\n\t\tif (walkerNode === node) {\n\t\t\tif (walkerNode.nodeType === Node.TEXT_NODE) {\n\t\t\t\treturn createPosition(bid, offset + domOffset, path.length > 1 ? path : undefined);\n\t\t\t}\n\t\t\t// Node is an inline element — return offset at its start\n\t\t\treturn createPosition(bid, offset, path.length > 1 ? path : undefined);\n\t\t}\n\t\tif (walkerNode.nodeType === Node.TEXT_NODE) {\n\t\t\toffset += walkerNode.textContent?.length ?? 0;\n\t\t} else if (\n\t\t\twalkerNode instanceof HTMLElement &&\n\t\t\twalkerNode.getAttribute('contenteditable') === 'false'\n\t\t) {\n\t\t\toffset += 1;\n\t\t}\n\t\twalkerNode = walker.nextNode();\n\t}\n\n\t// If the node is not a text node, try to find the offset from element context\n\tif (node.nodeType === Node.ELEMENT_NODE) {\n\t\tconst childOffset = inlineOffsetForChildIndex(node, domOffset);\n\t\tconst offsetBeforeNode = inlineOffsetBeforeNode(contentEl, node);\n\t\tconst totalOffset = offsetBeforeNode === null ? childOffset : offsetBeforeNode + childOffset;\n\t\treturn createPosition(bid, totalOffset, path.length > 1 ? path : undefined);\n\t}\n\n\treturn createPosition(bid, 0, path.length > 1 ? path : undefined);\n}\n\n/** Counts inline width for the first `childIndex` children of an element. */\nfunction inlineOffsetForChildIndex(node: Node, childIndex: number): number {\n\tlet childOffset = 0;\n\tlet childIdx = 0;\n\tfor (const child of Array.from(node.childNodes)) {\n\t\tif (childIdx >= childIndex) break;\n\t\tchildOffset += inlineContentWidth(child);\n\t\tchildIdx++;\n\t}\n\treturn childOffset;\n}\n\n/** Returns the inline offset from `root` to the start of `node`, or null when unrelated. */\nfunction inlineOffsetBeforeNode(root: Element, node: Node): number | null {\n\tlet offset = 0;\n\tlet current: Node | null = node;\n\n\twhile (current && current !== root) {\n\t\tconst parent: Node | null = current.parentNode;\n\t\tif (!parent) return null;\n\n\t\tfor (const sibling of Array.from(parent.childNodes) as Node[]) {\n\t\t\tif (sibling === current) break;\n\t\t\toffset += inlineContentWidth(sibling);\n\t\t}\n\n\t\tcurrent = parent;\n\t}\n\n\treturn current === root ? offset : null;\n}\n\n/** Checks if a node is inside a contentEditable=\"false\" inline element. */\nfunction isInsideInlineElement(node: Node, root: Element): boolean {\n\tlet parent: Node | null = node.parentNode;\n\twhile (parent && parent !== root) {\n\t\tif (parent instanceof HTMLElement && parent.getAttribute('contenteditable') === 'false') {\n\t\t\treturn true;\n\t\t}\n\t\tparent = parent.parentNode;\n\t}\n\treturn false;\n}\n\n/**\n * Creates a TreeWalker that visits text nodes and contentEditable=\"false\"\n * inline elements within a block, skipping mark wrappers and nested blocks.\n */\nfunction createInlineContentWalker(blockEl: Element): TreeWalker {\n\treturn document.createTreeWalker(blockEl, NodeFilter.SHOW_ALL, {\n\t\tacceptNode: (n: Node) => {\n\t\t\t// Skip cursor wrapper (ZWS for stored marks during IME composition)\n\t\t\tif (n instanceof HTMLElement && n.hasAttribute('data-cursor-wrapper')) {\n\t\t\t\treturn NodeFilter.FILTER_REJECT;\n\t\t\t}\n\t\t\t// Skip anything inside an inline element (contentEditable=\"false\")\n\t\t\tif (isInsideInlineElement(n, blockEl)) return NodeFilter.FILTER_REJECT;\n\t\t\t// Skip nested block elements and their descendants\n\t\t\tif (n instanceof HTMLElement && n.hasAttribute('data-block-id') && n !== blockEl) {\n\t\t\t\treturn NodeFilter.FILTER_REJECT;\n\t\t\t}\n\t\t\t// Accept text nodes\n\t\t\tif (n.nodeType === Node.TEXT_NODE) return NodeFilter.FILTER_ACCEPT;\n\t\t\t// Accept inline elements (contentEditable=\"false\")\n\t\t\tif (n instanceof HTMLElement && n.getAttribute('contenteditable') === 'false') {\n\t\t\t\treturn NodeFilter.FILTER_ACCEPT;\n\t\t\t}\n\t\t\t// Skip other elements (mark wrappers, decoration wrappers) — descend\n\t\t\treturn NodeFilter.FILTER_SKIP;\n\t\t},\n\t});\n}\n\n/** Returns the child index of a node within its parent. */\nfunction childIndexOf(parent: Node, child: Node): number {\n\tlet idx = 0;\n\tfor (const c of Array.from(parent.childNodes)) {\n\t\tif (c === child) return idx;\n\t\tidx++;\n\t}\n\treturn idx;\n}\n\n/**\n * Resolves the content root for inline content walking.\n * If the block element has a contentDOM (marked with data-content-dom),\n * returns it so the walker skips NodeView structural elements (headers, etc.).\n */\nfunction resolveContentRoot(blockEl: Element): Element {\n\tconst contentDOM: Element | null = blockEl.querySelector('[data-content-dom]');\n\treturn contentDOM ?? blockEl;\n}\n\n/** Counts the inline content width of a DOM node (text length + 1 per inline element). */\nfunction inlineContentWidth(node: Node): number {\n\tif (node.nodeType === Node.TEXT_NODE) {\n\t\treturn node.textContent?.length ?? 0;\n\t}\n\tif (node instanceof HTMLElement && node.getAttribute('contenteditable') === 'false') {\n\t\treturn 1;\n\t}\n\t// Mark wrapper or other element — sum children\n\tlet width = 0;\n\tfor (const child of Array.from(node.childNodes)) {\n\t\twidth += inlineContentWidth(child);\n\t}\n\treturn width;\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 type { EditorState } from '../state/EditorState.js';\nimport { canCrossBlockBoundary, isVoidBlock } 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';\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;\nimport { getTextDirection } from '../platform/Platform.js';\nimport type { SelectionEndpoints } from './SelectionSync.js';\nimport { domPositionToState, getSelection, readDOMSelectionEndpoints } from './SelectionSync.js';\n\nexport type CaretDirection = 'left' | 'right' | 'up' | 'down';\n\n/** Result of resolving the adjacent block for vertical navigation. */\ninterface NavigationTarget {\n\treadonly targetId: BlockId;\n\treadonly isVoid: boolean;\n}\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: NavigationTarget | 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: NavigationTarget | 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// 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/** Returns the bounding rect of the current caret position, or null. */\nexport function getCaretRectFromSelection(domSel: globalThis.Selection): DOMRect | null {\n\tif (domSel.rangeCount === 0) return null;\n\tconst range: Range = domSel.getRangeAt(0);\n\tconst rects: DOMRectList = range.getClientRects();\n\tif (rects.length > 0) return rects[0] ?? null;\n\treturn range.getBoundingClientRect();\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): NavigationTarget | null {\n\tconst blockOrder: readonly BlockId[] = state.getBlockOrder();\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return null;\n\n\tconst currentIdx: number = blockOrder.indexOf(sel.anchor.blockId);\n\tif (currentIdx < 0) return null;\n\n\tconst targetIdx: number =\n\t\tdirection === 'left' || direction === 'up' ? currentIdx - 1 : currentIdx + 1;\n\n\tif (targetIdx < 0 || targetIdx >= blockOrder.length) return null;\n\n\tconst targetId: BlockId | undefined = blockOrder[targetIdx];\n\tif (!targetId) return null;\n\n\tif (!canCrossBlockBoundary(state, sel.anchor.blockId, targetId)) return null;\n\n\treturn { targetId, isVoid: isVoidBlock(state, targetId) };\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\t// Small inset to ensure we hit inside the line, not on the border\n\tconst y: number =\n\t\tdirection === 'down' ? rect.top + BLOCK_EDGE_INSET_PX : rect.bottom - BLOCK_EDGE_INSET_PX;\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);\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);\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 { canCrossBlockBoundary, isVoidBlock } 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 blockOrder: readonly BlockId[] = state.getBlockOrder();\n\t\tconst idx: number = blockOrder.indexOf(head.blockId);\n\t\tconst targetIdx: number = direction === 'forward' ? idx + 1 : idx - 1;\n\n\t\tif (targetIdx < 0 || targetIdx >= blockOrder.length) return null;\n\n\t\tconst targetId: BlockId | undefined = blockOrder[targetIdx];\n\t\tif (!targetId) return null;\n\t\tif (!canCrossBlockBoundary(state, head.blockId, targetId)) return null;\n\n\t\tif (isVoidBlock(state, targetId)) {\n\t\t\t// Cannot extend a text selection into a void block\n\t\t\treturn null;\n\t\t}\n\n\t\tconst targetBlock = state.getBlock(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, 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 blockOrder: readonly BlockId[] = state.getBlockOrder();\n\tconst idx: number = blockOrder.indexOf(blockId);\n\tconst targetIdx: number = direction === 'forward' ? idx + 1 : idx - 1;\n\n\tif (targetIdx < 0 || targetIdx >= blockOrder.length) return null;\n\n\tconst targetId: BlockId | undefined = blockOrder[targetIdx];\n\tif (!targetId) return null;\n\tif (!canCrossBlockBoundary(state, blockId, targetId)) return null;\n\n\tif (isVoidBlock(state, targetId)) return nodeSelTx(state, targetId);\n\n\tconst targetBlock = state.getBlock(targetId);\n\tif (!targetBlock) return null;\n\n\tconst targetOffset: number = direction === 'forward' ? 0 : getBlockLength(targetBlock);\n\treturn moveTx(state, 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\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: Record<string, () => Promise<{ default: CaretNavigationLocale }>> =\n\timport.meta.glob<{ default: CaretNavigationLocale }>('./locales/*.ts', { eager: false });\n\nexport async function loadCaretNavigationLocale(lang: string): Promise<CaretNavigationLocale> {\n\tif (lang === 'en') return CARET_NAVIGATION_LOCALE_EN;\n\tconst loader = localeModules[`./locales/${lang}.ts`];\n\tif (!loader) return CARET_NAVIGATION_LOCALE_EN;\n\ttry {\n\t\tconst mod = await loader();\n\t\treturn mod.default;\n\t} catch {\n\t\treturn CARET_NAVIGATION_LOCALE_EN;\n\t}\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' : 'forward';\n\t\treturn visual === 'left' ? 'forward' : 'backward';\n\t}\n}\n"],"mappings":"ygBAUA,IAAM,EAD+C,oBAAT,MAAwB,cAAe,KAEhF,IAAI,KAAK,eAAU,EAAW,CAAE,YAAa,aAC7C,KAMH,SAAgB,EAAiB,EAAc,GAC9C,GAAI,GAAU,EAAK,QAA0B,IAAhB,EAAK,OAAc,OAAO,EAEvD,GAAI,EAAW,CACd,IAAK,MAAM,KAAW,EAAU,QAAQ,GACvC,GAAI,EAAQ,OAAS,EACpB,OAAO,EAAQ,QAAQ,OAGzB,OAAO,EAGR,OAAO,EAQR,SAAgB,EAAiB,EAAc,GAC9C,GAAI,GAAU,GAAqB,IAAhB,EAAK,OAAc,OAAO,EAE7C,GAAI,EAAW,CACd,IAAI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AAO,KAAK,kBAAkB,EAAK,GAOpC,iCAAA,CACC,EACA,GAEA,MAAM,EAAM,EAAM,UAClB,IAAK,EAAgB,GACpB,MAAkB,SAAX,EAAoB,WAAa,UAEzC,MAAM,EAAqC,KAAK,SAAS,eACzD,IAAK,EAAW,MAAkB,SAAX,EAAoB,WAAa,UACxD,MAAM,EAA0B,EAAU,cACzC,mBAAmB,EAAI,KAAK,aAG7B,OADuB,aAAmB,aAA6C,QAA9B,EAAiB,GAExD,SAAX,EAAoB,UAAY,WADT,SAAX,EAAoB,WAAa"}
@@ -0,0 +1,2 @@
1
+ import{h as t,p as e,s as o,u as n,x as c}from"./Document-CkQLx84k.mjs";import{o as r,t as l,u as a}from"./Selection-B14e7gd0.mjs";import{a as s}from"./TypeBrands-BQR8dEYU.mjs";import{n as i}from"./DomUtils-BkyCg-OO.mjs";import{r as d}from"./HTMLUtils-BLwp5G4f.mjs";import{s as u}from"./StyleRuntime-0yPPJK9H.mjs";import{i as g,l as p}from"./PluginHelpers-DLKHJWJn.mjs";import{i as h,r as k,t as b}from"./Decoration-6dhb8k3b.mjs";import{t as f}from"./ShortcutFormatting-DQPMvupx.mjs";import{n as m}from"./XmlPatterns-Ub8I1jdE.mjs";function y(t,e){const o=t.getState();if(!a(o.selection))return!1;const n=o.selection,c=o.getBlock(n.anchor.blockId);return!(!c||"code_block"!==c.type)&&e({state:o,block:c,blockId:n.anchor.blockId,offset:n.anchor.offset})}function C(t){return y(t,({state:e,blockId:o})=>{const n=e.getBlockOrder(),c=n.indexOf(o);if(c<n.length-1){const o=n[c+1],r=e.transaction("command").setSelection(l(o,0)).build();t.dispatch(r)}else x(t,o);return!0})}function x(t,e){const c=t.getState(),r=c.getBlock(e);if(!r)return;const a=n(r),i=o(),d=c.transaction("command").splitBlock(e,a,i).setBlockType(i,s("paragraph")).setSelection(l(i,0)).build();t.dispatch(d)}function B(e,o){const r=e.getState(),i=r.selection;if(!a(i))return!1;const d=r.getBlock(i.anchor.blockId);if(!d||"code_block"===d.type)return!1;const u={language:o.defaultLanguage??"",backgroundColor:""},g=r.transaction("command");return function(e,o){if(0===n(o))return;const r=t(o);let l=0;for(const t of r)if(c(t)){if(t.text.length>0)for(const n of t.marks)e.removeMark(o.id,l,l+t.text.length,n);l+=t.text.length}else l+=1}(g,d),g.setBlockType(i.anchor.blockId,s("code_block"),u).setSelection(l(i.anchor.blockId,0)),e.dispatch(g.build()),!0}var v={label:"Code Block",tooltip:t=>t?`Code Block (${t})`:"Code Block",enteredCodeBlock:"Entered code block. Press Escape to exit.",leftCodeBlock:"Left code block.",copyCodeAria:"Copy code",escToExit:"Esc to exit",codeBlockAriaLabel:t=>`${t} code block. Press Escape to exit.`,copiedToClipboard:"Copied to clipboard"},S=/* @__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-MHdV5PAO.mjs"),"./locales/de.ts":()=>import("./de-CNoAAJul.mjs"),"./locales/es.ts":()=>import("./es-C7xAs1yn.mjs"),"./locales/fr.ts":()=>import("./fr-C1Pak7kS.mjs"),"./locales/hi.ts":()=>import("./hi-DknCX8Nx.mjs"),"./locales/pt.ts":()=>import("./pt-DgzgCxdH.mjs"),"./locales/ru.ts":()=>import("./ru-DF0vhzeC.mjs"),"./locales/zh.ts":()=>import("./zh-giWyGMSZ.mjs")});async function w(t){if("en"===t)return v;const e=S[`./locales/${t}.ts`];if(!e)return v;try{return(await e()).default}catch{return v}}var _={insertAfter:"Mod-Enter",toggle:"Mod-Shift-M"},I={defaultLanguage:"",useSpaces:!1,spaceCount:2,showCopyButton:!0},A=new p("codeBlock"),L=new p("syntaxHighlighter");function T(t,e,o,n){const c=t.getState(),r=c.getBlock(e);if(!r||"code_block"!==r.type)return;const l=c.getNodePath(e);if(!l)return;const a={...r.attrs,[o]:n},s=c.transaction("command").setNodeAttr(l,a).build();t.dispatch(s)}var M=class{languageMap=/* @__PURE__ */new Map;constructor(t){if(t)for(const e of t)this.registerLanguageInternal(e)}registerLanguage(t){this.registerLanguageInternal(t)}tokenize(t,e){const o=this.languageMap.get(e.toLowerCase());if(!o)return[];const n=[];let c=0;for(;c<t.length;){let e=!1;for(const r of o.patterns){const o=r.pattern.exec(t.slice(c));if(o&&o[0].length>0){n.push({from:c,to:c+o[0].length,type:r.type}),c+=o[0].length,e=!0;break}}e||c++}return n}getSupportedLanguages(){const t=/* @__PURE__ */new Set;for(const e of this.languageMap.values()){t.add(e.name);for(const o of e.aliases)t.add(o)}return[...t]}registerLanguageInternal(t){this.languageMap.set(t.name.toLowerCase(),t);for(const e of t.aliases)this.languageMap.set(e.toLowerCase(),t)}},j={name:"json",aliases:["jsonc"],patterns:[{type:"property",pattern:/^"(?:[^"\\]|\\.)*"(?=\s*:)/},{type:"string",pattern:/^"(?:[^"\\]|\\.)*"/},{type:"number",pattern:/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?/},{type:"boolean",pattern:/^(?:true|false)\b/},{type:"null",pattern:/^null\b/},{type:"punctuation",pattern:/^[{}[\]:,]/}]},N={name:"xml",aliases:["html","xhtml","svg","xsl"],patterns:[{type:"comment",pattern:/^<!--[\s\S]*?-->/},{type:"keyword",pattern:/^<!\[CDATA\[[\s\S]*?\]\]>/},{type:"keyword",pattern:/^<\?[\s\S]*?\?>/},{type:"keyword",pattern:new RegExp(`^<\\/${m}`)},{type:"keyword",pattern:new RegExp(`^<${m}`)},{type:"punctuation",pattern:/^\/>|^>|^=/},{type:"property",pattern:new RegExp(`^${m}(?=\\s*=)`)},{type:"string",pattern:/^"[^"]*"/},{type:"string",pattern:/^'[^']*'/}]},E=class{id="code-block";name="Code Block";priority=36;config;resolvedKeymap;context=null;locale;highlighter=null;tokenCache=/* @__PURE__ */new Map;constructor(t){this.config={...I,...t},this.resolvedKeymap={..._,...t?.keymap}}async init(t){this.locale=await g(t,this.config.locale,v,w),t.registerStyleSheet("\n/* Code Block — uses theme custom properties */\n.notectl-code-block {\n\tposition: relative;\n\tmargin: 8px 0;\n\tborder-radius: 6px;\n\tbackground: var(--notectl-code-block-bg);\n\tcolor: var(--notectl-code-block-color);\n\tfont-family: 'SF Mono', 'Fira Code', 'Cascadia Code', Menlo, Consolas, monospace;\n\tfont-size: 14px;\n\tline-height: 1.5;\n\toverflow: hidden;\n}\n\n.notectl-code-block__header {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tpadding: 6px 12px;\n\tbackground: var(--notectl-code-block-header-bg);\n\tborder-bottom: 1px solid var(--notectl-code-block-header-border);\n\tfont-size: 12px;\n\tcolor: var(--notectl-code-block-header-color);\n\tuser-select: none;\n}\n\n.notectl-code-block__language {\n\tfont-weight: 500;\n\tletter-spacing: 0.02em;\n}\n\n.notectl-code-block__copy {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 24px;\n\theight: 24px;\n\tborder: none;\n\tborder-radius: 4px;\n\tbackground: transparent;\n\tcolor: var(--notectl-code-block-header-color);\n\tcursor: pointer;\n\tpadding: 0;\n\ttransition: background 0.15s, color 0.15s;\n}\n\n.notectl-code-block__copy:hover {\n\tbackground: rgba(128, 128, 128, 0.15);\n\tcolor: var(--notectl-code-block-color);\n}\n\n.notectl-code-block__copy svg {\n\tfill: currentColor;\n}\n\n.notectl-code-block__content {\n\tdisplay: block;\n\tpadding: 12px 16px;\n\twhite-space: pre-wrap;\n\tword-wrap: break-word;\n\ttab-size: 4;\n\t-moz-tab-size: 4;\n\toutline: none;\n\tmin-height: 1.5em;\n}\n\n.notectl-code-block--selected {\n\toutline: 2px solid var(--notectl-primary);\n\toutline-offset: 2px;\n}\n\n.notectl-code-block__esc-hint {\n\tdisplay: none;\n\tposition: absolute;\n\tbottom: 4px;\n\tinset-inline-end: 8px;\n\tfont-size: 11px;\n\tcolor: var(--notectl-code-block-header-color);\n\topacity: 0.5;\n\tpointer-events: none;\n\tuser-select: none;\n\tfont-family: system-ui, sans-serif;\n}\n\n.notectl-code-block--focused .notectl-code-block__esc-hint {\n\tdisplay: block;\n}\n\n/* Syntax highlighting token classes */\n.notectl-token--keyword { color: var(--notectl-code-token-keyword); }\n.notectl-token--string { color: var(--notectl-code-token-string); }\n.notectl-token--comment { color: var(--notectl-code-token-comment); font-style: italic; }\n.notectl-token--number { color: var(--notectl-code-token-number); }\n.notectl-token--function { color: var(--notectl-code-token-function); }\n.notectl-token--operator { color: var(--notectl-code-token-operator); }\n.notectl-token--punctuation { color: var(--notectl-code-token-punctuation); }\n.notectl-token--boolean { color: var(--notectl-code-token-boolean); }\n.notectl-token--null { color: var(--notectl-code-token-null); }\n.notectl-token--property { color: var(--notectl-code-token-property); }\n"),this.context=t,this.initHighlighter(),this.registerNodeSpec(t),this.registerNodeView(t),function(t,e){t.registerCommand("toggleCodeBlock",()=>function(t,e){const o=t.getState();if(!a(o.selection))return!1;const n=o.getBlock(o.selection.anchor.blockId);if(!n)return!1;if("code_block"===n.type){const e=o.transaction("command").setBlockType(o.selection.anchor.blockId,s("paragraph")).setSelection(o.selection).build();return t.dispatch(e),!0}return B(t,e)}(t,e)),t.registerCommand("insertCodeBlock",()=>B(t,e)),t.registerCommand("setCodeBlockLanguage",()=>!1),t.registerCommand("setCodeBlockBackground",()=>!1),t.registerCommand("exitCodeBlock",()=>C(t))}(t,this.config),function(t,c,a){const i={Enter:()=>function(t){return y(t,({state:n,block:c,blockId:a,offset:i})=>{if(!r(n.selection))return!1;const d=e(c);if(d.endsWith("\n")&&i===d.length)return function(t,e,n){const c=t.getState(),r=n.length-1,a=o(),i=c.transaction("input").deleteTextAt(e,r,n.length).splitBlock(e,r,a).setBlockType(a,s("paragraph")).setSelection(l(a,0)).build();return t.dispatch(i),!0}(t,a,d);const u=n.transaction("input").insertText(a,i,"\n",[]).setSelection(l(a,i+1)).build();return t.dispatch(u),!0})}(t),Backspace:()=>function(t){return y(t,({state:e,blockId:o,offset:n})=>{if(!r(e.selection))return!1;if(0!==n)return!1;const c=e.transaction("input").setBlockType(o,s("paragraph")).setSelection(e.selection).build();return t.dispatch(c),!0})}(t),Tab:()=>function(t,e){return y(t,({state:o,blockId:n,offset:c})=>{const r=e.useSpaces?" ".repeat(e.spaceCount??2):"\t",a=o.transaction("input").insertText(n,c,r,[]).setSelection(l(n,c+r.length)).build();return t.dispatch(a),!0})}(t,c),"Shift-Tab":()=>function(t,o){return y(t,({state:n,block:c,blockId:r,offset:a})=>{const s=e(c),i=s.lastIndexOf("\n",a-1)+1;if(o.useSpaces){const e=o.spaceCount??2;if(s.slice(i,i+e)===" ".repeat(e)){const o=n.transaction("input").deleteTextAt(r,i,i+e).setSelection(l(r,Math.max(i,a-e))).build();return t.dispatch(o),!0}}else if("\t"===s[i]){const e=n.transaction("input").deleteTextAt(r,i,i+1).setSelection(l(r,Math.max(i,a-1))).build();return t.dispatch(e),!0}return!0})}(t,c),Escape:()=>C(t),ArrowDown:()=>function(t){return y(t,({state:o,block:n,blockId:c,offset:a})=>{if(!r(o.selection))return!1;if(-1!==e(n).indexOf("\n",a))return!1;const s=o.getBlockOrder(),i=s.indexOf(c);if(i<s.length-1){const e=s[i+1],n=o.transaction("command").setSelection(l(e,0)).build();t.dispatch(n)}else x(t,c);return!0})}(t),ArrowUp:()=>function(t){return y(t,({state:o,block:c,blockId:a,offset:s})=>{if(!r(o.selection))return!1;const i=e(c).indexOf("\n");if(-1!==i&&s>i)return!1;const d=o.getBlockOrder(),u=d.indexOf(a);if(u>0){const e=d[u-1],c=o.getBlock(e),r=c?n(c):0,a=o.transaction("command").setSelection(l(e,r)).build();return t.dispatch(a),!0}return!1})}(t),ArrowRight:()=>function(t){return y(t,({state:o,block:n,blockId:c,offset:a})=>{if(!r(o.selection))return!1;if(a!==e(n).length)return!1;const s=o.getBlockOrder(),i=s.indexOf(c);if(i<s.length-1){const e=s[i+1],n=o.transaction("command").setSelection(l(e,0)).build();t.dispatch(n)}else x(t,c);return!0})}(t),ArrowLeft:()=>function(t){return y(t,({state:e,blockId:o,offset:c})=>{if(!r(e.selection))return!1;if(0!==c)return!1;const a=e.getBlockOrder(),s=a.indexOf(o);if(s>0){const o=a[s-1],c=e.getBlock(o),r=c?n(c):0,i=e.transaction("command").setSelection(l(o,r)).build();return t.dispatch(i),!0}return!1})}(t)},{insertAfter:d,toggle:u}=a;d&&(i[d]=()=>function(t){return y(t,({blockId:e})=>(x(t,e),!0))}(t)),u&&(i[u]=()=>t.executeCommand("toggleCodeBlock")),t.registerKeymap(i,{priority:"context"})}(t,this.config,this.resolvedKeymap),this.registerInputRule(t),this.registerToolbarItem(t),this.registerMiddleware(t),function(t,e,o){t.registerService(A,{setLanguage(e,o){T(t,e,"language",o)},getLanguage(t){const e=o();if(!e)return"";const n=e.getState().getBlock(t);return n&&"code_block"===n.type?n.attrs?.language??"":""},setBackground(e,o){T(t,e,"backgroundColor",o)},getBackground(t){const e=o();if(!e)return"";const n=e.getState().getBlock(t);return n&&"code_block"===n.type?n.attrs?.backgroundColor??"":""},isCodeBlock(t){const e=o();return!!e&&"code_block"===e.getState().getBlock(t)?.type},getSupportedLanguages:()=>e.highlighter?e.highlighter.getSupportedLanguages():[]})}(t,this.config,()=>this.context),this.registerSyntaxHighlighterService(t),this.patchTableCellContent(t)}destroy(){this.context=null,this.highlighter=null,this.tokenCache.clear()}onStateChange(t,e,o){if(!this.context)return;const n=a(t.selection)?t.selection.anchor.blockId:null,c=a(e.selection)?e.selection.anchor.blockId:null,r=n?t.getBlock(n):void 0,l=c?e.getBlock(c):void 0,s="code_block"===r?.type,i="code_block"===l?.type;!s&&i?this.context.announce(this.locale.enteredCodeBlock):s&&!i&&this.context.announce(this.locale.leftCodeBlock)}decorations(t){const o=[],n=this.getFocusedCodeBlockId(t);if(n&&o.push(h(n,{class:"notectl-code-block--focused"})),this.highlighter){const n=/* @__PURE__ */new Set;for(const c of t.getBlockOrder()){const r=t.getBlock(c);if(!r||"code_block"!==r.type)continue;const l=r.attrs?.language??"";if(!l)continue;const a=e(r);if(!a)continue;n.add(c);const s=this.getCachedTokens(c,a,l);for(const t of s)o.push(k(c,t.from,t.to,{class:`notectl-token--${t.type}`}))}for(const t of this.tokenCache.keys())n.has(t)||this.tokenCache.delete(t)}return 0===o.length?b.empty:b.create(o)}registerNodeSpec(t){t.registerNodeSpec({type:"code_block",group:"block",content:{allow:["text"]},selectable:!0,attrs:{language:{default:""},backgroundColor:{default:""}},toDOM(t){const e=i("pre",t.id);e.className="notectl-code-block",e.setAttribute("dir","ltr");const o=document.createElement("code");return o.className="notectl-code-block__content",e.appendChild(o),e},toHTML(t,e,o){const n=d(t.attrs?.language??""),c=d(t.attrs?.backgroundColor??""),r=n?` class="language-${n}"`:"";return`<pre dir="ltr"${c?o?.styleAttr(`background-color: ${c}`)??` style="background-color: ${c}"`:""}><code${r}>${e||""}</code></pre>`},parseHTML:[{tag:"pre",getAttrs(t){const e=t.querySelector("code"),o=e?.className.match(/language-(\S+)/)?.[1]??"";return{language:(e?.getAttribute("data-language")??"")||o}}}],sanitize:{tags:["pre","code"],attrs:["data-language","class","style"]}})}registerNodeView(t){t.registerNodeView("code_block",function(t,o=v){return(n,c,r)=>{const l=document.createElement("pre");l.className="notectl-code-block",l.setAttribute("data-block-id",n.id),l.setAttribute("dir","ltr"),l.setAttribute("role","group"),l.setAttribute("aria-roledescription","code block");const a=document.createElement("div");a.className="notectl-code-block__header",a.setAttribute("contenteditable","false");const s=document.createElement("span");s.className="notectl-code-block__language";let i=null;!1!==t.showCopyButton&&(i=document.createElement("button"),i.className="notectl-code-block__copy",i.setAttribute("aria-label",o.copyCodeAria),i.setAttribute("data-notectl-no-print",""),i.type="button",i.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="14" height="14"><path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"/></svg>');const d=document.createElement("span");d.className="notectl-sr-only",d.setAttribute("aria-live","assertive"),d.setAttribute("aria-atomic","true"),a.appendChild(s),i&&a.appendChild(i),a.appendChild(d);const g=document.createElement("code");g.className="notectl-code-block__content";const p=document.createElement("div");p.className="notectl-code-block__esc-hint",p.setAttribute("contenteditable","false"),p.setAttribute("aria-hidden","true"),p.setAttribute("data-notectl-no-print",""),p.textContent=o.escToExit,l.appendChild(a),l.appendChild(g),l.appendChild(p),t.background&&u(l,"--notectl-code-block-bg",t.background),t.headerBackground&&u(l,"--notectl-code-block-header-bg",t.headerBackground),t.textColor&&u(l,"--notectl-code-block-color",t.textColor),t.headerColor&&u(l,"--notectl-code-block-header-color",t.headerColor);let h=n.id;function k(t){const e=t.attrs?.language??"",n=e||"plain";s.textContent=n,l.setAttribute("aria-label",o.codeBlockAriaLabel(n)),e?g.setAttribute("data-language",e):g.removeAttribute("data-language"),u(l,"backgroundColor",(t.attrs?.backgroundColor??"")||"")}return k(n),i&&i.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation();const n=c().getBlock(h);if(!n)return;const r=e(n);navigator.clipboard.writeText(r),d.textContent=o.copiedToClipboard,setTimeout(()=>{d.textContent=""},1e3)}),{dom:l,contentDOM:g,update:t=>"code_block"===t.type&&(h=t.id,l.setAttribute("data-block-id",t.id),k(t),!0),selectNode(){l.classList.add("notectl-code-block--selected")},deselectNode(){l.classList.remove("notectl-code-block--selected")},destroy(){}}}}(this.config,this.locale))}registerInputRule(t){t.registerInputRule({pattern:/^```(\w*) $/,handler:(t,e,o,n)=>{const c=t.selection;if(!a(c))return null;if(!r(c))return null;const i=t.getBlock(c.anchor.blockId);if(!i||"paragraph"!==i.type)return null;const d={language:e[1]??"",backgroundColor:""};return t.transaction("input").deleteTextAt(c.anchor.blockId,o,o+e[0].length).setBlockType(c.anchor.blockId,s("code_block"),d).setSelection(l(c.anchor.blockId,0)).build()}})}registerToolbarItem(t){t.registerToolbarItem({id:"code_block",group:"block",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"/></svg>',label:this.locale.label,tooltip:this.locale.tooltip(this.resolvedKeymap.toggle?f(this.resolvedKeymap.toggle):void 0),command:"toggleCodeBlock",isActive:t=>!!a(t.selection)&&"code_block"===t.getBlock(t.selection.anchor.blockId)?.type})}registerMiddleware(t){t.registerMiddleware((t,e,o)=>{if(!t.steps.some(t=>"addMark"===t.type&&"code_block"===e.getBlock(t.blockId)?.type))return void o(t);const n=t.steps.filter(t=>"addMark"!==t.type||"code_block"!==e.getBlock(t.blockId)?.type);o({...t,steps:n})},{name:"code-block:mark-guard",priority:50})}patchTableCellContent(t){const e=t.getSchemaRegistry(),o=e.getNodeSpec("table_cell");if(!o?.content)return;const n=o.content.allow??[];n.includes("code_block")||(e.removeNodeSpec("table_cell"),e.registerNodeSpec({...o,content:{...o.content,allow:[...n,"code_block"]}}))}initHighlighter(){this.config.highlighter?this.highlighter=this.config.highlighter:this.highlighter=new M([j,N])}registerSyntaxHighlighterService(t){const e=this.highlighter;e&&t.registerService(L,{registerLanguage:t=>{e.registerLanguage?.(t),this.tokenCache.clear()},getSupportedLanguages:()=>e.getSupportedLanguages(),tokenize:(t,o)=>e.tokenize(t,o)})}getCachedTokens(t,e,o){const n=this.tokenCache.get(t);if(n&&n.text===e&&n.language===o)return n.tokens;const c=this.highlighter?.tokenize(e,o)??[];return this.tokenCache.set(t,{text:e,language:o,tokens:c}),c}getFocusedCodeBlockId(t){if(!a(t.selection))return null;const e=t.selection.anchor.blockId;return"code_block"===t.getBlock(e)?.type?e:null}};export{A as a,w as c,M as i,N as n,L as o,j as r,v as s,E as t};
2
+ //# sourceMappingURL=CodeBlockPlugin-BP3XaOGj.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CodeBlockPlugin-BP3XaOGj.mjs","names":[],"sources":["../../src/editor/styles/code-block.ts","../../src/plugins/code-block/CodeBlockKeyboardHandlers.ts","../../src/plugins/code-block/CodeBlockCommands.ts","../../src/plugins/code-block/CodeBlockLocale.ts","../../src/plugins/code-block/CodeBlockNodeView.ts","../../src/plugins/code-block/CodeBlockTypes.ts","../../src/plugins/code-block/CodeBlockService.ts","../../src/plugins/code-block/highlighter/RegexTokenizer.ts","../../src/plugins/code-block/highlighter/languages/json.ts","../../src/plugins/code-block/highlighter/languages/xml.ts","../../src/plugins/code-block/CodeBlockPlugin.ts"],"sourcesContent":["/** Code block styles — syntax highlighting container, header, copy button. */\nexport const CODE_BLOCK_CSS = `\n/* Code Block — uses theme custom properties */\n.notectl-code-block {\n\tposition: relative;\n\tmargin: 8px 0;\n\tborder-radius: 6px;\n\tbackground: var(--notectl-code-block-bg);\n\tcolor: var(--notectl-code-block-color);\n\tfont-family: 'SF Mono', 'Fira Code', 'Cascadia Code', Menlo, Consolas, monospace;\n\tfont-size: 14px;\n\tline-height: 1.5;\n\toverflow: hidden;\n}\n\n.notectl-code-block__header {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tpadding: 6px 12px;\n\tbackground: var(--notectl-code-block-header-bg);\n\tborder-bottom: 1px solid var(--notectl-code-block-header-border);\n\tfont-size: 12px;\n\tcolor: var(--notectl-code-block-header-color);\n\tuser-select: none;\n}\n\n.notectl-code-block__language {\n\tfont-weight: 500;\n\tletter-spacing: 0.02em;\n}\n\n.notectl-code-block__copy {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 24px;\n\theight: 24px;\n\tborder: none;\n\tborder-radius: 4px;\n\tbackground: transparent;\n\tcolor: var(--notectl-code-block-header-color);\n\tcursor: pointer;\n\tpadding: 0;\n\ttransition: background 0.15s, color 0.15s;\n}\n\n.notectl-code-block__copy:hover {\n\tbackground: rgba(128, 128, 128, 0.15);\n\tcolor: var(--notectl-code-block-color);\n}\n\n.notectl-code-block__copy svg {\n\tfill: currentColor;\n}\n\n.notectl-code-block__content {\n\tdisplay: block;\n\tpadding: 12px 16px;\n\twhite-space: pre-wrap;\n\tword-wrap: break-word;\n\ttab-size: 4;\n\t-moz-tab-size: 4;\n\toutline: none;\n\tmin-height: 1.5em;\n}\n\n.notectl-code-block--selected {\n\toutline: 2px solid var(--notectl-primary);\n\toutline-offset: 2px;\n}\n\n.notectl-code-block__esc-hint {\n\tdisplay: none;\n\tposition: absolute;\n\tbottom: 4px;\n\tinset-inline-end: 8px;\n\tfont-size: 11px;\n\tcolor: var(--notectl-code-block-header-color);\n\topacity: 0.5;\n\tpointer-events: none;\n\tuser-select: none;\n\tfont-family: system-ui, sans-serif;\n}\n\n.notectl-code-block--focused .notectl-code-block__esc-hint {\n\tdisplay: block;\n}\n\n/* Syntax highlighting token classes */\n.notectl-token--keyword { color: var(--notectl-code-token-keyword); }\n.notectl-token--string { color: var(--notectl-code-token-string); }\n.notectl-token--comment { color: var(--notectl-code-token-comment); font-style: italic; }\n.notectl-token--number { color: var(--notectl-code-token-number); }\n.notectl-token--function { color: var(--notectl-code-token-function); }\n.notectl-token--operator { color: var(--notectl-code-token-operator); }\n.notectl-token--punctuation { color: var(--notectl-code-token-punctuation); }\n.notectl-token--boolean { color: var(--notectl-code-token-boolean); }\n.notectl-token--null { color: var(--notectl-code-token-null); }\n.notectl-token--property { color: var(--notectl-code-token-property); }\n`;\n","/**\n * Keyboard handlers for code-block navigation and editing.\n * Handles Enter, Backspace, Tab, Shift-Tab, Escape, Arrow keys,\n * and configurable shortcuts (Mod+Enter, toggle).\n */\n\nimport type { BlockNode } from '../../model/Document.js';\nimport { generateBlockId, getBlockLength, getBlockText } from '../../model/Document.js';\nimport { createCollapsedSelection, isCollapsed, isTextSelection } from '../../model/Selection.js';\nimport type { BlockId } from '../../model/TypeBrands.js';\nimport { nodeType } from '../../model/TypeBrands.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { Transaction } from '../../state/Transaction.js';\nimport type { PluginContext } from '../Plugin.js';\nimport type { CodeBlockConfig, CodeBlockKeymap } from './CodeBlockTypes.js';\n\n// --- Context Guard ---\n\ninterface CodeBlockContext {\n\treadonly state: EditorState;\n\treadonly block: BlockNode;\n\treadonly blockId: BlockId;\n\treadonly offset: number;\n}\n\n/**\n * Guards against NodeSelection and non-code-block blocks.\n * Returns false (not handled) if the cursor is not inside a code block.\n */\nfunction withCodeBlockContext(\n\tcontext: PluginContext,\n\thandler: (ctx: CodeBlockContext) => boolean,\n): boolean {\n\tconst state: EditorState = context.getState();\n\tif (!isTextSelection(state.selection)) return false;\n\n\tconst sel = state.selection;\n\tconst block: BlockNode | undefined = state.getBlock(sel.anchor.blockId);\n\tif (!block || block.type !== 'code_block') return false;\n\n\treturn handler({\n\t\tstate,\n\t\tblock,\n\t\tblockId: sel.anchor.blockId,\n\t\toffset: sel.anchor.offset,\n\t});\n}\n\n/** Registers all code-block keyboard handlers. */\nexport function registerCodeBlockKeymaps(\n\tcontext: PluginContext,\n\tconfig: CodeBlockConfig,\n\tresolvedKeymap: Readonly<Record<keyof CodeBlockKeymap, string | null>>,\n): void {\n\tconst keymap: Record<string, () => boolean> = {\n\t\tEnter: () => handleEnter(context),\n\t\tBackspace: () => handleBackspace(context),\n\t\tTab: () => handleTab(context, config),\n\t\t'Shift-Tab': () => handleShiftTab(context, config),\n\t\tEscape: () => handleEscape(context),\n\t\tArrowDown: () => handleArrowDown(context),\n\t\tArrowUp: () => handleArrowUp(context),\n\t\tArrowRight: () => handleArrowRight(context),\n\t\tArrowLeft: () => handleArrowLeft(context),\n\t};\n\n\tconst { insertAfter, toggle } = resolvedKeymap;\n\n\tif (insertAfter) {\n\t\tkeymap[insertAfter] = () => handleModEnter(context);\n\t}\n\tif (toggle) {\n\t\tkeymap[toggle] = () => context.executeCommand('toggleCodeBlock');\n\t}\n\n\tcontext.registerKeymap(keymap, { priority: 'context' });\n}\n\n// --- Handler Functions ---\n\nfunction handleBackspace(context: PluginContext): boolean {\n\treturn withCodeBlockContext(context, ({ state, blockId, offset }) => {\n\t\tif (!isCollapsed(state.selection)) return false;\n\t\tif (offset !== 0) return false;\n\n\t\tconst tr: Transaction = state\n\t\t\t.transaction('input')\n\t\t\t.setBlockType(blockId, nodeType('paragraph'))\n\t\t\t.setSelection(state.selection)\n\t\t\t.build();\n\t\tcontext.dispatch(tr);\n\t\treturn true;\n\t});\n}\n\nfunction handleEnter(context: PluginContext): boolean {\n\treturn withCodeBlockContext(context, ({ state, block, blockId, offset }) => {\n\t\tif (!isCollapsed(state.selection)) return false;\n\n\t\tconst text: string = getBlockText(block);\n\n\t\tif (text.endsWith('\\n') && offset === text.length) {\n\t\t\treturn exitOnDoubleEnter(context, blockId, text);\n\t\t}\n\n\t\tconst tr: Transaction = state\n\t\t\t.transaction('input')\n\t\t\t.insertText(blockId, offset, '\\n', [])\n\t\t\t.setSelection(createCollapsedSelection(blockId, offset + 1))\n\t\t\t.build();\n\n\t\tcontext.dispatch(tr);\n\t\treturn true;\n\t});\n}\n\nfunction handleTab(context: PluginContext, config: CodeBlockConfig): boolean {\n\treturn withCodeBlockContext(context, ({ state, blockId, offset }) => {\n\t\tconst indent: string = config.useSpaces ? ' '.repeat(config.spaceCount ?? 2) : '\\t';\n\n\t\tconst tr: Transaction = state\n\t\t\t.transaction('input')\n\t\t\t.insertText(blockId, offset, indent, [])\n\t\t\t.setSelection(createCollapsedSelection(blockId, offset + indent.length))\n\t\t\t.build();\n\n\t\tcontext.dispatch(tr);\n\t\treturn true;\n\t});\n}\n\nfunction handleShiftTab(context: PluginContext, config: CodeBlockConfig): boolean {\n\treturn withCodeBlockContext(context, ({ state, block, blockId, offset }) => {\n\t\tconst text: string = getBlockText(block);\n\t\tconst lineStart: number = text.lastIndexOf('\\n', offset - 1) + 1;\n\n\t\tif (config.useSpaces) {\n\t\t\tconst spaceCount: number = config.spaceCount ?? 2;\n\t\t\tconst linePrefix: string = text.slice(lineStart, lineStart + spaceCount);\n\t\t\tif (linePrefix === ' '.repeat(spaceCount)) {\n\t\t\t\tconst tr: Transaction = state\n\t\t\t\t\t.transaction('input')\n\t\t\t\t\t.deleteTextAt(blockId, lineStart, lineStart + spaceCount)\n\t\t\t\t\t.setSelection(createCollapsedSelection(blockId, Math.max(lineStart, offset - spaceCount)))\n\t\t\t\t\t.build();\n\t\t\t\tcontext.dispatch(tr);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else if (text[lineStart] === '\\t') {\n\t\t\tconst tr: Transaction = state\n\t\t\t\t.transaction('input')\n\t\t\t\t.deleteTextAt(blockId, lineStart, lineStart + 1)\n\t\t\t\t.setSelection(createCollapsedSelection(blockId, Math.max(lineStart, offset - 1)))\n\t\t\t\t.build();\n\t\t\tcontext.dispatch(tr);\n\t\t\treturn true;\n\t\t}\n\n\t\treturn true; // Consume event even if no dedent possible\n\t});\n}\n\n/**\n * Exits the code block to the next block or creates a new paragraph.\n * Exported for use by the `exitCodeBlock` command.\n */\nexport function handleEscape(context: PluginContext): boolean {\n\treturn withCodeBlockContext(context, ({ state, blockId }) => {\n\t\tconst blockOrder: readonly BlockId[] = state.getBlockOrder();\n\t\tconst idx: number = blockOrder.indexOf(blockId);\n\n\t\tif (idx < blockOrder.length - 1) {\n\t\t\tconst nextId: BlockId = blockOrder[idx + 1] as BlockId;\n\t\t\tconst tr: Transaction = state\n\t\t\t\t.transaction('command')\n\t\t\t\t.setSelection(createCollapsedSelection(nextId, 0))\n\t\t\t\t.build();\n\t\t\tcontext.dispatch(tr);\n\t\t} else {\n\t\t\tinsertParagraphAfter(context, blockId);\n\t\t}\n\n\t\treturn true;\n\t});\n}\n\nfunction handleArrowDown(context: PluginContext): boolean {\n\treturn withCodeBlockContext(context, ({ state, block, blockId, offset }) => {\n\t\tif (!isCollapsed(state.selection)) return false;\n\n\t\tconst text: string = getBlockText(block);\n\t\tconst nextNewline: number = text.indexOf('\\n', offset);\n\t\tif (nextNewline !== -1) return false;\n\n\t\tconst blockOrder: readonly BlockId[] = state.getBlockOrder();\n\t\tconst idx: number = blockOrder.indexOf(blockId);\n\n\t\tif (idx < blockOrder.length - 1) {\n\t\t\tconst nextId: BlockId = blockOrder[idx + 1] as BlockId;\n\t\t\tconst tr: Transaction = state\n\t\t\t\t.transaction('command')\n\t\t\t\t.setSelection(createCollapsedSelection(nextId, 0))\n\t\t\t\t.build();\n\t\t\tcontext.dispatch(tr);\n\t\t} else {\n\t\t\tinsertParagraphAfter(context, blockId);\n\t\t}\n\n\t\treturn true;\n\t});\n}\n\nfunction handleArrowUp(context: PluginContext): boolean {\n\treturn withCodeBlockContext(context, ({ state, block, blockId, offset }) => {\n\t\tif (!isCollapsed(state.selection)) return false;\n\n\t\tconst text: string = getBlockText(block);\n\t\tconst firstNewline: number = text.indexOf('\\n');\n\t\tif (firstNewline !== -1 && offset > firstNewline) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst blockOrder: readonly BlockId[] = state.getBlockOrder();\n\t\tconst idx: number = blockOrder.indexOf(blockId);\n\n\t\tif (idx > 0) {\n\t\t\tconst prevId: BlockId = blockOrder[idx - 1] as BlockId;\n\t\t\tconst prevBlock: BlockNode | undefined = state.getBlock(prevId);\n\t\t\tconst prevLen: number = prevBlock ? getBlockLength(prevBlock) : 0;\n\t\t\tconst tr: Transaction = state\n\t\t\t\t.transaction('command')\n\t\t\t\t.setSelection(createCollapsedSelection(prevId, prevLen))\n\t\t\t\t.build();\n\t\t\tcontext.dispatch(tr);\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t});\n}\n\nfunction handleArrowRight(context: PluginContext): boolean {\n\treturn withCodeBlockContext(context, ({ state, block, blockId, offset }) => {\n\t\tif (!isCollapsed(state.selection)) return false;\n\n\t\tconst text: string = getBlockText(block);\n\t\tif (offset !== text.length) return false;\n\n\t\tconst blockOrder: readonly BlockId[] = state.getBlockOrder();\n\t\tconst idx: number = blockOrder.indexOf(blockId);\n\n\t\tif (idx < blockOrder.length - 1) {\n\t\t\tconst nextId: BlockId = blockOrder[idx + 1] as BlockId;\n\t\t\tconst tr: Transaction = state\n\t\t\t\t.transaction('command')\n\t\t\t\t.setSelection(createCollapsedSelection(nextId, 0))\n\t\t\t\t.build();\n\t\t\tcontext.dispatch(tr);\n\t\t} else {\n\t\t\tinsertParagraphAfter(context, blockId);\n\t\t}\n\n\t\treturn true;\n\t});\n}\n\nfunction handleArrowLeft(context: PluginContext): boolean {\n\treturn withCodeBlockContext(context, ({ state, blockId, offset }) => {\n\t\tif (!isCollapsed(state.selection)) return false;\n\t\tif (offset !== 0) return false;\n\n\t\tconst blockOrder: readonly BlockId[] = state.getBlockOrder();\n\t\tconst idx: number = blockOrder.indexOf(blockId);\n\n\t\tif (idx > 0) {\n\t\t\tconst prevId: BlockId = blockOrder[idx - 1] as BlockId;\n\t\t\tconst prevBlock: BlockNode | undefined = state.getBlock(prevId);\n\t\t\tconst prevLen: number = prevBlock ? getBlockLength(prevBlock) : 0;\n\t\t\tconst tr: Transaction = state\n\t\t\t\t.transaction('command')\n\t\t\t\t.setSelection(createCollapsedSelection(prevId, prevLen))\n\t\t\t\t.build();\n\t\t\tcontext.dispatch(tr);\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t});\n}\n\nfunction handleModEnter(context: PluginContext): boolean {\n\treturn withCodeBlockContext(context, ({ blockId }) => {\n\t\tinsertParagraphAfter(context, blockId);\n\t\treturn true;\n\t});\n}\n\n// --- Shared Helpers ---\n\nfunction insertParagraphAfter(context: PluginContext, bid: BlockId): void {\n\tconst state: EditorState = context.getState();\n\tconst block: BlockNode | undefined = state.getBlock(bid);\n\tif (!block) return;\n\n\tconst blockLength: number = getBlockLength(block);\n\tconst newId: BlockId = generateBlockId();\n\n\tconst tr: Transaction = state\n\t\t.transaction('command')\n\t\t.splitBlock(bid, blockLength, newId)\n\t\t.setBlockType(newId, nodeType('paragraph'))\n\t\t.setSelection(createCollapsedSelection(newId, 0))\n\t\t.build();\n\n\tcontext.dispatch(tr);\n}\n\nfunction exitOnDoubleEnter(context: PluginContext, bid: BlockId, text: string): boolean {\n\tconst state: EditorState = context.getState();\n\tconst trimmedLen: number = text.length - 1;\n\tconst newId: BlockId = generateBlockId();\n\n\tconst tr: Transaction = state\n\t\t.transaction('input')\n\t\t.deleteTextAt(bid, trimmedLen, text.length)\n\t\t.splitBlock(bid, trimmedLen, newId)\n\t\t.setBlockType(newId, nodeType('paragraph'))\n\t\t.setSelection(createCollapsedSelection(newId, 0))\n\t\t.build();\n\n\tcontext.dispatch(tr);\n\treturn true;\n}\n","/**\n * Command registration and implementations for code blocks.\n * Handles toggle, insert, exit, and mark stripping.\n */\n\nimport type { BlockNode } from '../../model/Document.js';\nimport { getBlockLength, getInlineChildren, isTextNode } from '../../model/Document.js';\nimport { createCollapsedSelection, isTextSelection } from '../../model/Selection.js';\nimport { nodeType } from '../../model/TypeBrands.js';\nimport type { Transaction, TransactionBuilder } from '../../state/Transaction.js';\nimport type { PluginContext } from '../Plugin.js';\nimport { handleEscape } from './CodeBlockKeyboardHandlers.js';\nimport type { CodeBlockConfig } from './CodeBlockTypes.js';\n\n/** Registers all code-block commands. */\nexport function registerCodeBlockCommands(context: PluginContext, config: CodeBlockConfig): void {\n\tcontext.registerCommand('toggleCodeBlock', () => toggleCodeBlock(context, config));\n\n\tcontext.registerCommand('insertCodeBlock', () => insertCodeBlock(context, config));\n\n\tcontext.registerCommand('setCodeBlockLanguage', () => false);\n\n\tcontext.registerCommand('setCodeBlockBackground', () => false);\n\n\tcontext.registerCommand('exitCodeBlock', () => handleEscape(context));\n}\n\n// --- Command Implementations ---\n\nfunction toggleCodeBlock(context: PluginContext, config: CodeBlockConfig): boolean {\n\tconst state = context.getState();\n\tif (!isTextSelection(state.selection)) return false;\n\n\tconst block: BlockNode | undefined = state.getBlock(state.selection.anchor.blockId);\n\tif (!block) return false;\n\n\tif (block.type === 'code_block') {\n\t\tconst tr: Transaction = state\n\t\t\t.transaction('command')\n\t\t\t.setBlockType(state.selection.anchor.blockId, nodeType('paragraph'))\n\t\t\t.setSelection(state.selection)\n\t\t\t.build();\n\t\tcontext.dispatch(tr);\n\t\treturn true;\n\t}\n\n\treturn insertCodeBlock(context, config);\n}\n\nfunction insertCodeBlock(context: PluginContext, config: CodeBlockConfig): boolean {\n\tconst state = context.getState();\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return false;\n\n\tconst block: BlockNode | undefined = state.getBlock(sel.anchor.blockId);\n\tif (!block || block.type === 'code_block') return false;\n\n\tconst attrs: Record<string, string | number | boolean> = {\n\t\tlanguage: config.defaultLanguage ?? '',\n\t\tbackgroundColor: '',\n\t};\n\n\tconst builder: TransactionBuilder = state.transaction('command');\n\tstripAllMarks(builder, block);\n\tbuilder\n\t\t.setBlockType(sel.anchor.blockId, nodeType('code_block'), attrs)\n\t\t.setSelection(createCollapsedSelection(sel.anchor.blockId, 0));\n\n\tcontext.dispatch(builder.build());\n\treturn true;\n}\n\n/**\n * Strips all marks from a block's inline content.\n * Used when converting to code_block so no formatting carries over.\n */\nfunction stripAllMarks(builder: TransactionBuilder, block: BlockNode): void {\n\tconst blockLength: number = getBlockLength(block);\n\tif (blockLength === 0) return;\n\n\tconst inlineChildren = getInlineChildren(block);\n\tlet offset = 0;\n\n\tfor (const child of inlineChildren) {\n\t\tif (isTextNode(child)) {\n\t\t\tif (child.text.length > 0) {\n\t\t\t\tfor (const mark of child.marks) {\n\t\t\t\t\tbuilder.removeMark(block.id, offset, offset + child.text.length, mark);\n\t\t\t\t}\n\t\t\t}\n\t\t\toffset += child.text.length;\n\t\t} else {\n\t\t\toffset += 1;\n\t\t}\n\t}\n}\n","/** Locale interface and default English locale for the CodeBlockPlugin. */\n\n// --- Locale Interface ---\n\nexport interface CodeBlockLocale {\n\treadonly label: string;\n\treadonly tooltip: (shortcut?: string) => string;\n\treadonly enteredCodeBlock: string;\n\treadonly leftCodeBlock: string;\n\treadonly copyCodeAria: string;\n\treadonly escToExit: string;\n\treadonly codeBlockAriaLabel: (lang: string) => string;\n\treadonly copiedToClipboard: string;\n}\n\n// --- Default English Locale ---\n\nexport const CODE_BLOCK_LOCALE_EN: CodeBlockLocale = {\n\tlabel: 'Code Block',\n\ttooltip: (shortcut?: string) => (shortcut ? `Code Block (${shortcut})` : 'Code Block'),\n\tenteredCodeBlock: 'Entered code block. Press Escape to exit.',\n\tleftCodeBlock: 'Left code block.',\n\tcopyCodeAria: 'Copy code',\n\tescToExit: 'Esc to exit',\n\tcodeBlockAriaLabel: (lang: string) => `${lang} code block. Press Escape to exit.`,\n\tcopiedToClipboard: 'Copied to clipboard',\n};\n\n// --- Lazy Locale Loader ---\n\nconst localeModules: Record<string, () => Promise<{ default: CodeBlockLocale }>> =\n\timport.meta.glob<{ default: CodeBlockLocale }>('./locales/*.ts', { eager: false });\n\nexport async function loadCodeBlockLocale(lang: string): Promise<CodeBlockLocale> {\n\tif (lang === 'en') return CODE_BLOCK_LOCALE_EN;\n\tconst loader = localeModules[`./locales/${lang}.ts`];\n\tif (!loader) return CODE_BLOCK_LOCALE_EN;\n\ttry {\n\t\tconst mod = await loader();\n\t\treturn mod.default;\n\t} catch {\n\t\treturn CODE_BLOCK_LOCALE_EN;\n\t}\n}\n","/**\n * NodeView factory for code blocks.\n * Renders <pre> with a non-editable header (language label + copy button)\n * and a <code> content area where the Reconciler renders text.\n */\n\nimport type { BlockNode } from '../../model/Document.js';\nimport { getBlockText } from '../../model/Document.js';\nimport type { BlockId } from '../../model/TypeBrands.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { Transaction } from '../../state/Transaction.js';\nimport { setStyleProperty } from '../../style/StyleRuntime.js';\nimport type { NodeView, NodeViewFactory } from '../../view/NodeView.js';\nimport { CODE_BLOCK_LOCALE_EN, type CodeBlockLocale } from './CodeBlockLocale.js';\nimport type { CodeBlockConfig } from './CodeBlockTypes.js';\n\nconst COPY_ICON =\n\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" width=\"14\" height=\"14\"><path d=\"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z\"/></svg>';\n\n/** Creates a NodeViewFactory for code_block nodes. */\nexport function createCodeBlockNodeViewFactory(\n\tconfig: CodeBlockConfig,\n\tlocale: CodeBlockLocale = CODE_BLOCK_LOCALE_EN,\n): NodeViewFactory {\n\treturn (\n\t\tnode: BlockNode,\n\t\tgetState: () => EditorState,\n\t\t_dispatch: (tr: Transaction) => void,\n\t): NodeView => {\n\t\t// --- DOM Construction ---\n\t\tconst pre: HTMLElement = document.createElement('pre');\n\t\tpre.className = 'notectl-code-block';\n\t\tpre.setAttribute('data-block-id', node.id);\n\t\tpre.setAttribute('dir', 'ltr');\n\t\tpre.setAttribute('role', 'group');\n\t\tpre.setAttribute('aria-roledescription', 'code block');\n\n\t\t// Header (non-editable)\n\t\tconst header: HTMLDivElement = document.createElement('div');\n\t\theader.className = 'notectl-code-block__header';\n\t\theader.setAttribute('contenteditable', 'false');\n\n\t\tconst langLabel: HTMLSpanElement = document.createElement('span');\n\t\tlangLabel.className = 'notectl-code-block__language';\n\n\t\tconst showCopy: boolean = config.showCopyButton !== false;\n\t\tlet copyBtn: HTMLButtonElement | null = null;\n\n\t\tif (showCopy) {\n\t\t\tcopyBtn = document.createElement('button');\n\t\t\tcopyBtn.className = 'notectl-code-block__copy';\n\t\t\tcopyBtn.setAttribute('aria-label', locale.copyCodeAria);\n\t\t\tcopyBtn.setAttribute('data-notectl-no-print', '');\n\t\t\tcopyBtn.type = 'button';\n\t\t\tcopyBtn.innerHTML = COPY_ICON;\n\t\t}\n\n\t\t// Screen reader live region for copy feedback\n\t\tconst copyAnnouncer: HTMLSpanElement = document.createElement('span');\n\t\tcopyAnnouncer.className = 'notectl-sr-only';\n\t\tcopyAnnouncer.setAttribute('aria-live', 'assertive');\n\t\tcopyAnnouncer.setAttribute('aria-atomic', 'true');\n\n\t\theader.appendChild(langLabel);\n\t\tif (copyBtn) {\n\t\t\theader.appendChild(copyBtn);\n\t\t}\n\t\theader.appendChild(copyAnnouncer);\n\n\t\t// Content area (Reconciler target)\n\t\tconst code: HTMLElement = document.createElement('code');\n\t\tcode.className = 'notectl-code-block__content';\n\n\t\t// Escape hint (visible only when focused, CSS-driven)\n\t\tconst escHint: HTMLDivElement = document.createElement('div');\n\t\tescHint.className = 'notectl-code-block__esc-hint';\n\t\tescHint.setAttribute('contenteditable', 'false');\n\t\tescHint.setAttribute('aria-hidden', 'true');\n\t\tescHint.setAttribute('data-notectl-no-print', '');\n\t\tescHint.textContent = locale.escToExit;\n\n\t\tpre.appendChild(header);\n\t\tpre.appendChild(code);\n\t\tpre.appendChild(escHint);\n\n\t\t// Apply config-level color overrides as CSS custom properties\n\t\tif (config.background) {\n\t\t\tsetStyleProperty(pre, '--notectl-code-block-bg', config.background);\n\t\t}\n\t\tif (config.headerBackground) {\n\t\t\tsetStyleProperty(pre, '--notectl-code-block-header-bg', config.headerBackground);\n\t\t}\n\t\tif (config.textColor) {\n\t\t\tsetStyleProperty(pre, '--notectl-code-block-color', config.textColor);\n\t\t}\n\t\tif (config.headerColor) {\n\t\t\tsetStyleProperty(pre, '--notectl-code-block-header-color', config.headerColor);\n\t\t}\n\n\t\tlet currentNodeId: BlockId = node.id;\n\n\t\t// --- Attribute Application ---\n\n\t\tfunction applyAttrs(n: BlockNode): void {\n\t\t\tconst lang: string = (n.attrs?.language as string) ?? '';\n\t\t\tconst langName: string = lang || 'plain';\n\t\t\tlangLabel.textContent = langName;\n\t\t\tpre.setAttribute('aria-label', locale.codeBlockAriaLabel(langName));\n\n\t\t\tif (lang) {\n\t\t\t\tcode.setAttribute('data-language', lang);\n\t\t\t} else {\n\t\t\t\tcode.removeAttribute('data-language');\n\t\t\t}\n\n\t\t\tconst bg: string = (n.attrs?.backgroundColor as string) ?? '';\n\t\t\tsetStyleProperty(pre, 'backgroundColor', bg || '');\n\t\t}\n\n\t\tapplyAttrs(node);\n\n\t\t// --- Copy Button Handler ---\n\n\t\tif (copyBtn) {\n\t\t\tcopyBtn.addEventListener('click', (e: MouseEvent) => {\n\t\t\t\te.preventDefault();\n\t\t\t\te.stopPropagation();\n\n\t\t\t\tconst state: EditorState = getState();\n\t\t\t\tconst block: BlockNode | undefined = state.getBlock(currentNodeId);\n\t\t\t\tif (!block) return;\n\n\t\t\t\tconst text: string = getBlockText(block);\n\t\t\t\tnavigator.clipboard.writeText(text);\n\n\t\t\t\t// Announce to screen readers\n\t\t\t\tcopyAnnouncer.textContent = locale.copiedToClipboard;\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tcopyAnnouncer.textContent = '';\n\t\t\t\t}, 1000);\n\t\t\t});\n\t\t}\n\n\t\t// --- NodeView Interface ---\n\n\t\treturn {\n\t\t\tdom: pre,\n\t\t\tcontentDOM: code,\n\n\t\t\tupdate(updatedNode: BlockNode): boolean {\n\t\t\t\tif (updatedNode.type !== 'code_block') return false;\n\t\t\t\tcurrentNodeId = updatedNode.id;\n\t\t\t\tpre.setAttribute('data-block-id', updatedNode.id);\n\t\t\t\tapplyAttrs(updatedNode);\n\t\t\t\treturn true;\n\t\t\t},\n\n\t\t\tselectNode(): void {\n\t\t\t\tpre.classList.add('notectl-code-block--selected');\n\t\t\t},\n\n\t\t\tdeselectNode(): void {\n\t\t\t\tpre.classList.remove('notectl-code-block--selected');\n\t\t\t},\n\n\t\t\tdestroy(): void {\n\t\t\t\t// No cleanup needed\n\t\t\t},\n\t\t};\n\t};\n}\n","/**\n * Types, interfaces, and constants for the code-block plugin.\n */\n\nimport type { BlockId } from '../../model/TypeBrands.js';\nimport { ServiceKey } from '../Plugin.js';\n\n// --- Attribute Registry Augmentation ---\n\ndeclare module '../../model/AttrRegistry.js' {\n\tinterface NodeAttrRegistry {\n\t\tcode_block: {\n\t\t\tlanguage: string;\n\t\t\tbackgroundColor: string;\n\t\t};\n\t}\n}\n\n// --- Syntax Highlighting Types ---\n\nexport interface SyntaxToken {\n\treadonly from: number;\n\treadonly to: number;\n\treadonly type: string;\n}\n\nexport interface SyntaxHighlighter {\n\ttokenize(code: string, language: string): readonly SyntaxToken[];\n\tgetSupportedLanguages(): readonly string[];\n\tregisterLanguage?(def: import('./highlighter/TokenizerTypes.js').LanguageDefinition): void;\n}\n\n// --- Configuration ---\n\n/**\n * Configurable keyboard bindings for CodeBlockPlugin actions.\n * Omit a slot to use the default; set to `null` to disable the binding.\n *\n * Key descriptor format: `'Mod-Enter'`, `'Mod-Shift-M'`, etc.\n * `Mod` resolves to Cmd on macOS, Ctrl on Windows/Linux.\n */\nexport interface CodeBlockKeymap {\n\t/**\n\t * Insert a new paragraph below the code block and move the cursor there.\n\t * @default 'Mod-Enter'\n\t */\n\treadonly insertAfter?: string | null;\n\n\t/**\n\t * Toggle the current block between code block and paragraph.\n\t * @default 'Mod-Shift-M'\n\t */\n\treadonly toggle?: string | null;\n}\n\nexport const DEFAULT_KEYMAP: Readonly<Record<keyof CodeBlockKeymap, string>> = {\n\tinsertAfter: 'Mod-Enter',\n\ttoggle: 'Mod-Shift-M',\n};\n\nexport interface CodeBlockConfig {\n\treadonly highlighter?: SyntaxHighlighter;\n\treadonly defaultLanguage?: string;\n\treadonly useSpaces?: boolean;\n\treadonly spaceCount?: number;\n\treadonly showCopyButton?: boolean;\n\t/** Default body background color (overrides --notectl-code-block-bg). */\n\treadonly background?: string;\n\t/** Default header background color (overrides --notectl-code-block-header-bg). */\n\treadonly headerBackground?: string;\n\t/** Default text color (overrides --notectl-code-block-color). */\n\treadonly textColor?: string;\n\t/** Default header/label text color (overrides --notectl-code-block-header-color). */\n\treadonly headerColor?: string;\n\t/** Customize keyboard bindings for code block actions. */\n\treadonly keymap?: CodeBlockKeymap;\n\t/** Locale override for user-facing strings. */\n\treadonly locale?: import('./CodeBlockLocale.js').CodeBlockLocale;\n}\n\nexport const DEFAULT_CONFIG: CodeBlockConfig = {\n\tdefaultLanguage: '',\n\tuseSpaces: false,\n\tspaceCount: 2,\n\tshowCopyButton: true,\n};\n\n// --- Service Types ---\n\nexport interface CodeBlockService {\n\tsetLanguage(blockId: BlockId, language: string): void;\n\tgetLanguage(blockId: BlockId): string;\n\tsetBackground(blockId: BlockId, color: string): void;\n\tgetBackground(blockId: BlockId): string;\n\tisCodeBlock(blockId: BlockId): boolean;\n\tgetSupportedLanguages(): readonly string[];\n}\n\nexport const CODE_BLOCK_SERVICE_KEY = new ServiceKey<CodeBlockService>('codeBlock');\n\n// --- Syntax Highlighter Service ---\n\nexport interface SyntaxHighlighterService {\n\tregisterLanguage(def: import('./highlighter/TokenizerTypes.js').LanguageDefinition): void;\n\tgetSupportedLanguages(): readonly string[];\n\ttokenize(code: string, language: string): readonly SyntaxToken[];\n}\n\nexport const SYNTAX_HIGHLIGHTER_SERVICE_KEY = new ServiceKey<SyntaxHighlighterService>(\n\t'syntaxHighlighter',\n);\n\n// --- SVG Icon ---\n\nexport const CODE_BLOCK_ICON =\n\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z\"/></svg>';\n","/**\n * Service API for code blocks.\n * Provides language/background getters and setters.\n */\n\nimport type { BlockAttrs, BlockNode } from '../../model/Document.js';\nimport type { BlockId } from '../../model/TypeBrands.js';\nimport type { Transaction } from '../../state/Transaction.js';\nimport type { PluginContext } from '../Plugin.js';\nimport type { CodeBlockConfig } from './CodeBlockTypes.js';\nimport { CODE_BLOCK_SERVICE_KEY } from './CodeBlockTypes.js';\n\n/** Registers the CodeBlockService on the given context. */\nexport function registerCodeBlockService(\n\tcontext: PluginContext,\n\tconfig: CodeBlockConfig,\n\tgetContext: () => PluginContext | null,\n): void {\n\tcontext.registerService(CODE_BLOCK_SERVICE_KEY, {\n\t\tsetLanguage(bid: BlockId, language: string): void {\n\t\t\tsetAttr(context, bid, 'language', language);\n\t\t},\n\n\t\tgetLanguage(bid: BlockId): string {\n\t\t\tconst ctx: PluginContext | null = getContext();\n\t\t\tif (!ctx) return '';\n\t\t\tconst block: BlockNode | undefined = ctx.getState().getBlock(bid);\n\t\t\tif (!block || block.type !== 'code_block') return '';\n\t\t\treturn (block.attrs?.language as string) ?? '';\n\t\t},\n\n\t\tsetBackground(bid: BlockId, color: string): void {\n\t\t\tsetAttr(context, bid, 'backgroundColor', color);\n\t\t},\n\n\t\tgetBackground(bid: BlockId): string {\n\t\t\tconst ctx: PluginContext | null = getContext();\n\t\t\tif (!ctx) return '';\n\t\t\tconst block: BlockNode | undefined = ctx.getState().getBlock(bid);\n\t\t\tif (!block || block.type !== 'code_block') return '';\n\t\t\treturn (block.attrs?.backgroundColor as string) ?? '';\n\t\t},\n\n\t\tisCodeBlock(bid: BlockId): boolean {\n\t\t\tconst ctx: PluginContext | null = getContext();\n\t\t\tif (!ctx) return false;\n\t\t\tconst block: BlockNode | undefined = ctx.getState().getBlock(bid);\n\t\t\treturn block?.type === 'code_block';\n\t\t},\n\n\t\tgetSupportedLanguages(): readonly string[] {\n\t\t\tif (config.highlighter) {\n\t\t\t\treturn config.highlighter.getSupportedLanguages();\n\t\t\t}\n\t\t\treturn [];\n\t\t},\n\t});\n}\n\n// --- Helper ---\n\nfunction setAttr(context: PluginContext, bid: BlockId, key: string, value: string): void {\n\tconst state = context.getState();\n\tconst block: BlockNode | undefined = state.getBlock(bid);\n\tif (!block || block.type !== 'code_block') return;\n\n\tconst path: BlockId[] | undefined = state.getNodePath(bid);\n\tif (!path) return;\n\n\tconst newAttrs: BlockAttrs = { ...block.attrs, [key]: value };\n\tconst tr: Transaction = state.transaction('command').setNodeAttr(path, newAttrs).build();\n\n\tcontext.dispatch(tr);\n}\n","/**\n * Regex-based syntax tokenizer.\n * Implements the SyntaxHighlighter interface using linear regex scanning.\n */\n\nimport type { SyntaxHighlighter, SyntaxToken } from '../CodeBlockTypes.js';\nimport type { LanguageDefinition } from './TokenizerTypes.js';\n\nexport class RegexTokenizer implements SyntaxHighlighter {\n\tprivate readonly languageMap = new Map<string, LanguageDefinition>();\n\n\tconstructor(languages?: readonly LanguageDefinition[]) {\n\t\tif (languages) {\n\t\t\tfor (const lang of languages) {\n\t\t\t\tthis.registerLanguageInternal(lang);\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Registers a language definition. Overwrites existing definitions for the same name/aliases. */\n\tregisterLanguage(def: LanguageDefinition): void {\n\t\tthis.registerLanguageInternal(def);\n\t}\n\n\t/** Tokenizes code using the specified language. Returns empty array for unknown languages. */\n\ttokenize(code: string, language: string): readonly SyntaxToken[] {\n\t\tconst lang: LanguageDefinition | undefined = this.languageMap.get(language.toLowerCase());\n\t\tif (!lang) return [];\n\n\t\tconst tokens: SyntaxToken[] = [];\n\t\tlet pos = 0;\n\n\t\twhile (pos < code.length) {\n\t\t\tlet matched = false;\n\n\t\t\tfor (const pattern of lang.patterns) {\n\t\t\t\tconst match: RegExpExecArray | null = pattern.pattern.exec(code.slice(pos));\n\t\t\t\tif (match && match[0].length > 0) {\n\t\t\t\t\ttokens.push({\n\t\t\t\t\t\tfrom: pos,\n\t\t\t\t\t\tto: pos + match[0].length,\n\t\t\t\t\t\ttype: pattern.type,\n\t\t\t\t\t});\n\t\t\t\t\tpos += match[0].length;\n\t\t\t\t\tmatched = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!matched) {\n\t\t\t\tpos++;\n\t\t\t}\n\t\t}\n\n\t\treturn tokens;\n\t}\n\n\t/** Returns all registered language names and aliases. */\n\tgetSupportedLanguages(): readonly string[] {\n\t\tconst names = new Set<string>();\n\t\tfor (const lang of this.languageMap.values()) {\n\t\t\tnames.add(lang.name);\n\t\t\tfor (const alias of lang.aliases) {\n\t\t\t\tnames.add(alias);\n\t\t\t}\n\t\t}\n\t\treturn [...names];\n\t}\n\n\tprivate registerLanguageInternal(def: LanguageDefinition): void {\n\t\tthis.languageMap.set(def.name.toLowerCase(), def);\n\t\tfor (const alias of def.aliases) {\n\t\t\tthis.languageMap.set(alias.toLowerCase(), def);\n\t\t}\n\t}\n}\n","/**\n * JSON language definition for regex-based syntax highlighting.\n */\n\nimport type { LanguageDefinition } from '../TokenizerTypes.js';\n\nexport const JSON_LANGUAGE: LanguageDefinition = {\n\tname: 'json',\n\taliases: ['jsonc'],\n\tpatterns: [\n\t\t{ type: 'property', pattern: /^\"(?:[^\"\\\\]|\\\\.)*\"(?=\\s*:)/ },\n\t\t{ type: 'string', pattern: /^\"(?:[^\"\\\\]|\\\\.)*\"/ },\n\t\t{ type: 'number', pattern: /^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?/ },\n\t\t{ type: 'boolean', pattern: /^(?:true|false)\\b/ },\n\t\t{ type: 'null', pattern: /^null\\b/ },\n\t\t{ type: 'punctuation', pattern: /^[{}[\\]:,]/ },\n\t],\n};\n","/**\n * XML language definition for regex-based syntax highlighting.\n *\n * Token type mapping:\n * - `comment` — XML comments `<!-- ... -->`\n * - `keyword` — tag names (consumed with `<`/`</` prefix), processing instructions, CDATA\n * - `property` — attribute names (identifier followed by `=`)\n * - `string` — attribute values (double or single quoted)\n * - `punctuation` — delimiters `/>`, `>`, `=`\n *\n * Tag names are combined with their `<` or `</` prefix into a single `keyword` token\n * to prevent text content between tags from being incorrectly highlighted.\n */\n\nimport { XML_TAG_NAME } from '../../../shared/XmlPatterns.js';\nimport type { LanguageDefinition } from '../TokenizerTypes.js';\n\nexport const XML_LANGUAGE: LanguageDefinition = {\n\tname: 'xml',\n\taliases: ['html', 'xhtml', 'svg', 'xsl'],\n\tpatterns: [\n\t\t{ type: 'comment', pattern: /^<!--[\\s\\S]*?-->/ },\n\t\t{ type: 'keyword', pattern: /^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>/ },\n\t\t{ type: 'keyword', pattern: /^<\\?[\\s\\S]*?\\?>/ },\n\t\t{ type: 'keyword', pattern: new RegExp(`^<\\\\/${XML_TAG_NAME}`) },\n\t\t{ type: 'keyword', pattern: new RegExp(`^<${XML_TAG_NAME}`) },\n\t\t{ type: 'punctuation', pattern: /^\\/>|^>|^=/ },\n\t\t{ type: 'property', pattern: new RegExp(`^${XML_TAG_NAME}(?=\\\\s*=)`) },\n\t\t{ type: 'string', pattern: /^\"[^\"]*\"/ },\n\t\t{ type: 'string', pattern: /^'[^']*'/ },\n\t],\n};\n","/**\n * CodeBlockPlugin: orchestrates code block registration by delegating to\n * focused modules for keyboard handling, commands, and service API.\n *\n * Inline responsibilities: NodeSpec, NodeView, InputRule, Toolbar,\n * Middleware, Decorations, and lifecycle hooks (focus tracking).\n */\n\nimport type { Decoration, DecorationSet } from '../../decorations/Decoration.js';\nimport {\n\tinline as inlineDecoration,\n\tnode as nodeDecoration,\n} from '../../decorations/Decoration.js';\nimport { DecorationSet as DecorationSetClass } from '../../decorations/Decoration.js';\nimport { CODE_BLOCK_CSS } from '../../editor/styles/code-block.js';\nimport type { BlockNode } from '../../model/Document.js';\nimport { getBlockText } from '../../model/Document.js';\nimport { escapeHTML } from '../../model/HTMLUtils.js';\nimport type { HTMLExportContext } from '../../model/NodeSpec.js';\nimport { createCollapsedSelection, isCollapsed, isTextSelection } from '../../model/Selection.js';\nimport type { BlockId } from '../../model/TypeBrands.js';\nimport { nodeType } from '../../model/TypeBrands.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { Transaction } from '../../state/Transaction.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 { registerCodeBlockCommands } from './CodeBlockCommands.js';\nimport { registerCodeBlockKeymaps } from './CodeBlockKeyboardHandlers.js';\nimport {\n\tCODE_BLOCK_LOCALE_EN,\n\ttype CodeBlockLocale,\n\tloadCodeBlockLocale,\n} from './CodeBlockLocale.js';\nimport { createCodeBlockNodeViewFactory } from './CodeBlockNodeView.js';\nimport { registerCodeBlockService } from './CodeBlockService.js';\nimport type {\n\tCodeBlockConfig,\n\tCodeBlockKeymap,\n\tSyntaxHighlighter,\n\tSyntaxToken,\n} from './CodeBlockTypes.js';\nimport {\n\tCODE_BLOCK_ICON,\n\tDEFAULT_CONFIG,\n\tDEFAULT_KEYMAP,\n\tSYNTAX_HIGHLIGHTER_SERVICE_KEY,\n} from './CodeBlockTypes.js';\nimport { RegexTokenizer } from './highlighter/RegexTokenizer.js';\nimport { JSON_LANGUAGE } from './highlighter/languages/json.js';\nimport { XML_LANGUAGE } from './highlighter/languages/xml.js';\n\nexport class CodeBlockPlugin implements Plugin {\n\treadonly id = 'code-block';\n\treadonly name = 'Code Block';\n\treadonly priority = 36;\n\n\tprivate readonly config: CodeBlockConfig;\n\tprivate readonly resolvedKeymap: Readonly<Record<keyof CodeBlockKeymap, string | null>>;\n\tprivate context: PluginContext | null = null;\n\tprivate locale!: CodeBlockLocale;\n\tprivate highlighter: SyntaxHighlighter | null = null;\n\tprivate readonly tokenCache = new Map<\n\t\tBlockId,\n\t\t{\n\t\t\treadonly text: string;\n\t\t\treadonly language: string;\n\t\t\treadonly tokens: readonly SyntaxToken[];\n\t\t}\n\t>();\n\n\tconstructor(config?: Partial<CodeBlockConfig>) {\n\t\tthis.config = { ...DEFAULT_CONFIG, ...config };\n\t\tthis.resolvedKeymap = {\n\t\t\t...DEFAULT_KEYMAP,\n\t\t\t...config?.keymap,\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\tCODE_BLOCK_LOCALE_EN,\n\t\t\tloadCodeBlockLocale,\n\t\t);\n\t\tcontext.registerStyleSheet(CODE_BLOCK_CSS);\n\t\tthis.context = context;\n\n\t\tthis.initHighlighter();\n\t\tthis.registerNodeSpec(context);\n\t\tthis.registerNodeView(context);\n\t\tregisterCodeBlockCommands(context, this.config);\n\t\tregisterCodeBlockKeymaps(context, this.config, this.resolvedKeymap);\n\t\tthis.registerInputRule(context);\n\t\tthis.registerToolbarItem(context);\n\t\tthis.registerMiddleware(context);\n\t\tregisterCodeBlockService(context, this.config, () => this.context);\n\t\tthis.registerSyntaxHighlighterService(context);\n\t\tthis.patchTableCellContent(context);\n\t}\n\n\tdestroy(): void {\n\t\tthis.context = null;\n\t\tthis.highlighter = null;\n\t\tthis.tokenCache.clear();\n\t}\n\n\tonStateChange(oldState: EditorState, newState: EditorState, _tr: Transaction): void {\n\t\tif (!this.context) return;\n\n\t\tconst oldBlockId: BlockId | null = !isTextSelection(oldState.selection)\n\t\t\t? null\n\t\t\t: oldState.selection.anchor.blockId;\n\t\tconst newBlockId: BlockId | null = !isTextSelection(newState.selection)\n\t\t\t? null\n\t\t\t: newState.selection.anchor.blockId;\n\n\t\tconst oldBlock: BlockNode | undefined = oldBlockId ? oldState.getBlock(oldBlockId) : undefined;\n\t\tconst newBlock: BlockNode | undefined = newBlockId ? newState.getBlock(newBlockId) : undefined;\n\n\t\tconst wasInCode: boolean = oldBlock?.type === 'code_block';\n\t\tconst nowInCode: boolean = newBlock?.type === 'code_block';\n\n\t\tif (!wasInCode && nowInCode) {\n\t\t\tthis.context.announce(this.locale.enteredCodeBlock);\n\t\t} else if (wasInCode && !nowInCode) {\n\t\t\tthis.context.announce(this.locale.leftCodeBlock);\n\t\t}\n\t}\n\n\tdecorations(state: EditorState): DecorationSet {\n\t\tconst decorations: Decoration[] = [];\n\n\t\tconst focusedBlockId: BlockId | null = this.getFocusedCodeBlockId(state);\n\t\tif (focusedBlockId) {\n\t\t\tdecorations.push(nodeDecoration(focusedBlockId, { class: 'notectl-code-block--focused' }));\n\t\t}\n\n\t\tif (this.highlighter) {\n\t\t\tconst activeBlockIds = new Set<BlockId>();\n\t\t\tfor (const bid of state.getBlockOrder()) {\n\t\t\t\tconst block: BlockNode | undefined = state.getBlock(bid);\n\t\t\t\tif (!block || block.type !== 'code_block') continue;\n\n\t\t\t\tconst lang: string = (block.attrs?.language as string) ?? '';\n\t\t\t\tif (!lang) continue;\n\n\t\t\t\tconst text: string = getBlockText(block);\n\t\t\t\tif (!text) continue;\n\n\t\t\t\tactiveBlockIds.add(bid);\n\t\t\t\tconst tokens: readonly SyntaxToken[] = this.getCachedTokens(bid, text, lang);\n\t\t\t\tfor (const token of tokens) {\n\t\t\t\t\tdecorations.push(\n\t\t\t\t\t\tinlineDecoration(bid, token.from, token.to, {\n\t\t\t\t\t\t\tclass: `notectl-token--${token.type}`,\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Purge stale cache entries\n\t\t\tfor (const cachedId of this.tokenCache.keys()) {\n\t\t\t\tif (!activeBlockIds.has(cachedId)) {\n\t\t\t\t\tthis.tokenCache.delete(cachedId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (decorations.length === 0) return DecorationSetClass.empty;\n\t\treturn DecorationSetClass.create(decorations);\n\t}\n\n\t// --- NodeSpec ---\n\n\tprivate registerNodeSpec(context: PluginContext): void {\n\t\tcontext.registerNodeSpec({\n\t\t\ttype: 'code_block',\n\t\t\tgroup: 'block',\n\t\t\tcontent: { allow: ['text'] },\n\t\t\tselectable: true,\n\t\t\tattrs: {\n\t\t\t\tlanguage: { default: '' },\n\t\t\t\tbackgroundColor: { default: '' },\n\t\t\t},\n\t\t\ttoDOM(node) {\n\t\t\t\tconst pre: HTMLElement = createBlockElement('pre', node.id);\n\t\t\t\tpre.className = 'notectl-code-block';\n\t\t\t\tpre.setAttribute('dir', 'ltr');\n\t\t\t\tconst code: HTMLElement = document.createElement('code');\n\t\t\t\tcode.className = 'notectl-code-block__content';\n\t\t\t\tpre.appendChild(code);\n\t\t\t\treturn pre;\n\t\t\t},\n\t\t\ttoHTML(node, content, ctx?: HTMLExportContext) {\n\t\t\t\tconst lang: string = escapeHTML((node.attrs?.language as string) ?? '');\n\t\t\t\tconst bg: string = escapeHTML((node.attrs?.backgroundColor as string) ?? '');\n\t\t\t\tconst langClass: string = lang ? ` class=\"language-${lang}\"` : '';\n\t\t\t\tconst bgAttr: string = bg\n\t\t\t\t\t? (ctx?.styleAttr(`background-color: ${bg}`) ?? ` style=\"background-color: ${bg}\"`)\n\t\t\t\t\t: '';\n\t\t\t\treturn `<pre dir=\"ltr\"${bgAttr}><code${langClass}>${content || ''}</code></pre>`;\n\t\t\t},\n\t\t\tparseHTML: [\n\t\t\t\t{\n\t\t\t\t\ttag: 'pre',\n\t\t\t\t\tgetAttrs(el: HTMLElement) {\n\t\t\t\t\t\tconst code: HTMLElement | null = el.querySelector('code');\n\t\t\t\t\t\tconst langClass: string = code?.className.match(/language-(\\S+)/)?.[1] ?? '';\n\t\t\t\t\t\tconst dataLang: string = code?.getAttribute('data-language') ?? '';\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tlanguage: dataLang || langClass,\n\t\t\t\t\t\t};\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t\tsanitize: {\n\t\t\t\ttags: ['pre', 'code'],\n\t\t\t\tattrs: ['data-language', 'class', 'style'],\n\t\t\t},\n\t\t});\n\t}\n\n\t// --- NodeView ---\n\n\tprivate registerNodeView(context: PluginContext): void {\n\t\tcontext.registerNodeView(\n\t\t\t'code_block',\n\t\t\tcreateCodeBlockNodeViewFactory(this.config, this.locale),\n\t\t);\n\t}\n\n\t// --- Input Rule ---\n\n\tprivate registerInputRule(context: PluginContext): void {\n\t\tcontext.registerInputRule({\n\t\t\tpattern: /^```(\\w*) $/,\n\t\t\thandler: (state, match, start, _end) => {\n\t\t\t\tconst sel = state.selection;\n\t\t\t\tif (!isTextSelection(sel)) return null;\n\t\t\t\tif (!isCollapsed(sel)) return null;\n\n\t\t\t\tconst block: BlockNode | undefined = state.getBlock(sel.anchor.blockId);\n\t\t\t\tif (!block || block.type !== 'paragraph') return null;\n\n\t\t\t\tconst language: string = match[1] ?? '';\n\t\t\t\tconst attrs: Record<string, string | number | boolean> = {\n\t\t\t\t\tlanguage,\n\t\t\t\t\tbackgroundColor: '',\n\t\t\t\t};\n\n\t\t\t\treturn state\n\t\t\t\t\t.transaction('input')\n\t\t\t\t\t.deleteTextAt(sel.anchor.blockId, start, start + match[0].length)\n\t\t\t\t\t.setBlockType(sel.anchor.blockId, nodeType('code_block'), attrs)\n\t\t\t\t\t.setSelection(createCollapsedSelection(sel.anchor.blockId, 0))\n\t\t\t\t\t.build();\n\t\t\t},\n\t\t});\n\t}\n\n\t// --- Toolbar ---\n\n\tprivate registerToolbarItem(context: PluginContext): void {\n\t\tcontext.registerToolbarItem({\n\t\t\tid: 'code_block',\n\t\t\tgroup: 'block',\n\t\t\ticon: CODE_BLOCK_ICON,\n\t\t\tlabel: this.locale.label,\n\t\t\ttooltip: this.locale.tooltip(\n\t\t\t\tthis.resolvedKeymap.toggle ? formatShortcut(this.resolvedKeymap.toggle) : undefined,\n\t\t\t),\n\t\t\tcommand: 'toggleCodeBlock',\n\t\t\tisActive: (state) => {\n\t\t\t\tif (!isTextSelection(state.selection)) return false;\n\t\t\t\tconst block: BlockNode | undefined = state.getBlock(state.selection.anchor.blockId);\n\t\t\t\treturn block?.type === 'code_block';\n\t\t\t},\n\t\t});\n\t}\n\n\t// --- Middleware (Mark Prevention) ---\n\n\tprivate registerMiddleware(context: PluginContext): void {\n\t\tcontext.registerMiddleware(\n\t\t\t(tr, state, next) => {\n\t\t\t\tconst hasMarkInCodeBlock: boolean = tr.steps.some((step) => {\n\t\t\t\t\tif (step.type !== 'addMark') return false;\n\t\t\t\t\tconst block: BlockNode | undefined = state.getBlock(step.blockId);\n\t\t\t\t\treturn block?.type === 'code_block';\n\t\t\t\t});\n\n\t\t\t\tif (!hasMarkInCodeBlock) {\n\t\t\t\t\tnext(tr);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst filtered = tr.steps.filter((step) => {\n\t\t\t\t\tif (step.type !== 'addMark') return true;\n\t\t\t\t\tconst block: BlockNode | undefined = state.getBlock(step.blockId);\n\t\t\t\t\treturn block?.type !== 'code_block';\n\t\t\t\t});\n\n\t\t\t\tnext({ ...tr, steps: filtered });\n\t\t\t},\n\t\t\t{ name: 'code-block:mark-guard', priority: 50 },\n\t\t);\n\t}\n\n\t// --- Table Cell Patching ---\n\n\tprivate patchTableCellContent(context: PluginContext): void {\n\t\tconst registry = context.getSchemaRegistry();\n\t\tconst cellSpec = registry.getNodeSpec('table_cell');\n\t\tif (!cellSpec?.content) return;\n\n\t\tconst currentAllow: readonly string[] = cellSpec.content.allow ?? [];\n\t\tif (currentAllow.includes('code_block')) return;\n\n\t\tregistry.removeNodeSpec('table_cell');\n\t\tregistry.registerNodeSpec({\n\t\t\t...cellSpec,\n\t\t\tcontent: {\n\t\t\t\t...cellSpec.content,\n\t\t\t\tallow: [...currentAllow, 'code_block'],\n\t\t\t},\n\t\t});\n\t}\n\n\t// --- Highlighter Setup ---\n\n\tprivate initHighlighter(): void {\n\t\tif (this.config.highlighter) {\n\t\t\tthis.highlighter = this.config.highlighter;\n\t\t} else {\n\t\t\tthis.highlighter = new RegexTokenizer([JSON_LANGUAGE, XML_LANGUAGE]);\n\t\t}\n\t}\n\n\tprivate registerSyntaxHighlighterService(context: PluginContext): void {\n\t\tconst tokenizer = this.highlighter;\n\t\tif (!tokenizer) return;\n\n\t\tcontext.registerService(SYNTAX_HIGHLIGHTER_SERVICE_KEY, {\n\t\t\tregisterLanguage: (def) => {\n\t\t\t\ttokenizer.registerLanguage?.(def);\n\t\t\t\tthis.tokenCache.clear();\n\t\t\t},\n\t\t\tgetSupportedLanguages: () => tokenizer.getSupportedLanguages(),\n\t\t\ttokenize: (code, language) => tokenizer.tokenize(code, language),\n\t\t});\n\t}\n\n\tprivate getCachedTokens(\n\t\tblockId: BlockId,\n\t\ttext: string,\n\t\tlanguage: string,\n\t): readonly SyntaxToken[] {\n\t\tconst cached = this.tokenCache.get(blockId);\n\t\tif (cached && cached.text === text && cached.language === language) {\n\t\t\treturn cached.tokens;\n\t\t}\n\t\tconst tokens: readonly SyntaxToken[] = this.highlighter?.tokenize(text, language) ?? [];\n\t\tthis.tokenCache.set(blockId, { text, language, tokens });\n\t\treturn tokens;\n\t}\n\n\t// --- Helpers ---\n\n\tprivate getFocusedCodeBlockId(state: EditorState): BlockId | null {\n\t\tif (!isTextSelection(state.selection)) return null;\n\t\tconst blockId: BlockId = state.selection.anchor.blockId;\n\t\tconst block: BlockNode | undefined = state.getBlock(blockId);\n\t\tif (block?.type === 'code_block') return blockId;\n\t\treturn null;\n\t}\n}\n"],"mappings":"mhBC6BA,SAAS,EACR,EACA,GAEA,MAAM,EAAqB,EAAQ,WACnC,IAAK,EAAgB,EAAM,WAAY,OAAO,EAE9C,MAAM,EAAM,EAAM,UACZ,EAA+B,EAAM,SAAS,EAAI,OAAO,SAC/D,SAAK,GAAwB,eAAf,EAAM,OAEb,EAAQ,CACd,QACA,QACA,QAAS,EAAI,OAAO,QACpB,OAAQ,EAAI,OAAO,SA0HrB,SAAgB,EAAa,GAC5B,OAAO,EAAqB,EAAA,EAAY,QAAO,cAC9C,MAAM,EAAiC,EAAM,gBACvC,EAAc,EAAW,QAAQ,GAEvC,GAAI,EAAM,EAAW,OAAS,EAAG,CAChC,MAAM,EAAkB,EAAW,EAAM,GACnC,EAAkB,EACtB,YAAY,WACZ,aAAa,EAAyB,EAAQ,IAC9C,QACF,EAAQ,SAAS,QAEjB,EAAqB,EAAS,GAG/B,OAAO,IAqHT,SAAS,EAAqB,EAAwB,GACrD,MAAM,EAAqB,EAAQ,WAC7B,EAA+B,EAAM,SAAS,GACpD,IAAK,EAAO,OAEZ,MAAM,EAAsB,EAAe,GACrC,EAAiB,IAEjB,EAAkB,EACtB,YAAY,WACZ,WAAW,EAAK,EAAa,GAC7B,aAAa,EAAO,EAAS,cAC7B,aAAa,EAAyB,EAAO,IAC7C,QAEF,EAAQ,SAAS,GCzQlB,SAAS,EAAgB,EAAwB,GAChD,MAAM,EAAQ,EAAQ,WAChB,EAAM,EAAM,UAClB,IAAK,EAAgB,GAAM,OAAO,EAElC,MAAM,EAA+B,EAAM,SAAS,EAAI,OAAO,S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T4Mn.mjs";import{o as a,s as r}from"./StyleRuntime-0yPPJK9H.mjs";import{r as t,t as f}from"./KeyboardNav-BZIHDPDV.mjs";var o=new Map([["#000000","Black"],["#434343","Dark Gray 4"],["#666666","Dark Gray 3"],["#999999","Dark Gray 2"],["#b7b7b7","Dark Gray 1"],["#cccccc","Light Gray 3"],["#d9d9d9","Light Gray 2"],["#efefef","Light Gray 1"],["#f3f3f3","Near White"],["#ffffff","White"],["#980000","Dark Red Berry"],["#ff0000","Red"],["#ff9900","Orange"],["#ffff00","Yellow"],["#00ff00","Green"],["#00ffff","Cyan"],["#4a86e8","Cornflower Blue"],["#0000ff","Blue"],["#9900ff","Purple"],["#ff00ff","Magenta"],["#e6b8af","Light Red Berry 3"],["#f4cccc","Light Red 3"],["#fce5cd","Light Orange 3"],["#fff2cc","Light Yellow 3"],["#d9ead3","Light Green 3"],["#d0e0e3","Light Cyan 3"],["#c9daf8","Light Cornflower Blue 3"],["#cfe2f3","Light Blue 3"],["#d9d2e9","Light Purple 3"],["#ead1dc","Light Magenta 3"],["#dd7e6b","Light Red Berry 2"],["#ea9999","Light Red 2"],["#f9cb9c","Light Orange 2"],["#ffe599","Light Yellow 2"],["#b6d7a8","Light Green 2"],["#a2c4c9","Light Cyan 2"],["#a4c2f4","Light Cornflower Blue 2"],["#9fc5e8","Light Blue 2"],["#b4a7d6","Light Purple 2"],["#d5a6bd","Light Magenta 2"],["#cc4125","Light Red Berry 1"],["#e06666","Light Red 1"],["#f6b26b","Light Orange 1"],["#ffd966","Light Yellow 1"],["#93c47d","Light Green 1"],["#76a5af","Light Cyan 1"],["#6d9eeb","Light Cornflower Blue 1"],["#6fa8dc","Light Blue 1"],["#8e7cc3","Light Purple 1"],["#c27ba0","Light Magenta 1"],["#a61c00","Dark Red Berry 1"],["#cc0000","Dark Red 1"],["#e69138","Dark Orange 1"],["#f1c232","Dark Yellow 1"],["#6aa84f","Dark Green 1"],["#45818e","Dark Cyan 1"],["#3c78d8","Dark Cornflower Blue 1"],["#3d85c6","Dark Blue 1"],["#674ea7","Dark Purple 1"],["#a64d79","Dark Magenta 1"],["#85200c","Dark Red Berry 2"],["#990000","Dark Red 2"],["#b45f06","Dark Orange 2"],["#bf9000","Dark Yellow 2"],["#38761d","Dark Green 2"],["#134f5c","Dark Cyan 2"],["#1155cc","Dark Cornflower Blue 2"],["#0b5394","Dark Blue 2"],["#351c75","Dark Purple 2"],["#741b47","Dark Magenta 2"],["#fff176","Bright Yellow"],["#aed581","Light Green"],["#4dd0e1","Bright Cyan"],["#64b5f6","Sky Blue"],["#ce93d8","Lavender"],["#f48fb1","Pink"],["#ffab91","Peach"],["#ff8a65","Coral"],["#e6ee9c","Lime"],["#80cbc4","Teal"],["#fff9c4","Pale Yellow"],["#dcedc8","Pale Green"],["#e0f7fa","Pale Cyan"],["#e3f2fd","Pale Blue"],["#f3e5f5","Pale Purple"],["#fce4ec","Pale Pink"],["#fff3e0","Pale Orange"],["#fbe9e7","Pale Red"],["#f9fbe7","Pale Lime"],["#e0f2f1","Pale Teal"],["#fff59d","Soft Yellow"],["#c5e1a5","Soft Green"],["#80deea","Soft Cyan"],["#90caf9","Soft Blue"],["#e1bee7","Soft Purple"],["#f8bbd0","Soft Pink"],["#ffcc80","Soft Orange"],["#a5d6a7","Mint"],["#ffee58","Vivid Yellow"],["#9ccc65","Vivid Green"],["#26c6da","Vivid Cyan"],["#42a5f5","Vivid Blue"],["#ab47bc","Vivid Purple"],["#ec407a","Vivid Pink"],["#ffa726","Vivid Orange"],["#ff7043","Red Orange"],["#d4e157","Vivid Lime"],["#66bb6a","Emerald"],["#fafafa","Almost White"],["#f5f5f5","Lightest Gray"],["#eeeeee","Very Light Gray"],["#e0e0e0","Silver"],["#bdbdbd","Medium Gray"],["#e8eaf6","Lavender Gray"],["#efebe9","Warm Gray"],["#eceff1","Cool Gray"]]);function n(e){return o.get(e.toLowerCase())||function(e){const a=l(e),r=Number.parseInt(a.slice(1,3),16)/255,t=Number.parseInt(a.slice(3,5),16)/255,f=Number.parseInt(a.slice(5,7),16)/255,o=Math.max(r,t,f),n=Math.min(r,t,f),i=(o+n)/2,c=o-n;if(c<.05)return i<.15?"Black":i<.35?"Dark Gray":i<.65?"Gray":i<.85?"Light Gray":"Near White";let s=0;s=o===r?60*((t-f)/c+(t<f?6:0)):o===t?60*((f-r)/c+2):60*((r-t)/c+4);let u="Red";for(const[l,g]of d)if(s<l){u=g;break}return i<.25?`Very Dark ${u}`:i<.4?`Dark ${u}`:i>.8?`Very Light ${u}`:i>.65?`Light ${u}`:u}(e)}function i(e){return function(e){const a=l(e);return.2126*c(Number.parseInt(a.slice(1,3),16)/255)+.7152*c(Number.parseInt(a.slice(3,5),16)/255)+.0722*c(Number.parseInt(a.slice(5,7),16)/255)}(e)>.3}function l(e){const a=e.toLowerCase();return 4===a.length?`#${a[1]}${a[1]}${a[2]}${a[2]}${a[3]}${a[3]}`:a}function c(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}var d=[[15,"Red"],[45,"Orange"],[65,"Yellow"],[150,"Green"],[190,"Cyan"],[250,"Blue"],[290,"Purple"],[330,"Pink"],[361,"Red"]],s=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]);function u(o,l){const c=l.columns,d=l.colors.length,u=Math.ceil(d/c),g=document.createElement("div");g.className="notectl-color-picker__grid",g.setAttribute("role","grid"),g.setAttribute("aria-label",l.ariaLabel);const h=[];let b=0;for(let e=0;e<u;e++){const t=document.createElement("div");t.setAttribute("role","row");for(let f=0;f<c;f++){const o=e*c+f;if(o>=d)break;const s=l.colors[o],u=n(s),g=!!l.activeColor&&l.activeColor.toLowerCase()===s.toLowerCase(),L=document.createElement("button");L.type="button",L.className="notectl-color-picker__swatch",L.setAttribute("role","gridcell");const k=l.swatchLabel?l.swatchLabel(u):`${l.ariaLabelPrefix} ${u}`;L.setAttribute("aria-label",k),L.setAttribute("aria-selected",String(g)),L.dataset.index=String(o),r(L,"backgroundColor",s),L.title=l.titleAsName?u:s,i(s)&&a(L,{border:"1px solid #d0d0d0"}),g&&(L.classList.add("notectl-color-picker__swatch--active"),b=o),L.addEventListener("mousedown",e=>{e.preventDefault(),e.stopPropagation(),l.onSelect(s)}),h.push(L),t.appendChild(L)}g.appendChild(t)}f(h,b),g.addEventListener("keydown",a=>{if("Escape"===a.key)return a.preventDefault(),a.stopPropagation(),void l.onClose();if("Enter"===a.key||" "===a.key){a.preventDefault(),a.stopPropagation();const e=a.target.dataset.index;if(void 0!==e){const a=l.colors[Number(e)];a&&l.onSelect(a)}return}if(s.has(a.key)){a.preventDefault(),a.stopPropagation();const r=Math.floor(b/c)+1,n=b%c+1,i=e(o),[l,s]=t(r,n,u,c,a.key,i);let g=(l-1)*c+(s-1);return g>=d&&(g=d-1),b=g,f(h,b),void h[b]?.focus()}if("Home"===a.key||"End"===a.key){a.preventDefault(),a.stopPropagation();const e=Math.floor(b/c)*c,r=Math.min(e+c-1,d-1);b="Home"===a.key?e:r,f(h,b),h[b]?.focus()}}),o.appendChild(g)}export{n,i as r,u as t};
2
+ //# sourceMappingURL=ColorGrid-taTKtdsm.mjs.map