@schneiderelli/cms-runtime 0.0.3 → 0.0.5
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/dist/components/BlockRenderer.svelte +106 -71
- package/dist/components/BlockRenderer.svelte.d.ts +15 -4
- package/dist/components/blocks/AdBlock.svelte +58 -0
- package/dist/components/blocks/AdBlock.svelte.d.ts +9 -0
- package/dist/components/blocks/AffiliateBlock.svelte +50 -0
- package/dist/components/blocks/AffiliateBlock.svelte.d.ts +9 -0
- package/dist/components/blocks/BreadcrumbBlock.svelte +30 -0
- package/dist/components/blocks/BreadcrumbBlock.svelte.d.ts +9 -0
- package/dist/components/blocks/ChildrenBlock.svelte +46 -0
- package/dist/components/blocks/ChildrenBlock.svelte.d.ts +9 -0
- package/dist/components/blocks/DividerBlock.svelte +9 -0
- package/dist/components/blocks/DividerBlock.svelte.d.ts +26 -0
- package/dist/components/blocks/FaqBlock.svelte +77 -0
- package/dist/components/blocks/FaqBlock.svelte.d.ts +7 -0
- package/dist/components/blocks/HeadingBlock.svelte +35 -5
- package/dist/components/blocks/HeadingBlock.svelte.d.ts +3 -3
- package/dist/components/blocks/HeroBlock.svelte +43 -0
- package/dist/components/blocks/HeroBlock.svelte.d.ts +7 -0
- package/dist/components/blocks/HowToBlock.svelte +100 -0
- package/dist/components/blocks/HowToBlock.svelte.d.ts +7 -0
- package/dist/components/blocks/ImageBlock.svelte +42 -3
- package/dist/components/blocks/ImageBlock.svelte.d.ts +3 -3
- package/dist/components/blocks/LinksBlock.svelte +66 -0
- package/dist/components/blocks/LinksBlock.svelte.d.ts +7 -0
- package/dist/components/blocks/MarkdownBlock.svelte +118 -0
- package/dist/components/blocks/MarkdownBlock.svelte.d.ts +7 -0
- package/dist/components/blocks/NoteBlock.svelte +59 -0
- package/dist/components/blocks/NoteBlock.svelte.d.ts +7 -0
- package/dist/components/blocks/QuoteBlock.svelte +44 -0
- package/dist/components/blocks/QuoteBlock.svelte.d.ts +7 -0
- package/dist/index.d.ts +16 -1
- package/dist/index.js +26 -1
- package/dist/registry.d.ts +43 -0
- package/dist/registry.js +374 -0
- package/dist/types.d.ts +253 -23
- package/dist/types.js +179 -1
- package/package.json +2 -1
- package/dist/components/blocks/TextBlock.svelte +0 -8
- package/dist/components/blocks/TextBlock.svelte.d.ts +0 -7
- package/dist/resolve.d.ts +0 -15
- package/dist/resolve.js +0 -15
package/dist/registry.js
ADDED
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// CSM-RUNTIME REGISTRY
|
|
3
|
+
// =============================================================================
|
|
4
|
+
// Block-Metadaten für den Editor
|
|
5
|
+
// Beschreibt welche Blocks verfügbar sind und wie sie konfiguriert werden
|
|
6
|
+
// =============================================================================
|
|
7
|
+
// -----------------------------------------------------------------------------
|
|
8
|
+
// BLOCK REGISTRY - Alle verfügbaren Blocks
|
|
9
|
+
// -----------------------------------------------------------------------------
|
|
10
|
+
export const blockRegistry = [
|
|
11
|
+
// =========================================================================
|
|
12
|
+
// CONTENT BLOCKS
|
|
13
|
+
// =========================================================================
|
|
14
|
+
{
|
|
15
|
+
type: 'markdown',
|
|
16
|
+
label: 'Markdown',
|
|
17
|
+
icon: '📝',
|
|
18
|
+
description: 'Freier Text mit Markdown-Formatierung',
|
|
19
|
+
category: 'content',
|
|
20
|
+
defaults: { content: '' },
|
|
21
|
+
fields: [
|
|
22
|
+
{
|
|
23
|
+
name: 'content',
|
|
24
|
+
label: 'Inhalt',
|
|
25
|
+
type: 'markdown',
|
|
26
|
+
required: true,
|
|
27
|
+
placeholder: 'Schreibe hier deinen Text...'
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
type: 'heading',
|
|
33
|
+
label: 'Überschrift',
|
|
34
|
+
icon: '🔤',
|
|
35
|
+
description: 'Überschrift H1-H6',
|
|
36
|
+
category: 'content',
|
|
37
|
+
defaults: { text: '', level: 2 },
|
|
38
|
+
fields: [
|
|
39
|
+
{
|
|
40
|
+
name: 'text',
|
|
41
|
+
label: 'Text',
|
|
42
|
+
type: 'text',
|
|
43
|
+
required: true,
|
|
44
|
+
placeholder: 'Überschrift eingeben...'
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'level',
|
|
48
|
+
label: 'Level',
|
|
49
|
+
type: 'select',
|
|
50
|
+
options: [
|
|
51
|
+
{ value: '1', label: 'H1 - Hauptüberschrift' },
|
|
52
|
+
{ value: '2', label: 'H2 - Abschnitt' },
|
|
53
|
+
{ value: '3', label: 'H3 - Unterabschnitt' },
|
|
54
|
+
{ value: '4', label: 'H4' },
|
|
55
|
+
{ value: '5', label: 'H5' },
|
|
56
|
+
{ value: '6', label: 'H6' }
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
type: 'quote',
|
|
63
|
+
label: 'Zitat',
|
|
64
|
+
icon: '💬',
|
|
65
|
+
description: 'Zitat mit optionaler Quellenangabe',
|
|
66
|
+
category: 'content',
|
|
67
|
+
defaults: { content: '', source: '' },
|
|
68
|
+
fields: [
|
|
69
|
+
{
|
|
70
|
+
name: 'content',
|
|
71
|
+
label: 'Zitat',
|
|
72
|
+
type: 'textarea',
|
|
73
|
+
required: true,
|
|
74
|
+
placeholder: 'Zitat eingeben...'
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: 'source',
|
|
78
|
+
label: 'Quelle',
|
|
79
|
+
type: 'text',
|
|
80
|
+
placeholder: 'Autor oder Quelle...'
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
type: 'note',
|
|
86
|
+
label: 'Hinweis',
|
|
87
|
+
icon: '💡',
|
|
88
|
+
description: 'Info-Box, Warnung, Tipp oder Fehler',
|
|
89
|
+
category: 'content',
|
|
90
|
+
defaults: { content: '', variant: 'info' },
|
|
91
|
+
fields: [
|
|
92
|
+
{
|
|
93
|
+
name: 'content',
|
|
94
|
+
label: 'Inhalt',
|
|
95
|
+
type: 'markdown',
|
|
96
|
+
required: true,
|
|
97
|
+
placeholder: 'Hinweis-Text...'
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
name: 'variant',
|
|
101
|
+
label: 'Typ',
|
|
102
|
+
type: 'select',
|
|
103
|
+
options: [
|
|
104
|
+
{ value: 'info', label: '💙 Info' },
|
|
105
|
+
{ value: 'tip', label: '💚 Tipp' },
|
|
106
|
+
{ value: 'warning', label: '💛 Warnung' },
|
|
107
|
+
{ value: 'danger', label: '❤️ Achtung' }
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
type: 'faq',
|
|
114
|
+
label: 'FAQ',
|
|
115
|
+
icon: '❓',
|
|
116
|
+
description: 'Häufig gestellte Fragen',
|
|
117
|
+
category: 'content',
|
|
118
|
+
defaults: { title: '', items: [] },
|
|
119
|
+
fields: [
|
|
120
|
+
{
|
|
121
|
+
name: 'title',
|
|
122
|
+
label: 'Titel (optional)',
|
|
123
|
+
type: 'text',
|
|
124
|
+
placeholder: 'Häufige Fragen'
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
name: 'items',
|
|
128
|
+
label: 'Fragen',
|
|
129
|
+
type: 'list',
|
|
130
|
+
listFields: [
|
|
131
|
+
{ name: 'q', label: 'Frage', type: 'text', required: true },
|
|
132
|
+
{ name: 'a', label: 'Antwort', type: 'markdown', required: true }
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
]
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
type: 'howto',
|
|
139
|
+
label: 'Anleitung',
|
|
140
|
+
icon: '📋',
|
|
141
|
+
description: 'Schritt-für-Schritt-Anleitung',
|
|
142
|
+
category: 'content',
|
|
143
|
+
defaults: { title: '', steps: [] },
|
|
144
|
+
fields: [
|
|
145
|
+
{
|
|
146
|
+
name: 'title',
|
|
147
|
+
label: 'Titel (optional)',
|
|
148
|
+
type: 'text',
|
|
149
|
+
placeholder: 'So gehts...'
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
name: 'steps',
|
|
153
|
+
label: 'Schritte',
|
|
154
|
+
type: 'list',
|
|
155
|
+
listFields: [
|
|
156
|
+
{ name: 'title', label: 'Schritt-Titel', type: 'text', required: true },
|
|
157
|
+
{ name: 'description', label: 'Beschreibung', type: 'markdown', required: true }
|
|
158
|
+
]
|
|
159
|
+
}
|
|
160
|
+
]
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
type: 'hero',
|
|
164
|
+
label: 'Hero',
|
|
165
|
+
icon: '🦸',
|
|
166
|
+
description: 'Großer Titel-Bereich',
|
|
167
|
+
category: 'content',
|
|
168
|
+
defaults: { title: '', subtitle: '' },
|
|
169
|
+
fields: [
|
|
170
|
+
{
|
|
171
|
+
name: 'title',
|
|
172
|
+
label: 'Titel',
|
|
173
|
+
type: 'text',
|
|
174
|
+
required: true,
|
|
175
|
+
placeholder: 'Haupttitel'
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
name: 'subtitle',
|
|
179
|
+
label: 'Untertitel',
|
|
180
|
+
type: 'textarea',
|
|
181
|
+
placeholder: 'Kurze Beschreibung...'
|
|
182
|
+
}
|
|
183
|
+
]
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
type: 'divider',
|
|
187
|
+
label: 'Trennlinie',
|
|
188
|
+
icon: '➖',
|
|
189
|
+
description: 'Horizontale Trennlinie',
|
|
190
|
+
category: 'content',
|
|
191
|
+
defaults: {},
|
|
192
|
+
fields: []
|
|
193
|
+
},
|
|
194
|
+
// =========================================================================
|
|
195
|
+
// MEDIA BLOCKS
|
|
196
|
+
// =========================================================================
|
|
197
|
+
{
|
|
198
|
+
type: 'image',
|
|
199
|
+
label: 'Bild',
|
|
200
|
+
icon: '🖼️',
|
|
201
|
+
description: 'Bild mit optionaler Beschriftung',
|
|
202
|
+
category: 'media',
|
|
203
|
+
defaults: { src: '', alt: '', caption: '' },
|
|
204
|
+
fields: [
|
|
205
|
+
{
|
|
206
|
+
name: 'src',
|
|
207
|
+
label: 'Bild',
|
|
208
|
+
type: 'image',
|
|
209
|
+
required: true
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
name: 'alt',
|
|
213
|
+
label: 'Alt-Text',
|
|
214
|
+
type: 'text',
|
|
215
|
+
placeholder: 'Beschreibung für Screenreader...'
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
name: 'caption',
|
|
219
|
+
label: 'Bildunterschrift',
|
|
220
|
+
type: 'text',
|
|
221
|
+
placeholder: 'Optionale Bildunterschrift...'
|
|
222
|
+
}
|
|
223
|
+
]
|
|
224
|
+
},
|
|
225
|
+
// =========================================================================
|
|
226
|
+
// LAYOUT BLOCKS
|
|
227
|
+
// =========================================================================
|
|
228
|
+
{
|
|
229
|
+
type: 'children',
|
|
230
|
+
label: 'Unterseiten',
|
|
231
|
+
icon: '📂',
|
|
232
|
+
description: 'Zeigt Kind-Seiten als Grid',
|
|
233
|
+
category: 'layout',
|
|
234
|
+
defaults: { title: '', columns: 3 },
|
|
235
|
+
fields: [
|
|
236
|
+
{
|
|
237
|
+
name: 'title',
|
|
238
|
+
label: 'Titel (optional)',
|
|
239
|
+
type: 'text',
|
|
240
|
+
placeholder: 'Alle Themen'
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
name: 'columns',
|
|
244
|
+
label: 'Spalten',
|
|
245
|
+
type: 'select',
|
|
246
|
+
options: [
|
|
247
|
+
{ value: '2', label: '2 Spalten' },
|
|
248
|
+
{ value: '3', label: '3 Spalten' },
|
|
249
|
+
{ value: '4', label: '4 Spalten' }
|
|
250
|
+
]
|
|
251
|
+
}
|
|
252
|
+
]
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
type: 'links',
|
|
256
|
+
label: 'Link-Liste',
|
|
257
|
+
icon: '🔗',
|
|
258
|
+
description: 'Liste von Links',
|
|
259
|
+
category: 'layout',
|
|
260
|
+
defaults: { title: '', items: [] },
|
|
261
|
+
fields: [
|
|
262
|
+
{
|
|
263
|
+
name: 'title',
|
|
264
|
+
label: 'Titel (optional)',
|
|
265
|
+
type: 'text'
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
name: 'items',
|
|
269
|
+
label: 'Links',
|
|
270
|
+
type: 'list',
|
|
271
|
+
listFields: [
|
|
272
|
+
{ name: 'label', label: 'Text', type: 'text', required: true },
|
|
273
|
+
{ name: 'href', label: 'URL', type: 'text', required: true },
|
|
274
|
+
{ name: 'icon', label: 'Icon', type: 'text' }
|
|
275
|
+
]
|
|
276
|
+
}
|
|
277
|
+
]
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
type: 'breadcrumb',
|
|
281
|
+
label: 'Breadcrumb',
|
|
282
|
+
icon: '🧭',
|
|
283
|
+
description: 'Navigationspfad',
|
|
284
|
+
category: 'layout',
|
|
285
|
+
defaults: {},
|
|
286
|
+
fields: []
|
|
287
|
+
},
|
|
288
|
+
// =========================================================================
|
|
289
|
+
// MONETIZATION BLOCKS
|
|
290
|
+
// =========================================================================
|
|
291
|
+
{
|
|
292
|
+
type: 'affiliate',
|
|
293
|
+
label: 'Affiliate',
|
|
294
|
+
icon: '🛒',
|
|
295
|
+
description: 'Affiliate-Produkt-Empfehlung',
|
|
296
|
+
category: 'monetization',
|
|
297
|
+
defaults: { ref: '', variant: 'box' },
|
|
298
|
+
fields: [
|
|
299
|
+
{
|
|
300
|
+
name: 'ref',
|
|
301
|
+
label: 'Referenz',
|
|
302
|
+
type: 'text',
|
|
303
|
+
placeholder: 'z.B. dyson/v11'
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
name: 'variant',
|
|
307
|
+
label: 'Darstellung',
|
|
308
|
+
type: 'select',
|
|
309
|
+
options: [
|
|
310
|
+
{ value: 'inline', label: 'Inline' },
|
|
311
|
+
{ value: 'box', label: 'Box' },
|
|
312
|
+
{ value: 'sticky', label: 'Sticky (Mobile)' },
|
|
313
|
+
{ value: 'floating', label: 'Floating (Desktop)' }
|
|
314
|
+
]
|
|
315
|
+
}
|
|
316
|
+
]
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
type: 'ad',
|
|
320
|
+
label: 'Werbung',
|
|
321
|
+
icon: '📢',
|
|
322
|
+
description: 'Werbeplatz',
|
|
323
|
+
category: 'monetization',
|
|
324
|
+
defaults: { slot: '', variant: 'inline' },
|
|
325
|
+
fields: [
|
|
326
|
+
{
|
|
327
|
+
name: 'slot',
|
|
328
|
+
label: 'Slot-ID',
|
|
329
|
+
type: 'text'
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
name: 'variant',
|
|
333
|
+
label: 'Darstellung',
|
|
334
|
+
type: 'select',
|
|
335
|
+
options: [
|
|
336
|
+
{ value: 'inline', label: 'Inline' },
|
|
337
|
+
{ value: 'banner', label: 'Banner' },
|
|
338
|
+
{ value: 'sidebar', label: 'Sidebar' }
|
|
339
|
+
]
|
|
340
|
+
}
|
|
341
|
+
]
|
|
342
|
+
}
|
|
343
|
+
];
|
|
344
|
+
// -----------------------------------------------------------------------------
|
|
345
|
+
// HELPER FUNCTIONS
|
|
346
|
+
// -----------------------------------------------------------------------------
|
|
347
|
+
/** Holt Block-Definition by Type */
|
|
348
|
+
export function getBlockDefinition(type) {
|
|
349
|
+
return blockRegistry.find(b => b.type === type);
|
|
350
|
+
}
|
|
351
|
+
/** Gruppiert Blocks nach Kategorie */
|
|
352
|
+
export function getBlocksByCategory() {
|
|
353
|
+
const categories = {
|
|
354
|
+
content: [],
|
|
355
|
+
media: [],
|
|
356
|
+
layout: [],
|
|
357
|
+
monetization: []
|
|
358
|
+
};
|
|
359
|
+
for (const block of blockRegistry) {
|
|
360
|
+
categories[block.category].push(block);
|
|
361
|
+
}
|
|
362
|
+
return categories;
|
|
363
|
+
}
|
|
364
|
+
/** Erstellt einen neuen Block mit Default-Werten */
|
|
365
|
+
export function createBlockFromDefinition(type) {
|
|
366
|
+
const def = getBlockDefinition(type);
|
|
367
|
+
if (!def)
|
|
368
|
+
return undefined;
|
|
369
|
+
return {
|
|
370
|
+
id: `block-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`,
|
|
371
|
+
type,
|
|
372
|
+
...def.defaults
|
|
373
|
+
};
|
|
374
|
+
}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,47 +1,277 @@
|
|
|
1
|
+
export interface Page {
|
|
2
|
+
/** Eindeutige ID (für D1 Storage) */
|
|
3
|
+
id: string;
|
|
4
|
+
/** URL-Slug */
|
|
5
|
+
slug: string;
|
|
6
|
+
/** Seitentitel (H1 und <title>) */
|
|
7
|
+
title: string;
|
|
8
|
+
/** Meta Description für SEO */
|
|
9
|
+
description?: string;
|
|
10
|
+
/** Parent-Slug für Hierarchie */
|
|
11
|
+
parent?: string;
|
|
12
|
+
/** Icon (Emoji) für Navigation */
|
|
13
|
+
icon?: string;
|
|
14
|
+
/** Reihenfolge in Navigation */
|
|
15
|
+
order?: number;
|
|
16
|
+
/** In Navigation anzeigen? */
|
|
17
|
+
showInNav?: boolean;
|
|
18
|
+
/** Kurzname für Navigation */
|
|
19
|
+
navTitle?: string;
|
|
20
|
+
/** Layout-ID (optional) */
|
|
21
|
+
layoutId?: string;
|
|
22
|
+
/** Die Inhalte */
|
|
23
|
+
blocks: Block[];
|
|
24
|
+
/** Metadata */
|
|
25
|
+
createdAt?: string;
|
|
26
|
+
updatedAt?: string;
|
|
27
|
+
}
|
|
28
|
+
/** Layout Region Key - Vordefinierte Bereiche */
|
|
29
|
+
export type LayoutRegionKey = 'header' | 'sidebar' | 'content' | 'aside' | 'footer';
|
|
30
|
+
/** Layout Region - Ein Bereich im Layout */
|
|
31
|
+
export interface LayoutRegion {
|
|
32
|
+
/** Region-Name */
|
|
33
|
+
name: string;
|
|
34
|
+
/** Grid-Area Name für CSS Grid */
|
|
35
|
+
gridArea: LayoutRegionKey;
|
|
36
|
+
/** Blöcke in dieser Region (nur für header/sidebar/footer) */
|
|
37
|
+
blocks: Block[];
|
|
38
|
+
/** Sticky Position? */
|
|
39
|
+
sticky?: boolean;
|
|
40
|
+
}
|
|
41
|
+
/** Grid Konfiguration für Layout */
|
|
42
|
+
export interface LayoutGridConfig {
|
|
43
|
+
/** CSS Grid template-areas */
|
|
44
|
+
areas: string;
|
|
45
|
+
/** CSS Grid template-columns */
|
|
46
|
+
columns: string;
|
|
47
|
+
/** CSS Grid template-rows */
|
|
48
|
+
rows: string;
|
|
49
|
+
/** Gap zwischen Grid-Items */
|
|
50
|
+
gap?: string;
|
|
51
|
+
}
|
|
52
|
+
/** Layout - Template für mehrere Seiten */
|
|
53
|
+
export interface Layout {
|
|
54
|
+
/** Eindeutige ID */
|
|
55
|
+
id: string;
|
|
56
|
+
/** Layout-Name */
|
|
57
|
+
name: string;
|
|
58
|
+
/** Beschreibung */
|
|
59
|
+
description?: string;
|
|
60
|
+
/** Grid-Konfiguration */
|
|
61
|
+
grid: LayoutGridConfig;
|
|
62
|
+
/** Regionen */
|
|
63
|
+
regions: {
|
|
64
|
+
[K in LayoutRegionKey]?: LayoutRegion;
|
|
65
|
+
};
|
|
66
|
+
/** Metadata */
|
|
67
|
+
createdAt?: string;
|
|
68
|
+
updatedAt?: string;
|
|
69
|
+
}
|
|
1
70
|
export interface BaseBlock {
|
|
71
|
+
/** Eindeutige Block-ID */
|
|
2
72
|
id: string;
|
|
73
|
+
/** Block-Typ */
|
|
3
74
|
type: string;
|
|
4
75
|
}
|
|
5
|
-
|
|
6
|
-
|
|
76
|
+
/** Markdown Block - Der wichtigste Block */
|
|
77
|
+
export interface MarkdownBlock extends BaseBlock {
|
|
78
|
+
type: 'markdown';
|
|
79
|
+
/** Markdown Content */
|
|
7
80
|
content: string;
|
|
8
81
|
}
|
|
82
|
+
/** Heading Block */
|
|
9
83
|
export interface HeadingBlock extends BaseBlock {
|
|
10
|
-
type:
|
|
11
|
-
|
|
84
|
+
type: 'heading';
|
|
85
|
+
/** Überschrift-Text */
|
|
12
86
|
text: string;
|
|
87
|
+
/** Level: 1-6 */
|
|
88
|
+
level: 1 | 2 | 3 | 4 | 5 | 6;
|
|
13
89
|
}
|
|
90
|
+
/** Image Block */
|
|
14
91
|
export interface ImageBlock extends BaseBlock {
|
|
15
|
-
type:
|
|
92
|
+
type: 'image';
|
|
93
|
+
/** Bild-URL (R2 oder extern) */
|
|
16
94
|
src: string;
|
|
95
|
+
/** Alt-Text */
|
|
17
96
|
alt?: string;
|
|
97
|
+
/** Bildunterschrift */
|
|
98
|
+
caption?: string;
|
|
18
99
|
}
|
|
19
|
-
|
|
20
|
-
type: "markdown";
|
|
21
|
-
content: string;
|
|
22
|
-
}
|
|
100
|
+
/** Quote Block */
|
|
23
101
|
export interface QuoteBlock extends BaseBlock {
|
|
24
|
-
type:
|
|
25
|
-
|
|
26
|
-
|
|
102
|
+
type: 'quote';
|
|
103
|
+
/** Zitat-Text (kann Markdown sein) */
|
|
104
|
+
content: string;
|
|
105
|
+
/** Quelle/Autor */
|
|
106
|
+
source?: string;
|
|
27
107
|
}
|
|
108
|
+
/** Divider Block */
|
|
28
109
|
export interface DividerBlock extends BaseBlock {
|
|
29
|
-
type:
|
|
110
|
+
type: 'divider';
|
|
30
111
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
112
|
+
/** Note/Callout Block */
|
|
113
|
+
export interface NoteBlock extends BaseBlock {
|
|
114
|
+
type: 'note';
|
|
115
|
+
/** Inhalt (kann Markdown sein) */
|
|
116
|
+
content: string;
|
|
117
|
+
/** Variante */
|
|
118
|
+
variant: 'info' | 'warning' | 'tip' | 'danger';
|
|
34
119
|
}
|
|
120
|
+
/** FAQ Block */
|
|
35
121
|
export interface FaqBlock extends BaseBlock {
|
|
36
|
-
type:
|
|
37
|
-
|
|
122
|
+
type: 'faq';
|
|
123
|
+
/** Optionaler Titel */
|
|
124
|
+
title?: string;
|
|
125
|
+
/** FAQ-Einträge */
|
|
126
|
+
items: FaqItem[];
|
|
38
127
|
}
|
|
39
|
-
export interface
|
|
40
|
-
|
|
41
|
-
|
|
128
|
+
export interface FaqItem {
|
|
129
|
+
/** Frage */
|
|
130
|
+
q: string;
|
|
131
|
+
/** Antwort (Markdown) */
|
|
132
|
+
a: string;
|
|
42
133
|
}
|
|
134
|
+
/** HowTo/Steps Block */
|
|
43
135
|
export interface HowToBlock extends BaseBlock {
|
|
44
|
-
type:
|
|
136
|
+
type: 'howto';
|
|
137
|
+
/** Optionaler Titel */
|
|
138
|
+
title?: string;
|
|
139
|
+
/** Schritte */
|
|
45
140
|
steps: HowToStep[];
|
|
46
141
|
}
|
|
47
|
-
export
|
|
142
|
+
export interface HowToStep {
|
|
143
|
+
/** Schritt-Titel */
|
|
144
|
+
title: string;
|
|
145
|
+
/** Beschreibung (Markdown) */
|
|
146
|
+
description: string;
|
|
147
|
+
}
|
|
148
|
+
/** Hero Block */
|
|
149
|
+
export interface HeroBlock extends BaseBlock {
|
|
150
|
+
type: 'hero';
|
|
151
|
+
/** Haupttitel */
|
|
152
|
+
title: string;
|
|
153
|
+
/** Untertitel */
|
|
154
|
+
subtitle?: string;
|
|
155
|
+
}
|
|
156
|
+
/** Children Block - Zeigt Kind-Seiten */
|
|
157
|
+
export interface ChildrenBlock extends BaseBlock {
|
|
158
|
+
type: 'children';
|
|
159
|
+
/** Optionaler Titel */
|
|
160
|
+
title?: string;
|
|
161
|
+
/** Anzahl Spalten */
|
|
162
|
+
columns?: 2 | 3 | 4;
|
|
163
|
+
}
|
|
164
|
+
/** Link List Block */
|
|
165
|
+
export interface LinksBlock extends BaseBlock {
|
|
166
|
+
type: 'links';
|
|
167
|
+
/** Optionaler Titel */
|
|
168
|
+
title?: string;
|
|
169
|
+
/** Links */
|
|
170
|
+
items: LinkItem[];
|
|
171
|
+
}
|
|
172
|
+
export interface LinkItem {
|
|
173
|
+
/** Link-Text */
|
|
174
|
+
label: string;
|
|
175
|
+
/** URL */
|
|
176
|
+
href: string;
|
|
177
|
+
/** Icon (Emoji) */
|
|
178
|
+
icon?: string;
|
|
179
|
+
}
|
|
180
|
+
/** Breadcrumb Block */
|
|
181
|
+
export interface BreadcrumbBlock extends BaseBlock {
|
|
182
|
+
type: 'breadcrumb';
|
|
183
|
+
}
|
|
184
|
+
/** Affiliate Block */
|
|
185
|
+
export interface AffiliateBlock extends BaseBlock {
|
|
186
|
+
type: 'affiliate';
|
|
187
|
+
/** Referenz zum Affiliate */
|
|
188
|
+
ref?: string;
|
|
189
|
+
/** Darstellung */
|
|
190
|
+
variant?: 'inline' | 'box' | 'sticky' | 'floating';
|
|
191
|
+
}
|
|
192
|
+
/** Ad Block */
|
|
193
|
+
export interface AdBlock extends BaseBlock {
|
|
194
|
+
type: 'ad';
|
|
195
|
+
/** Slot-ID */
|
|
196
|
+
slot?: string;
|
|
197
|
+
/** Darstellung */
|
|
198
|
+
variant?: 'inline' | 'banner' | 'sidebar';
|
|
199
|
+
}
|
|
200
|
+
/** Container Block - Grid/Flex Container für Layout */
|
|
201
|
+
export interface ContainerBlock extends BaseBlock {
|
|
202
|
+
type: 'container';
|
|
203
|
+
/** Blöcke im Container */
|
|
204
|
+
blocks: Block[];
|
|
205
|
+
/** Layout-Typ */
|
|
206
|
+
layout: 'grid' | 'flex' | 'stack';
|
|
207
|
+
/** Grid-Konfiguration (nur bei layout: 'grid') */
|
|
208
|
+
grid?: {
|
|
209
|
+
columns?: string;
|
|
210
|
+
rows?: string;
|
|
211
|
+
gap?: string;
|
|
212
|
+
};
|
|
213
|
+
/** Flex-Konfiguration (nur bei layout: 'flex') */
|
|
214
|
+
flex?: {
|
|
215
|
+
direction?: 'row' | 'column';
|
|
216
|
+
wrap?: boolean;
|
|
217
|
+
gap?: string;
|
|
218
|
+
align?: 'start' | 'center' | 'end' | 'stretch';
|
|
219
|
+
justify?: 'start' | 'center' | 'end' | 'space-between' | 'space-around';
|
|
220
|
+
};
|
|
221
|
+
/** Stack-Konfiguration (nur bei layout: 'stack') */
|
|
222
|
+
stack?: {
|
|
223
|
+
gap?: string;
|
|
224
|
+
align?: 'start' | 'center' | 'end' | 'stretch';
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
/** Logo Block - Für Header/Branding */
|
|
228
|
+
export interface LogoBlock extends BaseBlock {
|
|
229
|
+
type: 'logo';
|
|
230
|
+
/** Logo-Bild URL */
|
|
231
|
+
src?: string;
|
|
232
|
+
/** Text/Name (wenn kein Bild) */
|
|
233
|
+
text?: string;
|
|
234
|
+
/** Alt-Text */
|
|
235
|
+
alt?: string;
|
|
236
|
+
/** Link-Ziel */
|
|
237
|
+
href?: string;
|
|
238
|
+
}
|
|
239
|
+
/** Navigation Block - Menü */
|
|
240
|
+
export interface NavigationBlock extends BaseBlock {
|
|
241
|
+
type: 'navigation';
|
|
242
|
+
/** Navigations-Items */
|
|
243
|
+
items: NavItem[];
|
|
244
|
+
/** Darstellung */
|
|
245
|
+
variant?: 'horizontal' | 'vertical' | 'dropdown';
|
|
246
|
+
/** Zeige Icons? */
|
|
247
|
+
showIcons?: boolean;
|
|
248
|
+
}
|
|
249
|
+
export interface NavItem {
|
|
250
|
+
/** Label */
|
|
251
|
+
label: string;
|
|
252
|
+
/** Link */
|
|
253
|
+
href: string;
|
|
254
|
+
/** Icon (Emoji) */
|
|
255
|
+
icon?: string;
|
|
256
|
+
/** Kinder (für Dropdown) */
|
|
257
|
+
children?: NavItem[];
|
|
258
|
+
}
|
|
259
|
+
/** Search Block - Suchleiste */
|
|
260
|
+
export interface SearchBlock extends BaseBlock {
|
|
261
|
+
type: 'search';
|
|
262
|
+
/** Placeholder-Text */
|
|
263
|
+
placeholder?: string;
|
|
264
|
+
/** Action URL */
|
|
265
|
+
action?: string;
|
|
266
|
+
}
|
|
267
|
+
export type Block = MarkdownBlock | HeadingBlock | ImageBlock | QuoteBlock | DividerBlock | NoteBlock | FaqBlock | HowToBlock | HeroBlock | ChildrenBlock | LinksBlock | BreadcrumbBlock | AffiliateBlock | AdBlock | ContainerBlock | LogoBlock | NavigationBlock | SearchBlock;
|
|
268
|
+
export type BlockType = Block['type'];
|
|
269
|
+
export declare function createBlock<T extends Block>(type: T['type'], data: Omit<T, 'id' | 'type'>): T;
|
|
270
|
+
export declare function createPage(data: Omit<Page, 'id' | 'blocks' | 'createdAt' | 'updatedAt'> & {
|
|
271
|
+
blocks?: Block[];
|
|
272
|
+
}): Page;
|
|
273
|
+
export declare function createLayout(data: Omit<Layout, 'id' | 'createdAt' | 'updatedAt'>): Layout;
|
|
274
|
+
export declare function createSimpleLayout(): Layout;
|
|
275
|
+
export declare function createTwoColumnLayout(): Layout;
|
|
276
|
+
export declare function createThreeColumnLayout(): Layout;
|
|
277
|
+
export declare function createFullWidthLayout(): Layout;
|