@dicebear/micah 5.0.0-alpha.2 → 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/colors/base.d.ts +2 -0
- package/lib/colors/base.js +15 -0
- package/lib/colors/earring.d.ts +2 -0
- package/lib/colors/earring.js +15 -0
- package/lib/colors/eyeShadow.d.ts +2 -0
- package/lib/colors/eyeShadow.js +15 -0
- package/lib/colors/eyebrows.d.ts +2 -0
- package/lib/colors/eyebrows.js +15 -0
- package/lib/colors/eyes.d.ts +2 -0
- package/lib/colors/eyes.js +15 -0
- package/lib/colors/facialHair.d.ts +2 -0
- package/lib/colors/facialHair.js +15 -0
- package/lib/colors/glasses.d.ts +2 -0
- package/lib/colors/glasses.js +15 -0
- package/lib/colors/hair.d.ts +2 -0
- package/lib/colors/hair.js +15 -0
- package/lib/colors/index.d.ts +10 -0
- package/lib/colors/index.js +10 -0
- package/lib/colors/mouth.d.ts +2 -0
- package/lib/colors/mouth.js +3 -0
- package/lib/colors/shirt.d.ts +2 -0
- package/lib/colors/shirt.js +15 -0
- package/lib/components/base.d.ts +2 -0
- package/lib/components/base.js +6 -0
- package/lib/components/earrings.d.ts +2 -0
- package/lib/components/earrings.js +4 -0
- package/lib/components/ears.d.ts +2 -0
- package/lib/components/ears.js +10 -0
- package/lib/components/eyebrows.d.ts +2 -0
- package/lib/components/eyebrows.js +6 -0
- package/lib/components/eyes.d.ts +2 -0
- package/lib/components/eyes.js +18 -0
- package/lib/components/facialHair.d.ts +2 -0
- package/lib/components/facialHair.js +4 -0
- package/lib/components/glasses.d.ts +2 -0
- package/lib/components/glasses.js +4 -0
- package/lib/components/hair.d.ts +2 -0
- package/lib/components/hair.js +10 -0
- package/lib/components/index.d.ts +11 -0
- package/lib/components/index.js +11 -0
- package/lib/components/mouth.d.ts +2 -0
- package/lib/components/mouth.js +10 -0
- package/lib/components/nose.d.ts +2 -0
- package/lib/components/nose.js +5 -0
- package/lib/components/shirt.d.ts +2 -0
- package/lib/components/shirt.js +5 -0
- package/{dist → lib}/core.d.ts +3 -3
- package/lib/core.js +32 -0
- package/{dist → lib}/hooks/onPostCreate.d.ts +10 -12
- package/lib/hooks/onPostCreate.js +6 -0
- package/lib/hooks/onPreCreate.d.ts +8 -0
- package/lib/hooks/onPreCreate.js +26 -0
- package/lib/index.d.ts +13 -0
- package/lib/index.js +13 -0
- package/lib/schema.d.ts +2 -0
- package/lib/schema.js +449 -0
- package/lib/types.d.ts +43 -0
- package/lib/types.js +1 -0
- package/{dist → lib}/utils/getColors.d.ts +8 -9
- package/lib/utils/getColors.js +55 -0
- package/{dist → lib}/utils/getComponents.d.ts +8 -9
- package/lib/utils/getComponents.js +77 -0
- package/{dist → lib}/utils/pickColor.d.ts +9 -9
- package/lib/utils/pickColor.js +13 -0
- package/{dist → lib}/utils/pickComponent.d.ts +9 -9
- package/lib/utils/pickComponent.js +14 -0
- package/package.json +19 -23
- package/dist/colors/base.d.ts +0 -2
- package/dist/colors/earring.d.ts +0 -2
- package/dist/colors/eyeShadow.d.ts +0 -2
- package/dist/colors/eyebrow.d.ts +0 -2
- package/dist/colors/eyes.d.ts +0 -2
- package/dist/colors/facialHair.d.ts +0 -2
- package/dist/colors/glasses.d.ts +0 -2
- package/dist/colors/hair.d.ts +0 -2
- package/dist/colors/index.d.ts +0 -10
- package/dist/colors/mouth.d.ts +0 -2
- package/dist/colors/shirt.d.ts +0 -2
- package/dist/components/base.d.ts +0 -2
- package/dist/components/earrings.d.ts +0 -2
- package/dist/components/ears.d.ts +0 -2
- package/dist/components/eyebrows.d.ts +0 -2
- package/dist/components/eyes.d.ts +0 -2
- package/dist/components/facialHair.d.ts +0 -2
- package/dist/components/glasses.d.ts +0 -2
- package/dist/components/hair.d.ts +0 -2
- package/dist/components/index.d.ts +0 -11
- package/dist/components/mouth.d.ts +0 -2
- package/dist/components/nose.d.ts +0 -2
- package/dist/components/shirt.d.ts +0 -2
- package/dist/hooks/onPreCreate.d.ts +0 -9
- package/dist/index.d.ts +0 -13
- package/dist/index.es.js +0 -1247
- package/dist/index.js +0 -1254
- package/dist/index.umd.js +0 -12
- package/dist/meta/components.d.ts +0 -4
- package/dist/options.d.ts +0 -32
- package/dist/static-types.d.ts +0 -16
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as colors from '../colors/index.js';
|
|
2
|
+
export function pickColor({ prng, group, values = [] }) {
|
|
3
|
+
var _a;
|
|
4
|
+
const colorCollection = colors;
|
|
5
|
+
if (values.length === 0) {
|
|
6
|
+
values.push('transparent');
|
|
7
|
+
}
|
|
8
|
+
const key = prng.pick(values);
|
|
9
|
+
return {
|
|
10
|
+
name: key,
|
|
11
|
+
value: (_a = colorCollection[group][key]) !== null && _a !== void 0 ? _a : key,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { Prng } from '@dicebear/core';
|
|
2
|
-
import type { ComponentPick } from '../
|
|
3
|
-
declare type Props = {
|
|
4
|
-
prng: Prng;
|
|
5
|
-
group: string;
|
|
6
|
-
values?: string[];
|
|
7
|
-
};
|
|
8
|
-
export declare function pickComponent({ prng, group, values, }: Props): ComponentPick;
|
|
9
|
-
export {};
|
|
1
|
+
import type { Prng } from '@dicebear/core';
|
|
2
|
+
import type { ComponentPick } from '../types.js';
|
|
3
|
+
declare type Props = {
|
|
4
|
+
prng: Prng;
|
|
5
|
+
group: string;
|
|
6
|
+
values?: string[];
|
|
7
|
+
};
|
|
8
|
+
export declare function pickComponent({ prng, group, values, }: Props): ComponentPick;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as components from '../components/index.js';
|
|
2
|
+
export function pickComponent({ prng, group, values = [], }) {
|
|
3
|
+
const componentCollection = components;
|
|
4
|
+
const key = prng.pick(values);
|
|
5
|
+
if (componentCollection[group][key]) {
|
|
6
|
+
return {
|
|
7
|
+
name: key,
|
|
8
|
+
value: componentCollection[group][key],
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dicebear/micah",
|
|
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"
|
|
@@ -13,39 +13,35 @@
|
|
|
13
13
|
"url": "git+https://github.com/dicebear/dicebear.git"
|
|
14
14
|
},
|
|
15
15
|
"license": "MIT",
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"browser": "dist/index.umd.js",
|
|
20
|
-
"types": "dist/index.d.ts",
|
|
16
|
+
"type": "module",
|
|
17
|
+
"exports": "./lib/index.js",
|
|
18
|
+
"types": "./lib/index.d.ts",
|
|
21
19
|
"files": [
|
|
22
20
|
"LICENSE",
|
|
23
|
-
"
|
|
24
|
-
"
|
|
21
|
+
"lib",
|
|
22
|
+
"README.md"
|
|
25
23
|
],
|
|
26
24
|
"scripts": {
|
|
27
|
-
"
|
|
25
|
+
"prebuild": "del-cli lib",
|
|
26
|
+
"build": "tsc",
|
|
28
27
|
"prepublishOnly": "npm run build",
|
|
29
|
-
"
|
|
30
|
-
"build": "dicebear-project build DiceBear.Micah"
|
|
28
|
+
"test": "uvu tests"
|
|
31
29
|
},
|
|
32
30
|
"devDependencies": {
|
|
33
|
-
"@dicebear/core": "^5.0.0-alpha.
|
|
34
|
-
"@tsconfig/recommended": "^1.0.
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"jest": "^26.6.3",
|
|
39
|
-
"shx": "^0.3.3",
|
|
40
|
-
"ts-jest": "^26.5.4",
|
|
41
|
-
"typescript": "^4.2.3",
|
|
42
|
-
"utility-types": "^3.10.0"
|
|
31
|
+
"@dicebear/core": "^5.0.0-alpha.20",
|
|
32
|
+
"@tsconfig/recommended": "^1.0.1",
|
|
33
|
+
"del-cli": "^4.0.1",
|
|
34
|
+
"typescript": "^4.6.3",
|
|
35
|
+
"uvu": "^0.5.3"
|
|
43
36
|
},
|
|
44
37
|
"peerDependencies": {
|
|
45
|
-
"@dicebear/core": "^5.0.0-alpha.
|
|
38
|
+
"@dicebear/core": "^5.0.0-alpha.16"
|
|
39
|
+
},
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": "^14.13.1 || >=16.0.0"
|
|
46
42
|
},
|
|
47
43
|
"publishConfig": {
|
|
48
44
|
"access": "public"
|
|
49
45
|
},
|
|
50
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "6b1c2bd64294365be21d0a133a362ede5ed62b5a"
|
|
51
47
|
}
|
package/dist/colors/base.d.ts
DELETED
package/dist/colors/earring.d.ts
DELETED
package/dist/colors/eyebrow.d.ts
DELETED
package/dist/colors/eyes.d.ts
DELETED
package/dist/colors/glasses.d.ts
DELETED
package/dist/colors/hair.d.ts
DELETED
package/dist/colors/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { base } from './base';
|
|
2
|
-
export { earring } from './earring';
|
|
3
|
-
export { eyeShadow } from './eyeShadow';
|
|
4
|
-
export { eyebrow } from './eyebrow';
|
|
5
|
-
export { facialHair } from './facialHair';
|
|
6
|
-
export { glasses } from './glasses';
|
|
7
|
-
export { hair } from './hair';
|
|
8
|
-
export { mouth } from './mouth';
|
|
9
|
-
export { shirt } from './shirt';
|
|
10
|
-
export { eyes } from './eyes';
|
package/dist/colors/mouth.d.ts
DELETED
package/dist/colors/shirt.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export { base } from './base';
|
|
2
|
-
export { mouth } from './mouth';
|
|
3
|
-
export { eyebrows } from './eyebrows';
|
|
4
|
-
export { hair } from './hair';
|
|
5
|
-
export { eyes } from './eyes';
|
|
6
|
-
export { nose } from './nose';
|
|
7
|
-
export { ears } from './ears';
|
|
8
|
-
export { shirt } from './shirt';
|
|
9
|
-
export { earrings } from './earrings';
|
|
10
|
-
export { glasses } from './glasses';
|
|
11
|
-
export { facialHair } from './facialHair';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Prng, StyleOptions } from '@dicebear/core';
|
|
2
|
-
import { Options } from '../options';
|
|
3
|
-
declare type Props = {
|
|
4
|
-
prng: Prng;
|
|
5
|
-
options: StyleOptions<Options>;
|
|
6
|
-
preview: boolean;
|
|
7
|
-
};
|
|
8
|
-
export declare function onPreCreate({ prng, options, preview }: Props): void;
|
|
9
|
-
export {};
|
package/dist/index.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Micah (@dicebear/micah)
|
|
3
|
-
*
|
|
4
|
-
* Code licensed under MIT License.
|
|
5
|
-
* Copyright (c) 2021 Florian Körner
|
|
6
|
-
*
|
|
7
|
-
* Design "Avatar Illustration System" by Micah Lanier licensed under CC BY 4.0.
|
|
8
|
-
* Source: https://www.figma.com/community/file/829741575478342595
|
|
9
|
-
* License: https://creativecommons.org/licenses/by/4.0/
|
|
10
|
-
*/
|
|
11
|
-
declare let create: import("@dicebear/core").StyleCreate<import("./options").Options>, preview: import("@dicebear/core").StylePreview<import("./options").Options> | undefined, meta: import("@dicebear/core").StyleMeta, schema: import("json-schema").JSONSchema7;
|
|
12
|
-
export { create, preview, meta, schema };
|
|
13
|
-
export { Options } from './options';
|