@blockslides/ai-context 0.2.0 → 0.3.0

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.
Files changed (49) hide show
  1. package/dist/index.cjs +987 -996
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +709 -191
  4. package/dist/index.d.ts +709 -191
  5. package/dist/index.js +987 -994
  6. package/dist/index.js.map +1 -1
  7. package/package.json +1 -1
  8. package/src/bundles/v1/all.ts +0 -1
  9. package/src/bundles/v1/allContexts.ts +1 -1
  10. package/src/bundles/v1/minimalCreate.ts +2 -2
  11. package/src/contexts/v1/blockquote.ts +10 -5
  12. package/src/contexts/v1/bulletList.ts +10 -5
  13. package/src/contexts/v1/codeBlock.ts +11 -3
  14. package/src/contexts/v1/column.ts +34 -14
  15. package/src/contexts/v1/columnGroup.ts +44 -0
  16. package/src/contexts/v1/core.ts +24 -4
  17. package/src/contexts/v1/editingRules.ts +5 -5
  18. package/src/contexts/v1/heading.ts +11 -4
  19. package/src/contexts/v1/horizontalRule.ts +9 -4
  20. package/src/contexts/v1/imageBlock.ts +31 -22
  21. package/src/contexts/v1/index.ts +1 -1
  22. package/src/contexts/v1/paragraph.ts +11 -5
  23. package/src/contexts/v1/slide.ts +5 -1
  24. package/src/contexts/v1/youtube.ts +14 -7
  25. package/src/index.ts +0 -3
  26. package/src/schemas/v1/blockquote.schema.json +13 -2
  27. package/src/schemas/v1/bulletList.schema.json +13 -2
  28. package/src/schemas/v1/codeBlock.schema.json +12 -3
  29. package/src/schemas/v1/column.schema.json +18 -14
  30. package/src/schemas/v1/columnGroup.schema.json +45 -0
  31. package/src/schemas/v1/heading.schema.json +12 -7
  32. package/src/schemas/v1/horizontalRule.schema.json +7 -2
  33. package/src/schemas/v1/imageBlock.schema.json +25 -15
  34. package/src/schemas/v1/index.ts +1 -1
  35. package/src/schemas/v1/paragraph.schema.json +13 -2
  36. package/src/schemas/v1/slide.schema.json +6 -0
  37. package/src/schemas/v1/youtube.schema.json +9 -6
  38. package/src/templates/v1/presetTemplateBuilder.ts +401 -443
  39. package/src/templates/v1/schemaBuilder.ts +195 -263
  40. package/src/types/v1.ts +40 -25
  41. package/src/contexts/v1/row.ts +0 -25
  42. package/src/examples/v1/flyers.ts +0 -30
  43. package/src/examples/v1/index.ts +0 -4
  44. package/src/examples/v1/slides.ts +0 -31
  45. package/src/recipes/v1/addTwoColumns.ts +0 -13
  46. package/src/recipes/v1/createSlide.ts +0 -29
  47. package/src/recipes/v1/editImageToCover.ts +0 -13
  48. package/src/recipes/v1/index.ts +0 -5
  49. package/src/schemas/v1/row.schema.json +0 -29
@@ -38,11 +38,13 @@ const titleAndSubheader: PresetTemplate = {
38
38
  icon: titleAndSubheaderIcon,
39
39
  build: () =>
40
40
  slide.singleCol({
41
- rowAttrs: { className: "min-h-[720px] items-center justify-center" },
42
41
  columnAttrs: {
43
- verticalAlign: "center",
44
- horizontalAlign: "center",
45
- className: "gap-6 p-12 text-center bg-white",
42
+ justify: "center",
43
+ align: "center",
44
+ gap: "md",
45
+ padding: "lg",
46
+ fill: true,
47
+ backgroundColor: "#ffffff",
46
48
  },
47
49
  content: [
48
50
  blocks.heading("Lorem ipsum dolor sit amet", 1),
@@ -107,30 +109,30 @@ const imageAndText: PresetTemplate = {
107
109
  description: "Image on left, text on right",
108
110
  icon: imageTextIcon,
109
111
  build: () =>
110
- slide.twoCol({
111
- rowAttrs: { className: "items-center" },
112
- leftColumnAttrs: {
113
- horizontalAlign: "center",
114
- verticalAlign: "center",
115
- className: "p-8",
116
- },
117
- rightColumnAttrs: {
118
- verticalAlign: "center",
119
- className: "p-8 gap-3",
120
- },
121
- left: [
122
- blocks.imageBlock({
123
- src: "https://placehold.co/640x480/png",
124
- layout: "contain",
125
- fullBleed: false,
126
- }),
127
- ],
128
- right: [
129
- blocks.heading("Lorem ipsum dolor sit amet", 2),
130
- blocks.paragraph("Consectetur adipiscing elit. Sed do eiusmod tempor incididunt."),
131
- blocks.paragraph("Ut enim ad minim veniam, quis nostrud exercitation."),
132
- ],
133
- }),
112
+ slide.twoCol(
113
+ blocks.column(
114
+ [
115
+ blocks.imageBlock({
116
+ src: "https://placehold.co/640x480/png",
117
+ size: "fit",
118
+ }),
119
+ ],
120
+ {
121
+ }
122
+ ),
123
+ blocks.column(
124
+ [
125
+ blocks.heading("Lorem ipsum dolor sit amet", 2),
126
+ blocks.paragraph("Consectetur adipiscing elit. Sed do eiusmod tempor incididunt."),
127
+ blocks.paragraph("Ut enim ad minim veniam, quis nostrud exercitation."),
128
+ ],
129
+ {
130
+ padding: "lg",
131
+ gap: "sm",
132
+ fill: true,
133
+ }
134
+ )
135
+ ),
134
136
  };
135
137
 
136
138
  const textAndImage: PresetTemplate = {
@@ -139,30 +141,35 @@ const textAndImage: PresetTemplate = {
139
141
  description: "Text on left, image on right",
140
142
  icon: textImageIcon,
141
143
  build: () =>
142
- slide.twoCol({
143
- rowAttrs: { className: "items-center" },
144
- leftColumnAttrs: {
145
- verticalAlign: "center",
146
- className: "p-8 gap-3",
147
- },
148
- rightColumnAttrs: {
149
- horizontalAlign: "center",
150
- verticalAlign: "center",
151
- className: "p-8",
152
- },
153
- left: [
154
- blocks.heading("Lorem ipsum dolor sit amet", 2),
155
- blocks.paragraph("Consectetur adipiscing elit. Sed do eiusmod tempor incididunt."),
156
- blocks.paragraph("Ut enim ad minim veniam, quis nostrud exercitation."),
157
- ],
158
- right: [
159
- blocks.imageBlock({
160
- src: "https://placehold.co/640x480/png",
161
- layout: "contain",
162
- fullBleed: false,
163
- }),
164
- ],
165
- }),
144
+ slide.twoCol(
145
+ blocks.column(
146
+ [
147
+ blocks.heading("Lorem ipsum dolor sit amet", 2),
148
+ blocks.paragraph("Consectetur adipiscing elit. Sed do eiusmod tempor incididunt."),
149
+ blocks.paragraph("Ut enim ad minim veniam, quis nostrud exercitation."),
150
+ ],
151
+ {
152
+ justify: "center",
153
+ padding: "lg",
154
+ gap: "sm",
155
+ fill: true,
156
+ }
157
+ ),
158
+ blocks.column(
159
+ [
160
+ blocks.imageBlock({
161
+ src: "https://placehold.co/640x480/png",
162
+ size: "fit",
163
+ }),
164
+ ],
165
+ {
166
+ align: "center",
167
+ justify: "center",
168
+ padding: "lg",
169
+ fill: true,
170
+ }
171
+ )
172
+ ),
166
173
  };
167
174
 
168
175
  const twoColumns: PresetTemplate = {
@@ -170,37 +177,31 @@ const twoColumns: PresetTemplate = {
170
177
  label: "Two Columns",
171
178
  description: "Header above two balanced text columns",
172
179
  icon: twoColumnsIcon,
173
- build: () =>
174
- slide.singleCol({
175
- columnAttrs: { className: "w-full p-6 gap-4", horizontalAlign: "stretch" },
176
- content: [
177
- blocks.heading("Section heading", 2),
178
- {
179
- type: "row",
180
- attrs: { layout: "1-1", className: "items-start w-full gap-4" },
181
- content: [
182
- {
183
- type: "column",
184
- attrs: { className: "p-4 gap-3 w-full box-border" },
185
- content: [
186
- blocks.paragraph("Lorem ipsum dolor sit amet."),
187
- blocks.paragraph("Consectetur adipiscing elit. Sed do eiusmod tempor incididunt."),
188
- blocks.paragraph("Ut enim ad minim veniam, quis nostrud exercitation."),
189
- ],
190
- },
191
- {
192
- type: "column",
193
- attrs: { className: "p-4 gap-3 w-full box-border" },
194
- content: [
195
- blocks.paragraph("Lorem ipsum dolor sit amet."),
196
- blocks.paragraph("Consectetur adipiscing elit. Sed do eiusmod tempor incididunt."),
197
- blocks.paragraph("Ut enim ad minim veniam, quis nostrud exercitation."),
198
- ],
199
- },
180
+ build: () => ({
181
+ type: "slide",
182
+ attrs: { id: "slide-1", size: "16x9" },
183
+ content: [
184
+ blocks.heading("Section heading", 2),
185
+ blocks.columnGroup([
186
+ blocks.column(
187
+ [
188
+ blocks.paragraph("Lorem ipsum dolor sit amet."),
189
+ blocks.paragraph("Consectetur adipiscing elit. Sed do eiusmod tempor incididunt."),
190
+ blocks.paragraph("Ut enim ad minim veniam, quis nostrud exercitation."),
200
191
  ],
201
- },
202
- ],
203
- }),
192
+ { padding: "md", gap: "sm", fill: true }
193
+ ),
194
+ blocks.column(
195
+ [
196
+ blocks.paragraph("Lorem ipsum dolor sit amet."),
197
+ blocks.paragraph("Consectetur adipiscing elit. Sed do eiusmod tempor incididunt."),
198
+ blocks.paragraph("Ut enim ad minim veniam, quis nostrud exercitation."),
199
+ ],
200
+ { padding: "md", gap: "sm", fill: true }
201
+ ),
202
+ ]),
203
+ ],
204
+ }),
204
205
  };
205
206
 
206
207
  const twoColumnsWithHeader: PresetTemplate = {
@@ -208,37 +209,31 @@ const twoColumnsWithHeader: PresetTemplate = {
208
209
  label: "Two Columns + Header",
209
210
  description: "Header plus two columns, each with its own heading",
210
211
  icon: twoColumnsHeaderIcon,
211
- build: () =>
212
- slide.singleCol({
213
- columnAttrs: { className: "w-full p-6 gap-4", horizontalAlign: "stretch" },
214
- content: [
215
- blocks.heading("Section heading", 2),
216
- {
217
- type: "row",
218
- attrs: { layout: "1-1", className: "items-start w-full gap-4" },
219
- content: [
220
- {
221
- type: "column",
222
- attrs: { className: "p-4 gap-3 w-full box-border" },
223
- content: [
224
- blocks.heading("Column heading", 4),
225
- blocks.paragraph("Consectetur adipiscing elit. Sed do eiusmod tempor incididunt."),
226
- blocks.paragraph("Ut enim ad minim veniam, quis nostrud exercitation."),
227
- ],
228
- },
229
- {
230
- type: "column",
231
- attrs: { className: "p-4 gap-3 w-full box-border" },
232
- content: [
233
- blocks.heading("Column heading", 4),
234
- blocks.paragraph("Consectetur adipiscing elit. Sed do eiusmod tempor incididunt."),
235
- blocks.paragraph("Ut enim ad minim veniam, quis nostrud exercitation."),
236
- ],
237
- },
212
+ build: () => ({
213
+ type: "slide",
214
+ attrs: { id: "slide-1", size: "16x9" },
215
+ content: [
216
+ blocks.heading("Section heading", 2),
217
+ blocks.columnGroup([
218
+ blocks.column(
219
+ [
220
+ blocks.heading("Column heading", 4),
221
+ blocks.paragraph("Consectetur adipiscing elit. Sed do eiusmod tempor incididunt."),
222
+ blocks.paragraph("Ut enim ad minim veniam, quis nostrud exercitation."),
238
223
  ],
239
- },
240
- ],
241
- }),
224
+ { padding: "md", gap: "sm", fill: true }
225
+ ),
226
+ blocks.column(
227
+ [
228
+ blocks.heading("Column heading", 4),
229
+ blocks.paragraph("Consectetur adipiscing elit. Sed do eiusmod tempor incididunt."),
230
+ blocks.paragraph("Ut enim ad minim veniam, quis nostrud exercitation."),
231
+ ],
232
+ { padding: "md", gap: "sm", fill: true }
233
+ ),
234
+ ]),
235
+ ],
236
+ }),
242
237
  };
243
238
 
244
239
  const threeColumns: PresetTemplate = {
@@ -246,42 +241,35 @@ const threeColumns: PresetTemplate = {
246
241
  label: "Three Columns",
247
242
  description: "Balanced three-column text",
248
243
  icon: threeColumnsIcon,
249
- build: () =>
250
- slide.singleCol({
251
- columnAttrs: { className: "w-full p-6 gap-4", horizontalAlign: "stretch" },
252
- content: [
253
- {
254
- type: "row",
255
- attrs: { layout: "1-1-1", className: "items-start w-full gap-4" },
256
- content: [
257
- {
258
- type: "column",
259
- attrs: { className: "p-3 gap-3 w-full box-border" },
260
- content: [
261
- blocks.paragraph("Lorem ipsum dolor sit amet."),
262
- blocks.paragraph("Consectetur adipiscing elit. Sed do eiusmod tempor incididunt."),
263
- ],
264
- },
265
- {
266
- type: "column",
267
- attrs: { className: "p-3 gap-3 w-full box-border" },
268
- content: [
269
- blocks.paragraph("Ut enim ad minim veniam."),
270
- blocks.paragraph("Quis nostrud exercitation ullamco laboris."),
271
- ],
272
- },
273
- {
274
- type: "column",
275
- attrs: { className: "p-3 gap-3 w-full box-border" },
276
- content: [
277
- blocks.paragraph("Nisi ut aliquip ex ea commodo consequat."),
278
- blocks.paragraph("Duis aute irure dolor in reprehenderit."),
279
- ],
280
- },
244
+ build: () => ({
245
+ type: "slide",
246
+ attrs: { id: "slide-1", size: "16x9" },
247
+ content: [
248
+ blocks.columnGroup([
249
+ blocks.column(
250
+ [
251
+ blocks.paragraph("Lorem ipsum dolor sit amet."),
252
+ blocks.paragraph("Consectetur adipiscing elit. Sed do eiusmod tempor incididunt."),
281
253
  ],
282
- },
283
- ],
284
- }),
254
+ { padding: "sm", gap: "sm", fill: true }
255
+ ),
256
+ blocks.column(
257
+ [
258
+ blocks.paragraph("Ut enim ad minim veniam."),
259
+ blocks.paragraph("Quis nostrud exercitation ullamco laboris."),
260
+ ],
261
+ { padding: "sm", gap: "sm", fill: true }
262
+ ),
263
+ blocks.column(
264
+ [
265
+ blocks.paragraph("Nisi ut aliquip ex ea commodo consequat."),
266
+ blocks.paragraph("Duis aute irure dolor in reprehenderit."),
267
+ ],
268
+ { padding: "sm", gap: "sm", fill: true }
269
+ ),
270
+ ]),
271
+ ],
272
+ }),
285
273
  };
286
274
 
287
275
  const threeColumnsWithHeader: PresetTemplate = {
@@ -289,46 +277,39 @@ const threeColumnsWithHeader: PresetTemplate = {
289
277
  label: "Three Columns + Header",
290
278
  description: "Header plus three columns",
291
279
  icon: threeColumnsHeaderIcon,
292
- build: () =>
293
- slide.singleCol({
294
- columnAttrs: { className: "w-full p-6 gap-4", horizontalAlign: "stretch" },
295
- content: [
296
- blocks.heading("Section heading", 2),
297
- {
298
- type: "row",
299
- attrs: { layout: "1-1-1", className: "items-start w-full gap-4" },
300
- content: [
301
- {
302
- type: "column",
303
- attrs: { className: "p-3 gap-3 w-full box-border" },
304
- content: [
305
- blocks.heading("Column heading", 4),
306
- blocks.paragraph("Lorem ipsum dolor sit amet."),
307
- blocks.paragraph("Consectetur adipiscing elit. Sed do eiusmod tempor incididunt."),
308
- ],
309
- },
310
- {
311
- type: "column",
312
- attrs: { className: "p-3 gap-3 w-full box-border" },
313
- content: [
314
- blocks.heading("Column heading", 4),
315
- blocks.paragraph("Ut enim ad minim veniam."),
316
- blocks.paragraph("Quis nostrud exercitation ullamco laboris."),
317
- ],
318
- },
319
- {
320
- type: "column",
321
- attrs: { className: "p-3 gap-3 w-full box-border" },
322
- content: [
323
- blocks.heading("Column heading", 4),
324
- blocks.paragraph("Nisi ut aliquip ex ea commodo consequat."),
325
- blocks.paragraph("Duis aute irure dolor in reprehenderit."),
326
- ],
327
- },
280
+ build: () => ({
281
+ type: "slide",
282
+ attrs: { id: "slide-1", size: "16x9" },
283
+ content: [
284
+ blocks.heading("Section heading", 2),
285
+ blocks.columnGroup([
286
+ blocks.column(
287
+ [
288
+ blocks.heading("Column heading", 4),
289
+ blocks.paragraph("Lorem ipsum dolor sit amet."),
290
+ blocks.paragraph("Consectetur adipiscing elit. Sed do eiusmod tempor incididunt."),
328
291
  ],
329
- },
330
- ],
331
- }),
292
+ { padding: "sm", gap: "sm", fill: true }
293
+ ),
294
+ blocks.column(
295
+ [
296
+ blocks.heading("Column heading", 4),
297
+ blocks.paragraph("Ut enim ad minim veniam."),
298
+ blocks.paragraph("Quis nostrud exercitation ullamco laboris."),
299
+ ],
300
+ { padding: "sm", gap: "sm", fill: true }
301
+ ),
302
+ blocks.column(
303
+ [
304
+ blocks.heading("Column heading", 4),
305
+ blocks.paragraph("Nisi ut aliquip ex ea commodo consequat."),
306
+ blocks.paragraph("Duis aute irure dolor in reprehenderit."),
307
+ ],
308
+ { padding: "sm", gap: "sm", fill: true }
309
+ ),
310
+ ]),
311
+ ],
312
+ }),
332
313
  };
333
314
 
334
315
  const fourColumnsWithHeader: PresetTemplate = {
@@ -336,55 +317,47 @@ const fourColumnsWithHeader: PresetTemplate = {
336
317
  label: "Four Columns + Header",
337
318
  description: "Header plus four columns",
338
319
  icon: fourColumnsHeaderIcon,
339
- build: () =>
340
- slide.singleCol({
341
- columnAttrs: { className: "w-full p-6 gap-4", horizontalAlign: "stretch" },
342
- content: [
343
- blocks.heading("Section heading", 2),
344
- {
345
- type: "row",
346
- attrs: { layout: "1-1-1-1", className: "items-start w-full gap-3" },
347
- content: [
348
- {
349
- type: "column",
350
- attrs: { className: "p-3 gap-3 w-full box-border" },
351
- content: [
352
- blocks.heading("Column heading", 4),
353
- blocks.paragraph("Lorem ipsum dolor sit amet."),
354
- blocks.paragraph("Consectetur adipiscing elit."),
355
- ],
356
- },
357
- {
358
- type: "column",
359
- attrs: { className: "p-3 gap-3 w-full box-border" },
360
- content: [
361
- blocks.heading("Column heading", 4),
362
- blocks.paragraph("Ut enim ad minim veniam."),
363
- blocks.paragraph("Quis nostrud exercitation ullamco laboris."),
364
- ],
365
- },
366
- {
367
- type: "column",
368
- attrs: { className: "p-3 gap-3 w-full box-border" },
369
- content: [
370
- blocks.heading("Column heading", 4),
371
- blocks.paragraph("Nisi ut aliquip ex ea commodo consequat."),
372
- blocks.paragraph("Duis aute irure dolor in reprehenderit."),
373
- ],
374
- },
375
- {
376
- type: "column",
377
- attrs: { className: "p-3 gap-3 w-full box-border" },
378
- content: [
379
- blocks.heading("Column heading", 4),
380
- blocks.paragraph("Excepteur sint occaecat cupidatat."),
381
- blocks.paragraph("Sunt in culpa qui officia."),
382
- ],
383
- },
320
+ build: () => ({
321
+ type: "slide",
322
+ attrs: { id: "slide-1", size: "16x9" },
323
+ content: [
324
+ blocks.heading("Section heading", 2),
325
+ blocks.columnGroup([
326
+ blocks.column(
327
+ [
328
+ blocks.heading("Column heading", 4),
329
+ blocks.paragraph("Lorem ipsum dolor sit amet."),
330
+ blocks.paragraph("Consectetur adipiscing elit."),
384
331
  ],
385
- },
386
- ],
387
- }),
332
+ { padding: "sm", gap: "sm", fill: true }
333
+ ),
334
+ blocks.column(
335
+ [
336
+ blocks.heading("Column heading", 4),
337
+ blocks.paragraph("Ut enim ad minim veniam."),
338
+ blocks.paragraph("Quis nostrud exercitation ullamco laboris."),
339
+ ],
340
+ { padding: "sm", gap: "sm", fill: true }
341
+ ),
342
+ blocks.column(
343
+ [
344
+ blocks.heading("Column heading", 4),
345
+ blocks.paragraph("Nisi ut aliquip ex ea commodo consequat."),
346
+ blocks.paragraph("Duis aute irure dolor in reprehenderit."),
347
+ ],
348
+ { padding: "sm", gap: "sm", fill: true }
349
+ ),
350
+ blocks.column(
351
+ [
352
+ blocks.heading("Column heading", 4),
353
+ blocks.paragraph("Excepteur sint occaecat cupidatat."),
354
+ blocks.paragraph("Sunt in culpa qui officia."),
355
+ ],
356
+ { padding: "sm", gap: "sm", fill: true }
357
+ ),
358
+ ]),
359
+ ],
360
+ }),
388
361
  };
389
362
 
390
363
  const fullImage: PresetTemplate = {
@@ -394,14 +367,12 @@ const fullImage: PresetTemplate = {
394
367
  icon: fullImageIcon,
395
368
  build: () =>
396
369
  slide.singleCol({
397
- rowAttrs: { className: "min-h-[720px]" },
398
- columnAttrs: { className: "p-0 w-full h-full", horizontalAlign: "stretch" },
370
+ columnAttrs: { padding: "none", fill: true, align: "stretch" },
399
371
  content: [
400
372
  blocks.imageBlock({
401
373
  src: "https://placehold.co/1920x1080/png",
402
- layout: "cover",
403
- fullBleed: true,
404
- align: "center",
374
+ size: "fill",
375
+ crop: "center",
405
376
  }),
406
377
  ],
407
378
  }),
@@ -412,24 +383,23 @@ const fourColumns: PresetTemplate = {
412
383
  label: "Four Columns",
413
384
  description: "Balanced four-column text",
414
385
  icon: fourColumnsIcon,
415
- build: () =>
416
- slide.singleCol({
417
- columnAttrs: { className: "w-full p-4 gap-4", horizontalAlign: "stretch" },
418
- content: [
419
- {
420
- type: "row",
421
- attrs: { layout: "1-1-1-1", className: "items-start w-full gap-3" },
422
- content: Array.from({ length: 4 }).map(() => ({
423
- type: "column",
424
- attrs: { className: "p-2.5 gap-2 w-full box-border" },
425
- content: [
386
+ build: () => ({
387
+ type: "slide",
388
+ attrs: { id: "slide-1", size: "16x9" },
389
+ content: [
390
+ blocks.columnGroup(
391
+ Array.from({ length: 4 }).map(() =>
392
+ blocks.column(
393
+ [
426
394
  blocks.paragraph("Lorem ipsum dolor sit amet."),
427
395
  blocks.paragraph("Consectetur adipiscing elit."),
428
396
  ],
429
- })),
430
- },
431
- ],
432
- }),
397
+ { padding: "sm", gap: "sm", fill: true }
398
+ )
399
+ )
400
+ ),
401
+ ],
402
+ }),
433
403
  };
434
404
 
435
405
  const titleWithBullets: PresetTemplate = {
@@ -439,7 +409,7 @@ const titleWithBullets: PresetTemplate = {
439
409
  icon: titleBulletsIcon,
440
410
  build: () =>
441
411
  slide.singleCol({
442
- columnAttrs: { className: "p-6 gap-4" },
412
+ columnAttrs: { padding: "md", gap: "md" },
443
413
  content: [
444
414
  blocks.heading("Lorem ipsum dolor sit amet", 2),
445
415
  blocks.bulletList([
@@ -457,30 +427,33 @@ const titleBulletsAndImage: PresetTemplate = {
457
427
  description: "Title with bullets and an image",
458
428
  icon: titleBulletsImageIcon,
459
429
  build: () =>
460
- slide.twoCol({
461
- rowAttrs: { className: "items-start w-full" },
462
- leftColumnAttrs: { className: "p-6 gap-3 w-full" },
463
- rightColumnAttrs: {
464
- horizontalAlign: "center",
465
- verticalAlign: "center",
466
- className: "p-6 w-full",
467
- },
468
- left: [
469
- blocks.heading("Lorem ipsum dolor sit amet", 2),
470
- blocks.bulletList([
471
- "Consectetur adipiscing elit.",
472
- "Sed do eiusmod tempor incididunt.",
473
- "Ut enim ad minim veniam.",
474
- ]),
475
- ],
476
- right: [
477
- blocks.imageBlock({
478
- src: "https://placehold.co/480x360/png",
479
- layout: "contain",
480
- fullBleed: false,
481
- }),
482
- ],
483
- }),
430
+ slide.twoCol(
431
+ blocks.column(
432
+ [
433
+ blocks.heading("Lorem ipsum dolor sit amet", 2),
434
+ blocks.bulletList([
435
+ "Consectetur adipiscing elit.",
436
+ "Sed do eiusmod tempor incididunt.",
437
+ "Ut enim ad minim veniam.",
438
+ ]),
439
+ ],
440
+ { padding: "md", gap: "sm", fill: true }
441
+ ),
442
+ blocks.column(
443
+ [
444
+ blocks.imageBlock({
445
+ src: "https://placehold.co/480x360/png",
446
+ size: "fit",
447
+ }),
448
+ ],
449
+ {
450
+ align: "center",
451
+ justify: "center",
452
+ padding: "md",
453
+ fill: true,
454
+ }
455
+ )
456
+ ),
484
457
  };
485
458
 
486
459
  const accentLeft: PresetTemplate = {
@@ -489,28 +462,31 @@ const accentLeft: PresetTemplate = {
489
462
  description: "Accent band with image on the left, text on the right",
490
463
  icon: accentLeftIcon,
491
464
  build: () =>
492
- slide.twoCol({
493
- rowAttrs: { layout: "1-2", className: "items-stretch w-full gap-0 min-h-[360px]" },
494
- leftColumnAttrs: {
495
- className: "bg-slate-100 p-0 w-full h-full",
496
- horizontalAlign: "stretch",
497
- verticalAlign: "top",
498
- },
499
- rightColumnAttrs: { className: "p-6 gap-3 w-full", verticalAlign: "center" },
500
- left: [
501
- blocks.imageBlock({
502
- src: "https://placehold.co/320x240/png",
503
- layout: "cover",
504
- fullBleed: true,
505
- align: "center",
506
- }),
507
- ],
508
- right: [
509
- blocks.heading("Accent left", 3),
510
- blocks.paragraph("Short supporting copy goes here."),
511
- blocks.paragraph("Add one more line if needed."),
512
- ],
513
- }),
465
+ slide.twoCol(
466
+ blocks.column(
467
+ [
468
+ blocks.imageBlock({
469
+ src: "https://placehold.co/320x240/png",
470
+ size: "fill",
471
+ crop: "center",
472
+ }),
473
+ ],
474
+ {
475
+ backgroundColor: "#f1f5f9",
476
+ padding: "none",
477
+ fill: true,
478
+ align: "stretch",
479
+ }
480
+ ),
481
+ blocks.column(
482
+ [
483
+ blocks.heading("Accent left", 3),
484
+ blocks.paragraph("Short supporting copy goes here."),
485
+ blocks.paragraph("Add one more line if needed."),
486
+ ],
487
+ { padding: "md", gap: "sm", fill: true, justify: "center" }
488
+ )
489
+ ),
514
490
  };
515
491
 
516
492
  const accentRight: PresetTemplate = {
@@ -519,28 +495,31 @@ const accentRight: PresetTemplate = {
519
495
  description: "Accent band with image on the right, text on the left",
520
496
  icon: accentRightIcon,
521
497
  build: () =>
522
- slide.twoCol({
523
- rowAttrs: { layout: "2-1", className: "items-stretch w-full gap-0 min-h-[360px]" },
524
- leftColumnAttrs: { className: "p-6 gap-3 w-full", verticalAlign: "center" },
525
- rightColumnAttrs: {
526
- className: "bg-slate-100 p-0 w-full h-full",
527
- horizontalAlign: "stretch",
528
- verticalAlign: "top",
529
- },
530
- left: [
531
- blocks.heading("Accent right", 3),
532
- blocks.paragraph("Short supporting copy goes here."),
533
- blocks.paragraph("Add one more line if needed."),
534
- ],
535
- right: [
536
- blocks.imageBlock({
537
- src: "https://placehold.co/320x240/png",
538
- layout: "cover",
539
- fullBleed: true,
540
- align: "center",
541
- }),
542
- ],
543
- }),
498
+ slide.twoCol(
499
+ blocks.column(
500
+ [
501
+ blocks.heading("Accent right", 3),
502
+ blocks.paragraph("Short supporting copy goes here."),
503
+ blocks.paragraph("Add one more line if needed."),
504
+ ],
505
+ { padding: "md", gap: "sm", fill: true, justify: "center" }
506
+ ),
507
+ blocks.column(
508
+ [
509
+ blocks.imageBlock({
510
+ src: "https://placehold.co/320x240/png",
511
+ size: "fill",
512
+ crop: "center",
513
+ }),
514
+ ],
515
+ {
516
+ backgroundColor: "#f1f5f9",
517
+ padding: "none",
518
+ fill: true,
519
+ align: "stretch",
520
+ }
521
+ )
522
+ ),
544
523
  };
545
524
 
546
525
  const accentTop: PresetTemplate = {
@@ -551,39 +530,26 @@ const accentTop: PresetTemplate = {
551
530
  build: () =>
552
531
  ({
553
532
  type: "slide",
554
- attrs: { id: "slide-1", size: "16x9", className: "" },
533
+ attrs: { id: "slide-1", size: "16x9" },
555
534
  content: [
556
535
  {
557
- type: "row",
558
- attrs: { layout: "1", className: "w-full items-stretch h-[20vh] min-h-[140px]" },
536
+ type: "column",
537
+ attrs: { backgroundColor: "#f1f5f9", padding: "none", height: "200px", align: "stretch" },
559
538
  content: [
560
- {
561
- type: "column",
562
- attrs: { className: "bg-slate-100 p-0 w-full h-full box-border" },
563
- content: [
564
- blocks.imageBlock({
565
- src: "https://placehold.co/1200x400/png",
566
- layout: "cover",
567
- fullBleed: true,
568
- align: "center",
569
- }),
570
- ],
571
- },
539
+ blocks.imageBlock({
540
+ src: "https://placehold.co/1200x400/png",
541
+ size: "fill",
542
+ crop: "center",
543
+ }),
572
544
  ],
573
545
  },
574
546
  {
575
- type: "row",
576
- attrs: { layout: "1", className: "w-full flex-1" },
547
+ type: "column",
548
+ attrs: { padding: "md", gap: "sm", fill: true, justify: "end" },
577
549
  content: [
578
- {
579
- type: "column",
580
- attrs: { className: "p-6 gap-3 w-full box-border justify-end" },
581
- content: [
582
- blocks.heading("Accent top", 3),
583
- blocks.paragraph("Short supporting copy goes here."),
584
- blocks.paragraph("Add one more line if needed."),
585
- ],
586
- },
550
+ blocks.heading("Accent top", 3),
551
+ blocks.paragraph("Short supporting copy goes here."),
552
+ blocks.paragraph("Add one more line if needed."),
587
553
  ],
588
554
  },
589
555
  ],
@@ -596,34 +562,35 @@ const accentRightFit: PresetTemplate = {
596
562
  description: "Text with a tighter image card on the right",
597
563
  icon: accentRightFitIcon,
598
564
  build: () =>
599
- slide.twoCol({
600
- rowAttrs: { layout: "2-1", className: "items-center w-full gap-4" },
601
- leftColumnAttrs: { className: "p-6 gap-3 w-full", verticalAlign: "center" },
602
- rightColumnAttrs: {
603
- className: "p-6 w-full items-center",
604
- verticalAlign: "center",
605
- horizontalAlign: "center",
606
- },
607
- left: [
608
- blocks.heading("Accent right (fit)", 3),
609
- blocks.paragraph("Short supporting copy goes here."),
610
- blocks.paragraph("Add one more line if needed."),
611
- ],
612
- right: [
565
+ slide.twoCol(
566
+ blocks.column(
567
+ [
568
+ blocks.heading("Accent right (fit)", 3),
569
+ blocks.paragraph("Short supporting copy goes here."),
570
+ blocks.paragraph("Add one more line if needed."),
571
+ ],
572
+ { padding: "md", gap: "sm", fill: true, justify: "center" }
573
+ ),
574
+ blocks.column(
575
+ [
576
+ blocks.column(
577
+ [
578
+ blocks.imageBlock({
579
+ src: "https://placehold.co/240x200/png",
580
+ size: "fit",
581
+ }),
582
+ ],
583
+ { backgroundColor: "#f1f5f9", padding: "md", gap: "sm", borderRadius: "lg", align: "center" }
584
+ ),
585
+ ],
613
586
  {
614
- type: "column",
615
- attrs: { className: "bg-slate-100 p-4 gap-3 rounded-lg w-full items-center" },
616
- content: [
617
- blocks.imageBlock({
618
- src: "https://placehold.co/240x200/png",
619
- layout: "contain",
620
- fullBleed: false,
621
- align: "center",
622
- }),
623
- ],
624
- },
625
- ],
626
- }),
587
+ padding: "md",
588
+ fill: true,
589
+ justify: "center",
590
+ align: "center",
591
+ }
592
+ )
593
+ ),
627
594
  };
628
595
 
629
596
  const accentLeftFit: PresetTemplate = {
@@ -632,34 +599,35 @@ const accentLeftFit: PresetTemplate = {
632
599
  description: "Compact image card on the left, text on the right",
633
600
  icon: accentLeftFitIcon,
634
601
  build: () =>
635
- slide.twoCol({
636
- rowAttrs: { layout: "1-2", className: "items-center w-full gap-4" },
637
- leftColumnAttrs: {
638
- className: "p-6 w-full items-center",
639
- verticalAlign: "center",
640
- horizontalAlign: "center",
641
- },
642
- rightColumnAttrs: { className: "p-6 gap-3 w-full", verticalAlign: "center" },
643
- left: [
602
+ slide.twoCol(
603
+ blocks.column(
604
+ [
605
+ blocks.column(
606
+ [
607
+ blocks.imageBlock({
608
+ src: "https://placehold.co/240x200/png",
609
+ size: "fit",
610
+ }),
611
+ ],
612
+ { backgroundColor: "#f1f5f9", padding: "md", gap: "sm", borderRadius: "lg", align: "center" }
613
+ ),
614
+ ],
644
615
  {
645
- type: "column",
646
- attrs: { className: "bg-slate-100 p-4 gap-3 rounded-lg w-full items-center" },
647
- content: [
648
- blocks.imageBlock({
649
- src: "https://placehold.co/240x200/png",
650
- layout: "contain",
651
- fullBleed: false,
652
- align: "center",
653
- }),
654
- ],
655
- },
656
- ],
657
- right: [
658
- blocks.heading("Accent left (fit)", 3),
659
- blocks.paragraph("Short supporting copy goes here."),
660
- blocks.paragraph("Add one more line if needed."),
661
- ],
662
- }),
616
+ padding: "md",
617
+ fill: true,
618
+ justify: "center",
619
+ align: "center",
620
+ }
621
+ ),
622
+ blocks.column(
623
+ [
624
+ blocks.heading("Accent left (fit)", 3),
625
+ blocks.paragraph("Short supporting copy goes here."),
626
+ blocks.paragraph("Add one more line if needed."),
627
+ ],
628
+ { padding: "md", gap: "sm", fill: true, justify: "center" }
629
+ )
630
+ ),
663
631
  };
664
632
 
665
633
  const twoImageColumns: PresetTemplate = {
@@ -667,47 +635,37 @@ const twoImageColumns: PresetTemplate = {
667
635
  label: "2 image columns",
668
636
  description: "Header with two image cards",
669
637
  icon: twoImageColumnsIcon,
670
- build: () =>
671
- slide.singleCol({
672
- columnAttrs: { className: "w-full p-6 gap-4", horizontalAlign: "stretch" },
673
- content: [
674
- blocks.heading("Images", 2),
675
- {
676
- type: "row",
677
- attrs: { layout: "1-1", className: "items-start w-full gap-4" },
678
- content: [
679
- {
680
- type: "column",
681
- attrs: { className: "p-4 gap-3 w-full box-border" },
682
- content: [
683
- blocks.imageBlock({
684
- src: "https://placehold.co/640x360/png",
685
- layout: "contain",
686
- fullBleed: false,
687
- align: "center",
688
- }),
689
- blocks.heading("Image title", 4),
690
- blocks.paragraph("Short supporting copy goes here."),
691
- ],
692
- },
693
- {
694
- type: "column",
695
- attrs: { className: "p-4 gap-3 w-full box-border" },
696
- content: [
697
- blocks.imageBlock({
698
- src: "https://placehold.co/640x360/png",
699
- layout: "contain",
700
- fullBleed: false,
701
- align: "center",
702
- }),
703
- blocks.heading("Image title", 4),
704
- blocks.paragraph("Short supporting copy goes here."),
705
- ],
706
- },
638
+ build: () => ({
639
+ type: "slide",
640
+ attrs: { id: "slide-1", size: "16x9" },
641
+ content: [
642
+ blocks.heading("Images", 2),
643
+ blocks.columnGroup([
644
+ blocks.column(
645
+ [
646
+ blocks.imageBlock({
647
+ src: "https://placehold.co/640x360/png",
648
+ size: "fit",
649
+ }),
650
+ blocks.heading("Image title", 4),
651
+ blocks.paragraph("Short supporting copy goes here."),
707
652
  ],
708
- },
709
- ],
710
- }),
653
+ { padding: "md", gap: "sm", fill: true }
654
+ ),
655
+ blocks.column(
656
+ [
657
+ blocks.imageBlock({
658
+ src: "https://placehold.co/640x360/png",
659
+ size: "fit",
660
+ }),
661
+ blocks.heading("Image title", 4),
662
+ blocks.paragraph("Short supporting copy goes here."),
663
+ ],
664
+ { padding: "md", gap: "sm", fill: true }
665
+ ),
666
+ ]),
667
+ ],
668
+ }),
711
669
  };
712
670
 
713
671
  const registry: Record<PresetKey, PresetTemplate> = {