@hiai-gg/docsmint 0.5.10 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/LICENSE +39 -8
  2. package/README.md +67 -43
  3. package/dist/backend/index.js +45 -12
  4. package/dist/client.d.ts +3 -1
  5. package/dist/client.js +2 -0
  6. package/dist/frontend/HiAiEditor-DSVG3GNd.js +2986 -0
  7. package/dist/frontend/SettingsDialog-BDNgf5rv.js +969 -0
  8. package/dist/frontend/ShareDialog-2Mty7hm4.js +258 -0
  9. package/dist/frontend/{Sidebar-CzcLd6v5.js → Sidebar-DX08utdV.js} +2 -2
  10. package/dist/frontend/app-shell.js +27 -26
  11. package/dist/frontend/components/editor/compact-editor.d.ts +3 -0
  12. package/dist/frontend/components/editor/compact-editor.js +36 -0
  13. package/dist/frontend/components/editor/document-editor.js +2 -2986
  14. package/dist/frontend/components/settings.js +1 -1
  15. package/dist/frontend/components/share-dialog.d.ts +2 -1
  16. package/dist/frontend/components/share-dialog.js +1 -1
  17. package/dist/frontend/components/sidebar.js +1 -1
  18. package/dist/frontend/dashboard.js +1 -1
  19. package/dist/frontend/editor-preferences.d.ts +4 -0
  20. package/dist/frontend/editor-preferences.js +2 -0
  21. package/dist/frontend/editor-preferences.svelte-Bt_A9k7n.js +61 -0
  22. package/dist/frontend/frontend.css +1 -1
  23. package/dist/frontend-ssr/app-shell.js +3 -2
  24. package/dist/frontend-ssr/assets/HiAiEditor-CUOJmKzT.js +2358 -0
  25. package/dist/frontend-ssr/assets/{SettingsDialog-DVp0OxPO.js → SettingsDialog-BjJIiVLc.js} +2 -64
  26. package/dist/frontend-ssr/assets/{ShareDialog-BZd28sg-.js → ShareDialog-C9C-XTm4.js} +1 -1
  27. package/dist/frontend-ssr/assets/{Sidebar-CqsMw0Hd.js → Sidebar-C2sUfGNk.js} +2 -2
  28. package/dist/frontend-ssr/assets/editor-preferences.svelte-iI5jJM1x.js +65 -0
  29. package/dist/frontend-ssr/components/editor/compact-editor.js +19 -0
  30. package/dist/frontend-ssr/components/editor/document-editor.js +1 -2357
  31. package/dist/frontend-ssr/components/settings.js +1 -1
  32. package/dist/frontend-ssr/components/share-dialog.js +1 -1
  33. package/dist/frontend-ssr/components/sidebar.js +1 -1
  34. package/dist/frontend-ssr/dashboard.js +1 -1
  35. package/dist/frontend-ssr/editor-preferences.js +2 -0
  36. package/dist/types.d.ts +5 -0
  37. package/package.json +16 -2
  38. package/packages/cli/src/index.ts +1 -1
  39. package/packages/mcp-server/src/index.ts +1 -1
  40. package/dist/frontend/SettingsDialog-CyZSOjLE.js +0 -1024
  41. package/dist/frontend/ShareDialog-BC-Jl6v1.js +0 -257
@@ -13,6 +13,7 @@ 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";
16
+ import { t as editorPreferences } from "./editor-preferences.svelte-iI5jJM1x.js";
16
17
  import { t as themeStore } from "./theme.svelte-Co0-ssaD.js";
17
18
  import * as $ from "svelte/internal/server";
18
19
  import { onMount } from "svelte";
@@ -456,69 +457,6 @@ async function cleanupOfflineData() {
456
457
  } catch {}
457
458
  }
458
459
  //#endregion
459
- //#region src/lib/stores/editor-preferences.ts
460
- var DEFAULT_EDITOR_PREFERENCES = {
461
- showVisualMode: true,
462
- showMarkdownMode: true,
463
- minimalToolbar: false,
464
- showScrollToTop: true
465
- };
466
- function normalizeEditorPreferences(value) {
467
- if (!value || typeof value !== "object") return { ...DEFAULT_EDITOR_PREFERENCES };
468
- const candidate = value;
469
- const requestedVisualMode = typeof candidate.showVisualMode === "boolean" ? candidate.showVisualMode : DEFAULT_EDITOR_PREFERENCES.showVisualMode;
470
- const showMarkdownMode = typeof candidate.showMarkdownMode === "boolean" ? candidate.showMarkdownMode : DEFAULT_EDITOR_PREFERENCES.showMarkdownMode;
471
- return {
472
- showVisualMode: requestedVisualMode || !showMarkdownMode,
473
- showMarkdownMode,
474
- minimalToolbar: typeof candidate.minimalToolbar === "boolean" ? candidate.minimalToolbar : DEFAULT_EDITOR_PREFERENCES.minimalToolbar,
475
- showScrollToTop: typeof candidate.showScrollToTop === "boolean" ? candidate.showScrollToTop : DEFAULT_EDITOR_PREFERENCES.showScrollToTop
476
- };
477
- }
478
- //#endregion
479
- //#region src/lib/stores/editor-preferences.svelte.ts
480
- var STORAGE_KEY = "docsmint-editor-preferences";
481
- var preferences$1 = { ...DEFAULT_EDITOR_PREFERENCES };
482
- var initialized$1 = false;
483
- function isBrowser() {
484
- return typeof window !== "undefined" && typeof localStorage !== "undefined";
485
- }
486
- function init$1() {
487
- if (!isBrowser() || initialized$1) return;
488
- initialized$1 = true;
489
- try {
490
- preferences$1 = normalizeEditorPreferences(JSON.parse(localStorage.getItem(STORAGE_KEY) ?? "null"));
491
- } catch {
492
- preferences$1 = { ...DEFAULT_EDITOR_PREFERENCES };
493
- }
494
- }
495
- function update$1(patch) {
496
- preferences$1 = normalizeEditorPreferences({
497
- ...preferences$1,
498
- ...patch
499
- });
500
- if (isBrowser()) localStorage.setItem(STORAGE_KEY, JSON.stringify(preferences$1));
501
- }
502
- var editorPreferences = {
503
- get value() {
504
- return preferences$1;
505
- },
506
- get showMarkdownMode() {
507
- return preferences$1.showMarkdownMode;
508
- },
509
- get showVisualMode() {
510
- return preferences$1.showVisualMode;
511
- },
512
- get minimalToolbar() {
513
- return preferences$1.minimalToolbar;
514
- },
515
- get showScrollToTop() {
516
- return preferences$1.showScrollToTop;
517
- },
518
- init: init$1,
519
- update: update$1
520
- };
521
- //#endregion
522
460
  //#region src/lib/stores/search-preferences.ts
523
461
  var DEFAULT_SEARCH_PREFERENCES = { graphSearchEnabled: true };
524
462
  var SEARCH_PREFERENCES_KEY = "docsmint:search-preferences";
@@ -1112,4 +1050,4 @@ function SettingsDialog($$renderer, $$props) {
1112
1050
  });
1113
1051
  }
1114
1052
  //#endregion
1115
- export { searchPreferences as n, editorPreferences as r, SettingsDialog as t };
1053
+ export { searchPreferences as n, SettingsDialog as t };
@@ -6,7 +6,7 @@ import * as $ from "svelte/internal/server";
6
6
  //#region src/lib/components/ShareDialog.svelte
7
7
  function ShareDialog($$renderer, $$props) {
8
8
  $$renderer.component(($$renderer) => {
9
- let { open = false, documentId = "", documentTitle = "", folderId = "", folderName = "", categoryId = "", categoryName = "" } = $$props;
9
+ let { open = false, documentId = "", documentTitle = "", folderId = "", folderName = "", categoryId = "", categoryName = "", onCreated } = $$props;
10
10
  let usePassword = false;
11
11
  let expiresIn = "7d";
12
12
  getDocsmintRequestAdapter();
@@ -6,7 +6,7 @@ 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-DVp0OxPO.js";
9
+ import { t as SettingsDialog } from "./SettingsDialog-BjJIiVLc.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";
@@ -23,7 +23,7 @@ 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-BZd28sg-.js";
26
+ import { t as ShareDialog } from "./ShareDialog-C9C-XTm4.js";
27
27
  import { t as CategoryDialog } from "./CategoryDialog-QHEv_9N4.js";
28
28
  import { n as createDocumentPlacementWriter, t as createDocumentDropCoordinator } from "./document-drop-coordinator-CEaYACsC.js";
29
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";
@@ -0,0 +1,65 @@
1
+ import "svelte/internal/server";
2
+ //#region src/lib/stores/editor-preferences.ts
3
+ var DEFAULT_EDITOR_PREFERENCES = {
4
+ showVisualMode: true,
5
+ showMarkdownMode: true,
6
+ minimalToolbar: false,
7
+ showScrollToTop: true
8
+ };
9
+ function normalizeEditorPreferences(value) {
10
+ if (!value || typeof value !== "object") return { ...DEFAULT_EDITOR_PREFERENCES };
11
+ const candidate = value;
12
+ const requestedVisualMode = typeof candidate.showVisualMode === "boolean" ? candidate.showVisualMode : DEFAULT_EDITOR_PREFERENCES.showVisualMode;
13
+ const showMarkdownMode = typeof candidate.showMarkdownMode === "boolean" ? candidate.showMarkdownMode : DEFAULT_EDITOR_PREFERENCES.showMarkdownMode;
14
+ return {
15
+ showVisualMode: requestedVisualMode || !showMarkdownMode,
16
+ showMarkdownMode,
17
+ minimalToolbar: typeof candidate.minimalToolbar === "boolean" ? candidate.minimalToolbar : DEFAULT_EDITOR_PREFERENCES.minimalToolbar,
18
+ showScrollToTop: typeof candidate.showScrollToTop === "boolean" ? candidate.showScrollToTop : DEFAULT_EDITOR_PREFERENCES.showScrollToTop
19
+ };
20
+ }
21
+ //#endregion
22
+ //#region src/lib/stores/editor-preferences.svelte.ts
23
+ var STORAGE_KEY = "docsmint-editor-preferences";
24
+ var preferences = { ...DEFAULT_EDITOR_PREFERENCES };
25
+ var initialized = false;
26
+ function isBrowser() {
27
+ return typeof window !== "undefined" && typeof localStorage !== "undefined";
28
+ }
29
+ function init() {
30
+ if (!isBrowser() || initialized) return;
31
+ initialized = true;
32
+ try {
33
+ preferences = normalizeEditorPreferences(JSON.parse(localStorage.getItem(STORAGE_KEY) ?? "null"));
34
+ } catch {
35
+ preferences = { ...DEFAULT_EDITOR_PREFERENCES };
36
+ }
37
+ }
38
+ function update(patch) {
39
+ preferences = normalizeEditorPreferences({
40
+ ...preferences,
41
+ ...patch
42
+ });
43
+ if (isBrowser()) localStorage.setItem(STORAGE_KEY, JSON.stringify(preferences));
44
+ }
45
+ var editorPreferences = {
46
+ get value() {
47
+ return preferences;
48
+ },
49
+ get showMarkdownMode() {
50
+ return preferences.showMarkdownMode;
51
+ },
52
+ get showVisualMode() {
53
+ return preferences.showVisualMode;
54
+ },
55
+ get minimalToolbar() {
56
+ return preferences.minimalToolbar;
57
+ },
58
+ get showScrollToTop() {
59
+ return preferences.showScrollToTop;
60
+ },
61
+ init,
62
+ update
63
+ };
64
+ //#endregion
65
+ export { DEFAULT_EDITOR_PREFERENCES as n, normalizeEditorPreferences as r, editorPreferences as t };
@@ -0,0 +1,19 @@
1
+ import { t as HiAiEditor } from "../../assets/HiAiEditor-CUOJmKzT.js";
2
+ import "svelte/internal/server";
3
+ //#region src/lib/components/editor/CompactEditor.svelte
4
+ function CompactEditor($$renderer, $$props) {
5
+ let { content = "", contentJson, placeholder, onUpdate = (_output) => {}, editable = true, collaboration = null, documentId = "", documentUpdatedAt = "" } = $$props;
6
+ HiAiEditor($$renderer, {
7
+ content,
8
+ contentJson,
9
+ placeholder,
10
+ onUpdate,
11
+ editable,
12
+ collaboration,
13
+ documentId,
14
+ documentUpdatedAt,
15
+ minimalToolbar: true
16
+ });
17
+ }
18
+ //#endregion
19
+ export { CompactEditor };