storybook
Advanced tools
@@ -7,4 +7,4 @@ import ESM_COMPAT_Module from "node:module"; | ||
const require = ESM_COMPAT_Module.createRequire(import.meta.url); | ||
var a = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { | ||
get: (c, o) => (typeof require < "u" ? require : c)[o] | ||
var b = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { | ||
get: (a, o) => (typeof require < "u" ? require : a)[o] | ||
}) : e)(function(e) { | ||
@@ -16,72 +16,72 @@ if (typeof require < "u") return require.apply(this, arguments); | ||
// src/bin/index.ts | ||
import { spawn as y } from "node:child_process"; | ||
import { spawn as h } from "node:child_process"; | ||
import { readFileSync as p } from "node:fs"; | ||
import { dirname as b, join as k } from "node:path"; | ||
import { dirname as k, join as y } from "node:path"; | ||
// src/common/versions.ts | ||
var s = { | ||
"@storybook/addon-a11y": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/addon-actions": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/addon-backgrounds": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/addon-controls": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/addon-docs": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/addon-essentials": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/addon-mdx-gfm": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/addon-highlight": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/addon-interactions": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/addon-jest": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/addon-links": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/addon-measure": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/addon-onboarding": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/addon-outline": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/addon-storysource": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/addon-test": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/addon-themes": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/addon-toolbars": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/addon-viewport": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/builder-vite": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/builder-webpack5": "0.0.0-pr-30761-sha-c5072ae0", | ||
storybook: "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/angular": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/ember": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/experimental-nextjs-vite": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/html-vite": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/html-webpack5": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/nextjs": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/preact-vite": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/preact-webpack5": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/react-native-web-vite": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/react-vite": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/react-webpack5": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/server-webpack5": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/svelte-vite": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/svelte-webpack5": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/sveltekit": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/vue3-vite": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/vue3-webpack5": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/web-components-vite": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/web-components-webpack5": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/blocks": "0.0.0-pr-30761-sha-c5072ae0", | ||
sb: "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/cli": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/codemod": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/core-webpack": "0.0.0-pr-30761-sha-c5072ae0", | ||
"create-storybook": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/csf-plugin": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/react-dom-shim": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/source-loader": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/preset-create-react-app": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/preset-html-webpack": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/preset-preact-webpack": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/preset-react-webpack": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/preset-server-webpack": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/preset-svelte-webpack": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/preset-vue3-webpack": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/html": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/preact": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/react": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/server": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/svelte": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/vue3": "0.0.0-pr-30761-sha-c5072ae0", | ||
"@storybook/web-components": "0.0.0-pr-30761-sha-c5072ae0" | ||
"@storybook/addon-a11y": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/addon-actions": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/addon-backgrounds": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/addon-controls": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/addon-docs": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/addon-essentials": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/addon-mdx-gfm": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/addon-highlight": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/addon-interactions": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/addon-jest": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/addon-links": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/addon-measure": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/addon-onboarding": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/addon-outline": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/addon-storysource": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/addon-test": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/addon-themes": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/addon-toolbars": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/addon-viewport": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/builder-vite": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/builder-webpack5": "0.0.0-pr-30764-sha-1b1e4113", | ||
storybook: "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/angular": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/ember": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/experimental-nextjs-vite": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/html-vite": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/html-webpack5": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/nextjs": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/preact-vite": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/preact-webpack5": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/react-native-web-vite": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/react-vite": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/react-webpack5": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/server-webpack5": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/svelte-vite": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/svelte-webpack5": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/sveltekit": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/vue3-vite": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/vue3-webpack5": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/web-components-vite": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/web-components-webpack5": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/blocks": "0.0.0-pr-30764-sha-1b1e4113", | ||
sb: "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/cli": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/codemod": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/core-webpack": "0.0.0-pr-30764-sha-1b1e4113", | ||
"create-storybook": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/csf-plugin": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/react-dom-shim": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/source-loader": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/preset-create-react-app": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/preset-html-webpack": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/preset-preact-webpack": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/preset-react-webpack": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/preset-server-webpack": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/preset-svelte-webpack": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/preset-vue3-webpack": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/html": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/preact": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/react": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/server": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/svelte": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/vue3": "0.0.0-pr-30764-sha-1b1e4113", | ||
"@storybook/web-components": "0.0.0-pr-30764-sha-1b1e4113" | ||
}; | ||
@@ -92,3 +92,3 @@ | ||
if (["dev", "build", "index"].includes(r[0])) | ||
a("storybook/internal/cli/bin"); | ||
b("storybook/internal/cli/bin"); | ||
else { | ||
@@ -99,3 +99,3 @@ let e; | ||
try { | ||
o = a.resolve("create-storybook/package.json"); | ||
o = b.resolve("create-storybook/package.json"); | ||
} catch { | ||
@@ -105,3 +105,3 @@ } | ||
"node", | ||
k(b(o), "bin", "index.cjs"), | ||
y(k(o), "bin", "index.cjs"), | ||
...r.slice(1) | ||
@@ -112,9 +112,9 @@ ]) : e = ["npx", "--yes", `create-storybook@${s.storybook}`, ...r.slice(1)]; | ||
try { | ||
o = a.resolve("@storybook/cli/package.json"); | ||
o = b.resolve("@storybook/cli/package.json"); | ||
} catch { | ||
} | ||
o ? JSON.parse(p(o, "utf-8")).version === s["@storybook/cli"] && (e = ["node", k(b(o), "bin", "index.cjs"), ...r]) : e = ["npx", "--yes", | ||
o ? JSON.parse(p(o, "utf-8")).version === s["@storybook/cli"] && (e = ["node", y(k(o), "bin", "index.cjs"), ...r]) : e = ["npx", "--yes", | ||
`@storybook/cli@${s.storybook}`, ...r]; | ||
} | ||
e || (console.error("Could not run storybook cli, please report this as a bug"), process.exit(1)), y(e[0], e.slice(1), { stdio: "inherit", | ||
e || (console.error("Could not run storybook cli, please report this as a bug"), process.exit(1)), h(e[0], e.slice(1), { stdio: "inherit", | ||
shell: !0 }).on("exit", (o) => { | ||
@@ -121,0 +121,0 @@ o != null && process.exit(o), process.exit(1); |
@@ -130,3 +130,3 @@ import { PackageJsonWithMaybeDeps, JsPackageManager, PackageJsonWithDepsAndDevDeps, PackageJson } from 'storybook/internal/common'; | ||
packageManager: JsPackageManager; | ||
renderer: SupportedFrameworks | SupportedRenderers$1; | ||
templateLocation: SupportedFrameworks | SupportedRenderers$1; | ||
language: SupportedLanguage; | ||
@@ -146,3 +146,3 @@ commonAssetsDir?: string; | ||
declare const cliStoriesTargetPath: () => Promise<"./src/stories" | "./stories">; | ||
declare function copyTemplateFiles({ packageManager, renderer, language, destination, commonAssetsDir, features, }: CopyTemplateFilesOptions): Promise<void>; | ||
declare function copyTemplateFiles({ packageManager, templateLocation, language, destination, commonAssetsDir, features, }: CopyTemplateFilesOptions): Promise<void>; | ||
declare function adjustTemplate(templatePath: string, templateData: Record<string, any>): Promise<void>; | ||
@@ -149,0 +149,0 @@ declare function getStorybookVersionSpecifier(packageJson: PackageJsonWithDepsAndDevDeps): string | undefined; |
import { ArgTypes } from 'storybook/internal/csf'; | ||
import { Addon_TestProviderType, Addon_TestProviderState, NormalizedProjectAnnotations, ProjectAnnotations, ComposedStoryFn } from 'storybook/internal/types'; | ||
import { Addon_TestProviderType, Addon_TestProviderState } from 'storybook/internal/types'; | ||
import { Report } from 'storybook/internal/preview-api'; | ||
@@ -155,25 +156,2 @@ interface CreateNewStoryRequestPayload { | ||
declare global { | ||
var globalProjectAnnotations: NormalizedProjectAnnotations<any>; | ||
var defaultProjectAnnotations: ProjectAnnotations<any>; | ||
} | ||
type WrappedStoryRef = { | ||
__pw_type: 'jsx' | 'importRef'; | ||
}; | ||
type UnwrappedJSXStoryRef = { | ||
__pw_type: 'jsx'; | ||
type: UnwrappedImportStoryRef; | ||
}; | ||
type UnwrappedImportStoryRef = ComposedStoryFn; | ||
declare global { | ||
function __pwUnwrapObject(storyRef: WrappedStoryRef): Promise<UnwrappedJSXStoryRef | UnwrappedImportStoryRef>; | ||
} | ||
interface Report<T = unknown> { | ||
type: string; | ||
version?: number; | ||
result: T; | ||
status: 'failed' | 'passed' | 'warning'; | ||
} | ||
interface StoryFinishedPayload { | ||
@@ -180,0 +158,0 @@ storyId: string; |
import { loadAllPresets } from 'storybook/internal/common'; | ||
export { getPreviewBodyTemplate, getPreviewHeadTemplate } from 'storybook/internal/common'; | ||
import * as storybook_internal_types from 'storybook/internal/types'; | ||
import { CLIOptions, LoadOptions, BuilderOptions, StorybookConfigRaw, IndexInputStats, NormalizedStoriesSpecifier, Path, Indexer, DocsOptions, StoryIndexEntry, DocsIndexEntry, Tag, IndexEntry, StoryIndex, Options } from 'storybook/internal/types'; | ||
import { CLIOptions, LoadOptions, BuilderOptions, StorybookConfigRaw, IndexInputStats, NormalizedStoriesSpecifier, Path, Indexer, DocsOptions, StoryIndexEntry, DocsIndexEntry, Tag, IndexEntry, StoryIndex, Options, NormalizedProjectAnnotations, ProjectAnnotations, ComposedStoryFn } from 'storybook/internal/types'; | ||
import { EventType } from 'storybook/internal/telemetry'; | ||
import { Channel } from 'storybook/internal/channels'; | ||
import { StoryId } from 'storybook/internal/csf'; | ||
@@ -462,2 +463,54 @@ type BuildStaticStandaloneOptions = CLIOptions & LoadOptions & BuilderOptions & { | ||
export { type BuildIndexOptions, type BuildStaticStandaloneOptions, StoryIndexGenerator, build, buildDevStandalone, buildIndex, buildIndexStandalone, buildStaticStandalone, MockUniversalStore as experimental_MockUniversalStore, UniversalStore as experimental_UniversalStore, loadStorybook as experimental_loadStorybook, getErrorLevel, mapStaticDir, sendTelemetryError, withTelemetry }; | ||
declare global { | ||
interface SymbolConstructor { | ||
readonly observable: symbol; | ||
} | ||
} | ||
declare global { | ||
var globalProjectAnnotations: NormalizedProjectAnnotations<any>; | ||
var defaultProjectAnnotations: ProjectAnnotations<any>; | ||
} | ||
type WrappedStoryRef = { | ||
__pw_type: 'jsx' | 'importRef'; | ||
}; | ||
type UnwrappedJSXStoryRef = { | ||
__pw_type: 'jsx'; | ||
type: UnwrappedImportStoryRef; | ||
}; | ||
type UnwrappedImportStoryRef = ComposedStoryFn; | ||
declare global { | ||
function __pwUnwrapObject(storyRef: WrappedStoryRef): Promise<UnwrappedJSXStoryRef | UnwrappedImportStoryRef>; | ||
} | ||
type StatusValue = 'status-value:pending' | 'status-value:success' | 'status-value:error' | 'status-value:warn' | 'status-value:unknown'; | ||
type StatusTypeId = string; | ||
type StatusByTypeId = Record<StatusTypeId, Status>; | ||
type StatusesByStoryIdAndTypeId = Record<StoryId, StatusByTypeId>; | ||
interface Status { | ||
value: StatusValue; | ||
typeId: StatusTypeId; | ||
storyId: StoryId; | ||
title: string; | ||
description: string; | ||
data?: any; | ||
sidebarContextMenu?: boolean; | ||
} | ||
type StatusStore = { | ||
getAll: () => StatusesByStoryIdAndTypeId; | ||
set: (statuses: Status[]) => void; | ||
onAllStatusChange: (listener: (statuses: StatusesByStoryIdAndTypeId, previousStatuses: StatusesByStoryIdAndTypeId) => void) => () => void; | ||
onSelect: (listener: (selectedStatuses: Status[]) => void) => () => void; | ||
unset: (storyIds?: StoryId[]) => void; | ||
}; | ||
type StatusStoreByTypeId = StatusStore & { | ||
typeId: StatusTypeId; | ||
}; | ||
declare const fullStatusStore: StatusStore & { | ||
selectStatuses: (statuses: Status[]) => void; | ||
typeId: undefined; | ||
}; | ||
declare const getStatusStoreByTypeId: (typeId: StatusTypeId) => StatusStoreByTypeId; | ||
export { type BuildIndexOptions, type BuildStaticStandaloneOptions, StoryIndexGenerator, build, buildDevStandalone, buildIndex, buildIndexStandalone, buildStaticStandalone, MockUniversalStore as experimental_MockUniversalStore, UniversalStore as experimental_UniversalStore, getStatusStoreByTypeId as experimental_getStatusStore, loadStorybook as experimental_loadStorybook, getErrorLevel, fullStatusStore as internal_fullStatusStore, mapStaticDir, sendTelemetryError, withTelemetry }; |
@@ -5,7 +5,7 @@ import React, { FC, ReactNode, ReactElement, Component } from 'react'; | ||
import { RouterData, NavigateOptions } from 'storybook/internal/router'; | ||
import { Addon_Types, Addon_TypesEnum, Addon_Collection, Addon_TypesMapping, Addon_BaseType, Addon_SidebarTopType, Addon_SidebarBottomType, Addon_TestProviderType, Addon_PageType, Addon_WrapperType, Addon_Config, API_ProviderData, API_StateMerger, API_Provider, StoryId, Globals, GlobalTypes, API_PanelPositions, API_Layout, API_UI, API_Notification, API_IframeRenderer, API_ComposedRef, API_SetRefData, API_ComposedRefUpdate, API_Refs, API_Settings, API_HashEntry, API_ViewMode, API_LeafEntry, API_PreparedStoryIndex, API_StoryEntry, Args, API_IndexHash, API_DocsEntry, API_StatusObject, API_StatusUpdate, API_StatusState, API_FilterFunction, API_LoadedRefData, API_Version, API_Versions, API_UnknownEntries, API_OptionsData, Parameters, ArgTypes } from 'storybook/internal/types'; | ||
import { Addon_Types, Addon_TypesEnum, Addon_Collection, Addon_TypesMapping, Addon_BaseType, Addon_SidebarTopType, Addon_SidebarBottomType, Addon_TestProviderType, Addon_PageType, Addon_WrapperType, Addon_Config, API_ProviderData, API_StateMerger, API_Provider, StoryId, Globals, GlobalTypes, API_PanelPositions, API_Layout, API_UI, API_Notification, API_IframeRenderer, API_ComposedRef, API_SetRefData, API_ComposedRefUpdate, API_Refs, API_Settings, API_HashEntry, API_ViewMode, API_LeafEntry, API_PreparedStoryIndex, API_StoryEntry, Args, API_IndexHash, API_DocsEntry, API_FilterFunction, API_LoadedRefData, API_Version, API_Versions, API_UnknownEntries, NormalizedProjectAnnotations, ProjectAnnotations, ComposedStoryFn, API_OptionsData, Parameters, ArgTypes } from 'storybook/internal/types'; | ||
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'; | ||
import { TestProviderState, TestProviderId, TestProviders, WhatsNewData } from 'storybook/internal/core-events'; | ||
import { ThemeVars } from 'storybook/internal/theming'; | ||
import { toId } from 'storybook/internal/csf'; | ||
import { toId, StoryId as StoryId$1 } from 'storybook/internal/csf'; | ||
@@ -395,3 +395,3 @@ declare function mockChannel(): Channel; | ||
declare const controlOrMetaSymbol: () => "⌘" | "ctrl"; | ||
declare const controlOrMetaKey: () => "control" | "meta"; | ||
declare const controlOrMetaKey: () => "meta" | "control"; | ||
declare const optionOrAltSymbol: () => "⌥" | "alt"; | ||
@@ -512,3 +512,2 @@ declare const isShortcutTaken: (arr1: string[], arr2: string[]) => boolean; | ||
viewMode: API_ViewMode; | ||
status: API_StatusState; | ||
filters: Record<string, API_FilterFunction>; | ||
@@ -701,16 +700,2 @@ } | ||
/** | ||
* Returns the current status of the stories. | ||
* | ||
* @returns {API_StatusState} The current status of the stories. | ||
*/ | ||
getCurrentStoryStatus: () => Record<string, API_StatusObject>; | ||
/** | ||
* Updates the status of a collection of stories. | ||
* | ||
* @param {string} addonId - The ID of the addon to update. | ||
* @param {StatusUpdate} update - An object containing the updated status information. | ||
* @returns {Promise<void>} A promise that resolves when the status has been updated. | ||
*/ | ||
experimental_updateStatus: (addonId: string, update: API_StatusUpdate | ((state: API_StatusState) => API_StatusUpdate)) => Promise<void>; | ||
/** | ||
* Updates the filtering of the index. | ||
@@ -1146,2 +1131,56 @@ * | ||
declare global { | ||
interface SymbolConstructor { | ||
readonly observable: symbol; | ||
} | ||
} | ||
declare global { | ||
var globalProjectAnnotations: NormalizedProjectAnnotations<any>; | ||
var defaultProjectAnnotations: ProjectAnnotations<any>; | ||
} | ||
type WrappedStoryRef = { | ||
__pw_type: 'jsx' | 'importRef'; | ||
}; | ||
type UnwrappedJSXStoryRef = { | ||
__pw_type: 'jsx'; | ||
type: UnwrappedImportStoryRef; | ||
}; | ||
type UnwrappedImportStoryRef = ComposedStoryFn; | ||
declare global { | ||
function __pwUnwrapObject(storyRef: WrappedStoryRef): Promise<UnwrappedJSXStoryRef | UnwrappedImportStoryRef>; | ||
} | ||
type StatusValue = 'status-value:pending' | 'status-value:success' | 'status-value:error' | 'status-value:warn' | 'status-value:unknown'; | ||
type StatusTypeId = string; | ||
type StatusByTypeId = Record<StatusTypeId, Status>; | ||
type StatusesByStoryIdAndTypeId = Record<StoryId$1, StatusByTypeId>; | ||
interface Status { | ||
value: StatusValue; | ||
typeId: StatusTypeId; | ||
storyId: StoryId$1; | ||
title: string; | ||
description: string; | ||
data?: any; | ||
sidebarContextMenu?: boolean; | ||
} | ||
type StatusStore = { | ||
getAll: () => StatusesByStoryIdAndTypeId; | ||
set: (statuses: Status[]) => void; | ||
onAllStatusChange: (listener: (statuses: StatusesByStoryIdAndTypeId, previousStatuses: StatusesByStoryIdAndTypeId) => void) => () => void; | ||
onSelect: (listener: (selectedStatuses: Status[]) => void) => () => void; | ||
unset: (storyIds?: StoryId$1[]) => void; | ||
}; | ||
type StatusStoreByTypeId = StatusStore & { | ||
typeId: StatusTypeId; | ||
}; | ||
type UseStatusStore = (selector?: (statuses: StatusesByStoryIdAndTypeId) => any) => any; | ||
declare const fullStatusStore: StatusStore & { | ||
selectStatuses: (statuses: Status[]) => void; | ||
typeId: undefined; | ||
}; | ||
declare const getStatusStoreByTypeId: (typeId: StatusTypeId) => StatusStoreByTypeId; | ||
declare const useStatusStore: UseStatusStore; | ||
declare const ActiveTabs: { | ||
@@ -1216,2 +1255,2 @@ SIDEBAR: "sidebar"; | ||
export { type API, type API_EventMap, 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, experimental_requestResponse, useUniversalStore as experimental_useUniversalStore, isMacLike, isShortcutTaken, keyToSymbol, _default as merge, mockChannel, optionOrAltSymbol, shortcutMatchesShortcut, shortcutToHumanString, typesX as types, useAddonState, useArgTypes, useArgs, useChannel, useGlobalTypes, useGlobals, useParameter, useSharedState, useStoryPrepared, useStorybookApi, useStorybookState }; | ||
export { type API, type API_EventMap, 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, experimental_requestResponse, useStatusStore as experimental_useStatusStore, useUniversalStore as experimental_useUniversalStore, fullStatusStore as internal_fullStatusStore, isMacLike, isShortcutTaken, keyToSymbol, _default as merge, mockChannel, optionOrAltSymbol, shortcutMatchesShortcut, shortcutToHumanString, typesX as types, useAddonState, useArgTypes, useArgs, useChannel, useGlobalTypes, useGlobals, useParameter, useSharedState, useStoryPrepared, useStorybookApi, useStorybookState }; |
@@ -0,1 +1,15 @@ | ||
import { StoryId } from 'storybook/internal/csf'; | ||
type StatusValue = 'status-value:pending' | 'status-value:success' | 'status-value:error' | 'status-value:warn' | 'status-value:unknown'; | ||
type StatusTypeId = string; | ||
interface Status { | ||
value: StatusValue; | ||
typeId: StatusTypeId; | ||
storyId: StoryId; | ||
title: string; | ||
description: string; | ||
data?: any; | ||
sidebarContextMenu?: boolean; | ||
} | ||
declare abstract class StorybookError extends Error { | ||
@@ -64,3 +78,13 @@ /** Category of the error. Used to classify the type of error, e.g., 'PREVIEW_API'. */ | ||
} | ||
declare class StatusTypeIdMismatchError extends StorybookError { | ||
data: { | ||
status: Status; | ||
typeId: StatusTypeId; | ||
}; | ||
constructor(data: { | ||
status: Status; | ||
typeId: StatusTypeId; | ||
}); | ||
} | ||
export { Category, ProviderDoesNotExtendBaseProviderError, UncaughtManagerError }; | ||
export { Category, ProviderDoesNotExtendBaseProviderError, StatusTypeIdMismatchError, UncaughtManagerError }; |
@@ -1,13 +0,13 @@ | ||
var g = Object.defineProperty; | ||
var t = (A, o) => g(A, "name", { value: o, configurable: !0 }); | ||
var R = Object.defineProperty; | ||
var r = (A, s) => R(A, "name", { value: s, configurable: !0 }); | ||
// src/storybook-error.ts | ||
function E({ | ||
function l({ | ||
code: A, | ||
category: o | ||
category: s | ||
}) { | ||
let e = String(A).padStart(4, "0"); | ||
return `SB_${o}_${e}`; | ||
return `SB_${s}_${e}`; | ||
} | ||
t(E, "parseErrorCode"); | ||
r(l, "parseErrorCode"); | ||
var c = class c extends Error { | ||
@@ -26,3 +26,3 @@ constructor(e) { | ||
get fullErrorCode() { | ||
return E({ code: this.code, category: this.category }); | ||
return l({ code: this.code, category: this.category }); | ||
} | ||
@@ -37,23 +37,23 @@ /** Overrides the default `Error.name` property in the format: SB_<CATEGORY>_<CODE>. */ | ||
documentation: e, | ||
code: u, | ||
category: d, | ||
code: p, | ||
category: y, | ||
message: G | ||
}) { | ||
let s; | ||
return e === !0 ? s = `https://storybook.js.org/error/${E({ code: u, category: d })}` : typeof e == "string" ? s = e : Array.isArray(e) && | ||
(s = ` | ||
${e.map((R) => ` - ${R}`).join(` | ||
`)}`), `${G}${s != null ? ` | ||
let n; | ||
return e === !0 ? n = `https://storybook.js.org/error/${l({ code: p, category: y })}` : typeof e == "string" ? n = e : Array.isArray(e) && | ||
(n = ` | ||
${e.map((g) => ` - ${g}`).join(` | ||
`)}`), `${G}${n != null ? ` | ||
More info: ${s} | ||
More info: ${n} | ||
` : ""}`; | ||
} | ||
}; | ||
t(c, "StorybookError"); | ||
var n = c; | ||
r(c, "StorybookError"); | ||
var o = c; | ||
// src/manager-errors.ts | ||
var M = /* @__PURE__ */ ((r) => (r.MANAGER_UNCAUGHT = "MANAGER_UNCAUGHT", r.MANAGER_UI = "MANAGER_UI", r.MANAGER_API = "MANAGER_API", r.MANAGER_CLIENT_LOGGER = | ||
"MANAGER_CLIENT-LOGGER", r.MANAGER_CHANNELS = "MANAGER_CHANNELS", r.MANAGER_CORE_EVENTS = "MANAGER_CORE-EVENTS", r.MANAGER_ROUTER = "MANAGER\ | ||
_ROUTER", r.MANAGER_THEMING = "MANAGER_THEMING", r))(M || {}), i = class i extends n { | ||
var M = /* @__PURE__ */ ((t) => (t.MANAGER_UNCAUGHT = "MANAGER_UNCAUGHT", t.MANAGER_UI = "MANAGER_UI", t.MANAGER_API = "MANAGER_API", t.MANAGER_CLIENT_LOGGER = | ||
"MANAGER_CLIENT-LOGGER", t.MANAGER_CHANNELS = "MANAGER_CHANNELS", t.MANAGER_CORE_EVENTS = "MANAGER_CORE-EVENTS", t.MANAGER_ROUTER = "MANAGER\ | ||
_ROUTER", t.MANAGER_THEMING = "MANAGER_THEMING", t))(M || {}), a = class a extends o { | ||
constructor() { | ||
@@ -67,4 +67,4 @@ super({ | ||
}; | ||
t(i, "ProviderDoesNotExtendBaseProviderError"); | ||
var l = i, a = class a extends n { | ||
r(a, "ProviderDoesNotExtendBaseProviderError"); | ||
var d = a, u = class u extends o { | ||
constructor(e) { | ||
@@ -80,8 +80,24 @@ super({ | ||
}; | ||
t(a, "UncaughtManagerError"); | ||
var N = a; | ||
r(u, "UncaughtManagerError"); | ||
var E = u, i = class i extends o { | ||
constructor(e) { | ||
super({ | ||
category: "MANAGER_API", | ||
code: 1, | ||
message: `Status has typeId "${e.status.typeId}" but was added to store with typeId "${e.typeId}". Full status: ${JSON.stringify( | ||
e.status, | ||
null, | ||
2 | ||
)}` | ||
}); | ||
this.data = e; | ||
} | ||
}; | ||
r(i, "StatusTypeIdMismatchError"); | ||
var N = i; | ||
export { | ||
M as Category, | ||
l as ProviderDoesNotExtendBaseProviderError, | ||
N as UncaughtManagerError | ||
d as ProviderDoesNotExtendBaseProviderError, | ||
N as StatusTypeIdMismatchError, | ||
E as UncaughtManagerError | ||
}; |
@@ -394,4 +394,7 @@ import ESM_COMPAT_Module from "node:module"; | ||
"experimental_UniversalStore", | ||
"experimental_getStatusStore", | ||
"experimental_requestResponse", | ||
"experimental_useStatusStore", | ||
"experimental_useUniversalStore", | ||
"internal_fullStatusStore", | ||
"isMacLike", | ||
@@ -617,2 +620,3 @@ "isShortcutTaken", | ||
"ProviderDoesNotExtendBaseProviderError", | ||
"StatusTypeIdMismatchError", | ||
"UncaughtManagerError" | ||
@@ -619,0 +623,0 @@ ], |
import { Channel } from 'storybook/internal/channels'; | ||
import * as storybook_internal_types from 'storybook/internal/types'; | ||
import { ProjectAnnotations, Renderer, Args, StoryContext, DecoratorApplicator, StoryId, Addon_StoryWrapper, PreparedStory, Globals, GlobalTypes, StoryIndex, StoryName, ComponentTitle, IndexEntry, Path, LegacyStoryAnnotationsOrFn, NormalizedComponentAnnotations, NormalizedStoryAnnotations, ModuleExports, CSFFile, NormalizedProjectAnnotations, ModuleExport, PreparedMeta, StepRunner, ComposedStoryFn, Store_CSFExports, ComposeStoryFn, ComponentAnnotations, NamedOrDefaultProjectAnnotations, ModuleImportFn, Parameters, StoryContextForEnhancers, StoryIndexV3, BoundStory, StrictArgTypes, ArgTypesEnhancer, LegacyStoryFn, DecoratorFunction, PartialStoryFn, StoryContextUpdate, NormalizedStoriesSpecifier, Addon_StorySortParameterV7, DocsContextProps, ResolvedModuleExportType, ResolvedModuleExportFromType, StoryRenderOptions, RenderContextCallbacks, RenderToCanvas, ViewMode } from 'storybook/internal/types'; | ||
import * as storybook_internal_csf from 'storybook/internal/csf'; | ||
import { CleanupCallback, Canvas } from 'storybook/internal/csf'; | ||
@@ -181,7 +180,7 @@ import { RequestData, ArgTypesRequestPayload } from 'storybook/internal/core-events'; | ||
declare function useEffect(create: () => (() => void) | void, deps?: any[]): void; | ||
interface Listener$1 { | ||
interface Listener { | ||
(...args: any[]): void; | ||
} | ||
interface EventMap { | ||
[eventId: string]: Listener$1; | ||
[eventId: string]: Listener; | ||
} | ||
@@ -316,308 +315,2 @@ /** | ||
type EnvironmentType = (typeof UniversalStore.Environment)[keyof typeof UniversalStore.Environment]; | ||
type StatusType = (typeof UniversalStore.Status)[keyof typeof UniversalStore.Status]; | ||
type StateUpdater<TState> = (prevState: TState) => TState; | ||
type Actor = { | ||
id: string; | ||
type: (typeof UniversalStore.ActorType)[keyof typeof UniversalStore.ActorType]; | ||
environment: EnvironmentType; | ||
}; | ||
type EventInfo = { | ||
actor: Actor; | ||
forwardingActor?: Actor; | ||
}; | ||
type Listener<TEvent> = (event: TEvent, eventInfo: EventInfo) => void; | ||
type BaseEvent = { | ||
type: string; | ||
payload?: any; | ||
}; | ||
interface SetStateEvent<TState> extends BaseEvent { | ||
type: typeof UniversalStore.InternalEventType.SET_STATE; | ||
payload: { | ||
state: TState; | ||
previousState: TState; | ||
}; | ||
} | ||
interface ExistingStateRequestEvent extends BaseEvent { | ||
type: typeof UniversalStore.InternalEventType.EXISTING_STATE_REQUEST; | ||
payload: never; | ||
} | ||
interface ExistingStateResponseEvent<TState> extends BaseEvent { | ||
type: typeof UniversalStore.InternalEventType.EXISTING_STATE_RESPONSE; | ||
payload: TState; | ||
} | ||
interface LeaderCreatedEvent extends BaseEvent { | ||
type: typeof UniversalStore.InternalEventType.LEADER_CREATED; | ||
payload: never; | ||
} | ||
interface FollowerCreatedEvent extends BaseEvent { | ||
type: typeof UniversalStore.InternalEventType.FOLLOWER_CREATED; | ||
payload: never; | ||
} | ||
type InternalEvent<TState> = SetStateEvent<TState> | ExistingStateRequestEvent | ExistingStateResponseEvent<TState> | FollowerCreatedEvent | LeaderCreatedEvent; | ||
type Event<TState, TEvent extends BaseEvent> = TEvent | InternalEvent<TState>; | ||
type ChannelLike = Pick<Channel, 'on' | 'off' | 'emit'>; | ||
type StoreOptions<TState> = { | ||
id: string; | ||
leader?: boolean; | ||
initialState?: TState; | ||
debug?: boolean; | ||
}; | ||
type EnvironmentOverrides = { | ||
channel: ChannelLike; | ||
environment: EnvironmentType; | ||
}; | ||
/** | ||
* A universal store implementation that synchronizes state across different environments using a | ||
* channel-based communication. | ||
* | ||
* The store follows a leader-follower pattern where: | ||
* | ||
* - Leader: The main store instance that owns and manages the state | ||
* - Follower: Store instances that mirror the leader's state | ||
* | ||
* Features: | ||
* | ||
* - State synchronization across environments | ||
* - Event-based communication | ||
* - Type-safe state and custom events | ||
* - Subscription system for state changes and custom events | ||
* | ||
* @remarks | ||
* - The store must be created using the static `create()` method, not the constructor | ||
* - Follower stores will automatically sync with their leader's state. If they have initial state, it | ||
* will be replaced immediately when it has synced with the leader. | ||
* | ||
* @example | ||
* | ||
* ```typescript | ||
* interface MyState { | ||
* count: number; | ||
* } | ||
* interface MyCustomEvent { | ||
* type: 'INCREMENT'; | ||
* payload: number; | ||
* } | ||
* | ||
* // Create a leader store | ||
* const leaderStore = UniversalStore.create<MyState, MyCustomEvent>({ | ||
* id: 'my-store', | ||
* leader: true, | ||
* initialState: { count: 0 }, | ||
* }); | ||
* | ||
* // Create a follower store | ||
* const followerStore = UniversalStore.create<MyState, MyCustomEvent>({ | ||
* id: 'my-store', | ||
* leader: false, | ||
* }); | ||
* ``` | ||
* | ||
* @template State - The type of state managed by the store | ||
* @template CustomEvent - Custom events that can be sent through the store. Must have a `type` | ||
* string and optional `payload` | ||
* @throws {Error} If constructed directly instead of using `create()` | ||
* @throws {Error} If created without setting a channel first | ||
* @throws {Error} If a follower is created with initial state | ||
* @throws {Error} If a follower cannot find its leader within 1 second | ||
*/ | ||
declare class UniversalStore<State, CustomEvent extends { | ||
type: string; | ||
payload?: any; | ||
} = { | ||
type: string; | ||
payload?: any; | ||
}> { | ||
/** | ||
* Defines the possible actor types in the store system | ||
* | ||
* @readonly | ||
*/ | ||
static readonly ActorType: { | ||
readonly LEADER: "LEADER"; | ||
readonly FOLLOWER: "FOLLOWER"; | ||
}; | ||
/** | ||
* Defines the possible environments the store can run in | ||
* | ||
* @readonly | ||
*/ | ||
static readonly Environment: { | ||
readonly SERVER: "SERVER"; | ||
readonly MANAGER: "MANAGER"; | ||
readonly PREVIEW: "PREVIEW"; | ||
readonly UNKNOWN: "UNKNOWN"; | ||
readonly MOCK: "MOCK"; | ||
}; | ||
/** | ||
* Internal event types used for store synchronization | ||
* | ||
* @readonly | ||
*/ | ||
static readonly InternalEventType: { | ||
readonly EXISTING_STATE_REQUEST: "__EXISTING_STATE_REQUEST"; | ||
readonly EXISTING_STATE_RESPONSE: "__EXISTING_STATE_RESPONSE"; | ||
readonly SET_STATE: "__SET_STATE"; | ||
readonly LEADER_CREATED: "__LEADER_CREATED"; | ||
readonly FOLLOWER_CREATED: "__FOLLOWER_CREATED"; | ||
}; | ||
static readonly Status: { | ||
readonly UNPREPARED: "UNPREPARED"; | ||
readonly SYNCING: "SYNCING"; | ||
readonly READY: "READY"; | ||
readonly ERROR: "ERROR"; | ||
}; | ||
protected static isInternalConstructing: boolean; | ||
/** | ||
* The preparation construct is used to keep track of all store's preparation state the promise is | ||
* resolved when the store is prepared with the static __prepare() method which will also change | ||
* the state from PENDING to RESOLVED | ||
*/ | ||
private static preparation; | ||
private static setupPreparationPromise; | ||
/** Enable debug logs for this store */ | ||
debugging: boolean; | ||
/** The actor object representing the store instance with a unique ID and a type */ | ||
get actor(): Actor; | ||
/** | ||
* The current state of the store, that signals both if the store is prepared by Storybook and | ||
* also - in the case of a follower - if the state has been synced with the leader's state. | ||
*/ | ||
get status(): StatusType; | ||
/** | ||
* A promise that resolves when the store is fully ready. A leader will be ready when the store | ||
* has been prepared by Storybook, which is almost instantly. | ||
* | ||
* A follower will be ready when the state has been synced with the leader's state, within a few | ||
* hundred milliseconds. | ||
*/ | ||
untilReady(): Promise<[{ | ||
channel: ChannelLike; | ||
environment: EnvironmentType; | ||
}, void | undefined]>; | ||
/** | ||
* The syncing construct is used to keep track of if the instance's state has been synced with the | ||
* other instances. A leader will immediately have the promise resolved. A follower will initially | ||
* be in a PENDING state, and resolve the the leader has sent the existing state, or reject if no | ||
* leader has responded before the timeout. | ||
*/ | ||
private syncing?; | ||
private channelEventName; | ||
private state; | ||
private channel?; | ||
private environment?; | ||
private listeners; | ||
private id; | ||
private actorId; | ||
private actorType; | ||
protected constructor(options: StoreOptions<State>, environmentOverrides?: EnvironmentOverrides); | ||
/** Creates a new instance of UniversalStore */ | ||
static create<State = any, CustomEvent extends { | ||
type: string; | ||
payload?: any; | ||
} = { | ||
type: string; | ||
payload?: any; | ||
}>(options: StoreOptions<State>): UniversalStore<State, CustomEvent>; | ||
/** Gets the current state */ | ||
getState: () => State; | ||
/** | ||
* Updates the store's state | ||
* | ||
* Either a new state or a state updater function can be passed to the method. | ||
*/ | ||
setState(updater: State | StateUpdater<State>): void; | ||
/** | ||
* Subscribes to store events | ||
* | ||
* @returns A function to unsubscribe | ||
*/ | ||
subscribe: { | ||
(listener: Listener<Event<State, CustomEvent>>): () => void; | ||
<EventType extends Event<State, CustomEvent>['type']>(eventType: EventType, listener: Listener<Extract<Event<State, CustomEvent>, { | ||
type: EventType; | ||
}>>): () => void; | ||
}; | ||
/** | ||
* Subscribes to state changes | ||
* | ||
* @returns Unsubscribe function | ||
*/ | ||
onStateChange(listener: (state: State, previousState: State, eventInfo: EventInfo) => void): () => void; | ||
/** Sends a custom event to the other stores */ | ||
send: (event: CustomEvent) => void; | ||
private emitToChannel; | ||
private prepareThis; | ||
private emitToListeners; | ||
private handleChannelEvents; | ||
private debug; | ||
} | ||
/** | ||
* A hook to use a UniversalStore in a rendered preview. This hook will react to changes in the | ||
* store state and re-render when the store changes. | ||
* | ||
* @param universalStore The UniversalStore instance to use. | ||
* @param selector An optional selector function to select a subset of the store state. | ||
* @remark This hook is intended for use in the preview. For use in the manager UI, import from | ||
* `storybook/internal/manager-api` instead. | ||
*/ | ||
declare const useUniversalStore: { | ||
<TUniversalStore extends UniversalStore<TState, any>, TState = TUniversalStore extends UniversalStore<infer S, any> ? S : never>(universalStore: TUniversalStore): [TState, TUniversalStore['setState']]; | ||
<TUniversalStore extends UniversalStore<any, any>, TSelectedState, TState = TUniversalStore extends UniversalStore<infer S, any> ? S : never>(universalStore: TUniversalStore, selector: (state: TState) => TSelectedState): [TSelectedState, TUniversalStore['setState']]; | ||
}; | ||
/** | ||
* A mock universal store that can be used when testing code that relies on a universal store. It | ||
* functions exactly like a normal universal store, with a few exceptions: | ||
* | ||
* - It is fully isolated, meaning that it doesn't interact with any channel, and it is always a | ||
* leader. | ||
* | ||
* If the second testUtils argument is provided, all the public methods are spied on, so they can be | ||
* asserted. | ||
* | ||
* When a mock store is re-used across tests (eg. in stories), you manually need to reset the state | ||
* after each test. | ||
* | ||
* @example | ||
* | ||
* ```ts | ||
* import * as testUtils from 'storybook/test'; // in stories | ||
* import { vi as testUtils } from 'vitest'; // ... or in Vitest tests | ||
* | ||
* const initialState = { ... }; | ||
* const store = new MockUniversalStore({ initialState }, testUtils); | ||
* | ||
* export default { | ||
* title: 'My story', | ||
* beforeEach: () => { | ||
* return () => { | ||
* store.setState(initialState); | ||
* }; | ||
* } | ||
* } | ||
* ``` | ||
*/ | ||
declare class MockUniversalStore<State, CustomEvent extends { | ||
type: string; | ||
payload?: any; | ||
} = { | ||
type: string; | ||
payload?: any; | ||
}> extends UniversalStore<State, CustomEvent> { | ||
private testUtils; | ||
constructor(options: StoreOptions<State>, testUtils?: any); | ||
/** Create a mock universal store. This is just an alias for the constructor */ | ||
static create<State = any, CustomEvent extends { | ||
type: string; | ||
payload?: any; | ||
} = { | ||
type: string; | ||
payload?: any; | ||
}>(options: StoreOptions<State>, testUtils?: any): MockUniversalStore<State, CustomEvent>; | ||
unsubscribeAll(): void; | ||
} | ||
declare class ArgsStore { | ||
@@ -724,3 +417,3 @@ initialArgsByStoryId: Record<StoryId, Args>; | ||
declare function getCsfFactoryAnnotations<TRenderer extends Renderer = Renderer, TArgs extends Args = Args>(story: LegacyStoryAnnotationsOrFn<TRenderer>, meta?: ComponentAnnotations<TRenderer, TArgs>, projectAnnotations?: ProjectAnnotations<TRenderer>): { | ||
story: storybook_internal_csf.StoryAnnotations<Renderer, Args>; | ||
story: storybook_internal_types.StoryAnnotations<Renderer, Args>; | ||
meta: ComponentAnnotations<Renderer, Args>; | ||
@@ -787,6 +480,6 @@ preview: storybook_internal_types.NormalizedProjectAnnotations<Renderer>; | ||
}): { | ||
args: storybook_internal_csf.Args; | ||
initialGlobals: storybook_internal_csf.Globals; | ||
globalTypes: (storybook_internal_csf.GlobalTypes & storybook_internal_csf.StrictGlobalTypes) | undefined; | ||
userGlobals: storybook_internal_csf.Globals; | ||
args: storybook_internal_types.Args; | ||
initialGlobals: storybook_internal_types.Globals; | ||
globalTypes: (storybook_internal_types.GlobalTypes & storybook_internal_types.StrictGlobalTypes) | undefined; | ||
userGlobals: storybook_internal_types.Globals; | ||
reporting: ReporterAPI; | ||
@@ -804,26 +497,26 @@ globals: { | ||
parameters: Parameters; | ||
initialArgs: storybook_internal_csf.Args; | ||
argTypes: storybook_internal_csf.StrictArgTypes<storybook_internal_csf.Args>; | ||
componentId: storybook_internal_csf.ComponentId; | ||
initialArgs: storybook_internal_types.Args; | ||
argTypes: storybook_internal_types.StrictArgTypes<storybook_internal_types.Args>; | ||
componentId: storybook_internal_types.ComponentId; | ||
title: ComponentTitle; | ||
kind: ComponentTitle; | ||
id: StoryId; | ||
name: storybook_internal_csf.StoryName; | ||
story: storybook_internal_csf.StoryName; | ||
tags: storybook_internal_csf.Tag[]; | ||
name: storybook_internal_types.StoryName; | ||
story: storybook_internal_types.StoryName; | ||
tags: storybook_internal_types.Tag[]; | ||
moduleExport: storybook_internal_types.ModuleExport; | ||
originalStoryFn: storybook_internal_csf.StoryFn<TRenderer>; | ||
undecoratedStoryFn: storybook_internal_csf.LegacyStoryFn<TRenderer>; | ||
unboundStoryFn: storybook_internal_csf.LegacyStoryFn<TRenderer>; | ||
applyLoaders: (context: StoryContext<TRenderer, storybook_internal_csf.Args>) => Promise<Record<string, any>>; | ||
applyBeforeEach: (context: StoryContext<TRenderer, storybook_internal_csf.Args>) => Promise<CleanupCallback[]>; | ||
applyAfterEach: (context: StoryContext<TRenderer, storybook_internal_csf.Args>) => Promise<void>; | ||
playFunction?: ((context: StoryContext<TRenderer, storybook_internal_csf.Args>) => Promise<void> | void) | undefined; | ||
runStep: storybook_internal_csf.StepRunner<TRenderer>; | ||
mount: (context: StoryContext<TRenderer, storybook_internal_csf.Args>) => () => Promise<Canvas>; | ||
originalStoryFn: storybook_internal_types.StoryFn<TRenderer>; | ||
undecoratedStoryFn: storybook_internal_types.LegacyStoryFn<TRenderer>; | ||
unboundStoryFn: storybook_internal_types.LegacyStoryFn<TRenderer>; | ||
applyLoaders: (context: StoryContext<TRenderer, storybook_internal_types.Args>) => Promise<Record<string, any>>; | ||
applyBeforeEach: (context: StoryContext<TRenderer, storybook_internal_types.Args>) => Promise<CleanupCallback[]>; | ||
applyAfterEach: (context: StoryContext<TRenderer, storybook_internal_types.Args>) => Promise<void>; | ||
playFunction?: ((context: StoryContext<TRenderer, storybook_internal_types.Args>) => Promise<void> | void) | undefined; | ||
runStep: storybook_internal_types.StepRunner<TRenderer>; | ||
mount: (context: StoryContext<TRenderer, storybook_internal_types.Args>) => () => Promise<Canvas>; | ||
testingLibraryRender?: (...args: never[]) => unknown; | ||
renderToCanvas?: storybook_internal_types.RenderToCanvas<TRenderer> | undefined; | ||
usesMount: boolean; | ||
storyGlobals: storybook_internal_csf.Globals; | ||
} & Pick<storybook_internal_csf.StoryContextForLoaders<Renderer, storybook_internal_csf.Args>, "allArgs" | "argsByTarget" | "unmappedArgs">; | ||
storyGlobals: storybook_internal_types.Globals; | ||
} & Pick<storybook_internal_types.StoryContextForLoaders<Renderer, storybook_internal_types.Args>, "allArgs" | "argsByTarget" | "unmappedArgs">; | ||
addCleanupCallbacks(story: PreparedStory<TRenderer>, callbacks: CleanupCallback[]): void; | ||
@@ -836,6 +529,6 @@ cleanupStory(story: PreparedStory<TRenderer>): Promise<void>; | ||
v: number; | ||
globals: storybook_internal_csf.Globals; | ||
globals: storybook_internal_types.Globals; | ||
globalParameters: {}; | ||
kindParameters: Parameters; | ||
stories: Record<string, StoryContextForEnhancers<TRenderer, storybook_internal_csf.Args>>; | ||
stories: Record<string, StoryContextForEnhancers<TRenderer, storybook_internal_types.Args>>; | ||
}; | ||
@@ -905,6 +598,6 @@ getStoriesJsonData: () => StoryIndexV3; | ||
viewMode: string; | ||
args: storybook_internal_csf.Args; | ||
initialGlobals: storybook_internal_csf.Globals; | ||
globalTypes: (storybook_internal_csf.GlobalTypes & storybook_internal_csf.StrictGlobalTypes) | undefined; | ||
userGlobals: storybook_internal_csf.Globals; | ||
args: storybook_internal_types.Args; | ||
initialGlobals: storybook_internal_types.Globals; | ||
globalTypes: (storybook_internal_types.GlobalTypes & storybook_internal_types.StrictGlobalTypes) | undefined; | ||
userGlobals: storybook_internal_types.Globals; | ||
reporting: ReporterAPI; | ||
@@ -921,26 +614,26 @@ globals: { | ||
})["component"]> | undefined; | ||
parameters: storybook_internal_csf.Parameters; | ||
initialArgs: storybook_internal_csf.Args; | ||
argTypes: storybook_internal_csf.StrictArgTypes<storybook_internal_csf.Args>; | ||
componentId: storybook_internal_csf.ComponentId; | ||
title: storybook_internal_csf.ComponentTitle; | ||
kind: storybook_internal_csf.ComponentTitle; | ||
parameters: storybook_internal_types.Parameters; | ||
initialArgs: storybook_internal_types.Args; | ||
argTypes: storybook_internal_types.StrictArgTypes<storybook_internal_types.Args>; | ||
componentId: storybook_internal_types.ComponentId; | ||
title: storybook_internal_types.ComponentTitle; | ||
kind: storybook_internal_types.ComponentTitle; | ||
id: StoryId; | ||
name: StoryName; | ||
story: StoryName; | ||
tags: storybook_internal_csf.Tag[]; | ||
tags: storybook_internal_types.Tag[]; | ||
moduleExport: ModuleExport; | ||
originalStoryFn: storybook_internal_csf.StoryFn<TRenderer>; | ||
undecoratedStoryFn: storybook_internal_csf.LegacyStoryFn<TRenderer>; | ||
unboundStoryFn: storybook_internal_csf.LegacyStoryFn<TRenderer>; | ||
applyLoaders: (context: storybook_internal_csf.StoryContext<TRenderer, storybook_internal_csf.Args>) => Promise<Record<string, any>>; | ||
applyBeforeEach: (context: storybook_internal_csf.StoryContext<TRenderer, storybook_internal_csf.Args>) => Promise<storybook_internal_csf.CleanupCallback[]>; | ||
applyAfterEach: (context: storybook_internal_csf.StoryContext<TRenderer, storybook_internal_csf.Args>) => Promise<void>; | ||
playFunction?: ((context: storybook_internal_csf.StoryContext<TRenderer, storybook_internal_csf.Args>) => Promise<void> | void) | undefined; | ||
runStep: storybook_internal_csf.StepRunner<TRenderer>; | ||
mount: (context: storybook_internal_csf.StoryContext<TRenderer, storybook_internal_csf.Args>) => () => Promise<storybook_internal_csf.Canvas>; | ||
originalStoryFn: storybook_internal_types.StoryFn<TRenderer>; | ||
undecoratedStoryFn: storybook_internal_types.LegacyStoryFn<TRenderer>; | ||
unboundStoryFn: storybook_internal_types.LegacyStoryFn<TRenderer>; | ||
applyLoaders: (context: storybook_internal_types.StoryContext<TRenderer, storybook_internal_types.Args>) => Promise<Record<string, any>>; | ||
applyBeforeEach: (context: storybook_internal_types.StoryContext<TRenderer, storybook_internal_types.Args>) => Promise<storybook_internal_types.CleanupCallback[]>; | ||
applyAfterEach: (context: storybook_internal_types.StoryContext<TRenderer, storybook_internal_types.Args>) => Promise<void>; | ||
playFunction?: ((context: storybook_internal_types.StoryContext<TRenderer, storybook_internal_types.Args>) => Promise<void> | void) | undefined; | ||
runStep: storybook_internal_types.StepRunner<TRenderer>; | ||
mount: (context: storybook_internal_types.StoryContext<TRenderer, storybook_internal_types.Args>) => () => Promise<storybook_internal_types.Canvas>; | ||
testingLibraryRender?: (...args: never[]) => unknown; | ||
renderToCanvas?: storybook_internal_types.RenderToCanvas<TRenderer> | undefined; | ||
usesMount: boolean; | ||
storyGlobals: storybook_internal_csf.Globals; | ||
storyGlobals: storybook_internal_types.Globals; | ||
allArgs: any; | ||
@@ -1163,3 +856,3 @@ argsByTarget: any; | ||
initialGlobals: Globals; | ||
globalTypes: (storybook_internal_csf.GlobalTypes & storybook_internal_csf.StrictGlobalTypes) | undefined; | ||
globalTypes: (storybook_internal_types.GlobalTypes & storybook_internal_types.StrictGlobalTypes) | undefined; | ||
userGlobals: Globals; | ||
@@ -1177,22 +870,22 @@ reporting: ReporterAPI; | ||
})["component"]> | undefined; | ||
parameters: storybook_internal_csf.Parameters; | ||
parameters: storybook_internal_types.Parameters; | ||
initialArgs: Args; | ||
argTypes: storybook_internal_csf.StrictArgTypes<Args>; | ||
componentId: storybook_internal_csf.ComponentId; | ||
title: storybook_internal_csf.ComponentTitle; | ||
kind: storybook_internal_csf.ComponentTitle; | ||
argTypes: storybook_internal_types.StrictArgTypes<Args>; | ||
componentId: storybook_internal_types.ComponentId; | ||
title: storybook_internal_types.ComponentTitle; | ||
kind: storybook_internal_types.ComponentTitle; | ||
id: StoryId; | ||
name: storybook_internal_csf.StoryName; | ||
story: storybook_internal_csf.StoryName; | ||
tags: storybook_internal_csf.Tag[]; | ||
name: storybook_internal_types.StoryName; | ||
story: storybook_internal_types.StoryName; | ||
tags: storybook_internal_types.Tag[]; | ||
moduleExport: storybook_internal_types.ModuleExport; | ||
originalStoryFn: storybook_internal_csf.StoryFn<TRenderer>; | ||
undecoratedStoryFn: storybook_internal_csf.LegacyStoryFn<TRenderer>; | ||
unboundStoryFn: storybook_internal_csf.LegacyStoryFn<TRenderer>; | ||
applyLoaders: (context: storybook_internal_csf.StoryContext<TRenderer, Args>) => Promise<Record<string, any>>; | ||
applyBeforeEach: (context: storybook_internal_csf.StoryContext<TRenderer, Args>) => Promise<CleanupCallback[]>; | ||
applyAfterEach: (context: storybook_internal_csf.StoryContext<TRenderer, Args>) => Promise<void>; | ||
playFunction?: ((context: storybook_internal_csf.StoryContext<TRenderer, Args>) => Promise<void> | void) | undefined; | ||
runStep: storybook_internal_csf.StepRunner<TRenderer>; | ||
mount: (context: storybook_internal_csf.StoryContext<TRenderer, Args>) => () => Promise<storybook_internal_csf.Canvas>; | ||
originalStoryFn: storybook_internal_types.StoryFn<TRenderer>; | ||
undecoratedStoryFn: storybook_internal_types.LegacyStoryFn<TRenderer>; | ||
unboundStoryFn: storybook_internal_types.LegacyStoryFn<TRenderer>; | ||
applyLoaders: (context: storybook_internal_types.StoryContext<TRenderer, Args>) => Promise<Record<string, any>>; | ||
applyBeforeEach: (context: storybook_internal_types.StoryContext<TRenderer, Args>) => Promise<CleanupCallback[]>; | ||
applyAfterEach: (context: storybook_internal_types.StoryContext<TRenderer, Args>) => Promise<void>; | ||
playFunction?: ((context: storybook_internal_types.StoryContext<TRenderer, Args>) => Promise<void> | void) | undefined; | ||
runStep: storybook_internal_types.StepRunner<TRenderer>; | ||
mount: (context: storybook_internal_types.StoryContext<TRenderer, Args>) => () => Promise<storybook_internal_types.Canvas>; | ||
testingLibraryRender?: (...args: never[]) => unknown; | ||
@@ -1202,6 +895,6 @@ renderToCanvas?: RenderToCanvas<TRenderer> | undefined; | ||
storyGlobals: Globals; | ||
} & Pick<storybook_internal_csf.StoryContextForLoaders<Renderer, Args>, "allArgs" | "argsByTarget" | "unmappedArgs">; | ||
} & Pick<storybook_internal_types.StoryContextForLoaders<Renderer, Args>, "allArgs" | "argsByTarget" | "unmappedArgs">; | ||
extract(options?: { | ||
includeDocsOnly: boolean; | ||
}): Promise<Record<string, storybook_internal_csf.StoryContextForEnhancers<TRenderer, Args>>>; | ||
}): Promise<Record<string, storybook_internal_types.StoryContextForEnhancers<TRenderer, Args>>>; | ||
renderPreviewEntryError(reason: string, err: Error): void; | ||
@@ -1367,2 +1060,2 @@ } | ||
export { DocsContext, HooksContext, Preview, PreviewWeb, PreviewWithSelection, type PropDescriptor, type Report, ReporterAPI, type SelectionStore, StoryStore, UrlStore, type View, WebView, addons, applyHooks, combineArgs, combineParameters, composeConfigs, composeStepRunners, composeStories, composeStory, createPlaywrightTest, decorateStory, defaultDecorateStory, definePreview, MockUniversalStore as experimental_MockUniversalStore, UniversalStore as experimental_UniversalStore, useUniversalStore as experimental_useUniversalStore, filterArgTypes, getCsfFactoryAnnotations, inferControls, makeDecorator, mockChannel, normalizeProjectAnnotations, normalizeStory, prepareMeta, prepareStory, sanitizeStoryContextUpdate, setDefaultProjectAnnotations, 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 Report, ReporterAPI, type SelectionStore, StoryStore, UrlStore, type View, WebView, addons, applyHooks, combineArgs, combineParameters, composeConfigs, composeStepRunners, composeStories, composeStory, createPlaywrightTest, decorateStory, defaultDecorateStory, definePreview, filterArgTypes, getCsfFactoryAnnotations, inferControls, makeDecorator, mockChannel, normalizeProjectAnnotations, normalizeStory, prepareMeta, prepareStory, sanitizeStoryContextUpdate, setDefaultProjectAnnotations, setProjectAnnotations, simulateDOMContentLoaded, simulatePageLoad, sortStoriesV7, useArgs, useCallback, useChannel, useEffect, useGlobals, useMemo, useParameter, useReducer, useRef, useState, useStoryContext, userOrAutoTitle, userOrAutoTitleFromSpecifier }; |
@@ -0,1 +1,15 @@ | ||
import { StoryId } from 'storybook/internal/csf'; | ||
type StatusValue = 'status-value:pending' | 'status-value:success' | 'status-value:error' | 'status-value:warn' | 'status-value:unknown'; | ||
type StatusTypeId = string; | ||
interface Status { | ||
value: StatusValue; | ||
typeId: StatusTypeId; | ||
storyId: StoryId; | ||
title: string; | ||
description: string; | ||
data?: any; | ||
sidebarContextMenu?: boolean; | ||
} | ||
declare abstract class StorybookError extends Error { | ||
@@ -156,2 +170,12 @@ /** Category of the error. Used to classify the type of error, e.g., 'PREVIEW_API'. */ | ||
} | ||
declare class StatusTypeIdMismatchError extends StorybookError { | ||
data: { | ||
status: Status; | ||
typeId: StatusTypeId; | ||
}; | ||
constructor(data: { | ||
status: Status; | ||
typeId: StatusTypeId; | ||
}); | ||
} | ||
declare class NextJsSharpError extends StorybookError { | ||
@@ -189,2 +213,2 @@ constructor(); | ||
export { CalledExtractOnStoreError, CalledPreviewMethodBeforeInitializationError, Category, EmptyIndexError, ImplicitActionsDuringRendering, MdxFileWithNoCsfReferencesError, MissingRenderToCanvasError, MissingStoryAfterHmrError, MissingStoryFromCsfFileError, MountMustBeDestructuredError, NextJsSharpError, NextjsRouterMocksNotAvailable, NoRenderFunctionError, NoStoryMatchError, NoStoryMountedError, StoryIndexFetchError, StoryStoreAccessedBeforeInitializationError, UnknownArgTypesError, UnsupportedViewportDimensionError }; | ||
export { CalledExtractOnStoreError, CalledPreviewMethodBeforeInitializationError, Category, EmptyIndexError, ImplicitActionsDuringRendering, MdxFileWithNoCsfReferencesError, MissingRenderToCanvasError, MissingStoryAfterHmrError, MissingStoryFromCsfFileError, MountMustBeDestructuredError, NextJsSharpError, NextjsRouterMocksNotAvailable, NoRenderFunctionError, NoStoryMatchError, NoStoryMountedError, StatusTypeIdMismatchError, StoryIndexFetchError, StoryStoreAccessedBeforeInitializationError, UnknownArgTypesError, UnsupportedViewportDimensionError }; |
@@ -1,11 +0,11 @@ | ||
var oe = Object.defineProperty; | ||
var t = (u, n) => oe(u, "name", { value: n, configurable: !0 }); | ||
var re = Object.defineProperty; | ||
var t = (u, s) => re(u, "name", { value: s, 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 s = [], e = 1; e < arguments.length; e++) | ||
s[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 g = a.reduce(function(i, m) { | ||
var p = a.reduce(function(i, m) { | ||
var y = m.match(/\n([\t ]+|(?!\s).)/g); | ||
@@ -17,5 +17,5 @@ return y ? i.concat(y.map(function(E) { | ||
}, []); | ||
if (g.length) { | ||
if (p.length) { | ||
var h = new RegExp(` | ||
[ ]{` + Math.min.apply(Math, g) + "}", "g"); | ||
[ ]{` + Math.min.apply(Math, p) + "}", "g"); | ||
a = a.map(function(i) { | ||
@@ -28,8 +28,8 @@ return i.replace(h, ` | ||
var c = a[0]; | ||
return n.forEach(function(i, m) { | ||
return s.forEach(function(i, m) { | ||
var y = c.match(/(?:^|\n)( *)$/), E = y ? y[1] : "", l = i; | ||
typeof i == "string" && i.includes(` | ||
`) && (l = String(i).split(` | ||
`).map(function(d, te) { | ||
return te === 0 ? d : "" + E + d; | ||
`).map(function(d, se) { | ||
return se === 0 ? d : "" + E + d; | ||
}).join(` | ||
@@ -39,16 +39,16 @@ `)), c += l + a[m + 1]; | ||
} | ||
t(r, "dedent"); | ||
t(n, "dedent"); | ||
// src/storybook-error.ts | ||
function C({ | ||
function D({ | ||
code: u, | ||
category: n | ||
category: s | ||
}) { | ||
let e = String(u).padStart(4, "0"); | ||
return `SB_${n}_${e}`; | ||
return `SB_${s}_${e}`; | ||
} | ||
t(C, "parseErrorCode"); | ||
var p = class p extends Error { | ||
t(D, "parseErrorCode"); | ||
var g = class g extends Error { | ||
constructor(e) { | ||
super(p.getFullMessage(e)); | ||
super(g.getFullMessage(e)); | ||
/** | ||
@@ -64,3 +64,3 @@ * Data associated with the error. Used to provide additional information in the error message or | ||
get fullErrorCode() { | ||
return C({ code: this.code, category: this.category }); | ||
return D({ code: this.code, category: this.category }); | ||
} | ||
@@ -76,7 +76,7 @@ /** Overrides the default `Error.name` property in the format: SB_<CATEGORY>_<CODE>. */ | ||
code: a, | ||
category: g, | ||
category: p, | ||
message: h | ||
}) { | ||
let c; | ||
return e === !0 ? c = `https://storybook.js.org/error/${C({ code: a, category: g })}` : typeof e == "string" ? c = e : Array.isArray(e) && | ||
return e === !0 ? c = `https://storybook.js.org/error/${D({ code: a, category: p })}` : typeof e == "string" ? c = e : Array.isArray(e) && | ||
(c = ` | ||
@@ -90,12 +90,12 @@ ${e.map((i) => ` - ${i}`).join(` | ||
}; | ||
t(p, "StorybookError"); | ||
var o = p; | ||
t(g, "StorybookError"); | ||
var o = g; | ||
// 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 = | ||
"PREVIEW_CHANNELS", s.PREVIEW_CORE_EVENTS = "PREVIEW_CORE-EVENTS", s.PREVIEW_INSTRUMENTER = "PREVIEW_INSTRUMENTER", s.PREVIEW_API = "PREVIEW\ | ||
_API", s.PREVIEW_REACT_DOM_SHIM = "PREVIEW_REACT-DOM-SHIM", s.PREVIEW_ROUTER = "PREVIEW_ROUTER", s.PREVIEW_THEMING = "PREVIEW_THEMING", s.RENDERER_HTML = | ||
"RENDERER_HTML", s.RENDERER_PREACT = "RENDERER_PREACT", s.RENDERER_REACT = "RENDERER_REACT", s.RENDERER_SERVER = "RENDERER_SERVER", s.RENDERER_SVELTE = | ||
"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.ADDON_VITEST = "ADDON_VITEST", s))(se || {}), f = class f extends o { | ||
var ne = /* @__PURE__ */ ((r) => (r.BLOCKS = "BLOCKS", r.DOCS_TOOLS = "DOCS-TOOLS", r.PREVIEW_CLIENT_LOGGER = "PREVIEW_CLIENT-LOGGER", r.PREVIEW_CHANNELS = | ||
"PREVIEW_CHANNELS", r.PREVIEW_CORE_EVENTS = "PREVIEW_CORE-EVENTS", r.PREVIEW_INSTRUMENTER = "PREVIEW_INSTRUMENTER", r.PREVIEW_API = "PREVIEW\ | ||
_API", r.PREVIEW_REACT_DOM_SHIM = "PREVIEW_REACT-DOM-SHIM", r.PREVIEW_ROUTER = "PREVIEW_ROUTER", r.PREVIEW_THEMING = "PREVIEW_THEMING", r.RENDERER_HTML = | ||
"RENDERER_HTML", r.RENDERER_PREACT = "RENDERER_PREACT", r.RENDERER_REACT = "RENDERER_REACT", r.RENDERER_SERVER = "RENDERER_SERVER", r.RENDERER_SVELTE = | ||
"RENDERER_SVELTE", r.RENDERER_VUE = "RENDERER_VUE", r.RENDERER_VUE3 = "RENDERER_VUE3", r.RENDERER_WEB_COMPONENTS = "RENDERER_WEB-COMPONENTS", | ||
r.FRAMEWORK_NEXTJS = "FRAMEWORK_NEXTJS", r.ADDON_VITEST = "ADDON_VITEST", r))(ne || {}), f = class f extends o { | ||
constructor(e) { | ||
@@ -105,3 +105,3 @@ super({ | ||
code: 1, | ||
message: r` | ||
message: n` | ||
Couldn't find story matching id '${e.storyId}' after HMR. | ||
@@ -118,3 +118,3 @@ - Did you just rename a story? | ||
t(f, "MissingStoryAfterHmrError"); | ||
var D = f, R = class R extends o { | ||
var j = f, R = class R extends o { | ||
constructor(e) { | ||
@@ -126,3 +126,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. | ||
@@ -143,3 +143,3 @@ ${e.deprecated ? ` | ||
t(R, "ImplicitActionsDuringRendering"); | ||
var j = R, b = class b extends o { | ||
var L = R, b = class b extends o { | ||
constructor() { | ||
@@ -149,3 +149,3 @@ super({ | ||
code: 3, | ||
message: r` | ||
message: n` | ||
Cannot call \`storyStore.extract()\` without calling \`storyStore.cacheAllCsfFiles()\` first. | ||
@@ -158,3 +158,3 @@ | ||
t(b, "CalledExtractOnStoreError"); | ||
var L = b, I = class I extends o { | ||
var G = b, I = class I extends o { | ||
constructor() { | ||
@@ -164,3 +164,3 @@ super({ | ||
code: 4, | ||
message: r` | ||
message: n` | ||
Expected your framework's preset to export a \`renderToCanvas\` field. | ||
@@ -174,3 +174,3 @@ | ||
t(I, "MissingRenderToCanvasError"); | ||
var G = I, P = class P extends o { | ||
var Y = I, P = class P extends o { | ||
constructor(e) { | ||
@@ -180,3 +180,3 @@ super({ | ||
code: 5, | ||
message: r` | ||
message: n` | ||
Called \`Preview.${e.methodName}()\` before initialization. | ||
@@ -194,3 +194,3 @@ | ||
t(P, "CalledPreviewMethodBeforeInitializationError"); | ||
var Y = P, x = class x extends o { | ||
var F = P, x = class x extends o { | ||
constructor(e) { | ||
@@ -200,3 +200,3 @@ super({ | ||
code: 6, | ||
message: r` | ||
message: n` | ||
Error fetching \`/index.json\`: | ||
@@ -216,3 +216,3 @@ | ||
t(x, "StoryIndexFetchError"); | ||
var M = x, T = class T extends o { | ||
var H = x, w = class w extends o { | ||
constructor(e) { | ||
@@ -222,3 +222,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 | ||
@@ -233,4 +233,4 @@ references, or autodocs for a CSF file that some doesn't refer to itself. | ||
}; | ||
t(T, "MdxFileWithNoCsfReferencesError"); | ||
var H = T, w = class w extends o { | ||
t(w, "MdxFileWithNoCsfReferencesError"); | ||
var K = w, T = class T extends o { | ||
constructor() { | ||
@@ -240,3 +240,3 @@ super({ | ||
code: 8, | ||
message: r` | ||
message: n` | ||
Couldn't find any stories in your Storybook. | ||
@@ -249,4 +249,4 @@ | ||
}; | ||
t(w, "EmptyIndexError"); | ||
var F = w, k = class k extends o { | ||
t(T, "EmptyIndexError"); | ||
var M = T, S = class S extends o { | ||
constructor(e) { | ||
@@ -256,3 +256,3 @@ super({ | ||
code: 9, | ||
message: r` | ||
message: n` | ||
Couldn't find story matching '${e.storySpecifier}'. | ||
@@ -267,4 +267,4 @@ | ||
}; | ||
t(k, "NoStoryMatchError"); | ||
var K = k, S = class S extends o { | ||
t(S, "NoStoryMatchError"); | ||
var X = S, k = class k extends o { | ||
constructor(e) { | ||
@@ -274,3 +274,3 @@ super({ | ||
code: 10, | ||
message: r` | ||
message: n` | ||
Couldn't find story matching id '${e.storyId}' after importing a CSF file. | ||
@@ -288,4 +288,4 @@ | ||
}; | ||
t(S, "MissingStoryFromCsfFileError"); | ||
var X = S, v = class v extends o { | ||
t(k, "MissingStoryFromCsfFileError"); | ||
var J = k, v = class v extends o { | ||
constructor() { | ||
@@ -295,3 +295,3 @@ super({ | ||
code: 11, | ||
message: r` | ||
message: n` | ||
Cannot access the Story Store until the index is ready. | ||
@@ -305,3 +305,3 @@ | ||
t(v, "StoryStoreAccessedBeforeInitializationError"); | ||
var U = v, _ = class _ extends o { | ||
var U = v, V = class V extends o { | ||
constructor(e) { | ||
@@ -311,3 +311,3 @@ super({ | ||
code: 12, | ||
message: r` | ||
message: n` | ||
Incorrect use of mount in the play function. | ||
@@ -334,4 +334,4 @@ | ||
}; | ||
t(_, "MountMustBeDestructuredError"); | ||
var J = _, V = class V extends o { | ||
t(V, "MountMustBeDestructuredError"); | ||
var q = V, _ = class _ extends o { | ||
constructor(e) { | ||
@@ -341,3 +341,3 @@ super({ | ||
code: 14, | ||
message: r` | ||
message: n` | ||
No render function available for storyId '${e.id}' | ||
@@ -349,4 +349,4 @@ ` | ||
}; | ||
t(V, "NoRenderFunctionError"); | ||
var q = V, N = class N extends o { | ||
t(_, "NoRenderFunctionError"); | ||
var z = _, N = class N extends o { | ||
constructor() { | ||
@@ -356,3 +356,3 @@ super({ | ||
code: 15, | ||
message: r` | ||
message: n` | ||
No component is mounted in your story. | ||
@@ -377,3 +377,18 @@ | ||
t(N, "NoStoryMountedError"); | ||
var z = N, A = class A extends o { | ||
var B = N, A = class A extends o { | ||
constructor(e) { | ||
super({ | ||
category: "PREVIEW_API", | ||
code: 16, | ||
message: `Status has typeId "${e.status.typeId}" but was added to store with typeId "${e.typeId}". Full status: ${JSON.stringify( | ||
e.status, | ||
null, | ||
2 | ||
)}` | ||
}); | ||
this.data = e; | ||
} | ||
}; | ||
t(A, "StatusTypeIdMismatchError"); | ||
var Q = A, W = class W extends o { | ||
constructor() { | ||
@@ -384,3 +399,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. | ||
@@ -393,4 +408,4 @@ | ||
}; | ||
t(A, "NextJsSharpError"); | ||
var B = A, W = class W extends o { | ||
t(W, "NextJsSharpError"); | ||
var Z = W, $ = class $ extends o { | ||
constructor(e) { | ||
@@ -400,3 +415,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. | ||
@@ -408,4 +423,4 @@ ` | ||
}; | ||
t(W, "NextjsRouterMocksNotAvailable"); | ||
var Q = W, $ = class $ extends o { | ||
t($, "NextjsRouterMocksNotAvailable"); | ||
var ee = $, O = class O extends o { | ||
constructor(e) { | ||
@@ -416,3 +431,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: | ||
@@ -430,4 +445,4 @@ ${JSON.stringify(e.type, null, 2)} | ||
}; | ||
t($, "UnknownArgTypesError"); | ||
var Z = $, O = class O extends o { | ||
t(O, "UnknownArgTypesError"); | ||
var te = O, C = class C extends o { | ||
constructor(e) { | ||
@@ -439,3 +454,3 @@ super({ | ||
// documentation: '', | ||
message: r` | ||
message: n` | ||
Encountered an unsupported value "${e.value}" when setting the viewport ${e.dimension} dimension. | ||
@@ -452,24 +467,25 @@ | ||
}; | ||
t(O, "UnsupportedViewportDimensionError"); | ||
var ee = O; | ||
t(C, "UnsupportedViewportDimensionError"); | ||
var oe = C; | ||
export { | ||
L as CalledExtractOnStoreError, | ||
Y as CalledPreviewMethodBeforeInitializationError, | ||
se as Category, | ||
F as EmptyIndexError, | ||
j as ImplicitActionsDuringRendering, | ||
H as MdxFileWithNoCsfReferencesError, | ||
G as MissingRenderToCanvasError, | ||
D as MissingStoryAfterHmrError, | ||
X as MissingStoryFromCsfFileError, | ||
J as MountMustBeDestructuredError, | ||
B as NextJsSharpError, | ||
Q as NextjsRouterMocksNotAvailable, | ||
q as NoRenderFunctionError, | ||
K as NoStoryMatchError, | ||
z as NoStoryMountedError, | ||
M as StoryIndexFetchError, | ||
G as CalledExtractOnStoreError, | ||
F as CalledPreviewMethodBeforeInitializationError, | ||
ne as Category, | ||
M as EmptyIndexError, | ||
L as ImplicitActionsDuringRendering, | ||
K as MdxFileWithNoCsfReferencesError, | ||
Y as MissingRenderToCanvasError, | ||
j as MissingStoryAfterHmrError, | ||
J as MissingStoryFromCsfFileError, | ||
q as MountMustBeDestructuredError, | ||
Z as NextJsSharpError, | ||
ee as NextjsRouterMocksNotAvailable, | ||
z as NoRenderFunctionError, | ||
X as NoStoryMatchError, | ||
B as NoStoryMountedError, | ||
Q as StatusTypeIdMismatchError, | ||
H as StoryIndexFetchError, | ||
U as StoryStoreAccessedBeforeInitializationError, | ||
Z as UnknownArgTypesError, | ||
ee as UnsupportedViewportDimensionError | ||
te as UnknownArgTypesError, | ||
oe as UnsupportedViewportDimensionError | ||
}; |
@@ -0,1 +1,15 @@ | ||
import { StoryId } from 'storybook/internal/csf'; | ||
type StatusValue = 'status-value:pending' | 'status-value:success' | 'status-value:error' | 'status-value:warn' | 'status-value:unknown'; | ||
type StatusTypeId = string; | ||
interface Status { | ||
value: StatusValue; | ||
typeId: StatusTypeId; | ||
storyId: StoryId; | ||
title: string; | ||
description: string; | ||
data?: any; | ||
sidebarContextMenu?: boolean; | ||
} | ||
declare abstract class StorybookError extends Error { | ||
@@ -220,2 +234,12 @@ /** Category of the error. Used to classify the type of error, e.g., 'PREVIEW_API'. */ | ||
} | ||
declare class StatusTypeIdMismatchError extends StorybookError { | ||
data: { | ||
status: Status; | ||
typeId: StatusTypeId; | ||
}; | ||
constructor(data: { | ||
status: Status; | ||
typeId: StatusTypeId; | ||
}); | ||
} | ||
declare class GenerateNewProjectOnInitError extends StorybookError { | ||
@@ -273,2 +297,2 @@ data: { | ||
export { AngularLegacyBuildOptionsError, Category, ConflictingStaticDirConfigError, CouldNotEvaluateFrameworkError, CriticalPresetLoadError, FindPackageVersionsError, GenerateNewProjectOnInitError, GoogleFontsDownloadError, GoogleFontsLoadingError, InvalidFrameworkNameError, InvalidStoriesEntryError, MainFileESMOnlyImportError, MainFileEvaluationError, MainFileMissingError, MissingAngularJsonError, MissingBuilderError, MissingFrameworkFieldError, NoMatchingExportError, NoStatsForViteDevError, NxProjectDetectedError, UpgradeStorybookInWrongWorkingDirectory, UpgradeStorybookToLowerVersionError, UpgradeStorybookToSameVersionError, UpgradeStorybookUnknownCurrentVersionError, WebpackCompilationError, WebpackInvocationError, WebpackMissingStatsError }; | ||
export { AngularLegacyBuildOptionsError, Category, ConflictingStaticDirConfigError, CouldNotEvaluateFrameworkError, CriticalPresetLoadError, FindPackageVersionsError, GenerateNewProjectOnInitError, GoogleFontsDownloadError, GoogleFontsLoadingError, InvalidFrameworkNameError, InvalidStoriesEntryError, MainFileESMOnlyImportError, MainFileEvaluationError, MainFileMissingError, MissingAngularJsonError, MissingBuilderError, MissingFrameworkFieldError, NoMatchingExportError, NoStatsForViteDevError, NxProjectDetectedError, StatusTypeIdMismatchError, UpgradeStorybookInWrongWorkingDirectory, UpgradeStorybookToLowerVersionError, UpgradeStorybookToSameVersionError, UpgradeStorybookUnknownCurrentVersionError, WebpackCompilationError, WebpackInvocationError, WebpackMissingStatsError }; |
@@ -7,16 +7,16 @@ import ESM_COMPAT_Module from "node:module"; | ||
const require = ESM_COMPAT_Module.createRequire(import.meta.url); | ||
var ne = Object.create; | ||
var ae = Object.create; | ||
var f = Object.defineProperty; | ||
var ae = Object.getOwnPropertyDescriptor; | ||
var ie = Object.getOwnPropertyNames; | ||
var ce = Object.getPrototypeOf, ue = Object.prototype.hasOwnProperty; | ||
var ie = Object.getOwnPropertyDescriptor; | ||
var ce = Object.getOwnPropertyNames; | ||
var ue = Object.getPrototypeOf, le = Object.prototype.hasOwnProperty; | ||
var s = (t, e) => f(t, "name", { value: e, configurable: !0 }); | ||
var O = (t, e) => () => (e || t((e = { exports: {} }).exports, e), e.exports); | ||
var le = (t, e, o, n) => { | ||
var me = (t, e, o, n) => { | ||
if (e && typeof e == "object" || typeof e == "function") | ||
for (let c of ie(e)) | ||
!ue.call(t, c) && c !== o && f(t, c, { get: () => e[c], enumerable: !(n = ae(e, c)) || n.enumerable }); | ||
for (let c of ce(e)) | ||
!le.call(t, c) && c !== o && f(t, c, { get: () => e[c], enumerable: !(n = ie(e, c)) || n.enumerable }); | ||
return t; | ||
}; | ||
var A = (t, e, o) => (o = t != null ? ne(ce(t)) : {}, le( | ||
var A = (t, e, o) => (o = t != null ? ae(ue(t)) : {}, me( | ||
// If the importer is in node compatibility mode or this is not an ESM | ||
@@ -31,8 +31,8 @@ // file that has been converted to a CommonJS file using a Babel- | ||
// ../node_modules/picocolors/picocolors.js | ||
var w = O((ye, k) => { | ||
var E = process || {}, _ = E.argv || [], h = E.env || {}, me = !(h.NO_COLOR || _.includes("--no-color")) && (!!h.FORCE_COLOR || _.includes( | ||
"--color") || E.platform === "win32" || (E.stdout || {}).isTTY && h.TERM !== "dumb" || !!h.CI), be = /* @__PURE__ */ s((t, e, o = t) => (n) => { | ||
var w = O((he, k) => { | ||
var E = process || {}, _ = E.argv || [], h = E.env || {}, de = !(h.NO_COLOR || _.includes("--no-color")) && (!!h.FORCE_COLOR || _.includes( | ||
"--color") || E.platform === "win32" || (E.stdout || {}).isTTY && h.TERM !== "dumb" || !!h.CI), ge = /* @__PURE__ */ s((t, e, o = t) => (n) => { | ||
let c = "" + n, u = c.indexOf(e, t.length); | ||
return ~u ? t + ge(c, e, o, u) + e : t + c + e; | ||
}, "formatter"), ge = /* @__PURE__ */ s((t, e, o, n) => { | ||
return ~u ? t + be(c, e, o, u) + e : t + c + e; | ||
}, "formatter"), be = /* @__PURE__ */ s((t, e, o, n) => { | ||
let c = "", u = 0; | ||
@@ -43,4 +43,4 @@ do | ||
return c + t.substring(u); | ||
}, "replaceClose"), C = /* @__PURE__ */ s((t = me) => { | ||
let e = t ? be : () => String; | ||
}, "replaceClose"), C = /* @__PURE__ */ s((t = de) => { | ||
let e = t ? ge : () => String; | ||
return { | ||
@@ -96,7 +96,7 @@ isColorSupported: t, | ||
// ../node_modules/ts-dedent/dist/index.js | ||
var T = O((y) => { | ||
var S = O((y) => { | ||
"use strict"; | ||
Object.defineProperty(y, "__esModule", { value: !0 }); | ||
y.dedent = void 0; | ||
function M(t) { | ||
function I(t) { | ||
for (var e = [], o = 1; o < arguments.length; o++) | ||
@@ -109,4 +109,4 @@ e[o - 1] = arguments[o]; | ||
return p ? m.concat(p.map(function(x) { | ||
var g, d; | ||
return (d = (g = x.match(/[\t ]/g)) === null || g === void 0 ? void 0 : g.length) !== null && d !== void 0 ? d : 0; | ||
var g, b; | ||
return (b = (g = x.match(/[\t ]/g)) === null || g === void 0 ? void 0 : g.length) !== null && b !== void 0 ? b : 0; | ||
})) : m; | ||
@@ -123,23 +123,23 @@ }, []); | ||
n[0] = n[0].replace(/^\r?\n/, ""); | ||
var b = n[0]; | ||
var d = n[0]; | ||
return e.forEach(function(m, R) { | ||
var p = b.match(/(?:^|\n)( *)$/), x = p ? p[1] : "", g = m; | ||
var p = d.match(/(?:^|\n)( *)$/), x = p ? p[1] : "", g = m; | ||
typeof m == "string" && m.includes(` | ||
`) && (g = String(m).split(` | ||
`).map(function(d, se) { | ||
return se === 0 ? d : "" + x + d; | ||
`).map(function(b, ne) { | ||
return ne === 0 ? b : "" + x + b; | ||
}).join(` | ||
`)), b += g + n[R + 1]; | ||
}), b; | ||
`)), d += g + n[R + 1]; | ||
}), d; | ||
} | ||
s(M, "dedent"); | ||
y.dedent = M; | ||
y.default = M; | ||
s(I, "dedent"); | ||
y.dedent = I; | ||
y.default = I; | ||
}); | ||
// src/server-errors.ts | ||
var l = A(w(), 1), i = A(T(), 1); | ||
var l = A(w(), 1), i = A(S(), 1); | ||
// src/storybook-error.ts | ||
function I({ | ||
function M({ | ||
code: t, | ||
@@ -151,3 +151,3 @@ category: e | ||
} | ||
s(I, "parseErrorCode"); | ||
s(M, "parseErrorCode"); | ||
var a = class t extends Error { | ||
@@ -169,3 +169,3 @@ constructor(o) { | ||
get fullErrorCode() { | ||
return I({ code: this.code, category: this.category }); | ||
return M({ code: this.code, category: this.category }); | ||
} | ||
@@ -184,9 +184,9 @@ /** Overrides the default `Error.name` property in the format: SB_<CATEGORY>_<CODE>. */ | ||
}) { | ||
let b; | ||
return o === !0 ? b = `https://storybook.js.org/error/${I({ code: n, category: c })}` : typeof o == "string" ? b = o : Array.isArray(o) && | ||
(b = ` | ||
let d; | ||
return o === !0 ? d = `https://storybook.js.org/error/${M({ code: n, category: c })}` : typeof o == "string" ? d = o : Array.isArray(o) && | ||
(d = ` | ||
${o.map((m) => ` - ${m}`).join(` | ||
`)}`), `${u}${b != null ? ` | ||
`)}`), `${u}${d != null ? ` | ||
More info: ${b} | ||
More info: ${d} | ||
` : ""}`; | ||
@@ -197,3 +197,3 @@ } | ||
// src/server-errors.ts | ||
var de = /* @__PURE__ */ ((r) => (r.CLI = "CLI", r.CLI_INIT = "CLI_INIT", r.CLI_AUTOMIGRATE = "CLI_AUTOMIGRATE", r.CLI_UPGRADE = "CLI_UPGRAD\ | ||
var pe = /* @__PURE__ */ ((r) => (r.CLI = "CLI", r.CLI_INIT = "CLI_INIT", r.CLI_AUTOMIGRATE = "CLI_AUTOMIGRATE", r.CLI_UPGRADE = "CLI_UPGRAD\ | ||
E", r.CLI_ADD = "CLI_ADD", r.CODEMOD = "CODEMOD", r.CORE_SERVER = "CORE-SERVER", r.CSF_PLUGIN = "CSF-PLUGIN", r.CSF_TOOLS = "CSF-TOOLS", r.CORE_COMMON = | ||
@@ -209,3 +209,3 @@ "CORE-COMMON", r.NODE_LOGGER = "NODE-LOGGER", r.TELEMETRY = "TELEMETRY", r.BUILDER_MANAGER = "BUILDER-MANAGER", r.BUILDER_VITE = "BUILDER-VI\ | ||
AMEWORK_VUE3-WEBPACK5", r.FRAMEWORK_WEB_COMPONENTS_VITE = "FRAMEWORK_WEB-COMPONENTS-VITE", r.FRAMEWORK_WEB_COMPONENTS_WEBPACK5 = "FRAMEWORK_\ | ||
WEB-COMPONENTS-WEBPACK5", r))(de || {}), S = class extends a { | ||
WEB-COMPONENTS-WEBPACK5", r))(pe || {}), T = class extends a { | ||
static { | ||
@@ -339,3 +339,3 @@ s(this, "NxProjectDetectedError"); | ||
s(V, "removeAnsiEscapeCodes"); | ||
var j = class extends a { | ||
var $ = class extends a { | ||
constructor(o) { | ||
@@ -362,3 +362,3 @@ o.errors = o.errors.map((n) => ({ | ||
} | ||
}, F = class extends a { | ||
}, j = class extends a { | ||
constructor(o) { | ||
@@ -378,3 +378,3 @@ super({ | ||
} | ||
}, $ = class extends a { | ||
}, F = class extends a { | ||
static { | ||
@@ -492,3 +492,3 @@ s(this, "AngularLegacyBuildOptionsError"); | ||
} | ||
}, X = class extends a { | ||
}, J = class extends a { | ||
constructor(o) { | ||
@@ -530,3 +530,3 @@ let n = [ | ||
} | ||
}, z = class extends a { | ||
}, X = class extends a { | ||
constructor(o) { | ||
@@ -559,3 +559,3 @@ let n = { | ||
} | ||
}, J = class extends a { | ||
}, z = class extends a { | ||
constructor(o) { | ||
@@ -582,2 +582,18 @@ let n = l.default.white( | ||
super({ | ||
category: "CORE-SERVER", | ||
code: 16, | ||
message: `Status has typeId "${o.status.typeId}" but was added to store with typeId "${o.typeId}". Full status: ${JSON.stringify( | ||
o.status, | ||
null, | ||
2 | ||
)}` | ||
}); | ||
this.data = o; | ||
} | ||
static { | ||
s(this, "StatusTypeIdMismatchError"); | ||
} | ||
}, Q = class extends a { | ||
constructor(o) { | ||
super({ | ||
category: "CLI_INIT", | ||
@@ -596,3 +612,3 @@ code: 3, | ||
} | ||
}, Q = class extends a { | ||
}, Z = class extends a { | ||
constructor(o) { | ||
@@ -619,3 +635,3 @@ super({ | ||
} | ||
}, Z = class extends a { | ||
}, ee = class extends a { | ||
constructor(o) { | ||
@@ -645,3 +661,3 @@ super({ | ||
} | ||
}, ee = class extends a { | ||
}, oe = class extends a { | ||
static { | ||
@@ -661,3 +677,3 @@ s(this, "UpgradeStorybookUnknownCurrentVersionError"); | ||
} | ||
}, oe = class extends a { | ||
}, te = class extends a { | ||
static { | ||
@@ -676,3 +692,3 @@ s(this, "UpgradeStorybookInWrongWorkingDirectory"); | ||
} | ||
}, te = class extends a { | ||
}, re = class extends a { | ||
static { | ||
@@ -691,3 +707,3 @@ s(this, "NoStatsForViteDevError"); | ||
} | ||
}, re = class extends a { | ||
}, se = class extends a { | ||
constructor(o) { | ||
@@ -708,9 +724,9 @@ super({ | ||
export { | ||
$ as AngularLegacyBuildOptionsError, | ||
de as Category, | ||
F as AngularLegacyBuildOptionsError, | ||
pe as Category, | ||
L as ConflictingStaticDirConfigError, | ||
v as CouldNotEvaluateFrameworkError, | ||
D as CriticalPresetLoadError, | ||
re as FindPackageVersionsError, | ||
q as GenerateNewProjectOnInitError, | ||
se as FindPackageVersionsError, | ||
Q as GenerateNewProjectOnInitError, | ||
G as GoogleFontsDownloadError, | ||
@@ -720,18 +736,19 @@ Y as GoogleFontsLoadingError, | ||
B as InvalidStoriesEntryError, | ||
X as MainFileESMOnlyImportError, | ||
J as MainFileEvaluationError, | ||
z as MainFileMissingError, | ||
F as MissingAngularJsonError, | ||
J as MainFileESMOnlyImportError, | ||
z as MainFileEvaluationError, | ||
X as MainFileMissingError, | ||
j as MissingAngularJsonError, | ||
U as MissingBuilderError, | ||
W as MissingFrameworkFieldError, | ||
H as NoMatchingExportError, | ||
te as NoStatsForViteDevError, | ||
S as NxProjectDetectedError, | ||
oe as UpgradeStorybookInWrongWorkingDirectory, | ||
Q as UpgradeStorybookToLowerVersionError, | ||
Z as UpgradeStorybookToSameVersionError, | ||
ee as UpgradeStorybookUnknownCurrentVersionError, | ||
j as WebpackCompilationError, | ||
re as NoStatsForViteDevError, | ||
T as NxProjectDetectedError, | ||
q as StatusTypeIdMismatchError, | ||
te as UpgradeStorybookInWrongWorkingDirectory, | ||
Z as UpgradeStorybookToLowerVersionError, | ||
ee as UpgradeStorybookToSameVersionError, | ||
oe as UpgradeStorybookUnknownCurrentVersionError, | ||
$ as WebpackCompilationError, | ||
N as WebpackInvocationError, | ||
P as WebpackMissingStatsError | ||
}; |
{ | ||
"name": "storybook", | ||
"version": "0.0.0-pr-30761-sha-c5072ae0", | ||
"version": "0.0.0-pr-30764-sha-1b1e4113", | ||
"description": "Storybook framework-agnostic API", | ||
@@ -25,2 +25,6 @@ "keywords": [ | ||
"imports": { | ||
"#manager-status-store": { | ||
"storybook": "./src/manager/status-store.mock.ts", | ||
"default": "./src/manager/status-store.ts" | ||
}, | ||
"#utils": { | ||
@@ -27,0 +31,0 @@ "storybook": "./template/stories/utils.mock.ts", |
Sorry, the diff of this file is not supported yet
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 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 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
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent 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
584581
0.02%21537889
-0.05%