@storybook/vue3 7.0.11 → 7.0.13
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/config.js +1 -1
- package/dist/config.mjs +1 -1
- package/package.json +6 -6
package/dist/config.js
CHANGED
@@ -40,7 +40,7 @@ ${namedSlotContents}
|
|
40
40
|
${childrenSource}
|
41
41
|
</${name}>`}return`<${name} ${props}/>`},components=isArray(compOrComps)?compOrComps:[compOrComps];return Object.keys(components).map(key=>`${generateComponentSource(components[key])}`).join(`
|
42
42
|
`)}function createNamedSlots(slotArgs,slotProps,byRef){if(!slotArgs)return"";let many=slotProps.length>1;return slotArgs.map(([key,value])=>{let content=byRef?`{{ ${key} }}`:JSON.stringify(value);return many?` <template #${key}>${content}</template>`:` ${content}`}).join(`
|
43
|
-
`)}function getArgsInAttrs(args,attributes){return Object.keys(args).reduce((acc,prop)=>{attributes!=null&&attributes.find(attr=>attr.name==="v-bind")&&(acc[prop]=args[prop]);let attribute=attributes==null?void 0:attributes.find(attr=>attr.name===prop||attr.name===`:${prop}`);return attribute&&(acc[prop]=attribute.name===`:${prop}`?args[prop]:attribute.value),Object.keys(acc).length===0&&(attributes==null||attributes.forEach(attr=>{acc[attr.name]=JSON.parse(JSON.stringify(attr.value))})),acc},{})}var sourceDecorator=(storyFn,context)=>{var _a,_b,_c;let channel=import_preview_api.addons.getChannel(),skip=skipSourceRender(context),story=storyFn(),source;if((0,import_preview_api.useEffect)(()=>{if(!skip&&source){let{id,
|
43
|
+
`)}function getArgsInAttrs(args,attributes){return Object.keys(args).reduce((acc,prop)=>{attributes!=null&&attributes.find(attr=>attr.name==="v-bind")&&(acc[prop]=args[prop]);let attribute=attributes==null?void 0:attributes.find(attr=>attr.name===prop||attr.name===`:${prop}`);return attribute&&(acc[prop]=attribute.name===`:${prop}`?args[prop]:attribute.value),Object.keys(acc).length===0&&(attributes==null||attributes.forEach(attr=>{acc[attr.name]=JSON.parse(JSON.stringify(attr.value))})),acc},{})}var sourceDecorator=(storyFn,context)=>{var _a,_b,_c;let channel=import_preview_api.addons.getChannel(),skip=skipSourceRender(context),story=storyFn(),source;if((0,import_preview_api.useEffect)(()=>{if(!skip&&source){let{id,unmappedArgs}=context;channel.emit(import_docs_tools2.SNIPPET_RENDERED,{id,args:unmappedArgs,source,format:"vue"})}}),skip)return story;let{args={},component:ctxtComponent,argTypes={}}=context||{},components=getTemplates(context==null?void 0:context.originalStoryFn),storyComponent=components.length?components:ctxtComponent,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(args,argTypes,components):"",generatedTemplate=generateSource(storyComponent,args,argTypes,withScript);return generatedTemplate&&(source=`${generatedScript}
|
44
44
|
<template>
|
45
45
|
${generatedTemplate}
|
46
46
|
</template>`),story};var parameters={docs:{story:{inline:!0},extractArgTypes,extractComponentDescription:import_docs_tools3.extractComponentDescription}},decorators=[sourceDecorator],argTypesEnhancers=[import_docs_tools3.enhanceArgTypes];var import_vue=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_vue.h)(Component,props,getSlots(props,context))},setupFunction=_app=>{};var map=new Map,elementMap=new Map;function renderToCanvas({storyFn,forceRemount,showMain,showException,storyContext},canvasElement){var _a;storyContext.args=(0,import_vue.reactive)(storyContext.args);let element=storyFn();elementMap.set(canvasElement,element);let props=(_a=element.render)==null?void 0:_a.call(element).props,reactiveArgs=props?(0,import_vue.reactive)(props):storyContext.args,existingApp=map.get(canvasElement);if(existingApp&&!forceRemount)return updateArgs(existingApp.reactiveArgs,reactiveArgs),()=>{teardown(existingApp.vueApp,canvasElement)};existingApp&&forceRemount&&teardown(existingApp.vueApp,canvasElement);let storybookApp=(0,import_vue.createApp)({render(){let renderedElement=elementMap.get(canvasElement),current=renderedElement&&renderedElement.template?renderedElement:element;return map.set(canvasElement,{vueApp:storybookApp,reactiveArgs}),(0,import_vue.h)(current,reactiveArgs)}});return storybookApp.config.errorHandler=e=>showException(e),setupFunction(storybookApp),storybookApp.mount(canvasElement),showMain(),()=>{teardown(storybookApp,canvasElement)}}function getSlots(props,context){let{argTypes}=context,slots=Object.entries(props).filter(([key,value])=>{var _a,_b;return((_b=(_a=argTypes[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 updateArgs(reactiveArgs,nextArgs){nextArgs&&(Object.keys(reactiveArgs).forEach(key=>{delete reactiveArgs[key]}),Object.assign(reactiveArgs,nextArgs))}function teardown(storybookApp,canvasElement){storybookApp==null||storybookApp.unmount(),map.has(canvasElement)&&map.delete(canvasElement)}var import_vue2=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:innerStory?{...normalizeFunctionalComponent(story),components:{...story.components||{},story:innerStory}}:{render(){return(0,import_vue2.h)(story)}}}function decorateStory(storyFn,decorators2){return decorators2.reduce((decorated,decorator)=>context=>{let story,decoratedStory=decorator(update=>(story=decorated({...context,...(0,import_preview_api2.sanitizeStoryContextUpdate)(update)}),story),context);return story||(story=decorated(context)),decoratedStory===story?story:prepare(decoratedStory,(0,import_vue2.h)(story,context.args))},context=>prepare(storyFn(context)))}var parameters2={renderer:"vue3",...parameters};0&&(module.exports={applyDecorators,argTypesEnhancers,decorators,parameters,render,renderToCanvas});
|
package/dist/config.mjs
CHANGED
@@ -45,7 +45,7 @@ ${namedSlotContents}
|
|
45
45
|
${childrenSource}
|
46
46
|
</${name}>`}return `<${name} ${props}/>`},components=isArray(compOrComps)?compOrComps:[compOrComps];return Object.keys(components).map(key=>`${generateComponentSource(components[key])}`).join(`
|
47
47
|
`)}function createNamedSlots(slotArgs,slotProps,byRef){if(!slotArgs)return "";let many=slotProps.length>1;return slotArgs.map(([key,value])=>{let content=byRef?`{{ ${key} }}`:JSON.stringify(value);return many?` <template #${key}>${content}</template>`:` ${content}`}).join(`
|
48
|
-
`)}function getArgsInAttrs(args,attributes){return Object.keys(args).reduce((acc,prop)=>{attributes?.find(attr=>attr.name==="v-bind")&&(acc[prop]=args[prop]);let attribute=attributes?.find(attr=>attr.name===prop||attr.name===`:${prop}`);return attribute&&(acc[prop]=attribute.name===`:${prop}`?args[prop]:attribute.value),Object.keys(acc).length===0&&attributes?.forEach(attr=>{acc[attr.name]=JSON.parse(JSON.stringify(attr.value));}),acc},{})}var sourceDecorator=(storyFn,context)=>{let channel=addons.getChannel(),skip=skipSourceRender(context),story=storyFn(),source;if(useEffect(()=>{if(!skip&&source){let{id,
|
48
|
+
`)}function getArgsInAttrs(args,attributes){return Object.keys(args).reduce((acc,prop)=>{attributes?.find(attr=>attr.name==="v-bind")&&(acc[prop]=args[prop]);let attribute=attributes?.find(attr=>attr.name===prop||attr.name===`:${prop}`);return attribute&&(acc[prop]=attribute.name===`:${prop}`?args[prop]:attribute.value),Object.keys(acc).length===0&&attributes?.forEach(attr=>{acc[attr.name]=JSON.parse(JSON.stringify(attr.value));}),acc},{})}var sourceDecorator=(storyFn,context)=>{let channel=addons.getChannel(),skip=skipSourceRender(context),story=storyFn(),source;if(useEffect(()=>{if(!skip&&source){let{id,unmappedArgs}=context;channel.emit(SNIPPET_RENDERED,{id,args:unmappedArgs,source,format:"vue"});}}),skip)return story;let{args={},component:ctxtComponent,argTypes={}}=context||{},components=getTemplates(context?.originalStoryFn),storyComponent=components.length?components:ctxtComponent,withScript=context?.parameters?.docs?.source?.withScriptSetup||!1,generatedScript=withScript?generateScriptSetup(args):"",generatedTemplate=generateSource(storyComponent,args,argTypes,withScript);return generatedTemplate&&(source=`${generatedScript}
|
49
49
|
<template>
|
50
50
|
${generatedTemplate}
|
51
51
|
</template>`),story};var parameters={docs:{story:{inline:!0},extractArgTypes,extractComponentDescription}},decorators=[sourceDecorator],argTypesEnhancers=[enhanceArgTypes];var parameters2={renderer:"vue3",...parameters};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@storybook/vue3",
|
3
|
-
"version": "7.0.
|
3
|
+
"version": "7.0.13",
|
4
4
|
"description": "Storybook Vue 3 renderer",
|
5
5
|
"keywords": [
|
6
6
|
"storybook"
|
@@ -48,11 +48,11 @@
|
|
48
48
|
"prep": "../../../scripts/prepare/bundle.ts"
|
49
49
|
},
|
50
50
|
"dependencies": {
|
51
|
-
"@storybook/core-client": "7.0.
|
52
|
-
"@storybook/docs-tools": "7.0.
|
51
|
+
"@storybook/core-client": "7.0.13",
|
52
|
+
"@storybook/docs-tools": "7.0.13",
|
53
53
|
"@storybook/global": "^5.0.0",
|
54
|
-
"@storybook/preview-api": "7.0.
|
55
|
-
"@storybook/types": "7.0.
|
54
|
+
"@storybook/preview-api": "7.0.13",
|
55
|
+
"@storybook/types": "7.0.13",
|
56
56
|
"ts-dedent": "^2.0.0",
|
57
57
|
"type-fest": "2.19.0"
|
58
58
|
},
|
@@ -80,5 +80,5 @@
|
|
80
80
|
],
|
81
81
|
"platform": "browser"
|
82
82
|
},
|
83
|
-
"gitHead": "
|
83
|
+
"gitHead": "23e292c67f790fc23e04b97aa0af1dc5e2c0d16a"
|
84
84
|
}
|