@storybook/vue3 7.0.0-alpha.47 → 7.0.0-alpha.49
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-FOJXQP7G.mjs +4 -0
- package/dist/config.d.ts +3 -3
- package/dist/config.js +2 -2
- package/dist/config.mjs +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/index.mjs +1 -1
- package/dist/render-da0f65a2.d.ts +14 -0
- package/package.json +7 -7
- package/template/cli/Button.stories.js +2 -0
- package/template/cli/Header.stories.js +2 -0
- package/dist/chunk-K34XRZNP.mjs +0 -4
- package/dist/render-34473438.d.ts +0 -14
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{h as F}from"vue";import{sanitizeStoryContextUpdate as d}from"@storybook/store";function l(e){return typeof e=="function"?{render:e,name:e.name}:e}function s(e,t){let o=e;return o==null?null:t?{...l(o),components:{...o.components||{},story:t}}:{render(){return F(o)}}}function S(e,t){return t.reduce((o,m)=>p=>{let r,n=m(u=>(r=o({...p,...d(u)}),r),p);return r||(r=o(p)),n===r?r:s(n,r)},o=>s(e(o)))}import{dedent as w}from"ts-dedent";import{createApp as k,h as c}from"vue";var R=(e,t)=>{let{id:o,component:m}=t;if(!m)throw new Error(`Unable to render story ${o} as the component annotation is missing from the default export`);return c(m,e)},i=e=>{},A=e=>{i=e},a=new Map;function L({title:e,name:t,storyFn:o,showMain:m,showError:p,showException:r},n){let u,y=k({unmounted(){a.delete(n)},render(){return a.set(n,y),i(y),c(u)}});if(y.config.errorHandler=f=>r(f),u=o(),!u){p({title:`Expecting a Vue component from the story: "${t}" of "${e}".`,description:w`
|
|
2
|
+
Did you forget to return the Vue component from the story?
|
|
3
|
+
Use "() => ({ template: '<my-comp></my-comp>' })" or "() => ({ components: MyComp, template: '<my-comp></my-comp>' })" when defining the story.
|
|
4
|
+
`});return}m(),a.get(n)?.unmount(),y.mount(n)}export{S as a,R as b,A as c,L as d};
|
package/dist/config.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as lib_docs_tools_dist from 'lib/docs-tools/dist';
|
|
2
2
|
import * as lib_types_dist from 'lib/types/dist';
|
|
3
|
-
import { V as VueFramework } from './render-
|
|
4
|
-
export { r as render, a as
|
|
3
|
+
import { V as VueFramework } from './render-da0f65a2.js';
|
|
4
|
+
export { r as render, a as renderToCanvas } from './render-da0f65a2.js';
|
|
5
5
|
import { LegacyStoryFn, DecoratorFunction } from '@storybook/types';
|
|
6
6
|
import 'vue';
|
|
7
7
|
|
|
8
|
-
declare const argTypesEnhancers: (<TFramework extends lib_types_dist.
|
|
8
|
+
declare const argTypesEnhancers: (<TFramework extends lib_types_dist.Framework>(context: lib_types_dist.StoryContextForEnhancers<TFramework, lib_types_dist.Args>) => lib_types_dist.StrictArgTypes<lib_types_dist.Args>)[];
|
|
9
9
|
|
|
10
10
|
declare function decorateStory(storyFn: LegacyStoryFn<VueFramework>, decorators: DecoratorFunction<VueFramework>[]): LegacyStoryFn<VueFramework>;
|
|
11
11
|
|
package/dist/config.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var d=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var v=Object.prototype.hasOwnProperty;var D=(e,o)=>{for(var r in o)d(e,r,{get:o[r],enumerable:!0})},L=(e,o,r,p)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of b(o))!v.call(e,t)&&t!==r&&d(e,t,{get:()=>o[t],enumerable:!(p=R(o,t))||p.enumerable});return e};var O=e=>L(d({},"__esModule",{value:!0}),e);var P={};D(P,{applyDecorators:()=>T,argTypesEnhancers:()=>C,parameters:()=>M,render:()=>w,renderToCanvas:()=>x});module.exports=O(P);var i=require("@storybook/docs-tools");var u=require("@storybook/docs-tools"),U=["props","events","slots","methods"],F=e=>{if(!(0,u.hasDocgen)(e))return null;let o={};return U.forEach(r=>{(0,u.extractComponentProps)(e,r).forEach(({propDef:t,docgenInfo:n,jsDocTags:m})=>{let{name:s,type:a,description:c,defaultValue:f,required:A}=t,E=r==="props"?(0,u.convert)(n):{name:"void"};o[s]={name:s,description:c,type:{required:A,...E},table:{type:a,jsDocTags:m,defaultValue:f,category:r}}})}),o};var g={docs:{inlineStories:!0,extractArgTypes:F,extractComponentDescription:i.extractComponentDescription}},C=[i.enhanceArgTypes];var k=require("ts-dedent"),y=require("vue"),w=(e,o)=>{let{id:r,component:p}=o;if(!p)throw new Error(`Unable to render story ${r} as the component annotation is missing from the default export`);return(0,y.h)(p,e)},$=e=>{};var l=new Map;function x({title:e,name:o,storyFn:r,showMain:p,showError:t,showException:n},m){var c;let s,a=(0,y.createApp)({unmounted(){l.delete(m)},render(){return l.set(m,a),$(a),(0,y.h)(s)}});if(a.config.errorHandler=f=>n(f),s=r(),!s){t({title:`Expecting a Vue component from the story: "${o}" of "${e}".`,description:k.dedent`
|
|
2
2
|
Did you forget to return the Vue component from the story?
|
|
3
3
|
Use "() => ({ template: '<my-comp></my-comp>' })" or "() => ({ components: MyComp, template: '<my-comp></my-comp>' })" when defining the story.
|
|
4
|
-
`});return}p(),(c=
|
|
4
|
+
`});return}p(),(c=l.get(m))==null||c.unmount(),a.mount(m)}var V=require("vue"),h=require("@storybook/store");function z(e){return typeof e=="function"?{render:e,name:e.name}:e}function S(e,o){let r=e;return r==null?null:o?{...z(r),components:{...r.components||{},story:o}}:{render(){return(0,V.h)(r)}}}function T(e,o){return o.reduce((r,p)=>t=>{let n,m=p(s=>(n=r({...t,...(0,h.sanitizeStoryContextUpdate)(s)}),n),t);return n||(n=r(t)),m===n?n:S(m,n)},r=>S(e(r)))}var M={framework:"vue3",...g};0&&(module.exports={applyDecorators,argTypesEnhancers,parameters,render,renderToCanvas});
|
package/dist/config.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as l,b as u,d as x}from"./chunk-FOJXQP7G.mjs";import{extractComponentDescription as E,enhanceArgTypes as S}from"@storybook/docs-tools";import{hasDocgen as T,extractComponentProps as g,convert as h}from"@storybook/docs-tools";var A=["props","events","slots","methods"],s=e=>{if(!T(e))return null;let t={};return A.forEach(r=>{g(e,r).forEach(({propDef:a,docgenInfo:n,jsDocTags:c})=>{let{name:o,type:m,description:y,defaultValue:f,required:i}=a,d=r==="props"?h(n):{name:"void"};t[o]={name:o,description:y,type:{required:i,...d},table:{type:m,jsDocTags:c,defaultValue:f,category:r}}})}),t};var p={docs:{inlineStories:!0,extractArgTypes:s,extractComponentDescription:E}},v=[S];var w={framework:"vue3",...p};export{l as applyDecorators,v as argTypesEnhancers,w as parameters,u as render,x as renderToCanvas};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as _storybook_types from '@storybook/types';
|
|
2
2
|
import { Addon_ClientStoryApi, Addon_Loadable, Args, ComponentAnnotations, AnnotatedStoryFn, ArgsStoryFn, ArgsFromMeta, StoryAnnotations, DecoratorFunction } from '@storybook/types';
|
|
3
3
|
import { App, ComponentOptions, FunctionalComponent, ConcreteComponent } from 'vue';
|
|
4
|
-
import { V as VueFramework } from './render-
|
|
5
|
-
export { s as setup } from './render-
|
|
4
|
+
import { V as VueFramework } from './render-da0f65a2.js';
|
|
5
|
+
export { s as setup } from './render-da0f65a2.js';
|
|
6
6
|
import { Simplify, SetOptional } from 'type-fest';
|
|
7
7
|
|
|
8
8
|
interface ClientApi extends Addon_ClientStoryApi<VueFramework['storyResult']> {
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var v=Object.create;var s=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var _=Object.getPrototypeOf,
|
|
1
|
+
"use strict";var v=Object.create;var s=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var _=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var M=(e,o)=>{for(var r in o)s(e,r,{get:o[r],enumerable:!0})},f=(e,o,r,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of T(o))!E.call(e,t)&&t!==r&&s(e,t,{get:()=>o[t],enumerable:!(n=L(o,t))||n.enumerable});return e};var D=(e,o,r)=>(r=e!=null?v(_(e)):{},f(o||!e||!e.__esModule?s(r,"default",{value:e,enumerable:!0}):r,e)),U=e=>f(s({},"__esModule",{value:!0}),e);var H={};M(H,{configure:()=>N,forceReRender:()=>W,raw:()=>B,setup:()=>S,storiesOf:()=>K});module.exports=U(H);var l=D(require("global")),{window:$}=l.default;$.STORYBOOK_ENV="vue3";var x=require("@storybook/core-client");var w=require("vue"),C=require("@storybook/store");function z(e){return typeof e=="function"?{render:e,name:e.name}:e}function F(e,o){let r=e;return r==null?null:o?{...z(r),components:{...r.components||{},story:o}}:{render(){return(0,w.h)(r)}}}function k(e,o){return o.reduce((r,n)=>t=>{let p,m=n(i=>(p=r({...t,...(0,C.sanitizeStoryContextUpdate)(i)}),p),t);return p||(p=r(t)),m===p?p:F(m,p)},r=>F(e(r)))}var V=require("ts-dedent"),u=require("vue"),g=(e,o)=>{let{id:r,component:n}=o;if(!n)throw new Error(`Unable to render story ${r} as the component annotation is missing from the default export`);return(0,u.h)(n,e)},A=e=>{},S=e=>{A=e},c=new Map;function R({title:e,name:o,storyFn:r,showMain:n,showError:t,showException:p},m){var d;let i,a=(0,u.createApp)({unmounted(){c.delete(m)},render(){return c.set(m,a),A(a),(0,u.h)(i)}});if(a.config.errorHandler=b=>p(b),i=r(),!i){t({title:`Expecting a Vue component from the story: "${o}" of "${e}".`,description:V.dedent`
|
|
2
2
|
Did you forget to return the Vue component from the story?
|
|
3
3
|
Use "() => ({ template: '<my-comp></my-comp>' })" or "() => ({ components: MyComp, template: '<my-comp></my-comp>' })" when defining the story.
|
|
4
|
-
`});return}n(),(
|
|
4
|
+
`});return}n(),(d=c.get(m))==null||d.unmount(),a.mount(m)}var h="vue3",y=(0,x.start)(R,{decorateStory:k,render:g}),K=(e,o)=>y.clientApi.storiesOf(e,o).addParameters({framework:h}),N=(...e)=>y.configure(h,...e),{forceReRender:W}=y,{raw:B}=y.clientApi;var O;(O=module==null?void 0:module.hot)==null||O.decline();0&&(module.exports={configure,forceReRender,raw,setup,storiesOf});
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as r,b as t,c as d,d as i}from"./chunk-FOJXQP7G.mjs";import a from"global";var{window:s}=a;s.STORYBOOK_ENV="vue3";import{start as m}from"@storybook/core-client";var n="vue3",o=m(i,{decorateStory:r,render:t}),A=(e,p)=>o.clientApi.storiesOf(e,p).addParameters({framework:n}),y=(...e)=>o.configure(n,...e),{forceReRender:R}=o,{raw:w}=o.clientApi;module?.hot?.decline();export{y as configure,R as forceReRender,w as raw,d as setup,A as storiesOf};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { WebFramework, ArgsStoryFn, Store_RenderContext } from '@storybook/types';
|
|
2
|
+
import { ConcreteComponent } from 'vue';
|
|
3
|
+
|
|
4
|
+
declare type StoryFnVueReturnType = ConcreteComponent<any>;
|
|
5
|
+
interface VueFramework extends WebFramework {
|
|
6
|
+
component: Omit<ConcreteComponent<this['T']>, 'props'>;
|
|
7
|
+
storyResult: StoryFnVueReturnType;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
declare const render: ArgsStoryFn<VueFramework>;
|
|
11
|
+
declare const setup: (fn: (app: any) => void) => void;
|
|
12
|
+
declare function renderToCanvas({ title, name, storyFn, showMain, showError, showException }: Store_RenderContext<VueFramework>, canvasElement: VueFramework['canvasElement']): void;
|
|
13
|
+
|
|
14
|
+
export { VueFramework 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.0.0-alpha.
|
|
3
|
+
"version": "7.0.0-alpha.49",
|
|
4
4
|
"description": "Storybook Vue 3 renderer",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook"
|
|
@@ -51,11 +51,11 @@
|
|
|
51
51
|
"prep": "../../../scripts/prepare/bundle.ts"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@storybook/addons": "7.0.0-alpha.
|
|
55
|
-
"@storybook/core-client": "7.0.0-alpha.
|
|
56
|
-
"@storybook/docs-tools": "7.0.0-alpha.
|
|
57
|
-
"@storybook/store": "7.0.0-alpha.
|
|
58
|
-
"@storybook/types": "7.0.0-alpha.
|
|
54
|
+
"@storybook/addons": "7.0.0-alpha.49",
|
|
55
|
+
"@storybook/core-client": "7.0.0-alpha.49",
|
|
56
|
+
"@storybook/docs-tools": "7.0.0-alpha.49",
|
|
57
|
+
"@storybook/store": "7.0.0-alpha.49",
|
|
58
|
+
"@storybook/types": "7.0.0-alpha.49",
|
|
59
59
|
"global": "^4.4.0",
|
|
60
60
|
"react": "16.14.0",
|
|
61
61
|
"react-dom": "16.14.0",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
],
|
|
92
92
|
"platform": "browser"
|
|
93
93
|
},
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
|
95
95
|
}
|
|
@@ -4,6 +4,8 @@ import MyButton from './Button.vue';
|
|
|
4
4
|
export default {
|
|
5
5
|
title: 'Example/Button',
|
|
6
6
|
component: MyButton,
|
|
7
|
+
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/vue/writing-docs/docs-page
|
|
8
|
+
tags: ['docsPage'],
|
|
7
9
|
// More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args
|
|
8
10
|
render: (args) => ({
|
|
9
11
|
// Components used in your story `template` are defined in the `components` object
|
|
@@ -3,6 +3,8 @@ import MyHeader from './Header.vue';
|
|
|
3
3
|
export default {
|
|
4
4
|
title: 'Example/Header',
|
|
5
5
|
component: MyHeader,
|
|
6
|
+
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/vue/writing-docs/docs-page
|
|
7
|
+
tags: ['docsPage'],
|
|
6
8
|
render: (args) => ({
|
|
7
9
|
// Components used in your story `template` are defined in the `components` object
|
|
8
10
|
components: {
|
package/dist/chunk-K34XRZNP.mjs
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{h as l}from"vue";import{sanitizeStoryContextUpdate as d}from"@storybook/store";function w(e){return typeof e=="function"?{render:e,name:e.name}:e}function s(e,r){let o=e;return o==null?null:r?{...w(o),components:{...o.components||{},story:r}}:{render(){return l(o)}}}function g(e,r){return r.reduce((o,p)=>m=>{let t,n=p(u=>(t=o({...m,...d(u)}),t),m);return t||(t=o(m)),n===t?t:s(n,t)},o=>s(e(o)))}import{dedent as C}from"ts-dedent";import{createApp as k,h as c}from"vue";var A=(e,r)=>{let{id:o,component:p}=r;if(!p)throw new Error(`Unable to render story ${o} as the component annotation is missing from the default export`);return c(p,e)},i=e=>{},L=e=>{i=e},a=new Map;function b({title:e,name:r,storyFn:o,showMain:p,showError:m,showException:t},n){let u,y=k({unmounted(){a.delete(n)},render(){return a.set(n,y),i(y),c(u)}});if(y.config.errorHandler=f=>t(f),u=o(),!u){m({title:`Expecting a Vue component from the story: "${r}" of "${e}".`,description:C`
|
|
2
|
-
Did you forget to return the Vue component from the story?
|
|
3
|
-
Use "() => ({ template: '<my-comp></my-comp>' })" or "() => ({ components: MyComp, template: '<my-comp></my-comp>' })" when defining the story.
|
|
4
|
-
`});return}p(),a.get(n)?.unmount(),y.mount(n)}export{g as a,A as b,L as c,b as d};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { AnyFramework, ArgsStoryFn, Store_RenderContext } from '@storybook/types';
|
|
2
|
-
import { ConcreteComponent } from 'vue';
|
|
3
|
-
|
|
4
|
-
declare type StoryFnVueReturnType = ConcreteComponent<any>;
|
|
5
|
-
interface VueFramework extends AnyFramework {
|
|
6
|
-
component: Omit<ConcreteComponent<this['T']>, 'props'>;
|
|
7
|
-
storyResult: StoryFnVueReturnType;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
declare const render: ArgsStoryFn<VueFramework>;
|
|
11
|
-
declare const setup: (fn: (app: any) => void) => void;
|
|
12
|
-
declare function renderToDOM({ title, name, storyFn, showMain, showError, showException }: Store_RenderContext<VueFramework>, domElement: Element): void;
|
|
13
|
-
|
|
14
|
-
export { VueFramework as V, renderToDOM as a, render as r, setup as s };
|