@hiai-gg/docsmint 0.7.4 → 0.7.6
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 +2 -2
- package/dist/backend/index.js +130026 -129609
- package/dist/backend-account-runtime-cleanup.js +2 -0
- package/dist/backend-api-key-facade.js +2 -0
- package/dist/backend-pipeline-cancellation.js +2 -0
- package/dist/frontend/CategoryDialog-D_xFSWGh.js +630 -0
- package/dist/frontend/ConfirmDialog-Cfq3D2Di.js +221 -0
- package/dist/frontend/{CreateSnapshotDialog-CojnWChs.js → CreateSnapshotDialog-BHODxZWK.js} +53 -52
- package/dist/frontend/{DatePicker-7FAbIOGg.js → DatePicker-CZyCnQ1q.js} +62 -64
- package/dist/frontend/{DeleteDialog-BIlqRb1u.js → DeleteDialog-DaJOO6SB.js} +17 -17
- package/dist/frontend/FolderNode-C_91NlEO.js +307 -0
- package/dist/frontend/{FolderTreeSelector-BMB1MS9N.js → FolderTreeSelector-DqO-f0nt.js} +7 -7
- package/dist/frontend/HiAiEditor-DtUGbQg6.js +3160 -0
- package/dist/frontend/{HiaiDocsExtensionProvider-OSn96BBw.js → HiaiDocsExtensionProvider-Cc3yzW5I.js} +5 -3
- package/dist/frontend/{Icon-Db-o32_E.js → Icon-y7xxAIC6.js} +1 -1
- package/dist/frontend/{SettingsDialog-DatuxOVX.js → SettingsDialog-BlIZqk2-.js} +169 -158
- package/dist/frontend/ShareDialog-CmX-VoJ9.js +273 -0
- package/dist/frontend/Sidebar-BVGm5BRR.js +2147 -0
- package/dist/frontend/{TagCreateDialog-Ch21yuWV.js → TagCreateDialog-BlGz4O9Z.js} +45 -36
- package/dist/frontend/action_cancel-Cuxsznzz.js +5 -0
- package/dist/frontend/action_close-BJm_52wm.js +5 -0
- package/dist/frontend/action_create-CtBQrRuj.js +5 -0
- package/dist/frontend/action_delete-BXBIzvn0.js +5 -0
- package/dist/frontend/action_go_to-VmK5jmEk.js +5 -0
- package/dist/frontend/action_loading-BLCGJVA9.js +5 -0
- package/dist/frontend/action_save-BRN2Z_GP.js +5 -0
- package/dist/frontend/api/attachments.js +1 -1
- package/dist/frontend/api/categories.js +1 -1
- package/dist/frontend/api/folders.js +1 -1
- package/dist/frontend/api/settings.js +1 -1
- package/dist/frontend/api/share.js +1 -1
- package/dist/frontend/api/tags.js +1 -1
- package/dist/frontend/app-shell.js +8 -8
- package/dist/frontend/{attachments-B2aH3hXF.js → attachments-C225gTA7.js} +2 -2
- package/dist/frontend/{auth-client-CnDZwPfp.js → auth-client-DCMne8vd.js} +630 -615
- package/dist/frontend/{bundle-mjs-DllmqUxV.js → bundle-mjs-CZ3g1Uzr.js} +35 -42
- package/dist/frontend/{camera-CzCxBOpc.js → camera-BI-BtnIm.js} +2 -2
- package/dist/frontend/{categories-X7gK8azc.js → categories-Bjcc41We.js} +1 -1
- package/dist/frontend/categories_update_error-4aSI8PTr.js +5 -0
- package/dist/frontend/{check-BIi-Ghti.js → check-sdTlLwi9.js} +2 -2
- package/dist/frontend/{chevron-down-C2ft7XUV.js → chevron-down-DlBnIE7Y.js} +2 -2
- package/dist/frontend/{circle-check-BrqfiQH1.js → circle-check-hWC-HeKu.js} +2 -2
- package/dist/frontend/{clock-Dz86E4Kz.js → clock-C4FHq-9q.js} +2 -2
- package/dist/frontend/collaboration.js +208 -103
- 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 +1 -1
- 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 +140 -125
- package/dist/frontend/components/editor/extensions.js +1 -1
- package/dist/frontend/components/editor/markdown-toggle.js +9 -9
- 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 +34 -25
- 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 +181 -176
- package/dist/frontend/{confirm-dialog-8T6vsWL7.js → confirm-dialog-BFTxjLv-.js} +46 -37
- package/dist/frontend/{copy-CvCh4ZVt.js → copy-4H99lwAQ.js} +2 -2
- package/dist/frontend/dashboard.js +462 -456
- package/dist/frontend/{db-Bo1t_76T.js → db-CbFRFAm2.js} +40 -38
- package/dist/frontend/{dialog-CiSwD-_v.js → dialog-tHAH3-9M.js} +10 -10
- package/dist/frontend/dist-Cg1BpNS7.js +2262 -0
- package/dist/frontend/dndzone-BrakBHwm.js +1375 -0
- package/dist/frontend/doc_title_label-DS9jSIh2.js +5 -0
- package/dist/frontend/doc_title_placeholder-DBQpM1aH.js +5 -0
- package/dist/frontend/{document-drop-coordinator-C4xHMjwC.js → document-drop-coordinator-Da7HcXgv.js} +1 -1
- package/dist/frontend/document-drop-coordinator.js +1 -1
- package/dist/frontend/{dropdown-menu-Bi5Iipwf.js → dropdown-menu-AJYeFPHu.js} +145 -145
- package/dist/frontend/{editor-content-sanitizer-CC_A8aaI.js → editor-content-sanitizer-CWjqiz0T.js} +30 -30
- package/dist/frontend/{editorExtensions--HusV819.js → editorExtensions-B-mKiWqq.js} +5085 -6220
- package/dist/frontend/editor_markdown_placeholder-BIWDUF1E.js +5 -0
- package/dist/frontend/error_dismiss-Dx_JbRjs.js +5 -0
- package/dist/frontend/error_generic-CzNtmBT4.js +5 -0
- package/dist/frontend/extension.js +1 -1
- package/dist/frontend/{folder-Cx60MRpi.js → folder-BAX6qBYy.js} +3 -3
- package/dist/frontend/{folders-ONG03Dkv.js → folders-CC0UWkZH.js} +3 -3
- package/dist/frontend/folders_rename-BJo4Gipq.js +5 -0
- package/dist/frontend/i18n.js +1007 -6
- package/dist/frontend/{identity-Ynrglr5i.js → identity-O4lAuchv.js} +2 -2
- package/dist/frontend/{input-N9dNSOWF.js → input-CrlYAH2S.js} +2 -2
- package/dist/frontend/{label-CK72_fw8.js → label-B0syEfns.js} +2 -2
- package/dist/frontend/{markdown-H6QB53zu.js → markdown-CMij27Gg.js} +1 -1
- package/dist/frontend/offline/identity.js +1 -1
- package/dist/frontend/{floating-layer-anchor-BGIndLY-.js → popper-layer-force-mount-BAYjg6Pp.js} +2476 -2564
- package/dist/frontend/{rolldown-runtime-CWhphoD1.js → rolldown-runtime-DArdT4gl.js} +2 -2
- package/dist/frontend/{rotate-ccw-ta4NosZ0.js → rotate-ccw-DtZDfSK3.js} +2 -2
- package/dist/frontend/runtime-CwWSo6c9.js +128 -0
- package/dist/frontend/{schemas-DwtKylCJ.js → schemas-CdPhcuru.js} +6 -7
- package/dist/frontend/scroll_to_top_aria-CvkNF_Hu.js +5 -0
- package/dist/frontend/search.js +237 -265
- package/dist/frontend/search_title-DOC0cPlQ.js +5 -0
- package/dist/frontend/{select-value-BD1DToYs.js → select-value-D9VqY5n5.js} +575 -572
- package/dist/frontend/{settings-BR48ihB4.js → settings-DJW8JkdF.js} +1 -1
- package/dist/frontend/{share-D7JtkC85.js → share-D5yo0JOh.js} +2 -1
- package/dist/frontend/share_copied-DPxVzfWh.js +5 -0
- package/dist/frontend/share_toggle_password-DdxfIjj1.js +5 -0
- package/dist/frontend/shared-document.js +1 -1
- package/dist/frontend/sidebar_uncategorized-qJ2_Aonf.js +5 -0
- package/dist/frontend/sort_relevance-DwYX5MO9.js +5 -0
- package/dist/frontend/{tag-DhVFHMcV.js → tag-ChpMfbfa.js} +3 -3
- package/dist/frontend/{tags-BdCaMGfj.js → tags-CzPNUoFw.js} +1 -1
- package/dist/frontend/tags_load_error-BKjA1pI0.js +5 -0
- package/dist/frontend/tags_new-BiNAJ9Bx.js +5 -0
- package/dist/frontend/{textarea-pl_fDBre.js → textarea-l_gRXsrH.js} +2 -2
- package/dist/frontend/theme.js +1 -1
- package/dist/frontend/{theme.svelte-DG3RS7wv.js → theme.svelte-Bzitjfh9.js} +2 -2
- package/dist/frontend/theme_system-BBNUhYKh.js +5 -0
- package/dist/frontend/utils/dndzone.js +1 -1
- package/dist/frontend/utils-B4LKx7VS.js +7 -0
- package/dist/frontend/{utils-DrfHTcei.js → utils-BovMJHdA.js} +2 -2
- package/dist/frontend/utils.js +1 -1
- package/dist/frontend/version_create_snapshot-3bu-0qzH.js +5 -0
- package/dist/frontend/version_restored_from-dVRN3Zdk.js +5 -0
- package/dist/frontend/version_snapshot_label_placeholder-DrMikux0.js +5 -0
- package/dist/frontend/weekday_we-C5H_M-df.js +5 -0
- package/dist/frontend/{x-cfdlccjs.js → x-B2ifxSH7.js} +2 -2
- package/dist/frontend/{awareness-snQ3RD9f.js → yjs-VUcKqaKW.js} +835 -944
- package/dist/frontend-ssr/api/attachments.js +92 -1
- package/dist/frontend-ssr/api/categories.js +1 -1
- package/dist/frontend-ssr/api/documents.js +1 -1
- package/dist/frontend-ssr/api/folders.js +1 -1
- package/dist/frontend-ssr/api/settings.js +1 -1
- package/dist/frontend-ssr/api/share.js +30 -1
- package/dist/frontend-ssr/api/tags.js +1 -1
- package/dist/frontend-ssr/app-shell.js +25 -18
- package/dist/frontend-ssr/assets/{CategoryDialog-DsXe54EF.js → CategoryDialog-C41IBNWG.js} +26 -35
- package/dist/frontend-ssr/assets/ConfirmDialog-CWO0HBaS.js +424 -0
- package/dist/frontend-ssr/assets/{CreateSnapshotDialog-D3-PjXVr.js → CreateSnapshotDialog-CECCRK0d.js} +12 -18
- package/dist/frontend-ssr/assets/{DatePicker-C9suIA1S.js → DatePicker-TZVeMZ2S.js} +32 -20
- package/dist/frontend-ssr/assets/{DeleteDialog-DxtMrS1O.js → DeleteDialog-BVnmzR2e.js} +5 -7
- package/dist/frontend-ssr/assets/{FolderNode-ChD10Elp.js → FolderNode-CClgk8BL.js} +7 -7
- package/dist/frontend-ssr/assets/{FolderTreeSelector-Bxi8EqMm.js → FolderTreeSelector-DnrKCYtl.js} +17 -20
- package/dist/frontend-ssr/assets/{HiAiEditor-2X3Uyg1B.js → HiAiEditor-_-m7MJDd.js} +330 -254
- package/dist/frontend-ssr/assets/{Icon-QwirKi9Y.js → Icon-Clqe8D8X.js} +28 -16
- package/dist/frontend-ssr/assets/{SettingsDialog-DDy0hN8x.js → SettingsDialog-BdvHRAxF.js} +45 -49
- package/dist/frontend-ssr/assets/{ShareDialog-BwW_wF4G.js → ShareDialog-DHPbSHZg.js} +5 -6
- package/dist/frontend-ssr/assets/{Sidebar-Dy-5gXOf.js → Sidebar-B3Saqn0O.js} +90 -93
- package/dist/frontend-ssr/assets/{TagCreateDialog-BPzgOaX8.js → TagCreateDialog-CPg-nG0D.js} +14 -14
- package/dist/frontend-ssr/assets/action_cancel-OVgQDP5Q.js +22 -0
- package/dist/frontend-ssr/assets/action_close-DagDyMXk.js +22 -0
- package/dist/frontend-ssr/assets/action_create-hqJWjyqh.js +22 -0
- package/dist/frontend-ssr/assets/action_delete-B1-16jSo.js +22 -0
- package/dist/frontend-ssr/assets/action_go_to-DQScgw7P.js +22 -0
- package/dist/frontend-ssr/assets/action_save-Bx7vlLZI.js +22 -0
- package/dist/frontend-ssr/assets/{api-keys-DIbclwj5.js → api-keys-CHOrbU-Q.js} +1 -1
- package/dist/frontend-ssr/assets/{auth-client-CojKIzqy.js → auth-client-DzkZlSQ8.js} +295 -261
- package/dist/frontend-ssr/assets/{camera-D6s20LDi.js → camera-Dwwtgvfn.js} +10 -6
- package/dist/frontend-ssr/assets/{categories-av9xjeg5.js → categories-C_dxFoHi.js} +1 -1
- package/dist/frontend-ssr/assets/categories_update_error-DkKgsqdD.js +202 -0
- package/dist/frontend-ssr/assets/{chevron-down-CvqKATjM.js → chevron-down-C6BTPJFz.js} +10 -6
- package/dist/frontend-ssr/assets/{chevron-right-DKD7WXjz.js → chevron-right-CseGE1qd.js} +10 -6
- package/dist/frontend-ssr/assets/{circle-check-CPS9dKEo.js → circle-check-BRhWPZo1.js} +10 -6
- package/dist/frontend-ssr/assets/{client-DZMkDkDn.js → client-rfwQYYHY.js} +4 -2
- package/dist/frontend-ssr/assets/{clock-CzsE58TH.js → clock-DpP_Y7WP.js} +10 -6
- package/dist/frontend-ssr/assets/{confirm-dialog-wYC07DPx.js → confirm-dialog-DeOR0SnQ.js} +44 -31
- package/dist/frontend-ssr/assets/{copy-DkkCPkBL.js → copy-DRMKiRZ0.js} +10 -6
- package/dist/frontend-ssr/assets/{db-BhwJPEkn.js → db-CUkQe9AU.js} +1 -1
- package/dist/frontend-ssr/assets/{dialog-ClcuF7nD.js → dialog--tDgDGw9.js} +12 -15
- package/dist/frontend-ssr/assets/{dndzone-DMvTO_Jz.js → dndzone-WtNaDxoQ.js} +309 -77
- package/dist/frontend-ssr/assets/doc_title_label-Ev_ltlh3.js +22 -0
- package/dist/frontend-ssr/assets/doc_title_placeholder-DSHpUb7w.js +22 -0
- package/dist/frontend-ssr/assets/{documents-CZ-wQohy.js → documents-CEuA1V6N.js} +1 -1
- package/dist/frontend-ssr/assets/{dropdown-menu-BKMGVNLL.js → dropdown-menu-CdEpn_LT.js} +74 -75
- package/dist/frontend-ssr/assets/editor_markdown_placeholder-BpezdkOr.js +42 -0
- package/dist/frontend-ssr/assets/editor_toolbar_undo-CKJAOqv2.js +562 -0
- package/dist/frontend-ssr/assets/error_generic-DTK0kwxT.js +42 -0
- package/dist/frontend-ssr/assets/{folder-DYIE-XPP.js → folder-DszunwKc.js} +10 -6
- package/dist/frontend-ssr/assets/{folders-BX30gHv6.js → folders-BOXeb9hz.js} +3 -2
- package/dist/frontend-ssr/assets/folders_rename-DvciOb6K.js +122 -0
- package/dist/frontend-ssr/assets/{identity-DcMMBKWg.js → identity-veXobEfE.js} +2 -2
- package/dist/frontend-ssr/assets/{input-DcDR8L8M.js → input-BlAj7LzC.js} +2 -2
- package/dist/frontend-ssr/assets/{label-Cz0_svJx.js → label-BRToaMg9.js} +2 -2
- package/dist/frontend-ssr/assets/{loader-circle-CIEWGyfP.js → loader-circle-BpRVrMZg.js} +10 -6
- package/dist/frontend-ssr/assets/{floating-layer-anchor-BoiiIEiK.js → popper-layer-force-mount-Djnq7l7a.js} +3684 -3674
- package/dist/frontend-ssr/assets/{rotate-ccw-dJSqPyTd.js → rotate-ccw-1GOD_yt_.js} +10 -6
- package/dist/frontend-ssr/assets/runtime-O78RzRqx.js +559 -0
- package/dist/frontend-ssr/assets/scroll_to_top_aria-BN4ZfOnM.js +22 -0
- package/dist/frontend-ssr/assets/search_title-CKUsQDT0.js +22 -0
- package/dist/frontend-ssr/assets/search_toggle_filters-hS9rvQhC.js +282 -0
- package/dist/frontend-ssr/assets/{select-value-CaDktvDW.js → select-value-BCWSsoTd.js} +204 -218
- package/dist/frontend-ssr/assets/{settings-Mp8EuFSn.js → settings-DwAcLGM1.js} +2 -2
- package/dist/frontend-ssr/assets/share_copied-BxU9rjXG.js +602 -0
- package/dist/frontend-ssr/assets/share_toggle_password-C6OmroqR.js +202 -0
- package/dist/frontend-ssr/assets/sidebar_uncategorized-Dx-LTd5w.js +102 -0
- package/dist/frontend-ssr/assets/{tag-BmiVU_Ej.js → tag-DFh6nF9R.js} +19 -11
- package/dist/frontend-ssr/assets/{tag-store.svelte-BM1lUI_P.js → tag-store.svelte-QRysvGKe.js} +1 -1
- package/dist/frontend-ssr/assets/{tags-BQsI_6OW.js → tags-BBCoFYro.js} +1 -1
- package/dist/frontend-ssr/assets/tags_load_error-CPrc6Gzs.js +362 -0
- package/dist/frontend-ssr/assets/tags_new-VmMr9v2V.js +62 -0
- package/dist/frontend-ssr/assets/{textarea-BGrjPOgU.js → textarea-BuszTo9i.js} +2 -2
- package/dist/frontend-ssr/assets/{theme.svelte-CN3BUhJG.js → theme.svelte-shZrSxz8.js} +1 -1
- package/dist/frontend-ssr/assets/theme_system-BucaNntV.js +362 -0
- package/dist/frontend-ssr/assets/{utils-Cg_R05dR.js → utils-BK35BJKQ.js} +1 -1
- package/dist/frontend-ssr/assets/version_create_snapshot-COHzwjle.js +22 -0
- package/dist/frontend-ssr/assets/version_restored_from-CertjFDl.js +242 -0
- package/dist/frontend-ssr/assets/version_snapshot_label_placeholder-Cy_rMCij.js +222 -0
- package/dist/frontend-ssr/assets/weekday_we-DrI3U230.js +422 -0
- 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 -1
- package/dist/frontend-ssr/components/editor/markdown-toggle.js +2 -2
- 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 +12 -14
- 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 +47 -51
- package/dist/frontend-ssr/dashboard.js +243 -232
- package/dist/frontend-ssr/i18n.js +6698 -1
- package/dist/frontend-ssr/offline/identity.js +1 -1
- package/dist/frontend-ssr/search.js +28 -31
- package/dist/frontend-ssr/shared-document.js +1 -2
- package/dist/frontend-ssr/theme.js +1 -1
- package/dist/frontend-ssr/utils/dndzone.js +1 -1
- package/dist/lifecycle-runtime.js +4437 -2019
- package/dist/mcp-cli.js +1 -1
- package/dist/mcp-server.js +1 -1
- package/package.json +7 -7
- package/packages/cli/src/index.ts +1 -1
- package/packages/db/src/schema.ts +2 -0
- package/server.json +2 -2
- package/dist/frontend/CategoryDialog-bQKMpVFD.js +0 -631
- package/dist/frontend/ConfirmDialog-DF7kgkyq.js +0 -139
- package/dist/frontend/FolderNode-Cf443LBa.js +0 -298
- package/dist/frontend/HiAiEditor-CMZ-eL8s.js +0 -2992
- package/dist/frontend/ShareDialog-Bwz2y3Le.js +0 -281
- package/dist/frontend/Sidebar-C_t5RrOJ.js +0 -2101
- package/dist/frontend/dist-DQa_OHOa.js +0 -268
- package/dist/frontend/dndzone-BzsOINtP.js +0 -1199
- package/dist/frontend/messages-DTRe4U2V.js +0 -1093
- package/dist/frontend/utils-CMQRlxbx.js +0 -7
- package/dist/frontend-ssr/assets/ConfirmDialog-DrH653ua.js +0 -136
- package/dist/frontend-ssr/assets/attachments-BdkOp8ha.js +0 -93
- package/dist/frontend-ssr/assets/messages-B1TjVIH8.js +0 -11147
- package/dist/frontend-ssr/assets/share-qTqvd6Lu.js +0 -30
|
@@ -1,2101 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./Icon-Db-o32_E.js";
|
|
2
|
-
import { t } from "./check-BIi-Ghti.js";
|
|
3
|
-
import { t as n } from "./chevron-down-C2ft7XUV.js";
|
|
4
|
-
import { n as r, t as i } from "./folder-Cx60MRpi.js";
|
|
5
|
-
import { t as a } from "./clock-Dz86E4Kz.js";
|
|
6
|
-
import { t as o } from "./copy-CvCh4ZVt.js";
|
|
7
|
-
import { a as s, i as c, r as l, t as u } from "./confirm-dialog-8T6vsWL7.js";
|
|
8
|
-
import { t as d } from "./SettingsDialog-DatuxOVX.js";
|
|
9
|
-
import { n as f, t as p } from "./tag-DhVFHMcV.js";
|
|
10
|
-
import { t as m } from "./x-cfdlccjs.js";
|
|
11
|
-
import { a as h, i as g, o as _, r as v, t as ee } from "./dropdown-menu-Bi5Iipwf.js";
|
|
12
|
-
import { n as te } from "./dist-DQa_OHOa.js";
|
|
13
|
-
import { $r as y, Di as b, Ei as x, Er as S, Gn as C, Gt as ne, Ii as w, Kt as T, Lt as E, O as D, Oi as re, Pi as ie, Qr as O, Ti as k, Ut as A, Wn as j, Xn as ae, Xr as M, Yn as oe, Zr as N, di as se, ei as P, hi as ce, ir as le, ji as ue, ki as de, li as fe, nr as pe, or as me, p as he, pi as ge, ri as _e, rr as ve, tr as ye, ui as be, vi as xe, w as Se, wi as Ce } from "./messages-DTRe4U2V.js";
|
|
14
|
-
import { a as we, i as Te, n as F, t as Ee } from "./route-context-DYQlUfzL.js";
|
|
15
|
-
import { t as I } from "./utils-DrfHTcei.js";
|
|
16
|
-
import { a as De, i as Oe, n as ke, o as Ae, r as je, s as Me, t as Ne } from "./dialog-CiSwD-_v.js";
|
|
17
|
-
import { t as Pe } from "./input-N9dNSOWF.js";
|
|
18
|
-
import { t as Fe } from "./label-CK72_fw8.js";
|
|
19
|
-
import { n as Ie } from "./client-GbtOH90i.js";
|
|
20
|
-
import { i as Le, r as Re, s as ze } from "./categories-X7gK8azc.js";
|
|
21
|
-
import { t as L } from "./context-D0zPFXZ4.js";
|
|
22
|
-
import { t as R } from "./resolve-BG4HgzpN.js";
|
|
23
|
-
import { n as Be, t as Ve } from "./dndzone-BzsOINtP.js";
|
|
24
|
-
import { c as He, i as Ue, r as We, s as Ge, t as Ke } from "./documents-CwCs1rA7.js";
|
|
25
|
-
import { c as qe, r as Je, s as Ye, t as Xe } from "./folders-ONG03Dkv.js";
|
|
26
|
-
import { t as Ze } from "./DeleteDialog-BIlqRb1u.js";
|
|
27
|
-
import { t as Qe } from "./ShareDialog-Bwz2y3Le.js";
|
|
28
|
-
import { t as $e } from "./clipboard-Cgzxc0_R.js";
|
|
29
|
-
import { t as et } from "./CategoryDialog-bQKMpVFD.js";
|
|
30
|
-
import { n as tt, t as nt } from "./document-drop-coordinator-C4xHMjwC.js";
|
|
31
|
-
import { a as rt, c as it, d as at, f as ot, i as st, n as ct, o as lt, p as ut, r as dt, s as ft, t as pt, u as mt } from "./subfolders-refresh-store.svelte-DxP21a1c.js";
|
|
32
|
-
import { t as ht } from "./FolderNode-Cf443LBa.js";
|
|
33
|
-
import { a as gt, i as _t, n as z, o as B, s as vt, t as yt } from "./tag-store.svelte-ogVCMCbv.js";
|
|
34
|
-
import { t as bt } from "./ConfirmDialog-DF7kgkyq.js";
|
|
35
|
-
import { i as xt, o as St } from "./tags-BdCaMGfj.js";
|
|
36
|
-
import { t as Ct } from "./TagCreateDialog-Ch21yuWV.js";
|
|
37
|
-
import "svelte/internal/disclose-version";
|
|
38
|
-
import * as V from "svelte/internal/client";
|
|
39
|
-
import { onDestroy as wt, onMount as Tt, untrack as Et } from "svelte";
|
|
40
|
-
import "svelte/internal/flags/legacy";
|
|
41
|
-
import { page as H } from "$app/state";
|
|
42
|
-
import { flip as Dt } from "svelte/animate";
|
|
43
|
-
//#region ../node_modules/.bun/lucide-svelte@0.577.0+ff5f301bb2db9a0d/node_modules/lucide-svelte/dist/icons/panel-left-close.svelte
|
|
44
|
-
function Ot(t, n) {
|
|
45
|
-
let r = V.legacy_rest_props(n, [
|
|
46
|
-
"children",
|
|
47
|
-
"$$slots",
|
|
48
|
-
"$$events",
|
|
49
|
-
"$$legacy"
|
|
50
|
-
]), i = [
|
|
51
|
-
["rect", {
|
|
52
|
-
width: "18",
|
|
53
|
-
height: "18",
|
|
54
|
-
x: "3",
|
|
55
|
-
y: "3",
|
|
56
|
-
rx: "2"
|
|
57
|
-
}],
|
|
58
|
-
["path", { d: "M9 3v18" }],
|
|
59
|
-
["path", { d: "m16 15-3-3 3-3" }]
|
|
60
|
-
];
|
|
61
|
-
e(t, V.spread_props({ name: "panel-left-close" }, () => r, {
|
|
62
|
-
get iconNode() {
|
|
63
|
-
return i;
|
|
64
|
-
},
|
|
65
|
-
children: (e, t) => {
|
|
66
|
-
var r = V.comment(), i = V.first_child(r);
|
|
67
|
-
V.slot(i, n, "default", {}, null), V.append(e, r);
|
|
68
|
-
},
|
|
69
|
-
$$slots: { default: !0 }
|
|
70
|
-
}));
|
|
71
|
-
}
|
|
72
|
-
//#endregion
|
|
73
|
-
//#region ../node_modules/.bun/lucide-svelte@0.577.0+ff5f301bb2db9a0d/node_modules/lucide-svelte/dist/icons/panel-left-open.svelte
|
|
74
|
-
function kt(t, n) {
|
|
75
|
-
let r = V.legacy_rest_props(n, [
|
|
76
|
-
"children",
|
|
77
|
-
"$$slots",
|
|
78
|
-
"$$events",
|
|
79
|
-
"$$legacy"
|
|
80
|
-
]), i = [
|
|
81
|
-
["rect", {
|
|
82
|
-
width: "18",
|
|
83
|
-
height: "18",
|
|
84
|
-
x: "3",
|
|
85
|
-
y: "3",
|
|
86
|
-
rx: "2"
|
|
87
|
-
}],
|
|
88
|
-
["path", { d: "M9 3v18" }],
|
|
89
|
-
["path", { d: "m14 9 3 3-3 3" }]
|
|
90
|
-
];
|
|
91
|
-
e(t, V.spread_props({ name: "panel-left-open" }, () => r, {
|
|
92
|
-
get iconNode() {
|
|
93
|
-
return i;
|
|
94
|
-
},
|
|
95
|
-
children: (e, t) => {
|
|
96
|
-
var r = V.comment(), i = V.first_child(r);
|
|
97
|
-
V.slot(i, n, "default", {}, null), V.append(e, r);
|
|
98
|
-
},
|
|
99
|
-
$$slots: { default: !0 }
|
|
100
|
-
}));
|
|
101
|
-
}
|
|
102
|
-
//#endregion
|
|
103
|
-
//#region ../node_modules/.bun/lucide-svelte@0.577.0+ff5f301bb2db9a0d/node_modules/lucide-svelte/dist/icons/settings.svelte
|
|
104
|
-
function U(t, n) {
|
|
105
|
-
let r = V.legacy_rest_props(n, [
|
|
106
|
-
"children",
|
|
107
|
-
"$$slots",
|
|
108
|
-
"$$events",
|
|
109
|
-
"$$legacy"
|
|
110
|
-
]), i = [["path", { d: "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915" }], ["circle", {
|
|
111
|
-
cx: "12",
|
|
112
|
-
cy: "12",
|
|
113
|
-
r: "3"
|
|
114
|
-
}]];
|
|
115
|
-
e(t, V.spread_props({ name: "settings" }, () => r, {
|
|
116
|
-
get iconNode() {
|
|
117
|
-
return i;
|
|
118
|
-
},
|
|
119
|
-
children: (e, t) => {
|
|
120
|
-
var r = V.comment(), i = V.first_child(r);
|
|
121
|
-
V.slot(i, n, "default", {}, null), V.append(e, r);
|
|
122
|
-
},
|
|
123
|
-
$$slots: { default: !0 }
|
|
124
|
-
}));
|
|
125
|
-
}
|
|
126
|
-
//#endregion
|
|
127
|
-
//#region src/lib/components/SearchBar.svelte
|
|
128
|
-
var W = V.from_html("<button type=\"button\" class=\"absolute right-2 top-1/2 inline-flex size-5 -translate-y-1/2 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring\"><!></button>"), At = V.from_html("<div><!> <input type=\"text\"/> <!></div>");
|
|
129
|
-
function jt(e, t) {
|
|
130
|
-
V.push(t, !0);
|
|
131
|
-
let n = V.state(""), r = V.state(null), i = Ee();
|
|
132
|
-
function a() {
|
|
133
|
-
V.set(n, ""), V.get(r)?.focus();
|
|
134
|
-
}
|
|
135
|
-
var o = At(), s = V.child(o);
|
|
136
|
-
f(s, { class: "pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" });
|
|
137
|
-
var c = V.sibling(s, 2);
|
|
138
|
-
V.remove_input_defaults(c), V.bind_this(c, (e) => V.set(r, e), () => V.get(r));
|
|
139
|
-
var l = V.sibling(c, 2), u = (e) => {
|
|
140
|
-
var t = W();
|
|
141
|
-
m(V.child(t), { class: "size-3.5" }), V.reset(t), V.template_effect((e, n) => {
|
|
142
|
-
V.set_attribute(t, "aria-label", e), V.set_attribute(t, "title", n);
|
|
143
|
-
}, [() => E(), () => E()]), V.delegated("click", t, a), V.append(e, t);
|
|
144
|
-
};
|
|
145
|
-
V.if(l, (e) => {
|
|
146
|
-
V.get(n) && e(u);
|
|
147
|
-
}), V.reset(o), V.template_effect((e, t, n) => {
|
|
148
|
-
V.set_class(o, 1, e), V.set_attribute(c, "placeholder", t), V.set_class(c, 1, n);
|
|
149
|
-
}, [
|
|
150
|
-
() => V.clsx(I("relative", t.class)),
|
|
151
|
-
() => M(),
|
|
152
|
-
() => V.clsx(I("flex h-9 w-full rounded-md border border-input bg-transparent pl-9 py-1 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring", V.get(n) ? "pr-9" : "pr-3"))
|
|
153
|
-
]), V.delegated("keydown", c, (e) => {
|
|
154
|
-
e.key === "Enter" && V.get(n).trim() && F(i, `/search?q=${encodeURIComponent(V.get(n).trim())}`);
|
|
155
|
-
}), V.event("focus", c, () => {}), V.bind_value(c, () => V.get(n), (e) => V.set(n, e)), V.append(e, o), V.pop();
|
|
156
|
-
}
|
|
157
|
-
V.delegate(["keydown", "click"]);
|
|
158
|
-
//#endregion
|
|
159
|
-
//#region src/lib/components/sidebar/FolderTree.svelte
|
|
160
|
-
var Mt = (e, t = V.noop) => {
|
|
161
|
-
var n = Lt(), r = V.sibling(V.child(n), 2);
|
|
162
|
-
s(r, { class: "size-4 shrink-0 text-muted-foreground" });
|
|
163
|
-
var i = V.sibling(r, 2), a = V.child(i, !0);
|
|
164
|
-
V.reset(i), V.reset(n), V.template_effect((e) => {
|
|
165
|
-
V.set_attribute(n, "href", `/docs/${t().id}`), V.set_class(n, 1, e, "svelte-1nshngr"), V.set_text(a, t().title);
|
|
166
|
-
}, [() => V.clsx(I("flex w-full min-w-0 items-center gap-1.5 rounded-md px-2 py-1 text-sm transition-colors hover:bg-accent hover:text-accent-foreground", H.params.id === t().id && "bg-accent text-accent-foreground font-medium"))]), V.append(e, n);
|
|
167
|
-
}, Nt = V.from_html("<button><!></button>"), Pt = V.from_html("<!> <!> <!>", 1), Ft = V.from_html("<!> <!>", 1), It = V.from_html("<button type=\"button\"><!></button>"), Lt = V.from_html("<a data-sveltekit-noscroll=\"\"><span class=\"w-3.5 shrink-0\"></span> <!> <span class=\"min-w-0 truncate\"> </span></a>"), Rt = V.from_html("<p class=\"px-2 text-xs text-destructive\"> </p>"), zt = V.from_html("<!> <!> <!> <!> <!> <!>", 1), Bt = V.from_html("<div><!></div>"), Vt = V.from_html("<div class=\"group/doc flex w-full min-w-0 items-center gap-1\"><!> <!> <!></div>"), Ht = V.from_html("<div class=\"ml-0.5 space-y-0.5 border-l border-border pl-0.5\"><div></div> <div></div></div>"), Ut = V.from_html("<div class=\"group/bucket\"><div class=\"flex w-full min-w-0 items-center gap-0.5\"><button type=\"button\"><!> <span class=\"min-w-0 truncate\"> </span></button> <!></div> <!></div>"), Wt = V.from_html("<div class=\"group/bucket\"><div class=\"flex w-full min-w-0 items-center gap-0.5\"><button type=\"button\"><!> <span class=\"min-w-0 truncate\"> </span></button></div> <!></div>"), Gt = V.from_html("<p id=\"rename-input-error\" class=\"text-xs text-destructive\" role=\"alert\"> </p>"), Kt = V.from_html("<!> <form class=\"space-y-4\"><div class=\"space-y-2\"><!> <!> <!></div></form> <!>", 1), qt = V.from_html("<div class=\"space-y-1\"><div class=\"mb-2 flex items-center justify-between gap-1\"><a class=\"block flex-1 px-2 text-xs font-medium uppercase tracking-wider text-muted-foreground transition-colors hover:text-foreground\"> </a> <button type=\"button\" class=\"inline-flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"><!></button></div> <!> <!> <div class=\"min-h-[8px] space-y-1\"></div> <!> <button type=\"button\" class=\"flex w-full items-center gap-1.5 rounded-md px-2 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground\"><!> <span> </span></button></div> <!> <!> <!> <!> <!>", 1);
|
|
168
|
-
function Jt(e, i) {
|
|
169
|
-
V.push(i, !0);
|
|
170
|
-
let a = (e, t = V.noop) => {
|
|
171
|
-
h(e, {
|
|
172
|
-
children: (e, n) => {
|
|
173
|
-
var r = Ft(), i = V.first_child(r);
|
|
174
|
-
ee(i, {
|
|
175
|
-
child: (e, t) => {
|
|
176
|
-
let n = () => (t?.()).props;
|
|
177
|
-
var r = Nt(), i = (e) => {
|
|
178
|
-
e.preventDefault(), e.stopPropagation();
|
|
179
|
-
};
|
|
180
|
-
V.attribute_effect(r, (e, t) => ({
|
|
181
|
-
...n(),
|
|
182
|
-
type: "button",
|
|
183
|
-
class: "sidebar-touch-action inline-flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-accent-foreground group-hover/doc:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
184
|
-
"aria-label": e,
|
|
185
|
-
title: t,
|
|
186
|
-
onclick: i
|
|
187
|
-
}), [() => T(), () => T()], void 0, void 0, "svelte-1nshngr"), _(V.child(r), { class: "size-3.5" }), V.reset(r), V.append(e, r);
|
|
188
|
-
},
|
|
189
|
-
$$slots: { child: !0 }
|
|
190
|
-
}), g(V.sibling(i, 2), {
|
|
191
|
-
align: "end",
|
|
192
|
-
children: (e, n) => {
|
|
193
|
-
var r = Pt(), i = V.first_child(r);
|
|
194
|
-
v(i, {
|
|
195
|
-
onSelect: () => sr("doc", t().id, t().title),
|
|
196
|
-
children: (e, t) => {
|
|
197
|
-
V.next();
|
|
198
|
-
var n = V.text();
|
|
199
|
-
V.template_effect((e) => V.set_text(n, e), [() => ce()]), V.append(e, n);
|
|
200
|
-
},
|
|
201
|
-
$$slots: { default: !0 }
|
|
202
|
-
});
|
|
203
|
-
var a = V.sibling(i, 2);
|
|
204
|
-
v(a, {
|
|
205
|
-
onSelect: () => dr(t().id, t().title),
|
|
206
|
-
children: (e, t) => {
|
|
207
|
-
V.next();
|
|
208
|
-
var n = V.text();
|
|
209
|
-
V.template_effect((e) => V.set_text(n, e), [() => k()]), V.append(e, n);
|
|
210
|
-
},
|
|
211
|
-
$$slots: { default: !0 }
|
|
212
|
-
}), v(V.sibling(a, 2), {
|
|
213
|
-
class: "text-destructive focus:text-destructive",
|
|
214
|
-
onSelect: () => ur("doc", t().id, t().title),
|
|
215
|
-
children: (e, t) => {
|
|
216
|
-
V.next();
|
|
217
|
-
var n = V.text();
|
|
218
|
-
V.template_effect((e) => V.set_text(n, e), [() => pe()]), V.append(e, n);
|
|
219
|
-
},
|
|
220
|
-
$$slots: { default: !0 }
|
|
221
|
-
}), V.append(e, r);
|
|
222
|
-
},
|
|
223
|
-
$$slots: { default: !0 }
|
|
224
|
-
}), V.append(e, r);
|
|
225
|
-
},
|
|
226
|
-
$$slots: { default: !0 }
|
|
227
|
-
});
|
|
228
|
-
}, s = (e, n = V.noop) => {
|
|
229
|
-
var r = It(), i = V.child(r), a = (e) => {
|
|
230
|
-
te(e, { class: "size-3.5 animate-spin" });
|
|
231
|
-
}, s = (e) => {
|
|
232
|
-
t(e, { class: "size-3.5" });
|
|
233
|
-
}, c = (e) => {
|
|
234
|
-
o(e, { class: "size-3.5" });
|
|
235
|
-
};
|
|
236
|
-
V.if(i, (e) => {
|
|
237
|
-
V.get(fn) === n().id ? e(a) : V.get(dn) === n().id ? e(s, 1) : e(c, -1);
|
|
238
|
-
}), V.reset(r), V.template_effect((e, t) => {
|
|
239
|
-
V.set_class(r, 1, `sidebar-touch-action inline-flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-accent-foreground group-hover/doc:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${V.get(dn) === n().id || V.get(fn) === n().id ? "opacity-100" : ""}`, "svelte-1nshngr"), V.set_attribute(r, "aria-label", e), V.set_attribute(r, "title", t), r.disabled = V.get(fn) === n().id;
|
|
240
|
-
}, [() => ne(), () => ne()]), V.delegated("click", r, (e) => {
|
|
241
|
-
e.preventDefault(), e.stopPropagation(), mn(n().id);
|
|
242
|
-
}), V.append(e, r);
|
|
243
|
-
}, d = (e, t = V.noop) => {
|
|
244
|
-
ht(e, {
|
|
245
|
-
get folder() {
|
|
246
|
-
return t();
|
|
247
|
-
},
|
|
248
|
-
get expandedFolderIds() {
|
|
249
|
-
return V.get(D);
|
|
250
|
-
},
|
|
251
|
-
onToggleFolder: Mn,
|
|
252
|
-
onRename: (e, t) => sr("folder", e, t),
|
|
253
|
-
onDelete: (e, t) => ur("folder", e, t),
|
|
254
|
-
onCreateSubfolder: Ln,
|
|
255
|
-
onShare: fr,
|
|
256
|
-
get dragDisabled() {
|
|
257
|
-
return V.get(L);
|
|
258
|
-
},
|
|
259
|
-
get isDraggingGlobal() {
|
|
260
|
-
return V.get(R);
|
|
261
|
-
},
|
|
262
|
-
get isDraggingFolder() {
|
|
263
|
-
return V.get(at);
|
|
264
|
-
},
|
|
265
|
-
get isDraggingDoc() {
|
|
266
|
-
return V.get(_t);
|
|
267
|
-
},
|
|
268
|
-
get draggedDocId() {
|
|
269
|
-
return V.get(B);
|
|
270
|
-
},
|
|
271
|
-
onScheduleFolderExpand: gn,
|
|
272
|
-
onClearExpandTimer: hn,
|
|
273
|
-
onConsiderDocs: Bn,
|
|
274
|
-
onFinalizeDocs: Vn,
|
|
275
|
-
onConsiderSubfolders: Yn,
|
|
276
|
-
onFinalizeSubfolders: Xn,
|
|
277
|
-
onDropOnFolder: Gn,
|
|
278
|
-
get folderDocsMap() {
|
|
279
|
-
return V.get(Ot);
|
|
280
|
-
},
|
|
281
|
-
folderFlipDurationMs: y,
|
|
282
|
-
documentFlipDurationMs: x,
|
|
283
|
-
get docRowInner() {
|
|
284
|
-
return Mt;
|
|
285
|
-
},
|
|
286
|
-
get copyButton() {
|
|
287
|
-
return s;
|
|
288
|
-
},
|
|
289
|
-
get docMenu() {
|
|
290
|
-
return a;
|
|
291
|
-
}
|
|
292
|
-
});
|
|
293
|
-
}, f = Ee(), p = we(), m = u(), y = 200, x = 80, S = V.state(V.proxy([])), C = V.state(V.proxy([])), E = V.state(V.proxy([])), D = V.state(V.proxy(/* @__PURE__ */ new Set())), O = V.state(V.proxy(/* @__PURE__ */ new Set())), A = V.state(!0), M = V.state(null), N = V.state(null), P = null;
|
|
294
|
-
function _e(e) {
|
|
295
|
-
V.set(N, e, !0), P &&= (clearTimeout(P), null), e !== null && (P = setTimeout(() => {
|
|
296
|
-
V.set(N, null), P = null;
|
|
297
|
-
}, 5e3));
|
|
298
|
-
}
|
|
299
|
-
let L = V.state(!1), R = V.state(!1), at = V.state(!1), _t = V.state(!1), B = V.state(null), vt = 0, bt = V.state(!1), xt = V.state(!1), St = 0, Ct = Promise.resolve(), H = V.state(V.proxy([])), Ot = V.state(V.proxy({})), kt = V.state(V.proxy({})), U = V.state(V.proxy({})), W = V.state(V.proxy([])), At = V.state(!1), jt = V.state(null), Lt = V.state(null), Jt = V.state(!1), Yt = V.state(null), Xt = V.state(""), G = V.state(null), K = V.state(!1), Zt = V.state(!1), q = V.state(null), Qt = V.state(!1), $t = V.state(""), en = V.state(""), tn = V.state(""), nn = V.state(""), rn = V.state(""), an = V.state(""), on = V.state(!1), sn = V.state("create"), J = V.state(null), cn = V.state(!1), Y = null, ln = V.state(null), X = null, un = V.state(null), dn = V.state(null), fn = V.state(null), pn = null;
|
|
300
|
-
async function mn(e) {
|
|
301
|
-
if (typeof window > "u") return;
|
|
302
|
-
let t = V.get(E).find((t) => t.id === e), n = "";
|
|
303
|
-
V.set(fn, e, !0);
|
|
304
|
-
try {
|
|
305
|
-
n = (await Ue(e, p.fetch)).content ?? "";
|
|
306
|
-
} catch (e) {
|
|
307
|
-
console.error("FolderTree: failed to fetch full document for copy", e), n = t?.excerpt ?? t?.content ?? "";
|
|
308
|
-
} finally {
|
|
309
|
-
V.set(fn, null);
|
|
310
|
-
}
|
|
311
|
-
n && await $e(n) && (V.set(dn, e, !0), pn && clearTimeout(pn), pn = setTimeout(() => {
|
|
312
|
-
V.set(dn, null), pn = null;
|
|
313
|
-
}, 2e3));
|
|
314
|
-
}
|
|
315
|
-
function hn() {
|
|
316
|
-
Y !== null && (clearTimeout(Y), Y = null), V.set(ln, null);
|
|
317
|
-
}
|
|
318
|
-
function gn(e) {
|
|
319
|
-
hn(), !V.get(D).has(e) && (V.set(ln, e, !0), Y = setTimeout(() => {
|
|
320
|
-
if (V.get(ln) === e && !V.get(D).has(e)) {
|
|
321
|
-
let t = new Set(V.get(D));
|
|
322
|
-
t.add(e), V.set(D, t, !0);
|
|
323
|
-
}
|
|
324
|
-
Y = null, V.set(ln, null);
|
|
325
|
-
}, 400));
|
|
326
|
-
}
|
|
327
|
-
function _n() {
|
|
328
|
-
X !== null && (clearTimeout(X), X = null), V.set(un, null);
|
|
329
|
-
}
|
|
330
|
-
function vn(e) {
|
|
331
|
-
_n(), !(e === $ ? V.get(A) : V.get(O).has(e)) && (V.set(un, e, !0), X = setTimeout(() => {
|
|
332
|
-
if (V.get(un) === e) if (e === $) V.set(A, !0);
|
|
333
|
-
else {
|
|
334
|
-
let t = new Set(V.get(O));
|
|
335
|
-
t.add(e), V.set(O, t, !0);
|
|
336
|
-
}
|
|
337
|
-
X = null, V.set(un, null);
|
|
338
|
-
}, 400));
|
|
339
|
-
}
|
|
340
|
-
function yn(e) {
|
|
341
|
-
return Array.isArray(e) ? e.filter((e) => typeof e == "object" && !!e && typeof e.id == "string") : [];
|
|
342
|
-
}
|
|
343
|
-
function bn(e) {
|
|
344
|
-
let t = [], n = {}, r = {};
|
|
345
|
-
for (let i of e) if (i.folderId) {
|
|
346
|
-
let e = r[i.folderId] ?? [];
|
|
347
|
-
e.push(i), r[i.folderId] = e;
|
|
348
|
-
} else if (i.categoryId) {
|
|
349
|
-
let e = n[i.categoryId] ?? [];
|
|
350
|
-
e.push(i), n[i.categoryId] = e;
|
|
351
|
-
} else t.push(i);
|
|
352
|
-
return {
|
|
353
|
-
root: t,
|
|
354
|
-
byCategory: n,
|
|
355
|
-
byFolder: r
|
|
356
|
-
};
|
|
357
|
-
}
|
|
358
|
-
function xn() {
|
|
359
|
-
let { root: e, byCategory: t, byFolder: n } = bn(V.get(E));
|
|
360
|
-
V.set(H, e, !0), V.set(kt, t, !0), V.set(Ot, n, !0);
|
|
361
|
-
}
|
|
362
|
-
function Sn() {
|
|
363
|
-
let e = /* @__PURE__ */ new Map();
|
|
364
|
-
for (let t of V.get(C)) e.set(t.id, []);
|
|
365
|
-
let t = [];
|
|
366
|
-
for (let n of V.get(S)) n.categoryId && e.has(n.categoryId) ? e.get(n.categoryId)?.push(n) : t.push(n);
|
|
367
|
-
let n = {};
|
|
368
|
-
for (let t of V.get(C)) n[t.id] = e.get(t.id) ?? [];
|
|
369
|
-
n[$] = t, V.set(U, n, !0);
|
|
370
|
-
}
|
|
371
|
-
V.user_effect(() => {
|
|
372
|
-
V.get(S), V.get(C), !(V.get(bt) || V.get(xt)) && (V.set(W, V.get(wr).map((e) => ({
|
|
373
|
-
id: e.id,
|
|
374
|
-
category: e.category,
|
|
375
|
-
folders: e.folders
|
|
376
|
-
})), !0), Sn());
|
|
377
|
-
});
|
|
378
|
-
async function Cn() {
|
|
379
|
-
try {
|
|
380
|
-
let e = await Ye(null, !1, p.fetch);
|
|
381
|
-
V.set(S, (e[0]?.children ?? []).map((e) => (ut(e.id, e.parentId ?? null, e.categoryId ?? null, e.order ?? 0), {
|
|
382
|
-
id: e.id,
|
|
383
|
-
name: e.name,
|
|
384
|
-
categoryId: e.categoryId ?? null,
|
|
385
|
-
parentId: e.parentId,
|
|
386
|
-
order: e.order ?? 0
|
|
387
|
-
})), !0), V.set(M, null);
|
|
388
|
-
} catch (e) {
|
|
389
|
-
console.error("FolderTree: failed to load folders", e), V.set(M, "Failed to load folders");
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
async function wn() {
|
|
393
|
-
try {
|
|
394
|
-
let e = await Le(p.fetch), t = /* @__PURE__ */ new Set();
|
|
395
|
-
for (let n of e) {
|
|
396
|
-
if (t.has(n.id)) throw Error(`Categories response contains duplicate id: ${n.id}`);
|
|
397
|
-
t.add(n.id);
|
|
398
|
-
}
|
|
399
|
-
V.set(C, e, !0);
|
|
400
|
-
} catch (e) {
|
|
401
|
-
console.error("FolderTree: failed to load categories", e);
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
let Tn = 0;
|
|
405
|
-
async function En() {
|
|
406
|
-
let e = ++Tn;
|
|
407
|
-
try {
|
|
408
|
-
let t = z(), n = await Ge({
|
|
409
|
-
limit: 100,
|
|
410
|
-
...t ? { tag: t } : {}
|
|
411
|
-
}, p.fetch);
|
|
412
|
-
if (e !== Tn) return;
|
|
413
|
-
V.set(E, n.items.map((e) => it(e.id) ? {
|
|
414
|
-
...e,
|
|
415
|
-
folderId: it(e.id)?.folderId ?? null,
|
|
416
|
-
categoryId: it(e.id)?.categoryId ?? null
|
|
417
|
-
} : e), !0), V.get(E).forEach((e) => {
|
|
418
|
-
e.id, e.title, e.categoryId, e.folderId, Object.keys(e), ot(e.id, e.folderId ?? null, e.categoryId ?? null);
|
|
419
|
-
}), xn();
|
|
420
|
-
} catch (e) {
|
|
421
|
-
console.error("FolderTree: failed to load documents", e), V.set(M, "Failed to load documents");
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
async function Z() {
|
|
425
|
-
Ke(), await Promise.all([
|
|
426
|
-
Cn(),
|
|
427
|
-
wn(),
|
|
428
|
-
En()
|
|
429
|
-
]);
|
|
430
|
-
}
|
|
431
|
-
function Dn(e, t) {
|
|
432
|
-
Tn++, ot(e, t.folderId, t.categoryId), V.set(E, V.get(E).map((n) => n.id === e ? {
|
|
433
|
-
...n,
|
|
434
|
-
...t
|
|
435
|
-
} : n), !0), xn();
|
|
436
|
-
}
|
|
437
|
-
let On = tt({
|
|
438
|
-
patch: (e, t) => He(e, t, p.fetch),
|
|
439
|
-
optimistic: (e, t) => mt(e, t.folderId, t.categoryId),
|
|
440
|
-
acknowledge: pt,
|
|
441
|
-
rollback: Dn,
|
|
442
|
-
onError: (e) => {
|
|
443
|
-
console.error("FolderTree: document move failed", e), _e(e instanceof Error ? e.message : "Move failed");
|
|
444
|
-
}
|
|
445
|
-
});
|
|
446
|
-
function kn(e, t) {
|
|
447
|
-
let n = dt(e);
|
|
448
|
-
n && (n.folderId === t.folderId && n.categoryId === t.categoryId || On(e, t, n).catch(() => void 0));
|
|
449
|
-
}
|
|
450
|
-
let Q = nt({ persist: kn });
|
|
451
|
-
Tt(() => {
|
|
452
|
-
let e = setTimeout(() => {
|
|
453
|
-
Z();
|
|
454
|
-
}, 500);
|
|
455
|
-
return () => clearTimeout(e);
|
|
456
|
-
}), wt(() => {
|
|
457
|
-
Q.cancel(), P &&= (clearTimeout(P), null), Y &&= (clearTimeout(Y), null), X &&= (clearTimeout(X), null);
|
|
458
|
-
}), V.user_effect(() => {
|
|
459
|
-
let e = yt(), t = lt();
|
|
460
|
-
e === 0 && t === 0 || Z();
|
|
461
|
-
}), V.user_effect(() => {
|
|
462
|
-
if (st() === 0) return;
|
|
463
|
-
let e = ft();
|
|
464
|
-
e && Et(() => {
|
|
465
|
-
Tn++;
|
|
466
|
-
let t = V.get(E).findIndex((t) => t.id === e.id);
|
|
467
|
-
t !== -1 && (V.set(E, V.get(E).map((n, r) => r === t ? {
|
|
468
|
-
...n,
|
|
469
|
-
folderId: e.folderId,
|
|
470
|
-
categoryId: e.categoryId
|
|
471
|
-
} : n), !0), xn());
|
|
472
|
-
});
|
|
473
|
-
});
|
|
474
|
-
let An = !0;
|
|
475
|
-
V.user_effect(() => {
|
|
476
|
-
if (z(), An) {
|
|
477
|
-
An = !1;
|
|
478
|
-
return;
|
|
479
|
-
}
|
|
480
|
-
Z();
|
|
481
|
-
});
|
|
482
|
-
async function jn() {
|
|
483
|
-
await Z();
|
|
484
|
-
}
|
|
485
|
-
function Mn(e) {
|
|
486
|
-
let t = V.get(D).has(e), n = new Set(V.get(D));
|
|
487
|
-
t ? n.delete(e) : n.add(e), V.set(D, n, !0), V.set(L, !0), typeof window < "u" && window.setTimeout(() => {
|
|
488
|
-
V.set(L, !1);
|
|
489
|
-
}, 250);
|
|
490
|
-
}
|
|
491
|
-
function Nn(e) {
|
|
492
|
-
let t = new Set(V.get(O));
|
|
493
|
-
t.has(e) ? t.delete(e) : t.add(e), V.set(O, t, !0);
|
|
494
|
-
}
|
|
495
|
-
function Pn() {
|
|
496
|
-
V.set(A, !V.get(A));
|
|
497
|
-
}
|
|
498
|
-
function Fn() {
|
|
499
|
-
V.set(jt, null), V.set(Lt, null), V.set(At, !0);
|
|
500
|
-
}
|
|
501
|
-
function In(e) {
|
|
502
|
-
V.set(jt, null), V.set(Lt, e, !0), V.set(At, !0);
|
|
503
|
-
}
|
|
504
|
-
function Ln(e) {
|
|
505
|
-
V.set(jt, e, !0), V.set(Lt, null), V.set(At, !0);
|
|
506
|
-
}
|
|
507
|
-
async function Rn(e) {
|
|
508
|
-
let t = V.get(jt), n = await Xe({
|
|
509
|
-
name: e,
|
|
510
|
-
parentId: t,
|
|
511
|
-
categoryId: V.get(Lt)
|
|
512
|
-
}, p.fetch);
|
|
513
|
-
return await Cn(), t && (V.set(D, new Set(V.get(D)).add(t), !0), ct(t)), n;
|
|
514
|
-
}
|
|
515
|
-
function zn(e, t) {
|
|
516
|
-
if (e.kind === "root") {
|
|
517
|
-
V.set(H, t, !0);
|
|
518
|
-
return;
|
|
519
|
-
}
|
|
520
|
-
if (e.kind === "category") {
|
|
521
|
-
V.set(kt, {
|
|
522
|
-
...V.get(kt),
|
|
523
|
-
[e.id]: t
|
|
524
|
-
}, !0);
|
|
525
|
-
return;
|
|
526
|
-
}
|
|
527
|
-
V.set(Ot, {
|
|
528
|
-
...V.get(Ot),
|
|
529
|
-
[e.id]: t
|
|
530
|
-
}, !0);
|
|
531
|
-
}
|
|
532
|
-
function Bn(e) {
|
|
533
|
-
return (t) => {
|
|
534
|
-
t.stopPropagation();
|
|
535
|
-
let n = !V.get(_t);
|
|
536
|
-
V.set(R, !0), V.set(_t, !0), t.detail.info?.id && (V.set(B, t.detail.info.id, !0), n && Q.begin(t.detail.info.id, ++vt)), zn(e, yn(t.detail.items)), hn();
|
|
537
|
-
};
|
|
538
|
-
}
|
|
539
|
-
function Vn(e) {
|
|
540
|
-
return (t) => {
|
|
541
|
-
t.stopPropagation(), zn(e, yn(t.detail.items)), hn();
|
|
542
|
-
let n = t.detail.info?.trigger === "droppedIntoAnother";
|
|
543
|
-
t.detail.info?.trigger;
|
|
544
|
-
let r = t.detail.info?.id ?? V.get(B);
|
|
545
|
-
!n && r && Q.zone(r, Hn(e)), r && Q.end(r, vt), V.set(R, !1), V.set(_t, !1), typeof window < "u" ? window.setTimeout(() => {
|
|
546
|
-
V.get(B) === r && V.set(B, null);
|
|
547
|
-
}, 0) : V.set(B, null);
|
|
548
|
-
};
|
|
549
|
-
}
|
|
550
|
-
function Hn(e) {
|
|
551
|
-
return {
|
|
552
|
-
folderId: e.kind === "folder" ? e.id : null,
|
|
553
|
-
categoryId: e.kind === "category" ? e.id : e.kind === "root" ? null : rt(e.id)?.categoryId ?? null
|
|
554
|
-
};
|
|
555
|
-
}
|
|
556
|
-
function Un(e) {
|
|
557
|
-
(V.get(B) ?? Q.pendingId(vt)) && (e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = "move"));
|
|
558
|
-
}
|
|
559
|
-
function Wn(e, t) {
|
|
560
|
-
let n = V.get(B) ?? Q.pendingId(vt);
|
|
561
|
-
if (!n) return;
|
|
562
|
-
e.preventDefault(), e.stopPropagation();
|
|
563
|
-
let r = t === $ ? null : t, i = dt(n);
|
|
564
|
-
if (!i) return;
|
|
565
|
-
let a = i.folderId !== null, o = i.categoryId !== r;
|
|
566
|
-
(a || o) && Q.header(n, {
|
|
567
|
-
folderId: null,
|
|
568
|
-
categoryId: r
|
|
569
|
-
}), V.set(B, null);
|
|
570
|
-
}
|
|
571
|
-
function Gn(e, t) {
|
|
572
|
-
let n = V.get(B) ?? Q.pendingId(vt);
|
|
573
|
-
if (!n) return;
|
|
574
|
-
e.preventDefault(), e.stopPropagation();
|
|
575
|
-
let r = rt(t)?.categoryId ?? null, i = dt(n);
|
|
576
|
-
i && (i.folderId !== t && Q.header(n, {
|
|
577
|
-
folderId: t,
|
|
578
|
-
categoryId: r
|
|
579
|
-
}), V.set(B, null));
|
|
580
|
-
}
|
|
581
|
-
let Kn = "parent:";
|
|
582
|
-
function qn(e) {
|
|
583
|
-
return (t) => {
|
|
584
|
-
t.stopPropagation(), V.set(R, !0), V.set(at, !0);
|
|
585
|
-
let n = Zn(t.detail.items);
|
|
586
|
-
e.startsWith(Kn) || V.set(U, {
|
|
587
|
-
...V.get(U),
|
|
588
|
-
[e]: n
|
|
589
|
-
}, !0);
|
|
590
|
-
};
|
|
591
|
-
}
|
|
592
|
-
function Jn(e) {
|
|
593
|
-
return (t) => {
|
|
594
|
-
t.stopPropagation();
|
|
595
|
-
let n = Zn(t.detail.items), r = t.detail.info?.trigger === "droppedIntoAnother";
|
|
596
|
-
e.startsWith(Kn) || V.set(U, {
|
|
597
|
-
...V.get(U),
|
|
598
|
-
[e]: n
|
|
599
|
-
}, !0), V.set(R, !1), V.set(at, !1), r || $n(e, n);
|
|
600
|
-
};
|
|
601
|
-
}
|
|
602
|
-
function Yn(e) {
|
|
603
|
-
return qn(`${Kn}${e}`);
|
|
604
|
-
}
|
|
605
|
-
function Xn(e) {
|
|
606
|
-
return Jn(`${Kn}${e}`);
|
|
607
|
-
}
|
|
608
|
-
function Zn(e) {
|
|
609
|
-
return Array.isArray(e) ? e.filter((e) => typeof e == "object" && !!e && typeof e.id == "string") : [];
|
|
610
|
-
}
|
|
611
|
-
function Qn(e) {
|
|
612
|
-
let t = /* @__PURE__ */ new Set();
|
|
613
|
-
if (!e) return t;
|
|
614
|
-
let n = e;
|
|
615
|
-
for (; n && !t.has(n);) t.add(n), n = rt(n)?.parentId ?? null;
|
|
616
|
-
return t;
|
|
617
|
-
}
|
|
618
|
-
async function $n(e, t) {
|
|
619
|
-
let n = e.startsWith(Kn), r = n || e === $ ? null : e, i = n && e.slice(7) || null, a = /* @__PURE__ */ new Map(), o = n ? Qn(i) : /* @__PURE__ */ new Set();
|
|
620
|
-
if (n) for (let e of t) {
|
|
621
|
-
if (o.has(e.id)) continue;
|
|
622
|
-
let t = rt(e.id);
|
|
623
|
-
t && t.parentId !== i && (a.set(e.id, {
|
|
624
|
-
folderId: e.id,
|
|
625
|
-
parentId: i
|
|
626
|
-
}), ut(e.id, i, t.categoryId, t.order));
|
|
627
|
-
}
|
|
628
|
-
else for (let e of t) {
|
|
629
|
-
let t = rt(e.id);
|
|
630
|
-
if (!t) continue;
|
|
631
|
-
let n = t.categoryId !== r, i = t.parentId !== null;
|
|
632
|
-
if (n || i) {
|
|
633
|
-
let o = { folderId: e.id };
|
|
634
|
-
n && (o.categoryId = r), i && (o.parentId = null), a.set(e.id, o), ut(e.id, null, r, t.order);
|
|
635
|
-
}
|
|
636
|
-
}
|
|
637
|
-
t.forEach((e, t) => {
|
|
638
|
-
if (n && o.has(e.id)) return;
|
|
639
|
-
let r = rt(e.id);
|
|
640
|
-
if (!r) return;
|
|
641
|
-
let i = r.order !== t, s = a.get(e.id);
|
|
642
|
-
s ? (s.order = t, ut(e.id, s.parentId === void 0 ? r.parentId : s.parentId, s.categoryId === void 0 ? r.categoryId : s.categoryId, t)) : i && (a.set(e.id, {
|
|
643
|
-
folderId: e.id,
|
|
644
|
-
order: t
|
|
645
|
-
}), ut(e.id, r.parentId, r.categoryId, t));
|
|
646
|
-
});
|
|
647
|
-
let s = Array.from(a.values()), c = /* @__PURE__ */ new Set();
|
|
648
|
-
if (n) {
|
|
649
|
-
i && c.add(i);
|
|
650
|
-
for (let e of t) {
|
|
651
|
-
let t = e.parentId ?? null;
|
|
652
|
-
t !== null && t !== i && c.add(t);
|
|
653
|
-
}
|
|
654
|
-
}
|
|
655
|
-
if (s.length !== 0) try {
|
|
656
|
-
await Promise.all(s.map((e) => {
|
|
657
|
-
let { folderId: t, ...n } = e;
|
|
658
|
-
return qe(t, n, p.fetch);
|
|
659
|
-
})), await Z(), Sn();
|
|
660
|
-
for (let e of c) ct(e);
|
|
661
|
-
} catch (e) {
|
|
662
|
-
console.error("FolderTree: folder DnD persist failed", e), _e(e instanceof Error ? `Move failed: ${e.message}` : "Move failed: unknown error");
|
|
663
|
-
}
|
|
664
|
-
}
|
|
665
|
-
function er(e) {
|
|
666
|
-
e.stopPropagation(), V.set(R, !0), V.set(bt, !0), V.set(W, nr(rr(e.detail.items)), !0);
|
|
667
|
-
}
|
|
668
|
-
function tr(e) {
|
|
669
|
-
e.stopPropagation();
|
|
670
|
-
let t = nr(ir(e.detail.items));
|
|
671
|
-
V.set(W, t, !0), V.set(R, !1), V.set(bt, !1), ar(t);
|
|
672
|
-
}
|
|
673
|
-
function nr(e) {
|
|
674
|
-
let t = e.filter((e) => e.id !== $), n = V.get(W).find((e) => e.id === $) ?? V.get(wr).find((e) => e.id === $);
|
|
675
|
-
return n ? [...t, n] : t;
|
|
676
|
-
}
|
|
677
|
-
function rr(e) {
|
|
678
|
-
if (!Array.isArray(e)) return [];
|
|
679
|
-
let t = [];
|
|
680
|
-
for (let n of e) {
|
|
681
|
-
if (typeof n != "object" || !n || typeof n.id != "string") continue;
|
|
682
|
-
let e = n;
|
|
683
|
-
t.push(e);
|
|
684
|
-
}
|
|
685
|
-
return t;
|
|
686
|
-
}
|
|
687
|
-
function ir(e) {
|
|
688
|
-
let t = rr(e), n = new Set(t.filter((e) => e[Be]).map((e) => e.id)), r = /* @__PURE__ */ new Set(), i = new Map([...V.get(W), ...V.get(wr)].map((e) => [e.id, e])), a = [];
|
|
689
|
-
for (let e of t) {
|
|
690
|
-
if (n.has(e.id) && !e.isDndShadowItem || r.has(e.id)) continue;
|
|
691
|
-
r.add(e.id);
|
|
692
|
-
let t = i.get(e.id) ?? e;
|
|
693
|
-
a.push({
|
|
694
|
-
id: t.id,
|
|
695
|
-
category: t.category,
|
|
696
|
-
folders: t.folders
|
|
697
|
-
});
|
|
698
|
-
}
|
|
699
|
-
return a;
|
|
700
|
-
}
|
|
701
|
-
function ar(e) {
|
|
702
|
-
let t = ++St;
|
|
703
|
-
V.set(xt, !0);
|
|
704
|
-
let n = e.map((e) => ({ ...e }));
|
|
705
|
-
Ct = Ct.catch(() => void 0).then(async () => {
|
|
706
|
-
try {
|
|
707
|
-
await or(n);
|
|
708
|
-
} catch (e) {
|
|
709
|
-
console.error("FolderTree: category DnD persist failed", e), _e(e instanceof Error ? `Reorder failed: ${e.message}` : "Reorder failed: unknown error");
|
|
710
|
-
} finally {
|
|
711
|
-
t === St && (await Z(), V.set(xt, !1));
|
|
712
|
-
}
|
|
713
|
-
});
|
|
714
|
-
}
|
|
715
|
-
async function or(e) {
|
|
716
|
-
let t = [];
|
|
717
|
-
if (e.forEach((e, n) => {
|
|
718
|
-
e.category && t.push({
|
|
719
|
-
id: e.category.id,
|
|
720
|
-
order: n
|
|
721
|
-
});
|
|
722
|
-
}), t.length !== 0) for (let e of t) await ze(e.id, { order: e.order }, p.fetch);
|
|
723
|
-
}
|
|
724
|
-
function sr(e, t, n) {
|
|
725
|
-
V.set(Yt, {
|
|
726
|
-
kind: e,
|
|
727
|
-
id: t,
|
|
728
|
-
name: n
|
|
729
|
-
}, !0), V.set(Xt, n, !0), V.set(G, null), V.set(Jt, !0);
|
|
730
|
-
}
|
|
731
|
-
function cr() {
|
|
732
|
-
V.set(Jt, !1), V.set(Yt, null), V.set(Xt, ""), V.set(G, null), V.set(K, !1);
|
|
733
|
-
}
|
|
734
|
-
async function lr(e) {
|
|
735
|
-
e?.preventDefault();
|
|
736
|
-
let t = V.get(Yt);
|
|
737
|
-
if (!t) return;
|
|
738
|
-
let n = V.get(Xt).trim();
|
|
739
|
-
if (n.length === 0) {
|
|
740
|
-
V.set(G, "Name is required");
|
|
741
|
-
return;
|
|
742
|
-
}
|
|
743
|
-
V.set(K, !0);
|
|
744
|
-
try {
|
|
745
|
-
t.kind === "folder" ? await qe(t.id, { name: n }, p.fetch) : await He(t.id, { title: n }, p.fetch), cr(), await Z(), gt();
|
|
746
|
-
} catch (e) {
|
|
747
|
-
console.error("FolderTree: rename failed", e), V.set(G, e instanceof Error ? e.message : me(), !0);
|
|
748
|
-
} finally {
|
|
749
|
-
V.set(K, !1);
|
|
750
|
-
}
|
|
751
|
-
}
|
|
752
|
-
function ur(e, t, n) {
|
|
753
|
-
V.set(q, {
|
|
754
|
-
kind: e,
|
|
755
|
-
id: t,
|
|
756
|
-
name: n
|
|
757
|
-
}, !0), V.set(Zt, !0);
|
|
758
|
-
}
|
|
759
|
-
function dr(e, t) {
|
|
760
|
-
V.set($t, e, !0), V.set(en, ""), V.set(rn, ""), V.set(tn, t, !0), V.set(nn, ""), V.set(an, ""), V.set(Qt, !0);
|
|
761
|
-
}
|
|
762
|
-
function fr(e, t) {
|
|
763
|
-
V.set(en, e, !0), V.set($t, ""), V.set(rn, ""), V.set(nn, t, !0), V.set(tn, ""), V.set(an, ""), V.set(Qt, !0);
|
|
764
|
-
}
|
|
765
|
-
function pr(e, t) {
|
|
766
|
-
V.set(rn, e, !0), V.set($t, ""), V.set(en, ""), V.set(an, t, !0), V.set(tn, ""), V.set(nn, ""), V.set(Qt, !0);
|
|
767
|
-
}
|
|
768
|
-
function mr() {
|
|
769
|
-
V.set(Zt, !1), V.set(q, null);
|
|
770
|
-
}
|
|
771
|
-
async function hr() {
|
|
772
|
-
let e = V.get(q);
|
|
773
|
-
e && (e.kind === "folder" ? await Je(e.id, p.fetch) : await We(e.id, p.fetch), await Z(), gt());
|
|
774
|
-
}
|
|
775
|
-
function gr() {
|
|
776
|
-
V.set(sn, "create"), V.set(J, null), V.set(on, !0);
|
|
777
|
-
}
|
|
778
|
-
function _r(e) {
|
|
779
|
-
V.set(sn, "edit"), V.set(J, e, !0), V.set(on, !0);
|
|
780
|
-
}
|
|
781
|
-
function vr(e) {
|
|
782
|
-
V.set(sn, "delete"), V.set(J, e, !0), V.set(on, !0);
|
|
783
|
-
}
|
|
784
|
-
function yr() {
|
|
785
|
-
V.get(cn) || (V.set(on, !1), V.set(J, null), V.set(cn, !1));
|
|
786
|
-
}
|
|
787
|
-
async function br(e) {
|
|
788
|
-
V.set(cn, !0);
|
|
789
|
-
try {
|
|
790
|
-
let t = {
|
|
791
|
-
name: e.name,
|
|
792
|
-
apiMode: e.apiMode,
|
|
793
|
-
apiPermissionRead: e.apiPermissionRead,
|
|
794
|
-
apiPermissionEdit: e.apiPermissionEdit,
|
|
795
|
-
apiPermissionWrite: e.apiPermissionWrite
|
|
796
|
-
}, n;
|
|
797
|
-
return n = V.get(sn) === "edit" && V.get(J) ? await Ie(`/api/categories/${encodeURIComponent(V.get(J).id)}`, {
|
|
798
|
-
method: "PATCH",
|
|
799
|
-
body: t
|
|
800
|
-
}, p.fetch) : await Ie("/api/categories", {
|
|
801
|
-
method: "POST",
|
|
802
|
-
body: t
|
|
803
|
-
}, p.fetch), await Z(), n;
|
|
804
|
-
} finally {
|
|
805
|
-
V.set(cn, !1);
|
|
806
|
-
}
|
|
807
|
-
}
|
|
808
|
-
async function xr() {
|
|
809
|
-
if (V.get(J)) {
|
|
810
|
-
V.set(cn, !0);
|
|
811
|
-
try {
|
|
812
|
-
await Re(V.get(J).id, p.fetch), await Z();
|
|
813
|
-
} finally {
|
|
814
|
-
V.set(cn, !1);
|
|
815
|
-
}
|
|
816
|
-
}
|
|
817
|
-
}
|
|
818
|
-
let $ = "__uncategorized__", Sr = V.derived(() => V.get(W).filter((e) => e.id !== $ && e.category !== null)), Cr = V.derived(() => V.get(W).find((e) => e.id === $) ?? null), wr = V.derived(() => {
|
|
819
|
-
let e = /* @__PURE__ */ new Map();
|
|
820
|
-
for (let t of V.get(C)) e.set(t.id, []);
|
|
821
|
-
let t = [];
|
|
822
|
-
for (let n of V.get(S)) n.categoryId && e.has(n.categoryId) ? e.get(n.categoryId)?.push(n) : t.push(n);
|
|
823
|
-
let n = [];
|
|
824
|
-
for (let t of V.get(C)) n.push({
|
|
825
|
-
id: t.id,
|
|
826
|
-
category: t,
|
|
827
|
-
folders: e.get(t.id) ?? []
|
|
828
|
-
});
|
|
829
|
-
return n.push({
|
|
830
|
-
id: $,
|
|
831
|
-
category: null,
|
|
832
|
-
folders: t
|
|
833
|
-
}), n;
|
|
834
|
-
});
|
|
835
|
-
var Tr = { refreshFolderTree: jn }, Er = qt(), Dr = V.first_child(Er), Or = V.child(Dr), kr = V.child(Or), Ar = V.child(kr, !0);
|
|
836
|
-
V.reset(kr);
|
|
837
|
-
var jr = V.sibling(kr, 2);
|
|
838
|
-
c(V.child(jr), { class: "size-3.5" }), V.reset(jr), V.reset(Or);
|
|
839
|
-
var Mr = V.sibling(Or, 2), Nr = (e) => {
|
|
840
|
-
var t = Rt(), n = V.child(t, !0);
|
|
841
|
-
V.reset(t), V.template_effect(() => V.set_text(n, V.get(M))), V.append(e, t);
|
|
842
|
-
};
|
|
843
|
-
V.if(Mr, (e) => {
|
|
844
|
-
V.get(M) && e(Nr);
|
|
845
|
-
});
|
|
846
|
-
var Pr = V.sibling(Mr, 2), Fr = (e) => {
|
|
847
|
-
var t = Rt(), n = V.child(t, !0);
|
|
848
|
-
V.reset(t), V.template_effect(() => V.set_text(n, V.get(N))), V.append(e, t);
|
|
849
|
-
};
|
|
850
|
-
V.if(Pr, (e) => {
|
|
851
|
-
V.get(N) && e(Fr);
|
|
852
|
-
});
|
|
853
|
-
var Ir = V.sibling(Pr, 2);
|
|
854
|
-
V.each(Ir, 29, () => V.get(Sr), (e) => `${e.id}:${e.isDndShadowItem ? "shadow" : "item"}`, (e, t) => {
|
|
855
|
-
let i = V.derived(() => V.get(O).has(V.get(t).id));
|
|
856
|
-
var o = Ut(), c = V.child(o), l = V.child(c), u = V.child(l), p = (e) => {
|
|
857
|
-
n(e, { class: "size-3.5 shrink-0" });
|
|
858
|
-
}, m = (e) => {
|
|
859
|
-
r(e, { class: "size-3.5 shrink-0" });
|
|
860
|
-
};
|
|
861
|
-
V.if(u, (e) => {
|
|
862
|
-
V.get(i) ? e(p) : e(m, -1);
|
|
863
|
-
});
|
|
864
|
-
var te = V.sibling(u, 2), y = V.child(te, !0);
|
|
865
|
-
V.reset(te), V.reset(l), h(V.sibling(l, 2), {
|
|
866
|
-
children: (e, n) => {
|
|
867
|
-
var r = Ft(), i = V.first_child(r);
|
|
868
|
-
ee(i, {
|
|
869
|
-
child: (e, t) => {
|
|
870
|
-
let n = () => (t?.()).props;
|
|
871
|
-
var r = Nt();
|
|
872
|
-
V.attribute_effect(r, (e, t) => ({
|
|
873
|
-
...n(),
|
|
874
|
-
type: "button",
|
|
875
|
-
class: "inline-flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-accent-foreground group-hover/bucket:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
876
|
-
"aria-label": e,
|
|
877
|
-
title: t
|
|
878
|
-
}), [() => T(), () => T()], void 0, void 0, "svelte-1nshngr"), _(V.child(r), { class: "size-3.5" }), V.reset(r), V.append(e, r);
|
|
879
|
-
},
|
|
880
|
-
$$slots: { child: !0 }
|
|
881
|
-
}), g(V.sibling(i, 2), {
|
|
882
|
-
align: "end",
|
|
883
|
-
children: (e, n) => {
|
|
884
|
-
var r = zt(), i = V.first_child(r);
|
|
885
|
-
v(i, {
|
|
886
|
-
onSelect: () => F(f, `/?category=${V.get(t).category.id}`),
|
|
887
|
-
children: (e, t) => {
|
|
888
|
-
V.next();
|
|
889
|
-
var n = V.text();
|
|
890
|
-
V.template_effect((e) => V.set_text(n, e), [() => ae()]), V.append(e, n);
|
|
891
|
-
},
|
|
892
|
-
$$slots: { default: !0 }
|
|
893
|
-
});
|
|
894
|
-
var a = V.sibling(i, 2);
|
|
895
|
-
v(a, {
|
|
896
|
-
onSelect: () => F(f, `/docs/new?category=${V.get(t).category.id}`),
|
|
897
|
-
children: (e, t) => {
|
|
898
|
-
V.next();
|
|
899
|
-
var n = V.text();
|
|
900
|
-
V.template_effect((e) => V.set_text(n, e), [() => ie()]), V.append(e, n);
|
|
901
|
-
},
|
|
902
|
-
$$slots: { default: !0 }
|
|
903
|
-
});
|
|
904
|
-
var o = V.sibling(a, 2);
|
|
905
|
-
v(o, {
|
|
906
|
-
onSelect: () => In(V.get(t).category.id),
|
|
907
|
-
children: (e, t) => {
|
|
908
|
-
V.next();
|
|
909
|
-
var n = V.text();
|
|
910
|
-
V.template_effect((e) => V.set_text(n, e), [() => xe()]), V.append(e, n);
|
|
911
|
-
},
|
|
912
|
-
$$slots: { default: !0 }
|
|
913
|
-
});
|
|
914
|
-
var s = V.sibling(o, 2);
|
|
915
|
-
v(s, {
|
|
916
|
-
onSelect: () => pr(V.get(t).category.id, V.get(t).category.name),
|
|
917
|
-
children: (e, t) => {
|
|
918
|
-
V.next();
|
|
919
|
-
var n = V.text();
|
|
920
|
-
V.template_effect((e) => V.set_text(n, e), [() => k()]), V.append(e, n);
|
|
921
|
-
},
|
|
922
|
-
$$slots: { default: !0 }
|
|
923
|
-
});
|
|
924
|
-
var c = V.sibling(s, 2);
|
|
925
|
-
v(c, {
|
|
926
|
-
onSelect: () => _r(V.get(t).category),
|
|
927
|
-
children: (e, t) => {
|
|
928
|
-
V.next();
|
|
929
|
-
var n = V.text();
|
|
930
|
-
V.template_effect((e) => V.set_text(n, e), [() => ye()]), V.append(e, n);
|
|
931
|
-
},
|
|
932
|
-
$$slots: { default: !0 }
|
|
933
|
-
}), v(V.sibling(c, 2), {
|
|
934
|
-
class: "text-destructive focus:text-destructive",
|
|
935
|
-
onSelect: () => vr(V.get(t).category),
|
|
936
|
-
children: (e, t) => {
|
|
937
|
-
V.next();
|
|
938
|
-
var n = V.text();
|
|
939
|
-
V.template_effect((e) => V.set_text(n, e), [() => pe()]), V.append(e, n);
|
|
940
|
-
},
|
|
941
|
-
$$slots: { default: !0 }
|
|
942
|
-
}), V.append(e, r);
|
|
943
|
-
},
|
|
944
|
-
$$slots: { default: !0 }
|
|
945
|
-
}), V.append(e, r);
|
|
946
|
-
},
|
|
947
|
-
$$slots: { default: !0 }
|
|
948
|
-
}), V.reset(c);
|
|
949
|
-
var b = V.sibling(c, 2), x = (e) => {
|
|
950
|
-
let n = V.derived(() => V.get(U)[V.get(t).id] ?? []), r = V.derived(() => V.get(kt)[V.get(t).id] ?? []);
|
|
951
|
-
var i = Ht(), o = V.child(i), c = V.derived(() => qn(V.get(t).id)), l = V.derived(() => Jn(V.get(t).id));
|
|
952
|
-
V.each(o, 29, () => V.get(n), (e) => e.id, (e, t) => {
|
|
953
|
-
var n = Bt();
|
|
954
|
-
d(V.child(n), () => V.get(t)), V.reset(n), V.animation(n, () => Dt, () => ({ duration: 200 })), V.append(e, n);
|
|
955
|
-
}), V.reset(o), V.action(o, (e, t) => Ve?.(e, t), () => ({
|
|
956
|
-
items: V.get(n),
|
|
957
|
-
flipDurationMs: 200,
|
|
958
|
-
type: "folder",
|
|
959
|
-
dropTargetStyle: {},
|
|
960
|
-
dragDisabled: V.get(L)
|
|
961
|
-
}));
|
|
962
|
-
var u = V.sibling(o, 2), f = V.derived(() => Bn({
|
|
963
|
-
kind: "category",
|
|
964
|
-
id: V.get(t).id
|
|
965
|
-
})), p = V.derived(() => Vn({
|
|
966
|
-
kind: "category",
|
|
967
|
-
id: V.get(t).id
|
|
968
|
-
}));
|
|
969
|
-
V.each(u, 29, () => V.get(r), (e) => e.id, (e, t) => {
|
|
970
|
-
var n = Vt(), r = V.child(n);
|
|
971
|
-
Mt(r, () => V.get(t));
|
|
972
|
-
var i = V.sibling(r, 2);
|
|
973
|
-
s(i, () => V.get(t)), a(V.sibling(i, 2), () => V.get(t)), V.reset(n), V.animation(n, () => Dt, () => ({ duration: 80 })), V.append(e, n);
|
|
974
|
-
}), V.reset(u), V.action(u, (e, t) => Ve?.(e, t), () => ({
|
|
975
|
-
items: V.get(r),
|
|
976
|
-
flipDurationMs: 80,
|
|
977
|
-
type: "doc",
|
|
978
|
-
dropTargetStyle: {},
|
|
979
|
-
dragDisabled: V.get(L),
|
|
980
|
-
useCursorForDetection: !0,
|
|
981
|
-
centreDraggedOnCursor: !0
|
|
982
|
-
})), V.reset(i), V.template_effect((e, t) => {
|
|
983
|
-
V.set_class(o, 1, e, "svelte-1nshngr"), V.set_class(u, 1, t, "svelte-1nshngr");
|
|
984
|
-
}, [() => V.clsx(I("min-h-[8px] space-y-0.5 transition-all duration-150", V.get(at) && V.get(n).length === 0 && "min-h-[36px] bg-accent/20 rounded border border-dashed border-muted-foreground/20")), () => V.clsx(I("min-h-[8px] space-y-0.5 transition-all duration-150", V.get(_t) && V.get(r).length === 0 && "min-h-[36px] bg-accent/20 rounded border border-dashed border-muted-foreground/20"))]), V.event("consider", o, function(...e) {
|
|
985
|
-
V.get(c)?.apply(this, e);
|
|
986
|
-
}), V.event("finalize", o, function(...e) {
|
|
987
|
-
V.get(l)?.apply(this, e);
|
|
988
|
-
}), V.event("consider", u, function(...e) {
|
|
989
|
-
V.get(f)?.apply(this, e);
|
|
990
|
-
}), V.event("finalize", u, function(...e) {
|
|
991
|
-
V.get(p)?.apply(this, e);
|
|
992
|
-
}), V.append(e, i);
|
|
993
|
-
};
|
|
994
|
-
V.if(b, (e) => {
|
|
995
|
-
V.get(i) && e(x);
|
|
996
|
-
}), V.reset(o), V.template_effect((e) => {
|
|
997
|
-
V.set_attribute(o, "data-is-dnd-shadow-item-hint", V.get(t)[Be]), V.set_attribute(l, "aria-expanded", V.get(i)), V.set_class(l, 1, e, "svelte-1nshngr"), V.set_text(y, V.get(t).category.name);
|
|
998
|
-
}, [() => V.clsx(I("flex min-w-0 flex-1 items-center gap-1.5 rounded-md px-2 py-1.5 text-xs font-medium uppercase tracking-wider text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground", V.get(B) && "hover:bg-accent/40 border border-dashed border-primary/30"))]), V.delegated("click", l, () => Nn(V.get(t).id)), V.event("mouseenter", l, () => {
|
|
999
|
-
V.get(R) && !V.get(i) && vn(V.get(t).id);
|
|
1000
|
-
}), V.event("mouseleave", l, () => {
|
|
1001
|
-
V.get(R) && _n();
|
|
1002
|
-
}), V.event("dragover", l, Un), V.event("drop", l, (e) => Wn(e, V.get(t).id)), V.animation(o, () => Dt, () => ({ duration: 200 })), V.append(e, o);
|
|
1003
|
-
}), V.reset(Ir), V.action(Ir, (e, t) => Ve?.(e, t), () => ({
|
|
1004
|
-
items: V.get(Sr),
|
|
1005
|
-
flipDurationMs: 200,
|
|
1006
|
-
type: "category",
|
|
1007
|
-
dropTargetStyle: {},
|
|
1008
|
-
dragDisabled: V.get(L)
|
|
1009
|
-
}));
|
|
1010
|
-
var Lr = V.sibling(Ir, 2), Rr = (e) => {
|
|
1011
|
-
var t = Wt(), i = V.child(t), o = V.child(i), c = V.child(o), l = (e) => {
|
|
1012
|
-
n(e, { class: "size-3.5 shrink-0" });
|
|
1013
|
-
}, u = (e) => {
|
|
1014
|
-
r(e, { class: "size-3.5 shrink-0" });
|
|
1015
|
-
};
|
|
1016
|
-
V.if(c, (e) => {
|
|
1017
|
-
V.get(A) ? e(l) : e(u, -1);
|
|
1018
|
-
});
|
|
1019
|
-
var f = V.sibling(c, 2), p = V.child(f, !0);
|
|
1020
|
-
V.reset(f), V.reset(o), V.reset(i);
|
|
1021
|
-
var m = V.sibling(i, 2), h = (e) => {
|
|
1022
|
-
let t = V.derived(() => V.get(U)[$] ?? []);
|
|
1023
|
-
var n = Ht(), r = V.child(n), i = V.derived(() => qn($)), o = V.derived(() => Jn($));
|
|
1024
|
-
V.each(r, 29, () => V.get(t), (e) => e.id, (e, t) => {
|
|
1025
|
-
var n = Bt();
|
|
1026
|
-
d(V.child(n), () => V.get(t)), V.reset(n), V.animation(n, () => Dt, () => ({ duration: 200 })), V.append(e, n);
|
|
1027
|
-
}), V.reset(r), V.action(r, (e, t) => Ve?.(e, t), () => ({
|
|
1028
|
-
items: V.get(t),
|
|
1029
|
-
flipDurationMs: 200,
|
|
1030
|
-
type: "folder",
|
|
1031
|
-
dropTargetStyle: {},
|
|
1032
|
-
dragDisabled: V.get(L)
|
|
1033
|
-
}));
|
|
1034
|
-
var c = V.sibling(r, 2), l = V.derived(() => Bn({ kind: "root" })), u = V.derived(() => Vn({ kind: "root" }));
|
|
1035
|
-
V.each(c, 29, () => V.get(H), (e) => e.id, (e, t) => {
|
|
1036
|
-
var n = Vt(), r = V.child(n);
|
|
1037
|
-
Mt(r, () => V.get(t));
|
|
1038
|
-
var i = V.sibling(r, 2);
|
|
1039
|
-
s(i, () => V.get(t)), a(V.sibling(i, 2), () => V.get(t)), V.reset(n), V.animation(n, () => Dt, () => ({ duration: 80 })), V.append(e, n);
|
|
1040
|
-
}), V.reset(c), V.action(c, (e, t) => Ve?.(e, t), () => ({
|
|
1041
|
-
items: V.get(H),
|
|
1042
|
-
flipDurationMs: 80,
|
|
1043
|
-
type: "doc",
|
|
1044
|
-
dropTargetStyle: {},
|
|
1045
|
-
dragDisabled: V.get(L),
|
|
1046
|
-
useCursorForDetection: !0,
|
|
1047
|
-
centreDraggedOnCursor: !0
|
|
1048
|
-
})), V.reset(n), V.template_effect((e, t) => {
|
|
1049
|
-
V.set_class(r, 1, e, "svelte-1nshngr"), V.set_class(c, 1, t, "svelte-1nshngr");
|
|
1050
|
-
}, [() => V.clsx(I("min-h-[8px] space-y-0.5 transition-all duration-150", V.get(at) && V.get(t).length === 0 && "min-h-[36px] bg-accent/20 rounded border border-dashed border-muted-foreground/20")), () => V.clsx(I("min-h-[8px] space-y-0.5 transition-all duration-150", V.get(_t) && V.get(H).length === 0 && "min-h-[36px] bg-accent/20 rounded border border-dashed border-muted-foreground/20"))]), V.event("consider", r, function(...e) {
|
|
1051
|
-
V.get(i)?.apply(this, e);
|
|
1052
|
-
}), V.event("finalize", r, function(...e) {
|
|
1053
|
-
V.get(o)?.apply(this, e);
|
|
1054
|
-
}), V.event("consider", c, function(...e) {
|
|
1055
|
-
V.get(l)?.apply(this, e);
|
|
1056
|
-
}), V.event("finalize", c, function(...e) {
|
|
1057
|
-
V.get(u)?.apply(this, e);
|
|
1058
|
-
}), V.append(e, n);
|
|
1059
|
-
};
|
|
1060
|
-
V.if(m, (e) => {
|
|
1061
|
-
V.get(A) && e(h);
|
|
1062
|
-
}), V.reset(t), V.template_effect((e, t) => {
|
|
1063
|
-
V.set_attribute(o, "aria-expanded", V.get(A)), V.set_class(o, 1, e, "svelte-1nshngr"), V.set_text(p, t);
|
|
1064
|
-
}, [() => V.clsx(I("flex min-w-0 flex-1 items-center gap-1.5 rounded-md px-2 py-1.5 text-xs font-medium uppercase tracking-wider text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground", V.get(B) && "hover:bg-accent/40 border border-dashed border-primary/30")), () => he()]), V.delegated("click", o, Pn), V.event("mouseenter", o, () => {
|
|
1065
|
-
V.get(R) && !V.get(A) && vn($);
|
|
1066
|
-
}), V.event("mouseleave", o, () => {
|
|
1067
|
-
V.get(R) && _n();
|
|
1068
|
-
}), V.event("dragover", o, Un), V.event("drop", o, (e) => Wn(e, $)), V.append(e, t);
|
|
1069
|
-
};
|
|
1070
|
-
V.if(Lr, (e) => {
|
|
1071
|
-
V.get(Cr) && e(Rr);
|
|
1072
|
-
});
|
|
1073
|
-
var zr = V.sibling(Lr, 2), Br = V.child(zr);
|
|
1074
|
-
c(Br, { class: "size-3.5" });
|
|
1075
|
-
var Vr = V.sibling(Br, 2), Hr = V.child(Vr, !0);
|
|
1076
|
-
V.reset(Vr), V.reset(zr), V.reset(Dr);
|
|
1077
|
-
var Ur = V.sibling(Dr, 2);
|
|
1078
|
-
l(Ur, {
|
|
1079
|
-
mode: "create",
|
|
1080
|
-
onSave: Rn,
|
|
1081
|
-
closeOnSave: !1,
|
|
1082
|
-
get open() {
|
|
1083
|
-
return V.get(At);
|
|
1084
|
-
},
|
|
1085
|
-
set open(e) {
|
|
1086
|
-
V.set(At, e, !0);
|
|
1087
|
-
}
|
|
1088
|
-
});
|
|
1089
|
-
var Wr = V.sibling(Ur, 2);
|
|
1090
|
-
Ae(Wr, {
|
|
1091
|
-
onOpenChange: (e) => {
|
|
1092
|
-
e || cr();
|
|
1093
|
-
},
|
|
1094
|
-
get open() {
|
|
1095
|
-
return V.get(Jt);
|
|
1096
|
-
},
|
|
1097
|
-
set open(e) {
|
|
1098
|
-
V.set(Jt, e, !0);
|
|
1099
|
-
},
|
|
1100
|
-
children: (e, t) => {
|
|
1101
|
-
De(e, {
|
|
1102
|
-
children: (e, t) => {
|
|
1103
|
-
var n = Kt(), r = V.first_child(n);
|
|
1104
|
-
ke(r, {
|
|
1105
|
-
children: (e, t) => {
|
|
1106
|
-
var n = Ft(), r = V.first_child(n);
|
|
1107
|
-
Ne(r, {
|
|
1108
|
-
children: (e, t) => {
|
|
1109
|
-
V.next();
|
|
1110
|
-
var n = V.text();
|
|
1111
|
-
V.template_effect((e) => V.set_text(n, e), [() => ce()]), V.append(e, n);
|
|
1112
|
-
},
|
|
1113
|
-
$$slots: { default: !0 }
|
|
1114
|
-
}), Oe(V.sibling(r, 2), {
|
|
1115
|
-
children: (e, t) => {
|
|
1116
|
-
V.next();
|
|
1117
|
-
var n = V.text();
|
|
1118
|
-
V.template_effect((e) => V.set_text(n, e), [() => V.get(Yt)?.kind === "folder" ? fe() : ue()]), V.append(e, n);
|
|
1119
|
-
},
|
|
1120
|
-
$$slots: { default: !0 }
|
|
1121
|
-
}), V.append(e, n);
|
|
1122
|
-
},
|
|
1123
|
-
$$slots: { default: !0 }
|
|
1124
|
-
});
|
|
1125
|
-
var i = V.sibling(r, 2), a = V.child(i), o = V.child(a);
|
|
1126
|
-
Fe(o, {
|
|
1127
|
-
for: "rename-input",
|
|
1128
|
-
children: (e, t) => {
|
|
1129
|
-
V.next();
|
|
1130
|
-
var n = V.text();
|
|
1131
|
-
V.template_effect((e) => V.set_text(n, e), [() => V.get(Yt)?.kind === "folder" ? fe() : ue()]), V.append(e, n);
|
|
1132
|
-
},
|
|
1133
|
-
$$slots: { default: !0 }
|
|
1134
|
-
});
|
|
1135
|
-
var s = V.sibling(o, 2);
|
|
1136
|
-
{
|
|
1137
|
-
let e = V.derived(() => V.get(G) ? "true" : void 0), t = V.derived(() => V.get(G) ? "rename-input-error" : void 0);
|
|
1138
|
-
Pe(s, {
|
|
1139
|
-
id: "rename-input",
|
|
1140
|
-
name: "name",
|
|
1141
|
-
type: "text",
|
|
1142
|
-
maxlength: 255,
|
|
1143
|
-
required: !0,
|
|
1144
|
-
get disabled() {
|
|
1145
|
-
return V.get(K);
|
|
1146
|
-
},
|
|
1147
|
-
get "aria-invalid"() {
|
|
1148
|
-
return V.get(e);
|
|
1149
|
-
},
|
|
1150
|
-
get "aria-describedby"() {
|
|
1151
|
-
return V.get(t);
|
|
1152
|
-
},
|
|
1153
|
-
autocomplete: "off",
|
|
1154
|
-
get value() {
|
|
1155
|
-
return V.get(Xt);
|
|
1156
|
-
},
|
|
1157
|
-
set value(e) {
|
|
1158
|
-
V.set(Xt, e, !0);
|
|
1159
|
-
}
|
|
1160
|
-
});
|
|
1161
|
-
}
|
|
1162
|
-
var c = V.sibling(s, 2), l = (e) => {
|
|
1163
|
-
var t = Gt(), n = V.child(t, !0);
|
|
1164
|
-
V.reset(t), V.template_effect(() => V.set_text(n, V.get(G))), V.append(e, t);
|
|
1165
|
-
};
|
|
1166
|
-
V.if(c, (e) => {
|
|
1167
|
-
V.get(G) && e(l);
|
|
1168
|
-
}), V.reset(a), V.reset(i), je(V.sibling(i, 2), {
|
|
1169
|
-
children: (e, t) => {
|
|
1170
|
-
var n = Ft(), r = V.first_child(n);
|
|
1171
|
-
Me(r, {
|
|
1172
|
-
variant: "outline",
|
|
1173
|
-
type: "button",
|
|
1174
|
-
onclick: cr,
|
|
1175
|
-
get disabled() {
|
|
1176
|
-
return V.get(K);
|
|
1177
|
-
},
|
|
1178
|
-
children: (e, t) => {
|
|
1179
|
-
V.next();
|
|
1180
|
-
var n = V.text();
|
|
1181
|
-
V.template_effect((e) => V.set_text(n, e), [() => ve()]), V.append(e, n);
|
|
1182
|
-
},
|
|
1183
|
-
$$slots: { default: !0 }
|
|
1184
|
-
});
|
|
1185
|
-
var i = V.sibling(r, 2);
|
|
1186
|
-
{
|
|
1187
|
-
let e = V.derived(() => V.get(K) || V.get(Xt).trim().length === 0);
|
|
1188
|
-
Me(i, {
|
|
1189
|
-
type: "submit",
|
|
1190
|
-
onclick: lr,
|
|
1191
|
-
get disabled() {
|
|
1192
|
-
return V.get(e);
|
|
1193
|
-
},
|
|
1194
|
-
children: (e, t) => {
|
|
1195
|
-
V.next();
|
|
1196
|
-
var n = V.text();
|
|
1197
|
-
V.template_effect((e) => V.set_text(n, e), [() => V.get(K) ? oe() : le()]), V.append(e, n);
|
|
1198
|
-
},
|
|
1199
|
-
$$slots: { default: !0 }
|
|
1200
|
-
});
|
|
1201
|
-
}
|
|
1202
|
-
V.append(e, n);
|
|
1203
|
-
},
|
|
1204
|
-
$$slots: { default: !0 }
|
|
1205
|
-
}), V.event("submit", i, lr), V.append(e, n);
|
|
1206
|
-
},
|
|
1207
|
-
$$slots: { default: !0 }
|
|
1208
|
-
});
|
|
1209
|
-
},
|
|
1210
|
-
$$slots: { default: !0 }
|
|
1211
|
-
});
|
|
1212
|
-
var Gr = V.sibling(Wr, 2);
|
|
1213
|
-
{
|
|
1214
|
-
let e = V.derived(() => V.get(q)?.name ?? ""), t = V.derived(() => V.get(q)?.kind === "folder" ? ge() : Ce()), n = V.derived(() => V.get(q)?.kind === "folder" ? "Its documents will be moved to the root and will not be deleted." : de()), r = V.derived(() => V.get(q)?.kind === "folder" ? se() : re()), i = V.derived(() => V.get(q)?.kind === "folder" ? be() : b()), a = V.derived(() => pe()), o = V.derived(() => ve());
|
|
1215
|
-
Ze(Gr, {
|
|
1216
|
-
get targetName() {
|
|
1217
|
-
return V.get(e);
|
|
1218
|
-
},
|
|
1219
|
-
get title() {
|
|
1220
|
-
return V.get(t);
|
|
1221
|
-
},
|
|
1222
|
-
get description() {
|
|
1223
|
-
return V.get(n);
|
|
1224
|
-
},
|
|
1225
|
-
get successTitle() {
|
|
1226
|
-
return V.get(r);
|
|
1227
|
-
},
|
|
1228
|
-
get successDescription() {
|
|
1229
|
-
return V.get(i);
|
|
1230
|
-
},
|
|
1231
|
-
get confirmLabel() {
|
|
1232
|
-
return V.get(a);
|
|
1233
|
-
},
|
|
1234
|
-
get cancelLabel() {
|
|
1235
|
-
return V.get(o);
|
|
1236
|
-
},
|
|
1237
|
-
onConfirm: hr,
|
|
1238
|
-
onCancel: mr,
|
|
1239
|
-
get open() {
|
|
1240
|
-
return V.get(Zt);
|
|
1241
|
-
},
|
|
1242
|
-
set open(e) {
|
|
1243
|
-
V.set(Zt, e, !0);
|
|
1244
|
-
}
|
|
1245
|
-
});
|
|
1246
|
-
}
|
|
1247
|
-
var Kr = V.sibling(Gr, 2);
|
|
1248
|
-
{
|
|
1249
|
-
let e = V.derived(() => V.get(J) ?? void 0);
|
|
1250
|
-
et(Kr, {
|
|
1251
|
-
get mode() {
|
|
1252
|
-
return V.get(sn);
|
|
1253
|
-
},
|
|
1254
|
-
get category() {
|
|
1255
|
-
return V.get(e);
|
|
1256
|
-
},
|
|
1257
|
-
onSave: br,
|
|
1258
|
-
onDelete: xr,
|
|
1259
|
-
onClose: yr,
|
|
1260
|
-
get open() {
|
|
1261
|
-
return V.get(on);
|
|
1262
|
-
},
|
|
1263
|
-
set open(e) {
|
|
1264
|
-
V.set(on, e, !0);
|
|
1265
|
-
}
|
|
1266
|
-
});
|
|
1267
|
-
}
|
|
1268
|
-
return Qe(V.sibling(Kr, 2), {
|
|
1269
|
-
get displayMode() {
|
|
1270
|
-
return m.displayMode;
|
|
1271
|
-
},
|
|
1272
|
-
get documentId() {
|
|
1273
|
-
return V.get($t);
|
|
1274
|
-
},
|
|
1275
|
-
get documentTitle() {
|
|
1276
|
-
return V.get(tn);
|
|
1277
|
-
},
|
|
1278
|
-
get folderId() {
|
|
1279
|
-
return V.get(en);
|
|
1280
|
-
},
|
|
1281
|
-
get folderName() {
|
|
1282
|
-
return V.get(nn);
|
|
1283
|
-
},
|
|
1284
|
-
get categoryId() {
|
|
1285
|
-
return V.get(rn);
|
|
1286
|
-
},
|
|
1287
|
-
get categoryName() {
|
|
1288
|
-
return V.get(an);
|
|
1289
|
-
},
|
|
1290
|
-
get open() {
|
|
1291
|
-
return V.get(Qt);
|
|
1292
|
-
},
|
|
1293
|
-
set open(e) {
|
|
1294
|
-
V.set(Qt, e, !0);
|
|
1295
|
-
}
|
|
1296
|
-
}), V.template_effect((e, t, n, r, i, a) => {
|
|
1297
|
-
V.set_attribute(kr, "href", e), V.set_attribute(kr, "title", t), V.set_text(Ar, n), V.set_attribute(jr, "aria-label", r), V.set_attribute(jr, "title", i), V.set_text(Hr, a);
|
|
1298
|
-
}, [
|
|
1299
|
-
() => Te(f, "/"),
|
|
1300
|
-
() => w(),
|
|
1301
|
-
() => j(),
|
|
1302
|
-
() => Se(),
|
|
1303
|
-
() => Se(),
|
|
1304
|
-
() => xe()
|
|
1305
|
-
]), V.delegated("click", jr, gr), V.event("consider", Ir, er), V.event("finalize", Ir, tr), V.delegated("click", zr, Fn), V.append(e, Er), V.pop(Tr);
|
|
1306
|
-
}
|
|
1307
|
-
V.delegate(["click"]);
|
|
1308
|
-
//#endregion
|
|
1309
|
-
//#region src/lib/components/sidebar/RecentDocs.svelte
|
|
1310
|
-
var Yt = V.from_html("<p class=\"px-2 text-xs text-destructive\"> </p>"), Xt = V.from_html("<button><!></button>"), G = V.from_html("<!> <!> <!>", 1), K = V.from_html("<!> <!>", 1), Zt = V.from_html("<div class=\"group/doc flex min-w-0 items-center gap-1\"><a><!> <div class=\"min-w-0 flex-1\"><p class=\"truncate min-w-0\"> </p> <p class=\"text-xs text-muted-foreground\"> </p></div></a> <button type=\"button\"><!></button> <!></div>"), q = V.from_html("<p id=\"recent-rename-input-error\" class=\"text-xs text-destructive\" role=\"alert\"> </p>"), Qt = V.from_html("<!> <form class=\"space-y-4\"><div class=\"space-y-2\"><!> <!> <!></div></form> <!>", 1), $t = V.from_html("<div class=\"space-y-1\"><h3 class=\"mb-2 px-2 text-xs font-medium uppercase tracking-wider text-muted-foreground\"> </h3> <!> <!></div> <!> <!> <!>", 1);
|
|
1311
|
-
function en(e, n) {
|
|
1312
|
-
V.push(n, !0);
|
|
1313
|
-
let r = we(), i = u(), a = V.state(V.proxy([])), c = V.state(null), l = V.state(null), d = V.state(null), f = V.state(null), p = null, m = V.state(!1), y = V.state(null), b = V.state(""), x = V.state(null), S = V.state(!1), w = V.state(!1), E = V.state(null), D = V.state(!1), re = V.state(!1), ie = V.state(""), O = V.state("");
|
|
1314
|
-
function A(e, t) {
|
|
1315
|
-
V.set(ie, e, !0), V.set(O, t, !0), V.set(re, !0);
|
|
1316
|
-
}
|
|
1317
|
-
async function j() {
|
|
1318
|
-
try {
|
|
1319
|
-
let e = z(), t = await Ge({
|
|
1320
|
-
limit: 6,
|
|
1321
|
-
...e ? { tag: e } : {}
|
|
1322
|
-
}, r.fetch);
|
|
1323
|
-
V.set(a, t.items, !0), V.set(l, null);
|
|
1324
|
-
} catch (e) {
|
|
1325
|
-
console.error("RecentDocs: failed to load recent documents", e), V.set(l, "Failed to load recent documents");
|
|
1326
|
-
}
|
|
1327
|
-
}
|
|
1328
|
-
Tt(() => {
|
|
1329
|
-
j();
|
|
1330
|
-
}), V.user_effect(() => {
|
|
1331
|
-
yt() !== 0 && j();
|
|
1332
|
-
});
|
|
1333
|
-
let ae = !0;
|
|
1334
|
-
V.user_effect(() => {
|
|
1335
|
-
if (z(), ae) {
|
|
1336
|
-
ae = !1;
|
|
1337
|
-
return;
|
|
1338
|
-
}
|
|
1339
|
-
j();
|
|
1340
|
-
});
|
|
1341
|
-
async function M() {
|
|
1342
|
-
await j();
|
|
1343
|
-
}
|
|
1344
|
-
wt(() => {
|
|
1345
|
-
p &&= (clearTimeout(p), null);
|
|
1346
|
-
});
|
|
1347
|
-
async function N(e, t) {
|
|
1348
|
-
if (e.preventDefault(), e.stopPropagation(), typeof window > "u") return;
|
|
1349
|
-
let n = V.get(a).find((e) => e.id === t), i = "";
|
|
1350
|
-
V.set(f, t, !0);
|
|
1351
|
-
try {
|
|
1352
|
-
i = (await Ue(t, r.fetch)).content ?? "";
|
|
1353
|
-
} catch (e) {
|
|
1354
|
-
console.error("RecentDocs: failed to fetch full document for copy", e), i = n?.excerpt ?? n?.content ?? "";
|
|
1355
|
-
} finally {
|
|
1356
|
-
V.set(f, null);
|
|
1357
|
-
}
|
|
1358
|
-
i && await $e(i) && (V.set(d, t, !0), p && clearTimeout(p), p = setTimeout(() => {
|
|
1359
|
-
V.set(d, null), p = null;
|
|
1360
|
-
}, 2e3));
|
|
1361
|
-
}
|
|
1362
|
-
function se(e, t) {
|
|
1363
|
-
V.set(y, {
|
|
1364
|
-
id: e,
|
|
1365
|
-
title: t
|
|
1366
|
-
}, !0), V.set(b, t, !0), V.set(x, null), V.set(m, !0);
|
|
1367
|
-
}
|
|
1368
|
-
function P() {
|
|
1369
|
-
V.set(m, !1), V.set(y, null), V.set(b, ""), V.set(x, null), V.set(S, !1);
|
|
1370
|
-
}
|
|
1371
|
-
async function fe(e) {
|
|
1372
|
-
e?.preventDefault();
|
|
1373
|
-
let t = V.get(y);
|
|
1374
|
-
if (!t) return;
|
|
1375
|
-
let n = V.get(b).trim();
|
|
1376
|
-
if (n.length === 0) {
|
|
1377
|
-
V.set(x, "Name is required");
|
|
1378
|
-
return;
|
|
1379
|
-
}
|
|
1380
|
-
V.set(S, !0);
|
|
1381
|
-
try {
|
|
1382
|
-
await He(t.id, { title: n }, r.fetch), P(), await j(), gt();
|
|
1383
|
-
} catch (e) {
|
|
1384
|
-
console.error("RecentDocs: rename failed", e), V.set(x, e instanceof Error ? e.message : me(), !0);
|
|
1385
|
-
} finally {
|
|
1386
|
-
V.set(S, !1);
|
|
1387
|
-
}
|
|
1388
|
-
}
|
|
1389
|
-
function he(e, t) {
|
|
1390
|
-
V.set(E, {
|
|
1391
|
-
id: e,
|
|
1392
|
-
title: t
|
|
1393
|
-
}, !0), V.set(w, !0);
|
|
1394
|
-
}
|
|
1395
|
-
function ge() {
|
|
1396
|
-
V.set(w, !1), V.set(E, null), V.set(D, !1);
|
|
1397
|
-
}
|
|
1398
|
-
async function _e() {
|
|
1399
|
-
let e = V.get(E);
|
|
1400
|
-
if (!(!e || V.get(D))) {
|
|
1401
|
-
V.set(D, !0);
|
|
1402
|
-
try {
|
|
1403
|
-
await We(e.id, r.fetch), ge(), await j(), gt();
|
|
1404
|
-
} catch (e) {
|
|
1405
|
-
console.error("RecentDocs: delete failed", e), V.set(l, e instanceof Error ? e.message : me(), !0), V.set(D, !1);
|
|
1406
|
-
}
|
|
1407
|
-
}
|
|
1408
|
-
}
|
|
1409
|
-
var ye = { refreshRecentDocs: M }, be = $t(), xe = V.first_child(be), Se = V.child(xe), Te = V.child(Se, !0);
|
|
1410
|
-
V.reset(Se);
|
|
1411
|
-
var F = V.sibling(Se, 2), Ee = (e) => {
|
|
1412
|
-
var t = Yt(), n = V.child(t, !0);
|
|
1413
|
-
V.reset(t), V.template_effect(() => V.set_text(n, V.get(l))), V.append(e, t);
|
|
1414
|
-
};
|
|
1415
|
-
V.if(F, (e) => {
|
|
1416
|
-
V.get(l) && e(Ee);
|
|
1417
|
-
});
|
|
1418
|
-
var Ie = V.sibling(F, 2);
|
|
1419
|
-
V.each(Ie, 17, () => V.get(a), (e) => e.id, (e, n) => {
|
|
1420
|
-
var r = Zt(), i = V.child(r), a = V.child(i);
|
|
1421
|
-
s(a, { class: "size-4 shrink-0 text-muted-foreground" });
|
|
1422
|
-
var l = V.sibling(a, 2), u = V.child(l), p = V.child(u, !0);
|
|
1423
|
-
V.reset(u);
|
|
1424
|
-
var m = V.sibling(u, 2), y = V.child(m, !0);
|
|
1425
|
-
V.reset(m), V.reset(l), V.reset(i);
|
|
1426
|
-
var b = V.sibling(i, 2), x = V.child(b), S = (e) => {
|
|
1427
|
-
te(e, { class: "size-3.5 animate-spin" });
|
|
1428
|
-
}, C = (e) => {
|
|
1429
|
-
t(e, { class: "size-3.5" });
|
|
1430
|
-
}, w = (e) => {
|
|
1431
|
-
o(e, { class: "size-3.5" });
|
|
1432
|
-
};
|
|
1433
|
-
V.if(x, (e) => {
|
|
1434
|
-
V.get(f) === V.get(n).id ? e(S) : V.get(d) === V.get(n).id ? e(C, 1) : e(w, -1);
|
|
1435
|
-
}), V.reset(b), h(V.sibling(b, 2), {
|
|
1436
|
-
children: (e, t) => {
|
|
1437
|
-
var r = K(), i = V.first_child(r);
|
|
1438
|
-
ee(i, {
|
|
1439
|
-
child: (e, t) => {
|
|
1440
|
-
let n = () => (t?.()).props;
|
|
1441
|
-
var r = Xt(), i = (e) => {
|
|
1442
|
-
e.preventDefault(), e.stopPropagation();
|
|
1443
|
-
};
|
|
1444
|
-
V.attribute_effect(r, (e, t) => ({
|
|
1445
|
-
...n(),
|
|
1446
|
-
type: "button",
|
|
1447
|
-
class: "sidebar-touch-action inline-flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-accent-foreground group-hover/doc:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
1448
|
-
"aria-label": e,
|
|
1449
|
-
title: t,
|
|
1450
|
-
onclick: i
|
|
1451
|
-
}), [() => T(), () => T()], void 0, void 0, "svelte-1uwxs9f"), _(V.child(r), { class: "size-3.5" }), V.reset(r), V.append(e, r);
|
|
1452
|
-
},
|
|
1453
|
-
$$slots: { child: !0 }
|
|
1454
|
-
}), g(V.sibling(i, 2), {
|
|
1455
|
-
align: "end",
|
|
1456
|
-
children: (e, t) => {
|
|
1457
|
-
var r = G(), i = V.first_child(r);
|
|
1458
|
-
v(i, {
|
|
1459
|
-
onSelect: () => se(V.get(n).id, V.get(n).title),
|
|
1460
|
-
children: (e, t) => {
|
|
1461
|
-
V.next();
|
|
1462
|
-
var n = V.text();
|
|
1463
|
-
V.template_effect((e) => V.set_text(n, e), [() => ce()]), V.append(e, n);
|
|
1464
|
-
},
|
|
1465
|
-
$$slots: { default: !0 }
|
|
1466
|
-
});
|
|
1467
|
-
var a = V.sibling(i, 2);
|
|
1468
|
-
v(a, {
|
|
1469
|
-
onSelect: () => A(V.get(n).id, V.get(n).title),
|
|
1470
|
-
children: (e, t) => {
|
|
1471
|
-
V.next();
|
|
1472
|
-
var n = V.text();
|
|
1473
|
-
V.template_effect((e) => V.set_text(n, e), [() => k()]), V.append(e, n);
|
|
1474
|
-
},
|
|
1475
|
-
$$slots: { default: !0 }
|
|
1476
|
-
}), v(V.sibling(a, 2), {
|
|
1477
|
-
class: "text-destructive focus:text-destructive",
|
|
1478
|
-
onSelect: () => he(V.get(n).id, V.get(n).title),
|
|
1479
|
-
children: (e, t) => {
|
|
1480
|
-
V.next();
|
|
1481
|
-
var n = V.text();
|
|
1482
|
-
V.template_effect((e) => V.set_text(n, e), [() => pe()]), V.append(e, n);
|
|
1483
|
-
},
|
|
1484
|
-
$$slots: { default: !0 }
|
|
1485
|
-
}), V.append(e, r);
|
|
1486
|
-
},
|
|
1487
|
-
$$slots: { default: !0 }
|
|
1488
|
-
}), V.append(e, r);
|
|
1489
|
-
},
|
|
1490
|
-
$$slots: { default: !0 }
|
|
1491
|
-
}), V.reset(r), V.template_effect((e, t, r) => {
|
|
1492
|
-
V.set_attribute(i, "href", `/docs/${V.get(n).id}`), V.set_class(i, 1, e, "svelte-1uwxs9f"), V.set_text(p, V.get(n).title), V.set_text(y, V.get(n).updatedAt), V.set_class(b, 1, `sidebar-touch-action inline-flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-accent-foreground group-hover/doc:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${V.get(d) === V.get(n).id || V.get(f) === V.get(n).id ? "opacity-100" : ""}`, "svelte-1uwxs9f"), V.set_attribute(b, "aria-label", t), V.set_attribute(b, "title", r), b.disabled = V.get(f) === V.get(n).id;
|
|
1493
|
-
}, [
|
|
1494
|
-
() => V.clsx(I("flex min-w-0 flex-1 items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors hover:bg-accent hover:text-accent-foreground", V.get(c) === V.get(n).id && "bg-accent text-accent-foreground")),
|
|
1495
|
-
() => ne(),
|
|
1496
|
-
() => ne()
|
|
1497
|
-
]), V.delegated("click", i, () => {
|
|
1498
|
-
V.set(c, V.get(n).id, !0);
|
|
1499
|
-
}), V.delegated("click", b, (e) => void N(e, V.get(n).id)), V.append(e, r);
|
|
1500
|
-
}), V.reset(xe);
|
|
1501
|
-
var Le = V.sibling(xe, 2);
|
|
1502
|
-
Ae(Le, {
|
|
1503
|
-
onOpenChange: (e) => {
|
|
1504
|
-
e || P();
|
|
1505
|
-
},
|
|
1506
|
-
get open() {
|
|
1507
|
-
return V.get(m);
|
|
1508
|
-
},
|
|
1509
|
-
set open(e) {
|
|
1510
|
-
V.set(m, e, !0);
|
|
1511
|
-
},
|
|
1512
|
-
children: (e, t) => {
|
|
1513
|
-
De(e, {
|
|
1514
|
-
children: (e, t) => {
|
|
1515
|
-
var n = Qt(), r = V.first_child(n);
|
|
1516
|
-
ke(r, {
|
|
1517
|
-
children: (e, t) => {
|
|
1518
|
-
var n = K(), r = V.first_child(n);
|
|
1519
|
-
Ne(r, {
|
|
1520
|
-
children: (e, t) => {
|
|
1521
|
-
V.next();
|
|
1522
|
-
var n = V.text();
|
|
1523
|
-
V.template_effect((e) => V.set_text(n, e), [() => ce()]), V.append(e, n);
|
|
1524
|
-
},
|
|
1525
|
-
$$slots: { default: !0 }
|
|
1526
|
-
}), Oe(V.sibling(r, 2), {
|
|
1527
|
-
children: (e, t) => {
|
|
1528
|
-
V.next();
|
|
1529
|
-
var n = V.text();
|
|
1530
|
-
V.template_effect((e) => V.set_text(n, e), [() => ue()]), V.append(e, n);
|
|
1531
|
-
},
|
|
1532
|
-
$$slots: { default: !0 }
|
|
1533
|
-
}), V.append(e, n);
|
|
1534
|
-
},
|
|
1535
|
-
$$slots: { default: !0 }
|
|
1536
|
-
});
|
|
1537
|
-
var i = V.sibling(r, 2), a = V.child(i), o = V.child(a);
|
|
1538
|
-
Fe(o, {
|
|
1539
|
-
for: "recent-rename-input",
|
|
1540
|
-
children: (e, t) => {
|
|
1541
|
-
V.next();
|
|
1542
|
-
var n = V.text();
|
|
1543
|
-
V.template_effect((e) => V.set_text(n, e), [() => ue()]), V.append(e, n);
|
|
1544
|
-
},
|
|
1545
|
-
$$slots: { default: !0 }
|
|
1546
|
-
});
|
|
1547
|
-
var s = V.sibling(o, 2);
|
|
1548
|
-
{
|
|
1549
|
-
let e = V.derived(() => V.get(x) ? "true" : void 0), t = V.derived(() => V.get(x) ? "recent-rename-input-error" : void 0);
|
|
1550
|
-
Pe(s, {
|
|
1551
|
-
id: "recent-rename-input",
|
|
1552
|
-
name: "name",
|
|
1553
|
-
type: "text",
|
|
1554
|
-
maxlength: 255,
|
|
1555
|
-
required: !0,
|
|
1556
|
-
get disabled() {
|
|
1557
|
-
return V.get(S);
|
|
1558
|
-
},
|
|
1559
|
-
get "aria-invalid"() {
|
|
1560
|
-
return V.get(e);
|
|
1561
|
-
},
|
|
1562
|
-
get "aria-describedby"() {
|
|
1563
|
-
return V.get(t);
|
|
1564
|
-
},
|
|
1565
|
-
autocomplete: "off",
|
|
1566
|
-
get value() {
|
|
1567
|
-
return V.get(b);
|
|
1568
|
-
},
|
|
1569
|
-
set value(e) {
|
|
1570
|
-
V.set(b, e, !0);
|
|
1571
|
-
}
|
|
1572
|
-
});
|
|
1573
|
-
}
|
|
1574
|
-
var c = V.sibling(s, 2), l = (e) => {
|
|
1575
|
-
var t = q(), n = V.child(t, !0);
|
|
1576
|
-
V.reset(t), V.template_effect(() => V.set_text(n, V.get(x))), V.append(e, t);
|
|
1577
|
-
};
|
|
1578
|
-
V.if(c, (e) => {
|
|
1579
|
-
V.get(x) && e(l);
|
|
1580
|
-
}), V.reset(a), V.reset(i), je(V.sibling(i, 2), {
|
|
1581
|
-
children: (e, t) => {
|
|
1582
|
-
var n = K(), r = V.first_child(n);
|
|
1583
|
-
Me(r, {
|
|
1584
|
-
variant: "outline",
|
|
1585
|
-
type: "button",
|
|
1586
|
-
onclick: P,
|
|
1587
|
-
get disabled() {
|
|
1588
|
-
return V.get(S);
|
|
1589
|
-
},
|
|
1590
|
-
children: (e, t) => {
|
|
1591
|
-
V.next();
|
|
1592
|
-
var n = V.text();
|
|
1593
|
-
V.template_effect((e) => V.set_text(n, e), [() => ve()]), V.append(e, n);
|
|
1594
|
-
},
|
|
1595
|
-
$$slots: { default: !0 }
|
|
1596
|
-
});
|
|
1597
|
-
var i = V.sibling(r, 2);
|
|
1598
|
-
{
|
|
1599
|
-
let e = V.derived(() => V.get(S) || V.get(b).trim().length === 0);
|
|
1600
|
-
Me(i, {
|
|
1601
|
-
type: "submit",
|
|
1602
|
-
onclick: fe,
|
|
1603
|
-
get disabled() {
|
|
1604
|
-
return V.get(e);
|
|
1605
|
-
},
|
|
1606
|
-
children: (e, t) => {
|
|
1607
|
-
V.next();
|
|
1608
|
-
var n = V.text();
|
|
1609
|
-
V.template_effect((e) => V.set_text(n, e), [() => V.get(S) ? oe() : le()]), V.append(e, n);
|
|
1610
|
-
},
|
|
1611
|
-
$$slots: { default: !0 }
|
|
1612
|
-
});
|
|
1613
|
-
}
|
|
1614
|
-
V.append(e, n);
|
|
1615
|
-
},
|
|
1616
|
-
$$slots: { default: !0 }
|
|
1617
|
-
}), V.event("submit", i, fe), V.append(e, n);
|
|
1618
|
-
},
|
|
1619
|
-
$$slots: { default: !0 }
|
|
1620
|
-
});
|
|
1621
|
-
},
|
|
1622
|
-
$$slots: { default: !0 }
|
|
1623
|
-
});
|
|
1624
|
-
var Re = V.sibling(Le, 2);
|
|
1625
|
-
{
|
|
1626
|
-
let e = V.derived(() => Ce()), t = V.derived(() => de()), n = V.derived(() => pe()), r = V.derived(() => ve());
|
|
1627
|
-
bt(Re, {
|
|
1628
|
-
get title() {
|
|
1629
|
-
return V.get(e);
|
|
1630
|
-
},
|
|
1631
|
-
get description() {
|
|
1632
|
-
return V.get(t);
|
|
1633
|
-
},
|
|
1634
|
-
get confirmLabel() {
|
|
1635
|
-
return V.get(n);
|
|
1636
|
-
},
|
|
1637
|
-
get cancelLabel() {
|
|
1638
|
-
return V.get(r);
|
|
1639
|
-
},
|
|
1640
|
-
variant: "destructive",
|
|
1641
|
-
get busy() {
|
|
1642
|
-
return V.get(D);
|
|
1643
|
-
},
|
|
1644
|
-
onConfirm: _e,
|
|
1645
|
-
onCancel: ge,
|
|
1646
|
-
get open() {
|
|
1647
|
-
return V.get(w);
|
|
1648
|
-
},
|
|
1649
|
-
set open(e) {
|
|
1650
|
-
V.set(w, e, !0);
|
|
1651
|
-
}
|
|
1652
|
-
});
|
|
1653
|
-
}
|
|
1654
|
-
return Qe(V.sibling(Re, 2), {
|
|
1655
|
-
get displayMode() {
|
|
1656
|
-
return i.displayMode;
|
|
1657
|
-
},
|
|
1658
|
-
get documentId() {
|
|
1659
|
-
return V.get(ie);
|
|
1660
|
-
},
|
|
1661
|
-
get documentTitle() {
|
|
1662
|
-
return V.get(O);
|
|
1663
|
-
},
|
|
1664
|
-
get open() {
|
|
1665
|
-
return V.get(re);
|
|
1666
|
-
},
|
|
1667
|
-
set open(e) {
|
|
1668
|
-
V.set(re, e, !0);
|
|
1669
|
-
}
|
|
1670
|
-
}), V.template_effect((e) => V.set_text(Te, e), [() => C()]), V.append(e, be), V.pop(ye);
|
|
1671
|
-
}
|
|
1672
|
-
V.delegate(["click"]);
|
|
1673
|
-
//#endregion
|
|
1674
|
-
//#region src/lib/components/sidebar/TagList.svelte
|
|
1675
|
-
var tn = V.from_html("<p class=\"px-2 text-xs text-destructive\"> </p>"), nn = V.from_html("<button><!></button>"), rn = V.from_html("<!> <!>", 1), an = V.from_html("<div><button type=\"button\" class=\"inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium\"><span class=\"size-2.5 shrink-0 rounded-full\"></span> </button> <!></div>"), on = V.from_html("<div class=\"space-y-1\"><h3 class=\"mb-2 px-2 text-xs font-medium uppercase tracking-wider text-muted-foreground\"> </h3> <!> <div class=\"flex flex-wrap gap-1 px-2\"><!> <button type=\"button\" class=\"inline-flex items-center gap-0.5 rounded-full px-2 py-0.5 text-xs text-muted-foreground transition-colors hover:bg-secondary hover:text-secondary-foreground\"><!> </button></div></div> <!> <!>", 1);
|
|
1676
|
-
function sn(e, t) {
|
|
1677
|
-
V.push(t, !0);
|
|
1678
|
-
let n = we(), r = V.state(V.proxy([])), i = V.state(null), a = V.state(!1), o = V.state(null), s = V.state(!1), l = V.state(null), u = V.state(!1);
|
|
1679
|
-
async function d() {
|
|
1680
|
-
try {
|
|
1681
|
-
V.set(r, await St(n.fetch), !0);
|
|
1682
|
-
} catch (e) {
|
|
1683
|
-
console.error("TagList: failed to load tags", e), V.set(i, A(), !0);
|
|
1684
|
-
}
|
|
1685
|
-
}
|
|
1686
|
-
Tt(() => {
|
|
1687
|
-
d();
|
|
1688
|
-
}), V.user_effect(() => {
|
|
1689
|
-
_t(), d();
|
|
1690
|
-
});
|
|
1691
|
-
function f(e) {
|
|
1692
|
-
V.set(r, [...V.get(r), e], !0), B(), d();
|
|
1693
|
-
}
|
|
1694
|
-
function p(e) {
|
|
1695
|
-
V.set(r, V.get(r).map((t) => t.id === e.id ? e : t), !0), B();
|
|
1696
|
-
}
|
|
1697
|
-
function m(e) {
|
|
1698
|
-
V.set(o, e, !0), V.set(a, !0);
|
|
1699
|
-
}
|
|
1700
|
-
function b() {
|
|
1701
|
-
V.set(o, null);
|
|
1702
|
-
}
|
|
1703
|
-
function S(e) {
|
|
1704
|
-
V.set(l, e, !0), V.set(s, !0);
|
|
1705
|
-
}
|
|
1706
|
-
function C() {
|
|
1707
|
-
V.set(s, !1), V.set(l, null);
|
|
1708
|
-
}
|
|
1709
|
-
async function ne() {
|
|
1710
|
-
let e = V.get(l);
|
|
1711
|
-
if (!(!e || V.get(u))) {
|
|
1712
|
-
V.set(u, !0);
|
|
1713
|
-
try {
|
|
1714
|
-
await xt(e.id, n.fetch), V.set(r, V.get(r).filter((t) => t.id !== e.id), !0), z() === e.id && vt(null), V.set(s, !1), V.set(l, null), B();
|
|
1715
|
-
} catch (e) {
|
|
1716
|
-
console.error("TagList: deleteTag failed", e), V.set(i, me(), !0);
|
|
1717
|
-
} finally {
|
|
1718
|
-
V.set(u, !1);
|
|
1719
|
-
}
|
|
1720
|
-
}
|
|
1721
|
-
}
|
|
1722
|
-
var w = on(), E = V.first_child(w), D = V.child(E), re = V.child(D, !0);
|
|
1723
|
-
V.reset(D);
|
|
1724
|
-
var ie = V.sibling(D, 2), k = (e) => {
|
|
1725
|
-
var t = tn(), n = V.child(t, !0);
|
|
1726
|
-
V.reset(t), V.template_effect(() => V.set_text(n, V.get(i))), V.append(e, t);
|
|
1727
|
-
};
|
|
1728
|
-
V.if(ie, (e) => {
|
|
1729
|
-
V.get(i) && e(k);
|
|
1730
|
-
});
|
|
1731
|
-
var j = V.sibling(ie, 2), ae = V.child(j);
|
|
1732
|
-
V.each(ae, 17, () => V.get(r), (e) => e.id, (e, t) => {
|
|
1733
|
-
var n = an(), r = V.child(n), i = V.child(r), a = V.sibling(i);
|
|
1734
|
-
V.reset(r), h(V.sibling(r, 2), {
|
|
1735
|
-
children: (e, n) => {
|
|
1736
|
-
var r = rn(), i = V.first_child(r);
|
|
1737
|
-
ee(i, {
|
|
1738
|
-
child: (e, n) => {
|
|
1739
|
-
let r = () => (n?.()).props;
|
|
1740
|
-
var i = nn();
|
|
1741
|
-
V.attribute_effect(i, (e, t, n) => ({
|
|
1742
|
-
...r(),
|
|
1743
|
-
type: "button",
|
|
1744
|
-
class: e,
|
|
1745
|
-
"aria-label": t,
|
|
1746
|
-
title: n,
|
|
1747
|
-
disabled: V.get(u)
|
|
1748
|
-
}), [
|
|
1749
|
-
() => I("hidden size-5 items-center justify-center rounded-full hover:bg-black/10 focus-visible:inline-flex group-hover/tag:inline-flex mr-0.5 data-[state=open]:inline-flex", z() === V.get(t).id && "inline-flex"),
|
|
1750
|
-
() => T(),
|
|
1751
|
-
() => T()
|
|
1752
|
-
]);
|
|
1753
|
-
var a = V.child(i), o = (e) => {
|
|
1754
|
-
te(e, { class: "size-3 animate-spin" });
|
|
1755
|
-
}, s = (e) => {
|
|
1756
|
-
_(e, { class: "size-3" });
|
|
1757
|
-
};
|
|
1758
|
-
V.if(a, (e) => {
|
|
1759
|
-
V.get(u) ? e(o) : e(s, -1);
|
|
1760
|
-
}), V.reset(i), V.append(e, i);
|
|
1761
|
-
},
|
|
1762
|
-
$$slots: { child: !0 }
|
|
1763
|
-
}), g(V.sibling(i, 2), {
|
|
1764
|
-
align: "start",
|
|
1765
|
-
children: (e, n) => {
|
|
1766
|
-
var r = rn(), i = V.first_child(r);
|
|
1767
|
-
v(i, {
|
|
1768
|
-
onSelect: () => m(V.get(t)),
|
|
1769
|
-
children: (e, t) => {
|
|
1770
|
-
V.next();
|
|
1771
|
-
var n = V.text();
|
|
1772
|
-
V.template_effect((e) => V.set_text(n, e), [() => ye()]), V.append(e, n);
|
|
1773
|
-
},
|
|
1774
|
-
$$slots: { default: !0 }
|
|
1775
|
-
}), v(V.sibling(i, 2), {
|
|
1776
|
-
class: "text-destructive focus:text-destructive",
|
|
1777
|
-
onSelect: () => S(V.get(t)),
|
|
1778
|
-
children: (e, t) => {
|
|
1779
|
-
V.next();
|
|
1780
|
-
var n = V.text();
|
|
1781
|
-
V.template_effect((e) => V.set_text(n, e), [() => pe()]), V.append(e, n);
|
|
1782
|
-
},
|
|
1783
|
-
$$slots: { default: !0 }
|
|
1784
|
-
}), V.append(e, r);
|
|
1785
|
-
},
|
|
1786
|
-
$$slots: { default: !0 }
|
|
1787
|
-
}), V.append(e, r);
|
|
1788
|
-
},
|
|
1789
|
-
$$slots: { default: !0 }
|
|
1790
|
-
}), V.reset(n), V.template_effect((e, o) => {
|
|
1791
|
-
V.set_class(n, 1, e), V.set_attribute(r, "aria-pressed", o), V.set_style(i, `background-color: ${(V.get(t).color || "#888888") ?? ""}`), V.set_text(a, ` ${V.get(t).name ?? ""}`);
|
|
1792
|
-
}, [() => V.clsx(I("group/tag relative inline-flex items-center rounded-full transition-colors", z() === V.get(t).id ? "bg-primary text-primary-foreground" : "bg-secondary text-secondary-foreground hover:bg-secondary/80")), () => z() === V.get(t).id]), V.delegated("click", r, () => vt(z() === V.get(t).id ? null : V.get(t).id, V.get(t).name)), V.append(e, n);
|
|
1793
|
-
});
|
|
1794
|
-
var M = V.sibling(ae, 2), oe = V.child(M);
|
|
1795
|
-
c(oe, { class: "size-3" });
|
|
1796
|
-
var N = V.sibling(oe);
|
|
1797
|
-
V.reset(M), V.reset(j), V.reset(E);
|
|
1798
|
-
var se = V.sibling(E, 2);
|
|
1799
|
-
{
|
|
1800
|
-
let e = V.derived(() => V.get(o) ? "edit" : "create");
|
|
1801
|
-
Ct(se, {
|
|
1802
|
-
get mode() {
|
|
1803
|
-
return V.get(e);
|
|
1804
|
-
},
|
|
1805
|
-
get tag() {
|
|
1806
|
-
return V.get(o);
|
|
1807
|
-
},
|
|
1808
|
-
onCreated: f,
|
|
1809
|
-
onUpdated: p,
|
|
1810
|
-
onClose: b,
|
|
1811
|
-
get open() {
|
|
1812
|
-
return V.get(a);
|
|
1813
|
-
},
|
|
1814
|
-
set open(e) {
|
|
1815
|
-
V.set(a, e, !0);
|
|
1816
|
-
}
|
|
1817
|
-
});
|
|
1818
|
-
}
|
|
1819
|
-
var ce = V.sibling(se, 2);
|
|
1820
|
-
{
|
|
1821
|
-
let e = V.derived(() => P()), t = V.derived(() => y()), n = V.derived(() => pe()), r = V.derived(() => ve());
|
|
1822
|
-
bt(ce, {
|
|
1823
|
-
get title() {
|
|
1824
|
-
return V.get(e);
|
|
1825
|
-
},
|
|
1826
|
-
get description() {
|
|
1827
|
-
return V.get(t);
|
|
1828
|
-
},
|
|
1829
|
-
get confirmLabel() {
|
|
1830
|
-
return V.get(n);
|
|
1831
|
-
},
|
|
1832
|
-
get cancelLabel() {
|
|
1833
|
-
return V.get(r);
|
|
1834
|
-
},
|
|
1835
|
-
variant: "destructive",
|
|
1836
|
-
get busy() {
|
|
1837
|
-
return V.get(u);
|
|
1838
|
-
},
|
|
1839
|
-
onConfirm: ne,
|
|
1840
|
-
onCancel: C,
|
|
1841
|
-
get open() {
|
|
1842
|
-
return V.get(s);
|
|
1843
|
-
},
|
|
1844
|
-
set open(e) {
|
|
1845
|
-
V.set(s, e, !0);
|
|
1846
|
-
}
|
|
1847
|
-
});
|
|
1848
|
-
}
|
|
1849
|
-
V.template_effect((e, t, n) => {
|
|
1850
|
-
V.set_text(re, e), V.set_attribute(M, "aria-label", t), V.set_text(N, ` ${n ?? ""}`);
|
|
1851
|
-
}, [
|
|
1852
|
-
() => x(),
|
|
1853
|
-
() => _e(),
|
|
1854
|
-
() => O()
|
|
1855
|
-
]), V.delegated("click", M, () => {
|
|
1856
|
-
V.set(o, null), V.set(a, !0);
|
|
1857
|
-
}), V.append(e, w), V.pop();
|
|
1858
|
-
}
|
|
1859
|
-
V.delegate(["click"]);
|
|
1860
|
-
//#endregion
|
|
1861
|
-
//#region src/lib/components/sidebar/Sidebar.svelte
|
|
1862
|
-
var J = V.from_html("<div role=\"separator\" tabindex=\"-1\"></div>"), cn = V.from_html("<button class=\"sidebar-collapse-toggle absolute -right-3 top-4 z-40 flex size-6 items-center justify-center rounded-full border border-border bg-background shadow-sm hover:bg-accent\"><!></button>"), Y = V.from_html("<!> <div class=\"h-px bg-border\"></div>", 1), ln = V.from_html("<span class=\"rounded bg-muted px-1.5 py-0.5 text-xs\"> </span>"), X = V.from_html("<a class=\"flex items-center gap-2 rounded-md px-2 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground aria-disabled:pointer-events-none aria-disabled:opacity-50\"><!> <span class=\"min-w-0 flex-1 truncate\"> </span> <!></a>"), un = V.from_html("<div class=\"h-px bg-border\"></div> <nav class=\"space-y-1\" aria-label=\"Product navigation\"></nav>", 1), dn = V.from_html("<div class=\"flex flex-1 flex-col gap-4 overflow-y-auto p-3\"><!> <!> <!> <!> <!> <!></div>"), fn = V.from_html("<span class=\"text-xs\"> </span>"), pn = V.from_html("<a class=\"flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground aria-disabled:pointer-events-none aria-disabled:opacity-50\"><!></a>"), mn = V.from_html("<div class=\"flex flex-1 flex-col items-center gap-1 pt-14\"><!> <button class=\"flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground\"><!></button> <button class=\"flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground\"><!></button> <button class=\"flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground\"><!></button> <button class=\"flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground\"><!></button> <!></div>"), hn = V.from_html("<div class=\"flex flex-col items-center gap-2\"><!> <button type=\"button\" class=\"flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground\"><!></button> <a href=\"https://docsmint.com\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground\"><img src=\"/favicon.ico\" alt=\"DocsMint\" class=\"size-5 object-contain dark:hidden\"/> <img src=\"/favicon_white.ico\" alt=\"\" aria-hidden=\"true\" class=\"hidden size-5 object-contain dark:block\"/></a></div>"), gn = V.from_html("<div class=\"flex items-center justify-between\"><a href=\"https://docsmint.com\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"text-xs text-muted-foreground hover:text-foreground transition-colors\"> </a> <div class=\"flex items-center gap-1\"><!> <button type=\"button\" class=\"flex size-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground\"><!></button></div></div>"), _n = V.from_html("<aside tabindex=\"-1\"><!> <!> <!> <div class=\"border-t border-border p-2\"><!></div></aside> <!>", 1);
|
|
1863
|
-
function vn(e, t) {
|
|
1864
|
-
V.push(t, !0);
|
|
1865
|
-
let n = V.prop(t, "mobile", 3, !1), r = V.prop(t, "mobileOpen", 3, !1), o = V.prop(t, "element", 15, null), s = "hiai_sidebar_collapsed", c = Ee(), l = V.state(!1), u = V.state(!1), m = V.state("all"), h = V.derived(() => !n() && V.get(l)), g = V.state(256), _ = V.state(!1), v = L(), ee = V.derived(() => R(v.sidebarTop, { pathname: H.url.pathname })), te = V.derived(() => R(v.sidebarFooterActions, { pathname: H.url.pathname })), y = V.derived(() => R(v.navigation, { pathname: H.url.pathname }));
|
|
1866
|
-
Tt(() => {
|
|
1867
|
-
let e = () => {
|
|
1868
|
-
at(), gt();
|
|
1869
|
-
};
|
|
1870
|
-
return window.addEventListener("hiai-docs:documents-updated", e), () => window.removeEventListener("hiai-docs:documents-updated", e);
|
|
1871
|
-
}), V.user_effect(() => {
|
|
1872
|
-
if (typeof window < "u") {
|
|
1873
|
-
try {
|
|
1874
|
-
V.set(l, localStorage.getItem(s) === "1");
|
|
1875
|
-
} catch {}
|
|
1876
|
-
let e = localStorage.getItem("hiai_sidebar_width");
|
|
1877
|
-
if (e) {
|
|
1878
|
-
let t = parseInt(e, 10);
|
|
1879
|
-
!Number.isNaN(t) && t >= 180 && t <= 500 && V.set(g, t, !0);
|
|
1880
|
-
}
|
|
1881
|
-
}
|
|
1882
|
-
}), V.user_effect(() => {
|
|
1883
|
-
if (V.get(_)) return window.addEventListener("mousemove", ne), window.addEventListener("mouseup", w), () => {
|
|
1884
|
-
window.removeEventListener("mousemove", ne), window.removeEventListener("mouseup", w);
|
|
1885
|
-
};
|
|
1886
|
-
});
|
|
1887
|
-
function b(e) {
|
|
1888
|
-
e.preventDefault(), V.set(_, !0);
|
|
1889
|
-
}
|
|
1890
|
-
function ne(e) {
|
|
1891
|
-
let t = Math.max(180, Math.min(500, e.clientX));
|
|
1892
|
-
V.set(g, t, !0);
|
|
1893
|
-
}
|
|
1894
|
-
function w() {
|
|
1895
|
-
V.set(_, !1), localStorage.setItem("hiai_sidebar_width", V.get(g).toString());
|
|
1896
|
-
}
|
|
1897
|
-
function T() {
|
|
1898
|
-
return F(c, "/search");
|
|
1899
|
-
}
|
|
1900
|
-
function E(e) {
|
|
1901
|
-
V.set(m, V.get(m) === e ? "all" : e, !0), V.set(l, !1), ie();
|
|
1902
|
-
}
|
|
1903
|
-
function re() {
|
|
1904
|
-
V.set(l, !V.get(l)), ie(), V.get(l) && V.set(m, "all");
|
|
1905
|
-
}
|
|
1906
|
-
function ie() {
|
|
1907
|
-
if (!(typeof localStorage > "u")) try {
|
|
1908
|
-
localStorage.setItem(s, V.get(l) ? "1" : "0");
|
|
1909
|
-
} catch {}
|
|
1910
|
-
}
|
|
1911
|
-
var O = _n(), k = V.first_child(O), A = V.child(k), ae = (e) => {
|
|
1912
|
-
var t = J();
|
|
1913
|
-
V.template_effect((e) => V.set_class(t, 1, e), [() => V.clsx(I("absolute right-0 top-0 z-40 h-full w-1 cursor-col-resize hover:bg-primary/50 transition-colors", V.get(_) && "bg-primary w-1"))]), V.delegated("mousedown", t, b), V.append(e, t);
|
|
1914
|
-
};
|
|
1915
|
-
V.if(A, (e) => {
|
|
1916
|
-
!n() && !V.get(h) && e(ae);
|
|
1917
|
-
});
|
|
1918
|
-
var M = V.sibling(A, 2), oe = (e) => {
|
|
1919
|
-
var t = cn(), n = V.child(t), r = (e) => {
|
|
1920
|
-
kt(e, { class: "size-3.5" });
|
|
1921
|
-
}, i = (e) => {
|
|
1922
|
-
Ot(e, { class: "size-3.5" });
|
|
1923
|
-
};
|
|
1924
|
-
V.if(n, (e) => {
|
|
1925
|
-
V.get(h) ? e(r) : e(i, -1);
|
|
1926
|
-
}), V.reset(t), V.delegated("click", t, re), V.append(e, t);
|
|
1927
|
-
};
|
|
1928
|
-
V.if(M, (e) => {
|
|
1929
|
-
n() || e(oe);
|
|
1930
|
-
});
|
|
1931
|
-
var se = V.sibling(M, 2), P = (e) => {
|
|
1932
|
-
var t = dn(), n = V.child(t);
|
|
1933
|
-
V.each(n, 17, () => V.get(ee), (e) => e.id, (e, t) => {
|
|
1934
|
-
let n = V.derived(() => V.get(t).component);
|
|
1935
|
-
var r = V.comment(), i = V.first_child(r);
|
|
1936
|
-
V.component(i, () => V.get(n), (e, t) => {
|
|
1937
|
-
t(e, { collapsed: !1 });
|
|
1938
|
-
}), V.append(e, r);
|
|
1939
|
-
});
|
|
1940
|
-
var r = V.sibling(n, 2);
|
|
1941
|
-
jt(r, { class: "mr-5" });
|
|
1942
|
-
var i = V.sibling(r, 2), a = (e) => {
|
|
1943
|
-
var t = Y();
|
|
1944
|
-
Jt(V.first_child(t), {}), V.next(2), V.append(e, t);
|
|
1945
|
-
};
|
|
1946
|
-
V.if(i, (e) => {
|
|
1947
|
-
V.get(m) === "all" && e(a);
|
|
1948
|
-
});
|
|
1949
|
-
var o = V.sibling(i, 2), s = (e) => {
|
|
1950
|
-
var t = Y();
|
|
1951
|
-
en(V.first_child(t), {}), V.next(2), V.append(e, t);
|
|
1952
|
-
};
|
|
1953
|
-
V.if(o, (e) => {
|
|
1954
|
-
(V.get(m) === "all" || V.get(m) === "recent") && e(s);
|
|
1955
|
-
});
|
|
1956
|
-
var l = V.sibling(o, 2), u = (e) => {
|
|
1957
|
-
sn(e, {});
|
|
1958
|
-
};
|
|
1959
|
-
V.if(l, (e) => {
|
|
1960
|
-
(V.get(m) === "all" || V.get(m) === "tags") && e(u);
|
|
1961
|
-
});
|
|
1962
|
-
var d = V.sibling(l, 2), f = (e) => {
|
|
1963
|
-
var t = un(), n = V.sibling(V.first_child(t), 2);
|
|
1964
|
-
V.each(n, 21, () => V.get(y), (e) => e.id, (e, t) => {
|
|
1965
|
-
let n = V.derived(() => V.get(t).icon);
|
|
1966
|
-
var r = X(), i = V.child(r), a = (e) => {
|
|
1967
|
-
var t = V.comment(), r = V.first_child(t);
|
|
1968
|
-
V.component(r, () => V.get(n), (e, t) => {
|
|
1969
|
-
t(e, { class: "size-4" });
|
|
1970
|
-
}), V.append(e, t);
|
|
1971
|
-
};
|
|
1972
|
-
V.if(i, (e) => {
|
|
1973
|
-
V.get(n) && e(a);
|
|
1974
|
-
});
|
|
1975
|
-
var o = V.sibling(i, 2), s = V.child(o, !0);
|
|
1976
|
-
V.reset(o);
|
|
1977
|
-
var l = V.sibling(o, 2), u = (e) => {
|
|
1978
|
-
var n = ln(), r = V.child(n, !0);
|
|
1979
|
-
V.reset(n), V.template_effect(() => V.set_text(r, V.get(t).badge)), V.append(e, n);
|
|
1980
|
-
};
|
|
1981
|
-
V.if(l, (e) => {
|
|
1982
|
-
V.get(t).badge !== void 0 && e(u);
|
|
1983
|
-
}), V.reset(r), V.template_effect((e) => {
|
|
1984
|
-
V.set_attribute(r, "href", e), V.set_attribute(r, "aria-disabled", V.get(t).disabled), V.set_text(s, V.get(t).label);
|
|
1985
|
-
}, [() => V.get(t).href ? Te(c, V.get(t).href) : "#"]), V.append(e, r);
|
|
1986
|
-
}), V.reset(n), V.append(e, t);
|
|
1987
|
-
};
|
|
1988
|
-
V.if(d, (e) => {
|
|
1989
|
-
V.get(m) === "all" && V.get(y).length > 0 && e(f);
|
|
1990
|
-
}), V.reset(t), V.append(e, t);
|
|
1991
|
-
}, ce = (e) => {
|
|
1992
|
-
var t = mn(), n = V.child(t);
|
|
1993
|
-
V.each(n, 17, () => V.get(ee), (e) => e.id, (e, t) => {
|
|
1994
|
-
let n = V.derived(() => V.get(t).component);
|
|
1995
|
-
var r = V.comment(), i = V.first_child(r);
|
|
1996
|
-
V.component(i, () => V.get(n), (e, t) => {
|
|
1997
|
-
t(e, { collapsed: !0 });
|
|
1998
|
-
}), V.append(e, r);
|
|
1999
|
-
});
|
|
2000
|
-
var r = V.sibling(n, 2);
|
|
2001
|
-
i(V.child(r), { class: "size-4" }), V.reset(r);
|
|
2002
|
-
var o = V.sibling(r, 2);
|
|
2003
|
-
f(V.child(o), { class: "size-4" }), V.reset(o);
|
|
2004
|
-
var s = V.sibling(o, 2);
|
|
2005
|
-
a(V.child(s), { class: "size-4" }), V.reset(s);
|
|
2006
|
-
var l = V.sibling(s, 2);
|
|
2007
|
-
p(V.child(l), { class: "size-4" }), V.reset(l);
|
|
2008
|
-
var u = V.sibling(l, 2);
|
|
2009
|
-
V.each(u, 17, () => V.get(y), (e) => e.id, (e, t) => {
|
|
2010
|
-
let n = V.derived(() => V.get(t).icon);
|
|
2011
|
-
var r = pn(), i = V.child(r), a = (e) => {
|
|
2012
|
-
var t = V.comment(), r = V.first_child(t);
|
|
2013
|
-
V.component(r, () => V.get(n), (e, t) => {
|
|
2014
|
-
t(e, { class: "size-4" });
|
|
2015
|
-
}), V.append(e, t);
|
|
2016
|
-
}, o = (e) => {
|
|
2017
|
-
var n = fn(), r = V.child(n, !0);
|
|
2018
|
-
V.reset(n), V.template_effect((e) => V.set_text(r, e), [() => V.get(t).label.slice(0, 1)]), V.append(e, n);
|
|
2019
|
-
};
|
|
2020
|
-
V.if(i, (e) => {
|
|
2021
|
-
V.get(n) ? e(a) : e(o, -1);
|
|
2022
|
-
}), V.reset(r), V.template_effect((e) => {
|
|
2023
|
-
V.set_attribute(r, "href", e), V.set_attribute(r, "aria-disabled", V.get(t).disabled), V.set_attribute(r, "title", V.get(t).label), V.set_attribute(r, "aria-label", V.get(t).label);
|
|
2024
|
-
}, [() => V.get(t).href ? Te(c, V.get(t).href) : "#"]), V.append(e, r);
|
|
2025
|
-
}), V.reset(t), V.template_effect((e, t, n, i, a, c, u, d) => {
|
|
2026
|
-
V.set_attribute(r, "title", e), V.set_attribute(r, "aria-label", t), V.set_attribute(o, "title", n), V.set_attribute(o, "aria-label", i), V.set_attribute(s, "title", a), V.set_attribute(s, "aria-label", c), V.set_attribute(l, "title", u), V.set_attribute(l, "aria-label", d);
|
|
2027
|
-
}, [
|
|
2028
|
-
() => j(),
|
|
2029
|
-
() => j(),
|
|
2030
|
-
() => N(),
|
|
2031
|
-
() => N(),
|
|
2032
|
-
() => C(),
|
|
2033
|
-
() => C(),
|
|
2034
|
-
() => x(),
|
|
2035
|
-
() => x()
|
|
2036
|
-
]), V.delegated("click", r, () => F(c, "/")), V.delegated("click", o, T), V.delegated("click", s, () => E("recent")), V.delegated("click", l, () => E("tags")), V.append(e, t);
|
|
2037
|
-
};
|
|
2038
|
-
V.if(se, (e) => {
|
|
2039
|
-
V.get(h) ? e(ce, -1) : e(P);
|
|
2040
|
-
});
|
|
2041
|
-
var le = V.sibling(se, 2), ue = V.child(le), de = (e) => {
|
|
2042
|
-
var t = hn(), n = V.child(t);
|
|
2043
|
-
V.each(n, 17, () => V.get(te), (e) => e.id, (e, t) => {
|
|
2044
|
-
let n = V.derived(() => V.get(t).component);
|
|
2045
|
-
var r = V.comment(), i = V.first_child(r);
|
|
2046
|
-
V.component(i, () => V.get(n), (e, t) => {
|
|
2047
|
-
t(e, { collapsed: !0 });
|
|
2048
|
-
}), V.append(e, r);
|
|
2049
|
-
});
|
|
2050
|
-
var r = V.sibling(n, 2);
|
|
2051
|
-
U(V.child(r), { class: "size-4" }), V.reset(r);
|
|
2052
|
-
var i = V.sibling(r, 2);
|
|
2053
|
-
V.reset(t), V.template_effect((e, t, n, a) => {
|
|
2054
|
-
V.set_attribute(r, "title", e), V.set_attribute(r, "aria-label", t), V.set_attribute(i, "title", n), V.set_attribute(i, "aria-label", a);
|
|
2055
|
-
}, [
|
|
2056
|
-
() => S(),
|
|
2057
|
-
() => S(),
|
|
2058
|
-
() => D(),
|
|
2059
|
-
() => D()
|
|
2060
|
-
]), V.delegated("click", r, () => {
|
|
2061
|
-
V.set(u, !0);
|
|
2062
|
-
}), V.append(e, t);
|
|
2063
|
-
}, fe = (e) => {
|
|
2064
|
-
var t = gn(), n = V.child(t), r = V.child(n, !0);
|
|
2065
|
-
V.reset(n);
|
|
2066
|
-
var i = V.sibling(n, 2), a = V.child(i);
|
|
2067
|
-
V.each(a, 17, () => V.get(te), (e) => e.id, (e, t) => {
|
|
2068
|
-
let n = V.derived(() => V.get(t).component);
|
|
2069
|
-
var r = V.comment(), i = V.first_child(r);
|
|
2070
|
-
V.component(i, () => V.get(n), (e, t) => {
|
|
2071
|
-
t(e, { collapsed: !1 });
|
|
2072
|
-
}), V.append(e, r);
|
|
2073
|
-
});
|
|
2074
|
-
var o = V.sibling(a, 2);
|
|
2075
|
-
U(V.child(o), { class: "size-4" }), V.reset(o), V.reset(i), V.reset(t), V.template_effect((e, t, i, a) => {
|
|
2076
|
-
V.set_attribute(n, "title", e), V.set_text(r, t), V.set_attribute(o, "title", i), V.set_attribute(o, "aria-label", a);
|
|
2077
|
-
}, [
|
|
2078
|
-
() => D(),
|
|
2079
|
-
() => D(),
|
|
2080
|
-
() => S(),
|
|
2081
|
-
() => S()
|
|
2082
|
-
]), V.delegated("click", o, () => {
|
|
2083
|
-
V.set(u, !0);
|
|
2084
|
-
}), V.append(e, t);
|
|
2085
|
-
};
|
|
2086
|
-
V.if(ue, (e) => {
|
|
2087
|
-
V.get(h) ? e(de) : e(fe, -1);
|
|
2088
|
-
}), V.reset(le), V.reset(k), V.bind_this(k, (e) => o(e), () => o()), d(V.sibling(k, 2), {
|
|
2089
|
-
get open() {
|
|
2090
|
-
return V.get(u);
|
|
2091
|
-
},
|
|
2092
|
-
set open(e) {
|
|
2093
|
-
V.set(u, e, !0);
|
|
2094
|
-
}
|
|
2095
|
-
}), V.template_effect((e) => {
|
|
2096
|
-
V.set_attribute(k, "id", n() ? "mobile-navigation" : void 0), V.set_attribute(k, "role", n() && r() ? "dialog" : void 0), V.set_attribute(k, "aria-modal", n() && r() ? "true" : void 0), V.set_attribute(k, "aria-label", n() ? "Navigation" : void 0), V.set_attribute(k, "aria-hidden", n() && !r() ? "true" : void 0), k.inert = n() && !r(), V.set_class(k, 1, e), V.set_style(k, n() ? "padding-top: env(safe-area-inset-top);" : V.get(h) ? "width: 48px;" : `width: ${V.get(g)}px;`);
|
|
2097
|
-
}, [() => V.clsx(I("flex flex-col border-r border-border bg-card font-sans", n() && "fixed inset-y-0 left-0 z-50 h-full w-[80%] max-w-[320px] shadow-xl transition-transform duration-300 ease-out", n() && (r() ? "translate-x-0" : "-translate-x-full"), !n() && "relative h-screen", !n() && !V.get(_) && "transition-[width] duration-200"))]), V.append(e, O), V.pop();
|
|
2098
|
-
}
|
|
2099
|
-
V.delegate(["mousedown", "click"]);
|
|
2100
|
-
//#endregion
|
|
2101
|
-
export { vn as t };
|