@hiai-gg/docsmint 0.5.10 → 0.6.0

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.
Files changed (41) hide show
  1. package/LICENSE +39 -8
  2. package/README.md +67 -43
  3. package/dist/backend/index.js +45 -12
  4. package/dist/client.d.ts +3 -1
  5. package/dist/client.js +2 -0
  6. package/dist/frontend/HiAiEditor-DSVG3GNd.js +2986 -0
  7. package/dist/frontend/SettingsDialog-BDNgf5rv.js +969 -0
  8. package/dist/frontend/ShareDialog-2Mty7hm4.js +258 -0
  9. package/dist/frontend/{Sidebar-CzcLd6v5.js → Sidebar-DX08utdV.js} +2 -2
  10. package/dist/frontend/app-shell.js +27 -26
  11. package/dist/frontend/components/editor/compact-editor.d.ts +3 -0
  12. package/dist/frontend/components/editor/compact-editor.js +36 -0
  13. package/dist/frontend/components/editor/document-editor.js +2 -2986
  14. package/dist/frontend/components/settings.js +1 -1
  15. package/dist/frontend/components/share-dialog.d.ts +2 -1
  16. package/dist/frontend/components/share-dialog.js +1 -1
  17. package/dist/frontend/components/sidebar.js +1 -1
  18. package/dist/frontend/dashboard.js +1 -1
  19. package/dist/frontend/editor-preferences.d.ts +4 -0
  20. package/dist/frontend/editor-preferences.js +2 -0
  21. package/dist/frontend/editor-preferences.svelte-Bt_A9k7n.js +61 -0
  22. package/dist/frontend/frontend.css +1 -1
  23. package/dist/frontend-ssr/app-shell.js +3 -2
  24. package/dist/frontend-ssr/assets/HiAiEditor-CUOJmKzT.js +2358 -0
  25. package/dist/frontend-ssr/assets/{SettingsDialog-DVp0OxPO.js → SettingsDialog-BjJIiVLc.js} +2 -64
  26. package/dist/frontend-ssr/assets/{ShareDialog-BZd28sg-.js → ShareDialog-C9C-XTm4.js} +1 -1
  27. package/dist/frontend-ssr/assets/{Sidebar-CqsMw0Hd.js → Sidebar-C2sUfGNk.js} +2 -2
  28. package/dist/frontend-ssr/assets/editor-preferences.svelte-iI5jJM1x.js +65 -0
  29. package/dist/frontend-ssr/components/editor/compact-editor.js +19 -0
  30. package/dist/frontend-ssr/components/editor/document-editor.js +1 -2357
  31. package/dist/frontend-ssr/components/settings.js +1 -1
  32. package/dist/frontend-ssr/components/share-dialog.js +1 -1
  33. package/dist/frontend-ssr/components/sidebar.js +1 -1
  34. package/dist/frontend-ssr/dashboard.js +1 -1
  35. package/dist/frontend-ssr/editor-preferences.js +2 -0
  36. package/dist/types.d.ts +5 -0
  37. package/package.json +16 -2
  38. package/packages/cli/src/index.ts +1 -1
  39. package/packages/mcp-server/src/index.ts +1 -1
  40. package/dist/frontend/SettingsDialog-CyZSOjLE.js +0 -1024
  41. package/dist/frontend/ShareDialog-BC-Jl6v1.js +0 -257
@@ -0,0 +1,258 @@
1
+ import { $n as e, Ar as t, Br as n, Dr as r, Fr as i, Hr as a, Ir as o, Lr as s, Mr as c, Nr as l, Or as u, Pr as d, Rr as f, Ur as p, Vr as ee, Zn as m, jr as h, kr as g, or as _, zr as v } from "./messages-DIovIZrK.js";
2
+ import { a as y } from "./route-context-DYQlUfzL.js";
3
+ import { a as b, i as x, n as te, r as S, t as ne } from "./select-value-JCAp2PmU.js";
4
+ import { n as C } from "./share-D7JtkC85.js";
5
+ import { h as w, u as T } from "./keyboard.svelte-CApmX0vl.js";
6
+ import { t as E } from "./clipboard-Cgzxc0_R.js";
7
+ import "svelte/internal/disclose-version";
8
+ import * as D from "svelte/internal/client";
9
+ //#region src/lib/components/ShareDialog.svelte
10
+ var re = D.from_html("<label class=\"flex items-start gap-2 text-xs text-muted-foreground\"><input type=\"checkbox\" class=\"mt-0.5\"/> Allow anyone with the password to view. Commenting and editing still require an invited account.</label>"), ie = D.from_html("<input type=\"password\" class=\"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring\"/> <!>", 1), ae = D.from_html("<button> </button>"), oe = D.from_html("<!> <!> <!>", 1), se = D.from_html("<!> <!>", 1), ce = D.from_html("<span class=\"inline-flex items-center gap-1 rounded-md bg-secondary px-2 py-0.5 text-xs\"> <button class=\"text-muted-foreground hover:text-foreground\">&times;</button></span>"), le = D.from_html("<div class=\"flex flex-wrap gap-1.5\"></div>"), ue = D.from_html("<div class=\"space-y-2\"><span class=\"text-sm font-medium\"> </span> <div class=\"flex gap-2\"><input type=\"email\" placeholder=\"guest@email.com\" class=\"flex h-9 flex-1 rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring\"/> <!> <button class=\"rounded-md border border-border px-3 py-1.5 text-sm font-medium hover:bg-accent\"> </button></div> <!></div>"), de = D.from_html("<p class=\"text-xs text-destructive\"> </p>"), fe = D.from_html("<div class=\"space-y-4\"><div class=\"grid grid-cols-2 gap-2 rounded-lg bg-muted p-1\" aria-label=\"Share access mode\"><button type=\"button\">Public link</button> <button type=\"button\">Specific people</button></div> <p class=\"rounded-md border border-border bg-muted/40 p-3 text-xs text-muted-foreground\"> </p> <div class=\"flex items-center justify-between\"><span class=\"text-sm font-medium\"> </span> <button role=\"switch\"><span></span></button></div> <!> <div class=\"space-y-2\"><span class=\"text-sm font-medium\"> </span> <div class=\"flex gap-2\"></div></div> <!> <!> <button class=\"w-full rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50\"> </button></div>"), O = D.from_html("<div class=\"space-y-4\"><p class=\"text-sm text-muted-foreground\"> </p> <div data-share-created-url=\"\" class=\"flex min-w-0 flex-col gap-2 sm:flex-row sm:items-center\"><code class=\"min-w-0 flex-1 break-all rounded-md bg-muted px-3 py-2 text-sm\"> </code> <button data-share-copy-action=\"\" class=\"w-full shrink-0 rounded-md bg-primary px-3 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90 sm:w-auto\"> </button></div> <button class=\"w-full rounded-md border border-border px-4 py-2 text-sm font-medium hover:bg-accent\"> </button></div>"), k = D.from_html("<div class=\"fixed inset-0 layer-modal z-[100] flex items-center justify-center\"><button class=\"absolute inset-0 z-[100] bg-black/50\"></button> <div class=\"relative z-[101] w-full max-w-md rounded-lg border border-border bg-background p-6 shadow-lg\" role=\"dialog\" aria-modal=\"true\"><div class=\"mb-4 flex items-center justify-between\"><h2 class=\"text-lg font-semibold\"> </h2> <button class=\"rounded-md p-1 text-muted-foreground hover:bg-accent hover:text-foreground\">&#10005;</button></div> <!></div></div>");
11
+ function A(A, j) {
12
+ D.push(j, !0);
13
+ let M = D.prop(j, "open", 15, !1), N = D.prop(j, "documentId", 3, ""), P = D.prop(j, "documentTitle", 3, ""), F = D.prop(j, "folderId", 3, ""), I = D.prop(j, "folderName", 3, ""), L = D.prop(j, "categoryId", 3, ""), R = D.prop(j, "categoryName", 3, ""), z = D.state(!1), B = D.state("public"), V = D.state(!1), H = D.state(""), U = D.state("7d"), W = D.state(""), G = D.state("viewer"), K = D.state(D.proxy([])), q = D.state(""), J = D.state(!1), Y = D.state(!1), X = D.state(""), pe = y();
14
+ D.user_effect(() => (T({
15
+ id: "share-dialog-escape",
16
+ keys: "escape",
17
+ description: "Close share dialog",
18
+ scope: "dialog",
19
+ enabled: M(),
20
+ overrideInput: !0,
21
+ handler: () => {
22
+ M() && Q();
23
+ }
24
+ }), () => {
25
+ w("share-dialog-escape");
26
+ }));
27
+ function Z() {
28
+ let e = D.get(W).trim();
29
+ e?.includes("@") && !D.get(K).some((t) => t.email === e.toLowerCase()) && (D.set(K, [...D.get(K), {
30
+ email: e.toLowerCase(),
31
+ role: D.get(G)
32
+ }], !0), D.set(W, ""));
33
+ }
34
+ function me(e) {
35
+ D.set(K, D.get(K).filter((t) => t.email !== e), !0);
36
+ }
37
+ async function he() {
38
+ D.set(Y, !0), D.set(X, "");
39
+ try {
40
+ let e = await C({
41
+ documentId: N() || void 0,
42
+ folderId: F() || void 0,
43
+ categoryId: L() || void 0,
44
+ password: D.get(z) ? D.get(H) : void 0,
45
+ expiresIn: D.get(U),
46
+ accessMode: D.get(B),
47
+ allowPasswordFallback: D.get(B) === "restricted" && D.get(z) ? D.get(V) : void 0,
48
+ guests: D.get(B) === "restricted" ? D.get(K) : void 0
49
+ }, pe.fetch);
50
+ D.set(q, `${window.location.origin}/s/${e.token}`), j.onCreated?.({
51
+ token: e.token,
52
+ url: D.get(q),
53
+ accessMode: D.get(B)
54
+ });
55
+ } catch (e) {
56
+ D.set(X, e instanceof Error ? e.message : _(), !0), console.error("ShareDialog: createShareLink failed", e);
57
+ } finally {
58
+ D.set(Y, !1);
59
+ }
60
+ }
61
+ async function ge() {
62
+ D.get(q) && (await E(D.get(q)), D.set(J, !0), setTimeout(() => {
63
+ D.set(J, !1);
64
+ }, 2e3));
65
+ }
66
+ function Q() {
67
+ M(!1), D.set(q, ""), D.set(z, !1), D.set(B, "public"), D.set(V, !1), D.set(H, ""), D.set(U, "7d"), D.set(K, [], !0), D.set(X, "");
68
+ }
69
+ var $ = D.comment(), _e = D.first_child($), ve = (_) => {
70
+ var y = k(), C = D.child(y), w = D.sibling(C, 2), T = D.child(w), E = D.child(T), A = D.child(E);
71
+ D.reset(E);
72
+ var j = D.sibling(E, 2);
73
+ D.reset(T);
74
+ var M = D.sibling(T, 2), N = (e) => {
75
+ var r = fe(), u = D.child(r), p = D.child(u), m = D.sibling(p, 2);
76
+ D.reset(u);
77
+ var g = D.sibling(u, 2), _ = D.child(g, !0);
78
+ D.reset(g);
79
+ var y = D.sibling(g, 2), C = D.child(y), w = D.child(C, !0);
80
+ D.reset(C);
81
+ var T = D.sibling(C, 2), E = D.child(T);
82
+ D.reset(T), D.reset(y);
83
+ var O = D.sibling(y, 2), k = (e) => {
84
+ var t = ie(), n = D.first_child(t);
85
+ D.remove_input_defaults(n);
86
+ var r = D.sibling(n, 2), i = (e) => {
87
+ var t = re(), n = D.child(t);
88
+ D.remove_input_defaults(n), D.next(), D.reset(t), D.bind_checked(n, () => D.get(V), (e) => D.set(V, e)), D.append(e, t);
89
+ };
90
+ D.if(r, (e) => {
91
+ D.get(B) === "restricted" && e(i);
92
+ }), D.template_effect((e) => D.set_attribute(n, "placeholder", e), [() => f()]), D.bind_value(n, () => D.get(H), (e) => D.set(H, e)), D.append(e, t);
93
+ };
94
+ D.if(O, (e) => {
95
+ D.get(z) && e(k);
96
+ });
97
+ var A = D.sibling(O, 2), j = D.child(A), M = D.child(j, !0);
98
+ D.reset(j);
99
+ var N = D.sibling(j, 2);
100
+ D.each(N, 21, () => [
101
+ ["1h", i()],
102
+ ["1d", d()],
103
+ ["7d", l()],
104
+ ["30d", c()],
105
+ ["never", o()]
106
+ ], D.index, (e, t) => {
107
+ var n = D.derived(() => D.to_array(D.get(t), 2));
108
+ let r = () => D.get(n)[0], i = () => D.get(n)[1];
109
+ var a = ae(), o = D.child(a, !0);
110
+ D.reset(a), D.template_effect(() => {
111
+ D.set_class(a, 1, `rounded-md border px-2.5 py-1 text-xs font-medium transition-colors
112
+ ${D.get(U) === r() ? "border-primary bg-primary text-primary-foreground" : "border-border text-muted-foreground hover:bg-accent"}`), D.set_text(o, i());
113
+ }), D.delegated("click", a, () => {
114
+ D.set(U, r(), !0);
115
+ }), D.append(e, a);
116
+ }), D.reset(N), D.reset(A);
117
+ var P = D.sibling(A, 2), F = (e) => {
118
+ var n = ue(), r = D.child(n), i = D.child(r, !0);
119
+ D.reset(r);
120
+ var a = D.sibling(r, 2), o = D.child(a);
121
+ D.remove_input_defaults(o);
122
+ var s = D.sibling(o, 2);
123
+ b(s, {
124
+ type: "single",
125
+ get value() {
126
+ return D.get(G);
127
+ },
128
+ onValueChange: (e) => {
129
+ (e === "viewer" || e === "commenter" || e === "editor") && D.set(G, e, !0);
130
+ },
131
+ children: (e, t) => {
132
+ var n = se(), r = D.first_child(n);
133
+ te(r, {
134
+ class: "h-9 w-32 justify-between px-3 text-sm",
135
+ "aria-label": "Guest role",
136
+ children: (e, t) => {
137
+ ne(e, {
138
+ placeholder: "Role",
139
+ children: (e, t) => {
140
+ D.next();
141
+ var n = D.text();
142
+ D.template_effect(() => D.set_text(n, D.get(G) === "viewer" ? "Viewer" : D.get(G) === "commenter" ? "Commenter" : "Editor")), D.append(e, n);
143
+ },
144
+ $$slots: { default: !0 }
145
+ });
146
+ },
147
+ $$slots: { default: !0 }
148
+ }), x(D.sibling(r, 2), {
149
+ children: (e, t) => {
150
+ var n = oe(), r = D.first_child(n);
151
+ S(r, {
152
+ value: "viewer",
153
+ children: (e, t) => {
154
+ D.next();
155
+ var n = D.text("Viewer");
156
+ D.append(e, n);
157
+ },
158
+ $$slots: { default: !0 }
159
+ });
160
+ var i = D.sibling(r, 2);
161
+ S(i, {
162
+ value: "commenter",
163
+ children: (e, t) => {
164
+ D.next();
165
+ var n = D.text("Commenter");
166
+ D.append(e, n);
167
+ },
168
+ $$slots: { default: !0 }
169
+ }), S(D.sibling(i, 2), {
170
+ value: "editor",
171
+ children: (e, t) => {
172
+ D.next();
173
+ var n = D.text("Editor");
174
+ D.append(e, n);
175
+ },
176
+ $$slots: { default: !0 }
177
+ }), D.append(e, n);
178
+ },
179
+ $$slots: { default: !0 }
180
+ }), D.append(e, n);
181
+ },
182
+ $$slots: { default: !0 }
183
+ });
184
+ var c = D.sibling(s, 2), l = D.child(c, !0);
185
+ D.reset(c), D.reset(a);
186
+ var u = D.sibling(a, 2), d = (e) => {
187
+ var t = le();
188
+ D.each(t, 21, () => D.get(K), D.index, (e, t) => {
189
+ var n = ce(), r = D.child(n), i = D.sibling(r);
190
+ D.reset(n), D.template_effect(() => D.set_text(r, `${D.get(t).email ?? ""} · ${D.get(t).role ?? ""} `)), D.delegated("click", i, () => me(D.get(t).email)), D.append(e, n);
191
+ }), D.reset(t), D.append(e, t);
192
+ };
193
+ D.if(u, (e) => {
194
+ D.get(K).length > 0 && e(d);
195
+ }), D.reset(n), D.template_effect((e, t) => {
196
+ D.set_text(i, e), D.set_text(l, t);
197
+ }, [() => h(), () => t()]), D.delegated("keydown", o, (e) => {
198
+ e.key === "Enter" && (e.preventDefault(), Z());
199
+ }), D.bind_value(o, () => D.get(W), (e) => D.set(W, e)), D.delegated("click", c, Z), D.append(e, n);
200
+ };
201
+ D.if(P, (e) => {
202
+ D.get(B) === "restricted" && e(F);
203
+ });
204
+ var I = D.sibling(P, 2), L = (e) => {
205
+ var t = de(), n = D.child(t, !0);
206
+ D.reset(t), D.template_effect(() => D.set_text(n, D.get(X))), D.append(e, t);
207
+ };
208
+ D.if(I, (e) => {
209
+ D.get(X) && e(L);
210
+ });
211
+ var R = D.sibling(I, 2), q = D.child(R, !0);
212
+ D.reset(R), D.reset(r), D.template_effect((e, t, n, r) => {
213
+ D.set_class(p, 1, `rounded-md px-3 py-2 text-sm font-medium ${D.get(B) === "public" ? "bg-background shadow-sm" : "text-muted-foreground"}`), D.set_class(m, 1, `rounded-md px-3 py-2 text-sm font-medium ${D.get(B) === "restricted" ? "bg-background shadow-sm" : "text-muted-foreground"}`), D.set_text(_, D.get(B) === "public" ? "Anyone with this link can view the document. The link may be forwarded." : "Only invited email addresses can comment or edit. A password fallback, when enabled, grants view-only access."), D.set_text(w, e), D.set_class(T, 1, `relative inline-flex h-5 w-9 items-center rounded-full transition-colors ${D.get(z) ? "bg-primary" : "bg-input"}`), D.set_attribute(T, "aria-checked", D.get(z)), D.set_attribute(T, "aria-label", t), D.set_class(E, 1, `inline-block h-4 w-4 rounded-full bg-white shadow transition-transform ${D.get(z) ? "translate-x-4" : "translate-x-0.5"}`), D.set_text(M, n), R.disabled = D.get(Y) || D.get(B) === "restricted" && D.get(K).length === 0 || D.get(z) && D.get(H).length < 8, D.set_text(q, r);
214
+ }, [
215
+ () => n(),
216
+ () => v(),
217
+ () => s(),
218
+ () => D.get(Y) ? ee() : a()
219
+ ]), D.delegated("click", p, () => {
220
+ D.set(B, "public"), D.set(K, [], !0), D.set(V, !1);
221
+ }), D.delegated("click", m, () => {
222
+ D.set(B, "restricted");
223
+ }), D.delegated("click", T, () => {
224
+ D.set(z, !D.get(z));
225
+ }), D.delegated("click", R, he), D.append(e, r);
226
+ }, F = (e) => {
227
+ var t = O(), n = D.child(t), i = D.child(n, !0);
228
+ D.reset(n);
229
+ var a = D.sibling(n, 2), o = D.child(a), s = D.child(o, !0);
230
+ D.reset(o);
231
+ var c = D.sibling(o, 2), l = D.child(c, !0);
232
+ D.reset(c), D.reset(a);
233
+ var d = D.sibling(a, 2), f = D.child(d, !0);
234
+ D.reset(d), D.reset(t), D.template_effect((e, t, n) => {
235
+ D.set_text(i, e), D.set_text(s, D.get(q)), D.set_text(l, t), D.set_text(f, n);
236
+ }, [
237
+ () => D.get(B) === "restricted" ? "Invitations were queued for delivery. This is not a public link." : r(),
238
+ () => D.get(J) ? u() : g(),
239
+ () => m()
240
+ ]), D.delegated("click", c, ge), D.delegated("click", d, Q), D.append(e, t);
241
+ };
242
+ D.if(M, (e) => {
243
+ D.get(q) ? e(F, -1) : e(N);
244
+ }), D.reset(w), D.reset(y), D.template_effect((e, t, n) => {
245
+ D.set_attribute(C, "aria-label", e), D.set_text(A, `${t ?? ""} "${(R() || I() || P()) ?? ""}"`), D.set_attribute(j, "aria-label", n);
246
+ }, [
247
+ () => e(),
248
+ () => p(),
249
+ () => e()
250
+ ]), D.delegated("click", C, Q), D.delegated("click", j, Q), D.append(_, y);
251
+ };
252
+ D.if(_e, (e) => {
253
+ M() && e(ve);
254
+ }), D.append(A, $), D.pop();
255
+ }
256
+ D.delegate(["click", "keydown"]);
257
+ //#endregion
258
+ export { A as t };
@@ -5,7 +5,7 @@ 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-CyZSOjLE.js";
8
+ import { t as u } from "./SettingsDialog-BDNgf5rv.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
11
  import { a as m, i as h, o as ee, r as g, t as te } from "./dropdown-menu-CJ_7V3N0.js";
@@ -25,7 +25,7 @@ import { c as Ve, i as He, r as Ue, s as We, t as Ge } from "./documents-CwCs1rA
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-BC-Jl6v1.js";
28
+ import { t as Qe } from "./ShareDialog-2Mty7hm4.js";
29
29
  import { t as $e } from "./CategoryDialog-CbXBMBZB.js";
30
30
  import { n as et, t as tt } from "./document-drop-coordinator-C4xHMjwC.js";
31
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-DxP21a1c.js";
@@ -1,8 +1,9 @@
1
1
  import { t as e } from "./Icon-Db-o32_E.js";
2
- import { n as t, r as n } from "./SettingsDialog-CyZSOjLE.js";
3
- import { t as r } from "./Sidebar-CzcLd6v5.js";
4
- import { D as i } from "./messages-DIovIZrK.js";
5
- import { o as a, r as o } from "./route-context-DYQlUfzL.js";
2
+ import { n as t } from "./SettingsDialog-BDNgf5rv.js";
3
+ import { t as n } from "./Sidebar-DX08utdV.js";
4
+ import { D as r } from "./messages-DIovIZrK.js";
5
+ import { o as i, r as a } from "./route-context-DYQlUfzL.js";
6
+ import { t as o } from "./editor-preferences.svelte-Bt_A9k7n.js";
6
7
  import { d as s } from "./subfolders-refresh-store.svelte-DxP21a1c.js";
7
8
  import { a as c, o as l } from "./tag-store.svelte-ogVCMCbv.js";
8
9
  import { t as u } from "./HiaiDocsExtensionProvider-OSn96BBw.js";
@@ -113,9 +114,9 @@ d.delegate(["click"]);
113
114
  var w = d.from_html("<button type=\"button\"><!></button>");
114
115
  function T(e, t) {
115
116
  d.push(t, !0);
116
- let n = d.prop(t, "avoidEditorToolbar", 3, !1), r = d.state(!1), a = null, o = d.state("none"), s = d.state(void 0);
117
+ let n = d.prop(t, "avoidEditorToolbar", 3, !1), i = d.state(!1), a = null, o = d.state("none"), s = d.state(void 0);
117
118
  function c() {
118
- d.set(r, (a ? a.scrollTop : window.scrollY) > 300);
119
+ d.set(i, (a ? a.scrollTop : window.scrollY) > 300);
119
120
  }
120
121
  function l() {
121
122
  a ? a.scrollTo({
@@ -140,7 +141,7 @@ function T(e, t) {
140
141
  window.removeEventListener("scroll", c);
141
142
  });
142
143
  }), p(() => {
143
- f(), d.set(r, !1);
144
+ f(), d.set(i, !1);
144
145
  }), d.user_effect(() => {
145
146
  if (!n() || typeof document > "u") {
146
147
  d.set(o, "none"), d.set(s, void 0);
@@ -175,11 +176,11 @@ function T(e, t) {
175
176
  var m = w();
176
177
  let h, _;
177
178
  g(d.child(m), { class: "size-5" }), d.reset(m), d.template_effect((e, t) => {
178
- h = d.set_class(m, 1, `scroll-to-top fixed bottom-6 right-6 z-50 inline-flex size-10 items-center justify-center rounded-full border border-border bg-card text-muted-foreground shadow-md transition-all hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${d.get(r) ? "opacity-100 pointer-events-auto" : "opacity-0 pointer-events-none"}`, null, h, {
179
+ h = d.set_class(m, 1, `scroll-to-top fixed bottom-6 right-6 z-50 inline-flex size-10 items-center justify-center rounded-full border border-border bg-card text-muted-foreground shadow-md transition-all hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${d.get(i) ? "opacity-100 pointer-events-auto" : "opacity-0 pointer-events-none"}`, null, h, {
179
180
  "above-editor-toolbar": d.get(o) === "toolbar",
180
181
  "below-editor-fab": d.get(o) === "fab"
181
182
  }), d.set_attribute(m, "aria-label", e), d.set_attribute(m, "title", t), _ = d.set_style(m, "", _, { bottom: d.get(s) });
182
- }, [() => i(), () => i()]), d.delegated("click", m, l), d.append(e, m), d.pop();
183
+ }, [() => r(), () => r()]), d.delegated("click", m, l), d.append(e, m), d.pop();
183
184
  }
184
185
  d.delegate(["click"]);
185
186
  //#endregion
@@ -245,21 +246,21 @@ function M() {
245
246
  //#endregion
246
247
  //#region src/lib/hosts/DocsmintAppShellHost.svelte
247
248
  var N = d.from_html("<div data-mobile-sidebar-edge=\"\" aria-hidden=\"true\" class=\"fixed inset-y-0 left-0 z-20 w-9 md:hidden\" style=\"touch-action: pan-y;\"></div>"), P = d.from_html("<button type=\"button\" tabindex=\"-1\" aria-label=\"Close navigation menu\" class=\"fixed inset-0 z-40 bg-black/50\"></button>"), F = d.from_html("<div class=\"flex h-screen\" data-docsmint-app-shell-host=\"\"><!> <main id=\"main-content\" class=\"relative flex-1 overflow-auto\"><!></main></div> <!> <!> <!>", 1), I = d.from_html("<!> <!>", 1);
248
- function L(e, i) {
249
- d.push(i, !0);
250
- let f = d.prop(i, "request", 19, () => ({ fetch })), p = d.prop(i, "extensions", 19, () => ({}));
251
- o({
249
+ function L(e, r) {
250
+ d.push(r, !0);
251
+ let f = d.prop(r, "request", 19, () => ({ fetch })), p = d.prop(r, "extensions", 19, () => ({}));
252
+ a({
252
253
  get pathname() {
253
- return i.route.pathname;
254
+ return r.route.pathname;
254
255
  },
255
- resolve: (e) => i.route.resolve(e),
256
- navigate: (e, t) => i.route.navigate?.(e, t)
257
- }), a({ fetch: async (...e) => {
256
+ resolve: (e) => r.route.resolve(e),
257
+ navigate: (e, t) => r.route.navigate?.(e, t)
258
+ }), i({ fetch: async (...e) => {
258
259
  let t = await f().fetch(...e), n = O(e[0], e[1]);
259
260
  return t.ok && k(n) && (n.documents && c(), n.folders && s(), n.tags && l()), t;
260
261
  } });
261
- let m = h(() => i.realtime);
262
- m && j(m), n.init(), t.init();
262
+ let m = h(() => r.realtime);
263
+ m && j(m), o.init(), t.init();
263
264
  let g = d.state(null), _ = d.state(null), v = d.state(null), S = d.state(!1), w = E();
264
265
  function D(e) {
265
266
  w.start({
@@ -293,7 +294,7 @@ function L(e, i) {
293
294
  };
294
295
  return t(), e.addEventListener("change", t), () => e.removeEventListener("change", t);
295
296
  }), d.user_effect(() => {
296
- i.route.pathname, x();
297
+ r.route.pathname, x();
297
298
  }), d.user_effect(() => {
298
299
  if (!d.get(S) || !y.open || !d.get(_)) return;
299
300
  let e = document.activeElement instanceof HTMLElement ? document.activeElement : d.get(v), t = document.body.style.overflow;
@@ -327,8 +328,8 @@ function L(e, i) {
327
328
  return p();
328
329
  },
329
330
  children: (e, t) => {
330
- var n = F(), a = d.first_child(n), o = d.child(a);
331
- r(o, {
331
+ var i = F(), a = d.first_child(i), o = d.child(a);
332
+ n(o, {
332
333
  get mobile() {
333
334
  return d.get(S);
334
335
  },
@@ -343,7 +344,7 @@ function L(e, i) {
343
344
  }
344
345
  });
345
346
  var s = d.sibling(o, 2), c = d.child(s);
346
- d.snippet(c, () => i.children), d.reset(s), d.bind_this(s, (e) => d.set(g, e), () => d.get(g)), d.reset(a);
347
+ d.snippet(c, () => r.children), d.reset(s), d.bind_this(s, (e) => d.set(g, e), () => d.get(g)), d.reset(a);
347
348
  var l = d.sibling(a, 2);
348
349
  C(l, {
349
350
  get buttonRef() {
@@ -368,13 +369,13 @@ function L(e, i) {
368
369
  };
369
370
  d.if(p, (e) => {
370
371
  d.get(S) && y.open && e(m);
371
- }), d.template_effect(() => s.inert = d.get(S) && y.open), d.append(e, n);
372
+ }), d.template_effect(() => s.inert = d.get(S) && y.open), d.append(e, i);
372
373
  },
373
374
  $$slots: { default: !0 }
374
375
  });
375
376
  var B = d.sibling(z, 2), V = (e) => {
376
377
  {
377
- let t = d.derived(() => i.route.pathname.startsWith("/docs/"));
378
+ let t = d.derived(() => r.route.pathname.startsWith("/docs/"));
378
379
  T(e, {
379
380
  get scrollTarget() {
380
381
  return d.get(g);
@@ -386,7 +387,7 @@ function L(e, i) {
386
387
  }
387
388
  };
388
389
  d.if(B, (e) => {
389
- n.showScrollToTop && e(V);
390
+ o.showScrollToTop && e(V);
390
391
  }), d.append(e, R), d.pop();
391
392
  }
392
393
  d.delegate([
@@ -0,0 +1,3 @@
1
+ import type { Component } from "svelte";
2
+ export interface EditorOutput { markdown: string; json: object; }
3
+ export declare const CompactEditor: Component<{ content?: string; contentJson?: object; placeholder?: string; onUpdate?: (output: EditorOutput) => void; editable?: boolean; documentId?: string; documentUpdatedAt?: string; }>;
@@ -0,0 +1,36 @@
1
+ import { t as e } from "../../HiAiEditor-DSVG3GNd.js";
2
+ import "svelte/internal/disclose-version";
3
+ import * as t from "svelte/internal/client";
4
+ //#region src/lib/components/editor/CompactEditor.svelte
5
+ function n(n, r) {
6
+ let i = t.prop(r, "content", 3, ""), a = t.prop(r, "onUpdate", 3, (e) => {}), o = t.prop(r, "editable", 3, !0), s = t.prop(r, "collaboration", 3, null), c = t.prop(r, "documentId", 3, ""), l = t.prop(r, "documentUpdatedAt", 3, "");
7
+ e(n, {
8
+ get content() {
9
+ return i();
10
+ },
11
+ get contentJson() {
12
+ return r.contentJson;
13
+ },
14
+ get placeholder() {
15
+ return r.placeholder;
16
+ },
17
+ get onUpdate() {
18
+ return a();
19
+ },
20
+ get editable() {
21
+ return o();
22
+ },
23
+ get collaboration() {
24
+ return s();
25
+ },
26
+ get documentId() {
27
+ return c();
28
+ },
29
+ get documentUpdatedAt() {
30
+ return l();
31
+ },
32
+ minimalToolbar: !0
33
+ });
34
+ }
35
+ //#endregion
36
+ export { n as CompactEditor };