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