ngwr 14.7.0 → 14.9.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 (482) hide show
  1. package/README.md +66 -332
  2. package/alert/styles/_index.scss +10 -0
  3. package/avatar/styles/_index.scss +18 -7
  4. package/badge/styles/_index.scss +7 -0
  5. package/badge/styles/_tag.scss +7 -1
  6. package/bar-chart/styles/_index.scss +1 -0
  7. package/button/styles/_index.scss +6 -0
  8. package/calendar-heatmap/styles/_index.scss +1 -0
  9. package/cascader/styles/_rules.scss +87 -15
  10. package/checkbox/styles/_index.scss +4 -0
  11. package/command-palette/styles/_index.scss +1 -1
  12. package/date-picker/styles/_index.scss +30 -0
  13. package/density/styles/_index.scss +4 -2
  14. package/divider/styles/_index.scss +2 -0
  15. package/donut-chart/styles/_index.scss +10 -0
  16. package/dropdown/styles/_index.scss +67 -5
  17. package/editor/styles/_index.scss +441 -0
  18. package/event-calendar/styles/_index.scss +209 -35
  19. package/fesm2022/ngwr-action-sheet-testing.mjs.map +1 -1
  20. package/fesm2022/ngwr-action-sheet.mjs +3 -3
  21. package/fesm2022/ngwr-action-sheet.mjs.map +1 -1
  22. package/fesm2022/ngwr-affix.mjs +3 -3
  23. package/fesm2022/ngwr-affix.mjs.map +1 -1
  24. package/fesm2022/ngwr-alert.mjs +3 -3
  25. package/fesm2022/ngwr-alert.mjs.map +1 -1
  26. package/fesm2022/ngwr-anchor.mjs +3 -3
  27. package/fesm2022/ngwr-anchor.mjs.map +1 -1
  28. package/fesm2022/ngwr-aurora.mjs +3 -3
  29. package/fesm2022/ngwr-aurora.mjs.map +1 -1
  30. package/fesm2022/ngwr-avatar.mjs +3 -3
  31. package/fesm2022/ngwr-avatar.mjs.map +1 -1
  32. package/fesm2022/ngwr-back-top.mjs +3 -3
  33. package/fesm2022/ngwr-back-top.mjs.map +1 -1
  34. package/fesm2022/ngwr-badge.mjs +28 -13
  35. package/fesm2022/ngwr-badge.mjs.map +1 -1
  36. package/fesm2022/ngwr-bar-chart-testing.mjs.map +1 -1
  37. package/fesm2022/ngwr-bar-chart.mjs +31 -6
  38. package/fesm2022/ngwr-bar-chart.mjs.map +1 -1
  39. package/fesm2022/ngwr-blur-text-testing.mjs.map +1 -1
  40. package/fesm2022/ngwr-blur-text.mjs +3 -3
  41. package/fesm2022/ngwr-blur-text.mjs.map +1 -1
  42. package/fesm2022/ngwr-border-glow-testing.mjs.map +1 -1
  43. package/fesm2022/ngwr-border-glow.mjs +3 -3
  44. package/fesm2022/ngwr-border-glow.mjs.map +1 -1
  45. package/fesm2022/ngwr-breadcrumbs.mjs +6 -6
  46. package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
  47. package/fesm2022/ngwr-burger.mjs +3 -3
  48. package/fesm2022/ngwr-burger.mjs.map +1 -1
  49. package/fesm2022/ngwr-button-testing.mjs.map +1 -1
  50. package/fesm2022/ngwr-button.mjs +6 -6
  51. package/fesm2022/ngwr-button.mjs.map +1 -1
  52. package/fesm2022/ngwr-calendar-heatmap-testing.mjs.map +1 -1
  53. package/fesm2022/ngwr-calendar-heatmap.mjs +61 -6
  54. package/fesm2022/ngwr-calendar-heatmap.mjs.map +1 -1
  55. package/fesm2022/ngwr-calendar-testing.mjs.map +1 -1
  56. package/fesm2022/ngwr-calendar.mjs +3 -3
  57. package/fesm2022/ngwr-calendar.mjs.map +1 -1
  58. package/fesm2022/ngwr-card.mjs +9 -9
  59. package/fesm2022/ngwr-card.mjs.map +1 -1
  60. package/fesm2022/ngwr-carousel-testing.mjs.map +1 -1
  61. package/fesm2022/ngwr-carousel.mjs +6 -6
  62. package/fesm2022/ngwr-carousel.mjs.map +1 -1
  63. package/fesm2022/ngwr-cascader-testing.mjs.map +1 -1
  64. package/fesm2022/ngwr-cascader.mjs +4 -4
  65. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  66. package/fesm2022/ngwr-checkbox-testing.mjs.map +1 -1
  67. package/fesm2022/ngwr-checkbox.mjs +18 -8
  68. package/fesm2022/ngwr-checkbox.mjs.map +1 -1
  69. package/fesm2022/ngwr-circular-text-testing.mjs.map +1 -1
  70. package/fesm2022/ngwr-circular-text.mjs +3 -3
  71. package/fesm2022/ngwr-circular-text.mjs.map +1 -1
  72. package/fesm2022/ngwr-click-spark.mjs +3 -3
  73. package/fesm2022/ngwr-click-spark.mjs.map +1 -1
  74. package/fesm2022/ngwr-clipboard.mjs +3 -3
  75. package/fesm2022/ngwr-clipboard.mjs.map +1 -1
  76. package/fesm2022/ngwr-collapse-testing.mjs.map +1 -1
  77. package/fesm2022/ngwr-collapse.mjs +9 -9
  78. package/fesm2022/ngwr-collapse.mjs.map +1 -1
  79. package/fesm2022/ngwr-color-picker-testing.mjs.map +1 -1
  80. package/fesm2022/ngwr-color-picker.mjs +6 -6
  81. package/fesm2022/ngwr-color-picker.mjs.map +1 -1
  82. package/fesm2022/ngwr-command-palette-testing.mjs.map +1 -1
  83. package/fesm2022/ngwr-command-palette.mjs +3 -3
  84. package/fesm2022/ngwr-command-palette.mjs.map +1 -1
  85. package/fesm2022/ngwr-compare.mjs +3 -3
  86. package/fesm2022/ngwr-compare.mjs.map +1 -1
  87. package/fesm2022/ngwr-confetti.mjs +3 -3
  88. package/fesm2022/ngwr-confetti.mjs.map +1 -1
  89. package/fesm2022/ngwr-config.mjs.map +1 -1
  90. package/fesm2022/ngwr-context-menu-testing.mjs.map +1 -1
  91. package/fesm2022/ngwr-context-menu.mjs +12 -12
  92. package/fesm2022/ngwr-context-menu.mjs.map +1 -1
  93. package/fesm2022/ngwr-cookie.mjs +3 -3
  94. package/fesm2022/ngwr-cookie.mjs.map +1 -1
  95. package/fesm2022/ngwr-counter.mjs +6 -6
  96. package/fesm2022/ngwr-counter.mjs.map +1 -1
  97. package/fesm2022/ngwr-date-adapters-fns.mjs +3 -3
  98. package/fesm2022/ngwr-date-adapters-fns.mjs.map +1 -1
  99. package/fesm2022/ngwr-date-adapters-luxon.mjs +3 -3
  100. package/fesm2022/ngwr-date-adapters-luxon.mjs.map +1 -1
  101. package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
  102. package/fesm2022/ngwr-date-picker.mjs +721 -62
  103. package/fesm2022/ngwr-date-picker.mjs.map +1 -1
  104. package/fesm2022/ngwr-date.mjs +3 -3
  105. package/fesm2022/ngwr-date.mjs.map +1 -1
  106. package/fesm2022/ngwr-decrypt-text-testing.mjs.map +1 -1
  107. package/fesm2022/ngwr-decrypt-text.mjs +3 -3
  108. package/fesm2022/ngwr-decrypt-text.mjs.map +1 -1
  109. package/fesm2022/ngwr-density.mjs +6 -6
  110. package/fesm2022/ngwr-density.mjs.map +1 -1
  111. package/fesm2022/ngwr-descriptions.mjs +6 -6
  112. package/fesm2022/ngwr-descriptions.mjs.map +1 -1
  113. package/fesm2022/ngwr-dialog-testing.mjs.map +1 -1
  114. package/fesm2022/ngwr-dialog.mjs +15 -15
  115. package/fesm2022/ngwr-dialog.mjs.map +1 -1
  116. package/fesm2022/ngwr-directives.mjs +12 -12
  117. package/fesm2022/ngwr-directives.mjs.map +1 -1
  118. package/fesm2022/ngwr-divider.mjs +3 -3
  119. package/fesm2022/ngwr-divider.mjs.map +1 -1
  120. package/fesm2022/ngwr-donut-chart-testing.mjs.map +1 -1
  121. package/fesm2022/ngwr-donut-chart.mjs +48 -6
  122. package/fesm2022/ngwr-donut-chart.mjs.map +1 -1
  123. package/fesm2022/ngwr-drag-drop.mjs +6 -6
  124. package/fesm2022/ngwr-drag-drop.mjs.map +1 -1
  125. package/fesm2022/ngwr-drawer-testing.mjs.map +1 -1
  126. package/fesm2022/ngwr-drawer.mjs +18 -18
  127. package/fesm2022/ngwr-drawer.mjs.map +1 -1
  128. package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
  129. package/fesm2022/ngwr-dropdown.mjs +174 -25
  130. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  131. package/fesm2022/ngwr-editor-testing.mjs +568 -0
  132. package/fesm2022/ngwr-editor-testing.mjs.map +1 -0
  133. package/fesm2022/ngwr-editor.mjs +2601 -0
  134. package/fesm2022/ngwr-editor.mjs.map +1 -0
  135. package/fesm2022/ngwr-empty.mjs +3 -3
  136. package/fesm2022/ngwr-empty.mjs.map +1 -1
  137. package/fesm2022/ngwr-event-calendar-testing.mjs.map +1 -1
  138. package/fesm2022/ngwr-event-calendar.mjs +14 -7
  139. package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
  140. package/fesm2022/ngwr-falling-text-testing.mjs.map +1 -1
  141. package/fesm2022/ngwr-falling-text.mjs +3 -3
  142. package/fesm2022/ngwr-falling-text.mjs.map +1 -1
  143. package/fesm2022/ngwr-file-upload-testing.mjs.map +1 -1
  144. package/fesm2022/ngwr-file-upload.mjs +3 -3
  145. package/fesm2022/ngwr-file-upload.mjs.map +1 -1
  146. package/fesm2022/ngwr-form-testing.mjs.map +1 -1
  147. package/fesm2022/ngwr-form.mjs +61 -10
  148. package/fesm2022/ngwr-form.mjs.map +1 -1
  149. package/fesm2022/ngwr-fuzzy-text-testing.mjs.map +1 -1
  150. package/fesm2022/ngwr-fuzzy-text.mjs +3 -3
  151. package/fesm2022/ngwr-fuzzy-text.mjs.map +1 -1
  152. package/fesm2022/ngwr-gauge-testing.mjs.map +1 -1
  153. package/fesm2022/ngwr-gauge.mjs +35 -6
  154. package/fesm2022/ngwr-gauge.mjs.map +1 -1
  155. package/fesm2022/ngwr-glitch-text-testing.mjs.map +1 -1
  156. package/fesm2022/ngwr-glitch-text.mjs +3 -3
  157. package/fesm2022/ngwr-glitch-text.mjs.map +1 -1
  158. package/fesm2022/ngwr-gradient-text-testing.mjs.map +1 -1
  159. package/fesm2022/ngwr-gradient-text.mjs +3 -3
  160. package/fesm2022/ngwr-gradient-text.mjs.map +1 -1
  161. package/fesm2022/ngwr-graph-testing.mjs.map +1 -1
  162. package/fesm2022/ngwr-graph.mjs +6 -6
  163. package/fesm2022/ngwr-graph.mjs.map +1 -1
  164. package/fesm2022/ngwr-hotkey.mjs +6 -6
  165. package/fesm2022/ngwr-hotkey.mjs.map +1 -1
  166. package/fesm2022/ngwr-i18n-ar.mjs +31 -0
  167. package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
  168. package/fesm2022/ngwr-i18n-cs.mjs +31 -0
  169. package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
  170. package/fesm2022/ngwr-i18n-de.mjs +31 -0
  171. package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
  172. package/fesm2022/ngwr-i18n-en.mjs +39 -0
  173. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  174. package/fesm2022/ngwr-i18n-es.mjs +31 -0
  175. package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
  176. package/fesm2022/ngwr-i18n-fr.mjs +31 -0
  177. package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
  178. package/fesm2022/ngwr-i18n-he.mjs +31 -0
  179. package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
  180. package/fesm2022/ngwr-i18n-hi.mjs +31 -0
  181. package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
  182. package/fesm2022/ngwr-i18n-id.mjs +31 -0
  183. package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
  184. package/fesm2022/ngwr-i18n-it.mjs +31 -0
  185. package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
  186. package/fesm2022/ngwr-i18n-ja.mjs +31 -0
  187. package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
  188. package/fesm2022/ngwr-i18n-ko.mjs +31 -0
  189. package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
  190. package/fesm2022/ngwr-i18n-nl.mjs +31 -0
  191. package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
  192. package/fesm2022/ngwr-i18n-pl.mjs +31 -0
  193. package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
  194. package/fesm2022/ngwr-i18n-pt.mjs +31 -0
  195. package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
  196. package/fesm2022/ngwr-i18n-ru.mjs +31 -0
  197. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  198. package/fesm2022/ngwr-i18n-sv.mjs +31 -0
  199. package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
  200. package/fesm2022/ngwr-i18n-tr.mjs +31 -0
  201. package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
  202. package/fesm2022/ngwr-i18n-uk.mjs +31 -0
  203. package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
  204. package/fesm2022/ngwr-i18n-vi.mjs +31 -0
  205. package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
  206. package/fesm2022/ngwr-i18n-zh-TW.mjs +31 -0
  207. package/fesm2022/ngwr-i18n-zh-TW.mjs.map +1 -1
  208. package/fesm2022/ngwr-i18n-zh.mjs +31 -0
  209. package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
  210. package/fesm2022/ngwr-i18n.mjs +9 -9
  211. package/fesm2022/ngwr-i18n.mjs.map +1 -1
  212. package/fesm2022/ngwr-icon-adapters-feather.mjs.map +1 -1
  213. package/fesm2022/ngwr-icon-adapters-lucide.mjs.map +1 -1
  214. package/fesm2022/ngwr-icon.mjs +6 -6
  215. package/fesm2022/ngwr-icon.mjs.map +1 -1
  216. package/fesm2022/ngwr-image-cropper-testing.mjs.map +1 -1
  217. package/fesm2022/ngwr-image-cropper.mjs +3 -3
  218. package/fesm2022/ngwr-image-cropper.mjs.map +1 -1
  219. package/fesm2022/ngwr-input-number-testing.mjs.map +1 -1
  220. package/fesm2022/ngwr-input-number.mjs +15 -3
  221. package/fesm2022/ngwr-input-number.mjs.map +1 -1
  222. package/fesm2022/ngwr-input-otp-testing.mjs.map +1 -1
  223. package/fesm2022/ngwr-input-otp.mjs +3 -3
  224. package/fesm2022/ngwr-input-otp.mjs.map +1 -1
  225. package/fesm2022/ngwr-input-testing.mjs.map +1 -1
  226. package/fesm2022/ngwr-input.mjs +15 -15
  227. package/fesm2022/ngwr-input.mjs.map +1 -1
  228. package/fesm2022/ngwr-keyboard.mjs +3 -3
  229. package/fesm2022/ngwr-keyboard.mjs.map +1 -1
  230. package/fesm2022/ngwr-knob-testing.mjs.map +1 -1
  231. package/fesm2022/ngwr-knob.mjs +3 -3
  232. package/fesm2022/ngwr-knob.mjs.map +1 -1
  233. package/fesm2022/ngwr-layout.mjs +15 -15
  234. package/fesm2022/ngwr-layout.mjs.map +1 -1
  235. package/fesm2022/ngwr-lightbox-testing.mjs.map +1 -1
  236. package/fesm2022/ngwr-lightbox.mjs +3 -3
  237. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  238. package/fesm2022/ngwr-line-chart-testing.mjs.map +1 -1
  239. package/fesm2022/ngwr-line-chart.mjs +18 -7
  240. package/fesm2022/ngwr-line-chart.mjs.map +1 -1
  241. package/fesm2022/ngwr-list.mjs +6 -6
  242. package/fesm2022/ngwr-list.mjs.map +1 -1
  243. package/fesm2022/ngwr-loading-bar-router.mjs.map +1 -1
  244. package/fesm2022/ngwr-loading-bar.mjs +6 -6
  245. package/fesm2022/ngwr-loading-bar.mjs.map +1 -1
  246. package/fesm2022/ngwr-markdown-testing.mjs.map +1 -1
  247. package/fesm2022/ngwr-markdown.mjs +798 -17
  248. package/fesm2022/ngwr-markdown.mjs.map +1 -1
  249. package/fesm2022/ngwr-marquee-testing.mjs.map +1 -1
  250. package/fesm2022/ngwr-marquee.mjs +3 -3
  251. package/fesm2022/ngwr-marquee.mjs.map +1 -1
  252. package/fesm2022/ngwr-media.mjs +3 -3
  253. package/fesm2022/ngwr-media.mjs.map +1 -1
  254. package/fesm2022/ngwr-mention-testing.mjs.map +1 -1
  255. package/fesm2022/ngwr-mention.mjs +6 -6
  256. package/fesm2022/ngwr-mention.mjs.map +1 -1
  257. package/fesm2022/ngwr-meta.mjs +6 -6
  258. package/fesm2022/ngwr-meta.mjs.map +1 -1
  259. package/fesm2022/ngwr-meter-group-testing.mjs +7 -3
  260. package/fesm2022/ngwr-meter-group-testing.mjs.map +1 -1
  261. package/fesm2022/ngwr-meter-group.mjs +26 -6
  262. package/fesm2022/ngwr-meter-group.mjs.map +1 -1
  263. package/fesm2022/ngwr-overlay.mjs +6 -6
  264. package/fesm2022/ngwr-overlay.mjs.map +1 -1
  265. package/fesm2022/ngwr-page-header.mjs +13 -5
  266. package/fesm2022/ngwr-page-header.mjs.map +1 -1
  267. package/fesm2022/ngwr-pagination-testing.mjs.map +1 -1
  268. package/fesm2022/ngwr-pagination.mjs +3 -3
  269. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  270. package/fesm2022/ngwr-pipes.mjs +21 -21
  271. package/fesm2022/ngwr-pipes.mjs.map +1 -1
  272. package/fesm2022/ngwr-platform.mjs +9 -9
  273. package/fesm2022/ngwr-platform.mjs.map +1 -1
  274. package/fesm2022/ngwr-popconfirm-testing.mjs.map +1 -1
  275. package/fesm2022/ngwr-popconfirm.mjs +6 -6
  276. package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
  277. package/fesm2022/ngwr-popover-testing.mjs.map +1 -1
  278. package/fesm2022/ngwr-popover.mjs +578 -16
  279. package/fesm2022/ngwr-popover.mjs.map +1 -1
  280. package/fesm2022/ngwr-progress.mjs +3 -3
  281. package/fesm2022/ngwr-progress.mjs.map +1 -1
  282. package/fesm2022/ngwr-pull-to-refresh.mjs +3 -3
  283. package/fesm2022/ngwr-pull-to-refresh.mjs.map +1 -1
  284. package/fesm2022/ngwr-qr.mjs +3 -3
  285. package/fesm2022/ngwr-qr.mjs.map +1 -1
  286. package/fesm2022/ngwr-radio-testing.mjs.map +1 -1
  287. package/fesm2022/ngwr-radio.mjs +6 -6
  288. package/fesm2022/ngwr-radio.mjs.map +1 -1
  289. package/fesm2022/ngwr-rating-testing.mjs.map +1 -1
  290. package/fesm2022/ngwr-rating.mjs +3 -3
  291. package/fesm2022/ngwr-rating.mjs.map +1 -1
  292. package/fesm2022/ngwr-result.mjs +12 -12
  293. package/fesm2022/ngwr-result.mjs.map +1 -1
  294. package/fesm2022/ngwr-rotating-text-testing.mjs.map +1 -1
  295. package/fesm2022/ngwr-rotating-text.mjs +3 -3
  296. package/fesm2022/ngwr-rotating-text.mjs.map +1 -1
  297. package/fesm2022/ngwr-schema-form.mjs +3 -3
  298. package/fesm2022/ngwr-schema-form.mjs.map +1 -1
  299. package/fesm2022/ngwr-scroll.mjs +3 -3
  300. package/fesm2022/ngwr-scroll.mjs.map +1 -1
  301. package/fesm2022/ngwr-segmented-testing.mjs.map +1 -1
  302. package/fesm2022/ngwr-segmented.mjs +3 -3
  303. package/fesm2022/ngwr-segmented.mjs.map +1 -1
  304. package/fesm2022/ngwr-select-testing.mjs.map +1 -1
  305. package/fesm2022/ngwr-select.mjs +12 -12
  306. package/fesm2022/ngwr-select.mjs.map +1 -1
  307. package/fesm2022/ngwr-shiny-text-testing.mjs.map +1 -1
  308. package/fesm2022/ngwr-shiny-text.mjs +6 -6
  309. package/fesm2022/ngwr-shiny-text.mjs.map +1 -1
  310. package/fesm2022/ngwr-sidebar.mjs +10 -3
  311. package/fesm2022/ngwr-sidebar.mjs.map +1 -1
  312. package/fesm2022/ngwr-skeleton.mjs +3 -3
  313. package/fesm2022/ngwr-skeleton.mjs.map +1 -1
  314. package/fesm2022/ngwr-slider-testing.mjs.map +1 -1
  315. package/fesm2022/ngwr-slider.mjs +3 -3
  316. package/fesm2022/ngwr-slider.mjs.map +1 -1
  317. package/fesm2022/ngwr-sparkline-testing.mjs.map +1 -1
  318. package/fesm2022/ngwr-sparkline.mjs +84 -10
  319. package/fesm2022/ngwr-sparkline.mjs.map +1 -1
  320. package/fesm2022/ngwr-speed-dial-testing.mjs.map +1 -1
  321. package/fesm2022/ngwr-speed-dial.mjs +3 -3
  322. package/fesm2022/ngwr-speed-dial.mjs.map +1 -1
  323. package/fesm2022/ngwr-spinner.mjs +3 -3
  324. package/fesm2022/ngwr-spinner.mjs.map +1 -1
  325. package/fesm2022/ngwr-splash-cursor-testing.mjs.map +1 -1
  326. package/fesm2022/ngwr-splash-cursor.mjs +3 -3
  327. package/fesm2022/ngwr-splash-cursor.mjs.map +1 -1
  328. package/fesm2022/ngwr-split-text-testing.mjs.map +1 -1
  329. package/fesm2022/ngwr-split-text.mjs +3 -3
  330. package/fesm2022/ngwr-split-text.mjs.map +1 -1
  331. package/fesm2022/ngwr-splitter-testing.mjs.map +1 -1
  332. package/fesm2022/ngwr-splitter.mjs +3 -3
  333. package/fesm2022/ngwr-splitter.mjs.map +1 -1
  334. package/fesm2022/ngwr-spotlight-card-testing.mjs.map +1 -1
  335. package/fesm2022/ngwr-spotlight-card.mjs +6 -6
  336. package/fesm2022/ngwr-spotlight-card.mjs.map +1 -1
  337. package/fesm2022/ngwr-squircle.mjs +6 -6
  338. package/fesm2022/ngwr-squircle.mjs.map +1 -1
  339. package/fesm2022/ngwr-star-border-testing.mjs.map +1 -1
  340. package/fesm2022/ngwr-star-border.mjs +3 -3
  341. package/fesm2022/ngwr-star-border.mjs.map +1 -1
  342. package/fesm2022/ngwr-statistic.mjs +9 -9
  343. package/fesm2022/ngwr-statistic.mjs.map +1 -1
  344. package/fesm2022/ngwr-stepper-testing.mjs.map +1 -1
  345. package/fesm2022/ngwr-stepper.mjs +6 -6
  346. package/fesm2022/ngwr-stepper.mjs.map +1 -1
  347. package/fesm2022/ngwr-storage.mjs +3 -3
  348. package/fesm2022/ngwr-storage.mjs.map +1 -1
  349. package/fesm2022/ngwr-switch-testing.mjs.map +1 -1
  350. package/fesm2022/ngwr-switch.mjs +3 -3
  351. package/fesm2022/ngwr-switch.mjs.map +1 -1
  352. package/fesm2022/ngwr-table-testing.mjs.map +1 -1
  353. package/fesm2022/ngwr-table.mjs +18 -18
  354. package/fesm2022/ngwr-table.mjs.map +1 -1
  355. package/fesm2022/ngwr-tabs-router.mjs +3 -3
  356. package/fesm2022/ngwr-tabs-router.mjs.map +1 -1
  357. package/fesm2022/ngwr-tabs-testing.mjs.map +1 -1
  358. package/fesm2022/ngwr-tabs.mjs +6 -6
  359. package/fesm2022/ngwr-tabs.mjs.map +1 -1
  360. package/fesm2022/ngwr-textarea-testing.mjs.map +1 -1
  361. package/fesm2022/ngwr-textarea.mjs +3 -3
  362. package/fesm2022/ngwr-textarea.mjs.map +1 -1
  363. package/fesm2022/ngwr-theme.mjs +3 -3
  364. package/fesm2022/ngwr-theme.mjs.map +1 -1
  365. package/fesm2022/ngwr-tilt-card-testing.mjs.map +1 -1
  366. package/fesm2022/ngwr-tilt-card.mjs +6 -6
  367. package/fesm2022/ngwr-tilt-card.mjs.map +1 -1
  368. package/fesm2022/ngwr-timeline.mjs +6 -6
  369. package/fesm2022/ngwr-timeline.mjs.map +1 -1
  370. package/fesm2022/ngwr-toast-testing.mjs.map +1 -1
  371. package/fesm2022/ngwr-toast.mjs +9 -9
  372. package/fesm2022/ngwr-toast.mjs.map +1 -1
  373. package/fesm2022/ngwr-toolbar.mjs +10 -3
  374. package/fesm2022/ngwr-toolbar.mjs.map +1 -1
  375. package/fesm2022/ngwr-tour-testing.mjs.map +1 -1
  376. package/fesm2022/ngwr-tour.mjs +6 -6
  377. package/fesm2022/ngwr-tour.mjs.map +1 -1
  378. package/fesm2022/ngwr-transfer-testing.mjs.map +1 -1
  379. package/fesm2022/ngwr-transfer.mjs +3 -3
  380. package/fesm2022/ngwr-transfer.mjs.map +1 -1
  381. package/fesm2022/ngwr-tree-testing.mjs.map +1 -1
  382. package/fesm2022/ngwr-tree.mjs +3 -3
  383. package/fesm2022/ngwr-tree.mjs.map +1 -1
  384. package/fesm2022/ngwr-typewriter-testing.mjs.map +1 -1
  385. package/fesm2022/ngwr-typewriter.mjs +3 -3
  386. package/fesm2022/ngwr-typewriter.mjs.map +1 -1
  387. package/fesm2022/ngwr-typography.mjs +7 -3
  388. package/fesm2022/ngwr-typography.mjs.map +1 -1
  389. package/fesm2022/ngwr-utils.mjs.map +1 -1
  390. package/fesm2022/ngwr-validators.mjs.map +1 -1
  391. package/fesm2022/ngwr-version.mjs +1 -1
  392. package/fesm2022/ngwr-version.mjs.map +1 -1
  393. package/fesm2022/ngwr-virtual-scroll.mjs +3 -3
  394. package/fesm2022/ngwr-virtual-scroll.mjs.map +1 -1
  395. package/fesm2022/ngwr-waves-testing.mjs.map +1 -1
  396. package/fesm2022/ngwr-waves.mjs +3 -3
  397. package/fesm2022/ngwr-waves.mjs.map +1 -1
  398. package/fesm2022/ngwr-window-testing.mjs.map +1 -1
  399. package/fesm2022/ngwr-window.mjs +12 -12
  400. package/fesm2022/ngwr-window.mjs.map +1 -1
  401. package/form/styles/_index.scss +16 -1
  402. package/gauge/styles/_index.scss +1 -0
  403. package/i18n/ar.json +32 -1
  404. package/i18n/cs.json +32 -1
  405. package/i18n/de.json +32 -1
  406. package/i18n/en.json +32 -1
  407. package/i18n/es.json +32 -1
  408. package/i18n/fr.json +32 -1
  409. package/i18n/he.json +32 -1
  410. package/i18n/hi.json +32 -1
  411. package/i18n/id.json +32 -1
  412. package/i18n/it.json +32 -1
  413. package/i18n/ja.json +32 -1
  414. package/i18n/ko.json +32 -1
  415. package/i18n/nl.json +32 -1
  416. package/i18n/pl.json +32 -1
  417. package/i18n/pt.json +32 -1
  418. package/i18n/ru.json +32 -1
  419. package/i18n/sv.json +32 -1
  420. package/i18n/tr.json +32 -1
  421. package/i18n/uk.json +32 -1
  422. package/i18n/vi.json +32 -1
  423. package/i18n/zh-TW.json +32 -1
  424. package/i18n/zh.json +32 -1
  425. package/input/styles/_index.scss +24 -1
  426. package/input-number/styles/_index.scss +69 -0
  427. package/input-otp/styles/_index.scss +5 -5
  428. package/line-chart/styles/_index.scss +30 -2
  429. package/llms-full.txt +14 -4
  430. package/llms.txt +188 -132
  431. package/mcp/providers.js +2 -2
  432. package/mcp/server.js +1 -1
  433. package/meter-group/styles/_index.scss +1 -0
  434. package/overlay/styles/_arrow.scss +30 -2
  435. package/package.json +43 -2
  436. package/page-header/styles/_index.scss +37 -1
  437. package/pagination/styles/_index.scss +9 -5
  438. package/popover/styles/_index.scss +73 -5
  439. package/progress/styles/_index.scss +4 -0
  440. package/radio/styles/_index.scss +4 -1
  441. package/schematics/use/symbol-map.json +1 -0
  442. package/select/styles/_index.scss +51 -12
  443. package/sidebar/styles/_index.scss +44 -2
  444. package/skeleton/styles/_index.scss +3 -0
  445. package/skills/ngwr/SKILL.md +5 -5
  446. package/skills/ngwr/references/catalog.md +2 -0
  447. package/skills/ngwr/references/setup.md +3 -3
  448. package/sparkline/styles/_index.scss +19 -0
  449. package/styles.scss +1 -0
  450. package/table/styles/_index.scss +7 -0
  451. package/textarea/styles/_index.scss +12 -3
  452. package/theme/styles/_colors.scss +39 -13
  453. package/theme/styles/_contrast.scss +9 -7
  454. package/toast/styles/_index.scss +4 -0
  455. package/toolbar/styles/_index.scss +35 -1
  456. package/tree/styles/_index.scss +46 -7
  457. package/types/ngwr-badge.d.ts +22 -7
  458. package/types/ngwr-bar-chart.d.ts +19 -1
  459. package/types/ngwr-calendar-heatmap.d.ts +29 -1
  460. package/types/ngwr-checkbox.d.ts +2 -0
  461. package/types/ngwr-config.d.ts +12 -0
  462. package/types/ngwr-date-picker.d.ts +308 -43
  463. package/types/ngwr-donut-chart.d.ts +24 -1
  464. package/types/ngwr-dropdown.d.ts +22 -2
  465. package/types/ngwr-editor-testing.d.ts +378 -0
  466. package/types/ngwr-editor.d.ts +449 -0
  467. package/types/ngwr-event-calendar.d.ts +8 -0
  468. package/types/ngwr-form.d.ts +35 -5
  469. package/types/ngwr-gauge.d.ts +20 -1
  470. package/types/ngwr-input-number.d.ts +7 -0
  471. package/types/ngwr-line-chart.d.ts +9 -1
  472. package/types/ngwr-markdown.d.ts +61 -2
  473. package/types/ngwr-meter-group-testing.d.ts +3 -2
  474. package/types/ngwr-meter-group.d.ts +14 -1
  475. package/types/ngwr-page-header.d.ts +10 -2
  476. package/types/ngwr-popover.d.ts +154 -3
  477. package/types/ngwr-sidebar.d.ts +7 -0
  478. package/types/ngwr-sparkline.d.ts +43 -1
  479. package/types/ngwr-toolbar.d.ts +7 -0
  480. package/types/ngwr-typography.d.ts +4 -0
  481. package/types/ngwr-version.d.ts +1 -1
  482. package/typography/styles/_index.scss +16 -0
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-fuzzy-text.mjs","sources":["../../../projects/lib/fuzzy-text/fuzzy-text.ts","../../../projects/lib/fuzzy-text/ngwr-fuzzy-text.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n *\n * Angular adaptation of the FuzzyText effect by David Haz / reactbits.dev.\n * Original: https://www.reactbits.dev/text-animations/fuzzy-text\n *\n * Renders text to an offscreen 2D canvas, then redraws it onto the\n * visible canvas one row (or column) at a time with random horizontal /\n * vertical offsets. Intensity reacts to hover / click / glitch state.\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { isPlatformBrowser } from '@angular/common';\nimport type { ElementRef } from '@angular/core';\nimport {\n Component,\n DestroyRef,\n PLATFORM_ID,\n ViewEncapsulation,\n afterNextRender,\n effect,\n inject,\n input,\n viewChild,\n} from '@angular/core';\n\nimport { WrPlatform } from 'ngwr/platform';\nimport { numAttr } from 'ngwr/utils';\n\nimport type { WrFuzzyTextDirection } from './interfaces';\n\n/**\n * Canvas-rendered \"fuzzy\" text — each row/column of glyphs is offset by\n * a random amount per frame, giving the text a TV-static or motion-blur\n * appearance. Intensity ramps up on hover, click, and during periodic\n * glitch bursts (configurable).\n *\n * @example\n * ```html\n * <wr-fuzzy-text text=\"404\" />\n * <wr-fuzzy-text\n * text=\"HELLO\"\n * color=\"#0ea5e9\"\n * [fuzzRange]=\"50\"\n * [hoverIntensity]=\"0.8\"\n * [glitchMode]=\"true\"\n * />\n * ```\n *\n * @see https://www.reactbits.dev/text-animations/fuzzy-text\n */\n@Component({\n selector: 'wr-fuzzy-text',\n // The text is drawn into the canvas as PIXELS, so without the first span there is\n // nothing for a screen reader to read at all — the same layer `wr-rotating-text`\n // and `wr-decrypt-text` carry. Hidden inline rather than through a class: this\n // entry point ships no stylesheet, and a consumer who imported none would\n // otherwise see the text twice.\n //\n // BOUND, not a static `style=\"…\"` attribute. A real attribute is refused under\n // `style-src 'self'`, and what is lost there is not a colour: the span drops\n // every visual-hiding declaration and the word renders on screen beside the\n // canvas that already draws it. A binding goes through `style.setProperty`,\n // which is CSSOM and outside CSP's reach.\n template:\n '<span class=\"wr-fuzzy-text__sr-only\" [style]=\"srOnly\">{{ text() }}</span>' +\n '<canvas #canvas aria-hidden=\"true\"></canvas>',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-fuzzy-text', '[style.color]': \"'var(--wr-color-dark)'\" },\n})\nexport class WrFuzzyText {\n /**\n * Visual-hiding declarations for the screen-reader copy of the text. A stable\n * object literal, so the binding is written once rather than on every pass.\n */\n protected readonly srOnly: Readonly<Record<string, string>> = {\n position: 'absolute',\n width: '1px',\n height: '1px',\n overflow: 'hidden',\n 'clip-path': 'inset(50%)',\n 'white-space': 'nowrap',\n };\n\n /** Text to render. */\n readonly text = input.required<string>();\n\n /** Font size as CSS length (`'4rem'`, `'72px'`, …) or px number. @default 'clamp(2rem, 10vw, 10rem)' */\n readonly fontSize = input<string | number>('clamp(2rem, 10vw, 10rem)');\n\n /** Font weight. @default 900 */\n readonly fontWeight = input<number | string>(900);\n\n /** Font family. `'inherit'` reads the canvas's computed style. @default 'inherit' */\n readonly fontFamily = input('inherit');\n\n /** Text colour. `'inherit'` reads the canvas's computed style. Ignored if `[gradient]` is set. @default 'inherit' */\n readonly color = input('inherit');\n\n /** Optional horizontal gradient stops. */\n readonly gradient = input<readonly string[] | null>(null);\n\n /** Enable hover / touch reactivity. @default true */\n readonly enableHover = input(true, { transform: coerceBooleanProperty });\n\n /** Base intensity (0..1) when idle. @default 0.18 */\n readonly baseIntensity = input(0.18, { transform: numAttr(0.18) });\n\n /** Intensity (0..1) while the pointer hovers the text. @default 0.5 */\n readonly hoverIntensity = input(0.5, { transform: numAttr(0.5) });\n\n /** Max pixel displacement per row/column at intensity 1. @default 30 */\n readonly fuzzRange = input(30, { transform: numAttr(30) });\n\n /** Frame rate cap. @default 60 */\n readonly fps = input(60, { transform: numAttr(60) });\n\n /** Fuzz direction. @default 'horizontal' */\n readonly direction = input<WrFuzzyTextDirection>('horizontal');\n\n /** Ms to ease intensity toward target. `0` snaps. @default 0 */\n readonly transitionDuration = input(0, { transform: numAttr(0) });\n\n /** Spike to full intensity briefly on click. @default false */\n readonly clickEffect = input(false, { transform: coerceBooleanProperty });\n\n /** Periodic \"glitch\" bursts at full intensity. @default false */\n readonly glitchMode = input(false, { transform: coerceBooleanProperty });\n\n /** Ms between glitch bursts. @default 2000 */\n readonly glitchInterval = input(2000, { transform: numAttr(2000) });\n\n /** Ms a glitch burst lasts. @default 200 */\n readonly glitchDuration = input(200, { transform: numAttr(200) });\n\n /** Extra pixels between glyphs. @default 0 */\n readonly letterSpacing = input(0, { transform: numAttr(0) });\n\n private readonly canvasRef = viewChild.required<ElementRef<HTMLCanvasElement>>('canvas');\n\n private readonly destroyRef = inject(DestroyRef);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n private readonly platform = inject(WrPlatform);\n\n private teardown: (() => void) | undefined;\n\n /**\n * `init()` suspends on font loading, so the component can be destroyed while\n * it is awaiting. At that moment `teardown` is still undefined, so the\n * destroy hook has nothing to call — and everything the rest of `init()`\n * starts (the rAF loop, the glitch timers, canvas listeners) would run for\n * the life of the page. This flag lets the continuation bail out.\n */\n private destroyed = false;\n\n constructor() {\n if (!this.isBrowser) return;\n\n afterNextRender(() => {\n void this.init();\n });\n\n // Re-init whenever any input that affects the offscreen rendering changes.\n effect(() => {\n this.text();\n this.fontSize();\n this.fontWeight();\n this.fontFamily();\n this.color();\n this.gradient();\n this.letterSpacing();\n this.direction();\n this.fuzzRange();\n this.fps();\n this.glitchMode();\n this.glitchInterval();\n this.glitchDuration();\n // Skip if we haven't booted yet.\n if (!this.teardown) return;\n this.teardown();\n this.teardown = undefined;\n queueMicrotask(() => {\n void this.init();\n });\n });\n\n this.destroyRef.onDestroy(() => {\n this.destroyed = true;\n this.teardown?.();\n });\n }\n\n // Init / loop\n\n private async init(): Promise<void> {\n const canvas = this.canvasRef().nativeElement;\n const ctx = canvas.getContext('2d');\n if (!ctx) return;\n\n const fontFamily =\n this.fontFamily() === 'inherit' ? window.getComputedStyle(canvas).fontFamily || 'sans-serif' : this.fontFamily();\n const color = this.color() === 'inherit' ? window.getComputedStyle(canvas).color || '#fff' : this.color();\n const fontSize = this.fontSize();\n const fontSizeStr = typeof fontSize === 'number' ? `${fontSize}px` : fontSize;\n const fontWeight = this.fontWeight();\n const fontString = `${fontWeight} ${fontSizeStr} ${fontFamily}`;\n\n try {\n await document.fonts.load(fontString);\n } catch {\n await document.fonts.ready;\n }\n\n // Destroyed while the fonts were loading — nothing below may start.\n if (this.destroyed) return;\n\n // Numeric font size for buffer maths.\n let numericFontSize: number;\n if (typeof fontSize === 'number') {\n numericFontSize = fontSize;\n } else {\n const tmp = document.createElement('span');\n tmp.style.fontSize = fontSize;\n document.body.appendChild(tmp);\n numericFontSize = Number.parseFloat(window.getComputedStyle(tmp).fontSize);\n document.body.removeChild(tmp);\n }\n\n const text = this.text();\n const letterSpacing = this.letterSpacing();\n const fuzzRange = this.fuzzRange();\n const direction = this.direction();\n\n // Offscreen canvas with the laid-out text.\n const offscreen = document.createElement('canvas');\n const offCtx = offscreen.getContext('2d');\n if (!offCtx) return;\n offCtx.font = fontString;\n offCtx.textBaseline = 'alphabetic';\n\n let totalWidth = 0;\n if (letterSpacing !== 0) {\n for (const ch of text) totalWidth += offCtx.measureText(ch).width + letterSpacing;\n totalWidth -= letterSpacing;\n } else {\n totalWidth = offCtx.measureText(text).width;\n }\n const m = offCtx.measureText(text);\n const actualLeft = m.actualBoundingBoxLeft ?? 0;\n const actualRight = letterSpacing !== 0 ? totalWidth : (m.actualBoundingBoxRight ?? m.width);\n const actualAscent = m.actualBoundingBoxAscent ?? numericFontSize;\n const actualDescent = m.actualBoundingBoxDescent ?? numericFontSize * 0.2;\n const textBoundingWidth = Math.ceil(letterSpacing !== 0 ? totalWidth : actualLeft + actualRight);\n const tightHeight = Math.ceil(actualAscent + actualDescent);\n\n const extraWidthBuffer = 10;\n const offscreenWidth = textBoundingWidth + extraWidthBuffer;\n offscreen.width = offscreenWidth;\n offscreen.height = tightHeight;\n const xOffset = extraWidthBuffer / 2;\n\n offCtx.font = fontString;\n offCtx.textBaseline = 'alphabetic';\n\n const gradient = this.gradient();\n if (gradient && gradient.length >= 2) {\n const g = offCtx.createLinearGradient(0, 0, offscreenWidth, 0);\n gradient.forEach((c, i) => g.addColorStop(i / (gradient.length - 1), c));\n offCtx.fillStyle = g;\n } else {\n offCtx.fillStyle = color;\n }\n\n if (letterSpacing !== 0) {\n let xPos = xOffset;\n for (const ch of text) {\n offCtx.fillText(ch, xPos, actualAscent);\n xPos += offCtx.measureText(ch).width + letterSpacing;\n }\n } else {\n offCtx.fillText(text, xOffset - actualLeft, actualAscent);\n }\n\n // Size the visible canvas, leaving room for the max horizontal fuzz.\n const horizontalMargin = fuzzRange + 20;\n const verticalMargin = 0;\n canvas.width = offscreenWidth + horizontalMargin * 2;\n canvas.height = tightHeight + verticalMargin * 2;\n ctx.translate(horizontalMargin, verticalMargin);\n\n const interactiveLeft = horizontalMargin + xOffset;\n const interactiveTop = verticalMargin;\n const interactiveRight = interactiveLeft + textBoundingWidth;\n const interactiveBottom = interactiveTop + tightHeight;\n\n // Reduced motion: paint the text once, clean — no fuzz loop, no\n // glitch bursts, no pointer reactivity. Teardown must still be set\n // so the re-init effect keeps redrawing on input changes.\n if (this.platform.prefersReducedMotion()) {\n ctx.drawImage(offscreen, 0, 0);\n this.teardown = (): void => undefined;\n return;\n }\n\n let isHovering = false;\n let isClicking = false;\n let isGlitching = false;\n let currentIntensity = this.baseIntensity();\n let targetIntensity = currentIntensity;\n let lastFrame = 0;\n const frameDuration = 1000 / this.fps();\n\n let rafId = 0;\n let glitchOnTimer: ReturnType<typeof setTimeout> | undefined;\n let glitchOffTimer: ReturnType<typeof setTimeout> | undefined;\n let clickTimer: ReturnType<typeof setTimeout> | undefined;\n\n const startGlitchLoop = (): void => {\n if (!this.glitchMode()) return;\n glitchOnTimer = setTimeout(() => {\n isGlitching = true;\n glitchOffTimer = setTimeout(() => {\n isGlitching = false;\n startGlitchLoop();\n }, this.glitchDuration());\n }, this.glitchInterval());\n };\n if (this.glitchMode()) startGlitchLoop();\n\n const run = (ts: number): void => {\n if (ts - lastFrame < frameDuration) {\n rafId = requestAnimationFrame(run);\n return;\n }\n lastFrame = ts;\n\n ctx.clearRect(\n -fuzzRange - 20,\n -fuzzRange - 10,\n offscreenWidth + 2 * (fuzzRange + 20),\n tightHeight + 2 * (fuzzRange + 10)\n );\n\n if (isClicking) targetIntensity = 1;\n else if (isGlitching) targetIntensity = 1;\n else if (isHovering) targetIntensity = this.hoverIntensity();\n else targetIntensity = this.baseIntensity();\n\n const td = this.transitionDuration();\n if (td > 0) {\n const step = 1 / (td / frameDuration);\n if (currentIntensity < targetIntensity) currentIntensity = Math.min(currentIntensity + step, targetIntensity);\n else if (currentIntensity > targetIntensity)\n currentIntensity = Math.max(currentIntensity - step, targetIntensity);\n } else {\n currentIntensity = targetIntensity;\n }\n\n if (direction === 'horizontal') {\n for (let j = 0; j < tightHeight; j++) {\n const dx = Math.floor(currentIntensity * (Math.random() - 0.5) * fuzzRange);\n ctx.drawImage(offscreen, 0, j, offscreenWidth, 1, dx, j, offscreenWidth, 1);\n }\n } else if (direction === 'vertical') {\n for (let i = 0; i < offscreenWidth; i++) {\n const dy = Math.floor(currentIntensity * (Math.random() - 0.5) * fuzzRange);\n ctx.drawImage(offscreen, i, 0, 1, tightHeight, i, dy, 1, tightHeight);\n }\n } else {\n // both: horizontal pass then vertical pass on the result\n for (let j = 0; j < tightHeight; j++) {\n const dx = Math.floor(currentIntensity * (Math.random() - 0.5) * fuzzRange);\n ctx.drawImage(offscreen, 0, j, offscreenWidth, 1, dx, j, offscreenWidth, 1);\n }\n const w = offscreenWidth + fuzzRange;\n const h = tightHeight + fuzzRange;\n const data = ctx.getImageData(0, 0, w, h);\n ctx.clearRect(\n -fuzzRange - 20,\n -fuzzRange - 10,\n offscreenWidth + 2 * (fuzzRange + 20),\n tightHeight + 2 * (fuzzRange + 10)\n );\n ctx.putImageData(data, 0, 0);\n for (let i = 0; i < w; i++) {\n const dy = Math.floor(currentIntensity * (Math.random() - 0.5) * fuzzRange * 0.5);\n const col = ctx.getImageData(i, 0, 1, h);\n ctx.clearRect(i, -fuzzRange, 1, tightHeight + 2 * fuzzRange);\n ctx.putImageData(col, i, dy);\n }\n }\n\n rafId = requestAnimationFrame(run);\n };\n rafId = requestAnimationFrame(run);\n\n const isInsideText = (x: number, y: number): boolean =>\n x >= interactiveLeft && x <= interactiveRight && y >= interactiveTop && y <= interactiveBottom;\n\n const onMouseMove = (e: MouseEvent): void => {\n if (!this.enableHover()) return;\n const rect = canvas.getBoundingClientRect();\n isHovering = isInsideText(e.clientX - rect.left, e.clientY - rect.top);\n };\n const onMouseLeave = (): void => {\n isHovering = false;\n };\n const onTouchMove = (e: TouchEvent): void => {\n if (!this.enableHover()) return;\n e.preventDefault();\n const rect = canvas.getBoundingClientRect();\n const t = e.touches[0];\n isHovering = isInsideText(t.clientX - rect.left, t.clientY - rect.top);\n };\n const onTouchEnd = (): void => {\n isHovering = false;\n };\n const onClick = (): void => {\n if (!this.clickEffect()) return;\n isClicking = true;\n clearTimeout(clickTimer);\n clickTimer = setTimeout(() => {\n isClicking = false;\n }, 150);\n };\n\n // Attached unconditionally, and gated inside the three handlers that can SET a\n // reactive state instead. `enableHover` and `clickEffect` are not in the re-init\n // effect's dependency list, so an attach conditional on them read the value at\n // boot and never again: a `[clickEffect]` bound to a signal that starts `false` —\n // the default, so the ordinary case — stayed dead after it flipped true. Adding\n // them to that list would restart the rAF loop and the glitch timers just to\n // toggle a listener, which is visible; the guards are not. `onTouchMove` calls\n // `preventDefault()` only past its own guard, so a hover-disabled instance still\n // swallows nothing.\n //\n // `onMouseLeave` / `onTouchEnd` stay ungated deliberately: they only ever CLEAR\n // toward the idle state, and gating them would strand `isHovering` on for good\n // when hover is switched off mid-hover.\n canvas.addEventListener('mousemove', onMouseMove);\n canvas.addEventListener('mouseleave', onMouseLeave);\n canvas.addEventListener('touchmove', onTouchMove, { passive: false });\n canvas.addEventListener('touchend', onTouchEnd);\n canvas.addEventListener('click', onClick);\n\n this.teardown = (): void => {\n cancelAnimationFrame(rafId);\n clearTimeout(glitchOnTimer);\n clearTimeout(glitchOffTimer);\n clearTimeout(clickTimer);\n canvas.removeEventListener('mousemove', onMouseMove);\n canvas.removeEventListener('mouseleave', onMouseLeave);\n canvas.removeEventListener('touchmove', onTouchMove);\n canvas.removeEventListener('touchend', onTouchEnd);\n canvas.removeEventListener('click', onClick);\n };\n }\n}\n\nexport type { WrFuzzyTextDirection } from './interfaces';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAAA;;;;;;;;;;;;AAYG;AAsBH;;;;;;;;;;;;;;;;;;;AAmBG;MAoBU,WAAW,CAAA;AACtB;;;AAGG;AACgB,IAAA,MAAM,GAAqC;AAC5D,QAAA,QAAQ,EAAE,UAAU;AACpB,QAAA,KAAK,EAAE,KAAK;AACZ,QAAA,MAAM,EAAE,KAAK;AACb,QAAA,QAAQ,EAAE,QAAQ;AAClB,QAAA,WAAW,EAAE,YAAY;AACzB,QAAA,aAAa,EAAE,QAAQ;KACxB;;IAGQ,IAAI,GAAG,KAAK,CAAC,QAAQ;6EAAU;;IAG/B,QAAQ,GAAG,KAAK,CAAkB,0BAA0B;iFAAC;;IAG7D,UAAU,GAAG,KAAK,CAAkB,GAAG;mFAAC;;IAGxC,UAAU,GAAG,KAAK,CAAC,SAAS;mFAAC;;IAG7B,KAAK,GAAG,KAAK,CAAC,SAAS;8EAAC;;IAGxB,QAAQ,GAAG,KAAK,CAA2B,IAAI;iFAAC;;IAGhD,WAAW,GAAG,KAAK,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BAAA,QAAQ,EAAE,eAAe;;;;;;;;;;;;AAYzB,oBAAA,QAAQ,EACN,2EAA2E;wBAC3E,8CAA8C;oBAChD,aAAa,EAAE,iBAAiB,CAAC,IAAI;oBACrC,IAAI,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,wBAAwB,EAAE;AAC5E,iBAAA;g3DAqEgF,QAAQ,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AC7IzF;;AAEG;;;;"}
1
+ {"version":3,"file":"ngwr-fuzzy-text.mjs","sources":["../../../projects/lib/fuzzy-text/fuzzy-text.ts","../../../projects/lib/fuzzy-text/ngwr-fuzzy-text.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n *\n * Angular adaptation of the FuzzyText effect by David Haz / reactbits.dev.\n * Original: https://www.reactbits.dev/text-animations/fuzzy-text\n *\n * Renders text to an offscreen 2D canvas, then redraws it onto the\n * visible canvas one row (or column) at a time with random horizontal /\n * vertical offsets. Intensity reacts to hover / click / glitch state.\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { isPlatformBrowser } from '@angular/common';\nimport type { ElementRef } from '@angular/core';\nimport {\n Component,\n DestroyRef,\n PLATFORM_ID,\n ViewEncapsulation,\n afterNextRender,\n effect,\n inject,\n input,\n viewChild,\n} from '@angular/core';\n\nimport { WrPlatform } from 'ngwr/platform';\nimport { numAttr } from 'ngwr/utils';\n\nimport type { WrFuzzyTextDirection } from './interfaces';\n\n/**\n * Canvas-rendered \"fuzzy\" text — each row/column of glyphs is offset by\n * a random amount per frame, giving the text a TV-static or motion-blur\n * appearance. Intensity ramps up on hover, click, and during periodic\n * glitch bursts (configurable).\n *\n * @example\n * ```html\n * <wr-fuzzy-text text=\"404\" />\n * <wr-fuzzy-text\n * text=\"HELLO\"\n * color=\"#0ea5e9\"\n * [fuzzRange]=\"50\"\n * [hoverIntensity]=\"0.8\"\n * [glitchMode]=\"true\"\n * />\n * ```\n *\n * @see https://www.reactbits.dev/text-animations/fuzzy-text\n */\n@Component({\n selector: 'wr-fuzzy-text',\n // The text is drawn into the canvas as PIXELS, so without the first span there is\n // nothing for a screen reader to read at all — the same layer `wr-rotating-text`\n // and `wr-decrypt-text` carry. Hidden inline rather than through a class: this\n // entry point ships no stylesheet, and a consumer who imported none would\n // otherwise see the text twice.\n //\n // BOUND, not a static `style=\"…\"` attribute. A real attribute is refused under\n // `style-src 'self'`, and what is lost there is not a colour: the span drops\n // every visual-hiding declaration and the word renders on screen beside the\n // canvas that already draws it. A binding goes through `style.setProperty`,\n // which is CSSOM and outside CSP's reach.\n template:\n '<span class=\"wr-fuzzy-text__sr-only\" [style]=\"srOnly\">{{ text() }}</span>' +\n '<canvas #canvas aria-hidden=\"true\"></canvas>',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-fuzzy-text', '[style.color]': \"'var(--wr-color-dark)'\" },\n})\nexport class WrFuzzyText {\n /**\n * Visual-hiding declarations for the screen-reader copy of the text. A stable\n * object literal, so the binding is written once rather than on every pass.\n */\n protected readonly srOnly: Readonly<Record<string, string>> = {\n position: 'absolute',\n width: '1px',\n height: '1px',\n overflow: 'hidden',\n 'clip-path': 'inset(50%)',\n 'white-space': 'nowrap',\n };\n\n /** Text to render. */\n readonly text = input.required<string>();\n\n /** Font size as CSS length (`'4rem'`, `'72px'`, …) or px number. @default 'clamp(2rem, 10vw, 10rem)' */\n readonly fontSize = input<string | number>('clamp(2rem, 10vw, 10rem)');\n\n /** Font weight. @default 900 */\n readonly fontWeight = input<number | string>(900);\n\n /** Font family. `'inherit'` reads the canvas's computed style. @default 'inherit' */\n readonly fontFamily = input('inherit');\n\n /** Text colour. `'inherit'` reads the canvas's computed style. Ignored if `[gradient]` is set. @default 'inherit' */\n readonly color = input('inherit');\n\n /** Optional horizontal gradient stops. */\n readonly gradient = input<readonly string[] | null>(null);\n\n /** Enable hover / touch reactivity. @default true */\n readonly enableHover = input(true, { transform: coerceBooleanProperty });\n\n /** Base intensity (0..1) when idle. @default 0.18 */\n readonly baseIntensity = input(0.18, { transform: numAttr(0.18) });\n\n /** Intensity (0..1) while the pointer hovers the text. @default 0.5 */\n readonly hoverIntensity = input(0.5, { transform: numAttr(0.5) });\n\n /** Max pixel displacement per row/column at intensity 1. @default 30 */\n readonly fuzzRange = input(30, { transform: numAttr(30) });\n\n /** Frame rate cap. @default 60 */\n readonly fps = input(60, { transform: numAttr(60) });\n\n /** Fuzz direction. @default 'horizontal' */\n readonly direction = input<WrFuzzyTextDirection>('horizontal');\n\n /** Ms to ease intensity toward target. `0` snaps. @default 0 */\n readonly transitionDuration = input(0, { transform: numAttr(0) });\n\n /** Spike to full intensity briefly on click. @default false */\n readonly clickEffect = input(false, { transform: coerceBooleanProperty });\n\n /** Periodic \"glitch\" bursts at full intensity. @default false */\n readonly glitchMode = input(false, { transform: coerceBooleanProperty });\n\n /** Ms between glitch bursts. @default 2000 */\n readonly glitchInterval = input(2000, { transform: numAttr(2000) });\n\n /** Ms a glitch burst lasts. @default 200 */\n readonly glitchDuration = input(200, { transform: numAttr(200) });\n\n /** Extra pixels between glyphs. @default 0 */\n readonly letterSpacing = input(0, { transform: numAttr(0) });\n\n private readonly canvasRef = viewChild.required<ElementRef<HTMLCanvasElement>>('canvas');\n\n private readonly destroyRef = inject(DestroyRef);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n private readonly platform = inject(WrPlatform);\n\n private teardown: (() => void) | undefined;\n\n /**\n * `init()` suspends on font loading, so the component can be destroyed while\n * it is awaiting. At that moment `teardown` is still undefined, so the\n * destroy hook has nothing to call — and everything the rest of `init()`\n * starts (the rAF loop, the glitch timers, canvas listeners) would run for\n * the life of the page. This flag lets the continuation bail out.\n */\n private destroyed = false;\n\n constructor() {\n if (!this.isBrowser) return;\n\n afterNextRender(() => {\n void this.init();\n });\n\n // Re-init whenever any input that affects the offscreen rendering changes.\n effect(() => {\n this.text();\n this.fontSize();\n this.fontWeight();\n this.fontFamily();\n this.color();\n this.gradient();\n this.letterSpacing();\n this.direction();\n this.fuzzRange();\n this.fps();\n this.glitchMode();\n this.glitchInterval();\n this.glitchDuration();\n // Skip if we haven't booted yet.\n if (!this.teardown) return;\n this.teardown();\n this.teardown = undefined;\n queueMicrotask(() => {\n void this.init();\n });\n });\n\n this.destroyRef.onDestroy(() => {\n this.destroyed = true;\n this.teardown?.();\n });\n }\n\n // Init / loop\n\n private async init(): Promise<void> {\n const canvas = this.canvasRef().nativeElement;\n const ctx = canvas.getContext('2d');\n if (!ctx) return;\n\n const fontFamily =\n this.fontFamily() === 'inherit' ? window.getComputedStyle(canvas).fontFamily || 'sans-serif' : this.fontFamily();\n const color = this.color() === 'inherit' ? window.getComputedStyle(canvas).color || '#fff' : this.color();\n const fontSize = this.fontSize();\n const fontSizeStr = typeof fontSize === 'number' ? `${fontSize}px` : fontSize;\n const fontWeight = this.fontWeight();\n const fontString = `${fontWeight} ${fontSizeStr} ${fontFamily}`;\n\n try {\n await document.fonts.load(fontString);\n } catch {\n await document.fonts.ready;\n }\n\n // Destroyed while the fonts were loading — nothing below may start.\n if (this.destroyed) return;\n\n // Numeric font size for buffer maths.\n let numericFontSize: number;\n if (typeof fontSize === 'number') {\n numericFontSize = fontSize;\n } else {\n const tmp = document.createElement('span');\n tmp.style.fontSize = fontSize;\n document.body.appendChild(tmp);\n numericFontSize = Number.parseFloat(window.getComputedStyle(tmp).fontSize);\n document.body.removeChild(tmp);\n }\n\n const text = this.text();\n const letterSpacing = this.letterSpacing();\n const fuzzRange = this.fuzzRange();\n const direction = this.direction();\n\n // Offscreen canvas with the laid-out text.\n const offscreen = document.createElement('canvas');\n const offCtx = offscreen.getContext('2d');\n if (!offCtx) return;\n offCtx.font = fontString;\n offCtx.textBaseline = 'alphabetic';\n\n let totalWidth = 0;\n if (letterSpacing !== 0) {\n for (const ch of text) totalWidth += offCtx.measureText(ch).width + letterSpacing;\n totalWidth -= letterSpacing;\n } else {\n totalWidth = offCtx.measureText(text).width;\n }\n const m = offCtx.measureText(text);\n const actualLeft = m.actualBoundingBoxLeft ?? 0;\n const actualRight = letterSpacing !== 0 ? totalWidth : (m.actualBoundingBoxRight ?? m.width);\n const actualAscent = m.actualBoundingBoxAscent ?? numericFontSize;\n const actualDescent = m.actualBoundingBoxDescent ?? numericFontSize * 0.2;\n const textBoundingWidth = Math.ceil(letterSpacing !== 0 ? totalWidth : actualLeft + actualRight);\n const tightHeight = Math.ceil(actualAscent + actualDescent);\n\n const extraWidthBuffer = 10;\n const offscreenWidth = textBoundingWidth + extraWidthBuffer;\n offscreen.width = offscreenWidth;\n offscreen.height = tightHeight;\n const xOffset = extraWidthBuffer / 2;\n\n offCtx.font = fontString;\n offCtx.textBaseline = 'alphabetic';\n\n const gradient = this.gradient();\n if (gradient && gradient.length >= 2) {\n const g = offCtx.createLinearGradient(0, 0, offscreenWidth, 0);\n gradient.forEach((c, i) => g.addColorStop(i / (gradient.length - 1), c));\n offCtx.fillStyle = g;\n } else {\n offCtx.fillStyle = color;\n }\n\n if (letterSpacing !== 0) {\n let xPos = xOffset;\n for (const ch of text) {\n offCtx.fillText(ch, xPos, actualAscent);\n xPos += offCtx.measureText(ch).width + letterSpacing;\n }\n } else {\n offCtx.fillText(text, xOffset - actualLeft, actualAscent);\n }\n\n // Size the visible canvas, leaving room for the max horizontal fuzz.\n const horizontalMargin = fuzzRange + 20;\n const verticalMargin = 0;\n canvas.width = offscreenWidth + horizontalMargin * 2;\n canvas.height = tightHeight + verticalMargin * 2;\n ctx.translate(horizontalMargin, verticalMargin);\n\n const interactiveLeft = horizontalMargin + xOffset;\n const interactiveTop = verticalMargin;\n const interactiveRight = interactiveLeft + textBoundingWidth;\n const interactiveBottom = interactiveTop + tightHeight;\n\n // Reduced motion: paint the text once, clean — no fuzz loop, no\n // glitch bursts, no pointer reactivity. Teardown must still be set\n // so the re-init effect keeps redrawing on input changes.\n if (this.platform.prefersReducedMotion()) {\n ctx.drawImage(offscreen, 0, 0);\n this.teardown = (): void => undefined;\n return;\n }\n\n let isHovering = false;\n let isClicking = false;\n let isGlitching = false;\n let currentIntensity = this.baseIntensity();\n let targetIntensity = currentIntensity;\n let lastFrame = 0;\n const frameDuration = 1000 / this.fps();\n\n let rafId = 0;\n let glitchOnTimer: ReturnType<typeof setTimeout> | undefined;\n let glitchOffTimer: ReturnType<typeof setTimeout> | undefined;\n let clickTimer: ReturnType<typeof setTimeout> | undefined;\n\n const startGlitchLoop = (): void => {\n if (!this.glitchMode()) return;\n glitchOnTimer = setTimeout(() => {\n isGlitching = true;\n glitchOffTimer = setTimeout(() => {\n isGlitching = false;\n startGlitchLoop();\n }, this.glitchDuration());\n }, this.glitchInterval());\n };\n if (this.glitchMode()) startGlitchLoop();\n\n const run = (ts: number): void => {\n if (ts - lastFrame < frameDuration) {\n rafId = requestAnimationFrame(run);\n return;\n }\n lastFrame = ts;\n\n ctx.clearRect(\n -fuzzRange - 20,\n -fuzzRange - 10,\n offscreenWidth + 2 * (fuzzRange + 20),\n tightHeight + 2 * (fuzzRange + 10)\n );\n\n if (isClicking) targetIntensity = 1;\n else if (isGlitching) targetIntensity = 1;\n else if (isHovering) targetIntensity = this.hoverIntensity();\n else targetIntensity = this.baseIntensity();\n\n const td = this.transitionDuration();\n if (td > 0) {\n const step = 1 / (td / frameDuration);\n if (currentIntensity < targetIntensity) currentIntensity = Math.min(currentIntensity + step, targetIntensity);\n else if (currentIntensity > targetIntensity)\n currentIntensity = Math.max(currentIntensity - step, targetIntensity);\n } else {\n currentIntensity = targetIntensity;\n }\n\n if (direction === 'horizontal') {\n for (let j = 0; j < tightHeight; j++) {\n const dx = Math.floor(currentIntensity * (Math.random() - 0.5) * fuzzRange);\n ctx.drawImage(offscreen, 0, j, offscreenWidth, 1, dx, j, offscreenWidth, 1);\n }\n } else if (direction === 'vertical') {\n for (let i = 0; i < offscreenWidth; i++) {\n const dy = Math.floor(currentIntensity * (Math.random() - 0.5) * fuzzRange);\n ctx.drawImage(offscreen, i, 0, 1, tightHeight, i, dy, 1, tightHeight);\n }\n } else {\n // both: horizontal pass then vertical pass on the result\n for (let j = 0; j < tightHeight; j++) {\n const dx = Math.floor(currentIntensity * (Math.random() - 0.5) * fuzzRange);\n ctx.drawImage(offscreen, 0, j, offscreenWidth, 1, dx, j, offscreenWidth, 1);\n }\n const w = offscreenWidth + fuzzRange;\n const h = tightHeight + fuzzRange;\n const data = ctx.getImageData(0, 0, w, h);\n ctx.clearRect(\n -fuzzRange - 20,\n -fuzzRange - 10,\n offscreenWidth + 2 * (fuzzRange + 20),\n tightHeight + 2 * (fuzzRange + 10)\n );\n ctx.putImageData(data, 0, 0);\n for (let i = 0; i < w; i++) {\n const dy = Math.floor(currentIntensity * (Math.random() - 0.5) * fuzzRange * 0.5);\n const col = ctx.getImageData(i, 0, 1, h);\n ctx.clearRect(i, -fuzzRange, 1, tightHeight + 2 * fuzzRange);\n ctx.putImageData(col, i, dy);\n }\n }\n\n rafId = requestAnimationFrame(run);\n };\n rafId = requestAnimationFrame(run);\n\n const isInsideText = (x: number, y: number): boolean =>\n x >= interactiveLeft && x <= interactiveRight && y >= interactiveTop && y <= interactiveBottom;\n\n const onMouseMove = (e: MouseEvent): void => {\n if (!this.enableHover()) return;\n const rect = canvas.getBoundingClientRect();\n isHovering = isInsideText(e.clientX - rect.left, e.clientY - rect.top);\n };\n const onMouseLeave = (): void => {\n isHovering = false;\n };\n const onTouchMove = (e: TouchEvent): void => {\n if (!this.enableHover()) return;\n e.preventDefault();\n const rect = canvas.getBoundingClientRect();\n const t = e.touches[0];\n isHovering = isInsideText(t.clientX - rect.left, t.clientY - rect.top);\n };\n const onTouchEnd = (): void => {\n isHovering = false;\n };\n const onClick = (): void => {\n if (!this.clickEffect()) return;\n isClicking = true;\n clearTimeout(clickTimer);\n clickTimer = setTimeout(() => {\n isClicking = false;\n }, 150);\n };\n\n // Attached unconditionally, and gated inside the three handlers that can SET a\n // reactive state instead. `enableHover` and `clickEffect` are not in the re-init\n // effect's dependency list, so an attach conditional on them read the value at\n // boot and never again: a `[clickEffect]` bound to a signal that starts `false` —\n // the default, so the ordinary case — stayed dead after it flipped true. Adding\n // them to that list would restart the rAF loop and the glitch timers just to\n // toggle a listener, which is visible; the guards are not. `onTouchMove` calls\n // `preventDefault()` only past its own guard, so a hover-disabled instance still\n // swallows nothing.\n //\n // `onMouseLeave` / `onTouchEnd` stay ungated deliberately: they only ever CLEAR\n // toward the idle state, and gating them would strand `isHovering` on for good\n // when hover is switched off mid-hover.\n canvas.addEventListener('mousemove', onMouseMove);\n canvas.addEventListener('mouseleave', onMouseLeave);\n canvas.addEventListener('touchmove', onTouchMove, { passive: false });\n canvas.addEventListener('touchend', onTouchEnd);\n canvas.addEventListener('click', onClick);\n\n this.teardown = (): void => {\n cancelAnimationFrame(rafId);\n clearTimeout(glitchOnTimer);\n clearTimeout(glitchOffTimer);\n clearTimeout(clickTimer);\n canvas.removeEventListener('mousemove', onMouseMove);\n canvas.removeEventListener('mouseleave', onMouseLeave);\n canvas.removeEventListener('touchmove', onTouchMove);\n canvas.removeEventListener('touchend', onTouchEnd);\n canvas.removeEventListener('click', onClick);\n };\n }\n}\n\nexport type { WrFuzzyTextDirection } from './interfaces';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAAA;;;;;;;;;;;;AAYG;AAsBH;;;;;;;;;;;;;;;;;;;AAmBG;MAoBU,WAAW,CAAA;AACtB;;;AAGG;AACgB,IAAA,MAAM,GAAqC;AAC5D,QAAA,QAAQ,EAAE,UAAU;AACpB,QAAA,KAAK,EAAE,KAAK;AACZ,QAAA,MAAM,EAAE,KAAK;AACb,QAAA,QAAQ,EAAE,QAAQ;AAClB,QAAA,WAAW,EAAE,YAAY;AACzB,QAAA,aAAa,EAAE,QAAQ;KACxB;;IAGQ,IAAI,GAAG,KAAK,CAAC,QAAQ;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AA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA,6HAAA,EAAA,QAAA,EAAA,IAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAAX,WAAW,EAAA,UAAA,EAAA,CAAA;kBAnBvB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,eAAe;;;;;;;;;;;;AAYzB,oBAAA,QAAQ,EACN,2EAA2E;wBAC3E,8CAA8C;oBAChD,aAAa,EAAE,iBAAiB,CAAC,IAAI;oBACrC,IAAI,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,wBAAwB,EAAE;AAC5E,iBAAA;g3DAqEgF,QAAQ,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AC7IzF;;AAEG;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-gauge-testing.mjs","sources":["../../../projects/lib/gauge/testing/wr-gauge-harness.ts","../../../projects/lib/gauge/testing/ngwr-gauge-testing.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';\n\nimport type { WrGaugeHarnessFilters } from './interfaces';\n\n/**\n * Test harness for `<wr-gauge>`.\n *\n * **The dial is `aria-hidden` and the printed number is optional, so the ARIA is the\n * whole readable surface.** The component carries `role=\"meter\"` with the value\n * trio and an `aria-valuetext` that includes the suffix — which is what makes a\n * gauge with `showValue` off readable at all. {@link getValue} is what it announces;\n * {@link getDisplayValue} is what is drawn, and it is `null` when nothing is.\n *\n * The arc is an SVG path, and its `d` is a rendering detail rather than an\n * assertion — it moves with the size, the stroke width and the sweep.\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrGaugeHarness extends ComponentHarness {\n static hostSelector = 'wr-gauge';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrGaugeHarnessFilters = {}): HarnessPredicate<WrGaugeHarness> {\n return new HarnessPredicate(WrGaugeHarness, options)\n .addOption('ariaLabel', options.ariaLabel, (harness, label) =>\n HarnessPredicate.stringMatches(harness.getAccessibleName(), label)\n )\n .addOption('value', options.value, async (harness, value) => (await harness.getValue()) === value);\n }\n\n private readonly surface = this.locatorFor('.wr-gauge__surface');\n\n /** The role the dial announces — `meter`, which is what a gauge is. */\n async getRole(): Promise<string | null> {\n return (await this.surface()).getAttribute('role');\n }\n\n /** The dial's accessible name. */\n async getAccessibleName(): Promise<string | null> {\n return (await this.surface()).getAttribute('aria-label');\n }\n\n /** The value it announces, from `aria-valuenow`. */\n async getValue(): Promise<number> {\n return Number(await (await this.surface()).getAttribute('aria-valuenow'));\n }\n\n /** The bottom of the range, from `aria-valuemin`. */\n async getMin(): Promise<number> {\n return Number(await (await this.surface()).getAttribute('aria-valuemin'));\n }\n\n /** The top of the range, from `aria-valuemax`. */\n async getMax(): Promise<number> {\n return Number(await (await this.surface()).getAttribute('aria-valuemax'));\n }\n\n /**\n * The spoken form of the value — the number with its suffix.\n *\n * The reason a gauge with no printed value is still readable, and worth asserting\n * separately from {@link getValue}: a percentage announced as a bare `72` says\n * something different from `72%`.\n */\n async getValueText(): Promise<string | null> {\n return (await this.surface()).getAttribute('aria-valuetext');\n }\n\n /** The number printed in the middle, suffix included, or `null` when `showValue` is off. */\n async getDisplayValue(): Promise<string | null> {\n const text = await this.locatorForOptional('.wr-gauge__text')();\n return text ? text.text() : null;\n }\n\n /** The suffix alone, or `null` when there is none — or nothing is printed. */\n async getSuffix(): Promise<string | null> {\n const suffix = await this.locatorForOptional('.wr-gauge__suffix')();\n if (!suffix) return null;\n const text = await suffix.text();\n return text === '' ? null : text;\n }\n\n /**\n * The dial's width in pixels, read off the `style` ATTRIBUTE.\n *\n * NOT `getCssValue()`, which is `getComputedStyle()`: a computed read answers\n * from the LAID-OUT box, so it agrees with the inline value in jsdom — which\n * lays nothing out and echoes the declaration — and disagrees in a browser,\n * where sub-pixel rounding turns a declared 240 into 239.5. A harness that\n * answers differently in the two places it runs is worse than one that refuses.\n */\n async getSize(): Promise<number> {\n const style = await (await this.surface()).getAttribute('style');\n const match = /width:\\s*([\\d.]+)px/.exec(style ?? '');\n if (!match) {\n throw new Error(\n `WrGaugeHarness.getSize(): the dial carries no inline width (style: \"${style ?? ''}\"). ` +\n 'The component writes one unconditionally, so its absence is the bug rather than a zero.'\n );\n }\n return Number.parseFloat(match[1]);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;AAKG;AAMH;;;;;;;;;;;;;AAaG;AACG,MAAO,cAAe,SAAQ,gBAAgB,CAAA;AAClD,IAAA,OAAO,YAAY,GAAG,UAAU;;AAGhC,IAAA,OAAO,IAAI,CAAC,OAAA,GAAiC,EAAE,EAAA;AAC7C,QAAA,OAAO,IAAI,gBAAgB,CAAC,cAAc,EAAE,OAAO;aAChD,SAAS,CAAC,WAAW,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,KAAK,KACxD,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,iBAAiB,EAAE,EAAE,KAAK,CAAC;aAEnE,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,OAAO,EAAE,KAAK,KAAK,CAAC,MAAM,OAAO,CAAC,QAAQ,EAAE,MAAM,KAAK,CAAC;IACtG;AAEiB,IAAA,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,oBAAoB,CAAC;;AAGhE,IAAA,MAAM,OAAO,GAAA;AACX,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,MAAM,CAAC;IACpD;;AAGA,IAAA,MAAM,iBAAi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,MAAM,IAAI,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,OAAO,CAAC;QAChE,MAAM,KAAK,GAAG,qBAAqB,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;QACrD,IAAI,CAAC,KAAK,EAAE;AACV,YAAA,MAAM,IAAI,KAAK,CACb,uEAAuE,KAAK,IAAI,EAAE,CAAA,IAAA,CAAM;AACtF,gBAAA,yFAAyF,CAC5F;QACH;QACA,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACpC;;;AC5GF;;AAEG;;;;"}
1
+ {"version":3,"file":"ngwr-gauge-testing.mjs","sources":["../../../projects/lib/gauge/testing/wr-gauge-harness.ts","../../../projects/lib/gauge/testing/ngwr-gauge-testing.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';\n\nimport type { WrGaugeHarnessFilters } from './interfaces';\n\n/**\n * Test harness for `<wr-gauge>`.\n *\n * **The dial is `aria-hidden` and the printed number is optional, so the ARIA is the\n * whole readable surface.** The component carries `role=\"meter\"` with the value\n * trio and an `aria-valuetext` that includes the suffix — which is what makes a\n * gauge with `showValue` off readable at all. {@link getValue} is what it announces;\n * {@link getDisplayValue} is what is drawn, and it is `null` when nothing is.\n *\n * The arc is an SVG path, and its `d` is a rendering detail rather than an\n * assertion — it moves with the size, the stroke width and the sweep.\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrGaugeHarness extends ComponentHarness {\n static hostSelector = 'wr-gauge';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrGaugeHarnessFilters = {}): HarnessPredicate<WrGaugeHarness> {\n return new HarnessPredicate(WrGaugeHarness, options)\n .addOption('ariaLabel', options.ariaLabel, (harness, label) =>\n HarnessPredicate.stringMatches(harness.getAccessibleName(), label)\n )\n .addOption('value', options.value, async (harness, value) => (await harness.getValue()) === value);\n }\n\n private readonly surface = this.locatorFor('.wr-gauge__surface');\n\n /** The role the dial announces — `meter`, which is what a gauge is. */\n async getRole(): Promise<string | null> {\n return (await this.surface()).getAttribute('role');\n }\n\n /** The dial's accessible name. */\n async getAccessibleName(): Promise<string | null> {\n return (await this.surface()).getAttribute('aria-label');\n }\n\n /** The value it announces, from `aria-valuenow`. */\n async getValue(): Promise<number> {\n return Number(await (await this.surface()).getAttribute('aria-valuenow'));\n }\n\n /** The bottom of the range, from `aria-valuemin`. */\n async getMin(): Promise<number> {\n return Number(await (await this.surface()).getAttribute('aria-valuemin'));\n }\n\n /** The top of the range, from `aria-valuemax`. */\n async getMax(): Promise<number> {\n return Number(await (await this.surface()).getAttribute('aria-valuemax'));\n }\n\n /**\n * The spoken form of the value — the number with its suffix.\n *\n * The reason a gauge with no printed value is still readable, and worth asserting\n * separately from {@link getValue}: a percentage announced as a bare `72` says\n * something different from `72%`.\n */\n async getValueText(): Promise<string | null> {\n return (await this.surface()).getAttribute('aria-valuetext');\n }\n\n /** The number printed in the middle, suffix included, or `null` when `showValue` is off. */\n async getDisplayValue(): Promise<string | null> {\n const text = await this.locatorForOptional('.wr-gauge__text')();\n return text ? text.text() : null;\n }\n\n /** The suffix alone, or `null` when there is none — or nothing is printed. */\n async getSuffix(): Promise<string | null> {\n const suffix = await this.locatorForOptional('.wr-gauge__suffix')();\n if (!suffix) return null;\n const text = await suffix.text();\n return text === '' ? null : text;\n }\n\n /**\n * The dial's width in pixels, read off the `style` ATTRIBUTE.\n *\n * NOT `getCssValue()`, which is `getComputedStyle()`: a computed read answers\n * from the LAID-OUT box, so it agrees with the inline value in jsdom — which\n * lays nothing out and echoes the declaration — and disagrees in a browser,\n * where sub-pixel rounding turns a declared 240 into 239.5. A harness that\n * answers differently in the two places it runs is worse than one that refuses.\n */\n async getSize(): Promise<number> {\n const style = await (await this.surface()).getAttribute('style');\n const match = /width:\\s*([\\d.]+)px/.exec(style ?? '');\n if (!match) {\n throw new Error(\n `WrGaugeHarness.getSize(): the dial carries no inline width (style: \"${style ?? ''}\"). ` +\n 'The component writes one unconditionally, so its absence is the bug rather than a zero.'\n );\n }\n return Number.parseFloat(match[1]);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;AAKG;AAMH;;;;;;;;;;;;;AAaG;AACG,MAAO,cAAe,SAAQ,gBAAgB,CAAA;AAClD,IAAA,OAAO,YAAY,GAAG,UAAU;;AAGhC,IAAA,OAAO,IAAI,CAAC,OAAA,GAAiC,EAAE,EAAA;AAC7C,QAAA,OAAO,IAAI,gBAAgB,CAAC,cAAc,EAAE,OAAO;aAChD,SAAS,CAAC,WAAW,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,KAAK,KACxD,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,iBAAiB,EAAE,EAAE,KAAK,CAAC;aAEnE,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,OAAO,EAAE,KAAK,KAAK,CAAC,MAAM,OAAO,CAAC,QAAQ,EAAE,MAAM,KAAK,CAAC;IACtG;AAEiB,IAAA,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,oBAAoB,CAAC;;AAGhE,IAAA,MAAM,OAAO,GAAA;AACX,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,MAAM,CAAC;IACpD;;AAGA,IAAA,MAAM,iBAAiB,GAAA;AACrB,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,YAAY,CAAC;IAC1D;;AAGA,IAAA,MAAM,QAAQ,GAAA;AACZ,QAAA,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,eAAe,CAAC,CAAC;IA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;AACtF,gBAAA,yFAAyF,CAC5F;QACH;QACA,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACpC;;;AC5GF;;AAEG;;"}
@@ -1,7 +1,8 @@
1
1
  import { coerceNumberProperty, coerceBooleanProperty } from '@angular/cdk/coercion';
2
2
  import * as i0 from '@angular/core';
3
- import { input, computed, ViewEncapsulation, Component } from '@angular/core';
3
+ import { input, viewChild, computed, ViewEncapsulation, Component } from '@angular/core';
4
4
  import { useI18nText } from 'ngwr/i18n';
5
+ import { useChartTooltip } from 'ngwr/popover';
5
6
  import { clamp } from 'ngwr/utils';
6
7
 
7
8
  /**
@@ -47,6 +48,13 @@ class WrGauge {
47
48
  showValue = input(true, { ...(ngDevMode ? { debugName: "showValue" } : /* istanbul ignore next */ {}), transform: coerceBooleanProperty });
48
49
  suffix = input('', /* @ts-ignore */
49
50
  ...(ngDevMode ? [{ debugName: "suffix" }] : /* istanbul ignore next */ []));
51
+ /**
52
+ * Show a tooltip with the reading on hover, named by `ariaLabel` when one is
53
+ * given. Pointer only — the meter announces the same reading. @default true
54
+ */
55
+ tooltip = input(true, { ...(ngDevMode ? { debugName: "tooltip" } : /* istanbul ignore next */ {}), transform: coerceBooleanProperty });
56
+ surface = viewChild('surface', /* @ts-ignore */
57
+ ...(ngDevMode ? [{ debugName: "surface" }] : /* istanbul ignore next */ []));
50
58
  // Geometry — semicircle in a 100×56 viewBox (centre at 50, 50).
51
59
  cx = 50;
52
60
  cy = 50;
@@ -86,13 +94,34 @@ class WrGauge {
86
94
  }, /* @ts-ignore */
87
95
  ...(ngDevMode ? [{ debugName: "valuePath" }] : /* istanbul ignore next */ []));
88
96
  viewBox = '0 0 100 56';
89
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrGauge, deps: [], target: i0.ɵɵFactoryTarget.Component });
90
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: WrGauge, isStandalone: true, selector: "wr-gauge", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, strokeWidth: { classPropertyName: "strokeWidth", publicName: "strokeWidth", isSignal: true, isRequired: false, transformFunction: null }, trackColor: { classPropertyName: "trackColor", publicName: "trackColor", isSignal: true, isRequired: false, transformFunction: null }, valueColor: { classPropertyName: "valueColor", publicName: "valueColor", isSignal: true, isRequired: false, transformFunction: null }, showValue: { classPropertyName: "showValue", publicName: "showValue", isSignal: true, isRequired: false, transformFunction: null }, suffix: { classPropertyName: "suffix", publicName: "suffix", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "wr-gauge" }, ngImport: i0, template: "<!--\n The dial is drawn in an aria-hidden <svg> and the printed value is optional, so\n with `showValue` off the component had no accessible representation at all.\n `role=\"meter\"` plus the value attributes make it readable either way.\n-->\n<div\n class=\"wr-gauge__surface\"\n [style.width.px]=\"size()\"\n role=\"meter\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-valuemin]=\"min()\"\n [attr.aria-valuemax]=\"max()\"\n [attr.aria-valuenow]=\"displayValue()\"\n [attr.aria-valuetext]=\"displayValue() + suffix()\"\n>\n <svg [attr.viewBox]=\"viewBox\" aria-hidden=\"true\">\n <path\n class=\"wr-gauge__track\"\n [attr.d]=\"trackPath()\"\n fill=\"none\"\n [attr.stroke]=\"trackColor()\"\n [attr.stroke-width]=\"strokeWidth()\"\n stroke-linecap=\"round\"\n />\n <path\n class=\"wr-gauge__value\"\n [attr.d]=\"valuePath()\"\n fill=\"none\"\n [attr.stroke]=\"valueColor()\"\n [attr.stroke-width]=\"strokeWidth()\"\n stroke-linecap=\"round\"\n />\n </svg>\n @if (showValue()) {\n <div class=\"wr-gauge__text\">\n {{ displayValue() }}<span class=\"wr-gauge__suffix\">{{ suffix() }}</span>\n </div>\n }\n</div>\n", encapsulation: i0.ViewEncapsulation.None });
97
+ /**
98
+ * The reading as the meter announces it — `aria-valuetext`, the number plus the
99
+ * suffix — so the tooltip, the printed value and a screen reader all say one
100
+ * thing.
101
+ */
102
+ valueText = computed(() => `${this.displayValue()}${this.suffix()}`, /* @ts-ignore */
103
+ ...(ngDevMode ? [{ debugName: "valueText" }] : /* istanbul ignore next */ []));
104
+ /**
105
+ * One tooltip, pointing at the top of the dial. The whole gauge is one section.
106
+ * The label is the `ariaLabel` input and not the catalog fallback, which names
107
+ * the kind of widget rather than the reading.
108
+ */
109
+ tip = useChartTooltip(this.tooltip, () => {
110
+ const el = this.surface()?.nativeElement;
111
+ if (!el)
112
+ return null;
113
+ return {
114
+ datum: { label: this.ariaLabel() ?? undefined, value: this.valueText(), color: this.valueColor() },
115
+ anchor: el,
116
+ };
117
+ });
118
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: WrGauge, deps: [], target: i0.ɵɵFactoryTarget.Component });
119
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: WrGauge, isStandalone: true, selector: "wr-gauge", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, strokeWidth: { classPropertyName: "strokeWidth", publicName: "strokeWidth", isSignal: true, isRequired: false, transformFunction: null }, trackColor: { classPropertyName: "trackColor", publicName: "trackColor", isSignal: true, isRequired: false, transformFunction: null }, valueColor: { classPropertyName: "valueColor", publicName: "valueColor", isSignal: true, isRequired: false, transformFunction: null }, showValue: { classPropertyName: "showValue", publicName: "showValue", isSignal: true, isRequired: false, transformFunction: null }, suffix: { classPropertyName: "suffix", publicName: "suffix", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "wr-gauge" }, viewQueries: [{ propertyName: "surface", first: true, predicate: ["surface"], descendants: true, isSignal: true }], ngImport: i0, template: "<!--\n The dial is drawn in an aria-hidden <svg> and the printed value is optional, so\n with `showValue` off the component had no accessible representation at all.\n `role=\"meter\"` plus the value attributes make it readable either way.\n-->\n<div\n #surface\n class=\"wr-gauge__surface\"\n [style.width.px]=\"size()\"\n role=\"meter\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-valuemin]=\"min()\"\n [attr.aria-valuemax]=\"max()\"\n [attr.aria-valuenow]=\"displayValue()\"\n [attr.aria-valuetext]=\"valueText()\"\n (mouseenter)=\"tip.enter(0)\"\n (mouseleave)=\"tip.leave($event)\"\n>\n <svg [attr.viewBox]=\"viewBox\" aria-hidden=\"true\">\n <path\n class=\"wr-gauge__track\"\n [attr.d]=\"trackPath()\"\n fill=\"none\"\n [attr.stroke]=\"trackColor()\"\n [attr.stroke-width]=\"strokeWidth()\"\n stroke-linecap=\"round\"\n />\n <path\n class=\"wr-gauge__value\"\n [attr.d]=\"valuePath()\"\n fill=\"none\"\n [attr.stroke]=\"valueColor()\"\n [attr.stroke-width]=\"strokeWidth()\"\n stroke-linecap=\"round\"\n />\n </svg>\n @if (showValue()) {\n <div class=\"wr-gauge__text\">\n {{ displayValue() }}<span class=\"wr-gauge__suffix\">{{ suffix() }}</span>\n </div>\n }\n</div>\n", encapsulation: i0.ViewEncapsulation.None });
91
120
  }
92
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrGauge, decorators: [{
121
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: WrGauge, decorators: [{
93
122
  type: Component,
94
- args: [{ selector: 'wr-gauge', encapsulation: ViewEncapsulation.None, host: { class: 'wr-gauge' }, template: "<!--\n The dial is drawn in an aria-hidden <svg> and the printed value is optional, so\n with `showValue` off the component had no accessible representation at all.\n `role=\"meter\"` plus the value attributes make it readable either way.\n-->\n<div\n class=\"wr-gauge__surface\"\n [style.width.px]=\"size()\"\n role=\"meter\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-valuemin]=\"min()\"\n [attr.aria-valuemax]=\"max()\"\n [attr.aria-valuenow]=\"displayValue()\"\n [attr.aria-valuetext]=\"displayValue() + suffix()\"\n>\n <svg [attr.viewBox]=\"viewBox\" aria-hidden=\"true\">\n <path\n class=\"wr-gauge__track\"\n [attr.d]=\"trackPath()\"\n fill=\"none\"\n [attr.stroke]=\"trackColor()\"\n [attr.stroke-width]=\"strokeWidth()\"\n stroke-linecap=\"round\"\n />\n <path\n class=\"wr-gauge__value\"\n [attr.d]=\"valuePath()\"\n fill=\"none\"\n [attr.stroke]=\"valueColor()\"\n [attr.stroke-width]=\"strokeWidth()\"\n stroke-linecap=\"round\"\n />\n </svg>\n @if (showValue()) {\n <div class=\"wr-gauge__text\">\n {{ displayValue() }}<span class=\"wr-gauge__suffix\">{{ suffix() }}</span>\n </div>\n }\n</div>\n" }]
95
- }], propDecorators: { ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], strokeWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "strokeWidth", required: false }] }], trackColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "trackColor", required: false }] }], valueColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueColor", required: false }] }], showValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "showValue", required: false }] }], suffix: [{ type: i0.Input, args: [{ isSignal: true, alias: "suffix", required: false }] }] } });
123
+ args: [{ selector: 'wr-gauge', encapsulation: ViewEncapsulation.None, host: { class: 'wr-gauge' }, template: "<!--\n The dial is drawn in an aria-hidden <svg> and the printed value is optional, so\n with `showValue` off the component had no accessible representation at all.\n `role=\"meter\"` plus the value attributes make it readable either way.\n-->\n<div\n #surface\n class=\"wr-gauge__surface\"\n [style.width.px]=\"size()\"\n role=\"meter\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-valuemin]=\"min()\"\n [attr.aria-valuemax]=\"max()\"\n [attr.aria-valuenow]=\"displayValue()\"\n [attr.aria-valuetext]=\"valueText()\"\n (mouseenter)=\"tip.enter(0)\"\n (mouseleave)=\"tip.leave($event)\"\n>\n <svg [attr.viewBox]=\"viewBox\" aria-hidden=\"true\">\n <path\n class=\"wr-gauge__track\"\n [attr.d]=\"trackPath()\"\n fill=\"none\"\n [attr.stroke]=\"trackColor()\"\n [attr.stroke-width]=\"strokeWidth()\"\n stroke-linecap=\"round\"\n />\n <path\n class=\"wr-gauge__value\"\n [attr.d]=\"valuePath()\"\n fill=\"none\"\n [attr.stroke]=\"valueColor()\"\n [attr.stroke-width]=\"strokeWidth()\"\n stroke-linecap=\"round\"\n />\n </svg>\n @if (showValue()) {\n <div class=\"wr-gauge__text\">\n {{ displayValue() }}<span class=\"wr-gauge__suffix\">{{ suffix() }}</span>\n </div>\n }\n</div>\n" }]
124
+ }], propDecorators: { ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], strokeWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "strokeWidth", required: false }] }], trackColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "trackColor", required: false }] }], valueColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueColor", required: false }] }], showValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "showValue", required: false }] }], suffix: [{ type: i0.Input, args: [{ isSignal: true, alias: "suffix", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], surface: [{ type: i0.ViewChild, args: ['surface', { isSignal: true }] }] } });
96
125
 
97
126
  /**
98
127
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-gauge.mjs","sources":["../../../projects/lib/gauge/gauge.ts","../../../projects/lib/gauge/gauge.html","../../../projects/lib/gauge/ngwr-gauge.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';\nimport { Component, ViewEncapsulation, computed, input } from '@angular/core';\n\nimport { useI18nText } from 'ngwr/i18n';\nimport { clamp } from 'ngwr/utils';\n\n/**\n * Semicircle progress gauge. Display-only — for interactive use see the\n * {@link WrKnob} from `ngwr/knob`.\n *\n * @example\n * ```html\n * <wr-gauge [value]=\"72\" />\n * <wr-gauge [value]=\"9.5\" [min]=\"0\" [max]=\"10\" suffix=\"/10\" valueColor=\"var(--wr-color-warning)\" />\n * ```\n *\n * @see https://ngwr.dev/reference/components/gauge\n */\n@Component({\n selector: 'wr-gauge',\n templateUrl: './gauge.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-gauge' },\n})\nexport class WrGauge {\n /** Accessible name — the role needs one. Falls back to `gauge.label`. */\n readonly ariaLabel = input<string | null>(null);\n\n protected readonly resolvedAriaLabel = useI18nText(this.ariaLabel, 'gauge.label', 'Gauge');\n\n /**\n * The reading. Coerced like every other numeric input here — it was the only one\n * without it, so a NaN reached the arc's `d` as the literal text `NaN`, which is\n * invalid path geometry and drops the arc.\n */\n readonly value = input.required<number, unknown>({\n transform: (v: unknown): number => coerceNumberProperty(v, 0),\n });\n readonly min = input(0, { transform: (v: unknown): number => coerceNumberProperty(v, 0) });\n readonly max = input(100, { transform: (v: unknown): number => coerceNumberProperty(v, 100) });\n\n /** Diameter in CSS pixels. @default 160 */\n readonly size = input(160, { transform: (v: unknown): number => Math.max(48, coerceNumberProperty(v, 160)) });\n\n /** Arc stroke thickness in viewBox units (out of 100). @default 10 */\n readonly strokeWidth = input(10, {\n transform: (v: unknown): number => Math.max(1, coerceNumberProperty(v, 10)),\n });\n\n readonly trackColor = input<string>('rgba(var(--wr-color-light-rgb), 0.6)');\n readonly valueColor = input<string>('var(--wr-color-primary)');\n\n /** Show the value text in the center. @default true */\n readonly showValue = input(true, { transform: coerceBooleanProperty });\n\n readonly suffix = input<string>('');\n\n // Geometry — semicircle in a 100×56 viewBox (centre at 50, 50).\n protected readonly cx = 50;\n protected readonly cy = 50;\n // A negative radius is invalid in the SVG path grammar, so the browser drops the arc\n // and the dial vanishes — which a fat stroke reaches at 99. `wr-knob` floors it too.\n protected readonly radius = computed(() => Math.max(1, 50 - this.strokeWidth() / 2 - 0.5));\n\n /**\n * The reading as it can actually be shown. Only `ratio` used to be clamped, so an\n * over-range value drew a full bar while `aria-valuenow` announced the raw number\n * against `aria-valuemax` — an invalid state for `role=\"meter\"` — and the printed\n * text disagreed with the bar as well.\n */\n protected readonly displayValue = computed(() => clamp(this.value(), this.min(), this.max()));\n\n protected readonly ratio = computed(() => {\n const range = this.max() - this.min();\n if (range <= 0) return 0;\n return clamp((this.value() - this.min()) / range, 0, 1);\n });\n\n protected readonly trackPath = computed(() => {\n const r = this.radius();\n return `M ${this.cx - r} ${this.cy} A ${r} ${r} 0 0 1 ${this.cx + r} ${this.cy}`;\n });\n\n protected readonly valuePath = computed(() => {\n const r = this.radius();\n const angle = Math.PI * (1 - this.ratio());\n const ex = this.cx + r * Math.cos(angle);\n const ey = this.cy - r * Math.sin(angle);\n // The arc always spans `π × ratio` radians (≤ 180°), so largeArc stays 0.\n // Previously this was set to 1 when ratio > 0.5, which made the swept arc\n // take the long way round and visually flipped the bar.\n return `M ${this.cx - r} ${this.cy} A ${r} ${r} 0 0 1 ${ex.toFixed(2)} ${ey.toFixed(2)}`;\n });\n\n protected readonly viewBox = '0 0 100 56';\n}\n","<!--\n The dial is drawn in an aria-hidden <svg> and the printed value is optional, so\n with `showValue` off the component had no accessible representation at all.\n `role=\"meter\"` plus the value attributes make it readable either way.\n-->\n<div\n class=\"wr-gauge__surface\"\n [style.width.px]=\"size()\"\n role=\"meter\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-valuemin]=\"min()\"\n [attr.aria-valuemax]=\"max()\"\n [attr.aria-valuenow]=\"displayValue()\"\n [attr.aria-valuetext]=\"displayValue() + suffix()\"\n>\n <svg [attr.viewBox]=\"viewBox\" aria-hidden=\"true\">\n <path\n class=\"wr-gauge__track\"\n [attr.d]=\"trackPath()\"\n fill=\"none\"\n [attr.stroke]=\"trackColor()\"\n [attr.stroke-width]=\"strokeWidth()\"\n stroke-linecap=\"round\"\n />\n <path\n class=\"wr-gauge__value\"\n [attr.d]=\"valuePath()\"\n fill=\"none\"\n [attr.stroke]=\"valueColor()\"\n [attr.stroke-width]=\"strokeWidth()\"\n stroke-linecap=\"round\"\n />\n </svg>\n @if (showValue()) {\n <div class=\"wr-gauge__text\">\n {{ displayValue() }}<span class=\"wr-gauge__suffix\">{{ suffix() }}</span>\n </div>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"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/B,EAAE,KAAK,EAAE,UAAU,EAAE,EAAA,QAAA,EAAA,usCAAA,EAAA;;;AE7B7B;;AAEG;;;;"}
1
+ {"version":3,"file":"ngwr-gauge.mjs","sources":["../../../projects/lib/gauge/gauge.ts","../../../projects/lib/gauge/gauge.html","../../../projects/lib/gauge/ngwr-gauge.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';\nimport { Component, type ElementRef, ViewEncapsulation, computed, input, viewChild } from '@angular/core';\n\nimport { useI18nText } from 'ngwr/i18n';\nimport { useChartTooltip } from 'ngwr/popover';\nimport { clamp } from 'ngwr/utils';\n\n/**\n * Semicircle progress gauge. Display-only — for interactive use see the\n * {@link WrKnob} from `ngwr/knob`.\n *\n * @example\n * ```html\n * <wr-gauge [value]=\"72\" />\n * <wr-gauge [value]=\"9.5\" [min]=\"0\" [max]=\"10\" suffix=\"/10\" valueColor=\"var(--wr-color-warning)\" />\n * ```\n *\n * @see https://ngwr.dev/reference/components/gauge\n */\n@Component({\n selector: 'wr-gauge',\n templateUrl: './gauge.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-gauge' },\n})\nexport class WrGauge {\n /** Accessible name — the role needs one. Falls back to `gauge.label`. */\n readonly ariaLabel = input<string | null>(null);\n\n protected readonly resolvedAriaLabel = useI18nText(this.ariaLabel, 'gauge.label', 'Gauge');\n\n /**\n * The reading. Coerced like every other numeric input here — it was the only one\n * without it, so a NaN reached the arc's `d` as the literal text `NaN`, which is\n * invalid path geometry and drops the arc.\n */\n readonly value = input.required<number, unknown>({\n transform: (v: unknown): number => coerceNumberProperty(v, 0),\n });\n readonly min = input(0, { transform: (v: unknown): number => coerceNumberProperty(v, 0) });\n readonly max = input(100, { transform: (v: unknown): number => coerceNumberProperty(v, 100) });\n\n /** Diameter in CSS pixels. @default 160 */\n readonly size = input(160, { transform: (v: unknown): number => Math.max(48, coerceNumberProperty(v, 160)) });\n\n /** Arc stroke thickness in viewBox units (out of 100). @default 10 */\n readonly strokeWidth = input(10, {\n transform: (v: unknown): number => Math.max(1, coerceNumberProperty(v, 10)),\n });\n\n readonly trackColor = input<string>('rgba(var(--wr-color-light-rgb), 0.6)');\n readonly valueColor = input<string>('var(--wr-color-primary)');\n\n /** Show the value text in the center. @default true */\n readonly showValue = input(true, { transform: coerceBooleanProperty });\n\n readonly suffix = input<string>('');\n\n /**\n * Show a tooltip with the reading on hover, named by `ariaLabel` when one is\n * given. Pointer only — the meter announces the same reading. @default true\n */\n readonly tooltip = input(true, { transform: coerceBooleanProperty });\n\n private readonly surface = viewChild<ElementRef<HTMLElement>>('surface');\n\n // Geometry — semicircle in a 100×56 viewBox (centre at 50, 50).\n protected readonly cx = 50;\n protected readonly cy = 50;\n // A negative radius is invalid in the SVG path grammar, so the browser drops the arc\n // and the dial vanishes — which a fat stroke reaches at 99. `wr-knob` floors it too.\n protected readonly radius = computed(() => Math.max(1, 50 - this.strokeWidth() / 2 - 0.5));\n\n /**\n * The reading as it can actually be shown. Only `ratio` used to be clamped, so an\n * over-range value drew a full bar while `aria-valuenow` announced the raw number\n * against `aria-valuemax` — an invalid state for `role=\"meter\"` — and the printed\n * text disagreed with the bar as well.\n */\n protected readonly displayValue = computed(() => clamp(this.value(), this.min(), this.max()));\n\n protected readonly ratio = computed(() => {\n const range = this.max() - this.min();\n if (range <= 0) return 0;\n return clamp((this.value() - this.min()) / range, 0, 1);\n });\n\n protected readonly trackPath = computed(() => {\n const r = this.radius();\n return `M ${this.cx - r} ${this.cy} A ${r} ${r} 0 0 1 ${this.cx + r} ${this.cy}`;\n });\n\n protected readonly valuePath = computed(() => {\n const r = this.radius();\n const angle = Math.PI * (1 - this.ratio());\n const ex = this.cx + r * Math.cos(angle);\n const ey = this.cy - r * Math.sin(angle);\n // The arc always spans `π × ratio` radians (≤ 180°), so largeArc stays 0.\n // Previously this was set to 1 when ratio > 0.5, which made the swept arc\n // take the long way round and visually flipped the bar.\n return `M ${this.cx - r} ${this.cy} A ${r} ${r} 0 0 1 ${ex.toFixed(2)} ${ey.toFixed(2)}`;\n });\n\n protected readonly viewBox = '0 0 100 56';\n\n /**\n * The reading as the meter announces it — `aria-valuetext`, the number plus the\n * suffix — so the tooltip, the printed value and a screen reader all say one\n * thing.\n */\n protected readonly valueText = computed(() => `${this.displayValue()}${this.suffix()}`);\n\n /**\n * One tooltip, pointing at the top of the dial. The whole gauge is one section.\n * The label is the `ariaLabel` input and not the catalog fallback, which names\n * the kind of widget rather than the reading.\n */\n protected readonly tip = useChartTooltip(this.tooltip, () => {\n const el = this.surface()?.nativeElement;\n if (!el) return null;\n return {\n datum: { label: this.ariaLabel() ?? undefined, value: this.valueText(), color: this.valueColor() },\n anchor: el,\n };\n });\n}\n","<!--\n The dial is drawn in an aria-hidden <svg> and the printed value is optional, so\n with `showValue` off the component had no accessible representation at all.\n `role=\"meter\"` plus the value attributes make it readable either way.\n-->\n<div\n #surface\n class=\"wr-gauge__surface\"\n [style.width.px]=\"size()\"\n role=\"meter\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-valuemin]=\"min()\"\n [attr.aria-valuemax]=\"max()\"\n [attr.aria-valuenow]=\"displayValue()\"\n [attr.aria-valuetext]=\"valueText()\"\n (mouseenter)=\"tip.enter(0)\"\n (mouseleave)=\"tip.leave($event)\"\n>\n <svg [attr.viewBox]=\"viewBox\" aria-hidden=\"true\">\n <path\n class=\"wr-gauge__track\"\n [attr.d]=\"trackPath()\"\n fill=\"none\"\n [attr.stroke]=\"trackColor()\"\n [attr.stroke-width]=\"strokeWidth()\"\n stroke-linecap=\"round\"\n />\n <path\n class=\"wr-gauge__value\"\n [attr.d]=\"valuePath()\"\n fill=\"none\"\n [attr.stroke]=\"valueColor()\"\n [attr.stroke-width]=\"strokeWidth()\"\n stroke-linecap=\"round\"\n />\n </svg>\n @if (showValue()) {\n <div class=\"wr-gauge__text\">\n {{ displayValue() }}<span class=\"wr-gauge__suffix\">{{ suffix() }}</span>\n </div>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAAA;;;;;AAKG;AASH;;;;;;;;;;;AAWG;MAOU,OAAO,CAAA;;IAET,SAAS,GAAG,KAAK,CAAgB,IAAI;kFAAC;IAE5B,iBAAiB,GAAG,WAAW,CAAC,IAAI,CAAC,SAAS,EAAE,aAAa,EAAE,OAAO,CAAC;AAE1F;;;;AAIG;AACM,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,CAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,OAAA,EAAA,8BAAA,EAAA,CAAA,EAC7B,SAAS,EAAE,CAAC,CAAU,KAAa,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,GAC7D;AACO,IAAA,GAAG,GAAG,KAAK,CAAC,CAAC,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,KAAA,EAAA,8BAAA,EAAA,CAAA,EAAI,SAAS,EAAE,CAAC,CAAU,KAAa,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;AACjF,IAAA,GAAG,GAAG,KAAK,CAAC,GAAG,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,KAAA,EAAA,8BAAA,EAAA,CAAA,EAAI,SAAS,EAAE,CAAC,CAAU,KAAa,oBAAoB,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG;;IAGrF,IAAI,GAAG,KAAK,CAAC,GAAG,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,MAAA,EAAA,8BAAA,EAAA,CAAA,EAAI,SAAS,EAAE,CAAC,CAAU,KAAa,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,oBAAoB,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAA,CAAG;;IAGpG,WAAW,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AE,CAAA,CAAE;kFAAC;AAEvF;;;;AAIG;IACgB,GAAG,GAAG,eAAe,CAAC,IAAI,CAAC,OAAO,EAAE,MAAK;QAC1D,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,aAAa;AACxC,QAAA,IAAI,CAAC,EAAE;AAAE,YAAA,OAAO,IAAI;QACpB,OAAO;YACL,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,SAAS,EAAE,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE;AAClG,YAAA,MAAM,EAAE,EAAE;SACX;AACH,IAAA,CAAC,CAAC;uGAnGS,OAAO,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAP,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,OAAO,mlDChCpB,4wCA0CA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FDVa,OAAO,EAAA,UAAA,EAAA,CAAA;kBANnB,SAAS;+BACE,UAAU,EAAA,aAAA,EAEL,iBAAiB,CAAC,IAAI,QAC/B,EAAE,KAAK,EAAE,UAAU,EAAE,EAAA,QAAA,EAAA,4wCAAA,EAAA;8kCAyCmC,SAAS,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEvEzE;;AAEG;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-glitch-text-testing.mjs","sources":["../../../projects/lib/glitch-text/testing/wr-glitch-text-harness.ts","../../../projects/lib/glitch-text/testing/ngwr-glitch-text-testing.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';\n\nimport type { WrGlitchTextColourSplit, WrGlitchTextDurations, WrGlitchTextHarnessFilters } from './interfaces';\n\n/**\n * Test harness for `<wr-glitch-text>`.\n *\n * **The one thing worth testing here is the pairing.** The two torn clones are\n * `::before` / `::after` pseudo-elements whose glyphs come from `content:\n * attr(data-text)`, so the string has to be in `__label`'s text node AND in the\n * `data-text` attribute on `__clones`. Drop either binding and the visible text stays\n * flawless while the effect disappears — no error, no missing element, nothing else in\n * the DOM changes. {@link isCloneTextInSync} is that assertion in one call.\n *\n * **Why they are two elements**, which is also why `data-text` is not on the host:\n * generated content is exposed to the accessibility tree, so pseudos on the host made\n * the string announce three times. `__clones` carries the `aria-hidden`;\n * {@link isCloneLayerHidden} is the assertion that keeps it there.\n *\n * **Everything else the harness reads is an inline custom property**, because that is\n * everything the component writes: the two clone durations, the two colour-split\n * shadows and the optional slice background. They are worth pinning for the unit\n * transforms — a duration that loses its `s`, or two clones that end up on the same\n * multiple and tear in lockstep, is a regression that changes no class, no attribute\n * and no text.\n *\n * **What the harness deliberately does not offer**, and why. There is no\n * `isGlitching()`: the tear is a `@keyframes` animation on a pseudo-element, applied by\n * a stylesheet a unit test never loads, so the only available answer is a class name\n * repackaged as a state. There is no `hover()` / `isGlitchingOnHover()`: the gate is a\n * `:hover` SELECTOR, and the DOM after a dispatched mouse event is byte-identical to\n * the DOM before it — a spec built on that would pass against a component whose hover\n * rules had been deleted. There is no `getCloneOffset()` / `getClipPath()`: the ±10px\n * offsets and the tear bands live in the stylesheet and are pure layout besides. There\n * is no `respectsReducedMotion()`: the handling is a `@media` block with no TypeScript\n * counterpart, so the DOM is identical in both states and there is nothing to read.\n * There is no resolver for the shadow colours — they hold `var(--wr-color-info)` /\n * `var(--wr-color-danger)`, and resolving those needs the theme stylesheet. And there\n * is no `getSpeed()`: the input is never written to the DOM, only its two products are,\n * and dividing one back would invent a precision the component never published (at\n * `[speed]=\"0.3\"` the after-duration is literally `0.8999999999999999s`).\n *\n * @example\n * ```ts\n * const glitch = await loader.getHarness(WrGlitchTextHarness);\n *\n * expect(await glitch.isCloneTextInSync()).toBe(true);\n * expect((await glitch.getDurations()).after).toBeCloseTo(3);\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrGlitchTextHarness extends ComponentHarness {\n static hostSelector = 'wr-glitch-text';\n\n /** The readable copy of the string — the only part of the component in the a11y tree. */\n private readonly label = this.locatorFor('.wr-glitch-text__label');\n\n /** The `aria-hidden` layer the two pseudo-clones hang off. */\n private readonly clones = this.locatorFor('.wr-glitch-text__clones');\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrGlitchTextHarnessFilters = {}): HarnessPredicate<WrGlitchTextHarness> {\n return new HarnessPredicate(WrGlitchTextHarness, options)\n .addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text))\n .addOption(\n 'hoverOnly',\n options.hoverOnly,\n async (harness, hoverOnly) => (await harness.isHoverOnly()) === hoverOnly\n );\n }\n\n /**\n * The rendered text, trimmed.\n *\n * The half a sighted user reads, and the half every other check would notice\n * breaking. Read off `__label`, which is the whole of the component's accessible\n * content — the clone layer beside it is `aria-hidden` and empty in the DOM.\n */\n async getText(): Promise<string> {\n return (await this.label()).text();\n }\n\n /**\n * The string the two clone layers draw from — `data-text` on `__clones`.\n *\n * The half nothing else notices. `content: attr(data-text)` is how both pseudo-clones\n * get their glyphs, so this attribute IS the effect. `null` means the mirror is gone\n * and the component is rendering plain text with extra classes.\n */\n async getCloneText(): Promise<string | null> {\n return (await this.clones()).getAttribute('data-text');\n }\n\n /**\n * Whether the clone attribute still mirrors the rendered text.\n *\n * The component's defining silent failure, as a single assertion — two separate reads\n * are two things a spec can forget to write together. Compared raw on both sides,\n * with no trimming: `__label` holds the bare interpolation, so its text node and the\n * attribute are byte-identical or the mirror is broken. An empty `text` is legal and\n * counts as in sync — `data-text=\"\"` is a mirror of nothing, not a missing binding,\n * which is why {@link getCloneText} reports the absent case as `null` instead.\n */\n async isCloneTextInSync(): Promise<boolean> {\n const label = await this.label();\n return (await label.getProperty<string>('textContent')) === (await (await this.clones()).getAttribute('data-text'));\n }\n\n /**\n * Whether the clone layer is still hidden from assistive technology.\n *\n * The reason the component is two elements rather than one. `content: attr(data-text)`\n * is exposed to the accessibility tree, so with the pseudos on the host the string was\n * announced three times and a wrapping heading or link computed its name as\n * \"404 404 404\". Nothing visual changes if the `aria-hidden` is dropped, and neither\n * a11y gate in this repo can see it: `check:a11y` reads prerendered HTML with no\n * stylesheets, and axe has no rule for duplicated generated content.\n */\n async isCloneLayerHidden(): Promise<boolean> {\n return (await (await this.clones()).getAttribute('aria-hidden')) === 'true';\n }\n\n /**\n * Whether the effect idles until the pointer arrives (`enableOnHover`).\n *\n * The `wr-glitch-text--hover-only` class is the only DOM trace of that input, the gate\n * itself being a `:hover` rule. It defaults to `true`, so this is also how a spec\n * catches the day someone \"fixes\" the default to match the component's own JSDoc,\n * which describes the opposite.\n */\n async isHoverOnly(): Promise<boolean> {\n return (await this.host()).hasClass('wr-glitch-text--hover-only');\n }\n\n /**\n * How long each clone takes to complete a cycle, in seconds.\n *\n * The two must NOT be equal: they run at 2× and 3× the `speed` multiplier so the tears\n * fall out of phase, and clones tearing in lockstep read as one shifted copy rather\n * than as a glitch. That regression changes no class, no attribute and no text, and no\n * visual gate in this repo can see it either.\n *\n * These are raw JavaScript floats — `[speed]=\"0.3\"` writes `0.8999999999999999s` —\n * so compare with `toBeCloseTo`, never against a formatted string.\n */\n async getDurations(): Promise<WrGlitchTextDurations> {\n return {\n before: await this.seconds('--wr-glitch-text-before-duration'),\n after: await this.seconds('--wr-glitch-text-after-duration'),\n };\n }\n\n /**\n * Whether the red / cyan colour split is switched on (`enableShadows`).\n *\n * The component writes the literal `none` rather than removing the properties when the\n * split is off, so \"disabled\" and \"never set\" stay distinguishable — an absent property\n * would mean a broken binding, and this reports that as no split either.\n */\n async hasColourSplit(): Promise<boolean> {\n const { before, after } = await this.getColourSplit();\n return before !== 'none' && after !== 'none' && before !== '' && after !== '';\n }\n\n /**\n * The two clone `text-shadow`s, exactly as written — `var()` tokens and all.\n *\n * Returned unresolved on purpose: resolving `var(--wr-color-info)` needs the theme\n * stylesheet, and a unit test that answered with a colour would be inventing one.\n * What the raw pair does prove is the thing a copy-paste breaks — the offsets must\n * have OPPOSITE signs and the two tints must be DIFFERENT intents. Give both clones\n * the same colour, or the same sign, and the chromatic aberration is gone while every\n * other reading stays green.\n */\n async getColourSplit(): Promise<WrGlitchTextColourSplit> {\n return {\n before: await this.inlineVar('--wr-glitch-text-before-shadow'),\n after: await this.inlineVar('--wr-glitch-text-after-shadow'),\n };\n }\n\n /**\n * The masking colour behind the clone slices, or `null` when none was given.\n *\n * The binding emits `null` for an empty input, so the property is ABSENT rather than\n * set to `transparent`, and the stylesheet's own `var(--wr-glitch-text-bg, transparent)`\n * fallback does the work. A component that started writing `transparent` inline would\n * look identical and break nothing until a consumer relied on that fallback — which is\n * the whole reason this reports the absent case as `null` instead of as a colour.\n */\n async getSliceBackground(): Promise<string | null> {\n const raw = await this.inlineVar('--wr-glitch-text-bg');\n return raw === '' ? null : raw;\n }\n\n /**\n * One custom property off the host's `style` ATTRIBUTE.\n *\n * Not `getCssValue()`, which is `getComputedStyle`: with the entry point's own\n * stylesheet loaded that resolves the sheet's declaration, so the method\n * answers plausibly at exactly the moment the host binding — the thing under\n * test — is what broke. The attribute holds only what the component wrote.\n */\n private async inlineVar(property: string): Promise<string> {\n const attr = (await (await this.host()).getAttribute('style')) ?? '';\n const found = new RegExp(`(?:^|;)\\\\s*${property}\\\\s*:\\\\s*([^;]+)`).exec(attr);\n return (found?.[1] ?? '').trim();\n }\n\n /** One of the host's inline duration properties, as a number of seconds. */\n private async seconds(property: string): Promise<number> {\n const raw = await this.inlineVar(property);\n const value = Number.parseFloat(raw);\n\n if (Number.isNaN(value)) {\n throw new Error(\n `WrGlitchTextHarness.getDurations(): \\`${property}\\` computed to \"${raw}\", which is not a number of ` +\n 'seconds. The component writes it inline on the host as a multiple of `[speed]`; an empty value means ' +\n 'that binding is gone, and there is no honest duration to report in its place.'\n );\n }\n return value;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;AAKG;AAMH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CG;AACG,MAAO,mBAAoB,SAAQ,gBAAgB,CAAA;AACvD,IAAA,OAAO,YAAY,GAAG,gBAAgB;;AAGrB,IAAA,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,wBAAwB,CAAC;;AAGjD,IAAA,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,yBAAyB,CAAC;;AAGpE,IAAA,OAAO,IAAI,CAAC,OAAA,GAAsC,EAAE,EAAA;AAClD,QAAA,OAAO,IAAI,gBAAgB,CAAC,mBAAmB,EAAE,OAAO;aACrD,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,IAAI,KAAK,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC;aAC1G,SAAS,CACR,WAAW,EACX,OAAO,CAAC,SAAS,EACjB,OAAO,OAAO,EAAE,SAAS,KAAK,CAAC,MAAM,OAAO,CAAC,WAAW,EAAE,MAAM,SAAS,CAC1E;IACL;AAEA;;;;;;AAMG;AACH,IAAA,MAAM,OAAO,GAAA;QACX,OAAO,CAAC,MAAM,IAAI,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE;IACpC;AAEA;;;;;;AAMG;AACH,IAAA,MAAM,YAAY,GAAA;AAChB,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,EAAE,YAAY,CAAC,WAAW,CAAC;IACxD;AAEA;;;;;;;;;AASG;AACH,IA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IAAA,MAAM,kBAAkB,GAAA;QACtB,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,qBAAqB,CAAC;QACvD,OAAO,GAAG,KAAK,EAAE,GAAG,IAAI,GAAG,GAAG;IAChC;AAEA;;;;;;;AAOG;IACK,MAAM,SAAS,CAAC,QAAgB,EAAA;AACtC,QAAA,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE;AACpE,QAAA,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,CAAA,WAAA,EAAc,QAAQ,CAAA,gBAAA,CAAkB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;AAC7E,QAAA,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE;IAClC;;IAGQ,MAAM,OAAO,CAAC,QAAgB,EAAA;QACpC,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;QAC1C,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC;AAEpC,QAAA,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;AACvB,YAAA,MAAM,IAAI,KAAK,CACb,yCAAyC,QAAQ,CAAA,gBAAA,EAAmB,GAAG,CAAA,4BAAA,CAA8B;gBACnG,uGAAuG;AACvG,gBAAA,+EAA+E,CAClF;QACH;AACA,QAAA,OAAO,KAAK;IACd;;;ACtOF;;AAEG;;;;"}
1
+ {"version":3,"file":"ngwr-glitch-text-testing.mjs","sources":["../../../projects/lib/glitch-text/testing/wr-glitch-text-harness.ts","../../../projects/lib/glitch-text/testing/ngwr-glitch-text-testing.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';\n\nimport type { WrGlitchTextColourSplit, WrGlitchTextDurations, WrGlitchTextHarnessFilters } from './interfaces';\n\n/**\n * Test harness for `<wr-glitch-text>`.\n *\n * **The one thing worth testing here is the pairing.** The two torn clones are\n * `::before` / `::after` pseudo-elements whose glyphs come from `content:\n * attr(data-text)`, so the string has to be in `__label`'s text node AND in the\n * `data-text` attribute on `__clones`. Drop either binding and the visible text stays\n * flawless while the effect disappears — no error, no missing element, nothing else in\n * the DOM changes. {@link isCloneTextInSync} is that assertion in one call.\n *\n * **Why they are two elements**, which is also why `data-text` is not on the host:\n * generated content is exposed to the accessibility tree, so pseudos on the host made\n * the string announce three times. `__clones` carries the `aria-hidden`;\n * {@link isCloneLayerHidden} is the assertion that keeps it there.\n *\n * **Everything else the harness reads is an inline custom property**, because that is\n * everything the component writes: the two clone durations, the two colour-split\n * shadows and the optional slice background. They are worth pinning for the unit\n * transforms — a duration that loses its `s`, or two clones that end up on the same\n * multiple and tear in lockstep, is a regression that changes no class, no attribute\n * and no text.\n *\n * **What the harness deliberately does not offer**, and why. There is no\n * `isGlitching()`: the tear is a `@keyframes` animation on a pseudo-element, applied by\n * a stylesheet a unit test never loads, so the only available answer is a class name\n * repackaged as a state. There is no `hover()` / `isGlitchingOnHover()`: the gate is a\n * `:hover` SELECTOR, and the DOM after a dispatched mouse event is byte-identical to\n * the DOM before it — a spec built on that would pass against a component whose hover\n * rules had been deleted. There is no `getCloneOffset()` / `getClipPath()`: the ±10px\n * offsets and the tear bands live in the stylesheet and are pure layout besides. There\n * is no `respectsReducedMotion()`: the handling is a `@media` block with no TypeScript\n * counterpart, so the DOM is identical in both states and there is nothing to read.\n * There is no resolver for the shadow colours — they hold `var(--wr-color-info)` /\n * `var(--wr-color-danger)`, and resolving those needs the theme stylesheet. And there\n * is no `getSpeed()`: the input is never written to the DOM, only its two products are,\n * and dividing one back would invent a precision the component never published (at\n * `[speed]=\"0.3\"` the after-duration is literally `0.8999999999999999s`).\n *\n * @example\n * ```ts\n * const glitch = await loader.getHarness(WrGlitchTextHarness);\n *\n * expect(await glitch.isCloneTextInSync()).toBe(true);\n * expect((await glitch.getDurations()).after).toBeCloseTo(3);\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrGlitchTextHarness extends ComponentHarness {\n static hostSelector = 'wr-glitch-text';\n\n /** The readable copy of the string — the only part of the component in the a11y tree. */\n private readonly label = this.locatorFor('.wr-glitch-text__label');\n\n /** The `aria-hidden` layer the two pseudo-clones hang off. */\n private readonly clones = this.locatorFor('.wr-glitch-text__clones');\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrGlitchTextHarnessFilters = {}): HarnessPredicate<WrGlitchTextHarness> {\n return new HarnessPredicate(WrGlitchTextHarness, options)\n .addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text))\n .addOption(\n 'hoverOnly',\n options.hoverOnly,\n async (harness, hoverOnly) => (await harness.isHoverOnly()) === hoverOnly\n );\n }\n\n /**\n * The rendered text, trimmed.\n *\n * The half a sighted user reads, and the half every other check would notice\n * breaking. Read off `__label`, which is the whole of the component's accessible\n * content — the clone layer beside it is `aria-hidden` and empty in the DOM.\n */\n async getText(): Promise<string> {\n return (await this.label()).text();\n }\n\n /**\n * The string the two clone layers draw from — `data-text` on `__clones`.\n *\n * The half nothing else notices. `content: attr(data-text)` is how both pseudo-clones\n * get their glyphs, so this attribute IS the effect. `null` means the mirror is gone\n * and the component is rendering plain text with extra classes.\n */\n async getCloneText(): Promise<string | null> {\n return (await this.clones()).getAttribute('data-text');\n }\n\n /**\n * Whether the clone attribute still mirrors the rendered text.\n *\n * The component's defining silent failure, as a single assertion — two separate reads\n * are two things a spec can forget to write together. Compared raw on both sides,\n * with no trimming: `__label` holds the bare interpolation, so its text node and the\n * attribute are byte-identical or the mirror is broken. An empty `text` is legal and\n * counts as in sync — `data-text=\"\"` is a mirror of nothing, not a missing binding,\n * which is why {@link getCloneText} reports the absent case as `null` instead.\n */\n async isCloneTextInSync(): Promise<boolean> {\n const label = await this.label();\n return (await label.getProperty<string>('textContent')) === (await (await this.clones()).getAttribute('data-text'));\n }\n\n /**\n * Whether the clone layer is still hidden from assistive technology.\n *\n * The reason the component is two elements rather than one. `content: attr(data-text)`\n * is exposed to the accessibility tree, so with the pseudos on the host the string was\n * announced three times and a wrapping heading or link computed its name as\n * \"404 404 404\". Nothing visual changes if the `aria-hidden` is dropped, and neither\n * a11y gate in this repo can see it: `check:a11y` reads prerendered HTML with no\n * stylesheets, and axe has no rule for duplicated generated content.\n */\n async isCloneLayerHidden(): Promise<boolean> {\n return (await (await this.clones()).getAttribute('aria-hidden')) === 'true';\n }\n\n /**\n * Whether the effect idles until the pointer arrives (`enableOnHover`).\n *\n * The `wr-glitch-text--hover-only` class is the only DOM trace of that input, the gate\n * itself being a `:hover` rule. It defaults to `true`, so this is also how a spec\n * catches the day someone \"fixes\" the default to match the component's own JSDoc,\n * which describes the opposite.\n */\n async isHoverOnly(): Promise<boolean> {\n return (await this.host()).hasClass('wr-glitch-text--hover-only');\n }\n\n /**\n * How long each clone takes to complete a cycle, in seconds.\n *\n * The two must NOT be equal: they run at 2× and 3× the `speed` multiplier so the tears\n * fall out of phase, and clones tearing in lockstep read as one shifted copy rather\n * than as a glitch. That regression changes no class, no attribute and no text, and no\n * visual gate in this repo can see it either.\n *\n * These are raw JavaScript floats — `[speed]=\"0.3\"` writes `0.8999999999999999s` —\n * so compare with `toBeCloseTo`, never against a formatted string.\n */\n async getDurations(): Promise<WrGlitchTextDurations> {\n return {\n before: await this.seconds('--wr-glitch-text-before-duration'),\n after: await this.seconds('--wr-glitch-text-after-duration'),\n };\n }\n\n /**\n * Whether the red / cyan colour split is switched on (`enableShadows`).\n *\n * The component writes the literal `none` rather than removing the properties when the\n * split is off, so \"disabled\" and \"never set\" stay distinguishable — an absent property\n * would mean a broken binding, and this reports that as no split either.\n */\n async hasColourSplit(): Promise<boolean> {\n const { before, after } = await this.getColourSplit();\n return before !== 'none' && after !== 'none' && before !== '' && after !== '';\n }\n\n /**\n * The two clone `text-shadow`s, exactly as written — `var()` tokens and all.\n *\n * Returned unresolved on purpose: resolving `var(--wr-color-info)` needs the theme\n * stylesheet, and a unit test that answered with a colour would be inventing one.\n * What the raw pair does prove is the thing a copy-paste breaks — the offsets must\n * have OPPOSITE signs and the two tints must be DIFFERENT intents. Give both clones\n * the same colour, or the same sign, and the chromatic aberration is gone while every\n * other reading stays green.\n */\n async getColourSplit(): Promise<WrGlitchTextColourSplit> {\n return {\n before: await this.inlineVar('--wr-glitch-text-before-shadow'),\n after: await this.inlineVar('--wr-glitch-text-after-shadow'),\n };\n }\n\n /**\n * The masking colour behind the clone slices, or `null` when none was given.\n *\n * The binding emits `null` for an empty input, so the property is ABSENT rather than\n * set to `transparent`, and the stylesheet's own `var(--wr-glitch-text-bg, transparent)`\n * fallback does the work. A component that started writing `transparent` inline would\n * look identical and break nothing until a consumer relied on that fallback — which is\n * the whole reason this reports the absent case as `null` instead of as a colour.\n */\n async getSliceBackground(): Promise<string | null> {\n const raw = await this.inlineVar('--wr-glitch-text-bg');\n return raw === '' ? null : raw;\n }\n\n /**\n * One custom property off the host's `style` ATTRIBUTE.\n *\n * Not `getCssValue()`, which is `getComputedStyle`: with the entry point's own\n * stylesheet loaded that resolves the sheet's declaration, so the method\n * answers plausibly at exactly the moment the host binding — the thing under\n * test — is what broke. The attribute holds only what the component wrote.\n */\n private async inlineVar(property: string): Promise<string> {\n const attr = (await (await this.host()).getAttribute('style')) ?? '';\n const found = new RegExp(`(?:^|;)\\\\s*${property}\\\\s*:\\\\s*([^;]+)`).exec(attr);\n return (found?.[1] ?? '').trim();\n }\n\n /** One of the host's inline duration properties, as a number of seconds. */\n private async seconds(property: string): Promise<number> {\n const raw = await this.inlineVar(property);\n const value = Number.parseFloat(raw);\n\n if (Number.isNaN(value)) {\n throw new Error(\n `WrGlitchTextHarness.getDurations(): \\`${property}\\` computed to \"${raw}\", which is not a number of ` +\n 'seconds. The component writes it inline on the host as a multiple of `[speed]`; an empty value means ' +\n 'that binding is gone, and there is no honest duration to report in its place.'\n );\n }\n return value;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;AAKG;AAMH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CG;AACG,MAAO,mBAAoB,SAAQ,gBAAgB,CAAA;AACvD,IAAA,OAAO,YAAY,GAAG,gBAAgB;;AAGrB,IAAA,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,wBAAwB,CAAC;;AAGjD,IAAA,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,yBAAyB,CAAC;;AAGpE,IAAA,OAAO,IAAI,CAAC,OAAA,GAAsC,EAAE,EAAA;AAClD,QAAA,OAAO,IAAI,gBAAgB,CAAC,mBAAmB,EAAE,OAAO;aACrD,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,IAAI,KAAK,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC;aAC1G,SAAS,CACR,WAAW,EACX,OAAO,CAAC,SAAS,EACjB,OAAO,OAAO,EAAE,SAAS,KAAK,CAAC,MAAM,OAAO,CAAC,WAAW,EAAE,MAAM,SAAS,CAC1E;IACL;AAEA;;;;;;AAMG;AACH,IAAA,MAAM,OAAO,GAAA;QACX,OAAO,CAAC,MAAM,IAAI,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE;IACpC;AAEA;;;;;;AAMG;AACH,IAAA,MAAM,YAAY,GAAA;AAChB,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,EAAE,YAAY,CAAC,WAAW,CAAC;IACxD;AAEA;;;;;;;;;AASG;AACH,IAAA,MAAM,iBAAiB,GAAA;AACrB,QAAA,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,KAA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AAC,qBAAqB,CAAC;QACvD,OAAO,GAAG,KAAK,EAAE,GAAG,IAAI,GAAG,GAAG;IAChC;AAEA;;;;;;;AAOG;IACK,MAAM,SAAS,CAAC,QAAgB,EAAA;AACtC,QAAA,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE;AACpE,QAAA,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,CAAA,WAAA,EAAc,QAAQ,CAAA,gBAAA,CAAkB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;AAC7E,QAAA,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE;IAClC;;IAGQ,MAAM,OAAO,CAAC,QAAgB,EAAA;QACpC,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;QAC1C,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC;AAEpC,QAAA,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;AACvB,YAAA,MAAM,IAAI,KAAK,CACb,yCAAyC,QAAQ,CAAA,gBAAA,EAAmB,GAAG,CAAA,4BAAA,CAA8B;gBACnG,uGAAuG;AACvG,gBAAA,+EAA+E,CAClF;QACH;AACA,QAAA,OAAO,KAAK;IACd;;;ACtOF;;AAEG;;"}
@@ -51,10 +51,10 @@ class WrGlitchText {
51
51
  ...(ngDevMode ? [{ debugName: "beforeShadow" }] : /* istanbul ignore next */ []));
52
52
  afterShadow = computed(() => (this.enableShadows() ? '-5px 0 var(--wr-color-danger)' : 'none'), /* @ts-ignore */
53
53
  ...(ngDevMode ? [{ debugName: "afterShadow" }] : /* istanbul ignore next */ []));
54
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrGlitchText, deps: [], target: i0.ɵɵFactoryTarget.Component });
55
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.6", type: WrGlitchText, isStandalone: true, selector: "wr-glitch-text", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: true, transformFunction: null }, speed: { classPropertyName: "speed", publicName: "speed", isSignal: true, isRequired: false, transformFunction: null }, enableShadows: { classPropertyName: "enableShadows", publicName: "enableShadows", isSignal: true, isRequired: false, transformFunction: null }, enableOnHover: { classPropertyName: "enableOnHover", publicName: "enableOnHover", isSignal: true, isRequired: false, transformFunction: null }, background: { classPropertyName: "background", publicName: "background", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.wr-glitch-text--hover-only": "enableOnHover()", "style.--wr-glitch-text-before-duration": "(speed() * 2) + 's'", "style.--wr-glitch-text-after-duration": "(speed() * 3) + 's'", "style.--wr-glitch-text-before-shadow": "beforeShadow()", "style.--wr-glitch-text-after-shadow": "afterShadow()", "style.--wr-glitch-text-bg": "background() || null" }, classAttribute: "wr-glitch-text" }, ngImport: i0, template: "<!--\n Two elements on purpose. The torn clones are `::before` / `::after` whose glyphs\n come from `content: attr(data-text)`, and CSS generated content IS exposed to the\n accessibility tree \u2014 so with the pseudos on the host the string was announced\n three times, and a heading or link wrapping this computed its name as\n \"404 404 404\". The clones now hang off their own `aria-hidden` layer instead:\n the same split `wr-blur-text` and `wr-circular-text` use \u2014 one readable copy,\n one decorative layer taken out of the tree with a single `aria-hidden`.\n\n `__clones` comes second and is absolutely positioned, so it contributes nothing\n to layout and still paints over the label, exactly as the host's own pseudos did.\n-->\n<span class=\"wr-glitch-text__label\">{{ text() }}</span>\n<span class=\"wr-glitch-text__clones\" aria-hidden=\"true\" [attr.data-text]=\"text()\"></span>\n", styles: [".wr-glitch-text{--wr-glitch-text-before-duration: 2s;--wr-glitch-text-after-duration: 3s;--wr-glitch-text-before-shadow: 5px 0 var(--wr-color-info);--wr-glitch-text-after-shadow: -5px 0 var(--wr-color-danger);position:relative;display:inline-block;white-space:nowrap;-webkit-user-select:none;user-select:none;font-weight:900;color:var(--wr-color-on-surface, #0f172a)}.wr-glitch-text__clones{position:absolute;inset:0}.wr-glitch-text__clones:before,.wr-glitch-text__clones:after{content:attr(data-text);position:absolute;top:0;color:inherit;background-color:var(--wr-glitch-text-bg, transparent);overflow:hidden;clip-path:inset(0 0 0 0)}.wr-glitch-text:not(.wr-glitch-text--hover-only) .wr-glitch-text__clones:before{left:-10px;text-shadow:var(--wr-glitch-text-before-shadow);animation:wr-glitch-text-tear var(--wr-glitch-text-before-duration) infinite linear alternate-reverse}.wr-glitch-text:not(.wr-glitch-text--hover-only) .wr-glitch-text__clones:after{left:10px;text-shadow:var(--wr-glitch-text-after-shadow);animation:wr-glitch-text-tear var(--wr-glitch-text-after-duration) infinite linear alternate-reverse}.wr-glitch-text--hover-only .wr-glitch-text__clones:before,.wr-glitch-text--hover-only .wr-glitch-text__clones:after{content:\"\";opacity:0;animation:none}.wr-glitch-text--hover-only:hover .wr-glitch-text__clones:before{content:attr(data-text);opacity:1;left:-10px;text-shadow:var(--wr-glitch-text-before-shadow);animation:wr-glitch-text-tear var(--wr-glitch-text-before-duration) infinite linear alternate-reverse}.wr-glitch-text--hover-only:hover .wr-glitch-text__clones:after{content:attr(data-text);opacity:1;left:10px;text-shadow:var(--wr-glitch-text-after-shadow);animation:wr-glitch-text-tear var(--wr-glitch-text-after-duration) infinite linear alternate-reverse}@media(prefers-reduced-motion:reduce){.wr-glitch-text__clones:before,.wr-glitch-text__clones:after{content:\"\"!important;opacity:0!important;animation:none!important}}@keyframes wr-glitch-text-tear{0%{clip-path:inset(20% 0 50% 0)}5%{clip-path:inset(10% 0 60% 0)}10%{clip-path:inset(15% 0 55% 0)}15%{clip-path:inset(25% 0 35% 0)}20%{clip-path:inset(30% 0 40% 0)}25%{clip-path:inset(40% 0 20% 0)}30%{clip-path:inset(10% 0 60% 0)}35%{clip-path:inset(15% 0 55% 0)}40%{clip-path:inset(25% 0 35% 0)}45%{clip-path:inset(30% 0 40% 0)}50%{clip-path:inset(20% 0 50% 0)}55%{clip-path:inset(10% 0 60% 0)}60%{clip-path:inset(15% 0 55% 0)}65%{clip-path:inset(25% 0 35% 0)}70%{clip-path:inset(30% 0 40% 0)}75%{clip-path:inset(40% 0 20% 0)}80%{clip-path:inset(20% 0 50% 0)}85%{clip-path:inset(10% 0 60% 0)}90%{clip-path:inset(15% 0 55% 0)}95%{clip-path:inset(25% 0 35% 0)}to{clip-path:inset(30% 0 40% 0)}}\n"], encapsulation: i0.ViewEncapsulation.None });
54
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: WrGlitchText, deps: [], target: i0.ɵɵFactoryTarget.Component });
55
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.7", type: WrGlitchText, isStandalone: true, selector: "wr-glitch-text", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: true, transformFunction: null }, speed: { classPropertyName: "speed", publicName: "speed", isSignal: true, isRequired: false, transformFunction: null }, enableShadows: { classPropertyName: "enableShadows", publicName: "enableShadows", isSignal: true, isRequired: false, transformFunction: null }, enableOnHover: { classPropertyName: "enableOnHover", publicName: "enableOnHover", isSignal: true, isRequired: false, transformFunction: null }, background: { classPropertyName: "background", publicName: "background", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.wr-glitch-text--hover-only": "enableOnHover()", "style.--wr-glitch-text-before-duration": "(speed() * 2) + 's'", "style.--wr-glitch-text-after-duration": "(speed() * 3) + 's'", "style.--wr-glitch-text-before-shadow": "beforeShadow()", "style.--wr-glitch-text-after-shadow": "afterShadow()", "style.--wr-glitch-text-bg": "background() || null" }, classAttribute: "wr-glitch-text" }, ngImport: i0, template: "<!--\n Two elements on purpose. The torn clones are `::before` / `::after` whose glyphs\n come from `content: attr(data-text)`, and CSS generated content IS exposed to the\n accessibility tree \u2014 so with the pseudos on the host the string was announced\n three times, and a heading or link wrapping this computed its name as\n \"404 404 404\". The clones now hang off their own `aria-hidden` layer instead:\n the same split `wr-blur-text` and `wr-circular-text` use \u2014 one readable copy,\n one decorative layer taken out of the tree with a single `aria-hidden`.\n\n `__clones` comes second and is absolutely positioned, so it contributes nothing\n to layout and still paints over the label, exactly as the host's own pseudos did.\n-->\n<span class=\"wr-glitch-text__label\">{{ text() }}</span>\n<span class=\"wr-glitch-text__clones\" aria-hidden=\"true\" [attr.data-text]=\"text()\"></span>\n", styles: [".wr-glitch-text{--wr-glitch-text-before-duration: 2s;--wr-glitch-text-after-duration: 3s;--wr-glitch-text-before-shadow: 5px 0 var(--wr-color-info);--wr-glitch-text-after-shadow: -5px 0 var(--wr-color-danger);position:relative;display:inline-block;white-space:nowrap;-webkit-user-select:none;user-select:none;font-weight:900;color:var(--wr-color-on-surface, #0f172a)}.wr-glitch-text__clones{position:absolute;inset:0}.wr-glitch-text__clones:before,.wr-glitch-text__clones:after{content:attr(data-text);position:absolute;top:0;color:inherit;background-color:var(--wr-glitch-text-bg, transparent);overflow:hidden;clip-path:inset(0 0 0 0)}.wr-glitch-text:not(.wr-glitch-text--hover-only) .wr-glitch-text__clones:before{left:-10px;text-shadow:var(--wr-glitch-text-before-shadow);animation:wr-glitch-text-tear var(--wr-glitch-text-before-duration) infinite linear alternate-reverse}.wr-glitch-text:not(.wr-glitch-text--hover-only) .wr-glitch-text__clones:after{left:10px;text-shadow:var(--wr-glitch-text-after-shadow);animation:wr-glitch-text-tear var(--wr-glitch-text-after-duration) infinite linear alternate-reverse}.wr-glitch-text--hover-only .wr-glitch-text__clones:before,.wr-glitch-text--hover-only .wr-glitch-text__clones:after{content:\"\";opacity:0;animation:none}.wr-glitch-text--hover-only:hover .wr-glitch-text__clones:before{content:attr(data-text);opacity:1;left:-10px;text-shadow:var(--wr-glitch-text-before-shadow);animation:wr-glitch-text-tear var(--wr-glitch-text-before-duration) infinite linear alternate-reverse}.wr-glitch-text--hover-only:hover .wr-glitch-text__clones:after{content:attr(data-text);opacity:1;left:10px;text-shadow:var(--wr-glitch-text-after-shadow);animation:wr-glitch-text-tear var(--wr-glitch-text-after-duration) infinite linear alternate-reverse}@media(prefers-reduced-motion:reduce){.wr-glitch-text__clones:before,.wr-glitch-text__clones:after{content:\"\"!important;opacity:0!important;animation:none!important}}@keyframes wr-glitch-text-tear{0%{clip-path:inset(20% 0 50% 0)}5%{clip-path:inset(10% 0 60% 0)}10%{clip-path:inset(15% 0 55% 0)}15%{clip-path:inset(25% 0 35% 0)}20%{clip-path:inset(30% 0 40% 0)}25%{clip-path:inset(40% 0 20% 0)}30%{clip-path:inset(10% 0 60% 0)}35%{clip-path:inset(15% 0 55% 0)}40%{clip-path:inset(25% 0 35% 0)}45%{clip-path:inset(30% 0 40% 0)}50%{clip-path:inset(20% 0 50% 0)}55%{clip-path:inset(10% 0 60% 0)}60%{clip-path:inset(15% 0 55% 0)}65%{clip-path:inset(25% 0 35% 0)}70%{clip-path:inset(30% 0 40% 0)}75%{clip-path:inset(40% 0 20% 0)}80%{clip-path:inset(20% 0 50% 0)}85%{clip-path:inset(10% 0 60% 0)}90%{clip-path:inset(15% 0 55% 0)}95%{clip-path:inset(25% 0 35% 0)}to{clip-path:inset(30% 0 40% 0)}}\n"], encapsulation: i0.ViewEncapsulation.None });
56
56
  }
57
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrGlitchText, decorators: [{
57
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: WrGlitchText, decorators: [{
58
58
  type: Component,
59
59
  args: [{ selector: 'wr-glitch-text', encapsulation: ViewEncapsulation.None, host: {
60
60
  class: 'wr-glitch-text',
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-glitch-text.mjs","sources":["../../../projects/lib/glitch-text/glitch-text.ts","../../../projects/lib/glitch-text/glitch-text.html","../../../projects/lib/glitch-text/ngwr-glitch-text.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n *\n * Angular adaptation of the GlitchText effect by David Haz / reactbits.dev.\n * Original: https://www.reactbits.dev/text-animations/glitch-text\n *\n * Pure CSS — two `::before` / `::after` clones offset by ±10px with\n * coloured `text-shadow`s, both running a clip-path keyframe to slice\n * random horizontal bands. The clones hang off an `aria-hidden` layer\n * rather than the host, because generated content is announced.\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Component, ViewEncapsulation, computed, input } from '@angular/core';\n\nimport { numAttr } from 'ngwr/utils';\n\n/**\n * Glitchy text effect — colour-split horizontal-tear glitch on the\n * provided text. Defaults to playing constantly; toggle `[enableOnHover]`\n * to make it idle until the user hovers.\n *\n * @example\n * ```html\n * <wr-glitch-text text=\"404\" />\n * <wr-glitch-text text=\"ERROR\" [speed]=\"0.5\" [enableOnHover]=\"true\" />\n * ```\n *\n * @see https://www.reactbits.dev/text-animations/glitch-text\n */\n@Component({\n selector: 'wr-glitch-text',\n templateUrl: './glitch-text.html',\n styleUrl: './glitch-text.scss',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-glitch-text',\n '[class.wr-glitch-text--hover-only]': 'enableOnHover()',\n '[style.--wr-glitch-text-before-duration]': \"(speed() * 2) + 's'\",\n '[style.--wr-glitch-text-after-duration]': \"(speed() * 3) + 's'\",\n '[style.--wr-glitch-text-before-shadow]': 'beforeShadow()',\n '[style.--wr-glitch-text-after-shadow]': 'afterShadow()',\n '[style.--wr-glitch-text-bg]': 'background() || null',\n },\n})\nexport class WrGlitchText {\n /** Text to glitch. Required — the value populates `data-text` for the pseudo clones. */\n readonly text = input.required<string>();\n\n /** Time multiplier — higher = slower glitching. @default 1 */\n readonly speed = input(1, { transform: numAttr(1) });\n\n /** Show the red / cyan colour-split shadows. @default true */\n readonly enableShadows = input(true, { transform: coerceBooleanProperty });\n\n /** Only glitch on hover (idle until then). @default true */\n readonly enableOnHover = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Surface colour for the clone slices. Pass the colour of the surface the\n * component sits on so the slicing illusion masks cleanly; leave unset\n * (transparent) on the page canvas. @default '' (transparent)\n */\n readonly background = input('');\n\n protected readonly beforeShadow = computed(() => (this.enableShadows() ? '5px 0 var(--wr-color-info)' : 'none'));\n protected readonly afterShadow = computed(() => (this.enableShadows() ? '-5px 0 var(--wr-color-danger)' : 'none'));\n}\n","<!--\n Two elements on purpose. The torn clones are `::before` / `::after` whose glyphs\n come from `content: attr(data-text)`, and CSS generated content IS exposed to the\n accessibility tree — so with the pseudos on the host the string was announced\n three times, and a heading or link wrapping this computed its name as\n \"404 404 404\". The clones now hang off their own `aria-hidden` layer instead:\n the same split `wr-blur-text` and `wr-circular-text` use — one readable copy,\n one decorative layer taken out of the tree with a single `aria-hidden`.\n\n `__clones` comes second and is absolutely positioned, so it contributes nothing\n to layout and still paints over the label, exactly as the host's own pseudos did.\n-->\n<span class=\"wr-glitch-text__label\">{{ text() }}</span>\n<span class=\"wr-glitch-text__clones\" aria-hidden=\"true\" [attr.data-text]=\"text()\"></span>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAAA;;;;;;;;;;;;;AAaG;AAOH;;;;;;;;;;;;AAYG;MAgBU,YAAY,CAAA;;IAEd,IAAI,GAAG,KAAK,CAAC,QAAQ;6EAAU;;AAG/B,IAAA,KAAK,GAAG,KAAK,CAAC,CAAC,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,OAAA,EAAA,8BAAA,EAAA,CAAA,EAAI,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,EAAA,CAAG;;IAG3C,aAAa,GAAG,KAAK,CAAC,IAAI,qFAAI,SAAS,EAAE,qBAAqB,EAAA,CAAG;;IAGjE,aAAa,GAAG,KAAK,CAAC,IAAI,qFAAI,SAAS,EAAE,qBAAqB,EAAA,CAAG;AAE1E;;;;AAIG;IACM,UAAU,GAAG,KAAK,CAAC,EAAE;mFAAC;AAEZ,IAAA,YAAY,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,aAAa,EAAE,GAAG,4BAA4B,GAAG,MAAM,CAAC;qFAAC;AAC7F,IAAA,WAAW,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,aAAa,EAAE,GAAG,+BAA+B,GAAG,MAAM,CAAC;oFAAC;uGArBvG,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAZ,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAY,ooCChDzB,+4BAcA,EAAA,MAAA,EAAA,CAAA,unFAAA,CAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FDkCa,YAAY,EAAA,UAAA,EAAA,CAAA;kBAfxB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gBAAgB,EAAA,aAAA,EAGX,iBAAiB,CAAC,IAAI,EAAA,IAAA,EAC/B;AACJ,wBAAA,KAAK,EAAE,gBAAgB;AACvB,wBAAA,oCAAoC,EAAE,iBAAiB;AACvD,wBAAA,0CAA0C,EAAE,qBAAqB;AACjE,wBAAA,yCAAyC,EAAE,qBAAqB;AAChE,wBAAA,wCAAwC,EAAE,gBAAgB;AAC1D,wBAAA,uCAAuC,EAAE,eAAe;AACxD,wBAAA,6BAA6B,EAAE,sBAAsB;AACtD,qBAAA,EAAA,QAAA,EAAA,+4BAAA,EAAA,MAAA,EAAA,CAAA,unFAAA,CAAA,EAAA;;;AE9CH;;AAEG;;;;"}
1
+ {"version":3,"file":"ngwr-glitch-text.mjs","sources":["../../../projects/lib/glitch-text/glitch-text.ts","../../../projects/lib/glitch-text/glitch-text.html","../../../projects/lib/glitch-text/ngwr-glitch-text.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n *\n * Angular adaptation of the GlitchText effect by David Haz / reactbits.dev.\n * Original: https://www.reactbits.dev/text-animations/glitch-text\n *\n * Pure CSS — two `::before` / `::after` clones offset by ±10px with\n * coloured `text-shadow`s, both running a clip-path keyframe to slice\n * random horizontal bands. The clones hang off an `aria-hidden` layer\n * rather than the host, because generated content is announced.\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Component, ViewEncapsulation, computed, input } from '@angular/core';\n\nimport { numAttr } from 'ngwr/utils';\n\n/**\n * Glitchy text effect — colour-split horizontal-tear glitch on the\n * provided text. Defaults to playing constantly; toggle `[enableOnHover]`\n * to make it idle until the user hovers.\n *\n * @example\n * ```html\n * <wr-glitch-text text=\"404\" />\n * <wr-glitch-text text=\"ERROR\" [speed]=\"0.5\" [enableOnHover]=\"true\" />\n * ```\n *\n * @see https://www.reactbits.dev/text-animations/glitch-text\n */\n@Component({\n selector: 'wr-glitch-text',\n templateUrl: './glitch-text.html',\n styleUrl: './glitch-text.scss',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-glitch-text',\n '[class.wr-glitch-text--hover-only]': 'enableOnHover()',\n '[style.--wr-glitch-text-before-duration]': \"(speed() * 2) + 's'\",\n '[style.--wr-glitch-text-after-duration]': \"(speed() * 3) + 's'\",\n '[style.--wr-glitch-text-before-shadow]': 'beforeShadow()',\n '[style.--wr-glitch-text-after-shadow]': 'afterShadow()',\n '[style.--wr-glitch-text-bg]': 'background() || null',\n },\n})\nexport class WrGlitchText {\n /** Text to glitch. Required — the value populates `data-text` for the pseudo clones. */\n readonly text = input.required<string>();\n\n /** Time multiplier — higher = slower glitching. @default 1 */\n readonly speed = input(1, { transform: numAttr(1) });\n\n /** Show the red / cyan colour-split shadows. @default true */\n readonly enableShadows = input(true, { transform: coerceBooleanProperty });\n\n /** Only glitch on hover (idle until then). @default true */\n readonly enableOnHover = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Surface colour for the clone slices. Pass the colour of the surface the\n * component sits on so the slicing illusion masks cleanly; leave unset\n * (transparent) on the page canvas. @default '' (transparent)\n */\n readonly background = input('');\n\n protected readonly beforeShadow = computed(() => (this.enableShadows() ? '5px 0 var(--wr-color-info)' : 'none'));\n protected readonly afterShadow = computed(() => (this.enableShadows() ? '-5px 0 var(--wr-color-danger)' : 'none'));\n}\n","<!--\n Two elements on purpose. The torn clones are `::before` / `::after` whose glyphs\n come from `content: attr(data-text)`, and CSS generated content IS exposed to the\n accessibility tree — so with the pseudos on the host the string was announced\n three times, and a heading or link wrapping this computed its name as\n \"404 404 404\". The clones now hang off their own `aria-hidden` layer instead:\n the same split `wr-blur-text` and `wr-circular-text` use — one readable copy,\n one decorative layer taken out of the tree with a single `aria-hidden`.\n\n `__clones` comes second and is absolutely positioned, so it contributes nothing\n to layout and still paints over the label, exactly as the host's own pseudos did.\n-->\n<span class=\"wr-glitch-text__label\">{{ text() }}</span>\n<span class=\"wr-glitch-text__clones\" aria-hidden=\"true\" [attr.data-text]=\"text()\"></span>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAAA;;;;;;;;;;;;;AAaG;AAOH;;;;;;;;;;;;AAYG;MAgBU,YAAY,CAAA;;IAEd,IAAI,GAAG,KAAK,CAAC,QAAQ;6EAAU;;AAG/B,IAAA,KAAK,GAAG,KAAK,CAAC,CAAC,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,OAAA,EAAA,8BAAA,EAAA,CAAA,EAAI,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,EAAA,CAAG;;IAG3C,aAAa,GAAG,KAAK,CAAC,IAAI,qFAAI,SAAS,EAAE,qBAAqB,EAAA,CAAG;;IAGjE,aAAa,GAAG,KAAK,CAAC,IAAI,qFAAI,SA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ects/lib/gradient-text/testing/wr-gradient-text-harness.ts","../../../projects/lib/gradient-text/testing/ngwr-gradient-text-testing.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';\n\nimport type { WrGradientTextDirection } from 'ngwr/gradient-text';\n\nimport type { WrGradientTextHarnessFilters } from './interfaces';\n\nconst GRADIENT = /^linear-gradient\\((.*)\\)$/s;\n\n/** Read one declaration out of an inline `style` attribute, or `null` when it is not there. */\nfunction inlineStyle(style: string | null, property: string): string | null {\n for (const declaration of (style ?? '').split(';')) {\n const colon = declaration.indexOf(':');\n if (colon === -1) continue;\n if (declaration.slice(0, colon).trim() !== property) continue;\n return declaration.slice(colon + 1).trim();\n }\n return null;\n}\n\n/** Split a gradient's argument list on top-level commas — a stop may be `rgb(1, 2, 3)`. */\nfunction splitStops(args: string): string[] {\n const parts: string[] = [];\n let depth = 0;\n let current = '';\n\n for (const character of args) {\n if (character === '(') depth++;\n if (character === ')') depth--;\n\n if (character === ',' && depth === 0) {\n parts.push(current.trim());\n current = '';\n } else {\n current += character;\n }\n }\n\n parts.push(current.trim());\n return parts;\n}\n\n/**\n * Test harness for `<wr-gradient-text>`.\n *\n * **The gradient string is the component.** Everything `[colors]` and `[direction]`\n * decide ends up in one inline custom property — the angle keyword, the stop list, and\n * the first colour repeated at the end, which is what makes the loop seamless instead of\n * snapping back at the wrap. {@link getColors} returns that list AS WRITTEN, wrap stop\n * included, because the duplicate is the thing worth asserting and stripping it would\n * hide the day it goes missing.\n *\n * **The three custom properties are read off the `style` ATTRIBUTE, not through\n * `getCssValue()`, and that is not a jsdom concession.** `.wr-gradient-text` declares\n * its own `--wr-gradient-text-image`, `-size` and `-duration`, spelling out the same\n * defaults the component computes — the three built-in stops with their wrap stop,\n * `300% 100%`, `8s`. So with the stylesheet loaded a computed read answers with a\n * perfectly healthy-looking value at exactly the moment the host binding is what broke,\n * and every throw below goes unreachable. What the component wrote is the only value\n * nothing else can forge.\n *\n * **Direction is two facts, not one.** The modifier class says which way the gradient\n * travels and {@link getBackgroundSize} says which axis it was stretched along, and they\n * are computed separately: a direction change that forgets the size leaves every class\n * looking right while the effect is squashed flat. Note too that `horizontal` writes NO\n * class at all — {@link getDirection} resolves the absence, which is the mapping a\n * refactor breaks most easily.\n *\n * **What the harness deliberately does not offer**, and why. There is no `isAnimating()`\n * / `isPaused()`: the sweep is a stylesheet keyframe, and a unit test loads no\n * stylesheet, so the answer would be the same constant for a working component and a\n * broken one. There is no `getBackgroundPosition()`: the swept value exists only\n * mid-animation, and the static declaration it would return corresponds to no frame the\n * user ever sees. {@link pausesOnHover} claims the CLASS and not the pause, deliberately\n * — `:hover` is a selector, and the DOM after a dispatched mouse event is identical to\n * the DOM before it. There is no `respectsReducedMotion()`: the only handling is a\n * `@media` block with no TypeScript counterpart, so nothing in the DOM changes in either\n * state. And there is nothing that reports the painted text colour: the fill comes from\n * `background-clip: text` over a `color: transparent` declared in the stylesheet, so a\n * read would describe the inherited colour and call the text readable where the browser\n * paints a gradient.\n *\n * @example\n * ```ts\n * const gradient = await loader.getHarness(WrGradientTextHarness);\n *\n * expect(await gradient.getColors()).toEqual(['#111111', '#222222', '#111111']);\n * expect(await gradient.getBackgroundSize()).toBe('300% 100%');\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrGradientTextHarness extends ComponentHarness {\n static hostSelector = 'wr-gradient-text';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrGradientTextHarnessFilters = {}): HarnessPredicate<WrGradientTextHarness> {\n return new HarnessPredicate(WrGradientTextHarness, options)\n .addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text))\n .addOption(\n 'direction',\n options.direction,\n async (harness, direction) => (await harness.getDirection()) === direction\n )\n .addOption('border', options.border, async (harness, border) => (await harness.hasBorderRing()) === border);\n }\n\n private readonly text = this.locatorFor('.wr-gradient-text__text');\n private readonly ring = this.locatorForOptional('.wr-gradient-text__border');\n\n /**\n * The projected text, trimmed.\n *\n * Read from the text span rather than from the host, so the answer stays correct on the\n * day the decorative ring gains content of its own — it is a sibling of this span, and\n * the host's text would include both.\n */\n async getText(): Promise<string> {\n return (await this.text()).text();\n }\n\n /**\n * Which way the gradient travels.\n *\n * `horizontal` is reported for the absence of both modifiers, because the component\n * writes no `--horizontal` class — there is nothing to read for the default, only the\n * two exceptions.\n */\n async getDirection(): Promise<WrGradientTextDirection> {\n const host = await this.host();\n if (await host.hasClass('wr-gradient-text--vertical')) return 'vertical';\n if (await host.hasClass('wr-gradient-text--diagonal')) return 'diagonal';\n return 'horizontal';\n }\n\n /**\n * The whole gradient the component computed, as written.\n *\n * Unresolved on purpose: a consumer may pass theme tokens, and resolving `var()` needs\n * the stylesheet. The stops come back spelled as they were written — a custom property\n * holds an unparsed token stream, so `#111111` stays `#111111` rather than being\n * re-serialised as `rgb()` the way it would be inside a standard `background-image`.\n * Whitespace is the exception, so prefer {@link getColors} over string-equalling the\n * whole gradient.\n */\n async getGradient(): Promise<string> {\n return this.published('--wr-gradient-text-image', 'getGradient');\n }\n\n /**\n * The gradient's colour stops, in order, INCLUDING the repeated first colour at the end.\n *\n * So the list is one longer than the `[colors]` input, and that extra entry is the\n * point: it is what lets the sweep wrap without a visible snap, and nothing else in the\n * DOM records it. An empty `[colors]` falls back to the three built-in stops, which\n * shows up here as four entries rather than one.\n *\n * Throws rather than guessing when the property holds something that is not a\n * `linear-gradient()`, because a list of fragments parsed out of the wreckage would\n * look like a colour set. A host that publishes no gradient at all throws one step\n * earlier, from {@link getGradient}.\n */\n async getColors(): Promise<string[]> {\n const gradient = await this.getGradient();\n const match = GRADIENT.exec(gradient);\n\n if (!match) {\n throw new Error(\n `WrGradientTextHarness.getColors(): \\`--wr-gradient-text-image\\` holds \"${gradient}\", which is not ` +\n 'a linear-gradient(). The component writes that property inline on the host on every render, so ' +\n 'anything else there is the bug rather than a gradient with no stops.'\n );\n }\n\n // The first argument is the angle keyword ('to right' / 'to bottom' / 'to bottom right').\n return splitStops(match[1]).slice(1);\n }\n\n /**\n * How far the gradient is stretched, as the `background-size` pair.\n *\n * The other half of direction: the gradient has to be oversized along the axis it\n * travels — `300% 100%` horizontal, `100% 300%` vertical, `300% 300%` diagonal — or\n * there is nothing outside the box to slide in. Worth asserting beside\n * {@link getDirection}, since the two are computed independently and only agree by\n * intent.\n */\n async getBackgroundSize(): Promise<string> {\n return this.published('--wr-gradient-text-size', 'getBackgroundSize');\n }\n\n /**\n * One full sweep in seconds, from `[animationSpeed]`.\n *\n * Proves the input reaches CSS at all, `numAttr` coercion included — a string attribute\n * arrives as a number and garbage falls back to the documented default. Throws when the\n * property holds something that is not a number of seconds; a host that publishes no\n * duration at all throws from the read itself.\n */\n async getAnimationDurationSeconds(): Promise<number> {\n const raw = await this.published('--wr-gradient-text-duration', 'getAnimationDurationSeconds');\n const seconds = Number.parseFloat(raw);\n\n if (Number.isNaN(seconds)) {\n throw new Error(\n `WrGradientTextHarness.getAnimationDurationSeconds(): \\`--wr-gradient-text-duration\\` holds ` +\n `\"${raw}\", which is not a number of seconds. The component writes it inline on the host from ` +\n '`[animationSpeed]`.'\n );\n }\n return seconds;\n }\n\n /**\n * Whether the decorative ring element was rendered (`showBorder`).\n *\n * Strictly more than the `wr-gradient-text--border` class says: the class is a host\n * binding and the ring is an `@if` branch in the template, two mechanisms reading one\n * input, and they can drift. This asks whether the element that paints the pill is\n * actually there.\n */\n async hasBorderRing(): Promise<boolean> {\n return (await this.ring()) !== null;\n }\n\n /**\n * Whether the ring is hidden from assistive tech, or `null` when there is no ring.\n *\n * The ring is an empty, nameless span. Paired with {@link hasBorderRing} this is the\n * component's whole a11y contract: if it ever loses `aria-hidden`, a screen reader stops\n * on an element with nothing to say. `null` rather than `false` for the absent case, so\n * \"no ring\" cannot be mistaken for \"an exposed ring\".\n */\n async isBorderDecorative(): Promise<boolean | null> {\n const ring = await this.ring();\n return ring === null ? null : (await ring.getAttribute('aria-hidden')) === 'true';\n }\n\n /**\n * Whether the sweep bounces instead of restarting (`yoyo`).\n *\n * Defaults to `true` here, unlike every other boolean on this component and unlike the\n * same-named input on `wr-shiny-text` — worth pinning in both directions. The class is\n * the only thing the `animation-direction: alternate` rule keys off.\n */\n async isYoyo(): Promise<boolean> {\n return (await this.host()).hasClass('wr-gradient-text--yoyo');\n }\n\n /**\n * Whether the opt-in reached the class the `:hover` rule needs.\n *\n * Named for the class and not for the pause on purpose: the pause itself is a CSS\n * selector match, which no unit test can observe. What this catches is the input never\n * arriving, which is the half that can go wrong in TypeScript.\n */\n async pausesOnHover(): Promise<boolean> {\n return (await this.host()).hasClass('wr-gradient-text--pause-on-hover');\n }\n\n /** One of the host's own custom properties. See the class note on why this is not `getCssValue()`. */\n private async published(property: string, method: string): Promise<string> {\n const style = await (await this.host()).getAttribute('style');\n const value = inlineStyle(style, property);\n\n if (value === null) {\n throw new Error(\n `WrGradientTextHarness.${method}(): the host publishes no \\`${property}\\` (style: \"${style ?? ''}\"). ` +\n 'The component writes all three of its custom properties inline on every render, so an absent one ' +\n 'means the host binding is gone — and the stylesheet declares the same default, so a computed read ' +\n 'would have answered as if nothing were wrong.'\n );\n }\n return value;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;AAKG;AAQH,MAAM,QAAQ,GAAG,4BAA4B;AAE7C;AACA,SAAS,WAAW,CAAC,KAAoB,EAAE,QAAgB,EAAA;AACzD,IAAA,KAAK,MAAM,WAAW,IAAI,CAAC,KAAK,IAAI,EAAE,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE;QAClD,MAAM,KAAK,GAAG,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC;QACtC,IAAI,KAAK,KAAK,CAAC,CAAC;YAAE;AAClB,QAAA,IAAI,WAAW,CAAC,KAAK,CAAC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AAE,QAAQ,CAAC,kCAAkC,CAAC;IACzE;;AAGQ,IAAA,MAAM,SAAS,CAAC,QAAgB,EAAE,MAAc,EAAA;AACtD,QAAA,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,YAAY,CAAC,OAAO,CAAC;QAC7D,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC;AAE1C,QAAA,IAAI,KAAK,KAAK,IAAI,EAAE;YAClB,MAAM,IAAI,KAAK,CACb,CAAA,sBAAA,EAAyB,MAAM,CAAA,4BAAA,EAA+B,QAAQ,CAAA,YAAA,EAAe,KAAK,IAAI,EAAE,CAAA,IAAA,CAAM;gBACpG,mGAAmG;gBACnG,oGAAoG;AACpG,gBAAA,+CAA+C,CAClD;QACH;AACA,QAAA,OAAO,KAAK;IACd;;;ACxRF;;AAEG;;;;"}
1
+ {"version":3,"file":"ngwr-gradient-text-testing.mjs","sources":["../../../projects/lib/gradient-text/testing/wr-gradient-text-harness.ts","../../../projects/lib/gradient-text/testing/ngwr-gradient-text-testing.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';\n\nimport type { WrGradientTextDirection } from 'ngwr/gradient-text';\n\nimport type { WrGradientTextHarnessFilters } from './interfaces';\n\nconst GRADIENT = /^linear-gradient\\((.*)\\)$/s;\n\n/** Read one declaration out of an inline `style` attribute, or `null` when it is not there. */\nfunction inlineStyle(style: string | null, property: string): string | null {\n for (const declaration of (style ?? '').split(';')) {\n const colon = declaration.indexOf(':');\n if (colon === -1) continue;\n if (declaration.slice(0, colon).trim() !== property) continue;\n return declaration.slice(colon + 1).trim();\n }\n return null;\n}\n\n/** Split a gradient's argument list on top-level commas — a stop may be `rgb(1, 2, 3)`. */\nfunction splitStops(args: string): string[] {\n const parts: string[] = [];\n let depth = 0;\n let current = '';\n\n for (const character of args) {\n if (character === '(') depth++;\n if (character === ')') depth--;\n\n if (character === ',' && depth === 0) {\n parts.push(current.trim());\n current = '';\n } else {\n current += character;\n }\n }\n\n parts.push(current.trim());\n return parts;\n}\n\n/**\n * Test harness for `<wr-gradient-text>`.\n *\n * **The gradient string is the component.** Everything `[colors]` and `[direction]`\n * decide ends up in one inline custom property — the angle keyword, the stop list, and\n * the first colour repeated at the end, which is what makes the loop seamless instead of\n * snapping back at the wrap. {@link getColors} returns that list AS WRITTEN, wrap stop\n * included, because the duplicate is the thing worth asserting and stripping it would\n * hide the day it goes missing.\n *\n * **The three custom properties are read off the `style` ATTRIBUTE, not through\n * `getCssValue()`, and that is not a jsdom concession.** `.wr-gradient-text` declares\n * its own `--wr-gradient-text-image`, `-size` and `-duration`, spelling out the same\n * defaults the component computes — the three built-in stops with their wrap stop,\n * `300% 100%`, `8s`. So with the stylesheet loaded a computed read answers with a\n * perfectly healthy-looking value at exactly the moment the host binding is what broke,\n * and every throw below goes unreachable. What the component wrote is the only value\n * nothing else can forge.\n *\n * **Direction is two facts, not one.** The modifier class says which way the gradient\n * travels and {@link getBackgroundSize} says which axis it was stretched along, and they\n * are computed separately: a direction change that forgets the size leaves every class\n * looking right while the effect is squashed flat. Note too that `horizontal` writes NO\n * class at all — {@link getDirection} resolves the absence, which is the mapping a\n * refactor breaks most easily.\n *\n * **What the harness deliberately does not offer**, and why. There is no `isAnimating()`\n * / `isPaused()`: the sweep is a stylesheet keyframe, and a unit test loads no\n * stylesheet, so the answer would be the same constant for a working component and a\n * broken one. There is no `getBackgroundPosition()`: the swept value exists only\n * mid-animation, and the static declaration it would return corresponds to no frame the\n * user ever sees. {@link pausesOnHover} claims the CLASS and not the pause, deliberately\n * — `:hover` is a selector, and the DOM after a dispatched mouse event is identical to\n * the DOM before it. There is no `respectsReducedMotion()`: the only handling is a\n * `@media` block with no TypeScript counterpart, so nothing in the DOM changes in either\n * state. And there is nothing that reports the painted text colour: the fill comes from\n * `background-clip: text` over a `color: transparent` declared in the stylesheet, so a\n * read would describe the inherited colour and call the text readable where the browser\n * paints a gradient.\n *\n * @example\n * ```ts\n * const gradient = await loader.getHarness(WrGradientTextHarness);\n *\n * expect(await gradient.getColors()).toEqual(['#111111', '#222222', '#111111']);\n * expect(await gradient.getBackgroundSize()).toBe('300% 100%');\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrGradientTextHarness extends ComponentHarness {\n static hostSelector = 'wr-gradient-text';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrGradientTextHarnessFilters = {}): HarnessPredicate<WrGradientTextHarness> {\n return new HarnessPredicate(WrGradientTextHarness, options)\n .addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text))\n .addOption(\n 'direction',\n options.direction,\n async (harness, direction) => (await harness.getDirection()) === direction\n )\n .addOption('border', options.border, async (harness, border) => (await harness.hasBorderRing()) === border);\n }\n\n private readonly text = this.locatorFor('.wr-gradient-text__text');\n private readonly ring = this.locatorForOptional('.wr-gradient-text__border');\n\n /**\n * The projected text, trimmed.\n *\n * Read from the text span rather than from the host, so the answer stays correct on the\n * day the decorative ring gains content of its own — it is a sibling of this span, and\n * the host's text would include both.\n */\n async getText(): Promise<string> {\n return (await this.text()).text();\n }\n\n /**\n * Which way the gradient travels.\n *\n * `horizontal` is reported for the absence of both modifiers, because the component\n * writes no `--horizontal` class — there is nothing to read for the default, only the\n * two exceptions.\n */\n async getDirection(): Promise<WrGradientTextDirection> {\n const host = await this.host();\n if (await host.hasClass('wr-gradient-text--vertical')) return 'vertical';\n if (await host.hasClass('wr-gradient-text--diagonal')) return 'diagonal';\n return 'horizontal';\n }\n\n /**\n * The whole gradient the component computed, as written.\n *\n * Unresolved on purpose: a consumer may pass theme tokens, and resolving `var()` needs\n * the stylesheet. The stops come back spelled as they were written — a custom property\n * holds an unparsed token stream, so `#111111` stays `#111111` rather than being\n * re-serialised as `rgb()` the way it would be inside a standard `background-image`.\n * Whitespace is the exception, so prefer {@link getColors} over string-equalling the\n * whole gradient.\n */\n async getGradient(): Promise<string> {\n return this.published('--wr-gradient-text-image', 'getGradient');\n }\n\n /**\n * The gradient's colour stops, in order, INCLUDING the repeated first colour at the end.\n *\n * So the list is one longer than the `[colors]` input, and that extra entry is the\n * point: it is what lets the sweep wrap without a visible snap, and nothing else in the\n * DOM records it. An empty `[colors]` falls back to the three built-in stops, which\n * shows up here as four entries rather than one.\n *\n * Throws rather than guessing when the property holds something that is not a\n * `linear-gradient()`, because a list of fragments parsed out of the wreckage would\n * look like a colour set. A host that publishes no gradient at all throws one step\n * earlier, from {@link getGradient}.\n */\n async getColors(): Promise<string[]> {\n const gradient = await this.getGradient();\n const match = GRADIENT.exec(gradient);\n\n if (!match) {\n throw new Error(\n `WrGradientTextHarness.getColors(): \\`--wr-gradient-text-image\\` holds \"${gradient}\", which is not ` +\n 'a linear-gradient(). The component writes that property inline on the host on every render, so ' +\n 'anything else there is the bug rather than a gradient with no stops.'\n );\n }\n\n // The first argument is the angle keyword ('to right' / 'to bottom' / 'to bottom right').\n return splitStops(match[1]).slice(1);\n }\n\n /**\n * How far the gradient is stretched, as the `background-size` pair.\n *\n * The other half of direction: the gradient has to be oversized along the axis it\n * travels — `300% 100%` horizontal, `100% 300%` vertical, `300% 300%` diagonal — or\n * there is nothing outside the box to slide in. Worth asserting beside\n * {@link getDirection}, since the two are computed independently and only agree by\n * intent.\n */\n async getBackgroundSize(): Promise<string> {\n return this.published('--wr-gradient-text-size', 'getBackgroundSize');\n }\n\n /**\n * One full sweep in seconds, from `[animationSpeed]`.\n *\n * Proves the input reaches CSS at all, `numAttr` coercion included — a string attribute\n * arrives as a number and garbage falls back to the documented default. Throws when the\n * property holds something that is not a number of seconds; a host that publishes no\n * duration at all throws from the read itself.\n */\n async getAnimationDurationSeconds(): Promise<number> {\n const raw = await this.published('--wr-gradient-text-duration', 'getAnimationDurationSeconds');\n const seconds = Number.parseFloat(raw);\n\n if (Number.isNaN(seconds)) {\n throw new Error(\n `WrGradientTextHarness.getAnimationDurationSeconds(): \\`--wr-gradient-text-duration\\` holds ` +\n `\"${raw}\", which is not a number of seconds. The component writes it inline on the host from ` +\n '`[animationSpeed]`.'\n );\n }\n return seconds;\n }\n\n /**\n * Whether the decorative ring element was rendered (`showBorder`).\n *\n * Strictly more than the `wr-gradient-text--border` class says: the class is a host\n * binding and the ring is an `@if` branch in the template, two mechanisms reading one\n * input, and they can drift. This asks whether the element that paints the pill is\n * actually there.\n */\n async hasBorderRing(): Promise<boolean> {\n return (await this.ring()) !== null;\n }\n\n /**\n * Whether the ring is hidden from assistive tech, or `null` when there is no ring.\n *\n * The ring is an empty, nameless span. Paired with {@link hasBorderRing} this is the\n * component's whole a11y contract: if it ever loses `aria-hidden`, a screen reader stops\n * on an element with nothing to say. `null` rather than `false` for the absent case, so\n * \"no ring\" cannot be mistaken for \"an exposed ring\".\n */\n async isBorderDecorative(): Promise<boolean | null> {\n const ring = await this.ring();\n return ring === null ? null : (await ring.getAttribute('aria-hidden')) === 'true';\n }\n\n /**\n * Whether the sweep bounces instead of restarting (`yoyo`).\n *\n * Defaults to `true` here, unlike every other boolean on this component and unlike the\n * same-named input on `wr-shiny-text` — worth pinning in both directions. The class is\n * the only thing the `animation-direction: alternate` rule keys off.\n */\n async isYoyo(): Promise<boolean> {\n return (await this.host()).hasClass('wr-gradient-text--yoyo');\n }\n\n /**\n * Whether the opt-in reached the class the `:hover` rule needs.\n *\n * Named for the class and not for the pause on purpose: the pause itself is a CSS\n * selector match, which no unit test can observe. What this catches is the input never\n * arriving, which is the half that can go wrong in TypeScript.\n */\n async pausesOnHover(): Promise<boolean> {\n return (await this.host()).hasClass('wr-gradient-text--pause-on-hover');\n }\n\n /** One of the host's own custom properties. See the class note on why this is not `getCssValue()`. */\n private async published(property: string, method: string): Promise<string> {\n const style = await (await this.host()).getAttribute('style');\n const value = inlineStyle(style, property);\n\n if (value === null) {\n throw new Error(\n `WrGradientTextHarness.${method}(): the host publishes no \\`${property}\\` (style: \"${style ?? ''}\"). ` +\n 'The component writes all three of its custom properties inline on every render, so an absent one ' +\n 'means the host binding is gone — and the stylesheet declares the same default, so a computed read ' +\n 'would have answered as if nothing were wrong.'\n );\n }\n return value;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;AAKG;AAQH,MAAM,QAAQ,GAAG,4BAA4B;AAE7C;AACA,SAAS,WAAW,CAAC,KAAoB,EAAE,QAAgB,EAAA;AACzD,IAAA,KAAK,MAAM,WAAW,IAAI,CAAC,KAAK,IAAI,EAAE,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE;QAClD,MAAM,KAAK,GAAG,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC;QACtC,IAAI,KAAK,KAAK,CAAC,CAAC;YAAE;AAClB,QAAA,IAAI,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,IAAI,EAAE,KAAK,QAAQ;YAAE;QACrD,OAAO,WAAW,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE;IAC5C;AACA,IAAA,OAAO,IAAI;AACb;AAEA;AACA,SAAS,UAAU,CAAC,IAAY,EAAA;IAC9B,MAAM,KAAK,GAAa,EAAE;IAC1B,IAAI,KAAK,GAAG,CAAC;IACb,IAAI,OAAO,GAAG,EAAE;AAEhB,IAAA,KAAK,MAAM,SAAS,IAAI,IAAI,EAAE;QAC5B,IAAI,SAAS,KAAK,GAAG;AAAE,YAAA,KAAK,EAAE;QAC9B,IAAI,SAAS,KAAK,GAAG;AAAE,YAAA,KAAK,EAAE;QAE9B,IAAI,SAAS,KAAK,GAAG,IAAI,KAAK,KAAK,CAAC,EAAE;YACpC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YAC1B,OAAO,GAAG,EAAE;QACd;aAAO;Y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