@hiai-gg/docsmint 0.3.6 → 0.3.8
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/backend/src/lib/logger.ts +45 -15
- package/dist/backend/index.js +238 -150
- package/dist/frontend/CategoryDialog-DphkZqIB.js +611 -0
- package/dist/frontend/ConfirmDialog-BLF3x_hr.js +214 -0
- package/dist/frontend/CreateSnapshotDialog-D5vPvFTL.js +216 -0
- package/dist/frontend/DatePicker-CLNTdvTk.js +259 -0
- package/dist/frontend/DeleteDialog-DxYFJivN.js +174 -0
- package/dist/frontend/FolderDialog-CRVZM2Oi.js +250 -0
- package/dist/frontend/FolderNode-C2zG7uii.js +298 -0
- package/dist/frontend/FolderTreeSelector-CyB8y2Sm.js +103 -0
- package/dist/frontend/Icon-CooFj4Ee.js +64 -0
- package/dist/frontend/SettingsDialog-DCM4-N6_.js +1016 -0
- package/dist/frontend/ShareDialog-DYu3RKQu.js +165 -0
- package/dist/frontend/TagCreateDialog-DXQs2bL9.js +260 -0
- package/dist/frontend/api/attachments.d.ts +6 -0
- package/dist/frontend/api/attachments.js +2 -0
- package/dist/frontend/api/categories.js +1 -1
- package/dist/frontend/api/documents.js +1 -1
- package/dist/frontend/api/folders.js +1 -1
- package/dist/frontend/api/settings.js +1 -1
- package/dist/frontend/api/share.d.ts +5 -0
- package/dist/frontend/api/share.js +2 -0
- package/dist/frontend/api/tags.js +1 -1
- package/dist/frontend/api-keys-CpkrA8rD.js +35 -0
- package/dist/frontend/attachments-BuILSs56.js +50 -0
- package/dist/frontend/{settings-PCrOtied.js → auth-client-Cygmp1I2.js} +205 -265
- package/dist/frontend/awareness-snQ3RD9f.js +3714 -0
- package/dist/frontend/camera-iKXDOOWT.js +29 -0
- package/dist/frontend/{categories-BE6ZpZl8.js → categories-izQovv2w.js} +1 -1
- package/dist/frontend/check-D-UuvBuh.js +25 -0
- package/dist/frontend/chevron-down-CiPtYyFh.js +25 -0
- package/dist/frontend/circle-check-tSPE1V6t.js +29 -0
- package/dist/frontend/{client-B9hzI0W8.js → client-GbtOH90i.js} +1 -1
- package/dist/frontend/clipboard-Cgzxc0_R.js +16 -0
- package/dist/frontend/clock-DJHbHZb8.js +29 -0
- package/dist/frontend/clsx-C7bIvsDS.js +1738 -0
- package/dist/frontend/collaboration.d.ts +6 -0
- package/dist/frontend/collaboration.js +182 -0
- package/dist/frontend/components/category-dialog.d.ts +2 -0
- package/dist/frontend/components/category-dialog.js +2 -0
- package/dist/frontend/components/create-snapshot-dialog.d.ts +2 -0
- package/dist/frontend/components/create-snapshot-dialog.js +2 -0
- package/dist/frontend/components/delete-dialog.d.ts +2 -0
- package/dist/frontend/components/delete-dialog.js +2 -0
- package/dist/frontend/components/editor/document-editor.d.ts +3 -0
- package/dist/frontend/components/editor/document-editor.js +3032 -0
- package/dist/frontend/components/editor/document-title.d.ts +2 -0
- package/dist/frontend/components/editor/document-title.js +31 -0
- package/dist/frontend/components/editor/docx-serializer.d.ts +2 -0
- package/dist/frontend/components/editor/docx-serializer.js +14600 -0
- package/dist/frontend/components/editor/extensions.d.ts +2 -0
- package/dist/frontend/components/editor/extensions.js +2 -0
- package/dist/frontend/components/editor/markdown-toggle.d.ts +2 -0
- package/dist/frontend/components/editor/markdown-toggle.js +72 -0
- package/dist/frontend/components/editor/markdown.d.ts +1 -0
- package/dist/frontend/components/editor/markdown.js +2 -0
- package/dist/frontend/components/folder-node.d.ts +3 -0
- package/dist/frontend/components/folder-node.js +2 -0
- package/dist/frontend/components/folder-tree-selector.d.ts +2 -0
- package/dist/frontend/components/folder-tree-selector.js +2 -0
- package/dist/frontend/components/save-as-dialog.d.ts +2 -0
- package/dist/frontend/components/save-as-dialog.js +272 -0
- package/dist/frontend/components/settings.js +1 -1
- package/dist/frontend/components/share-dialog.d.ts +2 -0
- package/dist/frontend/components/share-dialog.js +2 -0
- package/dist/frontend/components/sidebar.js +1145 -3693
- package/dist/frontend/components/tag-create-dialog.d.ts +2 -0
- package/dist/frontend/components/tag-create-dialog.js +2 -0
- package/dist/frontend/components/version-history.d.ts +2 -0
- package/dist/frontend/components/version-history.js +294 -0
- package/dist/frontend/{context-DbnW5yib.js → context-BMD6XTPe.js} +0 -3
- package/dist/frontend/copy-GppwRMjX.js +32 -0
- package/dist/frontend/dashboard.js +1113 -1157
- package/dist/frontend/{SettingsDialog-D4pgFD0D.js → db-ByrlYfaI.js} +923 -2002
- package/dist/frontend/dialog-D6NxYVmy.js +213 -0
- package/dist/frontend/dndzone-BzsOINtP.js +1199 -0
- package/dist/frontend/doc-tabs.d.ts +7 -0
- package/dist/frontend/doc-tabs.js +14 -0
- package/dist/frontend/document-drop-coordinator-C4xHMjwC.js +68 -0
- package/dist/frontend/document-drop-coordinator.d.ts +2 -0
- package/dist/frontend/document-drop-coordinator.js +2 -0
- package/dist/frontend/{documents-DFVS9SsL.js → documents-BsDkvzCm.js} +1 -1
- package/dist/frontend/editorExtensions-BMHvUbdk.js +27021 -0
- package/dist/frontend/ellipsis-vertical-P9MHvCps.js +530 -0
- package/dist/frontend/extension.js +8 -7
- package/dist/frontend/floating-layer-anchor-CPwucTfd.js +4515 -0
- package/dist/frontend/folder-DeWhnD7O.js +45 -0
- package/dist/frontend/folder-refresh.d.ts +8 -0
- package/dist/frontend/folder-refresh.js +2 -0
- package/dist/frontend/{folders-CGe9diAG.js → folders-CTuV_JtU.js} +1 -1
- package/dist/frontend/frontend.css +1 -1
- package/dist/frontend/i18n.js +1 -1
- package/dist/frontend/identity-DyWeNzu_.js +69 -0
- package/dist/frontend/input-B5Rak-5G.js +23 -0
- package/dist/frontend/keyboard.d.ts +14 -0
- package/dist/frontend/keyboard.js +2 -0
- package/dist/frontend/keyboard.svelte-CApmX0vl.js +133 -0
- package/dist/frontend/label-CW9rxoAb.js +30 -0
- package/dist/frontend/loader-circle-BA6aLO71.js +268 -0
- package/dist/frontend/markdown-BwnyjITU.js +11 -0
- package/dist/frontend/messages-BpYaLbzE.js +1091 -0
- package/dist/frontend/offline/identity.d.ts +6 -0
- package/dist/frontend/offline/identity.js +2 -0
- package/dist/frontend/resolve-BG4HgzpN.js +19 -0
- package/dist/frontend/rolldown-runtime-CWhphoD1.js +23 -0
- package/dist/frontend/rotate-ccw-B4Q7brmV.js +25 -0
- package/dist/frontend/search.js +637 -602
- package/dist/frontend/select-value-sF86Geyh.js +1446 -0
- package/dist/frontend/settings-blyobazp.js +62 -0
- package/dist/frontend/share-Cu7SSJuJ.js +28 -0
- package/dist/frontend/shared-document.js +94 -93
- package/dist/frontend/subfolders-refresh-store.svelte-B2dKVmgz.js +65 -0
- package/dist/frontend/tag-HxRazVN_.js +54 -0
- package/dist/frontend/tag-store.svelte-CqrUXo0o.js +29 -0
- package/dist/frontend/{tags-DVXTut0p.js → tags-CtCV0Djo.js} +1 -1
- package/dist/frontend/textarea-i1720bE7.js +23 -0
- package/dist/frontend/theme.js +1 -1
- package/dist/frontend/theme.svelte-DKfCy12k.js +49 -0
- package/dist/frontend/types.d.ts +6 -0
- package/dist/frontend/types.js +0 -0
- package/dist/frontend/utils/clipboard.d.ts +1 -0
- package/dist/frontend/utils/clipboard.js +2 -0
- package/dist/frontend/utils/dndzone.d.ts +4 -0
- package/dist/frontend/utils/dndzone.js +2 -0
- package/dist/frontend/utils-CffiyuTo.js +19 -0
- package/dist/frontend/utils-hzdMVeCv.js +7 -0
- package/dist/frontend/utils.d.ts +4 -0
- package/dist/frontend/utils.js +2 -0
- package/dist/frontend/x-CzBsnJ2x.js +25 -0
- package/dist/frontend-ssr/api/attachments.js +2 -0
- package/dist/frontend-ssr/api/categories.js +2 -0
- package/dist/frontend-ssr/api/documents.js +2 -0
- package/dist/frontend-ssr/api/folders.js +2 -0
- package/dist/frontend-ssr/api/settings.js +2 -0
- package/dist/frontend-ssr/api/share.js +2 -0
- package/dist/frontend-ssr/api/tags.js +2 -0
- package/dist/frontend-ssr/assets/CategoryDialog-C2xaZKHq.js +584 -0
- package/dist/frontend-ssr/assets/ConfirmDialog-DjMFKc0V.js +420 -0
- package/dist/frontend-ssr/assets/CreateSnapshotDialog-BRw1xJW1.js +214 -0
- package/dist/frontend-ssr/assets/DatePicker-DnXniwlZ.js +312 -0
- package/dist/frontend-ssr/assets/DeleteDialog-BCfZy3Zn.js +154 -0
- package/dist/frontend-ssr/assets/FolderDialog-Dq7I2cKZ.js +429 -0
- package/dist/frontend-ssr/assets/FolderNode-DRfBfpft.js +171 -0
- package/dist/frontend-ssr/assets/FolderTreeSelector-DZNZ2oI6.js +147 -0
- package/dist/frontend-ssr/assets/Icon-B0Zqppjo.js +231 -0
- package/dist/frontend-ssr/assets/SettingsDialog-CX8Noa8A.js +1107 -0
- package/dist/frontend-ssr/assets/ShareDialog-Cge49ZdJ.js +54 -0
- package/dist/frontend-ssr/assets/TagCreateDialog-EAChgBF-.js +264 -0
- package/dist/frontend-ssr/assets/api-keys-DFqX39MT.js +35 -0
- package/dist/frontend-ssr/assets/attachments-CWBxE3Vz.js +85 -0
- package/dist/frontend-ssr/assets/auth-client-x26kqY8Z.js +1286 -0
- package/dist/frontend-ssr/assets/camera-CdxscTw-.js +84 -0
- package/dist/frontend-ssr/assets/categories-AOqgcsn4.js +75 -0
- package/dist/frontend-ssr/assets/chevron-down-CSSNGNh_.js +80 -0
- package/dist/frontend-ssr/assets/chevron-right-B4p7Sk6X.js +80 -0
- package/dist/frontend-ssr/assets/circle-check-CI1v4vYh.js +84 -0
- package/dist/frontend-ssr/assets/client-DZMkDkDn.js +129 -0
- package/dist/frontend-ssr/assets/clipboard-CXOaoz2W.js +30 -0
- package/dist/frontend-ssr/assets/clock-IL-eX2di.js +84 -0
- package/dist/frontend-ssr/assets/context-jz1GGEUi.js +45 -0
- package/dist/frontend-ssr/assets/copy-CjV57nGQ.js +87 -0
- package/dist/frontend-ssr/assets/db-CnxeO66n.js +65 -0
- package/dist/frontend-ssr/assets/dialog-BOV1u6zP.js +157 -0
- package/dist/frontend-ssr/assets/dndzone-DMvTO_Jz.js +2114 -0
- package/dist/frontend-ssr/assets/document-drop-coordinator-CEaYACsC.js +109 -0
- package/dist/frontend-ssr/assets/documents-BnOTRdTY.js +108 -0
- package/dist/frontend-ssr/assets/editorExtensions-DUzwndMy.js +186 -0
- package/dist/frontend-ssr/assets/ellipsis-vertical-C-0hgkZn.js +555 -0
- package/dist/frontend-ssr/assets/floating-layer-anchor-uzw9K8qN.js +6114 -0
- package/dist/frontend-ssr/assets/folder-DChhG7qN.js +80 -0
- package/dist/frontend-ssr/assets/folders-CTfbS24J.js +127 -0
- package/dist/frontend-ssr/assets/identity-B3uHoDtf.js +99 -0
- package/dist/frontend-ssr/assets/input-DezGsU3y.js +19 -0
- package/dist/frontend-ssr/assets/keyboard.svelte-BgF47N3L.js +174 -0
- package/dist/frontend-ssr/assets/label-Bj8-TfFN.js +21 -0
- package/dist/frontend-ssr/assets/loader-circle-DZsrZ-er.js +80 -0
- package/dist/frontend-ssr/assets/markdown-CjqvGi5W.js +20 -0
- package/dist/frontend-ssr/assets/messages-DhXqlcJI.js +11125 -0
- package/dist/frontend-ssr/assets/resolve-BqHozBXl.js +32 -0
- package/dist/frontend-ssr/assets/rotate-ccw-BlgWwaiq.js +80 -0
- package/dist/frontend-ssr/assets/select-value-DngdSmLI.js +1526 -0
- package/dist/frontend-ssr/assets/settings-E6qSAWM2.js +64 -0
- package/dist/frontend-ssr/assets/share-BTBJelxA.js +30 -0
- package/dist/frontend-ssr/assets/subfolders-refresh-store.svelte-DAh4gT16.js +77 -0
- package/dist/frontend-ssr/assets/tag-GZEuGWk1.js +166 -0
- package/dist/frontend-ssr/assets/tag-store.svelte-DPodKj6Z.js +21 -0
- package/dist/frontend-ssr/assets/tags-BId2wdYd.js +49 -0
- package/dist/frontend-ssr/assets/textarea-Dev-qSEc.js +21 -0
- package/dist/frontend-ssr/assets/theme.svelte-Co0-ssaD.js +67 -0
- package/dist/frontend-ssr/assets/utils-DtlPPXpJ.js +9 -0
- package/dist/frontend-ssr/assets/utils-DvZnctjz.js +23 -0
- package/dist/frontend-ssr/collaboration.js +39 -0
- package/dist/frontend-ssr/components/category-dialog.js +2 -0
- package/dist/frontend-ssr/components/create-snapshot-dialog.js +2 -0
- package/dist/frontend-ssr/components/delete-dialog.js +2 -0
- package/dist/frontend-ssr/components/editor/document-editor.js +2499 -0
- package/dist/frontend-ssr/components/editor/document-title.js +11 -0
- package/dist/frontend-ssr/components/editor/docx-serializer.js +186 -0
- package/dist/frontend-ssr/components/editor/extensions.js +2 -0
- package/dist/frontend-ssr/components/editor/markdown-toggle.js +20 -0
- package/dist/frontend-ssr/components/editor/markdown.js +2 -0
- package/dist/frontend-ssr/components/folder-node.js +2 -0
- package/dist/frontend-ssr/components/folder-tree-selector.js +2 -0
- package/dist/frontend-ssr/components/save-as-dialog.js +280 -0
- package/dist/frontend-ssr/components/settings.js +2 -0
- package/dist/frontend-ssr/components/share-dialog.js +2 -0
- package/dist/frontend-ssr/components/sidebar.js +2033 -0
- package/dist/frontend-ssr/components/tag-create-dialog.js +2 -0
- package/dist/frontend-ssr/components/version-history.js +370 -0
- package/dist/frontend-ssr/dashboard.js +2542 -0
- package/dist/frontend-ssr/doc-tabs.js +23 -0
- package/dist/frontend-ssr/document-drop-coordinator.js +2 -0
- package/dist/frontend-ssr/extension.js +13 -0
- package/dist/frontend-ssr/folder-refresh.js +2 -0
- package/dist/frontend-ssr/i18n.js +10 -0
- package/dist/frontend-ssr/keyboard.js +2 -0
- package/dist/frontend-ssr/offline/identity.js +2 -0
- package/dist/frontend-ssr/search.js +332 -0
- package/dist/frontend-ssr/shared-document.js +273 -0
- package/dist/frontend-ssr/theme.js +9 -0
- package/dist/frontend-ssr/types.js +1 -0
- package/dist/frontend-ssr/utils/clipboard.js +2 -0
- package/dist/frontend-ssr/utils/dndzone.js +2 -0
- package/dist/frontend-ssr/utils.js +2 -0
- package/package.json +130 -1
- package/packages/cli/src/index.ts +1 -1
- package/packages/db/src/schema.ts +3 -0
- package/packages/mcp-server/src/index.ts +1 -1
- package/dist/frontend/DatePicker-BcMD49PV.js +0 -275
- package/dist/frontend/ShareDialog-Dzh7rV7J.js +0 -1317
- package/dist/frontend/client-C6QQGb0e.js +0 -2766
- package/dist/frontend/input-ieWIt8I7.js +0 -257
- package/dist/frontend/messages-CTGAsqFu.js +0 -1106
- package/dist/frontend/resolve-Bl6xmJl_.js +0 -2068
- package/dist/frontend/tag-C5xrg-bb.js +0 -53
- package/dist/frontend/tag-store.svelte-B3839FYq.js +0 -6152
- package/dist/frontend/theme.svelte-ei0QxXa8.js +0 -49
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { Ar as e, Br as t, Dr as n, Er as r, Fr as i, Ir as a, Lr as o, Mr as s, Nr as c, Or as l, Pr as u, Rr as d, Tr as f, Vr as p, Yn as m, Zn as h, ir as g, jr as _, kr as v, zr as y } from "./messages-BpYaLbzE.js";
|
|
2
|
+
import { t as b } from "./clipboard-Cgzxc0_R.js";
|
|
3
|
+
import { n as x } from "./share-Cu7SSJuJ.js";
|
|
4
|
+
import { h as S, u as C } from "./keyboard.svelte-CApmX0vl.js";
|
|
5
|
+
import "svelte/internal/disclose-version";
|
|
6
|
+
import * as w from "svelte/internal/client";
|
|
7
|
+
//#region src/lib/components/ShareDialog.svelte
|
|
8
|
+
var ee = w.from_html("<input type=\"password\" class=\"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring\"/>"), te = w.from_html("<button> </button>"), T = w.from_html("<span class=\"inline-flex items-center gap-1 rounded-md bg-secondary px-2 py-0.5 text-xs\"> <button class=\"text-muted-foreground hover:text-foreground\">×</button></span>"), E = w.from_html("<div class=\"flex flex-wrap gap-1.5\"></div>"), D = w.from_html("<p class=\"text-xs text-destructive\"> </p>"), O = w.from_html("<div class=\"space-y-4\"><div class=\"flex items-center justify-between\"><span class=\"text-sm font-medium\"> </span> <button role=\"switch\"><span></span></button></div> <!> <div class=\"space-y-2\"><span class=\"text-sm font-medium\"> </span> <div class=\"flex gap-2\"></div></div> <div class=\"space-y-2\"><span class=\"text-sm font-medium\"> </span> <div class=\"flex gap-2\"><input type=\"email\" placeholder=\"guest@email.com\" class=\"flex h-9 flex-1 rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring\"/> <button class=\"rounded-md border border-border px-3 py-1.5 text-sm font-medium hover:bg-accent\"> </button></div> <!></div> <!> <button class=\"w-full rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50\"> </button></div>"), k = w.from_html("<div class=\"space-y-4\"><p class=\"text-sm text-muted-foreground\"> </p> <div class=\"flex items-center gap-2\"><code class=\"flex-1 truncate rounded-md bg-muted px-3 py-2 text-sm\"> </code> <button class=\"rounded-md bg-primary px-3 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90\"> </button></div> <button class=\"w-full rounded-md border border-border px-4 py-2 text-sm font-medium hover:bg-accent\"> </button></div>"), A = w.from_html("<div class=\"fixed inset-0 layer-modal flex items-center justify-center\"><button class=\"absolute inset-0 bg-black/50\"></button> <div class=\"relative z-10 w-full max-w-md rounded-lg border border-border bg-background p-6 shadow-lg\" role=\"dialog\" aria-modal=\"true\"><div class=\"mb-4 flex items-center justify-between\"><h2 class=\"text-lg font-semibold\"> </h2> <button class=\"rounded-md p-1 text-muted-foreground hover:bg-accent hover:text-foreground\">✕</button></div> <!></div></div>");
|
|
9
|
+
function j(j, M) {
|
|
10
|
+
w.push(M, !0);
|
|
11
|
+
let N = w.prop(M, "open", 15, !1), P = w.prop(M, "documentId", 3, ""), F = w.prop(M, "documentTitle", 3, ""), I = w.prop(M, "folderId", 3, ""), L = w.prop(M, "folderName", 3, ""), R = w.prop(M, "categoryId", 3, ""), z = w.prop(M, "categoryName", 3, ""), B = w.state(!1), V = w.state(""), H = w.state("7d"), U = w.state(""), W = w.state(w.proxy([])), G = w.state(""), K = w.state(!1), q = w.state(!1), J = w.state("");
|
|
12
|
+
w.user_effect(() => (C({
|
|
13
|
+
id: "share-dialog-escape",
|
|
14
|
+
keys: "escape",
|
|
15
|
+
description: "Close share dialog",
|
|
16
|
+
scope: "dialog",
|
|
17
|
+
enabled: N(),
|
|
18
|
+
overrideInput: !0,
|
|
19
|
+
handler: () => {
|
|
20
|
+
N() && Q();
|
|
21
|
+
}
|
|
22
|
+
}), () => {
|
|
23
|
+
S("share-dialog-escape");
|
|
24
|
+
}));
|
|
25
|
+
function Y() {
|
|
26
|
+
let e = w.get(U).trim();
|
|
27
|
+
e?.includes("@") && !w.get(W).includes(e) && (w.set(W, [...w.get(W), e], !0), w.set(U, ""));
|
|
28
|
+
}
|
|
29
|
+
function X(e) {
|
|
30
|
+
w.set(W, w.get(W).filter((t) => t !== e), !0);
|
|
31
|
+
}
|
|
32
|
+
async function ne() {
|
|
33
|
+
w.set(q, !0), w.set(J, "");
|
|
34
|
+
try {
|
|
35
|
+
let e = await x({
|
|
36
|
+
documentId: P() || void 0,
|
|
37
|
+
folderId: I() || void 0,
|
|
38
|
+
categoryId: R() || void 0,
|
|
39
|
+
password: w.get(B) ? w.get(V) : void 0,
|
|
40
|
+
expiresIn: w.get(H),
|
|
41
|
+
guestEmails: w.get(W).length > 0 ? w.get(W) : void 0
|
|
42
|
+
});
|
|
43
|
+
w.set(G, `${window.location.origin}/s/${e.token}`);
|
|
44
|
+
} catch (e) {
|
|
45
|
+
w.set(J, e instanceof Error ? e.message : g(), !0), console.error("ShareDialog: createShareLink failed", e);
|
|
46
|
+
} finally {
|
|
47
|
+
w.set(q, !1);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
async function Z() {
|
|
51
|
+
w.get(G) && (await b(w.get(G)), w.set(K, !0), setTimeout(() => {
|
|
52
|
+
w.set(K, !1);
|
|
53
|
+
}, 2e3));
|
|
54
|
+
}
|
|
55
|
+
function Q() {
|
|
56
|
+
N(!1), w.set(G, ""), w.set(B, !1), w.set(V, ""), w.set(H, "7d"), w.set(W, [], !0), w.set(J, "");
|
|
57
|
+
}
|
|
58
|
+
var $ = w.comment(), re = w.first_child($), ie = (g) => {
|
|
59
|
+
var b = A(), x = w.child(b), S = w.sibling(x, 2), C = w.child(S), j = w.child(C), M = w.child(j);
|
|
60
|
+
w.reset(j);
|
|
61
|
+
var N = w.sibling(j, 2);
|
|
62
|
+
w.reset(C);
|
|
63
|
+
var P = w.sibling(C, 2), I = (n) => {
|
|
64
|
+
var r = O(), f = w.child(r), p = w.child(f), m = w.child(p, !0);
|
|
65
|
+
w.reset(p);
|
|
66
|
+
var h = w.sibling(p, 2), g = w.child(h);
|
|
67
|
+
w.reset(h), w.reset(f);
|
|
68
|
+
var b = w.sibling(f, 2), x = (e) => {
|
|
69
|
+
var t = ee();
|
|
70
|
+
w.remove_input_defaults(t), w.template_effect((e) => w.set_attribute(t, "placeholder", e), [() => a()]), w.bind_value(t, () => w.get(V), (e) => w.set(V, e)), w.append(e, t);
|
|
71
|
+
};
|
|
72
|
+
w.if(b, (e) => {
|
|
73
|
+
w.get(B) && e(x);
|
|
74
|
+
});
|
|
75
|
+
var S = w.sibling(b, 2), C = w.child(S), k = w.child(C, !0);
|
|
76
|
+
w.reset(C);
|
|
77
|
+
var A = w.sibling(C, 2);
|
|
78
|
+
w.each(A, 21, () => [
|
|
79
|
+
["1h", c()],
|
|
80
|
+
["1d", s()],
|
|
81
|
+
["7d", _()],
|
|
82
|
+
["30d", e()],
|
|
83
|
+
["never", u()]
|
|
84
|
+
], w.index, (e, t) => {
|
|
85
|
+
var n = w.derived(() => w.to_array(w.get(t), 2));
|
|
86
|
+
let r = () => w.get(n)[0], i = () => w.get(n)[1];
|
|
87
|
+
var a = te(), o = w.child(a, !0);
|
|
88
|
+
w.reset(a), w.template_effect(() => {
|
|
89
|
+
w.set_class(a, 1, `rounded-md border px-2.5 py-1 text-xs font-medium transition-colors
|
|
90
|
+
${w.get(H) === r() ? "border-primary bg-primary text-primary-foreground" : "border-border text-muted-foreground hover:bg-accent"}`), w.set_text(o, i());
|
|
91
|
+
}), w.delegated("click", a, () => {
|
|
92
|
+
w.set(H, r(), !0);
|
|
93
|
+
}), w.append(e, a);
|
|
94
|
+
}), w.reset(A), w.reset(S);
|
|
95
|
+
var j = w.sibling(S, 2), M = w.child(j), N = w.child(M, !0);
|
|
96
|
+
w.reset(M);
|
|
97
|
+
var P = w.sibling(M, 2), F = w.child(P);
|
|
98
|
+
w.remove_input_defaults(F);
|
|
99
|
+
var I = w.sibling(F, 2), L = w.child(I, !0);
|
|
100
|
+
w.reset(I), w.reset(P);
|
|
101
|
+
var R = w.sibling(P, 2), z = (e) => {
|
|
102
|
+
var t = E();
|
|
103
|
+
w.each(t, 21, () => w.get(W), w.index, (e, t) => {
|
|
104
|
+
var n = T(), r = w.child(n), i = w.sibling(r);
|
|
105
|
+
w.reset(n), w.template_effect(() => w.set_text(r, `${w.get(t) ?? ""} `)), w.delegated("click", i, () => X(w.get(t))), w.append(e, n);
|
|
106
|
+
}), w.reset(t), w.append(e, t);
|
|
107
|
+
};
|
|
108
|
+
w.if(R, (e) => {
|
|
109
|
+
w.get(W).length > 0 && e(z);
|
|
110
|
+
}), w.reset(j);
|
|
111
|
+
var G = w.sibling(j, 2), K = (e) => {
|
|
112
|
+
var t = D(), n = w.child(t, !0);
|
|
113
|
+
w.reset(t), w.template_effect(() => w.set_text(n, w.get(J))), w.append(e, t);
|
|
114
|
+
};
|
|
115
|
+
w.if(G, (e) => {
|
|
116
|
+
w.get(J) && e(K);
|
|
117
|
+
});
|
|
118
|
+
var Z = w.sibling(G, 2), Q = w.child(Z, !0);
|
|
119
|
+
w.reset(Z), w.reset(r), w.template_effect((e, t, n, r, i, a) => {
|
|
120
|
+
w.set_text(m, e), w.set_class(h, 1, `relative inline-flex h-5 w-9 items-center rounded-full transition-colors ${w.get(B) ? "bg-primary" : "bg-input"}`), w.set_attribute(h, "aria-checked", w.get(B)), w.set_attribute(h, "aria-label", t), w.set_class(g, 1, `inline-block h-4 w-4 rounded-full bg-white shadow transition-transform ${w.get(B) ? "translate-x-4" : "translate-x-0.5"}`), w.set_text(k, n), w.set_text(N, r), w.set_text(L, i), Z.disabled = w.get(q), w.set_text(Q, a);
|
|
121
|
+
}, [
|
|
122
|
+
() => d(),
|
|
123
|
+
() => o(),
|
|
124
|
+
() => i(),
|
|
125
|
+
() => v(),
|
|
126
|
+
() => l(),
|
|
127
|
+
() => w.get(q) ? y() : t()
|
|
128
|
+
]), w.delegated("click", h, () => {
|
|
129
|
+
w.set(B, !w.get(B));
|
|
130
|
+
}), w.delegated("keydown", F, (e) => {
|
|
131
|
+
e.key === "Enter" && (e.preventDefault(), Y());
|
|
132
|
+
}), w.bind_value(F, () => w.get(U), (e) => w.set(U, e)), w.delegated("click", I, Y), w.delegated("click", Z, ne), w.append(n, r);
|
|
133
|
+
}, R = (e) => {
|
|
134
|
+
var t = k(), i = w.child(t), a = w.child(i, !0);
|
|
135
|
+
w.reset(i);
|
|
136
|
+
var o = w.sibling(i, 2), s = w.child(o), c = w.child(s, !0);
|
|
137
|
+
w.reset(s);
|
|
138
|
+
var l = w.sibling(s, 2), u = w.child(l, !0);
|
|
139
|
+
w.reset(l), w.reset(o);
|
|
140
|
+
var d = w.sibling(o, 2), p = w.child(d, !0);
|
|
141
|
+
w.reset(d), w.reset(t), w.template_effect((e, t, n) => {
|
|
142
|
+
w.set_text(a, e), w.set_text(c, w.get(G)), w.set_text(u, t), w.set_text(p, n);
|
|
143
|
+
}, [
|
|
144
|
+
() => f(),
|
|
145
|
+
() => w.get(K) ? r() : n(),
|
|
146
|
+
() => m()
|
|
147
|
+
]), w.delegated("click", l, Z), w.delegated("click", d, Q), w.append(e, t);
|
|
148
|
+
};
|
|
149
|
+
w.if(P, (e) => {
|
|
150
|
+
w.get(G) ? e(R, -1) : e(I);
|
|
151
|
+
}), w.reset(S), w.reset(b), w.template_effect((e, t, n) => {
|
|
152
|
+
w.set_attribute(x, "aria-label", e), w.set_text(M, `${t ?? ""} "${(z() || L() || F()) ?? ""}"`), w.set_attribute(N, "aria-label", n);
|
|
153
|
+
}, [
|
|
154
|
+
() => h(),
|
|
155
|
+
() => p(),
|
|
156
|
+
() => h()
|
|
157
|
+
]), w.delegated("click", x, Q), w.delegated("click", N, Q), w.append(g, b);
|
|
158
|
+
};
|
|
159
|
+
w.if(re, (e) => {
|
|
160
|
+
N() && e(ie);
|
|
161
|
+
}), w.append(j, $), w.pop();
|
|
162
|
+
}
|
|
163
|
+
w.delegate(["click", "keydown"]);
|
|
164
|
+
//#endregion
|
|
165
|
+
export { j as t };
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import { t as e } from "./loader-circle-BA6aLO71.js";
|
|
2
|
+
import { a as t, i as n, n as r, o as i, r as a, t as o } from "./dialog-D6NxYVmy.js";
|
|
3
|
+
import { t as s } from "./label-CW9rxoAb.js";
|
|
4
|
+
import { $r as c, Qn as l, ei as u, ir as d, nr as f, qn as p, ti as m, tr as h } from "./messages-BpYaLbzE.js";
|
|
5
|
+
import { t as g } from "./utils-CffiyuTo.js";
|
|
6
|
+
import { t as _ } from "./input-B5Rak-5G.js";
|
|
7
|
+
import { c as v, l as y, n as b, r as x } from "./tags-CtCV0Djo.js";
|
|
8
|
+
import "svelte/internal/disclose-version";
|
|
9
|
+
import * as S from "svelte/internal/client";
|
|
10
|
+
//#region src/lib/components/TagCreateDialog.svelte
|
|
11
|
+
var C = S.from_html("<!> <!>", 1), w = S.from_html("<p id=\"tag-name-error\" class=\"text-xs text-destructive\"> </p>"), T = S.from_html("<button type=\"button\"></button>"), E = S.from_html("<p class=\"text-xs text-destructive\" role=\"alert\"> </p>"), D = S.from_html("<!> ", 1), O = S.from_html("<!> <form class=\"space-y-4\"><div class=\"space-y-2\"><!> <!> <!></div> <div class=\"space-y-2\"><!> <div id=\"tag-color\" class=\"flex flex-wrap gap-2\"><!> <label title=\"Custom color\"><input type=\"color\" class=\"absolute inset-0 h-full w-full cursor-pointer opacity-0\" aria-label=\"Custom color\"/></label></div></div> <!></form> <!>", 1);
|
|
12
|
+
function k(k, A) {
|
|
13
|
+
S.push(A, !0);
|
|
14
|
+
let j = [
|
|
15
|
+
"#ef4444",
|
|
16
|
+
"#f97316",
|
|
17
|
+
"#f59e0b",
|
|
18
|
+
"#eab308",
|
|
19
|
+
"#84cc16",
|
|
20
|
+
"#22c55e",
|
|
21
|
+
"#10b981",
|
|
22
|
+
"#06b6d4",
|
|
23
|
+
"#3b82f6",
|
|
24
|
+
"#8b5cf6",
|
|
25
|
+
"#ec4899"
|
|
26
|
+
], M = j[9], N = S.prop(A, "open", 15, !1), P = S.prop(A, "mode", 3, "create"), F = S.prop(A, "tag", 3, null), I = S.state(""), L = S.state(S.proxy(M)), R = S.state(null), z = S.state(null), B = S.state(!1), V = S.derived(() => P() === "edit"), H = S.derived(() => S.get(V) ? u() : m()), U = S.derived(() => S.get(B) ? p() : S.get(V) ? f() : l());
|
|
27
|
+
function W() {
|
|
28
|
+
S.set(I, ""), S.set(L, M, !0), S.set(R, null), S.set(z, null), S.set(B, !1);
|
|
29
|
+
}
|
|
30
|
+
function G(e) {
|
|
31
|
+
if (!e) {
|
|
32
|
+
W();
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
S.set(I, e.name, !0), S.set(L, e.color ?? M, !0), S.set(R, null), S.set(z, null), S.set(B, !1);
|
|
36
|
+
}
|
|
37
|
+
function K() {
|
|
38
|
+
N(!1), W(), A.onClose?.();
|
|
39
|
+
}
|
|
40
|
+
function q(e) {
|
|
41
|
+
e ? G(F()) : (W(), N(!1), A.onClose?.());
|
|
42
|
+
}
|
|
43
|
+
function J(e) {
|
|
44
|
+
e.preventDefault(), S.set(R, null), S.set(z, null);
|
|
45
|
+
let t = S.get(I).trim();
|
|
46
|
+
if (t.length === 0) {
|
|
47
|
+
S.set(R, c(), !0);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (S.get(V) && F()) {
|
|
51
|
+
let e = y.safeParse({
|
|
52
|
+
name: t,
|
|
53
|
+
color: S.get(L)
|
|
54
|
+
});
|
|
55
|
+
if (!e.success) {
|
|
56
|
+
let t = e.error.issues[0];
|
|
57
|
+
S.set(R, t?.message ?? d(), !0);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
X(F().id, e.data);
|
|
61
|
+
} else {
|
|
62
|
+
let e = x.safeParse({
|
|
63
|
+
name: t,
|
|
64
|
+
color: S.get(L)
|
|
65
|
+
});
|
|
66
|
+
if (!e.success) {
|
|
67
|
+
let t = e.error.issues[0];
|
|
68
|
+
S.set(R, t?.message ?? d(), !0);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
Y(e.data.name, S.get(L));
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
async function Y(e, t) {
|
|
75
|
+
S.set(B, !0);
|
|
76
|
+
try {
|
|
77
|
+
let n = await b(e, t);
|
|
78
|
+
A.onCreated?.(n), K();
|
|
79
|
+
} catch (e) {
|
|
80
|
+
S.set(z, e instanceof Error ? e.message : d(), !0), console.error("TagCreateDialog: createTag failed", e);
|
|
81
|
+
} finally {
|
|
82
|
+
S.set(B, !1);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
async function X(e, t) {
|
|
86
|
+
S.set(B, !0);
|
|
87
|
+
try {
|
|
88
|
+
let n = await v(e, t);
|
|
89
|
+
A.onUpdated?.(n), K();
|
|
90
|
+
} catch (e) {
|
|
91
|
+
S.set(z, e instanceof Error ? e.message : d(), !0), console.error("TagCreateDialog: updateTag failed", e);
|
|
92
|
+
} finally {
|
|
93
|
+
S.set(B, !1);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
function Z(e) {
|
|
97
|
+
e.key === "Enter" && !S.get(B) && (e.preventDefault(), J(new Event("submit")));
|
|
98
|
+
}
|
|
99
|
+
S.user_effect(() => {
|
|
100
|
+
N() && P() === "edit" && F() && (S.set(I, F().name, !0), S.set(L, F().color ?? M, !0), S.set(R, null), S.set(z, null));
|
|
101
|
+
}), t(k, {
|
|
102
|
+
onOpenChange: q,
|
|
103
|
+
get open() {
|
|
104
|
+
return N();
|
|
105
|
+
},
|
|
106
|
+
set open(e) {
|
|
107
|
+
N(e);
|
|
108
|
+
},
|
|
109
|
+
children: (t, l) => {
|
|
110
|
+
var u = O(), d = S.first_child(u);
|
|
111
|
+
r(d, {
|
|
112
|
+
children: (e, t) => {
|
|
113
|
+
var r = C(), i = S.first_child(r);
|
|
114
|
+
o(i, {
|
|
115
|
+
children: (e, t) => {
|
|
116
|
+
S.next();
|
|
117
|
+
var n = S.text();
|
|
118
|
+
S.template_effect(() => S.set_text(n, S.get(H))), S.append(e, n);
|
|
119
|
+
},
|
|
120
|
+
$$slots: { default: !0 }
|
|
121
|
+
}), n(S.sibling(i, 2), {
|
|
122
|
+
children: (e, t) => {
|
|
123
|
+
S.next();
|
|
124
|
+
var n = S.text();
|
|
125
|
+
S.template_effect((e) => S.set_text(n, e), [() => c()]), S.append(e, n);
|
|
126
|
+
},
|
|
127
|
+
$$slots: { default: !0 }
|
|
128
|
+
}), S.append(e, r);
|
|
129
|
+
},
|
|
130
|
+
$$slots: { default: !0 }
|
|
131
|
+
});
|
|
132
|
+
var f = S.sibling(d, 2), p = S.child(f), m = S.child(p);
|
|
133
|
+
s(m, {
|
|
134
|
+
for: "tag-name",
|
|
135
|
+
class: "sr-only",
|
|
136
|
+
children: (e, t) => {
|
|
137
|
+
S.next();
|
|
138
|
+
var n = S.text();
|
|
139
|
+
S.template_effect((e) => S.set_text(n, e), [() => c()]), S.append(e, n);
|
|
140
|
+
},
|
|
141
|
+
$$slots: { default: !0 }
|
|
142
|
+
});
|
|
143
|
+
var v = S.sibling(m, 2);
|
|
144
|
+
{
|
|
145
|
+
let e = S.derived(() => c()), t = S.derived(() => S.get(R) ? "true" : void 0), n = S.derived(() => S.get(R) ? "tag-name-error" : void 0);
|
|
146
|
+
_(v, {
|
|
147
|
+
id: "tag-name",
|
|
148
|
+
name: "name",
|
|
149
|
+
type: "text",
|
|
150
|
+
get placeholder() {
|
|
151
|
+
return S.get(e);
|
|
152
|
+
},
|
|
153
|
+
maxlength: 50,
|
|
154
|
+
required: !0,
|
|
155
|
+
get disabled() {
|
|
156
|
+
return S.get(B);
|
|
157
|
+
},
|
|
158
|
+
get "aria-invalid"() {
|
|
159
|
+
return S.get(t);
|
|
160
|
+
},
|
|
161
|
+
get "aria-describedby"() {
|
|
162
|
+
return S.get(n);
|
|
163
|
+
},
|
|
164
|
+
autocomplete: "off",
|
|
165
|
+
onkeydown: Z,
|
|
166
|
+
get value() {
|
|
167
|
+
return S.get(I);
|
|
168
|
+
},
|
|
169
|
+
set value(e) {
|
|
170
|
+
S.set(I, e, !0);
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
var y = S.sibling(v, 2), b = (e) => {
|
|
175
|
+
var t = w(), n = S.child(t, !0);
|
|
176
|
+
S.reset(t), S.template_effect(() => S.set_text(n, S.get(R))), S.append(e, t);
|
|
177
|
+
};
|
|
178
|
+
S.if(y, (e) => {
|
|
179
|
+
S.get(R) && e(b);
|
|
180
|
+
}), S.reset(p);
|
|
181
|
+
var x = S.sibling(p, 2), k = S.child(x);
|
|
182
|
+
s(k, {
|
|
183
|
+
for: "tag-color",
|
|
184
|
+
class: "text-xs text-muted-foreground",
|
|
185
|
+
children: (e, t) => {
|
|
186
|
+
S.next();
|
|
187
|
+
var n = S.text("Color");
|
|
188
|
+
S.append(e, n);
|
|
189
|
+
},
|
|
190
|
+
$$slots: { default: !0 }
|
|
191
|
+
});
|
|
192
|
+
var A = S.sibling(k, 2), M = S.child(A);
|
|
193
|
+
S.each(M, 16, () => j, (e) => e, (e, t) => {
|
|
194
|
+
let n = S.derived(() => S.get(L) === t);
|
|
195
|
+
var r = T();
|
|
196
|
+
S.template_effect((e) => {
|
|
197
|
+
S.set_class(r, 1, e), S.set_style(r, `background-color: ${t ?? ""};`), S.set_attribute(r, "aria-label", `Color ${t ?? ""}`), S.set_attribute(r, "aria-pressed", S.get(n)), r.disabled = S.get(B);
|
|
198
|
+
}, [() => S.clsx(g("size-6 shrink-0 rounded-full border-2 transition-all", S.get(n) ? "scale-110 border-foreground" : "border-transparent hover:scale-105"))]), S.delegated("click", r, () => S.set(L, t, !0)), S.append(e, r);
|
|
199
|
+
});
|
|
200
|
+
var N = S.sibling(M, 2), P = S.child(N);
|
|
201
|
+
S.remove_input_defaults(P), S.reset(N), S.reset(A), S.reset(x);
|
|
202
|
+
var F = S.sibling(x, 2), V = (e) => {
|
|
203
|
+
var t = E(), n = S.child(t, !0);
|
|
204
|
+
S.reset(t), S.template_effect(() => S.set_text(n, S.get(z))), S.append(e, t);
|
|
205
|
+
};
|
|
206
|
+
S.if(F, (e) => {
|
|
207
|
+
S.get(z) && e(V);
|
|
208
|
+
}), S.reset(f), a(S.sibling(f, 2), {
|
|
209
|
+
class: "gap-2 max-sm:flex-col max-sm:items-stretch",
|
|
210
|
+
children: (t, n) => {
|
|
211
|
+
var r = C(), a = S.first_child(r);
|
|
212
|
+
i(a, {
|
|
213
|
+
variant: "outline",
|
|
214
|
+
type: "button",
|
|
215
|
+
onclick: K,
|
|
216
|
+
get disabled() {
|
|
217
|
+
return S.get(B);
|
|
218
|
+
},
|
|
219
|
+
children: (e, t) => {
|
|
220
|
+
S.next();
|
|
221
|
+
var n = S.text();
|
|
222
|
+
S.template_effect((e) => S.set_text(n, e), [() => h()]), S.append(e, n);
|
|
223
|
+
},
|
|
224
|
+
$$slots: { default: !0 }
|
|
225
|
+
});
|
|
226
|
+
var o = S.sibling(a, 2);
|
|
227
|
+
{
|
|
228
|
+
let t = S.derived(() => S.get(B) || S.get(I).trim().length === 0);
|
|
229
|
+
i(o, {
|
|
230
|
+
type: "submit",
|
|
231
|
+
onclick: J,
|
|
232
|
+
get disabled() {
|
|
233
|
+
return S.get(t);
|
|
234
|
+
},
|
|
235
|
+
children: (t, n) => {
|
|
236
|
+
var r = D(), i = S.first_child(r), a = (t) => {
|
|
237
|
+
e(t, { class: "mr-1 size-4 animate-spin" });
|
|
238
|
+
};
|
|
239
|
+
S.if(i, (e) => {
|
|
240
|
+
S.get(B) && e(a);
|
|
241
|
+
});
|
|
242
|
+
var o = S.sibling(i);
|
|
243
|
+
S.template_effect(() => S.set_text(o, ` ${S.get(U) ?? ""}`)), S.append(t, r);
|
|
244
|
+
},
|
|
245
|
+
$$slots: { default: !0 }
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
S.append(t, r);
|
|
249
|
+
},
|
|
250
|
+
$$slots: { default: !0 }
|
|
251
|
+
}), S.template_effect((e) => {
|
|
252
|
+
S.set_class(N, 1, e), S.set_style(N, `background-color: ${S.get(L) ?? ""};`), S.set_value(P, S.get(L)), P.disabled = S.get(B);
|
|
253
|
+
}, [() => S.clsx(g("relative inline-flex size-6 shrink-0 cursor-pointer items-center justify-center overflow-hidden rounded-full border-2 transition-all", j.includes(S.get(L)) ? "border-transparent hover:scale-105" : "scale-110 border-foreground"))]), S.event("submit", f, J), S.delegated("input", P, (e) => S.set(L, e.currentTarget.value, !0)), S.append(t, u);
|
|
254
|
+
},
|
|
255
|
+
$$slots: { default: !0 }
|
|
256
|
+
}), S.pop();
|
|
257
|
+
}
|
|
258
|
+
S.delegate(["click", "input"]);
|
|
259
|
+
//#endregion
|
|
260
|
+
export { k as t };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface Attachment { id: string; filename: string; mimeType: string; size: number; url: string; }
|
|
2
|
+
export interface AttachmentListResponse { items: Attachment[]; }
|
|
3
|
+
export declare function uploadAttachment(documentId: string, file: File): Promise<Attachment>;
|
|
4
|
+
export declare function listAttachments(documentId: string): Promise<AttachmentListResponse>;
|
|
5
|
+
export declare function isImageFile(file: File): boolean;
|
|
6
|
+
export declare function isFileSizeAllowed(file: File): boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "../categories-
|
|
1
|
+
import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "../categories-izQovv2w.js";
|
|
2
2
|
export { s as createCategory, r as createCategoryInputSchema, a as deleteCategory, n as listCategories, e as setDocumentCategory, i as setFolderCategory, o as updateCategory, t as updateCategoryInputSchema };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "../documents-
|
|
1
|
+
import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "../documents-BsDkvzCm.js";
|
|
2
2
|
export { s as clearDocumentsCache, r as createDocument, a as deleteDocument, n as getDocument, e as importDocument, i as importDocuments, o as listDocuments, t as updateDocument };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "../folders-
|
|
1
|
+
import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "../folders-CTuV_JtU.js";
|
|
2
2
|
export { s as createFolder, r as deleteDocument, a as deleteFolder, n as duplicateDocument, e as getFolder, i as getFolderPath, o as listFolders, t as updateFolder };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, i as t, n, r, t as i } from "../settings-
|
|
1
|
+
import { a as e, i as t, n, r, t as i } from "../settings-blyobazp.js";
|
|
2
2
|
export { i as deleteAccount, n as getEmbeddingConfig, r as getProfile, t as updateEmbeddingConfig, e as updateProfile };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export interface ShareLink { id: string; token: string; documentId?: string; folderId?: string; categoryId?: string; hasPassword: boolean; expiresAt?: string | null; createdAt: string; title?: string; type?: "document" | "folder" | "category"; guestEmails: string[]; }
|
|
2
|
+
export interface CreateShareLinkInput { documentId?: string; folderId?: string; categoryId?: string; password?: string; expiresIn?: "1h" | "1d" | "7d" | "30d" | "never"; guestEmails?: string[]; }
|
|
3
|
+
export declare function createShareLink(data: CreateShareLinkInput): Promise<ShareLink>;
|
|
4
|
+
export declare function listShareLinks(params?: { documentId?: string }): Promise<{ links: ShareLink[] }>;
|
|
5
|
+
export declare function revokeShareLink(id: string): Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c } from "../tags-
|
|
1
|
+
import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c } from "../tags-CtCV0Djo.js";
|
|
2
2
|
export { c as addTagToDocument, i as createTag, o as createTagInputSchema, n as deleteTag, e as getTag, a as listTags, s as removeTagFromDocument, t as updateTag, r as updateTagInputSchema };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { n as e } from "./client-GbtOH90i.js";
|
|
2
|
+
//#region src/lib/api/api-keys.ts
|
|
3
|
+
function t() {
|
|
4
|
+
return e("/api/keys");
|
|
5
|
+
}
|
|
6
|
+
function n(t) {
|
|
7
|
+
return e("/api/keys/global", {
|
|
8
|
+
method: "POST",
|
|
9
|
+
body: { name: t }
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
function r(t, n) {
|
|
13
|
+
return e(`/api/categories/${encodeURIComponent(t)}/keys`, {
|
|
14
|
+
method: "POST",
|
|
15
|
+
body: { name: n }
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function i(t) {
|
|
19
|
+
return e(`/api/keys/${encodeURIComponent(t)}`, { method: "DELETE" });
|
|
20
|
+
}
|
|
21
|
+
async function a(t) {
|
|
22
|
+
return (await e(`/api/keys/${encodeURIComponent(t)}/secret`)).key;
|
|
23
|
+
}
|
|
24
|
+
function o(e) {
|
|
25
|
+
for (let t of e) {
|
|
26
|
+
let e = /^category:([0-9a-f-]{36}):(read|edit|write)$/i.exec(t);
|
|
27
|
+
if (e?.[1]) return e[1];
|
|
28
|
+
}
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
function s(e, t) {
|
|
32
|
+
return t ?? e.prefix;
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
export { t as a, n as i, o as n, a as o, r, i as s, s as t };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { n as e } from "./client-GbtOH90i.js";
|
|
2
|
+
//#region src/lib/api/attachments.ts
|
|
3
|
+
var t = 25 * 1024 * 1024;
|
|
4
|
+
function n(t, n) {
|
|
5
|
+
return e(`/api/documents/${t}/attachments/presign`, {
|
|
6
|
+
method: "POST",
|
|
7
|
+
body: {
|
|
8
|
+
filename: n.name,
|
|
9
|
+
contentType: n.type,
|
|
10
|
+
size: n.size
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function r(t, n, r) {
|
|
15
|
+
return e(`/api/documents/${t}/attachments/confirm`, {
|
|
16
|
+
method: "POST",
|
|
17
|
+
body: {
|
|
18
|
+
key: n,
|
|
19
|
+
filename: r.name,
|
|
20
|
+
contentType: r.type,
|
|
21
|
+
size: r.size
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
async function i(e, t) {
|
|
26
|
+
let i = await n(e, t), a = new AbortController(), o = setTimeout(() => a.abort(), 5 * 6e4), s;
|
|
27
|
+
try {
|
|
28
|
+
s = await fetch(i.url, {
|
|
29
|
+
method: "PUT",
|
|
30
|
+
body: t,
|
|
31
|
+
headers: { "Content-Type": t.type },
|
|
32
|
+
signal: a.signal
|
|
33
|
+
});
|
|
34
|
+
} finally {
|
|
35
|
+
clearTimeout(o);
|
|
36
|
+
}
|
|
37
|
+
if (!s.ok) throw Error(`Storage upload failed: ${s.status} ${s.statusText}`);
|
|
38
|
+
return r(e, i.key, t);
|
|
39
|
+
}
|
|
40
|
+
function a(t) {
|
|
41
|
+
return e(`/api/documents/${t}/attachments`);
|
|
42
|
+
}
|
|
43
|
+
function o(e) {
|
|
44
|
+
return e.type.startsWith("image/");
|
|
45
|
+
}
|
|
46
|
+
function s(e) {
|
|
47
|
+
return e.size <= t;
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
export { n as a, a as i, s as n, i as o, o as r, r as t };
|