@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,62 @@
|
|
|
1
|
+
import { n as e } from "./client-GbtOH90i.js";
|
|
2
|
+
import { t } from "./auth-client-Cygmp1I2.js";
|
|
3
|
+
//#region src/lib/api/settings.ts
|
|
4
|
+
async function n() {
|
|
5
|
+
try {
|
|
6
|
+
let t = await e("/api/auth/get-session");
|
|
7
|
+
if (t.user?.name || t.user?.email) return t.user;
|
|
8
|
+
} catch {}
|
|
9
|
+
let { data: n } = await t.getSession();
|
|
10
|
+
return n?.user ? {
|
|
11
|
+
id: n.user.id ?? "",
|
|
12
|
+
name: n.user.name ?? "User",
|
|
13
|
+
email: n.user.email ?? "",
|
|
14
|
+
avatar: null
|
|
15
|
+
} : {
|
|
16
|
+
id: "",
|
|
17
|
+
name: "User",
|
|
18
|
+
email: "",
|
|
19
|
+
avatar: null
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
async function r(t) {
|
|
23
|
+
return e("/api/auth/update-user", {
|
|
24
|
+
method: "POST",
|
|
25
|
+
body: JSON.stringify({ name: t.name })
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
var i = "hiai-docs:embedding-config";
|
|
29
|
+
function a() {
|
|
30
|
+
if (typeof window > "u") return {
|
|
31
|
+
baseUrl: "",
|
|
32
|
+
apiKey: "",
|
|
33
|
+
model: "",
|
|
34
|
+
fallbackBaseUrl: null,
|
|
35
|
+
fallbackApiKey: null,
|
|
36
|
+
fallbackModel: null
|
|
37
|
+
};
|
|
38
|
+
try {
|
|
39
|
+
let e = localStorage.getItem(i);
|
|
40
|
+
if (e) return JSON.parse(e);
|
|
41
|
+
} catch {}
|
|
42
|
+
return {
|
|
43
|
+
baseUrl: "",
|
|
44
|
+
apiKey: "",
|
|
45
|
+
model: "",
|
|
46
|
+
fallbackBaseUrl: null,
|
|
47
|
+
fallbackApiKey: null,
|
|
48
|
+
fallbackModel: null
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function o(e) {
|
|
52
|
+
let t = {
|
|
53
|
+
...a(),
|
|
54
|
+
...e
|
|
55
|
+
};
|
|
56
|
+
return localStorage.setItem(i, JSON.stringify(t)), t;
|
|
57
|
+
}
|
|
58
|
+
async function s() {
|
|
59
|
+
await e("/api/auth/delete-user", { method: "POST" });
|
|
60
|
+
}
|
|
61
|
+
//#endregion
|
|
62
|
+
export { r as a, o as i, a as n, n as r, s as t };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { n as e } from "./client-GbtOH90i.js";
|
|
2
|
+
//#region src/lib/api/share.ts
|
|
3
|
+
function t(t) {
|
|
4
|
+
return !t.documentId && !t.folderId && !t.categoryId ? Promise.reject(/* @__PURE__ */ Error("createShareLink: documentId, folderId, or categoryId is required")) : e("/api/share", {
|
|
5
|
+
method: "POST",
|
|
6
|
+
body: JSON.stringify(t)
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
function n(t) {
|
|
10
|
+
return e(`/api/share${t?.documentId ? `?documentId=${t.documentId}` : ""}`);
|
|
11
|
+
}
|
|
12
|
+
function r(t) {
|
|
13
|
+
return t ? e(`/api/share/${t}`) : Promise.reject(/* @__PURE__ */ Error("getShareLink: token is required"));
|
|
14
|
+
}
|
|
15
|
+
function i(t) {
|
|
16
|
+
return e(`/api/share/${t}`, { method: "DELETE" });
|
|
17
|
+
}
|
|
18
|
+
function a(t, n) {
|
|
19
|
+
return e(`/api/share/${t}/guests`, {
|
|
20
|
+
method: "POST",
|
|
21
|
+
body: JSON.stringify({ email: n })
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function o(t, n) {
|
|
25
|
+
return e(`/api/share/${t}/guests/${encodeURIComponent(n)}`, { method: "DELETE" });
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
export { o as a, n as i, t as n, i as o, r, a as t };
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { t as e } from "./context-
|
|
2
|
-
import
|
|
1
|
+
import { t as e } from "./context-BMD6XTPe.js";
|
|
2
|
+
import "svelte/internal/disclose-version";
|
|
3
|
+
import * as t from "svelte/internal/client";
|
|
3
4
|
//#region src/lib/components/editor/shared-document.ts
|
|
4
|
-
var
|
|
5
|
+
var n = /^\/api\/attachments\/[0-9a-f-]+\/raw$/i, r = /* @__PURE__ */ new Set([
|
|
5
6
|
"http:",
|
|
6
7
|
"https:",
|
|
7
8
|
"mailto:"
|
|
8
9
|
]);
|
|
9
|
-
function
|
|
10
|
+
function i(e) {
|
|
10
11
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
11
12
|
}
|
|
12
|
-
function
|
|
13
|
+
function a(e, t) {
|
|
13
14
|
switch (e.type) {
|
|
14
15
|
case "bold": return `<strong>${t}</strong>`;
|
|
15
16
|
case "italic": return `<em>${t}</em>`;
|
|
@@ -17,88 +18,88 @@ function y(e, t) {
|
|
|
17
18
|
case "strikethrough": return `<s>${t}</s>`;
|
|
18
19
|
case "underline": return `<u>${t}</u>`;
|
|
19
20
|
case "code": return `<code>${t}</code>`;
|
|
20
|
-
case "link": return `<a href="${
|
|
21
|
-
case "highlight": return `<mark style="background-color: ${
|
|
21
|
+
case "link": return `<a href="${i(o(e.attrs?.href ?? "#"))}" target="_blank" rel="noopener noreferrer">${t}</a>`;
|
|
22
|
+
case "highlight": return `<mark style="background-color: ${i(e.attrs?.color ?? "#fde68a")}">${t}</mark>`;
|
|
22
23
|
default: return t;
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
|
-
function
|
|
26
|
+
function o(e) {
|
|
26
27
|
if (e.startsWith("#") || e.startsWith("/") || e.startsWith("./")) return e;
|
|
27
28
|
try {
|
|
28
29
|
let t = new URL(e);
|
|
29
|
-
return
|
|
30
|
+
return r.has(t.protocol) ? e : "#";
|
|
30
31
|
} catch {
|
|
31
32
|
return "#";
|
|
32
33
|
}
|
|
33
34
|
}
|
|
34
|
-
function
|
|
35
|
+
function s(e) {
|
|
35
36
|
let t = e?.textAlign;
|
|
36
37
|
return t !== "left" && t !== "center" && t !== "right" && t !== "justify" ? "" : ` style="text-align: ${t}"`;
|
|
37
38
|
}
|
|
38
|
-
function
|
|
39
|
+
function c(e) {
|
|
39
40
|
if (e.type === "text") {
|
|
40
|
-
let t =
|
|
41
|
-
for (let n of e.marks ?? []) t =
|
|
41
|
+
let t = i(e.text ?? "");
|
|
42
|
+
for (let n of e.marks ?? []) t = a(n, t);
|
|
42
43
|
return t;
|
|
43
44
|
}
|
|
44
|
-
return (e.content ?? []).map(
|
|
45
|
+
return (e.content ?? []).map(c).join("");
|
|
45
46
|
}
|
|
46
|
-
function
|
|
47
|
+
function l(e) {
|
|
47
48
|
let t = (e) => {
|
|
48
|
-
if (e.type === "text") return
|
|
49
|
-
let
|
|
49
|
+
if (e.type === "text") return c(e);
|
|
50
|
+
let r = s(e.attrs), a = (e.content ?? []).map(t).join("");
|
|
50
51
|
switch (e.type) {
|
|
51
|
-
case "paragraph": return `<p${
|
|
52
|
+
case "paragraph": return `<p${r}>${a}</p>`;
|
|
52
53
|
case "heading": {
|
|
53
54
|
let t = Math.min(Math.max(Number(e.attrs?.level ?? 1), 1), 6);
|
|
54
|
-
return `<h${t}${
|
|
55
|
+
return `<h${t}${r}>${(e.content ?? []).map(c).join("")}</h${t}>`;
|
|
55
56
|
}
|
|
56
|
-
case "bulletList": return `<ul${
|
|
57
|
+
case "bulletList": return `<ul${r}>${a}</ul>`;
|
|
57
58
|
case "orderedList": {
|
|
58
59
|
let t = Number(e.attrs?.start ?? 1);
|
|
59
|
-
return `<ol${Number.isSafeInteger(t) && t > 1 ? ` start="${t}"` : ""}${
|
|
60
|
+
return `<ol${Number.isSafeInteger(t) && t > 1 ? ` start="${t}"` : ""}${r}>${a}</ol>`;
|
|
60
61
|
}
|
|
61
|
-
case "listItem": return `<li${
|
|
62
|
-
case "taskList": return `<ul data-type="taskList">${
|
|
62
|
+
case "listItem": return `<li${r}>${a}</li>`;
|
|
63
|
+
case "taskList": return `<ul data-type="taskList">${a}</ul>`;
|
|
63
64
|
case "taskItem": {
|
|
64
65
|
let t = e.attrs?.checked === !0 || e.attrs?.checked === "true";
|
|
65
|
-
return `<li data-type="taskItem"${t ? " data-checked=\"true\"" : ""}><label><input type="checkbox" disabled${t ? " checked" : ""} /></label><div>${
|
|
66
|
+
return `<li data-type="taskItem"${t ? " data-checked=\"true\"" : ""}><label><input type="checkbox" disabled${t ? " checked" : ""} /></label><div>${a}</div></li>`;
|
|
66
67
|
}
|
|
67
|
-
case "blockquote": return `<blockquote${
|
|
68
|
-
case "table": return `<table><tbody>${
|
|
69
|
-
case "tableRow": return `<tr>${
|
|
70
|
-
case "tableHeader": return `<th${
|
|
71
|
-
case "tableCell": return `<td${
|
|
68
|
+
case "blockquote": return `<blockquote${r}>${a}</blockquote>`;
|
|
69
|
+
case "table": return `<table><tbody>${a}</tbody></table>`;
|
|
70
|
+
case "tableRow": return `<tr>${a}</tr>`;
|
|
71
|
+
case "tableHeader": return `<th${r}>${a}</th>`;
|
|
72
|
+
case "tableCell": return `<td${r}>${a}</td>`;
|
|
72
73
|
case "codeBlock": {
|
|
73
74
|
let t = e.attrs?.language ?? "";
|
|
74
|
-
return `<pre><code${t ? ` class="language-${
|
|
75
|
+
return `<pre><code${t ? ` class="language-${i(t)}"` : ""}>${a}</code></pre>`;
|
|
75
76
|
}
|
|
76
77
|
case "horizontalRule": return "<hr />";
|
|
77
78
|
case "hardBreak": return "<br />";
|
|
78
79
|
case "image": {
|
|
79
|
-
let t = e.attrs?.src ?? "",
|
|
80
|
-
return
|
|
80
|
+
let t = e.attrs?.src ?? "", r = e.attrs?.alt ?? "", a = Number(e.attrs?.width), o = Number(e.attrs?.height), s = `${Number.isFinite(a) && a > 0 ? ` width="${Math.round(a)}"` : ""}${Number.isFinite(o) && o > 0 ? ` height="${Math.round(o)}"` : ""}`;
|
|
81
|
+
return n.test(t) ? `<img data-shared-attachment-src="${i(t)}" alt="${i(r)}"${s} />` : `<img src="${i(t)}" alt="${i(r)}"${s} />`;
|
|
81
82
|
}
|
|
82
|
-
default: return
|
|
83
|
+
default: return a;
|
|
83
84
|
}
|
|
84
85
|
};
|
|
85
86
|
return (e.content ?? []).map(t).join("");
|
|
86
87
|
}
|
|
87
|
-
function
|
|
88
|
+
function u(e) {
|
|
88
89
|
return e.replace(/<li>(\s*<input\b[^>]*type=["']checkbox["'][^>]*>)/gi, "<li class=\"task-list-item\">$1");
|
|
89
90
|
}
|
|
90
|
-
function
|
|
91
|
+
function d(e, t = "") {
|
|
91
92
|
return {
|
|
92
93
|
"x-share-token": e,
|
|
93
94
|
...t ? { "x-share-password": t } : {}
|
|
94
95
|
};
|
|
95
96
|
}
|
|
96
|
-
async function
|
|
97
|
+
async function f(e, t, n = "") {
|
|
97
98
|
let r = [], i = e.querySelectorAll("img[data-shared-attachment-src]");
|
|
98
99
|
return await Promise.all(Array.from(i, async (e) => {
|
|
99
100
|
let i = e.dataset.sharedAttachmentSrc;
|
|
100
101
|
if (i) try {
|
|
101
|
-
let a = await fetch(i, { headers:
|
|
102
|
+
let a = await fetch(i, { headers: d(t, n) });
|
|
102
103
|
if (!a.ok) {
|
|
103
104
|
e.dataset.sharedAttachmentError = String(a.status);
|
|
104
105
|
return;
|
|
@@ -110,7 +111,7 @@ async function E(e, t, n = "") {
|
|
|
110
111
|
}
|
|
111
112
|
})), r;
|
|
112
113
|
}
|
|
113
|
-
async function
|
|
114
|
+
async function p(e) {
|
|
114
115
|
let t = Array.from(e.querySelectorAll("img"));
|
|
115
116
|
await Promise.all(t.map(async (e) => {
|
|
116
117
|
if (!e.complete) {
|
|
@@ -126,7 +127,7 @@ async function D(e) {
|
|
|
126
127
|
}
|
|
127
128
|
//#endregion
|
|
128
129
|
//#region src/lib/extensions/shared-document-context.ts
|
|
129
|
-
var
|
|
130
|
+
var m = /* @__PURE__ */ new Set([
|
|
130
131
|
"shareToken",
|
|
131
132
|
"password",
|
|
132
133
|
"passwordHash",
|
|
@@ -135,22 +136,22 @@ var O = /* @__PURE__ */ new Set([
|
|
|
135
136
|
"cookie",
|
|
136
137
|
"signingSecret"
|
|
137
138
|
]);
|
|
138
|
-
function
|
|
139
|
+
function h(e) {
|
|
139
140
|
if (!e.id.trim() || !e.expiresAt.trim()) throw TypeError("Shared extension capability must include a non-empty id and expiry");
|
|
140
141
|
return Object.freeze({
|
|
141
142
|
id: e.id,
|
|
142
143
|
expiresAt: e.expiresAt
|
|
143
144
|
});
|
|
144
145
|
}
|
|
145
|
-
function
|
|
146
|
-
for (let t of Object.keys(e)) if (
|
|
146
|
+
function g(e) {
|
|
147
|
+
for (let t of Object.keys(e)) if (m.has(t)) throw TypeError(`Sensitive ${t} must not be provided to a shared extension`);
|
|
147
148
|
return Object.freeze({
|
|
148
149
|
documentId: e.documentId,
|
|
149
150
|
title: e.title,
|
|
150
151
|
content: e.content,
|
|
151
152
|
...e.contentJson === void 0 ? {} : { contentJson: e.contentJson },
|
|
152
153
|
role: e.role,
|
|
153
|
-
capability:
|
|
154
|
+
capability: h(e.capability),
|
|
154
155
|
permissions: Object.freeze({
|
|
155
156
|
read: !0,
|
|
156
157
|
annotate: e.permissions.annotate,
|
|
@@ -161,68 +162,68 @@ function A(e) {
|
|
|
161
162
|
}
|
|
162
163
|
//#endregion
|
|
163
164
|
//#region src/lib/hosts/DocsmintSharedDocumentHost.svelte
|
|
164
|
-
var
|
|
165
|
-
function
|
|
166
|
-
|
|
167
|
-
let
|
|
168
|
-
function
|
|
169
|
-
return e.permission === "annotate" ?
|
|
165
|
+
var _ = t.from_html("<div data-docsmint-shared-document-host=\"\"><div data-extension-zone=\"shared-header-actions\"></div> <!> <div data-extension-zone=\"shared-document-tabs\"></div> <div data-extension-zone=\"shared-document-notes\"></div> <div data-extension-zone=\"shared-document-editor\"><!></div></div>");
|
|
166
|
+
function v(n, r) {
|
|
167
|
+
t.push(r, !0);
|
|
168
|
+
let i = e(), a = t.derived(() => g(r.context));
|
|
169
|
+
function o(e) {
|
|
170
|
+
return e.permission === "annotate" ? t.get(a).permissions.annotate : t.get(a).permissions.edit;
|
|
170
171
|
}
|
|
171
|
-
function
|
|
172
|
-
let
|
|
172
|
+
function s(e) {
|
|
173
|
+
let n = /* @__PURE__ */ new Set();
|
|
173
174
|
return e.filter((e) => {
|
|
174
|
-
if (
|
|
175
|
-
|
|
175
|
+
if (n.has(e.id) || !o(e)) return !1;
|
|
176
|
+
n.add(e.id);
|
|
176
177
|
try {
|
|
177
|
-
return e.visible?.(
|
|
178
|
+
return e.visible?.(t.get(a)) ?? !0;
|
|
178
179
|
} catch {
|
|
179
180
|
return !1;
|
|
180
181
|
}
|
|
181
182
|
}).sort((e, t) => (e.order ?? 0) - (t.order ?? 0) || e.id.localeCompare(t.id));
|
|
182
183
|
}
|
|
183
|
-
var
|
|
184
|
-
|
|
185
|
-
var
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
return
|
|
184
|
+
var c = _(), l = t.child(c);
|
|
185
|
+
t.each(l, 21, () => s(i.sharedDocumentHeaderActions), (e) => e.id, (e, n) => {
|
|
186
|
+
var r = t.comment(), i = t.first_child(r);
|
|
187
|
+
t.component(i, () => t.get(n).component, (e, n) => {
|
|
188
|
+
n(e, { get context() {
|
|
189
|
+
return t.get(a);
|
|
189
190
|
} });
|
|
190
|
-
}),
|
|
191
|
-
}),
|
|
192
|
-
var
|
|
193
|
-
|
|
194
|
-
var
|
|
195
|
-
|
|
196
|
-
var
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
return
|
|
191
|
+
}), t.append(e, r);
|
|
192
|
+
}), t.reset(l);
|
|
193
|
+
var u = t.sibling(l, 2);
|
|
194
|
+
t.snippet(u, () => r.children);
|
|
195
|
+
var d = t.sibling(u, 2);
|
|
196
|
+
t.each(d, 21, () => s(i.sharedDocumentTabs), (e) => e.id, (e, n) => {
|
|
197
|
+
var r = t.comment(), i = t.first_child(r);
|
|
198
|
+
t.component(i, () => t.get(n).component, (e, n) => {
|
|
199
|
+
n(e, { get context() {
|
|
200
|
+
return t.get(a);
|
|
200
201
|
} });
|
|
201
|
-
}),
|
|
202
|
-
}),
|
|
203
|
-
var
|
|
204
|
-
|
|
205
|
-
var
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
return
|
|
202
|
+
}), t.append(e, r);
|
|
203
|
+
}), t.reset(d);
|
|
204
|
+
var f = t.sibling(d, 2);
|
|
205
|
+
t.each(f, 21, () => s(i.sharedDocumentNotesModes), (e) => e.id, (e, n) => {
|
|
206
|
+
var r = t.comment(), i = t.first_child(r);
|
|
207
|
+
t.component(i, () => t.get(n).component, (e, n) => {
|
|
208
|
+
n(e, { get context() {
|
|
209
|
+
return t.get(a);
|
|
209
210
|
} });
|
|
210
|
-
}),
|
|
211
|
-
}),
|
|
212
|
-
var
|
|
213
|
-
var t =
|
|
214
|
-
|
|
215
|
-
var
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
return
|
|
211
|
+
}), t.append(e, r);
|
|
212
|
+
}), t.reset(f);
|
|
213
|
+
var p = t.sibling(f, 2), m = t.child(p), h = (e) => {
|
|
214
|
+
var n = t.comment(), r = t.first_child(n);
|
|
215
|
+
t.each(r, 17, () => s(i.sharedDocumentEditorModes), (e) => e.id, (e, n) => {
|
|
216
|
+
var r = t.comment(), i = t.first_child(r);
|
|
217
|
+
t.component(i, () => t.get(n).component, (e, n) => {
|
|
218
|
+
n(e, { get context() {
|
|
219
|
+
return t.get(a);
|
|
219
220
|
} });
|
|
220
|
-
}),
|
|
221
|
-
}),
|
|
221
|
+
}), t.append(e, r);
|
|
222
|
+
}), t.append(e, n);
|
|
222
223
|
};
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
}),
|
|
224
|
+
t.if(m, (e) => {
|
|
225
|
+
t.get(a).permissions.edit && e(h);
|
|
226
|
+
}), t.reset(p), t.reset(c), t.append(n, c), t.pop();
|
|
226
227
|
}
|
|
227
228
|
//#endregion
|
|
228
|
-
export {
|
|
229
|
+
export { v as DocsmintSharedDocumentHost, f as hydrateSharedAttachmentImages, u as markMarkdownTaskItems, l as renderSharedDocument, d as sharedAttachmentHeaders, p as waitForSharedDocumentImages };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as e from "svelte/internal/client";
|
|
2
|
+
//#region src/lib/stores/subfolders-refresh-store.svelte.ts
|
|
3
|
+
var t = e.proxy({}), n = e.proxy({}), r = e.proxy({}), i = e.state(0), a = e.state(null), o = e.proxy({}), s = e.state(0);
|
|
4
|
+
function c() {
|
|
5
|
+
e.update(s);
|
|
6
|
+
}
|
|
7
|
+
function l() {
|
|
8
|
+
return e.get(s);
|
|
9
|
+
}
|
|
10
|
+
function u(e) {
|
|
11
|
+
t[e] = (t[e] ?? 0) + 1;
|
|
12
|
+
}
|
|
13
|
+
function d(e) {
|
|
14
|
+
return t[e] ?? 0;
|
|
15
|
+
}
|
|
16
|
+
function f(e, t, r, i) {
|
|
17
|
+
n[e] = {
|
|
18
|
+
parentId: t,
|
|
19
|
+
categoryId: r,
|
|
20
|
+
order: i
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function p(e) {
|
|
24
|
+
return n[e];
|
|
25
|
+
}
|
|
26
|
+
function m(e, t, n) {
|
|
27
|
+
r[e] = {
|
|
28
|
+
folderId: t,
|
|
29
|
+
categoryId: n
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function h(t, n, r) {
|
|
33
|
+
m(t, n, r);
|
|
34
|
+
let s = e.update_pre(i);
|
|
35
|
+
return e.set(a, {
|
|
36
|
+
id: t,
|
|
37
|
+
folderId: n,
|
|
38
|
+
categoryId: r,
|
|
39
|
+
version: s
|
|
40
|
+
}, !0), o[t] = {
|
|
41
|
+
folderId: n,
|
|
42
|
+
categoryId: r,
|
|
43
|
+
version: s
|
|
44
|
+
}, s;
|
|
45
|
+
}
|
|
46
|
+
function g(e, t) {
|
|
47
|
+
o[e]?.version === t && delete o[e];
|
|
48
|
+
}
|
|
49
|
+
function _(e) {
|
|
50
|
+
delete o[e];
|
|
51
|
+
}
|
|
52
|
+
function v(e) {
|
|
53
|
+
return o[e];
|
|
54
|
+
}
|
|
55
|
+
function y() {
|
|
56
|
+
return e.get(i);
|
|
57
|
+
}
|
|
58
|
+
function b() {
|
|
59
|
+
return e.get(a);
|
|
60
|
+
}
|
|
61
|
+
function x(e) {
|
|
62
|
+
return r[e];
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
65
|
+
export { p as a, v as c, c as d, m as f, y as i, d as l, _ as m, u as n, l as o, f as p, x as r, b as s, g as t, h as u };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { t as e } from "./Icon-CooFj4Ee.js";
|
|
2
|
+
import "svelte/internal/disclose-version";
|
|
3
|
+
import * as t from "svelte/internal/client";
|
|
4
|
+
import "svelte/internal/flags/legacy";
|
|
5
|
+
//#region ../node_modules/.bun/lucide-svelte@1.0.1+ff5f301bb2db9a0d/node_modules/lucide-svelte/dist/icons/search.svelte
|
|
6
|
+
function n(n, r) {
|
|
7
|
+
let i = t.legacy_rest_props(r, [
|
|
8
|
+
"children",
|
|
9
|
+
"$$slots",
|
|
10
|
+
"$$events",
|
|
11
|
+
"$$legacy"
|
|
12
|
+
]), a = [["path", { d: "m21 21-4.34-4.34" }], ["circle", {
|
|
13
|
+
cx: "11",
|
|
14
|
+
cy: "11",
|
|
15
|
+
r: "8"
|
|
16
|
+
}]];
|
|
17
|
+
e(n, t.spread_props({ name: "search" }, () => i, {
|
|
18
|
+
get iconNode() {
|
|
19
|
+
return a;
|
|
20
|
+
},
|
|
21
|
+
children: (e, n) => {
|
|
22
|
+
var i = t.comment(), a = t.first_child(i);
|
|
23
|
+
t.slot(a, r, "default", {}, null), t.append(e, i);
|
|
24
|
+
},
|
|
25
|
+
$$slots: { default: !0 }
|
|
26
|
+
}));
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region ../node_modules/.bun/lucide-svelte@1.0.1+ff5f301bb2db9a0d/node_modules/lucide-svelte/dist/icons/tag.svelte
|
|
30
|
+
function r(n, r) {
|
|
31
|
+
let i = t.legacy_rest_props(r, [
|
|
32
|
+
"children",
|
|
33
|
+
"$$slots",
|
|
34
|
+
"$$events",
|
|
35
|
+
"$$legacy"
|
|
36
|
+
]), a = [["path", { d: "M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z" }], ["circle", {
|
|
37
|
+
cx: "7.5",
|
|
38
|
+
cy: "7.5",
|
|
39
|
+
r: ".5",
|
|
40
|
+
fill: "currentColor"
|
|
41
|
+
}]];
|
|
42
|
+
e(n, t.spread_props({ name: "tag" }, () => i, {
|
|
43
|
+
get iconNode() {
|
|
44
|
+
return a;
|
|
45
|
+
},
|
|
46
|
+
children: (e, n) => {
|
|
47
|
+
var i = t.comment(), a = t.first_child(i);
|
|
48
|
+
t.slot(a, r, "default", {}, null), t.append(e, i);
|
|
49
|
+
},
|
|
50
|
+
$$slots: { default: !0 }
|
|
51
|
+
}));
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
export { n, r as t };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { t as e } from "./documents-BsDkvzCm.js";
|
|
2
|
+
import * as t from "svelte/internal/client";
|
|
3
|
+
//#region src/lib/stores/tag-store.svelte.ts
|
|
4
|
+
var n = t.state(0);
|
|
5
|
+
function r() {
|
|
6
|
+
t.update(n);
|
|
7
|
+
}
|
|
8
|
+
function i() {
|
|
9
|
+
return t.get(n);
|
|
10
|
+
}
|
|
11
|
+
var a = t.state(0);
|
|
12
|
+
function o() {
|
|
13
|
+
e(), t.update(a);
|
|
14
|
+
}
|
|
15
|
+
function s() {
|
|
16
|
+
return t.get(a);
|
|
17
|
+
}
|
|
18
|
+
var c = t.state(null), l = t.state(null);
|
|
19
|
+
function u(e, n = null) {
|
|
20
|
+
t.set(c, e, !0), t.set(l, e ? n : null, !0);
|
|
21
|
+
}
|
|
22
|
+
function d() {
|
|
23
|
+
return t.get(c);
|
|
24
|
+
}
|
|
25
|
+
function f() {
|
|
26
|
+
return t.get(l);
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { o as a, i, d as n, r as o, f as r, u as s, s as t };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { t as e } from "./utils-hzdMVeCv.js";
|
|
2
|
+
import "svelte/internal/disclose-version";
|
|
3
|
+
import * as t from "svelte/internal/client";
|
|
4
|
+
//#region ../node_modules/.bun/@hiai-gg+hiai-ui@0.0.8+3149ccaa93f654b8/node_modules/@hiai-gg/hiai-ui/dist/components/ui/textarea/textarea.svelte
|
|
5
|
+
var n = /* @__PURE__ */ new Set([
|
|
6
|
+
"$$slots",
|
|
7
|
+
"$$events",
|
|
8
|
+
"$$legacy",
|
|
9
|
+
"ref",
|
|
10
|
+
"class",
|
|
11
|
+
"value"
|
|
12
|
+
]), r = t.from_html("<textarea></textarea>");
|
|
13
|
+
function i(i, a) {
|
|
14
|
+
t.push(a, !0);
|
|
15
|
+
let o = t.prop(a, "ref", 15, null), s = t.prop(a, "value", 15, ""), c = t.rest_props(a, n);
|
|
16
|
+
var l = r();
|
|
17
|
+
t.remove_textarea_child(l), t.attribute_effect(l, (e) => ({
|
|
18
|
+
class: e,
|
|
19
|
+
...c
|
|
20
|
+
}), [() => e("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50", a.class)]), t.bind_this(l, (e) => o(e), () => o()), t.bind_value(l, s), t.append(i, l), t.pop();
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { i as t };
|
package/dist/frontend/theme.js
CHANGED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as e from "svelte/internal/client";
|
|
2
|
+
import { browser as t } from "$app/environment";
|
|
3
|
+
//#region src/lib/stores/theme.svelte.ts
|
|
4
|
+
var n = "hiai-docs-theme", r = /* @__PURE__ */ new Set();
|
|
5
|
+
function i() {
|
|
6
|
+
if (!t) return "system";
|
|
7
|
+
let e = localStorage.getItem(n);
|
|
8
|
+
return e === "light" || e === "dark" || e === "system" ? e : "system";
|
|
9
|
+
}
|
|
10
|
+
function a() {
|
|
11
|
+
return t ? window.matchMedia("(prefers-color-scheme: dark)").matches : !1;
|
|
12
|
+
}
|
|
13
|
+
function o(e) {
|
|
14
|
+
return e === "dark" ? !0 : e === "light" ? !1 : a();
|
|
15
|
+
}
|
|
16
|
+
function s(e) {
|
|
17
|
+
if (!t) return;
|
|
18
|
+
let n = o(e);
|
|
19
|
+
document.documentElement.classList.toggle("dark", n);
|
|
20
|
+
let r = document.querySelector("#app-favicon");
|
|
21
|
+
r && (r.href = n ? "/favicon_white.ico" : "/favicon.ico");
|
|
22
|
+
}
|
|
23
|
+
function c() {
|
|
24
|
+
for (let e of r) e();
|
|
25
|
+
}
|
|
26
|
+
var l = e.state("system"), u = e.state(!1), d = !1;
|
|
27
|
+
function f() {
|
|
28
|
+
if (!t || d) return;
|
|
29
|
+
d = !0, e.set(l, i(), !0), e.set(u, o(e.get(l)), !0), s(e.get(l));
|
|
30
|
+
let n = window.matchMedia("(prefers-color-scheme: dark)");
|
|
31
|
+
n.addEventListener("change", () => {
|
|
32
|
+
e.get(l) === "system" && (e.set(u, n.matches, !0), s("system"), c());
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function p(r) {
|
|
36
|
+
e.set(l, r, !0), t && localStorage.setItem(n, r), e.set(u, o(r), !0), s(r), c();
|
|
37
|
+
}
|
|
38
|
+
var m = {
|
|
39
|
+
get value() {
|
|
40
|
+
return e.get(l);
|
|
41
|
+
},
|
|
42
|
+
get isDark() {
|
|
43
|
+
return e.get(u);
|
|
44
|
+
},
|
|
45
|
+
init: f,
|
|
46
|
+
set: p
|
|
47
|
+
};
|
|
48
|
+
//#endregion
|
|
49
|
+
export { m as t };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface Document { id: string; title: string; content?: string; folderId: string | null; folderName: string; categoryId?: string | null; tags: string[]; createdAt: string; updatedAt: string; excerpt: string; }
|
|
2
|
+
export interface Folder { id: string; name: string; parentId: string | null; categoryId?: string | null; order: number; documentCount: number; subfolderCount: number; children: Folder[]; documents: Document[]; createdAt: string; updatedAt: string; }
|
|
3
|
+
export interface Tag { id: string; name: string; color: string; }
|
|
4
|
+
export type ViewMode = "grid" | "list";
|
|
5
|
+
export type SortOption = "name" | "updated" | "created";
|
|
6
|
+
export type SortDirection = "asc" | "desc";
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function copyToClipboard(text: string): Promise<boolean>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ActionReturn } from "svelte/action";
|
|
2
|
+
import type { DndEvent, DndZoneAttributes, Item, Options } from "svelte-dnd-action";
|
|
3
|
+
export type { DndEvent, Item, Options };
|
|
4
|
+
export declare function dndzone<T extends Item>(node: HTMLElement, options: Options<T>): ActionReturn<Options<T>, DndZoneAttributes<T>>;
|