@storybook/html 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 +4 -0
- package/dist/_browser-chunks/chunk-JFJ5UJ7Q.js +11 -0
- package/dist/_browser-chunks/chunk-R4NDMI3K.js +84 -0
- package/dist/entry-preview-docs.js +54 -1
- package/dist/entry-preview.js +13 -7
- package/dist/index.d.ts +8 -4
- package/dist/index.js +27 -7
- package/dist/preset.js +26 -1
- package/package.json +17 -28
- package/preset.js +1 -1
- package/dist/chunk-CEH6MNVV.mjs +0 -3
- package/dist/chunk-ZBAUHALS.mjs +0 -15
- package/dist/entry-preview-docs.d.ts +0 -20
- package/dist/entry-preview-docs.mjs +0 -7
- package/dist/entry-preview.d.ts +0 -12
- package/dist/entry-preview.mjs +0 -2
- package/dist/index.mjs +0 -8
- package/dist/preset.d.ts +0 -5
- package/dist/types-19e12ec7.d.ts +0 -24
package/README.md
CHANGED
|
@@ -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,84 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__export,
|
|
3
|
+
__name
|
|
4
|
+
} from "./chunk-JFJ5UJ7Q.js";
|
|
5
|
+
|
|
6
|
+
// src/entry-preview.ts
|
|
7
|
+
var entry_preview_exports = {};
|
|
8
|
+
__export(entry_preview_exports, {
|
|
9
|
+
argTypesEnhancers: () => argTypesEnhancers,
|
|
10
|
+
parameters: () => parameters,
|
|
11
|
+
render: () => render,
|
|
12
|
+
renderToCanvas: () => renderToCanvas
|
|
13
|
+
});
|
|
14
|
+
import { enhanceArgTypes } from "storybook/internal/docs-tools";
|
|
15
|
+
|
|
16
|
+
// src/render.ts
|
|
17
|
+
import { global } from "@storybook/global";
|
|
18
|
+
import { simulateDOMContentLoaded, simulatePageLoad } from "storybook/preview-api";
|
|
19
|
+
import { dedent } from "ts-dedent";
|
|
20
|
+
var { Node } = global;
|
|
21
|
+
var render = /* @__PURE__ */ __name((args, context) => {
|
|
22
|
+
const { id, component: Component } = context;
|
|
23
|
+
if (typeof Component === "string") {
|
|
24
|
+
let output = Component;
|
|
25
|
+
Object.keys(args).forEach((key) => {
|
|
26
|
+
output = output.replace(`{{${key}}}`, args[key]);
|
|
27
|
+
});
|
|
28
|
+
return output;
|
|
29
|
+
}
|
|
30
|
+
if (Component instanceof HTMLElement) {
|
|
31
|
+
const output = Component.cloneNode(true);
|
|
32
|
+
Object.keys(args).forEach((key) => {
|
|
33
|
+
output.setAttribute(
|
|
34
|
+
key,
|
|
35
|
+
typeof args[key] === "string" ? args[key] : JSON.stringify(args[key])
|
|
36
|
+
);
|
|
37
|
+
});
|
|
38
|
+
return output;
|
|
39
|
+
}
|
|
40
|
+
if (typeof Component === "function") {
|
|
41
|
+
return Component(args, context);
|
|
42
|
+
}
|
|
43
|
+
console.warn(dedent`
|
|
44
|
+
Storybook's HTML renderer only supports rendering DOM elements and strings.
|
|
45
|
+
Received: ${Component}
|
|
46
|
+
`);
|
|
47
|
+
throw new Error(`Unable to render story ${id}`);
|
|
48
|
+
}, "render");
|
|
49
|
+
function renderToCanvas({ storyFn, kind, name, showMain, showError, forceRemount }, canvasElement) {
|
|
50
|
+
const element = storyFn();
|
|
51
|
+
showMain();
|
|
52
|
+
if (typeof element === "string") {
|
|
53
|
+
canvasElement.innerHTML = element;
|
|
54
|
+
simulatePageLoad(canvasElement);
|
|
55
|
+
} else if (element instanceof Node) {
|
|
56
|
+
if (canvasElement.firstChild === element && forceRemount === false) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
canvasElement.innerHTML = "";
|
|
60
|
+
canvasElement.appendChild(element);
|
|
61
|
+
simulateDOMContentLoaded();
|
|
62
|
+
} else {
|
|
63
|
+
showError({
|
|
64
|
+
title: `Expecting an HTML snippet or DOM node from the story: "${name}" of "${kind}".`,
|
|
65
|
+
description: dedent`
|
|
66
|
+
Did you forget to return the HTML snippet from the story?
|
|
67
|
+
Use "() => <your snippet or node>" or when defining the story.
|
|
68
|
+
`
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
__name(renderToCanvas, "renderToCanvas");
|
|
73
|
+
|
|
74
|
+
// src/entry-preview.ts
|
|
75
|
+
var parameters = { renderer: "html" };
|
|
76
|
+
var argTypesEnhancers = [enhanceArgTypes];
|
|
77
|
+
|
|
78
|
+
export {
|
|
79
|
+
render,
|
|
80
|
+
renderToCanvas,
|
|
81
|
+
parameters,
|
|
82
|
+
argTypesEnhancers,
|
|
83
|
+
entry_preview_exports
|
|
84
|
+
};
|
|
@@ -1 +1,54 @@
|
|
|
1
|
-
|
|
1
|
+
import {
|
|
2
|
+
__name
|
|
3
|
+
} from "./_browser-chunks/chunk-JFJ5UJ7Q.js";
|
|
4
|
+
|
|
5
|
+
// src/entry-preview-docs.ts
|
|
6
|
+
import { SourceType as SourceType2 } from "storybook/internal/docs-tools";
|
|
7
|
+
|
|
8
|
+
// src/docs/sourceDecorator.ts
|
|
9
|
+
import { SourceType } from "storybook/internal/docs-tools";
|
|
10
|
+
import { emitTransformCode, useEffect, useRef } from "storybook/preview-api";
|
|
11
|
+
function skipSourceRender(context) {
|
|
12
|
+
const sourceParams = context?.parameters.docs?.source;
|
|
13
|
+
const isArgsStory = context?.parameters.__isArgsStory;
|
|
14
|
+
if (sourceParams?.type === SourceType.DYNAMIC) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
return !isArgsStory || sourceParams?.code || sourceParams?.type === SourceType.CODE;
|
|
18
|
+
}
|
|
19
|
+
__name(skipSourceRender, "skipSourceRender");
|
|
20
|
+
var sourceDecorator = /* @__PURE__ */ __name((storyFn, context) => {
|
|
21
|
+
const source = useRef(void 0);
|
|
22
|
+
const story = storyFn();
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
const renderedForSource = context?.parameters.docs?.source?.excludeDecorators ? context.originalStoryFn(context.args, context) : story;
|
|
25
|
+
if (!skipSourceRender(context)) {
|
|
26
|
+
if (typeof renderedForSource === "string" && source.current !== renderedForSource) {
|
|
27
|
+
emitTransformCode(renderedForSource, context);
|
|
28
|
+
source.current = renderedForSource;
|
|
29
|
+
} else if (renderedForSource instanceof Element && source.current !== renderedForSource.outerHTML) {
|
|
30
|
+
emitTransformCode(renderedForSource.outerHTML, context);
|
|
31
|
+
source.current = renderedForSource.outerHTML;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
return story;
|
|
36
|
+
}, "sourceDecorator");
|
|
37
|
+
|
|
38
|
+
// src/entry-preview-docs.ts
|
|
39
|
+
var decorators = [sourceDecorator];
|
|
40
|
+
var parameters = {
|
|
41
|
+
docs: {
|
|
42
|
+
story: { inline: true },
|
|
43
|
+
source: {
|
|
44
|
+
type: SourceType2.DYNAMIC,
|
|
45
|
+
language: "html",
|
|
46
|
+
code: void 0,
|
|
47
|
+
excludeDecorators: void 0
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
export {
|
|
52
|
+
decorators,
|
|
53
|
+
parameters
|
|
54
|
+
};
|
package/dist/entry-preview.js
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import {
|
|
2
|
+
argTypesEnhancers,
|
|
3
|
+
parameters,
|
|
4
|
+
render,
|
|
5
|
+
renderToCanvas
|
|
6
|
+
} from "./_browser-chunks/chunk-R4NDMI3K.js";
|
|
7
|
+
import "./_browser-chunks/chunk-JFJ5UJ7Q.js";
|
|
8
|
+
export {
|
|
9
|
+
argTypesEnhancers,
|
|
10
|
+
parameters,
|
|
11
|
+
render,
|
|
12
|
+
renderToCanvas
|
|
13
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import { Args, ComponentAnnotations, AnnotatedStoryFn, StoryAnnotations, StrictArgs, DecoratorFunction, LoaderFunction, StoryContext as StoryContext$1, ProjectAnnotations, NamedOrDefaultProjectAnnotations, NormalizedProjectAnnotations } from 'storybook/internal/types';
|
|
1
|
+
import { WebRenderer, ArgsStoryFn, Args, ComponentAnnotations, AnnotatedStoryFn, StoryAnnotations, StrictArgs, DecoratorFunction, LoaderFunction, StoryContext as StoryContext$1, ProjectAnnotations, NamedOrDefaultProjectAnnotations, NormalizedProjectAnnotations } from 'storybook/internal/types';
|
|
2
2
|
export { ArgTypes, Args, Parameters, StrictArgs } from 'storybook/internal/types';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
|
|
4
|
+
type StoryFnHtmlReturnType = string | Node;
|
|
5
|
+
interface HtmlRenderer extends WebRenderer {
|
|
6
|
+
component: string | HTMLElement | ArgsStoryFn<HtmlRenderer>;
|
|
7
|
+
storyResult: StoryFnHtmlReturnType;
|
|
8
|
+
}
|
|
5
9
|
|
|
6
10
|
/**
|
|
7
11
|
* Metadata to configure the stories for a component.
|
|
@@ -47,4 +51,4 @@ type Preview = ProjectAnnotations<HtmlRenderer>;
|
|
|
47
51
|
*/
|
|
48
52
|
declare function setProjectAnnotations(projectAnnotations: NamedOrDefaultProjectAnnotations<any> | NamedOrDefaultProjectAnnotations<any>[]): NormalizedProjectAnnotations<HtmlRenderer>;
|
|
49
53
|
|
|
50
|
-
export { Decorator, HtmlRenderer, Loader, Meta, Preview, StoryContext, StoryFn, StoryObj, setProjectAnnotations };
|
|
54
|
+
export { type Decorator, type HtmlRenderer, type Loader, type Meta, type Preview, type StoryContext, type StoryFn, type StoryObj, setProjectAnnotations };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import {
|
|
2
|
+
entry_preview_exports
|
|
3
|
+
} from "./_browser-chunks/chunk-R4NDMI3K.js";
|
|
4
|
+
import {
|
|
5
|
+
__name
|
|
6
|
+
} from "./_browser-chunks/chunk-JFJ5UJ7Q.js";
|
|
7
|
+
|
|
8
|
+
// src/globals.ts
|
|
9
|
+
import { global } from "@storybook/global";
|
|
10
|
+
var { window: globalWindow } = global;
|
|
11
|
+
globalWindow.STORYBOOK_ENV = "HTML";
|
|
12
|
+
|
|
13
|
+
// src/portable-stories.ts
|
|
14
|
+
import {
|
|
15
|
+
setProjectAnnotations as originalSetProjectAnnotations,
|
|
16
|
+
setDefaultProjectAnnotations
|
|
17
|
+
} from "storybook/preview-api";
|
|
18
|
+
function setProjectAnnotations(projectAnnotations) {
|
|
19
|
+
setDefaultProjectAnnotations(entry_preview_exports);
|
|
20
|
+
return originalSetProjectAnnotations(
|
|
21
|
+
projectAnnotations
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
__name(setProjectAnnotations, "setProjectAnnotations");
|
|
25
|
+
export {
|
|
26
|
+
setProjectAnnotations
|
|
27
|
+
};
|
package/dist/preset.js
CHANGED
|
@@ -1 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
import CJS_COMPAT_NODE_URL_7nkf3b0nov from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_7nkf3b0nov from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_7nkf3b0nov from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_7nkf3b0nov.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_7nkf3b0nov.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_7nkf3b0nov.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
|
+
// src/preset.ts
|
|
16
|
+
import { fileURLToPath } from "node:url";
|
|
17
|
+
var previewAnnotations = /* @__PURE__ */ __name(async (input = [], options) => {
|
|
18
|
+
const docsEnabled = Object.keys(await options.presets.apply("docs", {}, options)).length > 0;
|
|
19
|
+
const result = [];
|
|
20
|
+
return result.concat(input).concat([fileURLToPath(import.meta.resolve("@storybook/html/entry-preview"))]).concat(
|
|
21
|
+
docsEnabled ? [fileURLToPath(import.meta.resolve("@storybook/html/entry-preview-docs"))] : []
|
|
22
|
+
);
|
|
23
|
+
}, "previewAnnotations");
|
|
24
|
+
export {
|
|
25
|
+
previewAnnotations
|
|
26
|
+
};
|
package/package.json
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/html",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Storybook HTML renderer",
|
|
3
|
+
"version": "10.0.0-beta.1",
|
|
4
|
+
"description": "Storybook HTML renderer: Develop, document, and test UI components in isolation",
|
|
5
5
|
"keywords": [
|
|
6
|
-
"storybook"
|
|
6
|
+
"storybook",
|
|
7
|
+
"storybook-renderer",
|
|
8
|
+
"html",
|
|
9
|
+
"component",
|
|
10
|
+
"components"
|
|
7
11
|
],
|
|
8
12
|
"homepage": "https://github.com/storybookjs/storybook/tree/next/code/renderers/html",
|
|
9
13
|
"bugs": {
|
|
@@ -19,20 +23,17 @@
|
|
|
19
23
|
"url": "https://opencollective.com/storybook"
|
|
20
24
|
},
|
|
21
25
|
"license": "MIT",
|
|
26
|
+
"type": "module",
|
|
22
27
|
"exports": {
|
|
23
28
|
".": {
|
|
24
29
|
"types": "./dist/index.d.ts",
|
|
25
|
-
"
|
|
26
|
-
"require": "./dist/index.js"
|
|
30
|
+
"default": "./dist/index.js"
|
|
27
31
|
},
|
|
28
|
-
"./
|
|
29
|
-
"./
|
|
30
|
-
"./
|
|
31
|
-
"./
|
|
32
|
+
"./entry-preview": "./dist/entry-preview.js",
|
|
33
|
+
"./entry-preview-docs": "./dist/entry-preview-docs.js",
|
|
34
|
+
"./package.json": "./package.json",
|
|
35
|
+
"./preset": "./dist/preset.js"
|
|
32
36
|
},
|
|
33
|
-
"main": "dist/index.js",
|
|
34
|
-
"module": "dist/index.mjs",
|
|
35
|
-
"types": "dist/index.d.ts",
|
|
36
37
|
"files": [
|
|
37
38
|
"dist/**/*",
|
|
38
39
|
"template/cli/**/*",
|
|
@@ -42,8 +43,8 @@
|
|
|
42
43
|
"!src/**/*"
|
|
43
44
|
],
|
|
44
45
|
"scripts": {
|
|
45
|
-
"check": "jiti ../../../scripts/
|
|
46
|
-
"prep": "jiti ../../../scripts/
|
|
46
|
+
"check": "jiti ../../../scripts/check/check-package.ts",
|
|
47
|
+
"prep": "jiti ../../../scripts/build/build-package.ts"
|
|
47
48
|
},
|
|
48
49
|
"dependencies": {
|
|
49
50
|
"@storybook/global": "^5.0.0",
|
|
@@ -53,22 +54,10 @@
|
|
|
53
54
|
"typescript": "^5.8.3"
|
|
54
55
|
},
|
|
55
56
|
"peerDependencies": {
|
|
56
|
-
"storybook": "^
|
|
57
|
-
},
|
|
58
|
-
"engines": {
|
|
59
|
-
"node": ">=20.0.0"
|
|
57
|
+
"storybook": "^10.0.0-beta.1"
|
|
60
58
|
},
|
|
61
59
|
"publishConfig": {
|
|
62
60
|
"access": "public"
|
|
63
61
|
},
|
|
64
|
-
"
|
|
65
|
-
"entries": [
|
|
66
|
-
"./src/index.ts",
|
|
67
|
-
"./src/preset.ts",
|
|
68
|
-
"./src/entry-preview.ts",
|
|
69
|
-
"./src/entry-preview-docs.ts"
|
|
70
|
-
],
|
|
71
|
-
"platform": "browser"
|
|
72
|
-
},
|
|
73
|
-
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684"
|
|
62
|
+
"gitHead": "a8e7fd8a655c69780bc20b9749d2699e45beae16"
|
|
74
63
|
}
|
package/preset.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export * from './dist/preset.js';
|
package/dist/chunk-CEH6MNVV.mjs
DELETED
package/dist/chunk-ZBAUHALS.mjs
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { __export } from './chunk-CEH6MNVV.mjs';
|
|
2
|
-
import { enhanceArgTypes } from 'storybook/internal/docs-tools';
|
|
3
|
-
import { global } from '@storybook/global';
|
|
4
|
-
import { simulatePageLoad, simulateDOMContentLoaded } from 'storybook/preview-api';
|
|
5
|
-
import { dedent } from 'ts-dedent';
|
|
6
|
-
|
|
7
|
-
var entry_preview_exports={};__export(entry_preview_exports,{argTypesEnhancers:()=>argTypesEnhancers,parameters:()=>parameters,render:()=>render,renderToCanvas:()=>renderToCanvas});var {Node}=global,render=(args,context)=>{let{id,component:Component}=context;if(typeof Component=="string"){let output=Component;return Object.keys(args).forEach(key=>{output=output.replace(`{{${key}}}`,args[key]);}),output}if(Component instanceof HTMLElement){let output=Component.cloneNode(!0);return Object.keys(args).forEach(key=>{output.setAttribute(key,typeof args[key]=="string"?args[key]:JSON.stringify(args[key]));}),output}if(typeof Component=="function")return Component(args,context);throw console.warn(dedent`
|
|
8
|
-
Storybook's HTML renderer only supports rendering DOM elements and strings.
|
|
9
|
-
Received: ${Component}
|
|
10
|
-
`),new Error(`Unable to render story ${id}`)};function renderToCanvas({storyFn,kind,name,showMain,showError,forceRemount},canvasElement){let element=storyFn();if(showMain(),typeof element=="string")canvasElement.innerHTML=element,simulatePageLoad(canvasElement);else if(element instanceof Node){if(canvasElement.firstChild===element&&forceRemount===!1)return;canvasElement.innerHTML="",canvasElement.appendChild(element),simulateDOMContentLoaded();}else showError({title:`Expecting an HTML snippet or DOM node from the story: "${name}" of "${kind}".`,description:dedent`
|
|
11
|
-
Did you forget to return the HTML snippet from the story?
|
|
12
|
-
Use "() => <your snippet or node>" or when defining the story.
|
|
13
|
-
`});}var parameters={renderer:"html"},argTypesEnhancers=[enhanceArgTypes];
|
|
14
|
-
|
|
15
|
-
export { argTypesEnhancers, entry_preview_exports, parameters, render, renderToCanvas };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { SourceType } from 'storybook/internal/docs-tools';
|
|
2
|
-
import { DecoratorFunction } from 'storybook/internal/types';
|
|
3
|
-
import { H as HtmlRenderer } from './types-19e12ec7.js';
|
|
4
|
-
|
|
5
|
-
declare const decorators: DecoratorFunction<HtmlRenderer>[];
|
|
6
|
-
declare const parameters: {
|
|
7
|
-
docs: {
|
|
8
|
-
story: {
|
|
9
|
-
inline: boolean;
|
|
10
|
-
};
|
|
11
|
-
source: {
|
|
12
|
-
type: SourceType;
|
|
13
|
-
language: string;
|
|
14
|
-
code: undefined;
|
|
15
|
-
excludeDecorators: undefined;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export { decorators, parameters };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import './chunk-CEH6MNVV.mjs';
|
|
2
|
-
import { SourceType } from 'storybook/internal/docs-tools';
|
|
3
|
-
import { useRef, useEffect, emitTransformCode } from 'storybook/preview-api';
|
|
4
|
-
|
|
5
|
-
function skipSourceRender(context){let sourceParams=context?.parameters.docs?.source,isArgsStory=context?.parameters.__isArgsStory;return sourceParams?.type===SourceType.DYNAMIC?!1:!isArgsStory||sourceParams?.code||sourceParams?.type===SourceType.CODE}var sourceDecorator=(storyFn,context)=>{let source=useRef(void 0),story=storyFn();return useEffect(()=>{let renderedForSource=context?.parameters.docs?.source?.excludeDecorators?context.originalStoryFn(context.args,context):story;skipSourceRender(context)||(typeof renderedForSource=="string"&&source.current!==renderedForSource?(emitTransformCode(renderedForSource,context),source.current=renderedForSource):renderedForSource instanceof Element&&source.current!==renderedForSource.outerHTML&&(emitTransformCode(renderedForSource.outerHTML,context),source.current=renderedForSource.outerHTML));}),story};var decorators=[sourceDecorator],parameters={docs:{story:{inline:!0},source:{type:SourceType.DYNAMIC,language:"html",code:void 0,excludeDecorators:void 0}}};
|
|
6
|
-
|
|
7
|
-
export { decorators, parameters };
|
package/dist/entry-preview.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ArgsStoryFn, RenderContext, ArgTypesEnhancer } from 'storybook/internal/types';
|
|
2
|
-
import { H as HtmlRenderer, P as Parameters } from './types-19e12ec7.js';
|
|
3
|
-
import 'storybook/internal/docs-tools';
|
|
4
|
-
|
|
5
|
-
declare const render: ArgsStoryFn<HtmlRenderer>;
|
|
6
|
-
declare function renderToCanvas({ storyFn, kind, name, showMain, showError, forceRemount }: RenderContext<HtmlRenderer>, canvasElement: HtmlRenderer['canvasElement']): void;
|
|
7
|
-
|
|
8
|
-
declare const parameters: Parameters;
|
|
9
|
-
|
|
10
|
-
declare const argTypesEnhancers: ArgTypesEnhancer[];
|
|
11
|
-
|
|
12
|
-
export { argTypesEnhancers, parameters, render, renderToCanvas };
|
package/dist/entry-preview.mjs
DELETED
package/dist/index.mjs
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { entry_preview_exports } from './chunk-ZBAUHALS.mjs';
|
|
2
|
-
import './chunk-CEH6MNVV.mjs';
|
|
3
|
-
import { global } from '@storybook/global';
|
|
4
|
-
import { setDefaultProjectAnnotations, setProjectAnnotations as setProjectAnnotations$1 } from 'storybook/preview-api';
|
|
5
|
-
|
|
6
|
-
var{window:globalWindow}=global;globalWindow.STORYBOOK_ENV="HTML";function setProjectAnnotations(projectAnnotations){return setDefaultProjectAnnotations(entry_preview_exports),setProjectAnnotations$1(projectAnnotations)}
|
|
7
|
-
|
|
8
|
-
export { setProjectAnnotations };
|
package/dist/preset.d.ts
DELETED
package/dist/types-19e12ec7.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { SourceType } from 'storybook/internal/docs-tools';
|
|
2
|
-
import { WebRenderer, ArgsStoryFn } from 'storybook/internal/types';
|
|
3
|
-
|
|
4
|
-
type StoryFnHtmlReturnType = string | Node;
|
|
5
|
-
interface HtmlRenderer extends WebRenderer {
|
|
6
|
-
component: string | HTMLElement | ArgsStoryFn<HtmlRenderer>;
|
|
7
|
-
storyResult: StoryFnHtmlReturnType;
|
|
8
|
-
}
|
|
9
|
-
interface Parameters {
|
|
10
|
-
renderer: 'html';
|
|
11
|
-
docs?: {
|
|
12
|
-
story: {
|
|
13
|
-
inline: boolean;
|
|
14
|
-
};
|
|
15
|
-
source: {
|
|
16
|
-
type: SourceType.DYNAMIC;
|
|
17
|
-
language: 'html';
|
|
18
|
-
code: any;
|
|
19
|
-
excludeDecorators: any;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export { HtmlRenderer as H, Parameters as P };
|