@storybook/vue3 6.4.0-alpha.8 → 6.4.0-beta.10

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.
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "renderToDOM", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _render.renderToDOM;
10
+ }
11
+ });
12
+ exports.parameters = void 0;
13
+
14
+ var _render = require("./render");
15
+
16
+ var parameters = {
17
+ framework: 'vue3'
18
+ };
19
+ exports.parameters = parameters;
@@ -1,27 +1,5 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
-
5
- require("core-js/modules/es.object.keys.js");
6
-
7
- require("core-js/modules/es.symbol.js");
8
-
9
- require("core-js/modules/es.weak-map.js");
10
-
11
- require("core-js/modules/es.object.to-string.js");
12
-
13
- require("core-js/modules/es.string.iterator.js");
14
-
15
- require("core-js/modules/es.array.iterator.js");
16
-
17
- require("core-js/modules/web.dom-collections.iterator.js");
18
-
19
- require("core-js/modules/es.object.get-own-property-descriptor.js");
20
-
21
- require("core-js/modules/es.symbol.description.js");
22
-
23
- require("core-js/modules/es.symbol.iterator.js");
24
-
25
3
  Object.defineProperty(exports, "__esModule", {
26
4
  value: true
27
5
  });
@@ -31,25 +9,17 @@ require("core-js/modules/es.function.name.js");
31
9
 
32
10
  require("core-js/modules/es.object.assign.js");
33
11
 
34
- require("core-js/modules/es.array.reduce.js");
35
-
36
12
  require("core-js/modules/es.array.concat.js");
37
13
 
38
14
  var _vue = require("vue");
39
15
 
40
16
  var _client = require("@storybook/core/client");
41
17
 
42
- require("./globals");
43
-
44
- var _render = _interopRequireWildcard(require("./render"));
45
-
46
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
47
-
48
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
18
+ var _store = require("@storybook/store");
49
19
 
50
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
20
+ require("./globals");
51
21
 
52
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
22
+ var _render = require("./render");
53
23
 
54
24
  /*
55
25
  This normalizes a functional component into a render method in ComponentOptions.
@@ -86,28 +56,12 @@ function prepare(rawStory, innerStory) {
86
56
  };
87
57
  }
88
58
 
89
- var defaultContext = {
90
- id: 'unspecified',
91
- name: 'unspecified',
92
- kind: 'unspecified',
93
- parameters: {},
94
- args: {},
95
- argTypes: {},
96
- globals: {}
97
- };
98
-
99
59
  function decorateStory(storyFn, decorators) {
100
60
  return decorators.reduce(function (decorated, decorator) {
101
- return function () {
102
- var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultContext;
61
+ return function (context) {
103
62
  var story;
104
- var decoratedStory = decorator(function () {
105
- var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
106
-
107
- var parameters = _ref.parameters,
108
- innerContext = _objectWithoutProperties(_ref, ["parameters"]);
109
-
110
- story = decorated(Object.assign({}, context, innerContext));
63
+ var decoratedStory = decorator(function (update) {
64
+ story = decorated(Object.assign({}, context, (0, _store.sanitizeStoryContextUpdate)(update)));
111
65
  return story;
112
66
  }, context);
113
67
 
@@ -127,7 +81,7 @@ function decorateStory(storyFn, decorators) {
127
81
  }
128
82
 
129
83
  var framework = 'vue3';
130
- var api = (0, _client.start)(_render.default, {
84
+ var api = (0, _client.start)(_render.renderToDOM, {
131
85
  decorateStory: decorateStory
132
86
  });
133
87
 
@@ -7,7 +7,7 @@ require("core-js/modules/es.object.freeze.js");
7
7
  Object.defineProperty(exports, "__esModule", {
8
8
  value: true
9
9
  });
10
- exports.default = render;
10
+ exports.renderToDOM = renderToDOM;
11
11
  exports.storybookApp = void 0;
12
12
 
13
13
  require("core-js/modules/es.function.name.js");
@@ -40,21 +40,19 @@ var storybookApp = (0, _vue.createApp)({
40
40
  });
41
41
  exports.storybookApp = storybookApp;
42
42
 
43
- function render(_ref) {
44
- var storyFn = _ref.storyFn,
45
- kind = _ref.kind,
43
+ function renderToDOM(_ref, domElement) {
44
+ var title = _ref.title,
46
45
  name = _ref.name,
47
- args = _ref.args,
46
+ storyFn = _ref.storyFn,
48
47
  showMain = _ref.showMain,
49
48
  showError = _ref.showError,
50
- showException = _ref.showException,
51
- forceRender = _ref.forceRender;
49
+ showException = _ref.showException;
52
50
  storybookApp.config.errorHandler = showException;
53
51
  var element = storyFn();
54
52
 
55
53
  if (!element) {
56
54
  showError({
57
- title: "Expecting a Vue component from the story: \"".concat(name, "\" of \"").concat(kind, "\"."),
55
+ title: "Expecting a Vue component from the story: \"".concat(name, "\" of \"").concat(title, "\"."),
58
56
  description: (0, _tsDedent.default)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n Did you forget to return the Vue component from the story?\n Use \"() => ({ template: '<my-comp></my-comp>' })\" or \"() => ({ components: MyComp, template: '<my-comp></my-comp>' })\" when defining the story.\n "])))
59
57
  });
60
58
  return;
@@ -64,6 +62,6 @@ function render(_ref) {
64
62
  activeStoryComponent.value = element;
65
63
 
66
64
  if (!root) {
67
- root = storybookApp.mount('#root');
65
+ root = storybookApp.mount(domElement);
68
66
  }
69
67
  }
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,4 @@
1
+ export { renderToDOM } from './render';
2
+ export var parameters = {
3
+ framework: 'vue3'
4
+ };
@@ -1,17 +1,11 @@
1
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
2
-
3
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
4
-
5
1
  import "core-js/modules/es.function.name.js";
6
2
  import "core-js/modules/es.object.assign.js";
7
- import "core-js/modules/es.array.reduce.js";
8
3
  import "core-js/modules/es.array.concat.js";
9
- import "core-js/modules/es.object.keys.js";
10
- import "core-js/modules/es.symbol.js";
11
4
  import { h } from 'vue';
12
5
  import { start } from '@storybook/core/client';
6
+ import { sanitizeStoryContextUpdate } from '@storybook/store';
13
7
  import './globals';
14
- import render, { storybookApp } from './render';
8
+ import { renderToDOM, storybookApp } from './render';
15
9
  /*
16
10
  This normalizes a functional component into a render method in ComponentOptions.
17
11
 
@@ -48,28 +42,12 @@ function prepare(rawStory, innerStory) {
48
42
  };
49
43
  }
50
44
 
51
- var defaultContext = {
52
- id: 'unspecified',
53
- name: 'unspecified',
54
- kind: 'unspecified',
55
- parameters: {},
56
- args: {},
57
- argTypes: {},
58
- globals: {}
59
- };
60
-
61
45
  function decorateStory(storyFn, decorators) {
62
46
  return decorators.reduce(function (decorated, decorator) {
63
- return function () {
64
- var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultContext;
47
+ return function (context) {
65
48
  var story;
66
- var decoratedStory = decorator(function () {
67
- var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
68
-
69
- var parameters = _ref.parameters,
70
- innerContext = _objectWithoutProperties(_ref, ["parameters"]);
71
-
72
- story = decorated(Object.assign({}, context, innerContext));
49
+ var decoratedStory = decorator(function (update) {
50
+ story = decorated(Object.assign({}, context, sanitizeStoryContextUpdate(update)));
73
51
  return story;
74
52
  }, context);
75
53
 
@@ -89,7 +67,7 @@ function decorateStory(storyFn, decorators) {
89
67
  }
90
68
 
91
69
  var framework = 'vue3';
92
- var api = start(render, {
70
+ var api = start(renderToDOM, {
93
71
  decorateStory: decorateStory
94
72
  });
95
73
  export var storiesOf = function storiesOf(kind, m) {
@@ -22,21 +22,19 @@ export var storybookApp = createApp({
22
22
  };
23
23
  }
24
24
  });
25
- export default function render(_ref) {
26
- var storyFn = _ref.storyFn,
27
- kind = _ref.kind,
25
+ export function renderToDOM(_ref, domElement) {
26
+ var title = _ref.title,
28
27
  name = _ref.name,
29
- args = _ref.args,
28
+ storyFn = _ref.storyFn,
30
29
  showMain = _ref.showMain,
31
30
  showError = _ref.showError,
32
- showException = _ref.showException,
33
- forceRender = _ref.forceRender;
31
+ showException = _ref.showException;
34
32
  storybookApp.config.errorHandler = showException;
35
33
  var element = storyFn();
36
34
 
37
35
  if (!element) {
38
36
  showError({
39
- title: "Expecting a Vue component from the story: \"".concat(name, "\" of \"").concat(kind, "\"."),
37
+ title: "Expecting a Vue component from the story: \"".concat(name, "\" of \"").concat(title, "\"."),
40
38
  description: dedent(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n Did you forget to return the Vue component from the story?\n Use \"() => ({ template: '<my-comp></my-comp>' })\" or \"() => ({ components: MyComp, template: '<my-comp></my-comp>' })\" when defining the story.\n "])))
41
39
  });
42
40
  return;
@@ -46,6 +44,6 @@ export default function render(_ref) {
46
44
  activeStoryComponent.value = element;
47
45
 
48
46
  if (!root) {
49
- root = storybookApp.mount('#root');
47
+ root = storybookApp.mount(domElement);
50
48
  }
51
49
  }
File without changes
@@ -0,0 +1,4 @@
1
+ export { renderToDOM } from './render';
2
+ export const parameters = {
3
+ framework: 'vue3'
4
+ };
@@ -1,10 +1,9 @@
1
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
2
-
3
1
  import "core-js/modules/es.array.reduce.js";
4
2
  import { h } from 'vue';
5
3
  import { start } from '@storybook/core/client';
4
+ import { sanitizeStoryContextUpdate } from '@storybook/store';
6
5
  import './globals';
7
- import render, { storybookApp } from './render';
6
+ import { renderToDOM, storybookApp } from './render';
8
7
  /*
9
8
  This normalizes a functional component into a render method in ComponentOptions.
10
9
 
@@ -42,23 +41,11 @@ function prepare(rawStory, innerStory) {
42
41
  };
43
42
  }
44
43
 
45
- const defaultContext = {
46
- id: 'unspecified',
47
- name: 'unspecified',
48
- kind: 'unspecified',
49
- parameters: {},
50
- args: {},
51
- argTypes: {},
52
- globals: {}
53
- };
54
-
55
44
  function decorateStory(storyFn, decorators) {
56
- return decorators.reduce((decorated, decorator) => (context = defaultContext) => {
45
+ return decorators.reduce((decorated, decorator) => context => {
57
46
  let story;
58
- const decoratedStory = decorator((_ref = {}) => {
59
- let innerContext = _objectWithoutPropertiesLoose(_ref, ["parameters"]);
60
-
61
- story = decorated(Object.assign({}, context, innerContext));
47
+ const decoratedStory = decorator(update => {
48
+ story = decorated(Object.assign({}, context, sanitizeStoryContextUpdate(update)));
62
49
  return story;
63
50
  }, context);
64
51
 
@@ -75,7 +62,7 @@ function decorateStory(storyFn, decorators) {
75
62
  }
76
63
 
77
64
  const framework = 'vue3';
78
- const api = start(render, {
65
+ const api = start(renderToDOM, {
79
66
  decorateStory
80
67
  });
81
68
  export const storiesOf = (kind, m) => {
@@ -16,22 +16,20 @@ export const storybookApp = createApp({
16
16
  }
17
17
 
18
18
  });
19
- export default function render({
20
- storyFn,
21
- kind,
19
+ export function renderToDOM({
20
+ title,
22
21
  name,
23
- args,
22
+ storyFn,
24
23
  showMain,
25
24
  showError,
26
- showException,
27
- forceRender
28
- }) {
25
+ showException
26
+ }, domElement) {
29
27
  storybookApp.config.errorHandler = showException;
30
28
  const element = storyFn();
31
29
 
32
30
  if (!element) {
33
31
  showError({
34
- title: `Expecting a Vue component from the story: "${name}" of "${kind}".`,
32
+ title: `Expecting a Vue component from the story: "${name}" of "${title}".`,
35
33
  description: dedent`
36
34
  Did you forget to return the Vue component from the story?
37
35
  Use "() => ({ template: '<my-comp></my-comp>' })" or "() => ({ components: MyComp, template: '<my-comp></my-comp>' })" when defining the story.
@@ -44,6 +42,6 @@ export default function render({
44
42
  activeStoryComponent.value = element;
45
43
 
46
44
  if (!root) {
47
- root = storybookApp.mount('#root');
45
+ root = storybookApp.mount(domElement);
48
46
  }
49
47
  }
File without changes
@@ -0,0 +1,4 @@
1
+ export { renderToDOM } from './render';
2
+ export declare const parameters: {
3
+ framework: string;
4
+ };
@@ -1,10 +1,12 @@
1
1
  /// <reference types="webpack-env" />
2
2
  /// <reference types="node" />
3
3
  import { App } from 'vue';
4
- import { ClientStoryApi, DecoratorFunction, Loadable } from '@storybook/addons';
4
+ import { DecoratorFunction } from '@storybook/csf';
5
+ import { ClientStoryApi, Loadable } from '@storybook/addons';
5
6
  import './globals';
6
- import { IStorybookSection, StoryFnVueReturnType } from './types';
7
- interface ClientApi extends ClientStoryApi<StoryFnVueReturnType> {
7
+ import { IStorybookSection } from './types';
8
+ import { VueFramework } from './types-6-0';
9
+ interface ClientApi extends ClientStoryApi<VueFramework['storyResult']> {
8
10
  setAddon(addon: any): void;
9
11
  configure(loader: Loadable, module: NodeModule): void;
10
12
  getStorybook(): IStorybookSection[];
@@ -16,12 +18,15 @@ interface ClientApi extends ClientStoryApi<StoryFnVueReturnType> {
16
18
  }
17
19
  export declare const storiesOf: ClientApi['storiesOf'];
18
20
  export declare const configure: ClientApi['configure'];
19
- export declare const addDecorator: (decorator: DecoratorFunction<unknown>) => void;
20
- export declare const addParameters: (parameters: import("@storybook/addons").Parameters) => void;
21
+ export declare const addDecorator: (decorator: DecoratorFunction<VueFramework, import("@storybook/csf").Args>) => void;
22
+ export declare const addParameters: ({ globals, globalTypes, ...parameters }: import("@storybook/csf").Parameters & {
23
+ globals?: import("@storybook/csf").Globals;
24
+ globalTypes?: import("@storybook/csf").GlobalTypes;
25
+ }) => void;
21
26
  export declare const clearDecorators: () => void;
22
27
  export declare const setAddon: (addon: any) => void;
23
28
  export declare const forceReRender: () => void;
24
- export declare const getStorybook: () => import("@storybook/client-api").GetStorybookKind[];
25
- export declare const raw: () => import("@storybook/client-api").PublishedStoreItem[];
29
+ export declare const getStorybook: () => import("@storybook/client-api/dist/ts3.9/ClientApi").GetStorybookKind<VueFramework>[];
30
+ export declare const raw: () => import("@storybook/store").BoundStory<VueFramework>[];
26
31
  export declare const app: ClientApi['app'];
27
32
  export {};
@@ -1,3 +1,4 @@
1
- import { RenderContext } from './types';
1
+ import { RenderContext } from '@storybook/store';
2
+ import { VueFramework } from './types-6-0';
2
3
  export declare const storybookApp: import("vue").App<Element>;
3
- export default function render({ storyFn, kind, name, args, showMain, showError, showException, forceRender, }: RenderContext): void;
4
+ export declare function renderToDOM({ title, name, storyFn, showMain, showError, showException }: RenderContext<VueFramework>, domElement: HTMLElement): void;
@@ -1,19 +1,35 @@
1
1
  import { ConcreteComponent } from 'vue';
2
- import { Args as DefaultArgs, Annotations, BaseMeta, BaseStory } from '@storybook/addons';
2
+ import { Args, ComponentAnnotations, StoryAnnotations, AnnotatedStoryFn } from '@storybook/csf';
3
3
  import { StoryFnVueReturnType } from './types';
4
- export { Args, ArgTypes, Parameters, StoryContext } from '@storybook/addons';
5
- declare type VueComponent = ConcreteComponent<any>;
6
- declare type VueReturnType = StoryFnVueReturnType;
4
+ export { Args, ArgTypes, Parameters, StoryContext } from '@storybook/csf';
5
+ export declare type VueFramework = {
6
+ component: ConcreteComponent<any>;
7
+ storyResult: StoryFnVueReturnType;
8
+ };
7
9
  /**
8
10
  * Metadata to configure the stories for a component.
9
11
  *
10
12
  * @see [Default export](https://storybook.js.org/docs/formats/component-story-format/#default-export)
11
13
  */
12
- export declare type Meta<Args = DefaultArgs> = BaseMeta<VueComponent> & Annotations<Args, VueReturnType>;
14
+ export declare type Meta<TArgs = Args> = ComponentAnnotations<VueFramework, TArgs>;
13
15
  /**
14
- * Story function that represents a component example.
16
+ * Story function that represents a CSFv2 component example.
15
17
  *
16
18
  * @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
17
19
  */
18
- export declare type Story<Args = DefaultArgs> = BaseStory<Args, VueReturnType> & Annotations<Args, VueReturnType>;
19
- export declare type Decorators = Story['decorators'];
20
+ export declare type StoryFn<TArgs = Args> = AnnotatedStoryFn<VueFramework, TArgs>;
21
+ /**
22
+ * Story function that represents a CSFv3 component example.
23
+ *
24
+ * @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
25
+ */
26
+ export declare type StoryObj<TArgs = Args> = StoryAnnotations<VueFramework, TArgs>;
27
+ /**
28
+ * Story function that represents a CSFv2 component example.
29
+ *
30
+ * @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
31
+ *
32
+ * NOTE that in Storybook 7.0, this type will be renamed to `StoryFn` and replaced by the current `StoryObj` type.
33
+ *
34
+ */
35
+ export declare type Story<TArgs = Args> = StoryFn<TArgs>;
@@ -0,0 +1,9 @@
1
+ import { Args } from '@storybook/csf';
2
+ import { StoryObj } from './types-6-0';
3
+ export { StoryFn, StoryObj, Meta } from './types-6-0';
4
+ /**
5
+ * Story function that represents a CSFv3 component example.
6
+ *
7
+ * @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
8
+ */
9
+ export declare type Story<TArgs = Args> = StoryObj<TArgs>;
@@ -7,7 +7,7 @@ export interface ShowErrorArgs {
7
7
  export declare type StoryFnVueReturnType = ConcreteComponent<any>;
8
8
  export interface IStorybookStory {
9
9
  name: string;
10
- render: () => any;
10
+ render: (context: any) => any;
11
11
  }
12
12
  export interface IStorybookSection {
13
13
  kind: string;
@@ -0,0 +1,4 @@
1
+ export { renderToDOM } from './render';
2
+ export declare const parameters: {
3
+ framework: string;
4
+ };
@@ -1,10 +1,12 @@
1
1
  /// <reference types="webpack-env" />
2
2
  /// <reference types="node" />
3
3
  import type { App } from 'vue';
4
- import { ClientStoryApi, DecoratorFunction, Loadable } from '@storybook/addons';
4
+ import { DecoratorFunction } from '@storybook/csf';
5
+ import { ClientStoryApi, Loadable } from '@storybook/addons';
5
6
  import './globals';
6
- import { IStorybookSection, StoryFnVueReturnType } from './types';
7
- interface ClientApi extends ClientStoryApi<StoryFnVueReturnType> {
7
+ import { IStorybookSection } from './types';
8
+ import { VueFramework } from './types-6-0';
9
+ interface ClientApi extends ClientStoryApi<VueFramework['storyResult']> {
8
10
  setAddon(addon: any): void;
9
11
  configure(loader: Loadable, module: NodeModule): void;
10
12
  getStorybook(): IStorybookSection[];
@@ -16,12 +18,15 @@ interface ClientApi extends ClientStoryApi<StoryFnVueReturnType> {
16
18
  }
17
19
  export declare const storiesOf: ClientApi['storiesOf'];
18
20
  export declare const configure: ClientApi['configure'];
19
- export declare const addDecorator: (decorator: DecoratorFunction<unknown>) => void;
20
- export declare const addParameters: (parameters: import("@storybook/addons").Parameters) => void;
21
+ export declare const addDecorator: (decorator: DecoratorFunction<VueFramework, import("@storybook/csf").Args>) => void;
22
+ export declare const addParameters: ({ globals, globalTypes, ...parameters }: import("@storybook/csf").Parameters & {
23
+ globals?: import("@storybook/csf").Globals;
24
+ globalTypes?: import("@storybook/csf").GlobalTypes;
25
+ }) => void;
21
26
  export declare const clearDecorators: () => void;
22
27
  export declare const setAddon: (addon: any) => void;
23
28
  export declare const forceReRender: () => void;
24
- export declare const getStorybook: () => import("@storybook/client-api").GetStorybookKind[];
25
- export declare const raw: () => import("@storybook/client-api").PublishedStoreItem[];
29
+ export declare const getStorybook: () => import("@storybook/client-api/dist/ts3.9/ClientApi").GetStorybookKind<VueFramework>[];
30
+ export declare const raw: () => import("@storybook/store").BoundStory<VueFramework>[];
26
31
  export declare const app: ClientApi['app'];
27
32
  export {};
@@ -1,3 +1,4 @@
1
- import { RenderContext } from './types';
1
+ import { RenderContext } from '@storybook/store';
2
+ import { VueFramework } from './types-6-0';
2
3
  export declare const storybookApp: import("vue").App<Element>;
3
- export default function render({ storyFn, kind, name, args, showMain, showError, showException, forceRender, }: RenderContext): void;
4
+ export declare function renderToDOM({ title, name, storyFn, showMain, showError, showException }: RenderContext<VueFramework>, domElement: HTMLElement): void;
@@ -1,19 +1,35 @@
1
1
  import { ConcreteComponent } from 'vue';
2
- import { Args as DefaultArgs, Annotations, BaseMeta, BaseStory } from '@storybook/addons';
2
+ import { Args, ComponentAnnotations, StoryAnnotations, AnnotatedStoryFn } from '@storybook/csf';
3
3
  import { StoryFnVueReturnType } from './types';
4
- export type { Args, ArgTypes, Parameters, StoryContext } from '@storybook/addons';
5
- declare type VueComponent = ConcreteComponent<any>;
6
- declare type VueReturnType = StoryFnVueReturnType;
4
+ export type { Args, ArgTypes, Parameters, StoryContext } from '@storybook/csf';
5
+ export declare type VueFramework = {
6
+ component: ConcreteComponent<any>;
7
+ storyResult: StoryFnVueReturnType;
8
+ };
7
9
  /**
8
10
  * Metadata to configure the stories for a component.
9
11
  *
10
12
  * @see [Default export](https://storybook.js.org/docs/formats/component-story-format/#default-export)
11
13
  */
12
- export declare type Meta<Args = DefaultArgs> = BaseMeta<VueComponent> & Annotations<Args, VueReturnType>;
14
+ export declare type Meta<TArgs = Args> = ComponentAnnotations<VueFramework, TArgs>;
13
15
  /**
14
- * Story function that represents a component example.
16
+ * Story function that represents a CSFv2 component example.
15
17
  *
16
18
  * @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
17
19
  */
18
- export declare type Story<Args = DefaultArgs> = BaseStory<Args, VueReturnType> & Annotations<Args, VueReturnType>;
19
- export declare type Decorators = Story['decorators'];
20
+ export declare type StoryFn<TArgs = Args> = AnnotatedStoryFn<VueFramework, TArgs>;
21
+ /**
22
+ * Story function that represents a CSFv3 component example.
23
+ *
24
+ * @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
25
+ */
26
+ export declare type StoryObj<TArgs = Args> = StoryAnnotations<VueFramework, TArgs>;
27
+ /**
28
+ * Story function that represents a CSFv2 component example.
29
+ *
30
+ * @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
31
+ *
32
+ * NOTE that in Storybook 7.0, this type will be renamed to `StoryFn` and replaced by the current `StoryObj` type.
33
+ *
34
+ */
35
+ export declare type Story<TArgs = Args> = StoryFn<TArgs>;
@@ -0,0 +1,9 @@
1
+ import { Args } from '@storybook/csf';
2
+ import type { StoryObj } from './types-6-0';
3
+ export type { StoryFn, StoryObj, Meta } from './types-6-0';
4
+ /**
5
+ * Story function that represents a CSFv3 component example.
6
+ *
7
+ * @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
8
+ */
9
+ export declare type Story<TArgs = Args> = StoryObj<TArgs>;
@@ -7,7 +7,7 @@ export interface ShowErrorArgs {
7
7
  export declare type StoryFnVueReturnType = ConcreteComponent<any>;
8
8
  export interface IStorybookStory {
9
9
  name: string;
10
- render: () => any;
10
+ render: (context: any) => any;
11
11
  }
12
12
  export interface IStorybookSection {
13
13
  kind: string;
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@storybook/vue3",
3
- "version": "6.4.0-alpha.8",
3
+ "version": "6.4.0-beta.10",
4
4
  "description": "Storybook for Vue 3: Develop Vue 3 Components in isolation with Hot Reloading.",
5
5
  "keywords": [
6
6
  "storybook"
7
7
  ],
8
- "homepage": "https://github.com/storybookjs/storybook/tree/master/app/vue3",
8
+ "homepage": "https://github.com/storybookjs/storybook/tree/main/app/vue3",
9
9
  "bugs": {
10
10
  "url": "https://github.com/storybookjs/storybook/issues"
11
11
  },
@@ -24,7 +24,7 @@
24
24
  "types": "dist/ts3.9/client/index.d.ts",
25
25
  "typesVersions": {
26
26
  "<3.8": {
27
- "*": [
27
+ "dist/ts3.9/*": [
28
28
  "dist/ts3.4/*"
29
29
  ]
30
30
  }
@@ -45,9 +45,11 @@
45
45
  "prepare": "node ../../scripts/prepare.js"
46
46
  },
47
47
  "dependencies": {
48
- "@storybook/addons": "6.4.0-alpha.8",
49
- "@storybook/core": "6.4.0-alpha.8",
50
- "@storybook/core-common": "6.4.0-alpha.8",
48
+ "@storybook/addons": "6.4.0-beta.10",
49
+ "@storybook/core": "6.4.0-beta.10",
50
+ "@storybook/core-common": "6.4.0-beta.10",
51
+ "@storybook/csf": "0.0.2--canary.6aca495.0",
52
+ "@storybook/store": "6.4.0-beta.10",
51
53
  "@types/webpack-env": "^1.16.0",
52
54
  "core-js": "^3.8.2",
53
55
  "global": "^4.4.0",
@@ -79,6 +81,6 @@
79
81
  "publishConfig": {
80
82
  "access": "public"
81
83
  },
82
- "gitHead": "1ea7d55df3dc036f6ea091cb09cdc8f9512bda3d",
84
+ "gitHead": "9128cc184fa9771b332c1aabe85af6751dde890c",
83
85
  "sbmodern": "dist/modern/client/index.js"
84
86
  }
package/preset.js ADDED
@@ -0,0 +1,7 @@
1
+ function config(entry = []) {
2
+ return [...entry, require.resolve('./dist/esm/client/preview/config')];
3
+ }
4
+
5
+ module.exports = {
6
+ config,
7
+ };