@eldrajs/theme-cli 0.2.4 → 0.2.5
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/CHANGELOG.md +4 -0
- package/README.md +6 -0
- package/dist/cli.js +8 -2
- package/dist/index.d.ts +6 -0
- package/dist/index.js +1 -1
- package/dist/{validate-FjQ-5_ne.js → validate-CC6Mp5i_.js} +2 -1
- package/package.json +3 -3
- package/template/.eldra/previews.json +35 -35
- package/template/README.md +3 -1
- package/template/app/app.vue +1 -3
- package/template/app/assets/main.css +13 -15
- package/template/app/components/ui/UiImage.vue +29 -17
- package/template/app/components/ui/__tests__/UiImage.spec.ts +24 -15
- package/template/app/pages/[...slug].vue +1 -1
- package/template/blocks/announcement-bar/Block.vue +3 -2
- package/template/blocks/announcement-bar/__tests__/Block.spec.ts +1 -1
- package/template/blocks/article/Block.vue +3 -4
- package/template/blocks/article-list/Block.vue +18 -9
- package/template/blocks/breadcrumbs/Block.vue +1 -1
- package/template/blocks/breadcrumbs/__tests__/Block.spec.ts +9 -9
- package/template/blocks/cart/Block.vue +1 -1
- package/template/blocks/cart/parts/CartLines.vue +3 -2
- package/template/blocks/cart/parts/ShippingBar.vue +1 -1
- package/template/blocks/cart/parts/Summary.vue +5 -9
- package/template/blocks/collection-grid/Block.vue +11 -14
- package/template/blocks/collection-grid/__tests__/Block.spec.ts +12 -14
- package/template/blocks/collection-header/Block.vue +5 -5
- package/template/blocks/contact/Block.vue +1 -1
- package/template/blocks/contact/__tests__/Block.spec.ts +2 -2
- package/template/blocks/cta/Block.vue +16 -18
- package/template/blocks/cta/__tests__/Block.spec.ts +8 -12
- package/template/blocks/faq/Block.vue +3 -13
- package/template/blocks/faq/__tests__/Block.spec.ts +2 -2
- package/template/blocks/feature-grid/Block.vue +1 -1
- package/template/blocks/feature-grid/__tests__/Block.spec.ts +1 -1
- package/template/blocks/footer/Block.vue +14 -11
- package/template/blocks/footer/__tests__/Block.spec.ts +5 -5
- package/template/blocks/form/Block.vue +1 -1
- package/template/blocks/gallery/__tests__/Block.spec.ts +1 -1
- package/template/blocks/hero/Block.vue +8 -11
- package/template/blocks/hero/__tests__/Block.spec.ts +9 -7
- package/template/blocks/image/Block.vue +4 -4
- package/template/blocks/image/__tests__/Block.spec.ts +5 -6
- package/template/blocks/logo-cloud/__tests__/Block.spec.ts +1 -1
- package/template/blocks/navigation/Block.vue +16 -26
- package/template/blocks/navigation/__tests__/Block.spec.ts +22 -20
- package/template/blocks/newsletter/__tests__/Block.spec.ts +1 -1
- package/template/blocks/order-status/Block.vue +8 -9
- package/template/blocks/order-status/__tests__/Block.spec.ts +1 -2
- package/template/blocks/pricing-table/__tests__/Block.spec.ts +1 -1
- package/template/blocks/product-carousel/Block.vue +6 -6
- package/template/blocks/product-carousel/__tests__/Block.spec.ts +26 -8
- package/template/blocks/product-detail/Block.vue +8 -8
- package/template/blocks/product-detail/__tests__/Block.spec.ts +1 -1
- package/template/blocks/product-detail/parts/Gallery.vue +1 -1
- package/template/blocks/quote/Block.vue +1 -1
- package/template/blocks/quote/__tests__/Block.spec.ts +7 -4
- package/template/blocks/search/Block.vue +2 -2
- package/template/blocks/search/PopularChips.vue +1 -1
- package/template/blocks/split-content/Block.vue +2 -3
- package/template/blocks/split-content/__tests__/Block.spec.ts +2 -2
- package/template/blocks/stats/__tests__/Block.spec.ts +1 -1
- package/template/blocks/tabs/Block.vue +4 -5
- package/template/blocks/tabs/__tests__/Block.spec.ts +2 -2
- package/template/blocks/testimonials/Block.vue +10 -9
- package/template/blocks/testimonials/__tests__/Block.spec.ts +1 -1
- package/template/blocks/timeline/__tests__/Block.spec.ts +2 -2
- package/template/blocks/trust-strip/Block.vue +1 -1
- package/template/blocks/trust-strip/__tests__/Block.spec.ts +1 -1
- package/template/blocks/video-embed/Block.vue +3 -3
- package/template/blocks/video-embed/__tests__/Block.spec.ts +1 -1
- package/template/blocks/wishlist/Block.vue +1 -1
- package/template/nuxt.config.ts +5 -4
- package/template/package.json +1 -0
- package/template/stories/pages/article.stories.ts +2 -3
- package/template/stories/pages/cart.stories.ts +2 -3
- package/template/stories/pages/category.stories.ts +2 -3
- package/template/stories/pages/collection.stories.ts +2 -3
- package/template/stories/pages/home.stories.ts +2 -3
- package/template/stories/pages/product.stories.ts +3 -4
- package/template/stories/pages/products.stories.ts +2 -3
- package/template/stories/pages/search.stories.ts +2 -3
- package/template/stories/pages/wishlist.stories.ts +2 -3
- package/template/test/carouselKeyboard.spec.ts +2 -2
- package/template/test/carouselRing.browser.spec.ts +2 -2
- package/template/test/carouselSlideWidth.browser.spec.ts +9 -9
- package/template/test/eldraIcon.spec.ts +1 -1
- package/template/test/mainCss.spec.ts +7 -0
- package/template/test/pages/article.spec.ts +5 -5
- package/template/test/pages/collection.spec.ts +5 -5
- package/template/test/pages/hydration.spec.ts +10 -10
- package/template/test/prerenderRefresh.browser.spec.ts +1 -1
- package/template/test/support/mountPage.ts +2 -3
package/template/package.json
CHANGED
|
@@ -29,9 +29,8 @@ const ArticlePage = defineComponent({
|
|
|
29
29
|
href: '#main',
|
|
30
30
|
as: EldraRouterLink,
|
|
31
31
|
variant: 'standalone',
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
},
|
|
32
|
+
class:
|
|
33
|
+
'bg-primary text-primary-contrast rounded-md sr-only px-4 py-2 focus:not-sr-only focus:fixed focus:top-4 focus:left-4 focus:z-50',
|
|
35
34
|
},
|
|
36
35
|
{ default: () => t('nav.skipToContent') }
|
|
37
36
|
),
|
|
@@ -34,9 +34,8 @@ const CartPage = defineComponent({
|
|
|
34
34
|
href: '#main',
|
|
35
35
|
as: EldraRouterLink,
|
|
36
36
|
variant: 'standalone',
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
},
|
|
37
|
+
class:
|
|
38
|
+
'bg-primary text-primary-contrast rounded-md sr-only px-4 py-2 focus:not-sr-only focus:fixed focus:top-4 focus:left-4 focus:z-50',
|
|
40
39
|
},
|
|
41
40
|
() => t('nav.skipToContent')
|
|
42
41
|
),
|
|
@@ -34,9 +34,8 @@ const CategoryPage = defineComponent({
|
|
|
34
34
|
href: '#main',
|
|
35
35
|
as: EldraRouterLink,
|
|
36
36
|
variant: 'standalone',
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
},
|
|
37
|
+
class:
|
|
38
|
+
'bg-primary text-primary-contrast rounded-md sr-only px-4 py-2 focus:not-sr-only focus:fixed focus:top-4 focus:left-4 focus:z-50',
|
|
40
39
|
},
|
|
41
40
|
{ default: () => t('nav.skipToContent') }
|
|
42
41
|
),
|
|
@@ -29,9 +29,8 @@ const CollectionPage = defineComponent({
|
|
|
29
29
|
href: '#main',
|
|
30
30
|
as: EldraRouterLink,
|
|
31
31
|
variant: 'standalone',
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
},
|
|
32
|
+
class:
|
|
33
|
+
'bg-primary text-primary-contrast rounded-md sr-only px-4 py-2 focus:not-sr-only focus:fixed focus:top-4 focus:left-4 focus:z-50',
|
|
35
34
|
},
|
|
36
35
|
{ default: () => t('nav.skipToContent') }
|
|
37
36
|
),
|
|
@@ -29,9 +29,8 @@ const HomePage = defineComponent({
|
|
|
29
29
|
href: '#main',
|
|
30
30
|
as: EldraRouterLink,
|
|
31
31
|
variant: 'standalone',
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
},
|
|
32
|
+
class:
|
|
33
|
+
'bg-primary text-primary-contrast rounded-md sr-only px-4 py-2 focus:not-sr-only focus:fixed focus:top-4 focus:left-4 focus:z-50',
|
|
35
34
|
},
|
|
36
35
|
() => t('nav.skipToContent')
|
|
37
36
|
),
|
|
@@ -17,9 +17,8 @@ import { renderPageFixtureRegions, type PageFixture } from '../support/pageBlock
|
|
|
17
17
|
|
|
18
18
|
const fixture = productPage as unknown as PageFixture;
|
|
19
19
|
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
};
|
|
20
|
+
const SKIP_LINK_CLASS =
|
|
21
|
+
'bg-primary text-primary-contrast rounded-md sr-only px-4 py-2 focus:not-sr-only focus:fixed focus:top-4 focus:left-4 focus:z-50';
|
|
23
22
|
|
|
24
23
|
const ProductPage = defineComponent({
|
|
25
24
|
name: 'ProductPageStory',
|
|
@@ -28,7 +27,7 @@ const ProductPage = defineComponent({
|
|
|
28
27
|
return () => [
|
|
29
28
|
h(
|
|
30
29
|
Link,
|
|
31
|
-
{ href: '#main', as: EldraRouterLink, variant: 'standalone',
|
|
30
|
+
{ href: '#main', as: EldraRouterLink, variant: 'standalone', class: SKIP_LINK_CLASS },
|
|
32
31
|
{ default: () => t('nav.skipToContent') }
|
|
33
32
|
),
|
|
34
33
|
...renderPageFixtureRegions(fixture, 'Pages/Product story'),
|
|
@@ -36,9 +36,8 @@ const ProductsPage = defineComponent({
|
|
|
36
36
|
href: '#main',
|
|
37
37
|
as: EldraRouterLink,
|
|
38
38
|
variant: 'standalone',
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
},
|
|
39
|
+
class:
|
|
40
|
+
'bg-primary text-primary-contrast rounded-md sr-only px-4 py-2 focus:not-sr-only focus:fixed focus:top-4 focus:left-4 focus:z-50',
|
|
42
41
|
},
|
|
43
42
|
() => t('nav.skipToContent')
|
|
44
43
|
),
|
|
@@ -32,9 +32,8 @@ const SearchPage = defineComponent({
|
|
|
32
32
|
href: '#main',
|
|
33
33
|
as: EldraRouterLink,
|
|
34
34
|
variant: 'standalone',
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
},
|
|
35
|
+
class:
|
|
36
|
+
'bg-primary text-primary-contrast rounded-md sr-only px-4 py-2 focus:not-sr-only focus:fixed focus:top-4 focus:left-4 focus:z-50',
|
|
38
37
|
},
|
|
39
38
|
() => t('nav.skipToContent')
|
|
40
39
|
),
|
|
@@ -31,9 +31,8 @@ const WishlistPage = defineComponent({
|
|
|
31
31
|
href: '#main',
|
|
32
32
|
as: EldraRouterLink,
|
|
33
33
|
variant: 'standalone',
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
},
|
|
34
|
+
class:
|
|
35
|
+
'bg-primary text-primary-contrast rounded-md sr-only px-4 py-2 focus:not-sr-only focus:fixed focus:top-4 focus:left-4 focus:z-50',
|
|
37
36
|
},
|
|
38
37
|
() => t('nav.skipToContent')
|
|
39
38
|
),
|
|
@@ -219,7 +219,7 @@ describe('hero split-carousel — linked and unlinked slides in one row', () =>
|
|
|
219
219
|
// Slide 1 holds no link, so the slide element itself is the stop — with the package's own
|
|
220
220
|
// focus ring, since it has no control of its own to bring one. Slide 2's link is parked.
|
|
221
221
|
expect(figures[0]?.getAttribute('tabindex')).toBe('0');
|
|
222
|
-
expect(figures[0]?.classList.contains('eldra-focus')).toBe(true);
|
|
222
|
+
expect(figures[0]?.classList.contains('eldra:eldra-focus')).toBe(true);
|
|
223
223
|
expect(tabbableIn(track(wrapper))).toEqual([figures[0]]);
|
|
224
224
|
|
|
225
225
|
press(figures[0]!, 'ArrowRight');
|
|
@@ -229,7 +229,7 @@ describe('hero split-carousel — linked and unlinked slides in one row', () =>
|
|
|
229
229
|
const link = figures[1]!.querySelector<HTMLElement>('a[href]')!;
|
|
230
230
|
expect(document.activeElement).toBe(link);
|
|
231
231
|
expect(figures[1]?.getAttribute('tabindex')).toBeNull();
|
|
232
|
-
expect(figures[1]?.classList.contains('eldra-focus')).toBe(false);
|
|
232
|
+
expect(figures[1]?.classList.contains('eldra:eldra-focus')).toBe(false);
|
|
233
233
|
expect(figures[0]?.getAttribute('tabindex')).toBe('-1');
|
|
234
234
|
expect(tabbableIn(track(wrapper))).toEqual([link]);
|
|
235
235
|
expect(await axe(wrapper.element)).toHaveNoViolations();
|
|
@@ -149,14 +149,14 @@ describe('a focused card in the product carousel', () => {
|
|
|
149
149
|
}
|
|
150
150
|
const state = await page.evaluate(() => {
|
|
151
151
|
const active = document.activeElement as HTMLElement;
|
|
152
|
-
const ringed = active.closest('.eldra-focus') as HTMLElement | null;
|
|
152
|
+
const ringed = active.closest('.eldra\\:eldra-focus') as HTMLElement | null;
|
|
153
153
|
return {
|
|
154
154
|
focusedTag: active.tagName,
|
|
155
155
|
focusVisible: active.matches(':focus-visible'),
|
|
156
156
|
// The ring is on the card, not on the focused link inside it: `eldra-focus-proxy`'s
|
|
157
157
|
// `:has(:focus-visible)` is what lights it from the link's own focus.
|
|
158
158
|
ringedPart: ringed?.getAttribute('data-part'),
|
|
159
|
-
ringedProxy: ringed?.classList.contains('eldra-focus-proxy'),
|
|
159
|
+
ringedProxy: ringed?.classList.contains('eldra:eldra-focus-proxy'),
|
|
160
160
|
alpha: ringed
|
|
161
161
|
? getComputedStyle(ringed).getPropertyValue('--eldra-focus-alpha').trim()
|
|
162
162
|
: null,
|
|
@@ -70,17 +70,17 @@ describe('a recently-viewed product carousel at 1440px, in a real browser', () =
|
|
|
70
70
|
|
|
71
71
|
it('shows more than one card, each exactly as wide as its slide, with the track gap kept between them', async () => {
|
|
72
72
|
const boxes = await page.evaluate(() => {
|
|
73
|
-
const track = document.querySelector<HTMLElement>('.eldra-carousel-track');
|
|
73
|
+
const track = document.querySelector<HTMLElement>('.eldra\\:eldra-carousel-track');
|
|
74
74
|
if (track === null) return null;
|
|
75
75
|
const gap = Number.parseFloat(getComputedStyle(track).columnGap);
|
|
76
|
-
const slides = Array.from(
|
|
77
|
-
(slide)
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
);
|
|
76
|
+
const slides = Array.from(
|
|
77
|
+
track.querySelectorAll<HTMLElement>('.eldra\\:eldra-carousel-slide')
|
|
78
|
+
).map((slide) => {
|
|
79
|
+
const card = slide.querySelector('article');
|
|
80
|
+
const s = slide.getBoundingClientRect();
|
|
81
|
+
const c = card?.getBoundingClientRect();
|
|
82
|
+
return { slide: { x: s.x, width: s.width }, card: c ? { x: c.x, width: c.width } : null };
|
|
83
|
+
});
|
|
84
84
|
return { gap, slides };
|
|
85
85
|
});
|
|
86
86
|
if (boxes === null) throw new Error('the carousel track never laid out');
|
|
@@ -27,7 +27,7 @@ describe('EldraIcon', () => {
|
|
|
27
27
|
const wrapper = mount(EldraIcon, { props: { name: 'lock' } });
|
|
28
28
|
await flushPromises();
|
|
29
29
|
const svg = wrapper.find('svg');
|
|
30
|
-
expect(svg.classes()).toContain('size-8');
|
|
30
|
+
expect(svg.classes()).toContain('eldra:size-8');
|
|
31
31
|
expect(svg.attributes('stroke-width')).toBe('1.75');
|
|
32
32
|
expect(svg.attributes('aria-hidden')).toBe('true');
|
|
33
33
|
});
|
|
@@ -41,6 +41,13 @@ describe('main.css', () => {
|
|
|
41
41
|
expect(mainCss).toMatch(/^@source\s+'\.\.\/\.\.\/blocks';/m);
|
|
42
42
|
});
|
|
43
43
|
|
|
44
|
+
it("ships the package's components prebuilt, below this file's own utilities", async () => {
|
|
45
|
+
const css = await build(['w-full']);
|
|
46
|
+
expect(mainCss).toMatch(/^@import '@eldrajs\/ui\/components\.css';$/m);
|
|
47
|
+
expect(css).toMatch(/@layer components\s*\{[^]*\.eldra\\:inline-flex/);
|
|
48
|
+
expect(css).toMatch(/^@layer theme, base, components, utilities;$/m);
|
|
49
|
+
});
|
|
50
|
+
|
|
44
51
|
it('emits the dialog backdrop from the overlay token', async () => {
|
|
45
52
|
const css = await build(['backdrop:bg-overlay']);
|
|
46
53
|
expect(css).toContain('::backdrop');
|
|
@@ -120,11 +120,11 @@ describe('article sample page', () => {
|
|
|
120
120
|
const roots = pageBlockRoots(wrapper);
|
|
121
121
|
const articleEl = roots[2]!;
|
|
122
122
|
|
|
123
|
-
const contentContainers = articleEl.querySelectorAll('.eldra-container-content');
|
|
124
|
-
const narrowContainers = articleEl.querySelectorAll('.eldra-container-narrow');
|
|
123
|
+
const contentContainers = articleEl.querySelectorAll('.eldra\\:eldra-container-content');
|
|
124
|
+
const narrowContainers = articleEl.querySelectorAll('.eldra\\:eldra-container-narrow');
|
|
125
125
|
expect(contentContainers.length).toBeGreaterThan(0);
|
|
126
126
|
expect(narrowContainers.length).toBeGreaterThan(0);
|
|
127
|
-
expect(articleEl.querySelectorAll('.eldra-container-wide')).toHaveLength(0);
|
|
127
|
+
expect(articleEl.querySelectorAll('.eldra\\:eldra-container-wide')).toHaveLength(0);
|
|
128
128
|
|
|
129
129
|
// The content container (header + cover) precedes the narrow one (body + author card).
|
|
130
130
|
const firstContent = contentContainers[0]!;
|
|
@@ -134,8 +134,8 @@ describe('article sample page', () => {
|
|
|
134
134
|
).toBeTruthy();
|
|
135
135
|
|
|
136
136
|
// The header/breadcrumbs stay on the 80rem wide container.
|
|
137
|
-
expect(roots[0]!.querySelector('.eldra-container-wide')).not.toBeNull();
|
|
138
|
-
expect(roots[1]!.querySelector('.eldra-container-wide')).not.toBeNull();
|
|
137
|
+
expect(roots[0]!.querySelector('.eldra\\:eldra-container-wide')).not.toBeNull();
|
|
138
|
+
expect(roots[1]!.querySelector('.eldra\\:eldra-container-wide')).not.toBeNull();
|
|
139
139
|
});
|
|
140
140
|
|
|
141
141
|
it('wraps the body table in a named, focusable region and marks its code block focusable', async () => {
|
|
@@ -125,12 +125,12 @@ describe('collection sample page', () => {
|
|
|
125
125
|
expect(grounds).toEqual([null, null, 'none', 'none', 'surface', 'surface-strong']);
|
|
126
126
|
|
|
127
127
|
// The grid starts directly under the collection header with its own short 1.5rem top padding
|
|
128
|
-
// (`pt-6
|
|
129
|
-
// padding on its `surface`
|
|
130
|
-
//
|
|
131
|
-
//
|
|
128
|
+
// (`pt-6`, hand-rolled rather than read from `Section`'s `spacing` prop — see the block's own
|
|
129
|
+
// top-of-file comment), and the call to action keeps a full band of padding on its `surface`
|
|
130
|
+
// ground (`Section`'s own `eldra:pt-[var(--eldra-section-md)]`), so this is what proves the
|
|
131
|
+
// page actually renders those values.
|
|
132
132
|
expect(gridEl!.classList.contains('pt-6')).toBe(true);
|
|
133
|
-
expect(ctaEl!.classList.contains('pt-[var(--eldra-section-md)]')).toBe(true);
|
|
133
|
+
expect(ctaEl!.classList.contains('eldra:pt-[var(--eldra-section-md)]')).toBe(true);
|
|
134
134
|
});
|
|
135
135
|
|
|
136
136
|
it('has exactly one h1 (the collection title) and one breadcrumb nav on the page', async () => {
|
|
@@ -144,15 +144,15 @@ const SUBJECTS: Subject[] = [
|
|
|
144
144
|
/**
|
|
145
145
|
* `@eldrajs/ui`'s `Carousel` decorates its slides **imperatively after mount** — `useCarousel.ts`
|
|
146
146
|
* `setAttribute`s `data-part="slide"`, `role="group"`, `aria-roledescription="slide"` and an
|
|
147
|
-
* "n of total" label onto whatever children the consumer passed, adds the
|
|
148
|
-
* sizing class, and writes the roving tab stop's `tabindex` (one stop
|
|
149
|
-
* active slide; every other slide's controls parked at `-1`) — precisely
|
|
150
|
-
* plain elements. That is a deliberate progressive enhancement of the
|
|
151
|
-
* server disagreed with (Vue reports no mismatch for any of it), and
|
|
152
|
-
* `product-carousel`'s row both go through it. The `tabindex` pass
|
|
153
|
-
* labelling: the server renders the pre-enhancement shape, the
|
|
154
|
-
* exactly, and the model only moves in `onMounted` afterwards —
|
|
155
|
-
* sides leaves the comparison below an honest one.
|
|
147
|
+
* "n of total" label onto whatever children the consumer passed, adds the
|
|
148
|
+
* `eldra:eldra-carousel-slide` sizing class, and writes the roving tab stop's `tabindex` (one stop
|
|
149
|
+
* for the whole row, on the active slide; every other slide's controls parked at `-1`) — precisely
|
|
150
|
+
* so a block can hand it plain elements. That is a deliberate progressive enhancement of the
|
|
151
|
+
* package's, not a render the server disagreed with (Vue reports no mismatch for any of it), and
|
|
152
|
+
* `product-detail`'s gallery and `product-carousel`'s row both go through it. The `tabindex` pass
|
|
153
|
+
* is the same kind of thing as the labelling: the server renders the pre-enhancement shape, the
|
|
154
|
+
* first client render matches it exactly, and the model only moves in `onMounted` afterwards —
|
|
155
|
+
* which is why removing it from both sides leaves the comparison below an honest one.
|
|
156
156
|
*
|
|
157
157
|
* **The `tabindex` removal is scoped to the carousel's own track**, through a parse rather than the
|
|
158
158
|
* regex the other four tokens use: `tabindex` is an ordinary attribute a block writes for itself —
|
|
@@ -163,7 +163,7 @@ const SUBJECTS: Subject[] = [
|
|
|
163
163
|
* Nothing in `blocks/**` writes any of the other four.
|
|
164
164
|
*/
|
|
165
165
|
const CAROUSEL_ENHANCEMENT =
|
|
166
|
-
/\s(?:data-part="slide"|role="group"|aria-roledescription="slide"|aria-label="\d+ of \d+")|\
|
|
166
|
+
/\s(?:data-part="slide"|role="group"|aria-roledescription="slide"|aria-label="\d+ of \d+")|\s(?:eldra:)?eldra-carousel-slide|(?:eldra:)?eldra-carousel-slide\s/g;
|
|
167
167
|
|
|
168
168
|
function withoutPackageEnhancement(html: string): string {
|
|
169
169
|
// Both halves go through the same parse, so any normalisation the parser does of its own
|
|
@@ -154,7 +154,7 @@ async function visit(path: string): Promise<Visit> {
|
|
|
154
154
|
samples.push(
|
|
155
155
|
await page.evaluate(() => ({
|
|
156
156
|
busy: document.querySelectorAll('[aria-busy="true"]').length,
|
|
157
|
-
dimmed: document.querySelectorAll('.eldra-revalidating').length,
|
|
157
|
+
dimmed: document.querySelectorAll('.eldra\\:eldra-revalidating').length,
|
|
158
158
|
spinners: document.querySelectorAll('[data-part="spinner"]').length,
|
|
159
159
|
announced: [...document.querySelectorAll('[role="status"]')].filter((node) =>
|
|
160
160
|
/Updating/i.test((node as HTMLElement).textContent ?? '')
|
|
@@ -91,9 +91,8 @@ export async function mountPageWithSkipLink(
|
|
|
91
91
|
href: '#main',
|
|
92
92
|
as: EldraRouterLink,
|
|
93
93
|
variant: 'standalone',
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
},
|
|
94
|
+
class:
|
|
95
|
+
'bg-primary text-primary-contrast rounded-md sr-only px-4 py-2 focus:not-sr-only focus:fixed focus:top-4 focus:left-4 focus:z-50',
|
|
97
96
|
},
|
|
98
97
|
() => t('nav.skipToContent')
|
|
99
98
|
),
|