@storybook/angular 7.0.0-alpha.5 → 7.0.0-alpha.50

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.
Files changed (313) hide show
  1. package/.eslintrc.js +8 -0
  2. package/README.md +1 -1
  3. package/dist/{types/builders → builders}/build-storybook/index.d.ts +1 -1
  4. package/dist/{types/builders → builders}/build-storybook/index.js +0 -0
  5. package/dist/builders/build-storybook/index.spec.d.ts +1 -0
  6. package/dist/builders/build-storybook/index.spec.js +218 -0
  7. package/dist/{types/builders → builders}/build-storybook/schema.json +0 -0
  8. package/dist/{types/builders → builders}/builders.json +0 -0
  9. package/dist/{types/builders → builders}/start-storybook/index.d.ts +1 -1
  10. package/dist/{types/builders → builders}/start-storybook/index.js +0 -0
  11. package/dist/builders/start-storybook/index.spec.d.ts +1 -0
  12. package/dist/builders/start-storybook/index.spec.js +214 -0
  13. package/dist/{types/builders → builders}/start-storybook/schema.json +0 -0
  14. package/dist/{types/builders → builders}/utils/build-standalone-errors-handler.d.ts +0 -0
  15. package/dist/{types/builders → builders}/utils/build-standalone-errors-handler.js +3 -6
  16. package/dist/{types/builders → builders}/utils/run-compodoc.d.ts +0 -0
  17. package/dist/{types/builders → builders}/utils/run-compodoc.js +0 -1
  18. package/dist/builders/utils/run-compodoc.spec.d.ts +1 -0
  19. package/dist/builders/utils/run-compodoc.spec.js +59 -0
  20. package/dist/{types/builders → builders}/utils/standalone-options.d.ts +2 -2
  21. package/dist/{types/builders → builders}/utils/standalone-options.js +0 -0
  22. package/dist/{types/client/preview/angular/components → client/angular}/app.component.d.ts +2 -2
  23. package/dist/{types/client/preview/angular/components → client/angular}/app.component.js +1 -2
  24. package/dist/{types/client/preview → client}/angular/app.token.d.ts +0 -0
  25. package/dist/{types/client/preview → client}/angular/app.token.js +0 -0
  26. package/dist/{types/client/preview → client}/angular/helpers.d.ts +3 -3
  27. package/dist/{types/client/preview → client}/angular/helpers.js +2 -3
  28. package/dist/{types/client/preview → client}/angular-beta/AbstractRenderer.d.ts +1 -2
  29. package/dist/{types/client/preview → client}/angular-beta/AbstractRenderer.js +0 -0
  30. package/dist/{types/client/preview → client}/angular-beta/CanvasRenderer.d.ts +1 -2
  31. package/dist/{types/client/preview → client}/angular-beta/CanvasRenderer.js +0 -0
  32. package/dist/{types/client/preview → client}/angular-beta/ComputesTemplateFromComponent.d.ts +4 -4
  33. package/dist/{types/client/preview → client}/angular-beta/ComputesTemplateFromComponent.js +0 -0
  34. package/dist/client/angular-beta/ComputesTemplateFromComponent.test.d.ts +1 -0
  35. package/dist/client/angular-beta/ComputesTemplateFromComponent.test.js +389 -0
  36. package/dist/{types/client/preview → client}/angular-beta/DocsRenderer.d.ts +1 -2
  37. package/dist/{types/client/preview → client}/angular-beta/DocsRenderer.js +3 -6
  38. package/dist/{types/client/preview → client}/angular-beta/RendererFactory.d.ts +0 -0
  39. package/dist/{types/client/preview → client}/angular-beta/RendererFactory.js +3 -3
  40. package/dist/client/angular-beta/RendererFactory.test.d.ts +1 -0
  41. package/dist/client/angular-beta/RendererFactory.test.js +297 -0
  42. package/dist/{types/client/preview → client}/angular-beta/StorybookModule.d.ts +2 -2
  43. package/dist/{types/client/preview → client}/angular-beta/StorybookModule.js +4 -23
  44. package/dist/client/angular-beta/StorybookModule.test.d.ts +1 -0
  45. package/dist/client/angular-beta/StorybookModule.test.js +279 -0
  46. package/dist/{types/client/preview → client}/angular-beta/StorybookProvider.d.ts +1 -1
  47. package/dist/{types/client/preview → client}/angular-beta/StorybookProvider.js +0 -0
  48. package/dist/{types/client/preview → client}/angular-beta/StorybookWrapperComponent.d.ts +0 -0
  49. package/dist/{types/client/preview → client}/angular-beta/StorybookWrapperComponent.js +0 -1
  50. package/dist/client/angular-beta/__testfixtures__/input.component.d.ts +26 -0
  51. package/dist/client/angular-beta/__testfixtures__/input.component.js +67 -0
  52. package/dist/{types/client/preview → client}/angular-beta/utils/NgComponentAnalyzer.d.ts +1 -1
  53. package/dist/{types/client/preview → client}/angular-beta/utils/NgComponentAnalyzer.js +0 -0
  54. package/dist/client/angular-beta/utils/NgComponentAnalyzer.test.d.ts +1 -0
  55. package/dist/client/angular-beta/utils/NgComponentAnalyzer.test.js +340 -0
  56. package/dist/{types/client/preview → client}/angular-beta/utils/NgModulesAnalyzer.d.ts +0 -0
  57. package/dist/{types/client/preview → client}/angular-beta/utils/NgModulesAnalyzer.js +0 -0
  58. package/dist/client/angular-beta/utils/NgModulesAnalyzer.test.d.ts +1 -0
  59. package/dist/client/angular-beta/utils/NgModulesAnalyzer.test.js +23 -0
  60. package/dist/client/config.d.ts +6 -0
  61. package/dist/client/config.js +10 -0
  62. package/dist/client/decorateStory.d.ts +4 -0
  63. package/dist/{types/client/preview → client}/decorateStory.js +1 -1
  64. package/dist/client/decorateStory.test.d.ts +1 -0
  65. package/dist/client/decorateStory.test.js +335 -0
  66. package/dist/client/decorators.d.ts +5 -0
  67. package/dist/{types/client/preview → client}/decorators.js +0 -0
  68. package/dist/client/decorators.test.d.ts +1 -0
  69. package/dist/client/decorators.test.js +106 -0
  70. package/dist/client/docs/__testfixtures__/doc-button/input.d.ts +111 -0
  71. package/dist/client/docs/__testfixtures__/doc-button/input.js +207 -0
  72. package/dist/client/docs/__testfixtures__/doc-button/tsconfig.json +7 -0
  73. package/dist/client/docs/angular-properties.test.d.ts +1 -0
  74. package/dist/client/docs/angular-properties.test.js +56 -0
  75. package/dist/{types/client → client}/docs/compodoc.d.ts +4 -4
  76. package/dist/{types/client → client}/docs/compodoc.js +2 -3
  77. package/dist/client/docs/compodoc.test.d.ts +1 -0
  78. package/dist/client/docs/compodoc.test.js +131 -0
  79. package/dist/client/docs/config.d.ts +4 -0
  80. package/dist/{types/client → client}/docs/config.js +0 -0
  81. package/dist/{types/client → client}/docs/index.d.ts +0 -0
  82. package/dist/{types/client → client}/docs/index.js +0 -0
  83. package/dist/{types/client → client}/docs/sourceDecorator.d.ts +3 -3
  84. package/dist/{types/client → client}/docs/sourceDecorator.js +0 -0
  85. package/dist/{types/client → client}/docs/types.d.ts +0 -0
  86. package/dist/{types/client → client}/docs/types.js +0 -0
  87. package/dist/{types/client/preview/angular-polyfills.d.ts → client/globals.d.ts} +0 -10
  88. package/dist/{types/client/preview/angular-polyfills.js → client/globals.js} +7 -1
  89. package/dist/client/index.d.ts +5 -0
  90. package/dist/client/index.js +28 -0
  91. package/dist/client/public-api.d.ts +15 -0
  92. package/dist/client/public-api.js +36 -0
  93. package/dist/client/public-types.d.ts +36 -0
  94. package/dist/{types/client/preview/types-6-0.js → client/public-types.js} +0 -0
  95. package/dist/client/render.d.ts +6 -0
  96. package/dist/{types/client/preview → client}/render.js +3 -3
  97. package/dist/client/types.d.ts +38 -0
  98. package/dist/{types/client/preview → client}/types.js +0 -0
  99. package/dist/index.d.ts +2 -0
  100. package/dist/{types/index.js → index.js} +1 -1
  101. package/dist/preset.d.ts +6 -0
  102. package/dist/{types/preset.js → preset.js} +12 -9
  103. package/dist/renderer.d.ts +4 -0
  104. package/dist/{types/renderer.js → renderer.js} +4 -4
  105. package/dist/{types/server → server}/__mocks-ng-workspace__/empty-projects-entry/angular.json +0 -0
  106. package/dist/{types/server → server}/__mocks-ng-workspace__/minimal-config/angular.json +0 -0
  107. package/dist/{types/server → server}/__mocks-ng-workspace__/minimal-config/src/main.d.ts +0 -0
  108. package/dist/{types/server → server}/__mocks-ng-workspace__/minimal-config/src/main.js +0 -0
  109. package/dist/{types/server → server}/__mocks-ng-workspace__/minimal-config/src/tsconfig.app.json +0 -0
  110. package/dist/{types/server/__mocks-ng-workspace__/some-config → server/__mocks-ng-workspace__/minimal-config}/tsconfig.json +1 -4
  111. package/dist/{types/server → server}/__mocks-ng-workspace__/some-config/angular.json +0 -0
  112. package/dist/{types/server → server}/__mocks-ng-workspace__/some-config/src/main.d.ts +0 -0
  113. package/dist/{types/server → server}/__mocks-ng-workspace__/some-config/src/main.js +0 -0
  114. package/dist/{types/server → server}/__mocks-ng-workspace__/some-config/src/tsconfig.app.json +0 -0
  115. package/dist/{types/server/__mocks-ng-workspace__/with-angularBrowserTarget → server/__mocks-ng-workspace__/some-config}/tsconfig.json +1 -4
  116. package/dist/{types/server → server}/__mocks-ng-workspace__/with-angularBrowserTarget/angular.json +0 -0
  117. package/dist/{types/server → server}/__mocks-ng-workspace__/with-angularBrowserTarget/src/main.d.ts +0 -0
  118. package/dist/{types/server → server}/__mocks-ng-workspace__/with-angularBrowserTarget/src/main.js +0 -0
  119. package/dist/{types/server → server}/__mocks-ng-workspace__/with-angularBrowserTarget/src/tsconfig.app.json +0 -0
  120. package/dist/{types/server/__mocks-ng-workspace__/minimal-config → server/__mocks-ng-workspace__/with-angularBrowserTarget}/tsconfig.json +1 -4
  121. package/dist/{types/server → server}/__mocks-ng-workspace__/with-lib/angular.json +0 -0
  122. package/dist/{types/server → server}/__mocks-ng-workspace__/with-lib/projects/pattern-lib/src/main.d.ts +0 -0
  123. package/dist/{types/server → server}/__mocks-ng-workspace__/with-lib/projects/pattern-lib/src/main.js +0 -0
  124. package/dist/{types/server/__mocks-ng-workspace__/without-projects-entry → server/__mocks-ng-workspace__/with-lib}/projects/pattern-lib/tsconfig.lib.json +2 -8
  125. package/dist/{types/server → server}/__mocks-ng-workspace__/with-lib/tsconfig.json +1 -4
  126. package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx/angular.json +0 -0
  127. package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx/nx.json +0 -0
  128. package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx/src/main.d.ts +0 -0
  129. package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx/src/main.js +0 -0
  130. package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx/src/tsconfig.app.json +0 -0
  131. package/dist/server/__mocks-ng-workspace__/with-nx/tsconfig.json +14 -0
  132. package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx-workspace/nx.json +0 -0
  133. package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx-workspace/src/main.d.ts +0 -0
  134. package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx-workspace/src/main.js +0 -0
  135. package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx-workspace/src/tsconfig.app.json +0 -0
  136. package/dist/server/__mocks-ng-workspace__/with-nx-workspace/tsconfig.json +14 -0
  137. package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx-workspace/workspace.json +0 -0
  138. package/dist/{types/server → server}/__mocks-ng-workspace__/with-options-styles/angular.json +0 -0
  139. package/dist/{types/server → server}/__mocks-ng-workspace__/with-options-styles/src/main.d.ts +0 -0
  140. package/dist/{types/server → server}/__mocks-ng-workspace__/with-options-styles/src/main.js +0 -0
  141. package/dist/{types/server → server}/__mocks-ng-workspace__/with-options-styles/src/tsconfig.app.json +0 -0
  142. package/dist/server/__mocks-ng-workspace__/with-options-styles/tsconfig.json +13 -0
  143. package/dist/{types/server → server}/__mocks-ng-workspace__/without-architect-build/angular.json +0 -0
  144. package/dist/{types/server → server}/__mocks-ng-workspace__/without-architect-build-options/angular.json +0 -0
  145. package/dist/{types/server → server}/__mocks-ng-workspace__/without-compatible-projects/angular.json +0 -0
  146. package/dist/{types/server → server}/__mocks-ng-workspace__/without-projects-entry/angular.json +0 -0
  147. package/dist/{types/server → server}/__mocks-ng-workspace__/without-projects-entry/projects/pattern-lib/src/main.d.ts +0 -0
  148. package/dist/{types/server → server}/__mocks-ng-workspace__/without-projects-entry/projects/pattern-lib/src/main.js +0 -0
  149. package/dist/{types/server/__mocks-ng-workspace__/with-lib → server/__mocks-ng-workspace__/without-projects-entry}/projects/pattern-lib/tsconfig.lib.json +2 -8
  150. package/dist/server/__mocks-ng-workspace__/without-projects-entry/tsconfig.json +13 -0
  151. package/dist/{types/server → server}/__mocks-ng-workspace__/without-tsConfig/angular.json +0 -0
  152. package/dist/{types/server → server}/__mocks-ng-workspace__/without-tsConfig/src/main.d.ts +0 -0
  153. package/dist/{types/server → server}/__mocks-ng-workspace__/without-tsConfig/src/main.js +0 -0
  154. package/dist/{types/server → server}/__mocks-ng-workspace__/without-tsConfig/src/tsconfig.app.json +0 -0
  155. package/dist/server/__mocks-ng-workspace__/without-tsConfig/tsconfig.json +13 -0
  156. package/dist/server/__tests__/angular.json +96 -0
  157. package/dist/{types/server → server}/angular-cli-webpack-13.x.x.d.ts +0 -0
  158. package/dist/{types/server → server}/angular-cli-webpack-13.x.x.js +0 -0
  159. package/dist/{types/server → server}/angular-read-workspace.d.ts +0 -0
  160. package/dist/{types/server → server}/angular-read-workspace.js +1 -1
  161. package/dist/{types/server → server}/framework-preset-angular-cli.d.ts +1 -1
  162. package/dist/{types/server → server}/framework-preset-angular-cli.js +3 -22
  163. package/dist/server/framework-preset-angular-cli.test.d.ts +1 -0
  164. package/dist/server/framework-preset-angular-cli.test.js +708 -0
  165. package/dist/{types/server → server}/framework-preset-angular-docs.d.ts +1 -1
  166. package/dist/{types/server → server}/framework-preset-angular-docs.js +1 -1
  167. package/dist/{types/server → server}/framework-preset-angular-ivy.d.ts +1 -1
  168. package/dist/{types/server → server}/framework-preset-angular-ivy.js +4 -2
  169. package/dist/{types/server → server}/preset-options.d.ts +1 -1
  170. package/dist/{types/server → server}/preset-options.js +0 -0
  171. package/dist/{types/server → server}/utils/filter-out-styling-rules.d.ts +1 -1
  172. package/dist/{types/server → server}/utils/filter-out-styling-rules.js +0 -0
  173. package/dist/{types/server → server}/utils/module-is-available.d.ts +0 -0
  174. package/dist/{types/server → server}/utils/module-is-available.js +0 -0
  175. package/dist/{types/server → server}/utils/normalize-asset-patterns.d.ts +1 -1
  176. package/dist/{types/server → server}/utils/normalize-asset-patterns.js +0 -0
  177. package/dist/{types/server → server}/utils/normalize-optimization.d.ts +0 -0
  178. package/dist/{types/server → server}/utils/normalize-optimization.js +0 -0
  179. package/dist/types.d.ts +29 -0
  180. package/dist/{types/types.js → types.js} +0 -0
  181. package/jest.config.js +8 -1
  182. package/package.json +44 -48
  183. package/preset.js +1 -1
  184. package/renderer.d.ts +1 -1
  185. package/renderer.js +1 -1
  186. package/template/cli/.eslintrc.json +5 -0
  187. package/template/cli/Button.stories.ts +54 -0
  188. package/template/cli/Header.stories.ts +37 -0
  189. package/template/cli/Page.stories.ts +46 -0
  190. package/template/cli/User.ts +2 -0
  191. package/template/cli/button.component.ts +53 -0
  192. package/template/cli/header.component.ts +75 -0
  193. package/template/cli/page.component.ts +77 -0
  194. package/template/components/button.component.ts +54 -0
  195. package/template/components/button.css +30 -0
  196. package/template/components/form.component.ts +37 -0
  197. package/template/components/html.component.ts +22 -0
  198. package/template/components/index.js +8 -0
  199. package/template/components/pre.component.ts +29 -0
  200. package/template/stories/angular-mdx.stories.mdx +25 -0
  201. package/template/stories/argTypes/doc-button/doc-button.component.html +7 -0
  202. package/template/stories/argTypes/doc-button/doc-button.component.scss +3 -0
  203. package/template/stories/argTypes/doc-button/doc-button.component.ts +233 -0
  204. package/template/stories/argTypes/doc-button/doc-button.stories.ts +24 -0
  205. package/template/stories/argTypes/doc-directive/doc-directive.directive.ts +24 -0
  206. package/template/stories/argTypes/doc-directive/doc-directive.stories.ts +14 -0
  207. package/template/stories/argTypes/doc-injectable/doc-injectable.service.ts +27 -0
  208. package/template/stories/argTypes/doc-injectable/doc-injectable.stories.ts +17 -0
  209. package/template/stories/argTypes/doc-pipe/doc-pipe.pipe.ts +18 -0
  210. package/template/stories/argTypes/doc-pipe/doc-pipe.stories.ts +17 -0
  211. package/template/stories/basics/README.stories.mdx +7 -0
  212. package/template/stories/basics/angular-forms/customControlValueAccessor/custom-cva-component.stories.ts +27 -0
  213. package/template/stories/basics/angular-forms/customControlValueAccessor/custom-cva.component.ts +57 -0
  214. package/template/stories/basics/component-with-complex-selectors/attribute-selector.component.ts +19 -0
  215. package/template/stories/basics/component-with-complex-selectors/attribute-selectors.component.stories.ts +8 -0
  216. package/template/stories/basics/component-with-complex-selectors/class-selector.component.stories.ts +8 -0
  217. package/template/stories/basics/component-with-complex-selectors/class-selector.component.ts +19 -0
  218. package/template/stories/basics/component-with-complex-selectors/multiple-class-selector.component.stories.ts +8 -0
  219. package/template/stories/basics/component-with-complex-selectors/multiple-selector.component.stories.ts +8 -0
  220. package/template/stories/basics/component-with-complex-selectors/multiple-selector.component.ts +37 -0
  221. package/template/stories/basics/component-with-enums/enums.component.html +8 -0
  222. package/template/stories/basics/component-with-enums/enums.component.stories.ts +24 -0
  223. package/template/stories/basics/component-with-enums/enums.component.ts +53 -0
  224. package/template/stories/basics/component-with-inheritance/base-button.component.ts +10 -0
  225. package/template/stories/basics/component-with-inheritance/base-button.stories.ts +12 -0
  226. package/template/stories/basics/component-with-inheritance/icon-button.component.ts +11 -0
  227. package/template/stories/basics/component-with-inheritance/icon-button.stories.ts +13 -0
  228. package/template/stories/basics/component-with-ng-content/ng-content-about-parent.stories.ts +58 -0
  229. package/template/stories/basics/component-with-ng-content/ng-content-simple.stories.ts +29 -0
  230. package/template/stories/basics/component-with-ng-on-destroy/component-with-on-destroy.stories.ts +42 -0
  231. package/template/stories/basics/component-with-on-push/on-push-box.component.ts +21 -0
  232. package/template/stories/basics/component-with-on-push/on-push.stories.ts +21 -0
  233. package/template/stories/basics/component-with-pipe/custom-pipes.stories.ts +31 -0
  234. package/template/stories/basics/component-with-pipe/custom.pipe.ts +10 -0
  235. package/template/stories/basics/component-with-pipe/with-pipe.component.ts +10 -0
  236. package/template/stories/basics/component-with-provider/di.component.html +7 -0
  237. package/template/stories/basics/component-with-provider/di.component.stories.ts +26 -0
  238. package/template/stories/basics/component-with-provider/di.component.ts +28 -0
  239. package/template/stories/basics/component-with-style/styled.component.css +3 -0
  240. package/template/stories/basics/component-with-style/styled.component.html +5 -0
  241. package/template/stories/basics/component-with-style/styled.component.scss +5 -0
  242. package/template/stories/basics/component-with-style/styled.component.stories.ts +10 -0
  243. package/template/stories/basics/component-with-style/styled.component.ts +8 -0
  244. package/template/stories/basics/component-without-selector/without-selector-ng-component-outlet.stories.ts +73 -0
  245. package/template/stories/basics/component-without-selector/without-selector-ng-factory-resolver.stories.ts +71 -0
  246. package/template/stories/basics/component-without-selector/without-selector.component.ts +30 -0
  247. package/template/stories/basics/component-without-selector/without-selector.stories.ts +30 -0
  248. package/template/stories/basics/ng-module/angular-src/chip-color.token.ts +3 -0
  249. package/template/stories/basics/ng-module/angular-src/chip-text.pipe.ts +29 -0
  250. package/template/stories/basics/ng-module/angular-src/chip.component.ts +60 -0
  251. package/template/stories/basics/ng-module/angular-src/chips-group.component.ts +49 -0
  252. package/template/stories/basics/ng-module/angular-src/chips.module.ts +31 -0
  253. package/template/stories/basics/ng-module/import-module-for-root.stories.ts +50 -0
  254. package/template/stories/basics/ng-module/import-module.stories.ts +46 -0
  255. package/template/stories/button.component.ts +26 -0
  256. package/template/stories/core/README.stories.mdx +7 -0
  257. package/template/stories/core/decorators/componentWrapperDecorator/child.component.ts +20 -0
  258. package/template/stories/core/decorators/componentWrapperDecorator/decorators.stories.ts +117 -0
  259. package/template/stories/core/decorators/componentWrapperDecorator/parent.component.ts +18 -0
  260. package/template/stories/core/decorators/theme-decorator/decorators.stories.ts +20 -0
  261. package/template/stories/core/moduleMetadata/angular-src/custom.pipe.ts +10 -0
  262. package/template/stories/core/moduleMetadata/angular-src/dummy.service.ts +14 -0
  263. package/template/stories/core/moduleMetadata/angular-src/service.component.ts +24 -0
  264. package/template/stories/core/moduleMetadata/angular-src/token.component.ts +31 -0
  265. package/template/stories/core/moduleMetadata/in-export-default.stories.ts +38 -0
  266. package/template/stories/core/moduleMetadata/in-stories.stories.ts +46 -0
  267. package/template/stories/core/moduleMetadata/merge-default-and-story.stories.ts +35 -0
  268. package/template/stories/core/parameters/bootstrap-options.stories.ts +22 -0
  269. package/template/stories/core/styles/story-styles.stories.ts +50 -0
  270. package/template/stories/others/issues/12009-unknown-component.stories.ts +14 -0
  271. package/template/stories/others/ngx-translate/README.stories.mdx +58 -0
  272. package/LICENSE +0 -21
  273. package/dist/types/client/docs/config.d.ts +0 -14
  274. package/dist/types/client/index.d.ts +0 -4
  275. package/dist/types/client/index.js +0 -32
  276. package/dist/types/client/preview/config.d.ts +0 -6
  277. package/dist/types/client/preview/config.js +0 -10
  278. package/dist/types/client/preview/decorateStory.d.ts +0 -4
  279. package/dist/types/client/preview/decorators.d.ts +0 -6
  280. package/dist/types/client/preview/globals.d.ts +0 -1
  281. package/dist/types/client/preview/globals.js +0 -9
  282. package/dist/types/client/preview/index.d.ts +0 -25
  283. package/dist/types/client/preview/index.js +0 -29
  284. package/dist/types/client/preview/render.d.ts +0 -7
  285. package/dist/types/client/preview/types-6-0.d.ts +0 -42
  286. package/dist/types/client/preview/types-7-0.d.ts +0 -9
  287. package/dist/types/client/preview/types-7-0.js +0 -2
  288. package/dist/types/client/preview/types.d.ts +0 -29
  289. package/dist/types/index.d.ts +0 -2
  290. package/dist/types/preset.d.ts +0 -13
  291. package/dist/types/renderer.d.ts +0 -4
  292. package/dist/types/server/__mocks-ng-workspace__/with-nx/tsconfig.json +0 -19
  293. package/dist/types/server/__mocks-ng-workspace__/with-nx-workspace/tsconfig.json +0 -19
  294. package/dist/types/server/__mocks-ng-workspace__/with-options-styles/tsconfig.json +0 -16
  295. package/dist/types/server/__mocks-ng-workspace__/without-projects-entry/tsconfig.json +0 -16
  296. package/dist/types/server/__mocks-ng-workspace__/without-tsConfig/tsconfig.json +0 -16
  297. package/dist/types/server/angular-cli-webpack-12.2.x.d.ts +0 -1
  298. package/dist/types/server/angular-cli-webpack-12.2.x.js +0 -66
  299. package/dist/types/server/angular-cli-webpack-older.d.ts +0 -6
  300. package/dist/types/server/angular-cli-webpack-older.js +0 -111
  301. package/dist/types/server/angular-devkit-build-webpack.d.ts +0 -30
  302. package/dist/types/server/angular-devkit-build-webpack.js +0 -164
  303. package/dist/types/server/create-fork-ts-checker-plugin.d.ts +0 -3
  304. package/dist/types/server/create-fork-ts-checker-plugin.js +0 -19
  305. package/dist/types/server/framework-preset-angular.d.ts +0 -5
  306. package/dist/types/server/framework-preset-angular.js +0 -103
  307. package/dist/types/server/ngx-template-loader/index.d.ts +0 -1
  308. package/dist/types/server/ngx-template-loader/index.js +0 -46
  309. package/dist/types/server/ts_config.d.ts +0 -2
  310. package/dist/types/server/ts_config.js +0 -28
  311. package/dist/types/types.d.ts +0 -13
  312. package/types-6-0.d.ts +0 -1
  313. package/types-7-0.d.ts +0 -1
@@ -0,0 +1,207 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.InputComponent = exports.ButtonAccent = exports.exportedConstant = void 0;
13
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
14
+ // @ts-nocheck
15
+ /* eslint-disable no-console */
16
+ /* eslint-disable no-underscore-dangle */
17
+ const core_1 = require("@angular/core");
18
+ exports.exportedConstant = 'An exported constant';
19
+ var ButtonAccent;
20
+ (function (ButtonAccent) {
21
+ ButtonAccent["Normal"] = "Normal";
22
+ ButtonAccent["High"] = "High";
23
+ })(ButtonAccent = exports.ButtonAccent || (exports.ButtonAccent = {}));
24
+ /**
25
+ * This is a simple button that demonstrates various JSDoc handling in Storybook Docs for Angular.
26
+ *
27
+ * It supports [markdown](https://en.wikipedia.org/wiki/Markdown), so you can embed formatted text,
28
+ * like **bold**, _italic_, and `inline code`.
29
+ *
30
+ * > How you like dem apples?! It's never been easier to document all your components.
31
+ *
32
+ * @string Hello world
33
+ * @link [Example](http://example.com)
34
+ * @code `ThingThing`
35
+ * @html <span class="badge">aaa</span>
36
+ */
37
+ let InputComponent = class InputComponent {
38
+ constructor() {
39
+ /** Appearance style of the button. */
40
+ this.appearance = 'secondary';
41
+ /** Sets the button to a disabled state. */
42
+ this.isDisabled = false;
43
+ /** Size of the button. */
44
+ this.size = 'medium';
45
+ /**
46
+ * Some input you shouldn't use.
47
+ *
48
+ * @deprecated
49
+ */
50
+ this.somethingYouShouldNotUse = false;
51
+ /**
52
+ * Handler to be called when the button is clicked by a user.
53
+ *
54
+ * Will also block the emission of the event if `isDisabled` is true.
55
+ */
56
+ this.onClick = new core_1.EventEmitter();
57
+ this._inputValue = 'some value';
58
+ this.focus = false;
59
+ /**
60
+ * @ignore
61
+ */
62
+ this.ignoredProperty = 'Ignore me';
63
+ /** Public value. */
64
+ this.internalProperty = 'Public hello';
65
+ /** Private value. */
66
+ this._value = 'Private hello';
67
+ }
68
+ /**
69
+ * This is an internal method that we don't want to document and have added the `ignore` annotation to.
70
+ *
71
+ * @ignore
72
+ */
73
+ handleClick(event) {
74
+ event.stopPropagation();
75
+ if (!this.isDisabled) {
76
+ this.onClick.emit(event);
77
+ }
78
+ }
79
+ /** Setter for `inputValue` that is also an `@Input`. */
80
+ set inputValue(value) {
81
+ this._inputValue = value;
82
+ }
83
+ /** Getter for `inputValue`. */
84
+ get inputValue() {
85
+ return this._inputValue;
86
+ }
87
+ onClickListener(btn) {
88
+ console.log('button', btn);
89
+ }
90
+ /**
91
+ * Returns all the CSS classes for the button.
92
+ *
93
+ * @ignore
94
+ */
95
+ get classes() {
96
+ return [this.appearance, this.size]
97
+ .filter((_class) => !!_class)
98
+ .map((_class) => `btn-${_class}`);
99
+ }
100
+ /** Set the private value. */
101
+ set value(value) {
102
+ this._value = `${value}`;
103
+ }
104
+ /** Get the private value. */
105
+ get value() {
106
+ return this._value;
107
+ }
108
+ /**
109
+ * An internal calculation method which adds `x` and `y` together.
110
+ *
111
+ * @param x Some number you'd like to use.
112
+ * @param y Some other number or string you'd like to use, will have `parseInt()` applied before calculation.
113
+ */
114
+ calc(x, y) {
115
+ return x + parseInt(`${y}`, 10);
116
+ }
117
+ /** A public method using an interface. */
118
+ publicMethod(things) {
119
+ console.log(things);
120
+ }
121
+ /**
122
+ * A protected method.
123
+ *
124
+ * @param id Some `id`.
125
+ */
126
+ protectedMethod(id) {
127
+ console.log(id);
128
+ }
129
+ /**
130
+ * A private method.
131
+ *
132
+ * @param password Some `password`.
133
+ */
134
+ privateMethod(password) {
135
+ console.log(password);
136
+ }
137
+ set item(item) {
138
+ this.processedItem = item;
139
+ }
140
+ };
141
+ __decorate([
142
+ (0, core_1.ViewChild)('buttonRef', { static: false }),
143
+ __metadata("design:type", core_1.ElementRef)
144
+ ], InputComponent.prototype, "buttonRef", void 0);
145
+ __decorate([
146
+ (0, core_1.Input)(),
147
+ __metadata("design:type", String)
148
+ ], InputComponent.prototype, "appearance", void 0);
149
+ __decorate([
150
+ (0, core_1.Input)(),
151
+ __metadata("design:type", String)
152
+ ], InputComponent.prototype, "accent", void 0);
153
+ __decorate([
154
+ (0, core_1.Input)(),
155
+ __metadata("design:type", Object)
156
+ ], InputComponent.prototype, "isDisabled", void 0);
157
+ __decorate([
158
+ (0, core_1.Input)(),
159
+ __metadata("design:type", String)
160
+ ], InputComponent.prototype, "label", void 0);
161
+ __decorate([
162
+ (0, core_1.Input)(),
163
+ __metadata("design:type", String)
164
+ ], InputComponent.prototype, "size", void 0);
165
+ __decorate([
166
+ (0, core_1.Input)(),
167
+ __metadata("design:type", Object)
168
+ ], InputComponent.prototype, "someDataObject", void 0);
169
+ __decorate([
170
+ (0, core_1.Input)(),
171
+ __metadata("design:type", Object)
172
+ ], InputComponent.prototype, "somethingYouShouldNotUse", void 0);
173
+ __decorate([
174
+ (0, core_1.Output)(),
175
+ __metadata("design:type", Object)
176
+ ], InputComponent.prototype, "onClick", void 0);
177
+ __decorate([
178
+ (0, core_1.Input)(),
179
+ __metadata("design:type", String),
180
+ __metadata("design:paramtypes", [String])
181
+ ], InputComponent.prototype, "inputValue", null);
182
+ __decorate([
183
+ (0, core_1.HostListener)('click', ['$event.target']),
184
+ __metadata("design:type", Function),
185
+ __metadata("design:paramtypes", [Object]),
186
+ __metadata("design:returntype", void 0)
187
+ ], InputComponent.prototype, "onClickListener", null);
188
+ __decorate([
189
+ (0, core_1.HostBinding)('class.focused'),
190
+ __metadata("design:type", Object)
191
+ ], InputComponent.prototype, "focus", void 0);
192
+ __decorate([
193
+ (0, core_1.Input)('showKeyAlias'),
194
+ __metadata("design:type", Object)
195
+ ], InputComponent.prototype, "showKey", void 0);
196
+ __decorate([
197
+ (0, core_1.Input)(),
198
+ __metadata("design:type", Array),
199
+ __metadata("design:paramtypes", [Array])
200
+ ], InputComponent.prototype, "item", null);
201
+ InputComponent = __decorate([
202
+ (0, core_1.Component)({
203
+ selector: 'doc-button',
204
+ template: '<button>{{ label }}</button>',
205
+ })
206
+ ], InputComponent);
207
+ exports.InputComponent = InputComponent;
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "../../../tsconfig.json",
3
+ "compilerOptions": {
4
+ "rootDir": "."
5
+ },
6
+ "include": ["./*.ts"]
7
+ }
@@ -0,0 +1 @@
1
+ import 'jest-specific-snapshot';
@@ -0,0 +1,56 @@
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
+ require("jest-specific-snapshot");
7
+ const path_1 = __importDefault(require("path"));
8
+ const fs_1 = __importDefault(require("fs"));
9
+ const tmp_1 = __importDefault(require("tmp"));
10
+ const cross_spawn_1 = require("cross-spawn");
11
+ const compodoc_1 = require("./compodoc");
12
+ // @ts-expect-error (Converted from ts-ignore)
13
+ const { SNAPSHOT_OS } = global;
14
+ // File hierarchy: __testfixtures__ / some-test-case / input.*
15
+ const inputRegExp = /^input\..*$/;
16
+ const runCompodoc = (inputPath) => {
17
+ const testDir = path_1.default.dirname(inputPath);
18
+ const { name: tmpDir, removeCallback } = tmp_1.default.dirSync();
19
+ // FIXME: for now, this requires a tsconfig.json for each test case. Tried generating
20
+ // one dynamically in tmpDir, but compodoc doesn't handle absolute paths properly
21
+ // (and screwed around with relative paths as well, but couldn't get it working)
22
+ (0, cross_spawn_1.sync)('yarn', ['compodoc', '-p', `${testDir}/tsconfig.json`, '-e', 'json', '-d', tmpDir], {
23
+ stdio: 'inherit',
24
+ shell: true,
25
+ });
26
+ const output = fs_1.default.readFileSync(`${tmpDir}/documentation.json`, 'utf8');
27
+ try {
28
+ removeCallback();
29
+ }
30
+ catch (e) {
31
+ //
32
+ }
33
+ return output;
34
+ };
35
+ describe('angular component properties', () => {
36
+ const fixturesDir = path_1.default.join(__dirname, '__testfixtures__');
37
+ fs_1.default.readdirSync(fixturesDir, { withFileTypes: true }).forEach((testEntry) => {
38
+ if (testEntry.isDirectory()) {
39
+ const testDir = path_1.default.join(fixturesDir, testEntry.name);
40
+ const testFile = fs_1.default.readdirSync(testDir).find((fileName) => inputRegExp.test(fileName));
41
+ if (testFile) {
42
+ it(`${testEntry.name}`, () => {
43
+ const inputPath = path_1.default.join(testDir, testFile);
44
+ // snapshot the output of compodoc
45
+ const compodocOutput = runCompodoc(inputPath);
46
+ const compodocJson = JSON.parse(compodocOutput);
47
+ expect(compodocJson).toMatchSpecificSnapshot(path_1.default.join(testDir, `compodoc-${SNAPSHOT_OS}.snapshot`));
48
+ // snapshot the output of addon-docs angular-properties
49
+ const componentData = (0, compodoc_1.findComponentByName)('InputComponent', compodocJson);
50
+ const argTypes = (0, compodoc_1.extractArgTypesFromData)(componentData);
51
+ expect(argTypes).toMatchSpecificSnapshot(path_1.default.join(testDir, 'argtypes.snapshot'));
52
+ });
53
+ }
54
+ }
55
+ });
56
+ });
@@ -1,5 +1,5 @@
1
- import type { ArgTypes } from '@storybook/api';
2
- import type { Class, CompodocJson, Component, Injectable, Method, Pipe, Property, Directive } from './types';
1
+ import { API_ArgTypes } from '@storybook/types';
2
+ import { Class, CompodocJson, Component, Injectable, Method, Pipe, Property, Directive } from './types';
3
3
  export declare const isMethod: (methodOrProp: Method | Property) => methodOrProp is Method;
4
4
  export declare const setCompodocJson: (compodocJson: CompodocJson) => void;
5
5
  export declare const getCompodocJson: () => CompodocJson;
@@ -13,6 +13,6 @@ export declare const extractType: (property: Property, defaultValue: any) => {
13
13
  name: string;
14
14
  value: any[];
15
15
  };
16
- export declare const extractArgTypesFromData: (componentData: Class | Directive | Injectable | Pipe) => ArgTypes;
17
- export declare const extractArgTypes: (component: Component | Directive) => ArgTypes;
16
+ export declare const extractArgTypesFromData: (componentData: Class | Directive | Injectable | Pipe) => API_ArgTypes;
17
+ export declare const extractArgTypes: (component: Component | Directive) => API_ArgTypes;
18
18
  export declare const extractComponentDescription: (component: Component | Directive) => string;
@@ -9,11 +9,11 @@ const isMethod = (methodOrProp) => {
9
9
  };
10
10
  exports.isMethod = isMethod;
11
11
  const setCompodocJson = (compodocJson) => {
12
- // @ts-ignore
12
+ // @ts-expect-error (Converted from ts-ignore)
13
13
  window.__STORYBOOK_COMPODOC_JSON__ = compodocJson;
14
14
  };
15
15
  exports.setCompodocJson = setCompodocJson;
16
- // @ts-ignore
16
+ // @ts-expect-error (Converted from ts-ignore)
17
17
  const getCompodocJson = () => window.__STORYBOOK_COMPODOC_JSON__;
18
18
  exports.getCompodocJson = getCompodocJson;
19
19
  const checkValidComponentOrDirective = (component) => {
@@ -165,7 +165,6 @@ const extractDefaultValueFromComments = (property, value) => {
165
165
  let commentValue = value;
166
166
  property.jsdoctags.forEach((tag) => {
167
167
  if (['default', 'defaultvalue'].includes(tag.tagName.escapedText)) {
168
- // @ts-ignore
169
168
  const dom = new window.DOMParser().parseFromString(tag.comment, 'text/html');
170
169
  commentValue = dom.body.textContent;
171
170
  }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,131 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const compodoc_1 = require("./compodoc");
4
+ const makeProperty = (compodocType) => ({
5
+ type: compodocType,
6
+ name: 'dummy',
7
+ decorators: [],
8
+ optional: true,
9
+ });
10
+ const getDummyCompodocJson = () => {
11
+ return {
12
+ miscellaneous: {
13
+ typealiases: [
14
+ {
15
+ name: 'EnumAlias',
16
+ ctype: 'miscellaneous',
17
+ subtype: 'typealias',
18
+ rawtype: 'EnumNumeric',
19
+ file: 'src/stories/component-with-enums/enums.component.ts',
20
+ description: '',
21
+ kind: 161,
22
+ },
23
+ {
24
+ name: 'TypeAlias',
25
+ ctype: 'miscellaneous',
26
+ subtype: 'typealias',
27
+ rawtype: '"Type Alias 1" | "Type Alias 2" | "Type Alias 3"',
28
+ file: 'src/stories/component-with-enums/enums.component.ts',
29
+ description: '',
30
+ kind: 168,
31
+ },
32
+ ],
33
+ enumerations: [
34
+ {
35
+ name: 'EnumNumeric',
36
+ childs: [
37
+ {
38
+ name: 'FIRST',
39
+ },
40
+ {
41
+ name: 'SECOND',
42
+ },
43
+ {
44
+ name: 'THIRD',
45
+ },
46
+ ],
47
+ ctype: 'miscellaneous',
48
+ subtype: 'enum',
49
+ description: '<p>Button Priority</p>\n',
50
+ file: 'src/stories/component-with-enums/enums.component.ts',
51
+ },
52
+ {
53
+ name: 'EnumNumericInitial',
54
+ childs: [
55
+ {
56
+ name: 'UNO',
57
+ value: '1',
58
+ },
59
+ {
60
+ name: 'DOS',
61
+ },
62
+ {
63
+ name: 'TRES',
64
+ },
65
+ ],
66
+ ctype: 'miscellaneous',
67
+ subtype: 'enum',
68
+ description: '',
69
+ file: 'src/stories/component-with-enums/enums.component.ts',
70
+ },
71
+ {
72
+ name: 'EnumStringValues',
73
+ childs: [
74
+ {
75
+ name: 'PRIMARY',
76
+ value: 'PRIMARY',
77
+ },
78
+ {
79
+ name: 'SECONDARY',
80
+ value: 'SECONDARY',
81
+ },
82
+ {
83
+ name: 'TERTIARY',
84
+ value: 'TERTIARY',
85
+ },
86
+ ],
87
+ ctype: 'miscellaneous',
88
+ subtype: 'enum',
89
+ description: '',
90
+ file: 'src/stories/component-with-enums/enums.component.ts',
91
+ },
92
+ ],
93
+ },
94
+ };
95
+ };
96
+ describe('extractType', () => {
97
+ describe('with compodoc type', () => {
98
+ (0, compodoc_1.setCompodocJson)(getDummyCompodocJson());
99
+ it.each([
100
+ ['string', { name: 'string' }],
101
+ ['boolean', { name: 'boolean' }],
102
+ ['number', { name: 'number' }],
103
+ ['object', { name: 'object' }],
104
+ ['foo', { name: 'object' }],
105
+ [null, { name: 'void' }],
106
+ [undefined, { name: 'void' }],
107
+ ['T[]', { name: 'object' }],
108
+ ['[]', { name: 'object' }],
109
+ ['"primary" | "secondary"', { name: 'enum', value: ['primary', 'secondary'] }],
110
+ ['TypeAlias', { name: 'enum', value: ['Type Alias 1', 'Type Alias 2', 'Type Alias 3'] }],
111
+ ['EnumNumeric', { name: 'object' }],
112
+ ['EnumNumericInitial', { name: 'object' }],
113
+ ['EnumStringValues', { name: 'enum', value: ['PRIMARY', 'SECONDARY', 'TERTIARY'] }],
114
+ ])('%s', (compodocType, expected) => {
115
+ expect((0, compodoc_1.extractType)(makeProperty(compodocType), null)).toEqual(expected);
116
+ });
117
+ });
118
+ describe('without compodoc type', () => {
119
+ it.each([
120
+ ['string', { name: 'string' }],
121
+ ['', { name: 'string' }],
122
+ [false, { name: 'boolean' }],
123
+ [10, { name: 'number' }],
124
+ [['abc'], { name: 'object' }],
125
+ [{ foo: 1 }, { name: 'object' }],
126
+ [undefined, { name: 'void' }],
127
+ ])('%s', (defaultValue, expected) => {
128
+ expect((0, compodoc_1.extractType)(makeProperty(null), defaultValue)).toEqual(expected);
129
+ });
130
+ });
131
+ });
@@ -0,0 +1,4 @@
1
+ import { Parameters, DecoratorFunction, ArgTypesEnhancer } from '@storybook/types';
2
+ export declare const parameters: Parameters;
3
+ export declare const decorators: DecoratorFunction[];
4
+ export declare const argTypesEnhancers: ArgTypesEnhancer[];
File without changes
File without changes
File without changes
@@ -1,9 +1,9 @@
1
- import type { PartialStoryFn } from '@storybook/csf';
2
- import { StoryContext, AngularFramework } from '..';
1
+ import { PartialStoryFn } from '@storybook/types';
2
+ import { StoryContext, AngularRenderer } from '../types';
3
3
  export declare const skipSourceRender: (context: StoryContext) => any;
4
4
  /**
5
5
  * Angular source decorator.
6
6
  * @param storyFn Fn
7
7
  * @param context StoryContext
8
8
  */
9
- export declare const sourceDecorator: (storyFn: PartialStoryFn<AngularFramework>, context: StoryContext) => import("..").IStory;
9
+ export declare const sourceDecorator: (storyFn: PartialStoryFn<AngularRenderer>, context: StoryContext) => import("../types").StoryFnAngularReturnType;
File without changes
File without changes
@@ -29,13 +29,3 @@ import 'core-js/proposals/reflect-metadata';
29
29
  * Zone JS is required by Angular itself.
30
30
  */
31
31
  import 'zone.js/dist/zone';
32
- /** *************************************************************************************************
33
- * APPLICATION IMPORTS
34
- */
35
- /**
36
- * Date, currency, decimal and percent pipes.
37
- * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10
38
- */
39
- /**
40
- * Need to import at least one locale-data with intl.
41
- */
@@ -1,4 +1,9 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const global_1 = __importDefault(require("global"));
2
7
  /**
3
8
  * This file includes polyfills needed by Angular and is loaded before the app.
4
9
  * You can add your own extra polyfills to this file.
@@ -14,7 +19,6 @@
14
19
  *
15
20
  * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html
16
21
  */
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
22
  /** *************************************************************************************************
19
23
  * BROWSER POLYFILLS
20
24
  */
@@ -59,3 +63,5 @@ require("zone.js/dist/zone"); // Included with Angular CLI.
59
63
  * Need to import at least one locale-data with intl.
60
64
  */
61
65
  // import 'intl/locale-data/jsonp/en';
66
+ const { window: globalWindow } = global_1.default;
67
+ globalWindow.STORYBOOK_ENV = 'angular';
@@ -0,0 +1,5 @@
1
+ import './globals';
2
+ export * from './public-api';
3
+ export * from './public-types';
4
+ export type { StoryFnAngularReturnType as IStory } from './types';
5
+ export { moduleMetadata, componentWrapperDecorator } from './decorators';
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ /// <reference types="webpack-env" />
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.componentWrapperDecorator = exports.moduleMetadata = void 0;
19
+ require("./globals");
20
+ // eslint-disable-next-line import/export
21
+ __exportStar(require("./public-api"), exports);
22
+ // eslint-disable-next-line import/export
23
+ __exportStar(require("./public-types"), exports);
24
+ var decorators_1 = require("./decorators");
25
+ Object.defineProperty(exports, "moduleMetadata", { enumerable: true, get: function () { return decorators_1.moduleMetadata; } });
26
+ Object.defineProperty(exports, "componentWrapperDecorator", { enumerable: true, get: function () { return decorators_1.componentWrapperDecorator; } });
27
+ // optimization: stop HMR propagation in webpack
28
+ module?.hot?.decline();
@@ -0,0 +1,15 @@
1
+ /// <reference types="webpack-env" />
2
+ /// <reference types="node" />
3
+ import { Addon_ClientStoryApi, Addon_Loadable } from '@storybook/types';
4
+ import { AngularRenderer } from './types';
5
+ export * from './public-types';
6
+ interface ClientApi extends Addon_ClientStoryApi<AngularRenderer['storyResult']> {
7
+ configure(loader: Addon_Loadable, module: NodeModule): void;
8
+ forceReRender(): void;
9
+ raw: () => any;
10
+ load: (...args: any[]) => void;
11
+ }
12
+ export declare const storiesOf: ClientApi['storiesOf'];
13
+ export declare const configure: ClientApi['configure'];
14
+ export declare const forceReRender: ClientApi['forceReRender'];
15
+ export declare const raw: ClientApi['raw'];
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ var __importDefault = (this && this.__importDefault) || function (mod) {
17
+ return (mod && mod.__esModule) ? mod : { "default": mod };
18
+ };
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.raw = exports.forceReRender = exports.configure = exports.storiesOf = void 0;
21
+ const core_client_1 = require("@storybook/core-client");
22
+ const render_1 = require("./render");
23
+ const decorateStory_1 = __importDefault(require("./decorateStory"));
24
+ __exportStar(require("./public-types"), exports);
25
+ const FRAMEWORK = 'angular';
26
+ const api = (0, core_client_1.start)(render_1.renderToCanvas, { decorateStory: decorateStory_1.default, render: render_1.render });
27
+ const storiesOf = (kind, m) => {
28
+ return api.clientApi.storiesOf(kind, m).addParameters({
29
+ framework: FRAMEWORK,
30
+ });
31
+ };
32
+ exports.storiesOf = storiesOf;
33
+ const configure = (...args) => api.configure(FRAMEWORK, ...args);
34
+ exports.configure = configure;
35
+ exports.forceReRender = api.forceReRender;
36
+ exports.raw = api.clientApi.raw;
@@ -0,0 +1,36 @@
1
+ import { AnnotatedStoryFn, Args, ComponentAnnotations, DecoratorFunction, LoaderFunction, StoryAnnotations, StoryContext as GenericStoryContext, StrictArgs } from '@storybook/types';
2
+ import { AngularRenderer } from './types';
3
+ export type { Args, ArgTypes, Parameters, StrictArgs } from '@storybook/types';
4
+ export type { Parameters as AngularParameters } from './types';
5
+ export type { AngularRenderer };
6
+ /**
7
+ * Metadata to configure the stories for a component.
8
+ *
9
+ * @see [Default export](https://storybook.js.org/docs/formats/component-story-format/#default-export)
10
+ */
11
+ export declare type Meta<TArgs = Args> = ComponentAnnotations<AngularRenderer, TArgs>;
12
+ /**
13
+ * Story function that represents a CSFv2 component example.
14
+ *
15
+ * @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
16
+ */
17
+ export declare type StoryFn<TArgs = Args> = AnnotatedStoryFn<AngularRenderer, TArgs>;
18
+ /**
19
+ * Story function that represents a CSFv3 component example.
20
+ *
21
+ * @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
22
+ */
23
+ export declare type StoryObj<TArgs = Args> = StoryAnnotations<AngularRenderer, TArgs>;
24
+ /**
25
+ * @deprecated Use `StoryFn` instead.
26
+ * Use `StoryObj` if you want to migrate to CSF3, which uses objects instead of functions to represent stories.
27
+ * You can read more about the CSF3 format here: https://storybook.js.org/blog/component-story-format-3-0/
28
+ *
29
+ * Story function that represents a CSFv2 component example.
30
+ *
31
+ * @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
32
+ */
33
+ export declare type Story<TArgs = Args> = StoryFn<TArgs>;
34
+ export declare type Decorator<TArgs = StrictArgs> = DecoratorFunction<AngularRenderer, TArgs>;
35
+ export declare type Loader<TArgs = StrictArgs> = LoaderFunction<AngularRenderer, TArgs>;
36
+ export declare type StoryContext<TArgs = StrictArgs> = GenericStoryContext<AngularRenderer, TArgs>;
@@ -0,0 +1,6 @@
1
+ import { Store_RenderContext, ArgsStoryFn } from '@storybook/types';
2
+ import { AngularRenderer } from './types';
3
+ import { RendererFactory } from './angular-beta/RendererFactory';
4
+ export declare const rendererFactory: RendererFactory;
5
+ export declare const render: ArgsStoryFn<AngularRenderer>;
6
+ export declare function renderToCanvas({ storyFn, showMain, forceRemount, storyContext: { parameters, component }, id, }: Store_RenderContext<AngularRenderer>, element: HTMLElement): Promise<void>;