@rightkit/document-workspace 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/LICENSE-APACHE +201 -0
- package/LICENSE-MIT +21 -0
- package/README.md +74 -2
- package/dist/app/App.d.ts +1 -0
- package/dist/app/App.js +6 -0
- package/dist/app/AppDialogs.d.ts +52 -0
- package/dist/app/AppDialogs.js +23 -0
- package/dist/app/AppDialogsHost.d.ts +31 -0
- package/dist/app/AppDialogsHost.js +30 -0
- package/dist/app/AppLifecycle.d.ts +19 -0
- package/dist/app/AppLifecycle.js +87 -0
- package/dist/app/AppProvider.d.ts +317 -0
- package/dist/app/AppProvider.js +217 -0
- package/dist/app/AppRoot.d.ts +8 -0
- package/dist/app/AppRoot.js +159 -0
- package/dist/app/AppShell.d.ts +2 -0
- package/dist/app/AppShell.js +81 -0
- package/dist/app/CommandPalette.d.ts +13 -0
- package/dist/app/CommandPalette.js +47 -0
- package/dist/app/DocActionBar.d.ts +36 -0
- package/dist/app/DocActionBar.js +300 -0
- package/dist/app/DocumentContextMenu.d.ts +29 -0
- package/dist/app/DocumentContextMenu.js +122 -0
- package/dist/app/DocumentPane.d.ts +52 -0
- package/dist/app/DocumentPane.js +30 -0
- package/dist/app/DocumentRouterTable.d.ts +58 -0
- package/dist/app/DocumentRouterTable.js +143 -0
- package/dist/app/ErrorBoundary.d.ts +12 -0
- package/dist/app/ErrorBoundary.js +16 -0
- package/dist/app/FindBar.d.ts +12 -0
- package/dist/app/FindBar.js +199 -0
- package/dist/app/LiveTitle.d.ts +14 -0
- package/dist/app/LiveTitle.js +14 -0
- package/dist/app/OpeningProgress.d.ts +13 -0
- package/dist/app/OpeningProgress.js +21 -0
- package/dist/app/PrintPreviewWindow.d.ts +2 -0
- package/dist/app/PrintPreviewWindow.js +57 -0
- package/dist/app/ShortcutHelp.d.ts +3 -0
- package/dist/app/ShortcutHelp.js +99 -0
- package/dist/app/Sidebar.d.ts +36 -0
- package/dist/app/Sidebar.js +121 -0
- package/dist/app/ToastViewport.d.ts +1 -0
- package/dist/app/ToastViewport.js +31 -0
- package/dist/app/Toolbar.d.ts +26 -0
- package/dist/app/Toolbar.js +63 -0
- package/dist/app/activeFormatSavers.d.ts +7 -0
- package/dist/app/activeFormatSavers.js +4 -0
- package/dist/app/clipboardPaths.d.ts +1 -0
- package/dist/app/clipboardPaths.js +31 -0
- package/dist/app/documentDrafts.d.ts +17 -0
- package/dist/app/documentDrafts.js +104 -0
- package/dist/app/draftResolution.d.ts +5 -0
- package/dist/app/draftResolution.js +25 -0
- package/dist/app/markdownPaletteActions.d.ts +8 -0
- package/dist/app/markdownPaletteActions.js +107 -0
- package/dist/app/resourceCensusDev.d.ts +41 -0
- package/dist/app/resourceCensusDev.js +518 -0
- package/dist/app/setupRecovery.d.ts +34 -0
- package/dist/app/setupRecovery.js +70 -0
- package/dist/app/shell/DocStatsPill.d.ts +18 -0
- package/dist/app/shell/DocStatsPill.js +32 -0
- package/dist/app/shell/DocumentTools.d.ts +9 -0
- package/dist/app/shell/DocumentTools.js +73 -0
- package/dist/app/shell/InfoInspector.d.ts +9 -0
- package/dist/app/shell/InfoInspector.js +67 -0
- package/dist/app/shell/StartPage.d.ts +9 -0
- package/dist/app/shell/StartPage.js +49 -0
- package/dist/app/shell/readEdit.d.ts +6 -0
- package/dist/app/shell/readEdit.js +6 -0
- package/dist/app/sidebar/SidebarDocumentMenu.d.ts +20 -0
- package/dist/app/sidebar/SidebarDocumentMenu.js +56 -0
- package/dist/app/sidebar/SidebarExpandedPanel.d.ts +9 -0
- package/dist/app/sidebar/SidebarExpandedPanel.js +78 -0
- package/dist/app/sidebar/SidebarIcons.d.ts +3 -0
- package/dist/app/sidebar/SidebarIcons.js +18 -0
- package/dist/app/sidebar/SidebarMenus.d.ts +19 -0
- package/dist/app/sidebar/SidebarMenus.js +64 -0
- package/dist/app/sidebar/SidebarPathUtils.d.ts +10 -0
- package/dist/app/sidebar/SidebarPathUtils.js +55 -0
- package/dist/app/sidebar/SidebarPrimitives.d.ts +12 -0
- package/dist/app/sidebar/SidebarPrimitives.js +45 -0
- package/dist/app/sidebar/SidebarRail.d.ts +5 -0
- package/dist/app/sidebar/SidebarRail.js +37 -0
- package/dist/app/sidebar/explorer/ExplorerRowMenu.d.ts +21 -0
- package/dist/app/sidebar/explorer/ExplorerRowMenu.js +37 -0
- package/dist/app/sidebar/explorer/ExplorerSections.d.ts +16 -0
- package/dist/app/sidebar/explorer/ExplorerSections.js +259 -0
- package/dist/app/sidebar/explorer/ExplorerTree.d.ts +46 -0
- package/dist/app/sidebar/explorer/ExplorerTree.js +387 -0
- package/dist/app/sidebar/explorer/explorerState.d.ts +37 -0
- package/dist/app/sidebar/explorer/explorerState.js +135 -0
- package/dist/app/tabMountPolicy.d.ts +45 -0
- package/dist/app/tabMountPolicy.js +104 -0
- package/dist/app/tabWarmOrder.d.ts +7 -0
- package/dist/app/tabWarmOrder.js +48 -0
- package/dist/app/tabs/TabFuseCurves.d.ts +3 -0
- package/dist/app/tabs/TabFuseCurves.js +15 -0
- package/dist/app/tabs/TabOverview.d.ts +24 -0
- package/dist/app/tabs/TabOverview.js +121 -0
- package/dist/app/tabs/TabStrip.d.ts +42 -0
- package/dist/app/tabs/TabStrip.js +380 -0
- package/dist/app/tabs/tabIds.d.ts +5 -0
- package/dist/app/tabs/tabIds.js +7 -0
- package/dist/app/tabs/useTabDirty.d.ts +3 -0
- package/dist/app/tabs/useTabDirty.js +11 -0
- package/dist/app/useAppChromeState.d.ts +21 -0
- package/dist/app/useAppChromeState.js +48 -0
- package/dist/app/useAppCommands.d.ts +66 -0
- package/dist/app/useAppCommands.js +71 -0
- package/dist/app/useAppDocumentCore.d.ts +210 -0
- package/dist/app/useAppDocumentCore.js +40 -0
- package/dist/app/useAppEffects.d.ts +18 -0
- package/dist/app/useAppEffects.js +52 -0
- package/dist/app/useAppPaneSearch.d.ts +37 -0
- package/dist/app/useAppPaneSearch.js +74 -0
- package/dist/app/useAppShellSetup.d.ts +40 -0
- package/dist/app/useAppShellSetup.js +52 -0
- package/dist/app/useAppSlots.d.ts +28 -0
- package/dist/app/useAppSlots.js +40 -0
- package/dist/app/useAppTabChrome.d.ts +51 -0
- package/dist/app/useAppTabChrome.js +66 -0
- package/dist/app/useAutoSave.d.ts +34 -0
- package/dist/app/useAutoSave.js +116 -0
- package/dist/app/useCloseAll.d.ts +52 -0
- package/dist/app/useCloseAll.js +295 -0
- package/dist/app/useClosedTabEviction.d.ts +10 -0
- package/dist/app/useClosedTabEviction.js +38 -0
- package/dist/app/useCommandPalette.d.ts +44 -0
- package/dist/app/useCommandPalette.js +254 -0
- package/dist/app/useCrossDocSearch.d.ts +7 -0
- package/dist/app/useCrossDocSearch.js +94 -0
- package/dist/app/useDistractionFree.d.ts +21 -0
- package/dist/app/useDistractionFree.js +73 -0
- package/dist/app/useDocumentCreation.d.ts +18 -0
- package/dist/app/useDocumentCreation.js +63 -0
- package/dist/app/useDocumentDirty.d.ts +31 -0
- package/dist/app/useDocumentDirty.js +46 -0
- package/dist/app/useDocumentLoader.d.ts +55 -0
- package/dist/app/useDocumentLoader.js +267 -0
- package/dist/app/useDocumentOutputActions.d.ts +6 -0
- package/dist/app/useDocumentOutputActions.js +45 -0
- package/dist/app/useDocumentRuntimeEffects.d.ts +36 -0
- package/dist/app/useDocumentRuntimeEffects.js +458 -0
- package/dist/app/useDocumentSaver.d.ts +58 -0
- package/dist/app/useDocumentSaver.js +511 -0
- package/dist/app/useDocumentTabs.d.ts +41 -0
- package/dist/app/useDocumentTabs.js +207 -0
- package/dist/app/useDocumentWatcher.d.ts +83 -0
- package/dist/app/useDocumentWatcher.js +393 -0
- package/dist/app/useDocumentZoom.d.ts +24 -0
- package/dist/app/useDocumentZoom.js +104 -0
- package/dist/app/useDocuments.d.ts +169 -0
- package/dist/app/useDocuments.js +455 -0
- package/dist/app/useDraftConfirmGate.d.ts +27 -0
- package/dist/app/useDraftConfirmGate.js +47 -0
- package/dist/app/useFileDragOverlay.d.ts +12 -0
- package/dist/app/useFileDragOverlay.js +49 -0
- package/dist/app/useFormatApis.d.ts +13 -0
- package/dist/app/useFormatApis.js +62 -0
- package/dist/app/useFormatDirtyState.d.ts +29 -0
- package/dist/app/useFormatDirtyState.js +81 -0
- package/dist/app/useGlobalShortcuts.d.ts +47 -0
- package/dist/app/useGlobalShortcuts.js +359 -0
- package/dist/app/useHtmlSession.d.ts +68 -0
- package/dist/app/useHtmlSession.js +463 -0
- package/dist/app/useHtmlSessionProps.d.ts +33 -0
- package/dist/app/useHtmlSessionProps.js +57 -0
- package/dist/app/useLibrary.d.ts +21 -0
- package/dist/app/useLibrary.js +81 -0
- package/dist/app/useOpenFromClipboard.d.ts +7 -0
- package/dist/app/useOpenFromClipboard.js +44 -0
- package/dist/app/usePaneLiveness.d.ts +29 -0
- package/dist/app/usePaneLiveness.js +199 -0
- package/dist/app/usePendingSavePaths.d.ts +19 -0
- package/dist/app/usePendingSavePaths.js +67 -0
- package/dist/app/useReadyShow.d.ts +12 -0
- package/dist/app/useReadyShow.js +142 -0
- package/dist/app/useSearchController.d.ts +22 -0
- package/dist/app/useSearchController.js +114 -0
- package/dist/app/useSetupRecovery.d.ts +41 -0
- package/dist/app/useSetupRecovery.js +153 -0
- package/dist/app/useTabChrome.d.ts +40 -0
- package/dist/app/useTabChrome.js +115 -0
- package/dist/app/useViewState.d.ts +27 -0
- package/dist/app/useViewState.js +160 -0
- package/dist/appName.d.ts +2 -0
- package/dist/appName.js +8 -0
- package/dist/documents/DocumentRouter.d.ts +102 -0
- package/dist/documents/DocumentRouter.js +153 -0
- package/dist/documents/FileTypeIcon.d.ts +6 -0
- package/dist/documents/FileTypeIcon.js +93 -0
- package/dist/documents/ImageDocument.d.ts +14 -0
- package/dist/documents/ImageDocument.js +61 -0
- package/dist/documents/capabilities.d.ts +17 -0
- package/dist/documents/capabilities.js +18 -0
- package/dist/documents/html/HtmlDocument.d.ts +15 -0
- package/dist/documents/html/HtmlDocument.js +584 -0
- package/dist/documents/html/HtmlDocumentLayout.d.ts +87 -0
- package/dist/documents/html/HtmlDocumentLayout.js +25 -0
- package/dist/documents/html/HtmlDocumentProps.d.ts +60 -0
- package/dist/documents/html/HtmlDocumentProps.js +1 -0
- package/dist/documents/html/HtmlDocumentSource.d.ts +34 -0
- package/dist/documents/html/HtmlDocumentSource.js +28 -0
- package/dist/documents/markdown/MarkdownSplitPane.d.ts +115 -0
- package/dist/documents/markdown/MarkdownSplitPane.js +352 -0
- package/dist/documents/mdx/MdxSplitPane.d.ts +32 -0
- package/dist/documents/mdx/MdxSplitPane.js +60 -0
- package/dist/documents/txt/LinkDialog.d.ts +8 -0
- package/dist/documents/txt/LinkDialog.js +34 -0
- package/dist/documents/txt/MarkdownSourceToolbar.d.ts +8 -0
- package/dist/documents/txt/MarkdownSourceToolbar.js +25 -0
- package/dist/documents/txt/SourceEditorToolbar.d.ts +12 -0
- package/dist/documents/txt/SourceEditorToolbar.js +4 -0
- package/dist/documents/txt/TxtEditor.d.ts +39 -0
- package/dist/documents/txt/TxtEditor.js +186 -0
- package/dist/documents/txt/sourceEditorTypes.d.ts +49 -0
- package/dist/documents/txt/sourceEditorTypes.js +1 -0
- package/dist/documents/txt/sourceExtensions.d.ts +38 -0
- package/dist/documents/txt/sourceExtensions.js +444 -0
- package/dist/documents/txt/sourceFormatting.d.ts +18 -0
- package/dist/documents/txt/sourceFormatting.js +183 -0
- package/dist/documents/txt/sourceTheme.d.ts +5 -0
- package/dist/documents/txt/sourceTheme.js +220 -0
- package/dist/documents/txt/useCodeMirrorSourceEditor.d.ts +69 -0
- package/dist/documents/txt/useCodeMirrorSourceEditor.js +546 -0
- package/dist/documents/txt/useSourceSearch.d.ts +39 -0
- package/dist/documents/txt/useSourceSearch.js +122 -0
- package/dist/documents/txt/useTextEditorCommands.d.ts +26 -0
- package/dist/documents/txt/useTextEditorCommands.js +151 -0
- package/dist/documents/web/LivePreviewPane.d.ts +11 -0
- package/dist/documents/web/LivePreviewPane.js +58 -0
- package/dist/env.d.ts +66 -0
- package/dist/index.d.ts +121 -0
- package/dist/index.js +123 -0
- package/dist/settings/AppearanceMenu.d.ts +9 -0
- package/dist/settings/AppearanceMenu.js +54 -0
- package/dist/settings/SettingsPanel.d.ts +7 -0
- package/dist/settings/SettingsPanel.js +104 -0
- package/dist/settings/publishedSections.d.ts +22 -0
- package/dist/settings/publishedSections.js +79 -0
- package/dist/settings/sections/AboutSection.d.ts +1 -0
- package/dist/settings/sections/AboutSection.js +13 -0
- package/dist/settings/sections/DiagnosticsSection.d.ts +1 -0
- package/dist/settings/sections/DiagnosticsSection.js +42 -0
- package/dist/settings/sections/PrivacySection.d.ts +3 -0
- package/dist/settings/sections/PrivacySection.js +51 -0
- package/dist/settings/sections/UpdateLicenseBlock.d.ts +10 -0
- package/dist/settings/sections/UpdateLicenseBlock.js +158 -0
- package/dist/state/explorer.d.ts +32 -0
- package/dist/state/explorer.js +111 -0
- package/dist/state/legal.d.ts +51 -0
- package/dist/state/legal.js +130 -0
- package/dist/state/library.d.ts +33 -0
- package/dist/state/library.js +110 -0
- package/dist/state/updateLicense.d.ts +31 -0
- package/dist/state/updateLicense.js +340 -0
- package/dist/styles/explorer.css +219 -0
- package/dist/styles/index.css +1477 -0
- package/dist/styles/tabs.css +467 -0
- package/dist/styles.css +6 -0
- package/package.json +88 -3
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Hook composition for the whole app shell. Hook call order matches the original useAppState exactly:
|
|
4
|
+
* document core → chrome state → shell setup → pane/search → tab chrome/zoom/lifecycle → commands &
|
|
5
|
+
* shortcuts → slots. Plain (non-hook) derivations stay between the same hook calls they originally did.
|
|
6
|
+
*/
|
|
7
|
+
declare function useAppState(): {
|
|
8
|
+
dragOver: boolean;
|
|
9
|
+
rootDragProps: {
|
|
10
|
+
onDragEnter: (e: import("react").DragEvent) => void;
|
|
11
|
+
onDragOver: (e: import("react").DragEvent) => void;
|
|
12
|
+
onDragLeave: (e: import("react").DragEvent) => void;
|
|
13
|
+
onDrop: () => void;
|
|
14
|
+
};
|
|
15
|
+
distractionFree: boolean;
|
|
16
|
+
activePath: string | null;
|
|
17
|
+
openPathsSet: Set<string>;
|
|
18
|
+
recents: import("../index.js").FileEntry[];
|
|
19
|
+
pinnedPaths: Set<string>;
|
|
20
|
+
pinnedEntries: import("../index.js").PinEntry[];
|
|
21
|
+
activate: (path: string) => Promise<void>;
|
|
22
|
+
openRecent: (entry: import("../index.js").FileEntry) => Promise<void>;
|
|
23
|
+
openExplorerPath: (path: string) => void;
|
|
24
|
+
onTogglePin: (path: string) => Promise<void>;
|
|
25
|
+
library: {
|
|
26
|
+
onHistoryPurged: () => void;
|
|
27
|
+
recents: import("../index.js").FileEntry[];
|
|
28
|
+
pinnedPaths: Set<string>;
|
|
29
|
+
pinnedEntries: import("../index.js").PinEntry[];
|
|
30
|
+
refreshLibrary: () => Promise<void>;
|
|
31
|
+
syncPinned: (path: string) => Promise<void>;
|
|
32
|
+
onTogglePin: (path: string) => Promise<void>;
|
|
33
|
+
onTogglePinDir: (path: string, displayName: string) => Promise<void>;
|
|
34
|
+
onClearRecents: () => Promise<void>;
|
|
35
|
+
};
|
|
36
|
+
onOpenDialog: () => Promise<void>;
|
|
37
|
+
openUrl: () => void;
|
|
38
|
+
openFromClipboard: () => Promise<void>;
|
|
39
|
+
newDocument: (format?: "txt" | "md" | "docx") => void;
|
|
40
|
+
handleOpenSettings: () => void;
|
|
41
|
+
setSidebarCollapsed: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
42
|
+
menuSlot: import("react").JSX.Element | null;
|
|
43
|
+
modeSlot: import("react").JSX.Element | null;
|
|
44
|
+
active: import("@rightkit/document-core/documents/types").LoadedDocument | null;
|
|
45
|
+
activeIndex: number;
|
|
46
|
+
activeEditable: boolean;
|
|
47
|
+
titleBarTitle: string;
|
|
48
|
+
titleBarTitleFor: (d: import("@rightkit/document-core/documents/types").LoadedDocument) => string;
|
|
49
|
+
subscribeEdits: (path: string, cb: () => void) => () => void;
|
|
50
|
+
getEditSnapshot: (path: string) => string;
|
|
51
|
+
getExternalSeq: (path: string) => number;
|
|
52
|
+
sidebarCollapsed: boolean;
|
|
53
|
+
isDirty: (doc: import("@rightkit/document-core/documents/types").LoadedDocument) => boolean;
|
|
54
|
+
dirtyPaths: Set<string>;
|
|
55
|
+
subscribeDirty: (path: string, listener: () => void) => () => void;
|
|
56
|
+
tabStripProps: import("./tabs/TabStrip.js").TabStripProps;
|
|
57
|
+
view: import("@rightkit/document-core/documents/types").ViewMode;
|
|
58
|
+
docBarSlot: HTMLElement | null;
|
|
59
|
+
setDocBarSlot: import("react").Dispatch<import("react").SetStateAction<HTMLElement | null>>;
|
|
60
|
+
inspectorOpen: boolean;
|
|
61
|
+
toggleInspector: () => void;
|
|
62
|
+
closeInspector: () => void;
|
|
63
|
+
findBarEl: import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | null;
|
|
64
|
+
zoom: {
|
|
65
|
+
zoomHud: string | null;
|
|
66
|
+
zoomedAwayFromDefault: boolean;
|
|
67
|
+
zoomPercentLabel: string;
|
|
68
|
+
resetDocumentZoom: () => void;
|
|
69
|
+
onDocumentWheel: (e: import("react").WheelEvent<HTMLDivElement>) => void;
|
|
70
|
+
};
|
|
71
|
+
docs: {
|
|
72
|
+
ensureHtmlPage: (entryPath: string, pagePath: string) => Promise<void>;
|
|
73
|
+
setHtmlPageEdited: (entryPath: string, pagePath: string, edited: string) => void;
|
|
74
|
+
setHtmlActive: (entryPath: string, pagePath: string) => void;
|
|
75
|
+
discardHtmlPage: (entryPath: string, pagePath: string) => void;
|
|
76
|
+
saveHtmlPage: (entryPath: string, pagePath: string, options?: {
|
|
77
|
+
silent?: boolean;
|
|
78
|
+
}) => Promise<boolean>;
|
|
79
|
+
saveAllHtmlPages: (entryPath: string, options?: {
|
|
80
|
+
silent?: boolean;
|
|
81
|
+
}) => Promise<boolean>;
|
|
82
|
+
discardAllHtmlPages: (entryPath: string) => void;
|
|
83
|
+
onHtmlSaveShortcut: (entryPath: string) => void;
|
|
84
|
+
htmlDirtyPages: (entryPath: string) => {
|
|
85
|
+
path: string;
|
|
86
|
+
name: string;
|
|
87
|
+
isEntry: boolean;
|
|
88
|
+
}[];
|
|
89
|
+
htmlSaveCurrent: () => Promise<void>;
|
|
90
|
+
htmlSaveAll: () => Promise<void>;
|
|
91
|
+
htmlDiscardAll: () => void;
|
|
92
|
+
htmlConfirmCancel: () => void;
|
|
93
|
+
htmlConflictReload: () => Promise<void>;
|
|
94
|
+
htmlConflictKeep: () => Promise<void>;
|
|
95
|
+
reloadHtmlSubpage: (path: string) => void;
|
|
96
|
+
blockDrafts: import("@rightkit/document-core/app/blockDrafts").BlockDraftRegistry;
|
|
97
|
+
activate: (path: string) => Promise<void>;
|
|
98
|
+
open: (path: string, opts?: import("./useDocumentLoader.js").OpenDocumentOptions) => Promise<void>;
|
|
99
|
+
openLiveUrl: (input: string, opts?: {
|
|
100
|
+
background?: boolean;
|
|
101
|
+
}) => Promise<void>;
|
|
102
|
+
openRecent: (entry: import("../index.js").FileEntry) => Promise<void>;
|
|
103
|
+
onOpenDialog: () => Promise<void>;
|
|
104
|
+
newDocument: (format?: "txt" | "md" | "docx") => void;
|
|
105
|
+
duplicateAsDraft: (text: string, toastMsg?: string) => void;
|
|
106
|
+
requestClose: (path: string) => void;
|
|
107
|
+
closeAll: () => void;
|
|
108
|
+
closeMany: (paths: string[]) => void;
|
|
109
|
+
reopenLastClosed: () => void;
|
|
110
|
+
openImageSibling: (currentPath: string, targetPath: string) => Promise<void>;
|
|
111
|
+
onTxtChange: (path: string, content: string, text: string) => void;
|
|
112
|
+
onSave: (doc: import("@rightkit/document-core/documents/types").LoadedDocument, options?: {
|
|
113
|
+
silent?: boolean;
|
|
114
|
+
}) => Promise<string | null>;
|
|
115
|
+
onSaveAs: (doc: import("@rightkit/document-core/documents/types").LoadedDocument) => Promise<string | null>;
|
|
116
|
+
onDocxSaveAs: (doc: import("@rightkit/document-core/documents/types").LoadedDocument, buffer?: ArrayBuffer) => Promise<string | null>;
|
|
117
|
+
onPrint: (doc: import("@rightkit/document-core/documents/types").LoadedDocument | null) => void;
|
|
118
|
+
onDocxSave: (path: string, buffer: ArrayBuffer) => Promise<void>;
|
|
119
|
+
onDocxChange: (path: string) => void;
|
|
120
|
+
onPdfDirtyChange: (path: string, dirty: boolean) => void;
|
|
121
|
+
docxSaver: import("react").RefObject<(() => Promise<ArrayBuffer | null>) | null>;
|
|
122
|
+
docxSaversRef: import("react").RefObject<Map<string, () => Promise<ArrayBuffer | null>>>;
|
|
123
|
+
pdfSaversRef: import("react").RefObject<Map<string, import("@rightkit/document-core/documents/pdf/pdfEditor").PdfSaveFunction>>;
|
|
124
|
+
pdfSavePlansRef: import("react").RefObject<Map<string, () => Promise<import("@rightkit/document-core/documents/pdf/pdfEditModel").PdfSavePlan>>>;
|
|
125
|
+
onImageChange: (path: string) => void;
|
|
126
|
+
imageSaver: import("react").RefObject<import("@rightkit/media-ui").ImageSaveFunction | null>;
|
|
127
|
+
imageSaversRef: import("react").RefObject<Map<string, import("@rightkit/media-ui").ImageSaveFunction>>;
|
|
128
|
+
onEditImageExternal: (doc: import("@rightkit/document-core/documents/types").LoadedDocument | null) => void;
|
|
129
|
+
isDirty: (doc: import("@rightkit/document-core/documents/types").LoadedDocument) => boolean;
|
|
130
|
+
hasModifiedDraft: (path: string) => boolean;
|
|
131
|
+
snapshotModified: (path?: string) => Readonly<{
|
|
132
|
+
identity: import("@rightkit/document-core/app/blockDrafts").BlockDraftIdentity;
|
|
133
|
+
blockKind: string;
|
|
134
|
+
originalRevision: string | number;
|
|
135
|
+
sourceRange?: import("@rightkit/document-core/app/blockDrafts").BlockDraftSourceRange;
|
|
136
|
+
sourceChecksum?: string;
|
|
137
|
+
originalText: string;
|
|
138
|
+
currentText: string;
|
|
139
|
+
targetTag?: string;
|
|
140
|
+
selectionBookmark?: import("@rightkit/document-core/app/blockDrafts").BlockDraftSelectionBookmark;
|
|
141
|
+
status: import("@rightkit/document-core/app/blockDrafts").BlockDraftStatus;
|
|
142
|
+
reason?: string;
|
|
143
|
+
error?: string;
|
|
144
|
+
}>[];
|
|
145
|
+
snapshotAll: (path?: string) => Readonly<{
|
|
146
|
+
identity: import("@rightkit/document-core/app/blockDrafts").BlockDraftIdentity;
|
|
147
|
+
blockKind: string;
|
|
148
|
+
originalRevision: string | number;
|
|
149
|
+
sourceRange?: import("@rightkit/document-core/app/blockDrafts").BlockDraftSourceRange;
|
|
150
|
+
sourceChecksum?: string;
|
|
151
|
+
originalText: string;
|
|
152
|
+
currentText: string;
|
|
153
|
+
targetTag?: string;
|
|
154
|
+
selectionBookmark?: import("@rightkit/document-core/app/blockDrafts").BlockDraftSelectionBookmark;
|
|
155
|
+
status: import("@rightkit/document-core/app/blockDrafts").BlockDraftStatus;
|
|
156
|
+
reason?: string;
|
|
157
|
+
error?: string;
|
|
158
|
+
}>[];
|
|
159
|
+
pendingSavePaths: Set<string>;
|
|
160
|
+
titleFor: (doc: import("@rightkit/document-core/documents/types").LoadedDocument) => string;
|
|
161
|
+
error: string | null;
|
|
162
|
+
openingPath: string | null;
|
|
163
|
+
restoringSession: boolean;
|
|
164
|
+
setError: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
|
165
|
+
confirmClose: string | null;
|
|
166
|
+
setConfirmClose: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
|
167
|
+
confirmCloseAll: {
|
|
168
|
+
orderedPaths: string[];
|
|
169
|
+
affectedPaths: string[];
|
|
170
|
+
} | null;
|
|
171
|
+
setConfirmCloseAll: import("react").Dispatch<import("react").SetStateAction<{
|
|
172
|
+
orderedPaths: string[];
|
|
173
|
+
affectedPaths: string[];
|
|
174
|
+
} | null>>;
|
|
175
|
+
confirmCloseAllSaveAll: () => Promise<void>;
|
|
176
|
+
confirmCloseAllDontSave: () => Promise<void>;
|
|
177
|
+
confirmCloseAllCancel: () => void;
|
|
178
|
+
confirmQuit: boolean;
|
|
179
|
+
setConfirmQuit: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
180
|
+
conflict: string | null;
|
|
181
|
+
setConflict: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
|
182
|
+
keepConflict: (path: string) => Promise<void>;
|
|
183
|
+
reload: (path: string, options?: {
|
|
184
|
+
force?: boolean;
|
|
185
|
+
replayDeferred?: boolean;
|
|
186
|
+
}) => void;
|
|
187
|
+
confirmSave: () => Promise<void>;
|
|
188
|
+
confirmDontSave: () => Promise<void>;
|
|
189
|
+
applyReload: (path: string) => void;
|
|
190
|
+
quitNow: () => Promise<void>;
|
|
191
|
+
quitSaveAll: () => Promise<void>;
|
|
192
|
+
quitDiscardAll: () => Promise<void>;
|
|
193
|
+
draftConfirm: {
|
|
194
|
+
documentPath: string;
|
|
195
|
+
intent: import("@rightkit/document-core/app/blockDrafts").BlockDraftIntent;
|
|
196
|
+
onResolved: () => void;
|
|
197
|
+
} | null;
|
|
198
|
+
setDraftConfirm: import("react").Dispatch<import("react").SetStateAction<{
|
|
199
|
+
documentPath: string;
|
|
200
|
+
intent: import("@rightkit/document-core/app/blockDrafts").BlockDraftIntent;
|
|
201
|
+
onResolved: () => void;
|
|
202
|
+
} | null>>;
|
|
203
|
+
confirmDraftDone: () => Promise<void>;
|
|
204
|
+
confirmDraftDiscard: () => Promise<void>;
|
|
205
|
+
confirmDraftCancel: () => void;
|
|
206
|
+
requestDraftAwareViewChange: (path: string, proceed: () => void) => void;
|
|
207
|
+
htmlConfirm: import("./useHtmlSession.js").HtmlConfirmState;
|
|
208
|
+
htmlConflict: import("./useHtmlSession.js").HtmlConflictState;
|
|
209
|
+
trackMdxGrant: (entryPath: string, grantedPath: string) => void;
|
|
210
|
+
};
|
|
211
|
+
restoringSession: boolean;
|
|
212
|
+
openDocs: import("@rightkit/document-core/documents/types").LoadedDocument[];
|
|
213
|
+
blockDrafts: import("@rightkit/document-core/app/blockDrafts").BlockDraftRegistry;
|
|
214
|
+
livePaths: Set<string>;
|
|
215
|
+
renderedPaths: Set<string>;
|
|
216
|
+
views: Record<string, import("@rightkit/document-core/documents/types").ViewMode>;
|
|
217
|
+
contentScrollRef: import("react").RefObject<HTMLDivElement | null>;
|
|
218
|
+
viewState: {
|
|
219
|
+
views: Record<string, import("@rightkit/document-core/documents/types").ViewMode>;
|
|
220
|
+
setViews: import("react").Dispatch<import("react").SetStateAction<Record<string, import("@rightkit/document-core/documents/types").ViewMode>>>;
|
|
221
|
+
viewsRef: import("react").RefObject<Record<string, import("@rightkit/document-core/documents/types").ViewMode>>;
|
|
222
|
+
viewMetaRef: import("react").RefObject<Record<string, import("@rightkit/document-core/documents/types").ViewMeta>>;
|
|
223
|
+
persistViewMeta: (path: string) => void;
|
|
224
|
+
contentScrollRef: import("react").RefObject<HTMLDivElement | null>;
|
|
225
|
+
requestViewChange: (next: import("@rightkit/document-core/documents/types").ViewMode) => Promise<void>;
|
|
226
|
+
confirmViewChange: (decision: "done" | "discard" | "stay") => Promise<void>;
|
|
227
|
+
cancelViewChange: () => void;
|
|
228
|
+
pendingViewChange: {
|
|
229
|
+
next: import("@rightkit/document-core/documents/types").ViewMode;
|
|
230
|
+
drafts: ReturnType<import("@rightkit/document-core/app/blockDrafts").BlockDraftRegistry["snapshotModified"]>;
|
|
231
|
+
} | null;
|
|
232
|
+
onContentScroll: () => void;
|
|
233
|
+
onPdfViewState: (m: import("@rightkit/document-core/documents/types").ViewMeta) => void;
|
|
234
|
+
dropViewState: (path: string) => void;
|
|
235
|
+
};
|
|
236
|
+
onSave: (doc: import("@rightkit/document-core/documents/types").LoadedDocument, options?: {
|
|
237
|
+
silent?: boolean;
|
|
238
|
+
}) => Promise<string | null>;
|
|
239
|
+
setDocxMenu: import("react").Dispatch<import("react").SetStateAction<import("@rightkit/docx-editor/documents/docx/menuApi").DocxMenuApi | null>>;
|
|
240
|
+
registerPdfPrint: (fn: (() => Promise<boolean>) | null) => void;
|
|
241
|
+
registerMarkdownExport: (api: import("@rightkit/markdown-editor/documents/markdown/export/markdownExportTypes").MarkdownExportApi | null) => void;
|
|
242
|
+
findMode: "find" | "replace" | undefined;
|
|
243
|
+
searchProvider: import("@rightkit/document-core/documents/types").SearchProvider | null;
|
|
244
|
+
toggleFind: (replace: boolean) => void;
|
|
245
|
+
closeFind: () => void;
|
|
246
|
+
onChangeView: (next: import("@rightkit/document-core/documents/types").ViewMode) => Promise<void>;
|
|
247
|
+
registerSearchProviderFor: (path: string) => (provider: import("@rightkit/document-core/documents/types").SearchProvider | null) => void;
|
|
248
|
+
onOpenPathForRouter: (p: string, opts?: {
|
|
249
|
+
background?: boolean;
|
|
250
|
+
}) => void;
|
|
251
|
+
htmlPropsFor: (entryPath: string) => NonNullable<import("react").ComponentProps<typeof import("../index.js").DocumentRouter>["html"]>;
|
|
252
|
+
sourceViewStateRef: import("react").RefObject<Record<string, import("../index.js").SourceEditorViewState>>;
|
|
253
|
+
tabs: {
|
|
254
|
+
openDocs: import("@rightkit/document-core/documents/types").LoadedDocument[];
|
|
255
|
+
setOpenDocs: import("react").Dispatch<import("react").SetStateAction<import("@rightkit/document-core/documents/types").LoadedDocument[]>>;
|
|
256
|
+
activePath: string | null;
|
|
257
|
+
setActivePath: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
|
258
|
+
editsRef: import("react").RefObject<Record<string, string>>;
|
|
259
|
+
writeEdits: (updater: (prev: Record<string, string>) => Record<string, string>) => void;
|
|
260
|
+
writeEditsLive: (path: string, text: string) => void;
|
|
261
|
+
subscribeEdits: (path: string, cb: () => void) => () => void;
|
|
262
|
+
getEditSnapshot: (path: string) => string;
|
|
263
|
+
getExternalSeq: (path: string) => number;
|
|
264
|
+
docxDirty: Set<string>;
|
|
265
|
+
docxDirtyRef: import("react").RefObject<Set<string>>;
|
|
266
|
+
setDocxDirty: (next: import("react").SetStateAction<Set<string>>) => void;
|
|
267
|
+
pdfDirty: Set<string>;
|
|
268
|
+
pdfDirtyRef: import("react").RefObject<Set<string>>;
|
|
269
|
+
setPdfDirty: (next: import("react").SetStateAction<Set<string>>) => void;
|
|
270
|
+
imageDirty: Set<string>;
|
|
271
|
+
imageDirtyRef: import("react").RefObject<Set<string>>;
|
|
272
|
+
setImageDirty: (next: import("react").SetStateAction<Set<string>>) => void;
|
|
273
|
+
htmlPages: import("@rightkit/html-editor/documents/html/sessionTypes").HtmlSessionPages;
|
|
274
|
+
htmlPagesRef: import("react").RefObject<import("@rightkit/html-editor/documents/html/sessionTypes").HtmlSessionPages>;
|
|
275
|
+
writeHtmlPages: (updater: (prev: import("@rightkit/html-editor/documents/html/sessionTypes").HtmlSessionPages) => import("@rightkit/html-editor/documents/html/sessionTypes").HtmlSessionPages, options?: {
|
|
276
|
+
immediate?: boolean;
|
|
277
|
+
}) => void;
|
|
278
|
+
htmlActivePage: Record<string, string>;
|
|
279
|
+
setHtmlActivePage: import("react").Dispatch<import("react").SetStateAction<Record<string, string>>>;
|
|
280
|
+
mdxGrantsRef: import("react").RefObject<Record<string, Set<string>>>;
|
|
281
|
+
trackMdxGrant: (entryPath: string, grantedPath: string) => void;
|
|
282
|
+
};
|
|
283
|
+
docxMenu: import("@rightkit/docx-editor/documents/docx/menuApi").DocxMenuApi | null;
|
|
284
|
+
settings: import("@rightkit/document-core/settings/settings").Settings;
|
|
285
|
+
update: (patch: Partial<import("@rightkit/document-core/settings/settings").Settings>) => void;
|
|
286
|
+
docContextMenu: import("./DocumentContextMenu.js").DocContextMenu | null;
|
|
287
|
+
closeDocContextMenu: () => void;
|
|
288
|
+
copyContents: (() => undefined) | null;
|
|
289
|
+
paletteItems: import("./CommandPalette.js").PaletteItem[];
|
|
290
|
+
settingsOpen: boolean;
|
|
291
|
+
setSettingsOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
292
|
+
paletteOpen: boolean;
|
|
293
|
+
setPaletteOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
294
|
+
helpOpen: boolean;
|
|
295
|
+
setHelpOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
296
|
+
openUrlDialog: boolean;
|
|
297
|
+
setOpenUrlDialog: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
298
|
+
quitDirtyDocs: import("@rightkit/document-core/documents/types").LoadedDocument[];
|
|
299
|
+
open: (path: string, opts?: import("./useDocumentLoader.js").OpenDocumentOptions) => Promise<void>;
|
|
300
|
+
openLiveUrl: (input: string, opts?: {
|
|
301
|
+
background?: boolean;
|
|
302
|
+
}) => Promise<void>;
|
|
303
|
+
fullscreenConfirm: {
|
|
304
|
+
onDone: () => Promise<void>;
|
|
305
|
+
onDiscard: () => Promise<void>;
|
|
306
|
+
onStay: () => void;
|
|
307
|
+
error: string | null;
|
|
308
|
+
} | null;
|
|
309
|
+
};
|
|
310
|
+
export type AppState = ReturnType<typeof useAppState>;
|
|
311
|
+
/** Read the composed app state inside AppProvider. */
|
|
312
|
+
export declare function useAppContext(): AppState;
|
|
313
|
+
/** Mounts the composed app state (all top-level hooks) for AppShell and its children. */
|
|
314
|
+
export declare function AppProvider({ children }: {
|
|
315
|
+
children: ReactNode;
|
|
316
|
+
}): import("react").JSX.Element;
|
|
317
|
+
export {};
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext } from "react";
|
|
3
|
+
import { capabilitiesFor } from "../documents/capabilities.js";
|
|
4
|
+
import { effectiveReadEdit } from "./shell/readEdit.js";
|
|
5
|
+
import { toast } from "@rightkit/platform-ui/headless";
|
|
6
|
+
import { useAppDocumentCore } from "./useAppDocumentCore.js";
|
|
7
|
+
import { useAppChromeState } from "./useAppChromeState.js";
|
|
8
|
+
import { useAppShellSetup } from "./useAppShellSetup.js";
|
|
9
|
+
import { useAppPaneSearch } from "./useAppPaneSearch.js";
|
|
10
|
+
import { useAppTabChrome } from "./useAppTabChrome.js";
|
|
11
|
+
import { useAppCommands } from "./useAppCommands.js";
|
|
12
|
+
import { useAppSlots } from "./useAppSlots.js";
|
|
13
|
+
import { writeClipboardText } from "@rightkit/document-core/state/tauriBridge";
|
|
14
|
+
import { hostAppName } from "../appName.js";
|
|
15
|
+
/**
|
|
16
|
+
* Hook composition for the whole app shell. Hook call order matches the original useAppState exactly:
|
|
17
|
+
* document core → chrome state → shell setup → pane/search → tab chrome/zoom/lifecycle → commands &
|
|
18
|
+
* shortcuts → slots. Plain (non-hook) derivations stay between the same hook calls they originally did.
|
|
19
|
+
*/
|
|
20
|
+
function useAppState() {
|
|
21
|
+
const { blockDrafts, tabs, docBarSlot, setDocBarSlot, dirtyPaths, subscribeDirty, viewState, library, docs, } = useAppDocumentCore();
|
|
22
|
+
const { openDocs, activePath, editsRef, subscribeEdits, getEditSnapshot, getExternalSeq } = tabs;
|
|
23
|
+
const { views, contentScrollRef, requestViewChange: onChangeView } = viewState;
|
|
24
|
+
const { recents, pinnedPaths, pinnedEntries, onTogglePin } = library;
|
|
25
|
+
const { activate, open, openLiveUrl, openRecent, onOpenDialog, newDocument, onSave } = docs;
|
|
26
|
+
const { isDirty, restoringSession } = docs;
|
|
27
|
+
const { settingsOpen, setSettingsOpen, paletteOpen, setPaletteOpen, helpOpen, setHelpOpen, openUrlDialog, setOpenUrlDialog, tabOverviewOpen, setTabOverviewOpen, sidebarCollapsed, setSidebarCollapsed, inspectorOpen, toggleInspector, closeInspector, } = useAppChromeState();
|
|
28
|
+
const { settings, update, handleOpenSettings, dragOver, rootDragProps, docxMenu, setDocxMenu, markdownExport, registerPdfPrint, registerMarkdownExport, handlePrint, docContextMenu, closeDocContextMenu, autoUpdateCheckRan, previewScrollStore, sourceViewStateRef, } = useAppShellSetup({ docs, activePath, setSettingsOpen });
|
|
29
|
+
const active = openDocs.find((d) => d.path === activePath) ?? null;
|
|
30
|
+
// Tab order == openDocs order (titlebar tabs use index-keyed ids for aria-controls/labelledby).
|
|
31
|
+
const activeIndex = openDocs.findIndex((d) => d.path === activePath);
|
|
32
|
+
const quitDirtyDocs = openDocs.filter((doc) => isDirty(doc));
|
|
33
|
+
const view = active ? (views[active.path] ?? "preview") : "preview";
|
|
34
|
+
const { livePaths, renderedPaths, searchProvider, openFind, toggleFind, closeFind, findBarEl, canOpenFind, findOpen, findMode, registerSearchProviderFor, htmlPropsFor, } = useAppPaneSearch({
|
|
35
|
+
docs,
|
|
36
|
+
tabs,
|
|
37
|
+
openDocs,
|
|
38
|
+
activePath,
|
|
39
|
+
active,
|
|
40
|
+
blockDrafts,
|
|
41
|
+
previewScrollStore,
|
|
42
|
+
sourceViewStateRef,
|
|
43
|
+
});
|
|
44
|
+
// Read the live editsRef (not the debounced `edits` state) so the controlled editor + command-palette
|
|
45
|
+
// text actions see the latest keystroke without App re-rendering on every keystroke.
|
|
46
|
+
const activeText = active ? (editsRef.current[active.path] ?? active.content) : "";
|
|
47
|
+
const activeEditable = active ? capabilitiesFor(active.format).canEdit : false;
|
|
48
|
+
const activeReadEdit = active ? effectiveReadEdit(active) : "read";
|
|
49
|
+
const activeTextLike = active ? capabilitiesFor(active.format).canReplace : false;
|
|
50
|
+
// Whole-document copy — shared by the command palette, the bottom-bar button, and the document
|
|
51
|
+
// context menu's "Copy contents". Null for non-text formats (pdf/image/docx binary surfaces).
|
|
52
|
+
const copyContents = activeTextLike && active
|
|
53
|
+
? () => void writeClipboardText(activeText)
|
|
54
|
+
.then(() => toast("Document contents copied", "success"))
|
|
55
|
+
.catch(() => toast("Couldn't copy to clipboard", "error"))
|
|
56
|
+
: null;
|
|
57
|
+
const { titleBarTitleFor, tabStripProps, openPathsSet, openExplorerPath, cycleTab, jumpToTab, zoom, openFromClipboard, } = useAppTabChrome({
|
|
58
|
+
docs,
|
|
59
|
+
tabs,
|
|
60
|
+
activePath,
|
|
61
|
+
sidebarCollapsed,
|
|
62
|
+
tabOverviewOpen,
|
|
63
|
+
setTabOverviewOpen,
|
|
64
|
+
pinnedPaths,
|
|
65
|
+
onTogglePin,
|
|
66
|
+
dirtyPaths,
|
|
67
|
+
subscribeDirty,
|
|
68
|
+
active,
|
|
69
|
+
view,
|
|
70
|
+
settings,
|
|
71
|
+
update,
|
|
72
|
+
autoUpdateCheckRan,
|
|
73
|
+
});
|
|
74
|
+
const titleBarTitle = active ? titleBarTitleFor(active) : hostAppName();
|
|
75
|
+
const { paletteItems, distractionFree, fullscreenConfirm } = useAppCommands({
|
|
76
|
+
docs,
|
|
77
|
+
openDocs,
|
|
78
|
+
recents,
|
|
79
|
+
active,
|
|
80
|
+
activeEditable,
|
|
81
|
+
activeTextLike,
|
|
82
|
+
activeText,
|
|
83
|
+
copyContents,
|
|
84
|
+
settings,
|
|
85
|
+
update,
|
|
86
|
+
onChangeView,
|
|
87
|
+
docxMenu,
|
|
88
|
+
markdownExport,
|
|
89
|
+
handlePrint,
|
|
90
|
+
openFromClipboard,
|
|
91
|
+
cycleTab,
|
|
92
|
+
jumpToTab,
|
|
93
|
+
blockDrafts,
|
|
94
|
+
searchProvider,
|
|
95
|
+
canOpenFind,
|
|
96
|
+
findOpen,
|
|
97
|
+
openFind,
|
|
98
|
+
settingsOpen,
|
|
99
|
+
setSettingsOpen,
|
|
100
|
+
paletteOpen,
|
|
101
|
+
setPaletteOpen,
|
|
102
|
+
helpOpen,
|
|
103
|
+
setHelpOpen,
|
|
104
|
+
openUrlDialog,
|
|
105
|
+
setOpenUrlDialog,
|
|
106
|
+
setTabOverviewOpen,
|
|
107
|
+
});
|
|
108
|
+
const { onOpenPathForRouter, menuSlot, modeSlot } = useAppSlots({
|
|
109
|
+
docs,
|
|
110
|
+
active,
|
|
111
|
+
view,
|
|
112
|
+
onChangeView,
|
|
113
|
+
handlePrint,
|
|
114
|
+
docxMenu,
|
|
115
|
+
activeReadEdit,
|
|
116
|
+
});
|
|
117
|
+
const openUrl = () => setOpenUrlDialog(true);
|
|
118
|
+
return {
|
|
119
|
+
dragOver,
|
|
120
|
+
rootDragProps,
|
|
121
|
+
distractionFree,
|
|
122
|
+
activePath,
|
|
123
|
+
openPathsSet,
|
|
124
|
+
recents,
|
|
125
|
+
pinnedPaths,
|
|
126
|
+
pinnedEntries,
|
|
127
|
+
activate,
|
|
128
|
+
openRecent,
|
|
129
|
+
openExplorerPath,
|
|
130
|
+
onTogglePin,
|
|
131
|
+
library,
|
|
132
|
+
onOpenDialog,
|
|
133
|
+
openUrl,
|
|
134
|
+
openFromClipboard,
|
|
135
|
+
newDocument,
|
|
136
|
+
handleOpenSettings,
|
|
137
|
+
setSidebarCollapsed,
|
|
138
|
+
menuSlot,
|
|
139
|
+
modeSlot,
|
|
140
|
+
active,
|
|
141
|
+
activeIndex,
|
|
142
|
+
activeEditable,
|
|
143
|
+
titleBarTitle,
|
|
144
|
+
titleBarTitleFor,
|
|
145
|
+
subscribeEdits,
|
|
146
|
+
getEditSnapshot,
|
|
147
|
+
getExternalSeq,
|
|
148
|
+
sidebarCollapsed,
|
|
149
|
+
isDirty,
|
|
150
|
+
dirtyPaths,
|
|
151
|
+
subscribeDirty,
|
|
152
|
+
tabStripProps,
|
|
153
|
+
view,
|
|
154
|
+
docBarSlot,
|
|
155
|
+
setDocBarSlot,
|
|
156
|
+
inspectorOpen,
|
|
157
|
+
toggleInspector,
|
|
158
|
+
closeInspector,
|
|
159
|
+
findBarEl,
|
|
160
|
+
zoom,
|
|
161
|
+
docs,
|
|
162
|
+
restoringSession,
|
|
163
|
+
openDocs,
|
|
164
|
+
blockDrafts,
|
|
165
|
+
livePaths,
|
|
166
|
+
renderedPaths,
|
|
167
|
+
views,
|
|
168
|
+
contentScrollRef,
|
|
169
|
+
viewState,
|
|
170
|
+
onSave,
|
|
171
|
+
setDocxMenu,
|
|
172
|
+
registerPdfPrint,
|
|
173
|
+
registerMarkdownExport,
|
|
174
|
+
findMode,
|
|
175
|
+
searchProvider,
|
|
176
|
+
toggleFind,
|
|
177
|
+
closeFind,
|
|
178
|
+
onChangeView,
|
|
179
|
+
registerSearchProviderFor,
|
|
180
|
+
onOpenPathForRouter,
|
|
181
|
+
htmlPropsFor,
|
|
182
|
+
sourceViewStateRef,
|
|
183
|
+
tabs,
|
|
184
|
+
docxMenu,
|
|
185
|
+
settings,
|
|
186
|
+
update,
|
|
187
|
+
docContextMenu,
|
|
188
|
+
closeDocContextMenu,
|
|
189
|
+
copyContents,
|
|
190
|
+
paletteItems,
|
|
191
|
+
settingsOpen,
|
|
192
|
+
setSettingsOpen,
|
|
193
|
+
paletteOpen,
|
|
194
|
+
setPaletteOpen,
|
|
195
|
+
helpOpen,
|
|
196
|
+
setHelpOpen,
|
|
197
|
+
openUrlDialog,
|
|
198
|
+
setOpenUrlDialog,
|
|
199
|
+
quitDirtyDocs,
|
|
200
|
+
open,
|
|
201
|
+
openLiveUrl,
|
|
202
|
+
fullscreenConfirm,
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
const AppContext = createContext(null);
|
|
206
|
+
/** Read the composed app state inside AppProvider. */
|
|
207
|
+
export function useAppContext() {
|
|
208
|
+
const app = useContext(AppContext);
|
|
209
|
+
if (!app)
|
|
210
|
+
throw new Error("useAppContext must be used inside AppProvider");
|
|
211
|
+
return app;
|
|
212
|
+
}
|
|
213
|
+
/** Mounts the composed app state (all top-level hooks) for AppShell and its children. */
|
|
214
|
+
export function AppProvider({ children }) {
|
|
215
|
+
const app = useAppState();
|
|
216
|
+
return _jsx(AppContext.Provider, { value: app, children: children });
|
|
217
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Top-level shell: renders the shared Right Suite legal gate in place of the document workspace
|
|
3
|
+
* until the acceptance receipt in settings is current, then swaps to <App/>. Owns the one call to
|
|
4
|
+
* useReadyShow() for BOTH paths — the gate's own window (960x560, fixed) must reveal itself just
|
|
5
|
+
* like the main app window does, or a real first-run user launching the installer-hidden window
|
|
6
|
+
* sees nothing at all.
|
|
7
|
+
*/
|
|
8
|
+
export declare function AppRoot(): import("react").JSX.Element;
|