@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
|
@@ -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,62 +19,63 @@ 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
|
\`\`\`
|
|
26
|
-
export const Primary:
|
|
26
|
+
export const Primary: StoryFn = () => ({});
|
|
27
27
|
Primary.parameters = { component: AppComponent };
|
|
28
28
|
\`\`\`
|
|
29
29
|
Read more at
|
|
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) => {
|
package/dist/{ts3.9/client/preview → types/client}/angular-beta/StorybookWrapperComponent.d.ts
RENAMED
|
File without changes
|
package/dist/{ts3.9/client/preview → types/client}/angular-beta/StorybookWrapperComponent.js
RENAMED
|
@@ -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;
|
package/dist/{ts3.9/client/preview → types/client}/angular-beta/utils/NgComponentAnalyzer.d.ts
RENAMED
|
File without changes
|
package/dist/{ts3.9/client/preview → types/client}/angular-beta/utils/NgComponentAnalyzer.js
RENAMED
|
@@ -6,9 +6,9 @@ const reflectionCapabilities = new core_1.ɵReflectionCapabilities();
|
|
|
6
6
|
/**
|
|
7
7
|
* Returns component Inputs / Outputs by browsing these properties and decorator
|
|
8
8
|
*/
|
|
9
|
-
|
|
10
|
-
const componentMetadata = exports.getComponentDecoratorMetadata(component);
|
|
11
|
-
const componentPropsMetadata = exports.getComponentPropsDecoratorMetadata(component);
|
|
9
|
+
const getComponentInputsOutputs = (component) => {
|
|
10
|
+
const componentMetadata = (0, exports.getComponentDecoratorMetadata)(component);
|
|
11
|
+
const componentPropsMetadata = (0, exports.getComponentPropsDecoratorMetadata)(component);
|
|
12
12
|
const initialValue = {
|
|
13
13
|
inputs: [],
|
|
14
14
|
outputs: [],
|
|
@@ -26,42 +26,50 @@ exports.getComponentInputsOutputs = (component) => {
|
|
|
26
26
|
// Browses component properties to extract I/O
|
|
27
27
|
// Filters properties that have the same name as the one present in the @Component property
|
|
28
28
|
return Object.entries(componentPropsMetadata).reduce((previousValue, [propertyName, values]) => {
|
|
29
|
-
var _a, _b;
|
|
30
29
|
const value = values.find((v) => v instanceof core_1.Input || v instanceof core_1.Output);
|
|
31
30
|
if (value instanceof core_1.Input) {
|
|
32
31
|
const inputToAdd = {
|
|
33
32
|
propName: propertyName,
|
|
34
|
-
templateName:
|
|
33
|
+
templateName: value.bindingPropertyName ?? propertyName,
|
|
35
34
|
};
|
|
36
35
|
const previousInputsFiltered = previousValue.inputs.filter((i) => i.templateName !== propertyName);
|
|
37
|
-
return
|
|
36
|
+
return {
|
|
37
|
+
...previousValue,
|
|
38
|
+
inputs: [...previousInputsFiltered, inputToAdd],
|
|
39
|
+
};
|
|
38
40
|
}
|
|
39
41
|
if (value instanceof core_1.Output) {
|
|
40
42
|
const outputToAdd = {
|
|
41
43
|
propName: propertyName,
|
|
42
|
-
templateName:
|
|
44
|
+
templateName: value.bindingPropertyName ?? propertyName,
|
|
43
45
|
};
|
|
44
46
|
const previousOutputsFiltered = previousValue.outputs.filter((i) => i.templateName !== propertyName);
|
|
45
|
-
return
|
|
47
|
+
return {
|
|
48
|
+
...previousValue,
|
|
49
|
+
outputs: [...previousOutputsFiltered, outputToAdd],
|
|
50
|
+
};
|
|
46
51
|
}
|
|
47
52
|
return previousValue;
|
|
48
53
|
}, initialValue);
|
|
49
54
|
};
|
|
50
|
-
exports.
|
|
55
|
+
exports.getComponentInputsOutputs = getComponentInputsOutputs;
|
|
56
|
+
const isDeclarable = (component) => {
|
|
51
57
|
if (!component) {
|
|
52
58
|
return false;
|
|
53
59
|
}
|
|
54
60
|
const decorators = reflectionCapabilities.annotations(component);
|
|
55
61
|
return !!(decorators || []).find((d) => d instanceof core_1.Directive || d instanceof core_1.Pipe || d instanceof core_1.Component);
|
|
56
62
|
};
|
|
57
|
-
exports.
|
|
63
|
+
exports.isDeclarable = isDeclarable;
|
|
64
|
+
const isComponent = (component) => {
|
|
58
65
|
if (!component) {
|
|
59
66
|
return false;
|
|
60
67
|
}
|
|
61
68
|
const decorators = reflectionCapabilities.annotations(component);
|
|
62
69
|
return (decorators || []).some((d) => d instanceof core_1.Component);
|
|
63
70
|
};
|
|
64
|
-
exports.
|
|
71
|
+
exports.isComponent = isComponent;
|
|
72
|
+
const isStandaloneComponent = (component) => {
|
|
65
73
|
if (!component) {
|
|
66
74
|
return false;
|
|
67
75
|
}
|
|
@@ -70,17 +78,20 @@ exports.isStandaloneComponent = (component) => {
|
|
|
70
78
|
// Angular deps are updated to v14.x.x.
|
|
71
79
|
return (decorators || []).some((d) => d instanceof core_1.Component && d.standalone);
|
|
72
80
|
};
|
|
81
|
+
exports.isStandaloneComponent = isStandaloneComponent;
|
|
73
82
|
/**
|
|
74
83
|
* Returns all component decorator properties
|
|
75
84
|
* is used to get all `@Input` and `@Output` Decorator
|
|
76
85
|
*/
|
|
77
|
-
|
|
86
|
+
const getComponentPropsDecoratorMetadata = (component) => {
|
|
78
87
|
return reflectionCapabilities.propMetadata(component);
|
|
79
88
|
};
|
|
89
|
+
exports.getComponentPropsDecoratorMetadata = getComponentPropsDecoratorMetadata;
|
|
80
90
|
/**
|
|
81
91
|
* Returns component decorator `@Component`
|
|
82
92
|
*/
|
|
83
|
-
|
|
93
|
+
const getComponentDecoratorMetadata = (component) => {
|
|
84
94
|
const decorators = reflectionCapabilities.annotations(component);
|
|
85
95
|
return decorators.reverse().find((d) => d instanceof core_1.Component);
|
|
86
96
|
};
|
|
97
|
+
exports.getComponentDecoratorMetadata = getComponentDecoratorMetadata;
|
package/dist/{ts3.9/client/preview → types/client}/angular-beta/utils/NgModulesAnalyzer.d.ts
RENAMED
|
File without changes
|
|
@@ -8,7 +8,7 @@ const reflectionCapabilities = new core_1.ɵReflectionCapabilities();
|
|
|
8
8
|
*
|
|
9
9
|
* Checks recursively if the component has already been declared in all import Module
|
|
10
10
|
*/
|
|
11
|
-
|
|
11
|
+
const isComponentAlreadyDeclaredInModules = (componentToFind, moduleDeclarations, moduleImports) => {
|
|
12
12
|
if (moduleDeclarations &&
|
|
13
13
|
moduleDeclarations.some((declaration) => declaration === componentToFind)) {
|
|
14
14
|
// Found component in declarations array
|
|
@@ -23,9 +23,10 @@ exports.isComponentAlreadyDeclaredInModules = (componentToFind, moduleDeclaratio
|
|
|
23
23
|
// Not an NgModule
|
|
24
24
|
return false;
|
|
25
25
|
}
|
|
26
|
-
return exports.isComponentAlreadyDeclaredInModules(componentToFind, extractedNgModuleMetadata.declarations, extractedNgModuleMetadata.imports);
|
|
26
|
+
return (0, exports.isComponentAlreadyDeclaredInModules)(componentToFind, extractedNgModuleMetadata.declarations, extractedNgModuleMetadata.imports);
|
|
27
27
|
});
|
|
28
28
|
};
|
|
29
|
+
exports.isComponentAlreadyDeclaredInModules = isComponentAlreadyDeclaredInModules;
|
|
29
30
|
const extractNgModuleMetadata = (importItem) => {
|
|
30
31
|
const target = importItem && importItem.ngModule ? importItem.ngModule : importItem;
|
|
31
32
|
const decorators = reflectionCapabilities.annotations(target);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parameters = void 0;
|
|
3
|
+
exports.parameters = exports.decorateStory = exports.renderToDOM = exports.render = void 0;
|
|
4
4
|
require("./globals");
|
|
5
5
|
var render_1 = require("./render");
|
|
6
6
|
Object.defineProperty(exports, "render", { enumerable: true, get: function () { return render_1.render; } });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { DecoratorFunction, LegacyStoryFn } from '@storybook/csf';
|
|
2
|
-
import type { AngularFramework } from './types
|
|
2
|
+
import type { AngularFramework } from './types';
|
|
3
3
|
export default function decorateStory(mainStoryFn: LegacyStoryFn<AngularFramework>, decorators: DecoratorFunction<AngularFramework>[]): LegacyStoryFn<AngularFramework>;
|
|
4
4
|
export { decorateStory };
|
|
@@ -6,7 +6,10 @@ const ComputesTemplateFromComponent_1 = require("./angular-beta/ComputesTemplate
|
|
|
6
6
|
function decorateStory(mainStoryFn, decorators) {
|
|
7
7
|
const returnDecorators = [cleanArgsDecorator, ...decorators].reduce((previousStoryFn, decorator) => (context) => {
|
|
8
8
|
const decoratedStory = decorator((update) => {
|
|
9
|
-
return previousStoryFn(
|
|
9
|
+
return previousStoryFn({
|
|
10
|
+
...context,
|
|
11
|
+
...(0, store_1.sanitizeStoryContextUpdate)(update),
|
|
12
|
+
});
|
|
10
13
|
}, context);
|
|
11
14
|
return decoratedStory;
|
|
12
15
|
}, (context) => prepareMain(mainStoryFn(context), context));
|
|
@@ -15,14 +18,16 @@ function decorateStory(mainStoryFn, decorators) {
|
|
|
15
18
|
exports.default = decorateStory;
|
|
16
19
|
exports.decorateStory = decorateStory;
|
|
17
20
|
const prepareMain = (story, context) => {
|
|
18
|
-
var _a;
|
|
19
21
|
let { template } = story;
|
|
20
|
-
const component =
|
|
22
|
+
const component = story.component ?? context.component;
|
|
21
23
|
const userDefinedTemplate = !hasNoTemplate(template);
|
|
22
24
|
if (!userDefinedTemplate && component) {
|
|
23
|
-
template = ComputesTemplateFromComponent_1.computesTemplateFromComponent(component, story.props, '');
|
|
25
|
+
template = (0, ComputesTemplateFromComponent_1.computesTemplateFromComponent)(component, story.props, '');
|
|
24
26
|
}
|
|
25
|
-
return
|
|
27
|
+
return {
|
|
28
|
+
...story,
|
|
29
|
+
...(template ? { template, userDefinedTemplate } : {}),
|
|
30
|
+
};
|
|
26
31
|
};
|
|
27
32
|
function hasNoTemplate(template) {
|
|
28
33
|
return template === null || template === undefined;
|
|
@@ -36,7 +41,7 @@ const cleanArgsDecorator = (storyFn, context) => {
|
|
|
36
41
|
const argType = context.argTypes[key];
|
|
37
42
|
// Only keeps args with a control or an action in argTypes
|
|
38
43
|
if (argType.action || argType.control) {
|
|
39
|
-
return
|
|
44
|
+
return { ...obj, [key]: arg };
|
|
40
45
|
}
|
|
41
46
|
return obj;
|
|
42
47
|
}, {});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Type } from '@angular/core';
|
|
2
2
|
import type { DecoratorFunction, StoryContext } from '@storybook/csf';
|
|
3
|
-
import type { ICollection, NgModuleMetadata } from './types';
|
|
4
|
-
import type { AngularFramework } from './types-6-0';
|
|
3
|
+
import type { ICollection, NgModuleMetadata, AngularFramework } from './types';
|
|
5
4
|
export declare const moduleMetadata: <TArgs = any>(metadata: Partial<NgModuleMetadata>) => DecoratorFunction<AngularFramework, TArgs>;
|
|
6
5
|
export declare const componentWrapperDecorator: <TArgs = any>(element: Type<unknown> | ((story: string) => string), props?: ICollection | ((storyContext: StoryContext<AngularFramework, TArgs>) => ICollection)) => DecoratorFunction<AngularFramework, TArgs>;
|
|
@@ -5,11 +5,13 @@ const ComputesTemplateFromComponent_1 = require("./angular-beta/ComputesTemplate
|
|
|
5
5
|
const NgComponentAnalyzer_1 = require("./angular-beta/utils/NgComponentAnalyzer");
|
|
6
6
|
// We use `any` here as the default type rather than `Args` because we need something that is
|
|
7
7
|
// castable to any component-specific args type when the user is being careful.
|
|
8
|
-
|
|
8
|
+
const moduleMetadata = (metadata) => (storyFn) => {
|
|
9
9
|
const story = storyFn();
|
|
10
10
|
const storyMetadata = story.moduleMetadata || {};
|
|
11
11
|
metadata = metadata || {};
|
|
12
|
-
return
|
|
12
|
+
return {
|
|
13
|
+
...story,
|
|
14
|
+
moduleMetadata: {
|
|
13
15
|
declarations: [...(metadata.declarations || []), ...(storyMetadata.declarations || [])],
|
|
14
16
|
entryComponents: [
|
|
15
17
|
...(metadata.entryComponents || []),
|
|
@@ -18,17 +20,27 @@ exports.moduleMetadata = (metadata) => (storyFn) => {
|
|
|
18
20
|
imports: [...(metadata.imports || []), ...(storyMetadata.imports || [])],
|
|
19
21
|
schemas: [...(metadata.schemas || []), ...(storyMetadata.schemas || [])],
|
|
20
22
|
providers: [...(metadata.providers || []), ...(storyMetadata.providers || [])],
|
|
21
|
-
}
|
|
23
|
+
},
|
|
24
|
+
};
|
|
22
25
|
};
|
|
23
|
-
exports.
|
|
26
|
+
exports.moduleMetadata = moduleMetadata;
|
|
27
|
+
const componentWrapperDecorator = (element, props) => (storyFn, storyContext) => {
|
|
24
28
|
const story = storyFn();
|
|
25
29
|
const currentProps = typeof props === 'function' ? props(storyContext) : props;
|
|
26
|
-
const template = NgComponentAnalyzer_1.isComponent(element)
|
|
27
|
-
? ComputesTemplateFromComponent_1.computesTemplateFromComponent(element, currentProps
|
|
30
|
+
const template = (0, NgComponentAnalyzer_1.isComponent)(element)
|
|
31
|
+
? (0, ComputesTemplateFromComponent_1.computesTemplateFromComponent)(element, currentProps ?? {}, story.template)
|
|
28
32
|
: element(story.template);
|
|
29
|
-
return
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
return {
|
|
34
|
+
...story,
|
|
35
|
+
template,
|
|
36
|
+
...(currentProps || story.props
|
|
37
|
+
? {
|
|
38
|
+
props: {
|
|
39
|
+
...currentProps,
|
|
40
|
+
...story.props,
|
|
41
|
+
},
|
|
42
|
+
}
|
|
43
|
+
: {}),
|
|
44
|
+
};
|
|
34
45
|
};
|
|
46
|
+
exports.componentWrapperDecorator = componentWrapperDecorator;
|
|
File without changes
|