@hiai-gg/docsmint 0.3.6 → 0.3.7
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/dist/backend/index.js +1 -1
- package/dist/frontend/CategoryDialog--rIE7FrH.js +580 -0
- package/dist/frontend/ConfirmDialog-Cpzyb55f.js +212 -0
- package/dist/frontend/CreateSnapshotDialog-CmkV-n2A.js +216 -0
- package/dist/frontend/DatePicker-Byynca7V.js +257 -0
- package/dist/frontend/DeleteDialog-ap6nOywZ.js +174 -0
- package/dist/frontend/FolderDialog-DmN_trV0.js +247 -0
- package/dist/frontend/FolderNode-C4B8a2fd.js +317 -0
- package/dist/frontend/FolderTreeSelector-D6ijiZTA.js +100 -0
- package/dist/frontend/Icon-DtNo0N1U.js +64 -0
- package/dist/frontend/SettingsDialog-2kTaTXAs.js +992 -0
- package/dist/frontend/ShareDialog-BBDGNF5n.js +165 -0
- package/dist/frontend/TagCreateDialog-DiLZnJo4.js +258 -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/bundle-mjs-CP6Owz-8.js +1723 -0
- package/dist/frontend/camera-B7dAOd4s.js +28 -0
- package/dist/frontend/{categories-BE6ZpZl8.js → categories-izQovv2w.js} +1 -1
- package/dist/frontend/check-CDwRlG9T.js +24 -0
- package/dist/frontend/chevron-down-B7ZrjUmT.js +24 -0
- package/dist/frontend/circle-check-CDqeMB2d.js +28 -0
- package/dist/frontend/{client-C6QQGb0e.js → client-Bc5Fzx40.js} +833 -814
- package/dist/frontend/{client-B9hzI0W8.js → client-GbtOH90i.js} +1 -1
- package/dist/frontend/clipboard-Cgzxc0_R.js +16 -0
- package/dist/frontend/clock-Ck5Sn-Zl.js +28 -0
- package/dist/frontend/clsx-nmtDPO_P.js +16 -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 +3021 -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 +254 -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 +1206 -3762
- 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 +293 -0
- package/dist/frontend/{context-DbnW5yib.js → context-BMD6XTPe.js} +0 -3
- package/dist/frontend/copy-CMAA6GP0.js +31 -0
- package/dist/frontend/dashboard.js +1148 -1224
- package/dist/frontend/{SettingsDialog-D4pgFD0D.js → db-ByrlYfaI.js} +923 -2002
- package/dist/frontend/dialog-BDkiG42a.js +213 -0
- package/dist/frontend/disclose-version-5I57E3LD.js +3 -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-BBuPldbW.js +519 -0
- package/dist/frontend/extension.js +6 -5
- package/dist/frontend/floating-layer-anchor-C51M4l6v.js +4513 -0
- package/dist/frontend/folder-TQjKY4yn.js +44 -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/index-client-jobkrWVL.js +86 -0
- package/dist/frontend/input-CBI6p4Xl.js +23 -0
- package/dist/frontend/keyboard.d.ts +14 -0
- package/dist/frontend/keyboard.js +2 -0
- package/dist/frontend/keyboard.svelte-D7H8DihC.js +133 -0
- package/dist/frontend/label-C-GkhEp4.js +30 -0
- package/dist/frontend/loader-circle-Bk-WFz9g.js +267 -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-CleZtJ5D.js +24 -0
- package/dist/frontend/search.js +637 -628
- package/dist/frontend/select-value-CvrWRkXW.js +1436 -0
- package/dist/frontend/settings-blyobazp.js +62 -0
- package/dist/frontend/share-Cu7SSJuJ.js +28 -0
- package/dist/frontend/shared-document.js +41 -40
- package/dist/frontend/subfolders-refresh-store.svelte-BsheoQma.js +65 -0
- package/dist/frontend/{tag-C5xrg-bb.js → tag-Dx3SmucJ.js} +7 -7
- package/dist/frontend/tag-store.svelte-CIaF4sdZ.js +29 -0
- package/dist/frontend/{tags-DVXTut0p.js → tags-CtCV0Djo.js} +1 -1
- package/dist/frontend/textarea-Dfp78XlL.js +23 -0
- package/dist/frontend/theme.js +1 -1
- package/dist/frontend/{theme.svelte-ei0QxXa8.js → theme.svelte-CROg1Hi5.js} +7 -7
- 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-C0OW2678.js +20 -0
- package/dist/frontend/utils-D8kmM3ub.js +8 -0
- package/dist/frontend/utils.d.ts +4 -0
- package/dist/frontend/utils.js +2 -0
- package/dist/frontend/x-DaTdeDXv.js +24 -0
- package/package.json +109 -1
- package/packages/cli/src/index.ts +1 -1
- 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/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-store.svelte-B3839FYq.js +0 -6152
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import "./disclose-version-5I57E3LD.js";
|
|
2
|
+
import { $ as e, A as t, E as n, F as r, K as i, M as a, Q as o, V as s, _t as c, at as l, ct as u, dt as d, et as f, ft as p, gt as m, k as h, n as g, q as _, rt as v } from "./client-Bc5Fzx40.js";
|
|
3
|
+
import { t as y } from "./loader-circle-Bk-WFz9g.js";
|
|
4
|
+
import { a as b, i as x, n as S, o as C, r as w, t as T } from "./dialog-BDkiG42a.js";
|
|
5
|
+
import { t as E } from "./circle-check-CDqeMB2d.js";
|
|
6
|
+
//#region src/lib/components/DeleteDialog.svelte
|
|
7
|
+
var D = a("<span class=\"font-medium text-foreground\"> </span> ", 1), O = a("<!> <!>", 1), k = a("<!> <div class=\"flex items-start gap-3 rounded-lg border border-primary/30 bg-primary/10 p-4\" role=\"status\" aria-live=\"polite\"><!> <p class=\"text-sm text-muted-foreground\"><span class=\"font-medium text-foreground\"> </span> </p></div>", 1), A = a("Delete <span class=\"font-medium text-foreground\"> </span> ", 1), j = a("<p class=\"text-sm text-destructive\" role=\"alert\"> </p>"), M = a("<!> ", 1);
|
|
8
|
+
function N(a, N) {
|
|
9
|
+
p(N, !0);
|
|
10
|
+
let P = g(N, "open", 15, !1), F = g(N, "confirmLabel", 3, "Delete"), I = g(N, "cancelLabel", 3, "Cancel"), L = g(N, "doneLabel", 3, "Done"), R = g(N, "errorFallback", 3, "Failed to delete"), z = l(!1), B = l(!1), V = l(null);
|
|
11
|
+
_(() => {
|
|
12
|
+
P() || (v(B, !1), v(V, null));
|
|
13
|
+
});
|
|
14
|
+
async function H() {
|
|
15
|
+
if (!(s(z) || s(B))) {
|
|
16
|
+
v(z, !0), v(V, null);
|
|
17
|
+
try {
|
|
18
|
+
await N.onConfirm?.(), v(B, !0);
|
|
19
|
+
} catch (e) {
|
|
20
|
+
console.error("DeleteDialog: delete failed", e), v(V, e instanceof Error && e.message.trim() ? e.message : R(), !0);
|
|
21
|
+
} finally {
|
|
22
|
+
v(z, !1);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function U() {
|
|
27
|
+
s(z) || (P(!1), N.onCancel?.());
|
|
28
|
+
}
|
|
29
|
+
function W(e) {
|
|
30
|
+
if (!e && s(z)) {
|
|
31
|
+
P(!0);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
e || U();
|
|
35
|
+
}
|
|
36
|
+
b(a, {
|
|
37
|
+
onOpenChange: W,
|
|
38
|
+
get open() {
|
|
39
|
+
return P();
|
|
40
|
+
},
|
|
41
|
+
set open(e) {
|
|
42
|
+
P(e);
|
|
43
|
+
},
|
|
44
|
+
children: (a, l) => {
|
|
45
|
+
var d = O(), p = e(d), g = (n) => {
|
|
46
|
+
var a = k(), s = e(a);
|
|
47
|
+
S(s, {
|
|
48
|
+
children: (n, a) => {
|
|
49
|
+
var s = O(), l = e(s);
|
|
50
|
+
T(l, {
|
|
51
|
+
children: (e, n) => {
|
|
52
|
+
m();
|
|
53
|
+
var a = r();
|
|
54
|
+
i(() => h(a, N.successTitle)), t(e, a);
|
|
55
|
+
},
|
|
56
|
+
$$slots: { default: !0 }
|
|
57
|
+
}), x(f(l, 2), {
|
|
58
|
+
children: (n, r) => {
|
|
59
|
+
var a = D(), s = e(a), l = o(s);
|
|
60
|
+
c(s);
|
|
61
|
+
var u = f(s);
|
|
62
|
+
i(() => {
|
|
63
|
+
h(l, `“${N.targetName ?? ""}”`), h(u, ` ${N.successDescription ?? ""}`);
|
|
64
|
+
}), t(n, a);
|
|
65
|
+
},
|
|
66
|
+
$$slots: { default: !0 }
|
|
67
|
+
}), t(n, s);
|
|
68
|
+
},
|
|
69
|
+
$$slots: { default: !0 }
|
|
70
|
+
});
|
|
71
|
+
var l = f(s, 2), u = o(l);
|
|
72
|
+
E(u, { class: "mt-0.5 size-5 shrink-0 text-primary" });
|
|
73
|
+
var d = f(u, 2), p = o(d), g = o(p);
|
|
74
|
+
c(p);
|
|
75
|
+
var _ = f(p);
|
|
76
|
+
c(d), c(l), i(() => {
|
|
77
|
+
h(g, `“${N.targetName ?? ""}”`), h(_, ` ${N.successDescription ?? ""}`);
|
|
78
|
+
}), t(n, a);
|
|
79
|
+
}, _ = (a) => {
|
|
80
|
+
var l = O(), u = e(l);
|
|
81
|
+
S(u, {
|
|
82
|
+
children: (n, a) => {
|
|
83
|
+
var s = O(), l = e(s);
|
|
84
|
+
T(l, {
|
|
85
|
+
children: (e, n) => {
|
|
86
|
+
m();
|
|
87
|
+
var a = r();
|
|
88
|
+
i(() => h(a, N.title)), t(e, a);
|
|
89
|
+
},
|
|
90
|
+
$$slots: { default: !0 }
|
|
91
|
+
}), x(f(l, 2), {
|
|
92
|
+
children: (n, r) => {
|
|
93
|
+
m();
|
|
94
|
+
var a = A(), s = f(e(a)), l = o(s);
|
|
95
|
+
c(s);
|
|
96
|
+
var u = f(s);
|
|
97
|
+
i(() => {
|
|
98
|
+
h(l, `“${N.targetName ?? ""}”`), h(u, `?
|
|
99
|
+
${N.description ?? ""}`);
|
|
100
|
+
}), t(n, a);
|
|
101
|
+
},
|
|
102
|
+
$$slots: { default: !0 }
|
|
103
|
+
}), t(n, s);
|
|
104
|
+
},
|
|
105
|
+
$$slots: { default: !0 }
|
|
106
|
+
});
|
|
107
|
+
var d = f(u, 2), p = (e) => {
|
|
108
|
+
var n = j(), r = o(n, !0);
|
|
109
|
+
c(n), i(() => h(r, s(V))), t(e, n);
|
|
110
|
+
};
|
|
111
|
+
n(d, (e) => {
|
|
112
|
+
s(V) && e(p);
|
|
113
|
+
}), t(a, l);
|
|
114
|
+
};
|
|
115
|
+
n(p, (e) => {
|
|
116
|
+
s(B) ? e(g) : e(_, -1);
|
|
117
|
+
}), w(f(p, 2), {
|
|
118
|
+
children: (a, o) => {
|
|
119
|
+
var c = O(), l = e(c), d = (e) => {
|
|
120
|
+
C(e, {
|
|
121
|
+
variant: "outline",
|
|
122
|
+
type: "button",
|
|
123
|
+
onclick: U,
|
|
124
|
+
get disabled() {
|
|
125
|
+
return s(z);
|
|
126
|
+
},
|
|
127
|
+
children: (e, n) => {
|
|
128
|
+
m();
|
|
129
|
+
var a = r();
|
|
130
|
+
i(() => h(a, I())), t(e, a);
|
|
131
|
+
},
|
|
132
|
+
$$slots: { default: !0 }
|
|
133
|
+
});
|
|
134
|
+
};
|
|
135
|
+
n(l, (e) => {
|
|
136
|
+
s(B) || e(d);
|
|
137
|
+
});
|
|
138
|
+
var p = f(l, 2);
|
|
139
|
+
{
|
|
140
|
+
let r = u(() => s(B) ? "default" : "destructive"), a = u(() => s(B) ? U : H);
|
|
141
|
+
C(p, {
|
|
142
|
+
type: "button",
|
|
143
|
+
get variant() {
|
|
144
|
+
return s(r);
|
|
145
|
+
},
|
|
146
|
+
get onclick() {
|
|
147
|
+
return s(a);
|
|
148
|
+
},
|
|
149
|
+
get disabled() {
|
|
150
|
+
return s(z);
|
|
151
|
+
},
|
|
152
|
+
children: (r, a) => {
|
|
153
|
+
var o = M(), c = e(o), l = (e) => {
|
|
154
|
+
y(e, { class: "mr-1 size-4 animate-spin" });
|
|
155
|
+
};
|
|
156
|
+
n(c, (e) => {
|
|
157
|
+
s(z) && e(l);
|
|
158
|
+
});
|
|
159
|
+
var u = f(c);
|
|
160
|
+
i(() => h(u, ` ${(s(B) ? L() : F()) ?? ""}`)), t(r, o);
|
|
161
|
+
},
|
|
162
|
+
$$slots: { default: !0 }
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
t(a, c);
|
|
166
|
+
},
|
|
167
|
+
$$slots: { default: !0 }
|
|
168
|
+
}), t(a, d);
|
|
169
|
+
},
|
|
170
|
+
$$slots: { default: !0 }
|
|
171
|
+
}), d();
|
|
172
|
+
}
|
|
173
|
+
//#endregion
|
|
174
|
+
export { N as t };
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import "./disclose-version-5I57E3LD.js";
|
|
2
|
+
import { $ as e, A as t, E as n, F as r, K as i, M as a, Q as o, R as s, S as c, V as l, _t as u, at as d, ct as f, dt as p, et as m, ft as h, gt as g, i as _, j as v, k as y, n as b, q as x, rt as S, t as C } from "./client-Bc5Fzx40.js";
|
|
3
|
+
import { t as w } from "./loader-circle-Bk-WFz9g.js";
|
|
4
|
+
import { a as T, i as E, n as ee, o as D, r as O, t as k } from "./dialog-BDkiG42a.js";
|
|
5
|
+
import { t as A } from "./label-C-GkhEp4.js";
|
|
6
|
+
import { t as j } from "./Icon-DtNo0N1U.js";
|
|
7
|
+
import { t as M } from "./circle-check-CDqeMB2d.js";
|
|
8
|
+
import "./ConfirmDialog-Cpzyb55f.js";
|
|
9
|
+
import { D as N, Qn as P, gi as F, ir as I, nr as L, pi as R, tr as z } from "./messages-BpYaLbzE.js";
|
|
10
|
+
import { t as B } from "./input-CBI6p4Xl.js";
|
|
11
|
+
//#region ../node_modules/.bun/lucide-svelte@1.0.1+ff5f301bb2db9a0d/node_modules/lucide-svelte/dist/icons/file-text.svelte
|
|
12
|
+
function V(n, r) {
|
|
13
|
+
let i = C(r, [
|
|
14
|
+
"children",
|
|
15
|
+
"$$slots",
|
|
16
|
+
"$$events",
|
|
17
|
+
"$$legacy"
|
|
18
|
+
]), a = [
|
|
19
|
+
["path", { d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" }],
|
|
20
|
+
["path", { d: "M14 2v5a1 1 0 0 0 1 1h5" }],
|
|
21
|
+
["path", { d: "M10 9H8" }],
|
|
22
|
+
["path", { d: "M16 13H8" }],
|
|
23
|
+
["path", { d: "M16 17H8" }]
|
|
24
|
+
];
|
|
25
|
+
j(n, _({ name: "file-text" }, () => i, {
|
|
26
|
+
get iconNode() {
|
|
27
|
+
return a;
|
|
28
|
+
},
|
|
29
|
+
children: (n, i) => {
|
|
30
|
+
var a = v();
|
|
31
|
+
c(e(a), r, "default", {}, null), t(n, a);
|
|
32
|
+
},
|
|
33
|
+
$$slots: { default: !0 }
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region ../node_modules/.bun/lucide-svelte@1.0.1+ff5f301bb2db9a0d/node_modules/lucide-svelte/dist/icons/plus.svelte
|
|
38
|
+
function H(n, r) {
|
|
39
|
+
let i = C(r, [
|
|
40
|
+
"children",
|
|
41
|
+
"$$slots",
|
|
42
|
+
"$$events",
|
|
43
|
+
"$$legacy"
|
|
44
|
+
]), a = [["path", { d: "M5 12h14" }], ["path", { d: "M12 5v14" }]];
|
|
45
|
+
j(n, _({ name: "plus" }, () => i, {
|
|
46
|
+
get iconNode() {
|
|
47
|
+
return a;
|
|
48
|
+
},
|
|
49
|
+
children: (n, i) => {
|
|
50
|
+
var a = v();
|
|
51
|
+
c(e(a), r, "default", {}, null), t(n, a);
|
|
52
|
+
},
|
|
53
|
+
$$slots: { default: !0 }
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/lib/components/FolderDialog.svelte
|
|
58
|
+
var U = a("<!> <!>", 1), W = a("<div class=\"space-y-3 rounded-lg border border-primary/30 bg-primary/10 p-4\" role=\"status\" aria-live=\"polite\"><div class=\"flex items-start gap-3\"><!> <div><p class=\"text-sm font-medium text-foreground\">Folder created</p> <p class=\"text-sm text-muted-foreground\"> </p></div></div></div>"), G = a("<p id=\"folder-dialog-name-error\" class=\"text-xs text-destructive\" role=\"alert\"> </p>"), K = a("<form class=\"space-y-4\"><div class=\"space-y-2\"><!> <!> <!></div></form>"), q = a("<!> ", 1), J = a("<!> <!> <!>", 1);
|
|
59
|
+
function Y(a, c) {
|
|
60
|
+
h(c, !0);
|
|
61
|
+
let _ = b(c, "open", 15, !1), v = b(c, "closeOnSave", 3, !0), C = d(""), j = d(null), V = d(!1), H = d(null);
|
|
62
|
+
x(() => {
|
|
63
|
+
_() && (S(C, c.folder?.name ?? "", !0), S(j, null), S(H, null));
|
|
64
|
+
});
|
|
65
|
+
let Y = f(() => l(C).trim()), X = f(() => c.mode === "edit" ? R() : F()), Z = f(() => c.mode === "edit" ? L() : P());
|
|
66
|
+
async function Q(e) {
|
|
67
|
+
if (e?.preventDefault(), !l(V)) {
|
|
68
|
+
if (l(Y).length === 0) {
|
|
69
|
+
S(j, "Folder name is required");
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
if (!c.onSave) {
|
|
73
|
+
$();
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
S(V, !0);
|
|
77
|
+
try {
|
|
78
|
+
let e = await c.onSave(l(Y));
|
|
79
|
+
v() ? $(!0) : S(H, typeof e == "object" && e && "name" in e && typeof e.name == "string" ? e.name : l(Y), !0);
|
|
80
|
+
} catch (e) {
|
|
81
|
+
console.error("FolderDialog: save failed", e), S(j, e instanceof Error ? e.message : I(), !0);
|
|
82
|
+
} finally {
|
|
83
|
+
S(V, !1);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
function te() {
|
|
88
|
+
S(H, null), S(C, ""), S(j, null);
|
|
89
|
+
}
|
|
90
|
+
function $(e = !1) {
|
|
91
|
+
l(V) && !e || (_(!1), c.onClose?.());
|
|
92
|
+
}
|
|
93
|
+
T(a, {
|
|
94
|
+
onOpenChange: (e) => {
|
|
95
|
+
e || $();
|
|
96
|
+
},
|
|
97
|
+
get open() {
|
|
98
|
+
return _();
|
|
99
|
+
},
|
|
100
|
+
set open(e) {
|
|
101
|
+
_(e);
|
|
102
|
+
},
|
|
103
|
+
children: (a, d) => {
|
|
104
|
+
var p = J(), h = e(p);
|
|
105
|
+
ee(h, {
|
|
106
|
+
children: (n, a) => {
|
|
107
|
+
var o = U(), s = e(o);
|
|
108
|
+
k(s, {
|
|
109
|
+
children: (e, n) => {
|
|
110
|
+
g();
|
|
111
|
+
var a = r();
|
|
112
|
+
i(() => y(a, l(X))), t(e, a);
|
|
113
|
+
},
|
|
114
|
+
$$slots: { default: !0 }
|
|
115
|
+
}), E(m(s, 2), {
|
|
116
|
+
children: (e, n) => {
|
|
117
|
+
g();
|
|
118
|
+
var a = r();
|
|
119
|
+
i((e) => y(a, e), [() => c.mode === "edit" ? R() : N()]), t(e, a);
|
|
120
|
+
},
|
|
121
|
+
$$slots: { default: !0 }
|
|
122
|
+
}), t(n, o);
|
|
123
|
+
},
|
|
124
|
+
$$slots: { default: !0 }
|
|
125
|
+
});
|
|
126
|
+
var _ = m(h, 2), v = (e) => {
|
|
127
|
+
var n = W(), r = o(n), a = o(r);
|
|
128
|
+
M(a, { class: "mt-0.5 size-5 shrink-0 text-primary" });
|
|
129
|
+
var s = m(a, 2), c = m(o(s), 2), d = o(c);
|
|
130
|
+
u(c), u(s), u(r), u(n), i(() => y(d, `${l(H) ?? ""} is ready to use.`)), t(e, n);
|
|
131
|
+
}, b = (e) => {
|
|
132
|
+
var a = K(), c = o(a), d = o(c);
|
|
133
|
+
A(d, {
|
|
134
|
+
for: "folder-dialog-name",
|
|
135
|
+
children: (e, n) => {
|
|
136
|
+
g();
|
|
137
|
+
var a = r();
|
|
138
|
+
i((e) => y(a, e), [() => N()]), t(e, a);
|
|
139
|
+
},
|
|
140
|
+
$$slots: { default: !0 }
|
|
141
|
+
});
|
|
142
|
+
var p = m(d, 2);
|
|
143
|
+
{
|
|
144
|
+
let e = f(() => N()), t = f(() => l(j) ? "true" : void 0), n = f(() => l(j) ? "folder-dialog-name-error" : void 0);
|
|
145
|
+
B(p, {
|
|
146
|
+
id: "folder-dialog-name",
|
|
147
|
+
name: "name",
|
|
148
|
+
type: "text",
|
|
149
|
+
get placeholder() {
|
|
150
|
+
return l(e);
|
|
151
|
+
},
|
|
152
|
+
maxlength: 255,
|
|
153
|
+
required: !0,
|
|
154
|
+
get disabled() {
|
|
155
|
+
return l(V);
|
|
156
|
+
},
|
|
157
|
+
get "aria-invalid"() {
|
|
158
|
+
return l(t);
|
|
159
|
+
},
|
|
160
|
+
get "aria-describedby"() {
|
|
161
|
+
return l(n);
|
|
162
|
+
},
|
|
163
|
+
autocomplete: "off",
|
|
164
|
+
get value() {
|
|
165
|
+
return l(C);
|
|
166
|
+
},
|
|
167
|
+
set value(e) {
|
|
168
|
+
S(C, e, !0);
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
var h = m(p, 2), _ = (e) => {
|
|
173
|
+
var n = G(), r = o(n, !0);
|
|
174
|
+
u(n), i(() => y(r, l(j))), t(e, n);
|
|
175
|
+
};
|
|
176
|
+
n(h, (e) => {
|
|
177
|
+
l(j) && e(_);
|
|
178
|
+
}), u(c), u(a), s("submit", a, Q), t(e, a);
|
|
179
|
+
};
|
|
180
|
+
n(_, (e) => {
|
|
181
|
+
l(H) ? e(v) : e(b, -1);
|
|
182
|
+
}), O(m(_, 2), {
|
|
183
|
+
class: "gap-2 max-sm:flex-col max-sm:items-stretch",
|
|
184
|
+
children: (a, o) => {
|
|
185
|
+
var s = U(), c = e(s), u = (e) => {
|
|
186
|
+
D(e, {
|
|
187
|
+
variant: "outline",
|
|
188
|
+
type: "button",
|
|
189
|
+
onclick: te,
|
|
190
|
+
children: (e, n) => {
|
|
191
|
+
g(), t(e, r("Create another"));
|
|
192
|
+
},
|
|
193
|
+
$$slots: { default: !0 }
|
|
194
|
+
});
|
|
195
|
+
}, d = (e) => {
|
|
196
|
+
D(e, {
|
|
197
|
+
variant: "outline",
|
|
198
|
+
type: "button",
|
|
199
|
+
onclick: () => $(),
|
|
200
|
+
get disabled() {
|
|
201
|
+
return l(V);
|
|
202
|
+
},
|
|
203
|
+
children: (e, n) => {
|
|
204
|
+
g();
|
|
205
|
+
var a = r();
|
|
206
|
+
i((e) => y(a, e), [() => z()]), t(e, a);
|
|
207
|
+
},
|
|
208
|
+
$$slots: { default: !0 }
|
|
209
|
+
});
|
|
210
|
+
};
|
|
211
|
+
n(c, (e) => {
|
|
212
|
+
l(H) ? e(u) : e(d, -1);
|
|
213
|
+
});
|
|
214
|
+
var p = m(c, 2);
|
|
215
|
+
{
|
|
216
|
+
let r = f(() => l(H) ? () => $() : Q), a = f(() => l(V) || !l(H) && l(Y).length === 0);
|
|
217
|
+
D(p, {
|
|
218
|
+
type: "submit",
|
|
219
|
+
get onclick() {
|
|
220
|
+
return l(r);
|
|
221
|
+
},
|
|
222
|
+
get disabled() {
|
|
223
|
+
return l(a);
|
|
224
|
+
},
|
|
225
|
+
children: (r, a) => {
|
|
226
|
+
var o = q(), s = e(o), c = (e) => {
|
|
227
|
+
w(e, { class: "mr-1 size-4 animate-spin" });
|
|
228
|
+
};
|
|
229
|
+
n(s, (e) => {
|
|
230
|
+
l(V) && e(c);
|
|
231
|
+
});
|
|
232
|
+
var u = m(s);
|
|
233
|
+
i(() => y(u, ` ${(l(H) ? "Done" : l(Z)) ?? ""}`)), t(r, o);
|
|
234
|
+
},
|
|
235
|
+
$$slots: { default: !0 }
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
t(a, s);
|
|
239
|
+
},
|
|
240
|
+
$$slots: { default: !0 }
|
|
241
|
+
}), t(a, p);
|
|
242
|
+
},
|
|
243
|
+
$$slots: { default: !0 }
|
|
244
|
+
}), p();
|
|
245
|
+
}
|
|
246
|
+
//#endregion
|
|
247
|
+
export { H as n, V as r, Y as t };
|