@idle-screens/schema 3.9.1 → 3.10.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/FORMAT.md +128 -6
- package/dist/index.d.ts +216 -9
- package/dist/index.js +1068 -169
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/saver-spec.schema.json +63 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@idle-screens/schema",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.10.0",
|
|
4
4
|
"description": "Declarative, agent-authorable saver format for idle-screens: validate a data spec, then compile it into a runnable, seeded, flash-safe SaverPlugin.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Shawn Partridge",
|
package/saver-spec.schema.json
CHANGED
|
@@ -454,10 +454,40 @@
|
|
|
454
454
|
"type": "number",
|
|
455
455
|
"minimum": 0,
|
|
456
456
|
"maximum": 1
|
|
457
|
+
},
|
|
458
|
+
"dx": {
|
|
459
|
+
"type": "number",
|
|
460
|
+
"minimum": -17280,
|
|
461
|
+
"maximum": 17280,
|
|
462
|
+
"description": "Offset from x in min(w,h) units, within ±2 (px under units: 'px', within ±17280; the runtime validator enforces the unit's bound). x/y are fractions of width and height, sizes are fractions of min(w,h) — anchor parts on a shared fraction (the centre is the only aspect-safe one) and offset them with dx/dy so they register on every aspect. Placement (structural). Native clients ignore it."
|
|
463
|
+
},
|
|
464
|
+
"dy": {
|
|
465
|
+
"type": "number",
|
|
466
|
+
"minimum": -17280,
|
|
467
|
+
"maximum": 17280,
|
|
468
|
+
"description": "Offset from y in min(w,h) units. See dx."
|
|
457
469
|
}
|
|
458
470
|
},
|
|
459
471
|
"description": "Exact fractional position for a single entity. Requires count: 1. Overrides region scatter."
|
|
460
472
|
},
|
|
473
|
+
"opacity": {
|
|
474
|
+
"type": "number",
|
|
475
|
+
"minimum": 0,
|
|
476
|
+
"maximum": 1,
|
|
477
|
+
"description": "Paint-level layer opacity (default 1): multiplies every entity's alpha and the life envelope at draw time. Unlike alpha (a range baked into entities), it is paint — setParam, a timeline key or a morph glide it without re-seeding. Native clients ignore it (1)."
|
|
478
|
+
},
|
|
479
|
+
"transform": {
|
|
480
|
+
"type": "object",
|
|
481
|
+
"additionalProperties": false,
|
|
482
|
+
"properties": {
|
|
483
|
+
"x": { "type": "number", "minimum": -17280, "maximum": 17280, "description": "Translate in min(w,h) units, within ±2 (px under units: 'px'; the runtime validator enforces the unit's bound)." },
|
|
484
|
+
"y": { "type": "number", "minimum": -17280, "maximum": 17280, "description": "Translate in min(w,h) units, within ±2 (px under units: 'px')." },
|
|
485
|
+
"scale": { "type": "number", "minimum": 0, "maximum": 8, "description": "Uniform scale about the viewport centre (default 1)." },
|
|
486
|
+
"scaleX": { "type": "number", "minimum": -8, "maximum": 8, "description": "Extra horizontal scale; toward 0 reads as a turn about the vertical axis, negative mirrors (default 1)." },
|
|
487
|
+
"rotate": { "type": "number", "minimum": -3600, "maximum": 3600, "description": "Degrees, clockwise, about the viewport centre." }
|
|
488
|
+
},
|
|
489
|
+
"description": "Paint-level transform of the whole layer at draw time, about the viewport centre. Outside the structural signature, so it glides under setParam, a timeline key or a morph — a camera for timed pieces, a slow drift for ambient ones. Native clients ignore it (identity)."
|
|
490
|
+
},
|
|
461
491
|
"trail": {
|
|
462
492
|
"type": "object",
|
|
463
493
|
"required": [
|
|
@@ -1526,6 +1556,33 @@
|
|
|
1526
1556
|
"finish": {
|
|
1527
1557
|
"$ref": "#/definitions/finish"
|
|
1528
1558
|
},
|
|
1559
|
+
"timeline": {
|
|
1560
|
+
"type": "object",
|
|
1561
|
+
"required": ["keys"],
|
|
1562
|
+
"additionalProperties": false,
|
|
1563
|
+
"properties": {
|
|
1564
|
+
"loop": { "type": "boolean", "description": "Repeat every duration ms. A looping path's value before its first key is its last key's value." },
|
|
1565
|
+
"duration": { "type": "number", "exclusiveMinimum": 0, "maximum": 86400000, "description": "Lap length in ms; required with loop and greater than the latest key's t." },
|
|
1566
|
+
"keys": {
|
|
1567
|
+
"type": "array",
|
|
1568
|
+
"minItems": 1,
|
|
1569
|
+
"maxItems": 256,
|
|
1570
|
+
"items": {
|
|
1571
|
+
"type": "object",
|
|
1572
|
+
"required": ["t", "path", "value"],
|
|
1573
|
+
"additionalProperties": false,
|
|
1574
|
+
"properties": {
|
|
1575
|
+
"t": { "type": "number", "minimum": 0, "description": "Scene time in ms (a sequence segment's own clock)." },
|
|
1576
|
+
"path": { "type": "string", "minLength": 1, "description": "A setParam dot-path that already exists on the spec (layers.0.sprite.color, key.opacity, background.stops.1.color, …)." },
|
|
1577
|
+
"value": { "description": "The target value; the spec must still validate with it applied." },
|
|
1578
|
+
"ease": { "enum": ["step", "linear", "smooth"], "description": "Default smooth." },
|
|
1579
|
+
"dur": { "type": "number", "minimum": 0, "maximum": 30000, "description": "Glide length in ms from t (default 1000; 0 = cut)." }
|
|
1580
|
+
}
|
|
1581
|
+
}
|
|
1582
|
+
}
|
|
1583
|
+
},
|
|
1584
|
+
"description": "Authored keyframes on the scene's own clock. Each key glides its path to value at t; distinct key times on one path are >= 200 ms apart (flash safety). Live steering layers on top: a steer on a path no key touches is sticky (as on any scene); on an animated path it holds until that path's next key, then the timeline takes it back. Keys on structural paths rebuild (a pop) — animate paint (colour, opacity, transform, polygon points). Distinct from a channel track, whose t is a wall-clock stamp. Native clients ignore it and show the base spec — author the base as the piece's rest state."
|
|
1585
|
+
},
|
|
1529
1586
|
"layers": {
|
|
1530
1587
|
"type": "array",
|
|
1531
1588
|
"minItems": 1,
|
|
@@ -1586,6 +1643,10 @@
|
|
|
1586
1643
|
],
|
|
1587
1644
|
"description": "What the sequence clock is anchored to. 'mount' (default): every viewer starts at T = 0 when it mounts — a joiner sees segment 0 (pre-roll semantics). 'epoch': a viewer handed sequenceBaseT on its mount context (the host's Date.now() − epoch) starts its clock there, so every screen shows the same segment; a late joiner lands mid-loop. advance: 'input' holds stay armed under either. Native clients that anchor at their own mount behave as 'mount'."
|
|
1588
1645
|
},
|
|
1646
|
+
"wrapMorph": {
|
|
1647
|
+
"type": "boolean",
|
|
1648
|
+
"description": "Honour a morph declared on the last segment at the loop wrap (the lap morphs back into segment 0 instead of cutting). Opt-in; takes effect only under loop: true when every segment morphs into the next and the last is a structural twin of the first (validateSequence warns wrap-morph-inactive otherwise). Native clients cut."
|
|
1649
|
+
},
|
|
1589
1650
|
"bed": {
|
|
1590
1651
|
"$ref": "#/definitions/saverSpec",
|
|
1591
1652
|
"description": "A scene drawn under every segment on the sequence's global clock — the ground that does not reset at a boundary or under a sequence.segment steer. Segments render over it transparently (their background and ghosting are ignored; validateSequence warns bed-hides-segment-background). Its entities plus the largest segment's must stay within the 800 cap (enforced by validateSequence). Steer it with bed.<path>. Native clients that ignore it render segments with their own backgrounds."
|
|
@@ -1658,8 +1719,8 @@
|
|
|
1658
1719
|
"description": "Morph glide duration in ms. Requires structurally identical adjacent segments."
|
|
1659
1720
|
},
|
|
1660
1721
|
"text": {
|
|
1661
|
-
"enum": ["step", "crossfade"],
|
|
1662
|
-
"description": "How text / textBlock strings change during the morph. 'step' (default, today's behaviour): the incoming string shows from the first frame. 'crossfade': each text layer whose string(s) differ is drawn twice for dur — the outgoing words at 1 − k, the incoming at k (k = the eased progress). Native clients step (tvOS already cross-fades whole frames on a segment change)."
|
|
1722
|
+
"enum": ["step", "crossfade", "dip"],
|
|
1723
|
+
"description": "How text / textBlock strings change during the morph. 'step' (default, today's behaviour): the incoming string shows from the first frame. 'crossfade': each text layer whose string(s) differ is drawn twice for dur — the outgoing words at 1 − k, the incoming at k (k = the eased progress). 'dip': the same two passes in turn — the outgoing words fade out over the first half, the incoming fade in over the second, never both at once. Native clients step (tvOS already cross-fades whole frames on a segment change)."
|
|
1663
1724
|
}
|
|
1664
1725
|
},
|
|
1665
1726
|
"required": ["type", "dur"],
|