mirror of
https://github.com/Since-3/since3-portal.git
synced 2026-10-12 19:51:17 +00:00
18 lines
871 B
TypeScript
18 lines
871 B
TypeScript
import { defineTemplate, describeSections } from "../../lib/content"
|
|
import type { BlockSeed, TemplateDefinition } from "../../lib/types"
|
|
import { blockLibrary } from "./definitions"
|
|
import type { BrandData } from "./types"
|
|
|
|
type BuilderOptions = Omit<TemplateDefinition, "sections" | "defaults" | "builder"> & { brand: BrandData; seed: BlockSeed[] }
|
|
|
|
// Vorlage aus Bausteinen: „Marke & Kontakt“ ist die einzige feste Sektion, alles andere sind Bausteine,
|
|
// die im Editor frei hinzugefügt, sortiert und entfernt werden. `seed` ist die Startaufstellung.
|
|
export function defineBuilder({ brand, seed, ...template }: BuilderOptions) {
|
|
const defaults = { brand }
|
|
return defineTemplate({
|
|
...template,
|
|
sections: describeSections(defaults, { brand: "Marke & Kontakt" }),
|
|
defaults,
|
|
builder: { library: blockLibrary, seed },
|
|
})
|
|
}
|