@dicebear/miniavs 5.0.0-alpha.15 → 5.0.0-alpha.20
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/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 -34
package/LICENSE
CHANGED
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: 'Miniavs - Free Avatar Creator',
|
|
@@ -17,10 +16,10 @@ export const style = {
|
|
|
17
16
|
schema: schema,
|
|
18
17
|
create: ({ prng, options }) => {
|
|
19
18
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
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 64 64',
|
|
@@ -30,35 +29,4 @@ export const style = {
|
|
|
30
29
|
body: `${(_b = (_a = components.head) === null || _a === void 0 ? void 0 : _a.value(components, colors)) !== null && _b !== void 0 ? _b : ''}${(_d = (_c = components.body) === null || _c === void 0 ? void 0 : _c.value(components, colors)) !== null && _d !== void 0 ? _d : ''}${(_f = (_e = components.hair) === null || _e === void 0 ? void 0 : _e.value(components, colors)) !== null && _f !== void 0 ? _f : ''}<g transform="translate(1)">${(_h = (_g = components.mouth) === null || _g === void 0 ? void 0 : _g.value(components, colors)) !== null && _h !== void 0 ? _h : ''}</g><g transform="translate(0 -1)">${(_k = (_j = components.eyes) === null || _j === void 0 ? void 0 : _j.value(components, colors)) !== null && _k !== void 0 ? _k : ''}</g>${(_m = (_l = components.glasses) === null || _l === void 0 ? void 0 : _l.value(components, colors)) !== null && _m !== void 0 ? _m : ''}${(_p = (_o = components.mustache) === null || _o === void 0 ? void 0 : _o.value(components, colors)) !== null && _p !== void 0 ? _p : ''}`,
|
|
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 {};
|
|
@@ -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
|
* Miniavs (@dicebear/miniavs)
|
|
3
3
|
*
|
|
4
4
|
* Code licensed under MIT License.
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) 2022 Florian Körner
|
|
6
6
|
*
|
|
7
7
|
* Design "Miniavs - Free Avatar Creator" by Webpixels licensed under CC BY 4.0.
|
|
8
8
|
* Source: https://www.figma.com/community/file/923211396597067458
|
|
9
9
|
* License: https://creativecommons.org/licenses/by/4.0/
|
|
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
|
* Miniavs (@dicebear/miniavs)
|
|
3
3
|
*
|
|
4
4
|
* Code licensed under MIT License.
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) 2022 Florian Körner
|
|
6
6
|
*
|
|
7
7
|
* Design "Miniavs - Free Avatar Creator" by Webpixels licensed under CC BY 4.0.
|
|
8
8
|
* Source: https://www.figma.com/community/file/923211396597067458
|
|
9
9
|
* License: https://creativecommons.org/licenses/by/4.0/
|
|
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/miniavs",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.20",
|
|
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.20",
|
|
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": "6b1c2bd64294365be21d0a133a362ede5ed62b5a"
|
|
48
47
|
}
|
package/lib/meta/components.d.ts
DELETED
package/lib/meta/components.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export const dimensions = {
|
|
2
|
-
head: {
|
|
3
|
-
width: 64,
|
|
4
|
-
height: 64,
|
|
5
|
-
},
|
|
6
|
-
body: {
|
|
7
|
-
width: 64,
|
|
8
|
-
height: 64,
|
|
9
|
-
},
|
|
10
|
-
hair: {
|
|
11
|
-
width: 64,
|
|
12
|
-
height: 64,
|
|
13
|
-
},
|
|
14
|
-
mouth: {
|
|
15
|
-
width: 64,
|
|
16
|
-
height: 64,
|
|
17
|
-
},
|
|
18
|
-
eyes: {
|
|
19
|
-
width: 64,
|
|
20
|
-
height: 64,
|
|
21
|
-
},
|
|
22
|
-
glasses: {
|
|
23
|
-
width: 64,
|
|
24
|
-
height: 64,
|
|
25
|
-
},
|
|
26
|
-
mustache: {
|
|
27
|
-
width: 64,
|
|
28
|
-
height: 64,
|
|
29
|
-
},
|
|
30
|
-
blushes: {
|
|
31
|
-
width: 64,
|
|
32
|
-
height: 64,
|
|
33
|
-
},
|
|
34
|
-
};
|