@vscode/component-explorer 0.2.1-161 → 0.2.1-162
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 +86 -7
- package/dist/browserDaemonClient-AB8d4x2O.js +3465 -0
- package/dist/browserDaemonClient-AB8d4x2O.js.map +1 -0
- package/dist/components/BottomDebugPanel.d.ts.map +1 -1
- package/dist/components/DebugWorkbench.d.ts.map +1 -1
- package/dist/components/DebugWorkbenchLayout.d.ts +6 -3
- package/dist/components/DebugWorkbenchLayout.d.ts.map +1 -1
- package/dist/components/DebugWorkbenchState.d.ts +26 -4
- package/dist/components/DebugWorkbenchState.d.ts.map +1 -1
- package/dist/components/ExplorerModel.d.ts.map +1 -1
- package/dist/components/FixturePreviewItem.d.ts +1 -2
- package/dist/components/FixturePreviewItem.d.ts.map +1 -1
- package/dist/components/PageViewportState.d.ts +5 -2
- package/dist/components/PageViewportState.d.ts.map +1 -1
- package/dist/components/PreviewArea.d.ts.map +1 -1
- package/dist/components/RightSidebar.d.ts.map +1 -1
- package/dist/core/ComponentRenderer.d.ts +4 -1
- package/dist/core/ComponentRenderer.d.ts.map +1 -1
- package/dist/core/FixtureInteractionRuntime.d.ts +1 -0
- package/dist/core/FixtureInteractionRuntime.d.ts.map +1 -1
- package/dist/core/FixtureRegistry.d.ts +2 -0
- package/dist/core/FixtureRegistry.d.ts.map +1 -1
- package/dist/core/fixtureApi.d.ts +15 -1
- package/dist/core/fixtureApi.d.ts.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/daemon/DaemonConfig.d.ts +0 -2
- package/dist/daemon/DaemonConfig.d.ts.map +1 -1
- package/dist/daemon/DaemonModel.d.ts +12 -6
- package/dist/daemon/DaemonModel.d.ts.map +1 -1
- package/dist/daemon/browserDaemonClient.d.ts +3 -0
- package/dist/daemon/browserDaemonClient.d.ts.map +1 -0
- package/dist/fixtureApi.d-DjVuiRlO.d.ts +533 -0
- package/dist/index.d.ts +53 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/modes/EmbeddedMode.d.ts.map +1 -1
- package/dist/modes/ExplorerUIMode.d.ts +1 -1
- package/dist/modes/ExplorerUIMode.d.ts.map +1 -1
- package/dist/{runtimeVersion-UpREbArp.js → runtimeVersion-CrhlwHyO.js} +38 -34
- package/dist/runtimeVersion-CrhlwHyO.js.map +1 -0
- package/dist/viewer.d.ts +2900 -24
- package/dist/viewer.d.ts.map +1 -1
- package/dist/viewer.js +3420 -2929
- package/dist/viewer.js.map +1 -1
- package/package.json +6 -4
- package/dist/runtimeVersion-UpREbArp.js.map +0 -1
package/README.md
CHANGED
|
@@ -43,10 +43,19 @@ Options:
|
|
|
43
43
|
| `background` | `'light' \| 'dark'` | `'light'` | Preview canvas background pattern. |
|
|
44
44
|
| `description` | `string` | — | Documentation description. |
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
The sidebar's **Preview Sizing** dropdown applies to all fixtures and persists across navigation
|
|
47
|
+
and reloads. **Fit** scales down to fit the preview viewport's width and height, **1:1** shows
|
|
48
|
+
natural size, and **Responsive (Pages)** resizes page fixtures while using Fit for components.
|
|
49
|
+
Page fixtures retain their per-fixture toolbar for selecting a viewport preset and editing logical
|
|
50
|
+
width/height. These UI settings do not affect embedded or headless rendering.
|
|
51
|
+
|
|
52
|
+
Natural-size component fixtures also default to **Fit**, shrinking to the available preview
|
|
53
|
+
width and height without upscaling small components. Both fixed dimensions and dynamically
|
|
54
|
+
changing content retain their natural layout: only the preview presentation is scaled.
|
|
55
|
+
Dynamic size changes and preview resizing update the scale without remounting the fixture.
|
|
56
|
+
Fit uses a shared preview-viewport budget with fixed allowances for padding and fixture chrome.
|
|
57
|
+
It does not depend on a fixture's position, wrapping, neighboring fixtures, or its scaled bounds.
|
|
58
|
+
Small variants can share a row; large variants wrap without shrinking to their toolbar's width.
|
|
50
59
|
|
|
51
60
|
### Render timeout and diagnostics
|
|
52
61
|
|
|
@@ -114,7 +123,12 @@ single control that edits them all at once.
|
|
|
114
123
|
|
|
115
124
|
Use `inputControls` with `placement: 'toolbar'` for compact boolean or enum controls beside the
|
|
116
125
|
fixture dimensions. Opt a property into live updates with `watchInput`; changed properties without
|
|
117
|
-
a watcher keep the default full-remount behavior
|
|
126
|
+
a watcher keep the default full-remount behavior. A fixture can call
|
|
127
|
+
`reportInput(key, value)` after its component changes a watched property itself.
|
|
128
|
+
This updates the sidebar/shared input store without echoing the change to that
|
|
129
|
+
fixture's watcher or remounting it. Reports are coalesced per microtask and
|
|
130
|
+
discarded after disposal; unwatched properties are rejected. This also works
|
|
131
|
+
across iframe isolation.
|
|
118
132
|
|
|
119
133
|
```ts
|
|
120
134
|
defineFixture({
|
|
@@ -162,8 +176,73 @@ defineFixture({
|
|
|
162
176
|
```
|
|
163
177
|
|
|
164
178
|
Panels default beside a single logical fixture and in the shared bottom workbench for variant rows.
|
|
165
|
-
Set `placement: 'canvas-right'` or `'bottom-panel'` on the panel to override this rule.
|
|
166
|
-
|
|
179
|
+
Set `placement: 'canvas-right'` or `'bottom-panel'` on the panel to override this rule.
|
|
180
|
+
Closed inline panels are grouped in a **Debug panels** dropdown. When a stack's tabs do not fit,
|
|
181
|
+
the active tab remains visible and a **More debug panels** dropdown (`...`) offers the other panels.
|
|
182
|
+
Select a panel, then drag its tab into a split to keep multiple panels visible. During dragging,
|
|
183
|
+
overflowing tabs are revealed; hovering near the tab strip's edges scrolls it. Drop onto a tab
|
|
184
|
+
header to reorder or move tabs between panes.
|
|
185
|
+
|
|
186
|
+
**Split right** creates a second live view of the selected debug panel, leaving the original open.
|
|
187
|
+
Both copies share fixture state but have independent tab selections and view instances. Close a
|
|
188
|
+
pane using its **Close debug pane** button; its other tabs remain available in the workbench.
|
|
189
|
+
|
|
190
|
+
Drag the bottom edge of inline debug panes to give them more vertical space independently of the
|
|
191
|
+
fixture. The resize handle also supports Up/Down arrow keys; double-click or press Home to reset.
|
|
192
|
+
**Viewport height** fills the available preview height without stretching or remounting the fixture.
|
|
193
|
+
Open/closed panes, tab order and selection, duplicate views, split ratios, widths, and heights
|
|
194
|
+
survive navigation and reload in this browser. Storage is scoped to the project supplied by the
|
|
195
|
+
Vite/Webpack plugin. Custom hosts can supply `ExplorerAppOptions.storageScope` (the default is the
|
|
196
|
+
Explorer URL path). Storage errors are reported in the sidebar and console.
|
|
197
|
+
|
|
198
|
+
Enable **Synchronize debug panes** in the properties sidebar to copy the current fixture's
|
|
199
|
+
arrangement into a shared template. Other fixtures use that template with their own live data.
|
|
200
|
+
Missing panel types are temporarily hidden, and empty groups collapse. Navigation and panel
|
|
201
|
+
preference changes do not rewrite the template. An explicit layout edit (including selecting a
|
|
202
|
+
tab or resizing) saves the visible arrangement, discarding hidden groups from the template.
|
|
203
|
+
Turning synchronization off restores the independent fixture layouts and preferences from before
|
|
204
|
+
it was enabled. The aggregated bottom workbench, including Console, persists independently and
|
|
205
|
+
does not participate in synchronization.
|
|
206
|
+
|
|
207
|
+
### Persistent panel UI state
|
|
208
|
+
|
|
209
|
+
Panels can opt into validated, versioned, JSON-serializable view preferences without accessing
|
|
210
|
+
browser storage. Call `context.viewState` with a stable schema/version and one state object per
|
|
211
|
+
panel and scope. `get()` restores state before rendering; `set()` validates and saves it; `onChange()`
|
|
212
|
+
subscribes to changes (dispose the subscription with the panel).
|
|
213
|
+
|
|
214
|
+
```ts
|
|
215
|
+
render(container, context) {
|
|
216
|
+
const preferences = context.viewState({
|
|
217
|
+
version: 1,
|
|
218
|
+
scope: 'pane',
|
|
219
|
+
schema: z.object({ renderer: z.enum(['cmark-gfm', 'markdown-it']) }),
|
|
220
|
+
defaultValue: { renderer: 'cmark-gfm' },
|
|
221
|
+
});
|
|
222
|
+
const select = document.createElement('select');
|
|
223
|
+
for (const renderer of ['cmark-gfm', 'markdown-it']) {
|
|
224
|
+
select.add(new Option(renderer, renderer));
|
|
225
|
+
}
|
|
226
|
+
select.value = preferences.get().renderer;
|
|
227
|
+
select.onchange = () => {
|
|
228
|
+
preferences.set({ renderer: select.value === 'markdown-it' ? 'markdown-it' : 'cmark-gfm' });
|
|
229
|
+
};
|
|
230
|
+
const subscription = preferences.onChange(value => { select.value = value.renderer; });
|
|
231
|
+
container.append(select);
|
|
232
|
+
return {
|
|
233
|
+
update(source) { /* render live fixture data separately */ },
|
|
234
|
+
dispose() { subscription.dispose(); select.remove(); },
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
Use `scope: 'pane'` for preferences that follow a synchronized pane between fixtures (for example,
|
|
240
|
+
the Markdown Reference renderer). Use `scope: 'fixture'` for fixture-dependent selections or scroll
|
|
241
|
+
positions. Split right copies the current preferences once; the two tab instances then evolve
|
|
242
|
+
independently. Docking and reordering retain their identities, even when duplicate tabs are placed
|
|
243
|
+
in the same group. Unsupported versions or invalid saved values use the declared default and
|
|
244
|
+
report a warning; bump the version when changing the state shape. Fixture data, actions, and
|
|
245
|
+
headless rendering are unaffected.
|
|
167
246
|
|
|
168
247
|
Any defined `RenderResult.output` gets a built-in read-only JSON panel. Wrap it with
|
|
169
248
|
`interactiveOutput({ getSnapshot, activate })` to opt into JSON editing; output actions update the
|