@storybook/vue3 7.0.0-alpha.43 → 7.0.0-alpha.44
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-VOU3URBT.mjs +4 -0
- package/dist/config.d.ts +5 -6
- package/dist/config.js +2 -2
- package/dist/config.mjs +1 -1
- package/dist/index.d.ts +26 -17
- package/dist/index.js +2 -2
- package/dist/index.mjs +1 -1
- package/dist/{render-d27846a6.d.ts → render-34473438.d.ts} +5 -6
- package/package.json +12 -10
- package/dist/chunk-C4YTJRJQ.mjs +0 -4
|
@@ -0,0 +1,4 @@
|
|
|
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,t){let o=e;return o==null?null:t?{...w(o),components:{...o.components||{},story:t}}:{render(){return l(o)}}}function g(e,t){return t.reduce((o,p)=>m=>{let r,n=p(u=>(r=o({...m,...d(u)}),r),m);return r||(r=o(m)),n===r?r:s(n,r)},o=>s(e(o)))}import{dedent as C}from"ts-dedent";import{createApp as k,h as c}from"vue";var A=(e,t)=>{let{id:o,component:p}=t;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:t,storyFn:o,showMain:p,showError:m,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){m({title:`Expecting a Vue component from the story: "${t}" 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};
|
package/dist/config.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import * as lib_docs_tools_dist from 'lib/docs-tools/dist';
|
|
2
|
-
import * as
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import '@storybook/store';
|
|
2
|
+
import * as lib_types_dist from 'lib/types/dist';
|
|
3
|
+
import { V as VueFramework } from './render-34473438.js';
|
|
4
|
+
export { r as render, a as renderToDOM } from './render-34473438.js';
|
|
5
|
+
import { LegacyStoryFn, DecoratorFunction } from '@storybook/types';
|
|
7
6
|
import 'vue';
|
|
8
7
|
|
|
9
|
-
declare const argTypesEnhancers: (<TFramework extends
|
|
8
|
+
declare const argTypesEnhancers: (<TFramework extends lib_types_dist.AnyFramework>(context: lib_types_dist.StoryContextForEnhancers<TFramework, lib_types_dist.Args>) => lib_types_dist.StrictArgTypes<lib_types_dist.Args>)[];
|
|
10
9
|
|
|
11
10
|
declare function decorateStory(storyFn: LegacyStoryFn<VueFramework>, decorators: DecoratorFunction<VueFramework>[]): LegacyStoryFn<VueFramework>;
|
|
12
11
|
|
package/dist/config.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
"use strict";var l=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var D=Object.prototype.hasOwnProperty;var v=(e,o)=>{for(var r in o)l(e,r,{get:o[r],enumerable:!0})},O=(e,o,r,p)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of b(o))!D.call(e,t)&&t!==r&&l(e,t,{get:()=>o[t],enumerable:!(p=R(o,t))||p.enumerable});return e};var L=e=>O(l({},"__esModule",{value:!0}),e);var P={};v(P,{applyDecorators:()=>T,argTypesEnhancers:()=>x,parameters:()=>z,render:()=>S,renderToDOM:()=>k});module.exports=L(P);var i=require("@storybook/docs-tools");var u=require("@storybook/docs-tools"),M=["props","events","slots","methods"],F=e=>{if(!(0,u.hasDocgen)(e))return null;let o={};return M.forEach(r=>{(0,u.extractComponentProps)(e,r).forEach(({propDef:t,docgenInfo:n,jsDocTags:s})=>{let{name:m,type:a,description:c,defaultValue:f,required:A}=t,E=r==="props"?(0,u.convert)(n):{name:"void"};o[m]={name:m,description:c,type:{required:A,...E},table:{type:a,jsDocTags:s,defaultValue:f,category:r}}})}),o};var g={docs:{inlineStories:!0,extractArgTypes:F,extractComponentDescription:i.extractComponentDescription}},x=[i.enhanceArgTypes];var C=require("ts-dedent"),y=require("vue"),S=(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)},U=e=>{};var d=new Map;function k({title:e,name:o,storyFn:r,showMain:p,showError:t,showException:n},s){var c;let m,a=(0,y.createApp)({unmounted(){d.delete(s)},render(){return d.set(s,a),U(a),(0,y.h)(m)}});if(a.config.errorHandler=f=>n(f),m=r(),!m){t({title:`Expecting a Vue component from the story: "${o}" of "${e}".`,description:C.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(),
|
|
4
|
+
`});return}p(),(c=d.get(s))==null||c.unmount(),a.mount(s)}var V=require("vue"),h=require("@storybook/store");function $(e){return typeof e=="function"?{render:e,name:e.name}:e}function w(e,o){let r=e;return r==null?null:o?{...$(r),components:{...r.components||{},story:o}}:{render(){return(0,V.h)(r)}}}function T(e,o){return o.reduce((r,p)=>t=>{let n,s=p(m=>(n=r({...t,...(0,h.sanitizeStoryContextUpdate)(m)}),n),t);return n||(n=r(t)),s===n?n:w(s,n)},r=>w(e(r)))}var z={framework:"vue3",...g};0&&(module.exports={applyDecorators,argTypesEnhancers,parameters,render,renderToDOM});
|
package/dist/config.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as u,b as x,d as T}from"./chunk-
|
|
1
|
+
import{a as u,b as x,d as T}from"./chunk-VOU3URBT.mjs";import{extractComponentDescription as S,enhanceArgTypes as b}from"@storybook/docs-tools";import{hasDocgen as g,extractComponentProps as h,convert as A}from"@storybook/docs-tools";var E=["props","events","slots","methods"],p=e=>{if(!g(e))return null;let t={};return E.forEach(r=>{h(e,r).forEach(({propDef:c,docgenInfo:n,jsDocTags:m})=>{let{name:o,type:y,description:f,defaultValue:i,required:d}=c,l=r==="props"?A(n):{name:"void"};t[o]={name:o,description:f,type:{required:d,...l},table:{type:y,jsDocTags:m,defaultValue:i,category:r}}})}),t};var a={docs:{inlineStories:!0,extractArgTypes:p,extractComponentDescription:S}},v=[b];var w={framework:"vue3",...a};export{u as applyDecorators,v as argTypesEnhancers,w as parameters,x as render,T as renderToDOM};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { V as VueFramework } from './render-
|
|
5
|
-
export { s as setup } from './render-
|
|
6
|
-
import {
|
|
7
|
-
export { ArgTypes, Args, Parameters, StoryContext } from '@storybook/csf';
|
|
8
|
-
import '@storybook/store';
|
|
1
|
+
import * as _storybook_types from '@storybook/types';
|
|
2
|
+
import { Addon_ClientStoryApi, Addon_Loadable, Args, ComponentAnnotations, AnnotatedStoryFn, ArgsStoryFn, ArgsFromMeta, StoryAnnotations, DecoratorFunction } from '@storybook/types';
|
|
3
|
+
import { App, ComponentOptions, FunctionalComponent, ConcreteComponent } from 'vue';
|
|
4
|
+
import { V as VueFramework } from './render-34473438.js';
|
|
5
|
+
export { s as setup } from './render-34473438.js';
|
|
6
|
+
import { Simplify, SetOptional } from 'type-fest';
|
|
9
7
|
|
|
10
|
-
interface ClientApi extends
|
|
11
|
-
configure(loader:
|
|
8
|
+
interface ClientApi extends Addon_ClientStoryApi<VueFramework['storyResult']> {
|
|
9
|
+
configure(loader: Addon_Loadable, module: NodeModule): void;
|
|
12
10
|
forceReRender(): void;
|
|
13
11
|
raw: () => any;
|
|
14
12
|
load: (...args: any[]) => void;
|
|
@@ -17,31 +15,42 @@ interface ClientApi extends ClientStoryApi<VueFramework['storyResult']> {
|
|
|
17
15
|
declare const storiesOf: ClientApi['storiesOf'];
|
|
18
16
|
declare const configure: ClientApi['configure'];
|
|
19
17
|
declare const forceReRender: () => void;
|
|
20
|
-
declare const raw: ((...args: any[]) => never) | (() =>
|
|
18
|
+
declare const raw: ((...args: any[]) => never) | (() => _storybook_types.Store_BoundStory<VueFramework>[]);
|
|
21
19
|
|
|
22
20
|
/**
|
|
23
21
|
* Metadata to configure the stories for a component.
|
|
24
22
|
*
|
|
25
23
|
* @see [Default export](https://storybook.js.org/docs/formats/component-story-format/#default-export)
|
|
26
24
|
*/
|
|
27
|
-
declare type Meta<
|
|
25
|
+
declare type Meta<TCmpOrArgs = Args> = ComponentAnnotations<VueFramework, ComponentPropsOrProps<TCmpOrArgs>>;
|
|
28
26
|
/**
|
|
29
27
|
* Story function that represents a CSFv2 component example.
|
|
30
28
|
*
|
|
31
29
|
* @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
|
|
32
30
|
*/
|
|
33
|
-
declare type StoryFn<
|
|
31
|
+
declare type StoryFn<TCmpOrArgs = Args> = AnnotatedStoryFn<VueFramework, ComponentPropsOrProps<TCmpOrArgs>>;
|
|
34
32
|
/**
|
|
35
33
|
* Story function that represents a CSFv3 component example.
|
|
36
34
|
*
|
|
37
35
|
* @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
|
|
38
36
|
*/
|
|
39
|
-
declare type StoryObj<
|
|
37
|
+
declare type StoryObj<TMetaOrCmpOrArgs = Args> = TMetaOrCmpOrArgs extends {
|
|
38
|
+
render?: ArgsStoryFn<VueFramework, any>;
|
|
39
|
+
component?: infer Component;
|
|
40
|
+
args?: infer DefaultArgs;
|
|
41
|
+
} ? Simplify<ComponentProps<Component> & ArgsFromMeta<VueFramework, TMetaOrCmpOrArgs>> extends infer TArgs ? StoryAnnotations<VueFramework, TArgs, SetOptional<TArgs, Extract<keyof TArgs, keyof DefaultArgs>>> : never : StoryAnnotations<VueFramework, ComponentPropsOrProps<TMetaOrCmpOrArgs>>;
|
|
42
|
+
declare type ComponentProps<C> = C extends ComponentOptions<infer P> ? P : C extends FunctionalComponent<infer P> ? P : unknown;
|
|
43
|
+
declare type ComponentPropsOrProps<TCmpOrArgs> = TCmpOrArgs extends ConcreteComponent<any> ? unknown extends ComponentProps<TCmpOrArgs> ? TCmpOrArgs : ComponentProps<TCmpOrArgs> : TCmpOrArgs;
|
|
40
44
|
/**
|
|
41
|
-
*
|
|
45
|
+
* @deprecated Use `StoryFn` instead.
|
|
46
|
+
* Use `StoryObj` if you want to migrate to CSF3, which uses objects instead of functions to represent stories.
|
|
47
|
+
* You can read more about the CSF3 format here: https://storybook.js.org/blog/component-story-format-3-0/
|
|
48
|
+
*
|
|
49
|
+
* Story function that represents a CSFv2 component example.
|
|
42
50
|
*
|
|
43
51
|
* @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
|
|
44
52
|
*/
|
|
45
|
-
declare type Story<TArgs = Args> =
|
|
53
|
+
declare type Story<TArgs = Args> = StoryFn<TArgs>;
|
|
54
|
+
declare type DecoratorFn<TArgs = Args> = DecoratorFunction<VueFramework, TArgs>;
|
|
46
55
|
|
|
47
|
-
export { Meta, Story, StoryFn, StoryObj, configure, forceReRender, raw, storiesOf };
|
|
56
|
+
export { DecoratorFn, Meta, Story, StoryFn, StoryObj, configure, forceReRender, raw, storiesOf };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
"use strict";var v=Object.create;var s=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var _=Object.getPrototypeOf,M=Object.prototype.hasOwnProperty;var D=(e,o)=>{for(var r in o)s(e,r,{get:o[r],enumerable:!0})},d=(e,o,r,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of T(o))!M.call(e,t)&&t!==r&&s(e,t,{get:()=>o[t],enumerable:!(n=L(o,t))||n.enumerable});return e};var E=(e,o,r)=>(r=e!=null?v(_(e)):{},d(o||!e||!e.__esModule?s(r,"default",{value:e,enumerable:!0}):r,e)),U=e=>d(s({},"__esModule",{value:!0}),e);var H={};D(H,{configure:()=>N,forceReRender:()=>W,raw:()=>B,setup:()=>S,storiesOf:()=>K});module.exports=U(H);var l=E(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 f;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(),(f=c.get(m))==null||f.unmount(),a.mount(m)}var O="vue3",y=(0,x.start)(R,{decorateStory:k,render:g}),K=(e,o)=>y.clientApi.storiesOf(e,o).addParameters({framework:O}),N=(...e)=>y.configure(O,...e),{forceReRender:W}=y,{raw:B}=y.clientApi;var h;(h=module==null?void 0:module.hot)==null||h.decline();0&&(module.exports={configure,forceReRender,raw,setup,storiesOf});
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t,b as n,c as
|
|
1
|
+
import{a as t,b as n,c as i,d as p}from"./chunk-VOU3URBT.mjs";import a from"global";var{window:A}=a;A.STORYBOOK_ENV="vue3";import{start as y}from"@storybook/core-client";var s="vue3",o=y(p,{decorateStory:t,render:n}),O=(r,m)=>o.clientApi.storiesOf(r,m).addParameters({framework:s}),u=(...r)=>o.configure(s,...r),{forceReRender:c}=o,{raw:l}=o.clientApi;module?.hot?.decline();export{u as configure,c as forceReRender,l as raw,i as setup,O as storiesOf};
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ArgsStoryFn } from '@storybook/csf';
|
|
1
|
+
import { AnyFramework, ArgsStoryFn, Store_RenderContext } from '@storybook/types';
|
|
3
2
|
import { ConcreteComponent } from 'vue';
|
|
4
3
|
|
|
5
4
|
declare type StoryFnVueReturnType = ConcreteComponent<any>;
|
|
6
|
-
|
|
7
|
-
component: ConcreteComponent<
|
|
5
|
+
interface VueFramework extends AnyFramework {
|
|
6
|
+
component: Omit<ConcreteComponent<this['T']>, 'props'>;
|
|
8
7
|
storyResult: StoryFnVueReturnType;
|
|
9
|
-
}
|
|
8
|
+
}
|
|
10
9
|
|
|
11
10
|
declare const render: ArgsStoryFn<VueFramework>;
|
|
12
11
|
declare const setup: (fn: (app: any) => void) => void;
|
|
13
|
-
declare function renderToDOM({ title, name, storyFn, showMain, showError, showException }:
|
|
12
|
+
declare function renderToDOM({ title, name, storyFn, showMain, showError, showException }: Store_RenderContext<VueFramework>, domElement: Element): void;
|
|
14
13
|
|
|
15
14
|
export { VueFramework as V, renderToDOM 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.44",
|
|
4
4
|
"description": "Storybook Vue 3 renderer",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook"
|
|
@@ -46,24 +46,26 @@
|
|
|
46
46
|
"*.d.ts"
|
|
47
47
|
],
|
|
48
48
|
"scripts": {
|
|
49
|
-
"check": "
|
|
49
|
+
"check": "vue-tsc --noEmit",
|
|
50
50
|
"prep": "../../../scripts/prepare/bundle.ts"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@storybook/addons": "7.0.0-alpha.
|
|
54
|
-
"@storybook/core-client": "7.0.0-alpha.
|
|
55
|
-
"@storybook/
|
|
56
|
-
"@storybook/
|
|
57
|
-
"@storybook/
|
|
53
|
+
"@storybook/addons": "7.0.0-alpha.44",
|
|
54
|
+
"@storybook/core-client": "7.0.0-alpha.44",
|
|
55
|
+
"@storybook/docs-tools": "7.0.0-alpha.44",
|
|
56
|
+
"@storybook/store": "7.0.0-alpha.44",
|
|
57
|
+
"@storybook/types": "7.0.0-alpha.44",
|
|
58
58
|
"global": "^4.4.0",
|
|
59
59
|
"react": "16.14.0",
|
|
60
60
|
"react-dom": "16.14.0",
|
|
61
|
-
"ts-dedent": "^2.0.0"
|
|
61
|
+
"ts-dedent": "^2.0.0",
|
|
62
|
+
"type-fest": "2.19.0"
|
|
62
63
|
},
|
|
63
64
|
"devDependencies": {
|
|
64
65
|
"@digitak/esrun": "^3.2.2",
|
|
65
66
|
"typescript": "~4.6.3",
|
|
66
|
-
"vue": "^3.
|
|
67
|
+
"vue": "^3.2.41",
|
|
68
|
+
"vue-tsc": "^1.0.8"
|
|
67
69
|
},
|
|
68
70
|
"peerDependencies": {
|
|
69
71
|
"@babel/core": "*",
|
|
@@ -88,5 +90,5 @@
|
|
|
88
90
|
],
|
|
89
91
|
"platform": "browser"
|
|
90
92
|
},
|
|
91
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "d4965bd328d8f83c279560c7bc8428e490b275f3"
|
|
92
94
|
}
|
package/dist/chunk-C4YTJRJQ.mjs
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{h as F}from"vue";import{sanitizeStoryContextUpdate as l}from"@storybook/store";function C(e){return typeof e=="function"?{render:e,name:e.name}:e}function s(e,t){let o=e;return o==null?null:t?{...C(o),components:{...o.components||{},story:t}}:{render(){return F(o)}}}function g(e,t){return t.reduce((o,p)=>m=>{let r,n=p(u=>(r=o({...m,...l(u)}),r),m);return r||(r=o(m)),n===r?r:s(n,r)},o=>s(e(o)))}import{dedent as d}from"ts-dedent";import{createApp as k,h as c}from"vue";var R=(e,t)=>{let{id:o,component:p}=t;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=>{},b=e=>{i=e},y=new Map;function A({title:e,name:t,storyFn:o,showMain:p,showError:m,showException:r},n){let u,a=k({unmounted(){y.delete(n)},render(){return y.set(n,a),i(a),c(u)}});if(a.config.errorHandler=r,u=o(),!u){m({title:`Expecting a Vue component from the story: "${t}" of "${e}".`,description:d`
|
|
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(),y.has(n)&&y.get(n).unmount(),a.mount(n)}export{g as a,R as b,b as c,A as d};
|