@storybook/sveltekit 9.2.0-alpha.3 → 10.0.0-beta.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.
- package/README.md +3 -1
- package/dist/_browser-chunks/chunk-JFJ5UJ7Q.js +11 -0
- package/dist/_browser-chunks/chunk-MNND3IGN.js +45 -0
- package/dist/_browser-chunks/chunk-T276X65R.js +82 -0
- package/dist/_browser-chunks/chunk-Y4OPRTUT.js +104 -0
- package/dist/_node-chunks/chunk-EJIACILG.js +17 -0
- package/dist/_node-chunks/chunk-ZWPLD3PK.js +35 -0
- package/dist/index.d.ts +60 -4
- package/dist/index.js +33 -1
- package/dist/mocks/app/forms.js +33 -0
- package/dist/mocks/app/navigation.js +29 -0
- package/dist/mocks/app/stores.js +19 -0
- package/dist/node/index.d.ts +29 -3
- package/dist/node/index.js +23 -1
- package/dist/preset.js +71 -1
- package/dist/preview.js +9 -1
- package/dist/vite-plugin.js +25 -1
- package/package.json +25 -46
- package/preset.js +1 -1
- package/preview.js +1 -0
- package/dist/chunk-CEH6MNVV.mjs +0 -3
- package/dist/chunk-UUT6FZ4K.mjs +0 -7
- package/dist/index.mjs +0 -9
- package/dist/node/index.mjs +0 -5
- package/dist/preset.d.ts +0 -9
- package/dist/preview.d.ts +0 -5
- package/dist/preview.mjs +0 -2
- package/dist/types-3f08d935.d.ts +0 -53
- package/dist/vite-plugin.d.ts +0 -14
- package/dist/vite-plugin.mjs +0 -7
package/README.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# Storybook for SvelteKit
|
|
2
2
|
|
|
3
|
-
See [documentation](https://storybook.js.org/docs/get-started/frameworks/sveltekit?renderer=svelte) for installation instructions, usage examples, APIs, and more.
|
|
3
|
+
See [documentation](https://storybook.js.org/docs/get-started/frameworks/sveltekit?renderer=svelte&ref=readme) for installation instructions, usage examples, APIs, and more.
|
|
4
4
|
|
|
5
5
|
## Acknowledgements
|
|
6
6
|
|
|
7
7
|
Integrating with SvelteKit would not have been possible if it weren't for the fantastic efforts by the Svelte core team - especially [Ben McCann](https://twitter.com/benjaminmccann) - to make integrations with the wider ecosystem possible.
|
|
8
8
|
A big thank you also goes out to [Paolo Ricciuti](https://twitter.com/PaoloRicciuti) for improving the mocking capabilities.
|
|
9
|
+
|
|
10
|
+
Learn more about Storybook at [storybook.js.org](https://storybook.js.org/?ref=readme).
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
var __export = (target, all) => {
|
|
4
|
+
for (var name in all)
|
|
5
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export {
|
|
9
|
+
__name,
|
|
10
|
+
__export
|
|
11
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__name
|
|
3
|
+
} from "./chunk-JFJ5UJ7Q.js";
|
|
4
|
+
|
|
5
|
+
// src/mocks/app/stores.ts
|
|
6
|
+
import { getContext, setContext } from "svelte";
|
|
7
|
+
function createMockedStore(contextName) {
|
|
8
|
+
return [
|
|
9
|
+
{
|
|
10
|
+
subscribe(runner) {
|
|
11
|
+
const page2 = getContext(contextName);
|
|
12
|
+
runner(page2);
|
|
13
|
+
return () => {
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
(value) => {
|
|
18
|
+
setContext(contextName, value);
|
|
19
|
+
}
|
|
20
|
+
];
|
|
21
|
+
}
|
|
22
|
+
__name(createMockedStore, "createMockedStore");
|
|
23
|
+
var [page, setPage] = createMockedStore("page-ctx");
|
|
24
|
+
var [navigating, setNavigating] = createMockedStore("navigating-ctx");
|
|
25
|
+
var [updated, setUpdated] = createMockedStore("updated-ctx");
|
|
26
|
+
updated.check = () => {
|
|
27
|
+
};
|
|
28
|
+
function getStores() {
|
|
29
|
+
return {
|
|
30
|
+
page,
|
|
31
|
+
navigating,
|
|
32
|
+
updated
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
__name(getStores, "getStores");
|
|
36
|
+
|
|
37
|
+
export {
|
|
38
|
+
page,
|
|
39
|
+
setPage,
|
|
40
|
+
navigating,
|
|
41
|
+
setNavigating,
|
|
42
|
+
updated,
|
|
43
|
+
setUpdated,
|
|
44
|
+
getStores
|
|
45
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__name
|
|
3
|
+
} from "./chunk-JFJ5UJ7Q.js";
|
|
4
|
+
|
|
5
|
+
// src/mocks/app/navigation.ts
|
|
6
|
+
import { getContext, onMount, setContext } from "svelte";
|
|
7
|
+
async function goto(...args) {
|
|
8
|
+
const event = new CustomEvent("storybook:goto", {
|
|
9
|
+
detail: args
|
|
10
|
+
});
|
|
11
|
+
window.dispatchEvent(event);
|
|
12
|
+
}
|
|
13
|
+
__name(goto, "goto");
|
|
14
|
+
function setAfterNavigateArgument(afterNavigateArgs) {
|
|
15
|
+
setContext("after-navigate-args", afterNavigateArgs);
|
|
16
|
+
}
|
|
17
|
+
__name(setAfterNavigateArgument, "setAfterNavigateArgument");
|
|
18
|
+
function afterNavigate(cb) {
|
|
19
|
+
const argument = getContext("after-navigate-args");
|
|
20
|
+
onMount(() => {
|
|
21
|
+
if (cb && cb instanceof Function) {
|
|
22
|
+
cb(argument);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
__name(afterNavigate, "afterNavigate");
|
|
27
|
+
function onNavigate() {
|
|
28
|
+
}
|
|
29
|
+
__name(onNavigate, "onNavigate");
|
|
30
|
+
function beforeNavigate() {
|
|
31
|
+
}
|
|
32
|
+
__name(beforeNavigate, "beforeNavigate");
|
|
33
|
+
function disableScrollHandling() {
|
|
34
|
+
}
|
|
35
|
+
__name(disableScrollHandling, "disableScrollHandling");
|
|
36
|
+
async function invalidate(...args) {
|
|
37
|
+
const event = new CustomEvent("storybook:invalidate", {
|
|
38
|
+
detail: args
|
|
39
|
+
});
|
|
40
|
+
window.dispatchEvent(event);
|
|
41
|
+
}
|
|
42
|
+
__name(invalidate, "invalidate");
|
|
43
|
+
async function invalidateAll() {
|
|
44
|
+
const event = new CustomEvent("storybook:invalidateAll");
|
|
45
|
+
window.dispatchEvent(event);
|
|
46
|
+
}
|
|
47
|
+
__name(invalidateAll, "invalidateAll");
|
|
48
|
+
function preloadCode() {
|
|
49
|
+
}
|
|
50
|
+
__name(preloadCode, "preloadCode");
|
|
51
|
+
function preloadData() {
|
|
52
|
+
}
|
|
53
|
+
__name(preloadData, "preloadData");
|
|
54
|
+
async function pushState(...args) {
|
|
55
|
+
const event = new CustomEvent("storybook:pushState", {
|
|
56
|
+
detail: args
|
|
57
|
+
});
|
|
58
|
+
window.dispatchEvent(event);
|
|
59
|
+
}
|
|
60
|
+
__name(pushState, "pushState");
|
|
61
|
+
async function replaceState(...args) {
|
|
62
|
+
const event = new CustomEvent("storybook:replaceState", {
|
|
63
|
+
detail: args
|
|
64
|
+
});
|
|
65
|
+
window.dispatchEvent(event);
|
|
66
|
+
}
|
|
67
|
+
__name(replaceState, "replaceState");
|
|
68
|
+
|
|
69
|
+
export {
|
|
70
|
+
goto,
|
|
71
|
+
setAfterNavigateArgument,
|
|
72
|
+
afterNavigate,
|
|
73
|
+
onNavigate,
|
|
74
|
+
beforeNavigate,
|
|
75
|
+
disableScrollHandling,
|
|
76
|
+
invalidate,
|
|
77
|
+
invalidateAll,
|
|
78
|
+
preloadCode,
|
|
79
|
+
preloadData,
|
|
80
|
+
pushState,
|
|
81
|
+
replaceState
|
|
82
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import {
|
|
2
|
+
setAfterNavigateArgument
|
|
3
|
+
} from "./chunk-T276X65R.js";
|
|
4
|
+
import {
|
|
5
|
+
setNavigating,
|
|
6
|
+
setPage,
|
|
7
|
+
setUpdated
|
|
8
|
+
} from "./chunk-MNND3IGN.js";
|
|
9
|
+
import {
|
|
10
|
+
__export,
|
|
11
|
+
__name
|
|
12
|
+
} from "./chunk-JFJ5UJ7Q.js";
|
|
13
|
+
|
|
14
|
+
// src/preview.ts
|
|
15
|
+
var preview_exports = {};
|
|
16
|
+
__export(preview_exports, {
|
|
17
|
+
decorators: () => decorators
|
|
18
|
+
});
|
|
19
|
+
import { action } from "storybook/actions";
|
|
20
|
+
import { onMount } from "svelte";
|
|
21
|
+
var normalizeHrefConfig = /* @__PURE__ */ __name((hrefConfig) => {
|
|
22
|
+
if (typeof hrefConfig === "function") {
|
|
23
|
+
return { callback: hrefConfig, asRegex: false };
|
|
24
|
+
}
|
|
25
|
+
return hrefConfig;
|
|
26
|
+
}, "normalizeHrefConfig");
|
|
27
|
+
var svelteKitMocksDecorator = /* @__PURE__ */ __name((Story, ctx) => {
|
|
28
|
+
const svelteKitParameters = ctx.parameters?.sveltekit_experimental ?? {};
|
|
29
|
+
setPage(svelteKitParameters?.stores?.page);
|
|
30
|
+
setNavigating(svelteKitParameters?.stores?.navigating);
|
|
31
|
+
setUpdated(svelteKitParameters?.stores?.updated);
|
|
32
|
+
setAfterNavigateArgument(svelteKitParameters?.navigation?.afterNavigate);
|
|
33
|
+
onMount(() => {
|
|
34
|
+
const globalClickListener = /* @__PURE__ */ __name((e) => {
|
|
35
|
+
const path = e.composedPath();
|
|
36
|
+
const element = path.findLast((el) => el instanceof HTMLElement && el.tagName === "A");
|
|
37
|
+
if (element && element instanceof HTMLAnchorElement) {
|
|
38
|
+
const to = element.getAttribute("href");
|
|
39
|
+
if (!to) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
e.preventDefault();
|
|
43
|
+
const defaultActionCallback = /* @__PURE__ */ __name(() => action("navigate")(to, e), "defaultActionCallback");
|
|
44
|
+
if (!svelteKitParameters.hrefs) {
|
|
45
|
+
defaultActionCallback();
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
let callDefaultCallback = true;
|
|
49
|
+
Object.entries(svelteKitParameters.hrefs).forEach(([href, hrefConfig]) => {
|
|
50
|
+
const { callback, asRegex } = normalizeHrefConfig(hrefConfig);
|
|
51
|
+
const isMatch = asRegex ? new RegExp(href).test(to) : to === href;
|
|
52
|
+
if (isMatch) {
|
|
53
|
+
callDefaultCallback = false;
|
|
54
|
+
callback?.(to, e);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
if (callDefaultCallback) {
|
|
58
|
+
defaultActionCallback();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}, "globalClickListener");
|
|
62
|
+
function createListeners(baseModule, functions, defaultToAction) {
|
|
63
|
+
const toRemove = [];
|
|
64
|
+
functions.forEach((func) => {
|
|
65
|
+
const hasFunction = svelteKitParameters[baseModule]?.[func] && svelteKitParameters[baseModule][func] instanceof Function;
|
|
66
|
+
if (hasFunction || defaultToAction) {
|
|
67
|
+
const listener = /* @__PURE__ */ __name(({ detail = [] }) => {
|
|
68
|
+
const args = Array.isArray(detail) ? detail : [];
|
|
69
|
+
const fnToCall = hasFunction ? svelteKitParameters[baseModule][func] : action(func);
|
|
70
|
+
fnToCall(...args);
|
|
71
|
+
}, "listener");
|
|
72
|
+
const eventType = `storybook:${func}`;
|
|
73
|
+
toRemove.push({ eventType, listener });
|
|
74
|
+
window.addEventListener(eventType, listener);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
return () => {
|
|
78
|
+
toRemove.forEach(({ eventType, listener }) => {
|
|
79
|
+
window.removeEventListener(eventType, listener);
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
__name(createListeners, "createListeners");
|
|
84
|
+
const removeNavigationListeners = createListeners(
|
|
85
|
+
"navigation",
|
|
86
|
+
["goto", "invalidate", "invalidateAll", "pushState", "replaceState"],
|
|
87
|
+
true
|
|
88
|
+
);
|
|
89
|
+
const removeFormsListeners = createListeners("forms", ["enhance"]);
|
|
90
|
+
window.addEventListener("click", globalClickListener);
|
|
91
|
+
return () => {
|
|
92
|
+
window.removeEventListener("click", globalClickListener);
|
|
93
|
+
removeNavigationListeners();
|
|
94
|
+
removeFormsListeners();
|
|
95
|
+
};
|
|
96
|
+
});
|
|
97
|
+
return Story();
|
|
98
|
+
}, "svelteKitMocksDecorator");
|
|
99
|
+
var decorators = [svelteKitMocksDecorator];
|
|
100
|
+
|
|
101
|
+
export {
|
|
102
|
+
decorators,
|
|
103
|
+
preview_exports
|
|
104
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_9ile0rbaeil from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_9ile0rbaeil from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_9ile0rbaeil from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_9ile0rbaeil.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_9ile0rbaeil.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_9ile0rbaeil.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
var __defProp = Object.defineProperty;
|
|
13
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
__name
|
|
17
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_9ile0rbaeil from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_9ile0rbaeil from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_9ile0rbaeil from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_9ile0rbaeil.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_9ile0rbaeil.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_9ile0rbaeil.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
import {
|
|
13
|
+
__name
|
|
14
|
+
} from "./chunk-EJIACILG.js";
|
|
15
|
+
|
|
16
|
+
// src/plugins/mock-sveltekit-stores.ts
|
|
17
|
+
function mockSveltekitStores() {
|
|
18
|
+
return {
|
|
19
|
+
name: "storybook:sveltekit-mock-stores",
|
|
20
|
+
config: /* @__PURE__ */ __name(() => ({
|
|
21
|
+
resolve: {
|
|
22
|
+
alias: {
|
|
23
|
+
"$app/forms": "@storybook/sveltekit/internal/mocks/app/forms",
|
|
24
|
+
"$app/navigation": "@storybook/sveltekit/internal/mocks/app/navigation",
|
|
25
|
+
"$app/stores": "@storybook/sveltekit/internal/mocks/app/stores"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}), "config")
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
__name(mockSveltekitStores, "mockSveltekitStores");
|
|
32
|
+
|
|
33
|
+
export {
|
|
34
|
+
mockSveltekitStores
|
|
35
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,64 @@
|
|
|
1
1
|
import { SvelteRenderer } from '@storybook/svelte';
|
|
2
2
|
export * from '@storybook/svelte';
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
|
|
3
|
+
import { StorybookConfig as StorybookConfig$1, CompatibleString, NamedOrDefaultProjectAnnotations, NormalizedProjectAnnotations } from 'storybook/internal/types';
|
|
4
|
+
import { BuilderOptions, StorybookConfigVite } from '@storybook/builder-vite';
|
|
5
|
+
|
|
6
|
+
declare function enhance(form: HTMLFormElement): {
|
|
7
|
+
destroy(): void;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
declare function goto(...args: any[]): Promise<void>;
|
|
11
|
+
declare function invalidate(...args: any[]): Promise<void>;
|
|
12
|
+
declare function invalidateAll(): Promise<void>;
|
|
13
|
+
|
|
14
|
+
type FrameworkName = CompatibleString<'@storybook/sveltekit'>;
|
|
15
|
+
type BuilderName = CompatibleString<'@storybook/builder-vite'>;
|
|
16
|
+
type FrameworkOptions = {
|
|
17
|
+
builder?: BuilderOptions;
|
|
18
|
+
/**
|
|
19
|
+
* Enable or disable automatic documentation generation for component properties, events, and
|
|
20
|
+
* slots. When disabled, Storybook will skip the docgen processing step during build, which can
|
|
21
|
+
* improve build performance.
|
|
22
|
+
*
|
|
23
|
+
* @default true
|
|
24
|
+
*/
|
|
25
|
+
docgen?: boolean;
|
|
26
|
+
};
|
|
27
|
+
type StorybookConfigFramework = {
|
|
28
|
+
framework: FrameworkName | {
|
|
29
|
+
name: FrameworkName;
|
|
30
|
+
options: FrameworkOptions;
|
|
31
|
+
};
|
|
32
|
+
core?: StorybookConfig$1['core'] & {
|
|
33
|
+
builder?: BuilderName | {
|
|
34
|
+
name: BuilderName;
|
|
35
|
+
options: BuilderOptions;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
type StorybookConfig = Omit<StorybookConfig$1, keyof StorybookConfigVite | keyof StorybookConfigFramework> & StorybookConfigVite & StorybookConfigFramework;
|
|
40
|
+
type NormalizedHrefConfig = {
|
|
41
|
+
callback: (to: string, event: Event) => void;
|
|
42
|
+
asRegex?: boolean;
|
|
43
|
+
};
|
|
44
|
+
type HrefConfig = NormalizedHrefConfig | NormalizedHrefConfig['callback'];
|
|
45
|
+
type SvelteKitParameters = Partial<{
|
|
46
|
+
hrefs: Record<string, HrefConfig>;
|
|
47
|
+
stores: {
|
|
48
|
+
page: Record<string, any>;
|
|
49
|
+
navigating: Record<string, any>;
|
|
50
|
+
updated: boolean;
|
|
51
|
+
};
|
|
52
|
+
navigation: {
|
|
53
|
+
goto: typeof goto;
|
|
54
|
+
invalidate: typeof invalidate;
|
|
55
|
+
invalidateAll: typeof invalidateAll;
|
|
56
|
+
afterNavigate: Record<string, any>;
|
|
57
|
+
};
|
|
58
|
+
forms: {
|
|
59
|
+
enhance: typeof enhance;
|
|
60
|
+
};
|
|
61
|
+
}>;
|
|
6
62
|
|
|
7
63
|
/**
|
|
8
64
|
* Function that sets the globalConfig of your storybook. The global config is the preview module of
|
|
@@ -25,4 +81,4 @@ import '@storybook/builder-vite';
|
|
|
25
81
|
*/
|
|
26
82
|
declare function setProjectAnnotations(projectAnnotations: NamedOrDefaultProjectAnnotations<any> | NamedOrDefaultProjectAnnotations<any>[]): NormalizedProjectAnnotations<SvelteRenderer>;
|
|
27
83
|
|
|
28
|
-
export { setProjectAnnotations };
|
|
84
|
+
export { type FrameworkOptions, type HrefConfig, type NormalizedHrefConfig, type StorybookConfig, type SvelteKitParameters, setProjectAnnotations };
|
package/dist/index.js
CHANGED
|
@@ -1 +1,33 @@
|
|
|
1
|
-
|
|
1
|
+
import {
|
|
2
|
+
preview_exports
|
|
3
|
+
} from "./_browser-chunks/chunk-Y4OPRTUT.js";
|
|
4
|
+
import "./_browser-chunks/chunk-T276X65R.js";
|
|
5
|
+
import "./_browser-chunks/chunk-MNND3IGN.js";
|
|
6
|
+
import {
|
|
7
|
+
__name
|
|
8
|
+
} from "./_browser-chunks/chunk-JFJ5UJ7Q.js";
|
|
9
|
+
|
|
10
|
+
// src/index.ts
|
|
11
|
+
export * from "@storybook/svelte";
|
|
12
|
+
|
|
13
|
+
// src/portable-stories.ts
|
|
14
|
+
import { INTERNAL_DEFAULT_PROJECT_ANNOTATIONS as svelteAnnotations } from "@storybook/svelte";
|
|
15
|
+
import {
|
|
16
|
+
composeConfigs,
|
|
17
|
+
setProjectAnnotations as originalSetProjectAnnotations,
|
|
18
|
+
setDefaultProjectAnnotations
|
|
19
|
+
} from "storybook/preview-api";
|
|
20
|
+
function setProjectAnnotations(projectAnnotations) {
|
|
21
|
+
setDefaultProjectAnnotations(INTERNAL_DEFAULT_PROJECT_ANNOTATIONS);
|
|
22
|
+
return originalSetProjectAnnotations(
|
|
23
|
+
projectAnnotations
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
__name(setProjectAnnotations, "setProjectAnnotations");
|
|
27
|
+
var INTERNAL_DEFAULT_PROJECT_ANNOTATIONS = composeConfigs([
|
|
28
|
+
svelteAnnotations,
|
|
29
|
+
preview_exports
|
|
30
|
+
]);
|
|
31
|
+
export {
|
|
32
|
+
setProjectAnnotations
|
|
33
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__name
|
|
3
|
+
} from "../../_browser-chunks/chunk-JFJ5UJ7Q.js";
|
|
4
|
+
|
|
5
|
+
// src/mocks/app/forms.ts
|
|
6
|
+
function enhance(form) {
|
|
7
|
+
const listener = /* @__PURE__ */ __name((...args) => {
|
|
8
|
+
const e = args[0];
|
|
9
|
+
e.preventDefault();
|
|
10
|
+
const event = new CustomEvent("storybook:enhance", {
|
|
11
|
+
detail: args
|
|
12
|
+
});
|
|
13
|
+
window.dispatchEvent(event);
|
|
14
|
+
}, "listener");
|
|
15
|
+
form.addEventListener("submit", listener);
|
|
16
|
+
return {
|
|
17
|
+
destroy() {
|
|
18
|
+
form.removeEventListener("submit", listener);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
__name(enhance, "enhance");
|
|
23
|
+
function applyAction() {
|
|
24
|
+
}
|
|
25
|
+
__name(applyAction, "applyAction");
|
|
26
|
+
function deserialize() {
|
|
27
|
+
}
|
|
28
|
+
__name(deserialize, "deserialize");
|
|
29
|
+
export {
|
|
30
|
+
applyAction,
|
|
31
|
+
deserialize,
|
|
32
|
+
enhance
|
|
33
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {
|
|
2
|
+
afterNavigate,
|
|
3
|
+
beforeNavigate,
|
|
4
|
+
disableScrollHandling,
|
|
5
|
+
goto,
|
|
6
|
+
invalidate,
|
|
7
|
+
invalidateAll,
|
|
8
|
+
onNavigate,
|
|
9
|
+
preloadCode,
|
|
10
|
+
preloadData,
|
|
11
|
+
pushState,
|
|
12
|
+
replaceState,
|
|
13
|
+
setAfterNavigateArgument
|
|
14
|
+
} from "../../_browser-chunks/chunk-T276X65R.js";
|
|
15
|
+
import "../../_browser-chunks/chunk-JFJ5UJ7Q.js";
|
|
16
|
+
export {
|
|
17
|
+
afterNavigate,
|
|
18
|
+
beforeNavigate,
|
|
19
|
+
disableScrollHandling,
|
|
20
|
+
goto,
|
|
21
|
+
invalidate,
|
|
22
|
+
invalidateAll,
|
|
23
|
+
onNavigate,
|
|
24
|
+
preloadCode,
|
|
25
|
+
preloadData,
|
|
26
|
+
pushState,
|
|
27
|
+
replaceState,
|
|
28
|
+
setAfterNavigateArgument
|
|
29
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getStores,
|
|
3
|
+
navigating,
|
|
4
|
+
page,
|
|
5
|
+
setNavigating,
|
|
6
|
+
setPage,
|
|
7
|
+
setUpdated,
|
|
8
|
+
updated
|
|
9
|
+
} from "../../_browser-chunks/chunk-MNND3IGN.js";
|
|
10
|
+
import "../../_browser-chunks/chunk-JFJ5UJ7Q.js";
|
|
11
|
+
export {
|
|
12
|
+
getStores,
|
|
13
|
+
navigating,
|
|
14
|
+
page,
|
|
15
|
+
setNavigating,
|
|
16
|
+
setPage,
|
|
17
|
+
setUpdated,
|
|
18
|
+
updated
|
|
19
|
+
};
|
package/dist/node/index.d.ts
CHANGED
|
@@ -1,6 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import 'storybook/
|
|
3
|
-
|
|
1
|
+
import { StorybookConfig as StorybookConfig$1, CompatibleString } from 'storybook/internal/types';
|
|
2
|
+
import { StorybookConfigVite, BuilderOptions } from '@storybook/builder-vite';
|
|
3
|
+
|
|
4
|
+
type FrameworkName = CompatibleString<'@storybook/sveltekit'>;
|
|
5
|
+
type BuilderName = CompatibleString<'@storybook/builder-vite'>;
|
|
6
|
+
type FrameworkOptions = {
|
|
7
|
+
builder?: BuilderOptions;
|
|
8
|
+
/**
|
|
9
|
+
* Enable or disable automatic documentation generation for component properties, events, and
|
|
10
|
+
* slots. When disabled, Storybook will skip the docgen processing step during build, which can
|
|
11
|
+
* improve build performance.
|
|
12
|
+
*
|
|
13
|
+
* @default true
|
|
14
|
+
*/
|
|
15
|
+
docgen?: boolean;
|
|
16
|
+
};
|
|
17
|
+
type StorybookConfigFramework = {
|
|
18
|
+
framework: FrameworkName | {
|
|
19
|
+
name: FrameworkName;
|
|
20
|
+
options: FrameworkOptions;
|
|
21
|
+
};
|
|
22
|
+
core?: StorybookConfig$1['core'] & {
|
|
23
|
+
builder?: BuilderName | {
|
|
24
|
+
name: BuilderName;
|
|
25
|
+
options: BuilderOptions;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
type StorybookConfig = Omit<StorybookConfig$1, keyof StorybookConfigVite | keyof StorybookConfigFramework> & StorybookConfigVite & StorybookConfigFramework;
|
|
4
30
|
|
|
5
31
|
declare function defineMain(config: StorybookConfig): StorybookConfig;
|
|
6
32
|
|
package/dist/node/index.js
CHANGED
|
@@ -1 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
import CJS_COMPAT_NODE_URL_9ile0rbaeil from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_9ile0rbaeil from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_9ile0rbaeil from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_9ile0rbaeil.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_9ile0rbaeil.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_9ile0rbaeil.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
import {
|
|
13
|
+
__name
|
|
14
|
+
} from "../_node-chunks/chunk-EJIACILG.js";
|
|
15
|
+
|
|
16
|
+
// src/node/index.ts
|
|
17
|
+
function defineMain(config) {
|
|
18
|
+
return config;
|
|
19
|
+
}
|
|
20
|
+
__name(defineMain, "defineMain");
|
|
21
|
+
export {
|
|
22
|
+
defineMain
|
|
23
|
+
};
|
package/dist/preset.js
CHANGED
|
@@ -1 +1,71 @@
|
|
|
1
|
-
|
|
1
|
+
import CJS_COMPAT_NODE_URL_9ile0rbaeil from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_9ile0rbaeil from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_9ile0rbaeil from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_9ile0rbaeil.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_9ile0rbaeil.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_9ile0rbaeil.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
import {
|
|
13
|
+
mockSveltekitStores
|
|
14
|
+
} from "./_node-chunks/chunk-ZWPLD3PK.js";
|
|
15
|
+
import {
|
|
16
|
+
__name
|
|
17
|
+
} from "./_node-chunks/chunk-EJIACILG.js";
|
|
18
|
+
|
|
19
|
+
// src/preset.ts
|
|
20
|
+
import { fileURLToPath } from "node:url";
|
|
21
|
+
import { withoutVitePlugins } from "@storybook/builder-vite";
|
|
22
|
+
import { viteFinal as svelteViteFinal } from "@storybook/svelte-vite/preset";
|
|
23
|
+
|
|
24
|
+
// src/plugins/config-overrides.ts
|
|
25
|
+
function configOverrides() {
|
|
26
|
+
return {
|
|
27
|
+
// SvelteKit sets SSR, we need it to be false when building
|
|
28
|
+
name: "storybook:sveltekit-overrides",
|
|
29
|
+
apply: "build",
|
|
30
|
+
config: /* @__PURE__ */ __name(() => {
|
|
31
|
+
return { build: { ssr: false } };
|
|
32
|
+
}, "config")
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
__name(configOverrides, "configOverrides");
|
|
36
|
+
|
|
37
|
+
// src/preset.ts
|
|
38
|
+
var core = {
|
|
39
|
+
builder: import.meta.resolve("@storybook/builder-vite"),
|
|
40
|
+
renderer: import.meta.resolve("@storybook/svelte/preset")
|
|
41
|
+
};
|
|
42
|
+
var previewAnnotations = /* @__PURE__ */ __name((entry = []) => [
|
|
43
|
+
...entry,
|
|
44
|
+
fileURLToPath(import.meta.resolve("@storybook/sveltekit/preview"))
|
|
45
|
+
], "previewAnnotations");
|
|
46
|
+
var viteFinal = /* @__PURE__ */ __name(async (config, options) => {
|
|
47
|
+
const baseConfig = await svelteViteFinal(config, options);
|
|
48
|
+
return {
|
|
49
|
+
...baseConfig,
|
|
50
|
+
plugins: [
|
|
51
|
+
// disable specific plugins that are not compatible with Storybook
|
|
52
|
+
...await withoutVitePlugins(baseConfig.plugins ?? [], [
|
|
53
|
+
"vite-plugin-sveltekit-compile",
|
|
54
|
+
"vite-plugin-sveltekit-guard"
|
|
55
|
+
]),
|
|
56
|
+
configOverrides(),
|
|
57
|
+
mockSveltekitStores()
|
|
58
|
+
]
|
|
59
|
+
};
|
|
60
|
+
}, "viteFinal");
|
|
61
|
+
var optimizeViteDeps = [
|
|
62
|
+
"@storybook/sveltekit/internal/mocks/app/forms",
|
|
63
|
+
"@storybook/sveltekit/internal/mocks/app/navigation",
|
|
64
|
+
"@storybook/sveltekit/internal/mocks/app/stores"
|
|
65
|
+
];
|
|
66
|
+
export {
|
|
67
|
+
core,
|
|
68
|
+
optimizeViteDeps,
|
|
69
|
+
previewAnnotations,
|
|
70
|
+
viteFinal
|
|
71
|
+
};
|
package/dist/preview.js
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import {
|
|
2
|
+
decorators
|
|
3
|
+
} from "./_browser-chunks/chunk-Y4OPRTUT.js";
|
|
4
|
+
import "./_browser-chunks/chunk-T276X65R.js";
|
|
5
|
+
import "./_browser-chunks/chunk-MNND3IGN.js";
|
|
6
|
+
import "./_browser-chunks/chunk-JFJ5UJ7Q.js";
|
|
7
|
+
export {
|
|
8
|
+
decorators
|
|
9
|
+
};
|
package/dist/vite-plugin.js
CHANGED
|
@@ -1 +1,25 @@
|
|
|
1
|
-
|
|
1
|
+
import CJS_COMPAT_NODE_URL_9ile0rbaeil from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_9ile0rbaeil from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_9ile0rbaeil from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_9ile0rbaeil.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_9ile0rbaeil.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_9ile0rbaeil.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
import {
|
|
13
|
+
mockSveltekitStores
|
|
14
|
+
} from "./_node-chunks/chunk-ZWPLD3PK.js";
|
|
15
|
+
import {
|
|
16
|
+
__name
|
|
17
|
+
} from "./_node-chunks/chunk-EJIACILG.js";
|
|
18
|
+
|
|
19
|
+
// src/vite-plugin.ts
|
|
20
|
+
var storybookSveltekitPlugin = /* @__PURE__ */ __name(() => {
|
|
21
|
+
return [mockSveltekitStores()];
|
|
22
|
+
}, "storybookSveltekitPlugin");
|
|
23
|
+
export {
|
|
24
|
+
storybookSveltekitPlugin
|
|
25
|
+
};
|
package/package.json
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/sveltekit",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Storybook for SvelteKit",
|
|
3
|
+
"version": "10.0.0-beta.1",
|
|
4
|
+
"description": "Storybook for SvelteKit: Develop, document, and test UI components in isolation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
7
|
+
"storybook-framework",
|
|
7
8
|
"svelte",
|
|
8
9
|
"sveltekit",
|
|
9
|
-
"svelte-kit"
|
|
10
|
+
"svelte-kit",
|
|
11
|
+
"vite",
|
|
12
|
+
"component",
|
|
13
|
+
"components"
|
|
10
14
|
],
|
|
11
15
|
"homepage": "https://github.com/storybookjs/storybook/tree/next/code/frameworks/sveltekit",
|
|
12
16
|
"bugs": {
|
|
@@ -22,36 +26,24 @@
|
|
|
22
26
|
"url": "https://opencollective.com/storybook"
|
|
23
27
|
},
|
|
24
28
|
"license": "MIT",
|
|
29
|
+
"type": "module",
|
|
25
30
|
"exports": {
|
|
26
31
|
".": {
|
|
27
32
|
"types": "./dist/index.d.ts",
|
|
28
|
-
"
|
|
29
|
-
"node": "./dist/index.js",
|
|
30
|
-
"require": "./dist/index.js"
|
|
31
|
-
},
|
|
32
|
-
"./dist/preview.mjs": {
|
|
33
|
-
"import": "./dist/preview.mjs"
|
|
34
|
-
},
|
|
35
|
-
"./preset": {
|
|
36
|
-
"types": "./dist/preset.d.ts",
|
|
37
|
-
"require": "./dist/preset.js"
|
|
38
|
-
},
|
|
39
|
-
"./vite-plugin": {
|
|
40
|
-
"types": "./dist/vite-plugin.d.ts",
|
|
41
|
-
"require": "./dist/vite-plugin.js",
|
|
42
|
-
"import": "./dist/vite-plugin.mjs"
|
|
33
|
+
"default": "./dist/index.js"
|
|
43
34
|
},
|
|
35
|
+
"./internal/mocks/app/forms": "./dist/mocks/app/forms.js",
|
|
36
|
+
"./internal/mocks/app/navigation": "./dist/mocks/app/navigation.js",
|
|
37
|
+
"./internal/mocks/app/stores": "./dist/mocks/app/stores.js",
|
|
44
38
|
"./node": {
|
|
45
39
|
"types": "./dist/node/index.d.ts",
|
|
46
|
-
"
|
|
47
|
-
"import": "./dist/node/index.mjs",
|
|
48
|
-
"require": "./dist/node/index.js"
|
|
40
|
+
"default": "./dist/node/index.js"
|
|
49
41
|
},
|
|
50
|
-
"./package.json": "./package.json"
|
|
42
|
+
"./package.json": "./package.json",
|
|
43
|
+
"./preset": "./dist/preset.js",
|
|
44
|
+
"./preview": "./dist/preview.js",
|
|
45
|
+
"./vite-plugin": "./dist/vite-plugin.js"
|
|
51
46
|
},
|
|
52
|
-
"main": "dist/index.js",
|
|
53
|
-
"module": "dist/index.mjs",
|
|
54
|
-
"types": "dist/index.d.ts",
|
|
55
47
|
"files": [
|
|
56
48
|
"dist/**/*",
|
|
57
49
|
"template/**/*",
|
|
@@ -61,39 +53,26 @@
|
|
|
61
53
|
"src/mocks/**/*"
|
|
62
54
|
],
|
|
63
55
|
"scripts": {
|
|
64
|
-
"check": "jiti ../../../scripts/
|
|
65
|
-
"prep": "jiti ../../../scripts/
|
|
56
|
+
"check": "jiti ../../../scripts/check/check-package.ts",
|
|
57
|
+
"prep": "jiti ../../../scripts/build/build-package.ts"
|
|
66
58
|
},
|
|
67
59
|
"dependencies": {
|
|
68
|
-
"@storybook/builder-vite": "
|
|
69
|
-
"@storybook/svelte": "
|
|
70
|
-
"@storybook/svelte-vite": "
|
|
60
|
+
"@storybook/builder-vite": "10.0.0-beta.1",
|
|
61
|
+
"@storybook/svelte": "10.0.0-beta.1",
|
|
62
|
+
"@storybook/svelte-vite": "10.0.0-beta.1"
|
|
71
63
|
},
|
|
72
64
|
"devDependencies": {
|
|
73
65
|
"@types/node": "^22.0.0",
|
|
74
66
|
"typescript": "^5.8.3",
|
|
75
|
-
"vite": "^
|
|
67
|
+
"vite": "^7.0.4"
|
|
76
68
|
},
|
|
77
69
|
"peerDependencies": {
|
|
78
|
-
"storybook": "^
|
|
70
|
+
"storybook": "^10.0.0-beta.1",
|
|
79
71
|
"svelte": "^5.0.0",
|
|
80
72
|
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0"
|
|
81
73
|
},
|
|
82
|
-
"engines": {
|
|
83
|
-
"node": ">=20.0.0"
|
|
84
|
-
},
|
|
85
74
|
"publishConfig": {
|
|
86
75
|
"access": "public"
|
|
87
76
|
},
|
|
88
|
-
"
|
|
89
|
-
"entries": [
|
|
90
|
-
"./src/index.ts",
|
|
91
|
-
"./src/preview.ts",
|
|
92
|
-
"./src/preset.ts",
|
|
93
|
-
"./src/vite-plugin.ts",
|
|
94
|
-
"./src/node/index.ts"
|
|
95
|
-
],
|
|
96
|
-
"platform": "node"
|
|
97
|
-
},
|
|
98
|
-
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684"
|
|
77
|
+
"gitHead": "a8e7fd8a655c69780bc20b9749d2699e45beae16"
|
|
99
78
|
}
|
package/preset.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export * from './dist/preset.js';
|
package/preview.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/preview.js';
|
package/dist/chunk-CEH6MNVV.mjs
DELETED
package/dist/chunk-UUT6FZ4K.mjs
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { __export } from './chunk-CEH6MNVV.mjs';
|
|
2
|
-
import { action } from 'storybook/actions';
|
|
3
|
-
import { onMount, setContext, getContext } from 'svelte';
|
|
4
|
-
|
|
5
|
-
var preview_exports={};__export(preview_exports,{decorators:()=>decorators});function setAfterNavigateArgument(afterNavigateArgs){setContext("after-navigate-args",afterNavigateArgs);}function createMockedStore(contextName){return [{subscribe(runner){let page2=getContext(contextName);return runner(page2),()=>{}}},value=>{setContext(contextName,value);}]}var[page,setPage]=createMockedStore("page-ctx"),[navigating,setNavigating]=createMockedStore("navigating-ctx"),[updated,setUpdated]=createMockedStore("updated-ctx");updated.check=()=>{};var normalizeHrefConfig=hrefConfig=>typeof hrefConfig=="function"?{callback:hrefConfig,asRegex:!1}:hrefConfig,svelteKitMocksDecorator=(Story,ctx)=>{let svelteKitParameters=ctx.parameters?.sveltekit_experimental??{};return setPage(svelteKitParameters?.stores?.page),setNavigating(svelteKitParameters?.stores?.navigating),setUpdated(svelteKitParameters?.stores?.updated),setAfterNavigateArgument(svelteKitParameters?.navigation?.afterNavigate),onMount(()=>{let globalClickListener=e=>{let element=e.composedPath().findLast(el=>el instanceof HTMLElement&&el.tagName==="A");if(element&&element instanceof HTMLAnchorElement){let to=element.getAttribute("href");if(!to)return;e.preventDefault();let defaultActionCallback=()=>action("navigate")(to,e);if(!svelteKitParameters.hrefs){defaultActionCallback();return}let callDefaultCallback=!0;Object.entries(svelteKitParameters.hrefs).forEach(([href,hrefConfig])=>{let{callback,asRegex}=normalizeHrefConfig(hrefConfig);(asRegex?new RegExp(href).test(to):to===href)&&(callDefaultCallback=!1,callback?.(to,e));}),callDefaultCallback&&defaultActionCallback();}};function createListeners(baseModule,functions,defaultToAction){let toRemove=[];return functions.forEach(func=>{let hasFunction=svelteKitParameters[baseModule]?.[func]&&svelteKitParameters[baseModule][func]instanceof Function;if(hasFunction||defaultToAction){let listener=({detail=[]})=>{let args=Array.isArray(detail)?detail:[];(hasFunction?svelteKitParameters[baseModule][func]:action(func))(...args);},eventType=`storybook:${func}`;toRemove.push({eventType,listener}),window.addEventListener(eventType,listener);}}),()=>{toRemove.forEach(({eventType,listener})=>{window.removeEventListener(eventType,listener);});}}let removeNavigationListeners=createListeners("navigation",["goto","invalidate","invalidateAll","pushState","replaceState"],!0),removeFormsListeners=createListeners("forms",["enhance"]);return window.addEventListener("click",globalClickListener),()=>{window.removeEventListener("click",globalClickListener),removeNavigationListeners(),removeFormsListeners();}}),Story()},decorators=[svelteKitMocksDecorator];
|
|
6
|
-
|
|
7
|
-
export { decorators, preview_exports };
|
package/dist/index.mjs
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { preview_exports } from './chunk-UUT6FZ4K.mjs';
|
|
2
|
-
import './chunk-CEH6MNVV.mjs';
|
|
3
|
-
import { INTERNAL_DEFAULT_PROJECT_ANNOTATIONS as INTERNAL_DEFAULT_PROJECT_ANNOTATIONS$1 } from '@storybook/svelte';
|
|
4
|
-
export * from '@storybook/svelte';
|
|
5
|
-
import { composeConfigs, setDefaultProjectAnnotations, setProjectAnnotations as setProjectAnnotations$1 } from 'storybook/preview-api';
|
|
6
|
-
|
|
7
|
-
function setProjectAnnotations(projectAnnotations){return setDefaultProjectAnnotations(INTERNAL_DEFAULT_PROJECT_ANNOTATIONS),setProjectAnnotations$1(projectAnnotations)}var INTERNAL_DEFAULT_PROJECT_ANNOTATIONS=composeConfigs([INTERNAL_DEFAULT_PROJECT_ANNOTATIONS$1,preview_exports]);
|
|
8
|
-
|
|
9
|
-
export { setProjectAnnotations };
|
package/dist/node/index.mjs
DELETED
package/dist/preset.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { PresetProperty } from 'storybook/internal/types';
|
|
2
|
-
import { S as StorybookConfig } from './types-3f08d935.js';
|
|
3
|
-
import '@storybook/builder-vite';
|
|
4
|
-
|
|
5
|
-
declare const core: PresetProperty<'core'>;
|
|
6
|
-
declare const previewAnnotations: PresetProperty<'previewAnnotations'>;
|
|
7
|
-
declare const viteFinal: NonNullable<StorybookConfig['viteFinal']>;
|
|
8
|
-
|
|
9
|
-
export { core, previewAnnotations, viteFinal };
|
package/dist/preview.d.ts
DELETED
package/dist/preview.mjs
DELETED
package/dist/types-3f08d935.d.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { StorybookConfig as StorybookConfig$1, CompatibleString } from 'storybook/internal/types';
|
|
2
|
-
import { BuilderOptions, StorybookConfigVite } from '@storybook/builder-vite';
|
|
3
|
-
|
|
4
|
-
declare function enhance(form: HTMLFormElement): {
|
|
5
|
-
destroy(): void;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
declare function goto(...args: any[]): Promise<void>;
|
|
9
|
-
declare function invalidate(...args: any[]): Promise<void>;
|
|
10
|
-
declare function invalidateAll(): Promise<void>;
|
|
11
|
-
|
|
12
|
-
type FrameworkName = CompatibleString<'@storybook/sveltekit'>;
|
|
13
|
-
type BuilderName = CompatibleString<'@storybook/builder-vite'>;
|
|
14
|
-
type FrameworkOptions = {
|
|
15
|
-
builder?: BuilderOptions;
|
|
16
|
-
};
|
|
17
|
-
type StorybookConfigFramework = {
|
|
18
|
-
framework: FrameworkName | {
|
|
19
|
-
name: FrameworkName;
|
|
20
|
-
options: FrameworkOptions;
|
|
21
|
-
};
|
|
22
|
-
core?: StorybookConfig$1['core'] & {
|
|
23
|
-
builder?: BuilderName | {
|
|
24
|
-
name: BuilderName;
|
|
25
|
-
options: BuilderOptions;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
type StorybookConfig = Omit<StorybookConfig$1, keyof StorybookConfigVite | keyof StorybookConfigFramework> & StorybookConfigVite & StorybookConfigFramework;
|
|
30
|
-
type NormalizedHrefConfig = {
|
|
31
|
-
callback: (to: string, event: Event) => void;
|
|
32
|
-
asRegex?: boolean;
|
|
33
|
-
};
|
|
34
|
-
type HrefConfig = NormalizedHrefConfig | NormalizedHrefConfig['callback'];
|
|
35
|
-
type SvelteKitParameters = Partial<{
|
|
36
|
-
hrefs: Record<string, HrefConfig>;
|
|
37
|
-
stores: {
|
|
38
|
-
page: Record<string, any>;
|
|
39
|
-
navigating: Record<string, any>;
|
|
40
|
-
updated: boolean;
|
|
41
|
-
};
|
|
42
|
-
navigation: {
|
|
43
|
-
goto: typeof goto;
|
|
44
|
-
invalidate: typeof invalidate;
|
|
45
|
-
invalidateAll: typeof invalidateAll;
|
|
46
|
-
afterNavigate: Record<string, any>;
|
|
47
|
-
};
|
|
48
|
-
forms: {
|
|
49
|
-
enhance: typeof enhance;
|
|
50
|
-
};
|
|
51
|
-
}>;
|
|
52
|
-
|
|
53
|
-
export { FrameworkOptions as F, HrefConfig as H, NormalizedHrefConfig as N, StorybookConfig as S, SvelteKitParameters as a };
|
package/dist/vite-plugin.d.ts
DELETED
package/dist/vite-plugin.mjs
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import './chunk-CEH6MNVV.mjs';
|
|
2
|
-
import { dirname, resolve } from 'node:path';
|
|
3
|
-
import { fileURLToPath } from 'node:url';
|
|
4
|
-
|
|
5
|
-
var filename=__filename??fileURLToPath(import.meta.url),dir=dirname(filename);function mockSveltekitStores(){return {name:"storybook:sveltekit-mock-stores",config:()=>({resolve:{alias:{"$app/forms":resolve(dir,"../src/mocks/app/forms.ts"),"$app/navigation":resolve(dir,"../src/mocks/app/navigation.ts"),"$app/stores":resolve(dir,"../src/mocks/app/stores.ts")}}})}}var storybookSveltekitPlugin=()=>[mockSveltekitStores()];
|
|
6
|
-
|
|
7
|
-
export { storybookSveltekitPlugin };
|