@dicebear/lorelei 9.2.1 → 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/beard.js +2 -2
- package/lib/components/earrings.js +3 -3
- package/lib/components/eyebrows.js +13 -13
- package/lib/components/eyes.js +24 -24
- package/lib/components/freckles.js +1 -1
- package/lib/components/glasses.js +5 -5
- package/lib/components/hair.js +48 -48
- package/lib/components/hairAccessories.js +1 -1
- package/lib/components/head.js +4 -4
- package/lib/components/mouth.js +27 -27
- package/lib/components/nose.js +6 -6
- package/lib/hooks/onPostCreate.d.ts +2 -2
- package/lib/index.js +1 -1
- package/lib/schema.js +407 -465
- package/lib/types.d.ts +2 -2
- package/lib/utils/getColors.js +10 -11
- package/lib/utils/getComponents.d.ts +1 -1
- package/lib/utils/getComponents.js +20 -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,14 +6,14 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export interface Options {
|
|
8
8
|
hair?: ('variant48' | 'variant47' | 'variant46' | 'variant45' | 'variant44' | 'variant43' | 'variant42' | 'variant41' | 'variant40' | 'variant39' | 'variant38' | 'variant37' | 'variant36' | 'variant35' | 'variant34' | 'variant33' | 'variant32' | 'variant31' | 'variant30' | 'variant29' | 'variant28' | 'variant27' | 'variant26' | 'variant25' | 'variant24' | 'variant23' | 'variant22' | 'variant21' | 'variant20' | 'variant19' | 'variant18' | 'variant17' | 'variant16' | 'variant15' | 'variant14' | 'variant13' | 'variant12' | 'variant11' | 'variant10' | 'variant09' | 'variant08' | 'variant07' | 'variant06' | 'variant05' | 'variant04' | 'variant03' | 'variant02' | 'variant01')[];
|
|
9
|
-
hairAccessories?:
|
|
9
|
+
hairAccessories?: 'flowers'[];
|
|
10
10
|
hairAccessoriesProbability?: number;
|
|
11
11
|
head?: ('variant04' | 'variant03' | 'variant02' | 'variant01')[];
|
|
12
12
|
eyes?: ('variant24' | 'variant23' | 'variant22' | 'variant21' | 'variant20' | 'variant19' | 'variant18' | 'variant17' | 'variant16' | 'variant15' | 'variant14' | 'variant13' | 'variant12' | 'variant11' | 'variant10' | 'variant09' | 'variant08' | 'variant07' | 'variant06' | 'variant05' | 'variant04' | 'variant03' | 'variant02' | 'variant01')[];
|
|
13
13
|
eyebrows?: ('variant13' | 'variant12' | 'variant11' | 'variant10' | 'variant09' | 'variant08' | 'variant07' | 'variant06' | 'variant05' | 'variant04' | 'variant03' | 'variant02' | 'variant01')[];
|
|
14
14
|
earrings?: ('variant01' | 'variant02' | 'variant03')[];
|
|
15
15
|
earringsProbability?: number;
|
|
16
|
-
freckles?:
|
|
16
|
+
freckles?: 'variant01'[];
|
|
17
17
|
frecklesProbability?: number;
|
|
18
18
|
nose?: ('variant01' | 'variant02' | 'variant03' | 'variant04' | 'variant05' | 'variant06')[];
|
|
19
19
|
beard?: ('variant01' | 'variant02')[];
|
package/lib/utils/getColors.js
CHANGED
|
@@ -8,16 +8,15 @@ import { convertColor } from './convertColor.js';
|
|
|
8
8
|
export function getColors({ prng, options }) {
|
|
9
9
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
10
10
|
return {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
hair: convertColor(prng.pick((_a = options.hairColor) !== null && _a !== void 0 ? _a : [], 'transparent')),
|
|
12
|
+
skin: convertColor(prng.pick((_b = options.skinColor) !== null && _b !== void 0 ? _b : [], 'transparent')),
|
|
13
|
+
earrings: convertColor(prng.pick((_c = options.earringsColor) !== null && _c !== void 0 ? _c : [], 'transparent')),
|
|
14
|
+
eyebrows: convertColor(prng.pick((_d = options.eyebrowsColor) !== null && _d !== void 0 ? _d : [], 'transparent')),
|
|
15
|
+
eyes: convertColor(prng.pick((_e = options.eyesColor) !== null && _e !== void 0 ? _e : [], 'transparent')),
|
|
16
|
+
freckles: convertColor(prng.pick((_f = options.frecklesColor) !== null && _f !== void 0 ? _f : [], 'transparent')),
|
|
17
|
+
glasses: convertColor(prng.pick((_g = options.glassesColor) !== null && _g !== void 0 ? _g : [], 'transparent')),
|
|
18
|
+
mouth: convertColor(prng.pick((_h = options.mouthColor) !== null && _h !== void 0 ? _h : [], 'transparent')),
|
|
19
|
+
nose: convertColor(prng.pick((_j = options.noseColor) !== null && _j !== void 0 ? _j : [], 'transparent')),
|
|
20
|
+
hairAccessories: convertColor(prng.pick((_k = options.hairAccessoriesColor) !== null && _k !== void 0 ? _k : [], 'transparent')),
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* File: https://www.figma.com/community/file/1198749693280469639
|
|
6
6
|
*/
|
|
7
7
|
import { pickComponent } from './pickComponent.js';
|
|
8
|
-
export function getComponents({ prng, options }) {
|
|
8
|
+
export function getComponents({ prng, options, }) {
|
|
9
9
|
const hairComponent = pickComponent({
|
|
10
10
|
prng,
|
|
11
11
|
group: 'hair',
|
|
@@ -62,17 +62,24 @@ export function getComponents({ prng, options }) {
|
|
|
62
62
|
values: options.glasses,
|
|
63
63
|
});
|
|
64
64
|
return {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
65
|
+
hair: hairComponent,
|
|
66
|
+
hairAccessories: prng.bool(options.hairAccessoriesProbability)
|
|
67
|
+
? hairAccessoriesComponent
|
|
68
|
+
: undefined,
|
|
69
|
+
head: headComponent,
|
|
70
|
+
eyes: eyesComponent,
|
|
71
|
+
eyebrows: eyebrowsComponent,
|
|
72
|
+
earrings: prng.bool(options.earringsProbability)
|
|
73
|
+
? earringsComponent
|
|
74
|
+
: undefined,
|
|
75
|
+
freckles: prng.bool(options.frecklesProbability)
|
|
76
|
+
? frecklesComponent
|
|
77
|
+
: undefined,
|
|
78
|
+
nose: noseComponent,
|
|
79
|
+
beard: prng.bool(options.beardProbability) ? beardComponent : undefined,
|
|
80
|
+
mouth: mouthComponent,
|
|
81
|
+
glasses: prng.bool(options.glassesProbability)
|
|
82
|
+
? glassesComponent
|
|
83
|
+
: undefined,
|
|
76
84
|
};
|
|
77
85
|
}
|
|
78
|
-
;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* File: https://www.figma.com/community/file/1198749693280469639
|
|
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/lorelei",
|
|
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
|
}
|