@polotno/schema 0.14.0 → 0.15.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/README.md +8 -7
- package/lib/defaults.d.ts +1 -1
- package/lib/defaults.js +4 -1
- package/lib/design.schema.json +1 -1
- package/lib/migrate.d.ts +7 -1
- package/lib/migrate.js +68 -7
- package/lib/normalize.js +2 -2
- package/lib/schema.d.ts +15 -2
- package/lib/schema.js +68 -6
- package/lib/types.d.ts +40 -2
- package/lib/variable-text.d.ts +6 -0
- package/lib/variable-text.js +12 -4
- package/lib/variables.d.ts +1 -1
- package/lib/variables.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -79,13 +79,14 @@ an older document up to the current version before validating, so a consumer
|
|
|
79
79
|
never has to handle an old shape. A **missing** `schemaVersion` means 0 — the
|
|
80
80
|
oldest format, not the newest.
|
|
81
81
|
|
|
82
|
-
| Version | What changed
|
|
83
|
-
| ------- |
|
|
84
|
-
| 1 | `letterSpacing` is a ratio of the element's own `fontSize`, no longer of a 16px root.
|
|
85
|
-
| 2 | Filter `intensity` moved from `-100..100` to `-1..1`.
|
|
86
|
-
| 3 | Text backgrounds render as per-line polygons; pre-v3 rich text is stamped `
|
|
87
|
-
| 4 | Video time anchoring changed. Marker only — no document transform.
|
|
88
|
-
| 5 | `move` animations travel a share of the page's shorter side, not a fixed 200px; saved `strength` is rescaled to match.
|
|
82
|
+
| Version | What changed |
|
|
83
|
+
| ------- | ----------------------------------------------------------------------------------------------------------------------------- |
|
|
84
|
+
| 1 | `letterSpacing` is a ratio of the element's own `fontSize`, no longer of a 16px root. |
|
|
85
|
+
| 2 | Filter `intensity` moved from `-100..100` to `-1..1`. |
|
|
86
|
+
| 3 | Text backgrounds render as per-line polygons; pre-v3 rich text is stamped `backgroundShape: 'box'` to keep the old full rect. |
|
|
87
|
+
| 4 | Video time anchoring changed. Marker only — no document transform. |
|
|
88
|
+
| 5 | `move` animations travel a share of the page's shorter side, not a fixed 200px; saved `strength` is rescaled to match. |
|
|
89
|
+
| 6 | Text padding, `backgroundShape` and per-side cell padding; `legacyBackground` and `cellPadding` migrate to them. |
|
|
89
90
|
|
|
90
91
|
Steps 1 and 3 apply only to the modern text renderers, which every converter
|
|
91
92
|
uses.
|
package/lib/defaults.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const TABLE_CELL_OVERRIDABLE_KEYS: readonly ['fontSize', 'fontFamily', 'fontWeight', 'fontStyle', 'textDecoration', 'textTransform', 'fill', 'align', 'verticalAlign', 'lineHeight', 'letterSpacing', 'strokeWidth', 'stroke', 'cellBackground', '
|
|
1
|
+
export declare const TABLE_CELL_OVERRIDABLE_KEYS: readonly ['fontSize', 'fontFamily', 'fontWeight', 'fontStyle', 'textDecoration', 'textTransform', 'fill', 'align', 'verticalAlign', 'lineHeight', 'letterSpacing', 'strokeWidth', 'stroke', 'cellBackground', 'cellPaddingTop', 'cellPaddingRight', 'cellPaddingBottom', 'cellPaddingLeft'];
|
|
2
2
|
/**
|
|
3
3
|
* Resolve cell inheritance: every overridable text property a cell leaves
|
|
4
4
|
* undefined is filled from the table element (canvas parity — no fallback
|
package/lib/defaults.js
CHANGED
|
@@ -23,7 +23,10 @@ export const TABLE_CELL_OVERRIDABLE_KEYS = [
|
|
|
23
23
|
'strokeWidth',
|
|
24
24
|
'stroke',
|
|
25
25
|
'cellBackground',
|
|
26
|
-
'
|
|
26
|
+
'cellPaddingTop',
|
|
27
|
+
'cellPaddingRight',
|
|
28
|
+
'cellPaddingBottom',
|
|
29
|
+
'cellPaddingLeft',
|
|
27
30
|
];
|
|
28
31
|
/**
|
|
29
32
|
* Resolve cell inheritance: every overridable text property a cell leaves
|
package/lib/design.schema.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"variables":{"description":"Template variables: the value of each and how to present it. Text tokens and bindings read them.","type":"array","items":{"type":"object","properties":{"name":{"type":"string","pattern":"^[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*$","description":"Variable name: letters, digits and `_`, with `.` between path segments."},"label":{"description":"Name shown to people.","type":"string"},"description":{"description":"Help text for whoever fills the variable.","type":"string"},"required":{"description":"A record must supply the value; `default` does not.","type":"boolean"},"default":{"description":"Value used when none is supplied.","type":["string","boolean"]},"value":{"description":"Value the design draws now.","type":["string","boolean"]}},"required":["name"]}},"schemaVersion":{"default":5,"description":"Schema version for compatibility / migration. A design without it counts as version 0, the oldest format, and is migrated on load, so write the current version in new JSON.","type":"number"},"width":{"default":1080,"description":"Canvas width in pixels.","type":"number"},"height":{"default":1080,"description":"Canvas height in pixels.","type":"number"},"unit":{"default":"px","description":"Unit type for print measurements.","type":"string","enum":["px","pt","mm","cm","in"]},"dpi":{"default":72,"description":"Dots per inch for print calculations.","type":"number"},"custom":{"description":"Custom data attached to the design."},"fonts":{"default":[],"description":"Fonts used in the design.","type":"array","items":{"type":"object","properties":{"fontFamily":{"type":"string","description":"Font family name."},"url":{"default":"","description":"URL to load the font from (single-variant fonts).","type":"string"},"styles":{"description":"Per-weight/style variants for multi-variant families.","type":"array","items":{"type":"object","properties":{"src":{"type":"string","description":"Font source, typically in CSS url() form."},"fontStyle":{"type":"string"},"fontWeight":{"type":"string"}},"required":["src"]}}},"required":["fontFamily"]}},"pages":{"default":[],"description":"Pages in the design.","type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the page."},"width":{"default":"auto","description":"Page width in pixels or 'auto'.","anyOf":[{"type":"number"},{"type":"string","const":"auto"}]},"height":{"default":"auto","description":"Page height in pixels or 'auto'.","anyOf":[{"type":"number"},{"type":"string","const":"auto"}]},"background":{"default":"white","description":"Background color or image.","type":"string"},"bleed":{"default":0,"description":"Bleed area in pixels for print (all sides; base value for per-side overrides).","type":"number"},"bleedTop":{"description":"Per-side bleed override (top), in pixels. Inherits `bleed` when omitted.","type":"number"},"bleedRight":{"description":"Per-side bleed override (right), in pixels. Inherits `bleed` when omitted.","type":"number"},"bleedBottom":{"description":"Per-side bleed override (bottom), in pixels. Inherits `bleed` when omitted.","type":"number"},"bleedLeft":{"description":"Per-side bleed override (left), in pixels. Inherits `bleed` when omitted.","type":"number"},"custom":{},"duration":{"default":5000,"description":"Page duration in milliseconds.","type":"number"},"children":{"default":[],"description":"Elements on this page.","type":"array","items":{"$ref":"#/$defs/__schema0"}}},"required":["id"]}},"audios":{"default":[],"description":"Audio tracks in the design.","type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the audio track."},"name":{"default":"","description":"Display name shown on the timeline.","type":"string"},"src":{"default":"","description":"URL or data URI of the audio file.","type":"string"},"duration":{"default":0,"description":"Duration in milliseconds.","type":"number"},"startTime":{"default":0,"description":"Start offset (0-1).","type":"number"},"endTime":{"default":1,"description":"End offset (0-1).","type":"number"},"volume":{"default":1,"description":"Volume level (0-1).","type":"number"},"delay":{"default":0,"description":"Delay before playing, in milliseconds.","type":"number"},"speed":{"default":1,"description":"Playback speed multiplier (1 = normal).","type":"number"},"custom":{}},"required":["id"]}}},"$defs":{"__schema0":{"oneOf":[{"type":"object","properties":{"bindings":{"description":"Variable names bound to element properties.","type":"object","properties":{"fill":{"type":"string","pattern":"^[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*$"},"visible":{"type":"string","pattern":"^[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*$"}},"additionalProperties":false},"id":{"type":"string","description":"Unique identifier for the element."},"type":{"type":"string","const":"text","description":"Element type identifier."},"name":{"default":"","description":"Display name for the element.","type":"string"},"href":{"description":"Click destination: an http(s), `mailto:` or `tel:` URL, or `#` and a page ID. A group's link applies to each child without one.","type":"string"},"custom":{"description":"Custom data attached to the element."},"x":{"default":0,"description":"X position in pixels.","type":"number"},"y":{"default":0,"description":"Y position in pixels.","type":"number"},"width":{"default":100,"description":"Width in pixels. A value of 0 or less reads as 1.","type":"number"},"height":{"default":0,"description":"Height in pixels (0 until measured/rendered).","type":"number"},"rotation":{"default":0,"description":"Rotation angle in degrees.","type":"number"},"opacity":{"default":1,"description":"Opacity level (0-1).","type":"number"},"blendMode":{"description":"How the element composites with the content beneath it. Omitted means normal.","$ref":"#/$defs/BlendMode"},"animations":{"default":[],"description":"The element's animations, at most one of each `type`, so an 'enter', an 'exit' and a 'loop' can play together. A group's animations play on top of its children's.","type":"array","items":{"$ref":"#/$defs/Animation"}},"blurEnabled":{"default":false,"description":"Whether blur effect is enabled.","type":"boolean"},"blurRadius":{"default":10,"description":"Blur radius in pixels.","type":"number"},"brightnessEnabled":{"default":false,"description":"Whether brightness effect is enabled.","type":"boolean"},"brightness":{"default":0,"description":"Brightness level (-1 to 1).","type":"number"},"sepiaEnabled":{"default":false,"description":"Whether sepia effect is enabled.","type":"boolean"},"grayscaleEnabled":{"default":false,"description":"Whether grayscale effect is enabled.","type":"boolean"},"filters":{"default":{},"description":"Applied image filters keyed by filter name.","$ref":"#/$defs/Filters"},"shadowEnabled":{"default":false,"description":"Whether shadow is enabled.","type":"boolean"},"shadowBlur":{"default":5,"description":"Shadow blur radius in pixels.","type":"number"},"shadowOffsetX":{"default":0,"description":"Shadow horizontal offset in pixels.","type":"number"},"shadowOffsetY":{"default":0,"description":"Shadow vertical offset in pixels.","type":"number"},"shadowColor":{"default":"black","description":"Shadow color.","type":"string"},"shadowOpacity":{"default":1,"description":"Shadow opacity (0-1).","type":"number"},"visible":{"default":true,"description":"Whether the element is visible.","type":"boolean"},"draggable":{"default":true,"description":"Whether the element can be dragged.","type":"boolean"},"resizable":{"default":true,"description":"Whether the element can be resized.","type":"boolean"},"selectable":{"default":true,"description":"Whether the element can be selected.","type":"boolean"},"removable":{"default":true,"description":"Whether the element can be removed.","type":"boolean"},"contentEditable":{"default":true,"description":"Whether the element content can be edited.","type":"boolean"},"styleEditable":{"default":true,"description":"Whether the element style can be edited.","type":"boolean"},"alwaysOnTop":{"default":false,"description":"Whether the element stays on top of others.","type":"boolean"},"showInExport":{"default":true,"description":"Whether the element appears in exports.","type":"boolean"},"text":{"default":"","description":"Text shown on canvas: plain, or rich HTML. `{{name}}` prints a variable; `<a href>` links the words it wraps.","type":"string"},"placeholder":{"default":"","description":"Placeholder text shown when empty.","type":"string"},"fontSize":{"default":14,"description":"Font size in pixels (minimum 1).","type":"number"},"fontFamily":{"default":"Roboto","description":"Font family name.","type":"string"},"fontStyle":{"default":"normal","description":"Font style: 'normal' or 'italic'.","type":"string"},"fontWeight":{"default":"normal","description":"Font weight: 'normal', 'bold', or numeric string.","type":"string"},"textDecoration":{"default":"","description":"Text decoration (e.g. underline, line-through).","type":"string"},"textTransform":{"default":"none","description":"Text transform: uppercase, lowercase, capitalize, none.","type":"string"},"fill":{"default":"black","description":"Text color.","type":"string"},"align":{"default":"center","description":"Horizontal alignment (commonly left | center | right | justify).","type":"string"},"verticalAlign":{"default":"top","description":"Vertical alignment: top, middle, bottom.","type":"string"},"strokeWidth":{"default":0,"description":"Stroke width in pixels.","type":"number"},"stroke":{"default":"black","description":"Stroke color.","type":"string"},"strokeLineJoin":{"default":"round","description":"Stroke corner join: round, miter, bevel.","type":"string"},"lineHeight":{"default":1.2,"description":"Line height multiplier or 'auto'.","type":["number","string"]},"letterSpacing":{"default":0,"description":"Letter spacing as a fraction of font size.","type":"number"},"backgroundEnabled":{"default":false,"description":"Whether the text background is enabled.","type":"boolean"},"backgroundColor":{"default":"#7ED321","description":"Text background color.","type":"string"},"backgroundOpacity":{"default":1,"description":"Text background opacity (0-1).","type":"number"},"backgroundCornerRadius":{"default":0.5,"description":"Text background corner radius.","type":"number"},"backgroundPadding":{"default":0.5,"description":"Text background padding.","type":"number"},"borderColor":{"default":"black","description":"Text box border color.","type":"string"},"borderSize":{"default":0,"description":"Text box border width in pixels.","type":"number"},"curveEnabled":{"default":false,"description":"Whether the text curve effect is enabled.","type":"boolean"},"curvePower":{"default":0.5,"description":"Text curve power (-1 to 1, 0 = straight).","type":"number"},"legacyBackground":{"description":"Internal compatibility flag stamped by the v2→v3 migration.","type":"boolean"},"textOverflow":{"description":"What to do when the text does not fit: 'resize' | 'ellipsis' | 'fit'. Missing (or unknown) follows the global setting.","type":"string"},"maxLines":{"description":"Line cap in every overflow mode; text past it ends in an ellipsis.","type":"number"},"minFontSize":{"description":"Smallest size 'fit' may draw at, in pixels.","type":"number"},"maxFontSize":{"description":"Largest size 'fit' may draw at, in pixels (defaults to fontSize). Above fontSize it grows text to fit.","type":"number"}},"required":["id","type"]},{"type":"object","properties":{"bindings":{"description":"Variable names bound to element properties.","type":"object","properties":{"src":{"type":"string","pattern":"^[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*$"},"visible":{"type":"string","pattern":"^[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*$"}},"additionalProperties":false},"id":{"type":"string","description":"Unique identifier for the element."},"type":{"type":"string","const":"image","description":"Element type identifier."},"name":{"default":"","description":"Display name for the element.","type":"string"},"href":{"description":"Click destination: an http(s), `mailto:` or `tel:` URL, or `#` and a page ID. A group's link applies to each child without one.","type":"string"},"custom":{"description":"Custom data attached to the element."},"x":{"default":0,"description":"X position in pixels.","type":"number"},"y":{"default":0,"description":"Y position in pixels.","type":"number"},"width":{"default":100,"description":"Width in pixels. A value of 0 or less reads as 1.","type":"number"},"height":{"default":100,"description":"Height in pixels. A value of 0 or less reads as 1.","type":"number"},"rotation":{"default":0,"description":"Rotation angle in degrees.","type":"number"},"opacity":{"default":1,"description":"Opacity level (0-1).","type":"number"},"blendMode":{"description":"How the element composites with the content beneath it. Omitted means normal.","$ref":"#/$defs/BlendMode"},"animations":{"default":[],"description":"The element's animations, at most one of each `type`, so an 'enter', an 'exit' and a 'loop' can play together. A group's animations play on top of its children's.","type":"array","items":{"$ref":"#/$defs/Animation"}},"blurEnabled":{"default":false,"description":"Whether blur effect is enabled.","type":"boolean"},"blurRadius":{"default":10,"description":"Blur radius in pixels.","type":"number"},"brightnessEnabled":{"default":false,"description":"Whether brightness effect is enabled.","type":"boolean"},"brightness":{"default":0,"description":"Brightness level (-1 to 1).","type":"number"},"sepiaEnabled":{"default":false,"description":"Whether sepia effect is enabled.","type":"boolean"},"grayscaleEnabled":{"default":false,"description":"Whether grayscale effect is enabled.","type":"boolean"},"filters":{"default":{},"description":"Applied image filters keyed by filter name.","$ref":"#/$defs/Filters"},"shadowEnabled":{"default":false,"description":"Whether shadow is enabled.","type":"boolean"},"shadowBlur":{"default":5,"description":"Shadow blur radius in pixels.","type":"number"},"shadowOffsetX":{"default":0,"description":"Shadow horizontal offset in pixels.","type":"number"},"shadowOffsetY":{"default":0,"description":"Shadow vertical offset in pixels.","type":"number"},"shadowColor":{"default":"black","description":"Shadow color.","type":"string"},"shadowOpacity":{"default":1,"description":"Shadow opacity (0-1).","type":"number"},"visible":{"default":true,"description":"Whether the element is visible.","type":"boolean"},"draggable":{"default":true,"description":"Whether the element can be dragged.","type":"boolean"},"resizable":{"default":true,"description":"Whether the element can be resized.","type":"boolean"},"selectable":{"default":true,"description":"Whether the element can be selected.","type":"boolean"},"removable":{"default":true,"description":"Whether the element can be removed.","type":"boolean"},"contentEditable":{"default":true,"description":"Whether the element content can be edited.","type":"boolean"},"styleEditable":{"default":true,"description":"Whether the element style can be edited.","type":"boolean"},"alwaysOnTop":{"default":false,"description":"Whether the element stays on top of others.","type":"boolean"},"showInExport":{"default":true,"description":"Whether the element appears in exports.","type":"boolean"},"fit":{"description":"`cover` fills the frame and crops the source; `contain` shows the whole source. Unset, the crop fields apply.","type":"string","enum":["cover","contain"]},"focus":{"description":"Where the source sits when `fit` is set: 0 is the left or top edge, 1 the right or bottom; 0.5 by default.","type":"object","properties":{"x":{"type":"number","minimum":0,"maximum":1},"y":{"type":"number","minimum":0,"maximum":1}},"required":["x","y"]},"src":{"default":"","description":"URL or data URI of the image file.","type":"string"},"cropX":{"default":0,"description":"Crop X offset as a fraction (0-1).","type":"number"},"cropY":{"default":0,"description":"Crop Y offset as a fraction (0-1).","type":"number"},"cropWidth":{"default":1,"description":"Crop width as a fraction (0-1).","type":"number"},"cropHeight":{"default":1,"description":"Crop height as a fraction (0-1).","type":"number"},"cornerRadius":{"default":0,"description":"Corner radius in pixels.","type":"number"},"flipX":{"default":false,"description":"Whether the image is flipped horizontally.","type":"boolean"},"flipY":{"default":false,"description":"Whether the image is flipped vertically.","type":"boolean"},"clipSrc":{"default":"","description":"URL or data URI for a clipping mask.","type":"string"},"borderColor":{"default":"black","description":"Border color.","type":"string"},"borderSize":{"default":0,"description":"Border width in pixels.","type":"number"},"keepRatio":{"default":false,"description":"Whether to maintain aspect ratio when resizing.","type":"boolean"},"stretchEnabled":{"default":false,"description":"Whether stretch mode is enabled.","type":"boolean"}},"required":["id","type"]},{"type":"object","properties":{"bindings":{"description":"Variable names bound to element properties.","type":"object","properties":{"src":{"type":"string","pattern":"^[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*$"},"visible":{"type":"string","pattern":"^[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*$"}},"additionalProperties":false},"id":{"type":"string","description":"Unique identifier for the element."},"type":{"type":"string","const":"svg","description":"Element type identifier."},"name":{"default":"","description":"Display name for the element.","type":"string"},"href":{"description":"Click destination: an http(s), `mailto:` or `tel:` URL, or `#` and a page ID. A group's link applies to each child without one.","type":"string"},"custom":{"description":"Custom data attached to the element."},"x":{"default":0,"description":"X position in pixels.","type":"number"},"y":{"default":0,"description":"Y position in pixels.","type":"number"},"width":{"default":100,"description":"Width in pixels. A value of 0 or less reads as 1.","type":"number"},"height":{"default":100,"description":"Height in pixels. A value of 0 or less reads as 1.","type":"number"},"rotation":{"default":0,"description":"Rotation angle in degrees.","type":"number"},"opacity":{"default":1,"description":"Opacity level (0-1).","type":"number"},"blendMode":{"description":"How the element composites with the content beneath it. Omitted means normal.","$ref":"#/$defs/BlendMode"},"animations":{"default":[],"description":"The element's animations, at most one of each `type`, so an 'enter', an 'exit' and a 'loop' can play together. A group's animations play on top of its children's.","type":"array","items":{"$ref":"#/$defs/Animation"}},"blurEnabled":{"default":false,"description":"Whether blur effect is enabled.","type":"boolean"},"blurRadius":{"default":10,"description":"Blur radius in pixels.","type":"number"},"brightnessEnabled":{"default":false,"description":"Whether brightness effect is enabled.","type":"boolean"},"brightness":{"default":0,"description":"Brightness level (-1 to 1).","type":"number"},"sepiaEnabled":{"default":false,"description":"Whether sepia effect is enabled.","type":"boolean"},"grayscaleEnabled":{"default":false,"description":"Whether grayscale effect is enabled.","type":"boolean"},"filters":{"default":{},"description":"Applied image filters keyed by filter name.","$ref":"#/$defs/Filters"},"shadowEnabled":{"default":false,"description":"Whether shadow is enabled.","type":"boolean"},"shadowBlur":{"default":5,"description":"Shadow blur radius in pixels.","type":"number"},"shadowOffsetX":{"default":0,"description":"Shadow horizontal offset in pixels.","type":"number"},"shadowOffsetY":{"default":0,"description":"Shadow vertical offset in pixels.","type":"number"},"shadowColor":{"default":"black","description":"Shadow color.","type":"string"},"shadowOpacity":{"default":1,"description":"Shadow opacity (0-1).","type":"number"},"visible":{"default":true,"description":"Whether the element is visible.","type":"boolean"},"draggable":{"default":true,"description":"Whether the element can be dragged.","type":"boolean"},"resizable":{"default":true,"description":"Whether the element can be resized.","type":"boolean"},"selectable":{"default":true,"description":"Whether the element can be selected.","type":"boolean"},"removable":{"default":true,"description":"Whether the element can be removed.","type":"boolean"},"contentEditable":{"default":true,"description":"Whether the element content can be edited.","type":"boolean"},"styleEditable":{"default":true,"description":"Whether the element style can be edited.","type":"boolean"},"alwaysOnTop":{"default":false,"description":"Whether the element stays on top of others.","type":"boolean"},"showInExport":{"default":true,"description":"Whether the element appears in exports.","type":"boolean"},"src":{"default":"","description":"URL or data URI of the SVG.","type":"string"},"maskSrc":{"default":"","description":"URL or data URI for an SVG mask.","type":"string"},"cropX":{"default":0,"description":"Crop X offset as a fraction (0-1).","type":"number"},"cropY":{"default":0,"description":"Crop Y offset as a fraction (0-1).","type":"number"},"cropWidth":{"default":1,"description":"Crop width as a fraction (0-1).","type":"number"},"cropHeight":{"default":1,"description":"Crop height as a fraction (0-1).","type":"number"},"keepRatio":{"default":true,"description":"Whether to maintain aspect ratio when resizing.","type":"boolean"},"stretchEnabled":{"default":true,"description":"Whether stretch mode is enabled.","type":"boolean"},"flipX":{"default":false,"description":"Whether the image is flipped horizontally.","type":"boolean"},"flipY":{"default":false,"description":"Whether the image is flipped vertically.","type":"boolean"},"borderColor":{"default":"black","description":"Border color.","type":"string"},"borderSize":{"default":0,"description":"Border width in pixels.","type":"number"},"cornerRadius":{"default":0,"description":"Corner radius in pixels.","type":"number"},"colorsReplace":{"default":{},"description":"Color replacement mappings (original → replacement).","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["id","type"]},{"type":"object","properties":{"bindings":{"description":"Variable names bound to element properties.","type":"object","properties":{"visible":{"type":"string","pattern":"^[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*$"}},"additionalProperties":false},"id":{"type":"string","description":"Unique identifier for the element."},"type":{"type":"string","const":"line","description":"Element type identifier."},"name":{"default":"","description":"Display name for the element.","type":"string"},"href":{"description":"Click destination: an http(s), `mailto:` or `tel:` URL, or `#` and a page ID. A group's link applies to each child without one.","type":"string"},"custom":{"description":"Custom data attached to the element."},"x":{"default":0,"description":"X position in pixels.","type":"number"},"y":{"default":0,"description":"Y position in pixels.","type":"number"},"width":{"default":400,"description":"Width in pixels. A value of 0 or less reads as 1.","type":"number"},"height":{"default":10,"description":"Height in pixels. A value of 0 or less reads as 1.","type":"number"},"rotation":{"default":0,"description":"Rotation angle in degrees.","type":"number"},"opacity":{"default":1,"description":"Opacity level (0-1).","type":"number"},"blendMode":{"description":"How the element composites with the content beneath it. Omitted means normal.","$ref":"#/$defs/BlendMode"},"animations":{"default":[],"description":"The element's animations, at most one of each `type`, so an 'enter', an 'exit' and a 'loop' can play together. A group's animations play on top of its children's.","type":"array","items":{"$ref":"#/$defs/Animation"}},"blurEnabled":{"default":false,"description":"Whether blur effect is enabled.","type":"boolean"},"blurRadius":{"default":10,"description":"Blur radius in pixels.","type":"number"},"brightnessEnabled":{"default":false,"description":"Whether brightness effect is enabled.","type":"boolean"},"brightness":{"default":0,"description":"Brightness level (-1 to 1).","type":"number"},"sepiaEnabled":{"default":false,"description":"Whether sepia effect is enabled.","type":"boolean"},"grayscaleEnabled":{"default":false,"description":"Whether grayscale effect is enabled.","type":"boolean"},"filters":{"default":{},"description":"Applied image filters keyed by filter name.","$ref":"#/$defs/Filters"},"shadowEnabled":{"default":false,"description":"Whether shadow is enabled.","type":"boolean"},"shadowBlur":{"default":5,"description":"Shadow blur radius in pixels.","type":"number"},"shadowOffsetX":{"default":0,"description":"Shadow horizontal offset in pixels.","type":"number"},"shadowOffsetY":{"default":0,"description":"Shadow vertical offset in pixels.","type":"number"},"shadowColor":{"default":"black","description":"Shadow color.","type":"string"},"shadowOpacity":{"default":1,"description":"Shadow opacity (0-1).","type":"number"},"visible":{"default":true,"description":"Whether the element is visible.","type":"boolean"},"draggable":{"default":true,"description":"Whether the element can be dragged.","type":"boolean"},"resizable":{"default":true,"description":"Whether the element can be resized.","type":"boolean"},"selectable":{"default":true,"description":"Whether the element can be selected.","type":"boolean"},"removable":{"default":true,"description":"Whether the element can be removed.","type":"boolean"},"contentEditable":{"default":true,"description":"Whether the element content can be edited.","type":"boolean"},"styleEditable":{"default":true,"description":"Whether the element style can be edited.","type":"boolean"},"alwaysOnTop":{"default":false,"description":"Whether the element stays on top of others.","type":"boolean"},"showInExport":{"default":true,"description":"Whether the element appears in exports.","type":"boolean"},"color":{"default":"black","description":"Line color.","type":"string"},"dash":{"default":[],"description":"Dash pattern array.","type":"array","items":{"type":"number"}},"startHead":{"default":"","description":"Start arrow head: empty, arrow, circle, square, bar.","type":"string"},"endHead":{"default":"","description":"End arrow head: empty, arrow, circle, square, bar.","type":"string"}},"required":["id","type"]},{"type":"object","properties":{"bindings":{"description":"Variable names bound to element properties.","type":"object","properties":{"fill":{"type":"string","pattern":"^[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*$"},"visible":{"type":"string","pattern":"^[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*$"}},"additionalProperties":false},"id":{"type":"string","description":"Unique identifier for the element."},"type":{"type":"string","const":"figure","description":"Element type identifier."},"name":{"default":"","description":"Display name for the element.","type":"string"},"href":{"description":"Click destination: an http(s), `mailto:` or `tel:` URL, or `#` and a page ID. A group's link applies to each child without one.","type":"string"},"custom":{"description":"Custom data attached to the element."},"x":{"default":0,"description":"X position in pixels.","type":"number"},"y":{"default":0,"description":"Y position in pixels.","type":"number"},"width":{"default":100,"description":"Width in pixels. A value of 0 or less reads as 1.","type":"number"},"height":{"default":100,"description":"Height in pixels. A value of 0 or less reads as 1.","type":"number"},"rotation":{"default":0,"description":"Rotation angle in degrees.","type":"number"},"opacity":{"default":1,"description":"Opacity level (0-1).","type":"number"},"blendMode":{"description":"How the element composites with the content beneath it. Omitted means normal.","$ref":"#/$defs/BlendMode"},"animations":{"default":[],"description":"The element's animations, at most one of each `type`, so an 'enter', an 'exit' and a 'loop' can play together. A group's animations play on top of its children's.","type":"array","items":{"$ref":"#/$defs/Animation"}},"blurEnabled":{"default":false,"description":"Whether blur effect is enabled.","type":"boolean"},"blurRadius":{"default":10,"description":"Blur radius in pixels.","type":"number"},"brightnessEnabled":{"default":false,"description":"Whether brightness effect is enabled.","type":"boolean"},"brightness":{"default":0,"description":"Brightness level (-1 to 1).","type":"number"},"sepiaEnabled":{"default":false,"description":"Whether sepia effect is enabled.","type":"boolean"},"grayscaleEnabled":{"default":false,"description":"Whether grayscale effect is enabled.","type":"boolean"},"filters":{"default":{},"description":"Applied image filters keyed by filter name.","$ref":"#/$defs/Filters"},"shadowEnabled":{"default":false,"description":"Whether shadow is enabled.","type":"boolean"},"shadowBlur":{"default":5,"description":"Shadow blur radius in pixels.","type":"number"},"shadowOffsetX":{"default":0,"description":"Shadow horizontal offset in pixels.","type":"number"},"shadowOffsetY":{"default":0,"description":"Shadow vertical offset in pixels.","type":"number"},"shadowColor":{"default":"black","description":"Shadow color.","type":"string"},"shadowOpacity":{"default":1,"description":"Shadow opacity (0-1).","type":"number"},"visible":{"default":true,"description":"Whether the element is visible.","type":"boolean"},"draggable":{"default":true,"description":"Whether the element can be dragged.","type":"boolean"},"resizable":{"default":true,"description":"Whether the element can be resized.","type":"boolean"},"selectable":{"default":true,"description":"Whether the element can be selected.","type":"boolean"},"removable":{"default":true,"description":"Whether the element can be removed.","type":"boolean"},"contentEditable":{"default":true,"description":"Whether the element content can be edited.","type":"boolean"},"styleEditable":{"default":true,"description":"Whether the element style can be edited.","type":"boolean"},"alwaysOnTop":{"default":false,"description":"Whether the element stays on top of others.","type":"boolean"},"showInExport":{"default":true,"description":"Whether the element appears in exports.","type":"boolean"},"subType":{"default":"rect","description":"Figure subtype: rect, ellipse, triangle, etc.","type":"string"},"fill":{"default":"rgb(0, 161, 255)","description":"Fill color.","type":"string"},"dash":{"default":[],"description":"Dash pattern array.","type":"array","items":{"type":"number"}},"strokeWidth":{"default":0,"description":"Stroke width in pixels.","type":"number"},"stroke":{"default":"rgba(98, 197, 255, 1)","description":"Stroke color.","type":"string"},"cornerRadius":{"default":0,"description":"Corner radius in pixels.","type":"number"}},"required":["id","type"]},{"type":"object","properties":{"bindings":{"description":"Variable names bound to element properties.","type":"object","properties":{"src":{"type":"string","pattern":"^[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*$"},"visible":{"type":"string","pattern":"^[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*$"}},"additionalProperties":false},"id":{"type":"string","description":"Unique identifier for the element."},"type":{"type":"string","const":"gif","description":"Element type identifier."},"name":{"default":"","description":"Display name for the element.","type":"string"},"href":{"description":"Click destination: an http(s), `mailto:` or `tel:` URL, or `#` and a page ID. A group's link applies to each child without one.","type":"string"},"custom":{"description":"Custom data attached to the element."},"x":{"default":0,"description":"X position in pixels.","type":"number"},"y":{"default":0,"description":"Y position in pixels.","type":"number"},"width":{"default":100,"description":"Width in pixels. A value of 0 or less reads as 1.","type":"number"},"height":{"default":100,"description":"Height in pixels. A value of 0 or less reads as 1.","type":"number"},"rotation":{"default":0,"description":"Rotation angle in degrees.","type":"number"},"opacity":{"default":1,"description":"Opacity level (0-1).","type":"number"},"blendMode":{"description":"How the element composites with the content beneath it. Omitted means normal.","$ref":"#/$defs/BlendMode"},"animations":{"default":[],"description":"The element's animations, at most one of each `type`, so an 'enter', an 'exit' and a 'loop' can play together. A group's animations play on top of its children's.","type":"array","items":{"$ref":"#/$defs/Animation"}},"blurEnabled":{"default":false,"description":"Whether blur effect is enabled.","type":"boolean"},"blurRadius":{"default":10,"description":"Blur radius in pixels.","type":"number"},"brightnessEnabled":{"default":false,"description":"Whether brightness effect is enabled.","type":"boolean"},"brightness":{"default":0,"description":"Brightness level (-1 to 1).","type":"number"},"sepiaEnabled":{"default":false,"description":"Whether sepia effect is enabled.","type":"boolean"},"grayscaleEnabled":{"default":false,"description":"Whether grayscale effect is enabled.","type":"boolean"},"filters":{"default":{},"description":"Applied image filters keyed by filter name.","$ref":"#/$defs/Filters"},"shadowEnabled":{"default":false,"description":"Whether shadow is enabled.","type":"boolean"},"shadowBlur":{"default":5,"description":"Shadow blur radius in pixels.","type":"number"},"shadowOffsetX":{"default":0,"description":"Shadow horizontal offset in pixels.","type":"number"},"shadowOffsetY":{"default":0,"description":"Shadow vertical offset in pixels.","type":"number"},"shadowColor":{"default":"black","description":"Shadow color.","type":"string"},"shadowOpacity":{"default":1,"description":"Shadow opacity (0-1).","type":"number"},"visible":{"default":true,"description":"Whether the element is visible.","type":"boolean"},"draggable":{"default":true,"description":"Whether the element can be dragged.","type":"boolean"},"resizable":{"default":true,"description":"Whether the element can be resized.","type":"boolean"},"selectable":{"default":true,"description":"Whether the element can be selected.","type":"boolean"},"removable":{"default":true,"description":"Whether the element can be removed.","type":"boolean"},"contentEditable":{"default":true,"description":"Whether the element content can be edited.","type":"boolean"},"styleEditable":{"default":true,"description":"Whether the element style can be edited.","type":"boolean"},"alwaysOnTop":{"default":false,"description":"Whether the element stays on top of others.","type":"boolean"},"showInExport":{"default":true,"description":"Whether the element appears in exports.","type":"boolean"},"fit":{"description":"`cover` fills the frame and crops the source; `contain` shows the whole source. Unset, the crop fields apply.","type":"string","enum":["cover","contain"]},"focus":{"description":"Where the source sits when `fit` is set: 0 is the left or top edge, 1 the right or bottom; 0.5 by default.","type":"object","properties":{"x":{"type":"number","minimum":0,"maximum":1},"y":{"type":"number","minimum":0,"maximum":1}},"required":["x","y"]},"src":{"default":"","description":"URL or data URI of the image file.","type":"string"},"cropX":{"default":0,"description":"Crop X offset as a fraction (0-1).","type":"number"},"cropY":{"default":0,"description":"Crop Y offset as a fraction (0-1).","type":"number"},"cropWidth":{"default":1,"description":"Crop width as a fraction (0-1).","type":"number"},"cropHeight":{"default":1,"description":"Crop height as a fraction (0-1).","type":"number"},"cornerRadius":{"default":0,"description":"Corner radius in pixels.","type":"number"},"flipX":{"default":false,"description":"Whether the image is flipped horizontally.","type":"boolean"},"flipY":{"default":false,"description":"Whether the image is flipped vertically.","type":"boolean"},"clipSrc":{"default":"","description":"URL or data URI for a clipping mask.","type":"string"},"borderColor":{"default":"black","description":"Border color.","type":"string"},"borderSize":{"default":0,"description":"Border width in pixels.","type":"number"},"keepRatio":{"default":true,"description":"Whether to maintain aspect ratio when resizing.","type":"boolean"},"stretchEnabled":{"default":false,"description":"Whether stretch mode is enabled.","type":"boolean"},"duration":{"default":0,"description":"GIF duration in milliseconds.","type":"number"}},"required":["id","type"]},{"type":"object","properties":{"bindings":{"description":"Variable names bound to element properties.","type":"object","properties":{"visible":{"type":"string","pattern":"^[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*$"}},"additionalProperties":false},"id":{"type":"string","description":"Unique identifier for the element."},"type":{"type":"string","const":"lottie","description":"Element type identifier."},"name":{"default":"","description":"Display name for the element.","type":"string"},"href":{"description":"Click destination: an http(s), `mailto:` or `tel:` URL, or `#` and a page ID. A group's link applies to each child without one.","type":"string"},"custom":{"description":"Custom data attached to the element."},"x":{"default":0,"description":"X position in pixels.","type":"number"},"y":{"default":0,"description":"Y position in pixels.","type":"number"},"width":{"default":100,"description":"Width in pixels. A value of 0 or less reads as 1.","type":"number"},"height":{"default":100,"description":"Height in pixels. A value of 0 or less reads as 1.","type":"number"},"rotation":{"default":0,"description":"Rotation angle in degrees.","type":"number"},"opacity":{"default":1,"description":"Opacity level (0-1).","type":"number"},"blendMode":{"description":"How the element composites with the content beneath it. Omitted means normal.","$ref":"#/$defs/BlendMode"},"animations":{"default":[],"description":"The element's animations, at most one of each `type`, so an 'enter', an 'exit' and a 'loop' can play together. A group's animations play on top of its children's.","type":"array","items":{"$ref":"#/$defs/Animation"}},"blurEnabled":{"default":false,"description":"Whether blur effect is enabled.","type":"boolean"},"blurRadius":{"default":10,"description":"Blur radius in pixels.","type":"number"},"brightnessEnabled":{"default":false,"description":"Whether brightness effect is enabled.","type":"boolean"},"brightness":{"default":0,"description":"Brightness level (-1 to 1).","type":"number"},"sepiaEnabled":{"default":false,"description":"Whether sepia effect is enabled.","type":"boolean"},"grayscaleEnabled":{"default":false,"description":"Whether grayscale effect is enabled.","type":"boolean"},"filters":{"default":{},"description":"Applied image filters keyed by filter name.","$ref":"#/$defs/Filters"},"shadowEnabled":{"default":false,"description":"Whether shadow is enabled.","type":"boolean"},"shadowBlur":{"default":5,"description":"Shadow blur radius in pixels.","type":"number"},"shadowOffsetX":{"default":0,"description":"Shadow horizontal offset in pixels.","type":"number"},"shadowOffsetY":{"default":0,"description":"Shadow vertical offset in pixels.","type":"number"},"shadowColor":{"default":"black","description":"Shadow color.","type":"string"},"shadowOpacity":{"default":1,"description":"Shadow opacity (0-1).","type":"number"},"visible":{"default":true,"description":"Whether the element is visible.","type":"boolean"},"draggable":{"default":true,"description":"Whether the element can be dragged.","type":"boolean"},"resizable":{"default":true,"description":"Whether the element can be resized.","type":"boolean"},"selectable":{"default":true,"description":"Whether the element can be selected.","type":"boolean"},"removable":{"default":true,"description":"Whether the element can be removed.","type":"boolean"},"contentEditable":{"default":true,"description":"Whether the element content can be edited.","type":"boolean"},"styleEditable":{"default":true,"description":"Whether the element style can be edited.","type":"boolean"},"alwaysOnTop":{"default":false,"description":"Whether the element stays on top of others.","type":"boolean"},"showInExport":{"default":true,"description":"Whether the element appears in exports.","type":"boolean"},"fit":{"description":"`cover` fills the frame and crops the source; `contain` shows the whole source. Unset, the crop fields apply.","type":"string","enum":["cover","contain"]},"focus":{"description":"Where the source sits when `fit` is set: 0 is the left or top edge, 1 the right or bottom; 0.5 by default.","type":"object","properties":{"x":{"type":"number","minimum":0,"maximum":1},"y":{"type":"number","minimum":0,"maximum":1}},"required":["x","y"]},"src":{"default":"","description":"URL or data URI of the image file.","type":"string"},"cropX":{"default":0,"description":"Crop X offset as a fraction (0-1).","type":"number"},"cropY":{"default":0,"description":"Crop Y offset as a fraction (0-1).","type":"number"},"cropWidth":{"default":1,"description":"Crop width as a fraction (0-1).","type":"number"},"cropHeight":{"default":1,"description":"Crop height as a fraction (0-1).","type":"number"},"cornerRadius":{"default":0,"description":"Corner radius in pixels.","type":"number"},"flipX":{"default":false,"description":"Whether the image is flipped horizontally.","type":"boolean"},"flipY":{"default":false,"description":"Whether the image is flipped vertically.","type":"boolean"},"clipSrc":{"default":"","description":"URL or data URI for a clipping mask.","type":"string"},"borderColor":{"default":"black","description":"Border color.","type":"string"},"borderSize":{"default":0,"description":"Border width in pixels.","type":"number"},"keepRatio":{"default":true,"description":"Whether to maintain aspect ratio when resizing.","type":"boolean"},"stretchEnabled":{"default":false,"description":"Whether stretch mode is enabled.","type":"boolean"}},"required":["id","type"]},{"type":"object","properties":{"bindings":{"description":"Variable names bound to element properties.","type":"object","properties":{"src":{"type":"string","pattern":"^[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*$"},"visible":{"type":"string","pattern":"^[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*$"}},"additionalProperties":false},"id":{"type":"string","description":"Unique identifier for the element."},"type":{"type":"string","const":"video","description":"Element type identifier."},"name":{"default":"","description":"Display name for the element.","type":"string"},"href":{"description":"Click destination: an http(s), `mailto:` or `tel:` URL, or `#` and a page ID. A group's link applies to each child without one.","type":"string"},"custom":{"description":"Custom data attached to the element."},"x":{"default":0,"description":"X position in pixels.","type":"number"},"y":{"default":0,"description":"Y position in pixels.","type":"number"},"width":{"default":100,"description":"Width in pixels. A value of 0 or less reads as 1.","type":"number"},"height":{"default":100,"description":"Height in pixels. A value of 0 or less reads as 1.","type":"number"},"rotation":{"default":0,"description":"Rotation angle in degrees.","type":"number"},"opacity":{"default":1,"description":"Opacity level (0-1).","type":"number"},"blendMode":{"description":"How the element composites with the content beneath it. Omitted means normal.","$ref":"#/$defs/BlendMode"},"animations":{"default":[],"description":"The element's animations, at most one of each `type`, so an 'enter', an 'exit' and a 'loop' can play together. A group's animations play on top of its children's.","type":"array","items":{"$ref":"#/$defs/Animation"}},"blurEnabled":{"default":false,"description":"Whether blur effect is enabled.","type":"boolean"},"blurRadius":{"default":10,"description":"Blur radius in pixels.","type":"number"},"brightnessEnabled":{"default":false,"description":"Whether brightness effect is enabled.","type":"boolean"},"brightness":{"default":0,"description":"Brightness level (-1 to 1).","type":"number"},"sepiaEnabled":{"default":false,"description":"Whether sepia effect is enabled.","type":"boolean"},"grayscaleEnabled":{"default":false,"description":"Whether grayscale effect is enabled.","type":"boolean"},"filters":{"default":{},"description":"Applied image filters keyed by filter name.","$ref":"#/$defs/Filters"},"shadowEnabled":{"default":false,"description":"Whether shadow is enabled.","type":"boolean"},"shadowBlur":{"default":5,"description":"Shadow blur radius in pixels.","type":"number"},"shadowOffsetX":{"default":0,"description":"Shadow horizontal offset in pixels.","type":"number"},"shadowOffsetY":{"default":0,"description":"Shadow vertical offset in pixels.","type":"number"},"shadowColor":{"default":"black","description":"Shadow color.","type":"string"},"shadowOpacity":{"default":1,"description":"Shadow opacity (0-1).","type":"number"},"visible":{"default":true,"description":"Whether the element is visible.","type":"boolean"},"draggable":{"default":true,"description":"Whether the element can be dragged.","type":"boolean"},"resizable":{"default":true,"description":"Whether the element can be resized.","type":"boolean"},"selectable":{"default":true,"description":"Whether the element can be selected.","type":"boolean"},"removable":{"default":true,"description":"Whether the element can be removed.","type":"boolean"},"contentEditable":{"default":true,"description":"Whether the element content can be edited.","type":"boolean"},"styleEditable":{"default":true,"description":"Whether the element style can be edited.","type":"boolean"},"alwaysOnTop":{"default":false,"description":"Whether the element stays on top of others.","type":"boolean"},"showInExport":{"default":true,"description":"Whether the element appears in exports.","type":"boolean"},"fit":{"description":"`cover` fills the frame and crops the source; `contain` shows the whole source. Unset, the crop fields apply.","type":"string","enum":["cover","contain"]},"focus":{"description":"Where the source sits when `fit` is set: 0 is the left or top edge, 1 the right or bottom; 0.5 by default.","type":"object","properties":{"x":{"type":"number","minimum":0,"maximum":1},"y":{"type":"number","minimum":0,"maximum":1}},"required":["x","y"]},"src":{"default":"","description":"URL or data URI of the image file.","type":"string"},"cropX":{"default":0,"description":"Crop X offset as a fraction (0-1).","type":"number"},"cropY":{"default":0,"description":"Crop Y offset as a fraction (0-1).","type":"number"},"cropWidth":{"default":1,"description":"Crop width as a fraction (0-1).","type":"number"},"cropHeight":{"default":1,"description":"Crop height as a fraction (0-1).","type":"number"},"cornerRadius":{"default":0,"description":"Corner radius in pixels.","type":"number"},"flipX":{"default":false,"description":"Whether the image is flipped horizontally.","type":"boolean"},"flipY":{"default":false,"description":"Whether the image is flipped vertically.","type":"boolean"},"clipSrc":{"default":"","description":"URL or data URI for a clipping mask.","type":"string"},"borderColor":{"default":"black","description":"Border color.","type":"string"},"borderSize":{"default":0,"description":"Border width in pixels.","type":"number"},"keepRatio":{"default":false,"description":"Whether to maintain aspect ratio when resizing.","type":"boolean"},"stretchEnabled":{"default":false,"description":"Whether stretch mode is enabled.","type":"boolean"},"duration":{"default":0,"description":"Video duration in milliseconds.","type":"number"},"startTime":{"default":0,"description":"Start offset (0-1).","type":"number"},"endTime":{"default":1,"description":"End offset (0-1).","type":"number"},"volume":{"default":1,"description":"Volume (0-1).","type":"number"},"speed":{"default":1,"description":"Playback speed multiplier (1 = normal).","type":"number"}},"required":["id","type"]},{"type":"object","properties":{"bindings":{"description":"Variable names bound to element properties.","type":"object","properties":{"visible":{"type":"string","pattern":"^[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*$"}},"additionalProperties":false},"id":{"type":"string","description":"Unique identifier for the element."},"type":{"type":"string","const":"table","description":"Element type identifier."},"name":{"default":"","description":"Display name for the element.","type":"string"},"href":{"description":"Click destination: an http(s), `mailto:` or `tel:` URL, or `#` and a page ID. A group's link applies to each child without one.","type":"string"},"custom":{"description":"Custom data attached to the element."},"x":{"default":0,"description":"X position in pixels.","type":"number"},"y":{"default":0,"description":"Y position in pixels.","type":"number"},"width":{"default":300,"description":"Width in pixels. A value of 0 or less reads as 1.","type":"number"},"height":{"default":200,"description":"Height in pixels. A value of 0 or less reads as 1.","type":"number"},"rotation":{"default":0,"description":"Rotation angle in degrees.","type":"number"},"opacity":{"default":1,"description":"Opacity level (0-1).","type":"number"},"blendMode":{"description":"How the element composites with the content beneath it. Omitted means normal.","$ref":"#/$defs/BlendMode"},"animations":{"default":[],"description":"The element's animations, at most one of each `type`, so an 'enter', an 'exit' and a 'loop' can play together. A group's animations play on top of its children's.","type":"array","items":{"$ref":"#/$defs/Animation"}},"visible":{"default":true,"description":"Whether the element is visible.","type":"boolean"},"draggable":{"default":true,"description":"Whether the element can be dragged.","type":"boolean"},"resizable":{"default":true,"description":"Whether the element can be resized.","type":"boolean"},"selectable":{"default":true,"description":"Whether the element can be selected.","type":"boolean"},"removable":{"default":true,"description":"Whether the element can be removed.","type":"boolean"},"contentEditable":{"default":true,"description":"Whether the element content can be edited.","type":"boolean"},"styleEditable":{"default":true,"description":"Whether the element style can be edited.","type":"boolean"},"alwaysOnTop":{"default":false,"description":"Whether the element stays on top of others.","type":"boolean"},"showInExport":{"default":true,"description":"Whether the element appears in exports.","type":"boolean"},"rows":{"default":3,"description":"Number of rows.","type":"number"},"cols":{"default":3,"description":"Number of columns.","type":"number"},"colWidths":{"default":[],"description":"Column width fractions (sum to 1).","type":"array","items":{"type":"number"}},"rowHeights":{"default":[],"description":"Row height fractions (sum to 1).","type":"array","items":{"type":"number"}},"cells":{"default":[],"description":"Flat cell array in row-major order.","type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the cell."},"type":{"default":"tablecell","description":"Cell type identifier.","type":"string","const":"tablecell"},"text":{"default":"","description":"Text shown in the cell: plain, or rich HTML. `{{name}}` prints a variable; `<a href>` links the words it wraps.","type":"string"},"opacity":{"description":"Opacity level (0-1).","type":"number"},"rowSpan":{"description":"Number of rows this cell spans.","type":"number"},"colSpan":{"description":"Number of columns this cell spans.","type":"number"},"mergedInto":{"description":"Id of the cell this one is merged into, if any.","type":"string"},"name":{"description":"Display name for the cell.","type":"string"},"custom":{"description":"Custom data attached to the cell."},"borders":{"description":"Per-side border overrides for this cell.","type":"object","properties":{"top":{"description":"Top border override for this cell.","$ref":"#/$defs/BorderSide"},"right":{"description":"Right border override for this cell.","$ref":"#/$defs/BorderSide"},"bottom":{"description":"Bottom border override for this cell.","$ref":"#/$defs/BorderSide"},"left":{"description":"Left border override for this cell.","$ref":"#/$defs/BorderSide"}}},"fontSize":{"description":"Font size in pixels (inherits from the table when omitted, minimum 1).","type":"number"},"fontFamily":{"description":"Font family name (inherits from the table when omitted).","type":"string"},"fontWeight":{"description":"Font weight: 'normal', 'bold', or numeric string (inherits from the table when omitted).","type":"string"},"fontStyle":{"description":"Font style: 'normal' or 'italic' (inherits from the table when omitted).","type":"string"},"textDecoration":{"description":"Text decoration, e.g. underline, line-through (inherits from the table when omitted).","type":"string"},"textTransform":{"description":"Text transform: uppercase, lowercase, capitalize, none (inherits from the table when omitted).","type":"string"},"fill":{"description":"Text color (inherits from the table when omitted).","type":"string"},"align":{"description":"Horizontal alignment: left, center, right, justify (inherits from the table when omitted).","type":"string"},"verticalAlign":{"description":"Vertical alignment: top, middle, bottom (inherits from the table when omitted).","type":"string"},"lineHeight":{"description":"Line height multiplier or 'auto' (inherits from the table when omitted).","type":["number","string"]},"letterSpacing":{"description":"Letter spacing as a fraction of font size (inherits from the table when omitted).","type":"number"},"strokeWidth":{"description":"Stroke width in pixels (inherits from the table when omitted).","type":"number"},"stroke":{"description":"Stroke color (inherits from the table when omitted).","type":"string"},"cellBackground":{"description":"Cell background color (inherits from the table when omitted).","type":"string"},"cellPadding":{"description":"Cell padding in pixels (inherits from the table when omitted).","type":"number"}},"required":["id"]}},"borderColor":{"default":"#000000","description":"Default border color for the table grid.","type":"string"},"borderWidth":{"default":1,"description":"Default border width in pixels.","type":"number"},"borderStyle":{"default":"solid","description":"Default border style.","type":"string","enum":["solid","dashed","dotted","none"]},"fontSize":{"default":30,"description":"Default font size in pixels for cells (minimum 1).","type":"number"},"fontFamily":{"default":"Roboto","description":"Default font family name for cells.","type":"string"},"fontWeight":{"default":"normal","description":"Default font weight: 'normal', 'bold', or numeric string.","type":"string"},"fontStyle":{"default":"normal","description":"Default font style: 'normal' or 'italic'.","type":"string"},"textDecoration":{"default":"","description":"Default text decoration (e.g. underline, line-through).","type":"string"},"textTransform":{"default":"none","description":"Default text transform: uppercase, lowercase, capitalize, none.","type":"string"},"fill":{"default":"black","description":"Default text color for cells.","type":"string"},"align":{"default":"center","description":"Default horizontal alignment: left, center, right, justify.","type":"string"},"verticalAlign":{"default":"middle","description":"Default vertical alignment: top, middle, bottom.","type":"string"},"lineHeight":{"default":1.2,"description":"Default line height multiplier or 'auto'.","type":["number","string"]},"letterSpacing":{"default":0,"description":"Default letter spacing as a fraction of font size.","type":"number"},"strokeWidth":{"default":0,"description":"Default stroke width in pixels.","type":"number"},"stroke":{"default":"black","description":"Default stroke color.","type":"string"},"cellBackground":{"default":"transparent","description":"Default cell background color.","type":"string"},"cellPadding":{"default":4,"description":"Default cell padding in pixels.","type":"number"}},"required":["id","type"]},{"type":"object","properties":{"bindings":{"description":"Variable names bound to element properties.","type":"object","properties":{"visible":{"type":"string","pattern":"^[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*$"}},"additionalProperties":false},"id":{"type":"string","description":"Unique identifier for the element."},"type":{"type":"string","const":"group","description":"Element type identifier."},"name":{"default":"","description":"Display name for the element.","type":"string"},"custom":{"description":"Custom data attached to the element."},"href":{"description":"Click destination: an http(s), `mailto:` or `tel:` URL, or `#` and a page ID. A group's link applies to each child without one.","type":"string"},"opacity":{"default":1,"description":"Opacity level (0-1).","type":"number"},"blendMode":{"description":"How the group composites with the content beneath it. Omitted means pass-through: children blend with that content directly. Any other mode composites the children together first.","type":"string","enum":["pass-through","normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]},"visible":{"default":true,"description":"Whether the element is visible.","type":"boolean"},"selectable":{"default":true,"description":"Whether the element can be selected.","type":"boolean"},"removable":{"default":true,"description":"Whether the element can be removed.","type":"boolean"},"alwaysOnTop":{"default":false,"description":"Whether the element stays on top of others.","type":"boolean"},"showInExport":{"default":true,"description":"Whether the element appears in exports.","type":"boolean"},"animations":{"default":[],"description":"The element's animations, at most one of each `type`, so an 'enter', an 'exit' and a 'loop' can play together. A group's animations play on top of its children's.","type":"array","items":{"$ref":"#/$defs/Animation"}},"children":{"default":[],"description":"Child elements in this group.","type":"array","items":{"$ref":"#/$defs/__schema0"}}},"required":["id","type"]}]},"BlendMode":{"type":"string","enum":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]},"Animation":{"type":"object","properties":{"delay":{"default":0,"description":"Time in milliseconds, measured on the element's page, not on the whole design. On 'enter': how long after the page starts the element appears. It is hidden until then. On 'exit': how long before the page ends the element disappears. The exit finishes at that moment, and the element stays hidden after it. On 'loop': how long after the page starts the first cycle begins. It does not wait for the entrance, so a loop can be mid-cycle when the element appears. Until then the element is at rest. kenBurns ignores it, and letterWave also waits for an entrance that is a text preset to finish.","type":"number"},"duration":{"default":500,"description":"Time in milliseconds. On 'enter': how long the entrance plays, from its `delay`. On 'exit': how long the exit plays, up to the moment the element disappears. If the two together are longer than the element's time on the page, both play faster by the same factor to fit. On 'loop': the length of one cycle. Cycles repeat until the element disappears or the page ends. kenBurns ignores it and plays once across the element's whole time on the page. The default suits a transition of the whole element. Picking a preset in the editor sets a longer one: 1000 for lineRise, wordRise, wordFade, letterPop, wordBlur, lineWipe and linePeek, 50 per letter from 1000 to 4000 for typewriter, 4000 for rotate, 2500 for float, 2000 for letterWave and glow, 1500 for blink and pulse, and 1000 for shake.","type":"number"},"enabled":{"default":true,"description":"Whether the animation plays. A disabled 'enter' or 'exit' also loses its `delay`, so the element is on the page from its start or to its end. To time an element with no transition, keep it enabled with the name 'none'.","type":"boolean"},"type":{"type":"string","enum":["enter","exit","loop"],"description":"Animation phase: 'enter' brings the element onto the page, 'exit' takes it off, and 'loop' repeats while it is there, also during the entrance and the exit."},"name":{"default":"none","description":"Preset to play. Which names are valid depends on `type`. On 'enter' and 'exit': 'none' | 'fade' | 'move' | 'zoom' | 'pop' | 'rise' | 'flip' | 'growTurn' | 'wipe' | 'blur' | 'count' | 'typewriter' | 'lineRise' | 'wordRise' | 'wordFade' | 'letterPop' | 'wordBlur' | 'lineWipe' | 'linePeek'. On 'loop': 'none' | 'rotate' | 'blink' | 'bounce' | 'pulse' | 'float' | 'shake' | 'glow' | 'kenBurns' | 'letterWave'. Use a name only on its own type: a fade on 'loop' plays once and leaves the element hidden. An unknown name passes validation, logs a console error and does not animate. none is a hard cut: the element still appears or disappears at its `delay`, with no transition, and `duration` is ignored. As entrances: fade fades in, move slides in along a straight line, zoom scales into place, pop grows into place and fades in over its first third, rise moves up into place while fading in, flip turns half round about its vertical center line from its mirrored back, growTurn turns into place from half size while fading in, wipe shows the element behind a travelling edge, blur comes into focus while fading in, and count counts the first number in the text up to its value, keeping the style of the text and the format of the number, such as its thousands separator. An exit plays the same preset backwards, except that move, rise, growTurn and wipe carry on the way they were going. Presets that scale keep the center of the element in place. The text presets play on each unit of the text in turn, and `duration` covers them all: typewriter shows letters, letterPop pops letters, wordRise, wordFade and wordBlur play rise, fade and blur on words, lineRise and lineWipe play rise and wipe on lines, and linePeek slides each line into place behind a wipe's edge, clipped to the line's own row. An exit runs from the last unit back to the first, and a linePeek line carries on the way it came. As loops: rotate turns clockwise once per cycle, blink fades out and back, pulse grows a little and back, float lifts and settles, shake swings side to side and dies out within the cycle, glow swells and fades a halo around the element, letterWave bobs each letter in turn, and kenBurns zooms, and can pan, inside the frame of the element. bounce shrinks and grows back: the editor no longer offers it, so prefer pulse. Element limits: count, the text presets and letterWave are for 'text' elements. count plays nothing without a number in the text. Curved text or any other element plays a text preset whole, as its base preset: typewriter and wordFade as fade, lineRise and wordRise as rise, letterPop as pop, wordBlur as blur, lineWipe and linePeek as wipe and letterWave as float. blur blurs only 'text', 'image', 'svg', 'video' and 'gif', and any other element only fades. glow plays nothing on 'table' and 'group'. kenBurns plays on the crop, so only on 'image', 'svg', 'video' and 'gif'. Every other preset plays on every element, groups included.","type":"string"},"data":{"default":{},"description":"Object of options for the preset in `name`. Every option is optional, and a preset not listed here takes none. `strength` is always a multiplier, default 1, and the editor offers 0.1 to 3. move: `direction` 'right' | 'left' | 'up' | 'down' | 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left', default 'right', the way the element travels on both 'enter' and 'exit'. `strength` 1 travels 20% of the shorter side of the page: it covers that distance, not the way to the edge of the page. zoom: `direction` 'in' | 'out', default 'in'. 'in' starts smaller and grows into place, 'out' starts larger and shrinks into place, and any other value plays as 'out'. `strength` 1 starts 25% away from full size. pop: `strength` 1 starts from nothing, and 0.5 from half size. rise: `strength` 1 travels 5% of the shorter side of the page. growTurn: `strength` 1 turns 180 degrees. wipe: `direction` 'right' | 'left' | 'up' | 'down', default 'right', the way its edge travels. lineWipe: `direction` as wipe; without one, each line wipes in its own reading direction. linePeek: `direction` 'right' | 'left' | 'up' | 'down', default 'up', the way each line travels. blur: `strength` 1 adds 20 to `blurRadius` at its most blurred. count: `from`, a number, default 0, where the count starts on 'enter' and ends on 'exit'. bounce: `strength` 1 shrinks to a third of the size, and 0.5 to half. pulse: `strength` 1 grows 8%. float: `strength` 1 lifts 2% of the shorter side of the page. shake: `strength` 1 swings 1.5% of the shorter side of the page. letterWave: `strength` 1 lifts each letter 0.3 of its font size. glow: `strength` 1 spreads 2% of the shorter side of the page. It has no color option: it uses the element's `shadowColor` when `shadowEnabled` is true or `shadowColor` is not 'black', else its `fill` (`color` on a line), else black. So a `shadowColor` with `shadowEnabled` false glows in that color and shows no shadow at rest. kenBurns: `zoom` 'in' | 'out', default 'in'. 'in' narrows the saved crop, and 'out' widens to it. `direction` 'none' | 'right' | 'left' | 'up' | 'down', default 'none', the way the view pans. `strength` 1 narrows the crop by 15%. A design below `schemaVersion` 5, or with none, has its move `strength` rescaled on load to keep the fixed 200px those versions travelled."},"easing":{"description":"Timing curve: 'linear' | 'easeIn' | 'easeOut' | 'easeInOut' | 'backIn' | 'backOut' | 'backInOut'. Missing (or unknown) plays linear. Setting a preset in the editor writes its recommended curve: fade, move, zoom, blur, count, rise, flip, growTurn and wipe ease out on enter and ease in on exit, pop overshoots (backOut on enter, backIn on exit), blink and bounce ease in and out on each sweep, kenBurns eases in and out across the element's time, a text preset eases each of its letters, words or lines as the preset it plays, and every other animation is linear.","type":"string"}},"required":["type"]},"Filters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"intensity":{"default":1,"description":"Filter intensity (-1 to 1).","type":"number"}}}},"BorderSide":{"type":"object","properties":{"color":{"description":"Border color for this side.","type":"string"},"width":{"description":"Border width in pixels for this side.","type":"number"},"style":{"description":"Border style for this side.","type":"string","enum":["solid","dashed","dotted","none"]}}}},"$id":"https://schema.polotno.com/v1/design.schema.json","title":"Polotno Design"}
|
|
1
|
+
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"variables":{"description":"Template variables: the value of each and how to present it. Text tokens and bindings read them.","type":"array","items":{"type":"object","properties":{"name":{"type":"string","pattern":"^[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*$","description":"Variable name: letters, digits and `_`, with `.` between path segments."},"label":{"description":"Name shown to people.","type":"string"},"description":{"description":"Help text for whoever fills the variable.","type":"string"},"required":{"description":"A record must supply the value; `default` does not.","type":"boolean"},"default":{"description":"Value used when none is supplied.","type":["string","boolean"]},"value":{"description":"Value the design draws now.","type":["string","boolean"]}},"required":["name"]}},"schemaVersion":{"default":6,"description":"Schema version for compatibility / migration. A design without it counts as version 0, the oldest format, and is migrated on load, so write the current version in new JSON.","type":"number"},"width":{"default":1080,"description":"Canvas width in pixels.","type":"number"},"height":{"default":1080,"description":"Canvas height in pixels.","type":"number"},"unit":{"default":"px","description":"Unit type for print measurements.","type":"string","enum":["px","pt","mm","cm","in"]},"dpi":{"default":72,"description":"Dots per inch for print calculations.","type":"number"},"custom":{"description":"Custom data attached to the design."},"fonts":{"default":[],"description":"Fonts used in the design.","type":"array","items":{"type":"object","properties":{"fontFamily":{"type":"string","description":"Font family name."},"url":{"default":"","description":"URL to load the font from (single-variant fonts).","type":"string"},"styles":{"description":"Per-weight/style variants for multi-variant families.","type":"array","items":{"type":"object","properties":{"src":{"type":"string","description":"Font source, typically in CSS url() form."},"fontStyle":{"type":"string"},"fontWeight":{"type":"string"}},"required":["src"]}}},"required":["fontFamily"]}},"pages":{"default":[],"description":"Pages in the design.","type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the page."},"width":{"default":"auto","description":"Page width in pixels or 'auto'.","anyOf":[{"type":"number"},{"type":"string","const":"auto"}]},"height":{"default":"auto","description":"Page height in pixels or 'auto'.","anyOf":[{"type":"number"},{"type":"string","const":"auto"}]},"background":{"default":"white","description":"Background color or image.","type":"string"},"bleed":{"default":0,"description":"Bleed area in pixels for print (all sides; base value for per-side overrides).","type":"number"},"bleedTop":{"description":"Per-side bleed override (top), in pixels. Inherits `bleed` when omitted.","type":"number"},"bleedRight":{"description":"Per-side bleed override (right), in pixels. Inherits `bleed` when omitted.","type":"number"},"bleedBottom":{"description":"Per-side bleed override (bottom), in pixels. Inherits `bleed` when omitted.","type":"number"},"bleedLeft":{"description":"Per-side bleed override (left), in pixels. Inherits `bleed` when omitted.","type":"number"},"custom":{},"duration":{"default":5000,"description":"Page duration in milliseconds.","type":"number"},"children":{"default":[],"description":"Elements on this page.","type":"array","items":{"$ref":"#/$defs/__schema0"}}},"required":["id"]}},"audios":{"default":[],"description":"Audio tracks in the design.","type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the audio track."},"name":{"default":"","description":"Display name shown on the timeline.","type":"string"},"src":{"default":"","description":"URL or data URI of the audio file.","type":"string"},"duration":{"default":0,"description":"Duration in milliseconds.","type":"number"},"startTime":{"default":0,"description":"Start offset (0-1).","type":"number"},"endTime":{"default":1,"description":"End offset (0-1).","type":"number"},"volume":{"default":1,"description":"Volume level (0-1).","type":"number"},"delay":{"default":0,"description":"Delay before playing, in milliseconds.","type":"number"},"speed":{"default":1,"description":"Playback speed multiplier (1 = normal).","type":"number"},"custom":{}},"required":["id"]}}},"$defs":{"__schema0":{"oneOf":[{"type":"object","properties":{"bindings":{"description":"Variable names bound to element properties.","type":"object","properties":{"fill":{"type":"string","pattern":"^[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*$"},"visible":{"type":"string","pattern":"^[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*$"}},"additionalProperties":false},"id":{"type":"string","description":"Unique identifier for the element."},"type":{"type":"string","const":"text","description":"Element type identifier."},"name":{"default":"","description":"Display name for the element.","type":"string"},"href":{"description":"Click destination: an http(s), `mailto:` or `tel:` URL, or `#` and a page ID. A group's link applies to each child without one.","type":"string"},"custom":{"description":"Custom data attached to the element."},"x":{"default":0,"description":"X position in pixels.","type":"number"},"y":{"default":0,"description":"Y position in pixels.","type":"number"},"width":{"default":100,"description":"Width in pixels. A value of 0 or less reads as 1.","type":"number"},"height":{"default":0,"description":"Height in pixels (0 until measured/rendered).","type":"number"},"rotation":{"default":0,"description":"Rotation angle in degrees.","type":"number"},"opacity":{"default":1,"description":"Opacity level (0-1).","type":"number"},"blendMode":{"description":"How the element composites with the content beneath it. Omitted means normal.","$ref":"#/$defs/BlendMode"},"animations":{"default":[],"description":"The element's animations, at most one of each `type`, so an 'enter', an 'exit' and a 'loop' can play together. A group's animations play on top of its children's.","type":"array","items":{"$ref":"#/$defs/Animation"}},"blurEnabled":{"default":false,"description":"Whether blur effect is enabled.","type":"boolean"},"blurRadius":{"default":10,"description":"Blur radius in pixels.","type":"number"},"brightnessEnabled":{"default":false,"description":"Whether brightness effect is enabled.","type":"boolean"},"brightness":{"default":0,"description":"Brightness level (-1 to 1).","type":"number"},"sepiaEnabled":{"default":false,"description":"Whether sepia effect is enabled.","type":"boolean"},"grayscaleEnabled":{"default":false,"description":"Whether grayscale effect is enabled.","type":"boolean"},"filters":{"default":{},"description":"Applied image filters keyed by filter name.","$ref":"#/$defs/Filters"},"shadowEnabled":{"default":false,"description":"Whether shadow is enabled.","type":"boolean"},"shadowBlur":{"default":5,"description":"Shadow blur radius in pixels.","type":"number"},"shadowOffsetX":{"default":0,"description":"Shadow horizontal offset in pixels.","type":"number"},"shadowOffsetY":{"default":0,"description":"Shadow vertical offset in pixels.","type":"number"},"shadowColor":{"default":"black","description":"Shadow color.","type":"string"},"shadowOpacity":{"default":1,"description":"Shadow opacity (0-1).","type":"number"},"visible":{"default":true,"description":"Whether the element is visible.","type":"boolean"},"draggable":{"default":true,"description":"Whether the element can be dragged.","type":"boolean"},"resizable":{"default":true,"description":"Whether the element can be resized.","type":"boolean"},"selectable":{"default":true,"description":"Whether the element can be selected.","type":"boolean"},"removable":{"default":true,"description":"Whether the element can be removed.","type":"boolean"},"contentEditable":{"default":true,"description":"Whether the element content can be edited.","type":"boolean"},"styleEditable":{"default":true,"description":"Whether the element style can be edited.","type":"boolean"},"alwaysOnTop":{"default":false,"description":"Whether the element stays on top of others.","type":"boolean"},"showInExport":{"default":true,"description":"Whether the element appears in exports.","type":"boolean"},"text":{"default":"","description":"Text shown on canvas: plain, or rich HTML. `{{name}}` prints a variable; `<a href>` links the words it wraps.","type":"string"},"placeholder":{"default":"","description":"Placeholder text shown when empty.","type":"string"},"fontSize":{"default":14,"description":"Font size in pixels (minimum 1).","type":"number"},"fontFamily":{"default":"Roboto","description":"Font family name.","type":"string"},"fontStyle":{"default":"normal","description":"Font style: 'normal' or 'italic'.","type":"string"},"fontWeight":{"default":"normal","description":"Font weight: 'normal', 'bold', or numeric string.","type":"string"},"textDecoration":{"default":"","description":"Text decoration (e.g. underline, line-through).","type":"string"},"textTransform":{"default":"none","description":"Text transform: uppercase, lowercase, capitalize, none.","type":"string"},"fill":{"default":"black","description":"Text color.","type":"string"},"align":{"default":"center","description":"Horizontal alignment (commonly left | center | right | justify).","type":"string"},"verticalAlign":{"default":"top","description":"Vertical alignment: top, middle, bottom.","type":"string"},"strokeWidth":{"default":0,"description":"Stroke width in pixels.","type":"number"},"stroke":{"default":"black","description":"Stroke color.","type":"string"},"strokeLineJoin":{"default":"round","description":"Stroke corner join: round, miter, bevel.","type":"string"},"lineHeight":{"default":1.2,"description":"Line height multiplier or 'auto'.","type":["number","string"]},"letterSpacing":{"default":0,"description":"Letter spacing as a fraction of font size.","type":"number"},"backgroundEnabled":{"default":false,"description":"Whether the text background is enabled.","type":"boolean"},"backgroundColor":{"default":"#7ED321","description":"Text background color.","type":"string"},"backgroundOpacity":{"default":1,"description":"Text background opacity (0-1).","type":"number"},"backgroundCornerRadius":{"default":0.5,"description":"Text background corner radius.","type":"number"},"backgroundPadding":{"default":0.5,"description":"How far the text background and border reach past what they paint around (the spread), as a fraction of half a line at the authored font size. Never moves the text.","type":"number"},"backgroundShape":{"description":"What the text background and border paint around: 'lines' (each line, the default) or 'box' (the element's frame). Unknown values count as 'lines'.","type":"string"},"paddingTop":{"description":"Space between the text and the top edge of its frame, in pixels. Missing means 0.","type":"number"},"paddingRight":{"description":"Space between the text and the right edge of its frame, in pixels. Missing means 0.","type":"number"},"paddingBottom":{"description":"Space between the text and the bottom edge of its frame, in pixels. Missing means 0.","type":"number"},"paddingLeft":{"description":"Space between the text and the left edge of its frame, in pixels. Missing means 0.","type":"number"},"borderColor":{"default":"black","description":"Text box border color.","type":"string"},"borderSize":{"default":0,"description":"Text box border width in pixels.","type":"number"},"curveEnabled":{"default":false,"description":"Whether the text curve effect is enabled.","type":"boolean"},"curvePower":{"default":0.5,"description":"Text curve power (-1 to 1, 0 = straight).","type":"number"},"legacyBackground":{"description":"Deprecated input: migrateDesign turns true into backgroundShape 'box'. Never written.","type":"boolean"},"textOverflow":{"description":"What to do when the text does not fit: 'resize' | 'ellipsis' | 'fit'. Missing (or unknown) follows the global setting.","type":"string"},"maxLines":{"description":"Line cap in every overflow mode; text past it ends in an ellipsis.","type":"number"},"minFontSize":{"description":"Smallest size 'fit' may draw at, in pixels.","type":"number"},"maxFontSize":{"description":"Largest size 'fit' may draw at, in pixels (defaults to fontSize). Above fontSize it grows text to fit.","type":"number"}},"required":["id","type"]},{"type":"object","properties":{"bindings":{"description":"Variable names bound to element properties.","type":"object","properties":{"src":{"type":"string","pattern":"^[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*$"},"visible":{"type":"string","pattern":"^[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*$"}},"additionalProperties":false},"id":{"type":"string","description":"Unique identifier for the element."},"type":{"type":"string","const":"image","description":"Element type identifier."},"name":{"default":"","description":"Display name for the element.","type":"string"},"href":{"description":"Click destination: an http(s), `mailto:` or `tel:` URL, or `#` and a page ID. A group's link applies to each child without one.","type":"string"},"custom":{"description":"Custom data attached to the element."},"x":{"default":0,"description":"X position in pixels.","type":"number"},"y":{"default":0,"description":"Y position in pixels.","type":"number"},"width":{"default":100,"description":"Width in pixels. A value of 0 or less reads as 1.","type":"number"},"height":{"default":100,"description":"Height in pixels. A value of 0 or less reads as 1.","type":"number"},"rotation":{"default":0,"description":"Rotation angle in degrees.","type":"number"},"opacity":{"default":1,"description":"Opacity level (0-1).","type":"number"},"blendMode":{"description":"How the element composites with the content beneath it. Omitted means normal.","$ref":"#/$defs/BlendMode"},"animations":{"default":[],"description":"The element's animations, at most one of each `type`, so an 'enter', an 'exit' and a 'loop' can play together. A group's animations play on top of its children's.","type":"array","items":{"$ref":"#/$defs/Animation"}},"blurEnabled":{"default":false,"description":"Whether blur effect is enabled.","type":"boolean"},"blurRadius":{"default":10,"description":"Blur radius in pixels.","type":"number"},"brightnessEnabled":{"default":false,"description":"Whether brightness effect is enabled.","type":"boolean"},"brightness":{"default":0,"description":"Brightness level (-1 to 1).","type":"number"},"sepiaEnabled":{"default":false,"description":"Whether sepia effect is enabled.","type":"boolean"},"grayscaleEnabled":{"default":false,"description":"Whether grayscale effect is enabled.","type":"boolean"},"filters":{"default":{},"description":"Applied image filters keyed by filter name.","$ref":"#/$defs/Filters"},"shadowEnabled":{"default":false,"description":"Whether shadow is enabled.","type":"boolean"},"shadowBlur":{"default":5,"description":"Shadow blur radius in pixels.","type":"number"},"shadowOffsetX":{"default":0,"description":"Shadow horizontal offset in pixels.","type":"number"},"shadowOffsetY":{"default":0,"description":"Shadow vertical offset in pixels.","type":"number"},"shadowColor":{"default":"black","description":"Shadow color.","type":"string"},"shadowOpacity":{"default":1,"description":"Shadow opacity (0-1).","type":"number"},"visible":{"default":true,"description":"Whether the element is visible.","type":"boolean"},"draggable":{"default":true,"description":"Whether the element can be dragged.","type":"boolean"},"resizable":{"default":true,"description":"Whether the element can be resized.","type":"boolean"},"selectable":{"default":true,"description":"Whether the element can be selected.","type":"boolean"},"removable":{"default":true,"description":"Whether the element can be removed.","type":"boolean"},"contentEditable":{"default":true,"description":"Whether the element content can be edited.","type":"boolean"},"styleEditable":{"default":true,"description":"Whether the element style can be edited.","type":"boolean"},"alwaysOnTop":{"default":false,"description":"Whether the element stays on top of others.","type":"boolean"},"showInExport":{"default":true,"description":"Whether the element appears in exports.","type":"boolean"},"fit":{"description":"`cover` fills the frame and crops the source; `contain` shows the whole source. Unset, the crop fields apply.","type":"string","enum":["cover","contain"]},"focus":{"description":"Where the source sits when `fit` is set: 0 is the left or top edge, 1 the right or bottom; 0.5 by default.","type":"object","properties":{"x":{"type":"number","minimum":0,"maximum":1},"y":{"type":"number","minimum":0,"maximum":1}},"required":["x","y"]},"src":{"default":"","description":"URL or data URI of the image file.","type":"string"},"cropX":{"default":0,"description":"Crop X offset as a fraction (0-1).","type":"number"},"cropY":{"default":0,"description":"Crop Y offset as a fraction (0-1).","type":"number"},"cropWidth":{"default":1,"description":"Crop width as a fraction (0-1).","type":"number"},"cropHeight":{"default":1,"description":"Crop height as a fraction (0-1).","type":"number"},"cornerRadius":{"default":0,"description":"Corner radius in pixels.","type":"number"},"flipX":{"default":false,"description":"Whether the image is flipped horizontally.","type":"boolean"},"flipY":{"default":false,"description":"Whether the image is flipped vertically.","type":"boolean"},"clipSrc":{"default":"","description":"URL or data URI for a clipping mask.","type":"string"},"borderColor":{"default":"black","description":"Border color.","type":"string"},"borderSize":{"default":0,"description":"Border width in pixels.","type":"number"},"keepRatio":{"default":false,"description":"Whether to maintain aspect ratio when resizing.","type":"boolean"},"stretchEnabled":{"default":false,"description":"Whether stretch mode is enabled.","type":"boolean"}},"required":["id","type"]},{"type":"object","properties":{"bindings":{"description":"Variable names bound to element properties.","type":"object","properties":{"src":{"type":"string","pattern":"^[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*$"},"visible":{"type":"string","pattern":"^[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*$"}},"additionalProperties":false},"id":{"type":"string","description":"Unique identifier for the element."},"type":{"type":"string","const":"svg","description":"Element type identifier."},"name":{"default":"","description":"Display name for the element.","type":"string"},"href":{"description":"Click destination: an http(s), `mailto:` or `tel:` URL, or `#` and a page ID. A group's link applies to each child without one.","type":"string"},"custom":{"description":"Custom data attached to the element."},"x":{"default":0,"description":"X position in pixels.","type":"number"},"y":{"default":0,"description":"Y position in pixels.","type":"number"},"width":{"default":100,"description":"Width in pixels. A value of 0 or less reads as 1.","type":"number"},"height":{"default":100,"description":"Height in pixels. A value of 0 or less reads as 1.","type":"number"},"rotation":{"default":0,"description":"Rotation angle in degrees.","type":"number"},"opacity":{"default":1,"description":"Opacity level (0-1).","type":"number"},"blendMode":{"description":"How the element composites with the content beneath it. Omitted means normal.","$ref":"#/$defs/BlendMode"},"animations":{"default":[],"description":"The element's animations, at most one of each `type`, so an 'enter', an 'exit' and a 'loop' can play together. A group's animations play on top of its children's.","type":"array","items":{"$ref":"#/$defs/Animation"}},"blurEnabled":{"default":false,"description":"Whether blur effect is enabled.","type":"boolean"},"blurRadius":{"default":10,"description":"Blur radius in pixels.","type":"number"},"brightnessEnabled":{"default":false,"description":"Whether brightness effect is enabled.","type":"boolean"},"brightness":{"default":0,"description":"Brightness level (-1 to 1).","type":"number"},"sepiaEnabled":{"default":false,"description":"Whether sepia effect is enabled.","type":"boolean"},"grayscaleEnabled":{"default":false,"description":"Whether grayscale effect is enabled.","type":"boolean"},"filters":{"default":{},"description":"Applied image filters keyed by filter name.","$ref":"#/$defs/Filters"},"shadowEnabled":{"default":false,"description":"Whether shadow is enabled.","type":"boolean"},"shadowBlur":{"default":5,"description":"Shadow blur radius in pixels.","type":"number"},"shadowOffsetX":{"default":0,"description":"Shadow horizontal offset in pixels.","type":"number"},"shadowOffsetY":{"default":0,"description":"Shadow vertical offset in pixels.","type":"number"},"shadowColor":{"default":"black","description":"Shadow color.","type":"string"},"shadowOpacity":{"default":1,"description":"Shadow opacity (0-1).","type":"number"},"visible":{"default":true,"description":"Whether the element is visible.","type":"boolean"},"draggable":{"default":true,"description":"Whether the element can be dragged.","type":"boolean"},"resizable":{"default":true,"description":"Whether the element can be resized.","type":"boolean"},"selectable":{"default":true,"description":"Whether the element can be selected.","type":"boolean"},"removable":{"default":true,"description":"Whether the element can be removed.","type":"boolean"},"contentEditable":{"default":true,"description":"Whether the element content can be edited.","type":"boolean"},"styleEditable":{"default":true,"description":"Whether the element style can be edited.","type":"boolean"},"alwaysOnTop":{"default":false,"description":"Whether the element stays on top of others.","type":"boolean"},"showInExport":{"default":true,"description":"Whether the element appears in exports.","type":"boolean"},"src":{"default":"","description":"URL or data URI of the SVG.","type":"string"},"maskSrc":{"default":"","description":"URL or data URI for an SVG mask.","type":"string"},"cropX":{"default":0,"description":"Crop X offset as a fraction (0-1).","type":"number"},"cropY":{"default":0,"description":"Crop Y offset as a fraction (0-1).","type":"number"},"cropWidth":{"default":1,"description":"Crop width as a fraction (0-1).","type":"number"},"cropHeight":{"default":1,"description":"Crop height as a fraction (0-1).","type":"number"},"keepRatio":{"default":true,"description":"Whether to maintain aspect ratio when resizing.","type":"boolean"},"stretchEnabled":{"default":true,"description":"Whether stretch mode is enabled.","type":"boolean"},"flipX":{"default":false,"description":"Whether the image is flipped horizontally.","type":"boolean"},"flipY":{"default":false,"description":"Whether the image is flipped vertically.","type":"boolean"},"borderColor":{"default":"black","description":"Border color.","type":"string"},"borderSize":{"default":0,"description":"Border width in pixels.","type":"number"},"cornerRadius":{"default":0,"description":"Corner radius in pixels.","type":"number"},"colorsReplace":{"default":{},"description":"Color replacement mappings (original → replacement).","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["id","type"]},{"type":"object","properties":{"bindings":{"description":"Variable names bound to element properties.","type":"object","properties":{"visible":{"type":"string","pattern":"^[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*$"}},"additionalProperties":false},"id":{"type":"string","description":"Unique identifier for the element."},"type":{"type":"string","const":"line","description":"Element type identifier."},"name":{"default":"","description":"Display name for the element.","type":"string"},"href":{"description":"Click destination: an http(s), `mailto:` or `tel:` URL, or `#` and a page ID. A group's link applies to each child without one.","type":"string"},"custom":{"description":"Custom data attached to the element."},"x":{"default":0,"description":"X position in pixels.","type":"number"},"y":{"default":0,"description":"Y position in pixels.","type":"number"},"width":{"default":400,"description":"Width in pixels. A value of 0 or less reads as 1.","type":"number"},"height":{"default":10,"description":"Height in pixels. A value of 0 or less reads as 1.","type":"number"},"rotation":{"default":0,"description":"Rotation angle in degrees.","type":"number"},"opacity":{"default":1,"description":"Opacity level (0-1).","type":"number"},"blendMode":{"description":"How the element composites with the content beneath it. Omitted means normal.","$ref":"#/$defs/BlendMode"},"animations":{"default":[],"description":"The element's animations, at most one of each `type`, so an 'enter', an 'exit' and a 'loop' can play together. A group's animations play on top of its children's.","type":"array","items":{"$ref":"#/$defs/Animation"}},"blurEnabled":{"default":false,"description":"Whether blur effect is enabled.","type":"boolean"},"blurRadius":{"default":10,"description":"Blur radius in pixels.","type":"number"},"brightnessEnabled":{"default":false,"description":"Whether brightness effect is enabled.","type":"boolean"},"brightness":{"default":0,"description":"Brightness level (-1 to 1).","type":"number"},"sepiaEnabled":{"default":false,"description":"Whether sepia effect is enabled.","type":"boolean"},"grayscaleEnabled":{"default":false,"description":"Whether grayscale effect is enabled.","type":"boolean"},"filters":{"default":{},"description":"Applied image filters keyed by filter name.","$ref":"#/$defs/Filters"},"shadowEnabled":{"default":false,"description":"Whether shadow is enabled.","type":"boolean"},"shadowBlur":{"default":5,"description":"Shadow blur radius in pixels.","type":"number"},"shadowOffsetX":{"default":0,"description":"Shadow horizontal offset in pixels.","type":"number"},"shadowOffsetY":{"default":0,"description":"Shadow vertical offset in pixels.","type":"number"},"shadowColor":{"default":"black","description":"Shadow color.","type":"string"},"shadowOpacity":{"default":1,"description":"Shadow opacity (0-1).","type":"number"},"visible":{"default":true,"description":"Whether the element is visible.","type":"boolean"},"draggable":{"default":true,"description":"Whether the element can be dragged.","type":"boolean"},"resizable":{"default":true,"description":"Whether the element can be resized.","type":"boolean"},"selectable":{"default":true,"description":"Whether the element can be selected.","type":"boolean"},"removable":{"default":true,"description":"Whether the element can be removed.","type":"boolean"},"contentEditable":{"default":true,"description":"Whether the element content can be edited.","type":"boolean"},"styleEditable":{"default":true,"description":"Whether the element style can be edited.","type":"boolean"},"alwaysOnTop":{"default":false,"description":"Whether the element stays on top of others.","type":"boolean"},"showInExport":{"default":true,"description":"Whether the element appears in exports.","type":"boolean"},"color":{"default":"black","description":"Line color.","type":"string"},"dash":{"default":[],"description":"Dash pattern array.","type":"array","items":{"type":"number"}},"startHead":{"default":"","description":"Start arrow head: empty, arrow, circle, square, bar.","type":"string"},"endHead":{"default":"","description":"End arrow head: empty, arrow, circle, square, bar.","type":"string"}},"required":["id","type"]},{"type":"object","properties":{"bindings":{"description":"Variable names bound to element properties.","type":"object","properties":{"fill":{"type":"string","pattern":"^[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*$"},"visible":{"type":"string","pattern":"^[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*$"}},"additionalProperties":false},"id":{"type":"string","description":"Unique identifier for the element."},"type":{"type":"string","const":"figure","description":"Element type identifier."},"name":{"default":"","description":"Display name for the element.","type":"string"},"href":{"description":"Click destination: an http(s), `mailto:` or `tel:` URL, or `#` and a page ID. A group's link applies to each child without one.","type":"string"},"custom":{"description":"Custom data attached to the element."},"x":{"default":0,"description":"X position in pixels.","type":"number"},"y":{"default":0,"description":"Y position in pixels.","type":"number"},"width":{"default":100,"description":"Width in pixels. A value of 0 or less reads as 1.","type":"number"},"height":{"default":100,"description":"Height in pixels. A value of 0 or less reads as 1.","type":"number"},"rotation":{"default":0,"description":"Rotation angle in degrees.","type":"number"},"opacity":{"default":1,"description":"Opacity level (0-1).","type":"number"},"blendMode":{"description":"How the element composites with the content beneath it. Omitted means normal.","$ref":"#/$defs/BlendMode"},"animations":{"default":[],"description":"The element's animations, at most one of each `type`, so an 'enter', an 'exit' and a 'loop' can play together. A group's animations play on top of its children's.","type":"array","items":{"$ref":"#/$defs/Animation"}},"blurEnabled":{"default":false,"description":"Whether blur effect is enabled.","type":"boolean"},"blurRadius":{"default":10,"description":"Blur radius in pixels.","type":"number"},"brightnessEnabled":{"default":false,"description":"Whether brightness effect is enabled.","type":"boolean"},"brightness":{"default":0,"description":"Brightness level (-1 to 1).","type":"number"},"sepiaEnabled":{"default":false,"description":"Whether sepia effect is enabled.","type":"boolean"},"grayscaleEnabled":{"default":false,"description":"Whether grayscale effect is enabled.","type":"boolean"},"filters":{"default":{},"description":"Applied image filters keyed by filter name.","$ref":"#/$defs/Filters"},"shadowEnabled":{"default":false,"description":"Whether shadow is enabled.","type":"boolean"},"shadowBlur":{"default":5,"description":"Shadow blur radius in pixels.","type":"number"},"shadowOffsetX":{"default":0,"description":"Shadow horizontal offset in pixels.","type":"number"},"shadowOffsetY":{"default":0,"description":"Shadow vertical offset in pixels.","type":"number"},"shadowColor":{"default":"black","description":"Shadow color.","type":"string"},"shadowOpacity":{"default":1,"description":"Shadow opacity (0-1).","type":"number"},"visible":{"default":true,"description":"Whether the element is visible.","type":"boolean"},"draggable":{"default":true,"description":"Whether the element can be dragged.","type":"boolean"},"resizable":{"default":true,"description":"Whether the element can be resized.","type":"boolean"},"selectable":{"default":true,"description":"Whether the element can be selected.","type":"boolean"},"removable":{"default":true,"description":"Whether the element can be removed.","type":"boolean"},"contentEditable":{"default":true,"description":"Whether the element content can be edited.","type":"boolean"},"styleEditable":{"default":true,"description":"Whether the element style can be edited.","type":"boolean"},"alwaysOnTop":{"default":false,"description":"Whether the element stays on top of others.","type":"boolean"},"showInExport":{"default":true,"description":"Whether the element appears in exports.","type":"boolean"},"subType":{"default":"rect","description":"Figure subtype: rect, ellipse, triangle, etc.","type":"string"},"fill":{"default":"rgb(0, 161, 255)","description":"Fill color.","type":"string"},"dash":{"default":[],"description":"Dash pattern array.","type":"array","items":{"type":"number"}},"strokeWidth":{"default":0,"description":"Stroke width in pixels.","type":"number"},"stroke":{"default":"rgba(98, 197, 255, 1)","description":"Stroke color.","type":"string"},"cornerRadius":{"default":0,"description":"Corner radius in pixels.","type":"number"}},"required":["id","type"]},{"type":"object","properties":{"bindings":{"description":"Variable names bound to element properties.","type":"object","properties":{"src":{"type":"string","pattern":"^[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*$"},"visible":{"type":"string","pattern":"^[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*$"}},"additionalProperties":false},"id":{"type":"string","description":"Unique identifier for the element."},"type":{"type":"string","const":"gif","description":"Element type identifier."},"name":{"default":"","description":"Display name for the element.","type":"string"},"href":{"description":"Click destination: an http(s), `mailto:` or `tel:` URL, or `#` and a page ID. A group's link applies to each child without one.","type":"string"},"custom":{"description":"Custom data attached to the element."},"x":{"default":0,"description":"X position in pixels.","type":"number"},"y":{"default":0,"description":"Y position in pixels.","type":"number"},"width":{"default":100,"description":"Width in pixels. A value of 0 or less reads as 1.","type":"number"},"height":{"default":100,"description":"Height in pixels. A value of 0 or less reads as 1.","type":"number"},"rotation":{"default":0,"description":"Rotation angle in degrees.","type":"number"},"opacity":{"default":1,"description":"Opacity level (0-1).","type":"number"},"blendMode":{"description":"How the element composites with the content beneath it. Omitted means normal.","$ref":"#/$defs/BlendMode"},"animations":{"default":[],"description":"The element's animations, at most one of each `type`, so an 'enter', an 'exit' and a 'loop' can play together. A group's animations play on top of its children's.","type":"array","items":{"$ref":"#/$defs/Animation"}},"blurEnabled":{"default":false,"description":"Whether blur effect is enabled.","type":"boolean"},"blurRadius":{"default":10,"description":"Blur radius in pixels.","type":"number"},"brightnessEnabled":{"default":false,"description":"Whether brightness effect is enabled.","type":"boolean"},"brightness":{"default":0,"description":"Brightness level (-1 to 1).","type":"number"},"sepiaEnabled":{"default":false,"description":"Whether sepia effect is enabled.","type":"boolean"},"grayscaleEnabled":{"default":false,"description":"Whether grayscale effect is enabled.","type":"boolean"},"filters":{"default":{},"description":"Applied image filters keyed by filter name.","$ref":"#/$defs/Filters"},"shadowEnabled":{"default":false,"description":"Whether shadow is enabled.","type":"boolean"},"shadowBlur":{"default":5,"description":"Shadow blur radius in pixels.","type":"number"},"shadowOffsetX":{"default":0,"description":"Shadow horizontal offset in pixels.","type":"number"},"shadowOffsetY":{"default":0,"description":"Shadow vertical offset in pixels.","type":"number"},"shadowColor":{"default":"black","description":"Shadow color.","type":"string"},"shadowOpacity":{"default":1,"description":"Shadow opacity (0-1).","type":"number"},"visible":{"default":true,"description":"Whether the element is visible.","type":"boolean"},"draggable":{"default":true,"description":"Whether the element can be dragged.","type":"boolean"},"resizable":{"default":true,"description":"Whether the element can be resized.","type":"boolean"},"selectable":{"default":true,"description":"Whether the element can be selected.","type":"boolean"},"removable":{"default":true,"description":"Whether the element can be removed.","type":"boolean"},"contentEditable":{"default":true,"description":"Whether the element content can be edited.","type":"boolean"},"styleEditable":{"default":true,"description":"Whether the element style can be edited.","type":"boolean"},"alwaysOnTop":{"default":false,"description":"Whether the element stays on top of others.","type":"boolean"},"showInExport":{"default":true,"description":"Whether the element appears in exports.","type":"boolean"},"fit":{"description":"`cover` fills the frame and crops the source; `contain` shows the whole source. Unset, the crop fields apply.","type":"string","enum":["cover","contain"]},"focus":{"description":"Where the source sits when `fit` is set: 0 is the left or top edge, 1 the right or bottom; 0.5 by default.","type":"object","properties":{"x":{"type":"number","minimum":0,"maximum":1},"y":{"type":"number","minimum":0,"maximum":1}},"required":["x","y"]},"src":{"default":"","description":"URL or data URI of the image file.","type":"string"},"cropX":{"default":0,"description":"Crop X offset as a fraction (0-1).","type":"number"},"cropY":{"default":0,"description":"Crop Y offset as a fraction (0-1).","type":"number"},"cropWidth":{"default":1,"description":"Crop width as a fraction (0-1).","type":"number"},"cropHeight":{"default":1,"description":"Crop height as a fraction (0-1).","type":"number"},"cornerRadius":{"default":0,"description":"Corner radius in pixels.","type":"number"},"flipX":{"default":false,"description":"Whether the image is flipped horizontally.","type":"boolean"},"flipY":{"default":false,"description":"Whether the image is flipped vertically.","type":"boolean"},"clipSrc":{"default":"","description":"URL or data URI for a clipping mask.","type":"string"},"borderColor":{"default":"black","description":"Border color.","type":"string"},"borderSize":{"default":0,"description":"Border width in pixels.","type":"number"},"keepRatio":{"default":true,"description":"Whether to maintain aspect ratio when resizing.","type":"boolean"},"stretchEnabled":{"default":false,"description":"Whether stretch mode is enabled.","type":"boolean"},"duration":{"default":0,"description":"GIF duration in milliseconds.","type":"number"}},"required":["id","type"]},{"type":"object","properties":{"bindings":{"description":"Variable names bound to element properties.","type":"object","properties":{"visible":{"type":"string","pattern":"^[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*$"}},"additionalProperties":false},"id":{"type":"string","description":"Unique identifier for the element."},"type":{"type":"string","const":"lottie","description":"Element type identifier."},"name":{"default":"","description":"Display name for the element.","type":"string"},"href":{"description":"Click destination: an http(s), `mailto:` or `tel:` URL, or `#` and a page ID. A group's link applies to each child without one.","type":"string"},"custom":{"description":"Custom data attached to the element."},"x":{"default":0,"description":"X position in pixels.","type":"number"},"y":{"default":0,"description":"Y position in pixels.","type":"number"},"width":{"default":100,"description":"Width in pixels. A value of 0 or less reads as 1.","type":"number"},"height":{"default":100,"description":"Height in pixels. A value of 0 or less reads as 1.","type":"number"},"rotation":{"default":0,"description":"Rotation angle in degrees.","type":"number"},"opacity":{"default":1,"description":"Opacity level (0-1).","type":"number"},"blendMode":{"description":"How the element composites with the content beneath it. Omitted means normal.","$ref":"#/$defs/BlendMode"},"animations":{"default":[],"description":"The element's animations, at most one of each `type`, so an 'enter', an 'exit' and a 'loop' can play together. A group's animations play on top of its children's.","type":"array","items":{"$ref":"#/$defs/Animation"}},"blurEnabled":{"default":false,"description":"Whether blur effect is enabled.","type":"boolean"},"blurRadius":{"default":10,"description":"Blur radius in pixels.","type":"number"},"brightnessEnabled":{"default":false,"description":"Whether brightness effect is enabled.","type":"boolean"},"brightness":{"default":0,"description":"Brightness level (-1 to 1).","type":"number"},"sepiaEnabled":{"default":false,"description":"Whether sepia effect is enabled.","type":"boolean"},"grayscaleEnabled":{"default":false,"description":"Whether grayscale effect is enabled.","type":"boolean"},"filters":{"default":{},"description":"Applied image filters keyed by filter name.","$ref":"#/$defs/Filters"},"shadowEnabled":{"default":false,"description":"Whether shadow is enabled.","type":"boolean"},"shadowBlur":{"default":5,"description":"Shadow blur radius in pixels.","type":"number"},"shadowOffsetX":{"default":0,"description":"Shadow horizontal offset in pixels.","type":"number"},"shadowOffsetY":{"default":0,"description":"Shadow vertical offset in pixels.","type":"number"},"shadowColor":{"default":"black","description":"Shadow color.","type":"string"},"shadowOpacity":{"default":1,"description":"Shadow opacity (0-1).","type":"number"},"visible":{"default":true,"description":"Whether the element is visible.","type":"boolean"},"draggable":{"default":true,"description":"Whether the element can be dragged.","type":"boolean"},"resizable":{"default":true,"description":"Whether the element can be resized.","type":"boolean"},"selectable":{"default":true,"description":"Whether the element can be selected.","type":"boolean"},"removable":{"default":true,"description":"Whether the element can be removed.","type":"boolean"},"contentEditable":{"default":true,"description":"Whether the element content can be edited.","type":"boolean"},"styleEditable":{"default":true,"description":"Whether the element style can be edited.","type":"boolean"},"alwaysOnTop":{"default":false,"description":"Whether the element stays on top of others.","type":"boolean"},"showInExport":{"default":true,"description":"Whether the element appears in exports.","type":"boolean"},"fit":{"description":"`cover` fills the frame and crops the source; `contain` shows the whole source. Unset, the crop fields apply.","type":"string","enum":["cover","contain"]},"focus":{"description":"Where the source sits when `fit` is set: 0 is the left or top edge, 1 the right or bottom; 0.5 by default.","type":"object","properties":{"x":{"type":"number","minimum":0,"maximum":1},"y":{"type":"number","minimum":0,"maximum":1}},"required":["x","y"]},"src":{"default":"","description":"URL or data URI of the image file.","type":"string"},"cropX":{"default":0,"description":"Crop X offset as a fraction (0-1).","type":"number"},"cropY":{"default":0,"description":"Crop Y offset as a fraction (0-1).","type":"number"},"cropWidth":{"default":1,"description":"Crop width as a fraction (0-1).","type":"number"},"cropHeight":{"default":1,"description":"Crop height as a fraction (0-1).","type":"number"},"cornerRadius":{"default":0,"description":"Corner radius in pixels.","type":"number"},"flipX":{"default":false,"description":"Whether the image is flipped horizontally.","type":"boolean"},"flipY":{"default":false,"description":"Whether the image is flipped vertically.","type":"boolean"},"clipSrc":{"default":"","description":"URL or data URI for a clipping mask.","type":"string"},"borderColor":{"default":"black","description":"Border color.","type":"string"},"borderSize":{"default":0,"description":"Border width in pixels.","type":"number"},"keepRatio":{"default":true,"description":"Whether to maintain aspect ratio when resizing.","type":"boolean"},"stretchEnabled":{"default":false,"description":"Whether stretch mode is enabled.","type":"boolean"}},"required":["id","type"]},{"type":"object","properties":{"bindings":{"description":"Variable names bound to element properties.","type":"object","properties":{"src":{"type":"string","pattern":"^[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*$"},"visible":{"type":"string","pattern":"^[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*$"}},"additionalProperties":false},"id":{"type":"string","description":"Unique identifier for the element."},"type":{"type":"string","const":"video","description":"Element type identifier."},"name":{"default":"","description":"Display name for the element.","type":"string"},"href":{"description":"Click destination: an http(s), `mailto:` or `tel:` URL, or `#` and a page ID. A group's link applies to each child without one.","type":"string"},"custom":{"description":"Custom data attached to the element."},"x":{"default":0,"description":"X position in pixels.","type":"number"},"y":{"default":0,"description":"Y position in pixels.","type":"number"},"width":{"default":100,"description":"Width in pixels. A value of 0 or less reads as 1.","type":"number"},"height":{"default":100,"description":"Height in pixels. A value of 0 or less reads as 1.","type":"number"},"rotation":{"default":0,"description":"Rotation angle in degrees.","type":"number"},"opacity":{"default":1,"description":"Opacity level (0-1).","type":"number"},"blendMode":{"description":"How the element composites with the content beneath it. Omitted means normal.","$ref":"#/$defs/BlendMode"},"animations":{"default":[],"description":"The element's animations, at most one of each `type`, so an 'enter', an 'exit' and a 'loop' can play together. A group's animations play on top of its children's.","type":"array","items":{"$ref":"#/$defs/Animation"}},"blurEnabled":{"default":false,"description":"Whether blur effect is enabled.","type":"boolean"},"blurRadius":{"default":10,"description":"Blur radius in pixels.","type":"number"},"brightnessEnabled":{"default":false,"description":"Whether brightness effect is enabled.","type":"boolean"},"brightness":{"default":0,"description":"Brightness level (-1 to 1).","type":"number"},"sepiaEnabled":{"default":false,"description":"Whether sepia effect is enabled.","type":"boolean"},"grayscaleEnabled":{"default":false,"description":"Whether grayscale effect is enabled.","type":"boolean"},"filters":{"default":{},"description":"Applied image filters keyed by filter name.","$ref":"#/$defs/Filters"},"shadowEnabled":{"default":false,"description":"Whether shadow is enabled.","type":"boolean"},"shadowBlur":{"default":5,"description":"Shadow blur radius in pixels.","type":"number"},"shadowOffsetX":{"default":0,"description":"Shadow horizontal offset in pixels.","type":"number"},"shadowOffsetY":{"default":0,"description":"Shadow vertical offset in pixels.","type":"number"},"shadowColor":{"default":"black","description":"Shadow color.","type":"string"},"shadowOpacity":{"default":1,"description":"Shadow opacity (0-1).","type":"number"},"visible":{"default":true,"description":"Whether the element is visible.","type":"boolean"},"draggable":{"default":true,"description":"Whether the element can be dragged.","type":"boolean"},"resizable":{"default":true,"description":"Whether the element can be resized.","type":"boolean"},"selectable":{"default":true,"description":"Whether the element can be selected.","type":"boolean"},"removable":{"default":true,"description":"Whether the element can be removed.","type":"boolean"},"contentEditable":{"default":true,"description":"Whether the element content can be edited.","type":"boolean"},"styleEditable":{"default":true,"description":"Whether the element style can be edited.","type":"boolean"},"alwaysOnTop":{"default":false,"description":"Whether the element stays on top of others.","type":"boolean"},"showInExport":{"default":true,"description":"Whether the element appears in exports.","type":"boolean"},"fit":{"description":"`cover` fills the frame and crops the source; `contain` shows the whole source. Unset, the crop fields apply.","type":"string","enum":["cover","contain"]},"focus":{"description":"Where the source sits when `fit` is set: 0 is the left or top edge, 1 the right or bottom; 0.5 by default.","type":"object","properties":{"x":{"type":"number","minimum":0,"maximum":1},"y":{"type":"number","minimum":0,"maximum":1}},"required":["x","y"]},"src":{"default":"","description":"URL or data URI of the image file.","type":"string"},"cropX":{"default":0,"description":"Crop X offset as a fraction (0-1).","type":"number"},"cropY":{"default":0,"description":"Crop Y offset as a fraction (0-1).","type":"number"},"cropWidth":{"default":1,"description":"Crop width as a fraction (0-1).","type":"number"},"cropHeight":{"default":1,"description":"Crop height as a fraction (0-1).","type":"number"},"cornerRadius":{"default":0,"description":"Corner radius in pixels.","type":"number"},"flipX":{"default":false,"description":"Whether the image is flipped horizontally.","type":"boolean"},"flipY":{"default":false,"description":"Whether the image is flipped vertically.","type":"boolean"},"clipSrc":{"default":"","description":"URL or data URI for a clipping mask.","type":"string"},"borderColor":{"default":"black","description":"Border color.","type":"string"},"borderSize":{"default":0,"description":"Border width in pixels.","type":"number"},"keepRatio":{"default":false,"description":"Whether to maintain aspect ratio when resizing.","type":"boolean"},"stretchEnabled":{"default":false,"description":"Whether stretch mode is enabled.","type":"boolean"},"duration":{"default":0,"description":"Video duration in milliseconds.","type":"number"},"startTime":{"default":0,"description":"Start offset (0-1).","type":"number"},"endTime":{"default":1,"description":"End offset (0-1).","type":"number"},"volume":{"default":1,"description":"Volume (0-1).","type":"number"},"speed":{"default":1,"description":"Playback speed multiplier (1 = normal).","type":"number"}},"required":["id","type"]},{"type":"object","properties":{"bindings":{"description":"Variable names bound to element properties.","type":"object","properties":{"visible":{"type":"string","pattern":"^[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*$"}},"additionalProperties":false},"id":{"type":"string","description":"Unique identifier for the element."},"type":{"type":"string","const":"table","description":"Element type identifier."},"name":{"default":"","description":"Display name for the element.","type":"string"},"href":{"description":"Click destination: an http(s), `mailto:` or `tel:` URL, or `#` and a page ID. A group's link applies to each child without one.","type":"string"},"custom":{"description":"Custom data attached to the element."},"x":{"default":0,"description":"X position in pixels.","type":"number"},"y":{"default":0,"description":"Y position in pixels.","type":"number"},"width":{"default":300,"description":"Width in pixels. A value of 0 or less reads as 1.","type":"number"},"height":{"default":200,"description":"Height in pixels. A value of 0 or less reads as 1.","type":"number"},"rotation":{"default":0,"description":"Rotation angle in degrees.","type":"number"},"opacity":{"default":1,"description":"Opacity level (0-1).","type":"number"},"blendMode":{"description":"How the element composites with the content beneath it. Omitted means normal.","$ref":"#/$defs/BlendMode"},"animations":{"default":[],"description":"The element's animations, at most one of each `type`, so an 'enter', an 'exit' and a 'loop' can play together. A group's animations play on top of its children's.","type":"array","items":{"$ref":"#/$defs/Animation"}},"visible":{"default":true,"description":"Whether the element is visible.","type":"boolean"},"draggable":{"default":true,"description":"Whether the element can be dragged.","type":"boolean"},"resizable":{"default":true,"description":"Whether the element can be resized.","type":"boolean"},"selectable":{"default":true,"description":"Whether the element can be selected.","type":"boolean"},"removable":{"default":true,"description":"Whether the element can be removed.","type":"boolean"},"contentEditable":{"default":true,"description":"Whether the element content can be edited.","type":"boolean"},"styleEditable":{"default":true,"description":"Whether the element style can be edited.","type":"boolean"},"alwaysOnTop":{"default":false,"description":"Whether the element stays on top of others.","type":"boolean"},"showInExport":{"default":true,"description":"Whether the element appears in exports.","type":"boolean"},"rows":{"default":3,"description":"Number of rows.","type":"number"},"cols":{"default":3,"description":"Number of columns.","type":"number"},"colWidths":{"default":[],"description":"Column width fractions (sum to 1).","type":"array","items":{"type":"number"}},"rowHeights":{"default":[],"description":"Row height fractions (sum to 1).","type":"array","items":{"type":"number"}},"cells":{"default":[],"description":"Flat cell array in row-major order.","type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the cell."},"type":{"default":"tablecell","description":"Cell type identifier.","type":"string","const":"tablecell"},"text":{"default":"","description":"Text shown in the cell: plain, or rich HTML. `{{name}}` prints a variable; `<a href>` links the words it wraps.","type":"string"},"opacity":{"description":"Opacity level (0-1).","type":"number"},"rowSpan":{"description":"Number of rows this cell spans.","type":"number"},"colSpan":{"description":"Number of columns this cell spans.","type":"number"},"mergedInto":{"description":"Id of the cell this one is merged into, if any.","type":"string"},"name":{"description":"Display name for the cell.","type":"string"},"custom":{"description":"Custom data attached to the cell."},"borders":{"description":"Per-side border overrides for this cell.","type":"object","properties":{"top":{"description":"Top border override for this cell.","$ref":"#/$defs/BorderSide"},"right":{"description":"Right border override for this cell.","$ref":"#/$defs/BorderSide"},"bottom":{"description":"Bottom border override for this cell.","$ref":"#/$defs/BorderSide"},"left":{"description":"Left border override for this cell.","$ref":"#/$defs/BorderSide"}}},"fontSize":{"description":"Font size in pixels (inherits from the table when omitted, minimum 1).","type":"number"},"fontFamily":{"description":"Font family name (inherits from the table when omitted).","type":"string"},"fontWeight":{"description":"Font weight: 'normal', 'bold', or numeric string (inherits from the table when omitted).","type":"string"},"fontStyle":{"description":"Font style: 'normal' or 'italic' (inherits from the table when omitted).","type":"string"},"textDecoration":{"description":"Text decoration, e.g. underline, line-through (inherits from the table when omitted).","type":"string"},"textTransform":{"description":"Text transform: uppercase, lowercase, capitalize, none (inherits from the table when omitted).","type":"string"},"fill":{"description":"Text color (inherits from the table when omitted).","type":"string"},"align":{"description":"Horizontal alignment: left, center, right, justify (inherits from the table when omitted).","type":"string"},"verticalAlign":{"description":"Vertical alignment: top, middle, bottom (inherits from the table when omitted).","type":"string"},"lineHeight":{"description":"Line height multiplier or 'auto' (inherits from the table when omitted).","type":["number","string"]},"letterSpacing":{"description":"Letter spacing as a fraction of font size (inherits from the table when omitted).","type":"number"},"strokeWidth":{"description":"Stroke width in pixels (inherits from the table when omitted).","type":"number"},"stroke":{"description":"Stroke color (inherits from the table when omitted).","type":"string"},"cellBackground":{"description":"Cell background color (inherits from the table when omitted).","type":"string"},"cellPaddingTop":{"description":"Space between the text and the top of the cell, in pixels (inherits from the table when omitted).","type":"number"},"cellPaddingRight":{"description":"Space between the text and the right of the cell, in pixels (inherits from the table when omitted).","type":"number"},"cellPaddingBottom":{"description":"Space between the text and the bottom of the cell, in pixels (inherits from the table when omitted).","type":"number"},"cellPaddingLeft":{"description":"Space between the text and the left of the cell, in pixels (inherits from the table when omitted).","type":"number"},"cellPadding":{"description":"Deprecated input: all four cell paddings at once. migrateDesign expands it; never written.","type":"number"}},"required":["id"]}},"borderColor":{"default":"#000000","description":"Default border color for the table grid.","type":"string"},"borderWidth":{"default":1,"description":"Default border width in pixels.","type":"number"},"borderStyle":{"default":"solid","description":"Default border style.","type":"string","enum":["solid","dashed","dotted","none"]},"fontSize":{"default":30,"description":"Default font size in pixels for cells (minimum 1).","type":"number"},"fontFamily":{"default":"Roboto","description":"Default font family name for cells.","type":"string"},"fontWeight":{"default":"normal","description":"Default font weight: 'normal', 'bold', or numeric string.","type":"string"},"fontStyle":{"default":"normal","description":"Default font style: 'normal' or 'italic'.","type":"string"},"textDecoration":{"default":"","description":"Default text decoration (e.g. underline, line-through).","type":"string"},"textTransform":{"default":"none","description":"Default text transform: uppercase, lowercase, capitalize, none.","type":"string"},"fill":{"default":"black","description":"Default text color for cells.","type":"string"},"align":{"default":"center","description":"Default horizontal alignment: left, center, right, justify.","type":"string"},"verticalAlign":{"default":"middle","description":"Default vertical alignment: top, middle, bottom.","type":"string"},"lineHeight":{"default":1.2,"description":"Default line height multiplier or 'auto'.","type":["number","string"]},"letterSpacing":{"default":0,"description":"Default letter spacing as a fraction of font size.","type":"number"},"strokeWidth":{"default":0,"description":"Default stroke width in pixels.","type":"number"},"stroke":{"default":"black","description":"Default stroke color.","type":"string"},"cellBackground":{"default":"transparent","description":"Default cell background color.","type":"string"},"cellPaddingTop":{"default":4,"description":"Default space between the text and the top of a cell, in pixels.","type":"number"},"cellPaddingRight":{"default":4,"description":"Default space between the text and the right of a cell, in pixels.","type":"number"},"cellPaddingBottom":{"default":4,"description":"Default space between the text and the bottom of a cell, in pixels.","type":"number"},"cellPaddingLeft":{"default":4,"description":"Default space between the text and the left of a cell, in pixels.","type":"number"},"cellPadding":{"description":"Deprecated input: all four default cell paddings at once. migrateDesign expands it; never written.","type":"number"}},"required":["id","type"]},{"type":"object","properties":{"bindings":{"description":"Variable names bound to element properties.","type":"object","properties":{"visible":{"type":"string","pattern":"^[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*$"}},"additionalProperties":false},"id":{"type":"string","description":"Unique identifier for the element."},"type":{"type":"string","const":"group","description":"Element type identifier."},"name":{"default":"","description":"Display name for the element.","type":"string"},"custom":{"description":"Custom data attached to the element."},"href":{"description":"Click destination: an http(s), `mailto:` or `tel:` URL, or `#` and a page ID. A group's link applies to each child without one.","type":"string"},"opacity":{"default":1,"description":"Opacity level (0-1).","type":"number"},"blendMode":{"description":"How the group composites with the content beneath it. Omitted means pass-through: children blend with that content directly. Any other mode composites the children together first.","type":"string","enum":["pass-through","normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]},"visible":{"default":true,"description":"Whether the element is visible.","type":"boolean"},"selectable":{"default":true,"description":"Whether the element can be selected.","type":"boolean"},"removable":{"default":true,"description":"Whether the element can be removed.","type":"boolean"},"alwaysOnTop":{"default":false,"description":"Whether the element stays on top of others.","type":"boolean"},"showInExport":{"default":true,"description":"Whether the element appears in exports.","type":"boolean"},"animations":{"default":[],"description":"The element's animations, at most one of each `type`, so an 'enter', an 'exit' and a 'loop' can play together. A group's animations play on top of its children's.","type":"array","items":{"$ref":"#/$defs/Animation"}},"children":{"default":[],"description":"Child elements in this group.","type":"array","items":{"$ref":"#/$defs/__schema0"}}},"required":["id","type"]}]},"BlendMode":{"type":"string","enum":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]},"Animation":{"type":"object","properties":{"delay":{"default":0,"description":"Time in milliseconds, measured on the element's page, not on the whole design. On 'enter': how long after the page starts the element appears. It is hidden until then. On 'exit': how long before the page ends the element disappears. The exit finishes at that moment, and the element stays hidden after it. On 'loop': how long after the page starts the first cycle begins. It does not wait for the entrance, so a loop can be mid-cycle when the element appears. Until then the element is at rest. kenBurns ignores it, and letterWave also waits for an entrance that is a text preset to finish.","type":"number"},"duration":{"default":500,"description":"Time in milliseconds. On 'enter': how long the entrance plays, from its `delay`. On 'exit': how long the exit plays, up to the moment the element disappears. If the two together are longer than the element's time on the page, both play faster by the same factor to fit. On 'loop': the length of one cycle. Cycles repeat until the element disappears or the page ends. kenBurns ignores it and plays once across the element's whole time on the page. The default suits a transition of the whole element. Picking a preset in the editor sets a longer one: 1000 for lineRise, wordRise, wordFade, letterPop, wordBlur, lineWipe and linePeek, 50 per letter from 1000 to 4000 for typewriter, 4000 for rotate, 2500 for float, 2000 for letterWave and glow, 1500 for blink and pulse, and 1000 for shake.","type":"number"},"enabled":{"default":true,"description":"Whether the animation plays. A disabled 'enter' or 'exit' also loses its `delay`, so the element is on the page from its start or to its end. To time an element with no transition, keep it enabled with the name 'none'.","type":"boolean"},"type":{"type":"string","enum":["enter","exit","loop"],"description":"Animation phase: 'enter' brings the element onto the page, 'exit' takes it off, and 'loop' repeats while it is there, also during the entrance and the exit."},"name":{"default":"none","description":"Preset to play. Which names are valid depends on `type`. On 'enter' and 'exit': 'none' | 'fade' | 'move' | 'zoom' | 'pop' | 'rise' | 'flip' | 'growTurn' | 'wipe' | 'blur' | 'count' | 'typewriter' | 'lineRise' | 'wordRise' | 'wordFade' | 'letterPop' | 'wordBlur' | 'lineWipe' | 'linePeek'. On 'loop': 'none' | 'rotate' | 'blink' | 'bounce' | 'pulse' | 'float' | 'shake' | 'glow' | 'kenBurns' | 'letterWave'. Use a name only on its own type: a fade on 'loop' plays once and leaves the element hidden. An unknown name passes validation, logs a console error and does not animate. none is a hard cut: the element still appears or disappears at its `delay`, with no transition, and `duration` is ignored. As entrances: fade fades in, move slides in along a straight line, zoom scales into place, pop grows into place and fades in over its first third, rise moves up into place while fading in, flip turns half round about its vertical center line from its mirrored back, growTurn turns into place from half size while fading in, wipe shows the element behind a travelling edge, blur comes into focus while fading in, and count counts the first number in the text up to its value, keeping the style of the text and the format of the number, such as its thousands separator. An exit plays the same preset backwards, except that move, rise, growTurn and wipe carry on the way they were going. Presets that scale keep the center of the element in place. The text presets play on each unit of the text in turn, and `duration` covers them all: typewriter shows letters, letterPop pops letters, wordRise, wordFade and wordBlur play rise, fade and blur on words, lineRise and lineWipe play rise and wipe on lines, and linePeek slides each line into place behind a wipe's edge, clipped to the line's own row. An exit runs from the last unit back to the first, and a linePeek line carries on the way it came. As loops: rotate turns clockwise once per cycle, blink fades out and back, pulse grows a little and back, float lifts and settles, shake swings side to side and dies out within the cycle, glow swells and fades a halo around the element, letterWave bobs each letter in turn, and kenBurns zooms, and can pan, inside the frame of the element. bounce shrinks and grows back: the editor no longer offers it, so prefer pulse. Element limits: count, the text presets and letterWave are for 'text' elements. count plays nothing without a number in the text. Curved text or any other element plays a text preset whole, as its base preset: typewriter and wordFade as fade, lineRise and wordRise as rise, letterPop as pop, wordBlur as blur, lineWipe and linePeek as wipe and letterWave as float. blur blurs only 'text', 'image', 'svg', 'video' and 'gif', and any other element only fades. glow plays nothing on 'table' and 'group'. kenBurns plays on the crop, so only on 'image', 'svg', 'video' and 'gif'. Every other preset plays on every element, groups included.","type":"string"},"data":{"default":{},"description":"Object of options for the preset in `name`. Every option is optional, and a preset not listed here takes none. `strength` is always a multiplier, default 1, and the editor offers 0.1 to 3. move: `direction` 'right' | 'left' | 'up' | 'down' | 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left', default 'right', the way the element travels on both 'enter' and 'exit'. `strength` 1 travels 20% of the shorter side of the page: it covers that distance, not the way to the edge of the page. zoom: `direction` 'in' | 'out', default 'in'. 'in' starts smaller and grows into place, 'out' starts larger and shrinks into place, and any other value plays as 'out'. `strength` 1 starts 25% away from full size. pop: `strength` 1 starts from nothing, and 0.5 from half size. rise: `strength` 1 travels 5% of the shorter side of the page. growTurn: `strength` 1 turns 180 degrees. wipe: `direction` 'right' | 'left' | 'up' | 'down', default 'right', the way its edge travels. lineWipe: `direction` as wipe; without one, each line wipes in its own reading direction. linePeek: `direction` 'right' | 'left' | 'up' | 'down', default 'up', the way each line travels. blur: `strength` 1 adds 20 to `blurRadius` at its most blurred. count: `from`, a number, default 0, where the count starts on 'enter' and ends on 'exit'. bounce: `strength` 1 shrinks to a third of the size, and 0.5 to half. pulse: `strength` 1 grows 8%. float: `strength` 1 lifts 2% of the shorter side of the page. shake: `strength` 1 swings 1.5% of the shorter side of the page. letterWave: `strength` 1 lifts each letter 0.3 of its font size. glow: `strength` 1 spreads 2% of the shorter side of the page. It has no color option: it uses the element's `shadowColor` when `shadowEnabled` is true or `shadowColor` is not 'black', else its `fill` (`color` on a line), else black. So a `shadowColor` with `shadowEnabled` false glows in that color and shows no shadow at rest. kenBurns: `zoom` 'in' | 'out', default 'in'. 'in' narrows the saved crop, and 'out' widens to it. `direction` 'none' | 'right' | 'left' | 'up' | 'down', default 'none', the way the view pans. `strength` 1 narrows the crop by 15%. A design below `schemaVersion` 5, or with none, has its move `strength` rescaled on load to keep the fixed 200px those versions travelled."},"easing":{"description":"Timing curve: 'linear' | 'easeIn' | 'easeOut' | 'easeInOut' | 'backIn' | 'backOut' | 'backInOut'. Missing (or unknown) plays linear. Setting a preset in the editor writes its recommended curve: fade, move, zoom, blur, count, rise, flip, growTurn and wipe ease out on enter and ease in on exit, pop overshoots (backOut on enter, backIn on exit), blink and bounce ease in and out on each sweep, kenBurns eases in and out across the element's time, a text preset eases each of its letters, words or lines as the preset it plays, and every other animation is linear.","type":"string"}},"required":["type"]},"Filters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"intensity":{"default":1,"description":"Filter intensity (-1 to 1).","type":"number"}}}},"BorderSide":{"type":"object","properties":{"color":{"description":"Border color for this side.","type":"string"},"width":{"description":"Border width in pixels for this side.","type":"number"},"style":{"description":"Border style for this side.","type":"string","enum":["solid","dashed","dotted","none"]}}}},"$id":"https://schema.polotno.com/v1/design.schema.json","title":"Polotno Design"}
|
package/lib/migrate.d.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keys the migration reads and deletes. They are the design's own retired
|
|
3
|
+
* fields, never client data: `parseDesign` must not restore them, or the next
|
|
4
|
+
* parse would replay the old value over later edits.
|
|
5
|
+
*/
|
|
6
|
+
export declare const MIGRATED_AWAY_KEYS: ReadonlySet<string>;
|
|
1
7
|
export interface MigrateOptions {
|
|
2
8
|
/**
|
|
3
9
|
* Whether the consumer renders text with the modern engines (HTML /
|
|
@@ -22,6 +28,6 @@ export interface MigrateOptions {
|
|
|
22
28
|
/**
|
|
23
29
|
* Bring a design up to `CURRENT_SCHEMA_VERSION`. Returns a new object; the
|
|
24
30
|
* input is never mutated. A design already at the current version is returned
|
|
25
|
-
* unchanged apart from the clone.
|
|
31
|
+
* unchanged apart from the clone and the deprecated inputs (see the header).
|
|
26
32
|
*/
|
|
27
33
|
export declare function migrateDesign<T>(json: T, options?: MigrateOptions): T;
|
package/lib/migrate.js
CHANGED
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
// the bottom layer and dependency-free, and migrations run before any model
|
|
12
12
|
// or renderer exists. A change that can only be decided by measuring text
|
|
13
13
|
// is not a migration — stamp intent instead and let each renderer resolve it
|
|
14
|
-
// at paint time.
|
|
15
|
-
//
|
|
16
|
-
// rect, and every renderer
|
|
14
|
+
// at paint time. The v2→3 step is exactly that pattern: it records
|
|
15
|
+
// `backgroundShape: 'box'` ("paint the frame") rather than baking in a
|
|
16
|
+
// rect's size, and every renderer draws the box from the element.
|
|
17
17
|
// 2. **A missing `schemaVersion` means 0**, the oldest format — not the current
|
|
18
18
|
// one. Designs written before the field existed are precisely the ones that
|
|
19
19
|
// need migrating, so absence has to mean "old". `store.toJSON()` always
|
|
@@ -30,10 +30,24 @@
|
|
|
30
30
|
// await jsonToPDF(migrated); // and every converter
|
|
31
31
|
//
|
|
32
32
|
// `migrateDesign` bumps `schemaVersion` to the current one and writes the
|
|
33
|
-
// decision into the design (`
|
|
33
|
+
// decision into the design (`backgroundShape`), so the second pass through any
|
|
34
34
|
// entry point is a no-op and every renderer reads the same resolved intent.
|
|
35
|
+
//
|
|
36
|
+
// **Deprecated inputs are expanded at every version.** `cellPadding` (table and
|
|
37
|
+
// cell) became four sides in v6, but client code may still write it into a v6
|
|
38
|
+
// design until polotno 5.0 removes the fallback. Nothing in the SDK writes it,
|
|
39
|
+
// so when it is present it is the client's intent: it replaces the four sides.
|
|
35
40
|
import { CURRENT_SCHEMA_VERSION } from './schema.js';
|
|
36
41
|
import { DESIGN_SIZE, TEXT_DEFAULTS } from './defaults.js';
|
|
42
|
+
/**
|
|
43
|
+
* Keys the migration reads and deletes. They are the design's own retired
|
|
44
|
+
* fields, never client data: `parseDesign` must not restore them, or the next
|
|
45
|
+
* parse would replay the old value over later edits.
|
|
46
|
+
*/
|
|
47
|
+
export const MIGRATED_AWAY_KEYS = new Set([
|
|
48
|
+
'cellPadding',
|
|
49
|
+
'legacyBackground',
|
|
50
|
+
]);
|
|
37
51
|
/** Named effects that never used the -100..100 intensity range. */
|
|
38
52
|
const UNSCALED_FILTERS = ['warm', 'cold', 'natural'];
|
|
39
53
|
/** The tags Quill actually emitted. Anything else is not evidence. */
|
|
@@ -111,10 +125,40 @@ function forEveryElement(pages, cb) {
|
|
|
111
125
|
walk(page);
|
|
112
126
|
}
|
|
113
127
|
}
|
|
128
|
+
const CELL_PADDING_SIDES = [
|
|
129
|
+
'cellPaddingTop',
|
|
130
|
+
'cellPaddingRight',
|
|
131
|
+
'cellPaddingBottom',
|
|
132
|
+
'cellPaddingLeft',
|
|
133
|
+
];
|
|
134
|
+
/**
|
|
135
|
+
* The deprecated `cellPadding` of a table and of its cells, as the four sides
|
|
136
|
+
* it stands for (see the header). A value that is not a number (NaN arrives
|
|
137
|
+
* here as null) is dropped without touching the sides.
|
|
138
|
+
*/
|
|
139
|
+
function expandCellPadding(pages) {
|
|
140
|
+
const expand = (node) => {
|
|
141
|
+
if (!node || typeof node !== 'object' || !('cellPadding' in node))
|
|
142
|
+
return;
|
|
143
|
+
const value = node.cellPadding;
|
|
144
|
+
delete node.cellPadding;
|
|
145
|
+
if (typeof value !== 'number')
|
|
146
|
+
return;
|
|
147
|
+
for (const side of CELL_PADDING_SIDES)
|
|
148
|
+
node[side] = value;
|
|
149
|
+
};
|
|
150
|
+
forEveryElement(pages, (element) => {
|
|
151
|
+
if (element.type !== 'table')
|
|
152
|
+
return;
|
|
153
|
+
expand(element);
|
|
154
|
+
if (Array.isArray(element.cells))
|
|
155
|
+
element.cells.forEach(expand);
|
|
156
|
+
});
|
|
157
|
+
}
|
|
114
158
|
/**
|
|
115
159
|
* Bring a design up to `CURRENT_SCHEMA_VERSION`. Returns a new object; the
|
|
116
160
|
* input is never mutated. A design already at the current version is returned
|
|
117
|
-
* unchanged apart from the clone.
|
|
161
|
+
* unchanged apart from the clone and the deprecated inputs (see the header).
|
|
118
162
|
*/
|
|
119
163
|
export function migrateDesign(json, options = {}) {
|
|
120
164
|
// No default for modernizeTextBackground: `undefined` is a real state here
|
|
@@ -183,8 +227,11 @@ export function migrateDesign(json, options = {}) {
|
|
|
183
227
|
: !modernizeTextBackground;
|
|
184
228
|
if (stamp) {
|
|
185
229
|
forEveryElement(data.pages, (element) => {
|
|
186
|
-
|
|
187
|
-
|
|
230
|
+
// An explicit shape is the author's: unversioned JSON may be new.
|
|
231
|
+
if (element.type === 'text' &&
|
|
232
|
+
element.backgroundEnabled &&
|
|
233
|
+
element.backgroundShape === undefined) {
|
|
234
|
+
element.backgroundShape = 'box';
|
|
188
235
|
}
|
|
189
236
|
});
|
|
190
237
|
}
|
|
@@ -221,6 +268,20 @@ export function migrateDesign(json, options = {}) {
|
|
|
221
268
|
});
|
|
222
269
|
}
|
|
223
270
|
}
|
|
271
|
+
if (from < 6) {
|
|
272
|
+
// v3–v5 stamped the full-rect background as `legacyBackground: true`. v6
|
|
273
|
+
// draws that rect as `backgroundShape: 'box'` (the frame grown by the
|
|
274
|
+
// spread), so the flag becomes the shape and goes. Exact by construction:
|
|
275
|
+
// a migrated element has no padding, and box is the legacy rect's branch.
|
|
276
|
+
forEveryElement(data.pages, (element) => {
|
|
277
|
+
if (element.type !== 'text' || !('legacyBackground' in element))
|
|
278
|
+
return;
|
|
279
|
+
if (element.legacyBackground === true)
|
|
280
|
+
element.backgroundShape = 'box';
|
|
281
|
+
delete element.legacyBackground;
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
expandCellPadding(data.pages);
|
|
224
285
|
data.schemaVersion = CURRENT_SCHEMA_VERSION;
|
|
225
286
|
return data;
|
|
226
287
|
}
|
package/lib/normalize.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// and why a missing `schemaVersion` counts as 0.
|
|
5
5
|
import { designSchemaLenient, parseValidDesign, cloneDropNulls, ELEMENT_TYPES, } from './schema.js';
|
|
6
6
|
import { polotnoError } from './errors.js';
|
|
7
|
-
import { migrateDesign } from './migrate.js';
|
|
7
|
+
import { MIGRATED_AWAY_KEYS, migrateDesign } from './migrate.js';
|
|
8
8
|
import { clampElementSize } from './defaults.js';
|
|
9
9
|
import { fillVariables } from './variables.js';
|
|
10
10
|
export function normalizeDesign(json) {
|
|
@@ -152,7 +152,7 @@ function spliceUnknownElements(design, extracted) {
|
|
|
152
152
|
function restoreClientData(original, design) {
|
|
153
153
|
const restoreKeys = (orig, parsed) => {
|
|
154
154
|
for (const key of Object.keys(orig)) {
|
|
155
|
-
if (orig[key] != null && !(key in parsed))
|
|
155
|
+
if (orig[key] != null && !(key in parsed) && !MIGRATED_AWAY_KEYS.has(key))
|
|
156
156
|
parsed[key] = orig[key];
|
|
157
157
|
}
|
|
158
158
|
};
|
package/lib/schema.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const CURRENT_SCHEMA_VERSION =
|
|
2
|
+
export declare const CURRENT_SCHEMA_VERSION = 6;
|
|
3
3
|
declare const lenient: {
|
|
4
4
|
design: z.ZodObject<{
|
|
5
5
|
variables: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -150,6 +150,11 @@ declare const lenient: {
|
|
|
150
150
|
backgroundOpacity: z.ZodDefault<z.ZodNumber>;
|
|
151
151
|
backgroundCornerRadius: z.ZodDefault<z.ZodNumber>;
|
|
152
152
|
backgroundPadding: z.ZodDefault<z.ZodNumber>;
|
|
153
|
+
backgroundShape: z.ZodOptional<z.ZodString>;
|
|
154
|
+
paddingTop: z.ZodOptional<z.ZodNumber>;
|
|
155
|
+
paddingRight: z.ZodOptional<z.ZodNumber>;
|
|
156
|
+
paddingBottom: z.ZodOptional<z.ZodNumber>;
|
|
157
|
+
paddingLeft: z.ZodOptional<z.ZodNumber>;
|
|
153
158
|
borderColor: z.ZodDefault<z.ZodString>;
|
|
154
159
|
borderSize: z.ZodDefault<z.ZodNumber>;
|
|
155
160
|
curveEnabled: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -893,6 +898,10 @@ declare const lenient: {
|
|
|
893
898
|
strokeWidth: z.ZodOptional<z.ZodNumber>;
|
|
894
899
|
stroke: z.ZodOptional<z.ZodString>;
|
|
895
900
|
cellBackground: z.ZodOptional<z.ZodString>;
|
|
901
|
+
cellPaddingTop: z.ZodOptional<z.ZodNumber>;
|
|
902
|
+
cellPaddingRight: z.ZodOptional<z.ZodNumber>;
|
|
903
|
+
cellPaddingBottom: z.ZodOptional<z.ZodNumber>;
|
|
904
|
+
cellPaddingLeft: z.ZodOptional<z.ZodNumber>;
|
|
896
905
|
cellPadding: z.ZodOptional<z.ZodNumber>;
|
|
897
906
|
}, z.core.$strip>>>;
|
|
898
907
|
borderColor: z.ZodDefault<z.ZodString>;
|
|
@@ -917,7 +926,11 @@ declare const lenient: {
|
|
|
917
926
|
strokeWidth: z.ZodDefault<z.ZodNumber>;
|
|
918
927
|
stroke: z.ZodDefault<z.ZodString>;
|
|
919
928
|
cellBackground: z.ZodDefault<z.ZodString>;
|
|
920
|
-
|
|
929
|
+
cellPaddingTop: z.ZodDefault<z.ZodNumber>;
|
|
930
|
+
cellPaddingRight: z.ZodDefault<z.ZodNumber>;
|
|
931
|
+
cellPaddingBottom: z.ZodDefault<z.ZodNumber>;
|
|
932
|
+
cellPaddingLeft: z.ZodDefault<z.ZodNumber>;
|
|
933
|
+
cellPadding: z.ZodOptional<z.ZodNumber>;
|
|
921
934
|
}, z.core.$strip>, z.ZodObject<{
|
|
922
935
|
bindings: z.ZodOptional<z.ZodObject<{
|
|
923
936
|
visible: z.ZodOptional<z.ZodString>;
|
package/lib/schema.js
CHANGED
|
@@ -37,7 +37,7 @@ import { BINDABLE_PROPS } from './variables.js';
|
|
|
37
37
|
import { z } from 'zod';
|
|
38
38
|
import { polotnoError } from './errors.js';
|
|
39
39
|
import { ANIMATION_EASINGS, BLEND_MODES, GROUP_BLEND_MODES, MIN_FONT_SIZE, clampFontSize, DESIGN_SIZE, TEXT_DEFAULTS, } from './defaults.js';
|
|
40
|
-
export const CURRENT_SCHEMA_VERSION =
|
|
40
|
+
export const CURRENT_SCHEMA_VERSION = 6;
|
|
41
41
|
// `o` is the object constructor (`z.object` for lenient, `z.strictObject` for
|
|
42
42
|
// canonical), passed concretely so its precise generic return type is preserved
|
|
43
43
|
// — a `strict ? z.strictObject : z.object` ternary would widen to a union and
|
|
@@ -400,7 +400,31 @@ function build(o) {
|
|
|
400
400
|
backgroundPadding: z
|
|
401
401
|
.number()
|
|
402
402
|
.default(0.5)
|
|
403
|
-
.describe('
|
|
403
|
+
.describe('How far the text background and border reach past what they paint around (the spread), as a fraction of half a line at the authored font size. Never moves the text.'),
|
|
404
|
+
// A plain string, not an enum, for the reason `textOverflow` gives below:
|
|
405
|
+
// the editor's model throws on an enum value it does not know.
|
|
406
|
+
backgroundShape: z
|
|
407
|
+
.string()
|
|
408
|
+
.optional()
|
|
409
|
+
.describe("What the text background and border paint around: 'lines' (each line, the default) or 'box' (the element's frame). Unknown values count as 'lines'."),
|
|
410
|
+
// Text padding (docs/text-padding.md). Optional with NO default, like the
|
|
411
|
+
// text-sizing fields, so existing JSON and every snapshot stay unchanged.
|
|
412
|
+
paddingTop: z
|
|
413
|
+
.number()
|
|
414
|
+
.optional()
|
|
415
|
+
.describe('Space between the text and the top edge of its frame, in pixels. Missing means 0.'),
|
|
416
|
+
paddingRight: z
|
|
417
|
+
.number()
|
|
418
|
+
.optional()
|
|
419
|
+
.describe('Space between the text and the right edge of its frame, in pixels. Missing means 0.'),
|
|
420
|
+
paddingBottom: z
|
|
421
|
+
.number()
|
|
422
|
+
.optional()
|
|
423
|
+
.describe('Space between the text and the bottom edge of its frame, in pixels. Missing means 0.'),
|
|
424
|
+
paddingLeft: z
|
|
425
|
+
.number()
|
|
426
|
+
.optional()
|
|
427
|
+
.describe('Space between the text and the left edge of its frame, in pixels. Missing means 0.'),
|
|
404
428
|
borderColor: z.string().default('black').describe('Text box border color.'),
|
|
405
429
|
borderSize: z
|
|
406
430
|
.number()
|
|
@@ -414,10 +438,12 @@ function build(o) {
|
|
|
414
438
|
.number()
|
|
415
439
|
.default(TEXT_DEFAULTS.curvePower)
|
|
416
440
|
.describe('Text curve power (-1 to 1, 0 = straight).'),
|
|
441
|
+
// Accepted so strict validation still passes a design saved before v6;
|
|
442
|
+
// migrateDesign turns it into `backgroundShape: 'box'` and nothing writes it.
|
|
417
443
|
legacyBackground: z
|
|
418
444
|
.boolean()
|
|
419
445
|
.optional()
|
|
420
|
-
.describe(
|
|
446
|
+
.describe("Deprecated input: migrateDesign turns true into backgroundShape 'box'. Never written."),
|
|
421
447
|
// Text sizing. All optional with NO default, so existing JSON and every
|
|
422
448
|
// normalizeDesign snapshot stay unchanged; a missing field means "follow
|
|
423
449
|
// the global flag". @polotno/core/text-sizing resolves them.
|
|
@@ -660,10 +686,28 @@ function build(o) {
|
|
|
660
686
|
.string()
|
|
661
687
|
.optional()
|
|
662
688
|
.describe('Cell background color (inherits from the table when omitted).'),
|
|
689
|
+
cellPaddingTop: z
|
|
690
|
+
.number()
|
|
691
|
+
.optional()
|
|
692
|
+
.describe('Space between the text and the top of the cell, in pixels (inherits from the table when omitted).'),
|
|
693
|
+
cellPaddingRight: z
|
|
694
|
+
.number()
|
|
695
|
+
.optional()
|
|
696
|
+
.describe('Space between the text and the right of the cell, in pixels (inherits from the table when omitted).'),
|
|
697
|
+
cellPaddingBottom: z
|
|
698
|
+
.number()
|
|
699
|
+
.optional()
|
|
700
|
+
.describe('Space between the text and the bottom of the cell, in pixels (inherits from the table when omitted).'),
|
|
701
|
+
cellPaddingLeft: z
|
|
702
|
+
.number()
|
|
703
|
+
.optional()
|
|
704
|
+
.describe('Space between the text and the left of the cell, in pixels (inherits from the table when omitted).'),
|
|
705
|
+
// Deprecated input until polotno 5.0: migrateDesign expands it to the four
|
|
706
|
+
// sides and nothing writes it (docs/text-padding.md §6).
|
|
663
707
|
cellPadding: z
|
|
664
708
|
.number()
|
|
665
709
|
.optional()
|
|
666
|
-
.describe('
|
|
710
|
+
.describe('Deprecated input: all four cell paddings at once. migrateDesign expands it; never written.'),
|
|
667
711
|
});
|
|
668
712
|
// Effect props are nonsensical for tables and not part of its serialized form —
|
|
669
713
|
// omit them via a typed destructure (so `tableShape` keeps precise field types).
|
|
@@ -756,10 +800,28 @@ function build(o) {
|
|
|
756
800
|
.string()
|
|
757
801
|
.default('transparent')
|
|
758
802
|
.describe('Default cell background color.'),
|
|
759
|
-
|
|
803
|
+
cellPaddingTop: z
|
|
804
|
+
.number()
|
|
805
|
+
.default(4)
|
|
806
|
+
.describe('Default space between the text and the top of a cell, in pixels.'),
|
|
807
|
+
cellPaddingRight: z
|
|
760
808
|
.number()
|
|
761
809
|
.default(4)
|
|
762
|
-
.describe('Default cell
|
|
810
|
+
.describe('Default space between the text and the right of a cell, in pixels.'),
|
|
811
|
+
cellPaddingBottom: z
|
|
812
|
+
.number()
|
|
813
|
+
.default(4)
|
|
814
|
+
.describe('Default space between the text and the bottom of a cell, in pixels.'),
|
|
815
|
+
cellPaddingLeft: z
|
|
816
|
+
.number()
|
|
817
|
+
.default(4)
|
|
818
|
+
.describe('Default space between the text and the left of a cell, in pixels.'),
|
|
819
|
+
// Deprecated input until polotno 5.0: migrateDesign expands it to the four
|
|
820
|
+
// sides and nothing writes it (docs/text-padding.md §6).
|
|
821
|
+
cellPadding: z
|
|
822
|
+
.number()
|
|
823
|
+
.optional()
|
|
824
|
+
.describe('Deprecated input: all four default cell paddings at once. migrateDesign expands it; never written.'),
|
|
763
825
|
};
|
|
764
826
|
const groupShape = (element) => ({
|
|
765
827
|
bindings,
|
package/lib/types.d.ts
CHANGED
|
@@ -235,12 +235,34 @@ export interface TextElement extends ShapeAttributes {
|
|
|
235
235
|
backgroundColor: string;
|
|
236
236
|
backgroundOpacity: number;
|
|
237
237
|
backgroundCornerRadius: number;
|
|
238
|
+
/**
|
|
239
|
+
* How far the background and border reach past what they paint around (the
|
|
240
|
+
* spread), as a fraction of half a line at the authored font size. Never
|
|
241
|
+
* moves the text.
|
|
242
|
+
*/
|
|
238
243
|
backgroundPadding: number;
|
|
244
|
+
/**
|
|
245
|
+
* What the background and border paint around: 'lines' (each line, the
|
|
246
|
+
* default) or 'box' (the element's frame). A plain string: unknown values
|
|
247
|
+
* count as 'lines'.
|
|
248
|
+
*/
|
|
249
|
+
backgroundShape?: string;
|
|
250
|
+
/** Space between the text and the top edge of its frame, px. Missing is 0. */
|
|
251
|
+
paddingTop?: number;
|
|
252
|
+
/** Space between the text and the right edge of its frame, px. Missing is 0. */
|
|
253
|
+
paddingRight?: number;
|
|
254
|
+
/** Space between the text and the bottom edge of its frame, px. Missing is 0. */
|
|
255
|
+
paddingBottom?: number;
|
|
256
|
+
/** Space between the text and the left edge of its frame, px. Missing is 0. */
|
|
257
|
+
paddingLeft?: number;
|
|
239
258
|
borderColor: string;
|
|
240
259
|
borderSize: number;
|
|
241
260
|
curveEnabled: boolean;
|
|
242
261
|
curvePower: number;
|
|
243
|
-
/**
|
|
262
|
+
/**
|
|
263
|
+
* @deprecated Input only: `migrateDesign` turns `true` into
|
|
264
|
+
* `backgroundShape: 'box'`. Never written.
|
|
265
|
+
*/
|
|
244
266
|
legacyBackground?: boolean;
|
|
245
267
|
/**
|
|
246
268
|
* 'resize' | 'ellipsis' | 'fit'. A plain string so an unknown future value
|
|
@@ -391,6 +413,14 @@ export interface TableCell {
|
|
|
391
413
|
strokeWidth?: number;
|
|
392
414
|
stroke?: string;
|
|
393
415
|
cellBackground?: string;
|
|
416
|
+
cellPaddingTop?: number;
|
|
417
|
+
cellPaddingRight?: number;
|
|
418
|
+
cellPaddingBottom?: number;
|
|
419
|
+
cellPaddingLeft?: number;
|
|
420
|
+
/**
|
|
421
|
+
* @deprecated Input only until polotno 5.0: `migrateDesign` expands it to
|
|
422
|
+
* the four `cellPadding*` sides. Never written.
|
|
423
|
+
*/
|
|
394
424
|
cellPadding?: number;
|
|
395
425
|
}
|
|
396
426
|
/**
|
|
@@ -424,5 +454,13 @@ export interface TableElement extends Omit<ShapeAttributes, 'blurEnabled' | 'blu
|
|
|
424
454
|
strokeWidth: number;
|
|
425
455
|
stroke: string;
|
|
426
456
|
cellBackground: string;
|
|
427
|
-
|
|
457
|
+
cellPaddingTop: number;
|
|
458
|
+
cellPaddingRight: number;
|
|
459
|
+
cellPaddingBottom: number;
|
|
460
|
+
cellPaddingLeft: number;
|
|
461
|
+
/**
|
|
462
|
+
* @deprecated Input only until polotno 5.0: `migrateDesign` expands it to
|
|
463
|
+
* the four `cellPadding*` sides. Never written.
|
|
464
|
+
*/
|
|
465
|
+
cellPadding?: number;
|
|
428
466
|
}
|
package/lib/variable-text.d.ts
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
export declare const VARIABLE_NAME: RegExp;
|
|
2
|
+
/** Each `{{name}}` token in plain `text`: where it starts and ends, and its name. */
|
|
3
|
+
export declare function variableTokens(text: string): {
|
|
4
|
+
start: number;
|
|
5
|
+
end: number;
|
|
6
|
+
name: string;
|
|
7
|
+
}[];
|
|
2
8
|
export declare function substituteText(text: string, read: (name: string) => string | undefined): string;
|
package/lib/variable-text.js
CHANGED
|
@@ -4,6 +4,14 @@ export const VARIABLE_NAME = new RegExp('^' + NAME + '$');
|
|
|
4
4
|
const TOKEN_SOURCE = '\\{\\{[ \\t]*(' + NAME + ')[ \\t]*\\}\\}';
|
|
5
5
|
const TOKEN = new RegExp(TOKEN_SOURCE, 'g');
|
|
6
6
|
const WHOLE_TOKEN = new RegExp('^' + TOKEN_SOURCE + '$');
|
|
7
|
+
/** Each `{{name}}` token in plain `text`: where it starts and ends, and its name. */
|
|
8
|
+
export function variableTokens(text) {
|
|
9
|
+
return Array.from(text.matchAll(TOKEN), (match) => ({
|
|
10
|
+
start: match.index,
|
|
11
|
+
end: match.index + match[0].length,
|
|
12
|
+
name: match[1],
|
|
13
|
+
}));
|
|
14
|
+
}
|
|
7
15
|
const escapeText = (text) => text.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
|
8
16
|
// Keep the original tags and attributes byte-for-byte. Match within a block's
|
|
9
17
|
// visible runs, and write each replacement in the run containing its first brace.
|
|
@@ -60,10 +68,10 @@ export function substituteText(text, read) {
|
|
|
60
68
|
function flush() {
|
|
61
69
|
// Edit right-to-left so offsets into the untouched prefix stay valid.
|
|
62
70
|
let i = runs.length - 1;
|
|
63
|
-
const edits =
|
|
64
|
-
start
|
|
65
|
-
end
|
|
66
|
-
value: read(
|
|
71
|
+
const edits = variableTokens(body).map(({ start, end, name }) => ({
|
|
72
|
+
start,
|
|
73
|
+
end,
|
|
74
|
+
value: read(name),
|
|
67
75
|
}));
|
|
68
76
|
for (const { start, end, value } of edits.reverse()) {
|
|
69
77
|
if (value === undefined)
|
package/lib/variables.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Bindings, VariableDefinition } from './types.js';
|
|
2
|
-
export { VARIABLE_NAME } from './variable-text.js';
|
|
2
|
+
export { VARIABLE_NAME, variableTokens } from './variable-text.js';
|
|
3
3
|
/** The properties each element type can bind. Any other element binds `visible`. */
|
|
4
4
|
export declare const BINDABLE_PROPS: {
|
|
5
5
|
readonly image: readonly ["src", "visible"];
|
package/lib/variables.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { substituteText } from './variable-text.js';
|
|
2
2
|
import { removeTags } from './text.js';
|
|
3
|
-
export { VARIABLE_NAME } from './variable-text.js';
|
|
3
|
+
export { VARIABLE_NAME, variableTokens } from './variable-text.js';
|
|
4
4
|
import { polotnoError } from './errors.js';
|
|
5
5
|
const MEDIA = ['src', 'visible'];
|
|
6
6
|
const PAINT = ['fill', 'visible'];
|
package/package.json
CHANGED