@dicebear/adventurer 5.0.0-alpha.12 → 5.0.0-alpha.13
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.
|
@@ -3,6 +3,6 @@ export { eyes } from './eyes.js';
|
|
|
3
3
|
export { eyebrows } from './eyebrows.js';
|
|
4
4
|
export { mouth } from './mouth.js';
|
|
5
5
|
export { features } from './features.js';
|
|
6
|
+
export { glasses } from './glasses.js';
|
|
6
7
|
export { hair } from './hair.js';
|
|
7
8
|
export { earrings } from './earrings.js';
|
|
8
|
-
export { glasses } from './glasses.js';
|
package/lib/components/index.js
CHANGED
|
@@ -3,6 +3,6 @@ export { eyes } from './eyes.js';
|
|
|
3
3
|
export { eyebrows } from './eyebrows.js';
|
|
4
4
|
export { mouth } from './mouth.js';
|
|
5
5
|
export { features } from './features.js';
|
|
6
|
+
export { glasses } from './glasses.js';
|
|
6
7
|
export { hair } from './hair.js';
|
|
7
8
|
export { earrings } from './earrings.js';
|
|
8
|
-
export { glasses } from './glasses.js';
|
package/lib/core.js
CHANGED
|
@@ -27,7 +27,7 @@ export const style = {
|
|
|
27
27
|
fill: 'none',
|
|
28
28
|
'shape-rendering': 'auto',
|
|
29
29
|
},
|
|
30
|
-
body: `${(_b = (_a = components.base) === null || _a === void 0 ? void 0 : _a.value(components, colors)) !== null && _b !== void 0 ? _b : ''}<g transform="translate(-161 -83)">${(_d = (_c = components.eyes) === null || _c === void 0 ? void 0 : _c.value(components, colors)) !== null && _d !== void 0 ? _d : ''}</g><g transform="translate(-161 -83)">${(_f = (_e = components.eyebrows) === null || _e === void 0 ? void 0 : _e.value(components, colors)) !== null && _f !== void 0 ? _f : ''}</g><g transform="translate(-161 -83)">${(_h = (_g = components.mouth) === null || _g === void 0 ? void 0 : _g.value(components, colors)) !== null && _h !== void 0 ? _h : ''}</g><g transform="translate(-161 -83)">${(_k = (_j = components.features) === null || _j === void 0 ? void 0 : _j.value(components, colors)) !== null && _k !== void 0 ? _k : ''}</g><g transform="translate(-161 -83)">${(_m = (_l = components.
|
|
30
|
+
body: `${(_b = (_a = components.base) === null || _a === void 0 ? void 0 : _a.value(components, colors)) !== null && _b !== void 0 ? _b : ''}<g transform="translate(-161 -83)">${(_d = (_c = components.eyes) === null || _c === void 0 ? void 0 : _c.value(components, colors)) !== null && _d !== void 0 ? _d : ''}</g><g transform="translate(-161 -83)">${(_f = (_e = components.eyebrows) === null || _e === void 0 ? void 0 : _e.value(components, colors)) !== null && _f !== void 0 ? _f : ''}</g><g transform="translate(-161 -83)">${(_h = (_g = components.mouth) === null || _g === void 0 ? void 0 : _g.value(components, colors)) !== null && _h !== void 0 ? _h : ''}</g><g transform="translate(-161 -83)">${(_k = (_j = components.features) === null || _j === void 0 ? void 0 : _j.value(components, colors)) !== null && _k !== void 0 ? _k : ''}</g><g transform="translate(-161 -83)">${(_m = (_l = components.glasses) === null || _l === void 0 ? void 0 : _l.value(components, colors)) !== null && _m !== void 0 ? _m : ''}</g><g transform="translate(-161 -83)">${(_p = (_o = components.hair) === null || _o === void 0 ? void 0 : _o.value(components, colors)) !== null && _p !== void 0 ? _p : ''}</g><g transform="translate(-161 -83)">${(_r = (_q = components.earrings) === null || _q === void 0 ? void 0 : _q.value(components, colors)) !== null && _r !== void 0 ? _r : ''}</g>`,
|
|
31
31
|
};
|
|
32
32
|
},
|
|
33
33
|
preview: ({ prng, options, property }) => {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export function onPostCreate({ prng, options, components, colors, preview, }) {
|
|
2
2
|
var _a;
|
|
3
3
|
const invisibleEarringsHair = [
|
|
4
|
-
'
|
|
5
|
-
'
|
|
6
|
-
'
|
|
7
|
-
'
|
|
8
|
-
'
|
|
9
|
-
'
|
|
4
|
+
'long01',
|
|
5
|
+
'long04',
|
|
6
|
+
'long05',
|
|
7
|
+
'long20',
|
|
8
|
+
'long22',
|
|
9
|
+
'long24',
|
|
10
10
|
];
|
|
11
11
|
if (false === preview &&
|
|
12
12
|
((_a = components.hair) === null || _a === void 0 ? void 0 : _a.name) &&
|
package/lib/meta/components.js
CHANGED
|
@@ -19,15 +19,15 @@ export const dimensions = {
|
|
|
19
19
|
width: 1024,
|
|
20
20
|
height: 1024,
|
|
21
21
|
},
|
|
22
|
-
|
|
22
|
+
glasses: {
|
|
23
23
|
width: 1024,
|
|
24
24
|
height: 1024,
|
|
25
25
|
},
|
|
26
|
-
|
|
26
|
+
hair: {
|
|
27
27
|
width: 1024,
|
|
28
28
|
height: 1024,
|
|
29
29
|
},
|
|
30
|
-
|
|
30
|
+
earrings: {
|
|
31
31
|
width: 1024,
|
|
32
32
|
height: 1024,
|
|
33
33
|
},
|
package/lib/types.d.ts
CHANGED
|
@@ -5,12 +5,12 @@ export interface Options {
|
|
|
5
5
|
mouth?: ('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')[];
|
|
6
6
|
features?: ('blush' | 'birthmark' | 'freckles')[];
|
|
7
7
|
featuresProbability?: number;
|
|
8
|
+
glasses?: ('variant01' | 'variant02' | 'variant03' | 'variant04' | 'variant05')[];
|
|
9
|
+
glassesProbability?: number;
|
|
8
10
|
hair?: ('short16' | 'short15' | 'short14' | 'short13' | 'short12' | 'short11' | 'short10' | 'short09' | 'short08' | 'short07' | 'short06' | 'short05' | 'short04' | 'short03' | 'long20' | 'short02' | 'short01' | 'long19' | 'long18' | 'long17' | 'long16' | 'long15' | 'long14' | 'long13' | 'long12' | 'long11' | 'long10' | 'long09' | 'long08' | 'long07' | 'long06' | 'long05' | 'long04' | 'long03' | 'long02' | 'long01' | 'short19' | 'long26' | 'long25' | 'short18' | 'long24' | 'long23' | 'long22' | 'short17' | 'long21')[];
|
|
9
11
|
hairProbability?: number;
|
|
10
12
|
earrings?: ('variant06' | 'variant01' | 'variant02' | 'variant03' | 'variant04' | 'variant05')[];
|
|
11
13
|
earringsProbability?: number;
|
|
12
|
-
glasses?: ('variant01' | 'variant02' | 'variant03' | 'variant04' | 'variant05')[];
|
|
13
|
-
glassesProbability?: number;
|
|
14
14
|
skinColor?: string[];
|
|
15
15
|
hairColor?: string[];
|
|
16
16
|
earringsColor?: string[];
|
|
@@ -25,6 +25,11 @@ export function getComponents({ prng, options, }) {
|
|
|
25
25
|
group: 'features',
|
|
26
26
|
values: options.features,
|
|
27
27
|
});
|
|
28
|
+
const glassesComponent = pickComponent({
|
|
29
|
+
prng,
|
|
30
|
+
group: 'glasses',
|
|
31
|
+
values: options.glasses,
|
|
32
|
+
});
|
|
28
33
|
const hairComponent = pickComponent({
|
|
29
34
|
prng,
|
|
30
35
|
group: 'hair',
|
|
@@ -35,11 +40,6 @@ export function getComponents({ prng, options, }) {
|
|
|
35
40
|
group: 'earrings',
|
|
36
41
|
values: options.earrings,
|
|
37
42
|
});
|
|
38
|
-
const glassesComponent = pickComponent({
|
|
39
|
-
prng,
|
|
40
|
-
group: 'glasses',
|
|
41
|
-
values: options.glasses,
|
|
42
|
-
});
|
|
43
43
|
return {
|
|
44
44
|
base: baseComponent,
|
|
45
45
|
eyes: eyesComponent,
|
|
@@ -48,12 +48,12 @@ export function getComponents({ prng, options, }) {
|
|
|
48
48
|
features: prng.bool(options.featuresProbability)
|
|
49
49
|
? featuresComponent
|
|
50
50
|
: undefined,
|
|
51
|
+
glasses: prng.bool(options.glassesProbability)
|
|
52
|
+
? glassesComponent
|
|
53
|
+
: undefined,
|
|
51
54
|
hair: prng.bool(options.hairProbability) ? hairComponent : undefined,
|
|
52
55
|
earrings: prng.bool(options.earringsProbability)
|
|
53
56
|
? earringsComponent
|
|
54
57
|
: undefined,
|
|
55
|
-
glasses: prng.bool(options.glassesProbability)
|
|
56
|
-
? glassesComponent
|
|
57
|
-
: undefined,
|
|
58
58
|
};
|
|
59
59
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dicebear/adventurer",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.13",
|
|
4
4
|
"description": "Avatar style for DiceBear",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dicebear"
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"test": "uvu tests"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@dicebear/core": "^5.0.0-alpha.
|
|
31
|
+
"@dicebear/core": "^5.0.0-alpha.13",
|
|
32
32
|
"@tsconfig/recommended": "^1.0.0",
|
|
33
33
|
"@types/jest": "^26.0.22",
|
|
34
34
|
"del-cli": "^4.0.1",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"publishConfig": {
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "73f03408dec4386525493811f0f35b30509844ad"
|
|
48
48
|
}
|