@storybook/angular 7.6.0-alpha.3 → 7.6.0-alpha.5
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/client/angular-beta/AbstractRenderer.js +1 -1
- package/dist/client/angular-beta/__testfixtures__/input.component.js +3 -4
- package/dist/client/angular-beta/__testfixtures__/test.module.js +2 -3
- package/dist/client/angular-beta/utils/NgModulesAnalyzer.js +2 -2
- package/dist/client/angular-beta/utils/PropertyExtractor.js +1 -1
- package/dist/client/docs/__testfixtures__/doc-button/input.js +3 -4
- package/dist/server/angular-cli-webpack.js +3 -0
- package/package.json +26 -26
- package/template/cli/Page.stories.ts +7 -4
|
@@ -155,6 +155,7 @@ class AbstractRenderer {
|
|
|
155
155
|
return hasChangedModuleMetadata;
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
|
+
exports.AbstractRenderer = AbstractRenderer;
|
|
158
159
|
_a = AbstractRenderer;
|
|
159
160
|
/**
|
|
160
161
|
* Reset compiled components because we often want to compile the same component with
|
|
@@ -177,4 +178,3 @@ AbstractRenderer.resetCompiledComponents = async () => {
|
|
|
177
178
|
*/
|
|
178
179
|
}
|
|
179
180
|
};
|
|
180
|
-
exports.AbstractRenderer = AbstractRenderer;
|
|
@@ -16,8 +16,8 @@ var ButtonAccent;
|
|
|
16
16
|
(function (ButtonAccent) {
|
|
17
17
|
ButtonAccent["Normal"] = "Normal";
|
|
18
18
|
ButtonAccent["High"] = "High";
|
|
19
|
-
})(ButtonAccent
|
|
20
|
-
let InputComponent = class InputComponent {
|
|
19
|
+
})(ButtonAccent || (exports.ButtonAccent = ButtonAccent = {}));
|
|
20
|
+
let InputComponent = exports.InputComponent = class InputComponent {
|
|
21
21
|
constructor() {
|
|
22
22
|
/** Appearance style of the button. */
|
|
23
23
|
this.appearance = 'secondary';
|
|
@@ -58,10 +58,9 @@ __decorate([
|
|
|
58
58
|
(0, core_1.Output)(),
|
|
59
59
|
__metadata("design:type", Object)
|
|
60
60
|
], InputComponent.prototype, "onClick", void 0);
|
|
61
|
-
InputComponent = __decorate([
|
|
61
|
+
exports.InputComponent = InputComponent = __decorate([
|
|
62
62
|
(0, core_1.Component)({
|
|
63
63
|
selector: 'doc-button',
|
|
64
64
|
template: '<button>{{ label }}</button>',
|
|
65
65
|
})
|
|
66
66
|
], InputComponent);
|
|
67
|
-
exports.InputComponent = InputComponent;
|
|
@@ -10,11 +10,10 @@ exports.WithOfficialModule = void 0;
|
|
|
10
10
|
const common_1 = require("@angular/common");
|
|
11
11
|
const http_1 = require("@angular/common/http");
|
|
12
12
|
const core_1 = require("@angular/core");
|
|
13
|
-
let WithOfficialModule = class WithOfficialModule {
|
|
13
|
+
let WithOfficialModule = exports.WithOfficialModule = class WithOfficialModule {
|
|
14
14
|
};
|
|
15
|
-
WithOfficialModule = __decorate([
|
|
15
|
+
exports.WithOfficialModule = WithOfficialModule = __decorate([
|
|
16
16
|
(0, core_1.NgModule)({
|
|
17
17
|
imports: [common_1.CommonModule, http_1.HttpClientModule],
|
|
18
18
|
})
|
|
19
19
|
], WithOfficialModule);
|
|
20
|
-
exports.WithOfficialModule = WithOfficialModule;
|
|
@@ -10,14 +10,14 @@ const reflectionCapabilities = new core_1.ɵReflectionCapabilities();
|
|
|
10
10
|
*/
|
|
11
11
|
const isComponentAlreadyDeclared = (componentToFind, moduleDeclarations, moduleImports) => {
|
|
12
12
|
if (moduleDeclarations &&
|
|
13
|
-
moduleDeclarations.some((declaration) => declaration === componentToFind)) {
|
|
13
|
+
moduleDeclarations.flat().some((declaration) => declaration === componentToFind)) {
|
|
14
14
|
// Found component in declarations array
|
|
15
15
|
return true;
|
|
16
16
|
}
|
|
17
17
|
if (!moduleImports) {
|
|
18
18
|
return false;
|
|
19
19
|
}
|
|
20
|
-
return moduleImports.some((importItem) => {
|
|
20
|
+
return moduleImports.flat().some((importItem) => {
|
|
21
21
|
const extractedNgModuleMetadata = extractNgModuleMetadata(importItem);
|
|
22
22
|
if (!extractedNgModuleMetadata) {
|
|
23
23
|
// Not an NgModule
|
|
@@ -88,6 +88,7 @@ class PropertyExtractor {
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
+
exports.PropertyExtractor = PropertyExtractor;
|
|
91
92
|
_a = PropertyExtractor;
|
|
92
93
|
PropertyExtractor.analyzeRestricted = (ngModule) => {
|
|
93
94
|
if (ngModule === platform_browser_1.BrowserModule) {
|
|
@@ -159,4 +160,3 @@ PropertyExtractor.isDecoratorInstanceOf = (decorator, name) => {
|
|
|
159
160
|
}
|
|
160
161
|
return decorator instanceof factory || decorator.ngMetadataName === name;
|
|
161
162
|
};
|
|
162
|
-
exports.PropertyExtractor = PropertyExtractor;
|
|
@@ -20,7 +20,7 @@ var ButtonAccent;
|
|
|
20
20
|
(function (ButtonAccent) {
|
|
21
21
|
ButtonAccent["Normal"] = "Normal";
|
|
22
22
|
ButtonAccent["High"] = "High";
|
|
23
|
-
})(ButtonAccent
|
|
23
|
+
})(ButtonAccent || (exports.ButtonAccent = ButtonAccent = {}));
|
|
24
24
|
/**
|
|
25
25
|
* This is a simple button that demonstrates various JSDoc handling in Storybook Docs for Angular.
|
|
26
26
|
*
|
|
@@ -34,7 +34,7 @@ var ButtonAccent;
|
|
|
34
34
|
* @code `ThingThing`
|
|
35
35
|
* @html <span class="badge">aaa</span>
|
|
36
36
|
*/
|
|
37
|
-
let InputComponent = class InputComponent {
|
|
37
|
+
let InputComponent = exports.InputComponent = class InputComponent {
|
|
38
38
|
constructor() {
|
|
39
39
|
/** Appearance style of the button. */
|
|
40
40
|
this.appearance = 'secondary';
|
|
@@ -198,10 +198,9 @@ __decorate([
|
|
|
198
198
|
__metadata("design:type", Array),
|
|
199
199
|
__metadata("design:paramtypes", [Array])
|
|
200
200
|
], InputComponent.prototype, "item", null);
|
|
201
|
-
InputComponent = __decorate([
|
|
201
|
+
exports.InputComponent = InputComponent = __decorate([
|
|
202
202
|
(0, core_1.Component)({
|
|
203
203
|
selector: 'doc-button',
|
|
204
204
|
template: '<button>{{ label }}</button>',
|
|
205
205
|
})
|
|
206
206
|
], InputComponent);
|
|
207
|
-
exports.InputComponent = InputComponent;
|
|
@@ -47,6 +47,9 @@ exports.getWebpackConfig = async (baseConfig, { builderOptions, builderContext }
|
|
|
47
47
|
outputPath: 'noop-out',
|
|
48
48
|
// Options provided by user
|
|
49
49
|
...builderOptions,
|
|
50
|
+
styles: builderOptions.styles
|
|
51
|
+
?.map((style) => (typeof style === 'string' ? style : style.input))
|
|
52
|
+
.filter((style) => typeof style === 'string' || style.inject !== false),
|
|
50
53
|
// Fixed options
|
|
51
54
|
optimization: false,
|
|
52
55
|
namedChunks: false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/angular",
|
|
3
|
-
"version": "7.6.0-alpha.
|
|
3
|
+
"version": "7.6.0-alpha.5",
|
|
4
4
|
"description": "Storybook for Angular: Develop Angular components in isolation with hot reloading.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -37,20 +37,20 @@
|
|
|
37
37
|
"prep": "../../../scripts/prepare/tsc.ts"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@storybook/builder-webpack5": "7.6.0-alpha.
|
|
41
|
-
"@storybook/cli": "7.6.0-alpha.
|
|
42
|
-
"@storybook/client-logger": "7.6.0-alpha.
|
|
43
|
-
"@storybook/core-common": "7.6.0-alpha.
|
|
44
|
-
"@storybook/core-events": "7.6.0-alpha.
|
|
45
|
-
"@storybook/core-server": "7.6.0-alpha.
|
|
46
|
-
"@storybook/core-webpack": "7.6.0-alpha.
|
|
47
|
-
"@storybook/docs-tools": "7.6.0-alpha.
|
|
40
|
+
"@storybook/builder-webpack5": "7.6.0-alpha.5",
|
|
41
|
+
"@storybook/cli": "7.6.0-alpha.5",
|
|
42
|
+
"@storybook/client-logger": "7.6.0-alpha.5",
|
|
43
|
+
"@storybook/core-common": "7.6.0-alpha.5",
|
|
44
|
+
"@storybook/core-events": "7.6.0-alpha.5",
|
|
45
|
+
"@storybook/core-server": "7.6.0-alpha.5",
|
|
46
|
+
"@storybook/core-webpack": "7.6.0-alpha.5",
|
|
47
|
+
"@storybook/docs-tools": "7.6.0-alpha.5",
|
|
48
48
|
"@storybook/global": "^5.0.0",
|
|
49
|
-
"@storybook/manager-api": "7.6.0-alpha.
|
|
50
|
-
"@storybook/node-logger": "7.6.0-alpha.
|
|
51
|
-
"@storybook/preview-api": "7.6.0-alpha.
|
|
52
|
-
"@storybook/telemetry": "7.6.0-alpha.
|
|
53
|
-
"@storybook/types": "7.6.0-alpha.
|
|
49
|
+
"@storybook/manager-api": "7.6.0-alpha.5",
|
|
50
|
+
"@storybook/node-logger": "7.6.0-alpha.5",
|
|
51
|
+
"@storybook/preview-api": "7.6.0-alpha.5",
|
|
52
|
+
"@storybook/telemetry": "7.6.0-alpha.5",
|
|
53
|
+
"@storybook/types": "7.6.0-alpha.5",
|
|
54
54
|
"@types/node": "^18.0.0",
|
|
55
55
|
"@types/react": "^16.14.34",
|
|
56
56
|
"@types/react-dom": "^16.9.14",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"@types/cross-spawn": "^6.0.2",
|
|
82
82
|
"@types/tmp": "^0.2.3",
|
|
83
83
|
"cross-spawn": "^7.0.3",
|
|
84
|
-
"jest": "^29.
|
|
84
|
+
"jest": "^29.7.0",
|
|
85
85
|
"jest-preset-angular": "^13.0.1",
|
|
86
86
|
"jest-specific-snapshot": "^8.0.0",
|
|
87
87
|
"tmp": "^0.2.1",
|
|
@@ -90,17 +90,17 @@
|
|
|
90
90
|
"zone.js": "^0.13.0"
|
|
91
91
|
},
|
|
92
92
|
"peerDependencies": {
|
|
93
|
-
"@angular-devkit/architect": ">=0.1400.0 < 0.
|
|
94
|
-
"@angular-devkit/build-angular": ">=14.1.0 <
|
|
95
|
-
"@angular-devkit/core": ">=14.1.0 <
|
|
96
|
-
"@angular/cli": ">=14.1.0 <
|
|
97
|
-
"@angular/common": ">=14.1.0 <
|
|
98
|
-
"@angular/compiler": ">=14.1.0 <
|
|
99
|
-
"@angular/compiler-cli": ">=14.1.0 <
|
|
100
|
-
"@angular/core": ">=14.1.0 <
|
|
101
|
-
"@angular/forms": ">=14.1.0 <
|
|
102
|
-
"@angular/platform-browser": ">=14.1.0 <
|
|
103
|
-
"@angular/platform-browser-dynamic": ">=14.1.0 <
|
|
93
|
+
"@angular-devkit/architect": ">=0.1400.0 < 0.1800.0",
|
|
94
|
+
"@angular-devkit/build-angular": ">=14.1.0 < 18.0.0",
|
|
95
|
+
"@angular-devkit/core": ">=14.1.0 < 18.0.0",
|
|
96
|
+
"@angular/cli": ">=14.1.0 < 18.0.0",
|
|
97
|
+
"@angular/common": ">=14.1.0 < 18.0.0",
|
|
98
|
+
"@angular/compiler": ">=14.1.0 < 18.0.0",
|
|
99
|
+
"@angular/compiler-cli": ">=14.1.0 < 18.0.0",
|
|
100
|
+
"@angular/core": ">=14.1.0 < 18.0.0",
|
|
101
|
+
"@angular/forms": ">=14.1.0 < 18.0.0",
|
|
102
|
+
"@angular/platform-browser": ">=14.1.0 < 18.0.0",
|
|
103
|
+
"@angular/platform-browser-dynamic": ">=14.1.0 < 18.0.0",
|
|
104
104
|
"@babel/core": "*",
|
|
105
105
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
106
106
|
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/angular';
|
|
2
2
|
import { moduleMetadata } from '@storybook/angular';
|
|
3
|
-
import { within, userEvent } from '@storybook/testing-library';
|
|
4
3
|
import { CommonModule } from '@angular/common';
|
|
4
|
+
import { within, userEvent, expect } from '@storybook/test';
|
|
5
5
|
|
|
6
6
|
import Button from './button.component';
|
|
7
7
|
import Header from './header.component';
|
|
@@ -38,9 +38,12 @@ export const LoggedIn: Story = {
|
|
|
38
38
|
}),
|
|
39
39
|
play: async ({ canvasElement }) => {
|
|
40
40
|
const canvas = within(canvasElement);
|
|
41
|
-
const loginButton =
|
|
42
|
-
|
|
43
|
-
});
|
|
41
|
+
const loginButton = canvas.getByRole('button', { name: /Log in/i });
|
|
42
|
+
await expect(loginButton).toBeInTheDocument();
|
|
44
43
|
await userEvent.click(loginButton);
|
|
44
|
+
await expect(loginButton).not.toBeInTheDocument();
|
|
45
|
+
|
|
46
|
+
const logoutButton = canvas.getByRole('button', { name: /Log out/i });
|
|
47
|
+
await expect(logoutButton).toBeInTheDocument();
|
|
45
48
|
},
|
|
46
49
|
};
|