@storybook/preact 7.0.7 → 7.0.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/chunk-OHNM7E4P.mjs +7 -2
- package/dist/config.d.ts +1 -8
- package/dist/config.mjs +5 -1
- package/dist/index.mjs +7 -1
- package/package.json +11 -11
package/dist/chunk-OHNM7E4P.mjs
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import*as preact from
|
|
1
|
+
import * as preact from 'preact';
|
|
2
|
+
import { dedent } from 'ts-dedent';
|
|
3
|
+
|
|
4
|
+
var {h:h2}=preact,render2=(args,context)=>{let{id,component:Component}=context;if(!Component)throw new Error(`Unable to render story ${id} as the component annotation is missing from the default export`);return h2(Component,{...args})},renderedStory;function preactRender(story,canvasElement){preact.Fragment?preact.render(story,canvasElement):renderedStory=preact.render(story,canvasElement,renderedStory);}var StoryHarness=({showError,name,title,storyFn,canvasElement})=>{let content=preact.h(storyFn,null);return content||(showError({title:`Expecting a Preact element from the story: "${name}" of "${title}".`,description:dedent`
|
|
2
5
|
Did you forget to return the Preact element from the story?
|
|
3
6
|
Use "() => (<MyComp/>)" or "() => { return <MyComp/>; }" when defining the story.
|
|
4
|
-
`}),null)};function renderToCanvas({storyFn,title,name,showMain,showError,forceRemount},canvasElement){forceRemount&&preactRender(null,canvasElement),showMain(),preactRender(preact.h(StoryHarness,{name,title,showError,storyFn,canvasElement}),canvasElement)}
|
|
7
|
+
`}),null)};function renderToCanvas({storyFn,title,name,showMain,showError,forceRemount},canvasElement){forceRemount&&preactRender(null,canvasElement),showMain(),preactRender(preact.h(StoryHarness,{name,title,showError,storyFn,canvasElement}),canvasElement);}
|
|
8
|
+
|
|
9
|
+
export { render2 as render, renderToCanvas };
|
package/dist/config.d.ts
CHANGED
|
@@ -5,13 +5,6 @@ import 'preact';
|
|
|
5
5
|
declare const render: ArgsStoryFn<PreactRenderer>;
|
|
6
6
|
declare function renderToCanvas({ storyFn, title, name, showMain, showError, forceRemount }: RenderContext<PreactRenderer>, canvasElement: PreactRenderer['canvasElement']): void;
|
|
7
7
|
|
|
8
|
-
declare const parameters: {
|
|
9
|
-
docs: {
|
|
10
|
-
story: {
|
|
11
|
-
inline: boolean;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
renderer: "preact";
|
|
15
|
-
};
|
|
8
|
+
declare const parameters: {};
|
|
16
9
|
|
|
17
10
|
export { parameters, render, renderToCanvas };
|
package/dist/config.mjs
CHANGED
|
@@ -1 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
export { render, renderToCanvas } from './chunk-OHNM7E4P.mjs';
|
|
2
|
+
|
|
3
|
+
var parameters={docs:{story:{inline:!0}}};var parameters2={renderer:"preact",...parameters};
|
|
4
|
+
|
|
5
|
+
export { parameters2 as parameters };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
import{renderToCanvas}from
|
|
1
|
+
import { renderToCanvas } from './chunk-OHNM7E4P.mjs';
|
|
2
|
+
import { global } from '@storybook/global';
|
|
3
|
+
import { start } from '@storybook/preview-api';
|
|
4
|
+
|
|
5
|
+
var{window:globalWindow}=global;globalWindow&&(globalWindow.STORYBOOK_ENV="preact");var RENDERER="preact",api=start(renderToCanvas),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();
|
|
6
|
+
|
|
7
|
+
export { configure, forceReRender, raw, storiesOf };
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/preact",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.8",
|
|
4
4
|
"description": "Storybook Preact renderer",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook"
|
|
7
7
|
],
|
|
8
|
-
"homepage": "https://github.com/storybookjs/storybook/tree/
|
|
8
|
+
"homepage": "https://github.com/storybookjs/storybook/tree/next/code/renderers/preact",
|
|
9
9
|
"bugs": {
|
|
10
10
|
"url": "https://github.com/storybookjs/storybook/issues"
|
|
11
11
|
},
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
|
14
14
|
"url": "https://github.com/storybookjs/storybook.git",
|
|
15
|
-
"directory": "renderers/preact"
|
|
15
|
+
"directory": "code/renderers/preact"
|
|
16
16
|
},
|
|
17
17
|
"funding": {
|
|
18
18
|
"type": "opencollective",
|
|
@@ -21,15 +21,15 @@
|
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"exports": {
|
|
23
23
|
".": {
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
24
25
|
"node": "./dist/index.js",
|
|
25
26
|
"require": "./dist/index.js",
|
|
26
|
-
"import": "./dist/index.mjs"
|
|
27
|
-
"types": "./dist/index.d.ts"
|
|
27
|
+
"import": "./dist/index.mjs"
|
|
28
28
|
},
|
|
29
29
|
"./preview": {
|
|
30
|
+
"types": "./dist/config.d.ts",
|
|
30
31
|
"require": "./dist/config.js",
|
|
31
|
-
"import": "./dist/config.mjs"
|
|
32
|
-
"types": "./dist/config.d.ts"
|
|
32
|
+
"import": "./dist/config.mjs"
|
|
33
33
|
},
|
|
34
34
|
"./package.json": "./package.json"
|
|
35
35
|
},
|
|
@@ -48,10 +48,10 @@
|
|
|
48
48
|
"prep": "../../../scripts/prepare/bundle.ts"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@storybook/core-client": "7.0.
|
|
51
|
+
"@storybook/core-client": "7.0.8",
|
|
52
52
|
"@storybook/global": "^5.0.0",
|
|
53
|
-
"@storybook/preview-api": "7.0.
|
|
54
|
-
"@storybook/types": "7.0.
|
|
53
|
+
"@storybook/preview-api": "7.0.8",
|
|
54
|
+
"@storybook/types": "7.0.8",
|
|
55
55
|
"ts-dedent": "^2.0.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
],
|
|
75
75
|
"platform": "browser"
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "9991b68c7d0cd1543c974f358cae9e0d02b29e7e"
|
|
78
78
|
}
|