@hiai-gg/docsmint 0.5.1 → 0.5.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 (72) hide show
  1. package/dist/backend/index.js +47 -8
  2. package/dist/backend-account-runtime-cleanup.js +20 -3
  3. package/dist/backend-api-key-facade.js +20 -3
  4. package/dist/backend-pipeline-cancellation.js +20 -3
  5. package/dist/frontend/{CategoryDialog-DmlX0Z97.js → CategoryDialog-BYAFjX7E.js} +152 -138
  6. package/dist/frontend/{FolderNode-D3rN3yLV.js → FolderNode-DAAn_T8_.js} +1 -1
  7. package/dist/frontend/{HiaiDocsExtensionProvider-CMiTXi2J.js → HiaiDocsExtensionProvider-OSn96BBw.js} +1 -1
  8. package/dist/frontend/SettingsDialog-CyZSOjLE.js +1024 -0
  9. package/dist/frontend/ShareDialog-BC-Jl6v1.js +257 -0
  10. package/dist/frontend/{Sidebar-BthP-jOS.js → Sidebar-B-zCJT9i.js} +348 -332
  11. package/dist/frontend/api/attachments.js +1 -1
  12. package/dist/frontend/app-shell.js +160 -126
  13. package/dist/frontend/{attachments-C2DBzU-r.js → attachments-B8AuDjno.js} +8 -5
  14. package/dist/frontend/components/category-dialog.js +1 -1
  15. package/dist/frontend/components/editor/document-editor.js +1 -1
  16. package/dist/frontend/components/folder-node.js +1 -1
  17. package/dist/frontend/components/save-as-dialog.js +1 -1
  18. package/dist/frontend/components/settings.js +1 -1
  19. package/dist/frontend/components/share-dialog.js +1 -1
  20. package/dist/frontend/components/sidebar.js +1 -1
  21. package/dist/frontend/{context-KLiM3QQ0.js → context-D0zPFXZ4.js} +2 -0
  22. package/dist/frontend/dashboard.js +11 -5
  23. package/dist/frontend/extension.d.ts +3 -2
  24. package/dist/frontend/extension.js +1 -1
  25. package/dist/frontend/folder-refresh.js +1 -1
  26. package/dist/frontend/frontend.css +1 -1
  27. package/dist/frontend/search.js +593 -575
  28. package/dist/frontend/shared-document.js +1 -1
  29. package/dist/frontend/{subfolders-refresh-store.svelte-B2dKVmgz.js → subfolders-refresh-store.svelte-DxP21a1c.js} +1 -0
  30. package/dist/frontend-ssr/api/attachments.js +1 -1
  31. package/dist/frontend-ssr/app-shell.js +59 -5
  32. package/dist/frontend-ssr/assets/{CategoryDialog-DDu37Oub.js → CategoryDialog-BLxVoynx.js} +27 -10
  33. package/dist/frontend-ssr/assets/{CreateSnapshotDialog-DNAjd4eD.js → CreateSnapshotDialog-b6O0nUVp.js} +1 -1
  34. package/dist/frontend-ssr/assets/{DatePicker-Cp6Qmgdb.js → DatePicker-D84cJ-Eq.js} +1 -1
  35. package/dist/frontend-ssr/assets/{FolderNode-CrLWqHJH.js → FolderNode-kmilhDjO.js} +2 -2
  36. package/dist/frontend-ssr/assets/{HiaiDocsExtensionProvider-B_MrN08c.js → HiaiDocsExtensionProvider-BRKWmcDd.js} +1 -1
  37. package/dist/frontend-ssr/assets/{SettingsDialog-BymUxBgg.js → SettingsDialog-DVp0OxPO.js} +23 -9
  38. package/dist/frontend-ssr/assets/ShareDialog-BZd28sg-.js +45 -0
  39. package/dist/frontend-ssr/assets/{Sidebar-CI8YKbrY.js → Sidebar-CO9LZRPa.js} +39 -12
  40. package/dist/frontend-ssr/assets/{TagCreateDialog-B7wDbVqG.js → TagCreateDialog-DUPMitlL.js} +1 -1
  41. package/dist/frontend-ssr/assets/{attachments-CXgatN0B.js → attachments-Cj3fQyUp.js} +11 -4
  42. package/dist/frontend-ssr/assets/{confirm-dialog-B3C0WeMn.js → confirm-dialog-XuyaL8sr.js} +1 -1
  43. package/dist/frontend-ssr/assets/{context-BtCMqdVe.js → context-Bi_mO-NS.js} +2 -0
  44. package/dist/frontend-ssr/assets/{messages-D-auzk9H.js → messages-BAQzILs4.js} +1 -1
  45. package/dist/frontend-ssr/assets/{subfolders-refresh-store.svelte-DAh4gT16.js → subfolders-refresh-store.svelte-CXHxQWKh.js} +1 -0
  46. package/dist/frontend-ssr/components/category-dialog.js +1 -1
  47. package/dist/frontend-ssr/components/create-snapshot-dialog.js +1 -1
  48. package/dist/frontend-ssr/components/editor/document-editor.js +2 -2
  49. package/dist/frontend-ssr/components/editor/document-title.js +1 -1
  50. package/dist/frontend-ssr/components/editor/markdown-toggle.js +1 -1
  51. package/dist/frontend-ssr/components/folder-node.js +1 -1
  52. package/dist/frontend-ssr/components/save-as-dialog.js +2 -2
  53. package/dist/frontend-ssr/components/settings.js +1 -1
  54. package/dist/frontend-ssr/components/share-dialog.js +1 -1
  55. package/dist/frontend-ssr/components/sidebar.js +1 -1
  56. package/dist/frontend-ssr/components/tag-create-dialog.js +1 -1
  57. package/dist/frontend-ssr/components/version-history.js +2 -2
  58. package/dist/frontend-ssr/dashboard.js +13 -8
  59. package/dist/frontend-ssr/extension.js +1 -1
  60. package/dist/frontend-ssr/folder-refresh.js +1 -1
  61. package/dist/frontend-ssr/i18n.js +1 -1
  62. package/dist/frontend-ssr/search.js +55 -36
  63. package/dist/frontend-ssr/shared-document.js +1 -1
  64. package/dist/lifecycle-runtime.js +18 -3
  65. package/dist/types.d.ts +5 -0
  66. package/package.json +1 -1
  67. package/packages/cli/src/index.ts +1 -1
  68. package/packages/db/src/schema.ts +17 -2
  69. package/packages/mcp-server/src/index.ts +1 -1
  70. package/dist/frontend/SettingsDialog-DEx1eEZm.js +0 -1016
  71. package/dist/frontend/ShareDialog-uEf8Ks02.js +0 -166
  72. package/dist/frontend-ssr/assets/ShareDialog-B82t8oJi.js +0 -56
@@ -1,4 +1,4 @@
1
- import { t as e } from "./context-KLiM3QQ0.js";
1
+ import { t as e } from "./context-D0zPFXZ4.js";
2
2
  import "svelte/internal/disclose-version";
3
3
  import * as t from "svelte/internal/client";
4
4
  //#region src/lib/components/editor/shared-document.ts
@@ -3,6 +3,7 @@ import * as e from "svelte/internal/client";
3
3
  var t = e.proxy({}), n = e.proxy({}), r = e.proxy({}), i = e.state(0), a = e.state(null), o = e.proxy({}), s = e.state(0);
4
4
  function c() {
5
5
  e.update(s);
6
+ for (let e of Object.keys(n)) t[e] = (t[e] ?? 0) + 1;
6
7
  }
7
8
  function l() {
8
9
  return e.get(s);
@@ -1,2 +1,2 @@
1
- import { a as presignAttachment, i as listAttachments, n as isFileSizeAllowed, o as uploadAttachment, r as isImageFile, t as confirmAttachment } from "../assets/attachments-CXgatN0B.js";
1
+ import { a as presignAttachment, i as listAttachments, n as isFileSizeAllowed, o as uploadAttachment, r as isImageFile, t as confirmAttachment } from "../assets/attachments-Cj3fQyUp.js";
2
2
  export { confirmAttachment, isFileSizeAllowed, isImageFile, listAttachments, presignAttachment, uploadAttachment };
@@ -1,9 +1,11 @@
1
- import { E as scroll_to_top_aria } from "./assets/messages-D-auzk9H.js";
1
+ import { E as scroll_to_top_aria } from "./assets/messages-BAQzILs4.js";
2
2
  import { t as Icon } from "./assets/Icon-QwirKi9Y.js";
3
- import { n as searchPreferences, r as editorPreferences } from "./assets/SettingsDialog-BymUxBgg.js";
4
- import { t as Sidebar } from "./assets/Sidebar-CI8YKbrY.js";
3
+ import { n as searchPreferences, r as editorPreferences } from "./assets/SettingsDialog-DVp0OxPO.js";
4
+ import { t as Sidebar } from "./assets/Sidebar-CO9LZRPa.js";
5
5
  import { o as provideDocsmintRequestAdapter, r as provideDocsmintRouteAdapter } from "./assets/route-context-BPRerEtZ.js";
6
- import { t as HiaiDocsExtensionProvider } from "./assets/HiaiDocsExtensionProvider-B_MrN08c.js";
6
+ import { d as refreshFolders } from "./assets/subfolders-refresh-store.svelte-CXHxQWKh.js";
7
+ import { n as refreshDocs, r as refreshTags } from "./assets/tag-store.svelte-BM1lUI_P.js";
8
+ import { t as HiaiDocsExtensionProvider } from "./assets/HiaiDocsExtensionProvider-BRKWmcDd.js";
7
9
  import * as $ from "svelte/internal/server";
8
10
  import { getContext, onDestroy, setContext, untrack } from "svelte";
9
11
  //#region ../node_modules/.bun/lucide-svelte@0.577.0+ff5f301bb2db9a0d/node_modules/lucide-svelte/dist/icons/arrow-up.svelte
@@ -211,6 +213,49 @@ function ScrollToTop($$renderer, $$props) {
211
213
  });
212
214
  }
213
215
  //#endregion
216
+ //#region src/lib/hosts/mutation-refresh.ts
217
+ var noImpact = {
218
+ documents: false,
219
+ folders: false,
220
+ tags: false
221
+ };
222
+ function mutationRefreshImpact(input, init) {
223
+ const method = (init?.method ?? (input instanceof Request ? input.method : "GET")).toUpperCase();
224
+ if (![
225
+ "POST",
226
+ "PUT",
227
+ "PATCH",
228
+ "DELETE"
229
+ ].includes(method)) return noImpact;
230
+ const rawUrl = typeof input === "string" ? input : input instanceof URL ? input.href : input.url;
231
+ const pathname = new URL(rawUrl, "http://docsmint.local").pathname;
232
+ if (/\/keys(?:\/|$)/.test(pathname)) return noImpact;
233
+ if (/^\/api\/(?:v1\/)?tags(?:\/|$)/.test(pathname)) return {
234
+ documents: true,
235
+ folders: false,
236
+ tags: true
237
+ };
238
+ if (/^\/api\/(?:v1\/)?documents\/[^/]+\/tags(?:\/|$)/.test(pathname)) return {
239
+ documents: true,
240
+ folders: false,
241
+ tags: true
242
+ };
243
+ if (/^\/api\/(?:v1\/)?(?:folders|categories)(?:\/|$)/.test(pathname)) return {
244
+ documents: true,
245
+ folders: true,
246
+ tags: false
247
+ };
248
+ if (/^\/api\/(?:v1\/)?(?:documents|import|imports)(?:\/|$)/.test(pathname)) return {
249
+ documents: true,
250
+ folders: true,
251
+ tags: false
252
+ };
253
+ return noImpact;
254
+ }
255
+ function hasMutationRefreshImpact(impact) {
256
+ return impact.documents || impact.folders || impact.tags;
257
+ }
258
+ //#endregion
214
259
  //#region src/lib/hosts/realtime-context.ts
215
260
  var REALTIME_ADAPTER = Symbol("docsmint-realtime-adapter");
216
261
  function provideDocsmintRealtimeAdapter(adapter) {
@@ -232,7 +277,16 @@ function DocsmintAppShellHost($$renderer, $$props) {
232
277
  resolve: (path) => route.resolve(path),
233
278
  navigate: (path, options) => route.navigate?.(path, options)
234
279
  });
235
- provideDocsmintRequestAdapter({ fetch: (...args) => request.fetch(...args) });
280
+ provideDocsmintRequestAdapter({ fetch: async (...args) => {
281
+ const response = await request.fetch(...args);
282
+ const impact = mutationRefreshImpact(args[0], args[1]);
283
+ if (response.ok && hasMutationRefreshImpact(impact)) {
284
+ if (impact.documents) refreshDocs();
285
+ if (impact.folders) refreshFolders();
286
+ if (impact.tags) refreshTags();
287
+ }
288
+ return response;
289
+ } });
236
290
  const realtimeAdapter = untrack(() => realtime);
237
291
  if (realtimeAdapter) provideDocsmintRealtimeAdapter(realtimeAdapter);
238
292
  editorPreferences.init();
@@ -1,4 +1,4 @@
1
- import { S as categories_create_title, _ as categories_delete_error, _n as action_cancel, b as categories_name_placeholder, g as categories_delete_title, gn as action_delete, h as categories_delete_description, m as categories_delete_success, mn as action_create, p as categories_delete_success_description, v as categories_update_error, vn as action_save, x as categories_edit_title, y as categories_create_error } from "./messages-D-auzk9H.js";
1
+ import { S as categories_create_title, _ as categories_delete_error, _n as action_cancel, b as categories_name_placeholder, g as categories_delete_title, gn as action_delete, h as categories_delete_description, m as categories_delete_success, mn as action_create, p as categories_delete_success_description, v as categories_update_error, vn as action_save, x as categories_edit_title, y as categories_create_error } from "./messages-BAQzILs4.js";
2
2
  import { t as Copy } from "./copy-DkkCPkBL.js";
3
3
  import { t as Circle_check } from "./circle-check-CPS9dKEo.js";
4
4
  import { t as Loader_circle } from "./loader-circle-CIEWGyfP.js";
@@ -9,6 +9,16 @@ 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
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
+ //#region src/lib/components/sidebar/category-api-key-flow.ts
13
+ async function issueCategoryKeyAfterSavingAccess(input) {
14
+ if (!input.draft.name.trim()) throw new Error("Name is required");
15
+ if (input.draft.apiMode !== "category") throw new Error("Select Category API access");
16
+ if (!input.draft.apiPermissionRead && !input.draft.apiPermissionEdit && !input.draft.apiPermissionWrite) throw new Error("Select at least one permission");
17
+ const saved = await input.save(input.draft);
18
+ if (!saved || saved.id !== input.categoryId) throw new Error("Failed to save Category API access");
19
+ return input.issue(input.categoryId);
20
+ }
21
+ //#endregion
12
22
  //#region src/lib/components/sidebar/category-dialog-feedback.ts
13
23
  function categoryDialogErrorMessage(error, fallback) {
14
24
  if (typeof error === "object" && error !== null && "status" in error && error.status === 409) return "A category with this name already exists.";
@@ -47,10 +57,22 @@ function CategoryDialog($$renderer, $$props) {
47
57
  categoryKeys = (await listApiKeys(request.fetch)).keys.filter((key) => categoryIdFromScopes(key.scopes) === categoryId);
48
58
  }
49
59
  async function issueCategoryKey() {
50
- if (!category?.id) return;
60
+ if (!category?.id || !onSave) return;
51
61
  keyBusy = true;
62
+ error = null;
52
63
  try {
53
- const issued = await createCategoryApiKey(category.id, void 0, request.fetch);
64
+ const issued = await issueCategoryKeyAfterSavingAccess({
65
+ categoryId: category.id,
66
+ draft: {
67
+ name: trimmedName(),
68
+ apiMode: normalizeApiMode(apiMode),
69
+ apiPermissionRead,
70
+ apiPermissionEdit,
71
+ apiPermissionWrite
72
+ },
73
+ save: async (payload) => onSave(payload),
74
+ issue: async (categoryId) => createCategoryApiKey(categoryId, void 0, request.fetch)
75
+ });
54
76
  issuedKeys = {
55
77
  ...issuedKeys,
56
78
  [issued.id]: issued.key
@@ -462,23 +484,18 @@ function CategoryDialog($$renderer, $$props) {
462
484
  },
463
485
  $$slots: { default: true }
464
486
  });
465
- $$renderer.push(`<!----><p class="text-xs text-muted-foreground">Keys inherit the saved permissions above.</p></div> `);
487
+ $$renderer.push(`<!----><p class="text-xs text-muted-foreground">The current permissions are saved before the key is issued.</p></div> `);
466
488
  Button($$renderer, {
467
489
  type: "button",
468
490
  size: "sm",
469
491
  onclick: issueCategoryKey,
470
- disabled: busy || keyBusy || category.apiMode !== "category",
492
+ disabled: busy || keyBusy || !trimmedName() || !hasAnyPermission(),
471
493
  children: ($$renderer) => {
472
494
  $$renderer.push(`<!---->Create key`);
473
495
  },
474
496
  $$slots: { default: true }
475
497
  });
476
498
  $$renderer.push(`<!----></div> `);
477
- if (category.apiMode !== "category") {
478
- $$renderer.push("<!--[0-->");
479
- $$renderer.push(`<p class="text-xs text-muted-foreground">Save Category API access first, then reopen settings to issue a key.</p>`);
480
- } else $$renderer.push("<!--[-1-->");
481
- $$renderer.push(`<!--]--> `);
482
499
  if (latestIssuedKey()) {
483
500
  $$renderer.push("<!--[0-->");
484
501
  $$renderer.push(`<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">${$.escape(latestIssuedKey())}</code> `);
@@ -1,4 +1,4 @@
1
- import { At as version_snapshot_description_placeholder, Dt as version_snapshot_dialog_title, Et as version_snapshot_dialog_description, Mt as version_snapshot_description, Nt as version_snapshot_label, Ot as version_snapshot_creating, _n as action_cancel, jt as version_snapshot_label_placeholder, kt as version_snapshot_create, xt as version_restore_failed, yn as error_server, z as error_validation } from "./messages-D-auzk9H.js";
1
+ import { At as version_snapshot_description_placeholder, Dt as version_snapshot_dialog_title, Et as version_snapshot_dialog_description, Mt as version_snapshot_description, Nt as version_snapshot_label, Ot as version_snapshot_creating, _n as action_cancel, jt as version_snapshot_label_placeholder, kt as version_snapshot_create, xt as version_restore_failed, yn as error_server, z as error_validation } from "./messages-BAQzILs4.js";
2
2
  import { t as Loader_circle } from "./loader-circle-CIEWGyfP.js";
3
3
  import { a as Dialog, i as Dialog_description, n as Dialog_header, o as Button, r as Dialog_footer, t as Dialog_title } from "./dialog-BOV1u6zP.js";
4
4
  import { t as Input } from "./input-DezGsU3y.js";
@@ -1,4 +1,4 @@
1
- import { $ as month_august, B as date_picker_aria, G as weekday_th, H as weekday_su, J as weekday_mo, K as weekday_we, Q as month_september, U as weekday_sa, V as date_picker_placeholder, W as weekday_fr, X as month_november, Y as month_december, Z as month_october, at as month_february, et as month_july, it as month_march, nt as month_may, ot as month_january, q as weekday_tu, rt as month_april, tt as month_june } from "./messages-D-auzk9H.js";
1
+ import { $ as month_august, B as date_picker_aria, G as weekday_th, H as weekday_su, J as weekday_mo, K as weekday_we, Q as month_september, U as weekday_sa, V as date_picker_placeholder, W as weekday_fr, X as month_november, Y as month_december, Z as month_october, at as month_february, et as month_july, it as month_march, nt as month_may, ot as month_january, q as weekday_tu, rt as month_april, tt as month_june } from "./messages-BAQzILs4.js";
2
2
  import { t as Icon } from "./Icon-QwirKi9Y.js";
3
3
  import { t as cn } from "./utils-DtlPPXpJ.js";
4
4
  import * as $ from "svelte/internal/server";
@@ -1,11 +1,11 @@
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";
1
+ import { Dr as doc_share, Ir as dashboard_new_document, _r as folders_rename, br as folders_new, bt as editor_more_options, dn as action_go_to, gr as folders_delete } from "./messages-BAQzILs4.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
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";
8
- import "./subfolders-refresh-store.svelte-DAh4gT16.js";
8
+ import "./subfolders-refresh-store.svelte-CXHxQWKh.js";
9
9
  import * as $ from "svelte/internal/server";
10
10
  import { page } from "$app/state";
11
11
  import "svelte/animate";
@@ -1,4 +1,4 @@
1
- import { n as provideFrontendExtensions } from "./context-BtCMqdVe.js";
1
+ import { n as provideFrontendExtensions } from "./context-Bi_mO-NS.js";
2
2
  import "svelte/internal/server";
3
3
  //#region src/lib/hosts/HiaiDocsExtensionProvider.svelte
4
4
  function HiaiDocsExtensionProvider($$renderer, $$props) {
@@ -1,4 +1,4 @@
1
- import { An as settings_email, Cn as change_password, Dn as settings_save, En as password_label, Fn as settings_appearance, In as settings_account, Ln as settings_profile, Mn as theme_dark, Nn as theme_light, On as settings_name, Pn as settings_theme, Rn as settings_title, Sn as auth_password, Tn as new_password, jn as theme_system, kn as settings_email_change_warning, pn as action_close, wn as confirm_password, xn as auth_logout } from "./messages-D-auzk9H.js";
1
+ import { An as settings_email, Cn as change_password, Dn as settings_save, En as password_label, Fn as settings_appearance, In as settings_account, Ln as settings_profile, Mn as theme_dark, Nn as theme_light, On as settings_name, Pn as settings_theme, Rn as settings_title, Sn as auth_password, Tn as new_password, jn as theme_system, kn as settings_email_change_warning, pn as action_close, wn as confirm_password, xn as auth_logout } from "./messages-BAQzILs4.js";
2
2
  import { t as Icon } from "./Icon-QwirKi9Y.js";
3
3
  import { a as getDocsmintRequestAdapter, n as navigateDocsmintRoute, t as getDocsmintRouteAdapter } from "./route-context-BPRerEtZ.js";
4
4
  import { t as cn } from "./utils-DtlPPXpJ.js";
@@ -9,7 +9,7 @@ import { r as signOut } from "./auth-client-x26kqY8Z.js";
9
9
  import { r as getProfile } from "./settings-Bk5Hk9Vq.js";
10
10
  import { a as listApiKeys, i as createGlobalApiKey, n as categoryIdFromScopes, o as revealCategoryApiKey, s as revokeApiKey, t as apiKeyClipboardValue } from "./api-keys-DIbclwj5.js";
11
11
  import { i as listCategories } from "./categories-av9xjeg5.js";
12
- import { t as getFrontendExtensions } from "./context-BtCMqdVe.js";
12
+ import { t as getFrontendExtensions } from "./context-Bi_mO-NS.js";
13
13
  import { t as resolveExtensions } from "./resolve-BqHozBXl.js";
14
14
  import { a as resolveOfflineIdentity, t as disableOfflineAccess } from "./identity-B3uHoDtf.js";
15
15
  import { n as getOfflineDB, t as deleteOfflineDB } from "./db-CnxeO66n.js";
@@ -568,6 +568,7 @@ function SettingsDialog($$renderer, $$props) {
568
568
  let activeTab = "profile";
569
569
  const frontendExtensions = getFrontendExtensions();
570
570
  const settingsExtensions = $.derived(() => resolveExtensions(frontendExtensions.settingsSections, { pathname: page.url.pathname }));
571
+ const profileActions = $.derived(() => resolveExtensions(frontendExtensions.profileActions, { pathname: page.url.pathname }));
571
572
  let name = "";
572
573
  let email = "";
573
574
  let currentPassword = "";
@@ -839,7 +840,20 @@ function SettingsDialog($$renderer, $$props) {
839
840
  });
840
841
  $$renderer.push(`<!----> <p class="text-xs text-muted-foreground">${$.escape(settings_email_change_warning())}</p> `);
841
842
  $$renderer.push("<!--[-1-->");
842
- $$renderer.push(`<!--]--></div> <div class="flex items-center justify-between gap-4 rounded-md border p-3"><span><span class="block text-sm font-medium">GraphRAG search</span> <span class="block text-xs text-muted-foreground">Use graph expansion for related documents. Disable it for faster standard RAG search.</span></span> <button type="button" role="switch"${$.attr_class("preference-switch svelte-1eaqpj", void 0, { "enabled": searchPreferences.graphSearchEnabled })}${$.attr("aria-checked", searchPreferences.graphSearchEnabled)} aria-label="Use GraphRAG search"><span class="svelte-1eaqpj"></span></button></div> `);
843
+ $$renderer.push(`<!--]--></div> <details class="profile-advanced border-t pt-4 svelte-1eaqpj"><summary class="flex cursor-pointer items-center justify-between gap-3 rounded-md px-1 py-2 svelte-1eaqpj"><span><span class="block text-sm font-medium">Advanced</span> <span class="block text-xs text-muted-foreground">Search and additional profile controls</span></span> <span class="profile-advanced-chevron svelte-1eaqpj" aria-hidden="true">⌄</span></summary> <div class="mt-3 space-y-3"><div class="flex items-center justify-between gap-4 rounded-md border p-3"><span><span class="block text-sm font-medium">GraphRAG search</span> <span class="block text-xs text-muted-foreground">Use graph expansion for related documents. Disable it for faster standard RAG search.</span></span> <button type="button" role="switch"${$.attr_class("preference-switch svelte-1eaqpj", void 0, { "enabled": searchPreferences.graphSearchEnabled })}${$.attr("aria-checked", searchPreferences.graphSearchEnabled)} aria-label="Use GraphRAG search"><span class="svelte-1eaqpj"></span></button></div> <!--[-->`);
844
+ const each_array_1 = $.ensure_array_like(profileActions());
845
+ for (let $$index_1 = 0, $$length = each_array_1.length; $$index_1 < $$length; $$index_1++) {
846
+ const ProfileAction = each_array_1[$$index_1].component;
847
+ if (ProfileAction) {
848
+ $$renderer.push("<!--[-->");
849
+ ProfileAction($$renderer, {});
850
+ $$renderer.push("<!--]-->");
851
+ } else {
852
+ $$renderer.push("<!--[!-->");
853
+ $$renderer.push("<!--]-->");
854
+ }
855
+ }
856
+ $$renderer.push(`<!--]--></div></details> `);
843
857
  $$renderer.push("<!--[-1-->");
844
858
  $$renderer.push(`<!--]--> `);
845
859
  Button($$renderer, {
@@ -972,9 +986,9 @@ function SettingsDialog($$renderer, $$props) {
972
986
  $$slots: { default: true }
973
987
  });
974
988
  $$renderer.push(`<!----> <p class="text-xs text-muted-foreground">${$.escape(settings_appearance())}</p></div> <div class="grid grid-cols-3 gap-2"><!--[-->`);
975
- const each_array_1 = $.ensure_array_like(themeOptions);
976
- for (let $$index_1 = 0, $$length = each_array_1.length; $$index_1 < $$length; $$index_1++) {
977
- let opt = each_array_1[$$index_1];
989
+ const each_array_2 = $.ensure_array_like(themeOptions);
990
+ for (let $$index_2 = 0, $$length = each_array_2.length; $$index_2 < $$length; $$index_2++) {
991
+ let opt = each_array_2[$$index_2];
978
992
  $$renderer.push(`<button type="button"${$.attr_class($.clsx(["rounded-md border px-3 py-2 text-sm font-medium transition-colors", themeStore.value === opt.value ? "border-primary bg-primary text-primary-foreground" : "border-border text-muted-foreground hover:bg-accent hover:text-accent-foreground"].join(" ")), "svelte-1eaqpj")}>${$.escape(opt.label)}</button>`);
979
993
  }
980
994
  $$renderer.push(`<!--]--></div> <details class="editor-settings border-t pt-5 svelte-1eaqpj"><summary class="flex cursor-pointer items-center justify-between gap-3 rounded-md px-1 py-2 svelte-1eaqpj"><span><span class="block text-sm font-medium">Editor modes</span> <span class="block text-xs text-muted-foreground">Source views and toolbar layout</span></span> <span class="editor-settings-chevron svelte-1eaqpj" aria-hidden="true">⌄</span></summary> <div class="mt-3 space-y-3"><div class="flex items-center justify-between gap-4 rounded-md border p-3"><span><span class="block text-sm font-medium">Visual editor</span> <span class="block text-xs text-muted-foreground">Show the standard WYSIWYG editor mode.</span></span> <button type="button" role="switch"${$.attr_class("preference-switch svelte-1eaqpj", void 0, { "enabled": editorPreferences.showVisualMode })}${$.attr("aria-checked", editorPreferences.showVisualMode)} aria-label="Show visual editor"${$.attr("disabled", !editorPreferences.showMarkdownMode, true)}><span class="svelte-1eaqpj"></span></button></div> <div class="flex items-center justify-between gap-4 rounded-md border p-3"><span><span class="block text-sm font-medium">Raw Markdown</span> <span class="block text-xs text-muted-foreground">Show the Markdown source button in documents.</span></span> <button type="button" role="switch"${$.attr_class("preference-switch svelte-1eaqpj", void 0, { "enabled": editorPreferences.showMarkdownMode })}${$.attr("aria-checked", editorPreferences.showMarkdownMode)} aria-label="Show Raw Markdown"${$.attr("disabled", !editorPreferences.showVisualMode, true)}><span class="svelte-1eaqpj"></span></button></div> <div class="flex items-center justify-between gap-4 rounded-md border p-3"><span><span class="block text-sm font-medium">Minimal toolbar</span> <span class="block text-xs text-muted-foreground">Bold, italic, underline, lists, highlight, and copy.</span></span> <button type="button" role="switch"${$.attr_class("preference-switch svelte-1eaqpj", void 0, { "enabled": editorPreferences.minimalToolbar })}${$.attr("aria-checked", editorPreferences.minimalToolbar)} aria-label="Use minimal toolbar"><span class="svelte-1eaqpj"></span></button></div> <div class="flex items-center justify-between gap-4 rounded-md border p-3"><span><span class="block text-sm font-medium">Scroll to top</span> <span class="block text-xs text-muted-foreground">Show the floating arrow after scrolling down.</span></span> <button type="button" role="switch"${$.attr_class("preference-switch svelte-1eaqpj", void 0, { "enabled": editorPreferences.showScrollToTop })}${$.attr("aria-checked", editorPreferences.showScrollToTop)} aria-label="Show scroll to top"><span class="svelte-1eaqpj"></span></button></div></div></details></div>`);
@@ -1003,9 +1017,9 @@ function SettingsDialog($$renderer, $$props) {
1003
1017
  $$renderer.push("<!--]-->");
1004
1018
  }
1005
1019
  $$renderer.push(` <!--[-->`);
1006
- const each_array_2 = $.ensure_array_like(settingsExtensions());
1007
- for (let $$index_2 = 0, $$length = each_array_2.length; $$index_2 < $$length; $$index_2++) {
1008
- let section = each_array_2[$$index_2];
1020
+ const each_array_3 = $.ensure_array_like(settingsExtensions());
1021
+ for (let $$index_3 = 0, $$length = each_array_3.length; $$index_3 < $$length; $$index_3++) {
1022
+ let section = each_array_3[$$index_3];
1009
1023
  if (Tabs_content) {
1010
1024
  $$renderer.push("<!--[-->");
1011
1025
  Tabs_content($$renderer, {
@@ -0,0 +1,45 @@
1
+ import { Bn as share_expires_7d, Gn as share_toggle_password, Hn as share_expires_1h, Jn as share_create_title, Kn as share_password_protection, Un as share_expires_never, Vn as share_expires_1d, Wn as share_expires, pn as action_close, qn as share_create_link, zn as share_expires_30d } from "./messages-BAQzILs4.js";
2
+ import { a as getDocsmintRequestAdapter } from "./route-context-BPRerEtZ.js";
3
+ import "./select-value-DBhbkNcc.js";
4
+ import "./keyboard.svelte-BgF47N3L.js";
5
+ import * as $ from "svelte/internal/server";
6
+ //#region src/lib/components/ShareDialog.svelte
7
+ function ShareDialog($$renderer, $$props) {
8
+ $$renderer.component(($$renderer) => {
9
+ let { open = false, documentId = "", documentTitle = "", folderId = "", folderName = "", categoryId = "", categoryName = "" } = $$props;
10
+ let usePassword = false;
11
+ let expiresIn = "7d";
12
+ getDocsmintRequestAdapter();
13
+ if (open) {
14
+ $$renderer.push("<!--[0-->");
15
+ $$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> `);
16
+ {
17
+ $$renderer.push("<!--[0-->");
18
+ $$renderer.push(`<div class="space-y-4"><div class="grid grid-cols-2 gap-2 rounded-lg bg-muted p-1" aria-label="Share access mode"><button type="button"${$.attr_class(`rounded-md px-3 py-2 text-sm font-medium bg-background shadow-sm`)}>Public link</button> <button type="button"${$.attr_class(`rounded-md px-3 py-2 text-sm font-medium text-muted-foreground`)}>Specific people</button></div> <p class="rounded-md border border-border bg-muted/40 p-3 text-xs text-muted-foreground">${$.escape("Anyone with this link can view the document. The link may be forwarded.")}</p> <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> `);
19
+ $$renderer.push("<!--[-1-->");
20
+ $$renderer.push(`<!--]--> <div class="space-y-2"><span class="text-sm font-medium">${$.escape(share_expires())}</span> <div class="flex gap-2"><!--[-->`);
21
+ const each_array = $.ensure_array_like([
22
+ ["1h", share_expires_1h()],
23
+ ["1d", share_expires_1d()],
24
+ ["7d", share_expires_7d()],
25
+ ["30d", share_expires_30d()],
26
+ ["never", share_expires_never()]
27
+ ]);
28
+ for (let $$index = 0, $$length = each_array.length; $$index < $$length; $$index++) {
29
+ let [val, label] = each_array[$$index];
30
+ $$renderer.push(`<button${$.attr_class(`rounded-md border px-2.5 py-1 text-xs font-medium transition-colors ${expiresIn === val ? "border-primary bg-primary text-primary-foreground" : "border-border text-muted-foreground hover:bg-accent"}`)}>${$.escape(label)}</button>`);
31
+ }
32
+ $$renderer.push(`<!--]--></div></div> `);
33
+ $$renderer.push("<!--[-1-->");
34
+ $$renderer.push(`<!--]--> `);
35
+ $$renderer.push("<!--[-1-->");
36
+ $$renderer.push(`<!--]--> <button${$.attr("disabled", usePassword, true)} class="w-full rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50">${$.escape(share_create_link())}</button></div>`);
37
+ }
38
+ $$renderer.push(`<!--]--></div></div>`);
39
+ } else $$renderer.push("<!--[-1-->");
40
+ $$renderer.push(`<!--]-->`);
41
+ $.bind_props($$props, { open });
42
+ });
43
+ }
44
+ //#endregion
45
+ export { ShareDialog as t };
@@ -1,12 +1,12 @@
1
- import { Ar as doc_tags, Br as dashboard_title, C as categories_new, D as sidebar_powered_by, Fr as doc_title_label, Mr as doc_delete_success, Nr as doc_delete_confirm, Or as doc_delete, Rn as settings_title, Rr as dashboard_new_document, Sr as folders_new, _n as action_cancel, _r as folders_delete_title, an as sidebar_folders, bn as error_generic, bt as editor_more_options, dn as action_go_to, er as search_placeholder, f as sidebar_uncategorized, gn as action_delete, hn as action_edit, hr as folders_delete_success, ir as tags_delete_title, jr as doc_delete_success_description, kr as doc_share, mr as folders_delete_success_description, nr as tags_add, on as sidebar_recent, pr as folders_name_placeholder, rr as tags_delete_description, sr as tags_new, tr as search_title, un as action_loading, vn as action_save, vt as tags_load_error, yr as folders_rename, yt as action_copy_content } from "./messages-D-auzk9H.js";
1
+ import { $n as search_title, Ar as doc_delete_success, C as categories_new, D as sidebar_powered_by, Dr as doc_share, Er as doc_delete, Ir as dashboard_new_document, Nr as doc_title_label, Or as doc_tags, Qn as search_placeholder, Rn as settings_title, Rr as dashboard_title, _n as action_cancel, _r as folders_rename, an as sidebar_folders, ar as tags_new, bn as error_generic, br as folders_new, bt as editor_more_options, dn as action_go_to, dr as folders_name_placeholder, er as tags_add, f as sidebar_uncategorized, fr as folders_delete_success_description, gn as action_delete, hn as action_edit, hr as folders_delete_title, jr as doc_delete_confirm, kr as doc_delete_success_description, nr as tags_delete_title, on as sidebar_recent, pr as folders_delete_success, tr as tags_delete_description, un as action_loading, vn as action_save, vt as tags_load_error, yt as action_copy_content } from "./messages-BAQzILs4.js";
2
2
  import { t as Icon } from "./Icon-QwirKi9Y.js";
3
- import { i as Check, n as Plus, r as File_text, t as FolderDialog } from "./confirm-dialog-B3C0WeMn.js";
3
+ import { i as Check, n as Plus, r as File_text, t as FolderDialog } from "./confirm-dialog-XuyaL8sr.js";
4
4
  import { t as Chevron_down } from "./chevron-down-CvqKATjM.js";
5
5
  import { t as Chevron_right } from "./chevron-right-DKD7WXjz.js";
6
6
  import { t as Clock } from "./clock-CzsE58TH.js";
7
7
  import { t as Copy } from "./copy-DkkCPkBL.js";
8
8
  import { t as Folder } from "./folder-DYIE-XPP.js";
9
- import { t as SettingsDialog } from "./SettingsDialog-BymUxBgg.js";
9
+ import { t as SettingsDialog } from "./SettingsDialog-DVp0OxPO.js";
10
10
  import { n as Search, t as Tag } from "./tag-BmiVU_Ej.js";
11
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";
@@ -17,21 +17,21 @@ import { t as Input } from "./input-DezGsU3y.js";
17
17
  import { t as Label } from "./label-Bj8-TfFN.js";
18
18
  import { n as apiFetch } from "./client-DZMkDkDn.js";
19
19
  import { i as listCategories, r as deleteCategory } from "./categories-av9xjeg5.js";
20
- import { t as getFrontendExtensions } from "./context-BtCMqdVe.js";
20
+ import { t as getFrontendExtensions } from "./context-Bi_mO-NS.js";
21
21
  import { t as resolveExtensions } from "./resolve-BqHozBXl.js";
22
22
  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-B82t8oJi.js";
27
- import { t as CategoryDialog } from "./CategoryDialog-DDu37Oub.js";
26
+ import { t as ShareDialog } from "./ShareDialog-BZd28sg-.js";
27
+ import { t as CategoryDialog } from "./CategoryDialog-BLxVoynx.js";
28
28
  import { n as createDocumentPlacementWriter, t as createDocumentDropCoordinator } from "./document-drop-coordinator-CEaYACsC.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";
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-CXHxQWKh.js";
30
+ import { t as FolderNode } from "./FolderNode-kmilhDjO.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";
34
- import { t as TagCreateDialog } from "./TagCreateDialog-B7wDbVqG.js";
34
+ import { t as TagCreateDialog } from "./TagCreateDialog-DUPMitlL.js";
35
35
  import * as $ from "svelte/internal/server";
36
36
  import { onDestroy, onMount } from "svelte";
37
37
  import { page } from "$app/state";
@@ -1889,6 +1889,7 @@ function Sidebar($$renderer, $$props) {
1889
1889
  let isResizing = false;
1890
1890
  const frontendExtensions = getFrontendExtensions();
1891
1891
  const sidebarTopExtensions = $.derived(() => resolveExtensions(frontendExtensions.sidebarTop, { pathname: page.url.pathname }));
1892
+ const sidebarFooterActions = $.derived(() => resolveExtensions(frontendExtensions.sidebarFooterActions, { pathname: page.url.pathname }));
1892
1893
  const navigationExtensions = $.derived(() => resolveExtensions(frontendExtensions.navigation, { pathname: page.url.pathname }));
1893
1894
  onMount(() => {
1894
1895
  const refreshWorkspaceViews = () => {
@@ -2028,14 +2029,40 @@ function Sidebar($$renderer, $$props) {
2028
2029
  $$renderer.push(`<!--]--> <div class="border-t border-border p-2">`);
2029
2030
  if (isCollapsed()) {
2030
2031
  $$renderer.push("<!--[0-->");
2031
- $$renderer.push(`<div class="flex flex-col items-center gap-2"><button type="button" class="flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground"${$.attr("title", settings_title())}${$.attr("aria-label", settings_title())}>`);
2032
+ $$renderer.push(`<div class="flex flex-col items-center gap-2"><!--[-->`);
2033
+ const each_array_4 = $.ensure_array_like(sidebarFooterActions());
2034
+ for (let $$index_4 = 0, $$length = each_array_4.length; $$index_4 < $$length; $$index_4++) {
2035
+ const FooterAction = each_array_4[$$index_4].component;
2036
+ if (FooterAction) {
2037
+ $$renderer.push("<!--[-->");
2038
+ FooterAction($$renderer, { collapsed: true });
2039
+ $$renderer.push("<!--]-->");
2040
+ } else {
2041
+ $$renderer.push("<!--[!-->");
2042
+ $$renderer.push("<!--]-->");
2043
+ }
2044
+ }
2045
+ $$renderer.push(`<!--]--> <button type="button" class="flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground"${$.attr("title", settings_title())}${$.attr("aria-label", settings_title())}>`);
2032
2046
  Settings($$renderer, { class: "size-4" });
2033
2047
  $$renderer.push(`<!----></button> <a href="https://docsmint.com" target="_blank" rel="noopener noreferrer" class="flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"${$.attr("title", sidebar_powered_by())}${$.attr("aria-label", sidebar_powered_by())}><img src="/favicon.ico" alt="DocsMint" class="size-5 object-contain dark:hidden"/> <img src="/favicon_white.ico" alt="" aria-hidden="true" class="hidden size-5 object-contain dark:block"/></a></div>`);
2034
2048
  } else {
2035
2049
  $$renderer.push("<!--[-1-->");
2036
- $$renderer.push(`<div class="flex items-center justify-between"><a href="https://docsmint.com" target="_blank" rel="noopener noreferrer" class="text-xs text-muted-foreground hover:text-foreground transition-colors"${$.attr("title", sidebar_powered_by())}>${$.escape(sidebar_powered_by())}</a> <button type="button" class="flex size-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground"${$.attr("title", settings_title())}${$.attr("aria-label", settings_title())}>`);
2050
+ $$renderer.push(`<div class="flex items-center justify-between"><a href="https://docsmint.com" target="_blank" rel="noopener noreferrer" class="text-xs text-muted-foreground hover:text-foreground transition-colors"${$.attr("title", sidebar_powered_by())}>${$.escape(sidebar_powered_by())}</a> <div class="flex items-center gap-1"><!--[-->`);
2051
+ const each_array_5 = $.ensure_array_like(sidebarFooterActions());
2052
+ for (let $$index_5 = 0, $$length = each_array_5.length; $$index_5 < $$length; $$index_5++) {
2053
+ const FooterAction = each_array_5[$$index_5].component;
2054
+ if (FooterAction) {
2055
+ $$renderer.push("<!--[-->");
2056
+ FooterAction($$renderer, { collapsed: false });
2057
+ $$renderer.push("<!--]-->");
2058
+ } else {
2059
+ $$renderer.push("<!--[!-->");
2060
+ $$renderer.push("<!--]-->");
2061
+ }
2062
+ }
2063
+ $$renderer.push(`<!--]--> <button type="button" class="flex size-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground"${$.attr("title", settings_title())}${$.attr("aria-label", settings_title())}>`);
2037
2064
  Settings($$renderer, { class: "size-4" });
2038
- $$renderer.push(`<!----></button></div>`);
2065
+ $$renderer.push(`<!----></button></div></div>`);
2039
2066
  }
2040
2067
  $$renderer.push(`<!--]--></div></aside> `);
2041
2068
  SettingsDialog($$renderer, {
@@ -1,4 +1,4 @@
1
- import { _n as action_cancel, ar as tags_name_placeholder, bn as error_generic, mn as action_create, or as tags_edit, sr as tags_new, un as action_loading, vn as action_save } from "./messages-D-auzk9H.js";
1
+ import { _n as action_cancel, ar as tags_new, bn as error_generic, ir as tags_edit, mn as action_create, rr as tags_name_placeholder, un as action_loading, vn as action_save } from "./messages-BAQzILs4.js";
2
2
  import { t as Loader_circle } from "./loader-circle-CIEWGyfP.js";
3
3
  import { a as getDocsmintRequestAdapter } from "./route-context-BPRerEtZ.js";
4
4
  import { t as cn } from "./utils-DvZnctjz.js";
@@ -29,14 +29,15 @@ function presignAttachment(documentId, file, fetcher) {
29
29
  * already been PUT to storage. The backend verifies the object exists
30
30
  * before inserting.
31
31
  */
32
- function confirmAttachment(documentId, key, file, fetcher) {
32
+ function confirmAttachment(documentId, key, file, quotaReservationId, fetcher) {
33
33
  return apiFetch(`/api/documents/${documentId}/attachments/confirm`, {
34
34
  method: "POST",
35
35
  body: {
36
36
  key,
37
37
  filename: file.name,
38
38
  contentType: file.type,
39
- size: file.size
39
+ size: file.size,
40
+ ...quotaReservationId ? { quotaReservationId } : {}
40
41
  }
41
42
  }, fetcher);
42
43
  }
@@ -66,11 +67,17 @@ async function uploadAttachment(documentId, file, fetcher) {
66
67
  headers: { "Content-Type": file.type },
67
68
  signal: putController.signal
68
69
  });
70
+ } catch (error) {
71
+ await confirmAttachment(documentId, presign.key, file, presign.quotaReservationId, fetcher).catch(() => void 0);
72
+ throw error;
69
73
  } finally {
70
74
  clearTimeout(putTimeout);
71
75
  }
72
- if (!putResponse.ok) throw new Error(`Storage upload failed: ${putResponse.status} ${putResponse.statusText}`);
73
- return confirmAttachment(documentId, presign.key, file, fetcher);
76
+ if (!putResponse.ok) {
77
+ await confirmAttachment(documentId, presign.key, file, presign.quotaReservationId, fetcher).catch(() => void 0);
78
+ throw new Error(`Storage upload failed: ${putResponse.status} ${putResponse.statusText}`);
79
+ }
80
+ return confirmAttachment(documentId, presign.key, file, presign.quotaReservationId, fetcher);
74
81
  }
75
82
  function listAttachments(documentId, fetcher) {
76
83
  return apiFetch(`/api/documents/${documentId}/attachments`, {}, fetcher);
@@ -1,4 +1,4 @@
1
- import { O as doc_new_folder_name, Sr as folders_new, _n as action_cancel, bn as error_generic, mn as action_create, vn as action_save, yr as folders_rename } from "./messages-D-auzk9H.js";
1
+ import { O as doc_new_folder_name, _n as action_cancel, _r as folders_rename, bn as error_generic, br as folders_new, mn as action_create, vn as action_save } from "./messages-BAQzILs4.js";
2
2
  import { t as Icon } from "./Icon-QwirKi9Y.js";
3
3
  import { t as Circle_check } from "./circle-check-CPS9dKEo.js";
4
4
  import { t as Loader_circle } from "./loader-circle-CIEWGyfP.js";
@@ -9,6 +9,7 @@ import { createContext } from "svelte";
9
9
  function createFrontendExtensions(initial = {}) {
10
10
  return {
11
11
  sidebarTop: [...initial.sidebarTop ?? []],
12
+ sidebarFooterActions: [...initial.sidebarFooterActions ?? []],
12
13
  navigation: [...initial.navigation ?? []],
13
14
  dashboardWidgets: [...initial.dashboardWidgets ?? []],
14
15
  searchWidgets: [...initial.searchWidgets ?? []],
@@ -16,6 +17,7 @@ function createFrontendExtensions(initial = {}) {
16
17
  editorActions: [...initial.editorActions ?? []],
17
18
  documentMenuActions: [...initial.documentMenuActions ?? []],
18
19
  settingsSections: [...initial.settingsSections ?? []],
20
+ profileActions: [...initial.profileActions ?? []],
19
21
  commandPaletteActions: [...initial.commandPaletteActions ?? []],
20
22
  sharedDocumentHeaderActions: [...initial.sharedDocumentHeaderActions ?? []],
21
23
  sharedDocumentTabs: [...initial.sharedDocumentTabs ?? []],
@@ -11144,4 +11144,4 @@ var messages_exports = /* @__PURE__ */ __exportAll({
11144
11144
  weekday_we: () => weekday_we
11145
11145
  });
11146
11146
  //#endregion
11147
- export { month_august as $, search_tags as $n, editor_toolbar_list as $t, editor_highlight_gray as A, settings_email as An, doc_tags as Ar, version_snapshot_description_placeholder as At, date_picker_aria as B, share_guest_access as Bn, dashboard_title as Br, editor_markdown_placeholder as Bt, categories_new as C, change_password as Cn, doc_move_to_folder as Cr, version_badge_snapshot as Ct, sidebar_powered_by as D, settings_save as Dn, doc_updated as Dr, version_snapshot_dialog_title as Dt, scroll_to_top_aria as E, password_label as En, doc_open_menu as Er, version_snapshot_dialog_description as Et, editor_highlight_red as F, settings_appearance as Fn, doc_title_label as Fr, version_restore_confirm as Ft, weekday_th as G, share_expires_never as Gn, editor_toolbar_emoji as Gt, weekday_su as H, share_expires_7d as Hn, app_name as Hr, editor_enter_url as Ht, editor_highlight_orange as I, settings_account as In, doc_title_placeholder as Ir, version_restore_short as It, weekday_mo as J, share_password_protection as Jn, editor_toolbar_redo as Jt, weekday_we as K, share_expires as Kn, editor_toolbar_text_formatting as Kt, editor_highlight_yellow as L, settings_profile as Ln, dashboard_page_title as Lr, version_restore as Lt, editor_highlight_purple as M, theme_dark as Mn, doc_delete_success as Mr, version_snapshot_description as Mt, editor_highlight_blue as N, theme_light as Nn, doc_delete_confirm as Nr, version_snapshot_label as Nt, doc_new_folder_name as O, settings_name as On, doc_delete as Or, version_snapshot_creating as Ot, editor_highlight_green as P, settings_theme as Pn, doc_content_placeholder as Pr, version_create_snapshot as Pt, month_september as Q, search_date_from as Qn, editor_toolbar_heading as Qt, editor_anonymous as R, settings_title as Rn, dashboard_new_document as Rr, version_history_title as Rt, categories_create_title as S, auth_password as Sn, folders_new as Sr, version_restored_from as St, version_history_empty as T, new_password as Tn, doc_open as Tr, version_filter_all as Tt, weekday_sa as U, share_expires_1d as Un, locales as Ur, editor_toolbar_copy as Ut, date_picker_placeholder as V, share_expires_30d as Vn, nav_documents as Vr, editor_content_label as Vt, weekday_fr as W, share_expires_1h as Wn, setLocale as Wr, editor_toolbar_align as Wt, month_november as X, share_create_title as Xn, editor_toolbar_horizontal_rule as Xt, month_december as Y, share_create_link as Yn, editor_toolbar_undo as Yt, month_october as Z, search_date_to as Zn, editor_toolbar_code_block as Zt, categories_delete_error as _, action_cancel as _n, folders_delete_title as _r, folder_page_title as _t, import_progress_error as a, sidebar_folders as an, tags_name_placeholder as ar, month_february as at, categories_name_placeholder as b, error_generic as bn, folders_empty_description as br, editor_more_options as bt, import_progress_queued as c, time_hours_ago as cn, folders_move as cr, search_empty_description as ct, import_progress_title as d, action_go_to as dn, folders_document as dr, search_folders as dt, editor_toolbar_image as en, search_placeholder as er, month_july as et, sidebar_uncategorized as f, action_back as fn, folders_documents as fr, search_clear_all_filters as ft, categories_delete_title as g, action_delete as gn, folders_delete_description as gr, share_copied as gt, categories_delete_description as h, action_edit as hn, folders_delete_success as hr, search_title_with_query as ht, import_progress_summary as i, editor_toolbar_bold as in, tags_delete_title as ir, month_march as it, editor_highlight_pink as j, theme_system as jn, doc_delete_success_description as jr, version_snapshot_label_placeholder as jt, dashboard_import as k, settings_email_change_warning as kn, doc_share as kr, version_snapshot_create as kt, import_progress_uploading as l, time_minutes_ago as ln, folders_subfolder as lr, search_empty_title as lt, categories_delete_success as m, action_create as mn, folders_delete_success_description as mr, search_input_placeholder as mt, import_progress_empty as n, editor_toolbar_underline as nn, tags_add as nr, month_may as nt, import_progress_done as o, sidebar_recent as on, tags_edit as or, month_january as ot, categories_delete_success_description as p, action_close as pn, folders_name_placeholder as pr, search_toggle_filters as pt, weekday_tu as q, share_toggle_password as qn, editor_toolbar_highlight as qt, import_progress_close as r, editor_toolbar_italic as rn, tags_delete_description as rr, month_april as rt, import_progress_processing as s, time_days_ago as sn, tags_new as sr, search_popular as st, messages_exports as t, editor_toolbar_link as tn, search_title as tr, month_june as tt, import_progress_total as u, action_loading as un, folders_subfolders as ur, search_date_range as ut, categories_update_error as v, action_save as vn, folders_delete as vr, tags_load_error as vt, categories_title as w, confirm_password as wn, doc_duplicate as wr, version_filter_snapshots as wt, categories_edit_title as x, auth_logout as xn, folders_empty as xr, version_restore_failed as xt, categories_create_error as y, error_server as yn, folders_rename as yr, action_copy_content as yt, error_validation as z, share_add as zn, dashboard_subtitle as zr, editor_markdown_label as zt };
11147
+ export { month_august as $, search_title as $n, editor_toolbar_list as $t, editor_highlight_gray as A, settings_email as An, doc_delete_success as Ar, version_snapshot_description_placeholder as At, date_picker_aria as B, share_expires_7d as Bn, app_name as Br, editor_markdown_placeholder as Bt, categories_new as C, change_password as Cn, doc_open as Cr, version_badge_snapshot as Ct, sidebar_powered_by as D, settings_save as Dn, doc_share as Dr, version_snapshot_dialog_title as Dt, scroll_to_top_aria as E, password_label as En, doc_delete as Er, version_snapshot_dialog_description as Et, editor_highlight_red as F, settings_appearance as Fn, dashboard_page_title as Fr, version_restore_confirm as Ft, weekday_th as G, share_toggle_password as Gn, editor_toolbar_emoji as Gt, weekday_su as H, share_expires_1h as Hn, setLocale as Hr, editor_enter_url as Ht, editor_highlight_orange as I, settings_account as In, dashboard_new_document as Ir, version_restore_short as It, weekday_mo as J, share_create_title as Jn, editor_toolbar_redo as Jt, weekday_we as K, share_password_protection as Kn, editor_toolbar_text_formatting as Kt, editor_highlight_yellow as L, settings_profile as Ln, dashboard_subtitle as Lr, version_restore as Lt, editor_highlight_purple as M, theme_dark as Mn, doc_content_placeholder as Mr, version_snapshot_description as Mt, editor_highlight_blue as N, theme_light as Nn, doc_title_label as Nr, version_snapshot_label as Nt, doc_new_folder_name as O, settings_name as On, doc_tags as Or, version_snapshot_creating as Ot, editor_highlight_green as P, settings_theme as Pn, doc_title_placeholder as Pr, version_create_snapshot as Pt, month_september as Q, search_placeholder as Qn, editor_toolbar_heading as Qt, editor_anonymous as R, settings_title as Rn, dashboard_title as Rr, version_history_title as Rt, categories_create_title as S, auth_password as Sn, doc_duplicate as Sr, version_restored_from as St, version_history_empty as T, new_password as Tn, doc_updated as Tr, version_filter_all as Tt, weekday_sa as U, share_expires_never as Un, editor_toolbar_copy as Ut, date_picker_placeholder as V, share_expires_1d as Vn, locales as Vr, editor_content_label as Vt, weekday_fr as W, share_expires as Wn, editor_toolbar_align as Wt, month_november as X, search_date_from as Xn, editor_toolbar_horizontal_rule as Xt, month_december as Y, search_date_to as Yn, editor_toolbar_undo as Yt, month_october as Z, search_tags as Zn, editor_toolbar_code_block as Zt, categories_delete_error as _, action_cancel as _n, folders_rename as _r, folder_page_title as _t, import_progress_error as a, sidebar_folders as an, tags_new as ar, month_february as at, categories_name_placeholder as b, error_generic as bn, folders_new as br, editor_more_options as bt, import_progress_queued as c, time_hours_ago as cn, folders_subfolders as cr, search_empty_description as ct, import_progress_title as d, action_go_to as dn, folders_name_placeholder as dr, search_folders as dt, editor_toolbar_image as en, tags_add as er, month_july as et, sidebar_uncategorized as f, action_back as fn, folders_delete_success_description as fr, search_clear_all_filters as ft, categories_delete_title as g, action_delete as gn, folders_delete as gr, share_copied as gt, categories_delete_description as h, action_edit as hn, folders_delete_title as hr, search_title_with_query as ht, import_progress_summary as i, editor_toolbar_bold as in, tags_edit as ir, month_march as it, editor_highlight_pink as j, theme_system as jn, doc_delete_confirm as jr, version_snapshot_label_placeholder as jt, dashboard_import as k, settings_email_change_warning as kn, doc_delete_success_description as kr, version_snapshot_create as kt, import_progress_uploading as l, time_minutes_ago as ln, folders_document as lr, search_empty_title as lt, categories_delete_success as m, action_create as mn, folders_delete_description as mr, search_input_placeholder as mt, import_progress_empty as n, editor_toolbar_underline as nn, tags_delete_title as nr, month_may as nt, import_progress_done as o, sidebar_recent as on, folders_move as or, month_january as ot, categories_delete_success_description as p, action_close as pn, folders_delete_success as pr, search_toggle_filters as pt, weekday_tu as q, share_create_link as qn, editor_toolbar_highlight as qt, import_progress_close as r, editor_toolbar_italic as rn, tags_name_placeholder as rr, month_april as rt, import_progress_processing as s, time_days_ago as sn, folders_subfolder as sr, search_popular as st, messages_exports as t, editor_toolbar_link as tn, tags_delete_description as tr, month_june as tt, import_progress_total as u, action_loading as un, folders_documents as ur, search_date_range as ut, categories_update_error as v, action_save as vn, folders_empty_description as vr, tags_load_error as vt, categories_title as w, confirm_password as wn, doc_open_menu as wr, version_filter_snapshots as wt, categories_edit_title as x, auth_logout as xn, doc_move_to_folder as xr, version_restore_failed as xt, categories_create_error as y, error_server as yn, folders_empty as yr, action_copy_content as yt, error_validation as z, share_expires_30d as zn, nav_documents as zr, editor_markdown_label as zt };
@@ -9,6 +9,7 @@ var pendingDocumentPlacements = {};
9
9
  var globalFolderRefreshNonce = 0;
10
10
  function refreshFolders() {
11
11
  globalFolderRefreshNonce++;
12
+ for (const folderId of Object.keys(foldersRegistry)) refreshNonces[folderId] = (refreshNonces[folderId] ?? 0) + 1;
12
13
  }
13
14
  function getGlobalFolderRefreshNonce() {
14
15
  return globalFolderRefreshNonce;
@@ -1,2 +1,2 @@
1
- import { t as CategoryDialog } from "../assets/CategoryDialog-DDu37Oub.js";
1
+ import { t as CategoryDialog } from "../assets/CategoryDialog-BLxVoynx.js";
2
2
  export { CategoryDialog };
@@ -1,2 +1,2 @@
1
- import { t as CreateSnapshotDialog } from "../assets/CreateSnapshotDialog-DNAjd4eD.js";
1
+ import { t as CreateSnapshotDialog } from "../assets/CreateSnapshotDialog-b6O0nUVp.js";
2
2
  export { CreateSnapshotDialog };
@@ -1,4 +1,4 @@
1
- import { $t as editor_toolbar_list, A as editor_highlight_gray, F as editor_highlight_red, Gt as editor_toolbar_emoji, Ht as editor_enter_url, I as editor_highlight_orange, Jt as editor_toolbar_redo, Kt as editor_toolbar_text_formatting, L as editor_highlight_yellow, M as editor_highlight_purple, N as editor_highlight_blue, P as editor_highlight_green, Pr as doc_content_placeholder, Pt as version_create_snapshot, Qt as editor_toolbar_heading, R as editor_anonymous, Ut as editor_toolbar_copy, Vt as editor_content_label, Wt as editor_toolbar_align, Xt as editor_toolbar_horizontal_rule, Yt as editor_toolbar_undo, Zt as editor_toolbar_code_block, _n as action_cancel, en as editor_toolbar_image, in as editor_toolbar_bold, j as editor_highlight_pink, nn as editor_toolbar_underline, qt as editor_toolbar_highlight, rn as editor_toolbar_italic, tn as editor_toolbar_link, vn as action_save } from "../../assets/messages-D-auzk9H.js";
1
+ import { $t as editor_toolbar_list, A as editor_highlight_gray, F as editor_highlight_red, Gt as editor_toolbar_emoji, Ht as editor_enter_url, I as editor_highlight_orange, Jt as editor_toolbar_redo, Kt as editor_toolbar_text_formatting, L as editor_highlight_yellow, M as editor_highlight_purple, Mr as doc_content_placeholder, N as editor_highlight_blue, P as editor_highlight_green, Pt as version_create_snapshot, Qt as editor_toolbar_heading, R as editor_anonymous, Ut as editor_toolbar_copy, Vt as editor_content_label, Wt as editor_toolbar_align, Xt as editor_toolbar_horizontal_rule, Yt as editor_toolbar_undo, Zt as editor_toolbar_code_block, _n as action_cancel, en as editor_toolbar_image, in as editor_toolbar_bold, j as editor_highlight_pink, nn as editor_toolbar_underline, qt as editor_toolbar_highlight, rn as editor_toolbar_italic, tn as editor_toolbar_link, vn as action_save } from "../../assets/messages-BAQzILs4.js";
2
2
  import { t as Icon } from "../../assets/Icon-QwirKi9Y.js";
3
3
  import { t as Camera } from "../../assets/camera-D6s20LDi.js";
4
4
  import { t as Chevron_down } from "../../assets/chevron-down-CvqKATjM.js";
@@ -9,7 +9,7 @@ import { t as Input } from "../../assets/input-DezGsU3y.js";
9
9
  import { a as resolveOfflineIdentity } from "../../assets/identity-B3uHoDtf.js";
10
10
  import { n as getOfflineDB } from "../../assets/db-CnxeO66n.js";
11
11
  import { h as unregisterShortcut, u as registerShortcut } from "../../assets/keyboard.svelte-BgF47N3L.js";
12
- import { t as CreateSnapshotDialog } from "../../assets/CreateSnapshotDialog-DNAjd4eD.js";
12
+ import { t as CreateSnapshotDialog } from "../../assets/CreateSnapshotDialog-b6O0nUVp.js";
13
13
  import { r as editorExtensions } from "../../assets/editorExtensions-DUzwndMy.js";
14
14
  import { t as markdownToJson } from "../../assets/markdown-CjqvGi5W.js";
15
15
  import * as $ from "svelte/internal/server";
@@ -1,4 +1,4 @@
1
- import { Fr as doc_title_label, Ir as doc_title_placeholder } from "../../assets/messages-D-auzk9H.js";
1
+ import { Nr as doc_title_label, Pr as doc_title_placeholder } from "../../assets/messages-BAQzILs4.js";
2
2
  import * as $ from "svelte/internal/server";
3
3
  //#region src/lib/components/editor/DocumentTitle.svelte
4
4
  function DocumentTitle($$renderer, $$props) {