@vc-shell/framework 1.1.99-alpha.2 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/api/platform.ts +9883 -9883
- package/core/composables/useDynamicProperties/index.ts +16 -10
- package/core/composables/useNotifications/index.ts +1 -32
- package/core/composables/useSettings/index.ts +3 -8
- package/core/composables/useUser/index.ts +171 -74
- package/core/composables/useUserManagement/index.ts +25 -67
- package/core/interceptors/index.ts +56 -19
- package/core/plugins/signalR/index.ts +1 -27
- package/core/types/index.ts +0 -2
- package/dist/core/api/platform.d.ts +1 -1
- package/dist/core/api/platform.d.ts.map +1 -1
- package/dist/core/composables/useDynamicProperties/index.d.ts.map +1 -1
- package/dist/core/composables/useNotifications/index.d.ts.map +1 -1
- package/dist/core/composables/useSettings/index.d.ts.map +1 -1
- package/dist/core/composables/useUser/index.d.ts +9 -18
- package/dist/core/composables/useUser/index.d.ts.map +1 -1
- package/dist/core/composables/useUserManagement/index.d.ts +7 -7
- package/dist/core/composables/useUserManagement/index.d.ts.map +1 -1
- package/dist/core/interceptors/index.d.ts +1 -2
- package/dist/core/interceptors/index.d.ts.map +1 -1
- package/dist/core/plugins/signalR/index.d.ts +0 -2
- package/dist/core/plugins/signalR/index.d.ts.map +1 -1
- package/dist/core/types/index.d.ts +1 -1
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/index.d.ts +0 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/injection-keys.d.ts +1 -2
- package/dist/injection-keys.d.ts.map +1 -1
- package/dist/shared/components/app-switcher/composables/useAppSwitcher/index.d.ts.map +1 -1
- package/dist/shared/components/multilanguage-selector/multilanguage-selector.vue.d.ts +1 -1
- package/dist/shared/components/notifications/components/notification-container/index.d.ts +10 -10
- package/dist/shared/components/notifications/components/notification-container/index.d.ts.map +1 -1
- package/dist/shared/components/sign-in/useExternalProvider.d.ts +1 -1
- package/dist/shared/components/sign-in/useExternalProvider.d.ts.map +1 -1
- package/dist/shared/modules/assets-manager/components/assets-manager/assets-manager.vue.d.ts +2 -2
- package/dist/shared/modules/dynamic/helpers/nodeBuilder.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/pages/dynamic-blade-form.vue.d.ts +2 -2
- package/dist/shared/modules/dynamic/pages/dynamic-blade-list.vue.d.ts +2 -2
- package/dist/shared/pages/InvitePage/components/invite/Invite.vue.d.ts +1 -1
- package/dist/shared/pages/InvitePage/components/invite/Invite.vue.d.ts.map +1 -1
- package/dist/shared/pages/ResetPasswordPage/components/reset-password/ResetPassword.vue.d.ts +1 -1
- package/dist/shared/pages/ResetPasswordPage/components/reset-password/ResetPassword.vue.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/components/atoms/vc-badge/vc-badge.vue.d.ts +1 -1
- package/dist/ui/components/atoms/vc-badge/vc-badge.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-container/vc-container.vue.d.ts +2 -2
- package/dist/ui/components/atoms/vc-icon/vc-icon.vue.d.ts +1 -1
- package/dist/ui/components/atoms/vc-icon/vc-icon.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-progress/vc-progress.vue.d.ts +1 -1
- package/dist/ui/components/atoms/vc-progress/vc-progress.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/index.d.ts +1 -0
- package/dist/ui/components/molecules/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-accordion/_internal/vc-accordion-item/vc-accordion-item.vue.d.ts +34 -0
- package/dist/ui/components/molecules/vc-accordion/_internal/vc-accordion-item/vc-accordion-item.vue.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-accordion/index.d.ts +7 -0
- package/dist/ui/components/molecules/vc-accordion/index.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-accordion/vc-accordion.vue.d.ts +42 -0
- package/dist/ui/components/molecules/vc-accordion/vc-accordion.vue.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-editor/_internal/vc-editor-button.vue.d.ts +1 -1
- package/dist/ui/components/molecules/vc-file-upload/vc-file-upload.vue.d.ts +2 -2
- package/dist/ui/components/molecules/vc-file-upload/vc-file-upload.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.vue.d.ts +1 -1
- package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.vue.d.ts +1 -1
- package/dist/ui/components/molecules/vc-rating/vc-rating.vue.d.ts +1 -1
- package/dist/ui/components/molecules/vc-rating/vc-rating.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/vc-app-menu-item.vue.d.ts +1 -1
- 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
- package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts.map +1 -1
- 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 +1 -1
- 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 +1 -1
- 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
- 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 +1 -1
- 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
- package/dist/ui/components/organisms/vc-blade/vc-blade.backupsb.d.ts +3 -3
- package/dist/ui/components/organisms/vc-blade/vc-blade.vue.d.ts +1 -1
- package/dist/ui/components/organisms/vc-blade/vc-blade.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-gallery/_internal/vc-gallery-item/vc-gallery-item.vue.d.ts +2 -2
- package/dist/ui/components/organisms/vc-gallery/_internal/vc-gallery-preview/vc-gallery-preview.vue.d.ts +1 -1
- package/dist/ui/components/organisms/vc-gallery/_internal/vc-gallery-preview/vc-gallery-preview.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-gallery/vc-gallery.vue.d.ts +5 -5
- package/dist/ui/components/organisms/vc-gallery/vc-gallery.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-popup/vc-popup.vue.d.ts +1 -1
- package/dist/ui/components/organisms/vc-popup/vc-popup.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-counter/vc-table-counter.vue.d.ts +1 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-counter/vc-table-counter.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-body/vc-table-body.vue.d.ts +2 -2
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-row/vc-table-row.vue.d.ts +2 -2
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/vc-table-desktop-view.vue.d.ts +3 -3
- package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts +1 -1
- package/package.json +5 -7
- package/shared/components/app-switcher/components/vc-app-switcher/vc-app-switcher.vue +2 -2
- package/shared/components/app-switcher/composables/useAppSwitcher/index.ts +1 -15
- package/shared/components/sign-in/useExternalProvider.ts +1 -11
- package/shared/modules/dynamic/helpers/nodeBuilder.ts +3 -11
- package/ui/components/atoms/vc-badge/vc-badge.stories.ts +1 -1
- package/ui/components/atoms/vc-button/vc-button.stories.ts +1 -1
- package/ui/components/atoms/vc-card/vc-card.stories.ts +1 -1
- package/ui/components/atoms/vc-col/vc-col.stories.ts +1 -1
- package/ui/components/atoms/vc-container/vc-container.stories.ts +1 -1
- package/ui/components/atoms/vc-hint/vc-hint.stories.ts +1 -1
- package/ui/components/atoms/vc-icon/vc-icon.stories.ts +1 -1
- package/ui/components/atoms/vc-image/vc-image.stories.ts +1 -1
- package/ui/components/atoms/vc-label/vc-label.stories.ts +1 -1
- package/ui/components/atoms/vc-link/vc-link.stories.ts +1 -1
- package/ui/components/atoms/vc-progress/vc-progress.stories.ts +1 -1
- package/ui/components/atoms/vc-row/vc-row.stories.ts +1 -1
- package/ui/components/atoms/vc-skeleton/vc-skeleton.stories.ts +1 -1
- package/ui/components/atoms/vc-status/vc-status.stories.ts +1 -1
- package/ui/components/atoms/vc-status-icon/vc-status-icon.stories.ts +1 -1
- package/ui/components/atoms/vc-tooltip/vc-tooltip.stories.ts +1 -1
- package/ui/components/atoms/vc-video/vc-video.stories.ts +1 -1
- package/ui/components/atoms/vc-widget/vc-widget.stories.ts +1 -1
- package/ui/components/molecules/index.ts +1 -0
- package/ui/components/molecules/vc-accordion/_internal/vc-accordion-item/vc-accordion-item.vue +251 -0
- package/ui/components/molecules/vc-accordion/index.ts +11 -0
- package/ui/components/molecules/vc-accordion/vc-accordion.stories.ts +526 -0
- package/ui/components/molecules/vc-accordion/vc-accordion.vue +176 -0
- package/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.stories.ts +1 -1
- package/ui/components/molecules/vc-checkbox/vc-checkbox.stories.ts +1 -1
- package/ui/components/molecules/vc-editor/vc-editor.stories.ts +1 -1
- package/ui/components/molecules/vc-field/vc-field.stories.ts +1 -1
- package/ui/components/molecules/vc-file-upload/vc-file-upload.stories.ts +1 -1
- package/ui/components/molecules/vc-form/vc-form.stories.ts +1 -1
- package/ui/components/molecules/vc-input/vc-input.stories.ts +1 -1
- package/ui/components/molecules/vc-input-currency/vc-input-currency.stories.ts +1 -1
- package/ui/components/molecules/vc-input-dropdown/vc-input-dropdown.stories.ts +1 -1
- package/ui/components/molecules/vc-multivalue/vc-multivalue.stories.ts +1 -1
- package/ui/components/molecules/vc-pagination/vc-pagination.stories.ts +1 -1
- package/ui/components/molecules/vc-radio-button/vc-radio-button.stories.ts +1 -1
- package/ui/components/molecules/vc-rating/vc-rating.stories.ts +1 -1
- package/ui/components/molecules/vc-select/vc-select.stories.ts +1 -1
- package/ui/components/molecules/vc-slider/vc-slider.stories.ts +1 -1
- package/ui/components/molecules/vc-switch/vc-switch.stories.ts +1 -1
- package/ui/components/molecules/vc-textarea/vc-textarea.stories.ts +1 -1
- package/ui/components/molecules/vc-toast/vc-toast.stories.ts +1 -1
- package/ui/components/organisms/vc-app/vc-app.vue +2 -20
- package/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.vue +4 -0
- package/ui/components/organisms/vc-gallery/vc-gallery.stories.ts +1 -1
- package/ui/components/organisms/vc-popup/vc-popup.stories.ts +1 -1
- package/core/providers/README.md +0 -176
- package/core/providers/auth-provider-manager.ts +0 -74
- package/core/providers/auth-provider-utils.ts +0 -26
- package/core/providers/example-custom-auth-provider.ts +0 -162
- package/core/providers/index.ts +0 -3
- package/core/providers/platform-auth-provider.ts +0 -207
- package/core/types/auth-provider.ts +0 -40
- package/dist/assets/042c75b764bc78a7.svg +0 -1
- package/dist/assets/0ba156439a339f2a.svg +0 -1
- package/dist/assets/0be560bfb22d0e72.woff2 +0 -0
- package/dist/assets/0f590f8a94577092.svg +0 -1
- package/dist/assets/0fc5820f8be53a1b.svg +0 -1
- package/dist/assets/105efd028edc1dfe.woff +0 -0
- package/dist/assets/10768e2cc79fc60b.svg +0 -1
- package/dist/assets/11b3d25a56fd9a21.woff2 +0 -0
- package/dist/assets/154365acf3010d96.woff2 +0 -0
- package/dist/assets/157b8721e0600ea8.svg +0 -1
- package/dist/assets/15e91cdd649cde9a.svg +0 -1
- package/dist/assets/19275e398ae57130.woff2 +0 -0
- package/dist/assets/1a3e84b2457f709a.woff +0 -0
- package/dist/assets/1de63eb118636cce.svg +0 -1
- package/dist/assets/1ea01de36eb5491b.svg +0 -1
- package/dist/assets/204eaf512fde2023.svg +0 -1
- package/dist/assets/2088983edf42e153.svg +0 -1
- package/dist/assets/208f810a9321a327.svg +0 -1
- package/dist/assets/21220a9d10e6c558.svg +0 -1
- package/dist/assets/220db345a102045d.woff2 +0 -0
- package/dist/assets/225da11d23968333.svg +0 -1
- package/dist/assets/226f862dd81bdc13.woff2 +0 -0
- package/dist/assets/23a2d53395ddb14f.woff +0 -0
- package/dist/assets/259e6ad461a52ad7.svg +0 -1
- package/dist/assets/261e6dec4d53b9ac.woff +0 -0
- package/dist/assets/262f46a0b6d94bb6.svg +0 -1
- package/dist/assets/2857c513073467da.svg +0 -1
- package/dist/assets/2b3be7889467d98f.woff +0 -0
- package/dist/assets/2d4e6190eec72737.svg +0 -1
- package/dist/assets/2eba973185078bc8.woff +0 -0
- package/dist/assets/334d3f6bc766c516.woff +0 -0
- package/dist/assets/34ff7dd0c2285956.svg +0 -1
- package/dist/assets/3d26b7c1ab78bbe2.woff +0 -0
- package/dist/assets/3d892965ab4f1cbb.woff2 +0 -0
- package/dist/assets/3f8c4cc8099e34b6.woff2 +0 -0
- package/dist/assets/40a0e53b79ce63c6.woff2 +0 -0
- package/dist/assets/41275bcb979cb650.svg +0 -1
- package/dist/assets/434f7982590e462f.woff +0 -0
- package/dist/assets/475937116ee3314a.woff2 +0 -0
- package/dist/assets/489710fb710e73f0.woff +0 -0
- package/dist/assets/49791943b3872376.woff2 +0 -0
- package/dist/assets/4ae5f23e0ca888e7.woff2 +0 -0
- package/dist/assets/4d7a77b0e5373992.svg +0 -1
- package/dist/assets/4e43c74354534fb3.svg +0 -1
- package/dist/assets/4fe75f5117100705.svg +0 -1
- package/dist/assets/52e261a005074e1b.woff +0 -0
- package/dist/assets/5304c3d05a5f9789.woff2 +0 -0
- package/dist/assets/54cda5482c6c9218.woff +0 -0
- package/dist/assets/550f52072e8ccafe.woff2 +0 -0
- package/dist/assets/572bb1bb4156a9c1.svg +0 -1
- package/dist/assets/6075995d7e74da46.woff2 +0 -0
- package/dist/assets/617c4736236e199e.woff +0 -0
- package/dist/assets/67230f05dc94a265.svg +0 -1
- package/dist/assets/6798e4dd4add9b48.svg +0 -1
- package/dist/assets/686d4077c1e26876.woff2 +0 -0
- package/dist/assets/698ec6c722d4cb05.woff2 +0 -0
- package/dist/assets/6a3e73faf406cf33.svg +0 -1
- package/dist/assets/72de3a63bc0b70dd.svg +0 -1
- package/dist/assets/74c6a6ab81bb6340.woff2 +0 -0
- package/dist/assets/74ed5f8a78e71106.svg +0 -1
- package/dist/assets/7a5aa5abd625137f.ttf +0 -0
- package/dist/assets/7ce0c166fd6a1204.woff +0 -0
- package/dist/assets/7d55399c2a7bc985.svg +0 -1
- package/dist/assets/7d970675c69fca1d.woff +0 -0
- package/dist/assets/7eda727273fd98d3.svg +0 -1
- package/dist/assets/7f6ebfd707b76ca2.woff +0 -0
- package/dist/assets/7fa898d213fcc7bc.woff2 +0 -0
- package/dist/assets/861e6b7192b3b6c7.woff +0 -0
- package/dist/assets/8bbcde81ba21ecb2.woff2 +0 -0
- package/dist/assets/8f6657e5e0b8d3e4.woff +0 -0
- package/dist/assets/910b0d99b9e26568.svg +0 -1
- package/dist/assets/91fe94e424323d61.woff +0 -0
- package/dist/assets/92508f8707159b51.svg +0 -1
- package/dist/assets/9392bf1d591e1abb.svg +0 -1
- package/dist/assets/97e8d4984ba0713a.woff2 +0 -0
- package/dist/assets/9cb83236f6bb7ab1.svg +0 -1
- package/dist/assets/9d37314695c0b68d.woff +0 -0
- package/dist/assets/a03cdcd8da5bb987.woff +0 -0
- package/dist/assets/a18404194e3f9047.svg +0 -1
- package/dist/assets/a2017fe7f0a26510.svg +0 -1
- package/dist/assets/ab6e7190bb1492d5.woff2 +0 -0
- package/dist/assets/abf88f301a0730f4.svg +0 -1
- package/dist/assets/ac1a99b3d05d8232.woff +0 -0
- package/dist/assets/aed17cb6fdad2ada.woff2 +0 -0
- package/dist/assets/b1a596e31ad1185a.svg +0 -1
- package/dist/assets/b27767411c8427be.woff +0 -0
- package/dist/assets/b325adcae33bbe7a.svg +0 -1
- package/dist/assets/b372390551ca2fa1.svg +0 -1
- package/dist/assets/b5bb1e8fc975decd.svg +0 -1
- package/dist/assets/b645a4a2181b9dc1.svg +0 -1
- package/dist/assets/b6499ddce0a4ef7d.svg +0 -1
- package/dist/assets/b94421fadd23b0f2.svg +0 -1
- package/dist/assets/bb28fb0f27f1c11b.svg +0 -1
- package/dist/assets/c9191b638a10f67b.woff2 +0 -0
- package/dist/assets/ca791c5ca5848a03.svg +0 -1
- package/dist/assets/cb32840ce330103f.woff +0 -0
- package/dist/assets/ccc878931d74181b.woff2 +0 -0
- package/dist/assets/d084bda16abe8a56.svg +0 -1
- package/dist/assets/d32b129cae2fffd6.svg +0 -1
- package/dist/assets/d35a4c7113315758.woff2 +0 -0
- package/dist/assets/d3f792f54ae4c307.svg +0 -1
- package/dist/assets/d5a5b8630120073d.svg +0 -1
- package/dist/assets/d5f9664ebbfb104b.svg +0 -1
- package/dist/assets/d84247b59449dd88.woff2 +0 -0
- package/dist/assets/dceaf3b39091e6a4.woff +0 -0
- package/dist/assets/dd05d43ff0df2fc7.svg +0 -1
- package/dist/assets/e2ad5b3428289141.woff +0 -0
- package/dist/assets/e38acaa1757232e0.svg +0 -1
- package/dist/assets/e4a8550f1c7ffe36.svg +0 -1
- package/dist/assets/e5adb5ae3a3698f6.svg +0 -1
- package/dist/assets/e61a1889bac955f4.woff2 +0 -0
- package/dist/assets/e72bb11356af94c7.svg +0 -1
- package/dist/assets/e98196a9f8dcb2f0.svg +0 -1
- package/dist/assets/ebec912a42ad49ff.woff +0 -0
- package/dist/assets/ee6983981ffcbb41.woff2 +0 -0
- package/dist/assets/f09d89268e4c0317.svg +0 -1
- package/dist/assets/f239394367fcf005.woff2 +0 -0
- package/dist/assets/f5722262b6e7214e.woff2 +0 -0
- package/dist/assets/f7fc8bf46089d8b2.svg +0 -1
- package/dist/assets/fc829e3f399b70e0.woff2 +0 -0
- package/dist/assets/fe141d99763f5d2b.woff +0 -0
- package/dist/assets/fed13b0d59903483.svg +0 -1
- package/dist/assets/fed757d2c2344ead.woff2 +0 -0
- package/dist/assets/ffc438f20e79ce73.woff +0 -0
- package/dist/core/providers/auth-provider-manager.d.ts +0 -34
- package/dist/core/providers/auth-provider-manager.d.ts.map +0 -1
- package/dist/core/providers/auth-provider-utils.d.ts +0 -17
- package/dist/core/providers/auth-provider-utils.d.ts.map +0 -1
- package/dist/core/providers/example-custom-auth-provider.d.ts +0 -45
- package/dist/core/providers/example-custom-auth-provider.d.ts.map +0 -1
- package/dist/core/providers/index.d.ts +0 -3
- package/dist/core/providers/index.d.ts.map +0 -1
- package/dist/core/providers/platform-auth-provider.d.ts +0 -34
- package/dist/core/providers/platform-auth-provider.d.ts.map +0 -1
- package/dist/core/types/auth-provider.d.ts +0 -27
- package/dist/core/types/auth-provider.d.ts.map +0 -1
- package/dist/framework.js +0 -25048
- package/dist/index.css +0 -9
- package/dist/vendor-boolbase-A_-Pp38P.js +0 -23
- package/dist/vendor-cheerio-C46iBpCu.js +0 -1053
- package/dist/vendor-cheerio-select-C8emRZsx.js +0 -191
- package/dist/vendor-core-js-DDuR6YMQ.js +0 -1206
- package/dist/vendor-css-select-DR9bp36p.js +0 -622
- package/dist/vendor-css-what-CZZaquJM.js +0 -267
- package/dist/vendor-cypress-signalr-mock-DjBxJHA6.js +0 -769
- package/dist/vendor-date-fns-sZ1zMzTH.js +0 -3008
- package/dist/vendor-dom-serializer-Sk3xHhQk.js +0 -213
- package/dist/vendor-domelementtype-B3sFIGaC.js +0 -21
- package/dist/vendor-domhandler-CL40eeX9.js +0 -311
- package/dist/vendor-dompurify-BuxjWxA2.js +0 -553
- package/dist/vendor-domutils-BiVCXO8c.js +0 -386
- package/dist/vendor-entities-CCReaWqU.js +0 -364
- package/dist/vendor-floating-ui-core-Cl9nBI4j.js +0 -349
- package/dist/vendor-floating-ui-dom-3z44E4mf.js +0 -395
- package/dist/vendor-floating-ui-utils-D2sT7feD.js +0 -259
- package/dist/vendor-floating-ui-vue-ClrgkeO5.js +0 -107
- package/dist/vendor-headlessui-vue-D7tzx4PC.js +0 -961
- package/dist/vendor-htmlparser2-CpQu33io.js +0 -735
- package/dist/vendor-intlify-core-base-Da62SG4M.js +0 -1130
- package/dist/vendor-intlify-message-compiler-CHvGSH2u.js +0 -952
- package/dist/vendor-intlify-shared-jWBPd9WB.js +0 -144
- package/dist/vendor-iso-639-1-BJO6WZAt.js +0 -781
- package/dist/vendor-linkify-it-LzoUhj6C.js +0 -199
- package/dist/vendor-linkifyjs-dCH9UYes.js +0 -701
- package/dist/vendor-lodash-es-BqkGj3Jl.js +0 -4816
- package/dist/vendor-lucide-vue-next-m0L4DzUL.js +0 -29780
- package/dist/vendor-markdown-it-Czg9qJTh.js +0 -2263
- package/dist/vendor-markdown-it-task-lists-BxLwscWK.js +0 -69
- package/dist/vendor-mdurl-DZFDNdqC.js +0 -192
- package/dist/vendor-microsoft-applicationinsights-analytics-js-C1Yxuzwg.js +0 -1207
- package/dist/vendor-microsoft-applicationinsights-cfgsync-js-DArHD4Dn.js +0 -261
- package/dist/vendor-microsoft-applicationinsights-channel-js-Dbs0XRes.js +0 -1822
- package/dist/vendor-microsoft-applicationinsights-common-OjU3Zs6r.js +0 -1921
- package/dist/vendor-microsoft-applicationinsights-core-js-DWRvqBek.js +0 -4276
- package/dist/vendor-microsoft-applicationinsights-dependencies-js-BxTNw-Sk.js +0 -1407
- package/dist/vendor-microsoft-applicationinsights-properties-js-Gfhpu-At.js +0 -572
- package/dist/vendor-microsoft-applicationinsights-shims-CxtPYiwp.js +0 -43
- package/dist/vendor-microsoft-applicationinsights-web-9yeJ0EZv.js +0 -487
- package/dist/vendor-microsoft-dynamicproto-js-DSkQkH3T.js +0 -147
- package/dist/vendor-microsoft-signalr-Bgpbb4fW.js +0 -1761
- package/dist/vendor-moment-DMLRxgRE.js +0 -2589
- package/dist/vendor-nevware21-ts-async-CdMc_sGt.js +0 -261
- package/dist/vendor-nevware21-ts-utils-Dy41wRhA.js +0 -853
- package/dist/vendor-nth-check-CS1D-zr5.js +0 -45
- package/dist/vendor-orderedmap-B3SOk52B.js +0 -103
- package/dist/vendor-parse5-htmlparser2-tree-adapter-BWywtwol.js +0 -143
- package/dist/vendor-parse5-zq5Hn0y9.js +0 -5749
- package/dist/vendor-prettier-cZc5sCiS.js +0 -4875
- package/dist/vendor-prosemirror-commands-Cu1q5ZDk.js +0 -385
- package/dist/vendor-prosemirror-dropcursor-BuGmFgFS.js +0 -86
- package/dist/vendor-prosemirror-gapcursor-CyYcCWVK.js +0 -203
- package/dist/vendor-prosemirror-history-DzRcbrCw.js +0 -248
- package/dist/vendor-prosemirror-keymap-KfbdOEJw.js +0 -62
- package/dist/vendor-prosemirror-markdown-OyxRuawK.js +0 -650
- package/dist/vendor-prosemirror-model-DFp4ML7B.js +0 -2730
- package/dist/vendor-prosemirror-schema-list-CwCUArvx.js +0 -87
- package/dist/vendor-prosemirror-state-DHaVEu5h.js +0 -821
- package/dist/vendor-prosemirror-tables-mYok4vGT.js +0 -1711
- package/dist/vendor-prosemirror-transform-CAHmg-qG.js +0 -1508
- package/dist/vendor-prosemirror-view-CspJa44O.js +0 -3751
- package/dist/vendor-punycode-js-CgGegfA_.js +0 -133
- package/dist/vendor-rope-sequence-BWC2FSrq.js +0 -100
- package/dist/vendor-semver-Dar8oU3V.js +0 -1023
- package/dist/vendor-swiper-1bp0oJwt.js +0 -3387
- package/dist/vendor-tanstack-virtual-core-l0sNRNKZ.js +0 -1
- package/dist/vendor-tanstack-vue-virtual-CD9yLWd7.js +0 -1
- package/dist/vendor-tiptap-core-ClsTgaMv.js +0 -3699
- package/dist/vendor-tiptap-extension-blockquote-r1MBx4hD.js +0 -54
- package/dist/vendor-tiptap-extension-bold-BjLI4i8b.js +0 -74
- package/dist/vendor-tiptap-extension-code-D5-kDnMW.js +0 -52
- package/dist/vendor-tiptap-extension-code-block-RjEb0zPA.js +0 -215
- package/dist/vendor-tiptap-extension-document--PLOxIdq.js +0 -12
- package/dist/vendor-tiptap-extension-hard-break-9cxC2YOS.js +0 -59
- package/dist/vendor-tiptap-extension-heading-2w0TutHn.js +0 -63
- package/dist/vendor-tiptap-extension-horizontal-rule-CFowa_lc.js +0 -56
- package/dist/vendor-tiptap-extension-image-aWn-na6j.js +0 -127
- package/dist/vendor-tiptap-extension-italic-Bn-6saY0.js +0 -73
- package/dist/vendor-tiptap-extension-link-BmcG1_k-.js +0 -298
- package/dist/vendor-tiptap-extension-list-BrNBJ45n.js +0 -707
- package/dist/vendor-tiptap-extension-paragraph-DAiYhwUB.js +0 -41
- package/dist/vendor-tiptap-extension-placeholder-9tURDKy-.js +0 -1
- package/dist/vendor-tiptap-extension-strike-DqbXPfos.js +0 -64
- package/dist/vendor-tiptap-extension-table-DQwPaR7v.js +0 -374
- package/dist/vendor-tiptap-extension-table-cell-C0tEP_0i.js +0 -1
- package/dist/vendor-tiptap-extension-table-header-C0tEP_0i.js +0 -1
- package/dist/vendor-tiptap-extension-table-row-C0tEP_0i.js +0 -1
- package/dist/vendor-tiptap-extension-text-BFnfj70b.js +0 -13
- package/dist/vendor-tiptap-extension-text-style-Darua3qr.js +0 -235
- package/dist/vendor-tiptap-extension-underline-QyVnBqQZ.js +0 -65
- package/dist/vendor-tiptap-extensions-CU-D7bfm.js +0 -290
- package/dist/vendor-tiptap-markdown-BwATYN5A.js +0 -826
- package/dist/vendor-tiptap-pm-d91nGny8.js +0 -1
- package/dist/vendor-tiptap-starter-kit-5luf7zzS.js +0 -28
- package/dist/vendor-tiptap-vue-3-CFBErZGb.js +0 -157
- package/dist/vendor-truncate-html-DYC0Lj9o.js +0 -145
- package/dist/vendor-uc-micro-4lbSaZOs.js +0 -17
- package/dist/vendor-vee-validate-i18n-zT8NxX3R.js +0 -93
- package/dist/vendor-vee-validate-rules-4oWUZPpG.js +0 -316
- package/dist/vendor-vue-currency-input-BqaYAdhD.js +0 -317
- package/dist/vendor-vue-demi-CD9yLWd7.js +0 -1
- package/dist/vendor-vue-devtools-api-aVYGocXp.js +0 -93
- package/dist/vendor-vue-i18n-CO5LWKE0.js +0 -1370
- package/dist/vendor-vue3-application-insights-BKiiWnf2.js +0 -69
- package/dist/vendor-vue3-touch-events-DqysuuWh.js +0 -169
- package/dist/vendor-vuepic-vue-datepicker-CaY_xSnG.js +0 -4998
- package/dist/vendor-vueuse-components-sgKpNzof.js +0 -542
- package/dist/vendor-vueuse-core-D0cN7FqY.js +0 -5130
- package/dist/vendor-vueuse-shared-Pt0UEStA.js +0 -1169
- package/dist/vendor-w3c-keyname-CLxH8j-f.js +0 -92
|
@@ -1,1711 +0,0 @@
|
|
|
1
|
-
import { P as fe, a as Z, S as N, b as ye, T as E, N as Se } from "./vendor-prosemirror-state-DHaVEu5h.js";
|
|
2
|
-
import { F as R, S as v } from "./vendor-prosemirror-model-DFp4ML7B.js";
|
|
3
|
-
import { D as X, a as q } from "./vendor-prosemirror-view-CspJa44O.js";
|
|
4
|
-
import { k as Ae } from "./vendor-prosemirror-keymap-KfbdOEJw.js";
|
|
5
|
-
import { T as Re } from "./vendor-prosemirror-transform-CAHmg-qG.js";
|
|
6
|
-
var J, U;
|
|
7
|
-
if (typeof WeakMap < "u") {
|
|
8
|
-
let t = /* @__PURE__ */ new WeakMap();
|
|
9
|
-
J = (e) => t.get(e), U = (e, o) => (t.set(e, o), o);
|
|
10
|
-
} else {
|
|
11
|
-
const t = [];
|
|
12
|
-
let o = 0;
|
|
13
|
-
J = (n) => {
|
|
14
|
-
for (let l = 0; l < t.length; l += 2)
|
|
15
|
-
if (t[l] == n) return t[l + 1];
|
|
16
|
-
}, U = (n, l) => (o == 10 && (o = 0), t[o++] = n, t[o++] = l);
|
|
17
|
-
}
|
|
18
|
-
var C = class {
|
|
19
|
-
constructor(t, e, o, n) {
|
|
20
|
-
this.width = t, this.height = e, this.map = o, this.problems = n;
|
|
21
|
-
}
|
|
22
|
-
// Find the dimensions of the cell at the given position.
|
|
23
|
-
findCell(t) {
|
|
24
|
-
for (let e = 0; e < this.map.length; e++) {
|
|
25
|
-
const o = this.map[e];
|
|
26
|
-
if (o != t) continue;
|
|
27
|
-
const n = e % this.width, l = e / this.width | 0;
|
|
28
|
-
let s = n + 1, r = l + 1;
|
|
29
|
-
for (let c = 1; s < this.width && this.map[e + c] == o; c++)
|
|
30
|
-
s++;
|
|
31
|
-
for (let c = 1; r < this.height && this.map[e + this.width * c] == o; c++)
|
|
32
|
-
r++;
|
|
33
|
-
return { left: n, top: l, right: s, bottom: r };
|
|
34
|
-
}
|
|
35
|
-
throw new RangeError(`No cell with offset ${t} found`);
|
|
36
|
-
}
|
|
37
|
-
// Find the left side of the cell at the given position.
|
|
38
|
-
colCount(t) {
|
|
39
|
-
for (let e = 0; e < this.map.length; e++)
|
|
40
|
-
if (this.map[e] == t)
|
|
41
|
-
return e % this.width;
|
|
42
|
-
throw new RangeError(`No cell with offset ${t} found`);
|
|
43
|
-
}
|
|
44
|
-
// Find the next cell in the given direction, starting from the cell
|
|
45
|
-
// at `pos`, if any.
|
|
46
|
-
nextCell(t, e, o) {
|
|
47
|
-
const { left: n, right: l, top: s, bottom: r } = this.findCell(t);
|
|
48
|
-
return e == "horiz" ? (o < 0 ? n == 0 : l == this.width) ? null : this.map[s * this.width + (o < 0 ? n - 1 : l)] : (o < 0 ? s == 0 : r == this.height) ? null : this.map[n + this.width * (o < 0 ? s - 1 : r)];
|
|
49
|
-
}
|
|
50
|
-
// Get the rectangle spanning the two given cells.
|
|
51
|
-
rectBetween(t, e) {
|
|
52
|
-
const {
|
|
53
|
-
left: o,
|
|
54
|
-
right: n,
|
|
55
|
-
top: l,
|
|
56
|
-
bottom: s
|
|
57
|
-
} = this.findCell(t), {
|
|
58
|
-
left: r,
|
|
59
|
-
right: c,
|
|
60
|
-
top: i,
|
|
61
|
-
bottom: a
|
|
62
|
-
} = this.findCell(e);
|
|
63
|
-
return {
|
|
64
|
-
left: Math.min(o, r),
|
|
65
|
-
top: Math.min(l, i),
|
|
66
|
-
right: Math.max(n, c),
|
|
67
|
-
bottom: Math.max(s, a)
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
// Return the position of all cells that have the top left corner in
|
|
71
|
-
// the given rectangle.
|
|
72
|
-
cellsInRect(t) {
|
|
73
|
-
const e = [], o = {};
|
|
74
|
-
for (let n = t.top; n < t.bottom; n++)
|
|
75
|
-
for (let l = t.left; l < t.right; l++) {
|
|
76
|
-
const s = n * this.width + l, r = this.map[s];
|
|
77
|
-
o[r] || (o[r] = !0, !(l == t.left && l && this.map[s - 1] == r || n == t.top && n && this.map[s - this.width] == r) && e.push(r));
|
|
78
|
-
}
|
|
79
|
-
return e;
|
|
80
|
-
}
|
|
81
|
-
// Return the position at which the cell at the given row and column
|
|
82
|
-
// starts, or would start, if a cell started there.
|
|
83
|
-
positionAt(t, e, o) {
|
|
84
|
-
for (let n = 0, l = 0; ; n++) {
|
|
85
|
-
const s = l + o.child(n).nodeSize;
|
|
86
|
-
if (n == t) {
|
|
87
|
-
let r = e + t * this.width;
|
|
88
|
-
const c = (t + 1) * this.width;
|
|
89
|
-
for (; r < c && this.map[r] < l; ) r++;
|
|
90
|
-
return r == c ? s - 1 : this.map[r];
|
|
91
|
-
}
|
|
92
|
-
l = s;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
// Find the table map for the given table node.
|
|
96
|
-
static get(t) {
|
|
97
|
-
return J(t) || U(t, xe(t));
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
function xe(t) {
|
|
101
|
-
if (t.type.spec.tableRole != "table")
|
|
102
|
-
throw new RangeError("Not a table node: " + t.type.name);
|
|
103
|
-
const e = Me(t), o = t.childCount, n = [];
|
|
104
|
-
let l = 0, s = null;
|
|
105
|
-
const r = [];
|
|
106
|
-
for (let a = 0, d = e * o; a < d; a++) n[a] = 0;
|
|
107
|
-
for (let a = 0, d = 0; a < o; a++) {
|
|
108
|
-
const f = t.child(a);
|
|
109
|
-
d++;
|
|
110
|
-
for (let p = 0; ; p++) {
|
|
111
|
-
for (; l < n.length && n[l] != 0; ) l++;
|
|
112
|
-
if (p == f.childCount) break;
|
|
113
|
-
const m = f.child(p), { colspan: g, rowspan: b, colwidth: H } = m.attrs;
|
|
114
|
-
for (let B = 0; B < b; B++) {
|
|
115
|
-
if (B + a >= o) {
|
|
116
|
-
(s || (s = [])).push({
|
|
117
|
-
type: "overlong_rowspan",
|
|
118
|
-
pos: d,
|
|
119
|
-
n: b - B
|
|
120
|
-
});
|
|
121
|
-
break;
|
|
122
|
-
}
|
|
123
|
-
const j = l + B * e;
|
|
124
|
-
for (let k = 0; k < g; k++) {
|
|
125
|
-
n[j + k] == 0 ? n[j + k] = d : (s || (s = [])).push({
|
|
126
|
-
type: "collision",
|
|
127
|
-
row: a,
|
|
128
|
-
pos: d,
|
|
129
|
-
n: g - k
|
|
130
|
-
});
|
|
131
|
-
const _ = H && H[k];
|
|
132
|
-
if (_) {
|
|
133
|
-
const L = (j + k) % e * 2, K = r[L];
|
|
134
|
-
K == null || K != _ && r[L + 1] == 1 ? (r[L] = _, r[L + 1] = 1) : K == _ && r[L + 1]++;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
l += g, d += m.nodeSize;
|
|
139
|
-
}
|
|
140
|
-
const u = (a + 1) * e;
|
|
141
|
-
let h = 0;
|
|
142
|
-
for (; l < u; ) n[l++] == 0 && h++;
|
|
143
|
-
h && (s || (s = [])).push({ type: "missing", row: a, n: h }), d++;
|
|
144
|
-
}
|
|
145
|
-
(e === 0 || o === 0) && (s || (s = [])).push({ type: "zero_sized" });
|
|
146
|
-
const c = new C(e, o, n, s);
|
|
147
|
-
let i = !1;
|
|
148
|
-
for (let a = 0; !i && a < r.length; a += 2)
|
|
149
|
-
r[a] != null && r[a + 1] < o && (i = !0);
|
|
150
|
-
return i && Ne(c, r, t), c;
|
|
151
|
-
}
|
|
152
|
-
function Me(t) {
|
|
153
|
-
let e = -1, o = !1;
|
|
154
|
-
for (let n = 0; n < t.childCount; n++) {
|
|
155
|
-
const l = t.child(n);
|
|
156
|
-
let s = 0;
|
|
157
|
-
if (o)
|
|
158
|
-
for (let r = 0; r < n; r++) {
|
|
159
|
-
const c = t.child(r);
|
|
160
|
-
for (let i = 0; i < c.childCount; i++) {
|
|
161
|
-
const a = c.child(i);
|
|
162
|
-
r + a.attrs.rowspan > n && (s += a.attrs.colspan);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
for (let r = 0; r < l.childCount; r++) {
|
|
166
|
-
const c = l.child(r);
|
|
167
|
-
s += c.attrs.colspan, c.attrs.rowspan > 1 && (o = !0);
|
|
168
|
-
}
|
|
169
|
-
e == -1 ? e = s : e != s && (e = Math.max(e, s));
|
|
170
|
-
}
|
|
171
|
-
return e;
|
|
172
|
-
}
|
|
173
|
-
function Ne(t, e, o) {
|
|
174
|
-
t.problems || (t.problems = []);
|
|
175
|
-
const n = {};
|
|
176
|
-
for (let l = 0; l < t.map.length; l++) {
|
|
177
|
-
const s = t.map[l];
|
|
178
|
-
if (n[s]) continue;
|
|
179
|
-
n[s] = !0;
|
|
180
|
-
const r = o.nodeAt(s);
|
|
181
|
-
if (!r)
|
|
182
|
-
throw new RangeError(`No cell with offset ${s} found`);
|
|
183
|
-
let c = null;
|
|
184
|
-
const i = r.attrs;
|
|
185
|
-
for (let a = 0; a < i.colspan; a++) {
|
|
186
|
-
const d = (l + a) % t.width, f = e[d * 2];
|
|
187
|
-
f != null && (!i.colwidth || i.colwidth[a] != f) && ((c || (c = ze(i)))[a] = f);
|
|
188
|
-
}
|
|
189
|
-
c && t.problems.unshift({
|
|
190
|
-
type: "colwidth mismatch",
|
|
191
|
-
pos: s,
|
|
192
|
-
colwidth: c
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
function ze(t) {
|
|
197
|
-
if (t.colwidth) return t.colwidth.slice();
|
|
198
|
-
const e = [];
|
|
199
|
-
for (let o = 0; o < t.colspan; o++) e.push(0);
|
|
200
|
-
return e;
|
|
201
|
-
}
|
|
202
|
-
function y(t) {
|
|
203
|
-
let e = t.cached.tableNodeTypes;
|
|
204
|
-
if (!e) {
|
|
205
|
-
e = t.cached.tableNodeTypes = {};
|
|
206
|
-
for (const o in t.nodes) {
|
|
207
|
-
const n = t.nodes[o], l = n.spec.tableRole;
|
|
208
|
-
l && (e[l] = n);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
return e;
|
|
212
|
-
}
|
|
213
|
-
var z = new Z("selectingCells");
|
|
214
|
-
function D(t) {
|
|
215
|
-
for (let e = t.depth - 1; e > 0; e--)
|
|
216
|
-
if (t.node(e).type.spec.tableRole == "row")
|
|
217
|
-
return t.node(0).resolve(t.before(e + 1));
|
|
218
|
-
return null;
|
|
219
|
-
}
|
|
220
|
-
function ve(t) {
|
|
221
|
-
for (let e = t.depth; e > 0; e--) {
|
|
222
|
-
const o = t.node(e).type.spec.tableRole;
|
|
223
|
-
if (o === "cell" || o === "header_cell") return t.node(e);
|
|
224
|
-
}
|
|
225
|
-
return null;
|
|
226
|
-
}
|
|
227
|
-
function A(t) {
|
|
228
|
-
const e = t.selection.$head;
|
|
229
|
-
for (let o = e.depth; o > 0; o--)
|
|
230
|
-
if (e.node(o).type.spec.tableRole == "row") return !0;
|
|
231
|
-
return !1;
|
|
232
|
-
}
|
|
233
|
-
function O(t) {
|
|
234
|
-
const e = t.selection;
|
|
235
|
-
if ("$anchorCell" in e && e.$anchorCell)
|
|
236
|
-
return e.$anchorCell.pos > e.$headCell.pos ? e.$anchorCell : e.$headCell;
|
|
237
|
-
if ("node" in e && e.node && e.node.type.spec.tableRole == "cell")
|
|
238
|
-
return e.$anchor;
|
|
239
|
-
const o = D(e.$head) || ke(e.$head);
|
|
240
|
-
if (o)
|
|
241
|
-
return o;
|
|
242
|
-
throw new RangeError(`No cell found around position ${e.head}`);
|
|
243
|
-
}
|
|
244
|
-
function ke(t) {
|
|
245
|
-
for (let e = t.nodeAfter, o = t.pos; e; e = e.firstChild, o++) {
|
|
246
|
-
const n = e.type.spec.tableRole;
|
|
247
|
-
if (n == "cell" || n == "header_cell") return t.doc.resolve(o);
|
|
248
|
-
}
|
|
249
|
-
for (let e = t.nodeBefore, o = t.pos; e; e = e.lastChild, o--) {
|
|
250
|
-
const n = e.type.spec.tableRole;
|
|
251
|
-
if (n == "cell" || n == "header_cell")
|
|
252
|
-
return t.doc.resolve(o - e.nodeSize);
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
function Y(t) {
|
|
256
|
-
return t.parent.type.spec.tableRole == "row" && !!t.nodeAfter;
|
|
257
|
-
}
|
|
258
|
-
function Ee(t) {
|
|
259
|
-
return t.node(0).resolve(t.pos + t.nodeAfter.nodeSize);
|
|
260
|
-
}
|
|
261
|
-
function ee(t, e) {
|
|
262
|
-
return t.depth == e.depth && t.pos >= e.start(-1) && t.pos <= e.end(-1);
|
|
263
|
-
}
|
|
264
|
-
function ue(t, e, o) {
|
|
265
|
-
const n = t.node(-1), l = C.get(n), s = t.start(-1), r = l.nextCell(t.pos - s, e, o);
|
|
266
|
-
return r == null ? null : t.node(0).resolve(s + r);
|
|
267
|
-
}
|
|
268
|
-
function T(t, e, o = 1) {
|
|
269
|
-
const n = { ...t, colspan: t.colspan - o };
|
|
270
|
-
return n.colwidth && (n.colwidth = n.colwidth.slice(), n.colwidth.splice(e, o), n.colwidth.some((l) => l > 0) || (n.colwidth = null)), n;
|
|
271
|
-
}
|
|
272
|
-
function he(t, e, o = 1) {
|
|
273
|
-
const n = { ...t, colspan: t.colspan + o };
|
|
274
|
-
if (n.colwidth) {
|
|
275
|
-
n.colwidth = n.colwidth.slice();
|
|
276
|
-
for (let l = 0; l < o; l++) n.colwidth.splice(e, 0, 0);
|
|
277
|
-
}
|
|
278
|
-
return n;
|
|
279
|
-
}
|
|
280
|
-
function Te(t, e, o) {
|
|
281
|
-
const n = y(e.type.schema).header_cell;
|
|
282
|
-
for (let l = 0; l < t.height; l++)
|
|
283
|
-
if (e.nodeAt(t.map[o + l * t.width]).type != n)
|
|
284
|
-
return !1;
|
|
285
|
-
return !0;
|
|
286
|
-
}
|
|
287
|
-
var w = class M extends N {
|
|
288
|
-
// A table selection is identified by its anchor and head cells. The
|
|
289
|
-
// positions given to this constructor should point _before_ two
|
|
290
|
-
// cells in the same table. They may be the same, to select a single
|
|
291
|
-
// cell.
|
|
292
|
-
constructor(e, o = e) {
|
|
293
|
-
const n = e.node(-1), l = C.get(n), s = e.start(-1), r = l.rectBetween(
|
|
294
|
-
e.pos - s,
|
|
295
|
-
o.pos - s
|
|
296
|
-
), c = e.node(0), i = l.cellsInRect(r).filter((d) => d != o.pos - s);
|
|
297
|
-
i.unshift(o.pos - s);
|
|
298
|
-
const a = i.map((d) => {
|
|
299
|
-
const f = n.nodeAt(d);
|
|
300
|
-
if (!f)
|
|
301
|
-
throw RangeError(`No cell with offset ${d} found`);
|
|
302
|
-
const u = s + d + 1;
|
|
303
|
-
return new ye(
|
|
304
|
-
c.resolve(u),
|
|
305
|
-
c.resolve(u + f.content.size)
|
|
306
|
-
);
|
|
307
|
-
});
|
|
308
|
-
super(a[0].$from, a[0].$to, a), this.$anchorCell = e, this.$headCell = o;
|
|
309
|
-
}
|
|
310
|
-
map(e, o) {
|
|
311
|
-
const n = e.resolve(o.map(this.$anchorCell.pos)), l = e.resolve(o.map(this.$headCell.pos));
|
|
312
|
-
if (Y(n) && Y(l) && ee(n, l)) {
|
|
313
|
-
const s = this.$anchorCell.node(-1) != n.node(-1);
|
|
314
|
-
return s && this.isRowSelection() ? M.rowSelection(n, l) : s && this.isColSelection() ? M.colSelection(n, l) : new M(n, l);
|
|
315
|
-
}
|
|
316
|
-
return E.between(n, l);
|
|
317
|
-
}
|
|
318
|
-
// Returns a rectangular slice of table rows containing the selected
|
|
319
|
-
// cells.
|
|
320
|
-
content() {
|
|
321
|
-
const e = this.$anchorCell.node(-1), o = C.get(e), n = this.$anchorCell.start(-1), l = o.rectBetween(
|
|
322
|
-
this.$anchorCell.pos - n,
|
|
323
|
-
this.$headCell.pos - n
|
|
324
|
-
), s = {}, r = [];
|
|
325
|
-
for (let i = l.top; i < l.bottom; i++) {
|
|
326
|
-
const a = [];
|
|
327
|
-
for (let d = i * o.width + l.left, f = l.left; f < l.right; f++, d++) {
|
|
328
|
-
const u = o.map[d];
|
|
329
|
-
if (s[u]) continue;
|
|
330
|
-
s[u] = !0;
|
|
331
|
-
const h = o.findCell(u);
|
|
332
|
-
let p = e.nodeAt(u);
|
|
333
|
-
if (!p)
|
|
334
|
-
throw RangeError(`No cell with offset ${u} found`);
|
|
335
|
-
const m = l.left - h.left, g = h.right - l.right;
|
|
336
|
-
if (m > 0 || g > 0) {
|
|
337
|
-
let b = p.attrs;
|
|
338
|
-
if (m > 0 && (b = T(b, 0, m)), g > 0 && (b = T(
|
|
339
|
-
b,
|
|
340
|
-
b.colspan - g,
|
|
341
|
-
g
|
|
342
|
-
)), h.left < l.left) {
|
|
343
|
-
if (p = p.type.createAndFill(b), !p)
|
|
344
|
-
throw RangeError(
|
|
345
|
-
`Could not create cell with attrs ${JSON.stringify(b)}`
|
|
346
|
-
);
|
|
347
|
-
} else
|
|
348
|
-
p = p.type.create(b, p.content);
|
|
349
|
-
}
|
|
350
|
-
if (h.top < l.top || h.bottom > l.bottom) {
|
|
351
|
-
const b = {
|
|
352
|
-
...p.attrs,
|
|
353
|
-
rowspan: Math.min(h.bottom, l.bottom) - Math.max(h.top, l.top)
|
|
354
|
-
};
|
|
355
|
-
h.top < l.top ? p = p.type.createAndFill(b) : p = p.type.create(b, p.content);
|
|
356
|
-
}
|
|
357
|
-
a.push(p);
|
|
358
|
-
}
|
|
359
|
-
r.push(e.child(i).copy(R.from(a)));
|
|
360
|
-
}
|
|
361
|
-
const c = this.isColSelection() && this.isRowSelection() ? e : r;
|
|
362
|
-
return new v(R.from(c), 1, 1);
|
|
363
|
-
}
|
|
364
|
-
replace(e, o = v.empty) {
|
|
365
|
-
const n = e.steps.length, l = this.ranges;
|
|
366
|
-
for (let r = 0; r < l.length; r++) {
|
|
367
|
-
const { $from: c, $to: i } = l[r], a = e.mapping.slice(n);
|
|
368
|
-
e.replace(
|
|
369
|
-
a.map(c.pos),
|
|
370
|
-
a.map(i.pos),
|
|
371
|
-
r ? v.empty : o
|
|
372
|
-
);
|
|
373
|
-
}
|
|
374
|
-
const s = N.findFrom(
|
|
375
|
-
e.doc.resolve(e.mapping.slice(n).map(this.to)),
|
|
376
|
-
-1
|
|
377
|
-
);
|
|
378
|
-
s && e.setSelection(s);
|
|
379
|
-
}
|
|
380
|
-
replaceWith(e, o) {
|
|
381
|
-
this.replace(e, new v(R.from(o), 0, 0));
|
|
382
|
-
}
|
|
383
|
-
forEachCell(e) {
|
|
384
|
-
const o = this.$anchorCell.node(-1), n = C.get(o), l = this.$anchorCell.start(-1), s = n.cellsInRect(
|
|
385
|
-
n.rectBetween(
|
|
386
|
-
this.$anchorCell.pos - l,
|
|
387
|
-
this.$headCell.pos - l
|
|
388
|
-
)
|
|
389
|
-
);
|
|
390
|
-
for (let r = 0; r < s.length; r++)
|
|
391
|
-
e(o.nodeAt(s[r]), l + s[r]);
|
|
392
|
-
}
|
|
393
|
-
// True if this selection goes all the way from the top to the
|
|
394
|
-
// bottom of the table.
|
|
395
|
-
isColSelection() {
|
|
396
|
-
const e = this.$anchorCell.index(-1), o = this.$headCell.index(-1);
|
|
397
|
-
if (Math.min(e, o) > 0) return !1;
|
|
398
|
-
const n = e + this.$anchorCell.nodeAfter.attrs.rowspan, l = o + this.$headCell.nodeAfter.attrs.rowspan;
|
|
399
|
-
return Math.max(n, l) == this.$headCell.node(-1).childCount;
|
|
400
|
-
}
|
|
401
|
-
// Returns the smallest column selection that covers the given anchor
|
|
402
|
-
// and head cell.
|
|
403
|
-
static colSelection(e, o = e) {
|
|
404
|
-
const n = e.node(-1), l = C.get(n), s = e.start(-1), r = l.findCell(e.pos - s), c = l.findCell(o.pos - s), i = e.node(0);
|
|
405
|
-
return r.top <= c.top ? (r.top > 0 && (e = i.resolve(s + l.map[r.left])), c.bottom < l.height && (o = i.resolve(
|
|
406
|
-
s + l.map[l.width * (l.height - 1) + c.right - 1]
|
|
407
|
-
))) : (c.top > 0 && (o = i.resolve(s + l.map[c.left])), r.bottom < l.height && (e = i.resolve(
|
|
408
|
-
s + l.map[l.width * (l.height - 1) + r.right - 1]
|
|
409
|
-
))), new M(e, o);
|
|
410
|
-
}
|
|
411
|
-
// True if this selection goes all the way from the left to the
|
|
412
|
-
// right of the table.
|
|
413
|
-
isRowSelection() {
|
|
414
|
-
const e = this.$anchorCell.node(-1), o = C.get(e), n = this.$anchorCell.start(-1), l = o.colCount(this.$anchorCell.pos - n), s = o.colCount(this.$headCell.pos - n);
|
|
415
|
-
if (Math.min(l, s) > 0) return !1;
|
|
416
|
-
const r = l + this.$anchorCell.nodeAfter.attrs.colspan, c = s + this.$headCell.nodeAfter.attrs.colspan;
|
|
417
|
-
return Math.max(r, c) == o.width;
|
|
418
|
-
}
|
|
419
|
-
eq(e) {
|
|
420
|
-
return e instanceof M && e.$anchorCell.pos == this.$anchorCell.pos && e.$headCell.pos == this.$headCell.pos;
|
|
421
|
-
}
|
|
422
|
-
// Returns the smallest row selection that covers the given anchor
|
|
423
|
-
// and head cell.
|
|
424
|
-
static rowSelection(e, o = e) {
|
|
425
|
-
const n = e.node(-1), l = C.get(n), s = e.start(-1), r = l.findCell(e.pos - s), c = l.findCell(o.pos - s), i = e.node(0);
|
|
426
|
-
return r.left <= c.left ? (r.left > 0 && (e = i.resolve(
|
|
427
|
-
s + l.map[r.top * l.width]
|
|
428
|
-
)), c.right < l.width && (o = i.resolve(
|
|
429
|
-
s + l.map[l.width * (c.top + 1) - 1]
|
|
430
|
-
))) : (c.left > 0 && (o = i.resolve(s + l.map[c.top * l.width])), r.right < l.width && (e = i.resolve(
|
|
431
|
-
s + l.map[l.width * (r.top + 1) - 1]
|
|
432
|
-
))), new M(e, o);
|
|
433
|
-
}
|
|
434
|
-
toJSON() {
|
|
435
|
-
return {
|
|
436
|
-
type: "cell",
|
|
437
|
-
anchor: this.$anchorCell.pos,
|
|
438
|
-
head: this.$headCell.pos
|
|
439
|
-
};
|
|
440
|
-
}
|
|
441
|
-
static fromJSON(e, o) {
|
|
442
|
-
return new M(e.resolve(o.anchor), e.resolve(o.head));
|
|
443
|
-
}
|
|
444
|
-
static create(e, o, n = o) {
|
|
445
|
-
return new M(e.resolve(o), e.resolve(n));
|
|
446
|
-
}
|
|
447
|
-
getBookmark() {
|
|
448
|
-
return new De(this.$anchorCell.pos, this.$headCell.pos);
|
|
449
|
-
}
|
|
450
|
-
};
|
|
451
|
-
w.prototype.visible = !1;
|
|
452
|
-
N.jsonID("cell", w);
|
|
453
|
-
var De = class pe {
|
|
454
|
-
constructor(e, o) {
|
|
455
|
-
this.anchor = e, this.head = o;
|
|
456
|
-
}
|
|
457
|
-
map(e) {
|
|
458
|
-
return new pe(e.map(this.anchor), e.map(this.head));
|
|
459
|
-
}
|
|
460
|
-
resolve(e) {
|
|
461
|
-
const o = e.resolve(this.anchor), n = e.resolve(this.head);
|
|
462
|
-
return o.parent.type.spec.tableRole == "row" && n.parent.type.spec.tableRole == "row" && o.index() < o.parent.childCount && n.index() < n.parent.childCount && ee(o, n) ? new w(o, n) : N.near(n, 1);
|
|
463
|
-
}
|
|
464
|
-
};
|
|
465
|
-
function He(t) {
|
|
466
|
-
if (!(t.selection instanceof w)) return null;
|
|
467
|
-
const e = [];
|
|
468
|
-
return t.selection.forEachCell((o, n) => {
|
|
469
|
-
e.push(
|
|
470
|
-
q.node(n, n + o.nodeSize, { class: "selectedCell" })
|
|
471
|
-
);
|
|
472
|
-
}), X.create(t.doc, e);
|
|
473
|
-
}
|
|
474
|
-
function Be({ $from: t, $to: e }) {
|
|
475
|
-
if (t.pos == e.pos || t.pos < e.pos - 6) return !1;
|
|
476
|
-
let o = t.pos, n = e.pos, l = t.depth;
|
|
477
|
-
for (; l >= 0 && !(t.after(l + 1) < t.end(l)); l--, o++)
|
|
478
|
-
;
|
|
479
|
-
for (let s = e.depth; s >= 0 && !(e.before(s + 1) > e.start(s)); s--, n--)
|
|
480
|
-
;
|
|
481
|
-
return o == n && /row|table/.test(t.node(l).type.spec.tableRole);
|
|
482
|
-
}
|
|
483
|
-
function Le({ $from: t, $to: e }) {
|
|
484
|
-
let o, n;
|
|
485
|
-
for (let l = t.depth; l > 0; l--) {
|
|
486
|
-
const s = t.node(l);
|
|
487
|
-
if (s.type.spec.tableRole === "cell" || s.type.spec.tableRole === "header_cell") {
|
|
488
|
-
o = s;
|
|
489
|
-
break;
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
for (let l = e.depth; l > 0; l--) {
|
|
493
|
-
const s = e.node(l);
|
|
494
|
-
if (s.type.spec.tableRole === "cell" || s.type.spec.tableRole === "header_cell") {
|
|
495
|
-
n = s;
|
|
496
|
-
break;
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
return o !== n && e.parentOffset === 0;
|
|
500
|
-
}
|
|
501
|
-
function _e(t, e, o) {
|
|
502
|
-
const n = (e || t).selection, l = (e || t).doc;
|
|
503
|
-
let s, r;
|
|
504
|
-
if (n instanceof Se && (r = n.node.type.spec.tableRole)) {
|
|
505
|
-
if (r == "cell" || r == "header_cell")
|
|
506
|
-
s = w.create(l, n.from);
|
|
507
|
-
else if (r == "row") {
|
|
508
|
-
const c = l.resolve(n.from + 1);
|
|
509
|
-
s = w.rowSelection(c, c);
|
|
510
|
-
} else if (!o) {
|
|
511
|
-
const c = C.get(n.node), i = n.from + 1, a = i + c.map[c.width * c.height - 1];
|
|
512
|
-
s = w.create(l, i + 1, a);
|
|
513
|
-
}
|
|
514
|
-
} else n instanceof E && Be(n) ? s = E.create(l, n.from) : n instanceof E && Le(n) && (s = E.create(l, n.$from.start(), n.$from.end()));
|
|
515
|
-
return s && (e || (e = t.tr)).setSelection(s), e;
|
|
516
|
-
}
|
|
517
|
-
var $e = new Z("fix-tables");
|
|
518
|
-
function me(t, e, o, n) {
|
|
519
|
-
const l = t.childCount, s = e.childCount;
|
|
520
|
-
e: for (let r = 0, c = 0; r < s; r++) {
|
|
521
|
-
const i = e.child(r);
|
|
522
|
-
for (let a = c, d = Math.min(l, r + 3); a < d; a++)
|
|
523
|
-
if (t.child(a) == i) {
|
|
524
|
-
c = a + 1, o += i.nodeSize;
|
|
525
|
-
continue e;
|
|
526
|
-
}
|
|
527
|
-
n(i, o), c < l && t.child(c).sameMarkup(i) ? me(t.child(c), i, o + 1, n) : i.nodesBetween(0, i.content.size, n, o + 1), o += i.nodeSize;
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
function Fe(t, e) {
|
|
531
|
-
let o;
|
|
532
|
-
const n = (l, s) => {
|
|
533
|
-
l.type.spec.tableRole == "table" && (o = Pe(t, l, s, o));
|
|
534
|
-
};
|
|
535
|
-
return e ? e.doc != t.doc && me(e.doc, t.doc, 0, n) : t.doc.descendants(n), o;
|
|
536
|
-
}
|
|
537
|
-
function Pe(t, e, o, n) {
|
|
538
|
-
const l = C.get(e);
|
|
539
|
-
if (!l.problems) return n;
|
|
540
|
-
n || (n = t.tr);
|
|
541
|
-
const s = [];
|
|
542
|
-
for (let i = 0; i < l.height; i++) s.push(0);
|
|
543
|
-
for (let i = 0; i < l.problems.length; i++) {
|
|
544
|
-
const a = l.problems[i];
|
|
545
|
-
if (a.type == "collision") {
|
|
546
|
-
const d = e.nodeAt(a.pos);
|
|
547
|
-
if (!d) continue;
|
|
548
|
-
const f = d.attrs;
|
|
549
|
-
for (let u = 0; u < f.rowspan; u++) s[a.row + u] += a.n;
|
|
550
|
-
n.setNodeMarkup(
|
|
551
|
-
n.mapping.map(o + 1 + a.pos),
|
|
552
|
-
null,
|
|
553
|
-
T(f, f.colspan - a.n, a.n)
|
|
554
|
-
);
|
|
555
|
-
} else if (a.type == "missing")
|
|
556
|
-
s[a.row] += a.n;
|
|
557
|
-
else if (a.type == "overlong_rowspan") {
|
|
558
|
-
const d = e.nodeAt(a.pos);
|
|
559
|
-
if (!d) continue;
|
|
560
|
-
n.setNodeMarkup(n.mapping.map(o + 1 + a.pos), null, {
|
|
561
|
-
...d.attrs,
|
|
562
|
-
rowspan: d.attrs.rowspan - a.n
|
|
563
|
-
});
|
|
564
|
-
} else if (a.type == "colwidth mismatch") {
|
|
565
|
-
const d = e.nodeAt(a.pos);
|
|
566
|
-
if (!d) continue;
|
|
567
|
-
n.setNodeMarkup(n.mapping.map(o + 1 + a.pos), null, {
|
|
568
|
-
...d.attrs,
|
|
569
|
-
colwidth: a.colwidth
|
|
570
|
-
});
|
|
571
|
-
} else if (a.type == "zero_sized") {
|
|
572
|
-
const d = n.mapping.map(o);
|
|
573
|
-
n.delete(d, d + e.nodeSize);
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
|
-
let r, c;
|
|
577
|
-
for (let i = 0; i < s.length; i++)
|
|
578
|
-
s[i] && (r == null && (r = i), c = i);
|
|
579
|
-
for (let i = 0, a = o + 1; i < l.height; i++) {
|
|
580
|
-
const d = e.child(i), f = a + d.nodeSize, u = s[i];
|
|
581
|
-
if (u > 0) {
|
|
582
|
-
let h = "cell";
|
|
583
|
-
d.firstChild && (h = d.firstChild.type.spec.tableRole);
|
|
584
|
-
const p = [];
|
|
585
|
-
for (let g = 0; g < u; g++) {
|
|
586
|
-
const b = y(t.schema)[h].createAndFill();
|
|
587
|
-
b && p.push(b);
|
|
588
|
-
}
|
|
589
|
-
const m = (i == 0 || r == i - 1) && c == i ? a + 1 : f - 1;
|
|
590
|
-
n.insert(n.mapping.map(m), p);
|
|
591
|
-
}
|
|
592
|
-
a = f;
|
|
593
|
-
}
|
|
594
|
-
return n.setMeta($e, { fixTables: !0 });
|
|
595
|
-
}
|
|
596
|
-
function x(t) {
|
|
597
|
-
const e = t.selection, o = O(t), n = o.node(-1), l = o.start(-1), s = C.get(n);
|
|
598
|
-
return { ...e instanceof w ? s.rectBetween(
|
|
599
|
-
e.$anchorCell.pos - l,
|
|
600
|
-
e.$headCell.pos - l
|
|
601
|
-
) : s.findCell(o.pos - l), tableStart: l, map: s, table: n };
|
|
602
|
-
}
|
|
603
|
-
function ge(t, { map: e, tableStart: o, table: n }, l) {
|
|
604
|
-
let s = l > 0 ? -1 : 0;
|
|
605
|
-
Te(e, n, l + s) && (s = l == 0 || l == e.width ? null : 0);
|
|
606
|
-
for (let r = 0; r < e.height; r++) {
|
|
607
|
-
const c = r * e.width + l;
|
|
608
|
-
if (l > 0 && l < e.width && e.map[c - 1] == e.map[c]) {
|
|
609
|
-
const i = e.map[c], a = n.nodeAt(i);
|
|
610
|
-
t.setNodeMarkup(
|
|
611
|
-
t.mapping.map(o + i),
|
|
612
|
-
null,
|
|
613
|
-
he(a.attrs, l - e.colCount(i))
|
|
614
|
-
), r += a.attrs.rowspan - 1;
|
|
615
|
-
} else {
|
|
616
|
-
const i = s == null ? y(n.type.schema).cell : n.nodeAt(e.map[c + s]).type, a = e.positionAt(r, l, n);
|
|
617
|
-
t.insert(t.mapping.map(o + a), i.createAndFill());
|
|
618
|
-
}
|
|
619
|
-
}
|
|
620
|
-
return t;
|
|
621
|
-
}
|
|
622
|
-
function gt(t, e) {
|
|
623
|
-
if (!A(t)) return !1;
|
|
624
|
-
if (e) {
|
|
625
|
-
const o = x(t);
|
|
626
|
-
e(ge(t.tr, o, o.left));
|
|
627
|
-
}
|
|
628
|
-
return !0;
|
|
629
|
-
}
|
|
630
|
-
function wt(t, e) {
|
|
631
|
-
if (!A(t)) return !1;
|
|
632
|
-
if (e) {
|
|
633
|
-
const o = x(t);
|
|
634
|
-
e(ge(t.tr, o, o.right));
|
|
635
|
-
}
|
|
636
|
-
return !0;
|
|
637
|
-
}
|
|
638
|
-
function We(t, { map: e, table: o, tableStart: n }, l) {
|
|
639
|
-
const s = t.mapping.maps.length;
|
|
640
|
-
for (let r = 0; r < e.height; ) {
|
|
641
|
-
const c = r * e.width + l, i = e.map[c], a = o.nodeAt(i), d = a.attrs;
|
|
642
|
-
if (l > 0 && e.map[c - 1] == i || l < e.width - 1 && e.map[c + 1] == i)
|
|
643
|
-
t.setNodeMarkup(
|
|
644
|
-
t.mapping.slice(s).map(n + i),
|
|
645
|
-
null,
|
|
646
|
-
T(d, l - e.colCount(i))
|
|
647
|
-
);
|
|
648
|
-
else {
|
|
649
|
-
const f = t.mapping.slice(s).map(n + i);
|
|
650
|
-
t.delete(f, f + a.nodeSize);
|
|
651
|
-
}
|
|
652
|
-
r += d.rowspan;
|
|
653
|
-
}
|
|
654
|
-
}
|
|
655
|
-
function Ct(t, e) {
|
|
656
|
-
if (!A(t)) return !1;
|
|
657
|
-
if (e) {
|
|
658
|
-
const o = x(t), n = t.tr;
|
|
659
|
-
if (o.left == 0 && o.right == o.map.width) return !1;
|
|
660
|
-
for (let l = o.right - 1; We(n, o, l), l != o.left; l--) {
|
|
661
|
-
const s = o.tableStart ? n.doc.nodeAt(o.tableStart - 1) : n.doc;
|
|
662
|
-
if (!s)
|
|
663
|
-
throw RangeError("No table found");
|
|
664
|
-
o.table = s, o.map = C.get(s);
|
|
665
|
-
}
|
|
666
|
-
e(n);
|
|
667
|
-
}
|
|
668
|
-
return !0;
|
|
669
|
-
}
|
|
670
|
-
function Ie(t, e, o) {
|
|
671
|
-
var n;
|
|
672
|
-
const l = y(e.type.schema).header_cell;
|
|
673
|
-
for (let s = 0; s < t.width; s++)
|
|
674
|
-
if (((n = e.nodeAt(t.map[s + o * t.width])) == null ? void 0 : n.type) != l)
|
|
675
|
-
return !1;
|
|
676
|
-
return !0;
|
|
677
|
-
}
|
|
678
|
-
function we(t, { map: e, tableStart: o, table: n }, l) {
|
|
679
|
-
var s;
|
|
680
|
-
let r = o;
|
|
681
|
-
for (let a = 0; a < l; a++) r += n.child(a).nodeSize;
|
|
682
|
-
const c = [];
|
|
683
|
-
let i = l > 0 ? -1 : 0;
|
|
684
|
-
Ie(e, n, l + i) && (i = l == 0 || l == e.height ? null : 0);
|
|
685
|
-
for (let a = 0, d = e.width * l; a < e.width; a++, d++)
|
|
686
|
-
if (l > 0 && l < e.height && e.map[d] == e.map[d - e.width]) {
|
|
687
|
-
const f = e.map[d], u = n.nodeAt(f).attrs;
|
|
688
|
-
t.setNodeMarkup(o + f, null, {
|
|
689
|
-
...u,
|
|
690
|
-
rowspan: u.rowspan + 1
|
|
691
|
-
}), a += u.colspan - 1;
|
|
692
|
-
} else {
|
|
693
|
-
const f = i == null ? y(n.type.schema).cell : (s = n.nodeAt(e.map[d + i * e.width])) == null ? void 0 : s.type, u = f?.createAndFill();
|
|
694
|
-
u && c.push(u);
|
|
695
|
-
}
|
|
696
|
-
return t.insert(r, y(n.type.schema).row.create(null, c)), t;
|
|
697
|
-
}
|
|
698
|
-
function bt(t, e) {
|
|
699
|
-
if (!A(t)) return !1;
|
|
700
|
-
if (e) {
|
|
701
|
-
const o = x(t);
|
|
702
|
-
e(we(t.tr, o, o.top));
|
|
703
|
-
}
|
|
704
|
-
return !0;
|
|
705
|
-
}
|
|
706
|
-
function yt(t, e) {
|
|
707
|
-
if (!A(t)) return !1;
|
|
708
|
-
if (e) {
|
|
709
|
-
const o = x(t);
|
|
710
|
-
e(we(t.tr, o, o.bottom));
|
|
711
|
-
}
|
|
712
|
-
return !0;
|
|
713
|
-
}
|
|
714
|
-
function Oe(t, { map: e, table: o, tableStart: n }, l) {
|
|
715
|
-
let s = 0;
|
|
716
|
-
for (let a = 0; a < l; a++) s += o.child(a).nodeSize;
|
|
717
|
-
const r = s + o.child(l).nodeSize, c = t.mapping.maps.length;
|
|
718
|
-
t.delete(s + n, r + n);
|
|
719
|
-
const i = /* @__PURE__ */ new Set();
|
|
720
|
-
for (let a = 0, d = l * e.width; a < e.width; a++, d++) {
|
|
721
|
-
const f = e.map[d];
|
|
722
|
-
if (!i.has(f)) {
|
|
723
|
-
if (i.add(f), l > 0 && f == e.map[d - e.width]) {
|
|
724
|
-
const u = o.nodeAt(f).attrs;
|
|
725
|
-
t.setNodeMarkup(t.mapping.slice(c).map(f + n), null, {
|
|
726
|
-
...u,
|
|
727
|
-
rowspan: u.rowspan - 1
|
|
728
|
-
}), a += u.colspan - 1;
|
|
729
|
-
} else if (l < e.height && f == e.map[d + e.width]) {
|
|
730
|
-
const u = o.nodeAt(f), h = u.attrs, p = u.type.create(
|
|
731
|
-
{ ...h, rowspan: u.attrs.rowspan - 1 },
|
|
732
|
-
u.content
|
|
733
|
-
), m = e.positionAt(l + 1, a, o);
|
|
734
|
-
t.insert(t.mapping.slice(c).map(n + m), p), a += h.colspan - 1;
|
|
735
|
-
}
|
|
736
|
-
}
|
|
737
|
-
}
|
|
738
|
-
}
|
|
739
|
-
function St(t, e) {
|
|
740
|
-
if (!A(t)) return !1;
|
|
741
|
-
if (e) {
|
|
742
|
-
const o = x(t), n = t.tr;
|
|
743
|
-
if (o.top == 0 && o.bottom == o.map.height) return !1;
|
|
744
|
-
for (let l = o.bottom - 1; Oe(n, o, l), l != o.top; l--) {
|
|
745
|
-
const s = o.tableStart ? n.doc.nodeAt(o.tableStart - 1) : n.doc;
|
|
746
|
-
if (!s)
|
|
747
|
-
throw RangeError("No table found");
|
|
748
|
-
o.table = s, o.map = C.get(o.table);
|
|
749
|
-
}
|
|
750
|
-
e(n);
|
|
751
|
-
}
|
|
752
|
-
return !0;
|
|
753
|
-
}
|
|
754
|
-
function oe(t) {
|
|
755
|
-
const e = t.content;
|
|
756
|
-
return e.childCount == 1 && e.child(0).isTextblock && e.child(0).childCount == 0;
|
|
757
|
-
}
|
|
758
|
-
function je({ width: t, height: e, map: o }, n) {
|
|
759
|
-
let l = n.top * t + n.left, s = l, r = (n.bottom - 1) * t + n.left, c = l + (n.right - n.left - 1);
|
|
760
|
-
for (let i = n.top; i < n.bottom; i++) {
|
|
761
|
-
if (n.left > 0 && o[s] == o[s - 1] || n.right < t && o[c] == o[c + 1])
|
|
762
|
-
return !0;
|
|
763
|
-
s += t, c += t;
|
|
764
|
-
}
|
|
765
|
-
for (let i = n.left; i < n.right; i++) {
|
|
766
|
-
if (n.top > 0 && o[l] == o[l - t] || n.bottom < e && o[r] == o[r + t])
|
|
767
|
-
return !0;
|
|
768
|
-
l++, r++;
|
|
769
|
-
}
|
|
770
|
-
return !1;
|
|
771
|
-
}
|
|
772
|
-
function At(t, e) {
|
|
773
|
-
const o = t.selection;
|
|
774
|
-
if (!(o instanceof w) || o.$anchorCell.pos == o.$headCell.pos)
|
|
775
|
-
return !1;
|
|
776
|
-
const n = x(t), { map: l } = n;
|
|
777
|
-
if (je(l, n)) return !1;
|
|
778
|
-
if (e) {
|
|
779
|
-
const s = t.tr, r = {};
|
|
780
|
-
let c = R.empty, i, a;
|
|
781
|
-
for (let d = n.top; d < n.bottom; d++)
|
|
782
|
-
for (let f = n.left; f < n.right; f++) {
|
|
783
|
-
const u = l.map[d * l.width + f], h = n.table.nodeAt(u);
|
|
784
|
-
if (!(r[u] || !h))
|
|
785
|
-
if (r[u] = !0, i == null)
|
|
786
|
-
i = u, a = h;
|
|
787
|
-
else {
|
|
788
|
-
oe(h) || (c = c.append(h.content));
|
|
789
|
-
const p = s.mapping.map(u + n.tableStart);
|
|
790
|
-
s.delete(p, p + h.nodeSize);
|
|
791
|
-
}
|
|
792
|
-
}
|
|
793
|
-
if (i == null || a == null)
|
|
794
|
-
return !0;
|
|
795
|
-
if (s.setNodeMarkup(i + n.tableStart, null, {
|
|
796
|
-
...he(
|
|
797
|
-
a.attrs,
|
|
798
|
-
a.attrs.colspan,
|
|
799
|
-
n.right - n.left - a.attrs.colspan
|
|
800
|
-
),
|
|
801
|
-
rowspan: n.bottom - n.top
|
|
802
|
-
}), c.size) {
|
|
803
|
-
const d = i + 1 + a.content.size, f = oe(a) ? i + 1 : d;
|
|
804
|
-
s.replaceWith(f + n.tableStart, d + n.tableStart, c);
|
|
805
|
-
}
|
|
806
|
-
s.setSelection(
|
|
807
|
-
new w(s.doc.resolve(i + n.tableStart))
|
|
808
|
-
), e(s);
|
|
809
|
-
}
|
|
810
|
-
return !0;
|
|
811
|
-
}
|
|
812
|
-
function Rt(t, e) {
|
|
813
|
-
const o = y(t.schema);
|
|
814
|
-
return Ke(({ node: n }) => o[n.type.spec.tableRole])(t, e);
|
|
815
|
-
}
|
|
816
|
-
function Ke(t) {
|
|
817
|
-
return (e, o) => {
|
|
818
|
-
var n;
|
|
819
|
-
const l = e.selection;
|
|
820
|
-
let s, r;
|
|
821
|
-
if (l instanceof w) {
|
|
822
|
-
if (l.$anchorCell.pos != l.$headCell.pos) return !1;
|
|
823
|
-
s = l.$anchorCell.nodeAfter, r = l.$anchorCell.pos;
|
|
824
|
-
} else {
|
|
825
|
-
if (s = ve(l.$from), !s) return !1;
|
|
826
|
-
r = (n = D(l.$from)) == null ? void 0 : n.pos;
|
|
827
|
-
}
|
|
828
|
-
if (s == null || r == null || s.attrs.colspan == 1 && s.attrs.rowspan == 1)
|
|
829
|
-
return !1;
|
|
830
|
-
if (o) {
|
|
831
|
-
let c = s.attrs;
|
|
832
|
-
const i = [], a = c.colwidth;
|
|
833
|
-
c.rowspan > 1 && (c = { ...c, rowspan: 1 }), c.colspan > 1 && (c = { ...c, colspan: 1 });
|
|
834
|
-
const d = x(e), f = e.tr;
|
|
835
|
-
for (let h = 0; h < d.right - d.left; h++)
|
|
836
|
-
i.push(
|
|
837
|
-
a ? {
|
|
838
|
-
...c,
|
|
839
|
-
colwidth: a && a[h] ? [a[h]] : null
|
|
840
|
-
} : c
|
|
841
|
-
);
|
|
842
|
-
let u;
|
|
843
|
-
for (let h = d.top; h < d.bottom; h++) {
|
|
844
|
-
let p = d.map.positionAt(h, d.left, d.table);
|
|
845
|
-
h == d.top && (p += s.nodeSize);
|
|
846
|
-
for (let m = d.left, g = 0; m < d.right; m++, g++)
|
|
847
|
-
m == d.left && h == d.top || f.insert(
|
|
848
|
-
u = f.mapping.map(p + d.tableStart, 1),
|
|
849
|
-
t({ node: s, row: h, col: m }).createAndFill(i[g])
|
|
850
|
-
);
|
|
851
|
-
}
|
|
852
|
-
f.setNodeMarkup(
|
|
853
|
-
r,
|
|
854
|
-
t({ node: s, row: d.top, col: d.left }),
|
|
855
|
-
i[0]
|
|
856
|
-
), l instanceof w && f.setSelection(
|
|
857
|
-
new w(
|
|
858
|
-
f.doc.resolve(l.$anchorCell.pos),
|
|
859
|
-
u ? f.doc.resolve(u) : void 0
|
|
860
|
-
)
|
|
861
|
-
), o(f);
|
|
862
|
-
}
|
|
863
|
-
return !0;
|
|
864
|
-
};
|
|
865
|
-
}
|
|
866
|
-
function xt(t, e) {
|
|
867
|
-
return function(o, n) {
|
|
868
|
-
if (!A(o)) return !1;
|
|
869
|
-
const l = O(o);
|
|
870
|
-
if (l.nodeAfter.attrs[t] === e) return !1;
|
|
871
|
-
if (n) {
|
|
872
|
-
const s = o.tr;
|
|
873
|
-
o.selection instanceof w ? o.selection.forEachCell((r, c) => {
|
|
874
|
-
r.attrs[t] !== e && s.setNodeMarkup(c, null, {
|
|
875
|
-
...r.attrs,
|
|
876
|
-
[t]: e
|
|
877
|
-
});
|
|
878
|
-
}) : s.setNodeMarkup(l.pos, null, {
|
|
879
|
-
...l.nodeAfter.attrs,
|
|
880
|
-
[t]: e
|
|
881
|
-
}), n(s);
|
|
882
|
-
}
|
|
883
|
-
return !0;
|
|
884
|
-
};
|
|
885
|
-
}
|
|
886
|
-
function Ve(t) {
|
|
887
|
-
return function(e, o) {
|
|
888
|
-
if (!A(e)) return !1;
|
|
889
|
-
if (o) {
|
|
890
|
-
const n = y(e.schema), l = x(e), s = e.tr, r = l.map.cellsInRect(
|
|
891
|
-
t == "column" ? {
|
|
892
|
-
left: l.left,
|
|
893
|
-
top: 0,
|
|
894
|
-
right: l.right,
|
|
895
|
-
bottom: l.map.height
|
|
896
|
-
} : t == "row" ? {
|
|
897
|
-
left: 0,
|
|
898
|
-
top: l.top,
|
|
899
|
-
right: l.map.width,
|
|
900
|
-
bottom: l.bottom
|
|
901
|
-
} : l
|
|
902
|
-
), c = r.map((i) => l.table.nodeAt(i));
|
|
903
|
-
for (let i = 0; i < r.length; i++)
|
|
904
|
-
c[i].type == n.header_cell && s.setNodeMarkup(
|
|
905
|
-
l.tableStart + r[i],
|
|
906
|
-
n.cell,
|
|
907
|
-
c[i].attrs
|
|
908
|
-
);
|
|
909
|
-
if (s.steps.length == 0)
|
|
910
|
-
for (let i = 0; i < r.length; i++)
|
|
911
|
-
s.setNodeMarkup(
|
|
912
|
-
l.tableStart + r[i],
|
|
913
|
-
n.header_cell,
|
|
914
|
-
c[i].attrs
|
|
915
|
-
);
|
|
916
|
-
o(s);
|
|
917
|
-
}
|
|
918
|
-
return !0;
|
|
919
|
-
};
|
|
920
|
-
}
|
|
921
|
-
function ne(t, e, o) {
|
|
922
|
-
const n = e.map.cellsInRect({
|
|
923
|
-
left: 0,
|
|
924
|
-
top: 0,
|
|
925
|
-
right: t == "row" ? e.map.width : 1,
|
|
926
|
-
bottom: t == "column" ? e.map.height : 1
|
|
927
|
-
});
|
|
928
|
-
for (let l = 0; l < n.length; l++) {
|
|
929
|
-
const s = e.table.nodeAt(n[l]);
|
|
930
|
-
if (s && s.type !== o.header_cell)
|
|
931
|
-
return !1;
|
|
932
|
-
}
|
|
933
|
-
return !0;
|
|
934
|
-
}
|
|
935
|
-
function te(t, e) {
|
|
936
|
-
return e = e || { useDeprecatedLogic: !1 }, e.useDeprecatedLogic ? Ve(t) : function(o, n) {
|
|
937
|
-
if (!A(o)) return !1;
|
|
938
|
-
if (n) {
|
|
939
|
-
const l = y(o.schema), s = x(o), r = o.tr, c = ne("row", s, l), i = ne(
|
|
940
|
-
"column",
|
|
941
|
-
s,
|
|
942
|
-
l
|
|
943
|
-
), d = (t === "column" ? c : t === "row" ? i : !1) ? 1 : 0, f = t == "column" ? {
|
|
944
|
-
left: 0,
|
|
945
|
-
top: d,
|
|
946
|
-
right: 1,
|
|
947
|
-
bottom: s.map.height
|
|
948
|
-
} : t == "row" ? {
|
|
949
|
-
left: d,
|
|
950
|
-
top: 0,
|
|
951
|
-
right: s.map.width,
|
|
952
|
-
bottom: 1
|
|
953
|
-
} : s, u = t == "column" ? i ? l.cell : l.header_cell : t == "row" ? c ? l.cell : l.header_cell : l.cell;
|
|
954
|
-
s.map.cellsInRect(f).forEach((h) => {
|
|
955
|
-
const p = h + s.tableStart, m = r.doc.nodeAt(p);
|
|
956
|
-
m && r.setNodeMarkup(p, u, m.attrs);
|
|
957
|
-
}), n(r);
|
|
958
|
-
}
|
|
959
|
-
return !0;
|
|
960
|
-
};
|
|
961
|
-
}
|
|
962
|
-
te("row", {
|
|
963
|
-
useDeprecatedLogic: !0
|
|
964
|
-
});
|
|
965
|
-
te("column", {
|
|
966
|
-
useDeprecatedLogic: !0
|
|
967
|
-
});
|
|
968
|
-
var Mt = te("cell", {
|
|
969
|
-
useDeprecatedLogic: !0
|
|
970
|
-
});
|
|
971
|
-
function Xe(t, e) {
|
|
972
|
-
if (e < 0) {
|
|
973
|
-
const o = t.nodeBefore;
|
|
974
|
-
if (o) return t.pos - o.nodeSize;
|
|
975
|
-
for (let n = t.index(-1) - 1, l = t.before(); n >= 0; n--) {
|
|
976
|
-
const s = t.node(-1).child(n), r = s.lastChild;
|
|
977
|
-
if (r)
|
|
978
|
-
return l - 1 - r.nodeSize;
|
|
979
|
-
l -= s.nodeSize;
|
|
980
|
-
}
|
|
981
|
-
} else {
|
|
982
|
-
if (t.index() < t.parent.childCount - 1)
|
|
983
|
-
return t.pos + t.nodeAfter.nodeSize;
|
|
984
|
-
const o = t.node(-1);
|
|
985
|
-
for (let n = t.indexAfter(-1), l = t.after(); n < o.childCount; n++) {
|
|
986
|
-
const s = o.child(n);
|
|
987
|
-
if (s.childCount) return l + 1;
|
|
988
|
-
l += s.nodeSize;
|
|
989
|
-
}
|
|
990
|
-
}
|
|
991
|
-
return null;
|
|
992
|
-
}
|
|
993
|
-
function Nt(t) {
|
|
994
|
-
return function(e, o) {
|
|
995
|
-
if (!A(e)) return !1;
|
|
996
|
-
const n = Xe(O(e), t);
|
|
997
|
-
if (n == null) return !1;
|
|
998
|
-
if (o) {
|
|
999
|
-
const l = e.doc.resolve(n);
|
|
1000
|
-
o(
|
|
1001
|
-
e.tr.setSelection(E.between(l, Ee(l))).scrollIntoView()
|
|
1002
|
-
);
|
|
1003
|
-
}
|
|
1004
|
-
return !0;
|
|
1005
|
-
};
|
|
1006
|
-
}
|
|
1007
|
-
function zt(t, e) {
|
|
1008
|
-
const o = t.selection.$anchor;
|
|
1009
|
-
for (let n = o.depth; n > 0; n--)
|
|
1010
|
-
if (o.node(n).type.spec.tableRole == "table")
|
|
1011
|
-
return e && e(
|
|
1012
|
-
t.tr.delete(o.before(n), o.after(n)).scrollIntoView()
|
|
1013
|
-
), !0;
|
|
1014
|
-
return !1;
|
|
1015
|
-
}
|
|
1016
|
-
function $(t, e) {
|
|
1017
|
-
const o = t.selection;
|
|
1018
|
-
if (!(o instanceof w)) return !1;
|
|
1019
|
-
if (e) {
|
|
1020
|
-
const n = t.tr, l = y(t.schema).cell.createAndFill().content;
|
|
1021
|
-
o.forEachCell((s, r) => {
|
|
1022
|
-
s.content.eq(l) || n.replace(
|
|
1023
|
-
n.mapping.map(r + 1),
|
|
1024
|
-
n.mapping.map(r + s.nodeSize - 1),
|
|
1025
|
-
new v(l, 0, 0)
|
|
1026
|
-
);
|
|
1027
|
-
}), n.docChanged && e(n);
|
|
1028
|
-
}
|
|
1029
|
-
return !0;
|
|
1030
|
-
}
|
|
1031
|
-
function qe(t) {
|
|
1032
|
-
if (!t.size) return null;
|
|
1033
|
-
let { content: e, openStart: o, openEnd: n } = t;
|
|
1034
|
-
for (; e.childCount == 1 && (o > 0 && n > 0 || e.child(0).type.spec.tableRole == "table"); )
|
|
1035
|
-
o--, n--, e = e.child(0).content;
|
|
1036
|
-
const l = e.child(0), s = l.type.spec.tableRole, r = l.type.schema, c = [];
|
|
1037
|
-
if (s == "row")
|
|
1038
|
-
for (let i = 0; i < e.childCount; i++) {
|
|
1039
|
-
let a = e.child(i).content;
|
|
1040
|
-
const d = i ? 0 : Math.max(0, o - 1), f = i < e.childCount - 1 ? 0 : Math.max(0, n - 1);
|
|
1041
|
-
(d || f) && (a = G(
|
|
1042
|
-
y(r).row,
|
|
1043
|
-
new v(a, d, f)
|
|
1044
|
-
).content), c.push(a);
|
|
1045
|
-
}
|
|
1046
|
-
else if (s == "cell" || s == "header_cell")
|
|
1047
|
-
c.push(
|
|
1048
|
-
o || n ? G(
|
|
1049
|
-
y(r).row,
|
|
1050
|
-
new v(e, o, n)
|
|
1051
|
-
).content : e
|
|
1052
|
-
);
|
|
1053
|
-
else
|
|
1054
|
-
return null;
|
|
1055
|
-
return Je(r, c);
|
|
1056
|
-
}
|
|
1057
|
-
function Je(t, e) {
|
|
1058
|
-
const o = [];
|
|
1059
|
-
for (let l = 0; l < e.length; l++) {
|
|
1060
|
-
const s = e[l];
|
|
1061
|
-
for (let r = s.childCount - 1; r >= 0; r--) {
|
|
1062
|
-
const { rowspan: c, colspan: i } = s.child(r).attrs;
|
|
1063
|
-
for (let a = l; a < l + c; a++)
|
|
1064
|
-
o[a] = (o[a] || 0) + i;
|
|
1065
|
-
}
|
|
1066
|
-
}
|
|
1067
|
-
let n = 0;
|
|
1068
|
-
for (let l = 0; l < o.length; l++) n = Math.max(n, o[l]);
|
|
1069
|
-
for (let l = 0; l < o.length; l++)
|
|
1070
|
-
if (l >= e.length && e.push(R.empty), o[l] < n) {
|
|
1071
|
-
const s = y(t).cell.createAndFill(), r = [];
|
|
1072
|
-
for (let c = o[l]; c < n; c++)
|
|
1073
|
-
r.push(s);
|
|
1074
|
-
e[l] = e[l].append(R.from(r));
|
|
1075
|
-
}
|
|
1076
|
-
return { height: e.length, width: n, rows: e };
|
|
1077
|
-
}
|
|
1078
|
-
function G(t, e) {
|
|
1079
|
-
const o = t.createAndFill();
|
|
1080
|
-
return new Re(o).replace(0, o.content.size, e).doc;
|
|
1081
|
-
}
|
|
1082
|
-
function Ue({ width: t, height: e, rows: o }, n, l) {
|
|
1083
|
-
if (t != n) {
|
|
1084
|
-
const s = [], r = [];
|
|
1085
|
-
for (let c = 0; c < o.length; c++) {
|
|
1086
|
-
const i = o[c], a = [];
|
|
1087
|
-
for (let d = s[c] || 0, f = 0; d < n; f++) {
|
|
1088
|
-
let u = i.child(f % i.childCount);
|
|
1089
|
-
d + u.attrs.colspan > n && (u = u.type.createChecked(
|
|
1090
|
-
T(
|
|
1091
|
-
u.attrs,
|
|
1092
|
-
u.attrs.colspan,
|
|
1093
|
-
d + u.attrs.colspan - n
|
|
1094
|
-
),
|
|
1095
|
-
u.content
|
|
1096
|
-
)), a.push(u), d += u.attrs.colspan;
|
|
1097
|
-
for (let h = 1; h < u.attrs.rowspan; h++)
|
|
1098
|
-
s[c + h] = (s[c + h] || 0) + u.attrs.colspan;
|
|
1099
|
-
}
|
|
1100
|
-
r.push(R.from(a));
|
|
1101
|
-
}
|
|
1102
|
-
o = r, t = n;
|
|
1103
|
-
}
|
|
1104
|
-
if (e != l) {
|
|
1105
|
-
const s = [];
|
|
1106
|
-
for (let r = 0, c = 0; r < l; r++, c++) {
|
|
1107
|
-
const i = [], a = o[c % e];
|
|
1108
|
-
for (let d = 0; d < a.childCount; d++) {
|
|
1109
|
-
let f = a.child(d);
|
|
1110
|
-
r + f.attrs.rowspan > l && (f = f.type.create(
|
|
1111
|
-
{
|
|
1112
|
-
...f.attrs,
|
|
1113
|
-
rowspan: Math.max(1, l - f.attrs.rowspan)
|
|
1114
|
-
},
|
|
1115
|
-
f.content
|
|
1116
|
-
)), i.push(f);
|
|
1117
|
-
}
|
|
1118
|
-
s.push(R.from(i));
|
|
1119
|
-
}
|
|
1120
|
-
o = s, e = l;
|
|
1121
|
-
}
|
|
1122
|
-
return { width: t, height: e, rows: o };
|
|
1123
|
-
}
|
|
1124
|
-
function Ye(t, e, o, n, l, s, r) {
|
|
1125
|
-
const c = t.doc.type.schema, i = y(c);
|
|
1126
|
-
let a, d;
|
|
1127
|
-
if (l > e.width)
|
|
1128
|
-
for (let f = 0, u = 0; f < e.height; f++) {
|
|
1129
|
-
const h = o.child(f);
|
|
1130
|
-
u += h.nodeSize;
|
|
1131
|
-
const p = [];
|
|
1132
|
-
let m;
|
|
1133
|
-
h.lastChild == null || h.lastChild.type == i.cell ? m = a || (a = i.cell.createAndFill()) : m = d || (d = i.header_cell.createAndFill());
|
|
1134
|
-
for (let g = e.width; g < l; g++) p.push(m);
|
|
1135
|
-
t.insert(t.mapping.slice(r).map(u - 1 + n), p);
|
|
1136
|
-
}
|
|
1137
|
-
if (s > e.height) {
|
|
1138
|
-
const f = [];
|
|
1139
|
-
for (let p = 0, m = (e.height - 1) * e.width; p < Math.max(e.width, l); p++) {
|
|
1140
|
-
const g = p >= e.width ? !1 : o.nodeAt(e.map[m + p]).type == i.header_cell;
|
|
1141
|
-
f.push(
|
|
1142
|
-
g ? d || (d = i.header_cell.createAndFill()) : a || (a = i.cell.createAndFill())
|
|
1143
|
-
);
|
|
1144
|
-
}
|
|
1145
|
-
const u = i.row.create(null, R.from(f)), h = [];
|
|
1146
|
-
for (let p = e.height; p < s; p++) h.push(u);
|
|
1147
|
-
t.insert(t.mapping.slice(r).map(n + o.nodeSize - 2), h);
|
|
1148
|
-
}
|
|
1149
|
-
return !!(a || d);
|
|
1150
|
-
}
|
|
1151
|
-
function le(t, e, o, n, l, s, r, c) {
|
|
1152
|
-
if (r == 0 || r == e.height) return !1;
|
|
1153
|
-
let i = !1;
|
|
1154
|
-
for (let a = l; a < s; a++) {
|
|
1155
|
-
const d = r * e.width + a, f = e.map[d];
|
|
1156
|
-
if (e.map[d - e.width] == f) {
|
|
1157
|
-
i = !0;
|
|
1158
|
-
const u = o.nodeAt(f), { top: h, left: p } = e.findCell(f);
|
|
1159
|
-
t.setNodeMarkup(t.mapping.slice(c).map(f + n), null, {
|
|
1160
|
-
...u.attrs,
|
|
1161
|
-
rowspan: r - h
|
|
1162
|
-
}), t.insert(
|
|
1163
|
-
t.mapping.slice(c).map(e.positionAt(r, p, o)),
|
|
1164
|
-
u.type.createAndFill({
|
|
1165
|
-
...u.attrs,
|
|
1166
|
-
rowspan: h + u.attrs.rowspan - r
|
|
1167
|
-
})
|
|
1168
|
-
), a += u.attrs.colspan - 1;
|
|
1169
|
-
}
|
|
1170
|
-
}
|
|
1171
|
-
return i;
|
|
1172
|
-
}
|
|
1173
|
-
function se(t, e, o, n, l, s, r, c) {
|
|
1174
|
-
if (r == 0 || r == e.width) return !1;
|
|
1175
|
-
let i = !1;
|
|
1176
|
-
for (let a = l; a < s; a++) {
|
|
1177
|
-
const d = a * e.width + r, f = e.map[d];
|
|
1178
|
-
if (e.map[d - 1] == f) {
|
|
1179
|
-
i = !0;
|
|
1180
|
-
const u = o.nodeAt(f), h = e.colCount(f), p = t.mapping.slice(c).map(f + n);
|
|
1181
|
-
t.setNodeMarkup(
|
|
1182
|
-
p,
|
|
1183
|
-
null,
|
|
1184
|
-
T(
|
|
1185
|
-
u.attrs,
|
|
1186
|
-
r - h,
|
|
1187
|
-
u.attrs.colspan - (r - h)
|
|
1188
|
-
)
|
|
1189
|
-
), t.insert(
|
|
1190
|
-
p + u.nodeSize,
|
|
1191
|
-
u.type.createAndFill(
|
|
1192
|
-
T(u.attrs, 0, r - h)
|
|
1193
|
-
)
|
|
1194
|
-
), a += u.attrs.rowspan - 1;
|
|
1195
|
-
}
|
|
1196
|
-
}
|
|
1197
|
-
return i;
|
|
1198
|
-
}
|
|
1199
|
-
function re(t, e, o, n, l) {
|
|
1200
|
-
let s = o ? t.doc.nodeAt(o - 1) : t.doc;
|
|
1201
|
-
if (!s)
|
|
1202
|
-
throw new Error("No table found");
|
|
1203
|
-
let r = C.get(s);
|
|
1204
|
-
const { top: c, left: i } = n, a = i + l.width, d = c + l.height, f = t.tr;
|
|
1205
|
-
let u = 0;
|
|
1206
|
-
function h() {
|
|
1207
|
-
if (s = o ? f.doc.nodeAt(o - 1) : f.doc, !s)
|
|
1208
|
-
throw new Error("No table found");
|
|
1209
|
-
r = C.get(s), u = f.mapping.maps.length;
|
|
1210
|
-
}
|
|
1211
|
-
Ye(f, r, s, o, a, d, u) && h(), le(f, r, s, o, i, a, c, u) && h(), le(f, r, s, o, i, a, d, u) && h(), se(f, r, s, o, c, d, i, u) && h(), se(f, r, s, o, c, d, a, u) && h();
|
|
1212
|
-
for (let p = c; p < d; p++) {
|
|
1213
|
-
const m = r.positionAt(p, i, s), g = r.positionAt(p, a, s);
|
|
1214
|
-
f.replace(
|
|
1215
|
-
f.mapping.slice(u).map(m + o),
|
|
1216
|
-
f.mapping.slice(u).map(g + o),
|
|
1217
|
-
new v(l.rows[p - c], 0, 0)
|
|
1218
|
-
);
|
|
1219
|
-
}
|
|
1220
|
-
h(), f.setSelection(
|
|
1221
|
-
new w(
|
|
1222
|
-
f.doc.resolve(o + r.positionAt(c, i, s)),
|
|
1223
|
-
f.doc.resolve(o + r.positionAt(d - 1, a - 1, s))
|
|
1224
|
-
)
|
|
1225
|
-
), e(f);
|
|
1226
|
-
}
|
|
1227
|
-
var Ge = Ae({
|
|
1228
|
-
ArrowLeft: F("horiz", -1),
|
|
1229
|
-
ArrowRight: F("horiz", 1),
|
|
1230
|
-
ArrowUp: F("vert", -1),
|
|
1231
|
-
ArrowDown: F("vert", 1),
|
|
1232
|
-
"Shift-ArrowLeft": P("horiz", -1),
|
|
1233
|
-
"Shift-ArrowRight": P("horiz", 1),
|
|
1234
|
-
"Shift-ArrowUp": P("vert", -1),
|
|
1235
|
-
"Shift-ArrowDown": P("vert", 1),
|
|
1236
|
-
Backspace: $,
|
|
1237
|
-
"Mod-Backspace": $,
|
|
1238
|
-
Delete: $,
|
|
1239
|
-
"Mod-Delete": $
|
|
1240
|
-
});
|
|
1241
|
-
function W(t, e, o) {
|
|
1242
|
-
return o.eq(t.selection) ? !1 : (e && e(t.tr.setSelection(o).scrollIntoView()), !0);
|
|
1243
|
-
}
|
|
1244
|
-
function F(t, e) {
|
|
1245
|
-
return (o, n, l) => {
|
|
1246
|
-
if (!l) return !1;
|
|
1247
|
-
const s = o.selection;
|
|
1248
|
-
if (s instanceof w)
|
|
1249
|
-
return W(
|
|
1250
|
-
o,
|
|
1251
|
-
n,
|
|
1252
|
-
N.near(s.$headCell, e)
|
|
1253
|
-
);
|
|
1254
|
-
if (t != "horiz" && !s.empty) return !1;
|
|
1255
|
-
const r = Ce(l, t, e);
|
|
1256
|
-
if (r == null) return !1;
|
|
1257
|
-
if (t == "horiz")
|
|
1258
|
-
return W(
|
|
1259
|
-
o,
|
|
1260
|
-
n,
|
|
1261
|
-
N.near(o.doc.resolve(s.head + e), e)
|
|
1262
|
-
);
|
|
1263
|
-
{
|
|
1264
|
-
const c = o.doc.resolve(r), i = ue(c, t, e);
|
|
1265
|
-
let a;
|
|
1266
|
-
return i ? a = N.near(i, 1) : e < 0 ? a = N.near(o.doc.resolve(c.before(-1)), -1) : a = N.near(o.doc.resolve(c.after(-1)), 1), W(o, n, a);
|
|
1267
|
-
}
|
|
1268
|
-
};
|
|
1269
|
-
}
|
|
1270
|
-
function P(t, e) {
|
|
1271
|
-
return (o, n, l) => {
|
|
1272
|
-
if (!l) return !1;
|
|
1273
|
-
const s = o.selection;
|
|
1274
|
-
let r;
|
|
1275
|
-
if (s instanceof w)
|
|
1276
|
-
r = s;
|
|
1277
|
-
else {
|
|
1278
|
-
const i = Ce(l, t, e);
|
|
1279
|
-
if (i == null) return !1;
|
|
1280
|
-
r = new w(o.doc.resolve(i));
|
|
1281
|
-
}
|
|
1282
|
-
const c = ue(r.$headCell, t, e);
|
|
1283
|
-
return c ? W(
|
|
1284
|
-
o,
|
|
1285
|
-
n,
|
|
1286
|
-
new w(r.$anchorCell, c)
|
|
1287
|
-
) : !1;
|
|
1288
|
-
};
|
|
1289
|
-
}
|
|
1290
|
-
function Qe(t, e) {
|
|
1291
|
-
const o = t.state.doc, n = D(o.resolve(e));
|
|
1292
|
-
return n ? (t.dispatch(t.state.tr.setSelection(new w(n))), !0) : !1;
|
|
1293
|
-
}
|
|
1294
|
-
function Ze(t, e, o) {
|
|
1295
|
-
if (!A(t.state)) return !1;
|
|
1296
|
-
let n = qe(o);
|
|
1297
|
-
const l = t.state.selection;
|
|
1298
|
-
if (l instanceof w) {
|
|
1299
|
-
n || (n = {
|
|
1300
|
-
width: 1,
|
|
1301
|
-
height: 1,
|
|
1302
|
-
rows: [
|
|
1303
|
-
R.from(
|
|
1304
|
-
G(y(t.state.schema).cell, o)
|
|
1305
|
-
)
|
|
1306
|
-
]
|
|
1307
|
-
});
|
|
1308
|
-
const s = l.$anchorCell.node(-1), r = l.$anchorCell.start(-1), c = C.get(s).rectBetween(
|
|
1309
|
-
l.$anchorCell.pos - r,
|
|
1310
|
-
l.$headCell.pos - r
|
|
1311
|
-
);
|
|
1312
|
-
return n = Ue(n, c.right - c.left, c.bottom - c.top), re(t.state, t.dispatch, r, c, n), !0;
|
|
1313
|
-
} else if (n) {
|
|
1314
|
-
const s = O(t.state), r = s.start(-1);
|
|
1315
|
-
return re(
|
|
1316
|
-
t.state,
|
|
1317
|
-
t.dispatch,
|
|
1318
|
-
r,
|
|
1319
|
-
C.get(s.node(-1)).findCell(s.pos - r),
|
|
1320
|
-
n
|
|
1321
|
-
), !0;
|
|
1322
|
-
} else
|
|
1323
|
-
return !1;
|
|
1324
|
-
}
|
|
1325
|
-
function et(t, e) {
|
|
1326
|
-
var o;
|
|
1327
|
-
if (e.ctrlKey || e.metaKey) return;
|
|
1328
|
-
const n = ie(t, e.target);
|
|
1329
|
-
let l;
|
|
1330
|
-
if (e.shiftKey && t.state.selection instanceof w)
|
|
1331
|
-
s(t.state.selection.$anchorCell, e), e.preventDefault();
|
|
1332
|
-
else if (e.shiftKey && n && (l = D(t.state.selection.$anchor)) != null && ((o = V(t, e)) == null ? void 0 : o.pos) != l.pos)
|
|
1333
|
-
s(l, e), e.preventDefault();
|
|
1334
|
-
else if (!n)
|
|
1335
|
-
return;
|
|
1336
|
-
function s(i, a) {
|
|
1337
|
-
let d = V(t, a);
|
|
1338
|
-
const f = z.getState(t.state) == null;
|
|
1339
|
-
if (!d || !ee(i, d))
|
|
1340
|
-
if (f) d = i;
|
|
1341
|
-
else return;
|
|
1342
|
-
const u = new w(i, d);
|
|
1343
|
-
if (f || !t.state.selection.eq(u)) {
|
|
1344
|
-
const h = t.state.tr.setSelection(u);
|
|
1345
|
-
f && h.setMeta(z, i.pos), t.dispatch(h);
|
|
1346
|
-
}
|
|
1347
|
-
}
|
|
1348
|
-
function r() {
|
|
1349
|
-
t.root.removeEventListener("mouseup", r), t.root.removeEventListener("dragstart", r), t.root.removeEventListener("mousemove", c), z.getState(t.state) != null && t.dispatch(t.state.tr.setMeta(z, -1));
|
|
1350
|
-
}
|
|
1351
|
-
function c(i) {
|
|
1352
|
-
const a = i, d = z.getState(t.state);
|
|
1353
|
-
let f;
|
|
1354
|
-
if (d != null)
|
|
1355
|
-
f = t.state.doc.resolve(d);
|
|
1356
|
-
else if (ie(t, a.target) != n && (f = V(t, e), !f))
|
|
1357
|
-
return r();
|
|
1358
|
-
f && s(f, a);
|
|
1359
|
-
}
|
|
1360
|
-
t.root.addEventListener("mouseup", r), t.root.addEventListener("dragstart", r), t.root.addEventListener("mousemove", c);
|
|
1361
|
-
}
|
|
1362
|
-
function Ce(t, e, o) {
|
|
1363
|
-
if (!(t.state.selection instanceof E)) return null;
|
|
1364
|
-
const { $head: n } = t.state.selection;
|
|
1365
|
-
for (let l = n.depth - 1; l >= 0; l--) {
|
|
1366
|
-
const s = n.node(l);
|
|
1367
|
-
if ((o < 0 ? n.index(l) : n.indexAfter(l)) != (o < 0 ? 0 : s.childCount)) return null;
|
|
1368
|
-
if (s.type.spec.tableRole == "cell" || s.type.spec.tableRole == "header_cell") {
|
|
1369
|
-
const c = n.before(l), i = e == "vert" ? o > 0 ? "down" : "up" : o > 0 ? "right" : "left";
|
|
1370
|
-
return t.endOfTextblock(i) ? c : null;
|
|
1371
|
-
}
|
|
1372
|
-
}
|
|
1373
|
-
return null;
|
|
1374
|
-
}
|
|
1375
|
-
function ie(t, e) {
|
|
1376
|
-
for (; e && e != t.dom; e = e.parentNode)
|
|
1377
|
-
if (e.nodeName == "TD" || e.nodeName == "TH")
|
|
1378
|
-
return e;
|
|
1379
|
-
return null;
|
|
1380
|
-
}
|
|
1381
|
-
function V(t, e) {
|
|
1382
|
-
const o = t.posAtCoords({
|
|
1383
|
-
left: e.clientX,
|
|
1384
|
-
top: e.clientY
|
|
1385
|
-
});
|
|
1386
|
-
return o && o ? D(t.state.doc.resolve(o.pos)) : null;
|
|
1387
|
-
}
|
|
1388
|
-
var tt = class {
|
|
1389
|
-
constructor(t, e) {
|
|
1390
|
-
this.node = t, this.defaultCellMinWidth = e, this.dom = document.createElement("div"), this.dom.className = "tableWrapper", this.table = this.dom.appendChild(document.createElement("table")), this.table.style.setProperty(
|
|
1391
|
-
"--default-cell-min-width",
|
|
1392
|
-
`${e}px`
|
|
1393
|
-
), this.colgroup = this.table.appendChild(document.createElement("colgroup")), Q(t, this.colgroup, this.table, e), this.contentDOM = this.table.appendChild(document.createElement("tbody"));
|
|
1394
|
-
}
|
|
1395
|
-
update(t) {
|
|
1396
|
-
return t.type != this.node.type ? !1 : (this.node = t, Q(
|
|
1397
|
-
t,
|
|
1398
|
-
this.colgroup,
|
|
1399
|
-
this.table,
|
|
1400
|
-
this.defaultCellMinWidth
|
|
1401
|
-
), !0);
|
|
1402
|
-
}
|
|
1403
|
-
ignoreMutation(t) {
|
|
1404
|
-
return t.type == "attributes" && (t.target == this.table || this.colgroup.contains(t.target));
|
|
1405
|
-
}
|
|
1406
|
-
};
|
|
1407
|
-
function Q(t, e, o, n, l, s) {
|
|
1408
|
-
var r;
|
|
1409
|
-
let c = 0, i = !0, a = e.firstChild;
|
|
1410
|
-
const d = t.firstChild;
|
|
1411
|
-
if (d) {
|
|
1412
|
-
for (let f = 0, u = 0; f < d.childCount; f++) {
|
|
1413
|
-
const { colspan: h, colwidth: p } = d.child(f).attrs;
|
|
1414
|
-
for (let m = 0; m < h; m++, u++) {
|
|
1415
|
-
const g = l == u ? s : p && p[m], b = g ? g + "px" : "";
|
|
1416
|
-
if (c += g || n, g || (i = !1), a)
|
|
1417
|
-
a.style.width != b && (a.style.width = b), a = a.nextSibling;
|
|
1418
|
-
else {
|
|
1419
|
-
const H = document.createElement("col");
|
|
1420
|
-
H.style.width = b, e.appendChild(H);
|
|
1421
|
-
}
|
|
1422
|
-
}
|
|
1423
|
-
}
|
|
1424
|
-
for (; a; ) {
|
|
1425
|
-
const f = a.nextSibling;
|
|
1426
|
-
(r = a.parentNode) == null || r.removeChild(a), a = f;
|
|
1427
|
-
}
|
|
1428
|
-
i ? (o.style.width = c + "px", o.style.minWidth = "") : (o.style.width = "", o.style.minWidth = c + "px");
|
|
1429
|
-
}
|
|
1430
|
-
}
|
|
1431
|
-
var S = new Z(
|
|
1432
|
-
"tableColumnResizing"
|
|
1433
|
-
);
|
|
1434
|
-
function vt({
|
|
1435
|
-
handleWidth: t = 5,
|
|
1436
|
-
cellMinWidth: e = 25,
|
|
1437
|
-
defaultCellMinWidth: o = 100,
|
|
1438
|
-
View: n = tt,
|
|
1439
|
-
lastColumnResizable: l = !0
|
|
1440
|
-
} = {}) {
|
|
1441
|
-
const s = new fe({
|
|
1442
|
-
key: S,
|
|
1443
|
-
state: {
|
|
1444
|
-
init(r, c) {
|
|
1445
|
-
var i, a;
|
|
1446
|
-
const d = (a = (i = s.spec) == null ? void 0 : i.props) == null ? void 0 : a.nodeViews, f = y(c.schema).table.name;
|
|
1447
|
-
return n && d && (d[f] = (u, h) => new n(u, o, h)), new ot(-1, !1);
|
|
1448
|
-
},
|
|
1449
|
-
apply(r, c) {
|
|
1450
|
-
return c.apply(r);
|
|
1451
|
-
}
|
|
1452
|
-
},
|
|
1453
|
-
props: {
|
|
1454
|
-
attributes: (r) => {
|
|
1455
|
-
const c = S.getState(r);
|
|
1456
|
-
return c && c.activeHandle > -1 ? { class: "resize-cursor" } : {};
|
|
1457
|
-
},
|
|
1458
|
-
handleDOMEvents: {
|
|
1459
|
-
mousemove: (r, c) => {
|
|
1460
|
-
nt(r, c, t, l);
|
|
1461
|
-
},
|
|
1462
|
-
mouseleave: (r) => {
|
|
1463
|
-
lt(r);
|
|
1464
|
-
},
|
|
1465
|
-
mousedown: (r, c) => {
|
|
1466
|
-
st(r, c, e, o);
|
|
1467
|
-
}
|
|
1468
|
-
},
|
|
1469
|
-
decorations: (r) => {
|
|
1470
|
-
const c = S.getState(r);
|
|
1471
|
-
if (c && c.activeHandle > -1)
|
|
1472
|
-
return dt(r, c.activeHandle);
|
|
1473
|
-
},
|
|
1474
|
-
nodeViews: {}
|
|
1475
|
-
}
|
|
1476
|
-
});
|
|
1477
|
-
return s;
|
|
1478
|
-
}
|
|
1479
|
-
var ot = class I {
|
|
1480
|
-
constructor(e, o) {
|
|
1481
|
-
this.activeHandle = e, this.dragging = o;
|
|
1482
|
-
}
|
|
1483
|
-
apply(e) {
|
|
1484
|
-
const o = this, n = e.getMeta(S);
|
|
1485
|
-
if (n && n.setHandle != null)
|
|
1486
|
-
return new I(n.setHandle, !1);
|
|
1487
|
-
if (n && n.setDragging !== void 0)
|
|
1488
|
-
return new I(o.activeHandle, n.setDragging);
|
|
1489
|
-
if (o.activeHandle > -1 && e.docChanged) {
|
|
1490
|
-
let l = e.mapping.map(o.activeHandle, -1);
|
|
1491
|
-
return Y(e.doc.resolve(l)) || (l = -1), new I(l, o.dragging);
|
|
1492
|
-
}
|
|
1493
|
-
return o;
|
|
1494
|
-
}
|
|
1495
|
-
};
|
|
1496
|
-
function nt(t, e, o, n) {
|
|
1497
|
-
if (!t.editable) return;
|
|
1498
|
-
const l = S.getState(t.state);
|
|
1499
|
-
if (l && !l.dragging) {
|
|
1500
|
-
const s = it(e.target);
|
|
1501
|
-
let r = -1;
|
|
1502
|
-
if (s) {
|
|
1503
|
-
const { left: c, right: i } = s.getBoundingClientRect();
|
|
1504
|
-
e.clientX - c <= o ? r = ce(t, e, "left", o) : i - e.clientX <= o && (r = ce(t, e, "right", o));
|
|
1505
|
-
}
|
|
1506
|
-
if (r != l.activeHandle) {
|
|
1507
|
-
if (!n && r !== -1) {
|
|
1508
|
-
const c = t.state.doc.resolve(r), i = c.node(-1), a = C.get(i), d = c.start(-1);
|
|
1509
|
-
if (a.colCount(c.pos - d) + c.nodeAfter.attrs.colspan - 1 == a.width - 1)
|
|
1510
|
-
return;
|
|
1511
|
-
}
|
|
1512
|
-
be(t, r);
|
|
1513
|
-
}
|
|
1514
|
-
}
|
|
1515
|
-
}
|
|
1516
|
-
function lt(t) {
|
|
1517
|
-
if (!t.editable) return;
|
|
1518
|
-
const e = S.getState(t.state);
|
|
1519
|
-
e && e.activeHandle > -1 && !e.dragging && be(t, -1);
|
|
1520
|
-
}
|
|
1521
|
-
function st(t, e, o, n) {
|
|
1522
|
-
var l;
|
|
1523
|
-
if (!t.editable) return !1;
|
|
1524
|
-
const s = (l = t.dom.ownerDocument.defaultView) != null ? l : window, r = S.getState(t.state);
|
|
1525
|
-
if (!r || r.activeHandle == -1 || r.dragging)
|
|
1526
|
-
return !1;
|
|
1527
|
-
const c = t.state.doc.nodeAt(r.activeHandle), i = rt(t, r.activeHandle, c.attrs);
|
|
1528
|
-
t.dispatch(
|
|
1529
|
-
t.state.tr.setMeta(S, {
|
|
1530
|
-
setDragging: { startX: e.clientX, startWidth: i }
|
|
1531
|
-
})
|
|
1532
|
-
);
|
|
1533
|
-
function a(f) {
|
|
1534
|
-
s.removeEventListener("mouseup", a), s.removeEventListener("mousemove", d);
|
|
1535
|
-
const u = S.getState(t.state);
|
|
1536
|
-
u?.dragging && (ct(
|
|
1537
|
-
t,
|
|
1538
|
-
u.activeHandle,
|
|
1539
|
-
ae(u.dragging, f, o)
|
|
1540
|
-
), t.dispatch(
|
|
1541
|
-
t.state.tr.setMeta(S, { setDragging: null })
|
|
1542
|
-
));
|
|
1543
|
-
}
|
|
1544
|
-
function d(f) {
|
|
1545
|
-
if (!f.which) return a(f);
|
|
1546
|
-
const u = S.getState(t.state);
|
|
1547
|
-
if (u && u.dragging) {
|
|
1548
|
-
const h = ae(u.dragging, f, o);
|
|
1549
|
-
de(
|
|
1550
|
-
t,
|
|
1551
|
-
u.activeHandle,
|
|
1552
|
-
h,
|
|
1553
|
-
n
|
|
1554
|
-
);
|
|
1555
|
-
}
|
|
1556
|
-
}
|
|
1557
|
-
return de(
|
|
1558
|
-
t,
|
|
1559
|
-
r.activeHandle,
|
|
1560
|
-
i,
|
|
1561
|
-
n
|
|
1562
|
-
), s.addEventListener("mouseup", a), s.addEventListener("mousemove", d), e.preventDefault(), !0;
|
|
1563
|
-
}
|
|
1564
|
-
function rt(t, e, { colspan: o, colwidth: n }) {
|
|
1565
|
-
const l = n && n[n.length - 1];
|
|
1566
|
-
if (l) return l;
|
|
1567
|
-
const s = t.domAtPos(e);
|
|
1568
|
-
let c = s.node.childNodes[s.offset].offsetWidth, i = o;
|
|
1569
|
-
if (n)
|
|
1570
|
-
for (let a = 0; a < o; a++)
|
|
1571
|
-
n[a] && (c -= n[a], i--);
|
|
1572
|
-
return c / i;
|
|
1573
|
-
}
|
|
1574
|
-
function it(t) {
|
|
1575
|
-
for (; t && t.nodeName != "TD" && t.nodeName != "TH"; )
|
|
1576
|
-
t = t.classList && t.classList.contains("ProseMirror") ? null : t.parentNode;
|
|
1577
|
-
return t;
|
|
1578
|
-
}
|
|
1579
|
-
function ce(t, e, o, n) {
|
|
1580
|
-
const l = o == "right" ? -n : n, s = t.posAtCoords({
|
|
1581
|
-
left: e.clientX + l,
|
|
1582
|
-
top: e.clientY
|
|
1583
|
-
});
|
|
1584
|
-
if (!s) return -1;
|
|
1585
|
-
const { pos: r } = s, c = D(t.state.doc.resolve(r));
|
|
1586
|
-
if (!c) return -1;
|
|
1587
|
-
if (o == "right") return c.pos;
|
|
1588
|
-
const i = C.get(c.node(-1)), a = c.start(-1), d = i.map.indexOf(c.pos - a);
|
|
1589
|
-
return d % i.width == 0 ? -1 : a + i.map[d - 1];
|
|
1590
|
-
}
|
|
1591
|
-
function ae(t, e, o) {
|
|
1592
|
-
const n = e.clientX - t.startX;
|
|
1593
|
-
return Math.max(o, t.startWidth + n);
|
|
1594
|
-
}
|
|
1595
|
-
function be(t, e) {
|
|
1596
|
-
t.dispatch(
|
|
1597
|
-
t.state.tr.setMeta(S, { setHandle: e })
|
|
1598
|
-
);
|
|
1599
|
-
}
|
|
1600
|
-
function ct(t, e, o) {
|
|
1601
|
-
const n = t.state.doc.resolve(e), l = n.node(-1), s = C.get(l), r = n.start(-1), c = s.colCount(n.pos - r) + n.nodeAfter.attrs.colspan - 1, i = t.state.tr;
|
|
1602
|
-
for (let a = 0; a < s.height; a++) {
|
|
1603
|
-
const d = a * s.width + c;
|
|
1604
|
-
if (a && s.map[d] == s.map[d - s.width]) continue;
|
|
1605
|
-
const f = s.map[d], u = l.nodeAt(f).attrs, h = u.colspan == 1 ? 0 : c - s.colCount(f);
|
|
1606
|
-
if (u.colwidth && u.colwidth[h] == o) continue;
|
|
1607
|
-
const p = u.colwidth ? u.colwidth.slice() : at(u.colspan);
|
|
1608
|
-
p[h] = o, i.setNodeMarkup(r + f, null, { ...u, colwidth: p });
|
|
1609
|
-
}
|
|
1610
|
-
i.docChanged && t.dispatch(i);
|
|
1611
|
-
}
|
|
1612
|
-
function de(t, e, o, n) {
|
|
1613
|
-
const l = t.state.doc.resolve(e), s = l.node(-1), r = l.start(-1), c = C.get(s).colCount(l.pos - r) + l.nodeAfter.attrs.colspan - 1;
|
|
1614
|
-
let i = t.domAtPos(l.start(-1)).node;
|
|
1615
|
-
for (; i && i.nodeName != "TABLE"; )
|
|
1616
|
-
i = i.parentNode;
|
|
1617
|
-
i && Q(
|
|
1618
|
-
s,
|
|
1619
|
-
i.firstChild,
|
|
1620
|
-
i,
|
|
1621
|
-
n,
|
|
1622
|
-
c,
|
|
1623
|
-
o
|
|
1624
|
-
);
|
|
1625
|
-
}
|
|
1626
|
-
function at(t) {
|
|
1627
|
-
return Array(t).fill(0);
|
|
1628
|
-
}
|
|
1629
|
-
function dt(t, e) {
|
|
1630
|
-
var o;
|
|
1631
|
-
const n = [], l = t.doc.resolve(e), s = l.node(-1);
|
|
1632
|
-
if (!s)
|
|
1633
|
-
return X.empty;
|
|
1634
|
-
const r = C.get(s), c = l.start(-1), i = r.colCount(l.pos - c) + l.nodeAfter.attrs.colspan - 1;
|
|
1635
|
-
for (let a = 0; a < r.height; a++) {
|
|
1636
|
-
const d = i + a * r.width;
|
|
1637
|
-
if ((i == r.width - 1 || r.map[d] != r.map[d + 1]) && (a == 0 || r.map[d] != r.map[d - r.width])) {
|
|
1638
|
-
const f = r.map[d], u = c + f + s.nodeAt(f).nodeSize - 1, h = document.createElement("div");
|
|
1639
|
-
h.className = "column-resize-handle", (o = S.getState(t)) != null && o.dragging && n.push(
|
|
1640
|
-
q.node(
|
|
1641
|
-
c + f,
|
|
1642
|
-
c + f + s.nodeAt(f).nodeSize,
|
|
1643
|
-
{
|
|
1644
|
-
class: "column-resize-dragging"
|
|
1645
|
-
}
|
|
1646
|
-
)
|
|
1647
|
-
), n.push(q.widget(u, h));
|
|
1648
|
-
}
|
|
1649
|
-
}
|
|
1650
|
-
return X.create(t.doc, n);
|
|
1651
|
-
}
|
|
1652
|
-
function kt({
|
|
1653
|
-
allowTableNodeSelection: t = !1
|
|
1654
|
-
} = {}) {
|
|
1655
|
-
return new fe({
|
|
1656
|
-
key: z,
|
|
1657
|
-
// This piece of state is used to remember when a mouse-drag
|
|
1658
|
-
// cell-selection is happening, so that it can continue even as
|
|
1659
|
-
// transactions (which might move its anchor cell) come in.
|
|
1660
|
-
state: {
|
|
1661
|
-
init() {
|
|
1662
|
-
return null;
|
|
1663
|
-
},
|
|
1664
|
-
apply(e, o) {
|
|
1665
|
-
const n = e.getMeta(z);
|
|
1666
|
-
if (n != null) return n == -1 ? null : n;
|
|
1667
|
-
if (o == null || !e.docChanged) return o;
|
|
1668
|
-
const { deleted: l, pos: s } = e.mapping.mapResult(o);
|
|
1669
|
-
return l ? null : s;
|
|
1670
|
-
}
|
|
1671
|
-
},
|
|
1672
|
-
props: {
|
|
1673
|
-
decorations: He,
|
|
1674
|
-
handleDOMEvents: {
|
|
1675
|
-
mousedown: et
|
|
1676
|
-
},
|
|
1677
|
-
createSelectionBetween(e) {
|
|
1678
|
-
return z.getState(e.state) != null ? e.state.selection : null;
|
|
1679
|
-
},
|
|
1680
|
-
handleTripleClick: Qe,
|
|
1681
|
-
handleKeyDown: Ge,
|
|
1682
|
-
handlePaste: Ze
|
|
1683
|
-
},
|
|
1684
|
-
appendTransaction(e, o, n) {
|
|
1685
|
-
return _e(
|
|
1686
|
-
n,
|
|
1687
|
-
Fe(n, o),
|
|
1688
|
-
t
|
|
1689
|
-
);
|
|
1690
|
-
}
|
|
1691
|
-
});
|
|
1692
|
-
}
|
|
1693
|
-
export {
|
|
1694
|
-
w as C,
|
|
1695
|
-
Rt as a,
|
|
1696
|
-
Mt as b,
|
|
1697
|
-
vt as c,
|
|
1698
|
-
te as d,
|
|
1699
|
-
zt as e,
|
|
1700
|
-
Fe as f,
|
|
1701
|
-
Nt as g,
|
|
1702
|
-
St as h,
|
|
1703
|
-
yt as i,
|
|
1704
|
-
bt as j,
|
|
1705
|
-
Ct as k,
|
|
1706
|
-
wt as l,
|
|
1707
|
-
At as m,
|
|
1708
|
-
gt as n,
|
|
1709
|
-
xt as s,
|
|
1710
|
-
kt as t
|
|
1711
|
-
};
|