component formatting and types

This commit is contained in:
Julian Krauser 2025-02-14 13:57:55 +01:00
parent c2a7d15eeb
commit ce745c06e5
60 changed files with 464 additions and 301 deletions

View file

@ -1,12 +1,14 @@
import type DynamicZoneColumnImageText from "./dynamicZoneColumnImageText";
import type DynamicZoneDualColumnText from "./dynamicZoneDualColumnText";
import type DynamicZoneEmphasiseArticle from "./dynamicZoneEmphasiseArticle";
import type DynamicZoneFullImage from "./dynamicZoneFullImage";
import type DynamicZoneFullText from "./dynamicZoneFullText";
import type DynamicZoneGallery from "./dynamicZoneGallery";
import type DynamicZoneFileDownload from "./dynamicZoneFileDownload";
import type SharedList from "./sharedList";
import type DynamicZoneEmbedding from "./dynamicZoneEmbedding";
import type SharedEmphasiseArticle from "./shared/emphasiseArticle";
import type SharedList from "./shared/list";
import type DynamicZoneColumnImageText from "./dynamic-zone/columnImageText";
import type DynamicZoneDualColumnText from "./dynamic-zone/dualColumnText";
import type DynamicZoneFullImage from "./dynamic-zone/fullImage";
import type DynamicZoneFullText from "./dynamic-zone/fullText";
import type DynamicZoneGallery from "./dynamic-zone/gallery";
import type DynamicZoneFileDownload from "./dynamic-zone/fileDownload";
import type DynamicZoneEmbedding from "./dynamic-zone/embedding";
import type DynamicZoneSection from "./dynamic-zone/section";
import type DynamicZoneSpacer from "./dynamic-zone/spacer";
export default interface BaseComponent {
__component: ComponentNames;
@ -15,10 +17,12 @@ export default interface BaseComponent {
export type ComponentNames =
| "shared.list"
| "shared.emphasise-article"
| "dynamic-zone.section"
| "dynamic-zone.spacer"
| "dynamic-zone.gallery"
| "dynamic-zone.full-text"
| "dynamic-zone.full-image"
| "dynamic-zone.emphasise-article"
| "dynamic-zone.dual-column-text"
| "dynamic-zone.column-image-text"
| "dynamic-zone.file-download"
@ -26,10 +30,12 @@ export type ComponentNames =
export type ComponentTypes =
| SharedList
| SharedEmphasiseArticle
| DynamicZoneSection
| DynamicZoneSpacer
| DynamicZoneGallery
| DynamicZoneFullText
| DynamicZoneFullImage
| DynamicZoneEmphasiseArticle
| DynamicZoneDualColumnText
| DynamicZoneColumnImageText
| DynamicZoneFileDownload

View file

@ -1,6 +1,6 @@
import type ContentField from "../field/content";
import type BaseComponent from "./baseComponent";
import type BaseFile from "./baseFile";
import type ContentField from "../../field/content";
import type BaseComponent from "../baseComponent";
import type BaseFile from "../baseFile";
export default interface DynamicZoneColumnImageText extends BaseComponent {
__component: "dynamic-zone.column-image-text";

View file

@ -1,5 +1,5 @@
import type ContentField from "../field/content";
import type BaseComponent from "./baseComponent";
import type ContentField from "../../field/content";
import type BaseComponent from "../baseComponent";
export default interface DynamicZoneDualColumnText extends BaseComponent {
__component: "dynamic-zone.dual-column-text";

View file

@ -1,7 +1,6 @@
import type BaseComponent from "./baseComponent";
import type BaseComponent from "../baseComponent";
export default interface DynamicZoneEmbedding extends BaseComponent {
__component: "dynamic-zone.embedding";
title: string;
link: string;
}

View file

@ -1,9 +1,8 @@
import type BaseComponent from "./baseComponent";
import type BaseFile from "./baseFile";
import type BaseComponent from "../baseComponent";
import type BaseFile from "../baseFile";
export default interface DynamicZoneFileDownload extends BaseComponent {
__component: "dynamic-zone.file-download";
enable_download: boolean;
title: string;
file: BaseFile;
}

View file

@ -1,5 +1,5 @@
import type BaseComponent from "./baseComponent";
import type BaseFile from "./baseFile";
import type BaseComponent from "../baseComponent";
import type BaseFile from "../baseFile";
export default interface DynamicZoneFullImage extends BaseComponent {
__component: "dynamic-zone.full-image";

View file

@ -1,5 +1,5 @@
import type ContentField from "../field/content";
import type BaseComponent from "./baseComponent";
import type ContentField from "../../field/content";
import type BaseComponent from "../baseComponent";
export default interface DynamicZoneFullText extends BaseComponent {
__component: "dynamic-zone.full-text";

View file

@ -1,5 +1,5 @@
import type BaseComponent from "./baseComponent";
import type BaseFile from "./baseFile";
import type BaseComponent from "../baseComponent";
import type BaseFile from "../baseFile";
export default interface DynamicZoneGallery extends BaseComponent {
__component: "dynamic-zone.gallery";

View file

@ -0,0 +1,7 @@
import type BaseComponent from "../baseComponent";
export default interface DynamicZoneSection extends BaseComponent {
__component: "dynamic-zone.section";
title: string;
description: string;
}

View file

@ -0,0 +1,5 @@
import type BaseComponent from "../baseComponent";
export default interface DynamicZoneSpacer extends BaseComponent {
__component: "dynamic-zone.spacer";
}

View file

@ -1,10 +0,0 @@
import type Article from "../collection/article";
import type BaseComponent from "./baseComponent";
export default interface DynamicZoneEmphasiseArticle extends BaseComponent {
__component: "dynamic-zone.emphasise-article";
titel: string;
description: string;
articles: Array<Article>;
base_url: string;
}

View file

@ -0,0 +1,8 @@
import type FooterLink from "../items/footerLink";
export default interface Footer {
id: number;
copyright: undefined | string;
maintained_by: undefined | string;
links: FooterLink[];
}

View file

@ -0,0 +1,6 @@
import type NavbarItem from "../items/navbarItem";
export default interface Navbar {
id: number;
navbar_items: NavbarItem[];
}

View file

@ -1,4 +1,4 @@
export default interface SEOComponent {
export default interface SEO {
metaTitle: string;
metaDescription: string;
keywords: string;

View file

@ -1,8 +0,0 @@
import type FooterLink from "./itemsFooterLink";
export default interface Footer {
id: number;
copyright: string;
maintained?: string;
links: FooterLink[];
}

View file

@ -1,8 +0,0 @@
import type BaseFile from "./baseFile";
import type NavbarItem from "./itemsNavbarItem";
export default interface Navbar {
id: number;
logo: BaseFile;
navbar_items: NavbarItem[];
}

View file

@ -0,0 +1,7 @@
import type BaseFile from "../baseFile";
export default interface ItemsHero {
id: number;
title: string | undefined;
banner: BaseFile | undefined;
}

View file

@ -1,4 +1,4 @@
import type NavbarSubItem from "./itemsNavbarSubItem";
import type NavbarSubItem from "./navbarSubItem";
export default interface NavbarItem {
id: number;

View file

@ -1,4 +1,4 @@
import type Page from "../collection/page";
import type Page from "../../collection/page";
export default interface NavbarSubItem {
id: number;

View file

@ -0,0 +1,8 @@
import type Article from "../../collection/article";
import type BaseComponent from "../baseComponent";
export default interface SharedEmphasiseArticle extends BaseComponent {
__component: "shared.emphasise-article";
articles: Array<Article>;
link_to_articles: string;
}

View file

@ -0,0 +1,7 @@
import type Lookup from "../../collection/lookup";
import type BaseComponent from "../baseComponent";
export default interface SharedList extends BaseComponent {
__component: "shared.list";
lookup: Lookup;
}

View file

@ -1,7 +0,0 @@
import type BaseFile from "./baseFile";
export default interface SharedHero {
id: number;
title: string;
banner: BaseFile;
}

View file

@ -1,8 +0,0 @@
import type Lookup from "../collection/lookup";
import type BaseComponent from "./baseComponent";
export default interface SharedList extends BaseComponent {
__component: "shared.list";
enable_detail: boolean;
lookup: Lookup;
}