@hiai-gg/docsmint 0.5.7 → 0.5.10

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 (29) hide show
  1. package/dist/backend/index.js +12 -5
  2. package/dist/frontend/{CategoryDialog-BYAFjX7E.js → CategoryDialog-CbXBMBZB.js} +3 -3
  3. package/dist/frontend/{Sidebar-B-zCJT9i.js → Sidebar-CzcLd6v5.js} +13 -13
  4. package/dist/frontend/app-shell.js +102 -46
  5. package/dist/frontend/components/category-dialog.js +1 -1
  6. package/dist/frontend/components/editor/document-editor.js +974 -1033
  7. package/dist/frontend/components/editor/extensions.js +1 -1
  8. package/dist/frontend/components/editor/markdown-toggle.js +1 -1
  9. package/dist/frontend/components/editor/markdown.js +1 -1
  10. package/dist/frontend/components/sidebar.js +1 -1
  11. package/dist/frontend/{editorExtensions-BMHvUbdk.js → editorExtensions-BmINh76i.js} +1373 -1294
  12. package/dist/frontend/frontend.css +1 -1
  13. package/dist/frontend/{markdown-BwnyjITU.js → markdown-A5xji16P.js} +1 -1
  14. package/dist/frontend/search.js +3 -3
  15. package/dist/frontend-ssr/app-shell.js +44 -1
  16. package/dist/frontend-ssr/assets/{CategoryDialog-BLxVoynx.js → CategoryDialog-QHEv_9N4.js} +4 -4
  17. package/dist/frontend-ssr/assets/{Sidebar-CO9LZRPa.js → Sidebar-CqsMw0Hd.js} +16 -16
  18. package/dist/frontend-ssr/assets/{editorExtensions-DUzwndMy.js → editorExtensions-BwGeSPuX.js} +101 -2
  19. package/dist/frontend-ssr/assets/{markdown-CjqvGi5W.js → markdown-CB8DZ-LT.js} +1 -1
  20. package/dist/frontend-ssr/components/category-dialog.js +1 -1
  21. package/dist/frontend-ssr/components/editor/document-editor.js +2 -79
  22. package/dist/frontend-ssr/components/editor/extensions.js +1 -1
  23. package/dist/frontend-ssr/components/editor/markdown-toggle.js +1 -1
  24. package/dist/frontend-ssr/components/editor/markdown.js +1 -1
  25. package/dist/frontend-ssr/components/sidebar.js +1 -1
  26. package/dist/frontend-ssr/search.js +2 -2
  27. package/package.json +1 -1
  28. package/packages/cli/src/index.ts +1 -1
  29. package/packages/mcp-server/src/index.ts +1 -1
@@ -194469,11 +194469,17 @@ async function reembedDocsInFolder(folderId, ownerId, workspaceId) {
194469
194469
  return enqueued;
194470
194470
  }
194471
194471
  async function reembedDocsInFolderAdmin(folderId) {
194472
- const limit = config3.FOLDER_REEMBED_BATCH_SIZE;
194473
- const rows = await withTenant(REEMBED_ADMIN_TENANT, (tx) => {
194472
+ return reembedDocsInFolderAdminWith(folderId, loadAdminFolderDocumentIds);
194473
+ }
194474
+ async function loadAdminFolderDocumentIds(folderId, limit) {
194475
+ return withTenant(REEMBED_ADMIN_TENANT, (tx) => {
194474
194476
  const query = tx.select({ id: documents.id }).from(documents).where(eq(documents.folderId, folderId));
194475
194477
  return limit > 0 ? query.limit(limit) : query;
194476
194478
  });
194479
+ }
194480
+ async function reembedDocsInFolderAdminWith(folderId, loadRows) {
194481
+ const limit = config3.FOLDER_REEMBED_BATCH_SIZE;
194482
+ const rows = await loadRows(folderId, limit);
194477
194483
  const enqueued = await enqueueReembed(rows.map((r4) => r4.id));
194478
194484
  if (enqueued > 0) {
194479
194485
  logger3.info({ folderId, enqueued, limit, scope: "admin" }, "Re-embedding documents after admin folder reindex");
@@ -230336,6 +230342,7 @@ async function searchDocuments(ctx, request, adapters = {}) {
230336
230342
  const embeddingProvider = adapters.getEmbedding ?? getEmbedding;
230337
230343
  const expand2 = adapters.expand ?? expandQuery;
230338
230344
  const retrieveGraph = adapters.retrieveGraph ?? retrieveGraphCandidates;
230345
+ const filterRanked = adapters.filterRanked ?? applySearchFilters;
230339
230346
  const channelErrors = {};
230340
230347
  const embeddingCache = new Map;
230341
230348
  const getCachedEmbedding = (text4) => {
@@ -230473,7 +230480,7 @@ async function searchDocuments(ctx, request, adapters = {}) {
230473
230480
  });
230474
230481
  const filters = request.filters;
230475
230482
  const hasFilters = Boolean(filters && Object.values(filters).some((value) => Array.isArray(value) ? value.length > 0 : value !== undefined));
230476
- const filtered = hasFilters ? await applySearchFilters(ctx, ranked, filters, request.visibilityScope) : ranked;
230483
+ const filtered = hasFilters || request.visibilityScope !== undefined ? await filterRanked(ctx, ranked, filters ?? {}, request.visibilityScope) : ranked;
230477
230484
  const offset = (page - 1) * limit;
230478
230485
  const items = filtered.slice(offset, offset + limit);
230479
230486
  const graphContribution = items.some((item) => item.channels.includes("graph"));
@@ -230577,7 +230584,7 @@ async function applySearchFilters(ctx, items, filters, visibilityScope) {
230577
230584
  folderOwnerId: folders.ownerId,
230578
230585
  title: documents.title,
230579
230586
  createdAt: documents.createdAt
230580
- }).from(documents).leftJoin(folders, and(eq(folders.id, documents.folderId), eq(folders.ownerId, ctx.userId))).where(and(visibility, inArray(documents.id, ids))));
230587
+ }).from(documents).leftJoin(folders, and(eq(folders.id, documents.folderId), eq(folders.ownerId, ctx.userId))).where(and(visibility, isNull(documents.deletedAt), inArray(documents.id, ids))));
230581
230588
  const byId = new Map(rows.map((row) => [row.id, row]));
230582
230589
  let filtered = items.filter((item) => {
230583
230590
  const row = byId.get(item.documentId);
@@ -234279,7 +234286,7 @@ var swaggerConfig = {
234279
234286
  },
234280
234287
  info: {
234281
234288
  title: "DocsMint API",
234282
- version: "0.5.7",
234289
+ version: "0.5.10",
234283
234290
  description: "Self-hosted AI-first documentation platform. Full-text + semantic search, version history, sharing, and folder organization.",
234284
234291
  contact: { name: "HiAi-gg", url: "https://github.com/HiAi-gg/docsmint" },
234285
234292
  license: {
@@ -26,7 +26,7 @@ function S(e, t) {
26
26
  }
27
27
  //#endregion
28
28
  //#region src/lib/components/sidebar/CategoryDialog.svelte
29
- var _e = x.from_html("<span class=\"font-medium text-foreground\"> </span> ", 1), ve = x.from_html("Delete <span class=\"font-medium text-foreground\"> </span> ", 1), C = x.from_html("<!> <!>", 1), ye = x.from_html("<div class=\"flex items-start gap-3 rounded-lg border border-primary/30 bg-primary/10 p-4\" role=\"status\" aria-live=\"polite\"><!> <div><p class=\"text-sm font-medium text-foreground\"> </p> <p class=\"text-sm text-muted-foreground\"><span class=\"font-medium text-foreground\"> </span> </p></div></div>"), be = x.from_html("<!> Copy API key", 1), xe = x.from_html("<div class=\"rounded-md border border-primary/20 bg-background/80 p-3\"><p class=\"text-xs font-medium text-foreground\">Copy the API key now. It remains available in Settings → API.</p> <code class=\"mt-2 block break-all rounded bg-muted p-2 text-xs text-foreground\"> </code> <!></div>"), w = x.from_html("<p class=\"text-xs text-destructive\" role=\"alert\"> </p>"), Se = x.from_html("<div class=\"space-y-3 rounded-lg border border-primary/30 bg-primary/10 p-4\" role=\"status\" aria-live=\"polite\"><div class=\"flex items-start gap-3\"><!> <div><p class=\"text-sm font-medium text-foreground\">Category created</p> <p class=\"text-sm text-muted-foreground\"> </p></div></div> <!> <!></div>"), Ce = x.from_html("<p id=\"category-dialog-name-error\" class=\"text-xs text-destructive\" role=\"alert\"> </p>"), T = x.from_html("<!> <!> <!>", 1), we = x.from_html("<div class=\"space-y-3 rounded-md border border-border/70 bg-muted/30 p-3\"><div class=\"flex flex-wrap items-center justify-between gap-2\"><!> <div class=\"flex flex-wrap gap-2\"><!> <!></div></div> <div class=\"grid gap-2 sm:grid-cols-3\"><label class=\"flex items-center gap-2 rounded-md border border-border/60 bg-background px-3 py-2 text-sm\"><input type=\"checkbox\" class=\"size-4 rounded border-input\"/> <span>Read</span></label> <label class=\"flex items-center gap-2 rounded-md border border-border/60 bg-background px-3 py-2 text-sm\"><input type=\"checkbox\" class=\"size-4 rounded border-input\"/> <span>Edit</span></label> <label class=\"flex items-center gap-2 rounded-md border border-border/60 bg-background px-3 py-2 text-sm\"><input type=\"checkbox\" class=\"size-4 rounded border-input\"/> <span>Write</span></label></div></div>"), Te = x.from_html("<div class=\"rounded-lg border border-primary/30 bg-primary/10 p-3 text-primary\"><p class=\"text-xs font-medium\">Copy now — this raw key is shown once.</p> <code class=\"mt-1 block break-all rounded bg-background/80 p-2 text-xs text-foreground\"> </code> <!></div>"), Ee = x.from_html("<div class=\"flex items-center justify-between gap-3 rounded-md bg-muted/40 px-3 py-2 text-xs\"><span> </span> <div class=\"flex shrink-0 gap-2\"><!> <!></div></div>"), De = x.from_html("<div class=\"space-y-3 rounded-md border border-border/70 p-3\"><div class=\"flex items-center justify-between gap-2\"><div><!><p class=\"text-xs text-muted-foreground\">The current permissions are saved before the key is issued.</p></div> <!></div> <!> <div class=\"max-h-48 space-y-2 overflow-y-auto pr-1\"></div></div>"), Oe = x.from_html("<form class=\"space-y-4\"><div class=\"space-y-2\"><!> <!> <!></div> <div class=\"space-y-2\"><!> <!></div> <!> <!></form>"), ke = x.from_html("<!> ", 1);
29
+ var _e = x.from_html("<span class=\"font-medium text-foreground\"> </span> ", 1), ve = x.from_html("Delete <span class=\"font-medium text-foreground\"> </span> ", 1), C = x.from_html("<!> <!>", 1), ye = x.from_html("<div class=\"flex items-start gap-3 rounded-lg border border-primary/30 bg-primary/10 p-4\" role=\"status\" aria-live=\"polite\"><!> <div><p class=\"text-sm font-medium text-foreground\"> </p> <p class=\"text-sm text-muted-foreground\"><span class=\"font-medium text-foreground\"> </span> </p></div></div>"), be = x.from_html("<!> Copy API key", 1), xe = x.from_html("<div class=\"rounded-md border border-primary/20 bg-background/80 p-3\"><p class=\"text-xs font-medium text-foreground\">Copy the API key now. It remains available in Settings → API.</p> <code class=\"mt-2 block break-all rounded bg-muted p-2 text-xs text-foreground\"> </code> <!></div>"), w = x.from_html("<p class=\"text-xs text-destructive\" role=\"alert\"> </p>"), Se = x.from_html("<div class=\"space-y-3 rounded-lg border border-primary/30 bg-primary/10 p-4\" role=\"status\" aria-live=\"polite\"><div class=\"flex items-start gap-3\"><!> <div><p class=\"text-sm font-medium text-foreground\">Category created</p> <p class=\"text-sm text-muted-foreground\"> </p></div></div> <!> <!></div>"), Ce = x.from_html("<p id=\"category-dialog-name-error\" class=\"text-xs text-destructive\" role=\"alert\"> </p>"), T = x.from_html("<!> <!> <!>", 1), we = x.from_html("<div class=\"space-y-3 rounded-md border border-border/70 bg-muted/30 p-3\"><div class=\"flex flex-wrap items-center justify-between gap-2\"><!> <div class=\"flex flex-wrap gap-2\"><!> <!></div></div> <div class=\"grid gap-2 sm:grid-cols-3\"><label class=\"flex items-center gap-2 rounded-md border border-border/60 bg-background px-3 py-2 text-sm\"><input type=\"checkbox\" class=\"size-4 rounded border-input\"/> <span>Read</span></label> <label class=\"flex items-center gap-2 rounded-md border border-border/60 bg-background px-3 py-2 text-sm\"><input type=\"checkbox\" class=\"size-4 rounded border-input\"/> <span>Edit</span></label> <label class=\"flex items-center gap-2 rounded-md border border-border/60 bg-background px-3 py-2 text-sm\"><input type=\"checkbox\" class=\"size-4 rounded border-input\"/> <span>Write</span></label></div></div>"), Te = x.from_html("<div class=\"rounded-lg border border-primary/30 bg-primary/10 p-3 text-primary\"><p class=\"text-xs font-medium\">Copy now — this raw key is shown once.</p> <code class=\"mt-1 block break-all rounded bg-background/80 p-2 text-xs text-foreground\"> </code> <!></div>"), Ee = x.from_html("<div class=\"flex items-center justify-between gap-3 rounded-md bg-muted/40 px-3 py-2 text-xs\"><span> </span> <div class=\"flex shrink-0 gap-2\"><!> <!></div></div>"), De = x.from_html("<div class=\"space-y-3 rounded-md border border-border/70 p-3\"><div class=\"flex items-center justify-between gap-2 max-sm:flex-col max-sm:items-stretch\"><div><!> <p class=\"text-xs text-muted-foreground\">The current permissions are saved before the key is issued.</p></div> <!></div> <!> <div class=\"max-h-48 space-y-2 overflow-y-auto pr-1\"></div></div>"), Oe = x.from_html("<form data-category-dialog-scroll=\"\" class=\"max-h-[calc(100dvh-12rem)] space-y-4 overflow-y-auto overscroll-contain pr-1\"><div class=\"space-y-2\"><!> <!> <!></div> <div class=\"space-y-2\"><!> <!></div> <!> <!></form>"), ke = x.from_html("<!> ", 1);
30
30
  function E(E, D) {
31
31
  x.push(D, !0);
32
32
  let O = {
@@ -215,7 +215,7 @@ function E(E, D) {
215
215
  var a = x.sibling(r);
216
216
  x.template_effect((e) => {
217
217
  x.set_text(i, `“${D.category?.name ?? "Category" ?? ""}”`), x.set_text(a, `?
218
- ${e ?? ""}`);
218
+ ${e ?? ""}`);
219
219
  }, [() => c()]), x.append(e, n);
220
220
  },
221
221
  $$slots: { default: !0 }
@@ -475,7 +475,7 @@ function E(E, D) {
475
475
  x.append(e, n);
476
476
  },
477
477
  $$slots: { default: !0 }
478
- }), x.next(), x.reset(r);
478
+ }), x.next(2), x.reset(r);
479
479
  var i = x.sibling(r, 2);
480
480
  {
481
481
  let e = x.derived(() => x.get(N) || x.get(V) || !x.get(q) || !x.get(Y));
@@ -26,7 +26,7 @@ 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
28
  import { t as Qe } from "./ShareDialog-BC-Jl6v1.js";
29
- import { t as $e } from "./CategoryDialog-BYAFjX7E.js";
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";
32
32
  import { t as mt } from "./FolderNode-DAAn_T8_.js";
@@ -162,7 +162,7 @@ var At = (e, t = V.noop) => {
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
- V.set_attribute(n, "href", `/docs/${t().id}`), V.set_class(n, 1, e), V.set_text(a, t().title);
165
+ V.set_attribute(n, "href", `/docs/${t().id}`), V.set_class(n, 1, e, "svelte-1nshngr"), V.set_text(a, t().title);
166
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
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
168
  function Kt(e, i) {
@@ -180,11 +180,11 @@ function Kt(e, i) {
180
180
  V.attribute_effect(r, (e, t) => ({
181
181
  ...n(),
182
182
  type: "button",
183
- 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/doc:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
183
+ class: "sidebar-touch-action inline-flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-accent-foreground group-hover/doc:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
184
184
  "aria-label": e,
185
185
  title: t,
186
186
  onclick: i
187
- }), [() => C(), () => C()]), ee(V.child(r), { class: "size-3.5" }), V.reset(r), V.append(e, r);
187
+ }), [() => C(), () => C()], void 0, void 0, "svelte-1nshngr"), 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), {
@@ -236,7 +236,7 @@ function Kt(e, i) {
236
236
  V.if(i, (e) => {
237
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(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;
239
+ V.set_class(r, 1, `sidebar-touch-action inline-flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-accent-foreground group-hover/doc:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${V.get(cn) === n().id || V.get(ln) === n().id ? "opacity-100" : ""}`, "svelte-1nshngr"), V.set_attribute(r, "aria-label", e), V.set_attribute(r, "title", t), r.disabled = V.get(ln) === n().id;
240
240
  }, [() => re(), () => re()]), V.delegated("click", r, (e) => {
241
241
  e.preventDefault(), e.stopPropagation(), dn(n().id);
242
242
  }), V.append(e, r);
@@ -875,7 +875,7 @@ function Kt(e, i) {
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
- }), [() => C(), () => C()]), ee(V.child(r), { class: "size-3.5" }), V.reset(r), V.append(e, r);
878
+ }), [() => C(), () => C()], void 0, void 0, "svelte-1nshngr"), 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), {
@@ -980,7 +980,7 @@ function Kt(e, i) {
980
980
  useCursorForDetection: !0,
981
981
  centreDraggedOnCursor: !0
982
982
  })), V.reset(i), V.template_effect((e, t) => {
983
- V.set_class(o, 1, e), V.set_class(d, 1, t);
983
+ V.set_class(o, 1, e, "svelte-1nshngr"), V.set_class(d, 1, t, "svelte-1nshngr");
984
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) {
@@ -994,7 +994,7 @@ function Kt(e, i) {
994
994
  V.if(y, (e) => {
995
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(v, V.get(t).category.name);
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, "svelte-1nshngr"), V.set_text(v, V.get(t).category.name);
998
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
999
  V.get(I) && !V.get(i) && hn(V.get(t).id);
1000
1000
  }), V.event("mouseleave", l, () => {
@@ -1046,7 +1046,7 @@ function Kt(e, i) {
1046
1046
  useCursorForDetection: !0,
1047
1047
  centreDraggedOnCursor: !0
1048
1048
  })), V.reset(n), V.template_effect((e, t) => {
1049
- V.set_class(r, 1, e), V.set_class(s, 1, t);
1049
+ V.set_class(r, 1, e, "svelte-1nshngr"), V.set_class(s, 1, t, "svelte-1nshngr");
1050
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) {
@@ -1060,7 +1060,7 @@ function Kt(e, i) {
1060
1060
  V.if(m, (e) => {
1061
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(D)), V.set_class(o, 1, e), V.set_text(p, t);
1063
+ V.set_attribute(o, "aria-expanded", V.get(D)), V.set_class(o, 1, e, "svelte-1nshngr"), V.set_text(p, t);
1064
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
1065
  V.get(I) && !V.get(D) && hn($);
1066
1066
  }), V.event("mouseleave", o, () => {
@@ -1433,11 +1433,11 @@ function Zt(e, n) {
1433
1433
  V.attribute_effect(r, (e, t) => ({
1434
1434
  ...n(),
1435
1435
  type: "button",
1436
- 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/doc:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
1436
+ class: "sidebar-touch-action inline-flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-accent-foreground group-hover/doc:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
1437
1437
  "aria-label": e,
1438
1438
  title: t,
1439
1439
  onclick: i
1440
- }), [() => C(), () => C()]), ee(V.child(r), { class: "size-3.5" }), V.reset(r), V.append(e, r);
1440
+ }), [() => C(), () => C()], void 0, void 0, "svelte-1uwxs9f"), ee(V.child(r), { class: "size-3.5" }), V.reset(r), V.append(e, r);
1441
1441
  },
1442
1442
  $$slots: { child: !0 }
1443
1443
  }), h(V.sibling(i, 2), {
@@ -1468,7 +1468,7 @@ function Zt(e, n) {
1468
1468
  },
1469
1469
  $$slots: { default: !0 }
1470
1470
  }), V.reset(r), V.template_effect((e, t, r) => {
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
+ V.set_attribute(i, "href", `/docs/${V.get(n).id}`), V.set_class(i, 1, e, "svelte-1uwxs9f"), V.set_text(p, V.get(n).title), V.set_text(v, V.get(n).updatedAt), V.set_class(y, 1, `sidebar-touch-action inline-flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-accent-foreground group-hover/doc:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${V.get(l) === V.get(n).id || V.get(u) === V.get(n).id ? "opacity-100" : ""}`, "svelte-1uwxs9f"), V.set_attribute(y, "aria-label", t), V.set_attribute(y, "title", r), y.disabled = V.get(u) === V.get(n).id;
1472
1472
  }, [
1473
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
1474
  () => re(),
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "./Icon-Db-o32_E.js";
2
2
  import { n as t, r as n } from "./SettingsDialog-CyZSOjLE.js";
3
- import { t as r } from "./Sidebar-B-zCJT9i.js";
3
+ import { t as r } from "./Sidebar-CzcLd6v5.js";
4
4
  import { D as i } from "./messages-DIovIZrK.js";
5
5
  import { o as a, r as o } from "./route-context-DYQlUfzL.js";
6
6
  import { d as s } from "./subfolders-refresh-store.svelte-DxP21a1c.js";
@@ -67,12 +67,15 @@ var v = d.state(!1), y = {
67
67
  }
68
68
  };
69
69
  function b() {
70
+ d.set(v, !0);
71
+ }
72
+ function x() {
70
73
  d.set(v, !1);
71
74
  }
72
75
  //#endregion
73
76
  //#region src/lib/components/MobileSidebarToggle.svelte
74
- var x = d.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>");
75
- function S(e, t) {
77
+ var S = d.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>");
78
+ function C(e, t) {
76
79
  d.push(t, !0);
77
80
  let n = d.prop(t, "buttonRef", 15, null), r = d.prop(t, "controls", 3, "mobile-navigation"), i = d.state(!1);
78
81
  function a() {
@@ -95,7 +98,7 @@ function S(e, t) {
95
98
  y.toggle();
96
99
  }
97
100
  var s = d.comment(), c = d.first_child(s), l = (e) => {
98
- var t = x();
101
+ var t = S();
99
102
  _(d.child(t), { class: "size-5" }), d.reset(t), d.bind_this(t, (e) => n(e), () => n()), d.template_effect(() => {
100
103
  d.set_attribute(t, "aria-label", y.open ? "Close navigation menu" : "Open navigation menu"), d.set_attribute(t, "aria-expanded", y.open), d.set_attribute(t, "aria-controls", r());
101
104
  }), d.delegated("click", t, o), d.append(e, t);
@@ -107,8 +110,8 @@ function S(e, t) {
107
110
  d.delegate(["click"]);
108
111
  //#endregion
109
112
  //#region src/lib/components/ScrollToTop.svelte
110
- var C = d.from_html("<button type=\"button\"><!></button>");
111
- function w(e, t) {
113
+ var w = d.from_html("<button type=\"button\"><!></button>");
114
+ function T(e, t) {
112
115
  d.push(t, !0);
113
116
  let n = d.prop(t, "avoidEditorToolbar", 3, !1), r = d.state(!1), a = null, o = d.state("none"), s = d.state(void 0);
114
117
  function c() {
@@ -169,7 +172,7 @@ function w(e, t) {
169
172
  t.disconnect(), r.disconnect(), window.removeEventListener("resize", e);
170
173
  };
171
174
  });
172
- var m = C();
175
+ var m = w();
173
176
  let h, _;
174
177
  g(d.child(m), { class: "size-5" }), d.reset(m), d.template_effect((e, t) => {
175
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, {
@@ -180,22 +183,44 @@ function w(e, t) {
180
183
  }
181
184
  d.delegate(["click"]);
182
185
  //#endregion
186
+ //#region src/lib/stores/mobile-sidebar-gesture.ts
187
+ function E(e = {}) {
188
+ let t = e.edgeWidth ?? 36, n = e.openDistance ?? 40, r = e.scrollTolerance ?? 12, i = null, a = !1;
189
+ return {
190
+ start(e) {
191
+ return i = e.x <= t ? e : null, a = !1, i ? "tracking" : "idle";
192
+ },
193
+ move(e) {
194
+ if (!i || a) return a ? "cancelled" : "idle";
195
+ let t = e.x - i.x, o = Math.abs(e.y - i.y);
196
+ return o > r && o > Math.abs(t) ? (a = !0, "cancelled") : t >= n && o <= Math.max(r * 2, t) ? (i = null, "open") : "tracking";
197
+ },
198
+ end(e) {
199
+ let t = this.move(e);
200
+ return i = null, a = !1, t === "open" ? "open" : "idle";
201
+ },
202
+ cancel() {
203
+ i = null, a = !1;
204
+ }
205
+ };
206
+ }
207
+ //#endregion
183
208
  //#region src/lib/hosts/mutation-refresh.ts
184
- var T = {
209
+ var D = {
185
210
  documents: !1,
186
211
  folders: !1,
187
212
  tags: !1
188
213
  };
189
- function E(e, t) {
214
+ function O(e, t) {
190
215
  let n = (t?.method ?? (e instanceof Request ? e.method : "GET")).toUpperCase();
191
216
  if (![
192
217
  "POST",
193
218
  "PUT",
194
219
  "PATCH",
195
220
  "DELETE"
196
- ].includes(n)) return T;
221
+ ].includes(n)) return D;
197
222
  let r = typeof e == "string" ? e : e instanceof URL ? e.href : e.url, i = new URL(r, "http://docsmint.local").pathname;
198
- return /\/keys(?:\/|$)/.test(i) ? T : /^\/api\/(?:v1\/)?tags(?:\/|$)/.test(i) || /^\/api\/(?:v1\/)?documents\/[^/]+\/tags(?:\/|$)/.test(i) ? {
223
+ return /\/keys(?:\/|$)/.test(i) ? D : /^\/api\/(?:v1\/)?tags(?:\/|$)/.test(i) || /^\/api\/(?:v1\/)?documents\/[^/]+\/tags(?:\/|$)/.test(i) ? {
199
224
  documents: !0,
200
225
  folders: !1,
201
226
  tags: !0
@@ -203,24 +228,24 @@ function E(e, t) {
203
228
  documents: !0,
204
229
  folders: !0,
205
230
  tags: !1
206
- } : T;
231
+ } : D;
207
232
  }
208
- function D(e) {
233
+ function k(e) {
209
234
  return e.documents || e.folders || e.tags;
210
235
  }
211
236
  //#endregion
212
237
  //#region src/lib/hosts/realtime-context.ts
213
- var O = Symbol("docsmint-realtime-adapter");
214
- function k(e) {
215
- m(O, e);
238
+ var A = Symbol("docsmint-realtime-adapter");
239
+ function j(e) {
240
+ m(A, e);
216
241
  }
217
- function A() {
218
- return f(O);
242
+ function M() {
243
+ return f(A);
219
244
  }
220
245
  //#endregion
221
246
  //#region src/lib/hosts/DocsmintAppShellHost.svelte
222
- var j = d.from_html("<button type=\"button\" tabindex=\"-1\" aria-label=\"Close navigation menu\" class=\"fixed inset-0 z-40 bg-black/50\"></button>"), M = 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), N = d.from_html("<!> <!>", 1);
223
- function P(e, i) {
247
+ 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) {
224
249
  d.push(i, !0);
225
250
  let f = d.prop(i, "request", 19, () => ({ fetch })), p = d.prop(i, "extensions", 19, () => ({}));
226
251
  o({
@@ -230,12 +255,31 @@ function P(e, i) {
230
255
  resolve: (e) => i.route.resolve(e),
231
256
  navigate: (e, t) => i.route.navigate?.(e, t)
232
257
  }), a({ fetch: async (...e) => {
233
- let t = await f().fetch(...e), n = E(e[0], e[1]);
234
- return t.ok && D(n) && (n.documents && c(), n.folders && s(), n.tags && l()), t;
258
+ let t = await f().fetch(...e), n = O(e[0], e[1]);
259
+ return t.ok && k(n) && (n.documents && c(), n.folders && s(), n.tags && l()), t;
235
260
  } });
236
261
  let m = h(() => i.realtime);
237
- m && k(m), n.init(), t.init();
238
- let g = d.state(null), _ = d.state(null), v = d.state(null), x = d.state(!1), C = [
262
+ m && j(m), n.init(), t.init();
263
+ let g = d.state(null), _ = d.state(null), v = d.state(null), S = d.state(!1), w = E();
264
+ function D(e) {
265
+ w.start({
266
+ x: e.clientX,
267
+ y: e.clientY
268
+ }), e.currentTarget.setPointerCapture(e.pointerId);
269
+ }
270
+ function A(e) {
271
+ w.move({
272
+ x: e.clientX,
273
+ y: e.clientY
274
+ }) === "open" && (e.preventDefault(), b());
275
+ }
276
+ function M(e) {
277
+ w.end({
278
+ x: e.clientX,
279
+ y: e.clientY
280
+ }) === "open" && b();
281
+ }
282
+ let L = [
239
283
  "a[href]",
240
284
  "button:not([disabled])",
241
285
  "input:not([disabled])",
@@ -245,20 +289,20 @@ function P(e, i) {
245
289
  ].join(",");
246
290
  d.user_effect(() => {
247
291
  let e = window.matchMedia("(max-width: 767px)"), t = () => {
248
- d.set(x, e.matches, !0), d.get(x) || b();
292
+ d.set(S, e.matches, !0), d.get(S) || x();
249
293
  };
250
294
  return t(), e.addEventListener("change", t), () => e.removeEventListener("change", t);
251
295
  }), d.user_effect(() => {
252
- i.route.pathname, b();
296
+ i.route.pathname, x();
253
297
  }), d.user_effect(() => {
254
- if (!d.get(x) || !y.open || !d.get(_)) return;
298
+ if (!d.get(S) || !y.open || !d.get(_)) return;
255
299
  let e = document.activeElement instanceof HTMLElement ? document.activeElement : d.get(v), t = document.body.style.overflow;
256
300
  document.body.style.overflow = "hidden";
257
- let n = () => Array.from(d.get(_)?.querySelectorAll(C) ?? []).filter((e) => !e.hasAttribute("disabled")), r = (e) => {
301
+ let n = () => Array.from(d.get(_)?.querySelectorAll(L) ?? []).filter((e) => !e.hasAttribute("disabled")), r = (e) => {
258
302
  let t = e.target instanceof Element ? e.target.closest("[role=\"dialog\"]") : null;
259
303
  if (t && t !== d.get(_)) return;
260
304
  if (e.key === "Escape") {
261
- e.preventDefault(), b();
305
+ e.preventDefault(), x();
262
306
  return;
263
307
  }
264
308
  if (e.key !== "Tab") return;
@@ -277,16 +321,16 @@ function P(e, i) {
277
321
  cancelAnimationFrame(i), document.removeEventListener("keydown", r), document.body.style.overflow = t, e?.isConnected && e.focus();
278
322
  };
279
323
  });
280
- var T = N(), O = d.first_child(T);
281
- u(O, {
324
+ var R = I(), z = d.first_child(R);
325
+ u(z, {
282
326
  get extensions() {
283
327
  return p();
284
328
  },
285
329
  children: (e, t) => {
286
- var n = M(), a = d.first_child(n), o = d.child(a);
330
+ var n = F(), a = d.first_child(n), o = d.child(a);
287
331
  r(o, {
288
332
  get mobile() {
289
- return d.get(x);
333
+ return d.get(S);
290
334
  },
291
335
  get mobileOpen() {
292
336
  return y.open;
@@ -301,7 +345,7 @@ function P(e, i) {
301
345
  var s = d.sibling(o, 2), c = d.child(s);
302
346
  d.snippet(c, () => i.children), d.reset(s), d.bind_this(s, (e) => d.set(g, e), () => d.get(g)), d.reset(a);
303
347
  var l = d.sibling(a, 2);
304
- S(l, {
348
+ C(l, {
305
349
  get buttonRef() {
306
350
  return d.get(v);
307
351
  },
@@ -310,21 +354,28 @@ function P(e, i) {
310
354
  }
311
355
  });
312
356
  var u = d.sibling(l, 2), f = (e) => {
313
- var t = j();
357
+ var t = N();
358
+ d.delegated("pointerdown", t, D), d.delegated("pointermove", t, A), d.delegated("pointerup", t, M), d.event("pointercancel", t, () => w.cancel()), d.append(e, t);
359
+ };
360
+ d.if(u, (e) => {
361
+ d.get(S) && !y.open && e(f);
362
+ });
363
+ var p = d.sibling(u, 2), m = (e) => {
364
+ var t = P();
314
365
  d.delegated("click", t, function(...e) {
315
- b?.apply(this, e);
366
+ x?.apply(this, e);
316
367
  }), d.append(e, t);
317
368
  };
318
- d.if(u, (e) => {
319
- d.get(x) && y.open && e(f);
320
- }), d.template_effect(() => s.inert = d.get(x) && y.open), d.append(e, n);
369
+ d.if(p, (e) => {
370
+ d.get(S) && y.open && e(m);
371
+ }), d.template_effect(() => s.inert = d.get(S) && y.open), d.append(e, n);
321
372
  },
322
373
  $$slots: { default: !0 }
323
374
  });
324
- var A = d.sibling(O, 2), P = (e) => {
375
+ var B = d.sibling(z, 2), V = (e) => {
325
376
  {
326
377
  let t = d.derived(() => i.route.pathname.startsWith("/docs/"));
327
- w(e, {
378
+ T(e, {
328
379
  get scrollTarget() {
329
380
  return d.get(g);
330
381
  },
@@ -334,10 +385,15 @@ function P(e, i) {
334
385
  });
335
386
  }
336
387
  };
337
- d.if(A, (e) => {
338
- n.showScrollToTop && e(P);
339
- }), d.append(e, T), d.pop();
388
+ d.if(B, (e) => {
389
+ n.showScrollToTop && e(V);
390
+ }), d.append(e, R), d.pop();
340
391
  }
341
- d.delegate(["click"]);
392
+ d.delegate([
393
+ "pointerdown",
394
+ "pointermove",
395
+ "pointerup",
396
+ "click"
397
+ ]);
342
398
  //#endregion
343
- export { P as DocsmintAppShellHost, A as getDocsmintRealtimeAdapter };
399
+ export { L as DocsmintAppShellHost, M as getDocsmintRealtimeAdapter };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../CategoryDialog-BYAFjX7E.js";
1
+ import { t as e } from "../CategoryDialog-CbXBMBZB.js";
2
2
  export { e as CategoryDialog };