@polotno/schema 0.11.0 → 0.13.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 CHANGED
@@ -50,6 +50,10 @@ Idempotent and exact for current-format input. It migrates older
50
50
  `schemaVersion` documents up first (see below), and it leaves render-derived
51
51
  values (e.g. text auto-height) for the editor to compute.
52
52
 
53
+ It reads an element `width` or `height` of 0 or less, or `null`, as 1, as the
54
+ editor does when it loads the design. A text `height` of 0 stays 0: it means
55
+ "not measured yet".
56
+
53
57
  ## Schema versions
54
58
 
55
59
  Every design carries a `schemaVersion`. `normalizeDesign` / `parseDesign` migrate
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", "cellPadding"];
1
+ export declare const TABLE_CELL_OVERRIDABLE_KEYS: readonly ['fontSize', 'fontFamily', 'fontWeight', 'fontStyle', 'textDecoration', 'textTransform', 'fill', 'align', 'verticalAlign', 'lineHeight', 'letterSpacing', 'strokeWidth', 'stroke', 'cellBackground', 'cellPadding'];
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
@@ -25,10 +25,8 @@ export declare const resolveTableCellBorder: (cell: Record<string, any>, element
25
25
  * stroke intrudes and the other half lives in the neighbour. `cell` must carry
26
26
  * its grid position (`row`, `col`, and the spans when it spans).
27
27
  *
28
- * Mirrors the editor's `TableCell.borderInsets` (polotno's table-model.ts),
29
- * which is what the canvas places cell text with — that model still owns its
30
- * own copy because it resolves borders through MST views with an isAlive
31
- * guard.
28
+ * The editor's `TableCell.borderInsets` and @polotno/core/table's content
29
+ * box both take it.
32
30
  */
33
31
  export declare const tableCellBorderInsets: (cell: Record<string, any>, element: Record<string, any>) => {
34
32
  top: number;
@@ -38,18 +36,18 @@ export declare const tableCellBorderInsets: (cell: Record<string, any>, element:
38
36
  };
39
37
  export declare const TEXT_DEFAULTS: {
40
38
  readonly fontSize: 14;
41
- readonly fontFamily: "Roboto";
42
- readonly fontWeight: "normal";
43
- readonly fontStyle: "normal";
39
+ readonly fontFamily: 'Roboto';
40
+ readonly fontWeight: 'normal';
41
+ readonly fontStyle: 'normal';
44
42
  readonly lineHeight: 1.2;
45
43
  readonly letterSpacing: 0;
46
- readonly textTransform: "none";
47
- readonly textDecoration: "";
48
- readonly align: "center";
49
- readonly fill: "black";
50
- readonly stroke: "black";
44
+ readonly textTransform: 'none';
45
+ readonly textDecoration: '';
46
+ readonly align: 'center';
47
+ readonly fill: 'black';
48
+ readonly stroke: 'black';
51
49
  readonly strokeWidth: 0;
52
- readonly strokeLineJoin: "round";
50
+ readonly strokeLineJoin: 'round';
53
51
  readonly curveEnabled: false;
54
52
  readonly curvePower: 0.5;
55
53
  };
@@ -80,8 +78,26 @@ export declare const MIN_FONT_SIZE = 1;
80
78
  * the table", which is not a size to clamp.
81
79
  */
82
80
  export declare const clampFontSize: <T extends number | undefined>(size: T) => T;
83
- export declare const BLEND_MODES: readonly ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"];
81
+ /**
82
+ * The smallest width or height an element holds, and the size a stored width
83
+ * or height reads as when it is not a positive finite number: zero, negative,
84
+ * NaN, ±Infinity or null. One rule, no negative-size semantics. The editor's
85
+ * transformer never makes such a box, so only hand-written JSON holds one.
86
+ *
87
+ * The editor's model applies it to every element it loads (polotno's
88
+ * `shape-model.ts`), and the schema's normalize step applies it for every
89
+ * converter, so a 0×70 box is the same 1px column on the Canvas and in every
90
+ * export. Text height is exempt: 0 there means "not measured yet"
91
+ * (@polotno/core's `hasMeasuredHeight`), and the text model keeps it.
92
+ */
93
+ export declare const MIN_ELEMENT_SIZE = 1;
94
+ /**
95
+ * Apply that rule to a stored width or height. A non-number other than null
96
+ * passes through unchanged, so validation still rejects it.
97
+ */
98
+ export declare const clampElementSize: <T>(size: T) => T | number;
99
+ export declare const BLEND_MODES: readonly ['normal', 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', 'saturation', 'color', 'luminosity'];
84
100
  export declare const GROUP_BLEND_MODES: readonly ["pass-through", "normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"];
85
101
  /** The page size, on both sides, of a design that names none. */
86
102
  export declare const DESIGN_SIZE = 1080;
87
- export declare const ANIMATION_EASINGS: readonly ["linear", "easeIn", "easeOut", "easeInOut", "backIn", "backOut", "backInOut"];
103
+ export declare const ANIMATION_EASINGS: readonly ['linear', 'easeIn', 'easeOut', 'easeInOut', 'backIn', 'backOut', 'backInOut'];
package/lib/defaults.js CHANGED
@@ -5,9 +5,9 @@
5
5
  // so runtime consumers can import `@polotno/schema/defaults` without pulling
6
6
  // the validator.
7
7
  // Table-cell properties that inherit from the table element when a cell
8
- // leaves them undefined. Shared by the editor's table model and the svg/html
9
- // exporters so the inheritance vocabulary can't drift. (pdf-export uses a
10
- // deliberate subset without stroke/strokeWidth — see its table.ts.)
8
+ // leaves them undefined. Shared by the editor's table model and
9
+ // @polotno/core/table, which every exporter resolves cells through, so the
10
+ // inheritance vocabulary can't drift.
11
11
  export const TABLE_CELL_OVERRIDABLE_KEYS = [
12
12
  'fontSize',
13
13
  'fontFamily',
@@ -63,10 +63,8 @@ export const resolveTableCellBorder = (cell, element, side) => {
63
63
  * stroke intrudes and the other half lives in the neighbour. `cell` must carry
64
64
  * its grid position (`row`, `col`, and the spans when it spans).
65
65
  *
66
- * Mirrors the editor's `TableCell.borderInsets` (polotno's table-model.ts),
67
- * which is what the canvas places cell text with — that model still owns its
68
- * own copy because it resolves borders through MST views with an isAlive
69
- * guard.
66
+ * The editor's `TableCell.borderInsets` and @polotno/core/table's content
67
+ * box both take it.
70
68
  */
71
69
  export const tableCellBorderInsets = (cell, element) => {
72
70
  const rowSpan = cell.rowSpan || 1;
@@ -128,6 +126,27 @@ export const MIN_FONT_SIZE = 1;
128
126
  * the table", which is not a size to clamp.
129
127
  */
130
128
  export const clampFontSize = (size) => (size != null && size < MIN_FONT_SIZE ? MIN_FONT_SIZE : size);
129
+ /**
130
+ * The smallest width or height an element holds, and the size a stored width
131
+ * or height reads as when it is not a positive finite number: zero, negative,
132
+ * NaN, ±Infinity or null. One rule, no negative-size semantics. The editor's
133
+ * transformer never makes such a box, so only hand-written JSON holds one.
134
+ *
135
+ * The editor's model applies it to every element it loads (polotno's
136
+ * `shape-model.ts`), and the schema's normalize step applies it for every
137
+ * converter, so a 0×70 box is the same 1px column on the Canvas and in every
138
+ * export. Text height is exempt: 0 there means "not measured yet"
139
+ * (@polotno/core's `hasMeasuredHeight`), and the text model keeps it.
140
+ */
141
+ export const MIN_ELEMENT_SIZE = 1;
142
+ /**
143
+ * Apply that rule to a stored width or height. A non-number other than null
144
+ * passes through unchanged, so validation still rejects it.
145
+ */
146
+ export const clampElementSize = (size) => size == null ||
147
+ (typeof size === 'number' && !(Number.isFinite(size) && size > 0))
148
+ ? MIN_ELEMENT_SIZE
149
+ : size;
131
150
  export const BLEND_MODES = [
132
151
  'normal',
133
152
  'multiply',
@@ -1 +1 @@
1
- {"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"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":{"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"},"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.","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":"Visible text shown on canvas.","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":{"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"},"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.","type":"number"},"height":{"default":100,"description":"Height in pixels.","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 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":{"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"},"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.","type":"number"},"height":{"default":100,"description":"Height in pixels.","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":{"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"},"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.","type":"number"},"height":{"default":10,"description":"Height in pixels.","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":{"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"},"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.","type":"number"},"height":{"default":100,"description":"Height in pixels.","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":{"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"},"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.","type":"number"},"height":{"default":100,"description":"Height in pixels.","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 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":{"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"},"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.","type":"number"},"height":{"default":100,"description":"Height in pixels.","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 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":{"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"},"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.","type":"number"},"height":{"default":200,"description":"Height in pixels.","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":"Visible text shown in the cell.","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":{"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."},"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 and lineWipe, 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'. 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, and lineRise and lineWipe play rise and wipe on lines. An exit runs from the last unit back to the first. 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 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. 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":{"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":{"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"},"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":"Visible text shown on canvas.","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":{"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"},"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 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":{"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"},"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":{"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"},"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":{"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"},"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":{"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"},"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 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":{"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"},"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 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":{"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"},"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 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":{"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"},"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":"Visible text shown in the cell.","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":{"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."},"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/errors.d.ts CHANGED
@@ -3,8 +3,8 @@
3
3
  * `code` property (branch on it, like `err.code === 'ENOENT'`) and optional
4
4
  * JSON-serializable `details`. Messages are for humans and may change in any
5
5
  * release — never match on them. No classes, no instanceof — a code check
6
- * works on any copy of any package. See the error-codes table in the repo
7
- * root CLAUDE.md.
6
+ * works on any copy of any package. The rules live in the header of
7
+ * `@polotno/core`'s `src/errors.ts`, beside the canonical map.
8
8
  *
9
9
  * `@polotno/schema` is the layer *below* `@polotno/core`, so it can't import
10
10
  * core's shared error map — it defines its own. It only ever throws
package/lib/errors.js CHANGED
@@ -3,8 +3,8 @@
3
3
  * `code` property (branch on it, like `err.code === 'ENOENT'`) and optional
4
4
  * JSON-serializable `details`. Messages are for humans and may change in any
5
5
  * release — never match on them. No classes, no instanceof — a code check
6
- * works on any copy of any package. See the error-codes table in the repo
7
- * root CLAUDE.md.
6
+ * works on any copy of any package. The rules live in the header of
7
+ * `@polotno/core`'s `src/errors.ts`, beside the canonical map.
8
8
  *
9
9
  * `@polotno/schema` is the layer *below* `@polotno/core`, so it can't import
10
10
  * core's shared error map — it defines its own. It only ever throws
package/lib/migrate.js CHANGED
@@ -123,7 +123,7 @@ export function migrateDesign(json, options = {}) {
123
123
  // Guard BEFORE the round-trip: JSON.parse(JSON.stringify(undefined)) throws a
124
124
  // raw SyntaxError, and a circular object throws TypeError. Non-designs must
125
125
  // reach the zod pass untouched so they surface as a structured
126
- // DESIGN_INVALID, per the error contract in the root CLAUDE.md.
126
+ // DESIGN_INVALID, per the error contract in core's errors.ts header.
127
127
  if (!json || typeof json !== 'object')
128
128
  return json;
129
129
  const data = JSON.parse(JSON.stringify(json));