@storybook/html 7.1.0-alpha.0 → 7.1.0-alpha.10
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/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +6 -6
- package/template/cli/js/Button.stories.js +2 -2
- package/template/cli/js/Header.stories.js +3 -3
- package/template/cli/js/Page.stories.js +2 -2
- package/template/cli/ts-3-8/Button.stories.ts +1 -1
- package/template/cli/ts-3-8/Header.stories.ts +3 -3
- package/template/cli/ts-3-8/Page.stories.ts +2 -2
- package/template/cli/ts-4-9/Button.stories.ts +1 -1
- package/template/cli/ts-4-9/Header.stories.ts +3 -3
- package/template/cli/ts-4-9/Page.stories.ts +2 -2
package/dist/index.js
CHANGED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
`),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,(0,import_preview_api.simulatePageLoad)(canvasElement);else if(element instanceof Node){if(canvasElement.firstChild===element&&forceRemount===!1)return;canvasElement.innerHTML="",canvasElement.appendChild(element),(0,import_preview_api.simulateDOMContentLoaded)()}else showError({title:`Expecting an HTML snippet or DOM node from the story: "${name}" of "${kind}".`,description:import_ts_dedent.dedent`
|
|
5
5
|
Did you forget to return the HTML snippet from the story?
|
|
6
6
|
Use "() => <your snippet or node>" or when defining the story.
|
|
7
|
-
`})}var RENDERER="html",api=(0,import_preview_api2.start)(renderToCanvas,{render}),storiesOf=(kind,m)=>api.clientApi.storiesOf(kind,m).addParameters({renderer:RENDERER}),configure=(...args)=>api.configure(RENDERER,...args),forceReRender=api.forceReRender,raw=api.clientApi.raw;var _a;(_a=module==null?void 0:module.hot)==null||_a.decline();0&&(module.exports={configure,forceReRender,raw,storiesOf});
|
|
7
|
+
`})}var RENDERER="html",api=(0,import_preview_api2.start)(renderToCanvas,{render}),storiesOf=(kind,m)=>api.clientApi.storiesOf(kind,m).addParameters({renderer:RENDERER}),configure=(...args)=>api.configure(RENDERER,...args),forceReRender=api.forceReRender,raw=api.clientApi.raw;var _a;typeof module<"u"&&((_a=module==null?void 0:module.hot)==null||_a.decline());0&&(module.exports={configure,forceReRender,raw,storiesOf});
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{render,renderToCanvas}from"./chunk-JHBKUHDQ.mjs";import{global}from"@storybook/global";var{window:globalWindow}=global;globalWindow.STORYBOOK_ENV="HTML";import{start}from"@storybook/preview-api";var RENDERER="html",api=start(renderToCanvas,{render}),storiesOf=(kind,m)=>api.clientApi.storiesOf(kind,m).addParameters({renderer:RENDERER}),configure=(...args)=>api.configure(RENDERER,...args),forceReRender=api.forceReRender,raw=api.clientApi.raw;module?.hot?.decline();export{configure,forceReRender,raw,storiesOf};
|
|
1
|
+
import{render,renderToCanvas}from"./chunk-JHBKUHDQ.mjs";import{global}from"@storybook/global";var{window:globalWindow}=global;globalWindow.STORYBOOK_ENV="HTML";import{start}from"@storybook/preview-api";var RENDERER="html",api=start(renderToCanvas,{render}),storiesOf=(kind,m)=>api.clientApi.storiesOf(kind,m).addParameters({renderer:RENDERER}),configure=(...args)=>api.configure(RENDERER,...args),forceReRender=api.forceReRender,raw=api.clientApi.raw;typeof module<"u"&&module?.hot?.decline();export{configure,forceReRender,raw,storiesOf};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/html",
|
|
3
|
-
"version": "7.1.0-alpha.
|
|
3
|
+
"version": "7.1.0-alpha.10",
|
|
4
4
|
"description": "Storybook HTML renderer",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook"
|
|
@@ -48,11 +48,11 @@
|
|
|
48
48
|
"prep": "../../../scripts/prepare/bundle.ts"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@storybook/core-client": "7.1.0-alpha.
|
|
52
|
-
"@storybook/docs-tools": "7.1.0-alpha.
|
|
51
|
+
"@storybook/core-client": "7.1.0-alpha.10",
|
|
52
|
+
"@storybook/docs-tools": "7.1.0-alpha.10",
|
|
53
53
|
"@storybook/global": "^5.0.0",
|
|
54
|
-
"@storybook/preview-api": "7.1.0-alpha.
|
|
55
|
-
"@storybook/types": "7.1.0-alpha.
|
|
54
|
+
"@storybook/preview-api": "7.1.0-alpha.10",
|
|
55
|
+
"@storybook/types": "7.1.0-alpha.10",
|
|
56
56
|
"ts-dedent": "^2.0.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
],
|
|
75
75
|
"platform": "browser"
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "e7c833e690dd0d2966ffb7fb806a3bda89a508c8"
|
|
78
78
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createButton } from './Button';
|
|
2
2
|
|
|
3
|
-
// More on how to set up stories at: https://storybook.js.org/docs/
|
|
3
|
+
// More on how to set up stories at: https://storybook.js.org/docs/html/writing-stories/introduction
|
|
4
4
|
export default {
|
|
5
5
|
title: 'Example/Button',
|
|
6
6
|
tags: ['autodocs'],
|
|
@@ -21,7 +21,7 @@ export default {
|
|
|
21
21
|
},
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
// More on writing stories with args: https://storybook.js.org/docs/
|
|
24
|
+
// More on writing stories with args: https://storybook.js.org/docs/html/writing-stories/args
|
|
25
25
|
export const Primary = {
|
|
26
26
|
args: {
|
|
27
27
|
primary: true,
|
|
@@ -2,14 +2,14 @@ import { createHeader } from './Header';
|
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
title: 'Example/Header',
|
|
5
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/
|
|
5
|
+
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/html/writing-docs/autodocs
|
|
6
6
|
tags: ['autodocs'],
|
|
7
7
|
render: (args) => createHeader(args),
|
|
8
8
|
parameters: {
|
|
9
|
-
// More on how to position stories at: https://storybook.js.org/docs/
|
|
9
|
+
// More on how to position stories at: https://storybook.js.org/docs/html/configure/story-layout
|
|
10
10
|
layout: 'fullscreen',
|
|
11
11
|
},
|
|
12
|
-
// More on argTypes: https://storybook.js.org/docs/
|
|
12
|
+
// More on argTypes: https://storybook.js.org/docs/html/api/argtypes
|
|
13
13
|
argTypes: {
|
|
14
14
|
onLogin: { action: 'onLogin' },
|
|
15
15
|
onLogout: { action: 'onLogout' },
|
|
@@ -5,14 +5,14 @@ export default {
|
|
|
5
5
|
title: 'Example/Page',
|
|
6
6
|
render: () => createPage(),
|
|
7
7
|
parameters: {
|
|
8
|
-
// More on how to position stories at: https://storybook.js.org/docs/
|
|
8
|
+
// More on how to position stories at: https://storybook.js.org/docs/html/configure/story-layout
|
|
9
9
|
layout: 'fullscreen',
|
|
10
10
|
},
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
export const LoggedOut = {};
|
|
14
14
|
|
|
15
|
-
// More on interaction testing: https://storybook.js.org/docs/
|
|
15
|
+
// More on interaction testing: https://storybook.js.org/docs/html/writing-tests/interaction-testing
|
|
16
16
|
export const LoggedIn = {
|
|
17
17
|
play: async ({ canvasElement }) => {
|
|
18
18
|
const canvas = within(canvasElement);
|
|
@@ -26,7 +26,7 @@ const meta: Meta<ButtonProps> = {
|
|
|
26
26
|
export default meta;
|
|
27
27
|
type Story = StoryObj<ButtonProps>;
|
|
28
28
|
|
|
29
|
-
// More on writing stories with args: https://storybook.js.org/docs/
|
|
29
|
+
// More on writing stories with args: https://storybook.js.org/docs/html/writing-stories/args
|
|
30
30
|
export const Primary: Story = {
|
|
31
31
|
args: {
|
|
32
32
|
primary: true,
|
|
@@ -4,14 +4,14 @@ import { createHeader } from './Header';
|
|
|
4
4
|
|
|
5
5
|
const meta: Meta<HeaderProps> = {
|
|
6
6
|
title: 'Example/Header',
|
|
7
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/
|
|
7
|
+
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/html/writing-docs/autodocs
|
|
8
8
|
tags: ['autodocs'],
|
|
9
9
|
render: (args) => createHeader(args),
|
|
10
10
|
parameters: {
|
|
11
|
-
// More on how to position stories at: https://storybook.js.org/docs/
|
|
11
|
+
// More on how to position stories at: https://storybook.js.org/docs/html/configure/story-layout
|
|
12
12
|
layout: 'fullscreen',
|
|
13
13
|
},
|
|
14
|
-
// More on argTypes: https://storybook.js.org/docs/
|
|
14
|
+
// More on argTypes: https://storybook.js.org/docs/html/api/argtypes
|
|
15
15
|
argTypes: {
|
|
16
16
|
onLogin: { action: 'onLogin' },
|
|
17
17
|
onLogout: { action: 'onLogout' },
|
|
@@ -6,7 +6,7 @@ const meta: Meta = {
|
|
|
6
6
|
title: 'Example/Page',
|
|
7
7
|
render: () => createPage(),
|
|
8
8
|
parameters: {
|
|
9
|
-
// More on how to position stories at: https://storybook.js.org/docs/
|
|
9
|
+
// More on how to position stories at: https://storybook.js.org/docs/html/configure/story-layout
|
|
10
10
|
layout: 'fullscreen',
|
|
11
11
|
},
|
|
12
12
|
};
|
|
@@ -15,7 +15,7 @@ export default meta;
|
|
|
15
15
|
|
|
16
16
|
export const LoggedOut: StoryObj = {};
|
|
17
17
|
|
|
18
|
-
// More on interaction testing: https://storybook.js.org/docs/
|
|
18
|
+
// More on interaction testing: https://storybook.js.org/docs/html/writing-tests/interaction-testing
|
|
19
19
|
export const LoggedIn: StoryObj = {
|
|
20
20
|
play: async ({ canvasElement }) => {
|
|
21
21
|
const canvas = within(canvasElement);
|
|
@@ -26,7 +26,7 @@ const meta = {
|
|
|
26
26
|
export default meta;
|
|
27
27
|
type Story = StoryObj<ButtonProps>;
|
|
28
28
|
|
|
29
|
-
// More on writing stories with args: https://storybook.js.org/docs/
|
|
29
|
+
// More on writing stories with args: https://storybook.js.org/docs/html/writing-stories/args
|
|
30
30
|
export const Primary: Story = {
|
|
31
31
|
args: {
|
|
32
32
|
primary: true,
|
|
@@ -4,14 +4,14 @@ import { createHeader } from './Header';
|
|
|
4
4
|
|
|
5
5
|
const meta = {
|
|
6
6
|
title: 'Example/Header',
|
|
7
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/
|
|
7
|
+
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/html/writing-docs/autodocs
|
|
8
8
|
tags: ['autodocs'],
|
|
9
9
|
render: (args) => createHeader(args),
|
|
10
10
|
parameters: {
|
|
11
|
-
// More on how to position stories at: https://storybook.js.org/docs/
|
|
11
|
+
// More on how to position stories at: https://storybook.js.org/docs/html/configure/story-layout
|
|
12
12
|
layout: 'fullscreen',
|
|
13
13
|
},
|
|
14
|
-
// More on argTypes: https://storybook.js.org/docs/
|
|
14
|
+
// More on argTypes: https://storybook.js.org/docs/html/api/argtypes
|
|
15
15
|
argTypes: {
|
|
16
16
|
onLogin: { action: 'onLogin' },
|
|
17
17
|
onLogout: { action: 'onLogout' },
|
|
@@ -6,7 +6,7 @@ const meta = {
|
|
|
6
6
|
title: 'Example/Page',
|
|
7
7
|
render: () => createPage(),
|
|
8
8
|
parameters: {
|
|
9
|
-
// More on how to position stories at: https://storybook.js.org/docs/
|
|
9
|
+
// More on how to position stories at: https://storybook.js.org/docs/html/configure/story-layout
|
|
10
10
|
layout: 'fullscreen',
|
|
11
11
|
},
|
|
12
12
|
} satisfies Meta;
|
|
@@ -15,7 +15,7 @@ export default meta;
|
|
|
15
15
|
|
|
16
16
|
export const LoggedOut: StoryObj = {};
|
|
17
17
|
|
|
18
|
-
// More on interaction testing: https://storybook.js.org/docs/
|
|
18
|
+
// More on interaction testing: https://storybook.js.org/docs/html/writing-tests/interaction-testing
|
|
19
19
|
export const LoggedIn: StoryObj = {
|
|
20
20
|
play: async ({ canvasElement }) => {
|
|
21
21
|
const canvas = within(canvasElement);
|