@vc-shell/framework 1.1.74 → 1.1.76

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 (258) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/framework.js +4682 -4500
  3. package/dist/index.css +1 -1
  4. package/dist/shared/components/app-switcher/components/vc-app-switcher/vc-app-switcher.vue.d.ts.map +1 -1
  5. package/dist/shared/components/blade-navigation/components/vc-blade-navigation/_internal/vc-mobile-back-button.vue.d.ts.map +1 -1
  6. package/dist/shared/components/blade-navigation/components/vc-blade-navigation/vc-blade-navigation.vue.d.ts.map +1 -1
  7. package/dist/shared/components/change-password/change-password.vue.d.ts.map +1 -1
  8. package/dist/shared/components/change-password-button/change-password-button.vue.d.ts.map +1 -1
  9. package/dist/shared/components/common/popup/vc-popup-error.vue.d.ts.map +1 -1
  10. package/dist/shared/components/common/popup/vc-popup-info.vue.d.ts.map +1 -1
  11. package/dist/shared/components/common/popup/vc-popup-warning.vue.d.ts.map +1 -1
  12. package/dist/shared/components/dashboard-widget-card/dashboard-widget-card.vue.d.ts.map +1 -1
  13. package/dist/shared/components/draggable-dashboard/DraggableDashboard.vue.d.ts.map +1 -1
  14. package/dist/shared/components/draggable-dashboard/_internal/DashboardWidget.vue.d.ts.map +1 -1
  15. package/dist/shared/components/generic-dropdown/generic-dropdown.vue.d.ts +2 -2
  16. package/dist/shared/components/generic-dropdown/generic-dropdown.vue.d.ts.map +1 -1
  17. package/dist/shared/components/language-selector/language-selector.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/multilanguage-selector/multilanguage-selector.vue.d.ts.map +1 -1
  20. package/dist/shared/components/notification-dropdown/_internal/notification/notification.vue.d.ts.map +1 -1
  21. package/dist/shared/components/notification-dropdown/notification-dropdown.vue.d.ts.map +1 -1
  22. package/dist/shared/components/notification-template/notification-template.vue.d.ts.map +1 -1
  23. package/dist/shared/components/popup-handler/components/vc-popup-container/vc-popup-container.vue.d.ts.map +1 -1
  24. package/dist/shared/components/settings-menu/settings-menu.vue.d.ts.map +1 -1
  25. package/dist/shared/components/settings-menu-item/settings-menu-item.vue.d.ts.map +1 -1
  26. package/dist/shared/components/sidebar/sidebar.vue.d.ts.map +1 -1
  27. package/dist/shared/components/sign-in/external-provider.vue.d.ts.map +1 -1
  28. package/dist/shared/components/sign-in/external-providers.vue.d.ts.map +1 -1
  29. package/dist/shared/components/theme-selector/theme-selector.vue.d.ts.map +1 -1
  30. package/dist/shared/components/user-dropdown-button/_internal/user-info.vue.d.ts.map +1 -1
  31. package/dist/shared/components/user-dropdown-button/_internal/user-sidebar.vue.d.ts.map +1 -1
  32. package/dist/shared/components/user-dropdown-button/user-dropdown-button.vue.d.ts.map +1 -1
  33. package/dist/shared/composables/useMenuExpanded.d.ts +1 -1
  34. package/dist/shared/modules/assets/components/assets-details/assets-details.vue.d.ts.map +1 -1
  35. package/dist/shared/modules/assets-manager/components/assets-manager/assets-manager.vue.d.ts.map +1 -1
  36. package/dist/shared/modules/dynamic/pages/dynamic-blade-form.vue.d.ts.map +1 -1
  37. package/dist/shared/modules/dynamic/pages/dynamic-blade-list.vue.d.ts.map +1 -1
  38. package/dist/shared/pages/ChangePasswordPage/components/change-password/ChangePassword.vue.d.ts.map +1 -1
  39. package/dist/shared/pages/InvitePage/components/invite/Invite.vue.d.ts.map +1 -1
  40. package/dist/shared/pages/LoginPage/components/login/Login.vue.d.ts.map +1 -1
  41. package/dist/shared/pages/ResetPasswordPage/components/reset-password/ResetPassword.vue.d.ts.map +1 -1
  42. package/dist/tsconfig.tsbuildinfo +1 -1
  43. package/dist/ui/components/atoms/vc-badge/vc-badge.vue.d.ts.map +1 -1
  44. package/dist/ui/components/atoms/vc-banner/vc-banner.vue.d.ts.map +1 -1
  45. package/dist/ui/components/atoms/vc-button/vc-button.vue.d.ts.map +1 -1
  46. package/dist/ui/components/atoms/vc-card/vc-card.vue.d.ts.map +1 -1
  47. package/dist/ui/components/atoms/vc-col/vc-col.vue.d.ts.map +1 -1
  48. package/dist/ui/components/atoms/vc-container/vc-container.vue.d.ts +2 -2
  49. package/dist/ui/components/atoms/vc-container/vc-container.vue.d.ts.map +1 -1
  50. package/dist/ui/components/atoms/vc-hint/vc-hint.vue.d.ts.map +1 -1
  51. package/dist/ui/components/atoms/vc-icon/icons/MenuBurgerIcon.vue.d.ts.map +1 -1
  52. package/dist/ui/components/atoms/vc-icon/vc-bootstrap-icon.vue.d.ts.map +1 -1
  53. package/dist/ui/components/atoms/vc-icon/vc-fontawesome-icon.vue.d.ts.map +1 -1
  54. package/dist/ui/components/atoms/vc-icon/vc-icon-examples.vue.d.ts.map +1 -1
  55. package/dist/ui/components/atoms/vc-icon/vc-icon-test.vue.d.ts.map +1 -1
  56. package/dist/ui/components/atoms/vc-icon/vc-icon.vue.d.ts.map +1 -1
  57. package/dist/ui/components/atoms/vc-icon/vc-lucide-icon.vue.d.ts.map +1 -1
  58. package/dist/ui/components/atoms/vc-icon/vc-material-icon.vue.d.ts.map +1 -1
  59. package/dist/ui/components/atoms/vc-icon/vc-svg-icon.vue.d.ts.map +1 -1
  60. package/dist/ui/components/atoms/vc-image/vc-image.vue.d.ts.map +1 -1
  61. package/dist/ui/components/atoms/vc-label/vc-label.vue.d.ts.map +1 -1
  62. package/dist/ui/components/atoms/vc-link/vc-link.vue.d.ts.map +1 -1
  63. package/dist/ui/components/atoms/vc-loading/vc-loading.vue.d.ts.map +1 -1
  64. package/dist/ui/components/atoms/vc-progress/vc-progress.vue.d.ts.map +1 -1
  65. package/dist/ui/components/atoms/vc-row/vc-row.vue.d.ts.map +1 -1
  66. package/dist/ui/components/atoms/vc-skeleton/vc-skeleton.vue.d.ts.map +1 -1
  67. package/dist/ui/components/atoms/vc-status/vc-status.vue.d.ts.map +1 -1
  68. package/dist/ui/components/atoms/vc-status-icon/vc-status-icon.vue.d.ts.map +1 -1
  69. package/dist/ui/components/atoms/vc-tooltip/vc-tooltip.vue.d.ts.map +1 -1
  70. package/dist/ui/components/atoms/vc-video/vc-video.vue.d.ts.map +1 -1
  71. package/dist/ui/components/atoms/vc-widget/vc-widget.vue.d.ts.map +1 -1
  72. package/dist/ui/components/molecules/vc-breadcrumbs/_internal/vc-breadcrumbs-item/vc-breadcrumbs-item.vue.d.ts.map +1 -1
  73. package/dist/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.vue.d.ts.map +1 -1
  74. package/dist/ui/components/molecules/vc-checkbox/vc-checkbox.vue.d.ts.map +1 -1
  75. package/dist/ui/components/molecules/vc-editor/_internal/extensions/font-size.d.ts +12 -0
  76. package/dist/ui/components/molecules/vc-editor/_internal/extensions/font-size.d.ts.map +1 -0
  77. package/dist/ui/components/molecules/vc-editor/_internal/toolbar-types.d.ts +49 -0
  78. package/dist/ui/components/molecules/vc-editor/_internal/toolbar-types.d.ts.map +1 -0
  79. package/dist/ui/components/molecules/vc-editor/_internal/vc-editor-button.vue.d.ts.map +1 -1
  80. package/dist/ui/components/molecules/vc-editor/_internal/vc-editor-custom-button.vue.d.ts +10 -0
  81. package/dist/ui/components/molecules/vc-editor/_internal/vc-editor-custom-button.vue.d.ts.map +1 -0
  82. package/dist/ui/components/molecules/vc-editor/_internal/vc-editor-font-selector.vue.d.ts +8 -0
  83. package/dist/ui/components/molecules/vc-editor/_internal/vc-editor-font-selector.vue.d.ts.map +1 -0
  84. package/dist/ui/components/molecules/vc-editor/_internal/vc-editor-toolbar.vue.d.ts +4 -1
  85. package/dist/ui/components/molecules/vc-editor/_internal/vc-editor-toolbar.vue.d.ts.map +1 -1
  86. package/dist/ui/components/molecules/vc-editor/index.d.ts +1 -0
  87. package/dist/ui/components/molecules/vc-editor/index.d.ts.map +1 -1
  88. package/dist/ui/components/molecules/vc-editor/vc-editor.vue.d.ts +7 -3
  89. package/dist/ui/components/molecules/vc-editor/vc-editor.vue.d.ts.map +1 -1
  90. package/dist/ui/components/molecules/vc-field/_internal/vc-field-type/vc-field-type.vue.d.ts.map +1 -1
  91. package/dist/ui/components/molecules/vc-field/vc-field.vue.d.ts.map +1 -1
  92. package/dist/ui/components/molecules/vc-file-upload/vc-file-upload.vue.d.ts.map +1 -1
  93. package/dist/ui/components/molecules/vc-form/vc-form.vue.d.ts.map +1 -1
  94. package/dist/ui/components/molecules/vc-input/vc-input.vue.d.ts.map +1 -1
  95. package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.vue.d.ts.map +1 -1
  96. package/dist/ui/components/molecules/vc-input-dropdown/vc-input-dropdown.vue.d.ts.map +1 -1
  97. package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.vue.d.ts +2 -2
  98. package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.vue.d.ts.map +1 -1
  99. package/dist/ui/components/molecules/vc-pagination/vc-pagination.vue.d.ts.map +1 -1
  100. package/dist/ui/components/molecules/vc-radio-button/vc-radio-button.vue.d.ts.map +1 -1
  101. package/dist/ui/components/molecules/vc-rating/vc-rating.vue.d.ts.map +1 -1
  102. package/dist/ui/components/molecules/vc-select/vc-select.vue.d.ts +2 -2
  103. package/dist/ui/components/molecules/vc-select/vc-select.vue.d.ts.map +1 -1
  104. package/dist/ui/components/molecules/vc-slider/vc-slider.vue.d.ts +7 -8
  105. package/dist/ui/components/molecules/vc-slider/vc-slider.vue.d.ts.map +1 -1
  106. package/dist/ui/components/molecules/vc-switch/vc-switch.vue.d.ts.map +1 -1
  107. package/dist/ui/components/molecules/vc-textarea/vc-textarea.vue.d.ts.map +1 -1
  108. package/dist/ui/components/molecules/vc-toast/vc-toast.vue.d.ts.map +1 -1
  109. package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarContent.vue.d.ts.map +1 -1
  110. package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarHeader.vue.d.ts.map +1 -1
  111. package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarMobileActions.vue.d.ts.map +1 -1
  112. package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarOverlay.vue.d.ts +2 -2
  113. package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarOverlay.vue.d.ts.map +1 -1
  114. package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarSlots.vue.d.ts.map +1 -1
  115. package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarWidgetItem.vue.d.ts.map +1 -1
  116. package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarWidgetsMenu.vue.d.ts.map +1 -1
  117. package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/MenuSidebar.vue.d.ts.map +1 -1
  118. package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue.d.ts.map +1 -1
  119. 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
  120. package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/vc-app-menu-item.vue.d.ts.map +1 -1
  121. package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/vc-app-menu.vue.d.ts.map +1 -1
  122. package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts.map +1 -1
  123. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-header/vc-blade-header.vue.d.ts +2 -2
  124. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-header/vc-blade-header.vue.d.ts.map +1 -1
  125. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/vc-blade-toolbar-base-button.vue.d.ts.map +1 -1
  126. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/vc-blade-toolbar-button.vue.d.ts.map +1 -1
  127. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/vc-blade-toolbar-circle-button.vue.d.ts.map +1 -1
  128. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/desktop/vc-blade-toolbar-desktop.vue.d.ts.map +1 -1
  129. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/mobile/vc-blade-toolbar-mobile.vue.d.ts.map +1 -1
  130. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/vc-blade-toolbar-buttons.vue.d.ts.map +1 -1
  131. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/vc-blade-toolbar.vue.d.ts +2 -2
  132. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/vc-blade-toolbar.vue.d.ts.map +1 -1
  133. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-desktop.vue.d.ts.map +1 -1
  134. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-mobile.vue.d.ts.map +1 -1
  135. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/vc-widget-container.vue.d.ts.map +1 -1
  136. package/dist/ui/components/organisms/vc-blade/vc-blade.vue.d.ts.map +1 -1
  137. package/dist/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.vue.d.ts +2 -2
  138. package/dist/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.vue.d.ts.map +1 -1
  139. package/dist/ui/components/organisms/vc-gallery/_internal/vc-gallery-item/vc-gallery-item.vue.d.ts.map +1 -1
  140. package/dist/ui/components/organisms/vc-gallery/_internal/vc-gallery-preview/vc-gallery-preview.vue.d.ts.map +1 -1
  141. package/dist/ui/components/organisms/vc-gallery/vc-gallery.vue.d.ts.map +1 -1
  142. package/dist/ui/components/organisms/vc-login-form/vc-login-form.vue.d.ts.map +1 -1
  143. package/dist/ui/components/organisms/vc-popup/vc-popup.vue.d.ts.map +1 -1
  144. package/dist/ui/components/organisms/vc-table/_internal/vc-table-add-new/vc-table-add-new.vue.d.ts.map +1 -1
  145. package/dist/ui/components/organisms/vc-table/_internal/vc-table-base-header/vc-table-base-header.vue.d.ts +2 -2
  146. package/dist/ui/components/organisms/vc-table/_internal/vc-table-base-header/vc-table-base-header.vue.d.ts.map +1 -1
  147. package/dist/ui/components/organisms/vc-table/_internal/vc-table-cell/vc-table-cell.vue.d.ts.map +1 -1
  148. package/dist/ui/components/organisms/vc-table/_internal/vc-table-column-switcher/vc-table-column-switcher.vue.d.ts.map +1 -1
  149. package/dist/ui/components/organisms/vc-table/_internal/vc-table-counter/vc-table-counter.vue.d.ts.map +1 -1
  150. package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-body/vc-table-body.vue.d.ts +25 -3
  151. package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-body/vc-table-body.vue.d.ts.map +1 -1
  152. package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-columns-header/vc-table-columns-header.vue.d.ts +2 -2
  153. package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-columns-header/vc-table-columns-header.vue.d.ts.map +1 -1
  154. package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-row/vc-table-row.vue.d.ts +25 -3
  155. package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-row/vc-table-row.vue.d.ts.map +1 -1
  156. package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-select-all-header/vc-table-select-all-header.vue.d.ts.map +1 -1
  157. package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/vc-table-desktop-view.vue.d.ts +31 -3
  158. package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/vc-table-desktop-view.vue.d.ts.map +1 -1
  159. package/dist/ui/components/organisms/vc-table/_internal/vc-table-empty/vc-table-empty.vue.d.ts.map +1 -1
  160. package/dist/ui/components/organisms/vc-table/_internal/vc-table-filter/vc-table-filter.vue.d.ts +2 -2
  161. package/dist/ui/components/organisms/vc-table/_internal/vc-table-filter/vc-table-filter.vue.d.ts.map +1 -1
  162. package/dist/ui/components/organisms/vc-table/_internal/vc-table-footer/vc-table-footer.vue.d.ts.map +1 -1
  163. package/dist/ui/components/organisms/vc-table/_internal/vc-table-header/vc-table-header.vue.d.ts.map +1 -1
  164. package/dist/ui/components/organisms/vc-table/_internal/vc-table-mobile-item/vc-table-mobile-item.vue.d.ts +2 -2
  165. package/dist/ui/components/organisms/vc-table/_internal/vc-table-mobile-item/vc-table-mobile-item.vue.d.ts.map +1 -1
  166. package/dist/ui/components/organisms/vc-table/_internal/vc-table-mobile-view/vc-table-mobile-view.vue.d.ts +2 -2
  167. package/dist/ui/components/organisms/vc-table/_internal/vc-table-mobile-view/vc-table-mobile-view.vue.d.ts.map +1 -1
  168. package/dist/ui/components/organisms/vc-table/_internal/vc-table-select-all/vc-table-select-all.vue.d.ts.map +1 -1
  169. package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts +28 -3
  170. package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts.map +1 -1
  171. package/dist/vendor-floating-ui-vue-C1Zscv9o.js +836 -0
  172. package/dist/{vendor-linkifyjs-DTu7SY_Y.js → vendor-linkifyjs-dCH9UYes.js} +183 -187
  173. package/dist/{vendor-prosemirror-commands-B8fhFbTo.js → vendor-prosemirror-commands-DKHyfRYE.js} +26 -26
  174. package/dist/{vendor-prosemirror-dropcursor-CdHQ9kQG.js → vendor-prosemirror-dropcursor-Dro-INCI.js} +2 -2
  175. package/dist/{vendor-prosemirror-gapcursor-W-ky5QTm.js → vendor-prosemirror-gapcursor-BgyglWtH.js} +3 -3
  176. package/dist/{vendor-prosemirror-history-CrtTR5Cd.js → vendor-prosemirror-history-B4ei16kP.js} +2 -2
  177. package/dist/{vendor-prosemirror-keymap-DWvoDWf6.js → vendor-prosemirror-keymap-21y6bXc_.js} +1 -1
  178. package/dist/{vendor-prosemirror-schema-list-Ds6x_KLX.js → vendor-prosemirror-schema-list-Dmi4oPas.js} +11 -11
  179. package/dist/{vendor-prosemirror-state-CRUasa1V.js → vendor-prosemirror-state-6jGEPgrP.js} +1 -1
  180. package/dist/{vendor-prosemirror-tables-DzTfCeHX.js → vendor-prosemirror-tables-U7ypaxJu.js} +4 -4
  181. package/dist/{vendor-prosemirror-transform-BeDaI3CS.js → vendor-prosemirror-transform-Dk6c_eg4.js} +5 -4
  182. package/dist/vendor-prosemirror-view-Bfe9EVLy.js +1489 -0
  183. package/dist/vendor-swiper-1bp0oJwt.js +3387 -0
  184. package/dist/vendor-tiptap-core-CtNT-ozM.js +3096 -0
  185. package/dist/{vendor-tiptap-extension-blockquote-iAIM-meW.js → vendor-tiptap-extension-blockquote-25QerT8O.js} +6 -8
  186. package/dist/{vendor-tiptap-extension-bold-bkOLNH6E.js → vendor-tiptap-extension-bold-B-B75KIy.js} +10 -10
  187. package/dist/{vendor-tiptap-extension-code-CgIql8q6.js → vendor-tiptap-extension-code-CEZA5x7I.js} +8 -10
  188. package/dist/vendor-tiptap-extension-code-block-BFDiCj59.js +192 -0
  189. package/dist/vendor-tiptap-extension-document-C8JdW_kC.js +9 -0
  190. package/dist/{vendor-tiptap-extension-hard-break-DygHhzqw.js → vendor-tiptap-extension-hard-break-D9Nzegu6.js} +4 -6
  191. package/dist/{vendor-tiptap-extension-heading-C-ArDc3_.js → vendor-tiptap-extension-heading-TmkrHpE2.js} +9 -6
  192. package/dist/vendor-tiptap-extension-horizontal-rule-BC1YMUau.js +53 -0
  193. package/dist/{vendor-tiptap-extension-image-DChcWb4v.js → vendor-tiptap-extension-image-BQnBpg7z.js} +9 -3
  194. package/dist/{vendor-tiptap-extension-italic-BNJrFvrR.js → vendor-tiptap-extension-italic-mSCwLnXY.js} +4 -4
  195. package/dist/vendor-tiptap-extension-link-CQ0Mw6gd.js +287 -0
  196. package/dist/vendor-tiptap-extension-list-BwidYizT.js +420 -0
  197. package/dist/{vendor-tiptap-extension-paragraph-DZfkaJJ-.js → vendor-tiptap-extension-paragraph-C_OQHUNe.js} +3 -5
  198. package/dist/vendor-tiptap-extension-placeholder-BIojfRhh.js +1 -0
  199. package/dist/{vendor-tiptap-extension-strike-BlGNozxy.js → vendor-tiptap-extension-strike-Bfc-eud8.js} +3 -3
  200. package/dist/vendor-tiptap-extension-table-D26aUVrb.js +302 -0
  201. package/dist/vendor-tiptap-extension-table-cell-DuWy52BP.js +1 -0
  202. package/dist/vendor-tiptap-extension-table-header-DuWy52BP.js +1 -0
  203. package/dist/vendor-tiptap-extension-table-row-DuWy52BP.js +1 -0
  204. package/dist/vendor-tiptap-extension-text-DrXC1h34.js +8 -0
  205. package/dist/vendor-tiptap-extension-text-style-vv6u__7g.js +230 -0
  206. package/dist/{vendor-tiptap-extension-underline-CIVtuRLl.js → vendor-tiptap-extension-underline-BfygI164.js} +2 -2
  207. package/dist/vendor-tiptap-extensions-_4zopegS.js +289 -0
  208. package/dist/{vendor-tiptap-markdown-CidDIpZ-.js → vendor-tiptap-markdown-pGf8MOss.js} +26 -26
  209. package/dist/vendor-tiptap-pm-B2DY8bDS.js +7681 -0
  210. package/dist/vendor-tiptap-starter-kit-DPG4_B0q.js +28 -0
  211. package/dist/vendor-tiptap-vue-3-Ctgrxv1U.js +157 -0
  212. package/dist/vendor-vueuse-components-CuLo31bP.js +219 -0
  213. package/dist/vendor-vueuse-core-A9T6NeUn.js +6880 -0
  214. package/dist/vendor-vueuse-shared-B2Uva3Md.js +35 -0
  215. package/package.json +33 -27
  216. package/ui/components/molecules/vc-editor/_internal/extensions/font-size.ts +59 -0
  217. package/ui/components/molecules/vc-editor/_internal/toolbar-types.ts +57 -0
  218. package/ui/components/molecules/vc-editor/_internal/vc-editor-custom-button.vue +79 -0
  219. package/ui/components/molecules/vc-editor/_internal/vc-editor-font-selector.vue +215 -0
  220. package/ui/components/molecules/vc-editor/_internal/vc-editor-toolbar.vue +42 -0
  221. package/ui/components/molecules/vc-editor/index.ts +5 -0
  222. package/ui/components/molecules/vc-editor/vc-editor.stories.ts +172 -3
  223. package/ui/components/molecules/vc-editor/vc-editor.vue +49 -26
  224. package/ui/components/molecules/vc-slider/vc-slider.vue +8 -8
  225. package/dist/vendor-dom7-wvIUV9pT.js +0 -529
  226. package/dist/vendor-floating-ui-core-3dy7r5mx.js +0 -349
  227. package/dist/vendor-floating-ui-dom-DCjH_QK4.js +0 -393
  228. package/dist/vendor-floating-ui-vue-BUBCqiRN.js +0 -107
  229. package/dist/vendor-popperjs-core-LGjf7Wza.js +0 -905
  230. package/dist/vendor-prosemirror-view-BGYdOWiJ.js +0 -3748
  231. package/dist/vendor-ssr-window-D4k3p53c.js +0 -133
  232. package/dist/vendor-swiper-DrZzJvo8.js +0 -2825
  233. package/dist/vendor-tippy-js-nNhcw_JH.js +0 -812
  234. package/dist/vendor-tiptap-core-dlTW4S11.js +0 -2817
  235. package/dist/vendor-tiptap-extension-bubble-menu-BRWVLpun.js +0 -128
  236. package/dist/vendor-tiptap-extension-bullet-list-DfU428XB.js +0 -53
  237. package/dist/vendor-tiptap-extension-code-block-V26-erQk.js +0 -133
  238. package/dist/vendor-tiptap-extension-document-BYF_BzDD.js +0 -9
  239. package/dist/vendor-tiptap-extension-dropcursor-DqjaaFex.js +0 -20
  240. package/dist/vendor-tiptap-extension-floating-menu-vptdm_Y0.js +0 -99
  241. package/dist/vendor-tiptap-extension-gapcursor-DxLBw8V0.js +0 -24
  242. package/dist/vendor-tiptap-extension-history-C41RW3Bv.js +0 -35
  243. package/dist/vendor-tiptap-extension-horizontal-rule-BGMGd9fo.js +0 -58
  244. package/dist/vendor-tiptap-extension-link-DFN4ENph.js +0 -270
  245. package/dist/vendor-tiptap-extension-list-item-3qKYhGHe.js +0 -33
  246. package/dist/vendor-tiptap-extension-ordered-list-D3QL0eiW.js +0 -71
  247. package/dist/vendor-tiptap-extension-placeholder-CoOAmd0a.js +0 -52
  248. package/dist/vendor-tiptap-extension-table-CZn6Xykb.js +0 -213
  249. package/dist/vendor-tiptap-extension-table-cell-BQuS-XFD.js +0 -40
  250. package/dist/vendor-tiptap-extension-table-header-ZrtK7HiQ.js +0 -40
  251. package/dist/vendor-tiptap-extension-table-row-CBrXvqsO.js +0 -22
  252. package/dist/vendor-tiptap-extension-text-DwA7jrBq.js +0 -8
  253. package/dist/vendor-tiptap-pm-9TOy65Oe.js +0 -1
  254. package/dist/vendor-tiptap-starter-kit-BdU6UtqB.js +0 -29
  255. package/dist/vendor-tiptap-vue-3-CnYccgV4.js +0 -225
  256. package/dist/vendor-vueuse-components-B0zqjNRW.js +0 -542
  257. package/dist/vendor-vueuse-core-CYgwn-B2.js +0 -5130
  258. package/dist/vendor-vueuse-shared-B_uDJJ6V.js +0 -1169
@@ -0,0 +1,3096 @@
1
+ import { N as G, E as se, S as D, T as A, P, a as B, A as ie } from "./vendor-prosemirror-state-6jGEPgrP.js";
2
+ import { E as ae, D as ce, S as Tt, F as N, N as le, a as nt, b as ue } from "./vendor-tiptap-pm-B2DY8bDS.js";
3
+ import { a as de } from "./vendor-prosemirror-keymap-21y6bXc_.js";
4
+ import { f as fe, c as ct, T as pe, e as me, l as he, j as Ct, a as U, b as ge, R as ve } from "./vendor-prosemirror-transform-Dk6c_eg4.js";
5
+ import { c as ye, d as be, e as ke, j as we, a as Me, b as Se, f as Ee, g as xe, h as Te, l as Ce, i as Ae, n as Pe, s as $e, k as Ie, m as Ne, o as Oe, p as Be, q as yt, w as je } from "./vendor-prosemirror-commands-DKHyfRYE.js";
6
+ import { l as Re, s as De, w as Fe } from "./vendor-prosemirror-schema-list-Dmi4oPas.js";
7
+ var _e = Object.defineProperty, At = (e, t) => {
8
+ for (var n in t)
9
+ _e(e, n, { get: t[n], enumerable: !0 });
10
+ };
11
+ function X(e) {
12
+ const { state: t, transaction: n } = e;
13
+ let { selection: r } = n, { doc: o } = n, { storedMarks: s } = n;
14
+ return {
15
+ ...t,
16
+ apply: t.apply.bind(t),
17
+ applyTransaction: t.applyTransaction.bind(t),
18
+ plugins: t.plugins,
19
+ schema: t.schema,
20
+ reconfigure: t.reconfigure.bind(t),
21
+ toJSON: t.toJSON.bind(t),
22
+ get storedMarks() {
23
+ return s;
24
+ },
25
+ get selection() {
26
+ return r;
27
+ },
28
+ get doc() {
29
+ return o;
30
+ },
31
+ get tr() {
32
+ return r = n.selection, o = n.doc, s = n.storedMarks, n;
33
+ }
34
+ };
35
+ }
36
+ var Y = class {
37
+ constructor(e) {
38
+ this.editor = e.editor, this.rawCommands = this.editor.extensionManager.commands, this.customState = e.state;
39
+ }
40
+ get hasCustomState() {
41
+ return !!this.customState;
42
+ }
43
+ get state() {
44
+ return this.customState || this.editor.state;
45
+ }
46
+ get commands() {
47
+ const { rawCommands: e, editor: t, state: n } = this, { view: r } = t, { tr: o } = n, s = this.buildProps(o);
48
+ return Object.fromEntries(
49
+ Object.entries(e).map(([i, a]) => [i, (...l) => {
50
+ const d = a(...l)(s);
51
+ return !o.getMeta("preventDispatch") && !this.hasCustomState && r.dispatch(o), d;
52
+ }])
53
+ );
54
+ }
55
+ get chain() {
56
+ return () => this.createChain();
57
+ }
58
+ get can() {
59
+ return () => this.createCan();
60
+ }
61
+ createChain(e, t = !0) {
62
+ const { rawCommands: n, editor: r, state: o } = this, { view: s } = r, i = [], a = !!e, c = e || o.tr, l = () => (!a && t && !c.getMeta("preventDispatch") && !this.hasCustomState && s.dispatch(c), i.every((u) => u === !0)), d = {
63
+ ...Object.fromEntries(
64
+ Object.entries(n).map(([u, p]) => [u, (...m) => {
65
+ const h = this.buildProps(c, t), v = p(...m)(h);
66
+ return i.push(v), d;
67
+ }])
68
+ ),
69
+ run: l
70
+ };
71
+ return d;
72
+ }
73
+ createCan(e) {
74
+ const { rawCommands: t, state: n } = this, r = !1, o = e || n.tr, s = this.buildProps(o, r);
75
+ return {
76
+ ...Object.fromEntries(
77
+ Object.entries(t).map(([a, c]) => [a, (...l) => c(...l)({ ...s, dispatch: void 0 })])
78
+ ),
79
+ chain: () => this.createChain(o, r)
80
+ };
81
+ }
82
+ buildProps(e, t = !0) {
83
+ const { rawCommands: n, editor: r, state: o } = this, { view: s } = r, i = {
84
+ tr: e,
85
+ editor: r,
86
+ view: s,
87
+ state: X({
88
+ state: o,
89
+ transaction: e
90
+ }),
91
+ dispatch: t ? () => {
92
+ } : void 0,
93
+ chain: () => this.createChain(e, t),
94
+ can: () => this.createCan(e),
95
+ get commands() {
96
+ return Object.fromEntries(
97
+ Object.entries(n).map(([a, c]) => [a, (...l) => c(...l)(i)])
98
+ );
99
+ }
100
+ };
101
+ return i;
102
+ }
103
+ }, Le = class {
104
+ constructor() {
105
+ this.callbacks = {};
106
+ }
107
+ on(e, t) {
108
+ return this.callbacks[e] || (this.callbacks[e] = []), this.callbacks[e].push(t), this;
109
+ }
110
+ emit(e, ...t) {
111
+ const n = this.callbacks[e];
112
+ return n && n.forEach((r) => r.apply(this, t)), this;
113
+ }
114
+ off(e, t) {
115
+ const n = this.callbacks[e];
116
+ return n && (t ? this.callbacks[e] = n.filter((r) => r !== t) : delete this.callbacks[e]), this;
117
+ }
118
+ once(e, t) {
119
+ const n = (...r) => {
120
+ this.off(e, n), t.apply(this, r);
121
+ };
122
+ return this.on(e, n);
123
+ }
124
+ removeAllListeners() {
125
+ this.callbacks = {};
126
+ }
127
+ };
128
+ function ze(e, t) {
129
+ const n = new pe(e);
130
+ return t.forEach((r) => {
131
+ r.steps.forEach((o) => {
132
+ n.step(o);
133
+ });
134
+ }), n;
135
+ }
136
+ var Pt = (e) => {
137
+ const t = e.childNodes;
138
+ for (let n = t.length - 1; n >= 0; n -= 1) {
139
+ const r = t[n];
140
+ r.nodeType === 3 && r.nodeValue && /^(\n\s\s|\n)$/.test(r.nodeValue) ? e.removeChild(r) : r.nodeType === 1 && Pt(r);
141
+ }
142
+ return e;
143
+ };
144
+ function z(e) {
145
+ if (typeof window > "u")
146
+ throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");
147
+ const t = `<body>${e}</body>`, n = new window.DOMParser().parseFromString(t, "text/html").body;
148
+ return Pt(n);
149
+ }
150
+ function F(e, t, n) {
151
+ if (e instanceof le || e instanceof N)
152
+ return e;
153
+ n = {
154
+ slice: !0,
155
+ parseOptions: {},
156
+ ...n
157
+ };
158
+ const r = typeof e == "object" && e !== null, o = typeof e == "string";
159
+ if (r)
160
+ try {
161
+ if (Array.isArray(e) && e.length > 0)
162
+ return N.fromArray(e.map((a) => t.nodeFromJSON(a)));
163
+ const i = t.nodeFromJSON(e);
164
+ return n.errorOnInvalidContent && i.check(), i;
165
+ } catch (s) {
166
+ if (n.errorOnInvalidContent)
167
+ throw new Error("[tiptap error]: Invalid JSON content", { cause: s });
168
+ return console.warn("[tiptap warn]: Invalid content.", "Passed value:", e, "Error:", s), F("", t, n);
169
+ }
170
+ if (o) {
171
+ if (n.errorOnInvalidContent) {
172
+ let i = !1, a = "";
173
+ const c = new Tt({
174
+ topNode: t.spec.topNode,
175
+ marks: t.spec.marks,
176
+ // Prosemirror's schemas are executed such that: the last to execute, matches last
177
+ // This means that we can add a catch-all node at the end of the schema to catch any content that we don't know how to handle
178
+ nodes: t.spec.nodes.append({
179
+ __tiptap__private__unknown__catch__all__node: {
180
+ content: "inline*",
181
+ group: "block",
182
+ parseDOM: [
183
+ {
184
+ tag: "*",
185
+ getAttrs: (l) => (i = !0, a = typeof l == "string" ? l : l.outerHTML, null)
186
+ }
187
+ ]
188
+ }
189
+ })
190
+ });
191
+ if (n.slice ? nt.fromSchema(c).parseSlice(z(e), n.parseOptions) : nt.fromSchema(c).parse(z(e), n.parseOptions), n.errorOnInvalidContent && i)
192
+ throw new Error("[tiptap error]: Invalid HTML content", {
193
+ cause: new Error(`Invalid element found: ${a}`)
194
+ });
195
+ }
196
+ const s = nt.fromSchema(t);
197
+ return n.slice ? s.parseSlice(z(e), n.parseOptions).content : s.parse(z(e), n.parseOptions);
198
+ }
199
+ return F("", t, n);
200
+ }
201
+ function it(e, t, n = {}, r = {}) {
202
+ return F(e, t, {
203
+ slice: !1,
204
+ parseOptions: n,
205
+ errorOnInvalidContent: r.errorOnInvalidContent
206
+ });
207
+ }
208
+ function Ve(e) {
209
+ for (let t = 0; t < e.edgeCount; t += 1) {
210
+ const { type: n } = e.edge(t);
211
+ if (n.isTextblock && !n.hasRequiredAttrs())
212
+ return n;
213
+ }
214
+ return null;
215
+ }
216
+ function Br(e, t, n) {
217
+ const r = [];
218
+ return e.nodesBetween(t.from, t.to, (o, s) => {
219
+ n(o) && r.push({
220
+ node: o,
221
+ pos: s
222
+ });
223
+ }), r;
224
+ }
225
+ function He(e, t) {
226
+ for (let n = e.depth; n > 0; n -= 1) {
227
+ const r = e.node(n);
228
+ if (t(r))
229
+ return {
230
+ pos: n > 0 ? e.before(n) : 0,
231
+ start: e.start(n),
232
+ depth: n,
233
+ node: r
234
+ };
235
+ }
236
+ }
237
+ function Q(e) {
238
+ return (t) => He(t.$from, e);
239
+ }
240
+ function y(e, t, n) {
241
+ return e.config[t] === void 0 && e.parent ? y(e.parent, t, n) : typeof e.config[t] == "function" ? e.config[t].bind({
242
+ ...n,
243
+ parent: e.parent ? y(e.parent, t, n) : null
244
+ }) : e.config[t];
245
+ }
246
+ function lt(e) {
247
+ return e.map((t) => {
248
+ const n = {
249
+ name: t.name,
250
+ options: t.options,
251
+ storage: t.storage
252
+ }, r = y(t, "addExtensions", n);
253
+ return r ? [t, ...lt(r())] : t;
254
+ }).flat(10);
255
+ }
256
+ function ut(e, t) {
257
+ const n = ce.fromSchema(t).serializeFragment(e), o = document.implementation.createHTMLDocument().createElement("div");
258
+ return o.appendChild(n), o.innerHTML;
259
+ }
260
+ function $t(e) {
261
+ return typeof e == "function";
262
+ }
263
+ function w(e, t = void 0, ...n) {
264
+ return $t(e) ? t ? e.bind(t)(...n) : e(...n) : e;
265
+ }
266
+ function We(e = {}) {
267
+ return Object.keys(e).length === 0 && e.constructor === Object;
268
+ }
269
+ function _(e) {
270
+ const t = e.filter((o) => o.type === "extension"), n = e.filter((o) => o.type === "node"), r = e.filter((o) => o.type === "mark");
271
+ return {
272
+ baseExtensions: t,
273
+ nodeExtensions: n,
274
+ markExtensions: r
275
+ };
276
+ }
277
+ function It(e) {
278
+ const t = [], { nodeExtensions: n, markExtensions: r } = _(e), o = [...n, ...r], s = {
279
+ default: null,
280
+ validate: void 0,
281
+ rendered: !0,
282
+ renderHTML: null,
283
+ parseHTML: null,
284
+ keepOnSplit: !0,
285
+ isRequired: !1
286
+ };
287
+ return e.forEach((i) => {
288
+ const a = {
289
+ name: i.name,
290
+ options: i.options,
291
+ storage: i.storage,
292
+ extensions: o
293
+ }, c = y(
294
+ i,
295
+ "addGlobalAttributes",
296
+ a
297
+ );
298
+ if (!c)
299
+ return;
300
+ c().forEach((d) => {
301
+ d.types.forEach((u) => {
302
+ Object.entries(d.attributes).forEach(([p, f]) => {
303
+ t.push({
304
+ type: u,
305
+ name: p,
306
+ attribute: {
307
+ ...s,
308
+ ...f
309
+ }
310
+ });
311
+ });
312
+ });
313
+ });
314
+ }), o.forEach((i) => {
315
+ const a = {
316
+ name: i.name,
317
+ options: i.options,
318
+ storage: i.storage
319
+ }, c = y(
320
+ i,
321
+ "addAttributes",
322
+ a
323
+ );
324
+ if (!c)
325
+ return;
326
+ const l = c();
327
+ Object.entries(l).forEach(([d, u]) => {
328
+ const p = {
329
+ ...s,
330
+ ...u
331
+ };
332
+ typeof p?.default == "function" && (p.default = p.default()), p?.isRequired && p?.default === void 0 && delete p.default, t.push({
333
+ type: i.name,
334
+ name: d,
335
+ attribute: p
336
+ });
337
+ });
338
+ }), t;
339
+ }
340
+ function Ue(...e) {
341
+ return e.filter((t) => !!t).reduce((t, n) => {
342
+ const r = { ...t };
343
+ return Object.entries(n).forEach(([o, s]) => {
344
+ if (!r[o]) {
345
+ r[o] = s;
346
+ return;
347
+ }
348
+ if (o === "class") {
349
+ const a = s ? String(s).split(" ") : [], c = r[o] ? r[o].split(" ") : [], l = a.filter((d) => !c.includes(d));
350
+ r[o] = [...c, ...l].join(" ");
351
+ } else if (o === "style") {
352
+ const a = s ? s.split(";").map((d) => d.trim()).filter(Boolean) : [], c = r[o] ? r[o].split(";").map((d) => d.trim()).filter(Boolean) : [], l = /* @__PURE__ */ new Map();
353
+ c.forEach((d) => {
354
+ const [u, p] = d.split(":").map((f) => f.trim());
355
+ l.set(u, p);
356
+ }), a.forEach((d) => {
357
+ const [u, p] = d.split(":").map((f) => f.trim());
358
+ l.set(u, p);
359
+ }), r[o] = Array.from(l.entries()).map(([d, u]) => `${d}: ${u}`).join("; ");
360
+ } else
361
+ r[o] = s;
362
+ }), r;
363
+ }, {});
364
+ }
365
+ function K(e, t) {
366
+ return t.filter((n) => n.type === e.type.name).filter((n) => n.attribute.rendered).map((n) => n.attribute.renderHTML ? n.attribute.renderHTML(e.attrs) || {} : {
367
+ [n.name]: e.attrs[n.name]
368
+ }).reduce((n, r) => Ue(n, r), {});
369
+ }
370
+ function qe(e) {
371
+ return typeof e != "string" ? e : e.match(/^[+-]?(?:\d*\.)?\d+$/) ? Number(e) : e === "true" ? !0 : e === "false" ? !1 : e;
372
+ }
373
+ function bt(e, t) {
374
+ return "style" in e ? e : {
375
+ ...e,
376
+ getAttrs: (n) => {
377
+ const r = e.getAttrs ? e.getAttrs(n) : e.attrs;
378
+ if (r === !1)
379
+ return !1;
380
+ const o = t.reduce((s, i) => {
381
+ const a = i.attribute.parseHTML ? i.attribute.parseHTML(n) : qe(n.getAttribute(i.name));
382
+ return a == null ? s : {
383
+ ...s,
384
+ [i.name]: a
385
+ };
386
+ }, {});
387
+ return { ...r, ...o };
388
+ }
389
+ };
390
+ }
391
+ function kt(e) {
392
+ return Object.fromEntries(
393
+ // @ts-ignore
394
+ Object.entries(e).filter(([t, n]) => t === "attrs" && We(n) ? !1 : n != null)
395
+ );
396
+ }
397
+ function Ke(e, t) {
398
+ var n;
399
+ const r = It(e), { nodeExtensions: o, markExtensions: s } = _(e), i = (n = o.find((l) => y(l, "topNode"))) == null ? void 0 : n.name, a = Object.fromEntries(
400
+ o.map((l) => {
401
+ const d = r.filter((g) => g.type === l.name), u = {
402
+ name: l.name,
403
+ options: l.options,
404
+ storage: l.storage,
405
+ editor: t
406
+ }, p = e.reduce((g, b) => {
407
+ const k = y(b, "extendNodeSchema", u);
408
+ return {
409
+ ...g,
410
+ ...k ? k(l) : {}
411
+ };
412
+ }, {}), f = kt({
413
+ ...p,
414
+ content: w(y(l, "content", u)),
415
+ marks: w(y(l, "marks", u)),
416
+ group: w(y(l, "group", u)),
417
+ inline: w(y(l, "inline", u)),
418
+ atom: w(y(l, "atom", u)),
419
+ selectable: w(y(l, "selectable", u)),
420
+ draggable: w(y(l, "draggable", u)),
421
+ code: w(y(l, "code", u)),
422
+ whitespace: w(y(l, "whitespace", u)),
423
+ linebreakReplacement: w(
424
+ y(l, "linebreakReplacement", u)
425
+ ),
426
+ defining: w(y(l, "defining", u)),
427
+ isolating: w(y(l, "isolating", u)),
428
+ attrs: Object.fromEntries(
429
+ d.map((g) => {
430
+ var b, k;
431
+ return [
432
+ g.name,
433
+ { default: (b = g?.attribute) == null ? void 0 : b.default, validate: (k = g?.attribute) == null ? void 0 : k.validate }
434
+ ];
435
+ })
436
+ )
437
+ }), m = w(y(l, "parseHTML", u));
438
+ m && (f.parseDOM = m.map(
439
+ (g) => bt(g, d)
440
+ ));
441
+ const h = y(l, "renderHTML", u);
442
+ h && (f.toDOM = (g) => h({
443
+ node: g,
444
+ HTMLAttributes: K(g, d)
445
+ }));
446
+ const v = y(l, "renderText", u);
447
+ return v && (f.toText = v), [l.name, f];
448
+ })
449
+ ), c = Object.fromEntries(
450
+ s.map((l) => {
451
+ const d = r.filter((v) => v.type === l.name), u = {
452
+ name: l.name,
453
+ options: l.options,
454
+ storage: l.storage,
455
+ editor: t
456
+ }, p = e.reduce((v, g) => {
457
+ const b = y(g, "extendMarkSchema", u);
458
+ return {
459
+ ...v,
460
+ ...b ? b(l) : {}
461
+ };
462
+ }, {}), f = kt({
463
+ ...p,
464
+ inclusive: w(y(l, "inclusive", u)),
465
+ excludes: w(y(l, "excludes", u)),
466
+ group: w(y(l, "group", u)),
467
+ spanning: w(y(l, "spanning", u)),
468
+ code: w(y(l, "code", u)),
469
+ attrs: Object.fromEntries(
470
+ d.map((v) => {
471
+ var g, b;
472
+ return [
473
+ v.name,
474
+ { default: (g = v?.attribute) == null ? void 0 : g.default, validate: (b = v?.attribute) == null ? void 0 : b.validate }
475
+ ];
476
+ })
477
+ )
478
+ }), m = w(y(l, "parseHTML", u));
479
+ m && (f.parseDOM = m.map(
480
+ (v) => bt(v, d)
481
+ ));
482
+ const h = y(l, "renderHTML", u);
483
+ return h && (f.toDOM = (v) => h({
484
+ mark: v,
485
+ HTMLAttributes: K(v, d)
486
+ })), [l.name, f];
487
+ })
488
+ );
489
+ return new Tt({
490
+ topNode: i,
491
+ nodes: a,
492
+ marks: c
493
+ });
494
+ }
495
+ function Je(e) {
496
+ const t = e.filter((n, r) => e.indexOf(n) !== r);
497
+ return Array.from(new Set(t));
498
+ }
499
+ function dt(e) {
500
+ return e.sort((n, r) => {
501
+ const o = y(n, "priority") || 100, s = y(r, "priority") || 100;
502
+ return o > s ? -1 : o < s ? 1 : 0;
503
+ });
504
+ }
505
+ function Nt(e) {
506
+ const t = dt(lt(e)), n = Je(t.map((r) => r.name));
507
+ return n.length && console.warn(
508
+ `[tiptap warn]: Duplicate extension names found: [${n.map((r) => `'${r}'`).join(", ")}]. This can lead to issues.`
509
+ ), t;
510
+ }
511
+ function Ot(e, t, n) {
512
+ const { from: r, to: o } = t, { blockSeparator: s = `
513
+
514
+ `, textSerializers: i = {} } = n || {};
515
+ let a = "";
516
+ return e.nodesBetween(r, o, (c, l, d, u) => {
517
+ var p;
518
+ c.isBlock && l > r && (a += s);
519
+ const f = i?.[c.type.name];
520
+ if (f)
521
+ return d && (a += f({
522
+ node: c,
523
+ pos: l,
524
+ parent: d,
525
+ index: u,
526
+ range: t
527
+ })), !1;
528
+ c.isText && (a += (p = c?.text) == null ? void 0 : p.slice(Math.max(r, l) - l, o - l));
529
+ }), a;
530
+ }
531
+ function Ge(e, t) {
532
+ const n = {
533
+ from: 0,
534
+ to: e.content.size
535
+ };
536
+ return Ot(e, n, t);
537
+ }
538
+ function Bt(e) {
539
+ return Object.fromEntries(
540
+ Object.entries(e.nodes).filter(([, t]) => t.spec.toText).map(([t, n]) => [t, n.spec.toText])
541
+ );
542
+ }
543
+ function $(e, t) {
544
+ if (typeof e == "string") {
545
+ if (!t.marks[e])
546
+ throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);
547
+ return t.marks[e];
548
+ }
549
+ return e;
550
+ }
551
+ function jt(e, t) {
552
+ const n = $(t, e.schema), { from: r, to: o, empty: s } = e.selection, i = [];
553
+ s ? (e.storedMarks && i.push(...e.storedMarks), i.push(...e.selection.$head.marks())) : e.doc.nodesBetween(r, o, (c) => {
554
+ i.push(...c.marks);
555
+ });
556
+ const a = i.find((c) => c.type.name === n.name);
557
+ return a ? { ...a.attrs } : {};
558
+ }
559
+ function E(e, t) {
560
+ if (typeof e == "string") {
561
+ if (!t.nodes[e])
562
+ throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);
563
+ return t.nodes[e];
564
+ }
565
+ return e;
566
+ }
567
+ function Xe(e, t) {
568
+ const n = E(t, e.schema), { from: r, to: o } = e.selection, s = [];
569
+ e.doc.nodesBetween(r, o, (a) => {
570
+ s.push(a);
571
+ });
572
+ const i = s.reverse().find((a) => a.type.name === n.name);
573
+ return i ? { ...i.attrs } : {};
574
+ }
575
+ function Z(e, t) {
576
+ return t.nodes[e] ? "node" : t.marks[e] ? "mark" : null;
577
+ }
578
+ function Ye(e, t) {
579
+ const n = Z(
580
+ typeof t == "string" ? t : t.name,
581
+ e.schema
582
+ );
583
+ return n === "node" ? Xe(e, t) : n === "mark" ? jt(e, t) : {};
584
+ }
585
+ function Qe(e, t = JSON.stringify) {
586
+ const n = {};
587
+ return e.filter((r) => {
588
+ const o = t(r);
589
+ return Object.prototype.hasOwnProperty.call(n, o) ? !1 : n[o] = !0;
590
+ });
591
+ }
592
+ function Ze(e) {
593
+ const t = Qe(e);
594
+ return t.length === 1 ? t : t.filter((n, r) => !t.filter((s, i) => i !== r).some((s) => n.oldRange.from >= s.oldRange.from && n.oldRange.to <= s.oldRange.to && n.newRange.from >= s.newRange.from && n.newRange.to <= s.newRange.to));
595
+ }
596
+ function tn(e) {
597
+ const { mapping: t, steps: n } = e, r = [];
598
+ return t.maps.forEach((o, s) => {
599
+ const i = [];
600
+ if (o.ranges.length)
601
+ o.forEach((a, c) => {
602
+ i.push({ from: a, to: c });
603
+ });
604
+ else {
605
+ const { from: a, to: c } = n[s];
606
+ if (a === void 0 || c === void 0)
607
+ return;
608
+ i.push({ from: a, to: c });
609
+ }
610
+ i.forEach(({ from: a, to: c }) => {
611
+ const l = t.slice(s).map(a, -1), d = t.slice(s).map(c), u = t.invert().map(l, -1), p = t.invert().map(d);
612
+ r.push({
613
+ oldRange: {
614
+ from: u,
615
+ to: p
616
+ },
617
+ newRange: {
618
+ from: l,
619
+ to: d
620
+ }
621
+ });
622
+ });
623
+ }), Ze(r);
624
+ }
625
+ function ft(e) {
626
+ return Object.prototype.toString.call(e) === "[object RegExp]";
627
+ }
628
+ function J(e, t, n = { strict: !0 }) {
629
+ const r = Object.keys(t);
630
+ return r.length ? r.every((o) => n.strict ? t[o] === e[o] : ft(t[o]) ? t[o].test(e[o]) : t[o] === e[o]) : !0;
631
+ }
632
+ function Rt(e, t, n = {}) {
633
+ return e.find((r) => r.type === t && J(
634
+ // Only check equality for the attributes that are provided
635
+ Object.fromEntries(Object.keys(n).map((o) => [o, r.attrs[o]])),
636
+ n
637
+ ));
638
+ }
639
+ function wt(e, t, n = {}) {
640
+ return !!Rt(e, t, n);
641
+ }
642
+ function pt(e, t, n) {
643
+ var r;
644
+ if (!e || !t)
645
+ return;
646
+ let o = e.parent.childAfter(e.parentOffset);
647
+ if ((!o.node || !o.node.marks.some((d) => d.type === t)) && (o = e.parent.childBefore(e.parentOffset)), !o.node || !o.node.marks.some((d) => d.type === t) || (n = n || ((r = o.node.marks[0]) == null ? void 0 : r.attrs), !Rt([...o.node.marks], t, n)))
648
+ return;
649
+ let i = o.index, a = e.start() + o.offset, c = i + 1, l = a + o.node.nodeSize;
650
+ for (; i > 0 && wt([...e.parent.child(i - 1).marks], t, n); )
651
+ i -= 1, a -= e.parent.child(i).nodeSize;
652
+ for (; c < e.parent.childCount && wt([...e.parent.child(c).marks], t, n); )
653
+ l += e.parent.child(c).nodeSize, c += 1;
654
+ return {
655
+ from: a,
656
+ to: l
657
+ };
658
+ }
659
+ function Dt(e, t, n) {
660
+ const r = [];
661
+ return e === t ? n.resolve(e).marks().forEach((o) => {
662
+ const s = n.resolve(e), i = pt(s, o.type);
663
+ i && r.push({
664
+ mark: o,
665
+ ...i
666
+ });
667
+ }) : n.nodesBetween(e, t, (o, s) => {
668
+ !o || o?.nodeSize === void 0 || r.push(
669
+ ...o.marks.map((i) => ({
670
+ from: s,
671
+ to: s + o.nodeSize,
672
+ mark: i
673
+ }))
674
+ );
675
+ }), r;
676
+ }
677
+ var jr = (e, t, n, r = 20) => {
678
+ const o = e.doc.resolve(n);
679
+ let s = r, i = null;
680
+ for (; s > 0 && i === null; ) {
681
+ const a = o.node(s);
682
+ a?.type.name === t ? i = a : s -= 1;
683
+ }
684
+ return [i, s];
685
+ };
686
+ function rt(e, t) {
687
+ return t.nodes[e] || t.marks[e] || null;
688
+ }
689
+ function q(e, t, n) {
690
+ return Object.fromEntries(
691
+ Object.entries(n).filter(([r]) => {
692
+ const o = e.find((s) => s.type === t && s.name === r);
693
+ return o ? o.attribute.keepOnSplit : !1;
694
+ })
695
+ );
696
+ }
697
+ var en = (e, t = 500) => {
698
+ let n = "";
699
+ const r = e.parentOffset;
700
+ return e.parent.nodesBetween(Math.max(0, r - t), r, (o, s, i, a) => {
701
+ var c, l;
702
+ const d = ((l = (c = o.type.spec).toText) == null ? void 0 : l.call(c, {
703
+ node: o,
704
+ pos: s,
705
+ parent: i,
706
+ index: a
707
+ })) || o.textContent || "%leaf%";
708
+ n += o.isAtom && !o.isText ? d : d.slice(0, Math.max(0, r - s));
709
+ }), n;
710
+ };
711
+ function at(e, t, n = {}) {
712
+ const { empty: r, ranges: o } = e.selection, s = t ? $(t, e.schema) : null;
713
+ if (r)
714
+ return !!(e.storedMarks || e.selection.$from.marks()).filter((u) => s ? s.name === u.type.name : !0).find((u) => J(u.attrs, n, { strict: !1 }));
715
+ let i = 0;
716
+ const a = [];
717
+ if (o.forEach(({ $from: u, $to: p }) => {
718
+ const f = u.pos, m = p.pos;
719
+ e.doc.nodesBetween(f, m, (h, v) => {
720
+ if (!h.isText && !h.marks.length)
721
+ return;
722
+ const g = Math.max(f, v), b = Math.min(m, v + h.nodeSize), k = b - g;
723
+ i += k, a.push(
724
+ ...h.marks.map((S) => ({
725
+ mark: S,
726
+ from: g,
727
+ to: b
728
+ }))
729
+ );
730
+ });
731
+ }), i === 0)
732
+ return !1;
733
+ const c = a.filter((u) => s ? s.name === u.mark.type.name : !0).filter((u) => J(u.mark.attrs, n, { strict: !1 })).reduce((u, p) => u + p.to - p.from, 0), l = a.filter((u) => s ? u.mark.type !== s && u.mark.type.excludes(s) : !0).reduce((u, p) => u + p.to - p.from, 0);
734
+ return (c > 0 ? c + l : c) >= i;
735
+ }
736
+ function L(e, t, n = {}) {
737
+ const { from: r, to: o, empty: s } = e.selection, i = t ? E(t, e.schema) : null, a = [];
738
+ e.doc.nodesBetween(r, o, (u, p) => {
739
+ if (u.isText)
740
+ return;
741
+ const f = Math.max(r, p), m = Math.min(o, p + u.nodeSize);
742
+ a.push({
743
+ node: u,
744
+ from: f,
745
+ to: m
746
+ });
747
+ });
748
+ const c = o - r, l = a.filter((u) => i ? i.name === u.node.type.name : !0).filter((u) => J(u.node.attrs, n, { strict: !1 }));
749
+ return s ? !!l.length : l.reduce((u, p) => u + p.to - p.from, 0) >= c;
750
+ }
751
+ function nn(e, t, n = {}) {
752
+ if (!t)
753
+ return L(e, null, n) || at(e, null, n);
754
+ const r = Z(t, e.schema);
755
+ return r === "node" ? L(e, t, n) : r === "mark" ? at(e, t, n) : !1;
756
+ }
757
+ var Rr = (e, t) => {
758
+ const { $from: n, $to: r, $anchor: o } = e.selection;
759
+ if (t) {
760
+ const s = Q((a) => a.type.name === t)(e.selection);
761
+ if (!s)
762
+ return !1;
763
+ const i = e.doc.resolve(s.pos + 1);
764
+ return o.pos + 1 === i.end();
765
+ }
766
+ return !(r.parentOffset < r.parent.nodeSize - 2 || n.pos !== r.pos);
767
+ }, Dr = (e) => {
768
+ const { $from: t, $to: n } = e.selection;
769
+ return !(t.parentOffset > 0 || t.pos !== n.pos);
770
+ };
771
+ function Mt(e, t) {
772
+ return Array.isArray(t) ? t.some((n) => (typeof n == "string" ? n : n.name) === e.name) : t;
773
+ }
774
+ function St(e, t) {
775
+ const { nodeExtensions: n } = _(t), r = n.find((i) => i.name === e);
776
+ if (!r)
777
+ return !1;
778
+ const o = {
779
+ name: r.name,
780
+ options: r.options,
781
+ storage: r.storage
782
+ }, s = w(y(r, "group", o));
783
+ return typeof s != "string" ? !1 : s.split(" ").includes("list");
784
+ }
785
+ function mt(e, {
786
+ checkChildren: t = !0,
787
+ ignoreWhitespace: n = !1
788
+ } = {}) {
789
+ var r;
790
+ if (n) {
791
+ if (e.type.name === "hardBreak")
792
+ return !0;
793
+ if (e.isText)
794
+ return /^\s*$/m.test((r = e.text) != null ? r : "");
795
+ }
796
+ if (e.isText)
797
+ return !e.text;
798
+ if (e.isAtom || e.isLeaf)
799
+ return !1;
800
+ if (e.content.childCount === 0)
801
+ return !0;
802
+ if (t) {
803
+ let o = !0;
804
+ return e.content.forEach((s) => {
805
+ o !== !1 && (mt(s, { ignoreWhitespace: n, checkChildren: t }) || (o = !1));
806
+ }), o;
807
+ }
808
+ return !1;
809
+ }
810
+ function Fr(e) {
811
+ return e instanceof G;
812
+ }
813
+ function Ft(e) {
814
+ return e instanceof A;
815
+ }
816
+ function O(e = 0, t = 0, n = 0) {
817
+ return Math.min(Math.max(e, t), n);
818
+ }
819
+ function _t(e, t = null) {
820
+ if (!t)
821
+ return null;
822
+ const n = D.atStart(e), r = D.atEnd(e);
823
+ if (t === "start" || t === !0)
824
+ return n;
825
+ if (t === "end")
826
+ return r;
827
+ const o = n.from, s = r.to;
828
+ return t === "all" ? A.create(e, O(0, o, s), O(e.content.size, o, s)) : A.create(e, O(t, o, s), O(t, o, s));
829
+ }
830
+ function rn(e, t, n) {
831
+ const r = e.steps.length - 1;
832
+ if (r < t)
833
+ return;
834
+ const o = e.steps[r];
835
+ if (!(o instanceof ge || o instanceof ve))
836
+ return;
837
+ const s = e.mapping.maps[r];
838
+ let i = 0;
839
+ s.forEach((a, c, l, d) => {
840
+ i === 0 && (i = d);
841
+ }), e.setSelection(D.near(e.doc.resolve(i), n));
842
+ }
843
+ var tt = class {
844
+ constructor(e) {
845
+ this.find = e.find, this.handler = e.handler;
846
+ }
847
+ }, on = (e, t) => {
848
+ if (ft(t))
849
+ return t.exec(e);
850
+ const n = t(e);
851
+ if (!n)
852
+ return null;
853
+ const r = [n.text];
854
+ return r.index = n.index, r.input = e, r.data = n.data, n.replaceWith && (n.text.includes(n.replaceWith) || console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'), r.push(n.replaceWith)), r;
855
+ };
856
+ function V(e) {
857
+ var t;
858
+ const { editor: n, from: r, to: o, text: s, rules: i, plugin: a } = e, { view: c } = n;
859
+ if (c.composing)
860
+ return !1;
861
+ const l = c.state.doc.resolve(r);
862
+ if (
863
+ // check for code node
864
+ l.parent.type.spec.code || (t = l.nodeBefore || l.nodeAfter) != null && t.marks.find((p) => p.type.spec.code)
865
+ )
866
+ return !1;
867
+ let d = !1;
868
+ const u = en(l) + s;
869
+ return i.forEach((p) => {
870
+ if (d)
871
+ return;
872
+ const f = on(u, p.find);
873
+ if (!f)
874
+ return;
875
+ const m = c.state.tr, h = X({
876
+ state: c.state,
877
+ transaction: m
878
+ }), v = {
879
+ from: r - (f[0].length - s.length),
880
+ to: o
881
+ }, { commands: g, chain: b, can: k } = new Y({
882
+ editor: n,
883
+ state: h
884
+ });
885
+ p.handler({
886
+ state: h,
887
+ range: v,
888
+ match: f,
889
+ commands: g,
890
+ chain: b,
891
+ can: k
892
+ }) === null || !m.steps.length || (m.setMeta(a, {
893
+ transform: m,
894
+ from: r,
895
+ to: o,
896
+ text: s
897
+ }), c.dispatch(m), d = !0);
898
+ }), d;
899
+ }
900
+ function sn(e) {
901
+ const { editor: t, rules: n } = e, r = new P({
902
+ state: {
903
+ init() {
904
+ return null;
905
+ },
906
+ apply(o, s, i) {
907
+ const a = o.getMeta(r);
908
+ if (a)
909
+ return a;
910
+ const c = o.getMeta("applyInputRules");
911
+ return !!c && setTimeout(() => {
912
+ let { text: d } = c;
913
+ typeof d == "string" ? d = d : d = ut(N.from(d), i.schema);
914
+ const { from: u } = c, p = u + d.length;
915
+ V({
916
+ editor: t,
917
+ from: u,
918
+ to: p,
919
+ text: d,
920
+ rules: n,
921
+ plugin: r
922
+ });
923
+ }), o.selectionSet || o.docChanged ? null : s;
924
+ }
925
+ },
926
+ props: {
927
+ handleTextInput(o, s, i, a) {
928
+ return V({
929
+ editor: t,
930
+ from: s,
931
+ to: i,
932
+ text: a,
933
+ rules: n,
934
+ plugin: r
935
+ });
936
+ },
937
+ handleDOMEvents: {
938
+ compositionend: (o) => (setTimeout(() => {
939
+ const { $cursor: s } = o.state.selection;
940
+ s && V({
941
+ editor: t,
942
+ from: s.pos,
943
+ to: s.pos,
944
+ text: "",
945
+ rules: n,
946
+ plugin: r
947
+ });
948
+ }), !1)
949
+ },
950
+ // add support for input rules to trigger on enter
951
+ // this is useful for example for code blocks
952
+ handleKeyDown(o, s) {
953
+ if (s.key !== "Enter")
954
+ return !1;
955
+ const { $cursor: i } = o.state.selection;
956
+ return i ? V({
957
+ editor: t,
958
+ from: i.pos,
959
+ to: i.pos,
960
+ text: `
961
+ `,
962
+ rules: n,
963
+ plugin: r
964
+ }) : !1;
965
+ }
966
+ },
967
+ // @ts-ignore
968
+ isInputRules: !0
969
+ });
970
+ return r;
971
+ }
972
+ function an(e) {
973
+ return Object.prototype.toString.call(e).slice(8, -1);
974
+ }
975
+ function H(e) {
976
+ return an(e) !== "Object" ? !1 : e.constructor === Object && Object.getPrototypeOf(e) === Object.prototype;
977
+ }
978
+ function Lt(e, t) {
979
+ const n = { ...e };
980
+ return H(e) && H(t) && Object.keys(t).forEach((r) => {
981
+ H(t[r]) && H(e[r]) ? n[r] = Lt(e[r], t[r]) : n[r] = t[r];
982
+ }), n;
983
+ }
984
+ var ht = class {
985
+ constructor(e = {}) {
986
+ this.type = "extendable", this.parent = null, this.child = null, this.name = "", this.config = {
987
+ name: this.name
988
+ }, this.config = {
989
+ ...this.config,
990
+ ...e
991
+ }, this.name = this.config.name;
992
+ }
993
+ get options() {
994
+ return {
995
+ ...w(
996
+ y(this, "addOptions", {
997
+ name: this.name
998
+ })
999
+ ) || {}
1000
+ };
1001
+ }
1002
+ get storage() {
1003
+ return {
1004
+ ...w(
1005
+ y(this, "addStorage", {
1006
+ name: this.name,
1007
+ options: this.options
1008
+ })
1009
+ ) || {}
1010
+ };
1011
+ }
1012
+ configure(e = {}) {
1013
+ const t = this.extend({
1014
+ ...this.config,
1015
+ addOptions: () => Lt(this.options, e)
1016
+ });
1017
+ return t.name = this.name, t.parent = this.parent, t;
1018
+ }
1019
+ extend(e = {}) {
1020
+ const t = new this.constructor({ ...this.config, ...e });
1021
+ return t.parent = this, this.child = t, t.name = "name" in e ? e.name : t.parent.name, t;
1022
+ }
1023
+ }, cn = class zt extends ht {
1024
+ constructor() {
1025
+ super(...arguments), this.type = "mark";
1026
+ }
1027
+ /**
1028
+ * Create a new Mark instance
1029
+ * @param config - Mark configuration object or a function that returns a configuration object
1030
+ */
1031
+ static create(t = {}) {
1032
+ const n = typeof t == "function" ? t() : t;
1033
+ return new zt(n);
1034
+ }
1035
+ static handleExit({ editor: t, mark: n }) {
1036
+ const { tr: r } = t.state, o = t.state.selection.$from;
1037
+ if (o.pos === o.end()) {
1038
+ const i = o.marks();
1039
+ if (!!!i.find((l) => l?.type.name === n.name))
1040
+ return !1;
1041
+ const c = i.find((l) => l?.type.name === n.name);
1042
+ return c && r.removeStoredMark(c), r.insertText(" ", o.pos), t.view.dispatch(r), !0;
1043
+ }
1044
+ return !1;
1045
+ }
1046
+ configure(t) {
1047
+ return super.configure(t);
1048
+ }
1049
+ extend(t) {
1050
+ const n = typeof t == "function" ? t() : t;
1051
+ return super.extend(n);
1052
+ }
1053
+ };
1054
+ function ln(e) {
1055
+ return typeof e == "number";
1056
+ }
1057
+ var un = class {
1058
+ constructor(e) {
1059
+ this.find = e.find, this.handler = e.handler;
1060
+ }
1061
+ }, dn = (e, t, n) => {
1062
+ if (ft(t))
1063
+ return [...e.matchAll(t)];
1064
+ const r = t(e, n);
1065
+ return r ? r.map((o) => {
1066
+ const s = [o.text];
1067
+ return s.index = o.index, s.input = e, s.data = o.data, o.replaceWith && (o.text.includes(o.replaceWith) || console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'), s.push(o.replaceWith)), s;
1068
+ }) : [];
1069
+ };
1070
+ function fn(e) {
1071
+ const { editor: t, state: n, from: r, to: o, rule: s, pasteEvent: i, dropEvent: a } = e, { commands: c, chain: l, can: d } = new Y({
1072
+ editor: t,
1073
+ state: n
1074
+ }), u = [];
1075
+ return n.doc.nodesBetween(r, o, (f, m) => {
1076
+ var h, v, g, b, k;
1077
+ if ((v = (h = f.type) == null ? void 0 : h.spec) != null && v.code || !(f.isText || f.isTextblock || f.isInline))
1078
+ return;
1079
+ const S = (k = (b = (g = f.content) == null ? void 0 : g.size) != null ? b : f.nodeSize) != null ? k : 0, M = Math.max(r, m), x = Math.min(o, m + S);
1080
+ if (M >= x)
1081
+ return;
1082
+ const T = f.isText ? f.text || "" : f.textBetween(M - m, x - m, void 0, "");
1083
+ dn(T, s.find, i).forEach((j) => {
1084
+ if (j.index === void 0)
1085
+ return;
1086
+ const vt = M + j.index + 1, ne = vt + j[0].length, re = {
1087
+ from: n.tr.mapping.map(vt),
1088
+ to: n.tr.mapping.map(ne)
1089
+ }, oe = s.handler({
1090
+ state: n,
1091
+ range: re,
1092
+ match: j,
1093
+ commands: c,
1094
+ chain: l,
1095
+ can: d,
1096
+ pasteEvent: i,
1097
+ dropEvent: a
1098
+ });
1099
+ u.push(oe);
1100
+ });
1101
+ }), u.every((f) => f !== null);
1102
+ }
1103
+ var W = null, pn = (e) => {
1104
+ var t;
1105
+ const n = new ClipboardEvent("paste", {
1106
+ clipboardData: new DataTransfer()
1107
+ });
1108
+ return (t = n.clipboardData) == null || t.setData("text/html", e), n;
1109
+ };
1110
+ function mn(e) {
1111
+ const { editor: t, rules: n } = e;
1112
+ let r = null, o = !1, s = !1, i = typeof ClipboardEvent < "u" ? new ClipboardEvent("paste") : null, a;
1113
+ try {
1114
+ a = typeof DragEvent < "u" ? new DragEvent("drop") : null;
1115
+ } catch {
1116
+ a = null;
1117
+ }
1118
+ const c = ({
1119
+ state: d,
1120
+ from: u,
1121
+ to: p,
1122
+ rule: f,
1123
+ pasteEvt: m
1124
+ }) => {
1125
+ const h = d.tr, v = X({
1126
+ state: d,
1127
+ transaction: h
1128
+ });
1129
+ if (!(!fn({
1130
+ editor: t,
1131
+ state: v,
1132
+ from: Math.max(u - 1, 0),
1133
+ to: p.b - 1,
1134
+ rule: f,
1135
+ pasteEvent: m,
1136
+ dropEvent: a
1137
+ }) || !h.steps.length)) {
1138
+ try {
1139
+ a = typeof DragEvent < "u" ? new DragEvent("drop") : null;
1140
+ } catch {
1141
+ a = null;
1142
+ }
1143
+ return i = typeof ClipboardEvent < "u" ? new ClipboardEvent("paste") : null, h;
1144
+ }
1145
+ };
1146
+ return n.map((d) => new P({
1147
+ // we register a global drag handler to track the current drag source element
1148
+ view(u) {
1149
+ const p = (m) => {
1150
+ var h;
1151
+ r = (h = u.dom.parentElement) != null && h.contains(m.target) ? u.dom.parentElement : null, r && (W = t);
1152
+ }, f = () => {
1153
+ W && (W = null);
1154
+ };
1155
+ return window.addEventListener("dragstart", p), window.addEventListener("dragend", f), {
1156
+ destroy() {
1157
+ window.removeEventListener("dragstart", p), window.removeEventListener("dragend", f);
1158
+ }
1159
+ };
1160
+ },
1161
+ props: {
1162
+ handleDOMEvents: {
1163
+ drop: (u, p) => {
1164
+ if (s = r === u.dom.parentElement, a = p, !s) {
1165
+ const f = W;
1166
+ f?.isEditable && setTimeout(() => {
1167
+ const m = f.state.selection;
1168
+ m && f.commands.deleteRange({ from: m.from, to: m.to });
1169
+ }, 10);
1170
+ }
1171
+ return !1;
1172
+ },
1173
+ paste: (u, p) => {
1174
+ var f;
1175
+ const m = (f = p.clipboardData) == null ? void 0 : f.getData("text/html");
1176
+ return i = p, o = !!m?.includes("data-pm-slice"), !1;
1177
+ }
1178
+ }
1179
+ },
1180
+ appendTransaction: (u, p, f) => {
1181
+ const m = u[0], h = m.getMeta("uiEvent") === "paste" && !o, v = m.getMeta("uiEvent") === "drop" && !s, g = m.getMeta("applyPasteRules"), b = !!g;
1182
+ if (!h && !v && !b)
1183
+ return;
1184
+ if (b) {
1185
+ let { text: M } = g;
1186
+ typeof M == "string" ? M = M : M = ut(N.from(M), f.schema);
1187
+ const { from: x } = g, T = x + M.length, C = pn(M);
1188
+ return c({
1189
+ rule: d,
1190
+ state: f,
1191
+ from: x,
1192
+ to: { b: T },
1193
+ pasteEvt: C
1194
+ });
1195
+ }
1196
+ const k = p.doc.content.findDiffStart(f.doc.content), S = p.doc.content.findDiffEnd(f.doc.content);
1197
+ if (!(!ln(k) || !S || k === S.b))
1198
+ return c({
1199
+ rule: d,
1200
+ state: f,
1201
+ from: k,
1202
+ to: S,
1203
+ pasteEvt: i
1204
+ });
1205
+ }
1206
+ }));
1207
+ }
1208
+ var et = class {
1209
+ constructor(e, t) {
1210
+ this.splittableMarks = [], this.editor = t, this.extensions = Nt(e), this.schema = Ke(this.extensions, t), this.setupExtensions();
1211
+ }
1212
+ /**
1213
+ * Get all commands from the extensions.
1214
+ * @returns An object with all commands where the key is the command name and the value is the command function
1215
+ */
1216
+ get commands() {
1217
+ return this.extensions.reduce((e, t) => {
1218
+ const n = {
1219
+ name: t.name,
1220
+ options: t.options,
1221
+ storage: this.editor.extensionStorage[t.name],
1222
+ editor: this.editor,
1223
+ type: rt(t.name, this.schema)
1224
+ }, r = y(t, "addCommands", n);
1225
+ return r ? {
1226
+ ...e,
1227
+ ...r()
1228
+ } : e;
1229
+ }, {});
1230
+ }
1231
+ /**
1232
+ * Get all registered Prosemirror plugins from the extensions.
1233
+ * @returns An array of Prosemirror plugins
1234
+ */
1235
+ get plugins() {
1236
+ const { editor: e } = this;
1237
+ return dt([...this.extensions].reverse()).map((r) => {
1238
+ const o = {
1239
+ name: r.name,
1240
+ options: r.options,
1241
+ storage: this.editor.extensionStorage[r.name],
1242
+ editor: e,
1243
+ type: rt(r.name, this.schema)
1244
+ }, s = [], i = y(
1245
+ r,
1246
+ "addKeyboardShortcuts",
1247
+ o
1248
+ );
1249
+ let a = {};
1250
+ if (r.type === "mark" && y(r, "exitable", o) && (a.ArrowRight = () => cn.handleExit({ editor: e, mark: r })), i) {
1251
+ const p = Object.fromEntries(
1252
+ Object.entries(i()).map(([f, m]) => [f, () => m({ editor: e })])
1253
+ );
1254
+ a = { ...a, ...p };
1255
+ }
1256
+ const c = de(a);
1257
+ s.push(c);
1258
+ const l = y(r, "addInputRules", o);
1259
+ if (Mt(r, e.options.enableInputRules) && l) {
1260
+ const p = l();
1261
+ if (p && p.length) {
1262
+ const f = sn({
1263
+ editor: e,
1264
+ rules: p
1265
+ }), m = Array.isArray(f) ? f : [f];
1266
+ s.push(...m);
1267
+ }
1268
+ }
1269
+ const d = y(r, "addPasteRules", o);
1270
+ if (Mt(r, e.options.enablePasteRules) && d) {
1271
+ const p = d();
1272
+ if (p && p.length) {
1273
+ const f = mn({ editor: e, rules: p });
1274
+ s.push(...f);
1275
+ }
1276
+ }
1277
+ const u = y(
1278
+ r,
1279
+ "addProseMirrorPlugins",
1280
+ o
1281
+ );
1282
+ if (u) {
1283
+ const p = u();
1284
+ s.push(...p);
1285
+ }
1286
+ return s;
1287
+ }).flat();
1288
+ }
1289
+ /**
1290
+ * Get all attributes from the extensions.
1291
+ * @returns An array of attributes
1292
+ */
1293
+ get attributes() {
1294
+ return It(this.extensions);
1295
+ }
1296
+ /**
1297
+ * Get all node views from the extensions.
1298
+ * @returns An object with all node views where the key is the node name and the value is the node view function
1299
+ */
1300
+ get nodeViews() {
1301
+ const { editor: e } = this, { nodeExtensions: t } = _(this.extensions);
1302
+ return Object.fromEntries(
1303
+ t.filter((n) => !!y(n, "addNodeView")).map((n) => {
1304
+ const r = this.attributes.filter((a) => a.type === n.name), o = {
1305
+ name: n.name,
1306
+ options: n.options,
1307
+ storage: this.editor.extensionStorage[n.name],
1308
+ editor: e,
1309
+ type: E(n.name, this.schema)
1310
+ }, s = y(n, "addNodeView", o);
1311
+ if (!s)
1312
+ return [];
1313
+ const i = (a, c, l, d, u) => {
1314
+ const p = K(a, r);
1315
+ return s()({
1316
+ // pass-through
1317
+ node: a,
1318
+ view: c,
1319
+ getPos: l,
1320
+ decorations: d,
1321
+ innerDecorations: u,
1322
+ // tiptap-specific
1323
+ editor: e,
1324
+ extension: n,
1325
+ HTMLAttributes: p
1326
+ });
1327
+ };
1328
+ return [n.name, i];
1329
+ })
1330
+ );
1331
+ }
1332
+ get markViews() {
1333
+ const { editor: e } = this, { markExtensions: t } = _(this.extensions);
1334
+ return Object.fromEntries(
1335
+ t.filter((n) => !!y(n, "addMarkView")).map((n) => {
1336
+ const r = this.attributes.filter((a) => a.type === n.name), o = {
1337
+ name: n.name,
1338
+ options: n.options,
1339
+ storage: this.editor.extensionStorage[n.name],
1340
+ editor: e,
1341
+ type: $(n.name, this.schema)
1342
+ }, s = y(n, "addMarkView", o);
1343
+ if (!s)
1344
+ return [];
1345
+ const i = (a, c, l) => {
1346
+ const d = K(a, r);
1347
+ return s()({
1348
+ // pass-through
1349
+ mark: a,
1350
+ view: c,
1351
+ inline: l,
1352
+ // tiptap-specific
1353
+ editor: e,
1354
+ extension: n,
1355
+ HTMLAttributes: d,
1356
+ updateAttributes: (u) => {
1357
+ Cr(a, e, u);
1358
+ }
1359
+ });
1360
+ };
1361
+ return [n.name, i];
1362
+ })
1363
+ );
1364
+ }
1365
+ /**
1366
+ * Go through all extensions, create extension storages & setup marks
1367
+ * & bind editor event listener.
1368
+ */
1369
+ setupExtensions() {
1370
+ const e = this.extensions;
1371
+ this.editor.extensionStorage = Object.fromEntries(
1372
+ e.map((t) => [t.name, t.storage])
1373
+ ), e.forEach((t) => {
1374
+ var n;
1375
+ const r = {
1376
+ name: t.name,
1377
+ options: t.options,
1378
+ storage: this.editor.extensionStorage[t.name],
1379
+ editor: this.editor,
1380
+ type: rt(t.name, this.schema)
1381
+ };
1382
+ t.type === "mark" && ((n = w(y(t, "keepOnSplit", r))) == null || n) && this.splittableMarks.push(t.name);
1383
+ const o = y(t, "onBeforeCreate", r), s = y(t, "onCreate", r), i = y(t, "onUpdate", r), a = y(
1384
+ t,
1385
+ "onSelectionUpdate",
1386
+ r
1387
+ ), c = y(t, "onTransaction", r), l = y(t, "onFocus", r), d = y(t, "onBlur", r), u = y(t, "onDestroy", r);
1388
+ o && this.editor.on("beforeCreate", o), s && this.editor.on("create", s), i && this.editor.on("update", i), a && this.editor.on("selectionUpdate", a), c && this.editor.on("transaction", c), l && this.editor.on("focus", l), d && this.editor.on("blur", d), u && this.editor.on("destroy", u);
1389
+ });
1390
+ }
1391
+ };
1392
+ et.resolve = Nt;
1393
+ et.sort = dt;
1394
+ et.flatten = lt;
1395
+ var hn = {};
1396
+ At(hn, {
1397
+ ClipboardTextSerializer: () => Ht,
1398
+ Commands: () => qt,
1399
+ Delete: () => Kt,
1400
+ Drop: () => Jt,
1401
+ Editable: () => Gt,
1402
+ FocusEvents: () => Yt,
1403
+ Keymap: () => Qt,
1404
+ Paste: () => Zt,
1405
+ Tabindex: () => te,
1406
+ focusEventsPluginKey: () => Xt
1407
+ });
1408
+ var I = class Vt extends ht {
1409
+ constructor() {
1410
+ super(...arguments), this.type = "extension";
1411
+ }
1412
+ /**
1413
+ * Create a new Extension instance
1414
+ * @param config - Extension configuration object or a function that returns a configuration object
1415
+ */
1416
+ static create(t = {}) {
1417
+ const n = typeof t == "function" ? t() : t;
1418
+ return new Vt(n);
1419
+ }
1420
+ configure(t) {
1421
+ return super.configure(t);
1422
+ }
1423
+ extend(t) {
1424
+ const n = typeof t == "function" ? t() : t;
1425
+ return super.extend(n);
1426
+ }
1427
+ }, Ht = I.create({
1428
+ name: "clipboardTextSerializer",
1429
+ addOptions() {
1430
+ return {
1431
+ blockSeparator: void 0
1432
+ };
1433
+ },
1434
+ addProseMirrorPlugins() {
1435
+ return [
1436
+ new P({
1437
+ key: new B("clipboardTextSerializer"),
1438
+ props: {
1439
+ clipboardTextSerializer: () => {
1440
+ const { editor: e } = this, { state: t, schema: n } = e, { doc: r, selection: o } = t, { ranges: s } = o, i = Math.min(...s.map((d) => d.$from.pos)), a = Math.max(...s.map((d) => d.$to.pos)), c = Bt(n);
1441
+ return Ot(r, { from: i, to: a }, {
1442
+ ...this.options.blockSeparator !== void 0 ? { blockSeparator: this.options.blockSeparator } : {},
1443
+ textSerializers: c
1444
+ });
1445
+ }
1446
+ }
1447
+ })
1448
+ ];
1449
+ }
1450
+ }), Wt = {};
1451
+ At(Wt, {
1452
+ blur: () => gn,
1453
+ clearContent: () => vn,
1454
+ clearNodes: () => yn,
1455
+ command: () => bn,
1456
+ createParagraphNear: () => kn,
1457
+ cut: () => wn,
1458
+ deleteCurrentNode: () => Mn,
1459
+ deleteNode: () => Sn,
1460
+ deleteRange: () => En,
1461
+ deleteSelection: () => xn,
1462
+ enter: () => Tn,
1463
+ exitCode: () => Cn,
1464
+ extendMarkRange: () => An,
1465
+ first: () => Pn,
1466
+ focus: () => In,
1467
+ forEach: () => Nn,
1468
+ insertContent: () => On,
1469
+ insertContentAt: () => jn,
1470
+ joinBackward: () => Fn,
1471
+ joinDown: () => Dn,
1472
+ joinForward: () => _n,
1473
+ joinItemBackward: () => Ln,
1474
+ joinItemForward: () => zn,
1475
+ joinTextblockBackward: () => Vn,
1476
+ joinTextblockForward: () => Hn,
1477
+ joinUp: () => Rn,
1478
+ keyboardShortcut: () => Un,
1479
+ lift: () => qn,
1480
+ liftEmptyBlock: () => Kn,
1481
+ liftListItem: () => Jn,
1482
+ newlineInCode: () => Gn,
1483
+ resetAttributes: () => Xn,
1484
+ scrollIntoView: () => Yn,
1485
+ selectAll: () => Qn,
1486
+ selectNodeBackward: () => Zn,
1487
+ selectNodeForward: () => tr,
1488
+ selectParentNode: () => er,
1489
+ selectTextblockEnd: () => nr,
1490
+ selectTextblockStart: () => rr,
1491
+ setContent: () => or,
1492
+ setMark: () => ir,
1493
+ setMeta: () => ar,
1494
+ setNode: () => cr,
1495
+ setNodeSelection: () => lr,
1496
+ setTextSelection: () => ur,
1497
+ sinkListItem: () => dr,
1498
+ splitBlock: () => fr,
1499
+ splitListItem: () => pr,
1500
+ toggleList: () => mr,
1501
+ toggleMark: () => hr,
1502
+ toggleNode: () => gr,
1503
+ toggleWrap: () => vr,
1504
+ undoInputRule: () => yr,
1505
+ unsetAllMarks: () => br,
1506
+ unsetMark: () => kr,
1507
+ updateAttributes: () => wr,
1508
+ wrapIn: () => Mr,
1509
+ wrapInList: () => Sr
1510
+ });
1511
+ var gn = () => ({ editor: e, view: t }) => (requestAnimationFrame(() => {
1512
+ var n;
1513
+ e.isDestroyed || (t.dom.blur(), (n = window?.getSelection()) == null || n.removeAllRanges());
1514
+ }), !0), vn = (e = !0) => ({ commands: t }) => t.setContent("", { emitUpdate: e }), yn = () => ({ state: e, tr: t, dispatch: n }) => {
1515
+ const { selection: r } = t, { ranges: o } = r;
1516
+ return n && o.forEach(({ $from: s, $to: i }) => {
1517
+ e.doc.nodesBetween(s.pos, i.pos, (a, c) => {
1518
+ if (a.type.isText)
1519
+ return;
1520
+ const { doc: l, mapping: d } = t, u = l.resolve(d.map(c)), p = l.resolve(d.map(c + a.nodeSize)), f = u.blockRange(p);
1521
+ if (!f)
1522
+ return;
1523
+ const m = he(f);
1524
+ if (a.type.isTextblock) {
1525
+ const { defaultType: h } = u.parent.contentMatchAt(u.index());
1526
+ t.setNodeMarkup(f.start, h);
1527
+ }
1528
+ (m || m === 0) && t.lift(f, m);
1529
+ });
1530
+ }), !0;
1531
+ }, bn = (e) => (t) => e(t), kn = () => ({ state: e, dispatch: t }) => ye(e, t), wn = (e, t) => ({ editor: n, tr: r }) => {
1532
+ const { state: o } = n, s = o.doc.slice(e.from, e.to);
1533
+ r.deleteRange(e.from, e.to);
1534
+ const i = r.mapping.map(t);
1535
+ return r.insert(i, s.content), r.setSelection(new A(r.doc.resolve(Math.max(i - 1, 0)))), !0;
1536
+ }, Mn = () => ({ tr: e, dispatch: t }) => {
1537
+ const { selection: n } = e, r = n.$anchor.node();
1538
+ if (r.content.size > 0)
1539
+ return !1;
1540
+ const o = e.selection.$anchor;
1541
+ for (let s = o.depth; s > 0; s -= 1)
1542
+ if (o.node(s).type === r.type) {
1543
+ if (t) {
1544
+ const a = o.before(s), c = o.after(s);
1545
+ e.delete(a, c).scrollIntoView();
1546
+ }
1547
+ return !0;
1548
+ }
1549
+ return !1;
1550
+ }, Sn = (e) => ({ tr: t, state: n, dispatch: r }) => {
1551
+ const o = E(e, n.schema), s = t.selection.$anchor;
1552
+ for (let i = s.depth; i > 0; i -= 1)
1553
+ if (s.node(i).type === o) {
1554
+ if (r) {
1555
+ const c = s.before(i), l = s.after(i);
1556
+ t.delete(c, l).scrollIntoView();
1557
+ }
1558
+ return !0;
1559
+ }
1560
+ return !1;
1561
+ }, En = (e) => ({ tr: t, dispatch: n }) => {
1562
+ const { from: r, to: o } = e;
1563
+ return n && t.delete(r, o), !0;
1564
+ }, xn = () => ({ state: e, dispatch: t }) => be(e, t), Tn = () => ({ commands: e }) => e.keyboardShortcut("Enter"), Cn = () => ({ state: e, dispatch: t }) => ke(e, t), An = (e, t = {}) => ({ tr: n, state: r, dispatch: o }) => {
1565
+ const s = $(e, r.schema), { doc: i, selection: a } = n, { $from: c, from: l, to: d } = a;
1566
+ if (o) {
1567
+ const u = pt(c, s, t);
1568
+ if (u && u.from <= l && u.to >= d) {
1569
+ const p = A.create(i, u.from, u.to);
1570
+ n.setSelection(p);
1571
+ }
1572
+ }
1573
+ return !0;
1574
+ }, Pn = (e) => (t) => {
1575
+ const n = typeof e == "function" ? e(t) : e;
1576
+ for (let r = 0; r < n.length; r += 1)
1577
+ if (n[r](t))
1578
+ return !0;
1579
+ return !1;
1580
+ };
1581
+ function $n() {
1582
+ return navigator.platform === "Android" || /android/i.test(navigator.userAgent);
1583
+ }
1584
+ function gt() {
1585
+ return ["iPad Simulator", "iPhone Simulator", "iPod Simulator", "iPad", "iPhone", "iPod"].includes(navigator.platform) || // iPad on iOS 13 detection
1586
+ navigator.userAgent.includes("Mac") && "ontouchend" in document;
1587
+ }
1588
+ var In = (e = null, t = {}) => ({ editor: n, view: r, tr: o, dispatch: s }) => {
1589
+ t = {
1590
+ scrollIntoView: !0,
1591
+ ...t
1592
+ };
1593
+ const i = () => {
1594
+ (gt() || $n()) && r.dom.focus(), requestAnimationFrame(() => {
1595
+ n.isDestroyed || (r.focus(), t?.scrollIntoView && n.commands.scrollIntoView());
1596
+ });
1597
+ };
1598
+ if (r.hasFocus() && e === null || e === !1)
1599
+ return !0;
1600
+ if (s && e === null && !Ft(n.state.selection))
1601
+ return i(), !0;
1602
+ const a = _t(o.doc, e) || n.state.selection, c = n.state.selection.eq(a);
1603
+ return s && (c || o.setSelection(a), c && o.storedMarks && o.setStoredMarks(o.storedMarks), i()), !0;
1604
+ }, Nn = (e, t) => (n) => e.every((r, o) => t(r, { ...n, index: o })), On = (e, t) => ({ tr: n, commands: r }) => r.insertContentAt({ from: n.selection.from, to: n.selection.to }, e, t), Bn = (e) => !("type" in e), jn = (e, t, n) => ({ tr: r, dispatch: o, editor: s }) => {
1605
+ var i;
1606
+ if (o) {
1607
+ n = {
1608
+ parseOptions: s.options.parseOptions,
1609
+ updateSelection: !0,
1610
+ applyInputRules: !1,
1611
+ applyPasteRules: !1,
1612
+ ...n
1613
+ };
1614
+ let a;
1615
+ const { selection: c } = s.state, l = (g) => {
1616
+ s.emit("contentError", {
1617
+ editor: s,
1618
+ error: g,
1619
+ disableCollaboration: () => {
1620
+ "collaboration" in s.storage && typeof s.storage.collaboration == "object" && s.storage.collaboration && (s.storage.collaboration.isDisabled = !0);
1621
+ }
1622
+ });
1623
+ }, d = {
1624
+ preserveWhitespace: "full",
1625
+ ...n.parseOptions
1626
+ };
1627
+ if (!n.errorOnInvalidContent && !s.options.enableContentCheck && s.options.emitContentError)
1628
+ try {
1629
+ F(t, s.schema, {
1630
+ parseOptions: d,
1631
+ errorOnInvalidContent: !0
1632
+ });
1633
+ } catch (g) {
1634
+ l(g);
1635
+ }
1636
+ try {
1637
+ a = F(t, s.schema, {
1638
+ parseOptions: d,
1639
+ errorOnInvalidContent: (i = n.errorOnInvalidContent) != null ? i : s.options.enableContentCheck
1640
+ });
1641
+ } catch (g) {
1642
+ return l(g), !1;
1643
+ }
1644
+ let { from: u, to: p } = typeof e == "number" ? { from: e, to: e } : { from: e.from, to: e.to }, f = !0, m = !0;
1645
+ if ((Bn(a) ? a : [a]).forEach((g) => {
1646
+ g.check(), f = f ? g.isText && g.marks.length === 0 : !1, m = m ? g.isBlock : !1;
1647
+ }), u === p && m) {
1648
+ const { parent: g } = r.doc.resolve(u);
1649
+ g.isTextblock && !g.type.spec.code && !g.childCount && (u -= 1, p += 1);
1650
+ }
1651
+ let v;
1652
+ if (f) {
1653
+ if (Array.isArray(t))
1654
+ v = t.map((g) => g.text || "").join("");
1655
+ else if (t instanceof N) {
1656
+ let g = "";
1657
+ t.forEach((b) => {
1658
+ b.text && (g += b.text);
1659
+ }), v = g;
1660
+ } else typeof t == "object" && t && t.text ? v = t.text : v = t;
1661
+ r.insertText(v, u, p);
1662
+ } else {
1663
+ v = a;
1664
+ const g = c.$from.parentOffset === 0, b = c.$from.node().isText || c.$from.node().isTextblock, k = c.$from.node().content.size > 0;
1665
+ g && b && k && (u = Math.max(0, u - 1)), r.replaceWith(u, p, v);
1666
+ }
1667
+ n.updateSelection && rn(r, r.steps.length - 1, -1), n.applyInputRules && r.setMeta("applyInputRules", { from: u, text: v }), n.applyPasteRules && r.setMeta("applyPasteRules", { from: u, text: v });
1668
+ }
1669
+ return !0;
1670
+ }, Rn = () => ({ state: e, dispatch: t }) => we(e, t), Dn = () => ({ state: e, dispatch: t }) => Me(e, t), Fn = () => ({ state: e, dispatch: t }) => Se(e, t), _n = () => ({ state: e, dispatch: t }) => Ee(e, t), Ln = () => ({ state: e, dispatch: t, tr: n }) => {
1671
+ try {
1672
+ const r = Ct(e.doc, e.selection.$from.pos, -1);
1673
+ return r == null ? !1 : (n.join(r, 2), t && t(n), !0);
1674
+ } catch {
1675
+ return !1;
1676
+ }
1677
+ }, zn = () => ({ state: e, dispatch: t, tr: n }) => {
1678
+ try {
1679
+ const r = Ct(e.doc, e.selection.$from.pos, 1);
1680
+ return r == null ? !1 : (n.join(r, 2), t && t(n), !0);
1681
+ } catch {
1682
+ return !1;
1683
+ }
1684
+ }, Vn = () => ({ state: e, dispatch: t }) => xe(e, t), Hn = () => ({ state: e, dispatch: t }) => Te(e, t);
1685
+ function Ut() {
1686
+ return typeof navigator < "u" ? /Mac/.test(navigator.platform) : !1;
1687
+ }
1688
+ function Wn(e) {
1689
+ const t = e.split(/-(?!$)/);
1690
+ let n = t[t.length - 1];
1691
+ n === "Space" && (n = " ");
1692
+ let r, o, s, i;
1693
+ for (let a = 0; a < t.length - 1; a += 1) {
1694
+ const c = t[a];
1695
+ if (/^(cmd|meta|m)$/i.test(c))
1696
+ i = !0;
1697
+ else if (/^a(lt)?$/i.test(c))
1698
+ r = !0;
1699
+ else if (/^(c|ctrl|control)$/i.test(c))
1700
+ o = !0;
1701
+ else if (/^s(hift)?$/i.test(c))
1702
+ s = !0;
1703
+ else if (/^mod$/i.test(c))
1704
+ gt() || Ut() ? i = !0 : o = !0;
1705
+ else
1706
+ throw new Error(`Unrecognized modifier name: ${c}`);
1707
+ }
1708
+ return r && (n = `Alt-${n}`), o && (n = `Ctrl-${n}`), i && (n = `Meta-${n}`), s && (n = `Shift-${n}`), n;
1709
+ }
1710
+ var Un = (e) => ({ editor: t, view: n, tr: r, dispatch: o }) => {
1711
+ const s = Wn(e).split(/-(?!$)/), i = s.find((l) => !["Alt", "Ctrl", "Meta", "Shift"].includes(l)), a = new KeyboardEvent("keydown", {
1712
+ key: i === "Space" ? " " : i,
1713
+ altKey: s.includes("Alt"),
1714
+ ctrlKey: s.includes("Ctrl"),
1715
+ metaKey: s.includes("Meta"),
1716
+ shiftKey: s.includes("Shift"),
1717
+ bubbles: !0,
1718
+ cancelable: !0
1719
+ }), c = t.captureTransaction(() => {
1720
+ n.someProp("handleKeyDown", (l) => l(n, a));
1721
+ });
1722
+ return c?.steps.forEach((l) => {
1723
+ const d = l.map(r.mapping);
1724
+ d && o && r.maybeStep(d);
1725
+ }), !0;
1726
+ }, qn = (e, t = {}) => ({ state: n, dispatch: r }) => {
1727
+ const o = E(e, n.schema);
1728
+ return L(n, o, t) ? Ce(n, r) : !1;
1729
+ }, Kn = () => ({ state: e, dispatch: t }) => Ae(e, t), Jn = (e) => ({ state: t, dispatch: n }) => {
1730
+ const r = E(e, t.schema);
1731
+ return Re(r)(t, n);
1732
+ }, Gn = () => ({ state: e, dispatch: t }) => Pe(e, t);
1733
+ function Et(e, t) {
1734
+ const n = typeof t == "string" ? [t] : t;
1735
+ return Object.keys(e).reduce((r, o) => (n.includes(o) || (r[o] = e[o]), r), {});
1736
+ }
1737
+ var Xn = (e, t) => ({ tr: n, state: r, dispatch: o }) => {
1738
+ let s = null, i = null;
1739
+ const a = Z(
1740
+ typeof e == "string" ? e : e.name,
1741
+ r.schema
1742
+ );
1743
+ return a ? (a === "node" && (s = E(e, r.schema)), a === "mark" && (i = $(e, r.schema)), o && n.selection.ranges.forEach((c) => {
1744
+ r.doc.nodesBetween(c.$from.pos, c.$to.pos, (l, d) => {
1745
+ s && s === l.type && n.setNodeMarkup(d, void 0, Et(l.attrs, t)), i && l.marks.length && l.marks.forEach((u) => {
1746
+ i === u.type && n.addMark(d, d + l.nodeSize, i.create(Et(u.attrs, t)));
1747
+ });
1748
+ });
1749
+ }), !0) : !1;
1750
+ }, Yn = () => ({ tr: e, dispatch: t }) => (t && e.scrollIntoView(), !0), Qn = () => ({ tr: e, dispatch: t }) => {
1751
+ if (t) {
1752
+ const n = new ie(e.doc);
1753
+ e.setSelection(n);
1754
+ }
1755
+ return !0;
1756
+ }, Zn = () => ({ state: e, dispatch: t }) => $e(e, t), tr = () => ({ state: e, dispatch: t }) => Ie(e, t), er = () => ({ state: e, dispatch: t }) => Ne(e, t), nr = () => ({ state: e, dispatch: t }) => Oe(e, t), rr = () => ({ state: e, dispatch: t }) => Be(e, t), or = (e, { errorOnInvalidContent: t, emitUpdate: n = !0, parseOptions: r = {} } = {}) => ({ editor: o, tr: s, dispatch: i, commands: a }) => {
1757
+ const { doc: c } = s;
1758
+ if (r.preserveWhitespace !== "full") {
1759
+ const l = it(e, o.schema, r, {
1760
+ errorOnInvalidContent: t ?? o.options.enableContentCheck
1761
+ });
1762
+ return i && s.replaceWith(0, c.content.size, l).setMeta("preventUpdate", !n), !0;
1763
+ }
1764
+ return i && s.setMeta("preventUpdate", !n), a.insertContentAt({ from: 0, to: c.content.size }, e, {
1765
+ parseOptions: r,
1766
+ errorOnInvalidContent: t ?? o.options.enableContentCheck
1767
+ });
1768
+ };
1769
+ function sr(e, t, n) {
1770
+ var r;
1771
+ const { selection: o } = t;
1772
+ let s = null;
1773
+ if (Ft(o) && (s = o.$cursor), s) {
1774
+ const a = (r = e.storedMarks) != null ? r : s.marks();
1775
+ return s.parent.type.allowsMarkType(n) && (!!n.isInSet(a) || !a.some((l) => l.type.excludes(n)));
1776
+ }
1777
+ const { ranges: i } = o;
1778
+ return i.some(({ $from: a, $to: c }) => {
1779
+ let l = a.depth === 0 ? e.doc.inlineContent && e.doc.type.allowsMarkType(n) : !1;
1780
+ return e.doc.nodesBetween(a.pos, c.pos, (d, u, p) => {
1781
+ if (l)
1782
+ return !1;
1783
+ if (d.isInline) {
1784
+ const f = !p || p.type.allowsMarkType(n), m = !!n.isInSet(d.marks) || !d.marks.some((h) => h.type.excludes(n));
1785
+ l = f && m;
1786
+ }
1787
+ return !l;
1788
+ }), l;
1789
+ });
1790
+ }
1791
+ var ir = (e, t = {}) => ({ tr: n, state: r, dispatch: o }) => {
1792
+ const { selection: s } = n, { empty: i, ranges: a } = s, c = $(e, r.schema);
1793
+ if (o)
1794
+ if (i) {
1795
+ const l = jt(r, c);
1796
+ n.addStoredMark(
1797
+ c.create({
1798
+ ...l,
1799
+ ...t
1800
+ })
1801
+ );
1802
+ } else
1803
+ a.forEach((l) => {
1804
+ const d = l.$from.pos, u = l.$to.pos;
1805
+ r.doc.nodesBetween(d, u, (p, f) => {
1806
+ const m = Math.max(f, d), h = Math.min(f + p.nodeSize, u);
1807
+ p.marks.find((g) => g.type === c) ? p.marks.forEach((g) => {
1808
+ c === g.type && n.addMark(
1809
+ m,
1810
+ h,
1811
+ c.create({
1812
+ ...g.attrs,
1813
+ ...t
1814
+ })
1815
+ );
1816
+ }) : n.addMark(m, h, c.create(t));
1817
+ });
1818
+ });
1819
+ return sr(r, n, c);
1820
+ }, ar = (e, t) => ({ tr: n }) => (n.setMeta(e, t), !0), cr = (e, t = {}) => ({ state: n, dispatch: r, chain: o }) => {
1821
+ const s = E(e, n.schema);
1822
+ let i;
1823
+ return n.selection.$anchor.sameParent(n.selection.$head) && (i = n.selection.$anchor.parent.attrs), s.isTextblock ? o().command(({ commands: a }) => yt(s, { ...i, ...t })(n) ? !0 : a.clearNodes()).command(({ state: a }) => yt(s, { ...i, ...t })(a, r)).run() : (console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'), !1);
1824
+ }, lr = (e) => ({ tr: t, dispatch: n }) => {
1825
+ if (n) {
1826
+ const { doc: r } = t, o = O(e, 0, r.content.size), s = G.create(r, o);
1827
+ t.setSelection(s);
1828
+ }
1829
+ return !0;
1830
+ }, ur = (e) => ({ tr: t, dispatch: n }) => {
1831
+ if (n) {
1832
+ const { doc: r } = t, { from: o, to: s } = typeof e == "number" ? { from: e, to: e } : e, i = A.atStart(r).from, a = A.atEnd(r).to, c = O(o, i, a), l = O(s, i, a), d = A.create(r, c, l);
1833
+ t.setSelection(d);
1834
+ }
1835
+ return !0;
1836
+ }, dr = (e) => ({ state: t, dispatch: n }) => {
1837
+ const r = E(e, t.schema);
1838
+ return De(r)(t, n);
1839
+ };
1840
+ function xt(e, t) {
1841
+ const n = e.storedMarks || e.selection.$to.parentOffset && e.selection.$from.marks();
1842
+ if (n) {
1843
+ const r = n.filter((o) => t?.includes(o.type.name));
1844
+ e.tr.ensureMarks(r);
1845
+ }
1846
+ }
1847
+ var fr = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, editor: o }) => {
1848
+ const { selection: s, doc: i } = t, { $from: a, $to: c } = s, l = o.extensionManager.attributes, d = q(l, a.node().type.name, a.node().attrs);
1849
+ if (s instanceof G && s.node.isBlock)
1850
+ return !a.parentOffset || !U(i, a.pos) ? !1 : (r && (e && xt(n, o.extensionManager.splittableMarks), t.split(a.pos).scrollIntoView()), !0);
1851
+ if (!a.parent.isBlock)
1852
+ return !1;
1853
+ const u = c.parentOffset === c.parent.content.size, p = a.depth === 0 ? void 0 : Ve(a.node(-1).contentMatchAt(a.indexAfter(-1)));
1854
+ let f = u && p ? [
1855
+ {
1856
+ type: p,
1857
+ attrs: d
1858
+ }
1859
+ ] : void 0, m = U(t.doc, t.mapping.map(a.pos), 1, f);
1860
+ if (!f && !m && U(t.doc, t.mapping.map(a.pos), 1, p ? [{ type: p }] : void 0) && (m = !0, f = p ? [
1861
+ {
1862
+ type: p,
1863
+ attrs: d
1864
+ }
1865
+ ] : void 0), r) {
1866
+ if (m && (s instanceof A && t.deleteSelection(), t.split(t.mapping.map(a.pos), 1, f), p && !u && !a.parentOffset && a.parent.type !== p)) {
1867
+ const h = t.mapping.map(a.before()), v = t.doc.resolve(h);
1868
+ a.node(-1).canReplaceWith(v.index(), v.index() + 1, p) && t.setNodeMarkup(t.mapping.map(a.before()), p);
1869
+ }
1870
+ e && xt(n, o.extensionManager.splittableMarks), t.scrollIntoView();
1871
+ }
1872
+ return m;
1873
+ }, pr = (e, t = {}) => ({ tr: n, state: r, dispatch: o, editor: s }) => {
1874
+ var i;
1875
+ const a = E(e, r.schema), { $from: c, $to: l } = r.selection, d = r.selection.node;
1876
+ if (d && d.isBlock || c.depth < 2 || !c.sameParent(l))
1877
+ return !1;
1878
+ const u = c.node(-1);
1879
+ if (u.type !== a)
1880
+ return !1;
1881
+ const p = s.extensionManager.attributes;
1882
+ if (c.parent.content.size === 0 && c.node(-1).childCount === c.indexAfter(-1)) {
1883
+ if (c.depth === 2 || c.node(-3).type !== a || c.index(-2) !== c.node(-2).childCount - 1)
1884
+ return !1;
1885
+ if (o) {
1886
+ let g = N.empty;
1887
+ const b = c.index(-1) ? 1 : c.index(-2) ? 2 : 3;
1888
+ for (let C = c.depth - b; C >= c.depth - 3; C -= 1)
1889
+ g = N.from(c.node(C).copy(g));
1890
+ const k = (
1891
+ // eslint-disable-next-line no-nested-ternary
1892
+ c.indexAfter(-1) < c.node(-2).childCount ? 1 : c.indexAfter(-2) < c.node(-3).childCount ? 2 : 3
1893
+ ), S = {
1894
+ ...q(p, c.node().type.name, c.node().attrs),
1895
+ ...t
1896
+ }, M = ((i = a.contentMatch.defaultType) == null ? void 0 : i.createAndFill(S)) || void 0;
1897
+ g = g.append(N.from(a.createAndFill(null, M) || void 0));
1898
+ const x = c.before(c.depth - (b - 1));
1899
+ n.replace(x, c.after(-k), new ue(g, 4 - b, 0));
1900
+ let T = -1;
1901
+ n.doc.nodesBetween(x, n.doc.content.size, (C, j) => {
1902
+ if (T > -1)
1903
+ return !1;
1904
+ C.isTextblock && C.content.size === 0 && (T = j + 1);
1905
+ }), T > -1 && n.setSelection(A.near(n.doc.resolve(T))), n.scrollIntoView();
1906
+ }
1907
+ return !0;
1908
+ }
1909
+ const f = l.pos === c.end() ? u.contentMatchAt(0).defaultType : null, m = {
1910
+ ...q(p, u.type.name, u.attrs),
1911
+ ...t
1912
+ }, h = {
1913
+ ...q(p, c.node().type.name, c.node().attrs),
1914
+ ...t
1915
+ };
1916
+ n.delete(c.pos, l.pos);
1917
+ const v = f ? [
1918
+ { type: a, attrs: m },
1919
+ { type: f, attrs: h }
1920
+ ] : [{ type: a, attrs: m }];
1921
+ if (!U(n.doc, c.pos, 2))
1922
+ return !1;
1923
+ if (o) {
1924
+ const { selection: g, storedMarks: b } = r, { splittableMarks: k } = s.extensionManager, S = b || g.$to.parentOffset && g.$from.marks();
1925
+ if (n.split(c.pos, 2, v).scrollIntoView(), !S || !o)
1926
+ return !0;
1927
+ const M = S.filter((x) => k.includes(x.type.name));
1928
+ n.ensureMarks(M);
1929
+ }
1930
+ return !0;
1931
+ }, ot = (e, t) => {
1932
+ const n = Q((i) => i.type === t)(e.selection);
1933
+ if (!n)
1934
+ return !0;
1935
+ const r = e.doc.resolve(Math.max(0, n.pos - 1)).before(n.depth);
1936
+ if (r === void 0)
1937
+ return !0;
1938
+ const o = e.doc.nodeAt(r);
1939
+ return n.node.type === o?.type && ct(e.doc, n.pos) && e.join(n.pos), !0;
1940
+ }, st = (e, t) => {
1941
+ const n = Q((i) => i.type === t)(e.selection);
1942
+ if (!n)
1943
+ return !0;
1944
+ const r = e.doc.resolve(n.start).after(n.depth);
1945
+ if (r === void 0)
1946
+ return !0;
1947
+ const o = e.doc.nodeAt(r);
1948
+ return n.node.type === o?.type && ct(e.doc, r) && e.join(r), !0;
1949
+ }, mr = (e, t, n, r = {}) => ({ editor: o, tr: s, state: i, dispatch: a, chain: c, commands: l, can: d }) => {
1950
+ const { extensions: u, splittableMarks: p } = o.extensionManager, f = E(e, i.schema), m = E(t, i.schema), { selection: h, storedMarks: v } = i, { $from: g, $to: b } = h, k = g.blockRange(b), S = v || h.$to.parentOffset && h.$from.marks();
1951
+ if (!k)
1952
+ return !1;
1953
+ const M = Q((x) => St(x.type.name, u))(h);
1954
+ if (k.depth >= 1 && M && k.depth - M.depth <= 1) {
1955
+ if (M.node.type === f)
1956
+ return l.liftListItem(m);
1957
+ if (St(M.node.type.name, u) && f.validContent(M.node.content) && a)
1958
+ return c().command(() => (s.setNodeMarkup(M.pos, f), !0)).command(() => ot(s, f)).command(() => st(s, f)).run();
1959
+ }
1960
+ return !n || !S || !a ? c().command(() => d().wrapInList(f, r) ? !0 : l.clearNodes()).wrapInList(f, r).command(() => ot(s, f)).command(() => st(s, f)).run() : c().command(() => {
1961
+ const x = d().wrapInList(f, r), T = S.filter((C) => p.includes(C.type.name));
1962
+ return s.ensureMarks(T), x ? !0 : l.clearNodes();
1963
+ }).wrapInList(f, r).command(() => ot(s, f)).command(() => st(s, f)).run();
1964
+ }, hr = (e, t = {}, n = {}) => ({ state: r, commands: o }) => {
1965
+ const { extendEmptyMarkRange: s = !1 } = n, i = $(e, r.schema);
1966
+ return at(r, i, t) ? o.unsetMark(i, { extendEmptyMarkRange: s }) : o.setMark(i, t);
1967
+ }, gr = (e, t, n = {}) => ({ state: r, commands: o }) => {
1968
+ const s = E(e, r.schema), i = E(t, r.schema), a = L(r, s, n);
1969
+ let c;
1970
+ return r.selection.$anchor.sameParent(r.selection.$head) && (c = r.selection.$anchor.parent.attrs), a ? o.setNode(i, c) : o.setNode(s, { ...c, ...n });
1971
+ }, vr = (e, t = {}) => ({ state: n, commands: r }) => {
1972
+ const o = E(e, n.schema);
1973
+ return L(n, o, t) ? r.lift(o) : r.wrapIn(o, t);
1974
+ }, yr = () => ({ state: e, dispatch: t }) => {
1975
+ const n = e.plugins;
1976
+ for (let r = 0; r < n.length; r += 1) {
1977
+ const o = n[r];
1978
+ let s;
1979
+ if (o.spec.isInputRules && (s = o.getState(e))) {
1980
+ if (t) {
1981
+ const i = e.tr, a = s.transform;
1982
+ for (let c = a.steps.length - 1; c >= 0; c -= 1)
1983
+ i.step(a.steps[c].invert(a.docs[c]));
1984
+ if (s.text) {
1985
+ const c = i.doc.resolve(s.from).marks();
1986
+ i.replaceWith(s.from, s.to, e.schema.text(s.text, c));
1987
+ } else
1988
+ i.delete(s.from, s.to);
1989
+ }
1990
+ return !0;
1991
+ }
1992
+ }
1993
+ return !1;
1994
+ }, br = () => ({ tr: e, dispatch: t }) => {
1995
+ const { selection: n } = e, { empty: r, ranges: o } = n;
1996
+ return r || t && o.forEach((s) => {
1997
+ e.removeMark(s.$from.pos, s.$to.pos);
1998
+ }), !0;
1999
+ }, kr = (e, t = {}) => ({ tr: n, state: r, dispatch: o }) => {
2000
+ var s;
2001
+ const { extendEmptyMarkRange: i = !1 } = t, { selection: a } = n, c = $(e, r.schema), { $from: l, empty: d, ranges: u } = a;
2002
+ if (!o)
2003
+ return !0;
2004
+ if (d && i) {
2005
+ let { from: p, to: f } = a;
2006
+ const m = (s = l.marks().find((v) => v.type === c)) == null ? void 0 : s.attrs, h = pt(l, c, m);
2007
+ h && (p = h.from, f = h.to), n.removeMark(p, f, c);
2008
+ } else
2009
+ u.forEach((p) => {
2010
+ n.removeMark(p.$from.pos, p.$to.pos, c);
2011
+ });
2012
+ return n.removeStoredMark(c), !0;
2013
+ }, wr = (e, t = {}) => ({ tr: n, state: r, dispatch: o }) => {
2014
+ let s = null, i = null;
2015
+ const a = Z(
2016
+ typeof e == "string" ? e : e.name,
2017
+ r.schema
2018
+ );
2019
+ return a ? (a === "node" && (s = E(e, r.schema)), a === "mark" && (i = $(e, r.schema)), o && n.selection.ranges.forEach((c) => {
2020
+ const l = c.$from.pos, d = c.$to.pos;
2021
+ let u, p, f, m;
2022
+ n.selection.empty ? r.doc.nodesBetween(l, d, (h, v) => {
2023
+ s && s === h.type && (f = Math.max(v, l), m = Math.min(v + h.nodeSize, d), u = v, p = h);
2024
+ }) : r.doc.nodesBetween(l, d, (h, v) => {
2025
+ v < l && s && s === h.type && (f = Math.max(v, l), m = Math.min(v + h.nodeSize, d), u = v, p = h), v >= l && v <= d && (s && s === h.type && n.setNodeMarkup(v, void 0, {
2026
+ ...h.attrs,
2027
+ ...t
2028
+ }), i && h.marks.length && h.marks.forEach((g) => {
2029
+ if (i === g.type) {
2030
+ const b = Math.max(v, l), k = Math.min(v + h.nodeSize, d);
2031
+ n.addMark(
2032
+ b,
2033
+ k,
2034
+ i.create({
2035
+ ...g.attrs,
2036
+ ...t
2037
+ })
2038
+ );
2039
+ }
2040
+ }));
2041
+ }), p && (u !== void 0 && n.setNodeMarkup(u, void 0, {
2042
+ ...p.attrs,
2043
+ ...t
2044
+ }), i && p.marks.length && p.marks.forEach((h) => {
2045
+ i === h.type && n.addMark(
2046
+ f,
2047
+ m,
2048
+ i.create({
2049
+ ...h.attrs,
2050
+ ...t
2051
+ })
2052
+ );
2053
+ }));
2054
+ }), !0) : !1;
2055
+ }, Mr = (e, t = {}) => ({ state: n, dispatch: r }) => {
2056
+ const o = E(e, n.schema);
2057
+ return je(o, t)(n, r);
2058
+ }, Sr = (e, t = {}) => ({ state: n, dispatch: r }) => {
2059
+ const o = E(e, n.schema);
2060
+ return Fe(o, t)(n, r);
2061
+ }, qt = I.create({
2062
+ name: "commands",
2063
+ addCommands() {
2064
+ return {
2065
+ ...Wt
2066
+ };
2067
+ }
2068
+ }), Kt = I.create({
2069
+ name: "delete",
2070
+ onUpdate({ transaction: e, appendedTransactions: t }) {
2071
+ var n, r, o;
2072
+ const s = () => {
2073
+ var i, a, c, l;
2074
+ if ((l = (c = (a = (i = this.editor.options.coreExtensionOptions) == null ? void 0 : i.delete) == null ? void 0 : a.filterTransaction) == null ? void 0 : c.call(a, e)) != null ? l : e.getMeta("y-sync$"))
2075
+ return;
2076
+ const d = ze(e.before, [e, ...t]);
2077
+ tn(d).forEach((f) => {
2078
+ d.mapping.mapResult(f.oldRange.from).deletedAfter && d.mapping.mapResult(f.oldRange.to).deletedBefore && d.before.nodesBetween(f.oldRange.from, f.oldRange.to, (m, h) => {
2079
+ const v = h + m.nodeSize - 2, g = f.oldRange.from <= h && v <= f.oldRange.to;
2080
+ this.editor.emit("delete", {
2081
+ type: "node",
2082
+ node: m,
2083
+ from: h,
2084
+ to: v,
2085
+ newFrom: d.mapping.map(h),
2086
+ newTo: d.mapping.map(v),
2087
+ deletedRange: f.oldRange,
2088
+ newRange: f.newRange,
2089
+ partial: !g,
2090
+ editor: this.editor,
2091
+ transaction: e,
2092
+ combinedTransform: d
2093
+ });
2094
+ });
2095
+ });
2096
+ const p = d.mapping;
2097
+ d.steps.forEach((f, m) => {
2098
+ var h, v;
2099
+ if (f instanceof me) {
2100
+ const g = p.slice(m).map(f.from, -1), b = p.slice(m).map(f.to), k = p.invert().map(g, -1), S = p.invert().map(b), M = (h = d.doc.nodeAt(g - 1)) == null ? void 0 : h.marks.some((T) => T.eq(f.mark)), x = (v = d.doc.nodeAt(b)) == null ? void 0 : v.marks.some((T) => T.eq(f.mark));
2101
+ this.editor.emit("delete", {
2102
+ type: "mark",
2103
+ mark: f.mark,
2104
+ from: f.from,
2105
+ to: f.to,
2106
+ deletedRange: {
2107
+ from: k,
2108
+ to: S
2109
+ },
2110
+ newRange: {
2111
+ from: g,
2112
+ to: b
2113
+ },
2114
+ partial: !!(x || M),
2115
+ editor: this.editor,
2116
+ transaction: e,
2117
+ combinedTransform: d
2118
+ });
2119
+ }
2120
+ });
2121
+ };
2122
+ (o = (r = (n = this.editor.options.coreExtensionOptions) == null ? void 0 : n.delete) == null ? void 0 : r.async) == null || o ? setTimeout(s, 0) : s();
2123
+ }
2124
+ }), Jt = I.create({
2125
+ name: "drop",
2126
+ addProseMirrorPlugins() {
2127
+ return [
2128
+ new P({
2129
+ key: new B("tiptapDrop"),
2130
+ props: {
2131
+ handleDrop: (e, t, n, r) => {
2132
+ this.editor.emit("drop", {
2133
+ editor: this.editor,
2134
+ event: t,
2135
+ slice: n,
2136
+ moved: r
2137
+ });
2138
+ }
2139
+ }
2140
+ })
2141
+ ];
2142
+ }
2143
+ }), Gt = I.create({
2144
+ name: "editable",
2145
+ addProseMirrorPlugins() {
2146
+ return [
2147
+ new P({
2148
+ key: new B("editable"),
2149
+ props: {
2150
+ editable: () => this.editor.options.editable
2151
+ }
2152
+ })
2153
+ ];
2154
+ }
2155
+ }), Xt = new B("focusEvents"), Yt = I.create({
2156
+ name: "focusEvents",
2157
+ addProseMirrorPlugins() {
2158
+ const { editor: e } = this;
2159
+ return [
2160
+ new P({
2161
+ key: Xt,
2162
+ props: {
2163
+ handleDOMEvents: {
2164
+ focus: (t, n) => {
2165
+ e.isFocused = !0;
2166
+ const r = e.state.tr.setMeta("focus", { event: n }).setMeta("addToHistory", !1);
2167
+ return t.dispatch(r), !1;
2168
+ },
2169
+ blur: (t, n) => {
2170
+ e.isFocused = !1;
2171
+ const r = e.state.tr.setMeta("blur", { event: n }).setMeta("addToHistory", !1);
2172
+ return t.dispatch(r), !1;
2173
+ }
2174
+ }
2175
+ }
2176
+ })
2177
+ ];
2178
+ }
2179
+ }), Qt = I.create({
2180
+ name: "keymap",
2181
+ addKeyboardShortcuts() {
2182
+ const e = () => this.editor.commands.first(({ commands: i }) => [
2183
+ () => i.undoInputRule(),
2184
+ // maybe convert first text block node to default node
2185
+ () => i.command(({ tr: a }) => {
2186
+ const { selection: c, doc: l } = a, { empty: d, $anchor: u } = c, { pos: p, parent: f } = u, m = u.parent.isTextblock && p > 0 ? a.doc.resolve(p - 1) : u, h = m.parent.type.spec.isolating, v = u.pos - u.parentOffset, g = h && m.parent.childCount === 1 ? v === u.pos : D.atStart(l).from === p;
2187
+ return !d || !f.type.isTextblock || f.textContent.length || !g || g && u.parent.type.name === "paragraph" ? !1 : i.clearNodes();
2188
+ }),
2189
+ () => i.deleteSelection(),
2190
+ () => i.joinBackward(),
2191
+ () => i.selectNodeBackward()
2192
+ ]), t = () => this.editor.commands.first(({ commands: i }) => [
2193
+ () => i.deleteSelection(),
2194
+ () => i.deleteCurrentNode(),
2195
+ () => i.joinForward(),
2196
+ () => i.selectNodeForward()
2197
+ ]), r = {
2198
+ Enter: () => this.editor.commands.first(({ commands: i }) => [
2199
+ () => i.newlineInCode(),
2200
+ () => i.createParagraphNear(),
2201
+ () => i.liftEmptyBlock(),
2202
+ () => i.splitBlock()
2203
+ ]),
2204
+ "Mod-Enter": () => this.editor.commands.exitCode(),
2205
+ Backspace: e,
2206
+ "Mod-Backspace": e,
2207
+ "Shift-Backspace": e,
2208
+ Delete: t,
2209
+ "Mod-Delete": t,
2210
+ "Mod-a": () => this.editor.commands.selectAll()
2211
+ }, o = {
2212
+ ...r
2213
+ }, s = {
2214
+ ...r,
2215
+ "Ctrl-h": e,
2216
+ "Alt-Backspace": e,
2217
+ "Ctrl-d": t,
2218
+ "Ctrl-Alt-Backspace": t,
2219
+ "Alt-Delete": t,
2220
+ "Alt-d": t,
2221
+ "Ctrl-a": () => this.editor.commands.selectTextblockStart(),
2222
+ "Ctrl-e": () => this.editor.commands.selectTextblockEnd()
2223
+ };
2224
+ return gt() || Ut() ? s : o;
2225
+ },
2226
+ addProseMirrorPlugins() {
2227
+ return [
2228
+ // With this plugin we check if the whole document was selected and deleted.
2229
+ // In this case we will additionally call `clearNodes()` to convert e.g. a heading
2230
+ // to a paragraph if necessary.
2231
+ // This is an alternative to ProseMirror's `AllSelection`, which doesn’t work well
2232
+ // with many other commands.
2233
+ new P({
2234
+ key: new B("clearDocument"),
2235
+ appendTransaction: (e, t, n) => {
2236
+ if (e.some((h) => h.getMeta("composition")))
2237
+ return;
2238
+ const r = e.some((h) => h.docChanged) && !t.doc.eq(n.doc), o = e.some((h) => h.getMeta("preventClearDocument"));
2239
+ if (!r || o)
2240
+ return;
2241
+ const { empty: s, from: i, to: a } = t.selection, c = D.atStart(t.doc).from, l = D.atEnd(t.doc).to;
2242
+ if (s || !(i === c && a === l) || !mt(n.doc))
2243
+ return;
2244
+ const p = n.tr, f = X({
2245
+ state: n,
2246
+ transaction: p
2247
+ }), { commands: m } = new Y({
2248
+ editor: this.editor,
2249
+ state: f
2250
+ });
2251
+ if (m.clearNodes(), !!p.steps.length)
2252
+ return p;
2253
+ }
2254
+ })
2255
+ ];
2256
+ }
2257
+ }), Zt = I.create({
2258
+ name: "paste",
2259
+ addProseMirrorPlugins() {
2260
+ return [
2261
+ new P({
2262
+ key: new B("tiptapPaste"),
2263
+ props: {
2264
+ handlePaste: (e, t, n) => {
2265
+ this.editor.emit("paste", {
2266
+ editor: this.editor,
2267
+ event: t,
2268
+ slice: n
2269
+ });
2270
+ }
2271
+ }
2272
+ })
2273
+ ];
2274
+ }
2275
+ }), te = I.create({
2276
+ name: "tabindex",
2277
+ addProseMirrorPlugins() {
2278
+ return [
2279
+ new P({
2280
+ key: new B("tabindex"),
2281
+ props: {
2282
+ attributes: () => this.editor.isEditable ? { tabindex: "0" } : {}
2283
+ }
2284
+ })
2285
+ ];
2286
+ }
2287
+ }), Er = class R {
2288
+ constructor(t, n, r = !1, o = null) {
2289
+ this.currentNode = null, this.actualDepth = null, this.isBlock = r, this.resolvedPos = t, this.editor = n, this.currentNode = o;
2290
+ }
2291
+ get name() {
2292
+ return this.node.type.name;
2293
+ }
2294
+ get node() {
2295
+ return this.currentNode || this.resolvedPos.node();
2296
+ }
2297
+ get element() {
2298
+ return this.editor.view.domAtPos(this.pos).node;
2299
+ }
2300
+ get depth() {
2301
+ var t;
2302
+ return (t = this.actualDepth) != null ? t : this.resolvedPos.depth;
2303
+ }
2304
+ get pos() {
2305
+ return this.resolvedPos.pos;
2306
+ }
2307
+ get content() {
2308
+ return this.node.content;
2309
+ }
2310
+ set content(t) {
2311
+ let n = this.from, r = this.to;
2312
+ if (this.isBlock) {
2313
+ if (this.content.size === 0) {
2314
+ console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);
2315
+ return;
2316
+ }
2317
+ n = this.from + 1, r = this.to - 1;
2318
+ }
2319
+ this.editor.commands.insertContentAt({ from: n, to: r }, t);
2320
+ }
2321
+ get attributes() {
2322
+ return this.node.attrs;
2323
+ }
2324
+ get textContent() {
2325
+ return this.node.textContent;
2326
+ }
2327
+ get size() {
2328
+ return this.node.nodeSize;
2329
+ }
2330
+ get from() {
2331
+ return this.isBlock ? this.pos : this.resolvedPos.start(this.resolvedPos.depth);
2332
+ }
2333
+ get range() {
2334
+ return {
2335
+ from: this.from,
2336
+ to: this.to
2337
+ };
2338
+ }
2339
+ get to() {
2340
+ return this.isBlock ? this.pos + this.size : this.resolvedPos.end(this.resolvedPos.depth) + (this.node.isText ? 0 : 1);
2341
+ }
2342
+ get parent() {
2343
+ if (this.depth === 0)
2344
+ return null;
2345
+ const t = this.resolvedPos.start(this.resolvedPos.depth - 1), n = this.resolvedPos.doc.resolve(t);
2346
+ return new R(n, this.editor);
2347
+ }
2348
+ get before() {
2349
+ let t = this.resolvedPos.doc.resolve(this.from - (this.isBlock ? 1 : 2));
2350
+ return t.depth !== this.depth && (t = this.resolvedPos.doc.resolve(this.from - 3)), new R(t, this.editor);
2351
+ }
2352
+ get after() {
2353
+ let t = this.resolvedPos.doc.resolve(this.to + (this.isBlock ? 2 : 1));
2354
+ return t.depth !== this.depth && (t = this.resolvedPos.doc.resolve(this.to + 3)), new R(t, this.editor);
2355
+ }
2356
+ get children() {
2357
+ const t = [];
2358
+ return this.node.content.forEach((n, r) => {
2359
+ const o = n.isBlock && !n.isTextblock, s = n.isAtom && !n.isText, i = this.pos + r + (s ? 0 : 1);
2360
+ if (i < 0 || i > this.resolvedPos.doc.nodeSize - 2)
2361
+ return;
2362
+ const a = this.resolvedPos.doc.resolve(i);
2363
+ if (!o && a.depth <= this.depth)
2364
+ return;
2365
+ const c = new R(a, this.editor, o, o ? n : null);
2366
+ o && (c.actualDepth = this.depth + 1), t.push(new R(a, this.editor, o, o ? n : null));
2367
+ }), t;
2368
+ }
2369
+ get firstChild() {
2370
+ return this.children[0] || null;
2371
+ }
2372
+ get lastChild() {
2373
+ const t = this.children;
2374
+ return t[t.length - 1] || null;
2375
+ }
2376
+ closest(t, n = {}) {
2377
+ let r = null, o = this.parent;
2378
+ for (; o && !r; ) {
2379
+ if (o.node.type.name === t)
2380
+ if (Object.keys(n).length > 0) {
2381
+ const s = o.node.attrs, i = Object.keys(n);
2382
+ for (let a = 0; a < i.length; a += 1) {
2383
+ const c = i[a];
2384
+ if (s[c] !== n[c])
2385
+ break;
2386
+ }
2387
+ } else
2388
+ r = o;
2389
+ o = o.parent;
2390
+ }
2391
+ return r;
2392
+ }
2393
+ querySelector(t, n = {}) {
2394
+ return this.querySelectorAll(t, n, !0)[0] || null;
2395
+ }
2396
+ querySelectorAll(t, n = {}, r = !1) {
2397
+ let o = [];
2398
+ if (!this.children || this.children.length === 0)
2399
+ return o;
2400
+ const s = Object.keys(n);
2401
+ return this.children.forEach((i) => {
2402
+ r && o.length > 0 || (i.node.type.name === t && s.every((c) => n[c] === i.node.attrs[c]) && o.push(i), !(r && o.length > 0) && (o = o.concat(i.querySelectorAll(t, n, r))));
2403
+ }), o;
2404
+ }
2405
+ setAttribute(t) {
2406
+ const { tr: n } = this.editor.state;
2407
+ n.setNodeMarkup(this.from, void 0, {
2408
+ ...this.node.attrs,
2409
+ ...t
2410
+ }), this.editor.view.dispatch(n);
2411
+ }
2412
+ }, xr = `.ProseMirror {
2413
+ position: relative;
2414
+ }
2415
+
2416
+ .ProseMirror {
2417
+ word-wrap: break-word;
2418
+ white-space: pre-wrap;
2419
+ white-space: break-spaces;
2420
+ -webkit-font-variant-ligatures: none;
2421
+ font-variant-ligatures: none;
2422
+ font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
2423
+ }
2424
+
2425
+ .ProseMirror [contenteditable="false"] {
2426
+ white-space: normal;
2427
+ }
2428
+
2429
+ .ProseMirror [contenteditable="false"] [contenteditable="true"] {
2430
+ white-space: pre-wrap;
2431
+ }
2432
+
2433
+ .ProseMirror pre {
2434
+ white-space: pre-wrap;
2435
+ }
2436
+
2437
+ img.ProseMirror-separator {
2438
+ display: inline !important;
2439
+ border: none !important;
2440
+ margin: 0 !important;
2441
+ width: 0 !important;
2442
+ height: 0 !important;
2443
+ }
2444
+
2445
+ .ProseMirror-gapcursor {
2446
+ display: none;
2447
+ pointer-events: none;
2448
+ position: absolute;
2449
+ margin: 0;
2450
+ }
2451
+
2452
+ .ProseMirror-gapcursor:after {
2453
+ content: "";
2454
+ display: block;
2455
+ position: absolute;
2456
+ top: -2px;
2457
+ width: 20px;
2458
+ border-top: 1px solid black;
2459
+ animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
2460
+ }
2461
+
2462
+ @keyframes ProseMirror-cursor-blink {
2463
+ to {
2464
+ visibility: hidden;
2465
+ }
2466
+ }
2467
+
2468
+ .ProseMirror-hideselection *::selection {
2469
+ background: transparent;
2470
+ }
2471
+
2472
+ .ProseMirror-hideselection *::-moz-selection {
2473
+ background: transparent;
2474
+ }
2475
+
2476
+ .ProseMirror-hideselection * {
2477
+ caret-color: transparent;
2478
+ }
2479
+
2480
+ .ProseMirror-focused .ProseMirror-gapcursor {
2481
+ display: block;
2482
+ }`;
2483
+ function Tr(e, t, n) {
2484
+ const r = document.querySelector("style[data-tiptap-style]");
2485
+ if (r !== null)
2486
+ return r;
2487
+ const o = document.createElement("style");
2488
+ return t && o.setAttribute("nonce", t), o.setAttribute("data-tiptap-style", ""), o.innerHTML = e, document.getElementsByTagName("head")[0].appendChild(o), o;
2489
+ }
2490
+ var _r = class extends Le {
2491
+ constructor(t = {}) {
2492
+ super(), this.css = null, this.editorView = null, this.isFocused = !1, this.isInitialized = !1, this.extensionStorage = {}, this.instanceId = Math.random().toString(36).slice(2, 9), this.options = {
2493
+ element: typeof document < "u" ? document.createElement("div") : null,
2494
+ content: "",
2495
+ injectCSS: !0,
2496
+ injectNonce: void 0,
2497
+ extensions: [],
2498
+ autofocus: !1,
2499
+ editable: !0,
2500
+ editorProps: {},
2501
+ parseOptions: {},
2502
+ coreExtensionOptions: {},
2503
+ enableInputRules: !0,
2504
+ enablePasteRules: !0,
2505
+ enableCoreExtensions: !0,
2506
+ enableContentCheck: !1,
2507
+ emitContentError: !1,
2508
+ onBeforeCreate: () => null,
2509
+ onCreate: () => null,
2510
+ onMount: () => null,
2511
+ onUnmount: () => null,
2512
+ onUpdate: () => null,
2513
+ onSelectionUpdate: () => null,
2514
+ onTransaction: () => null,
2515
+ onFocus: () => null,
2516
+ onBlur: () => null,
2517
+ onDestroy: () => null,
2518
+ onContentError: ({ error: o }) => {
2519
+ throw o;
2520
+ },
2521
+ onPaste: () => null,
2522
+ onDrop: () => null,
2523
+ onDelete: () => null
2524
+ }, this.isCapturingTransaction = !1, this.capturedTransaction = null, this.setOptions(t), this.createExtensionManager(), this.createCommandManager(), this.createSchema(), this.on("beforeCreate", this.options.onBeforeCreate), this.emit("beforeCreate", { editor: this }), this.on("mount", this.options.onMount), this.on("unmount", this.options.onUnmount), this.on("contentError", this.options.onContentError), this.on("create", this.options.onCreate), this.on("update", this.options.onUpdate), this.on("selectionUpdate", this.options.onSelectionUpdate), this.on("transaction", this.options.onTransaction), this.on("focus", this.options.onFocus), this.on("blur", this.options.onBlur), this.on("destroy", this.options.onDestroy), this.on("drop", ({ event: o, slice: s, moved: i }) => this.options.onDrop(o, s, i)), this.on("paste", ({ event: o, slice: s }) => this.options.onPaste(o, s)), this.on("delete", this.options.onDelete);
2525
+ const n = this.createDoc(), r = _t(n, this.options.autofocus);
2526
+ this.editorState = se.create({
2527
+ doc: n,
2528
+ schema: this.schema,
2529
+ selection: r || void 0
2530
+ }), this.options.element && this.mount(this.options.element);
2531
+ }
2532
+ /**
2533
+ * Attach the editor to the DOM, creating a new editor view.
2534
+ */
2535
+ mount(t) {
2536
+ if (typeof document > "u")
2537
+ throw new Error(
2538
+ "[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment."
2539
+ );
2540
+ this.createView(t), this.emit("mount", { editor: this }), window.setTimeout(() => {
2541
+ this.isDestroyed || (this.commands.focus(this.options.autofocus), this.emit("create", { editor: this }), this.isInitialized = !0);
2542
+ }, 0);
2543
+ }
2544
+ /**
2545
+ * Remove the editor from the DOM, but still allow remounting at a different point in time
2546
+ */
2547
+ unmount() {
2548
+ if (this.editorView) {
2549
+ const t = this.editorView.dom;
2550
+ t?.editor && delete t.editor, this.editorView.destroy();
2551
+ }
2552
+ if (this.editorView = null, this.isInitialized = !1, this.css)
2553
+ try {
2554
+ typeof this.css.remove == "function" ? this.css.remove() : this.css.parentNode && this.css.parentNode.removeChild(this.css);
2555
+ } catch (t) {
2556
+ console.warn("Failed to remove CSS element:", t);
2557
+ }
2558
+ this.css = null, this.emit("unmount", { editor: this });
2559
+ }
2560
+ /**
2561
+ * Returns the editor storage.
2562
+ */
2563
+ get storage() {
2564
+ return this.extensionStorage;
2565
+ }
2566
+ /**
2567
+ * An object of all registered commands.
2568
+ */
2569
+ get commands() {
2570
+ return this.commandManager.commands;
2571
+ }
2572
+ /**
2573
+ * Create a command chain to call multiple commands at once.
2574
+ */
2575
+ chain() {
2576
+ return this.commandManager.chain();
2577
+ }
2578
+ /**
2579
+ * Check if a command or a command chain can be executed. Without executing it.
2580
+ */
2581
+ can() {
2582
+ return this.commandManager.can();
2583
+ }
2584
+ /**
2585
+ * Inject CSS styles.
2586
+ */
2587
+ injectCSS() {
2588
+ this.options.injectCSS && typeof document < "u" && (this.css = Tr(xr, this.options.injectNonce));
2589
+ }
2590
+ /**
2591
+ * Update editor options.
2592
+ *
2593
+ * @param options A list of options
2594
+ */
2595
+ setOptions(t = {}) {
2596
+ this.options = {
2597
+ ...this.options,
2598
+ ...t
2599
+ }, !(!this.editorView || !this.state || this.isDestroyed) && (this.options.editorProps && this.view.setProps(this.options.editorProps), this.view.updateState(this.state));
2600
+ }
2601
+ /**
2602
+ * Update editable state of the editor.
2603
+ */
2604
+ setEditable(t, n = !0) {
2605
+ this.setOptions({ editable: t }), n && this.emit("update", { editor: this, transaction: this.state.tr, appendedTransactions: [] });
2606
+ }
2607
+ /**
2608
+ * Returns whether the editor is editable.
2609
+ */
2610
+ get isEditable() {
2611
+ return this.options.editable && this.view && this.view.editable;
2612
+ }
2613
+ /**
2614
+ * Returns the editor state.
2615
+ */
2616
+ get view() {
2617
+ return this.editorView ? this.editorView : new Proxy(
2618
+ {
2619
+ state: this.editorState,
2620
+ updateState: (t) => {
2621
+ this.editorState = t;
2622
+ },
2623
+ dispatch: (t) => {
2624
+ this.editorState = this.state.apply(t);
2625
+ },
2626
+ // Stub some commonly accessed properties to prevent errors
2627
+ composing: !1,
2628
+ dragging: null,
2629
+ editable: !0,
2630
+ isDestroyed: !1
2631
+ },
2632
+ {
2633
+ get: (t, n) => {
2634
+ if (n === "state")
2635
+ return this.editorState;
2636
+ if (n in t)
2637
+ return Reflect.get(t, n);
2638
+ throw new Error(
2639
+ `[tiptap error]: The editor view is not available. Cannot access view['${n}']. The editor may not be mounted yet.`
2640
+ );
2641
+ }
2642
+ }
2643
+ );
2644
+ }
2645
+ /**
2646
+ * Returns the editor state.
2647
+ */
2648
+ get state() {
2649
+ return this.editorView && (this.editorState = this.view.state), this.editorState;
2650
+ }
2651
+ /**
2652
+ * Register a ProseMirror plugin.
2653
+ *
2654
+ * @param plugin A ProseMirror plugin
2655
+ * @param handlePlugins Control how to merge the plugin into the existing plugins.
2656
+ * @returns The new editor state
2657
+ */
2658
+ registerPlugin(t, n) {
2659
+ const r = $t(n) ? n(t, [...this.state.plugins]) : [...this.state.plugins, t], o = this.state.reconfigure({ plugins: r });
2660
+ return this.view.updateState(o), o;
2661
+ }
2662
+ /**
2663
+ * Unregister a ProseMirror plugin.
2664
+ *
2665
+ * @param nameOrPluginKeyToRemove The plugins name
2666
+ * @returns The new editor state or undefined if the editor is destroyed
2667
+ */
2668
+ unregisterPlugin(t) {
2669
+ if (this.isDestroyed)
2670
+ return;
2671
+ const n = this.state.plugins;
2672
+ let r = n;
2673
+ if ([].concat(t).forEach((s) => {
2674
+ const i = typeof s == "string" ? `${s}$` : s.key;
2675
+ r = r.filter((a) => !a.key.startsWith(i));
2676
+ }), n.length === r.length)
2677
+ return;
2678
+ const o = this.state.reconfigure({
2679
+ plugins: r
2680
+ });
2681
+ return this.view.updateState(o), o;
2682
+ }
2683
+ /**
2684
+ * Creates an extension manager.
2685
+ */
2686
+ createExtensionManager() {
2687
+ var t, n;
2688
+ const o = [...this.options.enableCoreExtensions ? [
2689
+ Gt,
2690
+ Ht.configure({
2691
+ blockSeparator: (n = (t = this.options.coreExtensionOptions) == null ? void 0 : t.clipboardTextSerializer) == null ? void 0 : n.blockSeparator
2692
+ }),
2693
+ qt,
2694
+ Yt,
2695
+ Qt,
2696
+ te,
2697
+ Jt,
2698
+ Zt,
2699
+ Kt
2700
+ ].filter((s) => typeof this.options.enableCoreExtensions == "object" ? this.options.enableCoreExtensions[s.name] !== !1 : !0) : [], ...this.options.extensions].filter((s) => ["extension", "node", "mark"].includes(s?.type));
2701
+ this.extensionManager = new et(o, this);
2702
+ }
2703
+ /**
2704
+ * Creates an command manager.
2705
+ */
2706
+ createCommandManager() {
2707
+ this.commandManager = new Y({
2708
+ editor: this
2709
+ });
2710
+ }
2711
+ /**
2712
+ * Creates a ProseMirror schema.
2713
+ */
2714
+ createSchema() {
2715
+ this.schema = this.extensionManager.schema;
2716
+ }
2717
+ /**
2718
+ * Creates the initial document.
2719
+ */
2720
+ createDoc() {
2721
+ let t;
2722
+ try {
2723
+ t = it(this.options.content, this.schema, this.options.parseOptions, {
2724
+ errorOnInvalidContent: this.options.enableContentCheck
2725
+ });
2726
+ } catch (n) {
2727
+ if (!(n instanceof Error) || !["[tiptap error]: Invalid JSON content", "[tiptap error]: Invalid HTML content"].includes(n.message))
2728
+ throw n;
2729
+ this.emit("contentError", {
2730
+ editor: this,
2731
+ error: n,
2732
+ disableCollaboration: () => {
2733
+ "collaboration" in this.storage && typeof this.storage.collaboration == "object" && this.storage.collaboration && (this.storage.collaboration.isDisabled = !0), this.options.extensions = this.options.extensions.filter((r) => r.name !== "collaboration"), this.createExtensionManager();
2734
+ }
2735
+ }), t = it(this.options.content, this.schema, this.options.parseOptions, {
2736
+ errorOnInvalidContent: !1
2737
+ });
2738
+ }
2739
+ return t;
2740
+ }
2741
+ /**
2742
+ * Creates a ProseMirror view.
2743
+ */
2744
+ createView(t) {
2745
+ var n;
2746
+ this.editorView = new ae(t, {
2747
+ ...this.options.editorProps,
2748
+ attributes: {
2749
+ // add `role="textbox"` to the editor element
2750
+ role: "textbox",
2751
+ ...(n = this.options.editorProps) == null ? void 0 : n.attributes
2752
+ },
2753
+ dispatchTransaction: this.dispatchTransaction.bind(this),
2754
+ state: this.editorState
2755
+ });
2756
+ const r = this.state.reconfigure({
2757
+ plugins: this.extensionManager.plugins
2758
+ });
2759
+ this.view.updateState(r), this.createNodeViews(), this.prependClass(), this.injectCSS();
2760
+ const o = this.view.dom;
2761
+ o.editor = this;
2762
+ }
2763
+ /**
2764
+ * Creates all node and mark views.
2765
+ */
2766
+ createNodeViews() {
2767
+ this.view.isDestroyed || this.view.setProps({
2768
+ markViews: this.extensionManager.markViews,
2769
+ nodeViews: this.extensionManager.nodeViews
2770
+ });
2771
+ }
2772
+ /**
2773
+ * Prepend class name to element.
2774
+ */
2775
+ prependClass() {
2776
+ this.view.dom.className = `tiptap ${this.view.dom.className}`;
2777
+ }
2778
+ captureTransaction(t) {
2779
+ this.isCapturingTransaction = !0, t(), this.isCapturingTransaction = !1;
2780
+ const n = this.capturedTransaction;
2781
+ return this.capturedTransaction = null, n;
2782
+ }
2783
+ /**
2784
+ * The callback over which to send transactions (state updates) produced by the view.
2785
+ *
2786
+ * @param transaction An editor state transaction
2787
+ */
2788
+ dispatchTransaction(t) {
2789
+ if (this.view.isDestroyed)
2790
+ return;
2791
+ if (this.isCapturingTransaction) {
2792
+ if (!this.capturedTransaction) {
2793
+ this.capturedTransaction = t;
2794
+ return;
2795
+ }
2796
+ t.steps.forEach((d) => {
2797
+ var u;
2798
+ return (u = this.capturedTransaction) == null ? void 0 : u.step(d);
2799
+ });
2800
+ return;
2801
+ }
2802
+ const { state: n, transactions: r } = this.state.applyTransaction(t), o = !this.state.selection.eq(n.selection), s = r.includes(t), i = this.state;
2803
+ if (this.emit("beforeTransaction", {
2804
+ editor: this,
2805
+ transaction: t,
2806
+ nextState: n
2807
+ }), !s)
2808
+ return;
2809
+ this.view.updateState(n), this.emit("transaction", {
2810
+ editor: this,
2811
+ transaction: t,
2812
+ appendedTransactions: r.slice(1)
2813
+ }), o && this.emit("selectionUpdate", {
2814
+ editor: this,
2815
+ transaction: t
2816
+ });
2817
+ const a = r.findLast((d) => d.getMeta("focus") || d.getMeta("blur")), c = a?.getMeta("focus"), l = a?.getMeta("blur");
2818
+ c && this.emit("focus", {
2819
+ editor: this,
2820
+ event: c.event,
2821
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
2822
+ transaction: a
2823
+ }), l && this.emit("blur", {
2824
+ editor: this,
2825
+ event: l.event,
2826
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
2827
+ transaction: a
2828
+ }), !(t.getMeta("preventUpdate") || !r.some((d) => d.docChanged) || i.doc.eq(n.doc)) && this.emit("update", {
2829
+ editor: this,
2830
+ transaction: t,
2831
+ appendedTransactions: r.slice(1)
2832
+ });
2833
+ }
2834
+ /**
2835
+ * Get attributes of the currently selected node or mark.
2836
+ */
2837
+ getAttributes(t) {
2838
+ return Ye(this.state, t);
2839
+ }
2840
+ isActive(t, n) {
2841
+ const r = typeof t == "string" ? t : null, o = typeof t == "string" ? n : t;
2842
+ return nn(this.state, r, o);
2843
+ }
2844
+ /**
2845
+ * Get the document as JSON.
2846
+ */
2847
+ getJSON() {
2848
+ return this.state.doc.toJSON();
2849
+ }
2850
+ /**
2851
+ * Get the document as HTML.
2852
+ */
2853
+ getHTML() {
2854
+ return ut(this.state.doc.content, this.schema);
2855
+ }
2856
+ /**
2857
+ * Get the document as text.
2858
+ */
2859
+ getText(t) {
2860
+ const { blockSeparator: n = `
2861
+
2862
+ `, textSerializers: r = {} } = t || {};
2863
+ return Ge(this.state.doc, {
2864
+ blockSeparator: n,
2865
+ textSerializers: {
2866
+ ...Bt(this.schema),
2867
+ ...r
2868
+ }
2869
+ });
2870
+ }
2871
+ /**
2872
+ * Check if there is no content.
2873
+ */
2874
+ get isEmpty() {
2875
+ return mt(this.state.doc);
2876
+ }
2877
+ /**
2878
+ * Destroy the editor.
2879
+ */
2880
+ destroy() {
2881
+ this.emit("destroy"), this.unmount(), this.removeAllListeners();
2882
+ }
2883
+ /**
2884
+ * Check if the editor is already destroyed.
2885
+ */
2886
+ get isDestroyed() {
2887
+ var t, n;
2888
+ return (n = (t = this.editorView) == null ? void 0 : t.isDestroyed) != null ? n : !0;
2889
+ }
2890
+ $node(t, n) {
2891
+ var r;
2892
+ return ((r = this.$doc) == null ? void 0 : r.querySelector(t, n)) || null;
2893
+ }
2894
+ $nodes(t, n) {
2895
+ var r;
2896
+ return ((r = this.$doc) == null ? void 0 : r.querySelectorAll(t, n)) || null;
2897
+ }
2898
+ $pos(t) {
2899
+ const n = this.state.doc.resolve(t);
2900
+ return new Er(n, this);
2901
+ }
2902
+ get $doc() {
2903
+ return this.$pos(0);
2904
+ }
2905
+ };
2906
+ function zr(e) {
2907
+ return new tt({
2908
+ find: e.find,
2909
+ handler: ({ state: t, range: n, match: r }) => {
2910
+ const o = w(e.getAttributes, void 0, r);
2911
+ if (o === !1 || o === null)
2912
+ return null;
2913
+ const { tr: s } = t, i = r[r.length - 1], a = r[0];
2914
+ if (i) {
2915
+ const c = a.search(/\S/), l = n.from + a.indexOf(i), d = l + i.length;
2916
+ if (Dt(n.from, n.to, t.doc).filter((f) => f.mark.type.excluded.find((h) => h === e.type && h !== f.mark.type)).filter((f) => f.to > l).length)
2917
+ return null;
2918
+ d < n.to && s.delete(d, n.to), l > n.from && s.delete(n.from + c, l);
2919
+ const p = n.from + c + i.length;
2920
+ s.addMark(n.from + c, p, e.type.create(o || {})), s.removeStoredMark(e.type);
2921
+ }
2922
+ }
2923
+ });
2924
+ }
2925
+ function Vr(e) {
2926
+ return new tt({
2927
+ find: e.find,
2928
+ handler: ({ state: t, range: n, match: r }) => {
2929
+ const o = w(e.getAttributes, void 0, r) || {}, { tr: s } = t, i = n.from;
2930
+ let a = n.to;
2931
+ const c = e.type.create(o);
2932
+ if (r[1]) {
2933
+ const l = r[0].lastIndexOf(r[1]);
2934
+ let d = i + l;
2935
+ d > a ? d = a : a = d + r[1].length;
2936
+ const u = r[0][r[0].length - 1];
2937
+ s.insertText(u, i + r[0].length - 1), s.replaceWith(d, a, c);
2938
+ } else if (r[0]) {
2939
+ const l = e.type.isInline ? i : i - 1;
2940
+ s.insert(l, e.type.create(o)).delete(s.mapping.map(i), s.mapping.map(a));
2941
+ }
2942
+ s.scrollIntoView();
2943
+ }
2944
+ });
2945
+ }
2946
+ function Hr(e) {
2947
+ return new tt({
2948
+ find: e.find,
2949
+ handler: ({ state: t, range: n, match: r }) => {
2950
+ const o = t.doc.resolve(n.from), s = w(e.getAttributes, void 0, r) || {};
2951
+ if (!o.node(-1).canReplaceWith(o.index(-1), o.indexAfter(-1), e.type))
2952
+ return null;
2953
+ t.tr.delete(n.from, n.to).setBlockType(n.from, n.from, e.type, s);
2954
+ }
2955
+ });
2956
+ }
2957
+ function Wr(e) {
2958
+ return new tt({
2959
+ find: e.find,
2960
+ handler: ({ state: t, range: n, match: r, chain: o }) => {
2961
+ const s = w(e.getAttributes, void 0, r) || {}, i = t.tr.delete(n.from, n.to), c = i.doc.resolve(n.from).blockRange(), l = c && fe(c, e.type, s);
2962
+ if (!l)
2963
+ return null;
2964
+ if (i.wrap(c, l), e.keepMarks && e.editor) {
2965
+ const { selection: u, storedMarks: p } = t, { splittableMarks: f } = e.editor.extensionManager, m = p || u.$to.parentOffset && u.$from.marks();
2966
+ if (m) {
2967
+ const h = m.filter((v) => f.includes(v.type.name));
2968
+ i.ensureMarks(h);
2969
+ }
2970
+ }
2971
+ if (e.keepAttributes) {
2972
+ const u = e.type.name === "bulletList" || e.type.name === "orderedList" ? "listItem" : "taskList";
2973
+ o().updateAttributes(u, s).run();
2974
+ }
2975
+ const d = i.doc.resolve(n.from - 1).nodeBefore;
2976
+ d && d.type === e.type && ct(i.doc, n.from - 1) && (!e.joinPredicate || e.joinPredicate(r, d)) && i.join(n.from - 1);
2977
+ }
2978
+ });
2979
+ }
2980
+ function Ur(e, t) {
2981
+ const { selection: n } = e, { $from: r } = n;
2982
+ if (n instanceof G) {
2983
+ const s = r.index();
2984
+ return r.parent.canReplaceWith(s, s + 1, t);
2985
+ }
2986
+ let o = r.depth;
2987
+ for (; o >= 0; ) {
2988
+ const s = r.index(o);
2989
+ if (r.node(o).contentMatchAt(s).matchType(t))
2990
+ return !0;
2991
+ o -= 1;
2992
+ }
2993
+ return !1;
2994
+ }
2995
+ function Cr(e, t, n = {}) {
2996
+ const { state: r } = t, { doc: o, tr: s } = r, i = e;
2997
+ o.descendants((a, c) => {
2998
+ const l = s.mapping.map(c), d = s.mapping.map(c) + a.nodeSize;
2999
+ let u = null;
3000
+ if (a.marks.forEach((f) => {
3001
+ if (f !== i)
3002
+ return !1;
3003
+ u = f;
3004
+ }), !u)
3005
+ return;
3006
+ let p = !1;
3007
+ if (Object.keys(n).forEach((f) => {
3008
+ n[f] !== u.attrs[f] && (p = !0);
3009
+ }), p) {
3010
+ const f = e.type.create({
3011
+ ...e.attrs,
3012
+ ...n
3013
+ });
3014
+ s.removeMark(l, d, e.type), s.addMark(l, d, f);
3015
+ }
3016
+ }), s.docChanged && t.view.dispatch(s);
3017
+ }
3018
+ var qr = class ee extends ht {
3019
+ constructor() {
3020
+ super(...arguments), this.type = "node";
3021
+ }
3022
+ /**
3023
+ * Create a new Node instance
3024
+ * @param config - Node configuration object or a function that returns a configuration object
3025
+ */
3026
+ static create(t = {}) {
3027
+ const n = typeof t == "function" ? t() : t;
3028
+ return new ee(n);
3029
+ }
3030
+ configure(t) {
3031
+ return super.configure(t);
3032
+ }
3033
+ extend(t) {
3034
+ const n = typeof t == "function" ? t() : t;
3035
+ return super.extend(n);
3036
+ }
3037
+ };
3038
+ function Kr(e) {
3039
+ return new un({
3040
+ find: e.find,
3041
+ handler: ({ state: t, range: n, match: r, pasteEvent: o }) => {
3042
+ const s = w(e.getAttributes, void 0, r, o);
3043
+ if (s === !1 || s === null)
3044
+ return null;
3045
+ const { tr: i } = t, a = r[r.length - 1], c = r[0];
3046
+ let l = n.to;
3047
+ if (a) {
3048
+ const d = c.search(/\S/), u = n.from + c.indexOf(a), p = u + a.length;
3049
+ if (Dt(n.from, n.to, t.doc).filter((m) => m.mark.type.excluded.find((v) => v === e.type && v !== m.mark.type)).filter((m) => m.to > u).length)
3050
+ return null;
3051
+ p < n.to && i.delete(p, n.to), u > n.from && i.delete(n.from + d, u), l = n.from + d + a.length, i.addMark(n.from + d, l, e.type.create(s || {})), i.removeStoredMark(e.type);
3052
+ }
3053
+ }
3054
+ });
3055
+ }
3056
+ var Jr = (e, t) => {
3057
+ if (e === "slot")
3058
+ return 0;
3059
+ if (e instanceof Function)
3060
+ return e(t);
3061
+ const { children: n, ...r } = t ?? {};
3062
+ if (e === "svg")
3063
+ throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");
3064
+ return [e, r, n];
3065
+ };
3066
+ export {
3067
+ I as E,
3068
+ cn as M,
3069
+ qr as N,
3070
+ Kr as a,
3071
+ zr as b,
3072
+ Ur as c,
3073
+ ze as d,
3074
+ Dt as e,
3075
+ Br as f,
3076
+ tn as g,
3077
+ Jr as h,
3078
+ Fr as i,
3079
+ Ye as j,
3080
+ L as k,
3081
+ Dr as l,
3082
+ Ue as m,
3083
+ Vr as n,
3084
+ Rr as o,
3085
+ E as p,
3086
+ jr as q,
3087
+ w as r,
3088
+ y as s,
3089
+ Hr as t,
3090
+ He as u,
3091
+ mt as v,
3092
+ Wr as w,
3093
+ hn as x,
3094
+ ut as y,
3095
+ _r as z
3096
+ };