@idle-screens/schema 3.4.5 → 3.6.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 +153 -20
- package/dist/index.d.ts +368 -10
- package/dist/index.js +1204 -84
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/saver-spec.schema.json +230 -35
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@idle-screens/schema",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.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",
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
"FORMAT.md"
|
|
43
43
|
],
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@idle-screens/core": "^0.4.
|
|
45
|
+
"@idle-screens/core": "^0.4.7"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"ajv": "^8.17.1",
|
|
49
|
-
"@idle-screens/core": "0.4.
|
|
49
|
+
"@idle-screens/core": "0.4.7"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"build": "tsup",
|
package/saver-spec.schema.json
CHANGED
|
@@ -389,49 +389,131 @@
|
|
|
389
389
|
"description": "Draw lines between entities. The layer's entity count (count field) must be <= 200 for performance."
|
|
390
390
|
},
|
|
391
391
|
"layout": {
|
|
392
|
-
"
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
"
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
"type": "integer",
|
|
403
|
-
"minimum": 1,
|
|
404
|
-
"maximum": 100,
|
|
405
|
-
"description": "Grid columns. Default: aspect-fit square-ish grid."
|
|
406
|
-
},
|
|
407
|
-
"jitter": {
|
|
408
|
-
"oneOf": [
|
|
409
|
-
{
|
|
410
|
-
"type": "number",
|
|
411
|
-
"minimum": 0,
|
|
412
|
-
"maximum": 1
|
|
392
|
+
"oneOf": [
|
|
393
|
+
{
|
|
394
|
+
"type": "object",
|
|
395
|
+
"required": [
|
|
396
|
+
"type"
|
|
397
|
+
],
|
|
398
|
+
"additionalProperties": false,
|
|
399
|
+
"properties": {
|
|
400
|
+
"type": {
|
|
401
|
+
"const": "grid"
|
|
413
402
|
},
|
|
414
|
-
{
|
|
415
|
-
"type": "
|
|
416
|
-
"
|
|
417
|
-
"
|
|
418
|
-
|
|
403
|
+
"columns": {
|
|
404
|
+
"type": "integer",
|
|
405
|
+
"minimum": 1,
|
|
406
|
+
"maximum": 100,
|
|
407
|
+
"description": "Grid columns. Default: aspect-fit square-ish grid."
|
|
408
|
+
},
|
|
409
|
+
"jitter": {
|
|
410
|
+
"oneOf": [
|
|
411
|
+
{
|
|
419
412
|
"type": "number",
|
|
420
413
|
"minimum": 0,
|
|
421
414
|
"maximum": 1
|
|
422
415
|
},
|
|
423
|
-
|
|
424
|
-
"type": "
|
|
425
|
-
"
|
|
426
|
-
"
|
|
416
|
+
{
|
|
417
|
+
"type": "object",
|
|
418
|
+
"additionalProperties": false,
|
|
419
|
+
"properties": {
|
|
420
|
+
"x": {
|
|
421
|
+
"type": "number",
|
|
422
|
+
"minimum": 0,
|
|
423
|
+
"maximum": 1
|
|
424
|
+
},
|
|
425
|
+
"y": {
|
|
426
|
+
"type": "number",
|
|
427
|
+
"minimum": 0,
|
|
428
|
+
"maximum": 1
|
|
429
|
+
}
|
|
430
|
+
}
|
|
427
431
|
}
|
|
428
|
-
|
|
432
|
+
],
|
|
433
|
+
"description": "Seeded per-entity offset as a fraction of cell size (scalar or per-axis). { y: 1 } keeps columns crisp while scattering vertically (Matrix rain). Default 0."
|
|
429
434
|
}
|
|
430
|
-
|
|
431
|
-
"description": "
|
|
435
|
+
},
|
|
436
|
+
"description": "Place entities on a grid (row-major, within region) instead of random scatter \u2014 Matrix columns, LED walls, uniform dot fields."
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
"type": "object",
|
|
440
|
+
"required": ["type"],
|
|
441
|
+
"additionalProperties": false,
|
|
442
|
+
"properties": {
|
|
443
|
+
"type": { "const": "list" },
|
|
444
|
+
"gap": { "type": "number", "exclusiveMinimum": 0, "description": "Row pitch in viewport units of min(w,h) (px in px specs). Default 0.06 / 40 px." }
|
|
445
|
+
},
|
|
446
|
+
"description": "Data layout: entities stacked in one column in reading order; strings[i], glyphs[i] and colors[i] are taken in order. position (any count) anchors the block's top-left; otherwise centred in region."
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
"type": "object",
|
|
450
|
+
"required": ["type", "columns"],
|
|
451
|
+
"additionalProperties": false,
|
|
452
|
+
"properties": {
|
|
453
|
+
"type": { "const": "table" },
|
|
454
|
+
"columns": { "type": "integer", "minimum": 1, "maximum": 100 },
|
|
455
|
+
"gap": {
|
|
456
|
+
"oneOf": [
|
|
457
|
+
{ "type": "number", "exclusiveMinimum": 0 },
|
|
458
|
+
{ "type": "object", "additionalProperties": false, "properties": { "x": { "type": "number", "exclusiveMinimum": 0 }, "y": { "type": "number", "exclusiveMinimum": 0 } } }
|
|
459
|
+
],
|
|
460
|
+
"description": "Cell pitch, one number or {x, y}, in viewport units of min(w,h). Default 0.06."
|
|
461
|
+
}
|
|
462
|
+
},
|
|
463
|
+
"description": "Data layout: entities fill columns row-major in reading order (see list)."
|
|
464
|
+
}
|
|
465
|
+
]
|
|
466
|
+
},
|
|
467
|
+
"emit": {
|
|
468
|
+
"type": "object",
|
|
469
|
+
"required": ["every", "life"],
|
|
470
|
+
"additionalProperties": false,
|
|
471
|
+
"properties": {
|
|
472
|
+
"every": {
|
|
473
|
+
"type": "number",
|
|
474
|
+
"minimum": 1000,
|
|
475
|
+
"maximum": 600000,
|
|
476
|
+
"description": "Event period in ms per entity (floor 1000: at most one event per second per entity)."
|
|
477
|
+
},
|
|
478
|
+
"life": {
|
|
479
|
+
"type": "number",
|
|
480
|
+
"minimum": 500,
|
|
481
|
+
"description": "Visible window per event in ms (floor 500; must be <= every). Fades in over the first quarter, out over the rest."
|
|
482
|
+
},
|
|
483
|
+
"jitter": {
|
|
484
|
+
"type": "number",
|
|
485
|
+
"minimum": 0,
|
|
486
|
+
"maximum": 1,
|
|
487
|
+
"description": "0 = entities evenly staggered across the period (one event at a time while life <= every / count); 1 (default) = scattered offsets from a fixed low-discrepancy sequence (not seeded)."
|
|
488
|
+
},
|
|
489
|
+
"grow": {
|
|
490
|
+
"type": "array",
|
|
491
|
+
"items": { "type": "number", "minimum": 0, "maximum": 8 },
|
|
492
|
+
"minItems": 2,
|
|
493
|
+
"maxItems": 2,
|
|
494
|
+
"description": "[from, to] size multipliers across the window \u2014 expansion rather than travel."
|
|
432
495
|
}
|
|
433
496
|
},
|
|
434
|
-
"description": "
|
|
497
|
+
"description": "Sparse events: each entity appears, expands and fades in place for `life` ms every `every` ms, dark in between. The one-ping primitive; a pure function of t."
|
|
498
|
+
},
|
|
499
|
+
"clock": {
|
|
500
|
+
"type": "object",
|
|
501
|
+
"additionalProperties": false,
|
|
502
|
+
"properties": {
|
|
503
|
+
"phase": {
|
|
504
|
+
"type": "number",
|
|
505
|
+
"minimum": 0,
|
|
506
|
+
"maximum": 1,
|
|
507
|
+
"description": "Shared phase in turns (0..1). Default 0."
|
|
508
|
+
},
|
|
509
|
+
"rate": {
|
|
510
|
+
"type": "number",
|
|
511
|
+
"minimum": 0.1,
|
|
512
|
+
"maximum": 4,
|
|
513
|
+
"description": "Time multiplier for pulse/grow/cycle. Default 1. Their periods must satisfy period / rate >= 1000 ms."
|
|
514
|
+
}
|
|
515
|
+
},
|
|
516
|
+
"description": "Phase-lock: replaces the seeded per-entity phases of pulse, grow and cycle with one shared phase so layers can breathe in step."
|
|
435
517
|
},
|
|
436
518
|
"life": {
|
|
437
519
|
"type": "object",
|
|
@@ -459,7 +541,16 @@
|
|
|
459
541
|
"if": {
|
|
460
542
|
"required": [
|
|
461
543
|
"position"
|
|
462
|
-
]
|
|
544
|
+
],
|
|
545
|
+
"not": {
|
|
546
|
+
"required": ["layout"],
|
|
547
|
+
"properties": {
|
|
548
|
+
"layout": {
|
|
549
|
+
"required": ["type"],
|
|
550
|
+
"properties": { "type": { "enum": ["list", "table"] } }
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
}
|
|
463
554
|
},
|
|
464
555
|
"then": {
|
|
465
556
|
"properties": {
|
|
@@ -676,6 +767,12 @@
|
|
|
676
767
|
"color": {
|
|
677
768
|
"$ref": "#/definitions/hexColor"
|
|
678
769
|
},
|
|
770
|
+
"feather": {
|
|
771
|
+
"type": "number",
|
|
772
|
+
"minimum": 0,
|
|
773
|
+
"maximum": 1,
|
|
774
|
+
"description": "Soft edge: the fraction of the half-size that fades out toward the border (Rothko's block at 0.5\u20130.8). Default 0 = hard."
|
|
775
|
+
},
|
|
679
776
|
"colors": {
|
|
680
777
|
"type": "array",
|
|
681
778
|
"minItems": 1,
|
|
@@ -690,6 +787,70 @@
|
|
|
690
787
|
},
|
|
691
788
|
"description": "Axis-aligned rectangle (rotates with spin) \u2014 Mondrian blocks, confetti, city lights."
|
|
692
789
|
},
|
|
790
|
+
{
|
|
791
|
+
"type": "object",
|
|
792
|
+
"required": ["kind", "values", "length", "thickness", "color"],
|
|
793
|
+
"additionalProperties": false,
|
|
794
|
+
"properties": {
|
|
795
|
+
"kind": { "const": "bar" },
|
|
796
|
+
"values": { "type": "array", "minItems": 1, "maxItems": 400, "items": { "type": "number", "minimum": 0 }, "description": "One value per entity in reading order; bar i is length x values[i] / max. Paint: steer layers.N.sprite.values and the bars glide." },
|
|
797
|
+
"length": { "type": "number", "exclusiveMinimum": 0, "description": "Full-scale bar length (px or viewport-units of min(w,h))." },
|
|
798
|
+
"thickness": { "type": "number", "exclusiveMinimum": 0, "description": "Bar thickness (px or viewport-units)." },
|
|
799
|
+
"color": { "$ref": "#/definitions/hexColor" },
|
|
800
|
+
"max": { "type": "number", "exclusiveMinimum": 0, "description": "Full-scale value. Default: the largest value." },
|
|
801
|
+
"direction": { "enum": ["right", "left", "up", "down"], "description": "Growth direction from the entity's position. Default right." },
|
|
802
|
+
"colors": { "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/hexColor" }, "description": "Per-entity color palette (in order under a list/table layout, seeded otherwise)." },
|
|
803
|
+
"colorWeights": { "$ref": "#/definitions/colorWeights" }
|
|
804
|
+
},
|
|
805
|
+
"description": "A data bar whose length is a number. Pair with a list layout for a chart that is one layer."
|
|
806
|
+
},
|
|
807
|
+
{
|
|
808
|
+
"type": "object",
|
|
809
|
+
"required": ["kind", "radius", "color"],
|
|
810
|
+
"additionalProperties": false,
|
|
811
|
+
"properties": {
|
|
812
|
+
"kind": { "const": "polygon" },
|
|
813
|
+
"radius": { "$ref": "#/definitions/positiveRange", "description": "Circumradius range (px or viewport-units)." },
|
|
814
|
+
"color": { "$ref": "#/definitions/hexColor" },
|
|
815
|
+
"sides": { "type": "integer", "minimum": 3, "maximum": 12, "description": "Regular n-gon, point up. Default 6. Not with points." },
|
|
816
|
+
"points": {
|
|
817
|
+
"type": "array",
|
|
818
|
+
"minItems": 3,
|
|
819
|
+
"maxItems": 24,
|
|
820
|
+
"items": { "type": "array", "minItems": 2, "maxItems": 2, "items": { "type": "number", "minimum": -1, "maximum": 1 } },
|
|
821
|
+
"description": "Custom vertices in unit coordinates (-1..1), scaled by the radius. Not with sides."
|
|
822
|
+
},
|
|
823
|
+
"soft": { "type": "boolean", "description": "Feather the fill from the centre, like a soft circle." },
|
|
824
|
+
"colors": { "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/hexColor" }, "description": "Per-entity color palette (seeded pick)." },
|
|
825
|
+
"colorWeights": { "$ref": "#/definitions/colorWeights" }
|
|
826
|
+
},
|
|
827
|
+
"not": { "required": ["sides", "points"] },
|
|
828
|
+
"description": "Regular or custom polygon (rotates with spin) \u2014 a facet, a triangle, a plane, a mosaic tile."
|
|
829
|
+
},
|
|
830
|
+
{
|
|
831
|
+
"type": "object",
|
|
832
|
+
"required": ["kind", "length", "points", "color"],
|
|
833
|
+
"additionalProperties": false,
|
|
834
|
+
"properties": {
|
|
835
|
+
"kind": { "const": "stroke" },
|
|
836
|
+
"length": { "$ref": "#/definitions/positiveRange", "description": "Bounding size range of the mark (px or viewport-units); the unit box is scaled to it." },
|
|
837
|
+
"points": {
|
|
838
|
+
"type": "array",
|
|
839
|
+
"minItems": 2,
|
|
840
|
+
"maxItems": 24,
|
|
841
|
+
"items": { "type": "array", "minItems": 2, "maxItems": 2, "items": { "type": "number", "minimum": -1, "maximum": 1 } },
|
|
842
|
+
"description": "Path control points in unit coordinates (-1..1)."
|
|
843
|
+
},
|
|
844
|
+
"color": { "$ref": "#/definitions/hexColor" },
|
|
845
|
+
"width": { "type": "number", "exclusiveMinimum": 0, "description": "Stroke width (px or viewport-units). Default 0.002 viewport-units / 2 px." },
|
|
846
|
+
"curve": { "enum": ["smooth", "linear"], "description": "Catmull-Rom spline through the points (default) or a polyline." },
|
|
847
|
+
"taper": { "type": "boolean", "description": "Thin the mark to almost nothing at both ends \u2014 a brush stroke rather than a line." },
|
|
848
|
+
"orient": { "type": "boolean", "description": "Turn the path's +x along the entity's heading (like streak)." },
|
|
849
|
+
"colors": { "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/hexColor" }, "description": "Per-entity color palette (seeded pick)." },
|
|
850
|
+
"colorWeights": { "$ref": "#/definitions/colorWeights" }
|
|
851
|
+
},
|
|
852
|
+
"description": "A freehand mark: a path stroked with round joins, optionally tapered and heading-oriented. Rotates with spin."
|
|
853
|
+
},
|
|
693
854
|
{
|
|
694
855
|
"type": "object",
|
|
695
856
|
"required": [
|
|
@@ -795,6 +956,16 @@
|
|
|
795
956
|
"type": "boolean",
|
|
796
957
|
"description": "Randomly flip horizontal direction per entity (fish)."
|
|
797
958
|
},
|
|
959
|
+
"ease": {
|
|
960
|
+
"type": "object",
|
|
961
|
+
"required": ["type", "tau"],
|
|
962
|
+
"additionalProperties": false,
|
|
963
|
+
"properties": {
|
|
964
|
+
"type": { "enum": ["settle", "buoyant"] },
|
|
965
|
+
"tau": { "type": "number", "minimum": 100, "maximum": 120000, "description": "Time constant in ms." }
|
|
966
|
+
},
|
|
967
|
+
"description": "Closed-form velocity easing: settle decelerates from speed to rest (travels speed x tau); buoyant accelerates from rest to speed. With emit, restarts every event."
|
|
968
|
+
},
|
|
798
969
|
"bob": {
|
|
799
970
|
"type": "number",
|
|
800
971
|
"description": "Vertical wobble amplitude in px."
|
|
@@ -815,6 +986,16 @@
|
|
|
815
986
|
"speed": {
|
|
816
987
|
"$ref": "#/definitions/speedRange"
|
|
817
988
|
},
|
|
989
|
+
"ease": {
|
|
990
|
+
"type": "object",
|
|
991
|
+
"required": ["type", "tau"],
|
|
992
|
+
"additionalProperties": false,
|
|
993
|
+
"properties": {
|
|
994
|
+
"type": { "enum": ["settle", "buoyant"] },
|
|
995
|
+
"tau": { "type": "number", "minimum": 100, "maximum": 120000, "description": "Time constant in ms." }
|
|
996
|
+
},
|
|
997
|
+
"description": "Closed-form velocity easing: settle decelerates from speed to rest (travels speed x tau); buoyant accelerates from rest to speed. With emit, restarts every event."
|
|
998
|
+
},
|
|
818
999
|
"sway": {
|
|
819
1000
|
"type": "number",
|
|
820
1001
|
"description": "Horizontal sway amplitude in px (bubbles)."
|
|
@@ -942,6 +1123,16 @@
|
|
|
942
1123
|
"exclusiveMinimum": 0,
|
|
943
1124
|
"description": "Harmonic amplitude (px or viewport-units). Default ~0.05 viewport-units. How far paths curve away from the base line."
|
|
944
1125
|
},
|
|
1126
|
+
"ease": {
|
|
1127
|
+
"type": "object",
|
|
1128
|
+
"required": ["type", "tau"],
|
|
1129
|
+
"additionalProperties": false,
|
|
1130
|
+
"properties": {
|
|
1131
|
+
"type": { "enum": ["settle", "buoyant"] },
|
|
1132
|
+
"tau": { "type": "number", "minimum": 100, "maximum": 120000, "description": "Time constant in ms." }
|
|
1133
|
+
},
|
|
1134
|
+
"description": "Closed-form velocity easing: settle decelerates from speed to rest (travels speed x tau); buoyant accelerates from rest to speed. With emit, restarts every event."
|
|
1135
|
+
},
|
|
945
1136
|
"coherence": {
|
|
946
1137
|
"type": "number",
|
|
947
1138
|
"minimum": 0,
|
|
@@ -1099,6 +1290,10 @@
|
|
|
1099
1290
|
],
|
|
1100
1291
|
"description": "Advisory intensity for capability/reduced-motion gating."
|
|
1101
1292
|
},
|
|
1293
|
+
"density": {
|
|
1294
|
+
"enum": ["sparse", "normal", "dense"],
|
|
1295
|
+
"description": "Declared density intent. sparse withholds the sparse-scene advisory (the emptiness is the point); dense withholds dense-scene. Checked against measured coverage (density-mismatch). A hint only — changes no pixel."
|
|
1296
|
+
},
|
|
1102
1297
|
"units": {
|
|
1103
1298
|
"enum": [
|
|
1104
1299
|
"px",
|