@hiai-gg/docsmint 2.2.1 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/backend/index.js +2 -2
- package/dist/frontend/FolderNode-Ds0LDfK3.js +290 -0
- package/dist/frontend/Sidebar-DerKtpWB.js +2168 -0
- package/dist/frontend/app-shell.js +1 -1
- package/dist/frontend/components/folder-node.js +1 -1
- package/dist/frontend/components/sidebar.js +1 -1
- package/dist/frontend/{dndzone-C62yjeG3.js → dndzone-B9jA0yIS.js} +21 -9
- package/dist/frontend/utils/dndzone.js +1 -1
- package/dist/frontend-ssr/app-shell.js +1 -1
- package/dist/frontend-ssr/assets/{FolderNode-Dg_5-orQ.js → FolderNode-CyOrLJ2Y.js} +6 -9
- package/dist/frontend-ssr/assets/{Sidebar-fpYk5MGO.js → Sidebar-dTp4DyW4.js} +164 -85
- package/dist/frontend-ssr/assets/{dndzone-Dx3jt_e4.js → dndzone-C7KnICM0.js} +22 -4
- package/dist/frontend-ssr/components/folder-node.js +1 -1
- package/dist/frontend-ssr/components/sidebar.js +1 -1
- package/dist/frontend-ssr/utils/dndzone.js +1 -1
- package/dist/mcp-cli.js +1 -1
- package/dist/mcp-server.js +1 -1
- package/package.json +1 -1
- package/packages/cli/src/index.ts +1 -1
- package/server.json +2 -2
- package/dist/frontend/FolderNode-Y7cV9xeX.js +0 -307
- package/dist/frontend/Sidebar-i0kbanpg.js +0 -2123
|
@@ -0,0 +1,2168 @@
|
|
|
1
|
+
import { t as e } from "./clock-dcpueRk-.js";
|
|
2
|
+
import { n as t, t as n } from "./folder-BpmB_sAy.js";
|
|
3
|
+
import { t as r } from "./Icon-CiHcxcpv.js";
|
|
4
|
+
import { n as i, t as a } from "./tag-Wdfe0rKU.js";
|
|
5
|
+
import { t as o } from "./x-CBUgPygC.js";
|
|
6
|
+
import { a as s, i as c, n as l, t as u } from "./route-context-6OHiGtfb.js";
|
|
7
|
+
import { t as d } from "./utils-CnAmIMwr.js";
|
|
8
|
+
import { t as f } from "./SettingsDialog-BvS74JZu.js";
|
|
9
|
+
import { a as p, i as m, n as h, o as g, r as _, s as v, t as y } from "./dialog-C0Bpok1d.js";
|
|
10
|
+
import { a as b, i as x, r as S, t as ee } from "./dropdown-menu-B3nk2aM-.js";
|
|
11
|
+
import { t as te } from "./input-CbeB9220.js";
|
|
12
|
+
import { t as ne } from "./label-CfBWf3gI.js";
|
|
13
|
+
import { t as re } from "./action_cancel-BdsWzQKU.js";
|
|
14
|
+
import { a as C, i as ie, n as w, t as T } from "./sidebar_uncategorized-C5PGOflV.js";
|
|
15
|
+
import { t as E } from "./action_delete-SRloglWY.js";
|
|
16
|
+
import { _ as D, a as ae, c as O, d as k, f as A, g as oe, h as se, i as j, l as ce, m as le, n as M, o as N, p as ue, r as P, s as de, t as F, u as fe, v as pe } from "./tags_load_error-BINNpPPV.js";
|
|
17
|
+
import { t as me } from "./action_go_to-DO1bicF-.js";
|
|
18
|
+
import { t as he } from "./action_loading-iQ0KsN6i.js";
|
|
19
|
+
import { t as ge } from "./action_save-DeqrZQwV.js";
|
|
20
|
+
import { i as I } from "./theme_system-YIfa_2Xt.js";
|
|
21
|
+
import { a as _e, i as L, n as ve, o as ye, t as be } from "./folders_rename-Cxbg5GIw.js";
|
|
22
|
+
import { t as xe } from "./doc_title_label-BOuZzvqv.js";
|
|
23
|
+
import { t as Se } from "./error_generic-BlWqOE-a.js";
|
|
24
|
+
import { n as R, t as z } from "./search_title-BETwQYJq.js";
|
|
25
|
+
import { t as B } from "./tags_new-Dw0Uy43-.js";
|
|
26
|
+
import { t as Ce } from "./check-DiMZRkKS.js";
|
|
27
|
+
import { t as we } from "./chevron-down-CxFrMFDJ.js";
|
|
28
|
+
import { t as Te } from "./copy-Bag46YaR.js";
|
|
29
|
+
import { a as Ee, i as De, r as Oe, t as ke } from "./share-context-C2xyVP9M.js";
|
|
30
|
+
import { t as Ae } from "./loader-circle-skKwfRCB.js";
|
|
31
|
+
import { t as je } from "./ellipsis-vertical-Oymsv1R4.js";
|
|
32
|
+
import { a as Me, i as Ne, n as Pe, r as Fe, t as Ie } from "./dndzone-B9jA0yIS.js";
|
|
33
|
+
import { i as Le, r as Re, s as ze } from "./categories-CusvHb5Y.js";
|
|
34
|
+
import { n as Be } from "./client-BDdDd84W.js";
|
|
35
|
+
import { c as Ve, i as He, r as Ue, s as We, t as Ge } from "./documents-CDJb8dv-.js";
|
|
36
|
+
import { t as V } from "./ConfirmDialog-0JwB8mKN.js";
|
|
37
|
+
import { c as Ke, r as qe, s as Je, t as Ye } from "./folders-DgKSovXa.js";
|
|
38
|
+
import { t as Xe } from "./DeleteDialog-s7Dr6bXg.js";
|
|
39
|
+
import { t as Ze } from "./ShareDialog-Bo50h_Oe.js";
|
|
40
|
+
import { t as Qe } from "./CategoryDialog-CVJi5PJu.js";
|
|
41
|
+
import { n as $e, t as et } from "./document-drop-coordinator-C_o93kKW.js";
|
|
42
|
+
import { t as tt } from "./FolderNode-Ds0LDfK3.js";
|
|
43
|
+
import { a as nt, c as rt, d as it, f as at, i as ot, n as st, o as ct, p as lt, r as ut, s as dt, t as ft, u as pt } from "./subfolders-refresh-store.svelte-CeyqvNpu.js";
|
|
44
|
+
import { a as mt, i as ht, n as H, o as gt, s as _t, t as vt } from "./tag-store.svelte-C9VYWqLQ.js";
|
|
45
|
+
import { t as yt } from "./clipboard-Dt1oW6nm.js";
|
|
46
|
+
import "./dist-Dl9qg10h.js";
|
|
47
|
+
import { i as bt, o as xt } from "./tags-DlDVothf.js";
|
|
48
|
+
import { t as St } from "./TagCreateDialog-DhKfsfv3.js";
|
|
49
|
+
import { t as Ct } from "./context-BguSRnCt.js";
|
|
50
|
+
import { t as wt } from "./resolve-DbT-KhGZ.js";
|
|
51
|
+
import "svelte/internal/disclose-version";
|
|
52
|
+
import * as U from "svelte/internal/client";
|
|
53
|
+
import { onDestroy as Tt, onMount as Et, untrack as Dt } from "svelte";
|
|
54
|
+
import "svelte/internal/flags/legacy";
|
|
55
|
+
import { page as W } from "$app/state";
|
|
56
|
+
import { flip as Ot } from "svelte/animate";
|
|
57
|
+
// ../node_modules/.bun/lucide-svelte@1.0.1+5d720e49779a0e36/node_modules/lucide-svelte/dist/icons/panel-left-close.svelte
|
|
58
|
+
function G(e, t) {
|
|
59
|
+
let n = U.legacy_rest_props(t, [
|
|
60
|
+
"children",
|
|
61
|
+
"$$slots",
|
|
62
|
+
"$$events",
|
|
63
|
+
"$$legacy"
|
|
64
|
+
]), i = [
|
|
65
|
+
["rect", {
|
|
66
|
+
width: "18",
|
|
67
|
+
height: "18",
|
|
68
|
+
x: "3",
|
|
69
|
+
y: "3",
|
|
70
|
+
rx: "2"
|
|
71
|
+
}],
|
|
72
|
+
["path", { d: "M9 3v18" }],
|
|
73
|
+
["path", { d: "m16 15-3-3 3-3" }]
|
|
74
|
+
];
|
|
75
|
+
r(e, U.spread_props({ name: "panel-left-close" }, () => n, {
|
|
76
|
+
get iconNode() {
|
|
77
|
+
return i;
|
|
78
|
+
},
|
|
79
|
+
children: (e, n) => {
|
|
80
|
+
var r = U.comment(), i = U.first_child(r);
|
|
81
|
+
U.slot(i, t, "default", {}, null), U.append(e, r);
|
|
82
|
+
},
|
|
83
|
+
$$slots: { default: !0 }
|
|
84
|
+
}));
|
|
85
|
+
}
|
|
86
|
+
// ../node_modules/.bun/lucide-svelte@1.0.1+5d720e49779a0e36/node_modules/lucide-svelte/dist/icons/panel-left-open.svelte
|
|
87
|
+
function K(e, t) {
|
|
88
|
+
let n = U.legacy_rest_props(t, [
|
|
89
|
+
"children",
|
|
90
|
+
"$$slots",
|
|
91
|
+
"$$events",
|
|
92
|
+
"$$legacy"
|
|
93
|
+
]), i = [
|
|
94
|
+
["rect", {
|
|
95
|
+
width: "18",
|
|
96
|
+
height: "18",
|
|
97
|
+
x: "3",
|
|
98
|
+
y: "3",
|
|
99
|
+
rx: "2"
|
|
100
|
+
}],
|
|
101
|
+
["path", { d: "M9 3v18" }],
|
|
102
|
+
["path", { d: "m14 9 3 3-3 3" }]
|
|
103
|
+
];
|
|
104
|
+
r(e, U.spread_props({ name: "panel-left-open" }, () => n, {
|
|
105
|
+
get iconNode() {
|
|
106
|
+
return i;
|
|
107
|
+
},
|
|
108
|
+
children: (e, n) => {
|
|
109
|
+
var r = U.comment(), i = U.first_child(r);
|
|
110
|
+
U.slot(i, t, "default", {}, null), U.append(e, r);
|
|
111
|
+
},
|
|
112
|
+
$$slots: { default: !0 }
|
|
113
|
+
}));
|
|
114
|
+
}
|
|
115
|
+
// ../node_modules/.bun/lucide-svelte@1.0.1+5d720e49779a0e36/node_modules/lucide-svelte/dist/icons/settings.svelte
|
|
116
|
+
function kt(e, t) {
|
|
117
|
+
let n = U.legacy_rest_props(t, [
|
|
118
|
+
"children",
|
|
119
|
+
"$$slots",
|
|
120
|
+
"$$events",
|
|
121
|
+
"$$legacy"
|
|
122
|
+
]), i = [["path", { d: "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915" }], ["circle", {
|
|
123
|
+
cx: "12",
|
|
124
|
+
cy: "12",
|
|
125
|
+
r: "3"
|
|
126
|
+
}]];
|
|
127
|
+
r(e, U.spread_props({ name: "settings" }, () => n, {
|
|
128
|
+
get iconNode() {
|
|
129
|
+
return i;
|
|
130
|
+
},
|
|
131
|
+
children: (e, n) => {
|
|
132
|
+
var r = U.comment(), i = U.first_child(r);
|
|
133
|
+
U.slot(i, t, "default", {}, null), U.append(e, r);
|
|
134
|
+
},
|
|
135
|
+
$$slots: { default: !0 }
|
|
136
|
+
}));
|
|
137
|
+
}
|
|
138
|
+
// src/lib/components/SearchBar.svelte
|
|
139
|
+
var At = U.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>"), jt = U.from_html("<div><!> <input type=\"text\"/> <!></div>");
|
|
140
|
+
function Mt(e, t) {
|
|
141
|
+
U.push(t, !0);
|
|
142
|
+
let n = U.state(""), r = U.state(null), a = u();
|
|
143
|
+
function s() {
|
|
144
|
+
U.set(n, ""), U.get(r)?.focus();
|
|
145
|
+
}
|
|
146
|
+
var c = jt(), f = U.child(c);
|
|
147
|
+
i(f, { class: "pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" });
|
|
148
|
+
var p = U.sibling(f, 2);
|
|
149
|
+
U.remove_input_defaults(p), U.bind_this(p, (e) => U.set(r, e), () => U.get(r));
|
|
150
|
+
var m = U.sibling(p, 2), h = (e) => {
|
|
151
|
+
var t = At(), n = U.child(t);
|
|
152
|
+
o(n, { class: "size-3.5" }), U.reset(t), U.template_effect((e, n) => {
|
|
153
|
+
U.set_attribute(t, "aria-label", e), U.set_attribute(t, "title", n);
|
|
154
|
+
}, [() => R(), () => R()]), U.delegated("click", t, s), U.append(e, t);
|
|
155
|
+
};
|
|
156
|
+
U.if(m, (e) => {
|
|
157
|
+
U.get(n) && e(h);
|
|
158
|
+
}), U.reset(c), U.template_effect((e, t, n) => {
|
|
159
|
+
U.set_class(c, 1, e), U.set_attribute(p, "placeholder", t), U.set_class(p, 1, n);
|
|
160
|
+
}, [
|
|
161
|
+
() => U.clsx(d("relative", t.class)),
|
|
162
|
+
() => O(),
|
|
163
|
+
() => U.clsx(d("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", U.get(n) ? "pr-9" : "pr-3"))
|
|
164
|
+
]), U.delegated("keydown", p, (e) => {
|
|
165
|
+
e.key === "Enter" && U.get(n).trim() && l(a, `/search?q=${encodeURIComponent(U.get(n).trim())}`);
|
|
166
|
+
}), U.event("focus", p, () => {}), U.bind_value(p, () => U.get(n), (e) => U.set(n, e)), U.append(e, c), U.pop();
|
|
167
|
+
}
|
|
168
|
+
U.delegate(["keydown", "click"]);
|
|
169
|
+
// src/lib/components/sidebar/FolderTree.svelte
|
|
170
|
+
var Nt = (e, t = U.noop) => {
|
|
171
|
+
var n = Rt(), r = U.sibling(U.child(n), 2);
|
|
172
|
+
Ee(r, { class: "size-4 shrink-0 text-muted-foreground" });
|
|
173
|
+
var i = U.sibling(r, 2), a = U.only_child(i, !0);
|
|
174
|
+
U.reset(n), U.template_effect((e) => {
|
|
175
|
+
U.set_attribute(n, "href", `/docs/${t().id}`), U.set_class(n, 1, e, "svelte-1nshngr"), U.set_text(a, t().title);
|
|
176
|
+
}, [() => U.clsx(d("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", W.params.id === t().id && "bg-accent text-accent-foreground font-medium"))]), U.append(e, n);
|
|
177
|
+
}, Pt = U.from_html("<button><!></button>"), Ft = U.from_html("<!> <!> <!>", 1), It = U.from_html("<!> <!>", 1), Lt = U.from_html("<button type=\"button\"><!></button>"), Rt = U.from_html("<a data-sveltekit-noscroll=\"\"><span class=\"w-3.5 shrink-0\"></span> <!> <span class=\"min-w-0 truncate\"> </span></a>"), zt = U.from_html("<p class=\"px-2 text-xs text-destructive\"> </p>"), Bt = U.from_html("<!> <!> <!> <!> <!> <!>", 1), Vt = U.from_html("<div><!></div>"), Ht = U.from_html("<div class=\"group/doc flex w-full min-w-0 items-center gap-1\"><!> <!> <!></div>"), Ut = U.from_html("<div class=\"ml-0.5 space-y-0.5 border-l border-border pl-0.5\"><div></div> <div></div></div>"), Wt = U.from_html("<div class=\"group/bucket\"><div class=\"flex w-full min-w-0 items-center gap-0.5\"><button type=\"button\" data-sidebar-drop-kind=\"category\"><!> <span class=\"min-w-0 truncate\"> </span></button> <!></div> <!></div>"), Gt = U.from_html("<div class=\"group/bucket\"><div class=\"flex w-full min-w-0 items-center gap-0.5\"><button type=\"button\" data-sidebar-drop-kind=\"category\"><!> <span class=\"min-w-0 truncate\"> </span></button></div> <!></div>"), Kt = U.from_html("<p id=\"rename-input-error\" class=\"text-xs text-destructive\" role=\"alert\"> </p>"), qt = U.from_html("<!> <form class=\"space-y-4\"><div class=\"space-y-2\"><!> <!> <!></div></form> <!>", 1), Jt = U.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);
|
|
178
|
+
function Yt(e, n) {
|
|
179
|
+
U.push(n, !0);
|
|
180
|
+
let r = (e, t = U.noop) => {
|
|
181
|
+
b(e, {
|
|
182
|
+
children: (e, n) => {
|
|
183
|
+
var r = It(), i = U.first_child(r);
|
|
184
|
+
ee(i, {
|
|
185
|
+
child: (e, t) => {
|
|
186
|
+
let n = () => (t?.()).props;
|
|
187
|
+
var r = Pt(), i = (e) => {
|
|
188
|
+
e.preventDefault(), e.stopPropagation();
|
|
189
|
+
};
|
|
190
|
+
U.attribute_effect(r, (e, t) => ({
|
|
191
|
+
...n(),
|
|
192
|
+
type: "button",
|
|
193
|
+
class: "sidebar-touch-action 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",
|
|
194
|
+
"aria-label": e,
|
|
195
|
+
title: t,
|
|
196
|
+
onclick: i
|
|
197
|
+
}), [() => L(), () => L()], void 0, void 0, "svelte-1nshngr");
|
|
198
|
+
var a = U.child(r);
|
|
199
|
+
je(a, { class: "size-3.5" }), U.reset(r), U.append(e, r);
|
|
200
|
+
},
|
|
201
|
+
$$slots: { child: !0 }
|
|
202
|
+
});
|
|
203
|
+
var a = U.sibling(i, 2);
|
|
204
|
+
x(a, {
|
|
205
|
+
align: "end",
|
|
206
|
+
children: (e, n) => {
|
|
207
|
+
var r = Ft(), i = U.first_child(r);
|
|
208
|
+
S(i, {
|
|
209
|
+
onSelect: () => ur("doc", t().id, t().title),
|
|
210
|
+
children: (e, t) => {
|
|
211
|
+
U.next();
|
|
212
|
+
var n = U.text();
|
|
213
|
+
U.template_effect((e) => U.set_text(n, e), [() => be()]), U.append(e, n);
|
|
214
|
+
},
|
|
215
|
+
$$slots: { default: !0 }
|
|
216
|
+
});
|
|
217
|
+
var a = U.sibling(i, 2);
|
|
218
|
+
S(a, {
|
|
219
|
+
onSelect: () => mr(t().id, t().title),
|
|
220
|
+
children: (e, t) => {
|
|
221
|
+
U.next();
|
|
222
|
+
var n = U.text();
|
|
223
|
+
U.template_effect((e) => U.set_text(n, e), [() => _e()]), U.append(e, n);
|
|
224
|
+
},
|
|
225
|
+
$$slots: { default: !0 }
|
|
226
|
+
});
|
|
227
|
+
var o = U.sibling(a, 2);
|
|
228
|
+
S(o, {
|
|
229
|
+
class: "text-destructive focus:text-destructive",
|
|
230
|
+
onSelect: () => pr("doc", t().id, t().title),
|
|
231
|
+
children: (e, t) => {
|
|
232
|
+
U.next();
|
|
233
|
+
var n = U.text();
|
|
234
|
+
U.template_effect((e) => U.set_text(n, e), [() => E()]), U.append(e, n);
|
|
235
|
+
},
|
|
236
|
+
$$slots: { default: !0 }
|
|
237
|
+
}), U.append(e, r);
|
|
238
|
+
},
|
|
239
|
+
$$slots: { default: !0 }
|
|
240
|
+
}), U.append(e, r);
|
|
241
|
+
},
|
|
242
|
+
$$slots: { default: !0 }
|
|
243
|
+
});
|
|
244
|
+
}, i = (e, t = U.noop) => {
|
|
245
|
+
var n = Lt(), r = U.child(n), i = (e) => {
|
|
246
|
+
Ae(e, { class: "size-3.5 animate-spin" });
|
|
247
|
+
}, a = (e) => {
|
|
248
|
+
Ce(e, { class: "size-3.5" });
|
|
249
|
+
}, o = (e) => {
|
|
250
|
+
Te(e, { class: "size-3.5" });
|
|
251
|
+
};
|
|
252
|
+
U.if(r, (e) => {
|
|
253
|
+
U.get(pn) === t().id ? e(i) : U.get(fn) === t().id ? e(a, 1) : e(o, -1);
|
|
254
|
+
}), U.reset(n), U.template_effect((e, r) => {
|
|
255
|
+
U.set_class(n, 1, `sidebar-touch-action 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 ${U.get(fn) === t().id || U.get(pn) === t().id ? "opacity-100" : ""}`, "svelte-1nshngr"), U.set_attribute(n, "aria-label", e), U.set_attribute(n, "title", r), n.disabled = U.get(pn) === t().id;
|
|
256
|
+
}, [() => C(), () => C()]), U.delegated("click", n, (e) => {
|
|
257
|
+
e.preventDefault(), e.stopPropagation(), hn(t().id);
|
|
258
|
+
}), U.append(e, n);
|
|
259
|
+
}, a = (e, t = U.noop) => {
|
|
260
|
+
{
|
|
261
|
+
let n = U.derived(() => U.get(X)?.kind === "folder" ? U.get(X).id : null);
|
|
262
|
+
tt(e, {
|
|
263
|
+
get folder() {
|
|
264
|
+
return t();
|
|
265
|
+
},
|
|
266
|
+
get expandedFolderIds() {
|
|
267
|
+
return U.get(P);
|
|
268
|
+
},
|
|
269
|
+
onToggleFolder: Ln,
|
|
270
|
+
onRename: (e, t) => ur("folder", e, t),
|
|
271
|
+
onDelete: (e, t) => pr("folder", e, t),
|
|
272
|
+
onCreateSubfolder: Hn,
|
|
273
|
+
onShare: hr,
|
|
274
|
+
get dragDisabled() {
|
|
275
|
+
return U.get(V);
|
|
276
|
+
},
|
|
277
|
+
get isDraggingFolder() {
|
|
278
|
+
return U.get(it);
|
|
279
|
+
},
|
|
280
|
+
get isDraggingDoc() {
|
|
281
|
+
return U.get(ht);
|
|
282
|
+
},
|
|
283
|
+
get activeDropFolderId() {
|
|
284
|
+
return U.get(n);
|
|
285
|
+
},
|
|
286
|
+
onConsiderDocs: Gn,
|
|
287
|
+
onFinalizeDocs: Kn,
|
|
288
|
+
onConsiderSubfolders: Zn,
|
|
289
|
+
onFinalizeSubfolders: Qn,
|
|
290
|
+
get folderDocsMap() {
|
|
291
|
+
return U.get(wt);
|
|
292
|
+
},
|
|
293
|
+
folderFlipDurationMs: O,
|
|
294
|
+
documentFlipDurationMs: A,
|
|
295
|
+
get docRowInner() {
|
|
296
|
+
return Nt;
|
|
297
|
+
},
|
|
298
|
+
get copyButton() {
|
|
299
|
+
return i;
|
|
300
|
+
},
|
|
301
|
+
get docMenu() {
|
|
302
|
+
return r;
|
|
303
|
+
}
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
}, o = u(), f = s(), ae = ke(), O = 200, A = 80, j = U.state(U.proxy([])), M = U.state(U.proxy([])), N = U.state(U.proxy([])), P = U.state(U.proxy(/* @__PURE__ */ new Set())), F = U.state(U.proxy(/* @__PURE__ */ new Set())), I = U.state(!0), R = U.state(null), z = U.state(null), B = null;
|
|
307
|
+
function Ee(e) {
|
|
308
|
+
U.set(z, e, !0), B &&= (clearTimeout(B), null), e !== null && (B = setTimeout(() => {
|
|
309
|
+
U.set(z, null), B = null;
|
|
310
|
+
}, 5e3));
|
|
311
|
+
}
|
|
312
|
+
let V = U.state(!1), it = U.state(!1), ht = U.state(!1), gt = 0, _t = U.state(!1), bt = U.state(!1), xt = 0, St = Promise.resolve(), Ct = U.state(U.proxy([])), wt = U.state(U.proxy({})), W = U.state(U.proxy({})), G = U.state(U.proxy({})), K = U.state(U.proxy([])), kt = U.state(!1), At = U.state(null), jt = U.state(null), Mt = U.state(!1), Rt = U.state(null), Yt = U.state(""), q = U.state(null), Xt = U.state(!1), Zt = U.state(!1), J = U.state(null), Qt = U.state(!1), $t = U.state(""), en = U.state(""), tn = U.state(""), nn = U.state(""), rn = U.state(""), an = U.state(""), on = U.state(!1), sn = U.state("create"), Y = U.state(null), cn = U.state(!1), ln, X = U.state(null), un = null, dn = null, Z = null, fn = U.state(null), pn = U.state(null), mn = null;
|
|
313
|
+
async function hn(e) {
|
|
314
|
+
if (typeof window > "u") return;
|
|
315
|
+
let t = U.get(N).find((t) => t.id === e), n = "";
|
|
316
|
+
U.set(pn, e, !0);
|
|
317
|
+
try {
|
|
318
|
+
n = (await He(e, f.fetch)).content ?? "";
|
|
319
|
+
} catch (e) {
|
|
320
|
+
console.error("FolderTree: failed to fetch full document for copy", e), n = t?.excerpt ?? t?.content ?? "";
|
|
321
|
+
} finally {
|
|
322
|
+
U.set(pn, null);
|
|
323
|
+
}
|
|
324
|
+
n && await yt(n) && (U.set(fn, e, !0), mn && clearTimeout(mn), mn = setTimeout(() => {
|
|
325
|
+
U.set(fn, null), mn = null;
|
|
326
|
+
}, 2e3));
|
|
327
|
+
}
|
|
328
|
+
function gn(e) {
|
|
329
|
+
e.kind === "folder" ? U.get(P).has(e.id) || U.set(P, new Set(U.get(P)).add(e.id), !0) : e.id === $ ? U.set(I, !0) : U.get(F).has(e.id) || U.set(F, new Set(U.get(F)).add(e.id), !0);
|
|
330
|
+
}
|
|
331
|
+
function _n() {
|
|
332
|
+
if (!ln || !dn || !Z) return null;
|
|
333
|
+
let e = ln.ownerDocument.elementsFromPoint(dn.clientX, dn.clientY).find((e) => !e.closest(`#${Pe}, [data-is-dnd-shadow-item-hint="true"]`));
|
|
334
|
+
if (!e || !ln.contains(e)) return null;
|
|
335
|
+
let t = e.closest("[data-sidebar-drop-kind]");
|
|
336
|
+
if (!t || !ln.contains(t)) return null;
|
|
337
|
+
let { sidebarDropKind: n, sidebarDropId: r } = t.dataset;
|
|
338
|
+
return !r || n !== "folder" && n !== "category" || n === "folder" && Z.kind === "folder" && er(r).has(Z.id) ? null : {
|
|
339
|
+
kind: n,
|
|
340
|
+
id: r
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
function vn(e) {
|
|
344
|
+
(e?.kind !== U.get(X)?.kind || e?.id !== U.get(X)?.id) && (un !== null && clearTimeout(un), un = null, U.set(X, e, !0), e && (un = setTimeout(() => {
|
|
345
|
+
un = null, gn(e);
|
|
346
|
+
}, 400)));
|
|
347
|
+
}
|
|
348
|
+
function yn(e, t) {
|
|
349
|
+
t.source === Ne.POINTER && t.trigger === Me.DRAG_STARTED && (Z = {
|
|
350
|
+
kind: e,
|
|
351
|
+
id: String(t.id),
|
|
352
|
+
released: !1,
|
|
353
|
+
cancelled: !1,
|
|
354
|
+
target: null
|
|
355
|
+
}, vn(_n()));
|
|
356
|
+
}
|
|
357
|
+
function bn(e, t) {
|
|
358
|
+
if (Z?.kind !== e || Z.id !== t) return null;
|
|
359
|
+
let n = Z;
|
|
360
|
+
return Z = null, vn(null), n;
|
|
361
|
+
}
|
|
362
|
+
function xn(e) {
|
|
363
|
+
dn = "touches" in e ? e.touches[0] ?? null : e, Z && !Z.released && vn(_n());
|
|
364
|
+
}
|
|
365
|
+
function Sn(e) {
|
|
366
|
+
Z && !Z.released && (dn = "changedTouches" in e ? e.changedTouches[0] ?? null : e, Z.released = !0, Z.cancelled = e.type === "touchcancel", Z.target = Z.cancelled ? null : _n(), vn(null));
|
|
367
|
+
}
|
|
368
|
+
function Cn(e) {
|
|
369
|
+
return Array.isArray(e) ? e.filter((e) => typeof e == "object" && !!e && typeof e.id == "string") : [];
|
|
370
|
+
}
|
|
371
|
+
function wn(e) {
|
|
372
|
+
let t = [], n = {}, r = {};
|
|
373
|
+
for (let i of e) if (i.folderId) {
|
|
374
|
+
let e = r[i.folderId] ?? [];
|
|
375
|
+
e.push(i), r[i.folderId] = e;
|
|
376
|
+
} else if (i.categoryId) {
|
|
377
|
+
let e = n[i.categoryId] ?? [];
|
|
378
|
+
e.push(i), n[i.categoryId] = e;
|
|
379
|
+
} else t.push(i);
|
|
380
|
+
return {
|
|
381
|
+
root: t,
|
|
382
|
+
byCategory: n,
|
|
383
|
+
byFolder: r
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
function Tn() {
|
|
387
|
+
let { root: e, byCategory: t, byFolder: n } = wn(U.get(N));
|
|
388
|
+
U.set(Ct, e, !0), U.set(W, t, !0), U.set(wt, n, !0);
|
|
389
|
+
}
|
|
390
|
+
function En() {
|
|
391
|
+
let e = /* @__PURE__ */ new Map();
|
|
392
|
+
for (let t of U.get(M)) e.set(t.id, []);
|
|
393
|
+
let t = [];
|
|
394
|
+
for (let n of U.get(j)) n.categoryId && e.has(n.categoryId) ? e.get(n.categoryId)?.push(n) : t.push(n);
|
|
395
|
+
let n = {};
|
|
396
|
+
for (let t of U.get(M)) n[t.id] = e.get(t.id) ?? [];
|
|
397
|
+
n[$] = t, U.set(G, n, !0);
|
|
398
|
+
}
|
|
399
|
+
U.user_effect(() => {
|
|
400
|
+
U.get(j), U.get(M), U.get(_t) || U.get(bt) || (U.set(K, U.get(Dr).map((e) => ({
|
|
401
|
+
id: e.id,
|
|
402
|
+
category: e.category,
|
|
403
|
+
folders: e.folders
|
|
404
|
+
})), !0), En());
|
|
405
|
+
});
|
|
406
|
+
async function Dn() {
|
|
407
|
+
try {
|
|
408
|
+
let e = await Je(null, !1, f.fetch);
|
|
409
|
+
U.set(j, (e[0]?.children ?? []).map((e) => (lt(e.id, e.parentId ?? null, e.categoryId ?? null, e.order ?? 0), {
|
|
410
|
+
id: e.id,
|
|
411
|
+
name: e.name,
|
|
412
|
+
categoryId: e.categoryId ?? null,
|
|
413
|
+
parentId: e.parentId,
|
|
414
|
+
order: e.order ?? 0
|
|
415
|
+
})), !0), U.set(R, null);
|
|
416
|
+
} catch (e) {
|
|
417
|
+
console.error("FolderTree: failed to load folders", e), U.set(R, "Failed to load folders");
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
async function On() {
|
|
421
|
+
try {
|
|
422
|
+
let e = await Le(f.fetch), t = /* @__PURE__ */ new Set();
|
|
423
|
+
for (let n of e) {
|
|
424
|
+
if (t.has(n.id)) throw Error(`Categories response contains duplicate id: ${n.id}`);
|
|
425
|
+
t.add(n.id);
|
|
426
|
+
}
|
|
427
|
+
U.set(M, e, !0);
|
|
428
|
+
} catch (e) {
|
|
429
|
+
console.error("FolderTree: failed to load categories", e);
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
let kn = 0;
|
|
433
|
+
async function An() {
|
|
434
|
+
let e = ++kn;
|
|
435
|
+
try {
|
|
436
|
+
let t = H(), n = await We({
|
|
437
|
+
limit: 100,
|
|
438
|
+
...t ? { tag: t } : {}
|
|
439
|
+
}, f.fetch);
|
|
440
|
+
if (e !== kn) return;
|
|
441
|
+
U.set(N, n.items.map((e) => rt(e.id) ? {
|
|
442
|
+
...e,
|
|
443
|
+
folderId: rt(e.id)?.folderId ?? null,
|
|
444
|
+
categoryId: rt(e.id)?.categoryId ?? null
|
|
445
|
+
} : e), !0), U.get(N).forEach((e) => {
|
|
446
|
+
e.id, e.title, e.categoryId, e.folderId, Object.keys(e), at(e.id, e.folderId ?? null, e.categoryId ?? null);
|
|
447
|
+
}), Tn();
|
|
448
|
+
} catch (e) {
|
|
449
|
+
console.error("FolderTree: failed to load documents", e), U.set(R, "Failed to load documents");
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
async function Q() {
|
|
453
|
+
Ge(), await Promise.all([
|
|
454
|
+
Dn(),
|
|
455
|
+
On(),
|
|
456
|
+
An()
|
|
457
|
+
]);
|
|
458
|
+
}
|
|
459
|
+
function jn(e, t) {
|
|
460
|
+
kn++, at(e, t.folderId, t.categoryId), U.set(N, U.get(N).map((n) => n.id === e ? {
|
|
461
|
+
...n,
|
|
462
|
+
...t
|
|
463
|
+
} : n), !0), Tn();
|
|
464
|
+
}
|
|
465
|
+
let Mn = $e({
|
|
466
|
+
patch: (e, t) => Ve(e, t, f.fetch),
|
|
467
|
+
optimistic: (e, t) => pt(e, t.folderId, t.categoryId),
|
|
468
|
+
acknowledge: ft,
|
|
469
|
+
rollback: jn,
|
|
470
|
+
onError: (e) => {
|
|
471
|
+
console.error("FolderTree: document move failed", e), Ee(e instanceof Error ? e.message : "Move failed");
|
|
472
|
+
}
|
|
473
|
+
});
|
|
474
|
+
function Nn(e, t) {
|
|
475
|
+
let n = ut(e);
|
|
476
|
+
n && (n.folderId !== t.folderId || n.categoryId !== t.categoryId) && Mn(e, t, n).catch(() => void 0);
|
|
477
|
+
}
|
|
478
|
+
let Pn = et({ persist: Nn });
|
|
479
|
+
Et(() => {
|
|
480
|
+
let e = setTimeout(() => {
|
|
481
|
+
Q();
|
|
482
|
+
}, 500);
|
|
483
|
+
return () => clearTimeout(e);
|
|
484
|
+
}), Et(() => {
|
|
485
|
+
let e = [
|
|
486
|
+
"mousedown",
|
|
487
|
+
"mousemove",
|
|
488
|
+
"touchstart",
|
|
489
|
+
"touchmove"
|
|
490
|
+
], t = [
|
|
491
|
+
"mouseup",
|
|
492
|
+
"touchend",
|
|
493
|
+
"touchcancel"
|
|
494
|
+
];
|
|
495
|
+
for (let t of e) window.addEventListener(t, xn, {
|
|
496
|
+
capture: !0,
|
|
497
|
+
passive: !0
|
|
498
|
+
});
|
|
499
|
+
for (let e of t) window.addEventListener(e, Sn, {
|
|
500
|
+
capture: !0,
|
|
501
|
+
passive: !0
|
|
502
|
+
});
|
|
503
|
+
return () => {
|
|
504
|
+
for (let t of e) window.removeEventListener(t, xn, !0);
|
|
505
|
+
for (let e of t) window.removeEventListener(e, Sn, !0);
|
|
506
|
+
};
|
|
507
|
+
}), Tt(() => {
|
|
508
|
+
Pn.cancel(), B &&= (clearTimeout(B), null), vn(null);
|
|
509
|
+
}), U.user_effect(() => {
|
|
510
|
+
let e = vt(), t = ct();
|
|
511
|
+
(e !== 0 || t !== 0) && Q();
|
|
512
|
+
}), U.user_effect(() => {
|
|
513
|
+
if (ot() === 0) return;
|
|
514
|
+
let e = dt();
|
|
515
|
+
e && Dt(() => {
|
|
516
|
+
kn++;
|
|
517
|
+
let t = U.get(N).findIndex((t) => t.id === e.id);
|
|
518
|
+
t !== -1 && (U.set(N, U.get(N).map((n, r) => r === t ? {
|
|
519
|
+
...n,
|
|
520
|
+
folderId: e.folderId,
|
|
521
|
+
categoryId: e.categoryId
|
|
522
|
+
} : n), !0), Tn());
|
|
523
|
+
});
|
|
524
|
+
});
|
|
525
|
+
let Fn = !0;
|
|
526
|
+
U.user_effect(() => {
|
|
527
|
+
H(), Fn ? Fn = !1 : Q();
|
|
528
|
+
});
|
|
529
|
+
async function In() {
|
|
530
|
+
await Q();
|
|
531
|
+
}
|
|
532
|
+
function Ln(e) {
|
|
533
|
+
let t = U.get(P).has(e), n = new Set(U.get(P));
|
|
534
|
+
t ? n.delete(e) : n.add(e), U.set(P, n, !0), U.set(V, !0), typeof window < "u" && window.setTimeout(() => {
|
|
535
|
+
U.set(V, !1);
|
|
536
|
+
}, 250);
|
|
537
|
+
}
|
|
538
|
+
function Rn(e) {
|
|
539
|
+
let t = new Set(U.get(F));
|
|
540
|
+
t.has(e) ? t.delete(e) : t.add(e), U.set(F, t, !0);
|
|
541
|
+
}
|
|
542
|
+
function zn() {
|
|
543
|
+
U.set(I, !U.get(I));
|
|
544
|
+
}
|
|
545
|
+
function Bn() {
|
|
546
|
+
U.set(At, null), U.set(jt, null), U.set(kt, !0);
|
|
547
|
+
}
|
|
548
|
+
function Vn(e) {
|
|
549
|
+
U.set(At, null), U.set(jt, e, !0), U.set(kt, !0);
|
|
550
|
+
}
|
|
551
|
+
function Hn(e) {
|
|
552
|
+
U.set(At, e, !0), U.set(jt, null), U.set(kt, !0);
|
|
553
|
+
}
|
|
554
|
+
async function Un(e) {
|
|
555
|
+
let t = U.get(At), n = await Ye({
|
|
556
|
+
name: e,
|
|
557
|
+
parentId: t,
|
|
558
|
+
categoryId: U.get(jt)
|
|
559
|
+
}, f.fetch);
|
|
560
|
+
return await Dn(), t && (U.set(P, new Set(U.get(P)).add(t), !0), st(t)), n;
|
|
561
|
+
}
|
|
562
|
+
function Wn(e, t) {
|
|
563
|
+
e.kind === "root" ? U.set(Ct, t, !0) : e.kind === "category" ? U.set(W, {
|
|
564
|
+
...U.get(W),
|
|
565
|
+
[e.id]: t
|
|
566
|
+
}, !0) : U.set(wt, {
|
|
567
|
+
...U.get(wt),
|
|
568
|
+
[e.id]: t
|
|
569
|
+
}, !0);
|
|
570
|
+
}
|
|
571
|
+
function Gn(e) {
|
|
572
|
+
return (t) => {
|
|
573
|
+
t.stopPropagation(), U.set(ht, !0);
|
|
574
|
+
let { info: n } = t.detail;
|
|
575
|
+
n.trigger === Me.DRAG_STARTED && (Pn.begin(String(n.id), ++gt), yn("doc", n)), Wn(e, Cn(t.detail.items));
|
|
576
|
+
};
|
|
577
|
+
}
|
|
578
|
+
function Kn(e) {
|
|
579
|
+
return (t) => {
|
|
580
|
+
t.stopPropagation(), Wn(e, Cn(t.detail.items));
|
|
581
|
+
let { info: n } = t.detail, r = String(n.id);
|
|
582
|
+
if (n.trigger !== Me.DROPPED_INTO_ANOTHER) {
|
|
583
|
+
let t = bn("doc", r);
|
|
584
|
+
if (t?.target) {
|
|
585
|
+
let e = t.target;
|
|
586
|
+
gn(e), Pn.zone(r, qn(e.kind === "category" && e.id === $ ? { kind: "root" } : e)), queueMicrotask(Tn);
|
|
587
|
+
} else !t?.cancelled && n.trigger !== Me.DROPPED_OUTSIDE_OF_ANY ? Pn.zone(r, qn(e)) : queueMicrotask(Tn);
|
|
588
|
+
}
|
|
589
|
+
Pn.end(r, gt), U.set(ht, !1);
|
|
590
|
+
};
|
|
591
|
+
}
|
|
592
|
+
function qn(e) {
|
|
593
|
+
if (e.kind === "category") return {
|
|
594
|
+
folderId: null,
|
|
595
|
+
categoryId: e.id
|
|
596
|
+
};
|
|
597
|
+
if (e.kind === "root") return {
|
|
598
|
+
folderId: null,
|
|
599
|
+
categoryId: null
|
|
600
|
+
};
|
|
601
|
+
let t = /* @__PURE__ */ new Set(), n = e.id;
|
|
602
|
+
for (; n && !t.has(n);) {
|
|
603
|
+
t.add(n);
|
|
604
|
+
let r = nt(n);
|
|
605
|
+
if (r?.categoryId) return {
|
|
606
|
+
folderId: e.id,
|
|
607
|
+
categoryId: r.categoryId
|
|
608
|
+
};
|
|
609
|
+
n = r?.parentId ?? null;
|
|
610
|
+
}
|
|
611
|
+
return {
|
|
612
|
+
folderId: e.id,
|
|
613
|
+
categoryId: null
|
|
614
|
+
};
|
|
615
|
+
}
|
|
616
|
+
let Jn = "parent:";
|
|
617
|
+
function Yn(e) {
|
|
618
|
+
return (t) => {
|
|
619
|
+
t.stopPropagation(), U.set(it, !0), yn("folder", t.detail.info);
|
|
620
|
+
let n = $n(t.detail.items);
|
|
621
|
+
e.startsWith(Jn) || U.set(G, {
|
|
622
|
+
...U.get(G),
|
|
623
|
+
[e]: n
|
|
624
|
+
}, !0);
|
|
625
|
+
};
|
|
626
|
+
}
|
|
627
|
+
function Xn(e) {
|
|
628
|
+
return (t) => {
|
|
629
|
+
t.stopPropagation();
|
|
630
|
+
let n = $n(t.detail.items), r = t.detail.info.trigger === Me.DROPPED_INTO_ANOTHER;
|
|
631
|
+
if (e.startsWith(Jn) || U.set(G, {
|
|
632
|
+
...U.get(G),
|
|
633
|
+
[e]: n
|
|
634
|
+
}, !0), U.set(it, !1), r) return;
|
|
635
|
+
let i = String(t.detail.info.id), a = bn("folder", i);
|
|
636
|
+
if (a?.target) {
|
|
637
|
+
let e = a.target;
|
|
638
|
+
queueMicrotask(() => void tr(i, e));
|
|
639
|
+
} else !a?.cancelled && t.detail.info.trigger !== Me.DROPPED_OUTSIDE_OF_ANY ? nr(e, n) : queueMicrotask(() => {
|
|
640
|
+
En(), e.startsWith(Jn) && st(e.slice(7));
|
|
641
|
+
});
|
|
642
|
+
};
|
|
643
|
+
}
|
|
644
|
+
function Zn(e) {
|
|
645
|
+
return Yn(`${Jn}${e}`);
|
|
646
|
+
}
|
|
647
|
+
function Qn(e) {
|
|
648
|
+
return Xn(`${Jn}${e}`);
|
|
649
|
+
}
|
|
650
|
+
function $n(e) {
|
|
651
|
+
return Array.isArray(e) ? e.filter((e) => typeof e == "object" && !!e && typeof e.id == "string") : [];
|
|
652
|
+
}
|
|
653
|
+
function er(e) {
|
|
654
|
+
let t = /* @__PURE__ */ new Set();
|
|
655
|
+
if (!e) return t;
|
|
656
|
+
let n = e;
|
|
657
|
+
for (; n && !t.has(n);) t.add(n), n = nt(n)?.parentId ?? null;
|
|
658
|
+
return t;
|
|
659
|
+
}
|
|
660
|
+
async function tr(e, t) {
|
|
661
|
+
let n = nt(e);
|
|
662
|
+
if (!n) return;
|
|
663
|
+
let r = t.kind === "folder" ? t.id : null, i = t.kind === "category" && t.id !== $ ? t.id : null;
|
|
664
|
+
try {
|
|
665
|
+
(n.parentId !== r || n.categoryId !== i) && await Ke(e, {
|
|
666
|
+
parentId: r,
|
|
667
|
+
categoryId: i
|
|
668
|
+
}, f.fetch), gn(t);
|
|
669
|
+
} catch (e) {
|
|
670
|
+
Ee(e instanceof Error ? e.message : "Move failed");
|
|
671
|
+
} finally {
|
|
672
|
+
await Q(), En(), n.parentId && st(n.parentId), r && r !== n.parentId && st(r);
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
async function nr(e, t) {
|
|
676
|
+
let n = e.startsWith(Jn), r = n || e === $ ? null : e, i = n && e.slice(7) || null, a = /* @__PURE__ */ new Map(), o = n ? er(i) : /* @__PURE__ */ new Set();
|
|
677
|
+
if (n) for (let e of t) {
|
|
678
|
+
if (o.has(e.id)) continue;
|
|
679
|
+
let t = nt(e.id);
|
|
680
|
+
t && t.parentId !== i && (a.set(e.id, {
|
|
681
|
+
folderId: e.id,
|
|
682
|
+
parentId: i
|
|
683
|
+
}), lt(e.id, i, t.categoryId, t.order));
|
|
684
|
+
}
|
|
685
|
+
else for (let e of t) {
|
|
686
|
+
let t = nt(e.id);
|
|
687
|
+
if (!t) continue;
|
|
688
|
+
let n = t.categoryId !== r, i = t.parentId !== null;
|
|
689
|
+
if (n || i) {
|
|
690
|
+
let o = { folderId: e.id };
|
|
691
|
+
n && (o.categoryId = r), i && (o.parentId = null), a.set(e.id, o), lt(e.id, null, r, t.order);
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
t.forEach((e, t) => {
|
|
695
|
+
if (n && o.has(e.id)) return;
|
|
696
|
+
let r = nt(e.id);
|
|
697
|
+
if (!r) return;
|
|
698
|
+
let i = r.order !== t, s = a.get(e.id);
|
|
699
|
+
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, {
|
|
700
|
+
folderId: e.id,
|
|
701
|
+
order: t
|
|
702
|
+
}), lt(e.id, r.parentId, r.categoryId, t));
|
|
703
|
+
});
|
|
704
|
+
let s = Array.from(a.values()), c = /* @__PURE__ */ new Set();
|
|
705
|
+
if (n) {
|
|
706
|
+
i && c.add(i);
|
|
707
|
+
for (let e of t) {
|
|
708
|
+
let t = e.parentId ?? null;
|
|
709
|
+
t !== null && t !== i && c.add(t);
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
if (s.length !== 0) try {
|
|
713
|
+
await Promise.all(s.map((e) => {
|
|
714
|
+
let { folderId: t, ...n } = e;
|
|
715
|
+
return Ke(t, n, f.fetch);
|
|
716
|
+
})), await Q(), En();
|
|
717
|
+
for (let e of c) st(e);
|
|
718
|
+
} catch (e) {
|
|
719
|
+
console.error("FolderTree: folder DnD persist failed", e), Ee(e instanceof Error ? `Move failed: ${e.message}` : "Move failed: unknown error");
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
function rr(e) {
|
|
723
|
+
e.stopPropagation(), U.set(_t, !0), U.set(K, ar(or(e.detail.items)), !0);
|
|
724
|
+
}
|
|
725
|
+
function ir(e) {
|
|
726
|
+
e.stopPropagation();
|
|
727
|
+
let t = ar(sr(e.detail.items));
|
|
728
|
+
U.set(K, t, !0), U.set(_t, !1), cr(t);
|
|
729
|
+
}
|
|
730
|
+
function ar(e) {
|
|
731
|
+
let t = e.filter((e) => e.id !== $), n = U.get(K).find((e) => e.id === $) ?? U.get(Dr).find((e) => e.id === $);
|
|
732
|
+
return n ? [...t, n] : t;
|
|
733
|
+
}
|
|
734
|
+
function or(e) {
|
|
735
|
+
if (!Array.isArray(e)) return [];
|
|
736
|
+
let t = [];
|
|
737
|
+
for (let n of e) {
|
|
738
|
+
if (typeof n != "object" || !n || typeof n.id != "string") continue;
|
|
739
|
+
let e = n;
|
|
740
|
+
t.push(e);
|
|
741
|
+
}
|
|
742
|
+
return t;
|
|
743
|
+
}
|
|
744
|
+
function sr(e) {
|
|
745
|
+
let t = or(e), n = new Set(t.filter((e) => e[Fe]).map((e) => e.id)), r = /* @__PURE__ */ new Set(), i = new Map([...U.get(K), ...U.get(Dr)].map((e) => [e.id, e])), a = [];
|
|
746
|
+
for (let e of t) {
|
|
747
|
+
if (n.has(e.id) && !e.isDndShadowItem || r.has(e.id)) continue;
|
|
748
|
+
r.add(e.id);
|
|
749
|
+
let t = i.get(e.id) ?? e;
|
|
750
|
+
a.push({
|
|
751
|
+
id: t.id,
|
|
752
|
+
category: t.category,
|
|
753
|
+
folders: t.folders
|
|
754
|
+
});
|
|
755
|
+
}
|
|
756
|
+
return a;
|
|
757
|
+
}
|
|
758
|
+
function cr(e) {
|
|
759
|
+
let t = ++xt;
|
|
760
|
+
U.set(bt, !0);
|
|
761
|
+
let n = e.map((e) => ({ ...e }));
|
|
762
|
+
St = St.catch(() => void 0).then(async () => {
|
|
763
|
+
try {
|
|
764
|
+
await lr(n);
|
|
765
|
+
} catch (e) {
|
|
766
|
+
console.error("FolderTree: category DnD persist failed", e), Ee(e instanceof Error ? `Reorder failed: ${e.message}` : "Reorder failed: unknown error");
|
|
767
|
+
} finally {
|
|
768
|
+
t === xt && (await Q(), U.set(bt, !1));
|
|
769
|
+
}
|
|
770
|
+
});
|
|
771
|
+
}
|
|
772
|
+
async function lr(e) {
|
|
773
|
+
let t = [];
|
|
774
|
+
if (e.forEach((e, n) => {
|
|
775
|
+
e.category && t.push({
|
|
776
|
+
id: e.category.id,
|
|
777
|
+
order: n
|
|
778
|
+
});
|
|
779
|
+
}), t.length !== 0) for (let e of t) await ze(e.id, { order: e.order }, f.fetch);
|
|
780
|
+
}
|
|
781
|
+
function ur(e, t, n) {
|
|
782
|
+
U.set(Rt, {
|
|
783
|
+
kind: e,
|
|
784
|
+
id: t,
|
|
785
|
+
name: n
|
|
786
|
+
}, !0), U.set(Yt, n, !0), U.set(q, null), U.set(Mt, !0);
|
|
787
|
+
}
|
|
788
|
+
function dr() {
|
|
789
|
+
U.set(Mt, !1), U.set(Rt, null), U.set(Yt, ""), U.set(q, null), U.set(Xt, !1);
|
|
790
|
+
}
|
|
791
|
+
async function fr(e) {
|
|
792
|
+
e?.preventDefault();
|
|
793
|
+
let t = U.get(Rt);
|
|
794
|
+
if (!t) return;
|
|
795
|
+
let n = U.get(Yt).trim();
|
|
796
|
+
if (n.length === 0) U.set(q, "Name is required");
|
|
797
|
+
else {
|
|
798
|
+
U.set(Xt, !0);
|
|
799
|
+
try {
|
|
800
|
+
t.kind === "folder" ? await Ke(t.id, { name: n }, f.fetch) : await Ve(t.id, { title: n }, f.fetch), dr(), await Q(), mt();
|
|
801
|
+
} catch (e) {
|
|
802
|
+
console.error("FolderTree: rename failed", e), U.set(q, e instanceof Error ? e.message : Se(), !0);
|
|
803
|
+
} finally {
|
|
804
|
+
U.set(Xt, !1);
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
function pr(e, t, n) {
|
|
809
|
+
U.set(J, {
|
|
810
|
+
kind: e,
|
|
811
|
+
id: t,
|
|
812
|
+
name: n
|
|
813
|
+
}, !0), U.set(Zt, !0);
|
|
814
|
+
}
|
|
815
|
+
function mr(e, t) {
|
|
816
|
+
U.set($t, e, !0), U.set(en, ""), U.set(rn, ""), U.set(tn, t, !0), U.set(nn, ""), U.set(an, ""), U.set(Qt, !0);
|
|
817
|
+
}
|
|
818
|
+
function hr(e, t) {
|
|
819
|
+
U.set(en, e, !0), U.set($t, ""), U.set(rn, ""), U.set(nn, t, !0), U.set(tn, ""), U.set(an, ""), U.set(Qt, !0);
|
|
820
|
+
}
|
|
821
|
+
function gr(e, t) {
|
|
822
|
+
U.set(rn, e, !0), U.set($t, ""), U.set(en, ""), U.set(an, t, !0), U.set(tn, ""), U.set(nn, ""), U.set(Qt, !0);
|
|
823
|
+
}
|
|
824
|
+
function _r() {
|
|
825
|
+
U.set(Zt, !1), U.set(J, null);
|
|
826
|
+
}
|
|
827
|
+
async function vr() {
|
|
828
|
+
let e = U.get(J);
|
|
829
|
+
e && (e.kind === "folder" ? await qe(e.id, f.fetch) : await Ue(e.id, f.fetch), await Q(), mt());
|
|
830
|
+
}
|
|
831
|
+
function yr() {
|
|
832
|
+
U.set(sn, "create"), U.set(Y, null), U.set(on, !0);
|
|
833
|
+
}
|
|
834
|
+
function br(e) {
|
|
835
|
+
U.set(sn, "edit"), U.set(Y, e, !0), U.set(on, !0);
|
|
836
|
+
}
|
|
837
|
+
function xr(e) {
|
|
838
|
+
U.set(sn, "delete"), U.set(Y, e, !0), U.set(on, !0);
|
|
839
|
+
}
|
|
840
|
+
function Sr() {
|
|
841
|
+
U.get(cn) || (U.set(on, !1), U.set(Y, null), U.set(cn, !1));
|
|
842
|
+
}
|
|
843
|
+
async function Cr(e) {
|
|
844
|
+
U.set(cn, !0);
|
|
845
|
+
try {
|
|
846
|
+
let t = {
|
|
847
|
+
name: e.name,
|
|
848
|
+
apiMode: e.apiMode,
|
|
849
|
+
apiPermissionRead: e.apiPermissionRead,
|
|
850
|
+
apiPermissionEdit: e.apiPermissionEdit,
|
|
851
|
+
apiPermissionWrite: e.apiPermissionWrite
|
|
852
|
+
}, n;
|
|
853
|
+
return n = U.get(sn) === "edit" && U.get(Y) ? await Be(`/api/categories/${encodeURIComponent(U.get(Y).id)}`, {
|
|
854
|
+
method: "PATCH",
|
|
855
|
+
body: t
|
|
856
|
+
}, f.fetch) : await Be("/api/categories", {
|
|
857
|
+
method: "POST",
|
|
858
|
+
body: t
|
|
859
|
+
}, f.fetch), await Q(), n;
|
|
860
|
+
} finally {
|
|
861
|
+
U.set(cn, !1);
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
async function wr() {
|
|
865
|
+
if (U.get(Y)) {
|
|
866
|
+
U.set(cn, !0);
|
|
867
|
+
try {
|
|
868
|
+
await Re(U.get(Y).id, f.fetch), await Q();
|
|
869
|
+
} finally {
|
|
870
|
+
U.set(cn, !1);
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
let $ = "__uncategorized__", Tr = U.derived(() => U.get(K).filter((e) => e.id !== $ && e.category !== null)), Er = U.derived(() => U.get(K).find((e) => e.id === $) ?? null), Dr = U.derived(() => {
|
|
875
|
+
let e = /* @__PURE__ */ new Map();
|
|
876
|
+
for (let t of U.get(M)) e.set(t.id, []);
|
|
877
|
+
let t = [];
|
|
878
|
+
for (let n of U.get(j)) n.categoryId && e.has(n.categoryId) ? e.get(n.categoryId)?.push(n) : t.push(n);
|
|
879
|
+
let n = [];
|
|
880
|
+
for (let t of U.get(M)) n.push({
|
|
881
|
+
id: t.id,
|
|
882
|
+
category: t,
|
|
883
|
+
folders: e.get(t.id) ?? []
|
|
884
|
+
});
|
|
885
|
+
return n.push({
|
|
886
|
+
id: $,
|
|
887
|
+
category: null,
|
|
888
|
+
folders: t
|
|
889
|
+
}), n;
|
|
890
|
+
});
|
|
891
|
+
var Or = { refreshFolderTree: In }, kr = Jt(), Ar = U.first_child(kr), jr = U.child(Ar), Mr = U.child(jr), Nr = U.only_child(Mr, !0), Pr = U.sibling(Mr, 2), Fr = U.child(Pr);
|
|
892
|
+
De(Fr, { class: "size-3.5" }), U.reset(Pr), U.reset(jr);
|
|
893
|
+
var Ir = U.sibling(jr, 2), Lr = (e) => {
|
|
894
|
+
var t = zt(), n = U.only_child(t, !0);
|
|
895
|
+
U.template_effect(() => U.set_text(n, U.get(R))), U.append(e, t);
|
|
896
|
+
};
|
|
897
|
+
U.if(Ir, (e) => {
|
|
898
|
+
U.get(R) && e(Lr);
|
|
899
|
+
});
|
|
900
|
+
var Rr = U.sibling(Ir, 2), zr = (e) => {
|
|
901
|
+
var t = zt(), n = U.only_child(t, !0);
|
|
902
|
+
U.template_effect(() => U.set_text(n, U.get(z))), U.append(e, t);
|
|
903
|
+
};
|
|
904
|
+
U.if(Rr, (e) => {
|
|
905
|
+
U.get(z) && e(zr);
|
|
906
|
+
});
|
|
907
|
+
var Br = U.sibling(Rr, 2);
|
|
908
|
+
U.each(Br, 29, () => U.get(Tr), (e) => `${e.id}:${e.isDndShadowItem ? "shadow" : "item"}`, (e, n) => {
|
|
909
|
+
let s = U.derived(() => U.get(F).has(U.get(n).id));
|
|
910
|
+
var c = Wt(), u = U.child(c), f = U.child(u), p = U.child(f), m = (e) => {
|
|
911
|
+
we(e, { class: "size-3.5 shrink-0" });
|
|
912
|
+
}, h = (e) => {
|
|
913
|
+
t(e, { class: "size-3.5 shrink-0" });
|
|
914
|
+
};
|
|
915
|
+
U.if(p, (e) => {
|
|
916
|
+
U.get(s) ? e(m) : e(h, -1);
|
|
917
|
+
});
|
|
918
|
+
var g = U.sibling(p, 2), _ = U.only_child(g, !0);
|
|
919
|
+
U.reset(f);
|
|
920
|
+
var v = U.sibling(f, 2);
|
|
921
|
+
b(v, {
|
|
922
|
+
children: (e, t) => {
|
|
923
|
+
var r = It(), i = U.first_child(r);
|
|
924
|
+
ee(i, {
|
|
925
|
+
child: (e, t) => {
|
|
926
|
+
let n = () => (t?.()).props;
|
|
927
|
+
var r = Pt();
|
|
928
|
+
U.attribute_effect(r, (e, t) => ({
|
|
929
|
+
...n(),
|
|
930
|
+
type: "button",
|
|
931
|
+
class: "inline-flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-accent-foreground group-hover/bucket:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
932
|
+
"aria-label": e,
|
|
933
|
+
title: t
|
|
934
|
+
}), [() => L(), () => L()], void 0, void 0, "svelte-1nshngr");
|
|
935
|
+
var i = U.child(r);
|
|
936
|
+
je(i, { class: "size-3.5" }), U.reset(r), U.append(e, r);
|
|
937
|
+
},
|
|
938
|
+
$$slots: { child: !0 }
|
|
939
|
+
});
|
|
940
|
+
var a = U.sibling(i, 2);
|
|
941
|
+
x(a, {
|
|
942
|
+
align: "end",
|
|
943
|
+
children: (e, t) => {
|
|
944
|
+
var r = Bt(), i = U.first_child(r);
|
|
945
|
+
S(i, {
|
|
946
|
+
onSelect: () => l(o, `/?category=${U.get(n).category.id}`),
|
|
947
|
+
children: (e, t) => {
|
|
948
|
+
U.next();
|
|
949
|
+
var n = U.text();
|
|
950
|
+
U.template_effect((e) => U.set_text(n, e), [() => me()]), U.append(e, n);
|
|
951
|
+
},
|
|
952
|
+
$$slots: { default: !0 }
|
|
953
|
+
});
|
|
954
|
+
var a = U.sibling(i, 2);
|
|
955
|
+
S(a, {
|
|
956
|
+
onSelect: () => l(o, `/docs/new?category=${U.get(n).category.id}`),
|
|
957
|
+
children: (e, t) => {
|
|
958
|
+
U.next();
|
|
959
|
+
var n = U.text();
|
|
960
|
+
U.template_effect((e) => U.set_text(n, e), [() => ye()]), U.append(e, n);
|
|
961
|
+
},
|
|
962
|
+
$$slots: { default: !0 }
|
|
963
|
+
});
|
|
964
|
+
var s = U.sibling(a, 2);
|
|
965
|
+
S(s, {
|
|
966
|
+
onSelect: () => Vn(U.get(n).category.id),
|
|
967
|
+
children: (e, t) => {
|
|
968
|
+
U.next();
|
|
969
|
+
var n = U.text();
|
|
970
|
+
U.template_effect((e) => U.set_text(n, e), [() => ve()]), U.append(e, n);
|
|
971
|
+
},
|
|
972
|
+
$$slots: { default: !0 }
|
|
973
|
+
});
|
|
974
|
+
var c = U.sibling(s, 2);
|
|
975
|
+
S(c, {
|
|
976
|
+
onSelect: () => gr(U.get(n).category.id, U.get(n).category.name),
|
|
977
|
+
children: (e, t) => {
|
|
978
|
+
U.next();
|
|
979
|
+
var n = U.text();
|
|
980
|
+
U.template_effect((e) => U.set_text(n, e), [() => _e()]), U.append(e, n);
|
|
981
|
+
},
|
|
982
|
+
$$slots: { default: !0 }
|
|
983
|
+
});
|
|
984
|
+
var u = U.sibling(c, 2);
|
|
985
|
+
S(u, {
|
|
986
|
+
onSelect: () => br(U.get(n).category),
|
|
987
|
+
children: (e, t) => {
|
|
988
|
+
U.next();
|
|
989
|
+
var n = U.text();
|
|
990
|
+
U.template_effect((e) => U.set_text(n, e), [() => pe()]), U.append(e, n);
|
|
991
|
+
},
|
|
992
|
+
$$slots: { default: !0 }
|
|
993
|
+
});
|
|
994
|
+
var d = U.sibling(u, 2);
|
|
995
|
+
S(d, {
|
|
996
|
+
class: "text-destructive focus:text-destructive",
|
|
997
|
+
onSelect: () => xr(U.get(n).category),
|
|
998
|
+
children: (e, t) => {
|
|
999
|
+
U.next();
|
|
1000
|
+
var n = U.text();
|
|
1001
|
+
U.template_effect((e) => U.set_text(n, e), [() => E()]), U.append(e, n);
|
|
1002
|
+
},
|
|
1003
|
+
$$slots: { default: !0 }
|
|
1004
|
+
}), U.append(e, r);
|
|
1005
|
+
},
|
|
1006
|
+
$$slots: { default: !0 }
|
|
1007
|
+
}), U.append(e, r);
|
|
1008
|
+
},
|
|
1009
|
+
$$slots: { default: !0 }
|
|
1010
|
+
}), U.reset(u);
|
|
1011
|
+
var y = U.sibling(u, 2), te = (e) => {
|
|
1012
|
+
let t = U.derived(() => U.get(G)[U.get(n).id] ?? []), o = U.derived(() => U.get(W)[U.get(n).id] ?? []);
|
|
1013
|
+
var s = Ut(), c = U.child(s), l = U.derived(() => Yn(U.get(n).id)), u = U.derived(() => Xn(U.get(n).id));
|
|
1014
|
+
U.each(c, 29, () => U.get(t), (e) => e.id, (e, t) => {
|
|
1015
|
+
var n = Vt(), r = U.child(n);
|
|
1016
|
+
a(r, () => U.get(t)), U.reset(n), U.template_effect(() => U.set_attribute(n, "data-is-dnd-shadow-item-hint", U.get(t)[Fe])), U.animation(n, () => Ot, () => ({ duration: 200 })), U.append(e, n);
|
|
1017
|
+
}), U.reset(c), U.action(c, (e, t) => Ie?.(e, t), () => ({
|
|
1018
|
+
items: U.get(t),
|
|
1019
|
+
flipDurationMs: 200,
|
|
1020
|
+
type: "folder",
|
|
1021
|
+
dropTargetStyle: {},
|
|
1022
|
+
dragDisabled: U.get(V)
|
|
1023
|
+
}));
|
|
1024
|
+
var f = U.sibling(c, 2), p = U.derived(() => Gn({
|
|
1025
|
+
kind: "category",
|
|
1026
|
+
id: U.get(n).id
|
|
1027
|
+
})), m = U.derived(() => Kn({
|
|
1028
|
+
kind: "category",
|
|
1029
|
+
id: U.get(n).id
|
|
1030
|
+
}));
|
|
1031
|
+
U.each(f, 29, () => U.get(o), (e) => e.id, (e, t) => {
|
|
1032
|
+
var n = Ht(), a = U.child(n);
|
|
1033
|
+
Nt(a, () => U.get(t));
|
|
1034
|
+
var o = U.sibling(a, 2);
|
|
1035
|
+
i(o, () => U.get(t));
|
|
1036
|
+
var s = U.sibling(o, 2);
|
|
1037
|
+
r(s, () => U.get(t)), U.reset(n), U.animation(n, () => Ot, () => ({ duration: 80 })), U.append(e, n);
|
|
1038
|
+
}), U.reset(f), U.action(f, (e, t) => Ie?.(e, t), () => ({
|
|
1039
|
+
items: U.get(o),
|
|
1040
|
+
flipDurationMs: 80,
|
|
1041
|
+
type: "doc",
|
|
1042
|
+
dropTargetStyle: {},
|
|
1043
|
+
dragDisabled: U.get(V),
|
|
1044
|
+
useCursorForDetection: !0,
|
|
1045
|
+
centreDraggedOnCursor: !0
|
|
1046
|
+
})), U.reset(s), U.template_effect((e, t) => {
|
|
1047
|
+
U.set_class(c, 1, e, "svelte-1nshngr"), U.set_class(f, 1, t, "svelte-1nshngr");
|
|
1048
|
+
}, [() => U.clsx(d("min-h-[8px] space-y-0.5 transition-all duration-150", U.get(it) && U.get(t).length === 0 && "min-h-[36px] bg-accent/20 rounded border border-dashed border-muted-foreground/20")), () => U.clsx(d("min-h-[8px] space-y-0.5 transition-all duration-150", U.get(ht) && U.get(o).length === 0 && "min-h-[36px] bg-accent/20 rounded border border-dashed border-muted-foreground/20"))]), U.event("consider", c, function(...e) {
|
|
1049
|
+
U.get(l)?.apply(this, e);
|
|
1050
|
+
}), U.event("finalize", c, function(...e) {
|
|
1051
|
+
U.get(u)?.apply(this, e);
|
|
1052
|
+
}), U.event("consider", f, function(...e) {
|
|
1053
|
+
U.get(p)?.apply(this, e);
|
|
1054
|
+
}), U.event("finalize", f, function(...e) {
|
|
1055
|
+
U.get(m)?.apply(this, e);
|
|
1056
|
+
}), U.append(e, s);
|
|
1057
|
+
};
|
|
1058
|
+
U.if(y, (e) => {
|
|
1059
|
+
U.get(s) && e(te);
|
|
1060
|
+
}), U.reset(c), U.template_effect((e) => {
|
|
1061
|
+
U.set_attribute(c, "data-is-dnd-shadow-item-hint", U.get(n)[Fe]), U.set_attribute(f, "data-sidebar-drop-id", U.get(n).id), U.set_attribute(f, "aria-expanded", U.get(s)), U.set_class(f, 1, e, "svelte-1nshngr"), U.set_text(_, U.get(n).category.name);
|
|
1062
|
+
}, [() => U.clsx(d("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", U.get(X)?.kind === "category" && U.get(X).id === U.get(n).id && "bg-accent ring-1 ring-primary/50"))]), U.delegated("click", f, () => Rn(U.get(n).id)), U.animation(c, () => Ot, () => ({ duration: 200 })), U.append(e, c);
|
|
1063
|
+
}), U.reset(Br), U.action(Br, (e, t) => Ie?.(e, t), () => ({
|
|
1064
|
+
items: U.get(Tr),
|
|
1065
|
+
flipDurationMs: 200,
|
|
1066
|
+
type: "category",
|
|
1067
|
+
dropTargetStyle: {},
|
|
1068
|
+
dragDisabled: U.get(V)
|
|
1069
|
+
}));
|
|
1070
|
+
var Vr = U.sibling(Br, 2), Hr = (e) => {
|
|
1071
|
+
var n = Gt(), o = U.child(n), s = U.child(o);
|
|
1072
|
+
U.set_attribute(s, "data-sidebar-drop-id", $);
|
|
1073
|
+
var c = U.child(s), l = (e) => {
|
|
1074
|
+
we(e, { class: "size-3.5 shrink-0" });
|
|
1075
|
+
}, u = (e) => {
|
|
1076
|
+
t(e, { class: "size-3.5 shrink-0" });
|
|
1077
|
+
};
|
|
1078
|
+
U.if(c, (e) => {
|
|
1079
|
+
U.get(I) ? e(l) : e(u, -1);
|
|
1080
|
+
});
|
|
1081
|
+
var f = U.sibling(c, 2), p = U.only_child(f, !0);
|
|
1082
|
+
U.reset(s), U.reset(o);
|
|
1083
|
+
var m = U.sibling(o, 2), h = (e) => {
|
|
1084
|
+
let t = U.derived(() => U.get(G)[$] ?? []);
|
|
1085
|
+
var n = Ut(), o = U.child(n), s = U.derived(() => Yn($)), c = U.derived(() => Xn($));
|
|
1086
|
+
U.each(o, 29, () => U.get(t), (e) => e.id, (e, t) => {
|
|
1087
|
+
var n = Vt(), r = U.child(n);
|
|
1088
|
+
a(r, () => U.get(t)), U.reset(n), U.animation(n, () => Ot, () => ({ duration: 200 })), U.append(e, n);
|
|
1089
|
+
}), U.reset(o), U.action(o, (e, t) => Ie?.(e, t), () => ({
|
|
1090
|
+
items: U.get(t),
|
|
1091
|
+
flipDurationMs: 200,
|
|
1092
|
+
type: "folder",
|
|
1093
|
+
dropTargetStyle: {},
|
|
1094
|
+
dragDisabled: U.get(V)
|
|
1095
|
+
}));
|
|
1096
|
+
var l = U.sibling(o, 2), u = U.derived(() => Gn({ kind: "root" })), f = U.derived(() => Kn({ kind: "root" }));
|
|
1097
|
+
U.each(l, 29, () => U.get(Ct), (e) => e.id, (e, t) => {
|
|
1098
|
+
var n = Ht(), a = U.child(n);
|
|
1099
|
+
Nt(a, () => U.get(t));
|
|
1100
|
+
var o = U.sibling(a, 2);
|
|
1101
|
+
i(o, () => U.get(t));
|
|
1102
|
+
var s = U.sibling(o, 2);
|
|
1103
|
+
r(s, () => U.get(t)), U.reset(n), U.animation(n, () => Ot, () => ({ duration: 80 })), U.append(e, n);
|
|
1104
|
+
}), U.reset(l), U.action(l, (e, t) => Ie?.(e, t), () => ({
|
|
1105
|
+
items: U.get(Ct),
|
|
1106
|
+
flipDurationMs: 80,
|
|
1107
|
+
type: "doc",
|
|
1108
|
+
dropTargetStyle: {},
|
|
1109
|
+
dragDisabled: U.get(V),
|
|
1110
|
+
useCursorForDetection: !0,
|
|
1111
|
+
centreDraggedOnCursor: !0
|
|
1112
|
+
})), U.reset(n), U.template_effect((e, t) => {
|
|
1113
|
+
U.set_class(o, 1, e, "svelte-1nshngr"), U.set_class(l, 1, t, "svelte-1nshngr");
|
|
1114
|
+
}, [() => U.clsx(d("min-h-[8px] space-y-0.5 transition-all duration-150", U.get(it) && U.get(t).length === 0 && "min-h-[36px] bg-accent/20 rounded border border-dashed border-muted-foreground/20")), () => U.clsx(d("min-h-[8px] space-y-0.5 transition-all duration-150", U.get(ht) && U.get(Ct).length === 0 && "min-h-[36px] bg-accent/20 rounded border border-dashed border-muted-foreground/20"))]), U.event("consider", o, function(...e) {
|
|
1115
|
+
U.get(s)?.apply(this, e);
|
|
1116
|
+
}), U.event("finalize", o, function(...e) {
|
|
1117
|
+
U.get(c)?.apply(this, e);
|
|
1118
|
+
}), U.event("consider", l, function(...e) {
|
|
1119
|
+
U.get(u)?.apply(this, e);
|
|
1120
|
+
}), U.event("finalize", l, function(...e) {
|
|
1121
|
+
U.get(f)?.apply(this, e);
|
|
1122
|
+
}), U.append(e, n);
|
|
1123
|
+
};
|
|
1124
|
+
U.if(m, (e) => {
|
|
1125
|
+
U.get(I) && e(h);
|
|
1126
|
+
}), U.reset(n), U.template_effect((e, t) => {
|
|
1127
|
+
U.set_attribute(s, "aria-expanded", U.get(I)), U.set_class(s, 1, e, "svelte-1nshngr"), U.set_text(p, t);
|
|
1128
|
+
}, [() => U.clsx(d("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", U.get(X)?.kind === "category" && U.get(X).id === $ && "bg-accent ring-1 ring-primary/50")), () => T()]), U.delegated("click", s, zn), U.append(e, n);
|
|
1129
|
+
};
|
|
1130
|
+
U.if(Vr, (e) => {
|
|
1131
|
+
U.get(Er) && e(Hr);
|
|
1132
|
+
});
|
|
1133
|
+
var Ur = U.sibling(Vr, 2), Wr = U.child(Ur);
|
|
1134
|
+
De(Wr, { class: "size-3.5" });
|
|
1135
|
+
var Gr = U.sibling(Wr, 2), Kr = U.only_child(Gr, !0);
|
|
1136
|
+
U.reset(Ur), U.reset(Ar), U.bind_this(Ar, (e) => ln = e, () => ln);
|
|
1137
|
+
var qr = U.sibling(Ar, 2);
|
|
1138
|
+
Oe(qr, {
|
|
1139
|
+
mode: "create",
|
|
1140
|
+
onSave: Un,
|
|
1141
|
+
closeOnSave: !1,
|
|
1142
|
+
get open() {
|
|
1143
|
+
return U.get(kt);
|
|
1144
|
+
},
|
|
1145
|
+
set open(e) {
|
|
1146
|
+
U.set(kt, e, !0);
|
|
1147
|
+
}
|
|
1148
|
+
});
|
|
1149
|
+
var Jr = U.sibling(qr, 2);
|
|
1150
|
+
g(Jr, {
|
|
1151
|
+
onOpenChange: (e) => {
|
|
1152
|
+
e || dr();
|
|
1153
|
+
},
|
|
1154
|
+
get open() {
|
|
1155
|
+
return U.get(Mt);
|
|
1156
|
+
},
|
|
1157
|
+
set open(e) {
|
|
1158
|
+
U.set(Mt, e, !0);
|
|
1159
|
+
},
|
|
1160
|
+
children: (e, t) => {
|
|
1161
|
+
p(e, {
|
|
1162
|
+
children: (e, t) => {
|
|
1163
|
+
var n = qt(), r = U.first_child(n);
|
|
1164
|
+
h(r, {
|
|
1165
|
+
children: (e, t) => {
|
|
1166
|
+
var n = It(), r = U.first_child(n);
|
|
1167
|
+
y(r, {
|
|
1168
|
+
children: (e, t) => {
|
|
1169
|
+
U.next();
|
|
1170
|
+
var n = U.text();
|
|
1171
|
+
U.template_effect((e) => U.set_text(n, e), [() => be()]), U.append(e, n);
|
|
1172
|
+
},
|
|
1173
|
+
$$slots: { default: !0 }
|
|
1174
|
+
});
|
|
1175
|
+
var i = U.sibling(r, 2);
|
|
1176
|
+
m(i, {
|
|
1177
|
+
children: (e, t) => {
|
|
1178
|
+
U.next();
|
|
1179
|
+
var n = U.text();
|
|
1180
|
+
U.template_effect((e) => U.set_text(n, e), [() => U.get(Rt)?.kind === "folder" ? ce() : xe()]), U.append(e, n);
|
|
1181
|
+
},
|
|
1182
|
+
$$slots: { default: !0 }
|
|
1183
|
+
}), U.append(e, n);
|
|
1184
|
+
},
|
|
1185
|
+
$$slots: { default: !0 }
|
|
1186
|
+
});
|
|
1187
|
+
var i = U.sibling(r, 2), a = U.child(i), o = U.child(a);
|
|
1188
|
+
ne(o, {
|
|
1189
|
+
for: "rename-input",
|
|
1190
|
+
children: (e, t) => {
|
|
1191
|
+
U.next();
|
|
1192
|
+
var n = U.text();
|
|
1193
|
+
U.template_effect((e) => U.set_text(n, e), [() => U.get(Rt)?.kind === "folder" ? ce() : xe()]), U.append(e, n);
|
|
1194
|
+
},
|
|
1195
|
+
$$slots: { default: !0 }
|
|
1196
|
+
});
|
|
1197
|
+
var s = U.sibling(o, 2);
|
|
1198
|
+
{
|
|
1199
|
+
let e = U.derived(() => U.get(q) ? "true" : void 0), t = U.derived(() => U.get(q) ? "rename-input-error" : void 0);
|
|
1200
|
+
te(s, {
|
|
1201
|
+
id: "rename-input",
|
|
1202
|
+
name: "name",
|
|
1203
|
+
type: "text",
|
|
1204
|
+
maxlength: 255,
|
|
1205
|
+
required: !0,
|
|
1206
|
+
get disabled() {
|
|
1207
|
+
return U.get(Xt);
|
|
1208
|
+
},
|
|
1209
|
+
get "aria-invalid"() {
|
|
1210
|
+
return U.get(e);
|
|
1211
|
+
},
|
|
1212
|
+
get "aria-describedby"() {
|
|
1213
|
+
return U.get(t);
|
|
1214
|
+
},
|
|
1215
|
+
autocomplete: "off",
|
|
1216
|
+
get value() {
|
|
1217
|
+
return U.get(Yt);
|
|
1218
|
+
},
|
|
1219
|
+
set value(e) {
|
|
1220
|
+
U.set(Yt, e, !0);
|
|
1221
|
+
}
|
|
1222
|
+
});
|
|
1223
|
+
}
|
|
1224
|
+
var c = U.sibling(s, 2), l = (e) => {
|
|
1225
|
+
var t = Kt(), n = U.only_child(t, !0);
|
|
1226
|
+
U.template_effect(() => U.set_text(n, U.get(q))), U.append(e, t);
|
|
1227
|
+
};
|
|
1228
|
+
U.if(c, (e) => {
|
|
1229
|
+
U.get(q) && e(l);
|
|
1230
|
+
}), U.reset(a), U.reset(i);
|
|
1231
|
+
var u = U.sibling(i, 2);
|
|
1232
|
+
_(u, {
|
|
1233
|
+
children: (e, t) => {
|
|
1234
|
+
var n = It(), r = U.first_child(n);
|
|
1235
|
+
v(r, {
|
|
1236
|
+
variant: "outline",
|
|
1237
|
+
type: "button",
|
|
1238
|
+
onclick: dr,
|
|
1239
|
+
get disabled() {
|
|
1240
|
+
return U.get(Xt);
|
|
1241
|
+
},
|
|
1242
|
+
children: (e, t) => {
|
|
1243
|
+
U.next();
|
|
1244
|
+
var n = U.text();
|
|
1245
|
+
U.template_effect((e) => U.set_text(n, e), [() => re()]), U.append(e, n);
|
|
1246
|
+
},
|
|
1247
|
+
$$slots: { default: !0 }
|
|
1248
|
+
});
|
|
1249
|
+
var i = U.sibling(r, 2);
|
|
1250
|
+
{
|
|
1251
|
+
let e = U.derived(() => U.get(Xt) || U.get(Yt).trim().length === 0);
|
|
1252
|
+
v(i, {
|
|
1253
|
+
type: "submit",
|
|
1254
|
+
onclick: fr,
|
|
1255
|
+
get disabled() {
|
|
1256
|
+
return U.get(e);
|
|
1257
|
+
},
|
|
1258
|
+
children: (e, t) => {
|
|
1259
|
+
U.next();
|
|
1260
|
+
var n = U.text();
|
|
1261
|
+
U.template_effect((e) => U.set_text(n, e), [() => U.get(Xt) ? he() : ge()]), U.append(e, n);
|
|
1262
|
+
},
|
|
1263
|
+
$$slots: { default: !0 }
|
|
1264
|
+
});
|
|
1265
|
+
}
|
|
1266
|
+
U.append(e, n);
|
|
1267
|
+
},
|
|
1268
|
+
$$slots: { default: !0 }
|
|
1269
|
+
}), U.event("submit", i, fr), U.append(e, n);
|
|
1270
|
+
},
|
|
1271
|
+
$$slots: { default: !0 }
|
|
1272
|
+
});
|
|
1273
|
+
},
|
|
1274
|
+
$$slots: { default: !0 }
|
|
1275
|
+
});
|
|
1276
|
+
var Yr = U.sibling(Jr, 2);
|
|
1277
|
+
{
|
|
1278
|
+
let e = U.derived(() => U.get(J)?.name ?? ""), t = U.derived(() => U.get(J)?.kind === "folder" ? w() : oe()), n = U.derived(() => U.get(J)?.kind === "folder" ? "Its documents will be moved to the root and will not be deleted." : se()), r = U.derived(() => U.get(J)?.kind === "folder" ? k() : le()), i = U.derived(() => U.get(J)?.kind === "folder" ? fe() : ue()), a = U.derived(() => E()), o = U.derived(() => re());
|
|
1279
|
+
Xe(Yr, {
|
|
1280
|
+
get targetName() {
|
|
1281
|
+
return U.get(e);
|
|
1282
|
+
},
|
|
1283
|
+
get title() {
|
|
1284
|
+
return U.get(t);
|
|
1285
|
+
},
|
|
1286
|
+
get description() {
|
|
1287
|
+
return U.get(n);
|
|
1288
|
+
},
|
|
1289
|
+
get successTitle() {
|
|
1290
|
+
return U.get(r);
|
|
1291
|
+
},
|
|
1292
|
+
get successDescription() {
|
|
1293
|
+
return U.get(i);
|
|
1294
|
+
},
|
|
1295
|
+
get confirmLabel() {
|
|
1296
|
+
return U.get(a);
|
|
1297
|
+
},
|
|
1298
|
+
get cancelLabel() {
|
|
1299
|
+
return U.get(o);
|
|
1300
|
+
},
|
|
1301
|
+
onConfirm: vr,
|
|
1302
|
+
onCancel: _r,
|
|
1303
|
+
get open() {
|
|
1304
|
+
return U.get(Zt);
|
|
1305
|
+
},
|
|
1306
|
+
set open(e) {
|
|
1307
|
+
U.set(Zt, e, !0);
|
|
1308
|
+
}
|
|
1309
|
+
});
|
|
1310
|
+
}
|
|
1311
|
+
var Xr = U.sibling(Yr, 2);
|
|
1312
|
+
{
|
|
1313
|
+
let e = U.derived(() => U.get(Y) ?? void 0);
|
|
1314
|
+
Qe(Xr, {
|
|
1315
|
+
get mode() {
|
|
1316
|
+
return U.get(sn);
|
|
1317
|
+
},
|
|
1318
|
+
get category() {
|
|
1319
|
+
return U.get(e);
|
|
1320
|
+
},
|
|
1321
|
+
onSave: Cr,
|
|
1322
|
+
onDelete: wr,
|
|
1323
|
+
onClose: Sr,
|
|
1324
|
+
get open() {
|
|
1325
|
+
return U.get(on);
|
|
1326
|
+
},
|
|
1327
|
+
set open(e) {
|
|
1328
|
+
U.set(on, e, !0);
|
|
1329
|
+
}
|
|
1330
|
+
});
|
|
1331
|
+
}
|
|
1332
|
+
var Zr = U.sibling(Xr, 2);
|
|
1333
|
+
return Ze(Zr, {
|
|
1334
|
+
get displayMode() {
|
|
1335
|
+
return ae.displayMode;
|
|
1336
|
+
},
|
|
1337
|
+
get documentId() {
|
|
1338
|
+
return U.get($t);
|
|
1339
|
+
},
|
|
1340
|
+
get documentTitle() {
|
|
1341
|
+
return U.get(tn);
|
|
1342
|
+
},
|
|
1343
|
+
get folderId() {
|
|
1344
|
+
return U.get(en);
|
|
1345
|
+
},
|
|
1346
|
+
get folderName() {
|
|
1347
|
+
return U.get(nn);
|
|
1348
|
+
},
|
|
1349
|
+
get categoryId() {
|
|
1350
|
+
return U.get(rn);
|
|
1351
|
+
},
|
|
1352
|
+
get categoryName() {
|
|
1353
|
+
return U.get(an);
|
|
1354
|
+
},
|
|
1355
|
+
get open() {
|
|
1356
|
+
return U.get(Qt);
|
|
1357
|
+
},
|
|
1358
|
+
set open(e) {
|
|
1359
|
+
U.set(Qt, e, !0);
|
|
1360
|
+
}
|
|
1361
|
+
}), U.template_effect((e, t, n, r, i, a) => {
|
|
1362
|
+
U.set_attribute(Mr, "href", e), U.set_attribute(Mr, "title", t), U.set_text(Nr, n), U.set_attribute(Pr, "aria-label", r), U.set_attribute(Pr, "title", i), U.set_text(Kr, a);
|
|
1363
|
+
}, [
|
|
1364
|
+
() => c(o, "/"),
|
|
1365
|
+
() => ie(),
|
|
1366
|
+
() => de(),
|
|
1367
|
+
() => D(),
|
|
1368
|
+
() => D(),
|
|
1369
|
+
() => ve()
|
|
1370
|
+
]), U.delegated("click", Pr, yr), U.event("consider", Br, rr), U.event("finalize", Br, ir), U.delegated("click", Ur, Bn), U.append(e, kr), U.pop(Or);
|
|
1371
|
+
}
|
|
1372
|
+
U.delegate(["click"]);
|
|
1373
|
+
// src/lib/components/sidebar/RecentDocs.svelte
|
|
1374
|
+
var q = U.from_html("<p class=\"px-2 text-xs text-destructive\"> </p>"), Xt = U.from_html("<button><!></button>"), Zt = U.from_html("<!> <!> <!>", 1), J = U.from_html("<!> <!>", 1), Qt = U.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>"), $t = U.from_html("<p id=\"recent-rename-input-error\" class=\"text-xs text-destructive\" role=\"alert\"> </p>"), en = U.from_html("<!> <form class=\"space-y-4\"><div class=\"space-y-2\"><!> <!> <!></div></form> <!>", 1), tn = U.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);
|
|
1375
|
+
function nn(e, t) {
|
|
1376
|
+
U.push(t, !0);
|
|
1377
|
+
let n = s(), r = ke(), i = U.state(U.proxy([])), a = U.state(null), o = U.state(null), c = U.state(null), l = U.state(null), u = null, f = U.state(!1), ie = U.state(null), w = U.state(""), T = U.state(null), D = U.state(!1), O = U.state(!1), k = U.state(null), A = U.state(!1), j = U.state(!1), ce = U.state(""), le = U.state("");
|
|
1378
|
+
function M(e, t) {
|
|
1379
|
+
U.set(ce, e, !0), U.set(le, t, !0), U.set(j, !0);
|
|
1380
|
+
}
|
|
1381
|
+
async function N() {
|
|
1382
|
+
try {
|
|
1383
|
+
let e = H(), t = await We({
|
|
1384
|
+
limit: 6,
|
|
1385
|
+
...e ? { tag: e } : {}
|
|
1386
|
+
}, n.fetch);
|
|
1387
|
+
U.set(i, t.items, !0), U.set(o, null);
|
|
1388
|
+
} catch (e) {
|
|
1389
|
+
console.error("RecentDocs: failed to load recent documents", e), U.set(o, "Failed to load recent documents");
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1392
|
+
Et(() => {
|
|
1393
|
+
N();
|
|
1394
|
+
}), U.user_effect(() => {
|
|
1395
|
+
vt() !== 0 && N();
|
|
1396
|
+
});
|
|
1397
|
+
let ue = !0;
|
|
1398
|
+
U.user_effect(() => {
|
|
1399
|
+
H(), ue ? ue = !1 : N();
|
|
1400
|
+
});
|
|
1401
|
+
async function P() {
|
|
1402
|
+
await N();
|
|
1403
|
+
}
|
|
1404
|
+
Tt(() => {
|
|
1405
|
+
u &&= (clearTimeout(u), null);
|
|
1406
|
+
});
|
|
1407
|
+
async function de(e, t) {
|
|
1408
|
+
if (e.preventDefault(), e.stopPropagation(), typeof window > "u") return;
|
|
1409
|
+
let r = U.get(i).find((e) => e.id === t), a = "";
|
|
1410
|
+
U.set(l, t, !0);
|
|
1411
|
+
try {
|
|
1412
|
+
a = (await He(t, n.fetch)).content ?? "";
|
|
1413
|
+
} catch (e) {
|
|
1414
|
+
console.error("RecentDocs: failed to fetch full document for copy", e), a = r?.excerpt ?? r?.content ?? "";
|
|
1415
|
+
} finally {
|
|
1416
|
+
U.set(l, null);
|
|
1417
|
+
}
|
|
1418
|
+
a && await yt(a) && (U.set(c, t, !0), u && clearTimeout(u), u = setTimeout(() => {
|
|
1419
|
+
U.set(c, null), u = null;
|
|
1420
|
+
}, 2e3));
|
|
1421
|
+
}
|
|
1422
|
+
function F(e, t) {
|
|
1423
|
+
U.set(ie, {
|
|
1424
|
+
id: e,
|
|
1425
|
+
title: t
|
|
1426
|
+
}, !0), U.set(w, t, !0), U.set(T, null), U.set(f, !0);
|
|
1427
|
+
}
|
|
1428
|
+
function fe() {
|
|
1429
|
+
U.set(f, !1), U.set(ie, null), U.set(w, ""), U.set(T, null), U.set(D, !1);
|
|
1430
|
+
}
|
|
1431
|
+
async function pe(e) {
|
|
1432
|
+
e?.preventDefault();
|
|
1433
|
+
let t = U.get(ie);
|
|
1434
|
+
if (!t) return;
|
|
1435
|
+
let r = U.get(w).trim();
|
|
1436
|
+
if (r.length === 0) U.set(T, "Name is required");
|
|
1437
|
+
else {
|
|
1438
|
+
U.set(D, !0);
|
|
1439
|
+
try {
|
|
1440
|
+
await Ve(t.id, { title: r }, n.fetch), fe(), await N(), mt();
|
|
1441
|
+
} catch (e) {
|
|
1442
|
+
console.error("RecentDocs: rename failed", e), U.set(T, e instanceof Error ? e.message : Se(), !0);
|
|
1443
|
+
} finally {
|
|
1444
|
+
U.set(D, !1);
|
|
1445
|
+
}
|
|
1446
|
+
}
|
|
1447
|
+
}
|
|
1448
|
+
function me(e, t) {
|
|
1449
|
+
U.set(k, {
|
|
1450
|
+
id: e,
|
|
1451
|
+
title: t
|
|
1452
|
+
}, !0), U.set(O, !0);
|
|
1453
|
+
}
|
|
1454
|
+
function I() {
|
|
1455
|
+
U.set(O, !1), U.set(k, null), U.set(A, !1);
|
|
1456
|
+
}
|
|
1457
|
+
async function ve() {
|
|
1458
|
+
let e = U.get(k);
|
|
1459
|
+
if (e && !U.get(A)) {
|
|
1460
|
+
U.set(A, !0);
|
|
1461
|
+
try {
|
|
1462
|
+
await Ue(e.id, n.fetch), I(), await N(), mt();
|
|
1463
|
+
} catch (e) {
|
|
1464
|
+
console.error("RecentDocs: delete failed", e), U.set(o, e instanceof Error ? e.message : Se(), !0), U.set(A, !1);
|
|
1465
|
+
}
|
|
1466
|
+
}
|
|
1467
|
+
}
|
|
1468
|
+
var ye = { refreshRecentDocs: P }, R = tn(), z = U.first_child(R), B = U.child(z), we = U.only_child(B, !0), De = U.sibling(B, 2), Oe = (e) => {
|
|
1469
|
+
var t = q(), n = U.only_child(t, !0);
|
|
1470
|
+
U.template_effect(() => U.set_text(n, U.get(o))), U.append(e, t);
|
|
1471
|
+
};
|
|
1472
|
+
U.if(De, (e) => {
|
|
1473
|
+
U.get(o) && e(Oe);
|
|
1474
|
+
});
|
|
1475
|
+
var Me = U.sibling(De, 2);
|
|
1476
|
+
U.each(Me, 17, () => U.get(i), (e) => e.id, (e, t) => {
|
|
1477
|
+
var n = Qt(), r = U.child(n), i = U.child(r);
|
|
1478
|
+
Ee(i, { class: "size-4 shrink-0 text-muted-foreground" });
|
|
1479
|
+
var o = U.sibling(i, 2), s = U.child(o), u = U.only_child(s, !0), f = U.sibling(s, 2), p = U.only_child(f, !0);
|
|
1480
|
+
U.reset(o), U.reset(r);
|
|
1481
|
+
var m = U.sibling(r, 2), h = U.child(m), g = (e) => {
|
|
1482
|
+
Ae(e, { class: "size-3.5 animate-spin" });
|
|
1483
|
+
}, _ = (e) => {
|
|
1484
|
+
Ce(e, { class: "size-3.5" });
|
|
1485
|
+
}, v = (e) => {
|
|
1486
|
+
Te(e, { class: "size-3.5" });
|
|
1487
|
+
};
|
|
1488
|
+
U.if(h, (e) => {
|
|
1489
|
+
U.get(l) === U.get(t).id ? e(g) : U.get(c) === U.get(t).id ? e(_, 1) : e(v, -1);
|
|
1490
|
+
}), U.reset(m);
|
|
1491
|
+
var y = U.sibling(m, 2);
|
|
1492
|
+
b(y, {
|
|
1493
|
+
children: (e, n) => {
|
|
1494
|
+
var r = J(), i = U.first_child(r);
|
|
1495
|
+
ee(i, {
|
|
1496
|
+
child: (e, t) => {
|
|
1497
|
+
let n = () => (t?.()).props;
|
|
1498
|
+
var r = Xt(), i = (e) => {
|
|
1499
|
+
e.preventDefault(), e.stopPropagation();
|
|
1500
|
+
};
|
|
1501
|
+
U.attribute_effect(r, (e, t) => ({
|
|
1502
|
+
...n(),
|
|
1503
|
+
type: "button",
|
|
1504
|
+
class: "sidebar-touch-action 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",
|
|
1505
|
+
"aria-label": e,
|
|
1506
|
+
title: t,
|
|
1507
|
+
onclick: i
|
|
1508
|
+
}), [() => L(), () => L()], void 0, void 0, "svelte-1uwxs9f");
|
|
1509
|
+
var a = U.child(r);
|
|
1510
|
+
je(a, { class: "size-3.5" }), U.reset(r), U.append(e, r);
|
|
1511
|
+
},
|
|
1512
|
+
$$slots: { child: !0 }
|
|
1513
|
+
});
|
|
1514
|
+
var a = U.sibling(i, 2);
|
|
1515
|
+
x(a, {
|
|
1516
|
+
align: "end",
|
|
1517
|
+
children: (e, n) => {
|
|
1518
|
+
var r = Zt(), i = U.first_child(r);
|
|
1519
|
+
S(i, {
|
|
1520
|
+
onSelect: () => F(U.get(t).id, U.get(t).title),
|
|
1521
|
+
children: (e, t) => {
|
|
1522
|
+
U.next();
|
|
1523
|
+
var n = U.text();
|
|
1524
|
+
U.template_effect((e) => U.set_text(n, e), [() => be()]), U.append(e, n);
|
|
1525
|
+
},
|
|
1526
|
+
$$slots: { default: !0 }
|
|
1527
|
+
});
|
|
1528
|
+
var a = U.sibling(i, 2);
|
|
1529
|
+
S(a, {
|
|
1530
|
+
onSelect: () => M(U.get(t).id, U.get(t).title),
|
|
1531
|
+
children: (e, t) => {
|
|
1532
|
+
U.next();
|
|
1533
|
+
var n = U.text();
|
|
1534
|
+
U.template_effect((e) => U.set_text(n, e), [() => _e()]), U.append(e, n);
|
|
1535
|
+
},
|
|
1536
|
+
$$slots: { default: !0 }
|
|
1537
|
+
});
|
|
1538
|
+
var o = U.sibling(a, 2);
|
|
1539
|
+
S(o, {
|
|
1540
|
+
class: "text-destructive focus:text-destructive",
|
|
1541
|
+
onSelect: () => me(U.get(t).id, U.get(t).title),
|
|
1542
|
+
children: (e, t) => {
|
|
1543
|
+
U.next();
|
|
1544
|
+
var n = U.text();
|
|
1545
|
+
U.template_effect((e) => U.set_text(n, e), [() => E()]), U.append(e, n);
|
|
1546
|
+
},
|
|
1547
|
+
$$slots: { default: !0 }
|
|
1548
|
+
}), U.append(e, r);
|
|
1549
|
+
},
|
|
1550
|
+
$$slots: { default: !0 }
|
|
1551
|
+
}), U.append(e, r);
|
|
1552
|
+
},
|
|
1553
|
+
$$slots: { default: !0 }
|
|
1554
|
+
}), U.reset(n), U.template_effect((e, n, i) => {
|
|
1555
|
+
U.set_attribute(r, "href", `/docs/${U.get(t).id}`), U.set_class(r, 1, e, "svelte-1uwxs9f"), U.set_text(u, U.get(t).title), U.set_text(p, U.get(t).updatedAt), U.set_class(m, 1, `sidebar-touch-action 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 ${U.get(c) === U.get(t).id || U.get(l) === U.get(t).id ? "opacity-100" : ""}`, "svelte-1uwxs9f"), U.set_attribute(m, "aria-label", n), U.set_attribute(m, "title", i), m.disabled = U.get(l) === U.get(t).id;
|
|
1556
|
+
}, [
|
|
1557
|
+
() => U.clsx(d("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", U.get(a) === U.get(t).id && "bg-accent text-accent-foreground")),
|
|
1558
|
+
() => C(),
|
|
1559
|
+
() => C()
|
|
1560
|
+
]), U.delegated("click", r, () => {
|
|
1561
|
+
U.set(a, U.get(t).id, !0);
|
|
1562
|
+
}), U.delegated("click", m, (e) => void de(e, U.get(t).id)), U.append(e, n);
|
|
1563
|
+
}), U.reset(z);
|
|
1564
|
+
var Ne = U.sibling(z, 2);
|
|
1565
|
+
g(Ne, {
|
|
1566
|
+
onOpenChange: (e) => {
|
|
1567
|
+
e || fe();
|
|
1568
|
+
},
|
|
1569
|
+
get open() {
|
|
1570
|
+
return U.get(f);
|
|
1571
|
+
},
|
|
1572
|
+
set open(e) {
|
|
1573
|
+
U.set(f, e, !0);
|
|
1574
|
+
},
|
|
1575
|
+
children: (e, t) => {
|
|
1576
|
+
p(e, {
|
|
1577
|
+
children: (e, t) => {
|
|
1578
|
+
var n = en(), r = U.first_child(n);
|
|
1579
|
+
h(r, {
|
|
1580
|
+
children: (e, t) => {
|
|
1581
|
+
var n = J(), r = U.first_child(n);
|
|
1582
|
+
y(r, {
|
|
1583
|
+
children: (e, t) => {
|
|
1584
|
+
U.next();
|
|
1585
|
+
var n = U.text();
|
|
1586
|
+
U.template_effect((e) => U.set_text(n, e), [() => be()]), U.append(e, n);
|
|
1587
|
+
},
|
|
1588
|
+
$$slots: { default: !0 }
|
|
1589
|
+
});
|
|
1590
|
+
var i = U.sibling(r, 2);
|
|
1591
|
+
m(i, {
|
|
1592
|
+
children: (e, t) => {
|
|
1593
|
+
U.next();
|
|
1594
|
+
var n = U.text();
|
|
1595
|
+
U.template_effect((e) => U.set_text(n, e), [() => xe()]), U.append(e, n);
|
|
1596
|
+
},
|
|
1597
|
+
$$slots: { default: !0 }
|
|
1598
|
+
}), U.append(e, n);
|
|
1599
|
+
},
|
|
1600
|
+
$$slots: { default: !0 }
|
|
1601
|
+
});
|
|
1602
|
+
var i = U.sibling(r, 2), a = U.child(i), o = U.child(a);
|
|
1603
|
+
ne(o, {
|
|
1604
|
+
for: "recent-rename-input",
|
|
1605
|
+
children: (e, t) => {
|
|
1606
|
+
U.next();
|
|
1607
|
+
var n = U.text();
|
|
1608
|
+
U.template_effect((e) => U.set_text(n, e), [() => xe()]), U.append(e, n);
|
|
1609
|
+
},
|
|
1610
|
+
$$slots: { default: !0 }
|
|
1611
|
+
});
|
|
1612
|
+
var s = U.sibling(o, 2);
|
|
1613
|
+
{
|
|
1614
|
+
let e = U.derived(() => U.get(T) ? "true" : void 0), t = U.derived(() => U.get(T) ? "recent-rename-input-error" : void 0);
|
|
1615
|
+
te(s, {
|
|
1616
|
+
id: "recent-rename-input",
|
|
1617
|
+
name: "name",
|
|
1618
|
+
type: "text",
|
|
1619
|
+
maxlength: 255,
|
|
1620
|
+
required: !0,
|
|
1621
|
+
get disabled() {
|
|
1622
|
+
return U.get(D);
|
|
1623
|
+
},
|
|
1624
|
+
get "aria-invalid"() {
|
|
1625
|
+
return U.get(e);
|
|
1626
|
+
},
|
|
1627
|
+
get "aria-describedby"() {
|
|
1628
|
+
return U.get(t);
|
|
1629
|
+
},
|
|
1630
|
+
autocomplete: "off",
|
|
1631
|
+
get value() {
|
|
1632
|
+
return U.get(w);
|
|
1633
|
+
},
|
|
1634
|
+
set value(e) {
|
|
1635
|
+
U.set(w, e, !0);
|
|
1636
|
+
}
|
|
1637
|
+
});
|
|
1638
|
+
}
|
|
1639
|
+
var c = U.sibling(s, 2), l = (e) => {
|
|
1640
|
+
var t = $t(), n = U.only_child(t, !0);
|
|
1641
|
+
U.template_effect(() => U.set_text(n, U.get(T))), U.append(e, t);
|
|
1642
|
+
};
|
|
1643
|
+
U.if(c, (e) => {
|
|
1644
|
+
U.get(T) && e(l);
|
|
1645
|
+
}), U.reset(a), U.reset(i);
|
|
1646
|
+
var u = U.sibling(i, 2);
|
|
1647
|
+
_(u, {
|
|
1648
|
+
children: (e, t) => {
|
|
1649
|
+
var n = J(), r = U.first_child(n);
|
|
1650
|
+
v(r, {
|
|
1651
|
+
variant: "outline",
|
|
1652
|
+
type: "button",
|
|
1653
|
+
onclick: fe,
|
|
1654
|
+
get disabled() {
|
|
1655
|
+
return U.get(D);
|
|
1656
|
+
},
|
|
1657
|
+
children: (e, t) => {
|
|
1658
|
+
U.next();
|
|
1659
|
+
var n = U.text();
|
|
1660
|
+
U.template_effect((e) => U.set_text(n, e), [() => re()]), U.append(e, n);
|
|
1661
|
+
},
|
|
1662
|
+
$$slots: { default: !0 }
|
|
1663
|
+
});
|
|
1664
|
+
var i = U.sibling(r, 2);
|
|
1665
|
+
{
|
|
1666
|
+
let e = U.derived(() => U.get(D) || U.get(w).trim().length === 0);
|
|
1667
|
+
v(i, {
|
|
1668
|
+
type: "submit",
|
|
1669
|
+
onclick: pe,
|
|
1670
|
+
get disabled() {
|
|
1671
|
+
return U.get(e);
|
|
1672
|
+
},
|
|
1673
|
+
children: (e, t) => {
|
|
1674
|
+
U.next();
|
|
1675
|
+
var n = U.text();
|
|
1676
|
+
U.template_effect((e) => U.set_text(n, e), [() => U.get(D) ? he() : ge()]), U.append(e, n);
|
|
1677
|
+
},
|
|
1678
|
+
$$slots: { default: !0 }
|
|
1679
|
+
});
|
|
1680
|
+
}
|
|
1681
|
+
U.append(e, n);
|
|
1682
|
+
},
|
|
1683
|
+
$$slots: { default: !0 }
|
|
1684
|
+
}), U.event("submit", i, pe), U.append(e, n);
|
|
1685
|
+
},
|
|
1686
|
+
$$slots: { default: !0 }
|
|
1687
|
+
});
|
|
1688
|
+
},
|
|
1689
|
+
$$slots: { default: !0 }
|
|
1690
|
+
});
|
|
1691
|
+
var Pe = U.sibling(Ne, 2);
|
|
1692
|
+
{
|
|
1693
|
+
let e = U.derived(() => oe()), t = U.derived(() => se()), n = U.derived(() => E()), r = U.derived(() => re());
|
|
1694
|
+
V(Pe, {
|
|
1695
|
+
get title() {
|
|
1696
|
+
return U.get(e);
|
|
1697
|
+
},
|
|
1698
|
+
get description() {
|
|
1699
|
+
return U.get(t);
|
|
1700
|
+
},
|
|
1701
|
+
get confirmLabel() {
|
|
1702
|
+
return U.get(n);
|
|
1703
|
+
},
|
|
1704
|
+
get cancelLabel() {
|
|
1705
|
+
return U.get(r);
|
|
1706
|
+
},
|
|
1707
|
+
variant: "destructive",
|
|
1708
|
+
get busy() {
|
|
1709
|
+
return U.get(A);
|
|
1710
|
+
},
|
|
1711
|
+
onConfirm: ve,
|
|
1712
|
+
onCancel: I,
|
|
1713
|
+
get open() {
|
|
1714
|
+
return U.get(O);
|
|
1715
|
+
},
|
|
1716
|
+
set open(e) {
|
|
1717
|
+
U.set(O, e, !0);
|
|
1718
|
+
}
|
|
1719
|
+
});
|
|
1720
|
+
}
|
|
1721
|
+
var Fe = U.sibling(Pe, 2);
|
|
1722
|
+
return Ze(Fe, {
|
|
1723
|
+
get displayMode() {
|
|
1724
|
+
return r.displayMode;
|
|
1725
|
+
},
|
|
1726
|
+
get documentId() {
|
|
1727
|
+
return U.get(ce);
|
|
1728
|
+
},
|
|
1729
|
+
get documentTitle() {
|
|
1730
|
+
return U.get(le);
|
|
1731
|
+
},
|
|
1732
|
+
get open() {
|
|
1733
|
+
return U.get(j);
|
|
1734
|
+
},
|
|
1735
|
+
set open(e) {
|
|
1736
|
+
U.set(j, e, !0);
|
|
1737
|
+
}
|
|
1738
|
+
}), U.template_effect((e) => U.set_text(we, e), [() => ae()]), U.append(e, R), U.pop(ye);
|
|
1739
|
+
}
|
|
1740
|
+
U.delegate(["click"]);
|
|
1741
|
+
// src/lib/components/sidebar/TagList.svelte
|
|
1742
|
+
var rn = U.from_html("<p class=\"px-2 text-xs text-destructive\"> </p>"), an = U.from_html("<button><!></button>"), on = U.from_html("<!> <!>", 1), sn = U.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>"), Y = U.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);
|
|
1743
|
+
function cn(e, t) {
|
|
1744
|
+
U.push(t, !0);
|
|
1745
|
+
let n = s(), r = U.state(U.proxy([])), i = U.state(null), a = U.state(!1), o = U.state(null), c = U.state(!1), l = U.state(null), u = U.state(!1);
|
|
1746
|
+
async function f() {
|
|
1747
|
+
try {
|
|
1748
|
+
U.set(r, await xt(n.fetch), !0);
|
|
1749
|
+
} catch (e) {
|
|
1750
|
+
console.error("TagList: failed to load tags", e), U.set(i, F(), !0);
|
|
1751
|
+
}
|
|
1752
|
+
}
|
|
1753
|
+
Et(() => {
|
|
1754
|
+
f();
|
|
1755
|
+
}), U.user_effect(() => {
|
|
1756
|
+
ht(), f();
|
|
1757
|
+
});
|
|
1758
|
+
function p(e) {
|
|
1759
|
+
U.set(r, [...U.get(r), e], !0), gt(), f();
|
|
1760
|
+
}
|
|
1761
|
+
function m(e) {
|
|
1762
|
+
U.set(r, U.get(r).map((t) => t.id === e.id ? e : t), !0), gt();
|
|
1763
|
+
}
|
|
1764
|
+
function h(e) {
|
|
1765
|
+
U.set(o, e, !0), U.set(a, !0);
|
|
1766
|
+
}
|
|
1767
|
+
function g() {
|
|
1768
|
+
U.set(o, null);
|
|
1769
|
+
}
|
|
1770
|
+
function _(e) {
|
|
1771
|
+
U.set(l, e, !0), U.set(c, !0);
|
|
1772
|
+
}
|
|
1773
|
+
function v() {
|
|
1774
|
+
U.set(c, !1), U.set(l, null);
|
|
1775
|
+
}
|
|
1776
|
+
async function y() {
|
|
1777
|
+
let e = U.get(l);
|
|
1778
|
+
if (e && !U.get(u)) {
|
|
1779
|
+
U.set(u, !0);
|
|
1780
|
+
try {
|
|
1781
|
+
await bt(e.id, n.fetch), U.set(r, U.get(r).filter((t) => t.id !== e.id), !0), H() === e.id && _t(null), U.set(c, !1), U.set(l, null), gt();
|
|
1782
|
+
} catch (e) {
|
|
1783
|
+
console.error("TagList: deleteTag failed", e), U.set(i, Se(), !0);
|
|
1784
|
+
} finally {
|
|
1785
|
+
U.set(u, !1);
|
|
1786
|
+
}
|
|
1787
|
+
}
|
|
1788
|
+
}
|
|
1789
|
+
var te = Y(), ne = U.first_child(te), C = U.child(ne), ie = U.only_child(C, !0), w = U.sibling(C, 2), T = (e) => {
|
|
1790
|
+
var t = rn(), n = U.only_child(t, !0);
|
|
1791
|
+
U.template_effect(() => U.set_text(n, U.get(i))), U.append(e, t);
|
|
1792
|
+
};
|
|
1793
|
+
U.if(w, (e) => {
|
|
1794
|
+
U.get(i) && e(T);
|
|
1795
|
+
});
|
|
1796
|
+
var D = U.sibling(w, 2), ae = U.child(D);
|
|
1797
|
+
U.each(ae, 17, () => U.get(r), (e) => e.id, (e, t) => {
|
|
1798
|
+
var n = sn(), r = U.child(n), i = U.child(r), a = U.sibling(i);
|
|
1799
|
+
U.reset(r);
|
|
1800
|
+
var o = U.sibling(r, 2);
|
|
1801
|
+
b(o, {
|
|
1802
|
+
children: (e, n) => {
|
|
1803
|
+
var r = on(), i = U.first_child(r);
|
|
1804
|
+
ee(i, {
|
|
1805
|
+
child: (e, n) => {
|
|
1806
|
+
let r = () => (n?.()).props;
|
|
1807
|
+
var i = an();
|
|
1808
|
+
U.attribute_effect(i, (e, t, n) => ({
|
|
1809
|
+
...r(),
|
|
1810
|
+
type: "button",
|
|
1811
|
+
class: e,
|
|
1812
|
+
"aria-label": t,
|
|
1813
|
+
title: n,
|
|
1814
|
+
disabled: U.get(u)
|
|
1815
|
+
}), [
|
|
1816
|
+
() => d("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", H() === U.get(t).id && "inline-flex"),
|
|
1817
|
+
() => L(),
|
|
1818
|
+
() => L()
|
|
1819
|
+
]);
|
|
1820
|
+
var a = U.child(i), o = (e) => {
|
|
1821
|
+
Ae(e, { class: "size-3 animate-spin" });
|
|
1822
|
+
}, s = (e) => {
|
|
1823
|
+
je(e, { class: "size-3" });
|
|
1824
|
+
};
|
|
1825
|
+
U.if(a, (e) => {
|
|
1826
|
+
U.get(u) ? e(o) : e(s, -1);
|
|
1827
|
+
}), U.reset(i), U.append(e, i);
|
|
1828
|
+
},
|
|
1829
|
+
$$slots: { child: !0 }
|
|
1830
|
+
});
|
|
1831
|
+
var a = U.sibling(i, 2);
|
|
1832
|
+
x(a, {
|
|
1833
|
+
align: "start",
|
|
1834
|
+
children: (e, n) => {
|
|
1835
|
+
var r = on(), i = U.first_child(r);
|
|
1836
|
+
S(i, {
|
|
1837
|
+
onSelect: () => h(U.get(t)),
|
|
1838
|
+
children: (e, t) => {
|
|
1839
|
+
U.next();
|
|
1840
|
+
var n = U.text();
|
|
1841
|
+
U.template_effect((e) => U.set_text(n, e), [() => pe()]), U.append(e, n);
|
|
1842
|
+
},
|
|
1843
|
+
$$slots: { default: !0 }
|
|
1844
|
+
});
|
|
1845
|
+
var a = U.sibling(i, 2);
|
|
1846
|
+
S(a, {
|
|
1847
|
+
class: "text-destructive focus:text-destructive",
|
|
1848
|
+
onSelect: () => _(U.get(t)),
|
|
1849
|
+
children: (e, t) => {
|
|
1850
|
+
U.next();
|
|
1851
|
+
var n = U.text();
|
|
1852
|
+
U.template_effect((e) => U.set_text(n, e), [() => E()]), U.append(e, n);
|
|
1853
|
+
},
|
|
1854
|
+
$$slots: { default: !0 }
|
|
1855
|
+
}), U.append(e, r);
|
|
1856
|
+
},
|
|
1857
|
+
$$slots: { default: !0 }
|
|
1858
|
+
}), U.append(e, r);
|
|
1859
|
+
},
|
|
1860
|
+
$$slots: { default: !0 }
|
|
1861
|
+
}), U.reset(n), U.template_effect((e, o) => {
|
|
1862
|
+
U.set_class(n, 1, e), U.set_attribute(r, "aria-pressed", o), U.set_style(i, `background-color: ${(U.get(t).color || "#888888") ?? ""}`), U.set_text(a, ` ${U.get(t).name ?? ""}`);
|
|
1863
|
+
}, [() => U.clsx(d("group/tag relative inline-flex items-center rounded-full transition-colors", H() === U.get(t).id ? "bg-primary text-primary-foreground" : "bg-secondary text-secondary-foreground hover:bg-secondary/80")), () => H() === U.get(t).id]), U.delegated("click", r, () => _t(H() === U.get(t).id ? null : U.get(t).id, U.get(t).name)), U.append(e, n);
|
|
1864
|
+
});
|
|
1865
|
+
var O = U.sibling(ae, 2), k = U.child(O);
|
|
1866
|
+
De(k, { class: "size-3" });
|
|
1867
|
+
var oe = U.sibling(k);
|
|
1868
|
+
U.reset(O), U.reset(D), U.reset(ne);
|
|
1869
|
+
var se = U.sibling(ne, 2);
|
|
1870
|
+
{
|
|
1871
|
+
let e = U.derived(() => U.get(o) ? "edit" : "create");
|
|
1872
|
+
St(se, {
|
|
1873
|
+
get mode() {
|
|
1874
|
+
return U.get(e);
|
|
1875
|
+
},
|
|
1876
|
+
get tag() {
|
|
1877
|
+
return U.get(o);
|
|
1878
|
+
},
|
|
1879
|
+
onCreated: p,
|
|
1880
|
+
onUpdated: m,
|
|
1881
|
+
onClose: g,
|
|
1882
|
+
get open() {
|
|
1883
|
+
return U.get(a);
|
|
1884
|
+
},
|
|
1885
|
+
set open(e) {
|
|
1886
|
+
U.set(a, e, !0);
|
|
1887
|
+
}
|
|
1888
|
+
});
|
|
1889
|
+
}
|
|
1890
|
+
var ce = U.sibling(se, 2);
|
|
1891
|
+
{
|
|
1892
|
+
let e = U.derived(() => M()), t = U.derived(() => P()), n = U.derived(() => E()), r = U.derived(() => re());
|
|
1893
|
+
V(ce, {
|
|
1894
|
+
get title() {
|
|
1895
|
+
return U.get(e);
|
|
1896
|
+
},
|
|
1897
|
+
get description() {
|
|
1898
|
+
return U.get(t);
|
|
1899
|
+
},
|
|
1900
|
+
get confirmLabel() {
|
|
1901
|
+
return U.get(n);
|
|
1902
|
+
},
|
|
1903
|
+
get cancelLabel() {
|
|
1904
|
+
return U.get(r);
|
|
1905
|
+
},
|
|
1906
|
+
variant: "destructive",
|
|
1907
|
+
get busy() {
|
|
1908
|
+
return U.get(u);
|
|
1909
|
+
},
|
|
1910
|
+
onConfirm: y,
|
|
1911
|
+
onCancel: v,
|
|
1912
|
+
get open() {
|
|
1913
|
+
return U.get(c);
|
|
1914
|
+
},
|
|
1915
|
+
set open(e) {
|
|
1916
|
+
U.set(c, e, !0);
|
|
1917
|
+
}
|
|
1918
|
+
});
|
|
1919
|
+
}
|
|
1920
|
+
U.template_effect((e, t, n) => {
|
|
1921
|
+
U.set_text(ie, e), U.set_attribute(O, "aria-label", t), U.set_text(oe, ` ${n ?? ""}`);
|
|
1922
|
+
}, [
|
|
1923
|
+
() => A(),
|
|
1924
|
+
() => B(),
|
|
1925
|
+
() => j()
|
|
1926
|
+
]), U.delegated("click", O, () => {
|
|
1927
|
+
U.set(o, null), U.set(a, !0);
|
|
1928
|
+
}), U.append(e, te), U.pop();
|
|
1929
|
+
}
|
|
1930
|
+
U.delegate(["click"]);
|
|
1931
|
+
// src/lib/components/sidebar/Sidebar.svelte
|
|
1932
|
+
var ln = U.from_html("<div role=\"separator\" tabindex=\"-1\"></div>"), X = U.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>"), un = U.from_html("<!> <div class=\"h-px bg-border\"></div>", 1), dn = U.from_html("<span class=\"rounded bg-muted px-1.5 py-0.5 text-xs\"> </span>"), Z = U.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>"), fn = U.from_html("<div class=\"h-px bg-border\"></div> <nav class=\"space-y-1\" aria-label=\"Product navigation\"></nav>", 1), pn = U.from_html("<div class=\"flex flex-1 flex-col gap-4 overflow-y-auto p-3\"><!> <!> <!> <!> <!> <!></div>"), mn = U.from_html("<span class=\"text-xs\"> </span>"), hn = U.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>"), gn = U.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>"), _n = U.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>"), vn = U.from_html("<div class=\"flex items-center justify-between\"><a href=\"https://docsmint.com\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"text-xs text-muted-foreground hover:text-foreground transition-colors\"> </a> <div class=\"flex items-center gap-1\"><!> <button type=\"button\" class=\"flex size-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground\"><!></button></div></div>"), yn = U.from_html("<aside tabindex=\"-1\"><!> <!> <!> <div class=\"border-t border-border p-2\"><!></div></aside> <!>", 1);
|
|
1933
|
+
function bn(t, r) {
|
|
1934
|
+
U.push(r, !0);
|
|
1935
|
+
let o = U.prop(r, "mobile", 3, !1), s = U.prop(r, "mobileOpen", 3, !1), p = U.prop(r, "element", 15, null), m = "hiai_sidebar_collapsed", h = u(), g = U.state(!1), _ = U.state(!1), v = U.state("all"), y = U.derived(() => !o() && U.get(g)), b = U.state(256), x = U.state(!1), S = Ct(), ee = U.derived(() => wt(S.sidebarTop, { pathname: W.url.pathname })), te = U.derived(() => wt(S.sidebarFooterActions, { pathname: W.url.pathname })), ne = U.derived(() => wt(S.navigation, { pathname: W.url.pathname }));
|
|
1936
|
+
Et(() => {
|
|
1937
|
+
let e = () => {
|
|
1938
|
+
it(), mt();
|
|
1939
|
+
};
|
|
1940
|
+
return window.addEventListener("hiai-docs:documents-updated", e), () => window.removeEventListener("hiai-docs:documents-updated", e);
|
|
1941
|
+
}), U.user_effect(() => {
|
|
1942
|
+
if (typeof window < "u") {
|
|
1943
|
+
try {
|
|
1944
|
+
U.set(g, localStorage.getItem(m) === "1");
|
|
1945
|
+
} catch {}
|
|
1946
|
+
let e = localStorage.getItem("hiai_sidebar_width");
|
|
1947
|
+
if (e) {
|
|
1948
|
+
let t = parseInt(e, 10);
|
|
1949
|
+
!Number.isNaN(t) && t >= 180 && t <= 500 && U.set(b, t, !0);
|
|
1950
|
+
}
|
|
1951
|
+
}
|
|
1952
|
+
}), U.user_effect(() => {
|
|
1953
|
+
if (U.get(x)) return window.addEventListener("mousemove", C), window.addEventListener("mouseup", ie), () => {
|
|
1954
|
+
window.removeEventListener("mousemove", C), window.removeEventListener("mouseup", ie);
|
|
1955
|
+
};
|
|
1956
|
+
});
|
|
1957
|
+
function re(e) {
|
|
1958
|
+
e.preventDefault(), U.set(x, !0);
|
|
1959
|
+
}
|
|
1960
|
+
function C(e) {
|
|
1961
|
+
let t = Math.max(180, Math.min(500, e.clientX));
|
|
1962
|
+
U.set(b, t, !0);
|
|
1963
|
+
}
|
|
1964
|
+
function ie() {
|
|
1965
|
+
U.set(x, !1), localStorage.setItem("hiai_sidebar_width", U.get(b).toString());
|
|
1966
|
+
}
|
|
1967
|
+
function w() {
|
|
1968
|
+
return l(h, "/search");
|
|
1969
|
+
}
|
|
1970
|
+
function T(e) {
|
|
1971
|
+
U.set(v, U.get(v) === e ? "all" : e, !0), U.set(g, !1), D();
|
|
1972
|
+
}
|
|
1973
|
+
function E() {
|
|
1974
|
+
U.set(g, !U.get(g)), D(), U.get(g) && U.set(v, "all");
|
|
1975
|
+
}
|
|
1976
|
+
function D() {
|
|
1977
|
+
if (typeof localStorage < "u") try {
|
|
1978
|
+
localStorage.setItem(m, U.get(g) ? "1" : "0");
|
|
1979
|
+
} catch {}
|
|
1980
|
+
}
|
|
1981
|
+
var O = yn(), k = U.first_child(O), oe = U.child(k), se = (e) => {
|
|
1982
|
+
var t = ln();
|
|
1983
|
+
U.template_effect((e) => U.set_class(t, 1, e), [() => U.clsx(d("absolute right-0 top-0 z-40 h-full w-1 cursor-col-resize hover:bg-primary/50 transition-colors", U.get(x) && "bg-primary w-1"))]), U.delegated("mousedown", t, re), U.append(e, t);
|
|
1984
|
+
};
|
|
1985
|
+
U.if(oe, (e) => {
|
|
1986
|
+
!o() && !U.get(y) && e(se);
|
|
1987
|
+
});
|
|
1988
|
+
var j = U.sibling(oe, 2), ce = (e) => {
|
|
1989
|
+
var t = X(), n = U.child(t), r = (e) => {
|
|
1990
|
+
K(e, { class: "size-3.5" });
|
|
1991
|
+
}, i = (e) => {
|
|
1992
|
+
G(e, { class: "size-3.5" });
|
|
1993
|
+
};
|
|
1994
|
+
U.if(n, (e) => {
|
|
1995
|
+
U.get(y) ? e(r) : e(i, -1);
|
|
1996
|
+
}), U.reset(t), U.delegated("click", t, E), U.append(e, t);
|
|
1997
|
+
};
|
|
1998
|
+
U.if(j, (e) => {
|
|
1999
|
+
o() || e(ce);
|
|
2000
|
+
});
|
|
2001
|
+
var le = U.sibling(j, 2), M = (e) => {
|
|
2002
|
+
var t = pn(), n = U.child(t);
|
|
2003
|
+
U.each(n, 17, () => U.get(ee), (e) => e.id, (e, t) => {
|
|
2004
|
+
let n = U.derived(() => U.get(t).component);
|
|
2005
|
+
var r = U.comment(), i = U.first_child(r);
|
|
2006
|
+
U.component(i, () => U.get(n), (e, t) => {
|
|
2007
|
+
t(e, { collapsed: !1 });
|
|
2008
|
+
}), U.append(e, r);
|
|
2009
|
+
});
|
|
2010
|
+
var r = U.sibling(n, 2);
|
|
2011
|
+
Mt(r, { class: "mr-5" });
|
|
2012
|
+
var i = U.sibling(r, 2), a = (e) => {
|
|
2013
|
+
var t = un();
|
|
2014
|
+
Yt(U.first_child(t), {}), U.next(2), U.append(e, t);
|
|
2015
|
+
};
|
|
2016
|
+
U.if(i, (e) => {
|
|
2017
|
+
U.get(v) === "all" && e(a);
|
|
2018
|
+
});
|
|
2019
|
+
var o = U.sibling(i, 2), s = (e) => {
|
|
2020
|
+
var t = un();
|
|
2021
|
+
nn(U.first_child(t), {}), U.next(2), U.append(e, t);
|
|
2022
|
+
};
|
|
2023
|
+
U.if(o, (e) => {
|
|
2024
|
+
(U.get(v) === "all" || U.get(v) === "recent") && e(s);
|
|
2025
|
+
});
|
|
2026
|
+
var l = U.sibling(o, 2), u = (e) => {
|
|
2027
|
+
cn(e, {});
|
|
2028
|
+
};
|
|
2029
|
+
U.if(l, (e) => {
|
|
2030
|
+
(U.get(v) === "all" || U.get(v) === "tags") && e(u);
|
|
2031
|
+
});
|
|
2032
|
+
var d = U.sibling(l, 2), f = (e) => {
|
|
2033
|
+
var t = fn(), n = U.sibling(U.first_child(t), 2);
|
|
2034
|
+
U.each(n, 21, () => U.get(ne), (e) => e.id, (e, t) => {
|
|
2035
|
+
let n = U.derived(() => U.get(t).icon);
|
|
2036
|
+
var r = Z(), i = U.child(r), a = (e) => {
|
|
2037
|
+
var t = U.comment(), r = U.first_child(t);
|
|
2038
|
+
U.component(r, () => U.get(n), (e, t) => {
|
|
2039
|
+
t(e, { class: "size-4" });
|
|
2040
|
+
}), U.append(e, t);
|
|
2041
|
+
};
|
|
2042
|
+
U.if(i, (e) => {
|
|
2043
|
+
U.get(n) && e(a);
|
|
2044
|
+
});
|
|
2045
|
+
var o = U.sibling(i, 2), s = U.only_child(o, !0), l = U.sibling(o, 2), u = (e) => {
|
|
2046
|
+
var n = dn(), r = U.only_child(n, !0);
|
|
2047
|
+
U.template_effect(() => U.set_text(r, U.get(t).badge)), U.append(e, n);
|
|
2048
|
+
};
|
|
2049
|
+
U.if(l, (e) => {
|
|
2050
|
+
U.get(t).badge !== void 0 && e(u);
|
|
2051
|
+
}), U.reset(r), U.template_effect((e) => {
|
|
2052
|
+
U.set_attribute(r, "href", e), U.set_attribute(r, "aria-disabled", U.get(t).disabled), U.set_text(s, U.get(t).label);
|
|
2053
|
+
}, [() => U.get(t).href ? c(h, U.get(t).href) : "#"]), U.append(e, r);
|
|
2054
|
+
}), U.reset(n), U.append(e, t);
|
|
2055
|
+
};
|
|
2056
|
+
U.if(d, (e) => {
|
|
2057
|
+
U.get(v) === "all" && U.get(ne).length > 0 && e(f);
|
|
2058
|
+
}), U.reset(t), U.append(e, t);
|
|
2059
|
+
}, ue = (t) => {
|
|
2060
|
+
var r = gn(), o = U.child(r);
|
|
2061
|
+
U.each(o, 17, () => U.get(ee), (e) => e.id, (e, t) => {
|
|
2062
|
+
let n = U.derived(() => U.get(t).component);
|
|
2063
|
+
var r = U.comment(), i = U.first_child(r);
|
|
2064
|
+
U.component(i, () => U.get(n), (e, t) => {
|
|
2065
|
+
t(e, { collapsed: !0 });
|
|
2066
|
+
}), U.append(e, r);
|
|
2067
|
+
});
|
|
2068
|
+
var s = U.sibling(o, 2), u = U.child(s);
|
|
2069
|
+
n(u, { class: "size-4" }), U.reset(s);
|
|
2070
|
+
var d = U.sibling(s, 2), f = U.child(d);
|
|
2071
|
+
i(f, { class: "size-4" }), U.reset(d);
|
|
2072
|
+
var p = U.sibling(d, 2), m = U.child(p);
|
|
2073
|
+
e(m, { class: "size-4" }), U.reset(p);
|
|
2074
|
+
var g = U.sibling(p, 2), _ = U.child(g);
|
|
2075
|
+
a(_, { class: "size-4" }), U.reset(g);
|
|
2076
|
+
var v = U.sibling(g, 2);
|
|
2077
|
+
U.each(v, 17, () => U.get(ne), (e) => e.id, (e, t) => {
|
|
2078
|
+
let n = U.derived(() => U.get(t).icon);
|
|
2079
|
+
var r = hn(), i = U.child(r), a = (e) => {
|
|
2080
|
+
var t = U.comment(), r = U.first_child(t);
|
|
2081
|
+
U.component(r, () => U.get(n), (e, t) => {
|
|
2082
|
+
t(e, { class: "size-4" });
|
|
2083
|
+
}), U.append(e, t);
|
|
2084
|
+
}, o = (e) => {
|
|
2085
|
+
var n = mn(), r = U.only_child(n, !0);
|
|
2086
|
+
U.template_effect((e) => U.set_text(r, e), [() => U.get(t).label.slice(0, 1)]), U.append(e, n);
|
|
2087
|
+
};
|
|
2088
|
+
U.if(i, (e) => {
|
|
2089
|
+
U.get(n) ? e(a) : e(o, -1);
|
|
2090
|
+
}), U.reset(r), U.template_effect((e) => {
|
|
2091
|
+
U.set_attribute(r, "href", e), U.set_attribute(r, "aria-disabled", U.get(t).disabled), U.set_attribute(r, "title", U.get(t).label), U.set_attribute(r, "aria-label", U.get(t).label);
|
|
2092
|
+
}, [() => U.get(t).href ? c(h, U.get(t).href) : "#"]), U.append(e, r);
|
|
2093
|
+
}), U.reset(r), U.template_effect((e, t, n, r, i, a, o, c) => {
|
|
2094
|
+
U.set_attribute(s, "title", e), U.set_attribute(s, "aria-label", t), U.set_attribute(d, "title", n), U.set_attribute(d, "aria-label", r), U.set_attribute(p, "title", i), U.set_attribute(p, "aria-label", a), U.set_attribute(g, "title", o), U.set_attribute(g, "aria-label", c);
|
|
2095
|
+
}, [
|
|
2096
|
+
() => de(),
|
|
2097
|
+
() => de(),
|
|
2098
|
+
() => z(),
|
|
2099
|
+
() => z(),
|
|
2100
|
+
() => ae(),
|
|
2101
|
+
() => ae(),
|
|
2102
|
+
() => A(),
|
|
2103
|
+
() => A()
|
|
2104
|
+
]), U.delegated("click", s, () => l(h, "/")), U.delegated("click", d, w), U.delegated("click", p, () => T("recent")), U.delegated("click", g, () => T("tags")), U.append(t, r);
|
|
2105
|
+
};
|
|
2106
|
+
U.if(le, (e) => {
|
|
2107
|
+
U.get(y) ? e(ue, -1) : e(M);
|
|
2108
|
+
});
|
|
2109
|
+
var P = U.sibling(le, 2), F = U.child(P), fe = (e) => {
|
|
2110
|
+
var t = _n(), n = U.child(t);
|
|
2111
|
+
U.each(n, 17, () => U.get(te), (e) => e.id, (e, t) => {
|
|
2112
|
+
let n = U.derived(() => U.get(t).component);
|
|
2113
|
+
var r = U.comment(), i = U.first_child(r);
|
|
2114
|
+
U.component(i, () => U.get(n), (e, t) => {
|
|
2115
|
+
t(e, { collapsed: !0 });
|
|
2116
|
+
}), U.append(e, r);
|
|
2117
|
+
});
|
|
2118
|
+
var r = U.sibling(n, 2);
|
|
2119
|
+
kt(U.child(r), { class: "size-4" }), U.reset(r);
|
|
2120
|
+
var i = U.sibling(r, 2);
|
|
2121
|
+
U.reset(t), U.template_effect((e, t, n, a) => {
|
|
2122
|
+
U.set_attribute(r, "title", e), U.set_attribute(r, "aria-label", t), U.set_attribute(i, "title", n), U.set_attribute(i, "aria-label", a);
|
|
2123
|
+
}, [
|
|
2124
|
+
() => I(),
|
|
2125
|
+
() => I(),
|
|
2126
|
+
() => N(),
|
|
2127
|
+
() => N()
|
|
2128
|
+
]), U.delegated("click", r, () => {
|
|
2129
|
+
U.set(_, !0);
|
|
2130
|
+
}), U.append(e, t);
|
|
2131
|
+
}, pe = (e) => {
|
|
2132
|
+
var t = vn(), n = U.child(t), r = U.only_child(n, !0), i = U.sibling(n, 2), a = U.child(i);
|
|
2133
|
+
U.each(a, 17, () => U.get(te), (e) => e.id, (e, t) => {
|
|
2134
|
+
let n = U.derived(() => U.get(t).component);
|
|
2135
|
+
var r = U.comment(), i = U.first_child(r);
|
|
2136
|
+
U.component(i, () => U.get(n), (e, t) => {
|
|
2137
|
+
t(e, { collapsed: !1 });
|
|
2138
|
+
}), U.append(e, r);
|
|
2139
|
+
});
|
|
2140
|
+
var o = U.sibling(a, 2);
|
|
2141
|
+
kt(U.child(o), { class: "size-4" }), U.reset(o), U.reset(i), U.reset(t), U.template_effect((e, t, i, a) => {
|
|
2142
|
+
U.set_attribute(n, "title", e), U.set_text(r, t), U.set_attribute(o, "title", i), U.set_attribute(o, "aria-label", a);
|
|
2143
|
+
}, [
|
|
2144
|
+
() => N(),
|
|
2145
|
+
() => N(),
|
|
2146
|
+
() => I(),
|
|
2147
|
+
() => I()
|
|
2148
|
+
]), U.delegated("click", o, () => {
|
|
2149
|
+
U.set(_, !0);
|
|
2150
|
+
}), U.append(e, t);
|
|
2151
|
+
};
|
|
2152
|
+
U.if(F, (e) => {
|
|
2153
|
+
U.get(y) ? e(fe) : e(pe, -1);
|
|
2154
|
+
}), U.reset(P), U.reset(k), U.bind_this(k, (e) => p(e), () => p());
|
|
2155
|
+
var me = U.sibling(k, 2);
|
|
2156
|
+
f(me, {
|
|
2157
|
+
get open() {
|
|
2158
|
+
return U.get(_);
|
|
2159
|
+
},
|
|
2160
|
+
set open(e) {
|
|
2161
|
+
U.set(_, e, !0);
|
|
2162
|
+
}
|
|
2163
|
+
}), U.template_effect((e) => {
|
|
2164
|
+
U.set_attribute(k, "id", o() ? "mobile-navigation" : void 0), U.set_attribute(k, "role", o() && s() ? "dialog" : void 0), U.set_attribute(k, "aria-modal", o() && s() ? "true" : void 0), U.set_attribute(k, "aria-label", o() ? "Navigation" : void 0), U.set_attribute(k, "aria-hidden", o() && !s() ? "true" : void 0), k.inert = o() && !s(), U.set_class(k, 1, e), U.set_style(k, o() ? "padding-top: env(safe-area-inset-top);" : U.get(y) ? "width: 48px;" : `width: ${U.get(b)}px;`);
|
|
2165
|
+
}, [() => U.clsx(d("flex flex-col border-r border-border bg-card font-sans", o() && "fixed inset-y-0 left-0 z-50 h-full w-[80%] max-w-[320px] shadow-xl transition-transform duration-300 ease-out", o() && (s() ? "translate-x-0" : "-translate-x-full"), !o() && "relative h-screen", !o() && !U.get(x) && "transition-[width] duration-200"))]), U.append(t, O), U.pop();
|
|
2166
|
+
}
|
|
2167
|
+
U.delegate(["mousedown", "click"]);
|
|
2168
|
+
export { bn as t };
|