e84b87ed16
🔧 fix: update navigation href resolution to include localized paths 🆕 feat: add new FeatureIcon component for feature boxes 🎨 style: improve styling for prose elements in richtext blocks 🛠️ refactor: streamline medialib image loading and caching logic 📦 chore: update mock data handling to support new medialib entries 🔄 chore: synchronize i18n initialization and locale management 📝 docs: update video tour descriptions to reflect recent changes
170 lines
3.5 KiB
TypeScript
170 lines
3.5 KiB
TypeScript
interface Ssr {
|
|
id?: string
|
|
path: string
|
|
content: string
|
|
// validUntil: any // go Time
|
|
}
|
|
|
|
declare module "*.css"
|
|
|
|
/** MongoDB-style filter, e.g. { _id: "abc" } or { $or: [...] } */
|
|
type MongoFilter = Record<string, unknown>
|
|
|
|
interface ApiOptions {
|
|
method?: "GET" | "POST" | "PUT" | "DELETE"
|
|
filter?: MongoFilter
|
|
sort?: string
|
|
lookup?: string
|
|
limit?: number
|
|
offset?: number
|
|
projection?: string
|
|
headers?: {
|
|
[key: string]: string
|
|
}
|
|
params?: {
|
|
[key: string]: string
|
|
}
|
|
signal?: AbortSignal
|
|
}
|
|
|
|
interface LocationStore {
|
|
path: string
|
|
search: string
|
|
hash: string
|
|
push: boolean
|
|
pop: boolean
|
|
previousLocation?: LocationStore
|
|
}
|
|
|
|
interface ApiResult<T> {
|
|
data: T
|
|
count: number
|
|
/** Build timestamp from server (X-Build-Time header), only present on client requests */
|
|
buildTime?: string | null
|
|
}
|
|
|
|
interface FileField {
|
|
path: string
|
|
src: string
|
|
type: string
|
|
size: number
|
|
}
|
|
|
|
type LocalizedText = {
|
|
[lang: string]: string | undefined
|
|
}
|
|
|
|
interface MedialibEntry {
|
|
id?: string
|
|
_id?: string
|
|
file?: {
|
|
src?: string
|
|
type?: string
|
|
}
|
|
title?: string
|
|
alt?: string | LocalizedText
|
|
description?: string
|
|
[key: string]: unknown
|
|
}
|
|
|
|
interface LookupContainer<T> {
|
|
_lookup?: Record<string, T | null>
|
|
}
|
|
|
|
interface ContentHeroImage extends LookupContainer<MedialibEntry> {
|
|
image?: string
|
|
}
|
|
|
|
interface ContentFeatureBoxEntry {
|
|
icon?: "lightning" | "palette" | "database" | "globe" | "monitor" | "flask"
|
|
title?: string
|
|
text?: string
|
|
}
|
|
|
|
/** Pagebuilder: Content Block Entry */
|
|
interface ContentBlockEntry extends LookupContainer<MedialibEntry> {
|
|
hide?: boolean
|
|
headline?: string
|
|
headlineH1?: boolean
|
|
subline?: string
|
|
tagline?: string
|
|
anchorId?: string
|
|
containerWidth?: "" | "wide" | "full"
|
|
padding?: {
|
|
top?: string
|
|
bottom?: string
|
|
}
|
|
type?: string
|
|
callToAction?: {
|
|
buttonText?: string
|
|
buttonLink?: string
|
|
buttonTarget?: string
|
|
}
|
|
heroImage?: ContentHeroImage
|
|
featureBoxes?: ContentFeatureBoxEntry[]
|
|
// richtext fields
|
|
text?: string
|
|
imagePosition?: "none" | "left" | "right"
|
|
image?: string
|
|
// accordion fields
|
|
accordionItems?: {
|
|
question?: string
|
|
answer?: string
|
|
open?: boolean
|
|
}[]
|
|
}
|
|
|
|
/** Content Entry from the CMS */
|
|
interface ContentEntry {
|
|
id?: string
|
|
_id?: string
|
|
_lookup?: Record<string, MedialibEntry | MedialibEntry[] | null>
|
|
active?: boolean
|
|
publication?: {
|
|
from?: string | Date
|
|
to?: string | Date
|
|
}
|
|
type?: string
|
|
lang?: string
|
|
translationKey?: string
|
|
name?: string
|
|
path?: string
|
|
alternativePaths?: { path?: string }[]
|
|
teaserText?: string
|
|
blocks?: ContentBlockEntry[]
|
|
meta?: {
|
|
title?: string
|
|
description?: string
|
|
keywords?: string[]
|
|
}
|
|
}
|
|
|
|
/** Navigation element */
|
|
interface NavigationElement {
|
|
name: string
|
|
external?: boolean
|
|
page?: string
|
|
hash?: string
|
|
externalUrl?: string
|
|
_lookup?: {
|
|
page?: ContentEntry | null
|
|
}
|
|
}
|
|
|
|
/** Navigation entry from the CMS */
|
|
interface NavigationEntry {
|
|
id?: string
|
|
_id?: string
|
|
language?: string
|
|
type?: "header" | "footer"
|
|
elements?: NavigationElement[]
|
|
}
|
|
|
|
interface ProductEntry {
|
|
id: string
|
|
// ...
|
|
}
|
|
|
|
/** Build-time flag: `true` when built with `MOCK=1`, enables API mock interceptor */
|
|
declare const __MOCK__: boolean
|