@bendyline/docblocks-react 1.1.2 → 2.1.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.
- package/README.md +37 -5
- package/dist/ExportDialog-7LDIXJZ3.js +10 -0
- package/dist/ExportDialog-7LDIXJZ3.js.map +1 -0
- package/dist/ExportToolbarControls-GHAOJMH6.js +508 -0
- package/dist/ExportToolbarControls-GHAOJMH6.js.map +1 -0
- package/dist/GitToolbarControl-GNMRVKWQ.js +136 -0
- package/dist/GitToolbarControl-GNMRVKWQ.js.map +1 -0
- package/dist/GitUI-VHOBQY43.js +1133 -0
- package/dist/GitUI-VHOBQY43.js.map +1 -0
- package/dist/LazyEditorShell-EF2BWRXU.js +6 -0
- package/dist/LazyEditorShell-EF2BWRXU.js.map +1 -0
- package/dist/ShareDialog-63ENBEDZ.js +213 -0
- package/dist/ShareDialog-63ENBEDZ.js.map +1 -0
- package/dist/chunk-4XXSWN3T.js +13 -0
- package/dist/chunk-4XXSWN3T.js.map +1 -0
- package/dist/chunk-57ZJJOC5.js +89 -0
- package/dist/chunk-57ZJJOC5.js.map +1 -0
- package/dist/chunk-5A4KEWKT.js +97 -0
- package/dist/chunk-5A4KEWKT.js.map +1 -0
- package/dist/chunk-DD4VFJQI.js +51 -0
- package/dist/chunk-DD4VFJQI.js.map +1 -0
- package/dist/chunk-FEWQUQML.js +256 -0
- package/dist/chunk-FEWQUQML.js.map +1 -0
- package/dist/chunk-FMGTHSTX.js +110 -0
- package/dist/chunk-FMGTHSTX.js.map +1 -0
- package/dist/chunk-UNYZQXWR.js +324 -0
- package/dist/chunk-UNYZQXWR.js.map +1 -0
- package/dist/chunk-VHDP4IPL.js +70 -0
- package/dist/chunk-VHDP4IPL.js.map +1 -0
- package/dist/chunk-ZI56BNB7.js +270 -0
- package/dist/chunk-ZI56BNB7.js.map +1 -0
- package/dist/editor.d.ts +11 -0
- package/dist/editor.js +9 -0
- package/dist/editor.js.map +1 -0
- package/dist/export/index.d.ts +93 -0
- package/dist/export/index.js +27 -0
- package/dist/export/index.js.map +1 -0
- package/dist/index.d.ts +346 -18
- package/dist/index.js +6169 -18
- package/dist/index.js.map +1 -1
- package/dist/run-export-ICTZITXC.js +10 -0
- package/dist/run-export-ICTZITXC.js.map +1 -0
- package/dist/settings/index.d.ts +36 -0
- package/dist/settings/index.js +14 -0
- package/dist/settings/index.js.map +1 -0
- package/package.json +33 -13
- package/src/styles/docblocks.css +2738 -132
- package/dist/AppMenu/AppMenu.d.ts +0 -26
- package/dist/AppMenu/AppMenu.d.ts.map +0 -1
- package/dist/AppMenu/AppMenu.js +0 -28
- package/dist/AppMenu/AppMenu.js.map +0 -1
- package/dist/AppMenu/index.d.ts +0 -3
- package/dist/AppMenu/index.d.ts.map +0 -1
- package/dist/AppMenu/index.js +0 -2
- package/dist/AppMenu/index.js.map +0 -1
- package/dist/DocBlocksShell/DocBlocksShell.d.ts +0 -36
- package/dist/DocBlocksShell/DocBlocksShell.d.ts.map +0 -1
- package/dist/DocBlocksShell/DocBlocksShell.js +0 -1351
- package/dist/DocBlocksShell/DocBlocksShell.js.map +0 -1
- package/dist/DocBlocksShell/index.d.ts +0 -3
- package/dist/DocBlocksShell/index.d.ts.map +0 -1
- package/dist/DocBlocksShell/index.js +0 -2
- package/dist/DocBlocksShell/index.js.map +0 -1
- package/dist/Export/ExportDialog.d.ts +0 -16
- package/dist/Export/ExportDialog.d.ts.map +0 -1
- package/dist/Export/ExportDialog.js +0 -158
- package/dist/Export/ExportDialog.js.map +0 -1
- package/dist/Export/ExportToolbarControls.d.ts +0 -17
- package/dist/Export/ExportToolbarControls.d.ts.map +0 -1
- package/dist/Export/ExportToolbarControls.js +0 -200
- package/dist/Export/ExportToolbarControls.js.map +0 -1
- package/dist/Export/export-options.d.ts +0 -53
- package/dist/Export/export-options.d.ts.map +0 -1
- package/dist/Export/export-options.js +0 -49
- package/dist/Export/export-options.js.map +0 -1
- package/dist/Export/index.d.ts +0 -6
- package/dist/Export/index.d.ts.map +0 -1
- package/dist/Export/index.js +0 -3
- package/dist/Export/index.js.map +0 -1
- package/dist/Export/run-export.d.ts +0 -8
- package/dist/Export/run-export.d.ts.map +0 -1
- package/dist/Export/run-export.js +0 -296
- package/dist/Export/run-export.js.map +0 -1
- package/dist/Export/transform-summaries.d.ts +0 -7
- package/dist/Export/transform-summaries.d.ts.map +0 -1
- package/dist/Export/transform-summaries.js +0 -6
- package/dist/Export/transform-summaries.js.map +0 -1
- package/dist/FileExplorer/FileExplorer.d.ts +0 -21
- package/dist/FileExplorer/FileExplorer.d.ts.map +0 -1
- package/dist/FileExplorer/FileExplorer.js +0 -140
- package/dist/FileExplorer/FileExplorer.js.map +0 -1
- package/dist/FileExplorer/FileTreeNode.d.ts +0 -18
- package/dist/FileExplorer/FileTreeNode.d.ts.map +0 -1
- package/dist/FileExplorer/FileTreeNode.js +0 -112
- package/dist/FileExplorer/FileTreeNode.js.map +0 -1
- package/dist/FileExplorer/index.d.ts +0 -6
- package/dist/FileExplorer/index.d.ts.map +0 -1
- package/dist/FileExplorer/index.js +0 -4
- package/dist/FileExplorer/index.js.map +0 -1
- package/dist/FileExplorer/useFileTree.d.ts +0 -35
- package/dist/FileExplorer/useFileTree.d.ts.map +0 -1
- package/dist/FileExplorer/useFileTree.js +0 -124
- package/dist/FileExplorer/useFileTree.js.map +0 -1
- package/dist/WorkspacePicker/WorkspacePicker.d.ts +0 -17
- package/dist/WorkspacePicker/WorkspacePicker.d.ts.map +0 -1
- package/dist/WorkspacePicker/WorkspacePicker.js +0 -63
- package/dist/WorkspacePicker/WorkspacePicker.js.map +0 -1
- package/dist/WorkspacePicker/WorkspaceSettingsButton.d.ts +0 -11
- package/dist/WorkspacePicker/WorkspaceSettingsButton.d.ts.map +0 -1
- package/dist/WorkspacePicker/WorkspaceSettingsButton.js +0 -27
- package/dist/WorkspacePicker/WorkspaceSettingsButton.js.map +0 -1
- package/dist/WorkspacePicker/WorkspaceSettingsDialog.d.ts +0 -20
- package/dist/WorkspacePicker/WorkspaceSettingsDialog.d.ts.map +0 -1
- package/dist/WorkspacePicker/WorkspaceSettingsDialog.js +0 -36
- package/dist/WorkspacePicker/WorkspaceSettingsDialog.js.map +0 -1
- package/dist/WorkspacePicker/index.d.ts +0 -3
- package/dist/WorkspacePicker/index.d.ts.map +0 -1
- package/dist/WorkspacePicker/index.js +0 -2
- package/dist/WorkspacePicker/index.js.map +0 -1
- package/dist/hooks/index.d.ts +0 -2
- package/dist/hooks/index.d.ts.map +0 -1
- package/dist/hooks/index.js +0 -2
- package/dist/hooks/index.js.map +0 -1
- package/dist/hooks/useAutoSave.d.ts +0 -15
- package/dist/hooks/useAutoSave.d.ts.map +0 -1
- package/dist/hooks/useAutoSave.js +0 -83
- package/dist/hooks/useAutoSave.js.map +0 -1
- package/dist/icons.d.ts +0 -7
- package/dist/icons.d.ts.map +0 -1
- package/dist/icons.js +0 -27
- package/dist/icons.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/monaco-slim.d.ts +0 -19
- package/dist/monaco-slim.d.ts.map +0 -1
- package/dist/monaco-slim.js +0 -19
- package/dist/monaco-slim.js.map +0 -1
- package/dist/preferences/versioning.d.ts +0 -27
- package/dist/preferences/versioning.d.ts.map +0 -1
- package/dist/preferences/versioning.js +0 -62
- package/dist/preferences/versioning.js.map +0 -1
- package/src/AppMenu/AppMenu.tsx +0 -264
- package/src/AppMenu/index.ts +0 -2
- package/src/DocBlocksShell/DocBlocksShell.tsx +0 -1778
- package/src/DocBlocksShell/index.ts +0 -2
- package/src/Export/ExportDialog.tsx +0 -383
- package/src/Export/ExportToolbarControls.tsx +0 -313
- package/src/Export/export-options.ts +0 -99
- package/src/Export/index.ts +0 -5
- package/src/Export/run-export.ts +0 -349
- package/src/Export/transform-summaries.ts +0 -14
- package/src/FileExplorer/FileExplorer.tsx +0 -282
- package/src/FileExplorer/FileTreeNode.tsx +0 -214
- package/src/FileExplorer/index.ts +0 -5
- package/src/FileExplorer/useFileTree.ts +0 -178
- package/src/WorkspacePicker/WorkspacePicker.tsx +0 -137
- package/src/WorkspacePicker/WorkspaceSettingsButton.tsx +0 -88
- package/src/WorkspacePicker/WorkspaceSettingsDialog.tsx +0 -121
- package/src/WorkspacePicker/index.ts +0 -2
- package/src/fonts/fonts.css +0 -362
- package/src/fonts/licenses/LICENSE-cormorant-garamond.txt +0 -93
- package/src/fonts/licenses/LICENSE-crimson-text.txt +0 -93
- package/src/fonts/licenses/LICENSE-dm-sans.txt +0 -93
- package/src/fonts/licenses/LICENSE-dm-serif-display.txt +0 -93
- package/src/fonts/licenses/LICENSE-hanken-grotesk.txt +0 -94
- package/src/fonts/licenses/LICENSE-ibm-plex-sans.txt +0 -93
- package/src/fonts/licenses/LICENSE-inter.txt +0 -93
- package/src/fonts/licenses/LICENSE-jetbrains-mono.txt +0 -93
- package/src/fonts/licenses/LICENSE-lora.txt +0 -93
- package/src/fonts/licenses/LICENSE-merriweather.txt +0 -93
- package/src/fonts/licenses/LICENSE-oswald.txt +0 -93
- package/src/fonts/licenses/LICENSE-playfair-display.txt +0 -93
- package/src/fonts/licenses/LICENSE-pt-serif.txt +0 -93
- package/src/fonts/licenses/LICENSE-roboto.txt +0 -93
- package/src/fonts/licenses/LICENSE-source-serif-4.txt +0 -93
- package/src/fonts/woff2/cormorant-garamond-400.woff2 +0 -0
- package/src/fonts/woff2/cormorant-garamond-700.woff2 +0 -0
- package/src/fonts/woff2/crimson-text-400.woff2 +0 -0
- package/src/fonts/woff2/crimson-text-400i.woff2 +0 -0
- package/src/fonts/woff2/crimson-text-700.woff2 +0 -0
- package/src/fonts/woff2/dm-sans-400.woff2 +0 -0
- package/src/fonts/woff2/dm-sans-400i.woff2 +0 -0
- package/src/fonts/woff2/dm-sans-500.woff2 +0 -0
- package/src/fonts/woff2/dm-sans-700.woff2 +0 -0
- package/src/fonts/woff2/dm-serif-display-400.woff2 +0 -0
- package/src/fonts/woff2/hanken-grotesk-400.woff2 +0 -0
- package/src/fonts/woff2/hanken-grotesk-400i.woff2 +0 -0
- package/src/fonts/woff2/hanken-grotesk-500.woff2 +0 -0
- package/src/fonts/woff2/hanken-grotesk-600.woff2 +0 -0
- package/src/fonts/woff2/hanken-grotesk-700.woff2 +0 -0
- package/src/fonts/woff2/ibm-plex-sans-400.woff2 +0 -0
- package/src/fonts/woff2/ibm-plex-sans-400i.woff2 +0 -0
- package/src/fonts/woff2/ibm-plex-sans-500.woff2 +0 -0
- package/src/fonts/woff2/ibm-plex-sans-600.woff2 +0 -0
- package/src/fonts/woff2/ibm-plex-sans-700.woff2 +0 -0
- package/src/fonts/woff2/inter-400.woff2 +0 -0
- package/src/fonts/woff2/inter-400i.woff2 +0 -0
- package/src/fonts/woff2/inter-500.woff2 +0 -0
- package/src/fonts/woff2/inter-600.woff2 +0 -0
- package/src/fonts/woff2/inter-700.woff2 +0 -0
- package/src/fonts/woff2/jetbrains-mono-400.woff2 +0 -0
- package/src/fonts/woff2/jetbrains-mono-400i.woff2 +0 -0
- package/src/fonts/woff2/jetbrains-mono-700.woff2 +0 -0
- package/src/fonts/woff2/lora-400.woff2 +0 -0
- package/src/fonts/woff2/lora-400i.woff2 +0 -0
- package/src/fonts/woff2/lora-700.woff2 +0 -0
- package/src/fonts/woff2/merriweather-400.woff2 +0 -0
- package/src/fonts/woff2/merriweather-700.woff2 +0 -0
- package/src/fonts/woff2/oswald-400.woff2 +0 -0
- package/src/fonts/woff2/oswald-700.woff2 +0 -0
- package/src/fonts/woff2/playfair-display-400.woff2 +0 -0
- package/src/fonts/woff2/playfair-display-700.woff2 +0 -0
- package/src/fonts/woff2/pt-serif-400.woff2 +0 -0
- package/src/fonts/woff2/pt-serif-700.woff2 +0 -0
- package/src/fonts/woff2/roboto-400.woff2 +0 -0
- package/src/fonts/woff2/roboto-400i.woff2 +0 -0
- package/src/fonts/woff2/roboto-700.woff2 +0 -0
- package/src/fonts/woff2/source-serif-4-400.woff2 +0 -0
- package/src/fonts/woff2/source-serif-4-400i.woff2 +0 -0
- package/src/fonts/woff2/source-serif-4-700.woff2 +0 -0
- package/src/hooks/index.ts +0 -1
- package/src/hooks/useAutoSave.ts +0 -116
- package/src/icons.tsx +0 -70
- package/src/index.ts +0 -31
- package/src/monaco-slim.ts +0 -20
- package/src/preferences/versioning.ts +0 -69
package/dist/index.d.ts
CHANGED
|
@@ -1,20 +1,348 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { FileSystemProvider, FileSystemEntry } from '@bendyline/docblocks/filesystem';
|
|
3
|
+
import { WorkspaceDescriptor } from '@bendyline/docblocks/workspace';
|
|
4
|
+
import { EditorColorScheme } from '@bendyline/squisq-editor-react';
|
|
5
|
+
import { PrunePolicy, SaveVersionResult, DocumentVersionManager } from '@bendyline/squisq/versions';
|
|
6
|
+
import { ThemePreference, AccentColor, WriteCanvasPreferences } from './settings/index.js';
|
|
7
|
+
export { AccentColorSettings, AccentColorSettingsProps, SettingsDialog, SettingsDialogProps, ThemeSettings, ThemeSettingsProps, WriteCanvasSettingsControls, WriteCanvasSettingsControlsProps } from './settings/index.js';
|
|
8
|
+
import { SharedDocumentMode } from '@bendyline/docblocks/share';
|
|
9
|
+
import { ContentContainer } from '@bendyline/squisq/storage';
|
|
10
|
+
import { VideoExportModalProps } from '@bendyline/squisq-video-react';
|
|
11
|
+
import { ExportBlobSaver } from './export/index.js';
|
|
12
|
+
export { DEFAULT_OPTIONS, ExportDestinationControl, ExportDialog, ExportDialogProps, ExportFormat, ExportOptions, HtmlBundle, HtmlStyle, buildExportFilename, loadLastExportOptions, runExport } from './export/index.js';
|
|
13
|
+
import { DocumentSession, DocumentSessionSnapshot } from '@bendyline/docblocks/document';
|
|
14
|
+
import 'react';
|
|
15
|
+
|
|
16
|
+
type FileTreeChange = {
|
|
17
|
+
type: 'create';
|
|
18
|
+
path: string;
|
|
19
|
+
kind?: 'file' | 'directory';
|
|
20
|
+
} | {
|
|
21
|
+
type: 'delete';
|
|
22
|
+
path: string;
|
|
23
|
+
kind: 'file' | 'directory';
|
|
24
|
+
} | {
|
|
25
|
+
type: 'move';
|
|
26
|
+
oldPath: string;
|
|
27
|
+
newPath: string;
|
|
28
|
+
kind: 'file' | 'directory';
|
|
29
|
+
};
|
|
30
|
+
type FileTreeMutationHandler = (change: FileTreeChange, mutate: () => Promise<void>) => Promise<void>;
|
|
31
|
+
interface WorkspaceMoveDestination {
|
|
32
|
+
id: string;
|
|
33
|
+
name: string;
|
|
34
|
+
}
|
|
35
|
+
interface FileExplorerProps {
|
|
36
|
+
/** The filesystem to display. */
|
|
37
|
+
provider: FileSystemProvider | null;
|
|
38
|
+
/** Active document to select and reveal by expanding all ancestor folders. */
|
|
39
|
+
activeFilePath?: string | null;
|
|
40
|
+
/** Called when any entry is selected (file or directory). */
|
|
41
|
+
onSelect?: (path: string, kind: 'file' | 'directory') => void;
|
|
42
|
+
/**
|
|
43
|
+
* Wraps destructive tree mutations so the active document session can
|
|
44
|
+
* flush, cancel, or retarget itself before storage changes.
|
|
45
|
+
*/
|
|
46
|
+
onTreeMutation?: FileTreeMutationHandler;
|
|
47
|
+
/** Called after any mutation, with move details when paths change. */
|
|
48
|
+
onTreeChange?: (change?: FileTreeChange) => void;
|
|
49
|
+
/** Called when supported files are dropped onto the explorer. */
|
|
50
|
+
onImportFiles?: (files: File[]) => void;
|
|
51
|
+
/**
|
|
52
|
+
* Ask the user to confirm an irreversible delete. Resolve `false` to abort.
|
|
53
|
+
* Hosts with their own dialog pass it here; otherwise the tree falls back to
|
|
54
|
+
* a native prompt rather than deleting unasked.
|
|
55
|
+
*/
|
|
56
|
+
confirmDelete?: (message: string) => boolean | Promise<boolean>;
|
|
57
|
+
/** Persisted workspaces that can receive the current transient workspace. */
|
|
58
|
+
moveDestinations?: readonly WorkspaceMoveDestination[];
|
|
59
|
+
/** When provided, shows the transient-workspace move action above the tree. */
|
|
60
|
+
onMoveToWorkspace?: (workspaceId: string) => Promise<void>;
|
|
61
|
+
/** Optional className for the root element. */
|
|
62
|
+
className?: string;
|
|
63
|
+
}
|
|
64
|
+
declare function FileExplorer({ provider, activeFilePath, onSelect, onTreeMutation, onTreeChange, onImportFiles, confirmDelete, moveDestinations, onMoveToWorkspace, className, }: FileExplorerProps): react_jsx_runtime.JSX.Element;
|
|
65
|
+
|
|
66
|
+
/** Git decoration for a row — precomputed by FileExplorer so this node stays context-free. */
|
|
67
|
+
interface FileTreeNodeBadge {
|
|
68
|
+
kind: string;
|
|
69
|
+
glyph: string;
|
|
70
|
+
label: string;
|
|
71
|
+
}
|
|
72
|
+
/** Git context-menu actions, prebound to this entry's path. */
|
|
73
|
+
interface FileTreeNodeGitActions {
|
|
74
|
+
viewChanges?: () => void;
|
|
75
|
+
fileHistory?: () => void;
|
|
76
|
+
openOnRemote?: () => void;
|
|
77
|
+
}
|
|
78
|
+
interface FileTreeNodeProps {
|
|
79
|
+
entry: FileSystemEntry;
|
|
80
|
+
depth: number;
|
|
81
|
+
expanded: boolean;
|
|
82
|
+
selected: boolean;
|
|
83
|
+
badge?: FileTreeNodeBadge;
|
|
84
|
+
gitActions?: FileTreeNodeGitActions;
|
|
85
|
+
children?: FileSystemEntry[];
|
|
86
|
+
/**
|
|
87
|
+
* Roving tabindex: true only for the tree's single tab stop. Defaults to
|
|
88
|
+
* true so a node rendered on its own is still reachable.
|
|
89
|
+
*/
|
|
90
|
+
focusable?: boolean;
|
|
91
|
+
/** 1-based position among siblings, for aria-posinset. */
|
|
92
|
+
posInSet?: number;
|
|
93
|
+
/** Number of siblings, for aria-setsize. */
|
|
94
|
+
setSize?: number;
|
|
95
|
+
/** The row took focus (click or arrow key) — move the roving tab stop. */
|
|
96
|
+
onRowFocus?: (path: string) => void;
|
|
97
|
+
onToggle: (path: string) => void;
|
|
98
|
+
onSelect: (path: string) => void;
|
|
99
|
+
/**
|
|
100
|
+
* Ask the user to confirm an irreversible delete. Resolve `false` to abort.
|
|
101
|
+
*
|
|
102
|
+
* Optional so a standalone `<FileTreeNode>` still asks before destroying
|
|
103
|
+
* something; hosts that have their own dialog (as `<DocBlocksShell>` does)
|
|
104
|
+
* pass it here so the prompt matches the product instead of being a native
|
|
105
|
+
* browser/Electron dialog.
|
|
106
|
+
*/
|
|
107
|
+
confirmDelete?: (message: string) => boolean | Promise<boolean>;
|
|
108
|
+
onDelete: (path: string, kind: 'file' | 'directory') => Promise<void>;
|
|
109
|
+
onRename: (oldPath: string, newPath: string, kind: 'file' | 'directory') => Promise<void>;
|
|
110
|
+
draggable?: boolean;
|
|
111
|
+
dragging?: boolean;
|
|
112
|
+
dropTarget?: boolean;
|
|
113
|
+
onDragStart?: (event: React.DragEvent, entry: FileSystemEntry) => void;
|
|
114
|
+
onDragEnd?: () => void;
|
|
115
|
+
onDragOverEntry?: (event: React.DragEvent, entry: FileSystemEntry) => void;
|
|
116
|
+
onDropEntry?: (event: React.DragEvent, entry: FileSystemEntry) => void;
|
|
117
|
+
renderChildren?: (dirPath: string) => React.ReactNode;
|
|
118
|
+
}
|
|
119
|
+
declare function FileTreeNode({ entry, depth, expanded, selected, badge, gitActions, focusable, posInSet, setSize, onRowFocus, onToggle, onSelect, confirmDelete, onDelete, onRename, draggable, dragging, dropTarget, onDragStart, onDragEnd, onDragOverEntry, onDropEntry, renderChildren, }: FileTreeNodeProps): react_jsx_runtime.JSX.Element;
|
|
120
|
+
|
|
1
121
|
/**
|
|
2
|
-
*
|
|
122
|
+
* useFileTree — hook that reads from a FileSystemProvider,
|
|
123
|
+
* maintains expanded/collapsed state, and provides CRUD operations.
|
|
3
124
|
*/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
125
|
+
|
|
126
|
+
interface FileTreeState {
|
|
127
|
+
/** Flat list of entries for the current directory view. */
|
|
128
|
+
entries: FileSystemEntry[];
|
|
129
|
+
/** Set of expanded directory paths. */
|
|
130
|
+
expanded: Set<string>;
|
|
131
|
+
/** Currently selected path — file or directory (null if none). */
|
|
132
|
+
selectedPath: string | null;
|
|
133
|
+
/** Kind of the selected entry. */
|
|
134
|
+
selectedKind: 'file' | 'directory' | null;
|
|
135
|
+
/** Whether the tree is loading. */
|
|
136
|
+
loading: boolean;
|
|
137
|
+
/** Latest provider/read/watch failure, cleared by a successful refresh. */
|
|
138
|
+
error: string | null;
|
|
139
|
+
}
|
|
140
|
+
interface FileTreeActions {
|
|
141
|
+
/** Toggle a directory's expanded state. */
|
|
142
|
+
toggleExpand: (path: string) => void;
|
|
143
|
+
/** Select a file or directory. */
|
|
144
|
+
select: (path: string, kind: 'file' | 'directory') => void;
|
|
145
|
+
/** Select an entry and expand each directory needed to reveal it. */
|
|
146
|
+
reveal: (path: string, kind: 'file' | 'directory') => void;
|
|
147
|
+
/** Create a new file with optional initial content. */
|
|
148
|
+
createFile: (path: string, content?: string) => Promise<void>;
|
|
149
|
+
/** Create a new directory. */
|
|
150
|
+
createDirectory: (path: string) => Promise<void>;
|
|
151
|
+
/** Delete a file or directory. */
|
|
152
|
+
deleteEntry: (path: string) => Promise<void>;
|
|
153
|
+
/** Rename or move a file or directory, including a markdown companion folder. */
|
|
154
|
+
renameEntry: (oldPath: string, newPath: string, kind?: 'file' | 'directory') => Promise<void>;
|
|
155
|
+
/** Force refresh the tree. */
|
|
156
|
+
refresh: () => Promise<void>;
|
|
157
|
+
}
|
|
158
|
+
declare function useFileTree(provider: FileSystemProvider | null): FileTreeState & FileTreeActions;
|
|
159
|
+
|
|
160
|
+
interface WorkspacePickerProps {
|
|
161
|
+
/** Currently active workspace id. */
|
|
162
|
+
activeWorkspaceId: string | null;
|
|
163
|
+
/** Called when the user picks a different workspace. */
|
|
164
|
+
onSelect: (descriptor: WorkspaceDescriptor) => void;
|
|
165
|
+
/** Called when the user chooses "Open Folder" (native FS). */
|
|
166
|
+
onOpenFolder: () => void;
|
|
167
|
+
/**
|
|
168
|
+
* Called when the user chooses "Clone Git repository". Only provided on
|
|
169
|
+
* the desktop when git is available — omitted, the item is hidden.
|
|
170
|
+
*/
|
|
171
|
+
onCloneRepository?: () => void;
|
|
172
|
+
/** Forces a list refresh after an external workspace-registry mutation. */
|
|
173
|
+
refreshKey?: number;
|
|
174
|
+
/** Optional className. */
|
|
175
|
+
className?: string;
|
|
176
|
+
}
|
|
177
|
+
declare function WorkspacePicker({ activeWorkspaceId, onSelect, onOpenFolder, onCloneRepository, refreshKey, className, }: WorkspacePickerProps): react_jsx_runtime.JSX.Element;
|
|
178
|
+
|
|
179
|
+
interface DocBlocksShellProps {
|
|
180
|
+
/**
|
|
181
|
+
* The theme to use before the user has an opinion. Omit or pass `'auto'` to
|
|
182
|
+
* follow the OS. An explicit `'light'`/`'dark'` choice the user makes in
|
|
183
|
+
* Settings outranks this — it is their app, not the host's.
|
|
184
|
+
*/
|
|
185
|
+
theme?: EditorColorScheme | 'auto';
|
|
186
|
+
/** Optional logo image URL for the app menu. */
|
|
187
|
+
logoUrl?: string;
|
|
188
|
+
/** Version and surface label included in prefilled issue reports, e.g. `1.1.2 web`. */
|
|
189
|
+
issueReportVersion?: string;
|
|
190
|
+
/** Stable host title used before a document opens and for the optional home document. */
|
|
191
|
+
homeDocumentTitle?: string;
|
|
192
|
+
/** Document path that represents the host's indexable home experience. */
|
|
193
|
+
homeDocumentPath?: string;
|
|
194
|
+
/**
|
|
195
|
+
* Enable document version history. Snapshots are written under
|
|
196
|
+
* `<basename>_files/.versions/` next to each markdown file (i.e., the
|
|
197
|
+
* per-document container). Defaults to `true`.
|
|
198
|
+
*/
|
|
199
|
+
allowVersioning?: boolean;
|
|
200
|
+
/**
|
|
201
|
+
* Override the document basename used in version filenames. Defaults
|
|
202
|
+
* to the basename of the currently selected file.
|
|
203
|
+
*/
|
|
204
|
+
versionBasename?: string;
|
|
205
|
+
/** Prune policy applied after each successful save. Default: keep last 50. */
|
|
206
|
+
versioningPrunePolicy?: PrunePolicy;
|
|
207
|
+
/** Idle delay (ms) before the editor auto-saves a version. `0` disables. Default 5000. */
|
|
208
|
+
versioningAutoSaveIdleMs?: number;
|
|
209
|
+
/** Notified after each `saveVersion` attempt (saved=true and saved=false). */
|
|
210
|
+
onSaveVersion?: (result: SaveVersionResult) => void;
|
|
211
|
+
/** Optional escape hatch for hosts that want imperative access to the version manager. */
|
|
212
|
+
versioningRef?: React.Ref<DocumentVersionManager | null>;
|
|
213
|
+
/**
|
|
214
|
+
* True when a new deploy is waiting (browser PWA hosts: a fresh service
|
|
215
|
+
* worker finished installing). The shell shows an "Update available"
|
|
216
|
+
* status-bar notice that opens a Reload/Later prompt.
|
|
217
|
+
*/
|
|
218
|
+
updateAvailable?: boolean;
|
|
219
|
+
/** Activates the waiting update and reloads onto the new version. */
|
|
220
|
+
onApplyUpdate?: () => void;
|
|
221
|
+
/**
|
|
222
|
+
* True once the app has been fully cached for offline use (browser PWA
|
|
223
|
+
* hosts). Shown to the user once as a passive notice.
|
|
224
|
+
*/
|
|
225
|
+
offlineReady?: boolean;
|
|
226
|
+
}
|
|
227
|
+
declare function DocBlocksShell({ theme: hostTheme, logoUrl, issueReportVersion, homeDocumentTitle, homeDocumentPath, allowVersioning, versionBasename, versioningPrunePolicy, versioningAutoSaveIdleMs, onSaveVersion, versioningRef, updateAvailable, onApplyUpdate, offlineReady, }: DocBlocksShellProps): react_jsx_runtime.JSX.Element;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Versioning preferences — global default + per-workspace resolution.
|
|
231
|
+
*
|
|
232
|
+
* The global preference controls whether DocBlocks writes version
|
|
233
|
+
* snapshots (under `<basename>_files/.versions/`) when editing. The
|
|
234
|
+
* default is `'browser-only'` so local-folder workspaces stay clean by
|
|
235
|
+
* default and only IndexedDB workspaces accumulate version history.
|
|
236
|
+
*
|
|
237
|
+
* Each workspace can override the global default with its own setting
|
|
238
|
+
* stored on the WorkspaceDescriptor. `'inherit'` (or absent) defers to
|
|
239
|
+
* the global preference; `'on'` / `'off'` force the behavior regardless.
|
|
240
|
+
*/
|
|
241
|
+
|
|
242
|
+
type VersioningPreference = 'on' | 'browser-only' | 'off';
|
|
243
|
+
|
|
244
|
+
interface AppMenuProps {
|
|
245
|
+
/** Optional logo image URL to display instead of the text label. */
|
|
246
|
+
logoUrl?: string;
|
|
247
|
+
/** Current theme preference. */
|
|
248
|
+
themePreference?: ThemePreference;
|
|
249
|
+
/** Called when the user changes the theme preference. */
|
|
250
|
+
onThemeChange?: (theme: ThemePreference) => void;
|
|
251
|
+
/** Current accent color. */
|
|
252
|
+
accentColor?: AccentColor;
|
|
253
|
+
/** Called when the user changes the accent color. */
|
|
254
|
+
onAccentColorChange?: (color: AccentColor) => void;
|
|
255
|
+
/** Current typography preferences for the editor's Write canvas. */
|
|
256
|
+
writeCanvasSettings?: WriteCanvasPreferences;
|
|
257
|
+
/** Called when the user changes the Write canvas typography. */
|
|
258
|
+
onWriteCanvasSettingsChange?: (settings: WriteCanvasPreferences) => void;
|
|
259
|
+
/** Current global versioning preference. */
|
|
260
|
+
versioningPreference?: VersioningPreference;
|
|
261
|
+
/** Called when the user changes the global versioning preference. */
|
|
262
|
+
onVersioningPreferenceChange?: (pref: VersioningPreference) => void;
|
|
263
|
+
/**
|
|
264
|
+
* Called when the user clicks "Download all workspaces". When omitted,
|
|
265
|
+
* the menu item is hidden.
|
|
266
|
+
*/
|
|
267
|
+
onDownloadAllWorkspaces?: () => void | Promise<void>;
|
|
268
|
+
/**
|
|
269
|
+
* Called when the user asks the browser to keep origin storage persistent.
|
|
270
|
+
* When omitted, the menu item is hidden.
|
|
271
|
+
*/
|
|
272
|
+
onKeepBrowserData?: () => void | Promise<void>;
|
|
273
|
+
/**
|
|
274
|
+
* Called when the user clicks "Install DocBlocks…" (browser PWA install).
|
|
275
|
+
* When omitted — Electron, unsupported browsers, or already installed —
|
|
276
|
+
* the menu item is hidden.
|
|
277
|
+
*/
|
|
278
|
+
onInstallApp?: () => void | Promise<void>;
|
|
279
|
+
/**
|
|
280
|
+
* Async origin storage usage/quota for the Settings "Storage" section
|
|
281
|
+
* (fetched when the dialog opens). When omitted — Electron, or browsers
|
|
282
|
+
* without `navigator.storage.estimate` — the section is hidden.
|
|
283
|
+
*/
|
|
284
|
+
getStorageEstimate?: () => Promise<{
|
|
285
|
+
usage: number;
|
|
286
|
+
quota: number;
|
|
287
|
+
} | null>;
|
|
288
|
+
/** Whether the browser has marked origin storage persistent (Settings display). */
|
|
289
|
+
storagePersistent?: boolean;
|
|
290
|
+
}
|
|
291
|
+
declare function AppMenu({ logoUrl, themePreference, onThemeChange, accentColor, onAccentColorChange, writeCanvasSettings, onWriteCanvasSettingsChange, versioningPreference, onVersioningPreferenceChange, onDownloadAllWorkspaces, onKeepBrowserData, onInstallApp, getStorageEstimate, storagePersistent, }: AppMenuProps): react_jsx_runtime.JSX.Element;
|
|
292
|
+
|
|
293
|
+
interface ExportToolbarControlsProps {
|
|
294
|
+
/** Currently selected file path — used to derive the download filename. */
|
|
295
|
+
selectedFile: string | null;
|
|
296
|
+
/** Media container for resolving images during export. */
|
|
297
|
+
mediaContainer?: ContentContainer | null;
|
|
298
|
+
/** Override the default browser download behavior for host-provided save flows. */
|
|
299
|
+
saveBlob?: ExportBlobSaver;
|
|
300
|
+
/** Optional host adapter for displaying, picking, and saving to a native target path. */
|
|
301
|
+
destinationAdapter?: ExportDestinationAdapter;
|
|
302
|
+
/** Render the trigger as a direct Export button instead of the overflow menu. */
|
|
303
|
+
trigger?: 'menu' | 'button';
|
|
304
|
+
/** Whether to show video export in the overflow menu. */
|
|
305
|
+
showVideoExport?: boolean;
|
|
306
|
+
/** Resolved host color scheme for the video export dialog. */
|
|
307
|
+
colorScheme?: 'light' | 'dark';
|
|
308
|
+
/** Host palette overrides for the video export dialog and progress UI. */
|
|
309
|
+
videoExportPalette?: VideoExportModalProps['uiPalette'];
|
|
310
|
+
/** HTTP(S) DocBlocks page used as the base of generated shared links. */
|
|
311
|
+
shareBaseUrl?: string;
|
|
312
|
+
/** One-time Use mode supplied by an opened shared document link. */
|
|
313
|
+
initialSharedMode?: SharedDocumentMode | null;
|
|
314
|
+
}
|
|
315
|
+
/** Host-specific operations behind the shared export destination control. */
|
|
316
|
+
interface ExportDestinationTarget {
|
|
317
|
+
grantId: string | null;
|
|
318
|
+
displayPath: string;
|
|
319
|
+
}
|
|
320
|
+
interface ExportDestinationAdapter {
|
|
321
|
+
resolveTarget: (filename: string) => Promise<ExportDestinationTarget>;
|
|
322
|
+
pickTarget: (filename: string, currentTarget?: ExportDestinationTarget | null) => Promise<ExportDestinationTarget | null>;
|
|
323
|
+
saveBlob: (blob: Blob, filename: string, target?: ExportDestinationTarget | null) => Promise<ExportDestinationTarget | null>;
|
|
324
|
+
hint?: string;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/** Public toolbar control with its editor-coupled implementation deferred. */
|
|
328
|
+
declare function ExportToolbarControls(props: ExportToolbarControlsProps): react_jsx_runtime.JSX.Element;
|
|
329
|
+
|
|
330
|
+
/** Keep a user-edited target name while switching the selected export format. */
|
|
331
|
+
declare function updateExportTargetExtension(targetPath: string, suggestedFilename: string): string;
|
|
332
|
+
|
|
333
|
+
interface UseDocumentSessionResult {
|
|
334
|
+
/** Stable controller for the lifetime of the mounted shell/panel. */
|
|
335
|
+
session: DocumentSession;
|
|
336
|
+
/** React snapshot of dirty/saving/saved/error/conflict state. */
|
|
337
|
+
snapshot: DocumentSessionSnapshot;
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* React binding for the framework-neutral DocumentSession engine.
|
|
341
|
+
*
|
|
342
|
+
* The hook deliberately does not infer target transitions from props.
|
|
343
|
+
* Callers must use transitionTo(), retarget(), or delete() before changing
|
|
344
|
+
* their view state so persistence ordering remains explicit.
|
|
345
|
+
*/
|
|
346
|
+
declare function useDocumentSession(autoSaveDelayMs?: number): UseDocumentSessionResult;
|
|
347
|
+
|
|
348
|
+
export { AccentColor, AppMenu, type AppMenuProps, DocBlocksShell, type DocBlocksShellProps, ExportBlobSaver, type ExportDestinationAdapter, type ExportDestinationTarget, ExportToolbarControls, type ExportToolbarControlsProps, FileExplorer, type FileExplorerProps, type FileTreeChange, type FileTreeMutationHandler, FileTreeNode, type FileTreeNodeProps, ThemePreference, type UseDocumentSessionResult, WorkspacePicker, type WorkspacePickerProps, WriteCanvasPreferences, updateExportTargetExtension, useDocumentSession, useFileTree };
|