@storybook/web-components 7.0.0-alpha.0 → 7.0.0-alpha.11
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-ZJUYDTMP.mjs +5 -0
- package/dist/config.d.ts +32 -0
- package/dist/config.js +5 -0
- package/dist/config.mjs +1 -0
- package/dist/index.d.ts +58 -0
- package/dist/index.js +5 -0
- package/dist/index.mjs +1 -0
- package/dist/types-7ab3c005.d.ts +17 -0
- package/package.json +41 -15
- package/preview.js +1 -1
- package/dist/cjs/config.js +0 -51
- package/dist/cjs/customElements.js +0 -56
- package/dist/cjs/docs/config.js +0 -32
- package/dist/cjs/docs/custom-elements.js +0 -165
- package/dist/cjs/docs/prepareForInline.js +0 -96
- package/dist/cjs/docs/sourceDecorator.js +0 -65
- package/dist/cjs/index.js +0 -148
- package/dist/cjs/preview/config.js +0 -13
- package/dist/cjs/preview/globals.js +0 -8
- package/dist/cjs/preview/index.js +0 -50
- package/dist/cjs/preview/render.js +0 -73
- package/dist/cjs/preview/types-6-0.js +0 -5
- package/dist/cjs/preview/types-7-0.js +0 -5
- package/dist/cjs/preview/types.js +0 -5
- package/dist/esm/config.js +0 -6
- package/dist/esm/customElements.js +0 -42
- package/dist/esm/docs/config.js +0 -18
- package/dist/esm/docs/custom-elements.js +0 -117
- package/dist/esm/docs/prepareForInline.js +0 -24
- package/dist/esm/docs/sourceDecorator.js +0 -45
- package/dist/esm/index.js +0 -27
- package/dist/esm/preview/config.js +0 -1
- package/dist/esm/preview/globals.js +0 -5
- package/dist/esm/preview/index.js +0 -19
- package/dist/esm/preview/render.js +0 -55
- package/dist/esm/preview/types-6-0.js +0 -1
- package/dist/esm/preview/types-7-0.js +0 -1
- package/dist/esm/preview/types.js +0 -1
- package/dist/types/config.d.ts +0 -17
- package/dist/types/customElements.d.ts +0 -8
- package/dist/types/docs/config.d.ts +0 -18
- package/dist/types/docs/custom-elements.d.ts +0 -35
- package/dist/types/docs/prepareForInline.d.ts +0 -4
- package/dist/types/docs/sourceDecorator.d.ts +0 -3
- package/dist/types/index.d.ts +0 -3
- package/dist/types/preview/config.d.ts +0 -1
- package/dist/types/preview/globals.d.ts +0 -1
- package/dist/types/preview/index.d.ts +0 -24
- package/dist/types/preview/render.d.ts +0 -3
- package/dist/types/preview/types-6-0.d.ts +0 -34
- package/dist/types/preview/types-7-0.d.ts +0 -9
- package/dist/types/preview/types.d.ts +0 -16
|
@@ -0,0 +1,5 @@
|
|
|
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};
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as lib_docs_tools_dist_types from 'lib/docs-tools/dist/types';
|
|
2
|
+
import * as lib_api_dist_types from 'lib/api/dist/types';
|
|
3
|
+
import * as lib_addons_dist_types from 'lib/addons/dist/types';
|
|
4
|
+
import * as _storybook_csf from '@storybook/csf';
|
|
5
|
+
import { PartialStoryFn, StoryContext } from '@storybook/csf';
|
|
6
|
+
import { W as WebComponentsFramework } from './types-7ab3c005.js';
|
|
7
|
+
import { RenderContext } from '@storybook/store';
|
|
8
|
+
import 'lit-html';
|
|
9
|
+
|
|
10
|
+
declare function sourceDecorator(storyFn: PartialStoryFn<WebComponentsFramework>, context: StoryContext<WebComponentsFramework>): WebComponentsFramework['storyResult'];
|
|
11
|
+
|
|
12
|
+
declare const decorators: (typeof sourceDecorator)[];
|
|
13
|
+
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_types.Parameters)[];
|
|
14
|
+
|
|
15
|
+
declare function renderToDOM({ storyFn, kind, name, showMain, showError, forceRemount }: RenderContext<WebComponentsFramework>, domElement: Element): void;
|
|
16
|
+
|
|
17
|
+
declare const parameters: {
|
|
18
|
+
docs: {
|
|
19
|
+
extractArgTypes: (tagName: string) => {
|
|
20
|
+
[x: string]: lib_api_dist_types.ArgType;
|
|
21
|
+
};
|
|
22
|
+
extractComponentDescription: (tagName: string) => string;
|
|
23
|
+
inlineStories: boolean;
|
|
24
|
+
source: {
|
|
25
|
+
type: lib_docs_tools_dist_types.SourceType;
|
|
26
|
+
language: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
framework: "web-components";
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export { argTypesEnhancers, decorators, parameters, renderToDOM };
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var $=Object.create;var f=Object.defineProperty;var H=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var B=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty;var s=(e,r)=>f(e,"name",{value:r,configurable:!0});var j=(e,r)=>{for(var o in r)f(e,o,{get:r[o],enumerable:!0})},O=(e,r,o,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of K(r))!F.call(e,n)&&n!==o&&f(e,n,{get:()=>r[n],enumerable:!(t=H(r,n))||t.enumerable});return e};var g=(e,r,o)=>(o=e!=null?$(B(e)):{},O(r||!e||!e.__esModule?f(o,"default",{value:e,enumerable:!0}):o,e)),q=e=>O(f({},"__esModule",{value:!0}),e);var se={};j(se,{argTypesEnhancers:()=>Y,decorators:()=>I,parameters:()=>ne,renderToDOM:()=>m});module.exports=q(se);var T=require("@storybook/docs-tools");var M=require("@storybook/client-logger");var x=g(require("global"));var h=g(require("global")),{window:W}=h.default;W.STORYBOOK_ENV="web-components";var b=require("@storybook/core-client");var D=g(require("global")),C=require("ts-dedent"),A=require("lit-html"),E=require("lit-html/directive-helpers.js"),u=require("@storybook/preview-web"),{Node:J}=D.default;function m({storyFn:e,kind:r,name:o,showMain:t,showError:n,forceRemount:i},a){let p=e();if(t(),(0,E.isTemplateResult)(p)){(i||!a.querySelector('[id="root-inner"]'))&&(a.innerHTML='<div id="root-inner"></div>');let P=a.querySelector('[id="root-inner"]');(0,A.render)(p,P),(0,u.simulatePageLoad)(a)}else if(typeof p=="string")a.innerHTML=p,(0,u.simulatePageLoad)(a);else if(p instanceof J){if(a.firstChild===p&&!i)return;a.innerHTML="",a.appendChild(p),(0,u.simulateDOMContentLoaded)()}else n({title:`Expecting an HTML snippet or DOM node from the story: "${o}" of "${r}".`,description:C.dedent`
|
|
2
|
+
Did you forget to return the HTML snippet from the story?
|
|
3
|
+
Use "() => <your snippet or node>" or when defining the story.
|
|
4
|
+
`})}s(m,"renderToDOM");var c=(0,b.start)(m);var ce=c.clientApi.addDecorator,de=c.clientApi.addParameters,fe=c.clientApi.clearDecorators,ue=c.clientApi.setAddon,le=c.forceReRender,me=c.clientApi.getStorybook,ye=c.clientApi.raw;function w(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"')}s(w,"isValidComponent");function S(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.`)}s(S,"isValidMetaData");function _(){return window.__STORYBOOK_CUSTOM_ELEMENTS__||window.__STORYBOOK_CUSTOM_ELEMENTS_MANIFEST__}s(_,"getCustomElements");var{window:X,EventSource:Z}=x.default;module&&module.hot&&module.hot.decline&&(module.hot.decline(),new Z("__webpack_hmr").addEventListener("message",s(function(o){try{let{action:t}=JSON.parse(o.data);t==="built"&&X.location.reload()}catch{}},"fullPageReload")));function R(e,r){var t,n;let o=r==="properties"?{name:((t=e.type)==null?void 0:t.text)||e.type}:{name:"void"};return{name:e.name,required:!1,description:e.description,type:o,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}}}}s(R,"mapItem");function z(e){let r=e.name.replace(/(-|_|:|\.|\s)+(.)?/g,(o,t,n)=>n?n.toUpperCase():"").replace(/^([A-Z])/,o=>o.toLowerCase());return r=`on${r.charAt(0).toUpperCase()+r.substr(1)}`,[{name:r,action:{name:e.name},table:{disable:!0}},R(e,"events")]}s(z,"mapEvent");function d(e,r){return e&&e.filter(o=>o&&o.name).reduce((o,t)=>{if(t.kind==="method")return o;switch(r){case"events":z(t).forEach(n=>{o[n.name]=n});break;default:o[t.name]=R(t,r);break}return o},{})}s(d,"mapData");var G=s((e,r)=>{if(!w(e)||!S(r))return null;let o=r.tags.find(t=>t.name.toUpperCase()===e.toUpperCase());return o||M.logger.warn(`Component not found in custom-elements.json: ${e}`),o},"getMetaDataExperimental"),Q=s((e,r)=>{var t;if(!w(e)||!S(r))return null;let o;return(t=r==null?void 0:r.modules)==null||t.forEach(n=>{var i;(i=n==null?void 0:n.declarations)==null||i.forEach(a=>{a.tagName===e&&(o=a)})}),o||M.logger.warn(`Component not found in custom-elements.json: ${e}`),o},"getMetaDataV1"),v=s((e,r)=>(r==null?void 0:r.version)==="experimental"?G(e,r):Q(e,r),"getMetaData"),ee=s((e,r)=>{let o=v(e,r);return o&&{...d(o.attributes,"attributes"),...d(o.members,"properties"),...d(o.properties,"properties"),...d(o.events,"events"),...d(o.slots,"slots"),...d(o.cssProperties,"css custom properties"),...d(o.cssParts,"css shadow parts")}},"extractArgTypesFromElements"),L=s(e=>{let r=_();return ee(e,r)},"extractArgTypes"),N=s(e=>{let r=v(e,_());return r&&r.description},"extractComponentDescription");var k=require("lit-html"),y=require("@storybook/addons"),l=require("@storybook/docs-tools"),re=/<!--\?lit\$[0-9]+\$-->|<!--\??-->/g;function oe(e){var t;let r=(t=e==null?void 0:e.parameters.docs)==null?void 0:t.source,o=e==null?void 0:e.parameters.__isArgsStory;return(r==null?void 0:r.type)===l.SourceType.DYNAMIC?!1:!o||(r==null?void 0:r.code)||(r==null?void 0:r.type)===l.SourceType.CODE}s(oe,"skipSourceRender");function te(e,r){let{transformSource:o}=r.parameters.docs??{};return typeof o!="function"?e:o(e,r)}s(te,"applyTransformSource");function U(e,r){var n,i;let o=(i=(n=r==null?void 0:r.parameters.docs)==null?void 0:n.source)!=null&&i.excludeDecorators?r.originalStoryFn(r.args,r):e(),t;if((0,y.useEffect)(()=>{t&&y.addons.getChannel().emit(l.SNIPPET_RENDERED,r.id,t)}),!oe(r)){let a=window.document.createElement("div");(0,k.render)(o,a),t=te(a.innerHTML.replace(re,""),r)}return o}s(U,"sourceDecorator");var I=[U],V={docs:{extractArgTypes:L,extractComponentDescription:N,inlineStories:!0,source:{type:T.SourceType.DYNAMIC,language:"html"}}},Y=[T.enhanceArgTypes];var ne={framework:"web-components",...V};0&&(module.exports={argTypesEnhancers,decorators,parameters,renderToDOM});
|
package/dist/config.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as o,b as g,l as p,m as c,p as u}from"./chunk-ZJUYDTMP.mjs";import{SourceType as I,enhanceArgTypes as k}from"@storybook/docs-tools";import{logger as m}from"@storybook/client-logger";function f(r,e){let t=e==="properties"?{name:r.type?.text||r.type}:{name:"void"};return{name:r.name,required:!1,description:r.description,type:t,table:{category:e,type:{summary:r.type?.text||r.type},defaultValue:{summary:r.default!==void 0?r.default:r.defaultValue}}}}o(f,"mapItem");function S(r){let e=r.name.replace(/(-|_|:|\.|\s)+(.)?/g,(t,n,s)=>s?s.toUpperCase():"").replace(/^([A-Z])/,t=>t.toLowerCase());return e=`on${e.charAt(0).toUpperCase()+e.substr(1)}`,[{name:e,action:{name:r.name},table:{disable:!0}},f(r,"events")]}o(S,"mapEvent");function a(r,e){return r&&r.filter(t=>t&&t.name).reduce((t,n)=>{if(n.kind==="method")return t;switch(e){case"events":S(n).forEach(s=>{t[s.name]=s});break;default:t[n.name]=f(n,e);break}return t},{})}o(a,"mapData");var T=o((r,e)=>{if(!p(r)||!c(e))return null;let t=e.tags.find(n=>n.name.toUpperCase()===r.toUpperCase());return t||m.warn(`Component not found in custom-elements.json: ${r}`),t},"getMetaDataExperimental"),h=o((r,e)=>{if(!p(r)||!c(e))return null;let t;return e?.modules?.forEach(n=>{n?.declarations?.forEach(s=>{s.tagName===r&&(t=s)})}),t||m.warn(`Component not found in custom-elements.json: ${r}`),t},"getMetaDataV1"),l=o((r,e)=>e?.version==="experimental"?T(r,e):h(r,e),"getMetaData"),x=o((r,e)=>{let t=l(r,e);return t&&{...a(t.attributes,"attributes"),...a(t.members,"properties"),...a(t.properties,"properties"),...a(t.events,"events"),...a(t.slots,"slots"),...a(t.cssProperties,"css custom properties"),...a(t.cssParts,"css shadow parts")}},"extractArgTypesFromElements"),d=o(r=>{let e=u();return x(r,e)},"extractArgTypes"),y=o(r=>{let e=l(r,u());return e&&e.description},"extractComponentDescription");import{render as b}from"lit-html";import{addons as A,useEffect as M}from"@storybook/addons";import{SNIPPET_RENDERED as w,SourceType as D}from"@storybook/docs-tools";var v=/<!--\?lit\$[0-9]+\$-->|<!--\??-->/g;function _(r){let e=r?.parameters.docs?.source,t=r?.parameters.__isArgsStory;return e?.type===D.DYNAMIC?!1:!t||e?.code||e?.type===D.CODE}o(_,"skipSourceRender");function P(r,e){let{transformSource:t}=e.parameters.docs??{};return typeof t!="function"?r:t(r,e)}o(P,"applyTransformSource");function E(r,e){let t=e?.parameters.docs?.source?.excludeDecorators?e.originalStoryFn(e.args,e):r(),n;if(M(()=>{n&&A.getChannel().emit(w,e.id,n)}),!_(e)){let s=window.document.createElement("div");b(t,s),n=P(s.innerHTML.replace(v,""),e)}return t}o(E,"sourceDecorator");var V=[E],C={docs:{extractArgTypes:d,extractComponentDescription:y,inlineStories:!0,source:{type:I.DYNAMIC,language:"html"}}},$=[k];var z={framework:"web-components",...C};export{$ as argTypesEnhancers,V as decorators,z as parameters,g as renderToDOM};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Args, ComponentAnnotations, AnnotatedStoryFn, StoryAnnotations } from '@storybook/csf';
|
|
2
|
+
import { W as WebComponentsFramework, I as IStorybookSection } from './types-7ab3c005.js';
|
|
3
|
+
import { ClientStoryApi, Loadable } from '@storybook/addons';
|
|
4
|
+
import 'lit-html';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Metadata to configure the stories for a component.
|
|
8
|
+
*
|
|
9
|
+
* @see [Default export](https://storybook.js.org/docs/formats/component-story-format/#default-export)
|
|
10
|
+
*/
|
|
11
|
+
declare type Meta<TArgs = Args> = ComponentAnnotations<WebComponentsFramework, TArgs>;
|
|
12
|
+
/**
|
|
13
|
+
* Story function that represents a CSFv2 component example.
|
|
14
|
+
*
|
|
15
|
+
* @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
|
|
16
|
+
*/
|
|
17
|
+
declare type StoryFn<TArgs = Args> = AnnotatedStoryFn<WebComponentsFramework, TArgs>;
|
|
18
|
+
/**
|
|
19
|
+
* Story function that represents a CSFv3 component example.
|
|
20
|
+
*
|
|
21
|
+
* @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
|
|
22
|
+
*/
|
|
23
|
+
declare type StoryObj<TArgs = Args> = StoryAnnotations<WebComponentsFramework, TArgs>;
|
|
24
|
+
/**
|
|
25
|
+
* Story function that represents a CSFv3 component example.
|
|
26
|
+
*
|
|
27
|
+
* @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
|
|
28
|
+
*/
|
|
29
|
+
declare type Story<TArgs = Args> = StoryObj<TArgs>;
|
|
30
|
+
|
|
31
|
+
interface ClientApi extends ClientStoryApi<WebComponentsFramework['storyResult']> {
|
|
32
|
+
setAddon(addon: any): void;
|
|
33
|
+
configure(loader: Loadable, module: NodeModule): void;
|
|
34
|
+
getStorybook(): IStorybookSection[];
|
|
35
|
+
clearDecorators(): void;
|
|
36
|
+
forceReRender(): void;
|
|
37
|
+
raw: () => any;
|
|
38
|
+
}
|
|
39
|
+
declare const storiesOf: ClientApi['storiesOf'];
|
|
40
|
+
declare const configure: ClientApi['configure'];
|
|
41
|
+
declare const addDecorator: ClientApi['addDecorator'];
|
|
42
|
+
declare const addParameters: ClientApi['addParameters'];
|
|
43
|
+
declare const clearDecorators: ClientApi['clearDecorators'];
|
|
44
|
+
declare const setAddon: ClientApi['setAddon'];
|
|
45
|
+
declare const forceReRender: ClientApi['forceReRender'];
|
|
46
|
+
declare const getStorybook: ClientApi['getStorybook'];
|
|
47
|
+
declare const raw: ClientApi['raw'];
|
|
48
|
+
|
|
49
|
+
declare function isValidComponent(tagName: string): boolean;
|
|
50
|
+
declare function isValidMetaData(customElements: any): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* @param customElements any for now as spec is not super stable yet
|
|
53
|
+
*/
|
|
54
|
+
declare function setCustomElements(customElements: any): void;
|
|
55
|
+
declare function setCustomElementsManifest(customElements: any): void;
|
|
56
|
+
declare function getCustomElements(): any;
|
|
57
|
+
|
|
58
|
+
export { Meta, Story, StoryFn, StoryObj, addDecorator, addParameters, clearDecorators, configure, forceReRender, getCustomElements, getStorybook, isValidComponent, isValidMetaData, raw, setAddon, setCustomElements, setCustomElementsManifest, storiesOf };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var h=Object.create;var p=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty;var r=(e,o)=>p(e,"name",{value:o,configurable:!0});var L=(e,o)=>{for(var t in o)p(e,t,{get:o[t],enumerable:!0})},u=(e,o,t,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of E(o))!C.call(e,a)&&a!==t&&p(e,a,{get:()=>o[a],enumerable:!(s=A(o,a))||s.enumerable});return e};var f=(e,o,t)=>(t=e!=null?h(b(e)):{},u(o||!e||!e.__esModule?p(t,"default",{value:e,enumerable:!0}):t,e)),R=e=>u(p({},"__esModule",{value:!0}),e);var z={};L(z,{addDecorator:()=>P,addParameters:()=>Y,clearDecorators:()=>B,configure:()=>K,forceReRender:()=>U,getCustomElements:()=>$,getStorybook:()=>k,isValidComponent:()=>V,isValidMetaData:()=>q,raw:()=>F,setAddon:()=>H,setCustomElements:()=>I,setCustomElementsManifest:()=>W,storiesOf:()=>v});module.exports=R(z);var x=f(require("global"));var m=f(require("global")),{window:D}=m.default;D.STORYBOOK_ENV="web-components";var S=require("@storybook/core-client");var _=f(require("global")),O=require("ts-dedent"),w=require("lit-html"),T=require("lit-html/directive-helpers.js"),c=require("@storybook/preview-web"),{Node:N}=_.default;function M({storyFn:e,kind:o,name:t,showMain:s,showError:a,forceRemount:l},n){let d=e();if(s(),(0,T.isTemplateResult)(d)){(l||!n.querySelector('[id="root-inner"]'))&&(n.innerHTML='<div id="root-inner"></div>');let y=n.querySelector('[id="root-inner"]');(0,w.render)(d,y),(0,c.simulatePageLoad)(n)}else if(typeof d=="string")n.innerHTML=d,(0,c.simulatePageLoad)(n);else if(d instanceof N){if(n.firstChild===d&&!l)return;n.innerHTML="",n.appendChild(d),(0,c.simulateDOMContentLoaded)()}else a({title:`Expecting an HTML snippet or DOM node from the story: "${t}" of "${o}".`,description:O.dedent`
|
|
2
|
+
Did you forget to return the HTML snippet from the story?
|
|
3
|
+
Use "() => <your snippet or node>" or when defining the story.
|
|
4
|
+
`})}r(M,"renderToDOM");var g="web-components",i=(0,S.start)(M),v=r((e,o)=>i.clientApi.storiesOf(e,o).addParameters({framework:g}),"storiesOf"),K=r((...e)=>i.configure(g,...e),"configure"),P=i.clientApi.addDecorator,Y=i.clientApi.addParameters,B=i.clientApi.clearDecorators,H=i.clientApi.setAddon,U=i.forceReRender,k=i.clientApi.getStorybook,F=i.clientApi.raw;function V(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"')}r(V,"isValidComponent");function q(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.`)}r(q,"isValidMetaData");function I(e){window.__STORYBOOK_CUSTOM_ELEMENTS__=e}r(I,"setCustomElements");function W(e){window.__STORYBOOK_CUSTOM_ELEMENTS_MANIFEST__=e}r(W,"setCustomElementsManifest");function $(){return window.__STORYBOOK_CUSTOM_ELEMENTS__||window.__STORYBOOK_CUSTOM_ELEMENTS_MANIFEST__}r($,"getCustomElements");var{window:j,EventSource:J}=x.default;module&&module.hot&&module.hot.decline&&(module.hot.decline(),new J("__webpack_hmr").addEventListener("message",r(function(t){try{let{action:s}=JSON.parse(t.data);s==="built"&&j.location.reload()}catch{}},"fullPageReload")));0&&(module.exports={addDecorator,addParameters,clearDecorators,configure,forceReRender,getCustomElements,getStorybook,isValidComponent,isValidMetaData,raw,setAddon,setCustomElements,setCustomElementsManifest,storiesOf});
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as a,d as b,e as c,f as d,g as e,h as f,i as g,j as h,k as i,l as j,m as k,n as l,o as m,p as n}from"./chunk-ZJUYDTMP.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};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TemplateResult, SVGTemplateResult } from 'lit-html';
|
|
2
|
+
|
|
3
|
+
declare type StoryFnHtmlReturnType = string | Node | TemplateResult | SVGTemplateResult;
|
|
4
|
+
declare type WebComponentsFramework = {
|
|
5
|
+
component: string;
|
|
6
|
+
storyResult: StoryFnHtmlReturnType;
|
|
7
|
+
};
|
|
8
|
+
interface IStorybookStory {
|
|
9
|
+
name: string;
|
|
10
|
+
render: (context: any) => any;
|
|
11
|
+
}
|
|
12
|
+
interface IStorybookSection {
|
|
13
|
+
kind: string;
|
|
14
|
+
stories: IStorybookStory[];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { IStorybookSection as I, WebComponentsFramework as W };
|
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.11",
|
|
4
4
|
"description": "Storybook web-components renderer",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lit-html",
|
|
@@ -21,9 +21,26 @@
|
|
|
21
21
|
"url": "https://opencollective.com/storybook"
|
|
22
22
|
},
|
|
23
23
|
"license": "MIT",
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"require": "./dist/index.js",
|
|
27
|
+
"import": "./dist/index.mjs",
|
|
28
|
+
"types": "./dist/index.d.ts"
|
|
29
|
+
},
|
|
30
|
+
"./preview": {
|
|
31
|
+
"require": "./dist/config.js",
|
|
32
|
+
"import": "./dist/config.mjs",
|
|
33
|
+
"types": "./dist/config.d.ts"
|
|
34
|
+
},
|
|
35
|
+
"./package.json": {
|
|
36
|
+
"require": "./package.json",
|
|
37
|
+
"import": "./package.json",
|
|
38
|
+
"types": "./package.json"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"main": "dist/index.js",
|
|
42
|
+
"module": "dist/index.mjs",
|
|
43
|
+
"types": "dist/index.d.ts",
|
|
27
44
|
"files": [
|
|
28
45
|
"dist/**/*",
|
|
29
46
|
"README.md",
|
|
@@ -31,26 +48,28 @@
|
|
|
31
48
|
"*.d.ts"
|
|
32
49
|
],
|
|
33
50
|
"scripts": {
|
|
34
|
-
"
|
|
51
|
+
"check": "tsc --noEmit",
|
|
52
|
+
"prepare": "esrun ../../scripts/prepare/bundle.ts"
|
|
35
53
|
},
|
|
36
54
|
"dependencies": {
|
|
37
|
-
"@storybook/addons": "7.0.0-alpha.
|
|
38
|
-
"@storybook/api": "7.0.0-alpha.
|
|
39
|
-
"@storybook/client-logger": "7.0.0-alpha.
|
|
40
|
-
"@storybook/core-client": "7.0.0-alpha.
|
|
55
|
+
"@storybook/addons": "7.0.0-alpha.11",
|
|
56
|
+
"@storybook/api": "7.0.0-alpha.11",
|
|
57
|
+
"@storybook/client-logger": "7.0.0-alpha.11",
|
|
58
|
+
"@storybook/core-client": "7.0.0-alpha.11",
|
|
41
59
|
"@storybook/csf": "0.0.2--canary.4566f4d.1",
|
|
42
|
-
"@storybook/docs-tools": "7.0.0-alpha.
|
|
43
|
-
"@storybook/preview-web": "7.0.0-alpha.
|
|
44
|
-
"@storybook/store": "7.0.0-alpha.
|
|
60
|
+
"@storybook/docs-tools": "7.0.0-alpha.11",
|
|
61
|
+
"@storybook/preview-web": "7.0.0-alpha.11",
|
|
62
|
+
"@storybook/store": "7.0.0-alpha.11",
|
|
45
63
|
"core-js": "^3.8.2",
|
|
46
64
|
"global": "^4.4.0",
|
|
47
65
|
"react": "16.14.0",
|
|
48
66
|
"react-dom": "16.14.0",
|
|
49
|
-
"regenerator-runtime": "^0.13.7",
|
|
50
67
|
"ts-dedent": "^2.0.0"
|
|
51
68
|
},
|
|
52
69
|
"devDependencies": {
|
|
53
|
-
"
|
|
70
|
+
"@digitak/esrun": "^3.2.2",
|
|
71
|
+
"lit-html": "2.0.2",
|
|
72
|
+
"typescript": "~4.6.3"
|
|
54
73
|
},
|
|
55
74
|
"peerDependencies": {
|
|
56
75
|
"lit-html": "^1.4.1 || ^2.0.0"
|
|
@@ -61,5 +80,12 @@
|
|
|
61
80
|
"publishConfig": {
|
|
62
81
|
"access": "public"
|
|
63
82
|
},
|
|
64
|
-
"
|
|
83
|
+
"bundler": {
|
|
84
|
+
"entries": [
|
|
85
|
+
"./src/index.ts",
|
|
86
|
+
"./src/config.ts"
|
|
87
|
+
],
|
|
88
|
+
"platform": "browser"
|
|
89
|
+
},
|
|
90
|
+
"gitHead": "688d338903e84a7e83cb104472e868e734399f65"
|
|
65
91
|
}
|
package/preview.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './dist/
|
|
1
|
+
export * from './dist/config';
|
package/dist/cjs/config.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
require("core-js/modules/es.object.to-string.js");
|
|
4
|
-
|
|
5
|
-
require("core-js/modules/web.dom-collections.for-each.js");
|
|
6
|
-
|
|
7
|
-
require("core-js/modules/es.object.keys.js");
|
|
8
|
-
|
|
9
|
-
Object.defineProperty(exports, "__esModule", {
|
|
10
|
-
value: true
|
|
11
|
-
});
|
|
12
|
-
var _exportNames = {
|
|
13
|
-
parameters: true,
|
|
14
|
-
decorators: true,
|
|
15
|
-
argTypesEnhancers: true
|
|
16
|
-
};
|
|
17
|
-
Object.defineProperty(exports, "argTypesEnhancers", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function get() {
|
|
20
|
-
return _config.argTypesEnhancers;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
Object.defineProperty(exports, "decorators", {
|
|
24
|
-
enumerable: true,
|
|
25
|
-
get: function get() {
|
|
26
|
-
return _config.decorators;
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
exports.parameters = void 0;
|
|
30
|
-
|
|
31
|
-
require("core-js/modules/es.object.assign.js");
|
|
32
|
-
|
|
33
|
-
var _config = require("./docs/config");
|
|
34
|
-
|
|
35
|
-
var _config2 = require("./preview/config");
|
|
36
|
-
|
|
37
|
-
Object.keys(_config2).forEach(function (key) {
|
|
38
|
-
if (key === "default" || key === "__esModule") return;
|
|
39
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
40
|
-
if (key in exports && exports[key] === _config2[key]) return;
|
|
41
|
-
Object.defineProperty(exports, key, {
|
|
42
|
-
enumerable: true,
|
|
43
|
-
get: function get() {
|
|
44
|
-
return _config2[key];
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
var parameters = Object.assign({
|
|
49
|
-
framework: 'web-components'
|
|
50
|
-
}, _config.parameters);
|
|
51
|
-
exports.parameters = parameters;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getCustomElements = getCustomElements;
|
|
7
|
-
exports.isValidComponent = isValidComponent;
|
|
8
|
-
exports.isValidMetaData = isValidMetaData;
|
|
9
|
-
exports.setCustomElements = setCustomElements;
|
|
10
|
-
exports.setCustomElementsManifest = setCustomElementsManifest;
|
|
11
|
-
|
|
12
|
-
/* eslint-disable no-underscore-dangle */
|
|
13
|
-
|
|
14
|
-
/* global window */
|
|
15
|
-
function isValidComponent(tagName) {
|
|
16
|
-
if (!tagName) {
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
if (typeof tagName === 'string') {
|
|
21
|
-
return true;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
throw new Error('Provided component needs to be a string. e.g. component: "my-element"');
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function isValidMetaData(customElements) {
|
|
28
|
-
if (!customElements) {
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
if (customElements.tags && Array.isArray(customElements.tags) || customElements.modules && Array.isArray(customElements.modules)) {
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
throw new Error("You need to setup valid meta data in your config.js via setCustomElements().\n See the readme of addon-docs for web components for more details.");
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* @param customElements any for now as spec is not super stable yet
|
|
40
|
-
*/
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
function setCustomElements(customElements) {
|
|
44
|
-
// @ts-ignore
|
|
45
|
-
window.__STORYBOOK_CUSTOM_ELEMENTS__ = customElements;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function setCustomElementsManifest(customElements) {
|
|
49
|
-
// @ts-ignore
|
|
50
|
-
window.__STORYBOOK_CUSTOM_ELEMENTS_MANIFEST__ = customElements;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function getCustomElements() {
|
|
54
|
-
// @ts-ignore
|
|
55
|
-
return window.__STORYBOOK_CUSTOM_ELEMENTS__ || window.__STORYBOOK_CUSTOM_ELEMENTS_MANIFEST__;
|
|
56
|
-
}
|
package/dist/cjs/docs/config.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.parameters = exports.decorators = exports.argTypesEnhancers = void 0;
|
|
7
|
-
|
|
8
|
-
var _docsTools = require("@storybook/docs-tools");
|
|
9
|
-
|
|
10
|
-
var _customElements = require("./custom-elements");
|
|
11
|
-
|
|
12
|
-
var _sourceDecorator = require("./sourceDecorator");
|
|
13
|
-
|
|
14
|
-
var _prepareForInline = require("./prepareForInline");
|
|
15
|
-
|
|
16
|
-
var decorators = [_sourceDecorator.sourceDecorator];
|
|
17
|
-
exports.decorators = decorators;
|
|
18
|
-
var parameters = {
|
|
19
|
-
docs: {
|
|
20
|
-
extractArgTypes: _customElements.extractArgTypes,
|
|
21
|
-
extractComponentDescription: _customElements.extractComponentDescription,
|
|
22
|
-
inlineStories: true,
|
|
23
|
-
prepareForInline: _prepareForInline.prepareForInline,
|
|
24
|
-
source: {
|
|
25
|
-
type: _docsTools.SourceType.DYNAMIC,
|
|
26
|
-
language: 'html'
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
exports.parameters = parameters;
|
|
31
|
-
var argTypesEnhancers = [_docsTools.enhanceArgTypes];
|
|
32
|
-
exports.argTypesEnhancers = argTypesEnhancers;
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.extractComponentDescription = exports.extractArgTypesFromElements = exports.extractArgTypes = void 0;
|
|
7
|
-
|
|
8
|
-
require("core-js/modules/es.function.name.js");
|
|
9
|
-
|
|
10
|
-
require("core-js/modules/es.symbol.js");
|
|
11
|
-
|
|
12
|
-
require("core-js/modules/es.symbol.description.js");
|
|
13
|
-
|
|
14
|
-
require("core-js/modules/es.regexp.exec.js");
|
|
15
|
-
|
|
16
|
-
require("core-js/modules/es.string.replace.js");
|
|
17
|
-
|
|
18
|
-
require("core-js/modules/es.object.to-string.js");
|
|
19
|
-
|
|
20
|
-
require("core-js/modules/es.array.filter.js");
|
|
21
|
-
|
|
22
|
-
require("core-js/modules/web.dom-collections.for-each.js");
|
|
23
|
-
|
|
24
|
-
require("core-js/modules/es.array.find.js");
|
|
25
|
-
|
|
26
|
-
require("core-js/modules/es.object.assign.js");
|
|
27
|
-
|
|
28
|
-
var _clientLogger = require("@storybook/client-logger");
|
|
29
|
-
|
|
30
|
-
var _ = require("..");
|
|
31
|
-
|
|
32
|
-
function mapItem(item, category) {
|
|
33
|
-
var _item$type, _item$type2;
|
|
34
|
-
|
|
35
|
-
var type = category === 'properties' ? {
|
|
36
|
-
name: ((_item$type = item.type) === null || _item$type === void 0 ? void 0 : _item$type.text) || item.type
|
|
37
|
-
} : {
|
|
38
|
-
name: 'void'
|
|
39
|
-
};
|
|
40
|
-
return {
|
|
41
|
-
name: item.name,
|
|
42
|
-
required: false,
|
|
43
|
-
description: item.description,
|
|
44
|
-
type: type,
|
|
45
|
-
table: {
|
|
46
|
-
category: category,
|
|
47
|
-
type: {
|
|
48
|
-
summary: ((_item$type2 = item.type) === null || _item$type2 === void 0 ? void 0 : _item$type2.text) || item.type
|
|
49
|
-
},
|
|
50
|
-
defaultValue: {
|
|
51
|
-
summary: item.default !== undefined ? item.default : item.defaultValue
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function mapEvent(item) {
|
|
58
|
-
var name = item.name.replace(/(-|_|:|\.|\s)+(.)?/g, function (_match, _separator, chr) {
|
|
59
|
-
return chr ? chr.toUpperCase() : '';
|
|
60
|
-
}).replace(/^([A-Z])/, function (match) {
|
|
61
|
-
return match.toLowerCase();
|
|
62
|
-
});
|
|
63
|
-
name = "on".concat(name.charAt(0).toUpperCase() + name.substr(1));
|
|
64
|
-
return [{
|
|
65
|
-
name: name,
|
|
66
|
-
action: {
|
|
67
|
-
name: item.name
|
|
68
|
-
},
|
|
69
|
-
table: {
|
|
70
|
-
disable: true
|
|
71
|
-
}
|
|
72
|
-
}, mapItem(item, 'events')];
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
function mapData(data, category) {
|
|
76
|
-
return data && data.filter(function (item) {
|
|
77
|
-
return item && item.name;
|
|
78
|
-
}).reduce(function (acc, item) {
|
|
79
|
-
if (item.kind === 'method') return acc;
|
|
80
|
-
|
|
81
|
-
switch (category) {
|
|
82
|
-
case 'events':
|
|
83
|
-
mapEvent(item).forEach(function (argType) {
|
|
84
|
-
acc[argType.name] = argType;
|
|
85
|
-
});
|
|
86
|
-
break;
|
|
87
|
-
|
|
88
|
-
default:
|
|
89
|
-
acc[item.name] = mapItem(item, category);
|
|
90
|
-
break;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
return acc;
|
|
94
|
-
}, {});
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
var getMetaDataExperimental = function getMetaDataExperimental(tagName, customElements) {
|
|
98
|
-
if (!(0, _.isValidComponent)(tagName) || !(0, _.isValidMetaData)(customElements)) {
|
|
99
|
-
return null;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
var metaData = customElements.tags.find(function (tag) {
|
|
103
|
-
return tag.name.toUpperCase() === tagName.toUpperCase();
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
if (!metaData) {
|
|
107
|
-
_clientLogger.logger.warn("Component not found in custom-elements.json: ".concat(tagName));
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
return metaData;
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
var getMetaDataV1 = function getMetaDataV1(tagName, customElements) {
|
|
114
|
-
var _customElements$modul;
|
|
115
|
-
|
|
116
|
-
if (!(0, _.isValidComponent)(tagName) || !(0, _.isValidMetaData)(customElements)) {
|
|
117
|
-
return null;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
var metadata;
|
|
121
|
-
customElements === null || customElements === void 0 ? void 0 : (_customElements$modul = customElements.modules) === null || _customElements$modul === void 0 ? void 0 : _customElements$modul.forEach(function (_module) {
|
|
122
|
-
var _module$declarations;
|
|
123
|
-
|
|
124
|
-
_module === null || _module === void 0 ? void 0 : (_module$declarations = _module.declarations) === null || _module$declarations === void 0 ? void 0 : _module$declarations.forEach(function (declaration) {
|
|
125
|
-
if (declaration.tagName === tagName) {
|
|
126
|
-
metadata = declaration;
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
if (!metadata) {
|
|
132
|
-
_clientLogger.logger.warn("Component not found in custom-elements.json: ".concat(tagName));
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
return metadata;
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
var getMetaData = function getMetaData(tagName, manifest) {
|
|
139
|
-
if ((manifest === null || manifest === void 0 ? void 0 : manifest.version) === 'experimental') {
|
|
140
|
-
return getMetaDataExperimental(tagName, manifest);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
return getMetaDataV1(tagName, manifest);
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
var extractArgTypesFromElements = function extractArgTypesFromElements(tagName, customElements) {
|
|
147
|
-
var metaData = getMetaData(tagName, customElements);
|
|
148
|
-
return metaData && Object.assign({}, mapData(metaData.attributes, 'attributes'), mapData(metaData.members, 'properties'), mapData(metaData.properties, 'properties'), mapData(metaData.events, 'events'), mapData(metaData.slots, 'slots'), mapData(metaData.cssProperties, 'css custom properties'), mapData(metaData.cssParts, 'css shadow parts'));
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
exports.extractArgTypesFromElements = extractArgTypesFromElements;
|
|
152
|
-
|
|
153
|
-
var extractArgTypes = function extractArgTypes(tagName) {
|
|
154
|
-
var cem = (0, _.getCustomElements)();
|
|
155
|
-
return extractArgTypesFromElements(tagName, cem);
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
exports.extractArgTypes = extractArgTypes;
|
|
159
|
-
|
|
160
|
-
var extractComponentDescription = function extractComponentDescription(tagName) {
|
|
161
|
-
var metaData = getMetaData(tagName, (0, _.getCustomElements)());
|
|
162
|
-
return metaData && metaData.description;
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
exports.extractComponentDescription = extractComponentDescription;
|