ngwr 11.0.0 → 11.2.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 (237) hide show
  1. package/action-sheet/styles/_index.scss +4 -1
  2. package/anchor/styles/_index.scss +2 -1
  3. package/calendar/styles/_index.scss +11 -2
  4. package/cascader/styles/_index.scss +3 -1
  5. package/circular-text/styles/_index.scss +11 -0
  6. package/command-palette/styles/_index.scss +14 -1
  7. package/context-menu/styles/_index.scss +2 -1
  8. package/falling-text/styles/_index.scss +2 -1
  9. package/fesm2022/ngwr-action-sheet-testing.mjs +313 -0
  10. package/fesm2022/ngwr-action-sheet-testing.mjs.map +1 -0
  11. package/fesm2022/ngwr-bar-chart-testing.mjs +89 -0
  12. package/fesm2022/ngwr-bar-chart-testing.mjs.map +1 -0
  13. package/fesm2022/ngwr-blur-text-testing.mjs +203 -0
  14. package/fesm2022/ngwr-blur-text-testing.mjs.map +1 -0
  15. package/fesm2022/ngwr-blur-text.mjs +15 -1
  16. package/fesm2022/ngwr-blur-text.mjs.map +1 -1
  17. package/fesm2022/ngwr-border-glow-testing.mjs +325 -0
  18. package/fesm2022/ngwr-border-glow-testing.mjs.map +1 -0
  19. package/fesm2022/ngwr-border-glow.mjs +2 -2
  20. package/fesm2022/ngwr-breadcrumbs.mjs +2 -2
  21. package/fesm2022/ngwr-calendar-heatmap-testing.mjs +95 -0
  22. package/fesm2022/ngwr-calendar-heatmap-testing.mjs.map +1 -0
  23. package/fesm2022/ngwr-calendar-testing.mjs +368 -0
  24. package/fesm2022/ngwr-calendar-testing.mjs.map +1 -0
  25. package/fesm2022/ngwr-calendar.mjs +43 -3
  26. package/fesm2022/ngwr-calendar.mjs.map +1 -1
  27. package/fesm2022/ngwr-card.mjs +2 -2
  28. package/fesm2022/ngwr-cascader.mjs +14 -2
  29. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  30. package/fesm2022/ngwr-checkbox.mjs +8 -0
  31. package/fesm2022/ngwr-checkbox.mjs.map +1 -1
  32. package/fesm2022/ngwr-circular-text-testing.mjs +230 -0
  33. package/fesm2022/ngwr-circular-text-testing.mjs.map +1 -0
  34. package/fesm2022/ngwr-circular-text.mjs +2 -2
  35. package/fesm2022/ngwr-circular-text.mjs.map +1 -1
  36. package/fesm2022/ngwr-color-picker-testing.mjs +432 -0
  37. package/fesm2022/ngwr-color-picker-testing.mjs.map +1 -0
  38. package/fesm2022/ngwr-color-picker.mjs +29 -3
  39. package/fesm2022/ngwr-color-picker.mjs.map +1 -1
  40. package/fesm2022/ngwr-context-menu.mjs +25 -5
  41. package/fesm2022/ngwr-context-menu.mjs.map +1 -1
  42. package/fesm2022/ngwr-date-picker-testing.mjs +10 -79
  43. package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
  44. package/fesm2022/ngwr-decrypt-text-testing.mjs +261 -0
  45. package/fesm2022/ngwr-decrypt-text-testing.mjs.map +1 -0
  46. package/fesm2022/ngwr-decrypt-text.mjs +6 -1
  47. package/fesm2022/ngwr-decrypt-text.mjs.map +1 -1
  48. package/fesm2022/ngwr-donut-chart-testing.mjs +93 -0
  49. package/fesm2022/ngwr-donut-chart-testing.mjs.map +1 -0
  50. package/fesm2022/ngwr-drag-drop.mjs +2 -2
  51. package/fesm2022/ngwr-drawer.mjs +36 -7
  52. package/fesm2022/ngwr-drawer.mjs.map +1 -1
  53. package/fesm2022/ngwr-dropdown.mjs +32 -2
  54. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  55. package/fesm2022/ngwr-event-calendar-testing.mjs +446 -0
  56. package/fesm2022/ngwr-event-calendar-testing.mjs.map +1 -0
  57. package/fesm2022/ngwr-event-calendar.mjs +43 -18
  58. package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
  59. package/fesm2022/ngwr-falling-text-testing.mjs +218 -0
  60. package/fesm2022/ngwr-falling-text-testing.mjs.map +1 -0
  61. package/fesm2022/ngwr-falling-text.mjs +2 -2
  62. package/fesm2022/ngwr-falling-text.mjs.map +1 -1
  63. package/fesm2022/ngwr-fuzzy-text-testing.mjs +134 -0
  64. package/fesm2022/ngwr-fuzzy-text-testing.mjs.map +1 -0
  65. package/fesm2022/ngwr-gauge-testing.mjs +86 -0
  66. package/fesm2022/ngwr-gauge-testing.mjs.map +1 -0
  67. package/fesm2022/ngwr-glitch-text-testing.mjs +181 -0
  68. package/fesm2022/ngwr-glitch-text-testing.mjs.map +1 -0
  69. package/fesm2022/ngwr-glitch-text.mjs +2 -2
  70. package/fesm2022/ngwr-gradient-text-testing.mjs +223 -0
  71. package/fesm2022/ngwr-gradient-text-testing.mjs.map +1 -0
  72. package/fesm2022/ngwr-gradient-text.mjs +2 -2
  73. package/fesm2022/ngwr-i18n-en.mjs +14 -0
  74. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  75. package/fesm2022/ngwr-i18n-ru.mjs +14 -0
  76. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  77. package/fesm2022/ngwr-image-cropper-testing.mjs +156 -0
  78. package/fesm2022/ngwr-image-cropper-testing.mjs.map +1 -0
  79. package/fesm2022/ngwr-image-cropper.mjs +10 -3
  80. package/fesm2022/ngwr-image-cropper.mjs.map +1 -1
  81. package/fesm2022/ngwr-input-number.mjs +73 -6
  82. package/fesm2022/ngwr-input-number.mjs.map +1 -1
  83. package/fesm2022/ngwr-knob-testing.mjs +220 -0
  84. package/fesm2022/ngwr-knob-testing.mjs.map +1 -0
  85. package/fesm2022/ngwr-lightbox-testing.mjs +223 -0
  86. package/fesm2022/ngwr-lightbox-testing.mjs.map +1 -0
  87. package/fesm2022/ngwr-lightbox.mjs +9 -2
  88. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  89. package/fesm2022/ngwr-line-chart-testing.mjs +119 -0
  90. package/fesm2022/ngwr-line-chart-testing.mjs.map +1 -0
  91. package/fesm2022/ngwr-list.mjs +2 -2
  92. package/fesm2022/ngwr-loading-bar.mjs +2 -2
  93. package/fesm2022/ngwr-marquee-testing.mjs +336 -0
  94. package/fesm2022/ngwr-marquee-testing.mjs.map +1 -0
  95. package/fesm2022/ngwr-marquee.mjs +2 -2
  96. package/fesm2022/ngwr-meter-group-testing.mjs +80 -0
  97. package/fesm2022/ngwr-meter-group-testing.mjs.map +1 -0
  98. package/fesm2022/ngwr-overlay.mjs +28 -1
  99. package/fesm2022/ngwr-overlay.mjs.map +1 -1
  100. package/fesm2022/ngwr-popover.mjs +14 -0
  101. package/fesm2022/ngwr-popover.mjs.map +1 -1
  102. package/fesm2022/ngwr-rotating-text-testing.mjs +220 -0
  103. package/fesm2022/ngwr-rotating-text-testing.mjs.map +1 -0
  104. package/fesm2022/ngwr-rotating-text.mjs +2 -2
  105. package/fesm2022/ngwr-rotating-text.mjs.map +1 -1
  106. package/fesm2022/ngwr-select.mjs +70 -11
  107. package/fesm2022/ngwr-select.mjs.map +1 -1
  108. package/fesm2022/ngwr-shiny-text-testing.mjs +237 -0
  109. package/fesm2022/ngwr-shiny-text-testing.mjs.map +1 -0
  110. package/fesm2022/ngwr-shiny-text.mjs +2 -2
  111. package/fesm2022/ngwr-slider.mjs +44 -6
  112. package/fesm2022/ngwr-slider.mjs.map +1 -1
  113. package/fesm2022/ngwr-sparkline-testing.mjs +76 -0
  114. package/fesm2022/ngwr-sparkline-testing.mjs.map +1 -0
  115. package/fesm2022/ngwr-speed-dial-testing.mjs +279 -0
  116. package/fesm2022/ngwr-speed-dial-testing.mjs.map +1 -0
  117. package/fesm2022/ngwr-splash-cursor-testing.mjs +89 -0
  118. package/fesm2022/ngwr-splash-cursor-testing.mjs.map +1 -0
  119. package/fesm2022/ngwr-split-text-testing.mjs +224 -0
  120. package/fesm2022/ngwr-split-text-testing.mjs.map +1 -0
  121. package/fesm2022/ngwr-split-text.mjs +15 -1
  122. package/fesm2022/ngwr-split-text.mjs.map +1 -1
  123. package/fesm2022/ngwr-splitter-testing.mjs +245 -0
  124. package/fesm2022/ngwr-splitter-testing.mjs.map +1 -0
  125. package/fesm2022/ngwr-spotlight-card-testing.mjs +368 -0
  126. package/fesm2022/ngwr-spotlight-card-testing.mjs.map +1 -0
  127. package/fesm2022/ngwr-spotlight-card.mjs +2 -2
  128. package/fesm2022/ngwr-star-border-testing.mjs +172 -0
  129. package/fesm2022/ngwr-star-border-testing.mjs.map +1 -0
  130. package/fesm2022/ngwr-star-border.mjs +2 -2
  131. package/fesm2022/ngwr-table.mjs +13 -3
  132. package/fesm2022/ngwr-table.mjs.map +1 -1
  133. package/fesm2022/ngwr-tabs.mjs +15 -1
  134. package/fesm2022/ngwr-tabs.mjs.map +1 -1
  135. package/fesm2022/ngwr-tilt-card-testing.mjs +190 -0
  136. package/fesm2022/ngwr-tilt-card-testing.mjs.map +1 -0
  137. package/fesm2022/ngwr-tilt-card.mjs +21 -3
  138. package/fesm2022/ngwr-tilt-card.mjs.map +1 -1
  139. package/fesm2022/ngwr-toast.mjs +36 -7
  140. package/fesm2022/ngwr-toast.mjs.map +1 -1
  141. package/fesm2022/ngwr-tour-testing.mjs +173 -0
  142. package/fesm2022/ngwr-tour-testing.mjs.map +1 -0
  143. package/fesm2022/ngwr-tour.mjs +2 -2
  144. package/fesm2022/ngwr-tour.mjs.map +1 -1
  145. package/fesm2022/ngwr-tree.mjs +10 -3
  146. package/fesm2022/ngwr-tree.mjs.map +1 -1
  147. package/fesm2022/ngwr-typewriter-testing.mjs +228 -0
  148. package/fesm2022/ngwr-typewriter-testing.mjs.map +1 -0
  149. package/fesm2022/ngwr-typewriter.mjs +2 -2
  150. package/fesm2022/ngwr-version.mjs +1 -1
  151. package/fesm2022/ngwr-version.mjs.map +1 -1
  152. package/fesm2022/ngwr-virtual-scroll.mjs +2 -2
  153. package/fesm2022/ngwr-waves-testing.mjs +128 -0
  154. package/fesm2022/ngwr-waves-testing.mjs.map +1 -0
  155. package/fesm2022/ngwr-waves.mjs +2 -2
  156. package/fesm2022/ngwr-window-testing.mjs +361 -0
  157. package/fesm2022/ngwr-window-testing.mjs.map +1 -0
  158. package/fesm2022/ngwr-window.mjs +84 -10
  159. package/fesm2022/ngwr-window.mjs.map +1 -1
  160. package/file-upload/styles/_index.scss +7 -2
  161. package/i18n/en.json +16 -2
  162. package/i18n/ru.json +16 -2
  163. package/llms-full.txt +147 -0
  164. package/llms.txt +27 -8
  165. package/mcp/providers.js +29 -0
  166. package/mcp/tools.js +1 -29
  167. package/package.json +145 -1
  168. package/result/styles/_index.scss +3 -1
  169. package/segmented/styles/_index.scss +5 -1
  170. package/select/styles/_index.scss +3 -1
  171. package/skills/ngwr/SKILL.md +115 -0
  172. package/skills/ngwr/references/catalog.md +212 -0
  173. package/skills/ngwr/references/setup.md +73 -0
  174. package/stepper/styles/_index.scss +18 -2
  175. package/table/styles/_index.scss +3 -1
  176. package/theme/styles/_colors.scss +15 -2
  177. package/theme/styles/_dark.scss +24 -12
  178. package/tree/styles/_index.scss +4 -2
  179. package/types/ngwr-action-sheet-testing.d.ts +260 -0
  180. package/types/ngwr-bar-chart-testing.d.ts +77 -0
  181. package/types/ngwr-blur-text-testing.d.ts +180 -0
  182. package/types/ngwr-blur-text.d.ts +12 -0
  183. package/types/ngwr-border-glow-testing.d.ts +219 -0
  184. package/types/ngwr-calendar-heatmap-testing.d.ts +79 -0
  185. package/types/ngwr-calendar-testing.d.ts +277 -0
  186. package/types/ngwr-calendar.d.ts +10 -0
  187. package/types/ngwr-checkbox.d.ts +13 -0
  188. package/types/ngwr-circular-text-testing.d.ts +196 -0
  189. package/types/ngwr-color-picker-testing.d.ts +291 -0
  190. package/types/ngwr-color-picker.d.ts +13 -1
  191. package/types/ngwr-context-menu.d.ts +15 -1
  192. package/types/ngwr-date-picker-testing.d.ts +6 -66
  193. package/types/ngwr-decrypt-text-testing.d.ts +222 -0
  194. package/types/ngwr-donut-chart-testing.d.ts +79 -0
  195. package/types/ngwr-drawer.d.ts +12 -0
  196. package/types/ngwr-dropdown.d.ts +9 -0
  197. package/types/ngwr-event-calendar-testing.d.ts +301 -0
  198. package/types/ngwr-event-calendar.d.ts +9 -6
  199. package/types/ngwr-falling-text-testing.d.ts +186 -0
  200. package/types/ngwr-fuzzy-text-testing.d.ts +130 -0
  201. package/types/ngwr-gauge-testing.d.ts +71 -0
  202. package/types/ngwr-glitch-text-testing.d.ts +172 -0
  203. package/types/ngwr-gradient-text-testing.d.ts +173 -0
  204. package/types/ngwr-image-cropper-testing.d.ts +134 -0
  205. package/types/ngwr-image-cropper.d.ts +1 -0
  206. package/types/ngwr-input-number.d.ts +33 -1
  207. package/types/ngwr-knob-testing.d.ts +150 -0
  208. package/types/ngwr-lightbox-testing.d.ts +154 -0
  209. package/types/ngwr-lightbox.d.ts +6 -0
  210. package/types/ngwr-line-chart-testing.d.ts +93 -0
  211. package/types/ngwr-marquee-testing.d.ts +280 -0
  212. package/types/ngwr-meter-group-testing.d.ts +67 -0
  213. package/types/ngwr-overlay.d.ts +19 -1
  214. package/types/ngwr-rotating-text-testing.d.ts +191 -0
  215. package/types/ngwr-select.d.ts +32 -0
  216. package/types/ngwr-shiny-text-testing.d.ts +165 -0
  217. package/types/ngwr-slider.d.ts +15 -0
  218. package/types/ngwr-sparkline-testing.d.ts +69 -0
  219. package/types/ngwr-speed-dial-testing.d.ts +195 -0
  220. package/types/ngwr-splash-cursor-testing.d.ts +95 -0
  221. package/types/ngwr-split-text-testing.d.ts +209 -0
  222. package/types/ngwr-split-text.d.ts +12 -0
  223. package/types/ngwr-splitter-testing.d.ts +174 -0
  224. package/types/ngwr-spotlight-card-testing.d.ts +303 -0
  225. package/types/ngwr-star-border-testing.d.ts +135 -0
  226. package/types/ngwr-table.d.ts +10 -1
  227. package/types/ngwr-tilt-card-testing.d.ts +158 -0
  228. package/types/ngwr-tilt-card.d.ts +2 -0
  229. package/types/ngwr-toast.d.ts +14 -5
  230. package/types/ngwr-tour-testing.d.ts +143 -0
  231. package/types/ngwr-tree.d.ts +7 -0
  232. package/types/ngwr-typewriter-testing.d.ts +201 -0
  233. package/types/ngwr-version.d.ts +1 -1
  234. package/types/ngwr-waves-testing.d.ts +121 -0
  235. package/types/ngwr-window-testing.d.ts +263 -0
  236. package/types/ngwr-window.d.ts +27 -10
  237. package/window/styles/_index.scss +44 -16
@@ -0,0 +1,220 @@
1
+ import { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';
2
+
3
+ /**
4
+ * @license
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
8
+ */
9
+ /** One animated piece — a grapheme, a word or a line, depending on `splitBy`. */
10
+ const CHAR = '.wr-rotating-text__char';
11
+ /** The whole animated layer, and the one element taken out of the a11y tree. */
12
+ const INNER = '.wr-rotating-text__inner';
13
+ /** The readable copy of the string showing now, carried once outside the animated layer. */
14
+ const SR_ONLY = '.wr-rotating-text__sr-only';
15
+ /** A word group — kept whether the word is drawn whole or exploded into characters. */
16
+ const WORD = '.wr-rotating-text__word';
17
+ /**
18
+ * An inline `opacity: 1` — the end state the enter step commits on every piece.
19
+ *
20
+ * Matched off the `style` ATTRIBUTE, never through `getCssValue`: a computed style would
21
+ * answer `1` for a piece nobody ever wrote to, which is the exact case worth telling
22
+ * apart from a piece the component finished with.
23
+ */
24
+ const SETTLED_OPACITY = /(?:^|;)\s*opacity\s*:\s*1\s*(?:;|$)/;
25
+ /** Exactly what the element holds — untrimmed, unlike `TestElement.text()`. */
26
+ async function rawText(element) {
27
+ return (await element.getProperty('textContent')) ?? '';
28
+ }
29
+ /**
30
+ * Test harness for `<wr-rotating-text>`.
31
+ *
32
+ * **What is announced and what is drawn are two questions, and this component is worth a
33
+ * harness mostly because it answers them separately.** The string showing now is carried
34
+ * verbatim in a visually-hidden span; the animated layer beside it is one span per
35
+ * grapheme, word or line and is `aria-hidden` as a whole, so a screen reader hears `one`
36
+ * rather than `o. n. e.` {@link getAccessibleText} is the first, {@link getRenderedText}
37
+ * and {@link getPieces} the second, and {@link isAnimatedLayerHidden} together with
38
+ * {@link hasAccessibleCopy} is the pairing that regresses silently when someone
39
+ * restructures the template — pieces hidden AND no readable copy is an element with no
40
+ * accessible text at all, which reads as a pass on either check alone.
41
+ *
42
+ * **The sr-only span is deliberately not a live region, and no method here implies
43
+ * otherwise.** `auto` advances every two seconds by default, and the APG's answer for
44
+ * self-advancing content is silence, not an announcement on a timer. What the harness
45
+ * pins is that the announced copy TRACKS the current word — nothing about it being
46
+ * spoken.
47
+ *
48
+ * **There is no `getIndex()`, and no `next()` / `previous()` / `jumpTo()` / `reset()`.**
49
+ * The index appears nowhere in the DOM — no attribute, no data hook — so deriving it
50
+ * would mean matching the shown string against a list the harness was never given, and
51
+ * guessing between duplicates. And the component renders no controls at all: rotation is
52
+ * a timer or a method call on the instance, so a harness "click" would have nothing to
53
+ * click and reaching into the component would make this a wrapper around the class rather
54
+ * than a reader of the DOM. Drive it from the spec — through the instance, or by
55
+ * advancing the interval — and assert the `nextChange` output for the index.
56
+ *
57
+ * **Nothing here reports the tween.** `duration`, `easing`, `staggerDuration` and
58
+ * `staggerFrom` are passed straight into Web Animation options and never written to the
59
+ * document; `delayFor()` is arithmetic with no rendered trace. So no `getDuration()`, no
60
+ * `getStagger()`, no `isAnimating()`. The pieces do carry inline `opacity` and
61
+ * `transform`, but on the animated path those are the FIRST keyframe — `opacity: 0` on
62
+ * text the user can see perfectly well — which is why the only reading offered is
63
+ * {@link isSettled}, and why it is spelled as a commitment rather than as a state of
64
+ * motion. The host's `overflow: hidden` clipping is layout, and every rect in a unit test
65
+ * is 0×0, so there is no `isClipped()` either.
66
+ *
67
+ * jsdom implements no Web Animations API, so the animated path throws on the first
68
+ * `el.animate` — before any assertion runs. Every spec supplies one half or the other:
69
+ *
70
+ * ```ts
71
+ * // Either: mount under reduced motion, where each swap is instant and nothing tweens.
72
+ * // (jsdom has no matchMedia, so WrPlatform must be provided as a value.)
73
+ * TestBed.configureTestingModule({ providers: [{ provide: WrPlatform, useValue: reducedMotion }] });
74
+ *
75
+ * // Or: stub the API — and remember a stub that never fires `onfinish` never resolves
76
+ * // the exit step, so the rotator stops after one swap.
77
+ * Reflect.set(Element.prototype, 'animate', () => ({ cancel: () => undefined, onfinish: null }));
78
+ * ```
79
+ *
80
+ * @example
81
+ * ```ts
82
+ * const rotator = await loader.getHarness(WrRotatingTextHarness);
83
+ *
84
+ * expect(await rotator.getAccessibleText()).toBe('design');
85
+ * expect(await rotator.getPieces()).toEqual(['d', 'e', 's', 'i', 'g', 'n']);
86
+ * expect(await rotator.isAnimatedLayerHidden()).toBe(true);
87
+ * ```
88
+ *
89
+ * @see https://ngwr.dev/guides/testing
90
+ */
91
+ class WrRotatingTextHarness extends ComponentHarness {
92
+ static hostSelector = 'wr-rotating-text';
93
+ /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */
94
+ static with(options = {}) {
95
+ return new HarnessPredicate(WrRotatingTextHarness, options)
96
+ .addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getAccessibleText(), text))
97
+ .addOption('wordCount', options.wordCount, async (harness, count) => (await harness.getWordCount()) === count);
98
+ }
99
+ chars = this.locatorForAll(CHAR);
100
+ /**
101
+ * The string showing right now, as the one readable copy holds it.
102
+ *
103
+ * Literally what a screen reader gets, the animated layer being out of the tree — and
104
+ * the thing to assert a rotation against, since it is where `next()`, `previous()`, a
105
+ * clamped `jumpTo()`, `reset()`, the wrap at either end, the stop when `loop` is off and
106
+ * the shrinking-list clamp all become visible.
107
+ *
108
+ * Throws when the copy is missing rather than answering with the pieces' text: an empty
109
+ * string is what a rotator holding an empty list correctly reports, so a plausible
110
+ * nothing here is indistinguishable from the component having lost its accessible name
111
+ * entirely. Ask {@link hasAccessibleCopy} when presence is the question.
112
+ */
113
+ async getAccessibleText() {
114
+ const copy = await this.locatorForOptional(SR_ONLY)();
115
+ if (!copy) {
116
+ throw new Error('WrRotatingTextHarness.getAccessibleText(): this <wr-rotating-text> renders no ' +
117
+ `${SR_ONLY} span, so it has no accessible text at all — every piece it draws is aria-hidden. ` +
118
+ 'Reading the pieces instead would report a healthy-looking string for a component a screen ' +
119
+ 'reader cannot see.');
120
+ }
121
+ return rawText(copy);
122
+ }
123
+ /**
124
+ * Everything the animated layer draws, in document order, as one string.
125
+ *
126
+ * A different fact from {@link getAccessibleText}, and the comparison between them is
127
+ * the point: a split that drops its spacer renders `hellothere` while the readable copy
128
+ * stays perfect, and nothing else in the DOM says so.
129
+ *
130
+ * The spacer between words is a non-breaking space (`&nbsp;`), which is a rendering
131
+ * choice rather than a contract, so it is normalized to a plain space here — otherwise
132
+ * every round-trip assertion would have to spell U+00A0 out to pass against a working
133
+ * component. Note that `splitBy="lines"` genuinely does not round-trip: the newline the
134
+ * readable copy carries is drawn as that same spacer.
135
+ */
136
+ async getRenderedText() {
137
+ return (await rawText(await this.locatorFor(INNER)())).replace(/\u00a0/g, ' ');
138
+ }
139
+ /**
140
+ * The animated pieces, in document order.
141
+ *
142
+ * The granularity actually applied: one piece per grapheme for `splitBy="characters"`,
143
+ * one per word for `"words"`, one per line for `"lines"`. It is also where the grapheme
144
+ * contract shows — `a🚀b` must come back as three pieces, not four with two broken
145
+ * halves of a surrogate pair.
146
+ */
147
+ async getPieces() {
148
+ return Promise.all((await this.chars()).map(rawText));
149
+ }
150
+ /**
151
+ * How many word groups the split produced.
152
+ *
153
+ * Word boundaries survive every granularity: three words stay three groups even when
154
+ * each is exploded into characters, which is what keeps the line wrapping sane. A
155
+ * splitter that flattened the grouping would leave {@link getPieces} correct and break
156
+ * only this.
157
+ */
158
+ async getWordCount() {
159
+ return (await this.locatorForAll(WORD)()).length;
160
+ }
161
+ /**
162
+ * Whether the animated layer is out of the accessibility tree.
163
+ *
164
+ * ONE attribute answers it — `aria-hidden` sits on the `__inner` wrapper, so the pieces
165
+ * inherit it and none carries it itself, which keeps the attribute off the nodes the
166
+ * tween writes to. Asserting it per piece would fail on a component that is behaving.
167
+ *
168
+ * If it regresses, every rotation is spelled out letter by letter beside the copy that
169
+ * was already read, and nothing changes on screen — so no other check catches it.
170
+ */
171
+ async isAnimatedLayerHidden() {
172
+ return (await (await this.locatorFor(INNER)()).getAttribute('aria-hidden')) === 'true';
173
+ }
174
+ /**
175
+ * Whether the readable copy is rendered at all.
176
+ *
177
+ * The other half of {@link isAnimatedLayerHidden}, and it exists as a separate question
178
+ * because the failure the two catch together is invisible to each alone: a layer
179
+ * correctly hidden with no readable copy beside it is a control with no accessible text
180
+ * whatsoever, and `isAnimatedLayerHidden() === true` is exactly what it reports.
181
+ */
182
+ async hasAccessibleCopy() {
183
+ return (await this.locatorForOptional(SR_ONLY)()) !== null;
184
+ }
185
+ /**
186
+ * Whether the enter step committed its end state on every piece — NOT whether an
187
+ * animation finished.
188
+ *
189
+ * The component writes `opacity: 1` inline on each piece when the swap settles: instantly
190
+ * under reduced motion, and from the tween's `onfinish` otherwise. So this answers "the
191
+ * new word was actually taken over", which is the bug the deferred enter exists to
192
+ * prevent — a swap that animates the OLD spans leaves the new ones staged at `opacity: 0`
193
+ * and the text invisible, while the readable copy reports the new word correctly.
194
+ *
195
+ * It is all-or-nothing: one piece left staged is one invisible glyph in the middle of a
196
+ * word. On the animated path it stays `false` until each tween finishes, which in a unit
197
+ * test means forever, since a stubbed `Element.animate` never fires anything — that is
198
+ * an honest answer about a swap that never landed, not a limitation to work around.
199
+ *
200
+ * Throws when there are no pieces: "every piece is settled" is true of none of them,
201
+ * and that is also what a component that stopped rendering its text would report.
202
+ */
203
+ async isSettled() {
204
+ const pieces = await this.chars();
205
+ if (pieces.length === 0) {
206
+ throw new Error('WrRotatingTextHarness.isSettled(): this <wr-rotating-text> drew no pieces, so "settled" would be ' +
207
+ 'vacuously true — the same answer a rotator that stopped rendering its text would give. Check ' +
208
+ '`texts` is not empty, or ask getPieces().');
209
+ }
210
+ const styles = await Promise.all(pieces.map(piece => piece.getAttribute('style')));
211
+ return styles.every(style => SETTLED_OPACITY.test(style ?? ''));
212
+ }
213
+ }
214
+
215
+ /**
216
+ * Generated bundle index. Do not edit.
217
+ */
218
+
219
+ export { WrRotatingTextHarness };
220
+ //# sourceMappingURL=ngwr-rotating-text-testing.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngwr-rotating-text-testing.mjs","sources":["../../../projects/lib/rotating-text/testing/wr-rotating-text-harness.ts","../../../projects/lib/rotating-text/testing/ngwr-rotating-text-testing.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate, type TestElement } from '@angular/cdk/testing';\n\nimport type { WrRotatingTextHarnessFilters } from './interfaces';\n\n/** One animated piece — a grapheme, a word or a line, depending on `splitBy`. */\nconst CHAR = '.wr-rotating-text__char';\n\n/** The whole animated layer, and the one element taken out of the a11y tree. */\nconst INNER = '.wr-rotating-text__inner';\n\n/** The readable copy of the string showing now, carried once outside the animated layer. */\nconst SR_ONLY = '.wr-rotating-text__sr-only';\n\n/** A word group — kept whether the word is drawn whole or exploded into characters. */\nconst WORD = '.wr-rotating-text__word';\n\n/**\n * An inline `opacity: 1` — the end state the enter step commits on every piece.\n *\n * Matched off the `style` ATTRIBUTE, never through `getCssValue`: a computed style would\n * answer `1` for a piece nobody ever wrote to, which is the exact case worth telling\n * apart from a piece the component finished with.\n */\nconst SETTLED_OPACITY = /(?:^|;)\\s*opacity\\s*:\\s*1\\s*(?:;|$)/;\n\n/** Exactly what the element holds — untrimmed, unlike `TestElement.text()`. */\nasync function rawText(element: TestElement): Promise<string> {\n return (await element.getProperty<string | null>('textContent')) ?? '';\n}\n\n/**\n * Test harness for `<wr-rotating-text>`.\n *\n * **What is announced and what is drawn are two questions, and this component is worth a\n * harness mostly because it answers them separately.** The string showing now is carried\n * verbatim in a visually-hidden span; the animated layer beside it is one span per\n * grapheme, word or line and is `aria-hidden` as a whole, so a screen reader hears `one`\n * rather than `o. n. e.` {@link getAccessibleText} is the first, {@link getRenderedText}\n * and {@link getPieces} the second, and {@link isAnimatedLayerHidden} together with\n * {@link hasAccessibleCopy} is the pairing that regresses silently when someone\n * restructures the template — pieces hidden AND no readable copy is an element with no\n * accessible text at all, which reads as a pass on either check alone.\n *\n * **The sr-only span is deliberately not a live region, and no method here implies\n * otherwise.** `auto` advances every two seconds by default, and the APG's answer for\n * self-advancing content is silence, not an announcement on a timer. What the harness\n * pins is that the announced copy TRACKS the current word — nothing about it being\n * spoken.\n *\n * **There is no `getIndex()`, and no `next()` / `previous()` / `jumpTo()` / `reset()`.**\n * The index appears nowhere in the DOM — no attribute, no data hook — so deriving it\n * would mean matching the shown string against a list the harness was never given, and\n * guessing between duplicates. And the component renders no controls at all: rotation is\n * a timer or a method call on the instance, so a harness \"click\" would have nothing to\n * click and reaching into the component would make this a wrapper around the class rather\n * than a reader of the DOM. Drive it from the spec — through the instance, or by\n * advancing the interval — and assert the `nextChange` output for the index.\n *\n * **Nothing here reports the tween.** `duration`, `easing`, `staggerDuration` and\n * `staggerFrom` are passed straight into Web Animation options and never written to the\n * document; `delayFor()` is arithmetic with no rendered trace. So no `getDuration()`, no\n * `getStagger()`, no `isAnimating()`. The pieces do carry inline `opacity` and\n * `transform`, but on the animated path those are the FIRST keyframe — `opacity: 0` on\n * text the user can see perfectly well — which is why the only reading offered is\n * {@link isSettled}, and why it is spelled as a commitment rather than as a state of\n * motion. The host's `overflow: hidden` clipping is layout, and every rect in a unit test\n * is 0×0, so there is no `isClipped()` either.\n *\n * jsdom implements no Web Animations API, so the animated path throws on the first\n * `el.animate` — before any assertion runs. Every spec supplies one half or the other:\n *\n * ```ts\n * // Either: mount under reduced motion, where each swap is instant and nothing tweens.\n * // (jsdom has no matchMedia, so WrPlatform must be provided as a value.)\n * TestBed.configureTestingModule({ providers: [{ provide: WrPlatform, useValue: reducedMotion }] });\n *\n * // Or: stub the API — and remember a stub that never fires `onfinish` never resolves\n * // the exit step, so the rotator stops after one swap.\n * Reflect.set(Element.prototype, 'animate', () => ({ cancel: () => undefined, onfinish: null }));\n * ```\n *\n * @example\n * ```ts\n * const rotator = await loader.getHarness(WrRotatingTextHarness);\n *\n * expect(await rotator.getAccessibleText()).toBe('design');\n * expect(await rotator.getPieces()).toEqual(['d', 'e', 's', 'i', 'g', 'n']);\n * expect(await rotator.isAnimatedLayerHidden()).toBe(true);\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrRotatingTextHarness extends ComponentHarness {\n static hostSelector = 'wr-rotating-text';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrRotatingTextHarnessFilters = {}): HarnessPredicate<WrRotatingTextHarness> {\n return new HarnessPredicate(WrRotatingTextHarness, options)\n .addOption('text', options.text, (harness, text) =>\n HarnessPredicate.stringMatches(harness.getAccessibleText(), text)\n )\n .addOption('wordCount', options.wordCount, async (harness, count) => (await harness.getWordCount()) === count);\n }\n\n private readonly chars = this.locatorForAll(CHAR);\n\n /**\n * The string showing right now, as the one readable copy holds it.\n *\n * Literally what a screen reader gets, the animated layer being out of the tree — and\n * the thing to assert a rotation against, since it is where `next()`, `previous()`, a\n * clamped `jumpTo()`, `reset()`, the wrap at either end, the stop when `loop` is off and\n * the shrinking-list clamp all become visible.\n *\n * Throws when the copy is missing rather than answering with the pieces' text: an empty\n * string is what a rotator holding an empty list correctly reports, so a plausible\n * nothing here is indistinguishable from the component having lost its accessible name\n * entirely. Ask {@link hasAccessibleCopy} when presence is the question.\n */\n async getAccessibleText(): Promise<string> {\n const copy = await this.locatorForOptional(SR_ONLY)();\n\n if (!copy) {\n throw new Error(\n 'WrRotatingTextHarness.getAccessibleText(): this <wr-rotating-text> renders no ' +\n `${SR_ONLY} span, so it has no accessible text at all — every piece it draws is aria-hidden. ` +\n 'Reading the pieces instead would report a healthy-looking string for a component a screen ' +\n 'reader cannot see.'\n );\n }\n\n return rawText(copy);\n }\n\n /**\n * Everything the animated layer draws, in document order, as one string.\n *\n * A different fact from {@link getAccessibleText}, and the comparison between them is\n * the point: a split that drops its spacer renders `hellothere` while the readable copy\n * stays perfect, and nothing else in the DOM says so.\n *\n * The spacer between words is a non-breaking space (`&nbsp;`), which is a rendering\n * choice rather than a contract, so it is normalized to a plain space here — otherwise\n * every round-trip assertion would have to spell U+00A0 out to pass against a working\n * component. Note that `splitBy=\"lines\"` genuinely does not round-trip: the newline the\n * readable copy carries is drawn as that same spacer.\n */\n async getRenderedText(): Promise<string> {\n return (await rawText(await this.locatorFor(INNER)())).replace(/\\u00a0/g, ' ');\n }\n\n /**\n * The animated pieces, in document order.\n *\n * The granularity actually applied: one piece per grapheme for `splitBy=\"characters\"`,\n * one per word for `\"words\"`, one per line for `\"lines\"`. It is also where the grapheme\n * contract shows — `a🚀b` must come back as three pieces, not four with two broken\n * halves of a surrogate pair.\n */\n async getPieces(): Promise<string[]> {\n return Promise.all((await this.chars()).map(rawText));\n }\n\n /**\n * How many word groups the split produced.\n *\n * Word boundaries survive every granularity: three words stay three groups even when\n * each is exploded into characters, which is what keeps the line wrapping sane. A\n * splitter that flattened the grouping would leave {@link getPieces} correct and break\n * only this.\n */\n async getWordCount(): Promise<number> {\n return (await this.locatorForAll(WORD)()).length;\n }\n\n /**\n * Whether the animated layer is out of the accessibility tree.\n *\n * ONE attribute answers it — `aria-hidden` sits on the `__inner` wrapper, so the pieces\n * inherit it and none carries it itself, which keeps the attribute off the nodes the\n * tween writes to. Asserting it per piece would fail on a component that is behaving.\n *\n * If it regresses, every rotation is spelled out letter by letter beside the copy that\n * was already read, and nothing changes on screen — so no other check catches it.\n */\n async isAnimatedLayerHidden(): Promise<boolean> {\n return (await (await this.locatorFor(INNER)()).getAttribute('aria-hidden')) === 'true';\n }\n\n /**\n * Whether the readable copy is rendered at all.\n *\n * The other half of {@link isAnimatedLayerHidden}, and it exists as a separate question\n * because the failure the two catch together is invisible to each alone: a layer\n * correctly hidden with no readable copy beside it is a control with no accessible text\n * whatsoever, and `isAnimatedLayerHidden() === true` is exactly what it reports.\n */\n async hasAccessibleCopy(): Promise<boolean> {\n return (await this.locatorForOptional(SR_ONLY)()) !== null;\n }\n\n /**\n * Whether the enter step committed its end state on every piece — NOT whether an\n * animation finished.\n *\n * The component writes `opacity: 1` inline on each piece when the swap settles: instantly\n * under reduced motion, and from the tween's `onfinish` otherwise. So this answers \"the\n * new word was actually taken over\", which is the bug the deferred enter exists to\n * prevent — a swap that animates the OLD spans leaves the new ones staged at `opacity: 0`\n * and the text invisible, while the readable copy reports the new word correctly.\n *\n * It is all-or-nothing: one piece left staged is one invisible glyph in the middle of a\n * word. On the animated path it stays `false` until each tween finishes, which in a unit\n * test means forever, since a stubbed `Element.animate` never fires anything — that is\n * an honest answer about a swap that never landed, not a limitation to work around.\n *\n * Throws when there are no pieces: \"every piece is settled\" is true of none of them,\n * and that is also what a component that stopped rendering its text would report.\n */\n async isSettled(): Promise<boolean> {\n const pieces = await this.chars();\n\n if (pieces.length === 0) {\n throw new Error(\n 'WrRotatingTextHarness.isSettled(): this <wr-rotating-text> drew no pieces, so \"settled\" would be ' +\n 'vacuously true — the same answer a rotator that stopped rendering its text would give. Check ' +\n '`texts` is not empty, or ask getPieces().'\n );\n }\n\n const styles = await Promise.all(pieces.map(piece => piece.getAttribute('style')));\n return styles.every(style => SETTLED_OPACITY.test(style ?? ''));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;AAKG;AAMH;AACA,MAAM,IAAI,GAAG,yBAAyB;AAEtC;AACA,MAAM,KAAK,GAAG,0BAA0B;AAExC;AACA,MAAM,OAAO,GAAG,4BAA4B;AAE5C;AACA,MAAM,IAAI,GAAG,yBAAyB;AAEtC;;;;;;AAMG;AACH,MAAM,eAAe,GAAG,qCAAqC;AAE7D;AACA,eAAe,OAAO,CAAC,OAAoB,EAAA;IACzC,OAAO,CAAC,MAAM,OAAO,CAAC,WAAW,CAAgB,aAAa,CAAC,KAAK,EAAE;AACxE;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6DG;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GAAG,CAAC,OAAO,CAAC,CAAC;IACvD;AAEA;;;;;;;AAOG;AACH,IAAA,MAAM,YAAY,GAAA;AAChB,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM;IAClD;AAEA;;;;;;;;;AASG;AACH,IAAA,MAAM,qBAAqB,GAAA;QACzB,OAAO,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,EAAE,YAAY,CAAC,aAAa,CAAC,MAAM,MAAM;IACxF;AAEA;;;;;;;AAOG;AACH,IAAA,MAAM,iBAAiB,GAAA;AACrB,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI;IAC5D;AAEA;;;;;;;;;;;;;;;;;AAiBG;AACH,IAAA,MAAM,SAAS,GAAA;AACb,QAAA,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,EAAE;AAEjC,QAAA,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;YACvB,MAAM,IAAI,KAAK,CACb,mGAAmG;gBACjG,+FAA+F;AAC/F,gBAAA,2CAA2C,CAC9C;QACH;QAEA,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,IAAI,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;AAClF,QAAA,OAAO,MAAM,CAAC,KAAK,CAAC,KAAK,IAAI,eAAe,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;IACjE;;;AC/OF;;AAEG;;;;"}
@@ -263,11 +263,11 @@ class WrRotatingText {
263
263
  }
264
264
  }
265
265
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: WrRotatingText, deps: [], target: i0.ɵɵFactoryTarget.Component });
266
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: WrRotatingText, isStandalone: true, selector: "wr-rotating-text", inputs: { texts: { classPropertyName: "texts", publicName: "texts", isSignal: true, isRequired: true, transformFunction: null }, rotationInterval: { classPropertyName: "rotationInterval", publicName: "rotationInterval", isSignal: true, isRequired: false, transformFunction: null }, splitBy: { classPropertyName: "splitBy", publicName: "splitBy", isSignal: true, isRequired: false, transformFunction: null }, auto: { classPropertyName: "auto", publicName: "auto", isSignal: true, isRequired: false, transformFunction: null }, loop: { classPropertyName: "loop", publicName: "loop", isSignal: true, isRequired: false, transformFunction: null }, duration: { classPropertyName: "duration", publicName: "duration", isSignal: true, isRequired: false, transformFunction: null }, easing: { classPropertyName: "easing", publicName: "easing", isSignal: true, isRequired: false, transformFunction: null }, staggerDuration: { classPropertyName: "staggerDuration", publicName: "staggerDuration", isSignal: true, isRequired: false, transformFunction: null }, staggerFrom: { classPropertyName: "staggerFrom", publicName: "staggerFrom", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { nextChange: "nextChange" }, host: { classAttribute: "wr-rotating-text" }, ngImport: i0, template: "<!-- Screen-reader-only live region with the canonical text. -->\n<span class=\"wr-rotating-text__sr-only\">{{ current() }}</span>\n\n<!-- Animated visual content. -->\n<span class=\"wr-rotating-text__inner\" aria-hidden=\"true\">\n @for (word of words(); track $index) {\n <span class=\"wr-rotating-text__word\">\n @for (char of word.characters; track $index) {\n <span class=\"wr-rotating-text__char\">{{ char }}</span>\n }\n @if (word.needsSpace) {\n <span class=\"wr-rotating-text__space\">&nbsp;</span>\n }\n </span>\n }\n</span>\n", styles: [".wr-rotating-text{display:inline-flex;align-items:center;overflow:hidden;vertical-align:bottom}.wr-rotating-text__sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}.wr-rotating-text__inner{display:inline-flex;flex-wrap:wrap}.wr-rotating-text__word{display:inline-flex;align-items:center}.wr-rotating-text__char{display:inline-block;will-change:transform,opacity}.wr-rotating-text__space{display:inline;white-space:pre}\n"], encapsulation: i0.ViewEncapsulation.None });
266
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: WrRotatingText, isStandalone: true, selector: "wr-rotating-text", inputs: { texts: { classPropertyName: "texts", publicName: "texts", isSignal: true, isRequired: true, transformFunction: null }, rotationInterval: { classPropertyName: "rotationInterval", publicName: "rotationInterval", isSignal: true, isRequired: false, transformFunction: null }, splitBy: { classPropertyName: "splitBy", publicName: "splitBy", isSignal: true, isRequired: false, transformFunction: null }, auto: { classPropertyName: "auto", publicName: "auto", isSignal: true, isRequired: false, transformFunction: null }, loop: { classPropertyName: "loop", publicName: "loop", isSignal: true, isRequired: false, transformFunction: null }, duration: { classPropertyName: "duration", publicName: "duration", isSignal: true, isRequired: false, transformFunction: null }, easing: { classPropertyName: "easing", publicName: "easing", isSignal: true, isRequired: false, transformFunction: null }, staggerDuration: { classPropertyName: "staggerDuration", publicName: "staggerDuration", isSignal: true, isRequired: false, transformFunction: null }, staggerFrom: { classPropertyName: "staggerFrom", publicName: "staggerFrom", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { nextChange: "nextChange" }, host: { classAttribute: "wr-rotating-text" }, ngImport: i0, template: "<!--\n The readable text, once: the spans below are per-character. Deliberately NOT a\n live region \u2014 `auto` rotates every two seconds by default, and the APG's answer\n for self-advancing content is silence, not an announcement every two seconds.\n-->\n\n<span class=\"wr-rotating-text__sr-only\">{{ current() }}</span>\n\n<!-- Animated visual content. -->\n<span class=\"wr-rotating-text__inner\" aria-hidden=\"true\">\n @for (word of words(); track $index) {\n <span class=\"wr-rotating-text__word\">\n @for (char of word.characters; track $index) {\n <span class=\"wr-rotating-text__char\">{{ char }}</span>\n }\n @if (word.needsSpace) {\n <span class=\"wr-rotating-text__space\">&nbsp;</span>\n }\n </span>\n }\n</span>\n", styles: [".wr-rotating-text{display:inline-flex;align-items:center;overflow:hidden;vertical-align:bottom}.wr-rotating-text__sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}.wr-rotating-text__inner{display:inline-flex;flex-wrap:wrap}.wr-rotating-text__word{display:inline-flex;align-items:center}.wr-rotating-text__char{display:inline-block;will-change:transform,opacity}.wr-rotating-text__space{display:inline;white-space:pre}\n"], encapsulation: i0.ViewEncapsulation.None });
267
267
  }
268
268
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: WrRotatingText, decorators: [{
269
269
  type: Component,
270
- args: [{ selector: 'wr-rotating-text', encapsulation: ViewEncapsulation.None, host: { class: 'wr-rotating-text' }, template: "<!-- Screen-reader-only live region with the canonical text. -->\n<span class=\"wr-rotating-text__sr-only\">{{ current() }}</span>\n\n<!-- Animated visual content. -->\n<span class=\"wr-rotating-text__inner\" aria-hidden=\"true\">\n @for (word of words(); track $index) {\n <span class=\"wr-rotating-text__word\">\n @for (char of word.characters; track $index) {\n <span class=\"wr-rotating-text__char\">{{ char }}</span>\n }\n @if (word.needsSpace) {\n <span class=\"wr-rotating-text__space\">&nbsp;</span>\n }\n </span>\n }\n</span>\n", styles: [".wr-rotating-text{display:inline-flex;align-items:center;overflow:hidden;vertical-align:bottom}.wr-rotating-text__sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}.wr-rotating-text__inner{display:inline-flex;flex-wrap:wrap}.wr-rotating-text__word{display:inline-flex;align-items:center}.wr-rotating-text__char{display:inline-block;will-change:transform,opacity}.wr-rotating-text__space{display:inline;white-space:pre}\n"] }]
270
+ args: [{ selector: 'wr-rotating-text', encapsulation: ViewEncapsulation.None, host: { class: 'wr-rotating-text' }, template: "<!--\n The readable text, once: the spans below are per-character. Deliberately NOT a\n live region \u2014 `auto` rotates every two seconds by default, and the APG's answer\n for self-advancing content is silence, not an announcement every two seconds.\n-->\n\n<span class=\"wr-rotating-text__sr-only\">{{ current() }}</span>\n\n<!-- Animated visual content. -->\n<span class=\"wr-rotating-text__inner\" aria-hidden=\"true\">\n @for (word of words(); track $index) {\n <span class=\"wr-rotating-text__word\">\n @for (char of word.characters; track $index) {\n <span class=\"wr-rotating-text__char\">{{ char }}</span>\n }\n @if (word.needsSpace) {\n <span class=\"wr-rotating-text__space\">&nbsp;</span>\n }\n </span>\n }\n</span>\n", styles: [".wr-rotating-text{display:inline-flex;align-items:center;overflow:hidden;vertical-align:bottom}.wr-rotating-text__sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}.wr-rotating-text__inner{display:inline-flex;flex-wrap:wrap}.wr-rotating-text__word{display:inline-flex;align-items:center}.wr-rotating-text__char{display:inline-block;will-change:transform,opacity}.wr-rotating-text__space{display:inline;white-space:pre}\n"] }]
271
271
  }], ctorParameters: () => [], propDecorators: { texts: [{ type: i0.Input, args: [{ isSignal: true, alias: "texts", required: true }] }], rotationInterval: [{ type: i0.Input, args: [{ isSignal: true, alias: "rotationInterval", required: false }] }], splitBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "splitBy", required: false }] }], auto: [{ type: i0.Input, args: [{ isSignal: true, alias: "auto", required: false }] }], loop: [{ type: i0.Input, args: [{ isSignal: true, alias: "loop", required: false }] }], duration: [{ type: i0.Input, args: [{ isSignal: true, alias: "duration", required: false }] }], easing: [{ type: i0.Input, args: [{ isSignal: true, alias: "easing", required: false }] }], staggerDuration: [{ type: i0.Input, args: [{ isSignal: true, alias: "staggerDuration", required: false }] }], staggerFrom: [{ type: i0.Input, args: [{ isSignal: true, alias: "staggerFrom", required: false }] }], nextChange: [{ type: i0.Output, args: ["nextChange"] }] } });
272
272
 
273
273
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-rotating-text.mjs","sources":["../../../projects/lib/rotating-text/rotating-text.ts","../../../projects/lib/rotating-text/rotating-text.html","../../../projects/lib/rotating-text/ngwr-rotating-text.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n *\n * Angular adaptation of the RotatingText effect by David Haz / reactbits.dev.\n * Original: https://www.reactbits.dev/text-animations/rotating-text\n *\n * The reactbits version uses `motion/react` + `AnimatePresence`. This\n * port is dependency-free — vanilla DOM split + Web Animations API for\n * the enter/exit transitions.\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n Injector,\n PLATFORM_ID,\n ViewEncapsulation,\n afterNextRender,\n computed,\n effect,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\n\nimport { WrPlatform } from 'ngwr/platform';\nimport { numAttr } from 'ngwr/utils';\n\nimport type { WrRotatingTextSplit, WrRotatingTextStaggerFrom } from './interfaces';\n\nconst DEFAULT_EASING = 'cubic-bezier(0.16, 1, 0.3, 1)';\n\ninterface Word {\n readonly characters: readonly string[];\n readonly needsSpace: boolean;\n}\n\nfunction graphemes(text: string): readonly string[] {\n if (typeof Intl !== 'undefined' && 'Segmenter' in Intl) {\n const seg = new Intl.Segmenter('en', { granularity: 'grapheme' });\n return Array.from(seg.segment(text), s => s.segment);\n }\n return Array.from(text);\n}\n\nfunction splitWords(text: string, by: WrRotatingTextSplit): readonly Word[] {\n if (!text) return [];\n if (by === 'lines') {\n const lines = text.split('\\n');\n return lines.map((line, i) => ({ characters: [line], needsSpace: i !== lines.length - 1 }));\n }\n if (by === 'words') {\n const words = text.split(' ');\n return words.map((w, i) => ({ characters: [w], needsSpace: i !== words.length - 1 }));\n }\n // characters: split each word into graphemes, keep word boundaries for spacing.\n const words = text.split(' ');\n return words.map((w, i) => ({ characters: graphemes(w), needsSpace: i !== words.length - 1 }));\n}\n\n/**\n * Cycles through a list of strings, animating each transition\n * character-by-character (or word/line). Auto-advances on a timer by\n * default; can also be controlled imperatively via `next()` /\n * `previous()` / `jumpTo()` / `reset()`.\n *\n * @example\n * ```html\n * <wr-rotating-text [texts]=\"['design', 'ship', 'iterate']\" />\n *\n * // Manual control:\n * @ViewChild(WrRotatingText) rotator!: WrRotatingText;\n * onClick(): void { this.rotator.next(); }\n * ```\n *\n * @see https://www.reactbits.dev/text-animations/rotating-text\n */\n@Component({\n selector: 'wr-rotating-text',\n templateUrl: './rotating-text.html',\n styleUrl: './rotating-text.scss',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-rotating-text' },\n})\nexport class WrRotatingText {\n /** Strings to cycle. Required. */\n readonly texts = input.required<readonly string[]>();\n\n /** Auto-advance interval in ms. @default 2000 */\n readonly rotationInterval = input(2000, { transform: numAttr(2000) });\n\n /** Granularity of the split. @default 'characters' */\n readonly splitBy = input<WrRotatingTextSplit>('characters');\n\n /** Auto-advance on a timer. @default true */\n readonly auto = input(true, { transform: coerceBooleanProperty });\n\n /** Loop back to the first string after the last. @default true */\n readonly loop = input(true, { transform: coerceBooleanProperty });\n\n /** Per-swap tween duration in seconds. @default 0.6 */\n readonly duration = input(0.6, { transform: numAttr(0.6) });\n\n /** CSS easing of the per-piece tween. @default 'cubic-bezier(0.16, 1, 0.3, 1)' (~power3.out) */\n readonly easing = input(DEFAULT_EASING);\n\n /** Per-piece stagger in seconds. @default 0 */\n readonly staggerDuration = input(0, { transform: numAttr(0) });\n\n /** Stagger origin. @default 'first' */\n readonly staggerFrom = input<WrRotatingTextStaggerFrom>('first');\n\n /** Emitted with the new index on every rotation. */\n readonly nextChange = output<number>();\n\n protected readonly index = signal(0);\n\n protected readonly current = computed(() => {\n const arr = this.texts();\n return arr.length === 0 ? '' : arr[Math.min(this.index(), arr.length - 1)];\n });\n\n protected readonly words = computed<readonly Word[]>(() => splitWords(this.current(), this.splitBy()));\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly injector = inject(Injector);\n private readonly destroyRef = inject(DestroyRef);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n private readonly platform = inject(WrPlatform);\n\n private timerId: ReturnType<typeof setInterval> | undefined;\n private isAnimating = false;\n private destroyed = false;\n\n constructor() {\n if (!this.isBrowser) return;\n\n afterNextRender(() => this.animateIn());\n\n // Restart the timer when interval / auto change.\n effect(() => {\n this.rotationInterval();\n this.auto();\n this.restartTimer();\n });\n\n this.destroyRef.onDestroy(() => {\n clearInterval(this.timerId);\n this.destroyed = true;\n });\n }\n\n // Public imperative API\n\n next(): void {\n const arr = this.texts();\n if (arr.length === 0) return;\n const cur = this.index();\n const last = arr.length - 1;\n const target = cur === last ? (this.loop() ? 0 : cur) : cur + 1;\n if (target !== cur) void this.transitionTo(target);\n }\n\n previous(): void {\n const arr = this.texts();\n if (arr.length === 0) return;\n const cur = this.index();\n const last = arr.length - 1;\n const target = cur === 0 ? (this.loop() ? last : cur) : cur - 1;\n if (target !== cur) void this.transitionTo(target);\n }\n\n jumpTo(target: number): void {\n const arr = this.texts();\n if (arr.length === 0) return;\n const clamped = Math.max(0, Math.min(target, arr.length - 1));\n if (clamped !== this.index()) void this.transitionTo(clamped);\n }\n\n reset(): void {\n if (this.index() !== 0) void this.transitionTo(0);\n }\n\n // Internals\n\n private restartTimer(): void {\n clearInterval(this.timerId);\n if (!this.auto()) return;\n this.timerId = setInterval(() => this.next(), this.rotationInterval());\n }\n\n private async transitionTo(target: number): Promise<void> {\n if (this.isAnimating) return;\n this.isAnimating = true;\n\n await this.animateOut();\n\n // `animateOut` is an async gap, and a transition already in flight outlives\n // the component: navigating away destroys it, and `clearInterval` only\n // stops FUTURE ticks — not this call. Everything below touches the view, so\n // resuming on a destroyed component throws NG0911 (\"View has already been\n // destroyed\") and warns NG0953 (emit on a destroyed `OutputRef`).\n if (this.destroyed) return;\n\n this.index.set(target);\n this.nextChange.emit(target);\n // Animate in only AFTER Angular has rendered the new word's spans. A single\n // microtask isn't enough under zoneless change detection — the re-render\n // hasn't flushed yet, so `animateIn()` would query the OLD spans, animate\n // them, and then the render would swap their content mid-flight (and any\n // spans the longer word adds would never get animated). `afterNextRender`\n // fires after the render the `index` change schedules.\n afterNextRender(\n () => {\n this.animateIn();\n this.isAnimating = false;\n },\n { injector: this.injector }\n );\n }\n\n private animateIn(): void {\n const targets = this.host.nativeElement.querySelectorAll<HTMLElement>('.wr-rotating-text__char');\n if (targets.length === 0) return;\n\n // Reduced motion: the word swap itself is content and keeps cycling,\n // but each swap is instant — no per-char rise/fall tween.\n if (this.platform.prefersReducedMotion()) {\n targets.forEach(el => {\n el.style.opacity = '1';\n el.style.transform = 'translate3d(0, 0, 0)';\n });\n return;\n }\n\n const stagger = this.staggerDuration() * 1000;\n targets.forEach((el, i) => {\n const delay = this.delayFor(i, targets.length, stagger);\n el.style.opacity = '0';\n el.style.transform = 'translate3d(0, 100%, 0)';\n const anim = el.animate(\n [\n { opacity: 0, transform: 'translate3d(0, 100%, 0)' },\n { opacity: 1, transform: 'translate3d(0, 0, 0)' },\n ],\n { duration: this.duration() * 1000, delay, easing: this.easing(), fill: 'forwards' }\n );\n anim.onfinish = (): void => {\n el.style.opacity = '1';\n el.style.transform = 'translate3d(0, 0, 0)';\n try {\n anim.cancel();\n } catch {\n /* noop */\n }\n };\n });\n }\n\n private animateOut(): Promise<void> {\n const targets = this.host.nativeElement.querySelectorAll<HTMLElement>('.wr-rotating-text__char');\n if (targets.length === 0) return Promise.resolve();\n if (this.platform.prefersReducedMotion()) return Promise.resolve();\n const stagger = this.staggerDuration() * 1000;\n const promises: Promise<void>[] = [];\n targets.forEach((el, i) => {\n const delay = this.delayFor(i, targets.length, stagger);\n const anim = el.animate(\n [\n { opacity: 1, transform: 'translate3d(0, 0, 0)' },\n { opacity: 0, transform: 'translate3d(0, -120%, 0)' },\n ],\n { duration: this.duration() * 1000, delay, easing: this.easing(), fill: 'forwards' }\n );\n promises.push(\n new Promise<void>(resolve => {\n anim.onfinish = (): void => {\n // Commit the exited (hidden, lifted) state to inline style before\n // cancelling, so the char stays out instead of snapping back to\n // visible-in-place between the swap and the enter animation.\n el.style.opacity = '0';\n el.style.transform = 'translate3d(0, -120%, 0)';\n try {\n anim.cancel();\n } catch {\n /* noop */\n }\n resolve();\n };\n })\n );\n });\n return Promise.all(promises).then(() => undefined);\n }\n\n private delayFor(i: number, total: number, stagger: number): number {\n if (stagger === 0) return 0;\n switch (this.staggerFrom()) {\n case 'last':\n return (total - 1 - i) * stagger;\n case 'center': {\n const center = Math.floor(total / 2);\n return Math.abs(center - i) * stagger;\n }\n case 'first':\n default:\n return i * stagger;\n }\n }\n}\n\nexport type { WrRotatingTextSplit, WrRotatingTextStaggerFrom } from './interfaces';\n","<!-- Screen-reader-only live region with the canonical text. -->\n<span class=\"wr-rotating-text__sr-only\">{{ current() }}</span>\n\n<!-- Animated visual content. -->\n<span class=\"wr-rotating-text__inner\" aria-hidden=\"true\">\n @for (word of words(); track $index) {\n <span class=\"wr-rotating-text__word\">\n @for (char of word.characters; track $index) {\n <span class=\"wr-rotating-text__char\">{{ char }}</span>\n }\n @if (word.needsSpace) {\n <span class=\"wr-rotating-text__space\">&nbsp;</span>\n }\n </span>\n }\n</span>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAAA;;;;;;;;;;;;AAYG;AAyBH,MAAM,cAAc,GAAG,+BAA+B;AAOtD,SAAS,SAAS,CAAC,IAAY,EAAA;IAC7B,IAAI,OAAO,IAAI,KAAK,WAAW,IAAI,WAAW,IAAI,IAAI,EAAE;AACtD,QAAA,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC;AACjE,QAAA,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC;IACtD;AACA,IAAA,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;AACzB;AAEA,SAAS,UAAU,CAAC,IAAY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,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAd,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,cAAc,i0CC3F3B,okBAgBA,EAAA,MAAA,EAAA,CAAA,8eAAA,CAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FD2Ea,cAAc,EAAA,UAAA,EAAA,CAAA;kBAP1B,SAAS;+BACE,kBAAkB,EAAA,aAAA,EAGb,iBAAiB,CAAC,IAAI,QAC/B,EAAE,KAAK,EAAE,kBAAkB,EAAE,EAAA,QAAA,EAAA,okBAAA,EAAA,MAAA,EAAA,CAAA,8eAAA,CAAA,EAAA;;;AEzFrC;;AAEG;;;;"}
1
+ {"version":3,"file":"ngwr-rotating-text.mjs","sources":["../../../projects/lib/rotating-text/rotating-text.ts","../../../projects/lib/rotating-text/rotating-text.html","../../../projects/lib/rotating-text/ngwr-rotating-text.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n *\n * Angular adaptation of the RotatingText effect by David Haz / reactbits.dev.\n * Original: https://www.reactbits.dev/text-animations/rotating-text\n *\n * The reactbits version uses `motion/react` + `AnimatePresence`. This\n * port is dependency-free — vanilla DOM split + Web Animations API for\n * the enter/exit transitions.\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n Injector,\n PLATFORM_ID,\n ViewEncapsulation,\n afterNextRender,\n computed,\n effect,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\n\nimport { WrPlatform } from 'ngwr/platform';\nimport { numAttr } from 'ngwr/utils';\n\nimport type { WrRotatingTextSplit, WrRotatingTextStaggerFrom } from './interfaces';\n\nconst DEFAULT_EASING = 'cubic-bezier(0.16, 1, 0.3, 1)';\n\ninterface Word {\n readonly characters: readonly string[];\n readonly needsSpace: boolean;\n}\n\nfunction graphemes(text: string): readonly string[] {\n if (typeof Intl !== 'undefined' && 'Segmenter' in Intl) {\n const seg = new Intl.Segmenter('en', { granularity: 'grapheme' });\n return Array.from(seg.segment(text), s => s.segment);\n }\n return Array.from(text);\n}\n\nfunction splitWords(text: string, by: WrRotatingTextSplit): readonly Word[] {\n if (!text) return [];\n if (by === 'lines') {\n const lines = text.split('\\n');\n return lines.map((line, i) => ({ characters: [line], needsSpace: i !== lines.length - 1 }));\n }\n if (by === 'words') {\n const words = text.split(' ');\n return words.map((w, i) => ({ characters: [w], needsSpace: i !== words.length - 1 }));\n }\n // characters: split each word into graphemes, keep word boundaries for spacing.\n const words = text.split(' ');\n return words.map((w, i) => ({ characters: graphemes(w), needsSpace: i !== words.length - 1 }));\n}\n\n/**\n * Cycles through a list of strings, animating each transition\n * character-by-character (or word/line). Auto-advances on a timer by\n * default; can also be controlled imperatively via `next()` /\n * `previous()` / `jumpTo()` / `reset()`.\n *\n * @example\n * ```html\n * <wr-rotating-text [texts]=\"['design', 'ship', 'iterate']\" />\n *\n * // Manual control:\n * @ViewChild(WrRotatingText) rotator!: WrRotatingText;\n * onClick(): void { this.rotator.next(); }\n * ```\n *\n * @see https://www.reactbits.dev/text-animations/rotating-text\n */\n@Component({\n selector: 'wr-rotating-text',\n templateUrl: './rotating-text.html',\n styleUrl: './rotating-text.scss',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-rotating-text' },\n})\nexport class WrRotatingText {\n /** Strings to cycle. Required. */\n readonly texts = input.required<readonly string[]>();\n\n /** Auto-advance interval in ms. @default 2000 */\n readonly rotationInterval = input(2000, { transform: numAttr(2000) });\n\n /** Granularity of the split. @default 'characters' */\n readonly splitBy = input<WrRotatingTextSplit>('characters');\n\n /** Auto-advance on a timer. @default true */\n readonly auto = input(true, { transform: coerceBooleanProperty });\n\n /** Loop back to the first string after the last. @default true */\n readonly loop = input(true, { transform: coerceBooleanProperty });\n\n /** Per-swap tween duration in seconds. @default 0.6 */\n readonly duration = input(0.6, { transform: numAttr(0.6) });\n\n /** CSS easing of the per-piece tween. @default 'cubic-bezier(0.16, 1, 0.3, 1)' (~power3.out) */\n readonly easing = input(DEFAULT_EASING);\n\n /** Per-piece stagger in seconds. @default 0 */\n readonly staggerDuration = input(0, { transform: numAttr(0) });\n\n /** Stagger origin. @default 'first' */\n readonly staggerFrom = input<WrRotatingTextStaggerFrom>('first');\n\n /** Emitted with the new index on every rotation. */\n readonly nextChange = output<number>();\n\n protected readonly index = signal(0);\n\n protected readonly current = computed(() => {\n const arr = this.texts();\n return arr.length === 0 ? '' : arr[Math.min(this.index(), arr.length - 1)];\n });\n\n protected readonly words = computed<readonly Word[]>(() => splitWords(this.current(), this.splitBy()));\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly injector = inject(Injector);\n private readonly destroyRef = inject(DestroyRef);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n private readonly platform = inject(WrPlatform);\n\n private timerId: ReturnType<typeof setInterval> | undefined;\n private isAnimating = false;\n private destroyed = false;\n\n constructor() {\n if (!this.isBrowser) return;\n\n afterNextRender(() => this.animateIn());\n\n // Restart the timer when interval / auto change.\n effect(() => {\n this.rotationInterval();\n this.auto();\n this.restartTimer();\n });\n\n this.destroyRef.onDestroy(() => {\n clearInterval(this.timerId);\n this.destroyed = true;\n });\n }\n\n // Public imperative API\n\n next(): void {\n const arr = this.texts();\n if (arr.length === 0) return;\n const cur = this.index();\n const last = arr.length - 1;\n const target = cur === last ? (this.loop() ? 0 : cur) : cur + 1;\n if (target !== cur) void this.transitionTo(target);\n }\n\n previous(): void {\n const arr = this.texts();\n if (arr.length === 0) return;\n const cur = this.index();\n const last = arr.length - 1;\n const target = cur === 0 ? (this.loop() ? last : cur) : cur - 1;\n if (target !== cur) void this.transitionTo(target);\n }\n\n jumpTo(target: number): void {\n const arr = this.texts();\n if (arr.length === 0) return;\n const clamped = Math.max(0, Math.min(target, arr.length - 1));\n if (clamped !== this.index()) void this.transitionTo(clamped);\n }\n\n reset(): void {\n if (this.index() !== 0) void this.transitionTo(0);\n }\n\n // Internals\n\n private restartTimer(): void {\n clearInterval(this.timerId);\n if (!this.auto()) return;\n this.timerId = setInterval(() => this.next(), this.rotationInterval());\n }\n\n private async transitionTo(target: number): Promise<void> {\n if (this.isAnimating) return;\n this.isAnimating = true;\n\n await this.animateOut();\n\n // `animateOut` is an async gap, and a transition already in flight outlives\n // the component: navigating away destroys it, and `clearInterval` only\n // stops FUTURE ticks — not this call. Everything below touches the view, so\n // resuming on a destroyed component throws NG0911 (\"View has already been\n // destroyed\") and warns NG0953 (emit on a destroyed `OutputRef`).\n if (this.destroyed) return;\n\n this.index.set(target);\n this.nextChange.emit(target);\n // Animate in only AFTER Angular has rendered the new word's spans. A single\n // microtask isn't enough under zoneless change detection — the re-render\n // hasn't flushed yet, so `animateIn()` would query the OLD spans, animate\n // them, and then the render would swap their content mid-flight (and any\n // spans the longer word adds would never get animated). `afterNextRender`\n // fires after the render the `index` change schedules.\n afterNextRender(\n () => {\n this.animateIn();\n this.isAnimating = false;\n },\n { injector: this.injector }\n );\n }\n\n private animateIn(): void {\n const targets = this.host.nativeElement.querySelectorAll<HTMLElement>('.wr-rotating-text__char');\n if (targets.length === 0) return;\n\n // Reduced motion: the word swap itself is content and keeps cycling,\n // but each swap is instant — no per-char rise/fall tween.\n if (this.platform.prefersReducedMotion()) {\n targets.forEach(el => {\n el.style.opacity = '1';\n el.style.transform = 'translate3d(0, 0, 0)';\n });\n return;\n }\n\n const stagger = this.staggerDuration() * 1000;\n targets.forEach((el, i) => {\n const delay = this.delayFor(i, targets.length, stagger);\n el.style.opacity = '0';\n el.style.transform = 'translate3d(0, 100%, 0)';\n const anim = el.animate(\n [\n { opacity: 0, transform: 'translate3d(0, 100%, 0)' },\n { opacity: 1, transform: 'translate3d(0, 0, 0)' },\n ],\n { duration: this.duration() * 1000, delay, easing: this.easing(), fill: 'forwards' }\n );\n anim.onfinish = (): void => {\n el.style.opacity = '1';\n el.style.transform = 'translate3d(0, 0, 0)';\n try {\n anim.cancel();\n } catch {\n /* noop */\n }\n };\n });\n }\n\n private animateOut(): Promise<void> {\n const targets = this.host.nativeElement.querySelectorAll<HTMLElement>('.wr-rotating-text__char');\n if (targets.length === 0) return Promise.resolve();\n if (this.platform.prefersReducedMotion()) return Promise.resolve();\n const stagger = this.staggerDuration() * 1000;\n const promises: Promise<void>[] = [];\n targets.forEach((el, i) => {\n const delay = this.delayFor(i, targets.length, stagger);\n const anim = el.animate(\n [\n { opacity: 1, transform: 'translate3d(0, 0, 0)' },\n { opacity: 0, transform: 'translate3d(0, -120%, 0)' },\n ],\n { duration: this.duration() * 1000, delay, easing: this.easing(), fill: 'forwards' }\n );\n promises.push(\n new Promise<void>(resolve => {\n anim.onfinish = (): void => {\n // Commit the exited (hidden, lifted) state to inline style before\n // cancelling, so the char stays out instead of snapping back to\n // visible-in-place between the swap and the enter animation.\n el.style.opacity = '0';\n el.style.transform = 'translate3d(0, -120%, 0)';\n try {\n anim.cancel();\n } catch {\n /* noop */\n }\n resolve();\n };\n })\n );\n });\n return Promise.all(promises).then(() => undefined);\n }\n\n private delayFor(i: number, total: number, stagger: number): number {\n if (stagger === 0) return 0;\n switch (this.staggerFrom()) {\n case 'last':\n return (total - 1 - i) * stagger;\n case 'center': {\n const center = Math.floor(total / 2);\n return Math.abs(center - i) * stagger;\n }\n case 'first':\n default:\n return i * stagger;\n }\n }\n}\n\nexport type { WrRotatingTextSplit, WrRotatingTextStaggerFrom } from './interfaces';\n","<!--\n The readable text, once: the spans below are per-character. Deliberately NOT a\n live region — `auto` rotates every two seconds by default, and the APG's answer\n for self-advancing content is silence, not an announcement every two seconds.\n-->\n\n<span class=\"wr-rotating-text__sr-only\">{{ current() }}</span>\n\n<!-- Animated visual content. -->\n<span class=\"wr-rotating-text__inner\" aria-hidden=\"true\">\n @for (word of words(); track $index) {\n <span class=\"wr-rotating-text__word\">\n @for (char of word.characters; track $index) {\n <span class=\"wr-rotating-text__char\">{{ char }}</span>\n }\n @if (word.needsSpace) {\n <span class=\"wr-rotating-text__space\">&nbsp;</span>\n }\n </span>\n }\n</span>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAAA;;;;;;;;;;;;AAYG;AAyBH,MAAM,cAAc,GAAG,+BAA+B;AAOtD,SAAS,SAAS,CAAC,IAAY,EAAA;IAC7B,IAAI,OAAO,IAAI,KAAK,WAAW,IAAI,WAAW,IAAI,IAAI,EAAE;AACtD,QAAA,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC;AACjE,QAAA,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC;IACtD;AACA,IAAA,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;AACzB;AAEA,SAAS,UAAU,CAAC,IAAY,EAAE,EAAuB,EAAA;AACvD,IAAA,IAAI,CAAC,IAAI;AAAE,QAAA,OAAO,EAAE;AACpB,IAAA,IAAI,EAAE,KAAK,OAAO,EAAE;QAClB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;AAC9B,QAAA,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,CAAC,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC;IAC7F;AACA,IAAA,IAAI,EAAE,KAAK,OAAO,EAAE;QAClB,MAAM,KAAK,GA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