@idle-screens/schema 3.12.0 → 3.13.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 +111 -19
- package/dist/index.d.ts +170 -9
- package/dist/index.js +1998 -344
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/saver-spec.schema.json +105 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@idle-screens/schema",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.13.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
|
@@ -12,6 +12,60 @@
|
|
|
12
12
|
}
|
|
13
13
|
],
|
|
14
14
|
"definitions": {
|
|
15
|
+
"pathD": { "type": "string", "minLength": 1, "maxLength": 65536, "description": "An SVG path d string (M L H V C S Q T A Z, absolute or relative) in the -1..1 unit box; flattens to at most 4096 points." },
|
|
16
|
+
"pathFillRule": { "enum": ["auto", "nonzero", "evenodd"], "description": "auto (default): a subpath entirely inside another is a hole, overlaps merge; nonzero / evenodd: SVG's rules." },
|
|
17
|
+
"pathPoint": { "type": "array", "minItems": 2, "maxItems": 2, "items": { "type": "number", "minimum": -2, "maximum": 2 } },
|
|
18
|
+
"pathStop": {
|
|
19
|
+
"type": "object",
|
|
20
|
+
"required": ["at", "color"],
|
|
21
|
+
"additionalProperties": false,
|
|
22
|
+
"properties": { "at": { "type": "number", "minimum": 0, "maximum": 1 }, "color": { "$ref": "#/definitions/hexColor" }, "opacity": { "type": "number", "minimum": 0, "maximum": 1 } }
|
|
23
|
+
},
|
|
24
|
+
"pathGradient": {
|
|
25
|
+
"oneOf": [
|
|
26
|
+
{
|
|
27
|
+
"type": "object",
|
|
28
|
+
"required": ["type", "from", "to", "stops"],
|
|
29
|
+
"additionalProperties": false,
|
|
30
|
+
"properties": { "type": { "const": "linear" }, "from": { "$ref": "#/definitions/pathPoint" }, "to": { "$ref": "#/definitions/pathPoint" }, "units": { "enum": ["box", "part"] }, "stops": { "type": "array", "minItems": 2, "maxItems": 8, "items": { "$ref": "#/definitions/pathStop" } } }
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"type": "object",
|
|
34
|
+
"required": ["type", "center", "radius", "stops"],
|
|
35
|
+
"additionalProperties": false,
|
|
36
|
+
"properties": { "type": { "const": "radial" }, "center": { "$ref": "#/definitions/pathPoint" }, "radius": { "type": "number", "exclusiveMinimum": 0, "maximum": 4 }, "focus": { "$ref": "#/definitions/pathPoint" }, "units": { "enum": ["box", "part"] }, "stops": { "type": "array", "minItems": 2, "maxItems": 8, "items": { "$ref": "#/definitions/pathStop" } } }
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"description": "A gradient fill in unit-box coordinates (units: part = the part's own box as -1..1)."
|
|
40
|
+
},
|
|
41
|
+
"pathStroke": {
|
|
42
|
+
"type": "object",
|
|
43
|
+
"required": ["color", "width"],
|
|
44
|
+
"additionalProperties": false,
|
|
45
|
+
"properties": {
|
|
46
|
+
"color": { "$ref": "#/definitions/hexColor" },
|
|
47
|
+
"width": { "type": "number", "exclusiveMinimum": 0, "maximum": 0.5, "description": "Unit-box units (0.01 = 1% of the drawing's half-size)." },
|
|
48
|
+
"opacity": { "type": "number", "minimum": 0, "maximum": 1 },
|
|
49
|
+
"join": { "enum": ["round", "miter", "bevel"] },
|
|
50
|
+
"cap": { "enum": ["round", "butt", "square"] }
|
|
51
|
+
},
|
|
52
|
+
"description": "An outline along every subpath as drawn."
|
|
53
|
+
},
|
|
54
|
+
"pathPart": {
|
|
55
|
+
"type": "object",
|
|
56
|
+
"required": ["path"],
|
|
57
|
+
"additionalProperties": false,
|
|
58
|
+
"properties": {
|
|
59
|
+
"path": { "$ref": "#/definitions/pathD" },
|
|
60
|
+
"color": { "$ref": "#/definitions/hexColor" },
|
|
61
|
+
"fillRule": { "$ref": "#/definitions/pathFillRule" },
|
|
62
|
+
"fill": { "type": "boolean" },
|
|
63
|
+
"gradient": { "$ref": "#/definitions/pathGradient" },
|
|
64
|
+
"stroke": { "$ref": "#/definitions/pathStroke" },
|
|
65
|
+
"opacity": { "type": "number", "minimum": 0, "maximum": 1 }
|
|
66
|
+
},
|
|
67
|
+
"description": "One piece of a multi-colour path drawing."
|
|
68
|
+
},
|
|
15
69
|
"hexColor": {
|
|
16
70
|
"type": "string",
|
|
17
71
|
"pattern": "^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$",
|
|
@@ -518,22 +572,51 @@
|
|
|
518
572
|
},
|
|
519
573
|
"links": {
|
|
520
574
|
"type": "object",
|
|
521
|
-
"
|
|
522
|
-
"
|
|
523
|
-
|
|
524
|
-
|
|
575
|
+
"if": {
|
|
576
|
+
"properties": {
|
|
577
|
+
"mode": {
|
|
578
|
+
"const": "chain"
|
|
579
|
+
}
|
|
580
|
+
},
|
|
581
|
+
"required": [
|
|
582
|
+
"mode"
|
|
583
|
+
]
|
|
584
|
+
},
|
|
585
|
+
"then": {
|
|
586
|
+
"if": {
|
|
587
|
+
"properties": {
|
|
588
|
+
"falloff": {
|
|
589
|
+
"const": true
|
|
590
|
+
}
|
|
591
|
+
},
|
|
592
|
+
"required": [
|
|
593
|
+
"falloff"
|
|
594
|
+
]
|
|
595
|
+
},
|
|
596
|
+
"then": {
|
|
597
|
+
"required": [
|
|
598
|
+
"maxDist"
|
|
599
|
+
]
|
|
600
|
+
}
|
|
601
|
+
},
|
|
602
|
+
"else": {
|
|
603
|
+
"required": [
|
|
604
|
+
"k",
|
|
605
|
+
"maxDist"
|
|
606
|
+
]
|
|
607
|
+
},
|
|
525
608
|
"additionalProperties": false,
|
|
526
609
|
"properties": {
|
|
527
610
|
"k": {
|
|
528
611
|
"type": "integer",
|
|
529
612
|
"minimum": 1,
|
|
530
613
|
"maximum": 8,
|
|
531
|
-
"description": "
|
|
614
|
+
"description": "Partners per entity (nearest/random modes; required there). Chain mode ignores it."
|
|
532
615
|
},
|
|
533
616
|
"maxDist": {
|
|
534
617
|
"type": "number",
|
|
535
618
|
"exclusiveMinimum": 0,
|
|
536
|
-
"description": "Maximum link distance (px or viewport-units)."
|
|
619
|
+
"description": "Maximum link distance (px or viewport-units). Required for nearest/random; chain mode ignores it as a cutoff and needs it only with falloff: true, as the fade distance."
|
|
537
620
|
},
|
|
538
621
|
"color": {
|
|
539
622
|
"$ref": "#/definitions/hexColor",
|
|
@@ -1026,10 +1109,23 @@
|
|
|
1026
1109
|
},
|
|
1027
1110
|
"soft": { "type": "boolean", "description": "Feather the fill from the centre, like a soft circle." },
|
|
1028
1111
|
"colors": { "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/hexColor" }, "description": "Per-entity color palette (seeded pick)." },
|
|
1029
|
-
"colorWeights": { "$ref": "#/definitions/colorWeights" }
|
|
1112
|
+
"colorWeights": { "$ref": "#/definitions/colorWeights" },
|
|
1113
|
+
"path": { "$ref": "#/definitions/pathD" },
|
|
1114
|
+
"fillRule": { "$ref": "#/definitions/pathFillRule" },
|
|
1115
|
+
"fill": { "type": "boolean", "description": "false draws the stroke only (line art; open paths allowed). Path drawings only." },
|
|
1116
|
+
"gradient": { "$ref": "#/definitions/pathGradient" },
|
|
1117
|
+
"stroke": { "$ref": "#/definitions/pathStroke" },
|
|
1118
|
+
"parts": { "type": "array", "minItems": 1, "maxItems": 256, "items": { "$ref": "#/definitions/pathPart" }, "description": "A multi-colour drawing: parts drawn back to front, each with its own path and paint. Not with path/points/sides/gradient/stroke/fill/fillRule on the sprite." },
|
|
1119
|
+
"span": { "enum": ["box", "width", "height", "screen"], "description": "How the unit box lands on screen: box (default, radius-sized square), width (x spans the screen width), height, screen (both). Path drawings only." },
|
|
1120
|
+
"origin": { "type": "array", "minItems": 2, "maxItems": 2, "items": { "type": "number", "minimum": -1, "maximum": 1 }, "description": "The unit-box point placed at the position, e.g. [0, 1] puts the drawing's base at position.y. Path drawings only." }
|
|
1030
1121
|
},
|
|
1031
|
-
"
|
|
1032
|
-
|
|
1122
|
+
"allOf": [
|
|
1123
|
+
{ "not": { "required": ["sides", "points"] } },
|
|
1124
|
+
{ "not": { "required": ["path", "points"] } },
|
|
1125
|
+
{ "not": { "required": ["path", "sides"] } },
|
|
1126
|
+
{ "not": { "required": ["parts", "path"] } }
|
|
1127
|
+
],
|
|
1128
|
+
"description": "Regular or custom polygon (rotates with spin) \u2014 a facet, a triangle, a plane, a mosaic tile \u2014 or, with path / parts, a vector drawing (SVG path d strings, gradients, strokes)."
|
|
1033
1129
|
},
|
|
1034
1130
|
{
|
|
1035
1131
|
"type": "object",
|