@hiai-gg/docsmint 0.5.0 → 0.5.1
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-DyytjQn6.js → CategoryDialog-DmlX0Z97.js} +1 -1
- package/dist/frontend/DatePicker-D6E-EEtZ.js +340 -0
- package/dist/frontend/{FolderNode-DAGPgi-M.js → FolderNode-D3rN3yLV.js} +1 -1
- package/dist/frontend/{ShareDialog-ChZogJtW.js → ShareDialog-uEf8Ks02.js} +1 -1
- package/dist/frontend/{Sidebar-BdB8CfXS.js → Sidebar-BthP-jOS.js} +443 -437
- package/dist/frontend/app-shell.js +1 -1
- package/dist/frontend/components/category-dialog.js +1 -1
- package/dist/frontend/components/editor/document-editor.js +240 -228
- package/dist/frontend/components/folder-node.js +1 -1
- package/dist/frontend/components/save-as-dialog.js +1 -1
- package/dist/frontend/components/share-dialog.js +1 -1
- package/dist/frontend/components/sidebar.js +1 -1
- package/dist/frontend/dashboard.js +1100 -1068
- package/dist/frontend/{dropdown-menu-Cre80-CJ.js → dropdown-menu-CJ_7V3N0.js} +43 -43
- package/dist/frontend/{floating-layer-anchor-BDs7vO-M.js → floating-layer-anchor-S5RSefGN.js} +1 -1
- package/dist/frontend/search.js +421 -405
- package/dist/frontend/{select-value-GXwx90Pr.js → select-value-JCAp2PmU.js} +466 -466
- package/dist/frontend-ssr/app-shell.js +1 -1
- package/dist/frontend-ssr/assets/{CategoryDialog-CLAGMZPz.js → CategoryDialog-DDu37Oub.js} +1 -1
- package/dist/frontend-ssr/assets/{FolderNode-Ty6fMbDu.js → FolderNode-CrLWqHJH.js} +1 -1
- package/dist/frontend-ssr/assets/{ShareDialog-C-9VDKSz.js → ShareDialog-B82t8oJi.js} +1 -1
- package/dist/frontend-ssr/assets/{Sidebar-DzbIUZFc.js → Sidebar-CI8YKbrY.js} +14 -6
- package/dist/frontend-ssr/assets/{dropdown-menu-CGkf8-rb.js → dropdown-menu-Dn_vQq9b.js} +1 -1
- package/dist/frontend-ssr/assets/{floating-layer-anchor-CYIE8Oj6.js → floating-layer-anchor-BIAu-252.js} +1 -1
- package/dist/frontend-ssr/assets/{select-value-6Lk0ToYd.js → select-value-DBhbkNcc.js} +1 -1
- package/dist/frontend-ssr/components/category-dialog.js +1 -1
- package/dist/frontend-ssr/components/editor/document-editor.js +35 -21
- 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/share-dialog.js +1 -1
- package/dist/frontend-ssr/components/sidebar.js +1 -1
- package/dist/frontend-ssr/dashboard.js +269 -75
- package/dist/frontend-ssr/search.js +1 -1
- package/package.json +1 -1
- package/packages/cli/src/index.ts +1 -1
- package/packages/mcp-server/src/index.ts +1 -1
- package/dist/frontend/DatePicker-BkaaNS1l.js +0 -256
|
@@ -8,40 +8,40 @@ import { n as s, r as c, t as l } from "./confirm-dialog-CzmoZw3a.js";
|
|
|
8
8
|
import { t as u } from "./SettingsDialog-DEx1eEZm.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 g, r as _, t as ee } from "./dropdown-menu-
|
|
11
|
+
import { a as m, i as h, o as g, r as _, t as ee } from "./dropdown-menu-CJ_7V3N0.js";
|
|
12
12
|
import { n as te } from "./dist-DQa_OHOa.js";
|
|
13
13
|
import { $r as v, Di as y, Ei as b, Er as x, Gn as S, Gt as C, Ii as w, Kt as T, Lt as E, O as D, Oi as ne, Pi as re, Qr as O, Ti as k, Ut as A, Wn as ie, Xn as ae, Xr as j, Yn as oe, Zr as M, di as se, ei as N, hi as ce, ir as le, ji as ue, ki as de, li as fe, nr as pe, 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
|
-
import { a as Ce, i as
|
|
15
|
-
import { t as
|
|
16
|
-
import { a as
|
|
17
|
-
import { t as
|
|
18
|
-
import { t as
|
|
19
|
-
import { n as
|
|
20
|
-
import { i as
|
|
21
|
-
import { t as
|
|
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
|
|
32
|
-
import { t as
|
|
33
|
-
import { a as
|
|
34
|
-
import { t as
|
|
35
|
-
import { i as
|
|
36
|
-
import { t as
|
|
14
|
+
import { a as Ce, i as we, n as Te, t as Ee } from "./route-context-DYQlUfzL.js";
|
|
15
|
+
import { t as F } from "./utils-DrfHTcei.js";
|
|
16
|
+
import { a as De, i as Oe, n as ke, o as Ae, r as je, t as Me } from "./dialog-Ce79C9fd.js";
|
|
17
|
+
import { t as Ne } from "./input-BWlOML_m.js";
|
|
18
|
+
import { t as Pe } from "./label-C2HfJNQ2.js";
|
|
19
|
+
import { n as Fe } from "./client-GbtOH90i.js";
|
|
20
|
+
import { i as Ie, r as Le, s as Re } from "./categories-X7gK8azc.js";
|
|
21
|
+
import { t as I } from "./context-KLiM3QQ0.js";
|
|
22
|
+
import { t as ze } from "./resolve-BG4HgzpN.js";
|
|
23
|
+
import { n as Be, t as Ve } from "./dndzone-BzsOINtP.js";
|
|
24
|
+
import { c as He, i as Ue, r as We, s as Ge, t as Ke } from "./documents-CwCs1rA7.js";
|
|
25
|
+
import { c as qe, r as Je, s as Ye, t as Xe } from "./folders-ONG03Dkv.js";
|
|
26
|
+
import { t as Ze } from "./DeleteDialog-8k6JYWCx.js";
|
|
27
|
+
import { t as Qe } from "./clipboard-Cgzxc0_R.js";
|
|
28
|
+
import { t as $e } from "./ShareDialog-uEf8Ks02.js";
|
|
29
|
+
import { t as et } from "./CategoryDialog-DmlX0Z97.js";
|
|
30
|
+
import { n as tt, t as nt } from "./document-drop-coordinator-C4xHMjwC.js";
|
|
31
|
+
import { a as rt, c as it, d as L, 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
|
+
import { t as mt } from "./FolderNode-D3rN3yLV.js";
|
|
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
|
+
import { t as vt } from "./ConfirmDialog-DgMTQBq4.js";
|
|
35
|
+
import { i as yt, o as bt } from "./tags-BdCaMGfj.js";
|
|
36
|
+
import { t as xt } from "./TagCreateDialog-Bb0-Vtzh.js";
|
|
37
37
|
import "svelte/internal/disclose-version";
|
|
38
38
|
import * as V from "svelte/internal/client";
|
|
39
|
-
import { onDestroy as
|
|
39
|
+
import { onDestroy as St, onMount as Ct, untrack as wt } from "svelte";
|
|
40
40
|
import "svelte/internal/flags/legacy";
|
|
41
41
|
import { page as H } from "$app/state";
|
|
42
|
-
import { flip as
|
|
42
|
+
import { flip as Tt } from "svelte/animate";
|
|
43
43
|
//#region ../node_modules/.bun/lucide-svelte@0.577.0+ff5f301bb2db9a0d/node_modules/lucide-svelte/dist/icons/panel-left-close.svelte
|
|
44
|
-
function
|
|
44
|
+
function Et(t, n) {
|
|
45
45
|
let r = V.legacy_rest_props(n, [
|
|
46
46
|
"children",
|
|
47
47
|
"$$slots",
|
|
@@ -125,19 +125,19 @@ function W(t, n) {
|
|
|
125
125
|
}
|
|
126
126
|
//#endregion
|
|
127
127
|
//#region src/lib/components/SearchBar.svelte
|
|
128
|
-
var
|
|
129
|
-
function
|
|
128
|
+
var Dt = V.from_html("<button type=\"button\" class=\"absolute right-2 top-1/2 inline-flex size-5 -translate-y-1/2 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring\"><!></button>"), Ot = V.from_html("<div><!> <input type=\"text\"/> <!></div>");
|
|
129
|
+
function kt(e, t) {
|
|
130
130
|
V.push(t, !0);
|
|
131
|
-
let n = V.state(""), r = V.state(null), i =
|
|
131
|
+
let n = V.state(""), r = V.state(null), i = Ee();
|
|
132
132
|
function a() {
|
|
133
133
|
V.set(n, ""), V.get(r)?.focus();
|
|
134
134
|
}
|
|
135
|
-
var o =
|
|
135
|
+
var o = Ot(), s = V.child(o);
|
|
136
136
|
d(s, { class: "pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" });
|
|
137
137
|
var c = V.sibling(s, 2);
|
|
138
138
|
V.remove_input_defaults(c), V.bind_this(c, (e) => V.set(r, e), () => V.get(r));
|
|
139
139
|
var l = V.sibling(c, 2), u = (e) => {
|
|
140
|
-
var t =
|
|
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
|
}, [() => E(), () => E()]), V.delegated("click", t, a), V.append(e, t);
|
|
@@ -147,34 +147,34 @@ function Ot(e, t) {
|
|
|
147
147
|
}), V.reset(o), V.template_effect((e, t, n) => {
|
|
148
148
|
V.set_class(o, 1, e), V.set_attribute(c, "placeholder", t), V.set_class(c, 1, n);
|
|
149
149
|
}, [
|
|
150
|
-
() => V.clsx(
|
|
150
|
+
() => V.clsx(F("relative", t.class)),
|
|
151
151
|
() => j(),
|
|
152
|
-
() => V.clsx(
|
|
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
|
-
e.key === "Enter" && V.get(n).trim() &&
|
|
154
|
+
e.key === "Enter" && V.get(n).trim() && Te(i, `/search?q=${encodeURIComponent(V.get(n).trim())}`);
|
|
155
155
|
}), V.event("focus", c, () => {}), V.bind_value(c, () => V.get(n), (e) => V.set(n, e)), V.append(e, o), V.pop();
|
|
156
156
|
}
|
|
157
157
|
V.delegate(["keydown", "click"]);
|
|
158
158
|
//#endregion
|
|
159
159
|
//#region src/lib/components/sidebar/FolderTree.svelte
|
|
160
|
-
var
|
|
161
|
-
var n =
|
|
160
|
+
var At = (e, t = V.noop) => {
|
|
161
|
+
var n = Ft(), r = V.sibling(V.child(n), 2);
|
|
162
162
|
c(r, { class: "size-4 shrink-0 text-muted-foreground" });
|
|
163
163
|
var i = V.sibling(r, 2), a = V.child(i, !0);
|
|
164
164
|
V.reset(i), V.reset(n), V.template_effect((e) => {
|
|
165
165
|
V.set_attribute(n, "href", `/docs/${t().id}`), V.set_class(n, 1, e), V.set_text(a, t().title);
|
|
166
|
-
}, [() => V.clsx(
|
|
167
|
-
},
|
|
168
|
-
function
|
|
166
|
+
}, [() => V.clsx(F("flex w-full min-w-0 items-center gap-1.5 rounded-md px-2 py-1 text-sm transition-colors hover:bg-accent hover:text-accent-foreground", H.params.id === t().id && "bg-accent text-accent-foreground font-medium"))]), V.append(e, n);
|
|
167
|
+
}, jt = V.from_html("<button><!></button>"), Mt = V.from_html("<!> <!> <!>", 1), Nt = V.from_html("<!> <!>", 1), Pt = V.from_html("<button type=\"button\"><!></button>"), Ft = V.from_html("<a data-sveltekit-noscroll=\"\"><span class=\"w-3.5 shrink-0\"></span> <!> <span class=\"min-w-0 truncate\"> </span></a>"), It = V.from_html("<p class=\"px-2 text-xs text-destructive\"> </p>"), Lt = V.from_html("<!> <!> <!> <!> <!> <!>", 1), Rt = V.from_html("<div><!></div>"), zt = V.from_html("<div class=\"group/doc flex w-full min-w-0 items-center gap-1\"><!> <!> <!></div>"), Bt = V.from_html("<div class=\"ml-0.5 space-y-0.5 border-l border-border pl-0.5\"><div></div> <div></div></div>"), Vt = V.from_html("<div class=\"group/bucket\"><div class=\"flex w-full min-w-0 items-center gap-0.5\"><button type=\"button\"><!> <span class=\"min-w-0 truncate\"> </span></button> <!></div> <!></div>"), Ht = V.from_html("<div class=\"group/bucket\"><div class=\"flex w-full min-w-0 items-center gap-0.5\"><button type=\"button\"><!> <span class=\"min-w-0 truncate\"> </span></button></div> <!></div>"), Ut = V.from_html("<p id=\"rename-input-error\" class=\"text-xs text-destructive\" role=\"alert\"> </p>"), Wt = V.from_html("<!> <form class=\"space-y-4\"><div class=\"space-y-2\"><!> <!> <!></div></form> <!>", 1), Gt = V.from_html("<div class=\"space-y-1\"><div class=\"mb-2 flex items-center justify-between gap-1\"><a class=\"block flex-1 px-2 text-xs font-medium uppercase tracking-wider text-muted-foreground transition-colors hover:text-foreground\"> </a> <button type=\"button\" class=\"inline-flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"><!></button></div> <!> <!> <div class=\"min-h-[8px] space-y-1\"></div> <!> <button type=\"button\" class=\"flex w-full items-center gap-1.5 rounded-md px-2 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground\"><!> <span> </span></button></div> <!> <!> <!> <!> <!>", 1);
|
|
168
|
+
function Kt(e, i) {
|
|
169
169
|
V.push(i, !0);
|
|
170
170
|
let a = (e, t = V.noop) => {
|
|
171
171
|
m(e, {
|
|
172
172
|
children: (e, n) => {
|
|
173
|
-
var r =
|
|
173
|
+
var r = Nt(), i = V.first_child(r);
|
|
174
174
|
ee(i, {
|
|
175
175
|
child: (e, t) => {
|
|
176
176
|
let n = () => (t?.()).props;
|
|
177
|
-
var r =
|
|
177
|
+
var r = jt(), i = (e) => {
|
|
178
178
|
e.preventDefault(), e.stopPropagation();
|
|
179
179
|
};
|
|
180
180
|
V.attribute_effect(r, (e, t) => ({
|
|
@@ -190,9 +190,9 @@ function Gt(e, i) {
|
|
|
190
190
|
}), h(V.sibling(i, 2), {
|
|
191
191
|
align: "end",
|
|
192
192
|
children: (e, n) => {
|
|
193
|
-
var r =
|
|
193
|
+
var r = Mt(), i = V.first_child(r);
|
|
194
194
|
_(i, {
|
|
195
|
-
onSelect: () =>
|
|
195
|
+
onSelect: () => ir("doc", t().id, t().title),
|
|
196
196
|
children: (e, t) => {
|
|
197
197
|
V.next();
|
|
198
198
|
var n = V.text();
|
|
@@ -202,7 +202,7 @@ function Gt(e, i) {
|
|
|
202
202
|
});
|
|
203
203
|
var a = V.sibling(i, 2);
|
|
204
204
|
_(a, {
|
|
205
|
-
onSelect: () =>
|
|
205
|
+
onSelect: () => cr(t().id, t().title),
|
|
206
206
|
children: (e, t) => {
|
|
207
207
|
V.next();
|
|
208
208
|
var n = V.text();
|
|
@@ -211,7 +211,7 @@ function Gt(e, i) {
|
|
|
211
211
|
$$slots: { default: !0 }
|
|
212
212
|
}), _(V.sibling(a, 2), {
|
|
213
213
|
class: "text-destructive focus:text-destructive",
|
|
214
|
-
onSelect: () =>
|
|
214
|
+
onSelect: () => sr("doc", t().id, t().title),
|
|
215
215
|
children: (e, t) => {
|
|
216
216
|
V.next();
|
|
217
217
|
var n = V.text();
|
|
@@ -226,7 +226,7 @@ function Gt(e, i) {
|
|
|
226
226
|
$$slots: { default: !0 }
|
|
227
227
|
});
|
|
228
228
|
}, c = (e, n = V.noop) => {
|
|
229
|
-
var r =
|
|
229
|
+
var r = Pt(), i = V.child(r), a = (e) => {
|
|
230
230
|
te(e, { class: "size-3.5 animate-spin" });
|
|
231
231
|
}, s = (e) => {
|
|
232
232
|
t(e, { class: "size-3.5" });
|
|
@@ -234,33 +234,33 @@ function Gt(e, i) {
|
|
|
234
234
|
o(e, { class: "size-3.5" });
|
|
235
235
|
};
|
|
236
236
|
V.if(i, (e) => {
|
|
237
|
-
V.get(
|
|
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
|
-
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(
|
|
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
|
}, [() => C(), () => C()]), V.delegated("click", r, (e) => {
|
|
241
|
-
e.preventDefault(), e.stopPropagation(),
|
|
241
|
+
e.preventDefault(), e.stopPropagation(), dn(n().id);
|
|
242
242
|
}), V.append(e, r);
|
|
243
243
|
}, u = (e, t = V.noop) => {
|
|
244
|
-
|
|
244
|
+
mt(e, {
|
|
245
245
|
get folder() {
|
|
246
246
|
return t();
|
|
247
247
|
},
|
|
248
248
|
get expandedFolderIds() {
|
|
249
249
|
return V.get(E);
|
|
250
250
|
},
|
|
251
|
-
onToggleFolder:
|
|
252
|
-
onRename: (e, t) =>
|
|
253
|
-
onDelete: (e, t) =>
|
|
254
|
-
onCreateSubfolder:
|
|
255
|
-
onShare:
|
|
251
|
+
onToggleFolder: kn,
|
|
252
|
+
onRename: (e, t) => ir("folder", e, t),
|
|
253
|
+
onDelete: (e, t) => sr("folder", e, t),
|
|
254
|
+
onCreateSubfolder: Pn,
|
|
255
|
+
onShare: lr,
|
|
256
256
|
get dragDisabled() {
|
|
257
257
|
return V.get(P);
|
|
258
258
|
},
|
|
259
259
|
get isDraggingGlobal() {
|
|
260
|
-
return V.get(
|
|
260
|
+
return V.get(I);
|
|
261
261
|
},
|
|
262
262
|
get isDraggingFolder() {
|
|
263
|
-
return V.get(
|
|
263
|
+
return V.get(ze);
|
|
264
264
|
},
|
|
265
265
|
get isDraggingDoc() {
|
|
266
266
|
return V.get(L);
|
|
@@ -268,20 +268,20 @@ function Gt(e, i) {
|
|
|
268
268
|
get draggedDocId() {
|
|
269
269
|
return V.get(R);
|
|
270
270
|
},
|
|
271
|
-
onScheduleFolderExpand:
|
|
272
|
-
onClearExpandTimer:
|
|
273
|
-
onConsiderDocs:
|
|
274
|
-
onFinalizeDocs:
|
|
275
|
-
onConsiderSubfolders:
|
|
276
|
-
onFinalizeSubfolders:
|
|
277
|
-
onDropOnFolder:
|
|
271
|
+
onScheduleFolderExpand: pn,
|
|
272
|
+
onClearExpandTimer: fn,
|
|
273
|
+
onConsiderDocs: Ln,
|
|
274
|
+
onFinalizeDocs: Rn,
|
|
275
|
+
onConsiderSubfolders: Kn,
|
|
276
|
+
onFinalizeSubfolders: qn,
|
|
277
|
+
onDropOnFolder: Hn,
|
|
278
278
|
get folderDocsMap() {
|
|
279
279
|
return V.get(H);
|
|
280
280
|
},
|
|
281
281
|
folderFlipDurationMs: p,
|
|
282
282
|
documentFlipDurationMs: v,
|
|
283
283
|
get docRowInner() {
|
|
284
|
-
return
|
|
284
|
+
return At;
|
|
285
285
|
},
|
|
286
286
|
get copyButton() {
|
|
287
287
|
return c;
|
|
@@ -290,57 +290,57 @@ function Gt(e, i) {
|
|
|
290
290
|
return a;
|
|
291
291
|
}
|
|
292
292
|
});
|
|
293
|
-
}, d =
|
|
293
|
+
}, d = Ee(), f = Ce(), p = 200, v = 80, b = V.state(V.proxy([])), x = V.state(V.proxy([])), S = V.state(V.proxy([])), E = V.state(V.proxy(/* @__PURE__ */ new Set())), D = V.state(V.proxy(/* @__PURE__ */ new Set())), O = V.state(!0), A = V.state(null), j = V.state(null), M = null;
|
|
294
294
|
function N(e) {
|
|
295
295
|
V.set(j, e, !0), M &&= (clearTimeout(M), null), e !== null && (M = setTimeout(() => {
|
|
296
296
|
V.set(j, null), M = null;
|
|
297
297
|
}, 5e3));
|
|
298
298
|
}
|
|
299
|
-
let P = V.state(!1),
|
|
300
|
-
async function
|
|
299
|
+
let P = V.state(!1), I = V.state(!1), ze = V.state(!1), L = 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
|
+
async function dn(e) {
|
|
301
301
|
if (typeof window > "u") return;
|
|
302
302
|
let t = V.get(S).find((t) => t.id === e), n = "";
|
|
303
|
-
V.set(
|
|
303
|
+
V.set(ln, e, !0);
|
|
304
304
|
try {
|
|
305
|
-
n = (await
|
|
305
|
+
n = (await Ue(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
|
-
V.set(
|
|
309
|
+
V.set(ln, null);
|
|
310
310
|
}
|
|
311
|
-
n && await
|
|
312
|
-
V.set(
|
|
311
|
+
n && await Qe(n) && (V.set(cn, e, !0), un && clearTimeout(un), un = setTimeout(() => {
|
|
312
|
+
V.set(cn, null), un = null;
|
|
313
313
|
}, 2e3));
|
|
314
314
|
}
|
|
315
|
-
function
|
|
316
|
-
Y !== null && (clearTimeout(Y), Y = null), V.set(
|
|
315
|
+
function fn() {
|
|
316
|
+
Y !== null && (clearTimeout(Y), Y = null), V.set(on, null);
|
|
317
317
|
}
|
|
318
|
-
function
|
|
319
|
-
|
|
320
|
-
if (V.get(
|
|
318
|
+
function pn(e) {
|
|
319
|
+
fn(), !V.get(E).has(e) && (V.set(on, e, !0), Y = setTimeout(() => {
|
|
320
|
+
if (V.get(on) === e && !V.get(E).has(e)) {
|
|
321
321
|
let t = new Set(V.get(E));
|
|
322
322
|
t.add(e), V.set(E, t, !0);
|
|
323
323
|
}
|
|
324
|
-
Y = null, V.set(
|
|
324
|
+
Y = null, V.set(on, null);
|
|
325
325
|
}, 400));
|
|
326
326
|
}
|
|
327
|
-
function
|
|
328
|
-
X !== null && (clearTimeout(X), X = null), V.set(
|
|
327
|
+
function mn() {
|
|
328
|
+
X !== null && (clearTimeout(X), X = null), V.set(sn, null);
|
|
329
329
|
}
|
|
330
|
-
function
|
|
331
|
-
|
|
332
|
-
if (V.get(
|
|
330
|
+
function hn(e) {
|
|
331
|
+
mn(), !(e === $ ? V.get(O) : V.get(D).has(e)) && (V.set(sn, e, !0), X = setTimeout(() => {
|
|
332
|
+
if (V.get(sn) === e) if (e === $) V.set(O, !0);
|
|
333
333
|
else {
|
|
334
334
|
let t = new Set(V.get(D));
|
|
335
335
|
t.add(e), V.set(D, t, !0);
|
|
336
336
|
}
|
|
337
|
-
X = null, V.set(
|
|
337
|
+
X = null, V.set(sn, null);
|
|
338
338
|
}, 400));
|
|
339
339
|
}
|
|
340
|
-
function
|
|
340
|
+
function gn(e) {
|
|
341
341
|
return Array.isArray(e) ? e.filter((e) => typeof e == "object" && !!e && typeof e.id == "string") : [];
|
|
342
342
|
}
|
|
343
|
-
function
|
|
343
|
+
function _n(e) {
|
|
344
344
|
let t = [], n = {}, r = {};
|
|
345
345
|
for (let i of e) if (i.folderId) {
|
|
346
346
|
let e = r[i.folderId] ?? [];
|
|
@@ -355,11 +355,11 @@ function Gt(e, i) {
|
|
|
355
355
|
byFolder: r
|
|
356
356
|
};
|
|
357
357
|
}
|
|
358
|
-
function _n() {
|
|
359
|
-
let { root: e, byCategory: t, byFolder: n } = gn(V.get(S));
|
|
360
|
-
V.set(bt, e, !0), V.set(Tt, t, !0), V.set(H, n, !0);
|
|
361
|
-
}
|
|
362
358
|
function vn() {
|
|
359
|
+
let { root: e, byCategory: t, byFolder: n } = _n(V.get(S));
|
|
360
|
+
V.set(xt, e, !0), V.set(Et, t, !0), V.set(H, n, !0);
|
|
361
|
+
}
|
|
362
|
+
function yn() {
|
|
363
363
|
let e = /* @__PURE__ */ new Map();
|
|
364
364
|
for (let t of V.get(x)) e.set(t.id, []);
|
|
365
365
|
let t = [];
|
|
@@ -369,16 +369,16 @@ function Gt(e, i) {
|
|
|
369
369
|
n[$] = t, V.set(U, n, !0);
|
|
370
370
|
}
|
|
371
371
|
V.user_effect(() => {
|
|
372
|
-
V.get(b), V.get(x), !(V.get(
|
|
372
|
+
V.get(b), V.get(x), !(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
|
|
376
|
-
})), !0),
|
|
376
|
+
})), !0), yn());
|
|
377
377
|
});
|
|
378
|
-
async function
|
|
378
|
+
async function bn() {
|
|
379
379
|
try {
|
|
380
|
-
let e = await
|
|
381
|
-
V.set(b, (e[0]?.children ?? []).map((e) => (
|
|
380
|
+
let e = await Ye(null, !1, f.fetch);
|
|
381
|
+
V.set(b, (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,
|
|
@@ -389,9 +389,9 @@ function Gt(e, i) {
|
|
|
389
389
|
console.error("FolderTree: failed to load folders", e), V.set(A, "Failed to load folders");
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
|
-
async function
|
|
392
|
+
async function xn() {
|
|
393
393
|
try {
|
|
394
|
-
let e = await
|
|
394
|
+
let e = await Ie(f.fetch), t = /* @__PURE__ */ new Set();
|
|
395
395
|
for (let n of e) {
|
|
396
396
|
if (t.has(n.id)) throw Error(`Categories response contains duplicate id: ${n.id}`);
|
|
397
397
|
t.add(n.id);
|
|
@@ -401,125 +401,125 @@ function Gt(e, i) {
|
|
|
401
401
|
console.error("FolderTree: failed to load categories", e);
|
|
402
402
|
}
|
|
403
403
|
}
|
|
404
|
-
let
|
|
405
|
-
async function
|
|
406
|
-
let e = ++
|
|
404
|
+
let Sn = 0;
|
|
405
|
+
async function Cn() {
|
|
406
|
+
let e = ++Sn;
|
|
407
407
|
try {
|
|
408
|
-
let t = z(), n = await
|
|
408
|
+
let t = z(), n = await Ge({
|
|
409
409
|
limit: 100,
|
|
410
410
|
...t ? { tag: t } : {}
|
|
411
411
|
}, f.fetch);
|
|
412
|
-
if (e !==
|
|
413
|
-
V.set(S, n.items.map((e) =>
|
|
412
|
+
if (e !== Sn) return;
|
|
413
|
+
V.set(S, n.items.map((e) => it(e.id) ? {
|
|
414
414
|
...e,
|
|
415
|
-
folderId:
|
|
416
|
-
categoryId:
|
|
415
|
+
folderId: it(e.id)?.folderId ?? null,
|
|
416
|
+
categoryId: it(e.id)?.categoryId ?? null
|
|
417
417
|
} : e), !0), V.get(S).forEach((e) => {
|
|
418
|
-
e.id, e.title, e.categoryId, e.folderId, Object.keys(e),
|
|
419
|
-
}),
|
|
418
|
+
e.id, e.title, e.categoryId, e.folderId, Object.keys(e), at(e.id, e.folderId ?? null, e.categoryId ?? null);
|
|
419
|
+
}), vn();
|
|
420
420
|
} catch (e) {
|
|
421
421
|
console.error("FolderTree: failed to load documents", e), V.set(A, "Failed to load documents");
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
424
|
async function Z() {
|
|
425
|
-
|
|
426
|
-
yn(),
|
|
425
|
+
Ke(), await Promise.all([
|
|
427
426
|
bn(),
|
|
428
|
-
|
|
427
|
+
xn(),
|
|
428
|
+
Cn()
|
|
429
429
|
]);
|
|
430
430
|
}
|
|
431
|
-
function
|
|
432
|
-
|
|
431
|
+
function wn(e, t) {
|
|
432
|
+
Sn++, at(e, t.folderId, t.categoryId), V.set(S, V.get(S).map((n) => n.id === e ? {
|
|
433
433
|
...n,
|
|
434
434
|
...t
|
|
435
|
-
} : n), !0),
|
|
435
|
+
} : n), !0), vn();
|
|
436
436
|
}
|
|
437
|
-
let
|
|
438
|
-
patch: (e, t) =>
|
|
439
|
-
optimistic: (e, t) =>
|
|
440
|
-
acknowledge:
|
|
441
|
-
rollback:
|
|
437
|
+
let Tn = tt({
|
|
438
|
+
patch: (e, t) => He(e, t, f.fetch),
|
|
439
|
+
optimistic: (e, t) => pt(e, t.folderId, t.categoryId),
|
|
440
|
+
acknowledge: ft,
|
|
441
|
+
rollback: wn,
|
|
442
442
|
onError: (e) => {
|
|
443
443
|
console.error("FolderTree: document move failed", e), N(e instanceof Error ? e.message : "Move failed");
|
|
444
444
|
}
|
|
445
445
|
});
|
|
446
|
-
function
|
|
447
|
-
let n =
|
|
448
|
-
n && (n.folderId === t.folderId && n.categoryId === t.categoryId ||
|
|
446
|
+
function En(e, t) {
|
|
447
|
+
let n = ut(e);
|
|
448
|
+
n && (n.folderId === t.folderId && n.categoryId === t.categoryId || Tn(e, t, n).catch(() => void 0));
|
|
449
449
|
}
|
|
450
|
-
let Q =
|
|
451
|
-
|
|
450
|
+
let Q = nt({ persist: En });
|
|
451
|
+
Ct(() => {
|
|
452
452
|
let e = setTimeout(() => {
|
|
453
453
|
Z();
|
|
454
454
|
}, 500);
|
|
455
455
|
return () => clearTimeout(e);
|
|
456
|
-
}),
|
|
456
|
+
}), St(() => {
|
|
457
457
|
Q.cancel(), M &&= (clearTimeout(M), null), Y &&= (clearTimeout(Y), null), X &&= (clearTimeout(X), null);
|
|
458
458
|
}), V.user_effect(() => {
|
|
459
|
-
let e =
|
|
459
|
+
let e = _t(), t = ct();
|
|
460
460
|
e === 0 && t === 0 || Z();
|
|
461
461
|
}), V.user_effect(() => {
|
|
462
|
-
if (
|
|
463
|
-
let e =
|
|
464
|
-
e &&
|
|
465
|
-
|
|
462
|
+
if (ot() === 0) return;
|
|
463
|
+
let e = dt();
|
|
464
|
+
e && wt(() => {
|
|
465
|
+
Sn++;
|
|
466
466
|
let t = V.get(S).findIndex((t) => t.id === e.id);
|
|
467
467
|
t !== -1 && (V.set(S, V.get(S).map((n, r) => r === t ? {
|
|
468
468
|
...n,
|
|
469
469
|
folderId: e.folderId,
|
|
470
470
|
categoryId: e.categoryId
|
|
471
|
-
} : n), !0),
|
|
471
|
+
} : n), !0), vn());
|
|
472
472
|
});
|
|
473
473
|
});
|
|
474
|
-
let
|
|
474
|
+
let Dn = !0;
|
|
475
475
|
V.user_effect(() => {
|
|
476
|
-
if (z(),
|
|
477
|
-
|
|
476
|
+
if (z(), Dn) {
|
|
477
|
+
Dn = !1;
|
|
478
478
|
return;
|
|
479
479
|
}
|
|
480
480
|
Z();
|
|
481
481
|
});
|
|
482
|
-
async function
|
|
482
|
+
async function On() {
|
|
483
483
|
await Z();
|
|
484
484
|
}
|
|
485
|
-
function
|
|
485
|
+
function kn(e) {
|
|
486
486
|
let t = V.get(E).has(e), n = new Set(V.get(E));
|
|
487
487
|
t ? n.delete(e) : n.add(e), V.set(E, n, !0), V.set(P, !0), typeof window < "u" && window.setTimeout(() => {
|
|
488
488
|
V.set(P, !1);
|
|
489
489
|
}, 250);
|
|
490
490
|
}
|
|
491
|
-
function
|
|
491
|
+
function An(e) {
|
|
492
492
|
let t = new Set(V.get(D));
|
|
493
493
|
t.has(e) ? t.delete(e) : t.add(e), V.set(D, t, !0);
|
|
494
494
|
}
|
|
495
|
-
function An() {
|
|
496
|
-
V.set(O, !V.get(O));
|
|
497
|
-
}
|
|
498
495
|
function jn() {
|
|
499
|
-
V.set(
|
|
496
|
+
V.set(O, !V.get(O));
|
|
500
497
|
}
|
|
501
|
-
function Mn(
|
|
502
|
-
V.set(
|
|
498
|
+
function Mn() {
|
|
499
|
+
V.set(Ot, null), V.set(kt, null), V.set(Dt, !0);
|
|
503
500
|
}
|
|
504
501
|
function Nn(e) {
|
|
505
|
-
V.set(
|
|
502
|
+
V.set(Ot, null), V.set(kt, e, !0), V.set(Dt, !0);
|
|
503
|
+
}
|
|
504
|
+
function Pn(e) {
|
|
505
|
+
V.set(Ot, e, !0), V.set(kt, null), V.set(Dt, !0);
|
|
506
506
|
}
|
|
507
|
-
async function
|
|
508
|
-
let t = V.get(
|
|
507
|
+
async function Fn(e) {
|
|
508
|
+
let t = V.get(Ot), n = await Xe({
|
|
509
509
|
name: e,
|
|
510
510
|
parentId: t,
|
|
511
|
-
categoryId: V.get(
|
|
511
|
+
categoryId: V.get(kt)
|
|
512
512
|
}, f.fetch);
|
|
513
|
-
return await
|
|
513
|
+
return await bn(), t && (V.set(E, new Set(V.get(E)).add(t), !0), st(t)), n;
|
|
514
514
|
}
|
|
515
|
-
function
|
|
515
|
+
function In(e, t) {
|
|
516
516
|
if (e.kind === "root") {
|
|
517
|
-
V.set(
|
|
517
|
+
V.set(xt, t, !0);
|
|
518
518
|
return;
|
|
519
519
|
}
|
|
520
520
|
if (e.kind === "category") {
|
|
521
|
-
V.set(
|
|
522
|
-
...V.get(
|
|
521
|
+
V.set(Et, {
|
|
522
|
+
...V.get(Et),
|
|
523
523
|
[e.id]: t
|
|
524
524
|
}, !0);
|
|
525
525
|
return;
|
|
@@ -529,38 +529,38 @@ function Gt(e, i) {
|
|
|
529
529
|
[e.id]: t
|
|
530
530
|
}, !0);
|
|
531
531
|
}
|
|
532
|
-
function
|
|
532
|
+
function Ln(e) {
|
|
533
533
|
return (t) => {
|
|
534
534
|
t.stopPropagation();
|
|
535
535
|
let n = !V.get(L);
|
|
536
|
-
V.set(
|
|
536
|
+
V.set(I, !0), V.set(L, !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
|
-
function
|
|
539
|
+
function Rn(e) {
|
|
540
540
|
return (t) => {
|
|
541
|
-
t.stopPropagation(),
|
|
541
|
+
t.stopPropagation(), In(e, gn(t.detail.items)), fn();
|
|
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,
|
|
545
|
+
!n && r && Q.zone(r, zn(e)), r && Q.end(r, B), V.set(I, !1), V.set(L, !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
|
};
|
|
549
549
|
}
|
|
550
|
-
function
|
|
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 : rt(e.id)?.categoryId ?? null
|
|
554
554
|
};
|
|
555
555
|
}
|
|
556
|
-
function
|
|
556
|
+
function Bn(e) {
|
|
557
557
|
(V.get(R) ?? Q.pendingId(B)) && (e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = "move"));
|
|
558
558
|
}
|
|
559
|
-
function
|
|
559
|
+
function Vn(e, t) {
|
|
560
560
|
let n = V.get(R) ?? Q.pendingId(B);
|
|
561
561
|
if (!n) return;
|
|
562
562
|
e.preventDefault(), e.stopPropagation();
|
|
563
|
-
let r = t === $ ? null : t, i =
|
|
563
|
+
let r = t === $ ? null : t, i = ut(n);
|
|
564
564
|
if (!i) return;
|
|
565
565
|
let a = i.folderId !== null, o = i.categoryId !== r;
|
|
566
566
|
(a || o) && Q.header(n, {
|
|
@@ -568,81 +568,81 @@ function Gt(e, i) {
|
|
|
568
568
|
categoryId: r
|
|
569
569
|
}), V.set(R, null);
|
|
570
570
|
}
|
|
571
|
-
function
|
|
571
|
+
function Hn(e, t) {
|
|
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 = rt(t)?.categoryId ?? null, i = ut(n);
|
|
576
576
|
i && (i.folderId !== t && Q.header(n, {
|
|
577
577
|
folderId: t,
|
|
578
578
|
categoryId: r
|
|
579
579
|
}), V.set(R, null));
|
|
580
580
|
}
|
|
581
|
-
let
|
|
582
|
-
function
|
|
581
|
+
let Un = "parent:";
|
|
582
|
+
function Wn(e) {
|
|
583
583
|
return (t) => {
|
|
584
|
-
t.stopPropagation(), V.set(
|
|
585
|
-
let n =
|
|
586
|
-
e.startsWith(
|
|
584
|
+
t.stopPropagation(), V.set(I, !0), V.set(ze, !0);
|
|
585
|
+
let n = Jn(t.detail.items);
|
|
586
|
+
e.startsWith(Un) || V.set(U, {
|
|
587
587
|
...V.get(U),
|
|
588
588
|
[e]: n
|
|
589
589
|
}, !0);
|
|
590
590
|
};
|
|
591
591
|
}
|
|
592
|
-
function
|
|
592
|
+
function Gn(e) {
|
|
593
593
|
return (t) => {
|
|
594
594
|
t.stopPropagation();
|
|
595
|
-
let n =
|
|
596
|
-
e.startsWith(
|
|
595
|
+
let n = Jn(t.detail.items), r = t.detail.info?.trigger === "droppedIntoAnother";
|
|
596
|
+
e.startsWith(Un) || V.set(U, {
|
|
597
597
|
...V.get(U),
|
|
598
598
|
[e]: n
|
|
599
|
-
}, !0), V.set(
|
|
599
|
+
}, !0), V.set(I, !1), V.set(ze, !1), r || Xn(e, n);
|
|
600
600
|
};
|
|
601
601
|
}
|
|
602
|
-
function Gn(e) {
|
|
603
|
-
return Un(`${Hn}${e}`);
|
|
604
|
-
}
|
|
605
602
|
function Kn(e) {
|
|
606
|
-
return Wn(`${
|
|
603
|
+
return Wn(`${Un}${e}`);
|
|
607
604
|
}
|
|
608
605
|
function qn(e) {
|
|
609
|
-
return
|
|
606
|
+
return Gn(`${Un}${e}`);
|
|
610
607
|
}
|
|
611
608
|
function Jn(e) {
|
|
609
|
+
return Array.isArray(e) ? e.filter((e) => typeof e == "object" && !!e && typeof e.id == "string") : [];
|
|
610
|
+
}
|
|
611
|
+
function Yn(e) {
|
|
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 = rt(n)?.parentId ?? null;
|
|
616
616
|
return t;
|
|
617
617
|
}
|
|
618
|
-
async function
|
|
619
|
-
let n = e.startsWith(
|
|
618
|
+
async function Xn(e, t) {
|
|
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 = rt(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 = rt(e.id);
|
|
630
630
|
if (!t) continue;
|
|
631
631
|
let n = t.categoryId !== r, i = t.parentId !== null;
|
|
632
632
|
if (n || i) {
|
|
633
633
|
let o = { folderId: e.id };
|
|
634
|
-
n && (o.categoryId = r), i && (o.parentId = null), a.set(e.id, o),
|
|
634
|
+
n && (o.categoryId = r), i && (o.parentId = null), a.set(e.id, o), lt(e.id, null, r, t.order);
|
|
635
635
|
}
|
|
636
636
|
}
|
|
637
637
|
t.forEach((e, t) => {
|
|
638
638
|
if (n && o.has(e.id)) return;
|
|
639
|
-
let r =
|
|
639
|
+
let r = rt(e.id);
|
|
640
640
|
if (!r) return;
|
|
641
641
|
let i = r.order !== t, s = a.get(e.id);
|
|
642
|
-
s ? (s.order = t,
|
|
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, {
|
|
643
643
|
folderId: e.id,
|
|
644
644
|
order: t
|
|
645
|
-
}),
|
|
645
|
+
}), lt(e.id, r.parentId, r.categoryId, t));
|
|
646
646
|
});
|
|
647
647
|
let s = Array.from(a.values()), c = /* @__PURE__ */ new Set();
|
|
648
648
|
if (n) {
|
|
@@ -655,26 +655,26 @@ function Gt(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
|
|
659
|
-
})), await Z(),
|
|
660
|
-
for (let e of c)
|
|
658
|
+
return qe(t, n, f.fetch);
|
|
659
|
+
})), await Z(), yn();
|
|
660
|
+
for (let e of c) st(e);
|
|
661
661
|
} catch (e) {
|
|
662
662
|
console.error("FolderTree: folder DnD persist failed", e), N(e instanceof Error ? `Move failed: ${e.message}` : "Move failed: unknown error");
|
|
663
663
|
}
|
|
664
664
|
}
|
|
665
|
-
function Xn(e) {
|
|
666
|
-
e.stopPropagation(), V.set(F, !0), V.set(ht, !0), V.set(W, Qn($n(e.detail.items)), !0);
|
|
667
|
-
}
|
|
668
665
|
function Zn(e) {
|
|
669
|
-
e.stopPropagation();
|
|
670
|
-
let t = Qn(er(e.detail.items));
|
|
671
|
-
V.set(W, t, !0), V.set(F, !1), V.set(ht, !1), tr(t);
|
|
666
|
+
e.stopPropagation(), V.set(I, !0), V.set(gt, !0), V.set(W, $n(er(e.detail.items)), !0);
|
|
672
667
|
}
|
|
673
668
|
function Qn(e) {
|
|
674
|
-
|
|
675
|
-
|
|
669
|
+
e.stopPropagation();
|
|
670
|
+
let t = $n(tr(e.detail.items));
|
|
671
|
+
V.set(W, t, !0), V.set(I, !1), V.set(gt, !1), nr(t);
|
|
676
672
|
}
|
|
677
673
|
function $n(e) {
|
|
674
|
+
let t = e.filter((e) => e.id !== $), n = V.get(W).find((e) => e.id === $) ?? V.get(xr).find((e) => e.id === $);
|
|
675
|
+
return n ? [...t, n] : t;
|
|
676
|
+
}
|
|
677
|
+
function er(e) {
|
|
678
678
|
if (!Array.isArray(e)) return [];
|
|
679
679
|
let t = [];
|
|
680
680
|
for (let n of e) {
|
|
@@ -684,8 +684,8 @@ function Gt(e, i) {
|
|
|
684
684
|
}
|
|
685
685
|
return t;
|
|
686
686
|
}
|
|
687
|
-
function
|
|
688
|
-
let t =
|
|
687
|
+
function tr(e) {
|
|
688
|
+
let t = er(e), n = new Set(t.filter((e) => e[Be]).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);
|
|
@@ -698,94 +698,94 @@ function Gt(e, i) {
|
|
|
698
698
|
}
|
|
699
699
|
return a;
|
|
700
700
|
}
|
|
701
|
-
function
|
|
702
|
-
let t = ++
|
|
703
|
-
V.set(
|
|
701
|
+
function nr(e) {
|
|
702
|
+
let t = ++yt;
|
|
703
|
+
V.set(vt, !0);
|
|
704
704
|
let n = e.map((e) => ({ ...e }));
|
|
705
|
-
|
|
705
|
+
bt = bt.catch(() => void 0).then(async () => {
|
|
706
706
|
try {
|
|
707
|
-
await
|
|
707
|
+
await rr(n);
|
|
708
708
|
} catch (e) {
|
|
709
709
|
console.error("FolderTree: category DnD persist failed", e), N(e instanceof Error ? `Reorder failed: ${e.message}` : "Reorder failed: unknown error");
|
|
710
710
|
} finally {
|
|
711
|
-
t ===
|
|
711
|
+
t === yt && (await Z(), V.set(vt, !1));
|
|
712
712
|
}
|
|
713
713
|
});
|
|
714
714
|
}
|
|
715
|
-
async function
|
|
715
|
+
async function rr(e) {
|
|
716
716
|
let t = [];
|
|
717
717
|
if (e.forEach((e, n) => {
|
|
718
718
|
e.category && t.push({
|
|
719
719
|
id: e.category.id,
|
|
720
720
|
order: n
|
|
721
721
|
});
|
|
722
|
-
}), t.length !== 0) for (let e of t) await
|
|
722
|
+
}), t.length !== 0) for (let e of t) await Re(e.id, { order: e.order }, f.fetch);
|
|
723
723
|
}
|
|
724
|
-
function
|
|
725
|
-
V.set(
|
|
724
|
+
function ir(e, t, n) {
|
|
725
|
+
V.set(Kt, {
|
|
726
726
|
kind: e,
|
|
727
727
|
id: t,
|
|
728
728
|
name: n
|
|
729
|
-
}, !0), V.set(
|
|
729
|
+
}, !0), V.set(qt, n, !0), V.set(G, null), V.set(Ft, !0);
|
|
730
730
|
}
|
|
731
|
-
function
|
|
732
|
-
V.set(
|
|
731
|
+
function ar() {
|
|
732
|
+
V.set(Ft, !1), V.set(Kt, null), V.set(qt, ""), V.set(G, null), V.set(K, !1);
|
|
733
733
|
}
|
|
734
|
-
async function
|
|
734
|
+
async function or(e) {
|
|
735
735
|
e?.preventDefault();
|
|
736
|
-
let t = V.get(
|
|
736
|
+
let t = V.get(Kt);
|
|
737
737
|
if (!t) return;
|
|
738
|
-
let n = V.get(
|
|
738
|
+
let n = V.get(qt).trim();
|
|
739
739
|
if (n.length === 0) {
|
|
740
740
|
V.set(G, "Name is required");
|
|
741
741
|
return;
|
|
742
742
|
}
|
|
743
743
|
V.set(K, !0);
|
|
744
744
|
try {
|
|
745
|
-
t.kind === "folder" ? await
|
|
745
|
+
t.kind === "folder" ? await qe(t.id, { name: n }, f.fetch) : await He(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 {
|
|
749
749
|
V.set(K, !1);
|
|
750
750
|
}
|
|
751
751
|
}
|
|
752
|
-
function
|
|
752
|
+
function sr(e, t, n) {
|
|
753
753
|
V.set(q, {
|
|
754
754
|
kind: e,
|
|
755
755
|
id: t,
|
|
756
756
|
name: n
|
|
757
|
-
}, !0), V.set(
|
|
758
|
-
}
|
|
759
|
-
function sr(e, t) {
|
|
760
|
-
V.set(Yt, e, !0), V.set(Xt, ""), V.set($t, ""), V.set(Zt, t, !0), V.set(Qt, ""), V.set(en, ""), V.set(Jt, !0);
|
|
757
|
+
}, !0), V.set(Jt, !0);
|
|
761
758
|
}
|
|
762
759
|
function cr(e, t) {
|
|
763
|
-
V.set(Xt, e, !0), V.set(
|
|
760
|
+
V.set(Xt, e, !0), V.set(Zt, ""), V.set(en, ""), V.set(Qt, t, !0), V.set($t, ""), V.set(tn, ""), V.set(Yt, !0);
|
|
764
761
|
}
|
|
765
762
|
function lr(e, t) {
|
|
766
|
-
V.set(
|
|
763
|
+
V.set(Zt, e, !0), V.set(Xt, ""), V.set(en, ""), V.set($t, t, !0), V.set(Qt, ""), V.set(tn, ""), V.set(Yt, !0);
|
|
767
764
|
}
|
|
768
|
-
function ur() {
|
|
769
|
-
V.set(
|
|
765
|
+
function ur(e, t) {
|
|
766
|
+
V.set(en, e, !0), V.set(Xt, ""), V.set(Zt, ""), V.set(tn, t, !0), V.set(Qt, ""), V.set($t, ""), V.set(Yt, !0);
|
|
770
767
|
}
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
e && (e.kind === "folder" ? await qe(e.id, f.fetch) : await Ue(e.id, f.fetch), await Z(), mt());
|
|
768
|
+
function dr() {
|
|
769
|
+
V.set(Jt, !1), V.set(q, null);
|
|
774
770
|
}
|
|
775
|
-
function fr() {
|
|
776
|
-
|
|
771
|
+
async function fr() {
|
|
772
|
+
let e = V.get(q);
|
|
773
|
+
e && (e.kind === "folder" ? await Je(e.id, f.fetch) : await We(e.id, f.fetch), await Z(), ht());
|
|
777
774
|
}
|
|
778
|
-
function pr(
|
|
779
|
-
V.set(
|
|
775
|
+
function pr() {
|
|
776
|
+
V.set(rn, "create"), V.set(J, null), V.set(nn, !0);
|
|
780
777
|
}
|
|
781
778
|
function mr(e) {
|
|
782
|
-
V.set(
|
|
779
|
+
V.set(rn, "edit"), V.set(J, e, !0), V.set(nn, !0);
|
|
783
780
|
}
|
|
784
|
-
function hr() {
|
|
785
|
-
V.
|
|
781
|
+
function hr(e) {
|
|
782
|
+
V.set(rn, "delete"), V.set(J, e, !0), V.set(nn, !0);
|
|
786
783
|
}
|
|
787
|
-
|
|
788
|
-
V.set(
|
|
784
|
+
function gr() {
|
|
785
|
+
V.get(an) || (V.set(nn, !1), V.set(J, null), V.set(an, !1));
|
|
786
|
+
}
|
|
787
|
+
async function _r(e) {
|
|
788
|
+
V.set(an, !0);
|
|
789
789
|
try {
|
|
790
790
|
let t = {
|
|
791
791
|
name: e.name,
|
|
@@ -794,28 +794,28 @@ function Gt(e, i) {
|
|
|
794
794
|
apiPermissionEdit: e.apiPermissionEdit,
|
|
795
795
|
apiPermissionWrite: e.apiPermissionWrite
|
|
796
796
|
}, n;
|
|
797
|
-
return n = V.get(
|
|
797
|
+
return n = V.get(rn) === "edit" && V.get(J) ? await Fe(`/api/categories/${encodeURIComponent(V.get(J).id)}`, {
|
|
798
798
|
method: "PATCH",
|
|
799
799
|
body: t
|
|
800
|
-
}, f.fetch) : await
|
|
800
|
+
}, f.fetch) : await Fe("/api/categories", {
|
|
801
801
|
method: "POST",
|
|
802
802
|
body: t
|
|
803
803
|
}, f.fetch), await Z(), n;
|
|
804
804
|
} finally {
|
|
805
|
-
V.set(
|
|
805
|
+
V.set(an, !1);
|
|
806
806
|
}
|
|
807
807
|
}
|
|
808
|
-
async function
|
|
808
|
+
async function vr() {
|
|
809
809
|
if (V.get(J)) {
|
|
810
|
-
V.set(
|
|
810
|
+
V.set(an, !0);
|
|
811
811
|
try {
|
|
812
|
-
await
|
|
812
|
+
await Le(V.get(J).id, f.fetch), await Z();
|
|
813
813
|
} finally {
|
|
814
|
-
V.set(
|
|
814
|
+
V.set(an, !1);
|
|
815
815
|
}
|
|
816
816
|
}
|
|
817
817
|
}
|
|
818
|
-
let $ = "__uncategorized__",
|
|
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
820
|
for (let t of V.get(x)) e.set(t.id, []);
|
|
821
821
|
let t = [];
|
|
@@ -832,28 +832,28 @@ function Gt(e, i) {
|
|
|
832
832
|
folders: t
|
|
833
833
|
}), n;
|
|
834
834
|
});
|
|
835
|
-
var
|
|
836
|
-
V.reset(
|
|
837
|
-
var
|
|
838
|
-
s(V.child(
|
|
839
|
-
var
|
|
840
|
-
var t =
|
|
835
|
+
var Sr = { refreshFolderTree: On }, Cr = Gt(), wr = V.first_child(Cr), Tr = V.child(wr), Er = V.child(Tr), Dr = V.child(Er, !0);
|
|
836
|
+
V.reset(Er);
|
|
837
|
+
var Or = V.sibling(Er, 2);
|
|
838
|
+
s(V.child(Or), { class: "size-3.5" }), V.reset(Or), V.reset(Tr);
|
|
839
|
+
var kr = V.sibling(Tr, 2), Ar = (e) => {
|
|
840
|
+
var t = It(), n = V.child(t, !0);
|
|
841
841
|
V.reset(t), V.template_effect(() => V.set_text(n, V.get(A))), V.append(e, t);
|
|
842
842
|
};
|
|
843
|
-
V.if(
|
|
844
|
-
V.get(A) && e(
|
|
843
|
+
V.if(kr, (e) => {
|
|
844
|
+
V.get(A) && e(Ar);
|
|
845
845
|
});
|
|
846
|
-
var
|
|
847
|
-
var t =
|
|
846
|
+
var jr = V.sibling(kr, 2), Mr = (e) => {
|
|
847
|
+
var t = It(), n = V.child(t, !0);
|
|
848
848
|
V.reset(t), V.template_effect(() => V.set_text(n, V.get(j))), V.append(e, t);
|
|
849
849
|
};
|
|
850
|
-
V.if(
|
|
851
|
-
V.get(j) && e(
|
|
850
|
+
V.if(jr, (e) => {
|
|
851
|
+
V.get(j) && e(Mr);
|
|
852
852
|
});
|
|
853
|
-
var
|
|
854
|
-
V.each(
|
|
853
|
+
var Nr = V.sibling(jr, 2);
|
|
854
|
+
V.each(Nr, 29, () => V.get(yr), (e) => `${e.id}:${e.isDndShadowItem ? "shadow" : "item"}`, (e, t) => {
|
|
855
855
|
let i = V.derived(() => V.get(D).has(V.get(t).id));
|
|
856
|
-
var o =
|
|
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
|
}, te = (e) => {
|
|
859
859
|
r(e, { class: "size-3.5 shrink-0" });
|
|
@@ -864,11 +864,11 @@ function Gt(e, i) {
|
|
|
864
864
|
var v = V.sibling(f, 2), y = V.child(v, !0);
|
|
865
865
|
V.reset(v), V.reset(l), m(V.sibling(l, 2), {
|
|
866
866
|
children: (e, n) => {
|
|
867
|
-
var r =
|
|
867
|
+
var r = Nt(), i = V.first_child(r);
|
|
868
868
|
ee(i, {
|
|
869
869
|
child: (e, t) => {
|
|
870
870
|
let n = () => (t?.()).props;
|
|
871
|
-
var r =
|
|
871
|
+
var r = jt();
|
|
872
872
|
V.attribute_effect(r, (e, t) => ({
|
|
873
873
|
...n(),
|
|
874
874
|
type: "button",
|
|
@@ -881,9 +881,9 @@ function Gt(e, i) {
|
|
|
881
881
|
}), h(V.sibling(i, 2), {
|
|
882
882
|
align: "end",
|
|
883
883
|
children: (e, n) => {
|
|
884
|
-
var r =
|
|
884
|
+
var r = Lt(), i = V.first_child(r);
|
|
885
885
|
_(i, {
|
|
886
|
-
onSelect: () =>
|
|
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();
|
|
@@ -893,7 +893,7 @@ function Gt(e, i) {
|
|
|
893
893
|
});
|
|
894
894
|
var a = V.sibling(i, 2);
|
|
895
895
|
_(a, {
|
|
896
|
-
onSelect: () =>
|
|
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();
|
|
@@ -903,7 +903,7 @@ function Gt(e, i) {
|
|
|
903
903
|
});
|
|
904
904
|
var o = V.sibling(a, 2);
|
|
905
905
|
_(o, {
|
|
906
|
-
onSelect: () =>
|
|
906
|
+
onSelect: () => Nn(V.get(t).category.id),
|
|
907
907
|
children: (e, t) => {
|
|
908
908
|
V.next();
|
|
909
909
|
var n = V.text();
|
|
@@ -913,7 +913,7 @@ function Gt(e, i) {
|
|
|
913
913
|
});
|
|
914
914
|
var s = V.sibling(o, 2);
|
|
915
915
|
_(s, {
|
|
916
|
-
onSelect: () =>
|
|
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();
|
|
@@ -923,7 +923,7 @@ function Gt(e, i) {
|
|
|
923
923
|
});
|
|
924
924
|
var c = V.sibling(s, 2);
|
|
925
925
|
_(c, {
|
|
926
|
-
onSelect: () =>
|
|
926
|
+
onSelect: () => mr(V.get(t).category),
|
|
927
927
|
children: (e, t) => {
|
|
928
928
|
V.next();
|
|
929
929
|
var n = V.text();
|
|
@@ -932,7 +932,7 @@ function Gt(e, i) {
|
|
|
932
932
|
$$slots: { default: !0 }
|
|
933
933
|
}), _(V.sibling(c, 2), {
|
|
934
934
|
class: "text-destructive focus:text-destructive",
|
|
935
|
-
onSelect: () =>
|
|
935
|
+
onSelect: () => hr(V.get(t).category),
|
|
936
936
|
children: (e, t) => {
|
|
937
937
|
V.next();
|
|
938
938
|
var n = V.text();
|
|
@@ -947,31 +947,31 @@ function Gt(e, i) {
|
|
|
947
947
|
$$slots: { default: !0 }
|
|
948
948
|
}), V.reset(s);
|
|
949
949
|
var b = V.sibling(s, 2), x = (e) => {
|
|
950
|
-
let n = V.derived(() => V.get(U)[V.get(t).id] ?? []), r = V.derived(() => V.get(
|
|
951
|
-
var i =
|
|
950
|
+
let n = V.derived(() => V.get(U)[V.get(t).id] ?? []), r = V.derived(() => V.get(Et)[V.get(t).id] ?? []);
|
|
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
|
-
var n =
|
|
954
|
-
u(V.child(n), () => V.get(t)), V.reset(n), V.animation(n, () =>
|
|
955
|
-
}), V.reset(o), V.action(o, (e, t) =>
|
|
953
|
+
var n = Rt();
|
|
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) => Ve?.(e, t), () => ({
|
|
956
956
|
items: V.get(n),
|
|
957
957
|
flipDurationMs: 200,
|
|
958
958
|
type: "folder",
|
|
959
959
|
dropTargetStyle: {},
|
|
960
960
|
dragDisabled: V.get(P)
|
|
961
961
|
}));
|
|
962
|
-
var d = V.sibling(o, 2), f = V.derived(() =>
|
|
962
|
+
var d = V.sibling(o, 2), f = V.derived(() => Ln({
|
|
963
963
|
kind: "category",
|
|
964
964
|
id: V.get(t).id
|
|
965
|
-
})), p = V.derived(() =>
|
|
965
|
+
})), p = V.derived(() => Rn({
|
|
966
966
|
kind: "category",
|
|
967
967
|
id: V.get(t).id
|
|
968
968
|
}));
|
|
969
969
|
V.each(d, 29, () => V.get(r), (e) => e.id, (e, t) => {
|
|
970
|
-
var n =
|
|
971
|
-
|
|
970
|
+
var n = zt(), r = V.child(n);
|
|
971
|
+
At(r, () => V.get(t));
|
|
972
972
|
var i = V.sibling(r, 2);
|
|
973
|
-
c(i, () => V.get(t)), a(V.sibling(i, 2), () => V.get(t)), V.reset(n), V.animation(n, () =>
|
|
974
|
-
}), V.reset(d), V.action(d, (e, t) =>
|
|
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) => Ve?.(e, t), () => ({
|
|
975
975
|
items: V.get(r),
|
|
976
976
|
flipDurationMs: 80,
|
|
977
977
|
type: "doc",
|
|
@@ -981,7 +981,7 @@ function Gt(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(
|
|
984
|
+
}, [() => V.clsx(F("min-h-[8px] space-y-0.5 transition-all duration-150", V.get(ze) && 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(L) && 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);
|
|
@@ -994,21 +994,21 @@ function Gt(e, i) {
|
|
|
994
994
|
V.if(b, (e) => {
|
|
995
995
|
V.get(i) && e(x);
|
|
996
996
|
}), V.reset(o), V.template_effect((e) => {
|
|
997
|
-
V.set_attribute(o, "data-is-dnd-shadow-item-hint", V.get(t)[
|
|
998
|
-
}, [() => V.clsx(
|
|
999
|
-
V.get(
|
|
997
|
+
V.set_attribute(o, "data-is-dnd-shadow-item-hint", V.get(t)[Be]), V.set_attribute(l, "aria-expanded", V.get(i)), V.set_class(l, 1, e), V.set_text(y, V.get(t).category.name);
|
|
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
|
+
V.get(I) && !V.get(i) && hn(V.get(t).id);
|
|
1000
1000
|
}), V.event("mouseleave", l, () => {
|
|
1001
|
-
V.get(
|
|
1002
|
-
}), V.event("dragover", l,
|
|
1003
|
-
}), V.reset(
|
|
1004
|
-
items: V.get(
|
|
1001
|
+
V.get(I) && mn();
|
|
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) => Ve?.(e, t), () => ({
|
|
1004
|
+
items: V.get(yr),
|
|
1005
1005
|
flipDurationMs: 200,
|
|
1006
1006
|
type: "category",
|
|
1007
1007
|
dropTargetStyle: {},
|
|
1008
1008
|
dragDisabled: V.get(P)
|
|
1009
1009
|
}));
|
|
1010
|
-
var
|
|
1011
|
-
var t =
|
|
1010
|
+
var Pr = V.sibling(Nr, 2), Fr = (e) => {
|
|
1011
|
+
var t = Ht(), i = V.child(t), o = V.child(i), s = V.child(o), l = (e) => {
|
|
1012
1012
|
n(e, { class: "size-3.5 shrink-0" });
|
|
1013
1013
|
}, d = (e) => {
|
|
1014
1014
|
r(e, { class: "size-3.5 shrink-0" });
|
|
@@ -1020,25 +1020,25 @@ function Gt(e, i) {
|
|
|
1020
1020
|
V.reset(f), V.reset(o), V.reset(i);
|
|
1021
1021
|
var m = V.sibling(i, 2), h = (e) => {
|
|
1022
1022
|
let t = V.derived(() => V.get(U)[$] ?? []);
|
|
1023
|
-
var n =
|
|
1023
|
+
var n = Bt(), r = V.child(n), i = V.derived(() => Wn($)), o = V.derived(() => Gn($));
|
|
1024
1024
|
V.each(r, 29, () => V.get(t), (e) => e.id, (e, t) => {
|
|
1025
|
-
var n =
|
|
1026
|
-
u(V.child(n), () => V.get(t)), V.reset(n), V.animation(n, () =>
|
|
1027
|
-
}), V.reset(r), V.action(r, (e, t) =>
|
|
1025
|
+
var n = Rt();
|
|
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) => Ve?.(e, t), () => ({
|
|
1028
1028
|
items: V.get(t),
|
|
1029
1029
|
flipDurationMs: 200,
|
|
1030
1030
|
type: "folder",
|
|
1031
1031
|
dropTargetStyle: {},
|
|
1032
1032
|
dragDisabled: V.get(P)
|
|
1033
1033
|
}));
|
|
1034
|
-
var s = V.sibling(r, 2), l = V.derived(() =>
|
|
1035
|
-
V.each(s, 29, () => V.get(
|
|
1036
|
-
var n =
|
|
1037
|
-
|
|
1034
|
+
var s = V.sibling(r, 2), l = V.derived(() => Ln({ kind: "root" })), d = V.derived(() => Rn({ kind: "root" }));
|
|
1035
|
+
V.each(s, 29, () => V.get(xt), (e) => e.id, (e, t) => {
|
|
1036
|
+
var n = zt(), r = V.child(n);
|
|
1037
|
+
At(r, () => V.get(t));
|
|
1038
1038
|
var i = V.sibling(r, 2);
|
|
1039
|
-
c(i, () => V.get(t)), a(V.sibling(i, 2), () => V.get(t)), V.reset(n), V.animation(n, () =>
|
|
1040
|
-
}), V.reset(s), V.action(s, (e, t) =>
|
|
1041
|
-
items: V.get(
|
|
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) => Ve?.(e, t), () => ({
|
|
1041
|
+
items: V.get(xt),
|
|
1042
1042
|
flipDurationMs: 80,
|
|
1043
1043
|
type: "doc",
|
|
1044
1044
|
dropTargetStyle: {},
|
|
@@ -1047,7 +1047,7 @@ function Gt(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(
|
|
1050
|
+
}, [() => V.clsx(F("min-h-[8px] space-y-0.5 transition-all duration-150", V.get(ze) && 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(L) && 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);
|
|
@@ -1061,59 +1061,59 @@ function Gt(e, i) {
|
|
|
1061
1061
|
V.get(O) && e(h);
|
|
1062
1062
|
}), V.reset(t), V.template_effect((e, t) => {
|
|
1063
1063
|
V.set_attribute(o, "aria-expanded", V.get(O)), V.set_class(o, 1, e), V.set_text(p, t);
|
|
1064
|
-
}, [() => V.clsx(
|
|
1065
|
-
V.get(
|
|
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(O) && hn($);
|
|
1066
1066
|
}), V.event("mouseleave", o, () => {
|
|
1067
|
-
V.get(
|
|
1068
|
-
}), V.event("dragover", o,
|
|
1067
|
+
V.get(I) && mn();
|
|
1068
|
+
}), V.event("dragover", o, Bn), V.event("drop", o, (e) => Vn(e, $)), V.append(e, t);
|
|
1069
1069
|
};
|
|
1070
|
-
V.if(
|
|
1071
|
-
V.get(
|
|
1070
|
+
V.if(Pr, (e) => {
|
|
1071
|
+
V.get(br) && e(Fr);
|
|
1072
1072
|
});
|
|
1073
|
-
var
|
|
1074
|
-
s(
|
|
1075
|
-
var
|
|
1076
|
-
V.reset(
|
|
1077
|
-
var
|
|
1078
|
-
l(
|
|
1073
|
+
var Ir = V.sibling(Pr, 2), Lr = V.child(Ir);
|
|
1074
|
+
s(Lr, { class: "size-3.5" });
|
|
1075
|
+
var Rr = V.sibling(Lr, 2), zr = V.child(Rr, !0);
|
|
1076
|
+
V.reset(Rr), V.reset(Ir), V.reset(wr);
|
|
1077
|
+
var Br = V.sibling(wr, 2);
|
|
1078
|
+
l(Br, {
|
|
1079
1079
|
mode: "create",
|
|
1080
|
-
onSave:
|
|
1080
|
+
onSave: Fn,
|
|
1081
1081
|
closeOnSave: !1,
|
|
1082
1082
|
get open() {
|
|
1083
|
-
return V.get(
|
|
1083
|
+
return V.get(Dt);
|
|
1084
1084
|
},
|
|
1085
1085
|
set open(e) {
|
|
1086
|
-
V.set(
|
|
1086
|
+
V.set(Dt, e, !0);
|
|
1087
1087
|
}
|
|
1088
1088
|
});
|
|
1089
|
-
var
|
|
1090
|
-
|
|
1089
|
+
var Vr = V.sibling(Br, 2);
|
|
1090
|
+
De(Vr, {
|
|
1091
1091
|
onOpenChange: (e) => {
|
|
1092
|
-
e ||
|
|
1092
|
+
e || ar();
|
|
1093
1093
|
},
|
|
1094
1094
|
get open() {
|
|
1095
|
-
return V.get(
|
|
1095
|
+
return V.get(Ft);
|
|
1096
1096
|
},
|
|
1097
1097
|
set open(e) {
|
|
1098
|
-
V.set(
|
|
1098
|
+
V.set(Ft, e, !0);
|
|
1099
1099
|
},
|
|
1100
1100
|
children: (e, t) => {
|
|
1101
|
-
var n =
|
|
1102
|
-
|
|
1101
|
+
var n = Wt(), r = V.first_child(n);
|
|
1102
|
+
ke(r, {
|
|
1103
1103
|
children: (e, t) => {
|
|
1104
|
-
var n =
|
|
1105
|
-
|
|
1104
|
+
var n = Nt(), r = V.first_child(n);
|
|
1105
|
+
Me(r, {
|
|
1106
1106
|
children: (e, t) => {
|
|
1107
1107
|
V.next();
|
|
1108
1108
|
var n = V.text();
|
|
1109
1109
|
V.template_effect((e) => V.set_text(n, e), [() => ce()]), 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(
|
|
1116
|
+
V.template_effect((e) => V.set_text(n, e), [() => V.get(Kt)?.kind === "folder" ? fe() : ue()]), V.append(e, n);
|
|
1117
1117
|
},
|
|
1118
1118
|
$$slots: { default: !0 }
|
|
1119
1119
|
}), V.append(e, n);
|
|
@@ -1121,19 +1121,19 @@ function Gt(e, i) {
|
|
|
1121
1121
|
$$slots: { default: !0 }
|
|
1122
1122
|
});
|
|
1123
1123
|
var i = V.sibling(r, 2), a = V.child(i), o = V.child(a);
|
|
1124
|
-
|
|
1124
|
+
Pe(o, {
|
|
1125
1125
|
for: "rename-input",
|
|
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(
|
|
1129
|
+
V.template_effect((e) => V.set_text(n, e), [() => V.get(Kt)?.kind === "folder" ? fe() : ue()]), V.append(e, n);
|
|
1130
1130
|
},
|
|
1131
1131
|
$$slots: { default: !0 }
|
|
1132
1132
|
});
|
|
1133
1133
|
var s = V.sibling(o, 2);
|
|
1134
1134
|
{
|
|
1135
1135
|
let e = V.derived(() => V.get(G) ? "true" : void 0), t = V.derived(() => V.get(G) ? "rename-input-error" : void 0);
|
|
1136
|
-
|
|
1136
|
+
Ne(s, {
|
|
1137
1137
|
id: "rename-input",
|
|
1138
1138
|
name: "name",
|
|
1139
1139
|
type: "text",
|
|
@@ -1150,26 +1150,26 @@ function Gt(e, i) {
|
|
|
1150
1150
|
},
|
|
1151
1151
|
autocomplete: "off",
|
|
1152
1152
|
get value() {
|
|
1153
|
-
return V.get(
|
|
1153
|
+
return V.get(qt);
|
|
1154
1154
|
},
|
|
1155
1155
|
set value(e) {
|
|
1156
|
-
V.set(
|
|
1156
|
+
V.set(qt, e, !0);
|
|
1157
1157
|
}
|
|
1158
1158
|
});
|
|
1159
1159
|
}
|
|
1160
1160
|
var c = V.sibling(s, 2), l = (e) => {
|
|
1161
|
-
var t =
|
|
1161
|
+
var t = Ut(), n = V.child(t, !0);
|
|
1162
1162
|
V.reset(t), V.template_effect(() => V.set_text(n, V.get(G))), V.append(e, t);
|
|
1163
1163
|
};
|
|
1164
1164
|
V.if(c, (e) => {
|
|
1165
1165
|
V.get(G) && e(l);
|
|
1166
|
-
}), V.reset(a), V.reset(i),
|
|
1166
|
+
}), V.reset(a), V.reset(i), je(V.sibling(i, 2), {
|
|
1167
1167
|
children: (e, t) => {
|
|
1168
|
-
var n =
|
|
1169
|
-
|
|
1168
|
+
var n = Nt(), r = V.first_child(n);
|
|
1169
|
+
Ae(r, {
|
|
1170
1170
|
variant: "outline",
|
|
1171
1171
|
type: "button",
|
|
1172
|
-
onclick:
|
|
1172
|
+
onclick: ar,
|
|
1173
1173
|
get disabled() {
|
|
1174
1174
|
return V.get(K);
|
|
1175
1175
|
},
|
|
@@ -1182,10 +1182,10 @@ function Gt(e, i) {
|
|
|
1182
1182
|
});
|
|
1183
1183
|
var i = V.sibling(r, 2);
|
|
1184
1184
|
{
|
|
1185
|
-
let e = V.derived(() => V.get(K) || V.get(
|
|
1186
|
-
|
|
1185
|
+
let e = V.derived(() => V.get(K) || V.get(qt).trim().length === 0);
|
|
1186
|
+
Ae(i, {
|
|
1187
1187
|
type: "submit",
|
|
1188
|
-
onclick:
|
|
1188
|
+
onclick: or,
|
|
1189
1189
|
get disabled() {
|
|
1190
1190
|
return V.get(e);
|
|
1191
1191
|
},
|
|
@@ -1200,14 +1200,14 @@ function Gt(e, i) {
|
|
|
1200
1200
|
V.append(e, n);
|
|
1201
1201
|
},
|
|
1202
1202
|
$$slots: { default: !0 }
|
|
1203
|
-
}), V.event("submit", i,
|
|
1203
|
+
}), V.event("submit", i, or), V.append(e, n);
|
|
1204
1204
|
},
|
|
1205
1205
|
$$slots: { default: !0 }
|
|
1206
1206
|
});
|
|
1207
|
-
var
|
|
1207
|
+
var Hr = V.sibling(Vr, 2);
|
|
1208
1208
|
{
|
|
1209
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." : de()), r = V.derived(() => V.get(q)?.kind === "folder" ? se() : ne()), i = V.derived(() => V.get(q)?.kind === "folder" ? ye() : y()), a = V.derived(() => pe()), o = V.derived(() => _e());
|
|
1210
|
-
|
|
1210
|
+
Ze(Hr, {
|
|
1211
1211
|
get targetName() {
|
|
1212
1212
|
return V.get(e);
|
|
1213
1213
|
},
|
|
@@ -1229,82 +1229,83 @@ function Gt(e, i) {
|
|
|
1229
1229
|
get cancelLabel() {
|
|
1230
1230
|
return V.get(o);
|
|
1231
1231
|
},
|
|
1232
|
-
onConfirm:
|
|
1233
|
-
onCancel:
|
|
1232
|
+
onConfirm: fr,
|
|
1233
|
+
onCancel: dr,
|
|
1234
1234
|
get open() {
|
|
1235
|
-
return V.get(
|
|
1235
|
+
return V.get(Jt);
|
|
1236
1236
|
},
|
|
1237
1237
|
set open(e) {
|
|
1238
|
-
V.set(
|
|
1238
|
+
V.set(Jt, e, !0);
|
|
1239
1239
|
}
|
|
1240
1240
|
});
|
|
1241
1241
|
}
|
|
1242
|
-
var
|
|
1242
|
+
var Ur = V.sibling(Hr, 2);
|
|
1243
1243
|
{
|
|
1244
1244
|
let e = V.derived(() => V.get(J) ?? void 0);
|
|
1245
|
-
|
|
1245
|
+
et(Ur, {
|
|
1246
1246
|
get mode() {
|
|
1247
|
-
return V.get(
|
|
1247
|
+
return V.get(rn);
|
|
1248
1248
|
},
|
|
1249
1249
|
get category() {
|
|
1250
1250
|
return V.get(e);
|
|
1251
1251
|
},
|
|
1252
|
-
onSave:
|
|
1253
|
-
onDelete:
|
|
1254
|
-
onClose:
|
|
1252
|
+
onSave: _r,
|
|
1253
|
+
onDelete: vr,
|
|
1254
|
+
onClose: gr,
|
|
1255
1255
|
get open() {
|
|
1256
|
-
return V.get(
|
|
1256
|
+
return V.get(nn);
|
|
1257
1257
|
},
|
|
1258
1258
|
set open(e) {
|
|
1259
|
-
V.set(
|
|
1259
|
+
V.set(nn, e, !0);
|
|
1260
1260
|
}
|
|
1261
1261
|
});
|
|
1262
1262
|
}
|
|
1263
|
-
return
|
|
1263
|
+
return $e(V.sibling(Ur, 2), {
|
|
1264
1264
|
get documentId() {
|
|
1265
|
-
return V.get(
|
|
1265
|
+
return V.get(Xt);
|
|
1266
1266
|
},
|
|
1267
1267
|
get documentTitle() {
|
|
1268
|
-
return V.get(
|
|
1268
|
+
return V.get(Qt);
|
|
1269
1269
|
},
|
|
1270
1270
|
get folderId() {
|
|
1271
|
-
return V.get(
|
|
1271
|
+
return V.get(Zt);
|
|
1272
1272
|
},
|
|
1273
1273
|
get folderName() {
|
|
1274
|
-
return V.get(
|
|
1274
|
+
return V.get($t);
|
|
1275
1275
|
},
|
|
1276
1276
|
get categoryId() {
|
|
1277
|
-
return V.get(
|
|
1277
|
+
return V.get(en);
|
|
1278
1278
|
},
|
|
1279
1279
|
get categoryName() {
|
|
1280
|
-
return V.get(
|
|
1280
|
+
return V.get(tn);
|
|
1281
1281
|
},
|
|
1282
1282
|
get open() {
|
|
1283
|
-
return V.get(
|
|
1283
|
+
return V.get(Yt);
|
|
1284
1284
|
},
|
|
1285
1285
|
set open(e) {
|
|
1286
|
-
V.set(
|
|
1286
|
+
V.set(Yt, e, !0);
|
|
1287
1287
|
}
|
|
1288
|
-
}), V.template_effect((e, t, n, r, i) => {
|
|
1289
|
-
V.set_attribute(
|
|
1288
|
+
}), V.template_effect((e, t, n, r, i, a) => {
|
|
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
|
+
() => we(d, "/"),
|
|
1291
1292
|
() => w(),
|
|
1292
1293
|
() => ie(),
|
|
1293
1294
|
() => xe(),
|
|
1294
1295
|
() => xe(),
|
|
1295
1296
|
() => be()
|
|
1296
|
-
]), V.delegated("click",
|
|
1297
|
+
]), V.delegated("click", Or, pr), V.event("consider", Nr, Zn), V.event("finalize", Nr, Qn), V.delegated("click", Ir, Mn), V.append(e, Cr), V.pop(Sr);
|
|
1297
1298
|
}
|
|
1298
1299
|
V.delegate(["click"]);
|
|
1299
1300
|
//#endregion
|
|
1300
1301
|
//#region src/lib/components/sidebar/RecentDocs.svelte
|
|
1301
|
-
var
|
|
1302
|
-
function
|
|
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
|
+
function Zt(e, n) {
|
|
1303
1304
|
V.push(n, !0);
|
|
1304
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 = V.state(""), y = V.state(null), b = V.state(!1), x = V.state(!1), w = V.state(null), E = V.state(!1);
|
|
1305
1306
|
async function D() {
|
|
1306
1307
|
try {
|
|
1307
|
-
let e = z(), t = await
|
|
1308
|
+
let e = z(), t = await Ge({
|
|
1308
1309
|
limit: 6,
|
|
1309
1310
|
...e ? { tag: e } : {}
|
|
1310
1311
|
}, r.fetch);
|
|
@@ -1313,10 +1314,10 @@ function Xt(e, n) {
|
|
|
1313
1314
|
console.error("RecentDocs: failed to load recent documents", e), V.set(s, "Failed to load recent documents");
|
|
1314
1315
|
}
|
|
1315
1316
|
}
|
|
1316
|
-
|
|
1317
|
+
Ct(() => {
|
|
1317
1318
|
D();
|
|
1318
1319
|
}), V.user_effect(() => {
|
|
1319
|
-
|
|
1320
|
+
_t() !== 0 && D();
|
|
1320
1321
|
});
|
|
1321
1322
|
let ne = !0;
|
|
1322
1323
|
V.user_effect(() => {
|
|
@@ -1329,7 +1330,7 @@ function Xt(e, n) {
|
|
|
1329
1330
|
async function re() {
|
|
1330
1331
|
await D();
|
|
1331
1332
|
}
|
|
1332
|
-
|
|
1333
|
+
St(() => {
|
|
1333
1334
|
d &&= (clearTimeout(d), null);
|
|
1334
1335
|
});
|
|
1335
1336
|
async function O(e, t) {
|
|
@@ -1337,13 +1338,13 @@ function Xt(e, n) {
|
|
|
1337
1338
|
let n = V.get(i).find((e) => e.id === t), a = "";
|
|
1338
1339
|
V.set(u, t, !0);
|
|
1339
1340
|
try {
|
|
1340
|
-
a = (await
|
|
1341
|
+
a = (await Ue(t, r.fetch)).content ?? "";
|
|
1341
1342
|
} catch (e) {
|
|
1342
1343
|
console.error("RecentDocs: failed to fetch full document for copy", e), a = n?.excerpt ?? n?.content ?? "";
|
|
1343
1344
|
} finally {
|
|
1344
1345
|
V.set(u, null);
|
|
1345
1346
|
}
|
|
1346
|
-
a && await
|
|
1347
|
+
a && await Qe(a) && (V.set(l, t, !0), d && clearTimeout(d), d = setTimeout(() => {
|
|
1347
1348
|
V.set(l, null), d = null;
|
|
1348
1349
|
}, 2e3));
|
|
1349
1350
|
}
|
|
@@ -1367,7 +1368,7 @@ function Xt(e, n) {
|
|
|
1367
1368
|
}
|
|
1368
1369
|
V.set(b, !0);
|
|
1369
1370
|
try {
|
|
1370
|
-
await
|
|
1371
|
+
await He(t.id, { title: n }, r.fetch), A(), await D(), ht();
|
|
1371
1372
|
} catch (e) {
|
|
1372
1373
|
console.error("RecentDocs: rename failed", e), V.set(y, e instanceof Error ? e.message : me(), !0);
|
|
1373
1374
|
} finally {
|
|
@@ -1388,16 +1389,16 @@ function Xt(e, n) {
|
|
|
1388
1389
|
if (!(!e || V.get(E))) {
|
|
1389
1390
|
V.set(E, !0);
|
|
1390
1391
|
try {
|
|
1391
|
-
await
|
|
1392
|
+
await We(e.id, r.fetch), j(), await D(), ht();
|
|
1392
1393
|
} catch (e) {
|
|
1393
1394
|
console.error("RecentDocs: delete failed", e), V.set(s, e instanceof Error ? e.message : me(), !0), V.set(E, !1);
|
|
1394
1395
|
}
|
|
1395
1396
|
}
|
|
1396
1397
|
}
|
|
1397
|
-
var se = { refreshRecentDocs: re }, N =
|
|
1398
|
+
var se = { refreshRecentDocs: re }, N = Xt(), fe = V.first_child(N), he = V.child(fe), ge = V.child(he, !0);
|
|
1398
1399
|
V.reset(he);
|
|
1399
1400
|
var P = V.sibling(he, 2), ve = (e) => {
|
|
1400
|
-
var t =
|
|
1401
|
+
var t = qt(), n = V.child(t, !0);
|
|
1401
1402
|
V.reset(t), V.template_effect(() => V.set_text(n, V.get(s))), V.append(e, t);
|
|
1402
1403
|
};
|
|
1403
1404
|
V.if(P, (e) => {
|
|
@@ -1405,7 +1406,7 @@ function Xt(e, n) {
|
|
|
1405
1406
|
});
|
|
1406
1407
|
var ye = V.sibling(P, 2);
|
|
1407
1408
|
V.each(ye, 17, () => V.get(i), (e) => e.id, (e, n) => {
|
|
1408
|
-
var r =
|
|
1409
|
+
var r = Jt(), i = V.child(r), s = V.child(i);
|
|
1409
1410
|
c(s, { class: "size-4 shrink-0 text-muted-foreground" });
|
|
1410
1411
|
var d = V.sibling(s, 2), f = V.child(d), p = V.child(f, !0);
|
|
1411
1412
|
V.reset(f);
|
|
@@ -1469,7 +1470,7 @@ function Xt(e, n) {
|
|
|
1469
1470
|
}), V.reset(r), V.template_effect((e, t, r) => {
|
|
1470
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(y, V.get(n).updatedAt), V.set_class(b, 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(b, "aria-label", t), V.set_attribute(b, "title", r), b.disabled = V.get(u) === V.get(n).id;
|
|
1471
1472
|
}, [
|
|
1472
|
-
() => V.clsx(
|
|
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")),
|
|
1473
1474
|
() => C(),
|
|
1474
1475
|
() => C()
|
|
1475
1476
|
]), V.delegated("click", i, () => {
|
|
@@ -1477,7 +1478,7 @@ function Xt(e, n) {
|
|
|
1477
1478
|
}), V.delegated("click", b, (e) => void O(e, V.get(n).id)), V.append(e, r);
|
|
1478
1479
|
}), V.reset(fe);
|
|
1479
1480
|
var be = V.sibling(fe, 2);
|
|
1480
|
-
|
|
1481
|
+
De(be, {
|
|
1481
1482
|
onOpenChange: (e) => {
|
|
1482
1483
|
e || A();
|
|
1483
1484
|
},
|
|
@@ -1488,18 +1489,18 @@ function Xt(e, n) {
|
|
|
1488
1489
|
V.set(f, e, !0);
|
|
1489
1490
|
},
|
|
1490
1491
|
children: (e, t) => {
|
|
1491
|
-
var n =
|
|
1492
|
-
|
|
1492
|
+
var n = Yt(), r = V.first_child(n);
|
|
1493
|
+
ke(r, {
|
|
1493
1494
|
children: (e, t) => {
|
|
1494
1495
|
var n = K(), r = V.first_child(n);
|
|
1495
|
-
|
|
1496
|
+
Me(r, {
|
|
1496
1497
|
children: (e, t) => {
|
|
1497
1498
|
V.next();
|
|
1498
1499
|
var n = V.text();
|
|
1499
1500
|
V.template_effect((e) => V.set_text(n, e), [() => ce()]), V.append(e, n);
|
|
1500
1501
|
},
|
|
1501
1502
|
$$slots: { default: !0 }
|
|
1502
|
-
}),
|
|
1503
|
+
}), Oe(V.sibling(r, 2), {
|
|
1503
1504
|
children: (e, t) => {
|
|
1504
1505
|
V.next();
|
|
1505
1506
|
var n = V.text();
|
|
@@ -1511,7 +1512,7 @@ function Xt(e, n) {
|
|
|
1511
1512
|
$$slots: { default: !0 }
|
|
1512
1513
|
});
|
|
1513
1514
|
var i = V.sibling(r, 2), a = V.child(i), o = V.child(a);
|
|
1514
|
-
|
|
1515
|
+
Pe(o, {
|
|
1515
1516
|
for: "recent-rename-input",
|
|
1516
1517
|
children: (e, t) => {
|
|
1517
1518
|
V.next();
|
|
@@ -1523,7 +1524,7 @@ function Xt(e, n) {
|
|
|
1523
1524
|
var s = V.sibling(o, 2);
|
|
1524
1525
|
{
|
|
1525
1526
|
let e = V.derived(() => V.get(y) ? "true" : void 0), t = V.derived(() => V.get(y) ? "recent-rename-input-error" : void 0);
|
|
1526
|
-
|
|
1527
|
+
Ne(s, {
|
|
1527
1528
|
id: "recent-rename-input",
|
|
1528
1529
|
name: "name",
|
|
1529
1530
|
type: "text",
|
|
@@ -1553,10 +1554,10 @@ function Xt(e, n) {
|
|
|
1553
1554
|
};
|
|
1554
1555
|
V.if(c, (e) => {
|
|
1555
1556
|
V.get(y) && e(l);
|
|
1556
|
-
}), V.reset(a), V.reset(i),
|
|
1557
|
+
}), V.reset(a), V.reset(i), je(V.sibling(i, 2), {
|
|
1557
1558
|
children: (e, t) => {
|
|
1558
1559
|
var n = K(), r = V.first_child(n);
|
|
1559
|
-
|
|
1560
|
+
Ae(r, {
|
|
1560
1561
|
variant: "outline",
|
|
1561
1562
|
type: "button",
|
|
1562
1563
|
onclick: A,
|
|
@@ -1573,7 +1574,7 @@ function Xt(e, n) {
|
|
|
1573
1574
|
var i = V.sibling(r, 2);
|
|
1574
1575
|
{
|
|
1575
1576
|
let e = V.derived(() => V.get(b) || V.get(v).trim().length === 0);
|
|
1576
|
-
|
|
1577
|
+
Ae(i, {
|
|
1577
1578
|
type: "submit",
|
|
1578
1579
|
onclick: ie,
|
|
1579
1580
|
get disabled() {
|
|
@@ -1597,7 +1598,7 @@ function Xt(e, n) {
|
|
|
1597
1598
|
var xe = V.sibling(be, 2);
|
|
1598
1599
|
{
|
|
1599
1600
|
let e = V.derived(() => Se()), t = V.derived(() => de()), n = V.derived(() => pe()), r = V.derived(() => _e());
|
|
1600
|
-
|
|
1601
|
+
vt(xe, {
|
|
1601
1602
|
get title() {
|
|
1602
1603
|
return V.get(e);
|
|
1603
1604
|
},
|
|
@@ -1629,18 +1630,18 @@ function Xt(e, n) {
|
|
|
1629
1630
|
V.delegate(["click"]);
|
|
1630
1631
|
//#endregion
|
|
1631
1632
|
//#region src/lib/components/sidebar/TagList.svelte
|
|
1632
|
-
var
|
|
1633
|
-
function
|
|
1633
|
+
var Qt = V.from_html("<p class=\"px-2 text-xs text-destructive\"> </p>"), $t = V.from_html("<button><!></button>"), en = V.from_html("<!> <!>", 1), tn = V.from_html("<div><button type=\"button\" class=\"inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium\"><span class=\"size-2.5 shrink-0 rounded-full\"></span> </button> <!></div>"), nn = 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 class=\"flex flex-wrap gap-1 px-2\"><!> <button type=\"button\" class=\"inline-flex items-center gap-0.5 rounded-full px-2 py-0.5 text-xs text-muted-foreground transition-colors hover:bg-secondary hover:text-secondary-foreground\"><!> </button></div></div> <!> <!>", 1);
|
|
1634
|
+
function rn(e, t) {
|
|
1634
1635
|
V.push(t, !0);
|
|
1635
1636
|
let n = Ce(), r = V.state(V.proxy([])), i = V.state(null), a = V.state(!1), o = V.state(null), c = V.state(!1), l = V.state(null), u = V.state(!1);
|
|
1636
1637
|
async function d() {
|
|
1637
1638
|
try {
|
|
1638
|
-
V.set(r, await
|
|
1639
|
+
V.set(r, await bt(n.fetch), !0);
|
|
1639
1640
|
} catch (e) {
|
|
1640
1641
|
console.error("TagList: failed to load tags", e), V.set(i, A(), !0);
|
|
1641
1642
|
}
|
|
1642
1643
|
}
|
|
1643
|
-
|
|
1644
|
+
Ct(() => {
|
|
1644
1645
|
d();
|
|
1645
1646
|
}), V.user_effect(() => {
|
|
1646
1647
|
R(), d();
|
|
@@ -1668,7 +1669,7 @@ function nn(e, t) {
|
|
|
1668
1669
|
if (!(!e || V.get(u))) {
|
|
1669
1670
|
V.set(u, !0);
|
|
1670
1671
|
try {
|
|
1671
|
-
await
|
|
1672
|
+
await yt(e.id, n.fetch), V.set(r, V.get(r).filter((t) => t.id !== e.id), !0), z() === e.id && gt(null), V.set(c, !1), V.set(l, null), B();
|
|
1672
1673
|
} catch (e) {
|
|
1673
1674
|
console.error("TagList: deleteTag failed", e), V.set(i, me(), !0);
|
|
1674
1675
|
} finally {
|
|
@@ -1676,10 +1677,10 @@ function nn(e, t) {
|
|
|
1676
1677
|
}
|
|
1677
1678
|
}
|
|
1678
1679
|
}
|
|
1679
|
-
var E =
|
|
1680
|
+
var E = nn(), D = V.first_child(E), ne = V.child(D), re = V.child(ne, !0);
|
|
1680
1681
|
V.reset(ne);
|
|
1681
1682
|
var k = V.sibling(ne, 2), ie = (e) => {
|
|
1682
|
-
var t =
|
|
1683
|
+
var t = Qt(), n = V.child(t, !0);
|
|
1683
1684
|
V.reset(t), V.template_effect(() => V.set_text(n, V.get(i))), V.append(e, t);
|
|
1684
1685
|
};
|
|
1685
1686
|
V.if(k, (e) => {
|
|
@@ -1687,14 +1688,14 @@ function nn(e, t) {
|
|
|
1687
1688
|
});
|
|
1688
1689
|
var ae = V.sibling(k, 2), j = V.child(ae);
|
|
1689
1690
|
V.each(j, 17, () => V.get(r), (e) => e.id, (e, t) => {
|
|
1690
|
-
var n =
|
|
1691
|
+
var n = tn(), r = V.child(n), i = V.child(r), a = V.sibling(i);
|
|
1691
1692
|
V.reset(r), m(V.sibling(r, 2), {
|
|
1692
1693
|
children: (e, n) => {
|
|
1693
|
-
var r =
|
|
1694
|
+
var r = en(), i = V.first_child(r);
|
|
1694
1695
|
ee(i, {
|
|
1695
1696
|
child: (e, n) => {
|
|
1696
1697
|
let r = () => (n?.()).props;
|
|
1697
|
-
var i =
|
|
1698
|
+
var i = $t();
|
|
1698
1699
|
V.attribute_effect(i, (e, t, n) => ({
|
|
1699
1700
|
...r(),
|
|
1700
1701
|
type: "button",
|
|
@@ -1703,7 +1704,7 @@ function nn(e, t) {
|
|
|
1703
1704
|
title: n,
|
|
1704
1705
|
disabled: V.get(u)
|
|
1705
1706
|
}), [
|
|
1706
|
-
() =>
|
|
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"),
|
|
1707
1708
|
() => T(),
|
|
1708
1709
|
() => T()
|
|
1709
1710
|
]);
|
|
@@ -1720,7 +1721,7 @@ function nn(e, t) {
|
|
|
1720
1721
|
}), h(V.sibling(i, 2), {
|
|
1721
1722
|
align: "start",
|
|
1722
1723
|
children: (e, n) => {
|
|
1723
|
-
var r =
|
|
1724
|
+
var r = en(), i = V.first_child(r);
|
|
1724
1725
|
_(i, {
|
|
1725
1726
|
onSelect: () => y(V.get(t)),
|
|
1726
1727
|
children: (e, t) => {
|
|
@@ -1746,7 +1747,7 @@ function nn(e, t) {
|
|
|
1746
1747
|
$$slots: { default: !0 }
|
|
1747
1748
|
}), V.reset(n), V.template_effect((e, o) => {
|
|
1748
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 ?? ""}`);
|
|
1749
|
-
}, [() => V.clsx(
|
|
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);
|
|
1750
1751
|
});
|
|
1751
1752
|
var oe = V.sibling(j, 2), M = V.child(oe);
|
|
1752
1753
|
s(M, { class: "size-3" });
|
|
@@ -1755,7 +1756,7 @@ function nn(e, t) {
|
|
|
1755
1756
|
var ce = V.sibling(D, 2);
|
|
1756
1757
|
{
|
|
1757
1758
|
let e = V.derived(() => V.get(o) ? "edit" : "create");
|
|
1758
|
-
|
|
1759
|
+
xt(ce, {
|
|
1759
1760
|
get mode() {
|
|
1760
1761
|
return V.get(e);
|
|
1761
1762
|
},
|
|
@@ -1776,7 +1777,7 @@ function nn(e, t) {
|
|
|
1776
1777
|
var le = V.sibling(ce, 2);
|
|
1777
1778
|
{
|
|
1778
1779
|
let e = V.derived(() => N()), t = V.derived(() => v()), n = V.derived(() => pe()), r = V.derived(() => _e());
|
|
1779
|
-
|
|
1780
|
+
vt(le, {
|
|
1780
1781
|
get title() {
|
|
1781
1782
|
return V.get(e);
|
|
1782
1783
|
},
|
|
@@ -1816,11 +1817,16 @@ function nn(e, t) {
|
|
|
1816
1817
|
V.delegate(["click"]);
|
|
1817
1818
|
//#endregion
|
|
1818
1819
|
//#region src/lib/components/sidebar/Sidebar.svelte
|
|
1819
|
-
var J = V.from_html("<div role=\"separator\" tabindex=\"-1\"></div>"),
|
|
1820
|
-
function
|
|
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> <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>"), mn = V.from_html("<aside tabindex=\"-1\"><!> <!> <!> <div class=\"border-t border-border p-2\"><!></div></aside> <!>", 1);
|
|
1821
|
+
function hn(e, t) {
|
|
1821
1822
|
V.push(t, !0);
|
|
1822
|
-
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 =
|
|
1823
|
-
|
|
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)), g = V.state(256), _ = V.state(!1), ee = I(), te = V.derived(() => ze(ee.sidebarTop, { pathname: H.url.pathname })), v = V.derived(() => ze(ee.navigation, { pathname: H.url.pathname }));
|
|
1824
|
+
Ct(() => {
|
|
1825
|
+
let e = () => {
|
|
1826
|
+
L(), ht();
|
|
1827
|
+
};
|
|
1828
|
+
return window.addEventListener("hiai-docs:documents-updated", e), () => window.removeEventListener("hiai-docs:documents-updated", e);
|
|
1829
|
+
}), V.user_effect(() => {
|
|
1824
1830
|
if (typeof window < "u") {
|
|
1825
1831
|
try {
|
|
1826
1832
|
V.set(l, localStorage.getItem(s) === "1");
|
|
@@ -1847,7 +1853,7 @@ function mn(e, t) {
|
|
|
1847
1853
|
V.set(_, !1), localStorage.setItem("hiai_sidebar_width", V.get(g).toString());
|
|
1848
1854
|
}
|
|
1849
1855
|
function T() {
|
|
1850
|
-
return
|
|
1856
|
+
return Te(c, "/search");
|
|
1851
1857
|
}
|
|
1852
1858
|
function E(e) {
|
|
1853
1859
|
V.set(m, V.get(m) === e ? "all" : e, !0), V.set(l, !1), re();
|
|
@@ -1860,18 +1866,18 @@ function mn(e, t) {
|
|
|
1860
1866
|
localStorage.setItem(s, V.get(l) ? "1" : "0");
|
|
1861
1867
|
} catch {}
|
|
1862
1868
|
}
|
|
1863
|
-
var O =
|
|
1869
|
+
var O = mn(), k = V.first_child(O), A = V.child(k), ae = (e) => {
|
|
1864
1870
|
var t = J();
|
|
1865
|
-
V.template_effect((e) => V.set_class(t, 1, e), [() => V.clsx(
|
|
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(_) && "bg-primary w-1"))]), V.delegated("mousedown", t, y), V.append(e, t);
|
|
1866
1872
|
};
|
|
1867
1873
|
V.if(A, (e) => {
|
|
1868
1874
|
!n() && !V.get(h) && e(ae);
|
|
1869
1875
|
});
|
|
1870
1876
|
var j = V.sibling(A, 2), oe = (e) => {
|
|
1871
|
-
var t =
|
|
1877
|
+
var t = an(), n = V.child(t), r = (e) => {
|
|
1872
1878
|
U(e, { class: "size-3.5" });
|
|
1873
1879
|
}, i = (e) => {
|
|
1874
|
-
|
|
1880
|
+
Et(e, { class: "size-3.5" });
|
|
1875
1881
|
};
|
|
1876
1882
|
V.if(n, (e) => {
|
|
1877
1883
|
V.get(h) ? e(r) : e(i, -1);
|
|
@@ -1881,7 +1887,7 @@ function mn(e, t) {
|
|
|
1881
1887
|
n() || e(oe);
|
|
1882
1888
|
});
|
|
1883
1889
|
var se = V.sibling(j, 2), N = (e) => {
|
|
1884
|
-
var t =
|
|
1890
|
+
var t = cn(), n = V.child(t);
|
|
1885
1891
|
V.each(n, 17, () => V.get(te), (e) => e.id, (e, t) => {
|
|
1886
1892
|
let n = V.derived(() => V.get(t).component);
|
|
1887
1893
|
var r = V.comment(), i = V.first_child(r);
|
|
@@ -1890,29 +1896,29 @@ function mn(e, t) {
|
|
|
1890
1896
|
}), V.append(e, r);
|
|
1891
1897
|
});
|
|
1892
1898
|
var r = V.sibling(n, 2);
|
|
1893
|
-
|
|
1899
|
+
kt(r, { class: "mr-5" });
|
|
1894
1900
|
var i = V.sibling(r, 2), a = (e) => {
|
|
1895
1901
|
var t = Y();
|
|
1896
|
-
|
|
1902
|
+
Kt(V.first_child(t), {}), V.next(2), V.append(e, t);
|
|
1897
1903
|
};
|
|
1898
1904
|
V.if(i, (e) => {
|
|
1899
1905
|
V.get(m) === "all" && e(a);
|
|
1900
1906
|
});
|
|
1901
1907
|
var o = V.sibling(i, 2), s = (e) => {
|
|
1902
1908
|
var t = Y();
|
|
1903
|
-
|
|
1909
|
+
Zt(V.first_child(t), {}), V.next(2), V.append(e, t);
|
|
1904
1910
|
};
|
|
1905
1911
|
V.if(o, (e) => {
|
|
1906
1912
|
(V.get(m) === "all" || V.get(m) === "recent") && e(s);
|
|
1907
1913
|
});
|
|
1908
1914
|
var l = V.sibling(o, 2), u = (e) => {
|
|
1909
|
-
|
|
1915
|
+
rn(e, {});
|
|
1910
1916
|
};
|
|
1911
1917
|
V.if(l, (e) => {
|
|
1912
1918
|
(V.get(m) === "all" || V.get(m) === "tags") && e(u);
|
|
1913
1919
|
});
|
|
1914
1920
|
var d = V.sibling(l, 2), f = (e) => {
|
|
1915
|
-
var t =
|
|
1921
|
+
var t = sn(), n = V.sibling(V.first_child(t), 2);
|
|
1916
1922
|
V.each(n, 21, () => V.get(v), (e) => e.id, (e, t) => {
|
|
1917
1923
|
let n = V.derived(() => V.get(t).icon);
|
|
1918
1924
|
var r = X(), i = V.child(r), a = (e) => {
|
|
@@ -1927,21 +1933,21 @@ function mn(e, t) {
|
|
|
1927
1933
|
var o = V.sibling(i, 2), s = V.child(o, !0);
|
|
1928
1934
|
V.reset(o);
|
|
1929
1935
|
var l = V.sibling(o, 2), u = (e) => {
|
|
1930
|
-
var n =
|
|
1936
|
+
var n = on(), r = V.child(n, !0);
|
|
1931
1937
|
V.reset(n), V.template_effect(() => V.set_text(r, V.get(t).badge)), V.append(e, n);
|
|
1932
1938
|
};
|
|
1933
1939
|
V.if(l, (e) => {
|
|
1934
1940
|
V.get(t).badge !== void 0 && e(u);
|
|
1935
1941
|
}), V.reset(r), V.template_effect((e) => {
|
|
1936
1942
|
V.set_attribute(r, "href", e), V.set_attribute(r, "aria-disabled", V.get(t).disabled), V.set_text(s, V.get(t).label);
|
|
1937
|
-
}, [() => V.get(t).href ?
|
|
1943
|
+
}, [() => V.get(t).href ? we(c, V.get(t).href) : "#"]), V.append(e, r);
|
|
1938
1944
|
}), V.reset(n), V.append(e, t);
|
|
1939
1945
|
};
|
|
1940
1946
|
V.if(d, (e) => {
|
|
1941
1947
|
V.get(m) === "all" && V.get(v).length > 0 && e(f);
|
|
1942
1948
|
}), V.reset(t), V.append(e, t);
|
|
1943
1949
|
}, ce = (e) => {
|
|
1944
|
-
var t =
|
|
1950
|
+
var t = dn(), n = V.child(t);
|
|
1945
1951
|
V.each(n, 17, () => V.get(te), (e) => e.id, (e, t) => {
|
|
1946
1952
|
let n = V.derived(() => V.get(t).component);
|
|
1947
1953
|
var r = V.comment(), i = V.first_child(r);
|
|
@@ -1960,20 +1966,20 @@ function mn(e, t) {
|
|
|
1960
1966
|
var u = V.sibling(l, 2);
|
|
1961
1967
|
V.each(u, 17, () => V.get(v), (e) => e.id, (e, t) => {
|
|
1962
1968
|
let n = V.derived(() => V.get(t).icon);
|
|
1963
|
-
var r =
|
|
1969
|
+
var r = un(), i = V.child(r), a = (e) => {
|
|
1964
1970
|
var t = V.comment(), r = V.first_child(t);
|
|
1965
1971
|
V.component(r, () => V.get(n), (e, t) => {
|
|
1966
1972
|
t(e, { class: "size-4" });
|
|
1967
1973
|
}), V.append(e, t);
|
|
1968
1974
|
}, o = (e) => {
|
|
1969
|
-
var n =
|
|
1975
|
+
var n = ln(), r = V.child(n, !0);
|
|
1970
1976
|
V.reset(n), V.template_effect((e) => V.set_text(r, e), [() => V.get(t).label.slice(0, 1)]), V.append(e, n);
|
|
1971
1977
|
};
|
|
1972
1978
|
V.if(i, (e) => {
|
|
1973
1979
|
V.get(n) ? e(a) : e(o, -1);
|
|
1974
1980
|
}), V.reset(r), V.template_effect((e) => {
|
|
1975
1981
|
V.set_attribute(r, "href", e), V.set_attribute(r, "aria-disabled", V.get(t).disabled), V.set_attribute(r, "title", V.get(t).label), V.set_attribute(r, "aria-label", V.get(t).label);
|
|
1976
|
-
}, [() => V.get(t).href ?
|
|
1982
|
+
}, [() => V.get(t).href ? we(c, V.get(t).href) : "#"]), V.append(e, r);
|
|
1977
1983
|
}), V.reset(t), V.template_effect((e, t, n, i, a, c, u, d) => {
|
|
1978
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);
|
|
1979
1985
|
}, [
|
|
@@ -1985,13 +1991,13 @@ function mn(e, t) {
|
|
|
1985
1991
|
() => S(),
|
|
1986
1992
|
() => b(),
|
|
1987
1993
|
() => b()
|
|
1988
|
-
]), V.delegated("click", r, () =>
|
|
1994
|
+
]), V.delegated("click", r, () => Te(c, "/")), V.delegated("click", o, T), V.delegated("click", s, () => E("recent")), V.delegated("click", l, () => E("tags")), V.append(e, t);
|
|
1989
1995
|
};
|
|
1990
1996
|
V.if(se, (e) => {
|
|
1991
1997
|
V.get(h) ? e(ce, -1) : e(N);
|
|
1992
1998
|
});
|
|
1993
1999
|
var le = V.sibling(se, 2), ue = V.child(le), de = (e) => {
|
|
1994
|
-
var t =
|
|
2000
|
+
var t = fn(), n = V.child(t);
|
|
1995
2001
|
W(V.child(n), { class: "size-4" }), V.reset(n);
|
|
1996
2002
|
var r = V.sibling(n, 2);
|
|
1997
2003
|
V.reset(t), V.template_effect((e, t, i, a) => {
|
|
@@ -2005,7 +2011,7 @@ function mn(e, t) {
|
|
|
2005
2011
|
V.set(p, !0);
|
|
2006
2012
|
}), V.append(e, t);
|
|
2007
2013
|
}, fe = (e) => {
|
|
2008
|
-
var t =
|
|
2014
|
+
var t = pn(), n = V.child(t), r = V.child(n, !0);
|
|
2009
2015
|
V.reset(n);
|
|
2010
2016
|
var i = V.sibling(n, 2);
|
|
2011
2017
|
W(V.child(i), { class: "size-4" }), V.reset(i), V.reset(t), V.template_effect((e, t, a, o) => {
|
|
@@ -2030,8 +2036,8 @@ function mn(e, t) {
|
|
|
2030
2036
|
}
|
|
2031
2037
|
}), V.template_effect((e) => {
|
|
2032
2038
|
V.set_attribute(k, "id", n() ? "mobile-navigation" : void 0), V.set_attribute(k, "role", n() && r() ? "dialog" : void 0), V.set_attribute(k, "aria-modal", n() && r() ? "true" : void 0), V.set_attribute(k, "aria-label", n() ? "Navigation" : void 0), V.set_attribute(k, "aria-hidden", n() && !r() ? "true" : void 0), k.inert = n() && !r(), V.set_class(k, 1, e), V.set_style(k, n() ? "padding-top: env(safe-area-inset-top);" : V.get(h) ? "width: 48px;" : `width: ${V.get(g)}px;`);
|
|
2033
|
-
}, [() => V.clsx(
|
|
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(_) && "transition-[width] duration-200"))]), V.append(e, O), V.pop();
|
|
2034
2040
|
}
|
|
2035
2041
|
V.delegate(["mousedown", "click"]);
|
|
2036
2042
|
//#endregion
|
|
2037
|
-
export {
|
|
2043
|
+
export { hn as t };
|