storybook 10.2.0-alpha.8 → 10.2.0-beta.0
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/dist/_browser-chunks/{Color-E5XDEOX4.js → Color-XESOIGZP.js} +57 -3
- package/dist/_browser-chunks/chunk-AFVOZMXQ.js +23 -0
- package/dist/_browser-chunks/{chunk-3PJE6VLG.js → chunk-ASKQZAOS.js} +1 -12
- package/dist/_browser-chunks/chunk-IYCKG66Y.js +171 -0
- package/dist/_browser-chunks/chunk-LCHBOIHN.js +64 -0
- package/dist/_browser-chunks/{chunk-IPA5A322.js → chunk-MEXTPDJG.js} +1 -1
- package/dist/_browser-chunks/{chunk-54PNNATT.js → chunk-NQJGOFZV.js} +18 -1
- package/dist/_browser-chunks/{chunk-VUZYLZ4B.js → chunk-QOXZ7W26.js} +31 -15
- package/dist/_browser-chunks/{chunk-LOTN4ZCW.js → chunk-SI6AKD4S.js} +2 -2
- package/dist/_browser-chunks/chunk-YK43Z22A.js +263 -0
- package/dist/_node-chunks/{builder-manager-2XASU3VS.js → builder-manager-JEJE63VV.js} +15 -12
- package/dist/_node-chunks/camelcase-HALRJETF.js +62 -0
- package/dist/_node-chunks/{chunk-5GRHJJHD.js → chunk-3SKE4CCB.js} +9 -9
- package/dist/_node-chunks/chunk-4UYAC7Y2.js +18 -0
- package/dist/_node-chunks/{chunk-S7FIFCTX.js → chunk-6UAQEBJX.js} +10 -10
- package/dist/_node-chunks/{chunk-ZKB7MQRR.js → chunk-72K4WVI5.js} +18 -14
- package/dist/_node-chunks/{chunk-6TJUL42C.js → chunk-7ZX5CX6B.js} +15 -69
- package/dist/_node-chunks/{chunk-LEZENLG7.js → chunk-ADTWC7QJ.js} +7 -7
- package/dist/_node-chunks/{chunk-2OC7H5MZ.js → chunk-APUXGW3Y.js} +7 -7
- package/dist/_node-chunks/{chunk-5WQXPM6D.js → chunk-AXDM43NU.js} +6 -6
- package/dist/_node-chunks/{chunk-LOXLI4XT.js → chunk-B422K4XV.js} +6 -6
- package/dist/_node-chunks/{chunk-3K6P75SS.js → chunk-BJOXVTWM.js} +12 -571
- package/dist/_node-chunks/{chunk-TTGXODEY.js → chunk-BLGRU6F5.js} +7 -7
- package/dist/_node-chunks/{chunk-2KSITKBI.js → chunk-CG47ALAV.js} +7 -7
- package/dist/_node-chunks/chunk-FH4FRUMP.js +23 -0
- package/dist/_node-chunks/{chunk-DTM4A3DJ.js → chunk-GBZ23FIZ.js} +125 -73
- package/dist/_node-chunks/{chunk-IJ34563N.js → chunk-IZ3ATSWZ.js} +5262 -1480
- package/dist/_node-chunks/{chunk-JWL5NLJU.js → chunk-IZFEBWVB.js} +6 -6
- package/dist/_node-chunks/{chunk-5BRYY6XB.js → chunk-KL5CKFPT.js} +9 -9
- package/dist/_node-chunks/{chunk-COGO4JMD.js → chunk-MLXCYULR.js} +7 -7
- package/dist/_node-chunks/{chunk-7B4JYHGV.js → chunk-MV2QM7P3.js} +6 -6
- package/dist/_node-chunks/chunk-PHX5XNP7.js +144 -0
- package/dist/_node-chunks/{chunk-VJFHZL2T.js → chunk-QL6L57W7.js} +533 -144
- package/dist/_node-chunks/{chunk-Q6WPGVIW.js → chunk-RPBXVPRB.js} +6 -6
- package/dist/_node-chunks/{chunk-DYQ6QR45.js → chunk-UH2GWMFP.js} +260 -162
- package/dist/_node-chunks/chunk-WNGL2VRJ.js +126 -0
- package/dist/_node-chunks/{chunk-WKC523P7.js → chunk-XAL452XB.js} +36 -14
- package/dist/_node-chunks/{chunk-UNHOAAXU.js → chunk-YVXXMWQO.js} +7 -7
- package/dist/_node-chunks/chunk-YYDL7JOC.js +61 -0
- package/dist/_node-chunks/{chunk-MLYPMYG5.js → chunk-Z7FLE2TR.js} +6 -6
- package/dist/_node-chunks/{globby-FWMT4OOQ.js → globby-4D4NBVG7.js} +11 -20
- package/dist/_node-chunks/{lib-YCGXIMW5.js → lib-RM2DWHZQ.js} +7 -7
- package/dist/_node-chunks/{mdx-N42X6CFJ-CRGM5LTU.js → mdx-N42X6CFJ-RAL72UTP.js} +8 -8
- package/dist/_node-chunks/{p-limit-UJIYI4QT.js → p-limit-6PUJQL5X.js} +18 -14
- package/dist/babel/index.js +10 -10
- package/dist/bin/core.js +12 -12
- package/dist/bin/dispatcher.js +11 -11
- package/dist/bin/loader.js +9 -9
- package/dist/cli/index.d.ts +1504 -424
- package/dist/cli/index.js +18 -18
- package/dist/common/index.d.ts +1319 -271
- package/dist/common/index.js +22 -22
- package/dist/components/index.d.ts +4 -1
- package/dist/components/index.js +228 -227
- package/dist/core-events/index.d.ts +23 -7
- package/dist/core-events/index.js +5 -1
- package/dist/core-server/index.d.ts +108 -4
- package/dist/core-server/index.js +3459 -3086
- package/dist/core-server/presets/common-manager.js +208 -160
- package/dist/core-server/presets/common-override-preset.js +11 -11
- package/dist/core-server/presets/common-preset.js +576 -4536
- package/dist/csf/index.d.ts +147 -15
- package/dist/csf/index.js +52 -23
- package/dist/csf-tools/index.d.ts +19 -1
- package/dist/csf-tools/index.js +11 -9
- package/dist/docs-tools/index.d.ts +2 -2
- package/dist/docs-tools/index.js +4 -5
- package/dist/manager/globals-runtime.js +2749 -6907
- package/dist/manager/runtime.js +2939 -2295
- package/dist/manager-api/index.d.ts +89 -21
- package/dist/manager-api/index.js +82 -23
- package/dist/mocking-utils/index.js +8 -8
- package/dist/node-logger/index.d.ts +1453 -108
- package/dist/node-logger/index.js +9 -9
- package/dist/preview/runtime.js +784 -5059
- package/dist/preview-api/index.d.ts +26 -1
- package/dist/preview-api/index.js +11 -8
- package/dist/router/index.js +5 -4
- package/dist/server-errors.js +11 -11
- package/dist/telemetry/index.d.ts +14 -2
- package/dist/telemetry/index.js +23 -22
- package/dist/theming/index.d.ts +5 -5
- package/dist/theming/index.js +21 -2
- package/dist/types/index.d.ts +24 -11
- package/dist/viewport/index.d.ts +5 -3
- package/dist/viewport/index.js +12 -3
- package/package.json +27 -26
- package/dist/_browser-chunks/chunk-2NDLAB5X.js +0 -363
- package/dist/_browser-chunks/chunk-CLSHX4VX.js +0 -4140
- package/dist/_browser-chunks/chunk-HPYUT3WS.js +0 -199
- package/dist/_browser-chunks/chunk-XCZK5QUJ.js +0 -0
- package/dist/_node-chunks/camelcase-KIWRHB2G.js +0 -37
- package/dist/_node-chunks/chunk-2ANLCK4Y.js +0 -18
- package/dist/_node-chunks/chunk-3TW66YXG.js +0 -70
- package/dist/_node-chunks/chunk-UFXCGC4W.js +0 -23
- package/dist/_node-chunks/chunk-X4YDIHYE.js +0 -61
- package/dist/_node-chunks/dist-GICI6ZHU.js +0 -121
|
@@ -5,8 +5,8 @@ import { RouterData, NavigateOptions } from 'storybook/internal/router';
|
|
|
5
5
|
import { Addon_Types, Addon_TypesEnum, Addon_Collection, Addon_TypesMapping, Addon_BaseType, Addon_TestProviderType, Addon_PageType, Addon_WrapperType, Addon_Config, API_ProviderData, API_StateMerger, API_Provider, Globals, GlobalTypes, API_PanelPositions, API_Layout, API_LayoutCustomisations, API_UI, API_Notification, API_IframeRenderer, API_ComposedRef, API_SetRefData, API_ComposedRefUpdate, API_Refs, StoryId, API_Settings, API_HashEntry, API_ViewMode, API_LeafEntry, API_PreparedStoryIndex, API_StoryEntry, API_TestEntry, Args, API_IndexHash, API_DocsEntry, API_FilterFunction, API_LoadedRefData, API_Version, API_Versions, API_UnknownEntries, API_OptionsData, Parameters, ArgTypes, NormalizedProjectAnnotations, ProjectAnnotations, ComposedStoryFn } from 'storybook/internal/types';
|
|
6
6
|
export { Addon_Type as Addon, API_ComponentEntry as ComponentEntry, API_ComposedRef as ComposedRef, API_DocsEntry as DocsEntry, API_GroupEntry as GroupEntry, API_HashEntry as HashEntry, API_IndexHash as IndexHash, API_LeafEntry as LeafEntry, API_Refs as Refs, API_RootEntry as RootEntry, API_IndexHash as StoriesHash, API_StoryEntry as StoryEntry } from 'storybook/internal/types';
|
|
7
7
|
import { ThemeVars } from 'storybook/theming';
|
|
8
|
+
import { OpenInEditorResponsePayload, WhatsNewData } from 'storybook/internal/core-events';
|
|
8
9
|
import { toId, StoryId as StoryId$1 } from 'storybook/internal/csf';
|
|
9
|
-
import { WhatsNewData } from 'storybook/internal/core-events';
|
|
10
10
|
|
|
11
11
|
declare function mockChannel(): Channel;
|
|
12
12
|
|
|
@@ -81,7 +81,7 @@ type ModuleArgs = RouterData & API_ProviderData<API> & {
|
|
|
81
81
|
store: Store;
|
|
82
82
|
};
|
|
83
83
|
|
|
84
|
-
interface SubAPI$
|
|
84
|
+
interface SubAPI$d {
|
|
85
85
|
/**
|
|
86
86
|
* Returns a collection of elements of a specific type.
|
|
87
87
|
*
|
|
@@ -128,7 +128,7 @@ interface SubAPI$c {
|
|
|
128
128
|
getAddonState<S>(addonId: string): S;
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
interface SubAPI$
|
|
131
|
+
interface SubAPI$c {
|
|
132
132
|
/**
|
|
133
133
|
* Returns the channel object.
|
|
134
134
|
*
|
|
@@ -177,7 +177,7 @@ interface SubState$9 {
|
|
|
177
177
|
storyGlobals?: Globals;
|
|
178
178
|
globalTypes?: GlobalTypes;
|
|
179
179
|
}
|
|
180
|
-
interface SubAPI$
|
|
180
|
+
interface SubAPI$b {
|
|
181
181
|
/**
|
|
182
182
|
* Returns the current globals, which is the user globals overlaid with the story globals
|
|
183
183
|
*
|
|
@@ -216,7 +216,7 @@ interface SubState$8 {
|
|
|
216
216
|
selectedPanel: string | undefined;
|
|
217
217
|
theme: ThemeVars;
|
|
218
218
|
}
|
|
219
|
-
interface SubAPI$
|
|
219
|
+
interface SubAPI$a {
|
|
220
220
|
/**
|
|
221
221
|
* Toggles the fullscreen mode of the Storybook UI.
|
|
222
222
|
*
|
|
@@ -287,7 +287,7 @@ interface SubState$7 {
|
|
|
287
287
|
notifications: API_Notification[];
|
|
288
288
|
}
|
|
289
289
|
/** The API for managing notifications. */
|
|
290
|
-
interface SubAPI$
|
|
290
|
+
interface SubAPI$9 {
|
|
291
291
|
/**
|
|
292
292
|
* Adds a new notification to the list of notifications. If a notification with the same ID
|
|
293
293
|
* already exists, it will be replaced.
|
|
@@ -303,6 +303,19 @@ interface SubAPI$8 {
|
|
|
303
303
|
clearNotification: (id: string) => void;
|
|
304
304
|
}
|
|
305
305
|
|
|
306
|
+
/** The API for opening files in the editor. */
|
|
307
|
+
interface SubAPI$8 {
|
|
308
|
+
/**
|
|
309
|
+
* Opens the file in the editor. You can optionally provide a line and column number to open at a
|
|
310
|
+
* more specific location.
|
|
311
|
+
*/
|
|
312
|
+
openInEditor: (payload: {
|
|
313
|
+
file: string;
|
|
314
|
+
line?: number;
|
|
315
|
+
column?: number;
|
|
316
|
+
}) => Promise<OpenInEditorResponsePayload>;
|
|
317
|
+
}
|
|
318
|
+
|
|
306
319
|
interface SubAPI$7 {
|
|
307
320
|
renderPreview?: API_IframeRenderer;
|
|
308
321
|
}
|
|
@@ -429,7 +442,7 @@ interface SubAPI$4 {
|
|
|
429
442
|
* @param shortcuts The new shortcuts to set.
|
|
430
443
|
* @returns A promise that resolves to the new shortcuts.
|
|
431
444
|
*/
|
|
432
|
-
setShortcuts(shortcuts: API_Shortcuts): Promise<API_Shortcuts>;
|
|
445
|
+
setShortcuts(update: API_Shortcuts | ((shortcuts: API_Shortcuts) => API_Shortcuts)): Promise<API_Shortcuts>;
|
|
433
446
|
/**
|
|
434
447
|
* Sets the shortcut for the given action to the given value.
|
|
435
448
|
*
|
|
@@ -495,7 +508,10 @@ interface API_Shortcuts {
|
|
|
495
508
|
expandAll: API_KeyCollection;
|
|
496
509
|
remount: API_KeyCollection;
|
|
497
510
|
openInEditor: API_KeyCollection;
|
|
511
|
+
openInIsolation: API_KeyCollection;
|
|
498
512
|
copyStoryLink: API_KeyCollection;
|
|
513
|
+
goToPreviousLandmark: API_KeyCollection;
|
|
514
|
+
goToNextLandmark: API_KeyCollection;
|
|
499
515
|
}
|
|
500
516
|
type API_Action = keyof API_Shortcuts;
|
|
501
517
|
interface API_AddonShortcut {
|
|
@@ -745,6 +761,33 @@ interface SubAPI$2 {
|
|
|
745
761
|
* @returns {void}
|
|
746
762
|
*/
|
|
747
763
|
navigateUrl: (url: string, options: NavigateOptions) => void;
|
|
764
|
+
/**
|
|
765
|
+
* Get the manager and preview hrefs for a story.
|
|
766
|
+
*
|
|
767
|
+
* @param {string} storyId - The ID of the story to get the URL for.
|
|
768
|
+
* @param {Object} options - Options for the URL.
|
|
769
|
+
* @param {string} [options.base] - Return an absolute href based on the current origin or network
|
|
770
|
+
* address.
|
|
771
|
+
* @param {boolean} [options.inheritArgs] - Inherit args from the current URL. If storyId matches
|
|
772
|
+
* current story, inheritArgs defaults to true.
|
|
773
|
+
* @param {boolean} [options.inheritGlobals] - Inherit globals from the current URL. Defaults to
|
|
774
|
+
* true.
|
|
775
|
+
* @param {QueryParams} [options.queryParams] - Query params to add to the URL.
|
|
776
|
+
* @param {string} [options.refId] - ID of the ref to get the URL for (for composed Storybooks)
|
|
777
|
+
* @param {string} [options.viewMode] - The view mode to use, defaults to 'story'.
|
|
778
|
+
* @returns {Object} Manager and preview hrefs for the story.
|
|
779
|
+
*/
|
|
780
|
+
getStoryHrefs(storyId: string, options?: {
|
|
781
|
+
base?: 'origin' | 'network';
|
|
782
|
+
inheritArgs?: boolean;
|
|
783
|
+
inheritGlobals?: boolean;
|
|
784
|
+
queryParams?: QueryParams;
|
|
785
|
+
refId?: string;
|
|
786
|
+
viewMode?: API_ViewMode;
|
|
787
|
+
}): {
|
|
788
|
+
managerHref: string;
|
|
789
|
+
previewHref: string;
|
|
790
|
+
};
|
|
748
791
|
/**
|
|
749
792
|
* Get the value of a query parameter from the current URL.
|
|
750
793
|
*
|
|
@@ -864,7 +907,7 @@ declare const ManagerContext: React.Context<{
|
|
|
864
907
|
state: State;
|
|
865
908
|
}>;
|
|
866
909
|
type State = SubState$8 & SubState$3 & SubState$6 & SubState$7 & SubState$1 & SubState$2 & SubState$4 & SubState$5 & SubState$9 & SubState & RouterData & API_OptionsData & Other;
|
|
867
|
-
type API = SubAPI$
|
|
910
|
+
type API = SubAPI$d & SubAPI$c & SubAPI$7 & SubAPI$3 & SubAPI$6 & SubAPI$b & SubAPI$a & SubAPI$9 & SubAPI$4 & SubAPI$5 & SubAPI$1 & SubAPI$2 & SubAPI & SubAPI$8 & Other;
|
|
868
911
|
interface Other {
|
|
869
912
|
[key: string]: any;
|
|
870
913
|
}
|
|
@@ -1746,6 +1789,31 @@ declare global {
|
|
|
1746
1789
|
function __pwUnwrapObject(storyRef: WrappedStoryRef): Promise<UnwrappedJSXStoryRef | UnwrappedImportStoryRef>;
|
|
1747
1790
|
}
|
|
1748
1791
|
|
|
1792
|
+
/** System tags used throughout Storybook for categorizing and filtering stories and docs entries. */
|
|
1793
|
+
declare const Tag: {
|
|
1794
|
+
/** Indicates that autodocs should be generated for this component */
|
|
1795
|
+
readonly AUTODOCS: "autodocs";
|
|
1796
|
+
/** MDX documentation attached to a component's stories file */
|
|
1797
|
+
readonly ATTACHED_MDX: "attached-mdx";
|
|
1798
|
+
/** Standalone MDX documentation not attached to stories */
|
|
1799
|
+
readonly UNATTACHED_MDX: "unattached-mdx";
|
|
1800
|
+
/** Story has a play function */
|
|
1801
|
+
readonly PLAY_FN: "play-fn";
|
|
1802
|
+
/** Story has a test function */
|
|
1803
|
+
readonly TEST_FN: "test-fn";
|
|
1804
|
+
/** Development environment tag */
|
|
1805
|
+
readonly DEV: "dev";
|
|
1806
|
+
/** Test environment tag */
|
|
1807
|
+
readonly TEST: "test";
|
|
1808
|
+
/** Manifest generation tag */
|
|
1809
|
+
readonly MANIFEST: "manifest";
|
|
1810
|
+
};
|
|
1811
|
+
/**
|
|
1812
|
+
* Tags can be any string, including custom user-defined tags. The Tag constant above defines the
|
|
1813
|
+
* system tags used by Storybook.
|
|
1814
|
+
*/
|
|
1815
|
+
type Tag = string;
|
|
1816
|
+
|
|
1749
1817
|
type TestProviderState = 'test-provider-state:pending' | 'test-provider-state:running' | 'test-provider-state:succeeded' | 'test-provider-state:crashed';
|
|
1750
1818
|
type TestProviderId = string;
|
|
1751
1819
|
type TestProviderStateByProviderId = Record<TestProviderId, TestProviderState>;
|
|
@@ -3199,11 +3267,11 @@ declare const userSettingSchema: ZodObject<{
|
|
|
3199
3267
|
mutedAt?: number | undefined;
|
|
3200
3268
|
}>>;
|
|
3201
3269
|
}, "strip", ZodTypeAny, {
|
|
3202
|
-
|
|
3270
|
+
autodocs?: {
|
|
3203
3271
|
status?: "done" | "open" | "accepted" | "skipped" | undefined;
|
|
3204
3272
|
mutedAt?: number | undefined;
|
|
3205
3273
|
} | undefined;
|
|
3206
|
-
|
|
3274
|
+
controls?: {
|
|
3207
3275
|
status?: "done" | "open" | "accepted" | "skipped" | undefined;
|
|
3208
3276
|
mutedAt?: number | undefined;
|
|
3209
3277
|
} | undefined;
|
|
@@ -3288,11 +3356,11 @@ declare const userSettingSchema: ZodObject<{
|
|
|
3288
3356
|
mutedAt?: number | undefined;
|
|
3289
3357
|
} | undefined;
|
|
3290
3358
|
}, {
|
|
3291
|
-
|
|
3359
|
+
autodocs?: {
|
|
3292
3360
|
status?: "done" | "open" | "accepted" | "skipped" | undefined;
|
|
3293
3361
|
mutedAt?: number | undefined;
|
|
3294
3362
|
} | undefined;
|
|
3295
|
-
|
|
3363
|
+
controls?: {
|
|
3296
3364
|
status?: "done" | "open" | "accepted" | "skipped" | undefined;
|
|
3297
3365
|
mutedAt?: number | undefined;
|
|
3298
3366
|
} | undefined;
|
|
@@ -3386,11 +3454,11 @@ declare const userSettingSchema: ZodObject<{
|
|
|
3386
3454
|
}>>;
|
|
3387
3455
|
}, "strip", ZodTypeAny, {
|
|
3388
3456
|
items?: {
|
|
3389
|
-
|
|
3457
|
+
autodocs?: {
|
|
3390
3458
|
status?: "done" | "open" | "accepted" | "skipped" | undefined;
|
|
3391
3459
|
mutedAt?: number | undefined;
|
|
3392
3460
|
} | undefined;
|
|
3393
|
-
|
|
3461
|
+
controls?: {
|
|
3394
3462
|
status?: "done" | "open" | "accepted" | "skipped" | undefined;
|
|
3395
3463
|
mutedAt?: number | undefined;
|
|
3396
3464
|
} | undefined;
|
|
@@ -3480,11 +3548,11 @@ declare const userSettingSchema: ZodObject<{
|
|
|
3480
3548
|
} | undefined;
|
|
3481
3549
|
}, {
|
|
3482
3550
|
items?: {
|
|
3483
|
-
|
|
3551
|
+
autodocs?: {
|
|
3484
3552
|
status?: "done" | "open" | "accepted" | "skipped" | undefined;
|
|
3485
3553
|
mutedAt?: number | undefined;
|
|
3486
3554
|
} | undefined;
|
|
3487
|
-
|
|
3555
|
+
controls?: {
|
|
3488
3556
|
status?: "done" | "open" | "accepted" | "skipped" | undefined;
|
|
3489
3557
|
mutedAt?: number | undefined;
|
|
3490
3558
|
} | undefined;
|
|
@@ -3581,11 +3649,11 @@ declare const userSettingSchema: ZodObject<{
|
|
|
3581
3649
|
userSince?: number | undefined;
|
|
3582
3650
|
checklist?: {
|
|
3583
3651
|
items?: {
|
|
3584
|
-
|
|
3652
|
+
autodocs?: {
|
|
3585
3653
|
status?: "done" | "open" | "accepted" | "skipped" | undefined;
|
|
3586
3654
|
mutedAt?: number | undefined;
|
|
3587
3655
|
} | undefined;
|
|
3588
|
-
|
|
3656
|
+
controls?: {
|
|
3589
3657
|
status?: "done" | "open" | "accepted" | "skipped" | undefined;
|
|
3590
3658
|
mutedAt?: number | undefined;
|
|
3591
3659
|
} | undefined;
|
|
@@ -3682,11 +3750,11 @@ declare const userSettingSchema: ZodObject<{
|
|
|
3682
3750
|
userSince?: number | undefined;
|
|
3683
3751
|
checklist?: {
|
|
3684
3752
|
items?: {
|
|
3685
|
-
|
|
3753
|
+
autodocs?: {
|
|
3686
3754
|
status?: "done" | "open" | "accepted" | "skipped" | undefined;
|
|
3687
3755
|
mutedAt?: number | undefined;
|
|
3688
3756
|
} | undefined;
|
|
3689
|
-
|
|
3757
|
+
controls?: {
|
|
3690
3758
|
status?: "done" | "open" | "accepted" | "skipped" | undefined;
|
|
3691
3759
|
mutedAt?: number | undefined;
|
|
3692
3760
|
} | undefined;
|
|
@@ -3837,4 +3905,4 @@ declare const checklistStore: {
|
|
|
3837
3905
|
disable: (value: boolean) => void;
|
|
3838
3906
|
};
|
|
3839
3907
|
|
|
3840
|
-
export { type API, type API_EventMap, type API_KeyCollection, ActiveTabs, AddonStore, type Combo, ManagerConsumer as Consumer, type KeyboardEventLike, ManagerContext, type ManagerProviderProps, ManagerProvider as Provider, RequestResponseError, type State, type Options as StoreOptions, addons, combineParameters, controlOrMetaKey, controlOrMetaSymbol, eventMatchesShortcut, eventToShortcut, MockUniversalStore as experimental_MockUniversalStore, UniversalStore as experimental_UniversalStore, getStatusStoreByTypeId as experimental_getStatusStore, getTestProviderStoreById as experimental_getTestProviderStore, experimental_requestResponse, useStatusStore as experimental_useStatusStore, useTestProviderStore as experimental_useTestProviderStore, useUniversalStore as experimental_useUniversalStore, checklistStore as internal_checklistStore, fullStatusStore as internal_fullStatusStore, fullTestProviderStore as internal_fullTestProviderStore, universalChecklistStore as internal_universalChecklistStore, universalStatusStore as internal_universalStatusStore, universalTestProviderStore as internal_universalTestProviderStore, isMacLike, isShortcutTaken, keyToSymbol, _default as merge, mockChannel, optionOrAltSymbol, shortcutMatchesShortcut, shortcutToAriaKeyshortcuts, shortcutToHumanString, typesX as types, useAddonState, useArgTypes, useArgs, useChannel, useGlobalTypes, useGlobals, useParameter, useSharedState, useStoryPrepared, useStorybookApi, useStorybookState };
|
|
3908
|
+
export { type API, type API_EventMap, type API_KeyCollection, ActiveTabs, AddonStore, type Combo, ManagerConsumer as Consumer, type KeyboardEventLike, ManagerContext, type ManagerProviderProps, ManagerProvider as Provider, RequestResponseError, type State, type Options as StoreOptions, Tag, addons, combineParameters, controlOrMetaKey, controlOrMetaSymbol, eventMatchesShortcut, eventToShortcut, MockUniversalStore as experimental_MockUniversalStore, UniversalStore as experimental_UniversalStore, getStatusStoreByTypeId as experimental_getStatusStore, getTestProviderStoreById as experimental_getTestProviderStore, experimental_requestResponse, useStatusStore as experimental_useStatusStore, useTestProviderStore as experimental_useTestProviderStore, useUniversalStore as experimental_useUniversalStore, checklistStore as internal_checklistStore, fullStatusStore as internal_fullStatusStore, fullTestProviderStore as internal_fullTestProviderStore, universalChecklistStore as internal_universalChecklistStore, universalStatusStore as internal_universalStatusStore, universalTestProviderStore as internal_universalTestProviderStore, isMacLike, isShortcutTaken, keyToSymbol, _default as merge, mockChannel, optionOrAltSymbol, shortcutMatchesShortcut, shortcutToAriaKeyshortcuts, shortcutToHumanString, typesX as types, useAddonState, useArgTypes, useArgs, useChannel, useGlobalTypes, useGlobals, useParameter, useSharedState, useStoryPrepared, useStorybookApi, useStorybookState };
|
|
@@ -13,22 +13,28 @@ import {
|
|
|
13
13
|
StorybookError
|
|
14
14
|
} from "../_browser-chunks/chunk-JVRDBUUP.js";
|
|
15
15
|
import {
|
|
16
|
+
countBy,
|
|
16
17
|
dequal,
|
|
17
18
|
partition
|
|
18
|
-
} from "../_browser-chunks/chunk-
|
|
19
|
-
import
|
|
19
|
+
} from "../_browser-chunks/chunk-NQJGOFZV.js";
|
|
20
|
+
import {
|
|
21
|
+
Tag
|
|
22
|
+
} from "../_browser-chunks/chunk-AFVOZMXQ.js";
|
|
23
|
+
import {
|
|
24
|
+
require_main
|
|
25
|
+
} from "../_browser-chunks/chunk-XLJZ7AOP.js";
|
|
26
|
+
import {
|
|
27
|
+
isEqual
|
|
28
|
+
} from "../_browser-chunks/chunk-IYCKG66Y.js";
|
|
29
|
+
import "../_browser-chunks/chunk-NZMVUW5T.js";
|
|
20
30
|
import {
|
|
21
|
-
countBy,
|
|
22
31
|
mapValues,
|
|
23
32
|
mergeWith,
|
|
33
|
+
omit,
|
|
24
34
|
pick,
|
|
25
35
|
toMerged
|
|
26
|
-
} from "../_browser-chunks/chunk-
|
|
27
|
-
import "../_browser-chunks/chunk-
|
|
28
|
-
import {
|
|
29
|
-
isEqual
|
|
30
|
-
} from "../_browser-chunks/chunk-2NDLAB5X.js";
|
|
31
|
-
import "../_browser-chunks/chunk-NZMVUW5T.js";
|
|
36
|
+
} from "../_browser-chunks/chunk-YK43Z22A.js";
|
|
37
|
+
import "../_browser-chunks/chunk-LCHBOIHN.js";
|
|
32
38
|
import {
|
|
33
39
|
require_memoizerific
|
|
34
40
|
} from "../_browser-chunks/chunk-ZCFV7BZB.js";
|
|
@@ -655,7 +661,7 @@ var TITLE_PATH_SEPARATOR = /\s*\/\s*/, denormalizeStoryParameters = ({
|
|
|
655
661
|
entries: Object.values(index.entries).reduce(
|
|
656
662
|
(acc, entry) => (acc[entry.id] = {
|
|
657
663
|
...entry,
|
|
658
|
-
tags: entry.tags ? [
|
|
664
|
+
tags: entry.tags ? [Tag.DEV, Tag.TEST, ...entry.tags] : [Tag.DEV]
|
|
659
665
|
}, acc),
|
|
660
666
|
{}
|
|
661
667
|
)
|
|
@@ -1461,7 +1467,12 @@ var defaultShortcuts = Object.freeze({
|
|
|
1461
1467
|
expandAll: [controlOrMetaKey2(), "shift", "ArrowDown"],
|
|
1462
1468
|
remount: ["alt", "R"],
|
|
1463
1469
|
openInEditor: ["alt", "shift", "E"],
|
|
1464
|
-
|
|
1470
|
+
openInIsolation: ["alt", "shift", "I"],
|
|
1471
|
+
copyStoryLink: ["alt", "shift", "L"],
|
|
1472
|
+
goToPreviousLandmark: ["shift", "F6"],
|
|
1473
|
+
// hardcoded in react-aria
|
|
1474
|
+
goToNextLandmark: ["F6"]
|
|
1475
|
+
// hardcoded in react-aria
|
|
1465
1476
|
// TODO: bring this back once we want to add shortcuts for this
|
|
1466
1477
|
// copyStoryName: ['alt', 'shift', 'C'],
|
|
1467
1478
|
}), addonsShortcuts = {};
|
|
@@ -1496,22 +1507,24 @@ var init10 = ({ store: store2, fullAPI, provider }) => {
|
|
|
1496
1507
|
defaults[actionName] = defaultShortcut;
|
|
1497
1508
|
}), defaults;
|
|
1498
1509
|
},
|
|
1499
|
-
async setShortcuts(
|
|
1500
|
-
|
|
1510
|
+
async setShortcuts(update2) {
|
|
1511
|
+
let { shortcuts } = await store2.setState(
|
|
1512
|
+
(state2) => ({ shortcuts: typeof update2 == "function" ? update2(state2.shortcuts) : update2 }),
|
|
1513
|
+
{ persistence: "permanent" }
|
|
1514
|
+
);
|
|
1515
|
+
return shortcuts;
|
|
1501
1516
|
},
|
|
1502
1517
|
async restoreAllDefaultShortcuts() {
|
|
1503
1518
|
return api.setShortcuts(api.getDefaultShortcuts());
|
|
1504
1519
|
},
|
|
1505
1520
|
async setShortcut(action, value) {
|
|
1506
|
-
|
|
1507
|
-
return await api.setShortcuts({ ...shortcuts, [action]: value }), value;
|
|
1521
|
+
return await api.setShortcuts((shortcuts) => ({ ...shortcuts, [action]: value })), value;
|
|
1508
1522
|
},
|
|
1509
1523
|
async setAddonShortcut(addon, shortcut) {
|
|
1510
|
-
|
|
1511
|
-
return await api.setShortcuts({
|
|
1524
|
+
return await api.setShortcuts((shortcuts) => ({
|
|
1512
1525
|
...shortcuts,
|
|
1513
1526
|
[`${addon}-${shortcut.actionName}`]: shortcut.defaultShortcut
|
|
1514
|
-
}), addonsShortcuts[`${addon}-${shortcut.actionName}`] = shortcut, shortcut;
|
|
1527
|
+
})), addonsShortcuts[`${addon}-${shortcut.actionName}`] = shortcut, shortcut;
|
|
1515
1528
|
},
|
|
1516
1529
|
async restoreDefaultShortcut(action) {
|
|
1517
1530
|
let defaultShortcut = api.getDefaultShortcuts()[action];
|
|
@@ -1528,7 +1541,9 @@ var init10 = ({ store: store2, fullAPI, provider }) => {
|
|
|
1528
1541
|
handleShortcutFeature(feature, event) {
|
|
1529
1542
|
let {
|
|
1530
1543
|
ui: { enableShortcuts },
|
|
1531
|
-
storyId
|
|
1544
|
+
storyId,
|
|
1545
|
+
refId,
|
|
1546
|
+
viewMode
|
|
1532
1547
|
} = store2.getState();
|
|
1533
1548
|
if (enableShortcuts)
|
|
1534
1549
|
switch (event?.preventDefault && event.preventDefault(), feature) {
|
|
@@ -1536,6 +1551,10 @@ var init10 = ({ store: store2, fullAPI, provider }) => {
|
|
|
1536
1551
|
fullAPI.getIsFullscreen() ? fullAPI.toggleFullscreen(!1) : fullAPI.getIsNavShown() && fullAPI.toggleNav(!0);
|
|
1537
1552
|
break;
|
|
1538
1553
|
}
|
|
1554
|
+
// Handled by @react-aria/interactions and useLandmarkIndicator
|
|
1555
|
+
case "goToNextLandmark":
|
|
1556
|
+
case "goToPreviousLandmark":
|
|
1557
|
+
break;
|
|
1539
1558
|
case "focusNav": {
|
|
1540
1559
|
fullAPI.getIsFullscreen() && fullAPI.toggleFullscreen(!1), fullAPI.getIsNavShown() || fullAPI.toggleNav(!0), fullAPI.focusOnUIElement(focusableUIElements.storyListMenu);
|
|
1541
1560
|
break;
|
|
@@ -1621,6 +1640,13 @@ var init10 = ({ store: store2, fullAPI, provider }) => {
|
|
|
1621
1640
|
});
|
|
1622
1641
|
break;
|
|
1623
1642
|
}
|
|
1643
|
+
case "openInIsolation": {
|
|
1644
|
+
if (storyId && viewMode === "story") {
|
|
1645
|
+
let { previewHref } = fullAPI.getStoryHrefs(storyId, { refId });
|
|
1646
|
+
window.open(previewHref, "_blank", "noopener,noreferrer");
|
|
1647
|
+
}
|
|
1648
|
+
break;
|
|
1649
|
+
}
|
|
1624
1650
|
// TODO: bring this back once we want to add shortcuts for this
|
|
1625
1651
|
// case 'copyStoryName': {
|
|
1626
1652
|
// const storyData = fullAPI.getCurrentStoryData();
|
|
@@ -1630,7 +1656,10 @@ var init10 = ({ store: store2, fullAPI, provider }) => {
|
|
|
1630
1656
|
// break;
|
|
1631
1657
|
// }
|
|
1632
1658
|
case "copyStoryLink": {
|
|
1633
|
-
|
|
1659
|
+
if (storyId) {
|
|
1660
|
+
let { managerHref } = fullAPI.getStoryHrefs(storyId, { refId });
|
|
1661
|
+
(0, import_copy_to_clipboard.default)(managerHref);
|
|
1662
|
+
}
|
|
1634
1663
|
break;
|
|
1635
1664
|
}
|
|
1636
1665
|
default:
|
|
@@ -2238,11 +2267,17 @@ import {
|
|
|
2238
2267
|
} from "storybook/internal/core-events";
|
|
2239
2268
|
import { buildArgsParam, queryFromLocation } from "storybook/internal/router";
|
|
2240
2269
|
import { global as global7 } from "@storybook/global";
|
|
2241
|
-
var
|
|
2270
|
+
var import_picoquery = __toESM(require_main(), 1);
|
|
2271
|
+
var parseBoolean = (value) => {
|
|
2242
2272
|
if (value === "true" || value === "1")
|
|
2243
2273
|
return !0;
|
|
2244
2274
|
if (value === "false" || value === "0")
|
|
2245
2275
|
return !1;
|
|
2276
|
+
}, parseSerializedParam = (param) => Object.fromEntries(
|
|
2277
|
+
param.split(";").map((pair) => pair.split(":")).map(([key, value]) => [key, encodeURIComponent(value)]).filter(([key, value]) => key && value)
|
|
2278
|
+
), mergeSerializedParams = (params, extraParams) => {
|
|
2279
|
+
let pairs = parseSerializedParam(params), extra = parseSerializedParam(extraParams);
|
|
2280
|
+
return Object.entries({ ...pairs, ...extra }).map(([key, value]) => `${key}:${value}`).join(";");
|
|
2246
2281
|
}, prevParams, initialUrlSupport = ({
|
|
2247
2282
|
state: { location: location2, path, viewMode, storyId: storyIdFromUrl },
|
|
2248
2283
|
singleStory
|
|
@@ -2274,6 +2309,29 @@ var { window: globalWindow } = global7, parseBoolean = (value) => {
|
|
|
2274
2309
|
let params = Object.entries(queryParams).filter(([, v]) => v).sort(([a], [b]) => a < b ? -1 : 1).map(([k, v]) => `${k}=${v}`), to = [path, ...params].join("&");
|
|
2275
2310
|
return navigate(to, options);
|
|
2276
2311
|
}, api = {
|
|
2312
|
+
getStoryHrefs(storyId, options = {}) {
|
|
2313
|
+
let { id: currentStoryId, refId: currentRefId } = fullAPI.getCurrentStoryData() ?? {}, isCurrentStory = storyId === currentStoryId && options.refId === currentRefId, { customQueryParams, location: location2, refs } = store2.getState(), {
|
|
2314
|
+
base,
|
|
2315
|
+
inheritArgs = isCurrentStory,
|
|
2316
|
+
inheritGlobals = !0,
|
|
2317
|
+
queryParams = {},
|
|
2318
|
+
refId,
|
|
2319
|
+
viewMode = "story"
|
|
2320
|
+
} = options;
|
|
2321
|
+
if (refId && !refs[refId])
|
|
2322
|
+
throw new Error(`Invalid refId: ${refId}`);
|
|
2323
|
+
let originAddress = global7.window.location.origin + location2.pathname, networkAddress = global7.STORYBOOK_NETWORK_ADDRESS ?? originAddress, managerBase = base === "origin" ? originAddress : base === "network" ? networkAddress : location2.pathname, previewBase = refId ? refs[refId].url + "/iframe.html" : global7.PREVIEW_URL || `${managerBase}iframe.html`, refParam = refId ? `&refId=${encodeURIComponent(refId)}` : "", { args = "", globals = "", ...otherParams } = queryParams, argsParam = inheritArgs ? mergeSerializedParams(customQueryParams?.args ?? "", args) : args, globalsParam = inheritGlobals ? mergeSerializedParams(customQueryParams?.globals ?? "", globals) : globals, customManagerParams = (0, import_picoquery.stringify)(otherParams, {
|
|
2324
|
+
nesting: !0,
|
|
2325
|
+
nestingSyntax: "js"
|
|
2326
|
+
}), customPreviewParams = (0, import_picoquery.stringify)(omit(otherParams, ["id", "viewMode"]), {
|
|
2327
|
+
nesting: !0,
|
|
2328
|
+
nestingSyntax: "js"
|
|
2329
|
+
});
|
|
2330
|
+
return argsParam = argsParam && `&args=${argsParam}`, globalsParam = globalsParam && `&globals=${globalsParam}`, customManagerParams = customManagerParams && `&${customManagerParams}`, customPreviewParams = customPreviewParams && `&${customPreviewParams}`, {
|
|
2331
|
+
managerHref: `${managerBase}?path=/${viewMode}/${refId ? `${refId}_` : ""}${storyId}${argsParam}${globalsParam}${customManagerParams}`,
|
|
2332
|
+
previewHref: `${previewBase}?id=${storyId}&viewMode=${viewMode}${refParam}${argsParam}${refId ? "" : globalsParam}${customPreviewParams}`
|
|
2333
|
+
};
|
|
2334
|
+
},
|
|
2277
2335
|
getQueryParam(key) {
|
|
2278
2336
|
let { customQueryParams } = store2.getState();
|
|
2279
2337
|
return customQueryParams ? customQueryParams[key] : void 0;
|
|
@@ -2316,7 +2374,7 @@ var { window: globalWindow } = global7, parseBoolean = (value) => {
|
|
|
2316
2374
|
provider.channel?.on(SET_CURRENT_STORY2, () => updateArgsParam());
|
|
2317
2375
|
let handleOrId;
|
|
2318
2376
|
return provider.channel?.on(STORY_ARGS_UPDATED2, () => {
|
|
2319
|
-
"requestIdleCallback" in
|
|
2377
|
+
"requestIdleCallback" in global7.window ? (handleOrId && global7.window.cancelIdleCallback(handleOrId), handleOrId = global7.window.requestIdleCallback(updateArgsParam, { timeout: 1e3 })) : (handleOrId && clearTimeout(handleOrId), setTimeout(updateArgsParam, 100));
|
|
2320
2378
|
}), provider.channel?.on(GLOBALS_UPDATED2, ({ userGlobals, initialGlobals }) => {
|
|
2321
2379
|
let { path, hash = "", queryParams } = api.getUrlState(), globalsString = buildArgsParam(initialGlobals, userGlobals);
|
|
2322
2380
|
navigateTo(`${path}${hash}`, { ...queryParams, globals: globalsString }, { replace: !0 }), api.setQueryParams({ globals: globalsString });
|
|
@@ -2338,7 +2396,7 @@ import { global as global8 } from "@storybook/global";
|
|
|
2338
2396
|
import semver from "semver";
|
|
2339
2397
|
|
|
2340
2398
|
// src/manager-api/version.ts
|
|
2341
|
-
var version = "10.2.0-
|
|
2399
|
+
var version = "10.2.0-beta.0";
|
|
2342
2400
|
|
|
2343
2401
|
// src/manager-api/modules/versions.ts
|
|
2344
2402
|
var { VERSIONCHECK } = global8, getVersionCheckData = (0, import_memoizerific2.default)(1)(() => {
|
|
@@ -2972,6 +3030,7 @@ export {
|
|
|
2972
3030
|
ManagerContext,
|
|
2973
3031
|
ManagerProvider as Provider,
|
|
2974
3032
|
RequestResponseError,
|
|
3033
|
+
Tag,
|
|
2975
3034
|
addons,
|
|
2976
3035
|
combineParameters,
|
|
2977
3036
|
controlOrMetaKey,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_phceqgr585q from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_phceqgr585q from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_phceqgr585q from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_phceqgr585q.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_phceqgr585q.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_phceqgr585q.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -16,8 +16,8 @@ import {
|
|
|
16
16
|
join,
|
|
17
17
|
normalize,
|
|
18
18
|
resolve
|
|
19
|
-
} from "../_node-chunks/chunk-
|
|
20
|
-
import "../_node-chunks/chunk-
|
|
19
|
+
} from "../_node-chunks/chunk-MV2QM7P3.js";
|
|
20
|
+
import "../_node-chunks/chunk-AXDM43NU.js";
|
|
21
21
|
|
|
22
22
|
// ../../node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
|
|
23
23
|
var comma = 44, semicolon = 59, chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", intToChar = new Uint8Array(64), charToInt = new Uint8Array(128);
|