@storybook/angular 6.5.0-alpha.50 → 6.5.0-alpha.53
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/ts3.4/server/framework-preset-angular-docs.d.ts +1 -1
- package/dist/ts3.4/server/preset.d.ts +1 -1
- package/dist/ts3.9/client/docs/sourceDecorator.js +13 -61
- package/dist/ts3.9/client/preview/angular-beta/StorybookWrapperComponent.js +3 -14
- package/dist/ts3.9/server/framework-preset-angular-docs.d.ts +1 -1
- package/dist/ts3.9/server/framework-preset-angular-docs.js +2 -2
- package/dist/ts3.9/server/preset.d.ts +1 -1
- package/dist/ts3.9/server/preset.js +2 -2
- package/package.json +14 -14
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { StorybookConfig } from '@storybook/core-common';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const previewAnnotations: StorybookConfig['previewAnnotations'];
|
|
@@ -1,32 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
-
if (mod && mod.__esModule) return mod;
|
|
16
|
-
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
-
__setModuleDefault(result, mod);
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
21
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
22
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
24
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
25
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
26
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
27
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
3
|
exports.sourceDecorator = exports.skipSourceRender = void 0;
|
|
32
4
|
const addons_1 = require("@storybook/addons");
|
|
@@ -43,22 +15,6 @@ exports.skipSourceRender = (context) => {
|
|
|
43
15
|
// if the user provides code
|
|
44
16
|
return (sourceParams === null || sourceParams === void 0 ? void 0 : sourceParams.code) || (sourceParams === null || sourceParams === void 0 ? void 0 : sourceParams.type) === docs_tools_1.SourceType.CODE;
|
|
45
17
|
};
|
|
46
|
-
let prettyUpInternal;
|
|
47
|
-
const makePrettyUp = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
48
|
-
if (prettyUpInternal) {
|
|
49
|
-
return prettyUpInternal;
|
|
50
|
-
}
|
|
51
|
-
const prettierHtml = yield Promise.resolve().then(() => __importStar(require('prettier/parser-html')));
|
|
52
|
-
const prettier = yield Promise.resolve().then(() => __importStar(require('prettier/standalone')));
|
|
53
|
-
prettyUpInternal = (source) => {
|
|
54
|
-
return prettier.format(source, {
|
|
55
|
-
parser: 'angular',
|
|
56
|
-
plugins: [prettierHtml],
|
|
57
|
-
htmlWhitespaceSensitivity: 'ignore',
|
|
58
|
-
});
|
|
59
|
-
};
|
|
60
|
-
return prettyUpInternal;
|
|
61
|
-
});
|
|
62
18
|
/**
|
|
63
19
|
* Angular source decorator.
|
|
64
20
|
* @param storyFn Fn
|
|
@@ -73,25 +29,21 @@ exports.sourceDecorator = (storyFn, context) => {
|
|
|
73
29
|
const { props, template, userDefinedTemplate } = story;
|
|
74
30
|
const { component, argTypes } = context;
|
|
75
31
|
let toEmit;
|
|
76
|
-
const prettyUpPromise = makePrettyUp();
|
|
77
32
|
addons_1.useEffect(() => {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
channel.emit(docs_tools_1.SNIPPET_RENDERED, context.id, prettyUp(toEmit));
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
prettyUpPromise.then((prettyUp) => {
|
|
84
|
-
if (component && !userDefinedTemplate) {
|
|
85
|
-
const source = renderer_1.computesTemplateSourceFromComponent(component, props, argTypes);
|
|
86
|
-
// We might have a story with a Directive or Service defined as the component
|
|
87
|
-
// In these cases there might exist a template, even if we aren't able to create source from component
|
|
88
|
-
if (source || template) {
|
|
89
|
-
toEmit = prettyUp(source || template);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
else if (template) {
|
|
93
|
-
toEmit = prettyUp(template);
|
|
33
|
+
if (toEmit) {
|
|
34
|
+
channel.emit(docs_tools_1.SNIPPET_RENDERED, context.id, toEmit, 'angular');
|
|
94
35
|
}
|
|
95
36
|
});
|
|
37
|
+
if (component && !userDefinedTemplate) {
|
|
38
|
+
const source = renderer_1.computesTemplateSourceFromComponent(component, props, argTypes);
|
|
39
|
+
// We might have a story with a Directive or Service defined as the component
|
|
40
|
+
// In these cases there might exist a template, even if we aren't able to create source from component
|
|
41
|
+
if (source || template) {
|
|
42
|
+
toEmit = source || template;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
else if (template) {
|
|
46
|
+
toEmit = template;
|
|
47
|
+
}
|
|
96
48
|
return story;
|
|
97
49
|
};
|
|
@@ -68,22 +68,11 @@ exports.createStorybookWrapperComponent = (selector, template, storyComponent, s
|
|
|
68
68
|
// And then forces the `detectChanges`
|
|
69
69
|
this.storyComponentViewContainerRef.injector.get(core_1.ChangeDetectorRef).markForCheck();
|
|
70
70
|
this.changeDetectorRef.detectChanges();
|
|
71
|
-
// Once target component has been initialized, the storyProps$ observable keeps target component
|
|
71
|
+
// Once target component has been initialized, the storyProps$ observable keeps target component properties than are not Input|Output up to date
|
|
72
72
|
this.storyComponentPropsSubscription = this.storyProps$
|
|
73
73
|
.pipe(operators_1.skip(1), operators_1.map((props) => {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
return Object.entries(props).reduce((prev, [key, value]) => (Object.assign(Object.assign({}, prev), (!outputsKeyToRemove.includes(key) && {
|
|
77
|
-
[key]: value,
|
|
78
|
-
}))), {});
|
|
79
|
-
}), operators_1.map((props) => {
|
|
80
|
-
// In case a component uses an input with `bindingPropertyName` (ex: @Input('name'))
|
|
81
|
-
// find the value of the local propName in the component Inputs
|
|
82
|
-
// otherwise use the input key
|
|
83
|
-
return Object.entries(props).reduce((prev, [propKey, value]) => {
|
|
84
|
-
const input = ngComponentInputsOutputs.inputs.find((o) => o.templateName === propKey);
|
|
85
|
-
return Object.assign(Object.assign({}, prev), (input ? { [input.propName]: value } : { [propKey]: value }));
|
|
86
|
-
}, {});
|
|
74
|
+
const propsKeyToKeep = getNonInputsOutputsProps(ngComponentInputsOutputs, props);
|
|
75
|
+
return propsKeyToKeep.reduce((acc, p) => (Object.assign(Object.assign({}, acc), { [p]: props[p] })), {});
|
|
87
76
|
}))
|
|
88
77
|
.subscribe((props) => {
|
|
89
78
|
// Replace inputs with new ones from props
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { StorybookConfig } from '@storybook/core-common';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const previewAnnotations: StorybookConfig['previewAnnotations'];
|
|
@@ -3,10 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.previewAnnotations = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
8
|
const docs_tools_1 = require("@storybook/docs-tools");
|
|
9
|
-
exports.
|
|
9
|
+
exports.previewAnnotations = (entry = [], options) => {
|
|
10
10
|
if (!docs_tools_1.hasDocsOrControls(options))
|
|
11
11
|
return entry;
|
|
12
12
|
return [...entry, path_1.default.join(__dirname, '../../../dist/ts3.9/client/docs/config')];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addons = exports.
|
|
4
|
-
exports.
|
|
3
|
+
exports.addons = exports.previewAnnotations = void 0;
|
|
4
|
+
exports.previewAnnotations = (entries = []) => [
|
|
5
5
|
...entries,
|
|
6
6
|
require.resolve('../client/preview/config'),
|
|
7
7
|
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/angular",
|
|
3
|
-
"version": "6.5.0-alpha.
|
|
3
|
+
"version": "6.5.0-alpha.53",
|
|
4
4
|
"description": "Storybook for Angular: Develop Angular Components in isolation with Hot Reloading.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook"
|
|
@@ -45,17 +45,17 @@
|
|
|
45
45
|
"prepare": "node ../../scripts/prepare.js"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@storybook/addons": "6.5.0-alpha.
|
|
49
|
-
"@storybook/api": "6.5.0-alpha.
|
|
50
|
-
"@storybook/client-logger": "6.5.0-alpha.
|
|
51
|
-
"@storybook/core": "6.5.0-alpha.
|
|
52
|
-
"@storybook/core-common": "6.5.0-alpha.
|
|
53
|
-
"@storybook/core-events": "6.5.0-alpha.
|
|
48
|
+
"@storybook/addons": "6.5.0-alpha.53",
|
|
49
|
+
"@storybook/api": "6.5.0-alpha.53",
|
|
50
|
+
"@storybook/client-logger": "6.5.0-alpha.53",
|
|
51
|
+
"@storybook/core": "6.5.0-alpha.53",
|
|
52
|
+
"@storybook/core-common": "6.5.0-alpha.53",
|
|
53
|
+
"@storybook/core-events": "6.5.0-alpha.53",
|
|
54
54
|
"@storybook/csf": "0.0.2--canary.507502b.0",
|
|
55
|
-
"@storybook/docs-tools": "6.5.0-alpha.
|
|
56
|
-
"@storybook/node-logger": "6.5.0-alpha.
|
|
55
|
+
"@storybook/docs-tools": "6.5.0-alpha.53",
|
|
56
|
+
"@storybook/node-logger": "6.5.0-alpha.53",
|
|
57
57
|
"@storybook/semver": "^7.3.2",
|
|
58
|
-
"@storybook/store": "6.5.0-alpha.
|
|
58
|
+
"@storybook/store": "6.5.0-alpha.53",
|
|
59
59
|
"@types/node": "^14.14.20 || ^16.0.0",
|
|
60
60
|
"@types/react": "^16.14.23",
|
|
61
61
|
"@types/react-dom": "^16.9.14",
|
|
@@ -69,7 +69,6 @@
|
|
|
69
69
|
"p-limit": "^3.1.0",
|
|
70
70
|
"postcss": "^7.0.36",
|
|
71
71
|
"postcss-loader": "^4.2.0",
|
|
72
|
-
"prettier": ">=2.2.1 <=2.3.0",
|
|
73
72
|
"raw-loader": "^4.0.2",
|
|
74
73
|
"react": "^16.14.0",
|
|
75
74
|
"react-dom": "^16.14.0",
|
|
@@ -81,7 +80,7 @@
|
|
|
81
80
|
"ts-loader": "^8.0.14",
|
|
82
81
|
"tsconfig-paths-webpack-plugin": "^3.3.0",
|
|
83
82
|
"util-deprecate": "^1.0.2",
|
|
84
|
-
"webpack": "4"
|
|
83
|
+
"webpack": ">=4.0.0 <6.0.0"
|
|
85
84
|
},
|
|
86
85
|
"devDependencies": {
|
|
87
86
|
"@angular-devkit/architect": "~0.1102.0",
|
|
@@ -102,7 +101,8 @@
|
|
|
102
101
|
"jest": "^26.6.3",
|
|
103
102
|
"jest-preset-angular": "^8.3.2",
|
|
104
103
|
"jest-specific-snapshot": "^4.0.0",
|
|
105
|
-
"tmp": "^0.2.1"
|
|
104
|
+
"tmp": "^0.2.1",
|
|
105
|
+
"webpack": "4"
|
|
106
106
|
},
|
|
107
107
|
"peerDependencies": {
|
|
108
108
|
"@angular-devkit/architect": ">=0.8.9",
|
|
@@ -137,5 +137,5 @@
|
|
|
137
137
|
"access": "public"
|
|
138
138
|
},
|
|
139
139
|
"builders": "dist/ts3.9/builders/builders.json",
|
|
140
|
-
"gitHead": "
|
|
140
|
+
"gitHead": "652768b3ff83a355651d5636ccc4d78bee2cdbf9"
|
|
141
141
|
}
|