@dicebear/big-ears 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2021 Florian Körner
3
+ Copyright (c) 2022 Florian Körner
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
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: 'Face Generator',
@@ -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, _q, _r, _s, _t, _u, _v, _w, _x;
20
- onPreCreate({ prng, options, preview: false });
19
+ onPreCreate({ prng, options });
21
20
  const components = getComponents({ prng, options });
22
21
  const colors = getColors({ prng, options });
23
- onPostCreate({ prng, options, components, colors, preview: false });
22
+ onPostCreate({ prng, options, components, colors });
24
23
  return {
25
24
  attributes: {
26
25
  viewBox: '0 0 440 440',
@@ -30,35 +29,4 @@ export const style = {
30
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>`,
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, preview, }: Props): void;
9
+ export declare function onPostCreate({ prng, options, components, colors }: Props): void;
11
10
  export {};
@@ -1,3 +1,3 @@
1
- export function onPostCreate({ prng, options, components, colors, preview, }) {
1
+ export function onPostCreate({ prng, options, components, colors }) {
2
2
  // Write your modifications here
3
3
  }
@@ -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, preview }: Props): void;
7
+ export declare function onPreCreate({ prng, options }: Props): void;
9
8
  export {};
@@ -1,3 +1,3 @@
1
- export function onPreCreate({ prng, options, preview }) {
1
+ export function onPreCreate({ prng, options }) {
2
2
  // Write your modifications here
3
3
  }
package/lib/index.d.ts CHANGED
@@ -2,12 +2,12 @@
2
2
  * Big Ears (@dicebear/big-ears)
3
3
  *
4
4
  * Code licensed under MIT License.
5
- * Copyright (c) 2021 Florian Körner
5
+ * Copyright (c) 2022 Florian Körner
6
6
  *
7
7
  * Design "Face Generator" by The Visual Team licensed under CC BY 4.0.
8
8
  * Source: https://www.figma.com/community/file/986078800058673824
9
9
  * License: https://creativecommons.org/licenses/by/4.0/
10
10
  */
11
- declare const create: import("@dicebear/core").StyleCreate<import("./types.js").Options>, preview: import("@dicebear/core").StylePreview<import("./types.js").Options> | undefined, meta: import("@dicebear/core").StyleMeta, schema: import("json-schema").JSONSchema7;
12
- export { create, preview, meta, schema };
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
  * Big Ears (@dicebear/big-ears)
3
3
  *
4
4
  * Code licensed under MIT License.
5
- * Copyright (c) 2021 Florian Körner
5
+ * Copyright (c) 2022 Florian Körner
6
6
  *
7
7
  * Design "Face Generator" by The Visual Team licensed under CC BY 4.0.
8
8
  * Source: https://www.figma.com/community/file/986078800058673824
9
9
  * License: https://creativecommons.org/licenses/by/4.0/
10
10
  */
11
11
  import { style } from './core.js';
12
- const { create, preview, meta, schema } = style;
13
- export { create, preview, meta, schema };
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/big-ears",
3
- "version": "5.0.0-alpha.15",
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.15",
32
- "@tsconfig/recommended": "^1.0.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.5.2",
36
- "uvu": "^0.5.2"
34
+ "typescript": "^4.6.3",
35
+ "uvu": "^0.5.3"
37
36
  },
38
37
  "peerDependencies": {
39
- "@dicebear/core": "^5.0.0-alpha.10"
38
+ "@dicebear/core": "^5.0.0-alpha.16"
40
39
  },
41
40
  "engines": {
42
- "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
41
+ "node": "^14.13.1 || >=16.0.0"
43
42
  },
44
43
  "publishConfig": {
45
44
  "access": "public"
46
45
  },
47
- "gitHead": "9905588d7bb8da0c3e7953f80845e732b9f43847"
46
+ "gitHead": "6b1c2bd64294365be21d0a133a362ede5ed62b5a"
48
47
  }
@@ -1,4 +0,0 @@
1
- export declare const dimensions: Record<string, {
2
- width: number;
3
- height: number;
4
- }>;
@@ -1,38 +0,0 @@
1
- export const dimensions = {
2
- hair: {
3
- width: 564.2955322265625,
4
- height: 641.4246826171875,
5
- },
6
- face: {
7
- width: 380,
8
- height: 398,
9
- },
10
- mouth: {
11
- width: 55.58613204956055,
12
- height: 55.58613204956055,
13
- },
14
- ear: {
15
- width: 130,
16
- height: 130,
17
- },
18
- eyes: {
19
- width: 289,
20
- height: 164,
21
- },
22
- cheek: {
23
- width: 256,
24
- height: 77,
25
- },
26
- nose: {
27
- width: 78,
28
- height: 78,
29
- },
30
- sideburn: {
31
- width: 63,
32
- height: 114,
33
- },
34
- frontHair: {
35
- width: 425,
36
- height: 198,
37
- },
38
- };