@storybook/angular 6.5.9 → 7.0.0-alpha.2
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.9 → types}/builders/build-storybook/index.d.ts +1 -1
- package/dist/types/builders/build-storybook/index.js +58 -0
- package/dist/{ts3.9 → types}/builders/build-storybook/schema.json +0 -0
- package/dist/{ts3.9 → types}/builders/builders.json +0 -0
- package/dist/{ts3.9 → types}/builders/start-storybook/index.d.ts +1 -1
- package/dist/types/builders/start-storybook/index.js +66 -0
- package/dist/{ts3.9 → types}/builders/start-storybook/schema.json +0 -0
- package/dist/{ts3.9 → types}/builders/utils/build-standalone-errors-handler.d.ts +0 -0
- package/dist/{ts3.9 → types}/builders/utils/build-standalone-errors-handler.js +5 -5
- package/dist/{ts3.9 → types}/builders/utils/run-compodoc.d.ts +0 -0
- package/dist/{ts3.9 → types}/builders/utils/run-compodoc.js +9 -4
- package/dist/{ts3.9 → types}/client/docs/compodoc.d.ts +0 -0
- package/dist/{ts3.9 → types}/client/docs/compodoc.js +47 -34
- package/dist/{ts3.9 → types}/client/docs/config.d.ts +2 -3
- package/dist/{ts3.9 → types}/client/docs/config.js +0 -2
- package/dist/{ts3.9 → types}/client/docs/index.d.ts +0 -0
- package/dist/{ts3.9 → types}/client/docs/index.js +6 -2
- package/dist/{ts3.9 → types}/client/docs/sourceDecorator.d.ts +0 -0
- package/dist/{ts3.9 → types}/client/docs/sourceDecorator.js +10 -9
- package/dist/{ts3.9 → types}/client/docs/types.d.ts +0 -0
- package/dist/{ts3.9 → types}/client/docs/types.js +0 -0
- package/dist/{ts3.9 → types}/client/index.d.ts +0 -0
- package/dist/{ts3.9 → types}/client/index.js +9 -5
- package/dist/{ts3.9 → types}/client/preview/angular/app.token.d.ts +0 -0
- package/dist/{ts3.9 → types}/client/preview/angular/app.token.js +0 -0
- package/dist/{ts3.9 → types}/client/preview/angular/components/app.component.d.ts +0 -0
- package/dist/{ts3.9 → types}/client/preview/angular/components/app.component.js +4 -4
- package/dist/{ts3.9 → types}/client/preview/angular/helpers.d.ts +0 -0
- package/dist/{ts3.9 → types}/client/preview/angular/helpers.js +6 -6
- package/dist/{ts3.9 → types}/client/preview/angular-beta/AbstractRenderer.d.ts +0 -0
- package/dist/{ts3.9 → types}/client/preview/angular-beta/AbstractRenderer.js +40 -48
- package/dist/{ts3.9 → types}/client/preview/angular-beta/CanvasRenderer.d.ts +0 -0
- package/dist/types/client/preview/angular-beta/CanvasRenderer.js +16 -0
- package/dist/{ts3.9 → types}/client/preview/angular-beta/ComputesTemplateFromComponent.d.ts +0 -0
- package/dist/{ts3.9 → types}/client/preview/angular-beta/ComputesTemplateFromComponent.js +10 -8
- package/dist/{ts3.9 → types}/client/preview/angular-beta/DocsRenderer.d.ts +0 -0
- package/dist/types/client/preview/angular-beta/DocsRenderer.js +41 -0
- package/dist/{ts3.9 → types}/client/preview/angular-beta/RendererFactory.d.ts +0 -0
- package/dist/types/client/preview/angular-beta/RendererFactory.js +55 -0
- package/dist/{ts3.9 → types}/client/preview/angular-beta/StorybookModule.d.ts +0 -0
- package/dist/{ts3.9 → types}/client/preview/angular-beta/StorybookModule.js +17 -16
- package/dist/{ts3.9 → types}/client/preview/angular-beta/StorybookProvider.d.ts +0 -0
- package/dist/{ts3.9 → types}/client/preview/angular-beta/StorybookProvider.js +2 -1
- package/dist/{ts3.9 → types}/client/preview/angular-beta/StorybookWrapperComponent.d.ts +0 -0
- package/dist/{ts3.9 → types}/client/preview/angular-beta/StorybookWrapperComponent.js +11 -10
- package/dist/{ts3.9 → types}/client/preview/angular-beta/utils/NgComponentAnalyzer.d.ts +0 -0
- package/dist/{ts3.9 → types}/client/preview/angular-beta/utils/NgComponentAnalyzer.js +24 -13
- package/dist/{ts3.9 → types}/client/preview/angular-beta/utils/NgModulesAnalyzer.d.ts +0 -0
- package/dist/{ts3.9 → types}/client/preview/angular-beta/utils/NgModulesAnalyzer.js +3 -2
- package/dist/{ts3.9 → types}/client/preview/angular-polyfills.d.ts +0 -0
- package/dist/{ts3.9 → types}/client/preview/angular-polyfills.js +0 -0
- package/dist/{ts3.9 → types}/client/preview/config.d.ts +0 -0
- package/dist/{ts3.9 → types}/client/preview/config.js +1 -1
- package/dist/{ts3.9 → types}/client/preview/decorateStory.d.ts +0 -0
- package/dist/{ts3.9 → types}/client/preview/decorateStory.js +11 -6
- package/dist/{ts3.9 → types}/client/preview/decorators.d.ts +0 -0
- package/dist/{ts3.9 → types}/client/preview/decorators.js +23 -11
- package/dist/{ts3.9 → types}/client/preview/globals.d.ts +0 -0
- package/dist/{ts3.9 → types}/client/preview/globals.js +0 -0
- package/dist/{ts3.9 → types}/client/preview/index.d.ts +0 -0
- package/dist/{ts3.9 → types}/client/preview/index.js +6 -4
- package/dist/{ts3.9 → types}/client/preview/render.d.ts +0 -0
- package/dist/types/client/preview/render.js +24 -0
- package/dist/{ts3.9 → types}/client/preview/types-6-0.d.ts +0 -0
- package/dist/{ts3.9 → types}/client/preview/types-6-0.js +0 -0
- package/dist/{ts3.9 → types}/client/preview/types-7-0.d.ts +0 -0
- package/dist/{ts3.9 → types}/client/preview/types-7-0.js +0 -0
- package/dist/{ts3.9 → types}/client/preview/types.d.ts +0 -0
- package/dist/{ts3.9 → types}/client/preview/types.js +0 -0
- package/dist/{ts3.4/public_api.d.ts → types/index.d.ts} +2 -1
- package/dist/{ts3.9/public_api.js → types/index.js} +7 -2
- package/dist/types/preset.d.ts +13 -0
- package/dist/types/preset.js +32 -0
- package/dist/{ts3.9 → types}/renderer.d.ts +0 -0
- package/dist/{ts3.9 → types}/renderer.js +1 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/empty-projects-entry/angular.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/minimal-config/angular.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/minimal-config/src/main.d.ts +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/minimal-config/src/main.js +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/minimal-config/src/tsconfig.app.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/minimal-config/tsconfig.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/some-config/angular.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/some-config/src/main.d.ts +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/some-config/src/main.js +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/some-config/src/tsconfig.app.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/some-config/tsconfig.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-angularBrowserTarget/angular.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-angularBrowserTarget/src/main.d.ts +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-angularBrowserTarget/src/main.js +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-angularBrowserTarget/src/tsconfig.app.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-angularBrowserTarget/tsconfig.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-lib/angular.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-lib/projects/pattern-lib/src/main.d.ts +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-lib/projects/pattern-lib/src/main.js +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-lib/projects/pattern-lib/tsconfig.lib.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-lib/tsconfig.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-nx/angular.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-nx/nx.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-nx/src/main.d.ts +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-nx/src/main.js +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-nx/src/tsconfig.app.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-nx/tsconfig.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-nx-workspace/nx.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-nx-workspace/src/main.d.ts +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-nx-workspace/src/main.js +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-nx-workspace/src/tsconfig.app.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-nx-workspace/tsconfig.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-nx-workspace/workspace.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-options-styles/angular.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-options-styles/src/main.d.ts +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-options-styles/src/main.js +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-options-styles/src/tsconfig.app.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-options-styles/tsconfig.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/without-architect-build/angular.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/without-architect-build-options/angular.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/without-compatible-projects/angular.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/without-projects-entry/angular.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/without-projects-entry/projects/pattern-lib/src/main.d.ts +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/without-projects-entry/projects/pattern-lib/src/main.js +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/without-projects-entry/projects/pattern-lib/tsconfig.lib.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/without-projects-entry/tsconfig.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/without-tsConfig/angular.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/without-tsConfig/src/main.d.ts +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/without-tsConfig/src/main.js +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/without-tsConfig/src/tsconfig.app.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/without-tsConfig/tsconfig.json +0 -0
- package/dist/{ts3.9 → types}/server/angular-cli-webpack-12.2.x.d.ts +0 -0
- package/dist/types/server/angular-cli-webpack-12.2.x.js +66 -0
- package/dist/{ts3.9 → types}/server/angular-cli-webpack-13.x.x.d.ts +0 -0
- package/dist/types/server/angular-cli-webpack-13.x.x.js +70 -0
- package/dist/types/server/angular-cli-webpack-older.d.ts +6 -0
- package/dist/types/server/angular-cli-webpack-older.js +111 -0
- package/dist/{ts3.9 → types}/server/angular-devkit-build-webpack.d.ts +6 -6
- package/dist/{ts3.9 → types}/server/angular-devkit-build-webpack.js +66 -54
- package/dist/{ts3.9 → types}/server/angular-read-workspace.d.ts +0 -0
- package/dist/{ts3.9 → types}/server/angular-read-workspace.js +8 -14
- package/dist/{ts3.9 → types}/server/create-fork-ts-checker-plugin.d.ts +0 -0
- package/dist/{ts3.9 → types}/server/create-fork-ts-checker-plugin.js +1 -1
- package/dist/{ts3.9 → types}/server/framework-preset-angular-cli.d.ts +1 -1
- package/dist/types/server/framework-preset-angular-cli.js +175 -0
- package/dist/{ts3.9 → types}/server/framework-preset-angular-docs.d.ts +0 -0
- package/dist/{ts3.9 → types}/server/framework-preset-angular-docs.js +4 -3
- package/dist/{ts3.9 → types}/server/framework-preset-angular-ivy.d.ts +1 -1
- package/dist/{ts3.9 → types}/server/framework-preset-angular-ivy.js +26 -22
- package/dist/{ts3.9 → types}/server/framework-preset-angular.d.ts +0 -0
- package/dist/types/server/framework-preset-angular.js +103 -0
- package/dist/{ts3.9 → types}/server/ngx-template-loader/index.d.ts +0 -0
- package/dist/{ts3.9 → types}/server/ngx-template-loader/index.js +0 -0
- package/dist/{ts3.9/server/options.d.ts → types/server/preset-options.d.ts} +1 -3
- package/dist/{ts3.9/types/index.js → types/server/preset-options.js} +0 -0
- package/dist/{ts3.9 → types}/server/ts_config.d.ts +0 -0
- package/dist/{ts3.9 → types}/server/ts_config.js +0 -0
- package/dist/{ts3.9 → types}/server/utils/filter-out-styling-rules.d.ts +0 -0
- package/dist/{ts3.9 → types}/server/utils/filter-out-styling-rules.js +2 -1
- package/dist/{ts3.9 → types}/server/utils/module-is-available.d.ts +0 -0
- package/dist/{ts3.9 → types}/server/utils/module-is-available.js +2 -1
- package/dist/{ts3.4 → types}/server/utils/normalize-asset-patterns.d.ts +7 -6
- package/dist/{ts3.9 → types}/server/utils/normalize-asset-patterns.js +9 -9
- package/dist/{ts3.9 → types}/server/utils/normalize-optimization.d.ts +1 -1
- package/dist/{ts3.9 → types}/server/utils/normalize-optimization.js +3 -2
- package/dist/types/types.d.ts +13 -0
- package/dist/types/types.js +2 -0
- package/jest.config.js +1 -0
- package/package.json +47 -56
- package/preset.js +1 -1
- package/renderer.d.ts +1 -1
- package/renderer.js +1 -1
- package/standalone.js +2 -3
- package/types-6-0.d.ts +1 -1
- package/types-7-0.d.ts +1 -1
- package/bin/build.js +0 -4
- package/bin/index.js +0 -3
- package/demo.d.ts +0 -4
- package/demo.js +0 -5
- package/dist/ts3.4/builders/build-storybook/index.d.ts +0 -15
- package/dist/ts3.4/builders/start-storybook/index.d.ts +0 -15
- package/dist/ts3.4/builders/utils/build-standalone-errors-handler.d.ts +0 -1
- package/dist/ts3.4/builders/utils/run-compodoc.d.ts +0 -6
- package/dist/ts3.4/client/docs/compodoc.d.ts +0 -18
- package/dist/ts3.4/client/docs/config.d.ts +0 -15
- package/dist/ts3.4/client/docs/index.d.ts +0 -1
- package/dist/ts3.4/client/docs/prepareForInline.d.ts +0 -7
- package/dist/ts3.4/client/docs/sourceDecorator.d.ts +0 -9
- package/dist/ts3.4/client/docs/types.d.ts +0 -102
- package/dist/ts3.4/client/index.d.ts +0 -4
- package/dist/ts3.4/client/preview/angular/app.token.d.ts +0 -3
- package/dist/ts3.4/client/preview/angular/components/app.component.d.ts +0 -38
- package/dist/ts3.4/client/preview/angular/helpers.d.ts +0 -8
- package/dist/ts3.4/client/preview/angular-beta/AbstractRenderer.d.ts +0 -57
- package/dist/ts3.4/client/preview/angular-beta/CanvasRenderer.d.ts +0 -14
- package/dist/ts3.4/client/preview/angular-beta/ComputesTemplateFromComponent.d.ts +0 -17
- package/dist/ts3.4/client/preview/angular-beta/DocsRenderer.d.ts +0 -14
- package/dist/ts3.4/client/preview/angular-beta/RendererFactory.d.ts +0 -11
- package/dist/ts3.4/client/preview/angular-beta/StorybookModule.d.ts +0 -9
- package/dist/ts3.4/client/preview/angular-beta/StorybookProvider.d.ts +0 -5
- package/dist/ts3.4/client/preview/angular-beta/StorybookWrapperComponent.d.ts +0 -9
- package/dist/ts3.4/client/preview/angular-beta/utils/NgComponentAnalyzer.d.ts +0 -29
- package/dist/ts3.4/client/preview/angular-beta/utils/NgModulesAnalyzer.d.ts +0 -6
- package/dist/ts3.4/client/preview/angular-polyfills.d.ts +0 -41
- package/dist/ts3.4/client/preview/config.d.ts +0 -6
- package/dist/ts3.4/client/preview/decorateStory.d.ts +0 -4
- package/dist/ts3.4/client/preview/decorators.d.ts +0 -6
- package/dist/ts3.4/client/preview/globals.d.ts +0 -1
- package/dist/ts3.4/client/preview/index.d.ts +0 -25
- package/dist/ts3.4/client/preview/render.d.ts +0 -7
- package/dist/ts3.4/client/preview/types-6-0.d.ts +0 -42
- package/dist/ts3.4/client/preview/types-7-0.d.ts +0 -9
- package/dist/ts3.4/client/preview/types.d.ts +0 -29
- package/dist/ts3.4/demo/button.component.d.ts +0 -5
- package/dist/ts3.4/demo/welcome.component.d.ts +0 -4
- package/dist/ts3.4/renderer.d.ts +0 -4
- package/dist/ts3.4/server/__mocks-ng-workspace__/minimal-config/src/main.d.ts +0 -1
- package/dist/ts3.4/server/__mocks-ng-workspace__/some-config/src/main.d.ts +0 -1
- package/dist/ts3.4/server/__mocks-ng-workspace__/with-angularBrowserTarget/src/main.d.ts +0 -1
- package/dist/ts3.4/server/__mocks-ng-workspace__/with-lib/projects/pattern-lib/src/main.d.ts +0 -1
- package/dist/ts3.4/server/__mocks-ng-workspace__/with-nx/src/main.d.ts +0 -1
- package/dist/ts3.4/server/__mocks-ng-workspace__/with-nx-workspace/src/main.d.ts +0 -1
- package/dist/ts3.4/server/__mocks-ng-workspace__/with-options-styles/src/main.d.ts +0 -1
- package/dist/ts3.4/server/__mocks-ng-workspace__/without-projects-entry/projects/pattern-lib/src/main.d.ts +0 -1
- package/dist/ts3.4/server/__mocks-ng-workspace__/without-tsConfig/src/main.d.ts +0 -1
- package/dist/ts3.4/server/angular-cli-webpack-12.2.x.d.ts +0 -1
- package/dist/ts3.4/server/angular-cli-webpack-13.x.x.d.ts +0 -1
- package/dist/ts3.4/server/angular-cli-webpack-older.d.ts +0 -73
- package/dist/ts3.4/server/angular-devkit-build-webpack.d.ts +0 -30
- package/dist/ts3.4/server/angular-read-workspace.d.ts +0 -13
- package/dist/ts3.4/server/build.d.ts +0 -1
- package/dist/ts3.4/server/create-fork-ts-checker-plugin.d.ts +0 -3
- package/dist/ts3.4/server/framework-preset-angular-cli.d.ts +0 -3
- package/dist/ts3.4/server/framework-preset-angular-docs.d.ts +0 -2
- package/dist/ts3.4/server/framework-preset-angular-ivy.d.ts +0 -10
- package/dist/ts3.4/server/framework-preset-angular.d.ts +0 -5
- package/dist/ts3.4/server/index.d.ts +0 -1
- package/dist/ts3.4/server/ngx-template-loader/index.d.ts +0 -1
- package/dist/ts3.4/server/options.d.ts +0 -14
- package/dist/ts3.4/server/preset.d.ts +0 -3
- package/dist/ts3.4/server/ts_config.d.ts +0 -2
- package/dist/ts3.4/server/utils/filter-out-styling-rules.d.ts +0 -2
- package/dist/ts3.4/server/utils/module-is-available.d.ts +0 -1
- package/dist/ts3.4/server/utils/normalize-optimization.d.ts +0 -3
- package/dist/ts3.4/types/index.d.ts +0 -6
- package/dist/ts3.9/builders/build-storybook/index.js +0 -65
- package/dist/ts3.9/builders/start-storybook/index.js +0 -73
- package/dist/ts3.9/client/docs/prepareForInline.d.ts +0 -7
- package/dist/ts3.9/client/docs/prepareForInline.js +0 -45
- package/dist/ts3.9/client/preview/angular-beta/CanvasRenderer.js +0 -34
- package/dist/ts3.9/client/preview/angular-beta/DocsRenderer.js +0 -59
- package/dist/ts3.9/client/preview/angular-beta/RendererFactory.js +0 -65
- package/dist/ts3.9/client/preview/render.js +0 -34
- package/dist/ts3.9/demo/button.component.d.ts +0 -5
- package/dist/ts3.9/demo/button.component.js +0 -46
- package/dist/ts3.9/demo/welcome.component.d.ts +0 -4
- package/dist/ts3.9/demo/welcome.component.js +0 -99
- package/dist/ts3.9/public_api.d.ts +0 -1
- package/dist/ts3.9/server/angular-cli-webpack-12.2.x.js +0 -56
- package/dist/ts3.9/server/angular-cli-webpack-13.x.x.js +0 -60
- package/dist/ts3.9/server/angular-cli-webpack-older.d.ts +0 -73
- package/dist/ts3.9/server/angular-cli-webpack-older.js +0 -110
- package/dist/ts3.9/server/build.d.ts +0 -1
- package/dist/ts3.9/server/build.js +0 -28
- package/dist/ts3.9/server/framework-preset-angular-cli.js +0 -177
- package/dist/ts3.9/server/framework-preset-angular.js +0 -100
- package/dist/ts3.9/server/index.d.ts +0 -1
- package/dist/ts3.9/server/index.js +0 -8
- package/dist/ts3.9/server/options.js +0 -8
- package/dist/ts3.9/server/preset.d.ts +0 -3
- package/dist/ts3.9/server/preset.js +0 -13
- package/dist/ts3.9/server/utils/normalize-asset-patterns.d.ts +0 -6
- package/dist/ts3.9/types/index.d.ts +0 -6
|
@@ -51,10 +51,10 @@ const getModule = (declarations, entryComponents, bootstrap, data, moduleMetadat
|
|
|
51
51
|
schemas: [...(moduleMetadata.schemas || [])],
|
|
52
52
|
bootstrap: [...bootstrap],
|
|
53
53
|
};
|
|
54
|
-
return core_1.NgModule(moduleMeta)(moduleClass);
|
|
54
|
+
return (0, core_1.NgModule)(moduleMeta)(moduleClass);
|
|
55
55
|
};
|
|
56
56
|
const createComponentFromTemplate = (template, styles) => {
|
|
57
|
-
return core_1.Component({
|
|
57
|
+
return (0, core_1.Component)({
|
|
58
58
|
template,
|
|
59
59
|
styles,
|
|
60
60
|
})(componentClass);
|
|
@@ -120,16 +120,15 @@ const insertDynamicRoot = () => {
|
|
|
120
120
|
const draw = (newModule) => {
|
|
121
121
|
if (!platform) {
|
|
122
122
|
insertDynamicRoot();
|
|
123
|
-
// eslint-disable-next-line no-undef
|
|
124
123
|
if (typeof NODE_ENV === 'string' && NODE_ENV !== 'development') {
|
|
125
124
|
try {
|
|
126
|
-
core_1.enableProdMode();
|
|
125
|
+
(0, core_1.enableProdMode)();
|
|
127
126
|
}
|
|
128
127
|
catch (e) {
|
|
129
128
|
//
|
|
130
129
|
}
|
|
131
130
|
}
|
|
132
|
-
platform = platform_browser_dynamic_1.platformBrowserDynamic();
|
|
131
|
+
platform = (0, platform_browser_dynamic_1.platformBrowserDynamic)();
|
|
133
132
|
promises.push(platform.bootstrapModule(newModule));
|
|
134
133
|
}
|
|
135
134
|
else {
|
|
@@ -141,7 +140,7 @@ const draw = (newModule) => {
|
|
|
141
140
|
});
|
|
142
141
|
}
|
|
143
142
|
};
|
|
144
|
-
|
|
143
|
+
const renderNgApp = (storyFn, forced) => {
|
|
145
144
|
if (!forced) {
|
|
146
145
|
draw(initModule(storyFn));
|
|
147
146
|
}
|
|
@@ -149,3 +148,4 @@ exports.renderNgApp = (storyFn, forced) => {
|
|
|
149
148
|
storyData.next(storyFn());
|
|
150
149
|
}
|
|
151
150
|
};
|
|
151
|
+
exports.renderNgApp = renderNgApp;
|
|
File without changes
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -14,22 +18,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
14
18
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
19
|
if (mod && mod.__esModule) return mod;
|
|
16
20
|
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
22
|
__setModuleDefault(result, mod);
|
|
19
23
|
return result;
|
|
20
24
|
};
|
|
21
|
-
var
|
|
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
|
-
};
|
|
25
|
+
var _a;
|
|
30
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
27
|
exports.AbstractRenderer = void 0;
|
|
32
|
-
/* eslint-disable no-undef */
|
|
33
28
|
const core_1 = require("@angular/core");
|
|
34
29
|
const platform_browser_dynamic_1 = require("@angular/platform-browser-dynamic");
|
|
35
30
|
const rxjs_1 = require("rxjs");
|
|
@@ -39,7 +34,7 @@ const StorybookModule_1 = require("./StorybookModule");
|
|
|
39
34
|
let platformRef;
|
|
40
35
|
function getPlatform(newPlatform) {
|
|
41
36
|
if (!platformRef || newPlatform) {
|
|
42
|
-
platformRef = platform_browser_dynamic_1.platformBrowserDynamic();
|
|
37
|
+
platformRef = (0, platform_browser_dynamic_1.platformBrowserDynamic)();
|
|
43
38
|
}
|
|
44
39
|
return platformRef;
|
|
45
40
|
}
|
|
@@ -49,7 +44,7 @@ class AbstractRenderer {
|
|
|
49
44
|
if (typeof NODE_ENV === 'string' && NODE_ENV !== 'development') {
|
|
50
45
|
try {
|
|
51
46
|
// platform should be set after enableProdMode()
|
|
52
|
-
core_1.enableProdMode();
|
|
47
|
+
(0, core_1.enableProdMode)();
|
|
53
48
|
}
|
|
54
49
|
catch (e) {
|
|
55
50
|
// eslint-disable-next-line no-console
|
|
@@ -63,9 +58,9 @@ class AbstractRenderer {
|
|
|
63
58
|
static resetPlatformBrowserDynamic() {
|
|
64
59
|
return new Promise((resolve) => {
|
|
65
60
|
if (platformRef && !platformRef.destroyed) {
|
|
66
|
-
platformRef.onDestroy(() =>
|
|
61
|
+
platformRef.onDestroy(async () => {
|
|
67
62
|
resolve();
|
|
68
|
-
})
|
|
63
|
+
});
|
|
69
64
|
// Destroys the current Angular platform and all Angular applications on the page.
|
|
70
65
|
// So call each angular ngOnDestroy and avoid memory leaks
|
|
71
66
|
platformRef.destroy();
|
|
@@ -86,30 +81,27 @@ class AbstractRenderer {
|
|
|
86
81
|
* @param component {Component}
|
|
87
82
|
* @param parameters {Parameters}
|
|
88
83
|
*/
|
|
89
|
-
render({ storyFnAngular, forced, parameters, component, targetDOMNode, }) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
yield getPlatform().bootstrapModule(StorybookModule_1.createStorybookModule(moduleMetadata), (_a = parameters.bootstrapModuleOptions) !== null && _a !== void 0 ? _a : undefined);
|
|
111
|
-
yield this.afterFullRender();
|
|
112
|
-
});
|
|
84
|
+
async render({ storyFnAngular, forced, parameters, component, targetDOMNode, }) {
|
|
85
|
+
const targetSelector = `${this.generateTargetSelectorFromStoryId()}`;
|
|
86
|
+
const newStoryProps$ = new rxjs_1.BehaviorSubject(storyFnAngular.props);
|
|
87
|
+
const moduleMetadata = (0, StorybookModule_1.getStorybookModuleMetadata)({ storyFnAngular, component, targetSelector }, newStoryProps$);
|
|
88
|
+
if (!this.fullRendererRequired({
|
|
89
|
+
storyFnAngular,
|
|
90
|
+
moduleMetadata,
|
|
91
|
+
forced,
|
|
92
|
+
})) {
|
|
93
|
+
this.storyProps$.next(storyFnAngular.props);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
await this.beforeFullRender();
|
|
97
|
+
// Complete last BehaviorSubject and set a new one for the current module
|
|
98
|
+
if (this.storyProps$) {
|
|
99
|
+
this.storyProps$.complete();
|
|
100
|
+
}
|
|
101
|
+
this.storyProps$ = newStoryProps$;
|
|
102
|
+
this.initAngularRootElement(targetDOMNode, targetSelector);
|
|
103
|
+
await getPlatform().bootstrapModule((0, StorybookModule_1.createStorybookModule)(moduleMetadata), parameters.bootstrapModuleOptions ?? undefined);
|
|
104
|
+
await this.afterFullRender();
|
|
113
105
|
}
|
|
114
106
|
/**
|
|
115
107
|
* Only ASCII alphanumerics can be used as HTML tag name.
|
|
@@ -137,11 +129,10 @@ class AbstractRenderer {
|
|
|
137
129
|
targetDOMNode.appendChild(document.createElement(targetSelector));
|
|
138
130
|
}
|
|
139
131
|
fullRendererRequired({ storyFnAngular, moduleMetadata, forced, }) {
|
|
140
|
-
var _a;
|
|
141
132
|
const { previousStoryRenderInfo } = this;
|
|
142
133
|
const currentStoryRender = {
|
|
143
134
|
storyFnAngular,
|
|
144
|
-
moduleMetadataSnapshot: telejson_1.stringify(moduleMetadata),
|
|
135
|
+
moduleMetadataSnapshot: (0, telejson_1.stringify)(moduleMetadata),
|
|
145
136
|
};
|
|
146
137
|
this.previousStoryRenderInfo = currentStoryRender;
|
|
147
138
|
if (
|
|
@@ -152,29 +143,30 @@ class AbstractRenderer {
|
|
|
152
143
|
return true;
|
|
153
144
|
}
|
|
154
145
|
// force the rendering if the template has changed
|
|
155
|
-
const hasChangedTemplate = !!
|
|
156
|
-
|
|
146
|
+
const hasChangedTemplate = !!storyFnAngular?.template &&
|
|
147
|
+
previousStoryRenderInfo?.storyFnAngular?.template !== storyFnAngular.template;
|
|
157
148
|
if (hasChangedTemplate) {
|
|
158
149
|
return true;
|
|
159
150
|
}
|
|
160
151
|
// force the rendering if the metadata structure has changed
|
|
161
|
-
const hasChangedModuleMetadata = currentStoryRender.moduleMetadataSnapshot !==
|
|
152
|
+
const hasChangedModuleMetadata = currentStoryRender.moduleMetadataSnapshot !== previousStoryRenderInfo?.moduleMetadataSnapshot;
|
|
162
153
|
return hasChangedModuleMetadata;
|
|
163
154
|
}
|
|
164
155
|
}
|
|
165
156
|
exports.AbstractRenderer = AbstractRenderer;
|
|
157
|
+
_a = AbstractRenderer;
|
|
166
158
|
/**
|
|
167
159
|
* Reset compiled components because we often want to compile the same component with
|
|
168
160
|
* more than one NgModule.
|
|
169
161
|
*/
|
|
170
|
-
AbstractRenderer.resetCompiledComponents = () =>
|
|
162
|
+
AbstractRenderer.resetCompiledComponents = async () => {
|
|
171
163
|
try {
|
|
172
164
|
// Clear global Angular component cache in order to be able to re-render the same component across multiple stories
|
|
173
165
|
//
|
|
174
166
|
// References:
|
|
175
167
|
// https://github.com/angular/angular-cli/blob/master/packages/angular_devkit/build_angular/src/webpack/plugins/hmr/hmr-accept.ts#L50
|
|
176
168
|
// https://github.com/angular/angular/blob/2ebe2bcb2fe19bf672316b05f15241fd7fd40803/packages/core/src/render3/jit/module.ts#L377-L384
|
|
177
|
-
const { ɵresetCompiledComponents } =
|
|
169
|
+
const { ɵresetCompiledComponents } = await Promise.resolve().then(() => __importStar(require('@angular/core')));
|
|
178
170
|
ɵresetCompiledComponents();
|
|
179
171
|
}
|
|
180
172
|
catch (e) {
|
|
@@ -183,4 +175,4 @@ AbstractRenderer.resetCompiledComponents = () => __awaiter(void 0, void 0, void
|
|
|
183
175
|
* This means angular removed or modified ɵresetCompiledComponents
|
|
184
176
|
*/
|
|
185
177
|
}
|
|
186
|
-
}
|
|
178
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CanvasRenderer = void 0;
|
|
4
|
+
const AbstractRenderer_1 = require("./AbstractRenderer");
|
|
5
|
+
class CanvasRenderer extends AbstractRenderer_1.AbstractRenderer {
|
|
6
|
+
async render(options) {
|
|
7
|
+
await super.render(options);
|
|
8
|
+
}
|
|
9
|
+
async beforeFullRender() {
|
|
10
|
+
await CanvasRenderer.resetPlatformBrowserDynamic();
|
|
11
|
+
}
|
|
12
|
+
async afterFullRender() {
|
|
13
|
+
await AbstractRenderer_1.AbstractRenderer.resetCompiledComponents();
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.CanvasRenderer = CanvasRenderer;
|
|
File without changes
|
|
@@ -21,9 +21,9 @@ const separateInputsOutputsAttributes = (ngComponentInputsOutputs, props = {}) =
|
|
|
21
21
|
* @param initialProps
|
|
22
22
|
* @param innerTemplate
|
|
23
23
|
*/
|
|
24
|
-
|
|
25
|
-
const ngComponentMetadata = NgComponentAnalyzer_1.getComponentDecoratorMetadata(component);
|
|
26
|
-
const ngComponentInputsOutputs = NgComponentAnalyzer_1.getComponentInputsOutputs(component);
|
|
24
|
+
const computesTemplateFromComponent = (component, initialProps, innerTemplate = '') => {
|
|
25
|
+
const ngComponentMetadata = (0, NgComponentAnalyzer_1.getComponentDecoratorMetadata)(component);
|
|
26
|
+
const ngComponentInputsOutputs = (0, NgComponentAnalyzer_1.getComponentInputsOutputs)(component);
|
|
27
27
|
if (!ngComponentMetadata.selector) {
|
|
28
28
|
// Allow to add renderer component when NgComponent selector is undefined
|
|
29
29
|
return `<ng-container *ngComponentOutlet="storyComponent"></ng-container>`;
|
|
@@ -35,8 +35,9 @@ exports.computesTemplateFromComponent = (component, initialProps, innerTemplate
|
|
|
35
35
|
: '';
|
|
36
36
|
return buildTemplate(ngComponentMetadata.selector, innerTemplate, templateInputs, templateOutputs);
|
|
37
37
|
};
|
|
38
|
+
exports.computesTemplateFromComponent = computesTemplateFromComponent;
|
|
38
39
|
const createAngularInputProperty = ({ propertyName, value, argType, }) => {
|
|
39
|
-
const { name: type = null, summary = null } =
|
|
40
|
+
const { name: type = null, summary = null } = argType?.type || {};
|
|
40
41
|
let templateValue = type === 'enum' && !!summary ? `${summary}.${value}` : value;
|
|
41
42
|
const actualType = type === 'enum' && summary ? 'enum' : typeof value;
|
|
42
43
|
const requiresBrackets = ['object', 'any', 'boolean', 'enum', 'number'].includes(actualType);
|
|
@@ -51,8 +52,8 @@ const createAngularInputProperty = ({ propertyName, value, argType, }) => {
|
|
|
51
52
|
* @param initialProps
|
|
52
53
|
* @param innerTemplate
|
|
53
54
|
*/
|
|
54
|
-
|
|
55
|
-
const ngComponentMetadata = NgComponentAnalyzer_1.getComponentDecoratorMetadata(component);
|
|
55
|
+
const computesTemplateSourceFromComponent = (component, initialProps, argTypes) => {
|
|
56
|
+
const ngComponentMetadata = (0, NgComponentAnalyzer_1.getComponentDecoratorMetadata)(component);
|
|
56
57
|
if (!ngComponentMetadata) {
|
|
57
58
|
return null;
|
|
58
59
|
}
|
|
@@ -60,14 +61,14 @@ exports.computesTemplateSourceFromComponent = (component, initialProps, argTypes
|
|
|
60
61
|
// Allow to add renderer component when NgComponent selector is undefined
|
|
61
62
|
return `<ng-container *ngComponentOutlet="${component.name}"></ng-container>`;
|
|
62
63
|
}
|
|
63
|
-
const ngComponentInputsOutputs = NgComponentAnalyzer_1.getComponentInputsOutputs(component);
|
|
64
|
+
const ngComponentInputsOutputs = (0, NgComponentAnalyzer_1.getComponentInputsOutputs)(component);
|
|
64
65
|
const { inputs: initialInputs, outputs: initialOutputs } = separateInputsOutputsAttributes(ngComponentInputsOutputs, initialProps);
|
|
65
66
|
const templateInputs = initialInputs.length > 0
|
|
66
67
|
? ` ${initialInputs
|
|
67
68
|
.map((propertyName) => createAngularInputProperty({
|
|
68
69
|
propertyName,
|
|
69
70
|
value: initialProps[propertyName],
|
|
70
|
-
argType: argTypes
|
|
71
|
+
argType: argTypes?.[propertyName],
|
|
71
72
|
}))
|
|
72
73
|
.join(' ')}`
|
|
73
74
|
: '';
|
|
@@ -76,6 +77,7 @@ exports.computesTemplateSourceFromComponent = (component, initialProps, argTypes
|
|
|
76
77
|
: '';
|
|
77
78
|
return buildTemplate(ngComponentMetadata.selector, '', templateInputs, templateOutputs);
|
|
78
79
|
};
|
|
80
|
+
exports.computesTemplateSourceFromComponent = computesTemplateSourceFromComponent;
|
|
79
81
|
const buildTemplate = (selector, innerTemplate, inputs, outputs) => {
|
|
80
82
|
// https://www.w3.org/TR/2011/WD-html-markup-20110113/syntax.html#syntax-elements
|
|
81
83
|
const voidElements = [
|
|
File without changes
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
exports.DocsRenderer = void 0;
|
|
7
|
+
const addons_1 = require("@storybook/addons");
|
|
8
|
+
const core_events_1 = __importDefault(require("@storybook/core-events"));
|
|
9
|
+
const AbstractRenderer_1 = require("./AbstractRenderer");
|
|
10
|
+
class DocsRenderer extends AbstractRenderer_1.AbstractRenderer {
|
|
11
|
+
async render(options) {
|
|
12
|
+
const channel = addons_1.addons.getChannel();
|
|
13
|
+
/**
|
|
14
|
+
* Destroy and recreate the PlatformBrowserDynamic of angular
|
|
15
|
+
* For several stories to be rendered in the same docs we should
|
|
16
|
+
* not destroy angular between each rendering but do it when the
|
|
17
|
+
* rendered stories are not needed anymore.
|
|
18
|
+
*
|
|
19
|
+
* Note for improvement: currently there is one event per story
|
|
20
|
+
* rendered in the doc. But one event could be enough for the whole docs
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
channel.once(core_events_1.default.STORY_CHANGED, async () => {
|
|
24
|
+
await DocsRenderer.resetPlatformBrowserDynamic();
|
|
25
|
+
});
|
|
26
|
+
/**
|
|
27
|
+
* Destroy and recreate the PlatformBrowserDynamic of angular
|
|
28
|
+
* when doc re render. Allows to call ngOnDestroy of angular
|
|
29
|
+
* for previous component
|
|
30
|
+
*/
|
|
31
|
+
channel.once(core_events_1.default.DOCS_RENDERED, async () => {
|
|
32
|
+
await DocsRenderer.resetPlatformBrowserDynamic();
|
|
33
|
+
});
|
|
34
|
+
await super.render({ ...options, forced: false });
|
|
35
|
+
}
|
|
36
|
+
async beforeFullRender() { }
|
|
37
|
+
async afterFullRender() {
|
|
38
|
+
await AbstractRenderer_1.AbstractRenderer.resetCompiledComponents();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.DocsRenderer = DocsRenderer;
|
|
File without changes
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.clearRootHTMLElement = exports.getRenderType = exports.RendererFactory = void 0;
|
|
4
|
+
const AbstractRenderer_1 = require("./AbstractRenderer");
|
|
5
|
+
const DocsRenderer_1 = require("./DocsRenderer");
|
|
6
|
+
const CanvasRenderer_1 = require("./CanvasRenderer");
|
|
7
|
+
class RendererFactory {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.rendererMap = new Map();
|
|
10
|
+
}
|
|
11
|
+
async getRendererInstance(storyId, targetDOMNode) {
|
|
12
|
+
// do nothing if the target node is null
|
|
13
|
+
// fix a problem when the docs asks 2 times the same component at the same time
|
|
14
|
+
// the 1st targetDOMNode of the 1st requested rendering becomes null 🤷♂️
|
|
15
|
+
if (targetDOMNode === null) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
const renderType = (0, exports.getRenderType)(targetDOMNode);
|
|
19
|
+
// keep only instances of the same type
|
|
20
|
+
if (this.lastRenderType && this.lastRenderType !== renderType) {
|
|
21
|
+
await AbstractRenderer_1.AbstractRenderer.resetPlatformBrowserDynamic();
|
|
22
|
+
clearRootHTMLElement(renderType);
|
|
23
|
+
this.rendererMap.clear();
|
|
24
|
+
}
|
|
25
|
+
if (!this.rendererMap.has(storyId)) {
|
|
26
|
+
this.rendererMap.set(storyId, this.buildRenderer(storyId, renderType));
|
|
27
|
+
}
|
|
28
|
+
this.lastRenderType = renderType;
|
|
29
|
+
return this.rendererMap.get(storyId);
|
|
30
|
+
}
|
|
31
|
+
buildRenderer(storyId, renderType) {
|
|
32
|
+
if (renderType === 'docs') {
|
|
33
|
+
return new DocsRenderer_1.DocsRenderer(storyId);
|
|
34
|
+
}
|
|
35
|
+
return new CanvasRenderer_1.CanvasRenderer(storyId);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.RendererFactory = RendererFactory;
|
|
39
|
+
const getRenderType = (targetDOMNode) => {
|
|
40
|
+
return targetDOMNode.id === 'root' ? 'canvas' : 'docs';
|
|
41
|
+
};
|
|
42
|
+
exports.getRenderType = getRenderType;
|
|
43
|
+
function clearRootHTMLElement(renderType) {
|
|
44
|
+
switch (renderType) {
|
|
45
|
+
case 'canvas':
|
|
46
|
+
global.document.getElementById('docs-root').innerHTML = '';
|
|
47
|
+
break;
|
|
48
|
+
case 'docs':
|
|
49
|
+
global.document.getElementById('root').innerHTML = '';
|
|
50
|
+
break;
|
|
51
|
+
default:
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.clearRootHTMLElement = clearRootHTMLElement;
|
|
File without changes
|
|
@@ -19,7 +19,7 @@ const NgModulesAnalyzer_1 = require("./utils/NgModulesAnalyzer");
|
|
|
19
19
|
const NgComponentAnalyzer_1 = require("./utils/NgComponentAnalyzer");
|
|
20
20
|
const StorybookWrapperComponent_1 = require("./StorybookWrapperComponent");
|
|
21
21
|
const ComputesTemplateFromComponent_1 = require("./ComputesTemplateFromComponent");
|
|
22
|
-
const deprecatedStoryComponentWarning = util_deprecate_1.default(() => { }, ts_dedent_1.default `\`component\` story return value is deprecated, and will be removed in Storybook 7.0.
|
|
22
|
+
const deprecatedStoryComponentWarning = (0, util_deprecate_1.default)(() => { }, (0, ts_dedent_1.default) `\`component\` story return value is deprecated, and will be removed in Storybook 7.0.
|
|
23
23
|
Instead, use \`export const default = () => ({ component: AppComponent });\`
|
|
24
24
|
or
|
|
25
25
|
\`\`\`
|
|
@@ -30,51 +30,52 @@ const deprecatedStoryComponentWarning = util_deprecate_1.default(() => { }, ts_d
|
|
|
30
30
|
- https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#deprecated-angular-story-component).
|
|
31
31
|
- https://storybook.js.org/docs/angular/writing-stories/parameters
|
|
32
32
|
`);
|
|
33
|
-
|
|
34
|
-
var _a, _b, _c, _d, _e;
|
|
33
|
+
const getStorybookModuleMetadata = ({ storyFnAngular, component: annotatedComponent, targetSelector, }, storyProps$) => {
|
|
35
34
|
const { component: storyComponent, props, styles, moduleMetadata = {} } = storyFnAngular;
|
|
36
35
|
let { template } = storyFnAngular;
|
|
37
36
|
if (storyComponent) {
|
|
38
37
|
deprecatedStoryComponentWarning();
|
|
39
38
|
}
|
|
40
|
-
const component = storyComponent
|
|
39
|
+
const component = storyComponent ?? annotatedComponent;
|
|
41
40
|
if (hasNoTemplate(template) && component) {
|
|
42
|
-
template = ComputesTemplateFromComponent_1.computesTemplateFromComponent(component, props, '');
|
|
41
|
+
template = (0, ComputesTemplateFromComponent_1.computesTemplateFromComponent)(component, props, '');
|
|
43
42
|
}
|
|
44
43
|
/**
|
|
45
44
|
* Create a component that wraps generated template and gives it props
|
|
46
45
|
*/
|
|
47
|
-
const ComponentToInject = StorybookWrapperComponent_1.createStorybookWrapperComponent(targetSelector, template, component, styles, props);
|
|
48
|
-
const isStandalone = NgComponentAnalyzer_1.isStandaloneComponent(component);
|
|
46
|
+
const ComponentToInject = (0, StorybookWrapperComponent_1.createStorybookWrapperComponent)(targetSelector, template, component, styles, props);
|
|
47
|
+
const isStandalone = (0, NgComponentAnalyzer_1.isStandaloneComponent)(component);
|
|
49
48
|
// Look recursively (deep) if the component is not already declared by an import module
|
|
50
|
-
const requiresComponentDeclaration = NgComponentAnalyzer_1.isDeclarable(component) &&
|
|
51
|
-
!NgModulesAnalyzer_1.isComponentAlreadyDeclaredInModules(component, moduleMetadata.declarations, moduleMetadata.imports) &&
|
|
49
|
+
const requiresComponentDeclaration = (0, NgComponentAnalyzer_1.isDeclarable)(component) &&
|
|
50
|
+
!(0, NgModulesAnalyzer_1.isComponentAlreadyDeclaredInModules)(component, moduleMetadata.declarations, moduleMetadata.imports) &&
|
|
52
51
|
!isStandalone;
|
|
53
52
|
return {
|
|
54
53
|
declarations: [
|
|
55
54
|
...(requiresComponentDeclaration ? [component] : []),
|
|
56
55
|
ComponentToInject,
|
|
57
|
-
...(
|
|
56
|
+
...(moduleMetadata.declarations ?? []),
|
|
58
57
|
],
|
|
59
58
|
imports: [
|
|
60
59
|
platform_browser_1.BrowserModule,
|
|
61
60
|
...(isStandalone ? [component] : []),
|
|
62
|
-
...(
|
|
61
|
+
...(moduleMetadata.imports ?? []),
|
|
63
62
|
],
|
|
64
|
-
providers: [StorybookProvider_1.storyPropsProvider(storyProps$), ...(
|
|
65
|
-
entryComponents: [...(
|
|
66
|
-
schemas: [...(
|
|
63
|
+
providers: [(0, StorybookProvider_1.storyPropsProvider)(storyProps$), ...(moduleMetadata.providers ?? [])],
|
|
64
|
+
entryComponents: [...(moduleMetadata.entryComponents ?? [])],
|
|
65
|
+
schemas: [...(moduleMetadata.schemas ?? [])],
|
|
67
66
|
bootstrap: [ComponentToInject],
|
|
68
67
|
};
|
|
69
68
|
};
|
|
70
|
-
exports.
|
|
69
|
+
exports.getStorybookModuleMetadata = getStorybookModuleMetadata;
|
|
70
|
+
const createStorybookModule = (ngModule) => {
|
|
71
71
|
let StorybookModule = class StorybookModule {
|
|
72
72
|
};
|
|
73
73
|
StorybookModule = __decorate([
|
|
74
|
-
core_1.NgModule(ngModule)
|
|
74
|
+
(0, core_1.NgModule)(ngModule)
|
|
75
75
|
], StorybookModule);
|
|
76
76
|
return StorybookModule;
|
|
77
77
|
};
|
|
78
|
+
exports.createStorybookModule = createStorybookModule;
|
|
78
79
|
function hasNoTemplate(template) {
|
|
79
80
|
return template === null || template === undefined;
|
|
80
81
|
}
|
|
File without changes
|
|
@@ -4,11 +4,12 @@ exports.storyPropsProvider = exports.STORY_PROPS = void 0;
|
|
|
4
4
|
const core_1 = require("@angular/core");
|
|
5
5
|
const rxjs_1 = require("rxjs");
|
|
6
6
|
exports.STORY_PROPS = new core_1.InjectionToken('STORY_PROPS');
|
|
7
|
-
|
|
7
|
+
const storyPropsProvider = (storyProps$) => ({
|
|
8
8
|
provide: exports.STORY_PROPS,
|
|
9
9
|
useFactory: storyDataFactory(storyProps$.asObservable()),
|
|
10
10
|
deps: [core_1.NgZone],
|
|
11
11
|
});
|
|
12
|
+
exports.storyPropsProvider = storyPropsProvider;
|
|
12
13
|
function storyDataFactory(data) {
|
|
13
14
|
return (ngZone) => new rxjs_1.Observable((subscriber) => {
|
|
14
15
|
const sub = data.subscribe((v) => {
|
|
File without changes
|
|
@@ -33,17 +33,17 @@ const getNonInputsOutputsProps = (ngComponentInputsOutputs, props = {}) => {
|
|
|
33
33
|
* @param storyComponent
|
|
34
34
|
* @param initialProps
|
|
35
35
|
*/
|
|
36
|
-
|
|
36
|
+
const createStorybookWrapperComponent = (selector, template, storyComponent, styles, initialProps) => {
|
|
37
37
|
// In ivy, a '' selector is not allowed, therefore we need to just set it to anything if
|
|
38
38
|
// storyComponent was not provided.
|
|
39
|
-
const viewChildSelector = storyComponent
|
|
39
|
+
const viewChildSelector = storyComponent ?? '__storybook-noop';
|
|
40
40
|
let StorybookWrapperComponent = class StorybookWrapperComponent {
|
|
41
41
|
// eslint-disable-next-line no-useless-constructor
|
|
42
42
|
constructor(storyProps$, changeDetectorRef) {
|
|
43
43
|
this.storyProps$ = storyProps$;
|
|
44
44
|
this.changeDetectorRef = changeDetectorRef;
|
|
45
45
|
// Used in case of a component without selector
|
|
46
|
-
this.storyComponent = storyComponent
|
|
46
|
+
this.storyComponent = storyComponent ?? '';
|
|
47
47
|
}
|
|
48
48
|
ngOnInit() {
|
|
49
49
|
// Subscribes to the observable storyProps$ to keep these properties up to date
|
|
@@ -57,7 +57,7 @@ exports.createStorybookWrapperComponent = (selector, template, storyComponent, s
|
|
|
57
57
|
ngAfterViewInit() {
|
|
58
58
|
// Bind properties to component, if the story have component
|
|
59
59
|
if (this.storyComponentElementRef) {
|
|
60
|
-
const ngComponentInputsOutputs = NgComponentAnalyzer_1.getComponentInputsOutputs(storyComponent);
|
|
60
|
+
const ngComponentInputsOutputs = (0, NgComponentAnalyzer_1.getComponentInputsOutputs)(storyComponent);
|
|
61
61
|
const initialOtherProps = getNonInputsOutputsProps(ngComponentInputsOutputs, initialProps);
|
|
62
62
|
// Initializes properties that are not Inputs | Outputs
|
|
63
63
|
// Allows story props to override local component properties
|
|
@@ -70,9 +70,9 @@ exports.createStorybookWrapperComponent = (selector, template, storyComponent, s
|
|
|
70
70
|
this.changeDetectorRef.detectChanges();
|
|
71
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
|
-
.pipe(operators_1.skip(1), operators_1.map((props) => {
|
|
73
|
+
.pipe((0, operators_1.skip)(1), (0, operators_1.map)((props) => {
|
|
74
74
|
const propsKeyToKeep = getNonInputsOutputsProps(ngComponentInputsOutputs, props);
|
|
75
|
-
return propsKeyToKeep.reduce((acc, p) => (
|
|
75
|
+
return propsKeyToKeep.reduce((acc, p) => ({ ...acc, [p]: props[p] }), {});
|
|
76
76
|
}))
|
|
77
77
|
.subscribe((props) => {
|
|
78
78
|
// Replace inputs with new ones from props
|
|
@@ -94,22 +94,23 @@ exports.createStorybookWrapperComponent = (selector, template, storyComponent, s
|
|
|
94
94
|
}
|
|
95
95
|
};
|
|
96
96
|
__decorate([
|
|
97
|
-
core_1.ViewChild(viewChildSelector, { static: true }),
|
|
97
|
+
(0, core_1.ViewChild)(viewChildSelector, { static: true }),
|
|
98
98
|
__metadata("design:type", core_1.ElementRef)
|
|
99
99
|
], StorybookWrapperComponent.prototype, "storyComponentElementRef", void 0);
|
|
100
100
|
__decorate([
|
|
101
|
-
core_1.ViewChild(viewChildSelector, { read: core_1.ViewContainerRef, static: true }),
|
|
101
|
+
(0, core_1.ViewChild)(viewChildSelector, { read: core_1.ViewContainerRef, static: true }),
|
|
102
102
|
__metadata("design:type", core_1.ViewContainerRef)
|
|
103
103
|
], StorybookWrapperComponent.prototype, "storyComponentViewContainerRef", void 0);
|
|
104
104
|
StorybookWrapperComponent = __decorate([
|
|
105
|
-
core_1.Component({
|
|
105
|
+
(0, core_1.Component)({
|
|
106
106
|
selector,
|
|
107
107
|
template,
|
|
108
108
|
styles,
|
|
109
109
|
}),
|
|
110
|
-
__param(0, core_1.Inject(StorybookProvider_1.STORY_PROPS)),
|
|
110
|
+
__param(0, (0, core_1.Inject)(StorybookProvider_1.STORY_PROPS)),
|
|
111
111
|
__metadata("design:paramtypes", [rxjs_1.Subject,
|
|
112
112
|
core_1.ChangeDetectorRef])
|
|
113
113
|
], StorybookWrapperComponent);
|
|
114
114
|
return StorybookWrapperComponent;
|
|
115
115
|
};
|
|
116
|
+
exports.createStorybookWrapperComponent = createStorybookWrapperComponent;
|
|
File without changes
|