@ng-prism/core 22.5.0 → 22.7.0-beta.0

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 (437) hide show
  1. package/README.md +13 -9
  2. package/dist/app/canvas/canvas-bg.styles.d.ts +1 -1
  3. package/dist/app/canvas/canvas-bg.styles.d.ts.map +1 -1
  4. package/dist/app/canvas/canvas-bg.styles.js +1 -1
  5. package/dist/app/canvas/canvas-overlay-tokens.d.ts +12 -0
  6. package/dist/app/canvas/canvas-overlay-tokens.d.ts.map +1 -0
  7. package/dist/app/canvas/canvas-overlay-tokens.js +52 -0
  8. package/dist/app/canvas/prism-canvas-bg-pill.component.js +2 -2
  9. package/dist/app/canvas/prism-canvas-pin-row.component.js +2 -2
  10. package/dist/app/canvas/prism-canvas-rulers.component.d.ts +2 -0
  11. package/dist/app/canvas/prism-canvas-rulers.component.d.ts.map +1 -1
  12. package/dist/app/canvas/prism-canvas-rulers.component.js +17 -12
  13. package/dist/app/canvas/prism-canvas-toolbar.component.d.ts +25 -3
  14. package/dist/app/canvas/prism-canvas-toolbar.component.d.ts.map +1 -1
  15. package/dist/app/canvas/prism-canvas-toolbar.component.js +154 -89
  16. package/dist/app/canvas/prism-template-popover.component.d.ts.map +1 -1
  17. package/dist/app/canvas/prism-template-popover.component.js +16 -7
  18. package/dist/app/canvas/state-chips.d.ts +50 -0
  19. package/dist/app/canvas/state-chips.d.ts.map +1 -0
  20. package/dist/app/canvas/state-chips.js +40 -0
  21. package/dist/app/component-head/head-metrics.d.ts +35 -19
  22. package/dist/app/component-head/head-metrics.d.ts.map +1 -1
  23. package/dist/app/component-head/head-metrics.js +57 -27
  24. package/dist/app/component-head/pipe-facts.d.ts +9 -0
  25. package/dist/app/component-head/pipe-facts.d.ts.map +1 -0
  26. package/dist/app/component-head/pipe-facts.js +15 -0
  27. package/dist/app/component-head/prism-component-head.component.d.ts +20 -22
  28. package/dist/app/component-head/prism-component-head.component.d.ts.map +1 -1
  29. package/dist/app/component-head/prism-component-head.component.js +85 -96
  30. package/dist/app/component-head/prism-head-gauge.component.d.ts +8 -12
  31. package/dist/app/component-head/prism-head-gauge.component.d.ts.map +1 -1
  32. package/dist/app/component-head/prism-head-gauge.component.js +51 -67
  33. package/dist/app/component-head/prism-head-info.component.d.ts +14 -2
  34. package/dist/app/component-head/prism-head-info.component.d.ts.map +1 -1
  35. package/dist/app/component-head/prism-head-info.component.js +84 -20
  36. package/dist/app/component-head/prism-stat.component.d.ts +4 -5
  37. package/dist/app/component-head/prism-stat.component.d.ts.map +1 -1
  38. package/dist/app/component-head/prism-stat.component.js +16 -12
  39. package/dist/app/component-head/service-facts.d.ts +8 -0
  40. package/dist/app/component-head/service-facts.d.ts.map +1 -0
  41. package/dist/app/component-head/service-facts.js +11 -0
  42. package/dist/app/controls/boolean-control.component.js +2 -2
  43. package/dist/app/controls/json-control.component.js +2 -2
  44. package/dist/app/controls/union-control.component.js +4 -3
  45. package/dist/app/directives/resize-value.d.ts +1 -1
  46. package/dist/app/directives/resize-value.js +1 -1
  47. package/dist/app/discovery-manifest.d.ts +2 -2
  48. package/dist/app/discovery-manifest.d.ts.map +1 -1
  49. package/dist/app/discovery-manifest.js +15 -3
  50. package/dist/app/header/header-brand.d.ts +25 -0
  51. package/dist/app/header/header-brand.d.ts.map +1 -0
  52. package/dist/app/header/header-brand.js +10 -0
  53. package/dist/app/header/prism-header.component.d.ts +2 -2
  54. package/dist/app/header/prism-header.component.d.ts.map +1 -1
  55. package/dist/app/header/prism-header.component.js +73 -57
  56. package/dist/app/icons/icon-registry.d.ts.map +1 -1
  57. package/dist/app/icons/icon-registry.js +4 -1
  58. package/dist/app/index.d.ts +12 -0
  59. package/dist/app/index.d.ts.map +1 -1
  60. package/dist/app/index.js +12 -1
  61. package/dist/app/layout-menu/prism-layout-menu.component.d.ts +3 -0
  62. package/dist/app/layout-menu/prism-layout-menu.component.d.ts.map +1 -1
  63. package/dist/app/layout-menu/prism-layout-menu.component.js +72 -58
  64. package/dist/app/overview/open-in-playground.d.ts +19 -0
  65. package/dist/app/overview/open-in-playground.d.ts.map +1 -0
  66. package/dist/app/overview/open-in-playground.js +25 -0
  67. package/dist/app/overview/overview-matrix.d.ts +85 -0
  68. package/dist/app/overview/overview-matrix.d.ts.map +1 -0
  69. package/dist/app/overview/overview-matrix.js +98 -0
  70. package/dist/app/overview/overview-visibility.d.ts +10 -2
  71. package/dist/app/overview/overview-visibility.d.ts.map +1 -1
  72. package/dist/app/overview/overview-visibility.js +14 -3
  73. package/dist/app/overview/prism-overview-cell.component.d.ts +27 -2
  74. package/dist/app/overview/prism-overview-cell.component.d.ts.map +1 -1
  75. package/dist/app/overview/prism-overview-cell.component.js +145 -28
  76. package/dist/app/overview/prism-overview-matrix.component.d.ts +29 -0
  77. package/dist/app/overview/prism-overview-matrix.component.d.ts.map +1 -0
  78. package/dist/app/overview/prism-overview-matrix.component.js +155 -0
  79. package/dist/app/overview/prism-overview.component.d.ts +4 -0
  80. package/dist/app/overview/prism-overview.component.d.ts.map +1 -1
  81. package/dist/app/overview/prism-overview.component.js +37 -14
  82. package/dist/app/page-renderer/prism-page-renderer.component.js +2 -2
  83. package/dist/app/panels/a11y/a11y-core.plugin.d.ts.map +1 -1
  84. package/dist/app/panels/a11y/a11y-core.plugin.js +0 -1
  85. package/dist/app/panels/a11y/a11y-header-badge.component.d.ts +1 -4
  86. package/dist/app/panels/a11y/a11y-header-badge.component.d.ts.map +1 -1
  87. package/dist/app/panels/a11y/a11y-header-badge.component.js +8 -19
  88. package/dist/app/panels/a11y/a11y-keyboard-overlay.component.js +2 -2
  89. package/dist/app/panels/a11y/a11y-overlay-host.component.d.ts +1 -0
  90. package/dist/app/panels/a11y/a11y-overlay-host.component.d.ts.map +1 -1
  91. package/dist/app/panels/a11y/a11y-overlay-host.component.js +4 -3
  92. package/dist/app/panels/a11y/a11y-panel.component.d.ts +4 -1
  93. package/dist/app/panels/a11y/a11y-panel.component.d.ts.map +1 -1
  94. package/dist/app/panels/a11y/a11y-panel.component.js +32 -54
  95. package/dist/app/panels/a11y/a11y-score.component.d.ts +8 -3
  96. package/dist/app/panels/a11y/a11y-score.component.d.ts.map +1 -1
  97. package/dist/app/panels/a11y/a11y-score.component.js +19 -35
  98. package/dist/app/panels/a11y/a11y-sr-overlay.component.js +2 -2
  99. package/dist/app/panels/a11y/a11y-sr.component.js +2 -2
  100. package/dist/app/panels/a11y/a11y-summary.d.ts.map +1 -1
  101. package/dist/app/panels/a11y/a11y-summary.js +8 -1
  102. package/dist/app/panels/a11y/a11y-tree.component.js +2 -2
  103. package/dist/app/panels/a11y/a11y-violations.component.d.ts +23 -2
  104. package/dist/app/panels/a11y/a11y-violations.component.d.ts.map +1 -1
  105. package/dist/app/panels/a11y/a11y-violations.component.js +104 -89
  106. package/dist/app/panels/a11y/severity.d.ts +9 -0
  107. package/dist/app/panels/a11y/severity.d.ts.map +1 -0
  108. package/dist/app/panels/a11y/severity.js +12 -0
  109. package/dist/app/panels/controls/controls-plugin.d.ts.map +1 -1
  110. package/dist/app/panels/controls/controls-plugin.js +1 -2
  111. package/dist/app/panels/controls/non-editable-input-types.d.ts +9 -1
  112. package/dist/app/panels/controls/non-editable-input-types.d.ts.map +1 -1
  113. package/dist/app/panels/controls/non-editable-input-types.js +18 -0
  114. package/dist/app/panels/controls/prism-controls-panel.component.d.ts +2 -1
  115. package/dist/app/panels/controls/prism-controls-panel.component.d.ts.map +1 -1
  116. package/dist/app/panels/controls/prism-controls-panel.component.js +77 -59
  117. package/dist/app/panels/events/events-plugin.d.ts.map +1 -1
  118. package/dist/app/panels/events/events-plugin.js +1 -2
  119. package/dist/app/panels/events/prism-events-panel.component.d.ts +2 -0
  120. package/dist/app/panels/events/prism-events-panel.component.d.ts.map +1 -1
  121. package/dist/app/panels/events/prism-events-panel.component.js +20 -7
  122. package/dist/app/panels/events/prism-json-node.utils.d.ts +6 -0
  123. package/dist/app/panels/events/prism-json-node.utils.d.ts.map +1 -1
  124. package/dist/app/panels/events/prism-json-node.utils.js +8 -0
  125. package/dist/app/panels/panel-host/addon-panels.d.ts +11 -0
  126. package/dist/app/panels/panel-host/addon-panels.d.ts.map +1 -0
  127. package/dist/app/panels/panel-host/addon-panels.js +12 -0
  128. package/dist/app/panels/panel-host/panel-badge.d.ts +22 -0
  129. package/dist/app/panels/panel-host/panel-badge.d.ts.map +1 -1
  130. package/dist/app/panels/panel-host/panel-badge.js +56 -11
  131. package/dist/app/panels/panel-host/prism-panel-host.component.d.ts +4 -1
  132. package/dist/app/panels/panel-host/prism-panel-host.component.d.ts.map +1 -1
  133. package/dist/app/panels/panel-host/prism-panel-host.component.js +36 -70
  134. package/dist/app/pseudo/pseudo-state-marker.d.ts +32 -10
  135. package/dist/app/pseudo/pseudo-state-marker.d.ts.map +1 -1
  136. package/dist/app/pseudo/pseudo-state-marker.js +83 -67
  137. package/dist/app/pseudo/pseudo-targets.d.ts +11 -0
  138. package/dist/app/pseudo/pseudo-targets.d.ts.map +1 -0
  139. package/dist/app/pseudo/pseudo-targets.js +46 -0
  140. package/dist/app/pseudo/state-fit.d.ts +28 -0
  141. package/dist/app/pseudo/state-fit.d.ts.map +1 -0
  142. package/dist/app/pseudo/state-fit.js +97 -0
  143. package/dist/app/renderer/composition.d.ts +20 -0
  144. package/dist/app/renderer/composition.d.ts.map +1 -0
  145. package/dist/app/renderer/composition.js +26 -0
  146. package/dist/app/renderer/input-bindings.d.ts +28 -0
  147. package/dist/app/renderer/input-bindings.d.ts.map +1 -0
  148. package/dist/app/renderer/input-bindings.js +42 -0
  149. package/dist/app/renderer/known-inputs.d.ts +8 -1
  150. package/dist/app/renderer/known-inputs.d.ts.map +1 -1
  151. package/dist/app/renderer/known-inputs.js +13 -5
  152. package/dist/app/renderer/prism-renderer.component.d.ts +18 -4
  153. package/dist/app/renderer/prism-renderer.component.d.ts.map +1 -1
  154. package/dist/app/renderer/prism-renderer.component.js +78 -44
  155. package/dist/app/renderer/projectable-content.d.ts +8 -1
  156. package/dist/app/renderer/projectable-content.d.ts.map +1 -1
  157. package/dist/app/renderer/projectable-content.js +40 -29
  158. package/dist/app/renderer/rendered-key.d.ts +20 -6
  159. package/dist/app/renderer/rendered-key.d.ts.map +1 -1
  160. package/dist/app/renderer/rendered-key.js +25 -8
  161. package/dist/app/renderer/snippet-generator.d.ts +14 -2
  162. package/dist/app/renderer/snippet-generator.d.ts.map +1 -1
  163. package/dist/app/renderer/snippet-generator.js +138 -81
  164. package/dist/app/services/navigation-item.d.ts +10 -0
  165. package/dist/app/services/navigation-item.d.ts.map +1 -0
  166. package/dist/app/services/navigation-item.js +20 -0
  167. package/dist/app/services/navigation-item.types.d.ts +8 -0
  168. package/dist/app/services/navigation-item.types.d.ts.map +1 -1
  169. package/dist/app/services/prism-layout.service.d.ts +12 -0
  170. package/dist/app/services/prism-layout.service.d.ts.map +1 -1
  171. package/dist/app/services/prism-layout.service.js +17 -7
  172. package/dist/app/services/prism-manifest.service.d.ts +4 -0
  173. package/dist/app/services/prism-manifest.service.d.ts.map +1 -1
  174. package/dist/app/services/prism-manifest.service.js +4 -0
  175. package/dist/app/services/prism-navigation.service.d.ts +12 -0
  176. package/dist/app/services/prism-navigation.service.d.ts.map +1 -1
  177. package/dist/app/services/prism-navigation.service.js +85 -19
  178. package/dist/app/services/prism-panel.service.d.ts +7 -3
  179. package/dist/app/services/prism-panel.service.d.ts.map +1 -1
  180. package/dist/app/services/prism-panel.service.js +13 -4
  181. package/dist/app/services/prism-pseudo-state.service.d.ts +59 -14
  182. package/dist/app/services/prism-pseudo-state.service.d.ts.map +1 -1
  183. package/dist/app/services/prism-pseudo-state.service.js +86 -29
  184. package/dist/app/services/prism-renderer.service.d.ts +23 -0
  185. package/dist/app/services/prism-renderer.service.d.ts.map +1 -1
  186. package/dist/app/services/prism-renderer.service.js +77 -8
  187. package/dist/app/services/prism-search.service.d.ts +4 -0
  188. package/dist/app/services/prism-search.service.d.ts.map +1 -1
  189. package/dist/app/services/prism-search.service.js +29 -6
  190. package/dist/app/services/prism-theme.service.d.ts +11 -3
  191. package/dist/app/services/prism-theme.service.d.ts.map +1 -1
  192. package/dist/app/services/prism-theme.service.js +27 -19
  193. package/dist/app/services/prism-url-state.service.d.ts.map +1 -1
  194. package/dist/app/services/prism-url-state.service.js +81 -12
  195. package/dist/app/shared/badge.types.d.ts +7 -0
  196. package/dist/app/shared/badge.types.d.ts.map +1 -0
  197. package/dist/app/shared/badge.types.js +9 -0
  198. package/dist/app/shared/brand-mark.d.ts +35 -0
  199. package/dist/app/shared/brand-mark.d.ts.map +1 -0
  200. package/dist/app/shared/brand-mark.js +52 -0
  201. package/dist/app/shared/metric-bar.d.ts +6 -0
  202. package/dist/app/shared/metric-bar.d.ts.map +1 -0
  203. package/dist/app/shared/metric-bar.js +7 -0
  204. package/dist/app/shared/prism-badge.component.d.ts +21 -0
  205. package/dist/app/shared/prism-badge.component.d.ts.map +1 -0
  206. package/dist/app/shared/prism-badge.component.js +68 -0
  207. package/dist/app/shared/prism-button.component.d.ts +12 -0
  208. package/dist/app/shared/prism-button.component.d.ts.map +1 -0
  209. package/dist/app/shared/prism-button.component.js +28 -0
  210. package/dist/app/shared/prism-icon-button.component.d.ts +17 -0
  211. package/dist/app/shared/prism-icon-button.component.d.ts.map +1 -0
  212. package/dist/app/shared/prism-icon-button.component.js +37 -0
  213. package/dist/app/shared/prism-list-row.component.d.ts +17 -0
  214. package/dist/app/shared/prism-list-row.component.d.ts.map +1 -0
  215. package/dist/app/shared/prism-list-row.component.js +57 -0
  216. package/dist/app/shared/prism-logo.component.d.ts +24 -0
  217. package/dist/app/shared/prism-logo.component.d.ts.map +1 -0
  218. package/dist/app/shared/prism-logo.component.js +77 -0
  219. package/dist/app/shared/prism-metric-badge.component.d.ts +9 -4
  220. package/dist/app/shared/prism-metric-badge.component.d.ts.map +1 -1
  221. package/dist/app/shared/prism-metric-badge.component.js +33 -12
  222. package/dist/app/shared/prism-metric-card.component.d.ts +30 -0
  223. package/dist/app/shared/prism-metric-card.component.d.ts.map +1 -0
  224. package/dist/app/shared/prism-metric-card.component.js +111 -0
  225. package/dist/app/shared/prism-panel-toolbar.component.d.ts +13 -0
  226. package/dist/app/shared/prism-panel-toolbar.component.d.ts.map +1 -0
  227. package/dist/app/shared/prism-panel-toolbar.component.js +28 -0
  228. package/dist/app/shared/prism-segmented.component.d.ts +25 -0
  229. package/dist/app/shared/prism-segmented.component.d.ts.map +1 -0
  230. package/dist/app/shared/prism-segmented.component.js +77 -0
  231. package/dist/app/shared/prism-tabs.component.d.ts +44 -0
  232. package/dist/app/shared/prism-tabs.component.d.ts.map +1 -0
  233. package/dist/app/shared/prism-tabs.component.js +134 -0
  234. package/dist/app/shared/roving-focus.d.ts +13 -0
  235. package/dist/app/shared/roving-focus.d.ts.map +1 -0
  236. package/dist/app/shared/roving-focus.js +34 -0
  237. package/dist/app/shell/prism-shell.component.d.ts +13 -0
  238. package/dist/app/shell/prism-shell.component.d.ts.map +1 -1
  239. package/dist/app/shell/prism-shell.component.js +57 -28
  240. package/dist/app/shell/should-select-first.d.ts +17 -0
  241. package/dist/app/shell/should-select-first.d.ts.map +1 -0
  242. package/dist/app/shell/should-select-first.js +13 -0
  243. package/dist/app/sidebar/navigation-decorations.d.ts +23 -1
  244. package/dist/app/sidebar/navigation-decorations.d.ts.map +1 -1
  245. package/dist/app/sidebar/navigation-decorations.js +33 -2
  246. package/dist/app/sidebar/prism-sidebar.component.d.ts +5 -15
  247. package/dist/app/sidebar/prism-sidebar.component.d.ts.map +1 -1
  248. package/dist/app/sidebar/prism-sidebar.component.js +89 -77
  249. package/dist/app/theme/deprecated-tokens.d.ts +15 -0
  250. package/dist/app/theme/deprecated-tokens.d.ts.map +1 -0
  251. package/dist/app/theme/deprecated-tokens.js +22 -0
  252. package/dist/app/theme/favicon.d.ts +3 -0
  253. package/dist/app/theme/favicon.d.ts.map +1 -0
  254. package/dist/app/theme/favicon.js +3 -0
  255. package/dist/app/theme/prism-default-theme.d.ts.map +1 -1
  256. package/dist/app/theme/prism-default-theme.js +122 -66
  257. package/dist/app/theme/resolve-theme-tokens.d.ts +29 -0
  258. package/dist/app/theme/resolve-theme-tokens.d.ts.map +1 -0
  259. package/dist/app/theme/resolve-theme-tokens.js +43 -0
  260. package/dist/app/variant-ribbon/prism-variant-ribbon.component.d.ts +4 -7
  261. package/dist/app/variant-ribbon/prism-variant-ribbon.component.d.ts.map +1 -1
  262. package/dist/app/variant-ribbon/prism-variant-ribbon.component.js +31 -69
  263. package/dist/app/view-tab-bar/next-view-id.d.ts +7 -1
  264. package/dist/app/view-tab-bar/next-view-id.d.ts.map +1 -1
  265. package/dist/app/view-tab-bar/next-view-id.js +9 -1
  266. package/dist/app/view-tab-bar/panel-inputs.d.ts +28 -0
  267. package/dist/app/view-tab-bar/panel-inputs.d.ts.map +1 -0
  268. package/dist/app/view-tab-bar/panel-inputs.js +41 -0
  269. package/dist/app/view-tab-bar/prism-view-panel-host.component.d.ts +2 -3
  270. package/dist/app/view-tab-bar/prism-view-panel-host.component.d.ts.map +1 -1
  271. package/dist/app/view-tab-bar/prism-view-panel-host.component.js +9 -9
  272. package/dist/app/view-tab-bar/prism-view-tab-bar.component.d.ts +6 -0
  273. package/dist/app/view-tab-bar/prism-view-tab-bar.component.d.ts.map +1 -1
  274. package/dist/app/view-tab-bar/prism-view-tab-bar.component.js +22 -29
  275. package/dist/builder/config-loader/deprecated-options.d.ts +9 -0
  276. package/dist/builder/config-loader/deprecated-options.d.ts.map +1 -0
  277. package/dist/builder/config-loader/deprecated-options.js +34 -0
  278. package/dist/builder/manifest/composition-wrapper.generator.d.ts +14 -0
  279. package/dist/builder/manifest/composition-wrapper.generator.d.ts.map +1 -0
  280. package/dist/builder/manifest/composition-wrapper.generator.js +66 -0
  281. package/dist/builder/manifest/host-parser.d.ts +2 -0
  282. package/dist/builder/manifest/host-parser.d.ts.map +1 -1
  283. package/dist/builder/manifest/host-parser.js +9 -4
  284. package/dist/builder/manifest/manifest-imports.d.ts +34 -0
  285. package/dist/builder/manifest/manifest-imports.d.ts.map +1 -0
  286. package/dist/builder/manifest/manifest-imports.js +91 -0
  287. package/dist/builder/manifest/runtime-manifest.generator.d.ts +13 -0
  288. package/dist/builder/manifest/runtime-manifest.generator.d.ts.map +1 -1
  289. package/dist/builder/manifest/runtime-manifest.generator.js +137 -65
  290. package/dist/builder/manifest/selector-element.d.ts +16 -0
  291. package/dist/builder/manifest/selector-element.d.ts.map +1 -0
  292. package/dist/builder/manifest/selector-element.js +46 -0
  293. package/dist/builder/manifest/template-literal.d.ts +3 -0
  294. package/dist/builder/manifest/template-literal.d.ts.map +1 -0
  295. package/dist/builder/manifest/template-literal.js +4 -0
  296. package/dist/builder/plugin-runner/plugin-runner.d.ts.map +1 -1
  297. package/dist/builder/plugin-runner/plugin-runner.js +29 -26
  298. package/dist/builder/scanner/api/angular-decorators.d.ts +84 -0
  299. package/dist/builder/scanner/api/angular-decorators.d.ts.map +1 -0
  300. package/dist/builder/scanner/api/angular-decorators.js +157 -0
  301. package/dist/builder/scanner/api/component-api.extractor.d.ts +13 -0
  302. package/dist/builder/scanner/api/component-api.extractor.d.ts.map +1 -0
  303. package/dist/builder/scanner/api/component-api.extractor.js +104 -0
  304. package/dist/builder/scanner/api/doc-tags.d.ts +13 -0
  305. package/dist/builder/scanner/api/doc-tags.d.ts.map +1 -0
  306. package/dist/builder/scanner/api/doc-tags.js +101 -0
  307. package/dist/builder/scanner/api/export-index.d.ts +18 -0
  308. package/dist/builder/scanner/api/export-index.d.ts.map +1 -0
  309. package/dist/builder/scanner/api/export-index.js +22 -0
  310. package/dist/builder/scanner/api/member.extractor.d.ts +90 -0
  311. package/dist/builder/scanner/api/member.extractor.d.ts.map +1 -0
  312. package/dist/builder/scanner/api/member.extractor.js +270 -0
  313. package/dist/builder/scanner/api/pipe-api.extractor.d.ts +12 -0
  314. package/dist/builder/scanner/api/pipe-api.extractor.d.ts.map +1 -0
  315. package/dist/builder/scanner/api/pipe-api.extractor.js +52 -0
  316. package/dist/builder/scanner/api/service-api.extractor.d.ts +14 -0
  317. package/dist/builder/scanner/api/service-api.extractor.d.ts.map +1 -0
  318. package/dist/builder/scanner/api/service-api.extractor.js +119 -0
  319. package/dist/builder/scanner/api/setup.reader.d.ts +26 -0
  320. package/dist/builder/scanner/api/setup.reader.d.ts.map +1 -0
  321. package/dist/builder/scanner/api/setup.reader.js +89 -0
  322. package/dist/builder/scanner/api/type-collector.d.ts +24 -0
  323. package/dist/builder/scanner/api/type-collector.d.ts.map +1 -0
  324. package/dist/builder/scanner/api/type-collector.js +211 -0
  325. package/dist/builder/scanner/ast-utils.d.ts +8 -0
  326. package/dist/builder/scanner/ast-utils.d.ts.map +1 -1
  327. package/dist/builder/scanner/ast-utils.js +37 -1
  328. package/dist/builder/scanner/class-hierarchy.d.ts +5 -3
  329. package/dist/builder/scanner/class-hierarchy.d.ts.map +1 -1
  330. package/dist/builder/scanner/class-hierarchy.js +12 -6
  331. package/dist/builder/scanner/component.scanner.d.ts +60 -6
  332. package/dist/builder/scanner/component.scanner.d.ts.map +1 -1
  333. package/dist/builder/scanner/component.scanner.js +229 -58
  334. package/dist/builder/scanner/composition/compose-template.d.ts +36 -0
  335. package/dist/builder/scanner/composition/compose-template.d.ts.map +1 -0
  336. package/dist/builder/scanner/composition/compose-template.js +187 -0
  337. package/dist/builder/scanner/composition/declarables.d.ts +54 -0
  338. package/dist/builder/scanner/composition/declarables.d.ts.map +1 -0
  339. package/dist/builder/scanner/composition/declarables.js +182 -0
  340. package/dist/builder/scanner/composition/match-declarables.d.ts +43 -0
  341. package/dist/builder/scanner/composition/match-declarables.d.ts.map +1 -0
  342. package/dist/builder/scanner/composition/match-declarables.js +131 -0
  343. package/dist/builder/scanner/composition/read-composition.d.ts +77 -0
  344. package/dist/builder/scanner/composition/read-composition.d.ts.map +1 -0
  345. package/dist/builder/scanner/composition/read-composition.js +302 -0
  346. package/dist/builder/scanner/composition/template-elements.d.ts +12 -0
  347. package/dist/builder/scanner/composition/template-elements.d.ts.map +1 -0
  348. package/dist/builder/scanner/composition/template-elements.js +41 -0
  349. package/dist/builder/scanner/entry-point-discovery.d.ts +5 -0
  350. package/dist/builder/scanner/entry-point-discovery.d.ts.map +1 -1
  351. package/dist/builder/scanner/entry-point-discovery.js +14 -0
  352. package/dist/builder/scanner/entry-point.scanner.d.ts +3 -1
  353. package/dist/builder/scanner/entry-point.scanner.d.ts.map +1 -1
  354. package/dist/builder/scanner/entry-point.scanner.js +7 -6
  355. package/dist/builder/scanner/index.d.ts +4 -0
  356. package/dist/builder/scanner/index.d.ts.map +1 -1
  357. package/dist/builder/scanner/index.js +2 -0
  358. package/dist/builder/scanner/input.extractor.d.ts +31 -2
  359. package/dist/builder/scanner/input.extractor.d.ts.map +1 -1
  360. package/dist/builder/scanner/input.extractor.js +73 -17
  361. package/dist/builder/scanner/pipe.scanner.d.ts +29 -0
  362. package/dist/builder/scanner/pipe.scanner.d.ts.map +1 -0
  363. package/dist/builder/scanner/pipe.scanner.js +65 -0
  364. package/dist/builder/scanner/pseudo-states.d.ts +1 -0
  365. package/dist/builder/scanner/pseudo-states.d.ts.map +1 -1
  366. package/dist/builder/scanner/pseudo-states.js +1 -1
  367. package/dist/builder/scanner/scanner.d.ts +27 -3
  368. package/dist/builder/scanner/scanner.d.ts.map +1 -1
  369. package/dist/builder/scanner/scanner.js +68 -24
  370. package/dist/builder/scanner/service/angular-decorators.d.ts +80 -0
  371. package/dist/builder/scanner/service/angular-decorators.d.ts.map +1 -0
  372. package/dist/builder/scanner/service/angular-decorators.js +154 -0
  373. package/dist/builder/scanner/service/doc-tags.d.ts +13 -0
  374. package/dist/builder/scanner/service/doc-tags.d.ts.map +1 -0
  375. package/dist/builder/scanner/service/doc-tags.js +97 -0
  376. package/dist/builder/scanner/service/export-index.d.ts +18 -0
  377. package/dist/builder/scanner/service/export-index.d.ts.map +1 -0
  378. package/dist/builder/scanner/service/export-index.js +22 -0
  379. package/dist/builder/scanner/service/member.extractor.d.ts +65 -0
  380. package/dist/builder/scanner/service/member.extractor.d.ts.map +1 -0
  381. package/dist/builder/scanner/service/member.extractor.js +216 -0
  382. package/dist/builder/scanner/service/pipe-api.extractor.d.ts +12 -0
  383. package/dist/builder/scanner/service/pipe-api.extractor.d.ts.map +1 -0
  384. package/dist/builder/scanner/service/pipe-api.extractor.js +72 -0
  385. package/dist/builder/scanner/service/service-api.extractor.d.ts +14 -0
  386. package/dist/builder/scanner/service/service-api.extractor.d.ts.map +1 -0
  387. package/dist/builder/scanner/service/service-api.extractor.js +119 -0
  388. package/dist/builder/scanner/service/setup.reader.d.ts +26 -0
  389. package/dist/builder/scanner/service/setup.reader.d.ts.map +1 -0
  390. package/dist/builder/scanner/service/setup.reader.js +89 -0
  391. package/dist/builder/scanner/service/type-collector.d.ts +23 -0
  392. package/dist/builder/scanner/service/type-collector.d.ts.map +1 -0
  393. package/dist/builder/scanner/service/type-collector.js +210 -0
  394. package/dist/builder/scanner/service.scanner.d.ts +26 -0
  395. package/dist/builder/scanner/service.scanner.d.ts.map +1 -0
  396. package/dist/builder/scanner/service.scanner.js +61 -0
  397. package/dist/builder/scanner/showcase-diagnostics.d.ts +60 -1
  398. package/dist/builder/scanner/showcase-diagnostics.d.ts.map +1 -1
  399. package/dist/builder/scanner/showcase-diagnostics.js +123 -10
  400. package/dist/builder/scanner/showcase-states.d.ts +17 -0
  401. package/dist/builder/scanner/showcase-states.d.ts.map +1 -0
  402. package/dist/builder/scanner/showcase-states.js +58 -0
  403. package/dist/builder/scanner/source-file-cache.d.ts +26 -0
  404. package/dist/builder/scanner/source-file-cache.d.ts.map +1 -0
  405. package/dist/builder/scanner/source-file-cache.js +60 -0
  406. package/dist/builder/shared/prism-pipeline.d.ts +6 -0
  407. package/dist/builder/shared/prism-pipeline.d.ts.map +1 -1
  408. package/dist/builder/shared/prism-pipeline.js +71 -18
  409. package/dist/decorator/index.d.ts +1 -1
  410. package/dist/decorator/index.d.ts.map +1 -1
  411. package/dist/decorator/showcase.types.d.ts +102 -9
  412. package/dist/decorator/showcase.types.d.ts.map +1 -1
  413. package/dist/plugin/index.d.ts +6 -1
  414. package/dist/plugin/index.d.ts.map +1 -1
  415. package/dist/plugin/index.js +4 -0
  416. package/dist/plugin/pipe.types.d.ts +36 -0
  417. package/dist/plugin/pipe.types.d.ts.map +1 -0
  418. package/dist/plugin/pipe.types.js +1 -0
  419. package/dist/plugin/plugin.types.d.ts +184 -8
  420. package/dist/plugin/plugin.types.d.ts.map +1 -1
  421. package/dist/plugin/service.types.d.ts +124 -0
  422. package/dist/plugin/service.types.d.ts.map +1 -0
  423. package/dist/plugin/service.types.js +1 -0
  424. package/dist/plugin/status.d.ts +27 -0
  425. package/dist/plugin/status.d.ts.map +1 -0
  426. package/dist/plugin/status.js +26 -0
  427. package/dist/shared/composition.d.ts +30 -0
  428. package/dist/shared/composition.d.ts.map +1 -0
  429. package/dist/shared/composition.js +29 -0
  430. package/dist/shared/pseudo-state.type.d.ts +2 -1
  431. package/dist/shared/pseudo-state.type.d.ts.map +1 -1
  432. package/dist/shared/void-elements.d.ts +3 -0
  433. package/dist/shared/void-elements.d.ts.map +1 -0
  434. package/dist/shared/void-elements.js +2 -0
  435. package/package.json +1 -1
  436. package/src/builder/build/schema.json +6 -6
  437. package/src/builder/serve/schema.json +6 -6
@@ -0,0 +1,154 @@
1
+ import ts from 'typescript';
2
+ import { evaluateExpression, evaluateStatic, findDecorator, getDecoratorArgument, UNEVALUABLE } from '../ast-utils.js';
3
+ const ANGULAR_CORE = '@angular/core';
4
+ /**
5
+ * `@Showcase` fields that only a component can use. A class that carries
6
+ * one of them next to `@Injectable` or `@Pipe` is a component with that
7
+ * decorator, not a service or a pipe: showing it as one would drop the field.
8
+ */
9
+ const COMPONENT_ONLY_FIELDS = ['variants', 'states', 'providers', 'bg', 'canvasLayout', 'host', 'renderPage'];
10
+ /** The values of `providedIn` that make Angular provide a service without anyone listing it. */
11
+ const AUTO_PROVIDED_IN = ['root', 'platform', 'any'];
12
+ /**
13
+ * {@link findDecorator} for an Angular decorator: it only counts if the
14
+ * identifier is imported from `@angular/core`. A `@Service` from a
15
+ * dependency-injection package of another name has nothing to do with Angular's.
16
+ *
17
+ * The scanner never imports `Service` itself, since Angular 20 has none: the
18
+ * decorator is recognised in the source alone.
19
+ */
20
+ export function findAngularCoreDecorator(classDecl, name, checker) {
21
+ const decorator = findDecorator(classDecl, name);
22
+ return decorator && isImportedFromAngularCore(decorator, name, checker) ? decorator : undefined;
23
+ }
24
+ /**
25
+ * Tell a service or a pipe from a component. They all carry `@Showcase`, and
26
+ * the only thing that tells them apart is the Angular decorator beside it.
27
+ *
28
+ * A class with `@Component` or `@Directive` is a component, whatever else it
29
+ * carries. Otherwise `@Pipe` makes it a pipe, and `@Service` or `@Injectable`
30
+ * a service, so that a pipe that is also injectable stays a pipe. Either is
31
+ * overruled by the `@Showcase` argument declaring a component-only field: such
32
+ * a class has been shown as a component so far, so it stays one
33
+ * (`legacy-component`) until 23.0.0, and the scan says why. That check comes
34
+ * first, before anything is said about the pipe itself.
35
+ *
36
+ * `showcaseArg` is read from the literal and from the evaluated value, since a
37
+ * constant or a spread can bring the field in and a field the evaluator cannot
38
+ * read is still in the literal.
39
+ */
40
+ export function classifyShowcaseClass(classDecl, showcaseArg, checker) {
41
+ // Compared by name, as everywhere else in the scanner.
42
+ if (findDecorator(classDecl, 'Component') || findDecorator(classDecl, 'Directive'))
43
+ return { kind: 'component' };
44
+ const pipe = findAngularCoreDecorator(classDecl, 'Pipe', checker);
45
+ if (pipe) {
46
+ const fields = readComponentOnlyFields(showcaseArg, checker);
47
+ if (fields.length === 0)
48
+ return { kind: 'pipe', decorator: pipe };
49
+ return readPipeOptions(pipe, checker).standalone
50
+ ? { kind: 'legacy-component', fields, source: 'pipe' }
51
+ : { kind: 'legacy-component', fields, source: 'pipe', standalone: false };
52
+ }
53
+ const decorator = findAngularCoreDecorator(classDecl, 'Service', checker) ?? findAngularCoreDecorator(classDecl, 'Injectable', checker);
54
+ if (!decorator)
55
+ return { kind: 'component' };
56
+ const fields = readComponentOnlyFields(showcaseArg, checker);
57
+ return fields.length > 0 ? { kind: 'legacy-component', fields, source: 'injectable' } : { kind: 'service', decorator };
58
+ }
59
+ /**
60
+ * Whether Angular provides the service on its own (`auto`) or the user has to
61
+ * list it in a providers array (`manual`).
62
+ *
63
+ * `@Service()` is auto-provided unless it says `autoProvided: false`;
64
+ * `@Injectable` is when `providedIn` is `'root'`, `'platform'` or `'any'`.
65
+ * Anything else, such as no argument, no `providedIn`, a module class or a value
66
+ * the scan cannot read, is `manual`, without a warning: a service nobody
67
+ * provides is a normal thing to document.
68
+ */
69
+ export function readProvision(decorator, checker) {
70
+ const isService = decoratorName(decorator) === 'Service';
71
+ const arg = getDecoratorArgument(decorator);
72
+ if (!arg)
73
+ return isService ? 'auto' : 'manual';
74
+ let unreadable = false;
75
+ const raw = evaluateStatic(arg, {
76
+ checker,
77
+ report: (issue) => {
78
+ // A `factory` is a runtime value and always dropped, which leaves the provision alone.
79
+ if (isService && issue.path[0] === 'autoProvided')
80
+ unreadable = true;
81
+ }
82
+ });
83
+ if (raw === UNEVALUABLE || typeof raw !== 'object' || raw === null)
84
+ return 'manual';
85
+ const options = raw;
86
+ if (isService)
87
+ return unreadable || options['autoProvided'] === false ? 'manual' : 'auto';
88
+ return AUTO_PROVIDED_IN.includes(options['providedIn']) ? 'auto' : 'manual';
89
+ }
90
+ /**
91
+ * Read `name`, `pure` and `standalone` from the `@Pipe` metadata.
92
+ *
93
+ * Nothing that cannot be read is guessed: a `name` or `pure` the source does not
94
+ * give as a constant is left out, so that the caller can say so, while
95
+ * `standalone` only counts as `false` when the source says exactly that.
96
+ */
97
+ export function readPipeOptions(decorator, checker) {
98
+ const arg = getDecoratorArgument(decorator);
99
+ let unreadable = false;
100
+ const raw = arg
101
+ ? evaluateStatic(arg, {
102
+ checker,
103
+ report: (issue) => {
104
+ // The whole argument or a spread that fails could have carried `pure` along, so it counts for it too.
105
+ if (issue.path.length === 0 || issue.path[0] === 'pure')
106
+ unreadable = true;
107
+ }
108
+ })
109
+ : {};
110
+ const options = typeof raw === 'object' && raw !== null ? raw : {};
111
+ const result = { standalone: options['standalone'] !== false };
112
+ if (typeof options['name'] === 'string')
113
+ result.name = options['name'];
114
+ if (typeof options['pure'] === 'boolean')
115
+ result.pure = options['pure'];
116
+ else if (!unreadable && options['pure'] === undefined)
117
+ result.pure = true;
118
+ return result;
119
+ }
120
+ function isImportedFromAngularCore(decorator, name, checker) {
121
+ const expr = ts.isCallExpression(decorator.expression) ? decorator.expression.expression : decorator.expression;
122
+ if (!ts.isIdentifier(expr))
123
+ return false;
124
+ return (checker.getSymbolAtLocation(expr)?.declarations?.some((decl) => {
125
+ if (!ts.isImportSpecifier(decl))
126
+ return false;
127
+ const importDeclaration = decl.parent.parent.parent;
128
+ // `import { Injectable as Service }` is Angular's Injectable, not its Service.
129
+ return (ts.isStringLiteral(importDeclaration.moduleSpecifier) &&
130
+ importDeclaration.moduleSpecifier.text === ANGULAR_CORE &&
131
+ (decl.propertyName ?? decl.name).text === name);
132
+ }) ?? false);
133
+ }
134
+ function decoratorName(decorator) {
135
+ const expr = ts.isCallExpression(decorator.expression) ? decorator.expression.expression : decorator.expression;
136
+ return ts.isIdentifier(expr) ? expr.text : undefined;
137
+ }
138
+ function readComponentOnlyFields(showcaseArg, checker) {
139
+ if (!showcaseArg)
140
+ return [];
141
+ const declared = new Set();
142
+ if (ts.isObjectLiteralExpression(showcaseArg)) {
143
+ for (const prop of showcaseArg.properties) {
144
+ if (prop.name && (ts.isIdentifier(prop.name) || ts.isStringLiteral(prop.name)))
145
+ declared.add(prop.name.text);
146
+ }
147
+ }
148
+ const evaluated = evaluateExpression(showcaseArg, checker);
149
+ if (typeof evaluated === 'object' && evaluated !== null) {
150
+ for (const key of Object.keys(evaluated))
151
+ declared.add(key);
152
+ }
153
+ return COMPONENT_ONLY_FIELDS.filter((field) => declared.has(field));
154
+ }
@@ -0,0 +1,13 @@
1
+ import ts from 'typescript';
2
+ import type { ApiDocTags } from '../../../plugin/service.types.js';
3
+ /** The comment text of a node without its tags, as written: line breaks and markdown stay. */
4
+ export declare function readDescription(node: ts.Node): string | undefined;
5
+ /** The tags of a node. `@version` and tags without a place in {@link ApiDocTags} are not read. */
6
+ export declare function readDocTags(node: ts.Node): ApiDocTags;
7
+ /** Whether a node has a doc block of its own, tags only or not. */
8
+ export declare function isDocumented(node: ts.Node): boolean;
9
+ /** Whether a node carries an `@internal` tag. */
10
+ export declare function isInternal(node: ts.Node): boolean;
11
+ /** The `@param` descriptions of a function-like node, by parameter name. */
12
+ export declare function readParamDescriptions(node: ts.Node): Map<string, string>;
13
+ //# sourceMappingURL=doc-tags.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doc-tags.d.ts","sourceRoot":"","sources":["../../../../src/builder/scanner/service/doc-tags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAgCnE,8FAA8F;AAC9F,wBAAgB,eAAe,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,MAAM,GAAG,SAAS,CAEjE;AAED,kGAAkG;AAClG,wBAAgB,WAAW,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,UAAU,CA6BrD;AAED,mEAAmE;AACnE,wBAAgB,YAAY,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,OAAO,CAEnD;AAED,iDAAiD;AACjD,wBAAgB,UAAU,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,OAAO,CAEjD;AAED,4EAA4E;AAC5E,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAaxE"}
@@ -0,0 +1,97 @@
1
+ import ts from 'typescript';
2
+ /**
3
+ * The block that documents a node: the last `/** *\/` above it, as long as it
4
+ * sits right on top of the node and says something. Line comments in between,
5
+ * such as `// eslint-disable-next-line`, keep it attached. TypeScript also
6
+ * attaches a block that floats a few lines above, such as a section banner,
7
+ * and one that is only a ruler (`/** ===== *\/`); neither describes the node.
8
+ */
9
+ function readDocBlock(node) {
10
+ const blocks = node.jsDoc;
11
+ const block = blocks?.[blocks.length - 1];
12
+ if (!block)
13
+ return undefined;
14
+ const sourceFile = node.getSourceFile();
15
+ // The first line is the rest of the block's last line, the last one the indentation of the node.
16
+ const linesBetween = sourceFile.text.slice(block.end, node.getStart(sourceFile)).split('\n').slice(1, -1);
17
+ if (linesBetween.some((line) => !/^\s*\/\//.test(line)))
18
+ return undefined;
19
+ const stripped = block.getText(sourceFile).replace(/[/*\s]/g, '');
20
+ if (stripped.length === 0 || /^[*=\-_#~]+$/.test(stripped))
21
+ return undefined;
22
+ return block;
23
+ }
24
+ function commentText(comment) {
25
+ return ts.getTextOfJSDocComment(comment)?.trim() || undefined;
26
+ }
27
+ /** The comment text of a node without its tags, as written: line breaks and markdown stay. */
28
+ export function readDescription(node) {
29
+ return commentText(readDocBlock(node)?.comment);
30
+ }
31
+ /** The tags of a node. `@version` and tags without a place in {@link ApiDocTags} are not read. */
32
+ export function readDocTags(node) {
33
+ const result = {};
34
+ for (const tag of readDocBlock(node)?.tags ?? []) {
35
+ const comment = commentText(tag.comment);
36
+ switch (tag.tagName.text) {
37
+ case 'deprecated':
38
+ result.deprecated = comment ?? true;
39
+ break;
40
+ case 'since':
41
+ if (comment)
42
+ result.since = comment;
43
+ break;
44
+ case 'default':
45
+ if (comment)
46
+ result.default = comment;
47
+ break;
48
+ case 'see': {
49
+ const reference = readSeeReference(tag);
50
+ if (reference)
51
+ result.see = [...(result.see ?? []), reference];
52
+ break;
53
+ }
54
+ case 'example':
55
+ if (comment)
56
+ result.example = [...(result.example ?? []), comment];
57
+ break;
58
+ }
59
+ }
60
+ return result;
61
+ }
62
+ /** Whether a node has a doc block of its own, tags only or not. */
63
+ export function isDocumented(node) {
64
+ return readDocBlock(node) !== undefined;
65
+ }
66
+ /** Whether a node carries an `@internal` tag. */
67
+ export function isInternal(node) {
68
+ return readDocBlock(node)?.tags?.some((tag) => tag.tagName.text === 'internal') ?? false;
69
+ }
70
+ /** The `@param` descriptions of a function-like node, by parameter name. */
71
+ export function readParamDescriptions(node) {
72
+ const result = new Map();
73
+ for (const tag of readDocBlock(node)?.tags ?? []) {
74
+ if (!ts.isJSDocParameterTag(tag) || !ts.isIdentifier(tag.name))
75
+ continue;
76
+ // `@param name - text` is the TSDoc spelling; the dash is not part of the text.
77
+ const description = commentText(tag.comment)?.replace(/^-\s+/, '');
78
+ if (description)
79
+ result.set(tag.name.text, description);
80
+ }
81
+ return result;
82
+ }
83
+ /**
84
+ * What a `@see` points at: the target of a `{@link}`, a name, or a URL. The
85
+ * parser reads a URL as a name followed by `://…` and leaves a stray `*` of the
86
+ * next line behind, so the tag is read from the source instead of from its parts.
87
+ */
88
+ function readSeeReference(tag) {
89
+ const body = tag
90
+ .getSourceFile()
91
+ .text.slice(tag.tagName.end, tag.end)
92
+ .split('\n')
93
+ .map((line) => line.replace(/^\s*\*?\s*/, ''))
94
+ .join(' ')
95
+ .trim();
96
+ return /^\{@link(?:code|plain)?\s+([^\s}|]+)/.exec(body)?.[1] ?? (body.split(/\s+/)[0] || undefined);
97
+ }
@@ -0,0 +1,18 @@
1
+ import ts from 'typescript';
2
+ /** Where a symbol can be imported from: the resolved symbol of an export, and the `importPath` of the entry point that exports it. */
3
+ export type ExportIndex = ReadonlyMap<ts.Symbol, string>;
4
+ /**
5
+ * Index everything the library's entry points export by its resolved symbol,
6
+ * so that a reference found anywhere in the source can be traced to the entry
7
+ * point a consumer imports it from. A re-export (`export { x } from`) is an
8
+ * alias and is followed to the declaration, which is what a reference resolves
9
+ * to as well.
10
+ *
11
+ * A symbol exported more than once keeps the first entry: callers put the
12
+ * secondary entry points before the primary one, as the component dedupe does.
13
+ */
14
+ export declare function buildExportIndex(entries: ReadonlyArray<{
15
+ exports: ts.Symbol[];
16
+ importPath: string;
17
+ }>, checker: ts.TypeChecker): ExportIndex;
18
+ //# sourceMappingURL=export-index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export-index.d.ts","sourceRoot":"","sources":["../../../../src/builder/scanner/service/export-index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,sIAAsI;AACtI,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEzD;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,aAAa,CAAC;IAAE,OAAO,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC,EAAE,OAAO,EAAE,EAAE,CAAC,WAAW,GAAG,WAAW,CAY3I"}
@@ -0,0 +1,22 @@
1
+ import ts from 'typescript';
2
+ /**
3
+ * Index everything the library's entry points export by its resolved symbol,
4
+ * so that a reference found anywhere in the source can be traced to the entry
5
+ * point a consumer imports it from. A re-export (`export { x } from`) is an
6
+ * alias and is followed to the declaration, which is what a reference resolves
7
+ * to as well.
8
+ *
9
+ * A symbol exported more than once keeps the first entry: callers put the
10
+ * secondary entry points before the primary one, as the component dedupe does.
11
+ */
12
+ export function buildExportIndex(entries, checker) {
13
+ const index = new Map();
14
+ for (const { exports, importPath } of entries) {
15
+ for (const sym of exports) {
16
+ const resolved = sym.flags & ts.SymbolFlags.Alias ? checker.getAliasedSymbol(sym) : sym;
17
+ if (!index.has(resolved))
18
+ index.set(resolved, importPath);
19
+ }
20
+ }
21
+ return index;
22
+ }
@@ -0,0 +1,65 @@
1
+ import ts from 'typescript';
2
+ import type { ApiMethod, ApiProperty, ApiTypeRef } from '../../../plugin/service.types.js';
3
+ /** What a type is the type of: a property, a parameter of a method, or what a method returns. */
4
+ export type TypeSite = {
5
+ kind: 'property';
6
+ name: string;
7
+ } | {
8
+ kind: 'parameter';
9
+ name: string;
10
+ method: string;
11
+ } | {
12
+ kind: 'return';
13
+ method: string;
14
+ };
15
+ /**
16
+ * Turns the type of a member, parameter or return value into an {@link ApiTypeRef}.
17
+ * `reachedFrom` says where it was met, e.g. `parameter of show()`, and `site`
18
+ * the same in parts, for a resolver that documents the types it finds on the
19
+ * way and follows their members.
20
+ */
21
+ export interface TypeRefResolver {
22
+ ref(typeNode: ts.TypeNode | undefined, type: ts.Type, reachedFrom: string, site?: TypeSite): ApiTypeRef;
23
+ }
24
+ /** A type as written, or as the checker prints it when there is nothing written. Whitespace is collapsed, so a multi-line literal type stays on one line. */
25
+ export declare function readTypeText(checker: ts.TypeChecker, typeNode: ts.TypeNode | undefined, type: ts.Type): string;
26
+ /** Gives the text of a type and nothing else: no links, no documented types. */
27
+ export declare function textOnlyResolver(checker: ts.TypeChecker): TypeRefResolver;
28
+ /**
29
+ * The public instance members of a class and of its base classes, nearest
30
+ * class first and in source order. A class that declares a name hides it in
31
+ * the classes above, whatever it declares: an `@internal` override removes
32
+ * the member, a redeclaration replaces the inherited one. A static member
33
+ * hides nothing, as it is not an instance member.
34
+ *
35
+ * Left out: `private`, `protected` and `#` members, names with a `_` prefix,
36
+ * lifecycle hooks, the constructor, statics and what is tagged `@internal`.
37
+ * The constructor's parameter properties (`constructor(readonly id: string)`)
38
+ * are properties, in the constructor's place, described by its `@param`.
39
+ * Methods are listed with or without JSDoc. A redeclaration without JSDoc of
40
+ * its own keeps its signature, but takes description, tags and `@param` texts
41
+ * from the nearest base class member of that name that has them.
42
+ */
43
+ export declare function extractMembers(classDecl: ts.ClassDeclaration, checker: ts.TypeChecker, types: TypeRefResolver): {
44
+ properties: ApiProperty[];
45
+ methods: ApiMethod[];
46
+ };
47
+ /**
48
+ * The members of an interface or an object literal type, the inherited ones
49
+ * included, own members first. What is tagged `@internal` is left out; there
50
+ * is nothing private to leave out.
51
+ */
52
+ export declare function extractObjectTypeMembers(type: ts.Type, checker: ts.TypeChecker, types: TypeRefResolver): {
53
+ properties: ApiProperty[];
54
+ methods: ApiMethod[];
55
+ };
56
+ /**
57
+ * The signature of a method, or of a function such as a setup function, with
58
+ * the doc block read from `docs`: the declaration itself, the statement of a
59
+ * `const` arrow function, or a declaration it inherits the docs of.
60
+ */
61
+ export declare function extractMethod(name: string, declaration: ts.SignatureDeclaration, docs: ts.Node, checker: ts.TypeChecker, types: TypeRefResolver): ApiMethod;
62
+ /** The first parameter that is not `this`. */
63
+ export declare function firstParameter(declaration: ts.SignatureDeclaration): ts.ParameterDeclaration | undefined;
64
+ export declare function collapseWhitespace(text: string): string;
65
+ //# sourceMappingURL=member.extractor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"member.extractor.d.ts","sourceRoot":"","sources":["../../../../src/builder/scanner/service/member.extractor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,KAAK,EAAE,SAAS,EAAY,WAAW,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAIrG,iGAAiG;AACjG,MAAM,MAAM,QAAQ,GAAG;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAErJ;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC5B,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,GAAG,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;CAC3G;AAkBD,6JAA6J;AAC7J,wBAAgB,YAAY,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,EAAE,QAAQ,EAAE,EAAE,CAAC,QAAQ,GAAG,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,MAAM,CAE9G;AAED,gFAAgF;AAChF,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,GAAG,eAAe,CAIzE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,EAAE,CAAC,gBAAgB,EAAE,OAAO,EAAE,EAAE,CAAC,WAAW,EAAE,KAAK,EAAE,eAAe,GAAG;IAAE,UAAU,EAAE,WAAW,EAAE,CAAC;IAAC,OAAO,EAAE,SAAS,EAAE,CAAA;CAAE,CAyBnK;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,WAAW,EAAE,KAAK,EAAE,eAAe,GAAG;IAAE,UAAU,EAAE,WAAW,EAAE,CAAC;IAAC,OAAO,EAAE,SAAS,EAAE,CAAA;CAAE,CAuB5J;AAiFD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,CAAC,oBAAoB,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,WAAW,EAAE,KAAK,EAAE,eAAe,GAAG,SAAS,CAe3J;AAoBD,8CAA8C;AAC9C,wBAAgB,cAAc,CAAC,WAAW,EAAE,EAAE,CAAC,oBAAoB,GAAG,EAAE,CAAC,oBAAoB,GAAG,SAAS,CAExG;AAkBD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEvD"}
@@ -0,0 +1,216 @@
1
+ import ts from 'typescript';
2
+ import { getClassHierarchy } from '../class-hierarchy.js';
3
+ import { isDocumented, isInternal, readDescription, readDocTags, readParamDescriptions } from './doc-tags.js';
4
+ /** The lifecycle hooks Angular calls on a service; they are not part of what a user calls. */
5
+ const LIFECYCLE_HOOKS = new Set([
6
+ 'ngOnInit',
7
+ 'ngOnDestroy',
8
+ 'ngOnChanges',
9
+ 'ngDoCheck',
10
+ 'ngAfterContentInit',
11
+ 'ngAfterContentChecked',
12
+ 'ngAfterViewInit',
13
+ 'ngAfterViewChecked'
14
+ ]);
15
+ /** A type as written, or as the checker prints it when there is nothing written. Whitespace is collapsed, so a multi-line literal type stays on one line. */
16
+ export function readTypeText(checker, typeNode, type) {
17
+ return typeNode ? collapseWhitespace(typeNode.getText()) : checker.typeToString(type, undefined, ts.TypeFormatFlags.NoTruncation);
18
+ }
19
+ /** Gives the text of a type and nothing else: no links, no documented types. */
20
+ export function textOnlyResolver(checker) {
21
+ return {
22
+ ref: (typeNode, type) => ({ text: readTypeText(checker, typeNode, type) })
23
+ };
24
+ }
25
+ /**
26
+ * The public instance members of a class and of its base classes, nearest
27
+ * class first and in source order. A class that declares a name hides it in
28
+ * the classes above, whatever it declares: an `@internal` override removes
29
+ * the member, a redeclaration replaces the inherited one. A static member
30
+ * hides nothing, as it is not an instance member.
31
+ *
32
+ * Left out: `private`, `protected` and `#` members, names with a `_` prefix,
33
+ * lifecycle hooks, the constructor, statics and what is tagged `@internal`.
34
+ * The constructor's parameter properties (`constructor(readonly id: string)`)
35
+ * are properties, in the constructor's place, described by its `@param`.
36
+ * Methods are listed with or without JSDoc. A redeclaration without JSDoc of
37
+ * its own keeps its signature, but takes description, tags and `@param` texts
38
+ * from the nearest base class member of that name that has them.
39
+ */
40
+ export function extractMembers(classDecl, checker, types) {
41
+ const properties = [];
42
+ const methods = [];
43
+ const declared = new Set();
44
+ const levels = getClassHierarchy(classDecl, checker).classes.map(({ classDecl: current }) => groupByName(current));
45
+ levels.forEach((groups, level) => {
46
+ for (const [name, group] of groups) {
47
+ if (declared.has(name))
48
+ continue;
49
+ // The doc block sits on one of them: the first overload, or the getter or the setter.
50
+ const declaration = group.find(hasOwnDocs) ?? group[0];
51
+ if (!isPublicApi(name, group, declaration))
52
+ continue;
53
+ const docs = hasOwnDocs(declaration) ? declaration : (findInheritedDocs(levels.slice(level + 1), name) ?? declaration);
54
+ if (ts.isMethodDeclaration(declaration))
55
+ methods.push(extractMethod(name, declaration, docs, checker, types));
56
+ else
57
+ properties.push(extractProperty(name, group, declaration, docs, checker, types));
58
+ }
59
+ for (const name of groups.keys())
60
+ declared.add(name);
61
+ });
62
+ return { properties, methods };
63
+ }
64
+ /**
65
+ * The members of an interface or an object literal type, the inherited ones
66
+ * included, own members first. What is tagged `@internal` is left out; there
67
+ * is nothing private to leave out.
68
+ */
69
+ export function extractObjectTypeMembers(type, checker, types) {
70
+ const properties = [];
71
+ const methods = [];
72
+ for (const symbol of checker.getPropertiesOfType(type)) {
73
+ const group = (symbol.declarations ?? []).filter((d) => ts.isMethodSignature(d) ||
74
+ ts.isMethodDeclaration(d) ||
75
+ ts.isPropertySignature(d) ||
76
+ ts.isPropertyDeclaration(d) ||
77
+ ts.isGetAccessor(d) ||
78
+ ts.isSetAccessor(d));
79
+ const declaration = group.find(isDocumented) ?? group[0];
80
+ if (!declaration || isInternal(declaration))
81
+ continue;
82
+ if (ts.isMethodSignature(declaration) || ts.isMethodDeclaration(declaration))
83
+ methods.push(extractMethod(symbol.name, declaration, declaration, checker, types));
84
+ else
85
+ properties.push(extractProperty(symbol.name, group, declaration, declaration, checker, types));
86
+ }
87
+ return { properties, methods };
88
+ }
89
+ /**
90
+ * The named instance members of a class by name, in source order: a getter and
91
+ * its setter, or the overloads of a method, share one entry. The parameter
92
+ * properties of the constructor come in where the constructor stands.
93
+ */
94
+ function groupByName(classDecl) {
95
+ const groups = new Map();
96
+ const add = (name, member) => groups.set(name, [...(groups.get(name) ?? []), member]);
97
+ for (const member of classDecl.members) {
98
+ if (ts.isConstructorDeclaration(member)) {
99
+ for (const param of member.parameters) {
100
+ if (ts.isParameterPropertyDeclaration(param, member))
101
+ add(param.name.text, param);
102
+ }
103
+ continue;
104
+ }
105
+ if (!(ts.isPropertyDeclaration(member) || ts.isMethodDeclaration(member) || ts.isGetAccessorDeclaration(member) || ts.isSetAccessorDeclaration(member)))
106
+ continue;
107
+ if (hasModifier(member, ts.SyntaxKind.StaticKeyword))
108
+ continue;
109
+ const name = getMemberName(member);
110
+ if (name !== undefined)
111
+ add(name, member);
112
+ }
113
+ return groups;
114
+ }
115
+ /**
116
+ * Whether a member is documented where it is declared: by a doc block of its
117
+ * own, or, for a parameter property, by the constructor's `@param` for it.
118
+ */
119
+ function hasOwnDocs(member) {
120
+ return isDocumented(member) || (ts.isParameter(member) && readParamDescriptions(member.parent).has(member.name.text));
121
+ }
122
+ function isPublicApi(name, group, declaration) {
123
+ if (name.startsWith('_') || LIFECYCLE_HOOKS.has(name))
124
+ return false;
125
+ if (group.some((member) => hasModifier(member, ts.SyntaxKind.PrivateKeyword) || hasModifier(member, ts.SyntaxKind.ProtectedKeyword)))
126
+ return false;
127
+ // Only its own block: a member is internal where it is declared, as for `stripInternal`.
128
+ return !isInternal(declaration);
129
+ }
130
+ /** The documented declaration of a name in the nearest of the given base classes that has one. */
131
+ function findInheritedDocs(levels, name) {
132
+ for (const groups of levels) {
133
+ const documented = groups.get(name)?.find(hasOwnDocs);
134
+ if (documented)
135
+ return documented;
136
+ }
137
+ return undefined;
138
+ }
139
+ /** `docs` is the node the doc block is read from: the declaration itself, or a declaration it inherits the docs of. */
140
+ function extractProperty(name, group, declaration, docs, checker, types) {
141
+ const getter = group.find(ts.isGetAccessorDeclaration);
142
+ const setter = group.find(ts.isSetAccessorDeclaration);
143
+ const isField = ts.isPropertyDeclaration(declaration) || ts.isPropertySignature(declaration) || ts.isParameter(declaration);
144
+ // A property reads its type from the getter, and from the setter's parameter when there is none.
145
+ const typeNode = isField ? declaration.type : (getter?.type ?? setter?.parameters[0]?.type);
146
+ const property = {
147
+ name,
148
+ type: types.ref(typeNode, checker.getTypeAtLocation(declaration), `type of ${name}`, { kind: 'property', name }),
149
+ readonly: isField ? hasModifier(declaration, ts.SyntaxKind.ReadonlyKeyword) : !!getter && !setter,
150
+ tags: readDocTags(docs)
151
+ };
152
+ if (isField && declaration.questionToken)
153
+ property.optional = true;
154
+ // A parameter property has its text in the constructor's `@param`, unless it carries a block of its own.
155
+ const description = readDescription(docs) ?? (ts.isParameter(docs) && ts.isIdentifier(docs.name) ? readParamDescriptions(docs.parent).get(docs.name.text) : undefined);
156
+ if (description)
157
+ property.description = description;
158
+ return property;
159
+ }
160
+ /**
161
+ * The signature of a method, or of a function such as a setup function, with
162
+ * the doc block read from `docs`: the declaration itself, the statement of a
163
+ * `const` arrow function, or a declaration it inherits the docs of.
164
+ */
165
+ export function extractMethod(name, declaration, docs, checker, types) {
166
+ const signature = checker.getSignatureFromDeclaration(declaration);
167
+ const returnType = signature ? checker.getReturnTypeOfSignature(signature) : checker.getTypeAtLocation(declaration);
168
+ const descriptions = readParamDescriptions(docs);
169
+ const result = {
170
+ name,
171
+ params: declaration.parameters.filter((param) => !isThisParameter(param)).map((param) => extractParam(name, param, descriptions, checker, types)),
172
+ returnType: types.ref(declaration.type, returnType, `returned by ${name}()`, { kind: 'return', method: name }),
173
+ tags: readDocTags(docs)
174
+ };
175
+ const description = readDescription(docs);
176
+ if (description)
177
+ result.description = description;
178
+ return result;
179
+ }
180
+ function extractParam(methodName, param, descriptions, checker, types) {
181
+ const name = ts.isIdentifier(param.name) ? param.name.text : collapseWhitespace(param.name.getText());
182
+ const result = {
183
+ name,
184
+ type: types.ref(param.type, checker.getTypeAtLocation(param), `parameter of ${methodName}()`, { kind: 'parameter', name, method: methodName }),
185
+ optional: !!(param.questionToken || param.initializer)
186
+ };
187
+ if (param.dotDotDotToken)
188
+ result.rest = true;
189
+ if (param.initializer)
190
+ result.defaultValue = collapseWhitespace(param.initializer.getText());
191
+ const description = descriptions.get(name);
192
+ if (description)
193
+ result.description = description;
194
+ return result;
195
+ }
196
+ /** The first parameter that is not `this`. */
197
+ export function firstParameter(declaration) {
198
+ return declaration.parameters.find((param) => !isThisParameter(param));
199
+ }
200
+ function isThisParameter(param) {
201
+ return ts.isIdentifier(param.name) && param.name.text === 'this';
202
+ }
203
+ /** `#private` and computed names have none: neither is part of the API a user reads. */
204
+ function getMemberName(member) {
205
+ if (!member.name)
206
+ return undefined;
207
+ if (ts.isIdentifier(member.name) || ts.isStringLiteral(member.name))
208
+ return member.name.text;
209
+ return undefined;
210
+ }
211
+ function hasModifier(node, kind) {
212
+ return ts.canHaveModifiers(node) && !!ts.getModifiers(node)?.some((modifier) => modifier.kind === kind);
213
+ }
214
+ export function collapseWhitespace(text) {
215
+ return text.replace(/\s+/g, ' ').trim();
216
+ }
@@ -0,0 +1,12 @@
1
+ import ts from 'typescript';
2
+ import type { PipeApi } from '../../../plugin/pipe.types.js';
3
+ import type { ExportIndex } from './export-index.js';
4
+ import type { SetupRef } from './setup.reader.js';
5
+ /**
6
+ * What the API page of a pipe shows: the description and tags of the class,
7
+ * the signatures of `transform()`, its setup functions and tokens with their
8
+ * config tables, and every documented type all of them reach. A template only
9
+ * calls `transform()`: no other member is read, and none adds a type.
10
+ */
11
+ export declare function extractPipeApi(classDecl: ts.ClassDeclaration, setupRefs: SetupRef[], checker: ts.TypeChecker, exportIndex: ExportIndex): PipeApi;
12
+ //# sourceMappingURL=pipe-api.extractor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipe-api.extractor.d.ts","sourceRoot":"","sources":["../../../../src/builder/scanner/service/pipe-api.extractor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAI7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGlD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,EAAE,CAAC,gBAAgB,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,WAAW,EAAE,WAAW,EAAE,WAAW,GAAG,OAAO,CAWhJ"}