@vc-shell/framework 1.1.44 → 1.1.45

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 (453) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/core/plugins/modularity/loader.ts +120 -74
  3. package/core/services/app-bar-mobile-buttons-service.ts +1 -1
  4. package/dist/core/plugins/modularity/loader.d.ts.map +1 -1
  5. package/dist/core/services/app-bar-mobile-buttons-service.d.ts +1 -1
  6. package/dist/core/services/app-bar-mobile-buttons-service.d.ts.map +1 -1
  7. package/dist/framework.js +33347 -295
  8. package/dist/index.css +1 -9
  9. package/dist/index.d.ts +0 -4
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/locales/de.json +0 -84
  12. package/dist/locales/en.json +0 -84
  13. package/dist/shared/components/blade-navigation/components/vc-blade-navigation/_internal/vc-mobile-back-button.vue.d.ts.map +1 -1
  14. package/dist/shared/components/blade-navigation/components/vc-blade-view/vc-blade-view.d.ts +1 -1
  15. package/dist/shared/components/blade-navigation/components/vc-blade-view/vc-blade-view.d.ts.map +1 -1
  16. package/dist/shared/components/blade-navigation/composables/useBladeNavigation/internal/bladeRouteResolver.d.ts.map +1 -1
  17. package/dist/shared/components/change-password-button/change-password-button.vue.d.ts.map +1 -1
  18. package/dist/shared/components/logout-button/logout-button.vue.d.ts.map +1 -1
  19. package/dist/shared/components/settings-menu-item/settings-menu-item.vue.d.ts.map +1 -1
  20. package/dist/shared/modules/dynamic/pages/dynamic-blade-form.vue.d.ts +2 -2
  21. package/dist/shared/modules/dynamic/pages/dynamic-blade-list.vue.d.ts +6 -6
  22. package/dist/shared/modules/dynamic/pages/dynamic-blade-list.vue.d.ts.map +1 -1
  23. package/dist/tsconfig.tsbuildinfo +1 -1
  24. package/dist/ui/components/atoms/vc-hint/vc-hint.vue.d.ts.map +1 -1
  25. package/dist/ui/components/atoms/vc-icon/icons/MenuBurgerIcon.vue.d.ts.map +1 -1
  26. package/dist/ui/components/atoms/vc-icon/icons/index.d.ts +0 -26
  27. package/dist/ui/components/atoms/vc-icon/icons/index.d.ts.map +1 -1
  28. package/dist/ui/components/atoms/vc-icon/vc-bootstrap-icon.vue.d.ts.map +1 -1
  29. package/dist/ui/components/atoms/vc-icon/vc-fontawesome-icon.vue.d.ts.map +1 -1
  30. package/dist/ui/components/atoms/vc-icon/vc-icon.vue.d.ts.map +1 -1
  31. package/dist/ui/components/atoms/vc-icon/vc-lucide-icon.vue.d.ts +0 -5
  32. package/dist/ui/components/atoms/vc-icon/vc-lucide-icon.vue.d.ts.map +1 -1
  33. package/dist/ui/components/atoms/vc-icon/vc-material-icon.vue.d.ts +0 -20
  34. package/dist/ui/components/atoms/vc-icon/vc-material-icon.vue.d.ts.map +1 -1
  35. package/dist/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.vue.d.ts.map +1 -1
  36. package/dist/ui/components/molecules/vc-editor/_internal/vc-editor-button.vue.d.ts +36 -0
  37. package/dist/ui/components/molecules/vc-editor/_internal/vc-editor-button.vue.d.ts.map +1 -0
  38. package/dist/ui/components/molecules/vc-editor/_internal/vc-editor-toolbar.vue.d.ts +17 -0
  39. package/dist/ui/components/molecules/vc-editor/_internal/vc-editor-toolbar.vue.d.ts.map +1 -0
  40. package/dist/ui/components/molecules/vc-editor/vc-editor.vue.d.ts +16 -2381
  41. package/dist/ui/components/molecules/vc-editor/vc-editor.vue.d.ts.map +1 -1
  42. package/dist/ui/components/molecules/vc-form/vc-form.vue.d.ts.map +1 -1
  43. package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.vue.d.ts +1 -1
  44. package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.vue.d.ts.map +1 -1
  45. package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.vue.d.ts +1 -1
  46. package/dist/ui/components/molecules/vc-pagination/vc-pagination.vue.d.ts.map +1 -1
  47. package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/MenuSidebar.vue.d.ts.map +1 -1
  48. package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue.d.ts.map +1 -1
  49. package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/_internal/vc-app-menu-link.vue.d.ts.map +1 -1
  50. package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts.map +1 -1
  51. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-header/vc-blade-header.vue.d.ts.map +1 -1
  52. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-desktop.vue.d.ts.map +1 -1
  53. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-mobile.vue.d.ts.map +1 -1
  54. package/dist/ui/components/organisms/vc-blade/vc-blade.vue.d.ts.map +1 -1
  55. package/dist/ui/components/organisms/vc-gallery/_internal/vc-gallery-item/vc-gallery-item.vue.d.ts +2 -2
  56. package/dist/ui/components/organisms/vc-gallery/vc-gallery.vue.d.ts +2 -2
  57. package/dist/ui/components/organisms/vc-table/_internal/vc-table-filter/vc-table-filter.vue.d.ts.map +1 -1
  58. package/dist/ui/components/organisms/vc-table/_internal/vc-table-header/vc-table-header.vue.d.ts.map +1 -1
  59. package/dist/vendor-boolbase-Cp9L0GAZ.js +25 -0
  60. package/dist/vendor-cheerio-HN9zIPZn.js +3135 -0
  61. package/dist/vendor-cheerio-select-5Ry0HvBq.js +306 -0
  62. package/dist/vendor-core-js-l0sNRNKZ.js +1 -0
  63. package/dist/vendor-css-select-DRIZ9kfZ.js +966 -0
  64. package/dist/vendor-css-what-DuPJ1HEF.js +448 -0
  65. package/dist/vendor-cypress-signalr-mock-BKdBJpdt.js +778 -0
  66. package/dist/vendor-date-fns-515YWkk-.js +6724 -0
  67. package/dist/vendor-dom-serializer-nQMsqjYW.js +286 -0
  68. package/dist/vendor-dom7-CJLPMwy5.js +941 -0
  69. package/dist/vendor-domelementtype-CjSzQey5.js +53 -0
  70. package/dist/vendor-domhandler-9z8cS16a.js +484 -0
  71. package/dist/vendor-dompurify-CRFzu7ib.js +1336 -0
  72. package/dist/vendor-domutils-Bc-Opz-v.js +981 -0
  73. package/dist/vendor-entities-Bfsx4xOQ.js +636 -0
  74. package/dist/vendor-floating-ui-core-wV8u8QP4.js +511 -0
  75. package/dist/vendor-floating-ui-dom-DDnRPs17.js +706 -0
  76. package/dist/vendor-floating-ui-utils-OMIFy1QU.js +296 -0
  77. package/dist/vendor-floating-ui-vue-D-tCDAMm.js +167 -0
  78. package/dist/vendor-fontsource-plus-jakarta-sans.css +1 -0
  79. package/dist/vendor-headlessui-vue-CY9FRgTb.js +83 -0
  80. package/dist/vendor-htmlparser2-B1dhFPOs.js +1426 -0
  81. package/dist/vendor-iconify-vue-DfRGgyNu.js +1840 -0
  82. package/dist/vendor-intlify-core-base-BuknsFQe.js +1876 -0
  83. package/dist/vendor-intlify-message-compiler-CuOQDWx1.js +1508 -0
  84. package/dist/vendor-intlify-shared-Cz4YRMuC.js +241 -0
  85. package/dist/vendor-iso-639-1-BJCk9DvE.js +819 -0
  86. package/dist/vendor-linkify-it-CKUf4vsc.js +830 -0
  87. package/dist/vendor-linkifyjs-BfyGgbCh.js +1756 -0
  88. package/dist/vendor-lodash-es-BySUOlwf.js +18333 -0
  89. package/dist/vendor-markdown-it-D-apazHa.js +6000 -0
  90. package/dist/vendor-markdown-it-task-lists-rxMVH6Ku.js +131 -0
  91. package/dist/vendor-mdurl-BNh2CCgT.js +537 -0
  92. package/dist/vendor-microsoft-applicationinsights-analytics-js-kG3lLg8X.js +1275 -0
  93. package/dist/vendor-microsoft-applicationinsights-cfgsync-js-C0uQkiQq.js +591 -0
  94. package/dist/vendor-microsoft-applicationinsights-channel-js-Dyd_PXA3.js +2153 -0
  95. package/dist/vendor-microsoft-applicationinsights-common-CfmP1_Qr.js +2470 -0
  96. package/dist/vendor-microsoft-applicationinsights-core-js-Cq4YSEvZ.js +6589 -0
  97. package/dist/vendor-microsoft-applicationinsights-dependencies-js-C56OBFr4.js +1510 -0
  98. package/dist/vendor-microsoft-applicationinsights-properties-js-CBJTBawx.js +761 -0
  99. package/dist/vendor-microsoft-applicationinsights-shims-CX8sJgar.js +70 -0
  100. package/dist/vendor-microsoft-applicationinsights-web-pim2ri-g.js +667 -0
  101. package/dist/vendor-microsoft-dynamicproto-js-CFBBUu9p.js +520 -0
  102. package/dist/vendor-microsoft-signalr-dUnlRsGm.js +3339 -0
  103. package/dist/vendor-moment-Mki5YqAR.js +5679 -0
  104. package/dist/vendor-nevware21-ts-async-CLMApQ9E.js +395 -0
  105. package/dist/vendor-nevware21-ts-utils-e8v8Jty3.js +1160 -0
  106. package/dist/vendor-normalize-css.css +1 -0
  107. package/dist/vendor-nth-check-Bx8TxtJt.js +157 -0
  108. package/dist/vendor-orderedmap-dGG6uMFJ.js +137 -0
  109. package/dist/vendor-parse5-Bt2NhSzR.js +8432 -0
  110. package/dist/vendor-parse5-htmlparser2-tree-adapter-BUUtKzf8.js +216 -0
  111. package/dist/vendor-popperjs-core-Cr2byIky.js +1790 -0
  112. package/dist/vendor-prettier-B4PaeWRQ.js +98 -0
  113. package/dist/vendor-prosemirror-commands-BH9lWGpW.js +561 -0
  114. package/dist/vendor-prosemirror-dropcursor-CeyPcxrA.js +146 -0
  115. package/dist/vendor-prosemirror-gapcursor-U8UoUJII.js +236 -0
  116. package/dist/vendor-prosemirror-history-BDaJkvNx.js +414 -0
  117. package/dist/vendor-prosemirror-keymap-BbWvIWmH.js +128 -0
  118. package/dist/vendor-prosemirror-markdown-gB0PXBbz.js +866 -0
  119. package/dist/vendor-prosemirror-model-BZu3WVcD.js +3463 -0
  120. package/dist/vendor-prosemirror-schema-list-Bl9NpKA7.js +158 -0
  121. package/dist/vendor-prosemirror-state-BvL9Pxph.js +1003 -0
  122. package/dist/vendor-prosemirror-tables-17qAnviK.js +2159 -0
  123. package/dist/vendor-prosemirror-transform-CE9VV3qg.js +2156 -0
  124. package/dist/vendor-prosemirror-view-CU2WTHT7.js +5811 -0
  125. package/dist/vendor-punycode-js-iAs5RxMf.js +441 -0
  126. package/dist/vendor-rope-sequence-BdXDKoGt.js +207 -0
  127. package/dist/vendor-semver-CVLMK-S4.js +2702 -0
  128. package/dist/vendor-ssr-window-s6OpKa3O.js +150 -0
  129. package/dist/vendor-swiper-CdiyNHVt.js +5679 -0
  130. package/dist/vendor-swiper.css +1 -0
  131. package/dist/vendor-tanstack-virtual-core-l0sNRNKZ.js +1 -0
  132. package/dist/vendor-tanstack-vue-virtual-l0sNRNKZ.js +1 -0
  133. package/dist/vendor-tippy-js-DWFe2TfK.js +1647 -0
  134. package/dist/vendor-tiptap-core-NfwGfaQk.js +4910 -0
  135. package/dist/vendor-tiptap-extension-blockquote-jmWBTtsI.js +57 -0
  136. package/dist/vendor-tiptap-extension-bold-p5frh4ak.js +97 -0
  137. package/dist/vendor-tiptap-extension-bubble-menu-KUhZSfrs.js +218 -0
  138. package/dist/vendor-tiptap-extension-bullet-list-COmZRoSB.js +73 -0
  139. package/dist/vendor-tiptap-extension-code-block-DyTARZss.js +221 -0
  140. package/dist/vendor-tiptap-extension-code-jVv6CXpX.js +75 -0
  141. package/dist/vendor-tiptap-extension-document-DssuotYs.js +13 -0
  142. package/dist/vendor-tiptap-extension-dropcursor-BoO0Qv91.js +26 -0
  143. package/dist/vendor-tiptap-extension-floating-menu-CrO8CN5w.js +165 -0
  144. package/dist/vendor-tiptap-extension-gapcursor-KpsWEoMD.js +30 -0
  145. package/dist/vendor-tiptap-extension-hard-break-ldOzhSvf.js +68 -0
  146. package/dist/vendor-tiptap-extension-heading-CKz2llX0.js +77 -0
  147. package/dist/vendor-tiptap-extension-history-DeKZ2VQ9.js +48 -0
  148. package/dist/vendor-tiptap-extension-horizontal-rule-CAjWRyDS.js +92 -0
  149. package/dist/vendor-tiptap-extension-image-ZagcEYuk.js +76 -0
  150. package/dist/vendor-tiptap-extension-italic-CM4xdznY.js +96 -0
  151. package/dist/vendor-tiptap-extension-link-Z-AMC4Ri.js +414 -0
  152. package/dist/vendor-tiptap-extension-list-item-BJi5QpXc.js +37 -0
  153. package/dist/vendor-tiptap-extension-ordered-list-C_TMrfBE.js +97 -0
  154. package/dist/vendor-tiptap-extension-paragraph-CQw0E0Au.js +39 -0
  155. package/dist/vendor-tiptap-extension-placeholder-BBNVKfa_.js +66 -0
  156. package/dist/vendor-tiptap-extension-strike-DUyMYX1Z.js +79 -0
  157. package/dist/vendor-tiptap-extension-table-cell-CoDIMPA5.js +47 -0
  158. package/dist/vendor-tiptap-extension-table-header-DvbGHnmw.js +47 -0
  159. package/dist/vendor-tiptap-extension-table-row-D1uqN5Aj.js +26 -0
  160. package/dist/vendor-tiptap-extension-table-tKS4MOM4.js +354 -0
  161. package/dist/vendor-tiptap-extension-text-DtRBhKB2.js +12 -0
  162. package/dist/vendor-tiptap-extension-underline-DqaSFp_P.js +50 -0
  163. package/dist/vendor-tiptap-markdown-7-PCADTU.js +1017 -0
  164. package/dist/vendor-tiptap-pm-l0sNRNKZ.js +1 -0
  165. package/dist/vendor-tiptap-starter-kit-CDSV_Zuu.js +88 -0
  166. package/dist/vendor-tiptap-vue-3-DZg2fjq_.js +268 -0
  167. package/dist/vendor-truncate-html-3qQY0Djo.js +196 -0
  168. package/dist/vendor-uc-micro-jjt6LQ65.js +23 -0
  169. package/dist/vendor-vee-validate-i18n-v_gHjRmD.js +154 -0
  170. package/dist/vendor-vee-validate-rules-DzV3VY3N.js +536 -0
  171. package/dist/vendor-vue-currency-input-DGAkEFBO.js +545 -0
  172. package/dist/vendor-vue-demi-l0sNRNKZ.js +1 -0
  173. package/dist/vendor-vue-devtools-api-DXYR8qBG.js +169 -0
  174. package/dist/vendor-vue-i18n-Co752uk3.js +1897 -0
  175. package/dist/vendor-vue3-application-insights-CYWFCr_J.js +119 -0
  176. package/dist/vendor-vue3-touch-events-BJEAiSa3.js +416 -0
  177. package/dist/vendor-vuepic-vue-datepicker-BSWXRSiu.js +5019 -0
  178. package/dist/vendor-vuepic-vue-datepicker.css +1 -0
  179. package/dist/vendor-vueuse-components-l1bL12mE.js +339 -0
  180. package/dist/vendor-vueuse-core-DGcJOmwG.js +7743 -0
  181. package/dist/vendor-vueuse-shared-_mOXsFuM.js +1568 -0
  182. package/dist/vendor-w3c-keyname-BOm2dtJm.js +121 -0
  183. package/package.json +22 -11
  184. package/shared/components/blade-navigation/components/vc-blade-navigation/_internal/vc-mobile-back-button.vue +3 -3
  185. package/shared/components/blade-navigation/components/vc-blade-view/vc-blade-view.ts +2 -1
  186. package/shared/components/blade-navigation/composables/useBladeNavigation/internal/bladeRouteResolver.ts +1 -0
  187. package/shared/components/change-password-button/change-password-button.vue +1 -2
  188. package/shared/components/logout-button/logout-button.vue +1 -2
  189. package/shared/components/notifications/components/notification-container/index.ts +1 -1
  190. package/shared/components/notifications/core/notification.ts +1 -1
  191. package/shared/components/settings-menu-item/settings-menu-item.vue +1 -0
  192. package/shared/components/sidebar/sidebar.vue +2 -2
  193. package/shared/modules/dynamic/pages/dynamic-blade-list.vue +2 -1
  194. package/ui/components/atoms/vc-hint/vc-hint.vue +2 -0
  195. package/ui/components/atoms/vc-icon/composables/use-icon.ts +1 -1
  196. package/ui/components/atoms/vc-icon/icons/MenuBurgerIcon.vue +18 -14
  197. package/ui/components/atoms/vc-icon/icons/index.ts +1 -27
  198. package/ui/components/atoms/vc-icon/vc-bootstrap-icon.vue +7 -11
  199. package/ui/components/atoms/vc-icon/vc-fontawesome-icon.vue +37 -31
  200. package/ui/components/atoms/vc-icon/vc-icon-examples.vue +1 -1
  201. package/ui/components/atoms/vc-icon/vc-icon.stories.ts +4 -5
  202. package/ui/components/atoms/vc-icon/vc-icon.vue +33 -163
  203. package/ui/components/atoms/vc-icon/vc-lucide-icon.vue +22 -70
  204. package/ui/components/atoms/vc-icon/vc-material-icon.vue +28 -59
  205. package/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.vue +2 -3
  206. package/ui/components/molecules/vc-editor/_internal/vc-editor-button.vue +103 -0
  207. package/ui/components/molecules/vc-editor/_internal/vc-editor-toolbar.vue +252 -0
  208. package/ui/components/molecules/vc-editor/vc-editor.stories.ts +1 -4
  209. package/ui/components/molecules/vc-editor/vc-editor.vue +666 -360
  210. package/ui/components/molecules/vc-form/vc-form.vue +7 -5
  211. package/ui/components/molecules/vc-input/vc-input.vue +1 -1
  212. package/ui/components/molecules/vc-pagination/vc-pagination.vue +4 -17
  213. package/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarMobileActions.vue +1 -1
  214. package/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/MenuSidebar.vue +1 -3
  215. package/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue +1 -4
  216. package/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/_internal/vc-app-menu-link.vue +1 -3
  217. package/ui/components/organisms/vc-app/vc-app.backupsb.ts +214 -214
  218. package/ui/components/organisms/vc-app/vc-app.vue +3 -5
  219. package/ui/components/organisms/vc-blade/_internal/vc-blade-header/vc-blade-header.vue +3 -10
  220. package/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/mobile/vc-blade-toolbar-mobile.vue +1 -1
  221. package/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-desktop.vue +2 -2
  222. package/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-mobile.vue +2 -2
  223. package/ui/components/organisms/vc-blade/vc-blade.vue +4 -5
  224. package/ui/components/organisms/vc-table/_internal/vc-table-filter/vc-table-filter.vue +1 -3
  225. package/ui/components/organisms/vc-table/_internal/vc-table-header/vc-table-header.vue +1 -2
  226. package/ui/components/organisms/vc-table/composables/useTableState.ts +5 -5
  227. package/dist/apl-B2DGVGxc.js +0 -76
  228. package/dist/asciiarmor-2LVJmxlE.js +0 -34
  229. package/dist/asn1-jKiBa2Ya.js +0 -95
  230. package/dist/asterisk-DS281yxp.js +0 -271
  231. package/dist/brainfuck-C_p9pTT8.js +0 -34
  232. package/dist/clike-DGTaUp48.js +0 -620
  233. package/dist/clojure-CCKyeQKf.js +0 -800
  234. package/dist/cmake-CuaCgAKt.js +0 -28
  235. package/dist/cobol-BlTKFDRj.js +0 -72
  236. package/dist/coffeescript-BVCvwO8I.js +0 -179
  237. package/dist/commonlisp-D_kxz07b.js +0 -75
  238. package/dist/crystal-D309uH6_.js +0 -217
  239. package/dist/css-BkF-NPzE.js +0 -1553
  240. package/dist/cypher-BMq4Fwjl.js +0 -68
  241. package/dist/d-BZcgY6La.js +0 -127
  242. package/dist/diff-Cg9d_RX2.js +0 -18
  243. package/dist/dockerfile-DIy8NleC.js +0 -194
  244. package/dist/dtd-CtLokQ-U.js +0 -84
  245. package/dist/dylan-QYeExnWK.js +0 -234
  246. package/dist/ebnf-DUPDuY4r.js +0 -78
  247. package/dist/ecl-CiXN-g_D.js +0 -121
  248. package/dist/eiffel-yQhjl4T1.js +0 -110
  249. package/dist/elm-CNT9vbN0.js +0 -108
  250. package/dist/erlang-CFOYdy9e.js +0 -487
  251. package/dist/factor-DDOC7X6P.js +0 -65
  252. package/dist/fcl-CPC2WYrI.js +0 -103
  253. package/dist/forth-BmxRyE9S.js +0 -60
  254. package/dist/fortran-9bvPyrOW.js +0 -442
  255. package/dist/gas-cpmYfFX2.js +0 -183
  256. package/dist/gherkin-CJuwpceU.js +0 -34
  257. package/dist/groovy-DZeT_VM-.js +0 -146
  258. package/dist/haskell-Bvt3Qq1t.js +0 -375
  259. package/dist/haxe-70NVW1pR.js +0 -359
  260. package/dist/http-D9LttvKF.js +0 -44
  261. package/dist/idl-B6TRFYjl.js +0 -947
  262. package/dist/index-4DWvmoYg.js +0 -71
  263. package/dist/index-52o7mJaX.js +0 -156
  264. package/dist/index-B0KatioT.js +0 -98
  265. package/dist/index-BP3W8zuk.js +0 -268
  266. package/dist/index-BykT5L1A.js +0 -148134
  267. package/dist/index-CfXo9hsG.js +0 -75
  268. package/dist/index-Ch37pBUt.js +0 -308
  269. package/dist/index-D2KGkAYT.js +0 -93
  270. package/dist/index-D83zQom_.js +0 -58
  271. package/dist/index-DuQrVLbu.js +0 -134
  272. package/dist/index-_fdMid5h.js +0 -288
  273. package/dist/index-a1wO-owY.js +0 -545
  274. package/dist/index-crMpNSFe.js +0 -611
  275. package/dist/index-dmBRpHHY.js +0 -137
  276. package/dist/index-kBdB14Fz.js +0 -341
  277. package/dist/index-uBhy41le.js +0 -249
  278. package/dist/index-zZrijNsr.js +0 -299
  279. package/dist/javascript-C2yteZeJ.js +0 -691
  280. package/dist/jinja2-DnB6dQmV.js +0 -154
  281. package/dist/julia-DpvXAuO6.js +0 -241
  282. package/dist/livescript-CanGTf8u.js +0 -272
  283. package/dist/lua-XplVlWi_.js +0 -217
  284. package/dist/mathematica-jaRHnSxC.js +0 -35
  285. package/dist/mbox-BctzC1hL.js +0 -76
  286. package/dist/mirc-CFBPAOaF.js +0 -72
  287. package/dist/mllike-BSnXJBGA.js +0 -272
  288. package/dist/modelica-vUgVs--1.js +0 -93
  289. package/dist/mscgen-Cpl0NYLN.js +0 -104
  290. package/dist/mumps-CQoS1kWX.js +0 -25
  291. package/dist/nginx-zDPm3Z74.js +0 -89
  292. package/dist/nsis-fePjrhq7.js +0 -62
  293. package/dist/ntriples-CsNjv2QF.js +0 -79
  294. package/dist/octave-C8PmmSRH.js +0 -143
  295. package/dist/oz-Ce8aN8oE.js +0 -151
  296. package/dist/pascal-De0D6mP7.js +0 -77
  297. package/dist/perl-B4bSCe1C.js +0 -915
  298. package/dist/pig-D24Z8EXi.js +0 -54
  299. package/dist/powershell-DkYVfTzP.js +0 -249
  300. package/dist/properties-Dn9wna3M.js +0 -26
  301. package/dist/protobuf-BPIjwpzm.js +0 -49
  302. package/dist/pug-CwAQJzGR.js +0 -248
  303. package/dist/puppet-nyd4dhjf.js +0 -45
  304. package/dist/python-BkR3uSy8.js +0 -313
  305. package/dist/q-DXjKs-tC.js +0 -83
  306. package/dist/r-LKEuhEGI.js +0 -104
  307. package/dist/rpm-IznJm2Xc.js +0 -57
  308. package/dist/ruby-CcYfvIk6.js +0 -228
  309. package/dist/sas-7E8yHoCW.js +0 -105
  310. package/dist/scheme-DjibxsNh.js +0 -124
  311. package/dist/shared/modules/dynamic/components/fields/storybook/common/args.d.ts +0 -113
  312. package/dist/shared/modules/dynamic/components/fields/storybook/common/args.d.ts.map +0 -1
  313. package/dist/shared/modules/dynamic/components/fields/storybook/common/templates.d.ts +0 -3
  314. package/dist/shared/modules/dynamic/components/fields/storybook/common/templates.d.ts.map +0 -1
  315. package/dist/shared/modules/dynamic/components/fields/storybook/pages/DynamicRender.d.ts +0 -102
  316. package/dist/shared/modules/dynamic/components/fields/storybook/pages/DynamicRender.d.ts.map +0 -1
  317. package/dist/shared/modules/dynamic/components/fields/storybook/utils/sourceHighlighter.d.ts +0 -4
  318. package/dist/shared/modules/dynamic/components/fields/storybook/utils/sourceHighlighter.d.ts.map +0 -1
  319. package/dist/shared/modules/dynamic/components/fields/storybook/utils/sourceTransform.d.ts +0 -3
  320. package/dist/shared/modules/dynamic/components/fields/storybook/utils/sourceTransform.d.ts.map +0 -1
  321. package/dist/shell-C0C2sNA_.js +0 -182
  322. package/dist/sieve-Bwz7vjP5.js +0 -72
  323. package/dist/simple-mode-B0dvCdAA.js +0 -89
  324. package/dist/smalltalk-Bhddl2pB.js +0 -48
  325. package/dist/solr-BNlsLglM.js +0 -41
  326. package/dist/sparql-FarWu_Gb.js +0 -197
  327. package/dist/spreadsheet-C-cy4P5N.js +0 -49
  328. package/dist/sql-CfG5lQ3l.js +0 -282
  329. package/dist/stex-Du4h4KAU.js +0 -129
  330. package/dist/stylus-CAdqWld3.js +0 -250
  331. package/dist/swift-DSxqR9R6.js +0 -230
  332. package/dist/tcl-xfoLljhY.js +0 -81
  333. package/dist/textile-D1AWE-pc.js +0 -295
  334. package/dist/tiddlywiki-5wqsXtSk.js +0 -155
  335. package/dist/tiki-__Kn3CeS.js +0 -181
  336. package/dist/toml-BHiuTcfn.js +0 -49
  337. package/dist/troff-D2UO-fKf.js +0 -35
  338. package/dist/ttcn-Bsa4sfRm.js +0 -123
  339. package/dist/ttcn-cfg-Bac_acMi.js +0 -88
  340. package/dist/turtle-xwJUxoPV.js +0 -80
  341. package/dist/ui/components/atoms/vc-icon/icons/AppWindowIcon.vue.d.ts +0 -7
  342. package/dist/ui/components/atoms/vc-icon/icons/AppWindowIcon.vue.d.ts.map +0 -1
  343. package/dist/ui/components/atoms/vc-icon/icons/ArrowLeftIcon.vue.d.ts +0 -7
  344. package/dist/ui/components/atoms/vc-icon/icons/ArrowLeftIcon.vue.d.ts.map +0 -1
  345. package/dist/ui/components/atoms/vc-icon/icons/ArrowRightIcon.vue.d.ts +0 -7
  346. package/dist/ui/components/atoms/vc-icon/icons/ArrowRightIcon.vue.d.ts.map +0 -1
  347. package/dist/ui/components/atoms/vc-icon/icons/BellIcon.vue.d.ts +0 -7
  348. package/dist/ui/components/atoms/vc-icon/icons/BellIcon.vue.d.ts.map +0 -1
  349. package/dist/ui/components/atoms/vc-icon/icons/ChevronDownIcon.vue.d.ts +0 -7
  350. package/dist/ui/components/atoms/vc-icon/icons/ChevronDownIcon.vue.d.ts.map +0 -1
  351. package/dist/ui/components/atoms/vc-icon/icons/ChevronLeftIcon.vue.d.ts +0 -7
  352. package/dist/ui/components/atoms/vc-icon/icons/ChevronLeftIcon.vue.d.ts.map +0 -1
  353. package/dist/ui/components/atoms/vc-icon/icons/ChevronRightIcon.vue.d.ts +0 -7
  354. package/dist/ui/components/atoms/vc-icon/icons/ChevronRightIcon.vue.d.ts.map +0 -1
  355. package/dist/ui/components/atoms/vc-icon/icons/ChevronUpIcon.vue.d.ts +0 -7
  356. package/dist/ui/components/atoms/vc-icon/icons/ChevronUpIcon.vue.d.ts.map +0 -1
  357. package/dist/ui/components/atoms/vc-icon/icons/CircleDotsIcon.vue.d.ts +0 -7
  358. package/dist/ui/components/atoms/vc-icon/icons/CircleDotsIcon.vue.d.ts.map +0 -1
  359. package/dist/ui/components/atoms/vc-icon/icons/CrossSignIcon.vue.d.ts +0 -7
  360. package/dist/ui/components/atoms/vc-icon/icons/CrossSignIcon.vue.d.ts.map +0 -1
  361. package/dist/ui/components/atoms/vc-icon/icons/DoubleArrowLeftIcon.vue.d.ts +0 -7
  362. package/dist/ui/components/atoms/vc-icon/icons/DoubleArrowLeftIcon.vue.d.ts.map +0 -1
  363. package/dist/ui/components/atoms/vc-icon/icons/DoubleArrowRightIcon.vue.d.ts +0 -7
  364. package/dist/ui/components/atoms/vc-icon/icons/DoubleArrowRightIcon.vue.d.ts.map +0 -1
  365. package/dist/ui/components/atoms/vc-icon/icons/FulfillmentCentersIcon.vue.d.ts +0 -7
  366. package/dist/ui/components/atoms/vc-icon/icons/FulfillmentCentersIcon.vue.d.ts.map +0 -1
  367. package/dist/ui/components/atoms/vc-icon/icons/GridDotsIcon.vue.d.ts +0 -7
  368. package/dist/ui/components/atoms/vc-icon/icons/GridDotsIcon.vue.d.ts.map +0 -1
  369. package/dist/ui/components/atoms/vc-icon/icons/LogoutIcon.vue.d.ts +0 -7
  370. package/dist/ui/components/atoms/vc-icon/icons/LogoutIcon.vue.d.ts.map +0 -1
  371. package/dist/ui/components/atoms/vc-icon/icons/MinusSignIcon.vue.d.ts +0 -7
  372. package/dist/ui/components/atoms/vc-icon/icons/MinusSignIcon.vue.d.ts.map +0 -1
  373. package/dist/ui/components/atoms/vc-icon/icons/OffersIcon.vue.d.ts +0 -7
  374. package/dist/ui/components/atoms/vc-icon/icons/OffersIcon.vue.d.ts.map +0 -1
  375. package/dist/ui/components/atoms/vc-icon/icons/OrdersIcon.vue.d.ts +0 -7
  376. package/dist/ui/components/atoms/vc-icon/icons/OrdersIcon.vue.d.ts.map +0 -1
  377. package/dist/ui/components/atoms/vc-icon/icons/PeopleIcon.vue.d.ts +0 -7
  378. package/dist/ui/components/atoms/vc-icon/icons/PeopleIcon.vue.d.ts.map +0 -1
  379. package/dist/ui/components/atoms/vc-icon/icons/PlusSignIcon.vue.d.ts +0 -7
  380. package/dist/ui/components/atoms/vc-icon/icons/PlusSignIcon.vue.d.ts.map +0 -1
  381. package/dist/ui/components/atoms/vc-icon/icons/ProductsIcon.vue.d.ts +0 -7
  382. package/dist/ui/components/atoms/vc-icon/icons/ProductsIcon.vue.d.ts.map +0 -1
  383. package/dist/ui/components/atoms/vc-icon/icons/ProfileIcon.vue.d.ts +0 -7
  384. package/dist/ui/components/atoms/vc-icon/icons/ProfileIcon.vue.d.ts.map +0 -1
  385. package/dist/ui/components/atoms/vc-icon/icons/SearchIcon.vue.d.ts +0 -7
  386. package/dist/ui/components/atoms/vc-icon/icons/SearchIcon.vue.d.ts.map +0 -1
  387. package/dist/ui/components/atoms/vc-icon/icons/SettingsBoltIcon.vue.d.ts +0 -7
  388. package/dist/ui/components/atoms/vc-icon/icons/SettingsBoltIcon.vue.d.ts.map +0 -1
  389. package/dist/ui/components/atoms/vc-icon/icons/ShoppingCardIcon.vue.d.ts +0 -7
  390. package/dist/ui/components/atoms/vc-icon/icons/ShoppingCardIcon.vue.d.ts.map +0 -1
  391. package/dist/ui/components/atoms/vc-icon/icons/VendorSwitchIcon.vue.d.ts +0 -7
  392. package/dist/ui/components/atoms/vc-icon/icons/VendorSwitchIcon.vue.d.ts.map +0 -1
  393. package/dist/ui/components/atoms/vc-icon/icons/VertDotsIcon.vue.d.ts +0 -7
  394. package/dist/ui/components/atoms/vc-icon/icons/VertDotsIcon.vue.d.ts.map +0 -1
  395. package/dist/vb-c2kQGd6-.js +0 -74
  396. package/dist/vbscript-1f_Dhg5H.js +0 -324
  397. package/dist/velocity-DJd0pTTC.js +0 -96
  398. package/dist/verilog-CiS1jyi5.js +0 -262
  399. package/dist/vhdl-T9HkrbI2.js +0 -106
  400. package/dist/webidl-CjfDENEo.js +0 -155
  401. package/dist/xquery-BUQdORAS.js +0 -422
  402. package/dist/yacas-C0absKBh.js +0 -73
  403. package/dist/z80-Pki2zAjW.js +0 -61
  404. package/shared/modules/dynamic/components/fields/storybook/Button.stories.ts +0 -186
  405. package/shared/modules/dynamic/components/fields/storybook/Card.stories.ts +0 -175
  406. package/shared/modules/dynamic/components/fields/storybook/Checkbox.stories.ts +0 -185
  407. package/shared/modules/dynamic/components/fields/storybook/ContentField.stories.ts +0 -245
  408. package/shared/modules/dynamic/components/fields/storybook/EditorField.stories.ts +0 -192
  409. package/shared/modules/dynamic/components/fields/storybook/Fieldset.stories.ts +0 -347
  410. package/shared/modules/dynamic/components/fields/storybook/GalleryField.stories.ts +0 -239
  411. package/shared/modules/dynamic/components/fields/storybook/ImageField.stories.ts +0 -186
  412. package/shared/modules/dynamic/components/fields/storybook/InputCurrency.stories.ts +0 -281
  413. package/shared/modules/dynamic/components/fields/storybook/InputField.stories.ts +0 -312
  414. package/shared/modules/dynamic/components/fields/storybook/MultivalueField.stories.ts +0 -361
  415. package/shared/modules/dynamic/components/fields/storybook/RadioButtonGroup.stories.ts +0 -224
  416. package/shared/modules/dynamic/components/fields/storybook/RatingField.stories.ts +0 -131
  417. package/shared/modules/dynamic/components/fields/storybook/SelectField.stories.ts +0 -666
  418. package/shared/modules/dynamic/components/fields/storybook/StatusField.stories.ts +0 -202
  419. package/shared/modules/dynamic/components/fields/storybook/SwitchField.stories.ts +0 -178
  420. package/shared/modules/dynamic/components/fields/storybook/TextareaField.stories.ts +0 -203
  421. package/shared/modules/dynamic/components/fields/storybook/VideoField.stories.ts +0 -92
  422. package/shared/modules/dynamic/components/fields/storybook/common/args.ts +0 -130
  423. package/shared/modules/dynamic/components/fields/storybook/common/templates.ts +0 -8
  424. package/shared/modules/dynamic/components/fields/storybook/pages/DynamicRender.ts +0 -54
  425. package/shared/modules/dynamic/components/fields/storybook/utils/sourceHighlighter.ts +0 -16
  426. package/shared/modules/dynamic/components/fields/storybook/utils/sourceTransform.ts +0 -41
  427. package/ui/components/atoms/vc-icon/icons/AppWindowIcon.vue +0 -15
  428. package/ui/components/atoms/vc-icon/icons/ArrowLeftIcon.vue +0 -20
  429. package/ui/components/atoms/vc-icon/icons/ArrowRightIcon.vue +0 -13
  430. package/ui/components/atoms/vc-icon/icons/BellIcon.vue +0 -14
  431. package/ui/components/atoms/vc-icon/icons/ChevronDownIcon.vue +0 -13
  432. package/ui/components/atoms/vc-icon/icons/ChevronLeftIcon.vue +0 -13
  433. package/ui/components/atoms/vc-icon/icons/ChevronRightIcon.vue +0 -13
  434. package/ui/components/atoms/vc-icon/icons/ChevronUpIcon.vue +0 -13
  435. package/ui/components/atoms/vc-icon/icons/CircleDotsIcon.vue +0 -16
  436. package/ui/components/atoms/vc-icon/icons/CrossSignIcon.vue +0 -20
  437. package/ui/components/atoms/vc-icon/icons/DoubleArrowLeftIcon.vue +0 -14
  438. package/ui/components/atoms/vc-icon/icons/DoubleArrowRightIcon.vue +0 -14
  439. package/ui/components/atoms/vc-icon/icons/FulfillmentCentersIcon.vue +0 -27
  440. package/ui/components/atoms/vc-icon/icons/GridDotsIcon.vue +0 -22
  441. package/ui/components/atoms/vc-icon/icons/LogoutIcon.vue +0 -13
  442. package/ui/components/atoms/vc-icon/icons/MinusSignIcon.vue +0 -14
  443. package/ui/components/atoms/vc-icon/icons/OffersIcon.vue +0 -23
  444. package/ui/components/atoms/vc-icon/icons/OrdersIcon.vue +0 -19
  445. package/ui/components/atoms/vc-icon/icons/PeopleIcon.vue +0 -21
  446. package/ui/components/atoms/vc-icon/icons/PlusSignIcon.vue +0 -20
  447. package/ui/components/atoms/vc-icon/icons/ProductsIcon.vue +0 -23
  448. package/ui/components/atoms/vc-icon/icons/ProfileIcon.vue +0 -18
  449. package/ui/components/atoms/vc-icon/icons/SearchIcon.vue +0 -14
  450. package/ui/components/atoms/vc-icon/icons/SettingsBoltIcon.vue +0 -21
  451. package/ui/components/atoms/vc-icon/icons/ShoppingCardIcon.vue +0 -16
  452. package/ui/components/atoms/vc-icon/icons/VendorSwitchIcon.vue +0 -26
  453. package/ui/components/atoms/vc-icon/icons/VertDotsIcon.vue +0 -19
@@ -0,0 +1,1003 @@
1
+ import { S as Slice, F as Fragment, b as Node, M as Mark } from './vendor-prosemirror-model-BZu3WVcD.js';
2
+ import { R as ReplaceStep, b as ReplaceAroundStep, T as Transform } from './vendor-prosemirror-transform-CE9VV3qg.js';
3
+
4
+ const classesById = Object.create(null);
5
+ /**
6
+ Superclass for editor selections. Every selection type should
7
+ extend this. Should not be instantiated directly.
8
+ */
9
+ class Selection {
10
+ /**
11
+ Initialize a selection with the head and anchor and ranges. If no
12
+ ranges are given, constructs a single range across `$anchor` and
13
+ `$head`.
14
+ */
15
+ constructor(
16
+ /**
17
+ The resolved anchor of the selection (the side that stays in
18
+ place when the selection is modified).
19
+ */
20
+ $anchor,
21
+ /**
22
+ The resolved head of the selection (the side that moves when
23
+ the selection is modified).
24
+ */
25
+ $head, ranges) {
26
+ this.$anchor = $anchor;
27
+ this.$head = $head;
28
+ this.ranges = ranges || [new SelectionRange($anchor.min($head), $anchor.max($head))];
29
+ }
30
+ /**
31
+ The selection's anchor, as an unresolved position.
32
+ */
33
+ get anchor() { return this.$anchor.pos; }
34
+ /**
35
+ The selection's head.
36
+ */
37
+ get head() { return this.$head.pos; }
38
+ /**
39
+ The lower bound of the selection's main range.
40
+ */
41
+ get from() { return this.$from.pos; }
42
+ /**
43
+ The upper bound of the selection's main range.
44
+ */
45
+ get to() { return this.$to.pos; }
46
+ /**
47
+ The resolved lower bound of the selection's main range.
48
+ */
49
+ get $from() {
50
+ return this.ranges[0].$from;
51
+ }
52
+ /**
53
+ The resolved upper bound of the selection's main range.
54
+ */
55
+ get $to() {
56
+ return this.ranges[0].$to;
57
+ }
58
+ /**
59
+ Indicates whether the selection contains any content.
60
+ */
61
+ get empty() {
62
+ let ranges = this.ranges;
63
+ for (let i = 0; i < ranges.length; i++)
64
+ if (ranges[i].$from.pos != ranges[i].$to.pos)
65
+ return false;
66
+ return true;
67
+ }
68
+ /**
69
+ Get the content of this selection as a slice.
70
+ */
71
+ content() {
72
+ return this.$from.doc.slice(this.from, this.to, true);
73
+ }
74
+ /**
75
+ Replace the selection with a slice or, if no slice is given,
76
+ delete the selection. Will append to the given transaction.
77
+ */
78
+ replace(tr, content = Slice.empty) {
79
+ // Put the new selection at the position after the inserted
80
+ // content. When that ended in an inline node, search backwards,
81
+ // to get the position after that node. If not, search forward.
82
+ let lastNode = content.content.lastChild, lastParent = null;
83
+ for (let i = 0; i < content.openEnd; i++) {
84
+ lastParent = lastNode;
85
+ lastNode = lastNode.lastChild;
86
+ }
87
+ let mapFrom = tr.steps.length, ranges = this.ranges;
88
+ for (let i = 0; i < ranges.length; i++) {
89
+ let { $from, $to } = ranges[i], mapping = tr.mapping.slice(mapFrom);
90
+ tr.replaceRange(mapping.map($from.pos), mapping.map($to.pos), i ? Slice.empty : content);
91
+ if (i == 0)
92
+ selectionToInsertionEnd(tr, mapFrom, (lastNode ? lastNode.isInline : lastParent && lastParent.isTextblock) ? -1 : 1);
93
+ }
94
+ }
95
+ /**
96
+ Replace the selection with the given node, appending the changes
97
+ to the given transaction.
98
+ */
99
+ replaceWith(tr, node) {
100
+ let mapFrom = tr.steps.length, ranges = this.ranges;
101
+ for (let i = 0; i < ranges.length; i++) {
102
+ let { $from, $to } = ranges[i], mapping = tr.mapping.slice(mapFrom);
103
+ let from = mapping.map($from.pos), to = mapping.map($to.pos);
104
+ if (i) {
105
+ tr.deleteRange(from, to);
106
+ }
107
+ else {
108
+ tr.replaceRangeWith(from, to, node);
109
+ selectionToInsertionEnd(tr, mapFrom, node.isInline ? -1 : 1);
110
+ }
111
+ }
112
+ }
113
+ /**
114
+ Find a valid cursor or leaf node selection starting at the given
115
+ position and searching back if `dir` is negative, and forward if
116
+ positive. When `textOnly` is true, only consider cursor
117
+ selections. Will return null when no valid selection position is
118
+ found.
119
+ */
120
+ static findFrom($pos, dir, textOnly = false) {
121
+ let inner = $pos.parent.inlineContent ? new TextSelection($pos)
122
+ : findSelectionIn($pos.node(0), $pos.parent, $pos.pos, $pos.index(), dir, textOnly);
123
+ if (inner)
124
+ return inner;
125
+ for (let depth = $pos.depth - 1; depth >= 0; depth--) {
126
+ let found = dir < 0
127
+ ? findSelectionIn($pos.node(0), $pos.node(depth), $pos.before(depth + 1), $pos.index(depth), dir, textOnly)
128
+ : findSelectionIn($pos.node(0), $pos.node(depth), $pos.after(depth + 1), $pos.index(depth) + 1, dir, textOnly);
129
+ if (found)
130
+ return found;
131
+ }
132
+ return null;
133
+ }
134
+ /**
135
+ Find a valid cursor or leaf node selection near the given
136
+ position. Searches forward first by default, but if `bias` is
137
+ negative, it will search backwards first.
138
+ */
139
+ static near($pos, bias = 1) {
140
+ return this.findFrom($pos, bias) || this.findFrom($pos, -bias) || new AllSelection($pos.node(0));
141
+ }
142
+ /**
143
+ Find the cursor or leaf node selection closest to the start of
144
+ the given document. Will return an
145
+ [`AllSelection`](https://prosemirror.net/docs/ref/#state.AllSelection) if no valid position
146
+ exists.
147
+ */
148
+ static atStart(doc) {
149
+ return findSelectionIn(doc, doc, 0, 0, 1) || new AllSelection(doc);
150
+ }
151
+ /**
152
+ Find the cursor or leaf node selection closest to the end of the
153
+ given document.
154
+ */
155
+ static atEnd(doc) {
156
+ return findSelectionIn(doc, doc, doc.content.size, doc.childCount, -1) || new AllSelection(doc);
157
+ }
158
+ /**
159
+ Deserialize the JSON representation of a selection. Must be
160
+ implemented for custom classes (as a static class method).
161
+ */
162
+ static fromJSON(doc, json) {
163
+ if (!json || !json.type)
164
+ throw new RangeError("Invalid input for Selection.fromJSON");
165
+ let cls = classesById[json.type];
166
+ if (!cls)
167
+ throw new RangeError(`No selection type ${json.type} defined`);
168
+ return cls.fromJSON(doc, json);
169
+ }
170
+ /**
171
+ To be able to deserialize selections from JSON, custom selection
172
+ classes must register themselves with an ID string, so that they
173
+ can be disambiguated. Try to pick something that's unlikely to
174
+ clash with classes from other modules.
175
+ */
176
+ static jsonID(id, selectionClass) {
177
+ if (id in classesById)
178
+ throw new RangeError("Duplicate use of selection JSON ID " + id);
179
+ classesById[id] = selectionClass;
180
+ selectionClass.prototype.jsonID = id;
181
+ return selectionClass;
182
+ }
183
+ /**
184
+ Get a [bookmark](https://prosemirror.net/docs/ref/#state.SelectionBookmark) for this selection,
185
+ which is a value that can be mapped without having access to a
186
+ current document, and later resolved to a real selection for a
187
+ given document again. (This is used mostly by the history to
188
+ track and restore old selections.) The default implementation of
189
+ this method just converts the selection to a text selection and
190
+ returns the bookmark for that.
191
+ */
192
+ getBookmark() {
193
+ return TextSelection.between(this.$anchor, this.$head).getBookmark();
194
+ }
195
+ }
196
+ Selection.prototype.visible = true;
197
+ /**
198
+ Represents a selected range in a document.
199
+ */
200
+ class SelectionRange {
201
+ /**
202
+ Create a range.
203
+ */
204
+ constructor(
205
+ /**
206
+ The lower bound of the range.
207
+ */
208
+ $from,
209
+ /**
210
+ The upper bound of the range.
211
+ */
212
+ $to) {
213
+ this.$from = $from;
214
+ this.$to = $to;
215
+ }
216
+ }
217
+ let warnedAboutTextSelection = false;
218
+ function checkTextSelection($pos) {
219
+ if (!warnedAboutTextSelection && !$pos.parent.inlineContent) {
220
+ warnedAboutTextSelection = true;
221
+ console["warn"]("TextSelection endpoint not pointing into a node with inline content (" + $pos.parent.type.name + ")");
222
+ }
223
+ }
224
+ /**
225
+ A text selection represents a classical editor selection, with a
226
+ head (the moving side) and anchor (immobile side), both of which
227
+ point into textblock nodes. It can be empty (a regular cursor
228
+ position).
229
+ */
230
+ class TextSelection extends Selection {
231
+ /**
232
+ Construct a text selection between the given points.
233
+ */
234
+ constructor($anchor, $head = $anchor) {
235
+ checkTextSelection($anchor);
236
+ checkTextSelection($head);
237
+ super($anchor, $head);
238
+ }
239
+ /**
240
+ Returns a resolved position if this is a cursor selection (an
241
+ empty text selection), and null otherwise.
242
+ */
243
+ get $cursor() { return this.$anchor.pos == this.$head.pos ? this.$head : null; }
244
+ map(doc, mapping) {
245
+ let $head = doc.resolve(mapping.map(this.head));
246
+ if (!$head.parent.inlineContent)
247
+ return Selection.near($head);
248
+ let $anchor = doc.resolve(mapping.map(this.anchor));
249
+ return new TextSelection($anchor.parent.inlineContent ? $anchor : $head, $head);
250
+ }
251
+ replace(tr, content = Slice.empty) {
252
+ super.replace(tr, content);
253
+ if (content == Slice.empty) {
254
+ let marks = this.$from.marksAcross(this.$to);
255
+ if (marks)
256
+ tr.ensureMarks(marks);
257
+ }
258
+ }
259
+ eq(other) {
260
+ return other instanceof TextSelection && other.anchor == this.anchor && other.head == this.head;
261
+ }
262
+ getBookmark() {
263
+ return new TextBookmark(this.anchor, this.head);
264
+ }
265
+ toJSON() {
266
+ return { type: "text", anchor: this.anchor, head: this.head };
267
+ }
268
+ /**
269
+ @internal
270
+ */
271
+ static fromJSON(doc, json) {
272
+ if (typeof json.anchor != "number" || typeof json.head != "number")
273
+ throw new RangeError("Invalid input for TextSelection.fromJSON");
274
+ return new TextSelection(doc.resolve(json.anchor), doc.resolve(json.head));
275
+ }
276
+ /**
277
+ Create a text selection from non-resolved positions.
278
+ */
279
+ static create(doc, anchor, head = anchor) {
280
+ let $anchor = doc.resolve(anchor);
281
+ return new this($anchor, head == anchor ? $anchor : doc.resolve(head));
282
+ }
283
+ /**
284
+ Return a text selection that spans the given positions or, if
285
+ they aren't text positions, find a text selection near them.
286
+ `bias` determines whether the method searches forward (default)
287
+ or backwards (negative number) first. Will fall back to calling
288
+ [`Selection.near`](https://prosemirror.net/docs/ref/#state.Selection^near) when the document
289
+ doesn't contain a valid text position.
290
+ */
291
+ static between($anchor, $head, bias) {
292
+ let dPos = $anchor.pos - $head.pos;
293
+ if (!bias || dPos)
294
+ bias = dPos >= 0 ? 1 : -1;
295
+ if (!$head.parent.inlineContent) {
296
+ let found = Selection.findFrom($head, bias, true) || Selection.findFrom($head, -bias, true);
297
+ if (found)
298
+ $head = found.$head;
299
+ else
300
+ return Selection.near($head, bias);
301
+ }
302
+ if (!$anchor.parent.inlineContent) {
303
+ if (dPos == 0) {
304
+ $anchor = $head;
305
+ }
306
+ else {
307
+ $anchor = (Selection.findFrom($anchor, -bias, true) || Selection.findFrom($anchor, bias, true)).$anchor;
308
+ if (($anchor.pos < $head.pos) != (dPos < 0))
309
+ $anchor = $head;
310
+ }
311
+ }
312
+ return new TextSelection($anchor, $head);
313
+ }
314
+ }
315
+ Selection.jsonID("text", TextSelection);
316
+ class TextBookmark {
317
+ constructor(anchor, head) {
318
+ this.anchor = anchor;
319
+ this.head = head;
320
+ }
321
+ map(mapping) {
322
+ return new TextBookmark(mapping.map(this.anchor), mapping.map(this.head));
323
+ }
324
+ resolve(doc) {
325
+ return TextSelection.between(doc.resolve(this.anchor), doc.resolve(this.head));
326
+ }
327
+ }
328
+ /**
329
+ A node selection is a selection that points at a single node. All
330
+ nodes marked [selectable](https://prosemirror.net/docs/ref/#model.NodeSpec.selectable) can be the
331
+ target of a node selection. In such a selection, `from` and `to`
332
+ point directly before and after the selected node, `anchor` equals
333
+ `from`, and `head` equals `to`..
334
+ */
335
+ class NodeSelection extends Selection {
336
+ /**
337
+ Create a node selection. Does not verify the validity of its
338
+ argument.
339
+ */
340
+ constructor($pos) {
341
+ let node = $pos.nodeAfter;
342
+ let $end = $pos.node(0).resolve($pos.pos + node.nodeSize);
343
+ super($pos, $end);
344
+ this.node = node;
345
+ }
346
+ map(doc, mapping) {
347
+ let { deleted, pos } = mapping.mapResult(this.anchor);
348
+ let $pos = doc.resolve(pos);
349
+ if (deleted)
350
+ return Selection.near($pos);
351
+ return new NodeSelection($pos);
352
+ }
353
+ content() {
354
+ return new Slice(Fragment.from(this.node), 0, 0);
355
+ }
356
+ eq(other) {
357
+ return other instanceof NodeSelection && other.anchor == this.anchor;
358
+ }
359
+ toJSON() {
360
+ return { type: "node", anchor: this.anchor };
361
+ }
362
+ getBookmark() { return new NodeBookmark(this.anchor); }
363
+ /**
364
+ @internal
365
+ */
366
+ static fromJSON(doc, json) {
367
+ if (typeof json.anchor != "number")
368
+ throw new RangeError("Invalid input for NodeSelection.fromJSON");
369
+ return new NodeSelection(doc.resolve(json.anchor));
370
+ }
371
+ /**
372
+ Create a node selection from non-resolved positions.
373
+ */
374
+ static create(doc, from) {
375
+ return new NodeSelection(doc.resolve(from));
376
+ }
377
+ /**
378
+ Determines whether the given node may be selected as a node
379
+ selection.
380
+ */
381
+ static isSelectable(node) {
382
+ return !node.isText && node.type.spec.selectable !== false;
383
+ }
384
+ }
385
+ NodeSelection.prototype.visible = false;
386
+ Selection.jsonID("node", NodeSelection);
387
+ class NodeBookmark {
388
+ constructor(anchor) {
389
+ this.anchor = anchor;
390
+ }
391
+ map(mapping) {
392
+ let { deleted, pos } = mapping.mapResult(this.anchor);
393
+ return deleted ? new TextBookmark(pos, pos) : new NodeBookmark(pos);
394
+ }
395
+ resolve(doc) {
396
+ let $pos = doc.resolve(this.anchor), node = $pos.nodeAfter;
397
+ if (node && NodeSelection.isSelectable(node))
398
+ return new NodeSelection($pos);
399
+ return Selection.near($pos);
400
+ }
401
+ }
402
+ /**
403
+ A selection type that represents selecting the whole document
404
+ (which can not necessarily be expressed with a text selection, when
405
+ there are for example leaf block nodes at the start or end of the
406
+ document).
407
+ */
408
+ class AllSelection extends Selection {
409
+ /**
410
+ Create an all-selection over the given document.
411
+ */
412
+ constructor(doc) {
413
+ super(doc.resolve(0), doc.resolve(doc.content.size));
414
+ }
415
+ replace(tr, content = Slice.empty) {
416
+ if (content == Slice.empty) {
417
+ tr.delete(0, tr.doc.content.size);
418
+ let sel = Selection.atStart(tr.doc);
419
+ if (!sel.eq(tr.selection))
420
+ tr.setSelection(sel);
421
+ }
422
+ else {
423
+ super.replace(tr, content);
424
+ }
425
+ }
426
+ toJSON() { return { type: "all" }; }
427
+ /**
428
+ @internal
429
+ */
430
+ static fromJSON(doc) { return new AllSelection(doc); }
431
+ map(doc) { return new AllSelection(doc); }
432
+ eq(other) { return other instanceof AllSelection; }
433
+ getBookmark() { return AllBookmark; }
434
+ }
435
+ Selection.jsonID("all", AllSelection);
436
+ const AllBookmark = {
437
+ map() { return this; },
438
+ resolve(doc) { return new AllSelection(doc); }
439
+ };
440
+ // FIXME we'll need some awareness of text direction when scanning for selections
441
+ // Try to find a selection inside the given node. `pos` points at the
442
+ // position where the search starts. When `text` is true, only return
443
+ // text selections.
444
+ function findSelectionIn(doc, node, pos, index, dir, text = false) {
445
+ if (node.inlineContent)
446
+ return TextSelection.create(doc, pos);
447
+ for (let i = index - (dir > 0 ? 0 : 1); dir > 0 ? i < node.childCount : i >= 0; i += dir) {
448
+ let child = node.child(i);
449
+ if (!child.isAtom) {
450
+ let inner = findSelectionIn(doc, child, pos + dir, dir < 0 ? child.childCount : 0, dir, text);
451
+ if (inner)
452
+ return inner;
453
+ }
454
+ else if (!text && NodeSelection.isSelectable(child)) {
455
+ return NodeSelection.create(doc, pos - (dir < 0 ? child.nodeSize : 0));
456
+ }
457
+ pos += child.nodeSize * dir;
458
+ }
459
+ return null;
460
+ }
461
+ function selectionToInsertionEnd(tr, startLen, bias) {
462
+ let last = tr.steps.length - 1;
463
+ if (last < startLen)
464
+ return;
465
+ let step = tr.steps[last];
466
+ if (!(step instanceof ReplaceStep || step instanceof ReplaceAroundStep))
467
+ return;
468
+ let map = tr.mapping.maps[last], end;
469
+ map.forEach((_from, _to, _newFrom, newTo) => { if (end == null)
470
+ end = newTo; });
471
+ tr.setSelection(Selection.near(tr.doc.resolve(end), bias));
472
+ }
473
+
474
+ const UPDATED_SEL = 1, UPDATED_MARKS = 2, UPDATED_SCROLL = 4;
475
+ /**
476
+ An editor state transaction, which can be applied to a state to
477
+ create an updated state. Use
478
+ [`EditorState.tr`](https://prosemirror.net/docs/ref/#state.EditorState.tr) to create an instance.
479
+
480
+ Transactions track changes to the document (they are a subclass of
481
+ [`Transform`](https://prosemirror.net/docs/ref/#transform.Transform)), but also other state changes,
482
+ like selection updates and adjustments of the set of [stored
483
+ marks](https://prosemirror.net/docs/ref/#state.EditorState.storedMarks). In addition, you can store
484
+ metadata properties in a transaction, which are extra pieces of
485
+ information that client code or plugins can use to describe what a
486
+ transaction represents, so that they can update their [own
487
+ state](https://prosemirror.net/docs/ref/#state.StateField) accordingly.
488
+
489
+ The [editor view](https://prosemirror.net/docs/ref/#view.EditorView) uses a few metadata
490
+ properties: it will attach a property `"pointer"` with the value
491
+ `true` to selection transactions directly caused by mouse or touch
492
+ input, a `"composition"` property holding an ID identifying the
493
+ composition that caused it to transactions caused by composed DOM
494
+ input, and a `"uiEvent"` property of that may be `"paste"`,
495
+ `"cut"`, or `"drop"`.
496
+ */
497
+ class Transaction extends Transform {
498
+ /**
499
+ @internal
500
+ */
501
+ constructor(state) {
502
+ super(state.doc);
503
+ // The step count for which the current selection is valid.
504
+ this.curSelectionFor = 0;
505
+ // Bitfield to track which aspects of the state were updated by
506
+ // this transaction.
507
+ this.updated = 0;
508
+ // Object used to store metadata properties for the transaction.
509
+ this.meta = Object.create(null);
510
+ this.time = Date.now();
511
+ this.curSelection = state.selection;
512
+ this.storedMarks = state.storedMarks;
513
+ }
514
+ /**
515
+ The transaction's current selection. This defaults to the editor
516
+ selection [mapped](https://prosemirror.net/docs/ref/#state.Selection.map) through the steps in the
517
+ transaction, but can be overwritten with
518
+ [`setSelection`](https://prosemirror.net/docs/ref/#state.Transaction.setSelection).
519
+ */
520
+ get selection() {
521
+ if (this.curSelectionFor < this.steps.length) {
522
+ this.curSelection = this.curSelection.map(this.doc, this.mapping.slice(this.curSelectionFor));
523
+ this.curSelectionFor = this.steps.length;
524
+ }
525
+ return this.curSelection;
526
+ }
527
+ /**
528
+ Update the transaction's current selection. Will determine the
529
+ selection that the editor gets when the transaction is applied.
530
+ */
531
+ setSelection(selection) {
532
+ if (selection.$from.doc != this.doc)
533
+ throw new RangeError("Selection passed to setSelection must point at the current document");
534
+ this.curSelection = selection;
535
+ this.curSelectionFor = this.steps.length;
536
+ this.updated = (this.updated | UPDATED_SEL) & ~UPDATED_MARKS;
537
+ this.storedMarks = null;
538
+ return this;
539
+ }
540
+ /**
541
+ Whether the selection was explicitly updated by this transaction.
542
+ */
543
+ get selectionSet() {
544
+ return (this.updated & UPDATED_SEL) > 0;
545
+ }
546
+ /**
547
+ Set the current stored marks.
548
+ */
549
+ setStoredMarks(marks) {
550
+ this.storedMarks = marks;
551
+ this.updated |= UPDATED_MARKS;
552
+ return this;
553
+ }
554
+ /**
555
+ Make sure the current stored marks or, if that is null, the marks
556
+ at the selection, match the given set of marks. Does nothing if
557
+ this is already the case.
558
+ */
559
+ ensureMarks(marks) {
560
+ if (!Mark.sameSet(this.storedMarks || this.selection.$from.marks(), marks))
561
+ this.setStoredMarks(marks);
562
+ return this;
563
+ }
564
+ /**
565
+ Add a mark to the set of stored marks.
566
+ */
567
+ addStoredMark(mark) {
568
+ return this.ensureMarks(mark.addToSet(this.storedMarks || this.selection.$head.marks()));
569
+ }
570
+ /**
571
+ Remove a mark or mark type from the set of stored marks.
572
+ */
573
+ removeStoredMark(mark) {
574
+ return this.ensureMarks(mark.removeFromSet(this.storedMarks || this.selection.$head.marks()));
575
+ }
576
+ /**
577
+ Whether the stored marks were explicitly set for this transaction.
578
+ */
579
+ get storedMarksSet() {
580
+ return (this.updated & UPDATED_MARKS) > 0;
581
+ }
582
+ /**
583
+ @internal
584
+ */
585
+ addStep(step, doc) {
586
+ super.addStep(step, doc);
587
+ this.updated = this.updated & ~UPDATED_MARKS;
588
+ this.storedMarks = null;
589
+ }
590
+ /**
591
+ Update the timestamp for the transaction.
592
+ */
593
+ setTime(time) {
594
+ this.time = time;
595
+ return this;
596
+ }
597
+ /**
598
+ Replace the current selection with the given slice.
599
+ */
600
+ replaceSelection(slice) {
601
+ this.selection.replace(this, slice);
602
+ return this;
603
+ }
604
+ /**
605
+ Replace the selection with the given node. When `inheritMarks` is
606
+ true and the content is inline, it inherits the marks from the
607
+ place where it is inserted.
608
+ */
609
+ replaceSelectionWith(node, inheritMarks = true) {
610
+ let selection = this.selection;
611
+ if (inheritMarks)
612
+ node = node.mark(this.storedMarks || (selection.empty ? selection.$from.marks() : (selection.$from.marksAcross(selection.$to) || Mark.none)));
613
+ selection.replaceWith(this, node);
614
+ return this;
615
+ }
616
+ /**
617
+ Delete the selection.
618
+ */
619
+ deleteSelection() {
620
+ this.selection.replace(this);
621
+ return this;
622
+ }
623
+ /**
624
+ Replace the given range, or the selection if no range is given,
625
+ with a text node containing the given string.
626
+ */
627
+ insertText(text, from, to) {
628
+ let schema = this.doc.type.schema;
629
+ if (from == null) {
630
+ if (!text)
631
+ return this.deleteSelection();
632
+ return this.replaceSelectionWith(schema.text(text), true);
633
+ }
634
+ else {
635
+ if (to == null)
636
+ to = from;
637
+ to = to == null ? from : to;
638
+ if (!text)
639
+ return this.deleteRange(from, to);
640
+ let marks = this.storedMarks;
641
+ if (!marks) {
642
+ let $from = this.doc.resolve(from);
643
+ marks = to == from ? $from.marks() : $from.marksAcross(this.doc.resolve(to));
644
+ }
645
+ this.replaceRangeWith(from, to, schema.text(text, marks));
646
+ if (!this.selection.empty)
647
+ this.setSelection(Selection.near(this.selection.$to));
648
+ return this;
649
+ }
650
+ }
651
+ /**
652
+ Store a metadata property in this transaction, keyed either by
653
+ name or by plugin.
654
+ */
655
+ setMeta(key, value) {
656
+ this.meta[typeof key == "string" ? key : key.key] = value;
657
+ return this;
658
+ }
659
+ /**
660
+ Retrieve a metadata property for a given name or plugin.
661
+ */
662
+ getMeta(key) {
663
+ return this.meta[typeof key == "string" ? key : key.key];
664
+ }
665
+ /**
666
+ Returns true if this transaction doesn't contain any metadata,
667
+ and can thus safely be extended.
668
+ */
669
+ get isGeneric() {
670
+ for (let _ in this.meta)
671
+ return false;
672
+ return true;
673
+ }
674
+ /**
675
+ Indicate that the editor should scroll the selection into view
676
+ when updated to the state produced by this transaction.
677
+ */
678
+ scrollIntoView() {
679
+ this.updated |= UPDATED_SCROLL;
680
+ return this;
681
+ }
682
+ /**
683
+ True when this transaction has had `scrollIntoView` called on it.
684
+ */
685
+ get scrolledIntoView() {
686
+ return (this.updated & UPDATED_SCROLL) > 0;
687
+ }
688
+ }
689
+
690
+ function bind(f, self) {
691
+ return !self || !f ? f : f.bind(self);
692
+ }
693
+ class FieldDesc {
694
+ constructor(name, desc, self) {
695
+ this.name = name;
696
+ this.init = bind(desc.init, self);
697
+ this.apply = bind(desc.apply, self);
698
+ }
699
+ }
700
+ const baseFields = [
701
+ new FieldDesc("doc", {
702
+ init(config) { return config.doc || config.schema.topNodeType.createAndFill(); },
703
+ apply(tr) { return tr.doc; }
704
+ }),
705
+ new FieldDesc("selection", {
706
+ init(config, instance) { return config.selection || Selection.atStart(instance.doc); },
707
+ apply(tr) { return tr.selection; }
708
+ }),
709
+ new FieldDesc("storedMarks", {
710
+ init(config) { return config.storedMarks || null; },
711
+ apply(tr, _marks, _old, state) { return state.selection.$cursor ? tr.storedMarks : null; }
712
+ }),
713
+ new FieldDesc("scrollToSelection", {
714
+ init() { return 0; },
715
+ apply(tr, prev) { return tr.scrolledIntoView ? prev + 1 : prev; }
716
+ })
717
+ ];
718
+ // Object wrapping the part of a state object that stays the same
719
+ // across transactions. Stored in the state's `config` property.
720
+ class Configuration {
721
+ constructor(schema, plugins) {
722
+ this.schema = schema;
723
+ this.plugins = [];
724
+ this.pluginsByKey = Object.create(null);
725
+ this.fields = baseFields.slice();
726
+ if (plugins)
727
+ plugins.forEach(plugin => {
728
+ if (this.pluginsByKey[plugin.key])
729
+ throw new RangeError("Adding different instances of a keyed plugin (" + plugin.key + ")");
730
+ this.plugins.push(plugin);
731
+ this.pluginsByKey[plugin.key] = plugin;
732
+ if (plugin.spec.state)
733
+ this.fields.push(new FieldDesc(plugin.key, plugin.spec.state, plugin));
734
+ });
735
+ }
736
+ }
737
+ /**
738
+ The state of a ProseMirror editor is represented by an object of
739
+ this type. A state is a persistent data structure—it isn't
740
+ updated, but rather a new state value is computed from an old one
741
+ using the [`apply`](https://prosemirror.net/docs/ref/#state.EditorState.apply) method.
742
+
743
+ A state holds a number of built-in fields, and plugins can
744
+ [define](https://prosemirror.net/docs/ref/#state.PluginSpec.state) additional fields.
745
+ */
746
+ class EditorState {
747
+ /**
748
+ @internal
749
+ */
750
+ constructor(
751
+ /**
752
+ @internal
753
+ */
754
+ config) {
755
+ this.config = config;
756
+ }
757
+ /**
758
+ The schema of the state's document.
759
+ */
760
+ get schema() {
761
+ return this.config.schema;
762
+ }
763
+ /**
764
+ The plugins that are active in this state.
765
+ */
766
+ get plugins() {
767
+ return this.config.plugins;
768
+ }
769
+ /**
770
+ Apply the given transaction to produce a new state.
771
+ */
772
+ apply(tr) {
773
+ return this.applyTransaction(tr).state;
774
+ }
775
+ /**
776
+ @internal
777
+ */
778
+ filterTransaction(tr, ignore = -1) {
779
+ for (let i = 0; i < this.config.plugins.length; i++)
780
+ if (i != ignore) {
781
+ let plugin = this.config.plugins[i];
782
+ if (plugin.spec.filterTransaction && !plugin.spec.filterTransaction.call(plugin, tr, this))
783
+ return false;
784
+ }
785
+ return true;
786
+ }
787
+ /**
788
+ Verbose variant of [`apply`](https://prosemirror.net/docs/ref/#state.EditorState.apply) that
789
+ returns the precise transactions that were applied (which might
790
+ be influenced by the [transaction
791
+ hooks](https://prosemirror.net/docs/ref/#state.PluginSpec.filterTransaction) of
792
+ plugins) along with the new state.
793
+ */
794
+ applyTransaction(rootTr) {
795
+ if (!this.filterTransaction(rootTr))
796
+ return { state: this, transactions: [] };
797
+ let trs = [rootTr], newState = this.applyInner(rootTr), seen = null;
798
+ // This loop repeatedly gives plugins a chance to respond to
799
+ // transactions as new transactions are added, making sure to only
800
+ // pass the transactions the plugin did not see before.
801
+ for (;;) {
802
+ let haveNew = false;
803
+ for (let i = 0; i < this.config.plugins.length; i++) {
804
+ let plugin = this.config.plugins[i];
805
+ if (plugin.spec.appendTransaction) {
806
+ let n = seen ? seen[i].n : 0, oldState = seen ? seen[i].state : this;
807
+ let tr = n < trs.length &&
808
+ plugin.spec.appendTransaction.call(plugin, n ? trs.slice(n) : trs, oldState, newState);
809
+ if (tr && newState.filterTransaction(tr, i)) {
810
+ tr.setMeta("appendedTransaction", rootTr);
811
+ if (!seen) {
812
+ seen = [];
813
+ for (let j = 0; j < this.config.plugins.length; j++)
814
+ seen.push(j < i ? { state: newState, n: trs.length } : { state: this, n: 0 });
815
+ }
816
+ trs.push(tr);
817
+ newState = newState.applyInner(tr);
818
+ haveNew = true;
819
+ }
820
+ if (seen)
821
+ seen[i] = { state: newState, n: trs.length };
822
+ }
823
+ }
824
+ if (!haveNew)
825
+ return { state: newState, transactions: trs };
826
+ }
827
+ }
828
+ /**
829
+ @internal
830
+ */
831
+ applyInner(tr) {
832
+ if (!tr.before.eq(this.doc))
833
+ throw new RangeError("Applying a mismatched transaction");
834
+ let newInstance = new EditorState(this.config), fields = this.config.fields;
835
+ for (let i = 0; i < fields.length; i++) {
836
+ let field = fields[i];
837
+ newInstance[field.name] = field.apply(tr, this[field.name], this, newInstance);
838
+ }
839
+ return newInstance;
840
+ }
841
+ /**
842
+ Start a [transaction](https://prosemirror.net/docs/ref/#state.Transaction) from this state.
843
+ */
844
+ get tr() { return new Transaction(this); }
845
+ /**
846
+ Create a new state.
847
+ */
848
+ static create(config) {
849
+ let $config = new Configuration(config.doc ? config.doc.type.schema : config.schema, config.plugins);
850
+ let instance = new EditorState($config);
851
+ for (let i = 0; i < $config.fields.length; i++)
852
+ instance[$config.fields[i].name] = $config.fields[i].init(config, instance);
853
+ return instance;
854
+ }
855
+ /**
856
+ Create a new state based on this one, but with an adjusted set
857
+ of active plugins. State fields that exist in both sets of
858
+ plugins are kept unchanged. Those that no longer exist are
859
+ dropped, and those that are new are initialized using their
860
+ [`init`](https://prosemirror.net/docs/ref/#state.StateField.init) method, passing in the new
861
+ configuration object..
862
+ */
863
+ reconfigure(config) {
864
+ let $config = new Configuration(this.schema, config.plugins);
865
+ let fields = $config.fields, instance = new EditorState($config);
866
+ for (let i = 0; i < fields.length; i++) {
867
+ let name = fields[i].name;
868
+ instance[name] = this.hasOwnProperty(name) ? this[name] : fields[i].init(config, instance);
869
+ }
870
+ return instance;
871
+ }
872
+ /**
873
+ Serialize this state to JSON. If you want to serialize the state
874
+ of plugins, pass an object mapping property names to use in the
875
+ resulting JSON object to plugin objects. The argument may also be
876
+ a string or number, in which case it is ignored, to support the
877
+ way `JSON.stringify` calls `toString` methods.
878
+ */
879
+ toJSON(pluginFields) {
880
+ let result = { doc: this.doc.toJSON(), selection: this.selection.toJSON() };
881
+ if (this.storedMarks)
882
+ result.storedMarks = this.storedMarks.map(m => m.toJSON());
883
+ if (pluginFields && typeof pluginFields == 'object')
884
+ for (let prop in pluginFields) {
885
+ if (prop == "doc" || prop == "selection")
886
+ throw new RangeError("The JSON fields `doc` and `selection` are reserved");
887
+ let plugin = pluginFields[prop], state = plugin.spec.state;
888
+ if (state && state.toJSON)
889
+ result[prop] = state.toJSON.call(plugin, this[plugin.key]);
890
+ }
891
+ return result;
892
+ }
893
+ /**
894
+ Deserialize a JSON representation of a state. `config` should
895
+ have at least a `schema` field, and should contain array of
896
+ plugins to initialize the state with. `pluginFields` can be used
897
+ to deserialize the state of plugins, by associating plugin
898
+ instances with the property names they use in the JSON object.
899
+ */
900
+ static fromJSON(config, json, pluginFields) {
901
+ if (!json)
902
+ throw new RangeError("Invalid input for EditorState.fromJSON");
903
+ if (!config.schema)
904
+ throw new RangeError("Required config field 'schema' missing");
905
+ let $config = new Configuration(config.schema, config.plugins);
906
+ let instance = new EditorState($config);
907
+ $config.fields.forEach(field => {
908
+ if (field.name == "doc") {
909
+ instance.doc = Node.fromJSON(config.schema, json.doc);
910
+ }
911
+ else if (field.name == "selection") {
912
+ instance.selection = Selection.fromJSON(instance.doc, json.selection);
913
+ }
914
+ else if (field.name == "storedMarks") {
915
+ if (json.storedMarks)
916
+ instance.storedMarks = json.storedMarks.map(config.schema.markFromJSON);
917
+ }
918
+ else {
919
+ if (pluginFields)
920
+ for (let prop in pluginFields) {
921
+ let plugin = pluginFields[prop], state = plugin.spec.state;
922
+ if (plugin.key == field.name && state && state.fromJSON &&
923
+ Object.prototype.hasOwnProperty.call(json, prop)) {
924
+ instance[field.name] = state.fromJSON.call(plugin, config, json[prop], instance);
925
+ return;
926
+ }
927
+ }
928
+ instance[field.name] = field.init(config, instance);
929
+ }
930
+ });
931
+ return instance;
932
+ }
933
+ }
934
+
935
+ function bindProps(obj, self, target) {
936
+ for (let prop in obj) {
937
+ let val = obj[prop];
938
+ if (val instanceof Function)
939
+ val = val.bind(self);
940
+ else if (prop == "handleDOMEvents")
941
+ val = bindProps(val, self, {});
942
+ target[prop] = val;
943
+ }
944
+ return target;
945
+ }
946
+ /**
947
+ Plugins bundle functionality that can be added to an editor.
948
+ They are part of the [editor state](https://prosemirror.net/docs/ref/#state.EditorState) and
949
+ may influence that state and the view that contains it.
950
+ */
951
+ class Plugin {
952
+ /**
953
+ Create a plugin.
954
+ */
955
+ constructor(
956
+ /**
957
+ The plugin's [spec object](https://prosemirror.net/docs/ref/#state.PluginSpec).
958
+ */
959
+ spec) {
960
+ this.spec = spec;
961
+ /**
962
+ The [props](https://prosemirror.net/docs/ref/#view.EditorProps) exported by this plugin.
963
+ */
964
+ this.props = {};
965
+ if (spec.props)
966
+ bindProps(spec.props, this, this.props);
967
+ this.key = spec.key ? spec.key.key : createKey("plugin");
968
+ }
969
+ /**
970
+ Extract the plugin's state field from an editor state.
971
+ */
972
+ getState(state) { return state[this.key]; }
973
+ }
974
+ const keys = Object.create(null);
975
+ function createKey(name) {
976
+ if (name in keys)
977
+ return name + "$" + ++keys[name];
978
+ keys[name] = 0;
979
+ return name + "$";
980
+ }
981
+ /**
982
+ A key is used to [tag](https://prosemirror.net/docs/ref/#state.PluginSpec.key) plugins in a way
983
+ that makes it possible to find them, given an editor state.
984
+ Assigning a key does mean only one plugin of that type can be
985
+ active in a state.
986
+ */
987
+ class PluginKey {
988
+ /**
989
+ Create a plugin key.
990
+ */
991
+ constructor(name = "key") { this.key = createKey(name); }
992
+ /**
993
+ Get the active plugin with this key, if any, from an editor
994
+ state.
995
+ */
996
+ get(state) { return state.config.pluginsByKey[this.key]; }
997
+ /**
998
+ Get the plugin's state from an editor state.
999
+ */
1000
+ getState(state) { return state[this.key]; }
1001
+ }
1002
+
1003
+ export { AllSelection as A, EditorState as E, NodeSelection as N, Plugin as P, Selection as S, TextSelection as T, PluginKey as a, SelectionRange as b };