@storybook/web-components 7.0.0-alpha.13 → 7.0.0-alpha.18
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-ZUHVAFTB.mjs +5 -0
- package/dist/config.js +3 -3
- package/dist/config.mjs +1 -1
- package/dist/index.js +3 -3
- package/dist/index.mjs +1 -1
- package/package.json +11 -12
- package/LICENSE +0 -21
- package/dist/chunk-ZJUYDTMP.mjs +0 -5
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import O from"global";import A from"global";var{window:y}=A;y.STORYBOOK_ENV="web-components";import{start as b}from"@storybook/core-client";import u from"global";import{dedent as g}from"ts-dedent";import{render as C}from"lit-html";import{isTemplateResult as S}from"lit-html/directive-helpers.js";import{simulatePageLoad as d,simulateDOMContentLoaded as w}from"@storybook/preview-web";var{Node:T}=u;function c({storyFn:o,kind:i,name:a,showMain:s,showError:f,forceRemount:p},e){let t=o();if(s(),S(t)){(p||!e.querySelector('[id="root-inner"]'))&&(e.innerHTML='<div id="root-inner"></div>');let l=e.querySelector('[id="root-inner"]');C(t,l),d(e)}else if(typeof t=="string")e.innerHTML=t,d(e);else if(t instanceof T){if(e.firstChild===t&&!p)return;e.innerHTML="",e.appendChild(t),w()}else f({title:`Expecting an HTML snippet or DOM node from the story: "${a}" of "${i}".`,description:g`
|
|
2
|
+
Did you forget to return the HTML snippet from the story?
|
|
3
|
+
Use "() => <your snippet or node>" or when defining the story.
|
|
4
|
+
`})}var m="web-components",r=b(c),W=(o,i)=>r.clientApi.storiesOf(o,i).addParameters({framework:m}),N=(...o)=>r.configure(m,...o),P=r.clientApi.addDecorator,H=r.clientApi.addParameters,K=r.clientApi.clearDecorators,Y=r.clientApi.setAddon,B=r.forceReRender,U=r.clientApi.getStorybook,I=r.clientApi.raw;function V(o){if(!o)return!1;if(typeof o=="string")return!0;throw new Error('Provided component needs to be a string. e.g. component: "my-element"')}function q(o){if(!o)return!1;if(o.tags&&Array.isArray(o.tags)||o.modules&&Array.isArray(o.modules))return!0;throw new Error(`You need to setup valid meta data in your config.js via setCustomElements().
|
|
5
|
+
See the readme of addon-docs for web components for more details.`)}function $(o){window.__STORYBOOK_CUSTOM_ELEMENTS__=o}function J(o){window.__STORYBOOK_CUSTOM_ELEMENTS_MANIFEST__=o}function z(){return window.__STORYBOOK_CUSTOM_ELEMENTS__||window.__STORYBOOK_CUSTOM_ELEMENTS_MANIFEST__}var{window:_,EventSource:x}=O;module&&module.hot&&module.hot.decline&&(module.hot.decline(),new x("__webpack_hmr").addEventListener("message",function(a){try{let{action:s}=JSON.parse(a.data);s==="built"&&_.location.reload()}catch{}}));export{c as a,W as b,N as c,P as d,H as e,K as f,Y as g,B as h,U as i,I as j,V as k,q as l,$ as m,J as n,z as o};
|
package/dist/config.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var
|
|
1
|
+
var U=Object.create;var f=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var H=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var K=(e,r)=>{for(var t in r)f(e,t,{get:r[t],enumerable:!0})},w=(e,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of Y(r))!$.call(e,n)&&n!==t&&f(e,n,{get:()=>r[n],enumerable:!(o=V(r,n))||o.enumerable});return e};var g=(e,r,t)=>(t=e!=null?U(H(e)):{},w(r||!e||!e.__esModule?f(t,"default",{value:e,enumerable:!0}):t,e)),B=e=>w(f({},"__esModule",{value:!0}),e);var ne={};K(ne,{argTypesEnhancers:()=>W,decorators:()=>L,parameters:()=>oe,renderToDOM:()=>l});module.exports=B(ne);var y=require("@storybook/docs-tools");var A=require("@storybook/client-logger");var h=g(require("global"));var b=g(require("global")),{window:j}=b.default;j.STORYBOOK_ENV="web-components";var E=require("@storybook/core-client");var M=g(require("global")),D=require("ts-dedent"),_=require("lit-html"),O=require("lit-html/directive-helpers.js"),m=require("@storybook/preview-web"),{Node:q}=M.default;function l({storyFn:e,kind:r,name:t,showMain:o,showError:n,forceRemount:a},s){let i=e();if(o(),(0,O.isTemplateResult)(i)){(a||!s.querySelector('[id="root-inner"]'))&&(s.innerHTML='<div id="root-inner"></div>');let N=s.querySelector('[id="root-inner"]');(0,_.render)(i,N),(0,m.simulatePageLoad)(s)}else if(typeof i=="string")s.innerHTML=i,(0,m.simulatePageLoad)(s);else if(i instanceof q){if(s.firstChild===i&&!a)return;s.innerHTML="",s.appendChild(i),(0,m.simulateDOMContentLoaded)()}else n({title:`Expecting an HTML snippet or DOM node from the story: "${t}" of "${r}".`,description:D.dedent`
|
|
2
2
|
Did you forget to return the HTML snippet from the story?
|
|
3
3
|
Use "() => <your snippet or node>" or when defining the story.
|
|
4
|
-
`})}
|
|
5
|
-
See the readme of addon-docs for web components for more details.`)}
|
|
4
|
+
`})}var p=(0,E.start)(l);var pe=p.clientApi.addDecorator,de=p.clientApi.addParameters,me=p.clientApi.clearDecorators,ce=p.clientApi.setAddon,fe=p.forceReRender,le=p.clientApi.getStorybook,ue=p.clientApi.raw;function C(e){if(!e)return!1;if(typeof e=="string")return!0;throw new Error('Provided component needs to be a string. e.g. component: "my-element"')}function T(e){if(!e)return!1;if(e.tags&&Array.isArray(e.tags)||e.modules&&Array.isArray(e.modules))return!0;throw new Error(`You need to setup valid meta data in your config.js via setCustomElements().
|
|
5
|
+
See the readme of addon-docs for web components for more details.`)}function S(){return window.__STORYBOOK_CUSTOM_ELEMENTS__||window.__STORYBOOK_CUSTOM_ELEMENTS_MANIFEST__}var{window:J,EventSource:X}=h.default;module&&module.hot&&module.hot.decline&&(module.hot.decline(),new X("__webpack_hmr").addEventListener("message",function(t){try{let{action:o}=JSON.parse(t.data);o==="built"&&J.location.reload()}catch{}}));function k(e,r){var o,n;let t=r==="properties"?{name:((o=e.type)==null?void 0:o.text)||e.type}:{name:"void"};return{name:e.name,required:!1,description:e.description,type:t,table:{category:r,type:{summary:((n=e.type)==null?void 0:n.text)||e.type},defaultValue:{summary:e.default!==void 0?e.default:e.defaultValue}}}}function Z(e){let r=e.name.replace(/(-|_|:|\.|\s)+(.)?/g,(t,o,n)=>n?n.toUpperCase():"").replace(/^([A-Z])/,t=>t.toLowerCase());return r=`on${r.charAt(0).toUpperCase()+r.substr(1)}`,[{name:r,action:{name:e.name},table:{disable:!0}},k(e,"events")]}function d(e,r){return e&&e.filter(t=>t&&t.name).reduce((t,o)=>{if(o.kind==="method")return t;switch(r){case"events":Z(o).forEach(n=>{t[n.name]=n});break;default:t[o.name]=k(o,r);break}return t},{})}var z=(e,r)=>{if(!C(e)||!T(r))return null;let t=r.tags.find(o=>o.name.toUpperCase()===e.toUpperCase());return t||A.logger.warn(`Component not found in custom-elements.json: ${e}`),t},G=(e,r)=>{var o;if(!C(e)||!T(r))return null;let t;return(o=r==null?void 0:r.modules)==null||o.forEach(n=>{var a;(a=n==null?void 0:n.declarations)==null||a.forEach(s=>{s.tagName===e&&(t=s)})}),t||A.logger.warn(`Component not found in custom-elements.json: ${e}`),t},x=(e,r)=>(r==null?void 0:r.version)==="experimental"?z(e,r):G(e,r),Q=(e,r)=>{let t=x(e,r);return t&&{...d(t.attributes,"attributes"),...d(t.members,"properties"),...d(t.properties,"properties"),...d(t.events,"events"),...d(t.slots,"slots"),...d(t.cssProperties,"css custom properties"),...d(t.cssParts,"css shadow parts")}},R=e=>{let r=S();return Q(e,r)},I=e=>{let r=x(e,S());return r&&r.description};var v=require("lit-html"),u=require("@storybook/addons"),c=require("@storybook/docs-tools"),ee=/<!--\?lit\$[0-9]+\$-->|<!--\??-->/g;function re(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)===c.SourceType.DYNAMIC?!1:!t||(r==null?void 0:r.code)||(r==null?void 0:r.type)===c.SourceType.CODE}function te(e,r){let{transformSource:t}=r.parameters.docs??{};return typeof t!="function"?e:t(e,r)}function F(e,r){var n,a;let t=(a=(n=r==null?void 0:r.parameters.docs)==null?void 0:n.source)!=null&&a.excludeDecorators?r.originalStoryFn(r.args,r):e(),o;if((0,u.useEffect)(()=>{o&&u.addons.getChannel().emit(c.SNIPPET_RENDERED,r.id,o)}),!re(r)){let s=window.document.createElement("div");(0,v.render)(t,s),o=te(s.innerHTML.replace(ee,""),r)}return t}var L=[F],P={docs:{extractArgTypes:R,extractComponentDescription:I,inlineStories:!0,source:{type:y.SourceType.DYNAMIC,language:"html"}}},W=[y.enhanceArgTypes];var oe={framework:"web-components",...P};0&&(module.exports={argTypesEnhancers,decorators,parameters,renderToDOM});
|
package/dist/config.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as T,k as a,l as p,o as i}from"./chunk-ZUHVAFTB.mjs";import{SourceType as P,enhanceArgTypes as M}from"@storybook/docs-tools";import{logger as c}from"@storybook/client-logger";function u(t,e){let r=e==="properties"?{name:t.type?.text||t.type}:{name:"void"};return{name:t.name,required:!1,description:t.description,type:r,table:{category:e,type:{summary:t.type?.text||t.type},defaultValue:{summary:t.default!==void 0?t.default:t.defaultValue}}}}function S(t){let e=t.name.replace(/(-|_|:|\.|\s)+(.)?/g,(r,o,s)=>s?s.toUpperCase():"").replace(/^([A-Z])/,r=>r.toLowerCase());return e=`on${e.charAt(0).toUpperCase()+e.substr(1)}`,[{name:e,action:{name:t.name},table:{disable:!0}},u(t,"events")]}function n(t,e){return t&&t.filter(r=>r&&r.name).reduce((r,o)=>{if(o.kind==="method")return r;switch(e){case"events":S(o).forEach(s=>{r[s.name]=s});break;default:r[o.name]=u(o,e);break}return r},{})}var b=(t,e)=>{if(!a(t)||!p(e))return null;let r=e.tags.find(o=>o.name.toUpperCase()===t.toUpperCase());return r||c.warn(`Component not found in custom-elements.json: ${t}`),r},D=(t,e)=>{if(!a(t)||!p(e))return null;let r;return e?.modules?.forEach(o=>{o?.declarations?.forEach(s=>{s.tagName===t&&(r=s)})}),r||c.warn(`Component not found in custom-elements.json: ${t}`),r},f=(t,e)=>e?.version==="experimental"?b(t,e):D(t,e),E=(t,e)=>{let r=f(t,e);return r&&{...n(r.attributes,"attributes"),...n(r.members,"properties"),...n(r.properties,"properties"),...n(r.events,"events"),...n(r.slots,"slots"),...n(r.cssProperties,"css custom properties"),...n(r.cssParts,"css shadow parts")}},l=t=>{let e=i();return E(t,e)},g=t=>{let e=f(t,i());return e&&e.description};import{render as I}from"lit-html";import{addons as w,useEffect as x}from"@storybook/addons";import{SNIPPET_RENDERED as A,SourceType as y}from"@storybook/docs-tools";var k=/<!--\?lit\$[0-9]+\$-->|<!--\??-->/g;function h(t){let e=t?.parameters.docs?.source,r=t?.parameters.__isArgsStory;return e?.type===y.DYNAMIC?!1:!r||e?.code||e?.type===y.CODE}function F(t,e){let{transformSource:r}=e.parameters.docs??{};return typeof r!="function"?t:r(t,e)}function d(t,e){let r=e?.parameters.docs?.source?.excludeDecorators?e.originalStoryFn(e.args,e):t(),o;if(x(()=>{o&&w.getChannel().emit(A,e.id,o)}),!h(e)){let s=window.document.createElement("div");I(r,s),o=F(s.innerHTML.replace(k,""),e)}return r}var v=[d],C={docs:{extractArgTypes:l,extractComponentDescription:g,inlineStories:!0,source:{type:P.DYNAMIC,language:"html"}}},_=[M];var X={framework:"web-components",...C};export{_ as argTypesEnhancers,v as decorators,X as parameters,T as renderToDOM};
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var
|
|
1
|
+
var T=Object.create;var p=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,R=Object.prototype.hasOwnProperty;var h=(e,o)=>{for(var r in o)p(e,r,{get:o[r],enumerable:!0})},f=(e,o,r,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of M(o))!R.call(e,a)&&a!==r&&p(e,a,{get:()=>o[a],enumerable:!(i=b(o,a))||i.enumerable});return e};var c=(e,o,r)=>(r=e!=null?T(x(e)):{},f(o||!e||!e.__esModule?p(r,"default",{value:e,enumerable:!0}):r,e)),E=e=>f(p({},"__esModule",{value:!0}),e);var J={};h(J,{addDecorator:()=>N,addParameters:()=>P,clearDecorators:()=>F,configure:()=>v,forceReRender:()=>K,getCustomElements:()=>q,getStorybook:()=>W,isValidComponent:()=>B,isValidMetaData:()=>U,raw:()=>Y,setAddon:()=>H,setCustomElements:()=>I,setCustomElementsManifest:()=>V,storiesOf:()=>D});module.exports=E(J);var O=c(require("global"));var m=c(require("global")),{window:L}=m.default;L.STORYBOOK_ENV="web-components";var S=require("@storybook/core-client");var u=c(require("global")),y=require("ts-dedent"),A=require("lit-html"),C=require("lit-html/directive-helpers.js"),d=require("@storybook/preview-web"),{Node:k}=u.default;function w({storyFn:e,kind:o,name:r,showMain:i,showError:a,forceRemount:l},t){let s=e();if(i(),(0,C.isTemplateResult)(s)){(l||!t.querySelector('[id="root-inner"]'))&&(t.innerHTML='<div id="root-inner"></div>');let g=t.querySelector('[id="root-inner"]');(0,A.render)(s,g),(0,d.simulatePageLoad)(t)}else if(typeof s=="string")t.innerHTML=s,(0,d.simulatePageLoad)(t);else if(s instanceof k){if(t.firstChild===s&&!l)return;t.innerHTML="",t.appendChild(s),(0,d.simulateDOMContentLoaded)()}else a({title:`Expecting an HTML snippet or DOM node from the story: "${r}" of "${o}".`,description:y.dedent`
|
|
2
2
|
Did you forget to return the HTML snippet from the story?
|
|
3
3
|
Use "() => <your snippet or node>" or when defining the story.
|
|
4
|
-
`})}
|
|
5
|
-
See the readme of addon-docs for web components for more details.`)}
|
|
4
|
+
`})}var _="web-components",n=(0,S.start)(w),D=(e,o)=>n.clientApi.storiesOf(e,o).addParameters({framework:_}),v=(...e)=>n.configure(_,...e),N=n.clientApi.addDecorator,P=n.clientApi.addParameters,F=n.clientApi.clearDecorators,H=n.clientApi.setAddon,K=n.forceReRender,W=n.clientApi.getStorybook,Y=n.clientApi.raw;function B(e){if(!e)return!1;if(typeof e=="string")return!0;throw new Error('Provided component needs to be a string. e.g. component: "my-element"')}function U(e){if(!e)return!1;if(e.tags&&Array.isArray(e.tags)||e.modules&&Array.isArray(e.modules))return!0;throw new Error(`You need to setup valid meta data in your config.js via setCustomElements().
|
|
5
|
+
See the readme of addon-docs for web components for more details.`)}function I(e){window.__STORYBOOK_CUSTOM_ELEMENTS__=e}function V(e){window.__STORYBOOK_CUSTOM_ELEMENTS_MANIFEST__=e}function q(){return window.__STORYBOOK_CUSTOM_ELEMENTS__||window.__STORYBOOK_CUSTOM_ELEMENTS_MANIFEST__}var{window:$,EventSource:j}=O.default;module&&module.hot&&module.hot.decline&&(module.hot.decline(),new j("__webpack_hmr").addEventListener("message",function(r){try{let{action:i}=JSON.parse(r.data);i==="built"&&$.location.reload()}catch{}}));0&&(module.exports={addDecorator,addParameters,clearDecorators,configure,forceReRender,getCustomElements,getStorybook,isValidComponent,isValidMetaData,raw,setAddon,setCustomElements,setCustomElementsManifest,storiesOf});
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l,n as m,o as n}from"./chunk-ZUHVAFTB.mjs";export{c as addDecorator,d as addParameters,e as clearDecorators,b as configure,g as forceReRender,n as getCustomElements,h as getStorybook,j as isValidComponent,k as isValidMetaData,i as raw,f as setAddon,l as setCustomElements,m as setCustomElementsManifest,a as storiesOf};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/web-components",
|
|
3
|
-
"version": "7.0.0-alpha.
|
|
3
|
+
"version": "7.0.0-alpha.18",
|
|
4
4
|
"description": "Storybook web-components renderer",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lit-html",
|
|
@@ -49,17 +49,17 @@
|
|
|
49
49
|
],
|
|
50
50
|
"scripts": {
|
|
51
51
|
"check": "tsc --noEmit",
|
|
52
|
-
"prepare": "
|
|
52
|
+
"prepare": "../../../scripts/prepare/bundle.ts"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@storybook/addons": "7.0.0-alpha.
|
|
56
|
-
"@storybook/api": "7.0.0-alpha.
|
|
57
|
-
"@storybook/client-logger": "7.0.0-alpha.
|
|
58
|
-
"@storybook/core-client": "7.0.0-alpha.
|
|
59
|
-
"@storybook/csf": "0.0.2--canary.
|
|
60
|
-
"@storybook/docs-tools": "7.0.0-alpha.
|
|
61
|
-
"@storybook/preview-web": "7.0.0-alpha.
|
|
62
|
-
"@storybook/store": "7.0.0-alpha.
|
|
55
|
+
"@storybook/addons": "7.0.0-alpha.18",
|
|
56
|
+
"@storybook/api": "7.0.0-alpha.18",
|
|
57
|
+
"@storybook/client-logger": "7.0.0-alpha.18",
|
|
58
|
+
"@storybook/core-client": "7.0.0-alpha.18",
|
|
59
|
+
"@storybook/csf": "0.0.2--canary.0899bb7.0",
|
|
60
|
+
"@storybook/docs-tools": "7.0.0-alpha.18",
|
|
61
|
+
"@storybook/preview-web": "7.0.0-alpha.18",
|
|
62
|
+
"@storybook/store": "7.0.0-alpha.18",
|
|
63
63
|
"core-js": "^3.8.2",
|
|
64
64
|
"global": "^4.4.0",
|
|
65
65
|
"react": "16.14.0",
|
|
@@ -67,7 +67,6 @@
|
|
|
67
67
|
"ts-dedent": "^2.0.0"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@digitak/esrun": "^3.2.2",
|
|
71
70
|
"lit-html": "2.0.2",
|
|
72
71
|
"typescript": "~4.6.3"
|
|
73
72
|
},
|
|
@@ -87,5 +86,5 @@
|
|
|
87
86
|
],
|
|
88
87
|
"platform": "browser"
|
|
89
88
|
},
|
|
90
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "bd59f1eef0f644175abdb0d9873ed0553f431f53"
|
|
91
90
|
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2017 Kadira Inc. <hello@kadira.io>
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
|
13
|
-
all copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
-
THE SOFTWARE.
|
package/dist/chunk-ZJUYDTMP.mjs
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
var _=Object.defineProperty;var o=(e,i)=>_(e,"name",{value:i,configurable:!0});import A from"global";import O from"global";var{window:w}=O;w.STORYBOOK_ENV="web-components";import{start as h}from"@storybook/core-client";import T from"global";import{dedent as M}from"ts-dedent";import{render as S}from"lit-html";import{isTemplateResult as g}from"lit-html/directive-helpers.js";import{simulatePageLoad as c,simulateDOMContentLoaded as x}from"@storybook/preview-web";var{Node:y}=T;function f({storyFn:e,kind:i,name:d,showMain:a,showError:u,forceRemount:p},r){let n=e();if(a(),g(n)){(p||!r.querySelector('[id="root-inner"]'))&&(r.innerHTML='<div id="root-inner"></div>');let m=r.querySelector('[id="root-inner"]');S(n,m),c(r)}else if(typeof n=="string")r.innerHTML=n,c(r);else if(n instanceof y){if(r.firstChild===n&&!p)return;r.innerHTML="",r.appendChild(n),x()}else u({title:`Expecting an HTML snippet or DOM node from the story: "${d}" of "${i}".`,description:M`
|
|
2
|
-
Did you forget to return the HTML snippet from the story?
|
|
3
|
-
Use "() => <your snippet or node>" or when defining the story.
|
|
4
|
-
`})}o(f,"renderToDOM");var l="web-components",t=h(f),H=o((e,i)=>t.clientApi.storiesOf(e,i).addParameters({framework:l}),"storiesOf"),U=o((...e)=>t.configure(l,...e),"configure"),k=t.clientApi.addDecorator,F=t.clientApi.addParameters,V=t.clientApi.clearDecorators,q=t.clientApi.setAddon,I=t.forceReRender,W=t.clientApi.getStorybook,$=t.clientApi.raw;function J(e){if(!e)return!1;if(typeof e=="string")return!0;throw new Error('Provided component needs to be a string. e.g. component: "my-element"')}o(J,"isValidComponent");function z(e){if(!e)return!1;if(e.tags&&Array.isArray(e.tags)||e.modules&&Array.isArray(e.modules))return!0;throw new Error(`You need to setup valid meta data in your config.js via setCustomElements().
|
|
5
|
-
See the readme of addon-docs for web components for more details.`)}o(z,"isValidMetaData");function G(e){window.__STORYBOOK_CUSTOM_ELEMENTS__=e}o(G,"setCustomElements");function Q(e){window.__STORYBOOK_CUSTOM_ELEMENTS_MANIFEST__=e}o(Q,"setCustomElementsManifest");function X(){return window.__STORYBOOK_CUSTOM_ELEMENTS__||window.__STORYBOOK_CUSTOM_ELEMENTS_MANIFEST__}o(X,"getCustomElements");var{window:E,EventSource:b}=A;module&&module.hot&&module.hot.decline&&(module.hot.decline(),new b("__webpack_hmr").addEventListener("message",o(function(d){try{let{action:a}=JSON.parse(d.data);a==="built"&&E.location.reload()}catch{}},"fullPageReload")));export{o as a,f as b,H as c,U as d,k as e,F as f,V as g,q as h,I as i,W as j,$ as k,J as l,z as m,G as n,Q as o,X as p};
|