@storybook/vue3 6.5.7 → 7.0.0-alpha.0
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/README.md +1 -43
- package/dist/cjs/config.js +44 -0
- package/dist/cjs/{client/docs → docs}/config.js +0 -0
- package/dist/cjs/{client/docs → docs}/extractArgTypes.js +0 -0
- package/dist/cjs/{client/docs → docs}/prepareForInline.js +0 -0
- package/dist/cjs/{client/index.js → index.js} +4 -3
- package/dist/cjs/{client/preview → preview}/config.js +0 -0
- package/dist/cjs/{client/preview → preview}/decorateStory.js +0 -0
- package/dist/cjs/{client/preview → preview}/globals.js +0 -0
- package/dist/cjs/{client/preview → preview}/index.js +2 -2
- package/dist/cjs/{client/preview → preview}/render.js +0 -0
- package/dist/cjs/{client/preview → preview}/types-6-0.js +0 -0
- package/dist/cjs/{client/preview → preview}/types-7-0.js +0 -0
- package/dist/cjs/{client/preview → preview}/types.js +0 -0
- package/dist/esm/config.js +6 -0
- package/dist/{modern/client → esm}/docs/config.js +0 -0
- package/dist/{modern/client → esm}/docs/extractArgTypes.js +0 -0
- package/dist/{modern/client → esm}/docs/prepareForInline.js +0 -0
- package/dist/{modern/client → esm}/index.js +2 -4
- package/dist/{modern/client → esm}/preview/config.js +0 -0
- package/dist/{modern/client → esm}/preview/decorateStory.js +0 -1
- package/dist/{modern/client → esm}/preview/globals.js +0 -0
- package/dist/{modern/client → esm}/preview/index.js +1 -1
- package/dist/{modern/client → esm}/preview/render.js +0 -0
- package/dist/esm/{client/preview → preview}/types-6-0.js +0 -0
- package/dist/esm/{client/preview → preview}/types-7-0.js +0 -0
- package/dist/esm/{client/preview → preview}/types.js +0 -0
- package/dist/types/config.d.ts +11 -0
- package/dist/{ts3.9/client → types}/docs/config.d.ts +1 -1
- package/dist/{ts3.9/client → types}/docs/extractArgTypes.d.ts +0 -0
- package/dist/{ts3.9/client → types}/docs/prepareForInline.d.ts +0 -0
- package/dist/{ts3.9/client → types}/index.d.ts +0 -0
- package/dist/{ts3.9/client → types}/preview/config.d.ts +0 -0
- package/dist/{ts3.9/client → types}/preview/decorateStory.d.ts +0 -0
- package/dist/{ts3.9/client → types}/preview/globals.d.ts +0 -0
- package/dist/{ts3.9/client → types}/preview/index.d.ts +2 -2
- package/dist/{ts3.9/client → types}/preview/render.d.ts +1 -1
- package/dist/{ts3.9/client → types}/preview/types-6-0.d.ts +0 -0
- package/dist/{ts3.9/client → types}/preview/types-7-0.d.ts +0 -0
- package/dist/{ts3.9/client → types}/preview/types.d.ts +1 -1
- package/package.json +14 -39
- package/preview.js +1 -0
- package/bin/build.js +0 -4
- package/bin/index.js +0 -3
- package/dist/cjs/server/build.js +0 -9
- package/dist/cjs/server/framework-preset-vue3-docs.js +0 -50
- package/dist/cjs/server/framework-preset-vue3.js +0 -66
- package/dist/cjs/server/index.js +0 -9
- package/dist/cjs/server/options.js +0 -17
- package/dist/cjs/server/preset.js +0 -8
- package/dist/esm/client/docs/config.js +0 -12
- package/dist/esm/client/docs/extractArgTypes.js +0 -45
- package/dist/esm/client/docs/prepareForInline.js +0 -22
- package/dist/esm/client/index.js +0 -6
- package/dist/esm/client/preview/config.js +0 -5
- package/dist/esm/client/preview/decorateStory.js +0 -64
- package/dist/esm/client/preview/globals.js +0 -4
- package/dist/esm/client/preview/index.js +0 -38
- package/dist/esm/client/preview/render.js +0 -60
- package/dist/esm/server/build.js +0 -3
- package/dist/esm/server/framework-preset-vue3-docs.js +0 -37
- package/dist/esm/server/framework-preset-vue3.js +0 -52
- package/dist/esm/server/index.js +0 -3
- package/dist/esm/server/options.js +0 -8
- package/dist/esm/server/preset.js +0 -1
- package/dist/modern/client/preview/types-6-0.js +0 -1
- package/dist/modern/client/preview/types-7-0.js +0 -1
- package/dist/modern/client/preview/types.js +0 -1
- package/dist/modern/server/build.js +0 -3
- package/dist/modern/server/framework-preset-vue3-docs.js +0 -37
- package/dist/modern/server/framework-preset-vue3.js +0 -52
- package/dist/modern/server/index.js +0 -3
- package/dist/modern/server/options.js +0 -8
- package/dist/modern/server/preset.js +0 -1
- package/dist/ts3.4/client/docs/config.d.ts +0 -10
- package/dist/ts3.4/client/docs/extractArgTypes.d.ts +0 -2
- package/dist/ts3.4/client/docs/prepareForInline.d.ts +0 -4
- package/dist/ts3.4/client/index.d.ts +0 -2
- package/dist/ts3.4/client/preview/config.d.ts +0 -5
- package/dist/ts3.4/client/preview/decorateStory.d.ts +0 -3
- package/dist/ts3.4/client/preview/globals.d.ts +0 -1
- package/dist/ts3.4/client/preview/index.d.ts +0 -31
- package/dist/ts3.4/client/preview/render.d.ts +0 -7
- package/dist/ts3.4/client/preview/types-6-0.d.ts +0 -35
- package/dist/ts3.4/client/preview/types-7-0.d.ts +0 -9
- package/dist/ts3.4/client/preview/types.d.ts +0 -15
- package/dist/ts3.4/server/build.d.ts +0 -1
- package/dist/ts3.4/server/framework-preset-vue3-docs.d.ts +0 -3
- package/dist/ts3.4/server/framework-preset-vue3.d.ts +0 -4
- package/dist/ts3.4/server/index.d.ts +0 -1
- package/dist/ts3.4/server/options.d.ts +0 -3
- package/dist/ts3.4/server/preset.d.ts +0 -2
- package/dist/ts3.9/server/build.d.ts +0 -1
- package/dist/ts3.9/server/framework-preset-vue3-docs.d.ts +0 -3
- package/dist/ts3.9/server/framework-preset-vue3.d.ts +0 -4
- package/dist/ts3.9/server/index.d.ts +0 -1
- package/dist/ts3.9/server/options.d.ts +0 -3
- package/dist/ts3.9/server/preset.d.ts +0 -2
- package/preset.js +0 -1
- package/standalone.js +0 -8
- package/types-6-0.d.ts +0 -1
- package/types-7-0.d.ts +0 -1
package/README.md
CHANGED
|
@@ -1,43 +1 @@
|
|
|
1
|
-
# Storybook
|
|
2
|
-
|
|
3
|
-
Storybook for Vue 3 is a UI development environment for your Vue 3 components.
|
|
4
|
-
With it, you can visualize different states of your UI components and develop them interactively.
|
|
5
|
-
|
|
6
|
-

|
|
7
|
-
|
|
8
|
-
Storybook runs outside of your app.
|
|
9
|
-
So you can develop UI components in isolation without worrying about app specific dependencies and requirements.
|
|
10
|
-
|
|
11
|
-
## Getting Started
|
|
12
|
-
|
|
13
|
-
```sh
|
|
14
|
-
cd my-vue3-app
|
|
15
|
-
npx sb init
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
For more information visit: [storybook.js.org](https://storybook.js.org)
|
|
19
|
-
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
Storybook also comes with a lot of [addons](https://storybook.js.org/addons) and a great API to customize as you wish.
|
|
23
|
-
You can also build a [static version](https://storybook.js.org/docs/vue/sharing/publish-storybook) of your Storybook and deploy it anywhere you want.
|
|
24
|
-
|
|
25
|
-
## Extending the Vue application
|
|
26
|
-
|
|
27
|
-
Storybook creates a [Vue 3 application](https://v3.vuejs.org/api/application-api.html#application-api) for your component preview which can be imported as `import { app } from '@storybook/vue3'`.
|
|
28
|
-
|
|
29
|
-
When using global custom components (`app.component`), directives (`app.directive`), extensions (`app.use`), or other application methods, you will need to configure those in the `./storybook/preview.js` file.
|
|
30
|
-
|
|
31
|
-
For example:
|
|
32
|
-
|
|
33
|
-
```js
|
|
34
|
-
// .storybook/preview.js
|
|
35
|
-
|
|
36
|
-
import { app } from '@storybook/vue3';
|
|
37
|
-
|
|
38
|
-
app.use(MyPlugin);
|
|
39
|
-
app.component('my-component', MyComponent);
|
|
40
|
-
app.mixin({
|
|
41
|
-
/* My mixin */
|
|
42
|
-
});
|
|
43
|
-
```
|
|
1
|
+
# Storybook Vue3 renderer
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.to-string.js");
|
|
4
|
+
|
|
5
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
6
|
+
|
|
7
|
+
require("core-js/modules/es.object.keys.js");
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, "__esModule", {
|
|
10
|
+
value: true
|
|
11
|
+
});
|
|
12
|
+
var _exportNames = {
|
|
13
|
+
parameters: true,
|
|
14
|
+
argTypesEnhancers: true
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "argTypesEnhancers", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function get() {
|
|
19
|
+
return _config.argTypesEnhancers;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
exports.parameters = void 0;
|
|
23
|
+
|
|
24
|
+
require("core-js/modules/es.object.assign.js");
|
|
25
|
+
|
|
26
|
+
var _config = require("./docs/config");
|
|
27
|
+
|
|
28
|
+
var _config2 = require("./preview/config");
|
|
29
|
+
|
|
30
|
+
Object.keys(_config2).forEach(function (key) {
|
|
31
|
+
if (key === "default" || key === "__esModule") return;
|
|
32
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
33
|
+
if (key in exports && exports[key] === _config2[key]) return;
|
|
34
|
+
Object.defineProperty(exports, key, {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
get: function get() {
|
|
37
|
+
return _config2[key];
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
var parameters = Object.assign({
|
|
42
|
+
framework: 'vue3'
|
|
43
|
+
}, _config.parameters);
|
|
44
|
+
exports.parameters = parameters;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -98,6 +98,7 @@ Object.keys(_types).forEach(function (key) {
|
|
|
98
98
|
});
|
|
99
99
|
});
|
|
100
100
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
101
|
+
var _module, _module$hot;
|
|
102
|
+
|
|
103
|
+
// optimization: stop HMR propagation in webpack
|
|
104
|
+
(_module = module) === null || _module === void 0 ? void 0 : (_module$hot = _module.hot) === null || _module$hot === void 0 ? void 0 : _module$hot.decline();
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -13,7 +13,7 @@ exports.storiesOf = exports.setAddon = exports.raw = exports.getStorybook = expo
|
|
|
13
13
|
|
|
14
14
|
require("core-js/modules/es.array.concat.js");
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _coreClient = require("@storybook/core-client");
|
|
17
17
|
|
|
18
18
|
require("./globals");
|
|
19
19
|
|
|
@@ -22,7 +22,7 @@ var _decorateStory = require("./decorateStory");
|
|
|
22
22
|
var _render = require("./render");
|
|
23
23
|
|
|
24
24
|
var framework = 'vue3';
|
|
25
|
-
var api = (0,
|
|
25
|
+
var api = (0, _coreClient.start)(_render.renderToDOM, {
|
|
26
26
|
decorateStory: _decorateStory.decorateStory,
|
|
27
27
|
render: _render.render
|
|
28
28
|
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
export { storiesOf, setAddon, addDecorator, addParameters, configure, getStorybook, forceReRender, raw, app, activeStoryComponent } from './preview';
|
|
2
|
-
export * from './preview/types-6-0';
|
|
2
|
+
export * from './preview/types-6-0'; // optimization: stop HMR propagation in webpack
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
module.hot.decline();
|
|
6
|
-
}
|
|
4
|
+
module?.hot?.decline();
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const parameters: {
|
|
2
|
+
docs: {
|
|
3
|
+
inlineStories: boolean;
|
|
4
|
+
prepareForInline: (storyFn: import("@storybook/csf").PartialStoryFn<import(".").VueFramework, import("@storybook/csf").Args>, { args }: import("@storybook/csf").StoryContext<import(".").VueFramework, import("@storybook/csf").Args>) => import("react").DetailedReactHTMLElement<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
|
|
5
|
+
extractArgTypes: import("lib/docs-tools/dist/types").ArgTypesExtractor;
|
|
6
|
+
extractComponentDescription: typeof import("lib/docs-tools/dist/types").extractComponentDescription;
|
|
7
|
+
};
|
|
8
|
+
framework: string;
|
|
9
|
+
};
|
|
10
|
+
export { argTypesEnhancers } from './docs/config';
|
|
11
|
+
export * from './preview/config';
|
|
@@ -7,4 +7,4 @@ export declare const parameters: {
|
|
|
7
7
|
extractComponentDescription: typeof extractComponentDescription;
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
|
-
export declare const argTypesEnhancers: (<TFramework extends import("@storybook/csf").AnyFramework>(context: import("@storybook/csf").StoryContextForEnhancers<TFramework, import("@storybook/csf").Args>) => import("@storybook/csf").StrictArgTypes<import("@storybook/csf").Args> | import("
|
|
10
|
+
export declare const argTypesEnhancers: (<TFramework extends import("@storybook/csf").AnyFramework>(context: import("@storybook/csf").StoryContextForEnhancers<TFramework, import("@storybook/csf").Args>) => import("@storybook/csf").StrictArgTypes<import("@storybook/csf").Args> | import("lib/addons/dist/types").Parameters)[];
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -25,7 +25,7 @@ export declare const addParameters: (() => never) | (({ globals, globalTypes, ..
|
|
|
25
25
|
export declare const clearDecorators: (() => never) | (() => void);
|
|
26
26
|
export declare const setAddon: (() => never) | ((addon: any) => void);
|
|
27
27
|
export declare const forceReRender: (() => never) | (() => void);
|
|
28
|
-
export declare const getStorybook: (() => never) | (() => import("
|
|
29
|
-
export declare const raw: (() => never) | (() => import("
|
|
28
|
+
export declare const getStorybook: (() => never) | (() => import("lib/client-api/dist/types/ClientApi").GetStorybookKind<VueFramework>[]);
|
|
29
|
+
export declare const raw: (() => never) | (() => import("lib/store/dist/types").BoundStory<VueFramework>[]);
|
|
30
30
|
export declare const app: ClientApi['app'];
|
|
31
31
|
export { activeStoryComponent } from './render';
|
|
@@ -2,6 +2,6 @@ import type { RenderContext } from '@storybook/store';
|
|
|
2
2
|
import type { ArgsStoryFn } from '@storybook/csf';
|
|
3
3
|
import { VueFramework } from './types-6-0';
|
|
4
4
|
export declare const render: ArgsStoryFn<VueFramework>;
|
|
5
|
-
export declare const activeStoryComponent: import("vue").Ref<import("vue").ComponentOptions<any, any, any,
|
|
5
|
+
export declare const activeStoryComponent: import("vue").Ref<import("vue").ComponentOptions<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, any, any, any>> | import("vue").Ref<import("vue").FunctionalComponent<any, any>>;
|
|
6
6
|
export declare const storybookApp: import("vue").App<Element>;
|
|
7
7
|
export declare function renderToDOM({ title, name, storyFn, showMain, showError, showException }: RenderContext<VueFramework>, domElement: HTMLElement): void;
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,39 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/vue3",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Storybook
|
|
3
|
+
"version": "7.0.0-alpha.0",
|
|
4
|
+
"description": "Storybook Vue 3 renderer",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook"
|
|
7
7
|
],
|
|
8
|
-
"homepage": "https://github.com/storybookjs/storybook/tree/main/
|
|
8
|
+
"homepage": "https://github.com/storybookjs/storybook/tree/main/renderers/vue3",
|
|
9
9
|
"bugs": {
|
|
10
10
|
"url": "https://github.com/storybookjs/storybook/issues"
|
|
11
11
|
},
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
|
14
14
|
"url": "https://github.com/storybookjs/storybook.git",
|
|
15
|
-
"directory": "
|
|
15
|
+
"directory": "renderers/vue3"
|
|
16
16
|
},
|
|
17
17
|
"funding": {
|
|
18
18
|
"type": "opencollective",
|
|
19
19
|
"url": "https://opencollective.com/storybook"
|
|
20
20
|
},
|
|
21
21
|
"license": "MIT",
|
|
22
|
-
"main": "dist/cjs/
|
|
23
|
-
"module": "dist/esm/
|
|
24
|
-
"types": "dist/
|
|
25
|
-
"typesVersions": {
|
|
26
|
-
"<3.8": {
|
|
27
|
-
"dist/ts3.9/*": [
|
|
28
|
-
"dist/ts3.4/*"
|
|
29
|
-
]
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
"bin": {
|
|
33
|
-
"build-storybook": "./bin/build.js",
|
|
34
|
-
"start-storybook": "./bin/index.js",
|
|
35
|
-
"storybook-server": "./bin/index.js"
|
|
36
|
-
},
|
|
22
|
+
"main": "dist/cjs/index.js",
|
|
23
|
+
"module": "dist/esm/index.js",
|
|
24
|
+
"types": "dist/types/index.d.ts",
|
|
37
25
|
"files": [
|
|
38
26
|
"bin/**/*",
|
|
39
27
|
"dist/**/*",
|
|
@@ -45,35 +33,23 @@
|
|
|
45
33
|
"prepare": "node ../../scripts/prepare.js"
|
|
46
34
|
},
|
|
47
35
|
"dependencies": {
|
|
48
|
-
"@storybook/addons": "
|
|
49
|
-
"@storybook/core": "
|
|
50
|
-
"@storybook/core-common": "6.5.7",
|
|
36
|
+
"@storybook/addons": "7.0.0-alpha.0",
|
|
37
|
+
"@storybook/core-client": "7.0.0-alpha.0",
|
|
51
38
|
"@storybook/csf": "0.0.2--canary.4566f4d.1",
|
|
52
|
-
"@storybook/docs-tools": "
|
|
53
|
-
"@storybook/store": "
|
|
54
|
-
"@types/node": "^14.14.20 || ^16.0.0",
|
|
55
|
-
"@types/webpack-env": "^1.16.0",
|
|
39
|
+
"@storybook/docs-tools": "7.0.0-alpha.0",
|
|
40
|
+
"@storybook/store": "7.0.0-alpha.0",
|
|
56
41
|
"core-js": "^3.8.2",
|
|
57
42
|
"global": "^4.4.0",
|
|
58
43
|
"react": "16.14.0",
|
|
59
44
|
"react-dom": "16.14.0",
|
|
60
|
-
"read-pkg-up": "^7.0.1",
|
|
61
45
|
"regenerator-runtime": "^0.13.7",
|
|
62
|
-
"ts-dedent": "^2.0.0"
|
|
63
|
-
"ts-loader": "^8.0.14",
|
|
64
|
-
"vue-docgen-api": "^4.44.15",
|
|
65
|
-
"vue-docgen-loader": "^1.5.0",
|
|
66
|
-
"vue-loader": "^16.4.1",
|
|
67
|
-
"webpack": ">=4.0.0 <6.0.0"
|
|
46
|
+
"ts-dedent": "^2.0.0"
|
|
68
47
|
},
|
|
69
48
|
"devDependencies": {
|
|
70
|
-
"
|
|
71
|
-
"vue": "3.0.0",
|
|
72
|
-
"webpack": "4"
|
|
49
|
+
"vue": "3.0.0"
|
|
73
50
|
},
|
|
74
51
|
"peerDependencies": {
|
|
75
52
|
"@babel/core": "*",
|
|
76
|
-
"@vue/compiler-sfc": "^3.0.0",
|
|
77
53
|
"babel-loader": "^7.0.0 || ^8.0.0",
|
|
78
54
|
"vue": "^3.0.0"
|
|
79
55
|
},
|
|
@@ -83,6 +59,5 @@
|
|
|
83
59
|
"publishConfig": {
|
|
84
60
|
"access": "public"
|
|
85
61
|
},
|
|
86
|
-
"gitHead": "
|
|
87
|
-
"sbmodern": "dist/modern/client/index.js"
|
|
62
|
+
"gitHead": "c82d897ea765da8cf4fbbcc2af1f28c808a93e23"
|
|
88
63
|
}
|
package/preview.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/esm/config';
|
package/bin/build.js
DELETED
package/bin/index.js
DELETED
package/dist/cjs/server/build.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _server = require("@storybook/core/server");
|
|
4
|
-
|
|
5
|
-
var _options = _interopRequireDefault(require("./options"));
|
|
6
|
-
|
|
7
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
8
|
-
|
|
9
|
-
(0, _server.buildStatic)(_options.default);
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.previewAnnotations = void 0;
|
|
7
|
-
exports.webpackFinal = webpackFinal;
|
|
8
|
-
|
|
9
|
-
var _coreCommon = require("@storybook/core-common");
|
|
10
|
-
|
|
11
|
-
var _docsTools = require("@storybook/docs-tools");
|
|
12
|
-
|
|
13
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
14
|
-
|
|
15
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
16
|
-
|
|
17
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
18
|
-
|
|
19
|
-
function webpackFinal(webpackConfig = {}, options) {
|
|
20
|
-
var _options$presetsList;
|
|
21
|
-
|
|
22
|
-
if (!(0, _docsTools.hasDocsOrControls)(options)) return webpackConfig;
|
|
23
|
-
var vueDocgenOptions = {};
|
|
24
|
-
(_options$presetsList = options.presetsList) === null || _options$presetsList === void 0 ? void 0 : _options$presetsList.forEach(function (preset) {
|
|
25
|
-
if (preset.name.includes('addon-docs') && preset.options.vueDocgenOptions) {
|
|
26
|
-
var appendableOptions = preset.options.vueDocgenOptions;
|
|
27
|
-
vueDocgenOptions = _objectSpread(_objectSpread({}, vueDocgenOptions), appendableOptions);
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
webpackConfig.module.rules.push({
|
|
31
|
-
test: /\.vue$/,
|
|
32
|
-
loader: require.resolve('vue-docgen-loader', {
|
|
33
|
-
paths: [require.resolve('@storybook/vue3')]
|
|
34
|
-
}),
|
|
35
|
-
enforce: 'post',
|
|
36
|
-
options: {
|
|
37
|
-
docgenOptions: _objectSpread({
|
|
38
|
-
alias: webpackConfig.resolve.alias
|
|
39
|
-
}, vueDocgenOptions)
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
return webpackConfig;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
var previewAnnotations = function (entry = [], options) {
|
|
46
|
-
if (!(0, _docsTools.hasDocsOrControls)(options)) return entry;
|
|
47
|
-
return [...entry, (0, _coreCommon.findDistEsm)(__dirname, 'client/docs/config')];
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
exports.previewAnnotations = previewAnnotations;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.previewAnnotations = void 0;
|
|
7
|
-
exports.webpack = webpack;
|
|
8
|
-
|
|
9
|
-
var _vueLoader = require("vue-loader");
|
|
10
|
-
|
|
11
|
-
var _webpack = require("webpack");
|
|
12
|
-
|
|
13
|
-
var _coreCommon = require("@storybook/core-common");
|
|
14
|
-
|
|
15
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
16
|
-
|
|
17
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
18
|
-
|
|
19
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
20
|
-
|
|
21
|
-
function webpack(config) {
|
|
22
|
-
return _objectSpread(_objectSpread({}, config), {}, {
|
|
23
|
-
plugins: [...config.plugins, new _vueLoader.VueLoaderPlugin(), new _webpack.DefinePlugin({
|
|
24
|
-
__VUE_OPTIONS_API__: JSON.stringify(true),
|
|
25
|
-
__VUE_PROD_DEVTOOLS__: JSON.stringify(true)
|
|
26
|
-
})],
|
|
27
|
-
module: _objectSpread(_objectSpread({}, config.module), {}, {
|
|
28
|
-
rules: [...config.module.rules, {
|
|
29
|
-
test: /\.vue$/,
|
|
30
|
-
loader: require.resolve('vue-loader'),
|
|
31
|
-
options: {}
|
|
32
|
-
}, {
|
|
33
|
-
test: /\.ts$/,
|
|
34
|
-
use: [{
|
|
35
|
-
loader: require.resolve('ts-loader'),
|
|
36
|
-
options: {
|
|
37
|
-
transpileOnly: true,
|
|
38
|
-
appendTsSuffixTo: [/\.vue$/]
|
|
39
|
-
}
|
|
40
|
-
}]
|
|
41
|
-
}, {
|
|
42
|
-
test: /\.tsx$/,
|
|
43
|
-
use: [{
|
|
44
|
-
loader: require.resolve('ts-loader'),
|
|
45
|
-
options: {
|
|
46
|
-
transpileOnly: true,
|
|
47
|
-
// Note this is different from the `appendTsSuffixTo` above!
|
|
48
|
-
appendTsxSuffixTo: [/\.vue$/]
|
|
49
|
-
}
|
|
50
|
-
}]
|
|
51
|
-
}]
|
|
52
|
-
}),
|
|
53
|
-
resolve: _objectSpread(_objectSpread({}, config.resolve), {}, {
|
|
54
|
-
extensions: [...config.resolve.extensions, '.vue'],
|
|
55
|
-
alias: _objectSpread(_objectSpread({}, config.resolve.alias), {}, {
|
|
56
|
-
vue$: require.resolve('vue/dist/vue.esm-bundler.js')
|
|
57
|
-
})
|
|
58
|
-
})
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
var previewAnnotations = function (entry = []) {
|
|
63
|
-
return [...entry, (0, _coreCommon.findDistEsm)(__dirname, 'client/preview/config')];
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
exports.previewAnnotations = previewAnnotations;
|
package/dist/cjs/server/index.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _server = require("@storybook/core/server");
|
|
4
|
-
|
|
5
|
-
var _options = _interopRequireDefault(require("./options"));
|
|
6
|
-
|
|
7
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
8
|
-
|
|
9
|
-
(0, _server.buildDev)(_options.default);
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _readPkgUp = require("read-pkg-up");
|
|
9
|
-
|
|
10
|
-
var _default = {
|
|
11
|
-
packageJson: (0, _readPkgUp.sync)({
|
|
12
|
-
cwd: __dirname
|
|
13
|
-
}).packageJson,
|
|
14
|
-
framework: 'vue3',
|
|
15
|
-
frameworkPresets: [require.resolve('./preset')]
|
|
16
|
-
};
|
|
17
|
-
exports.default = _default;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { extractComponentDescription, enhanceArgTypes } from '@storybook/docs-tools';
|
|
2
|
-
import { extractArgTypes } from './extractArgTypes';
|
|
3
|
-
import { prepareForInline } from './prepareForInline';
|
|
4
|
-
export var parameters = {
|
|
5
|
-
docs: {
|
|
6
|
-
inlineStories: true,
|
|
7
|
-
prepareForInline: prepareForInline,
|
|
8
|
-
extractArgTypes: extractArgTypes,
|
|
9
|
-
extractComponentDescription: extractComponentDescription
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
export var argTypesEnhancers = [enhanceArgTypes];
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import "core-js/modules/es.object.to-string.js";
|
|
2
|
-
import "core-js/modules/web.dom-collections.for-each.js";
|
|
3
|
-
import "core-js/modules/es.function.name.js";
|
|
4
|
-
import "core-js/modules/es.symbol.js";
|
|
5
|
-
import "core-js/modules/es.symbol.description.js";
|
|
6
|
-
import "core-js/modules/es.object.assign.js";
|
|
7
|
-
import { hasDocgen, extractComponentProps, convert } from '@storybook/docs-tools';
|
|
8
|
-
var SECTIONS = ['props', 'events', 'slots'];
|
|
9
|
-
export var extractArgTypes = function extractArgTypes(component) {
|
|
10
|
-
if (!hasDocgen(component)) {
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
var results = {};
|
|
15
|
-
SECTIONS.forEach(function (section) {
|
|
16
|
-
var props = extractComponentProps(component, section);
|
|
17
|
-
props.forEach(function (_ref) {
|
|
18
|
-
var propDef = _ref.propDef,
|
|
19
|
-
docgenInfo = _ref.docgenInfo,
|
|
20
|
-
jsDocTags = _ref.jsDocTags;
|
|
21
|
-
var name = propDef.name,
|
|
22
|
-
type = propDef.type,
|
|
23
|
-
description = propDef.description,
|
|
24
|
-
defaultSummary = propDef.defaultValue,
|
|
25
|
-
required = propDef.required;
|
|
26
|
-
var sbType = section === 'props' ? convert(docgenInfo) : {
|
|
27
|
-
name: 'void'
|
|
28
|
-
};
|
|
29
|
-
results[name] = {
|
|
30
|
-
name: name,
|
|
31
|
-
description: description,
|
|
32
|
-
type: Object.assign({
|
|
33
|
-
required: required
|
|
34
|
-
}, sbType),
|
|
35
|
-
table: {
|
|
36
|
-
type: type,
|
|
37
|
-
jsDocTags: jsDocTags,
|
|
38
|
-
defaultValue: defaultSummary,
|
|
39
|
-
category: section
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
return results;
|
|
45
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import * as Vue from 'vue';
|
|
3
|
-
import { app } from '../index'; // This is cast as `any` to workaround type errors caused by Vue 2 types
|
|
4
|
-
|
|
5
|
-
var _ref = Vue,
|
|
6
|
-
render = _ref.render,
|
|
7
|
-
h = _ref.h;
|
|
8
|
-
export var prepareForInline = function prepareForInline(storyFn, _ref2) {
|
|
9
|
-
var args = _ref2.args;
|
|
10
|
-
var component = storyFn();
|
|
11
|
-
var vnode = h(component, args); // By attaching the app context from `@storybook/vue3` to the vnode
|
|
12
|
-
// like this, these stoeis are able to access any app config stuff
|
|
13
|
-
// the end-user set inside `.storybook/preview.js`
|
|
14
|
-
|
|
15
|
-
vnode.appContext = app._context; // eslint-disable-line no-underscore-dangle
|
|
16
|
-
|
|
17
|
-
return /*#__PURE__*/React.createElement('div', {
|
|
18
|
-
ref: function ref(node) {
|
|
19
|
-
return node ? render(vnode, node) : null;
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
};
|
package/dist/esm/client/index.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { storiesOf, setAddon, addDecorator, addParameters, configure, getStorybook, forceReRender, raw, app, activeStoryComponent } from './preview';
|
|
2
|
-
export * from './preview/types-6-0';
|
|
3
|
-
|
|
4
|
-
if (module && module.hot && module.hot.decline) {
|
|
5
|
-
module.hot.decline();
|
|
6
|
-
}
|