@hiai-gg/docsmint 0.5.0 → 0.5.1

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 (38) hide show
  1. package/dist/backend/index.js +1 -1
  2. package/dist/frontend/{CategoryDialog-DyytjQn6.js → CategoryDialog-DmlX0Z97.js} +1 -1
  3. package/dist/frontend/DatePicker-D6E-EEtZ.js +340 -0
  4. package/dist/frontend/{FolderNode-DAGPgi-M.js → FolderNode-D3rN3yLV.js} +1 -1
  5. package/dist/frontend/{ShareDialog-ChZogJtW.js → ShareDialog-uEf8Ks02.js} +1 -1
  6. package/dist/frontend/{Sidebar-BdB8CfXS.js → Sidebar-BthP-jOS.js} +443 -437
  7. package/dist/frontend/app-shell.js +1 -1
  8. package/dist/frontend/components/category-dialog.js +1 -1
  9. package/dist/frontend/components/editor/document-editor.js +240 -228
  10. package/dist/frontend/components/folder-node.js +1 -1
  11. package/dist/frontend/components/save-as-dialog.js +1 -1
  12. package/dist/frontend/components/share-dialog.js +1 -1
  13. package/dist/frontend/components/sidebar.js +1 -1
  14. package/dist/frontend/dashboard.js +1100 -1068
  15. package/dist/frontend/{dropdown-menu-Cre80-CJ.js → dropdown-menu-CJ_7V3N0.js} +43 -43
  16. package/dist/frontend/{floating-layer-anchor-BDs7vO-M.js → floating-layer-anchor-S5RSefGN.js} +1 -1
  17. package/dist/frontend/search.js +421 -405
  18. package/dist/frontend/{select-value-GXwx90Pr.js → select-value-JCAp2PmU.js} +466 -466
  19. package/dist/frontend-ssr/app-shell.js +1 -1
  20. package/dist/frontend-ssr/assets/{CategoryDialog-CLAGMZPz.js → CategoryDialog-DDu37Oub.js} +1 -1
  21. package/dist/frontend-ssr/assets/{FolderNode-Ty6fMbDu.js → FolderNode-CrLWqHJH.js} +1 -1
  22. package/dist/frontend-ssr/assets/{ShareDialog-C-9VDKSz.js → ShareDialog-B82t8oJi.js} +1 -1
  23. package/dist/frontend-ssr/assets/{Sidebar-DzbIUZFc.js → Sidebar-CI8YKbrY.js} +14 -6
  24. package/dist/frontend-ssr/assets/{dropdown-menu-CGkf8-rb.js → dropdown-menu-Dn_vQq9b.js} +1 -1
  25. package/dist/frontend-ssr/assets/{floating-layer-anchor-CYIE8Oj6.js → floating-layer-anchor-BIAu-252.js} +1 -1
  26. package/dist/frontend-ssr/assets/{select-value-6Lk0ToYd.js → select-value-DBhbkNcc.js} +1 -1
  27. package/dist/frontend-ssr/components/category-dialog.js +1 -1
  28. package/dist/frontend-ssr/components/editor/document-editor.js +35 -21
  29. package/dist/frontend-ssr/components/folder-node.js +1 -1
  30. package/dist/frontend-ssr/components/save-as-dialog.js +1 -1
  31. package/dist/frontend-ssr/components/share-dialog.js +1 -1
  32. package/dist/frontend-ssr/components/sidebar.js +1 -1
  33. package/dist/frontend-ssr/dashboard.js +269 -75
  34. package/dist/frontend-ssr/search.js +1 -1
  35. package/package.json +1 -1
  36. package/packages/cli/src/index.ts +1 -1
  37. package/packages/mcp-server/src/index.ts +1 -1
  38. package/dist/frontend/DatePicker-BkaaNS1l.js +0 -256
@@ -1,7 +1,7 @@
1
1
  import { E as scroll_to_top_aria } from "./assets/messages-D-auzk9H.js";
2
2
  import { t as Icon } from "./assets/Icon-QwirKi9Y.js";
3
3
  import { n as searchPreferences, r as editorPreferences } from "./assets/SettingsDialog-BymUxBgg.js";
4
- import { t as Sidebar } from "./assets/Sidebar-DzbIUZFc.js";
4
+ import { t as Sidebar } from "./assets/Sidebar-CI8YKbrY.js";
5
5
  import { o as provideDocsmintRequestAdapter, r as provideDocsmintRouteAdapter } from "./assets/route-context-BPRerEtZ.js";
6
6
  import { t as HiaiDocsExtensionProvider } from "./assets/HiaiDocsExtensionProvider-B_MrN08c.js";
7
7
  import * as $ from "svelte/internal/server";
@@ -7,7 +7,7 @@ import { a as Dialog, i as Dialog_description, n as Dialog_header, o as Button,
7
7
  import { t as Input } from "./input-DezGsU3y.js";
8
8
  import { t as Label } from "./label-Bj8-TfFN.js";
9
9
  import { a as listApiKeys, n as categoryIdFromScopes, o as revealCategoryApiKey, r as createCategoryApiKey, s as revokeApiKey, t as apiKeyClipboardValue } from "./api-keys-DIbclwj5.js";
10
- import { a as Select, i as Select_content, n as Select_trigger, r as Select_item, t as Select_value } from "./select-value-6Lk0ToYd.js";
10
+ import { a as Select, i as Select_content, n as Select_trigger, r as Select_item, t as Select_value } from "./select-value-DBhbkNcc.js";
11
11
  import * as $ from "svelte/internal/server";
12
12
  //#region src/lib/components/sidebar/category-dialog-feedback.ts
13
13
  function categoryDialogErrorMessage(error, fallback) {
@@ -1,7 +1,7 @@
1
1
  import { Rr as dashboard_new_document, Sr as folders_new, bt as editor_more_options, dn as action_go_to, kr as doc_share, vr as folders_delete, yr as folders_rename } from "./messages-D-auzk9H.js";
2
2
  import { t as Chevron_right } from "./chevron-right-DKD7WXjz.js";
3
3
  import { t as Folder } from "./folder-DYIE-XPP.js";
4
- import { a as Dropdown_menu, i as Dropdown_menu_content, o as Ellipsis_vertical, r as Dropdown_menu_item, t as Dropdown_menu_trigger } from "./dropdown-menu-CGkf8-rb.js";
4
+ import { a as Dropdown_menu, i as Dropdown_menu_content, o as Ellipsis_vertical, r as Dropdown_menu_item, t as Dropdown_menu_trigger } from "./dropdown-menu-Dn_vQq9b.js";
5
5
  import { a as getDocsmintRequestAdapter, n as navigateDocsmintRoute, t as getDocsmintRouteAdapter } from "./route-context-BPRerEtZ.js";
6
6
  import { t as cn } from "./utils-DvZnctjz.js";
7
7
  import "./dndzone-DMvTO_Jz.js";
@@ -14,7 +14,7 @@ function ShareDialog($$renderer, $$props) {
14
14
  getDocsmintRequestAdapter();
15
15
  if (open) {
16
16
  $$renderer.push("<!--[0-->");
17
- $$renderer.push(`<div class="fixed inset-0 layer-modal flex items-center justify-center"><button class="absolute inset-0 bg-black/50"${$.attr("aria-label", action_close())}></button> <div class="relative z-10 w-full max-w-md rounded-lg border border-border bg-background p-6 shadow-lg" role="dialog" aria-modal="true"><div class="mb-4 flex items-center justify-between"><h2 class="text-lg font-semibold">${$.escape(share_create_title())} "${$.escape(categoryName || folderName || documentTitle)}"</h2> <button class="rounded-md p-1 text-muted-foreground hover:bg-accent hover:text-foreground"${$.attr("aria-label", action_close())}>✕</button></div> `);
17
+ $$renderer.push(`<div class="fixed inset-0 layer-modal z-[100] flex items-center justify-center"><button class="absolute inset-0 z-[100] bg-black/50"${$.attr("aria-label", action_close())}></button> <div class="relative z-[101] w-full max-w-md rounded-lg border border-border bg-background p-6 shadow-lg" role="dialog" aria-modal="true"><div class="mb-4 flex items-center justify-between"><h2 class="text-lg font-semibold">${$.escape(share_create_title())} "${$.escape(categoryName || folderName || documentTitle)}"</h2> <button class="rounded-md p-1 text-muted-foreground hover:bg-accent hover:text-foreground"${$.attr("aria-label", action_close())}>✕</button></div> `);
18
18
  {
19
19
  $$renderer.push("<!--[0-->");
20
20
  $$renderer.push(`<div class="space-y-4"><div class="flex items-center justify-between"><span class="text-sm font-medium">${$.escape(share_password_protection())}</span> <button${$.attr_class(`relative inline-flex h-5 w-9 items-center rounded-full transition-colors bg-input`)} role="switch"${$.attr("aria-checked", usePassword)}${$.attr("aria-label", share_toggle_password())}><span${$.attr_class(`inline-block h-4 w-4 rounded-full bg-white shadow transition-transform translate-x-0.5`)}></span></button></div> `);
@@ -8,7 +8,7 @@ import { t as Copy } from "./copy-DkkCPkBL.js";
8
8
  import { t as Folder } from "./folder-DYIE-XPP.js";
9
9
  import { t as SettingsDialog } from "./SettingsDialog-BymUxBgg.js";
10
10
  import { n as Search, t as Tag } from "./tag-BmiVU_Ej.js";
11
- import { a as Dropdown_menu, i as Dropdown_menu_content, o as Ellipsis_vertical, r as Dropdown_menu_item, t as Dropdown_menu_trigger } from "./dropdown-menu-CGkf8-rb.js";
11
+ import { a as Dropdown_menu, i as Dropdown_menu_content, o as Ellipsis_vertical, r as Dropdown_menu_item, t as Dropdown_menu_trigger } from "./dropdown-menu-Dn_vQq9b.js";
12
12
  import { t as Loader_circle } from "./loader-circle-CIEWGyfP.js";
13
13
  import { a as getDocsmintRequestAdapter, i as resolveDocsmintRoute, n as navigateDocsmintRoute, t as getDocsmintRouteAdapter } from "./route-context-BPRerEtZ.js";
14
14
  import { t as cn } from "./utils-DvZnctjz.js";
@@ -23,11 +23,11 @@ import { n as SHADOW_ITEM_MARKER_PROPERTY_NAME } from "./dndzone-DMvTO_Jz.js";
23
23
  import { c as updateDocument, r as deleteDocument, s as listDocuments, t as clearDocumentsCache } from "./documents-CZ-wQohy.js";
24
24
  import { c as updateFolder, r as deleteFolder, s as listFolders, t as createFolder } from "./folders-BX30gHv6.js";
25
25
  import { t as DeleteDialog } from "./DeleteDialog-DG9Lm38J.js";
26
- import { t as ShareDialog } from "./ShareDialog-C-9VDKSz.js";
27
- import { t as CategoryDialog } from "./CategoryDialog-CLAGMZPz.js";
26
+ import { t as ShareDialog } from "./ShareDialog-B82t8oJi.js";
27
+ import { t as CategoryDialog } from "./CategoryDialog-DDu37Oub.js";
28
28
  import { n as createDocumentPlacementWriter, t as createDocumentDropCoordinator } from "./document-drop-coordinator-CEaYACsC.js";
29
- import { a as getFolderFromRegistry, c as getPendingDocumentPlacement, f as registerDocument, n as bumpSubfoldersRefresh, p as registerFolder, r as getDocumentFromRegistry, t as acknowledgeDocumentPlacement, u as publishDocumentPlacement } from "./subfolders-refresh-store.svelte-DAh4gT16.js";
30
- import { t as FolderNode } from "./FolderNode-Ty6fMbDu.js";
29
+ import { a as getFolderFromRegistry, c as getPendingDocumentPlacement, d as refreshFolders, f as registerDocument, n as bumpSubfoldersRefresh, p as registerFolder, r as getDocumentFromRegistry, t as acknowledgeDocumentPlacement, u as publishDocumentPlacement } from "./subfolders-refresh-store.svelte-DAh4gT16.js";
30
+ import { t as FolderNode } from "./FolderNode-CrLWqHJH.js";
31
31
  import { i as setSelectedTag, n as refreshDocs, r as refreshTags, t as getSelectedTag } from "./tag-store.svelte-BM1lUI_P.js";
32
32
  import { t as ConfirmDialog } from "./ConfirmDialog-BhAelejz.js";
33
33
  import { i as deleteTag, o as listTags } from "./tags-BQsI_6OW.js";
@@ -1044,7 +1044,7 @@ function FolderTree($$renderer, $$props) {
1044
1044
  let $$settled = true;
1045
1045
  let $$inner_renderer;
1046
1046
  function $$render_inner($$renderer) {
1047
- $$renderer.push(`<div class="space-y-1"><div class="mb-2 flex items-center justify-between gap-1"><a href="/" class="block flex-1 px-2 text-xs font-medium uppercase tracking-wider text-muted-foreground transition-colors hover:text-foreground"${$.attr("title", dashboard_title())}>${$.escape(sidebar_folders())}</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"${$.attr("aria-label", categories_new())}${$.attr("title", categories_new())}>`);
1047
+ $$renderer.push(`<div class="space-y-1"><div class="mb-2 flex items-center justify-between gap-1"><a${$.attr("href", resolveDocsmintRoute(route, "/"))} class="block flex-1 px-2 text-xs font-medium uppercase tracking-wider text-muted-foreground transition-colors hover:text-foreground"${$.attr("title", dashboard_title())}>${$.escape(sidebar_folders())}</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"${$.attr("aria-label", categories_new())}${$.attr("title", categories_new())}>`);
1048
1048
  Plus($$renderer, { class: "size-3.5" });
1049
1049
  $$renderer.push(`<!----></button></div> `);
1050
1050
  if (loadError) {
@@ -1890,6 +1890,14 @@ function Sidebar($$renderer, $$props) {
1890
1890
  const frontendExtensions = getFrontendExtensions();
1891
1891
  const sidebarTopExtensions = $.derived(() => resolveExtensions(frontendExtensions.sidebarTop, { pathname: page.url.pathname }));
1892
1892
  const navigationExtensions = $.derived(() => resolveExtensions(frontendExtensions.navigation, { pathname: page.url.pathname }));
1893
+ onMount(() => {
1894
+ const refreshWorkspaceViews = () => {
1895
+ refreshFolders();
1896
+ refreshDocs();
1897
+ };
1898
+ window.addEventListener("hiai-docs:documents-updated", refreshWorkspaceViews);
1899
+ return () => window.removeEventListener("hiai-docs:documents-updated", refreshWorkspaceViews);
1900
+ });
1893
1901
  let $$settled = true;
1894
1902
  let $$inner_renderer;
1895
1903
  function $$render_inner($$renderer) {
@@ -1,6 +1,6 @@
1
1
  import { t as Icon } from "./Icon-QwirKi9Y.js";
2
2
  import { t as cn } from "./utils-DtlPPXpJ.js";
3
- import { $ as boxWith, Z as mergeProps, a as Floating_layer, c as MenuContentState, d as MenuMenuState, f as MenuRootState, i as createId, n as Popper_layer_force_mount, o as getFloatingContentCSSVars, p as MenuSeparatorState, r as Popper_layer, s as DropdownMenuTriggerState, t as Floating_layer_anchor, u as MenuItemState, v as noop } from "./floating-layer-anchor-CYIE8Oj6.js";
3
+ import { Q as mergeProps, a as Floating_layer, c as MenuContentState, d as MenuMenuState, et as boxWith, f as MenuRootState, i as createId, n as Popper_layer_force_mount, o as getFloatingContentCSSVars, p as MenuSeparatorState, r as Popper_layer, s as DropdownMenuTriggerState, t as Floating_layer_anchor, u as MenuItemState, v as noop } from "./floating-layer-anchor-BIAu-252.js";
4
4
  import * as $ from "svelte/internal/server";
5
5
  //#region ../node_modules/.bun/lucide-svelte@0.577.0+ff5f301bb2db9a0d/node_modules/lucide-svelte/dist/icons/ellipsis-vertical.svelte
6
6
  function Ellipsis_vertical($$renderer, $$props) {
@@ -6111,4 +6111,4 @@ function Floating_layer_anchor($$renderer, $$props) {
6111
6111
  });
6112
6112
  }
6113
6113
  //#endregion
6114
- export { boxWith as $, isIOS as A, META as B, prev as C, createBitsAttrs as D, boolToTrueOrUndef as E, CAPS_LOCK as F, watch as G, PAGE_UP as H, CONTROL as I, DOMContext as J, Context as K, ENTER as L, ARROW_LEFT as M, ARROW_RIGHT as N, getDataOpenClosed as O, ARROW_UP as P, styleToString as Q, ESCAPE as R, next as S, boolToStr as T, SHIFT as U, PAGE_DOWN as V, Previous as W, onDestroyEffect as X, afterTick as Y, mergeProps as Z, boxAutoReset as _, Floating_layer as a, forward as b, MenuContentState as c, MenuMenuState as d, MenuRootState as f, DOMTypeahead as g, PresenceManager as h, createId as i, ARROW_DOWN as j, getDataTransitionAttrs as k, MenuGroupState as l, MenuSubmenuState as m, Popper_layer_force_mount as n, getFloatingContentCSSVars as o, MenuSeparatorState as p, attachRef as q, Popper_layer as r, DropdownMenuTriggerState as s, Floating_layer_anchor as t, MenuItemState as u, noop as v, boolToEmptyStrOrUndef as w, getNextMatch as x, backward as y, HOME as z };
6114
+ export { styleToString as $, isBrowser as A, HOME as B, prev as C, createBitsAttrs as D, boolToTrueOrUndef as E, ARROW_UP as F, Previous as G, PAGE_DOWN as H, CAPS_LOCK as I, attachRef as J, watch as K, CONTROL as L, ARROW_DOWN as M, ARROW_LEFT as N, getDataOpenClosed as O, ARROW_RIGHT as P, mergeProps as Q, ENTER as R, next as S, boolToStr as T, PAGE_UP as U, META as V, SHIFT as W, afterTick as X, DOMContext as Y, onDestroyEffect as Z, boxAutoReset as _, Floating_layer as a, forward as b, MenuContentState as c, MenuMenuState as d, boxWith as et, MenuRootState as f, DOMTypeahead as g, PresenceManager as h, createId as i, isIOS as j, getDataTransitionAttrs as k, MenuGroupState as l, MenuSubmenuState as m, Popper_layer_force_mount as n, getFloatingContentCSSVars as o, MenuSeparatorState as p, Context as q, Popper_layer as r, DropdownMenuTriggerState as s, Floating_layer_anchor as t, MenuItemState as u, noop as v, boolToEmptyStrOrUndef as w, getNextMatch as x, backward as y, ESCAPE as z };
@@ -1,5 +1,5 @@
1
1
  import { t as cn } from "./utils-DtlPPXpJ.js";
2
- import { $ as boxWith, A as isIOS, C as prev, D as createBitsAttrs, E as boolToTrueOrUndef, G as watch, H as PAGE_UP, J as DOMContext, K as Context, O as getDataOpenClosed, P as ARROW_UP, Q as styleToString, S as next, T as boolToStr, V as PAGE_DOWN, W as Previous, Y as afterTick, Z as mergeProps, _ as boxAutoReset, a as Floating_layer, b as forward, g as DOMTypeahead, h as PresenceManager, i as createId, j as ARROW_DOWN, k as getDataTransitionAttrs, n as Popper_layer_force_mount, o as getFloatingContentCSSVars, q as attachRef, r as Popper_layer, t as Floating_layer_anchor, v as noop, w as boolToEmptyStrOrUndef, x as getNextMatch, y as backward, z as HOME } from "./floating-layer-anchor-CYIE8Oj6.js";
2
+ import { $ as styleToString, B as HOME, C as prev, D as createBitsAttrs, E as boolToTrueOrUndef, F as ARROW_UP, G as Previous, H as PAGE_DOWN, J as attachRef, K as watch, M as ARROW_DOWN, O as getDataOpenClosed, Q as mergeProps, S as next, T as boolToStr, U as PAGE_UP, X as afterTick, Y as DOMContext, _ as boxAutoReset, a as Floating_layer, b as forward, et as boxWith, g as DOMTypeahead, h as PresenceManager, i as createId, j as isIOS, k as getDataTransitionAttrs, n as Popper_layer_force_mount, o as getFloatingContentCSSVars, q as Context, r as Popper_layer, t as Floating_layer_anchor, v as noop, w as boolToEmptyStrOrUndef, x as getNextMatch, y as backward } from "./floating-layer-anchor-BIAu-252.js";
3
3
  import * as $ from "svelte/internal/server";
4
4
  import "svelte";
5
5
  import { on } from "svelte/events";
@@ -1,2 +1,2 @@
1
- import { t as CategoryDialog } from "../assets/CategoryDialog-CLAGMZPz.js";
1
+ import { t as CategoryDialog } from "../assets/CategoryDialog-DDu37Oub.js";
2
2
  export { CategoryDialog };
@@ -2263,6 +2263,39 @@ function HiAiEditor($$renderer, $$props) {
2263
2263
  let editor = null;
2264
2264
  let ready = false;
2265
2265
  let deferredContentLoading = false;
2266
+ let deferredParseKey = "";
2267
+ let deferredParseGeneration = 0;
2268
+ function scheduleDeferredMarkdownParse(ed) {
2269
+ if (collaboration?.doc || contentJson || !shouldDeferMarkdownParsing(content)) return;
2270
+ const source = content;
2271
+ const cacheDocumentId = documentId;
2272
+ const cacheUpdatedAt = documentUpdatedAt;
2273
+ const parseKey = `${cacheDocumentId}:${cacheUpdatedAt}:${source.length}:${source.slice(0, 64)}`;
2274
+ if (deferredParseKey === parseKey) return;
2275
+ deferredParseKey = parseKey;
2276
+ const generation = ++deferredParseGeneration;
2277
+ deferredContentLoading = true;
2278
+ const parse = async () => {
2279
+ try {
2280
+ const cached = cacheDocumentId && cacheUpdatedAt ? await getCachedParsedContent(cacheDocumentId, cacheUpdatedAt) : null;
2281
+ if (generation !== deferredParseGeneration || editor !== ed) return;
2282
+ const parsed = cached ?? sanitizeEditorContent(markdownToJson(source));
2283
+ ed.commands.setContent(parsed, { emitUpdate: false });
2284
+ onUpdate({
2285
+ markdown: source,
2286
+ json: parsed
2287
+ });
2288
+ if (!cached && cacheDocumentId && cacheUpdatedAt) cacheParsedContent(cacheDocumentId, cacheUpdatedAt, parsed);
2289
+ } catch (err) {
2290
+ if (generation === deferredParseGeneration) console.warn("HiAiEditor: deferred markdown parsing failed", err);
2291
+ } finally {
2292
+ if (generation === deferredParseGeneration) deferredContentLoading = false;
2293
+ }
2294
+ };
2295
+ requestAnimationFrame(() => {
2296
+ setTimeout(() => void parse(), 0);
2297
+ });
2298
+ }
2266
2299
  /**
2267
2300
  * Resolve the initial editor content. Prefer the persisted ProseMirror JSON
2268
2301
  * when it is present. When it is missing but the markdown source is
@@ -2333,31 +2366,11 @@ function HiAiEditor($$renderer, $$props) {
2333
2366
  const unsubscribe = editorStore.subscribe((ed) => {
2334
2367
  editor = ed;
2335
2368
  if (ed && !ready) ready = true;
2369
+ if (ed) scheduleDeferredMarkdownParse(ed);
2336
2370
  });
2337
2371
  if (!collaboration?.doc && contentJson) removeUnavailableAttachmentImages(contentJson).then(({ content: clean }) => {
2338
2372
  if (editor && clean && JSON.stringify(editor.getJSON()) !== JSON.stringify(clean)) editor.commands.setContent(clean, { emitUpdate: false });
2339
2373
  });
2340
- if (!collaboration?.doc && !contentJson && shouldDeferMarkdownParsing(content)) {
2341
- const parse = async () => {
2342
- if (!editor) {
2343
- deferredContentLoading = false;
2344
- return;
2345
- }
2346
- try {
2347
- const cached = documentId && documentUpdatedAt ? await getCachedParsedContent(documentId, documentUpdatedAt) : null;
2348
- if (!editor) return;
2349
- const parsed = cached ?? sanitizeEditorContent(markdownToJson(content));
2350
- editor.commands.setContent(parsed, { emitUpdate: false });
2351
- if (!cached && documentId && documentUpdatedAt) cacheParsedContent(documentId, documentUpdatedAt, parsed);
2352
- } catch (err) {
2353
- console.warn("HiAiEditor: deferred markdown parsing failed", err);
2354
- } finally {
2355
- deferredContentLoading = false;
2356
- }
2357
- };
2358
- if ("requestIdleCallback" in window) window.requestIdleCallback(() => void parse(), { timeout: 250 });
2359
- else setTimeout(() => void parse(), 0);
2360
- }
2361
2374
  registerShortcut({
2362
2375
  id: "editor-toggle-markdown",
2363
2376
  keys: "mod+shift+7",
@@ -2383,6 +2396,7 @@ function HiAiEditor($$renderer, $$props) {
2383
2396
  };
2384
2397
  });
2385
2398
  onDestroy(() => {
2399
+ deferredParseGeneration += 1;
2386
2400
  editor?.destroy?.();
2387
2401
  });
2388
2402
  $$renderer.push(`<div class="editor-wrapper svelte-9hjz5q" role="presentation">`);
@@ -1,2 +1,2 @@
1
- import { t as FolderNode } from "../assets/FolderNode-Ty6fMbDu.js";
1
+ import { t as FolderNode } from "../assets/FolderNode-CrLWqHJH.js";
2
2
  export { FolderNode };
@@ -6,7 +6,7 @@ import { a as getDocsmintRequestAdapter } from "../assets/route-context-BPRerEtZ
6
6
  import { a as Dialog, i as Dialog_description, n as Dialog_header, o as Button, r as Dialog_footer, t as Dialog_title } from "../assets/dialog-BOV1u6zP.js";
7
7
  import { t as Label } from "../assets/label-Bj8-TfFN.js";
8
8
  import "../assets/categories-av9xjeg5.js";
9
- import { a as Select, i as Select_content, n as Select_trigger, r as Select_item, t as Select_value } from "../assets/select-value-6Lk0ToYd.js";
9
+ import { a as Select, i as Select_content, n as Select_trigger, r as Select_item, t as Select_value } from "../assets/select-value-DBhbkNcc.js";
10
10
  import { d as refreshFolders } from "../assets/subfolders-refresh-store.svelte-DAh4gT16.js";
11
11
  import * as $ from "svelte/internal/server";
12
12
  //#region src/lib/components/SaveAsDialog.svelte
@@ -1,2 +1,2 @@
1
- import { t as ShareDialog } from "../assets/ShareDialog-C-9VDKSz.js";
1
+ import { t as ShareDialog } from "../assets/ShareDialog-B82t8oJi.js";
2
2
  export { ShareDialog };
@@ -1,2 +1,2 @@
1
- import { t as Sidebar } from "../assets/Sidebar-DzbIUZFc.js";
1
+ import { t as Sidebar } from "../assets/Sidebar-CI8YKbrY.js";
2
2
  export { Sidebar };