@storybook/html 7.0.0-alpha.34 → 7.0.0-alpha.37
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-GYELUVFC.mjs +7 -0
- package/dist/config.d.ts +2 -2
- package/dist/config.js +5 -2
- package/dist/config.mjs +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -2
- package/dist/index.mjs +1 -1
- package/dist/{types-5a8f2337.d.ts → types-70312e86.d.ts} +6 -5
- package/package.json +8 -8
- package/dist/chunk-6QRYQ3I4.mjs +0 -4
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import d from"global";import{dedent as f}from"ts-dedent";import{simulatePageLoad as m,simulateDOMContentLoaded as l}from"@storybook/preview-web";var{Node:c}=d,h=(e,s)=>{let{id:p,component:t}=s;if(typeof t=="string"){let r=t;return Object.keys(e).forEach(o=>{r=r.replace(`{{${o}}}`,e[o])}),r}if(t instanceof HTMLElement){let r=t.cloneNode(!0);return Object.keys(e).forEach(o=>{r.setAttribute(o,typeof e[o]=="string"?e[o]:JSON.stringify(e[o]))}),r}if(typeof t=="function")return t(e,s);throw console.warn(f`
|
|
2
|
+
Storybook's HTML renderer only supports rendering DOM elements and strings.
|
|
3
|
+
Received: ${t}
|
|
4
|
+
`),new Error(`Unable to render story ${p}`)};function H({storyFn:e,kind:s,name:p,showMain:t,showError:r,forceRemount:o},n){let i=e();if(t(),typeof i=="string")n.innerHTML=i,m(n);else if(i instanceof c){if(n.firstChild===i&&o===!1)return;n.innerHTML="",n.appendChild(i),l()}else r({title:`Expecting an HTML snippet or DOM node from the story: "${p}" of "${s}".`,description:f`
|
|
5
|
+
Did you forget to return the HTML snippet from the story?
|
|
6
|
+
Use "() => <your snippet or node>" or when defining the story.
|
|
7
|
+
`})}export{h as a,H as b};
|
package/dist/config.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import 'lib/docs-tools/dist/types';
|
|
2
|
-
export { a as argTypesEnhancers, d as decorators, p as parameters, r as renderToDOM } from './types-
|
|
2
|
+
export { a as argTypesEnhancers, d as decorators, p as parameters, b as render, r as renderToDOM } from './types-70312e86.js';
|
|
3
3
|
import '@storybook/csf';
|
|
4
|
-
import 'lib/addons/dist
|
|
4
|
+
import 'lib/addons/dist';
|
|
5
5
|
import '@storybook/store';
|
package/dist/config.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var w=Object.create;var a=Object.defineProperty;var H=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var F=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var L=(e,r)=>{for(var t in r)a(e,t,{get:r[t],enumerable:!0})},y=(e,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of E(r))!k.call(e,n)&&n!==t&&a(e,n,{get:()=>r[n],enumerable:!(o=H(r,n))||o.enumerable});return e};var O=(e,r,t)=>(t=e!=null?w(F(e)):{},y(r||!e||!e.__esModule?a(t,"default",{value:e,enumerable:!0}):t,e)),b=e=>y(a({},"__esModule",{value:!0}),e);var _={};L(_,{argTypesEnhancers:()=>h,decorators:()=>g,parameters:()=>I,render:()=>M,renderToDOM:()=>C});module.exports=b(_);var d=require("@storybook/docs-tools");var p=require("@storybook/docs-tools"),m=require("@storybook/addons"),l=require("ts-dedent");function A(e){var o;let r=(o=e==null?void 0:e.parameters.docs)==null?void 0:o.source,t=e==null?void 0:e.parameters.__isArgsStory;return(r==null?void 0:r.type)===p.SourceType.DYNAMIC?!1:!t||(r==null?void 0:r.code)||(r==null?void 0:r.type)===p.SourceType.CODE}function N(e){return(0,l.dedent)(e)}function R(e,r){return((r.parameters.docs??{}).transformSource??N)(e,r)}function S(e,r){var n,s;let t=(s=(n=r==null?void 0:r.parameters.docs)==null?void 0:n.source)!=null&&s.excludeDecorators?r.originalStoryFn(r.args,r):e(),o;return A(r)||(typeof t=="string"?o=t:t instanceof Element&&(o=t.outerHTML),o&&(o=R(o,r))),(0,m.useEffect)(()=>{o&&m.addons.getChannel().emit(p.SNIPPET_RENDERED,r.id,o)}),t}var g=[S],T={docs:{inlineStories:!0,transformSource:void 0,source:{type:d.SourceType.DYNAMIC,language:"html",code:void 0,excludeDecorators:void 0}}},h=[d.enhanceArgTypes];var D=O(require("global")),c=require("ts-dedent"),u=require("@storybook/preview-web"),{Node:$}=D.default,M=(e,r)=>{let{id:t,component:o}=r;if(typeof o=="string"){let n=o;return Object.keys(e).forEach(s=>{n=n.replace(`{{${s}}}`,e[s])}),n}if(o instanceof HTMLElement){let n=o.cloneNode(!0);return Object.keys(e).forEach(s=>{n.setAttribute(s,typeof e[s]=="string"?e[s]:JSON.stringify(e[s]))}),n}if(typeof o=="function")return o(e,r);throw console.warn(c.dedent`
|
|
2
|
+
Storybook's HTML renderer only supports rendering DOM elements and strings.
|
|
3
|
+
Received: ${o}
|
|
4
|
+
`),new Error(`Unable to render story ${t}`)};function C({storyFn:e,kind:r,name:t,showMain:o,showError:n,forceRemount:s},i){let f=e();if(o(),typeof f=="string")i.innerHTML=f,(0,u.simulatePageLoad)(i);else if(f instanceof $){if(i.firstChild===f&&s===!1)return;i.innerHTML="",i.appendChild(f),(0,u.simulateDOMContentLoaded)()}else n({title:`Expecting an HTML snippet or DOM node from the story: "${t}" of "${r}".`,description:c.dedent`
|
|
2
5
|
Did you forget to return the HTML snippet from the story?
|
|
3
6
|
Use "() => <your snippet or node>" or when defining the story.
|
|
4
|
-
`})}var I={framework:"html",...
|
|
7
|
+
`})}var I={framework:"html",...T};0&&(module.exports={argTypesEnhancers,decorators,parameters,render,renderToDOM});
|
package/dist/config.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as m}from"./chunk-
|
|
1
|
+
import{a as m,b as i}from"./chunk-GYELUVFC.mjs";import{SourceType as g,enhanceArgTypes as D}from"@storybook/docs-tools";import{SNIPPET_RENDERED as f,SourceType as s}from"@storybook/docs-tools";import{addons as u,useEffect as p}from"@storybook/addons";import{dedent as d}from"ts-dedent";function y(o){let r=o?.parameters.docs?.source,e=o?.parameters.__isArgsStory;return r?.type===s.DYNAMIC?!1:!e||r?.code||r?.type===s.CODE}function S(o){return d(o)}function l(o,r){return((r.parameters.docs??{}).transformSource??S)(o,r)}function a(o,r){let e=r?.parameters.docs?.source?.excludeDecorators?r.originalStoryFn(r.args,r):o(),t;return y(r)||(typeof e=="string"?t=e:e instanceof Element&&(t=e.outerHTML),t&&(t=l(t,r))),p(()=>{t&&u.getChannel().emit(f,r.id,t)}),e}var T=[a],c={docs:{inlineStories:!0,transformSource:void 0,source:{type:g.DYNAMIC,language:"html",code:void 0,excludeDecorators:void 0}}},E=[D];var M={framework:"html",...c};export{E as argTypesEnhancers,T as decorators,M as parameters,m as render,i as renderToDOM};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ClientStoryApi, Loadable } from '@storybook/addons';
|
|
2
|
-
import { H as HtmlFramework, I as IStorybookSection } from './types-
|
|
2
|
+
import { H as HtmlFramework, I as IStorybookSection } from './types-70312e86.js';
|
|
3
3
|
import { Args, ComponentAnnotations, AnnotatedStoryFn, StoryAnnotations } from '@storybook/csf';
|
|
4
4
|
export { ArgTypes, Args, Parameters } from '@storybook/csf';
|
|
5
5
|
import 'lib/docs-tools/dist/types';
|
|
6
|
-
import 'lib/addons/dist
|
|
6
|
+
import 'lib/addons/dist';
|
|
7
7
|
import '@storybook/store';
|
|
8
8
|
|
|
9
9
|
interface ClientApi extends ClientStoryApi<HtmlFramework['storyResult']> {
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var x=Object.create;var a=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var M=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty;var D=(e,o)=>{for(var r in o)a(e,r,{get:o[r],enumerable:!0})},f=(e,o,r,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of R(o))!S.call(e,t)&&t!==r&&a(e,t,{get:()=>o[t],enumerable:!(n=O(o,t))||n.enumerable});return e};var m=(e,o,r)=>(r=e!=null?x(M(e)):{},f(o||!e||!e.__esModule?a(r,"default",{value:e,enumerable:!0}):r,e)),k=e=>f(a({},"__esModule",{value:!0}),e);var I={};D(I,{addDecorator:()=>F,addParameters:()=>P,clearDecorators:()=>v,configure:()=>T,forceReRender:()=>N,getStorybook:()=>$,raw:()=>j,setAddon:()=>E,storiesOf:()=>L});module.exports=k(I);var y=m(require("global")),{window:H}=y.default;H.STORYBOOK_ENV="HTML";var b=require("@storybook/core-client");var A=m(require("global")),l=require("ts-dedent"),c=require("@storybook/preview-web"),{Node:h}=A.default,u=(e,o)=>{let{id:r,component:n}=o;if(typeof n=="string"){let t=n;return Object.keys(e).forEach(i=>{t=t.replace(`{{${i}}}`,e[i])}),t}if(n instanceof HTMLElement){let t=n.cloneNode(!0);return Object.keys(e).forEach(i=>{t.setAttribute(i,typeof e[i]=="string"?e[i]:JSON.stringify(e[i]))}),t}if(typeof n=="function")return n(e,o);throw console.warn(l.dedent`
|
|
2
|
+
Storybook's HTML renderer only supports rendering DOM elements and strings.
|
|
3
|
+
Received: ${n}
|
|
4
|
+
`),new Error(`Unable to render story ${r}`)};function C({storyFn:e,kind:o,name:r,showMain:n,showError:t,forceRemount:i},p){let d=e();if(n(),typeof d=="string")p.innerHTML=d,(0,c.simulatePageLoad)(p);else if(d instanceof h){if(p.firstChild===d&&i===!1)return;p.innerHTML="",p.appendChild(d),(0,c.simulateDOMContentLoaded)()}else t({title:`Expecting an HTML snippet or DOM node from the story: "${r}" of "${o}".`,description:l.dedent`
|
|
2
5
|
Did you forget to return the HTML snippet from the story?
|
|
3
6
|
Use "() => <your snippet or node>" or when defining the story.
|
|
4
|
-
`})}var
|
|
7
|
+
`})}var g="html",s=(0,b.start)(C,{render:u}),L=(e,o)=>s.clientApi.storiesOf(e,o).addParameters({framework:g}),T=(...e)=>s.configure(g,...e),F=s.clientApi.addDecorator,P=s.clientApi.addParameters,v=s.clientApi.clearDecorators,E=s.clientApi.setAddon,N=s.forceReRender,$=s.clientApi.getStorybook,j=s.clientApi.raw;var w;(w=module==null?void 0:module.hot)==null||w.decline();0&&(module.exports={addDecorator,addParameters,clearDecorators,configure,forceReRender,getStorybook,raw,setAddon,storiesOf});
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
1
|
+
import{a as e,b as n}from"./chunk-GYELUVFC.mjs";import s from"global";var{window:p}=s;p.STORYBOOK_ENV="HTML";import{start as d}from"@storybook/core-client";var i="html",o=d(n,{render:e}),m=(r,a)=>o.clientApi.storiesOf(r,a).addParameters({framework:i}),y=(...r)=>o.configure(i,...r),f=o.clientApi.addDecorator,g=o.clientApi.addParameters,S=o.clientApi.clearDecorators,x=o.clientApi.setAddon,C=o.forceReRender,k=o.clientApi.getStorybook,b=o.clientApi.raw;module?.hot?.decline();export{f as addDecorator,g as addParameters,S as clearDecorators,y as configure,C as forceReRender,k as getStorybook,b as raw,x as setAddon,m as storiesOf};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import * as _storybook_csf from '@storybook/csf';
|
|
2
|
-
import { PartialStoryFn, StoryContext as StoryContext$1 } from '@storybook/csf';
|
|
2
|
+
import { PartialStoryFn, ArgsStoryFn, StoryContext as StoryContext$1 } from '@storybook/csf';
|
|
3
3
|
import * as lib_docs_tools_dist_types from 'lib/docs-tools/dist/types';
|
|
4
|
-
import * as
|
|
4
|
+
import * as lib_addons_dist from 'lib/addons/dist';
|
|
5
5
|
import { RenderContext } from '@storybook/store';
|
|
6
6
|
|
|
7
7
|
declare function sourceDecorator(storyFn: PartialStoryFn<HtmlFramework>, context: StoryContext): StoryFnHtmlReturnType;
|
|
8
8
|
|
|
9
9
|
declare const decorators: (typeof sourceDecorator)[];
|
|
10
|
-
declare const argTypesEnhancers: (<TFramework extends _storybook_csf.AnyFramework>(context: _storybook_csf.StoryContextForEnhancers<TFramework, _storybook_csf.Args>) => _storybook_csf.StrictArgTypes<_storybook_csf.Args> |
|
|
10
|
+
declare const argTypesEnhancers: (<TFramework extends _storybook_csf.AnyFramework>(context: _storybook_csf.StoryContextForEnhancers<TFramework, _storybook_csf.Args>) => _storybook_csf.StrictArgTypes<_storybook_csf.Args> | lib_addons_dist.Parameters)[];
|
|
11
11
|
|
|
12
|
+
declare const render: ArgsStoryFn<HtmlFramework>;
|
|
12
13
|
declare function renderToDOM({ storyFn, kind, name, showMain, showError, forceRemount }: RenderContext<HtmlFramework>, domElement: Element): void;
|
|
13
14
|
|
|
14
15
|
declare const parameters: {
|
|
@@ -35,11 +36,11 @@ interface IStorybookSection {
|
|
|
35
36
|
stories: IStorybookStory[];
|
|
36
37
|
}
|
|
37
38
|
declare type HtmlFramework = {
|
|
38
|
-
component: HTMLElement
|
|
39
|
+
component: string | HTMLElement | ArgsStoryFn<HtmlFramework>;
|
|
39
40
|
storyResult: StoryFnHtmlReturnType;
|
|
40
41
|
};
|
|
41
42
|
declare type StoryContext = StoryContext$1<HtmlFramework> & {
|
|
42
43
|
parameters: StoryContext$1<HtmlFramework>['parameters'] & typeof parameters;
|
|
43
44
|
};
|
|
44
45
|
|
|
45
|
-
export { HtmlFramework as H, IStorybookSection as I, argTypesEnhancers as a, decorators as d, parameters as p, renderToDOM as r };
|
|
46
|
+
export { HtmlFramework as H, IStorybookSection as I, argTypesEnhancers as a, render as b, decorators as d, parameters as p, renderToDOM as r };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/html",
|
|
3
|
-
"version": "7.0.0-alpha.
|
|
3
|
+
"version": "7.0.0-alpha.37",
|
|
4
4
|
"description": "Storybook HTML renderer",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook"
|
|
@@ -50,12 +50,12 @@
|
|
|
50
50
|
"prep": "../../../scripts/prepare/bundle.ts"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@storybook/addons": "7.0.0-alpha.
|
|
54
|
-
"@storybook/core-client": "7.0.0-alpha.
|
|
55
|
-
"@storybook/csf": "0.0.2--canary.
|
|
56
|
-
"@storybook/docs-tools": "7.0.0-alpha.
|
|
57
|
-
"@storybook/preview-web": "7.0.0-alpha.
|
|
58
|
-
"@storybook/store": "7.0.0-alpha.
|
|
53
|
+
"@storybook/addons": "7.0.0-alpha.37",
|
|
54
|
+
"@storybook/core-client": "7.0.0-alpha.37",
|
|
55
|
+
"@storybook/csf": "0.0.2--canary.49.258942b.0",
|
|
56
|
+
"@storybook/docs-tools": "7.0.0-alpha.37",
|
|
57
|
+
"@storybook/preview-web": "7.0.0-alpha.37",
|
|
58
|
+
"@storybook/store": "7.0.0-alpha.37",
|
|
59
59
|
"global": "^4.4.0",
|
|
60
60
|
"react": "16.14.0",
|
|
61
61
|
"react-dom": "16.14.0",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
],
|
|
81
81
|
"platform": "browser"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "82667a655108283aafc828427f00bb3590a334e5"
|
|
84
84
|
}
|
package/dist/chunk-6QRYQ3I4.mjs
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import f from"global";import{dedent as d}from"ts-dedent";import{simulatePageLoad as a,simulateDOMContentLoaded as m}from"@storybook/preview-web";var{Node:l}=f;function c({storyFn:o,kind:r,name:n,showMain:i,showError:s,forceRemount:p},e){let t=o();if(i(),typeof t=="string")e.innerHTML=t,a(e);else if(t instanceof l){if(e.firstChild===t&&p===!1)return;e.innerHTML="",e.appendChild(t),m()}else s({title:`Expecting an HTML snippet or DOM node from the story: "${n}" of "${r}".`,description:d`
|
|
2
|
-
Did you forget to return the HTML snippet from the story?
|
|
3
|
-
Use "() => <your snippet or node>" or when defining the story.
|
|
4
|
-
`})}export{c as a};
|