@eldrajs/theme-cli 0.2.8 → 0.2.10

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 (165) hide show
  1. package/CHANGELOG.md +3 -1
  2. package/package.json +1 -1
  3. package/template/.eldra/block-types.d.ts +28 -7
  4. package/template/.eldra/manifest.json +1034 -355
  5. package/template/.eldra/previews.json +35 -35
  6. package/template/README.md +32 -0
  7. package/template/app/assets/main.css +23 -0
  8. package/template/app/plugins/eldra-storefront.ts +3 -0
  9. package/template/app/storefront/demo.ts +75 -24
  10. package/template/app/storefront/gateway.ts +16 -2
  11. package/template/blocks/announcement-bar/preview.png +0 -0
  12. package/template/blocks/article/preview.json +4 -4
  13. package/template/blocks/article/preview.png +0 -0
  14. package/template/blocks/article-list/Block.vue +48 -19
  15. package/template/blocks/article-list/__tests__/Block.spec.ts +15 -0
  16. package/template/blocks/article-list/preview.json +43 -43
  17. package/template/blocks/article-list/preview.png +0 -0
  18. package/template/blocks/breadcrumbs/preview.png +0 -0
  19. package/template/blocks/cart/preview.png +0 -0
  20. package/template/blocks/collection-grid/Block.vue +260 -9
  21. package/template/blocks/collection-grid/__tests__/Block.spec.ts +202 -0
  22. package/template/blocks/collection-grid/block.json +3 -3
  23. package/template/blocks/collection-grid/preview.png +0 -0
  24. package/template/blocks/collection-header/Block.vue +82 -58
  25. package/template/blocks/collection-header/__tests__/Block.spec.ts +77 -1
  26. package/template/blocks/collection-header/preview.json +4 -4
  27. package/template/blocks/collection-header/preview.png +0 -0
  28. package/template/blocks/contact/preview.png +0 -0
  29. package/template/blocks/cta/preview.json +4 -4
  30. package/template/blocks/cta/preview.png +0 -0
  31. package/template/blocks/faq/preview.png +0 -0
  32. package/template/blocks/feature-grid/Block.vue +73 -4
  33. package/template/blocks/feature-grid/__tests__/Block.spec.ts +43 -1
  34. package/template/blocks/feature-grid/block.json +2 -2
  35. package/template/blocks/feature-grid/preview.json +49 -24
  36. package/template/blocks/feature-grid/preview.png +0 -0
  37. package/template/blocks/footer/Block.vue +186 -71
  38. package/template/blocks/footer/__tests__/Block.spec.ts +127 -32
  39. package/template/blocks/footer/block.json +42 -4
  40. package/template/blocks/footer/mock.json +31 -34
  41. package/template/blocks/footer/preview.png +0 -0
  42. package/template/blocks/form/preview.png +0 -0
  43. package/template/blocks/gallery/preview.json +24 -24
  44. package/template/blocks/gallery/preview.png +0 -0
  45. package/template/blocks/hero/Block.vue +117 -19
  46. package/template/blocks/hero/__tests__/Block.spec.ts +46 -0
  47. package/template/blocks/hero/block.json +36 -1
  48. package/template/blocks/hero/preview.json +33 -25
  49. package/template/blocks/hero/preview.png +0 -0
  50. package/template/blocks/image/preview.json +4 -4
  51. package/template/blocks/image/preview.png +0 -0
  52. package/template/blocks/logo-cloud/preview.png +0 -0
  53. package/template/blocks/navigation/Block.vue +623 -184
  54. package/template/blocks/navigation/__tests__/Block.spec.ts +416 -68
  55. package/template/blocks/navigation/__tests__/fixtures/menu.json +182 -0
  56. package/template/blocks/navigation/block.json +102 -6
  57. package/template/blocks/navigation/mock.json +279 -52
  58. package/template/blocks/navigation/preview.json +311 -0
  59. package/template/blocks/navigation/preview.png +0 -0
  60. package/template/blocks/newsletter/Block.vue +248 -144
  61. package/template/blocks/newsletter/__tests__/Block.spec.ts +42 -0
  62. package/template/blocks/newsletter/block.json +61 -2
  63. package/template/blocks/newsletter/preview.json +35 -0
  64. package/template/blocks/newsletter/preview.png +0 -0
  65. package/template/blocks/order-status/preview.png +0 -0
  66. package/template/blocks/pricing-table/preview.png +0 -0
  67. package/template/blocks/product-carousel/Block.vue +272 -26
  68. package/template/blocks/product-carousel/__tests__/Block.spec.ts +90 -0
  69. package/template/blocks/product-carousel/block.json +61 -0
  70. package/template/blocks/product-carousel/preview.json +12 -0
  71. package/template/blocks/product-carousel/preview.png +0 -0
  72. package/template/blocks/product-detail/Block.vue +148 -96
  73. package/template/blocks/product-detail/__tests__/Block.spec.ts +98 -74
  74. package/template/blocks/product-detail/block.json +11 -4
  75. package/template/blocks/product-detail/mock.json +53 -22
  76. package/template/blocks/product-detail/parts/Gallery.vue +52 -103
  77. package/template/blocks/product-detail/preview.png +0 -0
  78. package/template/blocks/quote/preview.png +0 -0
  79. package/template/blocks/rich-text/preview.png +0 -0
  80. package/template/blocks/search/Block.vue +1 -0
  81. package/template/blocks/search/TypeSection.vue +1 -0
  82. package/template/blocks/search/__tests__/Block.spec.ts +23 -0
  83. package/template/blocks/search/preview.png +0 -0
  84. package/template/blocks/split-content/Block.vue +98 -20
  85. package/template/blocks/split-content/__tests__/Block.spec.ts +57 -18
  86. package/template/blocks/split-content/block.json +72 -6
  87. package/template/blocks/split-content/preview.json +34 -13
  88. package/template/blocks/split-content/preview.png +0 -0
  89. package/template/blocks/stats/preview.png +0 -0
  90. package/template/blocks/tabs/preview.json +16 -16
  91. package/template/blocks/tabs/preview.png +0 -0
  92. package/template/blocks/team/preview.png +0 -0
  93. package/template/blocks/testimonials/preview.png +0 -0
  94. package/template/blocks/timeline/preview.png +0 -0
  95. package/template/blocks/trust-strip/Block.vue +67 -1
  96. package/template/blocks/trust-strip/__tests__/Block.spec.ts +30 -1
  97. package/template/blocks/trust-strip/block.json +4 -4
  98. package/template/blocks/trust-strip/preview.json +21 -0
  99. package/template/blocks/trust-strip/preview.png +0 -0
  100. package/template/blocks/video-embed/preview.png +0 -0
  101. package/template/blocks/wishlist/preview.png +0 -0
  102. package/template/i18n/en-US.json +16 -9
  103. package/template/i18n/is-IS.json +16 -9
  104. package/template/pages/article.page.json +19 -18
  105. package/template/pages/cart.page.json +3 -13
  106. package/template/pages/category.page.json +15 -7
  107. package/template/pages/collection.page.json +15 -14
  108. package/template/pages/home.page.json +217 -182
  109. package/template/pages/product.page.json +46 -36
  110. package/template/pages/products.page.json +3 -13
  111. package/template/pages/search.page.json +3 -13
  112. package/template/pages/wishlist.page.json +3 -13
  113. package/template/public/images/CREDITS.md +28 -0
  114. package/template/public/images/clay-hands.webp +0 -0
  115. package/template/public/images/coffee-table.webp +0 -0
  116. package/template/public/images/cup.webp +0 -0
  117. package/template/public/images/enamel-cups.webp +0 -0
  118. package/template/public/images/hero.webp +0 -0
  119. package/template/public/images/kitchen.webp +0 -0
  120. package/template/public/images/mug.webp +0 -0
  121. package/template/public/images/northwind-mark.svg +1 -0
  122. package/template/public/images/planters.webp +0 -0
  123. package/template/public/images/plates.webp +0 -0
  124. package/template/public/images/reading.webp +0 -0
  125. package/template/public/images/sweater.webp +0 -0
  126. package/template/public/images/terracotta.webp +0 -0
  127. package/template/public/images/throws.webp +0 -0
  128. package/template/public/images/vase.webp +0 -0
  129. package/template/public/images/wheel.webp +0 -0
  130. package/template/public/images/yarn-tools.webp +0 -0
  131. package/template/public/images/yarn.webp +0 -0
  132. package/template/stories/generated/collection-grid.stories.ts +6 -0
  133. package/template/stories/generated/feature-grid.stories.ts +6 -0
  134. package/template/stories/generated/footer.stories.ts +4 -4
  135. package/template/stories/generated/hero.stories.ts +6 -0
  136. package/template/stories/generated/navigation.stories.ts +14 -1
  137. package/template/stories/generated/newsletter.stories.ts +2 -1
  138. package/template/stories/generated/product-carousel.stories.ts +12 -0
  139. package/template/stories/generated/split-content.stories.ts +12 -0
  140. package/template/stories/generated/trust-strip.stories.ts +8 -1
  141. package/template/stories/pages/article.stories.ts +2 -1
  142. package/template/stories/pages/cart.stories.ts +2 -1
  143. package/template/stories/pages/category.stories.ts +2 -1
  144. package/template/stories/pages/collection.stories.ts +2 -1
  145. package/template/stories/pages/home.stories.ts +2 -1
  146. package/template/stories/pages/product.stories.ts +2 -1
  147. package/template/stories/pages/products.stories.ts +2 -1
  148. package/template/stories/pages/search.stories.ts +2 -1
  149. package/template/stories/pages/wishlist.stories.ts +2 -1
  150. package/template/stories/support/demoChrome.ts +32 -0
  151. package/template/stories/support/pageBlocks.ts +2 -4
  152. package/template/test/countPill.browser.spec.ts +21 -13
  153. package/template/test/localePrefix.spec.ts +11 -6
  154. package/template/test/pages/article.spec.ts +1 -1
  155. package/template/test/pages/category.spec.ts +34 -11
  156. package/template/test/pages/collection.spec.ts +182 -148
  157. package/template/test/pages/home.spec.ts +35 -40
  158. package/template/test/pages/hydration.spec.ts +4 -4
  159. package/template/test/pages/product.spec.ts +17 -14
  160. package/template/test/pages/seededPages.spec.ts +11 -6
  161. package/template/test/prerenderRefresh.browser.spec.ts +36 -15
  162. package/template/test/previewParity.browser.spec.ts +36 -2
  163. package/template/test/starter.spec.ts +31 -15
  164. package/template/test/storefront/gatewayPrerender.spec.ts +26 -0
  165. package/template/tokens.json +13 -13
@@ -1,9 +1,9 @@
1
1
  // @vitest-environment jsdom
2
2
  //
3
- // The product sample page (`pages/product.page.json`): announcement bar, header, breadcrumbs,
4
- // the product-detail buy box for "Merino crew sweater", a related-products carousel, an FAQ and
5
- // the footer, rendered together through `mountPage` exactly as `app/pages/[...slug].vue` renders
6
- // a real page: the leading structure blocks (announcement bar + header) before `<main id="main">`,
3
+ // The product sample page (`pages/product.page.json`): header, breadcrumbs, the product-detail
4
+ // buy box for "Merino crew sweater", a related-products carousel, an FAQ and the footer, rendered
5
+ // together through `mountPage` exactly as `app/pages/[...slug].vue` renders a real page: the
6
+ // leading structure block (the header, which carries its own info strip) before `<main id="main">`,
7
7
  // everything else inside it, the footer after it — see `app/utils/pageStructure.ts`.
8
8
  //
9
9
  // Carousel counts are read off the real demo storefront (`app/storefront/demo.ts`), not assumed:
@@ -45,13 +45,14 @@ async function mountProductPage() {
45
45
  * drawer — the seeded header has nothing to put in one, so it draws neither the Menu button nor the
46
46
  * drawer (see `withAuthoredHeaderLink`). */
47
47
  async function mountProductPageWithHeaderLink() {
48
- return mountPage(withAuthoredHeaderLink(fixture), { attachTo: document.body });
48
+ return mountPage(withAuthoredHeaderLink(fixture), {
49
+ attachTo: document.body,
50
+ });
49
51
  }
50
52
 
51
53
  describe('product sample page', () => {
52
54
  it('is composed of exactly the fixture blocks, in the documented order', () => {
53
55
  expect(fixture.blocks.map((b) => b.apiId)).toEqual([
54
- 'announcement-bar',
55
56
  'navigation',
56
57
  'breadcrumbs',
57
58
  'product-detail',
@@ -70,7 +71,6 @@ describe('product sample page', () => {
70
71
  // `test/support/mountPage.spec.ts`'s own html.indexOf pattern).
71
72
  const html = wrapper.html();
72
73
  const markers = [
73
- 'Free shipping on orders over $80', // announcement-bar
74
74
  'data-eldra-header-focus', // navigation
75
75
  'aria-label="Breadcrumb"', // breadcrumbs
76
76
  'aria-label="Product images"', // product-detail (gallery)
@@ -173,11 +173,11 @@ describe('product sample page', () => {
173
173
 
174
174
  it('shares the same ground across product-detail, the carousel and the FAQ, with only the footer changing it', async () => {
175
175
  const wrapper = await mountProductPage();
176
- const [, , , productDetail, carousel, faq, footer] = pageBlockRoots(wrapper);
176
+ const [, , productDetail, carousel, faq, footer] = pageBlockRoots(wrapper);
177
177
  expect(productDetail!.getAttribute('data-section-bg')).toBe('none');
178
178
  expect(carousel!.getAttribute('data-section-bg')).toBe('none');
179
179
  expect(faq!.getAttribute('data-section-bg')).toBe('none');
180
- expect(footer!.getAttribute('data-section-bg')).toBe('surface-strong');
180
+ expect(footer!.getAttribute('data-section-bg')).toBe('primary');
181
181
  // Adjacency (not just value) is what the package's CSS rule keys off:
182
182
  expect(productDetail!.nextElementSibling).toBe(carousel);
183
183
  expect(carousel!.nextElementSibling).toBe(faq);
@@ -217,7 +217,7 @@ describe('product sample page', () => {
217
217
  describe('modals', () => {
218
218
  it('menu drawer: opens as a dialog and Esc returns focus to the menu button', async () => {
219
219
  const wrapper = await mountProductPageWithHeaderLink();
220
- const menuButton = wrapper.get('button[aria-label="Open menu"]');
220
+ const menuButton = wrapper.get('button[aria-label="Menu"]');
221
221
  menuButton.element.focus();
222
222
  await menuButton.trigger('click');
223
223
  const dialog = wrapper.get('dialog[open]');
@@ -234,7 +234,10 @@ describe('product sample page', () => {
234
234
 
235
235
  it('search: opens as a dialog and Esc returns focus to the search button', async () => {
236
236
  const wrapper = await mountProductPage();
237
- const searchButton = wrapper.get('button[aria-label="Search"]');
237
+ // The labelled Search tool, named by its visible label.
238
+ const searchButton = wrapper
239
+ .findAll('button')
240
+ .find((button) => button.text().trim() === 'Search')!;
238
241
  searchButton.element.focus();
239
242
  await searchButton.trigger('click');
240
243
  expect(wrapper.findAll('dialog[open]').length).toBeGreaterThan(0);
@@ -248,9 +251,9 @@ describe('product sample page', () => {
248
251
  wrapper.unmount();
249
252
  });
250
253
 
251
- it('lightbox: opens from zoom and Esc returns focus to the zoom button', async () => {
254
+ it('lightbox: opens from a mosaic tile and Esc returns focus to that tile', async () => {
252
255
  const wrapper = await mountProductPage();
253
- const zoomButton = wrapper.get('button[aria-haspopup="dialog"][aria-label^="Zoom image"]');
256
+ const zoomButton = wrapper.get('button[aria-haspopup="dialog"][aria-label^="Open image"]');
254
257
  zoomButton.element.focus();
255
258
  await zoomButton.trigger('click');
256
259
  const dialog = wrapper.get('dialog[aria-label="Merino crew sweater, images"]');
@@ -312,7 +315,7 @@ describe('product sample page', () => {
312
315
  });
313
316
 
314
317
  it('exposes exactly one banner, one main and one contentinfo landmark', async () => {
315
- // The announcement bar and header render before `<main id="main">` and the footer after it
318
+ // The header renders before `<main id="main">` and the footer after it
316
319
  // (`app/utils/pageStructure.ts`), which is the only way `<header>`/`<footer>` map to the
317
320
  // `banner`/`contentinfo` roles at all.
318
321
  const wrapper = await mountProductPage();
@@ -5,7 +5,7 @@
5
5
  // (`pages/{cart,wishlist,search,products}.page.json`, `app/templates.ts`'s `starterPages()`).
6
6
  //
7
7
  // One spec for all three rather than three near-identical files: they are the same page by design —
8
- // announcement bar, the shared header, breadcrumbs, the one block the page exists for, a
8
+ // the shared header (which carries its own info strip), breadcrumbs, the one block the page exists for, a
9
9
  // recently-viewed carousel, the shared footer — and what each of them is *for* is the block in the
10
10
  // middle. The per-page table below is the whole difference.
11
11
  //
@@ -86,7 +86,6 @@ const PAGES: SeededPage[] = [
86
86
 
87
87
  function expectedApiIds(page: SeededPage): string[] {
88
88
  return [
89
- 'announcement-bar',
90
89
  'navigation',
91
90
  'breadcrumbs',
92
91
  ...(page.above === undefined ? [] : [page.above]),
@@ -111,10 +110,13 @@ describe.each(PAGES)('the seeded $slug page', (page) => {
111
110
 
112
111
  const roots = pageBlockRoots(wrapper);
113
112
  expect(roots).toHaveLength(expectedApiIds(page).length);
114
- expect(roots[1]!.tagName).toBe('HEADER');
113
+ // Indexed off the expected order rather than literal positions, so a block added or removed
114
+ // ahead of them cannot silently point these at the wrong root.
115
+ const ids = expectedApiIds(page);
116
+ expect(roots[ids.indexOf('navigation')]!.tagName).toBe('HEADER');
115
117
  expect(roots.at(-1)!.tagName).toBe('FOOTER');
116
118
  // Breadcrumbs stays inside `<main>`: it renders a `<nav>`, a landmark wherever it sits.
117
- expect(roots[2]!.querySelector('nav[aria-label]')).not.toBeNull();
119
+ expect(roots[ids.indexOf('breadcrumbs')]!.querySelector('nav[aria-label]')).not.toBeNull();
118
120
  });
119
121
 
120
122
  it('has exactly one h1, and it is the block that owns the page’s title', async () => {
@@ -153,7 +155,7 @@ describe('the page seeds built from those fixtures', () => {
153
155
  for (const [index, seed] of seeds.entries()) {
154
156
  const page = PAGES[index]!;
155
157
  expect(seed.title).toBe(page.title);
156
- // The announcement bar precedes the header, exactly as the fixture has it: a region is a
158
+ // The header leads, exactly as the fixture has it: a region is a
157
159
  // placement in the page's own order, not a frame around it.
158
160
  expect(
159
161
  seed.blocks.map((entry) => ('role' in entry ? `@${entry.role}` : entry.apiId))
@@ -171,7 +173,10 @@ describe('the page seeds built from those fixtures', () => {
171
173
  (entry) => 'required' in entry && entry.required === true
172
174
  );
173
175
  expect(required).toHaveLength(1);
174
- expect(required[0]).toMatchObject({ apiId: PAGES[index]!.fixed, required: true });
176
+ expect(required[0]).toMatchObject({
177
+ apiId: PAGES[index]!.fixed,
178
+ required: true,
179
+ });
175
180
  }
176
181
  });
177
182
 
@@ -314,7 +314,7 @@ interface GridState {
314
314
  const GRID_SECTION = 'section[aria-label="The winter edit products"]';
315
315
 
316
316
  function readGrid(page: Page): Promise<GridState> {
317
- return page.evaluate((selector) => {
317
+ return page.evaluate(async (selector) => {
318
318
  const section = document.querySelector(selector);
319
319
  // `aria-labelledby`, not any `ul`: that is the grid's own card list. The active-filter chips
320
320
  // are a `ul[aria-label]` in the same section, and they only exist once something is filtered.
@@ -324,9 +324,24 @@ function readGrid(page: Page): Promise<GridState> {
324
324
  const status = [...(section?.querySelectorAll('p[role="status"]') ?? [])]
325
325
  .map((node) => (node as HTMLElement).textContent?.trim() ?? '')
326
326
  .filter((text) => text !== '');
327
- const price = [...(section?.querySelectorAll('aside [role="slider"]') ?? [])].map(
328
- (thumb) => thumb.getAttribute('aria-valuenow') ?? ''
329
- );
327
+ const thumbs = (root: ParentNode | null): string[] =>
328
+ [...(root?.querySelectorAll('[role="slider"]') ?? [])].map(
329
+ (thumb) => thumb.getAttribute('aria-valuenow') ?? ''
330
+ );
331
+ // The sidebar shows its price thumbs all the time. The filter bar (the collection page's
332
+ // variant) keeps them in the Price chip's popover, which only renders while it is open, so the
333
+ // chip is opened to read them and closed again.
334
+ let price = thumbs(section?.querySelector('aside') ?? null);
335
+ const priceChip = [
336
+ ...(section?.querySelectorAll('[role="group"] button[aria-controls]') ?? []),
337
+ ].find((button) => (button.textContent ?? '').trim().startsWith('Price'));
338
+ if (price.length === 0 && priceChip instanceof HTMLElement) {
339
+ priceChip.click();
340
+ await new Promise((resolve) => setTimeout(resolve, 300));
341
+ price = thumbs(document.getElementById(priceChip.getAttribute('aria-controls') ?? ''));
342
+ priceChip.click();
343
+ await new Promise((resolve) => setTimeout(resolve, 100));
344
+ }
330
345
  return { titles, count: status[0] ?? '', price };
331
346
  }, GRID_SECTION);
332
347
  }
@@ -674,8 +689,8 @@ describe('prerendered commerce data on the generated static site', () => {
674
689
  // case would keep passing while quietly testing nothing.
675
690
  expect(visited.url).toBe(`${statics.origin}${productPage}/`);
676
691
  const instances = blockInstances(visited);
677
- // The page's own seven, plus the shell's hosted cart drawer (see the control above).
678
- expect(Object.keys(instances.created).length).toBe(8);
692
+ // The page's own six, plus the shell's hosted cart drawer (see the control above).
693
+ expect(Object.keys(instances.created).length).toBe(7);
679
694
  // The page is served at `/products/ash-glaze-mug/` and prerendered at
680
695
  // `/products/ash-glaze-mug` (`startStaticServer`'s 308 is the deployed host's). Nuxt therefore
681
696
  // re-navigates between the two while the page hydrates, and unless the route key and the page
@@ -731,11 +746,12 @@ describe('prerendered commerce data on the generated static site', () => {
731
746
  }
732
747
  });
733
748
 
734
- it("opens a mega-menu that spans the header's container, whichever item opened it", async () => {
749
+ it("opens a mega-menu that spans the header, its columns in the bar's container, whichever item opened it", async () => {
735
750
  // Geometry only a real browser can answer. The panel used to be pinned to the item that
736
751
  // opened it at a width of its own, so where it started and stopped depended on which word in
737
- // the bar the visitor happened to hover. It now spans the bar's own container: its left edge
738
- // on the brand's, its right edge on the actions', and its top on the bar's bottom edge.
752
+ // the bar the visitor happened to hover. It is now a full-bleed sheet: its edges on the
753
+ // header's, its top on the bar's bottom edge, and its content inside the bar's own container —
754
+ // the first column on the brand's left edge, the "View all" on the actions' right edge.
739
755
  const page = await browser.newPage({ viewport: { width: 1280, height: 900 } });
740
756
  try {
741
757
  await page.goto(`${statics.origin}${HOME_PAGE_PATH}`, { waitUntil: 'domcontentloaded' });
@@ -782,17 +798,17 @@ describe('prerendered commerce data on the generated static site', () => {
782
798
  };
783
799
  }, panelId ?? '');
784
800
 
785
- expect(Math.round(edges.panel.left)).toBe(Math.round(edges.brand.left));
786
- expect(Math.round(edges.panel.right)).toBe(Math.round(edges.actions.right));
801
+ expect(Math.round(edges.panel.left)).toBe(Math.round(edges.bar.left));
802
+ expect(Math.round(edges.panel.right)).toBe(Math.round(edges.bar.right));
803
+ expect(Math.abs(edges.firstColumn.left - edges.brand.left)).toBeLessThanOrEqual(1);
804
+ expect(Math.abs(edges.viewAll.right - edges.actions.right)).toBeLessThanOrEqual(1);
787
805
  // Directly below the bar — within the bar's own 1px bottom border.
788
806
  expect(Math.abs(edges.panel.top - edges.bar.bottom)).toBeLessThanOrEqual(2);
789
807
  // And the premise: the trigger is nowhere near either edge, so "spans the container" is a
790
808
  // real claim rather than a coincidence of where this item sits.
791
809
  expect(edges.trigger.left).toBeGreaterThan(edges.panel.left + 1);
792
810
  expect(edges.trigger.right).toBeLessThan(edges.panel.right - 1);
793
- // And the inset the operator asked for: nothing inside the panel sits flush against its
794
- // edges. 24px is the narrow-container figure; the wide container's own 32px clears it too,
795
- // so one bound holds at every width this page is measured at.
811
+ // And nothing inside the panel sits flush against its edges: the page's own gutters at least.
796
812
  expect(edges.firstColumn.left).toBeGreaterThanOrEqual(edges.panel.left + 24);
797
813
  expect(edges.viewAll.right).toBeLessThanOrEqual(edges.panel.right - 24);
798
814
  } finally {
@@ -952,8 +968,10 @@ describe('prerendered commerce data on the generated static site', () => {
952
968
  // The height the spacer's *classes* alone reserve — all the first paint of a prerendered
953
969
  // page has, before the bar has been measured at all — against the bar's own box for those
954
970
  // same classes. A difference here is a page that jumps on hydration.
971
+ // The bar's box is the spacer's last child; an info strip, when the header has one,
972
+ // reserves its own box before it.
955
973
  reserved:
956
- spacer === null ? null : spacer.firstElementChild!.getBoundingClientRect().height,
974
+ spacer === null ? null : spacer.lastElementChild!.getBoundingClientRect().height,
957
975
  nav: element.querySelector('[data-eldra-header-bar]')!.getBoundingClientRect().height,
958
976
  wrapper: wrapper === null ? null : wrapper.getBoundingClientRect().height,
959
977
  };
@@ -1011,6 +1029,9 @@ describe('prerendered commerce data on the generated static site', () => {
1011
1029
  'storefront:catalog.category:[null]',
1012
1030
  'storefront:catalog.collectionProducts:[null,{"page":1,"pageSize":8}]',
1013
1031
  'storefront:catalog.product:["ash-glaze-mug"]',
1032
+ // `product-carousel`'s quick-add read, keyed `null` until a shopper presses Quick add: no
1033
+ // request and no data, in the payload because it exists, like the category read above.
1034
+ 'storefront:catalog.product:[null]',
1014
1035
  'storefront:catalog.related:["ash-glaze-mug",8]',
1015
1036
  // The footer's sign-up spam guard (`useFormSpam`): a footer with no newsletter zone names no
1016
1037
  // form, so the read is keyed `""`, resolves `null` without a request and is in the payload
@@ -567,7 +567,22 @@ function capture(origin: string, path: string, width: number, session: boolean):
567
567
  });
568
568
  }
569
569
 
570
- /** A full-page screenshot, after the same normalisation as the DOM. */
570
+ /**
571
+ * A full-page screenshot, after the same normalisation as the DOM.
572
+ *
573
+ * Captured beyond the viewport, as `fullPage: true` does, but only once the viewport already is the
574
+ * document's height and the page has settled at that size. A capture beyond the viewport draws the
575
+ * page afresh, which is what keeps a session's paint history (a block re-rendered from the draft)
576
+ * out of the pixels. But Playwright's `fullPage: true` grows the view in that same capture, and the
577
+ * taller view changes the layer tree: on `/` at 1280 the open search popover needed its own layer
578
+ * only because the page scrolled under it. The frame is drawn before or after that change lands, a
579
+ * race decided on every load, and the popover's suggestion chips sit on a fractional pixel, so
580
+ * their rounded borders came out a step of anti-aliasing apart, about 60 pixels, on whichever page
581
+ * lost the race (WS-1450). Grown first, the capture changes nothing about the page it draws.
582
+ *
583
+ * What `animations: 'disabled'` and `caret: 'hide'` did is done here: a finite animation is
584
+ * finished, an infinite one cancelled, and the caret made transparent, the same on both pages.
585
+ */
571
586
  function screenshot(
572
587
  origin: string,
573
588
  path: string,
@@ -577,7 +592,26 @@ function screenshot(
577
592
  return open(origin, path, width, session, async (page) => {
578
593
  await normalise(page, session);
579
594
  await settle(page, true);
580
- return page.screenshot({ fullPage: true, animations: 'disabled', caret: 'hide' });
595
+ const height = await page.evaluate(() => document.documentElement.scrollHeight);
596
+ await page.setViewportSize({ width, height });
597
+ await settle(page, true);
598
+ await page.addStyleTag({
599
+ content: '*, *::before, *::after { caret-color: transparent !important; }',
600
+ });
601
+ await page.evaluate(async () => {
602
+ for (const animation of document.getAnimations()) {
603
+ if (animation.effect?.getComputedTiming().endTime === Infinity) animation.cancel();
604
+ else animation.finish();
605
+ }
606
+ await new Promise((resolve) => requestAnimationFrame(() => requestAnimationFrame(resolve)));
607
+ });
608
+ const cdp = await page.context().newCDPSession(page);
609
+ const { data } = await cdp.send('Page.captureScreenshot', {
610
+ format: 'png',
611
+ clip: { x: 0, y: 0, width, height, scale: 1 },
612
+ captureBeyondViewport: true,
613
+ });
614
+ return Buffer.from(data, 'base64');
581
615
  });
582
616
  }
583
617
 
@@ -89,14 +89,14 @@ describe('starter theme', () => {
89
89
  const result = scanTheme({ themeDir: templateDir, framework: 'nuxt' });
90
90
  expect(result.errors).toEqual([]);
91
91
  expect(result.manifest?.blocks.map((block) => block.apiId).sort()).toEqual(expectedBlocks);
92
- // The design spec's brand slot (eldra-starter-spec/tokens.json): a deep
93
- // ink a customer replaces with their own colour, not a blue.
94
- expect(result.manifest?.tokens.colors.primary.value).toBe('#24201c');
92
+ // The Northwind palette's brand slot: a deep spruce a customer replaces
93
+ // with their own colour.
94
+ expect(result.manifest?.tokens.colors.primary.value).toBe('#1e4646');
95
95
  // The roles `@eldrajs/ui` needs beyond the original thirteen.
96
- expect(result.manifest?.tokens.colors['border-strong']?.value).toBe('#7d7466');
97
- expect(result.manifest?.tokens.colors.focus?.value).toBe('#1c1917');
96
+ expect(result.manifest?.tokens.colors['border-strong']?.value).toBe('#776c5c');
97
+ expect(result.manifest?.tokens.colors.focus?.value).toBe('#1d1b18');
98
98
  expect(result.manifest?.tokens.colors['focus-inner']?.value).toBe('#ffffff');
99
- expect(result.manifest?.tokens.colors.overlay?.value).toBe('#1c1917b3');
99
+ expect(result.manifest?.tokens.colors.overlay?.value).toBe('#1d1b18b3');
100
100
  const fields = Object.fromEntries(
101
101
  result.manifest!.blocks.map((block) => [
102
102
  block.apiId,
@@ -121,6 +121,9 @@ describe('starter theme', () => {
121
121
  'successTitle',
122
122
  'successText',
123
123
  'formKey',
124
+ 'helpHeading',
125
+ 'helpText',
126
+ 'contacts',
124
127
  'sectionBackground',
125
128
  ],
126
129
  form: [
@@ -140,6 +143,9 @@ describe('starter theme', () => {
140
143
  'subheading',
141
144
  'image',
142
145
  'slides',
146
+ 'captionLabel',
147
+ 'captionDetail',
148
+ 'captionHref',
143
149
  'spacing',
144
150
  'primaryCtaLabel',
145
151
  'primaryCtaHref',
@@ -152,6 +158,10 @@ describe('starter theme', () => {
152
158
  'brandText',
153
159
  'brandLogo',
154
160
  'description',
161
+ 'address',
162
+ 'phone',
163
+ 'email',
164
+ 'hours',
155
165
  'groups',
156
166
  'links',
157
167
  'showNewsletter',
@@ -167,13 +177,17 @@ describe('starter theme', () => {
167
177
  'variant',
168
178
  'brandText',
169
179
  'brandLogo',
180
+ 'brandMark',
170
181
  'links',
182
+ 'drawerLayout',
183
+ 'account',
171
184
  'showSearch',
172
185
  'searchStyle',
173
186
  'ctaLabel',
174
187
  'cta',
175
188
  'sticky',
176
189
  'transparentOverHero',
190
+ 'infoItems',
177
191
  ],
178
192
  article: [
179
193
  'title',
@@ -268,7 +282,7 @@ describe('starter theme', () => {
268
282
  'trail',
269
283
  'subcollections',
270
284
  ],
271
- 'split-content': ['startWith', 'rows'],
285
+ 'split-content': ['startWith', 'rows', 'list', 'background'],
272
286
  quote: [
273
287
  'variant',
274
288
  'quote',
@@ -364,12 +378,17 @@ describe('starter theme', () => {
364
378
  'emptyText',
365
379
  ],
366
380
  'product-carousel': [
381
+ 'eyebrow',
367
382
  'heading',
368
383
  'variant',
369
384
  'sourceCollection',
370
385
  'limit',
371
386
  'viewAllLabel',
372
387
  'viewAllHref',
388
+ 'layout',
389
+ 'filters',
390
+ 'allFilterLabel',
391
+ 'quickAdd',
373
392
  'showSwatches',
374
393
  'background',
375
394
  ],
@@ -944,10 +963,8 @@ describe('seeded templates and pages (app/templates.ts)', () => {
944
963
  for (const seed of pageSeeds) {
945
964
  expect(Object.keys(seed)).toEqual(['slug', 'title', 'blocks']);
946
965
  }
947
- // The announcement bar precedes the header, which is only expressible because a region is a
948
- // placement in the page's own order rather than a frame around the blocks.
966
+ // The header region is a placement in the page's own order, not a frame around the blocks.
949
967
  expect(pageSeeds[0]!.blocks.map((entry) => entry.type)).toEqual([
950
- 'announcement-bar',
951
968
  '@header',
952
969
  'breadcrumbs',
953
970
  'cart',
@@ -1372,13 +1389,12 @@ describe('seeded templates and pages (app/templates.ts)', () => {
1372
1389
  });
1373
1390
 
1374
1391
  it('seeds no list item that is missing a required media field', () => {
1375
- // The `hero` seed is the live case: all four of the home fixture's slides require an image,
1376
- // and all four carry demo imagery, so the seeded hero renders with an empty slideshow rather
1377
- // than four entries Core would refuse to publish. (Its `mock.json` omits `slides` entirely,
1378
- // which is the same shape an author gets on insert.)
1392
+ // The home fixture's hero is the `card` variant, which has no slides, so the seed carries
1393
+ // none; a hero whose slides all carry demo imagery (each requires an image) would seed an
1394
+ // empty slideshow rather than entries Core would refuse to publish.
1379
1395
  const home = scanned.manifest!.templates!.find((template) => template.schemaApiId === 'home')!;
1380
1396
  const hero = home.blocks.find((block) => block.apiId === 'hero')!;
1381
- expect(hero.data.slides).toEqual([]);
1397
+ expect(hero.data.slides ?? []).toEqual([]);
1382
1398
 
1383
1399
  // And the rule generally, walked against each block's own declared field types: no seed
1384
1400
  // block (or role) may carry a list item without a value for a media field the block marks
@@ -329,6 +329,32 @@ describe('gateway storefront — prerendered results', () => {
329
329
  });
330
330
  });
331
331
 
332
+ describe('gateway storefront — the loads it hands the runtime', () => {
333
+ it('hands over every load, settled once its answer is written, and a reload too', async () => {
334
+ const calls = fakeClient();
335
+ const held: Array<Promise<void>> = [];
336
+ const storefront = createGatewayStorefront(calls.client, {
337
+ route: fakeRoute(),
338
+ // A draft preview session keeps its veil up for these (`holdPreviewSession`).
339
+ runtime: { hold: (load) => held.push(load) },
340
+ });
341
+
342
+ const collection = ref({ slug: 'winter-knitwear' });
343
+ const grid = storefront.catalog.collectionProducts(collection, ref({ pageSize: 24, page: 1 }));
344
+ expect(held).toHaveLength(1);
345
+ expect(grid.pending.value).toBe(true);
346
+ await held[0];
347
+ expect(grid.pending.value).toBe(false);
348
+ expect(grid.data.value?.items).toHaveLength(2);
349
+
350
+ collection.value = { slug: 'the-winter-edit' };
351
+ await nextTick();
352
+ expect(held).toHaveLength(2);
353
+ await held[1];
354
+ expect(grid.pending.value).toBe(false);
355
+ });
356
+ });
357
+
332
358
  describe('gateway storefront — the volatile refresh after hydration', () => {
333
359
  /**
334
360
  * Asserted at the URL the SDK actually sends: `filter` is the gateway's one repeatable
@@ -2,67 +2,67 @@
2
2
  "colors": {
3
3
  "background": {
4
4
  "label": "Background",
5
- "value": "#fcfbf8",
5
+ "value": "#f7f4ee",
6
6
  "group": "Surface",
7
7
  "allowSiteOverride": true
8
8
  },
9
9
  "surface": {
10
10
  "label": "Surface",
11
- "value": "#f4f1eb",
11
+ "value": "#efe9df",
12
12
  "group": "Surface",
13
13
  "allowSiteOverride": true
14
14
  },
15
15
  "surface-strong": {
16
16
  "label": "Surface strong",
17
- "value": "#e9e4da",
17
+ "value": "#e3dacb",
18
18
  "group": "Surface",
19
19
  "allowSiteOverride": true
20
20
  },
21
21
  "border": {
22
22
  "label": "Border",
23
- "value": "#ddd6ca",
23
+ "value": "#d8cebd",
24
24
  "group": "Surface",
25
25
  "allowSiteOverride": true
26
26
  },
27
27
  "border-strong": {
28
28
  "label": "Border strong",
29
- "value": "#7d7466",
29
+ "value": "#776c5c",
30
30
  "group": "Surface",
31
31
  "allowSiteOverride": true
32
32
  },
33
33
  "overlay": {
34
34
  "label": "Overlay",
35
- "value": "#1c1917b3",
35
+ "value": "#1d1b18b3",
36
36
  "group": "Surface",
37
37
  "allowSiteOverride": true
38
38
  },
39
39
  "text": {
40
40
  "label": "Text",
41
- "value": "#1c1917",
41
+ "value": "#1d1b18",
42
42
  "group": "Content",
43
43
  "allowSiteOverride": true
44
44
  },
45
45
  "muted": {
46
46
  "label": "Muted",
47
- "value": "#595249",
47
+ "value": "#5a5248",
48
48
  "group": "Content",
49
49
  "allowSiteOverride": true
50
50
  },
51
51
  "primary": {
52
52
  "label": "Primary",
53
- "value": "#24201c",
53
+ "value": "#1e4646",
54
54
  "group": "Brand",
55
55
  "allowSiteOverride": true
56
56
  },
57
57
  "primary-contrast": {
58
58
  "label": "Primary contrast",
59
- "value": "#fcfbf8",
59
+ "value": "#f7f4ee",
60
60
  "group": "Brand",
61
61
  "allowSiteOverride": true
62
62
  },
63
63
  "accent": {
64
64
  "label": "Accent",
65
- "value": "#9c3f24",
65
+ "value": "#9c3d26",
66
66
  "group": "Brand",
67
67
  "allowSiteOverride": true
68
68
  },
@@ -92,7 +92,7 @@
92
92
  },
93
93
  "focus": {
94
94
  "label": "Focus ring",
95
- "value": "#1c1917",
95
+ "value": "#1d1b18",
96
96
  "group": "Focus",
97
97
  "allowSiteOverride": true
98
98
  },
@@ -126,7 +126,7 @@
126
126
  },
127
127
  "wide": {
128
128
  "label": "Wide",
129
- "maxWidth": "80rem",
129
+ "maxWidth": "78rem",
130
130
  "gutter": {
131
131
  "normal": "2rem",
132
132
  "tablet": "1.5rem",