@eui/ecl 22.0.0-alpha.37 → 22.0.0-alpha.39
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/docs/changelog.html +28 -0
- package/docs/components/EclSloganTickerComponent.html +38 -2
- package/docs/components/EclSocialMediaFollowItemComponent.html +2 -2
- package/docs/directives/EclSocialMediaFollowLinkDirective.html +12 -47
- package/docs/js/search/search_index.js +2 -2
- package/docs/json/EclSloganTickerComponent.md +47 -2
- package/docs/json/EclSocialMediaFollowItemComponent.md +1 -1
- package/docs/json/documentation.json +74 -98
- package/docs/llms.txt +3 -3
- package/docs/properties.html +1 -1
- package/fesm2022/eui-ecl-components-ecl-slogan-ticker.mjs +53 -2
- package/fesm2022/eui-ecl-components-ecl-slogan-ticker.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-social-media-follow.mjs +13 -14
- package/fesm2022/eui-ecl-components-ecl-social-media-follow.mjs.map +1 -1
- package/package.json +1 -1
- package/types/eui-ecl-components-ecl-slogan-ticker.d.ts +53 -2
- package/types/eui-ecl-components-ecl-slogan-ticker.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-social-media-follow.d.ts +3 -4
- package/types/eui-ecl-components-ecl-social-media-follow.d.ts.map +1 -1
|
@@ -11,8 +11,53 @@ when off-screen via IntersectionObserver.
|
|
|
11
11
|
Uses Embla Carousel (via embla-carousel-angular) with the auto-scroll plugin
|
|
12
12
|
to match the ECL vanilla implementation.
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
## Why two lists (hidden source + generated track)
|
|
15
|
+
|
|
16
|
+
The consumer provides a plain, semantic list:
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<ecl-slogan-ticker>
|
|
20
|
+
<ul eclSloganTickerList>
|
|
21
|
+
<li eclSloganTickerSlide>SLOGAN ONE</li>
|
|
22
|
+
<li eclSloganTickerSlide>SLOGAN TWO</li>
|
|
23
|
+
</ul>
|
|
24
|
+
</ecl-slogan-ticker>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
This authored `<ul eclSloganTickerList>` is NOT the list you see scrolling.
|
|
28
|
+
`EclSloganTickerListDirective` hides it with `display: none`, and it stays in
|
|
29
|
+
the light DOM as the single accessible source of truth. The component reads
|
|
30
|
+
the slide texts out of it via a `contentChildren` query (see `slides`) and
|
|
31
|
+
builds a SEPARATE, component-owned `<ul class="ecl-slogan-ticker__track">`
|
|
32
|
+
from the `trackSlides` signal. That generated track is what Embla animates.
|
|
33
|
+
|
|
34
|
+
Reasons for the split (rather than just scrolling the authored `<ul>`):
|
|
35
|
+
|
|
36
|
+
- Seamless infinite loop needs more content than the author gives. The track
|
|
37
|
+
must be several times wider than the viewport or the loop visibly jumps, so
|
|
38
|
+
`ensureEnoughContent()` measures the originals and appends CLONE sets until
|
|
39
|
+
the total width reaches `CLONE_MULTIPLIER` × the container width.
|
|
40
|
+
- Clones must not pollute accessibility. The authored list stays the one
|
|
41
|
+
accessible list; every generated clone is rendered with `aria-hidden` so a
|
|
42
|
+
screen reader announces each slogan once, not once per clone.
|
|
43
|
+
- You cannot meaningfully grow the authored `<ul>`. Its `<li>` children are
|
|
44
|
+
Angular-projected content that Angular owns; imperatively appending clone
|
|
45
|
+
`<li>` nodes into it fights change detection. Building our own track signal
|
|
46
|
+
and letting `@for` render it is clean and safe. `<li>` is also only valid
|
|
47
|
+
inside a list element, so the `<ul eclSloganTickerList>` wrapper keeps the
|
|
48
|
+
consumer's authored markup valid and self-contained.
|
|
49
|
+
|
|
50
|
+
This mirrors the vanilla ECL slogan ticker (hidden source list + measured,
|
|
51
|
+
cloned, auto-scrolling track).
|
|
52
|
+
|
|
53
|
+
## Testing note
|
|
54
|
+
|
|
55
|
+
The visible track is only built after a real width measurement
|
|
56
|
+
(`offsetWidth`). Under jsdom every element reports a width of 0, so
|
|
57
|
+
`ensureEnoughContent()` bails early and the generated track stays empty. Unit
|
|
58
|
+
tests should therefore assert slide-driven behavior through its observable
|
|
59
|
+
effects (e.g. the play/pause controls appearing) rather than through the
|
|
60
|
+
generated track DOM.
|
|
16
61
|
|
|
17
62
|
|
|
18
63
|
**Selector:** `ecl-slogan-ticker`
|