@blockslides/ai-context 0.1.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 (57) hide show
  1. package/LICENSE.md +36 -0
  2. package/README.md +268 -0
  3. package/dist/index.cjs +806 -0
  4. package/dist/index.cjs.map +1 -0
  5. package/dist/index.d.cts +704 -0
  6. package/dist/index.d.ts +704 -0
  7. package/dist/index.js +781 -0
  8. package/dist/index.js.map +1 -0
  9. package/package.json +44 -0
  10. package/src/bundles/v1/all.ts +26 -0
  11. package/src/bundles/v1/allContexts.ts +32 -0
  12. package/src/bundles/v1/allSchemas.ts +20 -0
  13. package/src/bundles/v1/imageEditing.ts +5 -0
  14. package/src/bundles/v1/index.ts +6 -0
  15. package/src/bundles/v1/minimalCreate.ts +5 -0
  16. package/src/contexts/v1/blockquote.ts +14 -0
  17. package/src/contexts/v1/bulletList.ts +15 -0
  18. package/src/contexts/v1/codeBlock.ts +15 -0
  19. package/src/contexts/v1/column.ts +15 -0
  20. package/src/contexts/v1/core.ts +17 -0
  21. package/src/contexts/v1/editingRules.ts +9 -0
  22. package/src/contexts/v1/hardBreak.ts +14 -0
  23. package/src/contexts/v1/heading.ts +15 -0
  24. package/src/contexts/v1/horizontalRule.ts +14 -0
  25. package/src/contexts/v1/image.ts +17 -0
  26. package/src/contexts/v1/imageBlock.ts +27 -0
  27. package/src/contexts/v1/index.ts +19 -0
  28. package/src/contexts/v1/output.fullDocument.ts +8 -0
  29. package/src/contexts/v1/paragraph.ts +14 -0
  30. package/src/contexts/v1/row.ts +17 -0
  31. package/src/contexts/v1/sizing.ts +8 -0
  32. package/src/contexts/v1/slide.ts +16 -0
  33. package/src/contexts/v1/style.ts +8 -0
  34. package/src/contexts/v1/youtube.ts +18 -0
  35. package/src/examples/v1/flyers.ts +30 -0
  36. package/src/examples/v1/index.ts +4 -0
  37. package/src/examples/v1/slides.ts +31 -0
  38. package/src/index.ts +7 -0
  39. package/src/recipes/v1/addTwoColumns.ts +13 -0
  40. package/src/recipes/v1/createSlide.ts +29 -0
  41. package/src/recipes/v1/editImageToCover.ts +13 -0
  42. package/src/recipes/v1/index.ts +5 -0
  43. package/src/schemas/v1/blockquote.schema.json +16 -0
  44. package/src/schemas/v1/bulletList.schema.json +16 -0
  45. package/src/schemas/v1/codeBlock.schema.json +19 -0
  46. package/src/schemas/v1/column.schema.json +23 -0
  47. package/src/schemas/v1/hardBreak.schema.json +16 -0
  48. package/src/schemas/v1/heading.schema.json +23 -0
  49. package/src/schemas/v1/horizontalRule.schema.json +16 -0
  50. package/src/schemas/v1/image.schema.json +23 -0
  51. package/src/schemas/v1/imageBlock.schema.json +31 -0
  52. package/src/schemas/v1/index.ts +14 -0
  53. package/src/schemas/v1/paragraph.schema.json +16 -0
  54. package/src/schemas/v1/row.schema.json +22 -0
  55. package/src/schemas/v1/slide.schema.json +32 -0
  56. package/src/schemas/v1/youtube.schema.json +22 -0
  57. package/src/types/v1.ts +55 -0
package/dist/index.cjs ADDED
@@ -0,0 +1,806 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all2) => {
7
+ for (var name in all2)
8
+ __defProp(target, name, { get: all2[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ bundlesV1: () => v1_exports4,
24
+ contextsV1: () => v1_exports,
25
+ examplesV1: () => v1_exports2,
26
+ recipesV1: () => v1_exports5,
27
+ schemasV1: () => v1_exports3
28
+ });
29
+ module.exports = __toCommonJS(index_exports);
30
+
31
+ // src/contexts/v1/index.ts
32
+ var v1_exports = {};
33
+ __export(v1_exports, {
34
+ blockquote: () => blockquote,
35
+ bulletList: () => bulletList,
36
+ codeBlock: () => codeBlock,
37
+ column: () => column,
38
+ core: () => core,
39
+ editingRules: () => editingRules,
40
+ fullDocument: () => fullDocument,
41
+ hardBreak: () => hardBreak,
42
+ heading: () => heading,
43
+ horizontalRule: () => horizontalRule,
44
+ image: () => image,
45
+ imageBlock: () => imageBlock,
46
+ paragraph: () => paragraph,
47
+ row: () => row,
48
+ sizing: () => sizing,
49
+ slide: () => slide,
50
+ style: () => style,
51
+ youtube: () => youtube
52
+ });
53
+
54
+ // src/contexts/v1/core.ts
55
+ var core = `
56
+ You are given a BlockSlides document to CREATE or EDIT.
57
+
58
+ Document shape:
59
+ - doc: { type: "doc", content: slide[] }
60
+ - slide: { type: "slide", attrs?, content: row[] }
61
+ - row: { type: "row", attrs?, content: column[] | block[] }
62
+ - column: { type: "column", attrs?, content: (block | row)[] }
63
+ - block: includes nodes like paragraph, heading, imageBlock, etc.
64
+
65
+ Rules:
66
+ - Use only known node types and valid attrs. Do not invent attributes.
67
+ - Prefer stable references: preserve slide.attrs.id if present.
68
+ - Slides and flyers share the same JSON; flyers are slides sized via attrs and theme.
69
+ `.trim();
70
+
71
+ // src/contexts/v1/output.fullDocument.ts
72
+ var fullDocument = `
73
+ Output contract:
74
+ - Return exactly one JSON object representing the ENTIRE document.
75
+ - No prose, no markdown, no code fences, no comments. JSON only.
76
+ - Include all required attrs. Use allowed enum values only.
77
+ `.trim();
78
+
79
+ // src/contexts/v1/imageBlock.ts
80
+ var imageBlock = `
81
+ Node: imageBlock
82
+ Attrs:
83
+ - src (required): string (URL)
84
+ - alt (optional): string
85
+ - caption (optional): string
86
+ - credit (optional): string
87
+ - layout (optional): "cover" | "contain" | "fill" | "focus" | "pattern"
88
+ - align (optional): "left" | "center" | "right" | "stretch" (default "center")
89
+ - width (optional): number (px) or string ("%"/"px")
90
+ - height (optional): number (px) or string ("%"/"px")
91
+ - fullBleed (optional): boolean (removes radius; stretches width)
92
+ - assetId (optional): string
93
+ - focalX, focalY (optional): 0\u2013100; spotlight position (when relevant)
94
+
95
+ Behavior:
96
+ - Numbers for width/height are interpreted as pixels.
97
+ - layout:
98
+ - cover: Fill container; crop edges as needed.
99
+ - contain: Fit entirely; may letterbox.
100
+ - fill: Stretch to container (may distort).
101
+ - focus: Cover + radial spotlight at focalX/focalY.
102
+ - pattern: Hide <img>; use tiled background (from src).
103
+ - Do not set unknown attributes. Preserve existing valid attrs.
104
+ `.trim();
105
+
106
+ // src/contexts/v1/row.ts
107
+ var row = `
108
+ Node: row
109
+ Attrs:
110
+ - layout (optional): "", "1", "1-1", "2-1", "1-2", "1-1-1", "2-1-1", "1-2-1", "1-1-2", "1-1-1-1"
111
+ - className (optional): string (CSS classes)
112
+
113
+ Semantics:
114
+ - Fractions determine relative column flex:
115
+ - 1-1: two equal columns
116
+ - 2-1: first column is double width
117
+ - 1-2: second column is double width
118
+ - 1-1-1: three equal columns
119
+ - 1-1-1-1: four equal columns
120
+ - Empty layout ("", "1") acts as a single full-width column.
121
+ `.trim();
122
+
123
+ // src/contexts/v1/column.ts
124
+ var column = `
125
+ Node: column
126
+ Attrs:
127
+ - className (optional): string
128
+ - contentMode (optional): "default" (future-friendly)
129
+ - verticalAlign (optional): "top" | "center" | "bottom" (default "top")
130
+ - horizontalAlign (optional): "left" | "center" | "right" | "stretch" (default "left")
131
+ - padding (optional): "none" (future-friendly)
132
+
133
+ Notes:
134
+ - Use className for spacing, colors, typography (e.g., Tailwind).
135
+ - Keep nesting shallow; columns can contain rows or blocks as needed.
136
+ `.trim();
137
+
138
+ // src/contexts/v1/slide.ts
139
+ var slide = `
140
+ Node: slide
141
+ Attrs:
142
+ - id (optional): string (stable identifier; preserve if present)
143
+ - className (optional): string (styling)
144
+ - size (optional): "16x9" | "4x3" | "a4-portrait" | "a4-landscape" | "letter-portrait" | "letter-landscape" | "linkedin-banner"
145
+
146
+ Content:
147
+ - slide contains one or more rows.
148
+
149
+ Notes:
150
+ - Flyers are slides sized for paper (e.g., size: "a4-portrait").
151
+ - Set size to control canvas dimensions; theme applies the exact width/height.
152
+ `.trim();
153
+
154
+ // src/contexts/v1/style.ts
155
+ var style = `
156
+ Styling
157
+ - Prefer using attrs.className for styling (e.g., Tailwind classes).
158
+ - Use enums for canonical behaviors (e.g., imageBlock.layout).
159
+ - When enums are insufficient (spacing, backgrounds), use className.
160
+ `.trim();
161
+
162
+ // src/contexts/v1/editingRules.ts
163
+ var editingRules = `
164
+ Editing rules
165
+ - Preserve existing ids and valid attributes. Do not remove or rename known attrs.
166
+ - Use only allowed enum values. Do not invent new enum values.
167
+ - Avoid introducing new attrs. If styling is needed, prefer className.
168
+ - Keep the document valid: slide > row > column > blocks.
169
+ `.trim();
170
+
171
+ // src/contexts/v1/sizing.ts
172
+ var sizing = `
173
+ Sizing
174
+ - Slides and flyers share the same JSON. Flyers are slides sized via slide.attrs.size and theme rules.
175
+ - Allowed sizes: "16x9" | "4x3" | "a4-portrait" | "a4-landscape" | "letter-portrait" | "letter-landscape" | "linkedin-banner".
176
+ - Editors may render with fixed canvases or dynamic mode. The default is fixed; dynamic stretches to container with preserved aspect.
177
+ `.trim();
178
+
179
+ // src/contexts/v1/blockquote.ts
180
+ var blockquote = `
181
+ Node: blockquote
182
+ Attrs:
183
+ - HTML-only; no required JSON attrs beyond optional styling such as className.
184
+
185
+ Content:
186
+ - One or more block nodes (typically paragraphs, headings, lists).
187
+
188
+ Semantics:
189
+ - Use for quoted text or callouts inside a column or row.
190
+ - Styling should be applied via className on the surrounding column/slide, not by inventing new attrs here.
191
+ `.trim();
192
+
193
+ // src/contexts/v1/bulletList.ts
194
+ var bulletList = `
195
+ Node: bulletList
196
+ Attrs:
197
+ - HTML-only; no required JSON attrs beyond optional styling such as className.
198
+
199
+ Content:
200
+ - One or more list item nodes (listItem) that contain paragraphs or inline content.
201
+
202
+ Semantics:
203
+ - Represents an unordered list rendered as <ul>.
204
+ - Use when you need bullet points inside a column or blockquote.
205
+ - Do not use bulletList as a top-level child of doc; it belongs inside a column/row structure.
206
+ `.trim();
207
+
208
+ // src/contexts/v1/codeBlock.ts
209
+ var codeBlock = `
210
+ Node: codeBlock
211
+ Attrs:
212
+ - language (optional): string | null (e.g., "js", "ts", "python").
213
+
214
+ Content:
215
+ - Plain text only (no child nodes); used for preformatted code samples.
216
+
217
+ Semantics:
218
+ - Renders as <pre><code>\u2026</code></pre>.
219
+ - language controls a CSS class (e.g., "language-js") for syntax highlighting.
220
+ - Use when the user explicitly wants a fenced code block, not inline code in a paragraph.
221
+ `.trim();
222
+
223
+ // src/contexts/v1/hardBreak.ts
224
+ var hardBreak = `
225
+ Node: hardBreak
226
+ Attrs:
227
+ - None (HTML-only); behaves like a manual line break.
228
+
229
+ Content:
230
+ - Inline-only; used within paragraphs or headings.
231
+
232
+ Semantics:
233
+ - Renders as <br> and as a newline in plain text exports.
234
+ - Use when the user requests a line break without starting a new paragraph.
235
+ `.trim();
236
+
237
+ // src/contexts/v1/horizontalRule.ts
238
+ var horizontalRule = `
239
+ Node: horizontalRule
240
+ Attrs:
241
+ - HTML-only; no JSON attrs beyond optional styling via surrounding layout.
242
+
243
+ Content:
244
+ - No children; this is a self-contained separator.
245
+
246
+ Semantics:
247
+ - Renders as <hr>.
248
+ - Use to visually separate sections within a slide (for example, between rows of text).
249
+ `.trim();
250
+
251
+ // src/contexts/v1/image.ts
252
+ var image = `
253
+ Node: image
254
+ Attrs:
255
+ - src (required): string (URL to the image).
256
+ - alt (optional): string (accessibility text).
257
+ - title (optional): string (tooltip / caption).
258
+ - width, height (optional): numbers (px) used as hints for rendering.
259
+
260
+ Content:
261
+ - No children; this is an atomic inline or block-level image node depending on editor configuration.
262
+
263
+ Semantics:
264
+ - Renders as a simple <img>, unlike imageBlock which adds rich framing/caption UI.
265
+ - Prefer imageBlock for designed layouts; use image for simple inline images in paragraphs.
266
+ `.trim();
267
+
268
+ // src/contexts/v1/heading.ts
269
+ var heading = `
270
+ Node: heading
271
+ Attrs:
272
+ - level (required): 1 | 2 | 3 | 4 | 5 | 6.
273
+
274
+ Content:
275
+ - Inline content (text, marks, inline nodes).
276
+
277
+ Semantics:
278
+ - Renders as <h1>\u2026<h6> depending on level.
279
+ - Use level 1\u20132 for main slide titles, 3\u20134 for section headings, 5\u20136 for subtle labels.
280
+ - Do not invent other attrs; typography/styling should come from className on columns/slides.
281
+ `.trim();
282
+
283
+ // src/contexts/v1/paragraph.ts
284
+ var paragraph = `
285
+ Node: paragraph
286
+ Attrs:
287
+ - HTML-only; no structured JSON attrs beyond optional styling such as className.
288
+
289
+ Content:
290
+ - Inline content (text with marks, inline nodes such as image or hardBreak).
291
+
292
+ Semantics:
293
+ - Default text block inside columns and rows.
294
+ - Multiple paragraphs can be stacked within the same column to create vertical rhythm.
295
+ `.trim();
296
+
297
+ // src/contexts/v1/youtube.ts
298
+ var youtube = `
299
+ Node: youtube
300
+ Attrs:
301
+ - src (required): string (public YouTube URL).
302
+ - start (optional): number (start time in seconds).
303
+ - width (optional): number (frame width in px).
304
+ - height (optional): number (frame height in px).
305
+
306
+ Content:
307
+ - No children; this is an atomic embed node.
308
+
309
+ Semantics:
310
+ - Renders as an embedded YouTube iframe wrapped in a container <div>.
311
+ - Use for video embeds inside a column or row; keep other text in separate paragraphs/columns.
312
+ - Do not embed raw <iframe> HTML directly; always use the youtube node with attrs.
313
+ `.trim();
314
+
315
+ // src/examples/v1/index.ts
316
+ var v1_exports2 = {};
317
+ __export(v1_exports2, {
318
+ flyers: () => flyers,
319
+ slides: () => slides
320
+ });
321
+
322
+ // src/examples/v1/slides.ts
323
+ var slides = `
324
+ Examples: Slides (full-document output)
325
+
326
+ {
327
+ "type": "doc",
328
+ "content": [
329
+ {
330
+ "type": "slide",
331
+ "attrs": { "id": "intro", "size": "16x9" },
332
+ "content": [
333
+ {
334
+ "type": "row",
335
+ "attrs": { "layout": "1-1" },
336
+ "content": [
337
+ { "type": "column", "content": [
338
+ { "type": "heading", "attrs": { "level": 2 }, "content": [{ "type": "text", "text": "Welcome" }] }
339
+ ]},
340
+ { "type": "column", "content": [
341
+ { "type": "imageBlock", "attrs": { "src": "https://picsum.photos/seed/welcome/1200/800", "layout": "cover", "align": "center" } }
342
+ ]}
343
+ ]
344
+ }
345
+ ]
346
+ }
347
+ ]
348
+ }
349
+
350
+ /* more-slide-examples to be added here */
351
+ `.trim();
352
+
353
+ // src/examples/v1/flyers.ts
354
+ var flyers = `
355
+ Examples: Flyers (A4 slides; full-document output)
356
+
357
+ {
358
+ "type": "doc",
359
+ "content": [
360
+ {
361
+ "type": "slide",
362
+ "attrs": { "id": "a4-flyer", "size": "a4-portrait", "className": "bg-white text-slate-900" },
363
+ "content": [
364
+ {
365
+ "type": "row",
366
+ "attrs": { "layout": "1" },
367
+ "content": [
368
+ { "type": "column", "content": [
369
+ { "type": "heading", "attrs": { "level": 2 }, "content": [{ "type": "text", "text": "Event Title" }] },
370
+ { "type": "paragraph", "content": [{ "type": "text", "text": "Date \xB7 Location" }] },
371
+ { "type": "imageBlock", "attrs": { "src": "https://picsum.photos/seed/a4/1600/1000", "layout": "contain", "align": "center", "height": 320 } }
372
+ ]}
373
+ ]
374
+ }
375
+ ]
376
+ }
377
+ ]
378
+ }
379
+
380
+ /* more-flyer-examples to be added here */
381
+ `.trim();
382
+
383
+ // src/bundles/v1/index.ts
384
+ var v1_exports4 = {};
385
+ __export(v1_exports4, {
386
+ all: () => all,
387
+ allContexts: () => allContexts,
388
+ allSchemas: () => allSchemas,
389
+ imageEditing: () => imageEditing,
390
+ minimalCreate: () => minimalCreate
391
+ });
392
+
393
+ // src/bundles/v1/minimalCreate.ts
394
+ var minimalCreate = [core, fullDocument, slide, row, column, style].join("\n\n");
395
+
396
+ // src/bundles/v1/imageEditing.ts
397
+ var imageEditing = [core, fullDocument, imageBlock, editingRules].join("\n\n");
398
+
399
+ // src/bundles/v1/all.ts
400
+ var all = [
401
+ core,
402
+ fullDocument,
403
+ slide,
404
+ row,
405
+ column,
406
+ style,
407
+ sizing,
408
+ imageBlock,
409
+ blockquote,
410
+ bulletList,
411
+ heading,
412
+ paragraph,
413
+ image,
414
+ codeBlock,
415
+ hardBreak,
416
+ horizontalRule,
417
+ youtube,
418
+ editingRules
419
+ ].join("\n\n");
420
+
421
+ // src/schemas/v1/index.ts
422
+ var v1_exports3 = {};
423
+ __export(v1_exports3, {
424
+ blockquote: () => blockquote_schema_default,
425
+ bulletList: () => bulletList_schema_default,
426
+ codeBlock: () => codeBlock_schema_default,
427
+ column: () => column_schema_default,
428
+ hardBreak: () => hardBreak_schema_default,
429
+ heading: () => heading_schema_default,
430
+ horizontalRule: () => horizontalRule_schema_default,
431
+ image: () => image_schema_default,
432
+ imageBlock: () => imageBlock_schema_default,
433
+ paragraph: () => paragraph_schema_default,
434
+ row: () => row_schema_default,
435
+ slide: () => slide_schema_default,
436
+ youtube: () => youtube_schema_default
437
+ });
438
+
439
+ // src/schemas/v1/imageBlock.schema.json
440
+ var imageBlock_schema_default = {
441
+ $schema: "https://json-schema.org/draft/2020-12/schema",
442
+ title: "imageBlock",
443
+ type: "object",
444
+ properties: {
445
+ type: { const: "imageBlock" },
446
+ attrs: {
447
+ type: "object",
448
+ properties: {
449
+ src: { type: "string", minLength: 1 },
450
+ alt: { type: "string" },
451
+ caption: { type: "string" },
452
+ credit: { type: "string" },
453
+ layout: { enum: ["cover", "contain", "fill", "focus", "pattern", null] },
454
+ align: { enum: ["left", "center", "right", "stretch", null] },
455
+ width: { type: ["number", "string", "null"] },
456
+ height: { type: ["number", "string", "null"] },
457
+ fullBleed: { type: "boolean" },
458
+ assetId: { type: ["string", "null"] },
459
+ focalX: { type: ["number", "null"], minimum: 0, maximum: 100 },
460
+ focalY: { type: ["number", "null"], minimum: 0, maximum: 100 }
461
+ },
462
+ required: ["src"],
463
+ additionalProperties: false
464
+ }
465
+ },
466
+ required: ["type"],
467
+ additionalProperties: false
468
+ };
469
+
470
+ // src/schemas/v1/row.schema.json
471
+ var row_schema_default = {
472
+ $schema: "https://json-schema.org/draft/2020-12/schema",
473
+ title: "row",
474
+ type: "object",
475
+ properties: {
476
+ type: { const: "row" },
477
+ attrs: {
478
+ type: "object",
479
+ properties: {
480
+ layout: {
481
+ enum: ["", "1", "1-1", "2-1", "1-2", "1-1-1", "2-1-1", "1-2-1", "1-1-2", "1-1-1-1", null]
482
+ },
483
+ className: { type: ["string", "null"] }
484
+ },
485
+ additionalProperties: true
486
+ }
487
+ },
488
+ required: ["type"],
489
+ additionalProperties: false
490
+ };
491
+
492
+ // src/schemas/v1/column.schema.json
493
+ var column_schema_default = {
494
+ $schema: "https://json-schema.org/draft/2020-12/schema",
495
+ title: "column",
496
+ type: "object",
497
+ properties: {
498
+ type: { const: "column" },
499
+ attrs: {
500
+ type: "object",
501
+ properties: {
502
+ className: { type: ["string", "null"] },
503
+ contentMode: { enum: ["default", null] },
504
+ verticalAlign: { enum: ["top", "center", "bottom", null] },
505
+ horizontalAlign: { enum: ["left", "center", "right", "stretch", null] },
506
+ padding: { enum: ["none", null] }
507
+ },
508
+ additionalProperties: true
509
+ }
510
+ },
511
+ required: ["type"],
512
+ additionalProperties: false
513
+ };
514
+
515
+ // src/schemas/v1/slide.schema.json
516
+ var slide_schema_default = {
517
+ $schema: "https://json-schema.org/draft/2020-12/schema",
518
+ title: "slide",
519
+ type: "object",
520
+ properties: {
521
+ type: { const: "slide" },
522
+ attrs: {
523
+ type: "object",
524
+ properties: {
525
+ id: { type: ["string", "null"] },
526
+ className: { type: ["string", "null"] },
527
+ size: {
528
+ enum: [
529
+ "16x9",
530
+ "4x3",
531
+ "a4-portrait",
532
+ "a4-landscape",
533
+ "letter-portrait",
534
+ "letter-landscape",
535
+ "linkedin-banner",
536
+ null
537
+ ]
538
+ }
539
+ },
540
+ additionalProperties: true
541
+ }
542
+ },
543
+ required: ["type"],
544
+ additionalProperties: false
545
+ };
546
+
547
+ // src/schemas/v1/blockquote.schema.json
548
+ var blockquote_schema_default = {
549
+ $schema: "https://json-schema.org/draft/2020-12/schema",
550
+ title: "blockquote",
551
+ type: "object",
552
+ properties: {
553
+ type: { const: "blockquote" },
554
+ attrs: {
555
+ type: "object",
556
+ additionalProperties: true
557
+ }
558
+ },
559
+ required: ["type"],
560
+ additionalProperties: false
561
+ };
562
+
563
+ // src/schemas/v1/bulletList.schema.json
564
+ var bulletList_schema_default = {
565
+ $schema: "https://json-schema.org/draft/2020-12/schema",
566
+ title: "bulletList",
567
+ type: "object",
568
+ properties: {
569
+ type: { const: "bulletList" },
570
+ attrs: {
571
+ type: "object",
572
+ additionalProperties: true
573
+ }
574
+ },
575
+ required: ["type"],
576
+ additionalProperties: false
577
+ };
578
+
579
+ // src/schemas/v1/codeBlock.schema.json
580
+ var codeBlock_schema_default = {
581
+ $schema: "https://json-schema.org/draft/2020-12/schema",
582
+ title: "codeBlock",
583
+ type: "object",
584
+ properties: {
585
+ type: { const: "codeBlock" },
586
+ attrs: {
587
+ type: "object",
588
+ properties: {
589
+ language: { type: ["string", "null"] }
590
+ },
591
+ additionalProperties: true
592
+ }
593
+ },
594
+ required: ["type"],
595
+ additionalProperties: false
596
+ };
597
+
598
+ // src/schemas/v1/hardBreak.schema.json
599
+ var hardBreak_schema_default = {
600
+ $schema: "https://json-schema.org/draft/2020-12/schema",
601
+ title: "hardBreak",
602
+ type: "object",
603
+ properties: {
604
+ type: { const: "hardBreak" },
605
+ attrs: {
606
+ type: "object",
607
+ additionalProperties: true
608
+ }
609
+ },
610
+ required: ["type"],
611
+ additionalProperties: false
612
+ };
613
+
614
+ // src/schemas/v1/horizontalRule.schema.json
615
+ var horizontalRule_schema_default = {
616
+ $schema: "https://json-schema.org/draft/2020-12/schema",
617
+ title: "horizontalRule",
618
+ type: "object",
619
+ properties: {
620
+ type: { const: "horizontalRule" },
621
+ attrs: {
622
+ type: "object",
623
+ additionalProperties: true
624
+ }
625
+ },
626
+ required: ["type"],
627
+ additionalProperties: false
628
+ };
629
+
630
+ // src/schemas/v1/image.schema.json
631
+ var image_schema_default = {
632
+ $schema: "https://json-schema.org/draft/2020-12/schema",
633
+ title: "image",
634
+ type: "object",
635
+ properties: {
636
+ type: { const: "image" },
637
+ attrs: {
638
+ type: "object",
639
+ properties: {
640
+ src: { type: ["string", "null"] },
641
+ alt: { type: ["string", "null"] },
642
+ title: { type: ["string", "null"] },
643
+ width: { type: ["number", "null"] },
644
+ height: { type: ["number", "null"] }
645
+ },
646
+ additionalProperties: true
647
+ }
648
+ },
649
+ required: ["type"],
650
+ additionalProperties: false
651
+ };
652
+
653
+ // src/schemas/v1/heading.schema.json
654
+ var heading_schema_default = {
655
+ $schema: "https://json-schema.org/draft/2020-12/schema",
656
+ title: "heading",
657
+ type: "object",
658
+ properties: {
659
+ type: { const: "heading" },
660
+ attrs: {
661
+ type: "object",
662
+ properties: {
663
+ level: {
664
+ type: "integer",
665
+ minimum: 1,
666
+ maximum: 6
667
+ }
668
+ },
669
+ additionalProperties: true
670
+ }
671
+ },
672
+ required: ["type"],
673
+ additionalProperties: false
674
+ };
675
+
676
+ // src/schemas/v1/paragraph.schema.json
677
+ var paragraph_schema_default = {
678
+ $schema: "https://json-schema.org/draft/2020-12/schema",
679
+ title: "paragraph",
680
+ type: "object",
681
+ properties: {
682
+ type: { const: "paragraph" },
683
+ attrs: {
684
+ type: "object",
685
+ additionalProperties: true
686
+ }
687
+ },
688
+ required: ["type"],
689
+ additionalProperties: false
690
+ };
691
+
692
+ // src/schemas/v1/youtube.schema.json
693
+ var youtube_schema_default = {
694
+ $schema: "https://json-schema.org/draft/2020-12/schema",
695
+ title: "youtube",
696
+ type: "object",
697
+ properties: {
698
+ type: { const: "youtube" },
699
+ attrs: {
700
+ type: "object",
701
+ properties: {
702
+ src: { type: ["string", "null"] },
703
+ start: { type: "number" },
704
+ width: { type: "number" },
705
+ height: { type: "number" }
706
+ },
707
+ additionalProperties: true
708
+ }
709
+ },
710
+ required: ["type"],
711
+ additionalProperties: false
712
+ };
713
+
714
+ // src/bundles/v1/allSchemas.ts
715
+ var allSchemas = Object.entries(v1_exports3).map(
716
+ ([name, schema]) => `Schema "${name}":
717
+ ` + JSON.stringify(schema, null, 2)
718
+ ).join("\n\n");
719
+
720
+ // src/bundles/v1/allContexts.ts
721
+ var allContexts = [
722
+ core,
723
+ fullDocument,
724
+ slide,
725
+ row,
726
+ column,
727
+ style,
728
+ sizing,
729
+ imageBlock,
730
+ blockquote,
731
+ bulletList,
732
+ heading,
733
+ paragraph,
734
+ image,
735
+ codeBlock,
736
+ hardBreak,
737
+ horizontalRule,
738
+ youtube,
739
+ editingRules
740
+ ].join("\n\n");
741
+
742
+ // src/recipes/v1/index.ts
743
+ var v1_exports5 = {};
744
+ __export(v1_exports5, {
745
+ addTwoColumns: () => addTwoColumns,
746
+ createSlide: () => createSlide,
747
+ editImageToCover: () => editImageToCover
748
+ });
749
+
750
+ // src/recipes/v1/createSlide.ts
751
+ var createSlide = [
752
+ core,
753
+ fullDocument,
754
+ slide,
755
+ row,
756
+ column,
757
+ `
758
+ Return a single JSON document that creates one 16x9 slide with a 1-1 row:
759
+ {
760
+ "type": "doc",
761
+ "content": [
762
+ {
763
+ "type": "slide",
764
+ "attrs": { "size": "16x9" },
765
+ "content": [
766
+ { "type": "row", "attrs": { "layout": "1-1" }, "content": [
767
+ { "type": "column", "content": [{ "type": "paragraph", "content": [{ "type": "text", "text": "Left" }] }] },
768
+ { "type": "column", "content": [{ "type": "paragraph", "content": [{ "type": "text", "text": "Right" }] }] }
769
+ ] }
770
+ ]
771
+ }
772
+ ]
773
+ }
774
+ `.trim()
775
+ ].join("\n\n");
776
+
777
+ // src/recipes/v1/addTwoColumns.ts
778
+ var addTwoColumns = [
779
+ core,
780
+ fullDocument,
781
+ row,
782
+ column,
783
+ `
784
+ Return a full document where the first slide contains a row with layout "1-1" and two columns with simple text paragraphs.
785
+ `.trim()
786
+ ].join("\n\n");
787
+
788
+ // src/recipes/v1/editImageToCover.ts
789
+ var editImageToCover = [
790
+ core,
791
+ fullDocument,
792
+ imageBlock,
793
+ editingRules,
794
+ `
795
+ Update an existing imageBlock on the first slide so it uses layout "cover" and align "center". Preserve all other attributes.
796
+ `.trim()
797
+ ].join("\n\n");
798
+ // Annotate the CommonJS export names for ESM import in node:
799
+ 0 && (module.exports = {
800
+ bundlesV1,
801
+ contextsV1,
802
+ examplesV1,
803
+ recipesV1,
804
+ schemasV1
805
+ });
806
+ //# sourceMappingURL=index.cjs.map