@hiai-gg/docsmint 0.5.1 → 0.5.2
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 +47 -8
- package/dist/backend-account-runtime-cleanup.js +20 -3
- package/dist/backend-api-key-facade.js +20 -3
- package/dist/backend-pipeline-cancellation.js +20 -3
- package/dist/frontend/{HiaiDocsExtensionProvider-CMiTXi2J.js → HiaiDocsExtensionProvider-OSn96BBw.js} +1 -1
- package/dist/frontend/{SettingsDialog-DEx1eEZm.js → SettingsDialog-Bd_S2RKW.js} +104 -96
- package/dist/frontend/ShareDialog-BC-Jl6v1.js +257 -0
- package/dist/frontend/{Sidebar-BthP-jOS.js → Sidebar-BnZgNl_8.js} +347 -331
- package/dist/frontend/api/attachments.js +1 -1
- package/dist/frontend/app-shell.js +3 -3
- package/dist/frontend/{attachments-C2DBzU-r.js → attachments-B8AuDjno.js} +8 -5
- package/dist/frontend/components/editor/document-editor.js +1 -1
- package/dist/frontend/components/settings.js +1 -1
- package/dist/frontend/components/share-dialog.js +1 -1
- package/dist/frontend/components/sidebar.js +1 -1
- package/dist/frontend/{context-KLiM3QQ0.js → context-D0zPFXZ4.js} +2 -0
- package/dist/frontend/dashboard.js +10 -4
- package/dist/frontend/extension.d.ts +3 -2
- package/dist/frontend/extension.js +1 -1
- package/dist/frontend/frontend.css +1 -1
- package/dist/frontend/search.js +1 -1
- package/dist/frontend/shared-document.js +1 -1
- package/dist/frontend-ssr/api/attachments.js +1 -1
- package/dist/frontend-ssr/app-shell.js +4 -4
- package/dist/frontend-ssr/assets/{CategoryDialog-DDu37Oub.js → CategoryDialog-Cnlmr1sz.js} +1 -1
- package/dist/frontend-ssr/assets/{CreateSnapshotDialog-DNAjd4eD.js → CreateSnapshotDialog-b6O0nUVp.js} +1 -1
- package/dist/frontend-ssr/assets/{DatePicker-Cp6Qmgdb.js → DatePicker-D84cJ-Eq.js} +1 -1
- package/dist/frontend-ssr/assets/{FolderNode-CrLWqHJH.js → FolderNode-CnFVWuQi.js} +1 -1
- package/dist/frontend-ssr/assets/{HiaiDocsExtensionProvider-B_MrN08c.js → HiaiDocsExtensionProvider-BRKWmcDd.js} +1 -1
- package/dist/frontend-ssr/assets/{SettingsDialog-BymUxBgg.js → SettingsDialog-BPdUl6pd.js} +23 -9
- package/dist/frontend-ssr/assets/ShareDialog-BZd28sg-.js +45 -0
- package/dist/frontend-ssr/assets/{Sidebar-CI8YKbrY.js → Sidebar-DwYZH0Tr.js} +38 -11
- package/dist/frontend-ssr/assets/{TagCreateDialog-B7wDbVqG.js → TagCreateDialog-DUPMitlL.js} +1 -1
- package/dist/frontend-ssr/assets/{attachments-CXgatN0B.js → attachments-Cj3fQyUp.js} +11 -4
- package/dist/frontend-ssr/assets/{confirm-dialog-B3C0WeMn.js → confirm-dialog-XuyaL8sr.js} +1 -1
- package/dist/frontend-ssr/assets/{context-BtCMqdVe.js → context-Bi_mO-NS.js} +2 -0
- package/dist/frontend-ssr/assets/{messages-D-auzk9H.js → messages-BAQzILs4.js} +1 -1
- package/dist/frontend-ssr/components/category-dialog.js +1 -1
- package/dist/frontend-ssr/components/create-snapshot-dialog.js +1 -1
- package/dist/frontend-ssr/components/editor/document-editor.js +2 -2
- package/dist/frontend-ssr/components/editor/document-title.js +1 -1
- package/dist/frontend-ssr/components/editor/markdown-toggle.js +1 -1
- package/dist/frontend-ssr/components/folder-node.js +1 -1
- package/dist/frontend-ssr/components/save-as-dialog.js +1 -1
- package/dist/frontend-ssr/components/settings.js +1 -1
- package/dist/frontend-ssr/components/share-dialog.js +1 -1
- package/dist/frontend-ssr/components/sidebar.js +1 -1
- package/dist/frontend-ssr/components/tag-create-dialog.js +1 -1
- package/dist/frontend-ssr/components/version-history.js +2 -2
- package/dist/frontend-ssr/dashboard.js +12 -7
- package/dist/frontend-ssr/extension.js +1 -1
- package/dist/frontend-ssr/i18n.js +1 -1
- package/dist/frontend-ssr/search.js +3 -3
- package/dist/frontend-ssr/shared-document.js +1 -1
- package/dist/lifecycle-runtime.js +18 -3
- package/dist/types.d.ts +5 -0
- package/package.json +1 -1
- package/packages/cli/src/index.ts +1 -1
- package/packages/db/src/schema.ts +17 -2
- package/packages/mcp-server/src/index.ts +1 -1
- package/dist/frontend/ShareDialog-uEf8Ks02.js +0 -166
- package/dist/frontend-ssr/assets/ShareDialog-B82t8oJi.js +0 -56
|
@@ -5,12 +5,12 @@ import { n as r, t as i } from "./folder-Cx60MRpi.js";
|
|
|
5
5
|
import { t as a } from "./clock-Dz86E4Kz.js";
|
|
6
6
|
import { t as o } from "./copy-CvCh4ZVt.js";
|
|
7
7
|
import { n as s, r as c, t as l } from "./confirm-dialog-CzmoZw3a.js";
|
|
8
|
-
import { t as u } from "./SettingsDialog-
|
|
8
|
+
import { t as u } from "./SettingsDialog-Bd_S2RKW.js";
|
|
9
9
|
import { n as d, t as f } from "./tag-DhVFHMcV.js";
|
|
10
10
|
import { t as p } from "./x-cfdlccjs.js";
|
|
11
|
-
import { a as m, i as h, o as
|
|
12
|
-
import { n as
|
|
13
|
-
import { $r as
|
|
11
|
+
import { a as m, i as h, o as ee, r as g, t as te } from "./dropdown-menu-CJ_7V3N0.js";
|
|
12
|
+
import { n as ne } from "./dist-DQa_OHOa.js";
|
|
13
|
+
import { $r as _, Di as v, Ei as y, Er as b, Gn as x, Gt as re, Ii as S, Kt as C, Lt as w, O as T, Oi as E, Pi as ie, Qr as D, Ti as ae, Ut as O, Wn as oe, Xn as se, Xr as k, Yn as A, Zr as j, di as ce, ei as M, hi as le, ir as ue, ji as de, ki as fe, li as pe, nr as N, or as me, p as he, pi as ge, ri as P, rr as _e, tr as ve, ui as ye, vi as be, w as xe, wi as Se } from "./messages-DIovIZrK.js";
|
|
14
14
|
import { a as Ce, i as we, n as Te, t as Ee } from "./route-context-DYQlUfzL.js";
|
|
15
15
|
import { t as F } from "./utils-DrfHTcei.js";
|
|
16
16
|
import { a as De, i as Oe, n as ke, o as Ae, r as je, t as Me } from "./dialog-Ce79C9fd.js";
|
|
@@ -18,17 +18,17 @@ import { t as Ne } from "./input-BWlOML_m.js";
|
|
|
18
18
|
import { t as Pe } from "./label-C2HfJNQ2.js";
|
|
19
19
|
import { n as Fe } from "./client-GbtOH90i.js";
|
|
20
20
|
import { i as Ie, r as Le, s as Re } from "./categories-X7gK8azc.js";
|
|
21
|
-
import { t as I } from "./context-
|
|
22
|
-
import { t as
|
|
23
|
-
import { n as
|
|
24
|
-
import { c as
|
|
25
|
-
import { c as
|
|
26
|
-
import { t as
|
|
27
|
-
import { t as
|
|
28
|
-
import { t as
|
|
29
|
-
import { t as
|
|
30
|
-
import { n as
|
|
31
|
-
import { a as
|
|
21
|
+
import { t as I } from "./context-D0zPFXZ4.js";
|
|
22
|
+
import { t as L } from "./resolve-BG4HgzpN.js";
|
|
23
|
+
import { n as ze, t as Be } from "./dndzone-BzsOINtP.js";
|
|
24
|
+
import { c as Ve, i as He, r as Ue, s as We, t as Ge } from "./documents-CwCs1rA7.js";
|
|
25
|
+
import { c as Ke, r as qe, s as Je, t as Ye } from "./folders-ONG03Dkv.js";
|
|
26
|
+
import { t as Xe } from "./DeleteDialog-8k6JYWCx.js";
|
|
27
|
+
import { t as Ze } from "./clipboard-Cgzxc0_R.js";
|
|
28
|
+
import { t as Qe } from "./ShareDialog-BC-Jl6v1.js";
|
|
29
|
+
import { t as $e } from "./CategoryDialog-DmlX0Z97.js";
|
|
30
|
+
import { n as et, t as tt } from "./document-drop-coordinator-C4xHMjwC.js";
|
|
31
|
+
import { a as nt, c as rt, d as it, f as at, i as ot, n as st, o as ct, p as lt, r as ut, s as dt, t as ft, u as pt } from "./subfolders-refresh-store.svelte-B2dKVmgz.js";
|
|
32
32
|
import { t as mt } from "./FolderNode-D3rN3yLV.js";
|
|
33
33
|
import { a as ht, i as R, n as z, o as B, s as gt, t as _t } from "./tag-store.svelte-ogVCMCbv.js";
|
|
34
34
|
import { t as vt } from "./ConfirmDialog-DgMTQBq4.js";
|
|
@@ -140,7 +140,7 @@ function kt(e, t) {
|
|
|
140
140
|
var t = Dt();
|
|
141
141
|
p(V.child(t), { class: "size-3.5" }), V.reset(t), V.template_effect((e, n) => {
|
|
142
142
|
V.set_attribute(t, "aria-label", e), V.set_attribute(t, "title", n);
|
|
143
|
-
}, [() =>
|
|
143
|
+
}, [() => w(), () => w()]), V.delegated("click", t, a), V.append(e, t);
|
|
144
144
|
};
|
|
145
145
|
V.if(l, (e) => {
|
|
146
146
|
V.get(n) && e(u);
|
|
@@ -148,7 +148,7 @@ function kt(e, t) {
|
|
|
148
148
|
V.set_class(o, 1, e), V.set_attribute(c, "placeholder", t), V.set_class(c, 1, n);
|
|
149
149
|
}, [
|
|
150
150
|
() => V.clsx(F("relative", t.class)),
|
|
151
|
-
() =>
|
|
151
|
+
() => k(),
|
|
152
152
|
() => V.clsx(F("flex h-9 w-full rounded-md border border-input bg-transparent pl-9 py-1 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring", V.get(n) ? "pr-9" : "pr-3"))
|
|
153
153
|
]), V.delegated("keydown", c, (e) => {
|
|
154
154
|
e.key === "Enter" && V.get(n).trim() && Te(i, `/search?q=${encodeURIComponent(V.get(n).trim())}`);
|
|
@@ -171,7 +171,7 @@ function Kt(e, i) {
|
|
|
171
171
|
m(e, {
|
|
172
172
|
children: (e, n) => {
|
|
173
173
|
var r = Nt(), i = V.first_child(r);
|
|
174
|
-
|
|
174
|
+
te(i, {
|
|
175
175
|
child: (e, t) => {
|
|
176
176
|
let n = () => (t?.()).props;
|
|
177
177
|
var r = jt(), i = (e) => {
|
|
@@ -184,38 +184,38 @@ function Kt(e, i) {
|
|
|
184
184
|
"aria-label": e,
|
|
185
185
|
title: t,
|
|
186
186
|
onclick: i
|
|
187
|
-
}), [() =>
|
|
187
|
+
}), [() => C(), () => C()]), ee(V.child(r), { class: "size-3.5" }), V.reset(r), V.append(e, r);
|
|
188
188
|
},
|
|
189
189
|
$$slots: { child: !0 }
|
|
190
190
|
}), h(V.sibling(i, 2), {
|
|
191
191
|
align: "end",
|
|
192
192
|
children: (e, n) => {
|
|
193
193
|
var r = Mt(), i = V.first_child(r);
|
|
194
|
-
|
|
194
|
+
g(i, {
|
|
195
195
|
onSelect: () => ir("doc", t().id, t().title),
|
|
196
196
|
children: (e, t) => {
|
|
197
197
|
V.next();
|
|
198
198
|
var n = V.text();
|
|
199
|
-
V.template_effect((e) => V.set_text(n, e), [() =>
|
|
199
|
+
V.template_effect((e) => V.set_text(n, e), [() => le()]), V.append(e, n);
|
|
200
200
|
},
|
|
201
201
|
$$slots: { default: !0 }
|
|
202
202
|
});
|
|
203
203
|
var a = V.sibling(i, 2);
|
|
204
|
-
|
|
204
|
+
g(a, {
|
|
205
205
|
onSelect: () => cr(t().id, t().title),
|
|
206
206
|
children: (e, t) => {
|
|
207
207
|
V.next();
|
|
208
208
|
var n = V.text();
|
|
209
|
-
V.template_effect((e) => V.set_text(n, e), [() =>
|
|
209
|
+
V.template_effect((e) => V.set_text(n, e), [() => ae()]), V.append(e, n);
|
|
210
210
|
},
|
|
211
211
|
$$slots: { default: !0 }
|
|
212
|
-
}),
|
|
212
|
+
}), g(V.sibling(a, 2), {
|
|
213
213
|
class: "text-destructive focus:text-destructive",
|
|
214
214
|
onSelect: () => sr("doc", t().id, t().title),
|
|
215
215
|
children: (e, t) => {
|
|
216
216
|
V.next();
|
|
217
217
|
var n = V.text();
|
|
218
|
-
V.template_effect((e) => V.set_text(n, e), [() =>
|
|
218
|
+
V.template_effect((e) => V.set_text(n, e), [() => N()]), V.append(e, n);
|
|
219
219
|
},
|
|
220
220
|
$$slots: { default: !0 }
|
|
221
221
|
}), V.append(e, r);
|
|
@@ -227,7 +227,7 @@ function Kt(e, i) {
|
|
|
227
227
|
});
|
|
228
228
|
}, c = (e, n = V.noop) => {
|
|
229
229
|
var r = Pt(), i = V.child(r), a = (e) => {
|
|
230
|
-
|
|
230
|
+
ne(e, { class: "size-3.5 animate-spin" });
|
|
231
231
|
}, s = (e) => {
|
|
232
232
|
t(e, { class: "size-3.5" });
|
|
233
233
|
}, c = (e) => {
|
|
@@ -237,7 +237,7 @@ function Kt(e, i) {
|
|
|
237
237
|
V.get(ln) === n().id ? e(a) : V.get(cn) === n().id ? e(s, 1) : e(c, -1);
|
|
238
238
|
}), V.reset(r), V.template_effect((e, t) => {
|
|
239
239
|
V.set_class(r, 1, `inline-flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-accent-foreground group-hover/doc:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${V.get(cn) === n().id || V.get(ln) === n().id ? "opacity-100" : ""}`), V.set_attribute(r, "aria-label", e), V.set_attribute(r, "title", t), r.disabled = V.get(ln) === n().id;
|
|
240
|
-
}, [() =>
|
|
240
|
+
}, [() => re(), () => re()]), V.delegated("click", r, (e) => {
|
|
241
241
|
e.preventDefault(), e.stopPropagation(), dn(n().id);
|
|
242
242
|
}), V.append(e, r);
|
|
243
243
|
}, u = (e, t = V.noop) => {
|
|
@@ -246,7 +246,7 @@ function Kt(e, i) {
|
|
|
246
246
|
return t();
|
|
247
247
|
},
|
|
248
248
|
get expandedFolderIds() {
|
|
249
|
-
return V.get(
|
|
249
|
+
return V.get(w);
|
|
250
250
|
},
|
|
251
251
|
onToggleFolder: kn,
|
|
252
252
|
onRename: (e, t) => ir("folder", e, t),
|
|
@@ -260,10 +260,10 @@ function Kt(e, i) {
|
|
|
260
260
|
return V.get(I);
|
|
261
261
|
},
|
|
262
262
|
get isDraggingFolder() {
|
|
263
|
-
return V.get(
|
|
263
|
+
return V.get(L);
|
|
264
264
|
},
|
|
265
265
|
get isDraggingDoc() {
|
|
266
|
-
return V.get(
|
|
266
|
+
return V.get(it);
|
|
267
267
|
},
|
|
268
268
|
get draggedDocId() {
|
|
269
269
|
return V.get(R);
|
|
@@ -279,7 +279,7 @@ function Kt(e, i) {
|
|
|
279
279
|
return V.get(H);
|
|
280
280
|
},
|
|
281
281
|
folderFlipDurationMs: p,
|
|
282
|
-
documentFlipDurationMs:
|
|
282
|
+
documentFlipDurationMs: _,
|
|
283
283
|
get docRowInner() {
|
|
284
284
|
return At;
|
|
285
285
|
},
|
|
@@ -290,25 +290,25 @@ function Kt(e, i) {
|
|
|
290
290
|
return a;
|
|
291
291
|
}
|
|
292
292
|
});
|
|
293
|
-
}, d = Ee(), f = Ce(), p = 200,
|
|
294
|
-
function
|
|
295
|
-
V.set(
|
|
296
|
-
V.set(
|
|
293
|
+
}, d = Ee(), f = Ce(), p = 200, _ = 80, y = V.state(V.proxy([])), b = V.state(V.proxy([])), x = V.state(V.proxy([])), w = V.state(V.proxy(/* @__PURE__ */ new Set())), T = V.state(V.proxy(/* @__PURE__ */ new Set())), D = V.state(!0), O = V.state(null), k = V.state(null), j = null;
|
|
294
|
+
function M(e) {
|
|
295
|
+
V.set(k, e, !0), j &&= (clearTimeout(j), null), e !== null && (j = setTimeout(() => {
|
|
296
|
+
V.set(k, null), j = null;
|
|
297
297
|
}, 5e3));
|
|
298
298
|
}
|
|
299
|
-
let P = V.state(!1), I = V.state(!1),
|
|
299
|
+
let P = V.state(!1), I = V.state(!1), L = V.state(!1), it = V.state(!1), R = V.state(null), B = 0, gt = V.state(!1), vt = V.state(!1), yt = 0, bt = Promise.resolve(), xt = V.state(V.proxy([])), H = V.state(V.proxy({})), Et = V.state(V.proxy({})), U = V.state(V.proxy({})), W = V.state(V.proxy([])), Dt = V.state(!1), Ot = V.state(null), kt = V.state(null), Ft = V.state(!1), Kt = V.state(null), qt = V.state(""), G = V.state(null), K = V.state(!1), Jt = V.state(!1), q = V.state(null), Yt = V.state(!1), Xt = V.state(""), Zt = V.state(""), Qt = V.state(""), $t = V.state(""), en = V.state(""), tn = V.state(""), nn = V.state(!1), rn = V.state("create"), J = V.state(null), an = V.state(!1), Y = null, on = V.state(null), X = null, sn = V.state(null), cn = V.state(null), ln = V.state(null), un = null;
|
|
300
300
|
async function dn(e) {
|
|
301
301
|
if (typeof window > "u") return;
|
|
302
|
-
let t = V.get(
|
|
302
|
+
let t = V.get(x).find((t) => t.id === e), n = "";
|
|
303
303
|
V.set(ln, e, !0);
|
|
304
304
|
try {
|
|
305
|
-
n = (await
|
|
305
|
+
n = (await He(e, f.fetch)).content ?? "";
|
|
306
306
|
} catch (e) {
|
|
307
307
|
console.error("FolderTree: failed to fetch full document for copy", e), n = t?.excerpt ?? t?.content ?? "";
|
|
308
308
|
} finally {
|
|
309
309
|
V.set(ln, null);
|
|
310
310
|
}
|
|
311
|
-
n && await
|
|
311
|
+
n && await Ze(n) && (V.set(cn, e, !0), un && clearTimeout(un), un = setTimeout(() => {
|
|
312
312
|
V.set(cn, null), un = null;
|
|
313
313
|
}, 2e3));
|
|
314
314
|
}
|
|
@@ -316,10 +316,10 @@ function Kt(e, i) {
|
|
|
316
316
|
Y !== null && (clearTimeout(Y), Y = null), V.set(on, null);
|
|
317
317
|
}
|
|
318
318
|
function pn(e) {
|
|
319
|
-
fn(), !V.get(
|
|
320
|
-
if (V.get(on) === e && !V.get(
|
|
321
|
-
let t = new Set(V.get(
|
|
322
|
-
t.add(e), V.set(
|
|
319
|
+
fn(), !V.get(w).has(e) && (V.set(on, e, !0), Y = setTimeout(() => {
|
|
320
|
+
if (V.get(on) === e && !V.get(w).has(e)) {
|
|
321
|
+
let t = new Set(V.get(w));
|
|
322
|
+
t.add(e), V.set(w, t, !0);
|
|
323
323
|
}
|
|
324
324
|
Y = null, V.set(on, null);
|
|
325
325
|
}, 400));
|
|
@@ -328,11 +328,11 @@ function Kt(e, i) {
|
|
|
328
328
|
X !== null && (clearTimeout(X), X = null), V.set(sn, null);
|
|
329
329
|
}
|
|
330
330
|
function hn(e) {
|
|
331
|
-
mn(), !(e === $ ? V.get(
|
|
332
|
-
if (V.get(sn) === e) if (e === $) V.set(
|
|
331
|
+
mn(), !(e === $ ? V.get(D) : V.get(T).has(e)) && (V.set(sn, e, !0), X = setTimeout(() => {
|
|
332
|
+
if (V.get(sn) === e) if (e === $) V.set(D, !0);
|
|
333
333
|
else {
|
|
334
|
-
let t = new Set(V.get(
|
|
335
|
-
t.add(e), V.set(
|
|
334
|
+
let t = new Set(V.get(T));
|
|
335
|
+
t.add(e), V.set(T, t, !0);
|
|
336
336
|
}
|
|
337
337
|
X = null, V.set(sn, null);
|
|
338
338
|
}, 400));
|
|
@@ -356,20 +356,20 @@ function Kt(e, i) {
|
|
|
356
356
|
};
|
|
357
357
|
}
|
|
358
358
|
function vn() {
|
|
359
|
-
let { root: e, byCategory: t, byFolder: n } = _n(V.get(
|
|
359
|
+
let { root: e, byCategory: t, byFolder: n } = _n(V.get(x));
|
|
360
360
|
V.set(xt, e, !0), V.set(Et, t, !0), V.set(H, n, !0);
|
|
361
361
|
}
|
|
362
362
|
function yn() {
|
|
363
363
|
let e = /* @__PURE__ */ new Map();
|
|
364
|
-
for (let t of V.get(
|
|
364
|
+
for (let t of V.get(b)) e.set(t.id, []);
|
|
365
365
|
let t = [];
|
|
366
|
-
for (let n of V.get(
|
|
366
|
+
for (let n of V.get(y)) n.categoryId && e.has(n.categoryId) ? e.get(n.categoryId)?.push(n) : t.push(n);
|
|
367
367
|
let n = {};
|
|
368
|
-
for (let t of V.get(
|
|
368
|
+
for (let t of V.get(b)) n[t.id] = e.get(t.id) ?? [];
|
|
369
369
|
n[$] = t, V.set(U, n, !0);
|
|
370
370
|
}
|
|
371
371
|
V.user_effect(() => {
|
|
372
|
-
V.get(
|
|
372
|
+
V.get(y), V.get(b), !(V.get(gt) || V.get(vt)) && (V.set(W, V.get(xr).map((e) => ({
|
|
373
373
|
id: e.id,
|
|
374
374
|
category: e.category,
|
|
375
375
|
folders: e.folders
|
|
@@ -377,16 +377,16 @@ function Kt(e, i) {
|
|
|
377
377
|
});
|
|
378
378
|
async function bn() {
|
|
379
379
|
try {
|
|
380
|
-
let e = await
|
|
381
|
-
V.set(
|
|
380
|
+
let e = await Je(null, !1, f.fetch);
|
|
381
|
+
V.set(y, (e[0]?.children ?? []).map((e) => (lt(e.id, e.parentId ?? null, e.categoryId ?? null, e.order ?? 0), {
|
|
382
382
|
id: e.id,
|
|
383
383
|
name: e.name,
|
|
384
384
|
categoryId: e.categoryId ?? null,
|
|
385
385
|
parentId: e.parentId,
|
|
386
386
|
order: e.order ?? 0
|
|
387
|
-
})), !0), V.set(
|
|
387
|
+
})), !0), V.set(O, null);
|
|
388
388
|
} catch (e) {
|
|
389
|
-
console.error("FolderTree: failed to load folders", e), V.set(
|
|
389
|
+
console.error("FolderTree: failed to load folders", e), V.set(O, "Failed to load folders");
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
392
|
async function xn() {
|
|
@@ -396,7 +396,7 @@ function Kt(e, i) {
|
|
|
396
396
|
if (t.has(n.id)) throw Error(`Categories response contains duplicate id: ${n.id}`);
|
|
397
397
|
t.add(n.id);
|
|
398
398
|
}
|
|
399
|
-
V.set(
|
|
399
|
+
V.set(b, e, !0);
|
|
400
400
|
} catch (e) {
|
|
401
401
|
console.error("FolderTree: failed to load categories", e);
|
|
402
402
|
}
|
|
@@ -405,56 +405,56 @@ function Kt(e, i) {
|
|
|
405
405
|
async function Cn() {
|
|
406
406
|
let e = ++Sn;
|
|
407
407
|
try {
|
|
408
|
-
let t = z(), n = await
|
|
408
|
+
let t = z(), n = await We({
|
|
409
409
|
limit: 100,
|
|
410
410
|
...t ? { tag: t } : {}
|
|
411
411
|
}, f.fetch);
|
|
412
412
|
if (e !== Sn) return;
|
|
413
|
-
V.set(
|
|
413
|
+
V.set(x, n.items.map((e) => rt(e.id) ? {
|
|
414
414
|
...e,
|
|
415
|
-
folderId:
|
|
416
|
-
categoryId:
|
|
417
|
-
} : e), !0), V.get(
|
|
415
|
+
folderId: rt(e.id)?.folderId ?? null,
|
|
416
|
+
categoryId: rt(e.id)?.categoryId ?? null
|
|
417
|
+
} : e), !0), V.get(x).forEach((e) => {
|
|
418
418
|
e.id, e.title, e.categoryId, e.folderId, Object.keys(e), at(e.id, e.folderId ?? null, e.categoryId ?? null);
|
|
419
419
|
}), vn();
|
|
420
420
|
} catch (e) {
|
|
421
|
-
console.error("FolderTree: failed to load documents", e), V.set(
|
|
421
|
+
console.error("FolderTree: failed to load documents", e), V.set(O, "Failed to load documents");
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
424
|
async function Z() {
|
|
425
|
-
|
|
425
|
+
Ge(), await Promise.all([
|
|
426
426
|
bn(),
|
|
427
427
|
xn(),
|
|
428
428
|
Cn()
|
|
429
429
|
]);
|
|
430
430
|
}
|
|
431
431
|
function wn(e, t) {
|
|
432
|
-
Sn++, at(e, t.folderId, t.categoryId), V.set(
|
|
432
|
+
Sn++, at(e, t.folderId, t.categoryId), V.set(x, V.get(x).map((n) => n.id === e ? {
|
|
433
433
|
...n,
|
|
434
434
|
...t
|
|
435
435
|
} : n), !0), vn();
|
|
436
436
|
}
|
|
437
|
-
let Tn =
|
|
438
|
-
patch: (e, t) =>
|
|
437
|
+
let Tn = et({
|
|
438
|
+
patch: (e, t) => Ve(e, t, f.fetch),
|
|
439
439
|
optimistic: (e, t) => pt(e, t.folderId, t.categoryId),
|
|
440
440
|
acknowledge: ft,
|
|
441
441
|
rollback: wn,
|
|
442
442
|
onError: (e) => {
|
|
443
|
-
console.error("FolderTree: document move failed", e),
|
|
443
|
+
console.error("FolderTree: document move failed", e), M(e instanceof Error ? e.message : "Move failed");
|
|
444
444
|
}
|
|
445
445
|
});
|
|
446
446
|
function En(e, t) {
|
|
447
447
|
let n = ut(e);
|
|
448
448
|
n && (n.folderId === t.folderId && n.categoryId === t.categoryId || Tn(e, t, n).catch(() => void 0));
|
|
449
449
|
}
|
|
450
|
-
let Q =
|
|
450
|
+
let Q = tt({ persist: En });
|
|
451
451
|
Ct(() => {
|
|
452
452
|
let e = setTimeout(() => {
|
|
453
453
|
Z();
|
|
454
454
|
}, 500);
|
|
455
455
|
return () => clearTimeout(e);
|
|
456
456
|
}), St(() => {
|
|
457
|
-
Q.cancel(),
|
|
457
|
+
Q.cancel(), j &&= (clearTimeout(j), null), Y &&= (clearTimeout(Y), null), X &&= (clearTimeout(X), null);
|
|
458
458
|
}), V.user_effect(() => {
|
|
459
459
|
let e = _t(), t = ct();
|
|
460
460
|
e === 0 && t === 0 || Z();
|
|
@@ -463,8 +463,8 @@ function Kt(e, i) {
|
|
|
463
463
|
let e = dt();
|
|
464
464
|
e && wt(() => {
|
|
465
465
|
Sn++;
|
|
466
|
-
let t = V.get(
|
|
467
|
-
t !== -1 && (V.set(
|
|
466
|
+
let t = V.get(x).findIndex((t) => t.id === e.id);
|
|
467
|
+
t !== -1 && (V.set(x, V.get(x).map((n, r) => r === t ? {
|
|
468
468
|
...n,
|
|
469
469
|
folderId: e.folderId,
|
|
470
470
|
categoryId: e.categoryId
|
|
@@ -483,17 +483,17 @@ function Kt(e, i) {
|
|
|
483
483
|
await Z();
|
|
484
484
|
}
|
|
485
485
|
function kn(e) {
|
|
486
|
-
let t = V.get(
|
|
487
|
-
t ? n.delete(e) : n.add(e), V.set(
|
|
486
|
+
let t = V.get(w).has(e), n = new Set(V.get(w));
|
|
487
|
+
t ? n.delete(e) : n.add(e), V.set(w, n, !0), V.set(P, !0), typeof window < "u" && window.setTimeout(() => {
|
|
488
488
|
V.set(P, !1);
|
|
489
489
|
}, 250);
|
|
490
490
|
}
|
|
491
491
|
function An(e) {
|
|
492
|
-
let t = new Set(V.get(
|
|
493
|
-
t.has(e) ? t.delete(e) : t.add(e), V.set(
|
|
492
|
+
let t = new Set(V.get(T));
|
|
493
|
+
t.has(e) ? t.delete(e) : t.add(e), V.set(T, t, !0);
|
|
494
494
|
}
|
|
495
495
|
function jn() {
|
|
496
|
-
V.set(
|
|
496
|
+
V.set(D, !V.get(D));
|
|
497
497
|
}
|
|
498
498
|
function Mn() {
|
|
499
499
|
V.set(Ot, null), V.set(kt, null), V.set(Dt, !0);
|
|
@@ -505,12 +505,12 @@ function Kt(e, i) {
|
|
|
505
505
|
V.set(Ot, e, !0), V.set(kt, null), V.set(Dt, !0);
|
|
506
506
|
}
|
|
507
507
|
async function Fn(e) {
|
|
508
|
-
let t = V.get(Ot), n = await
|
|
508
|
+
let t = V.get(Ot), n = await Ye({
|
|
509
509
|
name: e,
|
|
510
510
|
parentId: t,
|
|
511
511
|
categoryId: V.get(kt)
|
|
512
512
|
}, f.fetch);
|
|
513
|
-
return await bn(), t && (V.set(
|
|
513
|
+
return await bn(), t && (V.set(w, new Set(V.get(w)).add(t), !0), st(t)), n;
|
|
514
514
|
}
|
|
515
515
|
function In(e, t) {
|
|
516
516
|
if (e.kind === "root") {
|
|
@@ -532,8 +532,8 @@ function Kt(e, i) {
|
|
|
532
532
|
function Ln(e) {
|
|
533
533
|
return (t) => {
|
|
534
534
|
t.stopPropagation();
|
|
535
|
-
let n = !V.get(
|
|
536
|
-
V.set(I, !0), V.set(
|
|
535
|
+
let n = !V.get(it);
|
|
536
|
+
V.set(I, !0), V.set(it, !0), t.detail.info?.id && (V.set(R, t.detail.info.id, !0), n && Q.begin(t.detail.info.id, ++B)), In(e, gn(t.detail.items)), fn();
|
|
537
537
|
};
|
|
538
538
|
}
|
|
539
539
|
function Rn(e) {
|
|
@@ -542,7 +542,7 @@ function Kt(e, i) {
|
|
|
542
542
|
let n = t.detail.info?.trigger === "droppedIntoAnother";
|
|
543
543
|
t.detail.info?.trigger;
|
|
544
544
|
let r = t.detail.info?.id ?? V.get(R);
|
|
545
|
-
!n && r && Q.zone(r, zn(e)), r && Q.end(r, B), V.set(I, !1), V.set(
|
|
545
|
+
!n && r && Q.zone(r, zn(e)), r && Q.end(r, B), V.set(I, !1), V.set(it, !1), typeof window < "u" ? window.setTimeout(() => {
|
|
546
546
|
V.get(R) === r && V.set(R, null);
|
|
547
547
|
}, 0) : V.set(R, null);
|
|
548
548
|
};
|
|
@@ -550,7 +550,7 @@ function Kt(e, i) {
|
|
|
550
550
|
function zn(e) {
|
|
551
551
|
return {
|
|
552
552
|
folderId: e.kind === "folder" ? e.id : null,
|
|
553
|
-
categoryId: e.kind === "category" ? e.id : e.kind === "root" ? null :
|
|
553
|
+
categoryId: e.kind === "category" ? e.id : e.kind === "root" ? null : nt(e.id)?.categoryId ?? null
|
|
554
554
|
};
|
|
555
555
|
}
|
|
556
556
|
function Bn(e) {
|
|
@@ -572,7 +572,7 @@ function Kt(e, i) {
|
|
|
572
572
|
let n = V.get(R) ?? Q.pendingId(B);
|
|
573
573
|
if (!n) return;
|
|
574
574
|
e.preventDefault(), e.stopPropagation();
|
|
575
|
-
let r =
|
|
575
|
+
let r = nt(t)?.categoryId ?? null, i = ut(n);
|
|
576
576
|
i && (i.folderId !== t && Q.header(n, {
|
|
577
577
|
folderId: t,
|
|
578
578
|
categoryId: r
|
|
@@ -581,7 +581,7 @@ function Kt(e, i) {
|
|
|
581
581
|
let Un = "parent:";
|
|
582
582
|
function Wn(e) {
|
|
583
583
|
return (t) => {
|
|
584
|
-
t.stopPropagation(), V.set(I, !0), V.set(
|
|
584
|
+
t.stopPropagation(), V.set(I, !0), V.set(L, !0);
|
|
585
585
|
let n = Jn(t.detail.items);
|
|
586
586
|
e.startsWith(Un) || V.set(U, {
|
|
587
587
|
...V.get(U),
|
|
@@ -596,7 +596,7 @@ function Kt(e, i) {
|
|
|
596
596
|
e.startsWith(Un) || V.set(U, {
|
|
597
597
|
...V.get(U),
|
|
598
598
|
[e]: n
|
|
599
|
-
}, !0), V.set(I, !1), V.set(
|
|
599
|
+
}, !0), V.set(I, !1), V.set(L, !1), r || Xn(e, n);
|
|
600
600
|
};
|
|
601
601
|
}
|
|
602
602
|
function Kn(e) {
|
|
@@ -612,21 +612,21 @@ function Kt(e, i) {
|
|
|
612
612
|
let t = /* @__PURE__ */ new Set();
|
|
613
613
|
if (!e) return t;
|
|
614
614
|
let n = e;
|
|
615
|
-
for (; n && !t.has(n);) t.add(n), n =
|
|
615
|
+
for (; n && !t.has(n);) t.add(n), n = nt(n)?.parentId ?? null;
|
|
616
616
|
return t;
|
|
617
617
|
}
|
|
618
618
|
async function Xn(e, t) {
|
|
619
619
|
let n = e.startsWith(Un), r = n || e === $ ? null : e, i = n && e.slice(7) || null, a = /* @__PURE__ */ new Map(), o = n ? Yn(i) : /* @__PURE__ */ new Set();
|
|
620
620
|
if (n) for (let e of t) {
|
|
621
621
|
if (o.has(e.id)) continue;
|
|
622
|
-
let t =
|
|
622
|
+
let t = nt(e.id);
|
|
623
623
|
t && t.parentId !== i && (a.set(e.id, {
|
|
624
624
|
folderId: e.id,
|
|
625
625
|
parentId: i
|
|
626
626
|
}), lt(e.id, i, t.categoryId, t.order));
|
|
627
627
|
}
|
|
628
628
|
else for (let e of t) {
|
|
629
|
-
let t =
|
|
629
|
+
let t = nt(e.id);
|
|
630
630
|
if (!t) continue;
|
|
631
631
|
let n = t.categoryId !== r, i = t.parentId !== null;
|
|
632
632
|
if (n || i) {
|
|
@@ -636,7 +636,7 @@ function Kt(e, i) {
|
|
|
636
636
|
}
|
|
637
637
|
t.forEach((e, t) => {
|
|
638
638
|
if (n && o.has(e.id)) return;
|
|
639
|
-
let r =
|
|
639
|
+
let r = nt(e.id);
|
|
640
640
|
if (!r) return;
|
|
641
641
|
let i = r.order !== t, s = a.get(e.id);
|
|
642
642
|
s ? (s.order = t, lt(e.id, s.parentId === void 0 ? r.parentId : s.parentId, s.categoryId === void 0 ? r.categoryId : s.categoryId, t)) : i && (a.set(e.id, {
|
|
@@ -655,11 +655,11 @@ function Kt(e, i) {
|
|
|
655
655
|
if (s.length !== 0) try {
|
|
656
656
|
await Promise.all(s.map((e) => {
|
|
657
657
|
let { folderId: t, ...n } = e;
|
|
658
|
-
return
|
|
658
|
+
return Ke(t, n, f.fetch);
|
|
659
659
|
})), await Z(), yn();
|
|
660
660
|
for (let e of c) st(e);
|
|
661
661
|
} catch (e) {
|
|
662
|
-
console.error("FolderTree: folder DnD persist failed", e),
|
|
662
|
+
console.error("FolderTree: folder DnD persist failed", e), M(e instanceof Error ? `Move failed: ${e.message}` : "Move failed: unknown error");
|
|
663
663
|
}
|
|
664
664
|
}
|
|
665
665
|
function Zn(e) {
|
|
@@ -685,7 +685,7 @@ function Kt(e, i) {
|
|
|
685
685
|
return t;
|
|
686
686
|
}
|
|
687
687
|
function tr(e) {
|
|
688
|
-
let t = er(e), n = new Set(t.filter((e) => e[
|
|
688
|
+
let t = er(e), n = new Set(t.filter((e) => e[ze]).map((e) => e.id)), r = /* @__PURE__ */ new Set(), i = new Map([...V.get(W), ...V.get(xr)].map((e) => [e.id, e])), a = [];
|
|
689
689
|
for (let e of t) {
|
|
690
690
|
if (n.has(e.id) && !e.isDndShadowItem || r.has(e.id)) continue;
|
|
691
691
|
r.add(e.id);
|
|
@@ -706,7 +706,7 @@ function Kt(e, i) {
|
|
|
706
706
|
try {
|
|
707
707
|
await rr(n);
|
|
708
708
|
} catch (e) {
|
|
709
|
-
console.error("FolderTree: category DnD persist failed", e),
|
|
709
|
+
console.error("FolderTree: category DnD persist failed", e), M(e instanceof Error ? `Reorder failed: ${e.message}` : "Reorder failed: unknown error");
|
|
710
710
|
} finally {
|
|
711
711
|
t === yt && (await Z(), V.set(vt, !1));
|
|
712
712
|
}
|
|
@@ -742,7 +742,7 @@ function Kt(e, i) {
|
|
|
742
742
|
}
|
|
743
743
|
V.set(K, !0);
|
|
744
744
|
try {
|
|
745
|
-
t.kind === "folder" ? await
|
|
745
|
+
t.kind === "folder" ? await Ke(t.id, { name: n }, f.fetch) : await Ve(t.id, { title: n }, f.fetch), ar(), await Z(), ht();
|
|
746
746
|
} catch (e) {
|
|
747
747
|
console.error("FolderTree: rename failed", e), V.set(G, e instanceof Error ? e.message : me(), !0);
|
|
748
748
|
} finally {
|
|
@@ -770,7 +770,7 @@ function Kt(e, i) {
|
|
|
770
770
|
}
|
|
771
771
|
async function fr() {
|
|
772
772
|
let e = V.get(q);
|
|
773
|
-
e && (e.kind === "folder" ? await
|
|
773
|
+
e && (e.kind === "folder" ? await qe(e.id, f.fetch) : await Ue(e.id, f.fetch), await Z(), ht());
|
|
774
774
|
}
|
|
775
775
|
function pr() {
|
|
776
776
|
V.set(rn, "create"), V.set(J, null), V.set(nn, !0);
|
|
@@ -817,11 +817,11 @@ function Kt(e, i) {
|
|
|
817
817
|
}
|
|
818
818
|
let $ = "__uncategorized__", yr = V.derived(() => V.get(W).filter((e) => e.id !== $ && e.category !== null)), br = V.derived(() => V.get(W).find((e) => e.id === $) ?? null), xr = V.derived(() => {
|
|
819
819
|
let e = /* @__PURE__ */ new Map();
|
|
820
|
-
for (let t of V.get(
|
|
820
|
+
for (let t of V.get(b)) e.set(t.id, []);
|
|
821
821
|
let t = [];
|
|
822
|
-
for (let n of V.get(
|
|
822
|
+
for (let n of V.get(y)) n.categoryId && e.has(n.categoryId) ? e.get(n.categoryId)?.push(n) : t.push(n);
|
|
823
823
|
let n = [];
|
|
824
|
-
for (let t of V.get(
|
|
824
|
+
for (let t of V.get(b)) n.push({
|
|
825
825
|
id: t.id,
|
|
826
826
|
category: t,
|
|
827
827
|
folders: e.get(t.id) ?? []
|
|
@@ -838,34 +838,34 @@ function Kt(e, i) {
|
|
|
838
838
|
s(V.child(Or), { class: "size-3.5" }), V.reset(Or), V.reset(Tr);
|
|
839
839
|
var kr = V.sibling(Tr, 2), Ar = (e) => {
|
|
840
840
|
var t = It(), n = V.child(t, !0);
|
|
841
|
-
V.reset(t), V.template_effect(() => V.set_text(n, V.get(
|
|
841
|
+
V.reset(t), V.template_effect(() => V.set_text(n, V.get(O))), V.append(e, t);
|
|
842
842
|
};
|
|
843
843
|
V.if(kr, (e) => {
|
|
844
|
-
V.get(
|
|
844
|
+
V.get(O) && e(Ar);
|
|
845
845
|
});
|
|
846
846
|
var jr = V.sibling(kr, 2), Mr = (e) => {
|
|
847
847
|
var t = It(), n = V.child(t, !0);
|
|
848
|
-
V.reset(t), V.template_effect(() => V.set_text(n, V.get(
|
|
848
|
+
V.reset(t), V.template_effect(() => V.set_text(n, V.get(k))), V.append(e, t);
|
|
849
849
|
};
|
|
850
850
|
V.if(jr, (e) => {
|
|
851
|
-
V.get(
|
|
851
|
+
V.get(k) && e(Mr);
|
|
852
852
|
});
|
|
853
853
|
var Nr = V.sibling(jr, 2);
|
|
854
854
|
V.each(Nr, 29, () => V.get(yr), (e) => `${e.id}:${e.isDndShadowItem ? "shadow" : "item"}`, (e, t) => {
|
|
855
|
-
let i = V.derived(() => V.get(
|
|
855
|
+
let i = V.derived(() => V.get(T).has(V.get(t).id));
|
|
856
856
|
var o = Vt(), s = V.child(o), l = V.child(s), f = V.child(l), p = (e) => {
|
|
857
857
|
n(e, { class: "size-3.5 shrink-0" });
|
|
858
|
-
},
|
|
858
|
+
}, ne = (e) => {
|
|
859
859
|
r(e, { class: "size-3.5 shrink-0" });
|
|
860
860
|
};
|
|
861
861
|
V.if(f, (e) => {
|
|
862
|
-
V.get(i) ? e(p) : e(
|
|
862
|
+
V.get(i) ? e(p) : e(ne, -1);
|
|
863
863
|
});
|
|
864
|
-
var
|
|
865
|
-
V.reset(
|
|
864
|
+
var _ = V.sibling(f, 2), v = V.child(_, !0);
|
|
865
|
+
V.reset(_), V.reset(l), m(V.sibling(l, 2), {
|
|
866
866
|
children: (e, n) => {
|
|
867
867
|
var r = Nt(), i = V.first_child(r);
|
|
868
|
-
|
|
868
|
+
te(i, {
|
|
869
869
|
child: (e, t) => {
|
|
870
870
|
let n = () => (t?.()).props;
|
|
871
871
|
var r = jt();
|
|
@@ -875,34 +875,34 @@ function Kt(e, i) {
|
|
|
875
875
|
class: "inline-flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-accent-foreground group-hover/bucket:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
876
876
|
"aria-label": e,
|
|
877
877
|
title: t
|
|
878
|
-
}), [() =>
|
|
878
|
+
}), [() => C(), () => C()]), ee(V.child(r), { class: "size-3.5" }), V.reset(r), V.append(e, r);
|
|
879
879
|
},
|
|
880
880
|
$$slots: { child: !0 }
|
|
881
881
|
}), h(V.sibling(i, 2), {
|
|
882
882
|
align: "end",
|
|
883
883
|
children: (e, n) => {
|
|
884
884
|
var r = Lt(), i = V.first_child(r);
|
|
885
|
-
|
|
885
|
+
g(i, {
|
|
886
886
|
onSelect: () => Te(d, `/?category=${V.get(t).category.id}`),
|
|
887
887
|
children: (e, t) => {
|
|
888
888
|
V.next();
|
|
889
889
|
var n = V.text();
|
|
890
|
-
V.template_effect((e) => V.set_text(n, e), [() =>
|
|
890
|
+
V.template_effect((e) => V.set_text(n, e), [() => se()]), V.append(e, n);
|
|
891
891
|
},
|
|
892
892
|
$$slots: { default: !0 }
|
|
893
893
|
});
|
|
894
894
|
var a = V.sibling(i, 2);
|
|
895
|
-
|
|
895
|
+
g(a, {
|
|
896
896
|
onSelect: () => Te(d, `/docs/new?category=${V.get(t).category.id}`),
|
|
897
897
|
children: (e, t) => {
|
|
898
898
|
V.next();
|
|
899
899
|
var n = V.text();
|
|
900
|
-
V.template_effect((e) => V.set_text(n, e), [() =>
|
|
900
|
+
V.template_effect((e) => V.set_text(n, e), [() => ie()]), V.append(e, n);
|
|
901
901
|
},
|
|
902
902
|
$$slots: { default: !0 }
|
|
903
903
|
});
|
|
904
904
|
var o = V.sibling(a, 2);
|
|
905
|
-
|
|
905
|
+
g(o, {
|
|
906
906
|
onSelect: () => Nn(V.get(t).category.id),
|
|
907
907
|
children: (e, t) => {
|
|
908
908
|
V.next();
|
|
@@ -912,17 +912,17 @@ function Kt(e, i) {
|
|
|
912
912
|
$$slots: { default: !0 }
|
|
913
913
|
});
|
|
914
914
|
var s = V.sibling(o, 2);
|
|
915
|
-
|
|
915
|
+
g(s, {
|
|
916
916
|
onSelect: () => ur(V.get(t).category.id, V.get(t).category.name),
|
|
917
917
|
children: (e, t) => {
|
|
918
918
|
V.next();
|
|
919
919
|
var n = V.text();
|
|
920
|
-
V.template_effect((e) => V.set_text(n, e), [() =>
|
|
920
|
+
V.template_effect((e) => V.set_text(n, e), [() => ae()]), V.append(e, n);
|
|
921
921
|
},
|
|
922
922
|
$$slots: { default: !0 }
|
|
923
923
|
});
|
|
924
924
|
var c = V.sibling(s, 2);
|
|
925
|
-
|
|
925
|
+
g(c, {
|
|
926
926
|
onSelect: () => mr(V.get(t).category),
|
|
927
927
|
children: (e, t) => {
|
|
928
928
|
V.next();
|
|
@@ -930,13 +930,13 @@ function Kt(e, i) {
|
|
|
930
930
|
V.template_effect((e) => V.set_text(n, e), [() => ve()]), V.append(e, n);
|
|
931
931
|
},
|
|
932
932
|
$$slots: { default: !0 }
|
|
933
|
-
}),
|
|
933
|
+
}), g(V.sibling(c, 2), {
|
|
934
934
|
class: "text-destructive focus:text-destructive",
|
|
935
935
|
onSelect: () => hr(V.get(t).category),
|
|
936
936
|
children: (e, t) => {
|
|
937
937
|
V.next();
|
|
938
938
|
var n = V.text();
|
|
939
|
-
V.template_effect((e) => V.set_text(n, e), [() =>
|
|
939
|
+
V.template_effect((e) => V.set_text(n, e), [() => N()]), V.append(e, n);
|
|
940
940
|
},
|
|
941
941
|
$$slots: { default: !0 }
|
|
942
942
|
}), V.append(e, r);
|
|
@@ -946,13 +946,13 @@ function Kt(e, i) {
|
|
|
946
946
|
},
|
|
947
947
|
$$slots: { default: !0 }
|
|
948
948
|
}), V.reset(s);
|
|
949
|
-
var
|
|
949
|
+
var y = V.sibling(s, 2), b = (e) => {
|
|
950
950
|
let n = V.derived(() => V.get(U)[V.get(t).id] ?? []), r = V.derived(() => V.get(Et)[V.get(t).id] ?? []);
|
|
951
951
|
var i = Bt(), o = V.child(i), s = V.derived(() => Wn(V.get(t).id)), l = V.derived(() => Gn(V.get(t).id));
|
|
952
952
|
V.each(o, 29, () => V.get(n), (e) => e.id, (e, t) => {
|
|
953
953
|
var n = Rt();
|
|
954
954
|
u(V.child(n), () => V.get(t)), V.reset(n), V.animation(n, () => Tt, () => ({ duration: 200 })), V.append(e, n);
|
|
955
|
-
}), V.reset(o), V.action(o, (e, t) =>
|
|
955
|
+
}), V.reset(o), V.action(o, (e, t) => Be?.(e, t), () => ({
|
|
956
956
|
items: V.get(n),
|
|
957
957
|
flipDurationMs: 200,
|
|
958
958
|
type: "folder",
|
|
@@ -971,7 +971,7 @@ function Kt(e, i) {
|
|
|
971
971
|
At(r, () => V.get(t));
|
|
972
972
|
var i = V.sibling(r, 2);
|
|
973
973
|
c(i, () => V.get(t)), a(V.sibling(i, 2), () => V.get(t)), V.reset(n), V.animation(n, () => Tt, () => ({ duration: 80 })), V.append(e, n);
|
|
974
|
-
}), V.reset(d), V.action(d, (e, t) =>
|
|
974
|
+
}), V.reset(d), V.action(d, (e, t) => Be?.(e, t), () => ({
|
|
975
975
|
items: V.get(r),
|
|
976
976
|
flipDurationMs: 80,
|
|
977
977
|
type: "doc",
|
|
@@ -981,7 +981,7 @@ function Kt(e, i) {
|
|
|
981
981
|
centreDraggedOnCursor: !0
|
|
982
982
|
})), V.reset(i), V.template_effect((e, t) => {
|
|
983
983
|
V.set_class(o, 1, e), V.set_class(d, 1, t);
|
|
984
|
-
}, [() => V.clsx(F("min-h-[8px] space-y-0.5 transition-all duration-150", V.get(
|
|
984
|
+
}, [() => V.clsx(F("min-h-[8px] space-y-0.5 transition-all duration-150", V.get(L) && V.get(n).length === 0 && "min-h-[36px] bg-accent/20 rounded border border-dashed border-muted-foreground/20")), () => V.clsx(F("min-h-[8px] space-y-0.5 transition-all duration-150", V.get(it) && V.get(r).length === 0 && "min-h-[36px] bg-accent/20 rounded border border-dashed border-muted-foreground/20"))]), V.event("consider", o, function(...e) {
|
|
985
985
|
V.get(s)?.apply(this, e);
|
|
986
986
|
}), V.event("finalize", o, function(...e) {
|
|
987
987
|
V.get(l)?.apply(this, e);
|
|
@@ -991,16 +991,16 @@ function Kt(e, i) {
|
|
|
991
991
|
V.get(p)?.apply(this, e);
|
|
992
992
|
}), V.append(e, i);
|
|
993
993
|
};
|
|
994
|
-
V.if(
|
|
995
|
-
V.get(i) && e(
|
|
994
|
+
V.if(y, (e) => {
|
|
995
|
+
V.get(i) && e(b);
|
|
996
996
|
}), V.reset(o), V.template_effect((e) => {
|
|
997
|
-
V.set_attribute(o, "data-is-dnd-shadow-item-hint", V.get(t)[
|
|
997
|
+
V.set_attribute(o, "data-is-dnd-shadow-item-hint", V.get(t)[ze]), V.set_attribute(l, "aria-expanded", V.get(i)), V.set_class(l, 1, e), V.set_text(v, V.get(t).category.name);
|
|
998
998
|
}, [() => V.clsx(F("flex min-w-0 flex-1 items-center gap-1.5 rounded-md px-2 py-1.5 text-xs font-medium uppercase tracking-wider text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground", V.get(R) && "hover:bg-accent/40 border border-dashed border-primary/30"))]), V.delegated("click", l, () => An(V.get(t).id)), V.event("mouseenter", l, () => {
|
|
999
999
|
V.get(I) && !V.get(i) && hn(V.get(t).id);
|
|
1000
1000
|
}), V.event("mouseleave", l, () => {
|
|
1001
1001
|
V.get(I) && mn();
|
|
1002
1002
|
}), V.event("dragover", l, Bn), V.event("drop", l, (e) => Vn(e, V.get(t).id)), V.animation(o, () => Tt, () => ({ duration: 200 })), V.append(e, o);
|
|
1003
|
-
}), V.reset(Nr), V.action(Nr, (e, t) =>
|
|
1003
|
+
}), V.reset(Nr), V.action(Nr, (e, t) => Be?.(e, t), () => ({
|
|
1004
1004
|
items: V.get(yr),
|
|
1005
1005
|
flipDurationMs: 200,
|
|
1006
1006
|
type: "category",
|
|
@@ -1014,7 +1014,7 @@ function Kt(e, i) {
|
|
|
1014
1014
|
r(e, { class: "size-3.5 shrink-0" });
|
|
1015
1015
|
};
|
|
1016
1016
|
V.if(s, (e) => {
|
|
1017
|
-
V.get(
|
|
1017
|
+
V.get(D) ? e(l) : e(d, -1);
|
|
1018
1018
|
});
|
|
1019
1019
|
var f = V.sibling(s, 2), p = V.child(f, !0);
|
|
1020
1020
|
V.reset(f), V.reset(o), V.reset(i);
|
|
@@ -1024,7 +1024,7 @@ function Kt(e, i) {
|
|
|
1024
1024
|
V.each(r, 29, () => V.get(t), (e) => e.id, (e, t) => {
|
|
1025
1025
|
var n = Rt();
|
|
1026
1026
|
u(V.child(n), () => V.get(t)), V.reset(n), V.animation(n, () => Tt, () => ({ duration: 200 })), V.append(e, n);
|
|
1027
|
-
}), V.reset(r), V.action(r, (e, t) =>
|
|
1027
|
+
}), V.reset(r), V.action(r, (e, t) => Be?.(e, t), () => ({
|
|
1028
1028
|
items: V.get(t),
|
|
1029
1029
|
flipDurationMs: 200,
|
|
1030
1030
|
type: "folder",
|
|
@@ -1037,7 +1037,7 @@ function Kt(e, i) {
|
|
|
1037
1037
|
At(r, () => V.get(t));
|
|
1038
1038
|
var i = V.sibling(r, 2);
|
|
1039
1039
|
c(i, () => V.get(t)), a(V.sibling(i, 2), () => V.get(t)), V.reset(n), V.animation(n, () => Tt, () => ({ duration: 80 })), V.append(e, n);
|
|
1040
|
-
}), V.reset(s), V.action(s, (e, t) =>
|
|
1040
|
+
}), V.reset(s), V.action(s, (e, t) => Be?.(e, t), () => ({
|
|
1041
1041
|
items: V.get(xt),
|
|
1042
1042
|
flipDurationMs: 80,
|
|
1043
1043
|
type: "doc",
|
|
@@ -1047,7 +1047,7 @@ function Kt(e, i) {
|
|
|
1047
1047
|
centreDraggedOnCursor: !0
|
|
1048
1048
|
})), V.reset(n), V.template_effect((e, t) => {
|
|
1049
1049
|
V.set_class(r, 1, e), V.set_class(s, 1, t);
|
|
1050
|
-
}, [() => V.clsx(F("min-h-[8px] space-y-0.5 transition-all duration-150", V.get(
|
|
1050
|
+
}, [() => V.clsx(F("min-h-[8px] space-y-0.5 transition-all duration-150", V.get(L) && V.get(t).length === 0 && "min-h-[36px] bg-accent/20 rounded border border-dashed border-muted-foreground/20")), () => V.clsx(F("min-h-[8px] space-y-0.5 transition-all duration-150", V.get(it) && V.get(xt).length === 0 && "min-h-[36px] bg-accent/20 rounded border border-dashed border-muted-foreground/20"))]), V.event("consider", r, function(...e) {
|
|
1051
1051
|
V.get(i)?.apply(this, e);
|
|
1052
1052
|
}), V.event("finalize", r, function(...e) {
|
|
1053
1053
|
V.get(o)?.apply(this, e);
|
|
@@ -1058,11 +1058,11 @@ function Kt(e, i) {
|
|
|
1058
1058
|
}), V.append(e, n);
|
|
1059
1059
|
};
|
|
1060
1060
|
V.if(m, (e) => {
|
|
1061
|
-
V.get(
|
|
1061
|
+
V.get(D) && e(h);
|
|
1062
1062
|
}), V.reset(t), V.template_effect((e, t) => {
|
|
1063
|
-
V.set_attribute(o, "aria-expanded", V.get(
|
|
1063
|
+
V.set_attribute(o, "aria-expanded", V.get(D)), V.set_class(o, 1, e), V.set_text(p, t);
|
|
1064
1064
|
}, [() => V.clsx(F("flex min-w-0 flex-1 items-center gap-1.5 rounded-md px-2 py-1.5 text-xs font-medium uppercase tracking-wider text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground", V.get(R) && "hover:bg-accent/40 border border-dashed border-primary/30")), () => he()]), V.delegated("click", o, jn), V.event("mouseenter", o, () => {
|
|
1065
|
-
V.get(I) && !V.get(
|
|
1065
|
+
V.get(I) && !V.get(D) && hn($);
|
|
1066
1066
|
}), V.event("mouseleave", o, () => {
|
|
1067
1067
|
V.get(I) && mn();
|
|
1068
1068
|
}), V.event("dragover", o, Bn), V.event("drop", o, (e) => Vn(e, $)), V.append(e, t);
|
|
@@ -1106,14 +1106,14 @@ function Kt(e, i) {
|
|
|
1106
1106
|
children: (e, t) => {
|
|
1107
1107
|
V.next();
|
|
1108
1108
|
var n = V.text();
|
|
1109
|
-
V.template_effect((e) => V.set_text(n, e), [() =>
|
|
1109
|
+
V.template_effect((e) => V.set_text(n, e), [() => le()]), V.append(e, n);
|
|
1110
1110
|
},
|
|
1111
1111
|
$$slots: { default: !0 }
|
|
1112
1112
|
}), Oe(V.sibling(r, 2), {
|
|
1113
1113
|
children: (e, t) => {
|
|
1114
1114
|
V.next();
|
|
1115
1115
|
var n = V.text();
|
|
1116
|
-
V.template_effect((e) => V.set_text(n, e), [() => V.get(Kt)?.kind === "folder" ?
|
|
1116
|
+
V.template_effect((e) => V.set_text(n, e), [() => V.get(Kt)?.kind === "folder" ? pe() : de()]), V.append(e, n);
|
|
1117
1117
|
},
|
|
1118
1118
|
$$slots: { default: !0 }
|
|
1119
1119
|
}), V.append(e, n);
|
|
@@ -1126,7 +1126,7 @@ function Kt(e, i) {
|
|
|
1126
1126
|
children: (e, t) => {
|
|
1127
1127
|
V.next();
|
|
1128
1128
|
var n = V.text();
|
|
1129
|
-
V.template_effect((e) => V.set_text(n, e), [() => V.get(Kt)?.kind === "folder" ?
|
|
1129
|
+
V.template_effect((e) => V.set_text(n, e), [() => V.get(Kt)?.kind === "folder" ? pe() : de()]), V.append(e, n);
|
|
1130
1130
|
},
|
|
1131
1131
|
$$slots: { default: !0 }
|
|
1132
1132
|
});
|
|
@@ -1192,7 +1192,7 @@ function Kt(e, i) {
|
|
|
1192
1192
|
children: (e, t) => {
|
|
1193
1193
|
V.next();
|
|
1194
1194
|
var n = V.text();
|
|
1195
|
-
V.template_effect((e) => V.set_text(n, e), [() => V.get(K) ?
|
|
1195
|
+
V.template_effect((e) => V.set_text(n, e), [() => V.get(K) ? A() : ue()]), V.append(e, n);
|
|
1196
1196
|
},
|
|
1197
1197
|
$$slots: { default: !0 }
|
|
1198
1198
|
});
|
|
@@ -1206,8 +1206,8 @@ function Kt(e, i) {
|
|
|
1206
1206
|
});
|
|
1207
1207
|
var Hr = V.sibling(Vr, 2);
|
|
1208
1208
|
{
|
|
1209
|
-
let e = V.derived(() => V.get(q)?.name ?? ""), t = V.derived(() => V.get(q)?.kind === "folder" ? ge() : Se()), n = V.derived(() => V.get(q)?.kind === "folder" ? "Its documents will be moved to the root and will not be deleted." :
|
|
1210
|
-
|
|
1209
|
+
let e = V.derived(() => V.get(q)?.name ?? ""), t = V.derived(() => V.get(q)?.kind === "folder" ? ge() : Se()), n = V.derived(() => V.get(q)?.kind === "folder" ? "Its documents will be moved to the root and will not be deleted." : fe()), r = V.derived(() => V.get(q)?.kind === "folder" ? ce() : E()), i = V.derived(() => V.get(q)?.kind === "folder" ? ye() : v()), a = V.derived(() => N()), o = V.derived(() => _e());
|
|
1210
|
+
Xe(Hr, {
|
|
1211
1211
|
get targetName() {
|
|
1212
1212
|
return V.get(e);
|
|
1213
1213
|
},
|
|
@@ -1242,7 +1242,7 @@ function Kt(e, i) {
|
|
|
1242
1242
|
var Ur = V.sibling(Hr, 2);
|
|
1243
1243
|
{
|
|
1244
1244
|
let e = V.derived(() => V.get(J) ?? void 0);
|
|
1245
|
-
|
|
1245
|
+
$e(Ur, {
|
|
1246
1246
|
get mode() {
|
|
1247
1247
|
return V.get(rn);
|
|
1248
1248
|
},
|
|
@@ -1260,7 +1260,7 @@ function Kt(e, i) {
|
|
|
1260
1260
|
}
|
|
1261
1261
|
});
|
|
1262
1262
|
}
|
|
1263
|
-
return
|
|
1263
|
+
return Qe(V.sibling(Ur, 2), {
|
|
1264
1264
|
get documentId() {
|
|
1265
1265
|
return V.get(Xt);
|
|
1266
1266
|
},
|
|
@@ -1289,8 +1289,8 @@ function Kt(e, i) {
|
|
|
1289
1289
|
V.set_attribute(Er, "href", e), V.set_attribute(Er, "title", t), V.set_text(Dr, n), V.set_attribute(Or, "aria-label", r), V.set_attribute(Or, "title", i), V.set_text(zr, a);
|
|
1290
1290
|
}, [
|
|
1291
1291
|
() => we(d, "/"),
|
|
1292
|
-
() =>
|
|
1293
|
-
() =>
|
|
1292
|
+
() => S(),
|
|
1293
|
+
() => oe(),
|
|
1294
1294
|
() => xe(),
|
|
1295
1295
|
() => xe(),
|
|
1296
1296
|
() => be()
|
|
@@ -1302,10 +1302,10 @@ V.delegate(["click"]);
|
|
|
1302
1302
|
var qt = V.from_html("<p class=\"px-2 text-xs text-destructive\"> </p>"), G = V.from_html("<button><!></button>"), K = V.from_html("<!> <!>", 1), Jt = V.from_html("<div class=\"group/doc flex min-w-0 items-center gap-1\"><a><!> <div class=\"min-w-0 flex-1\"><p class=\"truncate min-w-0\"> </p> <p class=\"text-xs text-muted-foreground\"> </p></div></a> <button type=\"button\"><!></button> <!></div>"), q = V.from_html("<p id=\"recent-rename-input-error\" class=\"text-xs text-destructive\" role=\"alert\"> </p>"), Yt = V.from_html("<!> <form class=\"space-y-4\"><div class=\"space-y-2\"><!> <!> <!></div></form> <!>", 1), Xt = V.from_html("<div class=\"space-y-1\"><h3 class=\"mb-2 px-2 text-xs font-medium uppercase tracking-wider text-muted-foreground\"> </h3> <!> <!></div> <!> <!>", 1);
|
|
1303
1303
|
function Zt(e, n) {
|
|
1304
1304
|
V.push(n, !0);
|
|
1305
|
-
let r = Ce(), i = V.state(V.proxy([])), a = V.state(null), s = V.state(null), l = V.state(null), u = V.state(null), d = null, f = V.state(!1), p = V.state(null),
|
|
1306
|
-
async function
|
|
1305
|
+
let r = Ce(), i = V.state(V.proxy([])), a = V.state(null), s = V.state(null), l = V.state(null), u = V.state(null), d = null, f = V.state(!1), p = V.state(null), _ = V.state(""), v = V.state(null), y = V.state(!1), b = V.state(!1), S = V.state(null), w = V.state(!1);
|
|
1306
|
+
async function T() {
|
|
1307
1307
|
try {
|
|
1308
|
-
let e = z(), t = await
|
|
1308
|
+
let e = z(), t = await We({
|
|
1309
1309
|
limit: 6,
|
|
1310
1310
|
...e ? { tag: e } : {}
|
|
1311
1311
|
}, r.fetch);
|
|
@@ -1315,87 +1315,87 @@ function Zt(e, n) {
|
|
|
1315
1315
|
}
|
|
1316
1316
|
}
|
|
1317
1317
|
Ct(() => {
|
|
1318
|
-
|
|
1318
|
+
T();
|
|
1319
1319
|
}), V.user_effect(() => {
|
|
1320
|
-
_t() !== 0 &&
|
|
1320
|
+
_t() !== 0 && T();
|
|
1321
1321
|
});
|
|
1322
|
-
let
|
|
1322
|
+
let E = !0;
|
|
1323
1323
|
V.user_effect(() => {
|
|
1324
|
-
if (z(),
|
|
1325
|
-
|
|
1324
|
+
if (z(), E) {
|
|
1325
|
+
E = !1;
|
|
1326
1326
|
return;
|
|
1327
1327
|
}
|
|
1328
|
-
|
|
1328
|
+
T();
|
|
1329
1329
|
});
|
|
1330
|
-
async function
|
|
1331
|
-
await
|
|
1330
|
+
async function ie() {
|
|
1331
|
+
await T();
|
|
1332
1332
|
}
|
|
1333
1333
|
St(() => {
|
|
1334
1334
|
d &&= (clearTimeout(d), null);
|
|
1335
1335
|
});
|
|
1336
|
-
async function
|
|
1336
|
+
async function D(e, t) {
|
|
1337
1337
|
if (e.preventDefault(), e.stopPropagation(), typeof window > "u") return;
|
|
1338
1338
|
let n = V.get(i).find((e) => e.id === t), a = "";
|
|
1339
1339
|
V.set(u, t, !0);
|
|
1340
1340
|
try {
|
|
1341
|
-
a = (await
|
|
1341
|
+
a = (await He(t, r.fetch)).content ?? "";
|
|
1342
1342
|
} catch (e) {
|
|
1343
1343
|
console.error("RecentDocs: failed to fetch full document for copy", e), a = n?.excerpt ?? n?.content ?? "";
|
|
1344
1344
|
} finally {
|
|
1345
1345
|
V.set(u, null);
|
|
1346
1346
|
}
|
|
1347
|
-
a && await
|
|
1347
|
+
a && await Ze(a) && (V.set(l, t, !0), d && clearTimeout(d), d = setTimeout(() => {
|
|
1348
1348
|
V.set(l, null), d = null;
|
|
1349
1349
|
}, 2e3));
|
|
1350
1350
|
}
|
|
1351
|
-
function
|
|
1351
|
+
function ae(e, t) {
|
|
1352
1352
|
V.set(p, {
|
|
1353
1353
|
id: e,
|
|
1354
1354
|
title: t
|
|
1355
|
-
}, !0), V.set(
|
|
1355
|
+
}, !0), V.set(_, t, !0), V.set(v, null), V.set(f, !0);
|
|
1356
1356
|
}
|
|
1357
|
-
function
|
|
1358
|
-
V.set(f, !1), V.set(p, null), V.set(
|
|
1357
|
+
function O() {
|
|
1358
|
+
V.set(f, !1), V.set(p, null), V.set(_, ""), V.set(v, null), V.set(y, !1);
|
|
1359
1359
|
}
|
|
1360
|
-
async function
|
|
1360
|
+
async function oe(e) {
|
|
1361
1361
|
e?.preventDefault();
|
|
1362
1362
|
let t = V.get(p);
|
|
1363
1363
|
if (!t) return;
|
|
1364
|
-
let n = V.get(
|
|
1364
|
+
let n = V.get(_).trim();
|
|
1365
1365
|
if (n.length === 0) {
|
|
1366
|
-
V.set(
|
|
1366
|
+
V.set(v, "Name is required");
|
|
1367
1367
|
return;
|
|
1368
1368
|
}
|
|
1369
|
-
V.set(
|
|
1369
|
+
V.set(y, !0);
|
|
1370
1370
|
try {
|
|
1371
|
-
await
|
|
1371
|
+
await Ve(t.id, { title: n }, r.fetch), O(), await T(), ht();
|
|
1372
1372
|
} catch (e) {
|
|
1373
|
-
console.error("RecentDocs: rename failed", e), V.set(
|
|
1373
|
+
console.error("RecentDocs: rename failed", e), V.set(v, e instanceof Error ? e.message : me(), !0);
|
|
1374
1374
|
} finally {
|
|
1375
|
-
V.set(
|
|
1375
|
+
V.set(y, !1);
|
|
1376
1376
|
}
|
|
1377
1377
|
}
|
|
1378
|
-
function
|
|
1379
|
-
V.set(
|
|
1378
|
+
function se(e, t) {
|
|
1379
|
+
V.set(S, {
|
|
1380
1380
|
id: e,
|
|
1381
1381
|
title: t
|
|
1382
|
-
}, !0), V.set(
|
|
1382
|
+
}, !0), V.set(b, !0);
|
|
1383
1383
|
}
|
|
1384
|
-
function
|
|
1385
|
-
V.set(
|
|
1384
|
+
function k() {
|
|
1385
|
+
V.set(b, !1), V.set(S, null), V.set(w, !1);
|
|
1386
1386
|
}
|
|
1387
|
-
async function
|
|
1388
|
-
let e = V.get(
|
|
1389
|
-
if (!(!e || V.get(
|
|
1390
|
-
V.set(
|
|
1387
|
+
async function j() {
|
|
1388
|
+
let e = V.get(S);
|
|
1389
|
+
if (!(!e || V.get(w))) {
|
|
1390
|
+
V.set(w, !0);
|
|
1391
1391
|
try {
|
|
1392
|
-
await
|
|
1392
|
+
await Ue(e.id, r.fetch), k(), await T(), ht();
|
|
1393
1393
|
} catch (e) {
|
|
1394
|
-
console.error("RecentDocs: delete failed", e), V.set(s, e instanceof Error ? e.message : me(), !0), V.set(
|
|
1394
|
+
console.error("RecentDocs: delete failed", e), V.set(s, e instanceof Error ? e.message : me(), !0), V.set(w, !1);
|
|
1395
1395
|
}
|
|
1396
1396
|
}
|
|
1397
1397
|
}
|
|
1398
|
-
var
|
|
1398
|
+
var ce = { refreshRecentDocs: ie }, M = Xt(), pe = V.first_child(M), he = V.child(pe), ge = V.child(he, !0);
|
|
1399
1399
|
V.reset(he);
|
|
1400
1400
|
var P = V.sibling(he, 2), ve = (e) => {
|
|
1401
1401
|
var t = qt(), n = V.child(t, !0);
|
|
@@ -1410,21 +1410,21 @@ function Zt(e, n) {
|
|
|
1410
1410
|
c(s, { class: "size-4 shrink-0 text-muted-foreground" });
|
|
1411
1411
|
var d = V.sibling(s, 2), f = V.child(d), p = V.child(f, !0);
|
|
1412
1412
|
V.reset(f);
|
|
1413
|
-
var
|
|
1414
|
-
V.reset(
|
|
1415
|
-
var
|
|
1416
|
-
|
|
1417
|
-
},
|
|
1413
|
+
var _ = V.sibling(f, 2), v = V.child(_, !0);
|
|
1414
|
+
V.reset(_), V.reset(d), V.reset(i);
|
|
1415
|
+
var y = V.sibling(i, 2), b = V.child(y), x = (e) => {
|
|
1416
|
+
ne(e, { class: "size-3.5 animate-spin" });
|
|
1417
|
+
}, S = (e) => {
|
|
1418
1418
|
t(e, { class: "size-3.5" });
|
|
1419
|
-
},
|
|
1419
|
+
}, w = (e) => {
|
|
1420
1420
|
o(e, { class: "size-3.5" });
|
|
1421
1421
|
};
|
|
1422
|
-
V.if(
|
|
1423
|
-
V.get(u) === V.get(n).id ? e(
|
|
1424
|
-
}), V.reset(
|
|
1422
|
+
V.if(b, (e) => {
|
|
1423
|
+
V.get(u) === V.get(n).id ? e(x) : V.get(l) === V.get(n).id ? e(S, 1) : e(w, -1);
|
|
1424
|
+
}), V.reset(y), m(V.sibling(y, 2), {
|
|
1425
1425
|
children: (e, t) => {
|
|
1426
1426
|
var r = K(), i = V.first_child(r);
|
|
1427
|
-
|
|
1427
|
+
te(i, {
|
|
1428
1428
|
child: (e, t) => {
|
|
1429
1429
|
let n = () => (t?.()).props;
|
|
1430
1430
|
var r = G(), i = (e) => {
|
|
@@ -1437,28 +1437,28 @@ function Zt(e, n) {
|
|
|
1437
1437
|
"aria-label": e,
|
|
1438
1438
|
title: t,
|
|
1439
1439
|
onclick: i
|
|
1440
|
-
}), [() =>
|
|
1440
|
+
}), [() => C(), () => C()]), ee(V.child(r), { class: "size-3.5" }), V.reset(r), V.append(e, r);
|
|
1441
1441
|
},
|
|
1442
1442
|
$$slots: { child: !0 }
|
|
1443
1443
|
}), h(V.sibling(i, 2), {
|
|
1444
1444
|
align: "end",
|
|
1445
1445
|
children: (e, t) => {
|
|
1446
1446
|
var r = K(), i = V.first_child(r);
|
|
1447
|
-
|
|
1448
|
-
onSelect: () =>
|
|
1447
|
+
g(i, {
|
|
1448
|
+
onSelect: () => ae(V.get(n).id, V.get(n).title),
|
|
1449
1449
|
children: (e, t) => {
|
|
1450
1450
|
V.next();
|
|
1451
1451
|
var n = V.text();
|
|
1452
|
-
V.template_effect((e) => V.set_text(n, e), [() =>
|
|
1452
|
+
V.template_effect((e) => V.set_text(n, e), [() => le()]), V.append(e, n);
|
|
1453
1453
|
},
|
|
1454
1454
|
$$slots: { default: !0 }
|
|
1455
|
-
}),
|
|
1455
|
+
}), g(V.sibling(i, 2), {
|
|
1456
1456
|
class: "text-destructive focus:text-destructive",
|
|
1457
|
-
onSelect: () =>
|
|
1457
|
+
onSelect: () => se(V.get(n).id, V.get(n).title),
|
|
1458
1458
|
children: (e, t) => {
|
|
1459
1459
|
V.next();
|
|
1460
1460
|
var n = V.text();
|
|
1461
|
-
V.template_effect((e) => V.set_text(n, e), [() =>
|
|
1461
|
+
V.template_effect((e) => V.set_text(n, e), [() => N()]), V.append(e, n);
|
|
1462
1462
|
},
|
|
1463
1463
|
$$slots: { default: !0 }
|
|
1464
1464
|
}), V.append(e, r);
|
|
@@ -1468,19 +1468,19 @@ function Zt(e, n) {
|
|
|
1468
1468
|
},
|
|
1469
1469
|
$$slots: { default: !0 }
|
|
1470
1470
|
}), V.reset(r), V.template_effect((e, t, r) => {
|
|
1471
|
-
V.set_attribute(i, "href", `/docs/${V.get(n).id}`), V.set_class(i, 1, e), V.set_text(p, V.get(n).title), V.set_text(
|
|
1471
|
+
V.set_attribute(i, "href", `/docs/${V.get(n).id}`), V.set_class(i, 1, e), V.set_text(p, V.get(n).title), V.set_text(v, V.get(n).updatedAt), V.set_class(y, 1, `inline-flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-accent-foreground group-hover/doc:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${V.get(l) === V.get(n).id || V.get(u) === V.get(n).id ? "opacity-100" : ""}`), V.set_attribute(y, "aria-label", t), V.set_attribute(y, "title", r), y.disabled = V.get(u) === V.get(n).id;
|
|
1472
1472
|
}, [
|
|
1473
1473
|
() => V.clsx(F("flex min-w-0 flex-1 items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors hover:bg-accent hover:text-accent-foreground", V.get(a) === V.get(n).id && "bg-accent text-accent-foreground")),
|
|
1474
|
-
() =>
|
|
1475
|
-
() =>
|
|
1474
|
+
() => re(),
|
|
1475
|
+
() => re()
|
|
1476
1476
|
]), V.delegated("click", i, () => {
|
|
1477
1477
|
V.set(a, V.get(n).id, !0);
|
|
1478
|
-
}), V.delegated("click",
|
|
1479
|
-
}), V.reset(
|
|
1480
|
-
var be = V.sibling(
|
|
1478
|
+
}), V.delegated("click", y, (e) => void D(e, V.get(n).id)), V.append(e, r);
|
|
1479
|
+
}), V.reset(pe);
|
|
1480
|
+
var be = V.sibling(pe, 2);
|
|
1481
1481
|
De(be, {
|
|
1482
1482
|
onOpenChange: (e) => {
|
|
1483
|
-
e ||
|
|
1483
|
+
e || O();
|
|
1484
1484
|
},
|
|
1485
1485
|
get open() {
|
|
1486
1486
|
return V.get(f);
|
|
@@ -1497,14 +1497,14 @@ function Zt(e, n) {
|
|
|
1497
1497
|
children: (e, t) => {
|
|
1498
1498
|
V.next();
|
|
1499
1499
|
var n = V.text();
|
|
1500
|
-
V.template_effect((e) => V.set_text(n, e), [() =>
|
|
1500
|
+
V.template_effect((e) => V.set_text(n, e), [() => le()]), V.append(e, n);
|
|
1501
1501
|
},
|
|
1502
1502
|
$$slots: { default: !0 }
|
|
1503
1503
|
}), Oe(V.sibling(r, 2), {
|
|
1504
1504
|
children: (e, t) => {
|
|
1505
1505
|
V.next();
|
|
1506
1506
|
var n = V.text();
|
|
1507
|
-
V.template_effect((e) => V.set_text(n, e), [() =>
|
|
1507
|
+
V.template_effect((e) => V.set_text(n, e), [() => de()]), V.append(e, n);
|
|
1508
1508
|
},
|
|
1509
1509
|
$$slots: { default: !0 }
|
|
1510
1510
|
}), V.append(e, n);
|
|
@@ -1517,13 +1517,13 @@ function Zt(e, n) {
|
|
|
1517
1517
|
children: (e, t) => {
|
|
1518
1518
|
V.next();
|
|
1519
1519
|
var n = V.text();
|
|
1520
|
-
V.template_effect((e) => V.set_text(n, e), [() =>
|
|
1520
|
+
V.template_effect((e) => V.set_text(n, e), [() => de()]), V.append(e, n);
|
|
1521
1521
|
},
|
|
1522
1522
|
$$slots: { default: !0 }
|
|
1523
1523
|
});
|
|
1524
1524
|
var s = V.sibling(o, 2);
|
|
1525
1525
|
{
|
|
1526
|
-
let e = V.derived(() => V.get(
|
|
1526
|
+
let e = V.derived(() => V.get(v) ? "true" : void 0), t = V.derived(() => V.get(v) ? "recent-rename-input-error" : void 0);
|
|
1527
1527
|
Ne(s, {
|
|
1528
1528
|
id: "recent-rename-input",
|
|
1529
1529
|
name: "name",
|
|
@@ -1531,7 +1531,7 @@ function Zt(e, n) {
|
|
|
1531
1531
|
maxlength: 255,
|
|
1532
1532
|
required: !0,
|
|
1533
1533
|
get disabled() {
|
|
1534
|
-
return V.get(
|
|
1534
|
+
return V.get(y);
|
|
1535
1535
|
},
|
|
1536
1536
|
get "aria-invalid"() {
|
|
1537
1537
|
return V.get(e);
|
|
@@ -1541,28 +1541,28 @@ function Zt(e, n) {
|
|
|
1541
1541
|
},
|
|
1542
1542
|
autocomplete: "off",
|
|
1543
1543
|
get value() {
|
|
1544
|
-
return V.get(
|
|
1544
|
+
return V.get(_);
|
|
1545
1545
|
},
|
|
1546
1546
|
set value(e) {
|
|
1547
|
-
V.set(
|
|
1547
|
+
V.set(_, e, !0);
|
|
1548
1548
|
}
|
|
1549
1549
|
});
|
|
1550
1550
|
}
|
|
1551
1551
|
var c = V.sibling(s, 2), l = (e) => {
|
|
1552
1552
|
var t = q(), n = V.child(t, !0);
|
|
1553
|
-
V.reset(t), V.template_effect(() => V.set_text(n, V.get(
|
|
1553
|
+
V.reset(t), V.template_effect(() => V.set_text(n, V.get(v))), V.append(e, t);
|
|
1554
1554
|
};
|
|
1555
1555
|
V.if(c, (e) => {
|
|
1556
|
-
V.get(
|
|
1556
|
+
V.get(v) && e(l);
|
|
1557
1557
|
}), V.reset(a), V.reset(i), je(V.sibling(i, 2), {
|
|
1558
1558
|
children: (e, t) => {
|
|
1559
1559
|
var n = K(), r = V.first_child(n);
|
|
1560
1560
|
Ae(r, {
|
|
1561
1561
|
variant: "outline",
|
|
1562
1562
|
type: "button",
|
|
1563
|
-
onclick:
|
|
1563
|
+
onclick: O,
|
|
1564
1564
|
get disabled() {
|
|
1565
|
-
return V.get(
|
|
1565
|
+
return V.get(y);
|
|
1566
1566
|
},
|
|
1567
1567
|
children: (e, t) => {
|
|
1568
1568
|
V.next();
|
|
@@ -1573,17 +1573,17 @@ function Zt(e, n) {
|
|
|
1573
1573
|
});
|
|
1574
1574
|
var i = V.sibling(r, 2);
|
|
1575
1575
|
{
|
|
1576
|
-
let e = V.derived(() => V.get(
|
|
1576
|
+
let e = V.derived(() => V.get(y) || V.get(_).trim().length === 0);
|
|
1577
1577
|
Ae(i, {
|
|
1578
1578
|
type: "submit",
|
|
1579
|
-
onclick:
|
|
1579
|
+
onclick: oe,
|
|
1580
1580
|
get disabled() {
|
|
1581
1581
|
return V.get(e);
|
|
1582
1582
|
},
|
|
1583
1583
|
children: (e, t) => {
|
|
1584
1584
|
V.next();
|
|
1585
1585
|
var n = V.text();
|
|
1586
|
-
V.template_effect((e) => V.set_text(n, e), [() => V.get(
|
|
1586
|
+
V.template_effect((e) => V.set_text(n, e), [() => V.get(y) ? A() : ue()]), V.append(e, n);
|
|
1587
1587
|
},
|
|
1588
1588
|
$$slots: { default: !0 }
|
|
1589
1589
|
});
|
|
@@ -1591,13 +1591,13 @@ function Zt(e, n) {
|
|
|
1591
1591
|
V.append(e, n);
|
|
1592
1592
|
},
|
|
1593
1593
|
$$slots: { default: !0 }
|
|
1594
|
-
}), V.event("submit", i,
|
|
1594
|
+
}), V.event("submit", i, oe), V.append(e, n);
|
|
1595
1595
|
},
|
|
1596
1596
|
$$slots: { default: !0 }
|
|
1597
1597
|
});
|
|
1598
1598
|
var xe = V.sibling(be, 2);
|
|
1599
1599
|
{
|
|
1600
|
-
let e = V.derived(() => Se()), t = V.derived(() =>
|
|
1600
|
+
let e = V.derived(() => Se()), t = V.derived(() => fe()), n = V.derived(() => N()), r = V.derived(() => _e());
|
|
1601
1601
|
vt(xe, {
|
|
1602
1602
|
get title() {
|
|
1603
1603
|
return V.get(e);
|
|
@@ -1613,19 +1613,19 @@ function Zt(e, n) {
|
|
|
1613
1613
|
},
|
|
1614
1614
|
variant: "destructive",
|
|
1615
1615
|
get busy() {
|
|
1616
|
-
return V.get(
|
|
1616
|
+
return V.get(w);
|
|
1617
1617
|
},
|
|
1618
|
-
onConfirm:
|
|
1619
|
-
onCancel:
|
|
1618
|
+
onConfirm: j,
|
|
1619
|
+
onCancel: k,
|
|
1620
1620
|
get open() {
|
|
1621
|
-
return V.get(
|
|
1621
|
+
return V.get(b);
|
|
1622
1622
|
},
|
|
1623
1623
|
set open(e) {
|
|
1624
|
-
V.set(
|
|
1624
|
+
V.set(b, e, !0);
|
|
1625
1625
|
}
|
|
1626
1626
|
});
|
|
1627
1627
|
}
|
|
1628
|
-
return V.template_effect((e) => V.set_text(ge, e), [() =>
|
|
1628
|
+
return V.template_effect((e) => V.set_text(ge, e), [() => x()]), V.append(e, M), V.pop(ce);
|
|
1629
1629
|
}
|
|
1630
1630
|
V.delegate(["click"]);
|
|
1631
1631
|
//#endregion
|
|
@@ -1638,7 +1638,7 @@ function rn(e, t) {
|
|
|
1638
1638
|
try {
|
|
1639
1639
|
V.set(r, await bt(n.fetch), !0);
|
|
1640
1640
|
} catch (e) {
|
|
1641
|
-
console.error("TagList: failed to load tags", e), V.set(i,
|
|
1641
|
+
console.error("TagList: failed to load tags", e), V.set(i, O(), !0);
|
|
1642
1642
|
}
|
|
1643
1643
|
}
|
|
1644
1644
|
Ct(() => {
|
|
@@ -1652,19 +1652,19 @@ function rn(e, t) {
|
|
|
1652
1652
|
function p(e) {
|
|
1653
1653
|
V.set(r, V.get(r).map((t) => t.id === e.id ? e : t), !0), B();
|
|
1654
1654
|
}
|
|
1655
|
-
function
|
|
1655
|
+
function v(e) {
|
|
1656
1656
|
V.set(o, e, !0), V.set(a, !0);
|
|
1657
1657
|
}
|
|
1658
|
-
function
|
|
1658
|
+
function b() {
|
|
1659
1659
|
V.set(o, null);
|
|
1660
1660
|
}
|
|
1661
|
-
function
|
|
1661
|
+
function x(e) {
|
|
1662
1662
|
V.set(l, e, !0), V.set(c, !0);
|
|
1663
1663
|
}
|
|
1664
|
-
function
|
|
1664
|
+
function re() {
|
|
1665
1665
|
V.set(c, !1), V.set(l, null);
|
|
1666
1666
|
}
|
|
1667
|
-
async function
|
|
1667
|
+
async function S() {
|
|
1668
1668
|
let e = V.get(l);
|
|
1669
1669
|
if (!(!e || V.get(u))) {
|
|
1670
1670
|
V.set(u, !0);
|
|
@@ -1677,22 +1677,22 @@ function rn(e, t) {
|
|
|
1677
1677
|
}
|
|
1678
1678
|
}
|
|
1679
1679
|
}
|
|
1680
|
-
var
|
|
1681
|
-
V.reset(
|
|
1682
|
-
var
|
|
1680
|
+
var w = nn(), T = V.first_child(w), E = V.child(T), ie = V.child(E, !0);
|
|
1681
|
+
V.reset(E);
|
|
1682
|
+
var ae = V.sibling(E, 2), oe = (e) => {
|
|
1683
1683
|
var t = Qt(), n = V.child(t, !0);
|
|
1684
1684
|
V.reset(t), V.template_effect(() => V.set_text(n, V.get(i))), V.append(e, t);
|
|
1685
1685
|
};
|
|
1686
|
-
V.if(
|
|
1687
|
-
V.get(i) && e(
|
|
1686
|
+
V.if(ae, (e) => {
|
|
1687
|
+
V.get(i) && e(oe);
|
|
1688
1688
|
});
|
|
1689
|
-
var
|
|
1690
|
-
V.each(
|
|
1689
|
+
var se = V.sibling(ae, 2), k = V.child(se);
|
|
1690
|
+
V.each(k, 17, () => V.get(r), (e) => e.id, (e, t) => {
|
|
1691
1691
|
var n = tn(), r = V.child(n), i = V.child(r), a = V.sibling(i);
|
|
1692
1692
|
V.reset(r), m(V.sibling(r, 2), {
|
|
1693
1693
|
children: (e, n) => {
|
|
1694
1694
|
var r = en(), i = V.first_child(r);
|
|
1695
|
-
|
|
1695
|
+
te(i, {
|
|
1696
1696
|
child: (e, n) => {
|
|
1697
1697
|
let r = () => (n?.()).props;
|
|
1698
1698
|
var i = $t();
|
|
@@ -1705,13 +1705,13 @@ function rn(e, t) {
|
|
|
1705
1705
|
disabled: V.get(u)
|
|
1706
1706
|
}), [
|
|
1707
1707
|
() => F("hidden size-5 items-center justify-center rounded-full hover:bg-black/10 focus-visible:inline-flex group-hover/tag:inline-flex mr-0.5 data-[state=open]:inline-flex", z() === V.get(t).id && "inline-flex"),
|
|
1708
|
-
() =>
|
|
1709
|
-
() =>
|
|
1708
|
+
() => C(),
|
|
1709
|
+
() => C()
|
|
1710
1710
|
]);
|
|
1711
1711
|
var a = V.child(i), o = (e) => {
|
|
1712
|
-
|
|
1712
|
+
ne(e, { class: "size-3 animate-spin" });
|
|
1713
1713
|
}, s = (e) => {
|
|
1714
|
-
|
|
1714
|
+
ee(e, { class: "size-3" });
|
|
1715
1715
|
};
|
|
1716
1716
|
V.if(a, (e) => {
|
|
1717
1717
|
V.get(u) ? e(o) : e(s, -1);
|
|
@@ -1722,21 +1722,21 @@ function rn(e, t) {
|
|
|
1722
1722
|
align: "start",
|
|
1723
1723
|
children: (e, n) => {
|
|
1724
1724
|
var r = en(), i = V.first_child(r);
|
|
1725
|
-
|
|
1726
|
-
onSelect: () =>
|
|
1725
|
+
g(i, {
|
|
1726
|
+
onSelect: () => v(V.get(t)),
|
|
1727
1727
|
children: (e, t) => {
|
|
1728
1728
|
V.next();
|
|
1729
1729
|
var n = V.text();
|
|
1730
1730
|
V.template_effect((e) => V.set_text(n, e), [() => ve()]), V.append(e, n);
|
|
1731
1731
|
},
|
|
1732
1732
|
$$slots: { default: !0 }
|
|
1733
|
-
}),
|
|
1733
|
+
}), g(V.sibling(i, 2), {
|
|
1734
1734
|
class: "text-destructive focus:text-destructive",
|
|
1735
|
-
onSelect: () =>
|
|
1735
|
+
onSelect: () => x(V.get(t)),
|
|
1736
1736
|
children: (e, t) => {
|
|
1737
1737
|
V.next();
|
|
1738
1738
|
var n = V.text();
|
|
1739
|
-
V.template_effect((e) => V.set_text(n, e), [() =>
|
|
1739
|
+
V.template_effect((e) => V.set_text(n, e), [() => N()]), V.append(e, n);
|
|
1740
1740
|
},
|
|
1741
1741
|
$$slots: { default: !0 }
|
|
1742
1742
|
}), V.append(e, r);
|
|
@@ -1749,14 +1749,14 @@ function rn(e, t) {
|
|
|
1749
1749
|
V.set_class(n, 1, e), V.set_attribute(r, "aria-pressed", o), V.set_style(i, `background-color: ${(V.get(t).color || "#888888") ?? ""}`), V.set_text(a, ` ${V.get(t).name ?? ""}`);
|
|
1750
1750
|
}, [() => V.clsx(F("group/tag relative inline-flex items-center rounded-full transition-colors", z() === V.get(t).id ? "bg-primary text-primary-foreground" : "bg-secondary text-secondary-foreground hover:bg-secondary/80")), () => z() === V.get(t).id]), V.delegated("click", r, () => gt(z() === V.get(t).id ? null : V.get(t).id, V.get(t).name)), V.append(e, n);
|
|
1751
1751
|
});
|
|
1752
|
-
var
|
|
1753
|
-
s(
|
|
1754
|
-
var
|
|
1755
|
-
V.reset(
|
|
1756
|
-
var
|
|
1752
|
+
var A = V.sibling(k, 2), j = V.child(A);
|
|
1753
|
+
s(j, { class: "size-3" });
|
|
1754
|
+
var ce = V.sibling(j);
|
|
1755
|
+
V.reset(A), V.reset(se), V.reset(T);
|
|
1756
|
+
var le = V.sibling(T, 2);
|
|
1757
1757
|
{
|
|
1758
1758
|
let e = V.derived(() => V.get(o) ? "edit" : "create");
|
|
1759
|
-
xt(
|
|
1759
|
+
xt(le, {
|
|
1760
1760
|
get mode() {
|
|
1761
1761
|
return V.get(e);
|
|
1762
1762
|
},
|
|
@@ -1765,7 +1765,7 @@ function rn(e, t) {
|
|
|
1765
1765
|
},
|
|
1766
1766
|
onCreated: f,
|
|
1767
1767
|
onUpdated: p,
|
|
1768
|
-
onClose:
|
|
1768
|
+
onClose: b,
|
|
1769
1769
|
get open() {
|
|
1770
1770
|
return V.get(a);
|
|
1771
1771
|
},
|
|
@@ -1774,10 +1774,10 @@ function rn(e, t) {
|
|
|
1774
1774
|
}
|
|
1775
1775
|
});
|
|
1776
1776
|
}
|
|
1777
|
-
var
|
|
1777
|
+
var ue = V.sibling(le, 2);
|
|
1778
1778
|
{
|
|
1779
|
-
let e = V.derived(() =>
|
|
1780
|
-
vt(
|
|
1779
|
+
let e = V.derived(() => M()), t = V.derived(() => _()), n = V.derived(() => N()), r = V.derived(() => _e());
|
|
1780
|
+
vt(ue, {
|
|
1781
1781
|
get title() {
|
|
1782
1782
|
return V.get(e);
|
|
1783
1783
|
},
|
|
@@ -1794,8 +1794,8 @@ function rn(e, t) {
|
|
|
1794
1794
|
get busy() {
|
|
1795
1795
|
return V.get(u);
|
|
1796
1796
|
},
|
|
1797
|
-
onConfirm:
|
|
1798
|
-
onCancel:
|
|
1797
|
+
onConfirm: S,
|
|
1798
|
+
onCancel: re,
|
|
1799
1799
|
get open() {
|
|
1800
1800
|
return V.get(c);
|
|
1801
1801
|
},
|
|
@@ -1805,25 +1805,25 @@ function rn(e, t) {
|
|
|
1805
1805
|
});
|
|
1806
1806
|
}
|
|
1807
1807
|
V.template_effect((e, t, n) => {
|
|
1808
|
-
V.set_text(
|
|
1808
|
+
V.set_text(ie, e), V.set_attribute(A, "aria-label", t), V.set_text(ce, ` ${n ?? ""}`);
|
|
1809
1809
|
}, [
|
|
1810
|
-
() =>
|
|
1810
|
+
() => y(),
|
|
1811
1811
|
() => P(),
|
|
1812
|
-
() =>
|
|
1813
|
-
]), V.delegated("click",
|
|
1812
|
+
() => D()
|
|
1813
|
+
]), V.delegated("click", A, () => {
|
|
1814
1814
|
V.set(o, null), V.set(a, !0);
|
|
1815
|
-
}), V.append(e,
|
|
1815
|
+
}), V.append(e, w), V.pop();
|
|
1816
1816
|
}
|
|
1817
1817
|
V.delegate(["click"]);
|
|
1818
1818
|
//#endregion
|
|
1819
1819
|
//#region src/lib/components/sidebar/Sidebar.svelte
|
|
1820
|
-
var J = V.from_html("<div role=\"separator\" tabindex=\"-1\"></div>"), an = V.from_html("<button class=\"sidebar-collapse-toggle absolute -right-3 top-4 z-40 flex size-6 items-center justify-center rounded-full border border-border bg-background shadow-sm hover:bg-accent\"><!></button>"), Y = V.from_html("<!> <div class=\"h-px bg-border\"></div>", 1), on = V.from_html("<span class=\"rounded bg-muted px-1.5 py-0.5 text-xs\"> </span>"), X = V.from_html("<a class=\"flex items-center gap-2 rounded-md px-2 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground aria-disabled:pointer-events-none aria-disabled:opacity-50\"><!> <span class=\"min-w-0 flex-1 truncate\"> </span> <!></a>"), sn = V.from_html("<div class=\"h-px bg-border\"></div> <nav class=\"space-y-1\" aria-label=\"Product navigation\"></nav>", 1), cn = V.from_html("<div class=\"flex flex-1 flex-col gap-4 overflow-y-auto p-3\"><!> <!> <!> <!> <!> <!></div>"), ln = V.from_html("<span class=\"text-xs\"> </span>"), un = V.from_html("<a class=\"flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground aria-disabled:pointer-events-none aria-disabled:opacity-50\"><!></a>"), dn = V.from_html("<div class=\"flex flex-1 flex-col items-center gap-1 pt-14\"><!> <button class=\"flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground\"><!></button> <button class=\"flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground\"><!></button> <button class=\"flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground\"><!></button> <button class=\"flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground\"><!></button> <!></div>"), fn = V.from_html("<div class=\"flex flex-col items-center gap-2\"
|
|
1820
|
+
var J = V.from_html("<div role=\"separator\" tabindex=\"-1\"></div>"), an = V.from_html("<button class=\"sidebar-collapse-toggle absolute -right-3 top-4 z-40 flex size-6 items-center justify-center rounded-full border border-border bg-background shadow-sm hover:bg-accent\"><!></button>"), Y = V.from_html("<!> <div class=\"h-px bg-border\"></div>", 1), on = V.from_html("<span class=\"rounded bg-muted px-1.5 py-0.5 text-xs\"> </span>"), X = V.from_html("<a class=\"flex items-center gap-2 rounded-md px-2 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground aria-disabled:pointer-events-none aria-disabled:opacity-50\"><!> <span class=\"min-w-0 flex-1 truncate\"> </span> <!></a>"), sn = V.from_html("<div class=\"h-px bg-border\"></div> <nav class=\"space-y-1\" aria-label=\"Product navigation\"></nav>", 1), cn = V.from_html("<div class=\"flex flex-1 flex-col gap-4 overflow-y-auto p-3\"><!> <!> <!> <!> <!> <!></div>"), ln = V.from_html("<span class=\"text-xs\"> </span>"), un = V.from_html("<a class=\"flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground aria-disabled:pointer-events-none aria-disabled:opacity-50\"><!></a>"), dn = V.from_html("<div class=\"flex flex-1 flex-col items-center gap-1 pt-14\"><!> <button class=\"flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground\"><!></button> <button class=\"flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground\"><!></button> <button class=\"flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground\"><!></button> <button class=\"flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground\"><!></button> <!></div>"), fn = V.from_html("<div class=\"flex flex-col items-center gap-2\"><!> <button type=\"button\" class=\"flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground\"><!></button> <a href=\"https://docsmint.com\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground\"><img src=\"/favicon.ico\" alt=\"DocsMint\" class=\"size-5 object-contain dark:hidden\"/> <img src=\"/favicon_white.ico\" alt=\"\" aria-hidden=\"true\" class=\"hidden size-5 object-contain dark:block\"/></a></div>"), pn = V.from_html("<div class=\"flex items-center justify-between\"><a href=\"https://docsmint.com\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"text-xs text-muted-foreground hover:text-foreground transition-colors\"> </a> <div class=\"flex items-center gap-1\"><!> <button type=\"button\" class=\"flex size-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground\"><!></button></div></div>"), mn = V.from_html("<aside tabindex=\"-1\"><!> <!> <!> <div class=\"border-t border-border p-2\"><!></div></aside> <!>", 1);
|
|
1821
1821
|
function hn(e, t) {
|
|
1822
1822
|
V.push(t, !0);
|
|
1823
|
-
let n = V.prop(t, "mobile", 3, !1), r = V.prop(t, "mobileOpen", 3, !1), o = V.prop(t, "element", 15, null), s = "hiai_sidebar_collapsed", c = Ee(), l = V.state(!1), p = V.state(!1), m = V.state("all"), h = V.derived(() => !n() && V.get(l)),
|
|
1823
|
+
let n = V.prop(t, "mobile", 3, !1), r = V.prop(t, "mobileOpen", 3, !1), o = V.prop(t, "element", 15, null), s = "hiai_sidebar_collapsed", c = Ee(), l = V.state(!1), p = V.state(!1), m = V.state("all"), h = V.derived(() => !n() && V.get(l)), ee = V.state(256), g = V.state(!1), te = I(), ne = V.derived(() => L(te.sidebarTop, { pathname: H.url.pathname })), _ = V.derived(() => L(te.sidebarFooterActions, { pathname: H.url.pathname })), v = V.derived(() => L(te.navigation, { pathname: H.url.pathname }));
|
|
1824
1824
|
Ct(() => {
|
|
1825
1825
|
let e = () => {
|
|
1826
|
-
|
|
1826
|
+
it(), ht();
|
|
1827
1827
|
};
|
|
1828
1828
|
return window.addEventListener("hiai-docs:documents-updated", e), () => window.removeEventListener("hiai-docs:documents-updated", e);
|
|
1829
1829
|
}), V.user_effect(() => {
|
|
@@ -1834,46 +1834,46 @@ function hn(e, t) {
|
|
|
1834
1834
|
let e = localStorage.getItem("hiai_sidebar_width");
|
|
1835
1835
|
if (e) {
|
|
1836
1836
|
let t = parseInt(e, 10);
|
|
1837
|
-
!Number.isNaN(t) && t >= 180 && t <= 500 && V.set(
|
|
1837
|
+
!Number.isNaN(t) && t >= 180 && t <= 500 && V.set(ee, t, !0);
|
|
1838
1838
|
}
|
|
1839
1839
|
}
|
|
1840
1840
|
}), V.user_effect(() => {
|
|
1841
|
-
if (V.get(
|
|
1842
|
-
window.removeEventListener("mousemove",
|
|
1841
|
+
if (V.get(g)) return window.addEventListener("mousemove", S), window.addEventListener("mouseup", C), () => {
|
|
1842
|
+
window.removeEventListener("mousemove", S), window.removeEventListener("mouseup", C);
|
|
1843
1843
|
};
|
|
1844
1844
|
});
|
|
1845
|
-
function
|
|
1846
|
-
e.preventDefault(), V.set(
|
|
1845
|
+
function re(e) {
|
|
1846
|
+
e.preventDefault(), V.set(g, !0);
|
|
1847
1847
|
}
|
|
1848
|
-
function
|
|
1848
|
+
function S(e) {
|
|
1849
1849
|
let t = Math.max(180, Math.min(500, e.clientX));
|
|
1850
|
-
V.set(
|
|
1850
|
+
V.set(ee, t, !0);
|
|
1851
1851
|
}
|
|
1852
|
-
function
|
|
1853
|
-
V.set(
|
|
1852
|
+
function C() {
|
|
1853
|
+
V.set(g, !1), localStorage.setItem("hiai_sidebar_width", V.get(ee).toString());
|
|
1854
1854
|
}
|
|
1855
|
-
function
|
|
1855
|
+
function w() {
|
|
1856
1856
|
return Te(c, "/search");
|
|
1857
1857
|
}
|
|
1858
1858
|
function E(e) {
|
|
1859
|
-
V.set(m, V.get(m) === e ? "all" : e, !0), V.set(l, !1),
|
|
1859
|
+
V.set(m, V.get(m) === e ? "all" : e, !0), V.set(l, !1), D();
|
|
1860
1860
|
}
|
|
1861
|
-
function
|
|
1862
|
-
V.set(l, !V.get(l)),
|
|
1861
|
+
function ie() {
|
|
1862
|
+
V.set(l, !V.get(l)), D(), V.get(l) && V.set(m, "all");
|
|
1863
1863
|
}
|
|
1864
|
-
function
|
|
1864
|
+
function D() {
|
|
1865
1865
|
if (!(typeof localStorage > "u")) try {
|
|
1866
1866
|
localStorage.setItem(s, V.get(l) ? "1" : "0");
|
|
1867
1867
|
} catch {}
|
|
1868
1868
|
}
|
|
1869
|
-
var
|
|
1869
|
+
var ae = mn(), O = V.first_child(ae), se = V.child(O), k = (e) => {
|
|
1870
1870
|
var t = J();
|
|
1871
|
-
V.template_effect((e) => V.set_class(t, 1, e), [() => V.clsx(F("absolute right-0 top-0 z-40 h-full w-1 cursor-col-resize hover:bg-primary/50 transition-colors", V.get(
|
|
1871
|
+
V.template_effect((e) => V.set_class(t, 1, e), [() => V.clsx(F("absolute right-0 top-0 z-40 h-full w-1 cursor-col-resize hover:bg-primary/50 transition-colors", V.get(g) && "bg-primary w-1"))]), V.delegated("mousedown", t, re), V.append(e, t);
|
|
1872
1872
|
};
|
|
1873
|
-
V.if(
|
|
1874
|
-
!n() && !V.get(h) && e(
|
|
1873
|
+
V.if(se, (e) => {
|
|
1874
|
+
!n() && !V.get(h) && e(k);
|
|
1875
1875
|
});
|
|
1876
|
-
var
|
|
1876
|
+
var A = V.sibling(se, 2), ce = (e) => {
|
|
1877
1877
|
var t = an(), n = V.child(t), r = (e) => {
|
|
1878
1878
|
U(e, { class: "size-3.5" });
|
|
1879
1879
|
}, i = (e) => {
|
|
@@ -1881,14 +1881,14 @@ function hn(e, t) {
|
|
|
1881
1881
|
};
|
|
1882
1882
|
V.if(n, (e) => {
|
|
1883
1883
|
V.get(h) ? e(r) : e(i, -1);
|
|
1884
|
-
}), V.reset(t), V.delegated("click", t,
|
|
1884
|
+
}), V.reset(t), V.delegated("click", t, ie), V.append(e, t);
|
|
1885
1885
|
};
|
|
1886
|
-
V.if(
|
|
1887
|
-
n() || e(
|
|
1886
|
+
V.if(A, (e) => {
|
|
1887
|
+
n() || e(ce);
|
|
1888
1888
|
});
|
|
1889
|
-
var
|
|
1889
|
+
var M = V.sibling(A, 2), le = (e) => {
|
|
1890
1890
|
var t = cn(), n = V.child(t);
|
|
1891
|
-
V.each(n, 17, () => V.get(
|
|
1891
|
+
V.each(n, 17, () => V.get(ne), (e) => e.id, (e, t) => {
|
|
1892
1892
|
let n = V.derived(() => V.get(t).component);
|
|
1893
1893
|
var r = V.comment(), i = V.first_child(r);
|
|
1894
1894
|
V.component(i, () => V.get(n), (e, t) => {
|
|
@@ -1946,9 +1946,9 @@ function hn(e, t) {
|
|
|
1946
1946
|
V.if(d, (e) => {
|
|
1947
1947
|
V.get(m) === "all" && V.get(v).length > 0 && e(f);
|
|
1948
1948
|
}), V.reset(t), V.append(e, t);
|
|
1949
|
-
},
|
|
1949
|
+
}, ue = (e) => {
|
|
1950
1950
|
var t = dn(), n = V.child(t);
|
|
1951
|
-
V.each(n, 17, () => V.get(
|
|
1951
|
+
V.each(n, 17, () => V.get(ne), (e) => e.id, (e, t) => {
|
|
1952
1952
|
let n = V.derived(() => V.get(t).component);
|
|
1953
1953
|
var r = V.comment(), i = V.first_child(r);
|
|
1954
1954
|
V.component(i, () => V.get(n), (e, t) => {
|
|
@@ -1983,51 +1983,67 @@ function hn(e, t) {
|
|
|
1983
1983
|
}), V.reset(t), V.template_effect((e, t, n, i, a, c, u, d) => {
|
|
1984
1984
|
V.set_attribute(r, "title", e), V.set_attribute(r, "aria-label", t), V.set_attribute(o, "title", n), V.set_attribute(o, "aria-label", i), V.set_attribute(s, "title", a), V.set_attribute(s, "aria-label", c), V.set_attribute(l, "title", u), V.set_attribute(l, "aria-label", d);
|
|
1985
1985
|
}, [
|
|
1986
|
-
() =>
|
|
1987
|
-
() =>
|
|
1988
|
-
() =>
|
|
1989
|
-
() =>
|
|
1990
|
-
() =>
|
|
1991
|
-
() =>
|
|
1992
|
-
() =>
|
|
1993
|
-
() =>
|
|
1994
|
-
]), V.delegated("click", r, () => Te(c, "/")), V.delegated("click", o,
|
|
1986
|
+
() => oe(),
|
|
1987
|
+
() => oe(),
|
|
1988
|
+
() => j(),
|
|
1989
|
+
() => j(),
|
|
1990
|
+
() => x(),
|
|
1991
|
+
() => x(),
|
|
1992
|
+
() => y(),
|
|
1993
|
+
() => y()
|
|
1994
|
+
]), V.delegated("click", r, () => Te(c, "/")), V.delegated("click", o, w), V.delegated("click", s, () => E("recent")), V.delegated("click", l, () => E("tags")), V.append(e, t);
|
|
1995
1995
|
};
|
|
1996
|
-
V.if(
|
|
1997
|
-
V.get(h) ? e(
|
|
1996
|
+
V.if(M, (e) => {
|
|
1997
|
+
V.get(h) ? e(ue, -1) : e(le);
|
|
1998
1998
|
});
|
|
1999
|
-
var
|
|
1999
|
+
var de = V.sibling(M, 2), fe = V.child(de), pe = (e) => {
|
|
2000
2000
|
var t = fn(), n = V.child(t);
|
|
2001
|
-
|
|
2001
|
+
V.each(n, 17, () => V.get(_), (e) => e.id, (e, t) => {
|
|
2002
|
+
let n = V.derived(() => V.get(t).component);
|
|
2003
|
+
var r = V.comment(), i = V.first_child(r);
|
|
2004
|
+
V.component(i, () => V.get(n), (e, t) => {
|
|
2005
|
+
t(e, { collapsed: !0 });
|
|
2006
|
+
}), V.append(e, r);
|
|
2007
|
+
});
|
|
2002
2008
|
var r = V.sibling(n, 2);
|
|
2003
|
-
V.
|
|
2004
|
-
|
|
2009
|
+
W(V.child(r), { class: "size-4" }), V.reset(r);
|
|
2010
|
+
var i = V.sibling(r, 2);
|
|
2011
|
+
V.reset(t), V.template_effect((e, t, n, a) => {
|
|
2012
|
+
V.set_attribute(r, "title", e), V.set_attribute(r, "aria-label", t), V.set_attribute(i, "title", n), V.set_attribute(i, "aria-label", a);
|
|
2005
2013
|
}, [
|
|
2006
|
-
() =>
|
|
2007
|
-
() =>
|
|
2008
|
-
() =>
|
|
2009
|
-
() =>
|
|
2010
|
-
]), V.delegated("click",
|
|
2014
|
+
() => b(),
|
|
2015
|
+
() => b(),
|
|
2016
|
+
() => T(),
|
|
2017
|
+
() => T()
|
|
2018
|
+
]), V.delegated("click", r, () => {
|
|
2011
2019
|
V.set(p, !0);
|
|
2012
2020
|
}), V.append(e, t);
|
|
2013
|
-
},
|
|
2021
|
+
}, N = (e) => {
|
|
2014
2022
|
var t = pn(), n = V.child(t), r = V.child(n, !0);
|
|
2015
2023
|
V.reset(n);
|
|
2016
|
-
var i = V.sibling(n, 2);
|
|
2017
|
-
|
|
2018
|
-
|
|
2024
|
+
var i = V.sibling(n, 2), a = V.child(i);
|
|
2025
|
+
V.each(a, 17, () => V.get(_), (e) => e.id, (e, t) => {
|
|
2026
|
+
let n = V.derived(() => V.get(t).component);
|
|
2027
|
+
var r = V.comment(), i = V.first_child(r);
|
|
2028
|
+
V.component(i, () => V.get(n), (e, t) => {
|
|
2029
|
+
t(e, { collapsed: !1 });
|
|
2030
|
+
}), V.append(e, r);
|
|
2031
|
+
});
|
|
2032
|
+
var o = V.sibling(a, 2);
|
|
2033
|
+
W(V.child(o), { class: "size-4" }), V.reset(o), V.reset(i), V.reset(t), V.template_effect((e, t, i, a) => {
|
|
2034
|
+
V.set_attribute(n, "title", e), V.set_text(r, t), V.set_attribute(o, "title", i), V.set_attribute(o, "aria-label", a);
|
|
2019
2035
|
}, [
|
|
2020
|
-
() =>
|
|
2021
|
-
() =>
|
|
2022
|
-
() =>
|
|
2023
|
-
() =>
|
|
2024
|
-
]), V.delegated("click",
|
|
2036
|
+
() => T(),
|
|
2037
|
+
() => T(),
|
|
2038
|
+
() => b(),
|
|
2039
|
+
() => b()
|
|
2040
|
+
]), V.delegated("click", o, () => {
|
|
2025
2041
|
V.set(p, !0);
|
|
2026
2042
|
}), V.append(e, t);
|
|
2027
2043
|
};
|
|
2028
|
-
V.if(
|
|
2029
|
-
V.get(h) ? e(
|
|
2030
|
-
}), V.reset(
|
|
2044
|
+
V.if(fe, (e) => {
|
|
2045
|
+
V.get(h) ? e(pe) : e(N, -1);
|
|
2046
|
+
}), V.reset(de), V.reset(O), V.bind_this(O, (e) => o(e), () => o()), u(V.sibling(O, 2), {
|
|
2031
2047
|
get open() {
|
|
2032
2048
|
return V.get(p);
|
|
2033
2049
|
},
|
|
@@ -2035,8 +2051,8 @@ function hn(e, t) {
|
|
|
2035
2051
|
V.set(p, e, !0);
|
|
2036
2052
|
}
|
|
2037
2053
|
}), V.template_effect((e) => {
|
|
2038
|
-
V.set_attribute(
|
|
2039
|
-
}, [() => V.clsx(F("flex flex-col border-r border-border bg-card", n() && "fixed inset-y-0 left-0 z-50 h-full w-[80%] max-w-[320px] shadow-xl transition-transform duration-300 ease-out", n() && (r() ? "translate-x-0" : "-translate-x-full"), !n() && "relative h-screen", !n() && !V.get(
|
|
2054
|
+
V.set_attribute(O, "id", n() ? "mobile-navigation" : void 0), V.set_attribute(O, "role", n() && r() ? "dialog" : void 0), V.set_attribute(O, "aria-modal", n() && r() ? "true" : void 0), V.set_attribute(O, "aria-label", n() ? "Navigation" : void 0), V.set_attribute(O, "aria-hidden", n() && !r() ? "true" : void 0), O.inert = n() && !r(), V.set_class(O, 1, e), V.set_style(O, n() ? "padding-top: env(safe-area-inset-top);" : V.get(h) ? "width: 48px;" : `width: ${V.get(ee)}px;`);
|
|
2055
|
+
}, [() => V.clsx(F("flex flex-col border-r border-border bg-card", n() && "fixed inset-y-0 left-0 z-50 h-full w-[80%] max-w-[320px] shadow-xl transition-transform duration-300 ease-out", n() && (r() ? "translate-x-0" : "-translate-x-full"), !n() && "relative h-screen", !n() && !V.get(g) && "transition-[width] duration-200"))]), V.append(e, ae), V.pop();
|
|
2040
2056
|
}
|
|
2041
2057
|
V.delegate(["mousedown", "click"]);
|
|
2042
2058
|
//#endregion
|