@ng-prism/core 22.2.1 → 22.4.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 (359) hide show
  1. package/README.md +34 -36
  2. package/builders.json +11 -11
  3. package/dist/app/canvas/canvas-bg.styles.d.ts +7 -12
  4. package/dist/app/canvas/canvas-bg.styles.d.ts.map +1 -1
  5. package/dist/app/canvas/canvas-bg.styles.js +37 -22
  6. package/dist/app/canvas/measure-geometry.d.ts +140 -0
  7. package/dist/app/canvas/measure-geometry.d.ts.map +1 -0
  8. package/dist/app/canvas/measure-geometry.js +217 -0
  9. package/dist/app/canvas/measure-keyboard.d.ts +20 -0
  10. package/dist/app/canvas/measure-keyboard.d.ts.map +1 -0
  11. package/dist/app/canvas/measure-keyboard.js +34 -0
  12. package/dist/app/canvas/measure-quad.d.ts +114 -0
  13. package/dist/app/canvas/measure-quad.d.ts.map +1 -0
  14. package/dist/app/canvas/measure-quad.js +173 -0
  15. package/dist/app/canvas/measure-snap.d.ts +35 -0
  16. package/dist/app/canvas/measure-snap.d.ts.map +1 -0
  17. package/dist/app/canvas/measure-snap.js +63 -0
  18. package/dist/app/canvas/prism-canvas-bg-pill.component.d.ts.map +1 -1
  19. package/dist/app/canvas/prism-canvas-bg-pill.component.js +3 -18
  20. package/dist/app/canvas/prism-canvas-measure.component.d.ts +142 -0
  21. package/dist/app/canvas/prism-canvas-measure.component.d.ts.map +1 -0
  22. package/dist/app/canvas/prism-canvas-measure.component.js +554 -0
  23. package/dist/app/canvas/prism-canvas-pin-row.component.d.ts +23 -0
  24. package/dist/app/canvas/prism-canvas-pin-row.component.d.ts.map +1 -0
  25. package/dist/app/canvas/prism-canvas-pin-row.component.js +64 -0
  26. package/dist/app/canvas/prism-canvas-rulers.component.d.ts +1 -0
  27. package/dist/app/canvas/prism-canvas-rulers.component.d.ts.map +1 -1
  28. package/dist/app/canvas/prism-canvas-rulers.component.js +9 -14
  29. package/dist/app/canvas/prism-canvas-toolbar.component.d.ts +28 -28
  30. package/dist/app/canvas/prism-canvas-toolbar.component.d.ts.map +1 -1
  31. package/dist/app/canvas/prism-canvas-toolbar.component.js +124 -162
  32. package/dist/app/canvas/prism-template-popover.component.d.ts.map +1 -1
  33. package/dist/app/canvas/prism-template-popover.component.js +8 -49
  34. package/dist/app/canvas/viewport-snap.d.ts +12 -0
  35. package/dist/app/canvas/viewport-snap.d.ts.map +1 -0
  36. package/dist/app/canvas/viewport-snap.js +23 -0
  37. package/dist/app/component-head/head-metrics.d.ts +2 -2
  38. package/dist/app/component-head/head-metrics.d.ts.map +1 -1
  39. package/dist/app/component-head/head-metrics.js +3 -3
  40. package/dist/app/component-head/prism-component-head.component.d.ts +3 -3
  41. package/dist/app/component-head/prism-component-head.component.d.ts.map +1 -1
  42. package/dist/app/component-head/prism-component-head.component.js +24 -64
  43. package/dist/app/component-head/prism-head-gauge.component.d.ts.map +1 -1
  44. package/dist/app/component-head/prism-head-gauge.component.js +4 -36
  45. package/dist/app/component-head/prism-head-info.component.d.ts +1 -1
  46. package/dist/app/component-head/prism-head-info.component.d.ts.map +1 -1
  47. package/dist/app/component-head/prism-head-info.component.js +4 -37
  48. package/dist/app/component-head/prism-stat.component.d.ts +1 -1
  49. package/dist/app/component-head/prism-stat.component.d.ts.map +1 -1
  50. package/dist/app/component-head/prism-stat.component.js +4 -15
  51. package/dist/app/controls/boolean-control.component.d.ts.map +1 -1
  52. package/dist/app/controls/boolean-control.component.js +4 -12
  53. package/dist/app/controls/json-control.component.d.ts.map +1 -1
  54. package/dist/app/controls/json-control.component.js +4 -24
  55. package/dist/app/controls/number-control.component.d.ts.map +1 -1
  56. package/dist/app/controls/number-control.component.js +4 -11
  57. package/dist/app/controls/string-control.component.d.ts.map +1 -1
  58. package/dist/app/controls/string-control.component.js +4 -11
  59. package/dist/app/controls/union-control.component.d.ts.map +1 -1
  60. package/dist/app/controls/union-control.component.js +4 -16
  61. package/dist/app/directives/prism-resizer.directive.d.ts +24 -1
  62. package/dist/app/directives/prism-resizer.directive.d.ts.map +1 -1
  63. package/dist/app/directives/prism-resizer.directive.js +44 -7
  64. package/dist/app/directives/resize-value.d.ts +22 -0
  65. package/dist/app/directives/resize-value.d.ts.map +1 -0
  66. package/dist/app/directives/resize-value.js +23 -0
  67. package/dist/app/discovery-manifest.d.ts +2 -2
  68. package/dist/app/discovery-manifest.d.ts.map +1 -1
  69. package/dist/app/discovery-manifest.js +16 -22
  70. package/dist/app/header/prism-header-widget-host.component.d.ts.map +1 -1
  71. package/dist/app/header/prism-header-widget-host.component.js +4 -8
  72. package/dist/app/header/prism-header.component.d.ts.map +1 -1
  73. package/dist/app/header/prism-header.component.js +9 -78
  74. package/dist/app/hmr.d.ts.map +1 -1
  75. package/dist/app/icons/icon-registry.d.ts +2 -2
  76. package/dist/app/icons/icon-registry.d.ts.map +1 -1
  77. package/dist/app/icons/icon-registry.js +5 -3
  78. package/dist/app/icons/prism-icon.component.d.ts +2 -2
  79. package/dist/app/icons/prism-icon.component.d.ts.map +1 -1
  80. package/dist/app/icons/prism-icon.component.js +9 -9
  81. package/dist/app/index.d.ts +3 -3
  82. package/dist/app/index.d.ts.map +1 -1
  83. package/dist/app/index.js +17 -24
  84. package/dist/app/layout-menu/prism-layout-menu.component.d.ts.map +1 -1
  85. package/dist/app/layout-menu/prism-layout-menu.component.js +3 -77
  86. package/dist/app/overview/overview-panel.js +1 -1
  87. package/dist/app/overview/overview-visibility.d.ts +1 -1
  88. package/dist/app/overview/overview-visibility.d.ts.map +1 -1
  89. package/dist/app/overview/overview-visibility.js +1 -1
  90. package/dist/app/overview/prism-overview-cell.component.d.ts +2 -2
  91. package/dist/app/overview/prism-overview-cell.component.d.ts.map +1 -1
  92. package/dist/app/overview/prism-overview-cell.component.js +17 -25
  93. package/dist/app/overview/prism-overview.component.d.ts +2 -2
  94. package/dist/app/overview/prism-overview.component.d.ts.map +1 -1
  95. package/dist/app/overview/prism-overview.component.js +6 -14
  96. package/dist/app/page-renderer/prism-page-renderer.component.d.ts.map +1 -1
  97. package/dist/app/page-renderer/prism-page-renderer.component.js +4 -17
  98. package/dist/app/panels/a11y/a11y-audit.service.d.ts.map +1 -1
  99. package/dist/app/panels/a11y/a11y-audit.service.js +14 -2
  100. package/dist/app/panels/a11y/a11y-core.plugin.d.ts.map +1 -1
  101. package/dist/app/panels/a11y/a11y-core.plugin.js +1 -1
  102. package/dist/app/panels/a11y/a11y-dom-utils.d.ts.map +1 -1
  103. package/dist/app/panels/a11y/a11y-dom-utils.js +9 -6
  104. package/dist/app/panels/a11y/a11y-header-badge.component.d.ts.map +1 -1
  105. package/dist/app/panels/a11y/a11y-header-badge.component.js +6 -22
  106. package/dist/app/panels/a11y/a11y-keyboard-overlay.component.d.ts.map +1 -1
  107. package/dist/app/panels/a11y/a11y-keyboard-overlay.component.js +6 -25
  108. package/dist/app/panels/a11y/a11y-keyboard.component.d.ts.map +1 -1
  109. package/dist/app/panels/a11y/a11y-keyboard.component.js +5 -36
  110. package/dist/app/panels/a11y/a11y-keyboard.service.d.ts.map +1 -1
  111. package/dist/app/panels/a11y/a11y-keyboard.service.js +2 -2
  112. package/dist/app/panels/a11y/a11y-overlay-host.component.d.ts.map +1 -1
  113. package/dist/app/panels/a11y/a11y-overlay-host.component.js +5 -32
  114. package/dist/app/panels/a11y/a11y-panel-state.service.d.ts.map +1 -1
  115. package/dist/app/panels/a11y/a11y-panel.component.d.ts +1 -1
  116. package/dist/app/panels/a11y/a11y-panel.component.d.ts.map +1 -1
  117. package/dist/app/panels/a11y/a11y-panel.component.js +7 -69
  118. package/dist/app/panels/a11y/a11y-perspective.service.d.ts.map +1 -1
  119. package/dist/app/panels/a11y/a11y-score.component.d.ts.map +1 -1
  120. package/dist/app/panels/a11y/a11y-score.component.js +4 -31
  121. package/dist/app/panels/a11y/a11y-sr-overlay.component.d.ts.map +1 -1
  122. package/dist/app/panels/a11y/a11y-sr-overlay.component.js +8 -28
  123. package/dist/app/panels/a11y/a11y-sr.component.d.ts.map +1 -1
  124. package/dist/app/panels/a11y/a11y-sr.component.js +5 -28
  125. package/dist/app/panels/a11y/a11y-sr.service.d.ts.map +1 -1
  126. package/dist/app/panels/a11y/a11y-sr.service.js +4 -7
  127. package/dist/app/panels/a11y/a11y-summary.d.ts +3 -4
  128. package/dist/app/panels/a11y/a11y-summary.d.ts.map +1 -1
  129. package/dist/app/panels/a11y/a11y-summary.js +5 -9
  130. package/dist/app/panels/a11y/a11y-thresholds.d.ts +1 -1
  131. package/dist/app/panels/a11y/a11y-thresholds.d.ts.map +1 -1
  132. package/dist/app/panels/a11y/a11y-thresholds.js +2 -2
  133. package/dist/app/panels/a11y/a11y-tree.component.d.ts.map +1 -1
  134. package/dist/app/panels/a11y/a11y-tree.component.js +9 -46
  135. package/dist/app/panels/a11y/a11y-tree.service.d.ts.map +1 -1
  136. package/dist/app/panels/a11y/a11y-tree.service.js +3 -5
  137. package/dist/app/panels/a11y/a11y-violations.component.d.ts.map +1 -1
  138. package/dist/app/panels/a11y/a11y-violations.component.js +7 -58
  139. package/dist/app/panels/a11y/a11y.types.d.ts +1 -1
  140. package/dist/app/panels/a11y/a11y.types.d.ts.map +1 -1
  141. package/dist/app/panels/builtin-header-widgets.js +2 -2
  142. package/dist/app/panels/builtin-navigation-decorations.d.ts +1 -1
  143. package/dist/app/panels/builtin-navigation-decorations.d.ts.map +1 -1
  144. package/dist/app/panels/builtin-navigation-decorations.js +3 -3
  145. package/dist/app/panels/builtin-panels.d.ts.map +1 -1
  146. package/dist/app/panels/builtin-panels.js +2 -7
  147. package/dist/app/panels/controls/controls-plugin.js +3 -3
  148. package/dist/app/panels/controls/non-editable-input-types.d.ts.map +1 -1
  149. package/dist/app/panels/controls/non-editable-input-types.js +2 -6
  150. package/dist/app/panels/controls/prism-controls-panel.component.d.ts.map +1 -1
  151. package/dist/app/panels/controls/prism-controls-panel.component.js +5 -95
  152. package/dist/app/panels/events/events-plugin.js +3 -3
  153. package/dist/app/panels/events/prism-events-panel.component.d.ts.map +1 -1
  154. package/dist/app/panels/events/prism-events-panel.component.js +5 -23
  155. package/dist/app/panels/events/prism-json-node.component.d.ts.map +1 -1
  156. package/dist/app/panels/events/prism-json-node.component.js +4 -86
  157. package/dist/app/panels/events/prism-json-node.utils.d.ts.map +1 -1
  158. package/dist/app/panels/panel-host/panel-badge.d.ts +1 -1
  159. package/dist/app/panels/panel-host/panel-badge.d.ts.map +1 -1
  160. package/dist/app/panels/panel-host/panel-badge.js +2 -4
  161. package/dist/app/panels/panel-host/prism-panel-host.component.d.ts +1 -1
  162. package/dist/app/panels/panel-host/prism-panel-host.component.d.ts.map +1 -1
  163. package/dist/app/panels/panel-host/prism-panel-host.component.js +12 -67
  164. package/dist/app/provide-prism.d.ts +1 -1
  165. package/dist/app/provide-prism.d.ts.map +1 -1
  166. package/dist/app/provide-prism.js +8 -12
  167. package/dist/app/renderer/known-inputs.d.ts +1 -1
  168. package/dist/app/renderer/known-inputs.d.ts.map +1 -1
  169. package/dist/app/renderer/known-inputs.js +1 -1
  170. package/dist/app/renderer/overlay-resolver.d.ts +17 -3
  171. package/dist/app/renderer/overlay-resolver.d.ts.map +1 -1
  172. package/dist/app/renderer/overlay-resolver.js +10 -5
  173. package/dist/app/renderer/prism-renderer.component.d.ts +28 -3
  174. package/dist/app/renderer/prism-renderer.component.d.ts.map +1 -1
  175. package/dist/app/renderer/prism-renderer.component.js +107 -80
  176. package/dist/app/renderer/projectable-content.d.ts.map +1 -1
  177. package/dist/app/renderer/projectable-content.js +4 -6
  178. package/dist/app/renderer/snippet-generator.d.ts +1 -1
  179. package/dist/app/renderer/snippet-generator.d.ts.map +1 -1
  180. package/dist/app/renderer/snippet-generator.js +7 -22
  181. package/dist/app/services/navigation-item.types.d.ts +1 -1
  182. package/dist/app/services/navigation-item.types.d.ts.map +1 -1
  183. package/dist/app/services/prism-canvas.service.d.ts +33 -0
  184. package/dist/app/services/prism-canvas.service.d.ts.map +1 -1
  185. package/dist/app/services/prism-canvas.service.js +71 -6
  186. package/dist/app/services/prism-capture.service.d.ts +24 -50
  187. package/dist/app/services/prism-capture.service.d.ts.map +1 -1
  188. package/dist/app/services/prism-capture.service.js +62 -146
  189. package/dist/app/services/prism-event-log.service.d.ts.map +1 -1
  190. package/dist/app/services/prism-event-log.service.js +1 -4
  191. package/dist/app/services/prism-layout.service.d.ts.map +1 -1
  192. package/dist/app/services/prism-layout.service.js +5 -4
  193. package/dist/app/services/prism-manifest.service.d.ts +1 -1
  194. package/dist/app/services/prism-manifest.service.d.ts.map +1 -1
  195. package/dist/app/services/prism-manifest.service.js +1 -1
  196. package/dist/app/services/prism-measure.service.d.ts +44 -0
  197. package/dist/app/services/prism-measure.service.d.ts.map +1 -0
  198. package/dist/app/services/prism-measure.service.js +91 -0
  199. package/dist/app/services/prism-navigation.service.d.ts +1 -1
  200. package/dist/app/services/prism-navigation.service.d.ts.map +1 -1
  201. package/dist/app/services/prism-navigation.service.js +5 -13
  202. package/dist/app/services/prism-panel.service.d.ts +2 -2
  203. package/dist/app/services/prism-panel.service.d.ts.map +1 -1
  204. package/dist/app/services/prism-panel.service.js +4 -7
  205. package/dist/app/services/prism-persistence.service.d.ts.map +1 -1
  206. package/dist/app/services/prism-persistence.service.js +9 -11
  207. package/dist/app/services/prism-plugin.service.d.ts.map +1 -1
  208. package/dist/app/services/prism-renderer.service.d.ts.map +1 -1
  209. package/dist/app/services/prism-renderer.service.js +5 -9
  210. package/dist/app/services/prism-search.service.d.ts.map +1 -1
  211. package/dist/app/services/prism-search.service.js +1 -2
  212. package/dist/app/services/prism-theme.service.d.ts.map +1 -1
  213. package/dist/app/services/prism-theme.service.js +6 -4
  214. package/dist/app/services/prism-url-state.service.d.ts.map +1 -1
  215. package/dist/app/services/prism-url-state.service.js +4 -10
  216. package/dist/app/services/prism-variant-bg.service.d.ts +10 -24
  217. package/dist/app/services/prism-variant-bg.service.d.ts.map +1 -1
  218. package/dist/app/services/prism-variant-bg.service.js +13 -29
  219. package/dist/app/shared/prism-metric-badge.component.d.ts +9 -15
  220. package/dist/app/shared/prism-metric-badge.component.d.ts.map +1 -1
  221. package/dist/app/shared/prism-metric-badge.component.js +13 -32
  222. package/dist/app/shell/prism-shell.component.d.ts.map +1 -1
  223. package/dist/app/shell/prism-shell.component.js +26 -125
  224. package/dist/app/sidebar/navigation-decorations.d.ts +4 -4
  225. package/dist/app/sidebar/navigation-decorations.d.ts.map +1 -1
  226. package/dist/app/sidebar/navigation-decorations.js +3 -3
  227. package/dist/app/sidebar/prism-sidebar.component.d.ts +3 -3
  228. package/dist/app/sidebar/prism-sidebar.component.d.ts.map +1 -1
  229. package/dist/app/sidebar/prism-sidebar.component.js +21 -156
  230. package/dist/app/theme/prism-default-theme.d.ts.map +1 -1
  231. package/dist/app/theme/prism-default-theme.js +6 -6
  232. package/dist/app/tokens/prism-tokens.d.ts.map +1 -1
  233. package/dist/app/tokens/prism-tokens.js +1 -1
  234. package/dist/app/variant-ribbon/prism-variant-ribbon.component.d.ts.map +1 -1
  235. package/dist/app/variant-ribbon/prism-variant-ribbon.component.js +4 -49
  236. package/dist/app/variant-ribbon/spectrum.d.ts +1 -1
  237. package/dist/app/variant-ribbon/spectrum.d.ts.map +1 -1
  238. package/dist/app/variant-ribbon/spectrum.js +1 -1
  239. package/dist/app/view-tab-bar/next-view-id.d.ts +1 -1
  240. package/dist/app/view-tab-bar/next-view-id.d.ts.map +1 -1
  241. package/dist/app/view-tab-bar/next-view-id.js +2 -4
  242. package/dist/app/view-tab-bar/prism-view-panel-host.component.d.ts.map +1 -1
  243. package/dist/app/view-tab-bar/prism-view-panel-host.component.js +5 -17
  244. package/dist/app/view-tab-bar/prism-view-tab-bar.component.d.ts.map +1 -1
  245. package/dist/app/view-tab-bar/prism-view-tab-bar.component.js +4 -27
  246. package/dist/builder/a11y/a11y-report-reader.d.ts +2 -2
  247. package/dist/builder/a11y/a11y-report-reader.d.ts.map +1 -1
  248. package/dist/builder/a11y/a11y-report-reader.js +8 -8
  249. package/dist/builder/build/index.d.ts.map +1 -1
  250. package/dist/builder/build/index.js +5 -9
  251. package/dist/builder/build/schema.d.ts.map +1 -1
  252. package/dist/builder/config-loader/config-loader.d.ts.map +1 -1
  253. package/dist/builder/config-loader/config-loader.js +4 -5
  254. package/dist/builder/manifest/host-parser.d.ts.map +1 -1
  255. package/dist/builder/manifest/host-parser.js +1 -1
  256. package/dist/builder/manifest/runtime-manifest.generator.d.ts +1 -1
  257. package/dist/builder/manifest/runtime-manifest.generator.d.ts.map +1 -1
  258. package/dist/builder/manifest/runtime-manifest.generator.js +14 -35
  259. package/dist/builder/plugin-runner/plugin-runner.d.ts.map +1 -1
  260. package/dist/builder/plugin-runner/plugin-runner.js +2 -4
  261. package/dist/builder/scanner/ast-utils.d.ts +46 -2
  262. package/dist/builder/scanner/ast-utils.d.ts.map +1 -1
  263. package/dist/builder/scanner/ast-utils.js +338 -38
  264. package/dist/builder/scanner/class-hierarchy.d.ts +33 -0
  265. package/dist/builder/scanner/class-hierarchy.d.ts.map +1 -0
  266. package/dist/builder/scanner/class-hierarchy.js +87 -0
  267. package/dist/builder/scanner/component.scanner.d.ts +7 -1
  268. package/dist/builder/scanner/component.scanner.d.ts.map +1 -1
  269. package/dist/builder/scanner/component.scanner.js +113 -72
  270. package/dist/builder/scanner/entry-point-discovery.d.ts.map +1 -1
  271. package/dist/builder/scanner/entry-point-discovery.js +3 -5
  272. package/dist/builder/scanner/entry-point.scanner.d.ts.map +1 -1
  273. package/dist/builder/scanner/entry-point.scanner.js +1 -3
  274. package/dist/builder/scanner/index.d.ts +1 -1
  275. package/dist/builder/scanner/index.d.ts.map +1 -1
  276. package/dist/builder/scanner/input.extractor.d.ts +7 -4
  277. package/dist/builder/scanner/input.extractor.d.ts.map +1 -1
  278. package/dist/builder/scanner/input.extractor.js +157 -76
  279. package/dist/builder/scanner/manifest.generator.d.ts.map +1 -1
  280. package/dist/builder/scanner/manifest.generator.js +8 -6
  281. package/dist/builder/scanner/scanner.d.ts +3 -1
  282. package/dist/builder/scanner/scanner.d.ts.map +1 -1
  283. package/dist/builder/scanner/scanner.js +10 -8
  284. package/dist/builder/scanner/showcase-diagnostics.d.ts +25 -0
  285. package/dist/builder/scanner/showcase-diagnostics.d.ts.map +1 -0
  286. package/dist/builder/scanner/showcase-diagnostics.js +96 -0
  287. package/dist/builder/serve/index.d.ts.map +1 -1
  288. package/dist/builder/serve/index.js +8 -10
  289. package/dist/builder/serve/schema.d.ts.map +1 -1
  290. package/dist/builder/shared/index.d.ts +1 -1
  291. package/dist/builder/shared/index.d.ts.map +1 -1
  292. package/dist/builder/shared/index.js +1 -1
  293. package/dist/builder/shared/prism-pipeline.d.ts +1 -1
  294. package/dist/builder/shared/prism-pipeline.d.ts.map +1 -1
  295. package/dist/builder/shared/prism-pipeline.js +29 -38
  296. package/dist/builder/shared/resolve-cache-dir.d.ts.map +1 -1
  297. package/dist/builder/shared/resolve-cache-dir.js +1 -1
  298. package/dist/builder/watcher/index.d.ts +1 -1
  299. package/dist/builder/watcher/index.d.ts.map +1 -1
  300. package/dist/builder/watcher/prism-watcher.d.ts.map +1 -1
  301. package/dist/builder/watcher/prism-watcher.js +14 -12
  302. package/dist/config/index.d.ts +2 -2
  303. package/dist/config/index.d.ts.map +1 -1
  304. package/dist/config/index.js +1 -1
  305. package/dist/decorator/index.d.ts +1 -1
  306. package/dist/decorator/index.d.ts.map +1 -1
  307. package/dist/decorator/showcase.decorator.d.ts.map +1 -1
  308. package/dist/decorator/showcase.types.d.ts +11 -9
  309. package/dist/decorator/showcase.types.d.ts.map +1 -1
  310. package/dist/index.js +3 -3
  311. package/dist/plugin/define-config.js +1 -1
  312. package/dist/plugin/index.d.ts +4 -4
  313. package/dist/plugin/index.d.ts.map +1 -1
  314. package/dist/plugin/index.js +7 -11
  315. package/dist/plugin/page-helpers.d.ts +1 -1
  316. package/dist/plugin/page-helpers.d.ts.map +1 -1
  317. package/dist/plugin/page-helpers.js +2 -2
  318. package/dist/plugin/page.types.d.ts.map +1 -1
  319. package/dist/plugin/plugin.types.d.ts +31 -14
  320. package/dist/plugin/plugin.types.d.ts.map +1 -1
  321. package/dist/schematics/migrations/v21-13-manifest-cache/index.d.ts.map +1 -1
  322. package/dist/schematics/migrations/v21-13-manifest-cache/index.js +4 -10
  323. package/dist/schematics/migrations/v22-0-cache-dir-rename/index.d.ts.map +1 -1
  324. package/dist/schematics/migrations/v22-0-cache-dir-rename/index.js +6 -10
  325. package/dist/schematics/ng-add/index.d.ts.map +1 -1
  326. package/dist/schematics/ng-add/index.js +122 -56
  327. package/dist/schematics/ng-add/schema.d.ts.map +1 -1
  328. package/dist/schematics/utils/config-ast.d.ts.map +1 -1
  329. package/dist/schematics/utils/config-ast.js +8 -15
  330. package/dist/schematics/utils/tsconfig-paths.d.ts.map +1 -1
  331. package/dist/schematics/utils/tsconfig-paths.js +1 -1
  332. package/dist/shared/canvas-bg.type.d.ts +5 -6
  333. package/dist/shared/canvas-bg.type.d.ts.map +1 -1
  334. package/dist/shared/canvas-bg.type.js +5 -13
  335. package/dist/shared/canvas-layout.type.d.ts.map +1 -1
  336. package/dist/shared/canvas-layout.type.js +1 -4
  337. package/dist/shared/measure.type.d.ts +52 -0
  338. package/dist/shared/measure.type.d.ts.map +1 -0
  339. package/dist/shared/measure.type.js +21 -0
  340. package/dist/shared/variant-bg.d.ts +20 -31
  341. package/dist/shared/variant-bg.d.ts.map +1 -1
  342. package/dist/shared/variant-bg.js +20 -31
  343. package/dist/shared/viewport.type.d.ts +43 -0
  344. package/dist/shared/viewport.type.d.ts.map +1 -0
  345. package/dist/shared/viewport.type.js +44 -0
  346. package/dist/transformer/cli.js +0 -0
  347. package/dist/transformer/index.d.ts +2 -2
  348. package/dist/transformer/index.d.ts.map +1 -1
  349. package/dist/transformer/index.js +2 -2
  350. package/dist/transformer/showcase-strip.transformer.d.ts.map +1 -1
  351. package/dist/transformer/showcase-strip.transformer.js +7 -16
  352. package/dist/transformer/strip-directory.d.ts.map +1 -1
  353. package/dist/transformer/strip-directory.js +2 -4
  354. package/package.json +5 -2
  355. package/schematics/collection.json +7 -7
  356. package/schematics/migrations.json +12 -12
  357. package/schematics/ng-add/schema.json +22 -22
  358. package/src/builder/build/schema.json +36 -36
  359. package/src/builder/serve/schema.json +37 -37
@@ -0,0 +1,52 @@
1
+ /**
2
+ * The measuring tool measures geometry, not cascade: a point knows the edge
3
+ * it sits on, but not the CSS property that produced it. Mapping pixels to a
4
+ * property is deliberately a follow-up step, see Spec §13.
5
+ */
6
+ export type SnapKind = 'border' | 'padding' | 'content';
7
+ export type EdgeSide = 'top' | 'right' | 'bottom' | 'left';
8
+ /** What a point snapped to — `null` when no target was within tolerance. */
9
+ export interface SnapRef {
10
+ kind: SnapKind;
11
+ side: EdgeSide;
12
+ from: Element;
13
+ }
14
+ /**
15
+ * A measure point in `.demo-wrap`-local CSS pixels.
16
+ *
17
+ * Not in screen coordinates: `.demo-wrap` carries
18
+ * `transform: scale(var(--zoom))`, and local coordinates turn the distance
19
+ * into a CSS-pixel distance with no further division. Zooming after a pin is
20
+ * placed then does not shift it relative to the specimen.
21
+ */
22
+ export interface MeasurePoint {
23
+ x: number;
24
+ y: number;
25
+ snap: SnapRef | null;
26
+ }
27
+ export interface Measurement {
28
+ a: MeasurePoint;
29
+ b: MeasurePoint;
30
+ }
31
+ /**
32
+ * How close the pointer has to come to an edge, in **screen** pixels.
33
+ *
34
+ * Screen and not document pixels, because the tolerance describes a
35
+ * precision of the hand and not a property of the document: it has to feel
36
+ * the same at 50% zoom as at 200%. Same value as `VIEWPORT_SNAP_TOLERANCE`,
37
+ * for the same reason.
38
+ */
39
+ export declare const MEASURE_SNAP_TOLERANCE = 8;
40
+ /**
41
+ * The span, in CSS pixels, above which the value fits between the end ticks.
42
+ *
43
+ * Below it the ticks and the number overlap, and the measurement becomes
44
+ * unreadable exactly where it needs to be most precise. The value then
45
+ * moves outside instead.
46
+ */
47
+ export declare const MEASURE_LABEL_MIN_SPAN = 28;
48
+ /** How far the value steps aside, perpendicular to the line, for short spans. */
49
+ export declare const MEASURE_LABEL_OFFSET = 15;
50
+ /** Length of an end tick, centered on the endpoint. */
51
+ export declare const MEASURE_TICK_LENGTH = 7;
52
+ //# sourceMappingURL=measure.type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"measure.type.d.ts","sourceRoot":"","sources":["../../src/shared/measure.type.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;AAExD,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE3D,4EAA4E;AAC5E,MAAM,WAAW,OAAO;IACpB,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IACzB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;CACxB;AAED,MAAM,WAAW,WAAW;IACxB,CAAC,EAAE,YAAY,CAAC;IAChB,CAAC,EAAE,YAAY,CAAC;CACnB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAEzC,iFAAiF;AACjF,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC,uDAAuD;AACvD,eAAO,MAAM,mBAAmB,IAAI,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * How close the pointer has to come to an edge, in **screen** pixels.
3
+ *
4
+ * Screen and not document pixels, because the tolerance describes a
5
+ * precision of the hand and not a property of the document: it has to feel
6
+ * the same at 50% zoom as at 200%. Same value as `VIEWPORT_SNAP_TOLERANCE`,
7
+ * for the same reason.
8
+ */
9
+ export const MEASURE_SNAP_TOLERANCE = 8;
10
+ /**
11
+ * The span, in CSS pixels, above which the value fits between the end ticks.
12
+ *
13
+ * Below it the ticks and the number overlap, and the measurement becomes
14
+ * unreadable exactly where it needs to be most precise. The value then
15
+ * moves outside instead.
16
+ */
17
+ export const MEASURE_LABEL_MIN_SPAN = 28;
18
+ /** How far the value steps aside, perpendicular to the line, for short spans. */
19
+ export const MEASURE_LABEL_OFFSET = 15;
20
+ /** Length of an end tick, centered on the endpoint. */
21
+ export const MEASURE_TICK_LENGTH = 7;
@@ -2,37 +2,26 @@ import type { CanvasBg } from './canvas-bg.type.js';
2
2
  /**
3
3
  * The surface a variant is reported to render on when nothing declares one.
4
4
  *
5
- * An undeclared variant is the "no opinion" case, and `transparent` is the
6
- * honest capture of no opinion. The alternative, `checker`, patterns over
7
- * `--prism-bg-surface` — a *theme* token — and capture mode strips the pattern
8
- * and keeps the colour, so an undeclared variant used to be photographed on
9
- * whichever theme the runner's browser happened to start in. That is not a
10
- * neutral default; it is the runner's theme leaking into a baseline. Alpha
11
- * carries no such dependency, and it is not the thing capture mode's
12
- * determinism argument rules out: a pattern has a phase that shifts when a
13
- * centred component resizes, an alpha channel is a per-pixel value that does
14
- * not move.
15
- *
16
- * In the app both values look identical — `transparent` renders as the same
17
- * checkerboard, which is the UI's way of saying "no surface here". The change
18
- * is only visible in a capture.
19
- *
20
- * The cost is real and worth stating plainly: a runner that does not pass
21
- * `omitBackground: true` gets an opaque capture over whatever the browser
22
- * painted, because the page's own backdrop is below every stylesheet. See
5
+ * `transparent`, because an undeclared variant has no opinion about its
6
+ * surface. `checker` patterns over `--prism-bg-surface`, a theme token, and
7
+ * capture mode keeps the colour, so the runner's theme would leak into the
8
+ * baseline. Alpha has no such dependency and, unlike a pattern, does not shift
9
+ * when a centred component resizes. In the app both render the same
10
+ * checkerboard; the difference only shows in a capture.
11
+ *
12
+ * A runner must pass `omitBackground: true`, otherwise the capture is opaque
13
+ * over whatever the browser painted. See
23
14
  * `docs/guide/visual-regression.md#capturing-transparency`.
24
15
  *
25
- * What to declare, now that the default no longer decides it for you:
16
+ * What to declare:
26
17
  *
27
- * - `light` or `dark` when the component was designed against a surface.
28
- * Their colours are absolute rather than theme tokens, which is what makes
29
- * them stable across runners.
30
- * - `transparent` when the component's own transparency is the thing under
31
- * test — an outlined button, an icon, a divider. Flattening one onto an
32
- * opaque colour makes a transparent fill and a painted fill produce the
33
- * same pixels.
34
- * - `dots`, `plain` or `checker` for browsing. All three follow the active
35
- * theme, so a baseline recorded on one is only as stable as the theme.
18
+ * - `light` or `dark` when the component was designed against a surface. Their
19
+ * colours are absolute, not theme tokens, so they are stable across runners.
20
+ * - `transparent` when the component's own transparency is under test (an
21
+ * outlined button, an icon, a divider). On an opaque colour a transparent
22
+ * fill and a painted fill produce the same pixels.
23
+ * - `dots`, `plain` or `checker` for browsing. They follow the active theme, so
24
+ * a baseline recorded on one is only as stable as the theme.
36
25
  */
37
26
  export declare const DEFAULT_VARIANT_BG: CanvasBg;
38
27
  /**
@@ -50,7 +39,7 @@ export interface VariantBgSource {
50
39
  /**
51
40
  * The background a variant *declares*, or `null` when it declares none.
52
41
  *
53
- * Priority is variant, then component. `null` is a meaningful answer — it is
42
+ * Priority is variant, then component. `null` is a meaningful answer. It is
54
43
  * what lets the canvas keep the user's own background choice instead of
55
44
  * overwriting it, and what makes the background pill able to say "this is your
56
45
  * choice, not the component's".
@@ -64,8 +53,8 @@ export declare function declaredVariantBg(config: VariantBgSource, variantIndex:
64
53
  /**
65
54
  * The background a variant renders on, always resolved to a concrete value.
66
55
  *
67
- * This is the answer external tooling needs — a screenshot runner cannot act
68
- * on "nothing declared" — and the one capture mode paints, so the value
56
+ * This is the answer external tooling needs, since a screenshot runner cannot act
57
+ * on "nothing declared". It is also what capture mode paints, so the value
69
58
  * reported by `__PRISM_MANIFEST__` and the pixels in the capture agree.
70
59
  */
71
60
  export declare function resolveVariantBg(config: VariantBgSource, variantIndex: number): CanvasBg;
@@ -1 +1 @@
1
- {"version":3,"file":"variant-bg.d.ts","sourceRoot":"","sources":["../../src/shared/variant-bg.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,eAAO,MAAM,kBAAkB,EAAE,QAAwB,CAAC;AAE1D;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,EAAE,CAAC,EAAE,QAAQ,CAAC;IACd,QAAQ,CAAC,EAAE,SAAS;QAAE,EAAE,CAAC,EAAE,QAAQ,CAAA;KAAE,EAAE,CAAC;CACzC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,eAAe,EACvB,YAAY,EAAE,MAAM,GACnB,QAAQ,GAAG,IAAI,CAEjB;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,eAAe,EACvB,YAAY,EAAE,MAAM,GACnB,QAAQ,CAEV"}
1
+ {"version":3,"file":"variant-bg.d.ts","sourceRoot":"","sources":["../../src/shared/variant-bg.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,kBAAkB,EAAE,QAAwB,CAAC;AAE1D;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC5B,EAAE,CAAC,EAAE,QAAQ,CAAC;IACd,QAAQ,CAAC,EAAE,SAAS;QAAE,EAAE,CAAC,EAAE,QAAQ,CAAA;KAAE,EAAE,CAAC;CAC3C;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAEhG;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,GAAG,QAAQ,CAExF"}
@@ -1,43 +1,32 @@
1
1
  /**
2
2
  * The surface a variant is reported to render on when nothing declares one.
3
3
  *
4
- * An undeclared variant is the "no opinion" case, and `transparent` is the
5
- * honest capture of no opinion. The alternative, `checker`, patterns over
6
- * `--prism-bg-surface` — a *theme* token — and capture mode strips the pattern
7
- * and keeps the colour, so an undeclared variant used to be photographed on
8
- * whichever theme the runner's browser happened to start in. That is not a
9
- * neutral default; it is the runner's theme leaking into a baseline. Alpha
10
- * carries no such dependency, and it is not the thing capture mode's
11
- * determinism argument rules out: a pattern has a phase that shifts when a
12
- * centred component resizes, an alpha channel is a per-pixel value that does
13
- * not move.
14
- *
15
- * In the app both values look identical — `transparent` renders as the same
16
- * checkerboard, which is the UI's way of saying "no surface here". The change
17
- * is only visible in a capture.
18
- *
19
- * The cost is real and worth stating plainly: a runner that does not pass
20
- * `omitBackground: true` gets an opaque capture over whatever the browser
21
- * painted, because the page's own backdrop is below every stylesheet. See
4
+ * `transparent`, because an undeclared variant has no opinion about its
5
+ * surface. `checker` patterns over `--prism-bg-surface`, a theme token, and
6
+ * capture mode keeps the colour, so the runner's theme would leak into the
7
+ * baseline. Alpha has no such dependency and, unlike a pattern, does not shift
8
+ * when a centred component resizes. In the app both render the same
9
+ * checkerboard; the difference only shows in a capture.
10
+ *
11
+ * A runner must pass `omitBackground: true`, otherwise the capture is opaque
12
+ * over whatever the browser painted. See
22
13
  * `docs/guide/visual-regression.md#capturing-transparency`.
23
14
  *
24
- * What to declare, now that the default no longer decides it for you:
15
+ * What to declare:
25
16
  *
26
- * - `light` or `dark` when the component was designed against a surface.
27
- * Their colours are absolute rather than theme tokens, which is what makes
28
- * them stable across runners.
29
- * - `transparent` when the component's own transparency is the thing under
30
- * test — an outlined button, an icon, a divider. Flattening one onto an
31
- * opaque colour makes a transparent fill and a painted fill produce the
32
- * same pixels.
33
- * - `dots`, `plain` or `checker` for browsing. All three follow the active
34
- * theme, so a baseline recorded on one is only as stable as the theme.
17
+ * - `light` or `dark` when the component was designed against a surface. Their
18
+ * colours are absolute, not theme tokens, so they are stable across runners.
19
+ * - `transparent` when the component's own transparency is under test (an
20
+ * outlined button, an icon, a divider). On an opaque colour a transparent
21
+ * fill and a painted fill produce the same pixels.
22
+ * - `dots`, `plain` or `checker` for browsing. They follow the active theme, so
23
+ * a baseline recorded on one is only as stable as the theme.
35
24
  */
36
25
  export const DEFAULT_VARIANT_BG = 'transparent';
37
26
  /**
38
27
  * The background a variant *declares*, or `null` when it declares none.
39
28
  *
40
- * Priority is variant, then component. `null` is a meaningful answer — it is
29
+ * Priority is variant, then component. `null` is a meaningful answer. It is
41
30
  * what lets the canvas keep the user's own background choice instead of
42
31
  * overwriting it, and what makes the background pill able to say "this is your
43
32
  * choice, not the component's".
@@ -53,8 +42,8 @@ export function declaredVariantBg(config, variantIndex) {
53
42
  /**
54
43
  * The background a variant renders on, always resolved to a concrete value.
55
44
  *
56
- * This is the answer external tooling needs — a screenshot runner cannot act
57
- * on "nothing declared" — and the one capture mode paints, so the value
45
+ * This is the answer external tooling needs, since a screenshot runner cannot act
46
+ * on "nothing declared". It is also what capture mode paints, so the value
58
47
  * reported by `__PRISM_MANIFEST__` and the pixels in the capture agree.
59
48
  */
60
49
  export function resolveVariantBg(config, variantIndex) {
@@ -0,0 +1,43 @@
1
+ /**
2
+ * The canvas viewport: one nullable number, not a device list.
3
+ *
4
+ * The tool is for finding where a layout breaks, so the presets are plain
5
+ * widths without device names. A device name would suggest a simulation; the
6
+ * constraint only narrows the box. Media queries still read the real browser
7
+ * viewport; only `@container` rules respond.
8
+ */
9
+ /**
10
+ * The narrowest the constraint will go.
11
+ *
12
+ * Below any real device. The presets cover the widths people design against;
13
+ * the floor lets a drag go past them to find where a layout breaks. A floor at
14
+ * the narrowest real phone would hide that point for the components most worth
15
+ * checking.
16
+ */
17
+ export declare const VIEWPORT_MIN = 100;
18
+ /** Wide enough for a desktop breakpoint, short of the point where the stage scrolls on any realistic screen. */
19
+ export declare const VIEWPORT_MAX = 1600;
20
+ /** Where the toggle lands when no width has been set this session. */
21
+ export declare const VIEWPORT_DEFAULT = 390;
22
+ /** How near a drag has to come before it rests on a preset, in pixels. */
23
+ export declare const VIEWPORT_SNAP_TOLERANCE = 8;
24
+ /**
25
+ * The named widths, as numbers.
26
+ *
27
+ * Common CSS breakpoints plus the two phone widths that actually differ from
28
+ * them. Rendered as the "Width" group in the canvas tools menu, like the zoom
29
+ * chooser next to it.
30
+ */
31
+ export declare const VIEWPORT_SNAPS: readonly number[];
32
+ /**
33
+ * `width` brought inside the legal range and onto a whole pixel.
34
+ *
35
+ * Lives next to the bounds, not the canvas snapping, because the service uses
36
+ * it to keep stored and programmatic widths legal and should not import from
37
+ * the canvas UI folder.
38
+ *
39
+ * Rounded, not truncated: the value is shown as a label on the canvas, and
40
+ * `389.6 px` during a drag looks like a rendering bug.
41
+ */
42
+ export declare function clampViewportWidth(width: number): number;
43
+ //# sourceMappingURL=viewport.type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"viewport.type.d.ts","sourceRoot":"","sources":["../../src/shared/viewport.type.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,MAAM,CAAC;AAEhC,gHAAgH;AAChH,eAAO,MAAM,YAAY,OAAO,CAAC;AAEjC,sEAAsE;AACtE,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAEpC,0EAA0E;AAC1E,eAAO,MAAM,uBAAuB,IAAI,CAAC;AAEzC;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,EAAE,SAAS,MAAM,EAAoC,CAAC;AAEjF;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAExD"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * The canvas viewport: one nullable number, not a device list.
3
+ *
4
+ * The tool is for finding where a layout breaks, so the presets are plain
5
+ * widths without device names. A device name would suggest a simulation; the
6
+ * constraint only narrows the box. Media queries still read the real browser
7
+ * viewport; only `@container` rules respond.
8
+ */
9
+ /**
10
+ * The narrowest the constraint will go.
11
+ *
12
+ * Below any real device. The presets cover the widths people design against;
13
+ * the floor lets a drag go past them to find where a layout breaks. A floor at
14
+ * the narrowest real phone would hide that point for the components most worth
15
+ * checking.
16
+ */
17
+ export const VIEWPORT_MIN = 100;
18
+ /** Wide enough for a desktop breakpoint, short of the point where the stage scrolls on any realistic screen. */
19
+ export const VIEWPORT_MAX = 1600;
20
+ /** Where the toggle lands when no width has been set this session. */
21
+ export const VIEWPORT_DEFAULT = 390;
22
+ /** How near a drag has to come before it rests on a preset, in pixels. */
23
+ export const VIEWPORT_SNAP_TOLERANCE = 8;
24
+ /**
25
+ * The named widths, as numbers.
26
+ *
27
+ * Common CSS breakpoints plus the two phone widths that actually differ from
28
+ * them. Rendered as the "Width" group in the canvas tools menu, like the zoom
29
+ * chooser next to it.
30
+ */
31
+ export const VIEWPORT_SNAPS = [320, 390, 480, 640, 768, 1024];
32
+ /**
33
+ * `width` brought inside the legal range and onto a whole pixel.
34
+ *
35
+ * Lives next to the bounds, not the canvas snapping, because the service uses
36
+ * it to keep stored and programmatic widths legal and should not import from
37
+ * the canvas UI folder.
38
+ *
39
+ * Rounded, not truncated: the value is shown as a label on the canvas, and
40
+ * `389.6 px` during a drag looks like a rendering bug.
41
+ */
42
+ export function clampViewportWidth(width) {
43
+ return Math.round(Math.max(VIEWPORT_MIN, Math.min(VIEWPORT_MAX, width)));
44
+ }
File without changes
@@ -1,3 +1,3 @@
1
- export { createShowcaseStripTransformer, stripShowcaseDecorators, } from './showcase-strip.transformer.js';
2
- export { stripShowcaseFromDirectory, type StripResult, } from './strip-directory.js';
1
+ export { createShowcaseStripTransformer, stripShowcaseDecorators } from './showcase-strip.transformer.js';
2
+ export { type StripResult, stripShowcaseFromDirectory } from './strip-directory.js';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/transformer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,8BAA8B,EAC9B,uBAAuB,GACxB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,0BAA0B,EAC1B,KAAK,WAAW,GACjB,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/transformer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1G,OAAO,EAAE,KAAK,WAAW,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC"}
@@ -1,2 +1,2 @@
1
- export { createShowcaseStripTransformer, stripShowcaseDecorators, } from './showcase-strip.transformer.js';
2
- export { stripShowcaseFromDirectory, } from './strip-directory.js';
1
+ export { createShowcaseStripTransformer, stripShowcaseDecorators } from './showcase-strip.transformer.js';
2
+ export { stripShowcaseFromDirectory } from './strip-directory.js';
@@ -1 +1 @@
1
- {"version":3,"file":"showcase-strip.transformer.d.ts","sourceRoot":"","sources":["../../src/transformer/showcase-strip.transformer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAoN5B,wBAAgB,8BAA8B,IAAI,EAAE,CAAC,kBAAkB,CAAC,EAAE,CAAC,UAAU,CAAC,CA8CrF;AA6BD,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,MAAM,EACd,QAAQ,SAAY,GACnB,MAAM,CAgCR"}
1
+ {"version":3,"file":"showcase-strip.transformer.d.ts","sourceRoot":"","sources":["../../src/transformer/showcase-strip.transformer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAqK5B,wBAAgB,8BAA8B,IAAI,EAAE,CAAC,kBAAkB,CAAC,EAAE,CAAC,UAAU,CAAC,CA2CrF;AAyBD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,SAAY,GAAG,MAAM,CAyBpF"}
@@ -4,9 +4,7 @@ function isShowcaseModule(specifier) {
4
4
  return SHOWCASE_MODULE_PREFIXES.some((prefix) => specifier === prefix || specifier.startsWith(prefix + '/'));
5
5
  }
6
6
  function isShowcaseCall(expr, names) {
7
- return (ts.isCallExpression(expr) &&
8
- ts.isIdentifier(expr.expression) &&
9
- names.has(expr.expression.text));
7
+ return ts.isCallExpression(expr) && ts.isIdentifier(expr.expression) && names.has(expr.expression.text);
10
8
  }
11
9
  function isLoweredShowcaseCall(expr, names) {
12
10
  if (!ts.isCallExpression(expr))
@@ -15,21 +13,17 @@ function isLoweredShowcaseCall(expr, names) {
15
13
  }
16
14
  function tryHandleDecorateStatement(stmt, names, factory) {
17
15
  const expr = stmt.expression;
18
- if (!ts.isBinaryExpression(expr) ||
19
- expr.operatorToken.kind !== ts.SyntaxKind.EqualsToken) {
16
+ if (!ts.isBinaryExpression(expr) || expr.operatorToken.kind !== ts.SyntaxKind.EqualsToken) {
20
17
  return undefined;
21
18
  }
22
19
  const chain = [];
23
20
  let current = expr;
24
- while (ts.isBinaryExpression(current) &&
25
- current.operatorToken.kind === ts.SyntaxKind.EqualsToken) {
21
+ while (ts.isBinaryExpression(current) && current.operatorToken.kind === ts.SyntaxKind.EqualsToken) {
26
22
  chain.push(current);
27
23
  current = current.right;
28
24
  }
29
25
  const rhs = current;
30
- if (!ts.isCallExpression(rhs) ||
31
- !ts.isIdentifier(rhs.expression) ||
32
- rhs.expression.text !== '__decorate') {
26
+ if (!ts.isCallExpression(rhs) || !ts.isIdentifier(rhs.expression) || rhs.expression.text !== '__decorate') {
33
27
  return undefined;
34
28
  }
35
29
  const args = rhs.arguments;
@@ -55,9 +49,7 @@ function tryHandleDecorateStatement(stmt, names, factory) {
55
49
  return { action: 'replace', statement: newStmt };
56
50
  }
57
51
  function isShowcaseDecorator(d, names) {
58
- return (ts.isCallExpression(d.expression) &&
59
- ts.isIdentifier(d.expression.expression) &&
60
- names.has(d.expression.expression.text));
52
+ return ts.isCallExpression(d.expression) && ts.isIdentifier(d.expression.expression) && names.has(d.expression.expression.text);
61
53
  }
62
54
  function stripNativeDecorators(node, names, factory) {
63
55
  const decorators = ts.getDecorators(node);
@@ -128,8 +120,7 @@ export function createShowcaseStripTransformer() {
128
120
  continue;
129
121
  const decorateResult = tryHandleDecorateStatement(stmt, names, factory);
130
122
  if (decorateResult) {
131
- if (decorateResult.action === 'replace' &&
132
- decorateResult.statement) {
123
+ if (decorateResult.action === 'replace' && decorateResult.statement) {
133
124
  filtered.push(decorateResult.statement);
134
125
  }
135
126
  continue;
@@ -177,7 +168,7 @@ export function stripShowcaseDecorators(source, fileName = 'file.ts') {
177
168
  const leak = findShowcaseLeak(audited, importInfo.localNames);
178
169
  if (leak) {
179
170
  throw new Error(`[ng-prism] Showcase reference '${leak.name}' left in output after stripping at ${fileName}:${leak.line}. ` +
180
- `The Showcase import was removed but a reference remains — this would cause a ReferenceError at runtime. ` +
171
+ `The Showcase import was removed but a reference remains, which would cause a ReferenceError at runtime. ` +
181
172
  `This is a transformer bug; please report the input source.`);
182
173
  }
183
174
  return output;
@@ -1 +1 @@
1
- {"version":3,"file":"strip-directory.d.ts","sourceRoot":"","sources":["../../src/transformer/strip-directory.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;CACvB;AAID,wBAAsB,0BAA0B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAkBlF"}
1
+ {"version":3,"file":"strip-directory.d.ts","sourceRoot":"","sources":["../../src/transformer/strip-directory.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,WAAW;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;CACzB;AAID,wBAAsB,0BAA0B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAiBlF"}
@@ -1,12 +1,10 @@
1
1
  import { readdir, readFile, writeFile } from 'node:fs/promises';
2
- import { join, extname } from 'node:path';
2
+ import { extname, join } from 'node:path';
3
3
  import { stripShowcaseDecorators } from './showcase-strip.transformer.js';
4
4
  const JS_EXTENSIONS = new Set(['.js', '.mjs']);
5
5
  export async function stripShowcaseFromDirectory(dir) {
6
6
  const entries = await readdir(dir, { recursive: true });
7
- const files = entries
8
- .filter((entry) => JS_EXTENSIONS.has(extname(entry)))
9
- .map((entry) => join(dir, entry));
7
+ const files = entries.filter((entry) => JS_EXTENSIONS.has(extname(entry))).map((entry) => join(dir, entry));
10
8
  let strippedFiles = 0;
11
9
  for (const file of files) {
12
10
  const source = await readFile(file, 'utf-8');
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ng-prism/core",
3
- "version": "22.2.1",
4
- "description": "ng-prism — the Angular-native Storybook alternative. Lightweight component showcase with @Showcase decorator, no story files needed.",
3
+ "version": "22.4.0",
4
+ "description": "ng-prism: the Angular-native Storybook alternative. Lightweight component showcase with @Showcase decorator, no story files needed.",
5
5
  "keywords": [
6
6
  "ng-prism",
7
7
  "angular",
@@ -76,6 +76,7 @@
76
76
  "peerDependencies": {
77
77
  "@angular/core": ">=20.0.0",
78
78
  "@angular/common": ">=20.0.0",
79
+ "@angular/compiler": ">=20.0.0",
79
80
  "@angular-devkit/architect": ">=0.2000.0",
80
81
  "@angular-devkit/core": ">=20.0.0",
81
82
  "@angular-devkit/schematics": ">=20.0.0",
@@ -92,7 +93,9 @@
92
93
  }
93
94
  },
94
95
  "dependencies": {
96
+ "axe-core": "^4.11.1",
95
97
  "chokidar": "^5.0.0",
98
+ "jsonc-parser": "^3.3.1",
96
99
  "tslib": "^2.3.0"
97
100
  },
98
101
  "repository": {
@@ -1,10 +1,10 @@
1
1
  {
2
- "$schema": "../node_modules/@angular-devkit/schematics/collection-schema.json",
3
- "schematics": {
4
- "ng-add": {
5
- "description": "Set up ng-prism in an Angular workspace",
6
- "factory": "../dist/schematics/ng-add/index#ngAdd",
7
- "schema": "./ng-add/schema.json"
2
+ "$schema": "../node_modules/@angular-devkit/schematics/collection-schema.json",
3
+ "schematics": {
4
+ "ng-add": {
5
+ "description": "Set up ng-prism in an Angular workspace",
6
+ "factory": "../dist/schematics/ng-add/index#ngAdd",
7
+ "schema": "./ng-add/schema.json"
8
+ }
8
9
  }
9
- }
10
10
  }
@@ -1,15 +1,15 @@
1
1
  {
2
- "$schema": "../node_modules/@angular-devkit/schematics/collection-schema.json",
3
- "schematics": {
4
- "migration-v22-manifest-cache": {
5
- "version": "22.0.0-beta.0",
6
- "description": "Move generated prism-manifest.ts into <workspaceRoot>/ng-prism-cache/<prismProject>/ and resolve it via a wildcard tsconfig path mapping.",
7
- "factory": "../dist/schematics/migrations/v21-13-manifest-cache/index#migrate"
8
- },
9
- "migration-v22-cache-dir-rename": {
10
- "version": "22.0.0-beta.4",
11
- "description": "Rename the manifest cache directory from .ng-prism/ to ng-prism-cache/. The dot-prefixed name was silently excluded from @angular/build's watcher (hardcoded **/.*/** ignore pattern), so @Showcase decorator edits never triggered an HMR / reload.",
12
- "factory": "../dist/schematics/migrations/v22-0-cache-dir-rename/index#migrate"
2
+ "$schema": "../node_modules/@angular-devkit/schematics/collection-schema.json",
3
+ "schematics": {
4
+ "migration-v22-manifest-cache": {
5
+ "version": "22.0.0-beta.0",
6
+ "description": "Move generated prism-manifest.ts into <workspaceRoot>/ng-prism-cache/<prismProject>/ and resolve it via a wildcard tsconfig path mapping.",
7
+ "factory": "../dist/schematics/migrations/v21-13-manifest-cache/index#migrate"
8
+ },
9
+ "migration-v22-cache-dir-rename": {
10
+ "version": "22.0.0-beta.4",
11
+ "description": "Rename the manifest cache directory from .ng-prism/ to ng-prism-cache/. The dot-prefixed name was silently excluded from @angular/build's watcher (hardcoded **/.*/** ignore pattern), so @Showcase decorator edits never triggered an HMR / reload.",
12
+ "factory": "../dist/schematics/migrations/v22-0-cache-dir-rename/index#migrate"
13
+ }
13
14
  }
14
- }
15
15
  }
@@ -1,25 +1,25 @@
1
1
  {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "title": "ng-prism ng-add Schematic",
4
- "description": "Set up ng-prism in an Angular workspace",
5
- "type": "object",
6
- "properties": {
7
- "project": {
8
- "type": "string",
9
- "description": "The library project to set up ng-prism for",
10
- "x-prompt": "Which library project should ng-prism showcase?"
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "ng-prism ng-add Schematic",
4
+ "description": "Set up ng-prism in an Angular workspace",
5
+ "type": "object",
6
+ "properties": {
7
+ "project": {
8
+ "type": "string",
9
+ "description": "The library project to set up ng-prism for",
10
+ "x-prompt": "Which library project should ng-prism showcase?"
11
+ },
12
+ "port": {
13
+ "type": "number",
14
+ "default": 4400,
15
+ "description": "Dev server port for the Prism styleguide"
16
+ },
17
+ "zoneless": {
18
+ "type": "boolean",
19
+ "default": false,
20
+ "description": "Use zoneless change detection (no zone.js polyfill)"
21
+ }
11
22
  },
12
- "port": {
13
- "type": "number",
14
- "default": 4400,
15
- "description": "Dev server port for the Prism styleguide"
16
- },
17
- "zoneless": {
18
- "type": "boolean",
19
- "default": false,
20
- "description": "Use zoneless change detection (no zone.js polyfill)"
21
- }
22
- },
23
- "required": ["project"],
24
- "additionalProperties": false
23
+ "required": ["project"],
24
+ "additionalProperties": false
25
25
  }