@storybook/angular 7.0.0-alpha.50 → 7.0.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.
- package/dist/builders/build-storybook/index.d.ts +2 -2
- package/dist/builders/start-storybook/index.d.ts +2 -2
- package/dist/builders/utils/standalone-options.d.ts +1 -1
- package/dist/client/angular-beta/AbstractRenderer.d.ts +1 -1
- package/dist/client/angular-beta/AbstractRenderer.js +13 -13
- package/dist/client/angular-beta/RendererFactory.d.ts +1 -1
- package/dist/client/angular-beta/utils/NgComponentAnalyzer.d.ts +1 -1
- package/dist/client/docs/__testfixtures__/doc-button/input.d.ts +1 -1
- package/dist/client/docs/types.d.ts +1 -1
- package/dist/client/public-types.d.ts +7 -7
- package/dist/client/types.d.ts +3 -3
- package/dist/server/preset-options.d.ts +1 -1
- package/dist/types.d.ts +5 -5
- package/package.json +19 -19
- package/template/cli/Button.stories.ts +2 -5
- package/template/cli/Header.stories.ts +2 -2
- package/template/cli/Page.stories.ts +2 -2
|
@@ -2,7 +2,7 @@ import { BuilderOutput } from '@angular-devkit/architect';
|
|
|
2
2
|
import { JsonObject } from '@angular-devkit/core';
|
|
3
3
|
import { CLIOptions } from '@storybook/types';
|
|
4
4
|
import { ExtraEntryPoint, StylePreprocessorOptions } from '@angular-devkit/build-angular';
|
|
5
|
-
export
|
|
5
|
+
export type StorybookBuilderOptions = JsonObject & {
|
|
6
6
|
browserTarget?: string | null;
|
|
7
7
|
tsConfig?: string;
|
|
8
8
|
compodoc: boolean;
|
|
@@ -10,6 +10,6 @@ export declare type StorybookBuilderOptions = JsonObject & {
|
|
|
10
10
|
styles?: ExtraEntryPoint[];
|
|
11
11
|
stylePreprocessorOptions?: StylePreprocessorOptions;
|
|
12
12
|
} & Pick<CLIOptions, 'outputDir' | 'configDir' | 'loglevel' | 'quiet' | 'docs' | 'webpackStatsJson'>;
|
|
13
|
-
export
|
|
13
|
+
export type StorybookBuilderOutput = JsonObject & BuilderOutput & {};
|
|
14
14
|
declare const _default: import("@angular-devkit/architect/src/internal").Builder<any>;
|
|
15
15
|
export default _default;
|
|
@@ -2,7 +2,7 @@ import { BuilderOutput } from '@angular-devkit/architect';
|
|
|
2
2
|
import { JsonObject } from '@angular-devkit/core';
|
|
3
3
|
import { ExtraEntryPoint, StylePreprocessorOptions } from '@angular-devkit/build-angular';
|
|
4
4
|
import { CLIOptions } from '@storybook/types';
|
|
5
|
-
export
|
|
5
|
+
export type StorybookBuilderOptions = JsonObject & {
|
|
6
6
|
browserTarget?: string | null;
|
|
7
7
|
tsConfig?: string;
|
|
8
8
|
compodoc: boolean;
|
|
@@ -10,6 +10,6 @@ export declare type StorybookBuilderOptions = JsonObject & {
|
|
|
10
10
|
styles?: ExtraEntryPoint[];
|
|
11
11
|
stylePreprocessorOptions?: StylePreprocessorOptions;
|
|
12
12
|
} & Pick<CLIOptions, 'port' | 'host' | 'configDir' | 'https' | 'sslCa' | 'sslCert' | 'sslKey' | 'smokeTest' | 'ci' | 'quiet' | 'docs'>;
|
|
13
|
-
export
|
|
13
|
+
export type StorybookBuilderOutput = JsonObject & BuilderOutput & {};
|
|
14
14
|
declare const _default: import("@angular-devkit/architect/src/internal").Builder<any>;
|
|
15
15
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BuilderContext } from '@angular-devkit/architect';
|
|
2
2
|
import { LoadOptions, CLIOptions, BuilderOptions } from '@storybook/types';
|
|
3
|
-
export
|
|
3
|
+
export type StandaloneOptions = Partial<CLIOptions & LoadOptions & BuilderOptions & {
|
|
4
4
|
mode?: 'static' | 'dev';
|
|
5
5
|
angularBrowserTarget?: string | null;
|
|
6
6
|
angularBuilderOptions?: Record<string, any> & {
|
|
@@ -39,19 +39,6 @@ function getPlatform(newPlatform) {
|
|
|
39
39
|
return platformRef;
|
|
40
40
|
}
|
|
41
41
|
class AbstractRenderer {
|
|
42
|
-
constructor(storyId) {
|
|
43
|
-
this.storyId = storyId;
|
|
44
|
-
if (typeof NODE_ENV === 'string' && NODE_ENV !== 'development') {
|
|
45
|
-
try {
|
|
46
|
-
// platform should be set after enableProdMode()
|
|
47
|
-
(0, core_1.enableProdMode)();
|
|
48
|
-
}
|
|
49
|
-
catch (e) {
|
|
50
|
-
// eslint-disable-next-line no-console
|
|
51
|
-
console.debug(e);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
42
|
/**
|
|
56
43
|
* Wait and destroy the platform
|
|
57
44
|
*/
|
|
@@ -71,6 +58,19 @@ class AbstractRenderer {
|
|
|
71
58
|
getPlatform(true);
|
|
72
59
|
});
|
|
73
60
|
}
|
|
61
|
+
constructor(storyId) {
|
|
62
|
+
this.storyId = storyId;
|
|
63
|
+
if (typeof NODE_ENV === 'string' && NODE_ENV !== 'development') {
|
|
64
|
+
try {
|
|
65
|
+
// platform should be set after enableProdMode()
|
|
66
|
+
(0, core_1.enableProdMode)();
|
|
67
|
+
}
|
|
68
|
+
catch (e) {
|
|
69
|
+
// eslint-disable-next-line no-console
|
|
70
|
+
console.debug(e);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
74
|
/**
|
|
75
75
|
* Bootstrap main angular module with main component or send only new `props` with storyProps$
|
|
76
76
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventEmitter, ElementRef } from '@angular/core';
|
|
2
2
|
export declare const exportedConstant = "An exported constant";
|
|
3
|
-
export
|
|
3
|
+
export type ButtonSize = 'small' | 'medium' | 'large' | 'xlarge';
|
|
4
4
|
export declare enum ButtonAccent {
|
|
5
5
|
'Normal' = "Normal",
|
|
6
6
|
'High' = "High"
|
|
@@ -8,19 +8,19 @@ export type { AngularRenderer };
|
|
|
8
8
|
*
|
|
9
9
|
* @see [Default export](https://storybook.js.org/docs/formats/component-story-format/#default-export)
|
|
10
10
|
*/
|
|
11
|
-
export
|
|
11
|
+
export type Meta<TArgs = Args> = ComponentAnnotations<AngularRenderer, TArgs>;
|
|
12
12
|
/**
|
|
13
13
|
* Story function that represents a CSFv2 component example.
|
|
14
14
|
*
|
|
15
15
|
* @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
|
|
16
16
|
*/
|
|
17
|
-
export
|
|
17
|
+
export type StoryFn<TArgs = Args> = AnnotatedStoryFn<AngularRenderer, TArgs>;
|
|
18
18
|
/**
|
|
19
19
|
* Story function that represents a CSFv3 component example.
|
|
20
20
|
*
|
|
21
21
|
* @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
|
|
22
22
|
*/
|
|
23
|
-
export
|
|
23
|
+
export type StoryObj<TArgs = Args> = StoryAnnotations<AngularRenderer, TArgs>;
|
|
24
24
|
/**
|
|
25
25
|
* @deprecated Use `StoryFn` instead.
|
|
26
26
|
* Use `StoryObj` if you want to migrate to CSF3, which uses objects instead of functions to represent stories.
|
|
@@ -30,7 +30,7 @@ export declare type StoryObj<TArgs = Args> = StoryAnnotations<AngularRenderer, T
|
|
|
30
30
|
*
|
|
31
31
|
* @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
|
|
32
32
|
*/
|
|
33
|
-
export
|
|
34
|
-
export
|
|
35
|
-
export
|
|
36
|
-
export
|
|
33
|
+
export type Story<TArgs = Args> = StoryFn<TArgs>;
|
|
34
|
+
export type Decorator<TArgs = StrictArgs> = DecoratorFunction<AngularRenderer, TArgs>;
|
|
35
|
+
export type Loader<TArgs = StrictArgs> = LoaderFunction<AngularRenderer, TArgs>;
|
|
36
|
+
export type StoryContext<TArgs = StrictArgs> = GenericStoryContext<AngularRenderer, TArgs>;
|
package/dist/client/types.d.ts
CHANGED
|
@@ -23,16 +23,16 @@ export interface StoryFnAngularReturnType {
|
|
|
23
23
|
/**
|
|
24
24
|
* @deprecated Use `AngularRenderer` instead.
|
|
25
25
|
*/
|
|
26
|
-
export
|
|
26
|
+
export type AngularFramework = AngularRenderer;
|
|
27
27
|
export interface AngularRenderer extends WebRenderer {
|
|
28
28
|
component: any;
|
|
29
29
|
storyResult: StoryFnAngularReturnType;
|
|
30
30
|
}
|
|
31
|
-
export
|
|
31
|
+
export type Parameters = DefaultParameters & {
|
|
32
32
|
/** Uses legacy angular rendering engine that use dynamic component */
|
|
33
33
|
angularLegacyRendering?: boolean;
|
|
34
34
|
bootstrapModuleOptions?: unknown;
|
|
35
35
|
};
|
|
36
|
-
export
|
|
36
|
+
export type StoryContext = DefaultStoryContext<AngularRenderer> & {
|
|
37
37
|
parameters: Parameters;
|
|
38
38
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Options as CoreOptions } from '@storybook/types';
|
|
2
2
|
import { BuilderContext } from '@angular-devkit/architect';
|
|
3
3
|
import { ExtraEntryPoint, StylePreprocessorOptions } from '@angular-devkit/build-angular';
|
|
4
|
-
export
|
|
4
|
+
export type PresetOptions = CoreOptions & {
|
|
5
5
|
angularBrowserTarget?: string | null;
|
|
6
6
|
angularBuilderOptions?: {
|
|
7
7
|
styles?: ExtraEntryPoint[];
|
package/dist/types.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { StorybookConfig as StorybookConfigBase, TypescriptOptions as TypescriptOptionsReact } from '@storybook/core-webpack';
|
|
2
2
|
import { StorybookConfigWebpack, BuilderOptions, TypescriptOptions as TypescriptOptionsBuilder } from '@storybook/builder-webpack5';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export
|
|
3
|
+
type FrameworkName = '@storybook/angular';
|
|
4
|
+
type BuilderName = '@storybook/builder-webpack5';
|
|
5
|
+
export type FrameworkOptions = AngularOptions & {
|
|
6
6
|
builder?: BuilderOptions;
|
|
7
7
|
};
|
|
8
|
-
|
|
8
|
+
type StorybookConfigFramework = {
|
|
9
9
|
framework: FrameworkName | {
|
|
10
10
|
name: FrameworkName;
|
|
11
11
|
options: FrameworkOptions;
|
|
@@ -21,7 +21,7 @@ declare type StorybookConfigFramework = {
|
|
|
21
21
|
/**
|
|
22
22
|
* The interface for Storybook configuration in `main.ts` files.
|
|
23
23
|
*/
|
|
24
|
-
export
|
|
24
|
+
export type StorybookConfig = Omit<StorybookConfigBase, keyof StorybookConfigWebpack | keyof StorybookConfigFramework> & StorybookConfigWebpack & StorybookConfigFramework;
|
|
25
25
|
export interface AngularOptions {
|
|
26
26
|
enableIvy?: boolean;
|
|
27
27
|
enableNgcc?: boolean;
|
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.51",
|
|
4
4
|
"description": "Storybook for Angular: Develop Angular components in isolation with hot reloading.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -34,21 +34,21 @@
|
|
|
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.
|
|
50
|
-
"@types/node": "^16.0.0",
|
|
51
|
-
"@types/react": "^16.14.
|
|
37
|
+
"@storybook/addons": "7.0.0-alpha.51",
|
|
38
|
+
"@storybook/api": "7.0.0-alpha.51",
|
|
39
|
+
"@storybook/builder-webpack5": "7.0.0-alpha.51",
|
|
40
|
+
"@storybook/client-logger": "7.0.0-alpha.51",
|
|
41
|
+
"@storybook/core-client": "7.0.0-alpha.51",
|
|
42
|
+
"@storybook/core-common": "7.0.0-alpha.51",
|
|
43
|
+
"@storybook/core-events": "7.0.0-alpha.51",
|
|
44
|
+
"@storybook/core-server": "7.0.0-alpha.51",
|
|
45
|
+
"@storybook/core-webpack": "7.0.0-alpha.51",
|
|
46
|
+
"@storybook/docs-tools": "7.0.0-alpha.51",
|
|
47
|
+
"@storybook/node-logger": "7.0.0-alpha.51",
|
|
48
|
+
"@storybook/store": "7.0.0-alpha.51",
|
|
49
|
+
"@storybook/types": "7.0.0-alpha.51",
|
|
50
|
+
"@types/node": "^16.0.0 || ^18.0.0",
|
|
51
|
+
"@types/react": "^16.14.34",
|
|
52
52
|
"@types/react-dom": "^16.9.14",
|
|
53
53
|
"@types/semver": "^7.3.4",
|
|
54
54
|
"@types/webpack-env": "^1.18.0",
|
|
@@ -81,12 +81,12 @@
|
|
|
81
81
|
"@types/rimraf": "^3.0.2",
|
|
82
82
|
"@types/tmp": "^0.2.3",
|
|
83
83
|
"cross-spawn": "^7.0.3",
|
|
84
|
-
"jest": "^
|
|
84
|
+
"jest": "^29.3.1",
|
|
85
85
|
"jest-preset-angular": "^12.0.0",
|
|
86
86
|
"jest-specific-snapshot": "^6.0.0",
|
|
87
87
|
"rimraf": "^3.0.2",
|
|
88
88
|
"tmp": "^0.2.1",
|
|
89
|
-
"typescript": "
|
|
89
|
+
"typescript": "^4.9.3",
|
|
90
90
|
"webpack": "5",
|
|
91
91
|
"zone.js": "^0.11.0"
|
|
92
92
|
},
|
|
@@ -123,5 +123,5 @@
|
|
|
123
123
|
"access": "public"
|
|
124
124
|
},
|
|
125
125
|
"builders": "dist/builders/builders.json",
|
|
126
|
-
"gitHead": "
|
|
126
|
+
"gitHead": "4fec76c3f5135854d9834ebc1cf2f1f325696ded"
|
|
127
127
|
}
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/angular';
|
|
2
2
|
import Button from './button.component';
|
|
3
3
|
|
|
4
|
-
// More on how to set up stories at: https://storybook.js.org/docs/angular/writing-stories/introduction
|
|
4
|
+
// More on how to set up stories at: https://storybook.js.org/docs/7.0/angular/writing-stories/introduction
|
|
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
8
|
tags: ['docsPage'],
|
|
10
|
-
// More on component templates: https://storybook.js.org/docs/angular/writing-stories/introduction#using-args
|
|
11
9
|
render: (args: Button) => ({
|
|
12
10
|
props: {
|
|
13
11
|
backgroundColor: null,
|
|
14
12
|
...args,
|
|
15
13
|
},
|
|
16
14
|
}),
|
|
17
|
-
// More on argTypes: https://storybook.js.org/docs/angular/api/argtypes
|
|
18
15
|
argTypes: {
|
|
19
16
|
backgroundColor: {
|
|
20
17
|
control: 'color',
|
|
@@ -25,7 +22,7 @@ const meta: Meta<Button> = {
|
|
|
25
22
|
export default meta;
|
|
26
23
|
type Story = StoryObj<Button>;
|
|
27
24
|
|
|
28
|
-
// More on
|
|
25
|
+
// More on writing stories with args: https://storybook.js.org/docs/7.0/angular/writing-stories/args
|
|
29
26
|
export const Primary: Story = {
|
|
30
27
|
args: {
|
|
31
28
|
primary: true,
|
|
@@ -8,7 +8,7 @@ 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
|
|
11
|
+
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/7.0/angular/writing-docs/docs-page
|
|
12
12
|
tags: ['docsPage'],
|
|
13
13
|
render: (args) => ({ props: args }),
|
|
14
14
|
decorators: [
|
|
@@ -18,7 +18,7 @@ const meta: Meta<Header> = {
|
|
|
18
18
|
}),
|
|
19
19
|
],
|
|
20
20
|
parameters: {
|
|
21
|
-
// More on
|
|
21
|
+
// More on how to position stories at: https://storybook.js.org/docs/7.0/angular/configure/story-layout
|
|
22
22
|
layout: 'fullscreen',
|
|
23
23
|
},
|
|
24
24
|
};
|
|
@@ -11,7 +11,7 @@ const meta: Meta<Page> = {
|
|
|
11
11
|
title: 'Example/Page',
|
|
12
12
|
component: Page,
|
|
13
13
|
parameters: {
|
|
14
|
-
// More on
|
|
14
|
+
// More on how to position stories at: https://storybook.js.org/docs/7.0/angular/configure/story-layout
|
|
15
15
|
layout: 'fullscreen',
|
|
16
16
|
},
|
|
17
17
|
decorators: [
|
|
@@ -31,7 +31,7 @@ export const LoggedOut: Story = {
|
|
|
31
31
|
}),
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
// More on interaction testing: https://storybook.js.org/docs/angular/writing-tests/interaction-testing
|
|
34
|
+
// More on interaction testing: https://storybook.js.org/docs/7.0/angular/writing-tests/interaction-testing
|
|
35
35
|
export const LoggedIn: Story = {
|
|
36
36
|
render: (args: Page) => ({
|
|
37
37
|
props: args,
|