@easy-web/core 0.0.0-stage → 1.3.3
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/README.md +19 -2
- package/dist/components/labels.d.ts +37 -0
- package/dist/components/labels.d.ts.map +1 -0
- package/dist/components/labels.js +31 -0
- package/dist/components/labels.js.map +1 -0
- package/dist/components/scope-attributes.d.ts +9 -0
- package/dist/components/scope-attributes.d.ts.map +1 -0
- package/dist/components/scope-attributes.js +13 -0
- package/dist/components/scope-attributes.js.map +1 -0
- package/dist/contracts/capabilities.d.ts +17 -0
- package/dist/contracts/capabilities.d.ts.map +1 -0
- package/dist/contracts/capabilities.js +2 -0
- package/dist/contracts/capabilities.js.map +1 -0
- package/dist/contracts/implements.d.ts +3 -0
- package/dist/contracts/implements.d.ts.map +1 -0
- package/dist/contracts/implements.js +2 -0
- package/dist/contracts/implements.js.map +1 -0
- package/dist/contracts/index.d.ts +7 -0
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/contracts/index.js +7 -0
- package/dist/contracts/index.js.map +1 -0
- package/dist/contracts/jsonld.d.ts +81 -0
- package/dist/contracts/jsonld.d.ts.map +1 -0
- package/dist/contracts/jsonld.js +75 -0
- package/dist/contracts/jsonld.js.map +1 -0
- package/dist/contracts/props.d.ts +273 -0
- package/dist/contracts/props.d.ts.map +1 -0
- package/dist/contracts/props.js +2 -0
- package/dist/contracts/props.js.map +1 -0
- package/dist/contracts/publish.d.ts +5 -0
- package/dist/contracts/publish.d.ts.map +1 -0
- package/dist/contracts/publish.js +7 -0
- package/dist/contracts/publish.js.map +1 -0
- package/dist/contracts/types.d.ts +81 -0
- package/dist/contracts/types.d.ts.map +1 -0
- package/dist/contracts/types.js +2 -0
- package/dist/contracts/types.js.map +1 -0
- package/dist/i18n/factory.d.ts +27 -0
- package/dist/i18n/factory.d.ts.map +1 -0
- package/dist/i18n/factory.js +38 -0
- package/dist/i18n/factory.js.map +1 -0
- package/dist/i18n/formatters.d.ts +6 -0
- package/dist/i18n/formatters.d.ts.map +1 -0
- package/dist/i18n/formatters.js +44 -0
- package/dist/i18n/formatters.js.map +1 -0
- package/dist/i18n/index.d.ts +6 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +6 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/i18n/localized-paths.d.ts +80 -0
- package/dist/i18n/localized-paths.d.ts.map +1 -0
- package/dist/i18n/localized-paths.js +124 -0
- package/dist/i18n/localized-paths.js.map +1 -0
- package/dist/i18n/routing.d.ts +24 -0
- package/dist/i18n/routing.d.ts.map +1 -0
- package/dist/i18n/routing.js +38 -0
- package/dist/i18n/routing.js.map +1 -0
- package/dist/i18n/seo.d.ts +28 -0
- package/dist/i18n/seo.d.ts.map +1 -0
- package/dist/i18n/seo.js +81 -0
- package/dist/i18n/seo.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/markdown/index.d.ts +2 -0
- package/dist/markdown/index.d.ts.map +1 -0
- package/dist/markdown/index.js +2 -0
- package/dist/markdown/index.js.map +1 -0
- package/dist/markdown/plugin.d.ts +12 -0
- package/dist/markdown/plugin.d.ts.map +1 -0
- package/dist/markdown/plugin.js +35 -0
- package/dist/markdown/plugin.js.map +1 -0
- package/dist/schemas/galleries.d.ts +319 -0
- package/dist/schemas/galleries.d.ts.map +1 -0
- package/dist/schemas/galleries.js +136 -0
- package/dist/schemas/galleries.js.map +1 -0
- package/dist/schemas/notFound.d.ts +35 -0
- package/dist/schemas/notFound.d.ts.map +1 -0
- package/dist/schemas/notFound.js +30 -0
- package/dist/schemas/notFound.js.map +1 -0
- package/dist/seo/crawl-policy.d.ts +18 -0
- package/dist/seo/crawl-policy.d.ts.map +1 -0
- package/dist/seo/crawl-policy.js +25 -0
- package/dist/seo/crawl-policy.js.map +1 -0
- package/dist/seo/index.d.ts +24 -0
- package/dist/seo/index.d.ts.map +1 -0
- package/dist/seo/index.js +171 -0
- package/dist/seo/index.js.map +1 -0
- package/dist/seo/routes/robots-txt.d.ts +3 -0
- package/dist/seo/routes/robots-txt.d.ts.map +1 -0
- package/dist/seo/routes/robots-txt.js +28 -0
- package/dist/seo/routes/robots-txt.js.map +1 -0
- package/dist/theme/breakpoints.d.ts +19 -0
- package/dist/theme/breakpoints.d.ts.map +1 -0
- package/dist/theme/breakpoints.js +18 -0
- package/dist/theme/breakpoints.js.map +1 -0
- package/dist/theme/helper.d.ts +6 -0
- package/dist/theme/helper.d.ts.map +1 -0
- package/dist/theme/helper.js +31 -0
- package/dist/theme/helper.js.map +1 -0
- package/dist/theme/index.d.ts +4 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +4 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/theme/tokens.d.ts +120 -0
- package/dist/theme/tokens.d.ts.map +1 -0
- package/dist/theme/tokens.js +119 -0
- package/dist/theme/tokens.js.map +1 -0
- package/package.json +74 -4
- package/src/components/BlogPostCard.astro +83 -0
- package/src/components/Card.astro +73 -0
- package/src/components/CardGrid.astro +34 -0
- package/src/components/ContactSection.astro +71 -0
- package/src/components/CtaSection.astro +79 -0
- package/src/components/DraftBanner.astro +34 -0
- package/src/components/Footer.astro +138 -0
- package/src/components/GalleryCarousel.astro +304 -0
- package/src/components/GalleryFeatureHighlight.astro +159 -0
- package/src/components/GalleryHeroSlider.astro +365 -0
- package/src/components/GalleryImageGrid.astro +149 -0
- package/src/components/GalleryLightboxGrid.astro +350 -0
- package/src/components/GalleryMasonryGrid.astro +133 -0
- package/src/components/GallerySection.astro +36 -0
- package/src/components/Header.astro +205 -0
- package/src/components/HeaderCentered.astro +230 -0
- package/src/components/HeaderFlyout.astro +370 -0
- package/src/components/HeaderHideOnScroll.astro +234 -0
- package/src/components/Hero.astro +75 -0
- package/src/components/LanguageNotice.astro +33 -0
- package/src/components/LanguageSwitch.astro +82 -0
- package/src/components/LegalLayout.astro +62 -0
- package/src/components/Media.astro +54 -0
- package/src/components/NotFound.astro +115 -0
- package/src/components/PageShell.astro +82 -0
- package/src/components/Prose.astro +162 -0
- package/src/components/Section.astro +37 -0
- package/src/components/SeoHead.astro +109 -0
- package/src/components/StructuredData.astro +8 -0
- package/src/components/ThemeToggle.astro +84 -0
- package/src/components/UniversalMedia.astro +106 -0
- package/src/components/__tests__/Card.test.ts +183 -0
- package/src/components/__tests__/Gallery.test.ts +83 -0
- package/src/components/__tests__/GalleryLightbox.behavior.test.ts +119 -0
- package/src/components/__tests__/Media.test.ts +43 -0
- package/src/components/__tests__/NotFound.test.ts +65 -0
- package/src/components/__tests__/SiteChrome.test.ts +232 -0
- package/src/components/__tests__/StructuredData.test.ts +45 -0
- package/src/components/__tests__/UniversalMedia.test.ts +65 -0
- package/src/components/__tests__/__snapshots__/legacy-baseline.test.ts.snap +75 -0
- package/src/components/__tests__/fixtures/ScopeHost.astro +17 -0
- package/src/components/__tests__/fixtures/legacy-props.ts +221 -0
- package/src/components/__tests__/legacy-baseline.test.ts +29 -0
- package/src/components/__tests__/normalize-html.ts +26 -0
- package/src/components/__tests__/section-components.test.ts +94 -0
- package/src/components/labels.ts +67 -0
- package/src/components/scope-attributes.ts +11 -0
- package/src/contracts/__tests__/contracts.test.ts +60 -0
- package/src/contracts/__tests__/jsonld.test.ts +145 -0
- package/src/contracts/__tests__/publish.test.ts +36 -0
- package/src/contracts/capabilities.ts +22 -0
- package/src/contracts/implements.ts +3 -0
- package/src/contracts/index.ts +6 -0
- package/src/contracts/jsonld.ts +160 -0
- package/src/contracts/props.ts +307 -0
- package/src/contracts/publish.ts +13 -0
- package/src/contracts/types.ts +99 -0
- package/src/i18n/__tests__/bundle-budget.test.ts +19 -0
- package/src/i18n/__tests__/factory.test.ts +54 -0
- package/src/i18n/__tests__/formatters.test.ts +66 -0
- package/src/i18n/__tests__/i18n.test.ts +41 -0
- package/src/i18n/__tests__/localized-paths.test.ts +258 -0
- package/src/i18n/__tests__/routing-multi-locale.test.ts +89 -0
- package/src/i18n/__tests__/routing.test.ts +80 -0
- package/src/i18n/__tests__/seo.test.ts +140 -0
- package/src/i18n/factory.ts +66 -0
- package/src/i18n/formatters.ts +58 -0
- package/src/i18n/index.ts +5 -0
- package/src/i18n/localized-paths.ts +181 -0
- package/src/i18n/routing.ts +50 -0
- package/src/i18n/seo.ts +131 -0
- package/src/index.ts +1 -0
- package/src/markdown/__tests__/__fixtures__/abs-src-assets.md +1 -0
- package/src/markdown/__tests__/__fixtures__/external-url.md +1 -0
- package/src/markdown/__tests__/__fixtures__/public-slash.md +1 -0
- package/src/markdown/__tests__/__fixtures__/rel-double-dot.md +1 -0
- package/src/markdown/__tests__/index.test.ts +60 -0
- package/src/markdown/index.ts +1 -0
- package/src/markdown/plugin.ts +42 -0
- package/src/schemas/__tests__/notFound.test.ts +32 -0
- package/src/schemas/galleries.ts +152 -0
- package/src/schemas/notFound.ts +33 -0
- package/src/seo/__tests__/__snapshots__/legacy-baseline.test.ts.snap +5 -0
- package/src/seo/__tests__/crawl-policy.test.ts +50 -0
- package/src/seo/__tests__/integration.test.ts +195 -0
- package/src/seo/__tests__/legacy-baseline.test.ts +48 -0
- package/src/seo/__tests__/no-index-resolution.test.ts +53 -0
- package/src/seo/__tests__/normalize-html.ts +20 -0
- package/src/seo/__tests__/robots-txt.test.ts +66 -0
- package/src/seo/__tests__/sitemap-options.test.ts +400 -0
- package/src/seo/crawl-policy.ts +36 -0
- package/src/seo/index.ts +254 -0
- package/src/seo/routes/robots-txt.ts +36 -0
- package/src/theme/__tests__/__snapshots__/tokens.test.ts.snap +122 -0
- package/src/theme/__tests__/bundle-budget.test.ts +23 -0
- package/src/theme/__tests__/contrast.test.ts +127 -0
- package/src/theme/__tests__/helper.test.ts +25 -0
- package/src/theme/__tests__/theme.test.ts +14 -0
- package/src/theme/__tests__/tokens-extended.test.ts +146 -0
- package/src/theme/__tests__/tokens.test.ts +68 -0
- package/src/theme/breakpoints.ts +19 -0
- package/src/theme/helper.ts +32 -0
- package/src/theme/index.ts +9 -0
- package/src/theme/tokens.ts +120 -0
- package/src/type-tests/card-props.ts +66 -0
- package/src/type-tests/contracts.ts +31 -0
- package/src/type-tests/section-props.ts +23 -0
- package/styles/fonts.css +45 -0
- package/styles/tokens.css +198 -0
package/README.md
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @easy-web/core
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The base package for the `@easy-web/*` family. It owns the shared content contracts and, as the consolidation continues, the reusable components, theme, internationalization, SEO, and markdown primitives used by easy-web sites.
|
|
4
|
+
|
|
5
|
+
## Subpaths
|
|
6
|
+
|
|
7
|
+
- `@easy-web/core/contracts` - content and capability contracts
|
|
8
|
+
- `@easy-web/core/theme` - theme helpers and tokens
|
|
9
|
+
- `@easy-web/core/i18n` - localization helpers
|
|
10
|
+
- `@easy-web/core/seo` - SEO integration and components
|
|
11
|
+
- `@easy-web/core/markdown` - markdown processing helpers
|
|
12
|
+
- `@easy-web/core/components/*` - Astro components
|
|
13
|
+
- `@easy-web/core/schemas/*` - content schemas
|
|
14
|
+
- `@easy-web/core/styles/tokens.css` and `@easy-web/core/styles/fonts.css` - shared styles
|
|
15
|
+
|
|
16
|
+
## Add-ons
|
|
17
|
+
|
|
18
|
+
Four concerns remain separate because they depend on a specific platform or runtime: `@easy-web/swa` for Azure Static Web Apps, the `cms-adapters` package for Decap CMS, `@easy-web/auth` for React and MSAL authentication, and `@easy-web/brand` for brand tooling.
|
|
19
|
+
|
|
20
|
+
This package is private while the consolidation is in progress and is made publishable only by the family release task.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User-facing strings of the core components, one dictionary per UI language.
|
|
3
|
+
*
|
|
4
|
+
* Components never hardcode these strings. Each one accepts `lang` (default
|
|
5
|
+
* 'en', so legacy output is unchanged) and `labels` (per-key overrides), calls
|
|
6
|
+
* `resolveLabels(lang, labels)` and reads only the keys it renders. Unknown
|
|
7
|
+
* languages fall back to the English dictionary.
|
|
8
|
+
*/
|
|
9
|
+
export interface Labels {
|
|
10
|
+
mainNavigation: string;
|
|
11
|
+
toggleNavigationMenu: string;
|
|
12
|
+
toggleColorTheme: string;
|
|
13
|
+
skipToMainContent: string;
|
|
14
|
+
legal: string;
|
|
15
|
+
carousel: string;
|
|
16
|
+
slide: string;
|
|
17
|
+
imageCarousel: string;
|
|
18
|
+
heroSlider: string;
|
|
19
|
+
previousSlide: string;
|
|
20
|
+
nextSlide: string;
|
|
21
|
+
slideNavigation: string;
|
|
22
|
+
goToSlide: string;
|
|
23
|
+
slidePosition: string;
|
|
24
|
+
openImage: string;
|
|
25
|
+
imageLightbox: string;
|
|
26
|
+
closeLightbox: string;
|
|
27
|
+
previousImage: string;
|
|
28
|
+
nextImage: string;
|
|
29
|
+
/** Accessible name of a language-switch link; receives the target language code. */
|
|
30
|
+
switchToLanguage: (lang: string) => string;
|
|
31
|
+
}
|
|
32
|
+
export declare function resolveLabels(lang?: string, overrides?: Partial<Labels>): Labels;
|
|
33
|
+
export type GalleryLabelProps = {
|
|
34
|
+
readonly lang?: string;
|
|
35
|
+
readonly labels?: Partial<Labels>;
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=labels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"labels.d.ts","sourceRoot":"","sources":["../../src/components/labels.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,WAAW,MAAM;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,gBAAgB,EAAE,MAAM,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,oFAAoF;IACpF,gBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CAC5C;AAgCD,wBAAgB,aAAa,CAAC,IAAI,SAAO,EAAE,SAAS,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAE9E;AAED,MAAM,MAAM,iBAAiB,GAAG;IAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const en = {
|
|
2
|
+
mainNavigation: 'Main navigation',
|
|
3
|
+
toggleNavigationMenu: 'Toggle navigation menu',
|
|
4
|
+
toggleColorTheme: 'Toggle color theme (Darkmode)',
|
|
5
|
+
skipToMainContent: 'Skip to main content',
|
|
6
|
+
legal: 'Legal',
|
|
7
|
+
carousel: 'carousel', slide: 'slide', imageCarousel: 'Image carousel', heroSlider: 'Hero slider',
|
|
8
|
+
previousSlide: 'Previous slide', nextSlide: 'Next slide', slideNavigation: 'Slide navigation',
|
|
9
|
+
goToSlide: 'Go to slide {number}', slidePosition: '{number} / {total}',
|
|
10
|
+
openImage: 'Open {alt}', imageLightbox: 'Image lightbox', closeLightbox: 'Close lightbox',
|
|
11
|
+
previousImage: 'Previous image', nextImage: 'Next image',
|
|
12
|
+
switchToLanguage: (lang) => `Switch to ${lang}`,
|
|
13
|
+
};
|
|
14
|
+
const de = {
|
|
15
|
+
mainNavigation: 'Hauptnavigation',
|
|
16
|
+
toggleNavigationMenu: 'Navigationsmenü umschalten',
|
|
17
|
+
toggleColorTheme: 'Farbschema wechseln (Darkmode)',
|
|
18
|
+
skipToMainContent: 'Zum Hauptinhalt springen',
|
|
19
|
+
legal: 'Rechtliches',
|
|
20
|
+
carousel: 'Karussell', slide: 'Folie', imageCarousel: 'Bilderkarussell', heroSlider: 'Hero-Slider',
|
|
21
|
+
previousSlide: 'Vorherige Folie', nextSlide: 'Nächste Folie', slideNavigation: 'Foliennavigation',
|
|
22
|
+
goToSlide: 'Zu Folie {number}', slidePosition: '{number} / {total}',
|
|
23
|
+
openImage: '{alt} öffnen', imageLightbox: 'Bildansicht', closeLightbox: 'Bildansicht schließen',
|
|
24
|
+
previousImage: 'Vorheriges Bild', nextImage: 'Nächstes Bild',
|
|
25
|
+
switchToLanguage: (lang) => `Wechseln zu ${lang}`,
|
|
26
|
+
};
|
|
27
|
+
const dictionaries = { en, de };
|
|
28
|
+
export function resolveLabels(lang = 'en', overrides) {
|
|
29
|
+
return { ...(dictionaries[lang] ?? dictionaries.en), ...overrides };
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=labels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"labels.js","sourceRoot":"","sources":["../../src/components/labels.ts"],"names":[],"mappings":"AAgCA,MAAM,EAAE,GAAW;IACjB,cAAc,EAAE,iBAAiB;IACjC,oBAAoB,EAAE,wBAAwB;IAC9C,gBAAgB,EAAE,+BAA+B;IACjD,iBAAiB,EAAE,sBAAsB;IACzC,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,UAAU,EAAE,aAAa;IAChG,aAAa,EAAE,gBAAgB,EAAE,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,kBAAkB;IAC7F,SAAS,EAAE,sBAAsB,EAAE,aAAa,EAAE,oBAAoB;IACtE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,EAAE,gBAAgB;IACzF,aAAa,EAAE,gBAAgB,EAAE,SAAS,EAAE,YAAY;IACxD,gBAAgB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,IAAI,EAAE;CAChD,CAAC;AAEF,MAAM,EAAE,GAAW;IACjB,cAAc,EAAE,iBAAiB;IACjC,oBAAoB,EAAE,4BAA4B;IAClD,gBAAgB,EAAE,gCAAgC;IAClD,iBAAiB,EAAE,0BAA0B;IAC7C,KAAK,EAAE,aAAa;IACpB,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,UAAU,EAAE,aAAa;IAClG,aAAa,EAAE,iBAAiB,EAAE,SAAS,EAAE,eAAe,EAAE,eAAe,EAAE,kBAAkB;IACjG,SAAS,EAAE,mBAAmB,EAAE,aAAa,EAAE,oBAAoB;IACnE,SAAS,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,uBAAuB;IAC/F,aAAa,EAAE,iBAAiB,EAAE,SAAS,EAAE,eAAe;IAC5D,gBAAgB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,eAAe,IAAI,EAAE;CAClD,CAAC;AAEF,MAAM,YAAY,GAA2B,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;AAExD,MAAM,UAAU,aAAa,CAAC,IAAI,GAAG,IAAI,EAAE,SAA2B;IACpE,OAAO,EAAE,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,YAAY,CAAC,EAAE,CAAC,EAAE,GAAG,SAAS,EAAE,CAAC;AACtE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Astro hands the parent template's `data-astro-cid-*` scope attribute to every
|
|
3
|
+
* child component as a prop. A component that puts a caller's `class` on its
|
|
4
|
+
* root must put that attribute there too, or the caller's scoped rule for the
|
|
5
|
+
* class never matches. Without a class nothing is forwarded, so a call without
|
|
6
|
+
* `class` renders exactly as before.
|
|
7
|
+
*/
|
|
8
|
+
export declare function scopeAttributes(className: string | undefined, props: object): Record<string, unknown>;
|
|
9
|
+
//# sourceMappingURL=scope-attributes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope-attributes.d.ts","sourceRoot":"","sources":["../../src/components/scope-attributes.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAGrG"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Astro hands the parent template's `data-astro-cid-*` scope attribute to every
|
|
3
|
+
* child component as a prop. A component that puts a caller's `class` on its
|
|
4
|
+
* root must put that attribute there too, or the caller's scoped rule for the
|
|
5
|
+
* class never matches. Without a class nothing is forwarded, so a call without
|
|
6
|
+
* `class` renders exactly as before.
|
|
7
|
+
*/
|
|
8
|
+
export function scopeAttributes(className, props) {
|
|
9
|
+
if (!className)
|
|
10
|
+
return {};
|
|
11
|
+
return Object.fromEntries(Object.entries(props).filter(([key]) => key.startsWith('data-astro-cid-')));
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=scope-attributes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope-attributes.js","sourceRoot":"","sources":["../../src/components/scope-attributes.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,SAA6B,EAAE,KAAa;IAC1E,IAAI,CAAC,SAAS;QAAE,OAAO,EAAE,CAAC;IAC1B,OAAO,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;AACxG,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { AstroComponentFactory } from 'astro/runtime/server/index.js';
|
|
2
|
+
import type { Image } from './types.js';
|
|
3
|
+
export interface HasImage {
|
|
4
|
+
image: Image;
|
|
5
|
+
}
|
|
6
|
+
export interface HasPhotos {
|
|
7
|
+
photos: Image[];
|
|
8
|
+
}
|
|
9
|
+
export type RenderedContent = AstroComponentFactory;
|
|
10
|
+
export interface HasBody {
|
|
11
|
+
Content: RenderedContent;
|
|
12
|
+
}
|
|
13
|
+
export interface Linkable {
|
|
14
|
+
href: string;
|
|
15
|
+
}
|
|
16
|
+
export type Rendered<Data> = Data & HasBody;
|
|
17
|
+
//# sourceMappingURL=capabilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../src/contracts/capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,KAAK,CAAC;CACd;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,KAAK,EAAE,CAAC;CACjB;AAED,MAAM,MAAM,eAAe,GAAG,qBAAqB,CAAC;AAEpD,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,eAAe,CAAC;CAC1B;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,QAAQ,CAAC,IAAI,IAAI,IAAI,GAAG,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../../src/contracts/capabilities.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"implements.d.ts","sourceRoot":"","sources":["../../src/contracts/implements.ts"],"names":[],"mappings":"AAAA,wBAAgB,gBAAgB,CAAC,KAAK,SAAS,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAG;AAE7E,MAAM,MAAM,UAAU,CAAC,IAAI,EAAE,QAAQ,IAAI,IAAI,SAAS,QAAQ,GAAG,IAAI,GAAG,KAAK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"implements.js","sourceRoot":"","sources":["../../src/contracts/implements.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,gBAAgB,KAA4C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { Article, Event, Organization, Page, Person, Product } from './types.js';
|
|
2
|
+
export interface JsonLdContext {
|
|
3
|
+
url: string;
|
|
4
|
+
siteUrl: string;
|
|
5
|
+
inLanguage?: string;
|
|
6
|
+
}
|
|
7
|
+
interface JsonLdBase<T extends string> {
|
|
8
|
+
'@context': 'https://schema.org';
|
|
9
|
+
'@type': T;
|
|
10
|
+
inLanguage?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface JsonLdWebPage extends JsonLdBase<'WebPage'> {
|
|
13
|
+
name: string;
|
|
14
|
+
description: string;
|
|
15
|
+
url: string;
|
|
16
|
+
}
|
|
17
|
+
export type ArticleType = 'Article' | 'NewsArticle' | 'BlogPosting';
|
|
18
|
+
export interface JsonLdArticle extends JsonLdBase<ArticleType> {
|
|
19
|
+
name: string;
|
|
20
|
+
headline: string;
|
|
21
|
+
description?: string;
|
|
22
|
+
image?: string;
|
|
23
|
+
url: string;
|
|
24
|
+
datePublished: string;
|
|
25
|
+
dateModified?: string;
|
|
26
|
+
author?: {
|
|
27
|
+
'@type': 'Person';
|
|
28
|
+
name: string;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export type EventType = 'Event' | 'SportsEvent';
|
|
32
|
+
export interface JsonLdEvent extends JsonLdBase<EventType> {
|
|
33
|
+
name: string;
|
|
34
|
+
description?: string;
|
|
35
|
+
image?: string;
|
|
36
|
+
url: string;
|
|
37
|
+
startDate: string;
|
|
38
|
+
endDate?: string;
|
|
39
|
+
location?: {
|
|
40
|
+
'@type': 'Place';
|
|
41
|
+
name: string;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export type OrganizationType = 'Organization' | 'SportsOrganization';
|
|
45
|
+
export interface JsonLdOrganization extends JsonLdBase<OrganizationType> {
|
|
46
|
+
name: string;
|
|
47
|
+
logo: string;
|
|
48
|
+
url?: string;
|
|
49
|
+
description?: string;
|
|
50
|
+
}
|
|
51
|
+
export interface JsonLdPerson extends JsonLdBase<'Person'> {
|
|
52
|
+
name: string;
|
|
53
|
+
description?: string;
|
|
54
|
+
image?: string;
|
|
55
|
+
email?: string;
|
|
56
|
+
}
|
|
57
|
+
export type ProductType = 'Product' | 'Motorcycle';
|
|
58
|
+
export interface JsonLdProduct extends JsonLdBase<ProductType> {
|
|
59
|
+
name: string;
|
|
60
|
+
description?: string;
|
|
61
|
+
image: string;
|
|
62
|
+
url: string;
|
|
63
|
+
}
|
|
64
|
+
export declare const jsonLd: {
|
|
65
|
+
page(page: Page, ctx: JsonLdContext): JsonLdWebPage;
|
|
66
|
+
article(article: Article, ctx: JsonLdContext, opts: {
|
|
67
|
+
type: ArticleType;
|
|
68
|
+
}): JsonLdArticle;
|
|
69
|
+
event(event: Event, ctx: JsonLdContext, opts: {
|
|
70
|
+
type: EventType;
|
|
71
|
+
}): JsonLdEvent;
|
|
72
|
+
organization(org: Organization, ctx: JsonLdContext, opts: {
|
|
73
|
+
type: OrganizationType;
|
|
74
|
+
}): JsonLdOrganization;
|
|
75
|
+
person(person: Person, ctx: JsonLdContext): JsonLdPerson;
|
|
76
|
+
product(product: Product, ctx: JsonLdContext, opts: {
|
|
77
|
+
type: ProductType;
|
|
78
|
+
}): JsonLdProduct;
|
|
79
|
+
};
|
|
80
|
+
export {};
|
|
81
|
+
//# sourceMappingURL=jsonld.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonld.d.ts","sourceRoot":"","sources":["../../src/contracts/jsonld.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,KAAK,EAGL,YAAY,EACZ,IAAI,EACJ,MAAM,EACN,OAAO,EACR,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,UAAU,CAAC,CAAC,SAAS,MAAM;IACnC,UAAU,EAAE,oBAAoB,CAAC;IACjC,OAAO,EAAE,CAAC,CAAC;IACX,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,aAAc,SAAQ,UAAU,CAAC,SAAS,CAAC;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,MAAM,WAAW,GAAG,SAAS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CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,YAAY,CAAC;AACnD,MAAM,WAAW,aAAc,SAAQ,UAAU,CAAC,WAAW,CAAC;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb;AAoBD,eAAO,MAAM,MAAM;eACN,IAAI,OAAO,aAAa,GAAG,aAAa;qBASlC,OAAO,OAAO,aAAa,QAAQ;QAAE,IAAI,EAAE,WAAW,CAAA;KAAE,GAAG,aAAa;iBAc5E,KAAK,OAAO,aAAa,QAAQ;QAAE,IAAI,EAAE,SAAS,CAAA;KAAE,GAAG,WAAW;sBAa7D,YAAY,OAAO,aAAa,QAAQ;QAAE,IAAI,EAAE,gBAAgB,CAAA;KAAE,GAAG,kBAAkB;mBAU1F,MAAM,OAAO,aAAa,GAAG,YAAY;qBAUvC,OAAO,OAAO,aAAa,QAAQ;QAAE,IAAI,EAAE,WAAW,CAAA;KAAE,GAAG,aAAa;CAS1F,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
const absolute = (value, siteUrl) => new URL(value, siteUrl).toString();
|
|
2
|
+
function imageUrl(image, siteUrl) {
|
|
3
|
+
if (!image)
|
|
4
|
+
return undefined;
|
|
5
|
+
const src = image.src;
|
|
6
|
+
return absolute(typeof src === 'string' ? src : src.src, siteUrl);
|
|
7
|
+
}
|
|
8
|
+
// Absent optional values must be absent keys, not `undefined`-valued ones.
|
|
9
|
+
function compact(value) {
|
|
10
|
+
return Object.fromEntries(Object.entries(value).filter(([, v]) => v !== undefined));
|
|
11
|
+
}
|
|
12
|
+
const head = (type, ctx) => compact({ '@context': 'https://schema.org', '@type': type, inLanguage: ctx.inLanguage });
|
|
13
|
+
export const jsonLd = {
|
|
14
|
+
page(page, ctx) {
|
|
15
|
+
return compact({
|
|
16
|
+
...head('WebPage', ctx),
|
|
17
|
+
name: page.title,
|
|
18
|
+
description: page.description,
|
|
19
|
+
url: absolute(ctx.url, ctx.siteUrl),
|
|
20
|
+
});
|
|
21
|
+
},
|
|
22
|
+
article(article, ctx, opts) {
|
|
23
|
+
return compact({
|
|
24
|
+
...head(opts.type, ctx),
|
|
25
|
+
name: article.title,
|
|
26
|
+
headline: article.title,
|
|
27
|
+
description: article.description,
|
|
28
|
+
image: imageUrl(article.image, ctx.siteUrl),
|
|
29
|
+
url: absolute(ctx.url, ctx.siteUrl),
|
|
30
|
+
datePublished: article.datePublished.toISOString(),
|
|
31
|
+
dateModified: article.dateModified?.toISOString(),
|
|
32
|
+
author: article.author === undefined ? undefined : { '@type': 'Person', name: article.author },
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
event(event, ctx, opts) {
|
|
36
|
+
return compact({
|
|
37
|
+
...head(opts.type, ctx),
|
|
38
|
+
name: event.title,
|
|
39
|
+
description: event.description,
|
|
40
|
+
image: imageUrl(event.image, ctx.siteUrl),
|
|
41
|
+
url: absolute(ctx.url, ctx.siteUrl),
|
|
42
|
+
startDate: event.startDate.toISOString(),
|
|
43
|
+
endDate: event.endDate?.toISOString(),
|
|
44
|
+
location: event.location === undefined ? undefined : { '@type': 'Place', name: event.location },
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
organization(org, ctx, opts) {
|
|
48
|
+
return compact({
|
|
49
|
+
...head(opts.type, ctx),
|
|
50
|
+
name: org.name,
|
|
51
|
+
logo: imageUrl(org.logo, ctx.siteUrl),
|
|
52
|
+
url: org.url === undefined ? undefined : absolute(org.url, ctx.siteUrl),
|
|
53
|
+
description: org.description,
|
|
54
|
+
});
|
|
55
|
+
},
|
|
56
|
+
person(person, ctx) {
|
|
57
|
+
return compact({
|
|
58
|
+
...head('Person', ctx),
|
|
59
|
+
name: person.name,
|
|
60
|
+
description: person.role,
|
|
61
|
+
image: imageUrl(person.image, ctx.siteUrl),
|
|
62
|
+
email: person.email,
|
|
63
|
+
});
|
|
64
|
+
},
|
|
65
|
+
product(product, ctx, opts) {
|
|
66
|
+
return compact({
|
|
67
|
+
...head(opts.type, ctx),
|
|
68
|
+
name: product.title,
|
|
69
|
+
description: product.description,
|
|
70
|
+
image: imageUrl(product.image, ctx.siteUrl),
|
|
71
|
+
url: absolute(ctx.url, ctx.siteUrl),
|
|
72
|
+
});
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=jsonld.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonld.js","sourceRoot":"","sources":["../../src/contracts/jsonld.ts"],"names":[],"mappings":"AA2EA,MAAM,QAAQ,GAAG,CAAC,KAAa,EAAE,OAAe,EAAU,EAAE,CAAC,IAAI,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC;AAIhG,SAAS,QAAQ,CAAC,KAAqC,EAAE,OAAe;IACtE,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAC;IAC7B,MAAM,GAAG,GAAgB,KAAK,CAAC,GAAG,CAAC;IACnC,OAAO,QAAQ,CAAC,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AACpE,CAAC;AAED,2EAA2E;AAC3E,SAAS,OAAO,CAAmB,KAAQ;IACzC,OAAO,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAM,CAAC;AAC3F,CAAC;AAED,MAAM,IAAI,GAAG,CAAmB,IAAO,EAAE,GAAkB,EAAiB,EAAE,CAC5E,OAAO,CAAC,EAAE,UAAU,EAAE,oBAA6B,EAAE,OAAO,EAAE,IAAI,EAAE,UAA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C,KAAK,EAAE,MAAM,CAAC,KAAK;SACpB,CAAC,CAAC;IACL,CAAC;IAED,OAAO,CAAC,OAAgB,EAAE,GAAkB,EAAE,IAA2B;QACvE,OAAO,OAAO,CAAC;YACb,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC;YACvB,IAAI,EAAE,OAAO,CAAC,KAAK;YACnB,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC;YAC3C,GAAG,EAAE,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,OAAO,CAAC;SACpC,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import type { Linkable } from './capabilities.js';
|
|
2
|
+
import type { Article, Image, Item } from './types.js';
|
|
3
|
+
import type { AnyImage } from './types.js';
|
|
4
|
+
import type { Link, NavItem } from './types.js';
|
|
5
|
+
import type { Labels } from '../components/labels.js';
|
|
6
|
+
export type GalleryItem = Image & {
|
|
7
|
+
readonly caption?: string;
|
|
8
|
+
readonly title?: string;
|
|
9
|
+
readonly subtitle?: string;
|
|
10
|
+
readonly description?: string;
|
|
11
|
+
readonly href?: string;
|
|
12
|
+
readonly cta?: string;
|
|
13
|
+
readonly imagePosition?: 'left' | 'right';
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* `Card` rendered from a content contract. Title, description and image come
|
|
17
|
+
* from `item`, and the card becomes a link when `item.href` is set. The image
|
|
18
|
+
* alt text comes only from `item.image.alt`; the title is never a fallback.
|
|
19
|
+
*/
|
|
20
|
+
export interface ItemCardProps {
|
|
21
|
+
item: Item & Partial<Linkable>;
|
|
22
|
+
/**
|
|
23
|
+
* `sizes` attribute of the responsive image. Only `ImageMetadata` sources
|
|
24
|
+
* get a `srcset`; a string source renders a plain `<img>` and ignores it.
|
|
25
|
+
*/
|
|
26
|
+
imageSizes?: string;
|
|
27
|
+
class?: string;
|
|
28
|
+
title?: never;
|
|
29
|
+
description?: never;
|
|
30
|
+
href?: never;
|
|
31
|
+
image?: never;
|
|
32
|
+
imageAlt?: never;
|
|
33
|
+
}
|
|
34
|
+
/** `Card` rendered from individual props, exactly as before the content contracts. */
|
|
35
|
+
export interface LegacyCardProps {
|
|
36
|
+
/** @deprecated Pass `item`; `item.title` is rendered. */
|
|
37
|
+
title: string;
|
|
38
|
+
/** @deprecated Pass `item`; `item.description` is rendered. */
|
|
39
|
+
description?: string;
|
|
40
|
+
/** @deprecated Pass `item`; `item.href` makes the card a link. */
|
|
41
|
+
href?: string;
|
|
42
|
+
/** @deprecated Pass `item`; `item.image` also accepts a local image asset. */
|
|
43
|
+
image?: string;
|
|
44
|
+
/**
|
|
45
|
+
* @deprecated Pass `item`; the alt text then comes from `item.image.alt`.
|
|
46
|
+
* This prop falls back to `title`, the `item` path never does.
|
|
47
|
+
*/
|
|
48
|
+
imageAlt?: string;
|
|
49
|
+
class?: string;
|
|
50
|
+
item?: never;
|
|
51
|
+
imageSizes?: never;
|
|
52
|
+
}
|
|
53
|
+
export type CardProps = ItemCardProps | LegacyCardProps;
|
|
54
|
+
/**
|
|
55
|
+
* `BlogPostCard` rendered from an article contract. The date comes from
|
|
56
|
+
* `item.datePublished`; the image alt text only from `item.image.alt`.
|
|
57
|
+
*/
|
|
58
|
+
export interface ItemBlogPostCardProps {
|
|
59
|
+
item: Article & Linkable;
|
|
60
|
+
/** `sizes` attribute of the responsive image, as in `ItemCardProps`. */
|
|
61
|
+
imageSizes?: string;
|
|
62
|
+
/** Locale of the formatted date, e.g. `de`. Defaults to the runtime locale. */
|
|
63
|
+
locale?: string;
|
|
64
|
+
class?: string;
|
|
65
|
+
title?: never;
|
|
66
|
+
description?: never;
|
|
67
|
+
href?: never;
|
|
68
|
+
pubDate?: never;
|
|
69
|
+
heroImage?: never;
|
|
70
|
+
heroImageAlt?: never;
|
|
71
|
+
}
|
|
72
|
+
/** `BlogPostCard` rendered from individual props, exactly as before the content contracts. */
|
|
73
|
+
export interface LegacyBlogPostCardProps {
|
|
74
|
+
/** @deprecated Pass `item`; `item.title` is rendered. */
|
|
75
|
+
title: string;
|
|
76
|
+
/** @deprecated Pass `item`; `item.description` is rendered. */
|
|
77
|
+
description: string;
|
|
78
|
+
/** @deprecated Pass `item`; `item.href` is the link target. */
|
|
79
|
+
href: string;
|
|
80
|
+
/** @deprecated Pass `item`; the date comes from `item.datePublished`. */
|
|
81
|
+
pubDate: Date;
|
|
82
|
+
/** @deprecated Pass `item`; `item.image` also accepts a local image asset. */
|
|
83
|
+
heroImage?: string;
|
|
84
|
+
/**
|
|
85
|
+
* @deprecated Pass `item`; the alt text then comes from `item.image.alt`.
|
|
86
|
+
* This prop falls back to `title`, the `item` path never does.
|
|
87
|
+
*/
|
|
88
|
+
heroImageAlt?: string;
|
|
89
|
+
/** Locale of the formatted date, e.g. `de`. Defaults to the runtime locale. */
|
|
90
|
+
locale?: string;
|
|
91
|
+
class?: string;
|
|
92
|
+
item?: never;
|
|
93
|
+
imageSizes?: never;
|
|
94
|
+
}
|
|
95
|
+
export type BlogPostCardProps = ItemBlogPostCardProps | LegacyBlogPostCardProps;
|
|
96
|
+
export interface CardGridProps {
|
|
97
|
+
class?: string;
|
|
98
|
+
}
|
|
99
|
+
export interface HeroProps {
|
|
100
|
+
title: string;
|
|
101
|
+
subtitle?: string;
|
|
102
|
+
ctaLabel?: string;
|
|
103
|
+
ctaHref?: string;
|
|
104
|
+
variant?: 'centered' | 'left-aligned';
|
|
105
|
+
/** Extra classes for the root `<section>`, after `ew-hero`. */
|
|
106
|
+
class?: string;
|
|
107
|
+
}
|
|
108
|
+
export interface SectionProps {
|
|
109
|
+
title?: string;
|
|
110
|
+
id?: string;
|
|
111
|
+
/** Extra classes for the root `<section>`, after `ew-section`. */
|
|
112
|
+
class?: string;
|
|
113
|
+
}
|
|
114
|
+
export interface CtaSectionProps {
|
|
115
|
+
heading: string;
|
|
116
|
+
body?: string;
|
|
117
|
+
buttonLabel: string;
|
|
118
|
+
buttonHref: string;
|
|
119
|
+
variant?: 'default' | 'muted' | 'primary';
|
|
120
|
+
/** Extra classes for the root `<section>`, after `ew-cta`. */
|
|
121
|
+
class?: string;
|
|
122
|
+
}
|
|
123
|
+
export interface ContactSectionProps {
|
|
124
|
+
heading: string;
|
|
125
|
+
body?: string;
|
|
126
|
+
email: string;
|
|
127
|
+
buttonLabel: string;
|
|
128
|
+
/** Extra classes for the root `<section>`, after `ew-contact`. */
|
|
129
|
+
class?: string;
|
|
130
|
+
}
|
|
131
|
+
export interface DraftBannerProps {
|
|
132
|
+
message: string;
|
|
133
|
+
/** Extra classes for the root `<div>`, after `ew-draft-banner`. */
|
|
134
|
+
class?: string;
|
|
135
|
+
}
|
|
136
|
+
export interface LanguageNoticeProps {
|
|
137
|
+
message: string;
|
|
138
|
+
/** Extra classes for the root `<div>`, after `ew-language-notice`. */
|
|
139
|
+
class?: string;
|
|
140
|
+
}
|
|
141
|
+
export interface LegalLayoutProps {
|
|
142
|
+
title: string;
|
|
143
|
+
lastUpdated?: string;
|
|
144
|
+
/** Extra classes for the root `<article>`, after `ew-legal`. */
|
|
145
|
+
class?: string;
|
|
146
|
+
}
|
|
147
|
+
export interface ProseProps {
|
|
148
|
+
/** Extra classes for the root `<div>`, after `ew-prose`. */
|
|
149
|
+
class?: string;
|
|
150
|
+
}
|
|
151
|
+
export interface NotFoundProps {
|
|
152
|
+
/** Current page locale (e.g. `"de"`, `"en"`). */
|
|
153
|
+
currentLang: string;
|
|
154
|
+
/** Site default locale - used for `rootHref` auto-compute and the fallback copy. */
|
|
155
|
+
defaultLocale: string;
|
|
156
|
+
/** Explicit back-home link. Auto-computed from `currentLang` vs `defaultLocale` when omitted. */
|
|
157
|
+
rootHref?: string;
|
|
158
|
+
/** Alternate locale URL. When present, renders a language switcher link. */
|
|
159
|
+
alternateHref?: string;
|
|
160
|
+
/** CMS override for the `<h1>` heading (falls back to the inline copy). */
|
|
161
|
+
heading?: string;
|
|
162
|
+
/** CMS override for the paragraph message (falls back to the inline copy). */
|
|
163
|
+
message?: string;
|
|
164
|
+
/**
|
|
165
|
+
* Illustration above the heading. An `Image` or `DecorativeImage` renders
|
|
166
|
+
* through `Media`, so a local asset gets a `srcset`. A plain path string is
|
|
167
|
+
* the legacy form: it renders as a decorative `<img alt="">`, exactly as
|
|
168
|
+
* before; an empty string renders no image.
|
|
169
|
+
*/
|
|
170
|
+
image?: AnyImage | string;
|
|
171
|
+
}
|
|
172
|
+
export type { Labels };
|
|
173
|
+
/**
|
|
174
|
+
* Built-in strings of a component. `lang` picks the dictionary (default `'en'`,
|
|
175
|
+
* so output without it is unchanged; unknown languages fall back to English)
|
|
176
|
+
* and `labels` overrides single keys. Each component reads only the keys it
|
|
177
|
+
* renders, so one `labels` object can be shared by all of them.
|
|
178
|
+
*/
|
|
179
|
+
export interface LocalizedLabelsProps {
|
|
180
|
+
lang?: string;
|
|
181
|
+
labels?: Partial<Labels>;
|
|
182
|
+
}
|
|
183
|
+
/** Props shared by `Header`, `HeaderCentered`, `HeaderHideOnScroll` and `HeaderFlyout`. */
|
|
184
|
+
export interface HeaderVariantProps extends LocalizedLabelsProps {
|
|
185
|
+
siteName: string;
|
|
186
|
+
/** Navigation entries; only `HeaderFlyout` renders `children`, as dropdowns. */
|
|
187
|
+
navItems: NavItem[];
|
|
188
|
+
currentLang: string;
|
|
189
|
+
pathname: string;
|
|
190
|
+
/** Explicit alternate locale URL to pass to LanguageSwitch. */
|
|
191
|
+
alternateHref?: string;
|
|
192
|
+
/** Accessible label of the mobile menu button. Defaults to `labels.toggleNavigationMenu`. */
|
|
193
|
+
menuLabel?: string;
|
|
194
|
+
/**
|
|
195
|
+
* Brand logo, rendered through `Media` in place of the site name text. A URL
|
|
196
|
+
* string renders a plain `<img>` with the site name as alt text, exactly as
|
|
197
|
+
* before; an `Image` brings its own alt text, and a local asset gets a `srcset`.
|
|
198
|
+
*/
|
|
199
|
+
logo?: string | Image;
|
|
200
|
+
/**
|
|
201
|
+
* DOM id linking the menu button's `aria-controls` to the `<nav>`; in
|
|
202
|
+
* `HeaderFlyout` also the prefix of each dropdown's id. Stable by default so
|
|
203
|
+
* builds are reproducible. Override only when rendering more than one of the
|
|
204
|
+
* same header variant on a single page.
|
|
205
|
+
*/
|
|
206
|
+
navId?: string;
|
|
207
|
+
/**
|
|
208
|
+
* Locales this site actually serves. When it holds a single entry the
|
|
209
|
+
* language switch is omitted, because on a one-locale site it is a control
|
|
210
|
+
* that navigates to a route the site does not build. Omit the prop to keep
|
|
211
|
+
* the switch rendering unconditionally.
|
|
212
|
+
*/
|
|
213
|
+
locales?: readonly string[];
|
|
214
|
+
}
|
|
215
|
+
export interface HeaderProps extends HeaderVariantProps {
|
|
216
|
+
/** Explicit brand link href. Falls back to `/` (de) or `/${currentLang}/` (other). */
|
|
217
|
+
brandHref?: string;
|
|
218
|
+
}
|
|
219
|
+
export type HeaderCenteredProps = HeaderVariantProps;
|
|
220
|
+
export type HeaderHideOnScrollProps = HeaderVariantProps;
|
|
221
|
+
export type HeaderFlyoutProps = HeaderVariantProps;
|
|
222
|
+
export interface ThemeToggleProps extends LocalizedLabelsProps {
|
|
223
|
+
/** Accessible label and tooltip of the button. Defaults to `labels.toggleColorTheme`. */
|
|
224
|
+
label?: string;
|
|
225
|
+
}
|
|
226
|
+
export interface LanguageAlternate {
|
|
227
|
+
/** Language code of the target page; rendered as `hreflang`. */
|
|
228
|
+
lang: string;
|
|
229
|
+
href: string;
|
|
230
|
+
/** Visible link text. Defaults to the upper-cased language code. */
|
|
231
|
+
label?: string;
|
|
232
|
+
}
|
|
233
|
+
export interface LanguageSwitchProps extends LocalizedLabelsProps {
|
|
234
|
+
/** Current page language, e.g. "de" or "en". */
|
|
235
|
+
currentLang: string;
|
|
236
|
+
/** Current page pathname, e.g. "/" or "/en/about". */
|
|
237
|
+
pathname: string;
|
|
238
|
+
/** The default locale that uses bare paths (no prefix). Defaults to "de". */
|
|
239
|
+
defaultLocale?: string;
|
|
240
|
+
/** Explicit alternate URL for translated slugs (e.g. /en/privacy for /datenschutz). Bypasses automatic derivation. */
|
|
241
|
+
alternateHref?: string;
|
|
242
|
+
/** Accessible label of the derived link. Not applied to `alternates`. */
|
|
243
|
+
ariaLabel?: string;
|
|
244
|
+
/**
|
|
245
|
+
* One link per alternate version of the page, in place of the derived
|
|
246
|
+
* two-locale link. Each link is named by `labels.switchToLanguage`, with the
|
|
247
|
+
* visible label when one is given, else the language code.
|
|
248
|
+
*/
|
|
249
|
+
alternates?: LanguageAlternate[];
|
|
250
|
+
}
|
|
251
|
+
export interface PageShellProps extends LocalizedLabelsProps {
|
|
252
|
+
/** id of the <main> element and the skip link's target. */
|
|
253
|
+
mainId?: string;
|
|
254
|
+
/** Skip-link text. Defaults to `labels.skipToMainContent`. */
|
|
255
|
+
skipLabel?: string;
|
|
256
|
+
/** Extra class(es) for the <main> element. */
|
|
257
|
+
class?: string;
|
|
258
|
+
}
|
|
259
|
+
/** A group of footer links, rendered above the copyright and legal row. */
|
|
260
|
+
export interface FooterColumn {
|
|
261
|
+
title?: string;
|
|
262
|
+
/** Links of the group; an `external` link gets `rel="external"`. */
|
|
263
|
+
links: Link[];
|
|
264
|
+
}
|
|
265
|
+
/** `Footer` also takes a named `actions` slot, rendered after the legal links. */
|
|
266
|
+
export interface FooterProps extends LocalizedLabelsProps {
|
|
267
|
+
siteName: string;
|
|
268
|
+
/** Links of the legal navigation, which is named by `labels.legal`. */
|
|
269
|
+
legalLinks: Link[];
|
|
270
|
+
currentYear?: number;
|
|
271
|
+
columns?: FooterColumn[];
|
|
272
|
+
}
|
|
273
|
+
//# sourceMappingURL=props.d.ts.map
|