@hiai-gg/docsmint 2.2.4 → 2.2.5
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/README.md +10 -8
- package/dist/backend/index.js +59962 -40726
- package/dist/frontend/CategoryDialog-CtBDBrmR.js +603 -0
- package/dist/frontend/ConfirmDialog-B7rUgX7M.js +219 -0
- package/dist/frontend/CreateSnapshotDialog-bUKdc0Zb.js +219 -0
- package/dist/frontend/DatePicker-CKTDDpVx.js +291 -0
- package/dist/frontend/DeleteDialog-D28HGxN7.js +175 -0
- package/dist/frontend/FolderNode-CVd22MJS.js +291 -0
- package/dist/frontend/FolderTreeSelector-DObSptCD.js +102 -0
- package/dist/frontend/HiAiEditor--V0-gKwv.js +3266 -0
- package/dist/frontend/HiaiDocsExtensionProvider-B1bCAtpa.js +13 -0
- package/dist/frontend/{Icon-CiHcxcpv.js → Icon-DNapb_KY.js} +3 -2
- package/dist/frontend/SettingsDialog-CN-PrNpM.js +979 -0
- package/dist/frontend/ShareDialog-UO_6vvoT.js +272 -0
- package/dist/frontend/Sidebar-CAxrqTAQ.js +2169 -0
- package/dist/frontend/TagCreateDialog-BdWu4bPX.js +268 -0
- package/dist/frontend/{action_cancel-BdsWzQKU.js → action_cancel-DxbRD-bG.js} +1 -1
- package/dist/frontend/{action_close-CVhfLPRQ.js → action_close-Ct6lVumm.js} +1 -1
- package/dist/frontend/{action_create-ByaroO1_.js → action_create-DKOlnVyX.js} +1 -1
- package/dist/frontend/{action_delete-SRloglWY.js → action_delete-DRb7fBnB.js} +1 -1
- package/dist/frontend/{action_go_to-DO1bicF-.js → action_go_to-D0fF5t1d.js} +1 -1
- package/dist/frontend/{action_loading-iQ0KsN6i.js → action_loading-YGvDyzYG.js} +1 -1
- package/dist/frontend/{action_save-DeqrZQwV.js → action_save-BHYTeFmm.js} +1 -1
- package/dist/frontend/api/categories.js +1 -1
- package/dist/frontend/api/settings.js +1 -1
- package/dist/frontend/api/tags.js +1 -1
- package/dist/frontend/app-shell.js +177 -176
- package/dist/frontend/{auth-client-Dx7d9Tzo.js → auth-client-DahfoSYo.js} +297 -277
- package/dist/frontend/{bundle-mjs-clTO1WW-.js → bundle-mjs-654jE5XN.js} +397 -300
- package/dist/frontend/{camera-DsdOPOcD.js → camera-C6JuKKhr.js} +9 -8
- package/dist/frontend/{categories-CusvHb5Y.js → categories-CUfKlgrs.js} +1 -1
- package/dist/frontend/{categories_update_error-Cn8DBBHv.js → categories_update_error-BrLD-j9s.js} +1 -1
- package/dist/frontend/check-B_e1XqT2.js +25 -0
- package/dist/frontend/chevron-down-BsnN2mp2.js +25 -0
- package/dist/frontend/circle-check-CJH5zxd9.js +29 -0
- package/dist/frontend/clock-CU0gCiiM.js +29 -0
- package/dist/frontend/collaboration.js +113 -113
- package/dist/frontend/components/category-dialog.js +1 -1
- package/dist/frontend/components/create-snapshot-dialog.js +1 -1
- package/dist/frontend/components/delete-dialog.js +1 -1
- package/dist/frontend/components/editor/compact-editor.js +5 -4
- package/dist/frontend/components/editor/document-editor.js +1 -1
- package/dist/frontend/components/editor/document-title.js +3 -2
- package/dist/frontend/components/editor/docx-serializer.js +8359 -12358
- package/dist/frontend/components/editor/extensions.js +1 -1
- package/dist/frontend/components/editor/markdown-toggle.js +33 -32
- package/dist/frontend/components/editor/markdown.js +1 -1
- package/dist/frontend/components/folder-node.js +1 -1
- package/dist/frontend/components/folder-tree-selector.js +1 -1
- package/dist/frontend/components/save-as-dialog.js +168 -167
- package/dist/frontend/components/settings.js +1 -1
- package/dist/frontend/components/share-dialog.js +1 -1
- package/dist/frontend/components/sidebar.js +1 -1
- package/dist/frontend/components/tag-create-dialog.js +1 -1
- package/dist/frontend/components/version-history.js +252 -251
- package/dist/frontend/{copy-Bag46YaR.js → copy-DYNRCHgk.js} +9 -8
- package/dist/frontend/dashboard.js +1301 -1300
- package/dist/frontend/db-yN0Vve_2.js +4296 -0
- package/dist/frontend/{dialog-C0Bpok1d.js → dialog-Dqp04jso.js} +11 -10
- package/dist/frontend/dist-4xBCgXNT.js +40 -0
- package/dist/frontend/{dist-DjId3RKL.js → dist-BaAULhmK.js} +3 -9
- package/dist/frontend/dist-C1oIyJLI.js +302 -0
- package/dist/frontend/dndzone-CWg1kmdZ.js +1483 -0
- package/dist/frontend/{doc_title_label-BOuZzvqv.js → doc_title_label-BPlghiRM.js} +1 -1
- package/dist/frontend/{doc_title_placeholder-ZxpdWWEn.js → doc_title_placeholder-D-LfSoC5.js} +1 -1
- package/dist/frontend/dropdown-menu-HePwCxoQ.js +1429 -0
- package/dist/frontend/{editorExtensions-DbiFj4tn.js → editorExtensions-QKIFSqEG.js} +9 -9
- package/dist/frontend/{editor_markdown_placeholder-BztIY9Ci.js → editor_markdown_placeholder-BXRPm7JG.js} +1 -1
- package/dist/frontend/{ellipsis-vertical-Oymsv1R4.js → ellipsis-vertical-CR25MyeP.js} +9 -8
- package/dist/frontend/{error_dismiss-C651ZdWI.js → error_dismiss-Ckia7GQe.js} +1 -1
- package/dist/frontend/{error_generic-BlWqOE-a.js → error_generic-gyQMdET_.js} +1 -1
- package/dist/frontend/extension.js +1 -1
- package/dist/frontend/{folder-BpmB_sAy.js → folder-BpA690ie.js} +4 -3
- package/dist/frontend/{folders_rename-Cxbg5GIw.js → folders_rename-BHa_gSXw.js} +1 -1
- package/dist/frontend/frontend.css +1 -1
- package/dist/frontend/i18n.js +29 -29
- package/dist/frontend/{identity-B7HeOzDJ.js → identity-ndFYB8Nt.js} +1 -1
- package/dist/frontend/{input-CbeB9220.js → input-Cv3qF4J3.js} +9 -8
- package/dist/frontend/label-DXjefKfF.js +30 -0
- package/dist/frontend/{lib-CITdCbKa.js → lib-DJthN0w9.js} +7108 -5196
- package/dist/frontend/loader-circle-CvWX1HHL.js +25 -0
- package/dist/frontend/{markdown-6E9TWC6V.js → markdown-CksQVQ6a.js} +2 -2
- package/dist/frontend/offline/identity.js +1 -1
- package/dist/frontend/popper-layer-force-mount-DS--Cvfo.js +3493 -0
- package/dist/frontend/rolldown-runtime-DKYsOz5J.js +19 -0
- package/dist/frontend/{rotate-ccw-DAUX7np7.js → rotate-ccw-Box7QP5X.js} +9 -8
- package/dist/frontend/{runtime-CGUiMzK6.js → runtime-CJv8UGYl.js} +1 -4
- package/dist/frontend/{schemas-YXxhj5o8.js → schemas-BYbeR0Ky.js} +11 -11
- package/dist/frontend/{scroll_to_top_aria-lJc2RSx_.js → scroll_to_top_aria-CP7_oyCo.js} +1 -1
- package/dist/frontend/search.js +650 -649
- package/dist/frontend/{search_title-BETwQYJq.js → search_title-C2aOzN_J.js} +1 -1
- package/dist/frontend/select-value-DAMTi0zc.js +1473 -0
- package/dist/frontend/{settings-DyePuqjp.js → settings-DTsCVJEi.js} +1 -1
- package/dist/frontend/{share-context-C2xyVP9M.js → share-context-CtRMIIhL.js} +15 -14
- package/dist/frontend/{share_copied-BuAnmpbz.js → share_copied-BHb_9sOo.js} +1 -1
- package/dist/frontend/{share_toggle_password-LEYUeHWr.js → share_toggle_password-DjCMq4Eq.js} +1 -1
- package/dist/frontend/shared-document.js +49 -48
- package/dist/frontend/{sidebar_uncategorized-C5PGOflV.js → sidebar_uncategorized-BJSB_sc9.js} +1 -1
- package/dist/frontend/{sort_relevance-DpCVLby_.js → sort_relevance-CXuNTq6L.js} +1 -1
- package/dist/frontend/{tag-Wdfe0rKU.js → tag-BPOFgBQw.js} +4 -3
- package/dist/frontend/tag-store.svelte-DyqQNx7H.js +28 -0
- package/dist/frontend/{tags-DlDVothf.js → tags-DwilrkrM.js} +1 -1
- package/dist/frontend/{tags_load_error-BINNpPPV.js → tags_load_error-BOyuQEGc.js} +1 -1
- package/dist/frontend/{tags_new-Dw0Uy43-.js → tags_new-CGF3Hi1j.js} +1 -1
- package/dist/frontend/textarea-DDdgNvnf.js +23 -0
- package/dist/frontend/theme.js +1 -1
- package/dist/frontend/{theme.svelte-BiXvrqwh.js → theme.svelte-Dx01qWc3.js} +2 -2
- package/dist/frontend/{theme_system-YIfa_2Xt.js → theme_system-Bt9ItDgj.js} +1 -1
- package/dist/frontend/utils/dndzone.js +1 -1
- package/dist/frontend/{utils-CnAmIMwr.js → utils-BQMesoNf.js} +1 -1
- package/dist/frontend/utils-BavN35Bw.js +6 -0
- package/dist/frontend/utils.js +1 -1
- package/dist/frontend/{version_create_snapshot-D8xjbuCq.js → version_create_snapshot-BvoOuUeh.js} +1 -1
- package/dist/frontend/{version_restored_from-DYFFSuQj.js → version_restored_from-BIEEKFbx.js} +1 -1
- package/dist/frontend/{version_snapshot_label_placeholder-BhKq1NQ7.js → version_snapshot_label_placeholder-h9r2_0u3.js} +1 -1
- package/dist/frontend/{weekday_we-BxbzNVWR.js → weekday_we-DsuVW6rh.js} +1 -1
- package/dist/frontend/x-hIpDH7DU.js +25 -0
- package/dist/frontend/{yjs-BbwnvxgY.js → yjs--VgxqIlB.js} +607 -628
- package/dist/frontend-ssr/api/categories.js +1 -1
- package/dist/frontend-ssr/api/settings.js +1 -1
- package/dist/frontend-ssr/api/tags.js +1 -1
- package/dist/frontend-ssr/app-shell.js +11 -11
- package/dist/frontend-ssr/assets/{CategoryDialog-2CCX508O.js → CategoryDialog-DRItbO_9.js} +13 -13
- package/dist/frontend-ssr/assets/{ConfirmDialog-Cc6lcY1N.js → ConfirmDialog-B0NXRrel.js} +8 -8
- package/dist/frontend-ssr/assets/{CreateSnapshotDialog-BB8fXF9W.js → CreateSnapshotDialog-nj8PjuON.js} +7 -7
- package/dist/frontend-ssr/assets/{DatePicker-CfzKzipR.js → DatePicker-CdUKLPtP.js} +8 -8
- package/dist/frontend-ssr/assets/{DeleteDialog-DRU4UgOW.js → DeleteDialog-B83NoxAg.js} +3 -3
- package/dist/frontend-ssr/assets/{FolderNode-CyOrLJ2Y.js → FolderNode-CSeC3051.js} +10 -10
- package/dist/frontend-ssr/assets/{FolderTreeSelector-D0reTdFS.js → FolderTreeSelector-Dh-ViJPU.js} +4 -4
- package/dist/frontend-ssr/assets/{HiAiEditor-BQGlGd3z.js → HiAiEditor-DB2PjHm9.js} +41 -41
- package/dist/frontend-ssr/assets/{Icon-CrIRbT5O.js → Icon-CBEeswQ2.js} +4 -4
- package/dist/frontend-ssr/assets/{SettingsDialog-BpHY3IMb.js → SettingsDialog-kc3O9PXG.js} +21 -21
- package/dist/frontend-ssr/assets/{ShareDialog-CY40nWZJ.js → ShareDialog-Dmrj55QP.js} +4 -4
- package/dist/frontend-ssr/assets/{Sidebar-dTp4DyW4.js → Sidebar-CDQcIuyv.js} +45 -45
- package/dist/frontend-ssr/assets/{TagCreateDialog-C2tpdEuj.js → TagCreateDialog-CP-yYfpQ.js} +11 -11
- package/dist/frontend-ssr/assets/{action_cancel-CsBbxW0m.js → action_cancel-B8i5P3wt.js} +1 -1
- package/dist/frontend-ssr/assets/{action_close-lFKBqBwg.js → action_close-DPgIB-cY.js} +1 -1
- package/dist/frontend-ssr/assets/{action_create-BV4ZOcQW.js → action_create-DAlNPFeN.js} +1 -1
- package/dist/frontend-ssr/assets/{action_delete-CNmRhKQP.js → action_delete-C6lsQCtY.js} +1 -1
- package/dist/frontend-ssr/assets/{action_go_to-tN5I26xM.js → action_go_to-C6tegi-k.js} +1 -1
- package/dist/frontend-ssr/assets/{action_save-YCfMiKb4.js → action_save-BQCej1sh.js} +1 -1
- package/dist/frontend-ssr/assets/{auth-client-BnnnJDAb.js → auth-client-CwXGsJIQ.js} +44 -38
- package/dist/frontend-ssr/assets/{camera-OYNSMvMd.js → camera-kjjsHmQu.js} +2 -2
- package/dist/frontend-ssr/assets/{categories_update_error-Bfx5vtvt.js → categories_update_error-Kq8q_FJp.js} +1 -1
- package/dist/frontend-ssr/assets/{chevron-down-DB6YsSbQ.js → chevron-down-DPc-Owbl.js} +2 -2
- package/dist/frontend-ssr/assets/{chevron-right-DOt2uY6b.js → chevron-right-C-jY4mqk.js} +2 -2
- package/dist/frontend-ssr/assets/{circle-check-DQhTm9YR.js → circle-check-CnueRXrc.js} +2 -2
- package/dist/frontend-ssr/assets/{clock-B08dVWtf.js → clock-CoRtIDhT.js} +2 -2
- package/dist/frontend-ssr/assets/{copy-2jsznHar.js → copy-CDNZIGVg.js} +2 -2
- package/dist/frontend-ssr/assets/{db-BEKLU5Fc.js → db-NhMsSg1f.js} +1 -1
- package/dist/frontend-ssr/assets/{dialog-C6U-DqLr.js → dialog-B09MN2S-.js} +9 -9
- package/dist/frontend-ssr/assets/{dist-DqXTz_zE.js → dist-D4MAfF0i.js} +13 -13
- package/dist/frontend-ssr/assets/{dist-ip9bPdma.js → dist-cDG_u5EF.js} +8 -8
- package/dist/frontend-ssr/assets/{dndzone-C7KnICM0.js → dndzone-DyM8UtoT.js} +378 -216
- package/dist/frontend-ssr/assets/{doc_title_label-CE_l-Gum.js → doc_title_label-BqCuH3eY.js} +1 -1
- package/dist/frontend-ssr/assets/{doc_title_placeholder-7_i7PtG6.js → doc_title_placeholder-C3tGSpRB.js} +1 -1
- package/dist/frontend-ssr/assets/dropdown-menu-C9H45F9X.js +1721 -0
- package/dist/frontend-ssr/assets/{editor_markdown_placeholder-CAeLJjFT.js → editor_markdown_placeholder-Cxa5uq87.js} +1 -1
- package/dist/frontend-ssr/assets/{editor_toolbar_undo-CVCfQIS1.js → editor_toolbar_undo-D-gLz88j.js} +1 -1
- package/dist/frontend-ssr/assets/{ellipsis-vertical-IFHt2NM1.js → ellipsis-vertical-oBvMj3Jm.js} +2 -2
- package/dist/frontend-ssr/assets/{error_generic-BB80i0Vk.js → error_generic-BSoVZ_4p.js} +1 -1
- package/dist/frontend-ssr/assets/{folder-CXa1_bm5.js → folder-Ptjeaody.js} +2 -2
- package/dist/frontend-ssr/assets/{folders_rename-ydbfwQlj.js → folders_rename-DBtQcf2R.js} +1 -1
- package/dist/frontend-ssr/assets/{identity-DTz1SQwC.js → identity-CigCqYEA.js} +1 -1
- package/dist/frontend-ssr/assets/{input-Bxw9sFF0.js → input-Cc45dG_S.js} +2 -2
- package/dist/frontend-ssr/assets/{label-CMWedjs6.js → label-C1_J2397.js} +2 -2
- package/dist/frontend-ssr/assets/{loader-circle-zbKj9Qb-.js → loader-circle-CK3McH5n.js} +2 -2
- package/dist/frontend-ssr/assets/{markdown-BmIhDQp7.js → markdown-WQsa_gay.js} +1 -1
- package/dist/frontend-ssr/assets/{popper-layer-force-mount-CSHZsG2E.js → popper-layer-force-mount-CGKwdZaZ.js} +1448 -2402
- package/dist/frontend-ssr/assets/{rotate-ccw-B7SaTFWf.js → rotate-ccw-B1lCxJ5d.js} +2 -2
- package/dist/frontend-ssr/assets/{runtime-BX6-jTn_.js → runtime-CoxALrm1.js} +2 -28
- package/dist/frontend-ssr/assets/{scroll_to_top_aria-CAYSiGHO.js → scroll_to_top_aria-CmLwsPln.js} +1 -1
- package/dist/frontend-ssr/assets/{search_title-C7NVXXq3.js → search_title-CZIl0wkq.js} +1 -1
- package/dist/frontend-ssr/assets/{search_toggle_filters-Bq_YVD8s.js → search_toggle_filters-BG-CRM9G.js} +1 -1
- package/dist/frontend-ssr/assets/{select-value-TgslfiUB.js → select-value-BeUHHkLq.js} +157 -66
- package/dist/frontend-ssr/assets/{settings-B1MA_FjO.js → settings-BqyemuQv.js} +1 -1
- package/dist/frontend-ssr/assets/{share-context-RVh8AExX.js → share-context-BM1sUnlP.js} +15 -15
- package/dist/frontend-ssr/assets/{share_copied-CrwEwkb3.js → share_copied-BVGtm9Ud.js} +1 -1
- package/dist/frontend-ssr/assets/{share_toggle_password-Co56z0Ha.js → share_toggle_password-z0gwy0TG.js} +1 -1
- package/dist/frontend-ssr/assets/{sidebar_uncategorized-COWdmZ3d.js → sidebar_uncategorized-rpbsgLVr.js} +1 -1
- package/dist/frontend-ssr/assets/{tag-BGhtDKpP.js → tag-D_ZqINN3.js} +3 -3
- package/dist/frontend-ssr/assets/{tags_load_error-DW4FbHvr.js → tags_load_error-DvhlyMMY.js} +1 -1
- package/dist/frontend-ssr/assets/{tags_new-Dr3ByMPZ.js → tags_new-DStxzBII.js} +1 -1
- package/dist/frontend-ssr/assets/{textarea-Bz5Tz4rw.js → textarea-S9uzw6je.js} +2 -2
- package/dist/frontend-ssr/assets/{theme.svelte-CdHah46l.js → theme.svelte-CqAzqvik.js} +2 -2
- package/dist/frontend-ssr/assets/{theme_system-E97FASeq.js → theme_system-DjbsL0RQ.js} +1 -1
- package/dist/frontend-ssr/assets/{utils-DF6CmRDX.js → utils-DF93j6z-.js} +1 -1
- package/dist/frontend-ssr/assets/{version_create_snapshot-DeeYB7bb.js → version_create_snapshot-SwYsTZ56.js} +1 -1
- package/dist/frontend-ssr/assets/{version_restored_from-CTt2LM4A.js → version_restored_from-pYBnudye.js} +1 -1
- package/dist/frontend-ssr/assets/{version_snapshot_label_placeholder-BbGD9YuN.js → version_snapshot_label_placeholder-DtDnHip8.js} +1 -1
- package/dist/frontend-ssr/assets/{weekday_we-BzGQ-iFc.js → weekday_we-CV1TMROW.js} +1 -1
- package/dist/frontend-ssr/components/category-dialog.js +1 -1
- package/dist/frontend-ssr/components/create-snapshot-dialog.js +1 -1
- package/dist/frontend-ssr/components/delete-dialog.js +1 -1
- package/dist/frontend-ssr/components/editor/compact-editor.js +1 -1
- package/dist/frontend-ssr/components/editor/document-editor.js +1 -1
- package/dist/frontend-ssr/components/editor/document-title.js +2 -2
- package/dist/frontend-ssr/components/editor/extensions.js +1 -1
- package/dist/frontend-ssr/components/editor/markdown-toggle.js +3 -3
- package/dist/frontend-ssr/components/editor/markdown.js +1 -1
- package/dist/frontend-ssr/components/folder-node.js +1 -1
- package/dist/frontend-ssr/components/folder-tree-selector.js +1 -1
- package/dist/frontend-ssr/components/save-as-dialog.js +10 -10
- package/dist/frontend-ssr/components/settings.js +1 -1
- package/dist/frontend-ssr/components/share-dialog.js +1 -1
- package/dist/frontend-ssr/components/sidebar.js +1 -1
- package/dist/frontend-ssr/components/tag-create-dialog.js +1 -1
- package/dist/frontend-ssr/components/version-history.js +17 -17
- package/dist/frontend-ssr/dashboard.js +61 -158
- package/dist/frontend-ssr/extension.js +1 -1
- package/dist/frontend-ssr/i18n.js +31 -31
- package/dist/frontend-ssr/offline/identity.js +1 -1
- package/dist/frontend-ssr/search.js +13 -13
- package/dist/frontend-ssr/shared-document.js +1 -1
- package/dist/frontend-ssr/theme.js +1 -1
- package/dist/frontend-ssr/utils/dndzone.js +1 -1
- package/dist/lifecycle-runtime.js +17768 -11203
- package/dist/mcp-cli.js +1 -1
- package/dist/mcp-server.js +1 -1
- package/package.json +13 -13
- package/packages/cli/src/index.ts +1 -1
- package/server.json +2 -2
- package/dist/frontend/CategoryDialog-CVJi5PJu.js +0 -602
- package/dist/frontend/ConfirmDialog-0JwB8mKN.js +0 -218
- package/dist/frontend/CreateSnapshotDialog-BLrtuYs5.js +0 -218
- package/dist/frontend/DatePicker-BwSb8TRv.js +0 -326
- package/dist/frontend/DeleteDialog-s7Dr6bXg.js +0 -174
- package/dist/frontend/FolderNode-Ds0LDfK3.js +0 -290
- package/dist/frontend/FolderTreeSelector-BR3lYmPU.js +0 -101
- package/dist/frontend/HiAiEditor-BHz46Iqd.js +0 -3078
- package/dist/frontend/HiaiDocsExtensionProvider-A2nGddUR.js +0 -12
- package/dist/frontend/SettingsDialog-BvS74JZu.js +0 -978
- package/dist/frontend/ShareDialog-Bo50h_Oe.js +0 -271
- package/dist/frontend/Sidebar-DerKtpWB.js +0 -2168
- package/dist/frontend/TagCreateDialog-DhKfsfv3.js +0 -267
- package/dist/frontend/check-DiMZRkKS.js +0 -24
- package/dist/frontend/chevron-down-CxFrMFDJ.js +0 -24
- package/dist/frontend/circle-check-B4F_qgPx.js +0 -28
- package/dist/frontend/clock-dcpueRk-.js +0 -28
- package/dist/frontend/db-B1ZV452J.js +0 -3792
- package/dist/frontend/dist-BlcV_BOY.js +0 -39
- package/dist/frontend/dist-Dl9qg10h.js +0 -301
- package/dist/frontend/dndzone-B9jA0yIS.js +0 -1372
- package/dist/frontend/dropdown-menu-B3nk2aM-.js +0 -482
- package/dist/frontend/label-CfBWf3gI.js +0 -29
- package/dist/frontend/loader-circle-skKwfRCB.js +0 -24
- package/dist/frontend/popper-layer-force-mount-BG0eyrCk.js +0 -4255
- package/dist/frontend/rolldown-runtime-CwxnZyOB.js +0 -22
- package/dist/frontend/select-value-BY5Hw6Rl.js +0 -1412
- package/dist/frontend/tag-store.svelte-C9VYWqLQ.js +0 -28
- package/dist/frontend/textarea-D6emvAwM.js +0 -22
- package/dist/frontend/utils-DH0uqK40.js +0 -6
- package/dist/frontend/x-CBUgPygC.js +0 -24
- package/dist/frontend-ssr/assets/dropdown-menu-BS5fcN9l.js +0 -446
- package/dist/frontend-ssr/assets/{HiaiDocsExtensionProvider-D6cGL-9s.js → HiaiDocsExtensionProvider-BdfQP817.js} +1 -1
- package/dist/frontend-ssr/assets/{categories-bBPviKjl.js → categories-CMmudpEk.js} +1 -1
- package/dist/frontend-ssr/assets/{editorExtensions-2O7O2Nhv.js → editorExtensions-DOPTTKUS.js} +2 -2
- package/dist/frontend-ssr/assets/{tag-store.svelte-CUUgAaDD.js → tag-store.svelte-Djpf1W0n.js} +1 -1
- package/dist/frontend-ssr/assets/{tags-C7u-LBsl.js → tags-GQOEtqET.js} +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// ../node_modules/.bun/svelte-dnd-action@0.9.
|
|
1
|
+
// ../node_modules/.bun/svelte-dnd-action@0.9.81+39695945a324e2d8/node_modules/svelte-dnd-action/dist/index.mjs
|
|
2
2
|
function ownKeys(object, enumerableOnly) {
|
|
3
3
|
var keys = Object.keys(object);
|
|
4
4
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -170,6 +170,79 @@ function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
|
170
170
|
}
|
|
171
171
|
};
|
|
172
172
|
}
|
|
173
|
+
/**
|
|
174
|
+
* The window an element lives in. A drop zone can live in another window than the one that
|
|
175
|
+
* loaded this module, for example a same-origin iframe or a popup opened with window.open.
|
|
176
|
+
* @param {Node} el
|
|
177
|
+
* @return {Window}
|
|
178
|
+
*/
|
|
179
|
+
function getWindowOf(el) {
|
|
180
|
+
return el.ownerDocument.defaultView || window;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Schedules a timeout on the given window. Work for a zone runs on the zone's window: the browser throttles
|
|
184
|
+
* or stops the timers of a hidden window, and the loading window can be hidden while the zone's is not.
|
|
185
|
+
* @param {Window} win
|
|
186
|
+
* @param {function} callback
|
|
187
|
+
* @param {number} ms
|
|
188
|
+
* @return {{win: Window, id: number}} - pass it to clearTimeoutIn
|
|
189
|
+
*/
|
|
190
|
+
function setTimeoutIn(win, callback, ms) {
|
|
191
|
+
return {
|
|
192
|
+
win,
|
|
193
|
+
id: win.setTimeout(callback, ms)
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Cancels a timeout through the window that scheduled it
|
|
198
|
+
* @param {{win: Window, id: number}} [timeout] - from setTimeoutIn
|
|
199
|
+
*/
|
|
200
|
+
function clearTimeoutIn(timeout) {
|
|
201
|
+
if (timeout) timeout.win.clearTimeout(timeout.id);
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* @param {Object} object
|
|
205
|
+
* @return {string}
|
|
206
|
+
*/
|
|
207
|
+
function toString(object) {
|
|
208
|
+
return JSON.stringify(object, null, 2);
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Finds the depth of the given node in the DOM tree
|
|
212
|
+
* @param {HTMLElement} node
|
|
213
|
+
* @return {number} - the depth of the node
|
|
214
|
+
*/
|
|
215
|
+
function getDepth(node) {
|
|
216
|
+
if (!node) throw new Error("cannot get depth of a falsy node");
|
|
217
|
+
return _getDepth(node, 0);
|
|
218
|
+
}
|
|
219
|
+
function _getDepth(node) {
|
|
220
|
+
var countSoFar = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
|
|
221
|
+
if (!node.parentElement) return countSoFar - 1;
|
|
222
|
+
return _getDepth(node.parentElement, countSoFar + 1);
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* A simple util to shallow compare objects quickly, it doesn't validate the arguments so pass objects in
|
|
226
|
+
* @param {Object} objA
|
|
227
|
+
* @param {Object} objB
|
|
228
|
+
* @return {boolean} - true if objA and objB are shallow equal
|
|
229
|
+
*/
|
|
230
|
+
function areObjectsShallowEqual(objA, objB) {
|
|
231
|
+
if (Object.keys(objA).length !== Object.keys(objB).length) return false;
|
|
232
|
+
for (var keyA in objA) if (!{}.hasOwnProperty.call(objB, keyA) || objB[keyA] !== objA[keyA]) return false;
|
|
233
|
+
return true;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Shallow compares two arrays
|
|
237
|
+
* @param arrA
|
|
238
|
+
* @param arrB
|
|
239
|
+
* @return {boolean} - whether the arrays are shallow equal
|
|
240
|
+
*/
|
|
241
|
+
function areArraysShallowEqualSameOrder(arrA, arrB) {
|
|
242
|
+
if (arrA.length !== arrB.length) return false;
|
|
243
|
+
for (var i = 0; i < arrA.length; i++) if (arrA[i] !== arrB[i]) return false;
|
|
244
|
+
return true;
|
|
245
|
+
}
|
|
173
246
|
var FINALIZE_EVENT_NAME = "finalize";
|
|
174
247
|
var CONSIDER_EVENT_NAME = "consider";
|
|
175
248
|
/**
|
|
@@ -182,7 +255,7 @@ var CONSIDER_EVENT_NAME = "consider";
|
|
|
182
255
|
* @param {Info} info
|
|
183
256
|
*/
|
|
184
257
|
function dispatchFinalizeEvent(el, items, info) {
|
|
185
|
-
el.dispatchEvent(new CustomEvent(FINALIZE_EVENT_NAME, { detail: {
|
|
258
|
+
el.dispatchEvent(new (getWindowOf(el)).CustomEvent(FINALIZE_EVENT_NAME, { detail: {
|
|
186
259
|
items,
|
|
187
260
|
info
|
|
188
261
|
} }));
|
|
@@ -194,7 +267,7 @@ function dispatchFinalizeEvent(el, items, info) {
|
|
|
194
267
|
* @param {Info} info
|
|
195
268
|
*/
|
|
196
269
|
function dispatchConsiderEvent(el, items, info) {
|
|
197
|
-
el.dispatchEvent(new CustomEvent(CONSIDER_EVENT_NAME, { detail: {
|
|
270
|
+
el.dispatchEvent(new (getWindowOf(el)).CustomEvent(CONSIDER_EVENT_NAME, { detail: {
|
|
198
271
|
items,
|
|
199
272
|
info
|
|
200
273
|
} }));
|
|
@@ -208,7 +281,7 @@ var DRAGGED_LEFT_TYPES = {
|
|
|
208
281
|
OUTSIDE_OF_ANY: "outsideOfAny"
|
|
209
282
|
};
|
|
210
283
|
function dispatchDraggedElementEnteredContainer(containerEl, indexObj, draggedEl) {
|
|
211
|
-
containerEl.dispatchEvent(new CustomEvent(DRAGGED_ENTERED_EVENT_NAME, { detail: {
|
|
284
|
+
containerEl.dispatchEvent(new (getWindowOf(containerEl)).CustomEvent(DRAGGED_ENTERED_EVENT_NAME, { detail: {
|
|
212
285
|
indexObj,
|
|
213
286
|
draggedEl
|
|
214
287
|
} }));
|
|
@@ -219,26 +292,27 @@ function dispatchDraggedElementEnteredContainer(containerEl, indexObj, draggedEl
|
|
|
219
292
|
* @param theOtherDz - the new dropzone the element entered
|
|
220
293
|
*/
|
|
221
294
|
function dispatchDraggedElementLeftContainerForAnother(containerEl, draggedEl, theOtherDz) {
|
|
222
|
-
containerEl.dispatchEvent(new CustomEvent(DRAGGED_LEFT_EVENT_NAME, { detail: {
|
|
295
|
+
containerEl.dispatchEvent(new (getWindowOf(containerEl)).CustomEvent(DRAGGED_LEFT_EVENT_NAME, { detail: {
|
|
223
296
|
draggedEl,
|
|
224
297
|
type: DRAGGED_LEFT_TYPES.LEFT_FOR_ANOTHER,
|
|
225
298
|
theOtherDz
|
|
226
299
|
} }));
|
|
227
300
|
}
|
|
228
301
|
function dispatchDraggedElementLeftContainerForNone(containerEl, draggedEl) {
|
|
229
|
-
containerEl.dispatchEvent(new CustomEvent(DRAGGED_LEFT_EVENT_NAME, { detail: {
|
|
302
|
+
containerEl.dispatchEvent(new (getWindowOf(containerEl)).CustomEvent(DRAGGED_LEFT_EVENT_NAME, { detail: {
|
|
230
303
|
draggedEl,
|
|
231
304
|
type: DRAGGED_LEFT_TYPES.OUTSIDE_OF_ANY
|
|
232
305
|
} }));
|
|
233
306
|
}
|
|
234
307
|
function dispatchDraggedElementIsOverIndex(containerEl, indexObj, draggedEl) {
|
|
235
|
-
containerEl.dispatchEvent(new CustomEvent(DRAGGED_OVER_INDEX_EVENT_NAME, { detail: {
|
|
308
|
+
containerEl.dispatchEvent(new (getWindowOf(containerEl)).CustomEvent(DRAGGED_OVER_INDEX_EVENT_NAME, { detail: {
|
|
236
309
|
indexObj,
|
|
237
310
|
draggedEl
|
|
238
311
|
} }));
|
|
239
312
|
}
|
|
240
313
|
function dispatchDraggedLeftDocument(draggedEl) {
|
|
241
|
-
|
|
314
|
+
var win = getWindowOf(draggedEl);
|
|
315
|
+
win.dispatchEvent(new win.CustomEvent(DRAGGED_LEFT_DOCUMENT_EVENT_NAME, { detail: { draggedEl } }));
|
|
242
316
|
}
|
|
243
317
|
var TRIGGERS = {
|
|
244
318
|
DRAG_STARTED: "dragStarted",
|
|
@@ -292,7 +366,7 @@ function getBoundingRectNoTransforms(el) {
|
|
|
292
366
|
var onlyVisible = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
|
|
293
367
|
var ta;
|
|
294
368
|
var rect = onlyVisible ? getVisibleRectRecursive(el) : el.getBoundingClientRect();
|
|
295
|
-
var style = getComputedStyle(el);
|
|
369
|
+
var style = getWindowOf(el).getComputedStyle(el);
|
|
296
370
|
var tx = style.transform;
|
|
297
371
|
if (tx) {
|
|
298
372
|
var sx, sy, dx, dy;
|
|
@@ -333,11 +407,12 @@ function getBoundingRectNoTransforms(el) {
|
|
|
333
407
|
*/
|
|
334
408
|
function getAbsoluteRectNoTransforms(el) {
|
|
335
409
|
var rect = getBoundingRectNoTransforms(el);
|
|
410
|
+
var win = getWindowOf(el);
|
|
336
411
|
return {
|
|
337
|
-
top: rect.top +
|
|
338
|
-
bottom: rect.bottom +
|
|
339
|
-
left: rect.left +
|
|
340
|
-
right: rect.right +
|
|
412
|
+
top: rect.top + win.scrollY,
|
|
413
|
+
bottom: rect.bottom + win.scrollY,
|
|
414
|
+
left: rect.left + win.scrollX,
|
|
415
|
+
right: rect.right + win.scrollX
|
|
341
416
|
};
|
|
342
417
|
}
|
|
343
418
|
/**
|
|
@@ -347,11 +422,12 @@ function getAbsoluteRectNoTransforms(el) {
|
|
|
347
422
|
*/
|
|
348
423
|
function getAbsoluteRect(el) {
|
|
349
424
|
var rect = el.getBoundingClientRect();
|
|
425
|
+
var win = getWindowOf(el);
|
|
350
426
|
return {
|
|
351
|
-
top: rect.top +
|
|
352
|
-
bottom: rect.bottom +
|
|
353
|
-
left: rect.left +
|
|
354
|
-
right: rect.right +
|
|
427
|
+
top: rect.top + win.scrollY,
|
|
428
|
+
bottom: rect.bottom + win.scrollY,
|
|
429
|
+
left: rect.left + win.scrollX,
|
|
430
|
+
right: rect.right + win.scrollX
|
|
355
431
|
};
|
|
356
432
|
}
|
|
357
433
|
/**
|
|
@@ -412,7 +488,8 @@ function calcDistanceFromPointToCenter(point, el) {
|
|
|
412
488
|
*/
|
|
413
489
|
function isElementOffDocument(el) {
|
|
414
490
|
var rect = getAbsoluteRect(el);
|
|
415
|
-
|
|
491
|
+
var documentElement = el.ownerDocument.documentElement;
|
|
492
|
+
return rect.right < 0 || rect.left > documentElement.scrollWidth || rect.bottom < 0 || rect.top > documentElement.scrollHeight;
|
|
416
493
|
}
|
|
417
494
|
/**
|
|
418
495
|
* Computes the portion of an element that is actually visible inside its scrollable
|
|
@@ -439,8 +516,8 @@ function getVisibleRectRecursive(element) {
|
|
|
439
516
|
var wasClippedByScrollY = false;
|
|
440
517
|
var wasClippedByScrollX = false;
|
|
441
518
|
var parent = element.parentElement;
|
|
442
|
-
while (parent && parent !==
|
|
443
|
-
var style =
|
|
519
|
+
while (parent && parent !== element.ownerDocument.body) {
|
|
520
|
+
var style = getWindowOf(parent).getComputedStyle(parent);
|
|
444
521
|
var overflowY = style.overflowY;
|
|
445
522
|
var overflowX = style.overflowX;
|
|
446
523
|
var isScrollableY = overflowY === "scroll" || overflowY === "auto";
|
|
@@ -560,52 +637,10 @@ function findWouldBeIndex(referencePoint, collectionBelowEl) {
|
|
|
560
637
|
isProximityBased: true
|
|
561
638
|
};
|
|
562
639
|
}
|
|
563
|
-
/**
|
|
564
|
-
* @param {Object} object
|
|
565
|
-
* @return {string}
|
|
566
|
-
*/
|
|
567
|
-
function toString(object) {
|
|
568
|
-
return JSON.stringify(object, null, 2);
|
|
569
|
-
}
|
|
570
|
-
/**
|
|
571
|
-
* Finds the depth of the given node in the DOM tree
|
|
572
|
-
* @param {HTMLElement} node
|
|
573
|
-
* @return {number} - the depth of the node
|
|
574
|
-
*/
|
|
575
|
-
function getDepth(node) {
|
|
576
|
-
if (!node) throw new Error("cannot get depth of a falsy node");
|
|
577
|
-
return _getDepth(node, 0);
|
|
578
|
-
}
|
|
579
|
-
function _getDepth(node) {
|
|
580
|
-
var countSoFar = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
|
|
581
|
-
if (!node.parentElement) return countSoFar - 1;
|
|
582
|
-
return _getDepth(node.parentElement, countSoFar + 1);
|
|
583
|
-
}
|
|
584
|
-
/**
|
|
585
|
-
* A simple util to shallow compare objects quickly, it doesn't validate the arguments so pass objects in
|
|
586
|
-
* @param {Object} objA
|
|
587
|
-
* @param {Object} objB
|
|
588
|
-
* @return {boolean} - true if objA and objB are shallow equal
|
|
589
|
-
*/
|
|
590
|
-
function areObjectsShallowEqual(objA, objB) {
|
|
591
|
-
if (Object.keys(objA).length !== Object.keys(objB).length) return false;
|
|
592
|
-
for (var keyA in objA) if (!{}.hasOwnProperty.call(objB, keyA) || objB[keyA] !== objA[keyA]) return false;
|
|
593
|
-
return true;
|
|
594
|
-
}
|
|
595
|
-
/**
|
|
596
|
-
* Shallow compares two arrays
|
|
597
|
-
* @param arrA
|
|
598
|
-
* @param arrB
|
|
599
|
-
* @return {boolean} - whether the arrays are shallow equal
|
|
600
|
-
*/
|
|
601
|
-
function areArraysShallowEqualSameOrder(arrA, arrB) {
|
|
602
|
-
if (arrA.length !== arrB.length) return false;
|
|
603
|
-
for (var i = 0; i < arrA.length; i++) if (arrA[i] !== arrB[i]) return false;
|
|
604
|
-
return true;
|
|
605
|
-
}
|
|
606
640
|
var INTERVAL_MS = 200;
|
|
607
641
|
var TOLERANCE_PX = 10;
|
|
608
642
|
var next;
|
|
643
|
+
var currentObservation;
|
|
609
644
|
/**
|
|
610
645
|
* Tracks the dragged elements and performs the side effects when it is dragged over a drop zone (basically dispatching custom-events scrolling)
|
|
611
646
|
* @param {Set<HTMLElement>} dropZones
|
|
@@ -622,6 +657,9 @@ function observe(draggedEl, dropZones) {
|
|
|
622
657
|
var lastIndexFound;
|
|
623
658
|
var lastIsDraggedInADropZone = false;
|
|
624
659
|
var lastCentrePositionOfDragged;
|
|
660
|
+
var win = getWindowOf(draggedEl);
|
|
661
|
+
var observation = {};
|
|
662
|
+
currentObservation = observation;
|
|
625
663
|
var dropZonesFromDeepToShallow = Array.from(dropZones).sort(function(dz1, dz2) {
|
|
626
664
|
return getDepth(dz2) - getDepth(dz1);
|
|
627
665
|
});
|
|
@@ -632,7 +670,7 @@ function observe(draggedEl, dropZones) {
|
|
|
632
670
|
var referencePoint = getReferencePoint();
|
|
633
671
|
var scrolled = multiScroller.multiScrollIfNeeded();
|
|
634
672
|
if (!scrolled && lastCentrePositionOfDragged && Math.abs(lastCentrePositionOfDragged.x - referencePoint.x) < TOLERANCE_PX && Math.abs(lastCentrePositionOfDragged.y - referencePoint.y) < TOLERANCE_PX) {
|
|
635
|
-
next =
|
|
673
|
+
next = setTimeoutIn(win, andNow, intervalMs);
|
|
636
674
|
return;
|
|
637
675
|
}
|
|
638
676
|
if (isElementOffDocument(draggedEl)) {
|
|
@@ -652,6 +690,7 @@ function observe(draggedEl, dropZones) {
|
|
|
652
690
|
isDraggedInADropZone = true;
|
|
653
691
|
if (dz !== lastDropZoneFound) {
|
|
654
692
|
lastDropZoneFound && dispatchDraggedElementLeftContainerForAnother(lastDropZoneFound, draggedEl, dz);
|
|
693
|
+
if (currentObservation !== observation) return;
|
|
655
694
|
dispatchDraggedElementEnteredContainer(dz, indexObj, draggedEl);
|
|
656
695
|
lastDropZoneFound = dz;
|
|
657
696
|
} else if (index !== lastIndexFound) {
|
|
@@ -671,12 +710,15 @@ function observe(draggedEl, dropZones) {
|
|
|
671
710
|
lastIndexFound = void 0;
|
|
672
711
|
lastIsDraggedInADropZone = false;
|
|
673
712
|
} else lastIsDraggedInADropZone = true;
|
|
674
|
-
|
|
713
|
+
if (currentObservation !== observation) return;
|
|
714
|
+
next = setTimeoutIn(win, andNow, intervalMs);
|
|
675
715
|
}
|
|
676
716
|
andNow();
|
|
677
717
|
}
|
|
678
718
|
function unobserve() {
|
|
679
|
-
|
|
719
|
+
currentObservation = void 0;
|
|
720
|
+
clearTimeoutIn(next);
|
|
721
|
+
next = void 0;
|
|
680
722
|
resetIndexesCache();
|
|
681
723
|
}
|
|
682
724
|
var SCROLL_ZONE_PX = 30;
|
|
@@ -697,7 +739,7 @@ function makeScroller() {
|
|
|
697
739
|
var _scrollingInfo = scrollingInfo, directionObj = _scrollingInfo.directionObj, stepPx = _scrollingInfo.stepPx;
|
|
698
740
|
if (directionObj) {
|
|
699
741
|
containerEl.scrollBy(directionObj.x * stepPx, directionObj.y * stepPx);
|
|
700
|
-
|
|
742
|
+
getWindowOf(containerEl).requestAnimationFrame(function() {
|
|
701
743
|
return scrollContainer(containerEl);
|
|
702
744
|
});
|
|
703
745
|
}
|
|
@@ -778,11 +820,11 @@ function makeScroller() {
|
|
|
778
820
|
* @return {null|{top: number, left: number, bottom: number, right: number}}
|
|
779
821
|
*/
|
|
780
822
|
function calcInnerDistancesBetweenPointAndSidesOfElement(point, el) {
|
|
781
|
-
var rect = el ===
|
|
823
|
+
var rect = el === el.ownerDocument.scrollingElement ? {
|
|
782
824
|
top: 0,
|
|
783
|
-
bottom:
|
|
825
|
+
bottom: getWindowOf(el).innerHeight,
|
|
784
826
|
left: 0,
|
|
785
|
-
right:
|
|
827
|
+
right: getWindowOf(el).innerWidth
|
|
786
828
|
} : el.getBoundingClientRect();
|
|
787
829
|
if (!isPointInsideRect(point, rect)) return null;
|
|
788
830
|
return {
|
|
@@ -816,7 +858,7 @@ function createMultiScroller() {
|
|
|
816
858
|
var mousePosition = getPointerPosition();
|
|
817
859
|
if (!mousePosition || !scrollingContainersDeepToShallow) return false;
|
|
818
860
|
var scrollContainersUnderCursor = scrollingContainersDeepToShallow.filter(function(el) {
|
|
819
|
-
return isPointInsideRect(mousePosition, el.getBoundingClientRect()) || el ===
|
|
861
|
+
return isPointInsideRect(mousePosition, el.getBoundingClientRect()) || el === el.ownerDocument.scrollingElement;
|
|
820
862
|
});
|
|
821
863
|
for (var i = 0; i < scrollContainersUnderCursor.length; i++) if (scrollIfNeeded(mousePosition, scrollContainersUnderCursor[i])) return true;
|
|
822
864
|
return false;
|
|
@@ -835,7 +877,7 @@ function findScrollableParents(element) {
|
|
|
835
877
|
var scrollableContainers = [];
|
|
836
878
|
var parent = element;
|
|
837
879
|
while (parent) {
|
|
838
|
-
if (
|
|
880
|
+
if (getWindowOf(parent).getComputedStyle(parent).overflow.split(" ").some(function(o) {
|
|
839
881
|
return o.includes("auto") || o.includes("scroll");
|
|
840
882
|
})) scrollableContainers.push(parent);
|
|
841
883
|
parent = parent.parentElement;
|
|
@@ -851,13 +893,14 @@ function findRelevantScrollContainers(dropZones) {
|
|
|
851
893
|
findScrollableParents(dz).forEach(function(container) {
|
|
852
894
|
return scrollingContainers.add(container);
|
|
853
895
|
});
|
|
896
|
+
var scrollingElement = dz.ownerDocument.scrollingElement;
|
|
897
|
+
if (scrollingElement.scrollHeight > scrollingElement.clientHeight || scrollingElement.scrollWidth > scrollingElement.clientHeight) scrollingContainers.add(scrollingElement);
|
|
854
898
|
}
|
|
855
899
|
} catch (err) {
|
|
856
900
|
_iterator.e(err);
|
|
857
901
|
} finally {
|
|
858
902
|
_iterator.f();
|
|
859
903
|
}
|
|
860
|
-
if (document.scrollingElement.scrollHeight > document.scrollingElement.clientHeight || document.scrollingElement.scrollWidth > document.scrollingElement.clientHeight) scrollingContainers.add(document.scrollingElement);
|
|
861
904
|
return scrollingContainers;
|
|
862
905
|
}
|
|
863
906
|
/**
|
|
@@ -953,6 +996,7 @@ function ensureMorphSizeTransitions(draggedEl) {
|
|
|
953
996
|
*/
|
|
954
997
|
function createDraggedElementFrom(originalElement, positionCenterOnXY) {
|
|
955
998
|
var rect = originalElement.getBoundingClientRect();
|
|
999
|
+
var win = getWindowOf(originalElement);
|
|
956
1000
|
var draggedEl = svelteNodeClone(originalElement);
|
|
957
1001
|
copyStylesFromTo(originalElement, draggedEl);
|
|
958
1002
|
draggedEl.id = DRAGGED_ELEMENT_ID;
|
|
@@ -965,7 +1009,7 @@ function createDraggedElementFrom(originalElement, positionCenterOnXY) {
|
|
|
965
1009
|
var center = findCenter(rect);
|
|
966
1010
|
elTopPx -= center.y - positionCenterOnXY.y;
|
|
967
1011
|
elLeftPx -= center.x - positionCenterOnXY.x;
|
|
968
|
-
|
|
1012
|
+
win.setTimeout(function() {
|
|
969
1013
|
draggedEl.style.top = "".concat(elTopPx, "px");
|
|
970
1014
|
draggedEl.style.left = "".concat(elLeftPx, "px");
|
|
971
1015
|
}, 0);
|
|
@@ -975,7 +1019,7 @@ function createDraggedElementFrom(originalElement, positionCenterOnXY) {
|
|
|
975
1019
|
draggedEl.style.height = "".concat(rect.height, "px");
|
|
976
1020
|
draggedEl.style.width = "".concat(rect.width, "px");
|
|
977
1021
|
draggedEl.style.transition = "".concat(trs("top"), ", ").concat(trs("left"), ", ").concat(trs("background-color"), ", ").concat(trs("opacity"), ", ").concat(trs("color"), " ");
|
|
978
|
-
|
|
1022
|
+
win.setTimeout(function() {
|
|
979
1023
|
return ensureMorphSizeTransitions(draggedEl);
|
|
980
1024
|
}, 0);
|
|
981
1025
|
draggedEl.style.zIndex = "9999";
|
|
@@ -1001,7 +1045,7 @@ function morphDraggedElementToBeLike(draggedEl, copyFromEl, currentMouseX, curre
|
|
|
1001
1045
|
copyStylesFromTo(copyFromEl, draggedEl);
|
|
1002
1046
|
var newRect = copyFromEl.getBoundingClientRect();
|
|
1003
1047
|
var draggedElRect = draggedEl.getBoundingClientRect();
|
|
1004
|
-
var draggedElComputedStyle =
|
|
1048
|
+
var draggedElComputedStyle = getWindowOf(draggedEl).getComputedStyle(draggedEl);
|
|
1005
1049
|
var currentLeft = parseFloat(draggedElComputedStyle.left);
|
|
1006
1050
|
var currentTop = parseFloat(draggedElComputedStyle.top);
|
|
1007
1051
|
var widthChange = newRect.width - draggedElRect.width;
|
|
@@ -1024,7 +1068,7 @@ function morphDraggedElementToBeLike(draggedEl, copyFromEl, currentMouseX, curre
|
|
|
1024
1068
|
* @param {HTMLElement} copyToEl
|
|
1025
1069
|
*/
|
|
1026
1070
|
function copyStylesFromTo(copyFromEl, copyToEl) {
|
|
1027
|
-
var computedStyle =
|
|
1071
|
+
var computedStyle = getWindowOf(copyFromEl).getComputedStyle(copyFromEl);
|
|
1028
1072
|
Array.from(computedStyle).filter(function(s) {
|
|
1029
1073
|
return s.startsWith("background") || s.startsWith("padding") || s.startsWith("font") || s.startsWith("text") || s.startsWith("align") || s.startsWith("justify") || s.startsWith("display") || s.startsWith("flex") || s.startsWith("border") || s === "opacity" || s === "color" || s === "list-style-type" || getFeatureFlag(FEATURE_FLAG_NAMES.USE_COMPUTED_STYLE_INSTEAD_OF_BOUNDING_RECT) && (s === "width" || s === "height");
|
|
1030
1074
|
}).forEach(function(s) {
|
|
@@ -1125,9 +1169,10 @@ function styleInactiveDropZones(dropZones) {
|
|
|
1125
1169
|
*/
|
|
1126
1170
|
function preventShrinking(el) {
|
|
1127
1171
|
var originalMinHeight = el.style.minHeight;
|
|
1128
|
-
|
|
1172
|
+
var computedStyle = getWindowOf(el).getComputedStyle(el);
|
|
1173
|
+
el.style.minHeight = computedStyle.getPropertyValue("height");
|
|
1129
1174
|
var originalMinWidth = el.style.minWidth;
|
|
1130
|
-
el.style.minWidth =
|
|
1175
|
+
el.style.minWidth = computedStyle.getPropertyValue("width");
|
|
1131
1176
|
return function undo() {
|
|
1132
1177
|
el.style.minHeight = originalMinHeight;
|
|
1133
1178
|
el.style.minWidth = originalMinWidth;
|
|
@@ -1161,6 +1206,8 @@ var touchHoldElapsed = false;
|
|
|
1161
1206
|
var useCursorForDetectionActive = false;
|
|
1162
1207
|
var pendingDragOwner;
|
|
1163
1208
|
var watchedDropZones = /* @__PURE__ */ new Set();
|
|
1209
|
+
var dragWindow;
|
|
1210
|
+
var dropFinalization;
|
|
1164
1211
|
var typeToDropZones$1 = /* @__PURE__ */ new Map();
|
|
1165
1212
|
var dzToConfig$1 = /* @__PURE__ */ new Map();
|
|
1166
1213
|
var elToMouseDownListener = /* @__PURE__ */ new WeakMap();
|
|
@@ -1177,9 +1224,14 @@ function unregisterDropZone$1(dropZoneEl, type) {
|
|
|
1177
1224
|
decrementActiveDropZoneCount();
|
|
1178
1225
|
if (dropZones.size === 0) typeToDropZones$1["delete"](type);
|
|
1179
1226
|
}
|
|
1227
|
+
function getDropZonesInDragWindow(type) {
|
|
1228
|
+
return Array.from(typeToDropZones$1.get(type) || []).filter(function(dz) {
|
|
1229
|
+
return dz.ownerDocument.defaultView === dragWindow;
|
|
1230
|
+
});
|
|
1231
|
+
}
|
|
1180
1232
|
function watchDraggedElement() {
|
|
1181
|
-
var dropZones =
|
|
1182
|
-
if (
|
|
1233
|
+
var dropZones = getDropZonesInDragWindow(draggedElType);
|
|
1234
|
+
if (dropZones.length === 0) return;
|
|
1183
1235
|
if (watchedDropZones.size > 0) unWatchDraggedElement();
|
|
1184
1236
|
watchedDropZones = new Set(dropZones);
|
|
1185
1237
|
var _iterator = _createForOfIteratorHelper(watchedDropZones), _step;
|
|
@@ -1195,7 +1247,7 @@ function watchDraggedElement() {
|
|
|
1195
1247
|
} finally {
|
|
1196
1248
|
_iterator.f();
|
|
1197
1249
|
}
|
|
1198
|
-
|
|
1250
|
+
dragWindow.addEventListener(DRAGGED_LEFT_DOCUMENT_EVENT_NAME, handleDrop$1);
|
|
1199
1251
|
var setIntervalMs = Math.max.apply(Math, _toConsumableArray(Array.from(watchedDropZones).map(function(dz) {
|
|
1200
1252
|
return dzToConfig$1.get(dz).dropAnimationDurationMs;
|
|
1201
1253
|
})));
|
|
@@ -1205,8 +1257,8 @@ function watchDraggedElement() {
|
|
|
1205
1257
|
});
|
|
1206
1258
|
var getReferencePoint = useCursorForDetectionActive ? function() {
|
|
1207
1259
|
return {
|
|
1208
|
-
x: currentMousePosition.x +
|
|
1209
|
-
y: currentMousePosition.y +
|
|
1260
|
+
x: currentMousePosition.x + dragWindow.scrollX,
|
|
1261
|
+
y: currentMousePosition.y + dragWindow.scrollY
|
|
1210
1262
|
};
|
|
1211
1263
|
} : function() {
|
|
1212
1264
|
return findCenterOfElement(draggedEl);
|
|
@@ -1228,7 +1280,7 @@ function unWatchDraggedElement() {
|
|
|
1228
1280
|
_iterator2.f();
|
|
1229
1281
|
}
|
|
1230
1282
|
watchedDropZones = /* @__PURE__ */ new Set();
|
|
1231
|
-
|
|
1283
|
+
dragWindow.removeEventListener(DRAGGED_LEFT_DOCUMENT_EVENT_NAME, handleDrop$1);
|
|
1232
1284
|
if (multiScroller) {
|
|
1233
1285
|
multiScroller.destroy();
|
|
1234
1286
|
multiScroller = void 0;
|
|
@@ -1260,6 +1312,7 @@ function handleDraggedEntered(e) {
|
|
|
1260
1312
|
id: draggedElData[ITEM_ID_KEY],
|
|
1261
1313
|
source: SOURCES.POINTER
|
|
1262
1314
|
});
|
|
1315
|
+
if (!isWorkingOnPreviousDrag) return;
|
|
1263
1316
|
}
|
|
1264
1317
|
var shadowElIdx = e.detail.indexObj.index;
|
|
1265
1318
|
shadowElDropZone = e.currentTarget;
|
|
@@ -1290,6 +1343,7 @@ function handleDraggedLeft(e) {
|
|
|
1290
1343
|
id: draggedElData[ITEM_ID_KEY],
|
|
1291
1344
|
source: SOURCES.POINTER
|
|
1292
1345
|
});
|
|
1346
|
+
if (!isWorkingOnPreviousDrag) return;
|
|
1293
1347
|
}
|
|
1294
1348
|
dispatchConsiderEvent(e.currentTarget, items, {
|
|
1295
1349
|
trigger: TRIGGERS.DRAGGED_LEFT,
|
|
@@ -1323,15 +1377,15 @@ function handleMouseMove(e) {
|
|
|
1323
1377
|
}
|
|
1324
1378
|
function handleDrop$1() {
|
|
1325
1379
|
finalizingPreviousDrag = true;
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1380
|
+
dragWindow.removeEventListener("mousemove", handleMouseMove);
|
|
1381
|
+
dragWindow.removeEventListener("touchmove", handleMouseMove);
|
|
1382
|
+
dragWindow.removeEventListener("mouseup", handleDrop$1);
|
|
1383
|
+
dragWindow.removeEventListener("touchend", handleDrop$1);
|
|
1330
1384
|
unWatchDraggedElement();
|
|
1331
1385
|
moveDraggedElementToWasDroppedState(draggedEl);
|
|
1332
1386
|
if (!shadowElDropZone) shadowElDropZone = originDropZone;
|
|
1333
|
-
var _dzToConfig$get4 = dzToConfig$1.get(shadowElDropZone), items = _dzToConfig$get4.items
|
|
1334
|
-
styleInactiveDropZones(
|
|
1387
|
+
var _dzToConfig$get4 = dzToConfig$1.get(shadowElDropZone), items = _dzToConfig$get4.items;
|
|
1388
|
+
styleInactiveDropZones(getDropZonesInDragWindow(_dzToConfig$get4.type), function(dz) {
|
|
1335
1389
|
return dzToConfig$1.get(dz).dropTargetStyle;
|
|
1336
1390
|
}, function(dz) {
|
|
1337
1391
|
return dzToConfig$1.get(dz).dropTargetClasses;
|
|
@@ -1375,7 +1429,22 @@ function animateDraggedToFinalPosition(shadowElIdx, callback) {
|
|
|
1375
1429
|
var transition = "transform ".concat(dropAnimationDurationMs, "ms ease");
|
|
1376
1430
|
draggedEl.style.transition = draggedEl.style.transition ? draggedEl.style.transition + "," + transition : transition;
|
|
1377
1431
|
draggedEl.style.transform = "translate3d(".concat(newTransform.x, "px, ").concat(newTransform.y, "px, 0)");
|
|
1378
|
-
|
|
1432
|
+
dropFinalization = {
|
|
1433
|
+
timeout: setTimeoutIn(dragWindow, finishDropAnimation, dropAnimationDurationMs),
|
|
1434
|
+
finalize: callback
|
|
1435
|
+
};
|
|
1436
|
+
}
|
|
1437
|
+
function finishDropAnimation() {
|
|
1438
|
+
var finalize = dropFinalization.finalize;
|
|
1439
|
+
dropFinalization = void 0;
|
|
1440
|
+
finalize();
|
|
1441
|
+
}
|
|
1442
|
+
function handleDragWindowHidden() {
|
|
1443
|
+
if (!finalizingPreviousDrag) handleDrop$1();
|
|
1444
|
+
if (dropFinalization) {
|
|
1445
|
+
clearTimeoutIn(dropFinalization.timeout);
|
|
1446
|
+
finishDropAnimation();
|
|
1447
|
+
}
|
|
1379
1448
|
}
|
|
1380
1449
|
function scheduleDZForRemovalAfterDrop(dz, destroy) {
|
|
1381
1450
|
var scheduledRemoval = {
|
|
@@ -1383,10 +1452,10 @@ function scheduleDZForRemovalAfterDrop(dz, destroy) {
|
|
|
1383
1452
|
destroy
|
|
1384
1453
|
};
|
|
1385
1454
|
scheduledForRemovalAfterDrop.push(scheduledRemoval);
|
|
1386
|
-
|
|
1455
|
+
getWindowOf(dz).requestAnimationFrame(function() {
|
|
1387
1456
|
if (!scheduledForRemovalAfterDrop.includes(scheduledRemoval)) return;
|
|
1388
1457
|
hideElement(dz);
|
|
1389
|
-
|
|
1458
|
+
dz.ownerDocument.body.appendChild(dz);
|
|
1390
1459
|
});
|
|
1391
1460
|
}
|
|
1392
1461
|
function cleanupPostDrop() {
|
|
@@ -1406,15 +1475,17 @@ function cleanupPostDrop() {
|
|
|
1406
1475
|
finalizingPreviousDrag = false;
|
|
1407
1476
|
unlockOriginDzMinDimensions = void 0;
|
|
1408
1477
|
isDraggedOutsideOfAnyDz = false;
|
|
1409
|
-
|
|
1478
|
+
dragWindow.removeEventListener("pagehide", handleDragWindowHidden);
|
|
1479
|
+
dragWindow = void 0;
|
|
1480
|
+
clearTimeoutIn(touchDragHoldTimer);
|
|
1410
1481
|
touchDragHoldTimer = void 0;
|
|
1411
1482
|
touchHoldElapsed = false;
|
|
1412
1483
|
useCursorForDetectionActive = false;
|
|
1413
1484
|
pendingDragOwner = void 0;
|
|
1414
1485
|
if (scheduledForRemovalAfterDrop.length) {
|
|
1415
1486
|
scheduledForRemovalAfterDrop.forEach(function(_ref) {
|
|
1416
|
-
var dz = _ref.dz
|
|
1417
|
-
destroy();
|
|
1487
|
+
var dz = _ref.dz;
|
|
1488
|
+
(0, _ref.destroy)();
|
|
1418
1489
|
dz.remove();
|
|
1419
1490
|
});
|
|
1420
1491
|
scheduledForRemovalAfterDrop = [];
|
|
@@ -1440,21 +1511,23 @@ function dndzone$2(node, options) {
|
|
|
1440
1511
|
};
|
|
1441
1512
|
var elToIdx = /* @__PURE__ */ new Map();
|
|
1442
1513
|
function addMaybeListeners() {
|
|
1443
|
-
|
|
1444
|
-
|
|
1514
|
+
dragWindow.addEventListener("mousemove", handleMouseMoveMaybeDragStart, { passive: false });
|
|
1515
|
+
dragWindow.addEventListener("touchmove", handleMouseMoveMaybeDragStart, {
|
|
1445
1516
|
passive: false,
|
|
1446
1517
|
capture: false
|
|
1447
1518
|
});
|
|
1448
|
-
|
|
1449
|
-
|
|
1519
|
+
dragWindow.addEventListener("mouseup", handleFalseAlarm, { passive: false });
|
|
1520
|
+
dragWindow.addEventListener("touchend", handleFalseAlarm, { passive: false });
|
|
1521
|
+
dragWindow.addEventListener("pagehide", cancelPendingDrag);
|
|
1450
1522
|
}
|
|
1451
1523
|
function removeMaybeListeners() {
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1524
|
+
dragWindow.removeEventListener("mousemove", handleMouseMoveMaybeDragStart);
|
|
1525
|
+
dragWindow.removeEventListener("touchmove", handleMouseMoveMaybeDragStart);
|
|
1526
|
+
dragWindow.removeEventListener("mouseup", handleFalseAlarm);
|
|
1527
|
+
dragWindow.removeEventListener("touchend", handleFalseAlarm);
|
|
1528
|
+
dragWindow.removeEventListener("pagehide", cancelPendingDrag);
|
|
1456
1529
|
if (touchDragHoldTimer) {
|
|
1457
|
-
|
|
1530
|
+
clearTimeoutIn(touchDragHoldTimer);
|
|
1458
1531
|
touchDragHoldTimer = void 0;
|
|
1459
1532
|
touchHoldElapsed = false;
|
|
1460
1533
|
}
|
|
@@ -1462,6 +1535,7 @@ function dndzone$2(node, options) {
|
|
|
1462
1535
|
function cancelPendingDrag() {
|
|
1463
1536
|
if (pendingDragOwner !== node) return;
|
|
1464
1537
|
removeMaybeListeners();
|
|
1538
|
+
dragWindow = void 0;
|
|
1465
1539
|
pendingDragOwner = void 0;
|
|
1466
1540
|
originalDragTarget = void 0;
|
|
1467
1541
|
dragStartMousePosition = void 0;
|
|
@@ -1471,7 +1545,7 @@ function dndzone$2(node, options) {
|
|
|
1471
1545
|
if (pendingDragOwner !== node) return;
|
|
1472
1546
|
cancelPendingDrag();
|
|
1473
1547
|
if (e.type === "touchend") {
|
|
1474
|
-
var clickEvent = new Event("click", {
|
|
1548
|
+
var clickEvent = new (getWindowOf(e.target)).Event("click", {
|
|
1475
1549
|
bubbles: true,
|
|
1476
1550
|
cancelable: true
|
|
1477
1551
|
});
|
|
@@ -1488,10 +1562,8 @@ function dndzone$2(node, options) {
|
|
|
1488
1562
|
y: c.clientY
|
|
1489
1563
|
};
|
|
1490
1564
|
if (Math.abs(currentMousePosition.x - dragStartMousePosition.x) >= MIN_MOVEMENT_BEFORE_DRAG_START_PX || Math.abs(currentMousePosition.y - dragStartMousePosition.y) >= MIN_MOVEMENT_BEFORE_DRAG_START_PX) {
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
touchDragHoldTimer = void 0;
|
|
1494
|
-
}
|
|
1565
|
+
clearTimeoutIn(touchDragHoldTimer);
|
|
1566
|
+
touchDragHoldTimer = void 0;
|
|
1495
1567
|
handleFalseAlarm(e);
|
|
1496
1568
|
}
|
|
1497
1569
|
return;
|
|
@@ -1519,10 +1591,11 @@ function dndzone$2(node, options) {
|
|
|
1519
1591
|
};
|
|
1520
1592
|
currentMousePosition = _objectSpread2({}, dragStartMousePosition);
|
|
1521
1593
|
originalDragTarget = e.currentTarget;
|
|
1594
|
+
dragWindow = getWindowOf(originalDragTarget);
|
|
1522
1595
|
if (useDelay) {
|
|
1523
1596
|
var pendingTarget = originalDragTarget;
|
|
1524
1597
|
touchHoldElapsed = false;
|
|
1525
|
-
touchDragHoldTimer =
|
|
1598
|
+
touchDragHoldTimer = setTimeoutIn(dragWindow, function() {
|
|
1526
1599
|
if (destroyed || pendingDragOwner !== node || originalDragTarget !== pendingTarget) return;
|
|
1527
1600
|
touchHoldElapsed = true;
|
|
1528
1601
|
handleDragStart();
|
|
@@ -1559,13 +1632,14 @@ function dndzone$2(node, options) {
|
|
|
1559
1632
|
originalDragTarget.setAttribute(ORIGINAL_DRAGGED_ITEM_MARKER_ATTRIBUTE, true);
|
|
1560
1633
|
originDropZoneRoot.appendChild(originalDragTarget);
|
|
1561
1634
|
watchDraggedElement();
|
|
1635
|
+
if (!draggedEl) return;
|
|
1562
1636
|
hideElement(originalDragTarget);
|
|
1563
1637
|
shadowElData[ITEM_ID_KEY] = draggedElData[ITEM_ID_KEY];
|
|
1564
1638
|
draggedEl.focus();
|
|
1565
|
-
} else
|
|
1639
|
+
} else dragWindow.requestAnimationFrame(keepOriginalElementInDom);
|
|
1566
1640
|
}
|
|
1567
|
-
|
|
1568
|
-
styleActiveDropZones(
|
|
1641
|
+
dragWindow.requestAnimationFrame(keepOriginalElementInDom);
|
|
1642
|
+
styleActiveDropZones(getDropZonesInDragWindow(config.type).filter(function(dz) {
|
|
1569
1643
|
return dz === originDropZone || !dzToConfig$1.get(dz).dropFromOthersDisabled;
|
|
1570
1644
|
}), function(dz) {
|
|
1571
1645
|
return dzToConfig$1.get(dz).dropTargetStyle;
|
|
@@ -1574,21 +1648,25 @@ function dndzone$2(node, options) {
|
|
|
1574
1648
|
});
|
|
1575
1649
|
items.splice(currentIdx, 1, shadowElData);
|
|
1576
1650
|
unlockOriginDzMinDimensions = preventShrinking(originDropZone);
|
|
1651
|
+
dragWindow.addEventListener("mousemove", handleMouseMove, { passive: false });
|
|
1652
|
+
dragWindow.addEventListener("touchmove", handleMouseMove, {
|
|
1653
|
+
passive: false,
|
|
1654
|
+
capture: false
|
|
1655
|
+
});
|
|
1656
|
+
dragWindow.addEventListener("mouseup", handleDrop$1, { passive: false });
|
|
1657
|
+
dragWindow.addEventListener("touchend", handleDrop$1, { passive: false });
|
|
1658
|
+
dragWindow.addEventListener("pagehide", handleDragWindowHidden);
|
|
1577
1659
|
dispatchConsiderEvent(originDropZone, items, {
|
|
1578
1660
|
trigger: TRIGGERS.DRAG_STARTED,
|
|
1579
1661
|
id: draggedElData[ITEM_ID_KEY],
|
|
1580
1662
|
source: SOURCES.POINTER
|
|
1581
1663
|
});
|
|
1582
|
-
window.addEventListener("mousemove", handleMouseMove, { passive: false });
|
|
1583
|
-
window.addEventListener("touchmove", handleMouseMove, {
|
|
1584
|
-
passive: false,
|
|
1585
|
-
capture: false
|
|
1586
|
-
});
|
|
1587
|
-
window.addEventListener("mouseup", handleDrop$1, { passive: false });
|
|
1588
|
-
window.addEventListener("touchend", handleDrop$1, { passive: false });
|
|
1589
1664
|
}
|
|
1590
1665
|
function configure(_ref2) {
|
|
1591
1666
|
var _ref2$items = _ref2.items, items = _ref2$items === void 0 ? void 0 : _ref2$items, _ref2$flipDurationMs = _ref2.flipDurationMs, dropAnimationDurationMs = _ref2$flipDurationMs === void 0 ? 0 : _ref2$flipDurationMs, _ref2$type = _ref2.type, newType = _ref2$type === void 0 ? DEFAULT_DROP_ZONE_TYPE$1 : _ref2$type, _ref2$dragDisabled = _ref2.dragDisabled, dragDisabled = _ref2$dragDisabled === void 0 ? false : _ref2$dragDisabled, _ref2$morphDisabled = _ref2.morphDisabled, morphDisabled = _ref2$morphDisabled === void 0 ? false : _ref2$morphDisabled, _ref2$dropFromOthersD = _ref2.dropFromOthersDisabled, dropFromOthersDisabled = _ref2$dropFromOthersD === void 0 ? false : _ref2$dropFromOthersD, _ref2$dropTargetStyle = _ref2.dropTargetStyle, dropTargetStyle = _ref2$dropTargetStyle === void 0 ? DEFAULT_DROP_TARGET_STYLE$1 : _ref2$dropTargetStyle, _ref2$dropTargetClass = _ref2.dropTargetClasses, dropTargetClasses = _ref2$dropTargetClass === void 0 ? [] : _ref2$dropTargetClass, _ref2$transformDragge = _ref2.transformDraggedElement, transformDraggedElement = _ref2$transformDragge === void 0 ? function() {} : _ref2$transformDragge, _ref2$centreDraggedOn = _ref2.centreDraggedOnCursor, centreDraggedOnCursor = _ref2$centreDraggedOn === void 0 ? false : _ref2$centreDraggedOn, _ref2$useCursorForDet = _ref2.useCursorForDetection, useCursorForDetection = _ref2$useCursorForDet === void 0 ? false : _ref2$useCursorForDet, _ref2$dropAnimationDi = _ref2.dropAnimationDisabled, dropAnimationDisabled = _ref2$dropAnimationDi === void 0 ? false : _ref2$dropAnimationDi, _ref2$delayTouchStart = _ref2.delayTouchStart, delayTouchStartOpt = _ref2$delayTouchStart === void 0 ? false : _ref2$delayTouchStart;
|
|
1667
|
+
var isInDragWindow = isWorkingOnPreviousDrag && node.ownerDocument.defaultView === dragWindow;
|
|
1668
|
+
var wasDropTarget = node === originDropZone || config.type === draggedElType && !config.dropFromOthersDisabled;
|
|
1669
|
+
var isDropTarget = node === originDropZone || newType === draggedElType && !dropFromOthersDisabled;
|
|
1592
1670
|
config.dropAnimationDurationMs = dropAnimationDurationMs;
|
|
1593
1671
|
var effectiveDelayMs = 0;
|
|
1594
1672
|
if (delayTouchStartOpt === true) effectiveDelayMs = DEFAULT_TOUCH_DELAY_MS;
|
|
@@ -1603,13 +1681,13 @@ function dndzone$2(node, options) {
|
|
|
1603
1681
|
config.centreDraggedOnCursor = centreDraggedOnCursor;
|
|
1604
1682
|
config.useCursorForDetection = useCursorForDetection;
|
|
1605
1683
|
config.dropAnimationDisabled = dropAnimationDisabled;
|
|
1606
|
-
if (initialized &&
|
|
1607
|
-
styleInactiveDropZones([node], function() {
|
|
1684
|
+
if (initialized && isInDragWindow && !finalizingPreviousDrag && (wasDropTarget !== isDropTarget || !areObjectsShallowEqual(dropTargetStyle, config.dropTargetStyle) || !areArraysShallowEqualSameOrder(dropTargetClasses, config.dropTargetClasses))) {
|
|
1685
|
+
if (wasDropTarget) styleInactiveDropZones([node], function() {
|
|
1608
1686
|
return config.dropTargetStyle;
|
|
1609
1687
|
}, function() {
|
|
1610
|
-
return dropTargetClasses;
|
|
1688
|
+
return config.dropTargetClasses;
|
|
1611
1689
|
});
|
|
1612
|
-
styleActiveDropZones([node], function() {
|
|
1690
|
+
if (isDropTarget) styleActiveDropZones([node], function() {
|
|
1613
1691
|
return dropTargetStyle;
|
|
1614
1692
|
}, function() {
|
|
1615
1693
|
return dropTargetClasses;
|
|
@@ -1617,21 +1695,6 @@ function dndzone$2(node, options) {
|
|
|
1617
1695
|
}
|
|
1618
1696
|
config.dropTargetStyle = dropTargetStyle;
|
|
1619
1697
|
config.dropTargetClasses = _toConsumableArray(dropTargetClasses);
|
|
1620
|
-
function getConfigProp(dz, propName) {
|
|
1621
|
-
return dzToConfig$1.get(dz) ? dzToConfig$1.get(dz)[propName] : config[propName];
|
|
1622
|
-
}
|
|
1623
|
-
if (initialized && isWorkingOnPreviousDrag && config.dropFromOthersDisabled !== dropFromOthersDisabled) {
|
|
1624
|
-
if (dropFromOthersDisabled) styleInactiveDropZones([node], function(dz) {
|
|
1625
|
-
return getConfigProp(dz, "dropTargetStyle");
|
|
1626
|
-
}, function(dz) {
|
|
1627
|
-
return getConfigProp(dz, "dropTargetClasses");
|
|
1628
|
-
});
|
|
1629
|
-
else styleActiveDropZones([node], function(dz) {
|
|
1630
|
-
return getConfigProp(dz, "dropTargetStyle");
|
|
1631
|
-
}, function(dz) {
|
|
1632
|
-
return getConfigProp(dz, "dropTargetClasses");
|
|
1633
|
-
});
|
|
1634
|
-
}
|
|
1635
1698
|
config.dropFromOthersDisabled = dropFromOthersDisabled;
|
|
1636
1699
|
dzToConfig$1.set(node, config);
|
|
1637
1700
|
registerDropZone$1(node, newType);
|
|
@@ -1653,8 +1716,8 @@ function dndzone$2(node, options) {
|
|
|
1653
1716
|
elToMouseDownListener.set(draggableEl, handleMouseDown);
|
|
1654
1717
|
}
|
|
1655
1718
|
elToIdx.set(draggableEl, idx);
|
|
1656
|
-
if (!initialized) initialized = true;
|
|
1657
1719
|
}
|
|
1720
|
+
initialized = true;
|
|
1658
1721
|
}
|
|
1659
1722
|
configure(options);
|
|
1660
1723
|
return {
|
|
@@ -1724,10 +1787,10 @@ var DEFAULT_ARIA_STRINGS = {
|
|
|
1724
1787
|
var ariaStrings = _objectSpread2({}, DEFAULT_ARIA_STRINGS);
|
|
1725
1788
|
var instructionCtx = { keyboardDragTrigger: DEFAULT_KEYBOARD_DRAG_TRIGGER };
|
|
1726
1789
|
var ALERT_DIV_ID = "dnd-action-aria-alert";
|
|
1727
|
-
var
|
|
1728
|
-
function initAriaOnBrowser() {
|
|
1729
|
-
if (
|
|
1730
|
-
alertsDiv =
|
|
1790
|
+
var docToAlertsDiv = /* @__PURE__ */ new Map();
|
|
1791
|
+
function initAriaOnBrowser(doc) {
|
|
1792
|
+
if (docToAlertsDiv.has(doc)) return;
|
|
1793
|
+
var alertsDiv = doc.createElement("div");
|
|
1731
1794
|
(function initAlertsDiv() {
|
|
1732
1795
|
alertsDiv.id = ALERT_DIV_ID;
|
|
1733
1796
|
alertsDiv.style.position = "fixed";
|
|
@@ -1739,36 +1802,48 @@ function initAriaOnBrowser() {
|
|
|
1739
1802
|
alertsDiv.style.width = "0";
|
|
1740
1803
|
alertsDiv.setAttribute("role", "alert");
|
|
1741
1804
|
})();
|
|
1742
|
-
|
|
1805
|
+
doc.body.prepend(alertsDiv);
|
|
1806
|
+
docToAlertsDiv.forEach(function(_, knownDoc) {
|
|
1807
|
+
return !knownDoc.defaultView && docToAlertsDiv["delete"](knownDoc);
|
|
1808
|
+
});
|
|
1809
|
+
docToAlertsDiv.set(doc, alertsDiv);
|
|
1743
1810
|
Object.entries(INSTRUCTION_ID_TO_STRING_KEY).forEach(function(_ref7) {
|
|
1744
1811
|
var _ref8 = _slicedToArray(_ref7, 2), id = _ref8[0], key = _ref8[1];
|
|
1745
|
-
return
|
|
1812
|
+
return doc.body.prepend(instructionToHiddenDiv(doc, id, formatWithFallback(key, instructionCtx)));
|
|
1746
1813
|
});
|
|
1747
1814
|
}
|
|
1748
1815
|
/**
|
|
1749
1816
|
* Initializes the static aria instructions so they can be attached to zones
|
|
1817
|
+
* @param {Document} [doc] - the document of the zones, defaults to the one that loaded this module
|
|
1750
1818
|
* @return {{DND_ZONE_ACTIVE: string, DND_ZONE_DRAG_DISABLED: string} | null} - the IDs for static aria instruction (to be used via aria-describedby) or null on the server
|
|
1751
1819
|
*/
|
|
1752
|
-
function initAria() {
|
|
1820
|
+
function initAria(doc) {
|
|
1753
1821
|
if (isOnServer) return null;
|
|
1754
|
-
|
|
1755
|
-
|
|
1822
|
+
doc = doc || document;
|
|
1823
|
+
if (doc.readyState !== "loading") initAriaOnBrowser(doc);
|
|
1824
|
+
else doc.addEventListener("DOMContentLoaded", function() {
|
|
1825
|
+
return initAriaOnBrowser(doc);
|
|
1826
|
+
}, { once: true });
|
|
1756
1827
|
return _objectSpread2({}, INSTRUCTION_IDs$1);
|
|
1757
1828
|
}
|
|
1758
1829
|
/**
|
|
1759
|
-
* Removes all the artifacts (dom elements) added by this module
|
|
1830
|
+
* Removes all the artifacts (dom elements) added by this module to the given document
|
|
1831
|
+
* @param {Document} [doc] - defaults to the document that loaded this module
|
|
1760
1832
|
*/
|
|
1761
|
-
function destroyAria() {
|
|
1762
|
-
if (isOnServer
|
|
1833
|
+
function destroyAria(doc) {
|
|
1834
|
+
if (isOnServer) return;
|
|
1835
|
+
doc = doc || document;
|
|
1836
|
+
var alertsDiv = docToAlertsDiv.get(doc);
|
|
1837
|
+
if (!alertsDiv) return;
|
|
1763
1838
|
Object.keys(INSTRUCTION_ID_TO_STRING_KEY).forEach(function(id) {
|
|
1764
|
-
var
|
|
1765
|
-
return (
|
|
1839
|
+
var _doc$getElementById;
|
|
1840
|
+
return (_doc$getElementById = doc.getElementById(id)) === null || _doc$getElementById === void 0 ? void 0 : _doc$getElementById.remove();
|
|
1766
1841
|
});
|
|
1767
1842
|
alertsDiv.remove();
|
|
1768
|
-
|
|
1843
|
+
docToAlertsDiv["delete"](doc);
|
|
1769
1844
|
}
|
|
1770
|
-
function instructionToHiddenDiv(id, txt) {
|
|
1771
|
-
var div =
|
|
1845
|
+
function instructionToHiddenDiv(doc, id, txt) {
|
|
1846
|
+
var div = doc.createElement("div");
|
|
1772
1847
|
div.id = id;
|
|
1773
1848
|
renderInstruction(div, txt);
|
|
1774
1849
|
div.style.display = "none";
|
|
@@ -1778,19 +1853,23 @@ function instructionToHiddenDiv(id, txt) {
|
|
|
1778
1853
|
}
|
|
1779
1854
|
function renderInstruction(div, txt) {
|
|
1780
1855
|
div.replaceChildren();
|
|
1781
|
-
var paragraph =
|
|
1856
|
+
var paragraph = div.ownerDocument.createElement("p");
|
|
1782
1857
|
paragraph.textContent = txt;
|
|
1783
1858
|
div.appendChild(paragraph);
|
|
1784
1859
|
}
|
|
1785
1860
|
/**
|
|
1786
1861
|
* Will make the screen reader alert the provided text to the user
|
|
1787
1862
|
* @param {string} txt
|
|
1863
|
+
* @param {Document} [doc] - the document to announce in, for a zone in another window such as an iframe or a popup.
|
|
1864
|
+
* Defaults to the document that loaded this module.
|
|
1788
1865
|
*/
|
|
1789
|
-
function alertToScreenReader(txt) {
|
|
1866
|
+
function alertToScreenReader(txt, doc) {
|
|
1790
1867
|
if (isOnServer) return;
|
|
1791
|
-
|
|
1868
|
+
doc = doc || document;
|
|
1869
|
+
if (!docToAlertsDiv.has(doc)) initAriaOnBrowser(doc);
|
|
1870
|
+
var alertsDiv = docToAlertsDiv.get(doc);
|
|
1792
1871
|
alertsDiv.innerHTML = "";
|
|
1793
|
-
var alertText =
|
|
1872
|
+
var alertText = doc.createTextNode(txt);
|
|
1794
1873
|
alertsDiv.appendChild(alertText);
|
|
1795
1874
|
alertsDiv.style.display = "none";
|
|
1796
1875
|
alertsDiv.style.display = "inline";
|
|
@@ -1816,9 +1895,10 @@ function formatWithFallback(key, ctx) {
|
|
|
1816
1895
|
* escape because this function runs during the drag lifecycle.
|
|
1817
1896
|
* @param {string} key - one of the keys accepted by setAriaStrings
|
|
1818
1897
|
* @param {Object} [ctx] - the interpolation context for that key
|
|
1898
|
+
* @param {Document} [doc] - the document of the zone the message is about, defaults to the one that loaded this module
|
|
1819
1899
|
*/
|
|
1820
|
-
function announceToScreenReader(key, ctx) {
|
|
1821
|
-
alertToScreenReader(formatWithFallback(key, ctx));
|
|
1900
|
+
function announceToScreenReader(key, ctx, doc) {
|
|
1901
|
+
alertToScreenReader(formatWithFallback(key, ctx), doc);
|
|
1822
1902
|
}
|
|
1823
1903
|
var activeTrigger = DEFAULT_KEYBOARD_DRAG_TRIGGER;
|
|
1824
1904
|
/**
|
|
@@ -1837,24 +1917,82 @@ var focusedDzLabel = "";
|
|
|
1837
1917
|
var focusedItem;
|
|
1838
1918
|
var focusedItemId;
|
|
1839
1919
|
var focusedItemLabel = "";
|
|
1920
|
+
var dragDocument;
|
|
1840
1921
|
var allDragTargets = /* @__PURE__ */ new WeakSet();
|
|
1841
1922
|
var elToKeyDownListeners = /* @__PURE__ */ new WeakMap();
|
|
1842
1923
|
var elToFocusListeners = /* @__PURE__ */ new WeakMap();
|
|
1843
1924
|
var dzToHandles = /* @__PURE__ */ new Map();
|
|
1844
1925
|
var dzToConfig = /* @__PURE__ */ new Map();
|
|
1845
1926
|
var typeToDropZones = /* @__PURE__ */ new Map();
|
|
1927
|
+
var dzToDocuments = /* @__PURE__ */ new Map();
|
|
1928
|
+
var documentToRegistration = /* @__PURE__ */ new Map();
|
|
1846
1929
|
var INSTRUCTION_IDs;
|
|
1847
|
-
function
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1930
|
+
function getDocumentsAround(doc) {
|
|
1931
|
+
var docs = [doc];
|
|
1932
|
+
for (var frame = (_doc$defaultView = doc.defaultView) === null || _doc$defaultView === void 0 ? void 0 : _doc$defaultView.frameElement; frame && docs[docs.length - 1] !== document; frame = getWindowOf(frame).frameElement) {
|
|
1933
|
+
var _doc$defaultView;
|
|
1934
|
+
docs.push(frame.ownerDocument);
|
|
1852
1935
|
}
|
|
1936
|
+
return docs;
|
|
1937
|
+
}
|
|
1938
|
+
function retainDocuments(dropZoneEl) {
|
|
1939
|
+
var docs = getDocumentsAround(dropZoneEl.ownerDocument);
|
|
1940
|
+
docs.forEach(function(doc, idx) {
|
|
1941
|
+
var registration = documentToRegistration.get(doc);
|
|
1942
|
+
if (!registration) {
|
|
1943
|
+
var handlers = {
|
|
1944
|
+
keydown: globalKeyDownHandler,
|
|
1945
|
+
click: globalClickHandler,
|
|
1946
|
+
pagehide: handleWindowHidden
|
|
1947
|
+
};
|
|
1948
|
+
registration = {
|
|
1949
|
+
win: doc.defaultView,
|
|
1950
|
+
zoneCount: 0,
|
|
1951
|
+
documentCount: 0,
|
|
1952
|
+
handlers: {}
|
|
1953
|
+
};
|
|
1954
|
+
Object.entries(handlers).forEach(function(_ref) {
|
|
1955
|
+
var _registration$win;
|
|
1956
|
+
var _ref2 = _slicedToArray(_ref, 2), type = _ref2[0], handler = _ref2[1];
|
|
1957
|
+
registration.handlers[type] = function(e) {
|
|
1958
|
+
return handler(e);
|
|
1959
|
+
};
|
|
1960
|
+
(_registration$win = registration.win) === null || _registration$win === void 0 || _registration$win.addEventListener(type, registration.handlers[type]);
|
|
1961
|
+
});
|
|
1962
|
+
documentToRegistration.set(doc, registration);
|
|
1963
|
+
}
|
|
1964
|
+
registration.documentCount++;
|
|
1965
|
+
if (idx === 0 && registration.zoneCount++ === 0) INSTRUCTION_IDs = initAria(doc);
|
|
1966
|
+
});
|
|
1967
|
+
dzToDocuments.set(dropZoneEl, docs);
|
|
1968
|
+
}
|
|
1969
|
+
function releaseDocuments(dropZoneEl) {
|
|
1970
|
+
var docs = dzToDocuments.get(dropZoneEl);
|
|
1971
|
+
if (!docs) return;
|
|
1972
|
+
dzToDocuments["delete"](dropZoneEl);
|
|
1973
|
+
docs.forEach(function(doc, idx) {
|
|
1974
|
+
var registration = documentToRegistration.get(doc);
|
|
1975
|
+
if (idx === 0 && --registration.zoneCount === 0) destroyAria(doc);
|
|
1976
|
+
if (--registration.documentCount > 0) return;
|
|
1977
|
+
documentToRegistration["delete"](doc);
|
|
1978
|
+
Object.entries(registration.handlers).forEach(function(_ref3) {
|
|
1979
|
+
var _registration$win2;
|
|
1980
|
+
var _ref4 = _slicedToArray(_ref3, 2), type = _ref4[0], handler = _ref4[1];
|
|
1981
|
+
return (_registration$win2 = registration.win) === null || _registration$win2 === void 0 ? void 0 : _registration$win2.removeEventListener(type, handler);
|
|
1982
|
+
});
|
|
1983
|
+
});
|
|
1984
|
+
}
|
|
1985
|
+
function registerDropZone(dropZoneEl, type) {
|
|
1986
|
+
var _dzToDocuments$get;
|
|
1853
1987
|
if (!typeToDropZones.has(type)) typeToDropZones.set(type, /* @__PURE__ */ new Set());
|
|
1854
1988
|
if (!typeToDropZones.get(type).has(dropZoneEl)) {
|
|
1855
1989
|
typeToDropZones.get(type).add(dropZoneEl);
|
|
1856
1990
|
incrementActiveDropZoneCount();
|
|
1857
1991
|
}
|
|
1992
|
+
if (((_dzToDocuments$get = dzToDocuments.get(dropZoneEl)) === null || _dzToDocuments$get === void 0 ? void 0 : _dzToDocuments$get[0]) !== dropZoneEl.ownerDocument) {
|
|
1993
|
+
releaseDocuments(dropZoneEl);
|
|
1994
|
+
retainDocuments(dropZoneEl);
|
|
1995
|
+
}
|
|
1858
1996
|
}
|
|
1859
1997
|
function unregisterDropZone(dropZoneEl, type) {
|
|
1860
1998
|
if (isDragging && focusedDz === dropZoneEl) handleDrop();
|
|
@@ -1862,12 +2000,7 @@ function unregisterDropZone(dropZoneEl, type) {
|
|
|
1862
2000
|
if (!dropZones || !dropZones["delete"](dropZoneEl)) return;
|
|
1863
2001
|
decrementActiveDropZoneCount();
|
|
1864
2002
|
if (dropZones.size === 0) typeToDropZones["delete"](type);
|
|
1865
|
-
|
|
1866
|
-
window.removeEventListener("keydown", globalKeyDownHandler);
|
|
1867
|
-
window.removeEventListener("click", globalClickHandler);
|
|
1868
|
-
INSTRUCTION_IDs = void 0;
|
|
1869
|
-
destroyAria();
|
|
1870
|
-
}
|
|
2003
|
+
releaseDocuments(dropZoneEl);
|
|
1871
2004
|
}
|
|
1872
2005
|
function globalKeyDownHandler(e) {
|
|
1873
2006
|
if (!isDragging) return;
|
|
@@ -1875,16 +2008,32 @@ function globalKeyDownHandler(e) {
|
|
|
1875
2008
|
case "Escape": handleDrop();
|
|
1876
2009
|
}
|
|
1877
2010
|
}
|
|
1878
|
-
function globalClickHandler() {
|
|
2011
|
+
function globalClickHandler(e) {
|
|
1879
2012
|
if (!isDragging) return;
|
|
1880
|
-
if (!allDragTargets.has(document.activeElement)) handleDrop();
|
|
2013
|
+
if (!allDragTargets.has(e.currentTarget.document.activeElement)) handleDrop();
|
|
2014
|
+
}
|
|
2015
|
+
function handleWindowHidden(e) {
|
|
2016
|
+
if (isDragging && focusedDz && getWindowOf(focusedDz) === e.currentTarget) handleDrop();
|
|
2017
|
+
}
|
|
2018
|
+
function isInDragDocument(dropZoneEl) {
|
|
2019
|
+
var doc = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : dragDocument;
|
|
2020
|
+
return dropZoneEl.ownerDocument === doc;
|
|
2021
|
+
}
|
|
2022
|
+
function isAboveOrLeftOf(el, otherEl) {
|
|
2023
|
+
var position = el.getBoundingClientRect();
|
|
2024
|
+
var otherPosition = otherEl.getBoundingClientRect();
|
|
2025
|
+
return position.top < otherPosition.top || position.left < otherPosition.left;
|
|
1881
2026
|
}
|
|
1882
|
-
function
|
|
1883
|
-
|
|
2027
|
+
function isKeyboardDropTarget(dropZoneEl) {
|
|
2028
|
+
var config = dzToConfig.get(dropZoneEl);
|
|
2029
|
+
return config.type === draggedItemType && !config.dropFromOthersDisabled && !focusedItem.contains(dropZoneEl) && isInDragDocument(dropZoneEl);
|
|
2030
|
+
}
|
|
2031
|
+
function getActiveDragTabIndex(dropZoneEl) {
|
|
2032
|
+
return dropZoneEl !== focusedDz && isKeyboardDropTarget(dropZoneEl) ? 0 : -1;
|
|
1884
2033
|
}
|
|
1885
2034
|
function refreshActiveDragTabIndices() {
|
|
1886
|
-
dzToConfig.forEach(function(
|
|
1887
|
-
dropZoneEl.tabIndex = getActiveDragTabIndex(dropZoneEl
|
|
2035
|
+
dzToConfig.forEach(function(_, dropZoneEl) {
|
|
2036
|
+
dropZoneEl.tabIndex = getActiveDragTabIndex(dropZoneEl);
|
|
1888
2037
|
});
|
|
1889
2038
|
}
|
|
1890
2039
|
function grabIsAlive() {
|
|
@@ -1898,8 +2047,10 @@ function grabIsAlive() {
|
|
|
1898
2047
|
function handleZoneFocus(e) {
|
|
1899
2048
|
if (!isDragging) return;
|
|
1900
2049
|
var newlyFocusedDz = e.currentTarget;
|
|
1901
|
-
if (newlyFocusedDz === focusedDz) return;
|
|
2050
|
+
if (newlyFocusedDz === focusedDz || !isKeyboardDropTarget(newlyFocusedDz)) return;
|
|
1902
2051
|
if (!grabIsAlive()) return;
|
|
2052
|
+
var dzFrom = focusedDz;
|
|
2053
|
+
var movedItemId = focusedItemId;
|
|
1903
2054
|
focusedDzLabel = newlyFocusedDz.getAttribute("aria-label") || "";
|
|
1904
2055
|
var originItems = dzToConfig.get(focusedDz).items;
|
|
1905
2056
|
var originItem = originItems.find(function(item) {
|
|
@@ -1908,14 +2059,14 @@ function handleZoneFocus(e) {
|
|
|
1908
2059
|
var originIdx = originItems.indexOf(originItem);
|
|
1909
2060
|
var itemToMove = originItems.splice(originIdx, 1)[0];
|
|
1910
2061
|
var _dzToConfig$get2 = dzToConfig.get(newlyFocusedDz), targetItems = _dzToConfig$get2.items, autoAriaDisabled = _dzToConfig$get2.autoAriaDisabled;
|
|
1911
|
-
if (
|
|
2062
|
+
if (isAboveOrLeftOf(newlyFocusedDz, focusedDz)) {
|
|
1912
2063
|
targetItems.push(itemToMove);
|
|
1913
2064
|
if (!autoAriaDisabled) announceToScreenReader("movedToZoneEnd", {
|
|
1914
2065
|
itemLabel: focusedItemLabel,
|
|
1915
2066
|
zoneLabel: focusedDzLabel,
|
|
1916
2067
|
position: targetItems.length,
|
|
1917
2068
|
count: targetItems.length
|
|
1918
|
-
});
|
|
2069
|
+
}, newlyFocusedDz.ownerDocument);
|
|
1919
2070
|
} else {
|
|
1920
2071
|
targetItems.unshift(itemToMove);
|
|
1921
2072
|
if (!autoAriaDisabled) announceToScreenReader("movedToZoneStart", {
|
|
@@ -1923,11 +2074,9 @@ function handleZoneFocus(e) {
|
|
|
1923
2074
|
zoneLabel: focusedDzLabel,
|
|
1924
2075
|
position: 1,
|
|
1925
2076
|
count: targetItems.length
|
|
1926
|
-
});
|
|
2077
|
+
}, newlyFocusedDz.ownerDocument);
|
|
1927
2078
|
}
|
|
1928
|
-
|
|
1929
|
-
var movedItemId = focusedItemId;
|
|
1930
|
-
focusedDz = newlyFocusedDz;
|
|
2079
|
+
if (isDragging) focusedDz = newlyFocusedDz;
|
|
1931
2080
|
dispatchFinalizeEvent(dzFrom, originItems, {
|
|
1932
2081
|
trigger: TRIGGERS.DROPPED_INTO_ANOTHER,
|
|
1933
2082
|
id: movedItemId,
|
|
@@ -1940,9 +2089,8 @@ function handleZoneFocus(e) {
|
|
|
1940
2089
|
});
|
|
1941
2090
|
}
|
|
1942
2091
|
function triggerAllDzsUpdate() {
|
|
1943
|
-
dzToHandles.forEach(function(
|
|
1944
|
-
|
|
1945
|
-
return update(dzToConfig.get(dz));
|
|
2092
|
+
dzToHandles.forEach(function(_ref5, dz) {
|
|
2093
|
+
return (0, _ref5.update)(dzToConfig.get(dz));
|
|
1946
2094
|
});
|
|
1947
2095
|
}
|
|
1948
2096
|
function handleDrop() {
|
|
@@ -1953,33 +2101,40 @@ function handleDrop() {
|
|
|
1953
2101
|
var droppedItemId = focusedItemId;
|
|
1954
2102
|
var droppedItemType = draggedItemType;
|
|
1955
2103
|
if (!droppedConfig) return;
|
|
2104
|
+
var droppedItemLabel = focusedItemLabel;
|
|
2105
|
+
var droppedDzLabel = focusedDzLabel;
|
|
2106
|
+
var droppedDocument = dragDocument;
|
|
2107
|
+
focusedItem = null;
|
|
2108
|
+
focusedItemId = null;
|
|
2109
|
+
focusedItemLabel = "";
|
|
2110
|
+
draggedItemType = null;
|
|
2111
|
+
focusedDz = null;
|
|
2112
|
+
focusedDzLabel = "";
|
|
2113
|
+
dragDocument = void 0;
|
|
2114
|
+
isDragging = false;
|
|
1956
2115
|
if (!droppedConfig.autoAriaDisabled) {
|
|
1957
2116
|
var droppedItems = droppedConfig.items;
|
|
1958
2117
|
var droppedIdx = droppedItems.findIndex(function(item) {
|
|
1959
2118
|
return item[ITEM_ID_KEY] === droppedItemId;
|
|
1960
2119
|
});
|
|
1961
2120
|
announceToScreenReader("dropped", {
|
|
1962
|
-
itemLabel:
|
|
1963
|
-
zoneLabel:
|
|
2121
|
+
itemLabel: droppedItemLabel,
|
|
2122
|
+
zoneLabel: droppedDzLabel,
|
|
1964
2123
|
position: (droppedIdx < 0 ? 0 : droppedIdx) + 1,
|
|
1965
2124
|
count: droppedItems.length
|
|
1966
|
-
});
|
|
2125
|
+
}, droppedDz.ownerDocument);
|
|
1967
2126
|
}
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
focusedItemId = null;
|
|
1971
|
-
focusedItemLabel = "";
|
|
1972
|
-
draggedItemType = null;
|
|
1973
|
-
focusedDz = null;
|
|
1974
|
-
focusedDzLabel = "";
|
|
1975
|
-
isDragging = false;
|
|
2127
|
+
var activeElement = droppedDz.ownerDocument.activeElement;
|
|
2128
|
+
if (allDragTargets.has(activeElement)) activeElement.blur();
|
|
1976
2129
|
if (dispatchConsider) dispatchConsiderEvent(droppedDz, droppedConfig.items, {
|
|
1977
2130
|
trigger: TRIGGERS.DRAG_STOPPED,
|
|
1978
2131
|
id: droppedItemId,
|
|
1979
2132
|
source: SOURCES.KEYBOARD
|
|
1980
2133
|
});
|
|
1981
2134
|
var dropZones = typeToDropZones.get(droppedItemType);
|
|
1982
|
-
if (dropZones) styleInactiveDropZones(dropZones
|
|
2135
|
+
if (dropZones) styleInactiveDropZones(Array.from(dropZones).filter(function(dz) {
|
|
2136
|
+
return isInDragDocument(dz, droppedDocument);
|
|
2137
|
+
}), function(dz) {
|
|
1983
2138
|
return dzToConfig.get(dz).dropTargetStyle;
|
|
1984
2139
|
}, function(dz) {
|
|
1985
2140
|
return dzToConfig.get(dz).dropTargetClasses;
|
|
@@ -2003,6 +2158,9 @@ function dndzone$1(node, options) {
|
|
|
2003
2158
|
if (arr.length <= 1) return;
|
|
2004
2159
|
arr.splice(j, 1, arr.splice(i, 1, arr[j])[0]);
|
|
2005
2160
|
}
|
|
2161
|
+
function ownsArrowKey(e) {
|
|
2162
|
+
return isDragging && node === focusedDz && isInDragDocument(node) && e.currentTarget === focusedItem && e.target === focusedItem;
|
|
2163
|
+
}
|
|
2006
2164
|
function handleKeyDown(e) {
|
|
2007
2165
|
switch (e.key) {
|
|
2008
2166
|
case "Enter":
|
|
@@ -2016,7 +2174,7 @@ function dndzone$1(node, options) {
|
|
|
2016
2174
|
break;
|
|
2017
2175
|
case "ArrowDown":
|
|
2018
2176
|
case "ArrowRight":
|
|
2019
|
-
if (!
|
|
2177
|
+
if (!ownsArrowKey(e)) return;
|
|
2020
2178
|
e.preventDefault();
|
|
2021
2179
|
e.stopPropagation();
|
|
2022
2180
|
var items = dzToConfig.get(node).items;
|
|
@@ -2028,7 +2186,8 @@ function dndzone$1(node, options) {
|
|
|
2028
2186
|
zoneLabel: focusedDzLabel,
|
|
2029
2187
|
position: idx + 2,
|
|
2030
2188
|
count: items.length
|
|
2031
|
-
});
|
|
2189
|
+
}, node.ownerDocument);
|
|
2190
|
+
if (!ownsArrowKey(e)) break;
|
|
2032
2191
|
swap(items, idx, idx + 1);
|
|
2033
2192
|
dispatchFinalizeEvent(node, items, {
|
|
2034
2193
|
trigger: TRIGGERS.DROPPED_INTO_ZONE,
|
|
@@ -2039,7 +2198,7 @@ function dndzone$1(node, options) {
|
|
|
2039
2198
|
break;
|
|
2040
2199
|
case "ArrowUp":
|
|
2041
2200
|
case "ArrowLeft":
|
|
2042
|
-
if (!
|
|
2201
|
+
if (!ownsArrowKey(e)) return;
|
|
2043
2202
|
e.preventDefault();
|
|
2044
2203
|
e.stopPropagation();
|
|
2045
2204
|
var _items = dzToConfig.get(node).items;
|
|
@@ -2050,7 +2209,8 @@ function dndzone$1(node, options) {
|
|
|
2050
2209
|
zoneLabel: focusedDzLabel,
|
|
2051
2210
|
position: _idx,
|
|
2052
2211
|
count: _items.length
|
|
2053
|
-
});
|
|
2212
|
+
}, node.ownerDocument);
|
|
2213
|
+
if (!ownsArrowKey(e)) break;
|
|
2054
2214
|
swap(_items, _idx, _idx - 1);
|
|
2055
2215
|
dispatchFinalizeEvent(node, _items, {
|
|
2056
2216
|
trigger: TRIGGERS.DROPPED_INTO_ZONE,
|
|
@@ -2066,8 +2226,9 @@ function dndzone$1(node, options) {
|
|
|
2066
2226
|
focusedDzLabel = node.getAttribute("aria-label") || "";
|
|
2067
2227
|
draggedItemType = config.type;
|
|
2068
2228
|
isDragging = true;
|
|
2229
|
+
dragDocument = node.ownerDocument;
|
|
2069
2230
|
var dropTargets = Array.from(typeToDropZones.get(config.type)).filter(function(dz) {
|
|
2070
|
-
return dz === focusedDz ||
|
|
2231
|
+
return dz === focusedDz || isKeyboardDropTarget(dz);
|
|
2071
2232
|
});
|
|
2072
2233
|
styleActiveDropZones(dropTargets, function(dz) {
|
|
2073
2234
|
return dzToConfig.get(dz).dropTargetStyle;
|
|
@@ -2085,8 +2246,9 @@ function dndzone$1(node, options) {
|
|
|
2085
2246
|
position: (startIdx < 0 ? 0 : startIdx) + 1,
|
|
2086
2247
|
count: startItems.length,
|
|
2087
2248
|
canMoveBetweenZones: dropTargets.length > 1
|
|
2088
|
-
});
|
|
2249
|
+
}, node.ownerDocument);
|
|
2089
2250
|
}
|
|
2251
|
+
if (!isDragging) return;
|
|
2090
2252
|
dispatchConsiderEvent(node, dzToConfig.get(node).items, {
|
|
2091
2253
|
trigger: TRIGGERS.DRAG_STARTED,
|
|
2092
2254
|
id: focusedItemId,
|
|
@@ -2110,8 +2272,8 @@ function dndzone$1(node, options) {
|
|
|
2110
2272
|
focusedItemId = items[focusedItemIdx][ITEM_ID_KEY];
|
|
2111
2273
|
focusedItemLabel = children[focusedItemIdx].getAttribute("aria-label") || "";
|
|
2112
2274
|
}
|
|
2113
|
-
function configure(
|
|
2114
|
-
var
|
|
2275
|
+
function configure(_ref6) {
|
|
2276
|
+
var _ref6$items = _ref6.items, items = _ref6$items === void 0 ? [] : _ref6$items, _ref6$type = _ref6.type, newType = _ref6$type === void 0 ? DEFAULT_DROP_ZONE_TYPE : _ref6$type, _ref6$dragDisabled = _ref6.dragDisabled, dragDisabled = _ref6$dragDisabled === void 0 ? false : _ref6$dragDisabled, _ref6$zoneTabIndex = _ref6.zoneTabIndex, zoneTabIndex = _ref6$zoneTabIndex === void 0 ? 0 : _ref6$zoneTabIndex, _ref6$zoneItemTabInde = _ref6.zoneItemTabIndex, zoneItemTabIndex = _ref6$zoneItemTabInde === void 0 ? 0 : _ref6$zoneItemTabInde, _ref6$dropFromOthersD = _ref6.dropFromOthersDisabled, dropFromOthersDisabled = _ref6$dropFromOthersD === void 0 ? false : _ref6$dropFromOthersD, _ref6$dropTargetStyle = _ref6.dropTargetStyle, dropTargetStyle = _ref6$dropTargetStyle === void 0 ? DEFAULT_DROP_TARGET_STYLE : _ref6$dropTargetStyle, _ref6$dropTargetClass = _ref6.dropTargetClasses, dropTargetClasses = _ref6$dropTargetClass === void 0 ? [] : _ref6$dropTargetClass, _ref6$autoAriaDisable = _ref6.autoAriaDisabled, autoAriaDisabled = _ref6$autoAriaDisable === void 0 ? false : _ref6$autoAriaDisable;
|
|
2115
2277
|
config.items = _toConsumableArray(items);
|
|
2116
2278
|
config.dragDisabled = dragDisabled;
|
|
2117
2279
|
config.dropFromOthersDisabled = dropFromOthersDisabled;
|
|
@@ -2130,14 +2292,14 @@ function dndzone$1(node, options) {
|
|
|
2130
2292
|
dzToConfig.set(node, config);
|
|
2131
2293
|
var itemMovedToThisZone = false;
|
|
2132
2294
|
if (isDragging) {
|
|
2133
|
-
itemMovedToThisZone = config.type === draggedItemType && config.items.some(function(item) {
|
|
2295
|
+
itemMovedToThisZone = isInDragDocument(node) && config.type === draggedItemType && config.items.some(function(item) {
|
|
2134
2296
|
return item[ITEM_ID_KEY] === focusedItemId;
|
|
2135
2297
|
}) && node !== focusedDz;
|
|
2136
2298
|
if (itemMovedToThisZone) {
|
|
2137
2299
|
focusedDz = node;
|
|
2138
2300
|
focusedDzLabel = node.getAttribute("aria-label") || "";
|
|
2139
2301
|
}
|
|
2140
|
-
node.tabIndex = getActiveDragTabIndex(node
|
|
2302
|
+
node.tabIndex = getActiveDragTabIndex(node);
|
|
2141
2303
|
} else node.tabIndex = config.zoneTabIndex;
|
|
2142
2304
|
node.addEventListener("focus", handleZoneFocus);
|
|
2143
2305
|
var _loop = function _loop(i) {
|
|
@@ -2154,14 +2316,14 @@ function dndzone$1(node, options) {
|
|
|
2154
2316
|
draggableEl.addEventListener("click", handleClick);
|
|
2155
2317
|
elToFocusListeners.set(draggableEl, handleClick);
|
|
2156
2318
|
}
|
|
2157
|
-
if (isDragging && config.type === draggedItemType && ((_config$items$i = config.items[i]) === null || _config$items$i === void 0 ? void 0 : _config$items$i[ITEM_ID_KEY]) === focusedItemId) {
|
|
2319
|
+
if (isDragging && isInDragDocument(node) && config.type === draggedItemType && ((_config$items$i = config.items[i]) === null || _config$items$i === void 0 ? void 0 : _config$items$i[ITEM_ID_KEY]) === focusedItemId) {
|
|
2158
2320
|
focusedItem = draggableEl;
|
|
2159
2321
|
focusedItem.tabIndex = config.zoneItemTabIndex;
|
|
2160
2322
|
draggableEl.focus();
|
|
2161
2323
|
}
|
|
2162
2324
|
};
|
|
2163
2325
|
for (var i = 0; i < node.children.length; i++) _loop(i);
|
|
2164
|
-
if (itemMovedToThisZone) refreshActiveDragTabIndices();
|
|
2326
|
+
if (itemMovedToThisZone && isDragging) refreshActiveDragTabIndices();
|
|
2165
2327
|
}
|
|
2166
2328
|
configure(options);
|
|
2167
2329
|
var handles = {
|