@dicebear/big-ears 5.0.3 → 5.1.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/lib/index.js +10 -0
- package/lib/utils/convertColor.js +1 -4
- package/lib/utils/getColors.js +3 -3
- package/package.json +3 -3
package/lib/index.js
CHANGED
|
@@ -27,6 +27,16 @@ export const create = ({ prng, options }) => {
|
|
|
27
27
|
'shape-rendering': 'auto'
|
|
28
28
|
},
|
|
29
29
|
body: `<g transform="matrix(.71048 0 0 .71048 24 2)">${(_b = (_a = components.hair) === null || _a === void 0 ? void 0 : _a.value(components, colors)) !== null && _b !== void 0 ? _b : ''}</g><g transform="translate(81.7 150.7) scale(.71856)">${(_d = (_c = components.face) === null || _c === void 0 ? void 0 : _c.value(components, colors)) !== null && _d !== void 0 ? _d : ''}</g><g transform="translate(199.5 333.4) scale(.71856)">${(_f = (_e = components.mouth) === null || _e === void 0 ? void 0 : _e.value(components, colors)) !== null && _f !== void 0 ? _f : ''}</g><g transform="translate(280.7 235.4) scale(.71856)">${(_h = (_g = components.ear) === null || _g === void 0 ? void 0 : _g.value(components, colors)) !== null && _h !== void 0 ? _h : ''}</g><g transform="matrix(-.71856 0 0 .71856 161.5 235.4)">${(_k = (_j = components.ear) === null || _j === void 0 ? void 0 : _j.value(components, colors)) !== null && _k !== void 0 ? _k : ''}</g><g transform="translate(114.8 215.5) scale(.71856)">${(_m = (_l = components.eyes) === null || _l === void 0 ? void 0 : _l.value(components, colors)) !== null && _m !== void 0 ? _m : ''}</g><g transform="translate(127.7 288.7) scale(.71856)">${(_p = (_o = components.cheek) === null || _o === void 0 ? void 0 : _o.value(components, colors)) !== null && _p !== void 0 ? _p : ''}</g><g transform="translate(193 279.4) scale(.71856)">${(_r = (_q = components.nose) === null || _q === void 0 ? void 0 : _q.value(components, colors)) !== null && _r !== void 0 ? _r : ''}</g><g transform="matrix(.52237 0 0 .52237 122.9 244.8)">${(_t = (_s = components.sideburn) === null || _s === void 0 ? void 0 : _s.value(components, colors)) !== null && _t !== void 0 ? _t : ''}</g><g transform="matrix(-.52237 0 0 .52237 315.7 244.8)">${(_v = (_u = components.sideburn) === null || _u === void 0 ? void 0 : _u.value(components, colors)) !== null && _v !== void 0 ? _v : ''}</g><g transform="matrix(.52237 0 0 .52237 108.7 145.6)">${(_x = (_w = components.frontHair) === null || _w === void 0 ? void 0 : _w.value(components, colors)) !== null && _x !== void 0 ? _x : ''}</g>`,
|
|
30
|
+
extra: () => ({
|
|
31
|
+
...Object.entries(components).reduce((acc, [key, value]) => {
|
|
32
|
+
acc[key] = value === null || value === void 0 ? void 0 : value.name;
|
|
33
|
+
return acc;
|
|
34
|
+
}, {}),
|
|
35
|
+
...Object.entries(colors).reduce((acc, [key, value]) => {
|
|
36
|
+
acc[`${key}Color`] = value;
|
|
37
|
+
return acc;
|
|
38
|
+
}, {}),
|
|
39
|
+
}),
|
|
30
40
|
};
|
|
31
41
|
};
|
|
32
42
|
export { schema } from './schema.js';
|
package/lib/utils/getColors.js
CHANGED
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { convertColor } from './convertColor.js';
|
|
8
8
|
export function getColors({ prng, options }) {
|
|
9
|
-
var _a, _b
|
|
9
|
+
var _a, _b;
|
|
10
10
|
return {
|
|
11
|
-
'hair': convertColor(
|
|
12
|
-
'skin': convertColor(
|
|
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
13
|
};
|
|
14
14
|
}
|
|
15
15
|
;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dicebear/big-ears",
|
|
3
|
-
"version": "5.0
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"description": "Avatar style for DiceBear",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dicebear"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"test": "uvu tests"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@dicebear/core": "^5.0
|
|
32
|
+
"@dicebear/core": "^5.1.0",
|
|
33
33
|
"@tsconfig/recommended": "^1.0.1",
|
|
34
34
|
"del-cli": "^4.0.1",
|
|
35
35
|
"typescript": "^4.6.3",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"publishConfig": {
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "4f9e4686aa33809026d6ce25c4a5f2d0750d59f4"
|
|
48
48
|
}
|