@storybook/angular 7.0.0-alpha.4 → 7.0.0-alpha.40
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/README.md +1 -1
- package/dist/types/builders/utils/build-standalone-errors-handler.js +3 -6
- package/dist/types/builders/utils/run-compodoc.js +0 -1
- package/dist/types/client/{preview/angular/components → angular}/app.component.d.ts +1 -1
- package/dist/types/client/{preview/angular/components → angular}/app.component.js +1 -1
- package/dist/types/client/{preview/angular → angular}/app.token.d.ts +0 -0
- package/dist/types/client/{preview/angular → angular}/app.token.js +0 -0
- package/dist/types/client/{preview/angular → angular}/helpers.d.ts +1 -1
- package/dist/types/client/{preview/angular → angular}/helpers.js +2 -3
- package/dist/types/client/{preview/angular-beta → angular-beta}/AbstractRenderer.d.ts +1 -2
- package/dist/types/client/{preview/angular-beta → angular-beta}/AbstractRenderer.js +0 -0
- package/dist/types/client/{preview/angular-beta → angular-beta}/CanvasRenderer.d.ts +1 -2
- package/dist/types/client/{preview/angular-beta → angular-beta}/CanvasRenderer.js +0 -0
- package/dist/types/client/{preview/angular-beta → angular-beta}/ComputesTemplateFromComponent.d.ts +0 -0
- package/dist/types/client/{preview/angular-beta → angular-beta}/ComputesTemplateFromComponent.js +0 -0
- package/dist/types/client/{preview/angular-beta → angular-beta}/DocsRenderer.d.ts +1 -2
- package/dist/types/client/{preview/angular-beta → angular-beta}/DocsRenderer.js +0 -0
- package/dist/types/client/{preview/angular-beta → angular-beta}/RendererFactory.d.ts +0 -0
- package/dist/types/client/{preview/angular-beta → angular-beta}/RendererFactory.js +3 -3
- package/dist/types/client/{preview/angular-beta → angular-beta}/StorybookModule.d.ts +1 -1
- package/dist/types/client/{preview/angular-beta → angular-beta}/StorybookModule.js +3 -30
- package/dist/types/client/{preview/angular-beta → angular-beta}/StorybookProvider.d.ts +0 -0
- package/dist/types/client/{preview/angular-beta → angular-beta}/StorybookProvider.js +0 -0
- package/dist/types/client/{preview/angular-beta → angular-beta}/StorybookWrapperComponent.d.ts +0 -0
- package/dist/types/client/{preview/angular-beta → angular-beta}/StorybookWrapperComponent.js +0 -0
- package/dist/types/client/{preview/angular-beta → angular-beta}/utils/NgComponentAnalyzer.d.ts +0 -0
- package/dist/types/client/{preview/angular-beta → angular-beta}/utils/NgComponentAnalyzer.js +0 -0
- package/dist/types/client/{preview/angular-beta → angular-beta}/utils/NgModulesAnalyzer.d.ts +0 -0
- package/dist/types/client/{preview/angular-beta → angular-beta}/utils/NgModulesAnalyzer.js +0 -0
- package/dist/types/client/{preview/config.d.ts → config.d.ts} +2 -2
- package/dist/types/client/{preview/config.js → config.js} +2 -2
- package/dist/types/client/{preview/decorateStory.d.ts → decorateStory.d.ts} +1 -1
- package/dist/types/client/{preview/decorateStory.js → decorateStory.js} +1 -1
- package/dist/types/client/{preview/decorators.d.ts → decorators.d.ts} +1 -2
- package/dist/types/client/{preview/decorators.js → decorators.js} +0 -0
- package/dist/types/client/docs/compodoc.js +2 -3
- package/dist/types/client/docs/config.d.ts +3 -3
- package/dist/types/client/docs/sourceDecorator.d.ts +2 -2
- package/dist/types/client/{preview/angular-polyfills.d.ts → globals.d.ts} +0 -10
- package/dist/types/client/{preview/angular-polyfills.js → globals.js} +7 -1
- package/dist/types/client/index.d.ts +5 -4
- package/dist/types/client/index.js +6 -12
- package/dist/types/client/{preview/index.d.ts → public-api.d.ts} +2 -12
- package/dist/types/client/public-api.js +36 -0
- package/dist/types/client/{preview/types-6-0.d.ts → public-types.d.ts} +4 -19
- package/dist/types/client/{preview/types-6-0.js → public-types.js} +0 -0
- package/dist/types/client/{preview/render.d.ts → render.d.ts} +1 -1
- package/dist/types/client/{preview/render.js → render.js} +0 -0
- package/dist/types/client/{preview/types.d.ts → types.d.ts} +13 -8
- package/dist/types/client/{preview/types.js → types.js} +0 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/preset.d.ts +4 -11
- package/dist/types/preset.js +12 -9
- package/dist/types/renderer.d.ts +4 -4
- package/dist/types/renderer.js +4 -4
- package/dist/types/server/__mocks-ng-workspace__/minimal-config/tsconfig.json +1 -4
- package/dist/types/server/__mocks-ng-workspace__/some-config/tsconfig.json +1 -4
- package/dist/types/server/__mocks-ng-workspace__/with-angularBrowserTarget/tsconfig.json +1 -4
- package/dist/types/server/__mocks-ng-workspace__/with-lib/projects/pattern-lib/tsconfig.lib.json +2 -8
- package/dist/types/server/__mocks-ng-workspace__/with-lib/tsconfig.json +1 -4
- package/dist/types/server/__mocks-ng-workspace__/with-nx/tsconfig.json +2 -7
- package/dist/types/server/__mocks-ng-workspace__/with-nx-workspace/tsconfig.json +2 -7
- package/dist/types/server/__mocks-ng-workspace__/with-options-styles/tsconfig.json +1 -4
- package/dist/types/server/__mocks-ng-workspace__/without-projects-entry/projects/pattern-lib/tsconfig.lib.json +2 -8
- package/dist/types/server/__mocks-ng-workspace__/without-projects-entry/tsconfig.json +1 -4
- package/dist/types/server/__mocks-ng-workspace__/without-tsConfig/tsconfig.json +1 -4
- package/dist/types/server/framework-preset-angular-cli.js +3 -22
- package/dist/types/server/framework-preset-angular-ivy.js +3 -1
- package/dist/types/types.d.ts +25 -9
- package/package.json +35 -42
- package/LICENSE +0 -21
- package/dist/types/client/preview/globals.d.ts +0 -1
- package/dist/types/client/preview/globals.js +0 -9
- package/dist/types/client/preview/index.js +0 -29
- package/dist/types/client/preview/types-7-0.d.ts +0 -9
- package/dist/types/client/preview/types-7-0.js +0 -2
- package/dist/types/server/angular-cli-webpack-12.2.x.d.ts +0 -1
- package/dist/types/server/angular-cli-webpack-12.2.x.js +0 -66
- package/dist/types/server/angular-cli-webpack-older.d.ts +0 -6
- package/dist/types/server/angular-cli-webpack-older.js +0 -111
- package/dist/types/server/angular-devkit-build-webpack.d.ts +0 -30
- package/dist/types/server/angular-devkit-build-webpack.js +0 -164
- package/dist/types/server/create-fork-ts-checker-plugin.d.ts +0 -3
- package/dist/types/server/create-fork-ts-checker-plugin.js +0 -19
- package/dist/types/server/framework-preset-angular.d.ts +0 -5
- package/dist/types/server/framework-preset-angular.js +0 -103
- package/dist/types/server/ngx-template-loader/index.d.ts +0 -1
- package/dist/types/server/ngx-template-loader/index.js +0 -46
- package/dist/types/server/ts_config.d.ts +0 -2
- package/dist/types/server/ts_config.js +0 -28
- package/types-6-0.d.ts +0 -1
- package/types-7-0.d.ts +0 -1
package/README.md
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.buildStandaloneErrorHandler = void 0;
|
|
7
4
|
const node_logger_1 = require("@storybook/node-logger");
|
|
8
|
-
const ts_dedent_1 =
|
|
5
|
+
const ts_dedent_1 = require("ts-dedent");
|
|
9
6
|
const buildStandaloneErrorHandler = (error) => {
|
|
10
7
|
// Duplicate code for Standalone error handling
|
|
11
8
|
// Source: https://github.com/storybookjs/storybook/blob/39c7ba09ad84fbd466f9c25d5b92791a5450b9f6/lib/core-server/src/build-dev.ts#L136
|
|
@@ -26,11 +23,11 @@ const buildStandaloneErrorHandler = (error) => {
|
|
|
26
23
|
}
|
|
27
24
|
node_logger_1.logger.line();
|
|
28
25
|
return error.close
|
|
29
|
-
? (0, ts_dedent_1.
|
|
26
|
+
? (0, ts_dedent_1.dedent) `
|
|
30
27
|
FATAL broken build!, will close the process,
|
|
31
28
|
Fix the error below and restart storybook.
|
|
32
29
|
`
|
|
33
|
-
: (0, ts_dedent_1.
|
|
30
|
+
: (0, ts_dedent_1.dedent) `
|
|
34
31
|
Broken build, fix the error above.
|
|
35
32
|
You may need to refresh the browser.
|
|
36
33
|
`;
|
|
@@ -48,7 +48,6 @@ const runCompodoc = ({ compodocArgs, tsconfig }, context) => {
|
|
|
48
48
|
context.logger.info(finalCompodocArgs.join(' '));
|
|
49
49
|
const child = (0, child_process_1.spawn)('npx', finalCompodocArgs, {
|
|
50
50
|
cwd: context.workspaceRoot,
|
|
51
|
-
env: process.env,
|
|
52
51
|
shell: true,
|
|
53
52
|
});
|
|
54
53
|
child.stdout.on('data', (data) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OnInit, ViewContainerRef, ComponentFactoryResolver, OnDestroy, ChangeDetectorRef } from '@angular/core';
|
|
2
2
|
import { Observable, Subscription } from 'rxjs';
|
|
3
|
-
import { StoryFnAngularReturnType } from '
|
|
3
|
+
import { StoryFnAngularReturnType } from '../types';
|
|
4
4
|
export declare class AppComponent implements OnInit, OnDestroy {
|
|
5
5
|
private cfr;
|
|
6
6
|
private changeDetectorRef;
|
|
@@ -21,7 +21,7 @@ exports.AppComponent = void 0;
|
|
|
21
21
|
const core_1 = require("@angular/core");
|
|
22
22
|
const rxjs_1 = require("rxjs");
|
|
23
23
|
const operators_1 = require("rxjs/operators");
|
|
24
|
-
const app_token_1 = require("
|
|
24
|
+
const app_token_1 = require("./app.token");
|
|
25
25
|
let AppComponent = class AppComponent {
|
|
26
26
|
constructor(cfr, changeDetectorRef, data) {
|
|
27
27
|
this.cfr = cfr;
|
|
File without changes
|
|
File without changes
|
|
@@ -4,14 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.renderNgApp = void 0;
|
|
7
|
-
// @ts-ignore
|
|
8
7
|
const global_1 = __importDefault(require("global"));
|
|
9
8
|
const core_1 = require("@angular/core");
|
|
10
9
|
const forms_1 = require("@angular/forms");
|
|
11
10
|
const platform_browser_dynamic_1 = require("@angular/platform-browser-dynamic");
|
|
12
11
|
const platform_browser_1 = require("@angular/platform-browser");
|
|
13
12
|
const rxjs_1 = require("rxjs");
|
|
14
|
-
const app_component_1 = require("./
|
|
13
|
+
const app_component_1 = require("./app.component");
|
|
15
14
|
const app_token_1 = require("./app.token");
|
|
16
15
|
const { document } = global_1.default;
|
|
17
16
|
let platform = null;
|
|
@@ -111,7 +110,7 @@ const initModule = (storyFn) => {
|
|
|
111
110
|
};
|
|
112
111
|
return getModule(componentDeclarations, [AnnotatedComponent], [app_component_1.AppComponent], story, moduleMetadata);
|
|
113
112
|
};
|
|
114
|
-
const staticRoot = document.getElementById('root');
|
|
113
|
+
const staticRoot = document.getElementById('storybook-root');
|
|
115
114
|
const insertDynamicRoot = () => {
|
|
116
115
|
const app = document.createElement('storybook-dynamic-app-root');
|
|
117
116
|
staticRoot.innerHTML = '';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Subject } from 'rxjs';
|
|
2
|
-
import { ICollection, StoryFnAngularReturnType } from '../types';
|
|
3
|
-
import { Parameters } from '../types-6-0';
|
|
2
|
+
import { ICollection, StoryFnAngularReturnType, Parameters } from '../types';
|
|
4
3
|
declare type StoryRenderInfo = {
|
|
5
4
|
storyFnAngular: StoryFnAngularReturnType;
|
|
6
5
|
moduleMetadataSnapshot: string;
|
|
File without changes
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { AbstractRenderer } from './AbstractRenderer';
|
|
2
|
-
import { StoryFnAngularReturnType } from '../types';
|
|
3
|
-
import { Parameters } from '../types-6-0';
|
|
2
|
+
import { StoryFnAngularReturnType, Parameters } from '../types';
|
|
4
3
|
export declare class CanvasRenderer extends AbstractRenderer {
|
|
5
4
|
render(options: {
|
|
6
5
|
storyFnAngular: StoryFnAngularReturnType;
|
|
File without changes
|
package/dist/types/client/{preview/angular-beta → angular-beta}/ComputesTemplateFromComponent.d.ts
RENAMED
|
File without changes
|
package/dist/types/client/{preview/angular-beta → angular-beta}/ComputesTemplateFromComponent.js
RENAMED
|
File without changes
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { AbstractRenderer } from './AbstractRenderer';
|
|
2
|
-
import { StoryFnAngularReturnType } from '../types';
|
|
3
|
-
import { Parameters } from '../types-6-0';
|
|
2
|
+
import { StoryFnAngularReturnType, Parameters } from '../types';
|
|
4
3
|
export declare class DocsRenderer extends AbstractRenderer {
|
|
5
4
|
render(options: {
|
|
6
5
|
storyFnAngular: StoryFnAngularReturnType;
|
|
File without changes
|
|
File without changes
|
|
@@ -37,16 +37,16 @@ class RendererFactory {
|
|
|
37
37
|
}
|
|
38
38
|
exports.RendererFactory = RendererFactory;
|
|
39
39
|
const getRenderType = (targetDOMNode) => {
|
|
40
|
-
return targetDOMNode.id === 'root' ? 'canvas' : 'docs';
|
|
40
|
+
return targetDOMNode.id === 'storybook-root' ? 'canvas' : 'docs';
|
|
41
41
|
};
|
|
42
42
|
exports.getRenderType = getRenderType;
|
|
43
43
|
function clearRootHTMLElement(renderType) {
|
|
44
44
|
switch (renderType) {
|
|
45
45
|
case 'canvas':
|
|
46
|
-
global.document.getElementById('docs
|
|
46
|
+
global.document.getElementById('storybook-docs').innerHTML = '';
|
|
47
47
|
break;
|
|
48
48
|
case 'docs':
|
|
49
|
-
global.document.getElementById('root').innerHTML = '';
|
|
49
|
+
global.document.getElementById('storybook-root').innerHTML = '';
|
|
50
50
|
break;
|
|
51
51
|
default:
|
|
52
52
|
break;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NgModule, Type } from '@angular/core';
|
|
2
2
|
import { Subject } from 'rxjs';
|
|
3
3
|
import { ICollection, StoryFnAngularReturnType } from '../types';
|
|
4
|
-
export declare const getStorybookModuleMetadata: ({ storyFnAngular, component
|
|
4
|
+
export declare const getStorybookModuleMetadata: ({ storyFnAngular, component, targetSelector, }: {
|
|
5
5
|
storyFnAngular: StoryFnAngularReturnType;
|
|
6
6
|
component?: any;
|
|
7
7
|
targetSelector: string;
|
|
@@ -5,41 +5,17 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
};
|
|
8
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
-
};
|
|
11
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
9
|
exports.createStorybookModule = exports.getStorybookModuleMetadata = void 0;
|
|
13
10
|
const core_1 = require("@angular/core");
|
|
14
11
|
const platform_browser_1 = require("@angular/platform-browser");
|
|
15
|
-
const ts_dedent_1 = __importDefault(require("ts-dedent"));
|
|
16
|
-
const util_deprecate_1 = __importDefault(require("util-deprecate"));
|
|
17
12
|
const StorybookProvider_1 = require("./StorybookProvider");
|
|
18
13
|
const NgModulesAnalyzer_1 = require("./utils/NgModulesAnalyzer");
|
|
19
14
|
const NgComponentAnalyzer_1 = require("./utils/NgComponentAnalyzer");
|
|
20
15
|
const StorybookWrapperComponent_1 = require("./StorybookWrapperComponent");
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
or
|
|
25
|
-
\`\`\`
|
|
26
|
-
export const Primary: Story = () => ({});
|
|
27
|
-
Primary.parameters = { component: AppComponent };
|
|
28
|
-
\`\`\`
|
|
29
|
-
Read more at
|
|
30
|
-
- https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#deprecated-angular-story-component).
|
|
31
|
-
- https://storybook.js.org/docs/angular/writing-stories/parameters
|
|
32
|
-
`);
|
|
33
|
-
const getStorybookModuleMetadata = ({ storyFnAngular, component: annotatedComponent, targetSelector, }, storyProps$) => {
|
|
34
|
-
const { component: storyComponent, props, styles, moduleMetadata = {} } = storyFnAngular;
|
|
35
|
-
let { template } = storyFnAngular;
|
|
36
|
-
if (storyComponent) {
|
|
37
|
-
deprecatedStoryComponentWarning();
|
|
38
|
-
}
|
|
39
|
-
const component = storyComponent ?? annotatedComponent;
|
|
40
|
-
if (hasNoTemplate(template) && component) {
|
|
41
|
-
template = (0, ComputesTemplateFromComponent_1.computesTemplateFromComponent)(component, props, '');
|
|
42
|
-
}
|
|
16
|
+
const getStorybookModuleMetadata = ({ storyFnAngular, component, targetSelector, }, storyProps$) => {
|
|
17
|
+
const { props, styles, moduleMetadata = {} } = storyFnAngular;
|
|
18
|
+
const { template } = storyFnAngular;
|
|
43
19
|
/**
|
|
44
20
|
* Create a component that wraps generated template and gives it props
|
|
45
21
|
*/
|
|
@@ -76,6 +52,3 @@ const createStorybookModule = (ngModule) => {
|
|
|
76
52
|
return StorybookModule;
|
|
77
53
|
};
|
|
78
54
|
exports.createStorybookModule = createStorybookModule;
|
|
79
|
-
function hasNoTemplate(template) {
|
|
80
|
-
return template === null || template === undefined;
|
|
81
|
-
}
|
|
File without changes
|
|
File without changes
|
package/dist/types/client/{preview/angular-beta → angular-beta}/StorybookWrapperComponent.d.ts
RENAMED
|
File without changes
|
package/dist/types/client/{preview/angular-beta → angular-beta}/StorybookWrapperComponent.js
RENAMED
|
File without changes
|
package/dist/types/client/{preview/angular-beta → angular-beta}/utils/NgComponentAnalyzer.d.ts
RENAMED
|
File without changes
|
package/dist/types/client/{preview/angular-beta → angular-beta}/utils/NgComponentAnalyzer.js
RENAMED
|
File without changes
|
package/dist/types/client/{preview/angular-beta → angular-beta}/utils/NgModulesAnalyzer.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './globals';
|
|
2
2
|
export { render, renderToDOM } from './render';
|
|
3
|
-
export { decorateStory } from './decorateStory';
|
|
3
|
+
export { decorateStory as applyDecorators } from './decorateStory';
|
|
4
4
|
export declare const parameters: {
|
|
5
|
-
framework:
|
|
5
|
+
framework: "angular";
|
|
6
6
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parameters = exports.
|
|
3
|
+
exports.parameters = exports.applyDecorators = exports.renderToDOM = exports.render = void 0;
|
|
4
4
|
require("./globals");
|
|
5
5
|
var render_1 = require("./render");
|
|
6
6
|
Object.defineProperty(exports, "render", { enumerable: true, get: function () { return render_1.render; } });
|
|
7
7
|
Object.defineProperty(exports, "renderToDOM", { enumerable: true, get: function () { return render_1.renderToDOM; } });
|
|
8
8
|
var decorateStory_1 = require("./decorateStory");
|
|
9
|
-
Object.defineProperty(exports, "
|
|
9
|
+
Object.defineProperty(exports, "applyDecorators", { enumerable: true, get: function () { return decorateStory_1.decorateStory; } });
|
|
10
10
|
exports.parameters = { framework: 'angular' };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { DecoratorFunction, LegacyStoryFn } from '@storybook/csf';
|
|
2
|
-
import type { AngularFramework } from './types
|
|
2
|
+
import type { AngularFramework } from './types';
|
|
3
3
|
export default function decorateStory(mainStoryFn: LegacyStoryFn<AngularFramework>, decorators: DecoratorFunction<AngularFramework>[]): LegacyStoryFn<AngularFramework>;
|
|
4
4
|
export { decorateStory };
|
|
@@ -40,7 +40,7 @@ const cleanArgsDecorator = (storyFn, context) => {
|
|
|
40
40
|
context.args = Object.entries(argsToClean).reduce((obj, [key, arg]) => {
|
|
41
41
|
const argType = context.argTypes[key];
|
|
42
42
|
// Only keeps args with a control or an action in argTypes
|
|
43
|
-
if (argType
|
|
43
|
+
if (argType?.action || argType?.control) {
|
|
44
44
|
return { ...obj, [key]: arg };
|
|
45
45
|
}
|
|
46
46
|
return obj;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Type } from '@angular/core';
|
|
2
2
|
import type { DecoratorFunction, StoryContext } from '@storybook/csf';
|
|
3
|
-
import type { ICollection, NgModuleMetadata } from './types';
|
|
4
|
-
import type { AngularFramework } from './types-6-0';
|
|
3
|
+
import type { ICollection, NgModuleMetadata, AngularFramework } from './types';
|
|
5
4
|
export declare const moduleMetadata: <TArgs = any>(metadata: Partial<NgModuleMetadata>) => DecoratorFunction<AngularFramework, TArgs>;
|
|
6
5
|
export declare const componentWrapperDecorator: <TArgs = any>(element: Type<unknown> | ((story: string) => string), props?: ICollection | ((storyContext: StoryContext<AngularFramework, TArgs>) => ICollection)) => DecoratorFunction<AngularFramework, TArgs>;
|
|
File without changes
|
|
@@ -9,11 +9,11 @@ const isMethod = (methodOrProp) => {
|
|
|
9
9
|
};
|
|
10
10
|
exports.isMethod = isMethod;
|
|
11
11
|
const setCompodocJson = (compodocJson) => {
|
|
12
|
-
// @ts-ignore
|
|
12
|
+
// @ts-expect-error (Converted from ts-ignore)
|
|
13
13
|
window.__STORYBOOK_COMPODOC_JSON__ = compodocJson;
|
|
14
14
|
};
|
|
15
15
|
exports.setCompodocJson = setCompodocJson;
|
|
16
|
-
// @ts-ignore
|
|
16
|
+
// @ts-expect-error (Converted from ts-ignore)
|
|
17
17
|
const getCompodocJson = () => window.__STORYBOOK_COMPODOC_JSON__;
|
|
18
18
|
exports.getCompodocJson = getCompodocJson;
|
|
19
19
|
const checkValidComponentOrDirective = (component) => {
|
|
@@ -165,7 +165,6 @@ const extractDefaultValueFromComments = (property, value) => {
|
|
|
165
165
|
let commentValue = value;
|
|
166
166
|
property.jsdoctags.forEach((tag) => {
|
|
167
167
|
if (['default', 'defaultvalue'].includes(tag.tagName.escapedText)) {
|
|
168
|
-
// @ts-ignore
|
|
169
168
|
const dom = new window.DOMParser().parseFromString(tag.comment, 'text/html');
|
|
170
169
|
commentValue = dom.body.textContent;
|
|
171
170
|
}
|
|
@@ -2,7 +2,7 @@ import { SourceType } from '@storybook/docs-tools';
|
|
|
2
2
|
export declare const parameters: {
|
|
3
3
|
docs: {
|
|
4
4
|
inlineStories: boolean;
|
|
5
|
-
extractArgTypes: (component: import("./types").Directive) => import("lib/api/dist
|
|
5
|
+
extractArgTypes: (component: import("./types").Directive) => import("lib/api/dist").ArgTypes;
|
|
6
6
|
extractComponentDescription: (component: import("./types").Directive) => string;
|
|
7
7
|
source: {
|
|
8
8
|
type: SourceType;
|
|
@@ -10,5 +10,5 @@ export declare const parameters: {
|
|
|
10
10
|
};
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
|
-
export declare const decorators: ((storyFn: import("@storybook/csf").PartialStoryFn<import("
|
|
14
|
-
export declare const argTypesEnhancers: (<TFramework extends import("@storybook/csf").AnyFramework>(context: import("@storybook/csf").StoryContextForEnhancers<TFramework, import("@storybook/csf").Args>) => import("@storybook/csf").StrictArgTypes<import("@storybook/csf").Args>
|
|
13
|
+
export declare const decorators: ((storyFn: import("@storybook/csf").PartialStoryFn<import("../types").AngularFramework, import("@storybook/csf").Args>, context: import("../types").StoryContext) => import("..").IStory)[];
|
|
14
|
+
export declare const argTypesEnhancers: (<TFramework extends import("@storybook/csf").AnyFramework>(context: import("@storybook/csf").StoryContextForEnhancers<TFramework, import("@storybook/csf").Args>) => import("@storybook/csf").StrictArgTypes<import("@storybook/csf").Args>)[];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { PartialStoryFn } from '@storybook/csf';
|
|
2
|
-
import { StoryContext, AngularFramework } from '
|
|
2
|
+
import { StoryContext, AngularFramework } from '../types';
|
|
3
3
|
export declare const skipSourceRender: (context: StoryContext) => any;
|
|
4
4
|
/**
|
|
5
5
|
* Angular source decorator.
|
|
6
6
|
* @param storyFn Fn
|
|
7
7
|
* @param context StoryContext
|
|
8
8
|
*/
|
|
9
|
-
export declare const sourceDecorator: (storyFn: PartialStoryFn<AngularFramework>, context: StoryContext) => import("
|
|
9
|
+
export declare const sourceDecorator: (storyFn: PartialStoryFn<AngularFramework>, context: StoryContext) => import("../types").StoryFnAngularReturnType;
|
|
@@ -29,13 +29,3 @@ import 'core-js/proposals/reflect-metadata';
|
|
|
29
29
|
* Zone JS is required by Angular itself.
|
|
30
30
|
*/
|
|
31
31
|
import 'zone.js/dist/zone';
|
|
32
|
-
/** *************************************************************************************************
|
|
33
|
-
* APPLICATION IMPORTS
|
|
34
|
-
*/
|
|
35
|
-
/**
|
|
36
|
-
* Date, currency, decimal and percent pipes.
|
|
37
|
-
* Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10
|
|
38
|
-
*/
|
|
39
|
-
/**
|
|
40
|
-
* Need to import at least one locale-data with intl.
|
|
41
|
-
*/
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const global_1 = __importDefault(require("global"));
|
|
2
7
|
/**
|
|
3
8
|
* This file includes polyfills needed by Angular and is loaded before the app.
|
|
4
9
|
* You can add your own extra polyfills to this file.
|
|
@@ -14,7 +19,6 @@
|
|
|
14
19
|
*
|
|
15
20
|
* Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html
|
|
16
21
|
*/
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
22
|
/** *************************************************************************************************
|
|
19
23
|
* BROWSER POLYFILLS
|
|
20
24
|
*/
|
|
@@ -59,3 +63,5 @@ require("zone.js/dist/zone"); // Included with Angular CLI.
|
|
|
59
63
|
* Need to import at least one locale-data with intl.
|
|
60
64
|
*/
|
|
61
65
|
// import 'intl/locale-data/jsonp/en';
|
|
66
|
+
const { window: globalWindow } = global_1.default;
|
|
67
|
+
globalWindow.STORYBOOK_ENV = 'angular';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export * from './
|
|
3
|
-
export
|
|
4
|
-
export {
|
|
1
|
+
import './globals';
|
|
2
|
+
export * from './public-api';
|
|
3
|
+
export * from './public-types';
|
|
4
|
+
export type { StoryFnAngularReturnType as IStory } from './types';
|
|
5
|
+
export { moduleMetadata, componentWrapperDecorator } from './decorators';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/// <reference types="webpack-env" />
|
|
2
3
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
4
|
if (k2 === undefined) k2 = k;
|
|
4
5
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -14,18 +15,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
15
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
16
|
};
|
|
16
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.componentWrapperDecorator = exports.moduleMetadata =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
Object.defineProperty(exports, "addParameters", { enumerable: true, get: function () { return preview_1.addParameters; } });
|
|
23
|
-
Object.defineProperty(exports, "configure", { enumerable: true, get: function () { return preview_1.configure; } });
|
|
24
|
-
Object.defineProperty(exports, "getStorybook", { enumerable: true, get: function () { return preview_1.getStorybook; } });
|
|
25
|
-
Object.defineProperty(exports, "forceReRender", { enumerable: true, get: function () { return preview_1.forceReRender; } });
|
|
26
|
-
Object.defineProperty(exports, "raw", { enumerable: true, get: function () { return preview_1.raw; } });
|
|
27
|
-
__exportStar(require("./preview/types-6-0"), exports);
|
|
28
|
-
var decorators_1 = require("./preview/decorators");
|
|
18
|
+
exports.componentWrapperDecorator = exports.moduleMetadata = void 0;
|
|
19
|
+
require("./globals");
|
|
20
|
+
__exportStar(require("./public-api"), exports);
|
|
21
|
+
__exportStar(require("./public-types"), exports);
|
|
22
|
+
var decorators_1 = require("./decorators");
|
|
29
23
|
Object.defineProperty(exports, "moduleMetadata", { enumerable: true, get: function () { return decorators_1.moduleMetadata; } });
|
|
30
24
|
Object.defineProperty(exports, "componentWrapperDecorator", { enumerable: true, get: function () { return decorators_1.componentWrapperDecorator; } });
|
|
31
25
|
// optimization: stop HMR propagation in webpack
|
|
@@ -1,25 +1,15 @@
|
|
|
1
1
|
/// <reference types="webpack-env" />
|
|
2
2
|
/// <reference types="node" />
|
|
3
3
|
import type { ClientStoryApi, Loadable } from '@storybook/addons';
|
|
4
|
-
import './
|
|
5
|
-
|
|
6
|
-
import type { AngularFramework } from './types-6-0';
|
|
4
|
+
import type { AngularFramework } from './types';
|
|
5
|
+
export * from './public-types';
|
|
7
6
|
interface ClientApi extends ClientStoryApi<AngularFramework['storyResult']> {
|
|
8
|
-
setAddon(addon: any): void;
|
|
9
7
|
configure(loader: Loadable, module: NodeModule): void;
|
|
10
|
-
getStorybook(): IStorybookSection[];
|
|
11
|
-
clearDecorators(): void;
|
|
12
8
|
forceReRender(): void;
|
|
13
9
|
raw: () => any;
|
|
14
10
|
load: (...args: any[]) => void;
|
|
15
11
|
}
|
|
16
12
|
export declare const storiesOf: ClientApi['storiesOf'];
|
|
17
13
|
export declare const configure: ClientApi['configure'];
|
|
18
|
-
export declare const addDecorator: ClientApi['addDecorator'];
|
|
19
|
-
export declare const addParameters: ClientApi['addParameters'];
|
|
20
|
-
export declare const clearDecorators: ClientApi['clearDecorators'];
|
|
21
|
-
export declare const setAddon: ClientApi['setAddon'];
|
|
22
14
|
export declare const forceReRender: ClientApi['forceReRender'];
|
|
23
|
-
export declare const getStorybook: ClientApi['getStorybook'];
|
|
24
15
|
export declare const raw: ClientApi['raw'];
|
|
25
|
-
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.raw = exports.forceReRender = exports.configure = exports.storiesOf = void 0;
|
|
21
|
+
const core_client_1 = require("@storybook/core-client");
|
|
22
|
+
const render_1 = require("./render");
|
|
23
|
+
const decorateStory_1 = __importDefault(require("./decorateStory"));
|
|
24
|
+
__exportStar(require("./public-types"), exports);
|
|
25
|
+
const FRAMEWORK = 'angular';
|
|
26
|
+
const api = (0, core_client_1.start)(render_1.renderToDOM, { decorateStory: decorateStory_1.default, render: render_1.render });
|
|
27
|
+
const storiesOf = (kind, m) => {
|
|
28
|
+
return api.clientApi.storiesOf(kind, m).addParameters({
|
|
29
|
+
framework: FRAMEWORK,
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
exports.storiesOf = storiesOf;
|
|
33
|
+
const configure = (...args) => api.configure(FRAMEWORK, ...args);
|
|
34
|
+
exports.configure = configure;
|
|
35
|
+
exports.forceReRender = api.forceReRender;
|
|
36
|
+
exports.raw = api.clientApi.raw;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import type { Args,
|
|
2
|
-
import
|
|
1
|
+
import type { Args, ComponentAnnotations, StoryAnnotations, AnnotatedStoryFn } from '@storybook/csf';
|
|
2
|
+
import { AngularFramework } from './types';
|
|
3
3
|
export type { Args, ArgTypes } from '@storybook/csf';
|
|
4
|
-
export declare type AngularFramework = {
|
|
5
|
-
component: any;
|
|
6
|
-
storyResult: StoryFnAngularReturnType;
|
|
7
|
-
};
|
|
8
4
|
/**
|
|
9
5
|
* Metadata to configure the stories for a component.
|
|
10
6
|
*
|
|
@@ -24,19 +20,8 @@ export declare type StoryFn<TArgs = Args> = AnnotatedStoryFn<AngularFramework, T
|
|
|
24
20
|
*/
|
|
25
21
|
export declare type StoryObj<TArgs = Args> = StoryAnnotations<AngularFramework, TArgs>;
|
|
26
22
|
/**
|
|
27
|
-
* Story function that represents a
|
|
23
|
+
* Story function that represents a CSFv3 component example.
|
|
28
24
|
*
|
|
29
25
|
* @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
|
|
30
|
-
*
|
|
31
|
-
* NOTE that in Storybook 7.0, this type will be renamed to `StoryFn` and replaced by the current `StoryObj` type.
|
|
32
|
-
*
|
|
33
26
|
*/
|
|
34
|
-
export declare type Story<TArgs = Args> =
|
|
35
|
-
export declare type Parameters = DefaultParameters & {
|
|
36
|
-
/** Uses legacy angular rendering engine that use dynamic component */
|
|
37
|
-
angularLegacyRendering?: boolean;
|
|
38
|
-
bootstrapModuleOptions?: unknown;
|
|
39
|
-
};
|
|
40
|
-
export declare type StoryContext = DefaultStoryContext<AngularFramework> & {
|
|
41
|
-
parameters: Parameters;
|
|
42
|
-
};
|
|
27
|
+
export declare type Story<TArgs = Args> = StoryObj<TArgs>;
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RenderContext } from '@storybook/store';
|
|
2
2
|
import type { ArgsStoryFn } from '@storybook/csf';
|
|
3
|
-
import type { AngularFramework } from './types
|
|
3
|
+
import type { AngularFramework } from './types';
|
|
4
4
|
import { RendererFactory } from './angular-beta/RendererFactory';
|
|
5
5
|
export declare const rendererFactory: RendererFactory;
|
|
6
6
|
export declare const render: ArgsStoryFn<AngularFramework>;
|
|
File without changes
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Parameters as DefaultParameters, StoryContext as DefaultStoryContext } from '@storybook/csf';
|
|
1
2
|
export interface NgModuleMetadata {
|
|
2
3
|
declarations?: any[];
|
|
3
4
|
entryComponents?: any[];
|
|
@@ -8,14 +9,6 @@ export interface NgModuleMetadata {
|
|
|
8
9
|
export interface ICollection {
|
|
9
10
|
[p: string]: any;
|
|
10
11
|
}
|
|
11
|
-
export interface IStorybookStory {
|
|
12
|
-
name: string;
|
|
13
|
-
render: (context: any) => any;
|
|
14
|
-
}
|
|
15
|
-
export interface IStorybookSection {
|
|
16
|
-
kind: string;
|
|
17
|
-
stories: IStorybookStory[];
|
|
18
|
-
}
|
|
19
12
|
export interface StoryFnAngularReturnType {
|
|
20
13
|
/** @deprecated `component` story input is deprecated, and will be removed in Storybook 7.0. */
|
|
21
14
|
component?: any;
|
|
@@ -27,3 +20,15 @@ export interface StoryFnAngularReturnType {
|
|
|
27
20
|
styles?: string[];
|
|
28
21
|
userDefinedTemplate?: boolean;
|
|
29
22
|
}
|
|
23
|
+
export declare type AngularFramework = {
|
|
24
|
+
component: any;
|
|
25
|
+
storyResult: StoryFnAngularReturnType;
|
|
26
|
+
};
|
|
27
|
+
export declare type Parameters = DefaultParameters & {
|
|
28
|
+
/** Uses legacy angular rendering engine that use dynamic component */
|
|
29
|
+
angularLegacyRendering?: boolean;
|
|
30
|
+
bootstrapModuleOptions?: unknown;
|
|
31
|
+
};
|
|
32
|
+
export declare type StoryContext = DefaultStoryContext<AngularFramework> & {
|
|
33
|
+
parameters: Parameters;
|
|
34
|
+
};
|
|
File without changes
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './client';
|
|
1
|
+
export * from './client/index';
|
|
2
2
|
export * from './types';
|
package/dist/types/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./client"), exports);
|
|
17
|
+
__exportStar(require("./client/index"), exports);
|
|
18
18
|
__exportStar(require("./types"), exports);
|
|
19
19
|
/*
|
|
20
20
|
* ATTENTION:
|