@storybook/angular 6.5.0-alpha.49 → 6.5.0-alpha.51
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.
|
@@ -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
|
};
|
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.51",
|
|
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.
|
|
54
|
-
"@storybook/csf": "0.0.2--canary.
|
|
55
|
-
"@storybook/docs-tools": "6.5.0-alpha.
|
|
56
|
-
"@storybook/node-logger": "6.5.0-alpha.
|
|
48
|
+
"@storybook/addons": "6.5.0-alpha.51",
|
|
49
|
+
"@storybook/api": "6.5.0-alpha.51",
|
|
50
|
+
"@storybook/client-logger": "6.5.0-alpha.51",
|
|
51
|
+
"@storybook/core": "6.5.0-alpha.51",
|
|
52
|
+
"@storybook/core-common": "6.5.0-alpha.51",
|
|
53
|
+
"@storybook/core-events": "6.5.0-alpha.51",
|
|
54
|
+
"@storybook/csf": "0.0.2--canary.507502b.0",
|
|
55
|
+
"@storybook/docs-tools": "6.5.0-alpha.51",
|
|
56
|
+
"@storybook/node-logger": "6.5.0-alpha.51",
|
|
57
57
|
"@storybook/semver": "^7.3.2",
|
|
58
|
-
"@storybook/store": "6.5.0-alpha.
|
|
58
|
+
"@storybook/store": "6.5.0-alpha.51",
|
|
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",
|
|
@@ -137,5 +136,5 @@
|
|
|
137
136
|
"access": "public"
|
|
138
137
|
},
|
|
139
138
|
"builders": "dist/ts3.9/builders/builders.json",
|
|
140
|
-
"gitHead": "
|
|
139
|
+
"gitHead": "cfcdc7fb74d3cf60eae8dd0b5a626d67ed180d42"
|
|
141
140
|
}
|