@storybook/svelte 10.5.2 → 10.6.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_cyqkhm89b9f from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_cyqkhm89b9f from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_cyqkhm89b9f from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_cyqkhm89b9f.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_cyqkhm89b9f.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_cyqkhm89b9f.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
package/dist/index.d.ts
CHANGED
|
@@ -1,57 +1,56 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import PreviewRender from '@storybook/svelte/internal/PreviewRender.svelte';
|
|
1
|
+
import { AnnotatedStoryFn, ArgTypes, Args, Args as Args$1, ArgsFromMeta, ArgsStoryFn, Canvas, ComponentAnnotations, ComposedStoryFn, DecoratorFunction, LoaderFunction, NamedOrDefaultProjectAnnotations, NormalizedProjectAnnotations, Parameters, ProjectAnnotations, Store_CSFExports, StoriesWithPartialProps, StoryAnnotations, StoryAnnotationsOrFn, StoryContext as StoryContext$1, StrictArgs, StrictArgs as StrictArgs$1, WebRenderer } from "storybook/internal/types";
|
|
2
|
+
import { Component, ComponentProps } from "svelte";
|
|
3
|
+
import { SetOptional, Simplify } from "type-fest";
|
|
4
|
+
import PreviewRender from "@storybook/svelte/internal/PreviewRender.svelte";
|
|
6
5
|
|
|
6
|
+
//#region code/renderers/svelte/.dts-emit/code/renderers/svelte/src/types.d.ts
|
|
7
7
|
interface SvelteRenderer<C extends Component<any, any, any> = Component<any, any, any>> extends WebRenderer {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
component: Component<this['T'] extends Record<string, any> ? this['T'] : any>;
|
|
9
|
+
storyResult: this['T'] extends Record<string, any> ? SvelteStoryResult<this['T']> : SvelteStoryResult;
|
|
10
|
+
mount: (Component?: C, options?: Record<string, any> & {
|
|
11
|
+
props: ComponentProps<C>;
|
|
12
|
+
}) => Promise<Canvas>;
|
|
13
13
|
}
|
|
14
14
|
interface SvelteStoryResult<Props extends Record<string, any> = any, Exports extends Record<string, any> = any, Bindings extends keyof Props | '' = string> {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
Component?: Component<Props, Exports, Bindings>;
|
|
16
|
+
props?: Props;
|
|
17
|
+
decorator?: Component<Props, Exports, Bindings>;
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region code/renderers/svelte/.dts-emit/code/renderers/svelte/src/public-types.d.ts
|
|
20
21
|
/**
|
|
21
22
|
* Metadata to configure the stories for a component.
|
|
22
23
|
*
|
|
23
24
|
* @see [Default export](https://storybook.js.org/docs/api/csf#default-export)
|
|
24
25
|
*/
|
|
25
|
-
type Meta<CmpOrArgs = Args> = CmpOrArgs extends Component<infer Props> ? ComponentAnnotations<SvelteRenderer<CmpOrArgs>, Props> : ComponentAnnotations<SvelteRenderer, CmpOrArgs>;
|
|
26
|
+
type Meta<CmpOrArgs = Args$1> = CmpOrArgs extends Component<infer Props> ? ComponentAnnotations<SvelteRenderer<CmpOrArgs>, Props> : ComponentAnnotations<SvelteRenderer, CmpOrArgs>;
|
|
26
27
|
/**
|
|
27
28
|
* Story function that represents a CSFv2 component example.
|
|
28
29
|
*
|
|
29
30
|
* @see [Named Story exports](https://storybook.js.org/docs/api/csf#named-story-exports)
|
|
30
31
|
*/
|
|
31
|
-
type StoryFn<TCmpOrArgs = Args> = TCmpOrArgs extends Component<infer Props> ? AnnotatedStoryFn<SvelteRenderer, Props> : AnnotatedStoryFn<SvelteRenderer, TCmpOrArgs>;
|
|
32
|
+
type StoryFn<TCmpOrArgs = Args$1> = TCmpOrArgs extends Component<infer Props> ? AnnotatedStoryFn<SvelteRenderer, Props> : AnnotatedStoryFn<SvelteRenderer, TCmpOrArgs>;
|
|
32
33
|
/**
|
|
33
34
|
* Story object that represents a CSFv3 component example.
|
|
34
35
|
*
|
|
35
36
|
* @see [Named Story exports](https://storybook.js.org/docs/api/csf#named-story-exports)
|
|
36
37
|
*/
|
|
37
|
-
type StoryObj<MetaOrCmpOrArgs = Args> = MetaOrCmpOrArgs extends {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
type StoryObj<MetaOrCmpOrArgs = Args$1> = MetaOrCmpOrArgs extends {
|
|
39
|
+
render?: ArgsStoryFn<SvelteRenderer, any>;
|
|
40
|
+
component: infer Comp;
|
|
41
|
+
args?: infer DefaultArgs;
|
|
41
42
|
} ? Simplify<ComponentProps<Comp extends Component<any, any, any> ? Comp : never> & ArgsFromMeta<SvelteRenderer, MetaOrCmpOrArgs>> extends infer TArgs ? StoryAnnotations<SvelteRenderer<Comp extends Component<any, any, any> ? Comp : never>, TArgs, SetOptional<TArgs, Extract<keyof TArgs, keyof DefaultArgs>>> : never : MetaOrCmpOrArgs extends Component<any, any, any> ? StoryAnnotations<SvelteRenderer<MetaOrCmpOrArgs>, ComponentProps<MetaOrCmpOrArgs>> : StoryAnnotations<SvelteRenderer, MetaOrCmpOrArgs>;
|
|
42
|
-
|
|
43
|
-
type
|
|
44
|
-
type
|
|
45
|
-
type StoryContext<TArgs = StrictArgs> = StoryContext$1<SvelteRenderer, TArgs>;
|
|
43
|
+
type Decorator<TArgs = StrictArgs$1> = DecoratorFunction<SvelteRenderer, TArgs>;
|
|
44
|
+
type Loader<TArgs = StrictArgs$1> = LoaderFunction<SvelteRenderer, TArgs>;
|
|
45
|
+
type StoryContext<TArgs = StrictArgs$1> = StoryContext$1<SvelteRenderer, TArgs>;
|
|
46
46
|
type Preview = ProjectAnnotations<SvelteRenderer>;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
type MapToComposed<TModule> = {
|
|
53
|
-
[K in keyof TModule]: TModule[K] extends StoryAnnotationsOrFn<SvelteRenderer, infer TArgs extends Args> ? ComposedStory<TArgs> : never;
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region code/renderers/svelte/.dts-emit/code/renderers/svelte/src/portable-stories.d.ts
|
|
49
|
+
type ComposedStory<TArgs extends Args$1 = any> = ComposedStoryFn<SvelteRenderer, TArgs> & {
|
|
50
|
+
Component: typeof PreviewRender;
|
|
51
|
+
props: any;
|
|
54
52
|
};
|
|
53
|
+
type MapToComposed<TModule> = { [K in keyof TModule]: TModule[K] extends StoryAnnotationsOrFn<SvelteRenderer, infer TArgs extends Args$1> ? ComposedStory<TArgs> : never };
|
|
55
54
|
/**
|
|
56
55
|
* Function that sets the globalConfig of your storybook. The global config is the preview module of
|
|
57
56
|
* your .storybook folder.
|
|
@@ -101,7 +100,7 @@ declare const INTERNAL_DEFAULT_PROJECT_ANNOTATIONS: ProjectAnnotations<SvelteRen
|
|
|
101
100
|
* this can be applied automatically if you use `setProjectAnnotations` in your setup files.
|
|
102
101
|
* @param [exportsName] - In case your story does not contain a name and you want it to have a name.
|
|
103
102
|
*/
|
|
104
|
-
declare function composeStory<TArgs extends Args = Args>(story: StoryAnnotationsOrFn<SvelteRenderer, TArgs>, componentAnnotations: Meta<TArgs | any>, projectAnnotations?: ProjectAnnotations<SvelteRenderer>, exportsName?: string): ComposedStory<TArgs>;
|
|
103
|
+
declare function composeStory<TArgs extends Args$1 = Args$1>(story: StoryAnnotationsOrFn<SvelteRenderer, TArgs>, componentAnnotations: Meta<TArgs | any>, projectAnnotations?: ProjectAnnotations<SvelteRenderer>, exportsName?: string): ComposedStory<TArgs>;
|
|
105
104
|
/**
|
|
106
105
|
* Function that will receive a stories import (e.g. `import * as stories from './Button.stories'`)
|
|
107
106
|
* and optionally projectAnnotations (e.g. `import * from '../.storybook/preview`) and will return
|
|
@@ -130,5 +129,5 @@ declare function composeStory<TArgs extends Args = Args>(story: StoryAnnotations
|
|
|
130
129
|
* this can be applied automatically if you use `setProjectAnnotations` in your setup files.
|
|
131
130
|
*/
|
|
132
131
|
declare function composeStories<TModule extends Store_CSFExports<SvelteRenderer, any>>(csfExports: TModule, projectAnnotations?: ProjectAnnotations<SvelteRenderer>): Omit<MapToComposed<StoriesWithPartialProps<SvelteRenderer, TModule>>, keyof Store_CSFExports>;
|
|
133
|
-
|
|
134
|
-
export { type Decorator, INTERNAL_DEFAULT_PROJECT_ANNOTATIONS,
|
|
132
|
+
//#endregion
|
|
133
|
+
export { type ArgTypes, type Args, Decorator, INTERNAL_DEFAULT_PROJECT_ANNOTATIONS, Loader, Meta, type Parameters, Preview, StoryContext, StoryFn, StoryObj, type StrictArgs, type SvelteRenderer, composeStories, composeStory, setProjectAnnotations };
|
package/dist/playwright.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { createPlaywrightTest as createTest } from "storybook/preview-api";
|
|
2
|
+
export { createTest };
|
package/dist/preset.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_cyqkhm89b9f from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_cyqkhm89b9f from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_cyqkhm89b9f from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_cyqkhm89b9f.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_cyqkhm89b9f.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_cyqkhm89b9f.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -18,7 +18,7 @@ var previewAnnotations = async (input = [], options) => {
|
|
|
18
18
|
docsEnabled ? [fileURLToPath(import.meta.resolve("@storybook/svelte/entry-preview-docs"))] : []
|
|
19
19
|
);
|
|
20
20
|
}, experimental_importParsers = async (input = []) => {
|
|
21
|
-
let { svelteImportParser } = await import("./_node-chunks/parsers-
|
|
21
|
+
let { svelteImportParser } = await import("./_node-chunks/parsers-C5WPTCAO.js");
|
|
22
22
|
return [...input, svelteImportParser];
|
|
23
23
|
};
|
|
24
24
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/svelte",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.6.0-alpha.1",
|
|
4
4
|
"description": "Storybook Svelte renderer: Develop, document, and test UI components in isolation.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -60,13 +60,13 @@
|
|
|
60
60
|
"@sveltejs/vite-plugin-svelte": "^6.2.0",
|
|
61
61
|
"@testing-library/svelte": "^5.2.4",
|
|
62
62
|
"svelte": "^5.39.5",
|
|
63
|
-
"svelte-check": "^4.
|
|
63
|
+
"svelte-check": "^4.4.8",
|
|
64
64
|
"sveltedoc-parser": "^4.2.1",
|
|
65
|
-
"typescript": "^
|
|
65
|
+
"typescript": "^6.0.3",
|
|
66
66
|
"vite": "^7.0.4"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"storybook": "^10.
|
|
69
|
+
"storybook": "^10.6.0-alpha.1",
|
|
70
70
|
"svelte": "^5.0.0"
|
|
71
71
|
},
|
|
72
72
|
"publishConfig": {
|