@dotdirfm/ui 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/dist/dotdir.css +2 -0
- package/dist/dotdir.js +130 -0
- package/dist/dotdir.mjs +9538 -0
- package/dist/lib/DotDir.d.ts +8 -0
- package/dist/lib/actionQueue.d.ts +7 -0
- package/dist/lib/app.d.ts +3 -0
- package/dist/lib/atoms.d.ts +84 -0
- package/dist/lib/components/ActionBar.d.ts +1 -0
- package/dist/lib/components/CommandLine.d.ts +1 -0
- package/dist/lib/components/CommandPalette.d.ts +10 -0
- package/dist/lib/components/ErrorBoundary.d.ts +18 -0
- package/dist/lib/components/ExtensionContainer.d.ts +48 -0
- package/dist/lib/components/ExtensionsPanel.d.ts +1 -0
- package/dist/lib/components/FileList/Breadcrumbs.d.ts +6 -0
- package/dist/lib/components/FileList/ColumnsScroller.d.ts +16 -0
- package/dist/lib/components/FileList/FileList.d.ts +15 -0
- package/dist/lib/components/FileList/PanelTabs.d.ts +24 -0
- package/dist/lib/components/FileList/ScrollableContainer.d.ts +13 -0
- package/dist/lib/components/FileList/index.d.ts +1 -0
- package/dist/lib/components/FileList/useElementSize.d.ts +7 -0
- package/dist/lib/components/PanelGroup.d.ts +23 -0
- package/dist/lib/components/Terminal.d.ts +2 -0
- package/dist/lib/dialogs/ConflictDialog.d.ts +11 -0
- package/dist/lib/dialogs/CopyConfigDialog.d.ts +8 -0
- package/dist/lib/dialogs/CopyProgressDialog.d.ts +9 -0
- package/dist/lib/dialogs/DeleteProgressDialog.d.ts +6 -0
- package/dist/lib/dialogs/HelpDialog.d.ts +6 -0
- package/dist/lib/dialogs/MakeFolderDialog.d.ts +13 -0
- package/dist/lib/dialogs/ModalDialog.d.ts +14 -0
- package/dist/lib/dialogs/MoveConfigDialog.d.ts +8 -0
- package/dist/lib/dialogs/OpenCreateFileDialog.d.ts +11 -0
- package/dist/lib/dialogs/RenameDialog.d.ts +6 -0
- package/dist/lib/dialogs/dialogContext.d.ts +115 -0
- package/dist/lib/dialogs/dialogHotkeys.d.ts +18 -0
- package/dist/lib/entities/panel/model/panelSide.d.ts +9 -0
- package/dist/lib/entities/panel/model/types.d.ts +1 -0
- package/dist/lib/entities/tab/model/tabsAtoms.d.ts +25 -0
- package/dist/lib/features/bridge/index.d.ts +209 -0
- package/dist/lib/features/bridge/useBridge.d.ts +9 -0
- package/dist/lib/features/commands/builtInCommandContributions.d.ts +2 -0
- package/dist/lib/features/commands/commands.d.ts +90 -0
- package/dist/lib/features/extensions/browserExtensionHost.d.ts +36 -0
- package/dist/lib/features/extensions/browserFsProvider.d.ts +5 -0
- package/dist/lib/features/extensions/extensionApi.d.ts +196 -0
- package/dist/lib/features/extensions/extensionHost.worker.d.ts +174 -0
- package/dist/lib/features/extensions/extensionHostClient.d.ts +29 -0
- package/dist/lib/features/extensions/extensionLoader.d.ts +8 -0
- package/dist/lib/features/extensions/extensions.d.ts +251 -0
- package/dist/lib/features/extensions/useExtensionHost.d.ts +6 -0
- package/dist/lib/features/file-icons/iconCache.d.ts +3 -0
- package/dist/lib/features/file-icons/iconResolver.d.ts +34 -0
- package/dist/lib/features/file-icons/vscodeIconTheme.d.ts +62 -0
- package/dist/lib/features/file-ops/model/fileOperationHandlers.d.ts +10 -0
- package/dist/lib/features/file-ops/model/useFileOperations.d.ts +15 -0
- package/dist/lib/features/marketplace/vscodeMarketplace.d.ts +33 -0
- package/dist/lib/features/navigation/lib/commandLineCd.d.ts +20 -0
- package/dist/lib/features/settings/types.d.ts +12 -0
- package/dist/lib/features/settings/useUserSettings.d.ts +6 -0
- package/dist/lib/features/settings/userSettings.d.ts +8 -0
- package/dist/lib/features/ui-state/types.d.ts +22 -0
- package/dist/lib/features/ui-state/uiState.d.ts +5 -0
- package/dist/lib/fileListHandlers.d.ts +31 -0
- package/dist/lib/focusContext.d.ts +21 -0
- package/dist/lib/fs.d.ts +36 -0
- package/dist/lib/fss.d.ts +9 -0
- package/dist/lib/hooks/useBuiltInCommands.d.ts +24 -0
- package/dist/lib/hooks/useDialogButtonNav.d.ts +10 -0
- package/dist/lib/hooks/useMediaQuery.d.ts +1 -0
- package/dist/lib/hooks/usePanel.d.ts +23 -0
- package/dist/lib/hooks/useTerminal.d.ts +12 -0
- package/dist/lib/jsoncFileWatcher.d.ts +15 -0
- package/dist/lib/languageRegistry.d.ts +43 -0
- package/dist/lib/panelGroupHandlers.d.ts +6 -0
- package/dist/lib/processes/workspace-session/model/useWorkspaceSessionProcess.d.ts +59 -0
- package/dist/lib/registerKeybindings.d.ts +11 -0
- package/dist/lib/styleHost.d.ts +2 -0
- package/dist/lib/terminal/TerminalSession.d.ts +59 -0
- package/dist/lib/terminal/TerminalView.d.ts +8 -0
- package/dist/lib/terminal/path.d.ts +7 -0
- package/dist/lib/terminal/shellProfiles.d.ts +15 -0
- package/dist/lib/terminal/terminalAtoms.d.ts +7 -0
- package/dist/lib/terminal/types.d.ts +53 -0
- package/dist/lib/terminal/useTerminalState.d.ts +20 -0
- package/dist/lib/types.d.ts +12 -0
- package/dist/lib/userKeybindings.d.ts +3 -0
- package/dist/lib/utils/containerPath.d.ts +45 -0
- package/dist/lib/utils/cssModules.d.ts +1 -0
- package/dist/lib/utils/inputNoAssist.d.ts +9 -0
- package/dist/lib/utils/langDetect.d.ts +1 -0
- package/dist/lib/utils/mediaFiles.d.ts +7 -0
- package/dist/lib/utils/path.d.ts +26 -0
- package/dist/lib/utils/vfs.d.ts +2 -0
- package/dist/lib/viewerEditorRegistry.d.ts +53 -0
- package/dist/lib/vscodeColorTheme.d.ts +27 -0
- package/package.json +66 -0
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extension Host Worker
|
|
3
|
+
*
|
|
4
|
+
* Runs in a Web Worker to isolate extension loading from the main thread.
|
|
5
|
+
* Can be safely terminated and restarted to pick up extension changes.
|
|
6
|
+
*
|
|
7
|
+
* Communication protocol with main thread:
|
|
8
|
+
* Main → Worker:
|
|
9
|
+
* { type: 'start', homePath: string } — begin loading extensions
|
|
10
|
+
* { type: 'readFileResult', id, data, error? } — response to a file read request
|
|
11
|
+
* Worker → Main:
|
|
12
|
+
* { type: 'readFile', id, path } — request file contents
|
|
13
|
+
* { type: 'loaded', extensions } — all extensions loaded
|
|
14
|
+
* { type: 'error', message } — fatal loading error
|
|
15
|
+
*/
|
|
16
|
+
interface ExtensionIconTheme {
|
|
17
|
+
id: string;
|
|
18
|
+
label: string;
|
|
19
|
+
path: string;
|
|
20
|
+
}
|
|
21
|
+
interface ExtensionLanguage {
|
|
22
|
+
id: string;
|
|
23
|
+
aliases?: string[];
|
|
24
|
+
extensions?: string[];
|
|
25
|
+
filenames?: string[];
|
|
26
|
+
configuration?: string;
|
|
27
|
+
}
|
|
28
|
+
interface ExtensionGrammar {
|
|
29
|
+
language: string;
|
|
30
|
+
scopeName: string;
|
|
31
|
+
path: string;
|
|
32
|
+
embeddedLanguages?: Record<string, string>;
|
|
33
|
+
}
|
|
34
|
+
interface LoadedGrammar {
|
|
35
|
+
contribution: ExtensionGrammar;
|
|
36
|
+
content: object;
|
|
37
|
+
}
|
|
38
|
+
interface LoadedGrammarRef {
|
|
39
|
+
contribution: ExtensionGrammar;
|
|
40
|
+
/** Absolute path to the grammar JSON file on disk. */
|
|
41
|
+
path: string;
|
|
42
|
+
}
|
|
43
|
+
interface ExtensionViewerContribution {
|
|
44
|
+
id: string;
|
|
45
|
+
label: string;
|
|
46
|
+
patterns: string[];
|
|
47
|
+
mimeTypes?: string[];
|
|
48
|
+
entry: string;
|
|
49
|
+
priority?: number;
|
|
50
|
+
}
|
|
51
|
+
interface ExtensionEditorContribution {
|
|
52
|
+
id: string;
|
|
53
|
+
label: string;
|
|
54
|
+
patterns: string[];
|
|
55
|
+
mimeTypes?: string[];
|
|
56
|
+
langId?: string;
|
|
57
|
+
entry: string;
|
|
58
|
+
priority?: number;
|
|
59
|
+
}
|
|
60
|
+
interface ExtensionColorTheme {
|
|
61
|
+
id?: string;
|
|
62
|
+
label: string;
|
|
63
|
+
uiTheme: string;
|
|
64
|
+
path: string;
|
|
65
|
+
}
|
|
66
|
+
interface ExtensionCommand {
|
|
67
|
+
command: string;
|
|
68
|
+
title: string;
|
|
69
|
+
category?: string;
|
|
70
|
+
icon?: string;
|
|
71
|
+
}
|
|
72
|
+
interface ExtensionKeybinding {
|
|
73
|
+
command: string;
|
|
74
|
+
key: string;
|
|
75
|
+
mac?: string;
|
|
76
|
+
when?: string;
|
|
77
|
+
}
|
|
78
|
+
interface ExtensionFsProviderContribution {
|
|
79
|
+
id: string;
|
|
80
|
+
label: string;
|
|
81
|
+
patterns: string[];
|
|
82
|
+
entry: string;
|
|
83
|
+
priority?: number;
|
|
84
|
+
runtime?: "frontend" | "backend";
|
|
85
|
+
}
|
|
86
|
+
interface ExtensionShellIntegration {
|
|
87
|
+
shell: string;
|
|
88
|
+
label: string;
|
|
89
|
+
scriptPath: string;
|
|
90
|
+
executableCandidates: string[];
|
|
91
|
+
platforms?: ("darwin" | "linux" | "unix" | "windows")[];
|
|
92
|
+
hiddenCdTemplate?: string;
|
|
93
|
+
cwdEscape?: "posix" | "powershell" | "cmd";
|
|
94
|
+
lineEnding?: "\n" | "\r\n";
|
|
95
|
+
spawnArgs?: string[];
|
|
96
|
+
scriptArg?: boolean;
|
|
97
|
+
}
|
|
98
|
+
interface ExtensionContributions {
|
|
99
|
+
iconTheme?: ExtensionIconTheme;
|
|
100
|
+
themes?: ExtensionColorTheme[];
|
|
101
|
+
languages?: ExtensionLanguage[];
|
|
102
|
+
grammars?: ExtensionGrammar[];
|
|
103
|
+
viewers?: ExtensionViewerContribution[];
|
|
104
|
+
editors?: ExtensionEditorContribution[];
|
|
105
|
+
commands?: ExtensionCommand[];
|
|
106
|
+
keybindings?: ExtensionKeybinding[];
|
|
107
|
+
fsProviders?: ExtensionFsProviderContribution[];
|
|
108
|
+
shellIntegrations?: ExtensionShellIntegration[];
|
|
109
|
+
}
|
|
110
|
+
interface ExtensionManifest {
|
|
111
|
+
name: string;
|
|
112
|
+
version: string;
|
|
113
|
+
publisher: string;
|
|
114
|
+
displayName?: string;
|
|
115
|
+
description?: string;
|
|
116
|
+
activationEvents?: string[];
|
|
117
|
+
/**
|
|
118
|
+
* Optional browser activation script entry.
|
|
119
|
+
* If present, the host will load it and call exported `activate()` / `deactivate()`.
|
|
120
|
+
*/
|
|
121
|
+
browser?: string;
|
|
122
|
+
contributes?: ExtensionContributions;
|
|
123
|
+
}
|
|
124
|
+
interface ExtensionRef {
|
|
125
|
+
publisher: string;
|
|
126
|
+
name: string;
|
|
127
|
+
version: string;
|
|
128
|
+
/** Optional absolute path for development; when set, load from this dir instead of extensionsDir. */
|
|
129
|
+
path?: string;
|
|
130
|
+
}
|
|
131
|
+
interface WorkerLoadedColorTheme {
|
|
132
|
+
id: string;
|
|
133
|
+
label: string;
|
|
134
|
+
uiTheme: string;
|
|
135
|
+
jsonPath: string;
|
|
136
|
+
}
|
|
137
|
+
export interface WorkerLoadedExtension {
|
|
138
|
+
ref: ExtensionRef;
|
|
139
|
+
manifest: ExtensionManifest;
|
|
140
|
+
dirPath: string;
|
|
141
|
+
iconThemeFss?: string;
|
|
142
|
+
iconThemeFssPath?: string;
|
|
143
|
+
iconThemeBasePath?: string;
|
|
144
|
+
vscodeIconThemePath?: string;
|
|
145
|
+
vscodeIconThemeId?: string;
|
|
146
|
+
colorThemes?: WorkerLoadedColorTheme[];
|
|
147
|
+
languages?: ExtensionLanguage[];
|
|
148
|
+
/** Grammar contributions (lazy JSON loading for editor). */
|
|
149
|
+
grammarRefs?: LoadedGrammarRef[];
|
|
150
|
+
/** Previously loaded grammars (kept for compatibility). */
|
|
151
|
+
grammars?: LoadedGrammar[];
|
|
152
|
+
viewers?: ExtensionViewerContribution[];
|
|
153
|
+
editors?: ExtensionEditorContribution[];
|
|
154
|
+
/** Command contributions from this extension */
|
|
155
|
+
commands?: ExtensionCommand[];
|
|
156
|
+
/** Keybinding contributions from this extension */
|
|
157
|
+
keybindings?: ExtensionKeybinding[];
|
|
158
|
+
/** FsProvider contributions from this extension */
|
|
159
|
+
fsProviders?: ExtensionFsProviderContribution[];
|
|
160
|
+
/** Shell integration contributions (scripts fully loaded). */
|
|
161
|
+
shellIntegrations?: Array<{
|
|
162
|
+
shell: string;
|
|
163
|
+
label: string;
|
|
164
|
+
script: string;
|
|
165
|
+
executableCandidates: string[];
|
|
166
|
+
platforms?: ("darwin" | "linux" | "unix" | "windows")[];
|
|
167
|
+
hiddenCdTemplate?: string;
|
|
168
|
+
cwdEscape?: "posix" | "powershell" | "cmd";
|
|
169
|
+
lineEnding?: "\n" | "\r\n";
|
|
170
|
+
spawnArgs?: string[];
|
|
171
|
+
scriptArg?: boolean;
|
|
172
|
+
}>;
|
|
173
|
+
}
|
|
174
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Bridge } from '../../../features/bridge';
|
|
2
|
+
import { LoadedExtension } from './extensions';
|
|
3
|
+
type ExtensionsLoadedCallback = (extensions: LoadedExtension[]) => void;
|
|
4
|
+
export declare class ExtensionHostClient {
|
|
5
|
+
private bridge;
|
|
6
|
+
private worker;
|
|
7
|
+
private homePath;
|
|
8
|
+
private listeners;
|
|
9
|
+
private starting;
|
|
10
|
+
private nextRequestId;
|
|
11
|
+
private pendingRequests;
|
|
12
|
+
constructor(bridge: Bridge);
|
|
13
|
+
/** Subscribe to extension load events. Returns an unsubscribe function. */
|
|
14
|
+
onLoaded(cb: ExtensionsLoadedCallback): () => void;
|
|
15
|
+
/** Start the extension host worker. Non-blocking — extensions load in background. */
|
|
16
|
+
start(): Promise<void>;
|
|
17
|
+
/** Terminate the current worker and start a fresh one. */
|
|
18
|
+
restart(): Promise<void>;
|
|
19
|
+
/** Terminate the worker and clean up. */
|
|
20
|
+
dispose(): void;
|
|
21
|
+
activateByEvent(event: string): Promise<void>;
|
|
22
|
+
executeCommand(command: string, args?: unknown[]): Promise<void>;
|
|
23
|
+
private spawnWorker;
|
|
24
|
+
private request;
|
|
25
|
+
private handleFileRead;
|
|
26
|
+
}
|
|
27
|
+
export declare const extensionHostClientAtom: import('jotai').Atom<ExtensionHostClient>;
|
|
28
|
+
export declare function useExtensionHostClient(): ExtensionHostClient;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Bridge } from '../../../features/bridge';
|
|
2
|
+
/**
|
|
3
|
+
* Read the extension entry file and return a blob URL for the script.
|
|
4
|
+
* Caller must revoke the URL when done (e.g. when extension is disposed or cache cleared).
|
|
5
|
+
*/
|
|
6
|
+
export declare function getExtensionScriptUrl(bridge: Bridge, extensionDirPath: string, entry: string): Promise<{
|
|
7
|
+
scriptUrl: string;
|
|
8
|
+
}>;
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import { Bridge, CwdEscapeMode } from '../../../features/bridge';
|
|
2
|
+
export declare const MARKETPLACE_URL = "https://dotdir.dev";
|
|
3
|
+
export interface ExtensionIconThemeFss {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
path: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ExtensionIconThemeVSCode {
|
|
9
|
+
id: string;
|
|
10
|
+
label: string;
|
|
11
|
+
path: string;
|
|
12
|
+
}
|
|
13
|
+
export type ExtensionIconTheme = ExtensionIconThemeFss | ExtensionIconThemeVSCode;
|
|
14
|
+
export interface ExtensionLanguage {
|
|
15
|
+
id: string;
|
|
16
|
+
aliases?: string[];
|
|
17
|
+
extensions?: string[];
|
|
18
|
+
filenames?: string[];
|
|
19
|
+
configuration?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface ExtensionGrammar {
|
|
22
|
+
language: string;
|
|
23
|
+
scopeName: string;
|
|
24
|
+
path: string;
|
|
25
|
+
embeddedLanguages?: Record<string, string>;
|
|
26
|
+
}
|
|
27
|
+
export interface ExtensionCommand {
|
|
28
|
+
command: string;
|
|
29
|
+
title: string;
|
|
30
|
+
category?: string;
|
|
31
|
+
icon?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface ExtensionKeybinding {
|
|
34
|
+
command: string;
|
|
35
|
+
key: string;
|
|
36
|
+
mac?: string;
|
|
37
|
+
when?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface ExtensionMenu {
|
|
40
|
+
command: string;
|
|
41
|
+
group?: string;
|
|
42
|
+
when?: string;
|
|
43
|
+
}
|
|
44
|
+
export interface ExtensionViewerContribution {
|
|
45
|
+
id: string;
|
|
46
|
+
label: string;
|
|
47
|
+
patterns: string[];
|
|
48
|
+
mimeTypes?: string[];
|
|
49
|
+
entry: string;
|
|
50
|
+
priority?: number;
|
|
51
|
+
}
|
|
52
|
+
export interface ExtensionEditorContribution {
|
|
53
|
+
id: string;
|
|
54
|
+
label: string;
|
|
55
|
+
patterns: string[];
|
|
56
|
+
mimeTypes?: string[];
|
|
57
|
+
langId?: string;
|
|
58
|
+
entry: string;
|
|
59
|
+
priority?: number;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* An fsProvider contribution allows an extension to expose the contents of a
|
|
63
|
+
* file (e.g. a ZIP archive) as a browsable directory tree.
|
|
64
|
+
* Patterns match the container file name (same glob syntax as viewers/editors).
|
|
65
|
+
*/
|
|
66
|
+
export interface ExtensionFsProviderContribution {
|
|
67
|
+
id: string;
|
|
68
|
+
label: string;
|
|
69
|
+
patterns: string[];
|
|
70
|
+
entry: string;
|
|
71
|
+
priority?: number;
|
|
72
|
+
/**
|
|
73
|
+
* Where the provider runs.
|
|
74
|
+
* - 'frontend' (default): a JS/CJS bundle loaded in the browser context.
|
|
75
|
+
* - 'backend': a WASM module executed by the Rust host via wasmtime.
|
|
76
|
+
*/
|
|
77
|
+
runtime?: "frontend" | "backend";
|
|
78
|
+
}
|
|
79
|
+
export interface ExtensionColorTheme {
|
|
80
|
+
id?: string;
|
|
81
|
+
label: string;
|
|
82
|
+
uiTheme: string;
|
|
83
|
+
path: string;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* A shellIntegration contribution declares a shell that .dir can spawn:
|
|
87
|
+
* how to find its executable and what init script to inject.
|
|
88
|
+
*
|
|
89
|
+
* The `shell` value matches the executable basename (without .exe on Windows),
|
|
90
|
+
* e.g. "bash", "zsh", "fish", "pwsh", "cmd".
|
|
91
|
+
*/
|
|
92
|
+
export interface ExtensionShellIntegration {
|
|
93
|
+
shell: string;
|
|
94
|
+
/** Display label shown in the shell picker dropdown. */
|
|
95
|
+
label: string;
|
|
96
|
+
/** Relative path to the init script file within the extension directory. */
|
|
97
|
+
scriptPath: string;
|
|
98
|
+
/**
|
|
99
|
+
* Ordered list of filesystem paths to check for the shell executable.
|
|
100
|
+
* Supports $VAR substitution from environment variables.
|
|
101
|
+
* The first existing path wins for each platform.
|
|
102
|
+
*/
|
|
103
|
+
executableCandidates: string[];
|
|
104
|
+
/** Optional platform filter. If omitted, applies to all platforms. */
|
|
105
|
+
platforms?: ("darwin" | "linux" | "unix" | "windows")[];
|
|
106
|
+
/** Hidden `cd` line before running a command from the UI; must contain `{{cwd}}`. */
|
|
107
|
+
hiddenCdTemplate?: string;
|
|
108
|
+
cwdEscape?: CwdEscapeMode;
|
|
109
|
+
lineEnding?: "\n" | "\r\n";
|
|
110
|
+
/** Extra argv after the shell executable (e.g. `--noprofile` for bash). */
|
|
111
|
+
spawnArgs?: string[];
|
|
112
|
+
/**
|
|
113
|
+
* When true, the init script is passed as the last CLI argument (after spawnArgs)
|
|
114
|
+
* rather than written to PTY stdin. Use for shells like pwsh that accept `-Command <script>`.
|
|
115
|
+
*/
|
|
116
|
+
scriptArg?: boolean;
|
|
117
|
+
}
|
|
118
|
+
export interface ExtensionContributions {
|
|
119
|
+
iconTheme?: ExtensionIconTheme;
|
|
120
|
+
iconThemes?: ExtensionIconThemeVSCode[];
|
|
121
|
+
themes?: ExtensionColorTheme[];
|
|
122
|
+
languages?: ExtensionLanguage[];
|
|
123
|
+
grammars?: ExtensionGrammar[];
|
|
124
|
+
commands?: ExtensionCommand[];
|
|
125
|
+
keybindings?: ExtensionKeybinding[];
|
|
126
|
+
menus?: {
|
|
127
|
+
commandPalette?: ExtensionMenu[];
|
|
128
|
+
"explorer/context"?: ExtensionMenu[];
|
|
129
|
+
};
|
|
130
|
+
viewers?: ExtensionViewerContribution[];
|
|
131
|
+
editors?: ExtensionEditorContribution[];
|
|
132
|
+
fsProviders?: ExtensionFsProviderContribution[];
|
|
133
|
+
shellIntegrations?: ExtensionShellIntegration[];
|
|
134
|
+
}
|
|
135
|
+
export interface ExtensionManifest {
|
|
136
|
+
name: string;
|
|
137
|
+
version: string;
|
|
138
|
+
publisher: string;
|
|
139
|
+
displayName?: string;
|
|
140
|
+
description?: string;
|
|
141
|
+
icon?: string;
|
|
142
|
+
/**
|
|
143
|
+
* Optional browser activation script entry.
|
|
144
|
+
* If present, the host will load it and call its exported `activate()` / `deactivate()`.
|
|
145
|
+
*/
|
|
146
|
+
browser?: string;
|
|
147
|
+
contributes?: ExtensionContributions;
|
|
148
|
+
}
|
|
149
|
+
export interface ExtensionRef {
|
|
150
|
+
publisher: string;
|
|
151
|
+
name: string;
|
|
152
|
+
version: string;
|
|
153
|
+
/** Optional absolute path for development; when set, load extension from this dir instead of ~/.dotdir/extensions/<publisher>-<name>-<version>. */
|
|
154
|
+
path?: string;
|
|
155
|
+
}
|
|
156
|
+
export interface LoadedGrammar {
|
|
157
|
+
contribution: ExtensionGrammar;
|
|
158
|
+
content: object;
|
|
159
|
+
}
|
|
160
|
+
export interface LoadedGrammarRef {
|
|
161
|
+
contribution: ExtensionGrammar;
|
|
162
|
+
/** Absolute path to the grammar JSON file on disk. */
|
|
163
|
+
path: string;
|
|
164
|
+
}
|
|
165
|
+
export interface LoadedColorTheme {
|
|
166
|
+
id: string;
|
|
167
|
+
label: string;
|
|
168
|
+
uiTheme: string;
|
|
169
|
+
jsonPath: string;
|
|
170
|
+
}
|
|
171
|
+
export interface LoadedExtension {
|
|
172
|
+
ref: ExtensionRef;
|
|
173
|
+
manifest: ExtensionManifest;
|
|
174
|
+
dirPath: string;
|
|
175
|
+
iconUrl?: string;
|
|
176
|
+
/** FSS-based icon theme content (lazy-loaded when active). */
|
|
177
|
+
iconThemeFss?: string;
|
|
178
|
+
/** Absolute path to the FSS icon theme file on disk (lazy-loaded). */
|
|
179
|
+
iconThemeFssPath?: string;
|
|
180
|
+
/** Directory containing the icon theme FSS file, for resolving relative url() paths */
|
|
181
|
+
iconThemeBasePath?: string;
|
|
182
|
+
/** VS Code icon theme JSON path (absolute) */
|
|
183
|
+
vscodeIconThemePath?: string;
|
|
184
|
+
/** VS Code icon theme ID */
|
|
185
|
+
vscodeIconThemeId?: string;
|
|
186
|
+
/** Color theme contributions from this extension */
|
|
187
|
+
colorThemes?: LoadedColorTheme[];
|
|
188
|
+
/** Language contributions from this extension */
|
|
189
|
+
languages?: ExtensionLanguage[];
|
|
190
|
+
/** Grammar contributions (lazy JSON loading for editor). */
|
|
191
|
+
grammarRefs?: LoadedGrammarRef[];
|
|
192
|
+
/** Previously loaded grammars (kept for compatibility). */
|
|
193
|
+
grammars?: LoadedGrammar[];
|
|
194
|
+
/** Command contributions from this extension */
|
|
195
|
+
commands?: ExtensionCommand[];
|
|
196
|
+
/** Keybinding contributions from this extension */
|
|
197
|
+
keybindings?: ExtensionKeybinding[];
|
|
198
|
+
/** Viewer contributions from this extension */
|
|
199
|
+
viewers?: ExtensionViewerContribution[];
|
|
200
|
+
/** Editor contributions from this extension */
|
|
201
|
+
editors?: ExtensionEditorContribution[];
|
|
202
|
+
/** FsProvider contributions from this extension */
|
|
203
|
+
fsProviders?: ExtensionFsProviderContribution[];
|
|
204
|
+
/** Shell integration contributions from this extension (fully resolved). */
|
|
205
|
+
shellIntegrations?: Array<{
|
|
206
|
+
shell: string;
|
|
207
|
+
label: string;
|
|
208
|
+
script: string;
|
|
209
|
+
executableCandidates: string[];
|
|
210
|
+
platforms?: ("darwin" | "linux" | "unix" | "windows")[];
|
|
211
|
+
hiddenCdTemplate?: string;
|
|
212
|
+
cwdEscape?: CwdEscapeMode;
|
|
213
|
+
lineEnding?: "\n" | "\r\n";
|
|
214
|
+
spawnArgs?: string[];
|
|
215
|
+
scriptArg?: boolean;
|
|
216
|
+
}>;
|
|
217
|
+
}
|
|
218
|
+
export interface MarketplaceExtension {
|
|
219
|
+
id: string;
|
|
220
|
+
name: string;
|
|
221
|
+
display_name: string;
|
|
222
|
+
description: string;
|
|
223
|
+
icon_url: string | null;
|
|
224
|
+
categories: string[];
|
|
225
|
+
tags: string[];
|
|
226
|
+
total_downloads: number;
|
|
227
|
+
publisher: {
|
|
228
|
+
username: string;
|
|
229
|
+
display_name: string | null;
|
|
230
|
+
};
|
|
231
|
+
latest_version: {
|
|
232
|
+
version: string;
|
|
233
|
+
archive_size: number;
|
|
234
|
+
created_at: string;
|
|
235
|
+
} | null;
|
|
236
|
+
}
|
|
237
|
+
export declare function loadExtensions(bridge: Bridge): Promise<LoadedExtension[]>;
|
|
238
|
+
export declare function searchMarketplace(query?: string, page?: number): Promise<{
|
|
239
|
+
extensions: MarketplaceExtension[];
|
|
240
|
+
total: number;
|
|
241
|
+
}>;
|
|
242
|
+
export declare function installExtension(bridge: Bridge, publisherUsername: string, extName: string, version: string): Promise<void>;
|
|
243
|
+
export declare function installVSCodeExtension(bridge: Bridge, publisherName: string, extName: string, downloadUrl: string): Promise<void>;
|
|
244
|
+
export declare function uninstallExtension(bridge: Bridge, publisherUsername: string, extName: string): Promise<void>;
|
|
245
|
+
export declare function extensionIconThemeId(ext: LoadedExtension): string | null;
|
|
246
|
+
export declare function isVSCodeIconTheme(ext: LoadedExtension): boolean;
|
|
247
|
+
export declare function colorThemeKey(ext: LoadedExtension, themeId: string): string;
|
|
248
|
+
export declare function findColorTheme(exts: LoadedExtension[], key: string): {
|
|
249
|
+
ext: LoadedExtension;
|
|
250
|
+
theme: LoadedColorTheme;
|
|
251
|
+
} | null;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified Icon Resolver
|
|
3
|
+
*
|
|
4
|
+
* Provides a single interface for resolving file/folder icons,
|
|
5
|
+
* supporting both FSS-based and VS Code icon themes.
|
|
6
|
+
*/
|
|
7
|
+
export type IconThemeType = "fss" | "vscode" | "none";
|
|
8
|
+
export declare function useSetIconTheme(): {
|
|
9
|
+
setIconTheme: (type: IconThemeType, path?: string) => Promise<void>;
|
|
10
|
+
};
|
|
11
|
+
export declare function useSetIconThemeKind(): {
|
|
12
|
+
setIconThemeKind: (kind: "dark" | "light") => void;
|
|
13
|
+
};
|
|
14
|
+
export declare function getIconThemeType(): IconThemeType;
|
|
15
|
+
export declare function onIconThemeChange(listener: () => void): () => void;
|
|
16
|
+
export interface ResolvedIcon {
|
|
17
|
+
path: string;
|
|
18
|
+
url: string | null;
|
|
19
|
+
fallbackUrl: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Resolve icon for a file or folder.
|
|
23
|
+
* Returns the icon path (for loading), cached URL if available, and a fallback URL.
|
|
24
|
+
*/
|
|
25
|
+
export declare function useResolveIcon(): (name: string, isDirectory: boolean, isExpanded: boolean, isRoot: boolean, langId?: string, fssIconPath?: string | null) => ResolvedIcon;
|
|
26
|
+
/**
|
|
27
|
+
* Load icons by path.
|
|
28
|
+
* Handles both FSS (via iconCache) and VS Code (via vscodeIconTheme).
|
|
29
|
+
*/
|
|
30
|
+
export declare function useLoadIconsForPaths(): (paths: string[]) => Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Get cached icon URL by path.
|
|
33
|
+
*/
|
|
34
|
+
export declare function useGetCachedIcon(): (path: string) => string | null;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Bridge } from '../../../features/bridge';
|
|
2
|
+
export interface VSCodeIconDefinition {
|
|
3
|
+
iconPath: string;
|
|
4
|
+
}
|
|
5
|
+
export interface VSCodeIconThemeJson {
|
|
6
|
+
iconDefinitions: Record<string, VSCodeIconDefinition>;
|
|
7
|
+
file?: string;
|
|
8
|
+
folder?: string;
|
|
9
|
+
folderExpanded?: string;
|
|
10
|
+
rootFolder?: string;
|
|
11
|
+
rootFolderExpanded?: string;
|
|
12
|
+
fileExtensions?: Record<string, string>;
|
|
13
|
+
fileNames?: Record<string, string>;
|
|
14
|
+
folderNames?: Record<string, string>;
|
|
15
|
+
folderNamesExpanded?: Record<string, string>;
|
|
16
|
+
languageIds?: Record<string, string>;
|
|
17
|
+
light?: {
|
|
18
|
+
file?: string;
|
|
19
|
+
folder?: string;
|
|
20
|
+
folderExpanded?: string;
|
|
21
|
+
fileExtensions?: Record<string, string>;
|
|
22
|
+
fileNames?: Record<string, string>;
|
|
23
|
+
folderNames?: Record<string, string>;
|
|
24
|
+
folderNamesExpanded?: Record<string, string>;
|
|
25
|
+
};
|
|
26
|
+
highContrast?: {
|
|
27
|
+
file?: string;
|
|
28
|
+
folder?: string;
|
|
29
|
+
folderExpanded?: string;
|
|
30
|
+
fileExtensions?: Record<string, string>;
|
|
31
|
+
fileNames?: Record<string, string>;
|
|
32
|
+
folderNames?: Record<string, string>;
|
|
33
|
+
folderNamesExpanded?: Record<string, string>;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export interface LoadedVSCodeIconTheme {
|
|
37
|
+
json: VSCodeIconThemeJson;
|
|
38
|
+
basePath: string;
|
|
39
|
+
iconCache: Map<string, string>;
|
|
40
|
+
}
|
|
41
|
+
export interface IconMatch {
|
|
42
|
+
iconPath: string | null;
|
|
43
|
+
iconUrl: string | null;
|
|
44
|
+
}
|
|
45
|
+
export declare class VSCodeIconThemeResolver {
|
|
46
|
+
private bridge;
|
|
47
|
+
private theme;
|
|
48
|
+
private loadingIcons;
|
|
49
|
+
private themeKind;
|
|
50
|
+
constructor(bridge: Bridge);
|
|
51
|
+
load(jsonPath: string): Promise<void>;
|
|
52
|
+
setTheme(kind: "dark" | "light"): void;
|
|
53
|
+
clear(): void;
|
|
54
|
+
isLoaded(): boolean;
|
|
55
|
+
private getEffectiveMap;
|
|
56
|
+
resolveIcon(name: string, isDirectory: boolean, isExpanded: boolean, isRoot: boolean, langId?: string): string | null;
|
|
57
|
+
loadIcon(iconPath: string): Promise<string | null>;
|
|
58
|
+
preloadIcons(paths: string[]): Promise<void>;
|
|
59
|
+
getCachedIcon(iconPath: string): string | null;
|
|
60
|
+
}
|
|
61
|
+
export declare const vscodeIconThemeAtom: import('jotai').Atom<VSCodeIconThemeResolver>;
|
|
62
|
+
export declare function useVscodeIconTheme(): VSCodeIconThemeResolver;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface FileOperationHandlers {
|
|
2
|
+
moveToTrash(sourcePaths: string[], refresh: () => void): void;
|
|
3
|
+
permanentDelete(sourcePaths: string[], refresh: () => void): void;
|
|
4
|
+
copy(sourcePaths: string[], refresh: () => void): void;
|
|
5
|
+
move(sourcePaths: string[], refresh: () => void): void;
|
|
6
|
+
rename(sourcePath: string, currentName: string, refresh: () => void): void;
|
|
7
|
+
pasteToCommandLine(text: string): void;
|
|
8
|
+
}
|
|
9
|
+
export declare function setFileOperationHandlers(handlers: FileOperationHandlers): void;
|
|
10
|
+
export declare function getFileOperationHandlers(): FileOperationHandlers | null;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PanelSide } from '../../../../entities/panel/model/types';
|
|
2
|
+
import { Dispatch, RefObject, SetStateAction } from 'react';
|
|
3
|
+
export type { PanelSide };
|
|
4
|
+
/** Minimal interface the hook needs from each panel. */
|
|
5
|
+
export interface PanelHandle {
|
|
6
|
+
currentPath: string;
|
|
7
|
+
navigateTo(path: string, force?: boolean): void;
|
|
8
|
+
}
|
|
9
|
+
export declare function useFileOperations(activePanelRef: RefObject<PanelSide>, leftRef: RefObject<PanelHandle>, rightRef: RefObject<PanelHandle>, setSelectionKey: Dispatch<SetStateAction<number>>): {
|
|
10
|
+
handleCopy: (sourcePaths: string[], refresh: () => void) => void;
|
|
11
|
+
handleMove: (sourcePaths: string[], refresh: () => void) => void;
|
|
12
|
+
handleMoveToTrash: (sourcePaths: string[], refresh: () => void) => void;
|
|
13
|
+
handlePermanentDelete: (sourcePaths: string[], _refresh: () => void) => void;
|
|
14
|
+
handleRename: (sourcePath: string, currentName: string, refresh: () => void) => void;
|
|
15
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VS Code Marketplace API and VSIX support
|
|
3
|
+
*/
|
|
4
|
+
export interface VSCodeExtension {
|
|
5
|
+
publisher: {
|
|
6
|
+
publisherName: string;
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
|
9
|
+
extensionName: string;
|
|
10
|
+
displayName: string;
|
|
11
|
+
shortDescription: string;
|
|
12
|
+
versions: {
|
|
13
|
+
version: string;
|
|
14
|
+
assetUri: string;
|
|
15
|
+
}[];
|
|
16
|
+
statistics: {
|
|
17
|
+
statisticName: string;
|
|
18
|
+
value: number;
|
|
19
|
+
}[];
|
|
20
|
+
}
|
|
21
|
+
export interface VSCodeSearchResult {
|
|
22
|
+
results: {
|
|
23
|
+
extensions: VSCodeExtension[];
|
|
24
|
+
}[];
|
|
25
|
+
}
|
|
26
|
+
export declare function searchVSCodeMarketplace(query: string, page?: number): Promise<{
|
|
27
|
+
extensions: VSCodeExtension[];
|
|
28
|
+
total: number;
|
|
29
|
+
}>;
|
|
30
|
+
export declare function getVSCodeInstallCount(ext: VSCodeExtension): number;
|
|
31
|
+
export declare function getVSCodeLatestVersion(ext: VSCodeExtension): string | null;
|
|
32
|
+
export declare function getVSCodeDownloadUrl(ext: VSCodeExtension): string | null;
|
|
33
|
+
export declare function getVSCodeIconUrl(ext: VSCodeExtension): string | null;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Bridge } from '../../../../features/bridge';
|
|
2
|
+
export type ParsedCdCommand = {
|
|
3
|
+
kind: "setAlias";
|
|
4
|
+
alias: string;
|
|
5
|
+
} | {
|
|
6
|
+
kind: "goAlias";
|
|
7
|
+
alias: string;
|
|
8
|
+
} | {
|
|
9
|
+
kind: "chdir";
|
|
10
|
+
pathArg: string;
|
|
11
|
+
} | {
|
|
12
|
+
kind: "error";
|
|
13
|
+
message: string;
|
|
14
|
+
};
|
|
15
|
+
/** Returns null if this is not a `cd` command (should run in terminal). */
|
|
16
|
+
export declare function parseCdCommand(cmd: string): ParsedCdCommand | null;
|
|
17
|
+
/** Resolve `cd` path argument relative to cwd (empty → home). */
|
|
18
|
+
export declare function resolveCdPath(bridge: Bridge, pathArg: string, cwd: string): Promise<string>;
|
|
19
|
+
/** True if path exists and can be listed as a directory. */
|
|
20
|
+
export declare function isExistingDirectory(bridge: Bridge, path: string): Promise<boolean>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface DotDirSettings {
|
|
2
|
+
iconTheme?: string;
|
|
3
|
+
colorTheme?: string;
|
|
4
|
+
/**
|
|
5
|
+
* Max file size in bytes to open for editing.
|
|
6
|
+
* Use 0 (or any negative value) to disable the limit.
|
|
7
|
+
*/
|
|
8
|
+
editorFileSizeLimit?: number;
|
|
9
|
+
showHidden?: boolean;
|
|
10
|
+
/** Command-line folder aliases: `cd:name` navigates to the absolute path. Set with `cd::name`. */
|
|
11
|
+
pathAliases?: Record<string, string>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Bridge } from '../../../features/bridge';
|
|
2
|
+
import { DotDirSettings } from './types';
|
|
3
|
+
export declare const DEFAULT_EDITOR_FILE_SIZE_LIMIT = 0;
|
|
4
|
+
export declare function getSettings(): DotDirSettings;
|
|
5
|
+
export declare function updateSettings(bridge: Bridge, partial: Partial<DotDirSettings>): void;
|
|
6
|
+
export declare function onSettingsChange(callback: (settings: DotDirSettings) => void): () => void;
|
|
7
|
+
export declare function initUserSettings(bridge: Bridge): Promise<DotDirSettings>;
|
|
8
|
+
export declare function disposeUserSettings(): Promise<void>;
|