@vscode/component-explorer 0.2.1-7 → 0.2.1-71
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 +39 -27
- package/dist/components/ExplorerModel.d.ts +5 -1
- package/dist/components/ExplorerModel.d.ts.map +1 -1
- package/dist/components/FixturePreviewItem.d.ts +2 -0
- package/dist/components/FixturePreviewItem.d.ts.map +1 -1
- package/dist/components/PreviewArea.d.ts.map +1 -1
- package/dist/components/RightSidebar.d.ts +8 -2
- package/dist/components/RightSidebar.d.ts.map +1 -1
- package/dist/components/icons.d.ts +8 -8
- package/dist/components/icons.d.ts.map +1 -1
- package/dist/core/ComponentRenderer.d.ts +8 -10
- package/dist/core/ComponentRenderer.d.ts.map +1 -1
- package/dist/core/ErrorInfo.d.ts +21 -1
- package/dist/core/ErrorInfo.d.ts.map +1 -1
- package/dist/core/FixtureInputStore.d.ts +32 -0
- package/dist/core/FixtureInputStore.d.ts.map +1 -0
- package/dist/core/FixtureNode.d.ts.map +1 -1
- package/dist/core/fixtureApi.d.ts +149 -34
- package/dist/core/fixtureApi.d.ts.map +1 -1
- package/dist/core/fixtureApiConsumer.d.ts +18 -2
- package/dist/core/fixtureApiConsumer.d.ts.map +1 -1
- package/dist/core/index.d.ts +6 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/inputAggregation.d.ts +31 -0
- package/dist/core/inputAggregation.d.ts.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/lib/explorerQueryParams.d.ts +2 -2
- package/dist/lib/explorerQueryParams.d.ts.map +1 -1
- package/dist/lib/fixtureSizeCache.d.ts +2 -0
- package/dist/lib/fixtureSizeCache.d.ts.map +1 -1
- package/dist/modes/EmbeddedMode.d.ts.map +1 -1
- package/dist/modes/HeadlessMode.d.ts +12 -3
- package/dist/modes/HeadlessMode.d.ts.map +1 -1
- package/dist/{runtimeVersion-CESTXB4A.js → runtimeVersion-_Psb35Ng.js} +47 -39
- package/dist/runtimeVersion-_Psb35Ng.js.map +1 -0
- package/dist/viewer.js +1819 -1389
- package/dist/viewer.js.map +1 -1
- package/package.json +15 -14
- package/dist/core/PropertySchema.d.ts +0 -40
- package/dist/core/PropertySchema.d.ts.map +0 -1
- package/dist/runtimeVersion-CESTXB4A.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @vscode/component-explorer
|
|
2
2
|
|
|
3
|
-
Core library for the [Component Explorer](../../README.md). Contains the fixture API,
|
|
3
|
+
Core library for the [Component Explorer](../../README.md). Contains the fixture API, input schemas, fixture registry, and the Explorer React UI.
|
|
4
4
|
|
|
5
5
|
## Fixture API
|
|
6
6
|
|
|
@@ -10,46 +10,54 @@ Defines a single component fixture.
|
|
|
10
10
|
|
|
11
11
|
```tsx
|
|
12
12
|
import { defineFixture } from '@vscode/component-explorer';
|
|
13
|
+
import { z } from 'zod';
|
|
13
14
|
|
|
14
15
|
export default defineFixture({
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
render: (container,
|
|
16
|
+
inputSchema: z.object({
|
|
17
|
+
label: z.string().default('Click me'),
|
|
18
|
+
disabled: z.boolean().default(false),
|
|
19
|
+
}),
|
|
20
|
+
render: (container, { input }) => {
|
|
20
21
|
const root = createRoot(container);
|
|
21
|
-
root.render(<Button label={
|
|
22
|
+
root.render(<Button label={input.label} disabled={input.disabled} />);
|
|
22
23
|
return { dispose: () => root.unmount() };
|
|
23
24
|
},
|
|
24
25
|
});
|
|
25
26
|
```
|
|
26
27
|
|
|
28
|
+
The `inputSchema` is a [zod](https://zod.dev) schema. It is converted to JSON Schema at define
|
|
29
|
+
time, and `input` (typed as `z.infer<typeof schema>`) is populated with the schema's defaults
|
|
30
|
+
plus any overrides set in the explorer's properties panel.
|
|
31
|
+
|
|
27
32
|
Options:
|
|
28
33
|
|
|
29
34
|
| Option | Type | Default | Description |
|
|
30
35
|
|---|---|---|---|
|
|
31
|
-
| `render` | `(container,
|
|
32
|
-
| `
|
|
36
|
+
| `render` | `(container, context) => Disposable` | **(required)** | Renders the component. Must return `{ dispose() }` for cleanup. |
|
|
37
|
+
| `inputSchema` | `z.ZodType` | — | Zod schema describing `input`. Drives the properties panel controls. |
|
|
33
38
|
| `isolation` | `'shadow-dom' \| 'iframe'` | `'shadow-dom'` | Component isolation strategy. |
|
|
34
39
|
| `displayMode` | `DisplayMode` | `{ type: 'component' }` | `'component'` for natural size, or `'page'` with viewport presets. |
|
|
35
40
|
| `styles` | `StyleDefinition[]` | — | Stylesheets injected into the shadow root (shadow-dom isolation only). |
|
|
36
41
|
| `background` | `'light' \| 'dark'` | `'light'` | Preview canvas background pattern. |
|
|
37
42
|
| `description` | `string` | — | Documentation description. |
|
|
38
43
|
|
|
39
|
-
### `defineFixtureGroup(entries)`
|
|
44
|
+
### `defineFixtureGroup(entries)` / `defineFixtureGroup(options, entries)`
|
|
40
45
|
|
|
41
|
-
Groups multiple fixtures (supports nesting)
|
|
46
|
+
Groups multiple fixtures (supports nesting). An optional first argument can declare an
|
|
47
|
+
`inputSchema` shared by — and merged into — every descendant fixture, so common input (e.g. a
|
|
48
|
+
`theme` switch) is declared once for the whole group:
|
|
42
49
|
|
|
43
50
|
```tsx
|
|
44
51
|
import { defineFixture, defineFixtureGroup } from '@vscode/component-explorer';
|
|
52
|
+
import { z } from 'zod';
|
|
45
53
|
|
|
46
|
-
export default defineFixtureGroup(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
|
|
54
|
+
export default defineFixtureGroup(
|
|
55
|
+
{ inputSchema: z.object({ theme: z.enum(['light', 'dark']).default('dark') }) },
|
|
56
|
+
{
|
|
57
|
+
Primary: defineFixture({ render: (c) => { /* ... */ } }),
|
|
58
|
+
Secondary: defineFixture({ render: (c) => { /* ... */ } }),
|
|
59
|
+
},
|
|
60
|
+
);
|
|
53
61
|
```
|
|
54
62
|
|
|
55
63
|
### `defineFixtureVariants(variants)`
|
|
@@ -66,16 +74,21 @@ defineFixtureVariants({
|
|
|
66
74
|
});
|
|
67
75
|
```
|
|
68
76
|
|
|
69
|
-
##
|
|
77
|
+
## Input Schemas
|
|
78
|
+
|
|
79
|
+
Fixture `input` is described with a [zod](https://zod.dev) schema (`inputSchema`). The explorer
|
|
80
|
+
converts it to JSON Schema and renders a control per property in the properties panel:
|
|
70
81
|
|
|
71
|
-
|
|
|
72
|
-
|
|
73
|
-
| `boolean` |
|
|
74
|
-
| `string` |
|
|
75
|
-
| `number`
|
|
76
|
-
| `enum` |
|
|
82
|
+
| Zod type | Control |
|
|
83
|
+
|---|---|
|
|
84
|
+
| `z.boolean()` | Toggle checkbox |
|
|
85
|
+
| `z.string()` | Text input |
|
|
86
|
+
| `z.number()` / `z.int()` | Number input |
|
|
87
|
+
| `z.enum([...])` | Dropdown select |
|
|
77
88
|
|
|
78
|
-
|
|
89
|
+
Use `.default(...)` to set the initial value and `.describe(...)` to document a property. When
|
|
90
|
+
multiple rendered fixtures share a property of the same name and schema, the panel exposes a
|
|
91
|
+
single control that edits them all at once.
|
|
79
92
|
|
|
80
93
|
## Explorer UI Components
|
|
81
94
|
|
|
@@ -96,7 +109,6 @@ The package exports the full Explorer UI as React components:
|
|
|
96
109
|
|---|---|
|
|
97
110
|
| `FixtureRegistry` | Observable registry of discovered fixtures. |
|
|
98
111
|
| `createFixtureTree` | Builds a `FixtureNode` tree from registered fixtures. |
|
|
99
|
-
| `getDefaultPropertyValues` | Extracts default values from a `PropertySchema[]`. |
|
|
100
112
|
| `VIEWPORT_SIZES` | Built-in viewport preset dimensions (`mobile`, `tablet`, `desktop`). |
|
|
101
113
|
|
|
102
114
|
## Styles
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IReader } from '@vscode/observables';
|
|
2
|
-
import { FixtureRegistry, ComponentDefinition } from '../core/index.js';
|
|
2
|
+
import { FixtureRegistry, ComponentDefinition, FixtureInputStore } from '../core/index.js';
|
|
3
3
|
import { ExplorerTreeNode } from './types.js';
|
|
4
4
|
import { DaemonModel } from '../daemon/index.js';
|
|
5
5
|
import { ReportModel } from '../report/ReportModel.js';
|
|
@@ -72,6 +72,10 @@ export declare class ExplorerModel extends ExplorerModel_base {
|
|
|
72
72
|
readonly selectedNode: import('@vscode/observables').IObservableWithChange<ExplorerTreeNode | undefined, void>;
|
|
73
73
|
/** List of preview rows to render based on current selection and view mode */
|
|
74
74
|
readonly selectedFixtures: import('@vscode/observables').IObservableWithChange<readonly PreviewRow[], void>;
|
|
75
|
+
/** Shared store of per-fixture `input` overrides, edited via the properties panel. */
|
|
76
|
+
readonly inputStore: FixtureInputStore;
|
|
77
|
+
/** Flattened list of the live fixtures currently shown in the preview area. */
|
|
78
|
+
readonly renderedFixtures: import('@vscode/observables').IObservableWithChange<readonly FixtureItem[], void>;
|
|
75
79
|
setViewMode: (mode: ViewMode) => void;
|
|
76
80
|
navigateToSession: (sessionName: string) => void;
|
|
77
81
|
toggleLeftSidebar: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExplorerModel.d.ts","sourceRoot":"","sources":["../../src/components/ExplorerModel.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAExE,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"ExplorerModel.d.ts","sourceRoot":"","sources":["../../src/components/ExplorerModel.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAExE,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,KAAK,gBAAgB,EAAkB,MAAM,YAAY,CAAC;AAInE,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3B;IAEF,WAAW,QAAO,IAAI,CAEpB;IAEF,UAAU,GAAI,QAAQ,MAAM,KAAG,IAAI,CAEjC;IAEF,kBAAkB,GAAI,QAAQ,MAAM,KAAG,IAAI,CASzC;IAEF,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO;IAKxD,OAAO,CAAC,qBAAqB;IAW7B,OAAO,CAAC,SAAS;IAWjB,OAAO,CAAC,mBAAmB;IA8C3B;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IA8CxB,OAAO,CAAC,kBAAkB;CA6B3B"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { FixtureInputStore } from '../core/index.js';
|
|
1
2
|
import { FixtureItem } from './ExplorerModel.js';
|
|
2
3
|
import * as React from 'react';
|
|
3
4
|
export declare const FixturePreviewItem: React.ComponentType<{
|
|
4
5
|
fixture: FixtureItem;
|
|
5
6
|
compact: boolean | undefined;
|
|
6
7
|
onSelect: ((nodeId: string) => void) | undefined;
|
|
8
|
+
inputStore: FixtureInputStore | undefined;
|
|
7
9
|
} & {} & {} & {}>;
|
|
8
10
|
//# sourceMappingURL=FixturePreviewItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FixturePreviewItem.d.ts","sourceRoot":"","sources":["../../src/components/FixturePreviewItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"FixturePreviewItem.d.ts","sourceRoot":"","sources":["../../src/components/FixturePreviewItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AA6HtD,eAAO,MAAM,kBAAkB;;;wBA1GE,MAAM,KAAK,IAAI;;iBA0J/C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreviewArea.d.ts","sourceRoot":"","sources":["../../src/components/PreviewArea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,aAAa,EAAc,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"PreviewArea.d.ts","sourceRoot":"","sources":["../../src/components/PreviewArea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,aAAa,EAAc,MAAM,oBAAoB,CAAC;AAsbpE,eAAO,MAAM,WAAW;;iBAmGvB,CAAC"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ExplorerModel } from './ExplorerModel.js';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Properties panel: aggregates the input schemas of every fixture currently rendered in the
|
|
5
|
+
* preview area and presents one control per shared property. Editing a control updates the
|
|
6
|
+
* `input` of all fixtures that declare that property (same name + schema), so common values
|
|
7
|
+
* like a theme can be switched across the whole view at once.
|
|
8
|
+
*/
|
|
3
9
|
export declare const RightSidebar: React.ComponentType<import('@vscode/observables-react').PropsIn<{
|
|
4
|
-
|
|
10
|
+
model: import('@vscode/observables-react').IPropertyTransformerFactory<ExplorerModel, ExplorerModel>;
|
|
5
11
|
}>>;
|
|
6
12
|
//# sourceMappingURL=RightSidebar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RightSidebar.d.ts","sourceRoot":"","sources":["../../src/components/RightSidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"RightSidebar.d.ts","sourceRoot":"","sources":["../../src/components/RightSidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAiJxD;;;;;GAKG;AACH,eAAO,MAAM,YAAY;;GAqCxB,CAAC"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export declare const ChevronRightIcon: ({ style }: {
|
|
3
3
|
style?: React.CSSProperties;
|
|
4
|
-
}) =>
|
|
4
|
+
}) => React.JSX.Element;
|
|
5
5
|
export declare const ChevronDownIcon: ({ style }: {
|
|
6
6
|
style?: React.CSSProperties;
|
|
7
|
-
}) =>
|
|
7
|
+
}) => React.JSX.Element;
|
|
8
8
|
export declare const ComponentIcon: ({ style }: {
|
|
9
9
|
style?: React.CSSProperties;
|
|
10
|
-
}) =>
|
|
10
|
+
}) => React.JSX.Element;
|
|
11
11
|
export declare const FolderIcon: ({ style }: {
|
|
12
12
|
style?: React.CSSProperties;
|
|
13
|
-
}) =>
|
|
14
|
-
export declare const PanelLeftIcon: () =>
|
|
15
|
-
export declare const PanelRightIcon: () =>
|
|
16
|
-
export declare const SunIcon: () =>
|
|
17
|
-
export declare const MoonIcon: () =>
|
|
13
|
+
}) => React.JSX.Element;
|
|
14
|
+
export declare const PanelLeftIcon: () => React.JSX.Element;
|
|
15
|
+
export declare const PanelRightIcon: () => React.JSX.Element;
|
|
16
|
+
export declare const SunIcon: () => React.JSX.Element;
|
|
17
|
+
export declare const MoonIcon: () => React.JSX.Element;
|
|
18
18
|
//# sourceMappingURL=icons.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../src/components/icons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,eAAO,MAAM,gBAAgB,GAAI,WAAW;IAAE,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../src/components/icons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,eAAO,MAAM,gBAAgB,GAAI,WAAW;IAAE,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CAAE,sBAI1E,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,WAAW;IAAE,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CAAE,sBAIzE,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,WAAW;IAAE,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CAAE,sBAIvE,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,WAAW;IAAE,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CAAE,sBAIpE,CAAC;AAEF,eAAO,MAAM,aAAa,yBAIzB,CAAC;AAEF,eAAO,MAAM,cAAc,yBAI1B,CAAC;AAEF,eAAO,MAAM,OAAO,yBAInB,CAAC;AAEF,eAAO,MAAM,QAAQ,yBAIpB,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { ComponentDefinition } from './fixtureApiConsumer.js';
|
|
2
|
-
import { RenderResult } from './fixtureApi.js';
|
|
2
|
+
import { RenderHost, RenderResult } from './fixtureApi.js';
|
|
3
3
|
import { ExceptionError } from './ErrorInfo.js';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
4
|
+
/** Maximum time a fixture render may take before it is reported as failed. */
|
|
5
|
+
export declare const RENDER_TIMEOUT_MS = 3000;
|
|
7
6
|
export declare class ComponentRendering {
|
|
8
7
|
readonly component: ComponentDefinition;
|
|
8
|
+
private readonly _renderHost;
|
|
9
|
+
private readonly _input?;
|
|
9
10
|
readonly renderTarget: HTMLElement;
|
|
10
11
|
readonly iframe: HTMLIFrameElement | null;
|
|
11
12
|
private readonly _abortController;
|
|
@@ -13,13 +14,10 @@ export declare class ComponentRendering {
|
|
|
13
14
|
private _injectedElements;
|
|
14
15
|
private _adoptedSheets;
|
|
15
16
|
private _styleTarget;
|
|
17
|
+
private readonly _disposables;
|
|
16
18
|
private readonly _rendered;
|
|
17
|
-
|
|
18
|
-
private _errorReported;
|
|
19
|
-
error: ExceptionError | undefined;
|
|
20
|
-
constructor(host: HTMLElement, component: ComponentDefinition, options?: ComponentRenderingOptions);
|
|
21
|
-
private _reportError;
|
|
19
|
+
constructor(host: HTMLElement, component: ComponentDefinition, _renderHost?: RenderHost, _input?: unknown | undefined);
|
|
22
20
|
waitForRendering(): Promise<RenderResult | undefined>;
|
|
23
|
-
dispose():
|
|
21
|
+
dispose(): Promise<readonly ExceptionError[]>;
|
|
24
22
|
}
|
|
25
23
|
//# sourceMappingURL=ComponentRenderer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComponentRenderer.d.ts","sourceRoot":"","sources":["../../src/core/ComponentRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ComponentRenderer.d.ts","sourceRoot":"","sources":["../../src/core/ComponentRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAsB,MAAM,yBAAyB,CAAC;AAClF,OAAO,KAAK,EAAe,UAAU,EAAE,YAAY,EAAmB,MAAM,iBAAiB,CAAC;AAC9F,OAAO,KAAK,EAAE,cAAc,EAAmB,MAAM,gBAAgB,CAAC;AAItE,8EAA8E;AAC9E,eAAO,MAAM,iBAAiB,OAAO,CAAC;AA8CtC,qBAAa,kBAAkB;IAa7B,QAAQ,CAAC,SAAS,EAAE,mBAAmB;IACvC,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC;IAdzB,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAAQ;IACjD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAyB;IAC1D,OAAO,CAAC,eAAe,CAAuD;IAC9E,OAAO,CAAC,iBAAiB,CAAqB;IAC9C,OAAO,CAAC,cAAc,CAAuB;IAC7C,OAAO,CAAC,YAAY,CAAmC;IACvD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAqB;IAClD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAoC;gBAG7D,IAAI,EAAE,WAAW,EACR,SAAS,EAAE,mBAAmB,EACtB,WAAW,GAAE,UAAqD,EAClE,MAAM,CAAC,EAAE,OAAO,YAAA;IA8H5B,gBAAgB,IAAI,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;IAmB3D,OAAO,IAAI,OAAO,CAAC,SAAS,cAAc,EAAE,CAAC;CA8C7C"}
|
package/dist/core/ErrorInfo.d.ts
CHANGED
|
@@ -6,15 +6,35 @@ export type RenderEventType = 'console.error' | 'console.warn' | 'console.log' |
|
|
|
6
6
|
export interface RenderEvent {
|
|
7
7
|
readonly type: RenderEventType;
|
|
8
8
|
readonly message: string;
|
|
9
|
+
readonly stack?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Errors and events captured while disposing a fixture (the implicit dispose
|
|
13
|
+
* that runs before a new render, or the explicit one triggered by
|
|
14
|
+
* `disposeAfter` / `disposeCurrentFixture()`).
|
|
15
|
+
*/
|
|
16
|
+
export interface DisposeReport {
|
|
17
|
+
readonly hasError: boolean;
|
|
18
|
+
/** Errors thrown by `dispose()` calls (RenderResult.dispose, addDisposable disposables). */
|
|
19
|
+
readonly errors: readonly ExceptionError[];
|
|
20
|
+
/** Console / window error events fired during the dispose call. */
|
|
21
|
+
readonly events: readonly RenderEvent[];
|
|
9
22
|
}
|
|
10
23
|
export interface RenderReport {
|
|
11
24
|
readonly hasError: boolean;
|
|
12
25
|
readonly error?: ExceptionError;
|
|
13
26
|
readonly events: RenderEvent[];
|
|
14
|
-
|
|
27
|
+
/** Output data the fixture provided via `RenderResult.output` (counterpart of `RenderContext.input`). */
|
|
28
|
+
readonly output?: unknown;
|
|
15
29
|
readonly renderTimeMs: {
|
|
16
30
|
readonly sync: number;
|
|
17
31
|
readonly total: number;
|
|
18
32
|
};
|
|
33
|
+
/**
|
|
34
|
+
* Errors / events captured while disposing the previous fixture (the implicit
|
|
35
|
+
* dispose that runs at the start of `renderFixture`). Present only if the
|
|
36
|
+
* dispose actually surfaced something.
|
|
37
|
+
*/
|
|
38
|
+
readonly previousDispose?: DisposeReport;
|
|
19
39
|
}
|
|
20
40
|
//# sourceMappingURL=ErrorInfo.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorInfo.d.ts","sourceRoot":"","sources":["../../src/core/ErrorInfo.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,MAAM,eAAe,GAAG,eAAe,GAAG,cAAc,GAAG,aAAa,GAAG,cAAc,GAAG,2BAA2B,CAAC;AAE9H,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAC/B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"ErrorInfo.d.ts","sourceRoot":"","sources":["../../src/core/ErrorInfo.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,MAAM,eAAe,GAAG,eAAe,GAAG,cAAc,GAAG,aAAa,GAAG,cAAc,GAAG,2BAA2B,CAAC;AAE9H,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAC/B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,4FAA4F;IAC5F,QAAQ,CAAC,MAAM,EAAE,SAAS,cAAc,EAAE,CAAC;IAC3C,mEAAmE;IACnE,QAAQ,CAAC,MAAM,EAAE,SAAS,WAAW,EAAE,CAAC;CACxC;AAED,MAAM,WAAW,YAAY;IAC5B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,WAAW,EAAE,CAAC;IAC/B,yGAAyG;IACzG,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,YAAY,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IACzE;;;;OAIG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,aAAa,CAAC;CACzC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { IObservable, IReader } from '@vscode/observables';
|
|
2
|
+
import { IJsonSchema } from './fixtureApi.js';
|
|
3
|
+
/** A fixture's input override object (only the keys the user explicitly changed). */
|
|
4
|
+
export type FixtureInputOverride = Record<string, unknown>;
|
|
5
|
+
/**
|
|
6
|
+
* Central store of `input` overrides for the explorer UI.
|
|
7
|
+
*
|
|
8
|
+
* Values are keyed by **property identity** (name + structural schema), not by fixture, so a
|
|
9
|
+
* value chosen on one fixture is automatically reused by every other fixture that declares the
|
|
10
|
+
* same input — navigating between fixtures keeps the shared value instead of resetting it.
|
|
11
|
+
* The whole map is persisted to `localStorage` so choices survive reloads. Schema defaults are
|
|
12
|
+
* applied at render time (see `applyInputDefaults`); only explicit overrides are stored here.
|
|
13
|
+
*/
|
|
14
|
+
export declare class FixtureInputStore {
|
|
15
|
+
/** Shared values keyed by `inputPropertyKey(name, schema)`. */
|
|
16
|
+
private readonly _values;
|
|
17
|
+
/** Cache of derived per-fixture override observables. */
|
|
18
|
+
private readonly _byFixture;
|
|
19
|
+
constructor();
|
|
20
|
+
/**
|
|
21
|
+
* Returns a derived observable of `fixtureId`'s input overrides, mapped from the shared
|
|
22
|
+
* per-property store. Only properties the user explicitly set (across any fixture) appear.
|
|
23
|
+
*/
|
|
24
|
+
getInput(fixtureId: string, schema: IJsonSchema | undefined): IObservable<FixtureInputOverride>;
|
|
25
|
+
/** The currently effective value of a shared property: explicit override, else schema default. */
|
|
26
|
+
readValue(reader: IReader, name: string, schema: IJsonSchema): unknown;
|
|
27
|
+
/** Sets a shared input property (applies to every fixture that declares it) and persists. */
|
|
28
|
+
setValue(name: string, schema: IJsonSchema, value: unknown): void;
|
|
29
|
+
private _load;
|
|
30
|
+
private _persist;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=FixtureInputStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FixtureInputStore.d.ts","sourceRoot":"","sources":["../../src/core/FixtureInputStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsD,KAAK,WAAW,EAAE,KAAK,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACzH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAGnD,qFAAqF;AACrF,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAI3D;;;;;;;;GAQG;AACH,qBAAa,iBAAiB;IAC1B,+DAA+D;IAC/D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA+C;IACvE,yDAAyD;IACzD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAwD;;IAMnF;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,SAAS,GAAG,WAAW,CAAC,oBAAoB,CAAC;IAuB/F,kGAAkG;IAClG,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO;IAStE,6FAA6F;IAC7F,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;IAOjE,OAAO,CAAC,KAAK;IAeb,OAAO,CAAC,QAAQ;CAOnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FixtureNode.d.ts","sourceRoot":"","sources":["../../src/core/FixtureNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"FixtureNode.d.ts","sourceRoot":"","sources":["../../src/core/FixtureNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAe,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAML,KAAK,mBAAmB,EACzB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AA8C/C;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,EAAE,WAAW,CAAC;IAEzB,mBAAmB;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,kGAAkG;IAClG,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,UAAU,GAAG,WAAW,CAAC;IAEnD,0CAA0C;IAC1C,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,WAAW,EAAE,CAAC;IAE3C,sDAAsD;IACtD,QAAQ,CAAC,SAAS,CAAC,EAAE,mBAAmB,CAAC;IAEzC,8CAA8C;IAC9C,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAEnC,0GAA0G;IAC1G,QAAQ,C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