@easy-web/core 1.7.0 → 1.8.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.
@@ -19,6 +19,8 @@ export type GalleryItem = Image & {
19
19
  */
20
20
  export interface ItemCardProps {
21
21
  item: Item & Partial<Linkable>;
22
+ /** Title heading tag. Defaults to `h3`; use `h2` directly below a page heading. */
23
+ headingLevel?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
22
24
  /**
23
25
  * `sizes` attribute of the responsive image. Only `ImageMetadata` sources
24
26
  * get a `srcset`; a string source renders a plain `<img>` and ignores it.
@@ -33,6 +35,8 @@ export interface ItemCardProps {
33
35
  }
34
36
  /** `Card` rendered from individual props, exactly as before the content contracts. */
35
37
  export interface LegacyCardProps {
38
+ /** Title heading tag, with the same `h3` default as the item API. */
39
+ headingLevel?: ItemCardProps['headingLevel'];
36
40
  /** @deprecated Pass `item`; `item.title` is rendered. */
37
41
  title: string;
38
42
  /** @deprecated Pass `item`; `item.description` is rendered. */
@@ -1 +1 @@
1
- {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/contracts/props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG;IAC9B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,CAAC,EAAE,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I,EAAE,CAAC;CACf;AAED,kFAAkF;AAClF,MAAM,WAAW,WAAY,SAAQ,oBAAoB;IACvD,QAAQ,EAAE,MAAM,CAAC;IACjB,uEAAuE;IACvE,UAAU,EAAE,IAAI,EAAE,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;CAC1B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easy-web/core",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -51,6 +51,7 @@ const formattedDate = new Intl.DateTimeFormat(locale ?? undefined, { dateStyle:
51
51
  }
52
52
  .ew-blog-card__image {
53
53
  width: 100%;
54
+ height: auto;
54
55
  aspect-ratio: 16 / 9;
55
56
  object-fit: cover;
56
57
  display: block;
@@ -10,7 +10,7 @@ import Media from './Media.astro';
10
10
  export type Props = CardProps;
11
11
 
12
12
  const props = Astro.props;
13
- const { item, imageSizes, class: className } = props;
13
+ const { item, imageSizes, headingLevel: Heading = 'h3', class: className } = props;
14
14
  const { title, description, href } = item ?? props;
15
15
  // Only the legacy props fall back to the title for alt text; an item's image
16
16
  // carries its own alt.
@@ -25,7 +25,7 @@ const Tag = href ? 'a' : 'div';
25
25
  props.image && <img src={props.image} alt={legacyAlt} class="ew-card__image" loading="lazy" />
26
26
  )}
27
27
  <div class="ew-card__body">
28
- <h3 class="ew-card__title">{title}</h3>
28
+ <Heading class="ew-card__title">{title}</Heading>
29
29
  {description && <p class="ew-card__description">{description}</p>}
30
30
  </div>
31
31
  </Tag>
@@ -48,6 +48,7 @@ const Tag = href ? 'a' : 'div';
48
48
  }
49
49
  .ew-card__image {
50
50
  width: 100%;
51
+ height: auto;
51
52
  aspect-ratio: 16 / 9;
52
53
  object-fit: cover;
53
54
  display: block;
@@ -245,7 +245,7 @@ const ratioClass = `ew-lightbox-grid__img--ratio-${aspectRatio.replace('/', '-')
245
245
  flex-direction: column;
246
246
  align-items: center;
247
247
  justify-content: center;
248
- z-index: 1000;
248
+ z-index: var(--ew-z-modal, 1300);
249
249
  padding: var(--ew-space-5);
250
250
  }
251
251
  .ew-lightbox[data-open='false'] {
@@ -68,7 +68,7 @@ const logoImage = !logo ? undefined : typeof logo === 'string' ? { src: logo, al
68
68
  .ew-header {
69
69
  position: sticky;
70
70
  top: 0;
71
- z-index: 100;
71
+ z-index: var(--ew-z-sticky, 1100);
72
72
  background: var(--ew-surface);
73
73
  border-bottom: 1px solid var(--ew-border);
74
74
  }
@@ -79,7 +79,7 @@ const rightItems = navItems.slice(mid);
79
79
  .ew-header-centered {
80
80
  position: sticky;
81
81
  top: 0;
82
- z-index: 100;
82
+ z-index: var(--ew-z-sticky, 1100);
83
83
  background: var(--ew-surface);
84
84
  border-bottom: 1px solid var(--ew-border);
85
85
  }
@@ -110,7 +110,7 @@ const dropdownIdPrefix = `${navId}-dropdown`;
110
110
  .ew-header-flyout {
111
111
  position: sticky;
112
112
  top: 0;
113
- z-index: 100;
113
+ z-index: var(--ew-z-sticky, 1100);
114
114
  background: var(--ew-surface);
115
115
  border-bottom: 1px solid var(--ew-border);
116
116
  }
@@ -217,7 +217,7 @@ const dropdownIdPrefix = `${navId}-dropdown`;
217
217
  padding: var(--ew-space-2);
218
218
  list-style: none;
219
219
  margin: 0;
220
- z-index: 200;
220
+ z-index: var(--ew-z-dropdown, 1000);
221
221
  }
222
222
  .ew-header-flyout__dropdown[data-open] {
223
223
  display: block;
@@ -66,7 +66,7 @@ const logoImage = !logo ? undefined : typeof logo === 'string' ? { src: logo, al
66
66
  top: 0;
67
67
  left: 0;
68
68
  right: 0;
69
- z-index: 100;
69
+ z-index: var(--ew-z-sticky, 1100);
70
70
  transition: transform 0.3s ease;
71
71
  background: var(--ew-surface);
72
72
  border-bottom: 1px solid var(--ew-border);
@@ -56,7 +56,7 @@ const { mainId = 'main-content', skipLabel = labels.skipToMainContent, class: cl
56
56
  position: absolute;
57
57
  left: -9999px;
58
58
  top: 0;
59
- z-index: 100;
59
+ z-index: var(--ew-z-overlay, 1200);
60
60
  padding: var(--ew-space-2) var(--ew-space-4);
61
61
  background: var(--ew-surface);
62
62
  color: var(--ew-on-surface);
@@ -77,9 +77,27 @@ const shouldNoIndex = (noIndex ?? policyNoIndex) || isNotFoundRoute;
77
77
 
78
78
  const canonical = new URL(servedPath, site).href;
79
79
  const absoluteOgImage = ogImage ? new URL(ogImage, site).href : undefined;
80
- // Map locale to OG locale format: 'de' → 'de_DE', 'en' → 'en_US'
81
- const ogLocale = locale === 'en' ? 'en_US' : locale === 'de' ? 'de_DE' : locale.replace('-', '_');
82
- const ogLocaleAlternate = locale === 'en' ? 'de_DE' : 'en_US';
80
+ function toOgLocale(value: string): string {
81
+ const [language, ...subtags] = value.replaceAll('_', '-').split('-');
82
+ const normalizedLanguage = language.toLowerCase();
83
+ // Preserve the historical defaults for unqualified German and English.
84
+ if (subtags.length === 0) {
85
+ return normalizedLanguage === 'en' ? 'en_US' : normalizedLanguage === 'de' ? 'de_DE' : normalizedLanguage;
86
+ }
87
+ return [normalizedLanguage, ...subtags.map((subtag) =>
88
+ subtag.length === 4
89
+ ? subtag[0].toUpperCase() + subtag.slice(1).toLowerCase()
90
+ : subtag.toUpperCase()
91
+ )].join('_');
92
+ }
93
+
94
+ const ogLocale = toOgLocale(locale);
95
+ const ogLocaleAlternates = [...new Set(
96
+ alternates
97
+ .filter(({ hreflang }) => hreflang.toLowerCase() !== 'x-default')
98
+ .map(({ hreflang }) => toOgLocale(hreflang))
99
+ .filter((alternate) => alternate !== ogLocale)
100
+ )];
83
101
  ---
84
102
  <title>{title}</title>
85
103
  {description && <meta name="description" content={description} />}
@@ -93,7 +111,7 @@ const ogLocaleAlternate = locale === 'en' ? 'de_DE' : 'en_US';
93
111
  <meta property="og:url" content={canonical} />
94
112
  <meta property="og:type" content={ogType} />
95
113
  <meta property="og:locale" content={ogLocale} />
96
- <meta property="og:locale:alternate" content={ogLocaleAlternate} />
114
+ {ogLocaleAlternates.map((alternate) => <meta property="og:locale:alternate" content={alternate} />)}
97
115
  <meta property="og:site_name" content={siteName} />
98
116
  {absoluteOgImage && <meta property="og:image" content={absoluteOgImage} />}
99
117
  <!-- Twitter Cards -->
@@ -1,6 +1,7 @@
1
1
  import { describe, expect, it } from 'vitest';
2
2
  import { experimental_AstroContainer as AstroContainer } from 'astro/container';
3
3
  import type { ImageMetadata } from 'astro';
4
+ import type { CardProps } from '../../contracts/index.js';
4
5
  import BlogPostCard from '../BlogPostCard.astro';
5
6
  import Card from '../Card.astro';
6
7
  import CardGrid from '../CardGrid.astro';
@@ -36,6 +37,21 @@ const imgTag = (html: string) => html.match(/<img\b[^>]*>/)?.[0] ?? '';
36
37
  const scopeOf = (tag: string) => tag.match(/data-astro-cid-[a-z0-9]+/)?.[0];
37
38
 
38
39
  describe('<Card item>', () => {
40
+ it.each(['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] as const)('renders a typed %s title on both prop paths', async (headingLevel) => {
41
+ const variants: CardProps[] = [
42
+ { item: { title: 'Gallery', href: '/gallery/' }, headingLevel },
43
+ { title: 'Gallery', headingLevel },
44
+ ];
45
+ for (const props of variants) {
46
+ const html = await render(Card, props);
47
+ expect(html).toContain(`<${headingLevel} class="ew-card__title">Gallery</${headingLevel}>`);
48
+ }
49
+ });
50
+
51
+ it('defaults the legacy title to h3', async () => {
52
+ expect(await render(Card, { title: 'Gallery' })).toContain('<h3 class="ew-card__title">Gallery</h3>');
53
+ });
54
+
39
55
  it('renders a local image through Media with srcset and the given sizes, and links the card', async () => {
40
56
  const html = await render(Card, {
41
57
  item: {
@@ -56,6 +72,8 @@ describe('<Card item>', () => {
56
72
  expect(img).toContain('alt="A touring bicycle"');
57
73
  expect(img).toContain('class="ew-card__image"');
58
74
  expect(img).toContain('loading="lazy"');
75
+ expect(img).toContain('width="1600"');
76
+ expect(img).toContain('height="900"');
59
77
  expect(html).toContain('<h3 class="ew-card__title">Touring bicycle</h3>');
60
78
  expect(html).toContain('<p class="ew-card__description">Ready for long rides</p>');
61
79
  });
@@ -129,6 +147,8 @@ describe('<BlogPostCard item>', () => {
129
147
  expect(img).toContain(`sizes="${gridSizes}"`);
130
148
  expect(img).toContain('alt="Players at the oche"');
131
149
  expect(img).toContain('class="ew-blog-card__image"');
150
+ expect(img).toContain('width="1600"');
151
+ expect(img).toContain('height="900"');
132
152
  expect(html).toContain('<h3 class="ew-blog-card__title">Season opener</h3>');
133
153
  expect(html).toContain('<time class="ew-blog-card__date" datetime="2025-03-15T12:00:00.000Z">15.03.2025</time>');
134
154
  expect(html).toContain('<p class="ew-blog-card__description">The first match day of the season</p>');
@@ -23,6 +23,8 @@ export type GalleryItem = Image & {
23
23
  */
24
24
  export interface ItemCardProps {
25
25
  item: Item & Partial<Linkable>;
26
+ /** Title heading tag. Defaults to `h3`; use `h2` directly below a page heading. */
27
+ headingLevel?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
26
28
  /**
27
29
  * `sizes` attribute of the responsive image. Only `ImageMetadata` sources
28
30
  * get a `srcset`; a string source renders a plain `<img>` and ignores it.
@@ -38,6 +40,8 @@ export interface ItemCardProps {
38
40
 
39
41
  /** `Card` rendered from individual props, exactly as before the content contracts. */
40
42
  export interface LegacyCardProps {
43
+ /** Title heading tag, with the same `h3` default as the item API. */
44
+ headingLevel?: ItemCardProps['headingLevel'];
41
45
  /** @deprecated Pass `item`; `item.title` is rendered. */
42
46
  title: string;
43
47
  /** @deprecated Pass `item`; `item.description` is rendered. */
@@ -1,5 +1,5 @@
1
1
  // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
2
 
3
- exports[`SeoHead legacy rendering baseline > renders the minimal props (darts/party200 style, noIndex) 1`] = `"<title>Start</title><link rel="canonical" href="https://example.com/"><meta name="robots" content="noindex, nofollow"><!-- Open Graph --><meta property="og:title" content="Start"><meta property="og:url" content="https://example.com/"><meta property="og:type" content="website"><meta property="og:locale" content="en_US"><meta property="og:locale:alternate" content="de_DE"><meta property="og:site_name" content="Example Site"><!-- Twitter Cards --><meta name="twitter:card" content="summary"><meta name="twitter:title" content="Start"><!-- hreflang alternates -->"`;
3
+ exports[`SeoHead legacy rendering baseline > renders the minimal props (darts/party200 style, noIndex) 1`] = `"<title>Start</title><link rel="canonical" href="https://example.com/"><meta name="robots" content="noindex, nofollow"><!-- Open Graph --><meta property="og:title" content="Start"><meta property="og:url" content="https://example.com/"><meta property="og:type" content="website"><meta property="og:locale" content="en_US"><meta property="og:site_name" content="Example Site"><!-- Twitter Cards --><meta name="twitter:card" content="summary"><meta name="twitter:title" content="Start"><!-- hreflang alternates -->"`;
4
4
 
5
5
  exports[`SeoHead legacy rendering baseline > renders the props the sites pass (dev.ismaili.de style) 1`] = `"<title>Kontakt</title><meta name="description" content="Get in touch"><link rel="canonical" href="https://example.com/kontakt/"><meta name="theme-color" content="#6366f1"><link rel="manifest" href="/manifest.json"><!-- Open Graph --><meta property="og:title" content="Kontakt"><meta property="og:description" content="Get in touch"><meta property="og:url" content="https://example.com/kontakt/"><meta property="og:type" content="website"><meta property="og:locale" content="de_DE"><meta property="og:locale:alternate" content="en_US"><meta property="og:site_name" content="Example Site"><!-- Twitter Cards --><meta name="twitter:card" content="summary"><meta name="twitter:title" content="Kontakt"><meta name="twitter:description" content="Get in touch"><!-- hreflang alternates --><link rel="alternate" hreflang="de" href="https://example.com/kontakt/"><link rel="alternate" hreflang="en" href="https://example.com/en/contact/">"`;
@@ -5,7 +5,8 @@ import { normalizeHtml } from './normalize-html';
5
5
 
6
6
  /**
7
7
  * Baseline: how today's <SeoHead> renders with today's props. A change to
8
- * these snapshots is a regression of legacy usage - do not update them.
8
+ * these snapshots requires an intentional behavior change. The single-language
9
+ * baseline now omits the formerly invented OG alternate; all other tags stay fixed.
9
10
  */
10
11
  const site = 'https://example.com';
11
12
 
@@ -0,0 +1,55 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { experimental_AstroContainer as AstroContainer } from 'astro/container';
3
+ import SeoHead from '../../components/SeoHead.astro';
4
+
5
+ async function render(locale: string, languages?: string[]) {
6
+ const container = await AstroContainer.create({ astroConfig: { site: 'https://example.com' } });
7
+ return container.renderToString(SeoHead, {
8
+ props: {
9
+ title: 'Gallery',
10
+ pathname: '/gallery',
11
+ locale,
12
+ siteName: 'Example',
13
+ noIndex: true,
14
+ ...(languages ? {
15
+ alternates: languages.map(hreflang => ({ hreflang, href: `https://example.com/${hreflang}/` })),
16
+ } : {}),
17
+ },
18
+ });
19
+ }
20
+
21
+ function alternates(html: string) {
22
+ return [...html.matchAll(/<meta property="og:locale:alternate" content="([^"]+)"/g)]
23
+ .map(match => match[1]);
24
+ }
25
+
26
+ describe('SeoHead Open Graph locales', () => {
27
+ it.each([undefined, [], ['de']])('emits no invented alternate for a German-only site (%j)', async languages => {
28
+ const html = await render('de', languages);
29
+ expect(alternates(html)).toEqual([]);
30
+ expect(html).toContain('<meta property="og:locale" content="de_DE"');
31
+ });
32
+
33
+ it.each([
34
+ ['de', ['de', 'en'], ['en_US']],
35
+ ['en', ['de', 'en'], ['de_DE']],
36
+ ['de', ['de', 'de-DE', 'DE_de', 'en', 'en-US', 'EN_us', 'x-default', 'X-DEFAULT'], ['en_US']],
37
+ ['de-AT', ['de-at', 'de', 'de-CH', 'en-GB', 'EN_gb', 'fr-ca'], ['de_DE', 'de_CH', 'en_GB', 'fr_CA']],
38
+ ['zh-Hant-TW', ['zh-hant-tw', 'zh-Hans-CN', 'pt-br', 'es-419'], ['zh_Hans_CN', 'pt_BR', 'es_419']],
39
+ ])('derives alternates for %s from configured links', async (locale, languages, expected) => {
40
+ const html = await render(locale, languages);
41
+ expect(alternates(html)).toEqual(expected);
42
+ // OG filtering must not remove or normalize the actual hreflang links.
43
+ for (const language of languages) {
44
+ expect(html).toContain(`hreflang="${language}" href="https://example.com/${language}/"`);
45
+ }
46
+ expect(html).toContain('rel="canonical" href="https://example.com/gallery/"');
47
+ expect(html).toContain('name="robots" content="noindex, nofollow"');
48
+ });
49
+
50
+ it.each([
51
+ ['en', 'en_US'], ['de', 'de_DE'], ['de-AT', 'de_AT'], ['en-GB', 'en_GB'], ['fr', 'fr'],
52
+ ])('preserves the current locale mapping for %s', async (locale, expected) => {
53
+ expect(await render(locale)).toContain(`<meta property="og:locale" content="${expected}"`);
54
+ });
55
+ });
@@ -12,6 +12,7 @@ const itemCard: CardProps = {
12
12
  item: { title: 'Touring bicycle', href: '/bikes/touring/', image },
13
13
  imageSizes: '(min-width: 1024px) 33vw, 100vw',
14
14
  class: 'featured',
15
+ headingLevel: 'h2',
15
16
  };
16
17
 
17
18
  const itemCardWithoutLink: CardProps = { item: { title: 'Touring bicycle', description: 'Ready for long rides' } };
@@ -21,8 +22,15 @@ const legacyCard: CardProps = {
21
22
  href: '/bikes/touring/',
22
23
  image: '/images/touring.jpg',
23
24
  imageAlt: 'A touring bicycle',
25
+ headingLevel: 'h4',
24
26
  };
25
27
 
28
+ // @ts-expect-error Only heading elements are allowed as card titles.
29
+ const nonHeadingCard: CardProps = { item: { title: 'Gallery' }, headingLevel: 'div' };
30
+
31
+ // @ts-expect-error Heading levels use tag names, not numeric ranks.
32
+ const numericHeadingCard: CardProps = { title: 'Gallery', headingLevel: 2 };
33
+
26
34
  // @ts-expect-error An item image carries its own alt text; the title is no fallback.
27
35
  const itemImageWithoutAlt: CardProps = { item: { title: 'Touring bicycle', image: { src: '/images/touring.jpg' } } };
28
36
 
@@ -56,6 +64,8 @@ const grid: CardGridProps = { class: 'news-grid' };
56
64
  void itemCard;
57
65
  void itemCardWithoutLink;
58
66
  void legacyCard;
67
+ void nonHeadingCard;
68
+ void numericHeadingCard;
59
69
  void itemImageWithoutAlt;
60
70
  void mixedCard;
61
71
  void legacyCardWithSizes;