@bendyline/docblocks-react 1.1.0 → 1.1.2

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 (64) hide show
  1. package/README.md +23 -14
  2. package/dist/AppMenu/AppMenu.d.ts +11 -1
  3. package/dist/AppMenu/AppMenu.d.ts.map +1 -1
  4. package/dist/AppMenu/AppMenu.js +2 -2
  5. package/dist/AppMenu/AppMenu.js.map +1 -1
  6. package/dist/DocBlocksShell/DocBlocksShell.d.ts +23 -3
  7. package/dist/DocBlocksShell/DocBlocksShell.d.ts.map +1 -1
  8. package/dist/DocBlocksShell/DocBlocksShell.js +621 -94
  9. package/dist/DocBlocksShell/DocBlocksShell.js.map +1 -1
  10. package/dist/Export/ExportDialog.d.ts.map +1 -1
  11. package/dist/Export/ExportDialog.js +123 -7
  12. package/dist/Export/ExportDialog.js.map +1 -1
  13. package/dist/Export/ExportToolbarControls.d.ts.map +1 -1
  14. package/dist/Export/ExportToolbarControls.js +108 -17
  15. package/dist/Export/ExportToolbarControls.js.map +1 -1
  16. package/dist/Export/export-options.d.ts +35 -0
  17. package/dist/Export/export-options.d.ts.map +1 -1
  18. package/dist/Export/export-options.js +6 -1
  19. package/dist/Export/export-options.js.map +1 -1
  20. package/dist/Export/run-export.d.ts.map +1 -1
  21. package/dist/Export/run-export.js +185 -97
  22. package/dist/Export/run-export.js.map +1 -1
  23. package/dist/Export/transform-summaries.d.ts +7 -0
  24. package/dist/Export/transform-summaries.d.ts.map +1 -0
  25. package/dist/Export/transform-summaries.js +6 -0
  26. package/dist/Export/transform-summaries.js.map +1 -0
  27. package/dist/FileExplorer/FileExplorer.d.ts.map +1 -1
  28. package/dist/FileExplorer/FileExplorer.js +17 -2
  29. package/dist/FileExplorer/FileExplorer.js.map +1 -1
  30. package/dist/WorkspacePicker/WorkspaceSettingsButton.d.ts +2 -1
  31. package/dist/WorkspacePicker/WorkspaceSettingsButton.d.ts.map +1 -1
  32. package/dist/WorkspacePicker/WorkspaceSettingsButton.js +2 -2
  33. package/dist/WorkspacePicker/WorkspaceSettingsButton.js.map +1 -1
  34. package/dist/WorkspacePicker/WorkspaceSettingsDialog.d.ts +20 -0
  35. package/dist/WorkspacePicker/WorkspaceSettingsDialog.d.ts.map +1 -0
  36. package/dist/WorkspacePicker/WorkspaceSettingsDialog.js +36 -0
  37. package/dist/WorkspacePicker/WorkspaceSettingsDialog.js.map +1 -0
  38. package/dist/hooks/useAutoSave.d.ts +8 -2
  39. package/dist/hooks/useAutoSave.d.ts.map +1 -1
  40. package/dist/hooks/useAutoSave.js +65 -30
  41. package/dist/hooks/useAutoSave.js.map +1 -1
  42. package/dist/monaco-slim.d.ts +19 -0
  43. package/dist/monaco-slim.d.ts.map +1 -0
  44. package/dist/monaco-slim.js +19 -0
  45. package/dist/monaco-slim.js.map +1 -0
  46. package/dist/preferences/versioning.d.ts +27 -0
  47. package/dist/preferences/versioning.d.ts.map +1 -0
  48. package/dist/preferences/versioning.js +62 -0
  49. package/dist/preferences/versioning.js.map +1 -0
  50. package/package.json +14 -10
  51. package/src/AppMenu/AppMenu.tsx +64 -1
  52. package/src/DocBlocksShell/DocBlocksShell.tsx +839 -116
  53. package/src/Export/ExportDialog.tsx +236 -26
  54. package/src/Export/ExportToolbarControls.tsx +151 -21
  55. package/src/Export/export-options.ts +43 -1
  56. package/src/Export/run-export.ts +208 -97
  57. package/src/Export/transform-summaries.ts +14 -0
  58. package/src/FileExplorer/FileExplorer.tsx +31 -9
  59. package/src/WorkspacePicker/WorkspaceSettingsButton.tsx +9 -0
  60. package/src/WorkspacePicker/WorkspaceSettingsDialog.tsx +121 -0
  61. package/src/hooks/useAutoSave.ts +87 -29
  62. package/src/monaco-slim.ts +20 -0
  63. package/src/preferences/versioning.ts +69 -0
  64. package/src/styles/docblocks.css +995 -53
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @bendyline/docblocks-react
2
2
 
3
- React components for DocBlocks — file explorer, workspace picker, editor shell, and export controls.
3
+ React components for DocBlocks — the complete editor shell (file explorer, workspace picker, app menu, export pipeline) plus the individual components and hooks it's built from. This is the package the DocBlocks web app and desktop renderer both mount.
4
4
 
5
5
  ## Installation
6
6
 
@@ -8,7 +8,7 @@ React components for DocBlocks — file explorer, workspace picker, editor shell
8
8
  npm install @bendyline/docblocks-react
9
9
  ```
10
10
 
11
- **Peer dependencies:** React 18 or 19, plus `@bendyline/docblocks` (core) and `@bendyline/squisq-editor-react`.
11
+ **Peer dependencies:** React 18 or 19. The DocBlocks core (`@bendyline/docblocks`) and the Squisq editor packages are regular dependencies and install automatically.
12
12
 
13
13
  ## Usage
14
14
 
@@ -17,7 +17,7 @@ import { DocBlocksShell } from '@bendyline/docblocks-react';
17
17
  import '@bendyline/docblocks-react/styles';
18
18
 
19
19
  function App() {
20
- return <DocBlocksShell theme="light" />;
20
+ return <DocBlocksShell theme="auto" />;
21
21
  }
22
22
  ```
23
23
 
@@ -25,46 +25,55 @@ function App() {
25
25
 
26
26
  ### DocBlocksShell
27
27
 
28
- The main application shell combines the file explorer, workspace picker, and squisq editor into a complete document editing experience.
28
+ The canonical DocBlocks experience in one component file explorer, workspace picker, app menu, the Squisq editor with its Editor / Markdown / Play views, and the export pipeline.
29
29
 
30
30
  ```tsx
31
- <DocBlocksShell theme="light" logoUrl="/logo.png" />
31
+ <DocBlocksShell theme="auto" logoUrl="/logo.png" />
32
32
  ```
33
33
 
34
- ### FileExplorer
34
+ - `theme` — `'light' | 'dark' | 'auto'` (auto follows `prefers-color-scheme`)
35
+ - `logoUrl` — brand mark for the app menu button
35
36
 
36
- File tree browser with create, rename, delete, and drag-and-drop support.
37
+ Storage is abstracted behind `FileSystemProvider` from `@bendyline/docblocks/filesystem`: browser-local (IndexedDB), native folders (File System Access API), or the Electron host.
38
+
39
+ ### FileExplorer / FileTreeNode
40
+
41
+ File tree browser with inline create (file + folder), rename, delete, and refresh. Long names truncate gracefully.
37
42
 
38
43
  ### WorkspacePicker
39
44
 
40
- Dropdown for switching between workspaces (IndexedDB or native filesystem handles).
45
+ Dropdown for switching between workspaces, creating new ones, and opening local folders, plus the per-workspace settings dialog (rename, download, remove, version-history overrides).
41
46
 
42
47
  ### AppMenu
43
48
 
44
- Top menu bar with branding and about dialog.
49
+ Top-left brand menu with the app-wide **Settings** dialog (theme preference, global version-history default), optional "Download all workspaces," and the **About** dialog.
45
50
 
46
51
  ### ExportToolbarControls / ExportDialog
47
52
 
48
- Export functionality supporting DOCX, PDF, PPTX, HTML, and Markdown output formats with theme and transform options.
53
+ The export flow: quick re-export of the last configuration plus the full dialog — format (PDF, Word, PowerPoint, HTML, Markdown), visual theme, and page size.
49
54
 
50
55
  ## Hooks
51
56
 
52
57
  ### `useAutoSave(content, save, delay?)`
53
58
 
54
- Debounced auto-save hook (default 500ms delay).
59
+ Debounced auto-save (default 500ms).
55
60
 
56
61
  ### `useFileTree(provider)`
57
62
 
58
- File tree state management — returns the tree structure, selected file, and mutation functions.
63
+ File tree state management over any `FileSystemProvider` — returns the tree, selection, and mutation functions.
59
64
 
60
65
  ## Styles
61
66
 
62
- Import the stylesheet to get the default DocBlocks styling:
63
-
64
67
  ```ts
65
68
  import '@bendyline/docblocks-react/styles';
66
69
  ```
67
70
 
71
+ One stylesheet (`docblocks.css`) covers all components in both themes. The package also bundles the self-hosted woff2 fonts used by document themes (see `NOTICE.md` at the repo root for licenses).
72
+
73
+ ## Where new UI belongs
74
+
75
+ Cross-surface UI that lives inside the shell chrome (file tree, workspace picker, app menu, export dialog) belongs here. The VS Code extension is the deliberate exception — its webview mounts Squisq's `EditorShell` directly because VS Code provides the file explorer, workspace, and theme itself.
76
+
68
77
  ## License
69
78
 
70
79
  MIT
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * AppMenu — top-left dropdown with workspace actions and app links.
3
3
  */
4
+ import type { VersioningPreference } from '../preferences/versioning.js';
4
5
  export type ThemePreference = 'auto' | 'light' | 'dark';
5
6
  export interface AppMenuProps {
6
7
  /** URL for the about page. */
@@ -11,6 +12,15 @@ export interface AppMenuProps {
11
12
  themePreference?: ThemePreference;
12
13
  /** Called when the user changes the theme preference. */
13
14
  onThemeChange?: (theme: ThemePreference) => void;
15
+ /** Current global versioning preference. */
16
+ versioningPreference?: VersioningPreference;
17
+ /** Called when the user changes the global versioning preference. */
18
+ onVersioningPreferenceChange?: (pref: VersioningPreference) => void;
19
+ /**
20
+ * Called when the user clicks "Download all workspaces". When omitted,
21
+ * the menu item is hidden.
22
+ */
23
+ onDownloadAllWorkspaces?: () => void | Promise<void>;
14
24
  }
15
- export declare function AppMenu({ aboutUrl: _aboutUrl, logoUrl, themePreference, onThemeChange, }: AppMenuProps): import("react/jsx-runtime").JSX.Element;
25
+ export declare function AppMenu({ aboutUrl: _aboutUrl, logoUrl, themePreference, onThemeChange, versioningPreference, onVersioningPreferenceChange, onDownloadAllWorkspaces, }: AppMenuProps): import("react/jsx-runtime").JSX.Element;
16
26
  //# sourceMappingURL=AppMenu.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AppMenu.d.ts","sourceRoot":"","sources":["../../src/AppMenu/AppMenu.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAIH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAExD,MAAM,WAAW,YAAY;IAC3B,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gCAAgC;IAChC,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,yDAAyD;IACzD,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;CAClD;AAED,wBAAgB,OAAO,CAAC,EACtB,QAAQ,EAAE,SAAoB,EAC9B,OAAO,EACP,eAAwB,EACxB,aAAa,GACd,EAAE,YAAY,2CAgLd"}
1
+ {"version":3,"file":"AppMenu.d.ts","sourceRoot":"","sources":["../../src/AppMenu/AppMenu.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEzE,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAExD,MAAM,WAAW,YAAY;IAC3B,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gCAAgC;IAChC,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,yDAAyD;IACzD,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IACjD,4CAA4C;IAC5C,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,qEAAqE;IACrE,4BAA4B,CAAC,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,IAAI,CAAC;IACpE;;;OAGG;IACH,uBAAuB,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtD;AAED,wBAAgB,OAAO,CAAC,EACtB,QAAQ,EAAE,SAAoB,EAC9B,OAAO,EACP,eAAwB,EACxB,aAAa,EACb,oBAAqC,EACrC,4BAA4B,EAC5B,uBAAuB,GACxB,EAAE,YAAY,2CAkOd"}
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
3
3
  * AppMenu — top-left dropdown with workspace actions and app links.
4
4
  */
5
5
  import { useState, useCallback, useRef, useEffect } from 'react';
6
- export function AppMenu({ aboutUrl: _aboutUrl = '#about', logoUrl, themePreference = 'auto', onThemeChange, }) {
6
+ export function AppMenu({ aboutUrl: _aboutUrl = '#about', logoUrl, themePreference = 'auto', onThemeChange, versioningPreference = 'browser-only', onVersioningPreferenceChange, onDownloadAllWorkspaces, }) {
7
7
  const [isOpen, setIsOpen] = useState(false);
8
8
  const [showAbout, setShowAbout] = useState(false);
9
9
  const [showSettings, setShowSettings] = useState(false);
@@ -23,6 +23,6 @@ export function AppMenu({ aboutUrl: _aboutUrl = '#about', logoUrl, themePreferen
23
23
  setIsOpen(false);
24
24
  action();
25
25
  }, []);
26
- return (_jsxs(_Fragment, { children: [_jsxs("div", { ref: menuRef, className: "db-app-menu", children: [_jsxs("button", { className: "db-app-menu-btn", onClick: () => setIsOpen(!isOpen), "aria-expanded": isOpen, "aria-haspopup": "true", children: [logoUrl ? (_jsx("img", { src: logoUrl, alt: "docblocks", className: "db-app-menu-logo" })) : (_jsx("span", { className: "db-app-menu-label", children: "docblocks" })), _jsx("span", { className: `db-app-menu-caret${isOpen ? ' db-app-menu-caret--open' : ''}`, children: '\u25BE' })] }), isOpen && (_jsxs("div", { className: "db-app-menu-dropdown", role: "menu", children: [_jsx("button", { className: "db-app-menu-item", role: "menuitem", onClick: () => handleAction(() => setShowSettings(true)), children: "Settings" }), _jsx("div", { className: "db-app-menu-divider" }), _jsx("button", { className: "db-app-menu-item", role: "menuitem", onClick: () => handleAction(() => setShowAbout(true)), children: "About" })] }))] }), showSettings && (_jsx("div", { className: "db-dialog-overlay", onClick: () => setShowSettings(false), children: _jsxs("div", { className: "db-dialog", role: "dialog", "aria-label": "Settings", onClick: (e) => e.stopPropagation(), children: [_jsxs("div", { className: "db-dialog-header", children: [_jsx("h2", { className: "db-dialog-title", children: "Settings" }), _jsx("button", { className: "db-dialog-close", onClick: () => setShowSettings(false), "aria-label": "Close", children: "\u00D7" })] }), _jsx("div", { className: "db-dialog-body", children: _jsxs("fieldset", { className: "db-settings-fieldset", children: [_jsx("legend", { className: "db-settings-legend", children: "Theme" }), _jsxs("label", { className: "db-settings-radio", children: [_jsx("input", { type: "radio", name: "theme", value: "auto", checked: themePreference === 'auto', onChange: () => onThemeChange?.('auto') }), "System default"] }), _jsxs("label", { className: "db-settings-radio", children: [_jsx("input", { type: "radio", name: "theme", value: "light", checked: themePreference === 'light', onChange: () => onThemeChange?.('light') }), "Light"] }), _jsxs("label", { className: "db-settings-radio", children: [_jsx("input", { type: "radio", name: "theme", value: "dark", checked: themePreference === 'dark', onChange: () => onThemeChange?.('dark') }), "Dark"] })] }) })] }) })), showAbout && (_jsx("div", { className: "db-dialog-overlay", onClick: () => setShowAbout(false), children: _jsxs("div", { className: "db-dialog", role: "dialog", "aria-label": "About DocBlocks", onClick: (e) => e.stopPropagation(), children: [_jsxs("div", { className: "db-dialog-header", children: [_jsx("h2", { className: "db-dialog-title", children: "About DocBlocks" }), _jsx("button", { className: "db-dialog-close", onClick: () => setShowAbout(false), "aria-label": "Close", children: "\u00D7" })] }), _jsxs("div", { className: "db-dialog-body", children: [_jsxs("p", { children: [_jsx("strong", { children: "DocBlocks" }), " is a markdown document editor that runs entirely in your browser. Your files stay on your device."] }), _jsxs("p", { children: ["Built on", ' ', _jsx("a", { href: "https://github.com/nicoth-in/squisq", target: "_blank", rel: "noopener noreferrer", children: "squisq" }), ' ', "by Bendyline."] }), _jsxs("p", { className: "db-dialog-links", children: [_jsx("a", { href: "https://github.com/bendyline/docblocks", target: "_blank", rel: "noopener noreferrer", children: "GitHub" }), _jsx("span", { className: "db-dialog-sep", children: "\u00B7" }), _jsx("a", { href: "https://github.com/bendyline/docblocks/blob/main/LICENSE", target: "_blank", rel: "noopener noreferrer", children: "License (MIT)" })] })] })] }) }))] }));
26
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { ref: menuRef, className: "db-app-menu", children: [_jsxs("button", { className: "db-app-menu-btn", onClick: () => setIsOpen(!isOpen), "aria-expanded": isOpen, "aria-haspopup": "true", children: [logoUrl ? (_jsx("img", { src: logoUrl, alt: "docblocks", className: "db-app-menu-logo" })) : (_jsx("span", { className: "db-app-menu-label", children: "docblocks" })), _jsx("span", { className: `db-app-menu-caret${isOpen ? ' db-app-menu-caret--open' : ''}`, children: '\u25BE' })] }), isOpen && (_jsxs("div", { className: "db-app-menu-dropdown", role: "menu", children: [_jsx("button", { className: "db-app-menu-item", role: "menuitem", onClick: () => handleAction(() => setShowSettings(true)), children: "Settings" }), onDownloadAllWorkspaces && (_jsx("button", { className: "db-app-menu-item", role: "menuitem", onClick: () => handleAction(() => void onDownloadAllWorkspaces()), children: "Download all workspaces" })), _jsx("div", { className: "db-app-menu-divider" }), _jsx("button", { className: "db-app-menu-item", role: "menuitem", onClick: () => handleAction(() => setShowAbout(true)), children: "About" })] }))] }), showSettings && (_jsx("div", { className: "db-dialog-overlay", onClick: () => setShowSettings(false), children: _jsxs("div", { className: "db-dialog", role: "dialog", "aria-label": "Settings", onClick: (e) => e.stopPropagation(), children: [_jsxs("div", { className: "db-dialog-header", children: [_jsx("h2", { className: "db-dialog-title", children: "Settings" }), _jsx("button", { className: "db-dialog-close", onClick: () => setShowSettings(false), "aria-label": "Close", children: "\u00D7" })] }), _jsxs("div", { className: "db-dialog-body", children: [_jsxs("fieldset", { className: "db-settings-fieldset", children: [_jsx("legend", { className: "db-settings-legend", children: "Theme" }), _jsxs("label", { className: "db-settings-radio", children: [_jsx("input", { type: "radio", name: "theme", value: "auto", checked: themePreference === 'auto', onChange: () => onThemeChange?.('auto') }), "System default"] }), _jsxs("label", { className: "db-settings-radio", children: [_jsx("input", { type: "radio", name: "theme", value: "light", checked: themePreference === 'light', onChange: () => onThemeChange?.('light') }), "Light"] }), _jsxs("label", { className: "db-settings-radio", children: [_jsx("input", { type: "radio", name: "theme", value: "dark", checked: themePreference === 'dark', onChange: () => onThemeChange?.('dark') }), "Dark"] })] }), onVersioningPreferenceChange && (_jsxs("fieldset", { className: "db-settings-fieldset", children: [_jsx("legend", { className: "db-settings-legend", children: "Version history" }), _jsxs("p", { className: "db-settings-hint", children: ["When on, DocBlocks keeps prior revisions of each document inside a sibling", ' ', _jsx("code", { children: "<name>_files/.versions/" }), " folder. Individual workspaces can override this default in their own settings."] }), _jsxs("label", { className: "db-settings-radio", children: [_jsx("input", { type: "radio", name: "versioning", value: "on", checked: versioningPreference === 'on', onChange: () => onVersioningPreferenceChange('on') }), "On for all workspaces"] }), _jsxs("label", { className: "db-settings-radio", children: [_jsx("input", { type: "radio", name: "versioning", value: "browser-only", checked: versioningPreference === 'browser-only', onChange: () => onVersioningPreferenceChange('browser-only') }), "On in browser workspaces, off for local folders"] }), _jsxs("label", { className: "db-settings-radio", children: [_jsx("input", { type: "radio", name: "versioning", value: "off", checked: versioningPreference === 'off', onChange: () => onVersioningPreferenceChange('off') }), "Off for all workspaces"] })] }))] })] }) })), showAbout && (_jsx("div", { className: "db-dialog-overlay", onClick: () => setShowAbout(false), children: _jsxs("div", { className: "db-dialog", role: "dialog", "aria-label": "About DocBlocks", onClick: (e) => e.stopPropagation(), children: [_jsxs("div", { className: "db-dialog-header", children: [_jsx("h2", { className: "db-dialog-title", children: "About DocBlocks" }), _jsx("button", { className: "db-dialog-close", onClick: () => setShowAbout(false), "aria-label": "Close", children: "\u00D7" })] }), _jsxs("div", { className: "db-dialog-body", children: [_jsxs("p", { children: [_jsx("strong", { children: "DocBlocks" }), " is a markdown document editor that runs entirely in your browser. Your files stay on your device."] }), _jsxs("p", { children: ["Built on", ' ', _jsx("a", { href: "https://github.com/bendyline/squisq", target: "_blank", rel: "noopener noreferrer", children: "squisq" }), ' ', "by Bendyline."] }), _jsxs("p", { className: "db-dialog-links", children: [_jsx("a", { href: "https://github.com/bendyline/docblocks", target: "_blank", rel: "noopener noreferrer", children: "GitHub" }), _jsx("span", { className: "db-dialog-sep", children: "\u00B7" }), _jsx("a", { href: "https://github.com/bendyline/docblocks/blob/main/LICENSE", target: "_blank", rel: "noopener noreferrer", children: "License (MIT)" })] })] })] }) }))] }));
27
27
  }
28
28
  //# sourceMappingURL=AppMenu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AppMenu.js","sourceRoot":"","sources":["../../src/AppMenu/AppMenu.tsx"],"names":[],"mappings":";AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAejE,MAAM,UAAU,OAAO,CAAC,EACtB,QAA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,CAAC,4BAA4B,CAAC,KAAK,CAAC,GACnD,8BAEI,IACC,CACZ,IACG,IACF,GACF,CACP,EAEA,SAAS,IAAI,CACZ,cAAK,SAAS,EAAC,mBAAmB,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,YACnE,eACE,SAAS,EAAC,WAAW,EACrB,IAAI,EAAC,QAAQ,gBACF,iBAAiB,EAC5B,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,aAEnC,eAAK,SAAS,EAAC,kBAAkB,aAC/B,aAAI,SAAS,EAAC,iBAAiB,gCAAqB,EACpD,iBACE,SAAS,EAAC,iBAAiB,EAC3B,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,gBACvB,OAAO,uBAGX,IACL,EACN,eAAK,SAAS,EAAC,gBAAgB,aAC7B,wBACE,yCAA0B,0GAExB,EACJ,oCACW,GAAG,EACZ,YACE,IAAI,EAAC,qCAAqC,EAC1C,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,qBAAqB,uBAGvB,EAAC,GAAG,qBAEN,EACJ,aAAG,SAAS,EAAC,iBAAiB,aAC5B,YACE,IAAI,EAAC,wCAAwC,EAC7C,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,qBAAqB,uBAGvB,EACJ,eAAM,SAAS,EAAC,eAAe,uBAAgB,EAC/C,YACE,IAAI,EAAC,0DAA0D,EAC/D,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,qBAAqB,8BAGvB,IACF,IACA,IACF,GACF,CACP,IACA,CACJ,CAAC;AACJ,CAAC"}
@@ -4,13 +4,33 @@
4
4
  * Composes the left sidebar (WorkspacePicker + FileExplorer) with
5
5
  * the center editor area (squisq EditorShell).
6
6
  */
7
- import type { EditorTheme } from '@bendyline/squisq-editor-react';
7
+ import type { EditorColorScheme } from '@bendyline/squisq-editor-react';
8
8
  import '@bendyline/squisq-editor-react/styles';
9
+ import { DocumentVersionManager, type PrunePolicy, type SaveVersionResult } from '@bendyline/squisq/versions';
9
10
  export interface DocBlocksShellProps {
10
11
  /** Optional theme override. Omit or pass 'auto' to follow OS preference. */
11
- theme?: EditorTheme | 'auto';
12
+ theme?: EditorColorScheme | 'auto';
12
13
  /** Optional logo image URL for the app menu. */
13
14
  logoUrl?: string;
15
+ /**
16
+ * Enable document version history. Snapshots are written under
17
+ * `<basename>_files/.versions/` next to each markdown file (i.e., the
18
+ * per-document container). Defaults to `true`.
19
+ */
20
+ allowVersioning?: boolean;
21
+ /**
22
+ * Override the document basename used in version filenames. Defaults
23
+ * to the basename of the currently selected file.
24
+ */
25
+ versionBasename?: string;
26
+ /** Prune policy applied after each successful save. Default: keep last 50. */
27
+ versioningPrunePolicy?: PrunePolicy;
28
+ /** Idle delay (ms) before the editor auto-saves a version. `0` disables. Default 5000. */
29
+ versioningAutoSaveIdleMs?: number;
30
+ /** Notified after each `saveVersion` attempt (saved=true and saved=false). */
31
+ onSaveVersion?: (result: SaveVersionResult) => void;
32
+ /** Optional escape hatch for hosts that want imperative access to the version manager. */
33
+ versioningRef?: React.Ref<DocumentVersionManager | null>;
14
34
  }
15
- export declare function DocBlocksShell({ theme: _themeProp, logoUrl }: DocBlocksShellProps): import("react/jsx-runtime").JSX.Element;
35
+ export declare function DocBlocksShell({ theme: _themeProp, logoUrl, allowVersioning, versionBasename, versioningPrunePolicy, versioningAutoSaveIdleMs, onSaveVersion, versioningRef, }: DocBlocksShellProps): import("react/jsx-runtime").JSX.Element;
16
36
  //# sourceMappingURL=DocBlocksShell.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DocBlocksShell.d.ts","sourceRoot":"","sources":["../../src/DocBlocksShell/DocBlocksShell.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAc,MAAM,gCAAgC,CAAC;AAC9E,OAAO,uCAAuC,CAAC;AA+B/C,MAAM,WAAW,mBAAmB;IACl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