@polotno/schema 0.6.0 → 0.6.1
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 +20 -3
- package/lib/design.schema.json +1 -0
- package/lib/schema.js +4 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -46,9 +46,26 @@ const complete = normalizeDesign(partial);
|
|
|
46
46
|
// every default filled in, unknown keys stripped
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
Idempotent and exact for current-format input. It
|
|
50
|
-
`schemaVersion` documents, and it leaves render-derived
|
|
51
|
-
auto-height) for the editor to compute.
|
|
49
|
+
Idempotent and exact for current-format input. It migrates older
|
|
50
|
+
`schemaVersion` documents up first (see below), and it leaves render-derived
|
|
51
|
+
values (e.g. text auto-height) for the editor to compute.
|
|
52
|
+
|
|
53
|
+
## Schema versions
|
|
54
|
+
|
|
55
|
+
Every design carries a `schemaVersion`. `normalizeDesign` / `parseDesign` migrate
|
|
56
|
+
an older document up to the current version before validating, so a consumer
|
|
57
|
+
never has to handle an old shape. A **missing** `schemaVersion` means 0 — the
|
|
58
|
+
oldest format, not the newest.
|
|
59
|
+
|
|
60
|
+
| Version | What changed |
|
|
61
|
+
| ------- | ----------------------------------------------------------------------------------------------------------------------- |
|
|
62
|
+
| 1 | `letterSpacing` is a ratio of the element's own `fontSize`, no longer of a 16px root. |
|
|
63
|
+
| 2 | Filter `intensity` moved from `-100..100` to `-1..1`. |
|
|
64
|
+
| 3 | Text backgrounds render as per-line polygons; pre-v3 rich text is stamped `legacyBackground` to keep the old full rect. |
|
|
65
|
+
| 4 | Video time anchoring changed. Marker only — no document transform. |
|
|
66
|
+
|
|
67
|
+
Steps 1 and 3 apply only to the modern text renderers, which every converter
|
|
68
|
+
uses.
|
|
52
69
|
|
|
53
70
|
## JSON Schema
|
|
54
71
|
|
package/lib/design.schema.json
CHANGED
package/lib/schema.js
CHANGED
|
@@ -314,7 +314,10 @@ function build(o) {
|
|
|
314
314
|
cropY: z.number().default(0),
|
|
315
315
|
cropWidth: z.number().default(1),
|
|
316
316
|
cropHeight: z.number().default(1),
|
|
317
|
-
keepRatio: z
|
|
317
|
+
keepRatio: z
|
|
318
|
+
.boolean()
|
|
319
|
+
.default(true)
|
|
320
|
+
.describe('Whether to maintain aspect ratio when resizing.'),
|
|
318
321
|
stretchEnabled: z.boolean().default(true),
|
|
319
322
|
flipX: z.boolean().default(false),
|
|
320
323
|
flipY: z.boolean().default(false),
|
package/package.json
CHANGED