@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,72 @@
|
|
|
1
|
+
import { t as e } from "../../check-D-UuvBuh.js";
|
|
2
|
+
import { t } from "../../copy-GppwRMjX.js";
|
|
3
|
+
import { dn as n, fn as r } from "../../messages-BpYaLbzE.js";
|
|
4
|
+
import { t as i } from "../../markdown-BwnyjITU.js";
|
|
5
|
+
import "svelte/internal/disclose-version";
|
|
6
|
+
import * as a from "svelte/internal/client";
|
|
7
|
+
//#region src/lib/components/editor/MarkdownToggle.svelte
|
|
8
|
+
var o = a.from_html("<!> <span>Copied!</span>", 1), s = a.from_html("<!> <span>Copy Raw</span>", 1), c = a.from_html("<div class=\"markdown-toggle svelte-1k98zvf\"><button type=\"button\" class=\"copy-btn svelte-1k98zvf\" aria-label=\"Copy markdown\" title=\"Copy markdown content\"><!></button> <textarea class=\"markdown-textarea svelte-1k98zvf\" spellcheck=\"false\"></textarea></div>");
|
|
9
|
+
function l(l, u) {
|
|
10
|
+
a.push(u, !0);
|
|
11
|
+
let d = a.prop(u, "content", 3, ""), f = a.prop(u, "onUpdate", 3, (e) => {}), p = a.state(!1), m = a.state(null), h = a.state(null), g = 0;
|
|
12
|
+
function _() {
|
|
13
|
+
if (a.get(h)) {
|
|
14
|
+
if (g === 0) {
|
|
15
|
+
let e = a.get(h).closest(".editor-container")?.clientHeight ?? 0;
|
|
16
|
+
g = Math.max(a.get(m)?.clientHeight ?? 0, e);
|
|
17
|
+
}
|
|
18
|
+
a.get(h).style.minHeight = `${g}px`, a.get(h).style.height = "auto", a.get(h).style.height = `${Math.max(g, a.get(h).scrollHeight)}px`;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
a.user_effect(() => {
|
|
22
|
+
d(), typeof window < "u" && queueMicrotask(_);
|
|
23
|
+
});
|
|
24
|
+
function v(e) {
|
|
25
|
+
let t = i(e);
|
|
26
|
+
f()({
|
|
27
|
+
markdown: e,
|
|
28
|
+
json: t
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function y(e) {
|
|
32
|
+
let t = e.target;
|
|
33
|
+
_(), v(t.value);
|
|
34
|
+
}
|
|
35
|
+
function b() {
|
|
36
|
+
d() && navigator.clipboard.writeText(d()).then(() => {
|
|
37
|
+
a.set(p, !0), setTimeout(() => {
|
|
38
|
+
a.set(p, !1);
|
|
39
|
+
}, 2e3);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
var x = c(), S = a.child(x), C = a.child(S), w = (t) => {
|
|
43
|
+
var n = o();
|
|
44
|
+
e(a.first_child(n), {
|
|
45
|
+
size: 14,
|
|
46
|
+
class: "text-emerald-500"
|
|
47
|
+
}), a.next(2), a.append(t, n);
|
|
48
|
+
}, T = (e) => {
|
|
49
|
+
var n = s();
|
|
50
|
+
t(a.first_child(n), { size: 14 }), a.next(2), a.append(e, n);
|
|
51
|
+
};
|
|
52
|
+
a.if(C, (e) => {
|
|
53
|
+
a.get(p) ? e(w) : e(T, -1);
|
|
54
|
+
}), a.reset(S);
|
|
55
|
+
var E = a.sibling(S, 2);
|
|
56
|
+
a.remove_textarea_child(E), a.bind_this(E, (e) => a.set(h, e), () => a.get(h)), a.reset(x), a.bind_this(x, (e) => a.set(m, e), () => a.get(m)), a.template_effect((e, t) => {
|
|
57
|
+
a.set_value(E, d()), a.set_attribute(E, "placeholder", e), a.set_attribute(E, "aria-label", t);
|
|
58
|
+
}, [() => r(), () => n()]), a.delegated("click", S, b), a.delegated("input", E, y), a.delegated("keydown", E, (e) => {
|
|
59
|
+
if (e.key === "Tab") {
|
|
60
|
+
e.preventDefault();
|
|
61
|
+
let t = e.target, n = t.selectionStart, r = t.selectionEnd;
|
|
62
|
+
t.value = `${t.value.substring(0, n)}\t${t.value.substring(r)}`, t.selectionStart = t.selectionEnd = n + 1, v(t.value);
|
|
63
|
+
}
|
|
64
|
+
}), a.append(l, x), a.pop();
|
|
65
|
+
}
|
|
66
|
+
a.delegate([
|
|
67
|
+
"click",
|
|
68
|
+
"input",
|
|
69
|
+
"keydown"
|
|
70
|
+
]);
|
|
71
|
+
//#endregion
|
|
72
|
+
export { l as MarkdownToggle };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function markdownToJson(markdown: string): Promise<object>;
|
|
@@ -0,0 +1,272 @@
|
|
|
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 { a as s, i as c, n as l, r as u, t as d } from "../select-value-sF86Geyh.js";
|
|
4
|
+
import { t as f } from "../label-CW9rxoAb.js";
|
|
5
|
+
import { t as p } from "../chevron-down-CiPtYyFh.js";
|
|
6
|
+
import { t as m } from "../FolderTreeSelector-CyB8y2Sm.js";
|
|
7
|
+
import { s as h } from "../folders-CTuV_JtU.js";
|
|
8
|
+
import { nr as g, tr as _ } from "../messages-BpYaLbzE.js";
|
|
9
|
+
import { i as v } from "../categories-izQovv2w.js";
|
|
10
|
+
import { d as y } from "../subfolders-refresh-store.svelte-B2dKVmgz.js";
|
|
11
|
+
import "svelte/internal/disclose-version";
|
|
12
|
+
import * as b from "svelte/internal/client";
|
|
13
|
+
//#region src/lib/components/SaveAsDialog.svelte
|
|
14
|
+
var x = b.from_html("<!> <!>", 1), S = b.from_html("<div class=\"flex items-center justify-center py-6\"><!></div>"), C = b.from_html("<p class=\"text-sm text-destructive\" role=\"alert\"> </p>"), w = b.from_html("<form class=\"space-y-4 py-2\"><!> <div class=\"space-y-2\"><!> <input id=\"save-as-title\" type=\"text\" placeholder=\"Enter new document title\" required=\"\" class=\"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50\"/></div> <div class=\"space-y-2\"><!> <!></div> <div class=\"space-y-2\"><!> <!></div></form>"), T = b.from_html("<!> ", 1), E = b.from_html("<!> <!> <!>", 1);
|
|
15
|
+
function D(D, O) {
|
|
16
|
+
b.push(O, !0);
|
|
17
|
+
let k = {
|
|
18
|
+
Root: s,
|
|
19
|
+
Content: c,
|
|
20
|
+
Item: u,
|
|
21
|
+
Trigger: l,
|
|
22
|
+
Value: d
|
|
23
|
+
}, A = b.prop(O, "open", 15, !1), j = b.prop(O, "initialTitle", 3, ""), M = b.prop(O, "initialParentId", 3, null), N = b.prop(O, "initialCategoryId", 3, null), P = b.state(b.proxy([])), F = b.state(b.proxy([])), I = b.state(!1), L = b.state(!1), R = b.state(null), z = b.state(""), B = b.state(null), V = b.state(void 0);
|
|
24
|
+
b.user_effect(() => {
|
|
25
|
+
A() && (b.set(z, j() ? `${j()} (Copy)` : "Untitled (Copy)", !0), b.set(B, M()), b.set(V, N() || "null", !0), b.set(R, null), H());
|
|
26
|
+
});
|
|
27
|
+
async function H() {
|
|
28
|
+
b.set(I, !0);
|
|
29
|
+
try {
|
|
30
|
+
let [e, t] = await Promise.all([v(), h(null, !0)]);
|
|
31
|
+
b.set(F, e, !0), b.set(P, t, !0);
|
|
32
|
+
} catch (e) {
|
|
33
|
+
console.error("Failed to load SaveAsDialog options", e), b.set(R, "Failed to load folders or categories");
|
|
34
|
+
} finally {
|
|
35
|
+
b.set(I, !1);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
async function U(e) {
|
|
39
|
+
if (e?.preventDefault(), !b.get(z).trim()) {
|
|
40
|
+
b.set(R, "Title cannot be empty");
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (!b.get(L)) {
|
|
44
|
+
b.set(L, !0);
|
|
45
|
+
try {
|
|
46
|
+
if (O.onSave) {
|
|
47
|
+
let e = b.get(B) === "" || b.get(B) === "null" ? null : b.get(B), t = b.get(V) === "" || b.get(V) === "null" || b.get(V) === void 0 ? null : b.get(V);
|
|
48
|
+
await O.onSave(b.get(z).trim(), e, t);
|
|
49
|
+
}
|
|
50
|
+
y(), A(!1);
|
|
51
|
+
} catch (e) {
|
|
52
|
+
console.error("Failed to duplicate item", e), b.set(R, e instanceof Error ? e.message : "Failed to duplicate item", !0);
|
|
53
|
+
} finally {
|
|
54
|
+
b.set(L, !1);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function W() {
|
|
59
|
+
b.get(L) || (A(!1), O.onClose?.());
|
|
60
|
+
}
|
|
61
|
+
t(D, {
|
|
62
|
+
onOpenChange: (e) => {
|
|
63
|
+
e || W();
|
|
64
|
+
},
|
|
65
|
+
get open() {
|
|
66
|
+
return A();
|
|
67
|
+
},
|
|
68
|
+
set open(e) {
|
|
69
|
+
A(e);
|
|
70
|
+
},
|
|
71
|
+
children: (t, s) => {
|
|
72
|
+
var c = E(), l = b.first_child(c);
|
|
73
|
+
r(l, {
|
|
74
|
+
children: (e, t) => {
|
|
75
|
+
var r = x(), i = b.first_child(r);
|
|
76
|
+
o(i, {
|
|
77
|
+
children: (e, t) => {
|
|
78
|
+
b.next();
|
|
79
|
+
var n = b.text("Save as Copy");
|
|
80
|
+
b.append(e, n);
|
|
81
|
+
},
|
|
82
|
+
$$slots: { default: !0 }
|
|
83
|
+
}), n(b.sibling(i, 2), {
|
|
84
|
+
children: (e, t) => {
|
|
85
|
+
b.next();
|
|
86
|
+
var n = b.text("Create a copy of this document with a new title, folder, and category.");
|
|
87
|
+
b.append(e, n);
|
|
88
|
+
},
|
|
89
|
+
$$slots: { default: !0 }
|
|
90
|
+
}), b.append(e, r);
|
|
91
|
+
},
|
|
92
|
+
$$slots: { default: !0 }
|
|
93
|
+
});
|
|
94
|
+
var u = b.sibling(l, 2), d = (t) => {
|
|
95
|
+
var n = S();
|
|
96
|
+
e(b.child(n), { class: "size-6 animate-spin text-muted-foreground" }), b.reset(n), b.append(t, n);
|
|
97
|
+
}, h = (e) => {
|
|
98
|
+
var t = w(), n = b.child(t), r = (e) => {
|
|
99
|
+
var t = C(), n = b.child(t, !0);
|
|
100
|
+
b.reset(t), b.template_effect(() => b.set_text(n, b.get(R))), b.append(e, t);
|
|
101
|
+
};
|
|
102
|
+
b.if(n, (e) => {
|
|
103
|
+
b.get(R) && e(r);
|
|
104
|
+
});
|
|
105
|
+
var i = b.sibling(n, 2), a = b.child(i);
|
|
106
|
+
f(a, {
|
|
107
|
+
for: "save-as-title",
|
|
108
|
+
children: (e, t) => {
|
|
109
|
+
b.next();
|
|
110
|
+
var n = b.text("New Title");
|
|
111
|
+
b.append(e, n);
|
|
112
|
+
},
|
|
113
|
+
$$slots: { default: !0 }
|
|
114
|
+
});
|
|
115
|
+
var o = b.sibling(a, 2);
|
|
116
|
+
b.remove_input_defaults(o), b.reset(i);
|
|
117
|
+
var s = b.sibling(i, 2), c = b.child(s);
|
|
118
|
+
f(c, {
|
|
119
|
+
children: (e, t) => {
|
|
120
|
+
b.next();
|
|
121
|
+
var n = b.text("Parent Folder");
|
|
122
|
+
b.append(e, n);
|
|
123
|
+
},
|
|
124
|
+
$$slots: { default: !0 }
|
|
125
|
+
}), m(b.sibling(c, 2), {
|
|
126
|
+
get folders() {
|
|
127
|
+
return b.get(P);
|
|
128
|
+
},
|
|
129
|
+
get selectedId() {
|
|
130
|
+
return b.get(B);
|
|
131
|
+
},
|
|
132
|
+
set selectedId(e) {
|
|
133
|
+
b.set(B, e, !0);
|
|
134
|
+
}
|
|
135
|
+
}), b.reset(s);
|
|
136
|
+
var l = b.sibling(s, 2), u = b.child(l);
|
|
137
|
+
f(u, {
|
|
138
|
+
for: "save-as-category",
|
|
139
|
+
children: (e, t) => {
|
|
140
|
+
b.next();
|
|
141
|
+
var n = b.text("Category");
|
|
142
|
+
b.append(e, n);
|
|
143
|
+
},
|
|
144
|
+
$$slots: { default: !0 }
|
|
145
|
+
});
|
|
146
|
+
var d = b.sibling(u, 2);
|
|
147
|
+
b.component(d, () => k.Root, (e, t) => {
|
|
148
|
+
t(e, {
|
|
149
|
+
type: "single",
|
|
150
|
+
get value() {
|
|
151
|
+
return b.get(V);
|
|
152
|
+
},
|
|
153
|
+
set value(e) {
|
|
154
|
+
b.set(V, e, !0);
|
|
155
|
+
},
|
|
156
|
+
children: (e, t) => {
|
|
157
|
+
var n = x(), r = b.first_child(n);
|
|
158
|
+
b.component(r, () => k.Trigger, (e, t) => {
|
|
159
|
+
t(e, {
|
|
160
|
+
class: "w-full text-foreground flex items-center justify-between bg-background border border-input px-3 py-2 text-sm rounded-md shadow-sm",
|
|
161
|
+
children: (e, t) => {
|
|
162
|
+
var n = x(), r = b.first_child(n);
|
|
163
|
+
b.component(r, () => k.Value, (e, t) => {
|
|
164
|
+
t(e, {
|
|
165
|
+
placeholder: "Select a category...",
|
|
166
|
+
children: (e, t) => {
|
|
167
|
+
b.next();
|
|
168
|
+
var n = b.text();
|
|
169
|
+
b.template_effect((e) => b.set_text(n, e), [() => b.get(V) && b.get(V) !== "null" ? b.get(F).find((e) => e.id === b.get(V))?.name ?? "Uncategorized" : "Uncategorized"]), b.append(e, n);
|
|
170
|
+
},
|
|
171
|
+
$$slots: { default: !0 }
|
|
172
|
+
});
|
|
173
|
+
}), p(b.sibling(r, 2), { class: "size-4 opacity-50" }), b.append(e, n);
|
|
174
|
+
},
|
|
175
|
+
$$slots: { default: !0 }
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
var i = b.sibling(r, 2);
|
|
179
|
+
b.component(i, () => k.Content, (e, t) => {
|
|
180
|
+
t(e, {
|
|
181
|
+
class: "w-[var(--bits-select-trigger-width)]",
|
|
182
|
+
children: (e, t) => {
|
|
183
|
+
var n = x(), r = b.first_child(n);
|
|
184
|
+
b.component(r, () => k.Item, (e, t) => {
|
|
185
|
+
t(e, {
|
|
186
|
+
value: "null",
|
|
187
|
+
children: (e, t) => {
|
|
188
|
+
b.next();
|
|
189
|
+
var n = b.text("Uncategorized");
|
|
190
|
+
b.append(e, n);
|
|
191
|
+
},
|
|
192
|
+
$$slots: { default: !0 }
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
var i = b.sibling(r, 2);
|
|
196
|
+
b.each(i, 17, () => b.get(F), (e) => e.id, (e, t) => {
|
|
197
|
+
var n = b.comment(), r = b.first_child(n);
|
|
198
|
+
b.component(r, () => k.Item, (e, n) => {
|
|
199
|
+
n(e, {
|
|
200
|
+
get value() {
|
|
201
|
+
return b.get(t).id;
|
|
202
|
+
},
|
|
203
|
+
children: (e, n) => {
|
|
204
|
+
b.next();
|
|
205
|
+
var r = b.text();
|
|
206
|
+
b.template_effect(() => b.set_text(r, b.get(t).name)), b.append(e, r);
|
|
207
|
+
},
|
|
208
|
+
$$slots: { default: !0 }
|
|
209
|
+
});
|
|
210
|
+
}), b.append(e, n);
|
|
211
|
+
}), b.append(e, n);
|
|
212
|
+
},
|
|
213
|
+
$$slots: { default: !0 }
|
|
214
|
+
});
|
|
215
|
+
}), b.append(e, n);
|
|
216
|
+
},
|
|
217
|
+
$$slots: { default: !0 }
|
|
218
|
+
});
|
|
219
|
+
}), b.reset(l), b.reset(t), b.event("submit", t, U), b.bind_value(o, () => b.get(z), (e) => b.set(z, e)), b.append(e, t);
|
|
220
|
+
};
|
|
221
|
+
b.if(u, (e) => {
|
|
222
|
+
b.get(I) ? e(d) : e(h, -1);
|
|
223
|
+
}), a(b.sibling(u, 2), {
|
|
224
|
+
class: "mt-4",
|
|
225
|
+
children: (t, n) => {
|
|
226
|
+
var r = x(), a = b.first_child(r);
|
|
227
|
+
i(a, {
|
|
228
|
+
variant: "outline",
|
|
229
|
+
type: "button",
|
|
230
|
+
onclick: W,
|
|
231
|
+
get disabled() {
|
|
232
|
+
return b.get(L);
|
|
233
|
+
},
|
|
234
|
+
children: (e, t) => {
|
|
235
|
+
b.next();
|
|
236
|
+
var n = b.text();
|
|
237
|
+
b.template_effect((e) => b.set_text(n, e), [() => _()]), b.append(e, n);
|
|
238
|
+
},
|
|
239
|
+
$$slots: { default: !0 }
|
|
240
|
+
});
|
|
241
|
+
var o = b.sibling(a, 2);
|
|
242
|
+
{
|
|
243
|
+
let t = b.derived(() => b.get(L) || b.get(I));
|
|
244
|
+
i(o, {
|
|
245
|
+
type: "button",
|
|
246
|
+
onclick: U,
|
|
247
|
+
get disabled() {
|
|
248
|
+
return b.get(t);
|
|
249
|
+
},
|
|
250
|
+
children: (t, n) => {
|
|
251
|
+
var r = T(), i = b.first_child(r), a = (t) => {
|
|
252
|
+
e(t, { class: "mr-1 size-4 animate-spin" });
|
|
253
|
+
};
|
|
254
|
+
b.if(i, (e) => {
|
|
255
|
+
b.get(L) && e(a);
|
|
256
|
+
});
|
|
257
|
+
var o = b.sibling(i);
|
|
258
|
+
b.template_effect((e) => b.set_text(o, ` ${e ?? ""}`), [() => g()]), b.append(t, r);
|
|
259
|
+
},
|
|
260
|
+
$$slots: { default: !0 }
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
b.append(t, r);
|
|
264
|
+
},
|
|
265
|
+
$$slots: { default: !0 }
|
|
266
|
+
}), b.append(t, c);
|
|
267
|
+
},
|
|
268
|
+
$$slots: { default: !0 }
|
|
269
|
+
}), b.pop();
|
|
270
|
+
}
|
|
271
|
+
//#endregion
|
|
272
|
+
export { D as SaveAsDialog };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../SettingsDialog-
|
|
1
|
+
import { t as e } from "../SettingsDialog-DCM4-N6_.js";
|
|
2
2
|
export { e as SettingsDialog };
|