@storybook/angular 6.5.9 → 7.0.0-alpha.10
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 +56 -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 +64 -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/types/builders/utils/standalone-options.d.ts +12 -0
- package/dist/{ts3.9/client/docs/types.js → types/builders/utils/standalone-options.js} +0 -0
- package/dist/{ts3.9/client/preview/angular/components → types/client/angular}/app.component.d.ts +1 -1
- package/dist/{ts3.9/client/preview/angular/components → types/client/angular}/app.component.js +5 -5
- package/dist/{ts3.9/client/preview → types/client}/angular/app.token.d.ts +0 -0
- package/dist/{ts3.9/client/preview → types/client}/angular/app.token.js +0 -0
- package/dist/{ts3.9/client/preview → types/client}/angular/helpers.d.ts +1 -1
- package/dist/{ts3.9/client/preview → types/client}/angular/helpers.js +7 -7
- package/dist/{ts3.9/client/preview → types/client}/angular-beta/AbstractRenderer.d.ts +1 -2
- package/dist/{ts3.9/client/preview → types/client}/angular-beta/AbstractRenderer.js +40 -48
- package/dist/{ts3.9/client/preview → types/client}/angular-beta/CanvasRenderer.d.ts +1 -2
- package/dist/types/client/angular-beta/CanvasRenderer.js +16 -0
- package/dist/{ts3.9/client/preview → types/client}/angular-beta/ComputesTemplateFromComponent.d.ts +0 -0
- package/dist/{ts3.9/client/preview → types/client}/angular-beta/ComputesTemplateFromComponent.js +10 -8
- package/dist/{ts3.9/client/preview → types/client}/angular-beta/DocsRenderer.d.ts +1 -2
- package/dist/types/client/angular-beta/DocsRenderer.js +41 -0
- package/dist/{ts3.9/client/preview → types/client}/angular-beta/RendererFactory.d.ts +0 -0
- package/dist/types/client/angular-beta/RendererFactory.js +55 -0
- package/dist/{ts3.9/client/preview → types/client}/angular-beta/StorybookModule.d.ts +0 -0
- package/dist/{ts3.9/client/preview → types/client}/angular-beta/StorybookModule.js +18 -17
- package/dist/{ts3.9/client/preview → types/client}/angular-beta/StorybookProvider.d.ts +0 -0
- package/dist/{ts3.9/client/preview → types/client}/angular-beta/StorybookProvider.js +2 -1
- package/dist/{ts3.9/client/preview → types/client}/angular-beta/StorybookWrapperComponent.d.ts +0 -0
- package/dist/{ts3.9/client/preview → types/client}/angular-beta/StorybookWrapperComponent.js +11 -10
- package/dist/{ts3.9/client/preview → types/client}/angular-beta/utils/NgComponentAnalyzer.d.ts +0 -0
- package/dist/{ts3.9/client/preview → types/client}/angular-beta/utils/NgComponentAnalyzer.js +24 -13
- package/dist/{ts3.9/client/preview → types/client}/angular-beta/utils/NgModulesAnalyzer.d.ts +0 -0
- package/dist/{ts3.9/client/preview → types/client}/angular-beta/utils/NgModulesAnalyzer.js +3 -2
- package/dist/{ts3.9/client/preview → types/client}/config.d.ts +1 -1
- package/dist/{ts3.9/client/preview → types/client}/config.js +1 -1
- package/dist/{ts3.9/client/preview → types/client}/decorateStory.d.ts +1 -1
- package/dist/{ts3.9/client/preview → types/client}/decorateStory.js +11 -6
- package/dist/{ts3.9/client/preview → types/client}/decorators.d.ts +1 -2
- package/dist/{ts3.9/client/preview → types/client}/decorators.js +23 -11
- 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 +3 -4
- 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 +2 -2
- 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/client/preview → types/client/docs}/types.js +0 -0
- package/dist/{ts3.9/client/preview/angular-polyfills.d.ts → types/client/globals.d.ts} +0 -10
- package/dist/{ts3.9/client/preview/angular-polyfills.js → types/client/globals.js} +7 -1
- package/dist/types/client/index.d.ts +5 -0
- package/dist/types/client/index.js +25 -0
- package/dist/{ts3.9/client/preview/index.d.ts → types/client/public-api.d.ts} +2 -4
- package/dist/types/client/public-api.js +43 -0
- package/dist/{ts3.9/client/preview/types-6-0.d.ts → types/client/public-types.d.ts} +4 -19
- package/dist/{ts3.9/client/preview/types-6-0.js → types/client/public-types.js} +0 -0
- package/dist/{ts3.9/client/preview → types/client}/render.d.ts +1 -1
- package/dist/types/client/render.js +24 -0
- package/dist/{ts3.9/client/preview → types/client}/types.d.ts +13 -0
- package/dist/{ts3.9/client/preview/types-7-0.js → types/client/types.js} +0 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/{ts3.9/public_api.js → types/index.js} +8 -3
- package/dist/types/preset.d.ts +6 -0
- package/dist/types/preset.js +36 -0
- package/dist/types/renderer.d.ts +4 -0
- package/dist/{ts3.9 → types}/renderer.js +5 -4
- 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 +28 -0
- package/dist/types/types.js +2 -0
- package/jest.config.js +1 -0
- package/package.json +47 -57
- package/preset.js +1 -1
- package/renderer.d.ts +1 -1
- package/renderer.js +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/public_api.d.ts +0 -1
- 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/index.d.ts +0 -4
- package/dist/ts3.9/client/index.js +0 -28
- 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/globals.d.ts +0 -1
- package/dist/ts3.9/client/preview/globals.js +0 -9
- package/dist/ts3.9/client/preview/index.js +0 -27
- package/dist/ts3.9/client/preview/render.js +0 -34
- package/dist/ts3.9/client/preview/types-7-0.d.ts +0 -9
- 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/renderer.d.ts +0 -4
- 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
- package/standalone.d.ts +0 -21
- package/standalone.js +0 -8
- package/types-6-0.d.ts +0 -1
- package/types-7-0.d.ts +0 -1
|
@@ -11,5 +11,5 @@ export declare type StorybookBuilderOptions = JsonObject & {
|
|
|
11
11
|
stylePreprocessorOptions?: StylePreprocessorOptions;
|
|
12
12
|
} & Pick<CLIOptions, 'outputDir' | 'configDir' | 'loglevel' | 'quiet' | 'docs' | 'webpackStatsJson'>;
|
|
13
13
|
export declare type StorybookBuilderOutput = JsonObject & BuilderOutput & {};
|
|
14
|
-
declare const _default: import("@angular-devkit/architect/src/internal").Builder<
|
|
14
|
+
declare const _default: import("@angular-devkit/architect/src/internal").Builder<any>;
|
|
15
15
|
export default _default;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const architect_1 = require("@angular-devkit/architect");
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const find_up_1 = require("find-up");
|
|
7
|
+
const read_pkg_up_1 = require("read-pkg-up");
|
|
8
|
+
const core_server_1 = require("@storybook/core-server");
|
|
9
|
+
const run_compodoc_1 = require("../utils/run-compodoc");
|
|
10
|
+
const build_standalone_errors_handler_1 = require("../utils/build-standalone-errors-handler");
|
|
11
|
+
exports.default = (0, architect_1.createBuilder)(commandBuilder);
|
|
12
|
+
function commandBuilder(options, context) {
|
|
13
|
+
return (0, rxjs_1.from)(setup(options, context)).pipe((0, operators_1.switchMap)(({ tsConfig }) => {
|
|
14
|
+
const runCompodoc$ = options.compodoc
|
|
15
|
+
? (0, run_compodoc_1.runCompodoc)({ compodocArgs: options.compodocArgs, tsconfig: tsConfig }, context).pipe((0, operators_1.mapTo)({ tsConfig }))
|
|
16
|
+
: (0, rxjs_1.of)({});
|
|
17
|
+
return runCompodoc$.pipe((0, operators_1.mapTo)({ tsConfig }));
|
|
18
|
+
}), (0, operators_1.map)(({ tsConfig }) => {
|
|
19
|
+
const { browserTarget, stylePreprocessorOptions, styles, configDir, docs, loglevel, outputDir, quiet, webpackStatsJson, } = options;
|
|
20
|
+
const standaloneOptions = {
|
|
21
|
+
packageJson: (0, read_pkg_up_1.sync)({ cwd: __dirname }).packageJson,
|
|
22
|
+
configDir,
|
|
23
|
+
docs,
|
|
24
|
+
loglevel,
|
|
25
|
+
outputDir,
|
|
26
|
+
quiet,
|
|
27
|
+
angularBrowserTarget: browserTarget,
|
|
28
|
+
angularBuilderContext: context,
|
|
29
|
+
angularBuilderOptions: {
|
|
30
|
+
...(stylePreprocessorOptions ? { stylePreprocessorOptions } : {}),
|
|
31
|
+
...(styles ? { styles } : {}),
|
|
32
|
+
},
|
|
33
|
+
tsConfig,
|
|
34
|
+
webpackStatsJson,
|
|
35
|
+
};
|
|
36
|
+
return standaloneOptions;
|
|
37
|
+
}), (0, operators_1.switchMap)((standaloneOptions) => runInstance({ ...standaloneOptions, mode: 'static' })), (0, operators_1.map)(() => {
|
|
38
|
+
return { success: true };
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
async function setup(options, context) {
|
|
42
|
+
let browserOptions;
|
|
43
|
+
let browserTarget;
|
|
44
|
+
if (options.browserTarget) {
|
|
45
|
+
browserTarget = (0, architect_1.targetFromTargetString)(options.browserTarget);
|
|
46
|
+
browserOptions = await context.validateOptions(await context.getTargetOptions(browserTarget), await context.getBuilderNameForTarget(browserTarget));
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
tsConfig: options.tsConfig ??
|
|
50
|
+
(0, find_up_1.sync)('tsconfig.json', { cwd: options.configDir }) ??
|
|
51
|
+
browserOptions.tsConfig,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function runInstance(options) {
|
|
55
|
+
return (0, rxjs_1.from)((0, core_server_1.buildStaticStandalone)(options)).pipe((0, operators_1.catchError)((error) => (0, rxjs_1.throwError)((0, build_standalone_errors_handler_1.buildStandaloneErrorHandler)(error))));
|
|
56
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -11,5 +11,5 @@ export declare type StorybookBuilderOptions = JsonObject & {
|
|
|
11
11
|
stylePreprocessorOptions?: StylePreprocessorOptions;
|
|
12
12
|
} & Pick<CLIOptions, 'port' | 'host' | 'configDir' | 'https' | 'sslCa' | 'sslCert' | 'sslKey' | 'smokeTest' | 'ci' | 'quiet' | 'docs'>;
|
|
13
13
|
export declare type StorybookBuilderOutput = JsonObject & BuilderOutput & {};
|
|
14
|
-
declare const _default: import("@angular-devkit/architect/src/internal").Builder<
|
|
14
|
+
declare const _default: import("@angular-devkit/architect/src/internal").Builder<any>;
|
|
15
15
|
export default _default;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const architect_1 = require("@angular-devkit/architect");
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const find_up_1 = require("find-up");
|
|
7
|
+
const read_pkg_up_1 = require("read-pkg-up");
|
|
8
|
+
const core_server_1 = require("@storybook/core-server");
|
|
9
|
+
const run_compodoc_1 = require("../utils/run-compodoc");
|
|
10
|
+
const build_standalone_errors_handler_1 = require("../utils/build-standalone-errors-handler");
|
|
11
|
+
exports.default = (0, architect_1.createBuilder)(commandBuilder);
|
|
12
|
+
function commandBuilder(options, context) {
|
|
13
|
+
return (0, rxjs_1.from)(setup(options, context)).pipe((0, operators_1.switchMap)(({ tsConfig }) => {
|
|
14
|
+
const runCompodoc$ = options.compodoc
|
|
15
|
+
? (0, run_compodoc_1.runCompodoc)({ compodocArgs: options.compodocArgs, tsconfig: tsConfig }, context).pipe((0, operators_1.mapTo)({ tsConfig }))
|
|
16
|
+
: (0, rxjs_1.of)({});
|
|
17
|
+
return runCompodoc$.pipe((0, operators_1.mapTo)({ tsConfig }));
|
|
18
|
+
}), (0, operators_1.map)(({ tsConfig }) => {
|
|
19
|
+
const { browserTarget, stylePreprocessorOptions, styles, ci, configDir, docs, host, https, port, quiet, smokeTest, sslCa, sslCert, sslKey, } = options;
|
|
20
|
+
const standaloneOptions = {
|
|
21
|
+
packageJson: (0, read_pkg_up_1.sync)({ cwd: __dirname }).packageJson,
|
|
22
|
+
ci,
|
|
23
|
+
configDir,
|
|
24
|
+
docs,
|
|
25
|
+
host,
|
|
26
|
+
https,
|
|
27
|
+
port,
|
|
28
|
+
quiet,
|
|
29
|
+
smokeTest,
|
|
30
|
+
sslCa,
|
|
31
|
+
sslCert,
|
|
32
|
+
sslKey,
|
|
33
|
+
angularBrowserTarget: browserTarget,
|
|
34
|
+
angularBuilderContext: context,
|
|
35
|
+
angularBuilderOptions: {
|
|
36
|
+
...(stylePreprocessorOptions ? { stylePreprocessorOptions } : {}),
|
|
37
|
+
...(styles ? { styles } : {}),
|
|
38
|
+
},
|
|
39
|
+
tsConfig,
|
|
40
|
+
};
|
|
41
|
+
return standaloneOptions;
|
|
42
|
+
}), (0, operators_1.switchMap)((standaloneOptions) => runInstance(standaloneOptions)), (0, operators_1.map)(() => {
|
|
43
|
+
return { success: true };
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
async function setup(options, context) {
|
|
47
|
+
let browserOptions;
|
|
48
|
+
let browserTarget;
|
|
49
|
+
if (options.browserTarget) {
|
|
50
|
+
browserTarget = (0, architect_1.targetFromTargetString)(options.browserTarget);
|
|
51
|
+
browserOptions = await context.validateOptions(await context.getTargetOptions(browserTarget), await context.getBuilderNameForTarget(browserTarget));
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
tsConfig: options.tsConfig ??
|
|
55
|
+
(0, find_up_1.sync)('tsconfig.json', { cwd: options.configDir }) ??
|
|
56
|
+
browserOptions.tsConfig,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function runInstance(options) {
|
|
60
|
+
return new rxjs_1.Observable((observer) => {
|
|
61
|
+
// This Observable intentionally never complete, leaving the process running ;)
|
|
62
|
+
(0, core_server_1.buildDevStandalone)(options).then(() => observer.next(), (error) => observer.error((0, build_standalone_errors_handler_1.buildStandaloneErrorHandler)(error)));
|
|
63
|
+
});
|
|
64
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -6,8 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.buildStandaloneErrorHandler = void 0;
|
|
7
7
|
const node_logger_1 = require("@storybook/node-logger");
|
|
8
8
|
const ts_dedent_1 = __importDefault(require("ts-dedent"));
|
|
9
|
-
|
|
10
|
-
var _a;
|
|
9
|
+
const buildStandaloneErrorHandler = (error) => {
|
|
11
10
|
// Duplicate code for Standalone error handling
|
|
12
11
|
// Source: https://github.com/storybookjs/storybook/blob/39c7ba09ad84fbd466f9c25d5b92791a5450b9f6/lib/core-server/src/build-dev.ts#L136
|
|
13
12
|
node_logger_1.instance.heading = '';
|
|
@@ -22,17 +21,18 @@ exports.buildStandaloneErrorHandler = (error) => {
|
|
|
22
21
|
node_logger_1.logger.error(error);
|
|
23
22
|
}
|
|
24
23
|
}
|
|
25
|
-
else if (
|
|
24
|
+
else if (error.compilation?.errors) {
|
|
26
25
|
error.compilation.errors.forEach((e) => node_logger_1.logger.plain(e));
|
|
27
26
|
}
|
|
28
27
|
node_logger_1.logger.line();
|
|
29
28
|
return error.close
|
|
30
|
-
? ts_dedent_1.default `
|
|
29
|
+
? (0, ts_dedent_1.default) `
|
|
31
30
|
FATAL broken build!, will close the process,
|
|
32
31
|
Fix the error below and restart storybook.
|
|
33
32
|
`
|
|
34
|
-
: ts_dedent_1.default `
|
|
33
|
+
: (0, ts_dedent_1.default) `
|
|
35
34
|
Broken build, fix the error above.
|
|
36
35
|
You may need to refresh the browser.
|
|
37
36
|
`;
|
|
38
37
|
};
|
|
38
|
+
exports.buildStandaloneErrorHandler = buildStandaloneErrorHandler;
|
|
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,7 +18,7 @@ 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
|
};
|
|
@@ -29,7 +33,7 @@ const hasTsConfigArg = (args) => args.indexOf('-p') !== -1;
|
|
|
29
33
|
const toRelativePath = (pathToTsConfig) => {
|
|
30
34
|
return path.isAbsolute(pathToTsConfig) ? path.relative('.', pathToTsConfig) : pathToTsConfig;
|
|
31
35
|
};
|
|
32
|
-
|
|
36
|
+
const runCompodoc = ({ compodocArgs, tsconfig }, context) => {
|
|
33
37
|
return new rxjs_1.Observable((observer) => {
|
|
34
38
|
const tsConfigPath = toRelativePath(tsconfig);
|
|
35
39
|
const finalCompodocArgs = [
|
|
@@ -42,7 +46,7 @@ exports.runCompodoc = ({ compodocArgs, tsconfig }, context) => {
|
|
|
42
46
|
];
|
|
43
47
|
try {
|
|
44
48
|
context.logger.info(finalCompodocArgs.join(' '));
|
|
45
|
-
const child = child_process_1.spawn('npx', finalCompodocArgs, {
|
|
49
|
+
const child = (0, child_process_1.spawn)('npx', finalCompodocArgs, {
|
|
46
50
|
cwd: context.workspaceRoot,
|
|
47
51
|
env: process.env,
|
|
48
52
|
shell: true,
|
|
@@ -68,3 +72,4 @@ exports.runCompodoc = ({ compodocArgs, tsconfig }, context) => {
|
|
|
68
72
|
}
|
|
69
73
|
});
|
|
70
74
|
};
|
|
75
|
+
exports.runCompodoc = runCompodoc;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { BuilderContext } from '@angular-devkit/architect';
|
|
2
|
+
import type { LoadOptions, CLIOptions, BuilderOptions } from '@storybook/core-common';
|
|
3
|
+
export declare type StandaloneOptions = Partial<CLIOptions & LoadOptions & BuilderOptions & {
|
|
4
|
+
mode?: 'static' | 'dev';
|
|
5
|
+
angularBrowserTarget?: string | null;
|
|
6
|
+
angularBuilderOptions?: Record<string, any> & {
|
|
7
|
+
styles?: any[];
|
|
8
|
+
stylePreprocessorOptions?: any;
|
|
9
|
+
};
|
|
10
|
+
angularBuilderContext?: BuilderContext | null;
|
|
11
|
+
tsConfig?: string;
|
|
12
|
+
}>;
|
|
File without changes
|
package/dist/{ts3.9/client/preview/angular/components → types/client/angular}/app.component.d.ts
RENAMED
|
@@ -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;
|
package/dist/{ts3.9/client/preview/angular/components → types/client/angular}/app.component.js
RENAMED
|
@@ -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;
|
|
@@ -31,7 +31,7 @@ let AppComponent = class AppComponent {
|
|
|
31
31
|
this.propSubscriptions = new Map();
|
|
32
32
|
}
|
|
33
33
|
ngOnInit() {
|
|
34
|
-
this.data.pipe(operators_1.first()).subscribe((data) => {
|
|
34
|
+
this.data.pipe((0, operators_1.first)()).subscribe((data) => {
|
|
35
35
|
this.target.clear();
|
|
36
36
|
const compFactory = this.cfr.resolveComponentFactory(data.component);
|
|
37
37
|
const componentRef = this.target.createComponent(compFactory);
|
|
@@ -126,15 +126,15 @@ let AppComponent = class AppComponent {
|
|
|
126
126
|
}
|
|
127
127
|
};
|
|
128
128
|
__decorate([
|
|
129
|
-
core_1.ViewChild('target', { read: core_1.ViewContainerRef, static: true }),
|
|
129
|
+
(0, core_1.ViewChild)('target', { read: core_1.ViewContainerRef, static: true }),
|
|
130
130
|
__metadata("design:type", core_1.ViewContainerRef)
|
|
131
131
|
], AppComponent.prototype, "target", void 0);
|
|
132
132
|
AppComponent = __decorate([
|
|
133
|
-
core_1.Component({
|
|
133
|
+
(0, core_1.Component)({
|
|
134
134
|
selector: 'storybook-dynamic-app-root',
|
|
135
135
|
template: '<ng-template #target></ng-template>',
|
|
136
136
|
}),
|
|
137
|
-
__param(2, core_1.Inject(app_token_1.STORY)),
|
|
137
|
+
__param(2, (0, core_1.Inject)(app_token_1.STORY)),
|
|
138
138
|
__metadata("design:paramtypes", [core_1.ComponentFactoryResolver,
|
|
139
139
|
core_1.ChangeDetectorRef,
|
|
140
140
|
rxjs_1.Observable])
|
|
File without changes
|
|
File without changes
|
|
@@ -11,7 +11,7 @@ const forms_1 = require("@angular/forms");
|
|
|
11
11
|
const platform_browser_dynamic_1 = require("@angular/platform-browser-dynamic");
|
|
12
12
|
const platform_browser_1 = require("@angular/platform-browser");
|
|
13
13
|
const rxjs_1 = require("rxjs");
|
|
14
|
-
const app_component_1 = require("./
|
|
14
|
+
const app_component_1 = require("./app.component");
|
|
15
15
|
const app_token_1 = require("./app.token");
|
|
16
16
|
const { document } = global_1.default;
|
|
17
17
|
let platform = null;
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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
|
+
};
|
|
@@ -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;
|
|
@@ -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;
|
package/dist/{ts3.9/client/preview → types/client}/angular-beta/ComputesTemplateFromComponent.d.ts
RENAMED
|
File without changes
|
package/dist/{ts3.9/client/preview → types/client}/angular-beta/ComputesTemplateFromComponent.js
RENAMED
|
@@ -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 = [
|
|
@@ -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;
|