@hiai-gg/docsmint 0.3.8 → 0.4.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 (107) hide show
  1. package/dist/backend/index.js +1 -1
  2. package/dist/client.d.ts +11 -0
  3. package/dist/client.js +9 -0
  4. package/dist/frontend/CategoryDialog-CxVyaBV5.js +611 -0
  5. package/dist/frontend/{ConfirmDialog-BLF3x_hr.js → ConfirmDialog-NFGXRa3E.js} +2 -2
  6. package/dist/frontend/{CreateSnapshotDialog-D5vPvFTL.js → CreateSnapshotDialog-BDgFTeFn.js} +40 -40
  7. package/dist/frontend/{DatePicker-CLNTdvTk.js → DatePicker-BZRBluzF.js} +102 -105
  8. package/dist/frontend/{DeleteDialog-DxYFJivN.js → DeleteDialog-CvAr2WPu.js} +39 -39
  9. package/dist/frontend/FolderNode--l1g8bcL.js +298 -0
  10. package/dist/frontend/HiaiDocsExtensionProvider-DHWLzRUu.js +11 -0
  11. package/dist/frontend/SettingsDialog-LyZUxxku.js +1016 -0
  12. package/dist/frontend/{ShareDialog-DYu3RKQu.js → ShareDialog-BUOkYSlw.js} +35 -35
  13. package/dist/frontend/Sidebar-BsJsD1mJ.js +2021 -0
  14. package/dist/frontend/{TagCreateDialog-DXQs2bL9.js → TagCreateDialog-B9YZBNHi.js} +38 -38
  15. package/dist/frontend/api/categories.js +1 -1
  16. package/dist/frontend/api/documents.js +1 -1
  17. package/dist/frontend/api/folders.js +1 -1
  18. package/dist/frontend/api/settings.js +1 -1
  19. package/dist/frontend/app-shell.d.ts +8 -0
  20. package/dist/frontend/app-shell.js +298 -0
  21. package/dist/frontend/{clsx-C7bIvsDS.js → bundle-mjs-DllmqUxV.js} +583 -583
  22. package/dist/frontend/{categories-izQovv2w.js → categories-Drnns7N6.js} +14 -14
  23. package/dist/frontend/components/category-dialog.js +1 -1
  24. package/dist/frontend/components/create-snapshot-dialog.js +1 -1
  25. package/dist/frontend/components/delete-dialog.js +1 -1
  26. package/dist/frontend/components/editor/document-editor.js +1102 -1102
  27. package/dist/frontend/components/editor/document-title.js +2 -2
  28. package/dist/frontend/components/editor/markdown-toggle.js +1 -1
  29. package/dist/frontend/components/folder-node.js +1 -1
  30. package/dist/frontend/components/save-as-dialog.js +75 -75
  31. package/dist/frontend/components/settings.js +1 -1
  32. package/dist/frontend/components/share-dialog.js +1 -1
  33. package/dist/frontend/components/sidebar.js +2 -2021
  34. package/dist/frontend/components/tag-create-dialog.js +1 -1
  35. package/dist/frontend/components/version-history.js +58 -58
  36. package/dist/frontend/{FolderDialog-CRVZM2Oi.js → confirm-dialog-C4jTRbiS.js} +69 -69
  37. package/dist/frontend/dashboard.js +1139 -1137
  38. package/dist/frontend/{dialog-D6NxYVmy.js → dialog-Bevp9mmM.js} +2 -2
  39. package/dist/frontend/{loader-circle-BA6aLO71.js → dist-C3857Spp.js} +81 -81
  40. package/dist/frontend/{documents-BsDkvzCm.js → documents-Bc7b_MSZ.js} +15 -15
  41. package/dist/frontend/{ellipsis-vertical-P9MHvCps.js → dropdown-menu-CRSby3e9.js} +182 -182
  42. package/dist/frontend/extension.js +2 -11
  43. package/dist/frontend/{floating-layer-anchor-CPwucTfd.js → floating-layer-anchor-BDs7vO-M.js} +1 -1
  44. package/dist/frontend/{folders-CTuV_JtU.js → folders-ONG03Dkv.js} +10 -10
  45. package/dist/frontend/frontend.css +1 -1
  46. package/dist/frontend/i18n.js +2 -2
  47. package/dist/frontend/{input-B5Rak-5G.js → input-BWlOML_m.js} +1 -1
  48. package/dist/frontend/{label-CW9rxoAb.js → label-C2HfJNQ2.js} +1 -1
  49. package/dist/frontend/{messages-BpYaLbzE.js → messages-C5Q890i2.js} +8 -8
  50. package/dist/frontend/route-context-BqQQ5c4i.js +29 -0
  51. package/dist/frontend/search.js +629 -629
  52. package/dist/frontend/{select-value-sF86Geyh.js → select-value-GXwx90Pr.js} +2 -2
  53. package/dist/frontend/{settings-blyobazp.js → settings-DSrUl4hW.js} +9 -9
  54. package/dist/frontend/{tag-store.svelte-CqrUXo0o.js → tag-store.svelte-CG7RrlDT.js} +1 -1
  55. package/dist/frontend/{textarea-i1720bE7.js → textarea-DOAE-h42.js} +1 -1
  56. package/dist/frontend/{utils-hzdMVeCv.js → utils-BPDRytUU.js} +1 -1
  57. package/dist/frontend/{utils-CffiyuTo.js → utils-DrfHTcei.js} +1 -1
  58. package/dist/frontend/utils.js +1 -1
  59. package/dist/frontend-ssr/api/categories.js +1 -1
  60. package/dist/frontend-ssr/api/documents.js +1 -1
  61. package/dist/frontend-ssr/api/folders.js +1 -1
  62. package/dist/frontend-ssr/api/settings.js +1 -1
  63. package/dist/frontend-ssr/app-shell.js +303 -0
  64. package/dist/frontend-ssr/assets/{CategoryDialog-C2xaZKHq.js → CategoryDialog-BcGW8-Kf.js} +4 -4
  65. package/dist/frontend-ssr/assets/{CreateSnapshotDialog-BRw1xJW1.js → CreateSnapshotDialog-1bROJ-Rn.js} +4 -4
  66. package/dist/frontend-ssr/assets/{DatePicker-DnXniwlZ.js → DatePicker-B1ML8OVz.js} +33 -33
  67. package/dist/frontend-ssr/assets/{FolderNode-DRfBfpft.js → FolderNode-CpHrpOED.js} +8 -6
  68. package/dist/frontend-ssr/assets/HiaiDocsExtensionProvider-DAM-lX4R.js +13 -0
  69. package/dist/frontend-ssr/assets/{SettingsDialog-CX8Noa8A.js → SettingsDialog-Dg97vv83.js} +20 -19
  70. package/dist/frontend-ssr/assets/{ShareDialog-Cge49ZdJ.js → ShareDialog-vMvJLRfn.js} +1 -1
  71. package/dist/frontend-ssr/assets/Sidebar-CrDk_HYY.js +2037 -0
  72. package/dist/frontend-ssr/assets/{TagCreateDialog-EAChgBF-.js → TagCreateDialog-B0DPEfmQ.js} +3 -3
  73. package/dist/frontend-ssr/assets/{categories-AOqgcsn4.js → categories-CTCtdv7V.js} +10 -10
  74. package/dist/frontend-ssr/assets/{FolderDialog-Dq7I2cKZ.js → confirm-dialog-BCthVwUY.js} +4 -4
  75. package/dist/frontend-ssr/assets/{documents-BnOTRdTY.js → documents-PObdTOiT.js} +8 -8
  76. package/dist/frontend-ssr/assets/{ellipsis-vertical-C-0hgkZn.js → dropdown-menu-Bj5rbqbB.js} +96 -96
  77. package/dist/frontend-ssr/assets/{folders-CTfbS24J.js → folders-BX30gHv6.js} +10 -10
  78. package/dist/frontend-ssr/assets/{messages-DhXqlcJI.js → messages-CvqpZNJe.js} +1 -1
  79. package/dist/frontend-ssr/assets/route-context-uca_b2Px.js +36 -0
  80. package/dist/frontend-ssr/assets/{select-value-DngdSmLI.js → select-value-6Lk0ToYd.js} +1 -1
  81. package/dist/frontend-ssr/assets/{tag-store.svelte-DPodKj6Z.js → tag-store.svelte-DvgUduhd.js} +1 -1
  82. package/dist/frontend-ssr/components/category-dialog.js +1 -1
  83. package/dist/frontend-ssr/components/create-snapshot-dialog.js +1 -1
  84. package/dist/frontend-ssr/components/delete-dialog.js +1 -1
  85. package/dist/frontend-ssr/components/editor/document-editor.js +5 -5
  86. package/dist/frontend-ssr/components/editor/document-title.js +1 -1
  87. package/dist/frontend-ssr/components/editor/markdown-toggle.js +1 -1
  88. package/dist/frontend-ssr/components/folder-node.js +1 -1
  89. package/dist/frontend-ssr/components/save-as-dialog.js +5 -5
  90. package/dist/frontend-ssr/components/settings.js +1 -1
  91. package/dist/frontend-ssr/components/share-dialog.js +1 -1
  92. package/dist/frontend-ssr/components/sidebar.js +1 -2032
  93. package/dist/frontend-ssr/components/tag-create-dialog.js +1 -1
  94. package/dist/frontend-ssr/components/version-history.js +3 -3
  95. package/dist/frontend-ssr/dashboard.js +45 -37
  96. package/dist/frontend-ssr/extension.js +1 -12
  97. package/dist/frontend-ssr/i18n.js +1 -1
  98. package/dist/frontend-ssr/search.js +9 -7
  99. package/package.json +7 -1
  100. package/packages/cli/src/index.ts +1 -1
  101. package/packages/mcp-server/src/index.ts +1 -1
  102. package/dist/frontend/CategoryDialog-DphkZqIB.js +0 -611
  103. package/dist/frontend/FolderNode-C2zG7uii.js +0 -298
  104. package/dist/frontend/SettingsDialog-DCM4-N6_.js +0 -1016
  105. package/dist/frontend-ssr/assets/{DeleteDialog-BCfZy3Zn.js → DeleteDialog-tBYaP0L3.js} +1 -1
  106. package/dist/frontend-ssr/assets/{floating-layer-anchor-uzw9K8qN.js → floating-layer-anchor-CYIE8Oj6.js} +1 -1
  107. package/dist/frontend-ssr/assets/{settings-E6qSAWM2.js → settings-Bk5Hk9Vq.js} +1 -1
@@ -1,9 +1,9 @@
1
- import { t as e } from "./loader-circle-BA6aLO71.js";
2
- import { a as t, i as n, n as r, o as i, r as a, t as o } from "./dialog-D6NxYVmy.js";
3
- import { t as s } from "./label-CW9rxoAb.js";
4
- import { $r as c, Qn as l, ei as u, ir as d, nr as f, qn as p, ti as m, tr as h } from "./messages-BpYaLbzE.js";
5
- import { t as g } from "./utils-CffiyuTo.js";
6
- import { t as _ } from "./input-B5Rak-5G.js";
1
+ import { n as e } from "./dist-C3857Spp.js";
2
+ import { $n as t, Jn as n, ar as r, ei as i, ni as a, nr as o, rr as s, ti as c } from "./messages-C5Q890i2.js";
3
+ import { t as l } from "./utils-DrfHTcei.js";
4
+ import { a as u, i as d, n as f, o as p, r as m, t as h } from "./dialog-Bevp9mmM.js";
5
+ import { t as g } from "./input-BWlOML_m.js";
6
+ import { t as _ } from "./label-C2HfJNQ2.js";
7
7
  import { c as v, l as y, n as b, r as x } from "./tags-CtCV0Djo.js";
8
8
  import "svelte/internal/disclose-version";
9
9
  import * as S from "svelte/internal/client";
@@ -23,7 +23,7 @@ function k(k, A) {
23
23
  "#3b82f6",
24
24
  "#8b5cf6",
25
25
  "#ec4899"
26
- ], M = j[9], N = S.prop(A, "open", 15, !1), P = S.prop(A, "mode", 3, "create"), F = S.prop(A, "tag", 3, null), I = S.state(""), L = S.state(S.proxy(M)), R = S.state(null), z = S.state(null), B = S.state(!1), V = S.derived(() => P() === "edit"), H = S.derived(() => S.get(V) ? u() : m()), U = S.derived(() => S.get(B) ? p() : S.get(V) ? f() : l());
26
+ ], M = j[9], N = S.prop(A, "open", 15, !1), P = S.prop(A, "mode", 3, "create"), F = S.prop(A, "tag", 3, null), I = S.state(""), L = S.state(S.proxy(M)), R = S.state(null), z = S.state(null), B = S.state(!1), V = S.derived(() => P() === "edit"), H = S.derived(() => S.get(V) ? c() : a()), U = S.derived(() => S.get(B) ? n() : S.get(V) ? s() : t());
27
27
  function W() {
28
28
  S.set(I, ""), S.set(L, M, !0), S.set(R, null), S.set(z, null), S.set(B, !1);
29
29
  }
@@ -44,7 +44,7 @@ function k(k, A) {
44
44
  e.preventDefault(), S.set(R, null), S.set(z, null);
45
45
  let t = S.get(I).trim();
46
46
  if (t.length === 0) {
47
- S.set(R, c(), !0);
47
+ S.set(R, i(), !0);
48
48
  return;
49
49
  }
50
50
  if (S.get(V) && F()) {
@@ -54,7 +54,7 @@ function k(k, A) {
54
54
  });
55
55
  if (!e.success) {
56
56
  let t = e.error.issues[0];
57
- S.set(R, t?.message ?? d(), !0);
57
+ S.set(R, t?.message ?? r(), !0);
58
58
  return;
59
59
  }
60
60
  X(F().id, e.data);
@@ -65,7 +65,7 @@ function k(k, A) {
65
65
  });
66
66
  if (!e.success) {
67
67
  let t = e.error.issues[0];
68
- S.set(R, t?.message ?? d(), !0);
68
+ S.set(R, t?.message ?? r(), !0);
69
69
  return;
70
70
  }
71
71
  Y(e.data.name, S.get(L));
@@ -77,7 +77,7 @@ function k(k, A) {
77
77
  let n = await b(e, t);
78
78
  A.onCreated?.(n), K();
79
79
  } catch (e) {
80
- S.set(z, e instanceof Error ? e.message : d(), !0), console.error("TagCreateDialog: createTag failed", e);
80
+ S.set(z, e instanceof Error ? e.message : r(), !0), console.error("TagCreateDialog: createTag failed", e);
81
81
  } finally {
82
82
  S.set(B, !1);
83
83
  }
@@ -88,7 +88,7 @@ function k(k, A) {
88
88
  let n = await v(e, t);
89
89
  A.onUpdated?.(n), K();
90
90
  } catch (e) {
91
- S.set(z, e instanceof Error ? e.message : d(), !0), console.error("TagCreateDialog: updateTag failed", e);
91
+ S.set(z, e instanceof Error ? e.message : r(), !0), console.error("TagCreateDialog: updateTag failed", e);
92
92
  } finally {
93
93
  S.set(B, !1);
94
94
  }
@@ -98,7 +98,7 @@ function k(k, A) {
98
98
  }
99
99
  S.user_effect(() => {
100
100
  N() && P() === "edit" && F() && (S.set(I, F().name, !0), S.set(L, F().color ?? M, !0), S.set(R, null), S.set(z, null));
101
- }), t(k, {
101
+ }), u(k, {
102
102
  onOpenChange: q,
103
103
  get open() {
104
104
  return N();
@@ -106,44 +106,44 @@ function k(k, A) {
106
106
  set open(e) {
107
107
  N(e);
108
108
  },
109
- children: (t, l) => {
110
- var u = O(), d = S.first_child(u);
111
- r(d, {
109
+ children: (t, n) => {
110
+ var r = O(), a = S.first_child(r);
111
+ f(a, {
112
112
  children: (e, t) => {
113
- var r = C(), i = S.first_child(r);
114
- o(i, {
113
+ var n = C(), r = S.first_child(n);
114
+ h(r, {
115
115
  children: (e, t) => {
116
116
  S.next();
117
117
  var n = S.text();
118
118
  S.template_effect(() => S.set_text(n, S.get(H))), S.append(e, n);
119
119
  },
120
120
  $$slots: { default: !0 }
121
- }), n(S.sibling(i, 2), {
121
+ }), d(S.sibling(r, 2), {
122
122
  children: (e, t) => {
123
123
  S.next();
124
124
  var n = S.text();
125
- S.template_effect((e) => S.set_text(n, e), [() => c()]), S.append(e, n);
125
+ S.template_effect((e) => S.set_text(n, e), [() => i()]), S.append(e, n);
126
126
  },
127
127
  $$slots: { default: !0 }
128
- }), S.append(e, r);
128
+ }), S.append(e, n);
129
129
  },
130
130
  $$slots: { default: !0 }
131
131
  });
132
- var f = S.sibling(d, 2), p = S.child(f), m = S.child(p);
133
- s(m, {
132
+ var s = S.sibling(a, 2), c = S.child(s), u = S.child(c);
133
+ _(u, {
134
134
  for: "tag-name",
135
135
  class: "sr-only",
136
136
  children: (e, t) => {
137
137
  S.next();
138
138
  var n = S.text();
139
- S.template_effect((e) => S.set_text(n, e), [() => c()]), S.append(e, n);
139
+ S.template_effect((e) => S.set_text(n, e), [() => i()]), S.append(e, n);
140
140
  },
141
141
  $$slots: { default: !0 }
142
142
  });
143
- var v = S.sibling(m, 2);
143
+ var v = S.sibling(u, 2);
144
144
  {
145
- let e = S.derived(() => c()), t = S.derived(() => S.get(R) ? "true" : void 0), n = S.derived(() => S.get(R) ? "tag-name-error" : void 0);
146
- _(v, {
145
+ let e = S.derived(() => i()), t = S.derived(() => S.get(R) ? "true" : void 0), n = S.derived(() => S.get(R) ? "tag-name-error" : void 0);
146
+ g(v, {
147
147
  id: "tag-name",
148
148
  name: "name",
149
149
  type: "text",
@@ -177,9 +177,9 @@ function k(k, A) {
177
177
  };
178
178
  S.if(y, (e) => {
179
179
  S.get(R) && e(b);
180
- }), S.reset(p);
181
- var x = S.sibling(p, 2), k = S.child(x);
182
- s(k, {
180
+ }), S.reset(c);
181
+ var x = S.sibling(c, 2), k = S.child(x);
182
+ _(k, {
183
183
  for: "tag-color",
184
184
  class: "text-xs text-muted-foreground",
185
185
  children: (e, t) => {
@@ -195,7 +195,7 @@ function k(k, A) {
195
195
  var r = T();
196
196
  S.template_effect((e) => {
197
197
  S.set_class(r, 1, e), S.set_style(r, `background-color: ${t ?? ""};`), S.set_attribute(r, "aria-label", `Color ${t ?? ""}`), S.set_attribute(r, "aria-pressed", S.get(n)), r.disabled = S.get(B);
198
- }, [() => S.clsx(g("size-6 shrink-0 rounded-full border-2 transition-all", S.get(n) ? "scale-110 border-foreground" : "border-transparent hover:scale-105"))]), S.delegated("click", r, () => S.set(L, t, !0)), S.append(e, r);
198
+ }, [() => S.clsx(l("size-6 shrink-0 rounded-full border-2 transition-all", S.get(n) ? "scale-110 border-foreground" : "border-transparent hover:scale-105"))]), S.delegated("click", r, () => S.set(L, t, !0)), S.append(e, r);
199
199
  });
200
200
  var N = S.sibling(M, 2), P = S.child(N);
201
201
  S.remove_input_defaults(P), S.reset(N), S.reset(A), S.reset(x);
@@ -205,11 +205,11 @@ function k(k, A) {
205
205
  };
206
206
  S.if(F, (e) => {
207
207
  S.get(z) && e(V);
208
- }), S.reset(f), a(S.sibling(f, 2), {
208
+ }), S.reset(s), m(S.sibling(s, 2), {
209
209
  class: "gap-2 max-sm:flex-col max-sm:items-stretch",
210
210
  children: (t, n) => {
211
- var r = C(), a = S.first_child(r);
212
- i(a, {
211
+ var r = C(), i = S.first_child(r);
212
+ p(i, {
213
213
  variant: "outline",
214
214
  type: "button",
215
215
  onclick: K,
@@ -219,14 +219,14 @@ function k(k, A) {
219
219
  children: (e, t) => {
220
220
  S.next();
221
221
  var n = S.text();
222
- S.template_effect((e) => S.set_text(n, e), [() => h()]), S.append(e, n);
222
+ S.template_effect((e) => S.set_text(n, e), [() => o()]), S.append(e, n);
223
223
  },
224
224
  $$slots: { default: !0 }
225
225
  });
226
- var o = S.sibling(a, 2);
226
+ var a = S.sibling(i, 2);
227
227
  {
228
228
  let t = S.derived(() => S.get(B) || S.get(I).trim().length === 0);
229
- i(o, {
229
+ p(a, {
230
230
  type: "submit",
231
231
  onclick: J,
232
232
  get disabled() {
@@ -250,7 +250,7 @@ function k(k, A) {
250
250
  $$slots: { default: !0 }
251
251
  }), S.template_effect((e) => {
252
252
  S.set_class(N, 1, e), S.set_style(N, `background-color: ${S.get(L) ?? ""};`), S.set_value(P, S.get(L)), P.disabled = S.get(B);
253
- }, [() => S.clsx(g("relative inline-flex size-6 shrink-0 cursor-pointer items-center justify-center overflow-hidden rounded-full border-2 transition-all", j.includes(S.get(L)) ? "border-transparent hover:scale-105" : "scale-110 border-foreground"))]), S.event("submit", f, J), S.delegated("input", P, (e) => S.set(L, e.currentTarget.value, !0)), S.append(t, u);
253
+ }, [() => S.clsx(l("relative inline-flex size-6 shrink-0 cursor-pointer items-center justify-center overflow-hidden rounded-full border-2 transition-all", j.includes(S.get(L)) ? "border-transparent hover:scale-105" : "scale-110 border-foreground"))]), S.event("submit", s, J), S.delegated("input", P, (e) => S.set(L, e.currentTarget.value, !0)), S.append(t, r);
254
254
  },
255
255
  $$slots: { default: !0 }
256
256
  }), S.pop();
@@ -1,2 +1,2 @@
1
- import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "../categories-izQovv2w.js";
1
+ import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "../categories-Drnns7N6.js";
2
2
  export { s as createCategory, r as createCategoryInputSchema, a as deleteCategory, n as listCategories, e as setDocumentCategory, i as setFolderCategory, o as updateCategory, t as updateCategoryInputSchema };
@@ -1,2 +1,2 @@
1
- import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "../documents-BsDkvzCm.js";
1
+ import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "../documents-Bc7b_MSZ.js";
2
2
  export { s as clearDocumentsCache, r as createDocument, a as deleteDocument, n as getDocument, e as importDocument, i as importDocuments, o as listDocuments, t as updateDocument };
@@ -1,2 +1,2 @@
1
- import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "../folders-CTuV_JtU.js";
1
+ import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "../folders-ONG03Dkv.js";
2
2
  export { s as createFolder, r as deleteDocument, a as deleteFolder, n as duplicateDocument, e as getFolder, i as getFolderPath, o as listFolders, t as updateFolder };
@@ -1,2 +1,2 @@
1
- import { a as e, i as t, n, r, t as i } from "../settings-blyobazp.js";
1
+ import { a as e, i as t, n, r, t as i } from "../settings-DSrUl4hW.js";
2
2
  export { i as deleteAccount, n as getEmbeddingConfig, r as getProfile, t as updateEmbeddingConfig, e as updateProfile };
@@ -0,0 +1,8 @@
1
+ import type { Component, Snippet } from "svelte";
2
+ export interface DocsmintRouteAdapter {
3
+ pathname: string;
4
+ resolve(path: string): string;
5
+ navigate?(path: string): void | Promise<void>;
6
+ }
7
+ export interface DocsmintAppShellHostProps { route: DocsmintRouteAdapter; extensions?: Record<string, unknown>; children: Snippet; }
8
+ export declare const DocsmintAppShellHost: Component<DocsmintAppShellHostProps>;
@@ -0,0 +1,298 @@
1
+ import { t as e } from "./Icon-CooFj4Ee.js";
2
+ import { n as t, r as n } from "./SettingsDialog-LyZUxxku.js";
3
+ import { t as r } from "./Sidebar-BsJsD1mJ.js";
4
+ import { E as i } from "./messages-C5Q890i2.js";
5
+ import { a, i as o } from "./route-context-BqQQ5c4i.js";
6
+ import { t as s } from "./HiaiDocsExtensionProvider-DHWLzRUu.js";
7
+ import "svelte/internal/disclose-version";
8
+ import * as c from "svelte/internal/client";
9
+ import "svelte/internal/flags/legacy";
10
+ import { onDestroy as l } from "svelte";
11
+ //#region ../node_modules/.bun/lucide-svelte@1.0.1+ff5f301bb2db9a0d/node_modules/lucide-svelte/dist/icons/arrow-up.svelte
12
+ function u(t, n) {
13
+ let r = c.legacy_rest_props(n, [
14
+ "children",
15
+ "$$slots",
16
+ "$$events",
17
+ "$$legacy"
18
+ ]), i = [["path", { d: "m5 12 7-7 7 7" }], ["path", { d: "M12 19V5" }]];
19
+ e(t, c.spread_props({ name: "arrow-up" }, () => r, {
20
+ get iconNode() {
21
+ return i;
22
+ },
23
+ children: (e, t) => {
24
+ var r = c.comment(), i = c.first_child(r);
25
+ c.slot(i, n, "default", {}, null), c.append(e, r);
26
+ },
27
+ $$slots: { default: !0 }
28
+ }));
29
+ }
30
+ //#endregion
31
+ //#region ../node_modules/.bun/lucide-svelte@1.0.1+ff5f301bb2db9a0d/node_modules/lucide-svelte/dist/icons/menu.svelte
32
+ function d(t, n) {
33
+ let r = c.legacy_rest_props(n, [
34
+ "children",
35
+ "$$slots",
36
+ "$$events",
37
+ "$$legacy"
38
+ ]), i = [
39
+ ["path", { d: "M4 5h16" }],
40
+ ["path", { d: "M4 12h16" }],
41
+ ["path", { d: "M4 19h16" }]
42
+ ];
43
+ e(t, c.spread_props({ name: "menu" }, () => r, {
44
+ get iconNode() {
45
+ return i;
46
+ },
47
+ children: (e, t) => {
48
+ var r = c.comment(), i = c.first_child(r);
49
+ c.slot(i, n, "default", {}, null), c.append(e, r);
50
+ },
51
+ $$slots: { default: !0 }
52
+ }));
53
+ }
54
+ //#endregion
55
+ //#region src/lib/stores/mobile-sidebar.svelte.ts
56
+ var f = c.state(!1), p = {
57
+ get open() {
58
+ return c.get(f);
59
+ },
60
+ set open(e) {
61
+ c.set(f, e, !0);
62
+ },
63
+ toggle() {
64
+ c.set(f, !c.get(f));
65
+ }
66
+ };
67
+ function m() {
68
+ c.set(f, !1);
69
+ }
70
+ //#endregion
71
+ //#region src/lib/components/MobileSidebarToggle.svelte
72
+ var h = c.from_html("<button type=\"button\" class=\"mobile-sidebar-toggle fixed left-3 top-3 flex size-11 items-center justify-center rounded-md border border-border bg-background text-foreground shadow-sm transition-colors hover:bg-accent md:hidden\" style=\"top: calc(0.75rem + env(safe-area-inset-top));\"><!></button>");
73
+ function g(e, t) {
74
+ c.push(t, !0);
75
+ let n = c.prop(t, "buttonRef", 15, null), r = c.prop(t, "controls", 3, "mobile-navigation"), i = c.state(!1);
76
+ function a() {
77
+ let e = Array.from(document.querySelectorAll("[role=\"dialog\"][aria-modal=\"true\"]"));
78
+ c.set(i, e.length > 0), document.documentElement.classList.toggle("nested-sidebar-modal-open", e.some((e) => e.tagName !== "ASIDE"));
79
+ }
80
+ c.user_effect(() => {
81
+ if (typeof document > "u") return;
82
+ let e = new MutationObserver(a);
83
+ return e.observe(document.body, {
84
+ childList: !0,
85
+ subtree: !0,
86
+ attributes: !0,
87
+ attributeFilter: ["role", "aria-modal"]
88
+ }), a(), () => {
89
+ e.disconnect(), document.documentElement.classList.remove("nested-sidebar-modal-open");
90
+ };
91
+ });
92
+ function o() {
93
+ p.toggle();
94
+ }
95
+ var s = c.comment(), l = c.first_child(s), u = (e) => {
96
+ var t = h();
97
+ d(c.child(t), { class: "size-5" }), c.reset(t), c.bind_this(t, (e) => n(e), () => n()), c.template_effect(() => {
98
+ c.set_attribute(t, "aria-label", p.open ? "Close navigation menu" : "Open navigation menu"), c.set_attribute(t, "aria-expanded", p.open), c.set_attribute(t, "aria-controls", r());
99
+ }), c.delegated("click", t, o), c.append(e, t);
100
+ };
101
+ c.if(l, (e) => {
102
+ c.get(i) || e(u);
103
+ }), c.append(e, s), c.pop();
104
+ }
105
+ c.delegate(["click"]);
106
+ //#endregion
107
+ //#region src/lib/components/ScrollToTop.svelte
108
+ var _ = c.from_html("<button type=\"button\"><!></button>");
109
+ function v(e, t) {
110
+ c.push(t, !0);
111
+ let n = c.prop(t, "avoidEditorToolbar", 3, !1), r = c.state(!1), a = null, o = c.state("none"), s = c.state(void 0);
112
+ function d() {
113
+ c.set(r, (a ? a.scrollTop : window.scrollY) > 300);
114
+ }
115
+ function f() {
116
+ a ? a.scrollTo({
117
+ top: 0,
118
+ behavior: "smooth"
119
+ }) : window.scrollTo({
120
+ top: 0,
121
+ behavior: "smooth"
122
+ });
123
+ }
124
+ function p(e) {
125
+ m(), e && (a = e, e.addEventListener("scroll", d, { passive: !0 }), d());
126
+ }
127
+ function m() {
128
+ a && a.removeEventListener("scroll", d), a = null;
129
+ }
130
+ c.user_effect(() => {
131
+ let e = t.scrollTarget;
132
+ return p(e), e ? () => {
133
+ m();
134
+ } : (window.addEventListener("scroll", d, { passive: !0 }), d(), () => {
135
+ window.removeEventListener("scroll", d);
136
+ });
137
+ }), l(() => {
138
+ m(), c.set(r, !1);
139
+ }), c.user_effect(() => {
140
+ if (!n() || typeof document > "u") {
141
+ c.set(o, "none"), c.set(s, void 0);
142
+ return;
143
+ }
144
+ let e = () => {
145
+ let e = document.querySelector(".toolbar.floating-bar");
146
+ if (e) {
147
+ let t = e.getBoundingClientRect();
148
+ c.set(o, "toolbar"), c.set(s, `${Math.max(0, window.innerHeight - t.top + 12)}px`);
149
+ return;
150
+ }
151
+ let t = document.querySelector(".floating-fab");
152
+ if (t) {
153
+ let e = t.getBoundingClientRect();
154
+ c.set(o, "fab"), c.set(s, `${Math.max(12, window.innerHeight - e.bottom - 12 - 40)}px`);
155
+ return;
156
+ }
157
+ c.set(o, "none"), c.set(s, void 0);
158
+ }, t = new MutationObserver(e);
159
+ t.observe(document.body, {
160
+ childList: !0,
161
+ subtree: !0,
162
+ attributes: !0,
163
+ attributeFilter: ["class"]
164
+ });
165
+ let r = new ResizeObserver(e);
166
+ return r.observe(document.body), window.addEventListener("resize", e, { passive: !0 }), e(), () => {
167
+ t.disconnect(), r.disconnect(), window.removeEventListener("resize", e);
168
+ };
169
+ });
170
+ var h = _();
171
+ let g, v;
172
+ u(c.child(h), { class: "size-5" }), c.reset(h), c.template_effect((e, t) => {
173
+ g = c.set_class(h, 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 ${c.get(r) ? "opacity-100 pointer-events-auto" : "opacity-0 pointer-events-none"}`, null, g, {
174
+ "above-editor-toolbar": c.get(o) === "toolbar",
175
+ "below-editor-fab": c.get(o) === "fab"
176
+ }), c.set_attribute(h, "aria-label", e), c.set_attribute(h, "title", t), v = c.set_style(h, "", v, { bottom: c.get(s) });
177
+ }, [() => i(), () => i()]), c.delegated("click", h, f), c.append(e, h), c.pop();
178
+ }
179
+ c.delegate(["click"]);
180
+ //#endregion
181
+ //#region src/lib/hosts/DocsmintAppShellHost.svelte
182
+ var y = c.from_html("<button type=\"button\" tabindex=\"-1\" aria-label=\"Close navigation menu\" class=\"fixed inset-0 z-40 bg-black/50\"></button>"), b = c.from_html("<div class=\"flex h-screen\" data-docsmint-app-shell-host=\"\"><!> <main id=\"main-content\" class=\"relative z-0 flex-1 overflow-auto\"><!></main></div> <!> <!>", 1), x = c.from_html("<!> <!>", 1);
183
+ function S(e, i) {
184
+ c.push(i, !0);
185
+ let l = c.prop(i, "request", 19, () => ({ fetch })), u = c.prop(i, "extensions", 19, () => ({}));
186
+ a({
187
+ get pathname() {
188
+ return i.route.pathname;
189
+ },
190
+ resolve: (e) => i.route.resolve(e),
191
+ navigate: (e, t) => i.route.navigate?.(e, t)
192
+ }), o({ fetch: (...e) => l().fetch(...e) }), n.init(), t.init();
193
+ let d = c.state(null), f = c.state(null), h = c.state(null), _ = c.state(!1), S = [
194
+ "a[href]",
195
+ "button:not([disabled])",
196
+ "input:not([disabled])",
197
+ "select:not([disabled])",
198
+ "textarea:not([disabled])",
199
+ "[tabindex]:not([tabindex=\"-1\"])"
200
+ ].join(",");
201
+ c.user_effect(() => {
202
+ let e = window.matchMedia("(max-width: 767px)"), t = () => {
203
+ c.set(_, e.matches, !0), c.get(_) || m();
204
+ };
205
+ return t(), e.addEventListener("change", t), () => e.removeEventListener("change", t);
206
+ }), c.user_effect(() => {
207
+ i.route.pathname, m();
208
+ }), c.user_effect(() => {
209
+ if (!c.get(_) || !p.open || !c.get(f)) return;
210
+ let e = document.activeElement instanceof HTMLElement ? document.activeElement : c.get(h), t = document.body.style.overflow;
211
+ document.body.style.overflow = "hidden";
212
+ let n = () => Array.from(c.get(f)?.querySelectorAll(S) ?? []).filter((e) => !e.hasAttribute("disabled")), r = (e) => {
213
+ let t = e.target instanceof Element ? e.target.closest("[role=\"dialog\"]") : null;
214
+ if (t && t !== c.get(f)) return;
215
+ if (e.key === "Escape") {
216
+ e.preventDefault(), m();
217
+ return;
218
+ }
219
+ if (e.key !== "Tab") return;
220
+ let r = n(), i = r.at(0), a = r.at(-1);
221
+ if (!i || !a) {
222
+ e.preventDefault(), c.get(f)?.focus();
223
+ return;
224
+ }
225
+ e.shiftKey && document.activeElement === i ? (e.preventDefault(), a.focus()) : !e.shiftKey && document.activeElement === a && (e.preventDefault(), i.focus());
226
+ };
227
+ document.addEventListener("keydown", r);
228
+ let i = requestAnimationFrame(() => {
229
+ (n().at(0) ?? c.get(f))?.focus();
230
+ });
231
+ return () => {
232
+ cancelAnimationFrame(i), document.removeEventListener("keydown", r), document.body.style.overflow = t, e?.isConnected && e.focus();
233
+ };
234
+ });
235
+ var C = x(), w = c.first_child(C);
236
+ s(w, {
237
+ get extensions() {
238
+ return u();
239
+ },
240
+ children: (e, t) => {
241
+ var n = b(), a = c.first_child(n), o = c.child(a);
242
+ r(o, {
243
+ get mobile() {
244
+ return c.get(_);
245
+ },
246
+ get mobileOpen() {
247
+ return p.open;
248
+ },
249
+ get element() {
250
+ return c.get(f);
251
+ },
252
+ set element(e) {
253
+ c.set(f, e, !0);
254
+ }
255
+ });
256
+ var s = c.sibling(o, 2), l = c.child(s);
257
+ c.snippet(l, () => i.children), c.reset(s), c.bind_this(s, (e) => c.set(d, e), () => c.get(d)), c.reset(a);
258
+ var u = c.sibling(a, 2);
259
+ g(u, {
260
+ get buttonRef() {
261
+ return c.get(h);
262
+ },
263
+ set buttonRef(e) {
264
+ c.set(h, e, !0);
265
+ }
266
+ });
267
+ var v = c.sibling(u, 2), x = (e) => {
268
+ var t = y();
269
+ c.delegated("click", t, function(...e) {
270
+ m?.apply(this, e);
271
+ }), c.append(e, t);
272
+ };
273
+ c.if(v, (e) => {
274
+ c.get(_) && p.open && e(x);
275
+ }), c.template_effect(() => s.inert = c.get(_) && p.open), c.append(e, n);
276
+ },
277
+ $$slots: { default: !0 }
278
+ });
279
+ var T = c.sibling(w, 2), E = (e) => {
280
+ {
281
+ let t = c.derived(() => i.route.pathname.startsWith("/docs/"));
282
+ v(e, {
283
+ get scrollTarget() {
284
+ return c.get(d);
285
+ },
286
+ get avoidEditorToolbar() {
287
+ return c.get(t);
288
+ }
289
+ });
290
+ }
291
+ };
292
+ c.if(T, (e) => {
293
+ n.showScrollToTop && e(E);
294
+ }), c.append(e, C), c.pop();
295
+ }
296
+ c.delegate(["click"]);
297
+ //#endregion
298
+ export { S as DocsmintAppShellHost };