@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 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 does not migrate old
50
- `schemaVersion` documents, and it leaves render-derived values (e.g. text
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
 
@@ -1109,6 +1109,7 @@
1109
1109
  },
1110
1110
  "keepRatio": {
1111
1111
  "default": true,
1112
+ "description": "Whether to maintain aspect ratio when resizing.",
1112
1113
  "type": "boolean"
1113
1114
  },
1114
1115
  "stretchEnabled": {
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.boolean().default(true),
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polotno/schema",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Canonical Polotno design format: types, normalize, validate, JSON Schema. Authored in zod, DOM-free.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "type": "module",