@dicebear/avataaars 9.2.2 → 9.2.3
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/lib/components/accessories.js +7 -7
- package/lib/components/base.js +1 -1
- package/lib/components/clothing.js +9 -9
- package/lib/components/clothingGraphic.js +10 -10
- package/lib/components/eyebrows.js +13 -13
- package/lib/components/eyes.js +12 -12
- package/lib/components/facialHair.js +5 -5
- package/lib/components/mouth.js +12 -12
- package/lib/components/nose.js +1 -1
- package/lib/components/style.js +2 -2
- package/lib/components/top.js +34 -34
- package/lib/hooks/onPostCreate.d.ts +2 -2
- package/lib/hooks/onPostCreate.js +6 -6
- package/lib/index.js +1 -1
- package/lib/schema.js +424 -439
- package/lib/types.d.ts +2 -2
- package/lib/utils/getColors.js +7 -8
- package/lib/utils/getComponents.d.ts +1 -1
- package/lib/utils/getComponents.js +16 -13
- package/lib/utils/pickComponent.d.ts +1 -1
- package/lib/utils/pickComponent.js +1 -1
- package/package.json +6 -6
package/lib/types.d.ts
CHANGED
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export interface Options {
|
|
8
8
|
style?: ('circle' | 'default')[];
|
|
9
|
-
base?:
|
|
9
|
+
base?: 'default'[];
|
|
10
10
|
clothing?: ('blazerAndShirt' | 'blazerAndSweater' | 'collarAndSweater' | 'graphicShirt' | 'hoodie' | 'overall' | 'shirtCrewNeck' | 'shirtScoopNeck' | 'shirtVNeck')[];
|
|
11
11
|
mouth?: ('concerned' | 'default' | 'disbelief' | 'eating' | 'grimace' | 'sad' | 'screamOpen' | 'serious' | 'smile' | 'tongue' | 'twinkle' | 'vomit')[];
|
|
12
|
-
nose?:
|
|
12
|
+
nose?: 'default'[];
|
|
13
13
|
eyes?: ('closed' | 'cry' | 'default' | 'eyeRoll' | 'happy' | 'hearts' | 'side' | 'squint' | 'surprised' | 'winkWacky' | 'wink' | 'xDizzy')[];
|
|
14
14
|
eyebrows?: ('angryNatural' | 'defaultNatural' | 'flatNatural' | 'frownNatural' | 'raisedExcitedNatural' | 'sadConcernedNatural' | 'unibrowNatural' | 'upDownNatural' | 'angry' | 'default' | 'raisedExcited' | 'sadConcerned' | 'upDown')[];
|
|
15
15
|
top?: ('hat' | 'hijab' | 'turban' | 'winterHat1' | 'winterHat02' | 'winterHat03' | 'winterHat04' | 'bob' | 'bun' | 'curly' | 'curvy' | 'dreads' | 'frida' | 'fro' | 'froBand' | 'longButNotTooLong' | 'miaWallace' | 'shavedSides' | 'straight02' | 'straight01' | 'straightAndStrand' | 'dreads01' | 'dreads02' | 'frizzle' | 'shaggy' | 'shaggyMullet' | 'shortCurly' | 'shortFlat' | 'shortRound' | 'shortWaved' | 'sides' | 'theCaesar' | 'theCaesarAndSidePart' | 'bigHair')[];
|
package/lib/utils/getColors.js
CHANGED
|
@@ -8,13 +8,12 @@ import { convertColor } from './convertColor.js';
|
|
|
8
8
|
export function getColors({ prng, options }) {
|
|
9
9
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
10
10
|
return {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
accessories: convertColor(prng.pick((_a = options.accessoriesColor) !== null && _a !== void 0 ? _a : [], 'transparent')),
|
|
12
|
+
clothes: convertColor(prng.pick((_b = options.clothesColor) !== null && _b !== void 0 ? _b : [], 'transparent')),
|
|
13
|
+
hat: convertColor(prng.pick((_c = options.hatColor) !== null && _c !== void 0 ? _c : [], 'transparent')),
|
|
14
|
+
hair: convertColor(prng.pick((_d = options.hairColor) !== null && _d !== void 0 ? _d : [], 'transparent')),
|
|
15
|
+
skin: convertColor(prng.pick((_e = options.skinColor) !== null && _e !== void 0 ? _e : [], 'transparent')),
|
|
16
|
+
facialHair: convertColor(prng.pick((_f = options.facialHairColor) !== null && _f !== void 0 ? _f : [], 'transparent')),
|
|
17
|
+
background: convertColor(prng.pick((_g = options.backgroundColor) !== null && _g !== void 0 ? _g : [], 'transparent')),
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* File: https://www.figma.com/file/HBLdITkkTnLs4M09BmCe4h
|
|
6
6
|
*/
|
|
7
7
|
import { pickComponent } from './pickComponent.js';
|
|
8
|
-
export function getComponents({ prng, options }) {
|
|
8
|
+
export function getComponents({ prng, options, }) {
|
|
9
9
|
const styleComponent = pickComponent({
|
|
10
10
|
prng,
|
|
11
11
|
group: 'style',
|
|
@@ -62,17 +62,20 @@ export function getComponents({ prng, options }) {
|
|
|
62
62
|
values: options.clothingGraphic,
|
|
63
63
|
});
|
|
64
64
|
return {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
65
|
+
style: styleComponent,
|
|
66
|
+
base: baseComponent,
|
|
67
|
+
clothing: clothingComponent,
|
|
68
|
+
mouth: mouthComponent,
|
|
69
|
+
nose: noseComponent,
|
|
70
|
+
eyes: eyesComponent,
|
|
71
|
+
eyebrows: eyebrowsComponent,
|
|
72
|
+
top: prng.bool(options.topProbability) ? topComponent : undefined,
|
|
73
|
+
facialHair: prng.bool(options.facialHairProbability)
|
|
74
|
+
? facialHairComponent
|
|
75
|
+
: undefined,
|
|
76
|
+
accessories: prng.bool(options.accessoriesProbability)
|
|
77
|
+
? accessoriesComponent
|
|
78
|
+
: undefined,
|
|
79
|
+
clothingGraphic: clothingGraphicComponent,
|
|
76
80
|
};
|
|
77
81
|
}
|
|
78
|
-
;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* File: https://www.figma.com/file/HBLdITkkTnLs4M09BmCe4h
|
|
6
6
|
*/
|
|
7
7
|
import * as components from '../components/index.js';
|
|
8
|
-
export function pickComponent({ prng, group, values = [] }) {
|
|
8
|
+
export function pickComponent({ prng, group, values = [], }) {
|
|
9
9
|
const componentCollection = components;
|
|
10
10
|
const key = prng.pick(values);
|
|
11
11
|
if (key && componentCollection[group][key]) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dicebear/avataaars",
|
|
3
|
-
"version": "9.2.
|
|
3
|
+
"version": "9.2.3",
|
|
4
4
|
"description": "Avatar style for DiceBear",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dicebear"
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"test": "uvu tests"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@dicebear/core": "9.2.
|
|
33
|
-
"@tsconfig/recommended": "^1.0.
|
|
34
|
-
"del-cli": "^
|
|
35
|
-
"typescript": "^5.
|
|
32
|
+
"@dicebear/core": "9.2.3",
|
|
33
|
+
"@tsconfig/recommended": "^1.0.10",
|
|
34
|
+
"del-cli": "^6.0.0",
|
|
35
|
+
"typescript": "^5.8.3",
|
|
36
36
|
"uvu": "^0.5.6"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"publishConfig": {
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "8cfdc4d029c9de6a82fef4e27ed67b5e2cd14a30"
|
|
48
48
|
}
|