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.
- package/action-sheet/styles/_index.scss +4 -1
- package/anchor/styles/_index.scss +2 -1
- package/calendar/styles/_index.scss +11 -2
- package/cascader/styles/_index.scss +3 -1
- package/circular-text/styles/_index.scss +11 -0
- package/command-palette/styles/_index.scss +14 -1
- package/context-menu/styles/_index.scss +2 -1
- package/falling-text/styles/_index.scss +2 -1
- package/fesm2022/ngwr-action-sheet-testing.mjs +313 -0
- package/fesm2022/ngwr-action-sheet-testing.mjs.map +1 -0
- package/fesm2022/ngwr-bar-chart-testing.mjs +89 -0
- package/fesm2022/ngwr-bar-chart-testing.mjs.map +1 -0
- package/fesm2022/ngwr-blur-text-testing.mjs +203 -0
- package/fesm2022/ngwr-blur-text-testing.mjs.map +1 -0
- package/fesm2022/ngwr-blur-text.mjs +15 -1
- package/fesm2022/ngwr-blur-text.mjs.map +1 -1
- package/fesm2022/ngwr-border-glow-testing.mjs +325 -0
- package/fesm2022/ngwr-border-glow-testing.mjs.map +1 -0
- package/fesm2022/ngwr-border-glow.mjs +2 -2
- package/fesm2022/ngwr-breadcrumbs.mjs +2 -2
- package/fesm2022/ngwr-calendar-heatmap-testing.mjs +95 -0
- package/fesm2022/ngwr-calendar-heatmap-testing.mjs.map +1 -0
- package/fesm2022/ngwr-calendar-testing.mjs +368 -0
- package/fesm2022/ngwr-calendar-testing.mjs.map +1 -0
- package/fesm2022/ngwr-calendar.mjs +43 -3
- package/fesm2022/ngwr-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-card.mjs +2 -2
- package/fesm2022/ngwr-cascader.mjs +14 -2
- package/fesm2022/ngwr-cascader.mjs.map +1 -1
- package/fesm2022/ngwr-checkbox.mjs +8 -0
- package/fesm2022/ngwr-checkbox.mjs.map +1 -1
- package/fesm2022/ngwr-circular-text-testing.mjs +230 -0
- package/fesm2022/ngwr-circular-text-testing.mjs.map +1 -0
- package/fesm2022/ngwr-circular-text.mjs +2 -2
- package/fesm2022/ngwr-circular-text.mjs.map +1 -1
- package/fesm2022/ngwr-color-picker-testing.mjs +432 -0
- package/fesm2022/ngwr-color-picker-testing.mjs.map +1 -0
- package/fesm2022/ngwr-color-picker.mjs +29 -3
- package/fesm2022/ngwr-color-picker.mjs.map +1 -1
- package/fesm2022/ngwr-context-menu.mjs +25 -5
- package/fesm2022/ngwr-context-menu.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker-testing.mjs +10 -79
- package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-decrypt-text-testing.mjs +261 -0
- package/fesm2022/ngwr-decrypt-text-testing.mjs.map +1 -0
- package/fesm2022/ngwr-decrypt-text.mjs +6 -1
- package/fesm2022/ngwr-decrypt-text.mjs.map +1 -1
- package/fesm2022/ngwr-donut-chart-testing.mjs +93 -0
- package/fesm2022/ngwr-donut-chart-testing.mjs.map +1 -0
- package/fesm2022/ngwr-drag-drop.mjs +2 -2
- package/fesm2022/ngwr-drawer.mjs +36 -7
- package/fesm2022/ngwr-drawer.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +32 -2
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-event-calendar-testing.mjs +446 -0
- package/fesm2022/ngwr-event-calendar-testing.mjs.map +1 -0
- package/fesm2022/ngwr-event-calendar.mjs +43 -18
- package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-falling-text-testing.mjs +218 -0
- package/fesm2022/ngwr-falling-text-testing.mjs.map +1 -0
- package/fesm2022/ngwr-falling-text.mjs +2 -2
- package/fesm2022/ngwr-falling-text.mjs.map +1 -1
- package/fesm2022/ngwr-fuzzy-text-testing.mjs +134 -0
- package/fesm2022/ngwr-fuzzy-text-testing.mjs.map +1 -0
- package/fesm2022/ngwr-gauge-testing.mjs +86 -0
- package/fesm2022/ngwr-gauge-testing.mjs.map +1 -0
- package/fesm2022/ngwr-glitch-text-testing.mjs +181 -0
- package/fesm2022/ngwr-glitch-text-testing.mjs.map +1 -0
- package/fesm2022/ngwr-glitch-text.mjs +2 -2
- package/fesm2022/ngwr-gradient-text-testing.mjs +223 -0
- package/fesm2022/ngwr-gradient-text-testing.mjs.map +1 -0
- package/fesm2022/ngwr-gradient-text.mjs +2 -2
- package/fesm2022/ngwr-i18n-en.mjs +14 -0
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +14 -0
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-image-cropper-testing.mjs +156 -0
- package/fesm2022/ngwr-image-cropper-testing.mjs.map +1 -0
- package/fesm2022/ngwr-image-cropper.mjs +10 -3
- package/fesm2022/ngwr-image-cropper.mjs.map +1 -1
- package/fesm2022/ngwr-input-number.mjs +73 -6
- package/fesm2022/ngwr-input-number.mjs.map +1 -1
- package/fesm2022/ngwr-knob-testing.mjs +220 -0
- package/fesm2022/ngwr-knob-testing.mjs.map +1 -0
- package/fesm2022/ngwr-lightbox-testing.mjs +223 -0
- package/fesm2022/ngwr-lightbox-testing.mjs.map +1 -0
- package/fesm2022/ngwr-lightbox.mjs +9 -2
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-line-chart-testing.mjs +119 -0
- package/fesm2022/ngwr-line-chart-testing.mjs.map +1 -0
- package/fesm2022/ngwr-list.mjs +2 -2
- package/fesm2022/ngwr-loading-bar.mjs +2 -2
- package/fesm2022/ngwr-marquee-testing.mjs +336 -0
- package/fesm2022/ngwr-marquee-testing.mjs.map +1 -0
- package/fesm2022/ngwr-marquee.mjs +2 -2
- package/fesm2022/ngwr-meter-group-testing.mjs +80 -0
- package/fesm2022/ngwr-meter-group-testing.mjs.map +1 -0
- package/fesm2022/ngwr-overlay.mjs +28 -1
- package/fesm2022/ngwr-overlay.mjs.map +1 -1
- package/fesm2022/ngwr-popover.mjs +14 -0
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-rotating-text-testing.mjs +220 -0
- package/fesm2022/ngwr-rotating-text-testing.mjs.map +1 -0
- package/fesm2022/ngwr-rotating-text.mjs +2 -2
- package/fesm2022/ngwr-rotating-text.mjs.map +1 -1
- package/fesm2022/ngwr-select.mjs +70 -11
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-shiny-text-testing.mjs +237 -0
- package/fesm2022/ngwr-shiny-text-testing.mjs.map +1 -0
- package/fesm2022/ngwr-shiny-text.mjs +2 -2
- package/fesm2022/ngwr-slider.mjs +44 -6
- package/fesm2022/ngwr-slider.mjs.map +1 -1
- package/fesm2022/ngwr-sparkline-testing.mjs +76 -0
- package/fesm2022/ngwr-sparkline-testing.mjs.map +1 -0
- package/fesm2022/ngwr-speed-dial-testing.mjs +279 -0
- package/fesm2022/ngwr-speed-dial-testing.mjs.map +1 -0
- package/fesm2022/ngwr-splash-cursor-testing.mjs +89 -0
- package/fesm2022/ngwr-splash-cursor-testing.mjs.map +1 -0
- package/fesm2022/ngwr-split-text-testing.mjs +224 -0
- package/fesm2022/ngwr-split-text-testing.mjs.map +1 -0
- package/fesm2022/ngwr-split-text.mjs +15 -1
- package/fesm2022/ngwr-split-text.mjs.map +1 -1
- package/fesm2022/ngwr-splitter-testing.mjs +245 -0
- package/fesm2022/ngwr-splitter-testing.mjs.map +1 -0
- package/fesm2022/ngwr-spotlight-card-testing.mjs +368 -0
- package/fesm2022/ngwr-spotlight-card-testing.mjs.map +1 -0
- package/fesm2022/ngwr-spotlight-card.mjs +2 -2
- package/fesm2022/ngwr-star-border-testing.mjs +172 -0
- package/fesm2022/ngwr-star-border-testing.mjs.map +1 -0
- package/fesm2022/ngwr-star-border.mjs +2 -2
- package/fesm2022/ngwr-table.mjs +13 -3
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tabs.mjs +15 -1
- package/fesm2022/ngwr-tabs.mjs.map +1 -1
- package/fesm2022/ngwr-tilt-card-testing.mjs +190 -0
- package/fesm2022/ngwr-tilt-card-testing.mjs.map +1 -0
- package/fesm2022/ngwr-tilt-card.mjs +21 -3
- package/fesm2022/ngwr-tilt-card.mjs.map +1 -1
- package/fesm2022/ngwr-toast.mjs +36 -7
- package/fesm2022/ngwr-toast.mjs.map +1 -1
- package/fesm2022/ngwr-tour-testing.mjs +173 -0
- package/fesm2022/ngwr-tour-testing.mjs.map +1 -0
- package/fesm2022/ngwr-tour.mjs +2 -2
- package/fesm2022/ngwr-tour.mjs.map +1 -1
- package/fesm2022/ngwr-tree.mjs +10 -3
- package/fesm2022/ngwr-tree.mjs.map +1 -1
- package/fesm2022/ngwr-typewriter-testing.mjs +228 -0
- package/fesm2022/ngwr-typewriter-testing.mjs.map +1 -0
- package/fesm2022/ngwr-typewriter.mjs +2 -2
- package/fesm2022/ngwr-version.mjs +1 -1
- package/fesm2022/ngwr-version.mjs.map +1 -1
- package/fesm2022/ngwr-virtual-scroll.mjs +2 -2
- package/fesm2022/ngwr-waves-testing.mjs +128 -0
- package/fesm2022/ngwr-waves-testing.mjs.map +1 -0
- package/fesm2022/ngwr-waves.mjs +2 -2
- package/fesm2022/ngwr-window-testing.mjs +361 -0
- package/fesm2022/ngwr-window-testing.mjs.map +1 -0
- package/fesm2022/ngwr-window.mjs +84 -10
- package/fesm2022/ngwr-window.mjs.map +1 -1
- package/file-upload/styles/_index.scss +7 -2
- package/i18n/en.json +16 -2
- package/i18n/ru.json +16 -2
- package/llms-full.txt +147 -0
- package/llms.txt +27 -8
- package/mcp/providers.js +29 -0
- package/mcp/tools.js +1 -29
- package/package.json +145 -1
- package/result/styles/_index.scss +3 -1
- package/segmented/styles/_index.scss +5 -1
- package/select/styles/_index.scss +3 -1
- package/skills/ngwr/SKILL.md +115 -0
- package/skills/ngwr/references/catalog.md +212 -0
- package/skills/ngwr/references/setup.md +73 -0
- package/stepper/styles/_index.scss +18 -2
- package/table/styles/_index.scss +3 -1
- package/theme/styles/_colors.scss +15 -2
- package/theme/styles/_dark.scss +24 -12
- package/tree/styles/_index.scss +4 -2
- package/types/ngwr-action-sheet-testing.d.ts +260 -0
- package/types/ngwr-bar-chart-testing.d.ts +77 -0
- package/types/ngwr-blur-text-testing.d.ts +180 -0
- package/types/ngwr-blur-text.d.ts +12 -0
- package/types/ngwr-border-glow-testing.d.ts +219 -0
- package/types/ngwr-calendar-heatmap-testing.d.ts +79 -0
- package/types/ngwr-calendar-testing.d.ts +277 -0
- package/types/ngwr-calendar.d.ts +10 -0
- package/types/ngwr-checkbox.d.ts +13 -0
- package/types/ngwr-circular-text-testing.d.ts +196 -0
- package/types/ngwr-color-picker-testing.d.ts +291 -0
- package/types/ngwr-color-picker.d.ts +13 -1
- package/types/ngwr-context-menu.d.ts +15 -1
- package/types/ngwr-date-picker-testing.d.ts +6 -66
- package/types/ngwr-decrypt-text-testing.d.ts +222 -0
- package/types/ngwr-donut-chart-testing.d.ts +79 -0
- package/types/ngwr-drawer.d.ts +12 -0
- package/types/ngwr-dropdown.d.ts +9 -0
- package/types/ngwr-event-calendar-testing.d.ts +301 -0
- package/types/ngwr-event-calendar.d.ts +9 -6
- package/types/ngwr-falling-text-testing.d.ts +186 -0
- package/types/ngwr-fuzzy-text-testing.d.ts +130 -0
- package/types/ngwr-gauge-testing.d.ts +71 -0
- package/types/ngwr-glitch-text-testing.d.ts +172 -0
- package/types/ngwr-gradient-text-testing.d.ts +173 -0
- package/types/ngwr-image-cropper-testing.d.ts +134 -0
- package/types/ngwr-image-cropper.d.ts +1 -0
- package/types/ngwr-input-number.d.ts +33 -1
- package/types/ngwr-knob-testing.d.ts +150 -0
- package/types/ngwr-lightbox-testing.d.ts +154 -0
- package/types/ngwr-lightbox.d.ts +6 -0
- package/types/ngwr-line-chart-testing.d.ts +93 -0
- package/types/ngwr-marquee-testing.d.ts +280 -0
- package/types/ngwr-meter-group-testing.d.ts +67 -0
- package/types/ngwr-overlay.d.ts +19 -1
- package/types/ngwr-rotating-text-testing.d.ts +191 -0
- package/types/ngwr-select.d.ts +32 -0
- package/types/ngwr-shiny-text-testing.d.ts +165 -0
- package/types/ngwr-slider.d.ts +15 -0
- package/types/ngwr-sparkline-testing.d.ts +69 -0
- package/types/ngwr-speed-dial-testing.d.ts +195 -0
- package/types/ngwr-splash-cursor-testing.d.ts +95 -0
- package/types/ngwr-split-text-testing.d.ts +209 -0
- package/types/ngwr-split-text.d.ts +12 -0
- package/types/ngwr-splitter-testing.d.ts +174 -0
- package/types/ngwr-spotlight-card-testing.d.ts +303 -0
- package/types/ngwr-star-border-testing.d.ts +135 -0
- package/types/ngwr-table.d.ts +10 -1
- package/types/ngwr-tilt-card-testing.d.ts +158 -0
- package/types/ngwr-tilt-card.d.ts +2 -0
- package/types/ngwr-toast.d.ts +14 -5
- package/types/ngwr-tour-testing.d.ts +143 -0
- package/types/ngwr-tree.d.ts +7 -0
- package/types/ngwr-typewriter-testing.d.ts +201 -0
- package/types/ngwr-version.d.ts +1 -1
- package/types/ngwr-waves-testing.d.ts +121 -0
- package/types/ngwr-window-testing.d.ts +263 -0
- package/types/ngwr-window.d.ts +27 -10
- package/window/styles/_index.scss +44 -16
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { BaseHarnessFilters, 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
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Which way the bright stripe travels. Mirrors the component's `direction` input, which
|
|
12
|
+
* declares the union inline and exports no name for it.
|
|
13
|
+
*/
|
|
14
|
+
type WrShinyTextSweepDirection = 'left' | 'right';
|
|
15
|
+
/** Narrows which `<wr-shiny-text>` a harness query matches. */
|
|
16
|
+
interface WrShinyTextHarnessFilters extends BaseHarnessFilters {
|
|
17
|
+
/** Match the rendered text — a string is an exact match, a RegExp is tested. */
|
|
18
|
+
readonly text?: string | RegExp;
|
|
19
|
+
/**
|
|
20
|
+
* Match only the stopped (`true`) or only the running (`false`) instances. Named for the
|
|
21
|
+
* DOM contract rather than for the input: `[disabled]` writes `wr-shiny-text--paused`.
|
|
22
|
+
*/
|
|
23
|
+
readonly paused?: boolean;
|
|
24
|
+
/** Match the sweep direction — `'left'` is the absence of the reverse modifier. */
|
|
25
|
+
readonly direction?: WrShinyTextSweepDirection;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @license
|
|
30
|
+
*
|
|
31
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
32
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Test harness for `<wr-shiny-text>`.
|
|
37
|
+
*
|
|
38
|
+
* **The duration is the assertion that matters.** The pause between sweeps is not
|
|
39
|
+
* `animation-delay` and not a second animation — it is folded INTO `animation-duration`,
|
|
40
|
+
* because the keyframe finishes at 50% and holds there. So `[speed]="2"` with
|
|
41
|
+
* `[delay]="3"` has to read 5 seconds, and anyone reimplementing the pause the obvious
|
|
42
|
+
* way passes every other check here and fails {@link getCycleDurationSeconds}.
|
|
43
|
+
*
|
|
44
|
+
* **The stripe is five stops and only one of them is the shine.** The base colour fills
|
|
45
|
+
* 0%, 35%, 65% and 100%; the highlight sits alone at 50%. {@link getBaseColor} and
|
|
46
|
+
* {@link getShineColor} are offered as a pair because swapping the two inputs is
|
|
47
|
+
* otherwise undetectable — the gradient stays well-formed, the angle is unchanged, and
|
|
48
|
+
* the text simply stops shimmering.
|
|
49
|
+
*
|
|
50
|
+
* **Both gradient reads come off the inline `style` attribute**, not through computed
|
|
51
|
+
* style. Unset colours fall through to the literal `var(--wr-shiny-text-base)` /
|
|
52
|
+
* `var(--wr-shiny-text-shine)` tokens, which is exactly what makes the dark-theme
|
|
53
|
+
* override work — and a computed read resolves those tokens in a real browser while
|
|
54
|
+
* handing them back verbatim in a unit test. Reading what the component wrote gives the
|
|
55
|
+
* same answer in both places.
|
|
56
|
+
*
|
|
57
|
+
* The colours still pass through the CSSOM on their way back out, and it has its own
|
|
58
|
+
* spelling: a hex literal is re-serialised, so `[color]="'#444'"` reads
|
|
59
|
+
* `rgb(68, 68, 68)`. Functional notations and `var()` tokens survive untouched. Assert
|
|
60
|
+
* the form the CSSOM returns, not the one the template passed in.
|
|
61
|
+
*
|
|
62
|
+
* There is no inner element to query: the template is the bare interpolation, so the text
|
|
63
|
+
* is a node on the host. A locator copied from the gradient-text harness finds nothing.
|
|
64
|
+
*
|
|
65
|
+
* **What the harness deliberately does not offer**, and why. There is no `isAnimating()`
|
|
66
|
+
* / `getBackgroundPosition()`: the sweep is a stylesheet keyframe over
|
|
67
|
+
* `background-position`, and a unit test neither loads the sheet nor runs the animation.
|
|
68
|
+
* There is no `getAnimationName()` / `getIterationCount()` / `getPlayState()`: every
|
|
69
|
+
* animation property except the duration lives in the stylesheet, so those reads answer
|
|
70
|
+
* the same empty string for a working component and a deleted one. {@link isPaused} and
|
|
71
|
+
* {@link pausesOnHover} claim the CLASSES and not the pauses — `:hover` is a selector and
|
|
72
|
+
* `animation-play-state` is a stylesheet rule, so what they honestly pin is that the
|
|
73
|
+
* input arrived. There is no `respectsReducedMotion()`: the handling is a `@media` block
|
|
74
|
+
* with no TypeScript counterpart. And there is nothing reporting the painted text colour,
|
|
75
|
+
* because `-webkit-text-fill-color: transparent` is a stylesheet declaration and a read
|
|
76
|
+
* would report the inherited colour as if the text were solid.
|
|
77
|
+
*
|
|
78
|
+
* The `[wrShimmer]` directive shipped from the same entry point has no harness: it adds
|
|
79
|
+
* one static class and nothing else, so a harness could only restate its own selector.
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```ts
|
|
83
|
+
* const shiny = await loader.getHarness(WrShinyTextHarness);
|
|
84
|
+
*
|
|
85
|
+
* expect(await shiny.getCycleDurationSeconds()).toBe(5);
|
|
86
|
+
* expect(await shiny.getShineColor()).toBe('var(--wr-shiny-text-shine)');
|
|
87
|
+
* ```
|
|
88
|
+
*
|
|
89
|
+
* @see https://ngwr.dev/guides/testing
|
|
90
|
+
*/
|
|
91
|
+
declare class WrShinyTextHarness extends ComponentHarness {
|
|
92
|
+
static hostSelector: string;
|
|
93
|
+
/** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */
|
|
94
|
+
static with(options?: WrShinyTextHarnessFilters): HarnessPredicate<WrShinyTextHarness>;
|
|
95
|
+
/** The rendered text, trimmed. It is a text node on the host — there is no inner span. */
|
|
96
|
+
getText(): Promise<string>;
|
|
97
|
+
/**
|
|
98
|
+
* The whole stripe gradient the component computed, as written.
|
|
99
|
+
*
|
|
100
|
+
* Unresolved on purpose. With no `[color]` / `[shineColor]` given this string contains
|
|
101
|
+
* the theme's own custom-property tokens rather than colours, and that is the working
|
|
102
|
+
* state, not a gap — resolving them would need the stylesheet, and the resolved answer
|
|
103
|
+
* would differ between a unit test and a browser.
|
|
104
|
+
*/
|
|
105
|
+
getGradient(): Promise<string>;
|
|
106
|
+
/**
|
|
107
|
+
* The gradient's angle in degrees, from `[spread]`.
|
|
108
|
+
*
|
|
109
|
+
* The only observable effect that input has, `numAttr` coercion included. Note the name
|
|
110
|
+
* is inherited vocabulary and describes the ANGLE, not the width of the bright stripe:
|
|
111
|
+
* the stop positions are hard-coded, so no input narrows the shine.
|
|
112
|
+
*/
|
|
113
|
+
getSpreadDegrees(): Promise<number>;
|
|
114
|
+
/**
|
|
115
|
+
* The colour outside the bright stripe — the 0% stop.
|
|
116
|
+
*
|
|
117
|
+
* The same colour fills 35%, 65% and 100%; only the 50% stop differs. Assert it next to
|
|
118
|
+
* {@link getShineColor}: a `[color]` that lands in the shine slot instead leaves a
|
|
119
|
+
* perfectly valid gradient that no longer shimmers.
|
|
120
|
+
*/
|
|
121
|
+
getBaseColor(): Promise<string>;
|
|
122
|
+
/** The highlight colour — the lone 50% stop the stripe is made of. */
|
|
123
|
+
getShineColor(): Promise<string>;
|
|
124
|
+
/**
|
|
125
|
+
* One full cycle in seconds — the sweep AND the pause after it.
|
|
126
|
+
*
|
|
127
|
+
* `[delay]` is not `animation-delay` and not a second animation: the keyframe reaches
|
|
128
|
+
* its end at 50% and holds, so the wait is bought by making the animation twice as long.
|
|
129
|
+
* That is why this reads `speed + delay` and why the method is named for the cycle
|
|
130
|
+
* rather than for the sweep.
|
|
131
|
+
*
|
|
132
|
+
* Read from the inline declaration rather than from computed style, so a missing binding
|
|
133
|
+
* is reported as missing instead of being answered from the stylesheet.
|
|
134
|
+
*/
|
|
135
|
+
getCycleDurationSeconds(): Promise<number>;
|
|
136
|
+
/**
|
|
137
|
+
* Whether the animation is stopped (`disabled`).
|
|
138
|
+
*
|
|
139
|
+
* Three names for one thing, which is why this method exists rather than a spec reading
|
|
140
|
+
* the class: the input is `disabled`, its JSDoc says "pause", and the DOM contract is
|
|
141
|
+
* `wr-shiny-text--paused`. Only the last of those is public API.
|
|
142
|
+
*/
|
|
143
|
+
isPaused(): Promise<boolean>;
|
|
144
|
+
/** Whether the opt-in reached the class the `:hover` rule needs. */
|
|
145
|
+
pausesOnHover(): Promise<boolean>;
|
|
146
|
+
/**
|
|
147
|
+
* Whether the stripe bounces instead of restarting (`yoyo`).
|
|
148
|
+
*
|
|
149
|
+
* Defaults to `false` here — the opposite of the same-named input on `wr-gradient-text`,
|
|
150
|
+
* which is worth pinning in a spec that uses both. Together with {@link getDirection}
|
|
151
|
+
* this is the whole four-way matrix the stylesheet derives `animation-direction` from.
|
|
152
|
+
*/
|
|
153
|
+
isYoyo(): Promise<boolean>;
|
|
154
|
+
/** Which way the stripe travels — `'left'` is the absence of the reverse modifier. */
|
|
155
|
+
getDirection(): Promise<WrShinyTextSweepDirection>;
|
|
156
|
+
/** The five stops of the stripe, positions attached, in gradient order. */
|
|
157
|
+
private gradientStops;
|
|
158
|
+
/** The gradient's arguments — the angle first, then the stops. */
|
|
159
|
+
private gradientArguments;
|
|
160
|
+
/** One of the host's two inline declarations, or a failure that says which one is missing. */
|
|
161
|
+
private require;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export { WrShinyTextHarness };
|
|
165
|
+
export type { WrShinyTextHarnessFilters, WrShinyTextSweepDirection };
|
package/types/ngwr-slider.d.ts
CHANGED
|
@@ -77,7 +77,22 @@ declare class WrSlider implements FormValueControl<WrSliderValue> {
|
|
|
77
77
|
/** Emitted on blur so a bound field can mark itself touched. */
|
|
78
78
|
readonly touch: _angular_core.OutputEmitterRef<void>;
|
|
79
79
|
protected readonly low: _angular_core.WritableSignal<number>;
|
|
80
|
+
/**
|
|
81
|
+
* The high thumb's cell. Its literal default stands in for `maxValue()`,
|
|
82
|
+
* which cannot be read at field-initialisation time — see `highSeeded` and
|
|
83
|
+
* the constructor effect.
|
|
84
|
+
*/
|
|
80
85
|
protected readonly high: _angular_core.WritableSignal<number>;
|
|
86
|
+
/**
|
|
87
|
+
* Whether `high` has ever been told a real value by the model.
|
|
88
|
+
*
|
|
89
|
+
* `<wr-slider range [min]="200" [max]="300" />` binds no value, so the model
|
|
90
|
+
* holds its own scalar default and the tuple branch below never runs: `high`
|
|
91
|
+
* kept the literal 100, which is not inside every `[min, max]`. The thumb
|
|
92
|
+
* rendered off the track and the first interaction committed `[low, 100]` —
|
|
93
|
+
* a value the slider itself calls out of range.
|
|
94
|
+
*/
|
|
95
|
+
private highSeeded;
|
|
81
96
|
protected readonly track: _angular_core.Signal<ElementRef<HTMLElement>>;
|
|
82
97
|
/**
|
|
83
98
|
* Ambient reading direction. Optional so a bare `TestBed` — or any consumer
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { BaseHarnessFilters, 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
|
+
|
|
10
|
+
/** Narrows which `<wr-sparkline>` a harness query matches. */
|
|
11
|
+
interface WrSparklineHarnessFilters extends BaseHarnessFilters {
|
|
12
|
+
/** Match the sparkline's accessible name — `null` for the decorative ones. */
|
|
13
|
+
readonly ariaLabel?: string | RegExp;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @license
|
|
18
|
+
*
|
|
19
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
20
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Test harness for `<wr-sparkline>`.
|
|
25
|
+
*
|
|
26
|
+
* **The interesting assertion here is the ARIA one.** A sparkline is a trend line
|
|
27
|
+
* with no axes and no labels, so it is either given an `ariaLabel` — in which case it
|
|
28
|
+
* announces itself as an image — or it is decoration, and must be `aria-hidden` so a
|
|
29
|
+
* screen reader does not stop on a nameless graphic. The component switches between
|
|
30
|
+
* those two states on one input, and {@link isDecorative} is how a spec pins which
|
|
31
|
+
* one it is in.
|
|
32
|
+
*
|
|
33
|
+
* The line itself is an SVG path, and a path's `d` is not something a spec should
|
|
34
|
+
* assert: it is a rendering detail that changes with the viewBox, the stroke width
|
|
35
|
+
* and the smoothing. What IS worth asserting is whether the parts are there —
|
|
36
|
+
* {@link hasLine}, {@link hasArea}, {@link hasTip} — since each is an input the
|
|
37
|
+
* consumer set, and an empty dataset draws none of them.
|
|
38
|
+
*
|
|
39
|
+
* @see https://ngwr.dev/guides/testing
|
|
40
|
+
*/
|
|
41
|
+
declare class WrSparklineHarness extends ComponentHarness {
|
|
42
|
+
static hostSelector: string;
|
|
43
|
+
/** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */
|
|
44
|
+
static with(options?: WrSparklineHarnessFilters): HarnessPredicate<WrSparklineHarness>;
|
|
45
|
+
private readonly svg;
|
|
46
|
+
/** The name the chart announces, or `null` when it is decoration. */
|
|
47
|
+
getAccessibleName(): Promise<string | null>;
|
|
48
|
+
/** The role the chart claims — `img` when it is named, `null` when it is not. */
|
|
49
|
+
getRole(): Promise<string | null>;
|
|
50
|
+
/**
|
|
51
|
+
* Whether the chart is hidden from assistive tech.
|
|
52
|
+
*
|
|
53
|
+
* The other half of {@link getAccessibleName}, and the pairing worth asserting
|
|
54
|
+
* together: a named sparkline must NOT be hidden, and an unnamed one must be, or a
|
|
55
|
+
* screen reader announces a graphic with nothing to say about it.
|
|
56
|
+
*/
|
|
57
|
+
isDecorative(): Promise<boolean>;
|
|
58
|
+
/** Whether a trend line was drawn — `false` for an empty or single-point dataset. */
|
|
59
|
+
hasLine(): Promise<boolean>;
|
|
60
|
+
/** Whether the area under the line is filled (`showArea`). */
|
|
61
|
+
hasArea(): Promise<boolean>;
|
|
62
|
+
/** Whether the last point is marked with a dot (`showTip`). */
|
|
63
|
+
hasTip(): Promise<boolean>;
|
|
64
|
+
/** The stroke colour as the component passed it through — a CSS value, not a resolved one. */
|
|
65
|
+
getColor(): Promise<string | null>;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export { WrSparklineHarness };
|
|
69
|
+
export type { WrSparklineHarnessFilters };
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { BaseHarnessFilters, ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';
|
|
2
|
+
import { WrSpeedDialDirection } from 'ngwr/speed-dial';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @license
|
|
6
|
+
*
|
|
7
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
8
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/** Narrows which `<wr-speed-dial>` a harness query matches. */
|
|
12
|
+
interface WrSpeedDialHarnessFilters extends BaseHarnessFilters {
|
|
13
|
+
/** Match the trigger's accessible name — a string is an exact match, a RegExp is tested. */
|
|
14
|
+
readonly triggerLabel?: string | RegExp;
|
|
15
|
+
/** Match the direction the actions fan out. */
|
|
16
|
+
readonly direction?: WrSpeedDialDirection;
|
|
17
|
+
/** Match only open (`true`) or only closed (`false`) dials. */
|
|
18
|
+
readonly open?: boolean;
|
|
19
|
+
/** Match only enabled (`false`) or only disabled (`true`) dials. */
|
|
20
|
+
readonly disabled?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/** Narrows which action inside a speed dial a harness query matches. */
|
|
23
|
+
interface WrSpeedDialActionHarnessFilters extends BaseHarnessFilters {
|
|
24
|
+
/** Match the action's accessible name — a string is an exact match, a RegExp is tested. */
|
|
25
|
+
readonly label?: string | RegExp;
|
|
26
|
+
/** Match only enabled (`false`) or only disabled (`true`) actions. */
|
|
27
|
+
readonly disabled?: boolean;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @license
|
|
32
|
+
*
|
|
33
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
34
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Test harness for one action inside a {@link WrSpeedDialHarness}.
|
|
39
|
+
*
|
|
40
|
+
* The label is read from `aria-label` rather than from the button's text, and that
|
|
41
|
+
* is the whole point of the control: an action renders an ICON, or — with no icon —
|
|
42
|
+
* the first glyph of its label. Its visible text is therefore `"S"` for "Share", or
|
|
43
|
+
* nothing at all. {@link getInitial} answers what is drawn; {@link getLabel} answers
|
|
44
|
+
* what it is.
|
|
45
|
+
*
|
|
46
|
+
* @see https://ngwr.dev/guides/testing
|
|
47
|
+
*/
|
|
48
|
+
declare class WrSpeedDialActionHarness extends ComponentHarness {
|
|
49
|
+
/** The action button. `role="menuitem"` sits on this element too. */
|
|
50
|
+
static hostSelector: string;
|
|
51
|
+
/** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */
|
|
52
|
+
static with(options?: WrSpeedDialActionHarnessFilters): HarnessPredicate<WrSpeedDialActionHarness>;
|
|
53
|
+
/** The action's accessible name — what a screen reader reads, and what `title` shows. */
|
|
54
|
+
getLabel(): Promise<string | null>;
|
|
55
|
+
/** The role the action announces — `menuitem`. */
|
|
56
|
+
getRole(): Promise<string | null>;
|
|
57
|
+
/** Whether the action draws an icon rather than a letter. */
|
|
58
|
+
hasIcon(): Promise<boolean>;
|
|
59
|
+
/** The icon's registered name, from `wr-icon`'s reflected `data-icon`, or `null`. */
|
|
60
|
+
getIconName(): Promise<string | null>;
|
|
61
|
+
/**
|
|
62
|
+
* The single glyph drawn in place of a missing icon, or `null` when there is one.
|
|
63
|
+
*
|
|
64
|
+
* A GLYPH, not a character: the component splits the label by code point, so an
|
|
65
|
+
* emoji label draws the whole emoji rather than the broken half of a surrogate pair.
|
|
66
|
+
*/
|
|
67
|
+
getInitial(): Promise<string | null>;
|
|
68
|
+
/**
|
|
69
|
+
* Whether the action refuses interaction.
|
|
70
|
+
*
|
|
71
|
+
* Every action follows the DIAL's `disabled` — there is no per-action flag — so
|
|
72
|
+
* this is really "is the dial disabled", asked at the action. Worth having anyway:
|
|
73
|
+
* it is what the DOM and the CDK consult before delivering a click.
|
|
74
|
+
*/
|
|
75
|
+
isDisabled(): Promise<boolean>;
|
|
76
|
+
/** Pick this action — emitting `pick` and closing the dial. */
|
|
77
|
+
click(): Promise<void>;
|
|
78
|
+
/** Move keyboard focus to the action. */
|
|
79
|
+
focus(): Promise<void>;
|
|
80
|
+
/** Whether the action currently holds focus. */
|
|
81
|
+
isFocused(): Promise<boolean>;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* @license
|
|
86
|
+
*
|
|
87
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
88
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
89
|
+
*/
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Test harness for `<wr-speed-dial>` — the floating trigger and the actions that fan
|
|
93
|
+
* out of it.
|
|
94
|
+
*
|
|
95
|
+
* **The actions never leave the DOM.** They are hidden with `visibility`, which is
|
|
96
|
+
* what actually takes them out of the tab order and the accessibility tree —
|
|
97
|
+
* `opacity: 0` alone would leave them focusable — and CSS is exactly what a unit
|
|
98
|
+
* test does not have. So a closed dial's buttons are queryable, clickable and
|
|
99
|
+
* readable from a spec while being unreachable in a browser. {@link getActions} and
|
|
100
|
+
* {@link pick} therefore REFUSE while the dial is closed rather than answering with
|
|
101
|
+
* elements nobody can see; open it first, which is what a user has to do too.
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```ts
|
|
105
|
+
* const dial = await loader.getHarness(WrSpeedDialHarness);
|
|
106
|
+
*
|
|
107
|
+
* await dial.open();
|
|
108
|
+
* expect(await dial.getActionLabels()).toEqual(['Share', 'Copy link']);
|
|
109
|
+
*
|
|
110
|
+
* await dial.pick({ label: 'Share' });
|
|
111
|
+
* expect(await dial.isOpen()).toBe(false);
|
|
112
|
+
* ```
|
|
113
|
+
*
|
|
114
|
+
* @see https://ngwr.dev/guides/testing
|
|
115
|
+
*/
|
|
116
|
+
declare class WrSpeedDialHarness extends ComponentHarness {
|
|
117
|
+
static hostSelector: string;
|
|
118
|
+
/** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */
|
|
119
|
+
static with(options?: WrSpeedDialHarnessFilters): HarnessPredicate<WrSpeedDialHarness>;
|
|
120
|
+
private readonly trigger;
|
|
121
|
+
private readonly menu;
|
|
122
|
+
/** Whether the dial is fanned out, from the trigger's `aria-expanded`. */
|
|
123
|
+
isOpen(): Promise<boolean>;
|
|
124
|
+
/** The direction the actions travel, from the host modifier. */
|
|
125
|
+
getDirection(): Promise<WrSpeedDialDirection>;
|
|
126
|
+
/**
|
|
127
|
+
* The trigger's accessible name.
|
|
128
|
+
*
|
|
129
|
+
* The trigger is icon-only, so this is its ONLY name — there is no text to fall
|
|
130
|
+
* back on, and a dial that loses it is announced as an unnamed button.
|
|
131
|
+
*/
|
|
132
|
+
getTriggerLabel(): Promise<string | null>;
|
|
133
|
+
/** The trigger icon's registered name, from `wr-icon`'s reflected `data-icon`. */
|
|
134
|
+
getTriggerIcon(): Promise<string | null>;
|
|
135
|
+
/** Whether the dial refuses interaction, from the trigger's own `disabled` property. */
|
|
136
|
+
isDisabled(): Promise<boolean>;
|
|
137
|
+
/** Whether the host is padded for the device's safe area (`safeArea`). */
|
|
138
|
+
hasSafeArea(): Promise<boolean>;
|
|
139
|
+
/** The role the action list announces — `menu`. */
|
|
140
|
+
getMenuRole(): Promise<string | null>;
|
|
141
|
+
/**
|
|
142
|
+
* Whether the trigger's `aria-controls` names THIS dial's menu, and nothing else on
|
|
143
|
+
* the page.
|
|
144
|
+
*
|
|
145
|
+
* Both halves matter. The id is resolved inside the host first, so a trigger
|
|
146
|
+
* pointing at a SIBLING dial's menu — which resolves perfectly well from the
|
|
147
|
+
* document — fails here. Then it is counted across the document, because two menus
|
|
148
|
+
* answering to one id hand every reference to whichever comes first.
|
|
149
|
+
*/
|
|
150
|
+
isMenuBound(): Promise<boolean>;
|
|
151
|
+
/**
|
|
152
|
+
* The actions, in DOM order.
|
|
153
|
+
*
|
|
154
|
+
* Throws while the dial is closed. The buttons are still in the DOM then — they
|
|
155
|
+
* have to be, for the fan-out to animate — and jsdom applies no `visibility`, so
|
|
156
|
+
* they would come back looking perfectly reachable when a real user cannot tab to
|
|
157
|
+
* one. A spec that read them closed would pass on a dial that never opens.
|
|
158
|
+
*/
|
|
159
|
+
getActions(filters?: WrSpeedDialActionHarnessFilters): Promise<WrSpeedDialActionHarness[]>;
|
|
160
|
+
/** The accessible names of the actions, in DOM order. Throws while closed. */
|
|
161
|
+
getActionLabels(): Promise<(string | null)[]>;
|
|
162
|
+
/** How many actions the dial holds — readable while closed, since it is not a reach. */
|
|
163
|
+
getActionCount(): Promise<number>;
|
|
164
|
+
/** Open the dial. An already-open one is left alone; a disabled one throws. */
|
|
165
|
+
open(): Promise<void>;
|
|
166
|
+
/** Close the dial. An already-closed one is left alone. */
|
|
167
|
+
close(): Promise<void>;
|
|
168
|
+
/** Click the trigger once, whichever way that takes it. */
|
|
169
|
+
toggle(): Promise<void>;
|
|
170
|
+
/**
|
|
171
|
+
* Pick the first action matching the filters — emitting `pick` and closing the dial.
|
|
172
|
+
*
|
|
173
|
+
* Opens first if it has to, the way `WrDropdownHarness.clickItem` does: a spec that
|
|
174
|
+
* says "pick Share" means the whole gesture. Throws when nothing matches, naming
|
|
175
|
+
* what the dial does offer.
|
|
176
|
+
*/
|
|
177
|
+
pick(filters: WrSpeedDialActionHarnessFilters): Promise<void>;
|
|
178
|
+
/**
|
|
179
|
+
* Press Escape — closing the dial and putting focus back on the trigger.
|
|
180
|
+
*
|
|
181
|
+
* Sent to the host, which is where the component listens. The focus return is the
|
|
182
|
+
* half worth asserting: `role="menu"` promises a way out, and the actions are
|
|
183
|
+
* ordinary tab stops, so without it a keyboard user has to walk through every
|
|
184
|
+
* action to leave.
|
|
185
|
+
*/
|
|
186
|
+
sendEscape(): Promise<void>;
|
|
187
|
+
/** Move keyboard focus to the trigger. */
|
|
188
|
+
focusTrigger(): Promise<void>;
|
|
189
|
+
/** Whether the trigger currently holds focus. */
|
|
190
|
+
isTriggerFocused(): Promise<boolean>;
|
|
191
|
+
private requireOpen;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export { WrSpeedDialActionHarness, WrSpeedDialHarness };
|
|
195
|
+
export type { WrSpeedDialActionHarnessFilters, WrSpeedDialHarnessFilters };
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { BaseHarnessFilters, 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
|
+
|
|
10
|
+
/** Narrows which `<wr-splash-cursor>` a harness query matches. */
|
|
11
|
+
interface WrSplashCursorHarnessFilters extends BaseHarnessFilters {
|
|
12
|
+
/**
|
|
13
|
+
* Match only the page-wide overlay (`true`) or only a box-contained effect (`false`).
|
|
14
|
+
* The component has no name and no content, so its layout mode is the only thing that
|
|
15
|
+
* distinguishes two of them — see `WrSplashCursorHarness.isFullscreen`.
|
|
16
|
+
*/
|
|
17
|
+
readonly fullscreen?: boolean;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @license
|
|
22
|
+
*
|
|
23
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
24
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Test harness for `<wr-splash-cursor>` — a WebGL fluid that splashes dye under the
|
|
29
|
+
* pointer.
|
|
30
|
+
*
|
|
31
|
+
* **This is a deliberately small surface, and the reason is the component.** The
|
|
32
|
+
* simulation is GL programs and framebuffers driven by `window` pointer listeners; the
|
|
33
|
+
* layout is `position: fixed`, `inset: 0`, `z-index: 50` and a `100dvh` canvas, all of
|
|
34
|
+
* it in the stylesheet. A unit test gets no WebGL context — the simulation is never
|
|
35
|
+
* constructed — and loads no stylesheet, so asking `getCssValue('position')` would
|
|
36
|
+
* answer `static` about a component whose whole layout contract is `fixed`. Three
|
|
37
|
+
* questions survive that, and they are the three below.
|
|
38
|
+
*
|
|
39
|
+
* There is no `isSimulating()`, `getSplatCount()` or `splat()`: the simulation returns
|
|
40
|
+
* `null` the moment the context is refused, so every one of those would report on
|
|
41
|
+
* something that was never built. No `moveMouse()` either — the listeners live on
|
|
42
|
+
* `window` and are only attached once a context exists, so a dispatched move reaches
|
|
43
|
+
* nothing. And no `isReducedMotion()` or `hasWebGL()`: the component renders
|
|
44
|
+
* byte-identical DOM whether it is running, standing down for reduced motion, or on a
|
|
45
|
+
* machine with no WebGL at all, so any answer would be the same for a working component
|
|
46
|
+
* and a broken one.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* const splash = await loader.getHarness(WrSplashCursorHarness);
|
|
51
|
+
*
|
|
52
|
+
* expect(await splash.isFullscreen()).toBe(true);
|
|
53
|
+
* expect(await splash.isDecorative()).toBe(true);
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* @see https://ngwr.dev/guides/testing
|
|
57
|
+
*/
|
|
58
|
+
declare class WrSplashCursorHarness extends ComponentHarness {
|
|
59
|
+
static hostSelector: string;
|
|
60
|
+
/** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */
|
|
61
|
+
static with(options?: WrSplashCursorHarnessFilters): HarnessPredicate<WrSplashCursorHarness>;
|
|
62
|
+
/**
|
|
63
|
+
* Whether the effect covers the whole viewport, rather than filling the nearest
|
|
64
|
+
* positioned ancestor.
|
|
65
|
+
*
|
|
66
|
+
* The component's one behavioural switch: fullscreen is a fixed, click-through
|
|
67
|
+
* overlay above the page, contained is an absolutely positioned box whose walls the
|
|
68
|
+
* dye collides with. Note what is being read — there is no `--fullscreen` class, only
|
|
69
|
+
* a `--contained` one written from a NEGATED binding, so this method answers the
|
|
70
|
+
* absence of a class. That inversion is exactly the kind that gets flipped in a
|
|
71
|
+
* refactor and looks fine on a page where the effect is full-viewport anyway, which
|
|
72
|
+
* is the whole reason the method exists.
|
|
73
|
+
*/
|
|
74
|
+
isFullscreen(): Promise<boolean>;
|
|
75
|
+
/**
|
|
76
|
+
* Whether the effect is hidden from assistive tech.
|
|
77
|
+
*
|
|
78
|
+
* It has no text and nothing to say, and at full size it sits in front of the entire
|
|
79
|
+
* page — so losing this puts a nameless graphic over everything a screen reader is
|
|
80
|
+
* trying to get through.
|
|
81
|
+
*/
|
|
82
|
+
isDecorative(): Promise<boolean>;
|
|
83
|
+
/**
|
|
84
|
+
* Whether the drawing surface is in the markup.
|
|
85
|
+
*
|
|
86
|
+
* It is there in all three states where nothing is ever drawn on it — prerendered on
|
|
87
|
+
* the server, WebGL refused, or reduced motion — because the documented contract is
|
|
88
|
+
* that the component renders nothing VISIBLE and stops, never that it renders no
|
|
89
|
+
* element and never that it throws on a null context.
|
|
90
|
+
*/
|
|
91
|
+
hasCanvas(): Promise<boolean>;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export { WrSplashCursorHarness };
|
|
95
|
+
export type { WrSplashCursorHarnessFilters };
|