@workbench-kit/shell-react 0.0.2-prototype.0.2.20 → 0.0.2-prototype.0.2.22
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 +18 -3
- package/package.json +16 -10
- package/src/shell/provider.tsx +3 -4
- package/src/shell/shell.tsx +1 -2
- package/src/workbench/layout-storage.ts +5 -3
package/README.md
CHANGED
|
@@ -17,17 +17,32 @@ Peer: React 19.
|
|
|
17
17
|
## Quick start
|
|
18
18
|
|
|
19
19
|
```tsx
|
|
20
|
-
import {
|
|
20
|
+
import { BUILTIN_WORKBENCH_EXTENSIONS } from '@workbench-kit/shell-react';
|
|
21
|
+
import { EditorArea } from '@workbench-kit/shell-react';
|
|
22
|
+
import { WorkbenchProvider } from '@workbench-kit/shell-react/provider';
|
|
23
|
+
import { WorkbenchShell } from '@workbench-kit/shell-react/shell';
|
|
21
24
|
|
|
22
25
|
export function App() {
|
|
23
26
|
return (
|
|
24
|
-
<WorkbenchProvider>
|
|
25
|
-
<WorkbenchShell title="Workbench" primarySidebar={<aside />} />
|
|
27
|
+
<WorkbenchProvider availableExtensions={BUILTIN_WORKBENCH_EXTENSIONS}>
|
|
28
|
+
<WorkbenchShell title="Workbench" primarySidebar={<aside />} editorArea={<EditorArea />} />
|
|
26
29
|
</WorkbenchProvider>
|
|
27
30
|
);
|
|
28
31
|
}
|
|
29
32
|
```
|
|
30
33
|
|
|
34
|
+
`WorkbenchProvider` has no implicit extensions. Product hosts pass their own
|
|
35
|
+
extension list; hosts that want the Kit Explorer/Search/Settings set opt into
|
|
36
|
+
`BUILTIN_WORKBENCH_EXTENSIONS` explicitly. Pure layout persistence helpers are
|
|
37
|
+
available from the non-React `@workbench-kit/shell-react/layout-storage` subpath.
|
|
38
|
+
`WorkbenchShell` also has no implicit editor surface: pass `editorArea` when the
|
|
39
|
+
host wants the Kit editor, or omit it for a product-owned editor region.
|
|
40
|
+
|
|
41
|
+
Performance-sensitive hosts should import orchestration from the focused
|
|
42
|
+
`provider`, `shell`, `command-host`, `command-palette`, and
|
|
43
|
+
`command-descriptors` subpaths. The root barrel remains the discovery surface,
|
|
44
|
+
not the default runtime import graph.
|
|
45
|
+
|
|
31
46
|
Prefer this package when the host needs provider + shell orchestration. For
|
|
32
47
|
layout-only chrome without host services, start from
|
|
33
48
|
`@workbench-kit/react/workbench/shell` — see
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workbench-kit/shell-react",
|
|
3
|
-
"version": "0.0.2-prototype.0.2.
|
|
3
|
+
"version": "0.0.2-prototype.0.2.22",
|
|
4
4
|
"private": false,
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"**/*.css"
|
|
@@ -8,8 +8,14 @@
|
|
|
8
8
|
"type": "module",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": "./src/index.ts",
|
|
11
|
+
"./command-descriptors": "./src/commands/use-command-descriptors.ts",
|
|
12
|
+
"./command-host": "./src/workbench/command-host.tsx",
|
|
13
|
+
"./command-palette": "./src/workbench/command-palette.ts",
|
|
11
14
|
"./field-remap": "./src/field-remap/index.ts",
|
|
12
|
-
"./field-remap/view.css": "./src/field-remap/view.css"
|
|
15
|
+
"./field-remap/view.css": "./src/field-remap/view.css",
|
|
16
|
+
"./layout-storage": "./src/workbench/layout-storage.ts",
|
|
17
|
+
"./provider": "./src/shell/provider.tsx",
|
|
18
|
+
"./shell": "./src/shell/shell.tsx"
|
|
13
19
|
},
|
|
14
20
|
"files": [
|
|
15
21
|
"src",
|
|
@@ -24,14 +30,14 @@
|
|
|
24
30
|
"@xyflow/react": "^12.11.2",
|
|
25
31
|
"jsonata": "^2.2.0",
|
|
26
32
|
"react-table-mapping": "^1.0.3",
|
|
27
|
-
"@workbench-kit/
|
|
28
|
-
"@workbench-kit/field-remap": "0.0.2-prototype.0.2.
|
|
29
|
-
"@workbench-kit/
|
|
30
|
-
"@workbench-kit/
|
|
31
|
-
"@workbench-kit/workbench-
|
|
32
|
-
"@workbench-kit/workbench-
|
|
33
|
-
"@workbench-kit/
|
|
34
|
-
"@workbench-kit/
|
|
33
|
+
"@workbench-kit/react": "0.0.2-prototype.0.2.22",
|
|
34
|
+
"@workbench-kit/field-remap": "0.0.2-prototype.0.2.22",
|
|
35
|
+
"@workbench-kit/platform": "0.0.2-prototype.0.2.22",
|
|
36
|
+
"@workbench-kit/tokens": "0.0.2-prototype.0.2.22",
|
|
37
|
+
"@workbench-kit/workbench-config": "0.0.2-prototype.0.2.22",
|
|
38
|
+
"@workbench-kit/workbench-extension-sdk": "0.0.2-prototype.0.2.22",
|
|
39
|
+
"@workbench-kit/workspace": "0.0.2-prototype.0.2.22",
|
|
40
|
+
"@workbench-kit/workbench-core": "0.0.2-prototype.0.2.22"
|
|
35
41
|
},
|
|
36
42
|
"peerDependencies": {
|
|
37
43
|
"react": "^19.0.0",
|
package/src/shell/provider.tsx
CHANGED
|
@@ -34,7 +34,6 @@ import {
|
|
|
34
34
|
type WorkbenchLayoutStateInput,
|
|
35
35
|
type ViewHostFactory,
|
|
36
36
|
} from '@workbench-kit/workbench-core';
|
|
37
|
-
import { BUILTIN_WORKBENCH_EXTENSIONS } from '../extensions/builtin-extensions.js';
|
|
38
37
|
import {
|
|
39
38
|
ContextKeyService,
|
|
40
39
|
createWorkbenchPermissionContextKeys,
|
|
@@ -96,12 +95,12 @@ export interface WorkbenchWorkspaceHostPort extends WorkbenchEditorSavePort {
|
|
|
96
95
|
|
|
97
96
|
export type { WorkbenchStorageAdapter };
|
|
98
97
|
|
|
99
|
-
const
|
|
100
|
-
|
|
98
|
+
const EMPTY_AVAILABLE_EXTENSIONS: readonly WorkbenchExtensionDescription[] = Object.freeze([]);
|
|
101
99
|
const EMPTY_HOST_THEMES: readonly WorkbenchHostThemeRegistration[] = Object.freeze([]);
|
|
102
100
|
const EMPTY_USER_COMMANDS: readonly WorkbenchUserCommandDefinition[] = Object.freeze([]);
|
|
103
101
|
|
|
104
102
|
export interface WorkbenchProviderProps {
|
|
103
|
+
/** Extensions available to this host. Defaults to none; hosts opt into built-ins explicitly. */
|
|
105
104
|
availableExtensions?: readonly WorkbenchExtensionDescription[];
|
|
106
105
|
children: ReactNode;
|
|
107
106
|
contextKeyValues?: Readonly<Record<string, ContextKeyValue>> | undefined;
|
|
@@ -219,7 +218,7 @@ export function WorkbenchProvider({
|
|
|
219
218
|
viewHostFactories,
|
|
220
219
|
workspaceHostPort,
|
|
221
220
|
}: WorkbenchProviderProps) {
|
|
222
|
-
const hostAvailableExtensions = availableExtensions ??
|
|
221
|
+
const hostAvailableExtensions = availableExtensions ?? EMPTY_AVAILABLE_EXTENSIONS;
|
|
223
222
|
const deferredDisposeRef = useRef<DeferredProviderDispose | undefined>(undefined);
|
|
224
223
|
const shouldPersistEditorState =
|
|
225
224
|
persistEditorState ??
|
package/src/shell/shell.tsx
CHANGED
|
@@ -27,7 +27,6 @@ import {
|
|
|
27
27
|
useResolvedWorkbenchTheme,
|
|
28
28
|
} from '@workbench-kit/react/workbench';
|
|
29
29
|
|
|
30
|
-
import { EditorArea } from '../editor/area.js';
|
|
31
30
|
import { BUILTIN_COMMANDS_VIEW_CONTAINER_ID } from '../commands/view-data.js';
|
|
32
31
|
import { BUILTIN_EXTENSIONS_VIEW_CONTAINER_ID } from '../extensions/view-data.js';
|
|
33
32
|
import {
|
|
@@ -198,7 +197,7 @@ export function WorkbenchShell({
|
|
|
198
197
|
showPanelLayoutToggle = true,
|
|
199
198
|
showAuxiliarySidebarLayoutToggle = true,
|
|
200
199
|
}: WorkbenchShellProps) {
|
|
201
|
-
const resolvedEditorArea = editorArea ??
|
|
200
|
+
const resolvedEditorArea = editorArea ?? null;
|
|
202
201
|
const resolvedWorkbenchTheme = useResolvedWorkbenchTheme(theme ?? 'system');
|
|
203
202
|
const activeThemePreset =
|
|
204
203
|
lightPreset !== undefined && darkPreset !== undefined
|
|
@@ -4,11 +4,13 @@ import {
|
|
|
4
4
|
} from '@workbench-kit/workbench-config';
|
|
5
5
|
import {
|
|
6
6
|
createWorkbenchLayoutState,
|
|
7
|
-
type WorkbenchStorageReader,
|
|
8
|
-
type WorkbenchStorageWriter,
|
|
9
7
|
type WorkbenchLayoutState,
|
|
10
8
|
type WorkbenchLayoutStateInput,
|
|
11
|
-
} from '@workbench-kit/workbench-core';
|
|
9
|
+
} from '@workbench-kit/workbench-core/layout';
|
|
10
|
+
import type {
|
|
11
|
+
WorkbenchStorageReader,
|
|
12
|
+
WorkbenchStorageWriter,
|
|
13
|
+
} from '@workbench-kit/workbench-core/storage';
|
|
12
14
|
|
|
13
15
|
import {
|
|
14
16
|
readLocalJsonStorage,
|