@dicebear/schema 0.9.0 → 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 +2 -2
- package/dist/definition.min.json +1 -1
- package/dist/options.min.json +1 -1
- package/package.json +1 -1
- package/src/definition.json +31 -31
- package/src/options.json +27 -27
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.
|
|
70
|
-
https://cdn.hopjs.net/npm/@dicebear/schema@0.
|
|
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
|
package/dist/definition.min.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$id":"https://cdn.hopjs.net/npm/@dicebear/schema@0.9.0/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}
|
package/dist/options.min.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$id":"https://cdn.hopjs.net/npm/@dicebear/schema@0.
|
|
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
package/src/definition.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "
|
|
3
|
-
"
|
|
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": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
208
|
-
{ "$ref": "
|
|
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": "
|
|
238
|
+
"$ref": "#/definitions/noExternalUrlRef"
|
|
239
239
|
},
|
|
240
240
|
"clip-rule": { "type": "string" },
|
|
241
241
|
"color": {
|
|
242
|
-
"$ref": "
|
|
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": "
|
|
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": "
|
|
268
|
+
"$ref": "#/definitions/noExternalUrlRef"
|
|
269
269
|
},
|
|
270
270
|
"filterUnits": { "type": "string" },
|
|
271
271
|
"flood-color": {
|
|
272
|
-
"$ref": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
423
|
-
{ "$ref": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
3
|
"title": "DiceBear options schema",
|
|
4
4
|
"type": "object",
|
|
5
|
-
"
|
|
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":
|
|
39
|
+
"minimum": 2
|
|
40
40
|
},
|
|
41
41
|
"fontFamilyName": {
|
|
42
42
|
"type": "string",
|
|
@@ -72,12 +72,12 @@
|
|
|
72
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.",
|
|
73
73
|
"oneOf": [
|
|
74
74
|
{
|
|
75
|
-
"$ref": "
|
|
75
|
+
"$ref": "#/definitions/flip"
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
78
|
"type": "array",
|
|
79
79
|
"items": {
|
|
80
|
-
"$ref": "
|
|
80
|
+
"$ref": "#/definitions/flip"
|
|
81
81
|
},
|
|
82
82
|
"maxItems": 128
|
|
83
83
|
}
|
|
@@ -87,12 +87,12 @@
|
|
|
87
87
|
"description": "Specifies the font family used for text rendering. If specified as an array, the PRNG will choose from the available options.",
|
|
88
88
|
"oneOf": [
|
|
89
89
|
{
|
|
90
|
-
"$ref": "
|
|
90
|
+
"$ref": "#/definitions/fontFamilyName"
|
|
91
91
|
},
|
|
92
92
|
{
|
|
93
93
|
"type": "array",
|
|
94
94
|
"items": {
|
|
95
|
-
"$ref": "
|
|
95
|
+
"$ref": "#/definitions/fontFamilyName"
|
|
96
96
|
},
|
|
97
97
|
"maxItems": 128
|
|
98
98
|
}
|
|
@@ -102,12 +102,12 @@
|
|
|
102
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.",
|
|
103
103
|
"oneOf": [
|
|
104
104
|
{
|
|
105
|
-
"$ref": "
|
|
105
|
+
"$ref": "#/definitions/fontWeight"
|
|
106
106
|
},
|
|
107
107
|
{
|
|
108
108
|
"type": "array",
|
|
109
109
|
"items": {
|
|
110
|
-
"$ref": "
|
|
110
|
+
"$ref": "#/definitions/fontWeight"
|
|
111
111
|
},
|
|
112
112
|
"maxItems": 128
|
|
113
113
|
}
|
|
@@ -117,12 +117,12 @@
|
|
|
117
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.",
|
|
118
118
|
"oneOf": [
|
|
119
119
|
{
|
|
120
|
-
"$ref": "
|
|
120
|
+
"$ref": "#/definitions/scale"
|
|
121
121
|
},
|
|
122
122
|
{
|
|
123
123
|
"type": "array",
|
|
124
124
|
"items": {
|
|
125
|
-
"$ref": "
|
|
125
|
+
"$ref": "#/definitions/scale"
|
|
126
126
|
},
|
|
127
127
|
"maxItems": 2
|
|
128
128
|
}
|
|
@@ -132,12 +132,12 @@
|
|
|
132
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.",
|
|
133
133
|
"oneOf": [
|
|
134
134
|
{
|
|
135
|
-
"$ref": "
|
|
135
|
+
"$ref": "#/definitions/borderRadius"
|
|
136
136
|
},
|
|
137
137
|
{
|
|
138
138
|
"type": "array",
|
|
139
139
|
"items": {
|
|
140
|
-
"$ref": "
|
|
140
|
+
"$ref": "#/definitions/borderRadius"
|
|
141
141
|
},
|
|
142
142
|
"maxItems": 2
|
|
143
143
|
}
|
|
@@ -181,12 +181,12 @@
|
|
|
181
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.",
|
|
182
182
|
"oneOf": [
|
|
183
183
|
{
|
|
184
|
-
"$ref": "
|
|
184
|
+
"$ref": "#/definitions/color"
|
|
185
185
|
},
|
|
186
186
|
{
|
|
187
187
|
"type": "array",
|
|
188
188
|
"items": {
|
|
189
|
-
"$ref": "
|
|
189
|
+
"$ref": "#/definitions/color"
|
|
190
190
|
},
|
|
191
191
|
"maxItems": 128
|
|
192
192
|
}
|
|
@@ -196,12 +196,12 @@
|
|
|
196
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.",
|
|
197
197
|
"oneOf": [
|
|
198
198
|
{
|
|
199
|
-
"$ref": "
|
|
199
|
+
"$ref": "#/definitions/colorFill"
|
|
200
200
|
},
|
|
201
201
|
{
|
|
202
202
|
"type": "array",
|
|
203
203
|
"items": {
|
|
204
|
-
"$ref": "
|
|
204
|
+
"$ref": "#/definitions/colorFill"
|
|
205
205
|
},
|
|
206
206
|
"maxItems": 128
|
|
207
207
|
}
|
|
@@ -211,12 +211,12 @@
|
|
|
211
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
212
|
"oneOf": [
|
|
213
213
|
{
|
|
214
|
-
"$ref": "
|
|
214
|
+
"$ref": "#/definitions/colorFillStops"
|
|
215
215
|
},
|
|
216
216
|
{
|
|
217
217
|
"type": "array",
|
|
218
218
|
"items": {
|
|
219
|
-
"$ref": "
|
|
219
|
+
"$ref": "#/definitions/colorFillStops"
|
|
220
220
|
},
|
|
221
221
|
"maxItems": 2
|
|
222
222
|
}
|
|
@@ -226,12 +226,12 @@
|
|
|
226
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.",
|
|
227
227
|
"oneOf": [
|
|
228
228
|
{
|
|
229
|
-
"$ref": "
|
|
229
|
+
"$ref": "#/definitions/rotate"
|
|
230
230
|
},
|
|
231
231
|
{
|
|
232
232
|
"type": "array",
|
|
233
233
|
"items": {
|
|
234
|
-
"$ref": "
|
|
234
|
+
"$ref": "#/definitions/rotate"
|
|
235
235
|
},
|
|
236
236
|
"maxItems": 2
|
|
237
237
|
}
|
|
@@ -241,12 +241,12 @@
|
|
|
241
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
242
|
"oneOf": [
|
|
243
243
|
{
|
|
244
|
-
"$ref": "
|
|
244
|
+
"$ref": "#/definitions/rotate"
|
|
245
245
|
},
|
|
246
246
|
{
|
|
247
247
|
"type": "array",
|
|
248
248
|
"items": {
|
|
249
|
-
"$ref": "
|
|
249
|
+
"$ref": "#/definitions/rotate"
|
|
250
250
|
},
|
|
251
251
|
"maxItems": 2
|
|
252
252
|
}
|
|
@@ -256,12 +256,12 @@
|
|
|
256
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
257
|
"oneOf": [
|
|
258
258
|
{
|
|
259
|
-
"$ref": "
|
|
259
|
+
"$ref": "#/definitions/translate"
|
|
260
260
|
},
|
|
261
261
|
{
|
|
262
262
|
"type": "array",
|
|
263
263
|
"items": {
|
|
264
|
-
"$ref": "
|
|
264
|
+
"$ref": "#/definitions/translate"
|
|
265
265
|
},
|
|
266
266
|
"maxItems": 2
|
|
267
267
|
}
|
|
@@ -271,12 +271,12 @@
|
|
|
271
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
272
|
"oneOf": [
|
|
273
273
|
{
|
|
274
|
-
"$ref": "
|
|
274
|
+
"$ref": "#/definitions/translate"
|
|
275
275
|
},
|
|
276
276
|
{
|
|
277
277
|
"type": "array",
|
|
278
278
|
"items": {
|
|
279
|
-
"$ref": "
|
|
279
|
+
"$ref": "#/definitions/translate"
|
|
280
280
|
},
|
|
281
281
|
"maxItems": 2
|
|
282
282
|
}
|