@storybook/core
Advanced tools
Comparing version 0.0.0-pr-28768-sha-89e4a1ff to 0.0.0-pr-28768-sha-9b4d61ce
@@ -874,2 +874,3 @@ import * as _storybook_core_types from '@storybook/core/types'; | ||
'@storybook/addon-viewport': string; | ||
'@storybook/experimental-addon-vitest': string; | ||
'@storybook/builder-vite': string; | ||
@@ -919,2 +920,3 @@ '@storybook/builder-webpack5': string; | ||
'@storybook/core-webpack': string; | ||
'create-storybook': string; | ||
'@storybook/csf-plugin': string; | ||
@@ -921,0 +923,0 @@ '@storybook/instrumenter': string; |
@@ -684,2 +684,4 @@ import React, { ReactNode, FC, Component, ReactElement } from 'react'; | ||
globals?: Globals; | ||
userGlobals?: Globals; | ||
storyGlobals?: Globals; | ||
globalTypes?: GlobalTypes; | ||
@@ -689,14 +691,23 @@ } | ||
/** | ||
* Returns the current global data object. | ||
* @returns {Globals} The current global data object. | ||
* Returns the current globals, which is the user globals overlaid with the story globals | ||
* @returns {Globals} The current globals. | ||
*/ | ||
getGlobals: () => Globals; | ||
/** | ||
* Returns the current global types object. | ||
* @returns {GlobalTypes} The current global types object. | ||
* Returns the current globals, as set by the user (a story may have override values) | ||
* @returns {Globals} The current user globals. | ||
*/ | ||
getUserGlobals: () => Globals /** | ||
/** | ||
* Returns the current globals, as set by the story | ||
* @returns {Globals} The current story globals. | ||
*/; | ||
getStoryGlobals: () => Globals /** | ||
* Returns the globalTypes, as defined at the project level. | ||
* @returns {GlobalTypes} The globalTypes. | ||
*/; | ||
getGlobalTypes: () => GlobalTypes; | ||
/** | ||
* Updates the current global data object with the provided new global data object. | ||
* @param {Globals} newGlobals - The new global data object to update with. | ||
* Updates the current globals with the provided new globals. | ||
* @param {Globals} newGlobals - The new globals to update with. | ||
* @returns {void} | ||
@@ -815,3 +826,8 @@ */ | ||
declare function useArgs(): [Args, (newArgs: Args) => void, (argNames?: string[]) => void, Args]; | ||
declare function useGlobals(): [Args, (newGlobals: Args) => void]; | ||
declare function useGlobals(): [ | ||
globals: Globals, | ||
updateGlobals: (newGlobals: Globals) => void, | ||
storyGlobals: Globals, | ||
userGlobals: Globals | ||
]; | ||
declare function useGlobalTypes(): ArgTypes; | ||
@@ -818,0 +834,0 @@ declare function useArgTypes(): ArgTypes; |
@@ -337,5 +337,10 @@ import { Channel } from '@storybook/core/channels'; | ||
declare global { | ||
var globalProjectAnnotations: ProjectAnnotations<any>; | ||
var defaultProjectAnnotations: ProjectAnnotations<any>; | ||
} | ||
declare function setDefaultProjectAnnotations<TRenderer extends Renderer = Renderer>(_defaultProjectAnnotations: ProjectAnnotations<TRenderer>): void; | ||
declare function setProjectAnnotations<TRenderer extends Renderer = Renderer>(projectAnnotations: NamedOrDefaultProjectAnnotations<TRenderer> | NamedOrDefaultProjectAnnotations<TRenderer>[]): ProjectAnnotations<TRenderer>; | ||
declare function composeStory<TRenderer extends Renderer = Renderer, TArgs extends Args = Args>(storyAnnotations: LegacyStoryAnnotationsOrFn<TRenderer>, componentAnnotations: ComponentAnnotations<TRenderer, TArgs>, projectAnnotations?: ProjectAnnotations<TRenderer>, defaultConfig?: ProjectAnnotations<TRenderer>, exportsName?: string): ComposedStoryFn<TRenderer, Partial<TArgs>>; | ||
declare function composeStories<TModule extends Store_CSFExports>(storiesImport: TModule, globalConfig: ProjectAnnotations<Renderer>, composeStoryFn: ComposeStoryFn): {}; | ||
declare function composeStories<TModule extends Store_CSFExports>(storiesImport: TModule, globalConfig: ProjectAnnotations<Renderer>, composeStoryFn?: ComposeStoryFn): {}; | ||
type WrappedStoryRef = { | ||
@@ -360,3 +365,3 @@ __pw_type: 'jsx' | 'importRef'; | ||
projectAnnotations: NormalizedProjectAnnotations<TRenderer>; | ||
globals: GlobalsStore; | ||
userGlobals: GlobalsStore; | ||
args: ArgsStore; | ||
@@ -400,3 +405,8 @@ hooks: Record<StoryId, HooksContext<TRenderer>>; | ||
args: _storybook_csf.Args; | ||
globals: _storybook_csf.Globals; | ||
initialGlobals: _storybook_csf.Globals; | ||
globalTypes: (_storybook_csf.GlobalTypes & _storybook_csf.StrictGlobalTypes) | undefined; | ||
userGlobals: _storybook_csf.Globals; | ||
globals: { | ||
[x: string]: any; | ||
}; | ||
hooks: unknown; | ||
@@ -431,2 +441,3 @@ component?: (TRenderer & { | ||
usesMount: boolean; | ||
storyGlobals: _storybook_csf.Globals; | ||
} & Pick<_storybook_csf.StoryContextForLoaders<Renderer, _storybook_csf.Args>, "allArgs" | "argsByTarget" | "unmappedArgs">; | ||
@@ -509,3 +520,3 @@ addCleanupCallbacks(story: PreparedStory<TRenderer>, callbacks: CleanupCallback[]): void; | ||
id: StoryId; | ||
viewMode: StoryContext['viewMode']; | ||
viewMode: StoryContext<TRenderer>['viewMode']; | ||
renderOptions: StoryRenderOptions; | ||
@@ -524,3 +535,3 @@ type: RenderType; | ||
showStoryDuringRender?: () => void; | ||
}, id: StoryId, viewMode: StoryContext['viewMode'], renderOptions?: StoryRenderOptions, story?: PreparedStory<TRenderer>); | ||
}, id: StoryId, viewMode: StoryContext<TRenderer>['viewMode'], renderOptions?: StoryRenderOptions, story?: PreparedStory<TRenderer>); | ||
private runPhase; | ||
@@ -580,3 +591,8 @@ private checkIfAborted; | ||
args: _storybook_csf.Args; | ||
globals: _storybook_csf.Globals; | ||
initialGlobals: _storybook_csf.Globals; | ||
globalTypes: (_storybook_csf.GlobalTypes & _storybook_csf.StrictGlobalTypes) | undefined; | ||
userGlobals: _storybook_csf.Globals; | ||
globals: { | ||
[x: string]: any; | ||
}; | ||
hooks: unknown; | ||
@@ -611,2 +627,3 @@ component?: (TRenderer & { | ||
usesMount: boolean; | ||
storyGlobals: _storybook_csf.Globals; | ||
allArgs: any; | ||
@@ -713,3 +730,3 @@ argsByTarget: any; | ||
constructor(importFn: ModuleImportFn, getProjectAnnotations: () => MaybePromise<ProjectAnnotations<TRenderer>>, channel?: Channel, shouldInitialize?: boolean); | ||
get storyStore(): {}; | ||
get storyStore(): StoryStore<TRenderer>; | ||
protected initialize(): Promise<void>; | ||
@@ -733,4 +750,5 @@ ready(): Promise<void>; | ||
}): Promise<void>; | ||
onUpdateGlobals({ globals }: { | ||
onUpdateGlobals({ globals: updatedGlobals, currentStory, }: { | ||
globals: Globals; | ||
currentStory?: PreparedStory<TRenderer>; | ||
}): Promise<void>; | ||
@@ -761,3 +779,8 @@ onUpdateArgs({ storyId, updatedArgs }: { | ||
args: Args; | ||
globals: Globals; | ||
initialGlobals: Globals; | ||
globalTypes: (_storybook_csf.GlobalTypes & _storybook_csf.StrictGlobalTypes) | undefined; | ||
userGlobals: Globals; | ||
globals: { | ||
[x: string]: any; | ||
}; | ||
hooks: unknown; | ||
@@ -792,2 +815,3 @@ component?: (TRenderer & { | ||
usesMount: boolean; | ||
storyGlobals: Globals; | ||
} & Pick<_storybook_csf.StoryContextForLoaders<Renderer, Args>, "allArgs" | "argsByTarget" | "unmappedArgs">; | ||
@@ -908,5 +932,3 @@ extract(options?: { | ||
type BooleanOptional = boolean | undefined; | ||
interface IStringifyBaseOptions { | ||
interface IStringifyOptions { | ||
delimiter?: string | undefined; | ||
@@ -922,3 +944,3 @@ strictNullHandling?: boolean | undefined; | ||
indices?: boolean | undefined; | ||
sort?: ((a: string, b: string) => number) | undefined; | ||
sort?: ((a: any, b: any) => number) | undefined; | ||
serializeDate?: ((d: Date) => string) | undefined; | ||
@@ -928,16 +950,8 @@ format?: "RFC1738" | "RFC3986" | undefined; | ||
addQueryPrefix?: boolean | undefined; | ||
allowDots?: boolean | undefined; | ||
charset?: "utf-8" | "iso-8859-1" | undefined; | ||
charsetSentinel?: boolean | undefined; | ||
allowEmptyArrays?: boolean | undefined; | ||
} | ||
type IStringifyDynamicOptions<AllowDots extends BooleanOptional> = AllowDots extends true | ||
? { allowDots?: AllowDots; encodeDotInKeys?: boolean } | ||
: { allowDots?: boolean; encodeDotInKeys?: false }; | ||
type IStringifyOptions<AllowDots extends BooleanOptional = undefined> = | ||
& IStringifyBaseOptions | ||
& IStringifyDynamicOptions<AllowDots>; | ||
interface IParseBaseOptions { | ||
interface IParseOptions { | ||
comma?: boolean | undefined; | ||
@@ -951,5 +965,5 @@ delimiter?: string | RegExp | undefined; | ||
parseArrays?: boolean | undefined; | ||
allowDots?: boolean | undefined; | ||
plainObjects?: boolean | undefined; | ||
allowPrototypes?: boolean | undefined; | ||
allowSparse?: boolean | undefined; | ||
parameterLimit?: number | undefined; | ||
@@ -961,14 +975,4 @@ strictNullHandling?: boolean | undefined; | ||
interpretNumericEntities?: boolean | undefined; | ||
allowEmptyArrays?: boolean | undefined; | ||
duplicates?: "combine" | "first" | "last" | undefined; | ||
} | ||
type IParseDynamicOptions<AllowDots extends BooleanOptional> = AllowDots extends true | ||
? { allowDots?: AllowDots; decodeDotInKeys?: boolean } | ||
: { allowDots?: boolean; decodeDotInKeys?: false }; | ||
type IParseOptions<AllowDots extends BooleanOptional = undefined> = | ||
& IParseBaseOptions | ||
& IParseDynamicOptions<AllowDots>; | ||
interface ParsedQs { | ||
@@ -978,8 +982,5 @@ [key: string]: undefined | string | string[] | ParsedQs | ParsedQs[]; | ||
function stringify(obj: any, options?: IStringifyOptions<BooleanOptional>): string; | ||
function parse(str: string, options?: IParseOptions<BooleanOptional> & { decoder?: never | undefined }): ParsedQs; | ||
function parse( | ||
str: string | Record<string, string>, | ||
options?: IParseOptions<BooleanOptional>, | ||
): { [key: string]: unknown }; | ||
function stringify(obj: any, options?: IStringifyOptions): string; | ||
function parse(str: string, options?: IParseOptions & { decoder?: never | undefined }): ParsedQs; | ||
function parse(str: string | Record<string, string>, options?: IParseOptions): { [key: string]: unknown }; | ||
} | ||
@@ -1040,2 +1041,2 @@ | ||
export { DocsContext, HooksContext, Preview, PreviewWeb, PreviewWithSelection, type PropDescriptor, type SelectionStore, StoryStore, UrlStore, type View, WebView, addons, applyHooks, combineArgs, combineParameters, composeConfigs, composeStepRunners, composeStories, composeStory, createPlaywrightTest, decorateStory, defaultDecorateStory, filterArgTypes, inferControls, makeDecorator, mockChannel, normalizeStory, prepareMeta, prepareStory, sanitizeStoryContextUpdate, setProjectAnnotations, simulateDOMContentLoaded, simulatePageLoad, sortStoriesV7, useArgs, useCallback, useChannel, useEffect, useGlobals, useMemo, useParameter, useReducer, useRef, useState, useStoryContext, userOrAutoTitle, userOrAutoTitleFromSpecifier }; | ||
export { DocsContext, HooksContext, Preview, PreviewWeb, PreviewWithSelection, type PropDescriptor, type SelectionStore, StoryStore, UrlStore, type View, WebView, addons, applyHooks, combineArgs, combineParameters, composeConfigs, composeStepRunners, composeStories, composeStory, createPlaywrightTest, decorateStory, defaultDecorateStory, filterArgTypes, inferControls, makeDecorator, mockChannel, normalizeStory, prepareMeta, prepareStory, sanitizeStoryContextUpdate, setDefaultProjectAnnotations, setProjectAnnotations, simulateDOMContentLoaded, simulatePageLoad, sortStoriesV7, useArgs, useCallback, useChannel, useEffect, useGlobals, useMemo, useParameter, useReducer, useRef, useState, useStoryContext, userOrAutoTitle, userOrAutoTitleFromSpecifier }; |
@@ -152,5 +152,2 @@ declare abstract class StorybookError extends Error { | ||
} | ||
declare class TestingLibraryMustBeConfiguredError extends StorybookError { | ||
constructor(); | ||
} | ||
declare class NoRenderFunctionError extends StorybookError { | ||
@@ -189,2 +186,2 @@ data: { | ||
export { CalledExtractOnStoreError, CalledPreviewMethodBeforeInitializationError, Category, EmptyIndexError, ImplicitActionsDuringRendering, MdxFileWithNoCsfReferencesError, MissingRenderToCanvasError, MissingStoryAfterHmrError, MissingStoryFromCsfFileError, MountMustBeDestructuredError, NextJsSharpError, NextjsRouterMocksNotAvailable, NoRenderFunctionError, NoStoryMatchError, NoStoryMountedError, StoryIndexFetchError, StoryStoreAccessedBeforeInitializationError, TestingLibraryMustBeConfiguredError, UnknownArgTypesError }; | ||
export { CalledExtractOnStoreError, CalledPreviewMethodBeforeInitializationError, Category, EmptyIndexError, ImplicitActionsDuringRendering, MdxFileWithNoCsfReferencesError, MissingRenderToCanvasError, MissingStoryAfterHmrError, MissingStoryFromCsfFileError, MountMustBeDestructuredError, NextJsSharpError, NextjsRouterMocksNotAvailable, NoRenderFunctionError, NoStoryMatchError, NoStoryMountedError, StoryIndexFetchError, StoryStoreAccessedBeforeInitializationError, UnknownArgTypesError }; |
@@ -1,22 +0,22 @@ | ||
var oe = Object.defineProperty; | ||
var t = (u, n) => oe(u, "name", { value: n, configurable: !0 }); | ||
var ee = Object.defineProperty; | ||
var t = (u, r) => ee(u, "name", { value: r, configurable: !0 }); | ||
// ../node_modules/ts-dedent/esm/index.js | ||
function r(u) { | ||
for (var n = [], e = 1; e < arguments.length; e++) | ||
n[e - 1] = arguments[e]; | ||
function n(u) { | ||
for (var r = [], e = 1; e < arguments.length; e++) | ||
r[e - 1] = arguments[e]; | ||
var a = Array.from(typeof u == "string" ? [u] : u); | ||
a[a.length - 1] = a[a.length - 1].replace(/\r?\n([\t ]*)$/, ""); | ||
var p = a.reduce(function(i, h) { | ||
var y = h.match(/\n([\t ]+|(?!\s).)/g); | ||
return y ? i.concat(y.map(function(E) { | ||
var d, l; | ||
return (l = (d = E.match(/[\t ]/g)) === null || d === void 0 ? void 0 : d.length) !== null && l !== void 0 ? l : 0; | ||
var p = a.reduce(function(i, E) { | ||
var y = E.match(/\n([\t ]+|(?!\s).)/g); | ||
return y ? i.concat(y.map(function(m) { | ||
var l, d; | ||
return (d = (l = m.match(/[\t ]/g)) === null || l === void 0 ? void 0 : l.length) !== null && d !== void 0 ? d : 0; | ||
})) : i; | ||
}, []); | ||
if (p.length) { | ||
var m = new RegExp(` | ||
var h = new RegExp(` | ||
[ ]{` + Math.min.apply(Math, p) + "}", "g"); | ||
a = a.map(function(i) { | ||
return i.replace(m, ` | ||
return i.replace(h, ` | ||
`); | ||
@@ -27,13 +27,13 @@ }); | ||
var c = a[0]; | ||
return n.forEach(function(i, h) { | ||
var y = c.match(/(?:^|\n)( *)$/), E = y ? y[1] : "", d = i; | ||
return r.forEach(function(i, E) { | ||
var y = c.match(/(?:^|\n)( *)$/), m = y ? y[1] : "", l = i; | ||
typeof i == "string" && i.includes(` | ||
`) && (d = String(i).split(` | ||
`).map(function(l, te) { | ||
return te === 0 ? l : "" + E + l; | ||
`) && (l = String(i).split(` | ||
`).map(function(d, Z) { | ||
return Z === 0 ? d : "" + m + d; | ||
}).join(` | ||
`)), c += d + a[h + 1]; | ||
`)), c += l + a[E + 1]; | ||
}), c; | ||
} | ||
t(r, "dedent"); | ||
t(n, "dedent"); | ||
@@ -43,6 +43,6 @@ // src/storybook-error.ts | ||
code: u, | ||
category: n | ||
category: r | ||
}) { | ||
let e = String(u).padStart(4, "0"); | ||
return `SB_${n}_${e}`; | ||
return `SB_${r}_${e}`; | ||
} | ||
@@ -80,3 +80,3 @@ t(O, "parseErrorCode"); | ||
category: p, | ||
message: m | ||
message: h | ||
}) { | ||
@@ -87,3 +87,3 @@ let c; | ||
${e.map((i) => ` - ${i}`).join(` | ||
`)}`), `${m}${c != null ? ` | ||
`)}`), `${h}${c != null ? ` | ||
@@ -98,3 +98,3 @@ More info: ${c} | ||
// src/preview-errors.ts | ||
var se = /* @__PURE__ */ ((s) => (s.BLOCKS = "BLOCKS", s.DOCS_TOOLS = "DOCS-TOOLS", s.PREVIEW_CLIENT_LOGGER = "PREVIEW_CLIENT-LOGGER", s.PREVIEW_CHANNELS = | ||
var te = /* @__PURE__ */ ((s) => (s.BLOCKS = "BLOCKS", s.DOCS_TOOLS = "DOCS-TOOLS", s.PREVIEW_CLIENT_LOGGER = "PREVIEW_CLIENT-LOGGER", s.PREVIEW_CHANNELS = | ||
"PREVIEW_CHANNELS", s.PREVIEW_CORE_EVENTS = "PREVIEW_CORE-EVENTS", s.PREVIEW_INSTRUMENTER = "PREVIEW_INSTRUMENTER", s.PREVIEW_API = "PREVIEW\ | ||
@@ -104,3 +104,3 @@ _API", s.PREVIEW_REACT_DOM_SHIM = "PREVIEW_REACT-DOM-SHIM", s.PREVIEW_ROUTER = "PREVIEW_ROUTER", s.PREVIEW_THEMING = "PREVIEW_THEMING", s.RENDERER_HTML = | ||
"RENDERER_SVELTE", s.RENDERER_VUE = "RENDERER_VUE", s.RENDERER_VUE3 = "RENDERER_VUE3", s.RENDERER_WEB_COMPONENTS = "RENDERER_WEB-COMPONENTS", | ||
s.FRAMEWORK_NEXTJS = "FRAMEWORK_NEXTJS", s))(se || {}), f = class f extends o { | ||
s.FRAMEWORK_NEXTJS = "FRAMEWORK_NEXTJS", s))(te || {}), f = class f extends o { | ||
constructor(e) { | ||
@@ -110,3 +110,3 @@ super({ | ||
code: 1, | ||
message: r` | ||
message: n` | ||
Couldn't find story matching id '${e.storyId}' after HMR. | ||
@@ -123,3 +123,3 @@ - Did you just rename a story? | ||
t(f, "MissingStoryAfterHmrError"); | ||
var D = f, R = class R extends o { | ||
var C = f, R = class R extends o { | ||
constructor(e) { | ||
@@ -131,3 +131,3 @@ super({ | ||
for-example-in-the-play-function", | ||
message: r` | ||
message: n` | ||
We detected that you use an implicit action arg while ${e.phase} of your story. | ||
@@ -148,3 +148,3 @@ ${e.deprecated ? ` | ||
t(R, "ImplicitActionsDuringRendering"); | ||
var j = R, b = class b extends o { | ||
var D = R, b = class b extends o { | ||
constructor() { | ||
@@ -154,3 +154,3 @@ super({ | ||
code: 3, | ||
message: r` | ||
message: n` | ||
Cannot call \`storyStore.extract()\` without calling \`storyStore.cacheAllCsfFiles()\` first. | ||
@@ -163,3 +163,3 @@ | ||
t(b, "CalledExtractOnStoreError"); | ||
var L = b, I = class I extends o { | ||
var j = b, I = class I extends o { | ||
constructor() { | ||
@@ -169,3 +169,3 @@ super({ | ||
code: 4, | ||
message: r` | ||
message: n` | ||
Expected your framework's preset to export a \`renderToCanvas\` field. | ||
@@ -179,3 +179,3 @@ | ||
t(I, "MissingRenderToCanvasError"); | ||
var F = I, P = class P extends o { | ||
var L = I, P = class P extends o { | ||
constructor(e) { | ||
@@ -185,3 +185,3 @@ super({ | ||
code: 5, | ||
message: r` | ||
message: n` | ||
Called \`Preview.${e.methodName}()\` before initialization. | ||
@@ -204,3 +204,3 @@ | ||
code: 6, | ||
message: r` | ||
message: n` | ||
Error fetching \`/index.json\`: | ||
@@ -220,3 +220,3 @@ | ||
t(x, "StoryIndexFetchError"); | ||
var Y = x, S = class S extends o { | ||
var M = x, w = class w extends o { | ||
constructor(e) { | ||
@@ -226,3 +226,3 @@ super({ | ||
code: 7, | ||
message: r` | ||
message: n` | ||
Tried to render docs entry ${e.storyId} but it is a MDX file that has no CSF | ||
@@ -237,4 +237,4 @@ references, or autodocs for a CSF file that some doesn't refer to itself. | ||
}; | ||
t(S, "MdxFileWithNoCsfReferencesError"); | ||
var H = S, w = class w extends o { | ||
t(w, "MdxFileWithNoCsfReferencesError"); | ||
var Y = w, T = class T extends o { | ||
constructor() { | ||
@@ -244,3 +244,3 @@ super({ | ||
code: 8, | ||
message: r` | ||
message: n` | ||
Couldn't find any stories in your Storybook. | ||
@@ -253,4 +253,4 @@ | ||
}; | ||
t(w, "EmptyIndexError"); | ||
var K = w, k = class k extends o { | ||
t(T, "EmptyIndexError"); | ||
var H = T, k = class k extends o { | ||
constructor(e) { | ||
@@ -260,3 +260,3 @@ super({ | ||
code: 9, | ||
message: r` | ||
message: n` | ||
Couldn't find story matching '${e.storySpecifier}'. | ||
@@ -272,3 +272,3 @@ | ||
t(k, "NoStoryMatchError"); | ||
var M = k, T = class T extends o { | ||
var F = k, S = class S extends o { | ||
constructor(e) { | ||
@@ -278,3 +278,3 @@ super({ | ||
code: 10, | ||
message: r` | ||
message: n` | ||
Couldn't find story matching id '${e.storyId}' after importing a CSF file. | ||
@@ -292,4 +292,4 @@ | ||
}; | ||
t(T, "MissingStoryFromCsfFileError"); | ||
var U = T, V = class V extends o { | ||
t(S, "MissingStoryFromCsfFileError"); | ||
var K = S, V = class V extends o { | ||
constructor() { | ||
@@ -299,3 +299,3 @@ super({ | ||
code: 11, | ||
message: r` | ||
message: n` | ||
Cannot access the Story Store until the index is ready. | ||
@@ -309,3 +309,3 @@ | ||
t(V, "StoryStoreAccessedBeforeInitializationError"); | ||
var X = V, _ = class _ extends o { | ||
var U = V, _ = class _ extends o { | ||
constructor(e) { | ||
@@ -315,3 +315,3 @@ super({ | ||
code: 12, | ||
message: r` | ||
message: n` | ||
Incorrect use of mount in the play function. | ||
@@ -339,39 +339,3 @@ | ||
t(_, "MountMustBeDestructuredError"); | ||
var J = _, v = class v extends o { | ||
constructor() { | ||
super({ | ||
category: "PREVIEW_API", | ||
code: 13, | ||
message: r` | ||
You must configure testingLibraryRender to use play in portable stories. | ||
import { render } from '@testing-library/[renderer]'; | ||
setProjectAnnotations({ | ||
testingLibraryRender: render, | ||
}); | ||
For other testing renderers, you can configure \`renderToCanvas\` like so: | ||
import { render } from 'your-test-renderer'; | ||
setProjectAnnotations({ | ||
renderToCanvas: ({ storyFn }) => { | ||
const Story = storyFn(); | ||
// Svelte | ||
render(Story.Component, Story.props); | ||
// Vue | ||
render(Story); | ||
// or for React | ||
render(<Story/>); | ||
}, | ||
});` | ||
}); | ||
} | ||
}; | ||
t(v, "TestingLibraryMustBeConfiguredError"); | ||
var q = v, W = class W extends o { | ||
var X = _, v = class v extends o { | ||
constructor(e) { | ||
@@ -381,3 +345,3 @@ super({ | ||
code: 14, | ||
message: r` | ||
message: n` | ||
No render function available for storyId '${e.id}' | ||
@@ -389,4 +353,4 @@ ` | ||
}; | ||
t(W, "NoRenderFunctionError"); | ||
var z = W, A = class A extends o { | ||
t(v, "NoRenderFunctionError"); | ||
var J = v, N = class N extends o { | ||
constructor() { | ||
@@ -396,3 +360,3 @@ super({ | ||
code: 15, | ||
message: r` | ||
message: n` | ||
No component is mounted in your story. | ||
@@ -416,4 +380,4 @@ | ||
}; | ||
t(A, "NoStoryMountedError"); | ||
var Q = A, N = class N extends o { | ||
t(N, "NoStoryMountedError"); | ||
var q = N, W = class W extends o { | ||
constructor() { | ||
@@ -424,3 +388,3 @@ super({ | ||
documentation: "https://storybook.js.org/docs/get-started/nextjs#faq", | ||
message: r` | ||
message: n` | ||
You are importing avif images, but you don't have sharp installed. | ||
@@ -433,4 +397,4 @@ | ||
}; | ||
t(N, "NextJsSharpError"); | ||
var Z = N, $ = class $ extends o { | ||
t(W, "NextJsSharpError"); | ||
var z = W, A = class A extends o { | ||
constructor(e) { | ||
@@ -440,3 +404,3 @@ super({ | ||
code: 2, | ||
message: r` | ||
message: n` | ||
Tried to access router mocks from "${e.importType}" but they were not created yet. You might be running code in an unsupported environment. | ||
@@ -448,4 +412,4 @@ ` | ||
}; | ||
t($, "NextjsRouterMocksNotAvailable"); | ||
var B = $, C = class C extends o { | ||
t(A, "NextjsRouterMocksNotAvailable"); | ||
var B = A, $ = class $ extends o { | ||
constructor(e) { | ||
@@ -456,3 +420,3 @@ super({ | ||
documentation: "https://github.com/storybookjs/storybook/issues/26606", | ||
message: r` | ||
message: n` | ||
There was a failure when generating detailed ArgTypes in ${e.language} for: | ||
@@ -470,24 +434,23 @@ ${JSON.stringify(e.type, null, 2)} | ||
}; | ||
t(C, "UnknownArgTypesError"); | ||
var ee = C; | ||
t($, "UnknownArgTypesError"); | ||
var Q = $; | ||
export { | ||
L as CalledExtractOnStoreError, | ||
j as CalledExtractOnStoreError, | ||
G as CalledPreviewMethodBeforeInitializationError, | ||
se as Category, | ||
K as EmptyIndexError, | ||
j as ImplicitActionsDuringRendering, | ||
H as MdxFileWithNoCsfReferencesError, | ||
F as MissingRenderToCanvasError, | ||
D as MissingStoryAfterHmrError, | ||
U as MissingStoryFromCsfFileError, | ||
J as MountMustBeDestructuredError, | ||
Z as NextJsSharpError, | ||
te as Category, | ||
H as EmptyIndexError, | ||
D as ImplicitActionsDuringRendering, | ||
Y as MdxFileWithNoCsfReferencesError, | ||
L as MissingRenderToCanvasError, | ||
C as MissingStoryAfterHmrError, | ||
K as MissingStoryFromCsfFileError, | ||
X as MountMustBeDestructuredError, | ||
z as NextJsSharpError, | ||
B as NextjsRouterMocksNotAvailable, | ||
z as NoRenderFunctionError, | ||
M as NoStoryMatchError, | ||
Q as NoStoryMountedError, | ||
Y as StoryIndexFetchError, | ||
X as StoryStoreAccessedBeforeInitializationError, | ||
q as TestingLibraryMustBeConfiguredError, | ||
ee as UnknownArgTypesError | ||
J as NoRenderFunctionError, | ||
F as NoStoryMatchError, | ||
q as NoStoryMountedError, | ||
M as StoryIndexFetchError, | ||
U as StoryStoreAccessedBeforeInitializationError, | ||
Q as UnknownArgTypesError | ||
}; |
{ | ||
"name": "@storybook/core", | ||
"version": "0.0.0-pr-28768-sha-89e4a1ff", | ||
"version": "0.0.0-pr-28768-sha-9b4d61ce", | ||
"description": "Storybook framework-agnostic API", | ||
@@ -155,2 +155,12 @@ "keywords": [ | ||
}, | ||
"./cli": { | ||
"types": "./dist/cli/index.d.ts", | ||
"import": "./dist/cli/index.js", | ||
"require": "./dist/cli/index.cjs" | ||
}, | ||
"./cli/bin": { | ||
"types": "./dist/cli/bin/index.d.ts", | ||
"import": "./dist/cli/bin/index.js", | ||
"require": "./dist/cli/bin/index.cjs" | ||
}, | ||
"./package.json": "./package.json" | ||
@@ -243,2 +253,8 @@ }, | ||
"./dist/preview/globals.d.ts" | ||
], | ||
"cli": [ | ||
"./dist/cli/index.d.ts" | ||
], | ||
"cli/bin": [ | ||
"./dist/cli/bin/index.d.ts" | ||
] | ||
@@ -267,3 +283,3 @@ } | ||
"recast": "^0.23.5", | ||
"util": "^0.12.4", | ||
"semver": "^7.6.2", | ||
"ws": "^8.2.3" | ||
@@ -286,3 +302,3 @@ }, | ||
"@fal-works/esbuild-plugin-global-externals": "^2.1.2", | ||
"@ndelangen/fs-extra-unified": "^1.0.3", | ||
"@ndelangen/get-tarball": "^3.0.7", | ||
"@popperjs/core": "^2.6.0", | ||
@@ -311,8 +327,8 @@ "@radix-ui/react-dialog": "^1.0.5", | ||
"@types/pretty-hrtime": "^1.0.0", | ||
"@types/prompts": "^2.0.9", | ||
"@types/qs": "^6", | ||
"@types/react-syntax-highlighter": "11.0.5", | ||
"@types/react-transition-group": "^4", | ||
"@types/semver": "^7.3.4", | ||
"@types/semver": "^7.5.8", | ||
"@types/ws": "^8", | ||
"@vitest/utils": "^1.3.1", | ||
"@yarnpkg/esbuild-plugin-pnp": "^3.0.0-rc.10", | ||
@@ -331,2 +347,3 @@ "@yarnpkg/fslib": "2.10.3", | ||
"cli-table3": "^0.6.1", | ||
"commander": "^6.2.1", | ||
"comment-parser": "^1.4.1", | ||
@@ -339,2 +356,3 @@ "compression": "^1.7.4", | ||
"dequal": "^2.0.2", | ||
"detect-indent": "^7.0.1", | ||
"detect-package-manager": "^3.0.2", | ||
@@ -357,2 +375,3 @@ "detect-port": "^1.3.0", | ||
"fuse.js": "^3.6.1", | ||
"get-npm-tarball-url": "^2.0.3", | ||
"glob": "^10.0.0", | ||
@@ -364,2 +383,3 @@ "globby": "^14.0.1", | ||
"lazy-universal-dotenv": "^4.0.0", | ||
"leven": "^4.0.0", | ||
"lodash": "^4.17.21", | ||
@@ -390,5 +410,5 @@ "markdown-to-jsx": "^7.4.5", | ||
"resolve-from": "^5.0.0", | ||
"semver": "^7.3.7", | ||
"slash": "^5.0.0", | ||
"store2": "^2.14.2", | ||
"strip-json-comments": "^5.0.1", | ||
"telejson": "^7.2.0", | ||
@@ -395,0 +415,0 @@ "tiny-invariant": "^1.3.1", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 6 instances in 1 package
Uses eval
Supply chain riskPackage uses eval() which is a dangerous function. This prevents the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses eval() which is a dangerous function. This prevents the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
38405481
97
690378
130
9
256
84
+ Addedsemver@^7.6.2
+ Addedsemver@7.6.3(transitive)
- Removedutil@^0.12.4
- Removedavailable-typed-arrays@1.0.7(transitive)
- Removedfor-each@0.3.3(transitive)
- Removedhas-tostringtag@1.0.2(transitive)
- Removedis-arguments@1.1.1(transitive)
- Removedis-callable@1.2.7(transitive)
- Removedis-generator-function@1.0.10(transitive)
- Removedis-typed-array@1.1.13(transitive)
- Removedpossible-typed-array-names@1.0.0(transitive)
- Removedutil@0.12.5(transitive)
- Removedwhich-typed-array@1.1.15(transitive)