@dicebear/schema 0.10.0 → 0.11.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/src/options.json CHANGED
@@ -14,12 +14,13 @@
14
14
  },
15
15
  "scale": {
16
16
  "type": "number",
17
- "minimum": 0
17
+ "minimum": 0,
18
+ "maximum": 10
18
19
  },
19
20
  "translate": {
20
21
  "type": "number",
21
- "minimum": -100,
22
- "maximum": 100
22
+ "minimum": -1000,
23
+ "maximum": 1000
23
24
  },
24
25
  "borderRadius": {
25
26
  "type": "number",
@@ -40,12 +41,40 @@
40
41
  },
41
42
  "fontFamilyName": {
42
43
  "type": "string",
43
- "pattern": "^[a-zA-Z0-9 _\\-]+$"
44
+ "pattern": "^[a-zA-Z0-9_\\-]+( [a-zA-Z0-9_\\-]+)*(, ?[a-zA-Z0-9_\\-]+( [a-zA-Z0-9_\\-]+)*)*$",
45
+ "maxLength": 256
44
46
  },
45
47
  "fontWeight": {
46
48
  "type": "integer",
47
49
  "minimum": 1,
48
50
  "maximum": 1000
51
+ },
52
+ "variantName": {
53
+ "type": "string",
54
+ "pattern": "^[a-z][a-zA-Z0-9]*$",
55
+ "maxLength": 64
56
+ },
57
+ "rotateOption": {
58
+ "anyOf": [
59
+ { "$ref": "#/definitions/rotate" },
60
+ {
61
+ "type": "array",
62
+ "items": { "$ref": "#/definitions/rotate" },
63
+ "minItems": 1,
64
+ "maxItems": 2
65
+ }
66
+ ]
67
+ },
68
+ "translateOption": {
69
+ "anyOf": [
70
+ { "$ref": "#/definitions/translate" },
71
+ {
72
+ "type": "array",
73
+ "items": { "$ref": "#/definitions/translate" },
74
+ "minItems": 1,
75
+ "maxItems": 2
76
+ }
77
+ ]
49
78
  }
50
79
  },
51
80
  "properties": {
@@ -57,7 +86,8 @@
57
86
  "size": {
58
87
  "type": "integer",
59
88
  "description": "Specifies the dimensions of the avatar in pixels. If no size is specified, the avatar defaults to a responsive design or scales to 100% of its container. This flexibility allows the avatar to seamlessly adapt to different screen sizes and layouts, ensuring optimal display across devices and environments.",
60
- "minimum": 1
89
+ "minimum": 1,
90
+ "maximum": 4096
61
91
  },
62
92
  "idRandomization": {
63
93
  "type": "boolean",
@@ -70,7 +100,7 @@
70
100
  },
71
101
  "flip": {
72
102
  "description": "Specifies how the avatar will be flipped. Options include `none` for no flip, `horizontal` for a left-to-right flip, `vertical` for an upside-down flip, and `both` for a complete flip. If specified as an array, the PRNG will choose from the available options.",
73
- "oneOf": [
103
+ "anyOf": [
74
104
  {
75
105
  "$ref": "#/definitions/flip"
76
106
  },
@@ -79,13 +109,14 @@
79
109
  "items": {
80
110
  "$ref": "#/definitions/flip"
81
111
  },
112
+ "minItems": 1,
82
113
  "maxItems": 128
83
114
  }
84
115
  ]
85
116
  },
86
117
  "fontFamily": {
87
118
  "description": "Specifies the font family used for text rendering. If specified as an array, the PRNG will choose from the available options.",
88
- "oneOf": [
119
+ "anyOf": [
89
120
  {
90
121
  "$ref": "#/definitions/fontFamilyName"
91
122
  },
@@ -94,13 +125,14 @@
94
125
  "items": {
95
126
  "$ref": "#/definitions/fontFamilyName"
96
127
  },
128
+ "minItems": 1,
97
129
  "maxItems": 128
98
130
  }
99
131
  ]
100
132
  },
101
133
  "fontWeight": {
102
134
  "description": "Specifies the font weight used for text rendering. The value must be an integer between 1 and 1000. If specified as an array, the PRNG will choose from the available options.",
103
- "oneOf": [
135
+ "anyOf": [
104
136
  {
105
137
  "$ref": "#/definitions/fontWeight"
106
138
  },
@@ -109,13 +141,14 @@
109
141
  "items": {
110
142
  "$ref": "#/definitions/fontWeight"
111
143
  },
144
+ "minItems": 1,
112
145
  "maxItems": 128
113
146
  }
114
147
  ]
115
148
  },
116
149
  "scale": {
117
150
  "description": "Sets the scaling of the avatar. A value of `1` corresponds to the original size of the avatar. This setting affects the size of the avatar itself, but not the size of the avatar container; any excess content will be clipped. If specified as an array, the PRNG will select a value within the specified range, including the values themselves.",
118
- "oneOf": [
151
+ "anyOf": [
119
152
  {
120
153
  "$ref": "#/definitions/scale"
121
154
  },
@@ -124,13 +157,14 @@
124
157
  "items": {
125
158
  "$ref": "#/definitions/scale"
126
159
  },
160
+ "minItems": 1,
127
161
  "maxItems": 2
128
162
  }
129
163
  ]
130
164
  },
131
165
  "borderRadius": {
132
166
  "description": "This is the radius of the corners of the avatar. This value can be a float or an integer. A value of 0 means that the avatar has sharp corners, while larger values result in more rounded corners. The maximum value is 50, which turns the avatar into a complete circle. If specified as an array, the PRNG will select a value within the specified range, including the values themselves.",
133
- "oneOf": [
167
+ "anyOf": [
134
168
  {
135
169
  "$ref": "#/definitions/borderRadius"
136
170
  },
@@ -139,6 +173,7 @@
139
173
  "items": {
140
174
  "$ref": "#/definitions/borderRadius"
141
175
  },
176
+ "minItems": 1,
142
177
  "maxItems": 2
143
178
  }
144
179
  ]
@@ -152,34 +187,34 @@
152
187
  "maximum": 100
153
188
  },
154
189
  "^[a-z][a-zA-Z0-9]*Variant$": {
155
- "description": "Specifies which variants of the avatar part can be selected by the PRNG and their relative weights. A string or array of strings filters which variants the PRNG can choose from. An object maps variant names to non-negative weights, simultaneously filtering and weighting selection.",
156
- "oneOf": [
190
+ "description": "Specifies which variants of the avatar part can be selected by the PRNG and their relative weights. A string or array of strings filters which variants the PRNG can choose from. An object maps variant names to non-negative weights, simultaneously filtering and weighting selection. Variant names must be camelCase identifiers.",
191
+ "anyOf": [
157
192
  {
158
- "type": "string"
193
+ "$ref": "#/definitions/variantName"
159
194
  },
160
195
  {
161
196
  "type": "array",
162
197
  "items": {
163
- "type": "string"
198
+ "$ref": "#/definitions/variantName"
164
199
  },
200
+ "minItems": 1,
165
201
  "maxItems": 128
166
202
  },
167
203
  {
168
204
  "type": "object",
169
- "propertyNames": {
170
- "pattern": "^[a-z][a-zA-Z0-9]*$"
171
- },
205
+ "propertyNames": { "$ref": "#/definitions/variantName" },
172
206
  "additionalProperties": {
173
207
  "type": "number",
174
208
  "minimum": 0
175
209
  },
210
+ "minProperties": 1,
176
211
  "maxProperties": 128
177
212
  }
178
213
  ]
179
214
  },
180
215
  "^[a-z][a-zA-Z0-9]*Color$": {
181
216
  "description": "Specifies which colors for the avatar component can be selected by the PRNG. If specified as a string or array with only one value, the value is fixed. However, if specified as an array with multiple values, the PRNG will choose from the available options. The color must be specified as a hex value.",
182
- "oneOf": [
217
+ "anyOf": [
183
218
  {
184
219
  "$ref": "#/definitions/color"
185
220
  },
@@ -188,13 +223,14 @@
188
223
  "items": {
189
224
  "$ref": "#/definitions/color"
190
225
  },
226
+ "minItems": 1,
191
227
  "maxItems": 128
192
228
  }
193
229
  ]
194
230
  },
195
231
  "^[a-z][a-zA-Z0-9]*ColorFill$": {
196
232
  "description": "Specifies the color fill method for the avatar component. Options include `solid` for a flat color, `linear` for a linear gradient, and `radial` for a radial gradient. If specified as a string or array with only one value, the value is fixed. However, if specified as an array with multiple values, the PRNG will choose from the available options.",
197
- "oneOf": [
233
+ "anyOf": [
198
234
  {
199
235
  "$ref": "#/definitions/colorFill"
200
236
  },
@@ -203,13 +239,14 @@
203
239
  "items": {
204
240
  "$ref": "#/definitions/colorFill"
205
241
  },
242
+ "minItems": 1,
206
243
  "maxItems": 128
207
244
  }
208
245
  ]
209
246
  },
210
247
  "^[a-z][a-zA-Z0-9]*ColorFillStops$": {
211
- "description": "Specifies the number of color stops for gradient fills. This value is only relevant when the color fill method is set to `linear` or `radial`. The minimum value is 1. If specified as an array, the PRNG will select a value within the specified range, including the values themselves.",
212
- "oneOf": [
248
+ "description": "Specifies the number of color stops for gradient fills. This value is only relevant when the color fill method is set to `linear` or `radial`. The minimum value is 2. If specified as an array, the PRNG will select a value within the specified range, including the values themselves.",
249
+ "anyOf": [
213
250
  {
214
251
  "$ref": "#/definitions/colorFillStops"
215
252
  },
@@ -218,70 +255,41 @@
218
255
  "items": {
219
256
  "$ref": "#/definitions/colorFillStops"
220
257
  },
258
+ "minItems": 1,
221
259
  "maxItems": 2
222
260
  }
223
261
  ]
224
262
  },
225
263
  "^[a-z][a-zA-Z0-9]*ColorAngle$": {
226
264
  "description": "Specifies the angle for the color gradient. This value can be an integer or a float. A value of 0 results in no rotation, while values between -360 and 360 define the degree of rotation. If specified as an array, the PRNG will select a value within the specified range, including the values themselves.",
227
- "oneOf": [
228
- {
229
- "$ref": "#/definitions/rotate"
230
- },
231
- {
232
- "type": "array",
233
- "items": {
234
- "$ref": "#/definitions/rotate"
235
- },
236
- "maxItems": 2
237
- }
238
- ]
265
+ "allOf": [{ "$ref": "#/definitions/rotateOption" }]
239
266
  },
240
- "^(r|[a-z][a-zA-Z0-9]*R)otate$": {
241
- "description": "This is the rotation angle for the avatar or its parts. This value can be an integer or a float. A value of 0 results in no rotation, while values between -360 and 360 define the degree of rotation in both directions. If specified as an array, the PRNG will select a value within the specified range, including the values themselves. If not preceded by an avatar part, the option applies to the entire avatar.",
242
- "oneOf": [
243
- {
244
- "$ref": "#/definitions/rotate"
245
- },
246
- {
247
- "type": "array",
248
- "items": {
249
- "$ref": "#/definitions/rotate"
250
- },
251
- "maxItems": 2
252
- }
253
- ]
267
+ "^rotate$": {
268
+ "description": "This is the rotation angle for the entire avatar. This value can be an integer or a float. A value of 0 results in no rotation, while values between -360 and 360 define the degree of rotation in both directions. If specified as an array, the PRNG will select a value within the specified range, including the values themselves.",
269
+ "allOf": [{ "$ref": "#/definitions/rotateOption" }]
254
270
  },
255
- "^(t|[a-z][a-zA-Z0-9]*T)ranslateY$": {
256
- "description": "This is the vertical translation of the avatar or its parts. This value can be an integer or a float. A value of 0 results in no translation, while positive values move the part down and negative values move it up. If specified as an array, the PRNG will select a value within the specified range, including the values themselves. If no avatar part is specified, the option applies to the entire avatar.",
257
- "oneOf": [
258
- {
259
- "$ref": "#/definitions/translate"
260
- },
261
- {
262
- "type": "array",
263
- "items": {
264
- "$ref": "#/definitions/translate"
265
- },
266
- "maxItems": 2
267
- }
268
- ]
271
+ "^[a-z][a-zA-Z0-9]*Rotate$": {
272
+ "description": "This is the rotation angle for a specific avatar part, prefixed with the part name in camelCase. This value can be an integer or a float. A value of 0 results in no rotation, while values between -360 and 360 define the degree of rotation in both directions. If specified as an array, the PRNG will select a value within the specified range, including the values themselves.",
273
+ "allOf": [{ "$ref": "#/definitions/rotateOption" }]
269
274
  },
270
- "^(t|[a-z][a-zA-Z0-9]*T)ranslateX$": {
271
- "description": "This is the horizontal translation of the avatar or its parts. This value can be an integer or a float. A value of 0 results in no translation, while positive values move the part to the right and negative values move it to the left. If specified as an array, the PRNG will select a value within the specified range, including the values themselves. If no avatar part is specified, the option applies to the entire avatar.",
272
- "oneOf": [
273
- {
274
- "$ref": "#/definitions/translate"
275
- },
276
- {
277
- "type": "array",
278
- "items": {
279
- "$ref": "#/definitions/translate"
280
- },
281
- "maxItems": 2
282
- }
283
- ]
275
+ "^translateY$": {
276
+ "description": "This is the vertical translation of the entire avatar. This value can be an integer or a float. A value of 0 results in no translation, while positive values move the avatar down and negative values move it up. If specified as an array, the PRNG will select a value within the specified range, including the values themselves.",
277
+ "allOf": [{ "$ref": "#/definitions/translateOption" }]
278
+ },
279
+ "^[a-z][a-zA-Z0-9]*TranslateY$": {
280
+ "description": "This is the vertical translation of a specific avatar part, prefixed with the part name in camelCase. This value can be an integer or a float. A value of 0 results in no translation, while positive values move the part down and negative values move it up. If specified as an array, the PRNG will select a value within the specified range, including the values themselves.",
281
+ "allOf": [{ "$ref": "#/definitions/translateOption" }]
282
+ },
283
+ "^translateX$": {
284
+ "description": "This is the horizontal translation of the entire avatar. This value can be an integer or a float. A value of 0 results in no translation, while positive values move the avatar to the right and negative values move it to the left. If specified as an array, the PRNG will select a value within the specified range, including the values themselves.",
285
+ "allOf": [{ "$ref": "#/definitions/translateOption" }]
286
+ },
287
+ "^[a-z][a-zA-Z0-9]*TranslateX$": {
288
+ "description": "This is the horizontal translation of a specific avatar part, prefixed with the part name in camelCase. This value can be an integer or a float. A value of 0 results in no translation, while positive values move the part to the right and negative values move it to the left. If specified as an array, the PRNG will select a value within the specified range, including the values themselves.",
289
+ "allOf": [{ "$ref": "#/definitions/translateOption" }]
284
290
  }
285
291
  },
286
- "additionalProperties": false
292
+ "propertyNames": { "maxLength": 128 },
293
+ "additionalProperties": false,
294
+ "maxProperties": 256
287
295
  }