@storybook/angular 7.0.0-alpha.47 → 7.0.0-alpha.48
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.
|
@@ -13,9 +13,14 @@ const StorybookProvider_1 = require("./StorybookProvider");
|
|
|
13
13
|
const NgModulesAnalyzer_1 = require("./utils/NgModulesAnalyzer");
|
|
14
14
|
const NgComponentAnalyzer_1 = require("./utils/NgComponentAnalyzer");
|
|
15
15
|
const StorybookWrapperComponent_1 = require("./StorybookWrapperComponent");
|
|
16
|
+
const ComputesTemplateFromComponent_1 = require("./ComputesTemplateFromComponent");
|
|
16
17
|
const getStorybookModuleMetadata = ({ storyFnAngular, component, targetSelector, }, storyProps$) => {
|
|
17
18
|
const { props, styles, moduleMetadata = {} } = storyFnAngular;
|
|
18
|
-
|
|
19
|
+
let { template } = storyFnAngular;
|
|
20
|
+
const hasTemplate = !hasNoTemplate(template);
|
|
21
|
+
if (!hasTemplate && component) {
|
|
22
|
+
template = (0, ComputesTemplateFromComponent_1.computesTemplateFromComponent)(component, props, '');
|
|
23
|
+
}
|
|
19
24
|
/**
|
|
20
25
|
* Create a component that wraps generated template and gives it props
|
|
21
26
|
*/
|
|
@@ -52,3 +57,6 @@ const createStorybookModule = (ngModule) => {
|
|
|
52
57
|
return StorybookModule;
|
|
53
58
|
};
|
|
54
59
|
exports.createStorybookModule = createStorybookModule;
|
|
60
|
+
function hasNoTemplate(template) {
|
|
61
|
+
return template === null || template === undefined;
|
|
62
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/angular",
|
|
3
|
-
"version": "7.0.0-alpha.
|
|
3
|
+
"version": "7.0.0-alpha.48",
|
|
4
4
|
"description": "Storybook for Angular: Develop Angular components in isolation with hot reloading.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -34,19 +34,19 @@
|
|
|
34
34
|
"prep": "rimraf dist && ../../../scripts/node_modules/.bin/tsc --project tsconfig.build.json && echo \"Preventing passing flags to tsc\""
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@storybook/addons": "7.0.0-alpha.
|
|
38
|
-
"@storybook/api": "7.0.0-alpha.
|
|
39
|
-
"@storybook/builder-webpack5": "7.0.0-alpha.
|
|
40
|
-
"@storybook/client-logger": "7.0.0-alpha.
|
|
41
|
-
"@storybook/core-client": "7.0.0-alpha.
|
|
42
|
-
"@storybook/core-common": "7.0.0-alpha.
|
|
43
|
-
"@storybook/core-events": "7.0.0-alpha.
|
|
44
|
-
"@storybook/core-server": "7.0.0-alpha.
|
|
45
|
-
"@storybook/core-webpack": "7.0.0-alpha.
|
|
46
|
-
"@storybook/docs-tools": "7.0.0-alpha.
|
|
47
|
-
"@storybook/node-logger": "7.0.0-alpha.
|
|
48
|
-
"@storybook/store": "7.0.0-alpha.
|
|
49
|
-
"@storybook/types": "7.0.0-alpha.
|
|
37
|
+
"@storybook/addons": "7.0.0-alpha.48",
|
|
38
|
+
"@storybook/api": "7.0.0-alpha.48",
|
|
39
|
+
"@storybook/builder-webpack5": "7.0.0-alpha.48",
|
|
40
|
+
"@storybook/client-logger": "7.0.0-alpha.48",
|
|
41
|
+
"@storybook/core-client": "7.0.0-alpha.48",
|
|
42
|
+
"@storybook/core-common": "7.0.0-alpha.48",
|
|
43
|
+
"@storybook/core-events": "7.0.0-alpha.48",
|
|
44
|
+
"@storybook/core-server": "7.0.0-alpha.48",
|
|
45
|
+
"@storybook/core-webpack": "7.0.0-alpha.48",
|
|
46
|
+
"@storybook/docs-tools": "7.0.0-alpha.48",
|
|
47
|
+
"@storybook/node-logger": "7.0.0-alpha.48",
|
|
48
|
+
"@storybook/store": "7.0.0-alpha.48",
|
|
49
|
+
"@storybook/types": "7.0.0-alpha.48",
|
|
50
50
|
"@types/node": "^16.0.0",
|
|
51
51
|
"@types/react": "^16.14.23",
|
|
52
52
|
"@types/react-dom": "^16.9.14",
|
|
@@ -122,5 +122,5 @@
|
|
|
122
122
|
"access": "public"
|
|
123
123
|
},
|
|
124
124
|
"builders": "dist/builders/builders.json",
|
|
125
|
-
"gitHead": "
|
|
125
|
+
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
|
126
126
|
}
|
|
@@ -5,6 +5,8 @@ import Button from './button.component';
|
|
|
5
5
|
const meta: Meta<Button> = {
|
|
6
6
|
title: 'Example/Button',
|
|
7
7
|
component: Button,
|
|
8
|
+
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/angular/writing-docs/docs-page
|
|
9
|
+
tags: ['docsPage'],
|
|
8
10
|
// More on component templates: https://storybook.js.org/docs/angular/writing-stories/introduction#using-args
|
|
9
11
|
render: (args: Button) => ({
|
|
10
12
|
props: {
|
|
@@ -8,6 +8,8 @@ import Header from './header.component';
|
|
|
8
8
|
const meta: Meta<Header> = {
|
|
9
9
|
title: 'Example/Header',
|
|
10
10
|
component: Header,
|
|
11
|
+
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/angular/writing-docs/docs-page
|
|
12
|
+
tags: ['docsPage'],
|
|
11
13
|
render: (args) => ({ props: args }),
|
|
12
14
|
decorators: [
|
|
13
15
|
moduleMetadata({
|