@polotno/schema 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/LICENSE.md +10 -0
  2. package/README.md +81 -0
  3. package/lib/constants.d.ts +6 -0
  4. package/lib/constants.d.ts.map +1 -0
  5. package/lib/constants.js +61 -0
  6. package/lib/constants.js.map +1 -0
  7. package/lib/defaults.d.ts +445 -0
  8. package/lib/defaults.d.ts.map +1 -0
  9. package/lib/defaults.js +254 -0
  10. package/lib/defaults.js.map +1 -0
  11. package/lib/design.schema.json +2771 -0
  12. package/lib/index.d.ts +5 -0
  13. package/lib/index.d.ts.map +1 -0
  14. package/lib/index.js +7 -0
  15. package/lib/index.js.map +1 -0
  16. package/lib/migrate.d.ts +6 -0
  17. package/lib/migrate.d.ts.map +1 -0
  18. package/lib/migrate.js +58 -0
  19. package/lib/migrate.js.map +1 -0
  20. package/lib/normalize.d.ts +2 -0
  21. package/lib/normalize.d.ts.map +1 -0
  22. package/lib/normalize.js +36 -0
  23. package/lib/normalize.js.map +1 -0
  24. package/lib/processors.d.ts +13 -0
  25. package/lib/processors.d.ts.map +1 -0
  26. package/lib/processors.js +170 -0
  27. package/lib/processors.js.map +1 -0
  28. package/lib/schema.d.ts +693 -0
  29. package/lib/schema.d.ts.map +1 -0
  30. package/lib/schema.js +379 -0
  31. package/lib/schema.js.map +1 -0
  32. package/lib/traverse.d.ts +3 -0
  33. package/lib/traverse.d.ts.map +1 -0
  34. package/lib/traverse.js +32 -0
  35. package/lib/traverse.js.map +1 -0
  36. package/lib/types-parity.d.ts +2 -0
  37. package/lib/types-parity.d.ts.map +1 -0
  38. package/lib/types-parity.js +11 -0
  39. package/lib/types-parity.js.map +1 -0
  40. package/lib/types.d.ts +349 -0
  41. package/lib/types.d.ts.map +1 -0
  42. package/lib/types.js +22 -0
  43. package/lib/types.js.map +1 -0
  44. package/lib/validate.d.ts +19 -0
  45. package/lib/validate.d.ts.map +1 -0
  46. package/lib/validate.js +383 -0
  47. package/lib/validate.js.map +1 -0
  48. package/package.json +57 -0
package/LICENSE.md ADDED
@@ -0,0 +1,10 @@
1
+ Polotno SDK License
2
+
3
+ Copyright (c) 2014–present Anton Lavrenov.
4
+
5
+ This package is part of the Polotno SDK. It is not open source. Use in
6
+ production requires a valid Polotno subscription.
7
+
8
+ Full license terms: https://polotno.com/legal/license
9
+
10
+ The software is provided "as is", without warranty of any kind.
package/README.md ADDED
@@ -0,0 +1,81 @@
1
+ # @polotno/schema
2
+
3
+ TypeScript types, default values, validation, and a JSON Schema for the **Polotno
4
+ design JSON** format — the document shape used across
5
+ [Polotno](https://polotno.com) and its import/export packages.
6
+
7
+ Use it to **validate** and **normalize** design JSON anywhere, without running the
8
+ editor.
9
+
10
+ ```bash
11
+ npm install @polotno/schema
12
+ ```
13
+
14
+ ## What it's for
15
+
16
+ - **Validate** a design — before saving it, or when accepting it over the wire.
17
+ - **Fill in defaults** so partial JSON becomes a complete, canonical document.
18
+ - **Check converter output.** The import packages emit design JSON with defaults
19
+ omitted; this validates and completes it. See
20
+ [`@polotno/pdf-import`](https://www.npmjs.com/package/@polotno/pdf-import),
21
+ [`@polotno/svg-import`](https://www.npmjs.com/package/@polotno/svg-import),
22
+ [`@polotno/psd-import`](https://www.npmjs.com/package/@polotno/psd-import).
23
+
24
+ ## Validate
25
+
26
+ ```ts
27
+ import { validateDesign, assertValidDesign } from '@polotno/schema';
28
+
29
+ validateDesign(json, { mode: 'partial' }); // lenient — defaults may be missing
30
+ validateDesign(json, { mode: 'canonical' }); // strict — rejects unknown keys
31
+ // → { valid: boolean, errors: { path: string, message: string }[] }
32
+
33
+ assertValidDesign(json); // throws on invalid
34
+ ```
35
+
36
+ The exported `designSchemaLenient` / `designSchemaCanonical` implement the
37
+ [Standard Schema](https://standardschema.dev) interface, so they interoperate with
38
+ zod, Effect Schema, Valibot, and other Standard-Schema tools.
39
+
40
+ ## Normalize (fill defaults)
41
+
42
+ ```ts
43
+ import { normalizeDesign } from '@polotno/schema';
44
+
45
+ const complete = normalizeDesign(partial);
46
+ // every default filled in, unknown keys stripped
47
+ ```
48
+
49
+ Idempotent and exact for current-format input. It does not migrate old
50
+ `schemaVersion` documents, and it leaves render-derived values (e.g. text
51
+ auto-height) for the editor to compute.
52
+
53
+ ## JSON Schema
54
+
55
+ A language-neutral JSON Schema (draft 2020-12) ships at
56
+ `@polotno/schema/design.schema.json` — validate from any language or tooling.
57
+
58
+ ```ts
59
+ import schema from '@polotno/schema/design.schema.json' with { type: 'json' };
60
+ ```
61
+
62
+ ## Types
63
+
64
+ ```ts
65
+ import type { Design, Page, Element, TextElement } from '@polotno/schema';
66
+ ```
67
+
68
+ ## Related
69
+
70
+ - [Polotno](https://polotno.com) — the design editor SDK these documents come from.
71
+ - Import/export packages that produce or consume this JSON:
72
+ [pdf-import](https://www.npmjs.com/package/@polotno/pdf-import),
73
+ [svg-import](https://www.npmjs.com/package/@polotno/svg-import),
74
+ [psd-import](https://www.npmjs.com/package/@polotno/psd-import),
75
+ [pdf-export](https://www.npmjs.com/package/@polotno/pdf-export).
76
+
77
+ ## License
78
+
79
+ Part of the Polotno SDK — not open source; production use requires a valid Polotno
80
+ subscription. See [LICENSE.md](./LICENSE.md) ·
81
+ [full terms](https://polotno.com/legal/license).
@@ -0,0 +1,6 @@
1
+ export declare const OVERRIDABLE_KEYS: readonly ["fontSize", "fontFamily", "fontWeight", "fontStyle", "textDecoration", "textTransform", "fill", "align", "verticalAlign", "lineHeight", "letterSpacing", "strokeWidth", "stroke", "cellBackground", "cellPadding"];
2
+ export declare const OVERRIDABLE_KEYS_SET: Set<string>;
3
+ export declare const TABLE_NONSENSICAL_KEYS: string[];
4
+ export declare const DIRECT_KEYS: readonly ["id", "type", "text", "opacity", "rowSpan", "colSpan", "mergedInto", "name", "custom", "borders"];
5
+ export declare const CELL_DIRECT_DEFAULTS: Record<string, number | string>;
6
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB,8NAgBnB,CAAC;AAEX,eAAO,MAAM,oBAAoB,aAAoC,CAAC;AAItE,eAAO,MAAM,sBAAsB,UAclC,CAAC;AAGF,eAAO,MAAM,WAAW,6GAWd,CAAC;AAIX,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAKhE,CAAC"}
@@ -0,0 +1,61 @@
1
+ // Table key-sets, extracted verbatim from `table-model.ts`. Shared by the table
2
+ // snapshot processors here and (re-imported) by core's `cell.set` logic.
3
+ // Cell text-styling props that fall back to the table default when unset. On a
4
+ // cell snapshot they are stored `_`-prefixed (`_fontSize`).
5
+ export const OVERRIDABLE_KEYS = [
6
+ 'fontSize',
7
+ 'fontFamily',
8
+ 'fontWeight',
9
+ 'fontStyle',
10
+ 'textDecoration',
11
+ 'textTransform',
12
+ 'fill',
13
+ 'align',
14
+ 'verticalAlign',
15
+ 'lineHeight',
16
+ 'letterSpacing',
17
+ 'strokeWidth',
18
+ 'stroke',
19
+ 'cellBackground',
20
+ 'cellPadding',
21
+ ];
22
+ export const OVERRIDABLE_KEYS_SET = new Set(OVERRIDABLE_KEYS);
23
+ // Props inherited from Shape that are nonsensical for tables — stripped from the
24
+ // table snapshot in postProcess.
25
+ export const TABLE_NONSENSICAL_KEYS = [
26
+ 'blurEnabled',
27
+ 'blurRadius',
28
+ 'brightnessEnabled',
29
+ 'brightness',
30
+ 'sepiaEnabled',
31
+ 'grayscaleEnabled',
32
+ 'filters',
33
+ 'shadowEnabled',
34
+ 'shadowBlur',
35
+ 'shadowOffsetX',
36
+ 'shadowOffsetY',
37
+ 'shadowColor',
38
+ 'shadowOpacity',
39
+ ];
40
+ // Non-overridable direct cell props (kept as-is on the cell snapshot).
41
+ export const DIRECT_KEYS = [
42
+ 'id',
43
+ 'type',
44
+ 'text',
45
+ 'opacity',
46
+ 'rowSpan',
47
+ 'colSpan',
48
+ 'mergedInto',
49
+ 'name',
50
+ 'custom',
51
+ 'borders',
52
+ ];
53
+ // Direct cell props whose value, when equal to the default, is stripped from the
54
+ // snapshot. NOTE: 'type' and 'text' are intentionally NOT here.
55
+ export const CELL_DIRECT_DEFAULTS = {
56
+ opacity: 1,
57
+ rowSpan: 1,
58
+ colSpan: 1,
59
+ name: '',
60
+ };
61
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,yEAAyE;AAEzE,+EAA+E;AAC/E,4DAA4D;AAC5D,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,UAAU;IACV,YAAY;IACZ,YAAY;IACZ,WAAW;IACX,gBAAgB;IAChB,eAAe;IACf,MAAM;IACN,OAAO;IACP,eAAe;IACf,YAAY;IACZ,eAAe;IACf,aAAa;IACb,QAAQ;IACR,gBAAgB;IAChB,aAAa;CACL,CAAC;AAEX,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAS,gBAAgB,CAAC,CAAC;AAEtE,iFAAiF;AACjF,iCAAiC;AACjC,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,aAAa;IACb,YAAY;IACZ,mBAAmB;IACnB,YAAY;IACZ,cAAc;IACd,kBAAkB;IAClB,SAAS;IACT,eAAe;IACf,YAAY;IACZ,eAAe;IACf,eAAe;IACf,aAAa;IACb,eAAe;CAChB,CAAC;AAEF,uEAAuE;AACvE,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,IAAI;IACJ,MAAM;IACN,MAAM;IACN,SAAS;IACT,SAAS;IACT,SAAS;IACT,YAAY;IACZ,MAAM;IACN,QAAQ;IACR,SAAS;CACD,CAAC;AAEX,iFAAiF;AACjF,gEAAgE;AAChE,MAAM,CAAC,MAAM,oBAAoB,GAAoC;IACnE,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,CAAC;IACV,IAAI,EAAE,EAAE;CACT,CAAC"}
@@ -0,0 +1,445 @@
1
+ export declare const NODE_DEFAULTS: {
2
+ readonly type: "none";
3
+ readonly name: "";
4
+ readonly opacity: 1;
5
+ readonly visible: true;
6
+ readonly selectable: true;
7
+ readonly removable: true;
8
+ readonly alwaysOnTop: false;
9
+ readonly showInExport: true;
10
+ };
11
+ export declare const SHAPE_DEFAULTS: {
12
+ readonly x: 0;
13
+ readonly y: 0;
14
+ readonly width: 100;
15
+ readonly height: 100;
16
+ readonly rotation: 0;
17
+ readonly opacity: 1;
18
+ readonly blurEnabled: false;
19
+ readonly blurRadius: 10;
20
+ readonly brightnessEnabled: false;
21
+ readonly brightness: 0;
22
+ readonly sepiaEnabled: false;
23
+ readonly grayscaleEnabled: false;
24
+ readonly shadowEnabled: false;
25
+ readonly shadowBlur: 5;
26
+ readonly shadowOffsetX: 0;
27
+ readonly shadowOffsetY: 0;
28
+ readonly shadowColor: "black";
29
+ readonly shadowOpacity: 1;
30
+ readonly visible: true;
31
+ readonly draggable: true;
32
+ readonly resizable: true;
33
+ readonly selectable: true;
34
+ readonly contentEditable: true;
35
+ readonly styleEditable: true;
36
+ readonly alwaysOnTop: false;
37
+ readonly showInExport: true;
38
+ readonly type: "none";
39
+ readonly name: "";
40
+ readonly removable: true;
41
+ };
42
+ export declare const IMAGE_DEFAULTS: {
43
+ readonly type: "image";
44
+ readonly width: 100;
45
+ readonly height: 100;
46
+ readonly src: "";
47
+ readonly cropX: 0;
48
+ readonly cropY: 0;
49
+ readonly cropWidth: 1;
50
+ readonly cropHeight: 1;
51
+ readonly cornerRadius: 0;
52
+ readonly flipX: false;
53
+ readonly flipY: false;
54
+ readonly clipSrc: "";
55
+ readonly borderColor: "black";
56
+ readonly borderSize: 0;
57
+ readonly keepRatio: false;
58
+ readonly stretchEnabled: false;
59
+ readonly x: 0;
60
+ readonly y: 0;
61
+ readonly rotation: 0;
62
+ readonly opacity: 1;
63
+ readonly blurEnabled: false;
64
+ readonly blurRadius: 10;
65
+ readonly brightnessEnabled: false;
66
+ readonly brightness: 0;
67
+ readonly sepiaEnabled: false;
68
+ readonly grayscaleEnabled: false;
69
+ readonly shadowEnabled: false;
70
+ readonly shadowBlur: 5;
71
+ readonly shadowOffsetX: 0;
72
+ readonly shadowOffsetY: 0;
73
+ readonly shadowColor: "black";
74
+ readonly shadowOpacity: 1;
75
+ readonly visible: true;
76
+ readonly draggable: true;
77
+ readonly resizable: true;
78
+ readonly selectable: true;
79
+ readonly contentEditable: true;
80
+ readonly styleEditable: true;
81
+ readonly alwaysOnTop: false;
82
+ readonly showInExport: true;
83
+ readonly name: "";
84
+ readonly removable: true;
85
+ };
86
+ export declare const TEXT_DEFAULTS: {
87
+ readonly type: "text";
88
+ readonly text: "";
89
+ readonly placeholder: "";
90
+ readonly fontSize: 14;
91
+ readonly fontFamily: "Roboto";
92
+ readonly fontStyle: "normal";
93
+ readonly fontWeight: "normal";
94
+ readonly textDecoration: "";
95
+ readonly textTransform: "none";
96
+ readonly fill: "black";
97
+ readonly align: "center";
98
+ readonly width: 100;
99
+ readonly height: 0;
100
+ readonly verticalAlign: "top";
101
+ readonly strokeWidth: 0;
102
+ readonly stroke: "black";
103
+ readonly lineHeight: 1.2;
104
+ readonly letterSpacing: 0;
105
+ readonly backgroundEnabled: false;
106
+ readonly backgroundColor: "#7ED321";
107
+ readonly backgroundOpacity: 1;
108
+ readonly backgroundCornerRadius: 0.5;
109
+ readonly backgroundPadding: 0.5;
110
+ readonly curveEnabled: false;
111
+ readonly curvePower: 0.5;
112
+ readonly x: 0;
113
+ readonly y: 0;
114
+ readonly rotation: 0;
115
+ readonly opacity: 1;
116
+ readonly blurEnabled: false;
117
+ readonly blurRadius: 10;
118
+ readonly brightnessEnabled: false;
119
+ readonly brightness: 0;
120
+ readonly sepiaEnabled: false;
121
+ readonly grayscaleEnabled: false;
122
+ readonly shadowEnabled: false;
123
+ readonly shadowBlur: 5;
124
+ readonly shadowOffsetX: 0;
125
+ readonly shadowOffsetY: 0;
126
+ readonly shadowColor: "black";
127
+ readonly shadowOpacity: 1;
128
+ readonly visible: true;
129
+ readonly draggable: true;
130
+ readonly resizable: true;
131
+ readonly selectable: true;
132
+ readonly contentEditable: true;
133
+ readonly styleEditable: true;
134
+ readonly alwaysOnTop: false;
135
+ readonly showInExport: true;
136
+ readonly name: "";
137
+ readonly removable: true;
138
+ };
139
+ export declare const SVG_DEFAULTS: {
140
+ readonly type: "svg";
141
+ readonly src: "";
142
+ readonly maskSrc: "";
143
+ readonly cropX: 0;
144
+ readonly cropY: 0;
145
+ readonly cropWidth: 1;
146
+ readonly cropHeight: 1;
147
+ readonly keepRatio: true;
148
+ readonly stretchEnabled: true;
149
+ readonly flipX: false;
150
+ readonly flipY: false;
151
+ readonly width: 100;
152
+ readonly height: 100;
153
+ readonly borderColor: "black";
154
+ readonly borderSize: 0;
155
+ readonly cornerRadius: 0;
156
+ readonly x: 0;
157
+ readonly y: 0;
158
+ readonly rotation: 0;
159
+ readonly opacity: 1;
160
+ readonly blurEnabled: false;
161
+ readonly blurRadius: 10;
162
+ readonly brightnessEnabled: false;
163
+ readonly brightness: 0;
164
+ readonly sepiaEnabled: false;
165
+ readonly grayscaleEnabled: false;
166
+ readonly shadowEnabled: false;
167
+ readonly shadowBlur: 5;
168
+ readonly shadowOffsetX: 0;
169
+ readonly shadowOffsetY: 0;
170
+ readonly shadowColor: "black";
171
+ readonly shadowOpacity: 1;
172
+ readonly visible: true;
173
+ readonly draggable: true;
174
+ readonly resizable: true;
175
+ readonly selectable: true;
176
+ readonly contentEditable: true;
177
+ readonly styleEditable: true;
178
+ readonly alwaysOnTop: false;
179
+ readonly showInExport: true;
180
+ readonly name: "";
181
+ readonly removable: true;
182
+ };
183
+ export declare const LINE_DEFAULTS: {
184
+ readonly type: "line";
185
+ readonly width: 400;
186
+ readonly height: 10;
187
+ readonly color: "black";
188
+ readonly startHead: "";
189
+ readonly endHead: "";
190
+ readonly x: 0;
191
+ readonly y: 0;
192
+ readonly rotation: 0;
193
+ readonly opacity: 1;
194
+ readonly blurEnabled: false;
195
+ readonly blurRadius: 10;
196
+ readonly brightnessEnabled: false;
197
+ readonly brightness: 0;
198
+ readonly sepiaEnabled: false;
199
+ readonly grayscaleEnabled: false;
200
+ readonly shadowEnabled: false;
201
+ readonly shadowBlur: 5;
202
+ readonly shadowOffsetX: 0;
203
+ readonly shadowOffsetY: 0;
204
+ readonly shadowColor: "black";
205
+ readonly shadowOpacity: 1;
206
+ readonly visible: true;
207
+ readonly draggable: true;
208
+ readonly resizable: true;
209
+ readonly selectable: true;
210
+ readonly contentEditable: true;
211
+ readonly styleEditable: true;
212
+ readonly alwaysOnTop: false;
213
+ readonly showInExport: true;
214
+ readonly name: "";
215
+ readonly removable: true;
216
+ };
217
+ export declare const FIGURE_DEFAULTS: {
218
+ readonly type: "figure";
219
+ readonly subType: "rect";
220
+ readonly fill: "rgb(0, 161, 255)";
221
+ readonly strokeWidth: 0;
222
+ readonly stroke: "rgba(98, 197, 255, 1)";
223
+ readonly cornerRadius: 0;
224
+ readonly x: 0;
225
+ readonly y: 0;
226
+ readonly width: 100;
227
+ readonly height: 100;
228
+ readonly rotation: 0;
229
+ readonly opacity: 1;
230
+ readonly blurEnabled: false;
231
+ readonly blurRadius: 10;
232
+ readonly brightnessEnabled: false;
233
+ readonly brightness: 0;
234
+ readonly sepiaEnabled: false;
235
+ readonly grayscaleEnabled: false;
236
+ readonly shadowEnabled: false;
237
+ readonly shadowBlur: 5;
238
+ readonly shadowOffsetX: 0;
239
+ readonly shadowOffsetY: 0;
240
+ readonly shadowColor: "black";
241
+ readonly shadowOpacity: 1;
242
+ readonly visible: true;
243
+ readonly draggable: true;
244
+ readonly resizable: true;
245
+ readonly selectable: true;
246
+ readonly contentEditable: true;
247
+ readonly styleEditable: true;
248
+ readonly alwaysOnTop: false;
249
+ readonly showInExport: true;
250
+ readonly name: "";
251
+ readonly removable: true;
252
+ };
253
+ export declare const GIF_DEFAULTS: {
254
+ readonly type: "gif";
255
+ readonly duration: 0;
256
+ readonly keepRatio: true;
257
+ readonly width: 100;
258
+ readonly height: 100;
259
+ readonly src: "";
260
+ readonly cropX: 0;
261
+ readonly cropY: 0;
262
+ readonly cropWidth: 1;
263
+ readonly cropHeight: 1;
264
+ readonly cornerRadius: 0;
265
+ readonly flipX: false;
266
+ readonly flipY: false;
267
+ readonly clipSrc: "";
268
+ readonly borderColor: "black";
269
+ readonly borderSize: 0;
270
+ readonly stretchEnabled: false;
271
+ readonly x: 0;
272
+ readonly y: 0;
273
+ readonly rotation: 0;
274
+ readonly opacity: 1;
275
+ readonly blurEnabled: false;
276
+ readonly blurRadius: 10;
277
+ readonly brightnessEnabled: false;
278
+ readonly brightness: 0;
279
+ readonly sepiaEnabled: false;
280
+ readonly grayscaleEnabled: false;
281
+ readonly shadowEnabled: false;
282
+ readonly shadowBlur: 5;
283
+ readonly shadowOffsetX: 0;
284
+ readonly shadowOffsetY: 0;
285
+ readonly shadowColor: "black";
286
+ readonly shadowOpacity: 1;
287
+ readonly visible: true;
288
+ readonly draggable: true;
289
+ readonly resizable: true;
290
+ readonly selectable: true;
291
+ readonly contentEditable: true;
292
+ readonly styleEditable: true;
293
+ readonly alwaysOnTop: false;
294
+ readonly showInExport: true;
295
+ readonly name: "";
296
+ readonly removable: true;
297
+ };
298
+ export declare const VIDEO_DEFAULTS: {
299
+ readonly type: "video";
300
+ readonly duration: 0;
301
+ readonly startTime: 0;
302
+ readonly endTime: 1;
303
+ readonly volume: 1;
304
+ readonly speed: 1;
305
+ readonly width: 100;
306
+ readonly height: 100;
307
+ readonly src: "";
308
+ readonly cropX: 0;
309
+ readonly cropY: 0;
310
+ readonly cropWidth: 1;
311
+ readonly cropHeight: 1;
312
+ readonly cornerRadius: 0;
313
+ readonly flipX: false;
314
+ readonly flipY: false;
315
+ readonly clipSrc: "";
316
+ readonly borderColor: "black";
317
+ readonly borderSize: 0;
318
+ readonly keepRatio: false;
319
+ readonly stretchEnabled: false;
320
+ readonly x: 0;
321
+ readonly y: 0;
322
+ readonly rotation: 0;
323
+ readonly opacity: 1;
324
+ readonly blurEnabled: false;
325
+ readonly blurRadius: 10;
326
+ readonly brightnessEnabled: false;
327
+ readonly brightness: 0;
328
+ readonly sepiaEnabled: false;
329
+ readonly grayscaleEnabled: false;
330
+ readonly shadowEnabled: false;
331
+ readonly shadowBlur: 5;
332
+ readonly shadowOffsetX: 0;
333
+ readonly shadowOffsetY: 0;
334
+ readonly shadowColor: "black";
335
+ readonly shadowOpacity: 1;
336
+ readonly visible: true;
337
+ readonly draggable: true;
338
+ readonly resizable: true;
339
+ readonly selectable: true;
340
+ readonly contentEditable: true;
341
+ readonly styleEditable: true;
342
+ readonly alwaysOnTop: false;
343
+ readonly showInExport: true;
344
+ readonly name: "";
345
+ readonly removable: true;
346
+ };
347
+ export declare const TABLE_DEFAULTS: {
348
+ readonly type: "table";
349
+ readonly width: 300;
350
+ readonly height: 200;
351
+ readonly rows: 3;
352
+ readonly cols: 3;
353
+ readonly borderColor: "#000000";
354
+ readonly borderWidth: 1;
355
+ readonly borderStyle: "solid";
356
+ readonly fontSize: 30;
357
+ readonly fontFamily: "Roboto";
358
+ readonly fontWeight: "normal";
359
+ readonly fontStyle: "normal";
360
+ readonly textDecoration: "";
361
+ readonly textTransform: "none";
362
+ readonly fill: "black";
363
+ readonly align: "center";
364
+ readonly verticalAlign: "middle";
365
+ readonly lineHeight: 1.2;
366
+ readonly letterSpacing: 0;
367
+ readonly strokeWidth: 0;
368
+ readonly stroke: "black";
369
+ readonly cellBackground: "transparent";
370
+ readonly cellPadding: 4;
371
+ readonly x: 0;
372
+ readonly y: 0;
373
+ readonly rotation: 0;
374
+ readonly opacity: 1;
375
+ readonly blurEnabled: false;
376
+ readonly blurRadius: 10;
377
+ readonly brightnessEnabled: false;
378
+ readonly brightness: 0;
379
+ readonly sepiaEnabled: false;
380
+ readonly grayscaleEnabled: false;
381
+ readonly shadowEnabled: false;
382
+ readonly shadowBlur: 5;
383
+ readonly shadowOffsetX: 0;
384
+ readonly shadowOffsetY: 0;
385
+ readonly shadowColor: "black";
386
+ readonly shadowOpacity: 1;
387
+ readonly visible: true;
388
+ readonly draggable: true;
389
+ readonly resizable: true;
390
+ readonly selectable: true;
391
+ readonly contentEditable: true;
392
+ readonly styleEditable: true;
393
+ readonly alwaysOnTop: false;
394
+ readonly showInExport: true;
395
+ readonly name: "";
396
+ readonly removable: true;
397
+ };
398
+ export declare const GROUP_DEFAULTS: {
399
+ readonly type: "group";
400
+ readonly name: "";
401
+ readonly opacity: 1;
402
+ readonly visible: true;
403
+ readonly selectable: true;
404
+ readonly removable: true;
405
+ readonly alwaysOnTop: false;
406
+ readonly showInExport: true;
407
+ };
408
+ export declare const TABLE_CELL_DEFAULTS: {
409
+ readonly type: "tablecell";
410
+ readonly text: "";
411
+ readonly opacity: 1;
412
+ readonly rowSpan: 1;
413
+ readonly colSpan: 1;
414
+ readonly name: "";
415
+ };
416
+ export declare const PAGE_DEFAULTS: {
417
+ readonly width: "auto";
418
+ readonly height: "auto";
419
+ readonly background: "white";
420
+ readonly bleed: 0;
421
+ readonly duration: 5000;
422
+ };
423
+ export declare const AUDIO_DEFAULTS: {
424
+ readonly src: "";
425
+ readonly duration: 0;
426
+ readonly startTime: 0;
427
+ readonly endTime: 1;
428
+ readonly volume: 1;
429
+ readonly delay: 0;
430
+ readonly speed: 1;
431
+ };
432
+ export declare const FONT_DEFAULTS: {
433
+ readonly url: "";
434
+ };
435
+ export declare const STORE_DEFAULTS: {
436
+ readonly width: 1080;
437
+ readonly height: 1080;
438
+ readonly unit: "px";
439
+ readonly dpi: 72;
440
+ readonly schemaVersion: 4;
441
+ };
442
+ export declare const CURRENT_SCHEMA_VERSION = 4;
443
+ export declare const DEFAULTS_BY_TYPE: Record<string, Record<string, unknown>>;
444
+ export declare const STRUCTURAL_DEFAULTS_BY_TYPE: Record<string, Record<string, unknown>>;
445
+ //# sourceMappingURL=defaults.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../src/defaults.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,aAAa;;;;;;;;;CAShB,CAAC;AAEX,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BjB,CAAC;AAEX,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkBjB,CAAC;AAEX,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BhB,CAAC;AAEX,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkBf,CAAC;AAEX,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQhB,CAAC;AAEX,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQlB,CAAC;AAEX,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKf,CAAC;AAEX,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQjB,CAAC;AAIX,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyBjB,CAAC;AAEX,eAAO,MAAM,cAAc;;;;;;;;;CAGjB,CAAC;AAIX,eAAO,MAAM,mBAAmB;;;;;;;CAOtB,CAAC;AAEX,eAAO,MAAM,aAAa;;;;;;CAMhB,CAAC;AAEX,eAAO,MAAM,cAAc;;;;;;;;CAQjB,CAAC;AAEX,eAAO,MAAM,aAAa;;CAEhB,CAAC;AAGX,eAAO,MAAM,cAAc;;;;;;CAMjB,CAAC;AAEX,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAIxC,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAUpE,CAAC;AAKF,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAC9C,MAAM,EACN,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAWxB,CAAC"}