@vc-shell/framework 2.0.0-alpha.1 → 2.0.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (290) hide show
  1. package/dist/tsconfig.tsbuildinfo +1 -1
  2. package/package.json +8 -5
  3. package/dist/assets/042c75b764bc78a7.svg +0 -1
  4. package/dist/assets/0ba156439a339f2a.svg +0 -1
  5. package/dist/assets/0be560bfb22d0e72.woff2 +0 -0
  6. package/dist/assets/0d67e9e056b4c500.woff +0 -0
  7. package/dist/assets/0f590f8a94577092.svg +0 -1
  8. package/dist/assets/0fc5820f8be53a1b.svg +0 -1
  9. package/dist/assets/105efd028edc1dfe.woff +0 -0
  10. package/dist/assets/10768e2cc79fc60b.svg +0 -1
  11. package/dist/assets/11b3d25a56fd9a21.woff2 +0 -0
  12. package/dist/assets/131b34336aedaf47.woff +0 -0
  13. package/dist/assets/154365acf3010d96.woff2 +0 -0
  14. package/dist/assets/157b8721e0600ea8.svg +0 -1
  15. package/dist/assets/15e91cdd649cde9a.svg +0 -1
  16. package/dist/assets/19275e398ae57130.woff2 +0 -0
  17. package/dist/assets/19bb1c668a5db39f.woff2 +0 -0
  18. package/dist/assets/1a3e84b2457f709a.woff +0 -0
  19. package/dist/assets/1de63eb118636cce.svg +0 -1
  20. package/dist/assets/1ea01de36eb5491b.svg +0 -1
  21. package/dist/assets/2010ada3e82156ed.woff +0 -0
  22. package/dist/assets/204eaf512fde2023.svg +0 -1
  23. package/dist/assets/2088983edf42e153.svg +0 -1
  24. package/dist/assets/208f810a9321a327.svg +0 -1
  25. package/dist/assets/21220a9d10e6c558.svg +0 -1
  26. package/dist/assets/220db345a102045d.woff2 +0 -0
  27. package/dist/assets/225da11d23968333.svg +0 -1
  28. package/dist/assets/226f862dd81bdc13.woff2 +0 -0
  29. package/dist/assets/23a2d53395ddb14f.woff +0 -0
  30. package/dist/assets/259e6ad461a52ad7.svg +0 -1
  31. package/dist/assets/261e6dec4d53b9ac.woff +0 -0
  32. package/dist/assets/262f46a0b6d94bb6.svg +0 -1
  33. package/dist/assets/2857c513073467da.svg +0 -1
  34. package/dist/assets/2b3be7889467d98f.woff +0 -0
  35. package/dist/assets/2d4e6190eec72737.svg +0 -1
  36. package/dist/assets/2eba973185078bc8.woff +0 -0
  37. package/dist/assets/334d3f6bc766c516.woff +0 -0
  38. package/dist/assets/34ff7dd0c2285956.svg +0 -1
  39. package/dist/assets/3d26b7c1ab78bbe2.woff +0 -0
  40. package/dist/assets/3d892965ab4f1cbb.woff2 +0 -0
  41. package/dist/assets/3f8c4cc8099e34b6.woff2 +0 -0
  42. package/dist/assets/3fc09a6113184f16.woff +0 -0
  43. package/dist/assets/40a0e53b79ce63c6.woff2 +0 -0
  44. package/dist/assets/41275bcb979cb650.svg +0 -1
  45. package/dist/assets/434f7982590e462f.woff +0 -0
  46. package/dist/assets/475937116ee3314a.woff2 +0 -0
  47. package/dist/assets/477e1881a0394cc5.woff +0 -0
  48. package/dist/assets/489710fb710e73f0.woff +0 -0
  49. package/dist/assets/49791943b3872376.woff2 +0 -0
  50. package/dist/assets/4ae5f23e0ca888e7.woff2 +0 -0
  51. package/dist/assets/4d7a77b0e5373992.svg +0 -1
  52. package/dist/assets/4e43c74354534fb3.svg +0 -1
  53. package/dist/assets/4fe75f5117100705.svg +0 -1
  54. package/dist/assets/52e261a005074e1b.woff +0 -0
  55. package/dist/assets/5304c3d05a5f9789.woff2 +0 -0
  56. package/dist/assets/54cda5482c6c9218.woff +0 -0
  57. package/dist/assets/550f52072e8ccafe.woff2 +0 -0
  58. package/dist/assets/572bb1bb4156a9c1.svg +0 -1
  59. package/dist/assets/6075995d7e74da46.woff2 +0 -0
  60. package/dist/assets/617c4736236e199e.woff +0 -0
  61. package/dist/assets/67230f05dc94a265.svg +0 -1
  62. package/dist/assets/6798e4dd4add9b48.svg +0 -1
  63. package/dist/assets/686d4077c1e26876.woff2 +0 -0
  64. package/dist/assets/698ec6c722d4cb05.woff2 +0 -0
  65. package/dist/assets/6a3e73faf406cf33.svg +0 -1
  66. package/dist/assets/72de3a63bc0b70dd.svg +0 -1
  67. package/dist/assets/74c6a6ab81bb6340.woff2 +0 -0
  68. package/dist/assets/74ed5f8a78e71106.svg +0 -1
  69. package/dist/assets/7a5aa5abd625137f.ttf +0 -0
  70. package/dist/assets/7ce0c166fd6a1204.woff +0 -0
  71. package/dist/assets/7d55399c2a7bc985.svg +0 -1
  72. package/dist/assets/7d970675c69fca1d.woff +0 -0
  73. package/dist/assets/7eda727273fd98d3.svg +0 -1
  74. package/dist/assets/7f6ebfd707b76ca2.woff +0 -0
  75. package/dist/assets/7fa898d213fcc7bc.woff2 +0 -0
  76. package/dist/assets/861e6b7192b3b6c7.woff +0 -0
  77. package/dist/assets/8bbcde81ba21ecb2.woff2 +0 -0
  78. package/dist/assets/8f6657e5e0b8d3e4.woff +0 -0
  79. package/dist/assets/910b0d99b9e26568.svg +0 -1
  80. package/dist/assets/91fe94e424323d61.woff +0 -0
  81. package/dist/assets/92508f8707159b51.svg +0 -1
  82. package/dist/assets/9392bf1d591e1abb.svg +0 -1
  83. package/dist/assets/97e8d4984ba0713a.woff2 +0 -0
  84. package/dist/assets/9cb83236f6bb7ab1.svg +0 -1
  85. package/dist/assets/9d37314695c0b68d.woff +0 -0
  86. package/dist/assets/a03cdcd8da5bb987.woff +0 -0
  87. package/dist/assets/a18404194e3f9047.svg +0 -1
  88. package/dist/assets/a2017fe7f0a26510.svg +0 -1
  89. package/dist/assets/ab6e7190bb1492d5.woff2 +0 -0
  90. package/dist/assets/abf88f301a0730f4.svg +0 -1
  91. package/dist/assets/ac1a99b3d05d8232.woff +0 -0
  92. package/dist/assets/aed17cb6fdad2ada.woff2 +0 -0
  93. package/dist/assets/b1a596e31ad1185a.svg +0 -1
  94. package/dist/assets/b27767411c8427be.woff +0 -0
  95. package/dist/assets/b325adcae33bbe7a.svg +0 -1
  96. package/dist/assets/b372390551ca2fa1.svg +0 -1
  97. package/dist/assets/b5bb1e8fc975decd.svg +0 -1
  98. package/dist/assets/b645a4a2181b9dc1.svg +0 -1
  99. package/dist/assets/b6499ddce0a4ef7d.svg +0 -1
  100. package/dist/assets/b7ffde2383bb16ba.woff2 +0 -0
  101. package/dist/assets/b94421fadd23b0f2.svg +0 -1
  102. package/dist/assets/bb28fb0f27f1c11b.svg +0 -1
  103. package/dist/assets/c5195215cb712e9c.woff2 +0 -0
  104. package/dist/assets/c9191b638a10f67b.woff2 +0 -0
  105. package/dist/assets/c97328b91ac5cc66.woff +0 -0
  106. package/dist/assets/ca791c5ca5848a03.svg +0 -1
  107. package/dist/assets/cb32840ce330103f.woff +0 -0
  108. package/dist/assets/ccc878931d74181b.woff2 +0 -0
  109. package/dist/assets/cdc69f8b549c866d.woff2 +0 -0
  110. package/dist/assets/d084bda16abe8a56.svg +0 -1
  111. package/dist/assets/d32b129cae2fffd6.svg +0 -1
  112. package/dist/assets/d35a4c7113315758.woff2 +0 -0
  113. package/dist/assets/d3f792f54ae4c307.svg +0 -1
  114. package/dist/assets/d5a5b8630120073d.svg +0 -1
  115. package/dist/assets/d5eb20bcdcf5616a.woff2 +0 -0
  116. package/dist/assets/d5f9664ebbfb104b.svg +0 -1
  117. package/dist/assets/d84247b59449dd88.woff2 +0 -0
  118. package/dist/assets/da4b7f5883fe7743.woff2 +0 -0
  119. package/dist/assets/dceaf3b39091e6a4.woff +0 -0
  120. package/dist/assets/dd05d43ff0df2fc7.svg +0 -1
  121. package/dist/assets/e2ad5b3428289141.woff +0 -0
  122. package/dist/assets/e38acaa1757232e0.svg +0 -1
  123. package/dist/assets/e4a8550f1c7ffe36.svg +0 -1
  124. package/dist/assets/e5adb5ae3a3698f6.svg +0 -1
  125. package/dist/assets/e61a1889bac955f4.woff2 +0 -0
  126. package/dist/assets/e72bb11356af94c7.svg +0 -1
  127. package/dist/assets/e98196a9f8dcb2f0.svg +0 -1
  128. package/dist/assets/ebec912a42ad49ff.woff +0 -0
  129. package/dist/assets/ee6983981ffcbb41.woff2 +0 -0
  130. package/dist/assets/f09d89268e4c0317.svg +0 -1
  131. package/dist/assets/f239394367fcf005.woff2 +0 -0
  132. package/dist/assets/f5722262b6e7214e.woff2 +0 -0
  133. package/dist/assets/f7fc8bf46089d8b2.svg +0 -1
  134. package/dist/assets/fc829e3f399b70e0.woff2 +0 -0
  135. package/dist/assets/fe141d99763f5d2b.woff +0 -0
  136. package/dist/assets/fed13b0d59903483.svg +0 -1
  137. package/dist/assets/fed757d2c2344ead.woff2 +0 -0
  138. package/dist/assets/ffc438f20e79ce73.woff +0 -0
  139. package/dist/framework.css +0 -9
  140. package/dist/framework.js +0 -36471
  141. package/dist/vendor-boolbase-D2i1C8XR.js +0 -18
  142. package/dist/vendor-cheerio-DrsWhxJH.js +0 -1053
  143. package/dist/vendor-cheerio-select-jw4C2SiT.js +0 -191
  144. package/dist/vendor-core-js-Do_NZFHx.js +0 -880
  145. package/dist/vendor-css-select-BwGMmTuc.js +0 -622
  146. package/dist/vendor-css-what-CZZaquJM.js +0 -267
  147. package/dist/vendor-cypress-signalr-mock-itnm2wpA.js +0 -781
  148. package/dist/vendor-d3-array-9cpTrqlO.js +0 -149
  149. package/dist/vendor-d3-axis-D1_DbKLz.js +0 -74
  150. package/dist/vendor-d3-brush-CcKeJp9e.js +0 -1
  151. package/dist/vendor-d3-color-BOYE6h_9.js +0 -306
  152. package/dist/vendor-d3-dispatch-fx-WMg0D.js +0 -64
  153. package/dist/vendor-d3-ease-Cr34gv04.js +0 -8
  154. package/dist/vendor-d3-format-DaIwZvFc.js +0 -182
  155. package/dist/vendor-d3-interpolate-BYG2gvO4.js +0 -177
  156. package/dist/vendor-d3-interpolate-path-CpGLvKgS.js +0 -299
  157. package/dist/vendor-d3-path-DJOTitNW.js +0 -64
  158. package/dist/vendor-d3-scale-CC5rtdt5.js +0 -561
  159. package/dist/vendor-d3-selection-CNMxsYiL.js +0 -603
  160. package/dist/vendor-d3-shape-DBhCDMiV.js +0 -925
  161. package/dist/vendor-d3-time-DAPP210_.js +0 -212
  162. package/dist/vendor-d3-time-format-hD7iE2WG.js +0 -491
  163. package/dist/vendor-d3-timer-C1cUWKPz.js +0 -67
  164. package/dist/vendor-d3-transition-BbNQT7qF.js +0 -524
  165. package/dist/vendor-d3-zoom-CcKeJp9e.js +0 -1
  166. package/dist/vendor-date-fns-BKO3x1R1.js +0 -3102
  167. package/dist/vendor-dom-serializer-BbVuF1MQ.js +0 -213
  168. package/dist/vendor-domelementtype-B3sFIGaC.js +0 -21
  169. package/dist/vendor-domhandler-Kufn9M_V.js +0 -311
  170. package/dist/vendor-dompurify-M2Bspgo5.js +0 -553
  171. package/dist/vendor-domutils-DDRq_ial.js +0 -386
  172. package/dist/vendor-emotion-cache-eEZT5l-Q.js +0 -274
  173. package/dist/vendor-emotion-hash-DImMRhyK.js +0 -22
  174. package/dist/vendor-emotion-memoize-BcEUCz8q.js +0 -9
  175. package/dist/vendor-emotion-serialize-BSDW8NwU.js +0 -123
  176. package/dist/vendor-emotion-sheet-CS8ZBl9s.js +0 -44
  177. package/dist/vendor-emotion-unitless-B7u1PU6w.js +0 -53
  178. package/dist/vendor-emotion-utils-D7refZTM.js +0 -28
  179. package/dist/vendor-entities-J86Og8IU.js +0 -364
  180. package/dist/vendor-floating-ui-core-BoHdh92a.js +0 -432
  181. package/dist/vendor-floating-ui-dom-BvVXFZ4B.js +0 -398
  182. package/dist/vendor-floating-ui-utils-CidJRIm2.js +0 -257
  183. package/dist/vendor-floating-ui-vue-sCrhit51.js +0 -121
  184. package/dist/vendor-gridstack-Dkfw452e.js +0 -3390
  185. package/dist/vendor-headlessui-vue-Cn-RMs4E.js +0 -961
  186. package/dist/vendor-htmlparser2-BxKKzWLL.js +0 -735
  187. package/dist/vendor-internmap-Q5729_cS.js +0 -35
  188. package/dist/vendor-intlify-core-base-BmIo1dK4.js +0 -1141
  189. package/dist/vendor-intlify-message-compiler-D9VOavkL.js +0 -960
  190. package/dist/vendor-intlify-shared-SCAs3ybf.js +0 -144
  191. package/dist/vendor-iso-639-1-rPqx9HMT.js +0 -786
  192. package/dist/vendor-juggle-resize-observer-DiSiNbbT.js +0 -286
  193. package/dist/vendor-linkify-it-LzoUhj6C.js +0 -199
  194. package/dist/vendor-linkifyjs-dCH9UYes.js +0 -701
  195. package/dist/vendor-lodash-es-BtnfG6xF.js +0 -4829
  196. package/dist/vendor-lucide-vue-next-CPgeDcFj.js +0 -33093
  197. package/dist/vendor-markdown-it-Bs9KEWkF.js +0 -2266
  198. package/dist/vendor-markdown-it-task-lists-CHCnS7dl.js +0 -69
  199. package/dist/vendor-mdurl-DZFDNdqC.js +0 -192
  200. package/dist/vendor-microsoft-applicationinsights-analytics-js-DFu_cVaY.js +0 -1207
  201. package/dist/vendor-microsoft-applicationinsights-cfgsync-js-DRQLN2Ue.js +0 -261
  202. package/dist/vendor-microsoft-applicationinsights-channel-js-BIJDcP3D.js +0 -1822
  203. package/dist/vendor-microsoft-applicationinsights-common-CJjmnDMb.js +0 -1921
  204. package/dist/vendor-microsoft-applicationinsights-core-js-BOc_o46i.js +0 -4276
  205. package/dist/vendor-microsoft-applicationinsights-dependencies-js-DDz502id.js +0 -1407
  206. package/dist/vendor-microsoft-applicationinsights-properties-js-9aDWHwXJ.js +0 -572
  207. package/dist/vendor-microsoft-applicationinsights-shims-Dton8Vqy.js +0 -43
  208. package/dist/vendor-microsoft-applicationinsights-web-DTa5YN-h.js +0 -487
  209. package/dist/vendor-microsoft-dynamicproto-js-89GEKjvR.js +0 -147
  210. package/dist/vendor-microsoft-signalr-Bgpbb4fW.js +0 -1761
  211. package/dist/vendor-module-federation-enhanced-CV1CNdJy.js +0 -22
  212. package/dist/vendor-module-federation-error-codes-DdVwX11j.js +0 -55
  213. package/dist/vendor-module-federation-runtime-CVH_lWgu.js +0 -91
  214. package/dist/vendor-module-federation-runtime-core-D5G-s9nP.js +0 -2202
  215. package/dist/vendor-module-federation-runtime-tools-CQbtw-RJ.js +0 -18
  216. package/dist/vendor-module-federation-sdk-DM4AJRa7.js +0 -683
  217. package/dist/vendor-nevware21-ts-async-D4qa7g-U.js +0 -261
  218. package/dist/vendor-nevware21-ts-utils-DII8jruI.js +0 -853
  219. package/dist/vendor-nth-check-CGMdQf59.js +0 -45
  220. package/dist/vendor-orderedmap-B3SOk52B.js +0 -103
  221. package/dist/vendor-parse5-htmlparser2-tree-adapter-BUDJ887-.js +0 -143
  222. package/dist/vendor-parse5-zq5Hn0y9.js +0 -5749
  223. package/dist/vendor-prettier-CoRReRqw.js +0 -5215
  224. package/dist/vendor-prosemirror-commands-Bv4ChObl.js +0 -385
  225. package/dist/vendor-prosemirror-dropcursor-kF5UKNFM.js +0 -86
  226. package/dist/vendor-prosemirror-gapcursor-S3ikcYX6.js +0 -203
  227. package/dist/vendor-prosemirror-history-CQYKHz3u.js +0 -248
  228. package/dist/vendor-prosemirror-keymap-CAfQyvJ7.js +0 -62
  229. package/dist/vendor-prosemirror-markdown-rpUTSG_Q.js +0 -663
  230. package/dist/vendor-prosemirror-model-DAA3avbR.js +0 -2730
  231. package/dist/vendor-prosemirror-schema-list-BNJkECdS.js +0 -87
  232. package/dist/vendor-prosemirror-state-IeimrELV.js +0 -821
  233. package/dist/vendor-prosemirror-tables-zVUKdbdQ.js +0 -1414
  234. package/dist/vendor-prosemirror-transform-BUjWd5Tb.js +0 -1525
  235. package/dist/vendor-prosemirror-view-DFpBkGRq.js +0 -3794
  236. package/dist/vendor-punycode-js-CgGegfA_.js +0 -133
  237. package/dist/vendor-rope-sequence-BWC2FSrq.js +0 -100
  238. package/dist/vendor-semver-Dar8oU3V.js +0 -1023
  239. package/dist/vendor-striptags-BrHtQQiF.js +0 -120
  240. package/dist/vendor-stylis-ClfDrgKE.js +0 -334
  241. package/dist/vendor-swiper-1bp0oJwt.js +0 -3387
  242. package/dist/vendor-tanstack-vue-virtual-CD9yLWd7.js +0 -1
  243. package/dist/vendor-throttle-debounce-CX0imT7m.js +0 -28
  244. package/dist/vendor-tiptap-core-CDScflP1.js +0 -3921
  245. package/dist/vendor-tiptap-extension-blockquote-ChRAwuus.js +0 -55
  246. package/dist/vendor-tiptap-extension-bold-BwoVpOFS.js +0 -74
  247. package/dist/vendor-tiptap-extension-code-DOlgG3ih.js +0 -52
  248. package/dist/vendor-tiptap-extension-code-block-CMeTs87s.js +0 -215
  249. package/dist/vendor-tiptap-extension-document-DO8oly70.js +0 -12
  250. package/dist/vendor-tiptap-extension-hard-break-BgDl2sHf.js +0 -59
  251. package/dist/vendor-tiptap-extension-heading-DFuYlwHi.js +0 -63
  252. package/dist/vendor-tiptap-extension-horizontal-rule-uyfttMp9.js +0 -56
  253. package/dist/vendor-tiptap-extension-image-DPeBaTE3.js +0 -128
  254. package/dist/vendor-tiptap-extension-italic-C9-3jNxO.js +0 -73
  255. package/dist/vendor-tiptap-extension-link-B57VzStq.js +0 -312
  256. package/dist/vendor-tiptap-extension-list-spvOF7Mz.js +0 -722
  257. package/dist/vendor-tiptap-extension-paragraph-Cj7auQB7.js +0 -44
  258. package/dist/vendor-tiptap-extension-placeholder-DhwvmZ6Y.js +0 -1
  259. package/dist/vendor-tiptap-extension-strike-yj6UvnkO.js +0 -64
  260. package/dist/vendor-tiptap-extension-table-cell-CQpTPSvF.js +0 -1
  261. package/dist/vendor-tiptap-extension-table-ex1kZQ-9.js +0 -374
  262. package/dist/vendor-tiptap-extension-table-header-CQpTPSvF.js +0 -1
  263. package/dist/vendor-tiptap-extension-table-row-CQpTPSvF.js +0 -1
  264. package/dist/vendor-tiptap-extension-text-C8FG4KnI.js +0 -13
  265. package/dist/vendor-tiptap-extension-text-style-DsQDXowp.js +0 -235
  266. package/dist/vendor-tiptap-extension-underline-HB3fg6Dc.js +0 -65
  267. package/dist/vendor-tiptap-extensions-CUGwjzl5.js +0 -296
  268. package/dist/vendor-tiptap-markdown-DLzeP3KU.js +0 -826
  269. package/dist/vendor-tiptap-pm-DSHuSumV.js +0 -1
  270. package/dist/vendor-tiptap-starter-kit-C42PcJ7J.js +0 -28
  271. package/dist/vendor-tiptap-vue-3-BxWCzu9Z.js +0 -157
  272. package/dist/vendor-truncate-html-r2r8GKvW.js +0 -145
  273. package/dist/vendor-uc-micro-4lbSaZOs.js +0 -17
  274. package/dist/vendor-unovis-ts-Bue71Kwt.js +0 -2382
  275. package/dist/vendor-unovis-vue-C_K1g5KH.js +0 -446
  276. package/dist/vendor-vee-validate-i18n-zT8NxX3R.js +0 -93
  277. package/dist/vendor-vee-validate-rules-4oWUZPpG.js +0 -316
  278. package/dist/vendor-vue-currency-input-CckB4kjx.js +0 -317
  279. package/dist/vendor-vue-demi-CD9yLWd7.js +0 -1
  280. package/dist/vendor-vue-devtools-api-aVYGocXp.js +0 -93
  281. package/dist/vendor-vue-i18n-DeO9Fa9I.js +0 -1387
  282. package/dist/vendor-vue-router-R3V0tq8_.js +0 -6
  283. package/dist/vendor-vue3-application-insights-BmJCYUcp.js +0 -69
  284. package/dist/vendor-vue3-touch-events-DqysuuWh.js +0 -169
  285. package/dist/vendor-vuepic-vue-datepicker-CaZ_qpJp.js +0 -4998
  286. package/dist/vendor-vueuse-components-Be490f6P.js +0 -542
  287. package/dist/vendor-vueuse-core-BW8bO6-j.js +0 -5135
  288. package/dist/vendor-vueuse-shared-bmkWEEYZ.js +0 -1169
  289. package/dist/vendor-w3c-keyname-CLxH8j-f.js +0 -92
  290. package/dist/vendor-web-vitals-vrpLO1bu.js +0 -207
@@ -1,821 +0,0 @@
1
- import { S as m, F as B, N as P, M as R } from "./vendor-prosemirror-model-DAA3avbR.js";
2
- import { R as x, a as K, T as $ } from "./vendor-prosemirror-transform-BUjWd5Tb.js";
3
- const O = /* @__PURE__ */ Object.create(null);
4
- class l {
5
- /**
6
- Initialize a selection with the head and anchor and ranges. If no
7
- ranges are given, constructs a single range across `$anchor` and
8
- `$head`.
9
- */
10
- constructor(e, t, r) {
11
- this.$anchor = e, this.$head = t, this.ranges = r || [new q(e.min(t), e.max(t))];
12
- }
13
- /**
14
- The selection's anchor, as an unresolved position.
15
- */
16
- get anchor() {
17
- return this.$anchor.pos;
18
- }
19
- /**
20
- The selection's head.
21
- */
22
- get head() {
23
- return this.$head.pos;
24
- }
25
- /**
26
- The lower bound of the selection's main range.
27
- */
28
- get from() {
29
- return this.$from.pos;
30
- }
31
- /**
32
- The upper bound of the selection's main range.
33
- */
34
- get to() {
35
- return this.$to.pos;
36
- }
37
- /**
38
- The resolved lower bound of the selection's main range.
39
- */
40
- get $from() {
41
- return this.ranges[0].$from;
42
- }
43
- /**
44
- The resolved upper bound of the selection's main range.
45
- */
46
- get $to() {
47
- return this.ranges[0].$to;
48
- }
49
- /**
50
- Indicates whether the selection contains any content.
51
- */
52
- get empty() {
53
- let e = this.ranges;
54
- for (let t = 0; t < e.length; t++)
55
- if (e[t].$from.pos != e[t].$to.pos)
56
- return !1;
57
- return !0;
58
- }
59
- /**
60
- Get the content of this selection as a slice.
61
- */
62
- content() {
63
- return this.$from.doc.slice(this.from, this.to, !0);
64
- }
65
- /**
66
- Replace the selection with a slice or, if no slice is given,
67
- delete the selection. Will append to the given transaction.
68
- */
69
- replace(e, t = m.empty) {
70
- let r = t.content.lastChild, n = null;
71
- for (let a = 0; a < t.openEnd; a++)
72
- n = r, r = r.lastChild;
73
- let s = e.steps.length, o = this.ranges;
74
- for (let a = 0; a < o.length; a++) {
75
- let { $from: c, $to: u } = o[a], h = e.mapping.slice(s);
76
- e.replaceRange(h.map(c.pos), h.map(u.pos), a ? m.empty : t), a == 0 && E(e, s, (r ? r.isInline : n && n.isTextblock) ? -1 : 1);
77
- }
78
- }
79
- /**
80
- Replace the selection with the given node, appending the changes
81
- to the given transaction.
82
- */
83
- replaceWith(e, t) {
84
- let r = e.steps.length, n = this.ranges;
85
- for (let s = 0; s < n.length; s++) {
86
- let { $from: o, $to: a } = n[s], c = e.mapping.slice(r), u = c.map(o.pos), h = c.map(a.pos);
87
- s ? e.deleteRange(u, h) : (e.replaceRangeWith(u, h, t), E(e, r, t.isInline ? -1 : 1));
88
- }
89
- }
90
- /**
91
- Find a valid cursor or leaf node selection starting at the given
92
- position and searching back if `dir` is negative, and forward if
93
- positive. When `textOnly` is true, only consider cursor
94
- selections. Will return null when no valid selection position is
95
- found.
96
- */
97
- static findFrom(e, t, r = !1) {
98
- let n = e.parent.inlineContent ? new f(e) : g(e.node(0), e.parent, e.pos, e.index(), t, r);
99
- if (n)
100
- return n;
101
- for (let s = e.depth - 1; s >= 0; s--) {
102
- let o = t < 0 ? g(e.node(0), e.node(s), e.before(s + 1), e.index(s), t, r) : g(e.node(0), e.node(s), e.after(s + 1), e.index(s) + 1, t, r);
103
- if (o)
104
- return o;
105
- }
106
- return null;
107
- }
108
- /**
109
- Find a valid cursor or leaf node selection near the given
110
- position. Searches forward first by default, but if `bias` is
111
- negative, it will search backwards first.
112
- */
113
- static near(e, t = 1) {
114
- return this.findFrom(e, t) || this.findFrom(e, -t) || new d(e.node(0));
115
- }
116
- /**
117
- Find the cursor or leaf node selection closest to the start of
118
- the given document. Will return an
119
- [`AllSelection`](https://prosemirror.net/docs/ref/#state.AllSelection) if no valid position
120
- exists.
121
- */
122
- static atStart(e) {
123
- return g(e, e, 0, 0, 1) || new d(e);
124
- }
125
- /**
126
- Find the cursor or leaf node selection closest to the end of the
127
- given document.
128
- */
129
- static atEnd(e) {
130
- return g(e, e, e.content.size, e.childCount, -1) || new d(e);
131
- }
132
- /**
133
- Deserialize the JSON representation of a selection. Must be
134
- implemented for custom classes (as a static class method).
135
- */
136
- static fromJSON(e, t) {
137
- if (!t || !t.type)
138
- throw new RangeError("Invalid input for Selection.fromJSON");
139
- let r = O[t.type];
140
- if (!r)
141
- throw new RangeError(`No selection type ${t.type} defined`);
142
- return r.fromJSON(e, t);
143
- }
144
- /**
145
- To be able to deserialize selections from JSON, custom selection
146
- classes must register themselves with an ID string, so that they
147
- can be disambiguated. Try to pick something that's unlikely to
148
- clash with classes from other modules.
149
- */
150
- static jsonID(e, t) {
151
- if (e in O)
152
- throw new RangeError("Duplicate use of selection JSON ID " + e);
153
- return O[e] = t, t.prototype.jsonID = e, t;
154
- }
155
- /**
156
- Get a [bookmark](https://prosemirror.net/docs/ref/#state.SelectionBookmark) for this selection,
157
- which is a value that can be mapped without having access to a
158
- current document, and later resolved to a real selection for a
159
- given document again. (This is used mostly by the history to
160
- track and restore old selections.) The default implementation of
161
- this method just converts the selection to a text selection and
162
- returns the bookmark for that.
163
- */
164
- getBookmark() {
165
- return f.between(this.$anchor, this.$head).getBookmark();
166
- }
167
- }
168
- l.prototype.visible = !0;
169
- class q {
170
- /**
171
- Create a range.
172
- */
173
- constructor(e, t) {
174
- this.$from = e, this.$to = t;
175
- }
176
- }
177
- let T = !1;
178
- function I(i) {
179
- !T && !i.parent.inlineContent && (T = !0, console.warn("TextSelection endpoint not pointing into a node with inline content (" + i.parent.type.name + ")"));
180
- }
181
- class f extends l {
182
- /**
183
- Construct a text selection between the given points.
184
- */
185
- constructor(e, t = e) {
186
- I(e), I(t), super(e, t);
187
- }
188
- /**
189
- Returns a resolved position if this is a cursor selection (an
190
- empty text selection), and null otherwise.
191
- */
192
- get $cursor() {
193
- return this.$anchor.pos == this.$head.pos ? this.$head : null;
194
- }
195
- map(e, t) {
196
- let r = e.resolve(t.map(this.head));
197
- if (!r.parent.inlineContent)
198
- return l.near(r);
199
- let n = e.resolve(t.map(this.anchor));
200
- return new f(n.parent.inlineContent ? n : r, r);
201
- }
202
- replace(e, t = m.empty) {
203
- if (super.replace(e, t), t == m.empty) {
204
- let r = this.$from.marksAcross(this.$to);
205
- r && e.ensureMarks(r);
206
- }
207
- }
208
- eq(e) {
209
- return e instanceof f && e.anchor == this.anchor && e.head == this.head;
210
- }
211
- getBookmark() {
212
- return new y(this.anchor, this.head);
213
- }
214
- toJSON() {
215
- return { type: "text", anchor: this.anchor, head: this.head };
216
- }
217
- /**
218
- @internal
219
- */
220
- static fromJSON(e, t) {
221
- if (typeof t.anchor != "number" || typeof t.head != "number")
222
- throw new RangeError("Invalid input for TextSelection.fromJSON");
223
- return new f(e.resolve(t.anchor), e.resolve(t.head));
224
- }
225
- /**
226
- Create a text selection from non-resolved positions.
227
- */
228
- static create(e, t, r = t) {
229
- let n = e.resolve(t);
230
- return new this(n, r == t ? n : e.resolve(r));
231
- }
232
- /**
233
- Return a text selection that spans the given positions or, if
234
- they aren't text positions, find a text selection near them.
235
- `bias` determines whether the method searches forward (default)
236
- or backwards (negative number) first. Will fall back to calling
237
- [`Selection.near`](https://prosemirror.net/docs/ref/#state.Selection^near) when the document
238
- doesn't contain a valid text position.
239
- */
240
- static between(e, t, r) {
241
- let n = e.pos - t.pos;
242
- if ((!r || n) && (r = n >= 0 ? 1 : -1), !t.parent.inlineContent) {
243
- let s = l.findFrom(t, r, !0) || l.findFrom(t, -r, !0);
244
- if (s)
245
- t = s.$head;
246
- else
247
- return l.near(t, r);
248
- }
249
- return e.parent.inlineContent || (n == 0 ? e = t : (e = (l.findFrom(e, -r, !0) || l.findFrom(e, r, !0)).$anchor, e.pos < t.pos != n < 0 && (e = t))), new f(e, t);
250
- }
251
- }
252
- l.jsonID("text", f);
253
- class y {
254
- constructor(e, t) {
255
- this.anchor = e, this.head = t;
256
- }
257
- map(e) {
258
- return new y(e.map(this.anchor), e.map(this.head));
259
- }
260
- resolve(e) {
261
- return f.between(e.resolve(this.anchor), e.resolve(this.head));
262
- }
263
- }
264
- class p extends l {
265
- /**
266
- Create a node selection. Does not verify the validity of its
267
- argument.
268
- */
269
- constructor(e) {
270
- let t = e.nodeAfter, r = e.node(0).resolve(e.pos + t.nodeSize);
271
- super(e, r), this.node = t;
272
- }
273
- map(e, t) {
274
- let { deleted: r, pos: n } = t.mapResult(this.anchor), s = e.resolve(n);
275
- return r ? l.near(s) : new p(s);
276
- }
277
- content() {
278
- return new m(B.from(this.node), 0, 0);
279
- }
280
- eq(e) {
281
- return e instanceof p && e.anchor == this.anchor;
282
- }
283
- toJSON() {
284
- return { type: "node", anchor: this.anchor };
285
- }
286
- getBookmark() {
287
- return new J(this.anchor);
288
- }
289
- /**
290
- @internal
291
- */
292
- static fromJSON(e, t) {
293
- if (typeof t.anchor != "number")
294
- throw new RangeError("Invalid input for NodeSelection.fromJSON");
295
- return new p(e.resolve(t.anchor));
296
- }
297
- /**
298
- Create a node selection from non-resolved positions.
299
- */
300
- static create(e, t) {
301
- return new p(e.resolve(t));
302
- }
303
- /**
304
- Determines whether the given node may be selected as a node
305
- selection.
306
- */
307
- static isSelectable(e) {
308
- return !e.isText && e.type.spec.selectable !== !1;
309
- }
310
- }
311
- p.prototype.visible = !1;
312
- l.jsonID("node", p);
313
- class J {
314
- constructor(e) {
315
- this.anchor = e;
316
- }
317
- map(e) {
318
- let { deleted: t, pos: r } = e.mapResult(this.anchor);
319
- return t ? new y(r, r) : new J(r);
320
- }
321
- resolve(e) {
322
- let t = e.resolve(this.anchor), r = t.nodeAfter;
323
- return r && p.isSelectable(r) ? new p(t) : l.near(t);
324
- }
325
- }
326
- class d extends l {
327
- /**
328
- Create an all-selection over the given document.
329
- */
330
- constructor(e) {
331
- super(e.resolve(0), e.resolve(e.content.size));
332
- }
333
- replace(e, t = m.empty) {
334
- if (t == m.empty) {
335
- e.delete(0, e.doc.content.size);
336
- let r = l.atStart(e.doc);
337
- r.eq(e.selection) || e.setSelection(r);
338
- } else
339
- super.replace(e, t);
340
- }
341
- toJSON() {
342
- return { type: "all" };
343
- }
344
- /**
345
- @internal
346
- */
347
- static fromJSON(e) {
348
- return new d(e);
349
- }
350
- map(e) {
351
- return new d(e);
352
- }
353
- eq(e) {
354
- return e instanceof d;
355
- }
356
- getBookmark() {
357
- return z;
358
- }
359
- }
360
- l.jsonID("all", d);
361
- const z = {
362
- map() {
363
- return this;
364
- },
365
- resolve(i) {
366
- return new d(i);
367
- }
368
- };
369
- function g(i, e, t, r, n, s = !1) {
370
- if (e.inlineContent)
371
- return f.create(i, t);
372
- for (let o = r - (n > 0 ? 0 : 1); n > 0 ? o < e.childCount : o >= 0; o += n) {
373
- let a = e.child(o);
374
- if (a.isAtom) {
375
- if (!s && p.isSelectable(a))
376
- return p.create(i, t - (n < 0 ? a.nodeSize : 0));
377
- } else {
378
- let c = g(i, a, t + n, n < 0 ? a.childCount : 0, n, s);
379
- if (c)
380
- return c;
381
- }
382
- t += a.nodeSize * n;
383
- }
384
- return null;
385
- }
386
- function E(i, e, t) {
387
- let r = i.steps.length - 1;
388
- if (r < e)
389
- return;
390
- let n = i.steps[r];
391
- if (!(n instanceof x || n instanceof K))
392
- return;
393
- let s = i.mapping.maps[r], o;
394
- s.forEach((a, c, u, h) => {
395
- o == null && (o = h);
396
- }), i.setSelection(l.near(i.doc.resolve(o), t));
397
- }
398
- const b = 1, k = 2, F = 4;
399
- class W extends $ {
400
- /**
401
- @internal
402
- */
403
- constructor(e) {
404
- super(e.doc), this.curSelectionFor = 0, this.updated = 0, this.meta = /* @__PURE__ */ Object.create(null), this.time = Date.now(), this.curSelection = e.selection, this.storedMarks = e.storedMarks;
405
- }
406
- /**
407
- The transaction's current selection. This defaults to the editor
408
- selection [mapped](https://prosemirror.net/docs/ref/#state.Selection.map) through the steps in the
409
- transaction, but can be overwritten with
410
- [`setSelection`](https://prosemirror.net/docs/ref/#state.Transaction.setSelection).
411
- */
412
- get selection() {
413
- return this.curSelectionFor < this.steps.length && (this.curSelection = this.curSelection.map(this.doc, this.mapping.slice(this.curSelectionFor)), this.curSelectionFor = this.steps.length), this.curSelection;
414
- }
415
- /**
416
- Update the transaction's current selection. Will determine the
417
- selection that the editor gets when the transaction is applied.
418
- */
419
- setSelection(e) {
420
- if (e.$from.doc != this.doc)
421
- throw new RangeError("Selection passed to setSelection must point at the current document");
422
- return this.curSelection = e, this.curSelectionFor = this.steps.length, this.updated = (this.updated | b) & ~k, this.storedMarks = null, this;
423
- }
424
- /**
425
- Whether the selection was explicitly updated by this transaction.
426
- */
427
- get selectionSet() {
428
- return (this.updated & b) > 0;
429
- }
430
- /**
431
- Set the current stored marks.
432
- */
433
- setStoredMarks(e) {
434
- return this.storedMarks = e, this.updated |= k, this;
435
- }
436
- /**
437
- Make sure the current stored marks or, if that is null, the marks
438
- at the selection, match the given set of marks. Does nothing if
439
- this is already the case.
440
- */
441
- ensureMarks(e) {
442
- return R.sameSet(this.storedMarks || this.selection.$from.marks(), e) || this.setStoredMarks(e), this;
443
- }
444
- /**
445
- Add a mark to the set of stored marks.
446
- */
447
- addStoredMark(e) {
448
- return this.ensureMarks(e.addToSet(this.storedMarks || this.selection.$head.marks()));
449
- }
450
- /**
451
- Remove a mark or mark type from the set of stored marks.
452
- */
453
- removeStoredMark(e) {
454
- return this.ensureMarks(e.removeFromSet(this.storedMarks || this.selection.$head.marks()));
455
- }
456
- /**
457
- Whether the stored marks were explicitly set for this transaction.
458
- */
459
- get storedMarksSet() {
460
- return (this.updated & k) > 0;
461
- }
462
- /**
463
- @internal
464
- */
465
- addStep(e, t) {
466
- super.addStep(e, t), this.updated = this.updated & ~k, this.storedMarks = null;
467
- }
468
- /**
469
- Update the timestamp for the transaction.
470
- */
471
- setTime(e) {
472
- return this.time = e, this;
473
- }
474
- /**
475
- Replace the current selection with the given slice.
476
- */
477
- replaceSelection(e) {
478
- return this.selection.replace(this, e), this;
479
- }
480
- /**
481
- Replace the selection with the given node. When `inheritMarks` is
482
- true and the content is inline, it inherits the marks from the
483
- place where it is inserted.
484
- */
485
- replaceSelectionWith(e, t = !0) {
486
- let r = this.selection;
487
- return t && (e = e.mark(this.storedMarks || (r.empty ? r.$from.marks() : r.$from.marksAcross(r.$to) || R.none))), r.replaceWith(this, e), this;
488
- }
489
- /**
490
- Delete the selection.
491
- */
492
- deleteSelection() {
493
- return this.selection.replace(this), this;
494
- }
495
- /**
496
- Replace the given range, or the selection if no range is given,
497
- with a text node containing the given string.
498
- */
499
- insertText(e, t, r) {
500
- let n = this.doc.type.schema;
501
- if (t == null)
502
- return e ? this.replaceSelectionWith(n.text(e), !0) : this.deleteSelection();
503
- {
504
- if (r == null && (r = t), !e)
505
- return this.deleteRange(t, r);
506
- let s = this.storedMarks;
507
- if (!s) {
508
- let o = this.doc.resolve(t);
509
- s = r == t ? o.marks() : o.marksAcross(this.doc.resolve(r));
510
- }
511
- return this.replaceRangeWith(t, r, n.text(e, s)), !this.selection.empty && this.selection.to == t + e.length && this.setSelection(l.near(this.selection.$to)), this;
512
- }
513
- }
514
- /**
515
- Store a metadata property in this transaction, keyed either by
516
- name or by plugin.
517
- */
518
- setMeta(e, t) {
519
- return this.meta[typeof e == "string" ? e : e.key] = t, this;
520
- }
521
- /**
522
- Retrieve a metadata property for a given name or plugin.
523
- */
524
- getMeta(e) {
525
- return this.meta[typeof e == "string" ? e : e.key];
526
- }
527
- /**
528
- Returns true if this transaction doesn't contain any metadata,
529
- and can thus safely be extended.
530
- */
531
- get isGeneric() {
532
- for (let e in this.meta)
533
- return !1;
534
- return !0;
535
- }
536
- /**
537
- Indicate that the editor should scroll the selection into view
538
- when updated to the state produced by this transaction.
539
- */
540
- scrollIntoView() {
541
- return this.updated |= F, this;
542
- }
543
- /**
544
- True when this transaction has had `scrollIntoView` called on it.
545
- */
546
- get scrolledIntoView() {
547
- return (this.updated & F) > 0;
548
- }
549
- }
550
- function D(i, e) {
551
- return !e || !i ? i : i.bind(e);
552
- }
553
- class S {
554
- constructor(e, t, r) {
555
- this.name = e, this.init = D(t.init, r), this.apply = D(t.apply, r);
556
- }
557
- }
558
- const L = [
559
- new S("doc", {
560
- init(i) {
561
- return i.doc || i.schema.topNodeType.createAndFill();
562
- },
563
- apply(i) {
564
- return i.doc;
565
- }
566
- }),
567
- new S("selection", {
568
- init(i, e) {
569
- return i.selection || l.atStart(e.doc);
570
- },
571
- apply(i) {
572
- return i.selection;
573
- }
574
- }),
575
- new S("storedMarks", {
576
- init(i) {
577
- return i.storedMarks || null;
578
- },
579
- apply(i, e, t, r) {
580
- return r.selection.$cursor ? i.storedMarks : null;
581
- }
582
- }),
583
- new S("scrollToSelection", {
584
- init() {
585
- return 0;
586
- },
587
- apply(i, e) {
588
- return i.scrolledIntoView ? e + 1 : e;
589
- }
590
- })
591
- ];
592
- class v {
593
- constructor(e, t) {
594
- this.schema = e, this.plugins = [], this.pluginsByKey = /* @__PURE__ */ Object.create(null), this.fields = L.slice(), t && t.forEach((r) => {
595
- if (this.pluginsByKey[r.key])
596
- throw new RangeError("Adding different instances of a keyed plugin (" + r.key + ")");
597
- this.plugins.push(r), this.pluginsByKey[r.key] = r, r.spec.state && this.fields.push(new S(r.key, r.spec.state, r));
598
- });
599
- }
600
- }
601
- class w {
602
- /**
603
- @internal
604
- */
605
- constructor(e) {
606
- this.config = e;
607
- }
608
- /**
609
- The schema of the state's document.
610
- */
611
- get schema() {
612
- return this.config.schema;
613
- }
614
- /**
615
- The plugins that are active in this state.
616
- */
617
- get plugins() {
618
- return this.config.plugins;
619
- }
620
- /**
621
- Apply the given transaction to produce a new state.
622
- */
623
- apply(e) {
624
- return this.applyTransaction(e).state;
625
- }
626
- /**
627
- @internal
628
- */
629
- filterTransaction(e, t = -1) {
630
- for (let r = 0; r < this.config.plugins.length; r++)
631
- if (r != t) {
632
- let n = this.config.plugins[r];
633
- if (n.spec.filterTransaction && !n.spec.filterTransaction.call(n, e, this))
634
- return !1;
635
- }
636
- return !0;
637
- }
638
- /**
639
- Verbose variant of [`apply`](https://prosemirror.net/docs/ref/#state.EditorState.apply) that
640
- returns the precise transactions that were applied (which might
641
- be influenced by the [transaction
642
- hooks](https://prosemirror.net/docs/ref/#state.PluginSpec.filterTransaction) of
643
- plugins) along with the new state.
644
- */
645
- applyTransaction(e) {
646
- if (!this.filterTransaction(e))
647
- return { state: this, transactions: [] };
648
- let t = [e], r = this.applyInner(e), n = null;
649
- for (; ; ) {
650
- let s = !1;
651
- for (let o = 0; o < this.config.plugins.length; o++) {
652
- let a = this.config.plugins[o];
653
- if (a.spec.appendTransaction) {
654
- let c = n ? n[o].n : 0, u = n ? n[o].state : this, h = c < t.length && a.spec.appendTransaction.call(a, c ? t.slice(c) : t, u, r);
655
- if (h && r.filterTransaction(h, o)) {
656
- if (h.setMeta("appendedTransaction", e), !n) {
657
- n = [];
658
- for (let M = 0; M < this.config.plugins.length; M++)
659
- n.push(M < o ? { state: r, n: t.length } : { state: this, n: 0 });
660
- }
661
- t.push(h), r = r.applyInner(h), s = !0;
662
- }
663
- n && (n[o] = { state: r, n: t.length });
664
- }
665
- }
666
- if (!s)
667
- return { state: r, transactions: t };
668
- }
669
- }
670
- /**
671
- @internal
672
- */
673
- applyInner(e) {
674
- if (!e.before.eq(this.doc))
675
- throw new RangeError("Applying a mismatched transaction");
676
- let t = new w(this.config), r = this.config.fields;
677
- for (let n = 0; n < r.length; n++) {
678
- let s = r[n];
679
- t[s.name] = s.apply(e, this[s.name], this, t);
680
- }
681
- return t;
682
- }
683
- /**
684
- Accessor that constructs and returns a new [transaction](https://prosemirror.net/docs/ref/#state.Transaction) from this state.
685
- */
686
- get tr() {
687
- return new W(this);
688
- }
689
- /**
690
- Create a new state.
691
- */
692
- static create(e) {
693
- let t = new v(e.doc ? e.doc.type.schema : e.schema, e.plugins), r = new w(t);
694
- for (let n = 0; n < t.fields.length; n++)
695
- r[t.fields[n].name] = t.fields[n].init(e, r);
696
- return r;
697
- }
698
- /**
699
- Create a new state based on this one, but with an adjusted set
700
- of active plugins. State fields that exist in both sets of
701
- plugins are kept unchanged. Those that no longer exist are
702
- dropped, and those that are new are initialized using their
703
- [`init`](https://prosemirror.net/docs/ref/#state.StateField.init) method, passing in the new
704
- configuration object..
705
- */
706
- reconfigure(e) {
707
- let t = new v(this.schema, e.plugins), r = t.fields, n = new w(t);
708
- for (let s = 0; s < r.length; s++) {
709
- let o = r[s].name;
710
- n[o] = this.hasOwnProperty(o) ? this[o] : r[s].init(e, n);
711
- }
712
- return n;
713
- }
714
- /**
715
- Serialize this state to JSON. If you want to serialize the state
716
- of plugins, pass an object mapping property names to use in the
717
- resulting JSON object to plugin objects. The argument may also be
718
- a string or number, in which case it is ignored, to support the
719
- way `JSON.stringify` calls `toString` methods.
720
- */
721
- toJSON(e) {
722
- let t = { doc: this.doc.toJSON(), selection: this.selection.toJSON() };
723
- if (this.storedMarks && (t.storedMarks = this.storedMarks.map((r) => r.toJSON())), e && typeof e == "object")
724
- for (let r in e) {
725
- if (r == "doc" || r == "selection")
726
- throw new RangeError("The JSON fields `doc` and `selection` are reserved");
727
- let n = e[r], s = n.spec.state;
728
- s && s.toJSON && (t[r] = s.toJSON.call(n, this[n.key]));
729
- }
730
- return t;
731
- }
732
- /**
733
- Deserialize a JSON representation of a state. `config` should
734
- have at least a `schema` field, and should contain array of
735
- plugins to initialize the state with. `pluginFields` can be used
736
- to deserialize the state of plugins, by associating plugin
737
- instances with the property names they use in the JSON object.
738
- */
739
- static fromJSON(e, t, r) {
740
- if (!t)
741
- throw new RangeError("Invalid input for EditorState.fromJSON");
742
- if (!e.schema)
743
- throw new RangeError("Required config field 'schema' missing");
744
- let n = new v(e.schema, e.plugins), s = new w(n);
745
- return n.fields.forEach((o) => {
746
- if (o.name == "doc")
747
- s.doc = P.fromJSON(e.schema, t.doc);
748
- else if (o.name == "selection")
749
- s.selection = l.fromJSON(s.doc, t.selection);
750
- else if (o.name == "storedMarks")
751
- t.storedMarks && (s.storedMarks = t.storedMarks.map(e.schema.markFromJSON));
752
- else {
753
- if (r)
754
- for (let a in r) {
755
- let c = r[a], u = c.spec.state;
756
- if (c.key == o.name && u && u.fromJSON && Object.prototype.hasOwnProperty.call(t, a)) {
757
- s[o.name] = u.fromJSON.call(c, e, t[a], s);
758
- return;
759
- }
760
- }
761
- s[o.name] = o.init(e, s);
762
- }
763
- }), s;
764
- }
765
- }
766
- function A(i, e, t) {
767
- for (let r in i) {
768
- let n = i[r];
769
- n instanceof Function ? n = n.bind(e) : r == "handleDOMEvents" && (n = A(n, e, {})), t[r] = n;
770
- }
771
- return t;
772
- }
773
- class G {
774
- /**
775
- Create a plugin.
776
- */
777
- constructor(e) {
778
- this.spec = e, this.props = {}, e.props && A(e.props, this, this.props), this.key = e.key ? e.key.key : C("plugin");
779
- }
780
- /**
781
- Extract the plugin's state field from an editor state.
782
- */
783
- getState(e) {
784
- return e[this.key];
785
- }
786
- }
787
- const N = /* @__PURE__ */ Object.create(null);
788
- function C(i) {
789
- return i in N ? i + "$" + ++N[i] : (N[i] = 0, i + "$");
790
- }
791
- class H {
792
- /**
793
- Create a plugin key.
794
- */
795
- constructor(e = "key") {
796
- this.key = C(e);
797
- }
798
- /**
799
- Get the active plugin with this key, if any, from an editor
800
- state.
801
- */
802
- get(e) {
803
- return e.config.pluginsByKey[this.key];
804
- }
805
- /**
806
- Get the plugin's state from an editor state.
807
- */
808
- getState(e) {
809
- return e[this.key];
810
- }
811
- }
812
- export {
813
- d as A,
814
- w as E,
815
- p as N,
816
- G as P,
817
- l as S,
818
- f as T,
819
- H as a,
820
- q as b
821
- };