@dicebear/schema 0.8.1 → 0.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/README.md CHANGED
@@ -66,8 +66,8 @@ composer require dicebear/schema
66
66
  The schemas are available directly via CDN — no installation required. We recommend using a specific version to ensure stability:
67
67
 
68
68
  ```
69
- https://cdn.hopjs.net/npm/@dicebear/schema@0.8.1/dist/definition.min.json
70
- https://cdn.hopjs.net/npm/@dicebear/schema@0.8.1/dist/options.min.json
69
+ https://cdn.hopjs.net/npm/@dicebear/schema@0.10.0/dist/definition.min.json
70
+ https://cdn.hopjs.net/npm/@dicebear/schema@0.10.0/dist/options.min.json
71
71
  ```
72
72
 
73
73
  ## Usage
@@ -82,8 +82,10 @@ import optionsSchema from '@dicebear/schema/options.json' assert { type: 'json'
82
82
  **PHP**
83
83
 
84
84
  ```php
85
- $definition = json_decode(file_get_contents(__DIR__ . '/vendor/dicebear/schema/src/definition.json'), true);
86
- $options = json_decode(file_get_contents(__DIR__ . '/vendor/dicebear/schema/src/options.json'), true);
85
+ $basePath = \Composer\InstalledVersions::getInstallPath('dicebear/schema');
86
+
87
+ $definition = json_decode(file_get_contents($basePath . '/src/definition.json'), true);
88
+ $options = json_decode(file_get_contents($basePath . '/src/options.json'), true);
87
89
  ```
88
90
 
89
91
  ## Development
@@ -1 +1 @@
1
- {"$id":"https://cdn.hopjs.net/npm/@dicebear/schema@0.8.1/dist/definition.min.json","$schema":"https://json-schema.org/draft/2020-12/schema","$defs":{"identifier":{"description":"A camelCase identifier starting with a lowercase letter. Used for component, variable, and color references.","type":"string","pattern":"^[a-z][a-zA-Z0-9]*$"},"colorAttribute":{"description":"A color value, either as a direct color string (named color, hex, rgb(a), hsl(a), hsb(a)) or as a reference to a named color defined in the `colors` section.","anyOf":[{"type":"string","anyOf":[{"pattern":"^[a-zA-Z]+$"},{"pattern":"^#([a-fA-F0-9]{3}|[a-fA-F0-9]{4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$"},{"pattern":"^rgba?\\(\\s*\\d+\\s*,\\s*\\d+\\s*,\\s*\\d+\\s*(,\\s*[0-1](\\.\\d+)?\\s*)?\\)$"},{"pattern":"^hsla?\\(\\s*\\d+\\s*,\\s*\\d+%\\s*,\\s*\\d+%\\s*(,\\s*[0-1](\\.\\d+)?\\s*)?\\)$"},{"pattern":"^hsba?\\(\\s*\\d+\\s*,\\s*\\d+%\\s*,\\s*\\d+%\\s*(,\\s*[0-1](\\.\\d+)?\\s*)?\\)$"}]},{"description":"A reference to a named color. At render time, the PRNG selects a color value from the referenced color.","type":"object","properties":{"type":{"type":"string","const":"color"},"value":{"description":"The name of the color to reference.","$ref":"#/$defs/identifier"}},"required":["type","value"],"additionalProperties":false}]},"safeUrl":{"description":"A URL restricted to HTTP and HTTPS protocols.","type":"string","pattern":"^https?://"},"paintAttribute":{"description":"A paint value for `fill` and `stroke` attributes. Accepts all color formats from `colorAttribute` as well as local SVG paint server references in the form `url(#id)`, e.g. for gradients or patterns.","anyOf":[{"$ref":"#/$defs/colorAttribute"},{"type":"string","pattern":"^url\\(#[a-zA-Z_][a-zA-Z0-9_.-]*\\)$"}]},"noExternalUrlRef":{"description":"A string that must not contain external URL references (e.g. `url(https://...)`) or CSS escape sequences (backslash). Local references such as `url(#id)` are permitted.","type":"string","not":{"anyOf":[{"pattern":"[uU][rR][lL]\\s*\\(\\s*[^#)]"},{"pattern":"\\\\"}]}},"noCssInjection":{"description":"A string that must not contain CSS injection patterns, including `@`-rules, `expression()`, `behavior:`, or `-moz-binding`.","type":"string","not":{"anyOf":[{"pattern":"@"},{"pattern":"[eE][xX][pP][rR][eE][sS][sS][iI][oO][nN]\\s*\\("},{"pattern":"[bB][eE][hH][aA][vV][iI][oO][rR]\\s*:"},{"pattern":"-[mM][oO][zZ]-[bB][iI][nN][dD][iI][nN][gG]"},{"pattern":"\\\\"}]}},"element":{"description":"An SVG node. Can be an actual SVG element (`element`), a raw text node (`text`), or a reference to a named component (`component`).","type":"object","properties":{"name":{"description":"The SVG tag name. Only a safe subset of SVG elements is permitted; dangerous elements such as `script`, `foreignObject`, or `a` are excluded.","type":"string","enum":["circle","clipPath","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","g","image","line","linearGradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialGradient","rect","stop","style","svg","switch","symbol","text","textPath","title","tspan","use","view"]},"type":{"description":"The node type. `element` renders an SVG tag, `text` renders a raw text node, `component` inserts a named component by reference.","type":"string","enum":["element","text","component"]},"value":{"description":"The text content for `text` nodes, the component name for `component` nodes, or the CSS content for `style` elements.","anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","const":"variable"},"value":{"type":"string","enum":["initial","initials"]}},"required":["type","value"],"additionalProperties":false}]},"attributes":{"description":"SVG presentation attributes to apply to this element.","$ref":"#/$defs/attributes"},"children":{"description":"Nested child elements. Only valid for `element` and `text` nodes.","type":"array","items":{"$ref":"#/$defs/element"}}},"required":["type"],"additionalProperties":false,"allOf":[{"if":{"properties":{"type":{"const":"component"}},"required":["type"]},"then":{"required":["value"],"properties":{"value":{"$ref":"#/$defs/identifier"}},"not":{"required":["children"]}}},{"if":{"properties":{"type":{"const":"element"}},"required":["type"]},"then":{"required":["name"],"if":{"properties":{"name":{"const":"style"}}},"then":{"properties":{"value":{"allOf":[{"$ref":"#/$defs/noExternalUrlRef"},{"$ref":"#/$defs/noCssInjection"}]}}},"else":{"not":{"required":["value"]}}}}]},"attributes":{"description":"A map of allowed SVG presentation attributes. Only a safe subset is permitted; event handlers (e.g. `onclick`) and namespace attributes (e.g. `xlink:href`) are not allowed.","type":"object","properties":{"alignment-baseline":{"type":"string"},"amplitude":{"type":"string"},"azimuth":{"type":"string"},"baseFrequency":{"type":"string"},"baseline-shift":{"type":"string"},"bias":{"type":"string"},"class":{"description":"CSS class name(s). Only alphanumeric characters, underscores, hyphens, and spaces are allowed.","type":"string","pattern":"^[a-zA-Z0-9_ -]+$"},"clipPathUnits":{"type":"string"},"clip-path":{"description":"References a clip path. External URL references are not allowed.","$ref":"#/$defs/noExternalUrlRef"},"clip-rule":{"type":"string"},"color":{"$ref":"#/$defs/colorAttribute"},"color-interpolation":{"type":"string"},"color-interpolation-filters":{"type":"string"},"crossorigin":{"type":"string"},"cx":{"type":"string"},"cy":{"type":"string"},"d":{"type":"string"},"decoding":{"type":"string"},"diffuseConstant":{"type":"string"},"direction":{"type":"string"},"display":{"type":"string"},"divisor":{"type":"string"},"dx":{"type":"string"},"dy":{"type":"string"},"edgeMode":{"type":"string"},"elevation":{"type":"string"},"exponent":{"type":"string"},"fill":{"description":"The fill color or paint server reference for this element.","$ref":"#/$defs/paintAttribute"},"fill-opacity":{"type":"string"},"fill-rule":{"type":"string"},"filter":{"description":"References a filter effect. External URL references are not allowed.","$ref":"#/$defs/noExternalUrlRef"},"filterUnits":{"type":"string"},"flood-color":{"$ref":"#/$defs/colorAttribute"},"flood-opacity":{"type":"string"},"font-family":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","const":"variable"},"value":{"type":"string","enum":["fontFamily"]}},"required":["type","value"],"additionalProperties":false}]},"font-size":{"type":"string"},"font-size-adjust":{"type":"string"},"font-style":{"type":"string"},"font-variant":{"type":"string"},"font-weight":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","const":"variable"},"value":{"type":"string","enum":["fontWeight"]}},"required":["type","value"],"additionalProperties":false}]},"fx":{"type":"string"},"fy":{"type":"string"},"gradientTransform":{"type":"string"},"gradientUnits":{"type":"string"},"height":{"type":"string"},"href":{"description":"A hyperlink reference. Only local fragment references (`#id`) and safe data URIs (raster images) are allowed.","anyOf":[{"type":"string","pattern":"^#[a-zA-Z0-9-]+$"},{"type":"string","pattern":"^data:image/(png|gif|jpg|jpeg|webp|avif);base64,[a-zA-Z0-9+/=]+$"}]},"id":{"description":"A unique identifier for the element. Must start with a letter or underscore.","type":"string","pattern":"^[a-zA-Z_][a-zA-Z0-9_.-]*$"},"image-rendering":{"type":"string"},"in":{"type":"string"},"in2":{"type":"string"},"intercept":{"type":"string"},"k1":{"type":"string"},"k2":{"type":"string"},"k3":{"type":"string"},"k4":{"type":"string"},"kernelMatrix":{"type":"string"},"kernelUnitLength":{"type":"string"},"lang":{"type":"string"},"lengthAdjust":{"type":"string"},"letter-spacing":{"type":"string"},"lighting-color":{"$ref":"#/$defs/colorAttribute"},"marker-end":{"description":"References a marker to draw at the end of a path. External URL references are not allowed.","$ref":"#/$defs/noExternalUrlRef"},"marker-mid":{"description":"References a marker to draw at intermediate vertices of a path. External URL references are not allowed.","$ref":"#/$defs/noExternalUrlRef"},"marker-start":{"description":"References a marker to draw at the start of a path. External URL references are not allowed.","$ref":"#/$defs/noExternalUrlRef"},"markerHeight":{"type":"string"},"markerUnits":{"type":"string"},"markerWidth":{"type":"string"},"mask":{"description":"References a mask element. External URL references are not allowed.","$ref":"#/$defs/noExternalUrlRef"},"maskContentUnits":{"type":"string"},"maskUnits":{"type":"string"},"media":{"type":"string"},"method":{"type":"string"},"mode":{"type":"string"},"numOctaves":{"type":"string"},"offset":{"type":"string"},"opacity":{"type":"string"},"operator":{"type":"string"},"order":{"type":"string"},"orient":{"type":"string"},"overflow":{"type":"string"},"paint-order":{"type":"string"},"path":{"type":"string"},"pathLength":{"type":"string"},"patternContentUnits":{"type":"string"},"patternTransform":{"type":"string"},"patternUnits":{"type":"string"},"points":{"type":"string"},"preserveAlpha":{"type":"string"},"preserveAspectRatio":{"type":"string"},"primitiveUnits":{"type":"string"},"r":{"type":"string"},"radius":{"type":"string"},"refX":{"type":"string"},"refY":{"type":"string"},"result":{"type":"string"},"rx":{"type":"string"},"ry":{"type":"string"},"scale":{"type":"string"},"seed":{"type":"string"},"shape-rendering":{"type":"string"},"slope":{"type":"string"},"specularConstant":{"type":"string"},"specularExponent":{"type":"string"},"spreadMethod":{"type":"string"},"startOffset":{"type":"string"},"stdDeviation":{"type":"string"},"stitchTiles":{"type":"string"},"stop-color":{"$ref":"#/$defs/colorAttribute"},"stop-opacity":{"type":"string"},"stroke":{"description":"The stroke color or paint server reference for this element.","$ref":"#/$defs/paintAttribute"},"stroke-dasharray":{"type":"string"},"stroke-dashoffset":{"type":"string"},"stroke-linecap":{"type":"string"},"stroke-linejoin":{"type":"string"},"stroke-miterlimit":{"type":"string"},"stroke-opacity":{"type":"string"},"stroke-width":{"type":"string"},"style":{"description":"Inline CSS styles. External URL references and CSS injection patterns are not allowed.","allOf":[{"$ref":"#/$defs/noExternalUrlRef"},{"$ref":"#/$defs/noCssInjection"}]},"surfaceScale":{"type":"string"},"systemLanguage":{"type":"string"},"tabindex":{"type":"string"},"tableValues":{"type":"string"},"targetX":{"type":"string"},"targetY":{"type":"string"},"text-anchor":{"type":"string"},"text-decoration":{"type":"string"},"text-rendering":{"type":"string"},"textLength":{"type":"string"},"transform":{"type":"string"},"transform-origin":{"type":"string"},"type":{"type":"string"},"values":{"type":"string"},"viewBox":{"type":"string"},"visibility":{"type":"string"},"width":{"type":"string"},"word-spacing":{"type":"string"},"writing-mode":{"type":"string"},"x":{"type":"string"},"x1":{"type":"string"},"x2":{"type":"string"},"xChannelSelector":{"type":"string"},"y":{"type":"string"},"y1":{"type":"string"},"y2":{"type":"string"},"yChannelSelector":{"type":"string"},"z":{"type":"string"}},"additionalProperties":false}},"type":"object","properties":{"$id":{"description":"A unique identifier for this style definition.","type":"string"},"$schema":{"description":"The JSON Schema identifier for this document.","type":"string"},"$comment":{"description":"An optional comment or description for this avatar style definition.","type":"string"},"meta":{"description":"Metadata about the avatar style, such as license information, creator details, and source references.","type":"object","properties":{"license":{"description":"License information for the avatar style.","type":"object","properties":{"name":{"description":"The name of the license, e.g. `CC BY 4.0`.","type":"string"},"url":{"description":"A link to the full license text.","$ref":"#/$defs/safeUrl"},"text":{"description":"The full license text.","type":"string"}},"additionalProperties":false},"creator":{"description":"Information about the creator of the avatar style.","type":"object","properties":{"name":{"description":"The name of the creator.","type":"string"},"url":{"description":"A link to the creator's website or profile.","$ref":"#/$defs/safeUrl"}},"additionalProperties":false},"source":{"description":"Information about the original source of the artwork.","type":"object","properties":{"name":{"description":"The name of the original source.","type":"string"},"url":{"description":"A link to the original source.","$ref":"#/$defs/safeUrl"}},"additionalProperties":false}},"additionalProperties":false},"attributes":{"description":"Global SVG presentation attributes applied to the root `<svg>` element.","$ref":"#/$defs/attributes"},"canvas":{"description":"The main content of the avatar, defining the SVG structure, canvas dimensions, and element tree.","type":"object","properties":{"elements":{"description":"The list of SVG elements that make up the avatar.","type":"array","items":{"$ref":"#/$defs/element"}},"width":{"description":"The natural width of the avatar canvas in pixels. Must be at least 1.","type":"number","minimum":1},"height":{"description":"The natural height of the avatar canvas in pixels. Must be at least 1.","type":"number","minimum":1}},"required":["elements","width","height"],"additionalProperties":false},"components":{"description":"Named, reusable SVG components. Each component defines a set of variants that the PRNG can select from at render time.","type":"object","patternProperties":{"^[a-z][a-zA-Z0-9]*$":{"description":"A named component definition.","type":"object","properties":{"width":{"description":"The natural width of the component canvas in pixels.","type":"number","minimum":1},"height":{"description":"The natural height of the component canvas in pixels.","type":"number","minimum":1},"probability":{"description":"The probability (0–100) that this component is rendered at all. A value of 0 means never, 100 means always.","type":"number","minimum":0,"maximum":100},"rotate":{"description":"A range of rotation angles in degrees the PRNG can choose from. Each value must be between -360 and 360.","type":"array","items":{"type":"number","minimum":-360,"maximum":360},"minItems":1,"maxItems":2},"translate":{"description":"A positional translation applied to the component after placement.","type":"object","properties":{"x":{"description":"A range of horizontal translation values the PRNG can choose from.","type":"array","items":{"type":"number"},"minItems":1,"maxItems":2},"y":{"description":"A range of vertical translation values the PRNG can choose from.","type":"array","items":{"type":"number"},"minItems":1,"maxItems":2}},"additionalProperties":false},"variants":{"description":"The available visual variants of this component. The PRNG selects one variant per render.","type":"object","patternProperties":{"^[a-z][a-zA-Z0-9]*$":{"description":"A single variant of the component, containing its SVG element tree.","type":"object","properties":{"elements":{"description":"The SVG elements that make up this variant.","type":"array","items":{"$ref":"#/$defs/element"}},"weight":{"description":"A non-negative weight that influences how likely the PRNG is to select this variant. Higher values make the variant more likely. When omitted, defaults to 1 (equal weighting). A value of 0 means the variant is not selected by the PRNG unless all available variants have a weight of 0.","type":"number","minimum":0}},"required":["elements"],"additionalProperties":false}},"additionalProperties":false}},"required":["width","height","variants"],"additionalProperties":false}},"additionalProperties":false},"colors":{"description":"Named color palettes used by the avatar. The PRNG selects colors from these groups at render time. Color groups can define constraints such as contrast or exclusion rules.","type":"object","patternProperties":{"^[a-z][a-zA-Z0-9]*$":{"description":"A named color.","type":"object","properties":{"values":{"description":"The list of hex color values the PRNG can choose from.","type":"array","items":{"type":"string","pattern":"^#([a-fA-F0-9]{3}|[a-fA-F0-9]{4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$"}},"notEqualTo":{"description":"A list of other color names. The selected color value must differ from the color values selected in those colors.","type":"array","items":{"$ref":"#/$defs/identifier"}},"contrastTo":{"description":"The name of another color. When specified, the PRNG is not used for selection — instead, the color value with the highest contrast against the selected color value of the referenced color is chosen.","$ref":"#/$defs/identifier"}},"required":["values"],"additionalProperties":false}},"additionalProperties":false}},"required":["canvas"],"additionalProperties":false}
1
+ {"$id":"https://cdn.hopjs.net/npm/@dicebear/schema@0.10.0/dist/definition.min.json","$schema":"http://json-schema.org/draft-07/schema#","definitions":{"identifier":{"description":"A camelCase identifier starting with a lowercase letter. Used for component, variable, and color references.","type":"string","pattern":"^[a-z][a-zA-Z0-9]*$"},"colorAttribute":{"description":"A color value, either as a direct color string (named color, hex, rgb(a), hsl(a), hsb(a)) or as a reference to a named color defined in the `colors` section.","anyOf":[{"type":"string","anyOf":[{"pattern":"^[a-zA-Z]+$"},{"pattern":"^#([a-fA-F0-9]{3}|[a-fA-F0-9]{4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$"},{"pattern":"^rgba?\\(\\s*\\d+\\s*,\\s*\\d+\\s*,\\s*\\d+\\s*(,\\s*[0-1](\\.\\d+)?\\s*)?\\)$"},{"pattern":"^hsla?\\(\\s*\\d+\\s*,\\s*\\d+%\\s*,\\s*\\d+%\\s*(,\\s*[0-1](\\.\\d+)?\\s*)?\\)$"},{"pattern":"^hsba?\\(\\s*\\d+\\s*,\\s*\\d+%\\s*,\\s*\\d+%\\s*(,\\s*[0-1](\\.\\d+)?\\s*)?\\)$"}]},{"description":"A reference to a named color. At render time, the PRNG selects a color value from the referenced color.","type":"object","properties":{"type":{"type":"string","const":"color"},"value":{"description":"The name of the color to reference.","$ref":"#/definitions/identifier"}},"required":["type","value"],"additionalProperties":false}]},"safeUrl":{"description":"A URL restricted to HTTP and HTTPS protocols.","type":"string","pattern":"^https?://"},"paintAttribute":{"description":"A paint value for `fill` and `stroke` attributes. Accepts all color formats from `colorAttribute` as well as local SVG paint server references in the form `url(#id)`, e.g. for gradients or patterns.","anyOf":[{"$ref":"#/definitions/colorAttribute"},{"type":"string","pattern":"^url\\(#[a-zA-Z_][a-zA-Z0-9_.-]*\\)$"}]},"noExternalUrlRef":{"description":"A string that must not contain external URL references (e.g. `url(https://...)`) or CSS escape sequences (backslash). Local references such as `url(#id)` are permitted.","type":"string","not":{"anyOf":[{"pattern":"[uU][rR][lL]\\s*\\(\\s*[^#)]"},{"pattern":"\\\\"}]}},"noCssInjection":{"description":"A string that must not contain CSS injection patterns, including `@`-rules, `expression()`, `behavior:`, or `-moz-binding`.","type":"string","not":{"anyOf":[{"pattern":"@"},{"pattern":"[eE][xX][pP][rR][eE][sS][sS][iI][oO][nN]\\s*\\("},{"pattern":"[bB][eE][hH][aA][vV][iI][oO][rR]\\s*:"},{"pattern":"-[mM][oO][zZ]-[bB][iI][nN][dD][iI][nN][gG]"},{"pattern":"\\\\"}]}},"element":{"description":"An SVG node. Can be an actual SVG element (`element`), a raw text node (`text`), or a reference to a named component (`component`).","type":"object","properties":{"name":{"description":"The SVG tag name. Only a safe subset of SVG elements is permitted; dangerous elements such as `script`, `foreignObject`, or `a` are excluded.","type":"string","enum":["circle","clipPath","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","g","image","line","linearGradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialGradient","rect","stop","style","svg","switch","symbol","text","textPath","title","tspan","use","view"]},"type":{"description":"The node type. `element` renders an SVG tag, `text` renders a raw text node, `component` inserts a named component by reference.","type":"string","enum":["element","text","component"]},"value":{"description":"The text content for `text` nodes, the component name for `component` nodes, or the CSS content for `style` elements.","anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","const":"variable"},"value":{"type":"string","enum":["initial","initials"]}},"required":["type","value"],"additionalProperties":false}]},"attributes":{"description":"SVG presentation attributes to apply to this element.","$ref":"#/definitions/attributes"},"children":{"description":"Nested child elements. Only valid for `element` and `text` nodes.","type":"array","items":{"$ref":"#/definitions/element"}}},"required":["type"],"additionalProperties":false,"allOf":[{"if":{"properties":{"type":{"const":"component"}},"required":["type"]},"then":{"required":["value"],"properties":{"value":{"$ref":"#/definitions/identifier"}},"not":{"required":["children"]}}},{"if":{"properties":{"type":{"const":"element"}},"required":["type"]},"then":{"required":["name"],"if":{"properties":{"name":{"const":"style"}}},"then":{"properties":{"value":{"allOf":[{"$ref":"#/definitions/noExternalUrlRef"},{"$ref":"#/definitions/noCssInjection"}]}}},"else":{"not":{"required":["value"]}}}}]},"attributes":{"description":"A map of allowed SVG presentation attributes. Only a safe subset is permitted; event handlers (e.g. `onclick`) and namespace attributes (e.g. `xlink:href`) are not allowed.","type":"object","properties":{"alignment-baseline":{"type":"string"},"amplitude":{"type":"string"},"azimuth":{"type":"string"},"baseFrequency":{"type":"string"},"baseline-shift":{"type":"string"},"bias":{"type":"string"},"class":{"description":"CSS class name(s). Only alphanumeric characters, underscores, hyphens, and spaces are allowed.","type":"string","pattern":"^[a-zA-Z0-9_ -]+$"},"clipPathUnits":{"type":"string"},"clip-path":{"description":"References a clip path. External URL references are not allowed.","$ref":"#/definitions/noExternalUrlRef"},"clip-rule":{"type":"string"},"color":{"$ref":"#/definitions/colorAttribute"},"color-interpolation":{"type":"string"},"color-interpolation-filters":{"type":"string"},"crossorigin":{"type":"string"},"cx":{"type":"string"},"cy":{"type":"string"},"d":{"type":"string"},"decoding":{"type":"string"},"diffuseConstant":{"type":"string"},"direction":{"type":"string"},"display":{"type":"string"},"divisor":{"type":"string"},"dx":{"type":"string"},"dy":{"type":"string"},"edgeMode":{"type":"string"},"elevation":{"type":"string"},"exponent":{"type":"string"},"fill":{"description":"The fill color or paint server reference for this element.","$ref":"#/definitions/paintAttribute"},"fill-opacity":{"type":"string"},"fill-rule":{"type":"string"},"filter":{"description":"References a filter effect. External URL references are not allowed.","$ref":"#/definitions/noExternalUrlRef"},"filterUnits":{"type":"string"},"flood-color":{"$ref":"#/definitions/colorAttribute"},"flood-opacity":{"type":"string"},"font-family":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","const":"variable"},"value":{"type":"string","enum":["fontFamily"]}},"required":["type","value"],"additionalProperties":false}]},"font-size":{"type":"string"},"font-size-adjust":{"type":"string"},"font-style":{"type":"string"},"font-variant":{"type":"string"},"font-weight":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","const":"variable"},"value":{"type":"string","enum":["fontWeight"]}},"required":["type","value"],"additionalProperties":false}]},"fx":{"type":"string"},"fy":{"type":"string"},"gradientTransform":{"type":"string"},"gradientUnits":{"type":"string"},"height":{"type":"string"},"href":{"description":"A hyperlink reference. Only local fragment references (`#id`) and safe data URIs (raster images) are allowed.","anyOf":[{"type":"string","pattern":"^#[a-zA-Z0-9-]+$"},{"type":"string","pattern":"^data:image/(png|gif|jpg|jpeg|webp|avif);base64,[a-zA-Z0-9+/=]+$"}]},"id":{"description":"A unique identifier for the element. Must start with a letter or underscore.","type":"string","pattern":"^[a-zA-Z_][a-zA-Z0-9_.-]*$"},"image-rendering":{"type":"string"},"in":{"type":"string"},"in2":{"type":"string"},"intercept":{"type":"string"},"k1":{"type":"string"},"k2":{"type":"string"},"k3":{"type":"string"},"k4":{"type":"string"},"kernelMatrix":{"type":"string"},"kernelUnitLength":{"type":"string"},"lang":{"type":"string"},"lengthAdjust":{"type":"string"},"letter-spacing":{"type":"string"},"lighting-color":{"$ref":"#/definitions/colorAttribute"},"marker-end":{"description":"References a marker to draw at the end of a path. External URL references are not allowed.","$ref":"#/definitions/noExternalUrlRef"},"marker-mid":{"description":"References a marker to draw at intermediate vertices of a path. External URL references are not allowed.","$ref":"#/definitions/noExternalUrlRef"},"marker-start":{"description":"References a marker to draw at the start of a path. External URL references are not allowed.","$ref":"#/definitions/noExternalUrlRef"},"markerHeight":{"type":"string"},"markerUnits":{"type":"string"},"markerWidth":{"type":"string"},"mask":{"description":"References a mask element. External URL references are not allowed.","$ref":"#/definitions/noExternalUrlRef"},"maskContentUnits":{"type":"string"},"maskUnits":{"type":"string"},"media":{"type":"string"},"method":{"type":"string"},"mode":{"type":"string"},"numOctaves":{"type":"string"},"offset":{"type":"string"},"opacity":{"type":"string"},"operator":{"type":"string"},"order":{"type":"string"},"orient":{"type":"string"},"overflow":{"type":"string"},"paint-order":{"type":"string"},"path":{"type":"string"},"pathLength":{"type":"string"},"patternContentUnits":{"type":"string"},"patternTransform":{"type":"string"},"patternUnits":{"type":"string"},"points":{"type":"string"},"preserveAlpha":{"type":"string"},"preserveAspectRatio":{"type":"string"},"primitiveUnits":{"type":"string"},"r":{"type":"string"},"radius":{"type":"string"},"refX":{"type":"string"},"refY":{"type":"string"},"result":{"type":"string"},"rx":{"type":"string"},"ry":{"type":"string"},"scale":{"type":"string"},"seed":{"type":"string"},"shape-rendering":{"type":"string"},"slope":{"type":"string"},"specularConstant":{"type":"string"},"specularExponent":{"type":"string"},"spreadMethod":{"type":"string"},"startOffset":{"type":"string"},"stdDeviation":{"type":"string"},"stitchTiles":{"type":"string"},"stop-color":{"$ref":"#/definitions/colorAttribute"},"stop-opacity":{"type":"string"},"stroke":{"description":"The stroke color or paint server reference for this element.","$ref":"#/definitions/paintAttribute"},"stroke-dasharray":{"type":"string"},"stroke-dashoffset":{"type":"string"},"stroke-linecap":{"type":"string"},"stroke-linejoin":{"type":"string"},"stroke-miterlimit":{"type":"string"},"stroke-opacity":{"type":"string"},"stroke-width":{"type":"string"},"style":{"description":"Inline CSS styles. External URL references and CSS injection patterns are not allowed.","allOf":[{"$ref":"#/definitions/noExternalUrlRef"},{"$ref":"#/definitions/noCssInjection"}]},"surfaceScale":{"type":"string"},"systemLanguage":{"type":"string"},"tabindex":{"type":"string"},"tableValues":{"type":"string"},"targetX":{"type":"string"},"targetY":{"type":"string"},"text-anchor":{"type":"string"},"text-decoration":{"type":"string"},"text-rendering":{"type":"string"},"textLength":{"type":"string"},"transform":{"type":"string"},"transform-origin":{"type":"string"},"type":{"type":"string"},"values":{"type":"string"},"viewBox":{"type":"string"},"visibility":{"type":"string"},"width":{"type":"string"},"word-spacing":{"type":"string"},"writing-mode":{"type":"string"},"x":{"type":"string"},"x1":{"type":"string"},"x2":{"type":"string"},"xChannelSelector":{"type":"string"},"y":{"type":"string"},"y1":{"type":"string"},"y2":{"type":"string"},"yChannelSelector":{"type":"string"},"z":{"type":"string"}},"additionalProperties":false}},"type":"object","properties":{"$id":{"description":"A unique identifier for this style definition.","type":"string"},"$schema":{"description":"The JSON Schema identifier for this document.","type":"string"},"$comment":{"description":"An optional comment or description for this avatar style definition.","type":"string"},"meta":{"description":"Metadata about the avatar style, such as license information, creator details, and source references.","type":"object","properties":{"license":{"description":"License information for the avatar style.","type":"object","properties":{"name":{"description":"The name of the license, e.g. `CC BY 4.0`.","type":"string"},"url":{"description":"A link to the full license text.","$ref":"#/definitions/safeUrl"},"text":{"description":"The full license text.","type":"string"}},"additionalProperties":false},"creator":{"description":"Information about the creator of the avatar style.","type":"object","properties":{"name":{"description":"The name of the creator.","type":"string"},"url":{"description":"A link to the creator's website or profile.","$ref":"#/definitions/safeUrl"}},"additionalProperties":false},"source":{"description":"Information about the original source of the artwork.","type":"object","properties":{"name":{"description":"The name of the original source.","type":"string"},"url":{"description":"A link to the original source.","$ref":"#/definitions/safeUrl"}},"additionalProperties":false}},"additionalProperties":false},"attributes":{"description":"Global SVG presentation attributes applied to the root `<svg>` element.","$ref":"#/definitions/attributes"},"canvas":{"description":"The main content of the avatar, defining the SVG structure, canvas dimensions, and element tree.","type":"object","properties":{"elements":{"description":"The list of SVG elements that make up the avatar.","type":"array","items":{"$ref":"#/definitions/element"}},"width":{"description":"The natural width of the avatar canvas in pixels. Must be at least 1.","type":"number","minimum":1},"height":{"description":"The natural height of the avatar canvas in pixels. Must be at least 1.","type":"number","minimum":1}},"required":["elements","width","height"],"additionalProperties":false},"components":{"description":"Named, reusable SVG components. Each component defines a set of variants that the PRNG can select from at render time.","type":"object","patternProperties":{"^[a-z][a-zA-Z0-9]*$":{"description":"A named component definition.","type":"object","properties":{"width":{"description":"The natural width of the component canvas in pixels.","type":"number","minimum":1},"height":{"description":"The natural height of the component canvas in pixels.","type":"number","minimum":1},"probability":{"description":"The probability (0–100) that this component is rendered at all. A value of 0 means never, 100 means always.","type":"number","minimum":0,"maximum":100},"rotate":{"description":"A range of rotation angles in degrees the PRNG can choose from. Each value must be between -360 and 360.","type":"array","items":{"type":"number","minimum":-360,"maximum":360},"minItems":1,"maxItems":2},"translate":{"description":"A positional translation applied to the component after placement.","type":"object","properties":{"x":{"description":"A range of horizontal translation values the PRNG can choose from.","type":"array","items":{"type":"number"},"minItems":1,"maxItems":2},"y":{"description":"A range of vertical translation values the PRNG can choose from.","type":"array","items":{"type":"number"},"minItems":1,"maxItems":2}},"additionalProperties":false},"variants":{"description":"The available visual variants of this component. The PRNG selects one variant per render.","type":"object","patternProperties":{"^[a-z][a-zA-Z0-9]*$":{"description":"A single variant of the component, containing its SVG element tree.","type":"object","properties":{"elements":{"description":"The SVG elements that make up this variant.","type":"array","items":{"$ref":"#/definitions/element"}},"weight":{"description":"A non-negative weight that influences how likely the PRNG is to select this variant. Higher values make the variant more likely. When omitted, defaults to 1 (equal weighting). A value of 0 means the variant is not selected by the PRNG unless all available variants have a weight of 0.","type":"number","minimum":0}},"required":["elements"],"additionalProperties":false}},"additionalProperties":false}},"required":["width","height","variants"],"additionalProperties":false}},"additionalProperties":false},"colors":{"description":"Named color palettes used by the avatar. The PRNG selects colors from these groups at render time. Color groups can define constraints such as contrast or exclusion rules.","type":"object","patternProperties":{"^[a-z][a-zA-Z0-9]*$":{"description":"A named color.","type":"object","properties":{"values":{"description":"The list of hex color values the PRNG can choose from.","type":"array","items":{"type":"string","pattern":"^#([a-fA-F0-9]{3}|[a-fA-F0-9]{4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$"}},"notEqualTo":{"description":"A list of other color names. The selected color value must differ from the color values selected in those colors.","type":"array","items":{"$ref":"#/definitions/identifier"}},"contrastTo":{"description":"The name of another color. When specified, the PRNG is not used for selection — instead, the color value with the highest contrast against the selected color value of the referenced color is chosen.","$ref":"#/definitions/identifier"}},"required":["values"],"additionalProperties":false}},"additionalProperties":false}},"required":["canvas"],"additionalProperties":false}
@@ -1 +1 @@
1
- {"$id":"https://cdn.hopjs.net/npm/@dicebear/schema@0.8.1/dist/options.min.json","$schema":"https://json-schema.org/draft/2020-12/schema","title":"DiceBear options schema","type":"object","$defs":{"flip":{"type":"string","enum":["none","horizontal","vertical","both"]},"rotate":{"type":"number","minimum":-360,"maximum":360},"scale":{"type":"number","minimum":0},"translate":{"type":"number","minimum":-100,"maximum":100},"borderRadius":{"type":"number","minimum":0,"maximum":50},"color":{"type":"string","pattern":"^#?([a-fA-F0-9]{3}|[a-fA-F0-9]{4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$"},"colorFill":{"type":"string","enum":["solid","linear","radial"]},"colorFillStops":{"type":"integer","minimum":1},"fontFamilyName":{"type":"string","pattern":"^[a-zA-Z0-9 _\\-]+$"},"fontWeight":{"type":"integer","minimum":1,"maximum":1000}},"properties":{"seed":{"type":"string","description":"The starting value for the pseudorandom number generator (PRNG) used in the avatar generation process. This option is essential for creating unique and consistent avatars. By setting a specific seed, you ensure that the same sequence of random characteristics is applied, allowing identical avatars to be reproduced. This is especially valuable for maintaining consistency across sessions and allowing users to share or recreate their personalized avatars.","maxLength":1024},"size":{"type":"integer","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.","minimum":1},"idRandomization":{"type":"boolean","description":"Generates random values for all IDs present in the SVG. This process ensures that while the avatar appears visually identical, the underlying code remains unique. This is particularly useful for embedding the same avatar multiple times in a document without running into duplicate ID conflicts that can interfere with styles and scripts."},"flip":{"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.","oneOf":[{"$ref":"#/$defs/flip"},{"type":"array","items":{"$ref":"#/$defs/flip"},"maxItems":128}]},"fontFamily":{"description":"Specifies the font family used for text rendering. If specified as an array, the PRNG will choose from the available options.","oneOf":[{"$ref":"#/$defs/fontFamilyName"},{"type":"array","items":{"$ref":"#/$defs/fontFamilyName"},"maxItems":128}]},"fontWeight":{"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.","oneOf":[{"$ref":"#/$defs/fontWeight"},{"type":"array","items":{"$ref":"#/$defs/fontWeight"},"maxItems":128}]},"scale":{"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.","oneOf":[{"$ref":"#/$defs/scale"},{"type":"array","items":{"$ref":"#/$defs/scale"},"maxItems":2}]},"borderRadius":{"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.","oneOf":[{"$ref":"#/$defs/borderRadius"},{"type":"array","items":{"$ref":"#/$defs/borderRadius"},"maxItems":2}]}},"patternProperties":{"^[a-z][a-zA-Z0-9]*Probability$":{"type":"number","description":"Represents the probability that a component of the avatar will be displayed. The value can be either a float or an integer, but is interpreted as a percentage. For example, a value of 0 means the part will never be displayed, while a value of 100 means it will always be displayed.","minimum":0,"maximum":100},"^[a-z][a-zA-Z0-9]*Variant$":{"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.","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"},"maxItems":128},{"type":"object","propertyNames":{"pattern":"^[a-z][a-zA-Z0-9]*$"},"additionalProperties":{"type":"number","minimum":0},"maxProperties":128}]},"^[a-z][a-zA-Z0-9]*Color$":{"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.","oneOf":[{"$ref":"#/$defs/color"},{"type":"array","items":{"$ref":"#/$defs/color"},"maxItems":128}]},"^[a-z][a-zA-Z0-9]*ColorFill$":{"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.","oneOf":[{"$ref":"#/$defs/colorFill"},{"type":"array","items":{"$ref":"#/$defs/colorFill"},"maxItems":128}]},"^[a-z][a-zA-Z0-9]*ColorFillStops$":{"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.","oneOf":[{"$ref":"#/$defs/colorFillStops"},{"type":"array","items":{"$ref":"#/$defs/colorFillStops"},"maxItems":2}]},"^[a-z][a-zA-Z0-9]*ColorAngle$":{"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.","oneOf":[{"$ref":"#/$defs/rotate"},{"type":"array","items":{"$ref":"#/$defs/rotate"},"maxItems":2}]},"^(r|[a-z][a-zA-Z0-9]*R)otate$":{"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.","oneOf":[{"$ref":"#/$defs/rotate"},{"type":"array","items":{"$ref":"#/$defs/rotate"},"maxItems":2}]},"^(t|[a-z][a-zA-Z0-9]*T)ranslateY$":{"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.","oneOf":[{"$ref":"#/$defs/translate"},{"type":"array","items":{"$ref":"#/$defs/translate"},"maxItems":2}]},"^(t|[a-z][a-zA-Z0-9]*T)ranslateX$":{"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.","oneOf":[{"$ref":"#/$defs/translate"},{"type":"array","items":{"$ref":"#/$defs/translate"},"maxItems":2}]}},"additionalProperties":false}
1
+ {"$id":"https://cdn.hopjs.net/npm/@dicebear/schema@0.10.0/dist/options.min.json","$schema":"http://json-schema.org/draft-07/schema#","title":"DiceBear options schema","type":"object","definitions":{"flip":{"type":"string","enum":["none","horizontal","vertical","both"]},"rotate":{"type":"number","minimum":-360,"maximum":360},"scale":{"type":"number","minimum":0},"translate":{"type":"number","minimum":-100,"maximum":100},"borderRadius":{"type":"number","minimum":0,"maximum":50},"color":{"type":"string","pattern":"^#?([a-fA-F0-9]{3}|[a-fA-F0-9]{4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$"},"colorFill":{"type":"string","enum":["solid","linear","radial"]},"colorFillStops":{"type":"integer","minimum":2},"fontFamilyName":{"type":"string","pattern":"^[a-zA-Z0-9 _\\-]+$"},"fontWeight":{"type":"integer","minimum":1,"maximum":1000}},"properties":{"seed":{"type":"string","description":"The starting value for the pseudorandom number generator (PRNG) used in the avatar generation process. This option is essential for creating unique and consistent avatars. By setting a specific seed, you ensure that the same sequence of random characteristics is applied, allowing identical avatars to be reproduced. This is especially valuable for maintaining consistency across sessions and allowing users to share or recreate their personalized avatars.","maxLength":1024},"size":{"type":"integer","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.","minimum":1},"idRandomization":{"type":"boolean","description":"Generates random values for all IDs present in the SVG. This process ensures that while the avatar appears visually identical, the underlying code remains unique. This is particularly useful for embedding the same avatar multiple times in a document without running into duplicate ID conflicts that can interfere with styles and scripts."},"title":{"type":"string","description":"Specifies an accessible title for the avatar. When set, the SVG will include a <title> element and an aria-label attribute, allowing screen readers and other assistive technologies to describe the avatar to users.","maxLength":256},"flip":{"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.","oneOf":[{"$ref":"#/definitions/flip"},{"type":"array","items":{"$ref":"#/definitions/flip"},"maxItems":128}]},"fontFamily":{"description":"Specifies the font family used for text rendering. If specified as an array, the PRNG will choose from the available options.","oneOf":[{"$ref":"#/definitions/fontFamilyName"},{"type":"array","items":{"$ref":"#/definitions/fontFamilyName"},"maxItems":128}]},"fontWeight":{"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.","oneOf":[{"$ref":"#/definitions/fontWeight"},{"type":"array","items":{"$ref":"#/definitions/fontWeight"},"maxItems":128}]},"scale":{"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.","oneOf":[{"$ref":"#/definitions/scale"},{"type":"array","items":{"$ref":"#/definitions/scale"},"maxItems":2}]},"borderRadius":{"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.","oneOf":[{"$ref":"#/definitions/borderRadius"},{"type":"array","items":{"$ref":"#/definitions/borderRadius"},"maxItems":2}]}},"patternProperties":{"^[a-z][a-zA-Z0-9]*Probability$":{"type":"number","description":"Represents the probability that a component of the avatar will be displayed. The value can be either a float or an integer, but is interpreted as a percentage. For example, a value of 0 means the part will never be displayed, while a value of 100 means it will always be displayed.","minimum":0,"maximum":100},"^[a-z][a-zA-Z0-9]*Variant$":{"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.","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"},"maxItems":128},{"type":"object","propertyNames":{"pattern":"^[a-z][a-zA-Z0-9]*$"},"additionalProperties":{"type":"number","minimum":0},"maxProperties":128}]},"^[a-z][a-zA-Z0-9]*Color$":{"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.","oneOf":[{"$ref":"#/definitions/color"},{"type":"array","items":{"$ref":"#/definitions/color"},"maxItems":128}]},"^[a-z][a-zA-Z0-9]*ColorFill$":{"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.","oneOf":[{"$ref":"#/definitions/colorFill"},{"type":"array","items":{"$ref":"#/definitions/colorFill"},"maxItems":128}]},"^[a-z][a-zA-Z0-9]*ColorFillStops$":{"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.","oneOf":[{"$ref":"#/definitions/colorFillStops"},{"type":"array","items":{"$ref":"#/definitions/colorFillStops"},"maxItems":2}]},"^[a-z][a-zA-Z0-9]*ColorAngle$":{"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.","oneOf":[{"$ref":"#/definitions/rotate"},{"type":"array","items":{"$ref":"#/definitions/rotate"},"maxItems":2}]},"^(r|[a-z][a-zA-Z0-9]*R)otate$":{"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.","oneOf":[{"$ref":"#/definitions/rotate"},{"type":"array","items":{"$ref":"#/definitions/rotate"},"maxItems":2}]},"^(t|[a-z][a-zA-Z0-9]*T)ranslateY$":{"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.","oneOf":[{"$ref":"#/definitions/translate"},{"type":"array","items":{"$ref":"#/definitions/translate"},"maxItems":2}]},"^(t|[a-z][a-zA-Z0-9]*T)ranslateX$":{"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.","oneOf":[{"$ref":"#/definitions/translate"},{"type":"array","items":{"$ref":"#/definitions/translate"},"maxItems":2}]}},"additionalProperties":false}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dicebear/schema",
3
- "version": "0.8.1",
3
+ "version": "0.10.0",
4
4
  "description": "JSON Schema definitions for DiceBear avatar styles and options",
5
5
  "keywords": [
6
6
  "dicebear",
@@ -1,6 +1,6 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$defs": {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "definitions": {
4
4
  "identifier": {
5
5
  "description": "A camelCase identifier starting with a lowercase letter. Used for component, variable, and color references.",
6
6
  "type": "string",
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "value": {
37
37
  "description": "The name of the color to reference.",
38
- "$ref": "#/$defs/identifier"
38
+ "$ref": "#/definitions/identifier"
39
39
  }
40
40
  },
41
41
  "required": ["type", "value"],
@@ -51,7 +51,7 @@
51
51
  "paintAttribute": {
52
52
  "description": "A paint value for `fill` and `stroke` attributes. Accepts all color formats from `colorAttribute` as well as local SVG paint server references in the form `url(#id)`, e.g. for gradients or patterns.",
53
53
  "anyOf": [
54
- { "$ref": "#/$defs/colorAttribute" },
54
+ { "$ref": "#/definitions/colorAttribute" },
55
55
  { "type": "string", "pattern": "^url\\(#[a-zA-Z_][a-zA-Z0-9_.-]*\\)$" }
56
56
  ]
57
57
  },
@@ -166,13 +166,13 @@
166
166
  },
167
167
  "attributes": {
168
168
  "description": "SVG presentation attributes to apply to this element.",
169
- "$ref": "#/$defs/attributes"
169
+ "$ref": "#/definitions/attributes"
170
170
  },
171
171
  "children": {
172
172
  "description": "Nested child elements. Only valid for `element` and `text` nodes.",
173
173
  "type": "array",
174
174
  "items": {
175
- "$ref": "#/$defs/element"
175
+ "$ref": "#/definitions/element"
176
176
  }
177
177
  }
178
178
  },
@@ -186,7 +186,7 @@
186
186
  },
187
187
  "then": {
188
188
  "required": ["value"],
189
- "properties": { "value": { "$ref": "#/$defs/identifier" } },
189
+ "properties": { "value": { "$ref": "#/definitions/identifier" } },
190
190
  "not": { "required": ["children"] }
191
191
  }
192
192
  },
@@ -204,8 +204,8 @@
204
204
  "properties": {
205
205
  "value": {
206
206
  "allOf": [
207
- { "$ref": "#/$defs/noExternalUrlRef" },
208
- { "$ref": "#/$defs/noCssInjection" }
207
+ { "$ref": "#/definitions/noExternalUrlRef" },
208
+ { "$ref": "#/definitions/noCssInjection" }
209
209
  ]
210
210
  }
211
211
  }
@@ -235,11 +235,11 @@
235
235
  "clipPathUnits": { "type": "string" },
236
236
  "clip-path": {
237
237
  "description": "References a clip path. External URL references are not allowed.",
238
- "$ref": "#/$defs/noExternalUrlRef"
238
+ "$ref": "#/definitions/noExternalUrlRef"
239
239
  },
240
240
  "clip-rule": { "type": "string" },
241
241
  "color": {
242
- "$ref": "#/$defs/colorAttribute"
242
+ "$ref": "#/definitions/colorAttribute"
243
243
  },
244
244
  "color-interpolation": { "type": "string" },
245
245
  "color-interpolation-filters": { "type": "string" },
@@ -259,17 +259,17 @@
259
259
  "exponent": { "type": "string" },
260
260
  "fill": {
261
261
  "description": "The fill color or paint server reference for this element.",
262
- "$ref": "#/$defs/paintAttribute"
262
+ "$ref": "#/definitions/paintAttribute"
263
263
  },
264
264
  "fill-opacity": { "type": "string" },
265
265
  "fill-rule": { "type": "string" },
266
266
  "filter": {
267
267
  "description": "References a filter effect. External URL references are not allowed.",
268
- "$ref": "#/$defs/noExternalUrlRef"
268
+ "$ref": "#/definitions/noExternalUrlRef"
269
269
  },
270
270
  "filterUnits": { "type": "string" },
271
271
  "flood-color": {
272
- "$ref": "#/$defs/colorAttribute"
272
+ "$ref": "#/definitions/colorAttribute"
273
273
  },
274
274
  "flood-opacity": { "type": "string" },
275
275
  "font-family": {
@@ -341,26 +341,26 @@
341
341
  "lengthAdjust": { "type": "string" },
342
342
  "letter-spacing": { "type": "string" },
343
343
  "lighting-color": {
344
- "$ref": "#/$defs/colorAttribute"
344
+ "$ref": "#/definitions/colorAttribute"
345
345
  },
346
346
  "marker-end": {
347
347
  "description": "References a marker to draw at the end of a path. External URL references are not allowed.",
348
- "$ref": "#/$defs/noExternalUrlRef"
348
+ "$ref": "#/definitions/noExternalUrlRef"
349
349
  },
350
350
  "marker-mid": {
351
351
  "description": "References a marker to draw at intermediate vertices of a path. External URL references are not allowed.",
352
- "$ref": "#/$defs/noExternalUrlRef"
352
+ "$ref": "#/definitions/noExternalUrlRef"
353
353
  },
354
354
  "marker-start": {
355
355
  "description": "References a marker to draw at the start of a path. External URL references are not allowed.",
356
- "$ref": "#/$defs/noExternalUrlRef"
356
+ "$ref": "#/definitions/noExternalUrlRef"
357
357
  },
358
358
  "markerHeight": { "type": "string" },
359
359
  "markerUnits": { "type": "string" },
360
360
  "markerWidth": { "type": "string" },
361
361
  "mask": {
362
362
  "description": "References a mask element. External URL references are not allowed.",
363
- "$ref": "#/$defs/noExternalUrlRef"
363
+ "$ref": "#/definitions/noExternalUrlRef"
364
364
  },
365
365
  "maskContentUnits": { "type": "string" },
366
366
  "maskUnits": { "type": "string" },
@@ -402,12 +402,12 @@
402
402
  "stdDeviation": { "type": "string" },
403
403
  "stitchTiles": { "type": "string" },
404
404
  "stop-color": {
405
- "$ref": "#/$defs/colorAttribute"
405
+ "$ref": "#/definitions/colorAttribute"
406
406
  },
407
407
  "stop-opacity": { "type": "string" },
408
408
  "stroke": {
409
409
  "description": "The stroke color or paint server reference for this element.",
410
- "$ref": "#/$defs/paintAttribute"
410
+ "$ref": "#/definitions/paintAttribute"
411
411
  },
412
412
  "stroke-dasharray": { "type": "string" },
413
413
  "stroke-dashoffset": { "type": "string" },
@@ -419,8 +419,8 @@
419
419
  "style": {
420
420
  "description": "Inline CSS styles. External URL references and CSS injection patterns are not allowed.",
421
421
  "allOf": [
422
- { "$ref": "#/$defs/noExternalUrlRef" },
423
- { "$ref": "#/$defs/noCssInjection" }
422
+ { "$ref": "#/definitions/noExternalUrlRef" },
423
+ { "$ref": "#/definitions/noCssInjection" }
424
424
  ]
425
425
  },
426
426
  "surfaceScale": { "type": "string" },
@@ -483,7 +483,7 @@
483
483
  },
484
484
  "url": {
485
485
  "description": "A link to the full license text.",
486
- "$ref": "#/$defs/safeUrl"
486
+ "$ref": "#/definitions/safeUrl"
487
487
  },
488
488
  "text": {
489
489
  "description": "The full license text.",
@@ -502,7 +502,7 @@
502
502
  },
503
503
  "url": {
504
504
  "description": "A link to the creator's website or profile.",
505
- "$ref": "#/$defs/safeUrl"
505
+ "$ref": "#/definitions/safeUrl"
506
506
  }
507
507
  },
508
508
  "additionalProperties": false
@@ -517,7 +517,7 @@
517
517
  },
518
518
  "url": {
519
519
  "description": "A link to the original source.",
520
- "$ref": "#/$defs/safeUrl"
520
+ "$ref": "#/definitions/safeUrl"
521
521
  }
522
522
  },
523
523
  "additionalProperties": false
@@ -527,7 +527,7 @@
527
527
  },
528
528
  "attributes": {
529
529
  "description": "Global SVG presentation attributes applied to the root `<svg>` element.",
530
- "$ref": "#/$defs/attributes"
530
+ "$ref": "#/definitions/attributes"
531
531
  },
532
532
  "canvas": {
533
533
  "description": "The main content of the avatar, defining the SVG structure, canvas dimensions, and element tree.",
@@ -536,7 +536,7 @@
536
536
  "elements": {
537
537
  "description": "The list of SVG elements that make up the avatar.",
538
538
  "type": "array",
539
- "items": { "$ref": "#/$defs/element" }
539
+ "items": { "$ref": "#/definitions/element" }
540
540
  },
541
541
  "width": {
542
542
  "description": "The natural width of the avatar canvas in pixels. Must be at least 1.",
@@ -619,7 +619,7 @@
619
619
  "elements": {
620
620
  "description": "The SVG elements that make up this variant.",
621
621
  "type": "array",
622
- "items": { "$ref": "#/$defs/element" }
622
+ "items": { "$ref": "#/definitions/element" }
623
623
  },
624
624
  "weight": {
625
625
  "description": "A non-negative weight that influences how likely the PRNG is to select this variant. Higher values make the variant more likely. When omitted, defaults to 1 (equal weighting). A value of 0 means the variant is not selected by the PRNG unless all available variants have a weight of 0.",
@@ -659,11 +659,11 @@
659
659
  "notEqualTo": {
660
660
  "description": "A list of other color names. The selected color value must differ from the color values selected in those colors.",
661
661
  "type": "array",
662
- "items": { "$ref": "#/$defs/identifier" }
662
+ "items": { "$ref": "#/definitions/identifier" }
663
663
  },
664
664
  "contrastTo": {
665
665
  "description": "The name of another color. When specified, the PRNG is not used for selection — instead, the color value with the highest contrast against the selected color value of the referenced color is chosen.",
666
- "$ref": "#/$defs/identifier"
666
+ "$ref": "#/definitions/identifier"
667
667
  }
668
668
  },
669
669
  "required": ["values"],
package/src/options.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
3
  "title": "DiceBear options schema",
4
4
  "type": "object",
5
- "$defs": {
5
+ "definitions": {
6
6
  "flip": {
7
7
  "type": "string",
8
8
  "enum": ["none", "horizontal", "vertical", "both"]
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "colorFillStops": {
38
38
  "type": "integer",
39
- "minimum": 1
39
+ "minimum": 2
40
40
  },
41
41
  "fontFamilyName": {
42
42
  "type": "string",
@@ -63,16 +63,21 @@
63
63
  "type": "boolean",
64
64
  "description": "Generates random values for all IDs present in the SVG. This process ensures that while the avatar appears visually identical, the underlying code remains unique. This is particularly useful for embedding the same avatar multiple times in a document without running into duplicate ID conflicts that can interfere with styles and scripts."
65
65
  },
66
+ "title": {
67
+ "type": "string",
68
+ "description": "Specifies an accessible title for the avatar. When set, the SVG will include a <title> element and an aria-label attribute, allowing screen readers and other assistive technologies to describe the avatar to users.",
69
+ "maxLength": 256
70
+ },
66
71
  "flip": {
67
72
  "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.",
68
73
  "oneOf": [
69
74
  {
70
- "$ref": "#/$defs/flip"
75
+ "$ref": "#/definitions/flip"
71
76
  },
72
77
  {
73
78
  "type": "array",
74
79
  "items": {
75
- "$ref": "#/$defs/flip"
80
+ "$ref": "#/definitions/flip"
76
81
  },
77
82
  "maxItems": 128
78
83
  }
@@ -82,12 +87,12 @@
82
87
  "description": "Specifies the font family used for text rendering. If specified as an array, the PRNG will choose from the available options.",
83
88
  "oneOf": [
84
89
  {
85
- "$ref": "#/$defs/fontFamilyName"
90
+ "$ref": "#/definitions/fontFamilyName"
86
91
  },
87
92
  {
88
93
  "type": "array",
89
94
  "items": {
90
- "$ref": "#/$defs/fontFamilyName"
95
+ "$ref": "#/definitions/fontFamilyName"
91
96
  },
92
97
  "maxItems": 128
93
98
  }
@@ -97,12 +102,12 @@
97
102
  "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.",
98
103
  "oneOf": [
99
104
  {
100
- "$ref": "#/$defs/fontWeight"
105
+ "$ref": "#/definitions/fontWeight"
101
106
  },
102
107
  {
103
108
  "type": "array",
104
109
  "items": {
105
- "$ref": "#/$defs/fontWeight"
110
+ "$ref": "#/definitions/fontWeight"
106
111
  },
107
112
  "maxItems": 128
108
113
  }
@@ -112,12 +117,12 @@
112
117
  "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.",
113
118
  "oneOf": [
114
119
  {
115
- "$ref": "#/$defs/scale"
120
+ "$ref": "#/definitions/scale"
116
121
  },
117
122
  {
118
123
  "type": "array",
119
124
  "items": {
120
- "$ref": "#/$defs/scale"
125
+ "$ref": "#/definitions/scale"
121
126
  },
122
127
  "maxItems": 2
123
128
  }
@@ -127,12 +132,12 @@
127
132
  "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.",
128
133
  "oneOf": [
129
134
  {
130
- "$ref": "#/$defs/borderRadius"
135
+ "$ref": "#/definitions/borderRadius"
131
136
  },
132
137
  {
133
138
  "type": "array",
134
139
  "items": {
135
- "$ref": "#/$defs/borderRadius"
140
+ "$ref": "#/definitions/borderRadius"
136
141
  },
137
142
  "maxItems": 2
138
143
  }
@@ -176,12 +181,12 @@
176
181
  "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.",
177
182
  "oneOf": [
178
183
  {
179
- "$ref": "#/$defs/color"
184
+ "$ref": "#/definitions/color"
180
185
  },
181
186
  {
182
187
  "type": "array",
183
188
  "items": {
184
- "$ref": "#/$defs/color"
189
+ "$ref": "#/definitions/color"
185
190
  },
186
191
  "maxItems": 128
187
192
  }
@@ -191,12 +196,12 @@
191
196
  "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.",
192
197
  "oneOf": [
193
198
  {
194
- "$ref": "#/$defs/colorFill"
199
+ "$ref": "#/definitions/colorFill"
195
200
  },
196
201
  {
197
202
  "type": "array",
198
203
  "items": {
199
- "$ref": "#/$defs/colorFill"
204
+ "$ref": "#/definitions/colorFill"
200
205
  },
201
206
  "maxItems": 128
202
207
  }
@@ -206,12 +211,12 @@
206
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.",
207
212
  "oneOf": [
208
213
  {
209
- "$ref": "#/$defs/colorFillStops"
214
+ "$ref": "#/definitions/colorFillStops"
210
215
  },
211
216
  {
212
217
  "type": "array",
213
218
  "items": {
214
- "$ref": "#/$defs/colorFillStops"
219
+ "$ref": "#/definitions/colorFillStops"
215
220
  },
216
221
  "maxItems": 2
217
222
  }
@@ -221,12 +226,12 @@
221
226
  "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.",
222
227
  "oneOf": [
223
228
  {
224
- "$ref": "#/$defs/rotate"
229
+ "$ref": "#/definitions/rotate"
225
230
  },
226
231
  {
227
232
  "type": "array",
228
233
  "items": {
229
- "$ref": "#/$defs/rotate"
234
+ "$ref": "#/definitions/rotate"
230
235
  },
231
236
  "maxItems": 2
232
237
  }
@@ -236,12 +241,12 @@
236
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.",
237
242
  "oneOf": [
238
243
  {
239
- "$ref": "#/$defs/rotate"
244
+ "$ref": "#/definitions/rotate"
240
245
  },
241
246
  {
242
247
  "type": "array",
243
248
  "items": {
244
- "$ref": "#/$defs/rotate"
249
+ "$ref": "#/definitions/rotate"
245
250
  },
246
251
  "maxItems": 2
247
252
  }
@@ -251,12 +256,12 @@
251
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.",
252
257
  "oneOf": [
253
258
  {
254
- "$ref": "#/$defs/translate"
259
+ "$ref": "#/definitions/translate"
255
260
  },
256
261
  {
257
262
  "type": "array",
258
263
  "items": {
259
- "$ref": "#/$defs/translate"
264
+ "$ref": "#/definitions/translate"
260
265
  },
261
266
  "maxItems": 2
262
267
  }
@@ -266,12 +271,12 @@
266
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.",
267
272
  "oneOf": [
268
273
  {
269
- "$ref": "#/$defs/translate"
274
+ "$ref": "#/definitions/translate"
270
275
  },
271
276
  {
272
277
  "type": "array",
273
278
  "items": {
274
- "$ref": "#/$defs/translate"
279
+ "$ref": "#/definitions/translate"
275
280
  },
276
281
  "maxItems": 2
277
282
  }