@storybook/sveltekit 11.0.0-alpha.7 → 11.0.0-alpha.8
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-V7G2TCOC.js} +6 -6
- package/dist/{chunk-D3kX1WMe.d.ts → chunk-uEjyQZBl.d.ts} +23 -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 +5 -5
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_ao98lxthyig from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_ao98lxthyig from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_ao98lxthyig from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_ao98lxthyig.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_ao98lxthyig.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_ao98lxthyig.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>;
|
|
@@ -57,7 +52,9 @@ interface Page<Params extends Record<string, string> = Record<string, string>, R
|
|
|
57
52
|
id: RouteId;
|
|
58
53
|
};
|
|
59
54
|
status: number;
|
|
60
|
-
error:
|
|
55
|
+
error: ({
|
|
56
|
+
message: string;
|
|
57
|
+
} & Record<string, any>) | null;
|
|
61
58
|
data: Record<string, any>;
|
|
62
59
|
state: Record<string, any>;
|
|
63
60
|
form: any;
|
|
@@ -90,27 +87,33 @@ interface Navigation {
|
|
|
90
87
|
delta?: number;
|
|
91
88
|
complete: Promise<void>;
|
|
92
89
|
}
|
|
90
|
+
type MockOf<F extends (...args: any[]) => unknown> = (...args: Parameters<F>) => void;
|
|
93
91
|
type SvelteKitParameters = Partial<{
|
|
94
92
|
hrefs: Record<string, HrefConfig>;
|
|
95
|
-
state: {
|
|
93
|
+
state: Partial<{
|
|
96
94
|
page: Partial<Page>;
|
|
97
95
|
navigating: Partial<Navigation>;
|
|
98
96
|
updated: {
|
|
99
97
|
current: boolean;
|
|
100
98
|
};
|
|
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
|
|
99
|
+
}>;
|
|
100
|
+
navigation: Partial<{
|
|
101
|
+
goto: MockOf<typeof goto>;
|
|
102
|
+
invalidate: MockOf<typeof invalidate>;
|
|
103
|
+
invalidateAll: MockOf<typeof invalidateAll>;
|
|
104
|
+
refreshAll: MockOf<typeof refreshAll>;
|
|
105
|
+
pushState: MockOf<typeof pushState>;
|
|
106
|
+
replaceState: MockOf<typeof replaceState>;
|
|
109
107
|
afterNavigate: Record<string, any>;
|
|
110
|
-
}
|
|
111
|
-
forms: {
|
|
112
|
-
enhance:
|
|
113
|
-
}
|
|
108
|
+
}>;
|
|
109
|
+
forms: Partial<{
|
|
110
|
+
enhance: (event: SubmitEvent) => void;
|
|
111
|
+
}>;
|
|
114
112
|
}>;
|
|
113
|
+
interface SvelteKitTypes {
|
|
114
|
+
parameters: {
|
|
115
|
+
/** Mocks for the SvelteKit modules, such as `$app/state` and `$app/navigation`. */sveltekit_experimental?: SvelteKitParameters;
|
|
116
|
+
};
|
|
117
|
+
}
|
|
115
118
|
//#endregion
|
|
116
|
-
export { SvelteKitParameters as a, StorybookConfig$1 as i, HrefConfig as n, NormalizedHrefConfig as r, FrameworkOptions as t };
|
|
119
|
+
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-uEjyQZBl.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-uEjyQZBl.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_ao98lxthyig from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_ao98lxthyig from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_ao98lxthyig from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_ao98lxthyig.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_ao98lxthyig.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_ao98lxthyig.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_ao98lxthyig from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_ao98lxthyig from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_ao98lxthyig from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_ao98lxthyig.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_ao98lxthyig.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_ao98lxthyig.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-V7G2TCOC.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_ao98lxthyig from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_ao98lxthyig from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_ao98lxthyig from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_ao98lxthyig.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_ao98lxthyig.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_ao98lxthyig.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-V7G2TCOC.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.8",
|
|
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.8",
|
|
60
|
+
"@storybook/svelte": "11.0.0-alpha.8",
|
|
61
|
+
"@storybook/svelte-vite": "11.0.0-alpha.8"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@types/node": "^22.19.1",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
70
|
"@sveltejs/kit": "^3.0.0",
|
|
71
|
-
"storybook": "^11.0.0-alpha.
|
|
71
|
+
"storybook": "^11.0.0-alpha.8",
|
|
72
72
|
"svelte": "^5.0.0",
|
|
73
73
|
"vite": "^8.0.0"
|
|
74
74
|
},
|