@storybook/vue3 7.3.2 → 7.4.0-alpha.1
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-UXHY756F.mjs +6 -0
- package/dist/config.d.ts +2 -2
- package/dist/config.js +2 -2
- package/dist/config.mjs +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.mjs +3 -3
- package/dist/{render-32b7dd3f.d.ts → render-ddbe18a8.d.ts} +2 -6
- package/package.json +8 -7
- package/dist/chunk-35B2DQBU.mjs +0 -6
- package/src/typings.d.ts +0 -1
- package/template/components/Button.vue +0 -52
- package/template/components/Form.vue +0 -41
- package/template/components/Html.vue +0 -18
- package/template/components/Pre.vue +0 -34
- package/template/components/button.css +0 -30
- package/template/stories/vue3-mdx.stories.mdx +0 -46
- package/template/stories_vue3-vite-default-ts/BaseLayout.vue +0 -18
- package/template/stories_vue3-vite-default-ts/CustomRenderFunctionalComponent.stories.ts +0 -32
- package/template/stories_vue3-vite-default-ts/CustomRenderOptionsArgsFromData.stories.ts +0 -45
- package/template/stories_vue3-vite-default-ts/GlobalSetup.stories.ts +0 -55
- package/template/stories_vue3-vite-default-ts/GlobalSetup.vue +0 -6
- package/template/stories_vue3-vite-default-ts/GlobalUsage.stories.ts +0 -29
- package/template/stories_vue3-vite-default-ts/GlobalUsage.vue +0 -3
- package/template/stories_vue3-vite-default-ts/MySlotComponent.vue +0 -12
- package/template/stories_vue3-vite-default-ts/OverrideArgs.vue +0 -40
- package/template/stories_vue3-vite-default-ts/ReactiveArgs.stories.ts +0 -137
- package/template/stories_vue3-vite-default-ts/ReactiveArgs.vue +0 -40
- package/template/stories_vue3-vite-default-ts/ReactiveDecorators.stories.ts +0 -88
- package/template/stories_vue3-vite-default-ts/ReactiveSlots.stories.ts +0 -127
- package/template/stories_vue3-vite-default-ts/Reactivity.vue +0 -44
- package/template/stories_vue3-vite-default-ts/ScopedSlots.stories.ts +0 -81
- package/template/stories_vue3-vite-default-ts/SourceDecorator.stories.ts +0 -46
- package/template/stories_vue3-vite-default-ts/decorators.stories.ts +0 -84
- package/template/stories_vue3-vite-default-ts/preview.ts +0 -12
@@ -0,0 +1,6 @@
|
|
1
|
+
import { h, createApp, reactive, isVNode, isReactive } from 'vue';
|
2
|
+
import { sanitizeStoryContextUpdate } from '@storybook/preview-api';
|
3
|
+
|
4
|
+
function normalizeFunctionalComponent(options){return typeof options=="function"?{render:options,name:options.name}:options}function prepare(rawStory,innerStory){let story=rawStory;return story===null?null:typeof story=="function"?story:innerStory?{...normalizeFunctionalComponent(story),components:{...story.components||{},story:innerStory}}:{render(){return h(story)}}}function decorateStory(storyFn,decorators){return decorators.reduce((decorated,decorator)=>context=>{let story,decoratedStory=decorator(update=>{let sanitizedUpdate=sanitizeStoryContextUpdate(update);return update&&(sanitizedUpdate.args=Object.assign(context.args,sanitizedUpdate.args)),story=decorated({...context,...sanitizedUpdate}),story},context);return story||(story=decorated(context)),decoratedStory===story?story:prepare(decoratedStory,()=>h(story))},context=>prepare(storyFn(context)))}var render=(props,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 ()=>h(Component,props,getSlots(props,context))},setup=fn=>{globalThis.PLUGINS_SETUP_FUNCTIONS??=new Set,globalThis.PLUGINS_SETUP_FUNCTIONS.add(fn);},runSetupFunctions=async(app,storyContext)=>{globalThis&&globalThis.PLUGINS_SETUP_FUNCTIONS&&await Promise.all([...globalThis.PLUGINS_SETUP_FUNCTIONS].map(fn=>fn(app,storyContext)));},map=new Map;async function renderToCanvas({storyFn,forceRemount,showMain,showException,storyContext,id},canvasElement){let existingApp=map.get(canvasElement);if(existingApp&&!forceRemount){let element=storyFn(),args=getArgs(element,storyContext);return updateArgs(existingApp.reactiveArgs,args),()=>{teardown(existingApp.vueApp,canvasElement);}}existingApp&&forceRemount&&teardown(existingApp.vueApp,canvasElement);let vueApp=createApp({setup(){storyContext.args=reactive(storyContext.args);let rootElement=storyFn(),args=getArgs(rootElement,storyContext),appState={vueApp,reactiveArgs:reactive(args)};return map.set(canvasElement,appState),()=>h(rootElement)}});return vueApp.config.errorHandler=e=>showException(e),await runSetupFunctions(vueApp,storyContext),vueApp.mount(canvasElement),showMain(),()=>{teardown(vueApp,canvasElement);}}function getSlots(props,context){let{argTypes}=context,slots=Object.entries(props).filter(([key])=>argTypes[key]?.table?.category==="slots").map(([key,value])=>[key,typeof value=="function"?value:()=>value]);return Object.fromEntries(slots)}function getArgs(element,storyContext){return element.props&&isVNode(element)?element.props:storyContext.args}function updateArgs(reactiveArgs,nextArgs){if(Object.keys(nextArgs).length===0)return;let currentArgs=isReactive(reactiveArgs)?reactiveArgs:reactive(reactiveArgs);Object.keys(currentArgs).forEach(key=>{key in nextArgs||delete currentArgs[key];}),Object.assign(currentArgs,nextArgs);}function teardown(storybookApp,canvasElement){storybookApp?.unmount(),map.has(canvasElement)&&map.delete(canvasElement);}
|
5
|
+
|
6
|
+
export { decorateStory, render, renderToCanvas, setup };
|
package/dist/config.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { Addon_DecoratorFunction, ArgTypesEnhancer, LegacyStoryFn, DecoratorFunction } from '@storybook/types';
|
2
|
-
import { V as VueRenderer } from './render-
|
3
|
-
export { r as render, a as renderToCanvas } from './render-
|
2
|
+
import { V as VueRenderer } from './render-ddbe18a8.js';
|
3
|
+
export { r as render, a as renderToCanvas } from './render-ddbe18a8.js';
|
4
4
|
import 'vue';
|
5
5
|
|
6
6
|
declare const decorators: Addon_DecoratorFunction<unknown>[];
|
package/dist/config.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var config_exports={};__export(config_exports,{applyDecorators:()=>decorateStory,argTypesEnhancers:()=>argTypesEnhancers,decorators:()=>decorators,parameters:()=>parameters2,render:()=>render,renderToCanvas:()=>renderToCanvas});module.exports=__toCommonJS(config_exports);var import_docs_tools3=require("@storybook/docs-tools");var import_docs_tools=require("@storybook/docs-tools"),SECTIONS=["props","events","slots","methods"],extractArgTypes=component=>{if(!(0,import_docs_tools.hasDocgen)(component))return null;let results={};return SECTIONS.forEach(section=>{(0,import_docs_tools.extractComponentProps)(component,section).forEach(({propDef,docgenInfo,jsDocTags})=>{let{name,type,description,defaultValue:defaultSummary,required}=propDef,sbType=section==="props"?(0,import_docs_tools.convert)(docgenInfo):{name:"void"};results[name]={name,description,type:{required,...sbType},table:{type,jsDocTags,defaultValue:defaultSummary,category:section}}})}),results};var import_preview_api=require("@storybook/preview-api"),import_docs_tools2=require("@storybook/docs-tools"),import_compiler_core=require("@vue/compiler-core"),import_vue=require("vue"),import_lodash=require("lodash");var omitEvent=args2=>args2?Object.fromEntries(Object.entries(args2).filter(([key,value])=>!key.startsWith("on"))):{},displayObject=obj=>obj&&typeof obj=="object"?`{${Object.keys(obj).map(key=>`${key}:${displayObject(obj[key])}`).join(",")}}`:typeof obj=="string"?`'${obj}'`:obj==null?void 0:obj.toString(),htmlEventAttributeToVueEventAttribute=key=>/^on[A-Za-z]/.test(key)?key.replace(/^on/,"v-on:").toLowerCase():key,directiveSource=(key,value)=>key.includes("on")?`${htmlEventAttributeToVueEventAttribute(key)}='()=>({})'`:`${key}="${value}"`,attributeSource=(key,value,dynamic)=>["boolean","number","object"].includes(typeof value)||dynamic&&["style","class"].includes(key)?`:${key}="${displayObject(value)}"`:directiveSource(key,value),evalExp=(argExpValue,args2)=>{let evalVal=argExpValue;return evalVal&&/v-bind="(\w+)"/.test(evalVal)?evalVal.replace(/"(\w+)"/g,`"${displayObject(args2)}"`):(Object.keys(args2).forEach(akey=>{let regexMatch=new RegExp(`(\\w+)\\.${akey}`,"g"),regexTarget=new RegExp(`(\\w+)\\.${akey}`,"g");regexMatch.test(evalVal)&&(evalVal=evalVal.replace(regexTarget,displayObject(args2[akey])))}),evalVal)},replaceValueWithRef=(source2,args2,ref)=>{let value=ref?args2[ref]:"args",bindValue=()=>{let argsRef=Object.fromEntries(Object.entries(args2).map(([key])=>[key,key]));return displayObject(argsRef).replace(/'/g,"")},regexMatch=new RegExp(`="${value}"`,"g");return source2.replace(regexMatch,`="${ref??bindValue()}"`)};function generateExpression(slot){let body=slot.toString().split("=>")[1].trim().replace("return","").trim();return body.startsWith("{")&&body.endsWith("}")&&(body=body.substring(1,body.length-1).trim()),`{{${body}}}`}var skipSourceRender=context=>{var _a;let sourceParams=(_a=context==null?void 0:context.parameters.docs)==null?void 0:_a.source,isArgsStory=context==null?void 0:context.parameters.__isArgsStory,isDocsViewMode=(context==null?void 0:context.viewMode)==="docs";return(sourceParams==null?void 0:sourceParams.type)===import_docs_tools2.SourceType.DYNAMIC?!1:!isDocsViewMode||!isArgsStory||(sourceParams==null?void 0:sourceParams.code)||(sourceParams==null?void 0:sourceParams.type)===import_docs_tools2.SourceType.CODE};function generateAttributesSource(tempArgs,args2,argTypes2,byRef2){return Object.keys(tempArgs).map(key=>{var _a;let source2=tempArgs[key].loc.source.replace(/\$props/g,"args"),argKey=(_a=tempArgs[key].arg)==null?void 0:_a.loc.source;return byRef2&&argKey?replaceValueWithRef(source2,args2,argKey):evalExp(source2,omitEvent(args2))}).join(" ")}function mapAttributesAndDirectives(props){let tranformKey=key=>key.startsWith("on")?key:(0,import_lodash.kebabCase)(key);return Object.keys(props).map(key=>({name:"bind",type:["v-","@","v-on"].includes(key)?7:6,arg:{content:tranformKey(key),loc:{source:tranformKey(key)}},loc:{source:attributeSource(tranformKey(key),props[key])},exp:{isStatic:!1,loc:{source:props[key]}},modifiers:[""]}))}function mapSlots(slotsArgs,generateComponentSource2,slots){return Object.keys(slotsArgs).map(key=>{var _a,_b;let slot=slotsArgs[key],slotContent="",scropedArgs=(_b=(_a=slots.find(s=>s.name===key&&s.scoped))==null?void 0:_a.bindings)==null?void 0:_b.map(b=>b.name).join(",");typeof slot=="function"
|
1
|
+
"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var config_exports={};__export(config_exports,{applyDecorators:()=>decorateStory,argTypesEnhancers:()=>argTypesEnhancers,decorators:()=>decorators,parameters:()=>parameters2,render:()=>render,renderToCanvas:()=>renderToCanvas});module.exports=__toCommonJS(config_exports);var import_docs_tools3=require("@storybook/docs-tools");var import_docs_tools=require("@storybook/docs-tools"),SECTIONS=["props","events","slots","methods"],extractArgTypes=component=>{if(!(0,import_docs_tools.hasDocgen)(component))return null;let results={};return SECTIONS.forEach(section=>{(0,import_docs_tools.extractComponentProps)(component,section).forEach(({propDef,docgenInfo,jsDocTags})=>{let{name,type,description,defaultValue:defaultSummary,required}=propDef,sbType=section==="props"?(0,import_docs_tools.convert)(docgenInfo):{name:"void"};results[name]={name,description,type:{required,...sbType},table:{type,jsDocTags,defaultValue:defaultSummary,category:section}}})}),results};var import_preview_api=require("@storybook/preview-api"),import_docs_tools2=require("@storybook/docs-tools"),import_compiler_core=require("@vue/compiler-core"),import_vue=require("vue"),import_lodash=require("lodash");var omitEvent=args2=>args2?Object.fromEntries(Object.entries(args2).filter(([key,value])=>!key.startsWith("on"))):{},displayObject=obj=>obj&&typeof obj=="object"?`{${Object.keys(obj).map(key=>`${key}:${displayObject(obj[key])}`).join(",")}}`:typeof obj=="string"?`'${obj}'`:obj==null?void 0:obj.toString(),htmlEventAttributeToVueEventAttribute=key=>/^on[A-Za-z]/.test(key)?key.replace(/^on/,"v-on:").toLowerCase():key,directiveSource=(key,value)=>key.includes("on")?`${htmlEventAttributeToVueEventAttribute(key)}='()=>({})'`:`${key}="${value}"`,attributeSource=(key,value,dynamic)=>["boolean","number","object"].includes(typeof value)||dynamic&&["style","class"].includes(key)?`:${key}="${displayObject(value)}"`:directiveSource(key,value),evalExp=(argExpValue,args2)=>{let evalVal=argExpValue;return evalVal&&/v-bind="(\w+)"/.test(evalVal)?evalVal.replace(/"(\w+)"/g,`"${displayObject(args2)}"`):(Object.keys(args2).forEach(akey=>{let regexMatch=new RegExp(`(\\w+)\\.${akey}`,"g"),regexTarget=new RegExp(`(\\w+)\\.${akey}`,"g");regexMatch.test(evalVal)&&(evalVal=evalVal.replace(regexTarget,displayObject(args2[akey])))}),evalVal)},replaceValueWithRef=(source2,args2,ref)=>{let value=ref?args2[ref]:"args",bindValue=()=>{let argsRef=Object.fromEntries(Object.entries(args2).map(([key])=>[key,key]));return displayObject(argsRef).replace(/'/g,"")},regexMatch=new RegExp(`="${value}"`,"g");return source2.replace(regexMatch,`="${ref??bindValue()}"`)};function generateExpression(slot){let body=slot.toString().split("=>")[1].trim().replace("return","").trim();return body.startsWith("{")&&body.endsWith("}")&&(body=body.substring(1,body.length-1).trim()),`{{${body}}}`}var skipSourceRender=context=>{var _a;let sourceParams=(_a=context==null?void 0:context.parameters.docs)==null?void 0:_a.source,isArgsStory=context==null?void 0:context.parameters.__isArgsStory,isDocsViewMode=(context==null?void 0:context.viewMode)==="docs";return(sourceParams==null?void 0:sourceParams.type)===import_docs_tools2.SourceType.DYNAMIC?!1:!isDocsViewMode||!isArgsStory||(sourceParams==null?void 0:sourceParams.code)||(sourceParams==null?void 0:sourceParams.type)===import_docs_tools2.SourceType.CODE};function generateAttributesSource(tempArgs,args2,argTypes2,byRef2){return Object.keys(tempArgs).map(key=>{var _a;let source2=tempArgs[key].loc.source.replace(/\$props/g,"args"),argKey=(_a=tempArgs[key].arg)==null?void 0:_a.loc.source;return byRef2&&argKey?replaceValueWithRef(source2,args2,argKey):evalExp(source2,omitEvent(args2))}).join(" ")}function mapAttributesAndDirectives(props){let tranformKey=key=>key.startsWith("on")?key:(0,import_lodash.kebabCase)(key);return Object.keys(props).map(key=>({name:"bind",type:["v-","@","v-on"].includes(key)?7:6,arg:{content:tranformKey(key),loc:{source:tranformKey(key)}},loc:{source:attributeSource(tranformKey(key),props[key])},exp:{isStatic:!1,loc:{source:props[key]}},modifiers:[""]}))}function mapSlots(slotsArgs,generateComponentSource2,slots){return Object.keys(slotsArgs).map(key=>{var _a,_b;let slot=slotsArgs[key],slotContent="",scropedArgs=(_b=(_a=slots.find(s=>s.name===key&&s.scoped))==null?void 0:_a.bindings)==null?void 0:_b.map(b=>b.name).join(",");typeof slot=="string"?slotContent=slot:typeof slot=="function"?slotContent=generateExpression(slot):(0,import_vue.isVNode)(slot)?slotContent=generateComponentSource2(slot):typeof slot=="object"&&!(0,import_vue.isVNode)(slot)&&(slotContent=JSON.stringify(slot));let bindingsString=scropedArgs?`="{${scropedArgs}}"`:"";return slotContent=slot?`<template #${key}${bindingsString}>${slotContent}</template>`:"",{type:2,content:slotContent,loc:{source:slotContent,start:{offset:0,line:1,column:0},end:{offset:0,line:1,column:0}}}})}function generateScriptSetup(args2,argTypes2,components){let scriptLines=Object.keys(args2).map(key=>`const ${key} = ${typeof args2[key]=="function"?"()=>{}":`ref(${JSON.stringify(args2[key])});`}`);return scriptLines.unshift('import { ref } from "vue";'),`<script lang='ts' setup>${scriptLines.join(`
|
2
2
|
`)}</script>`}function getTemplateComponents(renderFn,context){try{let originalStoryFn=renderFn,storyFn=originalStoryFn?originalStoryFn(context==null?void 0:context.args,context):context==null?void 0:context.component,story=typeof storyFn=="function"?storyFn():storyFn,{template}=story;return template?getComponents(template):[(0,import_vue.h)(story,context==null?void 0:context.args)]}catch(e){return console.log("error",e),[]}}function getComponents(template){let ast=(0,import_compiler_core.baseParse)(template),components=ast==null?void 0:ast.children;return components||[]}function generateTemplateSource(componentOrNodes,{args,argTypes},byRef=!1){let isElementNode=node=>node&&node.type===1,isInterpolationNode=node=>node&&node.type===5,isTextNode=node=>node&&node.type===2,generateComponentSource=componentOrNode=>{var _a,_b;if(isElementNode(componentOrNode)){let{tag:name,props:attributes,children}=componentOrNode,childSources=typeof children=="string"?children:children.map(child=>generateComponentSource(child)).join(""),props=generateAttributesSource(attributes,args,argTypes,byRef);return childSources===""?`<${name} ${props} />`:`<${name} ${props}>${childSources}</${name}>`}if(isTextNode(componentOrNode)){let{content:content2}=componentOrNode;return content2}if(isInterpolationNode(componentOrNode)){let{content}=componentOrNode,expValue=evalExp(content.loc.source,args);return expValue===content.loc.source?`{{${expValue}}}`:eval(expValue)}if((0,import_vue.isVNode)(componentOrNode)){let vnode=componentOrNode,{props,type,children}=vnode,slotsProps=typeof children=="string"?void 0:children,componentSlots=(_a=type==null?void 0:type.__docgenInfo)==null?void 0:_a.slots,attrsProps=slotsProps?Object.fromEntries(Object.entries(props??{}).filter(([key,value])=>!slotsProps[key]&&!["class","style"].includes(key)).map(([key,value])=>[key,value])):props,attributes=mapAttributesAndDirectives(attrsProps??{}),slotArgs=Object.fromEntries(Object.entries(props??{}).filter(([key,value])=>slotsProps==null?void 0:slotsProps[key])),childSources=children?typeof children=="string"?children:mapSlots(slotArgs,generateComponentSource,componentSlots??[]).map(child=>child.content).join(""):"";console.log(" vnode ",vnode," childSources ",childSources," attributes ",attributes);let name=typeof type=="string"?type:type.name||type.__name||((_b=type.__docgenInfo)==null?void 0:_b.displayName),propsSource=generateAttributesSource(attributes,args,argTypes,byRef);return childSources.trim()===""?`<${name} ${propsSource}/>`:`<${name} ${propsSource}>${childSources}</${name}>`}return null},componentsOrNodes=Array.isArray(componentOrNodes)?componentOrNodes:[componentOrNodes],source=componentsOrNodes.map(componentOrNode2=>generateComponentSource(componentOrNode2)).join(" ");return source||null}var sourceDecorator=(storyFn,context)=>{let skip=skipSourceRender(context),story=storyFn();return(0,import_vue.watch)(()=>context.args,()=>{skip||generateSource(context)},{immediate:!0,deep:!0}),story};function generateSource(context){var _a,_b,_c;let channel=import_preview_api.addons.getChannel(),{args:args2={},argTypes:argTypes2={},id}=context||{},storyComponents=getTemplateComponents(context==null?void 0:context.originalStoryFn,context),withScript=((_c=(_b=(_a=context==null?void 0:context.parameters)==null?void 0:_a.docs)==null?void 0:_b.source)==null?void 0:_c.withScriptSetup)||!1,generatedScript=withScript?generateScriptSetup(args2,argTypes2,storyComponents):"",generatedTemplate=generateTemplateSource(storyComponents,context,withScript);if(generatedTemplate){let source2=`${generatedScript}
|
3
3
|
<template>
|
4
4
|
${generatedTemplate}
|
5
|
-
</template>`;return channel.emit(import_docs_tools2.SNIPPET_RENDERED,{id,args:args2,source:source2,format:"vue"}),source2}return null}var parameters={docs:{story:{inline:!0},extractArgTypes,extractComponentDescription:import_docs_tools3.extractComponentDescription}},decorators=[sourceDecorator],argTypesEnhancers=[import_docs_tools3.enhanceArgTypes];var import_vue2=require("vue"),render=(props,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()=>(0,import_vue2.h)(Component,props,getSlots(props,context))}
|
5
|
+
</template>`;return channel.emit(import_docs_tools2.SNIPPET_RENDERED,{id,args:args2,source:source2,format:"vue"}),source2}return null}var parameters={docs:{story:{inline:!0},extractArgTypes,extractComponentDescription:import_docs_tools3.extractComponentDescription}},decorators=[sourceDecorator],argTypesEnhancers=[import_docs_tools3.enhanceArgTypes];var import_vue2=require("vue"),render=(props,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()=>(0,import_vue2.h)(Component,props,getSlots(props,context))};var runSetupFunctions=async(app,storyContext)=>{globalThis&&globalThis.PLUGINS_SETUP_FUNCTIONS&&await Promise.all([...globalThis.PLUGINS_SETUP_FUNCTIONS].map(fn=>fn(app,storyContext)))},map=new Map;async function renderToCanvas({storyFn,forceRemount,showMain,showException,storyContext,id},canvasElement){let existingApp=map.get(canvasElement);if(existingApp&&!forceRemount){let element=storyFn(),args2=getArgs(element,storyContext);return updateArgs(existingApp.reactiveArgs,args2),()=>{teardown(existingApp.vueApp,canvasElement)}}existingApp&&forceRemount&&teardown(existingApp.vueApp,canvasElement);let vueApp=(0,import_vue2.createApp)({setup(){storyContext.args=(0,import_vue2.reactive)(storyContext.args);let rootElement=storyFn(),args2=getArgs(rootElement,storyContext),appState={vueApp,reactiveArgs:(0,import_vue2.reactive)(args2)};return map.set(canvasElement,appState),()=>(0,import_vue2.h)(rootElement)}});return vueApp.config.errorHandler=e=>showException(e),await runSetupFunctions(vueApp,storyContext),vueApp.mount(canvasElement),showMain(),()=>{teardown(vueApp,canvasElement)}}function getSlots(props,context){let{argTypes:argTypes2}=context,slots=Object.entries(props).filter(([key])=>{var _a,_b;return((_b=(_a=argTypes2[key])==null?void 0:_a.table)==null?void 0:_b.category)==="slots"}).map(([key,value])=>[key,typeof value=="function"?value:()=>value]);return Object.fromEntries(slots)}function getArgs(element,storyContext){return element.props&&(0,import_vue2.isVNode)(element)?element.props:storyContext.args}function updateArgs(reactiveArgs,nextArgs){if(Object.keys(nextArgs).length===0)return;let currentArgs=(0,import_vue2.isReactive)(reactiveArgs)?reactiveArgs:(0,import_vue2.reactive)(reactiveArgs);Object.keys(currentArgs).forEach(key=>{key in nextArgs||delete currentArgs[key]}),Object.assign(currentArgs,nextArgs)}function teardown(storybookApp,canvasElement){storybookApp==null||storybookApp.unmount(),map.has(canvasElement)&&map.delete(canvasElement)}var import_vue3=require("vue"),import_preview_api2=require("@storybook/preview-api");function normalizeFunctionalComponent(options){return typeof options=="function"?{render:options,name:options.name}:options}function prepare(rawStory,innerStory){let story=rawStory;return story===null?null:typeof story=="function"?story:innerStory?{...normalizeFunctionalComponent(story),components:{...story.components||{},story:innerStory}}:{render(){return(0,import_vue3.h)(story)}}}function decorateStory(storyFn,decorators2){return decorators2.reduce((decorated,decorator)=>context=>{let story,decoratedStory=decorator(update=>{let sanitizedUpdate=(0,import_preview_api2.sanitizeStoryContextUpdate)(update);return update&&(sanitizedUpdate.args=Object.assign(context.args,sanitizedUpdate.args)),story=decorated({...context,...sanitizedUpdate}),story},context);return story||(story=decorated(context)),decoratedStory===story?story:prepare(decoratedStory,()=>(0,import_vue3.h)(story))},context=>prepare(storyFn(context)))}var parameters2={renderer:"vue3",...parameters};0&&(module.exports={applyDecorators,argTypesEnhancers,decorators,parameters,render,renderToCanvas});
|
package/dist/config.mjs
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
export { decorateStory as applyDecorators, render, renderToCanvas } from './chunk-
|
1
|
+
export { decorateStory as applyDecorators, render, renderToCanvas } from './chunk-UXHY756F.mjs';
|
2
2
|
import { enhanceArgTypes, SNIPPET_RENDERED, extractComponentDescription, hasDocgen, extractComponentProps, convert, SourceType } from '@storybook/docs-tools';
|
3
3
|
import { addons } from '@storybook/preview-api';
|
4
4
|
import { baseParse } from '@vue/compiler-core';
|
5
5
|
import { watch, h, isVNode } from 'vue';
|
6
6
|
import { kebabCase } from 'lodash';
|
7
7
|
|
8
|
-
var SECTIONS=["props","events","slots","methods"],extractArgTypes=component=>{if(!hasDocgen(component))return null;let results={};return SECTIONS.forEach(section=>{extractComponentProps(component,section).forEach(({propDef,docgenInfo,jsDocTags})=>{let{name,type,description,defaultValue:defaultSummary,required}=propDef,sbType=section==="props"?convert(docgenInfo):{name:"void"};results[name]={name,description,type:{required,...sbType},table:{type,jsDocTags,defaultValue:defaultSummary,category:section}};});}),results};var omitEvent=args2=>args2?Object.fromEntries(Object.entries(args2).filter(([key,value])=>!key.startsWith("on"))):{},displayObject=obj=>obj&&typeof obj=="object"?`{${Object.keys(obj).map(key=>`${key}:${displayObject(obj[key])}`).join(",")}}`:typeof obj=="string"?`'${obj}'`:obj?.toString(),htmlEventAttributeToVueEventAttribute=key=>/^on[A-Za-z]/.test(key)?key.replace(/^on/,"v-on:").toLowerCase():key,directiveSource=(key,value)=>key.includes("on")?`${htmlEventAttributeToVueEventAttribute(key)}='()=>({})'`:`${key}="${value}"`,attributeSource=(key,value,dynamic)=>["boolean","number","object"].includes(typeof value)||dynamic&&["style","class"].includes(key)?`:${key}="${displayObject(value)}"`:directiveSource(key,value),evalExp=(argExpValue,args2)=>{let evalVal=argExpValue;return evalVal&&/v-bind="(\w+)"/.test(evalVal)?evalVal.replace(/"(\w+)"/g,`"${displayObject(args2)}"`):(Object.keys(args2).forEach(akey=>{let regexMatch=new RegExp(`(\\w+)\\.${akey}`,"g"),regexTarget=new RegExp(`(\\w+)\\.${akey}`,"g");regexMatch.test(evalVal)&&(evalVal=evalVal.replace(regexTarget,displayObject(args2[akey])));}),evalVal)},replaceValueWithRef=(source2,args2,ref)=>{let value=ref?args2[ref]:"args",bindValue=()=>{let argsRef=Object.fromEntries(Object.entries(args2).map(([key])=>[key,key]));return displayObject(argsRef).replace(/'/g,"")},regexMatch=new RegExp(`="${value}"`,"g");return source2.replace(regexMatch,`="${ref??bindValue()}"`)};function generateExpression(slot){let body=slot.toString().split("=>")[1].trim().replace("return","").trim();return body.startsWith("{")&&body.endsWith("}")&&(body=body.substring(1,body.length-1).trim()),`{{${body}}}`}var skipSourceRender=context=>{let sourceParams=context?.parameters.docs?.source,isArgsStory=context?.parameters.__isArgsStory,isDocsViewMode=context?.viewMode==="docs";return sourceParams?.type===SourceType.DYNAMIC?!1:!isDocsViewMode||!isArgsStory||sourceParams?.code||sourceParams?.type===SourceType.CODE};function generateAttributesSource(tempArgs,args2,argTypes2,byRef2){return Object.keys(tempArgs).map(key=>{let source2=tempArgs[key].loc.source.replace(/\$props/g,"args"),argKey=tempArgs[key].arg?.loc.source;return byRef2&&argKey?replaceValueWithRef(source2,args2,argKey):evalExp(source2,omitEvent(args2))}).join(" ")}function mapAttributesAndDirectives(props){let tranformKey=key=>key.startsWith("on")?key:kebabCase(key);return Object.keys(props).map(key=>({name:"bind",type:["v-","@","v-on"].includes(key)?7:6,arg:{content:tranformKey(key),loc:{source:tranformKey(key)}},loc:{source:attributeSource(tranformKey(key),props[key])},exp:{isStatic:!1,loc:{source:props[key]}},modifiers:[""]}))}function mapSlots(slotsArgs,generateComponentSource2,slots){return Object.keys(slotsArgs).map(key=>{let slot=slotsArgs[key],slotContent="",scropedArgs=slots.find(s=>s.name===key&&s.scoped)?.bindings?.map(b=>b.name).join(",");typeof slot=="function"
|
8
|
+
var SECTIONS=["props","events","slots","methods"],extractArgTypes=component=>{if(!hasDocgen(component))return null;let results={};return SECTIONS.forEach(section=>{extractComponentProps(component,section).forEach(({propDef,docgenInfo,jsDocTags})=>{let{name,type,description,defaultValue:defaultSummary,required}=propDef,sbType=section==="props"?convert(docgenInfo):{name:"void"};results[name]={name,description,type:{required,...sbType},table:{type,jsDocTags,defaultValue:defaultSummary,category:section}};});}),results};var omitEvent=args2=>args2?Object.fromEntries(Object.entries(args2).filter(([key,value])=>!key.startsWith("on"))):{},displayObject=obj=>obj&&typeof obj=="object"?`{${Object.keys(obj).map(key=>`${key}:${displayObject(obj[key])}`).join(",")}}`:typeof obj=="string"?`'${obj}'`:obj?.toString(),htmlEventAttributeToVueEventAttribute=key=>/^on[A-Za-z]/.test(key)?key.replace(/^on/,"v-on:").toLowerCase():key,directiveSource=(key,value)=>key.includes("on")?`${htmlEventAttributeToVueEventAttribute(key)}='()=>({})'`:`${key}="${value}"`,attributeSource=(key,value,dynamic)=>["boolean","number","object"].includes(typeof value)||dynamic&&["style","class"].includes(key)?`:${key}="${displayObject(value)}"`:directiveSource(key,value),evalExp=(argExpValue,args2)=>{let evalVal=argExpValue;return evalVal&&/v-bind="(\w+)"/.test(evalVal)?evalVal.replace(/"(\w+)"/g,`"${displayObject(args2)}"`):(Object.keys(args2).forEach(akey=>{let regexMatch=new RegExp(`(\\w+)\\.${akey}`,"g"),regexTarget=new RegExp(`(\\w+)\\.${akey}`,"g");regexMatch.test(evalVal)&&(evalVal=evalVal.replace(regexTarget,displayObject(args2[akey])));}),evalVal)},replaceValueWithRef=(source2,args2,ref)=>{let value=ref?args2[ref]:"args",bindValue=()=>{let argsRef=Object.fromEntries(Object.entries(args2).map(([key])=>[key,key]));return displayObject(argsRef).replace(/'/g,"")},regexMatch=new RegExp(`="${value}"`,"g");return source2.replace(regexMatch,`="${ref??bindValue()}"`)};function generateExpression(slot){let body=slot.toString().split("=>")[1].trim().replace("return","").trim();return body.startsWith("{")&&body.endsWith("}")&&(body=body.substring(1,body.length-1).trim()),`{{${body}}}`}var skipSourceRender=context=>{let sourceParams=context?.parameters.docs?.source,isArgsStory=context?.parameters.__isArgsStory,isDocsViewMode=context?.viewMode==="docs";return sourceParams?.type===SourceType.DYNAMIC?!1:!isDocsViewMode||!isArgsStory||sourceParams?.code||sourceParams?.type===SourceType.CODE};function generateAttributesSource(tempArgs,args2,argTypes2,byRef2){return Object.keys(tempArgs).map(key=>{let source2=tempArgs[key].loc.source.replace(/\$props/g,"args"),argKey=tempArgs[key].arg?.loc.source;return byRef2&&argKey?replaceValueWithRef(source2,args2,argKey):evalExp(source2,omitEvent(args2))}).join(" ")}function mapAttributesAndDirectives(props){let tranformKey=key=>key.startsWith("on")?key:kebabCase(key);return Object.keys(props).map(key=>({name:"bind",type:["v-","@","v-on"].includes(key)?7:6,arg:{content:tranformKey(key),loc:{source:tranformKey(key)}},loc:{source:attributeSource(tranformKey(key),props[key])},exp:{isStatic:!1,loc:{source:props[key]}},modifiers:[""]}))}function mapSlots(slotsArgs,generateComponentSource2,slots){return Object.keys(slotsArgs).map(key=>{let slot=slotsArgs[key],slotContent="",scropedArgs=slots.find(s=>s.name===key&&s.scoped)?.bindings?.map(b=>b.name).join(",");typeof slot=="string"?slotContent=slot:typeof slot=="function"?slotContent=generateExpression(slot):isVNode(slot)?slotContent=generateComponentSource2(slot):typeof slot=="object"&&!isVNode(slot)&&(slotContent=JSON.stringify(slot));let bindingsString=scropedArgs?`="{${scropedArgs}}"`:"";return slotContent=slot?`<template #${key}${bindingsString}>${slotContent}</template>`:"",{type:2,content:slotContent,loc:{source:slotContent,start:{offset:0,line:1,column:0},end:{offset:0,line:1,column:0}}}})}function generateScriptSetup(args2,argTypes2,components){let scriptLines=Object.keys(args2).map(key=>`const ${key} = ${typeof args2[key]=="function"?"()=>{}":`ref(${JSON.stringify(args2[key])});`}`);return scriptLines.unshift('import { ref } from "vue";'),`<script lang='ts' setup>${scriptLines.join(`
|
9
9
|
`)}<\/script>`}function getTemplateComponents(renderFn,context){try{let originalStoryFn=renderFn,storyFn=originalStoryFn?originalStoryFn(context?.args,context):context?.component,story=typeof storyFn=="function"?storyFn():storyFn,{template}=story;return template?getComponents(template):[h(story,context?.args)]}catch(e){return console.log("error",e),[]}}function getComponents(template){let components=baseParse(template)?.children;return components||[]}function generateTemplateSource(componentOrNodes,{args,argTypes},byRef=!1){let isElementNode=node=>node&&node.type===1,isInterpolationNode=node=>node&&node.type===5,isTextNode=node=>node&&node.type===2,generateComponentSource=componentOrNode=>{if(isElementNode(componentOrNode)){let{tag:name,props:attributes,children}=componentOrNode,childSources=typeof children=="string"?children:children.map(child=>generateComponentSource(child)).join(""),props=generateAttributesSource(attributes,args,argTypes,byRef);return childSources===""?`<${name} ${props} />`:`<${name} ${props}>${childSources}</${name}>`}if(isTextNode(componentOrNode)){let{content:content2}=componentOrNode;return content2}if(isInterpolationNode(componentOrNode)){let{content}=componentOrNode,expValue=evalExp(content.loc.source,args);return expValue===content.loc.source?`{{${expValue}}}`:eval(expValue)}if(isVNode(componentOrNode)){let vnode=componentOrNode,{props,type,children}=vnode,slotsProps=typeof children=="string"?void 0:children,componentSlots=type?.__docgenInfo?.slots,attrsProps=slotsProps?Object.fromEntries(Object.entries(props??{}).filter(([key,value])=>!slotsProps[key]&&!["class","style"].includes(key)).map(([key,value])=>[key,value])):props,attributes=mapAttributesAndDirectives(attrsProps??{}),slotArgs=Object.fromEntries(Object.entries(props??{}).filter(([key,value])=>slotsProps?.[key])),childSources=children?typeof children=="string"?children:mapSlots(slotArgs,generateComponentSource,componentSlots??[]).map(child=>child.content).join(""):"";console.log(" vnode ",vnode," childSources ",childSources," attributes ",attributes);let name=typeof type=="string"?type:type.name||type.__name||type.__docgenInfo?.displayName,propsSource=generateAttributesSource(attributes,args,argTypes,byRef);return childSources.trim()===""?`<${name} ${propsSource}/>`:`<${name} ${propsSource}>${childSources}</${name}>`}return null},componentsOrNodes=Array.isArray(componentOrNodes)?componentOrNodes:[componentOrNodes],source=componentsOrNodes.map(componentOrNode2=>generateComponentSource(componentOrNode2)).join(" ");return source||null}var sourceDecorator=(storyFn,context)=>{let skip=skipSourceRender(context),story=storyFn();return watch(()=>context.args,()=>{skip||generateSource(context);},{immediate:!0,deep:!0}),story};function generateSource(context){let channel=addons.getChannel(),{args:args2={},argTypes:argTypes2={},id}=context||{},storyComponents=getTemplateComponents(context?.originalStoryFn,context),withScript=context?.parameters?.docs?.source?.withScriptSetup||!1,generatedScript=withScript?generateScriptSetup(args2):"",generatedTemplate=generateTemplateSource(storyComponents,context,withScript);if(generatedTemplate){let source2=`${generatedScript}
|
10
10
|
<template>
|
11
11
|
${generatedTemplate}
|
package/dist/index.d.ts
CHANGED
@@ -2,8 +2,8 @@ import * as _storybook_types from '@storybook/types';
|
|
2
2
|
import { Addon_ClientStoryApi, Addon_Loadable, Args, ComponentAnnotations, AnnotatedStoryFn, ArgsStoryFn, ArgsFromMeta, StoryAnnotations, StrictArgs, DecoratorFunction, LoaderFunction, StoryContext as StoryContext$1, ProjectAnnotations } from '@storybook/types';
|
3
3
|
export { ArgTypes, Args, Parameters, StrictArgs } from '@storybook/types';
|
4
4
|
import { App, FunctionalComponent, VNodeChild } from 'vue';
|
5
|
-
import { V as VueRenderer } from './render-
|
6
|
-
export { s as setup } from './render-
|
5
|
+
import { V as VueRenderer } from './render-ddbe18a8.js';
|
6
|
+
export { s as setup } from './render-ddbe18a8.js';
|
7
7
|
import { Simplify, SetOptional, Constructor, RemoveIndexSignature } from 'type-fest';
|
8
8
|
import { ComponentProps, ComponentSlots } from 'vue-component-type-helpers';
|
9
9
|
|
package/dist/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var src_exports={};__export(src_exports,{configure:()=>configure,forceReRender:()=>forceReRender,raw:()=>raw,setup:()=>setup,storiesOf:()=>storiesOf});module.exports=__toCommonJS(src_exports);var import_global=require("@storybook/global"),{window:globalWindow}=import_global.global;globalWindow.STORYBOOK_ENV="vue3";var import_preview_api2=require("@storybook/preview-api");var import_vue=require("vue"),import_preview_api=require("@storybook/preview-api");function normalizeFunctionalComponent(options){return typeof options=="function"?{render:options,name:options.name}:options}function prepare(rawStory,innerStory){let story=rawStory;return story===null?null:typeof story=="function"?story:innerStory?{...normalizeFunctionalComponent(story),components:{...story.components||{},story:innerStory}}:{render(){return(0,import_vue.h)(story)}}}function decorateStory(storyFn,decorators){return decorators.reduce((decorated,decorator)=>context=>{let story,decoratedStory=decorator(update=>{let sanitizedUpdate=(0,import_preview_api.sanitizeStoryContextUpdate)(update);return update&&(sanitizedUpdate.args=Object.assign(context.args,sanitizedUpdate.args)),story=decorated({...context,...sanitizedUpdate}),story},context);return story||(story=decorated(context)),decoratedStory===story?story:prepare(decoratedStory,()=>(0,import_vue.h)(story))},context=>prepare(storyFn(context)))}var import_vue2=require("vue"),render=(props,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()=>(0,import_vue2.h)(Component,props,getSlots(props,context))},
|
1
|
+
"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var src_exports={};__export(src_exports,{configure:()=>configure,forceReRender:()=>forceReRender,raw:()=>raw,setup:()=>setup,storiesOf:()=>storiesOf});module.exports=__toCommonJS(src_exports);var import_global=require("@storybook/global"),{window:globalWindow}=import_global.global;globalWindow.STORYBOOK_ENV="vue3";globalWindow.PLUGINS_SETUP_FUNCTIONS||=new Set;var import_preview_api2=require("@storybook/preview-api");var import_vue=require("vue"),import_preview_api=require("@storybook/preview-api");function normalizeFunctionalComponent(options){return typeof options=="function"?{render:options,name:options.name}:options}function prepare(rawStory,innerStory){let story=rawStory;return story===null?null:typeof story=="function"?story:innerStory?{...normalizeFunctionalComponent(story),components:{...story.components||{},story:innerStory}}:{render(){return(0,import_vue.h)(story)}}}function decorateStory(storyFn,decorators){return decorators.reduce((decorated,decorator)=>context=>{let story,decoratedStory=decorator(update=>{let sanitizedUpdate=(0,import_preview_api.sanitizeStoryContextUpdate)(update);return update&&(sanitizedUpdate.args=Object.assign(context.args,sanitizedUpdate.args)),story=decorated({...context,...sanitizedUpdate}),story},context);return story||(story=decorated(context)),decoratedStory===story?story:prepare(decoratedStory,()=>(0,import_vue.h)(story))},context=>prepare(storyFn(context)))}var import_vue2=require("vue"),render=(props,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()=>(0,import_vue2.h)(Component,props,getSlots(props,context))},setup=fn=>{globalThis.PLUGINS_SETUP_FUNCTIONS??=new Set,globalThis.PLUGINS_SETUP_FUNCTIONS.add(fn)},runSetupFunctions=async(app,storyContext)=>{globalThis&&globalThis.PLUGINS_SETUP_FUNCTIONS&&await Promise.all([...globalThis.PLUGINS_SETUP_FUNCTIONS].map(fn=>fn(app,storyContext)))},map=new Map;async function renderToCanvas({storyFn,forceRemount,showMain,showException,storyContext,id},canvasElement){let existingApp=map.get(canvasElement);if(existingApp&&!forceRemount){let element=storyFn(),args=getArgs(element,storyContext);return updateArgs(existingApp.reactiveArgs,args),()=>{teardown(existingApp.vueApp,canvasElement)}}existingApp&&forceRemount&&teardown(existingApp.vueApp,canvasElement);let vueApp=(0,import_vue2.createApp)({setup(){storyContext.args=(0,import_vue2.reactive)(storyContext.args);let rootElement=storyFn(),args=getArgs(rootElement,storyContext),appState={vueApp,reactiveArgs:(0,import_vue2.reactive)(args)};return map.set(canvasElement,appState),()=>(0,import_vue2.h)(rootElement)}});return vueApp.config.errorHandler=e=>showException(e),await runSetupFunctions(vueApp,storyContext),vueApp.mount(canvasElement),showMain(),()=>{teardown(vueApp,canvasElement)}}function getSlots(props,context){let{argTypes}=context,slots=Object.entries(props).filter(([key])=>{var _a2,_b;return((_b=(_a2=argTypes[key])==null?void 0:_a2.table)==null?void 0:_b.category)==="slots"}).map(([key,value])=>[key,typeof value=="function"?value:()=>value]);return Object.fromEntries(slots)}function getArgs(element,storyContext){return element.props&&(0,import_vue2.isVNode)(element)?element.props:storyContext.args}function updateArgs(reactiveArgs,nextArgs){if(Object.keys(nextArgs).length===0)return;let currentArgs=(0,import_vue2.isReactive)(reactiveArgs)?reactiveArgs:(0,import_vue2.reactive)(reactiveArgs);Object.keys(currentArgs).forEach(key=>{key in nextArgs||delete currentArgs[key]}),Object.assign(currentArgs,nextArgs)}function teardown(storybookApp,canvasElement){storybookApp==null||storybookApp.unmount(),map.has(canvasElement)&&map.delete(canvasElement)}var RENDERER="vue3",api=(0,import_preview_api2.start)(renderToCanvas,{decorateStory,render}),storiesOf=(kind,m)=>api.clientApi.storiesOf(kind,m).addParameters({renderer:RENDERER}),configure=(...args)=>api.configure(RENDERER,...args),{forceReRender}=api,{raw}=api.clientApi;var _a;try{(_a=module==null?void 0:module.hot)!=null&&_a.decline&&module.hot.decline()}catch{}0&&(module.exports={configure,forceReRender,raw,setup,storiesOf});
|
package/dist/index.mjs
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
import { renderToCanvas, decorateStory, render } from './chunk-
|
2
|
-
export { setup } from './chunk-
|
1
|
+
import { renderToCanvas, decorateStory, render } from './chunk-UXHY756F.mjs';
|
2
|
+
export { setup } from './chunk-UXHY756F.mjs';
|
3
3
|
import { global } from '@storybook/global';
|
4
4
|
import { start } from '@storybook/preview-api';
|
5
5
|
|
6
|
-
var{window:globalWindow}=global;globalWindow.STORYBOOK_ENV="vue3";var RENDERER="vue3",api=start(renderToCanvas,{decorateStory,render}),storiesOf=(kind,m)=>api.clientApi.storiesOf(kind,m).addParameters({renderer:RENDERER}),configure=(...args)=>api.configure(RENDERER,...args),{forceReRender}=api,{raw}=api.clientApi;
|
6
|
+
var{window:globalWindow}=global;globalWindow.STORYBOOK_ENV="vue3";globalWindow.PLUGINS_SETUP_FUNCTIONS||=new Set;var RENDERER="vue3",api=start(renderToCanvas,{decorateStory,render}),storiesOf=(kind,m)=>api.clientApi.storiesOf(kind,m).addParameters({renderer:RENDERER}),configure=(...args)=>api.configure(RENDERER,...args),{forceReRender}=api,{raw}=api.clientApi;try{module?.hot?.decline&&module.hot.decline();}catch{}
|
7
7
|
|
8
8
|
export { configure, forceReRender, raw, storiesOf };
|
@@ -138,11 +138,7 @@ type ArgsStoryFn<TRenderer extends Renderer = Renderer, TArgs = Args> = (args: T
|
|
138
138
|
type StoryFn<TRenderer extends Renderer = Renderer, TArgs = Args> = LegacyStoryFn<TRenderer, TArgs> | ArgsStoryFn<TRenderer, TArgs>;
|
139
139
|
|
140
140
|
declare const render: ArgsStoryFn$1<VueRenderer>;
|
141
|
-
|
142
|
-
|
143
|
-
* @param fn
|
144
|
-
*/
|
145
|
-
declare const setup: (fn: (app: App, storyContext?: StoryContext<VueRenderer>) => void) => void;
|
146
|
-
declare function renderToCanvas({ storyFn, forceRemount, showMain, showException, storyContext, id }: RenderContext<VueRenderer>, canvasElement: VueRenderer['canvasElement']): () => void;
|
141
|
+
declare const setup: (fn: (app: App, storyContext?: StoryContext<VueRenderer>) => unknown) => void;
|
142
|
+
declare function renderToCanvas({ storyFn, forceRemount, showMain, showException, storyContext, id }: RenderContext<VueRenderer>, canvasElement: VueRenderer['canvasElement']): Promise<() => void>;
|
147
143
|
|
148
144
|
export { VueRenderer as V, renderToCanvas as a, render as r, setup as s };
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@storybook/vue3",
|
3
|
-
"version": "7.
|
3
|
+
"version": "7.4.0-alpha.1",
|
4
4
|
"description": "Storybook Vue 3 renderer",
|
5
5
|
"keywords": [
|
6
6
|
"storybook"
|
@@ -38,21 +38,22 @@
|
|
38
38
|
"types": "dist/index.d.ts",
|
39
39
|
"files": [
|
40
40
|
"dist/**/*",
|
41
|
-
"template/**/*",
|
41
|
+
"template/cli/**/*",
|
42
42
|
"README.md",
|
43
43
|
"*.js",
|
44
|
-
"*.d.ts"
|
44
|
+
"*.d.ts",
|
45
|
+
"!src/**/*"
|
45
46
|
],
|
46
47
|
"scripts": {
|
47
48
|
"check": "vue-tsc --noEmit",
|
48
49
|
"prep": "../../../scripts/prepare/bundle.ts"
|
49
50
|
},
|
50
51
|
"dependencies": {
|
51
|
-
"@storybook/core-client": "7.
|
52
|
-
"@storybook/docs-tools": "7.
|
52
|
+
"@storybook/core-client": "7.4.0-alpha.1",
|
53
|
+
"@storybook/docs-tools": "7.4.0-alpha.1",
|
53
54
|
"@storybook/global": "^5.0.0",
|
54
|
-
"@storybook/preview-api": "7.
|
55
|
-
"@storybook/types": "7.
|
55
|
+
"@storybook/preview-api": "7.4.0-alpha.1",
|
56
|
+
"@storybook/types": "7.4.0-alpha.1",
|
56
57
|
"lodash": "^4.17.21",
|
57
58
|
"ts-dedent": "^2.0.0",
|
58
59
|
"type-fest": "~2.19",
|
package/dist/chunk-35B2DQBU.mjs
DELETED
@@ -1,6 +0,0 @@
|
|
1
|
-
import { h, createApp, reactive, isVNode, isReactive } from 'vue';
|
2
|
-
import { sanitizeStoryContextUpdate } from '@storybook/preview-api';
|
3
|
-
|
4
|
-
function normalizeFunctionalComponent(options){return typeof options=="function"?{render:options,name:options.name}:options}function prepare(rawStory,innerStory){let story=rawStory;return story===null?null:typeof story=="function"?story:innerStory?{...normalizeFunctionalComponent(story),components:{...story.components||{},story:innerStory}}:{render(){return h(story)}}}function decorateStory(storyFn,decorators){return decorators.reduce((decorated,decorator)=>context=>{let story,decoratedStory=decorator(update=>{let sanitizedUpdate=sanitizeStoryContextUpdate(update);return update&&(sanitizedUpdate.args=Object.assign(context.args,sanitizedUpdate.args)),story=decorated({...context,...sanitizedUpdate}),story},context);return story||(story=decorated(context)),decoratedStory===story?story:prepare(decoratedStory,()=>h(story))},context=>prepare(storyFn(context)))}var render=(props,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 ()=>h(Component,props,getSlots(props,context))},setupFunctions=new Set,setup=fn=>{setupFunctions.add(fn);},runSetupFunctions=(app,storyContext)=>{setupFunctions.forEach(fn=>fn(app,storyContext));},map=new Map;function renderToCanvas({storyFn,forceRemount,showMain,showException,storyContext,id},canvasElement){let existingApp=map.get(canvasElement);if(existingApp&&!forceRemount){let element=storyFn(),args=getArgs(element,storyContext);return updateArgs(existingApp.reactiveArgs,args),()=>{teardown(existingApp.vueApp,canvasElement);}}existingApp&&forceRemount&&teardown(existingApp.vueApp,canvasElement);let vueApp=createApp({setup(){storyContext.args=reactive(storyContext.args);let rootElement=storyFn(),args=getArgs(rootElement,storyContext),appState={vueApp,reactiveArgs:reactive(args)};return map.set(canvasElement,appState),()=>h(rootElement)}});return vueApp.config.errorHandler=e=>showException(e),runSetupFunctions(vueApp,storyContext),vueApp.mount(canvasElement),showMain(),()=>{teardown(vueApp,canvasElement);}}function getSlots(props,context){let{argTypes}=context,slots=Object.entries(props).filter(([key])=>argTypes[key]?.table?.category==="slots").map(([key,value])=>[key,typeof value=="function"?value:()=>value]);return Object.fromEntries(slots)}function getArgs(element,storyContext){return element.props&&isVNode(element)?element.props:storyContext.args}function updateArgs(reactiveArgs,nextArgs){if(Object.keys(nextArgs).length===0)return;let currentArgs=isReactive(reactiveArgs)?reactiveArgs:reactive(reactiveArgs);Object.keys(currentArgs).forEach(key=>{key in nextArgs||delete currentArgs[key];}),Object.assign(currentArgs,nextArgs);}function teardown(storybookApp,canvasElement){storybookApp?.unmount(),map.has(canvasElement)&&map.delete(canvasElement);}
|
5
|
-
|
6
|
-
export { decorateStory, render, renderToCanvas, setup };
|
package/src/typings.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
declare var STORYBOOK_ENV: 'vue3';
|
@@ -1,52 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<button type="button" :class="classes" @click="onClick" :style="style">{{ label }}</button>
|
3
|
-
</template>
|
4
|
-
|
5
|
-
<script>
|
6
|
-
import './button.css';
|
7
|
-
import { reactive, computed } from 'vue';
|
8
|
-
|
9
|
-
export default {
|
10
|
-
name: 'my-button',
|
11
|
-
|
12
|
-
props: {
|
13
|
-
label: {
|
14
|
-
type: String,
|
15
|
-
required: true,
|
16
|
-
},
|
17
|
-
primary: {
|
18
|
-
type: Boolean,
|
19
|
-
default: false,
|
20
|
-
},
|
21
|
-
size: {
|
22
|
-
type: String,
|
23
|
-
validator: function (value) {
|
24
|
-
return ['small', 'medium', 'large'].indexOf(value) !== -1;
|
25
|
-
},
|
26
|
-
},
|
27
|
-
backgroundColor: {
|
28
|
-
type: String,
|
29
|
-
},
|
30
|
-
},
|
31
|
-
|
32
|
-
emits: ['click'],
|
33
|
-
|
34
|
-
setup(props, { emit }) {
|
35
|
-
props = reactive(props);
|
36
|
-
return {
|
37
|
-
classes: computed(() => ({
|
38
|
-
'storybook-button': true,
|
39
|
-
'storybook-button--primary': props.primary,
|
40
|
-
'storybook-button--secondary': !props.primary,
|
41
|
-
[`storybook-button--${props.size || 'medium'}`]: true,
|
42
|
-
})),
|
43
|
-
style: computed(() => ({
|
44
|
-
backgroundColor: props.backgroundColor,
|
45
|
-
})),
|
46
|
-
onClick() {
|
47
|
-
emit('click');
|
48
|
-
},
|
49
|
-
};
|
50
|
-
},
|
51
|
-
};
|
52
|
-
</script>
|
@@ -1,41 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<form id="interaction-test-form" @submit.prevent="onSubmit">
|
3
|
-
<label>
|
4
|
-
Enter Value
|
5
|
-
<input type="text" data-testid="value" v-model="value" required />
|
6
|
-
</label>
|
7
|
-
<button type="submit">Submit</button>
|
8
|
-
<p v-if="complete">Completed!!</p>
|
9
|
-
</form>
|
10
|
-
</template>
|
11
|
-
|
12
|
-
<script>
|
13
|
-
export default {
|
14
|
-
name: 'my-form',
|
15
|
-
|
16
|
-
props: {
|
17
|
-
onSuccess: {
|
18
|
-
type: Function,
|
19
|
-
},
|
20
|
-
},
|
21
|
-
|
22
|
-
data() {
|
23
|
-
return {
|
24
|
-
value: '',
|
25
|
-
complete: false,
|
26
|
-
};
|
27
|
-
},
|
28
|
-
|
29
|
-
methods: {
|
30
|
-
onSubmit() {
|
31
|
-
this.onSuccess(this.value);
|
32
|
-
setTimeout(() => {
|
33
|
-
this.complete = true;
|
34
|
-
}, 500);
|
35
|
-
setTimeout(() => {
|
36
|
-
this.complete = false;
|
37
|
-
}, 1500);
|
38
|
-
},
|
39
|
-
},
|
40
|
-
};
|
41
|
-
</script>
|
@@ -1,34 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<pre data-testid="pre" :style="style">{{ finalText }}</pre>
|
3
|
-
</template>
|
4
|
-
|
5
|
-
<script>
|
6
|
-
import { reactive, computed } from 'vue';
|
7
|
-
|
8
|
-
export default {
|
9
|
-
name: 'my-pre',
|
10
|
-
|
11
|
-
props: {
|
12
|
-
// deepscan-disable-next-line
|
13
|
-
style: {
|
14
|
-
type: Object,
|
15
|
-
},
|
16
|
-
object: {
|
17
|
-
type: Object,
|
18
|
-
},
|
19
|
-
text: {
|
20
|
-
type: String,
|
21
|
-
default: '',
|
22
|
-
},
|
23
|
-
},
|
24
|
-
|
25
|
-
setup(props, { emit }) {
|
26
|
-
props = reactive(props);
|
27
|
-
return {
|
28
|
-
finalText: computed(() =>
|
29
|
-
props.object ? JSON.stringify(props.object, null, 2) : props.text
|
30
|
-
),
|
31
|
-
};
|
32
|
-
},
|
33
|
-
};
|
34
|
-
</script>
|
@@ -1,30 +0,0 @@
|
|
1
|
-
.storybook-button {
|
2
|
-
font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
3
|
-
font-weight: 700;
|
4
|
-
border: 0;
|
5
|
-
border-radius: 3em;
|
6
|
-
cursor: pointer;
|
7
|
-
display: inline-block;
|
8
|
-
line-height: 1;
|
9
|
-
}
|
10
|
-
.storybook-button--primary {
|
11
|
-
color: white;
|
12
|
-
background-color: #1ea7fd;
|
13
|
-
}
|
14
|
-
.storybook-button--secondary {
|
15
|
-
color: #333;
|
16
|
-
background-color: transparent;
|
17
|
-
box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset;
|
18
|
-
}
|
19
|
-
.storybook-button--small {
|
20
|
-
font-size: 12px;
|
21
|
-
padding: 10px 16px;
|
22
|
-
}
|
23
|
-
.storybook-button--medium {
|
24
|
-
font-size: 14px;
|
25
|
-
padding: 11px 20px;
|
26
|
-
}
|
27
|
-
.storybook-button--large {
|
28
|
-
font-size: 16px;
|
29
|
-
padding: 12px 24px;
|
30
|
-
}
|
@@ -1,46 +0,0 @@
|
|
1
|
-
import { global as globalThis } from '@storybook/global';
|
2
|
-
import { Meta, Story, Canvas } from '@storybook/addon-docs';
|
3
|
-
|
4
|
-
<Meta title="stories/renderers/vue3/vue3-mdx" />
|
5
|
-
|
6
|
-
# Vue3-specific MDX Stories
|
7
|
-
|
8
|
-
export const Button = globalThis.Components.Button;
|
9
|
-
|
10
|
-
export const Template = (args, { argTypes }) => ({
|
11
|
-
components: { MyButton: Button },
|
12
|
-
template: '<my-button v-bind="args" />',
|
13
|
-
setup() {
|
14
|
-
return { args };
|
15
|
-
},
|
16
|
-
});
|
17
|
-
|
18
|
-
## Primary
|
19
|
-
|
20
|
-
<Canvas>
|
21
|
-
<Story name="Primary">
|
22
|
-
{{
|
23
|
-
components: { MyButton: Button },
|
24
|
-
template: '<my-button :primary="true" label="Primary button" />',
|
25
|
-
}}
|
26
|
-
</Story>
|
27
|
-
</Canvas>
|
28
|
-
|
29
|
-
## Secondary
|
30
|
-
|
31
|
-
<Canvas>
|
32
|
-
<Story name="Secondary">
|
33
|
-
{{
|
34
|
-
components: { MyButton: Button },
|
35
|
-
template: '<my-button :primary="false" label="Secondary button" />',
|
36
|
-
}}
|
37
|
-
</Story>
|
38
|
-
</Canvas>
|
39
|
-
|
40
|
-
## From template
|
41
|
-
|
42
|
-
<Canvas>
|
43
|
-
<Story name="From Template" args={{ label: 'From template' }}>
|
44
|
-
{Template.bind({})}
|
45
|
-
</Story>
|
46
|
-
</Canvas>
|
@@ -1,18 +0,0 @@
|
|
1
|
-
<script setup lang="ts">
|
2
|
-
defineProps({
|
3
|
-
label: String,
|
4
|
-
});
|
5
|
-
</script>
|
6
|
-
<template>
|
7
|
-
<div>
|
8
|
-
<header data-testid="header-slot">
|
9
|
-
<slot name="header" title="Header title from the slot"></slot>
|
10
|
-
</header>
|
11
|
-
<main data-testid="default-slot">
|
12
|
-
<slot></slot>
|
13
|
-
</main>
|
14
|
-
<footer data-testid="footer-slot">
|
15
|
-
<slot name="footer"></slot>
|
16
|
-
</footer>
|
17
|
-
</div>
|
18
|
-
</template>
|
@@ -1,32 +0,0 @@
|
|
1
|
-
import type { Meta } from '@storybook/vue3';
|
2
|
-
import { h } from 'vue';
|
3
|
-
import Reactivity from './Reactivity.vue';
|
4
|
-
import * as ReactiveDecorators from './ReactiveDecorators.stories';
|
5
|
-
|
6
|
-
const meta = {
|
7
|
-
...ReactiveDecorators.default,
|
8
|
-
component: Reactivity,
|
9
|
-
// storybook render function is not a functional component. it returns a functional component or a component options
|
10
|
-
render: (args) => {
|
11
|
-
// create the slot contents as a functional components
|
12
|
-
const header = ({ title }: { title: string }) => h('h3', `${args.header} - Title: ${title}`);
|
13
|
-
const defaultSlot = () => h('p', `${args.default}`);
|
14
|
-
const footer = () => h('p', `${args.footer}`);
|
15
|
-
// vue render function is a functional components
|
16
|
-
return () =>
|
17
|
-
h('div', [
|
18
|
-
`Custom render uses a functional component, and passes slots to the component:`,
|
19
|
-
h(Reactivity, args, { header, default: defaultSlot, footer }),
|
20
|
-
]);
|
21
|
-
},
|
22
|
-
} satisfies Meta<typeof Reactivity>;
|
23
|
-
|
24
|
-
export default meta;
|
25
|
-
|
26
|
-
export {
|
27
|
-
NoDecorators,
|
28
|
-
DecoratorFunctionalComponent,
|
29
|
-
DecoratorFunctionalComponentArgsFromContext,
|
30
|
-
DecoratorComponentOptions,
|
31
|
-
DecoratorComponentOptionsArgsFromData,
|
32
|
-
} from './ReactiveDecorators.stories';
|
@@ -1,45 +0,0 @@
|
|
1
|
-
import type { Meta } from '@storybook/vue3';
|
2
|
-
import { defineComponent, shallowReactive } from 'vue';
|
3
|
-
import Reactivity from './Reactivity.vue';
|
4
|
-
import * as ReactiveDecorators from './ReactiveDecorators.stories';
|
5
|
-
|
6
|
-
// when you use custom render, you can use any vue api to create your story and garanti reactivity, otherwise i can ease kill the reactivity.
|
7
|
-
const state = shallowReactive<{ header: any; default: any; footer: any }>({
|
8
|
-
header: '',
|
9
|
-
default: '',
|
10
|
-
footer: '',
|
11
|
-
}); // or reactive
|
12
|
-
|
13
|
-
const meta = {
|
14
|
-
...ReactiveDecorators.default,
|
15
|
-
component: Reactivity,
|
16
|
-
render: (args, { argTypes }) => {
|
17
|
-
state.header = args.header;
|
18
|
-
state.default = args.default;
|
19
|
-
state.footer = args.footer;
|
20
|
-
// return a component options
|
21
|
-
return defineComponent({
|
22
|
-
data: () => ({ args, header: state.header, default: state.default, footer: state.footer }),
|
23
|
-
components: {
|
24
|
-
Reactivity,
|
25
|
-
},
|
26
|
-
template: `<div>Custom render uses options api and binds args to data:
|
27
|
-
<Reactivity v-bind="args">
|
28
|
-
<template #header="{title}"><h3>{{ args.header }} - Title: {{ title }}</h3></template>
|
29
|
-
<template #default>{{ args.default }}</template>
|
30
|
-
<template #footer>{{ args.footer }} </template>
|
31
|
-
</Reactivity>
|
32
|
-
</div>`,
|
33
|
-
});
|
34
|
-
},
|
35
|
-
} satisfies Meta<typeof Reactivity>;
|
36
|
-
|
37
|
-
export default meta;
|
38
|
-
|
39
|
-
export {
|
40
|
-
NoDecorators,
|
41
|
-
DecoratorFunctionalComponent,
|
42
|
-
DecoratorFunctionalComponentArgsFromContext,
|
43
|
-
DecoratorComponentOptions,
|
44
|
-
DecoratorComponentOptionsArgsFromData,
|
45
|
-
} from './ReactiveDecorators.stories';
|
@@ -1,55 +0,0 @@
|
|
1
|
-
/// <reference types="jest" />
|
2
|
-
/// <reference types="testing-library__jest-dom" />
|
3
|
-
|
4
|
-
import { expect } from '@storybook/jest';
|
5
|
-
import type { Meta, StoryObj } from '@storybook/vue3';
|
6
|
-
import { within } from '@storybook/testing-library';
|
7
|
-
import { inject } from 'vue';
|
8
|
-
import GlobalSetup from './GlobalSetup.vue';
|
9
|
-
|
10
|
-
const meta: Meta = {
|
11
|
-
component: GlobalSetup,
|
12
|
-
argTypes: {},
|
13
|
-
render: (args: any) => ({
|
14
|
-
// Components used in your story `template` are defined in the `components` object
|
15
|
-
components: { GlobalUsage: GlobalSetup },
|
16
|
-
// The story's `args` need to be mapped into the template through the `setup()` method
|
17
|
-
setup() {
|
18
|
-
const color = inject('someColor', 'red'); // <-- this is the global setup from .storybook/preview.ts
|
19
|
-
return { args: { ...args, backgroundColor: color } };
|
20
|
-
},
|
21
|
-
// And then the `args` are bound to your component with `v-bind="args"`
|
22
|
-
template: '<global-usage v-bind="args" />',
|
23
|
-
}),
|
24
|
-
} satisfies Meta<typeof GlobalSetup>;
|
25
|
-
export default meta;
|
26
|
-
|
27
|
-
type Story = StoryObj<typeof meta>;
|
28
|
-
|
29
|
-
export const Primary: Story = {
|
30
|
-
args: {
|
31
|
-
primary: true,
|
32
|
-
label: 'someColor injected from .storybook/preview.ts',
|
33
|
-
},
|
34
|
-
play: async ({ canvasElement, id }) => {
|
35
|
-
const canvas = within(canvasElement);
|
36
|
-
|
37
|
-
const button = await canvas.getByRole('button');
|
38
|
-
await expect(button).toHaveStyle('background-color: rgb(0, 128, 0)'); // <-- this provide themeColor = green from .storybook/preview.ts
|
39
|
-
|
40
|
-
const h2 = await canvas.getByRole('heading', { level: 2 });
|
41
|
-
await expect(h2).toHaveTextContent('Hi Story! from some plugin your name is Primary!');
|
42
|
-
|
43
|
-
const h3 = await canvas.getByRole('heading', { level: 3 });
|
44
|
-
await expect(h3).toHaveTextContent('Hello Story! from some plugin your name is Primary!');
|
45
|
-
|
46
|
-
const h4 = await canvas.getByRole('heading', { level: 4 });
|
47
|
-
await expect(h4).toHaveTextContent('Welcome Story! from some plugin your name is Primary!');
|
48
|
-
},
|
49
|
-
};
|
50
|
-
|
51
|
-
export const Secondary: Story = {
|
52
|
-
args: {
|
53
|
-
label: 'someColor injected from .storybook/preview.ts',
|
54
|
-
},
|
55
|
-
};
|