@dicebear/avataaars 5.0.0-alpha.16 → 5.0.0-alpha.21
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/LICENSE +1 -1
- package/lib/colors/accessories.js +1 -1
- package/lib/colors/clothes.js +1 -1
- package/lib/colors/hat.js +1 -1
- package/lib/core.js +2 -34
- package/lib/hooks/onPostCreate.d.ts +1 -2
- package/lib/hooks/onPostCreate.js +1 -1
- package/lib/hooks/onPreCreate.d.ts +1 -2
- package/lib/hooks/onPreCreate.js +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/index.js +3 -3
- package/package.json +8 -9
- package/lib/meta/components.d.ts +0 -4
- package/lib/meta/components.js +0 -42
package/LICENSE
CHANGED
|
@@ -3,7 +3,7 @@ export const accessories = {
|
|
|
3
3
|
blue01: 'rgba(101, 201, 255, 1)',
|
|
4
4
|
blue02: 'rgba(81, 153, 228, 1)',
|
|
5
5
|
blue03: 'rgba(37, 85, 124, 1)',
|
|
6
|
-
gray01: 'rgba(
|
|
6
|
+
gray01: 'rgba(230, 230, 230, 1)',
|
|
7
7
|
gray02: 'rgba(146, 149, 152, 1)',
|
|
8
8
|
heather: 'rgba(60, 79, 92, 1)',
|
|
9
9
|
pastelBlue: 'rgba(177, 226, 255, 1)',
|
package/lib/colors/clothes.js
CHANGED
|
@@ -3,7 +3,7 @@ export const clothes = {
|
|
|
3
3
|
blue01: 'rgba(101, 201, 255, 1)',
|
|
4
4
|
blue02: 'rgba(81, 153, 228, 1)',
|
|
5
5
|
blue03: 'rgba(37, 85, 124, 1)',
|
|
6
|
-
gray01: 'rgba(
|
|
6
|
+
gray01: 'rgba(230, 230, 230, 1)',
|
|
7
7
|
gray02: 'rgba(146, 149, 152, 1)',
|
|
8
8
|
heather: 'rgba(60, 79, 92, 1)',
|
|
9
9
|
pastelBlue: 'rgba(177, 226, 255, 1)',
|
package/lib/colors/hat.js
CHANGED
|
@@ -3,7 +3,7 @@ export const hat = {
|
|
|
3
3
|
blue01: 'rgba(101, 201, 255, 1)',
|
|
4
4
|
blue02: 'rgba(81, 153, 228, 1)',
|
|
5
5
|
blue03: 'rgba(37, 85, 124, 1)',
|
|
6
|
-
gray01: 'rgba(
|
|
6
|
+
gray01: 'rgba(230, 230, 230, 1)',
|
|
7
7
|
gray02: 'rgba(146, 149, 152, 1)',
|
|
8
8
|
heather: 'rgba(60, 79, 92, 1)',
|
|
9
9
|
pastelBlue: 'rgba(177, 226, 255, 1)',
|
package/lib/core.js
CHANGED
|
@@ -3,7 +3,6 @@ import { getComponents } from './utils/getComponents.js';
|
|
|
3
3
|
import { getColors } from './utils/getColors.js';
|
|
4
4
|
import { onPreCreate } from './hooks/onPreCreate.js';
|
|
5
5
|
import { onPostCreate } from './hooks/onPostCreate.js';
|
|
6
|
-
import { dimensions } from './meta/components.js';
|
|
7
6
|
export const style = {
|
|
8
7
|
meta: {
|
|
9
8
|
title: 'Avataaars',
|
|
@@ -17,10 +16,10 @@ export const style = {
|
|
|
17
16
|
schema: schema,
|
|
18
17
|
create: ({ prng, options }) => {
|
|
19
18
|
var _a, _b;
|
|
20
|
-
onPreCreate({ prng, options
|
|
19
|
+
onPreCreate({ prng, options });
|
|
21
20
|
const components = getComponents({ prng, options });
|
|
22
21
|
const colors = getColors({ prng, options });
|
|
23
|
-
onPostCreate({ prng, options, components, colors
|
|
22
|
+
onPostCreate({ prng, options, components, colors });
|
|
24
23
|
return {
|
|
25
24
|
attributes: {
|
|
26
25
|
viewBox: '0 0 280 280',
|
|
@@ -30,35 +29,4 @@ export const style = {
|
|
|
30
29
|
body: `<g transform="translate(8)">${(_b = (_a = components.style) === null || _a === void 0 ? void 0 : _a.value(components, colors)) !== null && _b !== void 0 ? _b : ''}</g>`,
|
|
31
30
|
};
|
|
32
31
|
},
|
|
33
|
-
preview: ({ prng, options, property }) => {
|
|
34
|
-
var _a, _b;
|
|
35
|
-
const componentGroup = property.toString();
|
|
36
|
-
const colorGroup = property.toString().replace(/Color$/, '');
|
|
37
|
-
onPreCreate({ prng, options, preview: true });
|
|
38
|
-
const components = getComponents({ prng, options });
|
|
39
|
-
const colors = getColors({ prng, options });
|
|
40
|
-
onPostCreate({ prng, options, components, colors, preview: true });
|
|
41
|
-
if (componentGroup in components) {
|
|
42
|
-
const { width, height } = dimensions[componentGroup];
|
|
43
|
-
return {
|
|
44
|
-
attributes: {
|
|
45
|
-
viewBox: `0 0 ${width} ${height}`,
|
|
46
|
-
fill: 'none',
|
|
47
|
-
'shape-rendering': 'auto',
|
|
48
|
-
},
|
|
49
|
-
body: (_b = (_a = components[componentGroup]) === null || _a === void 0 ? void 0 : _a.value(components, colors)) !== null && _b !== void 0 ? _b : '',
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
if (colorGroup in colors) {
|
|
53
|
-
return {
|
|
54
|
-
attributes: {
|
|
55
|
-
viewBox: `0 0 1 1`,
|
|
56
|
-
fill: 'none',
|
|
57
|
-
'shape-rendering': 'auto',
|
|
58
|
-
},
|
|
59
|
-
body: `<rect width="1" height="1" fill="${colors[colorGroup].value}" />`,
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
return undefined;
|
|
63
|
-
},
|
|
64
32
|
};
|
|
@@ -5,7 +5,6 @@ declare type Props = {
|
|
|
5
5
|
options: StyleOptions<Options>;
|
|
6
6
|
components: ComponentPickCollection;
|
|
7
7
|
colors: ColorPickCollection;
|
|
8
|
-
preview: boolean;
|
|
9
8
|
};
|
|
10
|
-
export declare function onPostCreate({ prng, options, components, colors
|
|
9
|
+
export declare function onPostCreate({ prng, options, components, colors }: Props): void;
|
|
11
10
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function onPostCreate({ prng, options, components, colors
|
|
1
|
+
export function onPostCreate({ prng, options, components, colors }) {
|
|
2
2
|
var _a;
|
|
3
3
|
if (((_a = components.style) === null || _a === void 0 ? void 0 : _a.name) === 'circle') {
|
|
4
4
|
options.backgroundColor = [];
|
|
@@ -3,7 +3,6 @@ import { Options } from '../types.js';
|
|
|
3
3
|
declare type Props = {
|
|
4
4
|
prng: Prng;
|
|
5
5
|
options: StyleOptions<Options>;
|
|
6
|
-
preview: boolean;
|
|
7
6
|
};
|
|
8
|
-
export declare function onPreCreate({ prng, options
|
|
7
|
+
export declare function onPreCreate({ prng, options }: Props): void;
|
|
9
8
|
export {};
|
package/lib/hooks/onPreCreate.js
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* Avataaars (@dicebear/avataaars)
|
|
3
3
|
*
|
|
4
4
|
* Code licensed under MIT License.
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) 2022 Florian Körner
|
|
6
6
|
*
|
|
7
7
|
* Design "Avataaars" by Pablo Stanley licensed under Free for personal and commercial use.
|
|
8
8
|
* Source: https://avataaars.com/
|
|
9
9
|
* License: https://avataaars.com/
|
|
10
10
|
*/
|
|
11
|
-
declare const create: import("@dicebear/core").StyleCreate<import("./types.js").Options>,
|
|
12
|
-
export { create,
|
|
11
|
+
declare const create: import("@dicebear/core").StyleCreate<import("./types.js").Options>, meta: import("@dicebear/core").StyleMeta, schema: import("json-schema").JSONSchema7;
|
|
12
|
+
export { create, meta, schema };
|
|
13
13
|
export type { Options } from './types.js';
|
package/lib/index.js
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* Avataaars (@dicebear/avataaars)
|
|
3
3
|
*
|
|
4
4
|
* Code licensed under MIT License.
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) 2022 Florian Körner
|
|
6
6
|
*
|
|
7
7
|
* Design "Avataaars" by Pablo Stanley licensed under Free for personal and commercial use.
|
|
8
8
|
* Source: https://avataaars.com/
|
|
9
9
|
* License: https://avataaars.com/
|
|
10
10
|
*/
|
|
11
11
|
import { style } from './core.js';
|
|
12
|
-
const { create,
|
|
13
|
-
export { create,
|
|
12
|
+
const { create, meta, schema } = style;
|
|
13
|
+
export { create, meta, schema };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dicebear/avataaars",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.21",
|
|
4
4
|
"description": "Avatar style for DiceBear",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dicebear"
|
|
@@ -28,21 +28,20 @@
|
|
|
28
28
|
"test": "uvu tests"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@dicebear/core": "^5.0.0-alpha.
|
|
32
|
-
"@tsconfig/recommended": "^1.0.
|
|
33
|
-
"@types/jest": "^26.0.22",
|
|
31
|
+
"@dicebear/core": "^5.0.0-alpha.21",
|
|
32
|
+
"@tsconfig/recommended": "^1.0.1",
|
|
34
33
|
"del-cli": "^4.0.1",
|
|
35
|
-
"typescript": "^4.
|
|
36
|
-
"uvu": "^0.5.
|
|
34
|
+
"typescript": "^4.6.3",
|
|
35
|
+
"uvu": "^0.5.3"
|
|
37
36
|
},
|
|
38
37
|
"peerDependencies": {
|
|
39
|
-
"@dicebear/core": "^5.0.0-alpha.
|
|
38
|
+
"@dicebear/core": "^5.0.0-alpha.16"
|
|
40
39
|
},
|
|
41
40
|
"engines": {
|
|
42
|
-
"node": "^
|
|
41
|
+
"node": "^14.13.1 || >=16.0.0"
|
|
43
42
|
},
|
|
44
43
|
"publishConfig": {
|
|
45
44
|
"access": "public"
|
|
46
45
|
},
|
|
47
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "40b7190a19ba3c6c355178f1ae6c422229634e06"
|
|
48
47
|
}
|
package/lib/meta/components.d.ts
DELETED
package/lib/meta/components.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
export const dimensions = {
|
|
2
|
-
style: {
|
|
3
|
-
width: 264,
|
|
4
|
-
height: 280,
|
|
5
|
-
},
|
|
6
|
-
clothing: {
|
|
7
|
-
width: 264,
|
|
8
|
-
height: 110,
|
|
9
|
-
},
|
|
10
|
-
mouth: {
|
|
11
|
-
width: 108,
|
|
12
|
-
height: 44,
|
|
13
|
-
},
|
|
14
|
-
nose: {
|
|
15
|
-
width: 56,
|
|
16
|
-
height: 24,
|
|
17
|
-
},
|
|
18
|
-
eyes: {
|
|
19
|
-
width: 112,
|
|
20
|
-
height: 44,
|
|
21
|
-
},
|
|
22
|
-
eyebrows: {
|
|
23
|
-
width: 112,
|
|
24
|
-
height: 24,
|
|
25
|
-
},
|
|
26
|
-
top: {
|
|
27
|
-
width: 266,
|
|
28
|
-
height: 280,
|
|
29
|
-
},
|
|
30
|
-
facialHair: {
|
|
31
|
-
width: 168,
|
|
32
|
-
height: 152,
|
|
33
|
-
},
|
|
34
|
-
accessories: {
|
|
35
|
-
width: 142,
|
|
36
|
-
height: 54,
|
|
37
|
-
},
|
|
38
|
-
clothingGraphic: {
|
|
39
|
-
width: 110,
|
|
40
|
-
height: 44,
|
|
41
|
-
},
|
|
42
|
-
};
|