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-color-picker.mjs","sources":["../../../projects/lib/color-picker/color/rgb-to-hsv.ts","../../../projects/lib/color-picker/color/hsv-to-rgb.ts","../../../projects/lib/color-picker/color/rgb-to-hsl.ts","../../../projects/lib/color-picker/color/hsl-to-rgb.ts","../../../projects/lib/color-picker/color/parse-hex.ts","../../../projects/lib/color-picker/color/to-hex.ts","../../../projects/lib/color-picker/color/parse-color.ts","../../../projects/lib/color-picker/color/format-color.ts","../../../projects/lib/color-picker/color-picker.ts","../../../projects/lib/color-picker/color-picker.html","../../../projects/lib/color-picker/color-picker-trigger.ts","../../../projects/lib/color-picker/ngwr-color-picker.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 type { WrHsv } from './wr-hsv';\nimport type { WrRgb } from './wr-rgb';\n\n/**\n * Convert sRGB to HSV. Preserves alpha.\n */\nexport function rgbToHsv(rgb: WrRgb): WrHsv {\n const r = rgb.r / 255;\n const g = rgb.g / 255;\n const b = rgb.b / 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const d = max - min;\n\n let h = 0;\n if (d !== 0) {\n if (max === r) h = ((g - b) / d) % 6;\n else if (max === g) h = (b - r) / d + 2;\n else h = (r - g) / d + 4;\n h *= 60;\n if (h < 0) h += 360;\n }\n\n const s = max === 0 ? 0 : d / max;\n const v = max;\n\n return { h, s, v, a: rgb.a };\n}\n","/**\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 type { WrHsv } from './wr-hsv';\nimport type { WrRgb } from './wr-rgb';\n\n/**\n * Convert HSV to sRGB. Preserves alpha. Returns integer channels in `[0, 255]`.\n */\nexport function hsvToRgb(hsv: WrHsv): WrRgb {\n const { h, s, v } = hsv;\n const c = v * s;\n const x = c * (1 - Math.abs(((h / 60) % 2) - 1));\n const m = v - c;\n\n let r = 0;\n let g = 0;\n let b = 0;\n\n if (h < 60) {\n r = c;\n g = x;\n } else if (h < 120) {\n r = x;\n g = c;\n } else if (h < 180) {\n g = c;\n b = x;\n } else if (h < 240) {\n g = x;\n b = c;\n } else if (h < 300) {\n r = x;\n b = c;\n } else {\n r = c;\n b = x;\n }\n\n return {\n r: Math.round((r + m) * 255),\n g: Math.round((g + m) * 255),\n b: Math.round((b + m) * 255),\n a: hsv.a,\n };\n}\n","/**\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 type { WrHsl } from './wr-hsl';\nimport type { WrRgb } from './wr-rgb';\n\n/**\n * Convert sRGB to HSL. Preserves alpha.\n */\nexport function rgbToHsl(rgb: WrRgb): WrHsl {\n const r = rgb.r / 255;\n const g = rgb.g / 255;\n const b = rgb.b / 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const d = max - min;\n const l = (max + min) / 2;\n\n let h = 0;\n let s = 0;\n\n if (d !== 0) {\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n\n if (max === r) h = (g - b) / d + (g < b ? 6 : 0);\n else if (max === g) h = (b - r) / d + 2;\n else h = (r - g) / d + 4;\n\n h *= 60;\n }\n\n return { h, s, l, a: rgb.a };\n}\n","/**\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 type { WrHsl } from './wr-hsl';\nimport type { WrRgb } from './wr-rgb';\n\nfunction hueToChannel(p: number, q: number, t: number): number {\n let x = t;\n if (x < 0) x += 1;\n if (x > 1) x -= 1;\n if (x < 1 / 6) return p + (q - p) * 6 * x;\n if (x < 1 / 2) return q;\n if (x < 2 / 3) return p + (q - p) * (2 / 3 - x) * 6;\n return p;\n}\n\n/**\n * Convert HSL to sRGB. Preserves alpha. Returns integer channels in `[0, 255]`.\n */\nexport function hslToRgb(hsl: WrHsl): WrRgb {\n const h = hsl.h / 360;\n const { s, l } = hsl;\n\n let r: number;\n let g: number;\n let b: number;\n\n if (s === 0) {\n r = l;\n g = l;\n b = l;\n } else {\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n r = hueToChannel(p, q, h + 1 / 3);\n g = hueToChannel(p, q, h);\n b = hueToChannel(p, q, h - 1 / 3);\n }\n\n return {\n r: Math.round(r * 255),\n g: Math.round(g * 255),\n b: Math.round(b * 255),\n a: hsl.a,\n };\n}\n","/**\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 type { WrRgb } from './wr-rgb';\n\n/**\n * Parse a CSS hex colour into {@link WrRgb}. Accepts 3, 4, 6, or 8 digit\n * forms with or without a leading `#`. Returns `null` for anything that\n * isn't a valid hex string.\n *\n * @example\n * ```ts\n * parseHex('#f00'); // { r: 255, g: 0, b: 0, a: 1 }\n * parseHex('3969e2'); // { r: 57, g: 105, b: 226, a: 1 }\n * parseHex('#3969e2ff'); // { r: 57, g: 105, b: 226, a: 1 }\n * parseHex('nope'); // null\n * ```\n */\nexport function parseHex(input: string): WrRgb | null {\n if (typeof input !== 'string') return null;\n\n let str = input.trim().replace(/^#/, '').toLowerCase();\n\n // Expand shorthand: rgb → rrggbb, rgba → rrggbbaa\n if (str.length === 3 || str.length === 4) {\n str = str\n .split('')\n .map(c => c + c)\n .join('');\n }\n\n if (str.length !== 6 && str.length !== 8) return null;\n if (!/^[0-9a-f]+$/.test(str)) return null;\n\n const r = parseInt(str.slice(0, 2), 16);\n const g = parseInt(str.slice(2, 4), 16);\n const b = parseInt(str.slice(4, 6), 16);\n const a = str.length === 8 ? parseInt(str.slice(6, 8), 16) / 255 : 1;\n\n return { r, g, b, a };\n}\n","/**\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 type { WrRgb } from './wr-rgb';\n\nfunction channelToHex(n: number): string {\n const clamped = Math.max(0, Math.min(255, Math.round(n)));\n return clamped.toString(16).padStart(2, '0');\n}\n\n/**\n * Format a {@link WrRgb} as a CSS hex string with a leading `#`. When\n * `withAlpha` is `true` the result is 8 digits (`#rrggbbaa`); otherwise\n * 6 digits.\n *\n * @example\n * ```ts\n * toHex({ r: 57, g: 105, b: 226, a: 1 }); // '#3969e2'\n * toHex({ r: 57, g: 105, b: 226, a: 0.5 }, true); // '#3969e280'\n * ```\n */\nexport function toHex(rgb: WrRgb, withAlpha = false): string {\n const r = channelToHex(rgb.r);\n const g = channelToHex(rgb.g);\n const b = channelToHex(rgb.b);\n if (withAlpha) {\n const a = channelToHex(rgb.a * 255);\n return `#${r}${g}${b}${a}`;\n }\n return `#${r}${g}${b}`;\n}\n","/**\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 { clamp } from 'ngwr/utils';\n\nimport { hslToRgb } from './hsl-to-rgb';\nimport { parseHex } from './parse-hex';\nimport type { WrRgb } from './wr-rgb';\n\n/**\n * `rgb(…)` / `rgba(…)`, comma- or space-separated, with an optional `/ alpha`.\n * Signs are accepted so an out-of-range channel CLAMPS the way CSS clamps it,\n * rather than failing to parse and reading as black.\n */\nconst RGB_RE = /^rgba?\\(\\s*(-?[\\d.]+)\\s*[,\\s]\\s*(-?[\\d.]+)\\s*[,\\s]\\s*(-?[\\d.]+)\\s*(?:[,/]\\s*(-?[\\d.]+%?)\\s*)?\\)$/i;\n\n/** `hsl(…)` / `hsla(…)`, with `%` optional on saturation and lightness. */\nconst HSL_RE =\n /^hsla?\\(\\s*(-?[\\d.]+)(?:deg)?\\s*[,\\s]\\s*(-?[\\d.]+)%?\\s*[,\\s]\\s*(-?[\\d.]+)%?\\s*(?:[,/]\\s*(-?[\\d.]+%?)\\s*)?\\)$/i;\n\n/** `0.5` and `50%` are the same alpha; anything absent is fully opaque. */\nfunction alphaOf(raw: string | undefined): number {\n if (raw === undefined) return 1;\n const value = raw.endsWith('%') ? Number(raw.slice(0, -1)) / 100 : Number(raw);\n return Number.isFinite(value) ? clamp(value, 0, 1) : 1;\n}\n\nfunction channel(raw: string): number {\n return clamp(Math.round(Number(raw)), 0, 255);\n}\n\n/**\n * Read a colour written in any format `<wr-color-picker>` can emit — hex,\n * `rgb()` / `rgba()`, `hsl()` / `hsla()` — or `null` when it is none of them.\n *\n * The picker emits in whichever format it was given, so a `[(value)]` binding\n * hands its own output straight back on the next external write. Accepting only\n * hex there (which is what it used to do) turned every non-hex value into black.\n *\n * `null` rather than a throw or a black fallback: the caller is often a text\n * field mid-typing, where \"not valid yet\" is the normal state.\n */\nexport function parseColor(input: string): WrRgb | null {\n const value = input.trim();\n if (value === '') return null;\n\n const hex = parseHex(value);\n if (hex) return hex;\n\n const rgb = RGB_RE.exec(value);\n if (rgb) {\n return { r: channel(rgb[1]), g: channel(rgb[2]), b: channel(rgb[3]), a: alphaOf(rgb[4]) };\n }\n\n const hsl = HSL_RE.exec(value);\n if (hsl) {\n return hslToRgb({\n // Normalised here rather than trusted downstream: `hslToRgb` happens to\n // absorb one negative turn inside `hueToChannel`, which is an internal\n // detail this function should not be leaning on.\n h: ((Number(hsl[1]) % 360) + 360) % 360,\n s: clamp(Number(hsl[2]) / 100, 0, 1),\n l: clamp(Number(hsl[3]) / 100, 0, 1),\n a: alphaOf(hsl[4]),\n });\n }\n\n return null;\n}\n","/**\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 type { WrColorFormat } from '../interfaces';\n\nimport { rgbToHsl } from './rgb-to-hsl';\nimport { toHex } from './to-hex';\nimport type { WrRgb } from './wr-rgb';\n\n/** Alpha with at most two decimals, and no trailing zeroes: `0.5`, not `0.50`. */\nfunction alphaText(a: number): string {\n return String(Math.round(a * 100) / 100);\n}\n\n/**\n * Render a colour in the format a `<wr-color-picker>` was asked for.\n *\n * `withAlpha` follows the picker's own `alpha` input, so each format has an\n * opaque and a translucent spelling — `#3969e2` / `#3969e2ff`,\n * `rgb(…)` / `rgba(…)`, `hsl(…)` / `hsla(…)` — and a picker with the alpha\n * slider turned off never emits a channel the caller cannot see or edit.\n */\nexport function formatColor(rgb: WrRgb, format: WrColorFormat, withAlpha: boolean): string {\n if (format === 'hex') return toHex(rgb, withAlpha);\n\n if (format === 'rgba') {\n const { r, g, b } = rgb;\n return withAlpha ? `rgba(${r}, ${g}, ${b}, ${alphaText(rgb.a)})` : `rgb(${r}, ${g}, ${b})`;\n }\n\n const { h, s, l } = rgbToHsl(rgb);\n const parts = `${Math.round(h)}, ${Math.round(s * 100)}%, ${Math.round(l * 100)}%`;\n return withAlpha ? `hsla(${parts}, ${alphaText(rgb.a)})` : `hsl(${parts})`;\n}\n","/**\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 { Directionality } from '@angular/cdk/bidi';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { DecimalPipe } from '@angular/common';\nimport { Component, ViewEncapsulation, computed, effect, inject, input, model, output, signal } from '@angular/core';\nimport type { FormValueControl } from '@angular/forms/signals';\n\nimport { WR_FORM_FIELD, useFormFieldAria } from 'ngwr/form';\nimport { readI18nText, useI18nFormatter } from 'ngwr/i18n';\nimport { WrSegmented, type WrSegmentedOption } from 'ngwr/segmented';\nimport { clamp } from 'ngwr/utils';\n\nimport {\n formatColor,\n hslToRgb,\n hsvToRgb,\n parseColor,\n parseHex,\n rgbToHsl,\n rgbToHsv,\n toHex,\n type WrHsl,\n type WrRgb,\n} from './color';\nimport type { WrColorFormat } from './interfaces';\n\ntype Tab = 'hex' | 'rgb' | 'hsl';\n\ntype Edges = 'sv' | 'hue' | 'alpha';\n\n/** Arrow step, in each surface's own unit: degrees of hue, percent everywhere else. */\nconst KEY_STEP = 1;\nconst KEY_STEP_COARSE = 10;\n\n/** Whether a hex string carries its own alpha (`#rgba` or `#rrggbbaa`). */\nfunction hasAlphaDigits(hex: string): boolean {\n const digits = hex.trim().replace(/^#/, '').length;\n return digits === 4 || digits === 8;\n}\n\n/**\n * Inline colour picker — HSV canvas, hue slider, optional alpha slider, HEX\n * input.\n *\n * A signal-forms native control: it implements `FormValueControl<string>`, so\n * `[formField]` binds straight to its `value` model — no\n * `ControlValueAccessor` in between. `[(value)]` works standalone. Output is\n * always a hex string.\n *\n * @example\n * ```html\n * <!-- signal forms -->\n * <wr-color-picker [formField]=\"form.brandColor\" />\n *\n * <!-- standalone two-way binding -->\n * <wr-color-picker [(value)]=\"brandColor\" [alpha]=\"false\" />\n * ```\n *\n * @see https://ngwr.dev/reference/components/color-picker\n */\n@Component({\n selector: 'wr-color-picker',\n templateUrl: './color-picker.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n '[class]': 'classes()',\n '[style.--wr-color-picker-hue]': 'hueCss()',\n '[style.--wr-color-picker-rgb]': 'rgbCss()',\n },\n // The picker is the control a `<wr-form-field>` wraps; the `<wr-segmented>` tab\n // strip in its own template is a part, not a control. Without this shield the\n // tab strip found the field's token and announced the colour field's error as\n // its own — which is why `fieldAria` below reads the field with `skipSelf`.\n providers: [{ provide: WR_FORM_FIELD, useValue: null }],\n imports: [DecimalPipe, WrSegmented],\n})\nexport class WrColorPicker implements FormValueControl<string> {\n /** Render the alpha slider and emit 8-digit hex / `rgba()`. @default true */\n readonly alpha = input(true, { transform: coerceBooleanProperty });\n\n /** Disable interaction. @default false */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Refuse changes while every surface stays focusable and the colour still\n * submits. Bound automatically from the field's readonly state when used with\n * `[formField]`.\n *\n * The two sliders keep their tab stop and keep announcing `aria-valuenow` —\n * they simply do not move — the hex / channel fields take the native\n * `readonly` attribute, and the swatches go inert. Switching TABS still works:\n * that changes which notation is displayed, not the colour. `aria-readonly` is\n * mirrored on the sliders, which support it; the saturation surface is a\n * `role=\"group\"`, which does not, so it carries nothing.\n *\n * @default false\n */\n readonly readonly = input(false, { transform: coerceBooleanProperty });\n\n /** The surrounding `<wr-form-field>`'s error state. @internal */\n protected readonly fieldAria = useFormFieldAria({ skipSelf: true });\n\n /**\n * Format the control writes into `value`. See {@link WrColorFormat} — all\n * three are accepted on the way in whichever one is set. @default 'hex'\n */\n readonly format = input<WrColorFormat>('hex');\n\n /** Preset hex colours rendered as a clickable row beneath the inputs. Empty = no row. @default [] */\n readonly swatches = input<readonly string[]>([]);\n\n /** The selected colour as a string. Bound by `[formField]`, or two-way via `[(value)]`. */\n readonly value = model<string>('');\n\n /** Emitted on blur so a bound field can mark itself touched. */\n readonly touch = output<void>();\n\n // Source of truth: HSV + alpha\n\n protected readonly h = signal(0);\n protected readonly s = signal(0);\n protected readonly v = signal(0);\n protected readonly a = signal(1);\n\n // Derived values\n\n /** RGB view of the current colour, computed lazily. */\n protected readonly rgb = computed<WrRgb>(() => hsvToRgb({ h: this.h(), s: this.s(), v: this.v(), a: this.a() }));\n\n /** Canonical hex — what the HEX field shows, whatever `format` emits. */\n protected readonly hex = computed(() => toHex(this.rgb(), this.alpha()));\n\n /** The colour as the consumer asked for it; this is what `value` receives. */\n protected readonly formatted = computed(() => formatColor(this.rgb(), this.format(), this.alpha()));\n\n /** SV canvas background colour (full-saturation hue). */\n protected readonly hueCss = computed(() => `hsl(${this.h()}, 100%, 50%)`);\n\n /** RGB string used for the alpha-slider gradient. */\n protected readonly rgbCss = computed(() => {\n const { r, g, b } = this.rgb();\n return `${r}, ${g}, ${b}`;\n });\n\n /**\n * Ambient reading direction, for the two SLIDERS only — see `updateFromEvent`\n * for why the SV canvas is not in that set.\n *\n * Optional so a bare `TestBed` — or any consumer that never set a direction —\n * needs no provider; `Directionality` is root-provided, so `null` only ever\n * means \"nobody asked\", which is LTR. Read inside the handlers rather than\n * cached: the thumbs are placed with `inset-inline-start`, so the tracks mirror\n * from CSS alone and a runtime flip needs no subscription to\n * `Directionality.change`.\n */\n private readonly dir = inject(Directionality, { optional: true });\n\n /** Thumb positions in % for each surface. */\n protected readonly svThumbX = computed(() => this.s() * 100);\n protected readonly svThumbY = computed(() => (1 - this.v()) * 100);\n protected readonly hueThumbX = computed(() => (this.h() / 360) * 100);\n protected readonly alphaThumbX = computed(() => this.a() * 100);\n\n /** Mirror of the canonical hex, edited by the user via the input field. */\n protected readonly hexInput = signal('');\n\n /** Active tab in the input switcher. */\n protected readonly activeTab = signal<Tab>('hex');\n\n /** HSL view of the current colour, computed lazily. */\n protected readonly hslView = computed<WrHsl>(() => rgbToHsl(this.rgb()));\n\n /** Alpha as integer percent — the numeric tabs and the alpha slider's `aria-valuenow`. */\n protected readonly alphaPercent = computed(() => Math.round(this.a() * 100));\n\n /** Hue in whole degrees, for the hue slider's `aria-valuenow`. */\n protected readonly hueValue = computed(() => Math.round(this.h()));\n\n private readonly areaLabel = useI18nFormatter(\n 'colorPicker.area',\n 'Saturation and brightness, {{saturation}}% and {{brightness}}%'\n );\n\n /** Name of the SV surface, carrying the two values a `role=\"group\"` cannot. */\n protected readonly resolvedAreaLabel = computed(() =>\n this.areaLabel({ saturation: Math.round(this.s() * 100), brightness: Math.round(this.v() * 100) })\n );\n\n protected readonly resolvedHueLabel = readI18nText('colorPicker.hue', 'Hue');\n protected readonly resolvedAlphaLabel = readI18nText('colorPicker.alpha', 'Opacity');\n\n /**\n * Every visible word in this component that is not a slider name.\n *\n * The format strip and the nine channel captions were literals — three in\n * TypeScript, the rest in the template — beside a `colorPicker` catalog\n * section that already existed and held the slider names. So the section was\n * there and these had simply not been put in it, which is why a fully Russian\n * picker still read `HEX RGB HSL` over `R G B`. Each caption is one string\n * INCLUDING its `%`, because a locale that spaces the sign differently has to\n * move the letter and the sign together.\n *\n * Signals, not strings: they follow a locale switch, and a catalog that lands\n * a microtask after the first change-detection pass.\n */\n protected readonly channelHexLabel = readI18nText('colorPicker.channelHex', 'HEX');\n protected readonly channelRedLabel = readI18nText('colorPicker.channelRed', 'R');\n protected readonly channelGreenLabel = readI18nText('colorPicker.channelGreen', 'G');\n protected readonly channelBlueLabel = readI18nText('colorPicker.channelBlue', 'B');\n protected readonly channelHueLabel = readI18nText('colorPicker.channelHue', 'H');\n protected readonly channelSaturationLabel = readI18nText('colorPicker.channelSaturation', 'S%');\n protected readonly channelLightnessLabel = readI18nText('colorPicker.channelLightness', 'L%');\n protected readonly channelAlphaLabel = readI18nText('colorPicker.channelAlpha', 'A%');\n\n private readonly formatHexLabel = readI18nText('colorPicker.formatHex', 'HEX');\n private readonly formatRgbLabel = readI18nText('colorPicker.formatRgb', 'RGB');\n private readonly formatHslLabel = readI18nText('colorPicker.formatHsl', 'HSL');\n\n /** A `computed`, because `WrSegmentedOption.label` is a plain string. */\n protected readonly tabOptions = computed<readonly WrSegmentedOption<Tab>[]>(() => [\n { value: 'hex', label: this.formatHexLabel() },\n { value: 'rgb', label: this.formatRgbLabel() },\n { value: 'hsl', label: this.formatHslLabel() },\n ]);\n\n protected readonly classes = computed(() => {\n const parts = ['wr-color-picker'];\n if (this.alpha()) parts.push('wr-color-picker--alpha');\n if (this.disabled()) parts.push('wr-color-picker--disabled');\n else if (this.readonly()) parts.push('wr-color-picker--readonly');\n return parts.join(' ');\n });\n\n /**\n * The one write we just made, held only until the sync effect has seen it.\n *\n * It exists so a drag keeps its continuous HSV values instead of being\n * re-quantised through its own hex round-trip. It used to be set and never\n * cleared, which turned \"ignore this write\" into \"ignore this STRING,\n * forever\": after the picker emitted `#ff0000` once, an app writing\n * `#ff0000` back — a reset button, a form patch, an undo — was silently\n * dropped for the rest of the component's life, and the surface kept\n * whatever colour the user had dragged to.\n */\n private lastEmitted: string | null = null;\n\n constructor() {\n // External writes (via `[formField]` / `[(value)]`) flow the incoming hex\n // string back into the HSV source of truth. Our own emits are skipped via\n // `lastEmitted` so dragging keeps its continuous (unquantised) values.\n effect(() => {\n const value = this.value();\n if (value === this.lastEmitted) {\n // Ours, and now observed. Release the guard so the NEXT write of the\n // same string — which can only come from outside — is honoured.\n this.lastEmitted = null;\n return;\n }\n const rgb = parseColor(value) ?? { r: 0, g: 0, b: 0, a: 1 };\n const hsv = rgbToHsv(rgb);\n this.h.set(hsv.h);\n this.s.set(hsv.s);\n this.v.set(hsv.v);\n this.a.set(hsv.a);\n this.hexInput.set(toHex(rgb, this.alpha()));\n });\n }\n\n // Drag handlers\n\n protected onPointerDown(event: PointerEvent, surface: Edges): void {\n if (this.disabled() || this.readonly()) return;\n // Primary button, primary pointer: a right-click used to open the context\n // menu AND start a drag, and a second finger used to fight the first one.\n if (event.button !== 0 || !event.isPrimary) return;\n event.preventDefault();\n const target = event.currentTarget as HTMLElement;\n target.setPointerCapture(event.pointerId);\n\n const update = (e: PointerEvent): void => this.updateFromEvent(e, target, surface);\n const cleanup = (e: PointerEvent): void => {\n target.releasePointerCapture(e.pointerId);\n target.removeEventListener('pointermove', update);\n target.removeEventListener('pointerup', cleanup);\n target.removeEventListener('pointercancel', cleanup);\n this.touch.emit();\n };\n\n target.addEventListener('pointermove', update);\n target.addEventListener('pointerup', cleanup);\n // `pointercancel` never sends a `pointerup` after it, so without this the\n // move listener outlived the drag: a cancelled gesture left the surface\n // repainting the colour under a pointer that was only hovering.\n target.addEventListener('pointercancel', cleanup);\n this.updateFromEvent(event, target, surface);\n }\n\n // Keyboard handlers\n //\n // The three surfaces used to be bare `<div>`s carrying nothing but\n // `(pointerdown)` — no role, no name, no tab stop, no key handler — so the\n // control the component is built around was operable by pointer only. The\n // numeric HEX / RGB / HSL fields could always reach the same values, which is\n // why this is 4.1.2 rather than a total loss of keyboard access, but a\n // roleless div driving a colour is WCAG F59 either way.\n\n /**\n * Hue and alpha are real one-value sliders, so they take the APG slider keys —\n * the same set `wr-knob` and `wr-slider` implement, including Home / End.\n *\n * The horizontal arrows name a SIDE of the track and so follow the reading\n * direction, exactly as `wr-slider`'s do; the vertical pair names a value's\n * direction and never mirrors.\n */\n protected onSliderKeydown(event: KeyboardEvent, surface: 'hue' | 'alpha'): void {\n if (this.disabled() || this.readonly()) return;\n const step = event.shiftKey ? KEY_STEP_COARSE : KEY_STEP;\n const inline = this.dir?.value === 'rtl' ? -step : step;\n const max = surface === 'hue' ? 360 : 100;\n const current = surface === 'hue' ? this.h() : this.a() * 100;\n let next: number;\n switch (event.key) {\n case 'ArrowRight':\n next = current + inline;\n break;\n case 'ArrowUp':\n next = current + step;\n break;\n case 'ArrowLeft':\n next = current - inline;\n break;\n case 'ArrowDown':\n next = current - step;\n break;\n case 'Home':\n next = 0;\n break;\n case 'End':\n next = max;\n break;\n default:\n return;\n }\n event.preventDefault();\n const value = clamp(next, 0, max);\n if (surface === 'hue') this.h.set(value);\n else this.a.set(value / 100);\n this.emit();\n }\n\n /**\n * The SV canvas is two axes at once, so the keys follow the picture: left and\n * right run along saturation, up and down along brightness — the directions\n * the thumb visibly moves. Shift takes ten percent at a time.\n *\n * Not mirrored under `dir=\"rtl\"`, unlike the two sliders above, and for the\n * reason given on `fraction()`: the canvas is a picture rather than a track, so\n * its gradient does not flip and neither may the keys that walk it.\n */\n protected onAreaKeydown(event: KeyboardEvent): void {\n if (this.disabled() || this.readonly()) return;\n const step = (event.shiftKey ? KEY_STEP_COARSE : KEY_STEP) / 100;\n switch (event.key) {\n case 'ArrowRight':\n this.s.set(clamp(this.s() + step, 0, 1));\n break;\n case 'ArrowLeft':\n this.s.set(clamp(this.s() - step, 0, 1));\n break;\n case 'ArrowUp':\n this.v.set(clamp(this.v() + step, 0, 1));\n break;\n case 'ArrowDown':\n this.v.set(clamp(this.v() - step, 0, 1));\n break;\n default:\n return;\n }\n event.preventDefault();\n this.emit();\n }\n\n /** Leaving a surface is what \"touched\" means, the same as leaving the hex field. */\n protected onSurfaceBlur(): void {\n this.touch.emit();\n }\n\n /**\n * The pointer's position along a surface, as a 0–1 fraction.\n *\n * Measured from whichever edge the surface STARTS at, and the two surfaces do\n * not agree on what that means — deliberately.\n *\n * The hue and alpha bars are one-value tracks with `role=\"slider\"`, the same\n * widget `wr-slider` is, so they mirror: their thumbs are placed with\n * `inset-inline-start` and their gradients are flipped by a `[dir='rtl']` rule,\n * which makes the reader's start the physical right edge under `dir=\"rtl\"`.\n * Opacity 100% used to sit at the physical right in both directions, i.e. at\n * the reader's START in RTL, while the format strip in the same panel mirrored\n * correctly.\n *\n * The SV canvas does NOT mirror, and stays measured from `rect.left`. It is a\n * two-axis colour FIELD, not a track — the component says so itself by giving\n * it `role=\"group\"` rather than `role=\"slider\"`, because it carries two values\n * and a slider has one. A picture with no start and no end has nothing to\n * mirror, and flipping it would only move white to the other side of an image\n * every colour picker in the world draws the same way.\n */\n private fraction(event: PointerEvent, rect: DOMRect, surface: Edges): number {\n const offset =\n surface !== 'sv' && this.dir?.value === 'rtl' ? rect.right - event.clientX : event.clientX - rect.left;\n return clamp(offset / rect.width, 0, 1);\n }\n\n private updateFromEvent(event: PointerEvent, target: HTMLElement, surface: Edges): void {\n const rect = target.getBoundingClientRect();\n const x = this.fraction(event, rect, surface);\n\n if (surface === 'sv') {\n const y = clamp((event.clientY - rect.top) / rect.height, 0, 1);\n this.s.set(x);\n this.v.set(1 - y);\n } else if (surface === 'hue') {\n this.h.set(x * 360);\n } else {\n this.a.set(x);\n }\n this.emit();\n }\n\n // Hex input handlers\n\n protected onHexInput(event: Event): void {\n if (this.disabled() || this.readonly()) return;\n const raw = (event.target as HTMLInputElement).value;\n this.hexInput.set(raw);\n const rgb = parseHex(raw);\n if (!rgb) return;\n const hsv = rgbToHsv(rgb);\n this.h.set(hsv.h);\n this.s.set(hsv.s);\n this.v.set(hsv.v);\n this.a.set(hsv.a);\n this.emitWithoutHexSync();\n }\n\n protected onHexBlur(): void {\n // Re-sync the input with the canonical value (in case the user typed invalid).\n this.hexInput.set(this.hex());\n this.touch.emit();\n }\n\n // Emission\n\n private emit(): void {\n this.emitWithoutHexSync();\n this.hexInput.set(this.hex());\n }\n\n private emitWithoutHexSync(): void {\n const next = this.formatted();\n this.lastEmitted = next;\n this.value.set(next);\n }\n\n // Tab + channel handlers\n\n protected onTabChange(tab: Tab | null): void {\n if (tab) this.activeTab.set(tab);\n }\n\n protected onRgbChannel(channel: 'r' | 'g' | 'b', event: Event): void {\n if (this.disabled() || this.readonly()) return;\n const n = clamp(Number((event.target as HTMLInputElement).value), 0, 255);\n if (Number.isNaN(n)) return;\n const current = this.rgb();\n const next: WrRgb = { ...current, [channel]: n };\n this.applyRgb(next);\n }\n\n protected onHslChannel(channel: 'h' | 's' | 'l', event: Event): void {\n if (this.disabled() || this.readonly()) return;\n const n = Number((event.target as HTMLInputElement).value);\n if (Number.isNaN(n)) return;\n const current = this.hslView();\n const next: WrHsl =\n channel === 'h' ? { ...current, h: clamp(n, 0, 360) } : { ...current, [channel]: clamp(n, 0, 100) / 100 };\n this.applyRgb(hslToRgb(next));\n }\n\n protected onAlphaPercent(event: Event): void {\n if (this.disabled() || this.readonly()) return;\n const n = clamp(Number((event.target as HTMLInputElement).value), 0, 100);\n if (Number.isNaN(n)) return;\n this.a.set(n / 100);\n this.emit();\n }\n\n protected onSwatchClick(hex: string): void {\n if (this.disabled() || this.readonly()) return;\n const rgb = parseHex(hex);\n if (!rgb) return;\n // A 6-digit swatch says nothing about alpha, and `parseHex` reports the\n // absence as `1` — so picking a preset used to silently snap a translucent\n // colour back to fully opaque.\n this.applyRgb(hasAlphaDigits(hex) ? rgb : { ...rgb, a: this.a() });\n }\n\n /** Push an RGB triple into the HSV source of truth. */\n private applyRgb(rgb: WrRgb): void {\n const hsv = rgbToHsv(rgb);\n this.h.set(hsv.h);\n this.s.set(hsv.s);\n this.v.set(hsv.v);\n this.a.set(hsv.a);\n this.emit();\n }\n}\n","<!--\n `role=\"group\"` rather than `role=\"slider\"`, because this surface holds TWO\n values and a slider has one `aria-valuenow`; and rather than\n `role=\"application\"`, which would switch the reader out of its own browse mode\n for the whole subtree — the call `wr-image-cropper` already made. A group has\n no value of its own, so the two percentages ride in its accessible name, which\n is where a reader querying the focused element finds them.\n-->\n<div\n class=\"wr-color-picker__sv\"\n role=\"group\"\n [attr.aria-label]=\"resolvedAreaLabel()\"\n [attr.aria-disabled]=\"disabled() || null\"\n [attr.aria-invalid]=\"fieldAria.ariaInvalid()\"\n [attr.aria-describedby]=\"fieldAria.describedBy()\"\n [attr.tabindex]=\"disabled() ? -1 : 0\"\n (pointerdown)=\"onPointerDown($event, 'sv')\"\n (keydown)=\"onAreaKeydown($event)\"\n (blur)=\"onSurfaceBlur()\"\n>\n <span class=\"wr-color-picker__thumb\" [style.left.%]=\"svThumbX()\" [style.top.%]=\"svThumbY()\"></span>\n</div>\n\n<div\n class=\"wr-color-picker__slider wr-color-picker__slider--hue\"\n role=\"slider\"\n aria-valuemin=\"0\"\n aria-valuemax=\"360\"\n [attr.aria-label]=\"resolvedHueLabel()\"\n [attr.aria-valuenow]=\"hueValue()\"\n [attr.aria-disabled]=\"disabled() || null\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-invalid]=\"fieldAria.ariaInvalid()\"\n [attr.aria-describedby]=\"fieldAria.describedBy()\"\n [attr.tabindex]=\"disabled() ? -1 : 0\"\n (pointerdown)=\"onPointerDown($event, 'hue')\"\n (keydown)=\"onSliderKeydown($event, 'hue')\"\n (blur)=\"onSurfaceBlur()\"\n>\n <!--\n `inset-inline-start`, not `left`: this is a one-value track, so it mirrors\n under `dir=\"rtl\"` the way `wr-slider` does. The SV thumb above keeps `left` —\n the canvas is a picture and does not flip.\n -->\n <span class=\"wr-color-picker__thumb wr-color-picker__thumb--slider\" [style.inset-inline-start.%]=\"hueThumbX()\"></span>\n</div>\n\n@if (alpha()) {\n <div\n class=\"wr-color-picker__slider wr-color-picker__slider--alpha\"\n role=\"slider\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n [attr.aria-label]=\"resolvedAlphaLabel()\"\n [attr.aria-valuenow]=\"alphaPercent()\"\n [attr.aria-valuetext]=\"`${alphaPercent()}%`\"\n [attr.aria-disabled]=\"disabled() || null\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-invalid]=\"fieldAria.ariaInvalid()\"\n [attr.aria-describedby]=\"fieldAria.describedBy()\"\n [attr.tabindex]=\"disabled() ? -1 : 0\"\n (pointerdown)=\"onPointerDown($event, 'alpha')\"\n (keydown)=\"onSliderKeydown($event, 'alpha')\"\n (blur)=\"onSurfaceBlur()\"\n >\n <span\n class=\"wr-color-picker__thumb wr-color-picker__thumb--slider\"\n [style.inset-inline-start.%]=\"alphaThumbX()\"\n ></span>\n </div>\n}\n\n<div class=\"wr-color-picker__chrome\">\n <span class=\"wr-color-picker__preview\" [style.background]=\"hex()\"></span>\n <wr-segmented\n class=\"wr-color-picker__tabs\"\n [options]=\"tabOptions()\"\n [value]=\"activeTab()\"\n (valueChange)=\"onTabChange($event)\"\n />\n</div>\n\n@switch (activeTab()) {\n @case ('hex') {\n <div class=\"wr-color-picker__inputs wr-color-picker__inputs--hex\">\n <label class=\"wr-color-picker__field wr-color-picker__field--wide\">\n <input\n type=\"text\"\n spellcheck=\"false\"\n autocomplete=\"off\"\n [value]=\"hexInput()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (input)=\"onHexInput($event)\"\n (blur)=\"onHexBlur()\"\n />\n <span class=\"wr-color-picker__field-label\">{{ channelHexLabel() }}</span>\n </label>\n </div>\n }\n @case ('rgb') {\n <div class=\"wr-color-picker__inputs\">\n <label class=\"wr-color-picker__field\">\n <input\n type=\"number\"\n min=\"0\"\n max=\"255\"\n [value]=\"rgb().r\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (input)=\"onRgbChannel('r', $event)\"\n />\n <span class=\"wr-color-picker__field-label\">{{ channelRedLabel() }}</span>\n </label>\n <label class=\"wr-color-picker__field\">\n <input\n type=\"number\"\n min=\"0\"\n max=\"255\"\n [value]=\"rgb().g\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (input)=\"onRgbChannel('g', $event)\"\n />\n <span class=\"wr-color-picker__field-label\">{{ channelGreenLabel() }}</span>\n </label>\n <label class=\"wr-color-picker__field\">\n <input\n type=\"number\"\n min=\"0\"\n max=\"255\"\n [value]=\"rgb().b\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (input)=\"onRgbChannel('b', $event)\"\n />\n <span class=\"wr-color-picker__field-label\">{{ channelBlueLabel() }}</span>\n </label>\n @if (alpha()) {\n <label class=\"wr-color-picker__field\">\n <input\n type=\"number\"\n min=\"0\"\n max=\"100\"\n [value]=\"alphaPercent()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (input)=\"onAlphaPercent($event)\"\n />\n <span class=\"wr-color-picker__field-label\">{{ channelAlphaLabel() }}</span>\n </label>\n }\n </div>\n }\n @case ('hsl') {\n <div class=\"wr-color-picker__inputs\">\n <label class=\"wr-color-picker__field\">\n <input\n type=\"number\"\n min=\"0\"\n max=\"360\"\n [value]=\"hslView().h | number: '1.0-0'\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (input)=\"onHslChannel('h', $event)\"\n />\n <span class=\"wr-color-picker__field-label\">{{ channelHueLabel() }}</span>\n </label>\n <label class=\"wr-color-picker__field\">\n <input\n type=\"number\"\n min=\"0\"\n max=\"100\"\n [value]=\"hslView().s * 100 | number: '1.0-0'\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (input)=\"onHslChannel('s', $event)\"\n />\n <span class=\"wr-color-picker__field-label\">{{ channelSaturationLabel() }}</span>\n </label>\n <label class=\"wr-color-picker__field\">\n <input\n type=\"number\"\n min=\"0\"\n max=\"100\"\n [value]=\"hslView().l * 100 | number: '1.0-0'\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (input)=\"onHslChannel('l', $event)\"\n />\n <span class=\"wr-color-picker__field-label\">{{ channelLightnessLabel() }}</span>\n </label>\n @if (alpha()) {\n <label class=\"wr-color-picker__field\">\n <input\n type=\"number\"\n min=\"0\"\n max=\"100\"\n [value]=\"alphaPercent()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (input)=\"onAlphaPercent($event)\"\n />\n <span class=\"wr-color-picker__field-label\">{{ channelAlphaLabel() }}</span>\n </label>\n }\n </div>\n }\n}\n\n@if (swatches().length > 0) {\n <div class=\"wr-color-picker__swatches\">\n @for (color of swatches(); track color) {\n <button\n type=\"button\"\n class=\"wr-color-picker__swatch\"\n [style.background]=\"color\"\n [attr.aria-label]=\"color\"\n [disabled]=\"disabled() || readonly()\"\n (click)=\"onSwatchClick(color)\"\n ></button>\n }\n </div>\n}\n","/**\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 { Directionality } from '@angular/cdk/bidi';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { type OverlayRef, ScrollStrategyOptions } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport {\n DestroyRef,\n Directive,\n ElementRef,\n Injector,\n ViewContainerRef,\n inject,\n input,\n model,\n output,\n signal,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { WR_OVERLAY, WrOutsideClick, wrFollowDirection } from 'ngwr/overlay';\n\nimport { WrColorPicker } from './color-picker';\nimport type { WrColorFormat } from './interfaces';\n\nlet triggerUid = 0;\n\n/**\n * Opens a `<wr-color-picker>` in an overlay anchored to the host element.\n *\n * Apply to any clickable element (typically a button). Two-way binds the\n * current colour through `[(value)]`; forwards `alpha` / `format` /\n * `swatches` / `disabled` to the inner picker.\n *\n * Same overlay isolation as the rest of the lib — uses {@link WR_OVERLAY},\n * not CDK's root container.\n *\n * @example\n * ```html\n * <button wrColorPickerTrigger\n * [(value)]=\"brandColor\"\n * [swatches]=\"palette\">\n * <span class=\"swatch\" [style.background]=\"brandColor\"></span>\n * {{ brandColor }}\n * </button>\n * ```\n *\n * @see https://ngwr.dev/reference/components/color-picker\n */\n@Directive({\n selector: '[wrColorPickerTrigger]',\n exportAs: 'wrColorPickerTrigger',\n host: {\n '(click)': 'toggle()',\n // The same two attributes `<wr-popover>`'s trigger carries: without them the\n // button gave no hint that it opens anything, and never said it was open.\n '[attr.aria-haspopup]': '\"dialog\"',\n '[attr.aria-expanded]': 'isOpen()',\n // Which panel, and only while there is one — the same pairing `[wrPopconfirm]`\n // publishes. Without it nothing on the page connects the trigger to the picker\n // it opened, so a second trigger's panel is indistinguishable from this one's.\n '[attr.aria-controls]': 'isOpen() ? panelId : null',\n // The directive's own `disabled` never reached the DOM: it gates `toggle()` and\n // is forwarded to the inner picker, so the button looked live to a screen\n // reader and did nothing when pressed.\n '[attr.aria-disabled]': 'disabled() ? true : null',\n },\n})\nexport class WrColorPickerTrigger {\n /** Two-way bindable colour value (hex string). */\n readonly value = model<string>('');\n\n /** Forwarded to the inner picker. @default true */\n readonly alpha = input(true, { transform: coerceBooleanProperty });\n\n /** Forwarded to the inner picker. @default 'hex' */\n readonly format = input<WrColorFormat>('hex');\n\n /** Forwarded to the inner picker. @default [] */\n readonly swatches = input<readonly string[]>([]);\n\n /** Disable the trigger entirely. @default false */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /** Fires after the picker opens. */\n readonly opened = output<void>();\n\n /** Fires after the picker closes. */\n readonly closed = output<void>();\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly overlay = inject(WR_OVERLAY);\n private readonly outsideClick = inject(WrOutsideClick);\n private readonly vcr = inject(ViewContainerRef);\n private readonly scrollStrategies = inject(ScrollStrategyOptions);\n private readonly destroyRef = inject(DestroyRef);\n private readonly injector = inject(Injector);\n /**\n * Ambient reading direction, for the open panel alone — nothing in this\n * directive reads it directly. Optional so a bare `TestBed` needs no\n * provider; `Directionality` is root-provided anyway, and a missing one\n * simply reads as `ltr`.\n */\n private readonly dir = inject(Directionality, { optional: true });\n\n protected readonly isOpen = signal(false);\n private overlayRef: OverlayRef | null = null;\n\n /** @internal Public so the host binding can read it. */\n protected readonly panelId = `wr-color-picker-panel-${++triggerUid}`;\n\n constructor() {\n this.destroyRef.onDestroy(() => this.dispose());\n }\n\n /** Toggle the picker. Open if closed, close if open. */\n toggle(): void {\n if (this.disabled()) return;\n if (this.isOpen()) {\n this.close();\n } else {\n this.open();\n }\n }\n\n /** Open the picker. No-op if already open. */\n open(): void {\n if (this.isOpen() || this.disabled()) return;\n\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.host)\n .withPositions([\n { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top', offsetY: 4 },\n { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom', offsetY: -4 },\n { originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top', offsetY: 4 },\n { originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom', offsetY: -4 },\n ])\n .withPush(true);\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: this.scrollStrategies.reposition(),\n panelClass: 'wr-color-picker-overlay',\n });\n this.overlayRef.overlayElement.id = this.panelId;\n\n // Two of the four fallbacks anchor on `end`, and the CDK resolves start /\n // end against the direction it captured when this ref was created. The\n // `<wr-segmented>` the picker draws its HEX / RGB / HSL tabs with is the\n // visible half: its thumb reads `Directionality` LIVE, so a flip while this\n // panel was open slid the thumb to the other slot inside a pane still drawn\n // `ltr` — parked under the wrong tab, which is the symptom that started all\n // of this.\n wrFollowDirection(this.overlayRef, this.dir, this.injector);\n\n const portal = new ComponentPortal(WrColorPicker, this.vcr);\n const ref = this.overlayRef.attach(portal);\n\n ref.setInput('alpha', this.alpha());\n ref.setInput('format', this.format());\n ref.setInput('swatches', this.swatches());\n ref.setInput('disabled', this.disabled());\n ref.setInput('value', this.value());\n\n // Render now rather than next frame: the picker's surfaces have to exist\n // before focus can move to one, and a deferred focus is the class of bug\n // this repo keeps finding.\n ref.changeDetectorRef.detectChanges();\n // Focus has to ENTER the panel. The overlay container sits at the end of\n // `<body>`, so a Tab from the trigger went to the next thing on the PAGE and\n // the saturation surface and both sliders — all `tabindex=\"0\"`, all\n // `role=\"slider\"` or `role=\"group\"` — were unreachable from the keyboard for\n // as long as the picker was open. The saturation surface is the first stop\n // and the one that carries the colour's two main values.\n //\n // Deliberately NOT a focus trap, matching `wr-popover` / `[wrPopconfirm]`:\n // this popup is non-modal, an outside click or Escape closes it, and\n // trapping would only make it harder to leave.\n this.overlayRef.overlayElement.querySelector<HTMLElement>('.wr-color-picker__sv')?.focus();\n\n // Bridge the inner picker's `value` model back to our two-way [(value)].\n ref.instance.value.subscribe((next: string) => this.value.set(next));\n\n // Outside-click → close (the source only filters out the overlay pane, so\n // the re-click on our own trigger still arrives here and has to be ignored).\n this.outsideClick\n .outsidePointerEvents(this.overlayRef)\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (this.host.nativeElement.contains(event.target as Node)) return;\n this.close();\n });\n\n // Escape → close.\n this.overlayRef\n .keydownEvents()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (event.key === 'Escape') {\n event.preventDefault();\n this.close();\n }\n });\n\n this.isOpen.set(true);\n this.opened.emit();\n }\n\n /** Close the picker. No-op if already closed. */\n close(): void {\n if (!this.isOpen()) return;\n // Focus lives inside the panel while it is open, and removing the panel\n // would drop it to `<body>` — hand it back to the trigger instead, the way\n // `[wrPopconfirm]` does. Only when focus is still IN there: if the user has\n // already clicked elsewhere, taking it back would be stealing.\n const returnFocus = !!this.overlayRef?.overlayElement.contains(document.activeElement);\n this.dispose();\n this.isOpen.set(false);\n this.closed.emit();\n if (returnFocus) this.host.nativeElement.focus();\n }\n\n private dispose(): void {\n if (this.overlayRef) {\n this.overlayRef.dispose();\n this.overlayRef = null;\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';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AA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,KAAA,EAAA,aAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,QAAA,EAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,OAAA,EAAA,UAAA,EAAA,EAAA,UAAA,EAAA,EAAA,oBAAA,EAAA,YAAA,EAAA,oBAAA,EAAA,UAAA,EAAA,oBAAA,EAAA,2BAAA,EAAA,oBAAA,EAAA,0BAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,sBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAnBhC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,wBAAwB;AAClC,oBAAA,QAAQ,EAAE,sBAAsB;AAChC,oBAAA,IAAI,EAAE;AACJ,wBAAA,SAAS,EAAE,UAAU;;;AAGrB,wBAAA,sBAAsB,EAAE,UAAU;AAClC,wBAAA,sBAAsB,EAAE,UAAU;;;;AAIlC,wBAAA,sBAAsB,EAAE,2BAA2B;;;;AAInD,wBAAA,sBAAsB,EAAE,0BAA0B;AACnD,qBAAA;AACF,iBAAA;;;ACxED;;AAEG;;;;"}
1
+ {"version":3,"file":"ngwr-color-picker.mjs","sources":["../../../projects/lib/color-picker/color/rgb-to-hsv.ts","../../../projects/lib/color-picker/color/hsv-to-rgb.ts","../../../projects/lib/color-picker/color/rgb-to-hsl.ts","../../../projects/lib/color-picker/color/hsl-to-rgb.ts","../../../projects/lib/color-picker/color/parse-hex.ts","../../../projects/lib/color-picker/color/to-hex.ts","../../../projects/lib/color-picker/color/parse-color.ts","../../../projects/lib/color-picker/color/format-color.ts","../../../projects/lib/color-picker/color-picker.ts","../../../projects/lib/color-picker/color-picker.html","../../../projects/lib/color-picker/color-picker-trigger.ts","../../../projects/lib/color-picker/ngwr-color-picker.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 type { WrHsv } from './wr-hsv';\nimport type { WrRgb } from './wr-rgb';\n\n/**\n * Convert sRGB to HSV. Preserves alpha.\n */\nexport function rgbToHsv(rgb: WrRgb): WrHsv {\n const r = rgb.r / 255;\n const g = rgb.g / 255;\n const b = rgb.b / 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const d = max - min;\n\n let h = 0;\n if (d !== 0) {\n if (max === r) h = ((g - b) / d) % 6;\n else if (max === g) h = (b - r) / d + 2;\n else h = (r - g) / d + 4;\n h *= 60;\n if (h < 0) h += 360;\n }\n\n const s = max === 0 ? 0 : d / max;\n const v = max;\n\n return { h, s, v, a: rgb.a };\n}\n","/**\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 type { WrHsv } from './wr-hsv';\nimport type { WrRgb } from './wr-rgb';\n\n/**\n * Convert HSV to sRGB. Preserves alpha. Returns integer channels in `[0, 255]`.\n */\nexport function hsvToRgb(hsv: WrHsv): WrRgb {\n const { h, s, v } = hsv;\n const c = v * s;\n const x = c * (1 - Math.abs(((h / 60) % 2) - 1));\n const m = v - c;\n\n let r = 0;\n let g = 0;\n let b = 0;\n\n if (h < 60) {\n r = c;\n g = x;\n } else if (h < 120) {\n r = x;\n g = c;\n } else if (h < 180) {\n g = c;\n b = x;\n } else if (h < 240) {\n g = x;\n b = c;\n } else if (h < 300) {\n r = x;\n b = c;\n } else {\n r = c;\n b = x;\n }\n\n return {\n r: Math.round((r + m) * 255),\n g: Math.round((g + m) * 255),\n b: Math.round((b + m) * 255),\n a: hsv.a,\n };\n}\n","/**\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 type { WrHsl } from './wr-hsl';\nimport type { WrRgb } from './wr-rgb';\n\n/**\n * Convert sRGB to HSL. Preserves alpha.\n */\nexport function rgbToHsl(rgb: WrRgb): WrHsl {\n const r = rgb.r / 255;\n const g = rgb.g / 255;\n const b = rgb.b / 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const d = max - min;\n const l = (max + min) / 2;\n\n let h = 0;\n let s = 0;\n\n if (d !== 0) {\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n\n if (max === r) h = (g - b) / d + (g < b ? 6 : 0);\n else if (max === g) h = (b - r) / d + 2;\n else h = (r - g) / d + 4;\n\n h *= 60;\n }\n\n return { h, s, l, a: rgb.a };\n}\n","/**\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 type { WrHsl } from './wr-hsl';\nimport type { WrRgb } from './wr-rgb';\n\nfunction hueToChannel(p: number, q: number, t: number): number {\n let x = t;\n if (x < 0) x += 1;\n if (x > 1) x -= 1;\n if (x < 1 / 6) return p + (q - p) * 6 * x;\n if (x < 1 / 2) return q;\n if (x < 2 / 3) return p + (q - p) * (2 / 3 - x) * 6;\n return p;\n}\n\n/**\n * Convert HSL to sRGB. Preserves alpha. Returns integer channels in `[0, 255]`.\n */\nexport function hslToRgb(hsl: WrHsl): WrRgb {\n const h = hsl.h / 360;\n const { s, l } = hsl;\n\n let r: number;\n let g: number;\n let b: number;\n\n if (s === 0) {\n r = l;\n g = l;\n b = l;\n } else {\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n r = hueToChannel(p, q, h + 1 / 3);\n g = hueToChannel(p, q, h);\n b = hueToChannel(p, q, h - 1 / 3);\n }\n\n return {\n r: Math.round(r * 255),\n g: Math.round(g * 255),\n b: Math.round(b * 255),\n a: hsl.a,\n };\n}\n","/**\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 type { WrRgb } from './wr-rgb';\n\n/**\n * Parse a CSS hex colour into {@link WrRgb}. Accepts 3, 4, 6, or 8 digit\n * forms with or without a leading `#`. Returns `null` for anything that\n * isn't a valid hex string.\n *\n * @example\n * ```ts\n * parseHex('#f00'); // { r: 255, g: 0, b: 0, a: 1 }\n * parseHex('3969e2'); // { r: 57, g: 105, b: 226, a: 1 }\n * parseHex('#3969e2ff'); // { r: 57, g: 105, b: 226, a: 1 }\n * parseHex('nope'); // null\n * ```\n */\nexport function parseHex(input: string): WrRgb | null {\n if (typeof input !== 'string') return null;\n\n let str = input.trim().replace(/^#/, '').toLowerCase();\n\n // Expand shorthand: rgb → rrggbb, rgba → rrggbbaa\n if (str.length === 3 || str.length === 4) {\n str = str\n .split('')\n .map(c => c + c)\n .join('');\n }\n\n if (str.length !== 6 && str.length !== 8) return null;\n if (!/^[0-9a-f]+$/.test(str)) return null;\n\n const r = parseInt(str.slice(0, 2), 16);\n const g = parseInt(str.slice(2, 4), 16);\n const b = parseInt(str.slice(4, 6), 16);\n const a = str.length === 8 ? parseInt(str.slice(6, 8), 16) / 255 : 1;\n\n return { r, g, b, a };\n}\n","/**\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 type { WrRgb } from './wr-rgb';\n\nfunction channelToHex(n: number): string {\n const clamped = Math.max(0, Math.min(255, Math.round(n)));\n return clamped.toString(16).padStart(2, '0');\n}\n\n/**\n * Format a {@link WrRgb} as a CSS hex string with a leading `#`. When\n * `withAlpha` is `true` the result is 8 digits (`#rrggbbaa`); otherwise\n * 6 digits.\n *\n * @example\n * ```ts\n * toHex({ r: 57, g: 105, b: 226, a: 1 }); // '#3969e2'\n * toHex({ r: 57, g: 105, b: 226, a: 0.5 }, true); // '#3969e280'\n * ```\n */\nexport function toHex(rgb: WrRgb, withAlpha = false): string {\n const r = channelToHex(rgb.r);\n const g = channelToHex(rgb.g);\n const b = channelToHex(rgb.b);\n if (withAlpha) {\n const a = channelToHex(rgb.a * 255);\n return `#${r}${g}${b}${a}`;\n }\n return `#${r}${g}${b}`;\n}\n","/**\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 { clamp } from 'ngwr/utils';\n\nimport { hslToRgb } from './hsl-to-rgb';\nimport { parseHex } from './parse-hex';\nimport type { WrRgb } from './wr-rgb';\n\n/**\n * `rgb(…)` / `rgba(…)`, comma- or space-separated, with an optional `/ alpha`.\n * Signs are accepted so an out-of-range channel CLAMPS the way CSS clamps it,\n * rather than failing to parse and reading as black.\n */\nconst RGB_RE = /^rgba?\\(\\s*(-?[\\d.]+)\\s*[,\\s]\\s*(-?[\\d.]+)\\s*[,\\s]\\s*(-?[\\d.]+)\\s*(?:[,/]\\s*(-?[\\d.]+%?)\\s*)?\\)$/i;\n\n/** `hsl(…)` / `hsla(…)`, with `%` optional on saturation and lightness. */\nconst HSL_RE =\n /^hsla?\\(\\s*(-?[\\d.]+)(?:deg)?\\s*[,\\s]\\s*(-?[\\d.]+)%?\\s*[,\\s]\\s*(-?[\\d.]+)%?\\s*(?:[,/]\\s*(-?[\\d.]+%?)\\s*)?\\)$/i;\n\n/** `0.5` and `50%` are the same alpha; anything absent is fully opaque. */\nfunction alphaOf(raw: string | undefined): number {\n if (raw === undefined) return 1;\n const value = raw.endsWith('%') ? Number(raw.slice(0, -1)) / 100 : Number(raw);\n return Number.isFinite(value) ? clamp(value, 0, 1) : 1;\n}\n\nfunction channel(raw: string): number {\n return clamp(Math.round(Number(raw)), 0, 255);\n}\n\n/**\n * Read a colour written in any format `<wr-color-picker>` can emit — hex,\n * `rgb()` / `rgba()`, `hsl()` / `hsla()` — or `null` when it is none of them.\n *\n * The picker emits in whichever format it was given, so a `[(value)]` binding\n * hands its own output straight back on the next external write. Accepting only\n * hex there (which is what it used to do) turned every non-hex value into black.\n *\n * `null` rather than a throw or a black fallback: the caller is often a text\n * field mid-typing, where \"not valid yet\" is the normal state.\n */\nexport function parseColor(input: string): WrRgb | null {\n const value = input.trim();\n if (value === '') return null;\n\n const hex = parseHex(value);\n if (hex) return hex;\n\n const rgb = RGB_RE.exec(value);\n if (rgb) {\n return { r: channel(rgb[1]), g: channel(rgb[2]), b: channel(rgb[3]), a: alphaOf(rgb[4]) };\n }\n\n const hsl = HSL_RE.exec(value);\n if (hsl) {\n return hslToRgb({\n // Normalised here rather than trusted downstream: `hslToRgb` happens to\n // absorb one negative turn inside `hueToChannel`, which is an internal\n // detail this function should not be leaning on.\n h: ((Number(hsl[1]) % 360) + 360) % 360,\n s: clamp(Number(hsl[2]) / 100, 0, 1),\n l: clamp(Number(hsl[3]) / 100, 0, 1),\n a: alphaOf(hsl[4]),\n });\n }\n\n return null;\n}\n","/**\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 type { WrColorFormat } from '../interfaces';\n\nimport { rgbToHsl } from './rgb-to-hsl';\nimport { toHex } from './to-hex';\nimport type { WrRgb } from './wr-rgb';\n\n/** Alpha with at most two decimals, and no trailing zeroes: `0.5`, not `0.50`. */\nfunction alphaText(a: number): string {\n return String(Math.round(a * 100) / 100);\n}\n\n/**\n * Render a colour in the format a `<wr-color-picker>` was asked for.\n *\n * `withAlpha` follows the picker's own `alpha` input, so each format has an\n * opaque and a translucent spelling — `#3969e2` / `#3969e2ff`,\n * `rgb(…)` / `rgba(…)`, `hsl(…)` / `hsla(…)` — and a picker with the alpha\n * slider turned off never emits a channel the caller cannot see or edit.\n */\nexport function formatColor(rgb: WrRgb, format: WrColorFormat, withAlpha: boolean): string {\n if (format === 'hex') return toHex(rgb, withAlpha);\n\n if (format === 'rgba') {\n const { r, g, b } = rgb;\n return withAlpha ? `rgba(${r}, ${g}, ${b}, ${alphaText(rgb.a)})` : `rgb(${r}, ${g}, ${b})`;\n }\n\n const { h, s, l } = rgbToHsl(rgb);\n const parts = `${Math.round(h)}, ${Math.round(s * 100)}%, ${Math.round(l * 100)}%`;\n return withAlpha ? `hsla(${parts}, ${alphaText(rgb.a)})` : `hsl(${parts})`;\n}\n","/**\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 { Directionality } from '@angular/cdk/bidi';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { DecimalPipe } from '@angular/common';\nimport { Component, ViewEncapsulation, computed, effect, inject, input, model, output, signal } from '@angular/core';\nimport type { FormValueControl } from '@angular/forms/signals';\n\nimport { WR_FORM_FIELD, useFormFieldAria } from 'ngwr/form';\nimport { readI18nText, useI18nFormatter } from 'ngwr/i18n';\nimport { WrSegmented, type WrSegmentedOption } from 'ngwr/segmented';\nimport { clamp } from 'ngwr/utils';\n\nimport {\n formatColor,\n hslToRgb,\n hsvToRgb,\n parseColor,\n parseHex,\n rgbToHsl,\n rgbToHsv,\n toHex,\n type WrHsl,\n type WrRgb,\n} from './color';\nimport type { WrColorFormat } from './interfaces';\n\ntype Tab = 'hex' | 'rgb' | 'hsl';\n\ntype Edges = 'sv' | 'hue' | 'alpha';\n\n/** Arrow step, in each surface's own unit: degrees of hue, percent everywhere else. */\nconst KEY_STEP = 1;\nconst KEY_STEP_COARSE = 10;\n\n/** Whether a hex string carries its own alpha (`#rgba` or `#rrggbbaa`). */\nfunction hasAlphaDigits(hex: string): boolean {\n const digits = hex.trim().replace(/^#/, '').length;\n return digits === 4 || digits === 8;\n}\n\n/**\n * Inline colour picker — HSV canvas, hue slider, optional alpha slider, HEX\n * input.\n *\n * A signal-forms native control: it implements `FormValueControl<string>`, so\n * `[formField]` binds straight to its `value` model — no\n * `ControlValueAccessor` in between. `[(value)]` works standalone. Output is\n * always a hex string.\n *\n * @example\n * ```html\n * <!-- signal forms -->\n * <wr-color-picker [formField]=\"form.brandColor\" />\n *\n * <!-- standalone two-way binding -->\n * <wr-color-picker [(value)]=\"brandColor\" [alpha]=\"false\" />\n * ```\n *\n * @see https://ngwr.dev/reference/components/color-picker\n */\n@Component({\n selector: 'wr-color-picker',\n templateUrl: './color-picker.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n '[class]': 'classes()',\n '[style.--wr-color-picker-hue]': 'hueCss()',\n '[style.--wr-color-picker-rgb]': 'rgbCss()',\n },\n // The picker is the control a `<wr-form-field>` wraps; the `<wr-segmented>` tab\n // strip in its own template is a part, not a control. Without this shield the\n // tab strip found the field's token and announced the colour field's error as\n // its own — which is why `fieldAria` below reads the field with `skipSelf`.\n providers: [{ provide: WR_FORM_FIELD, useValue: null }],\n imports: [DecimalPipe, WrSegmented],\n})\nexport class WrColorPicker implements FormValueControl<string> {\n /** Render the alpha slider and emit 8-digit hex / `rgba()`. @default true */\n readonly alpha = input(true, { transform: coerceBooleanProperty });\n\n /** Disable interaction. @default false */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Refuse changes while every surface stays focusable and the colour still\n * submits. Bound automatically from the field's readonly state when used with\n * `[formField]`.\n *\n * The two sliders keep their tab stop and keep announcing `aria-valuenow` —\n * they simply do not move — the hex / channel fields take the native\n * `readonly` attribute, and the swatches go inert. Switching TABS still works:\n * that changes which notation is displayed, not the colour. `aria-readonly` is\n * mirrored on the sliders, which support it; the saturation surface is a\n * `role=\"group\"`, which does not, so it carries nothing.\n *\n * @default false\n */\n readonly readonly = input(false, { transform: coerceBooleanProperty });\n\n /** The surrounding `<wr-form-field>`'s error state. @internal */\n protected readonly fieldAria = useFormFieldAria({ skipSelf: true });\n\n /**\n * Format the control writes into `value`. See {@link WrColorFormat} — all\n * three are accepted on the way in whichever one is set. @default 'hex'\n */\n readonly format = input<WrColorFormat>('hex');\n\n /** Preset hex colours rendered as a clickable row beneath the inputs. Empty = no row. @default [] */\n readonly swatches = input<readonly string[]>([]);\n\n /** The selected colour as a string. Bound by `[formField]`, or two-way via `[(value)]`. */\n readonly value = model<string>('');\n\n /** Emitted on blur so a bound field can mark itself touched. */\n readonly touch = output<void>();\n\n // Source of truth: HSV + alpha\n\n protected readonly h = signal(0);\n protected readonly s = signal(0);\n protected readonly v = signal(0);\n protected readonly a = signal(1);\n\n // Derived values\n\n /** RGB view of the current colour, computed lazily. */\n protected readonly rgb = computed<WrRgb>(() => hsvToRgb({ h: this.h(), s: this.s(), v: this.v(), a: this.a() }));\n\n /** Canonical hex — what the HEX field shows, whatever `format` emits. */\n protected readonly hex = computed(() => toHex(this.rgb(), this.alpha()));\n\n /** The colour as the consumer asked for it; this is what `value` receives. */\n protected readonly formatted = computed(() => formatColor(this.rgb(), this.format(), this.alpha()));\n\n /** SV canvas background colour (full-saturation hue). */\n protected readonly hueCss = computed(() => `hsl(${this.h()}, 100%, 50%)`);\n\n /** RGB string used for the alpha-slider gradient. */\n protected readonly rgbCss = computed(() => {\n const { r, g, b } = this.rgb();\n return `${r}, ${g}, ${b}`;\n });\n\n /**\n * Ambient reading direction, for the two SLIDERS only — see `updateFromEvent`\n * for why the SV canvas is not in that set.\n *\n * Optional so a bare `TestBed` — or any consumer that never set a direction —\n * needs no provider; `Directionality` is root-provided, so `null` only ever\n * means \"nobody asked\", which is LTR. Read inside the handlers rather than\n * cached: the thumbs are placed with `inset-inline-start`, so the tracks mirror\n * from CSS alone and a runtime flip needs no subscription to\n * `Directionality.change`.\n */\n private readonly dir = inject(Directionality, { optional: true });\n\n /** Thumb positions in % for each surface. */\n protected readonly svThumbX = computed(() => this.s() * 100);\n protected readonly svThumbY = computed(() => (1 - this.v()) * 100);\n protected readonly hueThumbX = computed(() => (this.h() / 360) * 100);\n protected readonly alphaThumbX = computed(() => this.a() * 100);\n\n /** Mirror of the canonical hex, edited by the user via the input field. */\n protected readonly hexInput = signal('');\n\n /** Active tab in the input switcher. */\n protected readonly activeTab = signal<Tab>('hex');\n\n /** HSL view of the current colour, computed lazily. */\n protected readonly hslView = computed<WrHsl>(() => rgbToHsl(this.rgb()));\n\n /** Alpha as integer percent — the numeric tabs and the alpha slider's `aria-valuenow`. */\n protected readonly alphaPercent = computed(() => Math.round(this.a() * 100));\n\n /** Hue in whole degrees, for the hue slider's `aria-valuenow`. */\n protected readonly hueValue = computed(() => Math.round(this.h()));\n\n private readonly areaLabel = useI18nFormatter(\n 'colorPicker.area',\n 'Saturation and brightness, {{saturation}}% and {{brightness}}%'\n );\n\n /** Name of the SV surface, carrying the two values a `role=\"group\"` cannot. */\n protected readonly resolvedAreaLabel = computed(() =>\n this.areaLabel({ saturation: Math.round(this.s() * 100), brightness: Math.round(this.v() * 100) })\n );\n\n protected readonly resolvedHueLabel = readI18nText('colorPicker.hue', 'Hue');\n protected readonly resolvedAlphaLabel = readI18nText('colorPicker.alpha', 'Opacity');\n\n /**\n * Every visible word in this component that is not a slider name.\n *\n * The format strip and the nine channel captions were literals — three in\n * TypeScript, the rest in the template — beside a `colorPicker` catalog\n * section that already existed and held the slider names. So the section was\n * there and these had simply not been put in it, which is why a fully Russian\n * picker still read `HEX RGB HSL` over `R G B`. Each caption is one string\n * INCLUDING its `%`, because a locale that spaces the sign differently has to\n * move the letter and the sign together.\n *\n * Signals, not strings: they follow a locale switch, and a catalog that lands\n * a microtask after the first change-detection pass.\n */\n protected readonly channelHexLabel = readI18nText('colorPicker.channelHex', 'HEX');\n protected readonly channelRedLabel = readI18nText('colorPicker.channelRed', 'R');\n protected readonly channelGreenLabel = readI18nText('colorPicker.channelGreen', 'G');\n protected readonly channelBlueLabel = readI18nText('colorPicker.channelBlue', 'B');\n protected readonly channelHueLabel = readI18nText('colorPicker.channelHue', 'H');\n protected readonly channelSaturationLabel = readI18nText('colorPicker.channelSaturation', 'S%');\n protected readonly channelLightnessLabel = readI18nText('colorPicker.channelLightness', 'L%');\n protected readonly channelAlphaLabel = readI18nText('colorPicker.channelAlpha', 'A%');\n\n private readonly formatHexLabel = readI18nText('colorPicker.formatHex', 'HEX');\n private readonly formatRgbLabel = readI18nText('colorPicker.formatRgb', 'RGB');\n private readonly formatHslLabel = readI18nText('colorPicker.formatHsl', 'HSL');\n\n /** A `computed`, because `WrSegmentedOption.label` is a plain string. */\n protected readonly tabOptions = computed<readonly WrSegmentedOption<Tab>[]>(() => [\n { value: 'hex', label: this.formatHexLabel() },\n { value: 'rgb', label: this.formatRgbLabel() },\n { value: 'hsl', label: this.formatHslLabel() },\n ]);\n\n protected readonly classes = computed(() => {\n const parts = ['wr-color-picker'];\n if (this.alpha()) parts.push('wr-color-picker--alpha');\n if (this.disabled()) parts.push('wr-color-picker--disabled');\n else if (this.readonly()) parts.push('wr-color-picker--readonly');\n return parts.join(' ');\n });\n\n /**\n * The one write we just made, held only until the sync effect has seen it.\n *\n * It exists so a drag keeps its continuous HSV values instead of being\n * re-quantised through its own hex round-trip. It used to be set and never\n * cleared, which turned \"ignore this write\" into \"ignore this STRING,\n * forever\": after the picker emitted `#ff0000` once, an app writing\n * `#ff0000` back — a reset button, a form patch, an undo — was silently\n * dropped for the rest of the component's life, and the surface kept\n * whatever colour the user had dragged to.\n */\n private lastEmitted: string | null = null;\n\n constructor() {\n // External writes (via `[formField]` / `[(value)]`) flow the incoming hex\n // string back into the HSV source of truth. Our own emits are skipped via\n // `lastEmitted` so dragging keeps its continuous (unquantised) values.\n effect(() => {\n const value = this.value();\n if (value === this.lastEmitted) {\n // Ours, and now observed. Release the guard so the NEXT write of the\n // same string — which can only come from outside — is honoured.\n this.lastEmitted = null;\n return;\n }\n const rgb = parseColor(value) ?? { r: 0, g: 0, b: 0, a: 1 };\n const hsv = rgbToHsv(rgb);\n this.h.set(hsv.h);\n this.s.set(hsv.s);\n this.v.set(hsv.v);\n this.a.set(hsv.a);\n this.hexInput.set(toHex(rgb, this.alpha()));\n });\n }\n\n // Drag handlers\n\n protected onPointerDown(event: PointerEvent, surface: Edges): void {\n if (this.disabled() || this.readonly()) return;\n // Primary button, primary pointer: a right-click used to open the context\n // menu AND start a drag, and a second finger used to fight the first one.\n if (event.button !== 0 || !event.isPrimary) return;\n event.preventDefault();\n const target = event.currentTarget as HTMLElement;\n target.setPointerCapture(event.pointerId);\n\n const update = (e: PointerEvent): void => this.updateFromEvent(e, target, surface);\n const cleanup = (e: PointerEvent): void => {\n target.releasePointerCapture(e.pointerId);\n target.removeEventListener('pointermove', update);\n target.removeEventListener('pointerup', cleanup);\n target.removeEventListener('pointercancel', cleanup);\n this.touch.emit();\n };\n\n target.addEventListener('pointermove', update);\n target.addEventListener('pointerup', cleanup);\n // `pointercancel` never sends a `pointerup` after it, so without this the\n // move listener outlived the drag: a cancelled gesture left the surface\n // repainting the colour under a pointer that was only hovering.\n target.addEventListener('pointercancel', cleanup);\n this.updateFromEvent(event, target, surface);\n }\n\n // Keyboard handlers\n //\n // The three surfaces used to be bare `<div>`s carrying nothing but\n // `(pointerdown)` — no role, no name, no tab stop, no key handler — so the\n // control the component is built around was operable by pointer only. The\n // numeric HEX / RGB / HSL fields could always reach the same values, which is\n // why this is 4.1.2 rather than a total loss of keyboard access, but a\n // roleless div driving a colour is WCAG F59 either way.\n\n /**\n * Hue and alpha are real one-value sliders, so they take the APG slider keys —\n * the same set `wr-knob` and `wr-slider` implement, including Home / End.\n *\n * The horizontal arrows name a SIDE of the track and so follow the reading\n * direction, exactly as `wr-slider`'s do; the vertical pair names a value's\n * direction and never mirrors.\n */\n protected onSliderKeydown(event: KeyboardEvent, surface: 'hue' | 'alpha'): void {\n if (this.disabled() || this.readonly()) return;\n const step = event.shiftKey ? KEY_STEP_COARSE : KEY_STEP;\n const inline = this.dir?.value === 'rtl' ? -step : step;\n const max = surface === 'hue' ? 360 : 100;\n const current = surface === 'hue' ? this.h() : this.a() * 100;\n let next: number;\n switch (event.key) {\n case 'ArrowRight':\n next = current + inline;\n break;\n case 'ArrowUp':\n next = current + step;\n break;\n case 'ArrowLeft':\n next = current - inline;\n break;\n case 'ArrowDown':\n next = current - step;\n break;\n case 'Home':\n next = 0;\n break;\n case 'End':\n next = max;\n break;\n default:\n return;\n }\n event.preventDefault();\n const value = clamp(next, 0, max);\n if (surface === 'hue') this.h.set(value);\n else this.a.set(value / 100);\n this.emit();\n }\n\n /**\n * The SV canvas is two axes at once, so the keys follow the picture: left and\n * right run along saturation, up and down along brightness — the directions\n * the thumb visibly moves. Shift takes ten percent at a time.\n *\n * Not mirrored under `dir=\"rtl\"`, unlike the two sliders above, and for the\n * reason given on `fraction()`: the canvas is a picture rather than a track, so\n * its gradient does not flip and neither may the keys that walk it.\n */\n protected onAreaKeydown(event: KeyboardEvent): void {\n if (this.disabled() || this.readonly()) return;\n const step = (event.shiftKey ? KEY_STEP_COARSE : KEY_STEP) / 100;\n switch (event.key) {\n case 'ArrowRight':\n this.s.set(clamp(this.s() + step, 0, 1));\n break;\n case 'ArrowLeft':\n this.s.set(clamp(this.s() - step, 0, 1));\n break;\n case 'ArrowUp':\n this.v.set(clamp(this.v() + step, 0, 1));\n break;\n case 'ArrowDown':\n this.v.set(clamp(this.v() - step, 0, 1));\n break;\n default:\n return;\n }\n event.preventDefault();\n this.emit();\n }\n\n /** Leaving a surface is what \"touched\" means, the same as leaving the hex field. */\n protected onSurfaceBlur(): void {\n this.touch.emit();\n }\n\n /**\n * The pointer's position along a surface, as a 0–1 fraction.\n *\n * Measured from whichever edge the surface STARTS at, and the two surfaces do\n * not agree on what that means — deliberately.\n *\n * The hue and alpha bars are one-value tracks with `role=\"slider\"`, the same\n * widget `wr-slider` is, so they mirror: their thumbs are placed with\n * `inset-inline-start` and their gradients are flipped by a `[dir='rtl']` rule,\n * which makes the reader's start the physical right edge under `dir=\"rtl\"`.\n * Opacity 100% used to sit at the physical right in both directions, i.e. at\n * the reader's START in RTL, while the format strip in the same panel mirrored\n * correctly.\n *\n * The SV canvas does NOT mirror, and stays measured from `rect.left`. It is a\n * two-axis colour FIELD, not a track — the component says so itself by giving\n * it `role=\"group\"` rather than `role=\"slider\"`, because it carries two values\n * and a slider has one. A picture with no start and no end has nothing to\n * mirror, and flipping it would only move white to the other side of an image\n * every colour picker in the world draws the same way.\n */\n private fraction(event: PointerEvent, rect: DOMRect, surface: Edges): number {\n const offset =\n surface !== 'sv' && this.dir?.value === 'rtl' ? rect.right - event.clientX : event.clientX - rect.left;\n return clamp(offset / rect.width, 0, 1);\n }\n\n private updateFromEvent(event: PointerEvent, target: HTMLElement, surface: Edges): void {\n const rect = target.getBoundingClientRect();\n const x = this.fraction(event, rect, surface);\n\n if (surface === 'sv') {\n const y = clamp((event.clientY - rect.top) / rect.height, 0, 1);\n this.s.set(x);\n this.v.set(1 - y);\n } else if (surface === 'hue') {\n this.h.set(x * 360);\n } else {\n this.a.set(x);\n }\n this.emit();\n }\n\n // Hex input handlers\n\n protected onHexInput(event: Event): void {\n if (this.disabled() || this.readonly()) return;\n const raw = (event.target as HTMLInputElement).value;\n this.hexInput.set(raw);\n const rgb = parseHex(raw);\n if (!rgb) return;\n const hsv = rgbToHsv(rgb);\n this.h.set(hsv.h);\n this.s.set(hsv.s);\n this.v.set(hsv.v);\n this.a.set(hsv.a);\n this.emitWithoutHexSync();\n }\n\n protected onHexBlur(): void {\n // Re-sync the input with the canonical value (in case the user typed invalid).\n this.hexInput.set(this.hex());\n this.touch.emit();\n }\n\n // Emission\n\n private emit(): void {\n this.emitWithoutHexSync();\n this.hexInput.set(this.hex());\n }\n\n private emitWithoutHexSync(): void {\n const next = this.formatted();\n this.lastEmitted = next;\n this.value.set(next);\n }\n\n // Tab + channel handlers\n\n protected onTabChange(tab: Tab | null): void {\n if (tab) this.activeTab.set(tab);\n }\n\n protected onRgbChannel(channel: 'r' | 'g' | 'b', event: Event): void {\n if (this.disabled() || this.readonly()) return;\n const n = clamp(Number((event.target as HTMLInputElement).value), 0, 255);\n if (Number.isNaN(n)) return;\n const current = this.rgb();\n const next: WrRgb = { ...current, [channel]: n };\n this.applyRgb(next);\n }\n\n protected onHslChannel(channel: 'h' | 's' | 'l', event: Event): void {\n if (this.disabled() || this.readonly()) return;\n const n = Number((event.target as HTMLInputElement).value);\n if (Number.isNaN(n)) return;\n const current = this.hslView();\n const next: WrHsl =\n channel === 'h' ? { ...current, h: clamp(n, 0, 360) } : { ...current, [channel]: clamp(n, 0, 100) / 100 };\n this.applyRgb(hslToRgb(next));\n }\n\n protected onAlphaPercent(event: Event): void {\n if (this.disabled() || this.readonly()) return;\n const n = clamp(Number((event.target as HTMLInputElement).value), 0, 100);\n if (Number.isNaN(n)) return;\n this.a.set(n / 100);\n this.emit();\n }\n\n protected onSwatchClick(hex: string): void {\n if (this.disabled() || this.readonly()) return;\n const rgb = parseHex(hex);\n if (!rgb) return;\n // A 6-digit swatch says nothing about alpha, and `parseHex` reports the\n // absence as `1` — so picking a preset used to silently snap a translucent\n // colour back to fully opaque.\n this.applyRgb(hasAlphaDigits(hex) ? rgb : { ...rgb, a: this.a() });\n }\n\n /** Push an RGB triple into the HSV source of truth. */\n private applyRgb(rgb: WrRgb): void {\n const hsv = rgbToHsv(rgb);\n this.h.set(hsv.h);\n this.s.set(hsv.s);\n this.v.set(hsv.v);\n this.a.set(hsv.a);\n this.emit();\n }\n}\n","<!--\n `role=\"group\"` rather than `role=\"slider\"`, because this surface holds TWO\n values and a slider has one `aria-valuenow`; and rather than\n `role=\"application\"`, which would switch the reader out of its own browse mode\n for the whole subtree — the call `wr-image-cropper` already made. A group has\n no value of its own, so the two percentages ride in its accessible name, which\n is where a reader querying the focused element finds them.\n-->\n<div\n class=\"wr-color-picker__sv\"\n role=\"group\"\n [attr.aria-label]=\"resolvedAreaLabel()\"\n [attr.aria-disabled]=\"disabled() || null\"\n [attr.aria-invalid]=\"fieldAria.ariaInvalid()\"\n [attr.aria-describedby]=\"fieldAria.describedBy()\"\n [attr.tabindex]=\"disabled() ? -1 : 0\"\n (pointerdown)=\"onPointerDown($event, 'sv')\"\n (keydown)=\"onAreaKeydown($event)\"\n (blur)=\"onSurfaceBlur()\"\n>\n <span class=\"wr-color-picker__thumb\" [style.left.%]=\"svThumbX()\" [style.top.%]=\"svThumbY()\"></span>\n</div>\n\n<div\n class=\"wr-color-picker__slider wr-color-picker__slider--hue\"\n role=\"slider\"\n aria-valuemin=\"0\"\n aria-valuemax=\"360\"\n [attr.aria-label]=\"resolvedHueLabel()\"\n [attr.aria-valuenow]=\"hueValue()\"\n [attr.aria-disabled]=\"disabled() || null\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-invalid]=\"fieldAria.ariaInvalid()\"\n [attr.aria-describedby]=\"fieldAria.describedBy()\"\n [attr.tabindex]=\"disabled() ? -1 : 0\"\n (pointerdown)=\"onPointerDown($event, 'hue')\"\n (keydown)=\"onSliderKeydown($event, 'hue')\"\n (blur)=\"onSurfaceBlur()\"\n>\n <!--\n `inset-inline-start`, not `left`: this is a one-value track, so it mirrors\n under `dir=\"rtl\"` the way `wr-slider` does. The SV thumb above keeps `left` —\n the canvas is a picture and does not flip.\n -->\n <span class=\"wr-color-picker__thumb wr-color-picker__thumb--slider\" [style.inset-inline-start.%]=\"hueThumbX()\"></span>\n</div>\n\n@if (alpha()) {\n <div\n class=\"wr-color-picker__slider wr-color-picker__slider--alpha\"\n role=\"slider\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n [attr.aria-label]=\"resolvedAlphaLabel()\"\n [attr.aria-valuenow]=\"alphaPercent()\"\n [attr.aria-valuetext]=\"`${alphaPercent()}%`\"\n [attr.aria-disabled]=\"disabled() || null\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-invalid]=\"fieldAria.ariaInvalid()\"\n [attr.aria-describedby]=\"fieldAria.describedBy()\"\n [attr.tabindex]=\"disabled() ? -1 : 0\"\n (pointerdown)=\"onPointerDown($event, 'alpha')\"\n (keydown)=\"onSliderKeydown($event, 'alpha')\"\n (blur)=\"onSurfaceBlur()\"\n >\n <span\n class=\"wr-color-picker__thumb wr-color-picker__thumb--slider\"\n [style.inset-inline-start.%]=\"alphaThumbX()\"\n ></span>\n </div>\n}\n\n<div class=\"wr-color-picker__chrome\">\n <span class=\"wr-color-picker__preview\" [style.background]=\"hex()\"></span>\n <wr-segmented\n class=\"wr-color-picker__tabs\"\n [options]=\"tabOptions()\"\n [value]=\"activeTab()\"\n (valueChange)=\"onTabChange($event)\"\n />\n</div>\n\n@switch (activeTab()) {\n @case ('hex') {\n <div class=\"wr-color-picker__inputs wr-color-picker__inputs--hex\">\n <label class=\"wr-color-picker__field wr-color-picker__field--wide\">\n <input\n type=\"text\"\n spellcheck=\"false\"\n autocomplete=\"off\"\n [value]=\"hexInput()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (input)=\"onHexInput($event)\"\n (blur)=\"onHexBlur()\"\n />\n <span class=\"wr-color-picker__field-label\">{{ channelHexLabel() }}</span>\n </label>\n </div>\n }\n @case ('rgb') {\n <div class=\"wr-color-picker__inputs\">\n <label class=\"wr-color-picker__field\">\n <input\n type=\"number\"\n min=\"0\"\n max=\"255\"\n [value]=\"rgb().r\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (input)=\"onRgbChannel('r', $event)\"\n />\n <span class=\"wr-color-picker__field-label\">{{ channelRedLabel() }}</span>\n </label>\n <label class=\"wr-color-picker__field\">\n <input\n type=\"number\"\n min=\"0\"\n max=\"255\"\n [value]=\"rgb().g\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (input)=\"onRgbChannel('g', $event)\"\n />\n <span class=\"wr-color-picker__field-label\">{{ channelGreenLabel() }}</span>\n </label>\n <label class=\"wr-color-picker__field\">\n <input\n type=\"number\"\n min=\"0\"\n max=\"255\"\n [value]=\"rgb().b\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (input)=\"onRgbChannel('b', $event)\"\n />\n <span class=\"wr-color-picker__field-label\">{{ channelBlueLabel() }}</span>\n </label>\n @if (alpha()) {\n <label class=\"wr-color-picker__field\">\n <input\n type=\"number\"\n min=\"0\"\n max=\"100\"\n [value]=\"alphaPercent()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (input)=\"onAlphaPercent($event)\"\n />\n <span class=\"wr-color-picker__field-label\">{{ channelAlphaLabel() }}</span>\n </label>\n }\n </div>\n }\n @case ('hsl') {\n <div class=\"wr-color-picker__inputs\">\n <label class=\"wr-color-picker__field\">\n <input\n type=\"number\"\n min=\"0\"\n max=\"360\"\n [value]=\"hslView().h | number: '1.0-0'\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (input)=\"onHslChannel('h', $event)\"\n />\n <span class=\"wr-color-picker__field-label\">{{ channelHueLabel() }}</span>\n </label>\n <label class=\"wr-color-picker__field\">\n <input\n type=\"number\"\n min=\"0\"\n max=\"100\"\n [value]=\"hslView().s * 100 | number: '1.0-0'\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (input)=\"onHslChannel('s', $event)\"\n />\n <span class=\"wr-color-picker__field-label\">{{ channelSaturationLabel() }}</span>\n </label>\n <label class=\"wr-color-picker__field\">\n <input\n type=\"number\"\n min=\"0\"\n max=\"100\"\n [value]=\"hslView().l * 100 | number: '1.0-0'\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (input)=\"onHslChannel('l', $event)\"\n />\n <span class=\"wr-color-picker__field-label\">{{ channelLightnessLabel() }}</span>\n </label>\n @if (alpha()) {\n <label class=\"wr-color-picker__field\">\n <input\n type=\"number\"\n min=\"0\"\n max=\"100\"\n [value]=\"alphaPercent()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (input)=\"onAlphaPercent($event)\"\n />\n <span class=\"wr-color-picker__field-label\">{{ channelAlphaLabel() }}</span>\n </label>\n }\n </div>\n }\n}\n\n@if (swatches().length > 0) {\n <div class=\"wr-color-picker__swatches\">\n @for (color of swatches(); track color) {\n <button\n type=\"button\"\n class=\"wr-color-picker__swatch\"\n [style.background]=\"color\"\n [attr.aria-label]=\"color\"\n [disabled]=\"disabled() || readonly()\"\n (click)=\"onSwatchClick(color)\"\n ></button>\n }\n </div>\n}\n","/**\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 { Directionality } from '@angular/cdk/bidi';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { type OverlayRef, ScrollStrategyOptions } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport {\n DestroyRef,\n Directive,\n ElementRef,\n Injector,\n ViewContainerRef,\n inject,\n input,\n model,\n output,\n signal,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { WR_OVERLAY, WrOutsideClick, wrFollowDirection } from 'ngwr/overlay';\n\nimport { WrColorPicker } from './color-picker';\nimport type { WrColorFormat } from './interfaces';\n\nlet triggerUid = 0;\n\n/**\n * Opens a `<wr-color-picker>` in an overlay anchored to the host element.\n *\n * Apply to any clickable element (typically a button). Two-way binds the\n * current colour through `[(value)]`; forwards `alpha` / `format` /\n * `swatches` / `disabled` to the inner picker.\n *\n * Same overlay isolation as the rest of the lib — uses {@link WR_OVERLAY},\n * not CDK's root container.\n *\n * @example\n * ```html\n * <button wrColorPickerTrigger\n * [(value)]=\"brandColor\"\n * [swatches]=\"palette\">\n * <span class=\"swatch\" [style.background]=\"brandColor\"></span>\n * {{ brandColor }}\n * </button>\n * ```\n *\n * @see https://ngwr.dev/reference/components/color-picker\n */\n@Directive({\n selector: '[wrColorPickerTrigger]',\n exportAs: 'wrColorPickerTrigger',\n host: {\n '(click)': 'toggle()',\n // The same two attributes `<wr-popover>`'s trigger carries: without them the\n // button gave no hint that it opens anything, and never said it was open.\n '[attr.aria-haspopup]': '\"dialog\"',\n '[attr.aria-expanded]': 'isOpen()',\n // Which panel, and only while there is one — the same pairing `[wrPopconfirm]`\n // publishes. Without it nothing on the page connects the trigger to the picker\n // it opened, so a second trigger's panel is indistinguishable from this one's.\n '[attr.aria-controls]': 'isOpen() ? panelId : null',\n // The directive's own `disabled` never reached the DOM: it gates `toggle()` and\n // is forwarded to the inner picker, so the button looked live to a screen\n // reader and did nothing when pressed.\n '[attr.aria-disabled]': 'disabled() ? true : null',\n },\n})\nexport class WrColorPickerTrigger {\n /** Two-way bindable colour value (hex string). */\n readonly value = model<string>('');\n\n /** Forwarded to the inner picker. @default true */\n readonly alpha = input(true, { transform: coerceBooleanProperty });\n\n /** Forwarded to the inner picker. @default 'hex' */\n readonly format = input<WrColorFormat>('hex');\n\n /** Forwarded to the inner picker. @default [] */\n readonly swatches = input<readonly string[]>([]);\n\n /** Disable the trigger entirely. @default false */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /** Fires after the picker opens. */\n readonly opened = output<void>();\n\n /** Fires after the picker closes. */\n readonly closed = output<void>();\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly overlay = inject(WR_OVERLAY);\n private readonly outsideClick = inject(WrOutsideClick);\n private readonly vcr = inject(ViewContainerRef);\n private readonly scrollStrategies = inject(ScrollStrategyOptions);\n private readonly destroyRef = inject(DestroyRef);\n private readonly injector = inject(Injector);\n /**\n * Ambient reading direction, for the open panel alone — nothing in this\n * directive reads it directly. Optional so a bare `TestBed` needs no\n * provider; `Directionality` is root-provided anyway, and a missing one\n * simply reads as `ltr`.\n */\n private readonly dir = inject(Directionality, { optional: true });\n\n protected readonly isOpen = signal(false);\n private overlayRef: OverlayRef | null = null;\n\n /** @internal Public so the host binding can read it. */\n protected readonly panelId = `wr-color-picker-panel-${++triggerUid}`;\n\n constructor() {\n this.destroyRef.onDestroy(() => this.dispose());\n }\n\n /** Toggle the picker. Open if closed, close if open. */\n toggle(): void {\n if (this.disabled()) return;\n if (this.isOpen()) {\n this.close();\n } else {\n this.open();\n }\n }\n\n /** Open the picker. No-op if already open. */\n open(): void {\n if (this.isOpen() || this.disabled()) return;\n\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.host)\n .withPositions([\n { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top', offsetY: 4 },\n { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom', offsetY: -4 },\n { originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top', offsetY: 4 },\n { originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom', offsetY: -4 },\n ])\n .withPush(true);\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: this.scrollStrategies.reposition(),\n panelClass: 'wr-color-picker-overlay',\n });\n this.overlayRef.overlayElement.id = this.panelId;\n\n // Two of the four fallbacks anchor on `end`, and the CDK resolves start /\n // end against the direction it captured when this ref was created. The\n // `<wr-segmented>` the picker draws its HEX / RGB / HSL tabs with is the\n // visible half: its thumb reads `Directionality` LIVE, so a flip while this\n // panel was open slid the thumb to the other slot inside a pane still drawn\n // `ltr` — parked under the wrong tab, which is the symptom that started all\n // of this.\n wrFollowDirection(this.overlayRef, this.dir, this.injector);\n\n const portal = new ComponentPortal(WrColorPicker, this.vcr);\n const ref = this.overlayRef.attach(portal);\n\n ref.setInput('alpha', this.alpha());\n ref.setInput('format', this.format());\n ref.setInput('swatches', this.swatches());\n ref.setInput('disabled', this.disabled());\n ref.setInput('value', this.value());\n\n // Render now rather than next frame: the picker's surfaces have to exist\n // before focus can move to one, and a deferred focus is the class of bug\n // this repo keeps finding.\n ref.changeDetectorRef.detectChanges();\n // Focus has to ENTER the panel. The overlay container sits at the end of\n // `<body>`, so a Tab from the trigger went to the next thing on the PAGE and\n // the saturation surface and both sliders — all `tabindex=\"0\"`, all\n // `role=\"slider\"` or `role=\"group\"` — were unreachable from the keyboard for\n // as long as the picker was open. The saturation surface is the first stop\n // and the one that carries the colour's two main values.\n //\n // Deliberately NOT a focus trap, matching `wr-popover` / `[wrPopconfirm]`:\n // this popup is non-modal, an outside click or Escape closes it, and\n // trapping would only make it harder to leave.\n this.overlayRef.overlayElement.querySelector<HTMLElement>('.wr-color-picker__sv')?.focus();\n\n // Bridge the inner picker's `value` model back to our two-way [(value)].\n ref.instance.value.subscribe((next: string) => this.value.set(next));\n\n // Outside-click → close (the source only filters out the overlay pane, so\n // the re-click on our own trigger still arrives here and has to be ignored).\n this.outsideClick\n .outsidePointerEvents(this.overlayRef)\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (this.host.nativeElement.contains(event.target as Node)) return;\n this.close();\n });\n\n // Escape → close.\n this.overlayRef\n .keydownEvents()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (event.key === 'Escape') {\n event.preventDefault();\n this.close();\n }\n });\n\n this.isOpen.set(true);\n this.opened.emit();\n }\n\n /** Close the picker. No-op if already closed. */\n close(): void {\n if (!this.isOpen()) return;\n // Focus lives inside the panel while it is open, and removing the panel\n // would drop it to `<body>` — hand it back to the trigger instead, the way\n // `[wrPopconfirm]` does. Only when focus is still IN there: if the user has\n // already clicked elsewhere, taking it back would be stealing.\n const returnFocus = !!this.overlayRef?.overlayElement.contains(document.activeElement);\n this.dispose();\n this.isOpen.set(false);\n this.closed.emit();\n if (returnFocus) this.host.nativeElement.focus();\n }\n\n private dispose(): void {\n if (this.overlayRef) {\n this.overlayRef.dispose();\n this.overlayRef = null;\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA;;;;;AAKG;AAKH;;AAEG;AACG,SAAU,QAAQ,CAAC,GAAU,EAAA;AACjC,IAAA,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG;AACrB,IAAA,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG;AACrB,IAAA,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG;AACrB,IAAA,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AAC7B,IAAA,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AAC7B,IAAA,MAAM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AAA,CAAA;AACT,oBAAA,QAAQ,EAAE,wBAAwB;AAClC,oBAAA,QAAQ,EAAE,sBAAsB;AAChC,oBAAA,IAAI,EAAE;AACJ,wBAAA,SAAS,EAAE,UAAU;;;AAGrB,wBAAA,sBAAsB,EAAE,UAAU;AAClC,wBAAA,sBAAsB,EAAE,UAAU;;;;AAIlC,wBAAA,sBAAsB,EAAE,2BAA2B;;;;AAInD,wBAAA,sBAAsB,EAAE,0BAA0B;AACnD,qBAAA;AACF,iBAAA;;;ACxED;;AAEG;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-command-palette-testing.mjs","sources":["../../../projects/lib/command-palette/testing/wr-command-palette-item-harness.ts","../../../projects/lib/command-palette/testing/wr-command-palette-group-harness.ts","../../../projects/lib/command-palette/testing/wr-command-palette-harness.ts","../../../projects/lib/command-palette/testing/ngwr-command-palette-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 { WrCommandPaletteItemHarnessFilters } from './interfaces';\n\n/**\n * Test harness for one command inside an open `<wr-command-palette>`.\n *\n * An item is an `option` in the palette's listbox, and it is never focused — the\n * search input keeps focus and points at the highlighted row with\n * `aria-activedescendant` — so `aria-selected` and the row's `id` are the whole\n * story a screen reader is told, and both are read here rather than the\n * `--active` class that paints it.\n *\n * @example\n * ```ts\n * const palette = await loader.getHarness(WrCommandPaletteHarness);\n * const [first] = await palette.getItems();\n *\n * expect(await first.getLabel()).toBe('Open file');\n * expect(await first.getShortcut()).toBe('⌘O');\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrCommandPaletteItemHarness extends ComponentHarness {\n /** The row the palette renders per command — also the `role=\"option\"`. */\n static hostSelector = '.wr-command-palette__option';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrCommandPaletteItemHarnessFilters = {}): HarnessPredicate<WrCommandPaletteItemHarness> {\n return new HarnessPredicate(WrCommandPaletteItemHarness, options)\n .addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getLabel(), text))\n .addOption('active', options.active, async (harness, active) => (await harness.isActive()) === active);\n }\n\n /**\n * The item's primary label.\n *\n * Read from the label element rather than from the host's text: the host also\n * holds the description, the shortcut hint, and whatever text sits inside a\n * registered icon's SVG (`<title>`, most often) — an icon with one would\n * otherwise turn up in the middle of the answer.\n */\n async getLabel(): Promise<string> {\n return (await this.locatorFor('.wr-command-palette__option-label')()).text();\n }\n\n /** The secondary line under the label, or `null` when the item declares none. */\n async getDescription(): Promise<string | null> {\n const description = await this.locatorForOptional('.wr-command-palette__option-description')();\n return description ? description.text() : null;\n }\n\n /**\n * The shortcut hint painted on the right, or `null` when the item declares none.\n *\n * A hint only — the palette draws whatever string it was given and binds\n * nothing. Only `trigger` is a real keybinding.\n */\n async getShortcut(): Promise<string | null> {\n const shortcut = await this.locatorForOptional('.wr-command-palette__option-shortcut')();\n return shortcut ? shortcut.text() : null;\n }\n\n /**\n * The leading icon's registered name, or `null` when the item declares no icon.\n *\n * The icon SLOT is always painted — an item without one gets a blank span so\n * every label stays on the same left edge — so the query is for the `<wr-icon>`\n * itself. It reflects the name it was asked for as `data-icon` whether or not\n * that name is registered, so this answers what the item MEANT to draw.\n */\n async getIconName(): Promise<string | null> {\n const icon = await this.locatorForOptional('wr-icon.wr-command-palette__option-icon')();\n return icon ? icon.getAttribute('data-icon') : null;\n }\n\n /** The role the item announces — `option`. */\n async getRole(): Promise<string | null> {\n return (await this.host()).getAttribute('role');\n }\n\n /**\n * Whether this item is the highlighted one.\n *\n * From `aria-selected`, not the `wr-command-palette__option--active` class:\n * both are public and the template paints them from the same predicate, but the\n * attribute is what a screen reader acts on — and it is the one\n * `aria-activedescendant` has to agree with. See\n * `WrCommandPaletteHarness.isActiveItemAnnounced()`.\n */\n async isActive(): Promise<boolean> {\n return (await (await this.host()).getAttribute('aria-selected')) === 'true';\n }\n\n /** The row's `id` — what the search input points at while this item is highlighted. */\n async getId(): Promise<string> {\n const id = await (await this.host()).getAttribute('id');\n if (!id) {\n throw new Error(\n `WrCommandPaletteItemHarness.getId(): \"${await this.getLabel()}\" has no id, so no search input can ` +\n 'point at it with `aria-activedescendant` — the palette assigns one per rendered row.'\n );\n }\n return id;\n }\n\n /**\n * Run this command — the pointer path.\n *\n * The palette commits on `mousedown` rather than on `click`, so that a press\n * inside the panel never lets the input lose focus first; the CDK's click\n * sequence opens with one, so this drives the real handler. It needs no\n * coordinates, which is what makes it usable in jsdom at all.\n *\n * With `closeOnPick` left at its default this also closes the palette, taking\n * every item harness — including this one — out of the DOM.\n */\n async click(): Promise<void> {\n return (await this.host()).click();\n }\n\n /**\n * Move the pointer onto this item, which highlights it.\n *\n * The palette follows the pointer as well as the keyboard, but only the\n * keyboard scrolls the row into view — hovering deliberately leaves the scroll\n * position alone, since moving it would fight the pointer that caused the move.\n */\n async hover(): Promise<void> {\n return (await this.host()).hover();\n }\n}\n","/**\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 { WrCommandPaletteGroupHarnessFilters, WrCommandPaletteItemHarnessFilters } from './interfaces';\nimport { WrCommandPaletteItemHarness } from './wr-command-palette-item-harness';\n\n/**\n * Test harness for one bucket of commands inside an open `<wr-command-palette>`.\n *\n * The palette buckets its items by `group`, in the order each group first\n * appears in `items` — which is why this exists as a harness of its own: it is\n * the only way to ask which commands ended up under which heading, and the\n * rendered order is the contract every index in the palette is counted against.\n *\n * A bucket WITH a title is a labelled `group`; the bucket holding ungrouped items\n * carries `role=\"none\"` instead, so its options belong to the listbox directly —\n * a `listbox` may only own `option` and `group` children, and a role-less\n * wrapper in between is something ARIA has no rule for.\n *\n * @example\n * ```ts\n * const palette = await loader.getHarness(WrCommandPaletteHarness);\n * const [file] = await palette.getGroups({ title: 'File' });\n *\n * expect(await file.getItemLabels()).toEqual(['Open file', 'Save file']);\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrCommandPaletteGroupHarness extends ComponentHarness {\n static hostSelector = '.wr-command-palette__group';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrCommandPaletteGroupHarnessFilters = {}): HarnessPredicate<WrCommandPaletteGroupHarness> {\n return new HarnessPredicate(WrCommandPaletteGroupHarness, options).addOption(\n 'title',\n options.title,\n (harness, title) => HarnessPredicate.stringMatches(harness.getTitle(), title)\n );\n }\n\n /** The heading over this bucket, or `null` for the one holding ungrouped items. */\n async getTitle(): Promise<string | null> {\n const title = await this.locatorForOptional('.wr-command-palette__group-title')();\n return title ? title.text() : null;\n }\n\n /**\n * The role this bucket announces — `group` when it has a title, `none` when it\n * does not, which promotes its options to the listbox's own children.\n */\n async getRole(): Promise<string | null> {\n return (await this.host()).getAttribute('role');\n }\n\n /**\n * Whether this bucket takes its accessible name from its own heading.\n *\n * The reference IS the group's name — no bucket carries an `aria-label` — and\n * the id it points at is generated, so a spec cannot hard-code one. `false` for\n * the untitled bucket, which has no name and needs none: it is `role=\"none\"`.\n */\n async isLabelledByTitle(): Promise<boolean> {\n const title = await this.locatorForOptional('.wr-command-palette__group-title')();\n if (!title) return false;\n\n const labelledBy = await (await this.host()).getAttribute('aria-labelledby');\n return labelledBy !== null && labelledBy === (await title.getAttribute('id'));\n }\n\n /** The commands in this bucket, in rendered order. */\n async getItems(filters: WrCommandPaletteItemHarnessFilters = {}): Promise<WrCommandPaletteItemHarness[]> {\n return this.locatorForAll(WrCommandPaletteItemHarness.with(filters))();\n }\n\n /** The labels of the commands in this bucket, in rendered order. */\n async getItemLabels(): Promise<string[]> {\n const items = await this.getItems();\n return Promise.all(items.map(item => item.getLabel()));\n }\n}\n","/**\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, type ModifierKeys, TestKey, type TestElement } from '@angular/cdk/testing';\n\nimport type {\n WrCommandPaletteGroupHarnessFilters,\n WrCommandPaletteHarnessFilters,\n WrCommandPaletteItemHarnessFilters,\n} from './interfaces';\nimport { WrCommandPaletteGroupHarness } from './wr-command-palette-group-harness';\nimport { WrCommandPaletteItemHarness } from './wr-command-palette-item-harness';\n\n/**\n * Test harness for `<wr-command-palette>` — the `⌘K` modal, its search box and\n * the filtered list of commands.\n *\n * Three things about this component shape the harness, and none of them match the\n * other overlay harnesses in the library:\n *\n * 1. **It is an element, and it keeps its own dialog.** The panel is NOT portalled\n * into the overlay container: the whole `role=\"dialog\"` lives inside\n * `<wr-command-palette>`, wrapped in an `@if (open())`. So every query here is\n * host-scoped — two palettes on one page cannot read each other's rows — and a\n * closed palette holds nothing at all, which is why the readers below throw\n * instead of answering emptily.\n * 2. **There is no trigger element.** The way in is a GLOBAL hotkey (`trigger`,\n * `'mod+k'` by default), bound on the document, so {@link open} presses a chord\n * at the document rather than clicking anything. A palette with\n * `[trigger]=\"null\"` cannot be opened from the DOM at all — set the bound\n * `open` from the spec. And because the first binding to match a chord calls\n * `preventDefault()`, which stops the rest, two palettes sharing one chord\n * means only the first-registered one ever toggles: see {@link pressTrigger}.\n * 3. **The rows are never focused.** Focus stays in the search input, which points\n * at the highlighted row with `aria-activedescendant`. Navigation is therefore\n * `moveTo*`, not `focus`, and \"where am I\" is answered by `aria-selected` plus\n * that reference — {@link isActiveItemAnnounced} asserts the pair agrees.\n *\n * @example\n * ```ts\n * const palette = await loader.getHarness(WrCommandPaletteHarness);\n *\n * await palette.open();\n * await palette.setQuery('file');\n * await palette.moveToNextItem();\n * await palette.runActiveItem();\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrCommandPaletteHarness extends ComponentHarness {\n static hostSelector = 'wr-command-palette';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrCommandPaletteHarnessFilters = {}): HarnessPredicate<WrCommandPaletteHarness> {\n return new HarnessPredicate(WrCommandPaletteHarness, options)\n .addOption('open', options.open, async (harness, open) => (await harness.isOpen()) === open)\n .addOption('label', options.label, (harness, label) => HarnessPredicate.stringMatches(harness.getLabel(), label));\n }\n\n /** Whether the palette is showing. */\n async isOpen(): Promise<boolean> {\n return (await this.dialog()) !== null;\n }\n\n /**\n * The role the palette announces — `dialog` — or `null` while it is closed.\n *\n * Worth asking rather than assuming: the role sits on the palette's own\n * backdrop-and-panel wrapper, not on the `<wr-command-palette>` host, so a\n * consumer looking for it on the element they wrote would not find it.\n */\n async getRole(): Promise<string | null> {\n const dialog = await this.dialog();\n return dialog ? dialog.getAttribute('role') : null;\n }\n\n /** Whether the palette is marked `aria-modal`. `false` while it is closed. */\n async isModal(): Promise<boolean> {\n const dialog = await this.dialog();\n return dialog !== null && (await dialog.getAttribute('aria-modal')) === 'true';\n }\n\n /**\n * The palette's accessible name — `paletteLabel`, or the catalogue string it\n * falls back to. `null` while it is closed, since the element carrying the name\n * does not exist then.\n */\n async getLabel(): Promise<string | null> {\n const dialog = await this.dialog();\n return dialog ? dialog.getAttribute('aria-label') : null;\n }\n\n /**\n * Whether this opening is presented full-screen instead of as a centred modal.\n *\n * Read from the `--sheet` modifier, which is public API: `responsive` is an\n * input that never reaches the DOM, and the decision also folds in the viewport\n * width — so the class is the only place the outcome exists. `false` while closed.\n *\n * That width is sampled when the palette last RECOMPUTED the decision, which is\n * when `responsive` or the app-wide `provideWrResponsiveOverlays()` config\n * changes — not when the palette opens. So a spec that narrows the viewport and\n * then opens sees nothing move until one of those two changes as well.\n */\n async isPresentedAsSheet(): Promise<boolean> {\n const dialog = await this.dialog();\n return dialog !== null && (await dialog.hasClass('wr-command-palette--sheet'));\n }\n\n /** The search box's placeholder — `placeholder`, or the catalogue fallback. */\n async getPlaceholder(): Promise<string> {\n return (await this.searchInput('getPlaceholder')).getProperty<string>('placeholder');\n }\n\n /** What is currently typed in the search box. */\n async getQuery(): Promise<string> {\n return (await this.searchInput('getQuery')).getProperty<string>('value');\n }\n\n /**\n * Replace the search query, filtering the list.\n *\n * The palette matches a query against each item's label, description, group and\n * keywords, and every keystroke sends the highlight back to the FIRST result —\n * so a spec that moves the highlight and then types has to move it again.\n */\n async setQuery(query: string): Promise<void> {\n const input = await this.searchInput('setQuery');\n await input.clear();\n if (query) await input.sendKeys(query);\n }\n\n /**\n * Whether the search box and the list are wired to each other the way a\n * combobox and its listbox have to be: the input announces itself expanded and\n * its `aria-controls` names THIS palette's listbox.\n *\n * The ids are generated per instance, so a spec cannot hard-code one — and this\n * reads the listbox inside this host, so a second palette's list can never\n * satisfy it.\n */\n async isSearchWiredToList(): Promise<boolean> {\n const input = await this.searchInput('isSearchWiredToList');\n const controls = await input.getAttribute('aria-controls');\n\n return (\n (await input.getAttribute('aria-expanded')) === 'true' &&\n controls !== null &&\n controls === (await (await this.listbox()).getAttribute('id'))\n );\n }\n\n /**\n * The commands currently offered, in rendered order.\n *\n * Rendered order, not the order they were passed in: the palette buckets by\n * `group` as each group first appears, so two interleaved groups come back\n * regrouped — and that order is what the arrows walk and what every index here\n * counts against.\n */\n async getItems(filters: WrCommandPaletteItemHarnessFilters = {}): Promise<WrCommandPaletteItemHarness[]> {\n await this.requireOpen('getItems');\n return this.locatorForAll(WrCommandPaletteItemHarness.with(filters))();\n }\n\n /** The labels of the commands currently offered, in rendered order. */\n async getItemLabels(): Promise<string[]> {\n const items = await this.getItems();\n return Promise.all(items.map(item => item.getLabel()));\n }\n\n /** The buckets the commands are grouped into, in rendered order. */\n async getGroups(filters: WrCommandPaletteGroupHarnessFilters = {}): Promise<WrCommandPaletteGroupHarness[]> {\n await this.requireOpen('getGroups');\n return this.locatorForAll(WrCommandPaletteGroupHarness.with(filters))();\n }\n\n /**\n * One entry per bucket, in rendered order — `null` for the bucket holding\n * ungrouped items, which is unlabelled by design.\n */\n async getGroupTitles(): Promise<(string | null)[]> {\n const groups = await this.getGroups();\n return Promise.all(groups.map(group => group.getTitle()));\n }\n\n /**\n * The \"no results\" message, or `null` when the palette has results.\n *\n * The two are exclusive — the panel renders the message INSTEAD of the buckets —\n * so a non-null answer here and an empty {@link getItemLabels} are the same fact.\n */\n async getEmptyText(): Promise<string | null> {\n await this.requireOpen('getEmptyText');\n const empty = await this.locatorForOptional('.wr-command-palette__empty')();\n return empty ? empty.text() : null;\n }\n\n /** The highlighted command, or `null` when nothing matches the query. */\n async getActiveItem(): Promise<WrCommandPaletteItemHarness | null> {\n const [active] = await this.getItems({ active: true });\n return active ?? null;\n }\n\n /** The highlighted command's label, or `null` when nothing matches the query. */\n async getActiveItemLabel(): Promise<string | null> {\n const active = await this.getActiveItem();\n return active ? active.getLabel() : null;\n }\n\n /**\n * Where the highlight sits in the rendered list, or `-1` when nothing matches\n * the query.\n */\n async getActiveItemIndex(): Promise<number> {\n const items = await this.getItems();\n for (let index = 0; index < items.length; index++) {\n if (await items[index].isActive()) return index;\n }\n return -1;\n }\n\n /**\n * Whether the search box points at the row that is actually highlighted.\n *\n * The rows are not focusable, so this reference is the ONLY thing telling a\n * screen-reader user where they are — and it is a per-instance id, so it is also\n * what would give away a palette announcing another palette's row. An empty list\n * announces nothing, and that counts as agreeing.\n */\n async isActiveItemAnnounced(): Promise<boolean> {\n const announced = await (await this.searchInput('isActiveItemAnnounced')).getAttribute('aria-activedescendant');\n const active = await this.getActiveItem();\n\n if (!active) return announced === null;\n return announced !== null && announced === (await active.getId());\n }\n\n /**\n * Open the palette with its global hotkey.\n *\n * Throws when the chord changes nothing, because every reason it would is worth\n * failing on rather than continuing against a closed palette — see\n * {@link pressTrigger} for the list.\n */\n async open(): Promise<void> {\n if (await this.isOpen()) return;\n await this.pressTrigger();\n }\n\n /**\n * Close the palette with Escape, the way a keyboard user does. A closed palette\n * is left alone.\n */\n async close(): Promise<void> {\n if (!(await this.isOpen())) return;\n\n await (await this.searchInput('close')).sendKeys(TestKey.ESCAPE);\n if (!(await this.isOpen())) return;\n\n throw new Error(\n 'WrCommandPaletteHarness.close(): Escape did not close the palette. The panel handles it whatever ' +\n 'holds focus inside, so check that `open` is not being written back by the binding it came from.'\n );\n }\n\n /** Dismiss the palette by clicking outside the panel, on the backdrop. */\n async clickBackdrop(): Promise<void> {\n await this.requireOpen('clickBackdrop');\n await (await this.locatorFor('.wr-command-palette__backdrop')()).click();\n }\n\n /**\n * Press the palette's global trigger chord, which TOGGLES it.\n *\n * Two things make this the least local method on the harness, and both are the\n * component's design rather than a shortcut here:\n *\n * - The chord is dispatched at the document, because that is where `trigger` is\n * bound. It reaches every palette on the page, not just this one.\n * - `mod` is Cmd on a Mac and Ctrl everywhere else, and nothing in the DOM says\n * which. The binding compares modifier state EXACTLY, so a chord with both set\n * matches neither: Ctrl is tried first, then Cmd, watching whether this palette\n * moved.\n *\n * Throws when neither did anything. With two palettes bound to the same chord\n * that is exactly what happens to the SECOND one — the first binding to match\n * calls `preventDefault()`, which stops the rest — and the first palette will\n * have toggled on the way. Give the palettes different `trigger` specs, or drive\n * them through the bound `open`.\n */\n async pressTrigger(): Promise<void> {\n const before = await this.isOpen();\n\n await this.pressHotkey('k', { control: true });\n if ((await this.isOpen()) !== before) return;\n\n await this.pressHotkey('k', { meta: true });\n if ((await this.isOpen()) !== before) return;\n\n throw new Error(\n 'WrCommandPaletteHarness.pressTrigger(): `mod+k` left this palette ' +\n `${before ? 'open' : 'closed'}. It fails when \\`trigger\\` is \\`null\\` (nothing is bound — write the ` +\n 'bound `open` instead), when `trigger` is some other spec (press it with pressHotkey()), or when ' +\n 'another palette is bound to the same chord and matched it first.'\n );\n }\n\n /**\n * Press an arbitrary chord at the document, where `trigger` is bound — the way\n * to exercise a palette whose `trigger` is not the default `'mod+k'`.\n *\n * The keys go to the `<wr-command-palette>` host and bubble to the document from\n * there. Any element inside the page would do — the listener is the document's,\n * and it fires even while a text field has focus — but the host is the one this\n * harness can always reach, and it takes no focus of its own, so an open palette\n * keeps the caret in its search box.\n */\n async pressHotkey(key: string, modifiers: ModifierKeys = {}): Promise<void> {\n await (await this.host()).sendKeys(modifiers, key);\n }\n\n /** Move the highlight down one row. Wraps from the last row to the first. */\n async moveToNextItem(): Promise<void> {\n await (await this.searchInput('moveToNextItem')).sendKeys(TestKey.DOWN_ARROW);\n }\n\n /** Move the highlight up one row. Wraps from the first row to the last. */\n async moveToPreviousItem(): Promise<void> {\n await (await this.searchInput('moveToPreviousItem')).sendKeys(TestKey.UP_ARROW);\n }\n\n /** Move the highlight to the first row — Home. */\n async moveToFirstItem(): Promise<void> {\n await (await this.searchInput('moveToFirstItem')).sendKeys(TestKey.HOME);\n }\n\n /** Move the highlight to the last row — End. */\n async moveToLastItem(): Promise<void> {\n await (await this.searchInput('moveToLastItem')).sendKeys(TestKey.END);\n }\n\n /**\n * Run the highlighted command — Enter in the search box, the accessible path.\n *\n * Throws when nothing is highlighted, which happens exactly when the query\n * matches nothing: Enter would then be a no-op and the spec would pass having\n * run no command at all. Assert {@link getEmptyText} instead.\n */\n async runActiveItem(): Promise<void> {\n const input = await this.searchInput('runActiveItem');\n\n if (!(await this.getActiveItem())) {\n throw new Error(\n 'WrCommandPaletteHarness.runActiveItem(): nothing is highlighted, so Enter would run nothing — ' +\n `the query \"${await this.getQuery()}\" matches no command. Assert getEmptyText() instead.`\n );\n }\n\n await input.sendKeys(TestKey.ENTER);\n }\n\n /**\n * Run the first command matching the filters, by pointer.\n *\n * The palette must already be open — unlike a select, there is nothing to click\n * to open it, so this cannot do it for you. With `closeOnPick` left at its\n * default the palette closes as the command runs.\n */\n async runItem(filters: WrCommandPaletteItemHarnessFilters): Promise<void> {\n const [item] = await this.getItems(filters);\n if (!item) {\n const offered = await this.getItemLabels();\n throw new Error(\n `WrCommandPaletteHarness.runItem(): no command matched ${JSON.stringify(filters)}. ` +\n `The palette offers: ${offered.length > 0 ? offered.join(', ') : '(nothing — the query matches none)'}.`\n );\n }\n\n await item.click();\n }\n\n /** Put the caret in the search box. The palette does this itself as it opens. */\n async focus(): Promise<void> {\n return (await this.searchInput('focus')).focus();\n }\n\n /**\n * Take focus out of the search box.\n *\n * The palette emits nothing on blur — it exists so a spec can prove\n * {@link focus} puts the caret back where the component put it.\n */\n async blur(): Promise<void> {\n return (await this.searchInput('blur')).blur();\n }\n\n /**\n * Whether the caret is in the search box.\n *\n * The only focus question worth asking of this component: the rows are never\n * focused, so the input is where focus is meant to stay for as long as the\n * palette is open.\n */\n async isSearchInputFocused(): Promise<boolean> {\n return (await this.searchInput('isSearchInputFocused')).isFocused();\n }\n\n /** The palette's dialog wrapper, or `null` while it is closed. */\n private async dialog(): Promise<TestElement | null> {\n // The role, not `.wr-command-palette`: both sit on the same element, but the\n // role is what a screen reader is told, and the element only exists while the\n // palette is open — so \"is there a dialog in this host\" IS the open state.\n return this.locatorForOptional('[role=\"dialog\"]')();\n }\n\n /** The search box, or a failure naming the reason there is none. */\n private async searchInput(method: string): Promise<TestElement> {\n await this.requireOpen(method);\n // Matched on the role rather than on `.wr-command-palette__search input`: the\n // combobox is the accessible contract, and the search row also holds a\n // decorative icon and the `esc` hint.\n return this.locatorFor('input[role=\"combobox\"]')();\n }\n\n /** This palette's listbox. */\n private async listbox(): Promise<TestElement> {\n return this.locatorFor('[role=\"listbox\"]')();\n }\n\n /** Fail with the reason when the panel is not rendered. */\n private async requireOpen(method: string): Promise<void> {\n if (await this.isOpen()) return;\n\n throw new Error(\n `WrCommandPaletteHarness.${method}(): the palette is closed, so nothing it holds exists — the search ` +\n 'box, the list and the rows are all inside an `@if (open())`. Call open() to press the global ' +\n 'trigger, or set the bound `open` when this palette has none.'\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;AAKG;AAMH;;;;;;;;;;;;;;;;;;;AAmBG;AACG,MAAO,2BAA4B,SAAQ,gBAAgB,CAAA;;AAE/D,IAAA,OAAO,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;;AAGA,IAAA,MAAM,KAAK,GAAA;AACT,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE;IAClD;AAEA;;;;;AAKG;AACH,IAAA,MAAM,IAAI,GAAA;AACR,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE;IAChD;AAEA;;;;;;AAMG;AACH,IAAA,MAAM,oBAAoB,GAAA;AACxB,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,sBAAsB,CAAC,EAAE,SAAS,EAAE;IACrE;;AAGQ,IAAA,MAAM,MAAM,GAAA;;;;AAIlB,QAAA,OAAO,IAAI,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,EAAE;IACrD;;IAGQ,MAAM,WAAW,CAAC,MAAc,EAAA;AACtC,QAAA,MAAM,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC;;;;AAI9B,QAAA,OAAO,IAAI,CAAC,UAAU,CAAC,wBAAwB,CAAC,EAAE;IACpD;;AAGQ,IAAA,MAAM,OAAO,GAAA;AACnB,QAAA,OAAO,IAAI,CAAC,UAAU,CAAC,kBAAkB,CAAC,EAAE;IAC9C;;IAGQ,MAAM,WAAW,CAAC,MAAc,EAAA;AACtC,QAAA,IAAI,MAAM,IAAI,CAAC,MAAM,EAAE;YAAE;AAEzB,QAAA,MAAM,IAAI,KAAK,CACb,CAAA,wBAAA,EAA2B,MAAM,CAAA,mEAAA,CAAqE;YACpG,+FAA+F;AAC/F,YAAA,8DAA8D,CACjE;IACH;;;AC5bF;;AAEG;;;;"}
1
+ {"version":3,"file":"ngwr-command-palette-testing.mjs","sources":["../../../projects/lib/command-palette/testing/wr-command-palette-item-harness.ts","../../../projects/lib/command-palette/testing/wr-command-palette-group-harness.ts","../../../projects/lib/command-palette/testing/wr-command-palette-harness.ts","../../../projects/lib/command-palette/testing/ngwr-command-palette-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 { WrCommandPaletteItemHarnessFilters } from './interfaces';\n\n/**\n * Test harness for one command inside an open `<wr-command-palette>`.\n *\n * An item is an `option` in the palette's listbox, and it is never focused — the\n * search input keeps focus and points at the highlighted row with\n * `aria-activedescendant` — so `aria-selected` and the row's `id` are the whole\n * story a screen reader is told, and both are read here rather than the\n * `--active` class that paints it.\n *\n * @example\n * ```ts\n * const palette = await loader.getHarness(WrCommandPaletteHarness);\n * const [first] = await palette.getItems();\n *\n * expect(await first.getLabel()).toBe('Open file');\n * expect(await first.getShortcut()).toBe('⌘O');\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrCommandPaletteItemHarness extends ComponentHarness {\n /** The row the palette renders per command — also the `role=\"option\"`. */\n static hostSelector = '.wr-command-palette__option';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrCommandPaletteItemHarnessFilters = {}): HarnessPredicate<WrCommandPaletteItemHarness> {\n return new HarnessPredicate(WrCommandPaletteItemHarness, options)\n .addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getLabel(), text))\n .addOption('active', options.active, async (harness, active) => (await harness.isActive()) === active);\n }\n\n /**\n * The item's primary label.\n *\n * Read from the label element rather than from the host's text: the host also\n * holds the description, the shortcut hint, and whatever text sits inside a\n * registered icon's SVG (`<title>`, most often) — an icon with one would\n * otherwise turn up in the middle of the answer.\n */\n async getLabel(): Promise<string> {\n return (await this.locatorFor('.wr-command-palette__option-label')()).text();\n }\n\n /** The secondary line under the label, or `null` when the item declares none. */\n async getDescription(): Promise<string | null> {\n const description = await this.locatorForOptional('.wr-command-palette__option-description')();\n return description ? description.text() : null;\n }\n\n /**\n * The shortcut hint painted on the right, or `null` when the item declares none.\n *\n * A hint only — the palette draws whatever string it was given and binds\n * nothing. Only `trigger` is a real keybinding.\n */\n async getShortcut(): Promise<string | null> {\n const shortcut = await this.locatorForOptional('.wr-command-palette__option-shortcut')();\n return shortcut ? shortcut.text() : null;\n }\n\n /**\n * The leading icon's registered name, or `null` when the item declares no icon.\n *\n * The icon SLOT is always painted — an item without one gets a blank span so\n * every label stays on the same left edge — so the query is for the `<wr-icon>`\n * itself. It reflects the name it was asked for as `data-icon` whether or not\n * that name is registered, so this answers what the item MEANT to draw.\n */\n async getIconName(): Promise<string | null> {\n const icon = await this.locatorForOptional('wr-icon.wr-command-palette__option-icon')();\n return icon ? icon.getAttribute('data-icon') : null;\n }\n\n /** The role the item announces — `option`. */\n async getRole(): Promise<string | null> {\n return (await this.host()).getAttribute('role');\n }\n\n /**\n * Whether this item is the highlighted one.\n *\n * From `aria-selected`, not the `wr-command-palette__option--active` class:\n * both are public and the template paints them from the same predicate, but the\n * attribute is what a screen reader acts on — and it is the one\n * `aria-activedescendant` has to agree with. See\n * `WrCommandPaletteHarness.isActiveItemAnnounced()`.\n */\n async isActive(): Promise<boolean> {\n return (await (await this.host()).getAttribute('aria-selected')) === 'true';\n }\n\n /** The row's `id` — what the search input points at while this item is highlighted. */\n async getId(): Promise<string> {\n const id = await (await this.host()).getAttribute('id');\n if (!id) {\n throw new Error(\n `WrCommandPaletteItemHarness.getId(): \"${await this.getLabel()}\" has no id, so no search input can ` +\n 'point at it with `aria-activedescendant` — the palette assigns one per rendered row.'\n );\n }\n return id;\n }\n\n /**\n * Run this command — the pointer path.\n *\n * The palette commits on `mousedown` rather than on `click`, so that a press\n * inside the panel never lets the input lose focus first; the CDK's click\n * sequence opens with one, so this drives the real handler. It needs no\n * coordinates, which is what makes it usable in jsdom at all.\n *\n * With `closeOnPick` left at its default this also closes the palette, taking\n * every item harness — including this one — out of the DOM.\n */\n async click(): Promise<void> {\n return (await this.host()).click();\n }\n\n /**\n * Move the pointer onto this item, which highlights it.\n *\n * The palette follows the pointer as well as the keyboard, but only the\n * keyboard scrolls the row into view — hovering deliberately leaves the scroll\n * position alone, since moving it would fight the pointer that caused the move.\n */\n async hover(): Promise<void> {\n return (await this.host()).hover();\n }\n}\n","/**\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 { WrCommandPaletteGroupHarnessFilters, WrCommandPaletteItemHarnessFilters } from './interfaces';\nimport { WrCommandPaletteItemHarness } from './wr-command-palette-item-harness';\n\n/**\n * Test harness for one bucket of commands inside an open `<wr-command-palette>`.\n *\n * The palette buckets its items by `group`, in the order each group first\n * appears in `items` — which is why this exists as a harness of its own: it is\n * the only way to ask which commands ended up under which heading, and the\n * rendered order is the contract every index in the palette is counted against.\n *\n * A bucket WITH a title is a labelled `group`; the bucket holding ungrouped items\n * carries `role=\"none\"` instead, so its options belong to the listbox directly —\n * a `listbox` may only own `option` and `group` children, and a role-less\n * wrapper in between is something ARIA has no rule for.\n *\n * @example\n * ```ts\n * const palette = await loader.getHarness(WrCommandPaletteHarness);\n * const [file] = await palette.getGroups({ title: 'File' });\n *\n * expect(await file.getItemLabels()).toEqual(['Open file', 'Save file']);\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrCommandPaletteGroupHarness extends ComponentHarness {\n static hostSelector = '.wr-command-palette__group';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrCommandPaletteGroupHarnessFilters = {}): HarnessPredicate<WrCommandPaletteGroupHarness> {\n return new HarnessPredicate(WrCommandPaletteGroupHarness, options).addOption(\n 'title',\n options.title,\n (harness, title) => HarnessPredicate.stringMatches(harness.getTitle(), title)\n );\n }\n\n /** The heading over this bucket, or `null` for the one holding ungrouped items. */\n async getTitle(): Promise<string | null> {\n const title = await this.locatorForOptional('.wr-command-palette__group-title')();\n return title ? title.text() : null;\n }\n\n /**\n * The role this bucket announces — `group` when it has a title, `none` when it\n * does not, which promotes its options to the listbox's own children.\n */\n async getRole(): Promise<string | null> {\n return (await this.host()).getAttribute('role');\n }\n\n /**\n * Whether this bucket takes its accessible name from its own heading.\n *\n * The reference IS the group's name — no bucket carries an `aria-label` — and\n * the id it points at is generated, so a spec cannot hard-code one. `false` for\n * the untitled bucket, which has no name and needs none: it is `role=\"none\"`.\n */\n async isLabelledByTitle(): Promise<boolean> {\n const title = await this.locatorForOptional('.wr-command-palette__group-title')();\n if (!title) return false;\n\n const labelledBy = await (await this.host()).getAttribute('aria-labelledby');\n return labelledBy !== null && labelledBy === (await title.getAttribute('id'));\n }\n\n /** The commands in this bucket, in rendered order. */\n async getItems(filters: WrCommandPaletteItemHarnessFilters = {}): Promise<WrCommandPaletteItemHarness[]> {\n return this.locatorForAll(WrCommandPaletteItemHarness.with(filters))();\n }\n\n /** The labels of the commands in this bucket, in rendered order. */\n async getItemLabels(): Promise<string[]> {\n const items = await this.getItems();\n return Promise.all(items.map(item => item.getLabel()));\n }\n}\n","/**\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, type ModifierKeys, TestKey, type TestElement } from '@angular/cdk/testing';\n\nimport type {\n WrCommandPaletteGroupHarnessFilters,\n WrCommandPaletteHarnessFilters,\n WrCommandPaletteItemHarnessFilters,\n} from './interfaces';\nimport { WrCommandPaletteGroupHarness } from './wr-command-palette-group-harness';\nimport { WrCommandPaletteItemHarness } from './wr-command-palette-item-harness';\n\n/**\n * Test harness for `<wr-command-palette>` — the `⌘K` modal, its search box and\n * the filtered list of commands.\n *\n * Three things about this component shape the harness, and none of them match the\n * other overlay harnesses in the library:\n *\n * 1. **It is an element, and it keeps its own dialog.** The panel is NOT portalled\n * into the overlay container: the whole `role=\"dialog\"` lives inside\n * `<wr-command-palette>`, wrapped in an `@if (open())`. So every query here is\n * host-scoped — two palettes on one page cannot read each other's rows — and a\n * closed palette holds nothing at all, which is why the readers below throw\n * instead of answering emptily.\n * 2. **There is no trigger element.** The way in is a GLOBAL hotkey (`trigger`,\n * `'mod+k'` by default), bound on the document, so {@link open} presses a chord\n * at the document rather than clicking anything. A palette with\n * `[trigger]=\"null\"` cannot be opened from the DOM at all — set the bound\n * `open` from the spec. And because the first binding to match a chord calls\n * `preventDefault()`, which stops the rest, two palettes sharing one chord\n * means only the first-registered one ever toggles: see {@link pressTrigger}.\n * 3. **The rows are never focused.** Focus stays in the search input, which points\n * at the highlighted row with `aria-activedescendant`. Navigation is therefore\n * `moveTo*`, not `focus`, and \"where am I\" is answered by `aria-selected` plus\n * that reference — {@link isActiveItemAnnounced} asserts the pair agrees.\n *\n * @example\n * ```ts\n * const palette = await loader.getHarness(WrCommandPaletteHarness);\n *\n * await palette.open();\n * await palette.setQuery('file');\n * await palette.moveToNextItem();\n * await palette.runActiveItem();\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrCommandPaletteHarness extends ComponentHarness {\n static hostSelector = 'wr-command-palette';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrCommandPaletteHarnessFilters = {}): HarnessPredicate<WrCommandPaletteHarness> {\n return new HarnessPredicate(WrCommandPaletteHarness, options)\n .addOption('open', options.open, async (harness, open) => (await harness.isOpen()) === open)\n .addOption('label', options.label, (harness, label) => HarnessPredicate.stringMatches(harness.getLabel(), label));\n }\n\n /** Whether the palette is showing. */\n async isOpen(): Promise<boolean> {\n return (await this.dialog()) !== null;\n }\n\n /**\n * The role the palette announces — `dialog` — or `null` while it is closed.\n *\n * Worth asking rather than assuming: the role sits on the palette's own\n * backdrop-and-panel wrapper, not on the `<wr-command-palette>` host, so a\n * consumer looking for it on the element they wrote would not find it.\n */\n async getRole(): Promise<string | null> {\n const dialog = await this.dialog();\n return dialog ? dialog.getAttribute('role') : null;\n }\n\n /** Whether the palette is marked `aria-modal`. `false` while it is closed. */\n async isModal(): Promise<boolean> {\n const dialog = await this.dialog();\n return dialog !== null && (await dialog.getAttribute('aria-modal')) === 'true';\n }\n\n /**\n * The palette's accessible name — `paletteLabel`, or the catalogue string it\n * falls back to. `null` while it is closed, since the element carrying the name\n * does not exist then.\n */\n async getLabel(): Promise<string | null> {\n const dialog = await this.dialog();\n return dialog ? dialog.getAttribute('aria-label') : null;\n }\n\n /**\n * Whether this opening is presented full-screen instead of as a centred modal.\n *\n * Read from the `--sheet` modifier, which is public API: `responsive` is an\n * input that never reaches the DOM, and the decision also folds in the viewport\n * width — so the class is the only place the outcome exists. `false` while closed.\n *\n * That width is sampled when the palette last RECOMPUTED the decision, which is\n * when `responsive` or the app-wide `provideWrResponsiveOverlays()` config\n * changes — not when the palette opens. So a spec that narrows the viewport and\n * then opens sees nothing move until one of those two changes as well.\n */\n async isPresentedAsSheet(): Promise<boolean> {\n const dialog = await this.dialog();\n return dialog !== null && (await dialog.hasClass('wr-command-palette--sheet'));\n }\n\n /** The search box's placeholder — `placeholder`, or the catalogue fallback. */\n async getPlaceholder(): Promise<string> {\n return (await this.searchInput('getPlaceholder')).getProperty<string>('placeholder');\n }\n\n /** What is currently typed in the search box. */\n async getQuery(): Promise<string> {\n return (await this.searchInput('getQuery')).getProperty<string>('value');\n }\n\n /**\n * Replace the search query, filtering the list.\n *\n * The palette matches a query against each item's label, description, group and\n * keywords, and every keystroke sends the highlight back to the FIRST result —\n * so a spec that moves the highlight and then types has to move it again.\n */\n async setQuery(query: string): Promise<void> {\n const input = await this.searchInput('setQuery');\n await input.clear();\n if (query) await input.sendKeys(query);\n }\n\n /**\n * Whether the search box and the list are wired to each other the way a\n * combobox and its listbox have to be: the input announces itself expanded and\n * its `aria-controls` names THIS palette's listbox.\n *\n * The ids are generated per instance, so a spec cannot hard-code one — and this\n * reads the listbox inside this host, so a second palette's list can never\n * satisfy it.\n */\n async isSearchWiredToList(): Promise<boolean> {\n const input = await this.searchInput('isSearchWiredToList');\n const controls = await input.getAttribute('aria-controls');\n\n return (\n (await input.getAttribute('aria-expanded')) === 'true' &&\n controls !== null &&\n controls === (await (await this.listbox()).getAttribute('id'))\n );\n }\n\n /**\n * The commands currently offered, in rendered order.\n *\n * Rendered order, not the order they were passed in: the palette buckets by\n * `group` as each group first appears, so two interleaved groups come back\n * regrouped — and that order is what the arrows walk and what every index here\n * counts against.\n */\n async getItems(filters: WrCommandPaletteItemHarnessFilters = {}): Promise<WrCommandPaletteItemHarness[]> {\n await this.requireOpen('getItems');\n return this.locatorForAll(WrCommandPaletteItemHarness.with(filters))();\n }\n\n /** The labels of the commands currently offered, in rendered order. */\n async getItemLabels(): Promise<string[]> {\n const items = await this.getItems();\n return Promise.all(items.map(item => item.getLabel()));\n }\n\n /** The buckets the commands are grouped into, in rendered order. */\n async getGroups(filters: WrCommandPaletteGroupHarnessFilters = {}): Promise<WrCommandPaletteGroupHarness[]> {\n await this.requireOpen('getGroups');\n return this.locatorForAll(WrCommandPaletteGroupHarness.with(filters))();\n }\n\n /**\n * One entry per bucket, in rendered order — `null` for the bucket holding\n * ungrouped items, which is unlabelled by design.\n */\n async getGroupTitles(): Promise<(string | null)[]> {\n const groups = await this.getGroups();\n return Promise.all(groups.map(group => group.getTitle()));\n }\n\n /**\n * The \"no results\" message, or `null` when the palette has results.\n *\n * The two are exclusive — the panel renders the message INSTEAD of the buckets —\n * so a non-null answer here and an empty {@link getItemLabels} are the same fact.\n */\n async getEmptyText(): Promise<string | null> {\n await this.requireOpen('getEmptyText');\n const empty = await this.locatorForOptional('.wr-command-palette__empty')();\n return empty ? empty.text() : null;\n }\n\n /** The highlighted command, or `null` when nothing matches the query. */\n async getActiveItem(): Promise<WrCommandPaletteItemHarness | null> {\n const [active] = await this.getItems({ active: true });\n return active ?? null;\n }\n\n /** The highlighted command's label, or `null` when nothing matches the query. */\n async getActiveItemLabel(): Promise<string | null> {\n const active = await this.getActiveItem();\n return active ? active.getLabel() : null;\n }\n\n /**\n * Where the highlight sits in the rendered list, or `-1` when nothing matches\n * the query.\n */\n async getActiveItemIndex(): Promise<number> {\n const items = await this.getItems();\n for (let index = 0; index < items.length; index++) {\n if (await items[index].isActive()) return index;\n }\n return -1;\n }\n\n /**\n * Whether the search box points at the row that is actually highlighted.\n *\n * The rows are not focusable, so this reference is the ONLY thing telling a\n * screen-reader user where they are — and it is a per-instance id, so it is also\n * what would give away a palette announcing another palette's row. An empty list\n * announces nothing, and that counts as agreeing.\n */\n async isActiveItemAnnounced(): Promise<boolean> {\n const announced = await (await this.searchInput('isActiveItemAnnounced')).getAttribute('aria-activedescendant');\n const active = await this.getActiveItem();\n\n if (!active) return announced === null;\n return announced !== null && announced === (await active.getId());\n }\n\n /**\n * Open the palette with its global hotkey.\n *\n * Throws when the chord changes nothing, because every reason it would is worth\n * failing on rather than continuing against a closed palette — see\n * {@link pressTrigger} for the list.\n */\n async open(): Promise<void> {\n if (await this.isOpen()) return;\n await this.pressTrigger();\n }\n\n /**\n * Close the palette with Escape, the way a keyboard user does. A closed palette\n * is left alone.\n */\n async close(): Promise<void> {\n if (!(await this.isOpen())) return;\n\n await (await this.searchInput('close')).sendKeys(TestKey.ESCAPE);\n if (!(await this.isOpen())) return;\n\n throw new Error(\n 'WrCommandPaletteHarness.close(): Escape did not close the palette. The panel handles it whatever ' +\n 'holds focus inside, so check that `open` is not being written back by the binding it came from.'\n );\n }\n\n /** Dismiss the palette by clicking outside the panel, on the backdrop. */\n async clickBackdrop(): Promise<void> {\n await this.requireOpen('clickBackdrop');\n await (await this.locatorFor('.wr-command-palette__backdrop')()).click();\n }\n\n /**\n * Press the palette's global trigger chord, which TOGGLES it.\n *\n * Two things make this the least local method on the harness, and both are the\n * component's design rather than a shortcut here:\n *\n * - The chord is dispatched at the document, because that is where `trigger` is\n * bound. It reaches every palette on the page, not just this one.\n * - `mod` is Cmd on a Mac and Ctrl everywhere else, and nothing in the DOM says\n * which. The binding compares modifier state EXACTLY, so a chord with both set\n * matches neither: Ctrl is tried first, then Cmd, watching whether this palette\n * moved.\n *\n * Throws when neither did anything. With two palettes bound to the same chord\n * that is exactly what happens to the SECOND one — the first binding to match\n * calls `preventDefault()`, which stops the rest — and the first palette will\n * have toggled on the way. Give the palettes different `trigger` specs, or drive\n * them through the bound `open`.\n */\n async pressTrigger(): Promise<void> {\n const before = await this.isOpen();\n\n await this.pressHotkey('k', { control: true });\n if ((await this.isOpen()) !== before) return;\n\n await this.pressHotkey('k', { meta: true });\n if ((await this.isOpen()) !== before) return;\n\n throw new Error(\n 'WrCommandPaletteHarness.pressTrigger(): `mod+k` left this palette ' +\n `${before ? 'open' : 'closed'}. It fails when \\`trigger\\` is \\`null\\` (nothing is bound — write the ` +\n 'bound `open` instead), when `trigger` is some other spec (press it with pressHotkey()), or when ' +\n 'another palette is bound to the same chord and matched it first.'\n );\n }\n\n /**\n * Press an arbitrary chord at the document, where `trigger` is bound — the way\n * to exercise a palette whose `trigger` is not the default `'mod+k'`.\n *\n * The keys go to the `<wr-command-palette>` host and bubble to the document from\n * there. Any element inside the page would do — the listener is the document's,\n * and it fires even while a text field has focus — but the host is the one this\n * harness can always reach, and it takes no focus of its own, so an open palette\n * keeps the caret in its search box.\n */\n async pressHotkey(key: string, modifiers: ModifierKeys = {}): Promise<void> {\n await (await this.host()).sendKeys(modifiers, key);\n }\n\n /** Move the highlight down one row. Wraps from the last row to the first. */\n async moveToNextItem(): Promise<void> {\n await (await this.searchInput('moveToNextItem')).sendKeys(TestKey.DOWN_ARROW);\n }\n\n /** Move the highlight up one row. Wraps from the first row to the last. */\n async moveToPreviousItem(): Promise<void> {\n await (await this.searchInput('moveToPreviousItem')).sendKeys(TestKey.UP_ARROW);\n }\n\n /** Move the highlight to the first row — Home. */\n async moveToFirstItem(): Promise<void> {\n await (await this.searchInput('moveToFirstItem')).sendKeys(TestKey.HOME);\n }\n\n /** Move the highlight to the last row — End. */\n async moveToLastItem(): Promise<void> {\n await (await this.searchInput('moveToLastItem')).sendKeys(TestKey.END);\n }\n\n /**\n * Run the highlighted command — Enter in the search box, the accessible path.\n *\n * Throws when nothing is highlighted, which happens exactly when the query\n * matches nothing: Enter would then be a no-op and the spec would pass having\n * run no command at all. Assert {@link getEmptyText} instead.\n */\n async runActiveItem(): Promise<void> {\n const input = await this.searchInput('runActiveItem');\n\n if (!(await this.getActiveItem())) {\n throw new Error(\n 'WrCommandPaletteHarness.runActiveItem(): nothing is highlighted, so Enter would run nothing — ' +\n `the query \"${await this.getQuery()}\" matches no command. Assert getEmptyText() instead.`\n );\n }\n\n await input.sendKeys(TestKey.ENTER);\n }\n\n /**\n * Run the first command matching the filters, by pointer.\n *\n * The palette must already be open — unlike a select, there is nothing to click\n * to open it, so this cannot do it for you. With `closeOnPick` left at its\n * default the palette closes as the command runs.\n */\n async runItem(filters: WrCommandPaletteItemHarnessFilters): Promise<void> {\n const [item] = await this.getItems(filters);\n if (!item) {\n const offered = await this.getItemLabels();\n throw new Error(\n `WrCommandPaletteHarness.runItem(): no command matched ${JSON.stringify(filters)}. ` +\n `The palette offers: ${offered.length > 0 ? offered.join(', ') : '(nothing — the query matches none)'}.`\n );\n }\n\n await item.click();\n }\n\n /** Put the caret in the search box. The palette does this itself as it opens. */\n async focus(): Promise<void> {\n return (await this.searchInput('focus')).focus();\n }\n\n /**\n * Take focus out of the search box.\n *\n * The palette emits nothing on blur — it exists so a spec can prove\n * {@link focus} puts the caret back where the component put it.\n */\n async blur(): Promise<void> {\n return (await this.searchInput('blur')).blur();\n }\n\n /**\n * Whether the caret is in the search box.\n *\n * The only focus question worth asking of this component: the rows are never\n * focused, so the input is where focus is meant to stay for as long as the\n * palette is open.\n */\n async isSearchInputFocused(): Promise<boolean> {\n return (await this.searchInput('isSearchInputFocused')).isFocused();\n }\n\n /** The palette's dialog wrapper, or `null` while it is closed. */\n private async dialog(): Promise<TestElement | null> {\n // The role, not `.wr-command-palette`: both sit on the same element, but the\n // role is what a screen reader is told, and the element only exists while the\n // palette is open — so \"is there a dialog in this host\" IS the open state.\n return this.locatorForOptional('[role=\"dialog\"]')();\n }\n\n /** The search box, or a failure naming the reason there is none. */\n private async searchInput(method: string): Promise<TestElement> {\n await this.requireOpen(method);\n // Matched on the role rather than on `.wr-command-palette__search input`: the\n // combobox is the accessible contract, and the search row also holds a\n // decorative icon and the `esc` hint.\n return this.locatorFor('input[role=\"combobox\"]')();\n }\n\n /** This palette's listbox. */\n private async listbox(): Promise<TestElement> {\n return this.locatorFor('[role=\"listbox\"]')();\n }\n\n /** Fail with the reason when the panel is not rendered. */\n private async requireOpen(method: string): Promise<void> {\n if (await this.isOpen()) return;\n\n throw new Error(\n `WrCommandPaletteHarness.${method}(): the palette is closed, so nothing it holds exists — the search ` +\n 'box, the list and the rows are all inside an `@if (open())`. Call open() to press the global ' +\n 'trigger, or set the bound `open` when this palette has none.'\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;AAKG;AAMH;;;;;;;;;;;;;;;;;;;AAmBG;AACG,MAAO,2BAA4B,SAAQ,gBAAgB,CAAA;;AAE/D,IAAA,OAAO,YAAY,GAAG,6BAA6B;;AAGnD,IAAA,OAAO,IAAI,CAAC,OAAA,GAA8C,EAAE,EAAA;AAC1D,QAAA,OAAO,IAAI,gBAAgB,CAAC,2BAA2B,EAAE,OAAO;aAC7D,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,IAAI,KAAK,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC;aAC3G,SAAS,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,OAAO,EAAE,MAAM,KAAK,CAAC,MAAM,OAAO,CAAC,QAAQ,EAAE,MAAM,MAAM,CAAC;IAC1G;AAEA;;;;;;;AAOG;AACH,IAAA,MAAM,QAAQ,GAAA;AACZ,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,mCAAmC,CA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