@storybook/sveltekit 11.0.0-alpha.7 → 11.0.0-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_node-chunks/{chunk-UCZ67QLF.js → chunk-RKMYY72D.js} +6 -6
- package/dist/{chunk-D3kX1WMe.d.ts → chunk-Curl48fh.d.ts} +24 -20
- package/dist/index.d.ts +15 -4
- package/dist/index.js +10 -0
- package/dist/node/index.d.ts +1 -1
- package/dist/node/index.js +6 -6
- package/dist/preset.js +7 -7
- package/dist/vite-plugin.js +7 -7
- package/package.json +6 -5
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_lo19bciwawi from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_lo19bciwawi from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_lo19bciwawi from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_lo19bciwawi.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_lo19bciwawi.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_lo19bciwawi.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { CompatibleString, StorybookConfig } from "storybook/internal/types";
|
|
2
2
|
import { BuilderOptions, StorybookConfigVite } from "@storybook/builder-vite";
|
|
3
3
|
|
|
4
|
-
//#region code/frameworks/sveltekit/.dts-emit/code/frameworks/sveltekit/src/mocks/app/forms.d.ts
|
|
5
|
-
declare function enhance(form: HTMLFormElement): {
|
|
6
|
-
destroy(): void;
|
|
7
|
-
};
|
|
8
|
-
//#endregion
|
|
9
4
|
//#region code/frameworks/sveltekit/.dts-emit/code/frameworks/sveltekit/src/mocks/app/navigation.d.ts
|
|
10
5
|
declare function goto(...args: any[]): Promise<void>;
|
|
11
6
|
declare function invalidate(...args: any[]): Promise<void>;
|
|
@@ -24,6 +19,7 @@ type FrameworkOptions = {
|
|
|
24
19
|
* slots. When disabled, Storybook will skip the docgen processing step during build, which can
|
|
25
20
|
* improve build performance.
|
|
26
21
|
*
|
|
22
|
+
* @deprecated Builder docgen is removed in Storybook 12. Use `features.docgenServer`.
|
|
27
23
|
* @default true
|
|
28
24
|
*/
|
|
29
25
|
docgen?: boolean;
|
|
@@ -57,7 +53,9 @@ interface Page<Params extends Record<string, string> = Record<string, string>, R
|
|
|
57
53
|
id: RouteId;
|
|
58
54
|
};
|
|
59
55
|
status: number;
|
|
60
|
-
error:
|
|
56
|
+
error: ({
|
|
57
|
+
message: string;
|
|
58
|
+
} & Record<string, any>) | null;
|
|
61
59
|
data: Record<string, any>;
|
|
62
60
|
state: Record<string, any>;
|
|
63
61
|
form: any;
|
|
@@ -90,27 +88,33 @@ interface Navigation {
|
|
|
90
88
|
delta?: number;
|
|
91
89
|
complete: Promise<void>;
|
|
92
90
|
}
|
|
91
|
+
type MockOf<F extends (...args: any[]) => unknown> = (...args: Parameters<F>) => void;
|
|
93
92
|
type SvelteKitParameters = Partial<{
|
|
94
93
|
hrefs: Record<string, HrefConfig>;
|
|
95
|
-
state: {
|
|
94
|
+
state: Partial<{
|
|
96
95
|
page: Partial<Page>;
|
|
97
96
|
navigating: Partial<Navigation>;
|
|
98
97
|
updated: {
|
|
99
98
|
current: boolean;
|
|
100
99
|
};
|
|
101
|
-
}
|
|
102
|
-
navigation: {
|
|
103
|
-
goto: typeof goto
|
|
104
|
-
invalidate: typeof invalidate
|
|
105
|
-
invalidateAll: typeof invalidateAll
|
|
106
|
-
refreshAll: typeof refreshAll
|
|
107
|
-
pushState: typeof pushState
|
|
108
|
-
replaceState: typeof replaceState
|
|
100
|
+
}>;
|
|
101
|
+
navigation: Partial<{
|
|
102
|
+
goto: MockOf<typeof goto>;
|
|
103
|
+
invalidate: MockOf<typeof invalidate>;
|
|
104
|
+
invalidateAll: MockOf<typeof invalidateAll>;
|
|
105
|
+
refreshAll: MockOf<typeof refreshAll>;
|
|
106
|
+
pushState: MockOf<typeof pushState>;
|
|
107
|
+
replaceState: MockOf<typeof replaceState>;
|
|
109
108
|
afterNavigate: Record<string, any>;
|
|
110
|
-
}
|
|
111
|
-
forms: {
|
|
112
|
-
enhance:
|
|
113
|
-
}
|
|
109
|
+
}>;
|
|
110
|
+
forms: Partial<{
|
|
111
|
+
enhance: (event: SubmitEvent) => void;
|
|
112
|
+
}>;
|
|
114
113
|
}>;
|
|
114
|
+
interface SvelteKitTypes {
|
|
115
|
+
parameters: {
|
|
116
|
+
/** Mocks for the SvelteKit modules, such as `$app/state` and `$app/navigation`. */sveltekit_experimental?: SvelteKitParameters;
|
|
117
|
+
};
|
|
118
|
+
}
|
|
115
119
|
//#endregion
|
|
116
|
-
export { SvelteKitParameters as a, StorybookConfig$1 as i, HrefConfig as n, NormalizedHrefConfig as r, FrameworkOptions as t };
|
|
120
|
+
export { SvelteKitParameters as a, StorybookConfig$1 as i, HrefConfig as n, SvelteKitTypes as o, NormalizedHrefConfig as r, FrameworkOptions as t };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { a as SvelteKitParameters, i as StorybookConfig, n as HrefConfig, r as NormalizedHrefConfig, t as FrameworkOptions } from "./chunk-
|
|
2
|
-
import {
|
|
3
|
-
import { NamedOrDefaultProjectAnnotations, NormalizedProjectAnnotations } from "storybook/internal/types";
|
|
1
|
+
import { a as SvelteKitParameters, i as StorybookConfig, n as HrefConfig, o as SvelteKitTypes, r as NormalizedHrefConfig, t as FrameworkOptions } from "./chunk-Curl48fh.js";
|
|
2
|
+
import { AddonTypes, InferTypes, PreviewAddonEntry } from "storybook/internal/csf";
|
|
3
|
+
import { NamedOrDefaultProjectAnnotations, NormalizedProjectAnnotations, ProjectAnnotations } from "storybook/internal/types";
|
|
4
|
+
import { SveltePreview, SvelteRenderer, SvelteTypes } from "@storybook/svelte";
|
|
4
5
|
export * from "@storybook/svelte";
|
|
5
6
|
|
|
6
7
|
//#region code/frameworks/sveltekit/.dts-emit/code/frameworks/sveltekit/src/portable-stories.d.ts
|
|
@@ -25,4 +26,14 @@ export * from "@storybook/svelte";
|
|
|
25
26
|
*/
|
|
26
27
|
declare function setProjectAnnotations(projectAnnotations: NamedOrDefaultProjectAnnotations<any> | NamedOrDefaultProjectAnnotations<any>[]): NormalizedProjectAnnotations<SvelteRenderer>;
|
|
27
28
|
//#endregion
|
|
28
|
-
|
|
29
|
+
//#region code/frameworks/sveltekit/.dts-emit/code/frameworks/sveltekit/src/index.d.ts
|
|
30
|
+
/**
|
|
31
|
+
* Define the preview of a SvelteKit project, with the `preview.meta()` and `meta.story()`
|
|
32
|
+
* factories. It includes the SvelteKit mocks, configured with `parameters.sveltekit_experimental`.
|
|
33
|
+
*/
|
|
34
|
+
declare function definePreview<Addons extends PreviewAddonEntry[] = []>(preview: {
|
|
35
|
+
addons?: Addons;
|
|
36
|
+
} & ProjectAnnotations<SvelteTypes & SvelteKitTypes & InferTypes<Addons>>): SvelteKitPreview<InferTypes<Addons>>;
|
|
37
|
+
interface SvelteKitPreview<T extends AddonTypes> extends SveltePreview<SvelteKitTypes & T> {}
|
|
38
|
+
//#endregion
|
|
39
|
+
export { FrameworkOptions, HrefConfig, NormalizedHrefConfig, StorybookConfig, SvelteKitParameters, SvelteKitPreview, SvelteKitTypes, definePreview, setProjectAnnotations };
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
import "./_browser-chunks/chunk-4BE7D4DS.js";
|
|
5
5
|
|
|
6
6
|
// src/index.ts
|
|
7
|
+
import { __definePreview } from "@storybook/svelte";
|
|
7
8
|
export * from "@storybook/svelte";
|
|
8
9
|
|
|
9
10
|
// src/portable-stories.ts
|
|
@@ -22,6 +23,15 @@ var INTERNAL_DEFAULT_PROJECT_ANNOTATIONS = composeConfigs([
|
|
|
22
23
|
svelteAnnotations,
|
|
23
24
|
preview_exports
|
|
24
25
|
]);
|
|
26
|
+
|
|
27
|
+
// src/index.ts
|
|
28
|
+
function definePreview(preview) {
|
|
29
|
+
return __definePreview({
|
|
30
|
+
...preview,
|
|
31
|
+
addons: [preview_exports, ...preview.addons ?? []]
|
|
32
|
+
});
|
|
33
|
+
}
|
|
25
34
|
export {
|
|
35
|
+
definePreview,
|
|
26
36
|
setProjectAnnotations
|
|
27
37
|
};
|
package/dist/node/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as StorybookConfig } from "../chunk-
|
|
1
|
+
import { i as StorybookConfig } from "../chunk-Curl48fh.js";
|
|
2
2
|
|
|
3
3
|
//#region code/frameworks/sveltekit/.dts-emit/code/frameworks/sveltekit/src/node/index.d.ts
|
|
4
4
|
declare function defineMain(config: StorybookConfig): StorybookConfig;
|
package/dist/node/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_lo19bciwawi from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_lo19bciwawi from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_lo19bciwawi from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_lo19bciwawi.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_lo19bciwawi.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_lo19bciwawi.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
package/dist/preset.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_lo19bciwawi from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_lo19bciwawi from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_lo19bciwawi from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_lo19bciwawi.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_lo19bciwawi.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_lo19bciwawi.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
mockSveltekitModules
|
|
14
|
-
} from "./_node-chunks/chunk-
|
|
14
|
+
} from "./_node-chunks/chunk-RKMYY72D.js";
|
|
15
15
|
|
|
16
16
|
// src/preset.ts
|
|
17
17
|
import { existsSync } from "node:fs";
|
package/dist/vite-plugin.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_lo19bciwawi from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_lo19bciwawi from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_lo19bciwawi from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_lo19bciwawi.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_lo19bciwawi.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_lo19bciwawi.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
mockSveltekitModules
|
|
14
|
-
} from "./_node-chunks/chunk-
|
|
14
|
+
} from "./_node-chunks/chunk-RKMYY72D.js";
|
|
15
15
|
|
|
16
16
|
// src/vite-plugin.ts
|
|
17
17
|
var storybookSveltekitPlugin = () => [mockSveltekitModules()];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/sveltekit",
|
|
3
|
-
"version": "11.0.0-alpha.
|
|
3
|
+
"version": "11.0.0-alpha.9",
|
|
4
4
|
"description": "Storybook for SvelteKit: Develop, document, and test UI components in isolation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -56,9 +56,9 @@
|
|
|
56
56
|
"*.d.ts"
|
|
57
57
|
],
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@storybook/builder-vite": "11.0.0-alpha.
|
|
60
|
-
"@storybook/svelte": "11.0.0-alpha.
|
|
61
|
-
"@storybook/svelte-vite": "11.0.0-alpha.
|
|
59
|
+
"@storybook/builder-vite": "11.0.0-alpha.9",
|
|
60
|
+
"@storybook/svelte": "11.0.0-alpha.9",
|
|
61
|
+
"@storybook/svelte-vite": "11.0.0-alpha.9"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@types/node": "^22.19.1",
|
|
@@ -68,8 +68,9 @@
|
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
70
|
"@sveltejs/kit": "^3.0.0",
|
|
71
|
-
"storybook": "^11.0.0-alpha.
|
|
71
|
+
"storybook": "^11.0.0-alpha.9",
|
|
72
72
|
"svelte": "^5.0.0",
|
|
73
|
+
"typescript": "^5.9.0 || ^6.0.0 || ^7.0.0",
|
|
73
74
|
"vite": "^8.0.0"
|
|
74
75
|
},
|
|
75
76
|
"publishConfig": {
|