@vscode/component-explorer 0.1.1-0 → 0.1.1-10
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 +104 -0
- package/dist/component-explorer.css +1 -0
- package/dist/components/Explorer.d.ts +5 -1
- package/dist/components/Explorer.d.ts.map +1 -1
- package/dist/components/ExplorerModel.d.ts +29 -2
- package/dist/components/ExplorerModel.d.ts.map +1 -1
- package/dist/components/FixturePreviewItem.d.ts +0 -1
- package/dist/components/FixturePreviewItem.d.ts.map +1 -1
- package/dist/components/FixtureScreenshotView.d.ts +12 -0
- package/dist/components/FixtureScreenshotView.d.ts.map +1 -0
- package/dist/components/PreviewArea.d.ts.map +1 -1
- package/dist/components/ScreenshotComparisonRow.d.ts +12 -0
- package/dist/components/ScreenshotComparisonRow.d.ts.map +1 -0
- package/dist/components/TitleBar.d.ts.map +1 -1
- package/dist/components/index.d.ts +3 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/core/CliRuntime.d.ts +48 -0
- package/dist/core/CliRuntime.d.ts.map +1 -0
- package/dist/core/ErrorInfo.d.ts +29 -0
- package/dist/core/ErrorInfo.d.ts.map +1 -0
- package/dist/core/FixtureNode.d.ts +2 -1
- package/dist/core/FixtureNode.d.ts.map +1 -1
- package/dist/core/FixtureRegistry.d.ts +2 -1
- package/dist/core/FixtureRegistry.d.ts.map +1 -1
- package/dist/core/fixtureApi.d.ts +215 -0
- package/dist/core/fixtureApi.d.ts.map +1 -0
- package/dist/core/fixtureApiConsumer.d.ts +83 -0
- package/dist/core/fixtureApiConsumer.d.ts.map +1 -0
- package/dist/core/index.d.ts +7 -6
- package/dist/core/index.d.ts.map +1 -1
- package/dist/daemon/DaemonConfig.d.ts +19 -0
- package/dist/daemon/DaemonConfig.d.ts.map +1 -0
- package/dist/daemon/DaemonModel.d.ts +57 -0
- package/dist/daemon/DaemonModel.d.ts.map +1 -0
- package/dist/daemon/index.d.ts +5 -0
- package/dist/daemon/index.d.ts.map +1 -0
- package/dist/index.d.ts +8 -28
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -1372
- package/dist/index.js.map +1 -1
- package/dist/lib/fixtureSizeCache.d.ts +1 -10
- package/dist/lib/fixtureSizeCache.d.ts.map +1 -1
- package/dist/viewer.d.ts +48 -0
- package/dist/viewer.d.ts.map +1 -0
- package/dist/viewer.js +3713 -0
- package/dist/viewer.js.map +1 -0
- package/package.json +11 -7
- package/dist/core/ComponentDefinition.d.ts +0 -70
- package/dist/core/ComponentDefinition.d.ts.map +0 -1
- package/dist/core/defineFixture.d.ts +0 -109
- package/dist/core/defineFixture.d.ts.map +0 -1
- package/dist/index.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CliRuntime.d.ts","sourceRoot":"","sources":["../../src/core/CliRuntime.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAa,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAI9D,MAAM,WAAW,cAAc;IAC9B,CAAC,IAAI,EAAE,MAAM,GAAG;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;CACtC;AAED,UAAU,WAAW;IACpB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED,UAAU,MAAM;IACf,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,YAAY,IAAI,WAAW,EAAE,CAAC;IAC9B,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CACxD;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,MAAM;QACf,wBAAwB,CAAC,EAAE,MAAM,CAAC;KAClC;CACD;AAED;;;;GAIG;AACH,qBAAa,UAAU;IASrB,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IARnC,QAAQ,CAAC,SAAS,SAAuC;IACzD,OAAO,CAAC,cAAc,CAAK;IAC3B,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAAC,eAAe,CAAiB;IACxC,OAAO,CAAC,kBAAkB,CAA0B;IACpD,OAAO,CAAC,iBAAiB,CAA0B;gBAGjC,iBAAiB,EAAE,WAAW,EAC/C,cAAc,EAAE,cAAc;IAU/B,IAAI,aAAa,IAAI,MAAM,CAE1B;IAED,cAAc,CAAC,cAAc,EAAE,cAAc,GAAG,IAAI;IAQpD,WAAW,IAAI,IAAI;IAKnB,YAAY,IAAI,WAAW,EAAE;IAIvB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAgF7D,OAAO,CAAC,cAAc;IAWtB,OAAO,CAAC,gBAAgB;IAYxB,OAAO,CAAC,gBAAgB;IASxB,OAAO,CAAC,iBAAiB;CAYzB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error captured during fixture rendering.
|
|
3
|
+
* Can be either an unhandled exception or a console error/warning.
|
|
4
|
+
*/
|
|
5
|
+
export type ErrorInfo = ExceptionError | ConsoleError;
|
|
6
|
+
/**
|
|
7
|
+
* Unhandled exception thrown during render.
|
|
8
|
+
*/
|
|
9
|
+
export interface ExceptionError {
|
|
10
|
+
readonly kind: 'exception';
|
|
11
|
+
readonly message: string;
|
|
12
|
+
readonly stack?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Console error or warning captured during render.
|
|
16
|
+
*/
|
|
17
|
+
export interface ConsoleError {
|
|
18
|
+
readonly kind: 'console';
|
|
19
|
+
readonly level: 'error' | 'warn';
|
|
20
|
+
readonly message: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Result of rendering a fixture, including any captured errors.
|
|
24
|
+
*/
|
|
25
|
+
export interface RenderResult {
|
|
26
|
+
/** Errors captured during rendering (exceptions and console.error/warn) */
|
|
27
|
+
readonly errors: ErrorInfo[];
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=ErrorInfo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorInfo.d.ts","sourceRoot":"","sources":["../../src/core/ErrorInfo.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,cAAc,GAAG,YAAY,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC;IACjC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B,2EAA2E;IAC3E,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC;CAC7B"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FixtureExport } from './fixtureApi.js';
|
|
2
|
+
import { ComponentDefinition } from './fixtureApiConsumer.js';
|
|
2
3
|
/**
|
|
3
4
|
* A node in the fixture tree.
|
|
4
5
|
* Can be a folder (with children), variants (with children, horizontal layout), or a component leaf.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FixtureNode.d.ts","sourceRoot":"","sources":["../../src/core/FixtureNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"FixtureNode.d.ts","sourceRoot":"","sources":["../../src/core/FixtureNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAKH,KAAK,mBAAmB,EAC3B,MAAM,yBAAyB,CAAC;AAEjC;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,sDAAsD;IACtD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB,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;CAC1C;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,WAAW,CAenF;AA8FD;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,WAAW,GAAG,SAAS,CAezF;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,WAAW,GAAG,mBAAmB,EAAE,CAU1E"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IObservable, IReader } from '@vscode/observables';
|
|
2
|
-
import {
|
|
2
|
+
import { FixtureExport } from './fixtureApi.js';
|
|
3
|
+
import { ComponentDefinition } from './fixtureApiConsumer.js';
|
|
3
4
|
import { FixtureNode } from './FixtureNode.js';
|
|
4
5
|
/**
|
|
5
6
|
* Registry for discovered fixtures.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FixtureRegistry.d.ts","sourceRoot":"","sources":["../../src/core/FixtureRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,WAAW,EAAE,KAAK,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC/F,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"FixtureRegistry.d.ts","sourceRoot":"","sources":["../../src/core/FixtureRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,WAAW,EAAE,KAAK,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC/F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAqC,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEvF;;;GAGG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAgE;IAE1F,0CAA0C;IAC1C,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC,WAAW,CAAC,CAGpC;IAEH;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,aAAa,GAAG,IAAI;IAM1D;;;OAGG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAO9B;;OAEG;IACH,KAAK,IAAI,IAAI;IAIb;;OAEG;IACH,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,WAAW,GAAG,SAAS;IAKjE;;;OAGG;IACH,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,mBAAmB,GAAG,SAAS;CAMpE"}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public Fixture API
|
|
3
|
+
*
|
|
4
|
+
* This module is the public API for defining fixtures.
|
|
5
|
+
* It's designed to be stable across versions - projects can use a different
|
|
6
|
+
* @vscode/component-explorer version than the explorer viewer uses.
|
|
7
|
+
*
|
|
8
|
+
* Use Symbol.for() instead of Symbol() so the same symbol is shared across
|
|
9
|
+
* different versions of this package.
|
|
10
|
+
*
|
|
11
|
+
* @module fixtureApi
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Disposable resource that can be cleaned up.
|
|
15
|
+
*/
|
|
16
|
+
export interface IDisposable {
|
|
17
|
+
dispose(): void;
|
|
18
|
+
}
|
|
19
|
+
/** @deprecated Use IDisposable instead */
|
|
20
|
+
export type Disposable = IDisposable;
|
|
21
|
+
/**
|
|
22
|
+
* Style definition for shadow DOM injection.
|
|
23
|
+
*/
|
|
24
|
+
export type StyleDefinition = {
|
|
25
|
+
readonly type: 'css';
|
|
26
|
+
readonly content: string;
|
|
27
|
+
} | {
|
|
28
|
+
readonly type: 'url';
|
|
29
|
+
readonly href: string;
|
|
30
|
+
} | {
|
|
31
|
+
readonly type: 'adopted';
|
|
32
|
+
readonly sheet: CSSStyleSheet;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Display mode for a component.
|
|
36
|
+
*/
|
|
37
|
+
export type DisplayMode = PageMode | ComponentMode;
|
|
38
|
+
/**
|
|
39
|
+
* Page mode - component fills a viewport with device presets.
|
|
40
|
+
*/
|
|
41
|
+
export interface PageMode {
|
|
42
|
+
readonly type: 'page';
|
|
43
|
+
readonly viewports: ViewportPreset[];
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Component mode - renders at natural size.
|
|
47
|
+
*/
|
|
48
|
+
export interface ComponentMode {
|
|
49
|
+
readonly type: 'component';
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Viewport preset - either a named preset or custom dimensions.
|
|
53
|
+
*/
|
|
54
|
+
export type ViewportPreset = ViewportPresetName | {
|
|
55
|
+
readonly name: string;
|
|
56
|
+
readonly width: number;
|
|
57
|
+
readonly height: number;
|
|
58
|
+
};
|
|
59
|
+
export type ViewportPresetName = 'mobile' | 'tablet' | 'desktop';
|
|
60
|
+
/**
|
|
61
|
+
* Schema for a component property.
|
|
62
|
+
*/
|
|
63
|
+
export type PropertySchema = BooleanProperty | StringProperty | NumberProperty | EnumProperty;
|
|
64
|
+
export interface BooleanProperty {
|
|
65
|
+
readonly type: 'boolean';
|
|
66
|
+
readonly name: string;
|
|
67
|
+
readonly defaultValue: boolean;
|
|
68
|
+
readonly description?: string;
|
|
69
|
+
}
|
|
70
|
+
export interface StringProperty {
|
|
71
|
+
readonly type: 'string';
|
|
72
|
+
readonly name: string;
|
|
73
|
+
readonly defaultValue: string;
|
|
74
|
+
readonly description?: string;
|
|
75
|
+
readonly multiline?: boolean;
|
|
76
|
+
}
|
|
77
|
+
export interface NumberProperty {
|
|
78
|
+
readonly type: 'number';
|
|
79
|
+
readonly name: string;
|
|
80
|
+
readonly defaultValue: number;
|
|
81
|
+
readonly description?: string;
|
|
82
|
+
readonly min?: number;
|
|
83
|
+
readonly max?: number;
|
|
84
|
+
readonly step?: number;
|
|
85
|
+
}
|
|
86
|
+
export interface EnumProperty {
|
|
87
|
+
readonly type: 'enum';
|
|
88
|
+
readonly name: string;
|
|
89
|
+
readonly defaultValue: string;
|
|
90
|
+
readonly description?: string;
|
|
91
|
+
readonly options: readonly string[];
|
|
92
|
+
}
|
|
93
|
+
/** Brand symbol to identify single fixtures */
|
|
94
|
+
export declare const singleFixtureBrand: unique symbol;
|
|
95
|
+
/** Brand symbol to identify fixture groups */
|
|
96
|
+
export declare const fixtureGroupBrand: unique symbol;
|
|
97
|
+
/** Brand symbol to identify fixture variants */
|
|
98
|
+
export declare const fixtureVariantsBrand: unique symbol;
|
|
99
|
+
/**
|
|
100
|
+
* Options for defining a single component fixture.
|
|
101
|
+
*/
|
|
102
|
+
export interface DefineFixtureOptions {
|
|
103
|
+
/** Optional description for documentation */
|
|
104
|
+
description?: string;
|
|
105
|
+
/** How to isolate: 'iframe' for full isolation, 'shadow-dom' (default) for lighter isolation */
|
|
106
|
+
isolation?: 'iframe' | 'shadow-dom';
|
|
107
|
+
/** Display mode: defaults to { type: 'component' } */
|
|
108
|
+
displayMode?: DisplayMode;
|
|
109
|
+
/** Styles to inject (for shadow-dom isolation) */
|
|
110
|
+
styles?: StyleDefinition[];
|
|
111
|
+
/** Background pattern for the preview canvas: 'light' (default) or 'dark' for dark transparent pattern */
|
|
112
|
+
background?: 'light' | 'dark';
|
|
113
|
+
/** Property definitions */
|
|
114
|
+
properties?: PropertySchema[];
|
|
115
|
+
/** Render function */
|
|
116
|
+
render: (container: HTMLElement, props: Record<string, unknown>) => IDisposable;
|
|
117
|
+
}
|
|
118
|
+
/** @deprecated Use DefineFixtureOptions instead */
|
|
119
|
+
export type DefineComponentOptions = DefineFixtureOptions;
|
|
120
|
+
/**
|
|
121
|
+
* A single fixture export created by defineFixture().
|
|
122
|
+
*/
|
|
123
|
+
export interface SingleFixtureExport {
|
|
124
|
+
readonly [singleFixtureBrand]: true;
|
|
125
|
+
readonly _options: DefineFixtureOptions;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Group entry: either a single fixture, a nested group, or variants.
|
|
129
|
+
*/
|
|
130
|
+
export type FixtureGroupEntry = SingleFixtureExport | FixtureGroupExport | FixtureVariantsExport;
|
|
131
|
+
/**
|
|
132
|
+
* A fixture group export created by defineFixtureGroup().
|
|
133
|
+
*/
|
|
134
|
+
export interface FixtureGroupExport {
|
|
135
|
+
readonly [fixtureGroupBrand]: true;
|
|
136
|
+
readonly _entries: {
|
|
137
|
+
[key: string]: FixtureGroupEntry;
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* A fixture variants export created by defineFixtureVariants().
|
|
142
|
+
*/
|
|
143
|
+
export interface FixtureVariantsExport {
|
|
144
|
+
readonly [fixtureVariantsBrand]: true;
|
|
145
|
+
readonly _variants: {
|
|
146
|
+
[key: string]: SingleFixtureExport;
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Fixture export type - a single fixture, a group, or variants.
|
|
151
|
+
*/
|
|
152
|
+
export type FixtureExport = SingleFixtureExport | FixtureGroupExport | FixtureVariantsExport;
|
|
153
|
+
/**
|
|
154
|
+
* Input for defineFixtureGroup.
|
|
155
|
+
*/
|
|
156
|
+
export type FixtureGroupInput = {
|
|
157
|
+
[key: string]: FixtureGroupEntry;
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* Input for defineFixtureVariants (only single fixtures, no nesting).
|
|
161
|
+
*/
|
|
162
|
+
export type FixtureVariantsInput = {
|
|
163
|
+
[key: string]: SingleFixtureExport;
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* Defines a single fixture.
|
|
167
|
+
*
|
|
168
|
+
* @example
|
|
169
|
+
* ```ts
|
|
170
|
+
* export default defineFixture({
|
|
171
|
+
* properties: [
|
|
172
|
+
* { type: 'string', name: 'label', defaultValue: 'Click me' },
|
|
173
|
+
* ],
|
|
174
|
+
* render: (container, props) => {
|
|
175
|
+
* container.innerHTML = `<button>${props.label}</button>`;
|
|
176
|
+
* return { dispose: () => { container.innerHTML = ''; } };
|
|
177
|
+
* },
|
|
178
|
+
* });
|
|
179
|
+
* ```
|
|
180
|
+
*/
|
|
181
|
+
export declare function defineFixture(options: DefineFixtureOptions): SingleFixtureExport;
|
|
182
|
+
/**
|
|
183
|
+
* Defines a group of fixtures with support for nesting.
|
|
184
|
+
*
|
|
185
|
+
* @example
|
|
186
|
+
* ```ts
|
|
187
|
+
* export default defineFixtureGroup({
|
|
188
|
+
* Primary: defineFixture({
|
|
189
|
+
* render: (container) => { ... },
|
|
190
|
+
* }),
|
|
191
|
+
* Variants: defineFixtureGroup({
|
|
192
|
+
* Small: defineFixture({ ... }),
|
|
193
|
+
* Large: defineFixture({ ... }),
|
|
194
|
+
* }),
|
|
195
|
+
* });
|
|
196
|
+
* ```
|
|
197
|
+
*/
|
|
198
|
+
export declare function defineFixtureGroup(group: FixtureGroupInput): FixtureGroupExport;
|
|
199
|
+
/**
|
|
200
|
+
* Defines a group of fixture variants (no nesting allowed).
|
|
201
|
+
* Variants are rendered horizontally by default and have a distinct icon in the tree.
|
|
202
|
+
*
|
|
203
|
+
* @example
|
|
204
|
+
* ```ts
|
|
205
|
+
* export default defineFixtureGroup({
|
|
206
|
+
* Button: defineFixtureVariants({
|
|
207
|
+
* Small: defineFixture({ ... }),
|
|
208
|
+
* Medium: defineFixture({ ... }),
|
|
209
|
+
* Large: defineFixture({ ... }),
|
|
210
|
+
* }),
|
|
211
|
+
* });
|
|
212
|
+
* ```
|
|
213
|
+
*/
|
|
214
|
+
export declare function defineFixtureVariants(variants: FixtureVariantsInput): FixtureVariantsExport;
|
|
215
|
+
//# sourceMappingURL=fixtureApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixtureApi.d.ts","sourceRoot":"","sources":["../../src/core/fixtureApi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,0CAA0C;AAC1C,MAAM,MAAM,UAAU,GAAG,WAAW,CAAC;AAErC;;GAEG;AACH,MAAM,MAAM,eAAe,GACvB;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAClD;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC/C;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAA;CAAE,CAAC;AAEhE;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,aAAa,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,cAAc,EAAE,CAAC;CACtC;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;CAC5B;AAED;;GAEG;AACH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AW,kBAAkB;IACjC,QAAQ,CAAC,CAAC,iBAAiB,CAAC,EAAE,IAAI,CAAC;IACnC,QAAQ,CAAC,QAAQ,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB,CAAA;KAAE,CAAC;CACzD;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,CAAC,oBAAoB,CAAC,EAAE,IAAI,CAAC;IACtC,QAAQ,CAAC,SAAS,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,mBAAmB,CAAA;KAAE,CAAC;CAC5D;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,mBAAmB,GAAG,kBAAkB,GAAG,qBAAqB,CAAC;AAE7F;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB,CAAA;CAAE,CAAC;AAErE;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,mBAAmB,CAAA;CAAE,CAAC;AAM1E;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,mBAAmB,CAKhF;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,GAAG,kBAAkB,CAK/E;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,oBAAoB,GAAG,qBAAqB,CAK3F"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { FixtureExport, SingleFixtureExport, FixtureGroupExport, FixtureVariantsExport, DisplayMode, StyleDefinition, PropertySchema, IDisposable } from './fixtureApi.js';
|
|
2
|
+
/**
|
|
3
|
+
* Type guard for SingleFixtureExport.
|
|
4
|
+
* Uses the global symbol brand for cross-version compatibility.
|
|
5
|
+
*/
|
|
6
|
+
export declare function isSingleFixture(value: unknown): value is SingleFixtureExport;
|
|
7
|
+
/**
|
|
8
|
+
* Type guard for FixtureGroupExport.
|
|
9
|
+
* Uses the global symbol brand for cross-version compatibility.
|
|
10
|
+
*/
|
|
11
|
+
export declare function isFixtureGroup(value: unknown): value is FixtureGroupExport;
|
|
12
|
+
/**
|
|
13
|
+
* Type guard for FixtureVariantsExport.
|
|
14
|
+
* Uses the global symbol brand for cross-version compatibility.
|
|
15
|
+
*/
|
|
16
|
+
export declare function isFixtureVariants(value: unknown): value is FixtureVariantsExport;
|
|
17
|
+
/**
|
|
18
|
+
* Type guard for any fixture export type.
|
|
19
|
+
*/
|
|
20
|
+
export declare function isFixtureExport(value: unknown): value is FixtureExport;
|
|
21
|
+
export type ParseResult<T> = {
|
|
22
|
+
success: true;
|
|
23
|
+
data: T;
|
|
24
|
+
} | {
|
|
25
|
+
success: false;
|
|
26
|
+
error: string;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Parses and validates a potential fixture export.
|
|
30
|
+
* Returns a ParseResult with either the validated data or an error message.
|
|
31
|
+
*/
|
|
32
|
+
export declare function parseFixtureExport(value: unknown): ParseResult<FixtureExport>;
|
|
33
|
+
/**
|
|
34
|
+
* Parses and validates a single fixture export.
|
|
35
|
+
*/
|
|
36
|
+
export declare function parseSingleFixture(value: unknown): ParseResult<SingleFixtureExport>;
|
|
37
|
+
/**
|
|
38
|
+
* Parses and validates a fixture group export.
|
|
39
|
+
*/
|
|
40
|
+
export declare function parseFixtureGroup(value: unknown): ParseResult<FixtureGroupExport>;
|
|
41
|
+
/**
|
|
42
|
+
* Parses and validates a fixture variants export.
|
|
43
|
+
*/
|
|
44
|
+
export declare function parseFixtureVariants(value: unknown): ParseResult<FixtureVariantsExport>;
|
|
45
|
+
/**
|
|
46
|
+
* Definition of a component fixture (internal representation).
|
|
47
|
+
*/
|
|
48
|
+
export interface ComponentDefinition {
|
|
49
|
+
/** Unique identifier within the fixture file */
|
|
50
|
+
readonly id: string;
|
|
51
|
+
/** Display name shown in the tree */
|
|
52
|
+
readonly name: string;
|
|
53
|
+
/** Optional description for documentation */
|
|
54
|
+
readonly description?: string;
|
|
55
|
+
/** How to isolate this component from other components */
|
|
56
|
+
readonly isolation: 'iframe' | 'shadow-dom';
|
|
57
|
+
/** How to display: page (device viewport) or component (natural size) */
|
|
58
|
+
readonly displayMode: DisplayMode;
|
|
59
|
+
/**
|
|
60
|
+
* Stylesheets to inject into shadow root (for shadow-dom isolation).
|
|
61
|
+
* Ignored when isolation is 'iframe'.
|
|
62
|
+
*/
|
|
63
|
+
readonly styles?: readonly StyleDefinition[];
|
|
64
|
+
/** Background pattern for the preview canvas: 'light' (default) or 'dark' for dark transparent pattern */
|
|
65
|
+
readonly background: 'light' | 'dark';
|
|
66
|
+
/** Property schema for the component */
|
|
67
|
+
readonly properties: readonly PropertySchema[];
|
|
68
|
+
/**
|
|
69
|
+
* Render the component into the container.
|
|
70
|
+
* Returns a disposable for cleanup (e.g., unmounting React).
|
|
71
|
+
*/
|
|
72
|
+
render(container: HTMLElement, props: Record<string, unknown>): IDisposable;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Creates the component definition from a validated SingleFixtureExport.
|
|
76
|
+
*/
|
|
77
|
+
export declare function createComponentDefinition(fixture: SingleFixtureExport, id: string, name: string): ComponentDefinition;
|
|
78
|
+
/**
|
|
79
|
+
* Type guard for checking if a value is a ComponentDefinition.
|
|
80
|
+
* @deprecated Use isSingleFixture or isFixtureGroup instead
|
|
81
|
+
*/
|
|
82
|
+
export declare function isComponentDefinition(value: unknown): value is ComponentDefinition;
|
|
83
|
+
//# sourceMappingURL=fixtureApiConsumer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixtureApiConsumer.d.ts","sourceRoot":"","sources":["../../src/core/fixtureApiConsumer.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAIH,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,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CAA6C;IAC7C,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAE9B,0DAA0D;IAC1D,QAAQ,CAAC,SAAS,EAAE,QAAQ,GAAG,YAAY,CAAC;IAE5C,yEAAyE;IACzE,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAElC;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;IAE7C,0GAA0G;IAC1G,QAAQ,CAAC,UAAU,EAAE,OAAO,GAAG,MAAM,CAAC;IAEtC,wCAAwC;IACxC,QAAQ,CAAC,UAAU,EAAE,SAAS,cAAc,EAAE,CAAC;IAE/C;;;OAGG;IACH,MAAM,CAAC,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,WAAW,CAAC;CAC7E;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,mBAAmB,EAC5B,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,MAAM,GACX,mBAAmB,CAarB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,mBAAmB,CASlF"}
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
export type {
|
|
2
|
-
export
|
|
3
|
-
export type { ComponentDefinition,
|
|
1
|
+
export type { IDisposable, StyleDefinition, DisplayMode, PageMode, ComponentMode, ViewportPreset, ViewportPresetName, PropertySchema, BooleanProperty, StringProperty, NumberProperty, EnumProperty, DefineFixtureOptions, DefineComponentOptions, FixtureGroupEntry, FixtureGroupInput, FixtureVariantsInput, FixtureExport, SingleFixtureExport, FixtureGroupExport, FixtureVariantsExport, } from './fixtureApi.js';
|
|
2
|
+
export { singleFixtureBrand, fixtureGroupBrand, fixtureVariantsBrand, defineFixture, defineFixtureGroup, defineFixtureVariants, } from './fixtureApi.js';
|
|
3
|
+
export type { ComponentDefinition, ParseResult } from './fixtureApiConsumer.js';
|
|
4
|
+
export { isSingleFixture, isFixtureGroup, isFixtureVariants, parseFixtureExport, parseSingleFixture, parseFixtureGroup, parseFixtureVariants, createComponentDefinition, isComponentDefinition, } from './fixtureApiConsumer.js';
|
|
5
|
+
export type { ErrorInfo, ExceptionError, ConsoleError, RenderResult, } from './ErrorInfo.js';
|
|
4
6
|
export type { FixtureNode, } from './FixtureNode.js';
|
|
5
|
-
export type { DefineFixtureOptions, DefineComponentOptions, FixtureGroupEntry, FixtureGroupInput, FixtureVariantsInput, } from './defineFixture.js';
|
|
6
7
|
export { VIEWPORT_SIZES, resolveViewport } from './DisplayMode.js';
|
|
7
8
|
export { getDefaultPropertyValues } from './PropertySchema.js';
|
|
8
|
-
export { isComponentDefinition } from './ComponentDefinition.js';
|
|
9
9
|
export { createFixtureTree, findNodeByPath, collectComponents } from './FixtureNode.js';
|
|
10
|
-
export { defineFixture, defineFixtureGroup, defineFixtureVariants, isSingleFixture, isFixtureGroup, isFixtureVariants } from './defineFixture.js';
|
|
11
10
|
export { FixtureRegistry } from './FixtureRegistry.js';
|
|
11
|
+
export { CliRuntime } from './CliRuntime.js';
|
|
12
|
+
export type { FixtureModules } from './CliRuntime.js';
|
|
12
13
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/core/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAGA,YAAY,EACV,WAAW,EACX,eAAe,EACf,WAAW,EACX,QAAQ,EACR,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,cAAc,EACd,cAAc,EACd,YAAY,EACZ,oBAAoB,EACpB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EACpB,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,aAAa,EACb,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,iBAAiB,CAAC;AAKzB,YAAY,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EACL,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,yBAAyB,EACzB,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AAKjC,YAAY,EACV,SAAS,EACT,cAAc,EACd,YAAY,EACZ,YAAY,GACb,MAAM,gBAAgB,CAAC;AAExB,YAAY,EACV,WAAW,GACZ,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGxF,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration injected by the daemon via the Vite plugin.
|
|
3
|
+
* Set as `window.__EXPLORER_DAEMON__` when the explorer is served from a daemon-managed Vite server.
|
|
4
|
+
*/
|
|
5
|
+
export interface DaemonConfig {
|
|
6
|
+
/** Name of the session this explorer instance belongs to (e.g. 'current' or 'baseline') */
|
|
7
|
+
readonly sessionName: string;
|
|
8
|
+
}
|
|
9
|
+
declare global {
|
|
10
|
+
interface Window {
|
|
11
|
+
__EXPLORER_DAEMON__?: DaemonConfig;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Reads daemon config from the global window object.
|
|
16
|
+
* Returns undefined if the explorer is not running under a daemon.
|
|
17
|
+
*/
|
|
18
|
+
export declare function getDaemonConfig(): DaemonConfig | undefined;
|
|
19
|
+
//# sourceMappingURL=DaemonConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DaemonConfig.d.ts","sourceRoot":"","sources":["../../src/daemon/DaemonConfig.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC5B,2FAA2F;IAC3F,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC7B;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,MAAM;QACf,mBAAmB,CAAC,EAAE,YAAY,CAAC;KACnC;CACD;AAED;;;GAGG;AACH,wBAAgB,eAAe,IAAI,YAAY,GAAG,SAAS,CAE1D"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { IObservable } from '@vscode/observables';
|
|
2
|
+
import { DaemonApiType } from '@vscode/component-explorer-cli/daemon-types';
|
|
3
|
+
import { DaemonConfig } from './DaemonConfig.js';
|
|
4
|
+
/** Screenshot result from the daemon */
|
|
5
|
+
export type DaemonScreenshotResult = DaemonApiType['screenshots']['take']['TResult'];
|
|
6
|
+
/** Comparison result from the daemon */
|
|
7
|
+
export type DaemonCompareResult = DaemonApiType['screenshots']['compare']['TResult'];
|
|
8
|
+
/** Fixture info from the daemon */
|
|
9
|
+
export type DaemonFixtureInfo = DaemonApiType['fixtures']['list']['TResult'][number];
|
|
10
|
+
/**
|
|
11
|
+
* Client-side model for interacting with the daemon.
|
|
12
|
+
* Manages source tree IDs, screenshot caching, and the event stream.
|
|
13
|
+
*/
|
|
14
|
+
export declare class DaemonModel {
|
|
15
|
+
readonly config: DaemonConfig;
|
|
16
|
+
private readonly _sourceTreeIds;
|
|
17
|
+
private readonly _sessions;
|
|
18
|
+
private readonly _screenshotCache;
|
|
19
|
+
private readonly _client;
|
|
20
|
+
private _eventStreamAbort;
|
|
21
|
+
readonly sessionName: string;
|
|
22
|
+
/** Observable map of sessionName → current sourceTreeId */
|
|
23
|
+
readonly sourceTreeIds: IObservable<ReadonlyMap<string, string>>;
|
|
24
|
+
/** Observable list of sessions from the daemon */
|
|
25
|
+
readonly sessions: IObservable<readonly {
|
|
26
|
+
name: string;
|
|
27
|
+
serverUrl: string;
|
|
28
|
+
}[]>;
|
|
29
|
+
constructor(config: DaemonConfig);
|
|
30
|
+
/**
|
|
31
|
+
* Initializes the model: fetches initial session info and starts listening to events.
|
|
32
|
+
* Call this once after construction.
|
|
33
|
+
*/
|
|
34
|
+
initialize(): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Get a screenshot for a fixture in a session, using cache when available.
|
|
37
|
+
* Cache is keyed on sessionName + fixtureId and invalidated when sourceTreeId changes.
|
|
38
|
+
*/
|
|
39
|
+
getScreenshot(sessionName: string, fixtureId: string): Promise<DaemonScreenshotResult>;
|
|
40
|
+
/**
|
|
41
|
+
* Compare a fixture across two sessions. Returns match status and hashes (no images).
|
|
42
|
+
*/
|
|
43
|
+
compare(fixtureId: string, baselineSessionName: string, currentSessionName: string): Promise<DaemonCompareResult>;
|
|
44
|
+
/**
|
|
45
|
+
* List fixtures from a session.
|
|
46
|
+
*/
|
|
47
|
+
listFixtures(sessionName: string): Promise<readonly DaemonFixtureInfo[]>;
|
|
48
|
+
/**
|
|
49
|
+
* Get the explorer URL for a different session (for session switching via full navigation).
|
|
50
|
+
*/
|
|
51
|
+
getSessionExplorerUrl(sessionName: string): string | undefined;
|
|
52
|
+
dispose(): void;
|
|
53
|
+
private _fetchSessionInfos;
|
|
54
|
+
private _startEventStream;
|
|
55
|
+
private _handleEvent;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=DaemonModel.d.ts.map
|
|
@@ -0,0 +1 @@
|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E,YAAY;IAKzC;;;OAGG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAKjC;;;OAGG;IACG,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAuB5F;;OAEG;IACG,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAgBvH;;OAEG;IACG,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,iBAAiB,EAAE,CAAC;IAQ9E;;OAEG;IACH,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAM9D,OAAO,IAAI,IAAI;YASD,kBAAkB;YAYlB,iBAAiB;IAuB/B,OAAO,CAAC,YAAY;CAepB"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { DaemonModel } from './DaemonModel.js';
|
|
2
|
+
export type { DaemonScreenshotResult, DaemonCompareResult, DaemonFixtureInfo } from './DaemonModel.js';
|
|
3
|
+
export { getDaemonConfig } from './DaemonConfig.js';
|
|
4
|
+
export type { DaemonConfig } from './DaemonConfig.js';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/daemon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,YAAY,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACvG,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,31 +1,11 @@
|
|
|
1
|
-
export * from './core/index.js';
|
|
2
|
-
export { Explorer, ExplorerWithDefaults, ExplorerModel } from './components/index.js';
|
|
3
|
-
export type { ExplorerTreeNode } from './components/index.js';
|
|
4
|
-
export { toExplorerTree } from './components/index.js';
|
|
5
|
-
export { TitleBar, TitleBarButton, LeftSidebar, RightSidebar, TreeView, TreeItem, } from './components/index.js';
|
|
6
|
-
export * from './components/icons.js';
|
|
7
|
-
export { styles, mergeStyles } from './components/index.js';
|
|
8
|
-
export interface FixtureModules {
|
|
9
|
-
[path: string]: {
|
|
10
|
-
default?: unknown;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
1
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
2
|
+
* @vscode/component-explorer
|
|
3
|
+
*
|
|
4
|
+
* This is the public API for defining fixtures.
|
|
5
|
+
* Projects import from this module to define their fixtures.
|
|
6
|
+
*
|
|
7
|
+
* For the viewer/explorer UI, import from '@vscode/component-explorer/viewer' instead.
|
|
16
8
|
*/
|
|
17
|
-
export
|
|
18
|
-
|
|
19
|
-
private readonly _registry;
|
|
20
|
-
constructor(element: HTMLElement, fixtureModules: FixtureModules);
|
|
21
|
-
private _populateRegistry;
|
|
22
|
-
/**
|
|
23
|
-
* Updates the fixtures. The UI will update automatically since the registry is observable.
|
|
24
|
-
*/
|
|
25
|
-
updateFixtures(fixtureModules: FixtureModules): void;
|
|
26
|
-
/**
|
|
27
|
-
* Unmounts the explorer and cleans up resources.
|
|
28
|
-
*/
|
|
29
|
-
dispose(): void;
|
|
30
|
-
}
|
|
9
|
+
export { defineFixture, defineFixtureGroup, defineFixtureVariants, singleFixtureBrand, fixtureGroupBrand, fixtureVariantsBrand, } from './core/fixtureApi.js';
|
|
10
|
+
export type { DefineFixtureOptions, DefineComponentOptions, FixtureExport, SingleFixtureExport, FixtureGroupExport, FixtureVariantsExport, FixtureGroupEntry, FixtureGroupInput, FixtureVariantsInput, IDisposable, Disposable, StyleDefinition, DisplayMode, PageMode, ComponentMode, ViewportPreset, ViewportPresetName, PropertySchema, BooleanProperty, StringProperty, NumberProperty, EnumProperty, } from './core/fixtureApi.js';
|
|
31
11
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAEL,aAAa,EACb,kBAAkB,EAClB,qBAAqB,EAGrB,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAG9B,YAAY,EAEV,oBAAoB,EACpB,sBAAsB,EAGtB,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EAGpB,WAAW,EACX,UAAU,EACV,eAAe,EACf,WAAW,EACX,QAAQ,EACR,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,cAAc,EACd,cAAc,EACd,YAAY,GACb,MAAM,sBAAsB,CAAC"}
|