@storybook/preact 7.0.0-alpha.47 → 7.0.0-alpha.49
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{chunk-VVPUC5MQ.mjs → chunk-SIW3OLET.mjs} +2 -2
- package/dist/config.d.ts +6 -3
- package/dist/config.js +2 -2
- package/dist/config.mjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/index.mjs +1 -1
- package/dist/{types-71aa9145.d.ts → types-9c757540.d.ts} +3 -2
- package/package.json +6 -6
- package/template/cli/Button.stories.jsx +2 -0
- package/template/cli/Header.stories.jsx +2 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
import*as e from"preact";import{dedent as i}from"ts-dedent";var{h:y}=e,
|
1
|
+
import*as e from"preact";import{dedent as i}from"ts-dedent";var{h:y}=e,f=(r,t)=>{let{id:o,component:n}=t;if(!n)throw new Error(`Unable to render story ${o} as the component annotation is missing from the default export`);return y(n,{...r})},m;function p(r,t){e.Fragment?e.render(r,t):m=e.render(r,t,m)}var l=({showError:r,name:t,title:o,storyFn:n,canvasElement:c})=>{let a=e.h(n,null);return a||(r({title:`Expecting a Preact element from the story: "${t}" of "${o}".`,description:i`
|
2
2
|
Did you forget to return the Preact element from the story?
|
3
3
|
Use "() => (<MyComp/>)" or "() => { return <MyComp/>; }" when defining the story.
|
4
|
-
`}),null)};function
|
4
|
+
`}),null)};function u({storyFn:r,title:t,name:o,showMain:n,showError:c,forceRemount:a},s){a&&p(null,s),n(),p(e.h(l,{name:o,title:t,showError:c,storyFn:r,canvasElement:s}),s)}export{f as a,u as b};
|
package/dist/config.d.ts
CHANGED
@@ -1,12 +1,15 @@
|
|
1
1
|
import { ArgsStoryFn, Store_RenderContext } from '@storybook/types';
|
2
|
-
import { P as PreactFramework } from './types-
|
2
|
+
import { P as PreactFramework } from './types-9c757540.js';
|
3
3
|
import 'preact';
|
4
4
|
|
5
5
|
declare const render: ArgsStoryFn<PreactFramework>;
|
6
|
-
declare function
|
6
|
+
declare function renderToCanvas({ storyFn, title, name, showMain, showError, forceRemount }: Store_RenderContext<PreactFramework>, canvasElement: PreactFramework['canvasElement']): void;
|
7
7
|
|
8
8
|
declare const parameters: {
|
9
|
+
docs: {
|
10
|
+
inlineStories: boolean;
|
11
|
+
};
|
9
12
|
framework: "preact";
|
10
13
|
};
|
11
14
|
|
12
|
-
export { parameters, render,
|
15
|
+
export { parameters, render, renderToCanvas };
|
package/dist/config.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
"use strict";var
|
1
|
+
"use strict";var w=Object.create;var m=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty;var S=(e,r)=>{for(var t in r)m(e,t,{get:r[t],enumerable:!0})},p=(e,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of h(r))!x.call(e,a)&&a!==t&&m(e,a,{get:()=>r[a],enumerable:!(o=F(r,a))||o.enumerable});return e};var g=(e,r,t)=>(t=e!=null?w(P(e)):{},p(r||!e||!e.__esModule?m(t,"default",{value:e,enumerable:!0}):t,e)),k=e=>p(m({},"__esModule",{value:!0}),e);var v={};S(v,{parameters:()=>R,render:()=>f,renderToCanvas:()=>u});module.exports=k(v);var i={docs:{inlineStories:!0}};var n=g(require("preact")),y=require("ts-dedent"),{h:C}=n,f=(e,r)=>{let{id:t,component:o}=r;if(!o)throw new Error(`Unable to render story ${t} as the component annotation is missing from the default export`);return C(o,{...e})},d;function l(e,r){n.Fragment?n.render(e,r):d=n.render(e,r,d)}var E=({showError:e,name:r,title:t,storyFn:o,canvasElement:a})=>{let s=n.h(o,null);return s||(e({title:`Expecting a Preact element from the story: "${r}" of "${t}".`,description:y.dedent`
|
2
2
|
Did you forget to return the Preact element from the story?
|
3
3
|
Use "() => (<MyComp/>)" or "() => { return <MyComp/>; }" when defining the story.
|
4
|
-
`}),null)};function
|
4
|
+
`}),null)};function u({storyFn:e,title:r,name:t,showMain:o,showError:a,forceRemount:s},c){s&&l(null,c),o(),l(n.h(E,{name:t,title:r,showError:a,storyFn:e,canvasElement:c}),c)}var R={framework:"preact",...i};0&&(module.exports={parameters,render,renderToCanvas});
|
package/dist/config.mjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
import{a as
|
1
|
+
import{a as e,b as a}from"./chunk-SIW3OLET.mjs";var r={docs:{inlineStories:!0}};var t={framework:"preact",...r};export{t as parameters,e as render,a as renderToCanvas};
|
package/dist/index.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { Addon_ClientStoryApi, Addon_Loadable, Args, ComponentAnnotations, AnnotatedStoryFn, StoryAnnotations } from '@storybook/types';
|
2
2
|
export { ArgTypes, Args, Parameters, StoryContext } from '@storybook/types';
|
3
|
-
import { P as PreactFramework } from './types-
|
3
|
+
import { P as PreactFramework } from './types-9c757540.js';
|
4
4
|
import 'preact';
|
5
5
|
|
6
6
|
interface ClientApi extends Addon_ClientStoryApi<PreactFramework['storyResult']> {
|
package/dist/index.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
"use strict";var
|
1
|
+
"use strict";var F=Object.create;var p=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var S=(e,r)=>{for(var t in r)p(e,t,{get:r[t],enumerable:!0})},m=(e,r,t,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of h(r))!k.call(e,n)&&n!==t&&p(e,n,{get:()=>r[n],enumerable:!(a=x(r,n))||a.enumerable});return e};var d=(e,r,t)=>(t=e!=null?F(P(e)):{},m(r||!e||!e.__esModule?p(t,"default",{value:e,enumerable:!0}):t,e)),E=e=>m(p({},"__esModule",{value:!0}),e);var M={};S(M,{configure:()=>b,forceReRender:()=>v,raw:()=>T,storiesOf:()=>_});module.exports=E(M);var f=d(require("global")),{window:l}=f.default;l&&(l.STORYBOOK_ENV="preact");var A=require("@storybook/core-client");var o=d(require("preact")),w=require("ts-dedent"),{h:K}=o;var y;function u(e,r){o.Fragment?o.render(e,r):y=o.render(e,r,y)}var O=({showError:e,name:r,title:t,storyFn:a,canvasElement:n})=>{let i=o.h(a,null);return i||(e({title:`Expecting a Preact element from the story: "${r}" of "${t}".`,description:w.dedent`
|
2
2
|
Did you forget to return the Preact element from the story?
|
3
3
|
Use "() => (<MyComp/>)" or "() => { return <MyComp/>; }" when defining the story.
|
4
|
-
`}),null)};function R({storyFn:e,title:r,name:t,showMain:
|
4
|
+
`}),null)};function R({storyFn:e,title:r,name:t,showMain:a,showError:n,forceRemount:i},c){i&&u(null,c),a(),u(o.h(O,{name:t,title:r,showError:n,storyFn:e,canvasElement:c}),c)}var C="preact",s=(0,A.start)(R),_=(e,r)=>s.clientApi.storiesOf(e,r).addParameters({framework:C}),b=(...e)=>s.configure(C,...e),v=s.forceReRender,T=s.clientApi.raw;var g;(g=module==null?void 0:module.hot)==null||g.decline();0&&(module.exports={configure,forceReRender,raw,storiesOf});
|
package/dist/index.mjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
import{b as
|
1
|
+
import{b as r}from"./chunk-SIW3OLET.mjs";import a from"global";var{window:t}=a;t&&(t.STORYBOOK_ENV="preact");import{start as p}from"@storybook/core-client";var i="preact",e=p(r),l=(o,n)=>e.clientApi.storiesOf(o,n).addParameters({framework:i}),f=(...o)=>e.configure(i,...o),m=e.forceReRender,A=e.clientApi.raw;module?.hot?.decline();export{f as configure,m as forceReRender,A as raw,l as storiesOf};
|
@@ -1,9 +1,10 @@
|
|
1
|
+
import { WebFramework } from '@storybook/types';
|
1
2
|
import { AnyComponent } from 'preact';
|
2
3
|
|
3
4
|
declare type StoryFnPreactReturnType = string | Node | preact.JSX.Element;
|
4
|
-
|
5
|
+
interface PreactFramework extends WebFramework {
|
5
6
|
component: AnyComponent<any, any>;
|
6
7
|
storyResult: StoryFnPreactReturnType;
|
7
|
-
}
|
8
|
+
}
|
8
9
|
|
9
10
|
export { PreactFramework as P };
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@storybook/preact",
|
3
|
-
"version": "7.0.0-alpha.
|
3
|
+
"version": "7.0.0-alpha.49",
|
4
4
|
"description": "Storybook Preact renderer",
|
5
5
|
"keywords": [
|
6
6
|
"storybook"
|
@@ -51,10 +51,10 @@
|
|
51
51
|
"prep": "../../../scripts/prepare/bundle.ts"
|
52
52
|
},
|
53
53
|
"dependencies": {
|
54
|
-
"@storybook/addons": "7.0.0-alpha.
|
55
|
-
"@storybook/core-client": "7.0.0-alpha.
|
56
|
-
"@storybook/store": "7.0.0-alpha.
|
57
|
-
"@storybook/types": "7.0.0-alpha.
|
54
|
+
"@storybook/addons": "7.0.0-alpha.49",
|
55
|
+
"@storybook/core-client": "7.0.0-alpha.49",
|
56
|
+
"@storybook/store": "7.0.0-alpha.49",
|
57
|
+
"@storybook/types": "7.0.0-alpha.49",
|
58
58
|
"global": "^4.4.0",
|
59
59
|
"react": "16.14.0",
|
60
60
|
"react-dom": "16.14.0",
|
@@ -80,5 +80,5 @@
|
|
80
80
|
],
|
81
81
|
"platform": "browser"
|
82
82
|
},
|
83
|
-
"gitHead": "
|
83
|
+
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
84
84
|
}
|
@@ -4,6 +4,8 @@ import { Button } from './Button';
|
|
4
4
|
export default {
|
5
5
|
title: 'Example/Button',
|
6
6
|
component: Button,
|
7
|
+
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/preact/writing-docs/docs-page
|
8
|
+
tags: ['docsPage'],
|
7
9
|
// More on argTypes: https://storybook.js.org/docs/preact/api/argtypes
|
8
10
|
argTypes: {
|
9
11
|
backgroundColor: { control: 'color' },
|
@@ -3,6 +3,8 @@ import { Header } from './Header';
|
|
3
3
|
export default {
|
4
4
|
title: 'Example/Header',
|
5
5
|
component: Header,
|
6
|
+
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/preact/writing-docs/docs-page
|
7
|
+
tags: ['docsPage'],
|
6
8
|
parameters: {
|
7
9
|
// More on Story layout: https://storybook.js.org/docs/preact/configure/story-layout
|
8
10
|
layout: 'fullscreen',
|