storybook 9.0.0-alpha.2 → 9.0.0-alpha.4
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 +1 -1
- package/dist/actions/decorator.d.ts +6 -0
- package/dist/actions/decorator.js +139 -0
- package/dist/actions/index.cjs +127 -0
- package/dist/actions/index.d.ts +105 -0
- package/dist/actions/index.js +112 -0
- package/dist/actions/manager.js +1196 -0
- package/dist/actions/preview.cjs +165 -0
- package/dist/actions/preview.d.ts +55 -0
- package/dist/actions/preview.js +156 -0
- package/dist/bin/index.cjs +63 -65
- package/dist/bin/index.js +63 -65
- package/dist/channels/index.cjs +209 -234
- package/dist/channels/index.js +304 -308
- package/dist/cli/bin/index.cjs +409 -409
- package/dist/cli/bin/index.js +414 -414
- package/dist/cli/index.cjs +1 -1
- package/dist/cli/index.d.ts +2 -2
- package/dist/cli/index.js +1 -1
- package/dist/client-logger/index.cjs +56 -88
- package/dist/client-logger/index.js +41 -47
- package/dist/common/index.cjs +148 -148
- package/dist/common/index.d.ts +1 -5
- package/dist/common/index.js +171 -171
- package/dist/components/index.cjs +9413 -11578
- package/dist/components/index.d.ts +92 -92
- package/dist/components/index.js +6768 -7544
- package/dist/core-events/index.d.ts +138 -25
- package/dist/core-server/index.cjs +5244 -5270
- package/dist/core-server/index.d.ts +1 -1
- package/dist/core-server/index.js +5356 -5380
- package/dist/core-server/presets/common-manager.js +11 -19
- package/dist/core-server/presets/common-preset.cjs +243 -242
- package/dist/core-server/presets/common-preset.js +379 -378
- package/dist/csf/index.cjs +76 -120
- package/dist/csf/index.d.ts +1 -3
- package/dist/csf/index.js +69 -113
- package/dist/docs-tools/index.cjs +1 -1
- package/dist/docs-tools/index.d.ts +2 -2
- package/dist/docs-tools/index.js +1 -1
- package/dist/instrumenter/index.cjs +1260 -1289
- package/dist/instrumenter/index.js +1344 -1348
- package/dist/manager/globals-module-info.cjs +272 -135
- package/dist/manager/globals-module-info.d.ts +1 -1
- package/dist/manager/globals-module-info.js +257 -120
- package/dist/manager/globals-runtime.js +59553 -22373
- package/dist/manager/globals.cjs +23 -19
- package/dist/manager/globals.d.ts +8 -5
- package/dist/manager/globals.js +10 -6
- package/dist/manager/runtime.js +129 -129
- package/dist/manager-api/index.cjs +1184 -1209
- package/dist/manager-api/index.d.ts +3 -3
- package/dist/manager-api/index.js +1012 -1012
- package/dist/preview/globals.cjs +21 -17
- package/dist/preview/globals.d.ts +4 -1
- package/dist/preview/globals.js +6 -2
- package/dist/preview/runtime.js +43946 -6548
- package/dist/preview-api/index.cjs +1245 -1243
- package/dist/preview-api/index.d.ts +105 -61
- package/dist/preview-api/index.js +1311 -1273
- package/dist/preview-errors.cjs +1 -1
- package/dist/preview-errors.js +1 -1
- package/dist/router/index.cjs +847 -871
- package/dist/router/index.js +193 -199
- package/dist/test/index.cjs +34778 -0
- package/dist/test/index.d.ts +186 -0
- package/dist/test/index.js +32916 -0
- package/dist/test/preview.cjs +15870 -0
- package/dist/test/preview.d.ts +54 -0
- package/dist/test/preview.js +14441 -0
- package/dist/test/spy.cjs +258 -0
- package/dist/test/spy.d.ts +66 -0
- package/dist/test/spy.js +240 -0
- package/dist/theming/create.cjs +79 -2269
- package/dist/theming/create.js +67 -841
- package/dist/theming/index.cjs +1065 -3232
- package/dist/theming/index.js +951 -1719
- package/dist/types/index.d.ts +242 -242
- package/package.json +155 -3
package/dist/types/index.d.ts
CHANGED
|
@@ -1,250 +1,12 @@
|
|
|
1
|
-
import { StoryId, StoryName, ComponentTitle, Tag as Tag$1, Parameters, Args, ArgTypes, ComponentId, StoryKind, Globals, GlobalTypes, InputType, StoryContext, PartialStoryFn, LegacyStoryFn, ArgsStoryFn, StoryFn, DecoratorFunction, LoaderFunction, Renderer as Renderer$1, ViewMode as ViewMode$1, StoryIdentifier, ProjectAnnotations as ProjectAnnotations$
|
|
1
|
+
import { StoryId, StoryName, ComponentTitle, Tag as Tag$1, Parameters, Args, ArgTypes, ComponentId, StoryKind, Globals, GlobalTypes, InputType, StoryContext, PartialStoryFn, LegacyStoryFn, ArgsStoryFn, StoryFn, DecoratorFunction, LoaderFunction, Renderer as Renderer$1, ViewMode as ViewMode$1, StoryIdentifier, ProjectAnnotations as ProjectAnnotations$1, StrictArgTypes, StrictGlobalTypes, StepRunner, BeforeAll, ComponentAnnotations, StoryAnnotations, StoryContextForEnhancers, CleanupCallback, Canvas, StoryAnnotationsOrFn, AnnotatedStoryFn } from 'storybook/internal/csf';
|
|
2
2
|
export { AfterEach, AnnotatedStoryFn, ArgTypes, ArgTypesEnhancer, Args, ArgsEnhancer, ArgsFromMeta, ArgsStoryFn, BaseAnnotations, ProjectAnnotations as BaseProjectAnnotations, BeforeAll, BeforeEach, Canvas, CleanupCallback, ComponentAnnotations, ComponentId, ComponentTitle, Conditional, DecoratorApplicator, DecoratorFunction, GlobalTypes, Globals, IncludeExcludeOptions, InputType, LegacyAnnotatedStoryFn, LegacyStoryAnnotationsOrFn, LegacyStoryFn, LoaderFunction, Parameters, PartialStoryFn, PlayFunction, PlayFunctionContext, SBArrayType, SBEnumType, SBIntersectionType, SBObjectType, SBOtherType, SBScalarType, SBType, SBUnionType, SeparatorOptions, StepFunction, StepLabel, StepRunner, StoryAnnotations, StoryAnnotationsOrFn, StoryContext, StoryContextForEnhancers, StoryContextForLoaders, StoryContextUpdate, StoryFn, StoryId, StoryIdentifier, StoryKind, StoryName, StrictArgTypes, StrictArgs, StrictGlobalTypes, StrictInputType, Tag } from 'storybook/internal/csf';
|
|
3
3
|
import { ReactElement, FC, ReactNode, PropsWithChildren } from 'react';
|
|
4
|
-
import { Addon_TestProviderType as Addon_TestProviderType$1, NormalizedProjectAnnotations as NormalizedProjectAnnotations$1, ProjectAnnotations as ProjectAnnotations$
|
|
4
|
+
import { Addon_TestProviderType as Addon_TestProviderType$1, NormalizedProjectAnnotations as NormalizedProjectAnnotations$1, ProjectAnnotations as ProjectAnnotations$2, ComposedStoryFn as ComposedStoryFn$1 } from 'storybook/internal/types';
|
|
5
5
|
import { FileSystemCache } from 'storybook/internal/common';
|
|
6
6
|
import { Server, IncomingMessage, ServerResponse } from 'http';
|
|
7
7
|
import { Server as Server$1 } from 'net';
|
|
8
8
|
import { Channel as Channel$1 } from 'storybook/internal/channels';
|
|
9
9
|
|
|
10
|
-
type DateNow = number;
|
|
11
|
-
type TestProviderConfig = Addon_TestProviderType$1;
|
|
12
|
-
type TestingModuleProgressReportProgress = {
|
|
13
|
-
startedAt: DateNow;
|
|
14
|
-
finishedAt?: DateNow;
|
|
15
|
-
numTotalTests?: number;
|
|
16
|
-
numPassedTests?: number;
|
|
17
|
-
numFailedTests?: number;
|
|
18
|
-
numPendingTests?: number;
|
|
19
|
-
percentageCompleted?: number;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
declare global {
|
|
23
|
-
var globalProjectAnnotations: NormalizedProjectAnnotations$1<any>;
|
|
24
|
-
var defaultProjectAnnotations: ProjectAnnotations$1<any>;
|
|
25
|
-
}
|
|
26
|
-
type WrappedStoryRef = {
|
|
27
|
-
__pw_type: 'jsx' | 'importRef';
|
|
28
|
-
};
|
|
29
|
-
type UnwrappedJSXStoryRef = {
|
|
30
|
-
__pw_type: 'jsx';
|
|
31
|
-
type: UnwrappedImportStoryRef;
|
|
32
|
-
};
|
|
33
|
-
type UnwrappedImportStoryRef = ComposedStoryFn$1;
|
|
34
|
-
declare global {
|
|
35
|
-
function __pwUnwrapObject(storyRef: WrappedStoryRef): Promise<UnwrappedJSXStoryRef | UnwrappedImportStoryRef>;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
interface Report<T = unknown> {
|
|
39
|
-
type: string;
|
|
40
|
-
version?: number;
|
|
41
|
-
result: T;
|
|
42
|
-
status: 'failed' | 'passed' | 'warning';
|
|
43
|
-
}
|
|
44
|
-
declare class ReporterAPI {
|
|
45
|
-
reports: Report[];
|
|
46
|
-
addReport(report: Report): Promise<void>;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* A URL pathname, beginning with a /.
|
|
51
|
-
*
|
|
52
|
-
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location.pathname
|
|
53
|
-
*/
|
|
54
|
-
declare type Pathname = string;
|
|
55
|
-
/**
|
|
56
|
-
* A URL search string, beginning with a ?.
|
|
57
|
-
*
|
|
58
|
-
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location.search
|
|
59
|
-
*/
|
|
60
|
-
declare type Search = string;
|
|
61
|
-
/**
|
|
62
|
-
* A URL fragment identifier, beginning with a #.
|
|
63
|
-
*
|
|
64
|
-
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location.hash
|
|
65
|
-
*/
|
|
66
|
-
declare type Hash = string;
|
|
67
|
-
/**
|
|
68
|
-
* A unique string associated with a location. May be used to safely store
|
|
69
|
-
* and retrieve data in some other storage API, like `localStorage`.
|
|
70
|
-
*
|
|
71
|
-
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location.key
|
|
72
|
-
*/
|
|
73
|
-
declare type Key = string;
|
|
74
|
-
/**
|
|
75
|
-
* The pathname, search, and hash values of a URL.
|
|
76
|
-
*/
|
|
77
|
-
interface Path$1 {
|
|
78
|
-
/**
|
|
79
|
-
* A URL pathname, beginning with a /.
|
|
80
|
-
*
|
|
81
|
-
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location.pathname
|
|
82
|
-
*/
|
|
83
|
-
pathname: Pathname;
|
|
84
|
-
/**
|
|
85
|
-
* A URL search string, beginning with a ?.
|
|
86
|
-
*
|
|
87
|
-
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location.search
|
|
88
|
-
*/
|
|
89
|
-
search: Search;
|
|
90
|
-
/**
|
|
91
|
-
* A URL fragment identifier, beginning with a #.
|
|
92
|
-
*
|
|
93
|
-
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location.hash
|
|
94
|
-
*/
|
|
95
|
-
hash: Hash;
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* An entry in a history stack. A location contains information about the
|
|
99
|
-
* URL path, as well as possibly some arbitrary state and a key.
|
|
100
|
-
*
|
|
101
|
-
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location
|
|
102
|
-
*/
|
|
103
|
-
interface Location extends Path$1 {
|
|
104
|
-
/**
|
|
105
|
-
* A value of arbitrary data associated with this location.
|
|
106
|
-
*
|
|
107
|
-
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location.state
|
|
108
|
-
*/
|
|
109
|
-
state: unknown;
|
|
110
|
-
/**
|
|
111
|
-
* A unique string associated with this location. May be used to safely store
|
|
112
|
-
* and retrieve data in some other storage API, like `localStorage`.
|
|
113
|
-
*
|
|
114
|
-
* Note: This value is always "default" on the initial location.
|
|
115
|
-
*
|
|
116
|
-
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location.key
|
|
117
|
-
*/
|
|
118
|
-
key: Key;
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Describes a location that is the destination of some navigation, either via
|
|
122
|
-
* `history.push` or `history.replace`. May be either a URL or the pieces of a
|
|
123
|
-
* URL path.
|
|
124
|
-
*/
|
|
125
|
-
declare type To = string | Partial<Path$1>;
|
|
126
|
-
|
|
127
|
-
interface NavigateOptions$1 {
|
|
128
|
-
replace?: boolean;
|
|
129
|
-
state?: any;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
interface StoryData {
|
|
133
|
-
viewMode?: string;
|
|
134
|
-
storyId?: string;
|
|
135
|
-
refId?: string;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
interface Other extends StoryData {
|
|
139
|
-
path: string;
|
|
140
|
-
singleStory?: boolean;
|
|
141
|
-
}
|
|
142
|
-
type NavigateOptions = NavigateOptions$1 & {
|
|
143
|
-
plain?: boolean;
|
|
144
|
-
};
|
|
145
|
-
type NavigateFunction = (to: To | number, options?: NavigateOptions) => void;
|
|
146
|
-
type RouterData = {
|
|
147
|
-
location: Partial<Location>;
|
|
148
|
-
navigate: NavigateFunction;
|
|
149
|
-
} & Other;
|
|
150
|
-
type RenderData = Pick<RouterData, 'location'> & Other;
|
|
151
|
-
|
|
152
|
-
interface ThemeVars extends ThemeVarsBase, ThemeVarsColors {
|
|
153
|
-
}
|
|
154
|
-
interface ThemeVarsBase {
|
|
155
|
-
base: 'light' | 'dark';
|
|
156
|
-
}
|
|
157
|
-
interface ThemeVarsColors {
|
|
158
|
-
colorPrimary: string;
|
|
159
|
-
colorSecondary: string;
|
|
160
|
-
appBg: string;
|
|
161
|
-
appContentBg: string;
|
|
162
|
-
appPreviewBg: string;
|
|
163
|
-
appBorderColor: string;
|
|
164
|
-
appBorderRadius: number;
|
|
165
|
-
fontBase: string;
|
|
166
|
-
fontCode: string;
|
|
167
|
-
textColor: string;
|
|
168
|
-
textInverseColor: string;
|
|
169
|
-
textMutedColor: string;
|
|
170
|
-
barTextColor: string;
|
|
171
|
-
barHoverColor: string;
|
|
172
|
-
barSelectedColor: string;
|
|
173
|
-
barBg: string;
|
|
174
|
-
buttonBg: string;
|
|
175
|
-
buttonBorder: string;
|
|
176
|
-
booleanBg: string;
|
|
177
|
-
booleanSelectedBg: string;
|
|
178
|
-
inputBg: string;
|
|
179
|
-
inputBorder: string;
|
|
180
|
-
inputTextColor: string;
|
|
181
|
-
inputBorderRadius: number;
|
|
182
|
-
brandTitle?: string;
|
|
183
|
-
brandUrl?: string;
|
|
184
|
-
brandImage?: string;
|
|
185
|
-
brandTarget?: string;
|
|
186
|
-
gridCellSize?: number;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
type ChannelHandler = (event: ChannelEvent) => void;
|
|
190
|
-
interface ChannelTransport {
|
|
191
|
-
send(event: ChannelEvent, options?: any): void;
|
|
192
|
-
setHandler(handler: ChannelHandler): void;
|
|
193
|
-
}
|
|
194
|
-
interface ChannelEvent {
|
|
195
|
-
type: string;
|
|
196
|
-
from: string;
|
|
197
|
-
args: any[];
|
|
198
|
-
}
|
|
199
|
-
interface Listener {
|
|
200
|
-
(...args: any[]): void;
|
|
201
|
-
}
|
|
202
|
-
interface ChannelArgsSingle {
|
|
203
|
-
transport?: ChannelTransport;
|
|
204
|
-
async?: boolean;
|
|
205
|
-
}
|
|
206
|
-
interface ChannelArgsMulti {
|
|
207
|
-
transports: ChannelTransport[];
|
|
208
|
-
async?: boolean;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
declare class Channel {
|
|
212
|
-
readonly isAsync: boolean;
|
|
213
|
-
private sender;
|
|
214
|
-
private events;
|
|
215
|
-
private data;
|
|
216
|
-
private readonly transports;
|
|
217
|
-
constructor(input: ChannelArgsMulti);
|
|
218
|
-
constructor(input: ChannelArgsSingle);
|
|
219
|
-
get hasTransport(): boolean;
|
|
220
|
-
addListener(eventName: string, listener: Listener): void;
|
|
221
|
-
emit(eventName: string, ...args: any): void;
|
|
222
|
-
last(eventName: string): any;
|
|
223
|
-
eventNames(): string[];
|
|
224
|
-
listenerCount(eventName: string): number;
|
|
225
|
-
listeners(eventName: string): Listener[] | undefined;
|
|
226
|
-
once(eventName: string, listener: Listener): void;
|
|
227
|
-
removeAllListeners(eventName?: string): void;
|
|
228
|
-
removeListener(eventName: string, listener: Listener): void;
|
|
229
|
-
on(eventName: string, listener: Listener): void;
|
|
230
|
-
off(eventName: string, listener: Listener): void;
|
|
231
|
-
private handleEvent;
|
|
232
|
-
private onceListener;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
interface Options$1 {
|
|
236
|
-
allowRegExp: boolean;
|
|
237
|
-
allowFunction: boolean;
|
|
238
|
-
allowSymbol: boolean;
|
|
239
|
-
allowDate: boolean;
|
|
240
|
-
allowUndefined: boolean;
|
|
241
|
-
allowClass: boolean;
|
|
242
|
-
allowError: boolean;
|
|
243
|
-
maxDepth: number;
|
|
244
|
-
space: number | undefined;
|
|
245
|
-
lazyEval: boolean;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
10
|
/**
|
|
249
11
|
Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
|
|
250
12
|
|
|
@@ -961,6 +723,217 @@ PackageJson$1.TypeScriptConfiguration &
|
|
|
961
723
|
PackageJson$1.YarnConfiguration &
|
|
962
724
|
PackageJson$1.JSPMConfiguration;
|
|
963
725
|
|
|
726
|
+
type DateNow = number;
|
|
727
|
+
type TestProviderConfig = Addon_TestProviderType$1;
|
|
728
|
+
type TestingModuleProgressReportProgress = {
|
|
729
|
+
startedAt: DateNow;
|
|
730
|
+
finishedAt?: DateNow;
|
|
731
|
+
numTotalTests?: number;
|
|
732
|
+
numPassedTests?: number;
|
|
733
|
+
numFailedTests?: number;
|
|
734
|
+
numPendingTests?: number;
|
|
735
|
+
percentageCompleted?: number;
|
|
736
|
+
};
|
|
737
|
+
|
|
738
|
+
/**
|
|
739
|
+
* A URL pathname, beginning with a /.
|
|
740
|
+
*
|
|
741
|
+
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location.pathname
|
|
742
|
+
*/
|
|
743
|
+
declare type Pathname = string;
|
|
744
|
+
/**
|
|
745
|
+
* A URL search string, beginning with a ?.
|
|
746
|
+
*
|
|
747
|
+
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location.search
|
|
748
|
+
*/
|
|
749
|
+
declare type Search = string;
|
|
750
|
+
/**
|
|
751
|
+
* A URL fragment identifier, beginning with a #.
|
|
752
|
+
*
|
|
753
|
+
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location.hash
|
|
754
|
+
*/
|
|
755
|
+
declare type Hash = string;
|
|
756
|
+
/**
|
|
757
|
+
* A unique string associated with a location. May be used to safely store
|
|
758
|
+
* and retrieve data in some other storage API, like `localStorage`.
|
|
759
|
+
*
|
|
760
|
+
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location.key
|
|
761
|
+
*/
|
|
762
|
+
declare type Key = string;
|
|
763
|
+
/**
|
|
764
|
+
* The pathname, search, and hash values of a URL.
|
|
765
|
+
*/
|
|
766
|
+
interface Path$1 {
|
|
767
|
+
/**
|
|
768
|
+
* A URL pathname, beginning with a /.
|
|
769
|
+
*
|
|
770
|
+
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location.pathname
|
|
771
|
+
*/
|
|
772
|
+
pathname: Pathname;
|
|
773
|
+
/**
|
|
774
|
+
* A URL search string, beginning with a ?.
|
|
775
|
+
*
|
|
776
|
+
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location.search
|
|
777
|
+
*/
|
|
778
|
+
search: Search;
|
|
779
|
+
/**
|
|
780
|
+
* A URL fragment identifier, beginning with a #.
|
|
781
|
+
*
|
|
782
|
+
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location.hash
|
|
783
|
+
*/
|
|
784
|
+
hash: Hash;
|
|
785
|
+
}
|
|
786
|
+
/**
|
|
787
|
+
* An entry in a history stack. A location contains information about the
|
|
788
|
+
* URL path, as well as possibly some arbitrary state and a key.
|
|
789
|
+
*
|
|
790
|
+
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location
|
|
791
|
+
*/
|
|
792
|
+
interface Location extends Path$1 {
|
|
793
|
+
/**
|
|
794
|
+
* A value of arbitrary data associated with this location.
|
|
795
|
+
*
|
|
796
|
+
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location.state
|
|
797
|
+
*/
|
|
798
|
+
state: unknown;
|
|
799
|
+
/**
|
|
800
|
+
* A unique string associated with this location. May be used to safely store
|
|
801
|
+
* and retrieve data in some other storage API, like `localStorage`.
|
|
802
|
+
*
|
|
803
|
+
* Note: This value is always "default" on the initial location.
|
|
804
|
+
*
|
|
805
|
+
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location.key
|
|
806
|
+
*/
|
|
807
|
+
key: Key;
|
|
808
|
+
}
|
|
809
|
+
/**
|
|
810
|
+
* Describes a location that is the destination of some navigation, either via
|
|
811
|
+
* `history.push` or `history.replace`. May be either a URL or the pieces of a
|
|
812
|
+
* URL path.
|
|
813
|
+
*/
|
|
814
|
+
declare type To = string | Partial<Path$1>;
|
|
815
|
+
|
|
816
|
+
interface NavigateOptions$1 {
|
|
817
|
+
replace?: boolean;
|
|
818
|
+
state?: any;
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
interface StoryData {
|
|
822
|
+
viewMode?: string;
|
|
823
|
+
storyId?: string;
|
|
824
|
+
refId?: string;
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
interface Other extends StoryData {
|
|
828
|
+
path: string;
|
|
829
|
+
singleStory?: boolean;
|
|
830
|
+
}
|
|
831
|
+
type NavigateOptions = NavigateOptions$1 & {
|
|
832
|
+
plain?: boolean;
|
|
833
|
+
};
|
|
834
|
+
type NavigateFunction = (to: To | number, options?: NavigateOptions) => void;
|
|
835
|
+
type RouterData = {
|
|
836
|
+
location: Partial<Location>;
|
|
837
|
+
navigate: NavigateFunction;
|
|
838
|
+
} & Other;
|
|
839
|
+
type RenderData = Pick<RouterData, 'location'> & Other;
|
|
840
|
+
|
|
841
|
+
interface ThemeVars extends ThemeVarsBase, ThemeVarsColors {
|
|
842
|
+
}
|
|
843
|
+
interface ThemeVarsBase {
|
|
844
|
+
base: 'light' | 'dark';
|
|
845
|
+
}
|
|
846
|
+
interface ThemeVarsColors {
|
|
847
|
+
colorPrimary: string;
|
|
848
|
+
colorSecondary: string;
|
|
849
|
+
appBg: string;
|
|
850
|
+
appContentBg: string;
|
|
851
|
+
appPreviewBg: string;
|
|
852
|
+
appBorderColor: string;
|
|
853
|
+
appBorderRadius: number;
|
|
854
|
+
fontBase: string;
|
|
855
|
+
fontCode: string;
|
|
856
|
+
textColor: string;
|
|
857
|
+
textInverseColor: string;
|
|
858
|
+
textMutedColor: string;
|
|
859
|
+
barTextColor: string;
|
|
860
|
+
barHoverColor: string;
|
|
861
|
+
barSelectedColor: string;
|
|
862
|
+
barBg: string;
|
|
863
|
+
buttonBg: string;
|
|
864
|
+
buttonBorder: string;
|
|
865
|
+
booleanBg: string;
|
|
866
|
+
booleanSelectedBg: string;
|
|
867
|
+
inputBg: string;
|
|
868
|
+
inputBorder: string;
|
|
869
|
+
inputTextColor: string;
|
|
870
|
+
inputBorderRadius: number;
|
|
871
|
+
brandTitle?: string;
|
|
872
|
+
brandUrl?: string;
|
|
873
|
+
brandImage?: string;
|
|
874
|
+
brandTarget?: string;
|
|
875
|
+
gridCellSize?: number;
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
type ChannelHandler = (event: ChannelEvent) => void;
|
|
879
|
+
interface ChannelTransport {
|
|
880
|
+
send(event: ChannelEvent, options?: any): void;
|
|
881
|
+
setHandler(handler: ChannelHandler): void;
|
|
882
|
+
}
|
|
883
|
+
interface ChannelEvent {
|
|
884
|
+
type: string;
|
|
885
|
+
from: string;
|
|
886
|
+
args: any[];
|
|
887
|
+
}
|
|
888
|
+
interface Listener {
|
|
889
|
+
(...args: any[]): void;
|
|
890
|
+
}
|
|
891
|
+
interface ChannelArgsSingle {
|
|
892
|
+
transport?: ChannelTransport;
|
|
893
|
+
async?: boolean;
|
|
894
|
+
}
|
|
895
|
+
interface ChannelArgsMulti {
|
|
896
|
+
transports: ChannelTransport[];
|
|
897
|
+
async?: boolean;
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
declare class Channel {
|
|
901
|
+
readonly isAsync: boolean;
|
|
902
|
+
private sender;
|
|
903
|
+
private events;
|
|
904
|
+
private data;
|
|
905
|
+
private readonly transports;
|
|
906
|
+
constructor(input: ChannelArgsMulti);
|
|
907
|
+
constructor(input: ChannelArgsSingle);
|
|
908
|
+
get hasTransport(): boolean;
|
|
909
|
+
addListener(eventName: string, listener: Listener): void;
|
|
910
|
+
emit(eventName: string, ...args: any): void;
|
|
911
|
+
last(eventName: string): any;
|
|
912
|
+
eventNames(): string[];
|
|
913
|
+
listenerCount(eventName: string): number;
|
|
914
|
+
listeners(eventName: string): Listener[] | undefined;
|
|
915
|
+
once(eventName: string, listener: Listener): void;
|
|
916
|
+
removeAllListeners(eventName?: string): void;
|
|
917
|
+
removeListener(eventName: string, listener: Listener): void;
|
|
918
|
+
on(eventName: string, listener: Listener): void;
|
|
919
|
+
off(eventName: string, listener: Listener): void;
|
|
920
|
+
private handleEvent;
|
|
921
|
+
private onceListener;
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
interface Options$1 {
|
|
925
|
+
allowRegExp: boolean;
|
|
926
|
+
allowFunction: boolean;
|
|
927
|
+
allowSymbol: boolean;
|
|
928
|
+
allowDate: boolean;
|
|
929
|
+
allowUndefined: boolean;
|
|
930
|
+
allowClass: boolean;
|
|
931
|
+
allowError: boolean;
|
|
932
|
+
maxDepth: number;
|
|
933
|
+
space: number | undefined;
|
|
934
|
+
lazyEval: boolean;
|
|
935
|
+
}
|
|
936
|
+
|
|
964
937
|
type ExportName = string;
|
|
965
938
|
type MetaId = string;
|
|
966
939
|
interface StoriesSpecifier {
|
|
@@ -2340,7 +2313,7 @@ type ModuleImportFn = (path: Path) => Promise<ModuleExports>;
|
|
|
2340
2313
|
type MaybePromise<T> = Promise<T> | T;
|
|
2341
2314
|
type TeardownRenderToCanvas = () => MaybePromise<void>;
|
|
2342
2315
|
type RenderToCanvas<TRenderer extends Renderer> = (context: RenderContext<TRenderer>, element: TRenderer['canvasElement']) => MaybePromise<void | TeardownRenderToCanvas>;
|
|
2343
|
-
interface ProjectAnnotations<TRenderer extends Renderer> extends ProjectAnnotations$
|
|
2316
|
+
interface ProjectAnnotations<TRenderer extends Renderer> extends ProjectAnnotations$1<TRenderer> {
|
|
2344
2317
|
addons?: ProjectAnnotations<TRenderer>[];
|
|
2345
2318
|
testingLibraryRender?: (...args: never[]) => {
|
|
2346
2319
|
unmount: () => void;
|
|
@@ -2493,6 +2466,33 @@ interface DocsContextProps<TRenderer extends Renderer = Renderer> {
|
|
|
2493
2466
|
}
|
|
2494
2467
|
type DocsRenderFunction<TRenderer extends Renderer> = (docsContext: DocsContextProps<TRenderer>, docsParameters: Parameters, element: HTMLElement) => Promise<void>;
|
|
2495
2468
|
|
|
2469
|
+
declare global {
|
|
2470
|
+
var globalProjectAnnotations: NormalizedProjectAnnotations$1<any>;
|
|
2471
|
+
var defaultProjectAnnotations: ProjectAnnotations$2<any>;
|
|
2472
|
+
}
|
|
2473
|
+
type WrappedStoryRef = {
|
|
2474
|
+
__pw_type: 'jsx' | 'importRef';
|
|
2475
|
+
};
|
|
2476
|
+
type UnwrappedJSXStoryRef = {
|
|
2477
|
+
__pw_type: 'jsx';
|
|
2478
|
+
type: UnwrappedImportStoryRef;
|
|
2479
|
+
};
|
|
2480
|
+
type UnwrappedImportStoryRef = ComposedStoryFn$1;
|
|
2481
|
+
declare global {
|
|
2482
|
+
function __pwUnwrapObject(storyRef: WrappedStoryRef): Promise<UnwrappedJSXStoryRef | UnwrappedImportStoryRef>;
|
|
2483
|
+
}
|
|
2484
|
+
|
|
2485
|
+
interface Report<T = unknown> {
|
|
2486
|
+
type: string;
|
|
2487
|
+
version?: number;
|
|
2488
|
+
result: T;
|
|
2489
|
+
status: 'failed' | 'passed' | 'warning';
|
|
2490
|
+
}
|
|
2491
|
+
declare class ReporterAPI {
|
|
2492
|
+
reports: Report[];
|
|
2493
|
+
addReport(report: Report): Promise<void>;
|
|
2494
|
+
}
|
|
2495
|
+
|
|
2496
2496
|
type Store_CSFExports<TRenderer extends Renderer$1 = Renderer$1, TArgs extends Args = Args> = {
|
|
2497
2497
|
default: ComponentAnnotations<TRenderer, TArgs>;
|
|
2498
2498
|
__esModule?: boolean;
|
|
@@ -2531,7 +2531,7 @@ type StoriesWithPartialProps<TRenderer extends Renderer$1, TModule> = {
|
|
|
2531
2531
|
* function
|
|
2532
2532
|
*/
|
|
2533
2533
|
interface ComposeStoryFn<TRenderer extends Renderer$1 = Renderer$1, TArgs extends Args = Args> {
|
|
2534
|
-
(storyAnnotations: AnnotatedStoryFn<TRenderer, TArgs> | StoryAnnotations<TRenderer, TArgs>, componentAnnotations: ComponentAnnotations<TRenderer, TArgs>, projectAnnotations: ProjectAnnotations$
|
|
2534
|
+
(storyAnnotations: AnnotatedStoryFn<TRenderer, TArgs> | StoryAnnotations<TRenderer, TArgs>, componentAnnotations: ComponentAnnotations<TRenderer, TArgs>, projectAnnotations: ProjectAnnotations$1<TRenderer>, exportsName?: string): ComposedStoryFn;
|
|
2535
2535
|
}
|
|
2536
2536
|
|
|
2537
2537
|
type SupportedFrameworks = 'angular' | 'ember' | 'experimental-nextjs-vite' | 'html-vite' | 'html-webpack5' | 'nextjs' | 'preact-vite' | 'preact-webpack5' | 'react-native-web-vite' | 'react-vite' | 'react-webpack5' | 'server-webpack5' | 'svelte-vite' | 'svelte-webpack5' | 'sveltekit' | 'vue3-vite' | 'vue3-webpack5' | 'web-components-vite' | 'web-components-webpack5' | 'qwik' | 'solid' | 'nuxt' | 'react-rsbuild' | 'vue3-rsbuild';
|