@hiai-gg/docsmint 0.7.0 → 0.7.3

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 (116) hide show
  1. package/README.md +97 -103
  2. package/dist/backend/index.js +2 -2
  3. package/dist/frontend/CategoryDialog-bQKMpVFD.js +631 -0
  4. package/dist/frontend/ConfirmDialog-DF7kgkyq.js +139 -0
  5. package/dist/frontend/CreateSnapshotDialog-CojnWChs.js +222 -0
  6. package/dist/frontend/{DatePicker-DsoepNdb.js → DatePicker-7FAbIOGg.js} +4 -4
  7. package/dist/frontend/DeleteDialog-BIlqRb1u.js +179 -0
  8. package/dist/frontend/{FolderNode-CNwi0ySr.js → FolderNode-Cf443LBa.js} +2 -2
  9. package/dist/frontend/{HiAiEditor-B1EDGsnA.js → HiAiEditor-CMZ-eL8s.js} +961 -955
  10. package/dist/frontend/SettingsDialog-DatuxOVX.js +980 -0
  11. package/dist/frontend/{ShareDialog-wGTXuXFE.js → ShareDialog-Bwz2y3Le.js} +2 -2
  12. package/dist/frontend/Sidebar-C_t5RrOJ.js +2101 -0
  13. package/dist/frontend/TagCreateDialog-Ch21yuWV.js +266 -0
  14. package/dist/frontend/app-shell.d.ts +3 -1
  15. package/dist/frontend/app-shell.js +155 -152
  16. package/dist/frontend/components/category-dialog.js +1 -1
  17. package/dist/frontend/components/create-snapshot-dialog.js +1 -1
  18. package/dist/frontend/components/delete-dialog.js +1 -1
  19. package/dist/frontend/components/editor/compact-editor.js +1 -1
  20. package/dist/frontend/components/editor/document-editor.js +1 -1
  21. package/dist/frontend/components/editor/document-title.js +1 -1
  22. package/dist/frontend/components/editor/extensions.js +1 -1
  23. package/dist/frontend/components/editor/markdown-toggle.js +2 -2
  24. package/dist/frontend/components/editor/markdown.js +1 -1
  25. package/dist/frontend/components/folder-node.js +1 -1
  26. package/dist/frontend/components/save-as-dialog.js +232 -227
  27. package/dist/frontend/components/settings.js +1 -1
  28. package/dist/frontend/components/share-dialog.js +1 -1
  29. package/dist/frontend/components/sidebar.js +1 -1
  30. package/dist/frontend/components/tag-create-dialog.js +1 -1
  31. package/dist/frontend/components/version-history.js +3 -3
  32. package/dist/frontend/confirm-dialog-8T6vsWL7.js +265 -0
  33. package/dist/frontend/dashboard.js +600 -592
  34. package/dist/frontend/dialog-CiSwD-_v.js +253 -0
  35. package/dist/frontend/{dropdown-menu-BXIl2E26.js → dropdown-menu-Bi5Iipwf.js} +6 -6
  36. package/dist/frontend/editor-content-sanitizer-CC_A8aaI.js +112 -0
  37. package/dist/frontend/{editorExtensions-BmINh76i.js → editorExtensions--HusV819.js} +3356 -3423
  38. package/dist/frontend/frontend.css +1 -1
  39. package/dist/frontend/i18n.js +1 -1
  40. package/dist/frontend/{input-eHFb2qiL.js → input-N9dNSOWF.js} +2 -2
  41. package/dist/frontend/{label-_I1iiaNU.js → label-CK72_fw8.js} +2 -2
  42. package/dist/frontend/{markdown-A5xji16P.js → markdown-H6QB53zu.js} +1 -1
  43. package/dist/frontend/messages-DTRe4U2V.js +1093 -0
  44. package/dist/frontend/search.js +3 -3
  45. package/dist/frontend/{select-value-CtMyrvDJ.js → select-value-BD1DToYs.js} +6 -6
  46. package/dist/frontend/shared-document.js +95 -92
  47. package/dist/frontend/{textarea-2eslfANY.js → textarea-pl_fDBre.js} +2 -2
  48. package/dist/frontend/theme.js +1 -1
  49. package/dist/frontend/theme.svelte-DG3RS7wv.js +101 -0
  50. package/dist/frontend/{utils-CDBqTgoV.js → utils-CMQRlxbx.js} +1 -1
  51. package/dist/frontend-ssr/app-shell.js +9 -5
  52. package/dist/frontend-ssr/assets/CategoryDialog-DsXe54EF.js +608 -0
  53. package/dist/frontend-ssr/assets/ConfirmDialog-DrH653ua.js +136 -0
  54. package/dist/frontend-ssr/assets/{CreateSnapshotDialog-BZ45odvJ.js → CreateSnapshotDialog-D3-PjXVr.js} +93 -88
  55. package/dist/frontend-ssr/assets/{DatePicker-CPtl6W5E.js → DatePicker-C9suIA1S.js} +4 -4
  56. package/dist/frontend-ssr/assets/DeleteDialog-DxtMrS1O.js +159 -0
  57. package/dist/frontend-ssr/assets/{FolderNode-D9kgJG9d.js → FolderNode-ChD10Elp.js} +2 -2
  58. package/dist/frontend-ssr/assets/{HiAiEditor-DOd2MXjD.js → HiAiEditor-2X3Uyg1B.js} +60 -54
  59. package/dist/frontend-ssr/assets/{SettingsDialog-CIVbMKmf.js → SettingsDialog-DDy0hN8x.js} +373 -361
  60. package/dist/frontend-ssr/assets/{ShareDialog-D2UNUbF7.js → ShareDialog-BwW_wF4G.js} +2 -2
  61. package/dist/frontend-ssr/assets/{Sidebar-Bb-k2R-Z.js → Sidebar-Dy-5gXOf.js} +170 -129
  62. package/dist/frontend-ssr/assets/{TagCreateDialog-6Gk7L3D-.js → TagCreateDialog-BPzgOaX8.js} +94 -89
  63. package/dist/frontend-ssr/assets/{confirm-dialog-B9MVS_bF.js → confirm-dialog-wYC07DPx.js} +109 -89
  64. package/dist/frontend-ssr/assets/{dialog-1SB5neow.js → dialog-ClcuF7nD.js} +47 -12
  65. package/dist/frontend-ssr/assets/{dropdown-menu-DqoOkdqB.js → dropdown-menu-BKMGVNLL.js} +6 -6
  66. package/dist/frontend-ssr/assets/editor-content-sanitizer-Gjm93iR-.js +145 -0
  67. package/dist/frontend-ssr/assets/{editorExtensions-BwGeSPuX.js → editorExtensions-qNlZVP98.js} +2 -88
  68. package/dist/frontend-ssr/assets/{input-Df-QP3Km.js → input-DcDR8L8M.js} +2 -2
  69. package/dist/frontend-ssr/assets/{label-CbUOUz6L.js → label-Cz0_svJx.js} +2 -2
  70. package/dist/frontend-ssr/assets/{markdown-CB8DZ-LT.js → markdown-MhPwNWrC.js} +1 -1
  71. package/dist/frontend-ssr/assets/{messages-BAQzILs4.js → messages-B1TjVIH8.js} +2 -2
  72. package/dist/frontend-ssr/assets/{select-value-CXEDWrZg.js → select-value-CaDktvDW.js} +6 -6
  73. package/dist/frontend-ssr/assets/{textarea-CHh8NuSS.js → textarea-BGrjPOgU.js} +2 -2
  74. package/dist/frontend-ssr/assets/theme.svelte-CN3BUhJG.js +136 -0
  75. package/dist/frontend-ssr/assets/{utils-DtX0ta7y.js → utils-Cg_R05dR.js} +1 -1
  76. package/dist/frontend-ssr/components/category-dialog.js +1 -1
  77. package/dist/frontend-ssr/components/create-snapshot-dialog.js +1 -1
  78. package/dist/frontend-ssr/components/delete-dialog.js +1 -1
  79. package/dist/frontend-ssr/components/editor/compact-editor.js +1 -1
  80. package/dist/frontend-ssr/components/editor/document-editor.js +1 -1
  81. package/dist/frontend-ssr/components/editor/document-title.js +1 -1
  82. package/dist/frontend-ssr/components/editor/extensions.js +1 -1
  83. package/dist/frontend-ssr/components/editor/markdown-toggle.js +2 -2
  84. package/dist/frontend-ssr/components/editor/markdown.js +1 -1
  85. package/dist/frontend-ssr/components/folder-node.js +1 -1
  86. package/dist/frontend-ssr/components/save-as-dialog.js +177 -172
  87. package/dist/frontend-ssr/components/settings.js +1 -1
  88. package/dist/frontend-ssr/components/share-dialog.js +1 -1
  89. package/dist/frontend-ssr/components/sidebar.js +1 -1
  90. package/dist/frontend-ssr/components/tag-create-dialog.js +1 -1
  91. package/dist/frontend-ssr/components/version-history.js +3 -3
  92. package/dist/frontend-ssr/dashboard.js +102 -95
  93. package/dist/frontend-ssr/i18n.js +1 -1
  94. package/dist/frontend-ssr/search.js +3 -3
  95. package/dist/frontend-ssr/shared-document.js +3 -0
  96. package/dist/frontend-ssr/theme.js +1 -1
  97. package/dist/mcp-cli.js +1 -1
  98. package/dist/mcp-server.js +1 -1
  99. package/package.json +1 -1
  100. package/packages/cli/src/index.ts +4 -3
  101. package/server.json +43 -6
  102. package/dist/frontend/CategoryDialog-C67_TXf0.js +0 -626
  103. package/dist/frontend/ConfirmDialog-_LlrA--f.js +0 -134
  104. package/dist/frontend/CreateSnapshotDialog-BmCRpOMv.js +0 -217
  105. package/dist/frontend/DeleteDialog-L1A3FhMM.js +0 -174
  106. package/dist/frontend/SettingsDialog-AP42xOGg.js +0 -969
  107. package/dist/frontend/Sidebar-lKQT3dEf.js +0 -2060
  108. package/dist/frontend/TagCreateDialog-su8BhLzS.js +0 -261
  109. package/dist/frontend/confirm-dialog-BG8y2Pum.js +0 -250
  110. package/dist/frontend/dialog-C2iKObEu.js +0 -213
  111. package/dist/frontend/messages-DIovIZrK.js +0 -1093
  112. package/dist/frontend/theme.svelte-DKfCy12k.js +0 -49
  113. package/dist/frontend-ssr/assets/CategoryDialog-BGuHTb3K.js +0 -603
  114. package/dist/frontend-ssr/assets/ConfirmDialog-D1BDXXll.js +0 -131
  115. package/dist/frontend-ssr/assets/DeleteDialog-oHT_p_vG.js +0 -154
  116. package/dist/frontend-ssr/assets/theme.svelte-Co0-ssaD.js +0 -67
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./Icon-Db-o32_E.js";
2
- import { a as t, i as n, o as r, r as i, t as a } from "./DatePicker-DsoepNdb.js";
2
+ import { a as t, i as n, o as r, r as i, t as a } from "./DatePicker-7FAbIOGg.js";
3
3
  import { t as o } from "./check-BIi-Ghti.js";
4
4
  import { t as s } from "./chevron-down-C2ft7XUV.js";
5
5
  import { n as c, t as l } from "./folder-Cx60MRpi.js";
@@ -7,14 +7,14 @@ import { t as u } from "./rotate-ccw-ta4NosZ0.js";
7
7
  import { n as d, t as f } from "./tag-DhVFHMcV.js";
8
8
  import { t as p } from "./x-cfdlccjs.js";
9
9
  import { n as m } from "./dist-DQa_OHOa.js";
10
- import { At as h, Ct as g, Dt as _, Et as v, Ft as y, Gr as b, It as x, Jr as S, Kr as C, Li as w, Lt as T, Mt as ee, Nt as te, Ot as E, Pt as ne, Ri as D, Rt as re, St as O, T as ie, Tt as ae, Wr as oe, Yr as k, Zr as se, _t as ce, bt as le, ft as ue, gt as de, ht as fe, jt as pe, kt as me, mt as he, n as ge, pt as _e, qr as ve, vt as ye, wt as be, xt as xe, yt as Se, zi as Ce, zt as we } from "./messages-DIovIZrK.js";
10
+ import { At as h, Ct as g, Dt as _, Et as v, Ft as y, Gr as b, It as x, Jr as S, Kr as C, Li as w, Lt as T, Mt as ee, Nt as te, Ot as E, Pt as ne, Ri as D, Rt as re, St as O, T as ie, Tt as ae, Wr as oe, Yr as k, Zr as se, _t as ce, bt as le, ft as ue, gt as de, ht as fe, jt as pe, kt as me, mt as he, n as ge, pt as _e, qr as ve, vt as ye, wt as be, xt as xe, yt as Se, zi as Ce, zt as we } from "./messages-DTRe4U2V.js";
11
11
  import { a as Te, i as Ee, n as A, t as De } from "./route-context-DYQlUfzL.js";
12
12
  import { n as j } from "./client-GbtOH90i.js";
13
13
  import { i as Oe } from "./categories-X7gK8azc.js";
14
14
  import { t as ke } from "./context-D0zPFXZ4.js";
15
15
  import { t as Ae } from "./resolve-BG4HgzpN.js";
16
16
  import { i as je } from "./search-preferences-B1GdbdUc.js";
17
- import { a as Me, i as Ne, n as Pe, r as Fe, t as Ie } from "./select-value-CtMyrvDJ.js";
17
+ import { a as Me, i as Ne, n as Pe, r as Fe, t as Ie } from "./select-value-BD1DToYs.js";
18
18
  import { s as Le } from "./documents-CwCs1rA7.js";
19
19
  import { s as Re } from "./folders-ONG03Dkv.js";
20
20
  import { r as ze } from "./tag-store.svelte-ogVCMCbv.js";
@@ -1,4 +1,4 @@
1
- import { t as e } from "./utils-CDBqTgoV.js";
1
+ import { t as e } from "./utils-CMQRlxbx.js";
2
2
  import { $ as t, B as n, C as r, D as i, E as a, F as o, G as s, H as c, J as l, K as u, M as d, O as f, Q as p, S as m, T as h, U as g, X as _, Y as v, Z as y, _ as b, a as x, b as S, et as C, g as w, h as T, i as E, j as ee, k as te, n as ne, o as D, q as O, r as k, t as A, v as j, w as M, x as re, y as ie } from "./floating-layer-anchor-BGIndLY-.js";
3
3
  import "svelte/internal/disclose-version";
4
4
  import * as N from "svelte/internal/client";
@@ -1207,7 +1207,7 @@ function Oe(e, t) {
1207
1207
  }), N.append(e, c), N.pop();
1208
1208
  }
1209
1209
  //#endregion
1210
- //#region ../node_modules/.bun/@hiai-gg+hiai-ui@0.0.8+8f2b9fada26e5f3b/node_modules/@hiai-gg/hiai-ui/dist/components/ui/select/select.svelte
1210
+ //#region ../node_modules/.bun/@hiai-gg+hiai-ui@0.1.3+8f2b9fada26e5f3b/node_modules/@hiai-gg/hiai-ui/dist/components/ui/select/select.svelte
1211
1211
  var ke = /* @__PURE__ */ new Set([
1212
1212
  "$$slots",
1213
1213
  "$$events",
@@ -1241,7 +1241,7 @@ function Ae(e, t) {
1241
1241
  }), N.append(e, i), N.pop();
1242
1242
  }
1243
1243
  //#endregion
1244
- //#region ../node_modules/.bun/@hiai-gg+hiai-ui@0.0.8+8f2b9fada26e5f3b/node_modules/@hiai-gg/hiai-ui/dist/components/ui/select/select-content.svelte
1244
+ //#region ../node_modules/.bun/@hiai-gg+hiai-ui@0.1.3+8f2b9fada26e5f3b/node_modules/@hiai-gg/hiai-ui/dist/components/ui/select/select-content.svelte
1245
1245
  var je = /* @__PURE__ */ new Set([
1246
1246
  "$$slots",
1247
1247
  "$$events",
@@ -1297,7 +1297,7 @@ function Me(t, n) {
1297
1297
  N.append(t, o), N.pop();
1298
1298
  }
1299
1299
  //#endregion
1300
- //#region ../node_modules/.bun/@hiai-gg+hiai-ui@0.0.8+8f2b9fada26e5f3b/node_modules/@hiai-gg/hiai-ui/dist/components/ui/select/select-item.svelte
1300
+ //#region ../node_modules/.bun/@hiai-gg+hiai-ui@0.1.3+8f2b9fada26e5f3b/node_modules/@hiai-gg/hiai-ui/dist/components/ui/select/select-item.svelte
1301
1301
  var Ne = /* @__PURE__ */ new Set([
1302
1302
  "$$slots",
1303
1303
  "$$events",
@@ -1338,7 +1338,7 @@ function Pe(t, n) {
1338
1338
  N.append(t, a), N.pop();
1339
1339
  }
1340
1340
  //#endregion
1341
- //#region ../node_modules/.bun/@hiai-gg+hiai-ui@0.0.8+8f2b9fada26e5f3b/node_modules/@hiai-gg/hiai-ui/dist/components/ui/select/select-trigger.svelte
1341
+ //#region ../node_modules/.bun/@hiai-gg+hiai-ui@0.1.3+8f2b9fada26e5f3b/node_modules/@hiai-gg/hiai-ui/dist/components/ui/select/select-trigger.svelte
1342
1342
  var Fe = /* @__PURE__ */ new Set([
1343
1343
  "$$slots",
1344
1344
  "$$events",
@@ -1412,7 +1412,7 @@ function Ie(t, n) {
1412
1412
  }), N.append(t, a), N.pop();
1413
1413
  }
1414
1414
  //#endregion
1415
- //#region ../node_modules/.bun/@hiai-gg+hiai-ui@0.0.8+8f2b9fada26e5f3b/node_modules/@hiai-gg/hiai-ui/dist/components/ui/select/select-value.svelte
1415
+ //#region ../node_modules/.bun/@hiai-gg+hiai-ui@0.1.3+8f2b9fada26e5f3b/node_modules/@hiai-gg/hiai-ui/dist/components/ui/select/select-value.svelte
1416
1416
  var Le = /* @__PURE__ */ new Set([
1417
1417
  "$$slots",
1418
1418
  "$$events",
@@ -1,16 +1,17 @@
1
1
  import { t as e } from "./context-D0zPFXZ4.js";
2
+ import { t } from "./editor-content-sanitizer-CC_A8aaI.js";
2
3
  import "svelte/internal/disclose-version";
3
- import * as t from "svelte/internal/client";
4
+ import * as n from "svelte/internal/client";
4
5
  //#region src/lib/components/editor/shared-document.ts
5
- var n = /^\/api\/attachments\/[0-9a-f-]+\/raw$/i, r = /* @__PURE__ */ new Set([
6
+ var r = /^\/api\/attachments\/[0-9a-f-]+\/raw$/i, i = /* @__PURE__ */ new Set([
6
7
  "http:",
7
8
  "https:",
8
9
  "mailto:"
9
10
  ]);
10
- function i(e) {
11
+ function a(e) {
11
12
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
12
13
  }
13
- function a(e, t) {
14
+ function o(e, t) {
14
15
  switch (e.type) {
15
16
  case "bold": return `<strong>${t}</strong>`;
16
17
  case "italic": return `<em>${t}</em>`;
@@ -18,88 +19,90 @@ function a(e, t) {
18
19
  case "strikethrough": return `<s>${t}</s>`;
19
20
  case "underline": return `<u>${t}</u>`;
20
21
  case "code": return `<code>${t}</code>`;
21
- case "link": return `<a href="${i(o(e.attrs?.href ?? "#"))}" target="_blank" rel="noopener noreferrer">${t}</a>`;
22
- case "highlight": return `<mark style="background-color: ${i(e.attrs?.color ?? "#fde68a")}">${t}</mark>`;
22
+ case "link": return `<a href="${a(s(e.attrs?.href ?? "#"))}" target="_blank" rel="noopener noreferrer">${t}</a>`;
23
+ case "highlight": return `<mark style="background-color: ${a(e.attrs?.color ?? "#fde68a")}">${t}</mark>`;
23
24
  default: return t;
24
25
  }
25
26
  }
26
- function o(e) {
27
+ function s(e) {
27
28
  if (e.startsWith("#") || e.startsWith("/") || e.startsWith("./")) return e;
28
29
  try {
29
30
  let t = new URL(e);
30
- return r.has(t.protocol) ? e : "#";
31
+ return i.has(t.protocol) ? e : "#";
31
32
  } catch {
32
33
  return "#";
33
34
  }
34
35
  }
35
- function s(e) {
36
+ function c(e) {
36
37
  let t = e?.textAlign;
37
38
  return t !== "left" && t !== "center" && t !== "right" && t !== "justify" ? "" : ` style="text-align: ${t}"`;
38
39
  }
39
- function c(e) {
40
+ function l(e) {
40
41
  if (e.type === "text") {
41
- let t = i(e.text ?? "");
42
- for (let n of e.marks ?? []) t = a(n, t);
42
+ let t = a(e.text ?? "");
43
+ for (let n of e.marks ?? []) t = o(n, t);
43
44
  return t;
44
45
  }
45
- return (e.content ?? []).map(c).join("");
46
+ return (e.content ?? []).map(l).join("");
46
47
  }
47
- function l(e) {
48
- let t = (e) => {
49
- if (e.type === "text") return c(e);
50
- let r = s(e.attrs), a = (e.content ?? []).map(t).join("");
48
+ function u(e) {
49
+ let n = (e) => {
50
+ if (e.type === "text") return l(e);
51
+ let i = c(e.attrs), o = (e.content ?? []).map(n).join("");
51
52
  switch (e.type) {
52
- case "paragraph": return `<p${r}>${a}</p>`;
53
+ case "paragraph": return `<p${i}>${o}</p>`;
53
54
  case "heading": {
54
55
  let t = Math.min(Math.max(Number(e.attrs?.level ?? 1), 1), 6);
55
- return `<h${t}${r}>${(e.content ?? []).map(c).join("")}</h${t}>`;
56
+ return `<h${t}${i}>${(e.content ?? []).map(l).join("")}</h${t}>`;
56
57
  }
57
- case "bulletList": return `<ul${r}>${a}</ul>`;
58
+ case "bulletList": return `<ul${i}>${o}</ul>`;
58
59
  case "orderedList": {
59
60
  let t = Number(e.attrs?.start ?? 1);
60
- return `<ol${Number.isSafeInteger(t) && t > 1 ? ` start="${t}"` : ""}${r}>${a}</ol>`;
61
+ return `<ol${Number.isSafeInteger(t) && t > 1 ? ` start="${t}"` : ""}${i}>${o}</ol>`;
61
62
  }
62
- case "listItem": return `<li${r}>${a}</li>`;
63
- case "taskList": return `<ul data-type="taskList">${a}</ul>`;
63
+ case "listItem": return `<li${i}>${o}</li>`;
64
+ case "taskList": return `<ul data-type="taskList">${o}</ul>`;
64
65
  case "taskItem": {
65
66
  let t = e.attrs?.checked === !0 || e.attrs?.checked === "true";
66
- return `<li data-type="taskItem"${t ? " data-checked=\"true\"" : ""}><label><input type="checkbox" disabled${t ? " checked" : ""} /></label><div>${a}</div></li>`;
67
+ return `<li data-type="taskItem"${t ? " data-checked=\"true\"" : ""}><label><input type="checkbox" disabled${t ? " checked" : ""} /></label><div>${o}</div></li>`;
67
68
  }
68
- case "blockquote": return `<blockquote${r}>${a}</blockquote>`;
69
- case "table": return `<table><tbody>${a}</tbody></table>`;
70
- case "tableRow": return `<tr>${a}</tr>`;
71
- case "tableHeader": return `<th${r}>${a}</th>`;
72
- case "tableCell": return `<td${r}>${a}</td>`;
69
+ case "blockquote": return `<blockquote${i}>${o}</blockquote>`;
70
+ case "table": return `<table><tbody>${o}</tbody></table>`;
71
+ case "tableRow": return `<tr>${o}</tr>`;
72
+ case "tableHeader": return `<th${i}>${o}</th>`;
73
+ case "tableCell": return `<td${i}>${o}</td>`;
73
74
  case "codeBlock": {
74
75
  let t = e.attrs?.language ?? "";
75
- return `<pre><code${t ? ` class="language-${i(t)}"` : ""}>${a}</code></pre>`;
76
+ return `<pre><code${t ? ` class="language-${a(t)}"` : ""}>${o}</code></pre>`;
76
77
  }
77
78
  case "horizontalRule": return "<hr />";
78
79
  case "hardBreak": return "<br />";
79
80
  case "image": {
80
- let t = e.attrs?.src ?? "", r = e.attrs?.alt ?? "", a = Number(e.attrs?.width), o = Number(e.attrs?.height), s = `${Number.isFinite(a) && a > 0 ? ` width="${Math.round(a)}"` : ""}${Number.isFinite(o) && o > 0 ? ` height="${Math.round(o)}"` : ""}`;
81
- return n.test(t) ? `<img data-shared-attachment-src="${i(t)}" alt="${i(r)}"${s} />` : `<img src="${i(t)}" alt="${i(r)}"${s} />`;
81
+ let n = e.attrs?.src ?? "", i = e.attrs?.alt ?? "", o = t(e.attrs);
82
+ if (o) return `<p class="shared-emoji">${a(o)}</p>`;
83
+ let s = Number(e.attrs?.width), c = Number(e.attrs?.height), l = `${Number.isFinite(s) && s > 0 ? ` width="${Math.round(s)}"` : ""}${Number.isFinite(c) && c > 0 ? ` height="${Math.round(c)}"` : ""}`;
84
+ return r.test(n) ? `<img data-shared-attachment-src="${a(n)}" alt="${a(i)}"${l} />` : `<img src="${a(n)}" alt="${a(i)}"${l} />`;
82
85
  }
83
- default: return a;
86
+ default: return o;
84
87
  }
85
88
  };
86
- return (e.content ?? []).map(t).join("");
89
+ return (e.content ?? []).map(n).join("");
87
90
  }
88
- function u(e) {
91
+ function d(e) {
89
92
  return e.replace(/<li>(\s*<input\b[^>]*type=["']checkbox["'][^>]*>)/gi, "<li class=\"task-list-item\">$1");
90
93
  }
91
- function d(e, t = "") {
94
+ function f(e, t = "") {
92
95
  return {
93
96
  "x-share-token": e,
94
97
  ...t ? { "x-share-password": t } : {}
95
98
  };
96
99
  }
97
- async function f(e, t, n = "") {
100
+ async function p(e, t, n = "") {
98
101
  let r = [], i = e.querySelectorAll("img[data-shared-attachment-src]");
99
102
  return await Promise.all(Array.from(i, async (e) => {
100
103
  let i = e.dataset.sharedAttachmentSrc;
101
104
  if (i) try {
102
- let a = await fetch(i, { headers: d(t, n) });
105
+ let a = await fetch(i, { headers: f(t, n) });
103
106
  if (!a.ok) {
104
107
  e.dataset.sharedAttachmentError = String(a.status);
105
108
  return;
@@ -111,7 +114,7 @@ async function f(e, t, n = "") {
111
114
  }
112
115
  })), r;
113
116
  }
114
- async function p(e) {
117
+ async function m(e) {
115
118
  let t = Array.from(e.querySelectorAll("img"));
116
119
  await Promise.all(t.map(async (e) => {
117
120
  if (!e.complete) {
@@ -127,7 +130,7 @@ async function p(e) {
127
130
  }
128
131
  //#endregion
129
132
  //#region src/lib/extensions/shared-document-context.ts
130
- var m = /* @__PURE__ */ new Set([
133
+ var h = /* @__PURE__ */ new Set([
131
134
  "shareToken",
132
135
  "password",
133
136
  "passwordHash",
@@ -136,22 +139,22 @@ var m = /* @__PURE__ */ new Set([
136
139
  "cookie",
137
140
  "signingSecret"
138
141
  ]);
139
- function h(e) {
142
+ function g(e) {
140
143
  if (!e.id.trim() || !e.expiresAt.trim()) throw TypeError("Shared extension capability must include a non-empty id and expiry");
141
144
  return Object.freeze({
142
145
  id: e.id,
143
146
  expiresAt: e.expiresAt
144
147
  });
145
148
  }
146
- function g(e) {
147
- for (let t of Object.keys(e)) if (m.has(t)) throw TypeError(`Sensitive ${t} must not be provided to a shared extension`);
149
+ function _(e) {
150
+ for (let t of Object.keys(e)) if (h.has(t)) throw TypeError(`Sensitive ${t} must not be provided to a shared extension`);
148
151
  return Object.freeze({
149
152
  documentId: e.documentId,
150
153
  title: e.title,
151
154
  content: e.content,
152
155
  ...e.contentJson === void 0 ? {} : { contentJson: e.contentJson },
153
156
  role: e.role,
154
- capability: h(e.capability),
157
+ capability: g(e.capability),
155
158
  permissions: Object.freeze({
156
159
  read: !0,
157
160
  annotate: e.permissions.annotate,
@@ -162,68 +165,68 @@ function g(e) {
162
165
  }
163
166
  //#endregion
164
167
  //#region src/lib/hosts/DocsmintSharedDocumentHost.svelte
165
- var _ = t.from_html("<div data-docsmint-shared-document-host=\"\"><div data-extension-zone=\"shared-header-actions\"></div> <!> <div data-extension-zone=\"shared-document-tabs\"></div> <div data-extension-zone=\"shared-document-notes\"></div> <div data-extension-zone=\"shared-document-editor\"><!></div></div>");
166
- function v(n, r) {
167
- t.push(r, !0);
168
- let i = e(), a = t.derived(() => g(r.context));
168
+ var v = n.from_html("<div data-docsmint-shared-document-host=\"\"><div data-extension-zone=\"shared-header-actions\"></div> <!> <div data-extension-zone=\"shared-document-tabs\"></div> <div data-extension-zone=\"shared-document-notes\"></div> <div data-extension-zone=\"shared-document-editor\"><!></div></div>");
169
+ function y(t, r) {
170
+ n.push(r, !0);
171
+ let i = e(), a = n.derived(() => _(r.context));
169
172
  function o(e) {
170
- return e.permission === "annotate" ? t.get(a).permissions.annotate : t.get(a).permissions.edit;
173
+ return e.permission === "annotate" ? n.get(a).permissions.annotate : n.get(a).permissions.edit;
171
174
  }
172
175
  function s(e) {
173
- let n = /* @__PURE__ */ new Set();
176
+ let t = /* @__PURE__ */ new Set();
174
177
  return e.filter((e) => {
175
- if (n.has(e.id) || !o(e)) return !1;
176
- n.add(e.id);
178
+ if (t.has(e.id) || !o(e)) return !1;
179
+ t.add(e.id);
177
180
  try {
178
- return e.visible?.(t.get(a)) ?? !0;
181
+ return e.visible?.(n.get(a)) ?? !0;
179
182
  } catch {
180
183
  return !1;
181
184
  }
182
185
  }).sort((e, t) => (e.order ?? 0) - (t.order ?? 0) || e.id.localeCompare(t.id));
183
186
  }
184
- var c = _(), l = t.child(c);
185
- t.each(l, 21, () => s(i.sharedDocumentHeaderActions), (e) => e.id, (e, n) => {
186
- var r = t.comment(), i = t.first_child(r);
187
- t.component(i, () => t.get(n).component, (e, n) => {
188
- n(e, { get context() {
189
- return t.get(a);
187
+ var c = v(), l = n.child(c);
188
+ n.each(l, 21, () => s(i.sharedDocumentHeaderActions), (e) => e.id, (e, t) => {
189
+ var r = n.comment(), i = n.first_child(r);
190
+ n.component(i, () => n.get(t).component, (e, t) => {
191
+ t(e, { get context() {
192
+ return n.get(a);
190
193
  } });
191
- }), t.append(e, r);
192
- }), t.reset(l);
193
- var u = t.sibling(l, 2);
194
- t.snippet(u, () => r.children);
195
- var d = t.sibling(u, 2);
196
- t.each(d, 21, () => s(i.sharedDocumentTabs), (e) => e.id, (e, n) => {
197
- var r = t.comment(), i = t.first_child(r);
198
- t.component(i, () => t.get(n).component, (e, n) => {
199
- n(e, { get context() {
200
- return t.get(a);
194
+ }), n.append(e, r);
195
+ }), n.reset(l);
196
+ var u = n.sibling(l, 2);
197
+ n.snippet(u, () => r.children);
198
+ var d = n.sibling(u, 2);
199
+ n.each(d, 21, () => s(i.sharedDocumentTabs), (e) => e.id, (e, t) => {
200
+ var r = n.comment(), i = n.first_child(r);
201
+ n.component(i, () => n.get(t).component, (e, t) => {
202
+ t(e, { get context() {
203
+ return n.get(a);
201
204
  } });
202
- }), t.append(e, r);
203
- }), t.reset(d);
204
- var f = t.sibling(d, 2);
205
- t.each(f, 21, () => s(i.sharedDocumentNotesModes), (e) => e.id, (e, n) => {
206
- var r = t.comment(), i = t.first_child(r);
207
- t.component(i, () => t.get(n).component, (e, n) => {
208
- n(e, { get context() {
209
- return t.get(a);
205
+ }), n.append(e, r);
206
+ }), n.reset(d);
207
+ var f = n.sibling(d, 2);
208
+ n.each(f, 21, () => s(i.sharedDocumentNotesModes), (e) => e.id, (e, t) => {
209
+ var r = n.comment(), i = n.first_child(r);
210
+ n.component(i, () => n.get(t).component, (e, t) => {
211
+ t(e, { get context() {
212
+ return n.get(a);
210
213
  } });
211
- }), t.append(e, r);
212
- }), t.reset(f);
213
- var p = t.sibling(f, 2), m = t.child(p), h = (e) => {
214
- var n = t.comment(), r = t.first_child(n);
215
- t.each(r, 17, () => s(i.sharedDocumentEditorModes), (e) => e.id, (e, n) => {
216
- var r = t.comment(), i = t.first_child(r);
217
- t.component(i, () => t.get(n).component, (e, n) => {
218
- n(e, { get context() {
219
- return t.get(a);
214
+ }), n.append(e, r);
215
+ }), n.reset(f);
216
+ var p = n.sibling(f, 2), m = n.child(p), h = (e) => {
217
+ var t = n.comment(), r = n.first_child(t);
218
+ n.each(r, 17, () => s(i.sharedDocumentEditorModes), (e) => e.id, (e, t) => {
219
+ var r = n.comment(), i = n.first_child(r);
220
+ n.component(i, () => n.get(t).component, (e, t) => {
221
+ t(e, { get context() {
222
+ return n.get(a);
220
223
  } });
221
- }), t.append(e, r);
222
- }), t.append(e, n);
224
+ }), n.append(e, r);
225
+ }), n.append(e, t);
223
226
  };
224
- t.if(m, (e) => {
225
- t.get(a).permissions.edit && e(h);
226
- }), t.reset(p), t.reset(c), t.append(n, c), t.pop();
227
+ n.if(m, (e) => {
228
+ n.get(a).permissions.edit && e(h);
229
+ }), n.reset(p), n.reset(c), n.append(t, c), n.pop();
227
230
  }
228
231
  //#endregion
229
- export { v as DocsmintSharedDocumentHost, f as hydrateSharedAttachmentImages, u as markMarkdownTaskItems, l as renderSharedDocument, d as sharedAttachmentHeaders, p as waitForSharedDocumentImages };
232
+ export { y as DocsmintSharedDocumentHost, p as hydrateSharedAttachmentImages, d as markMarkdownTaskItems, u as renderSharedDocument, f as sharedAttachmentHeaders, m as waitForSharedDocumentImages };
@@ -1,7 +1,7 @@
1
- import { t as e } from "./utils-CDBqTgoV.js";
1
+ import { t as e } from "./utils-CMQRlxbx.js";
2
2
  import "svelte/internal/disclose-version";
3
3
  import * as t from "svelte/internal/client";
4
- //#region ../node_modules/.bun/@hiai-gg+hiai-ui@0.0.8+8f2b9fada26e5f3b/node_modules/@hiai-gg/hiai-ui/dist/components/ui/textarea/textarea.svelte
4
+ //#region ../node_modules/.bun/@hiai-gg+hiai-ui@0.1.3+8f2b9fada26e5f3b/node_modules/@hiai-gg/hiai-ui/dist/components/ui/textarea/textarea.svelte
5
5
  var n = /* @__PURE__ */ new Set([
6
6
  "$$slots",
7
7
  "$$events",
@@ -1,4 +1,4 @@
1
- import { t as e } from "./theme.svelte-DKfCy12k.js";
1
+ import { t as e } from "./theme.svelte-DG3RS7wv.js";
2
2
  //#region ../packages/sdk/frontend-entries/theme.ts
3
3
  var t = e, n = e.set;
4
4
  function r() {
@@ -0,0 +1,101 @@
1
+ import * as e from "svelte/internal/client";
2
+ import { tick as t } from "svelte";
3
+ import { browser as n } from "$app/environment";
4
+ //#region ../node_modules/.bun/@hiai-gg+hiai-ui@0.1.3+8f2b9fada26e5f3b/node_modules/@hiai-gg/hiai-ui/dist/lib/theme-spread.js
5
+ function r() {
6
+ return typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
7
+ }
8
+ function i(e) {
9
+ let t = document.documentElement;
10
+ if (!e) {
11
+ t.style.removeProperty("--click-x"), t.style.removeProperty("--click-y");
12
+ return;
13
+ }
14
+ t.style.setProperty("--click-x", `${Math.round(e.x)}px`), t.style.setProperty("--click-y", `${Math.round(e.y)}px`);
15
+ }
16
+ async function a(e, t) {
17
+ if (typeof document > "u") {
18
+ await e();
19
+ return;
20
+ }
21
+ let n = document.startViewTransition;
22
+ if (!t || !n || r()) {
23
+ await e();
24
+ return;
25
+ }
26
+ let a = document.documentElement;
27
+ i(t), a.classList.add("theme-spread-active");
28
+ try {
29
+ await n(async () => {
30
+ await e();
31
+ }).finished;
32
+ } catch {
33
+ await e();
34
+ } finally {
35
+ a.classList.remove("theme-spread-active"), i();
36
+ }
37
+ }
38
+ //#endregion
39
+ //#region src/lib/stores/theme.svelte.ts
40
+ var o = "hiai-docs-theme", s = /* @__PURE__ */ new Set();
41
+ function c() {
42
+ if (!n) return "system";
43
+ let e = localStorage.getItem(o);
44
+ return e === "light" || e === "dark" || e === "system" ? e : "system";
45
+ }
46
+ function l() {
47
+ return n ? window.matchMedia("(prefers-color-scheme: dark)").matches : !1;
48
+ }
49
+ function u(e) {
50
+ return e === "dark" ? !0 : e === "light" ? !1 : l();
51
+ }
52
+ function d(e) {
53
+ if (!n) return;
54
+ let t = u(e);
55
+ document.documentElement.classList.toggle("dark", t);
56
+ let r = document.querySelector("#app-favicon");
57
+ r && (r.href = t ? "/favicon_white.ico" : "/favicon.ico");
58
+ }
59
+ function f() {
60
+ for (let e of s) e();
61
+ }
62
+ var p = e.state("system"), m = e.state(!1), h = !1;
63
+ function g() {
64
+ if (!n || h) return;
65
+ h = !0, e.set(p, c(), !0), e.set(m, u(e.get(p)), !0), d(e.get(p));
66
+ let t = window.matchMedia("(prefers-color-scheme: dark)");
67
+ t.addEventListener("change", () => {
68
+ e.get(p) === "system" && (e.set(m, t.matches, !0), d("system"), f());
69
+ });
70
+ }
71
+ function _(t) {
72
+ e.set(p, t, !0), n && localStorage.setItem(o, t), e.set(m, u(t), !0), d(t), f();
73
+ }
74
+ async function v(r, i) {
75
+ if (!n) {
76
+ _(r);
77
+ return;
78
+ }
79
+ if (e.get(p) !== r) {
80
+ if (u(e.get(p)) === u(r) || !i) {
81
+ _(r);
82
+ return;
83
+ }
84
+ await a(async () => {
85
+ _(r), await t();
86
+ }, i);
87
+ }
88
+ }
89
+ var y = {
90
+ get value() {
91
+ return e.get(p);
92
+ },
93
+ get isDark() {
94
+ return e.get(m);
95
+ },
96
+ init: g,
97
+ set: _,
98
+ spread: v
99
+ };
100
+ //#endregion
101
+ export { y as t };
@@ -1,5 +1,5 @@
1
1
  import { n as e, r as t } from "./bundle-mjs-DllmqUxV.js";
2
- //#region ../node_modules/.bun/@hiai-gg+hiai-ui@0.0.8+8f2b9fada26e5f3b/node_modules/@hiai-gg/hiai-ui/dist/lib/utils.js
2
+ //#region ../node_modules/.bun/@hiai-gg+hiai-ui@0.1.3+8f2b9fada26e5f3b/node_modules/@hiai-gg/hiai-ui/dist/lib/utils.js
3
3
  function n(...n) {
4
4
  return e(t(n));
5
5
  }
@@ -1,7 +1,8 @@
1
- import { E as scroll_to_top_aria } from "./assets/messages-BAQzILs4.js";
1
+ import { E as scroll_to_top_aria } from "./assets/messages-B1TjVIH8.js";
2
2
  import { t as Icon } from "./assets/Icon-QwirKi9Y.js";
3
- import { n as searchPreferences } from "./assets/SettingsDialog-CIVbMKmf.js";
4
- import { t as Sidebar } from "./assets/Sidebar-Bb-k2R-Z.js";
3
+ import { n as provideDocsmintShareAdapter, t as getDocsmintShareAdapter } from "./assets/confirm-dialog-wYC07DPx.js";
4
+ import { n as searchPreferences } from "./assets/SettingsDialog-DDy0hN8x.js";
5
+ import { t as Sidebar } from "./assets/Sidebar-Dy-5gXOf.js";
5
6
  import { o as provideDocsmintRequestAdapter, r as provideDocsmintRouteAdapter } from "./assets/route-context-BPRerEtZ.js";
6
7
  import { t as editorPreferences } from "./assets/editor-preferences.svelte-iI5jJM1x.js";
7
8
  import { d as refreshFolders } from "./assets/subfolders-refresh-store.svelte-CXHxQWKh.js";
@@ -315,7 +316,7 @@ function getDocsmintRealtimeAdapter() {
315
316
  //#region src/lib/hosts/DocsmintAppShellHost.svelte
316
317
  function DocsmintAppShellHost($$renderer, $$props) {
317
318
  $$renderer.component(($$renderer) => {
318
- const { route, request = { fetch }, realtime, extensions = {}, children } = $$props;
319
+ const { route, request = { fetch }, realtime, share, extensions = {}, children } = $$props;
319
320
  provideDocsmintRouteAdapter({
320
321
  get pathname() {
321
322
  return route.pathname;
@@ -335,6 +336,9 @@ function DocsmintAppShellHost($$renderer, $$props) {
335
336
  } });
336
337
  const realtimeAdapter = untrack(() => realtime);
337
338
  if (realtimeAdapter) provideDocsmintRealtimeAdapter(realtimeAdapter);
339
+ provideDocsmintShareAdapter({ get displayMode() {
340
+ return share?.displayMode ?? "standalone";
341
+ } });
338
342
  editorPreferences.init();
339
343
  searchPreferences.init();
340
344
  let mainElement = null;
@@ -407,4 +411,4 @@ function DocsmintAppShellHost($$renderer, $$props) {
407
411
  });
408
412
  }
409
413
  //#endregion
410
- export { DocsmintAppShellHost, getDocsmintRealtimeAdapter };
414
+ export { DocsmintAppShellHost, getDocsmintRealtimeAdapter, getDocsmintShareAdapter };