@blockslides/ai-context 0.1.6 → 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.
- package/dist/index.cjs +1453 -287
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3522 -163
- package/dist/index.d.ts +3522 -163
- package/dist/index.js +1451 -284
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/bundles/v1/all.ts +0 -1
- package/src/bundles/v1/allContexts.ts +1 -1
- package/src/bundles/v1/minimalCreate.ts +2 -2
- package/src/contexts/v1/blockquote.ts +10 -5
- package/src/contexts/v1/bulletList.ts +10 -5
- package/src/contexts/v1/codeBlock.ts +11 -3
- package/src/contexts/v1/column.ts +34 -14
- package/src/contexts/v1/columnGroup.ts +44 -0
- package/src/contexts/v1/core.ts +24 -4
- package/src/contexts/v1/editingRules.ts +5 -5
- package/src/contexts/v1/heading.ts +11 -4
- package/src/contexts/v1/horizontalRule.ts +9 -4
- package/src/contexts/v1/imageBlock.ts +31 -22
- package/src/contexts/v1/index.ts +1 -1
- package/src/contexts/v1/paragraph.ts +11 -5
- package/src/contexts/v1/slide.ts +5 -1
- package/src/contexts/v1/youtube.ts +14 -7
- package/src/index.ts +1 -3
- package/src/schemas/v1/blockquote.schema.json +13 -2
- package/src/schemas/v1/bulletList.schema.json +13 -2
- package/src/schemas/v1/codeBlock.schema.json +12 -3
- package/src/schemas/v1/column.schema.json +18 -14
- package/src/schemas/v1/columnGroup.schema.json +45 -0
- package/src/schemas/v1/heading.schema.json +12 -7
- package/src/schemas/v1/horizontalRule.schema.json +7 -2
- package/src/schemas/v1/imageBlock.schema.json +25 -15
- package/src/schemas/v1/index.ts +1 -1
- package/src/schemas/v1/paragraph.schema.json +13 -2
- package/src/schemas/v1/slide.schema.json +6 -0
- package/src/schemas/v1/youtube.schema.json +9 -6
- package/src/templates/v1/index.ts +2 -0
- package/src/templates/v1/presetTemplateBuilder.ts +697 -0
- package/src/templates/v1/schemaBuilder.ts +604 -0
- package/src/types/v1.ts +40 -25
- package/src/contexts/v1/row.ts +0 -25
- package/src/examples/v1/flyers.ts +0 -30
- package/src/examples/v1/index.ts +0 -4
- package/src/examples/v1/slides.ts +0 -31
- package/src/recipes/v1/addTwoColumns.ts +0 -13
- package/src/recipes/v1/createSlide.ts +0 -29
- package/src/recipes/v1/editImageToCover.ts +0 -13
- package/src/recipes/v1/index.ts +0 -5
- package/src/schemas/v1/row.schema.json +0 -29
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
export const codeBlock = `
|
|
2
2
|
<codeBlock>
|
|
3
|
-
Node: codeBlock
|
|
4
|
-
Attrs:
|
|
5
|
-
- language (optional): string | null (e.g., "js", "ts", "python")
|
|
3
|
+
Node: codeBlock (block group)
|
|
4
|
+
Attrs (codeBlock-specific):
|
|
5
|
+
- language (optional): string | null (e.g., "js", "ts", "python")
|
|
6
|
+
|
|
7
|
+
Attrs (inherited from BaseBlockAttributes):
|
|
8
|
+
- align: "left" | "center" | "right"
|
|
9
|
+
- padding: "none" | "sm" | "md" | "lg"
|
|
10
|
+
- margin: "none" | "sm" | "md" | "lg"
|
|
11
|
+
- backgroundColor: string (CSS color)
|
|
12
|
+
- borderRadius: "none" | "sm" | "md" | "lg"
|
|
13
|
+
- (and other base attributes)
|
|
6
14
|
|
|
7
15
|
Content:
|
|
8
16
|
- Plain text only (no child nodes); used for preformatted code samples.
|
|
@@ -1,21 +1,41 @@
|
|
|
1
1
|
export const column = `
|
|
2
2
|
<column>
|
|
3
|
-
Node: column
|
|
4
|
-
Attrs:
|
|
5
|
-
-
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
3
|
+
Node: column (block group)
|
|
4
|
+
Attrs (inherits from BaseBlockAttributes):
|
|
5
|
+
- align (optional): "left" | "center" | "right" | "stretch" - horizontal alignment
|
|
6
|
+
- justify (optional): "start" | "center" | "end" | "space-between" - vertical distribution of children
|
|
7
|
+
- padding (optional): "none" | "sm" | "md" | "lg" - internal spacing (semantic tokens)
|
|
8
|
+
- margin (optional): "none" | "sm" | "md" | "lg" - external spacing
|
|
9
|
+
- gap (optional): "none" | "sm" | "md" | "lg" - space between child blocks
|
|
10
|
+
- backgroundColor (optional): string - CSS color
|
|
11
|
+
- backgroundImage (optional): string - background image URL
|
|
12
|
+
- borderRadius (optional): "none" | "sm" | "md" | "lg" - corner rounding
|
|
13
|
+
- border (optional): string - CSS border value
|
|
14
|
+
- fill (optional): boolean - whether to fill available space
|
|
15
|
+
- width (optional): string - explicit width (CSS value)
|
|
16
|
+
- height (optional): string - explicit height (CSS value)
|
|
17
|
+
|
|
18
|
+
Content:
|
|
19
|
+
- Contains one or more blocks (heading, paragraph, imageBlock, bulletList, etc.)
|
|
20
|
+
- Columns cannot nest other columns
|
|
21
|
+
|
|
22
|
+
Spacing tokens:
|
|
23
|
+
- none: 0
|
|
24
|
+
- sm: 8px
|
|
25
|
+
- md: 16px
|
|
26
|
+
- lg: 32px
|
|
27
|
+
|
|
28
|
+
Border radius tokens:
|
|
29
|
+
- none: 0
|
|
30
|
+
- sm: 4px
|
|
31
|
+
- md: 8px
|
|
32
|
+
- lg: 16px
|
|
15
33
|
|
|
16
34
|
Notes:
|
|
17
|
-
- Use
|
|
18
|
-
-
|
|
35
|
+
- Use column directly in slide for full-width content
|
|
36
|
+
- Wrap columns in columnGroup to place them side-by-side
|
|
37
|
+
- Use justify to control vertical distribution of child blocks
|
|
38
|
+
- Use gap for spacing between children instead of margins
|
|
19
39
|
</column>
|
|
20
40
|
`.trim();
|
|
21
41
|
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export const columnGroup = `
|
|
2
|
+
<columnGroup>
|
|
3
|
+
Node: columnGroup (horizontal container)
|
|
4
|
+
Purpose: Groups multiple columns side-by-side horizontally
|
|
5
|
+
|
|
6
|
+
Attrs:
|
|
7
|
+
- layout (optional): string - Layout ratio for columns (e.g., "1-1" for equal width, "2-1" for 2:1 ratio, "1-2-1" for three columns)
|
|
8
|
+
- fill (optional): boolean - Whether the columnGroup fills available vertical space
|
|
9
|
+
- className (optional): string - CSS classes
|
|
10
|
+
- backgroundMode (optional): "none" | "color" | "image" | "imageOverlay"
|
|
11
|
+
- backgroundColor (optional): string - CSS color for background
|
|
12
|
+
- backgroundImage (optional): string - URL for background image
|
|
13
|
+
- backgroundOverlayColor (optional): string - Color for overlay when using imageOverlay
|
|
14
|
+
- backgroundOverlayOpacity (optional): number (0-1) - Opacity for overlay
|
|
15
|
+
|
|
16
|
+
Content:
|
|
17
|
+
- Contains one or more column nodes
|
|
18
|
+
- Columns within a columnGroup are displayed side-by-side horizontally
|
|
19
|
+
- Each column shares the horizontal space (equal width by default, or based on layout attribute)
|
|
20
|
+
|
|
21
|
+
Usage:
|
|
22
|
+
- Use columnGroup when you want columns to appear next to each other horizontally
|
|
23
|
+
- For full-width content, use column directly in the slide (without columnGroup)
|
|
24
|
+
- You can have multiple columnGroups in a slide to create different rows of columns
|
|
25
|
+
|
|
26
|
+
Examples:
|
|
27
|
+
1. Two equal columns side-by-side:
|
|
28
|
+
columnGroup { content: [column, column] }
|
|
29
|
+
|
|
30
|
+
2. Three columns with 2:1:1 ratio:
|
|
31
|
+
columnGroup { attrs: { layout: "2-1-1" }, content: [column, column, column] }
|
|
32
|
+
|
|
33
|
+
3. Full-width content above and below a two-column section:
|
|
34
|
+
slide {
|
|
35
|
+
content: [
|
|
36
|
+
column { ... }, // full-width
|
|
37
|
+
columnGroup { // side-by-side
|
|
38
|
+
content: [column, column]
|
|
39
|
+
},
|
|
40
|
+
column { ... } // full-width
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
</columnGroup>
|
|
44
|
+
`.trim();
|
package/src/contexts/v1/core.ts
CHANGED
|
@@ -4,15 +4,35 @@ You are given a BlockSlides document to CREATE or EDIT.
|
|
|
4
4
|
|
|
5
5
|
Document shape:
|
|
6
6
|
- doc: { type: "doc", content: slide[] }
|
|
7
|
-
- slide: { type: "slide", attrs?, content:
|
|
8
|
-
-
|
|
9
|
-
- column: { type: "column", attrs?, content:
|
|
10
|
-
|
|
7
|
+
- slide: { type: "slide", attrs?, content: block[] }
|
|
8
|
+
- block: includes heading, paragraph, column, imageBlock, bulletList, codeBlock, blockquote, horizontalRule, youtube, etc.
|
|
9
|
+
- column: { type: "column", attrs?, content: block[] }
|
|
10
|
+
|
|
11
|
+
Key changes:
|
|
12
|
+
- Slides can contain columns, columnGroups, or any block-level content
|
|
13
|
+
- Use column directly in slide for full-width blocks
|
|
14
|
+
- Use columnGroup to place multiple columns side-by-side
|
|
15
|
+
- All block types inherit common attributes from BaseBlockAttributes
|
|
16
|
+
|
|
17
|
+
BaseBlockAttributes (available on all blocks):
|
|
18
|
+
- align: "left" | "center" | "right" | "stretch"
|
|
19
|
+
- justify: "start" | "center" | "end" | "space-between" (for containers)
|
|
20
|
+
- padding: "none" | "sm" | "md" | "lg"
|
|
21
|
+
- margin: "none" | "sm" | "md" | "lg"
|
|
22
|
+
- gap: "none" | "sm" | "md" | "lg"
|
|
23
|
+
- backgroundColor: string (CSS color)
|
|
24
|
+
- backgroundImage: string (URL)
|
|
25
|
+
- borderRadius: "none" | "sm" | "md" | "lg"
|
|
26
|
+
- border: string (CSS border)
|
|
27
|
+
- fill: boolean (fill available space)
|
|
28
|
+
- width: string (CSS width)
|
|
29
|
+
- height: string (CSS height)
|
|
11
30
|
|
|
12
31
|
Rules:
|
|
13
32
|
- Use only known node types and valid attrs. Do not invent attributes.
|
|
14
33
|
- Prefer stable references: preserve slide.attrs.id if present.
|
|
15
34
|
- Slides and flyers share the same JSON; flyers are slides sized via attrs and theme.
|
|
35
|
+
- Use semantic spacing tokens (sm/md/lg) instead of raw pixel values
|
|
16
36
|
</core>
|
|
17
37
|
`.trim();
|
|
18
38
|
|
|
@@ -3,7 +3,7 @@ export const editingRules = `
|
|
|
3
3
|
- Preserve existing ids and valid attributes. Do not remove or rename known attrs.
|
|
4
4
|
- Use only allowed enum values. Do not invent new enum values.
|
|
5
5
|
- Avoid introducing new attributes that are not documented. If styling is needed, prefer className.
|
|
6
|
-
- Keep the document valid: slide >
|
|
6
|
+
- Keep the document valid: slide > (column | columnGroup > column) > blocks.
|
|
7
7
|
</General editing rules>
|
|
8
8
|
|
|
9
9
|
<Centering content in a column>
|
|
@@ -17,17 +17,17 @@ export const editingRules = `
|
|
|
17
17
|
- After: column.attrs = { verticalAlign: "center", horizontalAlign: "center", padding: "none" }
|
|
18
18
|
</Centering content in a column>
|
|
19
19
|
|
|
20
|
-
<Backgrounds (slides,
|
|
20
|
+
<Backgrounds (slides, columnGroups, columns)>
|
|
21
21
|
- Use structured background attrs instead of raw Tailwind bg-[url(...)] when setting background images.
|
|
22
22
|
- If you use bg-[...], the image will not work because the tailwind classes we need have been tree shaken off - instead use the attributes.
|
|
23
23
|
- For slide-level backgrounds (hero/flyer):
|
|
24
24
|
- Use slide.attrs.backgroundMode = "color" | "image" | "imageOverlay".
|
|
25
25
|
- For images, set slide.attrs.backgroundImage to the image URL.
|
|
26
26
|
- For overlays, set slide.attrs.backgroundOverlayColor (e.g., "rgba(0,0,0,0.8)") and slide.attrs.backgroundOverlayOpacity (0–1).
|
|
27
|
-
- For horizontal bands, use
|
|
27
|
+
- For horizontal bands, use columnGroup-level backgrounds (columnGroup.attrs.background*).
|
|
28
28
|
- For panel-style sections, use column-level backgrounds (column.attrs.background*).
|
|
29
|
-
- Do not mix multiple background images on the same node; prefer one backgroundMode per slide/
|
|
30
|
-
</Backgrounds (slides,
|
|
29
|
+
- Do not mix multiple background images on the same node; prefer one backgroundMode per slide/columnGroup/column and layer additional visuals as imageBlock nodes.
|
|
30
|
+
</Backgrounds (slides, columnGroups, columns)>
|
|
31
31
|
|
|
32
32
|
<Text editing (headings and paragraphs)>
|
|
33
33
|
- Preserve semantic types: do not turn headings into paragraphs or vice versa unless explicitly asked.
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
export const heading = `
|
|
2
2
|
<heading>
|
|
3
|
-
Node: heading
|
|
4
|
-
Attrs:
|
|
5
|
-
- level (required): 1 | 2 | 3 | 4 | 5 | 6
|
|
3
|
+
Node: heading (block group)
|
|
4
|
+
Attrs (heading-specific):
|
|
5
|
+
- level (required): 1 | 2 | 3 | 4 | 5 | 6
|
|
6
|
+
|
|
7
|
+
Attrs (inherited from BaseBlockAttributes):
|
|
8
|
+
- align: "left" | "center" | "right"
|
|
9
|
+
- padding: "none" | "sm" | "md" | "lg"
|
|
10
|
+
- margin: "none" | "sm" | "md" | "lg"
|
|
11
|
+
- backgroundColor: string (CSS color)
|
|
12
|
+
- borderRadius: "none" | "sm" | "md" | "lg"
|
|
13
|
+
- (and other base attributes)
|
|
6
14
|
|
|
7
15
|
Content:
|
|
8
16
|
- Inline content (text, marks, inline nodes).
|
|
@@ -10,7 +18,6 @@ Content:
|
|
|
10
18
|
Semantics:
|
|
11
19
|
- Renders as <h1>…<h6> depending on level.
|
|
12
20
|
- Use level 1–2 for main slide titles, 3–4 for section headings, 5–6 for subtle labels.
|
|
13
|
-
- Do not invent other attrs; typography/styling should come from className on columns/slides.
|
|
14
21
|
</heading>
|
|
15
22
|
`.trim();
|
|
16
23
|
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
export const horizontalRule = `
|
|
2
2
|
<horizontalRule>
|
|
3
|
-
Node: horizontalRule
|
|
4
|
-
Attrs:
|
|
5
|
-
-
|
|
3
|
+
Node: horizontalRule (block group)
|
|
4
|
+
Attrs (inherited from BaseBlockAttributes):
|
|
5
|
+
- align: "left" | "center" | "right" | "stretch"
|
|
6
|
+
- padding: "none" | "sm" | "md" | "lg"
|
|
7
|
+
- margin: "none" | "sm" | "md" | "lg"
|
|
8
|
+
- backgroundColor: string (CSS color)
|
|
9
|
+
- (and other base attributes)
|
|
6
10
|
|
|
7
11
|
Content:
|
|
8
12
|
- No children; this is a self-contained separator.
|
|
9
13
|
|
|
10
14
|
Semantics:
|
|
11
15
|
- Renders as <hr>.
|
|
12
|
-
- Use to visually separate sections within a slide
|
|
16
|
+
- Use to visually separate sections within a slide.
|
|
17
|
+
- Can control spacing around the rule with padding/margin.
|
|
13
18
|
</horizontalRule>
|
|
14
19
|
`.trim();
|
|
15
20
|
|
|
@@ -1,28 +1,37 @@
|
|
|
1
1
|
export const imageBlock = `
|
|
2
2
|
<imageBlock>
|
|
3
|
-
Node: imageBlock
|
|
4
|
-
Attrs:
|
|
5
|
-
- src (required): string (URL)
|
|
6
|
-
- alt (optional): string
|
|
7
|
-
- caption (optional): string
|
|
8
|
-
- credit (optional): string
|
|
9
|
-
- layout (optional): "cover" | "contain" | "fill" | "focus" | "pattern"
|
|
10
|
-
- align (optional): "left" | "center" | "right" | "stretch" (default "center")
|
|
11
|
-
- width (optional): number (px) or string ("%"/"px")
|
|
12
|
-
- height (optional): number (px) or string ("%"/"px")
|
|
13
|
-
- fullBleed (optional): boolean (removes radius; stretches width)
|
|
14
|
-
- assetId (optional): string
|
|
15
|
-
- focalX, focalY (optional): 0–100; spotlight position (when relevant)
|
|
3
|
+
Node: imageBlock (block group)
|
|
4
|
+
Attrs (required):
|
|
5
|
+
- src (required): string (image URL)
|
|
16
6
|
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
7
|
+
Attrs (optional - image-specific):
|
|
8
|
+
- alt (optional): string - alt text for accessibility
|
|
9
|
+
- caption (optional): string - image caption
|
|
10
|
+
- credit (optional): string - image credit/attribution
|
|
11
|
+
- assetId (optional): string - asset reference
|
|
12
|
+
- size (optional): "fill" | "fit" | "natural" - how image fills container
|
|
13
|
+
- fill: Cover entire container (width:100%, height:100%, object-fit:cover)
|
|
14
|
+
- fit: Fit inside container with letterboxing (object-fit:contain)
|
|
15
|
+
- natural: Use image's natural dimensions
|
|
16
|
+
- crop (optional): "center" | "top" | "bottom" | "left" | "right" | "top-left" | "top-right" | "bottom-left" | "bottom-right"
|
|
17
|
+
- Focal point for fill/fit modes (default: "center")
|
|
18
|
+
|
|
19
|
+
Attrs (inherited from BaseBlockAttributes):
|
|
20
|
+
- align (optional): "left" | "center" | "right" | "stretch" - block alignment
|
|
21
|
+
- padding (optional): "none" | "sm" | "md" | "lg" - internal padding
|
|
22
|
+
- margin (optional): "none" | "sm" | "md" | "lg" - external margin
|
|
23
|
+
- backgroundColor (optional): string - background color
|
|
24
|
+
- borderRadius (optional): "none" | "sm" | "md" | "lg" - corner rounding
|
|
25
|
+
- width (optional): string - explicit width override (CSS value)
|
|
26
|
+
- height (optional): string - explicit height override (CSS value)
|
|
27
|
+
|
|
28
|
+
Deprecated attributes (kept for backwards compatibility, do not use):
|
|
29
|
+
- layout, fullBleed, focalX, focalY
|
|
30
|
+
|
|
31
|
+
Notes:
|
|
32
|
+
- Default size is "fill" if not specified
|
|
33
|
+
- Use crop to control which part of the image is visible when cropped
|
|
34
|
+
- width/height overrides apply on top of size mode
|
|
26
35
|
</imageBlock>
|
|
27
36
|
`.trim();
|
|
28
37
|
|
package/src/contexts/v1/index.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { core } from "./core";
|
|
2
2
|
export { fullDocument } from "./output.fullDocument";
|
|
3
3
|
export { imageBlock } from "./imageBlock";
|
|
4
|
-
export { row } from "./row";
|
|
5
4
|
export { column } from "./column";
|
|
5
|
+
export { columnGroup } from "./columnGroup";
|
|
6
6
|
export { slide } from "./slide";
|
|
7
7
|
export { style } from "./style";
|
|
8
8
|
export { editingRules } from "./editingRules";
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
export const paragraph = `
|
|
2
2
|
<paragraph>
|
|
3
|
-
Node: paragraph
|
|
4
|
-
Attrs:
|
|
5
|
-
-
|
|
3
|
+
Node: paragraph (block group)
|
|
4
|
+
Attrs (inherited from BaseBlockAttributes):
|
|
5
|
+
- align: "left" | "center" | "right"
|
|
6
|
+
- padding: "none" | "sm" | "md" | "lg"
|
|
7
|
+
- margin: "none" | "sm" | "md" | "lg"
|
|
8
|
+
- backgroundColor: string (CSS color)
|
|
9
|
+
- borderRadius: "none" | "sm" | "md" | "lg"
|
|
10
|
+
- (and other base attributes)
|
|
6
11
|
|
|
7
12
|
Content:
|
|
8
13
|
- Inline content (text with marks, inline nodes such as image or hardBreak).
|
|
9
14
|
|
|
10
15
|
Semantics:
|
|
11
|
-
- Default text block inside columns and
|
|
12
|
-
- Multiple paragraphs can be stacked
|
|
16
|
+
- Default text block inside columns and slides.
|
|
17
|
+
- Multiple paragraphs can be stacked to create vertical rhythm.
|
|
18
|
+
- Use gap on parent column instead of margin on individual paragraphs for consistent spacing.
|
|
13
19
|
</paragraph>
|
|
14
20
|
`.trim();
|
|
15
21
|
|
package/src/contexts/v1/slide.ts
CHANGED
|
@@ -12,12 +12,16 @@ Attrs:
|
|
|
12
12
|
- backgroundOverlayOpacity (optional): number (0–1, opacity for the overlay)
|
|
13
13
|
|
|
14
14
|
Content:
|
|
15
|
-
- slide
|
|
15
|
+
- slide can contain columns, columnGroups, or any block-level content (heading, paragraph, imageBlock, bulletList, codeBlock, etc.)
|
|
16
|
+
- Use column directly for full-width content
|
|
17
|
+
- Use columnGroup to place multiple columns side-by-side
|
|
18
|
+
- You can mix columns, columnGroups, and other blocks in any order
|
|
16
19
|
|
|
17
20
|
Notes:
|
|
18
21
|
- Flyers are slides sized for paper (e.g., size: "a4-portrait").
|
|
19
22
|
- Set size to control canvas dimensions; theme applies the exact width/height.
|
|
20
23
|
- For background images, prefer backgroundMode/backgroundImage over Tailwind bg-[url(...)]; the extension will inject the correct CSS.
|
|
24
|
+
- To create multi-column layouts, wrap columns in a columnGroup
|
|
21
25
|
</slide>
|
|
22
26
|
`.trim();
|
|
23
27
|
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
export const youtube = `
|
|
2
2
|
<youtube>
|
|
3
|
-
Node: youtube
|
|
4
|
-
Attrs:
|
|
5
|
-
- src (required): string (public YouTube URL)
|
|
6
|
-
- start (optional): number (start time in seconds)
|
|
7
|
-
- width (optional): number (frame width in px)
|
|
8
|
-
- height (optional): number (frame height in px)
|
|
3
|
+
Node: youtube (block group)
|
|
4
|
+
Attrs (youtube-specific):
|
|
5
|
+
- src (required): string (public YouTube URL)
|
|
6
|
+
- start (optional): number (start time in seconds)
|
|
7
|
+
- width (optional): number (frame width in px)
|
|
8
|
+
- height (optional): number (frame height in px)
|
|
9
|
+
|
|
10
|
+
Attrs (inherited from BaseBlockAttributes):
|
|
11
|
+
- align: "left" | "center" | "right" | "stretch"
|
|
12
|
+
- padding: "none" | "sm" | "md" | "lg"
|
|
13
|
+
- margin: "none" | "sm" | "md" | "lg"
|
|
14
|
+
- borderRadius: "none" | "sm" | "md" | "lg"
|
|
15
|
+
- (and other base attributes)
|
|
9
16
|
|
|
10
17
|
Content:
|
|
11
18
|
- No children; this is an atomic embed node.
|
|
12
19
|
|
|
13
20
|
Semantics:
|
|
14
21
|
- Renders as an embedded YouTube iframe wrapped in a container <div>.
|
|
15
|
-
- Use for video embeds inside a column or
|
|
22
|
+
- Use for video embeds inside a column or slide.
|
|
16
23
|
- Do not embed raw <iframe> HTML directly; always use the youtube node with attrs.
|
|
17
24
|
</youtube>
|
|
18
25
|
`.trim();
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export * as contextsV1 from "./contexts/v1";
|
|
2
|
-
export * as examplesV1 from "./examples/v1";
|
|
3
2
|
export * as bundlesV1 from "./bundles/v1";
|
|
4
|
-
export * as recipesV1 from "./recipes/v1";
|
|
5
3
|
export * as schemasV1 from "./schemas/v1";
|
|
4
|
+
export * as templatesV1 from "./templates/v1";
|
|
6
5
|
export * from "./types/v1";
|
|
7
|
-
|
|
@@ -1,16 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"title": "blockquote",
|
|
4
|
+
"description": "A blockquote. Inherits common block attributes.",
|
|
4
5
|
"type": "object",
|
|
5
6
|
"properties": {
|
|
6
7
|
"type": { "const": "blockquote" },
|
|
7
8
|
"attrs": {
|
|
8
9
|
"type": "object",
|
|
10
|
+
"properties": {
|
|
11
|
+
"align": { "enum": ["left", "center", "right", null], "description": "Text alignment" },
|
|
12
|
+
"padding": { "enum": ["none", "sm", "md", "lg", null], "description": "Internal padding" },
|
|
13
|
+
"margin": { "enum": ["none", "sm", "md", "lg", null], "description": "External margin" },
|
|
14
|
+
"backgroundColor": { "type": ["string", "null"], "description": "Background color" },
|
|
15
|
+
"borderRadius": { "enum": ["none", "sm", "md", "lg", null], "description": "Corner rounding" }
|
|
16
|
+
},
|
|
9
17
|
"additionalProperties": true
|
|
18
|
+
},
|
|
19
|
+
"content": {
|
|
20
|
+
"type": "array",
|
|
21
|
+
"items": { "type": "object" },
|
|
22
|
+
"description": "Block content"
|
|
10
23
|
}
|
|
11
24
|
},
|
|
12
25
|
"required": ["type"],
|
|
13
26
|
"additionalProperties": false
|
|
14
27
|
}
|
|
15
|
-
|
|
16
|
-
|
|
@@ -1,16 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"title": "bulletList",
|
|
4
|
+
"description": "A bullet list block. Inherits common block attributes.",
|
|
4
5
|
"type": "object",
|
|
5
6
|
"properties": {
|
|
6
7
|
"type": { "const": "bulletList" },
|
|
7
8
|
"attrs": {
|
|
8
9
|
"type": "object",
|
|
10
|
+
"properties": {
|
|
11
|
+
"align": { "enum": ["left", "center", "right", null], "description": "Text alignment" },
|
|
12
|
+
"padding": { "enum": ["none", "sm", "md", "lg", null], "description": "Internal padding" },
|
|
13
|
+
"margin": { "enum": ["none", "sm", "md", "lg", null], "description": "External margin" },
|
|
14
|
+
"backgroundColor": { "type": ["string", "null"], "description": "Background color" },
|
|
15
|
+
"borderRadius": { "enum": ["none", "sm", "md", "lg", null], "description": "Corner rounding" }
|
|
16
|
+
},
|
|
9
17
|
"additionalProperties": true
|
|
18
|
+
},
|
|
19
|
+
"content": {
|
|
20
|
+
"type": "array",
|
|
21
|
+
"items": { "type": "object" },
|
|
22
|
+
"description": "List items"
|
|
10
23
|
}
|
|
11
24
|
},
|
|
12
25
|
"required": ["type"],
|
|
13
26
|
"additionalProperties": false
|
|
14
27
|
}
|
|
15
|
-
|
|
16
|
-
|
|
@@ -1,19 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"title": "codeBlock",
|
|
4
|
+
"description": "A code block. Inherits common block attributes.",
|
|
4
5
|
"type": "object",
|
|
5
6
|
"properties": {
|
|
6
7
|
"type": { "const": "codeBlock" },
|
|
7
8
|
"attrs": {
|
|
8
9
|
"type": "object",
|
|
9
10
|
"properties": {
|
|
10
|
-
"language": { "type": ["string", "null"] }
|
|
11
|
+
"language": { "type": ["string", "null"], "description": "Programming language for syntax highlighting" },
|
|
12
|
+
"align": { "enum": ["left", "center", "right", null], "description": "Block alignment" },
|
|
13
|
+
"padding": { "enum": ["none", "sm", "md", "lg", null], "description": "Internal padding" },
|
|
14
|
+
"margin": { "enum": ["none", "sm", "md", "lg", null], "description": "External margin" },
|
|
15
|
+
"backgroundColor": { "type": ["string", "null"], "description": "Background color" },
|
|
16
|
+
"borderRadius": { "enum": ["none", "sm", "md", "lg", null], "description": "Corner rounding" }
|
|
11
17
|
},
|
|
12
18
|
"additionalProperties": true
|
|
19
|
+
},
|
|
20
|
+
"content": {
|
|
21
|
+
"type": "array",
|
|
22
|
+
"items": { "type": "object" },
|
|
23
|
+
"description": "Code text content"
|
|
13
24
|
}
|
|
14
25
|
},
|
|
15
26
|
"required": ["type"],
|
|
16
27
|
"additionalProperties": false
|
|
17
28
|
}
|
|
18
|
-
|
|
19
|
-
|
|
@@ -1,30 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"title": "column",
|
|
4
|
+
"description": "A container block that holds other blocks. Common attributes (align, padding, gap, backgroundColor, etc.) are shared with all block types.",
|
|
4
5
|
"type": "object",
|
|
5
6
|
"properties": {
|
|
6
7
|
"type": { "const": "column" },
|
|
7
8
|
"attrs": {
|
|
8
9
|
"type": "object",
|
|
9
10
|
"properties": {
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
11
|
+
"align": { "enum": ["left", "center", "right", "stretch", null], "description": "Horizontal alignment of content" },
|
|
12
|
+
"justify": { "enum": ["start", "center", "end", "space-between", null], "description": "Vertical distribution of children" },
|
|
13
|
+
"padding": { "enum": ["none", "sm", "md", "lg", null], "description": "Internal padding" },
|
|
14
|
+
"margin": { "enum": ["none", "sm", "md", "lg", null], "description": "External margin" },
|
|
15
|
+
"gap": { "enum": ["none", "sm", "md", "lg", null], "description": "Gap between child blocks" },
|
|
16
|
+
"backgroundColor": { "type": ["string", "null"], "description": "Background color" },
|
|
17
|
+
"backgroundImage": { "type": ["string", "null"], "description": "Background image URL" },
|
|
18
|
+
"borderRadius": { "enum": ["none", "sm", "md", "lg", null], "description": "Corner rounding" },
|
|
19
|
+
"border": { "type": ["string", "null"], "description": "CSS border value" },
|
|
20
|
+
"fill": { "type": ["boolean", "null"], "description": "Whether to fill available space" },
|
|
21
|
+
"width": { "type": ["string", "null"], "description": "Explicit width" },
|
|
22
|
+
"height": { "type": ["string", "null"], "description": "Explicit height" }
|
|
22
23
|
},
|
|
23
24
|
"additionalProperties": true
|
|
25
|
+
},
|
|
26
|
+
"content": {
|
|
27
|
+
"type": "array",
|
|
28
|
+
"items": { "type": "object" },
|
|
29
|
+
"description": "Child blocks"
|
|
24
30
|
}
|
|
25
31
|
},
|
|
26
32
|
"required": ["type"],
|
|
27
33
|
"additionalProperties": false
|
|
28
34
|
}
|
|
29
|
-
|
|
30
|
-
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "columnGroup",
|
|
4
|
+
"description": "A horizontal container that groups multiple columns side-by-side. Use columnGroup when you want columns to be placed next to each other horizontally. For full-width content, use column directly in the slide.",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"type": { "const": "columnGroup" },
|
|
8
|
+
"attrs": {
|
|
9
|
+
"type": "object",
|
|
10
|
+
"properties": {
|
|
11
|
+
"layout": {
|
|
12
|
+
"type": ["string", "null"],
|
|
13
|
+
"description": "Layout ratio for columns (e.g., '1-1' for equal, '2-1' for 2:1 ratio)"
|
|
14
|
+
},
|
|
15
|
+
"fill": {
|
|
16
|
+
"type": ["boolean", "null"],
|
|
17
|
+
"description": "Whether the columnGroup should fill available vertical space"
|
|
18
|
+
},
|
|
19
|
+
"className": { "type": ["string", "null"] },
|
|
20
|
+
"backgroundMode": {
|
|
21
|
+
"enum": ["none", "color", "image", "imageOverlay", null]
|
|
22
|
+
},
|
|
23
|
+
"backgroundColor": { "type": ["string", "null"] },
|
|
24
|
+
"backgroundImage": { "type": ["string", "null"] },
|
|
25
|
+
"backgroundOverlayColor": { "type": ["string", "null"] },
|
|
26
|
+
"backgroundOverlayOpacity": { "type": ["number", "null"] }
|
|
27
|
+
},
|
|
28
|
+
"additionalProperties": true
|
|
29
|
+
},
|
|
30
|
+
"content": {
|
|
31
|
+
"type": "array",
|
|
32
|
+
"items": {
|
|
33
|
+
"type": "object",
|
|
34
|
+
"properties": {
|
|
35
|
+
"type": { "const": "column" }
|
|
36
|
+
},
|
|
37
|
+
"required": ["type"]
|
|
38
|
+
},
|
|
39
|
+
"minItems": 1,
|
|
40
|
+
"description": "Array of column nodes"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"required": ["type", "content"],
|
|
44
|
+
"additionalProperties": false
|
|
45
|
+
}
|
|
@@ -1,23 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"title": "heading",
|
|
4
|
+
"description": "A heading block (h1-h6). Inherits common block attributes.",
|
|
4
5
|
"type": "object",
|
|
5
6
|
"properties": {
|
|
6
7
|
"type": { "const": "heading" },
|
|
7
8
|
"attrs": {
|
|
8
9
|
"type": "object",
|
|
9
10
|
"properties": {
|
|
10
|
-
"level": {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
11
|
+
"level": { "type": "integer", "minimum": 1, "maximum": 6, "description": "Heading level (1-6)" },
|
|
12
|
+
"align": { "enum": ["left", "center", "right", null], "description": "Text alignment" },
|
|
13
|
+
"padding": { "enum": ["none", "sm", "md", "lg", null], "description": "Internal padding" },
|
|
14
|
+
"margin": { "enum": ["none", "sm", "md", "lg", null], "description": "External margin" },
|
|
15
|
+
"backgroundColor": { "type": ["string", "null"], "description": "Background color" },
|
|
16
|
+
"borderRadius": { "enum": ["none", "sm", "md", "lg", null], "description": "Corner rounding" }
|
|
15
17
|
},
|
|
16
18
|
"additionalProperties": true
|
|
19
|
+
},
|
|
20
|
+
"content": {
|
|
21
|
+
"type": "array",
|
|
22
|
+
"items": { "type": "object" },
|
|
23
|
+
"description": "Inline content (text, marks)"
|
|
17
24
|
}
|
|
18
25
|
},
|
|
19
26
|
"required": ["type"],
|
|
20
27
|
"additionalProperties": false
|
|
21
28
|
}
|
|
22
|
-
|
|
23
|
-
|