@dicebear/lorelei 5.0.0-alpha.32 → 5.0.0-alpha.33

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.
Files changed (44) hide show
  1. package/README.md +3 -3
  2. package/lib/components/beard.d.ts +6 -0
  3. package/lib/components/beard.js +8 -2
  4. package/lib/components/earrings.d.ts +6 -0
  5. package/lib/components/earrings.js +9 -3
  6. package/lib/components/eyebrows.d.ts +6 -0
  7. package/lib/components/eyebrows.js +19 -13
  8. package/lib/components/eyes.d.ts +6 -0
  9. package/lib/components/eyes.js +30 -24
  10. package/lib/components/freckles.d.ts +6 -0
  11. package/lib/components/freckles.js +7 -1
  12. package/lib/components/glasses.d.ts +6 -0
  13. package/lib/components/glasses.js +11 -5
  14. package/lib/components/hair.d.ts +6 -0
  15. package/lib/components/hair.js +54 -192
  16. package/lib/components/hairAccessories.d.ts +6 -0
  17. package/lib/components/hairAccessories.js +7 -1
  18. package/lib/components/head.d.ts +6 -0
  19. package/lib/components/head.js +10 -16
  20. package/lib/components/index.d.ts +6 -0
  21. package/lib/components/index.js +6 -0
  22. package/lib/components/mouth.d.ts +6 -0
  23. package/lib/components/mouth.js +33 -27
  24. package/lib/components/nose.d.ts +6 -0
  25. package/lib/components/nose.js +12 -6
  26. package/lib/core.d.ts +6 -0
  27. package/lib/core.js +7 -1
  28. package/lib/hooks/onPostCreate.d.ts +8 -2
  29. package/lib/hooks/onPostCreate.js +7 -1
  30. package/lib/hooks/onPreCreate.d.ts +8 -2
  31. package/lib/hooks/onPreCreate.js +6 -0
  32. package/lib/index.d.ts +6 -0
  33. package/lib/index.js +9 -2
  34. package/lib/schema.d.ts +6 -0
  35. package/lib/schema.js +475 -546
  36. package/lib/types.d.ts +6 -3
  37. package/lib/types.js +6 -0
  38. package/lib/utils/getColors.d.ts +6 -0
  39. package/lib/utils/getColors.js +17 -10
  40. package/lib/utils/getComponents.d.ts +7 -1
  41. package/lib/utils/getComponents.js +30 -31
  42. package/lib/utils/pickComponent.d.ts +7 -1
  43. package/lib/utils/pickComponent.js +11 -2
  44. package/package.json +4 -4
package/lib/types.d.ts CHANGED
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
3
+ *
4
+ * Plugin: https://www.figma.com/community/plugin/1005765655729342787
5
+ * File: https://www.figma.com/file/FCwwMBxsRND9Mbtpg5PUic/%40dicebear%2Florelei?node-id=23%3A2194
6
+ */
1
7
  export interface Options {
2
8
  hair?: ('variant48' | 'variant47' | 'variant46' | 'variant45' | 'variant44' | 'variant43' | 'variant42' | 'variant41' | 'variant40' | 'variant39' | 'variant38' | 'variant37' | 'variant36' | 'variant35' | 'variant34' | 'variant33' | 'variant32' | 'variant31' | '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')[];
3
9
  hairAccessories?: ('flowers')[];
@@ -26,9 +32,6 @@ export interface Options {
26
32
  noseColor?: string[];
27
33
  hairAccessoriesColor?: string[];
28
34
  }
29
- export declare type ColorGroup = Record<string, ColorGroupItem>;
30
- export declare type ColorGroupCollection = Record<string, ColorGroup>;
31
- export declare type ColorGroupItem = string;
32
35
  export declare type ColorPickCollection = Record<string, string>;
33
36
  export declare type ComponentGroup = Record<string, ComponentGroupItem>;
34
37
  export declare type ComponentGroupCollection = Record<string, ComponentGroup>;
package/lib/types.js CHANGED
@@ -1 +1,7 @@
1
+ /**
2
+ * Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
3
+ *
4
+ * Plugin: https://www.figma.com/community/plugin/1005765655729342787
5
+ * File: https://www.figma.com/file/FCwwMBxsRND9Mbtpg5PUic/%40dicebear%2Florelei?node-id=23%3A2194
6
+ */
1
7
  export {};
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
3
+ *
4
+ * Plugin: https://www.figma.com/community/plugin/1005765655729342787
5
+ * File: https://www.figma.com/file/FCwwMBxsRND9Mbtpg5PUic/%40dicebear%2Florelei?node-id=23%3A2194
6
+ */
1
7
  import type { Prng } from '@dicebear/core';
2
8
  import type { Options, ColorPickCollection } from '../types.js';
3
9
  declare type Props = {
@@ -1,15 +1,22 @@
1
+ /**
2
+ * Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
3
+ *
4
+ * Plugin: https://www.figma.com/community/plugin/1005765655729342787
5
+ * File: https://www.figma.com/file/FCwwMBxsRND9Mbtpg5PUic/%40dicebear%2Florelei?node-id=23%3A2194
6
+ */
1
7
  export function getColors({ prng, options }) {
2
8
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
3
9
  return {
4
- hair: (_b = prng.pick((_a = options.hairColor) !== null && _a !== void 0 ? _a : [])) !== null && _b !== void 0 ? _b : 'transparent',
5
- skin: (_d = prng.pick((_c = options.skinColor) !== null && _c !== void 0 ? _c : [])) !== null && _d !== void 0 ? _d : 'transparent',
6
- earrings: (_f = prng.pick((_e = options.earringsColor) !== null && _e !== void 0 ? _e : [])) !== null && _f !== void 0 ? _f : 'transparent',
7
- eyebrows: (_h = prng.pick((_g = options.eyebrowsColor) !== null && _g !== void 0 ? _g : [])) !== null && _h !== void 0 ? _h : 'transparent',
8
- eyes: (_k = prng.pick((_j = options.eyesColor) !== null && _j !== void 0 ? _j : [])) !== null && _k !== void 0 ? _k : 'transparent',
9
- freckles: (_m = prng.pick((_l = options.frecklesColor) !== null && _l !== void 0 ? _l : [])) !== null && _m !== void 0 ? _m : 'transparent',
10
- glasses: (_p = prng.pick((_o = options.glassesColor) !== null && _o !== void 0 ? _o : [])) !== null && _p !== void 0 ? _p : 'transparent',
11
- mouth: (_r = prng.pick((_q = options.mouthColor) !== null && _q !== void 0 ? _q : [])) !== null && _r !== void 0 ? _r : 'transparent',
12
- nose: (_t = prng.pick((_s = options.noseColor) !== null && _s !== void 0 ? _s : [])) !== null && _t !== void 0 ? _t : 'transparent',
13
- hairAccessories: (_v = prng.pick((_u = options.hairAccessoriesColor) !== null && _u !== void 0 ? _u : [])) !== null && _v !== void 0 ? _v : 'transparent',
10
+ 'hair': (_b = prng.pick((_a = options.hairColor) !== null && _a !== void 0 ? _a : [])) !== null && _b !== void 0 ? _b : 'transparent',
11
+ 'skin': (_d = prng.pick((_c = options.skinColor) !== null && _c !== void 0 ? _c : [])) !== null && _d !== void 0 ? _d : 'transparent',
12
+ 'earrings': (_f = prng.pick((_e = options.earringsColor) !== null && _e !== void 0 ? _e : [])) !== null && _f !== void 0 ? _f : 'transparent',
13
+ 'eyebrows': (_h = prng.pick((_g = options.eyebrowsColor) !== null && _g !== void 0 ? _g : [])) !== null && _h !== void 0 ? _h : 'transparent',
14
+ 'eyes': (_k = prng.pick((_j = options.eyesColor) !== null && _j !== void 0 ? _j : [])) !== null && _k !== void 0 ? _k : 'transparent',
15
+ 'freckles': (_m = prng.pick((_l = options.frecklesColor) !== null && _l !== void 0 ? _l : [])) !== null && _m !== void 0 ? _m : 'transparent',
16
+ 'glasses': (_p = prng.pick((_o = options.glassesColor) !== null && _o !== void 0 ? _o : [])) !== null && _p !== void 0 ? _p : 'transparent',
17
+ 'mouth': (_r = prng.pick((_q = options.mouthColor) !== null && _q !== void 0 ? _q : [])) !== null && _r !== void 0 ? _r : 'transparent',
18
+ 'nose': (_t = prng.pick((_s = options.noseColor) !== null && _s !== void 0 ? _s : [])) !== null && _t !== void 0 ? _t : 'transparent',
19
+ 'hairAccessories': (_v = prng.pick((_u = options.hairAccessoriesColor) !== null && _u !== void 0 ? _u : [])) !== null && _v !== void 0 ? _v : 'transparent',
14
20
  };
15
21
  }
22
+ ;
@@ -1,8 +1,14 @@
1
+ /**
2
+ * Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
3
+ *
4
+ * Plugin: https://www.figma.com/community/plugin/1005765655729342787
5
+ * File: https://www.figma.com/file/FCwwMBxsRND9Mbtpg5PUic/%40dicebear%2Florelei?node-id=23%3A2194
6
+ */
1
7
  import type { Prng } from '@dicebear/core';
2
8
  import type { Options, ComponentPickCollection } from '../types.js';
3
9
  declare type Props = {
4
10
  prng: Prng;
5
11
  options: Options;
6
12
  };
7
- export declare function getComponents({ prng, options, }: Props): ComponentPickCollection;
13
+ export declare function getComponents({ prng, options }: Props): ComponentPickCollection;
8
14
  export {};
@@ -1,79 +1,78 @@
1
+ /**
2
+ * Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
3
+ *
4
+ * Plugin: https://www.figma.com/community/plugin/1005765655729342787
5
+ * File: https://www.figma.com/file/FCwwMBxsRND9Mbtpg5PUic/%40dicebear%2Florelei?node-id=23%3A2194
6
+ */
1
7
  import { pickComponent } from './pickComponent.js';
2
- export function getComponents({ prng, options, }) {
8
+ export function getComponents({ prng, options }) {
3
9
  const hairComponent = pickComponent({
4
10
  prng,
5
11
  group: 'hair',
6
- values: options.hair,
12
+ values: options.hair
7
13
  });
8
14
  const hairAccessoriesComponent = pickComponent({
9
15
  prng,
10
16
  group: 'hairAccessories',
11
- values: options.hairAccessories,
17
+ values: options.hairAccessories
12
18
  });
13
19
  const headComponent = pickComponent({
14
20
  prng,
15
21
  group: 'head',
16
- values: options.head,
22
+ values: options.head
17
23
  });
18
24
  const eyesComponent = pickComponent({
19
25
  prng,
20
26
  group: 'eyes',
21
- values: options.eyes,
27
+ values: options.eyes
22
28
  });
23
29
  const eyebrowsComponent = pickComponent({
24
30
  prng,
25
31
  group: 'eyebrows',
26
- values: options.eyebrows,
32
+ values: options.eyebrows
27
33
  });
28
34
  const earringsComponent = pickComponent({
29
35
  prng,
30
36
  group: 'earrings',
31
- values: options.earrings,
37
+ values: options.earrings
32
38
  });
33
39
  const frecklesComponent = pickComponent({
34
40
  prng,
35
41
  group: 'freckles',
36
- values: options.freckles,
42
+ values: options.freckles
37
43
  });
38
44
  const noseComponent = pickComponent({
39
45
  prng,
40
46
  group: 'nose',
41
- values: options.nose,
47
+ values: options.nose
42
48
  });
43
49
  const beardComponent = pickComponent({
44
50
  prng,
45
51
  group: 'beard',
46
- values: options.beard,
52
+ values: options.beard
47
53
  });
48
54
  const mouthComponent = pickComponent({
49
55
  prng,
50
56
  group: 'mouth',
51
- values: options.mouth,
57
+ values: options.mouth
52
58
  });
53
59
  const glassesComponent = pickComponent({
54
60
  prng,
55
61
  group: 'glasses',
56
- values: options.glasses,
62
+ values: options.glasses
57
63
  });
58
64
  return {
59
- hair: hairComponent,
60
- hairAccessories: prng.bool(options.hairAccessoriesProbability)
61
- ? hairAccessoriesComponent
62
- : undefined,
63
- head: headComponent,
64
- eyes: eyesComponent,
65
- eyebrows: eyebrowsComponent,
66
- earrings: prng.bool(options.earringsProbability)
67
- ? earringsComponent
68
- : undefined,
69
- freckles: prng.bool(options.frecklesProbability)
70
- ? frecklesComponent
71
- : undefined,
72
- nose: noseComponent,
73
- beard: prng.bool(options.beardProbability) ? beardComponent : undefined,
74
- mouth: mouthComponent,
75
- glasses: prng.bool(options.glassesProbability)
76
- ? glassesComponent
77
- : undefined,
65
+ 'hair': hairComponent,
66
+ 'hairAccessories': prng.bool(options.hairAccessoriesProbability) ? hairAccessoriesComponent : undefined,
67
+ 'head': headComponent,
68
+ 'eyes': eyesComponent,
69
+ 'eyebrows': eyebrowsComponent,
70
+ 'earrings': prng.bool(options.earringsProbability) ? earringsComponent : undefined,
71
+ 'freckles': prng.bool(options.frecklesProbability) ? frecklesComponent : undefined,
72
+ 'nose': noseComponent,
73
+ 'beard': prng.bool(options.beardProbability) ? beardComponent : undefined,
74
+ 'mouth': mouthComponent,
75
+ 'glasses': prng.bool(options.glassesProbability) ? glassesComponent : undefined,
78
76
  };
79
77
  }
78
+ ;
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
3
+ *
4
+ * Plugin: https://www.figma.com/community/plugin/1005765655729342787
5
+ * File: https://www.figma.com/file/FCwwMBxsRND9Mbtpg5PUic/%40dicebear%2Florelei?node-id=23%3A2194
6
+ */
1
7
  import type { Prng } from '@dicebear/core';
2
8
  import type { ComponentPick } from '../types.js';
3
9
  declare type Props = {
@@ -5,5 +11,5 @@ declare type Props = {
5
11
  group: string;
6
12
  values?: string[];
7
13
  };
8
- export declare function pickComponent({ prng, group, values, }: Props): ComponentPick;
14
+ export declare function pickComponent({ prng, group, values }: Props): ComponentPick;
9
15
  export {};
@@ -1,9 +1,18 @@
1
+ /**
2
+ * Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
3
+ *
4
+ * Plugin: https://www.figma.com/community/plugin/1005765655729342787
5
+ * File: https://www.figma.com/file/FCwwMBxsRND9Mbtpg5PUic/%40dicebear%2Florelei?node-id=23%3A2194
6
+ */
1
7
  import * as components from '../components/index.js';
2
- export function pickComponent({ prng, group, values = [], }) {
8
+ export function pickComponent({ prng, group, values = [] }) {
3
9
  const componentCollection = components;
4
10
  const key = prng.pick(values);
5
11
  if (key && componentCollection[group][key]) {
6
- return { name: key, value: componentCollection[group][key] };
12
+ return {
13
+ name: key,
14
+ value: componentCollection[group][key],
15
+ };
7
16
  }
8
17
  else {
9
18
  return undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dicebear/lorelei",
3
- "version": "5.0.0-alpha.32",
3
+ "version": "5.0.0-alpha.33",
4
4
  "description": "Avatar style for DiceBear",
5
5
  "keywords": [
6
6
  "dicebear"
@@ -28,14 +28,14 @@
28
28
  "test": "uvu tests"
29
29
  },
30
30
  "devDependencies": {
31
- "@dicebear/core": "^5.0.0-alpha.32",
31
+ "@dicebear/core": "^5.0.0-alpha.33",
32
32
  "@tsconfig/recommended": "^1.0.1",
33
33
  "del-cli": "^4.0.1",
34
34
  "typescript": "^4.6.3",
35
35
  "uvu": "^0.5.3"
36
36
  },
37
37
  "peerDependencies": {
38
- "@dicebear/core": "^5.0.0-alpha.16"
38
+ "@dicebear/core": "^5.0.0-alpha.32"
39
39
  },
40
40
  "engines": {
41
41
  "node": "^14.13.1 || >=16.0.0"
@@ -43,5 +43,5 @@
43
43
  "publishConfig": {
44
44
  "access": "public"
45
45
  },
46
- "gitHead": "5a4a06cbb8aca42a5d19da8e704b3a7b3a45d755"
46
+ "gitHead": "88548ee882858c8871c477d83c3ed0bd227c64b0"
47
47
  }