@notectl/core 1.7.3 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1280) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +56 -31
  3. package/custom-elements.json +350 -6
  4. package/dist/chunks/AttrRegistry-B2AGfTE0.mjs +2 -0
  5. package/dist/chunks/AttrRegistry-B2AGfTE0.mjs.map +1 -0
  6. package/dist/chunks/AttributedMarkCommands-BB7lzFct.mjs +2 -0
  7. package/dist/chunks/{AttributedMarkCommands-BtLea72z.mjs.map → AttributedMarkCommands-BB7lzFct.mjs.map} +1 -1
  8. package/dist/chunks/BlockTypePickerRegistry-DcSE6IXB.mjs +2 -0
  9. package/dist/chunks/BlockTypePickerRegistry-DcSE6IXB.mjs.map +1 -0
  10. package/dist/chunks/ColorGrid-CpkbKfXg.mjs +2 -0
  11. package/dist/chunks/ColorGrid-CpkbKfXg.mjs.map +1 -0
  12. package/dist/chunks/ColorPickerPopup-DRzFvt7o.mjs +2 -0
  13. package/dist/chunks/ColorPickerPopup-DRzFvt7o.mjs.map +1 -0
  14. package/dist/chunks/ColorValidation-DCSKq9B2.mjs +2 -0
  15. package/dist/chunks/{ColorValidation-CV4f1wu6.mjs.map → ColorValidation-DCSKq9B2.mjs.map} +1 -1
  16. package/dist/chunks/Commands-P9wS8qtN.mjs +2 -0
  17. package/dist/chunks/Commands-P9wS8qtN.mjs.map +1 -0
  18. package/dist/chunks/Decoration-D49mFXrH.mjs +2 -0
  19. package/dist/chunks/Decoration-D49mFXrH.mjs.map +1 -0
  20. package/dist/chunks/Document-BFYAonMF.mjs +2 -0
  21. package/dist/chunks/{Document-Brtw2jL1.mjs.map → Document-BFYAonMF.mjs.map} +1 -1
  22. package/dist/chunks/DocumentParser-DFcvVMGY.mjs +2 -0
  23. package/dist/chunks/DocumentParser-DFcvVMGY.mjs.map +1 -0
  24. package/dist/chunks/DomUtils-Cdz1eDKM.mjs +2 -0
  25. package/dist/chunks/DomUtils-Cdz1eDKM.mjs.map +1 -0
  26. package/dist/chunks/HTMLUtils-CCvQ5f83.mjs +2 -0
  27. package/dist/chunks/HTMLUtils-CCvQ5f83.mjs.map +1 -0
  28. package/dist/chunks/HeadingPlugin-DYy3IoT_.mjs +2 -0
  29. package/dist/chunks/HeadingPlugin-DYy3IoT_.mjs.map +1 -0
  30. package/dist/chunks/KeyboardNav-DsYhKKuV.mjs +2 -0
  31. package/dist/chunks/KeyboardNav-DsYhKKuV.mjs.map +1 -0
  32. package/dist/chunks/LocaleService-B6Z-wyAF.mjs +2 -0
  33. package/dist/chunks/LocaleService-B6Z-wyAF.mjs.map +1 -0
  34. package/dist/chunks/MarkCommands-B_erV7zz.mjs +2 -0
  35. package/dist/chunks/{MarkCommands-6RUJ4L3r.mjs.map → MarkCommands-B_erV7zz.mjs.map} +1 -1
  36. package/dist/chunks/NavigationQueries-ogQuObz7.mjs +2 -0
  37. package/dist/chunks/NavigationQueries-ogQuObz7.mjs.map +1 -0
  38. package/dist/chunks/NotectlEditor-4NFnXLyD.mjs +2 -0
  39. package/dist/chunks/NotectlEditor-4NFnXLyD.mjs.map +1 -0
  40. package/dist/chunks/Platform-CU6itXZo.mjs +2 -0
  41. package/dist/chunks/Platform-CU6itXZo.mjs.map +1 -0
  42. package/dist/chunks/Plugin-OzM8Oxm_.mjs +2 -0
  43. package/dist/chunks/Plugin-OzM8Oxm_.mjs.map +1 -0
  44. package/dist/chunks/PluginHelpers-DjZt0pQi.mjs +2 -0
  45. package/dist/chunks/PluginHelpers-DjZt0pQi.mjs.map +1 -0
  46. package/dist/chunks/PopupManager-BM8IT6M7.mjs +2 -0
  47. package/dist/chunks/PopupManager-BM8IT6M7.mjs.map +1 -0
  48. package/dist/chunks/PopupPositioning-DtvqMSop.mjs +2 -0
  49. package/dist/chunks/PopupPositioning-DtvqMSop.mjs.map +1 -0
  50. package/dist/chunks/PrintTypes-ehbL7ipA.mjs +2 -0
  51. package/dist/chunks/PrintTypes-ehbL7ipA.mjs.map +1 -0
  52. package/dist/chunks/RangeIterator-CNI6smOg.mjs +2 -0
  53. package/dist/chunks/{RangeIterator-Bh4Vl_6D.mjs.map → RangeIterator-CNI6smOg.mjs.map} +1 -1
  54. package/dist/chunks/Selection-6-W6Flxc.mjs +2 -0
  55. package/dist/chunks/{Selection-BRTab5hO.mjs.map → Selection-6-W6Flxc.mjs.map} +1 -1
  56. package/dist/chunks/SelectionTransactions-q71GEzgE.mjs +2 -0
  57. package/dist/chunks/SelectionTransactions-q71GEzgE.mjs.map +1 -0
  58. package/dist/chunks/ShortcutFormatting-BLKS0Gys.mjs +2 -0
  59. package/dist/chunks/ShortcutFormatting-BLKS0Gys.mjs.map +1 -0
  60. package/dist/chunks/StyleRuntime-BmsLoEa8.mjs +2 -0
  61. package/dist/chunks/{StyleRuntime-CP4NCwKT.mjs.map → StyleRuntime-BmsLoEa8.mjs.map} +1 -1
  62. package/dist/chunks/TextDirectionLocale-DB_aqrMg.mjs +2 -0
  63. package/dist/chunks/TextDirectionLocale-DB_aqrMg.mjs.map +1 -0
  64. package/dist/chunks/TypeBrands-Bp_Z_o5Y.mjs +2 -0
  65. package/dist/chunks/{TypeBrands-C09nE2qO.mjs.map → TypeBrands-Bp_Z_o5Y.mjs.map} +1 -1
  66. package/dist/chunks/ar-B93SPJT7.mjs +2 -0
  67. package/dist/chunks/ar-B93SPJT7.mjs.map +1 -0
  68. package/dist/chunks/ar-BAmGa08u.mjs +2 -0
  69. package/dist/chunks/ar-BAmGa08u.mjs.map +1 -0
  70. package/dist/chunks/ar-BYNFEVLc.mjs +2 -0
  71. package/dist/chunks/ar-BYNFEVLc.mjs.map +1 -0
  72. package/dist/chunks/ar-Bnc7y8BP.mjs +2 -0
  73. package/dist/chunks/ar-Bnc7y8BP.mjs.map +1 -0
  74. package/dist/chunks/ar-Bp3rDZky.mjs +2 -0
  75. package/dist/chunks/ar-Bp3rDZky.mjs.map +1 -0
  76. package/dist/chunks/ar-BtOQ7lro.mjs +2 -0
  77. package/dist/chunks/ar-BtOQ7lro.mjs.map +1 -0
  78. package/dist/chunks/ar-C5JEHhw9.mjs +2 -0
  79. package/dist/chunks/ar-C5JEHhw9.mjs.map +1 -0
  80. package/dist/chunks/ar-CL3QL0tw.mjs +2 -0
  81. package/dist/chunks/ar-CL3QL0tw.mjs.map +1 -0
  82. package/dist/chunks/ar-CYtG-XlN.mjs +2 -0
  83. package/dist/chunks/ar-CYtG-XlN.mjs.map +1 -0
  84. package/dist/chunks/ar-CzVj8p__.mjs +2 -0
  85. package/dist/chunks/ar-CzVj8p__.mjs.map +1 -0
  86. package/dist/chunks/ar-D7PS3e2g.mjs +2 -0
  87. package/dist/chunks/ar-D7PS3e2g.mjs.map +1 -0
  88. package/dist/chunks/ar-D8adM2Uy.mjs +2 -0
  89. package/dist/chunks/ar-D8adM2Uy.mjs.map +1 -0
  90. package/dist/chunks/ar-D9jyShaB.mjs +2 -0
  91. package/dist/chunks/ar-D9jyShaB.mjs.map +1 -0
  92. package/dist/chunks/ar-DR6OA3ZO.mjs +2 -0
  93. package/dist/chunks/ar-DR6OA3ZO.mjs.map +1 -0
  94. package/dist/chunks/ar-Deibepjm.mjs +2 -0
  95. package/dist/chunks/ar-Deibepjm.mjs.map +1 -0
  96. package/dist/chunks/ar-Dlb5riUN.mjs +2 -0
  97. package/dist/chunks/ar-Dlb5riUN.mjs.map +1 -0
  98. package/dist/chunks/ar-DmmxE2W7.mjs +2 -0
  99. package/dist/chunks/ar-DmmxE2W7.mjs.map +1 -0
  100. package/dist/chunks/ar-Ds6Z2Gzf.mjs +2 -0
  101. package/dist/chunks/ar-Ds6Z2Gzf.mjs.map +1 -0
  102. package/dist/chunks/ar-DtIHQ8nU.mjs +2 -0
  103. package/dist/chunks/ar-DtIHQ8nU.mjs.map +1 -0
  104. package/dist/chunks/ar-J8B-on-0.mjs +2 -0
  105. package/dist/chunks/ar-J8B-on-0.mjs.map +1 -0
  106. package/dist/chunks/ar-iU02mRe5.mjs +2 -0
  107. package/dist/chunks/ar-iU02mRe5.mjs.map +1 -0
  108. package/dist/chunks/ar-mSCYQYnL.mjs +2 -0
  109. package/dist/chunks/ar-mSCYQYnL.mjs.map +1 -0
  110. package/dist/chunks/color-picker-Byjl_xr9.mjs +2 -0
  111. package/dist/chunks/color-picker-Byjl_xr9.mjs.map +1 -0
  112. package/dist/chunks/de-8aCC5jBM.mjs +2 -0
  113. package/dist/chunks/de-8aCC5jBM.mjs.map +1 -0
  114. package/dist/chunks/de-B4y4ndUw.mjs +2 -0
  115. package/dist/chunks/de-B4y4ndUw.mjs.map +1 -0
  116. package/dist/chunks/de-B5fcZ0FQ.mjs +2 -0
  117. package/dist/chunks/de-B5fcZ0FQ.mjs.map +1 -0
  118. package/dist/chunks/de-BT9VmwoJ.mjs +2 -0
  119. package/dist/chunks/de-BT9VmwoJ.mjs.map +1 -0
  120. package/dist/chunks/de-BZWSyJTG.mjs +2 -0
  121. package/dist/chunks/de-BZWSyJTG.mjs.map +1 -0
  122. package/dist/chunks/de-CFD_Wgik.mjs +2 -0
  123. package/dist/chunks/de-CFD_Wgik.mjs.map +1 -0
  124. package/dist/chunks/de-CLYtb6kD.mjs +2 -0
  125. package/dist/chunks/de-CLYtb6kD.mjs.map +1 -0
  126. package/dist/chunks/de-CP5v-98M.mjs +2 -0
  127. package/dist/chunks/de-CP5v-98M.mjs.map +1 -0
  128. package/dist/chunks/de-CYJ6uWno.mjs +2 -0
  129. package/dist/chunks/de-CYJ6uWno.mjs.map +1 -0
  130. package/dist/chunks/de-ChcKkF7A.mjs +2 -0
  131. package/dist/chunks/de-ChcKkF7A.mjs.map +1 -0
  132. package/dist/chunks/de-CicoU066.mjs +2 -0
  133. package/dist/chunks/de-CicoU066.mjs.map +1 -0
  134. package/dist/chunks/de-CjLAdBt2.mjs +2 -0
  135. package/dist/chunks/de-CjLAdBt2.mjs.map +1 -0
  136. package/dist/chunks/de-CtFvAXwF.mjs +2 -0
  137. package/dist/chunks/de-CtFvAXwF.mjs.map +1 -0
  138. package/dist/chunks/de-D1OAXtxJ.mjs +2 -0
  139. package/dist/chunks/de-D1OAXtxJ.mjs.map +1 -0
  140. package/dist/chunks/de-DBbzCQrm.mjs +2 -0
  141. package/dist/chunks/de-DBbzCQrm.mjs.map +1 -0
  142. package/dist/chunks/de-DOLwx_M7.mjs +2 -0
  143. package/dist/chunks/de-DOLwx_M7.mjs.map +1 -0
  144. package/dist/chunks/de-De2miMxo.mjs +2 -0
  145. package/dist/chunks/de-De2miMxo.mjs.map +1 -0
  146. package/dist/chunks/de-OTfhhinm.mjs +2 -0
  147. package/dist/chunks/de-OTfhhinm.mjs.map +1 -0
  148. package/dist/chunks/de-PZ9-LlBp.mjs +2 -0
  149. package/dist/chunks/de-PZ9-LlBp.mjs.map +1 -0
  150. package/dist/chunks/de-UREymH-5.mjs +2 -0
  151. package/dist/chunks/de-UREymH-5.mjs.map +1 -0
  152. package/dist/chunks/de-chYdoK9q.mjs +2 -0
  153. package/dist/chunks/de-chYdoK9q.mjs.map +1 -0
  154. package/dist/chunks/de-xJh5C_pk.mjs +2 -0
  155. package/dist/chunks/de-xJh5C_pk.mjs.map +1 -0
  156. package/dist/chunks/es-B9UhsaEI.mjs +2 -0
  157. package/dist/chunks/es-B9UhsaEI.mjs.map +1 -0
  158. package/dist/chunks/es-BHGwPgrP.mjs +2 -0
  159. package/dist/chunks/es-BHGwPgrP.mjs.map +1 -0
  160. package/dist/chunks/es-BbGOZGS_.mjs +2 -0
  161. package/dist/chunks/es-BbGOZGS_.mjs.map +1 -0
  162. package/dist/chunks/es-BjPsub0k.mjs +2 -0
  163. package/dist/chunks/es-BjPsub0k.mjs.map +1 -0
  164. package/dist/chunks/es-Bk0bRDFE.mjs +2 -0
  165. package/dist/chunks/es-Bk0bRDFE.mjs.map +1 -0
  166. package/dist/chunks/es-BkS6DsrM.mjs +2 -0
  167. package/dist/chunks/es-BkS6DsrM.mjs.map +1 -0
  168. package/dist/chunks/es-BzEpr4Bk.mjs +2 -0
  169. package/dist/chunks/es-BzEpr4Bk.mjs.map +1 -0
  170. package/dist/chunks/es-C2lnWyA0.mjs +2 -0
  171. package/dist/chunks/es-C2lnWyA0.mjs.map +1 -0
  172. package/dist/chunks/es-C7e35Muh.mjs +2 -0
  173. package/dist/chunks/es-C7e35Muh.mjs.map +1 -0
  174. package/dist/chunks/es-CBk43isB.mjs +2 -0
  175. package/dist/chunks/es-CBk43isB.mjs.map +1 -0
  176. package/dist/chunks/es-CE8t9fuM.mjs +2 -0
  177. package/dist/chunks/es-CE8t9fuM.mjs.map +1 -0
  178. package/dist/chunks/es-CFjzqIbS.mjs +2 -0
  179. package/dist/chunks/es-CFjzqIbS.mjs.map +1 -0
  180. package/dist/chunks/es-Ce-AEYxc.mjs +2 -0
  181. package/dist/chunks/es-Ce-AEYxc.mjs.map +1 -0
  182. package/dist/chunks/es-Co4AJr8Y.mjs +2 -0
  183. package/dist/chunks/es-Co4AJr8Y.mjs.map +1 -0
  184. package/dist/chunks/es-Cu5_OA4X.mjs +2 -0
  185. package/dist/chunks/es-Cu5_OA4X.mjs.map +1 -0
  186. package/dist/chunks/es-Cud6JXHf.mjs +2 -0
  187. package/dist/chunks/es-Cud6JXHf.mjs.map +1 -0
  188. package/dist/chunks/es-D-II7LZC.mjs +2 -0
  189. package/dist/chunks/es-D-II7LZC.mjs.map +1 -0
  190. package/dist/chunks/es-DBBSeOaD.mjs +2 -0
  191. package/dist/chunks/es-DBBSeOaD.mjs.map +1 -0
  192. package/dist/chunks/es-DCwjeUUu.mjs +2 -0
  193. package/dist/chunks/es-DCwjeUUu.mjs.map +1 -0
  194. package/dist/chunks/es-DvgH3-WZ.mjs +2 -0
  195. package/dist/chunks/es-DvgH3-WZ.mjs.map +1 -0
  196. package/dist/chunks/es-MgguVgIs.mjs +2 -0
  197. package/dist/chunks/es-MgguVgIs.mjs.map +1 -0
  198. package/dist/chunks/es-yXjjcxgb.mjs +2 -0
  199. package/dist/chunks/es-yXjjcxgb.mjs.map +1 -0
  200. package/dist/chunks/fr-B-_yKIAY.mjs +2 -0
  201. package/dist/chunks/fr-B-_yKIAY.mjs.map +1 -0
  202. package/dist/chunks/fr-BGyF2ym0.mjs +2 -0
  203. package/dist/chunks/fr-BGyF2ym0.mjs.map +1 -0
  204. package/dist/chunks/fr-BoRJ3B2-.mjs +2 -0
  205. package/dist/chunks/fr-BoRJ3B2-.mjs.map +1 -0
  206. package/dist/chunks/fr-BrKk4SPg.mjs +2 -0
  207. package/dist/chunks/fr-BrKk4SPg.mjs.map +1 -0
  208. package/dist/chunks/fr-C-y09LKg.mjs +2 -0
  209. package/dist/chunks/fr-C-y09LKg.mjs.map +1 -0
  210. package/dist/chunks/fr-C1W7jyd6.mjs +2 -0
  211. package/dist/chunks/fr-C1W7jyd6.mjs.map +1 -0
  212. package/dist/chunks/fr-C8CtmWBj.mjs +2 -0
  213. package/dist/chunks/fr-C8CtmWBj.mjs.map +1 -0
  214. package/dist/chunks/fr-C9oiPW0k.mjs +2 -0
  215. package/dist/chunks/fr-C9oiPW0k.mjs.map +1 -0
  216. package/dist/chunks/fr-CEkk4UyZ.mjs +2 -0
  217. package/dist/chunks/fr-CEkk4UyZ.mjs.map +1 -0
  218. package/dist/chunks/fr-Ccaetiwi.mjs +2 -0
  219. package/dist/chunks/fr-Ccaetiwi.mjs.map +1 -0
  220. package/dist/chunks/fr-Ccku5KzA.mjs +2 -0
  221. package/dist/chunks/fr-Ccku5KzA.mjs.map +1 -0
  222. package/dist/chunks/fr-CfUg1FxU.mjs +2 -0
  223. package/dist/chunks/fr-CfUg1FxU.mjs.map +1 -0
  224. package/dist/chunks/fr-DDkBcjmO.mjs +2 -0
  225. package/dist/chunks/fr-DDkBcjmO.mjs.map +1 -0
  226. package/dist/chunks/fr-DNwLChcm.mjs +2 -0
  227. package/dist/chunks/fr-DNwLChcm.mjs.map +1 -0
  228. package/dist/chunks/fr-DvneSjCf.mjs +2 -0
  229. package/dist/chunks/fr-DvneSjCf.mjs.map +1 -0
  230. package/dist/chunks/fr-Dx4Qqimj.mjs +2 -0
  231. package/dist/chunks/fr-Dx4Qqimj.mjs.map +1 -0
  232. package/dist/chunks/fr-RHXmueoO.mjs +2 -0
  233. package/dist/chunks/fr-RHXmueoO.mjs.map +1 -0
  234. package/dist/chunks/fr-Wiobfk5s.mjs +2 -0
  235. package/dist/chunks/fr-Wiobfk5s.mjs.map +1 -0
  236. package/dist/chunks/fr-YMiDtWuG.mjs +2 -0
  237. package/dist/chunks/fr-YMiDtWuG.mjs.map +1 -0
  238. package/dist/chunks/fr-_Oxf0k66.mjs +2 -0
  239. package/dist/chunks/fr-_Oxf0k66.mjs.map +1 -0
  240. package/dist/chunks/fr-gurfH-7T.mjs +2 -0
  241. package/dist/chunks/fr-gurfH-7T.mjs.map +1 -0
  242. package/dist/chunks/fr-zP7EjxDL.mjs +2 -0
  243. package/dist/chunks/fr-zP7EjxDL.mjs.map +1 -0
  244. package/dist/chunks/hi-B2W8pFqK.mjs +2 -0
  245. package/dist/chunks/hi-B2W8pFqK.mjs.map +1 -0
  246. package/dist/chunks/hi-B2m69ZCq.mjs +2 -0
  247. package/dist/chunks/hi-B2m69ZCq.mjs.map +1 -0
  248. package/dist/chunks/hi-BMIt3y_-.mjs +2 -0
  249. package/dist/chunks/hi-BMIt3y_-.mjs.map +1 -0
  250. package/dist/chunks/hi-BmkfaZpg.mjs +2 -0
  251. package/dist/chunks/hi-BmkfaZpg.mjs.map +1 -0
  252. package/dist/chunks/hi-C-l_R2SO.mjs +2 -0
  253. package/dist/chunks/hi-C-l_R2SO.mjs.map +1 -0
  254. package/dist/chunks/hi-C1LhM-oY.mjs +2 -0
  255. package/dist/chunks/hi-C1LhM-oY.mjs.map +1 -0
  256. package/dist/chunks/hi-CGEbGI1l.mjs +2 -0
  257. package/dist/chunks/hi-CGEbGI1l.mjs.map +1 -0
  258. package/dist/chunks/hi-CPuhj7IA.mjs +2 -0
  259. package/dist/chunks/hi-CPuhj7IA.mjs.map +1 -0
  260. package/dist/chunks/hi-CT5WERqi.mjs +2 -0
  261. package/dist/chunks/hi-CT5WERqi.mjs.map +1 -0
  262. package/dist/chunks/hi-CbLPPQ0b.mjs +2 -0
  263. package/dist/chunks/hi-CbLPPQ0b.mjs.map +1 -0
  264. package/dist/chunks/hi-ClvEtEKe.mjs +2 -0
  265. package/dist/chunks/hi-ClvEtEKe.mjs.map +1 -0
  266. package/dist/chunks/hi-CpBWHmYH.mjs +2 -0
  267. package/dist/chunks/hi-CpBWHmYH.mjs.map +1 -0
  268. package/dist/chunks/hi-DAfl8nU_.mjs +2 -0
  269. package/dist/chunks/hi-DAfl8nU_.mjs.map +1 -0
  270. package/dist/chunks/hi-DVof3w0y.mjs +2 -0
  271. package/dist/chunks/hi-DVof3w0y.mjs.map +1 -0
  272. package/dist/chunks/hi-DtlvSQkD.mjs +2 -0
  273. package/dist/chunks/hi-DtlvSQkD.mjs.map +1 -0
  274. package/dist/chunks/hi-FH3CAJuR.mjs +2 -0
  275. package/dist/chunks/hi-FH3CAJuR.mjs.map +1 -0
  276. package/dist/chunks/hi-Ga9h9a_1.mjs +2 -0
  277. package/dist/chunks/hi-Ga9h9a_1.mjs.map +1 -0
  278. package/dist/chunks/hi-Zc17M1T-.mjs +2 -0
  279. package/dist/chunks/hi-Zc17M1T-.mjs.map +1 -0
  280. package/dist/chunks/hi-g7i0bmig.mjs +2 -0
  281. package/dist/chunks/hi-g7i0bmig.mjs.map +1 -0
  282. package/dist/chunks/hi-js2P6byR.mjs +2 -0
  283. package/dist/chunks/hi-js2P6byR.mjs.map +1 -0
  284. package/dist/chunks/hi-ntUsOspQ.mjs +2 -0
  285. package/dist/chunks/hi-ntUsOspQ.mjs.map +1 -0
  286. package/dist/chunks/hi-yxAcR3w6.mjs +2 -0
  287. package/dist/chunks/hi-yxAcR3w6.mjs.map +1 -0
  288. package/dist/chunks/index-C8xtb3SM.mjs +2 -0
  289. package/dist/chunks/index-C8xtb3SM.mjs.map +1 -0
  290. package/dist/chunks/index-DAoSt12h.mjs +2 -0
  291. package/dist/chunks/index-DAoSt12h.mjs.map +1 -0
  292. package/dist/chunks/pt--IiroJQw.mjs +2 -0
  293. package/dist/chunks/pt--IiroJQw.mjs.map +1 -0
  294. package/dist/chunks/pt-BF72W8M5.mjs +2 -0
  295. package/dist/chunks/pt-BF72W8M5.mjs.map +1 -0
  296. package/dist/chunks/pt-BX_t4luI.mjs +2 -0
  297. package/dist/chunks/pt-BX_t4luI.mjs.map +1 -0
  298. package/dist/chunks/pt-B_XJ2s9X.mjs +2 -0
  299. package/dist/chunks/pt-B_XJ2s9X.mjs.map +1 -0
  300. package/dist/chunks/pt-C-Vp7Rxj.mjs +2 -0
  301. package/dist/chunks/pt-C-Vp7Rxj.mjs.map +1 -0
  302. package/dist/chunks/pt-CD2aCZXf.mjs +2 -0
  303. package/dist/chunks/pt-CD2aCZXf.mjs.map +1 -0
  304. package/dist/chunks/pt-CFjzqIbS.mjs +2 -0
  305. package/dist/chunks/pt-CFjzqIbS.mjs.map +1 -0
  306. package/dist/chunks/pt-CHjmBegF.mjs +2 -0
  307. package/dist/chunks/pt-CHjmBegF.mjs.map +1 -0
  308. package/dist/chunks/pt-CQRzEocL.mjs +2 -0
  309. package/dist/chunks/pt-CQRzEocL.mjs.map +1 -0
  310. package/dist/chunks/pt-Cem2WxUk.mjs +2 -0
  311. package/dist/chunks/pt-Cem2WxUk.mjs.map +1 -0
  312. package/dist/chunks/pt-D6kdF3fH.mjs +2 -0
  313. package/dist/chunks/pt-D6kdF3fH.mjs.map +1 -0
  314. package/dist/chunks/pt-DJfJVeY8.mjs +2 -0
  315. package/dist/chunks/pt-DJfJVeY8.mjs.map +1 -0
  316. package/dist/chunks/pt-DfB-IaYi.mjs +2 -0
  317. package/dist/chunks/pt-DfB-IaYi.mjs.map +1 -0
  318. package/dist/chunks/pt-DlNdH9pu.mjs +2 -0
  319. package/dist/chunks/pt-DlNdH9pu.mjs.map +1 -0
  320. package/dist/chunks/pt-DrJ0-8Yo.mjs +2 -0
  321. package/dist/chunks/pt-DrJ0-8Yo.mjs.map +1 -0
  322. package/dist/chunks/pt-DsBJpgpe.mjs +2 -0
  323. package/dist/chunks/pt-DsBJpgpe.mjs.map +1 -0
  324. package/dist/chunks/pt-DwdSYJzC.mjs +2 -0
  325. package/dist/chunks/pt-DwdSYJzC.mjs.map +1 -0
  326. package/dist/chunks/pt-Dx9UkZ3j.mjs +2 -0
  327. package/dist/chunks/pt-Dx9UkZ3j.mjs.map +1 -0
  328. package/dist/chunks/pt-TuA3_GDM.mjs +2 -0
  329. package/dist/chunks/pt-TuA3_GDM.mjs.map +1 -0
  330. package/dist/chunks/pt-cN6r-f7f.mjs +2 -0
  331. package/dist/chunks/pt-cN6r-f7f.mjs.map +1 -0
  332. package/dist/chunks/pt-uNGpVM3D.mjs +2 -0
  333. package/dist/chunks/pt-uNGpVM3D.mjs.map +1 -0
  334. package/dist/chunks/pt-v1E9u-Jx.mjs +2 -0
  335. package/dist/chunks/pt-v1E9u-Jx.mjs.map +1 -0
  336. package/dist/chunks/ru-0h51zrqE.mjs +2 -0
  337. package/dist/chunks/ru-0h51zrqE.mjs.map +1 -0
  338. package/dist/chunks/ru-4S8w6UN_.mjs +2 -0
  339. package/dist/chunks/ru-4S8w6UN_.mjs.map +1 -0
  340. package/dist/chunks/ru-B0cRw90L.mjs +2 -0
  341. package/dist/chunks/ru-B0cRw90L.mjs.map +1 -0
  342. package/dist/chunks/ru-B3O7WXNM.mjs +2 -0
  343. package/dist/chunks/ru-B3O7WXNM.mjs.map +1 -0
  344. package/dist/chunks/ru-B6zVAzvI.mjs +2 -0
  345. package/dist/chunks/ru-B6zVAzvI.mjs.map +1 -0
  346. package/dist/chunks/ru-B8teJin_.mjs +2 -0
  347. package/dist/chunks/ru-B8teJin_.mjs.map +1 -0
  348. package/dist/chunks/ru-BCriPw-8.mjs +2 -0
  349. package/dist/chunks/ru-BCriPw-8.mjs.map +1 -0
  350. package/dist/chunks/ru-BNOU16E5.mjs +2 -0
  351. package/dist/chunks/ru-BNOU16E5.mjs.map +1 -0
  352. package/dist/chunks/ru-BO6BIS5W.mjs +2 -0
  353. package/dist/chunks/ru-BO6BIS5W.mjs.map +1 -0
  354. package/dist/chunks/ru-Bdy1lLuc.mjs +2 -0
  355. package/dist/chunks/ru-Bdy1lLuc.mjs.map +1 -0
  356. package/dist/chunks/ru-BgBctNVm.mjs +2 -0
  357. package/dist/chunks/ru-BgBctNVm.mjs.map +1 -0
  358. package/dist/chunks/ru-CNLx7T3O.mjs +2 -0
  359. package/dist/chunks/ru-CNLx7T3O.mjs.map +1 -0
  360. package/dist/chunks/ru-CVSCT776.mjs +2 -0
  361. package/dist/chunks/ru-CVSCT776.mjs.map +1 -0
  362. package/dist/chunks/ru-CZvkdGnf.mjs +2 -0
  363. package/dist/chunks/ru-CZvkdGnf.mjs.map +1 -0
  364. package/dist/chunks/ru-CegMPuML.mjs +2 -0
  365. package/dist/chunks/ru-CegMPuML.mjs.map +1 -0
  366. package/dist/chunks/ru-CiLrD2Nz.mjs +2 -0
  367. package/dist/chunks/ru-CiLrD2Nz.mjs.map +1 -0
  368. package/dist/chunks/ru-ClEM6OKY.mjs +2 -0
  369. package/dist/chunks/ru-ClEM6OKY.mjs.map +1 -0
  370. package/dist/chunks/ru-CrbxCeQf.mjs +2 -0
  371. package/dist/chunks/ru-CrbxCeQf.mjs.map +1 -0
  372. package/dist/chunks/ru-D3j2x2xu.mjs +2 -0
  373. package/dist/chunks/ru-D3j2x2xu.mjs.map +1 -0
  374. package/dist/chunks/ru-DdHqb4Mh.mjs +2 -0
  375. package/dist/chunks/ru-DdHqb4Mh.mjs.map +1 -0
  376. package/dist/chunks/ru-DjgNdOdJ.mjs +2 -0
  377. package/dist/chunks/ru-DjgNdOdJ.mjs.map +1 -0
  378. package/dist/chunks/ru-XKNCzkR2.mjs +2 -0
  379. package/dist/chunks/ru-XKNCzkR2.mjs.map +1 -0
  380. package/dist/chunks/zh--oNSMazK.mjs +2 -0
  381. package/dist/chunks/zh--oNSMazK.mjs.map +1 -0
  382. package/dist/chunks/zh-BfeWdPIz.mjs +2 -0
  383. package/dist/chunks/zh-BfeWdPIz.mjs.map +1 -0
  384. package/dist/chunks/zh-BnOxGKxF.mjs +2 -0
  385. package/dist/chunks/zh-BnOxGKxF.mjs.map +1 -0
  386. package/dist/chunks/zh-BqMtE-jN.mjs +2 -0
  387. package/dist/chunks/zh-BqMtE-jN.mjs.map +1 -0
  388. package/dist/chunks/zh-C3aI7A2o.mjs +2 -0
  389. package/dist/chunks/zh-C3aI7A2o.mjs.map +1 -0
  390. package/dist/chunks/zh-C6YALJZt.mjs +2 -0
  391. package/dist/chunks/zh-C6YALJZt.mjs.map +1 -0
  392. package/dist/chunks/zh-CWdTbUOP.mjs +2 -0
  393. package/dist/chunks/zh-CWdTbUOP.mjs.map +1 -0
  394. package/dist/chunks/zh-CY01pMD4.mjs +2 -0
  395. package/dist/chunks/zh-CY01pMD4.mjs.map +1 -0
  396. package/dist/chunks/zh-Cmt7n9FY.mjs +2 -0
  397. package/dist/chunks/zh-Cmt7n9FY.mjs.map +1 -0
  398. package/dist/chunks/zh-CpP2kee3.mjs +2 -0
  399. package/dist/chunks/zh-CpP2kee3.mjs.map +1 -0
  400. package/dist/chunks/zh-Cpbg4evx.mjs +2 -0
  401. package/dist/chunks/zh-Cpbg4evx.mjs.map +1 -0
  402. package/dist/chunks/zh-Cqb55JWa.mjs +2 -0
  403. package/dist/chunks/zh-Cqb55JWa.mjs.map +1 -0
  404. package/dist/chunks/zh-DCQZ6gss.mjs +2 -0
  405. package/dist/chunks/zh-DCQZ6gss.mjs.map +1 -0
  406. package/dist/chunks/zh-DG2CNTUU.mjs +2 -0
  407. package/dist/chunks/zh-DG2CNTUU.mjs.map +1 -0
  408. package/dist/chunks/zh-DTiTJbzz.mjs +2 -0
  409. package/dist/chunks/zh-DTiTJbzz.mjs.map +1 -0
  410. package/dist/chunks/zh-Da1z6qbB.mjs +2 -0
  411. package/dist/chunks/zh-Da1z6qbB.mjs.map +1 -0
  412. package/dist/chunks/zh-DlBt06Pr.mjs +2 -0
  413. package/dist/chunks/zh-DlBt06Pr.mjs.map +1 -0
  414. package/dist/chunks/zh-Dt-wVrNr.mjs +2 -0
  415. package/dist/chunks/zh-Dt-wVrNr.mjs.map +1 -0
  416. package/dist/chunks/zh-ND6vW2M-.mjs +2 -0
  417. package/dist/chunks/zh-ND6vW2M-.mjs.map +1 -0
  418. package/dist/chunks/zh-Yd3GNsa0.mjs +2 -0
  419. package/dist/chunks/zh-Yd3GNsa0.mjs.map +1 -0
  420. package/dist/chunks/zh-lhynyH6Q.mjs +2 -0
  421. package/dist/chunks/zh-lhynyH6Q.mjs.map +1 -0
  422. package/dist/chunks/zh-v9NmlEIN.mjs +2 -0
  423. package/dist/chunks/zh-v9NmlEIN.mjs.map +1 -0
  424. package/dist/commands/Commands.d.ts +9 -3
  425. package/dist/commands/Commands.d.ts.map +1 -1
  426. package/dist/commands/GapCursorCommands.d.ts.map +1 -1
  427. package/dist/commands/MovementCommands.d.ts +1 -4
  428. package/dist/commands/MovementCommands.d.ts.map +1 -1
  429. package/dist/commands/NodeSelectionCommands.d.ts +3 -1
  430. package/dist/commands/NodeSelectionCommands.d.ts.map +1 -1
  431. package/dist/commands/WordBoundary.d.ts +4 -9
  432. package/dist/commands/WordBoundary.d.ts.map +1 -1
  433. package/dist/editor/Announcer.d.ts +1 -2
  434. package/dist/editor/Announcer.d.ts.map +1 -1
  435. package/dist/{model → editor}/BuiltinSpecs.d.ts +1 -1
  436. package/dist/editor/BuiltinSpecs.d.ts.map +1 -0
  437. package/dist/editor/ContentSerializer.d.ts +24 -0
  438. package/dist/editor/ContentSerializer.d.ts.map +1 -0
  439. package/dist/editor/EditorConfigController.d.ts +38 -0
  440. package/dist/editor/EditorConfigController.d.ts.map +1 -0
  441. package/dist/editor/EditorDOM.d.ts +3 -4
  442. package/dist/editor/EditorDOM.d.ts.map +1 -1
  443. package/dist/editor/EditorEventEmitter.d.ts +30 -0
  444. package/dist/editor/EditorEventEmitter.d.ts.map +1 -0
  445. package/dist/editor/EditorLifecycleCoordinator.d.ts +24 -0
  446. package/dist/editor/EditorLifecycleCoordinator.d.ts.map +1 -0
  447. package/dist/editor/EditorLocale.d.ts +9 -0
  448. package/dist/editor/EditorLocale.d.ts.map +1 -0
  449. package/dist/editor/EditorStyleCoordinator.d.ts +9 -0
  450. package/dist/editor/EditorStyleCoordinator.d.ts.map +1 -0
  451. package/dist/editor/NotectlEditor.d.ts +20 -54
  452. package/dist/editor/NotectlEditor.d.ts.map +1 -1
  453. package/dist/editor/PaperLayoutController.d.ts +1 -1
  454. package/dist/editor/PaperLayoutController.d.ts.map +1 -1
  455. package/dist/editor/PluginBootstrapper.d.ts +18 -0
  456. package/dist/editor/PluginBootstrapper.d.ts.map +1 -0
  457. package/dist/editor/locales/ar.d.ts +4 -0
  458. package/dist/editor/locales/ar.d.ts.map +1 -0
  459. package/dist/editor/locales/de.d.ts +4 -0
  460. package/dist/editor/locales/de.d.ts.map +1 -0
  461. package/dist/editor/locales/es.d.ts +4 -0
  462. package/dist/editor/locales/es.d.ts.map +1 -0
  463. package/dist/editor/locales/fr.d.ts +4 -0
  464. package/dist/editor/locales/fr.d.ts.map +1 -0
  465. package/dist/editor/locales/hi.d.ts +4 -0
  466. package/dist/editor/locales/hi.d.ts.map +1 -0
  467. package/dist/editor/locales/pt.d.ts +4 -0
  468. package/dist/editor/locales/pt.d.ts.map +1 -0
  469. package/dist/editor/locales/ru.d.ts +4 -0
  470. package/dist/editor/locales/ru.d.ts.map +1 -0
  471. package/dist/editor/locales/zh.d.ts +4 -0
  472. package/dist/editor/locales/zh.d.ts.map +1 -0
  473. package/dist/editor/styles/base.d.ts +1 -1
  474. package/dist/editor/styles/base.d.ts.map +1 -1
  475. package/dist/editor/styles/code-block.d.ts +1 -1
  476. package/dist/editor/styles/code-block.d.ts.map +1 -1
  477. package/dist/editor/styles/font-select.d.ts +1 -1
  478. package/dist/editor/styles/font-select.d.ts.map +1 -1
  479. package/dist/editor/styles/font-size-select.d.ts +1 -1
  480. package/dist/editor/styles/font-size-select.d.ts.map +1 -1
  481. package/dist/editor/styles/heading-select.d.ts +1 -1
  482. package/dist/editor/styles/heading-select.d.ts.map +1 -1
  483. package/dist/editor/styles/image.d.ts +1 -1
  484. package/dist/editor/styles/image.d.ts.map +1 -1
  485. package/dist/editor/styles/list.d.ts +1 -1
  486. package/dist/editor/styles/list.d.ts.map +1 -1
  487. package/dist/editor/styles/table.d.ts +1 -1
  488. package/dist/editor/styles/table.d.ts.map +1 -1
  489. package/dist/editor/styles/toolbar.d.ts +1 -1
  490. package/dist/editor/styles/toolbar.d.ts.map +1 -1
  491. package/dist/fonts.mjs +1 -6
  492. package/dist/fonts.mjs.map +1 -1
  493. package/dist/full.d.ts +45 -0
  494. package/dist/full.d.ts.map +1 -0
  495. package/dist/full.mjs +2 -0
  496. package/dist/full.mjs.map +1 -0
  497. package/dist/html.d.ts +16 -0
  498. package/dist/html.d.ts.map +1 -0
  499. package/dist/html.mjs +2 -0
  500. package/dist/html.mjs.map +1 -0
  501. package/dist/i18n/Locale.d.ts +1 -0
  502. package/dist/i18n/Locale.d.ts.map +1 -1
  503. package/dist/i18n/index.d.ts +0 -1
  504. package/dist/i18n/index.d.ts.map +1 -1
  505. package/dist/index.d.ts +29 -93
  506. package/dist/index.d.ts.map +1 -1
  507. package/dist/input/BlockInsertion.d.ts +51 -0
  508. package/dist/input/BlockInsertion.d.ts.map +1 -0
  509. package/dist/input/ClipboardHandler.d.ts +22 -0
  510. package/dist/input/ClipboardHandler.d.ts.map +1 -1
  511. package/dist/input/CompositionTracker.d.ts +2 -1
  512. package/dist/input/CompositionTracker.d.ts.map +1 -1
  513. package/dist/{model → input}/HTMLParser.d.ts +3 -3
  514. package/dist/input/HTMLParser.d.ts.map +1 -0
  515. package/dist/input/InputHandler.d.ts +1 -1
  516. package/dist/input/InputHandler.d.ts.map +1 -1
  517. package/dist/input/InputManager.d.ts +35 -0
  518. package/dist/input/InputManager.d.ts.map +1 -0
  519. package/dist/input/InternalClipboard.d.ts +11 -1
  520. package/dist/input/InternalClipboard.d.ts.map +1 -1
  521. package/dist/input/KeyboardHandler.d.ts +12 -1
  522. package/dist/input/KeyboardHandler.d.ts.map +1 -1
  523. package/dist/input/PasteHandler.d.ts +21 -17
  524. package/dist/input/PasteHandler.d.ts.map +1 -1
  525. package/dist/model/AttrRegistry.d.ts +1 -1
  526. package/dist/model/AttrRegistry.d.ts.map +1 -1
  527. package/dist/model/BlockAlignment.d.ts +8 -0
  528. package/dist/model/BlockAlignment.d.ts.map +1 -0
  529. package/dist/model/BlockTypeLabels.d.ts +7 -0
  530. package/dist/model/BlockTypeLabels.d.ts.map +1 -0
  531. package/dist/model/CompositionState.d.ts +8 -0
  532. package/dist/model/CompositionState.d.ts.map +1 -0
  533. package/dist/{input → model}/FileHandlerRegistry.d.ts +1 -1
  534. package/dist/{input → model}/FileHandlerRegistry.d.ts.map +1 -1
  535. package/dist/model/HTMLUtils.d.ts +6 -0
  536. package/dist/model/HTMLUtils.d.ts.map +1 -1
  537. package/dist/{input → model}/InputRule.d.ts.map +1 -1
  538. package/dist/{input → model}/InputRuleRegistry.d.ts.map +1 -1
  539. package/dist/{input → model}/Keymap.d.ts.map +1 -1
  540. package/dist/{input → model}/KeymapRegistry.d.ts.map +1 -1
  541. package/dist/model/MarkSpec.d.ts +2 -2
  542. package/dist/model/MarkSpec.d.ts.map +1 -1
  543. package/dist/model/NodeSpec.d.ts +0 -3
  544. package/dist/model/NodeSpec.d.ts.map +1 -1
  545. package/dist/model/PaperSize.d.ts.map +1 -0
  546. package/dist/model/WordBoundary.d.ts +12 -0
  547. package/dist/model/WordBoundary.d.ts.map +1 -0
  548. package/dist/notectl-core.mjs +1 -3888
  549. package/dist/notectl-core.mjs.map +1 -1
  550. package/dist/notectl-core.umd.js +1 -9523
  551. package/dist/notectl-core.umd.js.map +1 -1
  552. package/dist/{view → platform}/Platform.d.ts +2 -0
  553. package/dist/platform/Platform.d.ts.map +1 -0
  554. package/dist/plugins/Plugin.d.ts +5 -5
  555. package/dist/plugins/Plugin.d.ts.map +1 -1
  556. package/dist/plugins/PluginManager.d.ts +3 -3
  557. package/dist/plugins/alignment/AlignmentLocale.d.ts +3 -10
  558. package/dist/plugins/alignment/AlignmentLocale.d.ts.map +1 -1
  559. package/dist/plugins/alignment/AlignmentPlugin.d.ts +3 -13
  560. package/dist/plugins/alignment/AlignmentPlugin.d.ts.map +1 -1
  561. package/dist/plugins/alignment/index.d.ts +3 -1
  562. package/dist/plugins/alignment/index.d.ts.map +1 -1
  563. package/dist/plugins/alignment/locales/ar.d.ts +4 -0
  564. package/dist/plugins/alignment/locales/ar.d.ts.map +1 -0
  565. package/dist/plugins/alignment/locales/de.d.ts +4 -0
  566. package/dist/plugins/alignment/locales/de.d.ts.map +1 -0
  567. package/dist/plugins/alignment/locales/es.d.ts +4 -0
  568. package/dist/plugins/alignment/locales/es.d.ts.map +1 -0
  569. package/dist/plugins/alignment/locales/fr.d.ts +4 -0
  570. package/dist/plugins/alignment/locales/fr.d.ts.map +1 -0
  571. package/dist/plugins/alignment/locales/hi.d.ts +4 -0
  572. package/dist/plugins/alignment/locales/hi.d.ts.map +1 -0
  573. package/dist/plugins/alignment/locales/pt.d.ts +4 -0
  574. package/dist/plugins/alignment/locales/pt.d.ts.map +1 -0
  575. package/dist/plugins/alignment/locales/ru.d.ts +4 -0
  576. package/dist/plugins/alignment/locales/ru.d.ts.map +1 -0
  577. package/dist/plugins/alignment/locales/zh.d.ts +4 -0
  578. package/dist/plugins/alignment/locales/zh.d.ts.map +1 -0
  579. package/dist/plugins/alignment.mjs +1 -5
  580. package/dist/plugins/alignment.mjs.map +1 -1
  581. package/dist/plugins/blockquote/BlockquoteKeyboardHandlers.d.ts +4 -0
  582. package/dist/plugins/blockquote/BlockquoteKeyboardHandlers.d.ts.map +1 -0
  583. package/dist/plugins/blockquote/BlockquoteLocale.d.ts +1 -8
  584. package/dist/plugins/blockquote/BlockquoteLocale.d.ts.map +1 -1
  585. package/dist/plugins/blockquote/BlockquotePlugin.d.ts +1 -3
  586. package/dist/plugins/blockquote/BlockquotePlugin.d.ts.map +1 -1
  587. package/dist/plugins/blockquote/BlockquoteStyles.d.ts +3 -0
  588. package/dist/plugins/blockquote/BlockquoteStyles.d.ts.map +1 -0
  589. package/dist/plugins/blockquote/index.d.ts +2 -0
  590. package/dist/plugins/blockquote/index.d.ts.map +1 -1
  591. package/dist/plugins/blockquote/locales/ar.d.ts +4 -0
  592. package/dist/plugins/blockquote/locales/ar.d.ts.map +1 -0
  593. package/dist/plugins/blockquote/locales/de.d.ts +4 -0
  594. package/dist/plugins/blockquote/locales/de.d.ts.map +1 -0
  595. package/dist/plugins/blockquote/locales/es.d.ts +4 -0
  596. package/dist/plugins/blockquote/locales/es.d.ts.map +1 -0
  597. package/dist/plugins/blockquote/locales/fr.d.ts +4 -0
  598. package/dist/plugins/blockquote/locales/fr.d.ts.map +1 -0
  599. package/dist/plugins/blockquote/locales/hi.d.ts +4 -0
  600. package/dist/plugins/blockquote/locales/hi.d.ts.map +1 -0
  601. package/dist/plugins/blockquote/locales/pt.d.ts +4 -0
  602. package/dist/plugins/blockquote/locales/pt.d.ts.map +1 -0
  603. package/dist/plugins/blockquote/locales/ru.d.ts +4 -0
  604. package/dist/plugins/blockquote/locales/ru.d.ts.map +1 -0
  605. package/dist/plugins/blockquote/locales/zh.d.ts +4 -0
  606. package/dist/plugins/blockquote/locales/zh.d.ts.map +1 -0
  607. package/dist/plugins/blockquote.mjs +1 -4
  608. package/dist/plugins/blockquote.mjs.map +1 -1
  609. package/dist/plugins/caret-navigation/CaretNavigationLocale.d.ts +21 -0
  610. package/dist/plugins/caret-navigation/CaretNavigationLocale.d.ts.map +1 -0
  611. package/dist/plugins/caret-navigation/CaretNavigationPlugin.d.ts +2 -1
  612. package/dist/plugins/caret-navigation/CaretNavigationPlugin.d.ts.map +1 -1
  613. package/dist/plugins/caret-navigation/index.d.ts +2 -0
  614. package/dist/plugins/caret-navigation/index.d.ts.map +1 -1
  615. package/dist/plugins/caret-navigation/locales/ar.d.ts +4 -0
  616. package/dist/plugins/caret-navigation/locales/ar.d.ts.map +1 -0
  617. package/dist/plugins/caret-navigation/locales/de.d.ts +4 -0
  618. package/dist/plugins/caret-navigation/locales/de.d.ts.map +1 -0
  619. package/dist/plugins/caret-navigation/locales/es.d.ts +4 -0
  620. package/dist/plugins/caret-navigation/locales/es.d.ts.map +1 -0
  621. package/dist/plugins/caret-navigation/locales/fr.d.ts +4 -0
  622. package/dist/plugins/caret-navigation/locales/fr.d.ts.map +1 -0
  623. package/dist/plugins/caret-navigation/locales/hi.d.ts +4 -0
  624. package/dist/plugins/caret-navigation/locales/hi.d.ts.map +1 -0
  625. package/dist/plugins/caret-navigation/locales/pt.d.ts +4 -0
  626. package/dist/plugins/caret-navigation/locales/pt.d.ts.map +1 -0
  627. package/dist/plugins/caret-navigation/locales/ru.d.ts +4 -0
  628. package/dist/plugins/caret-navigation/locales/ru.d.ts.map +1 -0
  629. package/dist/plugins/caret-navigation/locales/zh.d.ts +4 -0
  630. package/dist/plugins/caret-navigation/locales/zh.d.ts.map +1 -0
  631. package/dist/plugins/caret-navigation.mjs +1 -4
  632. package/dist/plugins/caret-navigation.mjs.map +1 -1
  633. package/dist/plugins/code-block/CodeBlockLocale.d.ts +5 -8
  634. package/dist/plugins/code-block/CodeBlockLocale.d.ts.map +1 -1
  635. package/dist/plugins/code-block/CodeBlockNodeView.d.ts +2 -1
  636. package/dist/plugins/code-block/CodeBlockNodeView.d.ts.map +1 -1
  637. package/dist/plugins/code-block/CodeBlockPlugin.d.ts +2 -2
  638. package/dist/plugins/code-block/CodeBlockPlugin.d.ts.map +1 -1
  639. package/dist/plugins/code-block/CodeBlockService.d.ts.map +1 -1
  640. package/dist/plugins/code-block/CodeBlockTypes.d.ts +0 -1
  641. package/dist/plugins/code-block/CodeBlockTypes.d.ts.map +1 -1
  642. package/dist/plugins/code-block/index.d.ts +2 -0
  643. package/dist/plugins/code-block/index.d.ts.map +1 -1
  644. package/dist/plugins/code-block/locales/ar.d.ts +4 -0
  645. package/dist/plugins/code-block/locales/ar.d.ts.map +1 -0
  646. package/dist/plugins/code-block/locales/de.d.ts +4 -0
  647. package/dist/plugins/code-block/locales/de.d.ts.map +1 -0
  648. package/dist/plugins/code-block/locales/es.d.ts +4 -0
  649. package/dist/plugins/code-block/locales/es.d.ts.map +1 -0
  650. package/dist/plugins/code-block/locales/fr.d.ts +4 -0
  651. package/dist/plugins/code-block/locales/fr.d.ts.map +1 -0
  652. package/dist/plugins/code-block/locales/hi.d.ts +4 -0
  653. package/dist/plugins/code-block/locales/hi.d.ts.map +1 -0
  654. package/dist/plugins/code-block/locales/pt.d.ts +4 -0
  655. package/dist/plugins/code-block/locales/pt.d.ts.map +1 -0
  656. package/dist/plugins/code-block/locales/ru.d.ts +4 -0
  657. package/dist/plugins/code-block/locales/ru.d.ts.map +1 -0
  658. package/dist/plugins/code-block/locales/zh.d.ts +4 -0
  659. package/dist/plugins/code-block/locales/zh.d.ts.map +1 -0
  660. package/dist/plugins/code-block.mjs +1 -5
  661. package/dist/plugins/code-block.mjs.map +1 -1
  662. package/dist/plugins/font/FontLocale.d.ts +1 -8
  663. package/dist/plugins/font/FontLocale.d.ts.map +1 -1
  664. package/dist/plugins/font/FontPlugin.d.ts +1 -3
  665. package/dist/plugins/font/FontPlugin.d.ts.map +1 -1
  666. package/dist/plugins/font/index.d.ts +2 -0
  667. package/dist/plugins/font/index.d.ts.map +1 -1
  668. package/dist/plugins/font/locales/ar.d.ts +4 -0
  669. package/dist/plugins/font/locales/ar.d.ts.map +1 -0
  670. package/dist/plugins/font/locales/de.d.ts +4 -0
  671. package/dist/plugins/font/locales/de.d.ts.map +1 -0
  672. package/dist/plugins/font/locales/es.d.ts +4 -0
  673. package/dist/plugins/font/locales/es.d.ts.map +1 -0
  674. package/dist/plugins/font/locales/fr.d.ts +4 -0
  675. package/dist/plugins/font/locales/fr.d.ts.map +1 -0
  676. package/dist/plugins/font/locales/hi.d.ts +4 -0
  677. package/dist/plugins/font/locales/hi.d.ts.map +1 -0
  678. package/dist/plugins/font/locales/pt.d.ts +4 -0
  679. package/dist/plugins/font/locales/pt.d.ts.map +1 -0
  680. package/dist/plugins/font/locales/ru.d.ts +4 -0
  681. package/dist/plugins/font/locales/ru.d.ts.map +1 -0
  682. package/dist/plugins/font/locales/zh.d.ts +4 -0
  683. package/dist/plugins/font/locales/zh.d.ts.map +1 -0
  684. package/dist/plugins/font-size/FontSizeLocale.d.ts +1 -8
  685. package/dist/plugins/font-size/FontSizeLocale.d.ts.map +1 -1
  686. package/dist/plugins/font-size/FontSizePlugin.d.ts +1 -3
  687. package/dist/plugins/font-size/FontSizePlugin.d.ts.map +1 -1
  688. package/dist/plugins/font-size/FontSizePopup.d.ts +1 -1
  689. package/dist/plugins/font-size/FontSizePopup.d.ts.map +1 -1
  690. package/dist/plugins/font-size/index.d.ts +2 -0
  691. package/dist/plugins/font-size/index.d.ts.map +1 -1
  692. package/dist/plugins/font-size/locales/ar.d.ts +4 -0
  693. package/dist/plugins/font-size/locales/ar.d.ts.map +1 -0
  694. package/dist/plugins/font-size/locales/de.d.ts +4 -0
  695. package/dist/plugins/font-size/locales/de.d.ts.map +1 -0
  696. package/dist/plugins/font-size/locales/es.d.ts +4 -0
  697. package/dist/plugins/font-size/locales/es.d.ts.map +1 -0
  698. package/dist/plugins/font-size/locales/fr.d.ts +4 -0
  699. package/dist/plugins/font-size/locales/fr.d.ts.map +1 -0
  700. package/dist/plugins/font-size/locales/hi.d.ts +4 -0
  701. package/dist/plugins/font-size/locales/hi.d.ts.map +1 -0
  702. package/dist/plugins/font-size/locales/pt.d.ts +4 -0
  703. package/dist/plugins/font-size/locales/pt.d.ts.map +1 -0
  704. package/dist/plugins/font-size/locales/ru.d.ts +4 -0
  705. package/dist/plugins/font-size/locales/ru.d.ts.map +1 -0
  706. package/dist/plugins/font-size/locales/zh.d.ts +4 -0
  707. package/dist/plugins/font-size/locales/zh.d.ts.map +1 -0
  708. package/dist/plugins/font-size.mjs +1 -4
  709. package/dist/plugins/font-size.mjs.map +1 -1
  710. package/dist/plugins/font.mjs +1 -4
  711. package/dist/plugins/font.mjs.map +1 -1
  712. package/dist/plugins/gap-cursor/GapCursorLocale.d.ts +7 -0
  713. package/dist/plugins/gap-cursor/GapCursorLocale.d.ts.map +1 -0
  714. package/dist/plugins/gap-cursor/GapCursorPlugin.d.ts +7 -3
  715. package/dist/plugins/gap-cursor/GapCursorPlugin.d.ts.map +1 -1
  716. package/dist/plugins/gap-cursor/locales/ar.d.ts +4 -0
  717. package/dist/plugins/gap-cursor/locales/ar.d.ts.map +1 -0
  718. package/dist/plugins/gap-cursor/locales/de.d.ts +4 -0
  719. package/dist/plugins/gap-cursor/locales/de.d.ts.map +1 -0
  720. package/dist/plugins/gap-cursor/locales/es.d.ts +4 -0
  721. package/dist/plugins/gap-cursor/locales/es.d.ts.map +1 -0
  722. package/dist/plugins/gap-cursor/locales/fr.d.ts +4 -0
  723. package/dist/plugins/gap-cursor/locales/fr.d.ts.map +1 -0
  724. package/dist/plugins/gap-cursor/locales/hi.d.ts +4 -0
  725. package/dist/plugins/gap-cursor/locales/hi.d.ts.map +1 -0
  726. package/dist/plugins/gap-cursor/locales/pt.d.ts +4 -0
  727. package/dist/plugins/gap-cursor/locales/pt.d.ts.map +1 -0
  728. package/dist/plugins/gap-cursor/locales/ru.d.ts +4 -0
  729. package/dist/plugins/gap-cursor/locales/ru.d.ts.map +1 -0
  730. package/dist/plugins/gap-cursor/locales/zh.d.ts +4 -0
  731. package/dist/plugins/gap-cursor/locales/zh.d.ts.map +1 -0
  732. package/dist/plugins/gap-cursor.mjs +1 -64
  733. package/dist/plugins/gap-cursor.mjs.map +1 -1
  734. package/dist/plugins/hard-break.mjs +1 -4
  735. package/dist/plugins/hard-break.mjs.map +1 -1
  736. package/dist/plugins/heading/HeadingBlockTypePicker.d.ts +1 -1
  737. package/dist/plugins/heading/HeadingBlockTypePicker.d.ts.map +1 -1
  738. package/dist/plugins/heading/HeadingLocale.d.ts +1 -8
  739. package/dist/plugins/heading/HeadingLocale.d.ts.map +1 -1
  740. package/dist/plugins/heading/HeadingPlugin.d.ts +2 -4
  741. package/dist/plugins/heading/HeadingPlugin.d.ts.map +1 -1
  742. package/dist/plugins/heading/index.d.ts +3 -0
  743. package/dist/plugins/heading/index.d.ts.map +1 -1
  744. package/dist/plugins/heading/locales/ar.d.ts +4 -0
  745. package/dist/plugins/heading/locales/ar.d.ts.map +1 -0
  746. package/dist/plugins/heading/locales/de.d.ts +4 -0
  747. package/dist/plugins/heading/locales/de.d.ts.map +1 -0
  748. package/dist/plugins/heading/locales/es.d.ts +4 -0
  749. package/dist/plugins/heading/locales/es.d.ts.map +1 -0
  750. package/dist/plugins/heading/locales/fr.d.ts +4 -0
  751. package/dist/plugins/heading/locales/fr.d.ts.map +1 -0
  752. package/dist/plugins/heading/locales/hi.d.ts +4 -0
  753. package/dist/plugins/heading/locales/hi.d.ts.map +1 -0
  754. package/dist/plugins/heading/locales/pt.d.ts +4 -0
  755. package/dist/plugins/heading/locales/pt.d.ts.map +1 -0
  756. package/dist/plugins/heading/locales/ru.d.ts +4 -0
  757. package/dist/plugins/heading/locales/ru.d.ts.map +1 -0
  758. package/dist/plugins/heading/locales/zh.d.ts +4 -0
  759. package/dist/plugins/heading/locales/zh.d.ts.map +1 -0
  760. package/dist/plugins/heading.mjs +1 -4
  761. package/dist/plugins/heading.mjs.map +1 -1
  762. package/dist/plugins/highlight/HighlightLocale.d.ts +1 -8
  763. package/dist/plugins/highlight/HighlightLocale.d.ts.map +1 -1
  764. package/dist/plugins/highlight/HighlightPlugin.d.ts +1 -3
  765. package/dist/plugins/highlight/HighlightPlugin.d.ts.map +1 -1
  766. package/dist/plugins/highlight/index.d.ts +2 -0
  767. package/dist/plugins/highlight/index.d.ts.map +1 -1
  768. package/dist/plugins/highlight/locales/ar.d.ts +4 -0
  769. package/dist/plugins/highlight/locales/ar.d.ts.map +1 -0
  770. package/dist/plugins/highlight/locales/de.d.ts +4 -0
  771. package/dist/plugins/highlight/locales/de.d.ts.map +1 -0
  772. package/dist/plugins/highlight/locales/es.d.ts +4 -0
  773. package/dist/plugins/highlight/locales/es.d.ts.map +1 -0
  774. package/dist/plugins/highlight/locales/fr.d.ts +4 -0
  775. package/dist/plugins/highlight/locales/fr.d.ts.map +1 -0
  776. package/dist/plugins/highlight/locales/hi.d.ts +4 -0
  777. package/dist/plugins/highlight/locales/hi.d.ts.map +1 -0
  778. package/dist/plugins/highlight/locales/pt.d.ts +4 -0
  779. package/dist/plugins/highlight/locales/pt.d.ts.map +1 -0
  780. package/dist/plugins/highlight/locales/ru.d.ts +4 -0
  781. package/dist/plugins/highlight/locales/ru.d.ts.map +1 -0
  782. package/dist/plugins/highlight/locales/zh.d.ts +4 -0
  783. package/dist/plugins/highlight/locales/zh.d.ts.map +1 -0
  784. package/dist/plugins/highlight.mjs +1 -4
  785. package/dist/plugins/highlight.mjs.map +1 -1
  786. package/dist/plugins/horizontal-rule/HorizontalRuleLocale.d.ts +1 -8
  787. package/dist/plugins/horizontal-rule/HorizontalRuleLocale.d.ts.map +1 -1
  788. package/dist/plugins/horizontal-rule/HorizontalRulePlugin.d.ts +1 -3
  789. package/dist/plugins/horizontal-rule/HorizontalRulePlugin.d.ts.map +1 -1
  790. package/dist/plugins/horizontal-rule/index.d.ts +2 -0
  791. package/dist/plugins/horizontal-rule/index.d.ts.map +1 -1
  792. package/dist/plugins/horizontal-rule/locales/ar.d.ts +4 -0
  793. package/dist/plugins/horizontal-rule/locales/ar.d.ts.map +1 -0
  794. package/dist/plugins/horizontal-rule/locales/de.d.ts +4 -0
  795. package/dist/plugins/horizontal-rule/locales/de.d.ts.map +1 -0
  796. package/dist/plugins/horizontal-rule/locales/es.d.ts +4 -0
  797. package/dist/plugins/horizontal-rule/locales/es.d.ts.map +1 -0
  798. package/dist/plugins/horizontal-rule/locales/fr.d.ts +4 -0
  799. package/dist/plugins/horizontal-rule/locales/fr.d.ts.map +1 -0
  800. package/dist/plugins/horizontal-rule/locales/hi.d.ts +4 -0
  801. package/dist/plugins/horizontal-rule/locales/hi.d.ts.map +1 -0
  802. package/dist/plugins/horizontal-rule/locales/pt.d.ts +4 -0
  803. package/dist/plugins/horizontal-rule/locales/pt.d.ts.map +1 -0
  804. package/dist/plugins/horizontal-rule/locales/ru.d.ts +4 -0
  805. package/dist/plugins/horizontal-rule/locales/ru.d.ts.map +1 -0
  806. package/dist/plugins/horizontal-rule/locales/zh.d.ts +4 -0
  807. package/dist/plugins/horizontal-rule/locales/zh.d.ts.map +1 -0
  808. package/dist/plugins/horizontal-rule.mjs +1 -4
  809. package/dist/plugins/horizontal-rule.mjs.map +1 -1
  810. package/dist/plugins/image/ImageLocale.d.ts +9 -8
  811. package/dist/plugins/image/ImageLocale.d.ts.map +1 -1
  812. package/dist/plugins/image/ImageNodeView.d.ts +8 -1
  813. package/dist/plugins/image/ImageNodeView.d.ts.map +1 -1
  814. package/dist/plugins/image/ImagePlugin.d.ts +2 -2
  815. package/dist/plugins/image/ImagePlugin.d.ts.map +1 -1
  816. package/dist/plugins/image/ImageUpload.d.ts +1 -2
  817. package/dist/plugins/image/ImageUpload.d.ts.map +1 -1
  818. package/dist/plugins/image/index.d.ts +2 -0
  819. package/dist/plugins/image/index.d.ts.map +1 -1
  820. package/dist/plugins/image/locales/ar.d.ts +4 -0
  821. package/dist/plugins/image/locales/ar.d.ts.map +1 -0
  822. package/dist/plugins/image/locales/de.d.ts +4 -0
  823. package/dist/plugins/image/locales/de.d.ts.map +1 -0
  824. package/dist/plugins/image/locales/es.d.ts +4 -0
  825. package/dist/plugins/image/locales/es.d.ts.map +1 -0
  826. package/dist/plugins/image/locales/fr.d.ts +4 -0
  827. package/dist/plugins/image/locales/fr.d.ts.map +1 -0
  828. package/dist/plugins/image/locales/hi.d.ts +4 -0
  829. package/dist/plugins/image/locales/hi.d.ts.map +1 -0
  830. package/dist/plugins/image/locales/pt.d.ts +4 -0
  831. package/dist/plugins/image/locales/pt.d.ts.map +1 -0
  832. package/dist/plugins/image/locales/ru.d.ts +4 -0
  833. package/dist/plugins/image/locales/ru.d.ts.map +1 -0
  834. package/dist/plugins/image/locales/zh.d.ts +4 -0
  835. package/dist/plugins/image/locales/zh.d.ts.map +1 -0
  836. package/dist/plugins/image.mjs +1 -6
  837. package/dist/plugins/image.mjs.map +1 -1
  838. package/dist/plugins/link/LinkLocale.d.ts +1 -8
  839. package/dist/plugins/link/LinkLocale.d.ts.map +1 -1
  840. package/dist/plugins/link/LinkPlugin.d.ts +1 -3
  841. package/dist/plugins/link/LinkPlugin.d.ts.map +1 -1
  842. package/dist/plugins/link/index.d.ts +2 -0
  843. package/dist/plugins/link/index.d.ts.map +1 -1
  844. package/dist/plugins/link/locales/ar.d.ts +4 -0
  845. package/dist/plugins/link/locales/ar.d.ts.map +1 -0
  846. package/dist/plugins/link/locales/de.d.ts +4 -0
  847. package/dist/plugins/link/locales/de.d.ts.map +1 -0
  848. package/dist/plugins/link/locales/es.d.ts +4 -0
  849. package/dist/plugins/link/locales/es.d.ts.map +1 -0
  850. package/dist/plugins/link/locales/fr.d.ts +4 -0
  851. package/dist/plugins/link/locales/fr.d.ts.map +1 -0
  852. package/dist/plugins/link/locales/hi.d.ts +4 -0
  853. package/dist/plugins/link/locales/hi.d.ts.map +1 -0
  854. package/dist/plugins/link/locales/pt.d.ts +4 -0
  855. package/dist/plugins/link/locales/pt.d.ts.map +1 -0
  856. package/dist/plugins/link/locales/ru.d.ts +4 -0
  857. package/dist/plugins/link/locales/ru.d.ts.map +1 -0
  858. package/dist/plugins/link/locales/zh.d.ts +4 -0
  859. package/dist/plugins/link/locales/zh.d.ts.map +1 -0
  860. package/dist/plugins/link.mjs +1 -4
  861. package/dist/plugins/link.mjs.map +1 -1
  862. package/dist/plugins/list/ListLocale.d.ts +1 -8
  863. package/dist/plugins/list/ListLocale.d.ts.map +1 -1
  864. package/dist/plugins/list/ListPlugin.d.ts +1 -3
  865. package/dist/plugins/list/ListPlugin.d.ts.map +1 -1
  866. package/dist/plugins/list/index.d.ts +2 -0
  867. package/dist/plugins/list/index.d.ts.map +1 -1
  868. package/dist/plugins/list/locales/ar.d.ts +4 -0
  869. package/dist/plugins/list/locales/ar.d.ts.map +1 -0
  870. package/dist/plugins/list/locales/de.d.ts +4 -0
  871. package/dist/plugins/list/locales/de.d.ts.map +1 -0
  872. package/dist/plugins/list/locales/es.d.ts +4 -0
  873. package/dist/plugins/list/locales/es.d.ts.map +1 -0
  874. package/dist/plugins/list/locales/fr.d.ts +4 -0
  875. package/dist/plugins/list/locales/fr.d.ts.map +1 -0
  876. package/dist/plugins/list/locales/hi.d.ts +4 -0
  877. package/dist/plugins/list/locales/hi.d.ts.map +1 -0
  878. package/dist/plugins/list/locales/pt.d.ts +4 -0
  879. package/dist/plugins/list/locales/pt.d.ts.map +1 -0
  880. package/dist/plugins/list/locales/ru.d.ts +4 -0
  881. package/dist/plugins/list/locales/ru.d.ts.map +1 -0
  882. package/dist/plugins/list/locales/zh.d.ts +4 -0
  883. package/dist/plugins/list/locales/zh.d.ts.map +1 -0
  884. package/dist/plugins/list.mjs +1 -4
  885. package/dist/plugins/list.mjs.map +1 -1
  886. package/dist/plugins/print/PrintLocale.d.ts +1 -8
  887. package/dist/plugins/print/PrintLocale.d.ts.map +1 -1
  888. package/dist/plugins/print/PrintPlugin.d.ts +1 -1
  889. package/dist/plugins/print/PrintPlugin.d.ts.map +1 -1
  890. package/dist/plugins/print/PrintServiceImpl.d.ts.map +1 -1
  891. package/dist/plugins/print/PrintStyleCollector.d.ts.map +1 -1
  892. package/dist/plugins/print/PrintTypes.d.ts +1 -1
  893. package/dist/plugins/print/PrintTypes.d.ts.map +1 -1
  894. package/dist/plugins/print/index.d.ts +5 -0
  895. package/dist/plugins/print/index.d.ts.map +1 -0
  896. package/dist/plugins/print/locales/ar.d.ts +4 -0
  897. package/dist/plugins/print/locales/ar.d.ts.map +1 -0
  898. package/dist/plugins/print/locales/de.d.ts +4 -0
  899. package/dist/plugins/print/locales/de.d.ts.map +1 -0
  900. package/dist/plugins/print/locales/es.d.ts +4 -0
  901. package/dist/plugins/print/locales/es.d.ts.map +1 -0
  902. package/dist/plugins/print/locales/fr.d.ts +4 -0
  903. package/dist/plugins/print/locales/fr.d.ts.map +1 -0
  904. package/dist/plugins/print/locales/hi.d.ts +4 -0
  905. package/dist/plugins/print/locales/hi.d.ts.map +1 -0
  906. package/dist/plugins/print/locales/pt.d.ts +4 -0
  907. package/dist/plugins/print/locales/pt.d.ts.map +1 -0
  908. package/dist/plugins/print/locales/ru.d.ts +4 -0
  909. package/dist/plugins/print/locales/ru.d.ts.map +1 -0
  910. package/dist/plugins/print/locales/zh.d.ts +4 -0
  911. package/dist/plugins/print/locales/zh.d.ts.map +1 -0
  912. package/dist/plugins/print.mjs +2 -0
  913. package/dist/plugins/print.mjs.map +1 -0
  914. package/dist/plugins/shared/ColorGrid.d.ts.map +1 -1
  915. package/dist/plugins/shared/KeyboardNav.d.ts +17 -0
  916. package/dist/plugins/shared/KeyboardNav.d.ts.map +1 -0
  917. package/dist/plugins/shared/PluginHelpers.d.ts +10 -0
  918. package/dist/plugins/shared/PluginHelpers.d.ts.map +1 -0
  919. package/dist/plugins/shared/PopupKeyboardPatterns.d.ts +1 -1
  920. package/dist/plugins/shared/PopupKeyboardPatterns.d.ts.map +1 -1
  921. package/dist/plugins/shared/PopupManager.d.ts +2 -0
  922. package/dist/plugins/shared/PopupManager.d.ts.map +1 -1
  923. package/dist/plugins/shared/PopupPositioning.d.ts +1 -0
  924. package/dist/plugins/shared/PopupPositioning.d.ts.map +1 -1
  925. package/dist/plugins/shared/ShortcutFormatting.d.ts +9 -0
  926. package/dist/plugins/shared/ShortcutFormatting.d.ts.map +1 -0
  927. package/dist/plugins/shared/index.d.ts +12 -0
  928. package/dist/plugins/shared/index.d.ts.map +1 -0
  929. package/dist/plugins/shared.mjs +2 -0
  930. package/dist/plugins/shared.mjs.map +1 -0
  931. package/dist/plugins/strikethrough/StrikethroughLocale.d.ts +1 -8
  932. package/dist/plugins/strikethrough/StrikethroughLocale.d.ts.map +1 -1
  933. package/dist/plugins/strikethrough/StrikethroughPlugin.d.ts +1 -3
  934. package/dist/plugins/strikethrough/StrikethroughPlugin.d.ts.map +1 -1
  935. package/dist/plugins/strikethrough/index.d.ts +2 -0
  936. package/dist/plugins/strikethrough/index.d.ts.map +1 -1
  937. package/dist/plugins/strikethrough/locales/ar.d.ts +4 -0
  938. package/dist/plugins/strikethrough/locales/ar.d.ts.map +1 -0
  939. package/dist/plugins/strikethrough/locales/de.d.ts +4 -0
  940. package/dist/plugins/strikethrough/locales/de.d.ts.map +1 -0
  941. package/dist/plugins/strikethrough/locales/es.d.ts +4 -0
  942. package/dist/plugins/strikethrough/locales/es.d.ts.map +1 -0
  943. package/dist/plugins/strikethrough/locales/fr.d.ts +4 -0
  944. package/dist/plugins/strikethrough/locales/fr.d.ts.map +1 -0
  945. package/dist/plugins/strikethrough/locales/hi.d.ts +4 -0
  946. package/dist/plugins/strikethrough/locales/hi.d.ts.map +1 -0
  947. package/dist/plugins/strikethrough/locales/pt.d.ts +4 -0
  948. package/dist/plugins/strikethrough/locales/pt.d.ts.map +1 -0
  949. package/dist/plugins/strikethrough/locales/ru.d.ts +4 -0
  950. package/dist/plugins/strikethrough/locales/ru.d.ts.map +1 -0
  951. package/dist/plugins/strikethrough/locales/zh.d.ts +4 -0
  952. package/dist/plugins/strikethrough/locales/zh.d.ts.map +1 -0
  953. package/dist/plugins/strikethrough.mjs +1 -4
  954. package/dist/plugins/strikethrough.mjs.map +1 -1
  955. package/dist/plugins/super-sub/SuperSubLocale.d.ts +1 -8
  956. package/dist/plugins/super-sub/SuperSubLocale.d.ts.map +1 -1
  957. package/dist/plugins/super-sub/SuperSubPlugin.d.ts +1 -3
  958. package/dist/plugins/super-sub/SuperSubPlugin.d.ts.map +1 -1
  959. package/dist/plugins/super-sub/index.d.ts +2 -0
  960. package/dist/plugins/super-sub/index.d.ts.map +1 -1
  961. package/dist/plugins/super-sub/locales/ar.d.ts +4 -0
  962. package/dist/plugins/super-sub/locales/ar.d.ts.map +1 -0
  963. package/dist/plugins/super-sub/locales/de.d.ts +4 -0
  964. package/dist/plugins/super-sub/locales/de.d.ts.map +1 -0
  965. package/dist/plugins/super-sub/locales/es.d.ts +4 -0
  966. package/dist/plugins/super-sub/locales/es.d.ts.map +1 -0
  967. package/dist/plugins/super-sub/locales/fr.d.ts +4 -0
  968. package/dist/plugins/super-sub/locales/fr.d.ts.map +1 -0
  969. package/dist/plugins/super-sub/locales/hi.d.ts +4 -0
  970. package/dist/plugins/super-sub/locales/hi.d.ts.map +1 -0
  971. package/dist/plugins/super-sub/locales/pt.d.ts +4 -0
  972. package/dist/plugins/super-sub/locales/pt.d.ts.map +1 -0
  973. package/dist/plugins/super-sub/locales/ru.d.ts +4 -0
  974. package/dist/plugins/super-sub/locales/ru.d.ts.map +1 -0
  975. package/dist/plugins/super-sub/locales/zh.d.ts +4 -0
  976. package/dist/plugins/super-sub/locales/zh.d.ts.map +1 -0
  977. package/dist/plugins/super-sub.mjs +1 -4
  978. package/dist/plugins/super-sub.mjs.map +1 -1
  979. package/dist/plugins/table/TableCommands.d.ts +8 -8
  980. package/dist/plugins/table/TableCommands.d.ts.map +1 -1
  981. package/dist/plugins/table/TableContextMenu.d.ts.map +1 -1
  982. package/dist/plugins/table/TableControlsDOM.d.ts +4 -4
  983. package/dist/plugins/table/TableControlsDOM.d.ts.map +1 -1
  984. package/dist/plugins/table/TableLocale.d.ts +1 -8
  985. package/dist/plugins/table/TableLocale.d.ts.map +1 -1
  986. package/dist/plugins/table/TableNavigation.d.ts +1 -1
  987. package/dist/plugins/table/TableNavigation.d.ts.map +1 -1
  988. package/dist/plugins/table/TablePlugin.d.ts +3 -5
  989. package/dist/plugins/table/TablePlugin.d.ts.map +1 -1
  990. package/dist/plugins/table/TableSelection.d.ts +2 -0
  991. package/dist/plugins/table/TableSelection.d.ts.map +1 -1
  992. package/dist/plugins/table/index.d.ts +0 -5
  993. package/dist/plugins/table/index.d.ts.map +1 -1
  994. package/dist/plugins/table/locales/ar.d.ts +4 -0
  995. package/dist/plugins/table/locales/ar.d.ts.map +1 -0
  996. package/dist/plugins/table/locales/de.d.ts +4 -0
  997. package/dist/plugins/table/locales/de.d.ts.map +1 -0
  998. package/dist/plugins/table/locales/es.d.ts +4 -0
  999. package/dist/plugins/table/locales/es.d.ts.map +1 -0
  1000. package/dist/plugins/table/locales/fr.d.ts +4 -0
  1001. package/dist/plugins/table/locales/fr.d.ts.map +1 -0
  1002. package/dist/plugins/table/locales/hi.d.ts +4 -0
  1003. package/dist/plugins/table/locales/hi.d.ts.map +1 -0
  1004. package/dist/plugins/table/locales/pt.d.ts +4 -0
  1005. package/dist/plugins/table/locales/pt.d.ts.map +1 -0
  1006. package/dist/plugins/table/locales/ru.d.ts +4 -0
  1007. package/dist/plugins/table/locales/ru.d.ts.map +1 -0
  1008. package/dist/plugins/table/locales/zh.d.ts +4 -0
  1009. package/dist/plugins/table/locales/zh.d.ts.map +1 -0
  1010. package/dist/plugins/table.mjs +1 -20
  1011. package/dist/plugins/table.mjs.map +1 -1
  1012. package/dist/plugins/text-color/TextColorLocale.d.ts +1 -8
  1013. package/dist/plugins/text-color/TextColorLocale.d.ts.map +1 -1
  1014. package/dist/plugins/text-color/TextColorPlugin.d.ts +1 -3
  1015. package/dist/plugins/text-color/TextColorPlugin.d.ts.map +1 -1
  1016. package/dist/plugins/text-color/index.d.ts +2 -0
  1017. package/dist/plugins/text-color/index.d.ts.map +1 -1
  1018. package/dist/plugins/text-color/locales/ar.d.ts +4 -0
  1019. package/dist/plugins/text-color/locales/ar.d.ts.map +1 -0
  1020. package/dist/plugins/text-color/locales/de.d.ts +4 -0
  1021. package/dist/plugins/text-color/locales/de.d.ts.map +1 -0
  1022. package/dist/plugins/text-color/locales/es.d.ts +4 -0
  1023. package/dist/plugins/text-color/locales/es.d.ts.map +1 -0
  1024. package/dist/plugins/text-color/locales/fr.d.ts +4 -0
  1025. package/dist/plugins/text-color/locales/fr.d.ts.map +1 -0
  1026. package/dist/plugins/text-color/locales/hi.d.ts +4 -0
  1027. package/dist/plugins/text-color/locales/hi.d.ts.map +1 -0
  1028. package/dist/plugins/text-color/locales/pt.d.ts +4 -0
  1029. package/dist/plugins/text-color/locales/pt.d.ts.map +1 -0
  1030. package/dist/plugins/text-color/locales/ru.d.ts +4 -0
  1031. package/dist/plugins/text-color/locales/ru.d.ts.map +1 -0
  1032. package/dist/plugins/text-color/locales/zh.d.ts +4 -0
  1033. package/dist/plugins/text-color/locales/zh.d.ts.map +1 -0
  1034. package/dist/plugins/text-color.mjs +1 -4
  1035. package/dist/plugins/text-color.mjs.map +1 -1
  1036. package/dist/plugins/text-direction/DirectionDetection.d.ts +17 -0
  1037. package/dist/plugins/text-direction/DirectionDetection.d.ts.map +1 -0
  1038. package/dist/plugins/text-direction/ShiftDirectionHandler.d.ts +12 -0
  1039. package/dist/plugins/text-direction/ShiftDirectionHandler.d.ts.map +1 -0
  1040. package/dist/plugins/text-direction/TextDirectionCorePlugin.d.ts +35 -0
  1041. package/dist/plugins/text-direction/TextDirectionCorePlugin.d.ts.map +1 -0
  1042. package/dist/plugins/text-direction/TextDirectionLocale.d.ts +20 -0
  1043. package/dist/plugins/text-direction/TextDirectionLocale.d.ts.map +1 -0
  1044. package/dist/plugins/text-direction/TextDirectionMiddleware.d.ts +18 -0
  1045. package/dist/plugins/text-direction/TextDirectionMiddleware.d.ts.map +1 -0
  1046. package/dist/plugins/text-direction/TextDirectionPlugin.d.ts +59 -0
  1047. package/dist/plugins/text-direction/TextDirectionPlugin.d.ts.map +1 -0
  1048. package/dist/plugins/text-direction/index.d.ts +5 -0
  1049. package/dist/plugins/text-direction/index.d.ts.map +1 -0
  1050. package/dist/plugins/text-direction/locales/ar.d.ts +4 -0
  1051. package/dist/plugins/text-direction/locales/ar.d.ts.map +1 -0
  1052. package/dist/plugins/text-direction/locales/de.d.ts +4 -0
  1053. package/dist/plugins/text-direction/locales/de.d.ts.map +1 -0
  1054. package/dist/plugins/text-direction/locales/es.d.ts +4 -0
  1055. package/dist/plugins/text-direction/locales/es.d.ts.map +1 -0
  1056. package/dist/plugins/text-direction/locales/fr.d.ts +4 -0
  1057. package/dist/plugins/text-direction/locales/fr.d.ts.map +1 -0
  1058. package/dist/plugins/text-direction/locales/hi.d.ts +4 -0
  1059. package/dist/plugins/text-direction/locales/hi.d.ts.map +1 -0
  1060. package/dist/plugins/text-direction/locales/pt.d.ts +4 -0
  1061. package/dist/plugins/text-direction/locales/pt.d.ts.map +1 -0
  1062. package/dist/plugins/text-direction/locales/ru.d.ts +4 -0
  1063. package/dist/plugins/text-direction/locales/ru.d.ts.map +1 -0
  1064. package/dist/plugins/text-direction/locales/zh.d.ts +4 -0
  1065. package/dist/plugins/text-direction/locales/zh.d.ts.map +1 -0
  1066. package/dist/plugins/text-direction-advanced/index.d.ts +5 -0
  1067. package/dist/plugins/text-direction-advanced/index.d.ts.map +1 -0
  1068. package/dist/plugins/text-direction-advanced.mjs +2 -0
  1069. package/dist/plugins/text-direction-advanced.mjs.map +1 -0
  1070. package/dist/plugins/text-direction.mjs +2 -0
  1071. package/dist/plugins/text-direction.mjs.map +1 -0
  1072. package/dist/plugins/text-formatting/TextFormattingLocale.d.ts +1 -8
  1073. package/dist/plugins/text-formatting/TextFormattingLocale.d.ts.map +1 -1
  1074. package/dist/plugins/text-formatting/TextFormattingPlugin.d.ts +1 -3
  1075. package/dist/plugins/text-formatting/TextFormattingPlugin.d.ts.map +1 -1
  1076. package/dist/plugins/text-formatting/index.d.ts +2 -0
  1077. package/dist/plugins/text-formatting/index.d.ts.map +1 -1
  1078. package/dist/plugins/text-formatting/locales/ar.d.ts +4 -0
  1079. package/dist/plugins/text-formatting/locales/ar.d.ts.map +1 -0
  1080. package/dist/plugins/text-formatting/locales/de.d.ts +4 -0
  1081. package/dist/plugins/text-formatting/locales/de.d.ts.map +1 -0
  1082. package/dist/plugins/text-formatting/locales/es.d.ts +4 -0
  1083. package/dist/plugins/text-formatting/locales/es.d.ts.map +1 -0
  1084. package/dist/plugins/text-formatting/locales/fr.d.ts +4 -0
  1085. package/dist/plugins/text-formatting/locales/fr.d.ts.map +1 -0
  1086. package/dist/plugins/text-formatting/locales/hi.d.ts +4 -0
  1087. package/dist/plugins/text-formatting/locales/hi.d.ts.map +1 -0
  1088. package/dist/plugins/text-formatting/locales/pt.d.ts +4 -0
  1089. package/dist/plugins/text-formatting/locales/pt.d.ts.map +1 -0
  1090. package/dist/plugins/text-formatting/locales/ru.d.ts +4 -0
  1091. package/dist/plugins/text-formatting/locales/ru.d.ts.map +1 -0
  1092. package/dist/plugins/text-formatting/locales/zh.d.ts +4 -0
  1093. package/dist/plugins/text-formatting/locales/zh.d.ts.map +1 -0
  1094. package/dist/plugins/text-formatting.mjs +1 -4
  1095. package/dist/plugins/text-formatting.mjs.map +1 -1
  1096. package/dist/plugins/toolbar/ToolbarItem.d.ts +2 -18
  1097. package/dist/plugins/toolbar/ToolbarItem.d.ts.map +1 -1
  1098. package/dist/plugins/toolbar/ToolbarKeyboardNav.d.ts +5 -11
  1099. package/dist/plugins/toolbar/ToolbarKeyboardNav.d.ts.map +1 -1
  1100. package/dist/plugins/toolbar/ToolbarLocale.d.ts +2 -8
  1101. package/dist/plugins/toolbar/ToolbarLocale.d.ts.map +1 -1
  1102. package/dist/plugins/toolbar/ToolbarOverflowController.d.ts.map +1 -1
  1103. package/dist/plugins/toolbar/ToolbarPlugin.d.ts +2 -2
  1104. package/dist/plugins/toolbar/ToolbarPlugin.d.ts.map +1 -1
  1105. package/dist/plugins/toolbar/ToolbarPopupController.d.ts +3 -1
  1106. package/dist/plugins/toolbar/ToolbarPopupController.d.ts.map +1 -1
  1107. package/dist/plugins/toolbar/ToolbarRenderers.d.ts +2 -1
  1108. package/dist/plugins/toolbar/ToolbarRenderers.d.ts.map +1 -1
  1109. package/dist/plugins/toolbar/index.d.ts +4 -1
  1110. package/dist/plugins/toolbar/index.d.ts.map +1 -1
  1111. package/dist/plugins/toolbar/locales/ar.d.ts +4 -0
  1112. package/dist/plugins/toolbar/locales/ar.d.ts.map +1 -0
  1113. package/dist/plugins/toolbar/locales/de.d.ts +4 -0
  1114. package/dist/plugins/toolbar/locales/de.d.ts.map +1 -0
  1115. package/dist/plugins/toolbar/locales/es.d.ts +4 -0
  1116. package/dist/plugins/toolbar/locales/es.d.ts.map +1 -0
  1117. package/dist/plugins/toolbar/locales/fr.d.ts +4 -0
  1118. package/dist/plugins/toolbar/locales/fr.d.ts.map +1 -0
  1119. package/dist/plugins/toolbar/locales/hi.d.ts +4 -0
  1120. package/dist/plugins/toolbar/locales/hi.d.ts.map +1 -0
  1121. package/dist/plugins/toolbar/locales/pt.d.ts +4 -0
  1122. package/dist/plugins/toolbar/locales/pt.d.ts.map +1 -0
  1123. package/dist/plugins/toolbar/locales/ru.d.ts +4 -0
  1124. package/dist/plugins/toolbar/locales/ru.d.ts.map +1 -0
  1125. package/dist/plugins/toolbar/locales/zh.d.ts +4 -0
  1126. package/dist/plugins/toolbar/locales/zh.d.ts.map +1 -0
  1127. package/dist/plugins/toolbar.mjs +1 -7
  1128. package/dist/plugins/toolbar.mjs.map +1 -1
  1129. package/dist/presets/FullPreset.d.ts +4 -1
  1130. package/dist/presets/FullPreset.d.ts.map +1 -1
  1131. package/dist/presets/MinimalPreset.d.ts +3 -0
  1132. package/dist/presets/MinimalPreset.d.ts.map +1 -1
  1133. package/dist/presets/PresetTypes.d.ts +2 -0
  1134. package/dist/presets/PresetTypes.d.ts.map +1 -1
  1135. package/dist/presets/full.d.ts +17 -0
  1136. package/dist/presets/full.d.ts.map +1 -0
  1137. package/dist/presets/full.mjs +2 -0
  1138. package/dist/presets/full.mjs.map +1 -0
  1139. package/dist/presets/minimal.d.ts +17 -0
  1140. package/dist/presets/minimal.d.ts.map +1 -0
  1141. package/dist/presets/minimal.mjs +2 -0
  1142. package/dist/presets/minimal.mjs.map +1 -0
  1143. package/dist/presets.d.ts +20 -0
  1144. package/dist/presets.d.ts.map +1 -0
  1145. package/dist/presets.mjs +2 -0
  1146. package/dist/presets.mjs.map +1 -0
  1147. package/dist/serialization/CSSClassCollector.d.ts.map +1 -0
  1148. package/dist/serialization/ContentHTMLTypes.d.ts.map +1 -0
  1149. package/dist/serialization/DocumentParser.d.ts.map +1 -0
  1150. package/dist/{editor → serialization}/DocumentSerializer.d.ts +2 -0
  1151. package/dist/serialization/DocumentSerializer.d.ts.map +1 -0
  1152. package/dist/{editor → serialization}/MarkSerializer.d.ts +3 -2
  1153. package/dist/serialization/MarkSerializer.d.ts.map +1 -0
  1154. package/dist/serialization/index.d.ts +12 -0
  1155. package/dist/serialization/index.d.ts.map +1 -0
  1156. package/dist/state/BlockBoundaryMovement.d.ts +7 -0
  1157. package/dist/state/BlockBoundaryMovement.d.ts.map +1 -0
  1158. package/dist/{model/NavigationUtils.d.ts → state/NavigationQueries.d.ts} +3 -3
  1159. package/dist/state/NavigationQueries.d.ts.map +1 -0
  1160. package/dist/test/PluginTestUtils.d.ts +0 -2
  1161. package/dist/test/PluginTestUtils.d.ts.map +1 -1
  1162. package/dist/test/TestUtils.d.ts +2 -2
  1163. package/dist/test/TestUtils.d.ts.map +1 -1
  1164. package/dist/view/BlockRendering.d.ts +10 -0
  1165. package/dist/view/BlockRendering.d.ts.map +1 -0
  1166. package/dist/view/BlockWrapperManagement.d.ts +27 -0
  1167. package/dist/view/BlockWrapperManagement.d.ts.map +1 -0
  1168. package/dist/view/CaretNavigation.d.ts +1 -8
  1169. package/dist/view/CaretNavigation.d.ts.map +1 -1
  1170. package/dist/view/CursorWrapper.d.ts.map +1 -1
  1171. package/dist/view/DecorationRendering.d.ts +17 -0
  1172. package/dist/view/DecorationRendering.d.ts.map +1 -0
  1173. package/dist/view/DomUtils.d.ts +4 -0
  1174. package/dist/view/DomUtils.d.ts.map +1 -0
  1175. package/dist/view/EditorView.d.ts +7 -10
  1176. package/dist/view/EditorView.d.ts.map +1 -1
  1177. package/dist/view/GapCursorNavigation.d.ts +12 -0
  1178. package/dist/view/GapCursorNavigation.d.ts.map +1 -0
  1179. package/dist/view/InlineRendering.d.ts +11 -0
  1180. package/dist/view/InlineRendering.d.ts.map +1 -0
  1181. package/dist/view/MarkRendering.d.ts +5 -0
  1182. package/dist/view/MarkRendering.d.ts.map +1 -1
  1183. package/dist/view/Reconciler.d.ts +2 -6
  1184. package/dist/view/Reconciler.d.ts.map +1 -1
  1185. package/dist/view/SelectionSync.d.ts +41 -2
  1186. package/dist/view/SelectionSync.d.ts.map +1 -1
  1187. package/dist/view/ViewMovementCommands.d.ts.map +1 -1
  1188. package/package.json +208 -8
  1189. package/dist/chunks/AttrRegistry-D9Jx_RVb.mjs +0 -16
  1190. package/dist/chunks/AttrRegistry-D9Jx_RVb.mjs.map +0 -1
  1191. package/dist/chunks/AttributedMarkCommands-BtLea72z.mjs +0 -80
  1192. package/dist/chunks/CaretNavigation-7JYpIKbs.mjs +0 -311
  1193. package/dist/chunks/CaretNavigation-7JYpIKbs.mjs.map +0 -1
  1194. package/dist/chunks/ColorGrid--lBQ7jCK.mjs +0 -81
  1195. package/dist/chunks/ColorGrid--lBQ7jCK.mjs.map +0 -1
  1196. package/dist/chunks/ColorPickerPopup-TpIRlXc8.mjs +0 -37
  1197. package/dist/chunks/ColorPickerPopup-TpIRlXc8.mjs.map +0 -1
  1198. package/dist/chunks/ColorValidation-CV4f1wu6.mjs +0 -39
  1199. package/dist/chunks/Document-Brtw2jL1.mjs +0 -190
  1200. package/dist/chunks/HTMLUtils-DTqQzcKR.mjs +0 -35
  1201. package/dist/chunks/HTMLUtils-DTqQzcKR.mjs.map +0 -1
  1202. package/dist/chunks/MarkCommands-6RUJ4L3r.mjs +0 -94
  1203. package/dist/chunks/NavigationUtils-Cspt2ZrK.mjs +0 -47
  1204. package/dist/chunks/NavigationUtils-Cspt2ZrK.mjs.map +0 -1
  1205. package/dist/chunks/NodeResolver-C2XYkeOi.mjs +0 -81
  1206. package/dist/chunks/NodeResolver-C2XYkeOi.mjs.map +0 -1
  1207. package/dist/chunks/NodeSpec-NZVvcCuH.mjs +0 -8
  1208. package/dist/chunks/NodeSpec-NZVvcCuH.mjs.map +0 -1
  1209. package/dist/chunks/Platform-S_xqIqcM.mjs +0 -26
  1210. package/dist/chunks/Platform-S_xqIqcM.mjs.map +0 -1
  1211. package/dist/chunks/PopupPositioning-CgjgAKjp.mjs +0 -34
  1212. package/dist/chunks/PopupPositioning-CgjgAKjp.mjs.map +0 -1
  1213. package/dist/chunks/RangeIterator-Bh4Vl_6D.mjs +0 -16
  1214. package/dist/chunks/Selection-BRTab5hO.mjs +0 -52
  1215. package/dist/chunks/StyleRuntime-CP4NCwKT.mjs +0 -235
  1216. package/dist/chunks/ToolbarItem-BpZggUGo.mjs +0 -8
  1217. package/dist/chunks/ToolbarItem-BpZggUGo.mjs.map +0 -1
  1218. package/dist/chunks/ToolbarKeyboardNav-DhpL8zNV.mjs +0 -46
  1219. package/dist/chunks/ToolbarKeyboardNav-DhpL8zNV.mjs.map +0 -1
  1220. package/dist/chunks/TypeBrands-C09nE2qO.mjs +0 -27
  1221. package/dist/chunks/index--7pBhSF4.mjs +0 -542
  1222. package/dist/chunks/index--7pBhSF4.mjs.map +0 -1
  1223. package/dist/chunks/index-BXCkjDax.mjs +0 -161
  1224. package/dist/chunks/index-BXCkjDax.mjs.map +0 -1
  1225. package/dist/chunks/index-BXtw5PNN.mjs +0 -39
  1226. package/dist/chunks/index-BXtw5PNN.mjs.map +0 -1
  1227. package/dist/chunks/index-BcDRT4K2.mjs +0 -1019
  1228. package/dist/chunks/index-BcDRT4K2.mjs.map +0 -1
  1229. package/dist/chunks/index-BjFBWBOC.mjs +0 -168
  1230. package/dist/chunks/index-BjFBWBOC.mjs.map +0 -1
  1231. package/dist/chunks/index-C1opJocO.mjs +0 -92
  1232. package/dist/chunks/index-C1opJocO.mjs.map +0 -1
  1233. package/dist/chunks/index-CCyqQ0Dz.mjs +0 -228
  1234. package/dist/chunks/index-CCyqQ0Dz.mjs.map +0 -1
  1235. package/dist/chunks/index-Cd3uJLP3.mjs +0 -73
  1236. package/dist/chunks/index-Cd3uJLP3.mjs.map +0 -1
  1237. package/dist/chunks/index-DSAuGP4n.mjs +0 -410
  1238. package/dist/chunks/index-DSAuGP4n.mjs.map +0 -1
  1239. package/dist/chunks/index-DtRfqsq5.mjs +0 -924
  1240. package/dist/chunks/index-DtRfqsq5.mjs.map +0 -1
  1241. package/dist/chunks/index-Dum8yE_t.mjs +0 -62
  1242. package/dist/chunks/index-Dum8yE_t.mjs.map +0 -1
  1243. package/dist/chunks/index-DxbQirny.mjs +0 -63
  1244. package/dist/chunks/index-DxbQirny.mjs.map +0 -1
  1245. package/dist/chunks/index-ErZ5_a1o.mjs +0 -296
  1246. package/dist/chunks/index-ErZ5_a1o.mjs.map +0 -1
  1247. package/dist/chunks/index-WpbK_s_H.mjs +0 -119
  1248. package/dist/chunks/index-WpbK_s_H.mjs.map +0 -1
  1249. package/dist/chunks/index-WrqH1wG8.mjs +0 -50
  1250. package/dist/chunks/index-WrqH1wG8.mjs.map +0 -1
  1251. package/dist/chunks/index-fsVJLutn.mjs +0 -118
  1252. package/dist/chunks/index-fsVJLutn.mjs.map +0 -1
  1253. package/dist/chunks/index-fx3KIap3.mjs +0 -50
  1254. package/dist/chunks/index-fx3KIap3.mjs.map +0 -1
  1255. package/dist/chunks/index-oOJo-ywB.mjs +0 -467
  1256. package/dist/chunks/index-oOJo-ywB.mjs.map +0 -1
  1257. package/dist/chunks/index-toj88jtL.mjs +0 -101
  1258. package/dist/chunks/index-toj88jtL.mjs.map +0 -1
  1259. package/dist/chunks/resolvePluginLocale-B4w1OkPy.mjs +0 -34
  1260. package/dist/chunks/resolvePluginLocale-B4w1OkPy.mjs.map +0 -1
  1261. package/dist/editor/CSSClassCollector.d.ts.map +0 -1
  1262. package/dist/editor/ContentHTMLTypes.d.ts.map +0 -1
  1263. package/dist/editor/DocumentParser.d.ts.map +0 -1
  1264. package/dist/editor/DocumentSerializer.d.ts.map +0 -1
  1265. package/dist/editor/MarkSerializer.d.ts.map +0 -1
  1266. package/dist/editor/PaperSize.d.ts.map +0 -1
  1267. package/dist/i18n/resolvePluginLocale.d.ts +0 -3
  1268. package/dist/i18n/resolvePluginLocale.d.ts.map +0 -1
  1269. package/dist/model/BuiltinSpecs.d.ts.map +0 -1
  1270. package/dist/model/HTMLParser.d.ts.map +0 -1
  1271. package/dist/model/NavigationUtils.d.ts.map +0 -1
  1272. package/dist/view/Platform.d.ts.map +0 -1
  1273. /package/dist/{input → model}/InputRule.d.ts +0 -0
  1274. /package/dist/{input → model}/InputRuleRegistry.d.ts +0 -0
  1275. /package/dist/{input → model}/Keymap.d.ts +0 -0
  1276. /package/dist/{input → model}/KeymapRegistry.d.ts +0 -0
  1277. /package/dist/{editor → model}/PaperSize.d.ts +0 -0
  1278. /package/dist/{editor → serialization}/CSSClassCollector.d.ts +0 -0
  1279. /package/dist/{editor → serialization}/ContentHTMLTypes.d.ts +0 -0
  1280. /package/dist/{editor → serialization}/DocumentParser.d.ts +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NavigationQueries-ogQuObz7.mjs","sources":["../../src/model/NodeResolver.ts","../../src/state/NavigationQueries.ts"],"sourcesContent":["/**\n * Utilities for resolving nodes by path within the document tree.\n * Supports both flat and recursive (nested) document structures.\n */\n\nimport type { BlockNode, Document } from './Document.js';\nimport { isBlockNode } from './Document.js';\n\n/**\n * Resolves a node in the document tree by its path (array of block IDs).\n * The path traces the lineage from the root block down to the target.\n */\nexport function resolveNodeByPath(doc: Document, path: readonly string[]): BlockNode | undefined {\n\tif (path.length === 0) return undefined;\n\n\tlet current: BlockNode | undefined = doc.children.find((b) => b.id === path[0]);\n\tif (!current) return undefined;\n\n\tfor (let i = 1; i < path.length; i++) {\n\t\tconst childId = path[i];\n\t\tif (!childId) return undefined;\n\t\tconst next: BlockNode | undefined = current?.children.find(\n\t\t\t(c): c is BlockNode => isBlockNode(c) && c.id === childId,\n\t\t);\n\t\tif (!next) return undefined;\n\t\tcurrent = next;\n\t}\n\n\treturn current;\n}\n\n/**\n * Resolves the parent of a node at the given path.\n * Returns the parent container (Document or BlockNode) and the child's index within it.\n */\nexport function resolveParentByPath(\n\tdoc: Document,\n\tpath: readonly string[],\n): { parent: Document | BlockNode; index: number } | undefined {\n\tif (path.length === 0) return undefined;\n\n\tif (path.length === 1) {\n\t\tconst index = doc.children.findIndex((b) => b.id === path[0]);\n\t\tif (index === -1) return undefined;\n\t\treturn { parent: doc, index };\n\t}\n\n\tconst parentPath = path.slice(0, -1);\n\tconst parent = resolveNodeByPath(doc, parentPath);\n\tif (!parent) return undefined;\n\n\tconst childId = path[path.length - 1];\n\tif (!childId) return undefined;\n\tconst index = parent.children.findIndex(\n\t\t(c): c is BlockNode => isBlockNode(c) && c.id === childId,\n\t);\n\tif (index === -1) return undefined;\n\n\treturn { parent, index };\n}\n\n/**\n * Finds the path (array of block IDs) to a node by its ID.\n * Performs recursive DFS through the document tree.\n */\nexport function findNodePath(doc: Document, nodeId: string): string[] | undefined {\n\tfor (const block of doc.children) {\n\t\tif (block.id === nodeId) return [nodeId];\n\n\t\tconst subPath = findNodePathInBlock(block, nodeId);\n\t\tif (subPath) return [block.id, ...subPath];\n\t}\n\treturn undefined;\n}\n\nfunction findNodePathInBlock(block: BlockNode, nodeId: string): string[] | undefined {\n\tfor (const child of block.children) {\n\t\tif (!isBlockNode(child)) continue;\n\t\tif (child.id === nodeId) return [nodeId];\n\n\t\tconst subPath = findNodePathInBlock(child, nodeId);\n\t\tif (subPath) return [child.id, ...subPath];\n\t}\n\treturn undefined;\n}\n\n/**\n * Walks all block nodes in the document tree in depth-first order.\n * Visits every BlockNode, including nested ones, with their full path.\n */\nexport function walkNodes(\n\tdoc: Document,\n\tcallback: (node: BlockNode, path: string[]) => void,\n): void {\n\tfor (const block of doc.children) {\n\t\twalkNodeRecursive(block, [block.id], callback);\n\t}\n}\n\nfunction walkNodeRecursive(\n\tnode: BlockNode,\n\tpath: string[],\n\tcallback: (node: BlockNode, path: string[]) => void,\n): void {\n\tcallback(node, path);\n\tfor (const child of node.children) {\n\t\tif (isBlockNode(child)) {\n\t\t\twalkNodeRecursive(child, [...path, child.id], callback);\n\t\t}\n\t}\n}\n\n/**\n * Finds a block node by ID anywhere in the document tree (recursive DFS).\n */\nexport function findNode(doc: Document, nodeId: string): BlockNode | undefined {\n\tfor (const block of doc.children) {\n\t\tif (block.id === nodeId) return block;\n\t\tconst found = findNodeInBlock(block, nodeId);\n\t\tif (found) return found;\n\t}\n\treturn undefined;\n}\n\nfunction findNodeInBlock(block: BlockNode, nodeId: string): BlockNode | undefined {\n\tfor (const child of block.children) {\n\t\tif (!isBlockNode(child)) continue;\n\t\tif (child.id === nodeId) return child;\n\t\tconst found = findNodeInBlock(child, nodeId);\n\t\tif (found) return found;\n\t}\n\treturn undefined;\n}\n\n/**\n * Finds a block node and returns it together with its path.\n */\nexport function findNodeWithPath(\n\tdoc: Document,\n\tnodeId: string,\n): { node: BlockNode; path: string[] } | undefined {\n\tconst path = findNodePath(doc, nodeId);\n\tif (!path) return undefined;\n\tconst node = resolveNodeByPath(doc, path);\n\tif (!node) return undefined;\n\treturn { node, path };\n}\n","/**\n * Pure navigation query functions for block boundary and isolating checks.\n *\n * These utilities inspect the document structure and schema to answer\n * questions about block traversal — whether a block is void, isolating,\n * or whether navigation between two blocks is allowed.\n */\n\nimport type { BlockId } from '../model/TypeBrands.js';\nimport type { EditorState } from './EditorState.js';\n\n/** Returns true if the block with the given ID is a void block (e.g. image, HR). */\nexport function isVoidBlock(state: EditorState, bid: BlockId): boolean {\n\tconst block = state.getBlock(bid);\n\tif (!block) return false;\n\tconst getNodeSpec = state.schema.getNodeSpec;\n\tif (!getNodeSpec) return false;\n\treturn getNodeSpec(block.type)?.isVoid === true;\n}\n\n/** Checks whether two blocks share the same parent in the document tree. */\nexport function sharesParent(state: EditorState, blockIdA: BlockId, blockIdB: BlockId): boolean {\n\tconst pathA = state.getNodePath(blockIdA);\n\tconst pathB = state.getNodePath(blockIdB);\n\tif (!pathA || !pathB) return false;\n\tif (pathA.length !== pathB.length) return false;\n\t// Compare parent paths (all but last element)\n\tfor (let i = 0; i < pathA.length - 1; i++) {\n\t\tif (pathA[i] !== pathB[i]) return false;\n\t}\n\treturn true;\n}\n\n/** Checks whether a block is inside an isolating node (e.g. table_cell). */\nexport function isInsideIsolating(state: EditorState, blockId: BlockId): boolean {\n\tconst getNodeSpec = state.schema.getNodeSpec;\n\tif (!getNodeSpec) return false;\n\tconst path = state.getNodePath(blockId);\n\tif (!path || path.length <= 1) return false;\n\n\t// Check ancestors (not the block itself)\n\tfor (let i = 0; i < path.length - 1; i++) {\n\t\tconst ancestorId = path[i];\n\t\tif (!ancestorId) continue;\n\t\tconst ancestor = state.getBlock(ancestorId);\n\t\tif (!ancestor) continue;\n\t\tconst spec = getNodeSpec(ancestor.type);\n\t\tif (spec?.isolating) return true;\n\t}\n\treturn false;\n}\n\n/** Returns true if the block itself has the isolating property. */\nexport function isIsolatingBlock(state: EditorState, blockId: BlockId): boolean {\n\tconst getNodeSpec = state.schema.getNodeSpec;\n\tif (!getNodeSpec) return false;\n\tconst block = state.getBlock(blockId);\n\tif (!block) return false;\n\treturn getNodeSpec(block.type)?.isolating === true;\n}\n\n/**\n * Checks whether navigation between two blocks is allowed.\n * Prevents crossing isolating boundaries (e.g. table cells).\n */\nexport function canCrossBlockBoundary(state: EditorState, fromId: BlockId, toId: BlockId): boolean {\n\t// A block that is itself isolating cannot be crossed into via arrow keys\n\tif (isIsolatingBlock(state, fromId) || isIsolatingBlock(state, toId)) return false;\n\n\tconst fromInside: boolean = isInsideIsolating(state, fromId);\n\tconst toInside: boolean = isInsideIsolating(state, toId);\n\n\t// One inside isolating, the other not → disallow\n\tif (fromInside !== toInside) return false;\n\n\t// Both inside isolating → must share the same parent\n\tif (fromInside && toInside) return sharesParent(state, fromId, toId);\n\n\treturn true;\n}\n"],"names":["resolveNodeByPath","doc","path","length","current","children","find","b","id","i","childId","next","c","isBlockNode","resolveParentByPath","index","findIndex","parent","slice","findNodePath","nodeId","block","subPath","findNodePathInBlock","child","walkNodes","callback","walkNodeRecursive","node","findNode","found","findNodeInBlock","findNodeWithPath","isVoidBlock","state","bid","getBlock","getNodeSpec","schema","type","isVoid","sharesParent","blockIdA","blockIdB","pathA","getNodePath","pathB","isInsideIsolating","blockId","ancestorId","ancestor","spec","isolating","isIsolatingBlock","canCrossBlockBoundary","fromId","toId","fromInside","toInside"],"mappings":"uCAYO,SAASA,EAAkBC,EAAeC,GAChD,GAAoB,IAAhBA,EAAKC,OAAc,OAEvB,IAAIC,EAAiCH,EAAII,SAASC,KAAMC,GAAMA,EAAEC,KAAON,EAAK,IAC5E,GAAKE,EAAL,CAEA,IAAA,IAASK,EAAI,EAAGA,EAAIP,EAAKC,OAAQM,IAAK,CACrC,MAAMC,EAAUR,EAAKO,GACrB,IAAKC,EAAS,OACd,MAAMC,EAA8BP,GAASC,SAASC,KACpDM,GAAsBC,EAAYD,IAAMA,EAAEJ,KAAOE,GAEnD,IAAKC,EAAM,OACXP,EAAUO,CACX,CAEA,OAAOP,CAZc,CAatB,CAMO,SAASU,EACfb,EACAC,GAEA,GAAoB,IAAhBA,EAAKC,OAAc,OAEvB,GAAoB,IAAhBD,EAAKC,OAAc,CACtB,MAAMY,EAAQd,EAAII,SAASW,UAAWT,GAAMA,EAAEC,KAAON,EAAK,IAC1D,QAAIa,EAAc,OAClB,MAAO,CAAEE,OAAQhB,EAAKc,MAAAA,EACvB,CAEA,MACME,EAASjB,EAAkBC,EADdC,EAAKgB,MAAM,GAAG,IAEjC,IAAKD,EAAQ,OAEb,MAAMP,EAAUR,EAAKA,EAAKC,OAAS,GACnC,IAAKO,EAAS,OACd,MAAMK,EAAQE,EAAOZ,SAASW,UAC5BJ,GAAsBC,EAAYD,IAAMA,EAAEJ,KAAOE,GAEnD,WAAIK,EAEG,CAAEE,SAAQF,cAFjB,CAGD,CAMO,SAASI,EAAalB,EAAemB,GAC3C,IAAA,MAAWC,KAASpB,EAAII,SAAU,CACjC,GAAIgB,EAAMb,KAAOY,EAAQ,MAAO,CAACA,GAEjC,MAAME,EAAUC,EAAoBF,EAAOD,GAC3C,GAAIE,EAAS,MAAO,CAACD,EAAMb,MAAOc,EACnC,CAED,CAEA,SAASC,EAAoBF,EAAkBD,GAC9C,IAAA,MAAWI,KAASH,EAAMhB,SAAU,CACnC,IAAKQ,EAAYW,GAAQ,SACzB,GAAIA,EAAMhB,KAAOY,EAAQ,MAAO,CAACA,GAEjC,MAAME,EAAUC,EAAoBC,EAAOJ,GAC3C,GAAIE,EAAS,MAAO,CAACE,EAAMhB,MAAOc,EACnC,CAED,CAMO,SAASG,EACfxB,EACAyB,GAEA,IAAA,MAAWL,KAASpB,EAAII,SACvBsB,EAAkBN,EAAO,CAACA,EAAMb,IAAKkB,EAEvC,CAEA,SAASC,EACRC,EACA1B,EACAwB,GAEAA,EAASE,EAAM1B,GACf,IAAA,MAAWsB,KAASI,EAAKvB,SACpBQ,EAAYW,IACfG,EAAkBH,EAAO,IAAItB,EAAMsB,EAAMhB,IAAKkB,EAGjD,CAKO,SAASG,EAAS5B,EAAemB,GACvC,IAAA,MAAWC,KAASpB,EAAII,SAAU,CACjC,GAAIgB,EAAMb,KAAOY,EAAQ,OAAOC,EAChC,MAAMS,EAAQC,EAAgBV,EAAOD,GACrC,GAAIU,EAAO,OAAOA,CACnB,CAED,CAEA,SAASC,EAAgBV,EAAkBD,GAC1C,IAAA,MAAWI,KAASH,EAAMhB,SAAU,CACnC,IAAKQ,EAAYW,GAAQ,SACzB,GAAIA,EAAMhB,KAAOY,EAAQ,OAAOI,EAChC,MAAMM,EAAQC,EAAgBP,EAAOJ,GACrC,GAAIU,EAAO,OAAOA,CACnB,CAED,CAKO,SAASE,EACf/B,EACAmB,GAEA,MAAMlB,EAAOiB,EAAalB,EAAKmB,GAC/B,IAAKlB,EAAM,OACX,MAAM0B,EAAO5B,EAAkBC,EAAKC,GACpC,OAAK0B,EACE,CAAEA,OAAM1B,aADf,CAED,CCtIO,SAAS+B,EAAYC,EAAoBC,GAC/C,MAAMd,EAAQa,EAAME,SAASD,GAC7B,IAAKd,EAAO,OAAO,EACnB,MAAMgB,EAAcH,EAAMI,OAAOD,YACjC,QAAKA,IACsC,IAApCA,EAAYhB,EAAMkB,OAAOC,MACjC,CAGO,SAASC,EAAaP,EAAoBQ,EAAmBC,GACnE,MAAMC,EAAQV,EAAMW,YAAYH,GAC1BI,EAAQZ,EAAMW,YAAYF,GAChC,IAAKC,IAAUE,EAAO,OAAO,EAC7B,GAAIF,EAAMzC,SAAW2C,EAAM3C,OAAQ,OAAO,EAE1C,IAAA,IAASM,EAAI,EAAGA,EAAImC,EAAMzC,OAAS,EAAGM,IACrC,GAAImC,EAAMnC,KAAOqC,EAAMrC,GAAI,OAAO,EAEnC,OAAO,CACR,CAGO,SAASsC,EAAkBb,EAAoBc,GACrD,MAAMX,EAAcH,EAAMI,OAAOD,YACjC,IAAKA,EAAa,OAAO,EACzB,MAAMnC,EAAOgC,EAAMW,YAAYG,GAC/B,IAAK9C,GAAQA,EAAKC,QAAU,EAAG,OAAO,EAGtC,IAAA,IAASM,EAAI,EAAGA,EAAIP,EAAKC,OAAS,EAAGM,IAAK,CACzC,MAAMwC,EAAa/C,EAAKO,GACxB,IAAKwC,EAAY,SACjB,MAAMC,EAAWhB,EAAME,SAASa,GAChC,IAAKC,EAAU,SACf,MAAMC,EAAOd,EAAYa,EAASX,MAClC,GAAIY,GAAMC,UAAW,OAAO,CAC7B,CACA,OAAO,CACR,CAGO,SAASC,EAAiBnB,EAAoBc,GACpD,MAAMX,EAAcH,EAAMI,OAAOD,YACjC,IAAKA,EAAa,OAAO,EACzB,MAAMhB,EAAQa,EAAME,SAASY,GAC7B,QAAK3B,IACyC,IAAvCgB,EAAYhB,EAAMkB,OAAOa,SACjC,CAMO,SAASE,EAAsBpB,EAAoBqB,EAAiBC,GAE1E,GAAIH,EAAiBnB,EAAOqB,IAAWF,EAAiBnB,EAAOsB,GAAO,OAAO,EAE7E,MAAMC,EAAsBV,EAAkBb,EAAOqB,GAC/CG,EAAoBX,EAAkBb,EAAOsB,GAGnD,OAAIC,IAAeC,KAGfD,IAAcC,GAAiBjB,EAAaP,EAAOqB,EAAQC,GAGhE"}
@@ -0,0 +1,2 @@
1
+ import{b as e,c as t,g as n,m as s,s as r,n as i,f as o,d as a,a as c,e as l,i as h,h as d,r as p,j as u}from"./Commands-P9wS8qtN.mjs";import{D as f,d as g}from"./Decoration-D49mFXrH.mjs";import{L as m,a as y}from"./LocaleService-B6Z-wyAF.mjs";import{n as k,o as S,e as b,q as v,t as w,u as R,k as C,v as x,f as E,c as T,w as I,i as M,h as B,j as A,a as N,p as P,s as D,r as O,g as L}from"./Document-BFYAonMF.mjs";import{f as H,r as _,a as z}from"./NavigationQueries-ogQuObz7.mjs";import{b as F,c as K,h as $,g as j,e as V,d as U,i as W,k as q,j as G,s as Q}from"./Selection-6-W6Flxc.mjs";import{c as J,b as X,d as Y,p as Z}from"./DocumentParser-DFcvVMGY.mjs";import{o as ee,n as te,M as ne,N as se,O as re,P as ie,Q as oe,R as ae,G as ce,e as le,C as he,p as de,D as pe,K as ue}from"./index-DAoSt12h.mjs";import fe from"dompurify";import{b as ge,n as me,m as ye}from"./TypeBrands-Bp_Z_o5Y.mjs";import{S as ke,f as Se}from"./HTMLUtils-CCvQ5f83.mjs";import{d as be,a as ve,f as we,s as Re,i as Ce}from"./MarkCommands-B_erV7zz.mjs";import{b as xe,c as Ee,u as Te,d as Ie,r as Me,a as Be}from"./StyleRuntime-BmsLoEa8.mjs";import{g as Ae}from"./Platform-CU6itXZo.mjs";import{B as Ne}from"./BlockTypePickerRegistry-DcSE6IXB.mjs";import{ToolbarRegistry as Pe,ToolbarPlugin as De}from"../plugins/toolbar.mjs";import{i as Oe,b as Le,a as He,P as _e,d as ze,B as Fe}from"./PrintTypes-ehbL7ipA.mjs";import{c as Ke}from"./DomUtils-Cdz1eDKM.mjs";import{G as $e,n as je}from"./index-C8xtb3SM.mjs";import{TextFormattingPlugin as Ve}from"../plugins/text-formatting.mjs";class Ue{_nodeSpecs=/* @__PURE__ */new Map;_markSpecs=/* @__PURE__ */new Map;_inlineNodeSpecs=/* @__PURE__ */new Map;registerNodeSpec(e){if(this._nodeSpecs.has(e.type))throw new Error(`NodeSpec for type "${e.type}" is already registered.`);this._nodeSpecs.set(e.type,e)}getNodeSpec(e){return this._nodeSpecs.get(e)}removeNodeSpec(e){this._nodeSpecs.delete(e)}getNodeTypes(){return[...this._nodeSpecs.keys()]}registerMarkSpec(e){if(this._markSpecs.has(e.type))throw new Error(`MarkSpec for type "${e.type}" is already registered.`);this._markSpecs.set(e.type,e)}getMarkSpec(e){return this._markSpecs.get(e)}removeMarkSpec(e){this._markSpecs.delete(e)}getMarkTypes(){return[...this._markSpecs.keys()]}registerInlineNodeSpec(e){if(this._inlineNodeSpecs.has(e.type))throw new Error(`InlineNodeSpec for type "${e.type}" is already registered.`);this._inlineNodeSpecs.set(e.type,e)}getInlineNodeSpec(e){return this._inlineNodeSpecs.get(e)}removeInlineNodeSpec(e){this._inlineNodeSpecs.delete(e)}getInlineNodeTypes(){return[...this._inlineNodeSpecs.keys()]}getBlockParseRules(){const e=[];for(const[t,n]of this._nodeSpecs)if(n.parseHTML)for(const s of n.parseHTML)e.push({rule:s,type:t});return e.sort((e,t)=>(t.rule.priority??50)-(e.rule.priority??50))}getInlineParseRules(){const e=[];for(const[t,n]of this._inlineNodeSpecs)if(n.parseHTML)for(const s of n.parseHTML)e.push({rule:s,type:t});return e.sort((e,t)=>(t.rule.priority??50)-(e.rule.priority??50))}getMarkParseRules(){const e=[];for(const[t,n]of this._markSpecs)if(n.parseHTML)for(const s of n.parseHTML)e.push({rule:s,type:t});return e.sort((e,t)=>(t.rule.priority??50)-(e.rule.priority??50))}getAllowedTags(){const e=/* @__PURE__ */new Set(["p","br","div","span"]);for(const t of this._nodeSpecs.values())if(t.sanitize?.tags)for(const n of t.sanitize.tags)e.add(n);for(const t of this._inlineNodeSpecs.values())if(t.sanitize?.tags)for(const n of t.sanitize.tags)e.add(n);for(const t of this._markSpecs.values())if(t.sanitize?.tags)for(const n of t.sanitize.tags)e.add(n);return[...e]}getAllowedAttrs(){const e=/* @__PURE__ */new Set(["style","dir"]);for(const t of this._nodeSpecs.values())if(t.sanitize?.attrs)for(const n of t.sanitize.attrs)e.add(n);for(const t of this._inlineNodeSpecs.values())if(t.sanitize?.attrs)for(const n of t.sanitize.attrs)e.add(n);for(const t of this._markSpecs.values())if(t.sanitize?.attrs)for(const n of t.sanitize.attrs)e.add(n);return[...e]}clear(){this._nodeSpecs.clear(),this._markSpecs.clear(),this._inlineNodeSpecs.clear()}}function We(e,t,n){const s=e.getNodeSpec(t);if(!s?.content)return!0;const r=e.getNodeSpec(n),i=r?.group;for(const o of s.content.allow){if(o===n)return!0;if("text"!==o&&i&&o===i)return!0}return!1}function qe(e,t,n){const s=e.getNodeSpec(t);if(!s?.content)return!0;const{min:r=0,max:i=Number.POSITIVE_INFINITY}=s.content,o=n.filter(e=>"text"!==e);if(o.length<r||o.length>i)return!1;for(const a of o)if(!We(e,t,a))return!1;return!0}function Ge(e){e.registerNodeSpec({type:"paragraph",group:"block",content:{allow:["text"]},toDOM:e=>Ke("p",e.id),toHTML:(e,t)=>`<p>${t||"<br>"}</p>`,parseHTML:[{tag:"p"},{tag:"div",priority:10}],sanitize:{tags:["p"]}})}function Qe(e,t,n){return{children:Je(e.children,t,n)}}function Je(e,t,n){return e.map(e=>{if(!k(e))return e;if(e.id===t)return n(e);const s=Je(e.children,t,n);return s===e.children?e:{...e,children:s}})}function Xe(e,t,n){if(0===t.length)return e;const s=t[0];return s?{children:e.children.map(e=>k(e)&&e.id===s?1===t.length?n(e):Ye(e,t,1,n):e)}:e}function Ye(e,t,n,s){const r=t[n];if(!r)return e;const i=e.children.map(e=>k(e)&&e.id===r?n===t.length-1?s(e):Ye(e,t,n+1,s):e);return{...e,children:i}}function Ze(e,t,n){if(t(e))return n(e);let s=!1;const r=e.map(e=>{if(!k(e))return e;const r=Ze(e.children,t,n);return r?(s=!0,{...e,children:r}):e});return s?r:null}function et(e,t,n){const s=[];let r=0;for(const i of e){if(S(i)){const e=r+1;e>t&&r<n&&s.push(i),r=e;continue}const e=r+i.text.length;if(e<=t||r>=n);else{const e=Math.max(0,t-r),o=Math.min(i.text.length,n-r),a=i.text.slice(e,o);a.length>0&&s.push(b(a,i.marks))}r=e}return 0===s.length&&s.push(b("")),s}function tt(e,t,n,s,r){const i=[];let o=0;for(const a of e){if(S(a)){i.push(a),o+=1;continue}const e=o+a.text.length;if(e<=t||o>=n)i.push(a);else if(o>=t&&e<=n){const e=r?w(a.marks,s):R(a.marks,s.type);i.push(b(a.text,e))}else{const e=Math.max(0,t-o),c=Math.min(a.text.length,n-o),l=a.text.slice(0,e),h=a.text.slice(e,c),d=a.text.slice(c);if(l&&i.push(b(l,a.marks)),h){const e=r?w(a.marks,s):R(a.marks,s.type);i.push(b(h,e))}d&&i.push(b(d,a.marks))}o=e}return i}function nt(e,t){if(e.every(e=>v(e)||S(e)))return t;const n=e.filter(e=>!v(e)&&!S(e));return[...t,...n]}function st(e,t){switch(t.type){case"insertText":return function(e,t){return Qe(e,t.blockId,e=>{const n=C(e),s=t.segments?function(e,t,n){const s=[];let r=0,i=!1;for(const o of e){if(S(o)){if(!i&&t===r){for(const e of n)s.push(b(e.text,e.marks));i=!0}s.push(o),r+=1;continue}const e=r+o.text.length;if(!i&&t>=r&&t<=e){const e=t-r,a=o.text.slice(0,e),c=o.text.slice(e);a&&s.push(b(a,o.marks));for(const t of n)s.push(b(t.text,t.marks));c&&s.push(b(c,o.marks)),i=!0}else s.push(o);r=e}if(!i)for(const o of n)s.push(b(o.text,o.marks));return s}(n,t.offset,t.segments):function(e,t,n,s){const r=[];let i=0,o=!1;for(const a of e){if(S(a)){o||t!==i||(r.push(b(n,s)),o=!0),r.push(a),i+=1;continue}const e=i+a.text.length;if(!o&&t>=i&&t<=e){const e=t-i,c=a.text.slice(0,e),l=a.text.slice(e);c&&r.push(b(c,a.marks)),r.push(b(n,s)),l&&r.push(b(l,a.marks)),o=!0}else r.push(a);i=e}return o||r.push(b(n,s)),r}(n,t.offset,t.text,t.marks);return{...e,children:nt(e.children,x(s))}})}(e,t);case"deleteText":return function(e,t){return Qe(e,t.blockId,e=>{const n=function(e,t,n){const s=[];let r=0;for(const i of e){if(S(i)){const e=r+1;(e<=t||r>=n)&&s.push(i),r=e;continue}const e=r+i.text.length;if(e<=t||r>=n)s.push(i);else{const e=Math.max(0,t-r),o=Math.min(i.text.length,n-r),a=i.text.slice(0,e)+i.text.slice(o);a.length>0&&s.push(b(a,i.marks))}r=e}return s}(C(e),t.from,t.to);return{...e,children:nt(e.children,x(n))}})}(e,t);case"splitBlock":return function(e,t){const n=Ze(e.children,e=>e.some(e=>k(e)&&e.id===t.blockId),e=>{const n=e.findIndex(e=>k(e)&&e.id===t.blockId);if(-1===n)return e;const s=e[n],r=C(s),i=E(s),o=et(r,0,t.offset),a=et(r,t.offset,i),c={...s,children:x(o)},l=T(s.type,x(a),t.newBlockId,s.attrs),h=[...e];return h.splice(n,1,c,l),h});return n?{children:n}:e}(e,t);case"mergeBlocks":return function(e,t){const n=Ze(e.children,e=>e.some(e=>k(e)&&e.id===t.targetBlockId)&&e.some(e=>k(e)&&e.id===t.sourceBlockId),e=>{const n=e.findIndex(e=>k(e)&&e.id===t.targetBlockId),s=e.findIndex(e=>k(e)&&e.id===t.sourceBlockId);if(-1===n||-1===s)return e;const r=e[n],i=e[s],o=C(r),a=C(i),c=x([...o,...a]),l={...r,children:c};return e.filter(e=>!k(e)||e.id!==t.sourceBlockId).map(e=>k(e)&&e.id===t.targetBlockId?l:e)});return n?{children:n}:e}(e,t);case"addMark":return function(e,t){return Qe(e,t.blockId,e=>{const n=tt(C(e),t.from,t.to,t.mark,!0);return{...e,children:nt(e.children,x(n))}})}(e,t);case"removeMark":return function(e,t){return Qe(e,t.blockId,e=>{const n=tt(C(e),t.from,t.to,t.mark,!1);return{...e,children:nt(e.children,x(n))}})}(e,t);case"setStoredMarks":return e;case"setBlockType":return function(e,t){return Qe(e,t.blockId,e=>({...e,type:t.nodeType,...t.attrs?{attrs:t.attrs}:{attrs:void 0}}))}(e,t);case"insertNode":return function(e,t){if(0===t.parentPath.length){const n=[...e.children];return n.splice(t.index,0,t.node),{children:n}}return Xe(e,t.parentPath,e=>{const n=[...e.children];return n.splice(t.index,0,t.node),{...e,children:n}})}(e,t);case"removeNode":return function(e,t){if(0===t.parentPath.length){const n=[...e.children];return n.splice(t.index,1),{children:n}}return Xe(e,t.parentPath,e=>{const n=[...e.children];return n.splice(t.index,1),{...e,children:n}})}(e,t);case"setNodeAttr":return function(e,t){const n=t.path[t.path.length-1];return n?Qe(e,n,e=>({...e,attrs:t.attrs})):e}(e,t);case"insertInlineNode":return function(e,t){return Qe(e,t.blockId,e=>{const n=function(e,t,n){const s=[];let r=0,i=!1;for(const o of e){if(S(o)){i||t!==r||(s.push(n),i=!0),s.push(o),r+=1;continue}const e=r+o.text.length;if(!i&&t>=r&&t<=e){const e=t-r,a=o.text.slice(0,e),c=o.text.slice(e);a&&s.push(b(a,o.marks)),s.push(n),c&&s.push(b(c,o.marks)),i=!0}else s.push(o);r=e}return i||s.push(n),s}(C(e),t.offset,t.node);return{...e,children:nt(e.children,x(n))}})}(e,t);case"removeInlineNode":return function(e,t){return Qe(e,t.blockId,e=>{const n=function(e,t){const n=[];let s=0;for(const r of e)S(r)?(s!==t&&n.push(r),s+=1):(n.push(r),s+=r.text.length);return n}(C(e),t.offset);return{...e,children:nt(e.children,x(n))}})}(e,t);case"setInlineNodeAttr":return function(e,t){return Qe(e,t.blockId,e=>{const n=function(e,t,n){const s=[];let r=0;for(const i of e)S(i)?(r===t?s.push({...i,attrs:n}):s.push(i),r+=1):(s.push(i),r+=i.text.length);return s}(C(e),t.offset,t.attrs);return{...e,children:nt(e.children,n)}})}(e,t)}}function rt(e){switch(e.type){case"insertText":return{type:"deleteText",blockId:e.blockId,from:e.offset,to:e.offset+e.text.length,deletedText:e.text,deletedMarks:e.marks,deletedSegments:e.segments??[{text:e.text,marks:[...e.marks]}],...e.path?{path:e.path}:{}};case"deleteText":return{type:"insertText",blockId:e.blockId,offset:e.from,text:e.deletedText,marks:e.deletedMarks,segments:e.deletedSegments,...e.path?{path:e.path}:{}};case"splitBlock":return{type:"mergeBlocks",targetBlockId:e.blockId,sourceBlockId:e.newBlockId,targetLengthBefore:e.offset,...e.path?{path:e.path}:{}};case"mergeBlocks":return{type:"splitBlock",blockId:e.targetBlockId,offset:e.targetLengthBefore,newBlockId:e.sourceBlockId,...e.path?{path:e.path}:{}};case"addMark":return{type:"removeMark",blockId:e.blockId,from:e.from,to:e.to,mark:e.mark,...e.path?{path:e.path}:{}};case"removeMark":return{type:"addMark",blockId:e.blockId,from:e.from,to:e.to,mark:e.mark,...e.path?{path:e.path}:{}};case"setStoredMarks":return{type:"setStoredMarks",marks:e.previousMarks,previousMarks:e.marks};case"setBlockType":return{type:"setBlockType",blockId:e.blockId,nodeType:e.previousNodeType,attrs:e.previousAttrs,previousNodeType:e.nodeType,previousAttrs:e.attrs,...e.path?{path:e.path}:{}};case"insertNode":return{type:"removeNode",parentPath:e.parentPath,index:e.index,removedNode:e.node};case"removeNode":return{type:"insertNode",parentPath:e.parentPath,index:e.index,node:e.removedNode};case"setNodeAttr":return{type:"setNodeAttr",path:e.path,attrs:e.previousAttrs,previousAttrs:e.attrs};case"insertInlineNode":return{type:"removeInlineNode",blockId:e.blockId,offset:e.offset,removedNode:e.node,...e.path?{path:e.path}:{}};case"removeInlineNode":return{type:"insertInlineNode",blockId:e.blockId,offset:e.offset,node:e.removedNode,...e.path?{path:e.path}:{}};case"setInlineNodeAttr":return{type:"setInlineNodeAttr",blockId:e.blockId,offset:e.offset,attrs:e.previousAttrs,previousAttrs:e.attrs,...e.path?{path:e.path}:{}}}}function it(e){return{steps:e.steps.map(rt).reverse(),selectionBefore:e.selectionAfter,selectionAfter:e.selectionBefore,storedMarksAfter:null,metadata:{origin:"history",timestamp:Date.now()}}}class ot{steps=[];selection;storedMarks;selectionBefore;origin;workingDoc;_readonlyAllowed=!1;constructor(e,t,n="api",s){this.selection=e,this.selectionBefore=e,this.storedMarks=t,this.origin=n,this.workingDoc=s??null}insertText(e,t,n,s,r){const i={type:"insertText",blockId:e,offset:t,text:n,marks:s,...r?{segments:r}:{}};return this.steps.push(i),this.advanceDoc(i),this}deleteText(e,t,n,s,r,i){let o;if(i)o=i;else if(this.workingDoc){const i=H(this.workingDoc,e);o=i?I(i,t,n):[{text:s,marks:[...r]}]}else o=[{text:s,marks:[...r]}];const a={type:"deleteText",blockId:e,from:t,to:n,deletedText:s,deletedMarks:r,deletedSegments:o};return this.steps.push(a),this.advanceDoc(a),this}deleteTextAt(e,t,n){const s=this.workingDoc;if(!s)throw new Error("deleteTextAt requires a document. Use state.transaction() or provide doc to constructor.");const r=H(s,e);if(!r)throw new Error(`Block "${e}" not found in working document.`);const i=M(r).slice(t,n),o=B(r,t),a=I(r,t,n);return this.deleteText(e,t,n,i,o,a)}splitBlock(e,t,n){const s={type:"splitBlock",blockId:e,offset:t,newBlockId:n};return this.steps.push(s),this.advanceDoc(s),this}mergeBlocks(e,t,n){const s={type:"mergeBlocks",targetBlockId:e,sourceBlockId:t,targetLengthBefore:n};return this.steps.push(s),this.advanceDoc(s),this}mergeBlocksAt(e,t){const n=this.workingDoc;if(!n)throw new Error("mergeBlocksAt requires a document. Use state.transaction() or provide doc to constructor.");const s=H(n,e);if(!s)throw new Error(`Target block "${e}" not found in working document.`);const r=E(s);return this.mergeBlocks(e,t,r)}addMark(e,t,n,s){const r={type:"addMark",blockId:e,from:t,to:n,mark:s};return this.steps.push(r),this.advanceDoc(r),this}removeMark(e,t,n,s){const r={type:"removeMark",blockId:e,from:t,to:n,mark:s};return this.steps.push(r),this.advanceDoc(r),this}setBlockType(e,t,n){const s=this.workingDoc;if(!s)throw new Error("setBlockType requires a document. Use state.transaction() or provide doc to constructor.");const r=H(s,e);if(!r)throw new Error(`Block "${e}" not found in working document.`);const i={type:"setBlockType",blockId:e,nodeType:t,...n?{attrs:n}:{},previousNodeType:r.type,...r.attrs?{previousAttrs:r.attrs}:{}};return this.steps.push(i),this.advanceDoc(i),this}insertNode(e,t,n){const s={type:"insertNode",parentPath:e,index:t,node:n};return this.steps.push(s),this.advanceDoc(s),this}removeNode(e,t){const n=this.workingDoc;if(!n)throw new Error("removeNode requires a document. Use state.transaction() or provide doc to constructor.");const s=function(e,t,n){if(0===t.length){const t=e.children[n];return t&&k(t)?t:void 0}const s=_(e,t);if(!s)return;const r=s.children[n];return r&&k(r)?r:void 0}(n,e,t);if(!s)throw new Error(`Node at index ${t} not found under parent path [${e.join(", ")}].`);const r={type:"removeNode",parentPath:e,index:t,removedNode:s};return this.steps.push(r),this.advanceDoc(r),this}setNodeAttr(e,t){const n=this.workingDoc;if(!n)throw new Error("setNodeAttr requires a document. Use state.transaction() or provide doc to constructor.");const s=_(n,e);if(!s)throw new Error(`Node not found at path [${e.join(", ")}].`);const r={type:"setNodeAttr",path:e,attrs:t,...s.attrs?{previousAttrs:s.attrs}:{}};return this.steps.push(r),this.advanceDoc(r),this}insertInlineNode(e,t,n){const s={type:"insertInlineNode",blockId:e,offset:t,node:n};return this.steps.push(s),this.advanceDoc(s),this}removeInlineNode(e,t){const n=this.workingDoc;if(!n)throw new Error("removeInlineNode requires a document. Use state.transaction() or provide doc.");const s=H(n,e);if(!s)throw new Error(`Block "${e}" not found in working document.`);const r=A(s,t);if(!r||"inline"!==r.kind)throw new Error(`No InlineNode at offset ${t} in block "${e}".`);const i={type:"removeInlineNode",blockId:e,offset:t,removedNode:r.node};return this.steps.push(i),this.advanceDoc(i),this}setInlineNodeAttr(e,t,n){const s=this.workingDoc;if(!s)throw new Error("setInlineNodeAttr requires a document. Use state.transaction() or provide doc.");const r=H(s,e);if(!r)throw new Error(`Block "${e}" not found in working document.`);const i=C(r);let o=0;for(const a of i){if(S(a)&&o===t){const s={type:"setInlineNodeAttr",blockId:e,offset:t,attrs:n,previousAttrs:a.attrs};return this.steps.push(s),this.advanceDoc(s),this}o+=S(a)?1:a.text.length}throw new Error(`No InlineNode at offset ${t} in block "${e}".`)}readonlyAllowed(){return this._readonlyAllowed=!0,this}setSelection(e){return this.selection=e,this}setNodeSelection(e,t){return this.selection=F(e,t),this}setStoredMarks(e,t){return this.steps.push({type:"setStoredMarks",marks:e,previousMarks:t}),this.storedMarks=e,this}build(){return{steps:[...this.steps],selectionBefore:this.selectionBefore,selectionAfter:this.selection,storedMarksAfter:this.storedMarks,metadata:{origin:this.origin,timestamp:Date.now(),...this._readonlyAllowed?{readonlyAllowed:!0}:{}}}}advanceDoc(e){this.workingDoc&&(this.workingDoc=st(this.workingDoc,e))}}class at{doc;selection;storedMarks;schema;_blockMap=null;_blockOrder=null;constructor(e,t,n,s){this.doc=e,this.selection=t,this.storedMarks=n,this.schema=s}static create(e){const t=e?.schema??be(),n=e?.doc??N(),s=n.children[0],r=e?.selection??K(s?s.id:ge(""),0);return new at(n,r,null,t)}transaction(e="api"){return new ot(this.selection,this.storedMarks,e,this.doc)}apply(e){let t=this.doc;for(const s of e.steps)t=st(t,s);const n=function(e,t){if($(t))return H(e,t.nodeId)?t:lt(e,t);if(j(t))return H(e,t.blockId)?t:lt(e,t);const n=ct(e,t.anchor),s=ct(e,t.head);return n===t.anchor&&s===t.head?t:V(n,s)}(t,e.selectionAfter);return new at(t,n,e.storedMarksAfter,this.schema)}getBlock(e){return this._blockMap??=function(e){const t=/* @__PURE__ */new Map;return function e(n){for(const s of n)k(s)&&(t.set(s.id,s),e(s.children))}(e.children),t}(this.doc),this._blockMap.get(e)}getBlockOrder(){return this._blockOrder??=function(e){const t=[];return function e(n){for(const s of n)k(s)&&(P(s)?t.push(s.id):e(s.children))}(e.children),t}(this.doc),this._blockOrder}getNodePath(e){return z(this.doc,e)}getParent(e){const t=z(this.doc,e);if(!t||t.length<=1)return;const n=t[t.length-2];return n?H(this.doc,n):void 0}toJSON(){return{doc:this.doc,selection:this.selection}}static fromJSON(e,t){return new at(e.doc,e.selection,null,t??be())}}function ct(e,t){const n=H(e,t.blockId);if(n){const e=E(n);return t.offset>e?U(t.blockId,e,t.path):t}const s=e.children[0];return s?U(s.id,0):t}function lt(e,t){const n=ht(e.children);return n?K(n.id,0):t}function ht(e){for(const t of e){if(!k(t))continue;if(P(t))return t;const e=ht(t.children);if(e)return e}return null}function dt(e){for(const t of e.steps)if("setStoredMarks"!==t.type)return!1;return!0}function pt(e){return!!e.metadata.readonlyAllowed||dt(e)}class ut{undoStack=[];redoStack=[];groupTimeoutMs;maxDepth;lastOrigin=null;constructor(e){this.groupTimeoutMs=e?.groupTimeoutMs??500,this.maxDepth=e?.maxDepth??100}push(e){if("history"===e.metadata.origin)return;if(!e.steps.some(e=>"setStoredMarks"!==e.type))return void(this.lastOrigin=null);const t=e.metadata.timestamp,n=this.undoStack[this.undoStack.length-1];for(n&&"input"===e.metadata.origin&&"input"===this.lastOrigin&&t-n.timestamp<this.groupTimeoutMs&&this.isSameInputType(n.transactions,e)&&n?this.undoStack[this.undoStack.length-1]={transactions:[...n.transactions,e],timestamp:t}:this.undoStack.push({transactions:[e],timestamp:t}),this.lastOrigin=e.metadata.origin,this.redoStack=[];this.undoStack.length>this.maxDepth;)this.undoStack.shift()}undo(e){const t=this.undoStack.pop();if(!t)return null;let n=e;const s=[];for(let r=t.transactions.length-1;r>=0;r--){const e=t.transactions[r];if(!e)continue;const i=it(e);n=n.apply(i),s.push(...i.steps)}return this.redoStack.push({transactions:t.transactions,timestamp:Date.now()}),this.lastOrigin=null,{state:n,transaction:{steps:s,selectionBefore:e.selection,selectionAfter:n.selection,storedMarksAfter:n.storedMarks,metadata:{origin:"history",timestamp:Date.now(),historyDirection:"undo"}}}}redo(e){const t=this.redoStack.pop();if(!t)return null;let n=e;const s=[];for(const r of t.transactions)n=n.apply(r),s.push(...r.steps);return this.undoStack.push({transactions:t.transactions,timestamp:Date.now()}),this.lastOrigin=null,{state:n,transaction:{steps:s,selectionBefore:e.selection,selectionAfter:n.selection,storedMarksAfter:n.storedMarks,metadata:{origin:"history",timestamp:Date.now(),historyDirection:"redo"}}}}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}clear(){this.undoStack=[],this.redoStack=[],this.lastOrigin=null}isSameInputType(e,t){const n=e[e.length-1];if(!n)return!1;const s=n.steps[0]?.type,r=t.steps[0]?.type;return s===r}}function ft(n,s){const r=n.selection;if($(r))return e(n,r);if(j(r))return null;if(!W(r))return t(n);const i=n.getBlock(r.anchor.blockId);if(!i)return null;const o=s.range(i,r.anchor.offset);if(!o)return s.merge(n);const[a,c]=o;return n.transaction("input").deleteTextAt(i.id,a,c).setSelection(K(i.id,a)).build()}function gt(e){return ft(e,{merge:s,range:(e,t)=>t>0?[t-1,t]:null})}function mt(e){return ft(e,{merge:n,range:(e,t)=>t<E(e)?[t,t+1]:null})}class yt{constructor(e,t){this.element=e,this.getState=t.getState,this.dispatch=t.dispatch,this.undo=t.undo,this.redo=t.redo,this.keymapRegistry=t.keymapRegistry,this.isReadOnly=t.isReadOnly??(()=>!1),this.compositionTracker=t.compositionTracker,this.getTextDirectionFn=t.getTextDirection??(()=>"ltr"),this.navigateFromGapCursorFn=t.navigateFromGapCursor,this.handleKeydown=this.onKeydown.bind(this),e.addEventListener("keydown",this.handleKeydown)}getState;dispatch;undo;redo;keymapRegistry;isReadOnly;compositionTracker;getTextDirectionFn;navigateFromGapCursorFn;handleKeydown;onKeydown(e){if(this.compositionTracker?.isComposing)return;if(this.handleNodeSelectionKeys(e))return;if(this.handleGapCursorKeys(e))return;if(this.isReadOnly()){if(this.keymapRegistry){const t=kt(e),n=this.keymapRegistry.getKeymapsByPriority().navigation;for(let s=n.length-1;s>=0;s--){const r=n[s]?.[t];if(r?.())return void e.preventDefault()}}return void this.handleEscape(e)}if(this.keymapRegistry){const t=kt(e),n=this.keymapRegistry.getKeymapsByPriority();for(const s of[n.context,n.navigation,n.default])for(let n=s.length-1;n>=0;n--){const r=s[n]?.[t];if(r?.())return void e.preventDefault()}}if(this.handleGapCursorArrowFallback(e))return;if(this.handleTab(e))return;if(this.handleEscape(e))return;if(!e.metaKey&&!e.ctrlKey)return;const t=e.key.toLowerCase(),n=this.getState();let s=null;return"z"!==t||e.shiftKey?"z"===t&&e.shiftKey||"y"===t&&!e.shiftKey?(e.preventDefault(),void this.redo()):("a"!==t||e.shiftKey||(e.preventDefault(),s=r(n)),void(s&&this.dispatch(s))):(e.preventDefault(),void this.undo())}handleNodeSelectionKeys(t){const n=this.getState(),s=n.selection;if(!$(s))return!1;const r=t.key;if(!("ArrowLeft"!==r&&"ArrowUp"!==r&&"ArrowRight"!==r&&"ArrowDown"!==r||t.shiftKey||t.metaKey||t.ctrlKey||t.altKey)){const e="ArrowLeft"===r?"left":"ArrowRight"===r?"right":"ArrowUp"===r?"up":"down",o=this.isSelectedBlockRtl(s.nodeId),a=i(n,e,o);return!!a&&(t.preventDefault(),this.dispatch(a),!0)}if("Backspace"===r||"Delete"===r){if(this.isReadOnly())return t.preventDefault(),!0;t.preventDefault();const r=e(n,s);return r&&this.dispatch(r),!0}if("Enter"===r){if(this.isReadOnly())return t.preventDefault(),!0;t.preventDefault();const e=o(n);return e&&this.dispatch(e),!0}if("Escape"===r){t.preventDefault();const e=i(n,"right");return e&&this.dispatch(e),!0}return!1}handleGapCursorKeys(e){const t=this.getState(),n=t.selection;if(!j(n))return!1;const s=e.key;if("ArrowLeft"===s||"ArrowRight"===s||"ArrowUp"===s||"ArrowDown"===s)return!1;if("Escape"===s||"Tab"===s)return!1;if(e.ctrlKey||e.metaKey||e.altKey)return!1;if("Enter"===s){if(this.isReadOnly())return e.preventDefault(),!0;e.preventDefault();const n=o(t);return n&&this.dispatch(n),!0}if("Backspace"===s){if(this.isReadOnly())return e.preventDefault(),!0;e.preventDefault();const s=a(t,n);return s&&this.dispatch(s),!0}if("Delete"===s){if(this.isReadOnly())return e.preventDefault(),!0;e.preventDefault();const s=c(t,n);return s&&this.dispatch(s),!0}if(1===s.length){if(this.isReadOnly())return e.preventDefault(),!0;e.preventDefault();const n=l(t,s);return this.dispatch(n),!0}return!1}handleGapCursorArrowFallback(e){const t=this.getState(),n=t.selection;if(!j(n))return!1;const s=e.key;if("ArrowLeft"!==s&&"ArrowRight"!==s&&"ArrowUp"!==s&&"ArrowDown"!==s)return!1;const r="ArrowLeft"===s?"left":"ArrowRight"===s?"right":"ArrowUp"===s?"up":"down";if(!this.navigateFromGapCursorFn)return!1;const i=this.navigateFromGapCursorFn(t,r,this.element);return!(!i||q(i.selectionAfter,n)||(e.preventDefault(),this.dispatch(i),0))}handleTab(e){if("Tab"!==e.key)return!1;if(e.metaKey||e.ctrlKey||e.altKey)return!1;if(e.preventDefault(),e.shiftKey)return!0;const t=this.getState(),n=l(t,"\t");return this.dispatch(n),!0}handleEscape(e){return"Escape"===e.key&&(this.element.blur(),!0)}isSelectedBlockRtl(e){const t=this.element.querySelector(`[data-block-id="${e}"]`);return t instanceof HTMLElement&&"rtl"===this.getTextDirectionFn(t)}destroy(){this.element.removeEventListener("keydown",this.handleKeydown)}}function kt(e){const t=[];(e.metaKey||e.ctrlKey)&&t.push("Mod"),e.shiftKey&&t.push("Shift"),e.altKey&&t.push("Alt");let n=e.key;return" "===n?n="Space":1===n.length&&(n=n.toUpperCase()),t.push(n),t.join("-")}let St;function bt(e){return e.replace(/\r\n?/g,"\n")}class vt{constructor(e,t){this.element=e,this.getState=t.getState,this.dispatch=t.dispatch,this.schemaRegistry=t.schemaRegistry,this.syncSelection=t.syncSelection,this.isReadOnly=t.isReadOnly??(()=>!1),this.handleCopy=this.onCopy.bind(this),this.handleCut=this.onCut.bind(this),e.addEventListener("copy",this.handleCopy),e.addEventListener("cut",this.handleCut)}getState;dispatch;schemaRegistry;syncSelection;isReadOnly;handleCopy;handleCut;onCopy(e){this.syncSelection?.();const t=this.getState(),n=t.selection;if(j(n))return;if(G(n)&&W(n))return;e.preventDefault();const s=e.clipboardData;s&&($(n)?this.writeNodeSelectionToClipboard(s,t):this.writeTextSelectionToClipboard(s,t))}onCut(n){if(this.isReadOnly())return;this.syncSelection?.();const s=this.getState(),r=s.selection;if(j(r))return;if(G(r)&&W(r))return;n.preventDefault();const i=n.clipboardData;if(i)if($(r)){this.writeNodeSelectionToClipboard(i,s);const t=e(s,r);t&&this.dispatch(t)}else{this.writeTextSelectionToClipboard(i,s);const e=t(s);e&&this.dispatch(e)}}writeNodeSelectionToClipboard(e,t){const n=t.selection;if(!$(n))return;const s=t.getBlock(n.nodeId);if(!s)return;const r={type:s.type,...s.attrs?{attrs:{...s.attrs}}:{}};e.setData("application/x-notectl-block",JSON.stringify(r));const i=this.schemaRegistry?.getNodeSpec(s.type);i?.toHTML&&e.setData("text/html",i.toHTML(s,""));const o=s.attrs,a="string"==typeof o?.alt?o.alt:"";e.setData("text/plain",a)}writeTextSelectionToClipboard(e,t){const n=t.selection;if($(n))return;if(j(n))return;if(W(n))return;if(this.selectionRequiresDocumentSerializer(t))return void this.writeCompositeSelectionToClipboard(e,t);const s=t.getBlockOrder(),r=Q(n,s),i=s.indexOf(r.from.blockId),o=s.indexOf(r.to.blockId),a=[],c=[],l=[];for(let d=i;d<=o;d++){const e=s[d];if(!e)continue;const n=t.getBlock(e);if(!n)continue;const h=M(n),p=E(n),u=d===i?r.from.offset:0,f=d===o?r.to.offset:p,g=h.slice(u,f);a.push(g),l.push({block:n,start:u,end:f});const m=this.extractSegmentsForRange(n,u,f);c.push({type:n.type,text:g,...n.attrs?{attrs:{...n.attrs}}:{},...m.length>0?{segments:m}:{}})}const h=a.join("\n");if(e.setData("text/plain",h),this.schemaRegistry){const n=J(this.schemaRegistry);if(i!==o){const t=this.serializeBlocksToClipboardHTML(l,n,c);e.setData("text/html",t)}else{const o=s[i],a=o?t.getBlock(o):void 0;if(a){const t=this.serializeBlockRangeToHTML(a,r.from.offset,r.to.offset,n);e.setData("text/html",t)}}}!function(e,t){St={plainText:bt(e),blocks:t}}(h,c)}selectionRequiresDocumentSerializer(e){const t=this.getTextSelection(e);if(!t||W(t))return!1;const n=e.getBlockOrder(),s=Q(t,n),r=z(e.doc,s.from.blockId),i=z(e.doc,s.to.blockId);if(!r||!i)return!1;if(r[0]===i[0]){const t=e.doc.children.find(e=>e.id===r[0]);return!(!t||P(t))}const o=e.doc.children.findIndex(e=>e.id===r[0]),a=e.doc.children.findIndex(e=>e.id===i[0]);for(let c=o;c<=a;c++){const t=e.doc.children[c];if(!t)continue;if(!P(t))return!0;const n=this.schemaRegistry?.getNodeSpec(t.type);if(n?.isVoid)return!0}return!1}getTextSelection(e){const t=e.selection;if(!$(t)&&!j(t))return t}writeCompositeSelectionToClipboard(e,t){const n=this.getTextSelection(t);if(!n)return;const s=t.getBlockOrder(),r=Q(n,s),i=s.indexOf(r.from.blockId),o=s.indexOf(r.to.blockId),a=[];for(let c=i;c<=o;c++){const e=s[c];if(!e)continue;const n=t.getBlock(e);if(!n)continue;const l=M(n),h=c===i?r.from.offset:0,d=c===o?r.to.offset:E(n);a.push(l.slice(h,d))}if(e.setData("text/plain",a.join("\n")),this.schemaRegistry){const n=z(t.doc,r.from.blockId),s=z(t.doc,r.to.blockId);if(n&&s){const r=t.doc.children.findIndex(e=>e.id===n[0]),i=t.doc.children.findIndex(e=>e.id===s[0]),o=t.doc.children.slice(r,i+1),a=N(o),c=X(a,this.schemaRegistry);e.setData("text/html",c)}}}serializeBlockRangeToHTML(e,t,n,s){const r=C(e),i=[];let o=0;for(const a of r){const e=o+(S(a)?1:a.text.length);if(e<=t||o>=n)o=e;else{if(v(a)){const e=Math.max(0,t-o),r=Math.min(a.text.length,n-o),c=a.text.slice(e,r);c.length>0&&this.schemaRegistry&&i.push(Y(c,a.marks,this.schemaRegistry,s))}else if(S(a)){const e=this.schemaRegistry?.getInlineNodeSpec(a.inlineType);e?.toHTMLString&&i.push(e.toHTMLString(a))}o=e}}return i.join("")}extractSegmentsForRange(e,t,n){const s=C(e),r=[];let i=0;for(const o of s){const e=i+(S(o)?1:o.text.length);if(e<=t||i>=n)i=e;else{if(v(o)){const e=Math.max(0,t-i),s=Math.min(o.text.length,n-i),a=o.text.slice(e,s);if(a.length>0){const e=o.marks.map(e=>({type:e.type,...e.attrs?{attrs:{...e.attrs}}:{}}));r.push({text:a,marks:e})}}i=e}}return r}serializeBlocksToClipboardHTML(e,t,n){const s=[];let r,i=[];const o=()=>{i.length>0&&r&&(s.push(`<${r}>${i.join("")}</${r}>`),i=[],r=void 0)};for(const c of e){const{block:e,start:n,end:a}=c,l=this.serializeBlockRangeToHTML(e,n,a,t),h=this.schemaRegistry?.getNodeSpec(e.type);if(h?.wrapper){const t=h.wrapper(e).tag;r!==t&&(o(),r=t),h.toHTML?i.push(h.toHTML(e,l)):i.push(`<li>${l}</li>`)}else o(),h?.toHTML?s.push(h.toHTML(e,l)):s.push(`<p>${l}</p>`)}o();const a=JSON.stringify(n).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;");return s.push(`<span data-notectl-rich="${a}" hidden></span>`),s.join("")}destroy(){this.element.removeEventListener("copy",this.handleCopy),this.element.removeEventListener("cut",this.handleCut)}}class wt{_composing=!1;_activeBlockId=null;get isComposing(){return this._composing}get activeBlockId(){return this._activeBlockId}start(e){this._composing=!0,this._activeBlockId=e}end(){this._composing=!1,this._activeBlockId=null}}class Rt{constructor(e,t){this.element=e,this.getState=t.getState,this.dispatch=t.dispatch,this.syncSelection=t.syncSelection,this.inputRuleRegistry=t.inputRuleRegistry,this.isReadOnly=t.isReadOnly??(()=>!1),this.compositionTracker=t.compositionTracker??new wt,this.handleBeforeInput=this.onBeforeInput.bind(this),this.handleCompositionStart=this.onCompositionStart.bind(this),this.handleCompositionEnd=this.onCompositionEnd.bind(this),e.addEventListener("beforeinput",this.handleBeforeInput),e.addEventListener("compositionstart",this.handleCompositionStart),e.addEventListener("compositionend",this.handleCompositionEnd)}getState;dispatch;syncSelection;inputRuleRegistry;isReadOnly;compositionTracker;handleBeforeInput;handleCompositionStart;handleCompositionEnd;onBeforeInput(e){if(this.isReadOnly())return;if(this.compositionTracker.isComposing&&"insertCompositionText"===e.inputType)return;e.preventDefault(),"insertText"!==e.inputType&&"insertCompositionText"!==e.inputType&&this.syncSelection();const t=this.getState();let r=null;switch(e.inputType){case"insertText":e.data&&(r=l(t,e.data,"input"));break;case"insertParagraph":r=o(t);break;case"insertLineBreak":r=h(t);break;case"deleteContentBackward":case"deleteByCut":r=gt(t);break;case"deleteContentForward":r=mt(t);break;case"deleteWordBackward":r=function(e){return ft(e,{merge:s,range:(e,t)=>t>0?[te(e,t),t]:null})}(t);break;case"deleteWordForward":r=function(e){return ft(e,{merge:n,range:(e,t)=>t<E(e)?[t,ee(e,t)]:null})}(t);break;case"deleteSoftLineBackward":r=function(e){return ft(e,{merge:s,range:(e,t)=>t>0?[0,t]:null})}(t);break;case"deleteSoftLineForward":r=function(e){return ft(e,{merge:n,range:(e,t)=>{const n=E(e);return t<n?[t,n]:null}})}(t)}r&&(this.dispatch(r),"insertText"===e.inputType&&this.checkInputRules())}onCompositionStart(e){const t=this.getState();$(t.selection)||j(t.selection)||this.compositionTracker.start(t.selection.anchor.blockId)}onCompositionEnd(e){if(this.compositionTracker.end(),this.isReadOnly())return;const t=e.data;if(!t)return;const n=this.getState(),s=l(n,t,"input");this.dispatch(s)}checkInputRules(){if(!this.inputRuleRegistry)return;const e=this.inputRuleRegistry.getInputRules();if(0===e.length)return;const t=this.getState();if($(t.selection)||j(t.selection))return;const{anchor:n}=t.selection,s=t.getBlock(n.blockId);if(!s)return;const r=M(s).slice(0,n.offset);for(const i of e){const e=i.pattern.exec(r);if(e){const n=e.index,s=n+e[0].length,r=i.handler(t,e,n,s);if(r)return void this.dispatch(r)}}}destroy(){this.element.removeEventListener("beforeinput",this.handleBeforeInput),this.element.removeEventListener("compositionstart",this.handleCompositionStart),this.element.removeEventListener("compositionend",this.handleCompositionEnd)}}function Ct(e){return e.reduce((e,t)=>e+t.text,"")}function xt(e){return e.reduce((e,t)=>e+t.text.length,0)}function Et(e,t){if(0===t.blocks.length)return e.transaction("paste").setSelection(e.selection).build();const n=t.blocks[0];return n?1===t.blocks.length&&n.type===me("paragraph")?function(e,t){const n=e.selection;if($(n))return e.transaction("paste").setSelection(n).build();if(j(n))return function(e,t,n){const s=Tt(e,t);if(!s)return e.transaction("paste").setSelection(t).build();const r=D(),i=Ct(n),o=xt(n),a=e.transaction("paste");return a.insertNode(s.parentPath,s.insertIndex,T(me("paragraph"),[b("")],r)),i.length>0&&a.insertText(r,0,i,[],n),a.setSelection(K(r,o)),a.build()}(e,n,t);const s=e.transaction("paste");W(n)||d(e,s);const{blockId:r,offset:i}=p(n,e.getBlockOrder()),o=xt(t),a=Ct(t);return s.insertText(r,i,a,[],t),s.setSelection(K(r,i+o)),s.build()}(e,n.segments):1===t.blocks.length?function(e,t){const n=e.selection;if($(n))return e.transaction("paste").setSelection(n).build();if(j(n))return It(e,n,[t]);const s=e.transaction("paste");W(n)||d(e,s);const{blockId:r,offset:i}=p(n,e.getBlockOrder()),o=xt(t.segments),a=Ct(t.segments);return s.setBlockType(r,t.type,t.attrs),s.insertText(r,i,a,[],t.segments),s.setSelection(K(r,i+o)),s.build()}(e,n):function(e,t){const n=e.selection;if($(n))return e.transaction("paste").setSelection(n).build();if(j(n))return It(e,n,t.blocks);const s=e.transaction("paste");W(n)||d(e,s);const r=e.getBlockOrder(),{blockId:i,offset:o}=p(n,r),a=r.indexOf(i),c=t.blocks[0],l=t.blocks[t.blocks.length-1];if(!c||!l)return s.build();const h=t.blocks.slice(1,-1),u=xt(c.segments);c.segments.length>0&&u>0&&s.insertText(i,o,Ct(c.segments),[],c.segments),c.type!==me("paragraph")&&s.setBlockType(i,c.type,c.attrs);const f=o+u,g=D();s.splitBlock(i,f,g);let m=a+1;for(const d of h){const e=d.segments.map(e=>b(e.text,[...e.marks])),t=T(d.type,e.length>0?e:void 0,D(),d.attrs);s.insertNode([],m,t),m++}const y=xt(l.segments);return l.segments.length>0&&y>0&&s.insertText(g,0,Ct(l.segments),[],l.segments),l.type!==me("paragraph")&&s.setBlockType(g,l.type,l.attrs),s.setSelection(K(g,y)),s.build()}(e,t):e.transaction("paste").setSelection(e.selection).build()}function Tt(e,t){const n=z(e.doc,t.blockId);if(!n)return null;const s=n.length>1?n.slice(0,-1):[],r=(0===s.length?e.doc.children:(()=>{const t=e.getBlock(s[s.length-1]);return t?t.children:[]})()).findIndex(e=>k(e)&&e.id===t.blockId);if(r<0)return null;const i="before"===t.side?r:r+1;return{parentPath:s,insertIndex:i}}function It(e,t,n){const s=Tt(e,t);if(!s)return e.transaction("paste").setSelection(t).build();const r=e.transaction("paste");let i,o=s.insertIndex,a=0;for(const c of n){const e=D(),t=Ct(c.segments),n=c.segments.map(e=>b(e.text,[...e.marks])),l=T(c.type,n.length>0?n:[b("")],e,c.attrs);r.insertNode(s.parentPath,o,l),o++,i=e,a=t.length}return i&&r.setSelection(K(i,a)),r.build()}function Mt(e,t,n){const s=z(e.doc,t),r=s&&s.length>1?s.slice(0,-1):[],i=function(e,t){if(0===t.length)return e.doc.children;const n=e.getBlock(t[t.length-1]);return n?n.children:[]}(e,r),o=i.findIndex(e=>k(e)&&e.id===t);if(!(o<0))return{parentPath:r,anchorIndex:o,isAnchorEmpty:Ot(e,t,n)}}function Bt(e,t,n,s){const r=z(e.doc,n);if(!r)return;const i=e.getBlock(n);return i?{parentPath:r,anchorIndex:i.children.findIndex(e=>k(e)&&e.id===t),isAnchorEmpty:Ot(e,t,s)}:void 0}function At(e,t){const n=e.getBlock(t);if("table_cell"===n?.type)return t;const s=z(e.doc,t);if(s)for(const r of s){const t=e.getBlock(r);if("table_cell"===t?.type)return r}}function Nt(e,t){const n=e.children.map(e=>k(e)?Nt(e,D()):e);return T(e.type,n,t,e.attrs)}function Pt(e,t){if(e.id===t)return e;for(const n of e.children){if(!k(n))continue;const e=Pt(n,t);if(e)return e}}function Dt(e,t){if(!t)return;const n={};let s=!1;for(const r of Object.keys(t)){const i=t[r],o=e?.[r];"string"==typeof o||"number"==typeof o||"boolean"==typeof o?n[r]=o:void 0!==i.default&&(n[r]=i.default),r in n&&(s=!0)}return s?n:void 0}function Ot(e,t,n){const s=e.getBlock(t);if(!s)return!1;const r=n?.getNodeSpec(s.type);return!r?.isVoid&&""===M(s)}function Lt(e,t){if(!e.type)return;if(!t)return e;const n=t.getNodeSpec(e.type);if(!n)return;const s=Dt(e.attrs,n.attrs);return{...e,attrs:s}}function Ht(e){const t=D(),n=function(e,t){return e.segments&&e.segments.length>0?function(e){const t=[];for(const n of e){if(0===n.text.length)continue;const e=n.marks.map(e=>({type:e.type,...e.attrs?{attrs:e.attrs}:{}}));t.push(b(n.text,e))}return t}(e.segments):t?[b(t)]:void 0}(e,e.text??""),s=e.attrs?e.attrs:void 0;return T(me(e.type),n,t,s)}const _t=/* @__PURE__ */new Set(["P","DIV","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","LI","HR","PRE","TABLE","THEAD","TBODY","TR"]),zt=/* @__PURE__ */new Set(["STRONG","B","EM","I","U","S","STRIKE","DEL","A","SPAN","BR","SUB","SUP","CODE"]);class Ft{schema;blockParseRules;markParseRules;constructor(e){this.schema=e.schema,this.blockParseRules=e.schemaRegistry?.getBlockParseRules()??[],this.markParseRules=e.schemaRegistry?.getMarkParseRules()??[]}parse(e){const t=this.parseContainer(e);return 0===t.length?{blocks:[{type:this.resolveBlockType(me("paragraph")),segments:[{text:"",marks:[]}]}]}:{blocks:t}}parseContainer(e){const t=[];let n=[];for(const s of Array.from(e.childNodes))if(s.nodeType===Node.ELEMENT_NODE){const e=s;this.isBlockElement(e)?(this.flushPendingSegments(t,n),n=[],t.push(...this.parseBlockElement(e))):e.children.length>0&&this.containsBlockDescendants(e)?(this.flushPendingSegments(t,n),n=[],t.push(...this.parseContainerWithMarks(e,this.marksFromElement(e)))):n.push(...this.parseInlineNode(s,[]))}else if(s.nodeType===Node.TEXT_NODE){const e=s.textContent??"";e&&n.push({text:e,marks:[]})}return this.flushPendingSegments(t,n),t}parseBlockElement(e){const t=e.tagName,n=/^H([1-6])$/.exec(t);if(n){const t=Number(n[1]),s=this.resolveBlockType(me("heading"));return[{type:s,...s===me("heading")?{attrs:{level:t}}:{},segments:this.ensureSegments(this.parseInlineChildren(e,[]))}]}switch(t){case"P":case"DIV":return this.parseBlockWithLineBreaks(e,this.resolveBlockType(me("paragraph")));case"BLOCKQUOTE":return this.parseBlockquote(e);case"UL":return this.parseList(e,"bullet",0);case"OL":return this.parseList(e,"ordered",0);case"LI":return this.parseListItem(e,"bullet",0);case"HR":return[{type:this.resolveBlockType(me("horizontal_rule")),segments:[]}];case"PRE":return[{type:this.resolveBlockType(me("paragraph")),segments:this.ensureSegments(this.parsePreContent(e))}];case"TABLE":case"THEAD":case"TBODY":case"TR":return this.parseTableAsParagraphs(e);default:{const t=this.matchBlockRule(e);return t?[{type:t.type,...t.attrs?{attrs:t.attrs}:{},segments:this.ensureSegments(this.parseInlineChildren(e,[]))}]:[{type:this.resolveBlockType(me("paragraph")),segments:this.ensureSegments(this.parseInlineChildren(e,[]))}]}}}parseBlockquote(e){const t=this.resolveBlockType(me("blockquote"));return Array.from(e.childNodes).some(e=>e.nodeType===Node.ELEMENT_NODE&&this.isBlockElement(e))?this.parseContainer(e).map(e=>({type:t,segments:e.segments})):[{type:t,segments:this.ensureSegments(this.parseInlineChildren(e,[]))}]}parseList(e,t,n){const s=[];for(const r of Array.from(e.children)){const e=r;"LI"===e.tagName?s.push(...this.parseListItem(e,t,n)):"UL"===e.tagName?s.push(...this.parseList(e,"bullet",n+1)):"OL"===e.tagName&&s.push(...this.parseList(e,"ordered",n+1))}return s}parseListItem(e,t,n){const s=[],r=this.resolveBlockType(me("list_item")),i=this.hasCheckbox(e),o=i?"checklist":t,a=!!i&&this.isCheckboxChecked(e),c=[],l=[];for(const h of Array.from(e.childNodes))if(h.nodeType===Node.ELEMENT_NODE){const e=h;"UL"===e.tagName||"OL"===e.tagName?l.push(e):"INPUT"===e.tagName&&"checkbox"===e.getAttribute("type")||(this.isBlockElement(e)?c.push(...this.parseInlineChildren(e,[])):c.push(...this.parseInlineNode(h,[])))}else if(h.nodeType===Node.TEXT_NODE){const e=h.textContent??"";e&&c.push({text:e,marks:[]})}s.push({type:r,attrs:{listType:o,indent:n,..."checklist"===o?{checked:a}:{}},segments:this.ensureSegments(this.normalizeSegments(c))});for(const h of l){const e="OL"===h.tagName?"ordered":"bullet";s.push(...this.parseList(h,e,n+1))}return s}parseInlineChildren(e,t){const n=[];for(const s of Array.from(e.childNodes))n.push(...this.parseInlineNode(s,t));return this.normalizeSegments(n)}parseInlineNode(e,t){if(e.nodeType===Node.TEXT_NODE){const n=e.textContent??"";return n?[{text:n,marks:this.resolveMarks(t)}]:[]}if(e.nodeType!==Node.ELEMENT_NODE)return[];const n=e,s=n.tagName;if("BR"===s)return[{text:"\n",marks:this.resolveMarks(t)}];if(this.isBlockElement(n)&&!zt.has(s))return this.parseInlineChildren(n,t);const r=this.mergeMarks(t,this.marksFromElement(n));return this.parseInlineChildren(n,r)}parsePreContent(e){const t=e.textContent??"";return t?[{text:t,marks:[]}]:[]}parseTableAsParagraphs(e){const t=[],n=e.querySelectorAll("td, th");for(const s of Array.from(n)){const e=this.parseInlineChildren(s,[]);e.length>0&&e.some(e=>e.text.length>0)&&t.push({type:this.resolveBlockType(me("paragraph")),segments:this.ensureSegments(e)})}return t}marksFromElement(e){const t=[],n=e.tagName.toLowerCase();if(this.markParseRules.length>0){const s=/* @__PURE__ */new Set;for(const r of this.markParseRules)if(r.rule.tag===n&&!s.has(r.type))if(r.rule.getAttrs){const n=r.rule.getAttrs(e);if(!1===n)continue;t.push({type:ye(r.type),...Object.keys(n).length>0?{attrs:n}:{}}),s.add(r.type)}else t.push({type:ye(r.type)}),s.add(r.type);if(s.size>0)return t}const s=e.tagName;if("STRONG"===s||"B"===s){const n=e.style.fontWeight,s=Number.parseInt(n,10);"normal"===n||!Number.isNaN(s)&&s<700||t.push({type:ye("bold")})}if("EM"!==s&&"I"!==s||t.push({type:ye("italic")}),"U"===s&&t.push({type:ye("underline")}),"S"!==s&&"STRIKE"!==s&&"DEL"!==s||t.push({type:ye("strikethrough")}),"A"===s){const n=e.getAttribute("href")??"";t.push({type:ye("link"),attrs:{href:n}})}return t}mergeMarks(e,t){const n=[...e];for(const s of t)n.some(e=>e.type===s.type)||n.push(s);return n}resolveMarks(e){return e.filter(e=>ve(this.schema,e.type))}resolveBlockType(e){return we(this.schema,e)?e:me("paragraph")}normalizeSegments(e){if(0===e.length)return[];const t=[];for(const n of e){const e=t[t.length-1];e&&O(e.marks,n.marks)?t[t.length-1]={text:e.text+n.text,marks:e.marks}:n.text.length>0&&t.push(n)}return t}ensureSegments(e){return 0===e.length?[{text:"",marks:[]}]:e}matchBlockRule(e){const t=e.tagName.toLowerCase();for(const n of this.blockParseRules)if(n.rule.tag===t){if(n.rule.getAttrs){const t=n.rule.getAttrs(e);if(!1===t)continue;return{type:me(n.type),attrs:t}}return{type:me(n.type)}}return null}isBlockElement(e){if(_t.has(e.tagName))return!0;const t=e.tagName.toLowerCase();return this.blockParseRules.some(e=>e.rule.tag===t)}hasCheckbox(e){return null!==e.querySelector('input[type="checkbox"]')}isCheckboxChecked(e){const t=e.querySelector('input[type="checkbox"]');return t?.hasAttribute("checked")??!1}containsBlockDescendants(e){for(const t of Array.from(e.children)){if(this.isBlockElement(t))return!0;if(this.containsBlockDescendants(t))return!0}return!1}parseContainerWithMarks(e,t){const n=this.parseContainer(e);return 0===t.length?n:n.map(e=>({...e,segments:this.prependMarks(e.segments,t)}))}prependMarks(e,t){return e.map(e=>({text:e.text,marks:this.mergeMarks(t,e.marks)}))}parseBlockWithLineBreaks(e,t){const n=this.parseInlineChildren(e,[]);if(!n.some(e=>e.text.includes("\n")))return[{type:t,segments:this.ensureSegments(n)}];const s=[];let r=[];for(const i of n){const e=i.text.split("\n");for(let n=0;n<e.length;n++){n>0&&(s.push({type:t,segments:this.ensureSegments(this.normalizeSegments(r))}),r=[]);const o=e[n]??"";o&&r.push({text:o,marks:i.marks})}}return s.push({type:t,segments:this.ensureSegments(this.normalizeSegments(r))}),s}flushPendingSegments(e,t){const n=this.normalizeSegments(t);0!==n.length&&(n.every(e=>""===e.text.trim())||e.push({type:this.resolveBlockType(me("paragraph")),segments:n}))}}const Kt={1:"x-small",2:"small",3:"medium",4:"large",5:"x-large",6:"xx-large",7:"xxx-large"};function $t(e){return e.toLowerCase().includes("font-size")}function jt(e,t){for(;e.firstChild;)t.appendChild(e.firstChild)}function Vt(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}class Ut{constructor(e,t){this.element=e,this.getState=t.getState,this.dispatch=t.dispatch,this.schemaRegistry=t.schemaRegistry,this.fileHandlerRegistry=t.fileHandlerRegistry,this.isReadOnly=t.isReadOnly??(()=>!1),this.handlePaste=this.onPaste.bind(this),e.addEventListener("paste",this.handlePaste)}getState;dispatch;schemaRegistry;fileHandlerRegistry;isReadOnly;handlePaste;onPaste(e){if(e.preventDefault(),this.isReadOnly())return;const t=e.clipboardData;if(!t)return;const n=t.getData("application/x-notectl-block");if(n)return void this.handleBlockPaste(n);if(this.handleFilePaste(t))return;const s=t.getData("text/plain");if(s){const e=function(e){if(St&&St.plainText===bt(e))return St.blocks}(s);if(e&&this.handleRichPaste(e))return}this.handleHTMLOrTextPaste(t,s)}handleHTMLOrTextPaste(e,t){const n=this.getState(),s=e.getData("text/html");if(s){const e=this.extractRichData(s);if(e&&this.handleRichPasteFromJson(e))return;const t=document.createElement("template");t.innerHTML=s,function(e){const t=Array.from(e.querySelectorAll("font"));for(const n of t){const e=n.getAttribute("color"),t=n.getAttribute("face"),s=n.getAttribute("size"),r=n.getAttribute("style")??"";if(!(null!==e||null!==t||null!==s||r.length>0)){Vt(n);continue}const i=document.createElement("span"),o=[];if(r&&o.push(r.endsWith(";")?r:`${r};`),e&&o.push(`color: ${e};`),t&&o.push(`font-family: ${t};`),s&&!$t(r)){const e=Kt[s];e&&o.push(`font-size: ${e};`)}xe(i,o.join(" ")),jt(n,i),n.parentNode?.replaceChild(i,n)}}(t.content);const r=t.innerHTML,i=this.schemaRegistry?this.schemaRegistry.getAllowedTags():["strong","em","u","b","i","p","br","div","span"],o=this.schemaRegistry?this.schemaRegistry.getAllowedAttrs():[],a=fe.sanitize(r,{ALLOWED_TAGS:i,ALLOWED_ATTR:o,ALLOWED_URI_REGEXP:ke});if(this.schemaRegistry){const e=document.createElement("template");if(e.innerHTML=a,this.requiresDocumentParser(a,e.content))return void this.handleDocumentPaste(a,n);const t=Re(this.schemaRegistry),s=new Ft({schema:t,schemaRegistry:this.schemaRegistry}).parse(e.content);this.dispatch(Et(n,s))}else{const e=this.extractTextFromHTML(a);e&&this.dispatch(l(n,e,"paste"))}return}if(t){const e=function(e){const t=e.split(/\r?\n/).map(e=>({type:me("paragraph"),segments:[{text:e,marks:[]}]}));return{blocks:t.length>0?t:[{type:me("paragraph"),segments:[{text:"",marks:[]}]}]}}(t);this.dispatch(Et(this.getState(),e))}}handleBlockPaste(e){let t;try{t=JSON.parse(e)}catch{return}const n=t.type;if(!n)return;const s=this.schemaRegistry?.getNodeSpec(n);if(this.schemaRegistry&&!s)return;const r=this.getState(),i=r.selection,o=$(i)?i.nodeId:j(i)?i.blockId:i.anchor.blockId,a=D(),c=Dt(t.attrs,s?.attrs),l=T(me(n),void 0,a,c),h=At(r,o);if(h){const e=Bt(r,o,h,this.schemaRegistry);if(!e)return;const t=r.getBlock(h);if(!t)return;const n=r.transaction("paste");return n.insertNode(e.parentPath,t.children.length,l),n.setSelection(F(a,[...e.parentPath,a])),void this.dispatch(n.build())}const d=Mt(r,o,this.schemaRegistry);if(!d)return;const p=j(i)&&"before"===i.side?0:1,u=r.transaction("paste");u.insertNode(d.parentPath,d.anchorIndex+p,l),u.setSelection(F(a,[...d.parentPath,a])),this.dispatch(u.build())}handleRichPasteFromJson(e){let t;try{t=JSON.parse(e)}catch{return!1}return!(!Array.isArray(t)||0===t.length)&&this.handleRichPaste(t)}handleRichPaste(e){if(0===e.length)return!1;if(!e.some(e=>void 0!==e.type&&"paragraph"!==e.type)&&e.length<=1)return!1;let t=this.getState();const n=t.selection;if(G(n)&&!W(n)){const n=t.transaction("paste"),s=d(t,n),r=n.build();if(this.dispatch(r),t=t.apply(r),s)return this.resolveAndInsertRichBlocks(e,t,s)}const s=$(n)?n.nodeId:j(n)?n.blockId:n.anchor.blockId;return this.resolveAndInsertRichBlocks(e,t,s)}resolveAndInsertRichBlocks(e,t,n){const s=t.selection,r=At(t,n);if(r){const s=Bt(t,n,r,this.schemaRegistry);if(!s)return!1;const i=t.getBlock(r),o=s.anchorIndex>=0?s.anchorIndex+1:i?.children.length??0;return this.insertRichBlocks(e,t,s,o,!0)}const i=Mt(t,n,this.schemaRegistry);if(!i)return!1;const o=j(s)&&"before"===s.side?0:1;return this.insertRichBlocks(e,t,i,i.anchorIndex+o,!j(s))}insertRichBlocks(e,t,n,s,r){const i=t.transaction("paste");let o,a=s,c=0;for(const l of e){const e=Lt(l,this.schemaRegistry);if(!e)continue;const t=Ht(e);i.insertNode(n.parentPath,a,t),a++,o=t.id,c=(e.text??"").length}return r&&n.isAnchorEmpty&&n.anchorIndex>=0&&i.removeNode(n.parentPath,n.anchorIndex),o&&i.setSelection(K(o,c)),this.dispatch(i.build()),!0}handleFilePaste(e){if(!this.fileHandlerRegistry)return!1;const t=Array.from(e.files);if(0===t.length)for(let s=0;s<e.items.length;s++){const n=e.items[s];if(n&&"file"===n.kind){const e=n.getAsFile();e&&t.push(e)}}if(0===t.length)return!1;let n=!1;for(const s of t){const e=this.fileHandlerRegistry.matchFileHandlers(s.type);for(const t of e){const e=t(s,null);if(!0===e||e instanceof Promise){n=!0;break}}}return n}extractRichData(e){const t=document.createElement("template");t.innerHTML=e;const n=t.content.querySelector("[data-notectl-rich]");if(n)return n.getAttribute("data-notectl-rich")??void 0}requiresDocumentParser(e,t){return!!/<table[\s>]/i.test(e)||this.containsVoidBlockElements(t)}containsVoidBlockElements(e){if(!this.schemaRegistry)return!1;const t=this.schemaRegistry.getBlockParseRules();for(const n of t){const t=this.schemaRegistry.getNodeSpec(n.type);if(!t?.isVoid)continue;const s=e.querySelectorAll(n.rule.tag);for(const e of Array.from(s)){if(!n.rule.getAttrs)return!0;if(!1!==n.rule.getAttrs(e))return!0}}return!1}handleDocumentPaste(e,t){if(!this.schemaRegistry)return;const n=Z(e,this.schemaRegistry);if(0===n.children.length)return;const s=t.selection,r=t.transaction("paste");let i;G(s)&&!W(s)&&(i=d(t,r));const o=Mt(t,i??($(s)?s.nodeId:j(s)?s.blockId:s.anchor.blockId),this.schemaRegistry);if(!o)return;const a=j(s)&&"before"===s.side?0:1;let c,l,h=o.anchorIndex+a;for(const d of n.children){const e=Nt(d,D());r.insertNode(o.parentPath,h,e),h++,c=u(e),l=e}if(o.isAnchorEmpty&&!j(s)&&r.removeNode(o.parentPath,o.anchorIndex),c&&l){const e=Pt(l,c),t=e?M(e).length:0;r.setSelection(K(c,t))}this.dispatch(r.build())}extractTextFromHTML(e){const t=document.createElement("template");return t.innerHTML=e,t.content.textContent??""}destroy(){this.element.removeEventListener("paste",this.handlePaste)}}class Wt{compositionTracker;inputHandler;keyboardHandler;pasteHandler;clipboardHandler;constructor(e,t){this.compositionTracker=new wt,this.inputHandler=new Rt(e,{getState:t.getState,dispatch:t.dispatch,syncSelection:t.syncSelection,inputRuleRegistry:t.inputRuleRegistry,isReadOnly:t.isReadOnly,compositionTracker:this.compositionTracker}),this.keyboardHandler=new yt(e,{getState:t.getState,dispatch:t.dispatch,undo:t.undo,redo:t.redo,keymapRegistry:t.keymapRegistry,isReadOnly:t.isReadOnly,compositionTracker:this.compositionTracker,getTextDirection:t.getTextDirection,navigateFromGapCursor:t.navigateFromGapCursor}),this.pasteHandler=new Ut(e,{getState:t.getState,dispatch:t.dispatch,schemaRegistry:t.schemaRegistry,fileHandlerRegistry:t.fileHandlerRegistry,isReadOnly:t.isReadOnly}),this.clipboardHandler=new vt(e,{getState:t.getState,dispatch:t.dispatch,schemaRegistry:t.schemaRegistry,syncSelection:t.syncSelection,isReadOnly:t.isReadOnly})}destroy(){this.inputHandler.destroy(),this.keyboardHandler.destroy(),this.pasteHandler.destroy(),this.clipboardHandler.destroy()}}class qt{_contextKeymaps=[];_navigationKeymaps=[];_defaultKeymaps=[];registerKeymap(e,t){const n=[...this._contextKeymaps,...this._navigationKeymaps,...this._defaultKeymaps];for(const s of Object.keys(e))for(const e of n)if(s in e){console.debug(`[notectl] Keymap shortcut "${s}" is already registered and will be overridden.`);break}this.keymapArrayForPriority(t?.priority??"default").push(e)}getKeymaps(){return[...this._contextKeymaps,...this._navigationKeymaps,...this._defaultKeymaps]}getKeymapsByPriority(){return{context:[...this._contextKeymaps],navigation:[...this._navigationKeymaps],default:[...this._defaultKeymaps]}}removeKeymap(e){for(const t of[this._contextKeymaps,this._navigationKeymaps,this._defaultKeymaps]){const n=t.indexOf(e);if(-1!==n)return void t.splice(n,1)}}clear(){this._contextKeymaps.length=0,this._navigationKeymaps.length=0,this._defaultKeymaps.length=0}keymapArrayForPriority(e){switch(e){case"context":return this._contextKeymaps;case"navigation":return this._navigationKeymaps;case"default":return this._defaultKeymaps}}}class Gt{_inputRules=[];registerInputRule(e){this._inputRules.push(e)}getInputRules(){return this._inputRules}removeInputRule(e){const t=this._inputRules.indexOf(e);-1!==t&&this._inputRules.splice(t,1)}clear(){this._inputRules.length=0}}class Qt{_fileHandlers=[];registerFileHandler(e,t){this._fileHandlers.push({pattern:e,handler:t})}getFileHandlers(){return this._fileHandlers}matchFileHandlers(e){const t=[];for(const n of this._fileHandlers)Jt(n.pattern,e)&&t.push(n.handler);return t}removeFileHandler(e){const t=this._fileHandlers.findIndex(t=>t.handler===e);-1!==t&&this._fileHandlers.splice(t,1)}clear(){this._fileHandlers.length=0}}function Jt(e,t){if("*"===e||"*/*"===e)return!0;if(e===t)return!0;if(e.endsWith("/*")){const n=e.slice(0,-1);return t.startsWith(n)}return!1}class Xt{_nodeViews=/* @__PURE__ */new Map;registerNodeView(e,t){if(this._nodeViews.has(e))throw new Error(`NodeView for type "${e}" is already registered.`);this._nodeViews.set(e,t)}getNodeViewFactory(e){return this._nodeViews.get(e)}removeNodeView(e){this._nodeViews.delete(e)}clear(){this._nodeViews.clear()}}function Yt(e,t){if(t){const n=t.getMarkSpec(e.type);if(n)return n.rank??100}switch(e.type){case"bold":return 0;case"italic":return 1;case"underline":return 2;default:return 100}}function Zt(e,t,n){if(0===t.length)return e;const s=[...t].sort((e,t)=>Yt(e,n)-Yt(t,n));let r=e;for(let i=s.length-1;i>=0;i--){const e=s[i];if(!e)continue;const t=en(e,n);t.appendChild(r),r=t}return r}function en(e,t){if(t){const n=t.getMarkSpec(e.type);if(n)return n.toDOM(e)}switch(e.type){case"bold":return document.createElement("strong");case"italic":return document.createElement("em");case"underline":return document.createElement("u");default:return document.createElement("span")}}class tn{wrapperElement=null;container;registry;constructor(e,t){this.container=e,this.registry=t}get isActive(){return null!==this.wrapperElement}onCompositionStart(e){this.cleanup();const t=e.storedMarks;if(!t||0===t.length)return;const n=e.selection;if($(n)||j(n))return;if(!W(n))return;const s=document.createElement("span");s.setAttribute("data-cursor-wrapper","");const r=document.createTextNode("​"),i=Zt(r,t,this.registry);s.appendChild(i);const o=ne();if(!o||0===o.rangeCount)return;let a;const c=se(this.container,o);if(c){const e=document.createRange();try{e.setStart(c.anchorNode,c.anchorOffset),e.setEnd(c.focusNode,c.focusOffset)}catch{return}a=e}else a=o.getRangeAt(0);a.insertNode(s);try{o.collapse(r,r.length)}catch{}this.wrapperElement=s}cleanup(){this.wrapperElement&&(this.wrapperElement.remove(),this.wrapperElement=null)}}class nn{listeners=/* @__PURE__ */new Map;emit(e,t){const n=this.listeners.get(e.id);if(n)for(const r of n)try{r(t)}catch(s){console.error(`[EventBus] Listener error on "${e.id}":`,s)}}on(e,t){const n=e.id;this.listeners.has(n)||this.listeners.set(n,/* @__PURE__ */new Set);const s=this.listeners.get(n)??/* @__PURE__ */new Set;return s.add(t),()=>{s.delete(t),0===s.size&&this.listeners.delete(n)}}off(e,t){const n=this.listeners.get(e.id);n&&(n.delete(t),0===n.size&&this.listeners.delete(e.id))}clear(){this.listeners.clear()}}class sn{plugins=/* @__PURE__ */new Map;commands=/* @__PURE__ */new Map;services=/* @__PURE__ */new Map;middlewares=[];registrations=/* @__PURE__ */new Map;eventBus=new nn;pluginStyleSheets=[];schemaRegistry=new Ue;keymapRegistry=new qt;inputRuleRegistry=new Gt;fileHandlerRegistry=new Qt;nodeViewRegistry=new Xt;toolbarRegistry=new Pe;blockTypePickerRegistry=new Ne;middlewareSorted=null;initOrder=[];initialized=!1;initializing=!1;readOnly=!1;readonlyBypassActive=!1;registerService(e,t){if(this.services.has(e.id))throw new Error(`Service "${e.id}" is already registered.`);this.services.set(e.id,t)}register(e){if(this.initialized||this.initializing)throw new Error(`Cannot register plugin "${e.id}" after initialization.`);if(this.plugins.has(e.id))throw new Error(`Plugin "${e.id}" is already registered.`);this.plugins.set(e.id,e)}async init(e){if(!this.initialized&&!this.initializing){this.initializing=!0,this.initOrder=this.resolveOrder();for(const n of this.initOrder){const s=this.plugins.get(n);if(!s)continue;const r=this.createContext(n,e);try{await s.init(r)}catch(t){console.error(`[PluginManager] Plugin "${n}" failed to initialize:`,t)}}e.onBeforeReady&&await e.onBeforeReady();for(const e of this.initOrder){const n=this.plugins.get(e);if(n?.onReady)try{await n.onReady()}catch(t){console.error(`[PluginManager] Plugin "${e}" error in onReady:`,t)}}this.initialized=!0,this.initializing=!1}}notifyStateChange(e,t,n){for(const r of this.initOrder){const i=this.plugins.get(r);if(i?.onStateChange)try{i.onStateChange(e,t,n)}catch(s){console.error(`[PluginManager] Plugin "${r}" error in onStateChange:`,s)}}}collectDecorations(e,t){let n=f.empty;for(const r of this.initOrder){const i=this.plugins.get(r);if(i?.decorations)try{const s=i.decorations(e,t);s.isEmpty||(n=n.merge(s))}catch(s){console.error(`[PluginManager] Plugin "${r}" error in decorations():`,s)}}return n}dispatchWithMiddleware(e,t,n){if(0===this.middlewares.length)return void n(e);const s=this.getSortedMiddleware();let r=0,i=!1;const o=e=>{if(r<s.length){const n=s[r++];if(!n)return;let i=!1;const c=e=>{i||(i=!0,o(e))};try{n.middleware(e,t,c)}catch(a){console.error(`[PluginManager] Middleware "${n.name}" error:`,a),c(e)}}else i||(i=!0,n(e))};o(e)}canExecuteCommand(e){const t=this.commands.get(e);return!(!t||this.readOnly&&!t.readonlyAllowed)}executeCommand(e){const t=this.commands.get(e);if(!t)return!1;if(this.readOnly&&!t.readonlyAllowed)return!1;const n=this.readOnly&&t.readonlyAllowed;n&&(this.readonlyBypassActive=!0);try{return t.handler()}catch(s){return console.error(`[PluginManager] Command "${e}" error:`,s),!1}finally{n&&(this.readonlyBypassActive=!1)}}isReadonlyBypassed(){return this.readonlyBypassActive}configurePlugin(e,t){const n=this.plugins.get(e);if(!n)throw new Error(`Plugin "${e}" not found.`);if(n.onConfigure)try{n.onConfigure(t)}catch(s){console.error(`[PluginManager] Plugin "${e}" error in onConfigure:`,s)}}isReadOnly(){return this.readOnly}setReadOnly(e){if(this.readOnly!==e){this.readOnly=e;for(const n of this.initOrder){const s=this.plugins.get(n);if(s?.onReadOnlyChange)try{s.onReadOnlyChange(e)}catch(t){console.error(`[PluginManager] Plugin "${n}" error in onReadOnlyChange:`,t)}}}}getPluginIds(){return[...this.plugins.keys()]}getMiddlewareChain(){return this.getSortedMiddleware().map(e=>({name:e.name,priority:e.priority,pluginId:e.pluginId}))}get(e){return this.plugins.get(e)}getService(e){return this.services.get(e.id)}onEvent(e,t){return this.eventBus.on(e,t)}getPluginStyleSheets(){return this.pluginStyleSheets}async destroy(){const e=[...this.initOrder].reverse();for(const t of e)await this.destroyPlugin(t);this.plugins.clear(),this.commands.clear(),this.services.clear(),this.middlewares.length=0,this.middlewareSorted=null,this.pluginStyleSheets.length=0,this.eventBus.clear(),this.registrations.clear(),this.schemaRegistry.clear(),this.keymapRegistry.clear(),this.inputRuleRegistry.clear(),this.fileHandlerRegistry.clear(),this.nodeViewRegistry.clear(),this.toolbarRegistry.clear(),this.blockTypePickerRegistry.clear(),this.initOrder=[],this.initialized=!1}async destroyPlugin(e){const t=this.plugins.get(e);if(t?.destroy)try{await t.destroy()}catch(n){console.error(`[PluginManager] Plugin "${e}" error in destroy:`,n)}this.cleanupRegistrations(e)}cleanupRegistrations(e){const t=this.registrations.get(e);if(t){for(const e of t.commands)this.commands.delete(e);for(const e of t.services)this.services.delete(e);for(const e of t.middlewares){const t=this.middlewares.indexOf(e);-1!==t&&this.middlewares.splice(t,1)}for(const e of t.unsubscribers)e();for(const e of t.nodeSpecs)this.schemaRegistry.removeNodeSpec(e);for(const e of t.markSpecs)this.schemaRegistry.removeMarkSpec(e);for(const e of t.inlineNodeSpecs)this.schemaRegistry.removeInlineNodeSpec(e);for(const e of t.nodeViews)this.nodeViewRegistry.removeNodeView(e);for(const e of t.keymaps)this.keymapRegistry.removeKeymap(e);for(const e of t.inputRules)this.inputRuleRegistry.removeInputRule(e);for(const e of t.toolbarItems)this.toolbarRegistry.removeToolbarItem(e);for(const e of t.fileHandlers)this.fileHandlerRegistry.removeFileHandler(e);for(const e of t.blockTypePickerEntries)this.blockTypePickerRegistry.removeBlockTypePickerEntry(e);for(const e of t.stylesheets){const t=this.pluginStyleSheets.indexOf(e);-1!==t&&this.pluginStyleSheets.splice(t,1)}this.middlewareSorted=null,this.registrations.delete(e)}}getSortedMiddleware(){return this.middlewareSorted||(this.middlewareSorted=[...this.middlewares].sort((e,t)=>e.priority-t.priority)),this.middlewareSorted}createContext(e,t){const n={commands:[],services:[],middlewares:[],unsubscribers:[],nodeSpecs:[],markSpecs:[],inlineNodeSpecs:[],nodeViews:[],keymaps:[],inputRules:[],toolbarItems:[],fileHandlers:[],blockTypePickerEntries:[],stylesheets:[]};this.registrations.set(e,n);const s={emit:(e,t)=>this.eventBus.emit(e,t),on:(e,t)=>{const s=this.eventBus.on(e,t);return n.unsubscribers.push(s),s},off:(e,t)=>this.eventBus.off(e,t)};return{getState:t.getState,dispatch:t.dispatch,getContainer:t.getContainer,getPluginContainer:t.getPluginContainer,isReadOnly:()=>this.readOnly,registerCommand:(t,s,r)=>{if(this.commands.has(t)){const e=this.commands.get(t);throw new Error(`Command "${t}" is already registered by plugin "${e?.pluginId}".`)}const i=r?.readonlyAllowed??!1;this.commands.set(t,{name:t,handler:s,pluginId:e,readonlyAllowed:i}),n.commands.push(t)},executeCommand:e=>this.executeCommand(e),getEventBus:()=>s,registerMiddleware:(t,s)=>{const r={name:s?.name??(t.name||"anonymous"),pluginId:e,middleware:t,priority:s?.priority??100};this.middlewares.push(r),n.middlewares.push(r),this.middlewareSorted=null},registerService:(e,t)=>{if(this.services.has(e.id))throw new Error(`Service "${e.id}" is already registered by another plugin.`);this.services.set(e.id,t),n.services.push(e.id)},getService:e=>this.services.get(e.id),updateConfig:t=>{const n=this.plugins.get(e);if(n?.onConfigure)try{n.onConfigure(t)}catch(s){console.error(`[PluginManager] Plugin "${e}" error in onConfigure:`,s)}},registerNodeSpec:e=>{this.schemaRegistry.registerNodeSpec(e),n.nodeSpecs.push(e.type)},registerMarkSpec:e=>{this.schemaRegistry.registerMarkSpec(e),n.markSpecs.push(e.type)},registerNodeView:(e,t)=>{this.nodeViewRegistry.registerNodeView(e,t),n.nodeViews.push(e)},registerKeymap:(e,t)=>{this.keymapRegistry.registerKeymap(e,t),n.keymaps.push(e)},registerInputRule:e=>{this.inputRuleRegistry.registerInputRule(e),n.inputRules.push(e)},registerToolbarItem:t=>{this.toolbarRegistry.registerToolbarItem(t,e),n.toolbarItems.push(t.id)},registerInlineNodeSpec:e=>{this.schemaRegistry.registerInlineNodeSpec(e),n.inlineNodeSpecs.push(e.type)},registerFileHandler:(e,t)=>{this.fileHandlerRegistry.registerFileHandler(e,t),n.fileHandlers.push(t)},registerBlockTypePickerEntry:e=>{this.blockTypePickerRegistry.registerBlockTypePickerEntry(e),n.blockTypePickerEntries.push(e.id)},getSchemaRegistry:()=>this.schemaRegistry,getKeymapRegistry:()=>this.keymapRegistry,getInputRuleRegistry:()=>this.inputRuleRegistry,getFileHandlerRegistry:()=>this.fileHandlerRegistry,getNodeViewRegistry:()=>this.nodeViewRegistry,getToolbarRegistry:()=>this.toolbarRegistry,getBlockTypePickerRegistry:()=>this.blockTypePickerRegistry,registerStyleSheet:e=>{const t=new CSSStyleSheet;t.replaceSync(e),this.pluginStyleSheets.push(t),n.stylesheets.push(t)},announce:e=>{t.announce?.(e)},hasAnnouncement:()=>t.hasAnnouncement?.()??!1}}resolveOrder(){const e=[...this.plugins.keys()];for(const i of e){const e=this.plugins.get(i);if(e)for(const t of e.dependencies??[])if(!this.plugins.has(t))throw new Error(`Plugin "${i}" depends on "${t}", which is not registered.`)}const t=/* @__PURE__ */new Map,n=/* @__PURE__ */new Map;for(const i of e)t.set(i,0),n.set(i,[]);for(const i of e){const e=this.plugins.get(i),s=e?.dependencies??[];t.set(i,s.length);for(const t of s){const e=n.get(t);e&&e.push(i)}}const s=[];for(const[i,o]of t)0===o&&s.push(i);const r=[];for(;s.length>0;){s.sort((e,t)=>(this.plugins.get(e)?.priority??100)-(this.plugins.get(t)?.priority??100));const e=s.shift();if(!e)break;r.push(e);for(const r of n.get(e)??[]){const e=(t.get(r)??0)-1;t.set(r,e),0===e&&s.push(r)}}if(r.length!==e.length){const t=e.filter(e=>!r.includes(e));throw new Error(`Circular dependency detected among plugins: ${t.join(", ")}`)}return r}}const rn={Light:"light",Dark:"dark",System:"system"},on={name:"light",primitives:{background:"#ffffff",foreground:"#1a1a1a",mutedForeground:"#666666",border:"#d0d0d0",borderFocus:"#4a90d9",primary:"#4a90d9",primaryForeground:"#1a5fa0",primaryMuted:"#d0e0f0",surfaceRaised:"#f8f8f8",surfaceOverlay:"#ffffff",hoverBackground:"#e8e8e8",activeBackground:"#d0e0f0",danger:"#dc2626",dangerMuted:"#fee2e2",success:"#1a8c1a",shadow:"rgba(0, 0, 0, 0.15)",focusRing:"rgba(74, 144, 217, 0.2)"},codeBlock:{background:"#f8fafc",foreground:"#334155",headerBackground:"#f1f5f9",headerForeground:"#64748b",headerBorder:"#e2e8f0"},tooltip:{background:"#1a1a1a",foreground:"#ffffff"}},an={name:"dark",primitives:{background:"#1e1e2e",foreground:"#cdd6f4",mutedForeground:"#7f849c",border:"#45475a",borderFocus:"#89b4fa",primary:"#89b4fa",primaryForeground:"#89b4fa",primaryMuted:"rgba(137, 180, 250, 0.15)",surfaceRaised:"#313244",surfaceOverlay:"#313244",hoverBackground:"#45475a",activeBackground:"rgba(137, 180, 250, 0.15)",danger:"#f38ba8",dangerMuted:"rgba(243, 139, 168, 0.15)",success:"#a6e3a1",shadow:"rgba(0, 0, 0, 0.4)",focusRing:"rgba(137, 180, 250, 0.25)"},codeBlock:{background:"#11111b",foreground:"#cdd6f4",headerBackground:"#181825",headerForeground:"#7f849c",headerBorder:"rgba(205, 214, 244, 0.08)"},tooltip:{background:"#585b70",foreground:"#cdd6f4"}};function cn(e,t){return{name:t.name,primitives:{...e.primitives,...t.primitives},toolbar:t.toolbar?{...e.toolbar,...t.toolbar}:e.toolbar,codeBlock:t.codeBlock?{...e.codeBlock,...t.codeBlock}:e.codeBlock,tooltip:t.tooltip?{...e.tooltip,...t.tooltip}:e.tooltip}}function ln(e){if("object"==typeof e)return e;switch(e){case rn.Light:return on;case rn.Dark:return an;default:return on}}const hn=[["primitives.background","--notectl-bg"],["primitives.foreground","--notectl-fg"],["primitives.mutedForeground","--notectl-fg-muted"],["primitives.border","--notectl-border"],["primitives.borderFocus","--notectl-border-focus"],["primitives.primary","--notectl-primary"],["primitives.primaryForeground","--notectl-primary-fg"],["primitives.primaryMuted","--notectl-primary-muted"],["primitives.surfaceRaised","--notectl-surface-raised"],["primitives.surfaceOverlay","--notectl-surface-overlay"],["primitives.hoverBackground","--notectl-hover-bg"],["primitives.activeBackground","--notectl-active-bg"],["primitives.danger","--notectl-danger"],["primitives.dangerMuted","--notectl-danger-muted"],["primitives.success","--notectl-success"],["primitives.shadow","--notectl-shadow"],["primitives.focusRing","--notectl-focus-ring"],["toolbar.background","--notectl-toolbar-bg"],["toolbar.borderColor","--notectl-toolbar-border"],["codeBlock.background","--notectl-code-block-bg"],["codeBlock.foreground","--notectl-code-block-color"],["codeBlock.headerBackground","--notectl-code-block-header-bg"],["codeBlock.headerForeground","--notectl-code-block-header-color"],["codeBlock.headerBorder","--notectl-code-block-header-border"],["tooltip.background","--notectl-tooltip-bg"],["tooltip.foreground","--notectl-tooltip-fg"]],dn=/* @__PURE__ */new Map([["--notectl-toolbar-bg","var(--notectl-surface-raised)"],["--notectl-toolbar-border","var(--notectl-border)"],["--notectl-code-block-bg","var(--notectl-surface-raised)"],["--notectl-code-block-color","var(--notectl-fg)"],["--notectl-code-block-header-bg","var(--notectl-surface-raised)"],["--notectl-code-block-header-color","var(--notectl-fg-muted)"],["--notectl-code-block-header-border","var(--notectl-border)"],["--notectl-tooltip-bg","var(--notectl-fg)"],["--notectl-tooltip-fg","var(--notectl-bg)"]]);function pn(e,t){const n=t.split(".");let s=e;for(const r of n){if(null==s)return;if("object"!=typeof s)return;s=s[r]}return"string"==typeof s?s:void 0}function un(e){const t=[":host {"];for(const[n,s]of hn){const r=pn(e,n);if(void 0!==r)t.push(`\t${s}: ${r};`);else{const e=dn.get(s);e&&t.push(`\t${s}: ${e};`)}}return t.push("}"),t.join("\n")}function fn(e){const t=new CSSStyleSheet;return t.replaceSync(un(e)),t}const gn={EN:"en",DE:"de",ES:"es",FR:"fr",ZH:"zh",RU:"ru",AR:"ar",HI:"hi",PT:"pt",BROWSER:"browser"},mn={paragraph:"Paragraph",heading:"Heading",code_block:"Code Block",blockquote:"Block Quote",list_item:"List Item",horizontal_rule:"Horizontal Rule",image:"Image",table:"Table"};function yn(e,t){return"heading"===e&&t?.level?`Heading ${t.level}`:mn[e]??e}function kn(e,t){const n=t?.document??globalThis.document,s=t?.container??n.head;if(t?.id){const s=n.getElementById(t.id);if(s instanceof HTMLStyleElement)return s.textContent=e,t.nonce&&s.setAttribute("nonce",t.nonce),s}const r=n.createElement("style");return r.textContent=e,t?.id&&(r.id=t.id),t?.nonce&&r.setAttribute("nonce",t.nonce),s.appendChild(r),r}function Sn(e,t){const n=(t??globalThis.document).getElementById(e);n&&n.remove()}const bn=/* @__PURE__ */new WeakSet;function vn(e,t){const n=t?.target??globalThis.document,s=new CSSStyleSheet;return s.replaceSync(e),bn.add(s),t?.replace&&(n.adoptedStyleSheets=n.adoptedStyleSheets.filter(e=>!bn.has(e))),n.adoptedStyleSheets=[...n.adoptedStyleSheets,s],s}function wn(e,t){const n=t??globalThis.document;n.adoptedStyleSheets=n.adoptedStyleSheets.filter(t=>t!==e)}function Rn(e,t,n){if(!n)return;const s=[];let r=null,i=[];for(const o of t){const e=n.getNodeSpec(o.type),t=e?.wrapper?.(o);t&&r&&t.key===r.key?i.push(o.id):t?(r&&i.length>0&&s.push({spec:r,blockIds:i}),r=t,i=[o.id]):(r&&i.length>0&&s.push({spec:r,blockIds:i}),r=null,i=[])}r&&i.length>0&&s.push({spec:r,blockIds:i});for(const o of s){const t=e.querySelector(`[data-block-id="${o.blockIds[0]}"]`);if(!t)continue;const n=document.createElement(o.spec.tag);if(n.setAttribute("data-block-wrapper",o.spec.key),o.spec.className&&(n.className=o.spec.className),o.spec.attrs)for(const[e,s]of Object.entries(o.spec.attrs))n.setAttribute(e,s);t.before(n);for(const s of o.blockIds){const t=e.querySelector(`[data-block-id="${s}"]`);t&&n.appendChild(t)}}}function Cn(e){e.parentElement?.removeChild(e)}function xn(e,t,n){const s=e.parentElement;s?s.replaceChild(t,e):n.replaceChild(t,e)}function En(e,t,n){if(t?.parentElement){const e=t.parentElement;return void(t.nextSibling?e.insertBefore(n,t.nextSibling):e.appendChild(n))}e.firstChild?e.insertBefore(n,e.firstChild):e.appendChild(n)}function Tn(e,t){if(t){const n=t.getInlineNodeSpec(e.inlineType);if(n){const t=n.toDOM(e);return t.setAttribute("contenteditable","false"),t}}const n=document.createElement("span");return n.setAttribute("data-inline-type",e.inlineType),n.setAttribute("contenteditable","false"),n}function In(e){let t=e.replace(/ {2}/g,"  ");return t.endsWith(" ")&&(t=`${t.slice(0,-1)} `),t.startsWith(" ")&&(t=` ${t.slice(1)}`),t}function Mn(e){const t=e.nodeName??"span",n=document.createElement(t);if(n.setAttribute("data-decoration","true"),e.class)for(const s of e.class.split(" "))s&&n.classList.add(s);e.style&&xe(n,e.style);for(const[s,r]of Object.entries(e))"class"!==s&&"style"!==s&&"nodeName"!==s&&void 0!==r&&n.setAttribute(s,r);return n}function Bn(e,t,n){const s=n?.decorations?.findNode(t);if(s&&0!==s.length)for(const r of s){if(r.attrs.class)for(const t of r.attrs.class.split(" "))t&&e.classList.add(t);r.attrs.style&&Ee(e,r.attrs.style)}}function An(e,t,n,s){const r=s?.decorations?.findInline(e.id),i=s?.nodeViewRegistry;if(i&&t&&n&&s?.getState&&s?.dispatch){const o=i.getNodeViewFactory(e.type);if(o){const i=o(e,s.getState,s.dispatch);n.set(e.id,i);const a=t.getNodeSpec(e.type);if(a?.isVoid&&i.dom.setAttribute("data-void","true"),a?.selectable&&i.dom.setAttribute("data-selectable","true"),i.contentDOM&&i.contentDOM!==i.dom&&i.contentDOM.setAttribute("data-content-dom","true"),P(e)&&i.contentDOM)Nn(i.contentDOM,e,t,r);else{const r=L(e),o=/* @__PURE__ */new Map;for(const e of r){const r=i.getContentDOM?.(e.id)??i.contentDOM;if(r){const i=An(e,t,n,s);r.appendChild(i);let a=o.get(r);a||(a=[],o.set(r,a)),a.push(e)}}for(const[e,n]of o)Rn(e,n,t)}return i.dom.setAttribute("data-block-type",e.type),Bn(i.dom,e.id,s),i.dom}}if(t){const i=t.getNodeSpec(e.type);if(i){const o=i.toDOM(e);if(i.isVoid&&o.setAttribute("data-void","true"),i.selectable&&o.setAttribute("data-selectable","true"),!i.isVoid)if(P(e))Nn(o,e,t,r);else{const r=L(e);for(const e of r){const r=An(e,t,n,s);o.appendChild(r)}Rn(o,r,t)}return o.setAttribute("data-block-type",e.type),Bn(o,e.id,s),o}}return function(e,t,n){const s=Ke("p",e.id);return s.setAttribute("data-block-type",e.type),Nn(s,e,t,n),s}(e,t,r)}function Nn(e,t,n,s){for(const o of e.querySelectorAll("[data-cursor-wrapper]"))o.remove();const r=C(t);if(1===r.length&&v(r[0])&&""===r[0].text)return void e.appendChild(document.createElement("br"));if(s&&0!==s.length)!function(e,t,n,s){let r=0;for(const i of t){if(S(i)){e.appendChild(Tn(i,s)),r+=1;continue}const t=r,o=r+i.text.length;if(0===i.text.length){r=o;continue}const a=/* @__PURE__ */new Set;a.add(t),a.add(o);for(const e of n){const n=Math.max(t,e.from),s=Math.min(o,e.to);n>t&&n<o&&a.add(n),s>t&&s<o&&a.add(s)}const c=[...a].sort((e,t)=>e-t);for(let r=0;r<c.length-1;r++){const o=c[r],a=c[r+1];if(void 0===o||void 0===a||o>=a)continue;const l=o-t,h=a-t,d=i.text.slice(l,h),p=[];for(const e of n)e.from<=o&&e.to>=a&&p.push(e);let u=Zt(document.createTextNode(In(d)),i.marks,s);for(const e of p){const t=Mn(e.attrs);t.appendChild(u),u=t}e.appendChild(u)}r=o}}(e,r,s,n);else for(const o of r)v(o)?e.appendChild(Pn(o,n)):e.appendChild(Tn(o,n));const i=r[r.length-1];i&&S(i)&&"hard_break"===i.inlineType&&e.appendChild(document.createElement("br"))}function Pn(e,t){return""===e.text?document.createTextNode(""):Zt(document.createTextNode(In(e.text)),e.marks,t)}function Dn(e,t,n,s){const r=t?.doc.children??[],i=n.doc.children,o=s?.registry,a=s?.nodeViews,c=null!=s?.compositionBlockId;c||function(e){const t=Array.from(e.querySelectorAll(":scope > [data-block-wrapper]"));for(const n of t){for(;n.firstChild;)e.insertBefore(n.firstChild,n);n.remove()}}(e);const l=/* @__PURE__ */new Map;for(const g of function(e){const t=[];for(const n of Array.from(e.children))if(n instanceof HTMLElement)if(n.hasAttribute("data-block-id"))t.push(n);else if(n.hasAttribute("data-block-wrapper"))for(const e of Array.from(n.children))e instanceof HTMLElement&&e.hasAttribute("data-block-id")&&t.push(e);return t}(e)){const e=g.getAttribute("data-block-id");e&&l.set(ge(e),g)}const h=new Set(i.map(e=>e.id));for(const[g,m]of l)if(!h.has(g)){Cn(m),l.delete(g);const e=a?.get(g);e&&(e.destroy?.(),a?.delete(g))}const d=/* @__PURE__ */new Map;for(const g of r)d.set(g.id,g);let p=null;const u=s?.selectedNodeId,f=s?.previousSelectedNodeId;for(const g of i){const t=l.get(g.id),n=d.get(g.id);if(s?.compositionBlockId===g.id&&t){p=t;continue}const r=s?.oldDecorations?.find(g.id),i=s?.decorations?.find(g.id);if(t&&n&&!On(n,g,r,i))p=t;else if(t){const n=a?.get(g.id);if(n){if(n.update?.(g)){if(P(g)&&n.contentDOM){n.contentDOM.textContent="";const e=s?.decorations?.findInline(g.id);Nn(n.contentDOM,g,o,e)}p=n.dom;continue}n.destroy?.(),a?.delete(g.id)}const r=An(g,o,a,s);xn(t,r,e),p=r}else{const t=An(g,o,a,s);En(e,p,t),p=t}if(u===g.id){const e=a?.get(g.id);if(e)e.selectNode?.();else{const e=l.get(g.id)??p;e instanceof HTMLElement&&e.classList.add("notectl-node-selected")}}else if(f===g.id){const e=a?.get(g.id);if(e)e.deselectNode?.();else{const e=l.get(g.id)??p;e instanceof HTMLElement&&e.classList.remove("notectl-node-selected")}}}if(f&&f!==u){const e=a?.get(f);e&&!h.has(f)&&e.deselectNode?.()}if(u&&!h.has(u)){const e=a?.get(u);e&&e.selectNode?.()}c||Rn(e,i,o)}function On(e,t,n,s){if(e.type!==t.type)return!0;if(e.children.length!==t.children.length)return!0;const r=e.attrs,i=t.attrs;if(r!==i){if(!r||!i)return!0;const e=Object.keys(r),t=Object.keys(i);if(e.length!==t.length)return!0;for(const n of e)if(r[n]!==i[n])return!0}for(let c=0;c<e.children.length;c++){const n=e.children[c],s=t.children[c];if(!n||!s)return!0;if(v(n)&&v(s)){if(n.text!==s.text)return!0;if(!O(n.marks,s.marks))return!0}else if(S(n)&&S(s)){if(n.inlineType!==s.inlineType)return!0;if(!Ln(n.attrs,s.attrs))return!0}else{if(v(n)||v(s)||S(n)||S(s))return!0;if(On(n,s))return!0}}const o=n??[],a=s??[];return o!==a&&!g(o,a)}function Ln(e,t){const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0}class Hn{state;contentElement;history;stateChangeCallbacks=[];handleSelectionChange;handleMousedown;handleDragover;handleDrop;handleCompositionStartForWrapper;handleCompositionEndForWrapper;isUpdating=!1;pendingNodeSelectionClear=!1;pendingGapCursorClear=!1;schemaRegistry;keymapRegistry;fileHandlerRegistry;nodeViewRegistry;nodeViews=/* @__PURE__ */new Map;decorations=f.empty;getDecorations;isReadOnly;navigationKeymap=null;compositionState;cursorWrapper;goalColumn=null;preserveGoalColumn=!1;constructor(e,t){this.state=t.state,this.contentElement=e,this.schemaRegistry=t.schemaRegistry,this.keymapRegistry=t.keymapRegistry,this.fileHandlerRegistry=t.fileHandlerRegistry,this.nodeViewRegistry=t.nodeViewRegistry,this.getDecorations=t.getDecorations,this.isReadOnly=t.isReadOnly??(()=>!1),this.compositionState=t.compositionState??{isComposing:!1,activeBlockId:null},this.history=new ut({maxDepth:t.maxHistoryDepth??100}),t.onStateChange&&this.stateChangeCallbacks.push(t.onStateChange),this.cursorWrapper=new tn(e,this.schemaRegistry),this.handleCompositionStartForWrapper=()=>{this.cursorWrapper.onCompositionStart(this.state)},this.handleCompositionEndForWrapper=()=>{this.cursorWrapper.cleanup()},e.addEventListener("compositionstart",this.handleCompositionStartForWrapper),e.addEventListener("compositionend",this.handleCompositionEndForWrapper),this.handleSelectionChange=this.onSelectionChange.bind(this),document.addEventListener("selectionchange",this.handleSelectionChange),this.handleMousedown=this.onMousedown.bind(this),e.addEventListener("mousedown",this.handleMousedown),this.handleDragover=this.onDragover.bind(this),e.addEventListener("dragover",this.handleDragover),this.handleDrop=this.onDrop.bind(this),e.addEventListener("drop",this.handleDrop),this.decorations=this.getDecorations?.(this.state)??f.empty,Dn(e,null,this.state,{...this.reconcileOptions(),decorations:this.decorations}),re(e,this.state.selection),this.registerNavigationKeymaps()}getState(){return this.state}applyUpdate(e,t,n){if(!this.isUpdating){this.isUpdating=!0;try{const s=this.state;this.state=e,this.cursorWrapper.isActive&&!e.storedMarks?.length&&this.cursorWrapper.cleanup(),n?.pushHistory&&"history"!==t.metadata.origin&&this.history.push(t);const r=this.decorations,i=this.getDecorations?.(e,t)??f.empty;this.decorations=i,Dn(this.contentElement,s,e,{...this.reconcileOptions(s.selection),decorations:i,oldDecorations:r,compositionBlockId:this.compositionState.isComposing?this.compositionState.activeBlockId??void 0:void 0}),this.compositionState.isComposing||re(this.contentElement,e.selection);for(const n of this.stateChangeCallbacks)n(s,e,t);this.preserveGoalColumn||(this.goalColumn=null)}finally{this.isUpdating=!1}}}dispatch(e){const t=this.state.apply(e);this.applyUpdate(t,e,{pushHistory:!0})}undo(){if(this.isUpdating||this.isReadOnly())return;const e=this.history.undo(this.state);e&&this.applyUpdate(e.state,e.transaction)}redo(){if(this.isUpdating||this.isReadOnly())return;const e=this.history.redo(this.state);e&&this.applyUpdate(e.state,e.transaction)}onStateChange(e){return this.stateChangeCallbacks.push(e),()=>{const t=this.stateChangeCallbacks.indexOf(e);-1!==t&&this.stateChangeCallbacks.splice(t,1)}}replaceState(e){if(!this.isUpdating){this.isUpdating=!0;try{const t=this.state;this.state=e,this.history.clear();const n=this.decorations,s=this.getDecorations?.(e)??f.empty;this.decorations=s,Dn(this.contentElement,t,e,{...this.reconcileOptions(t.selection),decorations:s,oldDecorations:n,compositionBlockId:this.compositionState.isComposing?this.compositionState.activeBlockId??void 0:void 0}),this.compositionState.isComposing||re(this.contentElement,e.selection)}finally{this.isUpdating=!1}}}syncSelectionFromDOM(){if(this.compositionState.isComposing)return;if(this.cursorWrapper.isActive&&this.cursorWrapper.cleanup(),$(this.state.selection)&&!this.pendingNodeSelectionClear)return;if(j(this.state.selection)&&!this.pendingGapCursorClear)return;this.pendingNodeSelectionClear=!1,this.pendingGapCursorClear=!1;const e=ie(this.contentElement);if(!e)return;if(q(e,this.state.selection))return;const t=this.state.transaction("input").setSelection(e).setStoredMarks(null,this.state.storedMarks).build(),n=this.state.apply(t);this.applyUpdate(n,t)}onMousedown(e){if(this.isUpdating)return;this.goalColumn=null;const t=e.target;if(!(t instanceof HTMLElement))return;const n=t.closest("[data-block-id]");if(!(n instanceof HTMLElement&&this.contentElement.contains(n)))return void((this.contentElement.contains(t)||t===this.contentElement)&&this.handleClickBelowContent(e));if(!n.hasAttribute("data-void")&&!n.hasAttribute("data-selectable"))return $(this.state.selection)&&(this.pendingNodeSelectionClear=!0),void(j(this.state.selection)&&(this.pendingGapCursorClear=!0));const s=n.querySelector("[data-content-dom]");if(s?.contains(t))return $(this.state.selection)&&(this.pendingNodeSelectionClear=!0),void(j(this.state.selection)&&(this.pendingGapCursorClear=!0));e.preventDefault(),this.contentElement.focus();const r=ge(n.getAttribute("data-block-id")??""),i=this.buildBlockPath(n),o=F(r,i),a=this.state.transaction("input").setSelection(o).setStoredMarks(null,this.state.storedMarks).build(),c=this.state.apply(a);this.applyUpdate(c,a)}handleClickBelowContent(e){if(this.isReadOnly())return;const t=this.state.getBlockOrder(),n=t[t.length-1];if(!n)return;const s=this.contentElement.querySelector(`[data-block-id="${n}"]`);if(!s)return;const r=s.getBoundingClientRect();if(e.clientY<=r.bottom)return;const i=this.state.getBlock(n);if("paragraph"===i?.type&&0===E(i)){const t=this.state.transaction("input").setSelection(K(n,0)).build();return this.dispatch(t),void e.preventDefault()}e.preventDefault(),this.contentElement.focus();const o=D(),a=i?E(i):0,c=this.state.transaction("input").splitBlock(n,a,o).setBlockType(o,me("paragraph")).setSelection(K(o,0)).build();this.dispatch(c)}buildBlockPath(e){const t=[];let n=e;for(;n&&n!==this.contentElement;)n.hasAttribute("data-block-id")&&t.unshift(ge(n.getAttribute("data-block-id")??"")),n=n.parentElement;return t}onDragover(e){this.fileHandlerRegistry&&e.dataTransfer&&e.dataTransfer.types.includes("Files")&&e.preventDefault()}onDrop(e){if(this.isReadOnly())return;if(!this.fileHandlerRegistry)return;if(!e.dataTransfer)return;const t=Array.from(e.dataTransfer.files);if(0===t.length)return;const n=this.getPositionFromPoint(e.clientX,e.clientY);let s=!1;for(const r of t){const e=this.fileHandlerRegistry.matchFileHandlers(r.type);for(const t of e){const e=t(r,n);if(!0===e||e instanceof Promise){s=!0;break}}}s&&e.preventDefault()}getPositionFromPoint(e,t){const n=this.contentElement.getRootNode(),s=oe(n,e,t);return s&&this.contentElement.contains(s.node)?ae(this.contentElement,s.node,s.offset):null}onSelectionChange(){if(this.isUpdating)return;const e=this.contentElement.getRootNode(),t="activeElement"in e?e.activeElement:document.activeElement;(this.contentElement.contains(t)||t===this.contentElement)&&this.syncSelectionFromDOM()}reconcileOptions(e){const t=$(this.state.selection)?this.state.selection.nodeId:void 0,n=e&&$(e)?e.nodeId:void 0;return{registry:this.schemaRegistry,nodeViewRegistry:this.nodeViewRegistry,nodeViews:this.nodeViews,getState:()=>this.state,dispatch:e=>this.dispatch(e),selectedNodeId:t,previousSelectedNodeId:n}}registerNavigationKeymaps(){if(!this.keymapRegistry)return;const e={ArrowLeft:"left",ArrowRight:"right",ArrowUp:"up",ArrowDown:"down"},t={};for(const[n,s]of Object.entries(e))t[n]=()=>this.handleNavigationArrow(s);this.navigationKeymap=t,this.keymapRegistry.registerKeymap(t,{priority:"navigation"})}handleNavigationArrow(e){return!$(this.state.selection)&&!j(this.state.selection)&&!!W(this.state.selection)&&("left"===e||"right"===e?this.handleHorizontalArrow(e):this.handleVerticalArrow(e))}handleHorizontalArrow(e){this.goalColumn=null;const t=this.resolveLogicalHorizontalDirection(e),n=ce(this.state,t);if(n)return this.dispatch(n),this.validateSelectionAfterInlineSkip(),!0;if(!le(this.contentElement,this.state,e))return!1;const s=he(this.state,t);return!!s&&(this.dispatch(s),!0)}resolveLogicalHorizontalDirection(e){const t=this.state.selection;if($(t)||j(t))return e;const n=this.contentElement.querySelector(`[data-block-id="${t.anchor.blockId}"]`);return n instanceof HTMLElement&&"rtl"===Ae(n)?"left"===e?"right":"left":e}handleVerticalArrow(e){const t=this.contentElement.ownerDocument.getSelection?.()??null,n=t?de(t):null;if(!le(this.contentElement,this.state,e,n))return!1;null===this.goalColumn&&n&&(this.goalColumn=n.left),this.preserveGoalColumn=!0;const s=pe(this.contentElement,this.state,e,this.goalColumn);return s?(this.dispatch(s),this.preserveGoalColumn=!1,!0):(this.preserveGoalColumn=!1,!1)}validateSelectionAfterInlineSkip(){const e=ie(this.contentElement);e&&q(e,this.state.selection)||re(this.contentElement,this.state.selection)}syncSelection(){this.syncSelectionFromDOM()}destroy(){this.cursorWrapper.cleanup(),this.contentElement.removeEventListener("compositionstart",this.handleCompositionStartForWrapper),this.contentElement.removeEventListener("compositionend",this.handleCompositionEndForWrapper),document.removeEventListener("selectionchange",this.handleSelectionChange),this.contentElement.removeEventListener("mousedown",this.handleMousedown),this.contentElement.removeEventListener("dragover",this.handleDragover),this.contentElement.removeEventListener("drop",this.handleDrop),this.navigationKeymap&&this.keymapRegistry&&(this.keymapRegistry.removeKeymap(this.navigationKeymap),this.navigationKeymap=null);for(const e of this.nodeViews.values())e.destroy?.();this.nodeViews.clear()}}function _n(e,t,n){const s=t?function(e,t){return{children:e.children.map(e=>zn(e,t))}}(e,t):e,r=t?Re(t):void 0;n(at.create({doc:s,schema:r,selection:K(s.children[0]?.id??ge(""),0)}))}function zn(e,t){const n=t.getNodeSpec(e.type);if(!n?.content||!((s=n.content).allow.length>0)||s.allow.includes("text"))return e;var s;if(P(e)){const t=e.children.length>0?e.children:void 0,n=T(me("paragraph"),t);return T(e.type,[n],e.id,e.attrs)}const r=e.children.map(e=>v(e)||S(e)?e:zn(e,t));return T(e.type,r,e.id,e.attrs)}class Fn{config={};getConfig(){return this.config}setConfig(e){this.config=e}mergeConfig(e){this.config={...this.config,...e}}applyAttribute(e,t,n){if("placeholder"===e&&this.applyPlaceholder(t??"",n.contentElement),"readonly"===e){const e=null!==t;this.applyReadonly(e,n.contentElement,n.pluginManager),this.config={...this.config,readonly:e}}"theme"===e&&n.themeController?.apply(t??rn.Light),"paper-size"===e&&(null===t?(n.applyPaperSize(void 0),this.config={...this.config,paperSize:void 0}):Oe(t)&&(n.applyPaperSize(t),this.config={...this.config,paperSize:t})),"dir"===e&&this.applyDir("ltr"===t||"rtl"===t?t:void 0,n.contentElement,n.editorWrapper)}applyRuntimeConfig(e,t){void 0!==e.placeholder&&this.applyPlaceholder(e.placeholder,t.contentElement),void 0!==e.readonly&&this.applyReadonly(e.readonly,t.contentElement,t.pluginManager),"paperSize"in e&&t.applyPaperSize(e.paperSize),"dir"in e&&this.applyDir(e.dir,t.contentElement,t.editorWrapper),this.config={...this.config,...e}}applyTheme(e,t){this.config={...this.config,theme:e},t?.apply(e)}getTheme(){return this.config.theme??rn.Light}get isReadOnly(){return this.config.readonly??!1}getPaperSize(){return this.config.paperSize}applyPlaceholder(e,t){t?.setAttribute("data-placeholder",e)}applyReadonly(e,t,n){t&&(t.contentEditable=e?"false":"true",e?t.setAttribute("aria-readonly","true"):t.removeAttribute("aria-readonly"),n?.setReadOnly(e))}applyDir(e,t,n){t&&(e?(n?.setAttribute("dir",e),t.setAttribute("dir",e)):(n?.removeAttribute("dir"),t.removeAttribute("dir")))}}const Kn={ariaLabel:"Rich text editor",ariaDescription:"Press Escape to exit the editor",defaultPlaceholder:"Start typing..."},$n=/* @__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-mSCYQYnL.mjs"),"./locales/de.ts":()=>import("./de-DOLwx_M7.mjs"),"./locales/es.ts":()=>import("./es-Bk0bRDFE.mjs"),"./locales/fr.ts":()=>import("./fr-C1W7jyd6.mjs"),"./locales/hi.ts":()=>import("./hi-ntUsOspQ.mjs"),"./locales/pt.ts":()=>import("./pt-cN6r-f7f.mjs"),"./locales/ru.ts":()=>import("./ru-CZvkdGnf.mjs"),"./locales/zh.ts":()=>import("./zh-lhynyH6Q.mjs")});class jn{listeners=/* @__PURE__ */new Map;on(e,t){this.listeners.has(e)||this.listeners.set(e,/* @__PURE__ */new Set),this.listeners.get(e)?.add(t)}off(e,t){this.listeners.get(e)?.delete(t)}emit(e,t){const n=this.listeners.get(e);if(n)for(const s of n)s(t)}clear(){this.listeners.clear()}}class Vn{initialized=!1;readyPromiseResolve=null;readyPromise;preInitPlugins=[];constructor(){this.readyPromise=this.createReadyPromise()}isInitialized(){return this.initialized}markInitialized(){return!this.initialized&&(this.initialized=!0,!0)}whenReady(){return this.readyPromise}resolveReady(){this.readyPromiseResolve?.()}registerPreInitPlugin(e){if(this.initialized)throw new Error("Cannot register plugins after initialization. Register before calling init() or adding to DOM.");this.preInitPlugins.push(e)}consumePreInitPlugins(){const e=this.preInitPlugins;return this.preInitPlugins=[],e}reset(){this.initialized=!1,this.preInitPlugins=[],this.readyPromise=this.createReadyPromise()}createReadyPromise(){return new Promise(e=>{this.readyPromiseResolve=e})}}class Un{runtimeStyleSheet=null;setup(e,t,n){Te(e),this.runtimeStyleSheet=Ie(),n?.setRuntimeStyleSheets(this.runtimeStyleSheet?[this.runtimeStyleSheet]:[]),Me(e,{nonce:t,sheet:this.runtimeStyleSheet})}teardown(e,t){e&&Te(e),this.runtimeStyleSheet=null,t?.setRuntimeStyleSheets([])}}const Wn=["\n:host {\n\tdisplay: block;\n\tfont-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n\tfont-size: 16px;\n\tline-height: 1.6;\n\tcolor: var(--notectl-fg);\n}\n\n.notectl-editor {\n\tdisplay: flex;\n\tflex-direction: column;\n\tborder: 1px solid var(--notectl-border);\n\tborder-radius: 6px;\n\toverflow: hidden;\n\tbackground: var(--notectl-bg);\n}\n\n.notectl-editor:focus-within {\n\tborder-color: var(--notectl-border-focus);\n\tbox-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n/* Content Area */\n.notectl-content {\n\tflex: 1;\n\tpadding: 12px 16px;\n\toutline: none;\n\tmin-height: var(--notectl-content-min-height, 400px);\n\tcursor: text;\n\tposition: relative;\n\twhite-space: pre-wrap;\n\tword-wrap: break-word;\n\t-webkit-user-select: text;\n\tuser-select: text;\n\t-moz-tab-size: 4;\n\ttab-size: 4;\n}\n\n.notectl-content p {\n\tmargin: 0;\n\tpadding: 2px 0;\n\tmin-height: 1.6em;\n}\n\n.notectl-content p + p {\n\tmargin-top: 0;\n}\n\n/* Horizontal Rule */\n.notectl-content hr {\n\tborder: none;\n\tborder-top: 1px solid var(--notectl-border);\n\tmargin: 8px 0;\n\tpadding: 0;\n\tcursor: default;\n\tuser-select: none;\n}\n\n/* Placeholder */\n.notectl-content.notectl-content--empty::before {\n\tcontent: attr(data-placeholder);\n\tcolor: var(--notectl-fg-muted);\n\tpointer-events: none;\n\tposition: absolute;\n\ttop: 12px;\n\tinset-inline-start: 16px;\n}\n\n/* Plugin container bottom */\n.notectl-plugin-container--bottom {\n\tborder-top: 1px solid var(--notectl-border);\n}\n\n/* Screen reader announcements */\n.notectl-sr-only {\n\tposition: absolute;\n\twidth: 1px;\n\theight: 1px;\n\tmargin: -1px;\n\tpadding: 0;\n\toverflow: hidden;\n\tclip: rect(0, 0, 0, 0);\n\twhite-space: nowrap;\n\tborder: 0;\n}\n\n/* Node selection */\n.notectl-node-selected {\n\toutline: 2px solid var(--notectl-primary);\n\toutline-offset: 2px;\n}\n","\n@media (prefers-reduced-motion: reduce) {\n\t.notectl-toolbar-btn,\n\t.notectl-image__resize-handle,\n\t.notectl-image__size-indicator,\n\t.notectl-color-picker__swatch,\n\t.notectl-font-picker__item,\n\t.notectl-heading-picker__item,\n\t.notectl-font-size-picker__item,\n\t.ntbl-handle,\n\t.ntbl-handle-delete,\n\t.ntbl-insert-line,\n\t.ntbl-insert-btn,\n\t.ntbl-add-zone,\n\t.ntbl-add-icon,\n\t.ntbl-col-bar,\n\t.ntbl-row-bar,\n\t.ntbl-delete-table-btn,\n\t.notectl-code-block__copy {\n\t\ttransition: none !important;\n\t}\n}\n",`\n/* Paper viewport: scroll container with centered gray background */\n.notectl-paper-viewport {\n\tflex: 1;\n\toverflow-y: auto;\n\toverflow-x: hidden;\n\tbackground: var(--notectl-paper-viewport-bg, #e8e8e8);\n\tpadding: ${Le}px 0;\n}\n\n/* Paper surface: white page with shadow, centered */\n.notectl-paper-surface {\n\tmargin: 0 auto;\n\tbackground: var(--notectl-bg);\n\tborder-radius: 2px;\n\tbox-shadow: 0 2px 8px var(--notectl-shadow, rgba(0, 0, 0, 0.15));\n\ttransform-origin: top center;\n\ttransition: transform 0.15s ease-out;\n}\n\n/* Content overrides in paper mode: wider document margins */\n.notectl-editor[data-paper-mode] .notectl-content {\n\tflex: none;\n\tpadding: ${He}px ${_e}px;\n\tmin-height: auto;\n}\n\n/* Placeholder position override for paper mode */\n.notectl-editor[data-paper-mode] .notectl-content.notectl-content--empty::before {\n\ttop: ${He}px;\n\tinset-inline-start: ${_e}px;\n}\n\n/* Dark mode: darker viewport background */\n:host([theme="dark"]) .notectl-paper-viewport {\n\t--notectl-paper-viewport-bg: #181825;\n}\n\n@media (prefers-reduced-motion: reduce) {\n\t.notectl-paper-surface {\n\t\ttransition: none !important;\n\t}\n}\n`].join("\n");let qn=null;class Gn{themeStyleSheet=new CSSStyleSheet;systemThemeQuery=null;systemThemeHandler=null;pluginSheets=[];runtimeSheets=[];shadow;constructor(e){this.shadow=e}apply(e){if(this.cleanupSystemThemeListener(),e===rn.System){this.setupSystemThemeListener();const e=ln(this.getSystemTheme());this.setThemeStyleSheet(e)}else this.setThemeStyleSheet(ln(e))}setPluginStyleSheets(e){this.pluginSheets=e,this.refreshAdoptedStyleSheets()}setRuntimeStyleSheets(e){this.runtimeSheets=e,this.refreshAdoptedStyleSheets()}destroy(){this.cleanupSystemThemeListener()}setThemeStyleSheet(e){this.themeStyleSheet.replaceSync(un(e)),this.refreshAdoptedStyleSheets()}refreshAdoptedStyleSheets(){this.shadow.adoptedStyleSheets=[this.themeStyleSheet,(qn||(qn=new CSSStyleSheet,qn.replaceSync(Wn)),qn),...this.pluginSheets,...this.runtimeSheets]}setupSystemThemeListener(){this.systemThemeQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.systemThemeHandler=e=>{const t=ln(this.getSystemTheme());this.setThemeStyleSheet(t)},this.systemThemeQuery.addEventListener("change",this.systemThemeHandler)}cleanupSystemThemeListener(){this.systemThemeQuery&&this.systemThemeHandler&&this.systemThemeQuery.removeEventListener("change",this.systemThemeHandler),this.systemThemeQuery=null,this.systemThemeHandler=null}getSystemTheme(){return window.matchMedia("(prefers-color-scheme: dark)").matches?rn.Dark:rn.Light}}class Qn{wrapper;content;viewport=null;surface=null;viewportObserver=null;surfaceObserver=null;currentSize=null;currentPaperWidthPx=0;currentPaperHeightPx=0;currentScale=1;compensationFrameId=null;constructor(e,t){this.wrapper=e,this.content=t}apply(e){if(null===e)return void this.disable();const t=ze(e);this.currentPaperWidthPx=t.widthPx,this.currentPaperHeightPx=t.heightPx,this.currentSize=e,this.viewport||this.enable(),this.updateSurfaceDimensions(),this.wrapper.setAttribute("data-paper-mode",e)}destroy(){this.disable()}getPaperSize(){return this.currentSize}enable(){this.viewport=document.createElement("div"),this.viewport.className="notectl-paper-viewport",this.surface=document.createElement("div"),this.surface.className="notectl-paper-surface",this.wrapper.removeChild(this.content),this.surface.appendChild(this.content),this.viewport.appendChild(this.surface);const e=this.wrapper.querySelector(".notectl-plugin-container--bottom");e?this.wrapper.insertBefore(this.viewport,e):this.wrapper.appendChild(this.viewport),this.viewportObserver=new ResizeObserver(e=>{for(const t of e)this.onViewportResize(t.contentRect.width)}),this.viewportObserver.observe(this.viewport),this.surfaceObserver=new ResizeObserver(e=>{for(const t of e)this.onSurfaceResize(t.contentRect.height)}),this.surfaceObserver.observe(this.surface)}disable(){if(null!==this.compensationFrameId&&(cancelAnimationFrame(this.compensationFrameId),this.compensationFrameId=null),this.viewportObserver?.disconnect(),this.viewportObserver=null,this.surfaceObserver?.disconnect(),this.surfaceObserver=null,this.viewport&&this.surface){this.surface.removeChild(this.content);const e=this.wrapper.querySelector(".notectl-plugin-container--bottom");e?this.wrapper.insertBefore(this.content,e):this.wrapper.appendChild(this.content),this.wrapper.removeChild(this.viewport)}this.viewport=null,this.surface=null,this.currentSize=null,this.currentPaperWidthPx=0,this.currentPaperHeightPx=0,this.currentScale=1,this.wrapper.removeAttribute("data-paper-mode")}updateSurfaceDimensions(){this.surface&&(Be(this.surface,"width",`${this.currentPaperWidthPx}px`),Be(this.surface,"minHeight",`${this.currentPaperHeightPx}px`))}onViewportResize(e){if(!this.surface||0===this.currentPaperWidthPx)return;const t=e-2*Le,n=Math.min(1,t/this.currentPaperWidthPx);this.currentScale=n,Be(this.surface,"transform",n<1?`scale(${n})`:""),this.scheduleHeightCompensation(n)}onSurfaceResize(e){this.surface&&this.viewport&&this.scheduleHeightCompensation(this.currentScale)}scheduleHeightCompensation(e){null!==this.compensationFrameId&&cancelAnimationFrame(this.compensationFrameId),this.compensationFrameId=requestAnimationFrame(()=>{this.compensationFrameId=null,this.updateHeightCompensation(e)})}updateHeightCompensation(e){if(!this.surface)return;if(e>=1)return void Be(this.surface,"marginBottom","");const t=this.surface.scrollHeight,n=t*e-t;Be(this.surface,"marginBottom",`${n}px`)}}function Jn(e){return!Array.isArray(e)}class Xn extends HTMLElement{view=null;inputManager=null;pluginManager=null;domElements=null;configController=new Fn;events=new jn;lifecycle=new Vn;styleCoordinator=new Un;themeController=null;paperLayout=null;constructor(){super(),this.attachShadow({mode:"open"})}static get observedAttributes(){return["placeholder","readonly","theme","paper-size","dir"]}connectedCallback(){this.lifecycle.isInitialized()||this.init()}disconnectedCallback(){setTimeout(()=>{this.isConnected||this.destroy()},0)}attributeChangedCallback(e,t,n){this.configController.applyAttribute(e,n,this.getConfigDeps())}registerPlugin(e){this.lifecycle.registerPreInitPlugin(e)}async init(e){if(!this.lifecycle.markInitialized())return;e&&this.configController.setConfig(e);const t=this.configController.getConfig(),n=this.shadowRoot;if(!n)return;this.themeController=new Gn(n),this.styleCoordinator.setup(n,t.styleNonce,this.themeController),this.themeController.apply(t.theme??rn.Light);const s=new m(t.locale??"browser").getLocale(),r="en"===s?Kn:await async function(e){if("en"===e)return Kn;const t=$n[`./locales/${e}.ts`];if(!t)return Kn;try{return(await t()).default}catch{return Kn}}(s);this.domElements=function(e){const t=e.locale??Kn,n=document.createElement("div");n.className="notectl-editor";const s=document.createElement("div");s.className="notectl-plugin-container--top",s.setAttribute("data-notectl-no-print","");const r=document.createElement("div");r.className="notectl-content",r.contentEditable=e.readonly?"false":"true",r.setAttribute("role","textbox"),r.setAttribute("aria-multiline","true"),r.setAttribute("aria-label",t.ariaLabel),e.readonly&&r.setAttribute("aria-readonly","true"),r.setAttribute("aria-description",t.ariaDescription),r.setAttribute("data-placeholder",e.placeholder??t.defaultPlaceholder),e.dir&&(n.setAttribute("dir",e.dir),r.setAttribute("dir",e.dir));const i=document.createElement("div");i.className="notectl-plugin-container--bottom",i.setAttribute("data-notectl-no-print","");const o=document.createElement("div");return o.className="notectl-sr-only",o.setAttribute("data-notectl-no-print",""),o.setAttribute("aria-live","polite"),o.setAttribute("aria-atomic","true"),n.appendChild(s),n.appendChild(r),n.appendChild(i),n.appendChild(o),{wrapper:n,content:r,topPluginContainer:s,bottomPluginContainer:i,announcer:o}}({readonly:t.readonly,placeholder:t.placeholder,dir:t.dir??this.getAttribute("dir")??void 0,locale:r}),n.appendChild(this.domElements.wrapper),t.paperSize&&(this.paperLayout=new Qn(this.domElements.wrapper,this.domElements.content),this.paperLayout.apply(t.paperSize)),this.pluginManager=new sn;const i=new m(t.locale??"browser");if(this.pluginManager.registerService(y,i),Ge(this.pluginManager.schemaRegistry),function(e,t){if(!t)return;const n=Jn(t)?t.groups:t,s=Jn(t)?t.overflow:void 0,r=[];for(const o of n){const t=[];for(const n of o)t.push(n.id),e.register(n);r.push(t)}const i={groups:r,overflow:s};e.register(new De(i))}(this.pluginManager,t.toolbar),!this.pluginManager)return;for(const f of t.plugins??[])this.pluginManager.register(f);for(const f of this.lifecycle.consumePreInitPlugins())this.pluginManager.register(f);if(o=this.pluginManager,a=t.features,function(e,t){if(void 0!==e.get("text-formatting"))return;const n={bold:t?.bold??!0,italic:t?.italic??!0,underline:t?.underline??!0};e.register(new Ve(n))}(o,a),function(e){void 0===e.get("caret-navigation")&&e.register(new ue)}(o),function(e){void 0===e.get("gap-cursor")&&e.register(new $e)}(o),!this.pluginManager)return;var o,a;this.domElements.content.addEventListener("focus",()=>this.events.emit("focus",void 0)),this.domElements.content.addEventListener("blur",()=>this.events.emit("blur",void 0));const c=this.domElements,l=c.content,h=this.pluginManager,d=c.topPluginContainer,p=c.bottomPluginContainer,u=c.announcer;await h.init({getState:()=>{if(!this.view)throw new Error("View not initialized");return this.view.getState()},dispatch:e=>this.dispatch(e),getContainer:()=>l,getPluginContainer:e=>"top"===e?d:p,announce:e=>{u&&(u.textContent=e)},hasAnnouncement:()=>!!u?.textContent,onBeforeReady:()=>{const e=Re(h.schemaRegistry),n=at.create({schema:e});this.inputManager=new Wt(l,{getState:()=>{if(!this.view)throw new Error("View not initialized");return this.view.getState()},dispatch:e=>this.dispatch(e),syncSelection:()=>this.view?.syncSelection(),undo:()=>this.view?.undo(),redo:()=>this.view?.redo(),schemaRegistry:h.schemaRegistry,keymapRegistry:h.keymapRegistry,inputRuleRegistry:h.inputRuleRegistry,fileHandlerRegistry:h.fileHandlerRegistry,isReadOnly:()=>this.configController.isReadOnly,getTextDirection:Ae,navigateFromGapCursor:je}),this.view=new Hn(l,{state:n,schemaRegistry:h.schemaRegistry,keymapRegistry:h.keymapRegistry,fileHandlerRegistry:h.fileHandlerRegistry,nodeViewRegistry:h.nodeViewRegistry,maxHistoryDepth:t.maxHistoryDepth,getDecorations:(e,t)=>this.pluginManager?.collectDecorations(e,t)??f.empty,onStateChange:(e,t,n)=>{this.onStateChange(e,t,n)},isReadOnly:()=>this.configController.isReadOnly,compositionState:this.inputManager.compositionTracker}),this.updateEmptyState();const s=h.getPluginStyleSheets();s.length>0&&this.themeController?.setPluginStyleSheets(s)}}),this.pluginManager&&(t.readonly&&this.pluginManager.setReadOnly(!0),this.pluginManager.onEvent(Fe,e=>{!e.options.paperSize&&this.configController.getPaperSize()&&(e.options={...e.options,paperSize:this.configController.getPaperSize()})}),t.autofocus&&requestAnimationFrame(()=>this.domElements?.content.focus()),this.lifecycle.resolveReady(),this.events.emit("ready",void 0))}get isReadOnly(){return this.configController.isReadOnly}getJSON(){if(!this.view)throw new Error("Editor not initialized");return this.view.getState().doc}setJSON(e){_n(e,this.pluginManager?.schemaRegistry,e=>this.replaceState(e))}async getContentHTML(e){if(!this.view)throw new Error("Editor not initialized");return async function(e,t,n){const s=e.doc,{serializeDocumentToHTML:r,serializeDocumentToCSS:i}=await import("./DocumentParser-DFcvVMGY.mjs").then(e=>e.D);if("classes"===n?.cssMode){const e=i(s,t);return n.pretty?{html:Se(e.html),css:e.css,styleMap:e.styleMap}:e}const o=r(s,t);return n?.pretty?Se(o):o}(this.view.getState(),this.pluginManager?.schemaRegistry,e)}async setContentHTML(e,t){return async function(e,t,n,s){const{parseHTMLToDocument:r}=await import("./DocumentParser-DFcvVMGY.mjs").then(e=>e.e);_n(r(e,t,s),t,n)}(e,this.pluginManager?.schemaRegistry,e=>this.replaceState(e),t)}getText(){if(!this.view)throw new Error("Editor not initialized");return this.view.getState().doc.children.map(e=>M(e)).join("\n")}isEmpty(){return!this.view||function(e){if(!e)return!0;if(0===e.children.length)return!0;if(e.children.length>1)return!1;const t=e.children[0];return!t||"paragraph"===t.type&&""===M(t)}(this.view.getState().doc)}commands={toggleBold:()=>this.executeCommand("toggleBold"),toggleItalic:()=>this.executeCommand("toggleItalic"),toggleUnderline:()=>this.executeCommand("toggleUnderline"),undo:()=>{this.configController.isReadOnly||this.view?.undo()},redo:()=>{this.configController.isReadOnly||this.view?.redo()},selectAll:()=>{if(!this.view)return;const e=r(this.view.getState());this.dispatch(e)}};can(){const e=this.view?.getState().schema,t=this.configController.isReadOnly;return{toggleBold:()=>!t&&!!e&&ve(e,"bold"),toggleItalic:()=>!t&&!!e&&ve(e,"italic"),toggleUnderline:()=>!t&&!!e&&ve(e,"underline"),undo:()=>!t&&(this.view?.history.canUndo()??!1),redo:()=>!t&&(this.view?.history.canRedo()??!1),selectAll:()=>this.canExecuteCommand("selectAll")}}canExecuteCommand(e){return this.pluginManager?.canExecuteCommand(e)??!1}executeCommand(e){return this.pluginManager?.executeCommand(e)??!1}configurePlugin(e,t){this.pluginManager?.configurePlugin(e,t)}getService(e){return this.pluginManager?.getService(e)}onPluginEvent(e,t){return this.pluginManager?.onEvent(e,t)??(()=>{})}getState(){if(!this.view)throw new Error("Editor not initialized");return this.view.getState()}dispatch(e){this.view&&this.pluginManager&&(!this.configController.isReadOnly||pt(e)||this.pluginManager.isReadonlyBypassed())&&this.pluginManager.dispatchWithMiddleware(e,this.view.getState(),e=>this.view?.dispatch(e))}on(e,t){this.events.on(e,t)}off(e,t){this.events.off(e,t)}whenReady(){return this.lifecycle.whenReady()}configure(e){this.configController.applyRuntimeConfig(e,this.getConfigDeps())}setTheme(e){this.configController.applyTheme(e,this.themeController)}getTheme(){return this.configController.getTheme()}getPaperSize(){return this.configController.getPaperSize()}destroy(){this.paperLayout?.destroy(),this.paperLayout=null,this.styleCoordinator.teardown(this.shadowRoot,this.themeController),this.themeController?.destroy(),this.themeController=null,this.inputManager?.destroy(),this.inputManager=null,this.view?.destroy();const e=this.pluginManager?.destroy()??Promise.resolve();return this.view=null,this.pluginManager=null,this.lifecycle.reset(),this.events.clear(),this.domElements?.wrapper.remove(),this.domElements=null,e}getConfigDeps(){return{contentElement:this.domElements?.content??null,editorWrapper:this.domElements?.wrapper??null,pluginManager:this.pluginManager,themeController:this.themeController,applyPaperSize:e=>this.applyPaperSize(e)}}applyPaperSize(e){this.domElements&&(e?(this.paperLayout||(this.paperLayout=new Qn(this.domElements.wrapper,this.domElements.content)),this.paperLayout.apply(e)):this.paperLayout?.apply(null))}onStateChange(e,t,n){const s=this.domElements?.announcer;if(s&&(s.textContent=""),this.pluginManager?.notifyStateChange(e,t,n),this.updateEmptyState(),this.events.emit("stateChange",{oldState:e,newState:t,transaction:n}),q(e.selection,t.selection)||this.events.emit("selectionChange",{selection:t.selection}),!s?.textContent){const r=function(e,t,n){if("undo"===n.metadata.historyDirection)return"Undo";if("redo"===n.metadata.historyDirection)return"Redo";for(const s of n.steps)if("setBlockType"===s.type)return yn(s.nodeType,s.attrs);for(const s of t.schema.markTypes){const n=ye(s),r=Ce(e,n),i=Ce(t,n);if(r!==i)return`${s} ${i?"on":"off"}`}return null}(e,t,n);r&&s&&(s.textContent=r)}}updateEmptyState(){this.domElements?.content.classList.toggle("notectl-content--empty",this.isEmpty())}replaceState(e){this.view&&(this.view.replaceState(e),this.updateEmptyState())}}async function Yn(e){const t=document.createElement("notectl-editor");return await t.init(e),t}"undefined"==typeof customElements||customElements.get("notectl-editor")||customElements.define("notectl-editor",Xn);export{ln as A,qe as B,vt as C,an as D,at as E,Qt as F,ut as H,Wt as I,qt as K,on as L,Xt as N,sn as P,Ue as S,rn as T,wt as a,tn as b,nn as c,Gt as d,gn as e,Xn as f,ot as g,vn as h,st as i,We as j,Yn as k,cn as l,fn as m,gt as n,mt as o,un as p,yn as q,kn as r,rt as s,it as t,pt as u,dt as v,kt as w,Ge as x,wn as y,Sn as z};
2
+ //# sourceMappingURL=NotectlEditor-4NFnXLyD.mjs.map