@hiai-gg/docsmint 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backend/index.js +47 -8
- package/dist/backend-account-runtime-cleanup.js +20 -3
- package/dist/backend-api-key-facade.js +20 -3
- package/dist/backend-pipeline-cancellation.js +20 -3
- package/dist/frontend/{CategoryDialog-DyytjQn6.js → CategoryDialog-DmlX0Z97.js} +1 -1
- package/dist/frontend/DatePicker-D6E-EEtZ.js +340 -0
- package/dist/frontend/{FolderNode-DAGPgi-M.js → FolderNode-D3rN3yLV.js} +1 -1
- package/dist/frontend/{HiaiDocsExtensionProvider-CMiTXi2J.js → HiaiDocsExtensionProvider-OSn96BBw.js} +1 -1
- package/dist/frontend/{SettingsDialog-DEx1eEZm.js → SettingsDialog-Bd_S2RKW.js} +104 -96
- package/dist/frontend/ShareDialog-BC-Jl6v1.js +257 -0
- package/dist/frontend/{Sidebar-BdB8CfXS.js → Sidebar-BnZgNl_8.js} +679 -657
- package/dist/frontend/api/attachments.js +1 -1
- package/dist/frontend/app-shell.js +3 -3
- package/dist/frontend/{attachments-C2DBzU-r.js → attachments-B8AuDjno.js} +8 -5
- package/dist/frontend/components/category-dialog.js +1 -1
- package/dist/frontend/components/editor/document-editor.js +240 -228
- package/dist/frontend/components/folder-node.js +1 -1
- package/dist/frontend/components/save-as-dialog.js +1 -1
- package/dist/frontend/components/settings.js +1 -1
- package/dist/frontend/components/share-dialog.js +1 -1
- package/dist/frontend/components/sidebar.js +1 -1
- package/dist/frontend/{context-KLiM3QQ0.js → context-D0zPFXZ4.js} +2 -0
- package/dist/frontend/dashboard.js +1106 -1068
- package/dist/frontend/{dropdown-menu-Cre80-CJ.js → dropdown-menu-CJ_7V3N0.js} +43 -43
- package/dist/frontend/extension.d.ts +3 -2
- package/dist/frontend/extension.js +1 -1
- package/dist/frontend/{floating-layer-anchor-BDs7vO-M.js → floating-layer-anchor-S5RSefGN.js} +1 -1
- package/dist/frontend/frontend.css +1 -1
- package/dist/frontend/search.js +421 -405
- package/dist/frontend/{select-value-GXwx90Pr.js → select-value-JCAp2PmU.js} +466 -466
- package/dist/frontend/shared-document.js +1 -1
- package/dist/frontend-ssr/api/attachments.js +1 -1
- package/dist/frontend-ssr/app-shell.js +4 -4
- package/dist/frontend-ssr/assets/{CategoryDialog-CLAGMZPz.js → CategoryDialog-Cnlmr1sz.js} +2 -2
- package/dist/frontend-ssr/assets/{CreateSnapshotDialog-DNAjd4eD.js → CreateSnapshotDialog-b6O0nUVp.js} +1 -1
- package/dist/frontend-ssr/assets/{DatePicker-Cp6Qmgdb.js → DatePicker-D84cJ-Eq.js} +1 -1
- package/dist/frontend-ssr/assets/{FolderNode-Ty6fMbDu.js → FolderNode-CnFVWuQi.js} +2 -2
- package/dist/frontend-ssr/assets/{HiaiDocsExtensionProvider-B_MrN08c.js → HiaiDocsExtensionProvider-BRKWmcDd.js} +1 -1
- package/dist/frontend-ssr/assets/{SettingsDialog-BymUxBgg.js → SettingsDialog-BPdUl6pd.js} +23 -9
- package/dist/frontend-ssr/assets/ShareDialog-BZd28sg-.js +45 -0
- package/dist/frontend-ssr/assets/{Sidebar-DzbIUZFc.js → Sidebar-DwYZH0Tr.js} +49 -14
- package/dist/frontend-ssr/assets/{TagCreateDialog-B7wDbVqG.js → TagCreateDialog-DUPMitlL.js} +1 -1
- package/dist/frontend-ssr/assets/{attachments-CXgatN0B.js → attachments-Cj3fQyUp.js} +11 -4
- package/dist/frontend-ssr/assets/{confirm-dialog-B3C0WeMn.js → confirm-dialog-XuyaL8sr.js} +1 -1
- package/dist/frontend-ssr/assets/{context-BtCMqdVe.js → context-Bi_mO-NS.js} +2 -0
- package/dist/frontend-ssr/assets/{dropdown-menu-CGkf8-rb.js → dropdown-menu-Dn_vQq9b.js} +1 -1
- package/dist/frontend-ssr/assets/{floating-layer-anchor-CYIE8Oj6.js → floating-layer-anchor-BIAu-252.js} +1 -1
- package/dist/frontend-ssr/assets/{messages-D-auzk9H.js → messages-BAQzILs4.js} +1 -1
- package/dist/frontend-ssr/assets/{select-value-6Lk0ToYd.js → select-value-DBhbkNcc.js} +1 -1
- package/dist/frontend-ssr/components/category-dialog.js +1 -1
- package/dist/frontend-ssr/components/create-snapshot-dialog.js +1 -1
- package/dist/frontend-ssr/components/editor/document-editor.js +37 -23
- package/dist/frontend-ssr/components/editor/document-title.js +1 -1
- package/dist/frontend-ssr/components/editor/markdown-toggle.js +1 -1
- package/dist/frontend-ssr/components/folder-node.js +1 -1
- package/dist/frontend-ssr/components/save-as-dialog.js +2 -2
- package/dist/frontend-ssr/components/settings.js +1 -1
- package/dist/frontend-ssr/components/share-dialog.js +1 -1
- package/dist/frontend-ssr/components/sidebar.js +1 -1
- package/dist/frontend-ssr/components/tag-create-dialog.js +1 -1
- package/dist/frontend-ssr/components/version-history.js +2 -2
- package/dist/frontend-ssr/dashboard.js +280 -81
- package/dist/frontend-ssr/extension.js +1 -1
- package/dist/frontend-ssr/i18n.js +1 -1
- package/dist/frontend-ssr/search.js +4 -4
- package/dist/frontend-ssr/shared-document.js +1 -1
- package/dist/lifecycle-runtime.js +18 -3
- package/dist/types.d.ts +5 -0
- package/package.json +1 -1
- package/packages/cli/src/index.ts +1 -1
- package/packages/db/src/schema.ts +17 -2
- package/packages/mcp-server/src/index.ts +1 -1
- package/dist/frontend/DatePicker-BkaaNS1l.js +0 -256
- package/dist/frontend/ShareDialog-ChZogJtW.js +0 -166
- package/dist/frontend-ssr/assets/ShareDialog-C-9VDKSz.js +0 -56
|
@@ -5,43 +5,43 @@ import { n as r, t as i } from "./folder-Cx60MRpi.js";
|
|
|
5
5
|
import { t as a } from "./clock-Dz86E4Kz.js";
|
|
6
6
|
import { t as o } from "./copy-CvCh4ZVt.js";
|
|
7
7
|
import { n as s, r as c, t as l } from "./confirm-dialog-CzmoZw3a.js";
|
|
8
|
-
import { t as u } from "./SettingsDialog-
|
|
8
|
+
import { t as u } from "./SettingsDialog-Bd_S2RKW.js";
|
|
9
9
|
import { n as d, t as f } from "./tag-DhVFHMcV.js";
|
|
10
10
|
import { t as p } from "./x-cfdlccjs.js";
|
|
11
|
-
import { a as m, i as h, o as
|
|
12
|
-
import { n as
|
|
13
|
-
import { $r as
|
|
14
|
-
import { a as Ce, i as
|
|
15
|
-
import { t as
|
|
16
|
-
import { a as
|
|
17
|
-
import { t as
|
|
18
|
-
import { t as
|
|
19
|
-
import { n as
|
|
20
|
-
import { i as
|
|
21
|
-
import { t as
|
|
11
|
+
import { a as m, i as h, o as ee, r as g, t as te } from "./dropdown-menu-CJ_7V3N0.js";
|
|
12
|
+
import { n as ne } from "./dist-DQa_OHOa.js";
|
|
13
|
+
import { $r as _, Di as v, Ei as y, Er as b, Gn as x, Gt as re, Ii as S, Kt as C, Lt as w, O as T, Oi as E, Pi as ie, Qr as D, Ti as ae, Ut as O, Wn as oe, Xn as se, Xr as k, Yn as A, Zr as j, di as ce, ei as M, hi as le, ir as ue, ji as de, ki as fe, li as pe, nr as N, or as me, p as he, pi as ge, ri as P, rr as _e, tr as ve, ui as ye, vi as be, w as xe, wi as Se } from "./messages-DIovIZrK.js";
|
|
14
|
+
import { a as Ce, i as we, n as Te, t as Ee } from "./route-context-DYQlUfzL.js";
|
|
15
|
+
import { t as F } from "./utils-DrfHTcei.js";
|
|
16
|
+
import { a as De, i as Oe, n as ke, o as Ae, r as je, t as Me } from "./dialog-Ce79C9fd.js";
|
|
17
|
+
import { t as Ne } from "./input-BWlOML_m.js";
|
|
18
|
+
import { t as Pe } from "./label-C2HfJNQ2.js";
|
|
19
|
+
import { n as Fe } from "./client-GbtOH90i.js";
|
|
20
|
+
import { i as Ie, r as Le, s as Re } from "./categories-X7gK8azc.js";
|
|
21
|
+
import { t as I } from "./context-D0zPFXZ4.js";
|
|
22
22
|
import { t as L } from "./resolve-BG4HgzpN.js";
|
|
23
23
|
import { n as ze, t as Be } from "./dndzone-BzsOINtP.js";
|
|
24
24
|
import { c as Ve, i as He, r as Ue, s as We, t as Ge } from "./documents-CwCs1rA7.js";
|
|
25
25
|
import { c as Ke, r as qe, s as Je, t as Ye } from "./folders-ONG03Dkv.js";
|
|
26
26
|
import { t as Xe } from "./DeleteDialog-8k6JYWCx.js";
|
|
27
27
|
import { t as Ze } from "./clipboard-Cgzxc0_R.js";
|
|
28
|
-
import { t as Qe } from "./ShareDialog-
|
|
29
|
-
import { t as $e } from "./CategoryDialog-
|
|
28
|
+
import { t as Qe } from "./ShareDialog-BC-Jl6v1.js";
|
|
29
|
+
import { t as $e } from "./CategoryDialog-DmlX0Z97.js";
|
|
30
30
|
import { n as et, t as tt } from "./document-drop-coordinator-C4xHMjwC.js";
|
|
31
|
-
import { a as nt, c as rt,
|
|
32
|
-
import { t as
|
|
33
|
-
import { a as
|
|
34
|
-
import { t as
|
|
35
|
-
import { i as
|
|
36
|
-
import { t as
|
|
31
|
+
import { a as nt, c as rt, d as it, f as at, i as ot, n as st, o as ct, p as lt, r as ut, s as dt, t as ft, u as pt } from "./subfolders-refresh-store.svelte-B2dKVmgz.js";
|
|
32
|
+
import { t as mt } from "./FolderNode-D3rN3yLV.js";
|
|
33
|
+
import { a as ht, i as R, n as z, o as B, s as gt, t as _t } from "./tag-store.svelte-ogVCMCbv.js";
|
|
34
|
+
import { t as vt } from "./ConfirmDialog-DgMTQBq4.js";
|
|
35
|
+
import { i as yt, o as bt } from "./tags-BdCaMGfj.js";
|
|
36
|
+
import { t as xt } from "./TagCreateDialog-Bb0-Vtzh.js";
|
|
37
37
|
import "svelte/internal/disclose-version";
|
|
38
38
|
import * as V from "svelte/internal/client";
|
|
39
|
-
import { onDestroy as
|
|
39
|
+
import { onDestroy as St, onMount as Ct, untrack as wt } from "svelte";
|
|
40
40
|
import "svelte/internal/flags/legacy";
|
|
41
41
|
import { page as H } from "$app/state";
|
|
42
|
-
import { flip as
|
|
42
|
+
import { flip as Tt } from "svelte/animate";
|
|
43
43
|
//#region ../node_modules/.bun/lucide-svelte@0.577.0+ff5f301bb2db9a0d/node_modules/lucide-svelte/dist/icons/panel-left-close.svelte
|
|
44
|
-
function
|
|
44
|
+
function Et(t, n) {
|
|
45
45
|
let r = V.legacy_rest_props(n, [
|
|
46
46
|
"children",
|
|
47
47
|
"$$slots",
|
|
@@ -125,56 +125,56 @@ function W(t, n) {
|
|
|
125
125
|
}
|
|
126
126
|
//#endregion
|
|
127
127
|
//#region src/lib/components/SearchBar.svelte
|
|
128
|
-
var
|
|
129
|
-
function
|
|
128
|
+
var Dt = V.from_html("<button type=\"button\" class=\"absolute right-2 top-1/2 inline-flex size-5 -translate-y-1/2 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring\"><!></button>"), Ot = V.from_html("<div><!> <input type=\"text\"/> <!></div>");
|
|
129
|
+
function kt(e, t) {
|
|
130
130
|
V.push(t, !0);
|
|
131
|
-
let n = V.state(""), r = V.state(null), i =
|
|
131
|
+
let n = V.state(""), r = V.state(null), i = Ee();
|
|
132
132
|
function a() {
|
|
133
133
|
V.set(n, ""), V.get(r)?.focus();
|
|
134
134
|
}
|
|
135
|
-
var o =
|
|
135
|
+
var o = Ot(), s = V.child(o);
|
|
136
136
|
d(s, { class: "pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" });
|
|
137
137
|
var c = V.sibling(s, 2);
|
|
138
138
|
V.remove_input_defaults(c), V.bind_this(c, (e) => V.set(r, e), () => V.get(r));
|
|
139
139
|
var l = V.sibling(c, 2), u = (e) => {
|
|
140
|
-
var t =
|
|
140
|
+
var t = Dt();
|
|
141
141
|
p(V.child(t), { class: "size-3.5" }), V.reset(t), V.template_effect((e, n) => {
|
|
142
142
|
V.set_attribute(t, "aria-label", e), V.set_attribute(t, "title", n);
|
|
143
|
-
}, [() =>
|
|
143
|
+
}, [() => w(), () => w()]), V.delegated("click", t, a), V.append(e, t);
|
|
144
144
|
};
|
|
145
145
|
V.if(l, (e) => {
|
|
146
146
|
V.get(n) && e(u);
|
|
147
147
|
}), V.reset(o), V.template_effect((e, t, n) => {
|
|
148
148
|
V.set_class(o, 1, e), V.set_attribute(c, "placeholder", t), V.set_class(c, 1, n);
|
|
149
149
|
}, [
|
|
150
|
-
() => V.clsx(
|
|
151
|
-
() =>
|
|
152
|
-
() => V.clsx(
|
|
150
|
+
() => V.clsx(F("relative", t.class)),
|
|
151
|
+
() => k(),
|
|
152
|
+
() => V.clsx(F("flex h-9 w-full rounded-md border border-input bg-transparent pl-9 py-1 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring", V.get(n) ? "pr-9" : "pr-3"))
|
|
153
153
|
]), V.delegated("keydown", c, (e) => {
|
|
154
|
-
e.key === "Enter" && V.get(n).trim() &&
|
|
154
|
+
e.key === "Enter" && V.get(n).trim() && Te(i, `/search?q=${encodeURIComponent(V.get(n).trim())}`);
|
|
155
155
|
}), V.event("focus", c, () => {}), V.bind_value(c, () => V.get(n), (e) => V.set(n, e)), V.append(e, o), V.pop();
|
|
156
156
|
}
|
|
157
157
|
V.delegate(["keydown", "click"]);
|
|
158
158
|
//#endregion
|
|
159
159
|
//#region src/lib/components/sidebar/FolderTree.svelte
|
|
160
|
-
var
|
|
161
|
-
var n =
|
|
160
|
+
var At = (e, t = V.noop) => {
|
|
161
|
+
var n = Ft(), r = V.sibling(V.child(n), 2);
|
|
162
162
|
c(r, { class: "size-4 shrink-0 text-muted-foreground" });
|
|
163
163
|
var i = V.sibling(r, 2), a = V.child(i, !0);
|
|
164
164
|
V.reset(i), V.reset(n), V.template_effect((e) => {
|
|
165
165
|
V.set_attribute(n, "href", `/docs/${t().id}`), V.set_class(n, 1, e), V.set_text(a, t().title);
|
|
166
|
-
}, [() => V.clsx(
|
|
167
|
-
},
|
|
168
|
-
function
|
|
166
|
+
}, [() => V.clsx(F("flex w-full min-w-0 items-center gap-1.5 rounded-md px-2 py-1 text-sm transition-colors hover:bg-accent hover:text-accent-foreground", H.params.id === t().id && "bg-accent text-accent-foreground font-medium"))]), V.append(e, n);
|
|
167
|
+
}, jt = V.from_html("<button><!></button>"), Mt = V.from_html("<!> <!> <!>", 1), Nt = V.from_html("<!> <!>", 1), Pt = V.from_html("<button type=\"button\"><!></button>"), Ft = V.from_html("<a data-sveltekit-noscroll=\"\"><span class=\"w-3.5 shrink-0\"></span> <!> <span class=\"min-w-0 truncate\"> </span></a>"), It = V.from_html("<p class=\"px-2 text-xs text-destructive\"> </p>"), Lt = V.from_html("<!> <!> <!> <!> <!> <!>", 1), Rt = V.from_html("<div><!></div>"), zt = V.from_html("<div class=\"group/doc flex w-full min-w-0 items-center gap-1\"><!> <!> <!></div>"), Bt = V.from_html("<div class=\"ml-0.5 space-y-0.5 border-l border-border pl-0.5\"><div></div> <div></div></div>"), Vt = V.from_html("<div class=\"group/bucket\"><div class=\"flex w-full min-w-0 items-center gap-0.5\"><button type=\"button\"><!> <span class=\"min-w-0 truncate\"> </span></button> <!></div> <!></div>"), Ht = V.from_html("<div class=\"group/bucket\"><div class=\"flex w-full min-w-0 items-center gap-0.5\"><button type=\"button\"><!> <span class=\"min-w-0 truncate\"> </span></button></div> <!></div>"), Ut = V.from_html("<p id=\"rename-input-error\" class=\"text-xs text-destructive\" role=\"alert\"> </p>"), Wt = V.from_html("<!> <form class=\"space-y-4\"><div class=\"space-y-2\"><!> <!> <!></div></form> <!>", 1), Gt = V.from_html("<div class=\"space-y-1\"><div class=\"mb-2 flex items-center justify-between gap-1\"><a class=\"block flex-1 px-2 text-xs font-medium uppercase tracking-wider text-muted-foreground transition-colors hover:text-foreground\"> </a> <button type=\"button\" class=\"inline-flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"><!></button></div> <!> <!> <div class=\"min-h-[8px] space-y-1\"></div> <!> <button type=\"button\" class=\"flex w-full items-center gap-1.5 rounded-md px-2 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground\"><!> <span> </span></button></div> <!> <!> <!> <!> <!>", 1);
|
|
168
|
+
function Kt(e, i) {
|
|
169
169
|
V.push(i, !0);
|
|
170
170
|
let a = (e, t = V.noop) => {
|
|
171
171
|
m(e, {
|
|
172
172
|
children: (e, n) => {
|
|
173
|
-
var r =
|
|
174
|
-
|
|
173
|
+
var r = Nt(), i = V.first_child(r);
|
|
174
|
+
te(i, {
|
|
175
175
|
child: (e, t) => {
|
|
176
176
|
let n = () => (t?.()).props;
|
|
177
|
-
var r =
|
|
177
|
+
var r = jt(), i = (e) => {
|
|
178
178
|
e.preventDefault(), e.stopPropagation();
|
|
179
179
|
};
|
|
180
180
|
V.attribute_effect(r, (e, t) => ({
|
|
@@ -184,38 +184,38 @@ function Gt(e, i) {
|
|
|
184
184
|
"aria-label": e,
|
|
185
185
|
title: t,
|
|
186
186
|
onclick: i
|
|
187
|
-
}), [() =>
|
|
187
|
+
}), [() => C(), () => C()]), ee(V.child(r), { class: "size-3.5" }), V.reset(r), V.append(e, r);
|
|
188
188
|
},
|
|
189
189
|
$$slots: { child: !0 }
|
|
190
190
|
}), h(V.sibling(i, 2), {
|
|
191
191
|
align: "end",
|
|
192
192
|
children: (e, n) => {
|
|
193
|
-
var r =
|
|
194
|
-
|
|
195
|
-
onSelect: () =>
|
|
193
|
+
var r = Mt(), i = V.first_child(r);
|
|
194
|
+
g(i, {
|
|
195
|
+
onSelect: () => ir("doc", t().id, t().title),
|
|
196
196
|
children: (e, t) => {
|
|
197
197
|
V.next();
|
|
198
198
|
var n = V.text();
|
|
199
|
-
V.template_effect((e) => V.set_text(n, e), [() =>
|
|
199
|
+
V.template_effect((e) => V.set_text(n, e), [() => le()]), V.append(e, n);
|
|
200
200
|
},
|
|
201
201
|
$$slots: { default: !0 }
|
|
202
202
|
});
|
|
203
203
|
var a = V.sibling(i, 2);
|
|
204
|
-
|
|
205
|
-
onSelect: () =>
|
|
204
|
+
g(a, {
|
|
205
|
+
onSelect: () => cr(t().id, t().title),
|
|
206
206
|
children: (e, t) => {
|
|
207
207
|
V.next();
|
|
208
208
|
var n = V.text();
|
|
209
|
-
V.template_effect((e) => V.set_text(n, e), [() =>
|
|
209
|
+
V.template_effect((e) => V.set_text(n, e), [() => ae()]), V.append(e, n);
|
|
210
210
|
},
|
|
211
211
|
$$slots: { default: !0 }
|
|
212
|
-
}),
|
|
212
|
+
}), g(V.sibling(a, 2), {
|
|
213
213
|
class: "text-destructive focus:text-destructive",
|
|
214
|
-
onSelect: () =>
|
|
214
|
+
onSelect: () => sr("doc", t().id, t().title),
|
|
215
215
|
children: (e, t) => {
|
|
216
216
|
V.next();
|
|
217
217
|
var n = V.text();
|
|
218
|
-
V.template_effect((e) => V.set_text(n, e), [() =>
|
|
218
|
+
V.template_effect((e) => V.set_text(n, e), [() => N()]), V.append(e, n);
|
|
219
219
|
},
|
|
220
220
|
$$slots: { default: !0 }
|
|
221
221
|
}), V.append(e, r);
|
|
@@ -226,62 +226,62 @@ function Gt(e, i) {
|
|
|
226
226
|
$$slots: { default: !0 }
|
|
227
227
|
});
|
|
228
228
|
}, c = (e, n = V.noop) => {
|
|
229
|
-
var r =
|
|
230
|
-
|
|
229
|
+
var r = Pt(), i = V.child(r), a = (e) => {
|
|
230
|
+
ne(e, { class: "size-3.5 animate-spin" });
|
|
231
231
|
}, s = (e) => {
|
|
232
232
|
t(e, { class: "size-3.5" });
|
|
233
233
|
}, c = (e) => {
|
|
234
234
|
o(e, { class: "size-3.5" });
|
|
235
235
|
};
|
|
236
236
|
V.if(i, (e) => {
|
|
237
|
-
V.get(
|
|
237
|
+
V.get(ln) === n().id ? e(a) : V.get(cn) === n().id ? e(s, 1) : e(c, -1);
|
|
238
238
|
}), V.reset(r), V.template_effect((e, t) => {
|
|
239
|
-
V.set_class(r, 1, `inline-flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-accent-foreground group-hover/doc:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${V.get(
|
|
240
|
-
}, [() =>
|
|
241
|
-
e.preventDefault(), e.stopPropagation(),
|
|
239
|
+
V.set_class(r, 1, `inline-flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-accent-foreground group-hover/doc:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${V.get(cn) === n().id || V.get(ln) === n().id ? "opacity-100" : ""}`), V.set_attribute(r, "aria-label", e), V.set_attribute(r, "title", t), r.disabled = V.get(ln) === n().id;
|
|
240
|
+
}, [() => re(), () => re()]), V.delegated("click", r, (e) => {
|
|
241
|
+
e.preventDefault(), e.stopPropagation(), dn(n().id);
|
|
242
242
|
}), V.append(e, r);
|
|
243
243
|
}, u = (e, t = V.noop) => {
|
|
244
|
-
|
|
244
|
+
mt(e, {
|
|
245
245
|
get folder() {
|
|
246
246
|
return t();
|
|
247
247
|
},
|
|
248
248
|
get expandedFolderIds() {
|
|
249
|
-
return V.get(
|
|
249
|
+
return V.get(w);
|
|
250
250
|
},
|
|
251
|
-
onToggleFolder:
|
|
252
|
-
onRename: (e, t) =>
|
|
253
|
-
onDelete: (e, t) =>
|
|
254
|
-
onCreateSubfolder:
|
|
255
|
-
onShare:
|
|
251
|
+
onToggleFolder: kn,
|
|
252
|
+
onRename: (e, t) => ir("folder", e, t),
|
|
253
|
+
onDelete: (e, t) => sr("folder", e, t),
|
|
254
|
+
onCreateSubfolder: Pn,
|
|
255
|
+
onShare: lr,
|
|
256
256
|
get dragDisabled() {
|
|
257
257
|
return V.get(P);
|
|
258
258
|
},
|
|
259
259
|
get isDraggingGlobal() {
|
|
260
|
-
return V.get(
|
|
260
|
+
return V.get(I);
|
|
261
261
|
},
|
|
262
262
|
get isDraggingFolder() {
|
|
263
|
-
return V.get(
|
|
263
|
+
return V.get(L);
|
|
264
264
|
},
|
|
265
265
|
get isDraggingDoc() {
|
|
266
|
-
return V.get(
|
|
266
|
+
return V.get(it);
|
|
267
267
|
},
|
|
268
268
|
get draggedDocId() {
|
|
269
269
|
return V.get(R);
|
|
270
270
|
},
|
|
271
|
-
onScheduleFolderExpand:
|
|
272
|
-
onClearExpandTimer:
|
|
273
|
-
onConsiderDocs:
|
|
274
|
-
onFinalizeDocs:
|
|
275
|
-
onConsiderSubfolders:
|
|
276
|
-
onFinalizeSubfolders:
|
|
277
|
-
onDropOnFolder:
|
|
271
|
+
onScheduleFolderExpand: pn,
|
|
272
|
+
onClearExpandTimer: fn,
|
|
273
|
+
onConsiderDocs: Ln,
|
|
274
|
+
onFinalizeDocs: Rn,
|
|
275
|
+
onConsiderSubfolders: Kn,
|
|
276
|
+
onFinalizeSubfolders: qn,
|
|
277
|
+
onDropOnFolder: Hn,
|
|
278
278
|
get folderDocsMap() {
|
|
279
279
|
return V.get(H);
|
|
280
280
|
},
|
|
281
281
|
folderFlipDurationMs: p,
|
|
282
|
-
documentFlipDurationMs:
|
|
282
|
+
documentFlipDurationMs: _,
|
|
283
283
|
get docRowInner() {
|
|
284
|
-
return
|
|
284
|
+
return At;
|
|
285
285
|
},
|
|
286
286
|
get copyButton() {
|
|
287
287
|
return c;
|
|
@@ -290,57 +290,57 @@ function Gt(e, i) {
|
|
|
290
290
|
return a;
|
|
291
291
|
}
|
|
292
292
|
});
|
|
293
|
-
}, d =
|
|
294
|
-
function
|
|
295
|
-
V.set(
|
|
296
|
-
V.set(
|
|
293
|
+
}, d = Ee(), f = Ce(), p = 200, _ = 80, y = V.state(V.proxy([])), b = V.state(V.proxy([])), x = V.state(V.proxy([])), w = V.state(V.proxy(/* @__PURE__ */ new Set())), T = V.state(V.proxy(/* @__PURE__ */ new Set())), D = V.state(!0), O = V.state(null), k = V.state(null), j = null;
|
|
294
|
+
function M(e) {
|
|
295
|
+
V.set(k, e, !0), j &&= (clearTimeout(j), null), e !== null && (j = setTimeout(() => {
|
|
296
|
+
V.set(k, null), j = null;
|
|
297
297
|
}, 5e3));
|
|
298
298
|
}
|
|
299
|
-
let P = V.state(!1),
|
|
300
|
-
async function
|
|
299
|
+
let P = V.state(!1), I = V.state(!1), L = V.state(!1), it = V.state(!1), R = V.state(null), B = 0, gt = V.state(!1), vt = V.state(!1), yt = 0, bt = Promise.resolve(), xt = V.state(V.proxy([])), H = V.state(V.proxy({})), Et = V.state(V.proxy({})), U = V.state(V.proxy({})), W = V.state(V.proxy([])), Dt = V.state(!1), Ot = V.state(null), kt = V.state(null), Ft = V.state(!1), Kt = V.state(null), qt = V.state(""), G = V.state(null), K = V.state(!1), Jt = V.state(!1), q = V.state(null), Yt = V.state(!1), Xt = V.state(""), Zt = V.state(""), Qt = V.state(""), $t = V.state(""), en = V.state(""), tn = V.state(""), nn = V.state(!1), rn = V.state("create"), J = V.state(null), an = V.state(!1), Y = null, on = V.state(null), X = null, sn = V.state(null), cn = V.state(null), ln = V.state(null), un = null;
|
|
300
|
+
async function dn(e) {
|
|
301
301
|
if (typeof window > "u") return;
|
|
302
|
-
let t = V.get(
|
|
303
|
-
V.set(
|
|
302
|
+
let t = V.get(x).find((t) => t.id === e), n = "";
|
|
303
|
+
V.set(ln, e, !0);
|
|
304
304
|
try {
|
|
305
305
|
n = (await He(e, f.fetch)).content ?? "";
|
|
306
306
|
} catch (e) {
|
|
307
307
|
console.error("FolderTree: failed to fetch full document for copy", e), n = t?.excerpt ?? t?.content ?? "";
|
|
308
308
|
} finally {
|
|
309
|
-
V.set(
|
|
309
|
+
V.set(ln, null);
|
|
310
310
|
}
|
|
311
|
-
n && await Ze(n) && (V.set(
|
|
312
|
-
V.set(
|
|
311
|
+
n && await Ze(n) && (V.set(cn, e, !0), un && clearTimeout(un), un = setTimeout(() => {
|
|
312
|
+
V.set(cn, null), un = null;
|
|
313
313
|
}, 2e3));
|
|
314
314
|
}
|
|
315
|
-
function
|
|
316
|
-
Y !== null && (clearTimeout(Y), Y = null), V.set(
|
|
315
|
+
function fn() {
|
|
316
|
+
Y !== null && (clearTimeout(Y), Y = null), V.set(on, null);
|
|
317
317
|
}
|
|
318
|
-
function
|
|
319
|
-
|
|
320
|
-
if (V.get(
|
|
321
|
-
let t = new Set(V.get(
|
|
322
|
-
t.add(e), V.set(
|
|
318
|
+
function pn(e) {
|
|
319
|
+
fn(), !V.get(w).has(e) && (V.set(on, e, !0), Y = setTimeout(() => {
|
|
320
|
+
if (V.get(on) === e && !V.get(w).has(e)) {
|
|
321
|
+
let t = new Set(V.get(w));
|
|
322
|
+
t.add(e), V.set(w, t, !0);
|
|
323
323
|
}
|
|
324
|
-
Y = null, V.set(
|
|
324
|
+
Y = null, V.set(on, null);
|
|
325
325
|
}, 400));
|
|
326
326
|
}
|
|
327
|
-
function
|
|
328
|
-
X !== null && (clearTimeout(X), X = null), V.set(
|
|
327
|
+
function mn() {
|
|
328
|
+
X !== null && (clearTimeout(X), X = null), V.set(sn, null);
|
|
329
329
|
}
|
|
330
|
-
function
|
|
331
|
-
|
|
332
|
-
if (V.get(
|
|
330
|
+
function hn(e) {
|
|
331
|
+
mn(), !(e === $ ? V.get(D) : V.get(T).has(e)) && (V.set(sn, e, !0), X = setTimeout(() => {
|
|
332
|
+
if (V.get(sn) === e) if (e === $) V.set(D, !0);
|
|
333
333
|
else {
|
|
334
|
-
let t = new Set(V.get(
|
|
335
|
-
t.add(e), V.set(
|
|
334
|
+
let t = new Set(V.get(T));
|
|
335
|
+
t.add(e), V.set(T, t, !0);
|
|
336
336
|
}
|
|
337
|
-
X = null, V.set(
|
|
337
|
+
X = null, V.set(sn, null);
|
|
338
338
|
}, 400));
|
|
339
339
|
}
|
|
340
|
-
function
|
|
340
|
+
function gn(e) {
|
|
341
341
|
return Array.isArray(e) ? e.filter((e) => typeof e == "object" && !!e && typeof e.id == "string") : [];
|
|
342
342
|
}
|
|
343
|
-
function
|
|
343
|
+
function _n(e) {
|
|
344
344
|
let t = [], n = {}, r = {};
|
|
345
345
|
for (let i of e) if (i.folderId) {
|
|
346
346
|
let e = r[i.folderId] ?? [];
|
|
@@ -355,171 +355,171 @@ function Gt(e, i) {
|
|
|
355
355
|
byFolder: r
|
|
356
356
|
};
|
|
357
357
|
}
|
|
358
|
-
function _n() {
|
|
359
|
-
let { root: e, byCategory: t, byFolder: n } = gn(V.get(S));
|
|
360
|
-
V.set(bt, e, !0), V.set(Tt, t, !0), V.set(H, n, !0);
|
|
361
|
-
}
|
|
362
358
|
function vn() {
|
|
359
|
+
let { root: e, byCategory: t, byFolder: n } = _n(V.get(x));
|
|
360
|
+
V.set(xt, e, !0), V.set(Et, t, !0), V.set(H, n, !0);
|
|
361
|
+
}
|
|
362
|
+
function yn() {
|
|
363
363
|
let e = /* @__PURE__ */ new Map();
|
|
364
|
-
for (let t of V.get(
|
|
364
|
+
for (let t of V.get(b)) e.set(t.id, []);
|
|
365
365
|
let t = [];
|
|
366
|
-
for (let n of V.get(
|
|
366
|
+
for (let n of V.get(y)) n.categoryId && e.has(n.categoryId) ? e.get(n.categoryId)?.push(n) : t.push(n);
|
|
367
367
|
let n = {};
|
|
368
|
-
for (let t of V.get(
|
|
368
|
+
for (let t of V.get(b)) n[t.id] = e.get(t.id) ?? [];
|
|
369
369
|
n[$] = t, V.set(U, n, !0);
|
|
370
370
|
}
|
|
371
371
|
V.user_effect(() => {
|
|
372
|
-
V.get(
|
|
372
|
+
V.get(y), V.get(b), !(V.get(gt) || V.get(vt)) && (V.set(W, V.get(xr).map((e) => ({
|
|
373
373
|
id: e.id,
|
|
374
374
|
category: e.category,
|
|
375
375
|
folders: e.folders
|
|
376
|
-
})), !0),
|
|
376
|
+
})), !0), yn());
|
|
377
377
|
});
|
|
378
|
-
async function
|
|
378
|
+
async function bn() {
|
|
379
379
|
try {
|
|
380
380
|
let e = await Je(null, !1, f.fetch);
|
|
381
|
-
V.set(
|
|
381
|
+
V.set(y, (e[0]?.children ?? []).map((e) => (lt(e.id, e.parentId ?? null, e.categoryId ?? null, e.order ?? 0), {
|
|
382
382
|
id: e.id,
|
|
383
383
|
name: e.name,
|
|
384
384
|
categoryId: e.categoryId ?? null,
|
|
385
385
|
parentId: e.parentId,
|
|
386
386
|
order: e.order ?? 0
|
|
387
|
-
})), !0), V.set(
|
|
387
|
+
})), !0), V.set(O, null);
|
|
388
388
|
} catch (e) {
|
|
389
|
-
console.error("FolderTree: failed to load folders", e), V.set(
|
|
389
|
+
console.error("FolderTree: failed to load folders", e), V.set(O, "Failed to load folders");
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
|
-
async function
|
|
392
|
+
async function xn() {
|
|
393
393
|
try {
|
|
394
|
-
let e = await
|
|
394
|
+
let e = await Ie(f.fetch), t = /* @__PURE__ */ new Set();
|
|
395
395
|
for (let n of e) {
|
|
396
396
|
if (t.has(n.id)) throw Error(`Categories response contains duplicate id: ${n.id}`);
|
|
397
397
|
t.add(n.id);
|
|
398
398
|
}
|
|
399
|
-
V.set(
|
|
399
|
+
V.set(b, e, !0);
|
|
400
400
|
} catch (e) {
|
|
401
401
|
console.error("FolderTree: failed to load categories", e);
|
|
402
402
|
}
|
|
403
403
|
}
|
|
404
|
-
let
|
|
405
|
-
async function
|
|
406
|
-
let e = ++
|
|
404
|
+
let Sn = 0;
|
|
405
|
+
async function Cn() {
|
|
406
|
+
let e = ++Sn;
|
|
407
407
|
try {
|
|
408
408
|
let t = z(), n = await We({
|
|
409
409
|
limit: 100,
|
|
410
410
|
...t ? { tag: t } : {}
|
|
411
411
|
}, f.fetch);
|
|
412
|
-
if (e !==
|
|
413
|
-
V.set(
|
|
412
|
+
if (e !== Sn) return;
|
|
413
|
+
V.set(x, n.items.map((e) => rt(e.id) ? {
|
|
414
414
|
...e,
|
|
415
415
|
folderId: rt(e.id)?.folderId ?? null,
|
|
416
416
|
categoryId: rt(e.id)?.categoryId ?? null
|
|
417
|
-
} : e), !0), V.get(
|
|
418
|
-
e.id, e.title, e.categoryId, e.folderId, Object.keys(e),
|
|
419
|
-
}),
|
|
417
|
+
} : e), !0), V.get(x).forEach((e) => {
|
|
418
|
+
e.id, e.title, e.categoryId, e.folderId, Object.keys(e), at(e.id, e.folderId ?? null, e.categoryId ?? null);
|
|
419
|
+
}), vn();
|
|
420
420
|
} catch (e) {
|
|
421
|
-
console.error("FolderTree: failed to load documents", e), V.set(
|
|
421
|
+
console.error("FolderTree: failed to load documents", e), V.set(O, "Failed to load documents");
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
424
|
async function Z() {
|
|
425
425
|
Ge(), await Promise.all([
|
|
426
|
-
yn(),
|
|
427
426
|
bn(),
|
|
428
|
-
|
|
427
|
+
xn(),
|
|
428
|
+
Cn()
|
|
429
429
|
]);
|
|
430
430
|
}
|
|
431
|
-
function
|
|
432
|
-
|
|
431
|
+
function wn(e, t) {
|
|
432
|
+
Sn++, at(e, t.folderId, t.categoryId), V.set(x, V.get(x).map((n) => n.id === e ? {
|
|
433
433
|
...n,
|
|
434
434
|
...t
|
|
435
|
-
} : n), !0),
|
|
435
|
+
} : n), !0), vn();
|
|
436
436
|
}
|
|
437
|
-
let
|
|
437
|
+
let Tn = et({
|
|
438
438
|
patch: (e, t) => Ve(e, t, f.fetch),
|
|
439
|
-
optimistic: (e, t) =>
|
|
440
|
-
acknowledge:
|
|
441
|
-
rollback:
|
|
439
|
+
optimistic: (e, t) => pt(e, t.folderId, t.categoryId),
|
|
440
|
+
acknowledge: ft,
|
|
441
|
+
rollback: wn,
|
|
442
442
|
onError: (e) => {
|
|
443
|
-
console.error("FolderTree: document move failed", e),
|
|
443
|
+
console.error("FolderTree: document move failed", e), M(e instanceof Error ? e.message : "Move failed");
|
|
444
444
|
}
|
|
445
445
|
});
|
|
446
|
-
function
|
|
447
|
-
let n =
|
|
448
|
-
n && (n.folderId === t.folderId && n.categoryId === t.categoryId ||
|
|
446
|
+
function En(e, t) {
|
|
447
|
+
let n = ut(e);
|
|
448
|
+
n && (n.folderId === t.folderId && n.categoryId === t.categoryId || Tn(e, t, n).catch(() => void 0));
|
|
449
449
|
}
|
|
450
|
-
let Q = tt({ persist:
|
|
451
|
-
|
|
450
|
+
let Q = tt({ persist: En });
|
|
451
|
+
Ct(() => {
|
|
452
452
|
let e = setTimeout(() => {
|
|
453
453
|
Z();
|
|
454
454
|
}, 500);
|
|
455
455
|
return () => clearTimeout(e);
|
|
456
|
-
}),
|
|
457
|
-
Q.cancel(),
|
|
456
|
+
}), St(() => {
|
|
457
|
+
Q.cancel(), j &&= (clearTimeout(j), null), Y &&= (clearTimeout(Y), null), X &&= (clearTimeout(X), null);
|
|
458
458
|
}), V.user_effect(() => {
|
|
459
|
-
let e =
|
|
459
|
+
let e = _t(), t = ct();
|
|
460
460
|
e === 0 && t === 0 || Z();
|
|
461
461
|
}), V.user_effect(() => {
|
|
462
|
-
if (
|
|
463
|
-
let e =
|
|
464
|
-
e &&
|
|
465
|
-
|
|
466
|
-
let t = V.get(
|
|
467
|
-
t !== -1 && (V.set(
|
|
462
|
+
if (ot() === 0) return;
|
|
463
|
+
let e = dt();
|
|
464
|
+
e && wt(() => {
|
|
465
|
+
Sn++;
|
|
466
|
+
let t = V.get(x).findIndex((t) => t.id === e.id);
|
|
467
|
+
t !== -1 && (V.set(x, V.get(x).map((n, r) => r === t ? {
|
|
468
468
|
...n,
|
|
469
469
|
folderId: e.folderId,
|
|
470
470
|
categoryId: e.categoryId
|
|
471
|
-
} : n), !0),
|
|
471
|
+
} : n), !0), vn());
|
|
472
472
|
});
|
|
473
473
|
});
|
|
474
|
-
let
|
|
474
|
+
let Dn = !0;
|
|
475
475
|
V.user_effect(() => {
|
|
476
|
-
if (z(),
|
|
477
|
-
|
|
476
|
+
if (z(), Dn) {
|
|
477
|
+
Dn = !1;
|
|
478
478
|
return;
|
|
479
479
|
}
|
|
480
480
|
Z();
|
|
481
481
|
});
|
|
482
|
-
async function
|
|
482
|
+
async function On() {
|
|
483
483
|
await Z();
|
|
484
484
|
}
|
|
485
|
-
function
|
|
486
|
-
let t = V.get(
|
|
487
|
-
t ? n.delete(e) : n.add(e), V.set(
|
|
485
|
+
function kn(e) {
|
|
486
|
+
let t = V.get(w).has(e), n = new Set(V.get(w));
|
|
487
|
+
t ? n.delete(e) : n.add(e), V.set(w, n, !0), V.set(P, !0), typeof window < "u" && window.setTimeout(() => {
|
|
488
488
|
V.set(P, !1);
|
|
489
489
|
}, 250);
|
|
490
490
|
}
|
|
491
|
-
function
|
|
492
|
-
let t = new Set(V.get(
|
|
493
|
-
t.has(e) ? t.delete(e) : t.add(e), V.set(
|
|
494
|
-
}
|
|
495
|
-
function An() {
|
|
496
|
-
V.set(O, !V.get(O));
|
|
491
|
+
function An(e) {
|
|
492
|
+
let t = new Set(V.get(T));
|
|
493
|
+
t.has(e) ? t.delete(e) : t.add(e), V.set(T, t, !0);
|
|
497
494
|
}
|
|
498
495
|
function jn() {
|
|
499
|
-
V.set(
|
|
496
|
+
V.set(D, !V.get(D));
|
|
500
497
|
}
|
|
501
|
-
function Mn(
|
|
502
|
-
V.set(
|
|
498
|
+
function Mn() {
|
|
499
|
+
V.set(Ot, null), V.set(kt, null), V.set(Dt, !0);
|
|
503
500
|
}
|
|
504
501
|
function Nn(e) {
|
|
505
|
-
V.set(
|
|
502
|
+
V.set(Ot, null), V.set(kt, e, !0), V.set(Dt, !0);
|
|
506
503
|
}
|
|
507
|
-
|
|
508
|
-
|
|
504
|
+
function Pn(e) {
|
|
505
|
+
V.set(Ot, e, !0), V.set(kt, null), V.set(Dt, !0);
|
|
506
|
+
}
|
|
507
|
+
async function Fn(e) {
|
|
508
|
+
let t = V.get(Ot), n = await Ye({
|
|
509
509
|
name: e,
|
|
510
510
|
parentId: t,
|
|
511
|
-
categoryId: V.get(
|
|
511
|
+
categoryId: V.get(kt)
|
|
512
512
|
}, f.fetch);
|
|
513
|
-
return await
|
|
513
|
+
return await bn(), t && (V.set(w, new Set(V.get(w)).add(t), !0), st(t)), n;
|
|
514
514
|
}
|
|
515
|
-
function
|
|
515
|
+
function In(e, t) {
|
|
516
516
|
if (e.kind === "root") {
|
|
517
|
-
V.set(
|
|
517
|
+
V.set(xt, t, !0);
|
|
518
518
|
return;
|
|
519
519
|
}
|
|
520
520
|
if (e.kind === "category") {
|
|
521
|
-
V.set(
|
|
522
|
-
...V.get(
|
|
521
|
+
V.set(Et, {
|
|
522
|
+
...V.get(Et),
|
|
523
523
|
[e.id]: t
|
|
524
524
|
}, !0);
|
|
525
525
|
return;
|
|
@@ -529,38 +529,38 @@ function Gt(e, i) {
|
|
|
529
529
|
[e.id]: t
|
|
530
530
|
}, !0);
|
|
531
531
|
}
|
|
532
|
-
function
|
|
532
|
+
function Ln(e) {
|
|
533
533
|
return (t) => {
|
|
534
534
|
t.stopPropagation();
|
|
535
|
-
let n = !V.get(
|
|
536
|
-
V.set(
|
|
535
|
+
let n = !V.get(it);
|
|
536
|
+
V.set(I, !0), V.set(it, !0), t.detail.info?.id && (V.set(R, t.detail.info.id, !0), n && Q.begin(t.detail.info.id, ++B)), In(e, gn(t.detail.items)), fn();
|
|
537
537
|
};
|
|
538
538
|
}
|
|
539
|
-
function
|
|
539
|
+
function Rn(e) {
|
|
540
540
|
return (t) => {
|
|
541
|
-
t.stopPropagation(),
|
|
541
|
+
t.stopPropagation(), In(e, gn(t.detail.items)), fn();
|
|
542
542
|
let n = t.detail.info?.trigger === "droppedIntoAnother";
|
|
543
543
|
t.detail.info?.trigger;
|
|
544
544
|
let r = t.detail.info?.id ?? V.get(R);
|
|
545
|
-
!n && r && Q.zone(r,
|
|
545
|
+
!n && r && Q.zone(r, zn(e)), r && Q.end(r, B), V.set(I, !1), V.set(it, !1), typeof window < "u" ? window.setTimeout(() => {
|
|
546
546
|
V.get(R) === r && V.set(R, null);
|
|
547
547
|
}, 0) : V.set(R, null);
|
|
548
548
|
};
|
|
549
549
|
}
|
|
550
|
-
function
|
|
550
|
+
function zn(e) {
|
|
551
551
|
return {
|
|
552
552
|
folderId: e.kind === "folder" ? e.id : null,
|
|
553
553
|
categoryId: e.kind === "category" ? e.id : e.kind === "root" ? null : nt(e.id)?.categoryId ?? null
|
|
554
554
|
};
|
|
555
555
|
}
|
|
556
|
-
function
|
|
556
|
+
function Bn(e) {
|
|
557
557
|
(V.get(R) ?? Q.pendingId(B)) && (e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = "move"));
|
|
558
558
|
}
|
|
559
|
-
function
|
|
559
|
+
function Vn(e, t) {
|
|
560
560
|
let n = V.get(R) ?? Q.pendingId(B);
|
|
561
561
|
if (!n) return;
|
|
562
562
|
e.preventDefault(), e.stopPropagation();
|
|
563
|
-
let r = t === $ ? null : t, i =
|
|
563
|
+
let r = t === $ ? null : t, i = ut(n);
|
|
564
564
|
if (!i) return;
|
|
565
565
|
let a = i.folderId !== null, o = i.categoryId !== r;
|
|
566
566
|
(a || o) && Q.header(n, {
|
|
@@ -568,62 +568,62 @@ function Gt(e, i) {
|
|
|
568
568
|
categoryId: r
|
|
569
569
|
}), V.set(R, null);
|
|
570
570
|
}
|
|
571
|
-
function
|
|
571
|
+
function Hn(e, t) {
|
|
572
572
|
let n = V.get(R) ?? Q.pendingId(B);
|
|
573
573
|
if (!n) return;
|
|
574
574
|
e.preventDefault(), e.stopPropagation();
|
|
575
|
-
let r = nt(t)?.categoryId ?? null, i =
|
|
575
|
+
let r = nt(t)?.categoryId ?? null, i = ut(n);
|
|
576
576
|
i && (i.folderId !== t && Q.header(n, {
|
|
577
577
|
folderId: t,
|
|
578
578
|
categoryId: r
|
|
579
579
|
}), V.set(R, null));
|
|
580
580
|
}
|
|
581
|
-
let
|
|
582
|
-
function
|
|
581
|
+
let Un = "parent:";
|
|
582
|
+
function Wn(e) {
|
|
583
583
|
return (t) => {
|
|
584
|
-
t.stopPropagation(), V.set(
|
|
585
|
-
let n =
|
|
586
|
-
e.startsWith(
|
|
584
|
+
t.stopPropagation(), V.set(I, !0), V.set(L, !0);
|
|
585
|
+
let n = Jn(t.detail.items);
|
|
586
|
+
e.startsWith(Un) || V.set(U, {
|
|
587
587
|
...V.get(U),
|
|
588
588
|
[e]: n
|
|
589
589
|
}, !0);
|
|
590
590
|
};
|
|
591
591
|
}
|
|
592
|
-
function
|
|
592
|
+
function Gn(e) {
|
|
593
593
|
return (t) => {
|
|
594
594
|
t.stopPropagation();
|
|
595
|
-
let n =
|
|
596
|
-
e.startsWith(
|
|
595
|
+
let n = Jn(t.detail.items), r = t.detail.info?.trigger === "droppedIntoAnother";
|
|
596
|
+
e.startsWith(Un) || V.set(U, {
|
|
597
597
|
...V.get(U),
|
|
598
598
|
[e]: n
|
|
599
|
-
}, !0), V.set(
|
|
599
|
+
}, !0), V.set(I, !1), V.set(L, !1), r || Xn(e, n);
|
|
600
600
|
};
|
|
601
601
|
}
|
|
602
|
-
function Gn(e) {
|
|
603
|
-
return Un(`${Hn}${e}`);
|
|
604
|
-
}
|
|
605
602
|
function Kn(e) {
|
|
606
|
-
return Wn(`${
|
|
603
|
+
return Wn(`${Un}${e}`);
|
|
607
604
|
}
|
|
608
605
|
function qn(e) {
|
|
609
|
-
return
|
|
606
|
+
return Gn(`${Un}${e}`);
|
|
610
607
|
}
|
|
611
608
|
function Jn(e) {
|
|
609
|
+
return Array.isArray(e) ? e.filter((e) => typeof e == "object" && !!e && typeof e.id == "string") : [];
|
|
610
|
+
}
|
|
611
|
+
function Yn(e) {
|
|
612
612
|
let t = /* @__PURE__ */ new Set();
|
|
613
613
|
if (!e) return t;
|
|
614
614
|
let n = e;
|
|
615
615
|
for (; n && !t.has(n);) t.add(n), n = nt(n)?.parentId ?? null;
|
|
616
616
|
return t;
|
|
617
617
|
}
|
|
618
|
-
async function
|
|
619
|
-
let n = e.startsWith(
|
|
618
|
+
async function Xn(e, t) {
|
|
619
|
+
let n = e.startsWith(Un), r = n || e === $ ? null : e, i = n && e.slice(7) || null, a = /* @__PURE__ */ new Map(), o = n ? Yn(i) : /* @__PURE__ */ new Set();
|
|
620
620
|
if (n) for (let e of t) {
|
|
621
621
|
if (o.has(e.id)) continue;
|
|
622
622
|
let t = nt(e.id);
|
|
623
623
|
t && t.parentId !== i && (a.set(e.id, {
|
|
624
624
|
folderId: e.id,
|
|
625
625
|
parentId: i
|
|
626
|
-
}),
|
|
626
|
+
}), lt(e.id, i, t.categoryId, t.order));
|
|
627
627
|
}
|
|
628
628
|
else for (let e of t) {
|
|
629
629
|
let t = nt(e.id);
|
|
@@ -631,7 +631,7 @@ function Gt(e, i) {
|
|
|
631
631
|
let n = t.categoryId !== r, i = t.parentId !== null;
|
|
632
632
|
if (n || i) {
|
|
633
633
|
let o = { folderId: e.id };
|
|
634
|
-
n && (o.categoryId = r), i && (o.parentId = null), a.set(e.id, o),
|
|
634
|
+
n && (o.categoryId = r), i && (o.parentId = null), a.set(e.id, o), lt(e.id, null, r, t.order);
|
|
635
635
|
}
|
|
636
636
|
}
|
|
637
637
|
t.forEach((e, t) => {
|
|
@@ -639,10 +639,10 @@ function Gt(e, i) {
|
|
|
639
639
|
let r = nt(e.id);
|
|
640
640
|
if (!r) return;
|
|
641
641
|
let i = r.order !== t, s = a.get(e.id);
|
|
642
|
-
s ? (s.order = t,
|
|
642
|
+
s ? (s.order = t, lt(e.id, s.parentId === void 0 ? r.parentId : s.parentId, s.categoryId === void 0 ? r.categoryId : s.categoryId, t)) : i && (a.set(e.id, {
|
|
643
643
|
folderId: e.id,
|
|
644
644
|
order: t
|
|
645
|
-
}),
|
|
645
|
+
}), lt(e.id, r.parentId, r.categoryId, t));
|
|
646
646
|
});
|
|
647
647
|
let s = Array.from(a.values()), c = /* @__PURE__ */ new Set();
|
|
648
648
|
if (n) {
|
|
@@ -656,25 +656,25 @@ function Gt(e, i) {
|
|
|
656
656
|
await Promise.all(s.map((e) => {
|
|
657
657
|
let { folderId: t, ...n } = e;
|
|
658
658
|
return Ke(t, n, f.fetch);
|
|
659
|
-
})), await Z(),
|
|
660
|
-
for (let e of c)
|
|
659
|
+
})), await Z(), yn();
|
|
660
|
+
for (let e of c) st(e);
|
|
661
661
|
} catch (e) {
|
|
662
|
-
console.error("FolderTree: folder DnD persist failed", e),
|
|
662
|
+
console.error("FolderTree: folder DnD persist failed", e), M(e instanceof Error ? `Move failed: ${e.message}` : "Move failed: unknown error");
|
|
663
663
|
}
|
|
664
664
|
}
|
|
665
|
-
function Xn(e) {
|
|
666
|
-
e.stopPropagation(), V.set(F, !0), V.set(ht, !0), V.set(W, Qn($n(e.detail.items)), !0);
|
|
667
|
-
}
|
|
668
665
|
function Zn(e) {
|
|
669
|
-
e.stopPropagation();
|
|
670
|
-
let t = Qn(er(e.detail.items));
|
|
671
|
-
V.set(W, t, !0), V.set(F, !1), V.set(ht, !1), tr(t);
|
|
666
|
+
e.stopPropagation(), V.set(I, !0), V.set(gt, !0), V.set(W, $n(er(e.detail.items)), !0);
|
|
672
667
|
}
|
|
673
668
|
function Qn(e) {
|
|
674
|
-
|
|
675
|
-
|
|
669
|
+
e.stopPropagation();
|
|
670
|
+
let t = $n(tr(e.detail.items));
|
|
671
|
+
V.set(W, t, !0), V.set(I, !1), V.set(gt, !1), nr(t);
|
|
676
672
|
}
|
|
677
673
|
function $n(e) {
|
|
674
|
+
let t = e.filter((e) => e.id !== $), n = V.get(W).find((e) => e.id === $) ?? V.get(xr).find((e) => e.id === $);
|
|
675
|
+
return n ? [...t, n] : t;
|
|
676
|
+
}
|
|
677
|
+
function er(e) {
|
|
678
678
|
if (!Array.isArray(e)) return [];
|
|
679
679
|
let t = [];
|
|
680
680
|
for (let n of e) {
|
|
@@ -684,8 +684,8 @@ function Gt(e, i) {
|
|
|
684
684
|
}
|
|
685
685
|
return t;
|
|
686
686
|
}
|
|
687
|
-
function
|
|
688
|
-
let t =
|
|
687
|
+
function tr(e) {
|
|
688
|
+
let t = er(e), n = new Set(t.filter((e) => e[ze]).map((e) => e.id)), r = /* @__PURE__ */ new Set(), i = new Map([...V.get(W), ...V.get(xr)].map((e) => [e.id, e])), a = [];
|
|
689
689
|
for (let e of t) {
|
|
690
690
|
if (n.has(e.id) && !e.isDndShadowItem || r.has(e.id)) continue;
|
|
691
691
|
r.add(e.id);
|
|
@@ -698,94 +698,94 @@ function Gt(e, i) {
|
|
|
698
698
|
}
|
|
699
699
|
return a;
|
|
700
700
|
}
|
|
701
|
-
function
|
|
702
|
-
let t = ++
|
|
703
|
-
V.set(
|
|
701
|
+
function nr(e) {
|
|
702
|
+
let t = ++yt;
|
|
703
|
+
V.set(vt, !0);
|
|
704
704
|
let n = e.map((e) => ({ ...e }));
|
|
705
|
-
|
|
705
|
+
bt = bt.catch(() => void 0).then(async () => {
|
|
706
706
|
try {
|
|
707
|
-
await
|
|
707
|
+
await rr(n);
|
|
708
708
|
} catch (e) {
|
|
709
|
-
console.error("FolderTree: category DnD persist failed", e),
|
|
709
|
+
console.error("FolderTree: category DnD persist failed", e), M(e instanceof Error ? `Reorder failed: ${e.message}` : "Reorder failed: unknown error");
|
|
710
710
|
} finally {
|
|
711
|
-
t ===
|
|
711
|
+
t === yt && (await Z(), V.set(vt, !1));
|
|
712
712
|
}
|
|
713
713
|
});
|
|
714
714
|
}
|
|
715
|
-
async function
|
|
715
|
+
async function rr(e) {
|
|
716
716
|
let t = [];
|
|
717
717
|
if (e.forEach((e, n) => {
|
|
718
718
|
e.category && t.push({
|
|
719
719
|
id: e.category.id,
|
|
720
720
|
order: n
|
|
721
721
|
});
|
|
722
|
-
}), t.length !== 0) for (let e of t) await
|
|
722
|
+
}), t.length !== 0) for (let e of t) await Re(e.id, { order: e.order }, f.fetch);
|
|
723
723
|
}
|
|
724
|
-
function
|
|
725
|
-
V.set(
|
|
724
|
+
function ir(e, t, n) {
|
|
725
|
+
V.set(Kt, {
|
|
726
726
|
kind: e,
|
|
727
727
|
id: t,
|
|
728
728
|
name: n
|
|
729
|
-
}, !0), V.set(
|
|
729
|
+
}, !0), V.set(qt, n, !0), V.set(G, null), V.set(Ft, !0);
|
|
730
730
|
}
|
|
731
|
-
function
|
|
732
|
-
V.set(
|
|
731
|
+
function ar() {
|
|
732
|
+
V.set(Ft, !1), V.set(Kt, null), V.set(qt, ""), V.set(G, null), V.set(K, !1);
|
|
733
733
|
}
|
|
734
|
-
async function
|
|
734
|
+
async function or(e) {
|
|
735
735
|
e?.preventDefault();
|
|
736
|
-
let t = V.get(
|
|
736
|
+
let t = V.get(Kt);
|
|
737
737
|
if (!t) return;
|
|
738
|
-
let n = V.get(
|
|
738
|
+
let n = V.get(qt).trim();
|
|
739
739
|
if (n.length === 0) {
|
|
740
740
|
V.set(G, "Name is required");
|
|
741
741
|
return;
|
|
742
742
|
}
|
|
743
743
|
V.set(K, !0);
|
|
744
744
|
try {
|
|
745
|
-
t.kind === "folder" ? await Ke(t.id, { name: n }, f.fetch) : await Ve(t.id, { title: n }, f.fetch),
|
|
745
|
+
t.kind === "folder" ? await Ke(t.id, { name: n }, f.fetch) : await Ve(t.id, { title: n }, f.fetch), ar(), await Z(), ht();
|
|
746
746
|
} catch (e) {
|
|
747
747
|
console.error("FolderTree: rename failed", e), V.set(G, e instanceof Error ? e.message : me(), !0);
|
|
748
748
|
} finally {
|
|
749
749
|
V.set(K, !1);
|
|
750
750
|
}
|
|
751
751
|
}
|
|
752
|
-
function
|
|
752
|
+
function sr(e, t, n) {
|
|
753
753
|
V.set(q, {
|
|
754
754
|
kind: e,
|
|
755
755
|
id: t,
|
|
756
756
|
name: n
|
|
757
|
-
}, !0), V.set(
|
|
758
|
-
}
|
|
759
|
-
function sr(e, t) {
|
|
760
|
-
V.set(Yt, e, !0), V.set(Xt, ""), V.set($t, ""), V.set(Zt, t, !0), V.set(Qt, ""), V.set(en, ""), V.set(Jt, !0);
|
|
757
|
+
}, !0), V.set(Jt, !0);
|
|
761
758
|
}
|
|
762
759
|
function cr(e, t) {
|
|
763
|
-
V.set(Xt, e, !0), V.set(
|
|
760
|
+
V.set(Xt, e, !0), V.set(Zt, ""), V.set(en, ""), V.set(Qt, t, !0), V.set($t, ""), V.set(tn, ""), V.set(Yt, !0);
|
|
764
761
|
}
|
|
765
762
|
function lr(e, t) {
|
|
766
|
-
V.set(
|
|
763
|
+
V.set(Zt, e, !0), V.set(Xt, ""), V.set(en, ""), V.set($t, t, !0), V.set(Qt, ""), V.set(tn, ""), V.set(Yt, !0);
|
|
767
764
|
}
|
|
768
|
-
function ur() {
|
|
769
|
-
V.set(
|
|
765
|
+
function ur(e, t) {
|
|
766
|
+
V.set(en, e, !0), V.set(Xt, ""), V.set(Zt, ""), V.set(tn, t, !0), V.set(Qt, ""), V.set($t, ""), V.set(Yt, !0);
|
|
770
767
|
}
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
e && (e.kind === "folder" ? await qe(e.id, f.fetch) : await Ue(e.id, f.fetch), await Z(), mt());
|
|
768
|
+
function dr() {
|
|
769
|
+
V.set(Jt, !1), V.set(q, null);
|
|
774
770
|
}
|
|
775
|
-
function fr() {
|
|
776
|
-
|
|
771
|
+
async function fr() {
|
|
772
|
+
let e = V.get(q);
|
|
773
|
+
e && (e.kind === "folder" ? await qe(e.id, f.fetch) : await Ue(e.id, f.fetch), await Z(), ht());
|
|
777
774
|
}
|
|
778
|
-
function pr(
|
|
779
|
-
V.set(
|
|
775
|
+
function pr() {
|
|
776
|
+
V.set(rn, "create"), V.set(J, null), V.set(nn, !0);
|
|
780
777
|
}
|
|
781
778
|
function mr(e) {
|
|
782
|
-
V.set(
|
|
779
|
+
V.set(rn, "edit"), V.set(J, e, !0), V.set(nn, !0);
|
|
783
780
|
}
|
|
784
|
-
function hr() {
|
|
785
|
-
V.
|
|
781
|
+
function hr(e) {
|
|
782
|
+
V.set(rn, "delete"), V.set(J, e, !0), V.set(nn, !0);
|
|
786
783
|
}
|
|
787
|
-
|
|
788
|
-
V.set(
|
|
784
|
+
function gr() {
|
|
785
|
+
V.get(an) || (V.set(nn, !1), V.set(J, null), V.set(an, !1));
|
|
786
|
+
}
|
|
787
|
+
async function _r(e) {
|
|
788
|
+
V.set(an, !0);
|
|
789
789
|
try {
|
|
790
790
|
let t = {
|
|
791
791
|
name: e.name,
|
|
@@ -794,34 +794,34 @@ function Gt(e, i) {
|
|
|
794
794
|
apiPermissionEdit: e.apiPermissionEdit,
|
|
795
795
|
apiPermissionWrite: e.apiPermissionWrite
|
|
796
796
|
}, n;
|
|
797
|
-
return n = V.get(
|
|
797
|
+
return n = V.get(rn) === "edit" && V.get(J) ? await Fe(`/api/categories/${encodeURIComponent(V.get(J).id)}`, {
|
|
798
798
|
method: "PATCH",
|
|
799
799
|
body: t
|
|
800
|
-
}, f.fetch) : await
|
|
800
|
+
}, f.fetch) : await Fe("/api/categories", {
|
|
801
801
|
method: "POST",
|
|
802
802
|
body: t
|
|
803
803
|
}, f.fetch), await Z(), n;
|
|
804
804
|
} finally {
|
|
805
|
-
V.set(
|
|
805
|
+
V.set(an, !1);
|
|
806
806
|
}
|
|
807
807
|
}
|
|
808
|
-
async function
|
|
808
|
+
async function vr() {
|
|
809
809
|
if (V.get(J)) {
|
|
810
|
-
V.set(
|
|
810
|
+
V.set(an, !0);
|
|
811
811
|
try {
|
|
812
|
-
await
|
|
812
|
+
await Le(V.get(J).id, f.fetch), await Z();
|
|
813
813
|
} finally {
|
|
814
|
-
V.set(
|
|
814
|
+
V.set(an, !1);
|
|
815
815
|
}
|
|
816
816
|
}
|
|
817
817
|
}
|
|
818
|
-
let $ = "__uncategorized__",
|
|
818
|
+
let $ = "__uncategorized__", yr = V.derived(() => V.get(W).filter((e) => e.id !== $ && e.category !== null)), br = V.derived(() => V.get(W).find((e) => e.id === $) ?? null), xr = V.derived(() => {
|
|
819
819
|
let e = /* @__PURE__ */ new Map();
|
|
820
|
-
for (let t of V.get(
|
|
820
|
+
for (let t of V.get(b)) e.set(t.id, []);
|
|
821
821
|
let t = [];
|
|
822
|
-
for (let n of V.get(
|
|
822
|
+
for (let n of V.get(y)) n.categoryId && e.has(n.categoryId) ? e.get(n.categoryId)?.push(n) : t.push(n);
|
|
823
823
|
let n = [];
|
|
824
|
-
for (let t of V.get(
|
|
824
|
+
for (let t of V.get(b)) n.push({
|
|
825
825
|
id: t.id,
|
|
826
826
|
category: t,
|
|
827
827
|
folders: e.get(t.id) ?? []
|
|
@@ -832,78 +832,78 @@ function Gt(e, i) {
|
|
|
832
832
|
folders: t
|
|
833
833
|
}), n;
|
|
834
834
|
});
|
|
835
|
-
var
|
|
836
|
-
V.reset(
|
|
837
|
-
var
|
|
838
|
-
s(V.child(
|
|
839
|
-
var
|
|
840
|
-
var t =
|
|
841
|
-
V.reset(t), V.template_effect(() => V.set_text(n, V.get(
|
|
835
|
+
var Sr = { refreshFolderTree: On }, Cr = Gt(), wr = V.first_child(Cr), Tr = V.child(wr), Er = V.child(Tr), Dr = V.child(Er, !0);
|
|
836
|
+
V.reset(Er);
|
|
837
|
+
var Or = V.sibling(Er, 2);
|
|
838
|
+
s(V.child(Or), { class: "size-3.5" }), V.reset(Or), V.reset(Tr);
|
|
839
|
+
var kr = V.sibling(Tr, 2), Ar = (e) => {
|
|
840
|
+
var t = It(), n = V.child(t, !0);
|
|
841
|
+
V.reset(t), V.template_effect(() => V.set_text(n, V.get(O))), V.append(e, t);
|
|
842
842
|
};
|
|
843
|
-
V.if(
|
|
844
|
-
V.get(
|
|
843
|
+
V.if(kr, (e) => {
|
|
844
|
+
V.get(O) && e(Ar);
|
|
845
845
|
});
|
|
846
|
-
var
|
|
847
|
-
var t =
|
|
848
|
-
V.reset(t), V.template_effect(() => V.set_text(n, V.get(
|
|
846
|
+
var jr = V.sibling(kr, 2), Mr = (e) => {
|
|
847
|
+
var t = It(), n = V.child(t, !0);
|
|
848
|
+
V.reset(t), V.template_effect(() => V.set_text(n, V.get(k))), V.append(e, t);
|
|
849
849
|
};
|
|
850
|
-
V.if(
|
|
851
|
-
V.get(
|
|
850
|
+
V.if(jr, (e) => {
|
|
851
|
+
V.get(k) && e(Mr);
|
|
852
852
|
});
|
|
853
|
-
var
|
|
854
|
-
V.each(
|
|
855
|
-
let i = V.derived(() => V.get(
|
|
856
|
-
var o =
|
|
853
|
+
var Nr = V.sibling(jr, 2);
|
|
854
|
+
V.each(Nr, 29, () => V.get(yr), (e) => `${e.id}:${e.isDndShadowItem ? "shadow" : "item"}`, (e, t) => {
|
|
855
|
+
let i = V.derived(() => V.get(T).has(V.get(t).id));
|
|
856
|
+
var o = Vt(), s = V.child(o), l = V.child(s), f = V.child(l), p = (e) => {
|
|
857
857
|
n(e, { class: "size-3.5 shrink-0" });
|
|
858
|
-
},
|
|
858
|
+
}, ne = (e) => {
|
|
859
859
|
r(e, { class: "size-3.5 shrink-0" });
|
|
860
860
|
};
|
|
861
861
|
V.if(f, (e) => {
|
|
862
|
-
V.get(i) ? e(p) : e(
|
|
862
|
+
V.get(i) ? e(p) : e(ne, -1);
|
|
863
863
|
});
|
|
864
|
-
var
|
|
865
|
-
V.reset(
|
|
864
|
+
var _ = V.sibling(f, 2), v = V.child(_, !0);
|
|
865
|
+
V.reset(_), V.reset(l), m(V.sibling(l, 2), {
|
|
866
866
|
children: (e, n) => {
|
|
867
|
-
var r =
|
|
868
|
-
|
|
867
|
+
var r = Nt(), i = V.first_child(r);
|
|
868
|
+
te(i, {
|
|
869
869
|
child: (e, t) => {
|
|
870
870
|
let n = () => (t?.()).props;
|
|
871
|
-
var r =
|
|
871
|
+
var r = jt();
|
|
872
872
|
V.attribute_effect(r, (e, t) => ({
|
|
873
873
|
...n(),
|
|
874
874
|
type: "button",
|
|
875
875
|
class: "inline-flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-accent-foreground group-hover/bucket:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
876
876
|
"aria-label": e,
|
|
877
877
|
title: t
|
|
878
|
-
}), [() =>
|
|
878
|
+
}), [() => C(), () => C()]), ee(V.child(r), { class: "size-3.5" }), V.reset(r), V.append(e, r);
|
|
879
879
|
},
|
|
880
880
|
$$slots: { child: !0 }
|
|
881
881
|
}), h(V.sibling(i, 2), {
|
|
882
882
|
align: "end",
|
|
883
883
|
children: (e, n) => {
|
|
884
|
-
var r =
|
|
885
|
-
|
|
886
|
-
onSelect: () =>
|
|
884
|
+
var r = Lt(), i = V.first_child(r);
|
|
885
|
+
g(i, {
|
|
886
|
+
onSelect: () => Te(d, `/?category=${V.get(t).category.id}`),
|
|
887
887
|
children: (e, t) => {
|
|
888
888
|
V.next();
|
|
889
889
|
var n = V.text();
|
|
890
|
-
V.template_effect((e) => V.set_text(n, e), [() =>
|
|
890
|
+
V.template_effect((e) => V.set_text(n, e), [() => se()]), V.append(e, n);
|
|
891
891
|
},
|
|
892
892
|
$$slots: { default: !0 }
|
|
893
893
|
});
|
|
894
894
|
var a = V.sibling(i, 2);
|
|
895
|
-
|
|
896
|
-
onSelect: () =>
|
|
895
|
+
g(a, {
|
|
896
|
+
onSelect: () => Te(d, `/docs/new?category=${V.get(t).category.id}`),
|
|
897
897
|
children: (e, t) => {
|
|
898
898
|
V.next();
|
|
899
899
|
var n = V.text();
|
|
900
|
-
V.template_effect((e) => V.set_text(n, e), [() =>
|
|
900
|
+
V.template_effect((e) => V.set_text(n, e), [() => ie()]), V.append(e, n);
|
|
901
901
|
},
|
|
902
902
|
$$slots: { default: !0 }
|
|
903
903
|
});
|
|
904
904
|
var o = V.sibling(a, 2);
|
|
905
|
-
|
|
906
|
-
onSelect: () =>
|
|
905
|
+
g(o, {
|
|
906
|
+
onSelect: () => Nn(V.get(t).category.id),
|
|
907
907
|
children: (e, t) => {
|
|
908
908
|
V.next();
|
|
909
909
|
var n = V.text();
|
|
@@ -912,31 +912,31 @@ function Gt(e, i) {
|
|
|
912
912
|
$$slots: { default: !0 }
|
|
913
913
|
});
|
|
914
914
|
var s = V.sibling(o, 2);
|
|
915
|
-
|
|
916
|
-
onSelect: () =>
|
|
915
|
+
g(s, {
|
|
916
|
+
onSelect: () => ur(V.get(t).category.id, V.get(t).category.name),
|
|
917
917
|
children: (e, t) => {
|
|
918
918
|
V.next();
|
|
919
919
|
var n = V.text();
|
|
920
|
-
V.template_effect((e) => V.set_text(n, e), [() =>
|
|
920
|
+
V.template_effect((e) => V.set_text(n, e), [() => ae()]), V.append(e, n);
|
|
921
921
|
},
|
|
922
922
|
$$slots: { default: !0 }
|
|
923
923
|
});
|
|
924
924
|
var c = V.sibling(s, 2);
|
|
925
|
-
|
|
926
|
-
onSelect: () =>
|
|
925
|
+
g(c, {
|
|
926
|
+
onSelect: () => mr(V.get(t).category),
|
|
927
927
|
children: (e, t) => {
|
|
928
928
|
V.next();
|
|
929
929
|
var n = V.text();
|
|
930
930
|
V.template_effect((e) => V.set_text(n, e), [() => ve()]), V.append(e, n);
|
|
931
931
|
},
|
|
932
932
|
$$slots: { default: !0 }
|
|
933
|
-
}),
|
|
933
|
+
}), g(V.sibling(c, 2), {
|
|
934
934
|
class: "text-destructive focus:text-destructive",
|
|
935
|
-
onSelect: () =>
|
|
935
|
+
onSelect: () => hr(V.get(t).category),
|
|
936
936
|
children: (e, t) => {
|
|
937
937
|
V.next();
|
|
938
938
|
var n = V.text();
|
|
939
|
-
V.template_effect((e) => V.set_text(n, e), [() =>
|
|
939
|
+
V.template_effect((e) => V.set_text(n, e), [() => N()]), V.append(e, n);
|
|
940
940
|
},
|
|
941
941
|
$$slots: { default: !0 }
|
|
942
942
|
}), V.append(e, r);
|
|
@@ -946,12 +946,12 @@ function Gt(e, i) {
|
|
|
946
946
|
},
|
|
947
947
|
$$slots: { default: !0 }
|
|
948
948
|
}), V.reset(s);
|
|
949
|
-
var
|
|
950
|
-
let n = V.derived(() => V.get(U)[V.get(t).id] ?? []), r = V.derived(() => V.get(
|
|
951
|
-
var i =
|
|
949
|
+
var y = V.sibling(s, 2), b = (e) => {
|
|
950
|
+
let n = V.derived(() => V.get(U)[V.get(t).id] ?? []), r = V.derived(() => V.get(Et)[V.get(t).id] ?? []);
|
|
951
|
+
var i = Bt(), o = V.child(i), s = V.derived(() => Wn(V.get(t).id)), l = V.derived(() => Gn(V.get(t).id));
|
|
952
952
|
V.each(o, 29, () => V.get(n), (e) => e.id, (e, t) => {
|
|
953
|
-
var n =
|
|
954
|
-
u(V.child(n), () => V.get(t)), V.reset(n), V.animation(n, () =>
|
|
953
|
+
var n = Rt();
|
|
954
|
+
u(V.child(n), () => V.get(t)), V.reset(n), V.animation(n, () => Tt, () => ({ duration: 200 })), V.append(e, n);
|
|
955
955
|
}), V.reset(o), V.action(o, (e, t) => Be?.(e, t), () => ({
|
|
956
956
|
items: V.get(n),
|
|
957
957
|
flipDurationMs: 200,
|
|
@@ -959,18 +959,18 @@ function Gt(e, i) {
|
|
|
959
959
|
dropTargetStyle: {},
|
|
960
960
|
dragDisabled: V.get(P)
|
|
961
961
|
}));
|
|
962
|
-
var d = V.sibling(o, 2), f = V.derived(() =>
|
|
962
|
+
var d = V.sibling(o, 2), f = V.derived(() => Ln({
|
|
963
963
|
kind: "category",
|
|
964
964
|
id: V.get(t).id
|
|
965
|
-
})), p = V.derived(() =>
|
|
965
|
+
})), p = V.derived(() => Rn({
|
|
966
966
|
kind: "category",
|
|
967
967
|
id: V.get(t).id
|
|
968
968
|
}));
|
|
969
969
|
V.each(d, 29, () => V.get(r), (e) => e.id, (e, t) => {
|
|
970
|
-
var n =
|
|
971
|
-
|
|
970
|
+
var n = zt(), r = V.child(n);
|
|
971
|
+
At(r, () => V.get(t));
|
|
972
972
|
var i = V.sibling(r, 2);
|
|
973
|
-
c(i, () => V.get(t)), a(V.sibling(i, 2), () => V.get(t)), V.reset(n), V.animation(n, () =>
|
|
973
|
+
c(i, () => V.get(t)), a(V.sibling(i, 2), () => V.get(t)), V.reset(n), V.animation(n, () => Tt, () => ({ duration: 80 })), V.append(e, n);
|
|
974
974
|
}), V.reset(d), V.action(d, (e, t) => Be?.(e, t), () => ({
|
|
975
975
|
items: V.get(r),
|
|
976
976
|
flipDurationMs: 80,
|
|
@@ -981,7 +981,7 @@ function Gt(e, i) {
|
|
|
981
981
|
centreDraggedOnCursor: !0
|
|
982
982
|
})), V.reset(i), V.template_effect((e, t) => {
|
|
983
983
|
V.set_class(o, 1, e), V.set_class(d, 1, t);
|
|
984
|
-
}, [() => V.clsx(
|
|
984
|
+
}, [() => V.clsx(F("min-h-[8px] space-y-0.5 transition-all duration-150", V.get(L) && V.get(n).length === 0 && "min-h-[36px] bg-accent/20 rounded border border-dashed border-muted-foreground/20")), () => V.clsx(F("min-h-[8px] space-y-0.5 transition-all duration-150", V.get(it) && V.get(r).length === 0 && "min-h-[36px] bg-accent/20 rounded border border-dashed border-muted-foreground/20"))]), V.event("consider", o, function(...e) {
|
|
985
985
|
V.get(s)?.apply(this, e);
|
|
986
986
|
}), V.event("finalize", o, function(...e) {
|
|
987
987
|
V.get(l)?.apply(this, e);
|
|
@@ -991,39 +991,39 @@ function Gt(e, i) {
|
|
|
991
991
|
V.get(p)?.apply(this, e);
|
|
992
992
|
}), V.append(e, i);
|
|
993
993
|
};
|
|
994
|
-
V.if(
|
|
995
|
-
V.get(i) && e(
|
|
994
|
+
V.if(y, (e) => {
|
|
995
|
+
V.get(i) && e(b);
|
|
996
996
|
}), V.reset(o), V.template_effect((e) => {
|
|
997
|
-
V.set_attribute(o, "data-is-dnd-shadow-item-hint", V.get(t)[ze]), V.set_attribute(l, "aria-expanded", V.get(i)), V.set_class(l, 1, e), V.set_text(
|
|
998
|
-
}, [() => V.clsx(
|
|
999
|
-
V.get(
|
|
997
|
+
V.set_attribute(o, "data-is-dnd-shadow-item-hint", V.get(t)[ze]), V.set_attribute(l, "aria-expanded", V.get(i)), V.set_class(l, 1, e), V.set_text(v, V.get(t).category.name);
|
|
998
|
+
}, [() => V.clsx(F("flex min-w-0 flex-1 items-center gap-1.5 rounded-md px-2 py-1.5 text-xs font-medium uppercase tracking-wider text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground", V.get(R) && "hover:bg-accent/40 border border-dashed border-primary/30"))]), V.delegated("click", l, () => An(V.get(t).id)), V.event("mouseenter", l, () => {
|
|
999
|
+
V.get(I) && !V.get(i) && hn(V.get(t).id);
|
|
1000
1000
|
}), V.event("mouseleave", l, () => {
|
|
1001
|
-
V.get(
|
|
1002
|
-
}), V.event("dragover", l,
|
|
1003
|
-
}), V.reset(
|
|
1004
|
-
items: V.get(
|
|
1001
|
+
V.get(I) && mn();
|
|
1002
|
+
}), V.event("dragover", l, Bn), V.event("drop", l, (e) => Vn(e, V.get(t).id)), V.animation(o, () => Tt, () => ({ duration: 200 })), V.append(e, o);
|
|
1003
|
+
}), V.reset(Nr), V.action(Nr, (e, t) => Be?.(e, t), () => ({
|
|
1004
|
+
items: V.get(yr),
|
|
1005
1005
|
flipDurationMs: 200,
|
|
1006
1006
|
type: "category",
|
|
1007
1007
|
dropTargetStyle: {},
|
|
1008
1008
|
dragDisabled: V.get(P)
|
|
1009
1009
|
}));
|
|
1010
|
-
var
|
|
1011
|
-
var t =
|
|
1010
|
+
var Pr = V.sibling(Nr, 2), Fr = (e) => {
|
|
1011
|
+
var t = Ht(), i = V.child(t), o = V.child(i), s = V.child(o), l = (e) => {
|
|
1012
1012
|
n(e, { class: "size-3.5 shrink-0" });
|
|
1013
1013
|
}, d = (e) => {
|
|
1014
1014
|
r(e, { class: "size-3.5 shrink-0" });
|
|
1015
1015
|
};
|
|
1016
1016
|
V.if(s, (e) => {
|
|
1017
|
-
V.get(
|
|
1017
|
+
V.get(D) ? e(l) : e(d, -1);
|
|
1018
1018
|
});
|
|
1019
1019
|
var f = V.sibling(s, 2), p = V.child(f, !0);
|
|
1020
1020
|
V.reset(f), V.reset(o), V.reset(i);
|
|
1021
1021
|
var m = V.sibling(i, 2), h = (e) => {
|
|
1022
1022
|
let t = V.derived(() => V.get(U)[$] ?? []);
|
|
1023
|
-
var n =
|
|
1023
|
+
var n = Bt(), r = V.child(n), i = V.derived(() => Wn($)), o = V.derived(() => Gn($));
|
|
1024
1024
|
V.each(r, 29, () => V.get(t), (e) => e.id, (e, t) => {
|
|
1025
|
-
var n =
|
|
1026
|
-
u(V.child(n), () => V.get(t)), V.reset(n), V.animation(n, () =>
|
|
1025
|
+
var n = Rt();
|
|
1026
|
+
u(V.child(n), () => V.get(t)), V.reset(n), V.animation(n, () => Tt, () => ({ duration: 200 })), V.append(e, n);
|
|
1027
1027
|
}), V.reset(r), V.action(r, (e, t) => Be?.(e, t), () => ({
|
|
1028
1028
|
items: V.get(t),
|
|
1029
1029
|
flipDurationMs: 200,
|
|
@@ -1031,14 +1031,14 @@ function Gt(e, i) {
|
|
|
1031
1031
|
dropTargetStyle: {},
|
|
1032
1032
|
dragDisabled: V.get(P)
|
|
1033
1033
|
}));
|
|
1034
|
-
var s = V.sibling(r, 2), l = V.derived(() =>
|
|
1035
|
-
V.each(s, 29, () => V.get(
|
|
1036
|
-
var n =
|
|
1037
|
-
|
|
1034
|
+
var s = V.sibling(r, 2), l = V.derived(() => Ln({ kind: "root" })), d = V.derived(() => Rn({ kind: "root" }));
|
|
1035
|
+
V.each(s, 29, () => V.get(xt), (e) => e.id, (e, t) => {
|
|
1036
|
+
var n = zt(), r = V.child(n);
|
|
1037
|
+
At(r, () => V.get(t));
|
|
1038
1038
|
var i = V.sibling(r, 2);
|
|
1039
|
-
c(i, () => V.get(t)), a(V.sibling(i, 2), () => V.get(t)), V.reset(n), V.animation(n, () =>
|
|
1039
|
+
c(i, () => V.get(t)), a(V.sibling(i, 2), () => V.get(t)), V.reset(n), V.animation(n, () => Tt, () => ({ duration: 80 })), V.append(e, n);
|
|
1040
1040
|
}), V.reset(s), V.action(s, (e, t) => Be?.(e, t), () => ({
|
|
1041
|
-
items: V.get(
|
|
1041
|
+
items: V.get(xt),
|
|
1042
1042
|
flipDurationMs: 80,
|
|
1043
1043
|
type: "doc",
|
|
1044
1044
|
dropTargetStyle: {},
|
|
@@ -1047,7 +1047,7 @@ function Gt(e, i) {
|
|
|
1047
1047
|
centreDraggedOnCursor: !0
|
|
1048
1048
|
})), V.reset(n), V.template_effect((e, t) => {
|
|
1049
1049
|
V.set_class(r, 1, e), V.set_class(s, 1, t);
|
|
1050
|
-
}, [() => V.clsx(
|
|
1050
|
+
}, [() => V.clsx(F("min-h-[8px] space-y-0.5 transition-all duration-150", V.get(L) && V.get(t).length === 0 && "min-h-[36px] bg-accent/20 rounded border border-dashed border-muted-foreground/20")), () => V.clsx(F("min-h-[8px] space-y-0.5 transition-all duration-150", V.get(it) && V.get(xt).length === 0 && "min-h-[36px] bg-accent/20 rounded border border-dashed border-muted-foreground/20"))]), V.event("consider", r, function(...e) {
|
|
1051
1051
|
V.get(i)?.apply(this, e);
|
|
1052
1052
|
}), V.event("finalize", r, function(...e) {
|
|
1053
1053
|
V.get(o)?.apply(this, e);
|
|
@@ -1058,62 +1058,62 @@ function Gt(e, i) {
|
|
|
1058
1058
|
}), V.append(e, n);
|
|
1059
1059
|
};
|
|
1060
1060
|
V.if(m, (e) => {
|
|
1061
|
-
V.get(
|
|
1061
|
+
V.get(D) && e(h);
|
|
1062
1062
|
}), V.reset(t), V.template_effect((e, t) => {
|
|
1063
|
-
V.set_attribute(o, "aria-expanded", V.get(
|
|
1064
|
-
}, [() => V.clsx(
|
|
1065
|
-
V.get(
|
|
1063
|
+
V.set_attribute(o, "aria-expanded", V.get(D)), V.set_class(o, 1, e), V.set_text(p, t);
|
|
1064
|
+
}, [() => V.clsx(F("flex min-w-0 flex-1 items-center gap-1.5 rounded-md px-2 py-1.5 text-xs font-medium uppercase tracking-wider text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground", V.get(R) && "hover:bg-accent/40 border border-dashed border-primary/30")), () => he()]), V.delegated("click", o, jn), V.event("mouseenter", o, () => {
|
|
1065
|
+
V.get(I) && !V.get(D) && hn($);
|
|
1066
1066
|
}), V.event("mouseleave", o, () => {
|
|
1067
|
-
V.get(
|
|
1068
|
-
}), V.event("dragover", o,
|
|
1067
|
+
V.get(I) && mn();
|
|
1068
|
+
}), V.event("dragover", o, Bn), V.event("drop", o, (e) => Vn(e, $)), V.append(e, t);
|
|
1069
1069
|
};
|
|
1070
|
-
V.if(
|
|
1071
|
-
V.get(
|
|
1070
|
+
V.if(Pr, (e) => {
|
|
1071
|
+
V.get(br) && e(Fr);
|
|
1072
1072
|
});
|
|
1073
|
-
var
|
|
1074
|
-
s(
|
|
1075
|
-
var
|
|
1076
|
-
V.reset(
|
|
1077
|
-
var
|
|
1078
|
-
l(
|
|
1073
|
+
var Ir = V.sibling(Pr, 2), Lr = V.child(Ir);
|
|
1074
|
+
s(Lr, { class: "size-3.5" });
|
|
1075
|
+
var Rr = V.sibling(Lr, 2), zr = V.child(Rr, !0);
|
|
1076
|
+
V.reset(Rr), V.reset(Ir), V.reset(wr);
|
|
1077
|
+
var Br = V.sibling(wr, 2);
|
|
1078
|
+
l(Br, {
|
|
1079
1079
|
mode: "create",
|
|
1080
|
-
onSave:
|
|
1080
|
+
onSave: Fn,
|
|
1081
1081
|
closeOnSave: !1,
|
|
1082
1082
|
get open() {
|
|
1083
|
-
return V.get(
|
|
1083
|
+
return V.get(Dt);
|
|
1084
1084
|
},
|
|
1085
1085
|
set open(e) {
|
|
1086
|
-
V.set(
|
|
1086
|
+
V.set(Dt, e, !0);
|
|
1087
1087
|
}
|
|
1088
1088
|
});
|
|
1089
|
-
var
|
|
1090
|
-
|
|
1089
|
+
var Vr = V.sibling(Br, 2);
|
|
1090
|
+
De(Vr, {
|
|
1091
1091
|
onOpenChange: (e) => {
|
|
1092
|
-
e ||
|
|
1092
|
+
e || ar();
|
|
1093
1093
|
},
|
|
1094
1094
|
get open() {
|
|
1095
|
-
return V.get(
|
|
1095
|
+
return V.get(Ft);
|
|
1096
1096
|
},
|
|
1097
1097
|
set open(e) {
|
|
1098
|
-
V.set(
|
|
1098
|
+
V.set(Ft, e, !0);
|
|
1099
1099
|
},
|
|
1100
1100
|
children: (e, t) => {
|
|
1101
|
-
var n =
|
|
1102
|
-
|
|
1101
|
+
var n = Wt(), r = V.first_child(n);
|
|
1102
|
+
ke(r, {
|
|
1103
1103
|
children: (e, t) => {
|
|
1104
|
-
var n =
|
|
1105
|
-
|
|
1104
|
+
var n = Nt(), r = V.first_child(n);
|
|
1105
|
+
Me(r, {
|
|
1106
1106
|
children: (e, t) => {
|
|
1107
1107
|
V.next();
|
|
1108
1108
|
var n = V.text();
|
|
1109
|
-
V.template_effect((e) => V.set_text(n, e), [() =>
|
|
1109
|
+
V.template_effect((e) => V.set_text(n, e), [() => le()]), V.append(e, n);
|
|
1110
1110
|
},
|
|
1111
1111
|
$$slots: { default: !0 }
|
|
1112
|
-
}),
|
|
1112
|
+
}), Oe(V.sibling(r, 2), {
|
|
1113
1113
|
children: (e, t) => {
|
|
1114
1114
|
V.next();
|
|
1115
1115
|
var n = V.text();
|
|
1116
|
-
V.template_effect((e) => V.set_text(n, e), [() => V.get(
|
|
1116
|
+
V.template_effect((e) => V.set_text(n, e), [() => V.get(Kt)?.kind === "folder" ? pe() : de()]), V.append(e, n);
|
|
1117
1117
|
},
|
|
1118
1118
|
$$slots: { default: !0 }
|
|
1119
1119
|
}), V.append(e, n);
|
|
@@ -1121,19 +1121,19 @@ function Gt(e, i) {
|
|
|
1121
1121
|
$$slots: { default: !0 }
|
|
1122
1122
|
});
|
|
1123
1123
|
var i = V.sibling(r, 2), a = V.child(i), o = V.child(a);
|
|
1124
|
-
|
|
1124
|
+
Pe(o, {
|
|
1125
1125
|
for: "rename-input",
|
|
1126
1126
|
children: (e, t) => {
|
|
1127
1127
|
V.next();
|
|
1128
1128
|
var n = V.text();
|
|
1129
|
-
V.template_effect((e) => V.set_text(n, e), [() => V.get(
|
|
1129
|
+
V.template_effect((e) => V.set_text(n, e), [() => V.get(Kt)?.kind === "folder" ? pe() : de()]), V.append(e, n);
|
|
1130
1130
|
},
|
|
1131
1131
|
$$slots: { default: !0 }
|
|
1132
1132
|
});
|
|
1133
1133
|
var s = V.sibling(o, 2);
|
|
1134
1134
|
{
|
|
1135
1135
|
let e = V.derived(() => V.get(G) ? "true" : void 0), t = V.derived(() => V.get(G) ? "rename-input-error" : void 0);
|
|
1136
|
-
|
|
1136
|
+
Ne(s, {
|
|
1137
1137
|
id: "rename-input",
|
|
1138
1138
|
name: "name",
|
|
1139
1139
|
type: "text",
|
|
@@ -1150,26 +1150,26 @@ function Gt(e, i) {
|
|
|
1150
1150
|
},
|
|
1151
1151
|
autocomplete: "off",
|
|
1152
1152
|
get value() {
|
|
1153
|
-
return V.get(
|
|
1153
|
+
return V.get(qt);
|
|
1154
1154
|
},
|
|
1155
1155
|
set value(e) {
|
|
1156
|
-
V.set(
|
|
1156
|
+
V.set(qt, e, !0);
|
|
1157
1157
|
}
|
|
1158
1158
|
});
|
|
1159
1159
|
}
|
|
1160
1160
|
var c = V.sibling(s, 2), l = (e) => {
|
|
1161
|
-
var t =
|
|
1161
|
+
var t = Ut(), n = V.child(t, !0);
|
|
1162
1162
|
V.reset(t), V.template_effect(() => V.set_text(n, V.get(G))), V.append(e, t);
|
|
1163
1163
|
};
|
|
1164
1164
|
V.if(c, (e) => {
|
|
1165
1165
|
V.get(G) && e(l);
|
|
1166
|
-
}), V.reset(a), V.reset(i),
|
|
1166
|
+
}), V.reset(a), V.reset(i), je(V.sibling(i, 2), {
|
|
1167
1167
|
children: (e, t) => {
|
|
1168
|
-
var n =
|
|
1169
|
-
|
|
1168
|
+
var n = Nt(), r = V.first_child(n);
|
|
1169
|
+
Ae(r, {
|
|
1170
1170
|
variant: "outline",
|
|
1171
1171
|
type: "button",
|
|
1172
|
-
onclick:
|
|
1172
|
+
onclick: ar,
|
|
1173
1173
|
get disabled() {
|
|
1174
1174
|
return V.get(K);
|
|
1175
1175
|
},
|
|
@@ -1182,17 +1182,17 @@ function Gt(e, i) {
|
|
|
1182
1182
|
});
|
|
1183
1183
|
var i = V.sibling(r, 2);
|
|
1184
1184
|
{
|
|
1185
|
-
let e = V.derived(() => V.get(K) || V.get(
|
|
1186
|
-
|
|
1185
|
+
let e = V.derived(() => V.get(K) || V.get(qt).trim().length === 0);
|
|
1186
|
+
Ae(i, {
|
|
1187
1187
|
type: "submit",
|
|
1188
|
-
onclick:
|
|
1188
|
+
onclick: or,
|
|
1189
1189
|
get disabled() {
|
|
1190
1190
|
return V.get(e);
|
|
1191
1191
|
},
|
|
1192
1192
|
children: (e, t) => {
|
|
1193
1193
|
V.next();
|
|
1194
1194
|
var n = V.text();
|
|
1195
|
-
V.template_effect((e) => V.set_text(n, e), [() => V.get(K) ?
|
|
1195
|
+
V.template_effect((e) => V.set_text(n, e), [() => V.get(K) ? A() : ue()]), V.append(e, n);
|
|
1196
1196
|
},
|
|
1197
1197
|
$$slots: { default: !0 }
|
|
1198
1198
|
});
|
|
@@ -1200,14 +1200,14 @@ function Gt(e, i) {
|
|
|
1200
1200
|
V.append(e, n);
|
|
1201
1201
|
},
|
|
1202
1202
|
$$slots: { default: !0 }
|
|
1203
|
-
}), V.event("submit", i,
|
|
1203
|
+
}), V.event("submit", i, or), V.append(e, n);
|
|
1204
1204
|
},
|
|
1205
1205
|
$$slots: { default: !0 }
|
|
1206
1206
|
});
|
|
1207
|
-
var
|
|
1207
|
+
var Hr = V.sibling(Vr, 2);
|
|
1208
1208
|
{
|
|
1209
|
-
let e = V.derived(() => V.get(q)?.name ?? ""), t = V.derived(() => V.get(q)?.kind === "folder" ? ge() : Se()), n = V.derived(() => V.get(q)?.kind === "folder" ? "Its documents will be moved to the root and will not be deleted." :
|
|
1210
|
-
Xe(
|
|
1209
|
+
let e = V.derived(() => V.get(q)?.name ?? ""), t = V.derived(() => V.get(q)?.kind === "folder" ? ge() : Se()), n = V.derived(() => V.get(q)?.kind === "folder" ? "Its documents will be moved to the root and will not be deleted." : fe()), r = V.derived(() => V.get(q)?.kind === "folder" ? ce() : E()), i = V.derived(() => V.get(q)?.kind === "folder" ? ye() : v()), a = V.derived(() => N()), o = V.derived(() => _e());
|
|
1210
|
+
Xe(Hr, {
|
|
1211
1211
|
get targetName() {
|
|
1212
1212
|
return V.get(e);
|
|
1213
1213
|
},
|
|
@@ -1229,80 +1229,81 @@ function Gt(e, i) {
|
|
|
1229
1229
|
get cancelLabel() {
|
|
1230
1230
|
return V.get(o);
|
|
1231
1231
|
},
|
|
1232
|
-
onConfirm:
|
|
1233
|
-
onCancel:
|
|
1232
|
+
onConfirm: fr,
|
|
1233
|
+
onCancel: dr,
|
|
1234
1234
|
get open() {
|
|
1235
|
-
return V.get(
|
|
1235
|
+
return V.get(Jt);
|
|
1236
1236
|
},
|
|
1237
1237
|
set open(e) {
|
|
1238
|
-
V.set(
|
|
1238
|
+
V.set(Jt, e, !0);
|
|
1239
1239
|
}
|
|
1240
1240
|
});
|
|
1241
1241
|
}
|
|
1242
|
-
var
|
|
1242
|
+
var Ur = V.sibling(Hr, 2);
|
|
1243
1243
|
{
|
|
1244
1244
|
let e = V.derived(() => V.get(J) ?? void 0);
|
|
1245
|
-
$e(
|
|
1245
|
+
$e(Ur, {
|
|
1246
1246
|
get mode() {
|
|
1247
|
-
return V.get(
|
|
1247
|
+
return V.get(rn);
|
|
1248
1248
|
},
|
|
1249
1249
|
get category() {
|
|
1250
1250
|
return V.get(e);
|
|
1251
1251
|
},
|
|
1252
|
-
onSave:
|
|
1253
|
-
onDelete:
|
|
1254
|
-
onClose:
|
|
1252
|
+
onSave: _r,
|
|
1253
|
+
onDelete: vr,
|
|
1254
|
+
onClose: gr,
|
|
1255
1255
|
get open() {
|
|
1256
|
-
return V.get(
|
|
1256
|
+
return V.get(nn);
|
|
1257
1257
|
},
|
|
1258
1258
|
set open(e) {
|
|
1259
|
-
V.set(
|
|
1259
|
+
V.set(nn, e, !0);
|
|
1260
1260
|
}
|
|
1261
1261
|
});
|
|
1262
1262
|
}
|
|
1263
|
-
return Qe(V.sibling(
|
|
1263
|
+
return Qe(V.sibling(Ur, 2), {
|
|
1264
1264
|
get documentId() {
|
|
1265
|
-
return V.get(
|
|
1265
|
+
return V.get(Xt);
|
|
1266
1266
|
},
|
|
1267
1267
|
get documentTitle() {
|
|
1268
|
-
return V.get(
|
|
1268
|
+
return V.get(Qt);
|
|
1269
1269
|
},
|
|
1270
1270
|
get folderId() {
|
|
1271
|
-
return V.get(
|
|
1271
|
+
return V.get(Zt);
|
|
1272
1272
|
},
|
|
1273
1273
|
get folderName() {
|
|
1274
|
-
return V.get(
|
|
1274
|
+
return V.get($t);
|
|
1275
1275
|
},
|
|
1276
1276
|
get categoryId() {
|
|
1277
|
-
return V.get(
|
|
1277
|
+
return V.get(en);
|
|
1278
1278
|
},
|
|
1279
1279
|
get categoryName() {
|
|
1280
|
-
return V.get(
|
|
1280
|
+
return V.get(tn);
|
|
1281
1281
|
},
|
|
1282
1282
|
get open() {
|
|
1283
|
-
return V.get(
|
|
1283
|
+
return V.get(Yt);
|
|
1284
1284
|
},
|
|
1285
1285
|
set open(e) {
|
|
1286
|
-
V.set(
|
|
1286
|
+
V.set(Yt, e, !0);
|
|
1287
1287
|
}
|
|
1288
|
-
}), V.template_effect((e, t, n, r, i) => {
|
|
1289
|
-
V.set_attribute(
|
|
1288
|
+
}), V.template_effect((e, t, n, r, i, a) => {
|
|
1289
|
+
V.set_attribute(Er, "href", e), V.set_attribute(Er, "title", t), V.set_text(Dr, n), V.set_attribute(Or, "aria-label", r), V.set_attribute(Or, "title", i), V.set_text(zr, a);
|
|
1290
1290
|
}, [
|
|
1291
|
-
() =>
|
|
1292
|
-
() =>
|
|
1291
|
+
() => we(d, "/"),
|
|
1292
|
+
() => S(),
|
|
1293
|
+
() => oe(),
|
|
1293
1294
|
() => xe(),
|
|
1294
1295
|
() => xe(),
|
|
1295
1296
|
() => be()
|
|
1296
|
-
]), V.delegated("click",
|
|
1297
|
+
]), V.delegated("click", Or, pr), V.event("consider", Nr, Zn), V.event("finalize", Nr, Qn), V.delegated("click", Ir, Mn), V.append(e, Cr), V.pop(Sr);
|
|
1297
1298
|
}
|
|
1298
1299
|
V.delegate(["click"]);
|
|
1299
1300
|
//#endregion
|
|
1300
1301
|
//#region src/lib/components/sidebar/RecentDocs.svelte
|
|
1301
|
-
var
|
|
1302
|
-
function
|
|
1302
|
+
var qt = V.from_html("<p class=\"px-2 text-xs text-destructive\"> </p>"), G = V.from_html("<button><!></button>"), K = V.from_html("<!> <!>", 1), Jt = V.from_html("<div class=\"group/doc flex min-w-0 items-center gap-1\"><a><!> <div class=\"min-w-0 flex-1\"><p class=\"truncate min-w-0\"> </p> <p class=\"text-xs text-muted-foreground\"> </p></div></a> <button type=\"button\"><!></button> <!></div>"), q = V.from_html("<p id=\"recent-rename-input-error\" class=\"text-xs text-destructive\" role=\"alert\"> </p>"), Yt = V.from_html("<!> <form class=\"space-y-4\"><div class=\"space-y-2\"><!> <!> <!></div></form> <!>", 1), Xt = V.from_html("<div class=\"space-y-1\"><h3 class=\"mb-2 px-2 text-xs font-medium uppercase tracking-wider text-muted-foreground\"> </h3> <!> <!></div> <!> <!>", 1);
|
|
1303
|
+
function Zt(e, n) {
|
|
1303
1304
|
V.push(n, !0);
|
|
1304
|
-
let r = Ce(), i = V.state(V.proxy([])), a = V.state(null), s = V.state(null), l = V.state(null), u = V.state(null), d = null, f = V.state(!1), p = V.state(null),
|
|
1305
|
-
async function
|
|
1305
|
+
let r = Ce(), i = V.state(V.proxy([])), a = V.state(null), s = V.state(null), l = V.state(null), u = V.state(null), d = null, f = V.state(!1), p = V.state(null), _ = V.state(""), v = V.state(null), y = V.state(!1), b = V.state(!1), S = V.state(null), w = V.state(!1);
|
|
1306
|
+
async function T() {
|
|
1306
1307
|
try {
|
|
1307
1308
|
let e = z(), t = await We({
|
|
1308
1309
|
limit: 6,
|
|
@@ -1313,26 +1314,26 @@ function Xt(e, n) {
|
|
|
1313
1314
|
console.error("RecentDocs: failed to load recent documents", e), V.set(s, "Failed to load recent documents");
|
|
1314
1315
|
}
|
|
1315
1316
|
}
|
|
1316
|
-
|
|
1317
|
-
|
|
1317
|
+
Ct(() => {
|
|
1318
|
+
T();
|
|
1318
1319
|
}), V.user_effect(() => {
|
|
1319
|
-
|
|
1320
|
+
_t() !== 0 && T();
|
|
1320
1321
|
});
|
|
1321
|
-
let
|
|
1322
|
+
let E = !0;
|
|
1322
1323
|
V.user_effect(() => {
|
|
1323
|
-
if (z(),
|
|
1324
|
-
|
|
1324
|
+
if (z(), E) {
|
|
1325
|
+
E = !1;
|
|
1325
1326
|
return;
|
|
1326
1327
|
}
|
|
1327
|
-
|
|
1328
|
+
T();
|
|
1328
1329
|
});
|
|
1329
|
-
async function
|
|
1330
|
-
await
|
|
1330
|
+
async function ie() {
|
|
1331
|
+
await T();
|
|
1331
1332
|
}
|
|
1332
|
-
|
|
1333
|
+
St(() => {
|
|
1333
1334
|
d &&= (clearTimeout(d), null);
|
|
1334
1335
|
});
|
|
1335
|
-
async function
|
|
1336
|
+
async function D(e, t) {
|
|
1336
1337
|
if (e.preventDefault(), e.stopPropagation(), typeof window > "u") return;
|
|
1337
1338
|
let n = V.get(i).find((e) => e.id === t), a = "";
|
|
1338
1339
|
V.set(u, t, !0);
|
|
@@ -1347,57 +1348,57 @@ function Xt(e, n) {
|
|
|
1347
1348
|
V.set(l, null), d = null;
|
|
1348
1349
|
}, 2e3));
|
|
1349
1350
|
}
|
|
1350
|
-
function
|
|
1351
|
+
function ae(e, t) {
|
|
1351
1352
|
V.set(p, {
|
|
1352
1353
|
id: e,
|
|
1353
1354
|
title: t
|
|
1354
|
-
}, !0), V.set(
|
|
1355
|
+
}, !0), V.set(_, t, !0), V.set(v, null), V.set(f, !0);
|
|
1355
1356
|
}
|
|
1356
|
-
function
|
|
1357
|
-
V.set(f, !1), V.set(p, null), V.set(
|
|
1357
|
+
function O() {
|
|
1358
|
+
V.set(f, !1), V.set(p, null), V.set(_, ""), V.set(v, null), V.set(y, !1);
|
|
1358
1359
|
}
|
|
1359
|
-
async function
|
|
1360
|
+
async function oe(e) {
|
|
1360
1361
|
e?.preventDefault();
|
|
1361
1362
|
let t = V.get(p);
|
|
1362
1363
|
if (!t) return;
|
|
1363
|
-
let n = V.get(
|
|
1364
|
+
let n = V.get(_).trim();
|
|
1364
1365
|
if (n.length === 0) {
|
|
1365
|
-
V.set(
|
|
1366
|
+
V.set(v, "Name is required");
|
|
1366
1367
|
return;
|
|
1367
1368
|
}
|
|
1368
|
-
V.set(
|
|
1369
|
+
V.set(y, !0);
|
|
1369
1370
|
try {
|
|
1370
|
-
await Ve(t.id, { title: n }, r.fetch),
|
|
1371
|
+
await Ve(t.id, { title: n }, r.fetch), O(), await T(), ht();
|
|
1371
1372
|
} catch (e) {
|
|
1372
|
-
console.error("RecentDocs: rename failed", e), V.set(
|
|
1373
|
+
console.error("RecentDocs: rename failed", e), V.set(v, e instanceof Error ? e.message : me(), !0);
|
|
1373
1374
|
} finally {
|
|
1374
|
-
V.set(
|
|
1375
|
+
V.set(y, !1);
|
|
1375
1376
|
}
|
|
1376
1377
|
}
|
|
1377
|
-
function
|
|
1378
|
-
V.set(
|
|
1378
|
+
function se(e, t) {
|
|
1379
|
+
V.set(S, {
|
|
1379
1380
|
id: e,
|
|
1380
1381
|
title: t
|
|
1381
|
-
}, !0), V.set(
|
|
1382
|
+
}, !0), V.set(b, !0);
|
|
1382
1383
|
}
|
|
1383
|
-
function
|
|
1384
|
-
V.set(
|
|
1384
|
+
function k() {
|
|
1385
|
+
V.set(b, !1), V.set(S, null), V.set(w, !1);
|
|
1385
1386
|
}
|
|
1386
|
-
async function
|
|
1387
|
-
let e = V.get(
|
|
1388
|
-
if (!(!e || V.get(
|
|
1389
|
-
V.set(
|
|
1387
|
+
async function j() {
|
|
1388
|
+
let e = V.get(S);
|
|
1389
|
+
if (!(!e || V.get(w))) {
|
|
1390
|
+
V.set(w, !0);
|
|
1390
1391
|
try {
|
|
1391
|
-
await Ue(e.id, r.fetch),
|
|
1392
|
+
await Ue(e.id, r.fetch), k(), await T(), ht();
|
|
1392
1393
|
} catch (e) {
|
|
1393
|
-
console.error("RecentDocs: delete failed", e), V.set(s, e instanceof Error ? e.message : me(), !0), V.set(
|
|
1394
|
+
console.error("RecentDocs: delete failed", e), V.set(s, e instanceof Error ? e.message : me(), !0), V.set(w, !1);
|
|
1394
1395
|
}
|
|
1395
1396
|
}
|
|
1396
1397
|
}
|
|
1397
|
-
var
|
|
1398
|
+
var ce = { refreshRecentDocs: ie }, M = Xt(), pe = V.first_child(M), he = V.child(pe), ge = V.child(he, !0);
|
|
1398
1399
|
V.reset(he);
|
|
1399
1400
|
var P = V.sibling(he, 2), ve = (e) => {
|
|
1400
|
-
var t =
|
|
1401
|
+
var t = qt(), n = V.child(t, !0);
|
|
1401
1402
|
V.reset(t), V.template_effect(() => V.set_text(n, V.get(s))), V.append(e, t);
|
|
1402
1403
|
};
|
|
1403
1404
|
V.if(P, (e) => {
|
|
@@ -1405,25 +1406,25 @@ function Xt(e, n) {
|
|
|
1405
1406
|
});
|
|
1406
1407
|
var ye = V.sibling(P, 2);
|
|
1407
1408
|
V.each(ye, 17, () => V.get(i), (e) => e.id, (e, n) => {
|
|
1408
|
-
var r =
|
|
1409
|
+
var r = Jt(), i = V.child(r), s = V.child(i);
|
|
1409
1410
|
c(s, { class: "size-4 shrink-0 text-muted-foreground" });
|
|
1410
1411
|
var d = V.sibling(s, 2), f = V.child(d), p = V.child(f, !0);
|
|
1411
1412
|
V.reset(f);
|
|
1412
|
-
var
|
|
1413
|
-
V.reset(
|
|
1414
|
-
var
|
|
1415
|
-
|
|
1416
|
-
},
|
|
1413
|
+
var _ = V.sibling(f, 2), v = V.child(_, !0);
|
|
1414
|
+
V.reset(_), V.reset(d), V.reset(i);
|
|
1415
|
+
var y = V.sibling(i, 2), b = V.child(y), x = (e) => {
|
|
1416
|
+
ne(e, { class: "size-3.5 animate-spin" });
|
|
1417
|
+
}, S = (e) => {
|
|
1417
1418
|
t(e, { class: "size-3.5" });
|
|
1418
|
-
},
|
|
1419
|
+
}, w = (e) => {
|
|
1419
1420
|
o(e, { class: "size-3.5" });
|
|
1420
1421
|
};
|
|
1421
|
-
V.if(
|
|
1422
|
-
V.get(u) === V.get(n).id ? e(
|
|
1423
|
-
}), V.reset(
|
|
1422
|
+
V.if(b, (e) => {
|
|
1423
|
+
V.get(u) === V.get(n).id ? e(x) : V.get(l) === V.get(n).id ? e(S, 1) : e(w, -1);
|
|
1424
|
+
}), V.reset(y), m(V.sibling(y, 2), {
|
|
1424
1425
|
children: (e, t) => {
|
|
1425
1426
|
var r = K(), i = V.first_child(r);
|
|
1426
|
-
|
|
1427
|
+
te(i, {
|
|
1427
1428
|
child: (e, t) => {
|
|
1428
1429
|
let n = () => (t?.()).props;
|
|
1429
1430
|
var r = G(), i = (e) => {
|
|
@@ -1436,28 +1437,28 @@ function Xt(e, n) {
|
|
|
1436
1437
|
"aria-label": e,
|
|
1437
1438
|
title: t,
|
|
1438
1439
|
onclick: i
|
|
1439
|
-
}), [() =>
|
|
1440
|
+
}), [() => C(), () => C()]), ee(V.child(r), { class: "size-3.5" }), V.reset(r), V.append(e, r);
|
|
1440
1441
|
},
|
|
1441
1442
|
$$slots: { child: !0 }
|
|
1442
1443
|
}), h(V.sibling(i, 2), {
|
|
1443
1444
|
align: "end",
|
|
1444
1445
|
children: (e, t) => {
|
|
1445
1446
|
var r = K(), i = V.first_child(r);
|
|
1446
|
-
|
|
1447
|
-
onSelect: () =>
|
|
1447
|
+
g(i, {
|
|
1448
|
+
onSelect: () => ae(V.get(n).id, V.get(n).title),
|
|
1448
1449
|
children: (e, t) => {
|
|
1449
1450
|
V.next();
|
|
1450
1451
|
var n = V.text();
|
|
1451
|
-
V.template_effect((e) => V.set_text(n, e), [() =>
|
|
1452
|
+
V.template_effect((e) => V.set_text(n, e), [() => le()]), V.append(e, n);
|
|
1452
1453
|
},
|
|
1453
1454
|
$$slots: { default: !0 }
|
|
1454
|
-
}),
|
|
1455
|
+
}), g(V.sibling(i, 2), {
|
|
1455
1456
|
class: "text-destructive focus:text-destructive",
|
|
1456
|
-
onSelect: () =>
|
|
1457
|
+
onSelect: () => se(V.get(n).id, V.get(n).title),
|
|
1457
1458
|
children: (e, t) => {
|
|
1458
1459
|
V.next();
|
|
1459
1460
|
var n = V.text();
|
|
1460
|
-
V.template_effect((e) => V.set_text(n, e), [() =>
|
|
1461
|
+
V.template_effect((e) => V.set_text(n, e), [() => N()]), V.append(e, n);
|
|
1461
1462
|
},
|
|
1462
1463
|
$$slots: { default: !0 }
|
|
1463
1464
|
}), V.append(e, r);
|
|
@@ -1467,19 +1468,19 @@ function Xt(e, n) {
|
|
|
1467
1468
|
},
|
|
1468
1469
|
$$slots: { default: !0 }
|
|
1469
1470
|
}), V.reset(r), V.template_effect((e, t, r) => {
|
|
1470
|
-
V.set_attribute(i, "href", `/docs/${V.get(n).id}`), V.set_class(i, 1, e), V.set_text(p, V.get(n).title), V.set_text(
|
|
1471
|
+
V.set_attribute(i, "href", `/docs/${V.get(n).id}`), V.set_class(i, 1, e), V.set_text(p, V.get(n).title), V.set_text(v, V.get(n).updatedAt), V.set_class(y, 1, `inline-flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-accent-foreground group-hover/doc:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${V.get(l) === V.get(n).id || V.get(u) === V.get(n).id ? "opacity-100" : ""}`), V.set_attribute(y, "aria-label", t), V.set_attribute(y, "title", r), y.disabled = V.get(u) === V.get(n).id;
|
|
1471
1472
|
}, [
|
|
1472
|
-
() => V.clsx(
|
|
1473
|
-
() =>
|
|
1474
|
-
() =>
|
|
1473
|
+
() => V.clsx(F("flex min-w-0 flex-1 items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors hover:bg-accent hover:text-accent-foreground", V.get(a) === V.get(n).id && "bg-accent text-accent-foreground")),
|
|
1474
|
+
() => re(),
|
|
1475
|
+
() => re()
|
|
1475
1476
|
]), V.delegated("click", i, () => {
|
|
1476
1477
|
V.set(a, V.get(n).id, !0);
|
|
1477
|
-
}), V.delegated("click",
|
|
1478
|
-
}), V.reset(
|
|
1479
|
-
var be = V.sibling(
|
|
1480
|
-
|
|
1478
|
+
}), V.delegated("click", y, (e) => void D(e, V.get(n).id)), V.append(e, r);
|
|
1479
|
+
}), V.reset(pe);
|
|
1480
|
+
var be = V.sibling(pe, 2);
|
|
1481
|
+
De(be, {
|
|
1481
1482
|
onOpenChange: (e) => {
|
|
1482
|
-
e ||
|
|
1483
|
+
e || O();
|
|
1483
1484
|
},
|
|
1484
1485
|
get open() {
|
|
1485
1486
|
return V.get(f);
|
|
@@ -1488,22 +1489,22 @@ function Xt(e, n) {
|
|
|
1488
1489
|
V.set(f, e, !0);
|
|
1489
1490
|
},
|
|
1490
1491
|
children: (e, t) => {
|
|
1491
|
-
var n =
|
|
1492
|
-
|
|
1492
|
+
var n = Yt(), r = V.first_child(n);
|
|
1493
|
+
ke(r, {
|
|
1493
1494
|
children: (e, t) => {
|
|
1494
1495
|
var n = K(), r = V.first_child(n);
|
|
1495
|
-
|
|
1496
|
+
Me(r, {
|
|
1496
1497
|
children: (e, t) => {
|
|
1497
1498
|
V.next();
|
|
1498
1499
|
var n = V.text();
|
|
1499
|
-
V.template_effect((e) => V.set_text(n, e), [() =>
|
|
1500
|
+
V.template_effect((e) => V.set_text(n, e), [() => le()]), V.append(e, n);
|
|
1500
1501
|
},
|
|
1501
1502
|
$$slots: { default: !0 }
|
|
1502
|
-
}),
|
|
1503
|
+
}), Oe(V.sibling(r, 2), {
|
|
1503
1504
|
children: (e, t) => {
|
|
1504
1505
|
V.next();
|
|
1505
1506
|
var n = V.text();
|
|
1506
|
-
V.template_effect((e) => V.set_text(n, e), [() =>
|
|
1507
|
+
V.template_effect((e) => V.set_text(n, e), [() => de()]), V.append(e, n);
|
|
1507
1508
|
},
|
|
1508
1509
|
$$slots: { default: !0 }
|
|
1509
1510
|
}), V.append(e, n);
|
|
@@ -1511,26 +1512,26 @@ function Xt(e, n) {
|
|
|
1511
1512
|
$$slots: { default: !0 }
|
|
1512
1513
|
});
|
|
1513
1514
|
var i = V.sibling(r, 2), a = V.child(i), o = V.child(a);
|
|
1514
|
-
|
|
1515
|
+
Pe(o, {
|
|
1515
1516
|
for: "recent-rename-input",
|
|
1516
1517
|
children: (e, t) => {
|
|
1517
1518
|
V.next();
|
|
1518
1519
|
var n = V.text();
|
|
1519
|
-
V.template_effect((e) => V.set_text(n, e), [() =>
|
|
1520
|
+
V.template_effect((e) => V.set_text(n, e), [() => de()]), V.append(e, n);
|
|
1520
1521
|
},
|
|
1521
1522
|
$$slots: { default: !0 }
|
|
1522
1523
|
});
|
|
1523
1524
|
var s = V.sibling(o, 2);
|
|
1524
1525
|
{
|
|
1525
|
-
let e = V.derived(() => V.get(
|
|
1526
|
-
|
|
1526
|
+
let e = V.derived(() => V.get(v) ? "true" : void 0), t = V.derived(() => V.get(v) ? "recent-rename-input-error" : void 0);
|
|
1527
|
+
Ne(s, {
|
|
1527
1528
|
id: "recent-rename-input",
|
|
1528
1529
|
name: "name",
|
|
1529
1530
|
type: "text",
|
|
1530
1531
|
maxlength: 255,
|
|
1531
1532
|
required: !0,
|
|
1532
1533
|
get disabled() {
|
|
1533
|
-
return V.get(
|
|
1534
|
+
return V.get(y);
|
|
1534
1535
|
},
|
|
1535
1536
|
get "aria-invalid"() {
|
|
1536
1537
|
return V.get(e);
|
|
@@ -1540,28 +1541,28 @@ function Xt(e, n) {
|
|
|
1540
1541
|
},
|
|
1541
1542
|
autocomplete: "off",
|
|
1542
1543
|
get value() {
|
|
1543
|
-
return V.get(
|
|
1544
|
+
return V.get(_);
|
|
1544
1545
|
},
|
|
1545
1546
|
set value(e) {
|
|
1546
|
-
V.set(
|
|
1547
|
+
V.set(_, e, !0);
|
|
1547
1548
|
}
|
|
1548
1549
|
});
|
|
1549
1550
|
}
|
|
1550
1551
|
var c = V.sibling(s, 2), l = (e) => {
|
|
1551
1552
|
var t = q(), n = V.child(t, !0);
|
|
1552
|
-
V.reset(t), V.template_effect(() => V.set_text(n, V.get(
|
|
1553
|
+
V.reset(t), V.template_effect(() => V.set_text(n, V.get(v))), V.append(e, t);
|
|
1553
1554
|
};
|
|
1554
1555
|
V.if(c, (e) => {
|
|
1555
|
-
V.get(
|
|
1556
|
-
}), V.reset(a), V.reset(i),
|
|
1556
|
+
V.get(v) && e(l);
|
|
1557
|
+
}), V.reset(a), V.reset(i), je(V.sibling(i, 2), {
|
|
1557
1558
|
children: (e, t) => {
|
|
1558
1559
|
var n = K(), r = V.first_child(n);
|
|
1559
|
-
|
|
1560
|
+
Ae(r, {
|
|
1560
1561
|
variant: "outline",
|
|
1561
1562
|
type: "button",
|
|
1562
|
-
onclick:
|
|
1563
|
+
onclick: O,
|
|
1563
1564
|
get disabled() {
|
|
1564
|
-
return V.get(
|
|
1565
|
+
return V.get(y);
|
|
1565
1566
|
},
|
|
1566
1567
|
children: (e, t) => {
|
|
1567
1568
|
V.next();
|
|
@@ -1572,17 +1573,17 @@ function Xt(e, n) {
|
|
|
1572
1573
|
});
|
|
1573
1574
|
var i = V.sibling(r, 2);
|
|
1574
1575
|
{
|
|
1575
|
-
let e = V.derived(() => V.get(
|
|
1576
|
-
|
|
1576
|
+
let e = V.derived(() => V.get(y) || V.get(_).trim().length === 0);
|
|
1577
|
+
Ae(i, {
|
|
1577
1578
|
type: "submit",
|
|
1578
|
-
onclick:
|
|
1579
|
+
onclick: oe,
|
|
1579
1580
|
get disabled() {
|
|
1580
1581
|
return V.get(e);
|
|
1581
1582
|
},
|
|
1582
1583
|
children: (e, t) => {
|
|
1583
1584
|
V.next();
|
|
1584
1585
|
var n = V.text();
|
|
1585
|
-
V.template_effect((e) => V.set_text(n, e), [() => V.get(
|
|
1586
|
+
V.template_effect((e) => V.set_text(n, e), [() => V.get(y) ? A() : ue()]), V.append(e, n);
|
|
1586
1587
|
},
|
|
1587
1588
|
$$slots: { default: !0 }
|
|
1588
1589
|
});
|
|
@@ -1590,14 +1591,14 @@ function Xt(e, n) {
|
|
|
1590
1591
|
V.append(e, n);
|
|
1591
1592
|
},
|
|
1592
1593
|
$$slots: { default: !0 }
|
|
1593
|
-
}), V.event("submit", i,
|
|
1594
|
+
}), V.event("submit", i, oe), V.append(e, n);
|
|
1594
1595
|
},
|
|
1595
1596
|
$$slots: { default: !0 }
|
|
1596
1597
|
});
|
|
1597
1598
|
var xe = V.sibling(be, 2);
|
|
1598
1599
|
{
|
|
1599
|
-
let e = V.derived(() => Se()), t = V.derived(() =>
|
|
1600
|
-
|
|
1600
|
+
let e = V.derived(() => Se()), t = V.derived(() => fe()), n = V.derived(() => N()), r = V.derived(() => _e());
|
|
1601
|
+
vt(xe, {
|
|
1601
1602
|
get title() {
|
|
1602
1603
|
return V.get(e);
|
|
1603
1604
|
},
|
|
@@ -1612,35 +1613,35 @@ function Xt(e, n) {
|
|
|
1612
1613
|
},
|
|
1613
1614
|
variant: "destructive",
|
|
1614
1615
|
get busy() {
|
|
1615
|
-
return V.get(
|
|
1616
|
+
return V.get(w);
|
|
1616
1617
|
},
|
|
1617
|
-
onConfirm:
|
|
1618
|
-
onCancel:
|
|
1618
|
+
onConfirm: j,
|
|
1619
|
+
onCancel: k,
|
|
1619
1620
|
get open() {
|
|
1620
|
-
return V.get(
|
|
1621
|
+
return V.get(b);
|
|
1621
1622
|
},
|
|
1622
1623
|
set open(e) {
|
|
1623
|
-
V.set(
|
|
1624
|
+
V.set(b, e, !0);
|
|
1624
1625
|
}
|
|
1625
1626
|
});
|
|
1626
1627
|
}
|
|
1627
|
-
return V.template_effect((e) => V.set_text(ge, e), [() =>
|
|
1628
|
+
return V.template_effect((e) => V.set_text(ge, e), [() => x()]), V.append(e, M), V.pop(ce);
|
|
1628
1629
|
}
|
|
1629
1630
|
V.delegate(["click"]);
|
|
1630
1631
|
//#endregion
|
|
1631
1632
|
//#region src/lib/components/sidebar/TagList.svelte
|
|
1632
|
-
var
|
|
1633
|
-
function
|
|
1633
|
+
var Qt = V.from_html("<p class=\"px-2 text-xs text-destructive\"> </p>"), $t = V.from_html("<button><!></button>"), en = V.from_html("<!> <!>", 1), tn = V.from_html("<div><button type=\"button\" class=\"inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium\"><span class=\"size-2.5 shrink-0 rounded-full\"></span> </button> <!></div>"), nn = V.from_html("<div class=\"space-y-1\"><h3 class=\"mb-2 px-2 text-xs font-medium uppercase tracking-wider text-muted-foreground\"> </h3> <!> <div class=\"flex flex-wrap gap-1 px-2\"><!> <button type=\"button\" class=\"inline-flex items-center gap-0.5 rounded-full px-2 py-0.5 text-xs text-muted-foreground transition-colors hover:bg-secondary hover:text-secondary-foreground\"><!> </button></div></div> <!> <!>", 1);
|
|
1634
|
+
function rn(e, t) {
|
|
1634
1635
|
V.push(t, !0);
|
|
1635
1636
|
let n = Ce(), r = V.state(V.proxy([])), i = V.state(null), a = V.state(!1), o = V.state(null), c = V.state(!1), l = V.state(null), u = V.state(!1);
|
|
1636
1637
|
async function d() {
|
|
1637
1638
|
try {
|
|
1638
|
-
V.set(r, await
|
|
1639
|
+
V.set(r, await bt(n.fetch), !0);
|
|
1639
1640
|
} catch (e) {
|
|
1640
|
-
console.error("TagList: failed to load tags", e), V.set(i,
|
|
1641
|
+
console.error("TagList: failed to load tags", e), V.set(i, O(), !0);
|
|
1641
1642
|
}
|
|
1642
1643
|
}
|
|
1643
|
-
|
|
1644
|
+
Ct(() => {
|
|
1644
1645
|
d();
|
|
1645
1646
|
}), V.user_effect(() => {
|
|
1646
1647
|
R(), d();
|
|
@@ -1651,24 +1652,24 @@ function nn(e, t) {
|
|
|
1651
1652
|
function p(e) {
|
|
1652
1653
|
V.set(r, V.get(r).map((t) => t.id === e.id ? e : t), !0), B();
|
|
1653
1654
|
}
|
|
1654
|
-
function
|
|
1655
|
+
function v(e) {
|
|
1655
1656
|
V.set(o, e, !0), V.set(a, !0);
|
|
1656
1657
|
}
|
|
1657
|
-
function
|
|
1658
|
+
function b() {
|
|
1658
1659
|
V.set(o, null);
|
|
1659
1660
|
}
|
|
1660
|
-
function
|
|
1661
|
+
function x(e) {
|
|
1661
1662
|
V.set(l, e, !0), V.set(c, !0);
|
|
1662
1663
|
}
|
|
1663
|
-
function
|
|
1664
|
+
function re() {
|
|
1664
1665
|
V.set(c, !1), V.set(l, null);
|
|
1665
1666
|
}
|
|
1666
|
-
async function
|
|
1667
|
+
async function S() {
|
|
1667
1668
|
let e = V.get(l);
|
|
1668
1669
|
if (!(!e || V.get(u))) {
|
|
1669
1670
|
V.set(u, !0);
|
|
1670
1671
|
try {
|
|
1671
|
-
await
|
|
1672
|
+
await yt(e.id, n.fetch), V.set(r, V.get(r).filter((t) => t.id !== e.id), !0), z() === e.id && gt(null), V.set(c, !1), V.set(l, null), B();
|
|
1672
1673
|
} catch (e) {
|
|
1673
1674
|
console.error("TagList: deleteTag failed", e), V.set(i, me(), !0);
|
|
1674
1675
|
} finally {
|
|
@@ -1676,25 +1677,25 @@ function nn(e, t) {
|
|
|
1676
1677
|
}
|
|
1677
1678
|
}
|
|
1678
1679
|
}
|
|
1679
|
-
var
|
|
1680
|
-
V.reset(
|
|
1681
|
-
var
|
|
1682
|
-
var t =
|
|
1680
|
+
var w = nn(), T = V.first_child(w), E = V.child(T), ie = V.child(E, !0);
|
|
1681
|
+
V.reset(E);
|
|
1682
|
+
var ae = V.sibling(E, 2), oe = (e) => {
|
|
1683
|
+
var t = Qt(), n = V.child(t, !0);
|
|
1683
1684
|
V.reset(t), V.template_effect(() => V.set_text(n, V.get(i))), V.append(e, t);
|
|
1684
1685
|
};
|
|
1685
|
-
V.if(
|
|
1686
|
-
V.get(i) && e(
|
|
1686
|
+
V.if(ae, (e) => {
|
|
1687
|
+
V.get(i) && e(oe);
|
|
1687
1688
|
});
|
|
1688
|
-
var
|
|
1689
|
-
V.each(
|
|
1690
|
-
var n =
|
|
1689
|
+
var se = V.sibling(ae, 2), k = V.child(se);
|
|
1690
|
+
V.each(k, 17, () => V.get(r), (e) => e.id, (e, t) => {
|
|
1691
|
+
var n = tn(), r = V.child(n), i = V.child(r), a = V.sibling(i);
|
|
1691
1692
|
V.reset(r), m(V.sibling(r, 2), {
|
|
1692
1693
|
children: (e, n) => {
|
|
1693
|
-
var r =
|
|
1694
|
-
|
|
1694
|
+
var r = en(), i = V.first_child(r);
|
|
1695
|
+
te(i, {
|
|
1695
1696
|
child: (e, n) => {
|
|
1696
1697
|
let r = () => (n?.()).props;
|
|
1697
|
-
var i =
|
|
1698
|
+
var i = $t();
|
|
1698
1699
|
V.attribute_effect(i, (e, t, n) => ({
|
|
1699
1700
|
...r(),
|
|
1700
1701
|
type: "button",
|
|
@@ -1703,14 +1704,14 @@ function nn(e, t) {
|
|
|
1703
1704
|
title: n,
|
|
1704
1705
|
disabled: V.get(u)
|
|
1705
1706
|
}), [
|
|
1706
|
-
() =>
|
|
1707
|
-
() =>
|
|
1708
|
-
() =>
|
|
1707
|
+
() => F("hidden size-5 items-center justify-center rounded-full hover:bg-black/10 focus-visible:inline-flex group-hover/tag:inline-flex mr-0.5 data-[state=open]:inline-flex", z() === V.get(t).id && "inline-flex"),
|
|
1708
|
+
() => C(),
|
|
1709
|
+
() => C()
|
|
1709
1710
|
]);
|
|
1710
1711
|
var a = V.child(i), o = (e) => {
|
|
1711
|
-
|
|
1712
|
+
ne(e, { class: "size-3 animate-spin" });
|
|
1712
1713
|
}, s = (e) => {
|
|
1713
|
-
|
|
1714
|
+
ee(e, { class: "size-3" });
|
|
1714
1715
|
};
|
|
1715
1716
|
V.if(a, (e) => {
|
|
1716
1717
|
V.get(u) ? e(o) : e(s, -1);
|
|
@@ -1720,22 +1721,22 @@ function nn(e, t) {
|
|
|
1720
1721
|
}), h(V.sibling(i, 2), {
|
|
1721
1722
|
align: "start",
|
|
1722
1723
|
children: (e, n) => {
|
|
1723
|
-
var r =
|
|
1724
|
-
|
|
1725
|
-
onSelect: () =>
|
|
1724
|
+
var r = en(), i = V.first_child(r);
|
|
1725
|
+
g(i, {
|
|
1726
|
+
onSelect: () => v(V.get(t)),
|
|
1726
1727
|
children: (e, t) => {
|
|
1727
1728
|
V.next();
|
|
1728
1729
|
var n = V.text();
|
|
1729
1730
|
V.template_effect((e) => V.set_text(n, e), [() => ve()]), V.append(e, n);
|
|
1730
1731
|
},
|
|
1731
1732
|
$$slots: { default: !0 }
|
|
1732
|
-
}),
|
|
1733
|
+
}), g(V.sibling(i, 2), {
|
|
1733
1734
|
class: "text-destructive focus:text-destructive",
|
|
1734
|
-
onSelect: () =>
|
|
1735
|
+
onSelect: () => x(V.get(t)),
|
|
1735
1736
|
children: (e, t) => {
|
|
1736
1737
|
V.next();
|
|
1737
1738
|
var n = V.text();
|
|
1738
|
-
V.template_effect((e) => V.set_text(n, e), [() =>
|
|
1739
|
+
V.template_effect((e) => V.set_text(n, e), [() => N()]), V.append(e, n);
|
|
1739
1740
|
},
|
|
1740
1741
|
$$slots: { default: !0 }
|
|
1741
1742
|
}), V.append(e, r);
|
|
@@ -1746,16 +1747,16 @@ function nn(e, t) {
|
|
|
1746
1747
|
$$slots: { default: !0 }
|
|
1747
1748
|
}), V.reset(n), V.template_effect((e, o) => {
|
|
1748
1749
|
V.set_class(n, 1, e), V.set_attribute(r, "aria-pressed", o), V.set_style(i, `background-color: ${(V.get(t).color || "#888888") ?? ""}`), V.set_text(a, ` ${V.get(t).name ?? ""}`);
|
|
1749
|
-
}, [() => V.clsx(
|
|
1750
|
+
}, [() => V.clsx(F("group/tag relative inline-flex items-center rounded-full transition-colors", z() === V.get(t).id ? "bg-primary text-primary-foreground" : "bg-secondary text-secondary-foreground hover:bg-secondary/80")), () => z() === V.get(t).id]), V.delegated("click", r, () => gt(z() === V.get(t).id ? null : V.get(t).id, V.get(t).name)), V.append(e, n);
|
|
1750
1751
|
});
|
|
1751
|
-
var
|
|
1752
|
-
s(
|
|
1753
|
-
var
|
|
1754
|
-
V.reset(
|
|
1755
|
-
var
|
|
1752
|
+
var A = V.sibling(k, 2), j = V.child(A);
|
|
1753
|
+
s(j, { class: "size-3" });
|
|
1754
|
+
var ce = V.sibling(j);
|
|
1755
|
+
V.reset(A), V.reset(se), V.reset(T);
|
|
1756
|
+
var le = V.sibling(T, 2);
|
|
1756
1757
|
{
|
|
1757
1758
|
let e = V.derived(() => V.get(o) ? "edit" : "create");
|
|
1758
|
-
|
|
1759
|
+
xt(le, {
|
|
1759
1760
|
get mode() {
|
|
1760
1761
|
return V.get(e);
|
|
1761
1762
|
},
|
|
@@ -1764,7 +1765,7 @@ function nn(e, t) {
|
|
|
1764
1765
|
},
|
|
1765
1766
|
onCreated: f,
|
|
1766
1767
|
onUpdated: p,
|
|
1767
|
-
onClose:
|
|
1768
|
+
onClose: b,
|
|
1768
1769
|
get open() {
|
|
1769
1770
|
return V.get(a);
|
|
1770
1771
|
},
|
|
@@ -1773,10 +1774,10 @@ function nn(e, t) {
|
|
|
1773
1774
|
}
|
|
1774
1775
|
});
|
|
1775
1776
|
}
|
|
1776
|
-
var
|
|
1777
|
+
var ue = V.sibling(le, 2);
|
|
1777
1778
|
{
|
|
1778
|
-
let e = V.derived(() =>
|
|
1779
|
-
|
|
1779
|
+
let e = V.derived(() => M()), t = V.derived(() => _()), n = V.derived(() => N()), r = V.derived(() => _e());
|
|
1780
|
+
vt(ue, {
|
|
1780
1781
|
get title() {
|
|
1781
1782
|
return V.get(e);
|
|
1782
1783
|
},
|
|
@@ -1793,8 +1794,8 @@ function nn(e, t) {
|
|
|
1793
1794
|
get busy() {
|
|
1794
1795
|
return V.get(u);
|
|
1795
1796
|
},
|
|
1796
|
-
onConfirm:
|
|
1797
|
-
onCancel:
|
|
1797
|
+
onConfirm: S,
|
|
1798
|
+
onCancel: re,
|
|
1798
1799
|
get open() {
|
|
1799
1800
|
return V.get(c);
|
|
1800
1801
|
},
|
|
@@ -1804,23 +1805,28 @@ function nn(e, t) {
|
|
|
1804
1805
|
});
|
|
1805
1806
|
}
|
|
1806
1807
|
V.template_effect((e, t, n) => {
|
|
1807
|
-
V.set_text(
|
|
1808
|
+
V.set_text(ie, e), V.set_attribute(A, "aria-label", t), V.set_text(ce, ` ${n ?? ""}`);
|
|
1808
1809
|
}, [
|
|
1809
|
-
() =>
|
|
1810
|
+
() => y(),
|
|
1810
1811
|
() => P(),
|
|
1811
|
-
() =>
|
|
1812
|
-
]), V.delegated("click",
|
|
1812
|
+
() => D()
|
|
1813
|
+
]), V.delegated("click", A, () => {
|
|
1813
1814
|
V.set(o, null), V.set(a, !0);
|
|
1814
|
-
}), V.append(e,
|
|
1815
|
+
}), V.append(e, w), V.pop();
|
|
1815
1816
|
}
|
|
1816
1817
|
V.delegate(["click"]);
|
|
1817
1818
|
//#endregion
|
|
1818
1819
|
//#region src/lib/components/sidebar/Sidebar.svelte
|
|
1819
|
-
var J = V.from_html("<div role=\"separator\" tabindex=\"-1\"></div>"),
|
|
1820
|
-
function
|
|
1820
|
+
var J = V.from_html("<div role=\"separator\" tabindex=\"-1\"></div>"), an = V.from_html("<button class=\"sidebar-collapse-toggle absolute -right-3 top-4 z-40 flex size-6 items-center justify-center rounded-full border border-border bg-background shadow-sm hover:bg-accent\"><!></button>"), Y = V.from_html("<!> <div class=\"h-px bg-border\"></div>", 1), on = V.from_html("<span class=\"rounded bg-muted px-1.5 py-0.5 text-xs\"> </span>"), X = V.from_html("<a class=\"flex items-center gap-2 rounded-md px-2 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground aria-disabled:pointer-events-none aria-disabled:opacity-50\"><!> <span class=\"min-w-0 flex-1 truncate\"> </span> <!></a>"), sn = V.from_html("<div class=\"h-px bg-border\"></div> <nav class=\"space-y-1\" aria-label=\"Product navigation\"></nav>", 1), cn = V.from_html("<div class=\"flex flex-1 flex-col gap-4 overflow-y-auto p-3\"><!> <!> <!> <!> <!> <!></div>"), ln = V.from_html("<span class=\"text-xs\"> </span>"), un = V.from_html("<a class=\"flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground aria-disabled:pointer-events-none aria-disabled:opacity-50\"><!></a>"), dn = V.from_html("<div class=\"flex flex-1 flex-col items-center gap-1 pt-14\"><!> <button class=\"flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground\"><!></button> <button class=\"flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground\"><!></button> <button class=\"flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground\"><!></button> <button class=\"flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground\"><!></button> <!></div>"), fn = V.from_html("<div class=\"flex flex-col items-center gap-2\"><!> <button type=\"button\" class=\"flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground\"><!></button> <a href=\"https://docsmint.com\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground\"><img src=\"/favicon.ico\" alt=\"DocsMint\" class=\"size-5 object-contain dark:hidden\"/> <img src=\"/favicon_white.ico\" alt=\"\" aria-hidden=\"true\" class=\"hidden size-5 object-contain dark:block\"/></a></div>"), pn = V.from_html("<div class=\"flex items-center justify-between\"><a href=\"https://docsmint.com\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"text-xs text-muted-foreground hover:text-foreground transition-colors\"> </a> <div class=\"flex items-center gap-1\"><!> <button type=\"button\" class=\"flex size-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground\"><!></button></div></div>"), mn = V.from_html("<aside tabindex=\"-1\"><!> <!> <!> <div class=\"border-t border-border p-2\"><!></div></aside> <!>", 1);
|
|
1821
|
+
function hn(e, t) {
|
|
1821
1822
|
V.push(t, !0);
|
|
1822
|
-
let n = V.prop(t, "mobile", 3, !1), r = V.prop(t, "mobileOpen", 3, !1), o = V.prop(t, "element", 15, null), s = "hiai_sidebar_collapsed", c =
|
|
1823
|
-
|
|
1823
|
+
let n = V.prop(t, "mobile", 3, !1), r = V.prop(t, "mobileOpen", 3, !1), o = V.prop(t, "element", 15, null), s = "hiai_sidebar_collapsed", c = Ee(), l = V.state(!1), p = V.state(!1), m = V.state("all"), h = V.derived(() => !n() && V.get(l)), ee = V.state(256), g = V.state(!1), te = I(), ne = V.derived(() => L(te.sidebarTop, { pathname: H.url.pathname })), _ = V.derived(() => L(te.sidebarFooterActions, { pathname: H.url.pathname })), v = V.derived(() => L(te.navigation, { pathname: H.url.pathname }));
|
|
1824
|
+
Ct(() => {
|
|
1825
|
+
let e = () => {
|
|
1826
|
+
it(), ht();
|
|
1827
|
+
};
|
|
1828
|
+
return window.addEventListener("hiai-docs:documents-updated", e), () => window.removeEventListener("hiai-docs:documents-updated", e);
|
|
1829
|
+
}), V.user_effect(() => {
|
|
1824
1830
|
if (typeof window < "u") {
|
|
1825
1831
|
try {
|
|
1826
1832
|
V.set(l, localStorage.getItem(s) === "1");
|
|
@@ -1828,61 +1834,61 @@ function mn(e, t) {
|
|
|
1828
1834
|
let e = localStorage.getItem("hiai_sidebar_width");
|
|
1829
1835
|
if (e) {
|
|
1830
1836
|
let t = parseInt(e, 10);
|
|
1831
|
-
!Number.isNaN(t) && t >= 180 && t <= 500 && V.set(
|
|
1837
|
+
!Number.isNaN(t) && t >= 180 && t <= 500 && V.set(ee, t, !0);
|
|
1832
1838
|
}
|
|
1833
1839
|
}
|
|
1834
1840
|
}), V.user_effect(() => {
|
|
1835
|
-
if (V.get(
|
|
1836
|
-
window.removeEventListener("mousemove",
|
|
1841
|
+
if (V.get(g)) return window.addEventListener("mousemove", S), window.addEventListener("mouseup", C), () => {
|
|
1842
|
+
window.removeEventListener("mousemove", S), window.removeEventListener("mouseup", C);
|
|
1837
1843
|
};
|
|
1838
1844
|
});
|
|
1839
|
-
function
|
|
1840
|
-
e.preventDefault(), V.set(
|
|
1845
|
+
function re(e) {
|
|
1846
|
+
e.preventDefault(), V.set(g, !0);
|
|
1841
1847
|
}
|
|
1842
|
-
function
|
|
1848
|
+
function S(e) {
|
|
1843
1849
|
let t = Math.max(180, Math.min(500, e.clientX));
|
|
1844
|
-
V.set(
|
|
1850
|
+
V.set(ee, t, !0);
|
|
1845
1851
|
}
|
|
1846
|
-
function
|
|
1847
|
-
V.set(
|
|
1852
|
+
function C() {
|
|
1853
|
+
V.set(g, !1), localStorage.setItem("hiai_sidebar_width", V.get(ee).toString());
|
|
1848
1854
|
}
|
|
1849
|
-
function
|
|
1850
|
-
return
|
|
1855
|
+
function w() {
|
|
1856
|
+
return Te(c, "/search");
|
|
1851
1857
|
}
|
|
1852
1858
|
function E(e) {
|
|
1853
|
-
V.set(m, V.get(m) === e ? "all" : e, !0), V.set(l, !1),
|
|
1859
|
+
V.set(m, V.get(m) === e ? "all" : e, !0), V.set(l, !1), D();
|
|
1854
1860
|
}
|
|
1855
|
-
function
|
|
1856
|
-
V.set(l, !V.get(l)),
|
|
1861
|
+
function ie() {
|
|
1862
|
+
V.set(l, !V.get(l)), D(), V.get(l) && V.set(m, "all");
|
|
1857
1863
|
}
|
|
1858
|
-
function
|
|
1864
|
+
function D() {
|
|
1859
1865
|
if (!(typeof localStorage > "u")) try {
|
|
1860
1866
|
localStorage.setItem(s, V.get(l) ? "1" : "0");
|
|
1861
1867
|
} catch {}
|
|
1862
1868
|
}
|
|
1863
|
-
var
|
|
1869
|
+
var ae = mn(), O = V.first_child(ae), se = V.child(O), k = (e) => {
|
|
1864
1870
|
var t = J();
|
|
1865
|
-
V.template_effect((e) => V.set_class(t, 1, e), [() => V.clsx(
|
|
1871
|
+
V.template_effect((e) => V.set_class(t, 1, e), [() => V.clsx(F("absolute right-0 top-0 z-40 h-full w-1 cursor-col-resize hover:bg-primary/50 transition-colors", V.get(g) && "bg-primary w-1"))]), V.delegated("mousedown", t, re), V.append(e, t);
|
|
1866
1872
|
};
|
|
1867
|
-
V.if(
|
|
1868
|
-
!n() && !V.get(h) && e(
|
|
1873
|
+
V.if(se, (e) => {
|
|
1874
|
+
!n() && !V.get(h) && e(k);
|
|
1869
1875
|
});
|
|
1870
|
-
var
|
|
1871
|
-
var t =
|
|
1876
|
+
var A = V.sibling(se, 2), ce = (e) => {
|
|
1877
|
+
var t = an(), n = V.child(t), r = (e) => {
|
|
1872
1878
|
U(e, { class: "size-3.5" });
|
|
1873
1879
|
}, i = (e) => {
|
|
1874
|
-
|
|
1880
|
+
Et(e, { class: "size-3.5" });
|
|
1875
1881
|
};
|
|
1876
1882
|
V.if(n, (e) => {
|
|
1877
1883
|
V.get(h) ? e(r) : e(i, -1);
|
|
1878
|
-
}), V.reset(t), V.delegated("click", t,
|
|
1884
|
+
}), V.reset(t), V.delegated("click", t, ie), V.append(e, t);
|
|
1879
1885
|
};
|
|
1880
|
-
V.if(
|
|
1881
|
-
n() || e(
|
|
1886
|
+
V.if(A, (e) => {
|
|
1887
|
+
n() || e(ce);
|
|
1882
1888
|
});
|
|
1883
|
-
var
|
|
1884
|
-
var t =
|
|
1885
|
-
V.each(n, 17, () => V.get(
|
|
1889
|
+
var M = V.sibling(A, 2), le = (e) => {
|
|
1890
|
+
var t = cn(), n = V.child(t);
|
|
1891
|
+
V.each(n, 17, () => V.get(ne), (e) => e.id, (e, t) => {
|
|
1886
1892
|
let n = V.derived(() => V.get(t).component);
|
|
1887
1893
|
var r = V.comment(), i = V.first_child(r);
|
|
1888
1894
|
V.component(i, () => V.get(n), (e, t) => {
|
|
@@ -1890,29 +1896,29 @@ function mn(e, t) {
|
|
|
1890
1896
|
}), V.append(e, r);
|
|
1891
1897
|
});
|
|
1892
1898
|
var r = V.sibling(n, 2);
|
|
1893
|
-
|
|
1899
|
+
kt(r, { class: "mr-5" });
|
|
1894
1900
|
var i = V.sibling(r, 2), a = (e) => {
|
|
1895
1901
|
var t = Y();
|
|
1896
|
-
|
|
1902
|
+
Kt(V.first_child(t), {}), V.next(2), V.append(e, t);
|
|
1897
1903
|
};
|
|
1898
1904
|
V.if(i, (e) => {
|
|
1899
1905
|
V.get(m) === "all" && e(a);
|
|
1900
1906
|
});
|
|
1901
1907
|
var o = V.sibling(i, 2), s = (e) => {
|
|
1902
1908
|
var t = Y();
|
|
1903
|
-
|
|
1909
|
+
Zt(V.first_child(t), {}), V.next(2), V.append(e, t);
|
|
1904
1910
|
};
|
|
1905
1911
|
V.if(o, (e) => {
|
|
1906
1912
|
(V.get(m) === "all" || V.get(m) === "recent") && e(s);
|
|
1907
1913
|
});
|
|
1908
1914
|
var l = V.sibling(o, 2), u = (e) => {
|
|
1909
|
-
|
|
1915
|
+
rn(e, {});
|
|
1910
1916
|
};
|
|
1911
1917
|
V.if(l, (e) => {
|
|
1912
1918
|
(V.get(m) === "all" || V.get(m) === "tags") && e(u);
|
|
1913
1919
|
});
|
|
1914
1920
|
var d = V.sibling(l, 2), f = (e) => {
|
|
1915
|
-
var t =
|
|
1921
|
+
var t = sn(), n = V.sibling(V.first_child(t), 2);
|
|
1916
1922
|
V.each(n, 21, () => V.get(v), (e) => e.id, (e, t) => {
|
|
1917
1923
|
let n = V.derived(() => V.get(t).icon);
|
|
1918
1924
|
var r = X(), i = V.child(r), a = (e) => {
|
|
@@ -1927,22 +1933,22 @@ function mn(e, t) {
|
|
|
1927
1933
|
var o = V.sibling(i, 2), s = V.child(o, !0);
|
|
1928
1934
|
V.reset(o);
|
|
1929
1935
|
var l = V.sibling(o, 2), u = (e) => {
|
|
1930
|
-
var n =
|
|
1936
|
+
var n = on(), r = V.child(n, !0);
|
|
1931
1937
|
V.reset(n), V.template_effect(() => V.set_text(r, V.get(t).badge)), V.append(e, n);
|
|
1932
1938
|
};
|
|
1933
1939
|
V.if(l, (e) => {
|
|
1934
1940
|
V.get(t).badge !== void 0 && e(u);
|
|
1935
1941
|
}), V.reset(r), V.template_effect((e) => {
|
|
1936
1942
|
V.set_attribute(r, "href", e), V.set_attribute(r, "aria-disabled", V.get(t).disabled), V.set_text(s, V.get(t).label);
|
|
1937
|
-
}, [() => V.get(t).href ?
|
|
1943
|
+
}, [() => V.get(t).href ? we(c, V.get(t).href) : "#"]), V.append(e, r);
|
|
1938
1944
|
}), V.reset(n), V.append(e, t);
|
|
1939
1945
|
};
|
|
1940
1946
|
V.if(d, (e) => {
|
|
1941
1947
|
V.get(m) === "all" && V.get(v).length > 0 && e(f);
|
|
1942
1948
|
}), V.reset(t), V.append(e, t);
|
|
1943
|
-
},
|
|
1944
|
-
var t =
|
|
1945
|
-
V.each(n, 17, () => V.get(
|
|
1949
|
+
}, ue = (e) => {
|
|
1950
|
+
var t = dn(), n = V.child(t);
|
|
1951
|
+
V.each(n, 17, () => V.get(ne), (e) => e.id, (e, t) => {
|
|
1946
1952
|
let n = V.derived(() => V.get(t).component);
|
|
1947
1953
|
var r = V.comment(), i = V.first_child(r);
|
|
1948
1954
|
V.component(i, () => V.get(n), (e, t) => {
|
|
@@ -1960,68 +1966,84 @@ function mn(e, t) {
|
|
|
1960
1966
|
var u = V.sibling(l, 2);
|
|
1961
1967
|
V.each(u, 17, () => V.get(v), (e) => e.id, (e, t) => {
|
|
1962
1968
|
let n = V.derived(() => V.get(t).icon);
|
|
1963
|
-
var r =
|
|
1969
|
+
var r = un(), i = V.child(r), a = (e) => {
|
|
1964
1970
|
var t = V.comment(), r = V.first_child(t);
|
|
1965
1971
|
V.component(r, () => V.get(n), (e, t) => {
|
|
1966
1972
|
t(e, { class: "size-4" });
|
|
1967
1973
|
}), V.append(e, t);
|
|
1968
1974
|
}, o = (e) => {
|
|
1969
|
-
var n =
|
|
1975
|
+
var n = ln(), r = V.child(n, !0);
|
|
1970
1976
|
V.reset(n), V.template_effect((e) => V.set_text(r, e), [() => V.get(t).label.slice(0, 1)]), V.append(e, n);
|
|
1971
1977
|
};
|
|
1972
1978
|
V.if(i, (e) => {
|
|
1973
1979
|
V.get(n) ? e(a) : e(o, -1);
|
|
1974
1980
|
}), V.reset(r), V.template_effect((e) => {
|
|
1975
1981
|
V.set_attribute(r, "href", e), V.set_attribute(r, "aria-disabled", V.get(t).disabled), V.set_attribute(r, "title", V.get(t).label), V.set_attribute(r, "aria-label", V.get(t).label);
|
|
1976
|
-
}, [() => V.get(t).href ?
|
|
1982
|
+
}, [() => V.get(t).href ? we(c, V.get(t).href) : "#"]), V.append(e, r);
|
|
1977
1983
|
}), V.reset(t), V.template_effect((e, t, n, i, a, c, u, d) => {
|
|
1978
1984
|
V.set_attribute(r, "title", e), V.set_attribute(r, "aria-label", t), V.set_attribute(o, "title", n), V.set_attribute(o, "aria-label", i), V.set_attribute(s, "title", a), V.set_attribute(s, "aria-label", c), V.set_attribute(l, "title", u), V.set_attribute(l, "aria-label", d);
|
|
1979
1985
|
}, [
|
|
1980
|
-
() =>
|
|
1981
|
-
() =>
|
|
1982
|
-
() =>
|
|
1983
|
-
() =>
|
|
1984
|
-
() =>
|
|
1985
|
-
() =>
|
|
1986
|
-
() =>
|
|
1987
|
-
() =>
|
|
1988
|
-
]), V.delegated("click", r, () =>
|
|
1986
|
+
() => oe(),
|
|
1987
|
+
() => oe(),
|
|
1988
|
+
() => j(),
|
|
1989
|
+
() => j(),
|
|
1990
|
+
() => x(),
|
|
1991
|
+
() => x(),
|
|
1992
|
+
() => y(),
|
|
1993
|
+
() => y()
|
|
1994
|
+
]), V.delegated("click", r, () => Te(c, "/")), V.delegated("click", o, w), V.delegated("click", s, () => E("recent")), V.delegated("click", l, () => E("tags")), V.append(e, t);
|
|
1989
1995
|
};
|
|
1990
|
-
V.if(
|
|
1991
|
-
V.get(h) ? e(
|
|
1996
|
+
V.if(M, (e) => {
|
|
1997
|
+
V.get(h) ? e(ue, -1) : e(le);
|
|
1992
1998
|
});
|
|
1993
|
-
var
|
|
1994
|
-
var t =
|
|
1995
|
-
|
|
1999
|
+
var de = V.sibling(M, 2), fe = V.child(de), pe = (e) => {
|
|
2000
|
+
var t = fn(), n = V.child(t);
|
|
2001
|
+
V.each(n, 17, () => V.get(_), (e) => e.id, (e, t) => {
|
|
2002
|
+
let n = V.derived(() => V.get(t).component);
|
|
2003
|
+
var r = V.comment(), i = V.first_child(r);
|
|
2004
|
+
V.component(i, () => V.get(n), (e, t) => {
|
|
2005
|
+
t(e, { collapsed: !0 });
|
|
2006
|
+
}), V.append(e, r);
|
|
2007
|
+
});
|
|
1996
2008
|
var r = V.sibling(n, 2);
|
|
1997
|
-
V.
|
|
1998
|
-
|
|
2009
|
+
W(V.child(r), { class: "size-4" }), V.reset(r);
|
|
2010
|
+
var i = V.sibling(r, 2);
|
|
2011
|
+
V.reset(t), V.template_effect((e, t, n, a) => {
|
|
2012
|
+
V.set_attribute(r, "title", e), V.set_attribute(r, "aria-label", t), V.set_attribute(i, "title", n), V.set_attribute(i, "aria-label", a);
|
|
1999
2013
|
}, [
|
|
2000
|
-
() =>
|
|
2001
|
-
() =>
|
|
2002
|
-
() =>
|
|
2003
|
-
() =>
|
|
2004
|
-
]), V.delegated("click",
|
|
2014
|
+
() => b(),
|
|
2015
|
+
() => b(),
|
|
2016
|
+
() => T(),
|
|
2017
|
+
() => T()
|
|
2018
|
+
]), V.delegated("click", r, () => {
|
|
2005
2019
|
V.set(p, !0);
|
|
2006
2020
|
}), V.append(e, t);
|
|
2007
|
-
},
|
|
2008
|
-
var t =
|
|
2021
|
+
}, N = (e) => {
|
|
2022
|
+
var t = pn(), n = V.child(t), r = V.child(n, !0);
|
|
2009
2023
|
V.reset(n);
|
|
2010
|
-
var i = V.sibling(n, 2);
|
|
2011
|
-
|
|
2012
|
-
|
|
2024
|
+
var i = V.sibling(n, 2), a = V.child(i);
|
|
2025
|
+
V.each(a, 17, () => V.get(_), (e) => e.id, (e, t) => {
|
|
2026
|
+
let n = V.derived(() => V.get(t).component);
|
|
2027
|
+
var r = V.comment(), i = V.first_child(r);
|
|
2028
|
+
V.component(i, () => V.get(n), (e, t) => {
|
|
2029
|
+
t(e, { collapsed: !1 });
|
|
2030
|
+
}), V.append(e, r);
|
|
2031
|
+
});
|
|
2032
|
+
var o = V.sibling(a, 2);
|
|
2033
|
+
W(V.child(o), { class: "size-4" }), V.reset(o), V.reset(i), V.reset(t), V.template_effect((e, t, i, a) => {
|
|
2034
|
+
V.set_attribute(n, "title", e), V.set_text(r, t), V.set_attribute(o, "title", i), V.set_attribute(o, "aria-label", a);
|
|
2013
2035
|
}, [
|
|
2014
|
-
() =>
|
|
2015
|
-
() =>
|
|
2016
|
-
() =>
|
|
2017
|
-
() =>
|
|
2018
|
-
]), V.delegated("click",
|
|
2036
|
+
() => T(),
|
|
2037
|
+
() => T(),
|
|
2038
|
+
() => b(),
|
|
2039
|
+
() => b()
|
|
2040
|
+
]), V.delegated("click", o, () => {
|
|
2019
2041
|
V.set(p, !0);
|
|
2020
2042
|
}), V.append(e, t);
|
|
2021
2043
|
};
|
|
2022
|
-
V.if(
|
|
2023
|
-
V.get(h) ? e(
|
|
2024
|
-
}), V.reset(
|
|
2044
|
+
V.if(fe, (e) => {
|
|
2045
|
+
V.get(h) ? e(pe) : e(N, -1);
|
|
2046
|
+
}), V.reset(de), V.reset(O), V.bind_this(O, (e) => o(e), () => o()), u(V.sibling(O, 2), {
|
|
2025
2047
|
get open() {
|
|
2026
2048
|
return V.get(p);
|
|
2027
2049
|
},
|
|
@@ -2029,9 +2051,9 @@ function mn(e, t) {
|
|
|
2029
2051
|
V.set(p, e, !0);
|
|
2030
2052
|
}
|
|
2031
2053
|
}), V.template_effect((e) => {
|
|
2032
|
-
V.set_attribute(
|
|
2033
|
-
}, [() => V.clsx(
|
|
2054
|
+
V.set_attribute(O, "id", n() ? "mobile-navigation" : void 0), V.set_attribute(O, "role", n() && r() ? "dialog" : void 0), V.set_attribute(O, "aria-modal", n() && r() ? "true" : void 0), V.set_attribute(O, "aria-label", n() ? "Navigation" : void 0), V.set_attribute(O, "aria-hidden", n() && !r() ? "true" : void 0), O.inert = n() && !r(), V.set_class(O, 1, e), V.set_style(O, n() ? "padding-top: env(safe-area-inset-top);" : V.get(h) ? "width: 48px;" : `width: ${V.get(ee)}px;`);
|
|
2055
|
+
}, [() => V.clsx(F("flex flex-col border-r border-border bg-card", n() && "fixed inset-y-0 left-0 z-50 h-full w-[80%] max-w-[320px] shadow-xl transition-transform duration-300 ease-out", n() && (r() ? "translate-x-0" : "-translate-x-full"), !n() && "relative h-screen", !n() && !V.get(g) && "transition-[width] duration-200"))]), V.append(e, ae), V.pop();
|
|
2034
2056
|
}
|
|
2035
2057
|
V.delegate(["mousedown", "click"]);
|
|
2036
2058
|
//#endregion
|
|
2037
|
-
export {
|
|
2059
|
+
export { hn as t };
|