@notectl/core 2.0.2 → 2.0.4

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 (1134) hide show
  1. package/README.md +258 -123
  2. package/dist/chunks/AlignmentPlugin-DGb1VtCU.mjs +2 -0
  3. package/dist/chunks/AlignmentPlugin-DGb1VtCU.mjs.map +1 -0
  4. package/dist/chunks/AttrRegistry-DvqbnJ6T.mjs +2 -0
  5. package/dist/chunks/AttrRegistry-DvqbnJ6T.mjs.map +1 -0
  6. package/dist/chunks/AttributedMarkCommands-BiJtiHpx.mjs +2 -0
  7. package/dist/chunks/AttributedMarkCommands-BiJtiHpx.mjs.map +1 -0
  8. package/dist/chunks/BlockInsertion-Q8B21SaG.mjs +2 -0
  9. package/dist/chunks/BlockInsertion-Q8B21SaG.mjs.map +1 -0
  10. package/dist/chunks/BlockTypePickerRegistry-5fFlS2i0.mjs +2 -0
  11. package/dist/chunks/BlockTypePickerRegistry-5fFlS2i0.mjs.map +1 -0
  12. package/dist/chunks/BlockquotePlugin-Dz8Pny1r.mjs +2 -0
  13. package/dist/chunks/BlockquotePlugin-Dz8Pny1r.mjs.map +1 -0
  14. package/dist/chunks/CaretNavigationPlugin-mQ1nxJ6m.mjs +2 -0
  15. package/dist/chunks/CaretNavigationPlugin-mQ1nxJ6m.mjs.map +1 -0
  16. package/dist/chunks/CodeBlockPlugin-oPGiMno0.mjs +2 -0
  17. package/dist/chunks/CodeBlockPlugin-oPGiMno0.mjs.map +1 -0
  18. package/dist/chunks/ColorGrid-CcF0bH26.mjs +2 -0
  19. package/dist/chunks/ColorGrid-CcF0bH26.mjs.map +1 -0
  20. package/dist/chunks/ColorPickerPopup-BZxMBDxy.mjs +2 -0
  21. package/dist/chunks/ColorPickerPopup-BZxMBDxy.mjs.map +1 -0
  22. package/dist/chunks/ColorValidation-rOrJxBBt.mjs +2 -0
  23. package/dist/chunks/ColorValidation-rOrJxBBt.mjs.map +1 -0
  24. package/dist/chunks/CommandHelpers-G6M-qXJR.mjs +2 -0
  25. package/dist/chunks/CommandHelpers-G6M-qXJR.mjs.map +1 -0
  26. package/dist/chunks/Commands-ByBjgD3-.mjs +2 -0
  27. package/dist/chunks/Commands-ByBjgD3-.mjs.map +1 -0
  28. package/dist/chunks/Decoration-D-yB-H5v.mjs +2 -0
  29. package/dist/chunks/Decoration-D-yB-H5v.mjs.map +1 -0
  30. package/dist/chunks/Document-DnPKbcPE.mjs +2 -0
  31. package/dist/chunks/Document-DnPKbcPE.mjs.map +1 -0
  32. package/dist/chunks/DocumentParser-KuBaEZN6.mjs +2 -0
  33. package/dist/chunks/DocumentParser-KuBaEZN6.mjs.map +1 -0
  34. package/dist/chunks/DocumentSerializer-DgdiJsES.mjs +2 -0
  35. package/dist/chunks/DocumentSerializer-DgdiJsES.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-DYntd3gN.mjs +2 -0
  39. package/dist/chunks/FontPlugin-DYntd3gN.mjs.map +1 -0
  40. package/dist/chunks/FontSizePlugin-CGlH-S6g.mjs +2 -0
  41. package/dist/chunks/FontSizePlugin-CGlH-S6g.mjs.map +1 -0
  42. package/dist/chunks/GapCursorNavigation-uytzcZ6C.mjs +2 -0
  43. package/dist/chunks/GapCursorNavigation-uytzcZ6C.mjs.map +1 -0
  44. package/dist/chunks/GapCursorPlugin-BQ2_-7i6.mjs +2 -0
  45. package/dist/chunks/GapCursorPlugin-BQ2_-7i6.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-CCrP_Kec.mjs +2 -0
  49. package/dist/chunks/HardBreakPlugin-CCrP_Kec.mjs.map +1 -0
  50. package/dist/chunks/HeadingPlugin-BiDNuBmw.mjs +2 -0
  51. package/dist/chunks/HeadingPlugin-BiDNuBmw.mjs.map +1 -0
  52. package/dist/chunks/HighlightPlugin-CwrtRVfS.mjs +2 -0
  53. package/dist/chunks/HighlightPlugin-CwrtRVfS.mjs.map +1 -0
  54. package/dist/chunks/HorizontalRulePlugin-CKIkbVwn.mjs +2 -0
  55. package/dist/chunks/HorizontalRulePlugin-CKIkbVwn.mjs.map +1 -0
  56. package/dist/chunks/ImagePlugin-BqRAKlG1.mjs +2 -0
  57. package/dist/chunks/ImagePlugin-BqRAKlG1.mjs.map +1 -0
  58. package/dist/chunks/KeyboardNav-IMWHB6wc.mjs +2 -0
  59. package/dist/chunks/KeyboardNav-IMWHB6wc.mjs.map +1 -0
  60. package/dist/chunks/LinkPlugin-Cb2cpFe8.mjs +2 -0
  61. package/dist/chunks/LinkPlugin-Cb2cpFe8.mjs.map +1 -0
  62. package/dist/chunks/ListPlugin-CZgkinoS.mjs +2 -0
  63. package/dist/chunks/ListPlugin-CZgkinoS.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-BkOsZnuU.mjs +2 -0
  67. package/dist/chunks/NodeResolver-BkOsZnuU.mjs.map +1 -0
  68. package/dist/chunks/NodeSelectionCommands-U8xEdaE4.mjs +2 -0
  69. package/dist/chunks/NodeSelectionCommands-U8xEdaE4.mjs.map +1 -0
  70. package/dist/chunks/Platform-wPvKFB9m.mjs +2 -0
  71. package/dist/chunks/Platform-wPvKFB9m.mjs.map +1 -0
  72. package/dist/chunks/Plugin-C4cBw3bs.mjs +2 -0
  73. package/dist/chunks/Plugin-C4cBw3bs.mjs.map +1 -0
  74. package/dist/chunks/PluginHelpers-BZU5rE44.mjs +2 -0
  75. package/dist/chunks/PluginHelpers-BZU5rE44.mjs.map +1 -0
  76. package/dist/chunks/PopupManager-S2qQtTxR.mjs +2 -0
  77. package/dist/chunks/PopupManager-S2qQtTxR.mjs.map +1 -0
  78. package/dist/chunks/PopupPositioning-BdSCai19.mjs +2 -0
  79. package/dist/chunks/PopupPositioning-BdSCai19.mjs.map +1 -0
  80. package/dist/chunks/PrintPlugin-80SINLGF.mjs +2 -0
  81. package/dist/chunks/PrintPlugin-80SINLGF.mjs.map +1 -0
  82. package/dist/chunks/PrintTypes-CWIAfEaX.mjs +2 -0
  83. package/dist/chunks/PrintTypes-CWIAfEaX.mjs.map +1 -0
  84. package/dist/chunks/RangeIterator-DEuX1xKV.mjs +2 -0
  85. package/dist/chunks/RangeIterator-DEuX1xKV.mjs.map +1 -0
  86. package/dist/chunks/Selection-B14e7gd0.mjs +2 -0
  87. package/dist/chunks/Selection-B14e7gd0.mjs.map +1 -0
  88. package/dist/chunks/ShortcutFormatting-c0IajwWG.mjs +2 -0
  89. package/dist/chunks/ShortcutFormatting-c0IajwWG.mjs.map +1 -0
  90. package/dist/chunks/SmartPastePlugin-BvYBbHSA.mjs +2 -0
  91. package/dist/chunks/SmartPastePlugin-BvYBbHSA.mjs.map +1 -0
  92. package/dist/chunks/StrikethroughPlugin-XBOGv5Oi.mjs +2 -0
  93. package/dist/chunks/StrikethroughPlugin-XBOGv5Oi.mjs.map +1 -0
  94. package/dist/chunks/StyleRuntime-Bwde5icB.mjs +2 -0
  95. package/dist/chunks/StyleRuntime-Bwde5icB.mjs.map +1 -0
  96. package/dist/chunks/SuperSubPlugin-CVjU4W9y.mjs +2 -0
  97. package/dist/chunks/SuperSubPlugin-CVjU4W9y.mjs.map +1 -0
  98. package/dist/chunks/SyntaxTokenTypes-CY2-rJCA.mjs +2 -0
  99. package/dist/chunks/SyntaxTokenTypes-CY2-rJCA.mjs.map +1 -0
  100. package/dist/chunks/TablePlugin-BHpp6h9H.mjs +2 -0
  101. package/dist/chunks/TablePlugin-BHpp6h9H.mjs.map +1 -0
  102. package/dist/chunks/TextColorPlugin-CGbyMGTr.mjs +2 -0
  103. package/dist/chunks/TextColorPlugin-CGbyMGTr.mjs.map +1 -0
  104. package/dist/chunks/TextDirectionCorePlugin-DPU7wy6g.mjs +2 -0
  105. package/dist/chunks/TextDirectionCorePlugin-DPU7wy6g.mjs.map +1 -0
  106. package/dist/chunks/TextDirectionLocale-DxOfFixh.mjs +2 -0
  107. package/dist/chunks/TextDirectionLocale-DxOfFixh.mjs.map +1 -0
  108. package/dist/chunks/TextFormattingPlugin-CYVnhHH4.mjs +2 -0
  109. package/dist/chunks/TextFormattingPlugin-CYVnhHH4.mjs.map +1 -0
  110. package/dist/chunks/ToolbarPlugin-CWDkWXE8.mjs +2 -0
  111. package/dist/chunks/ToolbarPlugin-CWDkWXE8.mjs.map +1 -0
  112. package/dist/chunks/TypeBrands-BQR8dEYU.mjs +2 -0
  113. package/dist/chunks/TypeBrands-BQR8dEYU.mjs.map +1 -0
  114. package/dist/chunks/WordBoundary-BkxXn2JA.mjs +2 -0
  115. package/dist/chunks/WordBoundary-BkxXn2JA.mjs.map +1 -0
  116. package/dist/chunks/XmlDetector-BiWxa0RJ.mjs +2 -0
  117. package/dist/chunks/XmlDetector-BiWxa0RJ.mjs.map +1 -0
  118. package/dist/chunks/XmlPatterns-B-V-mHF4.mjs +2 -0
  119. package/dist/chunks/XmlPatterns-B-V-mHF4.mjs.map +1 -0
  120. package/dist/chunks/XmlSupport-Czr8xQB1.mjs +2 -0
  121. package/dist/chunks/XmlSupport-Czr8xQB1.mjs.map +1 -0
  122. package/dist/chunks/ar-BARk0vUs.mjs +2 -0
  123. package/dist/chunks/ar-BARk0vUs.mjs.map +1 -0
  124. package/dist/chunks/ar-BVnwjtBO.mjs +2 -0
  125. package/dist/chunks/ar-BVnwjtBO.mjs.map +1 -0
  126. package/dist/chunks/ar-BaLVMaVO.mjs +2 -0
  127. package/dist/chunks/ar-BaLVMaVO.mjs.map +1 -0
  128. package/dist/chunks/ar-BbXyJVxi.mjs +2 -0
  129. package/dist/chunks/ar-BbXyJVxi.mjs.map +1 -0
  130. package/dist/chunks/ar-Bj_U3O6Y.mjs +2 -0
  131. package/dist/chunks/ar-Bj_U3O6Y.mjs.map +1 -0
  132. package/dist/chunks/ar-CLEiZlfu.mjs +2 -0
  133. package/dist/chunks/ar-CLEiZlfu.mjs.map +1 -0
  134. package/dist/chunks/ar-CaE825oi.mjs +2 -0
  135. package/dist/chunks/ar-CaE825oi.mjs.map +1 -0
  136. package/dist/chunks/ar-CaRHAfkM.mjs +2 -0
  137. package/dist/chunks/ar-CaRHAfkM.mjs.map +1 -0
  138. package/dist/chunks/ar-Cg1wGAxo.mjs +2 -0
  139. package/dist/chunks/ar-Cg1wGAxo.mjs.map +1 -0
  140. package/dist/chunks/ar-Cp9qv7la.mjs +2 -0
  141. package/dist/chunks/ar-Cp9qv7la.mjs.map +1 -0
  142. package/dist/chunks/ar-CpZXocgF.mjs +2 -0
  143. package/dist/chunks/ar-CpZXocgF.mjs.map +1 -0
  144. package/dist/chunks/ar-CqD9pUY0.mjs +2 -0
  145. package/dist/chunks/ar-CqD9pUY0.mjs.map +1 -0
  146. package/dist/chunks/ar-D1DiKwV_.mjs +2 -0
  147. package/dist/chunks/ar-D1DiKwV_.mjs.map +1 -0
  148. package/dist/chunks/ar-D714r_62.mjs +2 -0
  149. package/dist/chunks/ar-D714r_62.mjs.map +1 -0
  150. package/dist/chunks/ar-D8hT58sd.mjs +2 -0
  151. package/dist/chunks/ar-D8hT58sd.mjs.map +1 -0
  152. package/dist/chunks/ar-DYA1zADy.mjs +2 -0
  153. package/dist/chunks/ar-DYA1zADy.mjs.map +1 -0
  154. package/dist/chunks/ar-Dc2VufjD.mjs +2 -0
  155. package/dist/chunks/ar-Dc2VufjD.mjs.map +1 -0
  156. package/dist/chunks/ar-DsmIDxDt.mjs +2 -0
  157. package/dist/chunks/ar-DsmIDxDt.mjs.map +1 -0
  158. package/dist/chunks/ar-M3QzJIS8.mjs +2 -0
  159. package/dist/chunks/ar-M3QzJIS8.mjs.map +1 -0
  160. package/dist/chunks/ar-UKi-TYFz.mjs +2 -0
  161. package/dist/chunks/ar-UKi-TYFz.mjs.map +1 -0
  162. package/dist/chunks/ar-UfrdJzT6.mjs +2 -0
  163. package/dist/chunks/ar-UfrdJzT6.mjs.map +1 -0
  164. package/dist/chunks/ar-fGsuiCw5.mjs +2 -0
  165. package/dist/chunks/ar-fGsuiCw5.mjs.map +1 -0
  166. package/dist/chunks/ar-fSElw9mJ.mjs +2 -0
  167. package/dist/chunks/ar-fSElw9mJ.mjs.map +1 -0
  168. package/dist/chunks/color-picker-iPmE48jm.mjs +2 -0
  169. package/dist/chunks/color-picker-iPmE48jm.mjs.map +1 -0
  170. package/dist/chunks/de-B4BcTYnc.mjs +2 -0
  171. package/dist/chunks/de-B4BcTYnc.mjs.map +1 -0
  172. package/dist/chunks/de-B7H06L3l.mjs +2 -0
  173. package/dist/chunks/de-B7H06L3l.mjs.map +1 -0
  174. package/dist/chunks/de-BWk2-9In.mjs +2 -0
  175. package/dist/chunks/de-BWk2-9In.mjs.map +1 -0
  176. package/dist/chunks/de-ByDTr_of.mjs +2 -0
  177. package/dist/chunks/de-ByDTr_of.mjs.map +1 -0
  178. package/dist/chunks/de-C5If_e7l.mjs +2 -0
  179. package/dist/chunks/de-C5If_e7l.mjs.map +1 -0
  180. package/dist/chunks/de-CAmM7IT5.mjs +2 -0
  181. package/dist/chunks/de-CAmM7IT5.mjs.map +1 -0
  182. package/dist/chunks/de-CF7zshOE.mjs +2 -0
  183. package/dist/chunks/de-CF7zshOE.mjs.map +1 -0
  184. package/dist/chunks/de-CXAESa_f.mjs +2 -0
  185. package/dist/chunks/de-CXAESa_f.mjs.map +1 -0
  186. package/dist/chunks/de-ChvJQZeC.mjs +2 -0
  187. package/dist/chunks/de-ChvJQZeC.mjs.map +1 -0
  188. package/dist/chunks/de-ClJaNWJr.mjs +2 -0
  189. package/dist/chunks/de-ClJaNWJr.mjs.map +1 -0
  190. package/dist/chunks/de-CpNFM0EP.mjs +2 -0
  191. package/dist/chunks/de-CpNFM0EP.mjs.map +1 -0
  192. package/dist/chunks/de-CwSQIBLx.mjs +2 -0
  193. package/dist/chunks/de-CwSQIBLx.mjs.map +1 -0
  194. package/dist/chunks/de-D3lxYgJa.mjs +2 -0
  195. package/dist/chunks/de-D3lxYgJa.mjs.map +1 -0
  196. package/dist/chunks/de-D8gRtvU4.mjs +2 -0
  197. package/dist/chunks/de-D8gRtvU4.mjs.map +1 -0
  198. package/dist/chunks/de-D_9IOrAk.mjs +2 -0
  199. package/dist/chunks/de-D_9IOrAk.mjs.map +1 -0
  200. package/dist/chunks/de-DcwZkO0v.mjs +2 -0
  201. package/dist/chunks/de-DcwZkO0v.mjs.map +1 -0
  202. package/dist/chunks/de-DeSVCxbd.mjs +2 -0
  203. package/dist/chunks/de-DeSVCxbd.mjs.map +1 -0
  204. package/dist/chunks/de-DqxnR2Y8.mjs +2 -0
  205. package/dist/chunks/de-DqxnR2Y8.mjs.map +1 -0
  206. package/dist/chunks/de-J82qPFkV.mjs +2 -0
  207. package/dist/chunks/de-J82qPFkV.mjs.map +1 -0
  208. package/dist/chunks/de-QDbUiCAO.mjs +2 -0
  209. package/dist/chunks/de-QDbUiCAO.mjs.map +1 -0
  210. package/dist/chunks/de-eAQXJdL9.mjs +2 -0
  211. package/dist/chunks/de-eAQXJdL9.mjs.map +1 -0
  212. package/dist/chunks/de-hneXQd4z.mjs +2 -0
  213. package/dist/chunks/de-hneXQd4z.mjs.map +1 -0
  214. package/dist/chunks/de-wXAi5Jyt.mjs +2 -0
  215. package/dist/chunks/de-wXAi5Jyt.mjs.map +1 -0
  216. package/dist/chunks/es-5c_5O95N.mjs +2 -0
  217. package/dist/chunks/es-5c_5O95N.mjs.map +1 -0
  218. package/dist/chunks/es-B2QB6DHA.mjs +2 -0
  219. package/dist/chunks/es-B2QB6DHA.mjs.map +1 -0
  220. package/dist/chunks/es-BEcu8DtV.mjs +2 -0
  221. package/dist/chunks/es-BEcu8DtV.mjs.map +1 -0
  222. package/dist/chunks/es-BXTkzYVW.mjs +2 -0
  223. package/dist/chunks/es-BXTkzYVW.mjs.map +1 -0
  224. package/dist/chunks/es-BemQV8dI.mjs +2 -0
  225. package/dist/chunks/es-BemQV8dI.mjs.map +1 -0
  226. package/dist/chunks/es-BfJM5zJ5.mjs +2 -0
  227. package/dist/chunks/es-BfJM5zJ5.mjs.map +1 -0
  228. package/dist/chunks/es-CnqxzYfU.mjs +2 -0
  229. package/dist/chunks/es-CnqxzYfU.mjs.map +1 -0
  230. package/dist/chunks/es-CrZtAd3-.mjs +2 -0
  231. package/dist/chunks/es-CrZtAd3-.mjs.map +1 -0
  232. package/dist/chunks/es-CsCCy0S5.mjs +2 -0
  233. package/dist/chunks/es-CsCCy0S5.mjs.map +1 -0
  234. package/dist/chunks/es-D62AfyHC.mjs +2 -0
  235. package/dist/chunks/es-D62AfyHC.mjs.map +1 -0
  236. package/dist/chunks/es-DA_zUbSs.mjs +2 -0
  237. package/dist/chunks/es-DA_zUbSs.mjs.map +1 -0
  238. package/dist/chunks/es-DFCDhXJb.mjs +2 -0
  239. package/dist/chunks/es-DFCDhXJb.mjs.map +1 -0
  240. package/dist/chunks/es-DHMIpSfB.mjs +2 -0
  241. package/dist/chunks/es-DHMIpSfB.mjs.map +1 -0
  242. package/dist/chunks/es-DIH9KVn1.mjs +2 -0
  243. package/dist/chunks/es-DIH9KVn1.mjs.map +1 -0
  244. package/dist/chunks/es-DOHIPZYT.mjs +2 -0
  245. package/dist/chunks/es-DOHIPZYT.mjs.map +1 -0
  246. package/dist/chunks/es-DPyejgTk.mjs +2 -0
  247. package/dist/chunks/es-DPyejgTk.mjs.map +1 -0
  248. package/dist/chunks/es-DUVk_Wkc.mjs +2 -0
  249. package/dist/chunks/es-DUVk_Wkc.mjs.map +1 -0
  250. package/dist/chunks/es-Di4t0cUf.mjs +2 -0
  251. package/dist/chunks/es-Di4t0cUf.mjs.map +1 -0
  252. package/dist/chunks/es-DjwvgN1j.mjs +2 -0
  253. package/dist/chunks/es-DjwvgN1j.mjs.map +1 -0
  254. package/dist/chunks/es-Nawgghri.mjs +2 -0
  255. package/dist/chunks/es-Nawgghri.mjs.map +1 -0
  256. package/dist/chunks/es-SuOzBFT7.mjs +2 -0
  257. package/dist/chunks/es-SuOzBFT7.mjs.map +1 -0
  258. package/dist/chunks/es-gB6GcNGB.mjs +2 -0
  259. package/dist/chunks/es-gB6GcNGB.mjs.map +1 -0
  260. package/dist/chunks/es-xSr9miNk.mjs +2 -0
  261. package/dist/chunks/es-xSr9miNk.mjs.map +1 -0
  262. package/dist/chunks/fonts-CG_dDwvT.mjs +2 -0
  263. package/dist/chunks/fonts-CG_dDwvT.mjs.map +1 -0
  264. package/dist/chunks/fr-B35gBW5Z.mjs +2 -0
  265. package/dist/chunks/fr-B35gBW5Z.mjs.map +1 -0
  266. package/dist/chunks/fr-BFngqWSa.mjs +2 -0
  267. package/dist/chunks/fr-BFngqWSa.mjs.map +1 -0
  268. package/dist/chunks/fr-BZRak2_s.mjs +2 -0
  269. package/dist/chunks/fr-BZRak2_s.mjs.map +1 -0
  270. package/dist/chunks/fr-Bj_GziCv.mjs +2 -0
  271. package/dist/chunks/fr-Bj_GziCv.mjs.map +1 -0
  272. package/dist/chunks/fr-BushvDBo.mjs +2 -0
  273. package/dist/chunks/fr-BushvDBo.mjs.map +1 -0
  274. package/dist/chunks/fr-Bz2JMdw5.mjs +2 -0
  275. package/dist/chunks/fr-Bz2JMdw5.mjs.map +1 -0
  276. package/dist/chunks/fr-C2y-quYa.mjs +2 -0
  277. package/dist/chunks/fr-C2y-quYa.mjs.map +1 -0
  278. package/dist/chunks/fr-C5g40qHr.mjs +2 -0
  279. package/dist/chunks/fr-C5g40qHr.mjs.map +1 -0
  280. package/dist/chunks/fr-CRPVlCtC.mjs +2 -0
  281. package/dist/chunks/fr-CRPVlCtC.mjs.map +1 -0
  282. package/dist/chunks/fr-Cf0xNw5j.mjs +2 -0
  283. package/dist/chunks/fr-Cf0xNw5j.mjs.map +1 -0
  284. package/dist/chunks/fr-Cr62KfH7.mjs +2 -0
  285. package/dist/chunks/fr-Cr62KfH7.mjs.map +1 -0
  286. package/dist/chunks/fr-D6XZTFJa.mjs +2 -0
  287. package/dist/chunks/fr-D6XZTFJa.mjs.map +1 -0
  288. package/dist/chunks/fr-D9u2mcht.mjs +2 -0
  289. package/dist/chunks/fr-D9u2mcht.mjs.map +1 -0
  290. package/dist/chunks/fr-DEWFKFrW.mjs +2 -0
  291. package/dist/chunks/fr-DEWFKFrW.mjs.map +1 -0
  292. package/dist/chunks/fr-DGBuhK3D.mjs +2 -0
  293. package/dist/chunks/fr-DGBuhK3D.mjs.map +1 -0
  294. package/dist/chunks/fr-DQBLPLlz.mjs +2 -0
  295. package/dist/chunks/fr-DQBLPLlz.mjs.map +1 -0
  296. package/dist/chunks/fr-DQM130Rf.mjs +2 -0
  297. package/dist/chunks/fr-DQM130Rf.mjs.map +1 -0
  298. package/dist/chunks/fr-Dg5SMkMo.mjs +2 -0
  299. package/dist/chunks/fr-Dg5SMkMo.mjs.map +1 -0
  300. package/dist/chunks/fr-Dv0GIx7Q.mjs +2 -0
  301. package/dist/chunks/fr-Dv0GIx7Q.mjs.map +1 -0
  302. package/dist/chunks/fr-DyGGhKFe.mjs +2 -0
  303. package/dist/chunks/fr-DyGGhKFe.mjs.map +1 -0
  304. package/dist/chunks/fr-DzQfRP8y.mjs +2 -0
  305. package/dist/chunks/fr-DzQfRP8y.mjs.map +1 -0
  306. package/dist/chunks/fr-SxdLDSEQ.mjs +2 -0
  307. package/dist/chunks/fr-SxdLDSEQ.mjs.map +1 -0
  308. package/dist/chunks/fr-VGC8qZxr.mjs +2 -0
  309. package/dist/chunks/fr-VGC8qZxr.mjs.map +1 -0
  310. package/dist/chunks/full-B-bw4M7L.mjs +2 -0
  311. package/dist/chunks/full-B-bw4M7L.mjs.map +1 -0
  312. package/dist/chunks/hi-8AQg9KKV.mjs +2 -0
  313. package/dist/chunks/hi-8AQg9KKV.mjs.map +1 -0
  314. package/dist/chunks/hi-B0EvMNl3.mjs +2 -0
  315. package/dist/chunks/hi-B0EvMNl3.mjs.map +1 -0
  316. package/dist/chunks/hi-B5sPMUNb.mjs +2 -0
  317. package/dist/chunks/hi-B5sPMUNb.mjs.map +1 -0
  318. package/dist/chunks/hi-BOfcnulc.mjs +2 -0
  319. package/dist/chunks/hi-BOfcnulc.mjs.map +1 -0
  320. package/dist/chunks/hi-BUveHWCk.mjs +2 -0
  321. package/dist/chunks/hi-BUveHWCk.mjs.map +1 -0
  322. package/dist/chunks/hi-BZ_n8-zx.mjs +2 -0
  323. package/dist/chunks/hi-BZ_n8-zx.mjs.map +1 -0
  324. package/dist/chunks/hi-BeLhPZ5d.mjs +2 -0
  325. package/dist/chunks/hi-BeLhPZ5d.mjs.map +1 -0
  326. package/dist/chunks/hi-Bg8jWcjX.mjs +2 -0
  327. package/dist/chunks/hi-Bg8jWcjX.mjs.map +1 -0
  328. package/dist/chunks/hi-BktVy4Yc.mjs +2 -0
  329. package/dist/chunks/hi-BktVy4Yc.mjs.map +1 -0
  330. package/dist/chunks/hi-Btg6DNgW.mjs +2 -0
  331. package/dist/chunks/hi-Btg6DNgW.mjs.map +1 -0
  332. package/dist/chunks/hi-C20PmckT.mjs +2 -0
  333. package/dist/chunks/hi-C20PmckT.mjs.map +1 -0
  334. package/dist/chunks/hi-C2DDsttW.mjs +2 -0
  335. package/dist/chunks/hi-C2DDsttW.mjs.map +1 -0
  336. package/dist/chunks/hi-CCDCfQV0.mjs +2 -0
  337. package/dist/chunks/hi-CCDCfQV0.mjs.map +1 -0
  338. package/dist/chunks/hi-CWX5sDy1.mjs +2 -0
  339. package/dist/chunks/hi-CWX5sDy1.mjs.map +1 -0
  340. package/dist/chunks/hi-ClSwgZfK.mjs +2 -0
  341. package/dist/chunks/hi-ClSwgZfK.mjs.map +1 -0
  342. package/dist/chunks/hi-D-apR3ri.mjs +2 -0
  343. package/dist/chunks/hi-D-apR3ri.mjs.map +1 -0
  344. package/dist/chunks/hi-D6ZQ_R6m.mjs +2 -0
  345. package/dist/chunks/hi-D6ZQ_R6m.mjs.map +1 -0
  346. package/dist/chunks/hi-D_rhcSL3.mjs +2 -0
  347. package/dist/chunks/hi-D_rhcSL3.mjs.map +1 -0
  348. package/dist/chunks/hi-DcA0CxZR.mjs +2 -0
  349. package/dist/chunks/hi-DcA0CxZR.mjs.map +1 -0
  350. package/dist/chunks/hi-Dd2GOD9r.mjs +2 -0
  351. package/dist/chunks/hi-Dd2GOD9r.mjs.map +1 -0
  352. package/dist/chunks/hi-DkEmvBok.mjs +2 -0
  353. package/dist/chunks/hi-DkEmvBok.mjs.map +1 -0
  354. package/dist/chunks/hi-nfmm9uwI.mjs +2 -0
  355. package/dist/chunks/hi-nfmm9uwI.mjs.map +1 -0
  356. package/dist/chunks/hi-wBX612X_.mjs +2 -0
  357. package/dist/chunks/hi-wBX612X_.mjs.map +1 -0
  358. package/dist/chunks/minimal-CMt909kl.mjs +2 -0
  359. package/dist/chunks/minimal-CMt909kl.mjs.map +1 -0
  360. package/dist/chunks/pt-BGQ7Sh6p.mjs +2 -0
  361. package/dist/chunks/pt-BGQ7Sh6p.mjs.map +1 -0
  362. package/dist/chunks/pt-BGQj9xok.mjs +2 -0
  363. package/dist/chunks/pt-BGQj9xok.mjs.map +1 -0
  364. package/dist/chunks/pt-BL5xNIhC.mjs +2 -0
  365. package/dist/chunks/pt-BL5xNIhC.mjs.map +1 -0
  366. package/dist/chunks/pt-BM8sUzpI.mjs +2 -0
  367. package/dist/chunks/pt-BM8sUzpI.mjs.map +1 -0
  368. package/dist/chunks/pt-BVLuZULN.mjs +2 -0
  369. package/dist/chunks/pt-BVLuZULN.mjs.map +1 -0
  370. package/dist/chunks/pt-BlGlrx3M.mjs +2 -0
  371. package/dist/chunks/pt-BlGlrx3M.mjs.map +1 -0
  372. package/dist/chunks/pt-CKaXK1FK.mjs +2 -0
  373. package/dist/chunks/pt-CKaXK1FK.mjs.map +1 -0
  374. package/dist/chunks/pt-CMpzmrVu.mjs +2 -0
  375. package/dist/chunks/pt-CMpzmrVu.mjs.map +1 -0
  376. package/dist/chunks/pt-Cw77qSTP.mjs +2 -0
  377. package/dist/chunks/pt-Cw77qSTP.mjs.map +1 -0
  378. package/dist/chunks/pt-DBNe2BiX.mjs +2 -0
  379. package/dist/chunks/pt-DBNe2BiX.mjs.map +1 -0
  380. package/dist/chunks/pt-DCfJFt-v.mjs +2 -0
  381. package/dist/chunks/pt-DCfJFt-v.mjs.map +1 -0
  382. package/dist/chunks/pt-DEs0I6eo.mjs +2 -0
  383. package/dist/chunks/pt-DEs0I6eo.mjs.map +1 -0
  384. package/dist/chunks/pt-DKONqS4g.mjs +2 -0
  385. package/dist/chunks/pt-DKONqS4g.mjs.map +1 -0
  386. package/dist/chunks/pt-DO4FbPvV.mjs +2 -0
  387. package/dist/chunks/pt-DO4FbPvV.mjs.map +1 -0
  388. package/dist/chunks/pt-DbDOQjV-.mjs +2 -0
  389. package/dist/chunks/pt-DbDOQjV-.mjs.map +1 -0
  390. package/dist/chunks/pt-DiYv0Ubf.mjs +2 -0
  391. package/dist/chunks/pt-DiYv0Ubf.mjs.map +1 -0
  392. package/dist/chunks/pt-Dk4Mr4yC.mjs +2 -0
  393. package/dist/chunks/pt-Dk4Mr4yC.mjs.map +1 -0
  394. package/dist/chunks/pt-DpLB51hL.mjs +2 -0
  395. package/dist/chunks/pt-DpLB51hL.mjs.map +1 -0
  396. package/dist/chunks/pt-Q5jXPjWo.mjs +2 -0
  397. package/dist/chunks/pt-Q5jXPjWo.mjs.map +1 -0
  398. package/dist/chunks/pt-kFy3gqNp.mjs +2 -0
  399. package/dist/chunks/pt-kFy3gqNp.mjs.map +1 -0
  400. package/dist/chunks/pt-ncNSxrVp.mjs +2 -0
  401. package/dist/chunks/pt-ncNSxrVp.mjs.map +1 -0
  402. package/dist/chunks/pt-tUVNk-7W.mjs +2 -0
  403. package/dist/chunks/pt-tUVNk-7W.mjs.map +1 -0
  404. package/dist/chunks/pt-zzij5vS0.mjs +2 -0
  405. package/dist/chunks/pt-zzij5vS0.mjs.map +1 -0
  406. package/dist/chunks/rolldown-runtime-B8Ku5yk6.mjs +1 -0
  407. package/dist/chunks/ru-B-XR4L6x.mjs +2 -0
  408. package/dist/chunks/ru-B-XR4L6x.mjs.map +1 -0
  409. package/dist/chunks/ru-B00ZXSqu.mjs +2 -0
  410. package/dist/chunks/ru-B00ZXSqu.mjs.map +1 -0
  411. package/dist/chunks/ru-B5wvkAtV.mjs +2 -0
  412. package/dist/chunks/ru-B5wvkAtV.mjs.map +1 -0
  413. package/dist/chunks/ru-BA5-gdMK.mjs +2 -0
  414. package/dist/chunks/ru-BA5-gdMK.mjs.map +1 -0
  415. package/dist/chunks/ru-BNTSKpWh.mjs +2 -0
  416. package/dist/chunks/ru-BNTSKpWh.mjs.map +1 -0
  417. package/dist/chunks/ru-BRy-L-TF.mjs +2 -0
  418. package/dist/chunks/ru-BRy-L-TF.mjs.map +1 -0
  419. package/dist/chunks/ru-BZrPeSDg.mjs +2 -0
  420. package/dist/chunks/ru-BZrPeSDg.mjs.map +1 -0
  421. package/dist/chunks/ru-B_8ujIHK.mjs +2 -0
  422. package/dist/chunks/ru-B_8ujIHK.mjs.map +1 -0
  423. package/dist/chunks/ru-BbgvH6r3.mjs +2 -0
  424. package/dist/chunks/ru-BbgvH6r3.mjs.map +1 -0
  425. package/dist/chunks/ru-CDm5R5CV.mjs +2 -0
  426. package/dist/chunks/ru-CDm5R5CV.mjs.map +1 -0
  427. package/dist/chunks/ru-CWLFWYwd.mjs +2 -0
  428. package/dist/chunks/ru-CWLFWYwd.mjs.map +1 -0
  429. package/dist/chunks/ru-CqsCwBQ_.mjs +2 -0
  430. package/dist/chunks/ru-CqsCwBQ_.mjs.map +1 -0
  431. package/dist/chunks/ru-CsFv_mi4.mjs +2 -0
  432. package/dist/chunks/ru-CsFv_mi4.mjs.map +1 -0
  433. package/dist/chunks/ru-Cv9Zbbn2.mjs +2 -0
  434. package/dist/chunks/ru-Cv9Zbbn2.mjs.map +1 -0
  435. package/dist/chunks/ru-CyTNK9dE.mjs +2 -0
  436. package/dist/chunks/ru-CyTNK9dE.mjs.map +1 -0
  437. package/dist/chunks/ru-DEkLlarB.mjs +2 -0
  438. package/dist/chunks/ru-DEkLlarB.mjs.map +1 -0
  439. package/dist/chunks/ru-DZge62_-.mjs +2 -0
  440. package/dist/chunks/ru-DZge62_-.mjs.map +1 -0
  441. package/dist/chunks/ru-DiVRD-Ds.mjs +2 -0
  442. package/dist/chunks/ru-DiVRD-Ds.mjs.map +1 -0
  443. package/dist/chunks/ru-DkP8YLYT.mjs +2 -0
  444. package/dist/chunks/ru-DkP8YLYT.mjs.map +1 -0
  445. package/dist/chunks/ru-OKZRZ5c-.mjs +2 -0
  446. package/dist/chunks/ru-OKZRZ5c-.mjs.map +1 -0
  447. package/dist/chunks/ru-aYY1QVJS.mjs +2 -0
  448. package/dist/chunks/ru-aYY1QVJS.mjs.map +1 -0
  449. package/dist/chunks/ru-ejPBB15H.mjs +2 -0
  450. package/dist/chunks/ru-ejPBB15H.mjs.map +1 -0
  451. package/dist/chunks/ru-tp62bXSj.mjs +2 -0
  452. package/dist/chunks/ru-tp62bXSj.mjs.map +1 -0
  453. package/dist/chunks/shared-DJ08jwra.mjs +2 -0
  454. package/dist/chunks/shared-DJ08jwra.mjs.map +1 -0
  455. package/dist/chunks/src-dxsvbiql.mjs +2 -0
  456. package/dist/chunks/src-dxsvbiql.mjs.map +1 -0
  457. package/dist/chunks/text-direction-advanced-B71gUwvk.mjs +2 -0
  458. package/dist/chunks/text-direction-advanced-B71gUwvk.mjs.map +1 -0
  459. package/dist/chunks/zh-2gEqF3OX.mjs +2 -0
  460. package/dist/chunks/zh-2gEqF3OX.mjs.map +1 -0
  461. package/dist/chunks/zh-B5J1sSsk.mjs +2 -0
  462. package/dist/chunks/zh-B5J1sSsk.mjs.map +1 -0
  463. package/dist/chunks/zh-B5LmYVQ2.mjs +2 -0
  464. package/dist/chunks/zh-B5LmYVQ2.mjs.map +1 -0
  465. package/dist/chunks/zh-BBOheLpv.mjs +2 -0
  466. package/dist/chunks/zh-BBOheLpv.mjs.map +1 -0
  467. package/dist/chunks/zh-BOy5F5Jq.mjs +2 -0
  468. package/dist/chunks/zh-BOy5F5Jq.mjs.map +1 -0
  469. package/dist/chunks/zh-BRlo0ayI.mjs +2 -0
  470. package/dist/chunks/zh-BRlo0ayI.mjs.map +1 -0
  471. package/dist/chunks/zh-BgTAzt6l.mjs +2 -0
  472. package/dist/chunks/zh-BgTAzt6l.mjs.map +1 -0
  473. package/dist/chunks/zh-BjY4TNQf.mjs +2 -0
  474. package/dist/chunks/zh-BjY4TNQf.mjs.map +1 -0
  475. package/dist/chunks/zh-BtD9NFJS.mjs +2 -0
  476. package/dist/chunks/zh-BtD9NFJS.mjs.map +1 -0
  477. package/dist/chunks/zh-BvSLqJFE.mjs +2 -0
  478. package/dist/chunks/zh-BvSLqJFE.mjs.map +1 -0
  479. package/dist/chunks/zh-C4rxe0Zk.mjs +2 -0
  480. package/dist/chunks/zh-C4rxe0Zk.mjs.map +1 -0
  481. package/dist/chunks/zh-CyX2tIRP.mjs +2 -0
  482. package/dist/chunks/zh-CyX2tIRP.mjs.map +1 -0
  483. package/dist/chunks/zh-D9QN2C7q.mjs +2 -0
  484. package/dist/chunks/zh-D9QN2C7q.mjs.map +1 -0
  485. package/dist/chunks/zh-DTnSCP1F.mjs +2 -0
  486. package/dist/chunks/zh-DTnSCP1F.mjs.map +1 -0
  487. package/dist/chunks/zh-DWlBkrGZ.mjs +2 -0
  488. package/dist/chunks/zh-DWlBkrGZ.mjs.map +1 -0
  489. package/dist/chunks/zh-DcY4Ouin.mjs +2 -0
  490. package/dist/chunks/zh-DcY4Ouin.mjs.map +1 -0
  491. package/dist/chunks/zh-DovMZIDF.mjs +2 -0
  492. package/dist/chunks/zh-DovMZIDF.mjs.map +1 -0
  493. package/dist/chunks/zh-DtzwqBHS.mjs +2 -0
  494. package/dist/chunks/zh-DtzwqBHS.mjs.map +1 -0
  495. package/dist/chunks/zh-DunJzfVR.mjs +2 -0
  496. package/dist/chunks/zh-DunJzfVR.mjs.map +1 -0
  497. package/dist/chunks/zh-Pd1HqYSs.mjs +2 -0
  498. package/dist/chunks/zh-Pd1HqYSs.mjs.map +1 -0
  499. package/dist/chunks/zh-Yvqfkdln.mjs +2 -0
  500. package/dist/chunks/zh-Yvqfkdln.mjs.map +1 -0
  501. package/dist/chunks/zh-Z9seusJc.mjs +2 -0
  502. package/dist/chunks/zh-Z9seusJc.mjs.map +1 -0
  503. package/dist/chunks/zh-fAa_AbWI.mjs +2 -0
  504. package/dist/chunks/zh-fAa_AbWI.mjs.map +1 -0
  505. package/dist/commands/CommandHelpers.d.ts +0 -2
  506. package/dist/commands/CommandHelpers.d.ts.map +1 -1
  507. package/dist/commands/Commands.d.ts +1 -1
  508. package/dist/commands/Commands.d.ts.map +1 -1
  509. package/dist/commands/GapCursorCommands.d.ts.map +1 -1
  510. package/dist/commands/NodeSelectionCommands.d.ts.map +1 -1
  511. package/dist/commands/RangeIterator.d.ts +6 -0
  512. package/dist/commands/RangeIterator.d.ts.map +1 -1
  513. package/dist/editor/EditorInitializer.d.ts.map +1 -1
  514. package/dist/editor/styles/code-block.d.ts +1 -1
  515. package/dist/editor/styles/code-block.d.ts.map +1 -1
  516. package/dist/editor/styles/color-picker.d.ts +1 -1
  517. package/dist/editor/styles/color-picker.d.ts.map +1 -1
  518. package/dist/editor/styles/font-size-select.d.ts +1 -1
  519. package/dist/editor/styles/font-size-select.d.ts.map +1 -1
  520. package/dist/editor/styles/image.d.ts +1 -1
  521. package/dist/editor/styles/image.d.ts.map +1 -1
  522. package/dist/editor/styles/table.d.ts +1 -1
  523. package/dist/editor/styles/table.d.ts.map +1 -1
  524. package/dist/editor/styles/toolbar.d.ts +1 -1
  525. package/dist/editor/styles/toolbar.d.ts.map +1 -1
  526. package/dist/editor/theme/SyntaxTokenTypes.d.ts +26 -0
  527. package/dist/editor/theme/SyntaxTokenTypes.d.ts.map +1 -0
  528. package/dist/editor/theme/ThemeEngine.d.ts.map +1 -1
  529. package/dist/editor/theme/ThemeTokens.d.ts +6 -16
  530. package/dist/editor/theme/ThemeTokens.d.ts.map +1 -1
  531. package/dist/fonts.mjs +1 -2
  532. package/dist/full.d.ts +1 -0
  533. package/dist/full.d.ts.map +1 -1
  534. package/dist/full.mjs +1 -2
  535. package/dist/html.mjs +1 -2
  536. package/dist/index.d.ts +4 -2
  537. package/dist/index.d.ts.map +1 -1
  538. package/dist/model/Document.d.ts +2 -0
  539. package/dist/model/Document.d.ts.map +1 -1
  540. package/dist/model/KeymapRegistry.d.ts.map +1 -1
  541. package/dist/notectl-core.mjs +1 -2
  542. package/dist/notectl-core.umd.js +2 -2
  543. package/dist/notectl-core.umd.js.map +1 -1
  544. package/dist/plugins/alignment.mjs +1 -2
  545. package/dist/plugins/blockquote.mjs +1 -2
  546. package/dist/plugins/caret-navigation.mjs +1 -2
  547. package/dist/plugins/code-block/CodeBlockCommands.d.ts +5 -0
  548. package/dist/plugins/code-block/CodeBlockCommands.d.ts.map +1 -1
  549. package/dist/plugins/code-block/CodeBlockLocale.d.ts +2 -0
  550. package/dist/plugins/code-block/CodeBlockLocale.d.ts.map +1 -1
  551. package/dist/plugins/code-block/CodeBlockNodeView.d.ts.map +1 -1
  552. package/dist/plugins/code-block/CodeBlockPlugin.d.ts +4 -0
  553. package/dist/plugins/code-block/CodeBlockPlugin.d.ts.map +1 -1
  554. package/dist/plugins/code-block/CodeBlockTypes.d.ts +2 -1
  555. package/dist/plugins/code-block/CodeBlockTypes.d.ts.map +1 -1
  556. package/dist/plugins/code-block/highlighter/TokenizerTypes.d.ts +2 -4
  557. package/dist/plugins/code-block/highlighter/TokenizerTypes.d.ts.map +1 -1
  558. package/dist/plugins/code-block/highlighter/languages/index.d.ts +1 -0
  559. package/dist/plugins/code-block/highlighter/languages/index.d.ts.map +1 -1
  560. package/dist/plugins/code-block/highlighter/languages/java.d.ts +3 -0
  561. package/dist/plugins/code-block/highlighter/languages/java.d.ts.map +1 -0
  562. package/dist/plugins/code-block/highlighter/languages/xml.d.ts.map +1 -1
  563. package/dist/plugins/code-block/index.d.ts +1 -0
  564. package/dist/plugins/code-block/index.d.ts.map +1 -1
  565. package/dist/plugins/code-block/locales/ar.d.ts.map +1 -1
  566. package/dist/plugins/code-block/locales/de.d.ts.map +1 -1
  567. package/dist/plugins/code-block/locales/es.d.ts.map +1 -1
  568. package/dist/plugins/code-block/locales/fr.d.ts.map +1 -1
  569. package/dist/plugins/code-block/locales/hi.d.ts.map +1 -1
  570. package/dist/plugins/code-block/locales/pt.d.ts.map +1 -1
  571. package/dist/plugins/code-block/locales/ru.d.ts.map +1 -1
  572. package/dist/plugins/code-block/locales/zh.d.ts.map +1 -1
  573. package/dist/plugins/code-block.mjs +1 -2
  574. package/dist/plugins/font-size.mjs +1 -2
  575. package/dist/plugins/font.mjs +1 -2
  576. package/dist/plugins/gap-cursor.mjs +1 -2
  577. package/dist/plugins/hard-break.mjs +1 -2
  578. package/dist/plugins/heading.mjs +1 -2
  579. package/dist/plugins/highlight.mjs +1 -2
  580. package/dist/plugins/horizontal-rule.mjs +1 -2
  581. package/dist/plugins/image.mjs +1 -2
  582. package/dist/plugins/language/LanguageRegistry.d.ts +15 -0
  583. package/dist/plugins/language/LanguageRegistry.d.ts.map +1 -0
  584. package/dist/plugins/language/LanguageTypes.d.ts +54 -0
  585. package/dist/plugins/language/LanguageTypes.d.ts.map +1 -0
  586. package/dist/plugins/language/bundles/JavaSupport.d.ts +3 -0
  587. package/dist/plugins/language/bundles/JavaSupport.d.ts.map +1 -0
  588. package/dist/plugins/language/bundles/JsonSupport.d.ts +3 -0
  589. package/dist/plugins/language/bundles/JsonSupport.d.ts.map +1 -0
  590. package/dist/plugins/language/bundles/XmlSupport.d.ts +3 -0
  591. package/dist/plugins/language/bundles/XmlSupport.d.ts.map +1 -0
  592. package/dist/plugins/language/bundles/index.d.ts +4 -0
  593. package/dist/plugins/language/bundles/index.d.ts.map +1 -0
  594. package/dist/plugins/language/index.d.ts +4 -0
  595. package/dist/plugins/language/index.d.ts.map +1 -0
  596. package/dist/plugins/language.mjs +1 -0
  597. package/dist/plugins/link.mjs +1 -2
  598. package/dist/plugins/list/ListAttrsFactory.d.ts +5 -0
  599. package/dist/plugins/list/ListAttrsFactory.d.ts.map +1 -0
  600. package/dist/plugins/list/ListCommands.d.ts +13 -0
  601. package/dist/plugins/list/ListCommands.d.ts.map +1 -0
  602. package/dist/plugins/list/ListDefinitions.d.ts +9 -0
  603. package/dist/plugins/list/ListDefinitions.d.ts.map +1 -0
  604. package/dist/plugins/list/ListInputRules.d.ts +5 -0
  605. package/dist/plugins/list/ListInputRules.d.ts.map +1 -0
  606. package/dist/plugins/list/ListKeyboardHandlers.d.ts +4 -0
  607. package/dist/plugins/list/ListKeyboardHandlers.d.ts.map +1 -0
  608. package/dist/plugins/list/ListPlugin.d.ts +0 -22
  609. package/dist/plugins/list/ListPlugin.d.ts.map +1 -1
  610. package/dist/plugins/list/ListToolbarItems.d.ts +6 -0
  611. package/dist/plugins/list/ListToolbarItems.d.ts.map +1 -0
  612. package/dist/plugins/list.mjs +1 -2
  613. package/dist/plugins/print/PrintContentPreparer.d.ts.map +1 -1
  614. package/dist/plugins/print.mjs +1 -2
  615. package/dist/plugins/shared/PopupPositioning.d.ts +20 -0
  616. package/dist/plugins/shared/PopupPositioning.d.ts.map +1 -1
  617. package/dist/plugins/shared.mjs +1 -2
  618. package/dist/plugins/smart-paste/ContentSplitter.d.ts +14 -0
  619. package/dist/plugins/smart-paste/ContentSplitter.d.ts.map +1 -0
  620. package/dist/plugins/smart-paste/SmartPasteLocale.d.ts +1 -0
  621. package/dist/plugins/smart-paste/SmartPasteLocale.d.ts.map +1 -1
  622. package/dist/plugins/smart-paste/SmartPastePlugin.d.ts +6 -1
  623. package/dist/plugins/smart-paste/SmartPastePlugin.d.ts.map +1 -1
  624. package/dist/plugins/smart-paste/SmartPasteTypes.d.ts +5 -0
  625. package/dist/plugins/smart-paste/SmartPasteTypes.d.ts.map +1 -1
  626. package/dist/plugins/smart-paste/detectors/JavaDetector.d.ts +7 -0
  627. package/dist/plugins/smart-paste/detectors/JavaDetector.d.ts.map +1 -0
  628. package/dist/plugins/smart-paste/index.d.ts +2 -1
  629. package/dist/plugins/smart-paste/index.d.ts.map +1 -1
  630. package/dist/plugins/smart-paste/locales/ar.d.ts.map +1 -1
  631. package/dist/plugins/smart-paste/locales/de.d.ts.map +1 -1
  632. package/dist/plugins/smart-paste/locales/es.d.ts.map +1 -1
  633. package/dist/plugins/smart-paste/locales/fr.d.ts.map +1 -1
  634. package/dist/plugins/smart-paste/locales/hi.d.ts.map +1 -1
  635. package/dist/plugins/smart-paste/locales/pt.d.ts.map +1 -1
  636. package/dist/plugins/smart-paste/locales/ru.d.ts.map +1 -1
  637. package/dist/plugins/smart-paste/locales/zh.d.ts.map +1 -1
  638. package/dist/plugins/smart-paste.mjs +1 -2
  639. package/dist/plugins/strikethrough.mjs +1 -2
  640. package/dist/plugins/super-sub.mjs +1 -2
  641. package/dist/plugins/table/TableCommands.d.ts.map +1 -1
  642. package/dist/plugins/table/TableContextMenu.d.ts.map +1 -1
  643. package/dist/plugins/table.mjs +1 -2
  644. package/dist/plugins/text-color.mjs +1 -2
  645. package/dist/plugins/text-direction-advanced.mjs +1 -2
  646. package/dist/plugins/text-direction.mjs +1 -2
  647. package/dist/plugins/text-formatting.mjs +1 -2
  648. package/dist/plugins/toolbar/ToolbarOverflowController.d.ts.map +1 -1
  649. package/dist/plugins/toolbar/ToolbarTooltip.d.ts.map +1 -1
  650. package/dist/plugins/toolbar.mjs +1 -2
  651. package/dist/presets/full.mjs +1 -2
  652. package/dist/presets/minimal.mjs +1 -2
  653. package/dist/presets.mjs +1 -2
  654. package/dist/view/CaretNavigation.d.ts +9 -2
  655. package/dist/view/CaretNavigation.d.ts.map +1 -1
  656. package/dist/view/DomPointUtils.d.ts +2 -3
  657. package/dist/view/DomPointUtils.d.ts.map +1 -1
  658. package/dist/view/EditorViewEvents.d.ts.map +1 -1
  659. package/dist/view/EditorViewNavigation.d.ts.map +1 -1
  660. package/package.json +8 -4
  661. package/dist/chunks/AttrRegistry-iNpjvcSG.mjs +0 -2
  662. package/dist/chunks/AttrRegistry-iNpjvcSG.mjs.map +0 -1
  663. package/dist/chunks/AttributedMarkCommands-BY1BSYWM.mjs +0 -2
  664. package/dist/chunks/AttributedMarkCommands-BY1BSYWM.mjs.map +0 -1
  665. package/dist/chunks/BlockInsertion-BJFhE0jA.mjs +0 -2
  666. package/dist/chunks/BlockInsertion-BJFhE0jA.mjs.map +0 -1
  667. package/dist/chunks/BlockTypePickerRegistry-DcSE6IXB.mjs +0 -2
  668. package/dist/chunks/BlockTypePickerRegistry-DcSE6IXB.mjs.map +0 -1
  669. package/dist/chunks/ColorGrid-CpkbKfXg.mjs +0 -2
  670. package/dist/chunks/ColorGrid-CpkbKfXg.mjs.map +0 -1
  671. package/dist/chunks/ColorPickerPopup-D6XjShhv.mjs +0 -2
  672. package/dist/chunks/ColorPickerPopup-D6XjShhv.mjs.map +0 -1
  673. package/dist/chunks/ColorValidation-DCSKq9B2.mjs +0 -2
  674. package/dist/chunks/ColorValidation-DCSKq9B2.mjs.map +0 -1
  675. package/dist/chunks/CommandHelpers-M6mPS6Ww.mjs +0 -2
  676. package/dist/chunks/CommandHelpers-M6mPS6Ww.mjs.map +0 -1
  677. package/dist/chunks/Commands-D_gMCnVa.mjs +0 -2
  678. package/dist/chunks/Commands-D_gMCnVa.mjs.map +0 -1
  679. package/dist/chunks/Decoration-D49mFXrH.mjs +0 -2
  680. package/dist/chunks/Decoration-D49mFXrH.mjs.map +0 -1
  681. package/dist/chunks/Document-3pNX7ear.mjs +0 -2
  682. package/dist/chunks/Document-3pNX7ear.mjs.map +0 -1
  683. package/dist/chunks/DocumentParser-LvzDQOd1.mjs +0 -2
  684. package/dist/chunks/DocumentParser-LvzDQOd1.mjs.map +0 -1
  685. package/dist/chunks/DomUtils-CznMAZZg.mjs +0 -2
  686. package/dist/chunks/DomUtils-CznMAZZg.mjs.map +0 -1
  687. package/dist/chunks/HTMLUtils-Cxy99Ak2.mjs +0 -2
  688. package/dist/chunks/HTMLUtils-Cxy99Ak2.mjs.map +0 -1
  689. package/dist/chunks/HeadingPlugin-BmkeUXj8.mjs +0 -2
  690. package/dist/chunks/HeadingPlugin-BmkeUXj8.mjs.map +0 -1
  691. package/dist/chunks/KeyboardNav-DsYhKKuV.mjs +0 -2
  692. package/dist/chunks/KeyboardNav-DsYhKKuV.mjs.map +0 -1
  693. package/dist/chunks/MarkCommands-CeCa4WSC.mjs +0 -2
  694. package/dist/chunks/MarkCommands-CeCa4WSC.mjs.map +0 -1
  695. package/dist/chunks/NavigationQueries-11qe4j9x.mjs +0 -2
  696. package/dist/chunks/NavigationQueries-11qe4j9x.mjs.map +0 -1
  697. package/dist/chunks/NodeResolver-z0ReCR34.mjs +0 -2
  698. package/dist/chunks/NodeResolver-z0ReCR34.mjs.map +0 -1
  699. package/dist/chunks/NodeSelectionCommands-CXrOcPtG.mjs +0 -2
  700. package/dist/chunks/NodeSelectionCommands-CXrOcPtG.mjs.map +0 -1
  701. package/dist/chunks/NotectlEditor-BJD7-FFx.mjs +0 -4
  702. package/dist/chunks/NotectlEditor-BJD7-FFx.mjs.map +0 -1
  703. package/dist/chunks/Platform-CU6itXZo.mjs +0 -2
  704. package/dist/chunks/Platform-CU6itXZo.mjs.map +0 -1
  705. package/dist/chunks/PluginHelpers-CdPR0MuT.mjs +0 -2
  706. package/dist/chunks/PluginHelpers-CdPR0MuT.mjs.map +0 -1
  707. package/dist/chunks/PopupManager-0b_Q0m7K.mjs +0 -2
  708. package/dist/chunks/PopupManager-0b_Q0m7K.mjs.map +0 -1
  709. package/dist/chunks/PopupPositioning-DtvqMSop.mjs +0 -2
  710. package/dist/chunks/PopupPositioning-DtvqMSop.mjs.map +0 -1
  711. package/dist/chunks/PrintTypes-DukwDSWS.mjs +0 -2
  712. package/dist/chunks/PrintTypes-DukwDSWS.mjs.map +0 -1
  713. package/dist/chunks/RangeIterator-XFN5FaYf.mjs +0 -2
  714. package/dist/chunks/RangeIterator-XFN5FaYf.mjs.map +0 -1
  715. package/dist/chunks/Selection-DhbizDM4.mjs +0 -2
  716. package/dist/chunks/Selection-DhbizDM4.mjs.map +0 -1
  717. package/dist/chunks/SelectionTransactions-DzIZxcuN.mjs +0 -2
  718. package/dist/chunks/SelectionTransactions-DzIZxcuN.mjs.map +0 -1
  719. package/dist/chunks/ShortcutFormatting-BLKS0Gys.mjs +0 -2
  720. package/dist/chunks/ShortcutFormatting-BLKS0Gys.mjs.map +0 -1
  721. package/dist/chunks/StyleRuntime-BmsLoEa8.mjs +0 -2
  722. package/dist/chunks/StyleRuntime-BmsLoEa8.mjs.map +0 -1
  723. package/dist/chunks/TextDirectionLocale-CKz0ZrH_.mjs +0 -2
  724. package/dist/chunks/TextDirectionLocale-CKz0ZrH_.mjs.map +0 -1
  725. package/dist/chunks/TypeBrands-Bp_Z_o5Y.mjs +0 -2
  726. package/dist/chunks/TypeBrands-Bp_Z_o5Y.mjs.map +0 -1
  727. package/dist/chunks/XmlPatterns-DxQXGjP8.mjs +0 -2
  728. package/dist/chunks/XmlPatterns-DxQXGjP8.mjs.map +0 -1
  729. package/dist/chunks/ar-B93SPJT7.mjs +0 -2
  730. package/dist/chunks/ar-B93SPJT7.mjs.map +0 -1
  731. package/dist/chunks/ar-BAmGa08u.mjs +0 -2
  732. package/dist/chunks/ar-BAmGa08u.mjs.map +0 -1
  733. package/dist/chunks/ar-BYNFEVLc.mjs +0 -2
  734. package/dist/chunks/ar-BYNFEVLc.mjs.map +0 -1
  735. package/dist/chunks/ar-Bnc7y8BP.mjs +0 -2
  736. package/dist/chunks/ar-Bnc7y8BP.mjs.map +0 -1
  737. package/dist/chunks/ar-Bp3rDZky.mjs +0 -2
  738. package/dist/chunks/ar-Bp3rDZky.mjs.map +0 -1
  739. package/dist/chunks/ar-BtOQ7lro.mjs +0 -2
  740. package/dist/chunks/ar-BtOQ7lro.mjs.map +0 -1
  741. package/dist/chunks/ar-C5JEHhw9.mjs +0 -2
  742. package/dist/chunks/ar-C5JEHhw9.mjs.map +0 -1
  743. package/dist/chunks/ar-CL3QL0tw.mjs +0 -2
  744. package/dist/chunks/ar-CL3QL0tw.mjs.map +0 -1
  745. package/dist/chunks/ar-CYtG-XlN.mjs +0 -2
  746. package/dist/chunks/ar-CYtG-XlN.mjs.map +0 -1
  747. package/dist/chunks/ar-CzVj8p__.mjs +0 -2
  748. package/dist/chunks/ar-CzVj8p__.mjs.map +0 -1
  749. package/dist/chunks/ar-D7PS3e2g.mjs +0 -2
  750. package/dist/chunks/ar-D7PS3e2g.mjs.map +0 -1
  751. package/dist/chunks/ar-D8adM2Uy.mjs +0 -2
  752. package/dist/chunks/ar-D8adM2Uy.mjs.map +0 -1
  753. package/dist/chunks/ar-D9jyShaB.mjs +0 -2
  754. package/dist/chunks/ar-D9jyShaB.mjs.map +0 -1
  755. package/dist/chunks/ar-DR6OA3ZO.mjs +0 -2
  756. package/dist/chunks/ar-DR6OA3ZO.mjs.map +0 -1
  757. package/dist/chunks/ar-Deibepjm.mjs +0 -2
  758. package/dist/chunks/ar-Deibepjm.mjs.map +0 -1
  759. package/dist/chunks/ar-Dlb5riUN.mjs +0 -2
  760. package/dist/chunks/ar-Dlb5riUN.mjs.map +0 -1
  761. package/dist/chunks/ar-DmmxE2W7.mjs +0 -2
  762. package/dist/chunks/ar-DmmxE2W7.mjs.map +0 -1
  763. package/dist/chunks/ar-Ds6Z2Gzf.mjs +0 -2
  764. package/dist/chunks/ar-Ds6Z2Gzf.mjs.map +0 -1
  765. package/dist/chunks/ar-DtIHQ8nU.mjs +0 -2
  766. package/dist/chunks/ar-DtIHQ8nU.mjs.map +0 -1
  767. package/dist/chunks/ar-J8B-on-0.mjs +0 -2
  768. package/dist/chunks/ar-J8B-on-0.mjs.map +0 -1
  769. package/dist/chunks/ar-b6VdnxAs.mjs +0 -2
  770. package/dist/chunks/ar-b6VdnxAs.mjs.map +0 -1
  771. package/dist/chunks/ar-iU02mRe5.mjs +0 -2
  772. package/dist/chunks/ar-iU02mRe5.mjs.map +0 -1
  773. package/dist/chunks/ar-mSCYQYnL.mjs +0 -2
  774. package/dist/chunks/ar-mSCYQYnL.mjs.map +0 -1
  775. package/dist/chunks/color-picker-Byjl_xr9.mjs +0 -2
  776. package/dist/chunks/color-picker-Byjl_xr9.mjs.map +0 -1
  777. package/dist/chunks/de-8aCC5jBM.mjs +0 -2
  778. package/dist/chunks/de-8aCC5jBM.mjs.map +0 -1
  779. package/dist/chunks/de-B4y4ndUw.mjs +0 -2
  780. package/dist/chunks/de-B4y4ndUw.mjs.map +0 -1
  781. package/dist/chunks/de-B5fcZ0FQ.mjs +0 -2
  782. package/dist/chunks/de-B5fcZ0FQ.mjs.map +0 -1
  783. package/dist/chunks/de-BT9VmwoJ.mjs +0 -2
  784. package/dist/chunks/de-BT9VmwoJ.mjs.map +0 -1
  785. package/dist/chunks/de-BZWSyJTG.mjs +0 -2
  786. package/dist/chunks/de-BZWSyJTG.mjs.map +0 -1
  787. package/dist/chunks/de-CFD_Wgik.mjs +0 -2
  788. package/dist/chunks/de-CFD_Wgik.mjs.map +0 -1
  789. package/dist/chunks/de-CLYtb6kD.mjs +0 -2
  790. package/dist/chunks/de-CLYtb6kD.mjs.map +0 -1
  791. package/dist/chunks/de-CP5v-98M.mjs +0 -2
  792. package/dist/chunks/de-CP5v-98M.mjs.map +0 -1
  793. package/dist/chunks/de-CYJ6uWno.mjs +0 -2
  794. package/dist/chunks/de-CYJ6uWno.mjs.map +0 -1
  795. package/dist/chunks/de-ChcKkF7A.mjs +0 -2
  796. package/dist/chunks/de-ChcKkF7A.mjs.map +0 -1
  797. package/dist/chunks/de-CicoU066.mjs +0 -2
  798. package/dist/chunks/de-CicoU066.mjs.map +0 -1
  799. package/dist/chunks/de-CjLAdBt2.mjs +0 -2
  800. package/dist/chunks/de-CjLAdBt2.mjs.map +0 -1
  801. package/dist/chunks/de-CtFvAXwF.mjs +0 -2
  802. package/dist/chunks/de-CtFvAXwF.mjs.map +0 -1
  803. package/dist/chunks/de-D1OAXtxJ.mjs +0 -2
  804. package/dist/chunks/de-D1OAXtxJ.mjs.map +0 -1
  805. package/dist/chunks/de-DBbzCQrm.mjs +0 -2
  806. package/dist/chunks/de-DBbzCQrm.mjs.map +0 -1
  807. package/dist/chunks/de-DOLwx_M7.mjs +0 -2
  808. package/dist/chunks/de-DOLwx_M7.mjs.map +0 -1
  809. package/dist/chunks/de-De2miMxo.mjs +0 -2
  810. package/dist/chunks/de-De2miMxo.mjs.map +0 -1
  811. package/dist/chunks/de-OTfhhinm.mjs +0 -2
  812. package/dist/chunks/de-OTfhhinm.mjs.map +0 -1
  813. package/dist/chunks/de-PZ9-LlBp.mjs +0 -2
  814. package/dist/chunks/de-PZ9-LlBp.mjs.map +0 -1
  815. package/dist/chunks/de-UREymH-5.mjs +0 -2
  816. package/dist/chunks/de-UREymH-5.mjs.map +0 -1
  817. package/dist/chunks/de-chYdoK9q.mjs +0 -2
  818. package/dist/chunks/de-chYdoK9q.mjs.map +0 -1
  819. package/dist/chunks/de-fXvs5vQT.mjs +0 -2
  820. package/dist/chunks/de-fXvs5vQT.mjs.map +0 -1
  821. package/dist/chunks/de-xJh5C_pk.mjs +0 -2
  822. package/dist/chunks/de-xJh5C_pk.mjs.map +0 -1
  823. package/dist/chunks/es-B9UhsaEI.mjs +0 -2
  824. package/dist/chunks/es-B9UhsaEI.mjs.map +0 -1
  825. package/dist/chunks/es-BHGwPgrP.mjs +0 -2
  826. package/dist/chunks/es-BHGwPgrP.mjs.map +0 -1
  827. package/dist/chunks/es-BTqy_aQ4.mjs +0 -2
  828. package/dist/chunks/es-BTqy_aQ4.mjs.map +0 -1
  829. package/dist/chunks/es-BbGOZGS_.mjs +0 -2
  830. package/dist/chunks/es-BbGOZGS_.mjs.map +0 -1
  831. package/dist/chunks/es-BjPsub0k.mjs +0 -2
  832. package/dist/chunks/es-BjPsub0k.mjs.map +0 -1
  833. package/dist/chunks/es-Bk0bRDFE.mjs +0 -2
  834. package/dist/chunks/es-Bk0bRDFE.mjs.map +0 -1
  835. package/dist/chunks/es-BkS6DsrM.mjs +0 -2
  836. package/dist/chunks/es-BkS6DsrM.mjs.map +0 -1
  837. package/dist/chunks/es-BzEpr4Bk.mjs +0 -2
  838. package/dist/chunks/es-BzEpr4Bk.mjs.map +0 -1
  839. package/dist/chunks/es-C2lnWyA0.mjs +0 -2
  840. package/dist/chunks/es-C2lnWyA0.mjs.map +0 -1
  841. package/dist/chunks/es-C7e35Muh.mjs +0 -2
  842. package/dist/chunks/es-C7e35Muh.mjs.map +0 -1
  843. package/dist/chunks/es-CBk43isB.mjs +0 -2
  844. package/dist/chunks/es-CBk43isB.mjs.map +0 -1
  845. package/dist/chunks/es-CE8t9fuM.mjs +0 -2
  846. package/dist/chunks/es-CE8t9fuM.mjs.map +0 -1
  847. package/dist/chunks/es-CFjzqIbS.mjs +0 -2
  848. package/dist/chunks/es-CFjzqIbS.mjs.map +0 -1
  849. package/dist/chunks/es-Ce-AEYxc.mjs +0 -2
  850. package/dist/chunks/es-Ce-AEYxc.mjs.map +0 -1
  851. package/dist/chunks/es-Co4AJr8Y.mjs +0 -2
  852. package/dist/chunks/es-Co4AJr8Y.mjs.map +0 -1
  853. package/dist/chunks/es-Cu5_OA4X.mjs +0 -2
  854. package/dist/chunks/es-Cu5_OA4X.mjs.map +0 -1
  855. package/dist/chunks/es-Cud6JXHf.mjs +0 -2
  856. package/dist/chunks/es-Cud6JXHf.mjs.map +0 -1
  857. package/dist/chunks/es-D-II7LZC.mjs +0 -2
  858. package/dist/chunks/es-D-II7LZC.mjs.map +0 -1
  859. package/dist/chunks/es-DBBSeOaD.mjs +0 -2
  860. package/dist/chunks/es-DBBSeOaD.mjs.map +0 -1
  861. package/dist/chunks/es-DCwjeUUu.mjs +0 -2
  862. package/dist/chunks/es-DCwjeUUu.mjs.map +0 -1
  863. package/dist/chunks/es-DvgH3-WZ.mjs +0 -2
  864. package/dist/chunks/es-DvgH3-WZ.mjs.map +0 -1
  865. package/dist/chunks/es-MgguVgIs.mjs +0 -2
  866. package/dist/chunks/es-MgguVgIs.mjs.map +0 -1
  867. package/dist/chunks/es-yXjjcxgb.mjs +0 -2
  868. package/dist/chunks/es-yXjjcxgb.mjs.map +0 -1
  869. package/dist/chunks/fr-B-_yKIAY.mjs +0 -2
  870. package/dist/chunks/fr-B-_yKIAY.mjs.map +0 -1
  871. package/dist/chunks/fr-BGyF2ym0.mjs +0 -2
  872. package/dist/chunks/fr-BGyF2ym0.mjs.map +0 -1
  873. package/dist/chunks/fr-BoRJ3B2-.mjs +0 -2
  874. package/dist/chunks/fr-BoRJ3B2-.mjs.map +0 -1
  875. package/dist/chunks/fr-BrKk4SPg.mjs +0 -2
  876. package/dist/chunks/fr-BrKk4SPg.mjs.map +0 -1
  877. package/dist/chunks/fr-C-y09LKg.mjs +0 -2
  878. package/dist/chunks/fr-C-y09LKg.mjs.map +0 -1
  879. package/dist/chunks/fr-C1W7jyd6.mjs +0 -2
  880. package/dist/chunks/fr-C1W7jyd6.mjs.map +0 -1
  881. package/dist/chunks/fr-C8CtmWBj.mjs +0 -2
  882. package/dist/chunks/fr-C8CtmWBj.mjs.map +0 -1
  883. package/dist/chunks/fr-C9oiPW0k.mjs +0 -2
  884. package/dist/chunks/fr-C9oiPW0k.mjs.map +0 -1
  885. package/dist/chunks/fr-CEkk4UyZ.mjs +0 -2
  886. package/dist/chunks/fr-CEkk4UyZ.mjs.map +0 -1
  887. package/dist/chunks/fr-Ccaetiwi.mjs +0 -2
  888. package/dist/chunks/fr-Ccaetiwi.mjs.map +0 -1
  889. package/dist/chunks/fr-Ccku5KzA.mjs +0 -2
  890. package/dist/chunks/fr-Ccku5KzA.mjs.map +0 -1
  891. package/dist/chunks/fr-CfUg1FxU.mjs +0 -2
  892. package/dist/chunks/fr-CfUg1FxU.mjs.map +0 -1
  893. package/dist/chunks/fr-DDkBcjmO.mjs +0 -2
  894. package/dist/chunks/fr-DDkBcjmO.mjs.map +0 -1
  895. package/dist/chunks/fr-DNwLChcm.mjs +0 -2
  896. package/dist/chunks/fr-DNwLChcm.mjs.map +0 -1
  897. package/dist/chunks/fr-DvneSjCf.mjs +0 -2
  898. package/dist/chunks/fr-DvneSjCf.mjs.map +0 -1
  899. package/dist/chunks/fr-Dx4Qqimj.mjs +0 -2
  900. package/dist/chunks/fr-Dx4Qqimj.mjs.map +0 -1
  901. package/dist/chunks/fr-RHXmueoO.mjs +0 -2
  902. package/dist/chunks/fr-RHXmueoO.mjs.map +0 -1
  903. package/dist/chunks/fr-VdiCNF4J.mjs +0 -2
  904. package/dist/chunks/fr-VdiCNF4J.mjs.map +0 -1
  905. package/dist/chunks/fr-Wiobfk5s.mjs +0 -2
  906. package/dist/chunks/fr-Wiobfk5s.mjs.map +0 -1
  907. package/dist/chunks/fr-YMiDtWuG.mjs +0 -2
  908. package/dist/chunks/fr-YMiDtWuG.mjs.map +0 -1
  909. package/dist/chunks/fr-_Oxf0k66.mjs +0 -2
  910. package/dist/chunks/fr-_Oxf0k66.mjs.map +0 -1
  911. package/dist/chunks/fr-gurfH-7T.mjs +0 -2
  912. package/dist/chunks/fr-gurfH-7T.mjs.map +0 -1
  913. package/dist/chunks/fr-zP7EjxDL.mjs +0 -2
  914. package/dist/chunks/fr-zP7EjxDL.mjs.map +0 -1
  915. package/dist/chunks/hi-B2W8pFqK.mjs +0 -2
  916. package/dist/chunks/hi-B2W8pFqK.mjs.map +0 -1
  917. package/dist/chunks/hi-B2m69ZCq.mjs +0 -2
  918. package/dist/chunks/hi-B2m69ZCq.mjs.map +0 -1
  919. package/dist/chunks/hi-BMIt3y_-.mjs +0 -2
  920. package/dist/chunks/hi-BMIt3y_-.mjs.map +0 -1
  921. package/dist/chunks/hi-BdtVhAzs.mjs +0 -2
  922. package/dist/chunks/hi-BdtVhAzs.mjs.map +0 -1
  923. package/dist/chunks/hi-BmkfaZpg.mjs +0 -2
  924. package/dist/chunks/hi-BmkfaZpg.mjs.map +0 -1
  925. package/dist/chunks/hi-C-l_R2SO.mjs +0 -2
  926. package/dist/chunks/hi-C-l_R2SO.mjs.map +0 -1
  927. package/dist/chunks/hi-C1LhM-oY.mjs +0 -2
  928. package/dist/chunks/hi-C1LhM-oY.mjs.map +0 -1
  929. package/dist/chunks/hi-CGEbGI1l.mjs +0 -2
  930. package/dist/chunks/hi-CGEbGI1l.mjs.map +0 -1
  931. package/dist/chunks/hi-CPuhj7IA.mjs +0 -2
  932. package/dist/chunks/hi-CPuhj7IA.mjs.map +0 -1
  933. package/dist/chunks/hi-CT5WERqi.mjs +0 -2
  934. package/dist/chunks/hi-CT5WERqi.mjs.map +0 -1
  935. package/dist/chunks/hi-CbLPPQ0b.mjs +0 -2
  936. package/dist/chunks/hi-CbLPPQ0b.mjs.map +0 -1
  937. package/dist/chunks/hi-ClvEtEKe.mjs +0 -2
  938. package/dist/chunks/hi-ClvEtEKe.mjs.map +0 -1
  939. package/dist/chunks/hi-CpBWHmYH.mjs +0 -2
  940. package/dist/chunks/hi-CpBWHmYH.mjs.map +0 -1
  941. package/dist/chunks/hi-DAfl8nU_.mjs +0 -2
  942. package/dist/chunks/hi-DAfl8nU_.mjs.map +0 -1
  943. package/dist/chunks/hi-DVof3w0y.mjs +0 -2
  944. package/dist/chunks/hi-DVof3w0y.mjs.map +0 -1
  945. package/dist/chunks/hi-DtlvSQkD.mjs +0 -2
  946. package/dist/chunks/hi-DtlvSQkD.mjs.map +0 -1
  947. package/dist/chunks/hi-FH3CAJuR.mjs +0 -2
  948. package/dist/chunks/hi-FH3CAJuR.mjs.map +0 -1
  949. package/dist/chunks/hi-Ga9h9a_1.mjs +0 -2
  950. package/dist/chunks/hi-Ga9h9a_1.mjs.map +0 -1
  951. package/dist/chunks/hi-Zc17M1T-.mjs +0 -2
  952. package/dist/chunks/hi-Zc17M1T-.mjs.map +0 -1
  953. package/dist/chunks/hi-g7i0bmig.mjs +0 -2
  954. package/dist/chunks/hi-g7i0bmig.mjs.map +0 -1
  955. package/dist/chunks/hi-js2P6byR.mjs +0 -2
  956. package/dist/chunks/hi-js2P6byR.mjs.map +0 -1
  957. package/dist/chunks/hi-ntUsOspQ.mjs +0 -2
  958. package/dist/chunks/hi-ntUsOspQ.mjs.map +0 -1
  959. package/dist/chunks/hi-yxAcR3w6.mjs +0 -2
  960. package/dist/chunks/hi-yxAcR3w6.mjs.map +0 -1
  961. package/dist/chunks/index-C-L4awHz.mjs +0 -2
  962. package/dist/chunks/index-C-L4awHz.mjs.map +0 -1
  963. package/dist/chunks/index-Cs9iqxhF.mjs +0 -2
  964. package/dist/chunks/index-Cs9iqxhF.mjs.map +0 -1
  965. package/dist/chunks/pt--IiroJQw.mjs +0 -2
  966. package/dist/chunks/pt--IiroJQw.mjs.map +0 -1
  967. package/dist/chunks/pt-BF72W8M5.mjs +0 -2
  968. package/dist/chunks/pt-BF72W8M5.mjs.map +0 -1
  969. package/dist/chunks/pt-BX_t4luI.mjs +0 -2
  970. package/dist/chunks/pt-BX_t4luI.mjs.map +0 -1
  971. package/dist/chunks/pt-B_XJ2s9X.mjs +0 -2
  972. package/dist/chunks/pt-B_XJ2s9X.mjs.map +0 -1
  973. package/dist/chunks/pt-C-Vp7Rxj.mjs +0 -2
  974. package/dist/chunks/pt-C-Vp7Rxj.mjs.map +0 -1
  975. package/dist/chunks/pt-CD2aCZXf.mjs +0 -2
  976. package/dist/chunks/pt-CD2aCZXf.mjs.map +0 -1
  977. package/dist/chunks/pt-CFjzqIbS.mjs +0 -2
  978. package/dist/chunks/pt-CFjzqIbS.mjs.map +0 -1
  979. package/dist/chunks/pt-CHjmBegF.mjs +0 -2
  980. package/dist/chunks/pt-CHjmBegF.mjs.map +0 -1
  981. package/dist/chunks/pt-CQRzEocL.mjs +0 -2
  982. package/dist/chunks/pt-CQRzEocL.mjs.map +0 -1
  983. package/dist/chunks/pt-Cem2WxUk.mjs +0 -2
  984. package/dist/chunks/pt-Cem2WxUk.mjs.map +0 -1
  985. package/dist/chunks/pt-D6kdF3fH.mjs +0 -2
  986. package/dist/chunks/pt-D6kdF3fH.mjs.map +0 -1
  987. package/dist/chunks/pt-DJfJVeY8.mjs +0 -2
  988. package/dist/chunks/pt-DJfJVeY8.mjs.map +0 -1
  989. package/dist/chunks/pt-DfB-IaYi.mjs +0 -2
  990. package/dist/chunks/pt-DfB-IaYi.mjs.map +0 -1
  991. package/dist/chunks/pt-DlNdH9pu.mjs +0 -2
  992. package/dist/chunks/pt-DlNdH9pu.mjs.map +0 -1
  993. package/dist/chunks/pt-DrJ0-8Yo.mjs +0 -2
  994. package/dist/chunks/pt-DrJ0-8Yo.mjs.map +0 -1
  995. package/dist/chunks/pt-DsBJpgpe.mjs +0 -2
  996. package/dist/chunks/pt-DsBJpgpe.mjs.map +0 -1
  997. package/dist/chunks/pt-DwdSYJzC.mjs +0 -2
  998. package/dist/chunks/pt-DwdSYJzC.mjs.map +0 -1
  999. package/dist/chunks/pt-Dx9UkZ3j.mjs +0 -2
  1000. package/dist/chunks/pt-Dx9UkZ3j.mjs.map +0 -1
  1001. package/dist/chunks/pt-K0BUlM9X.mjs +0 -2
  1002. package/dist/chunks/pt-K0BUlM9X.mjs.map +0 -1
  1003. package/dist/chunks/pt-TuA3_GDM.mjs +0 -2
  1004. package/dist/chunks/pt-TuA3_GDM.mjs.map +0 -1
  1005. package/dist/chunks/pt-cN6r-f7f.mjs +0 -2
  1006. package/dist/chunks/pt-cN6r-f7f.mjs.map +0 -1
  1007. package/dist/chunks/pt-uNGpVM3D.mjs +0 -2
  1008. package/dist/chunks/pt-uNGpVM3D.mjs.map +0 -1
  1009. package/dist/chunks/pt-v1E9u-Jx.mjs +0 -2
  1010. package/dist/chunks/pt-v1E9u-Jx.mjs.map +0 -1
  1011. package/dist/chunks/ru-0h51zrqE.mjs +0 -2
  1012. package/dist/chunks/ru-0h51zrqE.mjs.map +0 -1
  1013. package/dist/chunks/ru-4S8w6UN_.mjs +0 -2
  1014. package/dist/chunks/ru-4S8w6UN_.mjs.map +0 -1
  1015. package/dist/chunks/ru-B0cRw90L.mjs +0 -2
  1016. package/dist/chunks/ru-B0cRw90L.mjs.map +0 -1
  1017. package/dist/chunks/ru-B3O7WXNM.mjs +0 -2
  1018. package/dist/chunks/ru-B3O7WXNM.mjs.map +0 -1
  1019. package/dist/chunks/ru-B6zVAzvI.mjs +0 -2
  1020. package/dist/chunks/ru-B6zVAzvI.mjs.map +0 -1
  1021. package/dist/chunks/ru-B8teJin_.mjs +0 -2
  1022. package/dist/chunks/ru-B8teJin_.mjs.map +0 -1
  1023. package/dist/chunks/ru-BCriPw-8.mjs +0 -2
  1024. package/dist/chunks/ru-BCriPw-8.mjs.map +0 -1
  1025. package/dist/chunks/ru-BNOU16E5.mjs +0 -2
  1026. package/dist/chunks/ru-BNOU16E5.mjs.map +0 -1
  1027. package/dist/chunks/ru-BO6BIS5W.mjs +0 -2
  1028. package/dist/chunks/ru-BO6BIS5W.mjs.map +0 -1
  1029. package/dist/chunks/ru-Bdy1lLuc.mjs +0 -2
  1030. package/dist/chunks/ru-Bdy1lLuc.mjs.map +0 -1
  1031. package/dist/chunks/ru-BgBctNVm.mjs +0 -2
  1032. package/dist/chunks/ru-BgBctNVm.mjs.map +0 -1
  1033. package/dist/chunks/ru-CNLx7T3O.mjs +0 -2
  1034. package/dist/chunks/ru-CNLx7T3O.mjs.map +0 -1
  1035. package/dist/chunks/ru-CVSCT776.mjs +0 -2
  1036. package/dist/chunks/ru-CVSCT776.mjs.map +0 -1
  1037. package/dist/chunks/ru-CZvkdGnf.mjs +0 -2
  1038. package/dist/chunks/ru-CZvkdGnf.mjs.map +0 -1
  1039. package/dist/chunks/ru-CegMPuML.mjs +0 -2
  1040. package/dist/chunks/ru-CegMPuML.mjs.map +0 -1
  1041. package/dist/chunks/ru-CiLrD2Nz.mjs +0 -2
  1042. package/dist/chunks/ru-CiLrD2Nz.mjs.map +0 -1
  1043. package/dist/chunks/ru-ClEM6OKY.mjs +0 -2
  1044. package/dist/chunks/ru-ClEM6OKY.mjs.map +0 -1
  1045. package/dist/chunks/ru-CrbxCeQf.mjs +0 -2
  1046. package/dist/chunks/ru-CrbxCeQf.mjs.map +0 -1
  1047. package/dist/chunks/ru-D3j2x2xu.mjs +0 -2
  1048. package/dist/chunks/ru-D3j2x2xu.mjs.map +0 -1
  1049. package/dist/chunks/ru-DdHqb4Mh.mjs +0 -2
  1050. package/dist/chunks/ru-DdHqb4Mh.mjs.map +0 -1
  1051. package/dist/chunks/ru-DjgNdOdJ.mjs +0 -2
  1052. package/dist/chunks/ru-DjgNdOdJ.mjs.map +0 -1
  1053. package/dist/chunks/ru-Tzd5N37W.mjs +0 -2
  1054. package/dist/chunks/ru-Tzd5N37W.mjs.map +0 -1
  1055. package/dist/chunks/ru-XKNCzkR2.mjs +0 -2
  1056. package/dist/chunks/ru-XKNCzkR2.mjs.map +0 -1
  1057. package/dist/chunks/zh--oNSMazK.mjs +0 -2
  1058. package/dist/chunks/zh--oNSMazK.mjs.map +0 -1
  1059. package/dist/chunks/zh-BfeWdPIz.mjs +0 -2
  1060. package/dist/chunks/zh-BfeWdPIz.mjs.map +0 -1
  1061. package/dist/chunks/zh-BnOxGKxF.mjs +0 -2
  1062. package/dist/chunks/zh-BnOxGKxF.mjs.map +0 -1
  1063. package/dist/chunks/zh-BqMtE-jN.mjs +0 -2
  1064. package/dist/chunks/zh-BqMtE-jN.mjs.map +0 -1
  1065. package/dist/chunks/zh-C3aI7A2o.mjs +0 -2
  1066. package/dist/chunks/zh-C3aI7A2o.mjs.map +0 -1
  1067. package/dist/chunks/zh-C6YALJZt.mjs +0 -2
  1068. package/dist/chunks/zh-C6YALJZt.mjs.map +0 -1
  1069. package/dist/chunks/zh-CWdTbUOP.mjs +0 -2
  1070. package/dist/chunks/zh-CWdTbUOP.mjs.map +0 -1
  1071. package/dist/chunks/zh-CY01pMD4.mjs +0 -2
  1072. package/dist/chunks/zh-CY01pMD4.mjs.map +0 -1
  1073. package/dist/chunks/zh-Cmt7n9FY.mjs +0 -2
  1074. package/dist/chunks/zh-Cmt7n9FY.mjs.map +0 -1
  1075. package/dist/chunks/zh-CpP2kee3.mjs +0 -2
  1076. package/dist/chunks/zh-CpP2kee3.mjs.map +0 -1
  1077. package/dist/chunks/zh-Cpbg4evx.mjs +0 -2
  1078. package/dist/chunks/zh-Cpbg4evx.mjs.map +0 -1
  1079. package/dist/chunks/zh-Cqb55JWa.mjs +0 -2
  1080. package/dist/chunks/zh-Cqb55JWa.mjs.map +0 -1
  1081. package/dist/chunks/zh-DCQZ6gss.mjs +0 -2
  1082. package/dist/chunks/zh-DCQZ6gss.mjs.map +0 -1
  1083. package/dist/chunks/zh-DG2CNTUU.mjs +0 -2
  1084. package/dist/chunks/zh-DG2CNTUU.mjs.map +0 -1
  1085. package/dist/chunks/zh-DTiTJbzz.mjs +0 -2
  1086. package/dist/chunks/zh-DTiTJbzz.mjs.map +0 -1
  1087. package/dist/chunks/zh-Da1z6qbB.mjs +0 -2
  1088. package/dist/chunks/zh-Da1z6qbB.mjs.map +0 -1
  1089. package/dist/chunks/zh-Di3WqY4_.mjs +0 -2
  1090. package/dist/chunks/zh-Di3WqY4_.mjs.map +0 -1
  1091. package/dist/chunks/zh-DlBt06Pr.mjs +0 -2
  1092. package/dist/chunks/zh-DlBt06Pr.mjs.map +0 -1
  1093. package/dist/chunks/zh-Dt-wVrNr.mjs +0 -2
  1094. package/dist/chunks/zh-Dt-wVrNr.mjs.map +0 -1
  1095. package/dist/chunks/zh-ND6vW2M-.mjs +0 -2
  1096. package/dist/chunks/zh-ND6vW2M-.mjs.map +0 -1
  1097. package/dist/chunks/zh-Yd3GNsa0.mjs +0 -2
  1098. package/dist/chunks/zh-Yd3GNsa0.mjs.map +0 -1
  1099. package/dist/chunks/zh-lhynyH6Q.mjs +0 -2
  1100. package/dist/chunks/zh-lhynyH6Q.mjs.map +0 -1
  1101. package/dist/chunks/zh-v9NmlEIN.mjs +0 -2
  1102. package/dist/chunks/zh-v9NmlEIN.mjs.map +0 -1
  1103. package/dist/fonts.mjs.map +0 -1
  1104. package/dist/full.mjs.map +0 -1
  1105. package/dist/html.mjs.map +0 -1
  1106. package/dist/notectl-core.mjs.map +0 -1
  1107. package/dist/plugins/alignment.mjs.map +0 -1
  1108. package/dist/plugins/blockquote.mjs.map +0 -1
  1109. package/dist/plugins/caret-navigation.mjs.map +0 -1
  1110. package/dist/plugins/code-block.mjs.map +0 -1
  1111. package/dist/plugins/font-size.mjs.map +0 -1
  1112. package/dist/plugins/font.mjs.map +0 -1
  1113. package/dist/plugins/gap-cursor.mjs.map +0 -1
  1114. package/dist/plugins/hard-break.mjs.map +0 -1
  1115. package/dist/plugins/heading.mjs.map +0 -1
  1116. package/dist/plugins/highlight.mjs.map +0 -1
  1117. package/dist/plugins/horizontal-rule.mjs.map +0 -1
  1118. package/dist/plugins/image.mjs.map +0 -1
  1119. package/dist/plugins/link.mjs.map +0 -1
  1120. package/dist/plugins/list.mjs.map +0 -1
  1121. package/dist/plugins/print.mjs.map +0 -1
  1122. package/dist/plugins/shared.mjs.map +0 -1
  1123. package/dist/plugins/smart-paste.mjs.map +0 -1
  1124. package/dist/plugins/strikethrough.mjs.map +0 -1
  1125. package/dist/plugins/super-sub.mjs.map +0 -1
  1126. package/dist/plugins/table.mjs.map +0 -1
  1127. package/dist/plugins/text-color.mjs.map +0 -1
  1128. package/dist/plugins/text-direction-advanced.mjs.map +0 -1
  1129. package/dist/plugins/text-direction.mjs.map +0 -1
  1130. package/dist/plugins/text-formatting.mjs.map +0 -1
  1131. package/dist/plugins/toolbar.mjs.map +0 -1
  1132. package/dist/presets/full.mjs.map +0 -1
  1133. package/dist/presets/minimal.mjs.map +0 -1
  1134. package/dist/presets.mjs.map +0 -1
@@ -1,2 +1 @@
1
- import{D as t,n as e}from"../chunks/Decoration-D49mFXrH.mjs";import{a as n}from"../chunks/HTMLUtils-Cxy99Ak2.mjs";import{j as o,c as r,h as i,g as l,b as s,i as a}from"../chunks/Selection-DhbizDM4.mjs";import{c}from"../chunks/ColorValidation-DCSKq9B2.mjs";import{S as d,r as u}from"../chunks/PluginHelpers-CdPR0MuT.mjs";import{r as b,g as p}from"../chunks/ColorGrid-CpkbKfXg.mjs";import{g as h,s as m,c as f,e as g,f as v}from"../chunks/Document-3pNX7ear.mjs";import{n as x}from"../chunks/TypeBrands-Bp_Z_o5Y.mjs";import{c as w,a as C}from"../chunks/CommandHelpers-M6mPS6Ww.mjs";import{a as I,s as y,e as k}from"../chunks/StyleRuntime-BmsLoEa8.mjs";import{a as S}from"../chunks/KeyboardNav-DsYhKKuV.mjs";import{p as L}from"../chunks/PopupPositioning-DtvqMSop.mjs";function B(){const t=f(x("paragraph"),[g("")],m());return f(x("table_cell"),[t],m())}function A(t,e){const n=t.getNodePath(e);if(!n)return null;let o=null,r=null,i=null,l=null;for(const h of n){const e=t.getBlock(h);e&&("table"===e.type?(o=h,r=e):"table_row"===e.type?i=h:"table_cell"===e.type&&(l=h))}const s=t.getBlock(e);if("table_cell"===s?.type&&(l=e),!(o&&r&&l&&i))return null;const a=t.doc.children.findIndex(t=>t.id===o),c=h(r),d=c.findIndex(t=>t.id===i);if(-1===d)return null;const u=c[d];if(!u)return null;const b=h(u),p=b.findIndex(t=>t.id===l);if(-1===p)return null;const m=b.length,f=c.length;return{tableId:o,tableIndex:a,rowId:i,rowIndex:d,cellId:l,colIndex:p,totalRows:f,totalCols:m}}function R(t,e,n,o){const r=t.getBlock(e);if(!r)return null;const i=h(r)[n];if(!i)return null;const l=h(i)[o];return l?.id??null}function E(t,e){const n=t.getBlock(e);if(!n)return e;const o=h(n)[0];if(!o)return e;let r=o;for(;;){const t=h(r)[0];if(!t)return r.id;r=t}}function T(t,e){const n=t.getBlock(e);if(!n)return e;const o=h(n),r=o[o.length-1];if(!r)return e;let i=r;for(;;){const t=h(i),e=t[t.length-1];if(!e)return i.id;i=e}}function M(t,e){const n=t.getNodePath(e);if(!n)return!1;for(const o of n){const e=t.getBlock(o);if("table"===e?.type)return!0}return!1}const N={insertRowAbove:"Insert Row Above",insertRowBelow:"Insert Row Below",insertColumnLeft:"Insert Column Left",insertColumnRight:"Insert Column Right",deleteRow:"Delete Row",deleteColumn:"Delete Column",borderColorLabel:"Border Color...",deleteTable:"Delete Table",tableActions:"Table actions",menuKeyboardHint:"↑↓ Navigate · Enter Select · Esc Close",insertRow:"Insert row",insertColumn:"Insert column",addRow:"Add row",addColumn:"Add column",tableActionsHint:"Table actions (Right-click or Shift+F10)",contextMenuHint:"Right-click or Shift+F10 for table actions",borderColor:"Border color",defaultColor:"Default",noBorders:"No borders",borderColorPicker:"Border color picker",announceBorderColorSet:t=>`Table border color set to ${t}`,announceBorderReset:"Table borders reset to default",borderSwatchLabel:t=>`Border ${t}`,announceRowInsertedAbove:"Row inserted above",announceRowInsertedBelow:"Row inserted below",announceColumnInserted:t=>`Column inserted ${t}`,announceRowDeleted:"Row deleted",announceColumnDeleted:"Column deleted",announceTableDeleted:"Table deleted",insertTable:"Insert Table",tableAriaLabel:(t,e)=>`Table with ${t} rows and ${e} columns`,tableAriaDescription:"Right-click or press Shift+F10 for table actions"},H=/* @__PURE__ */Object.assign({"./locales/ar.ts":()=>import("../chunks/ar-CzVj8p__.mjs"),"./locales/de.ts":()=>import("../chunks/de-B4y4ndUw.mjs"),"./locales/es.ts":()=>import("../chunks/es-MgguVgIs.mjs"),"./locales/fr.ts":()=>import("../chunks/fr-RHXmueoO.mjs"),"./locales/hi.ts":()=>import("../chunks/hi-g7i0bmig.mjs"),"./locales/pt.ts":()=>import("../chunks/pt-DJfJVeY8.mjs"),"./locales/ru.ts":()=>import("../chunks/ru-B8teJin_.mjs"),"./locales/zh.ts":()=>import("../chunks/zh-Cpbg4evx.mjs")});async function D(t){if("en"===t)return N;const e=H[`./locales/${t}.ts`];if(!e)return N;try{return(await e()).default}catch{return N}}const P=["#000000","#434343","#666666","#999999","#b7b7b7","#cccccc","#d9d9d9","#efefef","#980000","#cc0000","#e69138","#f1c232","#6aa84f","#45818e","#3c78d8","#3d85c6","#674ea7","#a64d79","#0b5394","#38761d"];function z(t,e,n){const o=t.getBlock(e);if(!o||"table"!==o.type)return null;const r=t.getNodePath(e);if(!r)return null;if(void 0===n){const{borderColor:e,...n}=o.attrs??{},i=n;return t.transaction("command").setNodeAttr(r,i).setSelection(t.selection).build()}const i={...o.attrs,borderColor:n};return t.transaction("command").setNodeAttr(r,i).setSelection(t.selection).build()}function $(t,e,n=N){const r=t.getState();if(!o(r.selection))return!1;const i=A(r,r.selection.anchor.blockId);if(!i)return!1;const l=z(r,i.tableId,e);if(!l)return!1;t.dispatch(l);const s="none"===e?"none":p(e);return t.announce(n.announceBorderColorSet(s)),!0}function j(t,e=N){const n=t.getState();if(!o(n.selection))return!1;const r=A(n,n.selection.anchor.blockId);if(!r)return!1;const i=z(n,r.tableId,void 0);return!!i&&(t.dispatch(i),t.announce(e.announceBorderReset),!0)}function _(t,e){const n=t.getBlock(e);if(n)return n.attrs?.borderColor}function V(t,e,n,o,r=N){t.classList.add("notectl-color-picker");const i=_(e.getState(),n),l=document.createElement("button");l.type="button",l.className="notectl-color-picker__default",l.textContent=r.defaultColor,l.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation(),j(e,r),o()}),l.addEventListener("keydown",t=>{"Escape"===t.key&&(t.preventDefault(),o())}),t.appendChild(l);const s=document.createElement("button");s.type="button",s.className="notectl-color-picker__default",s.textContent=r.noBorders,s.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation(),$(e,"none",r),o()}),s.addEventListener("keydown",t=>{"Escape"===t.key&&(t.preventDefault(),o())}),t.appendChild(s),b(t,{colors:P,columns:5,ariaLabel:r.borderColorPicker,ariaLabelPrefix:"",activeColor:i??null,swatchLabel:r.borderSwatchLabel,titleAsName:!0,onSelect:t=>{$(e,t,r),o()},onClose:o})}function O(t,e,n){const o=t.getBlock(e);if(!o)return null;const i=h(o),l=i[0]?h(i[0]).length:0;if(0===l)return null;const s=function(t){const e=[];for(let n=0;n<t;n++)e.push(B());return f(x("table_row"),e,m())}(l),a=t.transaction("command").insertNode([e],n,s),c=h(s)[0],d=c?h(c)[0]:void 0;return d?a.setSelection(r(d.id,0)):c&&a.setSelection(r(c.id,0)),a.build()}function q(t,e,n){const o=t.getBlock(e);if(!o)return null;const r=h(o),i=t.transaction("command");for(const l of r){const t=B();i.insertNode([e,l.id],n,t)}return i.setSelection(t.selection),i.build()}function F(t,e,n,o=0){const i=t.getBlock(e);if(!i)return null;if(h(i).length<=1)return Y(t,e);const l=t.transaction("command").removeNode([e],n),s=R(t,e,n>0?n-1:1,o);if(s){const e=E(t,s);l.setSelection(r(e,0))}return l.build()}function Z(t,e,n,o=0){const i=t.getBlock(e);if(!i)return null;const l=h(i);if((l[0]?h(l[0]).length:0)<=1)return Y(t,e);const s=t.transaction("command");for(let r=l.length-1;r>=0;r--){const t=l[r];t&&s.removeNode([e,t.id],n)}const a=R(t,e,o,n>0?n-1:1);if(a){const e=E(t,a);s.setSelection(r(e,0))}return s.build()}function Y(t,e){const n=t.doc.children.findIndex(t=>t.id===e);if(-1===n)return null;if(1===t.doc.children.length){const e=w(m());return t.transaction("command").insertNode([],0,e).removeNode([],1).setSelection(r(e.id,0)).build()}const o=t.transaction("command").removeNode([],n),i=t.doc.children[n+1];if(i){const e=C(t,i.id,"start");if(e)return o.setSelection(e),o.build()}const l=t.doc.children[n-1];if(l){const e=C(t,l.id,"end");e&&o.setSelection(e)}return o.build()}function K(t,e,n){const i=t.getState(),l=i.selection;if(!o(l))return!1;const s=l.anchor.blockId;let a=-1;for(let o=0;o<i.doc.children.length;o++){const t=i.doc.children[o];if(!t)continue;if(t.id===s){a=o;break}const e=i.getNodePath(s);if(e&&e[0]===t.id){a=o;break}}-1===a&&(a=i.doc.children.length-1);const c=function(t,e){const n=m(),o=[];for(let r=0;r<t;r++){const t=[];for(let n=0;n<e;n++)t.push(B());o.push(f(x("table_row"),t,m()))}return f(x("table"),o,n)}(e,n),d=f(x("paragraph")),u=a+1,b=i.transaction("command").insertNode([],u,c).insertNode([],u+1,d),p=h(c)[0],g=p?h(p)[0]:void 0,v=g?h(g)[0]:void 0;return v?b.setSelection(r(v.id,0)):g&&b.setSelection(r(g.id,0)),t.dispatch(b.build()),!0}function X(t,e){const n=t.getState();if(!o(n.selection))return!1;const r=A(n,n.selection.anchor.blockId);if(!r)return!1;const i=O(n,r.tableId,r.rowIndex+1);return!!i&&(t.dispatch(i),t.announce(e.announceRowInsertedBelow),!0)}function W(t,e,n){const r=t.getState();if(!o(r.selection))return!1;const i=A(r,r.selection.anchor.blockId);if(!i)return!1;const l="left"===e?i.colIndex:i.colIndex+1,s=q(r,i.tableId,l);return!!s&&(t.dispatch(s),t.announce(n.announceColumnInserted(e)),!0)}function U(t,e){t.registerCommand("insertTable",()=>K(t,3,3)),t.registerCommand("addRowAbove",()=>function(t,e){const n=t.getState();if(!o(n.selection))return!1;const r=A(n,n.selection.anchor.blockId);if(!r)return!1;const i=O(n,r.tableId,r.rowIndex);return!!i&&(t.dispatch(i),t.announce(e.announceRowInsertedAbove),!0)}(t,e)),t.registerCommand("addRowBelow",()=>X(t,e)),t.registerCommand("addColumnLeft",()=>function(t,e){return W(t,"left",e)}(t,e)),t.registerCommand("addColumnRight",()=>function(t,e){return W(t,"right",e)}(t,e)),t.registerCommand("deleteRow",()=>function(t,e){const n=t.getState();if(!o(n.selection))return!1;const r=A(n,n.selection.anchor.blockId);if(!r)return!1;const i=F(n,r.tableId,r.rowIndex,r.colIndex);return!!i&&(t.dispatch(i),t.announce(e.announceRowDeleted),!0)}(t,e)),t.registerCommand("deleteColumn",()=>function(t,e){const n=t.getState();if(!o(n.selection))return!1;const r=A(n,n.selection.anchor.blockId);if(!r)return!1;const i=Z(n,r.tableId,r.colIndex,r.rowIndex);return!!i&&(t.dispatch(i),t.announce(e.announceColumnDeleted),!0)}(t,e)),t.registerCommand("selectTable",()=>function(t){const e=t.getState(),n=e.selection;if(i(n)){const t=e.getBlock(n.nodeId);return"table"===t?.type}if(l(n))return!1;const o=A(e,n.anchor.blockId);if(!o)return!1;const r=e.getNodePath(o.tableId);if(!r)return!1;const a=e.transaction("command").setSelection(s(o.tableId,r)).build();return t.dispatch(a),!0}(t)),t.registerCommand("deleteTable",()=>function(t,e){const n=t.getState(),o=function(t){if(i(t.selection)){const e=t.getBlock(t.selection.nodeId);return"table"!==e?.type?null:{tableId:e.id}}if(l(t.selection))return null;const e=A(t,t.selection.anchor.blockId);return e?{tableId:e.tableId}:null}(n);if(!o)return!1;const r=Y(n,o.tableId);return!!r&&(t.dispatch(r),t.announce(e.announceTableDeleted),!0)}(t,e))}function G(t,e,n,o,r,i=N,l){let s=!0,a=null;const c=document.createElement("div");c.className="notectl-table-context-menu",c.setAttribute("role","menu"),c.setAttribute("aria-label",i.tableActions),c.setAttribute("contenteditable","false");const d=[];let u=0;const b=function(t){return[{type:"item",label:t.insertRowAbove,command:"addRowAbove"},{type:"item",label:t.insertRowBelow,command:"addRowBelow"},{type:"separator"},{type:"item",label:t.insertColumnLeft,command:"addColumnLeft"},{type:"item",label:t.insertColumnRight,command:"addColumnRight"},{type:"separator"},{type:"item",label:t.deleteRow,command:"deleteRow"},{type:"item",label:t.deleteColumn,command:"deleteColumn"},{type:"separator"},{type:"submenu",label:t.borderColorLabel,id:"borderColor"},{type:"separator"},{type:"item",label:t.deleteTable,command:"deleteTable"}]}(i);for(const w of b){if("separator"===w.type){const t=document.createElement("div");t.setAttribute("role","separator"),c.appendChild(t);continue}const t=document.createElement("button");t.type="button",t.setAttribute("role","menuitem"),t.textContent=w.label,"submenu"===w.type&&(t.dataset.submenu=w.id,t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded","false")),"item"===w.type&&(t.dataset.command=w.command),t.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation()}),t.addEventListener("click",n=>{n.stopPropagation(),"item"===w.type?(e.executeCommand(w.command),x()):"submenu"===w.type&&h(t)}),d.push(t),c.appendChild(t)}const p=document.createElement("div");function h(o){m(),o.setAttribute("aria-expanded","true");{a=document.createElement("div"),a.className="notectl-table-context-menu",I(a,"position","fixed"),a.setAttribute("contenteditable","false"),a.addEventListener("keydown",t=>{t.stopPropagation();const e="rtl"===getComputedStyle(c).direction?"ArrowRight":"ArrowLeft";t.key===e&&(t.preventDefault(),m(),o.focus())}),V(a,e,n,()=>x(),i),t.appendChild(a);const r=o.getBoundingClientRect(),l=c.getBoundingClientRect();let s=r.top;const d=window.innerWidth,u=window.innerHeight;let b;"rtl"===getComputedStyle(c).direction?(b=l.left-200-2,b<0&&(b=l.right+2)):(b=l.right+2,b+200>d&&(b=l.left-200-2)),s+200>u&&(s=u-200),y(a,{left:`${b}px`,top:`${s}px`}),requestAnimationFrame(()=>{const t=a?.querySelector("button");t?.focus()})}}function m(){a&&(a.remove(),a=null),function(){for(const t of d)t.dataset.submenu&&t.setAttribute("aria-expanded","false")}()}p.className="notectl-table-context-menu__hint",p.setAttribute("aria-hidden","true"),p.textContent=i.menuKeyboardHint,c.appendChild(p),S(d,u),c.addEventListener("keydown",t=>{switch(t.stopPropagation(),t.key){case"Escape":return t.preventDefault(),void x();case"ArrowDown":return t.preventDefault(),u=(u+1)%d.length,S(d,u),void d[u]?.focus();case"ArrowUp":return t.preventDefault(),u=(u-1+d.length)%d.length,S(d,u),void d[u]?.focus();case"ArrowRight":case"ArrowLeft":{t.preventDefault();const e="rtl"===getComputedStyle(c).direction?"ArrowLeft":"ArrowRight";if(t.key===e){const t=d[u];t?.dataset.submenu&&h(t)}else m(),d[u]?.focus();return}case"Enter":case" ":{t.preventDefault();const n=d[u];if(!n)return;return void(n.dataset.submenu?h(n):n.dataset.command&&(e.executeCommand(n.dataset.command),x()))}case"Home":return t.preventDefault(),u=0,S(d,u),void d[u]?.focus();case"End":return t.preventDefault(),u=d.length-1,S(d,u),void d[u]?.focus()}}),L(c,o,{position:"below-start"}),t.appendChild(c),d[0]?.focus(),requestAnimationFrame(()=>{s&&d[0]&&d[0].focus()});const f=t=>{const e=t.composedPath();e.includes(c)||a&&e.includes(a)||x()};let g=null,v=!1;function x(){s&&(s=!1,m(),c.remove(),null!==g&&(clearTimeout(g),g=null),v&&(document.removeEventListener("mousedown",f,!0),v=!1),r?.())}return g=setTimeout(()=>{g=null,document.addEventListener("mousedown",f,!0),v=!0},0),{isOpen:()=>s,close:x,destroy:x}}function J(t,e){const n=t.getState();if(!o(n.selection))return!1;const r=n.selection,i=A(n,r.anchor.blockId);return!!i&&e(n,r,i)}function Q(t){return J(t,(e,n,o)=>{const i=o.tableIndex+1;if(i>=e.doc.children.length)return!1;const l=e.doc.children[i];if(!l)return!1;const s=e.transaction("command").setSelection(r(l.id,0)).build();return t.dispatch(s),!0})}let tt=null;function et(t,e,n,o){const i=t.getState(),l=R(i,e,n,o);if(!l)return!1;const s=E(i,l),a=i.transaction("command").setSelection(r(s,0)).build();return t.dispatch(a),!0}function nt(t,e,n,o){const i=t.getState(),l=R(i,e,n,o);if(!l)return!1;const s=T(i,l),a=i.getBlock(s);if(!a)return!1;const c=v(a),d=i.transaction("command").setSelection(r(s,c)).build();return t.dispatch(d),!0}function ot(t,e){const n=t.getState(),o=n.getNodePath(e);if(!o)return!1;const r=n.transaction("input").setSelection(s(e,o)).build();return t.dispatch(r),!0}const rt='<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none"><path d="M6 1v10M1 6h10" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/></svg>';function it(t,e,n){const o=document.createElement("button");return o.className=t,o.innerHTML=e,o.title=n,o.type="button",o.setAttribute("aria-label",n),o.setAttribute("contenteditable","false"),o.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation()}),o}function lt(t,e){const n=document.createElement("div");n.className=`ntbl-insert-line ntbl-insert-line--${t}`,n.setAttribute("contenteditable","false"),n.setAttribute("data-notectl-no-print","");const o=it("ntbl-insert-btn",rt,e);return n.appendChild(o),n}function st(t,e){const n=document.createElement("button");n.className=`ntbl-add-zone ${t}`,n.type="button",n.setAttribute("contenteditable","false"),n.setAttribute("aria-label",e),n.setAttribute("data-notectl-no-print",""),n.title=e;const o=document.createElement("span");return o.className="ntbl-add-icon",o.innerHTML=rt,n.appendChild(o),n.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation()}),n}function at(t){const e=document.createElement("div");return e.className=t,e.setAttribute("contenteditable","false"),e.setAttribute("data-notectl-no-print",""),e}function ct(t,e){y(t,"none"===e?{backgroundColor:"transparent",border:"1px dashed rgba(128,128,128,0.4)"}:e?{backgroundColor:e,border:"1px solid rgba(0,0,0,0.15)"}:{backgroundColor:"var(--notectl-border)",border:"1px solid rgba(0,0,0,0.15)"})}function dt(t,e,n,o){const r=document.createElement("div");r.className=`ntbl-handle ${t}`,r.dataset.index=String(e);const i=it("ntbl-handle-delete",'<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 10 10" fill="none"><path d="M2 2l6 6M8 2l-6 6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>',n);return i.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation(),o(e)}),r.appendChild(i),r}function ut(t,e){let n=0,o=0,r=t;for(;r&&r!==e;)n+=r.offsetTop,o+=r.offsetLeft,r=r.offsetParent;return{top:n,left:o}}class bt{tableId;numRows;numCols;activeRowIndex=-1;activeColIndex=-1;colBar;rowBar;insertLineH;insertLineV;addRowZone;addColZone;deleteTableBtn;borderColorBtn;actionsBtn;contextHint;observer;borderColorPopup=null;activeContextMenu=null;container;tableEl;getState;dispatchFn;pluginContext;locale;onMouseMove=t=>{const e=this.tableEl.getBoundingClientRect(),n=t.clientX-e.left,o=t.clientY-e.top;if(!(n>=-10&&n<=e.width+10&&o>=-10&&o<=e.height+10))return void this.hideInsertLines();const r=function(t,e,n,o){let r=Number.POSITIVE_INFINITY,i=null;for(const a of n){const t=Math.abs(e-a.position);t<r&&t<10&&(r=t,i=a)}let l=Number.POSITIVE_INFINITY,s=null;for(const a of o){const e=Math.abs(t-a.position);e<l&&e<10&&(l=e,s=a)}return i&&(!s||r<=l)?{type:"row",border:i}:s?{type:"col",border:s}:{type:"none",border:null}}(n,o,function(t){const e=t.querySelectorAll(":scope > tbody > tr"),n=t.offsetTop,o=[];for(let r=1;r<e.length;r++){const t=e[r];t&&o.push({position:t.offsetTop-n,index:r})}return o}(this.tableEl),function(t,e){if(e<=1)return[];const n=t/e,o=[];for(let r=1;r<e;r++)o.push({position:Math.round(n*r),index:r});return o}(this.tableEl.offsetWidth,this.numCols));"row"===r.type&&r.border?(this.showHorizontalLine(r.border),this.hideVerticalLine()):"col"===r.type&&r.border?(this.showVerticalLine(r.border),this.hideHorizontalLine()):this.hideInsertLines()};onMouseLeave=()=>{this.hideInsertLines()};constructor(t,e,n,o,r,i,l=N){if(this.container=t,this.tableEl=e,this.getState=o,this.dispatchFn=r,this.pluginContext=i??null,this.locale=l,this.tableId=n.id,this.numRows=h(n).length,this.numCols=this.countCols(n),this.colBar=at("ntbl-col-bar"),this.rowBar=at("ntbl-row-bar"),this.insertLineH=lt("horizontal",l.insertRow),this.insertLineV=lt("vertical",l.insertColumn),this.addRowZone=st("ntbl-add-row",l.addRow),this.addColZone=st("ntbl-add-col",l.addColumn),this.deleteTableBtn=it("ntbl-delete-table-btn",'<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none"><path d="M9 3h6m-9 4h12M10 11v6m4-6v6m-9 3h14l-1-13H6L5 20z" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"/></svg>',l.deleteTable),this.deleteTableBtn.setAttribute("data-notectl-no-print",""),i){const t=_(o(),this.tableId);this.borderColorBtn=function(t,e){const n=it("ntbl-border-color-btn",'<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none"><path d="M3 3h18v18H3V3zm0 6h18M3 15h18M9 3v18M15 3v18" stroke="currentColor" stroke-width="1.5"/></svg>',t);n.setAttribute("data-notectl-no-print","");const o=document.createElement("span");return o.className="ntbl-border-color-swatch",ct(o,e),n.appendChild(o),n}(l.borderColor,t),this.actionsBtn=function(t){const e=it("ntbl-actions-btn",'<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="currentColor"><circle cx="12" cy="5" r="2"/><circle cx="12" cy="12" r="2"/><circle cx="12" cy="19" r="2"/></svg>',t);return e.setAttribute("data-notectl-no-print",""),e}(l.tableActionsHint)}else this.borderColorBtn=null,this.actionsBtn=null;t.append(this.colBar,this.rowBar,this.insertLineH,this.insertLineV,this.addRowZone,this.addColZone,this.deleteTableBtn),this.borderColorBtn&&t.appendChild(this.borderColorBtn),this.actionsBtn&&t.appendChild(this.actionsBtn),this.contextHint=function(t){const e=document.createElement("div");return e.className="ntbl-context-hint",e.setAttribute("aria-hidden","true"),e.setAttribute("contenteditable","false"),e.setAttribute("data-notectl-no-print",""),e.textContent=t,e}(l.contextMenuHint),t.appendChild(this.contextHint),this.rebuildColHandles(),this.rebuildRowHandles(),this.bindEventListeners(),this.observer=new ResizeObserver(()=>{this.positionControls()}),this.observer.observe(e),requestAnimationFrame(()=>this.positionControls())}update(t){this.tableId=t.id;const e=h(t).length,n=this.countCols(t);if(e===this.numRows&&n===this.numCols||(this.numRows=e,this.numCols=n,this.rebuildColHandles(),this.rebuildRowHandles()),this.borderColorBtn){const e=this.borderColorBtn.querySelector(".ntbl-border-color-swatch");if(e){const n=t.attrs?.borderColor;ct(e,n)}}requestAnimationFrame(()=>this.positionControls())}destroy(){this.activeContextMenu?.destroy(),this.closeBorderColorPopup(),this.observer.disconnect(),this.container.removeEventListener("mousemove",this.onMouseMove),this.container.removeEventListener("mouseleave",this.onMouseLeave),this.colBar.remove(),this.rowBar.remove(),this.insertLineH.remove(),this.insertLineV.remove(),this.addRowZone.remove(),this.addColZone.remove(),this.deleteTableBtn.remove(),this.borderColorBtn?.remove(),this.actionsBtn?.remove(),this.contextHint.remove()}bindEventListeners(){const t=this.insertLineH.querySelector(".ntbl-insert-btn"),e=this.insertLineV.querySelector(".ntbl-insert-btn");if(t.addEventListener("click",()=>{this.activeRowIndex>=0&&this.dispatchTransaction(O(this.getState(),this.tableId,this.activeRowIndex))}),e.addEventListener("click",()=>{this.activeColIndex>=0&&this.dispatchTransaction(q(this.getState(),this.tableId,this.activeColIndex))}),this.addRowZone.addEventListener("click",()=>{this.dispatchTransaction(O(this.getState(),this.tableId,this.numRows))}),this.addColZone.addEventListener("click",()=>{this.dispatchTransaction(q(this.getState(),this.tableId,this.numCols))}),this.deleteTableBtn.addEventListener("click",()=>{this.dispatchTransaction(Y(this.getState(),this.tableId))}),this.borderColorBtn&&this.pluginContext){const t=this.pluginContext;this.borderColorBtn.addEventListener("click",()=>{this.toggleBorderColorPopup(t)})}if(this.actionsBtn&&this.pluginContext){const t=this.pluginContext;this.actionsBtn.addEventListener("click",()=>{this.openActionsMenu(t)})}this.container.addEventListener("mousemove",this.onMouseMove),this.container.addEventListener("mouseleave",this.onMouseLeave)}openActionsMenu(t){if(this.activeContextMenu?.isOpen())return this.activeContextMenu.close(),void(this.activeContextMenu=null);if(!this.actionsBtn)return;const e=this.actionsBtn.getBoundingClientRect(),n=new DOMRect(e.left,e.bottom+4,0,0);this.activeContextMenu=G(this.container,t,this.tableId,n,()=>{this.activeContextMenu=null},this.locale)}toggleBorderColorPopup(t){this.borderColorPopup?this.closeBorderColorPopup():(this.borderColorPopup=document.createElement("div"),this.borderColorPopup.className="notectl-table-context-menu",y(this.borderColorPopup,{position:"absolute",top:"24px",left:"24px",zIndex:"10000"}),this.borderColorPopup.setAttribute("contenteditable","false"),V(this.borderColorPopup,t,this.tableId,()=>{this.closeBorderColorPopup()},this.locale),this.container.appendChild(this.borderColorPopup))}closeBorderColorPopup(){this.borderColorPopup&&(this.borderColorPopup.remove(),this.borderColorPopup=null)}dispatchTransaction(t){t&&this.dispatchFn(t)}countCols(t){const e=h(t);return e[0]?h(e[0]).length:0}positionControls(){!function(t,e,n){const o=t.children;if(0===o.length)return;const r=e/n;for(let i=0;i<o.length;i++){const t=o[i];y(t,{left:`${Math.round(r*i)}px`,width:`${Math.round(r)}px`})}I(t,"width",`${e}px`)}(this.colBar,this.tableEl.offsetWidth,this.numCols),function(t,e){const n=t.children;if(0===n.length)return;const o=e.querySelectorAll(":scope > tbody > tr"),r=e.offsetTop;let i=0;for(let l=0;l<n.length;l++){const t=n[l],e=o[l];if(e){const n=e.offsetTop-r,o=e.offsetHeight;y(t,{top:`${n}px`,height:`${o}px`}),i=n+o}}I(t,"height",`${i}px`)}(this.rowBar,this.tableEl),function(t,e,n,o){const r=ut(n,o),i=n.offsetHeight,l=n.offsetWidth;y(t,{width:`${l}px`,left:`${r.left}px`}),y(e,{height:`${i}px`,top:`${r.top}px`})}(this.addRowZone,this.addColZone,this.tableEl,this.container)}showHorizontalLine(t){this.activeRowIndex=t.index;const e=ut(this.tableEl,this.container);y(this.insertLineH,{top:e.top+t.position-1+"px",left:`${e.left}px`,width:`${this.tableEl.offsetWidth}px`}),this.insertLineH.classList.add("ntbl-insert-line--visible")}showVerticalLine(t){this.activeColIndex=t.index;const e=ut(this.tableEl,this.container);y(this.insertLineV,{left:e.left+t.position-1+"px",top:`${e.top}px`,height:`${this.tableEl.offsetHeight}px`}),this.insertLineV.classList.add("ntbl-insert-line--visible")}hideInsertLines(){this.hideHorizontalLine(),this.hideVerticalLine()}hideHorizontalLine(){this.insertLineH.classList.remove("ntbl-insert-line--visible"),this.activeRowIndex=-1}hideVerticalLine(){this.insertLineV.classList.remove("ntbl-insert-line--visible"),this.activeColIndex=-1}rebuildColHandles(){this.colBar.innerHTML="";for(let t=0;t<this.numCols;t++){const e=dt("ntbl-col-handle",t,this.locale.deleteColumn,t=>{this.dispatchTransaction(Z(this.getState(),this.tableId,t))});this.colBar.appendChild(e)}}rebuildRowHandles(){this.rowBar.innerHTML="";for(let t=0;t<this.numRows;t++){const e=dt("ntbl-row-handle",t,this.locale.deleteRow,t=>{this.dispatchTransaction(F(this.getState(),this.tableId,t))});this.rowBar.appendChild(e)}}}function pt(t,e){"none"===e?(I(t,"--ntbl-border-color","transparent"),t.classList.add("notectl-table--borderless")):e?(I(t,"--ntbl-border-color",e),t.classList.remove("notectl-table--borderless")):(k(t,"--ntbl-border-color"),t.classList.remove("notectl-table--borderless"))}const ht=new d("tableSelection"),mt={maxPickerRows:8,maxPickerCols:8},ft="border-collapse: collapse; width: 100%; table-layout: fixed",gt="border: 1px solid var(--ntbl-bc, #d0d0d0); padding: 8px 12px; vertical-align: top";class vt{id="table";name="Table";priority=40;config;locale;selectionService=null;cleanupMouseSelection=null;context=null;constructor(t){this.config={...mt,...t}}async init(t){this.locale=await u(t,this.config.locale,N,D),t.registerStyleSheet('\n/* Table */\n.notectl-table-wrapper {\n\tmargin: 8px 0;\n\toverflow-x: auto;\n\tposition: relative;\n}\n\n.notectl-table {\n\twidth: 100%;\n\tborder-collapse: collapse;\n\ttable-layout: fixed;\n}\n\n.notectl-table td {\n\tborder: 1px solid var(--ntbl-border-color, var(--notectl-border));\n\tpadding: 8px 12px;\n\tmin-width: 60px;\n\tvertical-align: top;\n\tmin-height: 1.6em;\n}\n\n.notectl-table--borderless td {\n\tborder: 1px dashed rgba(128, 128, 128, 0.15);\n}\n\n@media print {\n\t.notectl-table--borderless td {\n\t\tborder: none;\n\t}\n}\n\n.notectl-table td:focus-within {\n\toutline: 2px solid var(--notectl-primary);\n\toutline-offset: -2px;\n}\n\n.notectl-table-cell--selected {\n\tbackground: var(--notectl-primary-muted);\n}\n\n/* Table Context Menu */\n.notectl-table-context-menu {\n\tposition: fixed;\n\tbackground: var(--notectl-surface-overlay);\n\tborder: 1px solid var(--notectl-border);\n\tborder-radius: 6px;\n\tbox-shadow: 0 4px 12px var(--notectl-shadow);\n\tpadding: 4px 0;\n\tmin-width: 180px;\n\tz-index: 10000;\n}\n\n.notectl-table-context-menu button {\n\tdisplay: block;\n\twidth: 100%;\n\tpadding: 8px 12px;\n\ttext-align: start;\n\tborder: none;\n\tbackground: none;\n\tcursor: pointer;\n\tfont-size: 14px;\n\tcolor: var(--notectl-fg);\n\tfont-family: inherit;\n}\n\n.notectl-table-context-menu button:hover {\n\tbackground: var(--notectl-hover-bg);\n}\n\n.notectl-table-context-menu hr {\n\tborder: none;\n\tborder-top: 1px solid var(--notectl-border);\n\tmargin: 4px 0;\n}\n\n/* === Table Controls === */\n\n/* Outer container for table + controls */\n.ntbl-container {\n\tposition: relative;\n\tmargin: 8px 0;\n\tpadding-block-start: 24px;\n\tpadding-inline-start: 24px;\n}\n\n.ntbl-container .notectl-table-wrapper {\n\tmargin: 0;\n}\n\n.ntbl-container.notectl-table--selected .notectl-table-wrapper {\n\toutline: 2px solid var(--notectl-primary-fg);\n\toutline-offset: 2px;\n\tborder-radius: 6px;\n}\n\n/* --- Column Handle Bar --- */\n.ntbl-col-bar {\n\tposition: absolute;\n\ttop: 0;\n\tinset-inline-start: 24px;\n\theight: 20px;\n\tdisplay: flex;\n\topacity: 0;\n\ttransition: opacity 0.2s ease;\n\tz-index: 3;\n\tpointer-events: none;\n}\n\n.ntbl-container:hover .ntbl-col-bar,\n.ntbl-container:focus-within .ntbl-col-bar {\n\topacity: 1;\n\tpointer-events: auto;\n}\n\n.ntbl-container.notectl-table--selected .ntbl-col-bar {\n\topacity: 1;\n\tpointer-events: auto;\n}\n\n/* --- Row Handle Bar --- */\n.ntbl-row-bar {\n\tposition: absolute;\n\ttop: 24px;\n\tinset-inline-start: 0;\n\twidth: 20px;\n\tdisplay: flex;\n\tflex-direction: column;\n\topacity: 0;\n\ttransition: opacity 0.2s ease;\n\tz-index: 3;\n\tpointer-events: none;\n}\n\n.ntbl-container:hover .ntbl-row-bar,\n.ntbl-container:focus-within .ntbl-row-bar {\n\topacity: 1;\n\tpointer-events: auto;\n}\n\n.ntbl-container.notectl-table--selected .ntbl-row-bar {\n\topacity: 1;\n\tpointer-events: auto;\n}\n\n/* --- Handle (shared base) --- */\n.ntbl-handle {\n\tposition: absolute;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tcursor: pointer;\n\ttransition: background 0.15s ease;\n\tborder-radius: 3px;\n}\n\n.ntbl-col-handle {\n\theight: 100%;\n\tbackground: var(--notectl-hover-bg);\n\tborder-radius: 4px 4px 0 0;\n}\n\n.ntbl-col-handle:hover {\n\tbackground: var(--notectl-border);\n}\n\n.ntbl-row-handle {\n\twidth: 100%;\n\tbackground: var(--notectl-hover-bg);\n\tborder-start-start-radius: 4px;\n\tborder-end-start-radius: 4px;\n}\n\n.ntbl-row-handle:hover {\n\tbackground: var(--notectl-border);\n}\n\n/* --- Handle Delete Button --- */\n.ntbl-handle-delete {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 16px;\n\theight: 16px;\n\tborder: none;\n\tbackground: transparent;\n\tcolor: var(--notectl-fg-muted);\n\tcursor: pointer;\n\tborder-radius: 3px;\n\tpadding: 0;\n\topacity: 0;\n\ttransform: scale(0.7);\n\ttransition: opacity 0.15s, transform 0.15s,\n\t\tbackground 0.15s, color 0.15s;\n}\n\n.ntbl-handle:hover .ntbl-handle-delete,\n.ntbl-handle:focus-within .ntbl-handle-delete {\n\topacity: 1;\n\ttransform: scale(1);\n}\n\n.ntbl-handle-delete:hover,\n.ntbl-handle-delete:focus-visible {\n\tbackground: var(--notectl-danger-muted);\n\tcolor: var(--notectl-danger);\n}\n\n.ntbl-handle-delete:focus-visible {\n\toutline: none;\n\tbox-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n/* --- Insert Lines --- */\n.ntbl-insert-line {\n\tposition: absolute;\n\tpointer-events: none;\n\topacity: 0;\n\ttransition: opacity 0.15s ease;\n\tz-index: 6;\n}\n\n.ntbl-insert-line--visible {\n\topacity: 1;\n\tpointer-events: auto;\n}\n\n.ntbl-insert-line--horizontal {\n\theight: 2px;\n\tbackground: linear-gradient(\n\t\t90deg,\n\t\ttransparent,\n\t\tvar(--notectl-primary) 8%,\n\t\tvar(--notectl-primary) 92%,\n\t\ttransparent\n\t);\n\tbox-shadow: 0 0 6px var(--notectl-focus-ring);\n}\n\n.ntbl-insert-line--vertical {\n\twidth: 2px;\n\tbackground: linear-gradient(\n\t\t180deg,\n\t\ttransparent,\n\t\tvar(--notectl-primary) 8%,\n\t\tvar(--notectl-primary) 92%,\n\t\ttransparent\n\t);\n\tbox-shadow: 0 0 6px var(--notectl-focus-ring);\n}\n\n/* --- Insert Button on Line --- */\n.ntbl-insert-btn {\n\tposition: absolute;\n\twidth: 20px;\n\theight: 20px;\n\tborder-radius: 50%;\n\tbackground: var(--notectl-bg);\n\tborder: 2px solid var(--notectl-primary);\n\tcolor: var(--notectl-primary);\n\tcursor: pointer;\n\tpointer-events: all;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tpadding: 0;\n\tbox-shadow: 0 2px 8px var(--notectl-focus-ring);\n\ttransition: background 0.15s, color 0.15s,\n\t\ttransform 0.15s, box-shadow 0.15s;\n}\n\n.ntbl-insert-line--horizontal .ntbl-insert-btn {\n\tleft: 50%;\n\ttop: -9px;\n\ttransform: translateX(-50%);\n}\n\n.ntbl-insert-line--vertical .ntbl-insert-btn {\n\ttop: 50%;\n\tinset-inline-start: -9px;\n\ttransform: translateY(-50%);\n}\n\n.ntbl-insert-btn:hover,\n.ntbl-insert-btn:focus-visible {\n\tbackground: var(--notectl-primary);\n\tcolor: var(--notectl-bg);\n\tbox-shadow: 0 2px 12px var(--notectl-focus-ring);\n}\n\n.ntbl-insert-btn:focus-visible {\n\toutline: none;\n\tbox-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n.ntbl-insert-line--horizontal .ntbl-insert-btn:hover {\n\ttransform: translateX(-50%) scale(1.2);\n}\n\n.ntbl-insert-line--vertical .ntbl-insert-btn:hover {\n\ttransform: translateY(-50%) scale(1.2);\n}\n\n/* --- Add Row / Add Column Zones --- */\n.ntbl-add-zone {\n\tposition: absolute;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tcursor: pointer;\n\tuser-select: none;\n\topacity: 0;\n\ttransition: opacity 0.2s ease, background 0.2s ease,\n\t\tborder-color 0.2s ease;\n}\n\n.ntbl-container:hover .ntbl-add-zone,\n.ntbl-container:focus-within .ntbl-add-zone {\n\topacity: 1;\n}\n\n.ntbl-container.notectl-table--selected .ntbl-add-zone {\n\topacity: 1;\n}\n\n.ntbl-delete-table-btn {\n\tposition: absolute;\n\ttop: 0;\n\tinset-inline-start: 0;\n\twidth: 20px;\n\theight: 20px;\n\tborder: 1px solid var(--notectl-danger);\n\tborder-radius: 4px;\n\tbackground: var(--notectl-bg);\n\tcolor: var(--notectl-danger);\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\topacity: 0;\n\ttransition: opacity 0.2s ease, background 0.15s, border-color 0.15s;\n\tz-index: 7;\n}\n\n.ntbl-container:hover .ntbl-delete-table-btn,\n.ntbl-container:focus-within .ntbl-delete-table-btn,\n.ntbl-container.notectl-table--selected .ntbl-delete-table-btn {\n\topacity: 1;\n}\n\n.ntbl-delete-table-btn:hover,\n.ntbl-delete-table-btn:focus-visible {\n\tbackground: var(--notectl-danger-muted);\n\tborder-color: var(--notectl-danger);\n}\n\n.ntbl-delete-table-btn:focus-visible {\n\toutline: none;\n\tbox-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n/* --- Context Menu Discovery Hint --- */\n.ntbl-context-hint {\n\tposition: absolute;\n\ttop: 4px;\n\tinset-inline-end: 0;\n\tfont-size: 11px;\n\tcolor: var(--notectl-fg-muted);\n\tpadding: 2px 8px;\n\tborder-radius: 4px;\n\topacity: 0;\n\ttransition: opacity 0.2s ease;\n\tpointer-events: none;\n\twhite-space: nowrap;\n\tz-index: 5;\n}\n\n.ntbl-container:hover .ntbl-context-hint,\n.ntbl-container:focus-within .ntbl-context-hint,\n.ntbl-container.notectl-table--selected .ntbl-context-hint {\n\topacity: 1;\n}\n\n/* --- Table Actions Button --- */\n.ntbl-actions-btn {\n\tposition: absolute;\n\ttop: 0;\n\tinset-inline-start: 48px;\n\twidth: 20px;\n\theight: 20px;\n\tborder: 1px solid var(--notectl-border);\n\tborder-radius: 4px;\n\tbackground: var(--notectl-bg);\n\tcolor: var(--notectl-fg-muted);\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\topacity: 0;\n\ttransition: opacity 0.2s ease, background 0.15s, border-color 0.15s;\n\tz-index: 7;\n\tcursor: pointer;\n\tpadding: 0;\n}\n\n.ntbl-container:hover .ntbl-actions-btn,\n.ntbl-container:focus-within .ntbl-actions-btn,\n.ntbl-container.notectl-table--selected .ntbl-actions-btn {\n\topacity: 1;\n}\n\n.ntbl-actions-btn:hover,\n.ntbl-actions-btn:focus-visible {\n\tbackground: var(--notectl-hover-bg);\n\tborder-color: var(--notectl-primary);\n}\n\n.ntbl-actions-btn:focus-visible {\n\toutline: none;\n\tbox-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n/* --- Border Color Button --- */\n.ntbl-border-color-btn {\n\tposition: absolute;\n\ttop: 0;\n\tinset-inline-start: 24px;\n\twidth: 20px;\n\theight: 20px;\n\tborder: 1px solid var(--notectl-border);\n\tborder-radius: 4px;\n\tbackground: var(--notectl-bg);\n\tcolor: var(--notectl-fg-muted);\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\topacity: 0;\n\ttransition: opacity 0.2s ease, background 0.15s, border-color 0.15s;\n\tz-index: 7;\n\tcursor: pointer;\n\tpadding: 0;\n}\n\n.ntbl-container:hover .ntbl-border-color-btn,\n.ntbl-container:focus-within .ntbl-border-color-btn,\n.ntbl-container.notectl-table--selected .ntbl-border-color-btn {\n\topacity: 1;\n}\n\n.ntbl-border-color-btn:hover,\n.ntbl-border-color-btn:focus-visible {\n\tbackground: var(--notectl-hover-bg);\n\tborder-color: var(--notectl-primary);\n}\n\n.ntbl-border-color-btn:focus-visible {\n\toutline: none;\n\tbox-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n.ntbl-border-color-swatch {\n\twidth: 10px;\n\theight: 10px;\n\tborder-radius: 2px;\n\tborder: 1px solid rgba(0, 0, 0, 0.15);\n}\n\n/* --- Context Menu Keyboard Hint --- */\n.notectl-table-context-menu__hint {\n\tpadding: 4px 12px 6px;\n\tfont-size: 11px;\n\tcolor: var(--notectl-fg-muted);\n\tborder-top: 1px solid var(--notectl-border);\n\tmargin-top: 4px;\n\ttext-align: center;\n\tuser-select: none;\n}\n\n/* --- Context Menu Focus --- */\n.notectl-table-context-menu button:focus-visible {\n\toutline: none;\n\tbackground: var(--notectl-primary-muted);\n\tbox-shadow: inset 0 0 0 2px var(--notectl-focus-ring);\n}\n\n.notectl-table-context-menu [role="separator"] {\n\tborder: none;\n\tborder-top: 1px solid var(--notectl-border);\n\tmargin: 4px 0;\n\theight: 0;\n}\n\n.ntbl-add-row {\n\tbottom: 0;\n\theight: 24px;\n\tborder: 1px dashed var(--notectl-border);\n\tborder-end-start-radius: 6px;\n\tborder-end-end-radius: 6px;\n\tborder-block-start: none;\n\tcolor: var(--notectl-fg-muted);\n\ttransform: translateY(100%);\n}\n\n.ntbl-add-row:hover,\n.ntbl-add-row:focus-visible {\n\tbackground: var(--notectl-primary-muted);\n\tborder-color: var(--notectl-primary);\n\tcolor: var(--notectl-primary);\n}\n\n.ntbl-add-row:focus-visible {\n\toutline: none;\n\tbox-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n.ntbl-add-col {\n\tinset-inline-end: 0;\n\ttop: 24px;\n\twidth: 24px;\n\tborder: 1px dashed var(--notectl-border);\n\tborder-start-end-radius: 6px;\n\tborder-end-end-radius: 6px;\n\tborder-inline-start: none;\n\tcolor: var(--notectl-fg-muted);\n\ttransform: translateX(100%);\n}\n\n[dir="rtl"] .ntbl-add-col {\n\ttransform: translateX(-100%);\n}\n\n.ntbl-add-col:hover,\n.ntbl-add-col:focus-visible {\n\tbackground: var(--notectl-primary-muted);\n\tborder-color: var(--notectl-primary);\n\tcolor: var(--notectl-primary);\n}\n\n.ntbl-add-col:focus-visible {\n\toutline: none;\n\tbox-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n.ntbl-add-icon {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\ttransition: transform 0.2s ease;\n}\n\n.ntbl-add-zone:hover .ntbl-add-icon {\n\ttransform: scale(1.15);\n}\n'),this.context=t,this.registerNodeSpecs(t),this.registerNodeViews(t),U(t,this.locale),t.registerCommand("resetTableBorderColor",()=>j(t,this.locale)),function(t,e){const n={Tab:()=>function(t,e){return J(t,(n,o,r)=>r.colIndex<r.totalCols-1?et(t,r.tableId,r.rowIndex,r.colIndex+1):r.rowIndex<r.totalRows-1?et(t,r.tableId,r.rowIndex+1,0):(X(t,e),!0))}(t,e),"Shift-Tab":()=>function(t){return J(t,(e,n,o)=>o.colIndex>0?et(t,o.tableId,o.rowIndex,o.colIndex-1):!(o.rowIndex>0)||et(t,o.tableId,o.rowIndex-1,o.totalCols-1))}(t),Backspace:()=>function(t){return J(t,(e,n,o)=>{if(!a(n))return!1;if(0!==n.anchor.offset)return!1;if(0!==o.rowIndex||0!==o.colIndex)return!1;const r=E(e,o.cellId);return n.anchor.blockId===r&&ot(t,o.tableId)})}(t),Delete:()=>function(t){return J(t,(e,n,o)=>{if(!a(n))return!1;const r=e.getBlock(n.anchor.blockId);if(!r)return!1;const i=v(r);if(n.anchor.offset!==i)return!1;if(o.rowIndex!==o.totalRows-1||o.colIndex!==o.totalCols-1)return!1;const l=T(e,o.cellId);return n.anchor.blockId===l&&ot(t,o.tableId)})}(t),ArrowDown:()=>function(t){return J(t,(e,n,o)=>{const r=T(e,o.cellId);return n.anchor.blockId===r&&(o.rowIndex>=o.totalRows-1?Q(t):et(t,o.tableId,o.rowIndex+1,o.colIndex))})}(t),ArrowUp:()=>function(t){return J(t,(e,n,o)=>{const r=E(e,o.cellId);return n.anchor.blockId===r&&!(o.rowIndex<=0)&&et(t,o.tableId,o.rowIndex-1,o.colIndex)})}(t),ArrowRight:()=>function(t){return J(t,(e,n,o)=>{if(!a(n))return!1;const r=e.getBlock(n.anchor.blockId);if(!r)return!1;const i=v(r);if(n.anchor.offset!==i)return!1;const l=T(e,o.cellId);return n.anchor.blockId===l&&(o.colIndex<o.totalCols-1?et(t,o.tableId,o.rowIndex,o.colIndex+1):!(o.rowIndex<o.totalRows-1)||et(t,o.tableId,o.rowIndex+1,0))})}(t),ArrowLeft:()=>function(t){return J(t,(e,n,o)=>{if(!a(n))return!1;if(0!==n.anchor.offset)return!1;const r=E(e,o.cellId);return n.anchor.blockId===r&&(o.colIndex>0?nt(t,o.tableId,o.rowIndex,o.colIndex-1):!(o.rowIndex>0)||nt(t,o.tableId,o.rowIndex-1,o.totalCols-1))})}(t),Escape:()=>Q(t),"Shift-F10":()=>function(t){return J(t,(e,n,o)=>{const r=t.getContainer(),i=r.querySelector(`[data-block-id="${o.cellId}"]`);if(!i)return!1;const l=i.getBoundingClientRect(),s=new DOMRect(l.left+l.width/2,l.bottom,0,0),a=r.querySelector(`[data-block-id="${o.tableId}"].ntbl-container`)??r;return tt?.close(),tt=G(a,t,o.tableId,s,()=>{tt=null}),!0})}(t)};t.registerKeymap(n,{priority:"context"})}(t,this.locale),this.registerToolbarItem(t),this.selectionService=function(t){let e=null,n=[],o=/* @__PURE__ */new Set;function r(){if(!e)return n=[],void(o=/* @__PURE__ */new Set);const r=t.getState(),i=[],l=Math.min(e.fromRow,e.toRow),s=Math.max(e.fromRow,e.toRow),a=Math.min(e.fromCol,e.toCol),c=Math.max(e.fromCol,e.toCol);for(let t=l;t<=s;t++)for(let n=a;n<=c;n++){const o=R(r,e.tableId,t,n);o&&i.push(o)}n=i,o=new Set(i)}const i={getSelectedRange:()=>e,setSelectedRange(n){e=n,r();const o=t.getState();t.dispatch(o.transaction("api").setSelection(o.selection).build())},clearSelectionSilent(){e=null,r()},getSelectedCellIds:()=>n,isSelected:t=>o.has(t)};return t.registerService(ht,i),i}(t)}onReady(){this.context&&this.selectionService&&(this.cleanupMouseSelection=function(t,e){const n=t.getContainer();let o=null,r=!1;function i(n){const i=n.target.closest("td[data-block-id]");if(!i)return o=null,r=!1,void e.setSelectedRange(null);if(n.shiftKey){if(o){const r=A(t.getState(),i.getAttribute("data-block-id"));if(!r||r.tableId!==o.tableId)return o=null,void e.setSelectedRange(null);n.preventDefault(),e.setSelectedRange({tableId:o.tableId,fromRow:o.row,fromCol:o.col,toRow:r.rowIndex,toCol:r.colIndex})}}else{e.setSelectedRange(null);const n=A(t.getState(),i.getAttribute("data-block-id"));if(!n)return o=null,void(r=!1);o={tableId:n.tableId,row:n.rowIndex,col:n.colIndex},r=!0}}function l(n){if(!r||!o)return;const i=n.target.closest("td[data-block-id]");if(!i)return;const l=A(t.getState(),i.getAttribute("data-block-id"));l&&l.tableId===o.tableId&&(l.rowIndex===o.row&&l.colIndex===o.col||(n.preventDefault(),e.setSelectedRange({tableId:o.tableId,fromRow:o.row,fromCol:o.col,toRow:l.rowIndex,toCol:l.colIndex})))}function s(){r=!1}return n.addEventListener("mousedown",i),n.addEventListener("mousemove",l),document.addEventListener("mouseup",s),()=>{n.removeEventListener("mousedown",i),n.removeEventListener("mousemove",l),document.removeEventListener("mouseup",s)}}(this.context,this.selectionService))}destroy(){this.cleanupMouseSelection?.(),this.cleanupMouseSelection=null,this.selectionService=null,this.context=null}decorations(n){if(!this.selectionService)return t.empty;if(!this.selectionService.getSelectedRange())return t.empty;const r=n.selection;if(!o(r)||!M(n,r.anchor.blockId))return this.selectionService.clearSelectionSilent(),t.empty;const i=this.selectionService.getSelectedCellIds();if(0===i.length)return t.empty;const l=[];for(const t of i)l.push(e(t,{class:"notectl-table-cell--selected"}));return t.create(l)}registerNodeSpecs(t){t.registerNodeSpec({type:"table",group:"block",content:{allow:["table_row"],min:1},isolating:!0,selectable:!0,toDOM(t){const e=document.createElement("div");return e.className="notectl-table-wrapper",e.setAttribute("data-block-id",t.id),e},toHTML(t,e,o){const r=t.attrs?.borderColor,i=function(t){return t?"none"===t?`${ft}; --ntbl-bc: transparent`:c(t)?`${ft}; --ntbl-bc: ${n(t)}`:ft:ft}(r);return`<table${o?.styleAttr(i)??` style="${i}"`}>${e}</table>`},sanitize:{tags:["table","tbody"]}}),t.registerNodeSpec({type:"table_row",group:"table_content",content:{allow:["table_cell"],min:1},toDOM(t){const e=document.createElement("tr");return e.setAttribute("data-block-id",t.id),e.setAttribute("role","row"),e},toHTML:(t,e)=>`<tr>${e}</tr>`,sanitize:{tags:["tr"]}}),t.registerNodeSpec({type:"table_cell",group:"table_content",content:{allow:["paragraph","list_item","heading","blockquote","image","horizontal_rule"]},isolating:!0,toDOM(t){const e=document.createElement("td");return e.setAttribute("data-block-id",t.id),e.setAttribute("role","cell"),e},toHTML(t,e,n){const o=t.attrs?.colspan??1,r=t.attrs?.rowspan??1,i=[n?.styleAttr(gt)??` style="${gt}"`];return o>1&&i.push(` colspan="${o}"`),r>1&&i.push(` rowspan="${r}"`),`<td${i.join("")}>${e}</td>`},sanitize:{tags:["td"],attrs:["colspan","rowspan"]}})}registerNodeViews(t){t.getSchemaRegistry(),t.registerNodeView("table",function(t,e,n=N){return(t,o,r)=>{const i=document.createElement("div");i.className="ntbl-container",i.setAttribute("data-block-id",t.id),i.setAttribute("data-selectable","true");const l=document.createElement("div");l.className="notectl-table-wrapper";const s=document.createElement("table");s.className="notectl-table",s.setAttribute("role","table");const a=h(t),c=a.length,d=a[0]?h(a[0]).length:0;s.setAttribute("aria-label",n.tableAriaLabel(c,d)),s.setAttribute("aria-description",n.tableAriaDescription);const u=document.createElement("tbody");s.appendChild(u),l.appendChild(s),i.appendChild(l),pt(s,t.attrs?.borderColor);const b=document.createElement("div");b.className="notectl-sr-only",b.setAttribute("aria-live","polite"),b.setAttribute("aria-atomic","true"),i.appendChild(b);const p=function(t,e,n,o,r,i,l){return new bt(t,e,n,o,r,i,l)}(i,s,t,o,r,e,n);let m=null,f=t.id;const g=t=>{if(!e)return;t.preventDefault(),t.stopPropagation(),m?.close();const o=new DOMRect(t.clientX,t.clientY,0,0);m=G(i,e,f,o,()=>{m=null},n)};return s.addEventListener("contextmenu",g),{dom:i,contentDOM:u,update(t){if("table"!==t.type)return!1;f=t.id,i.setAttribute("data-block-id",t.id),i.setAttribute("data-selectable","true");const e=h(t),o=e.length,r=e[0]?h(e[0]).length:0;return s.setAttribute("aria-label",n.tableAriaLabel(o,r)),pt(s,t.attrs?.borderColor),p.update(t),!1},destroy(){m?.destroy(),s.removeEventListener("contextmenu",g),p.destroy()},selectNode(){i.classList.add("notectl-table--selected")},deselectNode(){i.classList.remove("notectl-table--selected")}}}}(0,t,this.locale)),t.registerNodeView("table_row",(t,e,n)=>{const o=document.createElement("tr");return o.setAttribute("data-block-id",t.id),o.setAttribute("role","row"),{dom:o,contentDOM:o,update:t=>("table_row"!==t.type||o.setAttribute("data-block-id",t.id),!1),destroy(){}}}),t.registerNodeView("table_cell",(t,e,n)=>{const o=document.createElement("td");o.setAttribute("data-block-id",t.id),o.setAttribute("role","cell");const r=t.attrs?.colspan??1,i=t.attrs?.rowspan??1;r>1&&(o.colSpan=r),i>1&&(o.rowSpan=i);const l=t.attrs?.align;return l&&"left"!==l&&I(o,"textAlign",l),{dom:o,contentDOM:o,update(t){if("table_cell"!==t.type)return!1;o.setAttribute("data-block-id",t.id);const e=t.attrs?.colspan??1,n=t.attrs?.rowspan??1;return e>1?o.colSpan=e:o.removeAttribute("colspan"),n>1?o.rowSpan=n:o.removeAttribute("rowspan"),!1},destroy(){}}})}registerToolbarItem(t){const e=this.config.maxPickerRows??8,n=this.config.maxPickerCols??8;t.registerToolbarItem({id:"table",group:"insert",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 3h18v18H3V3zm2 2v4h6V5H5zm8 0v4h6V5h-6zm-8 6v4h6v-4H5zm8 0v4h6v-4h-6zm-8 6v4h6v-4H5zm8 0v4h6v-4h-6z"/></svg>',label:this.locale.insertTable,tooltip:this.locale.insertTable,command:"insertTable",popupType:"gridPicker",popupConfig:{maxRows:e,maxCols:n,onSelect:(e,n)=>{K(t,e,n)}},isActive:t=>!!o(t.selection)&&M(t,t.selection.anchor.blockId)})}}export{vt as TablePlugin,ht as TableSelectionServiceKey};
2
- //# sourceMappingURL=table.mjs.map
1
+ import{n as s,t as a}from"../chunks/TablePlugin-BHpp6h9H.mjs";export{a as TablePlugin,s as TableSelectionServiceKey};
@@ -1,2 +1 @@
1
- import{C as e}from"../chunks/color-picker-Byjl_xr9.mjs";import{a as t}from"../chunks/HTMLUtils-Cxy99Ak2.mjs";import{a as o}from"../chunks/StyleRuntime-BmsLoEa8.mjs";import{r,i as s,b as c}from"../chunks/ColorPickerPopup-D6XjShhv.mjs";import{r as a,i as l}from"../chunks/ColorValidation-DCSKq9B2.mjs";import{r as i}from"../chunks/PluginHelpers-CdPR0MuT.mjs";const f={label:"Text Color",tooltip:"Text Color",resetLabel:"Default",ariaLabelPrefix:"Text color"},n=/* @__PURE__ */Object.assign({"./locales/ar.ts":()=>import("../chunks/ar-CL3QL0tw.mjs"),"./locales/de.ts":()=>import("../chunks/de-D1OAXtxJ.mjs"),"./locales/es.ts":()=>import("../chunks/es-CBk43isB.mjs"),"./locales/fr.ts":()=>import("../chunks/fr-gurfH-7T.mjs"),"./locales/hi.ts":()=>import("../chunks/hi-DtlvSQkD.mjs"),"./locales/pt.ts":()=>import("../chunks/pt-C-Vp7Rxj.mjs"),"./locales/ru.ts":()=>import("../chunks/ru-B3O7WXNM.mjs"),"./locales/zh.ts":()=>import("../chunks/zh-BfeWdPIz.mjs")});async function m(e){if("en"===e)return f;const t=n[`./locales/${e}.ts`];if(!t)return f;try{return(await t()).default}catch{return f}}const p=["#000000","#434343","#666666","#999999","#b7b7b7","#cccccc","#d9d9d9","#efefef","#f3f3f3","#ffffff","#980000","#ff0000","#ff9900","#ffff00","#00ff00","#00ffff","#4a86e8","#0000ff","#9900ff","#ff00ff","#e6b8af","#f4cccc","#fce5cd","#fff2cc","#d9ead3","#d0e0e3","#c9daf8","#cfe2f3","#d9d2e9","#ead1dc","#dd7e6b","#ea9999","#f9cb9c","#ffe599","#b6d7a8","#a2c4c9","#a4c2f4","#9fc5e8","#b4a7d6","#d5a6bd","#cc4125","#e06666","#f6b26b","#ffd966","#93c47d","#76a5af","#6d9eeb","#6fa8dc","#8e7cc3","#c27ba0","#a61c00","#cc0000","#e69138","#f1c232","#6aa84f","#45818e","#3c78d8","#3d85c6","#674ea7","#a64d79","#85200c","#990000","#b45f06","#bf9000","#38761d","#134f5c","#1155cc","#0b5394","#351c75","#741b47"];class d{id="textColor";name="Text Color";priority=23;config;colors;locale;constructor(e){this.config={...e},this.colors=a(e?.colors,p,"TextColorPlugin")}async init(t){this.locale=await i(t,this.config.locale,f,m),t.registerStyleSheet(e),this.registerMarkSpec(t),this.registerCommands(t),this.registerToolbarItem(t)}registerMarkSpec(e){e.registerMarkSpec({type:"textColor",rank:5,attrs:{color:{default:""}},toDOM(e){const t=document.createElement("span"),r=e.attrs?.color??"";return o(t,"color",r),t},toHTMLString:(e,o,r)=>{const s=String(e.attrs?.color??"");if(!s||!l(s))return o;const c=`color: ${t(s)}`;return`<span${r?.styleAttr(c)??` style="${c}"`}>${o}</span>`},toHTMLStyle:e=>{const o=String(e.attrs?.color??"");return o&&l(o)?`color: ${t(o)}`:null},parseHTML:[{tag:"span",getAttrs:e=>{const t=e.style.color;return!(!t||!l(t))&&{color:t}}}],sanitize:{tags:["span"]}})}registerCommands(e){e.registerCommand("removeTextColor",()=>r(e,e.getState(),"textColor"))}registerToolbarItem(e){const t=['<svg xmlns="http://www.w3.org/2000/svg"',' viewBox="0 0 24 24">','<path d="M11 3L5.5 17h2.25l1.12-3h6.25l1.12 3h2.25L13 3h-2zm-1.38 9L12 5.67 14.38 12H9.62z"/>','<rect x="3" y="19.5" width="18" height="3"',' rx="0.5" fill="#e53935"/>',"</svg>"].join("");e.registerToolbarItem({id:"textColor",group:"format",icon:t,label:this.locale.label,tooltip:this.locale.tooltip,command:"removeTextColor",popupType:"custom",renderPopup:(e,t,o)=>{c(e,t,{markType:"textColor",colors:this.colors,columns:10,resetLabel:this.locale.resetLabel,resetCommand:"removeTextColor",ariaLabelPrefix:this.locale.ariaLabelPrefix,onClose:o})},isActive:e=>s(e,"textColor")})}}export{f as TEXT_COLOR_LOCALE_EN,d as TextColorPlugin,m as loadTextColorLocale};
2
- //# sourceMappingURL=text-color.mjs.map
1
+ import{n as o,r,t as s}from"../chunks/TextColorPlugin-CGbyMGTr.mjs";export{o as TEXT_COLOR_LOCALE_EN,s as TextColorPlugin,r as loadTextColorLocale};
@@ -1,2 +1 @@
1
- import{i as t,a as e,r as i}from"../chunks/AttributedMarkCommands-BY1BSYWM.mjs";import{a as o}from"../chunks/HTMLUtils-Cxy99Ak2.mjs";import{j as r,i as n,h as s}from"../chunks/Selection-DhbizDM4.mjs";import{m as a}from"../chunks/TypeBrands-Bp_Z_o5Y.mjs";import{a as l}from"../chunks/Platform-CU6itXZo.mjs";import{r as c,g as d}from"../chunks/PluginHelpers-CdPR0MuT.mjs";import{f as u}from"../chunks/ShortcutFormatting-BLKS0Gys.mjs";import{d as h,f as m,g,S as p,l as f,T as b}from"../chunks/TextDirectionLocale-CKz0ZrH_.mjs";import{i as v,b as T}from"../chunks/Document-3pNX7ear.mjs";function y(t,e,i){const o=t.getNodePath(e.id);if(o)return{type:"setNodeAttr",path:o,attrs:{...e.attrs,dir:i},previousAttrs:e.attrs}}function B(t,e,i,o){const r=e.getBlock(t.blockId);if(!r||!i.has(r.type))return;const n=v(r);if("auto"!==g(r)&&n.length>0)return;const s=T(r,t.offset),a=n.slice(0,s)+t.text+n.slice(s),l=h(a);if(!l)return;const c=y(e,r,l);c&&o.push(c)}function D(t,e,i,o){const r=e.getBlock(t.blockId);if(!r||!i.has(r.type))return;const n=g(r);if("auto"===n)return;const s=v(r),a=T(r,t.from),l=T(r,t.to),c=s.slice(0,a)+s.slice(l);if(0===c.length){const t=y(e,r,"auto");return void(t&&o.push(t))}const d=h(c);if(!d||d===n)return;const u=y(e,r,d);u&&o.push(u)}const w={directableTypes:["paragraph","heading","title","subtitle","table_cell","blockquote","list_item"]},k={ltr:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9 10v5h2V4h2v11h2V4h2V2H9C6.79 2 5 3.79 5 6s1.79 4 4 4zm12 8l-4-4v3H5v2h12v3l4-4z"/></svg>',rtl:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 10v5h2V4h2v11h2V4h2V2h-8C7.79 2 6 3.79 6 6s1.79 4 4 4zM8 14l-4 4 4 4v-3h12v-2H8v-3z"/></svg>',auto:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9 10v5h2V4h2v11h2V4h2V2H9C6.79 2 5 3.79 5 6s1.79 4 4 4zm3 8l-4-4v3H3v2h5v3l4-4zm7 0v-3l4 4-4 4v-3h-5v-2h5z"/></svg>'},S=["ltr","rtl","auto"];class x{id="text-direction";name="Text Direction";priority=91;config;locale;directableTypes;shiftDirHandler=null;constructor(t){this.config={...w,...t}}async init(t){this.locale=await c(t,this.config.locale,b,f),this.directableTypes=new Set(this.config.directableTypes),this.patchNodeSpecs(t),this.registerBdiMark(t),this.registerCommands(t),this.registerKeymaps(t),this.registerToolbarItem(t),this.registerInlineToolbarItem(t),function(t,e){t.registerMiddleware((t,i,o)=>{let r=!1;const n=t.steps.map(t=>{if("setBlockType"!==t.type)return t;if(!e.has(t.nodeType))return t;const i=t.previousAttrs?.dir;return i&&"auto"!==i?(r=!0,{...t,attrs:{...t.attrs,dir:i}}):t});o(r?{...t,steps:n}:t)},{name:"text-direction:preserve-dir"})}(t,this.directableTypes),function(t,e){t.registerMiddleware((t,i,o)=>{const r=[];for(const n of t.steps)"insertText"===n.type?B(n,i,e,r):"deleteText"===n.type&&D(n,i,e,r);o(r.length>0?{...t,steps:[...t.steps,...r]}:t)},{name:"text-direction:auto-detect"})}(t,this.directableTypes),function(t,e){t.registerMiddleware((t,i,o)=>{let r=!1;const n=t.steps.map(t=>{if("insertNode"!==t.type)return t;if(!e.has(t.node.type))return t;if("auto"!==String(t.node.attrs?.dir??"auto"))return t;const o=v(t.node);if(o.length>0){const e=h(o);if(e)return r=!0,{...t,node:{...t.node,attrs:{...t.node.attrs,dir:e}}}}const n=m(i,t.parentPath,t.index);return n&&"auto"!==n?(r=!0,{...t,node:{...t.node,attrs:{...t.node.attrs,dir:n}}}):t});o(r?{...t,steps:n}:t)},{name:"text-direction:inherit-dir"})}(t,this.directableTypes),l()||(this.shiftDirHandler=new p(t),this.shiftDirHandler.attach(t.getContainer()))}destroy(){this.shiftDirHandler?.detach(),this.shiftDirHandler=null}patchNodeSpecs(t){const e=t.getSchemaRegistry();for(const i of this.config.directableTypes){const t=e.getNodeSpec(i);if(!t)continue;if(t.attrs?.dir)continue;const o=t.toDOM;e.removeNodeSpec(i),e.registerNodeSpec({...t,attrs:{...t.attrs,dir:{default:"auto"}},toDOM(e){const i=o.call(t,e);return L(i,e),i}})}}registerBdiMark(t){t.registerMarkSpec({type:"bdi",rank:10,attrs:{dir:{default:"auto"}},toDOM(t){const e=document.createElement("bdi"),i=String(t.attrs?.dir??"auto");return e.setAttribute("dir",i),e},toHTMLString:(t,e)=>`<bdi dir="${o(String(t.attrs?.dir??"auto"))}">${e}</bdi>`,parseHTML:[{tag:"bdi",getAttrs:t=>{const e=t.getAttribute("dir");return"ltr"===e||"rtl"===e?{dir:e}:{dir:"auto"}}}],sanitize:{tags:["bdi"],attrs:["dir"]}})}registerCommands(t){t.registerCommand("setDirectionLTR",()=>{const e=this.setDirection(t,"ltr");return e&&t.announce(this.locale.announceLTR),e}),t.registerCommand("setDirectionRTL",()=>{const e=this.setDirection(t,"rtl");return e&&t.announce(this.locale.announceRTL),e}),t.registerCommand("setDirectionAuto",()=>{const e=this.setDirection(t,"auto");return e&&t.announce(this.locale.announceAuto),e}),t.registerCommand("toggleBidiLTR",()=>{const e=this.applyBdi(t,"ltr");return e&&t.announce(this.locale.inlineLTR),e}),t.registerCommand("toggleBidiRTL",()=>{const e=this.applyBdi(t,"rtl");return e&&t.announce(this.locale.inlineRTL),e}),t.registerCommand("toggleBidiAuto",()=>{const e=this.applyBdi(t,"auto");return e&&t.announce(this.locale.inlineAuto),e}),t.registerCommand("removeBidi",()=>{const e=this.removeBdi(t);return e&&t.announce(this.locale.announceRemoveBidi),e}),t.registerCommand("toggleBidiIsolation",()=>this.toggleBidiIsolation(t)),t.registerCommand("toggleDirection",()=>{const e=t.getState(),i=d(e);if(!i||!this.directableTypes.has(i.type))return!1;const o=g(i),r="auto"===o?"rtl":"rtl"===o?"ltr":"auto";return this.setDirection(t,r)})}registerKeymaps(t){t.registerKeymap({"Mod-Shift-D":()=>t.executeCommand("toggleDirection"),"Mod-Shift-B":()=>t.executeCommand("toggleBidiIsolation")})}registerToolbarItem(t){const e={ltr:"setDirectionLTR",rtl:"setDirectionRTL",auto:"setDirectionAuto"},i=S.map(t=>({label:this.getDirectionLabel(t),command:e[t],icon:k[t]}));t.registerToolbarItem({id:"text-direction",group:"block",icon:k.auto,label:this.locale.toolbarLabel,tooltip:`${this.locale.toolbarTooltip} (${u("Mod-Shift-D")})`,command:"setDirectionAuto",popupType:"dropdown",popupConfig:{items:i},isActive:t=>this.isNonDefaultDirection(t),isEnabled:t=>this.isDirectable(t),getIcon:t=>{const e=d(t);if(!e)return k.auto;const i=g(e);return k[i]??k.auto}})}registerInlineToolbarItem(e){const i=[{label:this.locale.inlineLTR,command:"toggleBidiLTR",icon:k.ltr},{label:this.locale.inlineRTL,command:"toggleBidiRTL",icon:k.rtl},{label:this.locale.inlineAuto,command:"toggleBidiAuto",icon:k.auto},{label:this.locale.announceRemoveBidi,command:"removeBidi"}];e.registerToolbarItem({id:"inline-direction",group:"format",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 4v7h2V4h2v7h2V4h1V2H10a3 3 0 1 0 0 6zm-3.5 9.5L3 17l3.5 3.5V18h3v-2h-3v-2.5zm14 0L17 17l3.5 3.5V18h-3v-2h3v-2.5zM11 16h2v6h-2z"/></svg>',label:this.locale.inlineLabel,tooltip:`${this.locale.inlineTooltip} (${u("Mod-Shift-B")})`,command:"toggleBidiIsolation",popupType:"dropdown",popupConfig:{items:i},isActive:e=>t(e,"bdi"),isEnabled:t=>{const e=t.selection;return r(e)&&!n(e)}})}getDirectionLabel(t){return"ltr"===t?this.locale.ltr:"rtl"===t?this.locale.rtl:this.locale.auto}setDirection(t,e){const i=t.getState(),o=this.getSelectedBlockIds(i);if(0===o.length)return!1;const r=i.transaction("command");let n=!1;for(const a of o){const t=i.getBlock(a);if(!t||!this.directableTypes.has(t.type))continue;const o=i.getNodePath(a);o&&(r.setNodeAttr(o,{...t.attrs,dir:e}),n=!0)}if(!n)return!1;const s=r.setSelection(i.selection).build();return t.dispatch(s),!0}getSelectedBlockIds(t){const e=t.selection;if(s(e))return[e.nodeId];if(!r(e))return[];const i=e.anchor.blockId,o=e.head.blockId;if(i===o)return[i];const n=t.getBlockOrder(),a=n.indexOf(i),l=n.indexOf(o);if(-1===a||-1===l)return[];const c=Math.min(a,l),d=Math.max(a,l);return n.slice(c,d+1)}isNonDefaultDirection(t){const e=d(t);if(!e||!this.directableTypes.has(e.type))return!1;const i=e.attrs?.dir;return null!=i&&"auto"!==i}isDirectable(t){const e=d(t);return null!=e&&this.directableTypes.has(e.type)}toggleBidiIsolation(e){const i=e.getState();if(t(i,"bdi")){const t=this.removeBdi(e);return t&&e.announce(this.locale.announceRemoveBidi),t}const o=d(i),r="rtl"===(o?g(o):"auto")?"ltr":"rtl",n=this.applyBdi(e,r);if(n){const t="ltr"===r?this.locale.inlineLTR:this.locale.inlineRTL;e.announce(t)}return n}applyBdi(t,i){const o=t.getState(),r={type:a("bdi"),attrs:{dir:i}},n=e(o,r);return!!n&&(t.dispatch(n),!0)}removeBdi(t){const e=t.getState(),o=i(e,a("bdi"));return!!o&&(t.dispatch(o),!0)}}function L(t,e){const i=e.attrs?.dir;"ltr"!==i&&"rtl"!==i&&"auto"!==i||t.setAttribute("dir",i)}export{k as DIRECTION_ICONS,b as TEXT_DIRECTION_LOCALE_EN,x as TextDirectionAdvancedPlugin,h as detectTextDirection,m as findSiblingDirection,g as getBlockDir,f as loadTextDirectionLocale};
2
- //# sourceMappingURL=text-direction-advanced.mjs.map
1
+ import{a,i as s,n as t,o as e,t as i}from"../chunks/TextDirectionLocale-DxOfFixh.mjs";import{n,t as o}from"../chunks/text-direction-advanced-B71gUwvk.mjs";export{o as DIRECTION_ICONS,i as TEXT_DIRECTION_LOCALE_EN,n as TextDirectionAdvancedPlugin,s as detectTextDirection,a as findSiblingDirection,e as getBlockDir,t as loadTextDirectionLocale};
@@ -1,2 +1 @@
1
- import{h as t,j as e}from"../chunks/Selection-DhbizDM4.mjs";import{a as i}from"../chunks/Platform-CU6itXZo.mjs";import{r as o,g as r}from"../chunks/PluginHelpers-CdPR0MuT.mjs";import{f as s}from"../chunks/ShortcutFormatting-BLKS0Gys.mjs";import{S as n,g as c,l as a,T as l}from"../chunks/TextDirectionLocale-CKz0ZrH_.mjs";import{d as h,f as u}from"../chunks/TextDirectionLocale-CKz0ZrH_.mjs";const d={directableTypes:["paragraph","heading","title","subtitle","table_cell","blockquote","list_item"]},m={ltr:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9 10v5h2V4h2v11h2V4h2V2H9C6.79 2 5 3.79 5 6s1.79 4 4 4zm12 8l-4-4v3H5v2h12v3l4-4z"/></svg>',rtl:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 10v5h2V4h2v11h2V4h2V2h-8C7.79 2 6 3.79 6 6s1.79 4 4 4zM8 14l-4 4 4 4v-3h12v-2H8v-3z"/></svg>',auto:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9 10v5h2V4h2v11h2V4h2V2H9C6.79 2 5 3.79 5 6s1.79 4 4 4zm3 8l-4-4v3H3v2h5v3l4-4zm7 0v-3l4 4-4 4v-3h-5v-2h5z"/></svg>'},g=["ltr","rtl","auto"];class p{id="text-direction";name="Text Direction";priority=91;config;locale;directableTypes;shiftDirHandler=null;constructor(t){this.config={...d,...t}}async init(t){this.locale=await o(t,this.config.locale,l,a),this.directableTypes=new Set(this.config.directableTypes),this.patchNodeSpecs(t),this.registerCommands(t),this.registerKeymaps(t),this.registerToolbarItem(t),i()||(this.shiftDirHandler=new n(t),this.shiftDirHandler.attach(t.getContainer()))}destroy(){this.shiftDirHandler?.detach(),this.shiftDirHandler=null}patchNodeSpecs(t){const e=t.getSchemaRegistry();for(const i of this.config.directableTypes){const t=e.getNodeSpec(i);if(!t)continue;if(t.attrs?.dir)continue;const o=t.toDOM;e.removeNodeSpec(i),e.registerNodeSpec({...t,attrs:{...t.attrs,dir:{default:"auto"}},toDOM(e){const i=o.call(t,e);return f(i,e),i}})}}registerCommands(t){t.registerCommand("setDirectionLTR",()=>{const e=this.setDirection(t,"ltr");return e&&t.announce(this.locale.announceLTR),e}),t.registerCommand("setDirectionRTL",()=>{const e=this.setDirection(t,"rtl");return e&&t.announce(this.locale.announceRTL),e}),t.registerCommand("setDirectionAuto",()=>{const e=this.setDirection(t,"auto");return e&&t.announce(this.locale.announceAuto),e}),t.registerCommand("toggleDirection",()=>{const e=t.getState(),i=r(e);if(!i||!this.directableTypes.has(i.type))return!1;const o=c(i),s="auto"===o?"rtl":"rtl"===o?"ltr":"auto";return this.setDirection(t,s)})}registerKeymaps(t){t.registerKeymap({"Mod-Shift-D":()=>t.executeCommand("toggleDirection")})}registerToolbarItem(t){const e={ltr:"setDirectionLTR",rtl:"setDirectionRTL",auto:"setDirectionAuto"},i=g.map(t=>({label:this.getDirectionLabel(t),command:e[t],icon:m[t]}));t.registerToolbarItem({id:"text-direction",group:"block",icon:m.auto,label:this.locale.toolbarLabel,tooltip:`${this.locale.toolbarTooltip} (${s("Mod-Shift-D")})`,command:"setDirectionAuto",popupType:"dropdown",popupConfig:{items:i},isActive:t=>this.isNonDefaultDirection(t),isEnabled:t=>this.isDirectable(t),getIcon:t=>{const e=r(t);if(!e)return m.auto;const i=c(e);return m[i]??m.auto}})}getDirectionLabel(t){return"ltr"===t?this.locale.ltr:"rtl"===t?this.locale.rtl:this.locale.auto}setDirection(t,e){const i=t.getState(),o=this.getSelectedBlockIds(i);if(0===o.length)return!1;const r=i.transaction("command");let s=!1;for(const c of o){const t=i.getBlock(c);if(!t||!this.directableTypes.has(t.type))continue;const o=i.getNodePath(c);o&&(r.setNodeAttr(o,{...t.attrs,dir:e}),s=!0)}if(!s)return!1;const n=r.setSelection(i.selection).build();return t.dispatch(n),!0}getSelectedBlockIds(i){const o=i.selection;if(t(o))return[o.nodeId];if(!e(o))return[];const r=o.anchor.blockId,s=o.head.blockId;if(r===s)return[r];const n=i.getBlockOrder(),c=n.indexOf(r),a=n.indexOf(s);if(-1===c||-1===a)return[];const l=Math.min(c,a),h=Math.max(c,a);return n.slice(l,h+1)}isNonDefaultDirection(t){const e=r(t);if(!e||!this.directableTypes.has(e.type))return!1;const i=e.attrs?.dir;return null!=i&&"auto"!==i}isDirectable(t){const e=r(t);return null!=e&&this.directableTypes.has(e.type)}}function f(t,e){const i=e.attrs?.dir;"ltr"!==i&&"rtl"!==i&&"auto"!==i||t.setAttribute("dir",i)}export{m as DIRECTION_ICONS,l as TEXT_DIRECTION_LOCALE_EN,p as TextDirectionPlugin,h as detectTextDirection,u as findSiblingDirection,c as getBlockDir,a as loadTextDirectionLocale};
2
- //# sourceMappingURL=text-direction.mjs.map
1
+ import{a as s,i,n as o,o as t,t as a}from"../chunks/TextDirectionLocale-DxOfFixh.mjs";import{n as e,t as n}from"../chunks/TextDirectionCorePlugin-DPU7wy6g.mjs";export{n as DIRECTION_ICONS,a as TEXT_DIRECTION_LOCALE_EN,e as TextDirectionPlugin,i as detectTextDirection,s as findSiblingDirection,t as getBlockDir,o as loadTextDirectionLocale};
@@ -1,2 +1 @@
1
- import{m as t}from"../chunks/TypeBrands-Bp_Z_o5Y.mjs";import{r as e,t as s}from"../chunks/PluginHelpers-CdPR0MuT.mjs";import{f as i}from"../chunks/ShortcutFormatting-BLKS0Gys.mjs";import{c as o,i as r}from"../chunks/MarkCommands-CeCa4WSC.mjs";const n={boldLabel:"Bold",italicLabel:"Italic",underlineLabel:"Underline"},a=/* @__PURE__ */Object.assign({"./locales/ar.ts":()=>import("../chunks/ar-BYNFEVLc.mjs"),"./locales/de.ts":()=>import("../chunks/de-CFD_Wgik.mjs"),"./locales/es.ts":()=>import("../chunks/es-Ce-AEYxc.mjs"),"./locales/fr.ts":()=>import("../chunks/fr-B-_yKIAY.mjs"),"./locales/hi.ts":()=>import("../chunks/hi-BMIt3y_-.mjs"),"./locales/pt.ts":()=>import("../chunks/pt-Dx9UkZ3j.mjs"),"./locales/ru.ts":()=>import("../chunks/ru-BCriPw-8.mjs"),"./locales/zh.ts":()=>import("../chunks/zh-CY01pMD4.mjs")});async function c(t){if("en"===t)return n;const e=a[`./locales/${t}.ts`];if(!e)return n;try{return(await e()).default}catch{return n}}const l={bold:!0,italic:!0,underline:!0},g=[{type:"bold",configKey:"bold",rank:0,tag:"strong",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79 0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79 0-1.52-.86-2.82-2.15-3.42zM10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3v-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z"/></svg>',keyBinding:"Mod-B",toHTMLString:t=>`<strong>${t}</strong>`,parseHTML:[{tag:"strong"},{tag:"b",getAttrs:t=>{const e=t.style.fontWeight;return"normal"!==e&&"400"!==e&&{}}},{tag:"span",getAttrs:t=>{const e=t.style.fontWeight;if(!e)return!1;if("bold"===e)return{};const s=Number.parseInt(e,10);return!Number.isNaN(s)&&s>=700&&{}}}],sanitize:{tags:["strong","b"]}},{type:"italic",configKey:"italic",rank:1,tag:"em",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4z"/></svg>',keyBinding:"Mod-I",toHTMLString:t=>`<em>${t}</em>`,parseHTML:[{tag:"em"},{tag:"i"},{tag:"span",getAttrs:t=>"italic"===t.style.fontStyle&&{}}],sanitize:{tags:["em","i"]}},{type:"underline",configKey:"underline",rank:2,tag:"u",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 17c3.31 0 6-2.69 6-6V3h-2.5v8c0 1.93-1.57 3.5-3.5 3.5S8.5 12.93 8.5 11V3H6v8c0 3.31 2.69 6 6 6zm-7 2v2h14v-2H5z"/></svg>',keyBinding:"Mod-U",toHTMLString:t=>`<u>${t}</u>`,parseHTML:[{tag:"u"},{tag:"span",getAttrs:t=>!!t.style.textDecoration.includes("underline")&&{}}],sanitize:{tags:["u"]}}];class m{id="text-formatting";name="Text Formatting";priority=20;config;locale;constructor(t){this.config={...l,...t}}async init(t){this.locale=await e(t,this.config.locale,n,c);const s=g.filter(t=>this.config[t.configKey]);for(const e of s)this.registerMark(t,e);this.registerKeymaps(t,s),this.registerDisabledToolbarItems(t)}registerMark(e,n){const a=s(n.type),c=this.isToolbarVisible(n.configKey);if(e.registerMarkSpec({type:n.type,rank:n.rank,toDOM:()=>document.createElement(n.tag),toHTMLString:(t,e)=>n.toHTMLString(e),parseHTML:n.parseHTML,sanitize:n.sanitize}),e.registerCommand(a,()=>{const s=o(e.getState(),t(n.type));return!!s&&(e.dispatch(s),!0)}),c){const s=this.getMarkLabel(n.type);e.registerToolbarItem({id:n.type,group:"format",icon:n.icon,label:s,tooltip:`${s} (${i(n.keyBinding)})`,command:a,isActive:e=>r(e,t(n.type))})}}registerKeymaps(t,e){const i={};for(const o of e){const e=s(o.type);i[o.keyBinding]=()=>t.executeCommand(e)}Object.keys(i).length>0&&t.registerKeymap(i)}registerDisabledToolbarItems(t){if(this.config.toolbar)for(const e of g){const i=this.config[e.configKey],o=this.config.toolbar[e.configKey]??!0;!i&&o&&t.registerToolbarItem({id:e.type,group:"format",icon:e.icon,label:this.getMarkLabel(e.type),command:s(e.type),isEnabled:()=>!1})}}getMarkLabel(t){const e=`${t}Label`;return this.locale[e]}isToolbarVisible(t){return!this.config.toolbar||(this.config.toolbar[t]??!0)}}export{n as TEXT_FORMATTING_LOCALE_EN,m as TextFormattingPlugin,c as loadTextFormattingLocale};
2
- //# sourceMappingURL=text-formatting.mjs.map
1
+ import{n as t,r,t as s}from"../chunks/TextFormattingPlugin-CYVnhHH4.mjs";export{t as TEXT_FORMATTING_LOCALE_EN,s as TextFormattingPlugin,r as loadTextFormattingLocale};
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarOverflowController.d.ts","sourceRoot":"","sources":["../../../src/plugins/toolbar/ToolbarOverflowController.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,KAAK,EAAe,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AASpD,KAAK,gBAAgB,GAAG,CACvB,cAAc,EAAE,SAAS,iBAAiB,EAAE,EAC5C,cAAc,EAAE,iBAAiB,GAAG,IAAI,KACpC,IAAI,CAAC;AAEV,KAAK,eAAe,GAAG,CAAC,cAAc,EAAE,iBAAiB,EAAE,IAAI,EAAE,WAAW,KAAK,IAAI,CAAC;AAEtF,MAAM,WAAW,wBAAwB;IACxC,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;IAChC,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC5C,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAC1C,QAAQ,CAAC,gBAAgB,EAAE,MAAM,OAAO,GAAG,IAAI,CAAC;IAChD,QAAQ,CAAC,YAAY,CAAC,EAAE,YAAY,CAAC;CACrC;AAcD,qBAAa,yBAAyB;IACrC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAc;IACtC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgB;IACxC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAmB;IACpD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAkB;IAClD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAuB;IACxD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAsB;IAEnD,OAAO,CAAC,OAAO,CAAuB;IACtC,OAAO,CAAC,cAAc,CAAkC;IACxD,OAAO,CAAC,gBAAgB,CAA4B;IACpD,OAAO,CAAC,cAAc,CAA4B;IAClD,OAAO,CAAC,eAAe,CAAuB;IAC9C,OAAO,CAAC,cAAc,CAA+B;IACrD,OAAO,CAAC,YAAY,CAA0C;IAC9D,OAAO,CAAC,iBAAiB,CAA8C;IACvE,OAAO,CAAC,oBAAoB,CAAS;gBAEzB,MAAM,EAAE,wBAAwB;IAa5C,8EAA8E;IAC9E,MAAM,CAAC,OAAO,EAAE,SAAS;QAAE,OAAO,EAAE,iBAAiB,CAAC;QAAC,IAAI,EAAE,WAAW,CAAA;KAAE,EAAE,GAAG,IAAI;IAKnF,6EAA6E;IAC7E,WAAW,IAAI,IAAI;IA8DnB,8EAA8E;IAC9E,gBAAgB,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;IAuC1C,mEAAmE;IACnE,OAAO,IAAI,IAAI;IAYf,OAAO,CAAC,kBAAkB;IAS1B,OAAO,CAAC,qBAAqB;IAO7B,OAAO,CAAC,eAAe;IAcvB,OAAO,CAAC,wBAAwB;IAQhC,OAAO,CAAC,oBAAoB;IAsB5B,OAAO,CAAC,cAAc;IAQtB,OAAO,CAAC,YAAY;IA+CpB,OAAO,CAAC,mBAAmB;IA4C3B,OAAO,CAAC,gBAAgB;IA0BxB,OAAO,CAAC,oBAAoB;IAoB5B,OAAO,CAAC,aAAa;IAgCrB,OAAO,CAAC,oBAAoB;IAW5B,OAAO,CAAC,qBAAqB;IA8C7B,OAAO,CAAC,sBAAsB;IAe9B,OAAO,CAAC,YAAY;CAMpB"}
1
+ {"version":3,"file":"ToolbarOverflowController.d.ts","sourceRoot":"","sources":["../../../src/plugins/toolbar/ToolbarOverflowController.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,KAAK,EAAe,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AASpD,KAAK,gBAAgB,GAAG,CACvB,cAAc,EAAE,SAAS,iBAAiB,EAAE,EAC5C,cAAc,EAAE,iBAAiB,GAAG,IAAI,KACpC,IAAI,CAAC;AAEV,KAAK,eAAe,GAAG,CAAC,cAAc,EAAE,iBAAiB,EAAE,IAAI,EAAE,WAAW,KAAK,IAAI,CAAC;AAEtF,MAAM,WAAW,wBAAwB;IACxC,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;IAChC,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC5C,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAC1C,QAAQ,CAAC,gBAAgB,EAAE,MAAM,OAAO,GAAG,IAAI,CAAC;IAChD,QAAQ,CAAC,YAAY,CAAC,EAAE,YAAY,CAAC;CACrC;AAcD,qBAAa,yBAAyB;IACrC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAc;IACtC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgB;IACxC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAmB;IACpD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAkB;IAClD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAuB;IACxD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAsB;IAEnD,OAAO,CAAC,OAAO,CAAuB;IACtC,OAAO,CAAC,cAAc,CAAkC;IACxD,OAAO,CAAC,gBAAgB,CAA4B;IACpD,OAAO,CAAC,cAAc,CAA4B;IAClD,OAAO,CAAC,eAAe,CAAuB;IAC9C,OAAO,CAAC,cAAc,CAA+B;IACrD,OAAO,CAAC,YAAY,CAA0C;IAC9D,OAAO,CAAC,iBAAiB,CAA8C;IACvE,OAAO,CAAC,oBAAoB,CAAS;gBAEzB,MAAM,EAAE,wBAAwB;IAa5C,8EAA8E;IAC9E,MAAM,CAAC,OAAO,EAAE,SAAS;QAAE,OAAO,EAAE,iBAAiB,CAAC;QAAC,IAAI,EAAE,WAAW,CAAA;KAAE,EAAE,GAAG,IAAI;IAKnF,6EAA6E;IAC7E,WAAW,IAAI,IAAI;IA8DnB,8EAA8E;IAC9E,gBAAgB,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;IAuC1C,mEAAmE;IACnE,OAAO,IAAI,IAAI;IAYf,OAAO,CAAC,kBAAkB;IAS1B,OAAO,CAAC,qBAAqB;IAO7B,OAAO,CAAC,eAAe;IAcvB,OAAO,CAAC,wBAAwB;IAQhC,OAAO,CAAC,oBAAoB;IAsB5B,OAAO,CAAC,cAAc;IAQtB,OAAO,CAAC,YAAY;IA+CpB,OAAO,CAAC,mBAAmB;IA4C3B,OAAO,CAAC,gBAAgB;IASxB,OAAO,CAAC,oBAAoB;IAoB5B,OAAO,CAAC,aAAa;IAgCrB,OAAO,CAAC,oBAAoB;IAW5B,OAAO,CAAC,qBAAqB;IA8C7B,OAAO,CAAC,sBAAsB;IAe9B,OAAO,CAAC,YAAY;CAMpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarTooltip.d.ts","sourceRoot":"","sources":["../../../src/plugins/toolbar/ToolbarTooltip.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,qBAAa,cAAc;IAC1B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAc;IACtC,OAAO,CAAC,KAAK,CAA8C;IAC3D,OAAO,CAAC,MAAM,CAAkC;IAChD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgB;IAE9C,MAAM,CAAC,QAAQ,CAAC,UAAU,6BAA6B;gBAE3C,aAAa,EAAE,MAAM,OAAO;IASxC,IAAI,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI;IAmCrC,IAAI,IAAI,IAAI;IAYZ,OAAO,IAAI,IAAI;CAIf"}
1
+ {"version":3,"file":"ToolbarTooltip.d.ts","sourceRoot":"","sources":["../../../src/plugins/toolbar/ToolbarTooltip.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,qBAAa,cAAc;IAC1B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAc;IACtC,OAAO,CAAC,KAAK,CAA8C;IAC3D,OAAO,CAAC,MAAM,CAAkC;IAChD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgB;IAE9C,MAAM,CAAC,QAAQ,CAAC,UAAU,6BAA6B;gBAE3C,aAAa,EAAE,MAAM,OAAO;IASxC,IAAI,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI;IAoCrC,IAAI,IAAI,IAAI;IAYZ,OAAO,IAAI,IAAI;CAIf"}
@@ -1,2 +1 @@
1
- import{b as t}from"../chunks/Platform-CU6itXZo.mjs";import{S as e,r as o}from"../chunks/PluginHelpers-CdPR0MuT.mjs";import{f as n,n as r,a as i}from"../chunks/KeyboardNav-DsYhKKuV.mjs";import{P as l,a as s}from"../chunks/PopupManager-0b_Q0m7K.mjs";import{s as a,a as c}from"../chunks/StyleRuntime-BmsLoEa8.mjs";import{a as d}from"../chunks/PopupPositioning-DtvqMSop.mjs";class p{_toolbarItems=/* @__PURE__ */new Map;_toolbarItemPluginMap=/* @__PURE__ */new Map;registerToolbarItem(t,e){if(this._toolbarItems.has(t.id))throw new Error(`ToolbarItem with id "${t.id}" is already registered.`);if(this._toolbarItems.set(t.id,t),e){const o=this._toolbarItemPluginMap.get(e)??[];o.push(t.id),this._toolbarItemPluginMap.set(e,o)}}getToolbarItemsByPlugin(t){const e=this._toolbarItemPluginMap.get(t)??[],o=[];for(const n of e){const t=this._toolbarItems.get(n);t&&o.push(t)}return o}getToolbarItem(t){return this._toolbarItems.get(t)}getToolbarItems(){return[...this._toolbarItems.values()]}removeToolbarItem(t){this._toolbarItems.delete(t);for(const[e,o]of this._toolbarItemPluginMap){const n=o.indexOf(t);if(-1!==n){o.splice(n,1),0===o.length&&this._toolbarItemPluginMap.delete(e);break}}}clear(){this._toolbarItems.clear(),this._toolbarItemPluginMap.clear()}}function u(t){for(let e=0;e<t.length;e++)if(!t[e]?.disabled)return e;return-1}const h={formattingOptionsAria:"Formatting options",moreToolsAria:"More tools",gridPickerLabel:(t,e)=>`${t} x ${e}`},b=/* @__PURE__ */Object.assign({"./locales/ar.ts":()=>import("../chunks/ar-D7PS3e2g.mjs"),"./locales/de.ts":()=>import("../chunks/de-BZWSyJTG.mjs"),"./locales/es.ts":()=>import("../chunks/es-Co4AJr8Y.mjs"),"./locales/fr.ts":()=>import("../chunks/fr-CEkk4UyZ.mjs"),"./locales/hi.ts":()=>import("../chunks/hi-CPuhj7IA.mjs"),"./locales/pt.ts":()=>import("../chunks/pt-CQRzEocL.mjs"),"./locales/ru.ts":()=>import("../chunks/ru-ClEM6OKY.mjs"),"./locales/zh.ts":()=>import("../chunks/zh-DCQZ6gss.mjs")});async function m(t){if("en"===t)return h;const e=b[`./locales/${t}.ts`];if(!e)return h;try{return(await e()).default}catch{return h}}const f={BurgerMenu:"burger-menu",Flow:"flow",None:"none"},v="notectl-toolbar-btn--overflow-hidden",g="notectl-toolbar-separator--overflow-hidden";class w{toolbar;context;onOverflowChange;onItemActivated;getActiveElement;ariaLabel;popupManager;entries=[];overflowButton=null;overflowDropdown=null;overflowHandle=null;overflowEntries=[];resizeObserver=null;closeHandler=null;closeHandlerTimer=null;closeHandlerAttached=!1;constructor(t){this.toolbar=t.toolbar,this.ariaLabel=t.ariaLabel,this.context=t.context,this.onOverflowChange=t.onOverflowChange,this.onItemActivated=t.onItemActivated,this.getActiveElement=t.getActiveElement,this.popupManager=t.popupManager??null,this.resizeObserver=new ResizeObserver(()=>this.recalculate()),this.resizeObserver.observe(this.toolbar)}update(t){this.entries=t.map(t=>({element:t.element,item:t.item})),this.recalculate()}recalculate(){if(0===this.entries.length)return;this.closeDropdown(),this.resetVisibility(),this.ensureOverflowButton(),this.setOverflowButtonVisible(!1);const t=this.measureAvailableWidth(),e=Array.from(this.toolbar.children),o=this.measureChildWidths(e),n=t-34-2;let r=0,i=!1;const l=[];for(const s of e){if(s===this.overflowButton)continue;if(s.classList.contains("notectl-toolbar-separator")){if(i){s.classList.add(g);continue}const t=(o.get(s)??0)+2;r+t>n?(i=!0,s.classList.add(g)):r+=t;continue}const t=this.entries.find(t=>t.element===s);if(!t)continue;if(i){t.element.classList.add(v),l.push(t);continue}const e=(o.get(s)??0)+2;r+e>n?(i=!0,t.element.classList.add(v),l.push(t)):r+=e}this.overflowEntries=l,this.hideTrailingSeparators(),this.setOverflowButtonVisible(l.length>0),this.notifyChange()}updateItemStates(t){if(!this.overflowDropdown)return;const e=Array.from(this.overflowDropdown.querySelectorAll(".notectl-dropdown__item"));for(const o of e){const e=o.getAttribute("data-toolbar-item"),n=this.overflowEntries.find(t=>t.item.id===e);if(!n)continue;const r=n.item.isActive?.(t)??!1,i=n.item.isEnabled?.(t)??!0;if(o.classList.toggle("notectl-dropdown__item--active",r),o.disabled=!i,"combobox"===n.item.popupType){const e=o.querySelector(".notectl-dropdown__item-label");e&&(e.textContent=n.item.getLabel(t))}if(n.item.getIcon){const e=n.item.getIcon(t),r=o.querySelector(".notectl-dropdown__item-icon");r&&r.innerHTML!==e&&(r.innerHTML=e)}}}destroy(){this.resizeObserver?.disconnect(),this.resizeObserver=null,this.closeDropdown(),this.overflowButton?.remove(),this.overflowButton=null,this.entries=[],this.overflowEntries=[]}measureChildWidths(t){const e=/* @__PURE__ */new Map;for(const o of t)o!==this.overflowButton&&e.set(o,o.offsetWidth);return e}measureAvailableWidth(){const t=getComputedStyle(this.toolbar),e=Number.parseFloat(t.paddingLeft)||0,o=Number.parseFloat(t.paddingRight)||0;return this.toolbar.clientWidth-e-o}resetVisibility(){for(const e of this.entries)e.element.classList.remove(v);const t=Array.from(this.toolbar.querySelectorAll(".notectl-toolbar-separator"));for(const e of t)e.classList.remove(g)}setOverflowButtonVisible(t){this.overflowButton&&(this.overflowButton.classList.toggle("notectl-toolbar-overflow-btn--hidden",!t),t||this.overflowButton.removeAttribute("tabindex"))}ensureOverflowButton(){if(this.overflowButton)return;const t=document.createElement("button");t.type="button",t.className="notectl-toolbar-overflow-btn",t.setAttribute("aria-label",this.ariaLabel),t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded","false"),t.innerHTML='<svg viewBox="0 0 16 16" width="16" height="16"><circle cx="3" cy="8" r="1.5" fill="currentColor"/><circle cx="8" cy="8" r="1.5" fill="currentColor"/><circle cx="13" cy="8" r="1.5" fill="currentColor"/></svg>',t.addEventListener("mousedown",t=>{t.preventDefault(),this.toggleDropdown()}),this.toolbar.appendChild(t),this.overflowButton=t}toggleDropdown(){this.overflowDropdown?this.closeDropdown():this.openDropdown()}openDropdown(){if(!this.overflowButton||0===this.overflowEntries.length)return;const t=document.createElement("div");t.className="notectl-toolbar-popup notectl-dropdown",t.setAttribute("role","menu"),this.renderDropdownItems(t,this.context.getState()),this.popupManager?(this.overflowHandle=this.popupManager.open({anchor:this.overflowButton,className:"notectl-toolbar-popup notectl-dropdown",ariaRole:"menu",position:"below-end",referenceNode:this.overflowButton,restoreFocusTo:this.overflowButton,onClose:()=>{this.overflowHandle=null,this.overflowDropdown=null,this.overflowButton&&this.overflowButton.setAttribute("aria-expanded","false")},content:t=>{this.renderDropdownItems(t,this.context.getState()),this.overflowDropdown=t,t.addEventListener("keydown",t=>this.handleDropdownKeydown(t))}}),this.overflowButton.setAttribute("aria-expanded","true")):(this.positionDropdown(t),d(t,this.overflowButton),this.overflowDropdown=t,this.overflowButton.setAttribute("aria-expanded","true"),requestAnimationFrame(()=>{const e=t.querySelector('[role="menuitem"]');e?.focus()}),t.addEventListener("keydown",t=>this.handleDropdownKeydown(t)),this.registerCloseHandler())}renderDropdownItems(t,e){let o=null;for(const n of this.overflowEntries){if(null!==o&&n.item.group!==o){const e=document.createElement("div");e.className="notectl-dropdown__separator",e.setAttribute("role","separator"),t.appendChild(e)}o=n.item.group;const r=document.createElement("button");r.type="button",r.className="notectl-dropdown__item",r.setAttribute("role","menuitem"),r.setAttribute("tabindex","-1"),r.setAttribute("data-toolbar-item",n.item.id);const i=document.createElement("span");i.className="notectl-dropdown__item-icon","combobox"!==n.item.popupType&&(i.innerHTML=n.item.icon),r.appendChild(i);const l=document.createElement("span");l.className="notectl-dropdown__item-label",l.textContent="combobox"===n.item.popupType?n.item.getLabel(e):n.item.tooltip??n.item.label,r.appendChild(l),r.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation(),this.activateOverflowItem(n)}),t.appendChild(r)}}positionDropdown(e){if(!this.overflowButton)return;const o=this.overflowButton.getBoundingClientRect();if(t(this.toolbar))a(e,{position:"fixed",top:`${o.bottom+2}px`,left:`${o.left}px`,right:"auto",zIndex:"10000"});else{const t=window.innerWidth-o.right;a(e,{position:"fixed",top:`${o.bottom+2}px`,right:`${t}px`,left:"auto",zIndex:"10000"})}}registerCloseHandler(){this.closeHandler=t=>{const e=t.composedPath();this.overflowDropdown&&!e.includes(this.overflowDropdown)&&this.overflowButton&&!e.includes(this.overflowButton)&&this.closeDropdown()},this.closeHandlerTimer=setTimeout(()=>{this.closeHandlerTimer=null,this.closeHandler&&this.overflowDropdown&&(document.addEventListener("mousedown",this.closeHandler),this.closeHandlerAttached=!0)},0)}closeDropdown(){if(this.overflowHandle){const t=this.overflowHandle;return this.overflowHandle=null,this.overflowDropdown=null,t.close(),void(this.overflowButton&&this.overflowButton.setAttribute("aria-expanded","false"))}this.overflowDropdown&&(this.overflowDropdown.remove(),this.overflowDropdown=null),this.overflowButton&&this.overflowButton.setAttribute("aria-expanded","false"),this.closeHandler&&(null!==this.closeHandlerTimer&&(clearTimeout(this.closeHandlerTimer),this.closeHandlerTimer=null),this.closeHandlerAttached&&(document.removeEventListener("mousedown",this.closeHandler),this.closeHandlerAttached=!1),this.closeHandler=null)}activateOverflowItem(t){this.closeDropdown(),t.item.popupType&&this.overflowButton?this.onItemActivated(this.overflowButton,t.item):this.context.executeCommand(t.item.command)}handleDropdownKeydown(t){if(!this.overflowDropdown)return;if("Escape"===t.key||"Tab"===t.key)return t.preventDefault(),t.stopPropagation(),this.closeDropdown(),void this.overflowButton?.focus();const e=Array.from(this.overflowDropdown.querySelectorAll('[role="menuitem"]')),o=e.indexOf(this.getActiveElement());switch(t.key){case"ArrowDown":{t.preventDefault();const r=n(e,o,1);e[r]?.focus();break}case"ArrowUp":{t.preventDefault();const r=n(e,o,-1);e[r]?.focus();break}case"Enter":case" ":{t.preventDefault();const n=e[o];if(!n)break;const r=n.getAttribute("data-toolbar-item"),i=this.overflowEntries.find(t=>t.item.id===r);i&&this.activateOverflowItem(i);break}}}hideTrailingSeparators(){const t=Array.from(this.toolbar.children);for(let e=t.length-1;e>=0;e--){const o=t[e];if(o&&o!==this.overflowButton)if(o.classList.contains("notectl-toolbar-separator"))o.classList.contains(g)||o.classList.add(g);else if(!o.classList.contains(v))break}}notifyChange(){const t=this.entries.filter(t=>!t.element.classList.contains(v)).map(t=>t.element);this.onOverflowChange(t,this.overflowEntries.length>0?this.overflowButton:null)}}function x(t,e,o){const n=t.querySelectorAll(".notectl-grid-picker__cell");for(const r of n){const t=Number(r.getAttribute("data-row")),n=Number(r.getAttribute("data-col"));r.classList.toggle("notectl-grid-picker__cell--highlighted",t<=e&&n<=o)}}function y(){const t=document.createElement("span");return t.className="notectl-toolbar-separator",t.setAttribute("role","separator"),t}class E{activePopup=null;activePopupButton=null;activeHandle=null;getActiveElement;locale;popupManager=null;constructor(t,e=h){this.getActiveElement=t,this.locale=e}setPopupManager(t){this.popupManager=t}isOpen(){return null!==this.activePopup}toggle(t,e,o){this.activePopup?this.close():this.openViaManager(t,e,o)}close(){if(this.activeHandle){const t=this.activeHandle;return this.activeHandle=null,this.clearButtonState(),void t.close()}this.clearButtonState(),this.activePopup&&(this.activePopup.remove(),this.activePopup=null)}closeAndRestoreFocus(){const t=this.activePopupButton;this.close(),t?.focus()}destroy(){this.close()}openViaManager(t,e,o){this.popupManager&&(this.activePopupButton=t,t.classList.add("notectl-toolbar-btn--popup-open"),t.setAttribute("aria-expanded","true"),this.activeHandle=this.popupManager.open({anchor:t,className:"notectl-toolbar-popup",referenceNode:t,restoreFocusTo:t,position:"below-start",onClose:()=>{this.activeHandle=null,this.clearButtonState(),this.activePopup=null},content:(t,n)=>{this.activePopup=t,this.renderPopupContent(t,e,o,n),t.addEventListener("keydown",t=>this.handlePopupKeydown(t))}}))}renderPopupContent(t,e,o,n){const r=()=>{n({restoreFocusTo:null}),o.getContainer().focus()};switch(e.popupType){case"gridPicker":!function(t,e,o,n=h){t.className+=" notectl-grid-picker";const r=document.createElement("div");r.className="notectl-grid-picker__grid",r.setAttribute("role","grid"),a(r,{display:"grid",gridTemplateColumns:`repeat(${e.maxCols}, 1fr)`,gap:"2px",padding:"8px"});const i=document.createElement("div");i.className="notectl-grid-picker__label",i.textContent=n.gridPickerLabel(1,1),a(i,{textAlign:"center",padding:"4px",fontSize:"12px"}),i.setAttribute("aria-live","polite");for(let l=1;l<=e.maxRows;l++)for(let t=1;t<=e.maxCols;t++){const s=document.createElement("div");s.className="notectl-grid-picker__cell",s.setAttribute("role","gridcell"),s.setAttribute("tabindex","-1"),s.setAttribute("aria-label",n.gridPickerLabel(l,t)),a(s,{width:"20px",height:"20px",border:"1px solid #ccc",cursor:"pointer"}),s.setAttribute("data-row",String(l)),s.setAttribute("data-col",String(t)),s.addEventListener("mouseenter",()=>{x(r,l,t),i.textContent=n.gridPickerLabel(l,t)}),s.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation()}),s.addEventListener("click",()=>{e.onSelect(l,t),o()}),r.appendChild(s)}t.appendChild(r),t.appendChild(i)}(t,e.popupConfig,r,this.locale);break;case"dropdown":!function(t,e,n,r){t.classList.add("notectl-dropdown"),t.setAttribute("role","menu");for(const i of e.items){const e=document.createElement("button");if(e.type="button",e.className="notectl-dropdown__item",e.setAttribute("role","menuitem"),e.setAttribute("tabindex","-1"),i.icon){const t=document.createElement("span");t.className="notectl-dropdown__item-icon",t.innerHTML=i.icon,e.appendChild(t)}const n=document.createElement("span");n.className="notectl-dropdown__item-label",n.textContent=i.label,e.appendChild(n),e.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation()}),e.addEventListener("click",()=>{var t;t=i.command,o.executeCommand(t),r()}),t.appendChild(e)}}(t,e.popupConfig,0,r);break;case"custom":case"combobox":e.renderPopup(t,o,n)}}clearButtonState(){this.activePopupButton&&(this.activePopupButton.classList.remove("notectl-toolbar-btn--popup-open"),this.activePopupButton.setAttribute("aria-expanded","false"),this.activePopupButton=null)}handlePopupKeydown(t){if(!this.activePopup)return;if("Escape"===t.key)return t.preventDefault(),t.stopPropagation(),void this.closeAndRestoreFocus();if("Tab"===t.key)return t.preventDefault(),void this.closeAndRestoreFocus();const e=this.activePopup.querySelectorAll('[role="menuitem"]');e.length>0?this.handleDropdownKeydown(t,e):null!==this.activePopup.querySelector(".notectl-grid-picker__cell")?this.handleGridKeydown(t):this.handleCustomPopupKeydown(t)}handleDropdownKeydown(t,e){const o=Array.from(e),r=o.indexOf(this.getActiveElement());switch(t.key){case"ArrowDown":{t.preventDefault();const e=n(o,r,1);o[e]?.focus();break}case"ArrowUp":{t.preventDefault();const e=n(o,r,-1);o[e]?.focus();break}case"Enter":case" ":{t.preventDefault();const e=o[r];e&&e.click();break}}}handleGridKeydown(e){const o=this.getActiveElement(),n=Number(o?.getAttribute("data-row")??1),i=Number(o?.getAttribute("data-col")??1),l=this.activePopup?.querySelector(".notectl-grid-picker__grid")??null;if(!l)return;const s=l.querySelector(".notectl-grid-picker__cell:last-child"),a=Number(s?.getAttribute("data-col")??1),c=Number(s?.getAttribute("data-row")??1);if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(e.key)){e.preventDefault();const[o,s]=r(n,i,c,a,e.key,!!this.activePopup&&t(this.activePopup)),d=l.querySelector(`.notectl-grid-picker__cell[data-row="${o}"][data-col="${s}"]`);d?.focus(),x(l,o,s);const p=this.activePopup?.querySelector(".notectl-grid-picker__label")??null;p&&(p.textContent=this.locale.gridPickerLabel(o,s))}"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),o?.click())}handleCustomPopupKeydown(t){if(!this.activePopup)return;const e=Array.from(this.activePopup.querySelectorAll("button"));if(0===e.length)return;const o=this.getActiveElement(),r=e.indexOf(o);switch(t.key){case"ArrowDown":{t.preventDefault();const o=n(e,r,1);e[o]?.focus();break}case"ArrowUp":{t.preventDefault();const o=n(e,r,-1);e[o]?.focus();break}case"Enter":case" ":t.preventDefault(),o&&o.dispatchEvent(new MouseEvent("mousedown",{bubbles:!0,cancelable:!0}))}}}class A{element;timer=null;target=null;isPopupActive;static TOOLTIP_ID="notectl-toolbar-tooltip";constructor(t){this.isPopupActive=t,this.element=document.createElement("div"),this.element.className="notectl-toolbar-tooltip",this.element.id=A.TOOLTIP_ID,this.element.setAttribute("role","tooltip"),c(this.element,"display","none")}show(t){if(this.hide(),this.isPopupActive()||t.disabled)return;const e=t.getAttribute("data-tooltip");e&&(this.target=t,this.timer=setTimeout(()=>{if(this.isPopupActive())return;this.element.textContent=e,c(this.element,"display","");const o=t.getRootNode();o instanceof ShadowRoot&&!this.element.parentNode?o.appendChild(this.element):o instanceof ShadowRoot||this.element.parentNode||document.body.appendChild(this.element),t.setAttribute("aria-describedby",A.TOOLTIP_ID);const n=t.getBoundingClientRect();a(this.element,{position:"fixed",top:`${n.bottom+6}px`,left:`${n.left+n.width/2}px`,transform:"translateX(-50%)"})},500))}hide(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.target&&(this.target.removeAttribute("aria-describedby"),this.target=null),c(this.element,"display","none")}destroy(){this.hide(),this.element.remove()}}const k=new e("toolbar");class _{id="toolbar";name="Toolbar";priority=10;context=null;toolbarElement=null;buttons=[];hiddenItems=/* @__PURE__ */new Set;layoutConfig;overflowBehavior;focusedIndex=0;tooltip=null;popupController=null;popupManager=null;overflowController=null;visibleElements=[];locale;constructor(t){this.layoutConfig=t??null,this.overflowBehavior=t?.overflow??f.BurgerMenu}async init(t){this.locale=await o(t,void 0,h,m),t.registerStyleSheet('\n/* Toolbar */\n.notectl-plugin-container--top {\n\tdisplay: flex;\n\talign-items: center;\n\tflex-wrap: nowrap;\n\tborder-bottom: 1px solid var(--notectl-border);\n\tbackground: var(--notectl-toolbar-bg, var(--notectl-surface-raised));\n\tmin-height: 40px;\n}\n\n.notectl-toolbar {\n\tdisplay: flex;\n\talign-items: center;\n\tflex-wrap: nowrap;\n\toverflow: hidden;\n\tflex: 1;\n\tmin-width: 0;\n\tgap: 2px;\n\tpadding: 4px 8px;\n}\n\n.notectl-toolbar[hidden] {\n\tdisplay: none;\n}\n\n.notectl-toolbar-btn {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 32px;\n\theight: 32px;\n\tborder: 1px solid transparent;\n\tborder-radius: 4px;\n\tbackground: transparent;\n\tcursor: pointer;\n\tcolor: var(--notectl-fg);\n\tfont-size: 14px;\n\tline-height: 1;\n\tpadding: 0;\n\tflex-shrink: 0;\n\ttransition: background 0.1s, border-color 0.1s;\n}\n\n@media (hover: hover) {\n\t.notectl-toolbar-btn:hover {\n\t\tbackground: var(--notectl-hover-bg);\n\t\tborder-color: var(--notectl-border);\n\t}\n}\n\n.notectl-toolbar-btn--active {\n\tbackground: var(--notectl-active-bg);\n\tborder-color: var(--notectl-primary-muted);\n\tcolor: var(--notectl-primary-fg);\n}\n\n.notectl-toolbar-btn:focus-visible {\n\tbox-shadow: 0 0 0 2px var(--notectl-focus-ring);\n\toutline: none;\n}\n\n.notectl-toolbar-btn:disabled {\n\topacity: 0.4;\n\tcursor: not-allowed;\n}\n\n@media (hover: hover) {\n\t.notectl-toolbar-btn:disabled:hover {\n\t\tbackground: transparent;\n\t\tborder-color: transparent;\n\t}\n}\n\n.notectl-toolbar-btn__icon {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\tpointer-events: none;\n}\n\n.notectl-toolbar-btn__icon svg {\n\tdisplay: block;\n\twidth: 18px;\n\theight: 18px;\n\tfill: currentColor;\n}\n\n/* Tooltip (rendered as fixed-position element in shadow root) */\n.notectl-toolbar-tooltip {\n\tposition: fixed;\n\tpadding: 4px 8px;\n\tborder-radius: 4px;\n\tbackground: var(--notectl-tooltip-bg);\n\tcolor: var(--notectl-tooltip-fg);\n\tfont-size: 11px;\n\tfont-weight: 500;\n\twhite-space: nowrap;\n\tpointer-events: none;\n\tz-index: 10001;\n\tline-height: 1.4;\n\tletter-spacing: 0.01em;\n\tfont-family: -apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, sans-serif;\n}\n\n.notectl-toolbar-separator {\n\tdisplay: inline-block;\n\twidth: 1px;\n\theight: 20px;\n\tbackground: var(--notectl-border);\n\tmargin: 0 4px;\n\tvertical-align: middle;\n}\n\n/* Toolbar Popups */\n.notectl-toolbar-popup {\n\tbackground: var(--notectl-surface-overlay);\n\tborder: 1px solid var(--notectl-border);\n\tborder-radius: 6px;\n\tbox-shadow: 0 4px 12px var(--notectl-shadow);\n\toverflow: hidden;\n}\n\n/* Grid Picker */\n.notectl-grid-picker__cell:focus-visible {\n\toutline: 2px solid var(--notectl-focus-ring);\n\toutline-offset: -1px;\n}\n\n.notectl-grid-picker__cell--highlighted {\n\tbackground: var(--notectl-primary-muted);\n\tborder-color: var(--notectl-primary);\n}\n\n/* Dropdown */\n.notectl-dropdown {\n\tmin-width: 160px;\n\tpadding: 4px 0;\n}\n\n.notectl-dropdown__item {\n\tdisplay: flex;\n\talign-items: center;\n\twidth: 100%;\n\tpadding: 8px 12px;\n\ttext-align: start;\n\tborder: none;\n\tbackground: none;\n\tcursor: pointer;\n\tfont-size: 14px;\n\tcolor: var(--notectl-fg);\n\tline-height: 1.4;\n\tfont-family: inherit;\n\twhite-space: nowrap;\n}\n\n@media (hover: hover) {\n\t.notectl-dropdown__item:hover {\n\t\tbackground: var(--notectl-hover-bg);\n\t}\n}\n\n.notectl-dropdown__item:focus-visible {\n\tbackground: var(--notectl-hover-bg);\n\toutline: none;\n}\n\n.notectl-dropdown__item-icon {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 28px;\n\tfont-weight: 600;\n\tcolor: var(--notectl-fg-muted);\n\tflex-shrink: 0;\n}\n\n.notectl-dropdown__item-label {\n\tflex: 1;\n}\n\n/* Overflow behavior: flow mode — toolbar wraps to additional rows */\n.notectl-toolbar[data-overflow="flow"] {\n\tflex-wrap: wrap;\n\toverflow: visible;\n}\n\n/* Overflow behavior: none — toolbar clips without any responsive behavior */\n.notectl-toolbar[data-overflow="none"] {\n\tflex-wrap: nowrap;\n\toverflow: hidden;\n}\n\n/* Overflow: hidden items (burger-menu mode) */\n.notectl-toolbar-btn--overflow-hidden,\n.notectl-toolbar-separator--overflow-hidden {\n\tdisplay: none;\n}\n\n/* Overflow "more" button */\n.notectl-toolbar-overflow-btn {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 32px;\n\theight: 32px;\n\tborder: 1px solid transparent;\n\tborder-radius: 4px;\n\tbackground: transparent;\n\tcursor: pointer;\n\tcolor: var(--notectl-fg);\n\tfont-size: 16px;\n\tline-height: 1;\n\tpadding: 0;\n\tflex-shrink: 0;\n\tmargin-inline-start: auto;\n\ttransition: background 0.1s, border-color 0.1s;\n}\n\n@media (hover: hover) {\n\t.notectl-toolbar-overflow-btn:hover {\n\t\tbackground: var(--notectl-hover-bg);\n\t\tborder-color: var(--notectl-border);\n\t}\n}\n\n.notectl-toolbar-overflow-btn--hidden {\n\tdisplay: none;\n}\n\n.notectl-toolbar-overflow-btn:focus-visible {\n\tbox-shadow: 0 0 0 2px var(--notectl-focus-ring);\n\toutline: none;\n}\n\n/* Dropdown item states shared by all dropdown menus (including overflow) */\n.notectl-dropdown__item:disabled {\n\topacity: 0.4;\n\tcursor: not-allowed;\n}\n\n@media (hover: hover) {\n\t.notectl-dropdown__item:disabled:hover {\n\t\tbackground: none;\n\t}\n}\n\n.notectl-dropdown__item--active {\n\tcolor: var(--notectl-primary-fg);\n}\n\n.notectl-dropdown__item-icon svg {\n\tdisplay: block;\n\twidth: 16px;\n\theight: 16px;\n\tfill: currentColor;\n}\n\n.notectl-dropdown__separator {\n\theight: 1px;\n\tbackground: var(--notectl-border);\n\tmargin: 4px 0;\n}\n\n/* Combobox-style toolbar buttons (shared base for font, fontSize, heading, etc.) */\n.notectl-toolbar-btn[role="combobox"] {\n\twidth: auto;\n\tpadding: 0 8px;\n\tgap: 4px;\n\tborder: 1px solid var(--notectl-border);\n\tborder-radius: 4px;\n\tbackground: var(--notectl-bg);\n}\n\n@media (hover: hover) {\n\t.notectl-toolbar-btn[role="combobox"]:hover {\n\t\tbackground: var(--notectl-hover-bg);\n\t\tborder-color: var(--notectl-fg-muted);\n\t}\n}\n\n.notectl-toolbar-btn[role="combobox"].notectl-toolbar-btn--active {\n\tbackground: var(--notectl-bg);\n\tborder-color: var(--notectl-primary-muted);\n}\n\n.notectl-toolbar-combobox__label {\n\tflex: 1;\n\tfont-size: 13px;\n\tfont-weight: 500;\n\tcolor: var(--notectl-fg);\n\twhite-space: nowrap;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\ttext-align: start;\n\tline-height: 30px;\n}\n\n.notectl-toolbar-combobox__arrow {\n\tflex-shrink: 0;\n\tfont-size: 11px;\n\tcolor: var(--notectl-fg-muted);\n\tline-height: 30px;\n}\n\n/* Link Popup */\n.notectl-link-popup {\n\tpadding: 8px;\n\tmin-width: 200px;\n}\n\n.notectl-link-popup__input {\n\twidth: 100%;\n\tpadding: 4px;\n\tbox-sizing: border-box;\n\tborder: 1px solid var(--notectl-border);\n\tborder-radius: 4px;\n\tfont-size: 13px;\n\tcolor: var(--notectl-fg);\n\tbackground: var(--notectl-bg);\n}\n\n.notectl-link-popup__input:focus-visible {\n\toutline: 2px solid var(--notectl-focus-ring);\n\toutline-offset: -1px;\n}\n\n.notectl-link-popup__button {\n\twidth: 100%;\n\tpadding: 6px 12px;\n\tcursor: pointer;\n\tborder: 1px solid var(--notectl-border);\n\tborder-radius: 4px;\n\tbackground: var(--notectl-bg);\n\tcolor: var(--notectl-fg);\n\tfont-size: 13px;\n}\n\n.notectl-link-popup__button--apply {\n\tmargin-top: 4px;\n}\n\n@media (hover: hover) {\n\t.notectl-link-popup__button:hover {\n\t\tbackground: var(--notectl-hover-bg);\n\t}\n}\n\n.notectl-link-popup__button:focus-visible {\n\toutline: 2px solid var(--notectl-focus-ring);\n\toutline-offset: -1px;\n}\n'),this.context=t,this.popupManager=new l(t.getContainer()),t.registerService(s,this.popupManager),this.popupController=new E(()=>this.getActiveElement(),this.locale),this.popupController.setPopupManager(this.popupManager),this.tooltip=new A(()=>this.popupController?.isOpen()??!1),t.registerService(k,{refresh:()=>this.updateButtonStates(t.getState()),closePopup:()=>this.popupController?.close()}),this.createToolbarElement()}getOverflowBehavior(){return this.overflowBehavior}setOverflowBehavior(t){t!==this.overflowBehavior&&(this.overflowBehavior=t,this.applyOverflowBehavior(),this.renderItems())}onReady(){this.renderItems()}destroy(){this.overflowController?.destroy(),this.overflowController=null,this.popupController?.destroy(),this.popupController=null,this.popupManager?.destroy(),this.popupManager=null,this.tooltip?.destroy(),this.tooltip=null,this.toolbarElement&&(this.toolbarElement.remove(),this.toolbarElement=null),this.buttons=[],this.visibleElements=[],this.context=null}onStateChange(t,e,o){this.updateButtonStates(e)}onReadOnlyChange(t){this.toolbarElement&&(this.toolbarElement.hidden=t)}onConfigure(t){for(const[e,o]of Object.entries(t))!1===o?this.hiddenItems.add(e):this.hiddenItems.delete(e);this.renderItems()}createToolbarElement(){if(!this.context)return;this.toolbarElement&&this.toolbarElement.remove(),this.buttons=[];const t=this.context.getPluginContainer("top");this.toolbarElement=document.createElement("div"),this.toolbarElement.setAttribute("role","toolbar"),this.toolbarElement.setAttribute("aria-label",this.locale.formattingOptionsAria),this.toolbarElement.setAttribute("data-notectl-no-print",""),this.toolbarElement.className="notectl-toolbar",this.toolbarElement.addEventListener("keydown",t=>this.handleToolbarKeydown(t)),this.applyOverflowBehavior(),t.appendChild(this.toolbarElement)}applyOverflowBehavior(){this.toolbarElement&&this.context&&(this.overflowController?.destroy(),this.overflowController=null,this.toolbarElement.setAttribute("data-overflow",this.overflowBehavior),this.overflowBehavior===f.BurgerMenu?this.overflowController=new w({toolbar:this.toolbarElement,ariaLabel:this.locale.moreToolsAria,context:this.context,popupManager:this.popupManager??void 0,onOverflowChange:(t,e)=>{this.visibleElements=e?[...t,e]:[...t],this.initRovingTabindex()},onItemActivated:(t,e)=>{this.activateButton(t,e)},getActiveElement:()=>this.getActiveElement()}):this.visibleElements=[])}renderItems(){if(this.context&&this.toolbarElement){for(const t of this.buttons)t.element.remove();this.buttons=[];for(const t of this.toolbarElement.querySelectorAll(".notectl-toolbar-separator"))t.remove();this.layoutConfig?this.renderItemsByLayout():this.renderItemsByGroup(),this.buttons.length>0&&!this.toolbarElement.parentElement&&this.context.getPluginContainer("top").appendChild(this.toolbarElement),this.overflowController?.update(this.buttons),this.initRovingTabindex(),this.updateButtonStates(this.context.getState())}}getTabElements(){return this.visibleElements.length>0?this.visibleElements:this.buttons.map(t=>t.element)}initRovingTabindex(){const t=this.getTabElements(),e=u(t);this.focusedIndex=e>=0?e:0,i(t,this.focusedIndex)}setRovingFocus(t){const e=this.getTabElements();t<0||t>=e.length||(this.focusedIndex=t,i(e,t),e[t]?.focus())}getActiveElement(){const t=this.toolbarElement?.getRootNode();return t instanceof ShadowRoot?t.activeElement:document.activeElement}syncFocusedIndex(){const t=this.getActiveElement(),e=this.getTabElements().findIndex(e=>e===t);e>=0&&(this.focusedIndex=e)}handleToolbarKeydown(e){const o=this.getTabElements();var n;if(0!==o.length)switch(this.syncFocusedIndex(),e.key){case"ArrowRight":case"ArrowLeft":{e.preventDefault();const r=(n=!!this.toolbarElement&&t(this.toolbarElement),"ArrowRight"===e.key?n?-1:1:n?1:-1),i=function(t,e,o){const n=t.length;if(0===n)return-1;let r=e;for(let i=0;i<n;i++)if(r=(r+o+n)%n,!t[r]?.disabled)return r;return e}(o,this.focusedIndex,r);this.setRovingFocus(i);break}case"Home":{e.preventDefault();const t=u(o);t>=0&&this.setRovingFocus(t);break}case"End":{e.preventDefault();const t=function(t){for(let e=t.length-1;e>=0;e--)if(!t[e]?.disabled)return e;return-1}(o);t>=0&&this.setRovingFocus(t);break}case"Enter":case" ":{e.preventDefault();const t=o[this.focusedIndex],n=this.buttons.find(e=>e.element===t);n&&this.activateButton(n.element,n.item);break}}}activateButton(t,e){this.tooltip?.hide(),e.popupType&&this.context?this.popupController?.toggle(t,e,this.context):this.context?.executeCommand(e.command)}renderItemsByLayout(){if(!this.context||!this.toolbarElement||!this.layoutConfig)return;const t=this.context.getToolbarRegistry();let e=!0;for(const o of this.layoutConfig.groups){const n=[];for(const e of o){const o=t.getToolbarItemsByPlugin(e).filter(t=>!this.hiddenItems.has(t.id));n.push(...o)}if(0!==n.length){e||this.toolbarElement.appendChild(y()),e=!1;for(const t of n){const e=this.createButton(t);this.toolbarElement.appendChild(e.element),this.buttons.push(e)}}}0===this.buttons.length&&this.toolbarElement.remove()}renderItemsByGroup(){if(!this.context||!this.toolbarElement)return;const t=this.context.getToolbarRegistry().getToolbarItems().filter(t=>!this.hiddenItems.has(t.id));if(0===t.length)return void this.toolbarElement.remove();const e=/* @__PURE__ */new Map;for(const n of t){const t=e.get(n.group)??[];t.push(n),e.set(n.group,t)}let o=!0;for(const[,n]of e){o||this.toolbarElement.appendChild(y()),o=!1;for(const t of n){const e=this.createButton(t);this.toolbarElement.appendChild(e.element),this.buttons.push(e)}}}createButton(t){const e=document.createElement("button");e.type="button",e.className=`notectl-toolbar-btn notectl-toolbar-btn--${t.id}`,e.setAttribute("aria-pressed","false"),e.setAttribute("aria-label",t.label),e.setAttribute("data-toolbar-item",t.id),e.setAttribute("data-tooltip",t.tooltip??t.label);let o=null;if("combobox"===t.popupType){e.setAttribute("role","combobox"),e.setAttribute("aria-haspopup","listbox"),e.setAttribute("aria-expanded","false");const n=document.createElement("span");n.className="notectl-toolbar-combobox__label";const r=this.context?.getState();r&&(n.textContent=t.getLabel(r)),e.appendChild(n),o=n;const i=document.createElement("span");i.className="notectl-toolbar-combobox__arrow",i.setAttribute("aria-hidden","true"),i.textContent="▾",e.appendChild(i)}else{t.popupType&&(e.setAttribute("aria-haspopup","true"),e.setAttribute("aria-expanded","false"));const o=document.createElement("span");o.className="notectl-toolbar-btn__icon",o.innerHTML=t.icon,e.appendChild(o)}return e.addEventListener("mousedown",o=>{o.preventDefault(),this.activateButton(e,t)}),e.addEventListener("mouseenter",()=>this.tooltip?.show(e)),e.addEventListener("mouseleave",()=>this.tooltip?.hide()),e.addEventListener("focus",()=>this.tooltip?.show(e)),e.addEventListener("blur",()=>this.tooltip?.hide()),{element:e,item:t,comboLabelEl:o}}updateButtonStates(t){for(const e of this.buttons){const o=e.item.isActive?.(t)??!1,n=e.item.isEnabled?.(t)??!0;if(e.element.setAttribute("aria-pressed",String(o)),e.element.classList.toggle("notectl-toolbar-btn--active",o),e.element.disabled=!n,n?e.element.removeAttribute("aria-disabled"):e.element.setAttribute("aria-disabled","true"),e.comboLabelEl&&"combobox"===e.item.popupType&&(e.comboLabelEl.textContent=e.item.getLabel(t)),e.item.getIcon){const o=e.item.getIcon(t),n=e.element.querySelector(".notectl-toolbar-btn__icon");n&&n.innerHTML!==o&&(n.innerHTML=o)}}this.overflowController?.updateItemStates(t)}}export{h as TOOLBAR_LOCALE_EN,f as ToolbarOverflowBehavior,_ as ToolbarPlugin,p as ToolbarRegistry,k as ToolbarServiceKey,m as loadToolbarLocale};
2
- //# sourceMappingURL=toolbar.mjs.map
1
+ import{a,i as s,n as o,o as r,r as i,t as m}from"../chunks/ToolbarPlugin-CWDkWXE8.mjs";export{s as TOOLBAR_LOCALE_EN,i as ToolbarOverflowBehavior,m as ToolbarPlugin,r as ToolbarRegistry,o as ToolbarServiceKey,a as loadToolbarLocale};
@@ -1,2 +1 @@
1
- import{AlignmentPlugin as i}from"../plugins/alignment.mjs";import{BlockquotePlugin as o}from"../plugins/blockquote.mjs";import{CodeBlockPlugin as t}from"../plugins/code-block.mjs";import{FontSizePlugin as m}from"../plugins/font-size.mjs";import{FontPlugin as n}from"../plugins/font.mjs";import{HardBreakPlugin as r}from"../plugins/hard-break.mjs";import{a as s}from"../chunks/HeadingPlugin-BmkeUXj8.mjs";import{HighlightPlugin as e}from"../plugins/highlight.mjs";import{HorizontalRulePlugin as p}from"../plugins/horizontal-rule.mjs";import{ImagePlugin as l}from"../plugins/image.mjs";import{LinkPlugin as g}from"../plugins/link.mjs";import{ListPlugin as u}from"../plugins/list.mjs";import{PrintPlugin as f}from"../plugins/print.mjs";import{SmartPastePlugin as a}from"../plugins/smart-paste.mjs";import{StrikethroughPlugin as j}from"../plugins/strikethrough.mjs";import{SuperSubPlugin as w}from"../plugins/super-sub.mjs";import{TablePlugin as h}from"../plugins/table.mjs";import{TextColorPlugin as c}from"../plugins/text-color.mjs";import{TextDirectionPlugin as k}from"../plugins/text-direction.mjs";import{TextFormattingPlugin as b}from"../plugins/text-formatting.mjs";function x(x){return{toolbar:[[new n({fonts:[],...x?.font}),new m(x?.fontSize)],[new b(x?.textFormatting),new j(x?.strikethrough),new w(x?.superSub)],[new c(x?.textColor),new e(x?.highlight)],[new s(x?.heading),new o(x?.blockquote),new t(x?.codeBlock)],[new i(x?.alignment),new k(x?.textDirection)],[new u(x?.list)],[new g(x?.link),new h(x?.table),new p(x?.horizontalRule),new l(x?.image)],[new f(x?.print)]],plugins:[new r,new a(x?.smartPaste)]}}export{x as createFullPreset};
2
- //# sourceMappingURL=full.mjs.map
1
+ import{t as m}from"../chunks/full-B-bw4M7L.mjs";export{m as createFullPreset};
@@ -1,2 +1 @@
1
- import{FontPlugin as n}from"../plugins/font.mjs";function o(o){return{toolbar:[[new n({fonts:[],...o?.font})]],plugins:[]}}export{o as createMinimalPreset};
2
- //# sourceMappingURL=minimal.mjs.map
1
+ import{t as m}from"../chunks/minimal-CMt909kl.mjs";export{m as createMinimalPreset};
package/dist/presets.mjs CHANGED
@@ -1,2 +1 @@
1
- import{createMinimalPreset as m}from"./presets/minimal.mjs";import{createFullPreset as r}from"./presets/full.mjs";export{r as createFullPreset,m as createMinimalPreset};
2
- //# sourceMappingURL=presets.mjs.map
1
+ import{t as m}from"./chunks/minimal-CMt909kl.mjs";import{t as s}from"./chunks/full-B-bw4M7L.mjs";export{s as createFullPreset,m as createMinimalPreset};
@@ -36,6 +36,13 @@ export declare function navigateVerticalWithGoalColumn(container: HTMLElement, s
36
36
  * the direction is vertical).
37
37
  */
38
38
  export declare function skipInlineNode(state: EditorState, direction: CaretDirection): Transaction | null;
39
- /** Returns the bounding rect of the current caret position, or null. */
40
- export declare function getCaretRectFromSelection(domSel: globalThis.Selection): DOMRect | null;
39
+ /**
40
+ * Returns the bounding rect of the current caret position, or null.
41
+ *
42
+ * Tries the standard `getRangeAt(0)` path first. When `container` is
43
+ * provided and the standard path yields no useful rect (height = 0),
44
+ * falls back to `readDOMSelectionEndpoints()` to handle Shadow DOM cases
45
+ * where `getRangeAt(0)` returns cross-boundary results (e.g. `<li>` elements).
46
+ */
47
+ export declare function getCaretRectFromSelection(domSel: globalThis.Selection, container?: HTMLElement): DOMRect | null;
41
48
  //# sourceMappingURL=CaretNavigation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CaretNavigation.d.ts","sourceRoot":"","sources":["../../src/view/CaretNavigation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAG3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAG3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAWjE,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,MAAM,CAAC;AAQ9D;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC7B,SAAS,EAAE,WAAW,EACtB,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,cAAc,EACzB,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,GACxB,OAAO,CAiCT;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CACnC,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,cAAc,GACvB,WAAW,GAAG,IAAI,CAcpB;AAED;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAC7C,SAAS,EAAE,WAAW,EACtB,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,IAAI,GAAG,MAAM,EACxB,UAAU,EAAE,MAAM,GAAG,IAAI,GACvB,WAAW,GAAG,IAAI,CAoBpB;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,cAAc,GAAG,WAAW,GAAG,IAAI,CAgBhG;AAyBD,wEAAwE;AACxE,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,UAAU,CAAC,SAAS,GAAG,OAAO,GAAG,IAAI,CAMtF"}
1
+ {"version":3,"file":"CaretNavigation.d.ts","sourceRoot":"","sources":["../../src/view/CaretNavigation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAG3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAG3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAWjE,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,MAAM,CAAC;AAQ9D;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC7B,SAAS,EAAE,WAAW,EACtB,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,cAAc,EACzB,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,GACxB,OAAO,CAiCT;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CACnC,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,cAAc,GACvB,WAAW,GAAG,IAAI,CAcpB;AAED;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAC7C,SAAS,EAAE,WAAW,EACtB,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,IAAI,GAAG,MAAM,EACxB,UAAU,EAAE,MAAM,GAAG,IAAI,GACvB,WAAW,GAAG,IAAI,CA8BpB;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,cAAc,GAAG,WAAW,GAAG,IAAI,CAgBhG;AAyBD;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACxC,MAAM,EAAE,UAAU,CAAC,SAAS,EAC5B,SAAS,CAAC,EAAE,WAAW,GACrB,OAAO,GAAG,IAAI,CA6BhB"}
@@ -12,9 +12,8 @@ export interface DomPoint {
12
12
  /**
13
13
  * Resolves a DOM position from screen coordinates using the best available API.
14
14
  *
15
- * Tries `caretPositionFromPoint` first (standard), then `caretRangeFromPoint`
16
- * (WebKit fallback), and finally tries the ownerDocument when the root is
17
- * a ShadowRoot and the first two returned nothing.
15
+ * Tries the given root first, then falls back to the ownerDocument when the
16
+ * root is a ShadowRoot and the first attempt returned nothing.
18
17
  */
19
18
  export declare function domPositionFromPoint(root: Document | ShadowRoot, x: number, y: number, ownerDoc?: Document): DomPoint | null;
20
19
  //# sourceMappingURL=DomPointUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DomPointUtils.d.ts","sourceRoot":"","sources":["../../src/view/DomPointUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,kEAAkE;AAClE,MAAM,WAAW,QAAQ;IACxB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CACnC,IAAI,EAAE,QAAQ,GAAG,UAAU,EAC3B,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,QAAQ,CAAC,EAAE,QAAQ,GACjB,QAAQ,GAAG,IAAI,CAmCjB"}
1
+ {"version":3,"file":"DomPointUtils.d.ts","sourceRoot":"","sources":["../../src/view/DomPointUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,kEAAkE;AAClE,MAAM,WAAW,QAAQ;IACxB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACxB;AAwBD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CACnC,IAAI,EAAE,QAAQ,GAAG,UAAU,EAC3B,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,QAAQ,CAAC,EAAE,QAAQ,GACjB,QAAQ,GAAG,IAAI,CAKjB"}
@@ -1 +1 @@
1
- {"version":3,"file":"EditorViewEvents.d.ts","sourceRoot":"","sources":["../../src/view/EditorViewEvents.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAErE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAW3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAKxD,MAAM,WAAW,oBAAoB;IACpC,QAAQ,CAAC,cAAc,EAAE,WAAW,CAAC;IACrC,QAAQ,CAAC,QAAQ,EAAE,MAAM,WAAW,CAAC;IACrC,QAAQ,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE,WAAW,KAAK,IAAI,CAAC;IAC7C,QAAQ,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,EAAE,EAAE,WAAW,KAAK,IAAI,CAAC;IACvE,QAAQ,CAAC,UAAU,EAAE,MAAM,OAAO,CAAC;IACnC,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC5C,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IACtC,QAAQ,CAAC,UAAU,EAAE,MAAM,OAAO,CAAC;IACnC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IACnD,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;CAClC;AAED,qBAAa,gBAAgB;IAC5B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAuB;IAC5C,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAa;IACnD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA0B;IAC1D,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAyB;IACxD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAyB;IACpD,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAa;IACpD,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAa;IAClD,OAAO,CAAC,yBAAyB,CAAS;IAC1C,OAAO,CAAC,qBAAqB,CAAS;gBAE1B,IAAI,EAAE,oBAAoB;IAyBtC,iDAAiD;IACjD,oBAAoB,IAAI,IAAI;IAiC5B,mCAAmC;IACnC,OAAO,IAAI,IAAI;IAUf,0DAA0D;IAC1D,OAAO,CAAC,iBAAiB;IAczB,mDAAmD;IACnD,OAAO,CAAC,WAAW;IAmDnB;;;OAGG;IACH,OAAO,CAAC,uBAAuB;IAwC/B,0DAA0D;IAC1D,OAAO,CAAC,UAAU;IAQlB,sDAAsD;IACtD,OAAO,CAAC,MAAM;IA0Bd,yDAAyD;IACzD,OAAO,CAAC,oBAAoB;IAU5B;;;OAGG;IACH,OAAO,CAAC,yBAAyB;CASjC"}
1
+ {"version":3,"file":"EditorViewEvents.d.ts","sourceRoot":"","sources":["../../src/view/EditorViewEvents.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAErE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAW3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAKxD,MAAM,WAAW,oBAAoB;IACpC,QAAQ,CAAC,cAAc,EAAE,WAAW,CAAC;IACrC,QAAQ,CAAC,QAAQ,EAAE,MAAM,WAAW,CAAC;IACrC,QAAQ,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE,WAAW,KAAK,IAAI,CAAC;IAC7C,QAAQ,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,EAAE,EAAE,WAAW,KAAK,IAAI,CAAC;IACvE,QAAQ,CAAC,UAAU,EAAE,MAAM,OAAO,CAAC;IACnC,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC5C,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IACtC,QAAQ,CAAC,UAAU,EAAE,MAAM,OAAO,CAAC;IACnC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IACnD,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;CAClC;AAED,qBAAa,gBAAgB;IAC5B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAuB;IAC5C,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAa;IACnD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA0B;IAC1D,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAyB;IACxD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAyB;IACpD,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAa;IACpD,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAa;IAClD,OAAO,CAAC,yBAAyB,CAAS;IAC1C,OAAO,CAAC,qBAAqB,CAAS;gBAE1B,IAAI,EAAE,oBAAoB;IAyBtC,iDAAiD;IACjD,oBAAoB,IAAI,IAAI;IAiC5B,mCAAmC;IACnC,OAAO,IAAI,IAAI;IAUf,0DAA0D;IAC1D,OAAO,CAAC,iBAAiB;IAczB,mDAAmD;IACnD,OAAO,CAAC,WAAW;IAmDnB;;;OAGG;IACH,OAAO,CAAC,uBAAuB;IAwC/B,0DAA0D;IAC1D,OAAO,CAAC,UAAU;IAQlB,sDAAsD;IACtD,OAAO,CAAC,MAAM;IA0Bd,yDAAyD;IACzD,OAAO,CAAC,oBAAoB;IAU5B;;;OAGG;IACH,OAAO,CAAC,yBAAyB;CASjC"}
@@ -1 +1 @@
1
- {"version":3,"file":"EditorViewNavigation.d.ts","sourceRoot":"","sources":["../../src/view/EditorViewNavigation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AASjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAW3D,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,cAAc,EAAE,WAAW,CAAC;IACrC,QAAQ,CAAC,QAAQ,EAAE,MAAM,WAAW,CAAC;IACrC,QAAQ,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE,WAAW,KAAK,IAAI,CAAC;IAC7C,QAAQ,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC;CACzC;AAED,qBAAa,oBAAoB;IAChC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAwB;IAC7C,OAAO,CAAC,gBAAgB,CAA8C;IACtE,OAAO,CAAC,UAAU,CAAuB;IACzC,OAAO,CAAC,kBAAkB,CAAS;gBAEvB,IAAI,EAAE,qBAAqB;IAKvC;;;OAGG;IACH,gBAAgB,IAAI,IAAI;IAMxB,6DAA6D;IAC7D,eAAe,IAAI,IAAI;IAIvB,oDAAoD;IACpD,OAAO,IAAI,IAAI;IAOf,4DAA4D;IAC5D,OAAO,CAAC,eAAe;IAqBvB,8DAA8D;IAC9D,OAAO,CAAC,WAAW;IAanB,+DAA+D;IAC/D,OAAO,CAAC,qBAAqB;IAwB7B;;;OAGG;IACH,OAAO,CAAC,uBAAuB;IAa/B,2DAA2D;IAC3D,OAAO,CAAC,mBAAmB;IA+B3B;;;;;;OAMG;IACH,OAAO,CAAC,gCAAgC;CAYxC"}
1
+ {"version":3,"file":"EditorViewNavigation.d.ts","sourceRoot":"","sources":["../../src/view/EditorViewNavigation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AASjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAW3D,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,cAAc,EAAE,WAAW,CAAC;IACrC,QAAQ,CAAC,QAAQ,EAAE,MAAM,WAAW,CAAC;IACrC,QAAQ,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE,WAAW,KAAK,IAAI,CAAC;IAC7C,QAAQ,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC;CACzC;AAED,qBAAa,oBAAoB;IAChC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAwB;IAC7C,OAAO,CAAC,gBAAgB,CAA8C;IACtE,OAAO,CAAC,UAAU,CAAuB;IACzC,OAAO,CAAC,kBAAkB,CAAS;gBAEvB,IAAI,EAAE,qBAAqB;IAKvC;;;OAGG;IACH,gBAAgB,IAAI,IAAI;IAMxB,6DAA6D;IAC7D,eAAe,IAAI,IAAI;IAIvB,oDAAoD;IACpD,OAAO,IAAI,IAAI;IAOf,4DAA4D;IAC5D,OAAO,CAAC,eAAe;IAqBvB,8DAA8D;IAC9D,OAAO,CAAC,WAAW;IAanB,+DAA+D;IAC/D,OAAO,CAAC,qBAAqB;IAwB7B;;;OAGG;IACH,OAAO,CAAC,uBAAuB;IAa/B,2DAA2D;IAC3D,OAAO,CAAC,mBAAmB;IAiC3B;;;;;;OAMG;IACH,OAAO,CAAC,gCAAgC;CAYxC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@notectl/core",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "description": "A modern and accessible rich text editor shipped as a single Web Component. Immutable state, transaction-based architecture, and a plugin system that powers every feature.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -130,6 +130,10 @@
130
130
  "types": "./dist/plugins/smart-paste/index.d.ts",
131
131
  "import": "./dist/plugins/smart-paste.mjs"
132
132
  },
133
+ "./plugins/language": {
134
+ "types": "./dist/plugins/language/index.d.ts",
135
+ "import": "./dist/plugins/language.mjs"
136
+ },
133
137
  "./plugins/text-direction": {
134
138
  "types": "./dist/plugins/text-direction/index.d.ts",
135
139
  "import": "./dist/plugins/text-direction.mjs"
@@ -367,11 +371,11 @@
367
371
  "devDependencies": {
368
372
  "@size-limit/preset-small-lib": "^12.0.0",
369
373
  "happy-dom": "^20.7.0",
370
- "rollup-plugin-visualizer": "^5.14.0",
374
+ "rollup-plugin-visualizer": "^7.0.1",
371
375
  "size-limit": "^12.0.0",
372
376
  "terser": "^5.46.0",
373
- "vite": "^7.3.1",
377
+ "vite": "^8.0.0",
374
378
  "vite-plugin-dts": "^4.5.4",
375
- "vitest": "^4.0.18"
379
+ "vitest": "^4.1.0"
376
380
  }
377
381
  }
@@ -1,2 +0,0 @@
1
- import{o as n}from"./Document-3pNX7ear.mjs";function t(n,t){return n.type===t}function e(n,t){return n.type===t}function r(t,e){return n(t)&&t.inlineType===e}export{e as a,t as b,r as i};
2
- //# sourceMappingURL=AttrRegistry-iNpjvcSG.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AttrRegistry-iNpjvcSG.mjs","sources":["../../src/model/AttrRegistry.ts"],"sourcesContent":["/**\n * Module-augmentable attribute registries for type-safe node/mark attributes.\n *\n * Plugins extend these interfaces via `declare module`:\n * @example\n * declare module '../../model/AttrRegistry.js' {\n * interface NodeAttrRegistry {\n * heading: { level: HeadingLevel; align?: BlockAlignment };\n * }\n * }\n */\n\nimport type { BlockAlignment } from './BlockAlignment.js';\nimport type { BlockNode, InlineNode, Mark } from './Document.js';\nimport { isInlineNode } from './Document.js';\n\n/** Plugins augment this interface to register typed node attributes. */\nexport interface NodeAttrRegistry {\n\tparagraph: { align?: BlockAlignment };\n}\n\n/** Plugins augment this interface to register typed mark attributes. */\nexport interface MarkAttrRegistry {\n\tbold: Record<string, never>;\n\titalic: Record<string, never>;\n\tunderline: Record<string, never>;\n}\n\n/** Resolves typed attributes for known node types, falls back for unknown. */\nexport type NodeAttrsFor<T extends string> = T extends keyof NodeAttrRegistry\n\t? NodeAttrRegistry[T]\n\t: Record<string, string | number | boolean>;\n\n/** Resolves typed attributes for known mark types, falls back for unknown. */\nexport type MarkAttrsFor<T extends string> = T extends keyof MarkAttrRegistry\n\t? MarkAttrRegistry[T]\n\t: Record<string, string | number | boolean>;\n\n/** Narrows a BlockNode to a typed variant with known attributes. */\nexport function isNodeOfType<T extends keyof NodeAttrRegistry>(\n\tnode: BlockNode,\n\ttype: T,\n): node is BlockNode & { readonly type: T; readonly attrs: NodeAttrRegistry[T] } {\n\treturn (node.type as string) === type;\n}\n\n/** Narrows a Mark to a typed variant with known attributes. */\nexport function isMarkOfType<T extends keyof MarkAttrRegistry>(\n\tmark: Mark,\n\ttype: T,\n): mark is Mark & { readonly type: T; readonly attrs: MarkAttrRegistry[T] } {\n\treturn (mark.type as string) === type;\n}\n\n// --- InlineNode Attribute Registry ---\n\n/** Plugins augment this interface to register typed inline node attributes. */\n// biome-ignore lint/suspicious/noEmptyInterface: module augmentation requires interface\nexport interface InlineNodeAttrRegistry {}\n\n/** Resolves typed attributes for known inline node types, falls back for unknown. */\nexport type InlineNodeAttrsFor<T extends string> = T extends keyof InlineNodeAttrRegistry\n\t? InlineNodeAttrRegistry[T]\n\t: Record<string, string | number | boolean>;\n\n/** Narrows an InlineNode to a typed variant with known attributes. */\nexport function isInlineNodeOfType<T extends keyof InlineNodeAttrRegistry>(\n\tnode: InlineNode,\n\tinlineNodeType: T,\n): node is InlineNode & {\n\treadonly inlineType: T;\n\treadonly attrs: InlineNodeAttrRegistry[T];\n} {\n\treturn isInlineNode(node) && (node.inlineType as string) === inlineNodeType;\n}\n"],"names":["isNodeOfType","node","type","isMarkOfType","mark","isInlineNodeOfType","inlineNodeType","isInlineNode","inlineType"],"mappings":"4CAuCO,SAASA,EACfC,EACAC,GAEA,OAAQD,EAAKC,OAAoBA,CAClC,CAGO,SAASC,EACfC,EACAF,GAEA,OAAQE,EAAKF,OAAoBA,CAClC,CAcO,SAASG,EACfJ,EACAK,GAKA,OAAOC,EAAaN,IAAUA,EAAKO,aAA0BF,CAC9D"}
@@ -1,2 +0,0 @@
1
- import{a as t}from"./AttrRegistry-iNpjvcSG.mjs";import{h as n,m as o,k as r,q as e}from"./Document-3pNX7ear.mjs";import{j as s,i as c,s as a}from"./Selection-DhbizDM4.mjs";import{m as i}from"./TypeBrands-Bp_Z_o5Y.mjs";import{f as l}from"./RangeIterator-XFN5FaYf.mjs";function f(t,o){const r=t.selection;if(!s(r))return null;const e=i(o.type);if(c(r)){const s=t.getBlock(r.anchor.blockId);if(!s)return null;const c=[...(t.storedMarks??n(s,r.anchor.offset)).filter(t=>t.type!==e),o];return t.transaction("command").setStoredMarks(c,t.storedMarks).setSelection(r).build()}const f=a(r,t.getBlockOrder()),u=t.transaction("command");return l(t,f,(n,r,s)=>{const c=t.getBlock(n);if(c){const t=k(c,e,r,s);t&&u.removeMark(n,r,s,t)}u.addMark(n,r,s,o)}),u.setSelection(r),u.build()}function u(t,r){const e=t.selection;if(!s(e))return null;if(c(e)){const s=t.getBlock(e.anchor.blockId);if(!s)return null;const c=t.storedMarks??n(s,e.anchor.offset);if(!o(c,r))return null;const a=c.filter(t=>t.type!==r);return t.transaction("command").setStoredMarks(a,t.storedMarks).setSelection(e).build()}const i=a(e,t.getBlockOrder()),f=t.transaction("command");return l(t,i,(n,o,e)=>{const s=t.getBlock(n),c=s?k(s,r,o,e):void 0;f.removeMark(n,o,e,c??{type:r})}),f.setSelection(e),f.build()}function m(o,r,e){const a=o.selection;if(!s(a))return null;if(c(a)&&o.storedMarks){const n=o.storedMarks.find(t=>t.type===r);return n&&t(n,r)?e(n):null}const i=o.getBlock(a.anchor.blockId);if(!i)return null;const l=n(i,a.anchor.offset).find(t=>t.type===r);return l&&t(l,r)?e(l):null}function d(t,n){return null!==m(t,n,()=>!0)}function k(t,n,o,s){const c=r(t);let a=0;for(const r of c){if(!e(r)){a+=1;continue}const t=a+r.text.length;if(t>o&&a<s){const t=r.marks.find(t=>t.type===n);if(t)return t}a=t}}export{f as a,m as g,d as i,u as r};
2
- //# sourceMappingURL=AttributedMarkCommands-BY1BSYWM.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AttributedMarkCommands-BY1BSYWM.mjs","sources":["../../src/commands/AttributedMarkCommands.ts"],"sourcesContent":["/**\n * Generic helpers for attributed marks (marks with key/value attrs).\n *\n * Unlike boolean marks (`bold`, `italic`) that toggle on/off, attributed\n * marks (`font`, `fontSize`, `textColor`, `highlight`) carry data and use\n * **replace** semantics: applying a new value removes the old one first.\n *\n * These helpers extract the duplicated collapsed-vs-range branching that\n * was previously copy-pasted across ColorMarkOperations, FontSizeOperations,\n * and FontPlugin.\n */\n\nimport { isMarkOfType } from '../model/AttrRegistry.js';\nimport type { MarkAttrRegistry } from '../model/AttrRegistry.js';\nimport type { BlockNode, Mark, TextNode } from '../model/Document.js';\nimport {\n\tgetBlockMarksAtOffset,\n\tgetInlineChildren,\n\thasMark,\n\tisTextNode,\n} from '../model/Document.js';\nimport type { InlineNode } from '../model/Document.js';\nimport { isCollapsed, isTextSelection, selectionRange } from '../model/Selection.js';\nimport { markType } from '../model/TypeBrands.js';\nimport type { MarkTypeName } from '../model/TypeBrands.js';\nimport type { EditorState } from '../state/EditorState.js';\nimport type { Transaction } from '../state/Transaction.js';\nimport { forEachBlockInRange } from './RangeIterator.js';\n\n/**\n * Applies an attributed mark to the current selection.\n *\n * - **Collapsed cursor**: replaces stored marks (filters out old mark of the\n * same type, appends the new one).\n * - **Range selection**: removes then re-adds the mark in every block span.\n *\n * Returns the built `Transaction`, or `null` when the selection is\n * unsupported (node-selection / gap-cursor) or the anchor block is missing.\n */\nexport function applyAttributedMark(state: EditorState, mark: Mark): Transaction | null {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return null;\n\n\tconst typeName: MarkTypeName = markType(mark.type as string);\n\n\tif (isCollapsed(sel)) {\n\t\tconst anchorBlock = state.getBlock(sel.anchor.blockId);\n\t\tif (!anchorBlock) return null;\n\t\tconst currentMarks: readonly Mark[] =\n\t\t\tstate.storedMarks ?? getBlockMarksAtOffset(anchorBlock, sel.anchor.offset);\n\t\tconst withoutMark: readonly Mark[] = currentMarks.filter((m) => m.type !== typeName);\n\t\tconst newMarks: readonly Mark[] = [...withoutMark, mark];\n\n\t\treturn state\n\t\t\t.transaction('command')\n\t\t\t.setStoredMarks(newMarks, state.storedMarks)\n\t\t\t.setSelection(sel)\n\t\t\t.build();\n\t}\n\n\tconst range = selectionRange(sel, state.getBlockOrder());\n\tconst builder = state.transaction('command');\n\n\tforEachBlockInRange(state, range, (blockId, from, to) => {\n\t\tconst block: BlockNode | undefined = state.getBlock(blockId);\n\t\tif (block) {\n\t\t\tconst existing: Mark | undefined = findMarkInRange(block, typeName, from, to);\n\t\t\tif (existing) {\n\t\t\t\tbuilder.removeMark(blockId, from, to, existing);\n\t\t\t}\n\t\t}\n\t\tbuilder.addMark(blockId, from, to, mark);\n\t});\n\n\tbuilder.setSelection(sel);\n\treturn builder.build();\n}\n\n/**\n * Removes an attributed mark from the current selection.\n *\n * - **Collapsed cursor**: filters the mark out of stored marks.\n * Returns `null` when the mark was not present.\n * - **Range selection**: removes the mark across all block spans.\n *\n * Returns the built `Transaction`, or `null` when the selection is\n * unsupported or the mark is absent at a collapsed cursor.\n */\nexport function removeAttributedMark(\n\tstate: EditorState,\n\tmarkTypeName: MarkTypeName,\n): Transaction | null {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return null;\n\n\tif (isCollapsed(sel)) {\n\t\tconst anchorBlock = state.getBlock(sel.anchor.blockId);\n\t\tif (!anchorBlock) return null;\n\t\tconst currentMarks: readonly Mark[] =\n\t\t\tstate.storedMarks ?? getBlockMarksAtOffset(anchorBlock, sel.anchor.offset);\n\t\tif (!hasMark(currentMarks, markTypeName)) return null;\n\n\t\tconst newMarks: readonly Mark[] = currentMarks.filter((m) => m.type !== markTypeName);\n\t\treturn state\n\t\t\t.transaction('command')\n\t\t\t.setStoredMarks(newMarks, state.storedMarks)\n\t\t\t.setSelection(sel)\n\t\t\t.build();\n\t}\n\n\tconst range = selectionRange(sel, state.getBlockOrder());\n\tconst builder = state.transaction('command');\n\n\tforEachBlockInRange(state, range, (blockId, from, to) => {\n\t\tconst block: BlockNode | undefined = state.getBlock(blockId);\n\t\tconst existing: Mark | undefined = block\n\t\t\t? findMarkInRange(block, markTypeName, from, to)\n\t\t\t: undefined;\n\t\tbuilder.removeMark(blockId, from, to, existing ?? { type: markTypeName });\n\t});\n\n\tbuilder.setSelection(sel);\n\treturn builder.build();\n}\n\n/**\n * Extracts a typed attribute value from the mark at the current selection.\n *\n * Looks at stored marks (collapsed w/ stored), block marks at cursor offset\n * (collapsed w/o stored), or anchor-block marks (range).\n *\n * @param extractFn — Narrows the found mark and returns the desired value,\n * or `null` when the mark's attrs don't match expectations.\n */\nexport function getMarkAttrAtSelection<K extends keyof MarkAttrRegistry, V>(\n\tstate: EditorState,\n\tmarkTypeName: K,\n\textractFn: (mark: Mark & { readonly type: K; readonly attrs: MarkAttrRegistry[K] }) => V | null,\n): V | null {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return null;\n\n\tif (isCollapsed(sel) && state.storedMarks) {\n\t\tconst found = state.storedMarks.find((m) => (m.type as string) === markTypeName);\n\t\treturn found && isMarkOfType(found, markTypeName) ? extractFn(found) : null;\n\t}\n\n\tconst block = state.getBlock(sel.anchor.blockId);\n\tif (!block) return null;\n\tconst marks: readonly Mark[] = getBlockMarksAtOffset(block, sel.anchor.offset);\n\tconst found = marks.find((m) => (m.type as string) === markTypeName);\n\treturn found && isMarkOfType(found, markTypeName) ? extractFn(found) : null;\n}\n\n/**\n * Returns `true` when the given attributed mark type is present at the\n * current selection (collapsed or range).\n */\nexport function isAttributedMarkActive<K extends keyof MarkAttrRegistry>(\n\tstate: EditorState,\n\tmarkTypeName: K,\n): boolean {\n\treturn getMarkAttrAtSelection(state, markTypeName, () => true as const) !== null;\n}\n\n/**\n * Finds the first mark of the given type within an offset range of a block.\n *\n * Returns the full mark (including attrs) so callers can pass it to\n * `removeMark` for correct undo inversion, or `undefined` when absent.\n */\nfunction findMarkInRange(\n\tblock: BlockNode,\n\ttypeName: MarkTypeName,\n\tfrom: number,\n\tto: number,\n): Mark | undefined {\n\tconst children: readonly (TextNode | InlineNode)[] = getInlineChildren(block);\n\tlet pos = 0;\n\n\tfor (const child of children) {\n\t\tif (!isTextNode(child)) {\n\t\t\tpos += 1;\n\t\t\tcontinue;\n\t\t}\n\t\tconst nodeEnd: number = pos + child.text.length;\n\t\tif (nodeEnd > from && pos < to) {\n\t\t\tconst found: Mark | undefined = child.marks.find((m) => m.type === typeName);\n\t\t\tif (found) return found;\n\t\t}\n\t\tpos = nodeEnd;\n\t}\n\treturn undefined;\n}\n"],"names":["applyAttributedMark","state","mark","sel","selection","isTextSelection","typeName","markType","type","isCollapsed","anchorBlock","getBlock","anchor","blockId","newMarks","storedMarks","getBlockMarksAtOffset","offset","filter","m","transaction","setStoredMarks","setSelection","build","range","selectionRange","getBlockOrder","builder","forEachBlockInRange","from","to","block","existing","findMarkInRange","removeMark","addMark","removeAttributedMark","markTypeName","currentMarks","hasMark","getMarkAttrAtSelection","extractFn","found","find","isMarkOfType","isAttributedMarkActive","children","getInlineChildren","pos","child","isTextNode","nodeEnd","text","length","marks"],"mappings":"2QAuCO,SAASA,EAAoBC,EAAoBC,GACvD,MAAMC,EAAMF,EAAMG,UAClB,IAAKC,EAAgBF,GAAM,OAAO,KAElC,MAAMG,EAAyBC,EAASL,EAAKM,MAE7C,GAAIC,EAAYN,GAAM,CACrB,MAAMO,EAAcT,EAAMU,SAASR,EAAIS,OAAOC,SAC9C,IAAKH,EAAa,OAAO,KACzB,MAGMI,EAA4B,KAFjCb,EAAMc,aAAeC,EAAsBN,EAAaP,EAAIS,OAAOK,SAClBC,OAAQC,GAAMA,EAAEX,OAASF,GACxBJ,GAEnD,OAAOD,EACLmB,YAAY,WACZC,eAAeP,EAAUb,EAAMc,aAC/BO,aAAanB,GACboB,OACH,CAEA,MAAMC,EAAQC,EAAetB,EAAKF,EAAMyB,iBAClCC,EAAU1B,EAAMmB,YAAY,WAclC,OAZAQ,EAAoB3B,EAAOuB,EAAO,CAACX,EAASgB,EAAMC,KACjD,MAAMC,EAA+B9B,EAAMU,SAASE,GACpD,GAAIkB,EAAO,CACV,MAAMC,EAA6BC,EAAgBF,EAAOzB,EAAUuB,EAAMC,GACtEE,GACHL,EAAQO,WAAWrB,EAASgB,EAAMC,EAAIE,EAExC,CACAL,EAAQQ,QAAQtB,EAASgB,EAAMC,EAAI5B,KAGpCyB,EAAQL,aAAanB,GACdwB,EAAQJ,OAChB,CAYO,SAASa,EACfnC,EACAoC,GAEA,MAAMlC,EAAMF,EAAMG,UAClB,IAAKC,EAAgBF,GAAM,OAAO,KAElC,GAAIM,EAAYN,GAAM,CACrB,MAAMO,EAAcT,EAAMU,SAASR,EAAIS,OAAOC,SAC9C,IAAKH,EAAa,OAAO,KACzB,MAAM4B,EACLrC,EAAMc,aAAeC,EAAsBN,EAAaP,EAAIS,OAAOK,QACpE,IAAKsB,EAAQD,EAAcD,GAAe,OAAO,KAEjD,MAAMvB,EAA4BwB,EAAapB,OAAQC,GAAMA,EAAEX,OAAS6B,GACxE,OAAOpC,EACLmB,YAAY,WACZC,eAAeP,EAAUb,EAAMc,aAC/BO,aAAanB,GACboB,OACH,CAEA,MAAMC,EAAQC,EAAetB,EAAKF,EAAMyB,iBAClCC,EAAU1B,EAAMmB,YAAY,WAWlC,OATAQ,EAAoB3B,EAAOuB,EAAO,CAACX,EAASgB,EAAMC,KACjD,MAAMC,EAA+B9B,EAAMU,SAASE,GAC9CmB,EAA6BD,EAChCE,EAAgBF,EAAOM,EAAcR,EAAMC,QAC3C,EACHH,EAAQO,WAAWrB,EAASgB,EAAMC,EAAIE,GAAY,CAAExB,KAAM6B,MAG3DV,EAAQL,aAAanB,GACdwB,EAAQJ,OAChB,CAWO,SAASiB,EACfvC,EACAoC,EACAI,GAEA,MAAMtC,EAAMF,EAAMG,UAClB,IAAKC,EAAgBF,GAAM,OAAO,KAElC,GAAIM,EAAYN,IAAQF,EAAMc,YAAa,CAC1C,MAAM2B,EAAQzC,EAAMc,YAAY4B,KAAMxB,GAAOA,EAAEX,OAAoB6B,GACnE,OAAOK,GAASE,EAAaF,EAAOL,GAAgBI,EAAUC,GAAS,IACxE,CAEA,MAAMX,EAAQ9B,EAAMU,SAASR,EAAIS,OAAOC,SACxC,IAAKkB,EAAO,OAAO,KACnB,MACMW,EADyB1B,EAAsBe,EAAO5B,EAAIS,OAAOK,QACnD0B,KAAMxB,GAAOA,EAAEX,OAAoB6B,GACvD,OAAOK,GAASE,EAAaF,EAAOL,GAAgBI,EAAUC,GAAS,IACxE,CAMO,SAASG,EACf5C,EACAoC,GAEA,OAA4E,OAArEG,EAAuBvC,EAAOoC,EAAc,KAAM,EAC1D,CAQA,SAASJ,EACRF,EACAzB,EACAuB,EACAC,GAEA,MAAMgB,EAA+CC,EAAkBhB,GACvE,IAAIiB,EAAM,EAEV,IAAA,MAAWC,KAASH,EAAU,CAC7B,IAAKI,EAAWD,GAAQ,CACvBD,GAAO,EACP,QACD,CACA,MAAMG,EAAkBH,EAAMC,EAAMG,KAAKC,OACzC,GAAIF,EAAUtB,GAAQmB,EAAMlB,EAAI,CAC/B,MAAMY,EAA0BO,EAAMK,MAAMX,KAAMxB,GAAMA,EAAEX,OAASF,GACnE,GAAIoC,EAAO,OAAOA,CACnB,CACAM,EAAMG,CACP,CAED"}
@@ -1,2 +0,0 @@
1
- import{n as t,s as n,c as e,i as o,e as r,d as s}from"./Document-3pNX7ear.mjs";import{a as i}from"./NodeResolver-z0ReCR34.mjs";import{h as c,g as a}from"./Selection-DhbizDM4.mjs";import{n as f,i as u}from"./TypeBrands-Bp_Z_o5Y.mjs";import{e as d,g as p,f as m}from"./CommandHelpers-M6mPS6Ww.mjs";function l(t,n,e){const o=i(t.doc,n),r=d(o),s=p(t,r),c=m(s,n);if(!(c<0))return{parentPath:r,anchorIndex:c,isAnchorEmpty:b(t,n,e)}}function h(n,e,o,r){const s=i(n.doc,o);if(!s)return;const c=n.getBlock(o);return c?{parentPath:s,anchorIndex:c.children.findIndex(n=>t(n)&&n.id===e),isAnchorEmpty:b(n,e,r)}:void 0}function y(t,n){const e=t.getBlock(n);if("table_cell"===e?.type)return n;const o=i(t.doc,n);if(o)for(const r of o){const n=t.getBlock(r);if("table_cell"===n?.type)return r}}function g(t){return c(t)?t.nodeId:a(t)?t.blockId:t.anchor.blockId}function x(t,n,e,o,r,s){const i=y(t,e);if(i){const r=h(t,e,i,s);if(!r)return!1;const c=r.anchorIndex+1;n.insertNode(r.parentPath,c,o),r.isAnchorEmpty&&r.anchorIndex>=0&&n.removeNode(r.parentPath,r.anchorIndex)}else{const i=l(t,e,s);if(!i)return!1;const c=a(r)&&"before"===r.side?0:1;n.insertNode(i.parentPath,i.anchorIndex+c,o),i.isAnchorEmpty&&!a(r)&&n.removeNode(i.parentPath,i.anchorIndex)}return!0}function I(o,r){const s=o.children.map(e=>t(e)?I(e,n()):e);return e(o.type,s,r,o.attrs)}function k(n,e){if(n.id===e)return n;for(const o of n.children){if(!t(o))continue;const n=k(o,e);if(n)return n}}function v(t,n){if(!n)return;const e={};let o=!1;for(const r of Object.keys(n)){const s=n[r],i=t?.[r];"string"==typeof i||"number"==typeof i||"boolean"==typeof i?e[r]=i:void 0!==s.default&&(e[r]=s.default),r in e&&(o=!0)}return o?e:void 0}function b(t,n,e){const r=t.getBlock(n);if(!r)return!1;const s=e?.getNodeSpec(r.type);return!s?.isVoid&&""===o(r)}function N(t,n){if(!t.type)return;if(!n)return t;const e=n.getNodeSpec(t.type);if(!e)return;const o=v(t.attrs,e.attrs),r=t.segments?function(t,n){const e=[];for(const o of t){if("inline"===o.kind){const t=n.getInlineNodeSpec(o.inlineType);if(!t)continue;const r=v(o.attrs,t.attrs);e.push({kind:"inline",inlineType:o.inlineType,...r?{attrs:r}:{}});continue}e.push(o)}return e}(t.segments,n):void 0;return{...t,...o?{attrs:o}:{},...r?{segments:r}:t.segments?{segments:[]}:{}}}function j(t){const o=n(),i=function(t,n){return t.segments&&t.segments.length>0?function(t){const n=[];for(const e of t){if("inline"===e.kind){n.push(s(u(e.inlineType),e.attrs));continue}if(0===e.text.length)continue;const t=e.marks.map(t=>({type:t.type,...t.attrs?{attrs:t.attrs}:{}}));n.push(r(e.text,t))}return n}(t.segments):n?[r(n)]:void 0}(t,t.text??""),c=t.attrs?t.attrs:void 0;return e(f(t.type),i,o,c)}export{y as a,h as b,I as c,j as d,g as e,k as f,x as i,l as r,v as s,N as v};
2
- //# sourceMappingURL=BlockInsertion-BJFhE0jA.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BlockInsertion-BJFhE0jA.mjs","sources":["../../src/commands/BlockInsertion.ts"],"sourcesContent":["/**\n * Block insertion utilities for paste and clipboard operations.\n *\n * Provides context resolution (parent path, anchor index, empty detection)\n * for inserting blocks into the document tree — both at root level and\n * inside table cells. Also contains pure helpers for block cloning,\n * recursive lookup, and attribute sanitization against a NodeSpec.\n */\n\nimport {\n\ttype BlockAttrs,\n\ttype BlockNode,\n\ttype ChildNode,\n\ttype InlineNode,\n\ttype Mark,\n\ttype TextNode,\n\tcreateBlockNode,\n\tcreateInlineNode,\n\tcreateTextNode,\n\tgenerateBlockId,\n\tgetBlockText,\n\tisBlockNode,\n} from '../model/Document.js';\nimport { findNodePath } from '../model/NodeResolver.js';\nimport type { AttrSpec } from '../model/NodeSpec.js';\nimport type { RichBlockData, RichSegment } from '../model/RichBlockData.js';\nimport type { SchemaRegistry } from '../model/SchemaRegistry.js';\nimport type { EditorSelection } from '../model/Selection.js';\nimport { isGapCursor, isNodeSelection } from '../model/Selection.js';\nimport type { BlockId, NodeTypeName } from '../model/TypeBrands.js';\nimport { inlineType, nodeType } from '../model/TypeBrands.js';\nimport type { EditorState } from '../state/EditorState.js';\nimport type { TransactionBuilder } from '../state/Transaction.js';\nimport { extractParentPath, findSiblingIndex, getSiblings } from './CommandHelpers.js';\n\n/**\n * Resolved insertion target within the document tree.\n * Contains everything needed to insert blocks at a specific anchor position.\n */\nexport interface InsertionContext {\n\treadonly parentPath: readonly BlockId[];\n\treadonly anchorIndex: number;\n\treadonly isAnchorEmpty: boolean;\n}\n\n/**\n * Resolves an insertion context for root-level (or nested-parent-level) insertion.\n * Computes the parent path, anchor index among siblings, and whether the anchor is empty.\n */\nexport function resolveRootInsertionContext(\n\tstate: EditorState,\n\tanchorBlockId: BlockId,\n\tschemaRegistry?: SchemaRegistry,\n): InsertionContext | undefined {\n\tconst path: readonly string[] | undefined = findNodePath(state.doc, anchorBlockId);\n\tconst parentPath: BlockId[] = extractParentPath(path);\n\n\tconst siblings: readonly ChildNode[] = getSiblings(state, parentPath);\n\tconst anchorIndex: number = findSiblingIndex(siblings, anchorBlockId);\n\tif (anchorIndex < 0) return undefined;\n\n\tconst isAnchorEmpty: boolean = isBlockEmpty(state, anchorBlockId, schemaRegistry);\n\treturn { parentPath, anchorIndex, isAnchorEmpty };\n}\n\n/**\n * Resolves an insertion context within a table cell.\n * The parent path points to the cell itself; siblings are the cell's children.\n */\nexport function resolveCellInsertionContext(\n\tstate: EditorState,\n\tanchorBlockId: BlockId,\n\tcellId: BlockId,\n\tschemaRegistry?: SchemaRegistry,\n): InsertionContext | undefined {\n\tconst cellPath: BlockId[] | undefined = findNodePath(state.doc, cellId) as BlockId[] | undefined;\n\tif (!cellPath) return undefined;\n\n\tconst cell: BlockNode | undefined = state.getBlock(cellId);\n\tif (!cell) return undefined;\n\n\tconst anchorIndex: number = cell.children.findIndex(\n\t\t(c) => isBlockNode(c) && c.id === anchorBlockId,\n\t);\n\n\tconst isAnchorEmpty: boolean = isBlockEmpty(state, anchorBlockId, schemaRegistry);\n\treturn { parentPath: cellPath, anchorIndex, isAnchorEmpty };\n}\n\n/**\n * Finds a table_cell ancestor for the given block.\n * Walks the node path upward, returning the first table_cell BlockId found.\n */\nexport function findTableCellAncestor(state: EditorState, blockId: BlockId): BlockId | undefined {\n\tconst block: BlockNode | undefined = state.getBlock(blockId);\n\tif (block?.type === 'table_cell') return blockId;\n\n\tconst path: BlockId[] | undefined = findNodePath(state.doc, blockId) as BlockId[] | undefined;\n\tif (!path) return undefined;\n\n\tfor (const id of path) {\n\t\tconst node: BlockNode | undefined = state.getBlock(id as BlockId);\n\t\tif (node?.type === 'table_cell') return id as BlockId;\n\t}\n\treturn undefined;\n}\n\n/**\n * Resolves the anchor block ID from the current editor selection.\n * Handles text selection, node selection, and gap cursor uniformly.\n */\nexport function resolveAnchorBlockId(selection: EditorSelection): BlockId {\n\tif (isNodeSelection(selection)) return selection.nodeId;\n\tif (isGapCursor(selection)) return selection.blockId;\n\treturn selection.anchor.blockId;\n}\n\n/**\n * Inserts a block node after the anchor position, resolving cell vs root context.\n * Removes the anchor block if it is empty (matching standard paste behavior).\n * Returns true on success, false if context resolution fails.\n */\nexport function insertBlockAfterAnchor(\n\tstate: EditorState,\n\tbuilder: TransactionBuilder,\n\tanchorBlockId: BlockId,\n\tblock: BlockNode,\n\tselection: EditorSelection,\n\tschemaRegistry?: SchemaRegistry,\n): boolean {\n\tconst cellId: BlockId | undefined = findTableCellAncestor(state, anchorBlockId);\n\n\tif (cellId) {\n\t\tconst ctx: InsertionContext | undefined = resolveCellInsertionContext(\n\t\t\tstate,\n\t\t\tanchorBlockId,\n\t\t\tcellId,\n\t\t\tschemaRegistry,\n\t\t);\n\t\tif (!ctx) return false;\n\n\t\tconst insertIndex: number = ctx.anchorIndex + 1;\n\t\tbuilder.insertNode(ctx.parentPath, insertIndex, block);\n\n\t\tif (ctx.isAnchorEmpty && ctx.anchorIndex >= 0) {\n\t\t\tbuilder.removeNode(ctx.parentPath, ctx.anchorIndex);\n\t\t}\n\t} else {\n\t\tconst ctx: InsertionContext | undefined = resolveRootInsertionContext(\n\t\t\tstate,\n\t\t\tanchorBlockId,\n\t\t\tschemaRegistry,\n\t\t);\n\t\tif (!ctx) return false;\n\n\t\tconst insertOffset: number = isGapCursor(selection) && selection.side === 'before' ? 0 : 1;\n\t\tbuilder.insertNode(ctx.parentPath, ctx.anchorIndex + insertOffset, block);\n\n\t\tif (ctx.isAnchorEmpty && !isGapCursor(selection)) {\n\t\t\tbuilder.removeNode(ctx.parentPath, ctx.anchorIndex);\n\t\t}\n\t}\n\n\treturn true;\n}\n\n/** Recursively clones a block tree, assigning new IDs to all block nodes. */\nexport function cloneBlockWithNewIds(block: BlockNode, newId: BlockId): BlockNode {\n\tconst children = block.children.map((child) => {\n\t\tif (isBlockNode(child)) {\n\t\t\treturn cloneBlockWithNewIds(child, generateBlockId());\n\t\t}\n\t\treturn child;\n\t});\n\treturn createBlockNode(block.type, children, newId, block.attrs);\n}\n\n/** Recursively searches a block tree for a block with the given ID (DFS). */\nexport function findBlockRecursive(block: BlockNode, blockId: BlockId): BlockNode | undefined {\n\tif (block.id === blockId) return block;\n\tfor (const child of block.children) {\n\t\tif (!isBlockNode(child)) continue;\n\t\tconst found: BlockNode | undefined = findBlockRecursive(child, blockId);\n\t\tif (found) return found;\n\t}\n\treturn undefined;\n}\n\n/**\n * Validates incoming attributes against the declared AttrSpec.\n * Only keys declared in the spec are kept; non-primitive values fall back to defaults.\n */\nexport function sanitizeAttrs(\n\tincoming: Record<string, unknown> | undefined,\n\tspecAttrs: Readonly<Record<string, AttrSpec>> | undefined,\n): Record<string, string | number | boolean> | undefined {\n\tif (!specAttrs) return undefined;\n\n\tconst result: Record<string, string | number | boolean> = {};\n\tlet hasKeys = false;\n\n\tfor (const key of Object.keys(specAttrs)) {\n\t\tconst spec: AttrSpec = specAttrs[key] as AttrSpec;\n\t\tconst raw: unknown = incoming?.[key];\n\n\t\tif (typeof raw === 'string' || typeof raw === 'number' || typeof raw === 'boolean') {\n\t\t\tresult[key] = raw;\n\t\t} else if (spec.default !== undefined) {\n\t\t\tresult[key] = spec.default;\n\t\t}\n\t\tif (key in result) hasKeys = true;\n\t}\n\n\treturn hasKeys ? result : undefined;\n}\n\n/** Checks whether a block is empty (has no text and is not a void block). */\nfunction isBlockEmpty(\n\tstate: EditorState,\n\tblockId: BlockId,\n\tschemaRegistry?: SchemaRegistry,\n): boolean {\n\tconst block: BlockNode | undefined = state.getBlock(blockId);\n\tif (!block) return false;\n\n\tconst spec = schemaRegistry?.getNodeSpec(block.type);\n\treturn !spec?.isVoid && getBlockText(block) === '';\n}\n\n// --- Rich block creation ---\n\n/**\n * Validates a rich block against the schema registry.\n * Returns undefined for blocks with unknown types; sanitizes attributes\n * against the declared spec.\n */\nexport function validateRichBlockData(\n\traw: RichBlockData,\n\tschemaRegistry?: SchemaRegistry,\n): RichBlockData | undefined {\n\tif (!raw.type) return undefined;\n\tif (!schemaRegistry) return raw;\n\n\tconst spec = schemaRegistry.getNodeSpec(raw.type);\n\tif (!spec) return undefined;\n\n\tconst attrs: Record<string, string | number | boolean> | undefined = sanitizeAttrs(\n\t\traw.attrs,\n\t\tspec.attrs,\n\t);\n\tconst segments: RichSegment[] | undefined = raw.segments\n\t\t? sanitizeRichSegments(raw.segments, schemaRegistry)\n\t\t: undefined;\n\treturn {\n\t\t...raw,\n\t\t...(attrs ? { attrs } : {}),\n\t\t...(segments ? { segments } : raw.segments ? { segments: [] } : {}),\n\t};\n}\n\n/**\n * Creates a BlockNode from validated rich block data.\n * Converts segments or plain text into inline children.\n */\nexport function createBlockFromRichData(blockData: RichBlockData): BlockNode {\n\tconst newId: BlockId = generateBlockId();\n\tconst text: string = blockData.text ?? '';\n\tconst children: readonly (TextNode | InlineNode)[] | undefined = createChildrenFromRichBlock(\n\t\tblockData,\n\t\ttext,\n\t);\n\tconst attrs: BlockAttrs | undefined = blockData.attrs\n\t\t? (blockData.attrs as BlockAttrs)\n\t\t: undefined;\n\n\treturn createBlockNode(nodeType(blockData.type) as NodeTypeName, children, newId, attrs);\n}\n\n/**\n * Creates inline children from rich block data.\n * Uses mark-preserving segments when available, falls back to plain text.\n */\nfunction createChildrenFromRichBlock(\n\tblockData: RichBlockData,\n\ttext: string,\n): readonly (TextNode | InlineNode)[] | undefined {\n\tif (blockData.segments && blockData.segments.length > 0) {\n\t\treturn createChildrenFromSegments(blockData.segments);\n\t}\n\treturn text ? [createTextNode(text)] : undefined;\n}\n\n/** Converts rich segments into TextNode children with marks. */\nfunction createChildrenFromSegments(\n\tsegments: readonly RichSegment[],\n): readonly (TextNode | InlineNode)[] {\n\tconst children: (TextNode | InlineNode)[] = [];\n\tfor (const seg of segments) {\n\t\tif (seg.kind === 'inline') {\n\t\t\tchildren.push(\n\t\t\t\tcreateInlineNode(\n\t\t\t\t\tinlineType(seg.inlineType),\n\t\t\t\t\tseg.attrs as Readonly<Record<string, string | number | boolean>> | undefined,\n\t\t\t\t),\n\t\t\t);\n\t\t\tcontinue;\n\t\t}\n\t\tif (seg.text.length === 0) continue;\n\t\tconst marks: readonly Mark[] = seg.marks.map((m) => ({\n\t\t\ttype: m.type as Mark['type'],\n\t\t\t...(m.attrs ? { attrs: m.attrs as Mark['attrs'] } : {}),\n\t\t}));\n\t\tchildren.push(createTextNode(seg.text, marks));\n\t}\n\treturn children;\n}\n\nfunction sanitizeRichSegments(\n\tsegments: readonly RichSegment[],\n\tschemaRegistry: SchemaRegistry,\n): RichSegment[] {\n\tconst sanitized: RichSegment[] = [];\n\tfor (const segment of segments) {\n\t\tif (segment.kind === 'inline') {\n\t\t\tconst spec = schemaRegistry.getInlineNodeSpec(segment.inlineType);\n\t\t\tif (!spec) continue;\n\t\t\tconst attrs = sanitizeAttrs(segment.attrs, spec.attrs);\n\t\t\tsanitized.push({\n\t\t\t\tkind: 'inline',\n\t\t\t\tinlineType: segment.inlineType,\n\t\t\t\t...(attrs ? { attrs } : {}),\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tsanitized.push(segment);\n\t}\n\treturn sanitized;\n}\n"],"names":["resolveRootInsertionContext","state","anchorBlockId","schemaRegistry","path","findNodePath","doc","parentPath","extractParentPath","siblings","getSiblings","anchorIndex","findSiblingIndex","isAnchorEmpty","isBlockEmpty","resolveCellInsertionContext","cellId","cellPath","cell","getBlock","children","findIndex","c","isBlockNode","id","findTableCellAncestor","blockId","block","type","node","resolveAnchorBlockId","selection","isNodeSelection","nodeId","isGapCursor","anchor","insertBlockAfterAnchor","builder","ctx","insertIndex","insertNode","removeNode","insertOffset","side","cloneBlockWithNewIds","newId","map","child","generateBlockId","createBlockNode","attrs","findBlockRecursive","found","sanitizeAttrs","incoming","specAttrs","result","hasKeys","key","Object","keys","spec","raw","default","getNodeSpec","isVoid","getBlockText","validateRichBlockData","segments","sanitized","segment","kind","getInlineNodeSpec","inlineType","push","sanitizeRichSegments","createBlockFromRichData","blockData","text","length","seg","createInlineNode","marks","m","createTextNode","createChildrenFromSegments","createChildrenFromRichBlock","nodeType"],"mappings":"wSAiDO,SAASA,EACfC,EACAC,EACAC,GAEA,MAAMC,EAAsCC,EAAaJ,EAAMK,IAAKJ,GAC9DK,EAAwBC,EAAkBJ,GAE1CK,EAAiCC,EAAYT,EAAOM,GACpDI,EAAsBC,EAAiBH,EAAUP,GACvD,KAAIS,EAAc,GAGlB,MAAO,CAAEJ,aAAYI,cAAaE,cADHC,EAAab,EAAOC,EAAeC,GAEnE,CAMO,SAASY,EACfd,EACAC,EACAc,EACAb,GAEA,MAAMc,EAAkCZ,EAAaJ,EAAMK,IAAKU,GAChE,IAAKC,EAAU,OAEf,MAAMC,EAA8BjB,EAAMkB,SAASH,GACnD,OAAKE,EAOE,CAAEX,WAAYU,EAAUN,YALHO,EAAKE,SAASC,UACxCC,GAAMC,EAAYD,IAAMA,EAAEE,KAAOtB,GAISW,cADbC,EAAab,EAAOC,EAAeC,SANlE,CAQD,CAMO,SAASsB,EAAsBxB,EAAoByB,GACzD,MAAMC,EAA+B1B,EAAMkB,SAASO,GACpD,GAAoB,eAAhBC,GAAOC,KAAuB,OAAOF,EAEzC,MAAMtB,EAA8BC,EAAaJ,EAAMK,IAAKoB,GAC5D,GAAKtB,EAEL,IAAA,MAAWoB,KAAMpB,EAAM,CACtB,MAAMyB,EAA8B5B,EAAMkB,SAASK,GACnD,GAAmB,eAAfK,GAAMD,KAAuB,OAAOJ,CACzC,CAED,CAMO,SAASM,EAAqBC,GACpC,OAAIC,EAAgBD,GAAmBA,EAAUE,OAC7CC,EAAYH,GAAmBA,EAAUL,QACtCK,EAAUI,OAAOT,OACzB,CAOO,SAASU,EACfnC,EACAoC,EACAnC,EACAyB,EACAI,EACA5B,GAEA,MAAMa,EAA8BS,EAAsBxB,EAAOC,GAEjE,GAAIc,EAAQ,CACX,MAAMsB,EAAoCvB,EACzCd,EACAC,EACAc,EACAb,GAED,IAAKmC,EAAK,OAAO,EAEjB,MAAMC,EAAsBD,EAAI3B,YAAc,EAC9C0B,EAAQG,WAAWF,EAAI/B,WAAYgC,EAAaZ,GAE5CW,EAAIzB,eAAiByB,EAAI3B,aAAe,GAC3C0B,EAAQI,WAAWH,EAAI/B,WAAY+B,EAAI3B,YAEzC,KAAO,CACN,MAAM2B,EAAoCtC,EACzCC,EACAC,EACAC,GAED,IAAKmC,EAAK,OAAO,EAEjB,MAAMI,EAAuBR,EAAYH,IAAiC,WAAnBA,EAAUY,KAAoB,EAAI,EACzFN,EAAQG,WAAWF,EAAI/B,WAAY+B,EAAI3B,YAAc+B,EAAcf,GAE/DW,EAAIzB,gBAAkBqB,EAAYH,IACrCM,EAAQI,WAAWH,EAAI/B,WAAY+B,EAAI3B,YAEzC,CAEA,OAAO,CACR,CAGO,SAASiC,EAAqBjB,EAAkBkB,GACtD,MAAMzB,EAAWO,EAAMP,SAAS0B,IAAKC,GAChCxB,EAAYwB,GACRH,EAAqBG,EAAOC,KAE7BD,GAER,OAAOE,EAAgBtB,EAAMC,KAAMR,EAAUyB,EAAOlB,EAAMuB,MAC3D,CAGO,SAASC,EAAmBxB,EAAkBD,GACpD,GAAIC,EAAMH,KAAOE,EAAS,OAAOC,EACjC,IAAA,MAAWoB,KAASpB,EAAMP,SAAU,CACnC,IAAKG,EAAYwB,GAAQ,SACzB,MAAMK,EAA+BD,EAAmBJ,EAAOrB,GAC/D,GAAI0B,EAAO,OAAOA,CACnB,CAED,CAMO,SAASC,EACfC,EACAC,GAEA,IAAKA,EAAW,OAEhB,MAAMC,EAAoD,CAAA,EAC1D,IAAIC,GAAU,EAEd,IAAA,MAAWC,KAAOC,OAAOC,KAAKL,GAAY,CACzC,MAAMM,EAAiBN,EAAUG,GAC3BI,EAAeR,IAAWI,GAEb,iBAARI,GAAmC,iBAARA,GAAmC,kBAARA,EAChEN,EAAOE,GAAOI,OACa,IAAjBD,EAAKE,UACfP,EAAOE,GAAOG,EAAKE,SAEhBL,KAAOF,IAAQC,GAAU,EAC9B,CAEA,OAAOA,EAAUD,OAAS,CAC3B,CAGA,SAAS1C,EACRb,EACAyB,EACAvB,GAEA,MAAMwB,EAA+B1B,EAAMkB,SAASO,GACpD,IAAKC,EAAO,OAAO,EAEnB,MAAMkC,EAAO1D,GAAgB6D,YAAYrC,EAAMC,MAC/C,OAAQiC,GAAMI,QAAkC,KAAxBC,EAAavC,EACtC,CASO,SAASwC,EACfL,EACA3D,GAEA,IAAK2D,EAAIlC,KAAM,OACf,IAAKzB,EAAgB,OAAO2D,EAE5B,MAAMD,EAAO1D,EAAe6D,YAAYF,EAAIlC,MAC5C,IAAKiC,EAAM,OAEX,MAAMX,EAA+DG,EACpES,EAAIZ,MACJW,EAAKX,OAEAkB,EAAsCN,EAAIM,SAmEjD,SACCA,EACAjE,GAEA,MAAMkE,EAA2B,GACjC,IAAA,MAAWC,KAAWF,EAAU,CAC/B,GAAqB,WAAjBE,EAAQC,KAAmB,CAC9B,MAAMV,EAAO1D,EAAeqE,kBAAkBF,EAAQG,YACtD,IAAKZ,EAAM,SACX,MAAMX,EAAQG,EAAciB,EAAQpB,MAAOW,EAAKX,OAChDmB,EAAUK,KAAK,CACdH,KAAM,SACNE,WAAYH,EAAQG,cAChBvB,EAAQ,CAAEA,SAAU,CAAA,IAEzB,QACD,CACAmB,EAAUK,KAAKJ,EAChB,CACA,OAAOD,CACR,CAtFIM,CAAqBb,EAAIM,SAAUjE,QACnC,EACH,MAAO,IACH2D,KACCZ,EAAQ,CAAEA,SAAU,CAAA,KACpBkB,EAAW,CAAEA,YAAaN,EAAIM,SAAW,CAAEA,SAAU,IAAO,CAAA,EAElE,CAMO,SAASQ,EAAwBC,GACvC,MAAMhC,EAAiBG,IAEjB5B,EAeP,SACCyD,EACAC,GAEA,OAAID,EAAUT,UAAYS,EAAUT,SAASW,OAAS,EAOvD,SACCX,GAEA,MAAMhD,EAAsC,GAC5C,IAAA,MAAW4D,KAAOZ,EAAU,CAC3B,GAAiB,WAAbY,EAAIT,KAAmB,CAC1BnD,EAASsD,KACRO,EACCR,EAAWO,EAAIP,YACfO,EAAI9B,QAGN,QACD,CACA,GAAwB,IAApB8B,EAAIF,KAAKC,OAAc,SAC3B,MAAMG,EAAyBF,EAAIE,MAAMpC,IAAKqC,IAAA,CAC7CvD,KAAMuD,EAAEvD,QACJuD,EAAEjC,MAAQ,CAAEA,MAAOiC,EAAEjC,OAA2B,CAAA,KAErD9B,EAASsD,KAAKU,EAAeJ,EAAIF,KAAMI,GACxC,CACA,OAAO9D,CACR,CA5BSiE,CAA2BR,EAAUT,UAEtCU,EAAO,CAACM,EAAeN,SAAS,CACxC,CAvBkEQ,CAChET,EAFoBA,EAAUC,MAAQ,IAKjC5B,EAAgC2B,EAAU3B,MAC5C2B,EAAU3B,WACX,EAEH,OAAOD,EAAgBsC,EAASV,EAAUjD,MAAuBR,EAAUyB,EAAOK,EACnF"}
@@ -1,2 +0,0 @@
1
- class e{_entries=/* @__PURE__ */new Map;registerBlockTypePickerEntry(e){if(this._entries.has(e.id))throw new Error(`BlockTypePickerEntry with id "${e.id}" is already registered.`);this._entries.set(e.id,e)}getBlockTypePickerEntries(){return[...this._entries.values()].sort((e,r)=>e.priority-r.priority)}removeBlockTypePickerEntry(e){this._entries.delete(e)}clear(){this._entries.clear()}}export{e as B};
2
- //# sourceMappingURL=BlockTypePickerRegistry-DcSE6IXB.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BlockTypePickerRegistry-DcSE6IXB.mjs","sources":["../../src/plugins/heading/BlockTypePickerRegistry.ts"],"sourcesContent":["/**\n * BlockTypePickerRegistry: manages plugin-registered block type picker entries\n * displayed in the heading/block type dropdown, sorted by priority.\n */\n\nimport type { BlockTypePickerEntry } from './BlockTypePickerEntry.js';\n\nexport class BlockTypePickerRegistry {\n\tprivate readonly _entries = new Map<string, BlockTypePickerEntry>();\n\n\tregisterBlockTypePickerEntry(entry: BlockTypePickerEntry): void {\n\t\tif (this._entries.has(entry.id)) {\n\t\t\tthrow new Error(`BlockTypePickerEntry with id \"${entry.id}\" is already registered.`);\n\t\t}\n\t\tthis._entries.set(entry.id, entry);\n\t}\n\n\tgetBlockTypePickerEntries(): readonly BlockTypePickerEntry[] {\n\t\treturn [...this._entries.values()].sort((a, b) => a.priority - b.priority);\n\t}\n\n\tremoveBlockTypePickerEntry(id: string): void {\n\t\tthis._entries.delete(id);\n\t}\n\n\tclear(): void {\n\t\tthis._entries.clear();\n\t}\n}\n"],"names":["BlockTypePickerRegistry","_entries","Map","registerBlockTypePickerEntry","entry","this","has","id","Error","set","getBlockTypePickerEntries","values","sort","a","b","priority","removeBlockTypePickerEntry","delete","clear"],"mappings":"AAOO,MAAMA,EACKC,4BAAeC,IAEhC,4BAAAC,CAA6BC,GAC5B,GAAIC,KAAKJ,SAASK,IAAIF,EAAMG,IAC3B,MAAM,IAAIC,MAAM,iCAAiCJ,EAAMG,8BAExDF,KAAKJ,SAASQ,IAAIL,EAAMG,GAAIH,EAC7B,CAEA,yBAAAM,GACC,MAAO,IAAIL,KAAKJ,SAASU,UAAUC,KAAK,CAACC,EAAGC,IAAMD,EAAEE,SAAWD,EAAEC,SAClE,CAEA,0BAAAC,CAA2BT,GAC1BF,KAAKJ,SAASgB,OAAOV,EACtB,CAEA,KAAAW,GACCb,KAAKJ,SAASiB,OACf"}