@dicebear/identicon
Advanced tools
Comparing version 5.0.0-alpha.16 to 5.0.0-alpha.20
@@ -6,3 +6,2 @@ import { schema } from './schema.js'; | ||
import { onPostCreate } from './hooks/onPostCreate.js'; | ||
import { dimensions } from './meta/components.js'; | ||
export const style = { | ||
@@ -20,6 +19,6 @@ meta: { | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k; | ||
onPreCreate({ prng, options, preview: false }); | ||
onPreCreate({ prng, options }); | ||
const components = getComponents({ prng, options }); | ||
const colors = getColors({ prng, options }); | ||
onPostCreate({ prng, options, components, colors, preview: false }); | ||
onPostCreate({ prng, options, components, colors }); | ||
return { | ||
@@ -34,33 +33,2 @@ attributes: { | ||
}, | ||
preview: ({ prng, options, property }) => { | ||
var _a, _b; | ||
const componentGroup = property.toString(); | ||
const colorGroup = property.toString().replace(/Color$/, ''); | ||
onPreCreate({ prng, options, preview: true }); | ||
const components = getComponents({ prng, options }); | ||
const colors = getColors({ prng, options }); | ||
onPostCreate({ prng, options, components, colors, preview: true }); | ||
if (componentGroup in components) { | ||
const { width, height } = dimensions[componentGroup]; | ||
return { | ||
attributes: { | ||
viewBox: `0 0 ${width} ${height}`, | ||
fill: 'none', | ||
'shape-rendering': 'crispEdges', | ||
}, | ||
body: (_b = (_a = components[componentGroup]) === null || _a === void 0 ? void 0 : _a.value(components, colors)) !== null && _b !== void 0 ? _b : '', | ||
}; | ||
} | ||
if (colorGroup in colors) { | ||
return { | ||
attributes: { | ||
viewBox: `0 0 1 1`, | ||
fill: 'none', | ||
'shape-rendering': 'crispEdges', | ||
}, | ||
body: `<rect width="1" height="1" fill="${colors[colorGroup].value}" />`, | ||
}; | ||
} | ||
return undefined; | ||
}, | ||
}; |
@@ -8,5 +8,4 @@ import { Prng, StyleOptions } from '@dicebear/core'; | ||
colors: ColorPickCollection; | ||
preview: boolean; | ||
}; | ||
export declare function onPostCreate({ prng, options, components, colors, preview, }: Props): void; | ||
export declare function onPostCreate({ prng, options, components, colors }: Props): void; | ||
export {}; |
@@ -1,3 +0,3 @@ | ||
export function onPostCreate({ prng, options, components, colors, preview, }) { | ||
export function onPostCreate({ prng, options, components, colors }) { | ||
// Write your modifications here | ||
} |
@@ -6,5 +6,4 @@ import { Prng, StyleOptions } from '@dicebear/core'; | ||
options: StyleOptions<Options>; | ||
preview: boolean; | ||
}; | ||
export declare function onPreCreate({ prng, options, preview }: Props): void; | ||
export declare function onPreCreate({ prng, options }: Props): void; | ||
export {}; |
@@ -1,3 +0,3 @@ | ||
export function onPreCreate({ prng, options, preview }) { | ||
export function onPreCreate({ prng, options }) { | ||
// Write your modifications here | ||
} |
@@ -5,3 +5,3 @@ /*! | ||
* Code licensed under MIT License. | ||
* Copyright (c) 2021 Florian Körner | ||
* Copyright (c) 2022 Florian Körner | ||
* | ||
@@ -11,4 +11,4 @@ * Design "Identicon" by Florian Körner licensed under CC0 1.0. | ||
*/ | ||
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; | ||
export { create, preview, meta, schema }; | ||
declare const create: import("@dicebear/core").StyleCreate<import("./types.js").Options>, meta: import("@dicebear/core").StyleMeta, schema: import("json-schema").JSONSchema7; | ||
export { create, meta, schema }; | ||
export type { Options } from './types.js'; |
@@ -5,3 +5,3 @@ /*! | ||
* Code licensed under MIT License. | ||
* Copyright (c) 2021 Florian Körner | ||
* Copyright (c) 2022 Florian Körner | ||
* | ||
@@ -12,3 +12,3 @@ * Design "Identicon" by Florian Körner licensed under CC0 1.0. | ||
import { style } from './core.js'; | ||
const { create, preview, meta, schema } = style; | ||
export { create, preview, meta, schema }; | ||
const { create, meta, schema } = style; | ||
export { create, meta, schema }; |
{ | ||
"name": "@dicebear/identicon", | ||
"version": "5.0.0-alpha.16", | ||
"version": "5.0.0-alpha.20", | ||
"description": "Avatar style for DiceBear", | ||
@@ -31,14 +31,13 @@ "keywords": [ | ||
"devDependencies": { | ||
"@dicebear/core": "^5.0.0-alpha.16", | ||
"@tsconfig/recommended": "^1.0.0", | ||
"@types/jest": "^26.0.22", | ||
"@dicebear/core": "^5.0.0-alpha.20", | ||
"@tsconfig/recommended": "^1.0.1", | ||
"del-cli": "^4.0.1", | ||
"typescript": "^4.5.2", | ||
"uvu": "^0.5.2" | ||
"typescript": "^4.6.3", | ||
"uvu": "^0.5.3" | ||
}, | ||
"peerDependencies": { | ||
"@dicebear/core": "^5.0.0-alpha.10" | ||
"@dicebear/core": "^5.0.0-alpha.16" | ||
}, | ||
"engines": { | ||
"node": "^12.20.0 || ^14.13.1 || >=16.0.0" | ||
"node": "^14.13.1 || >=16.0.0" | ||
}, | ||
@@ -48,3 +47,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "149a4a22c3a4d48dd5552bd22a49db0f853e0b5e" | ||
"gitHead": "6b1c2bd64294365be21d0a133a362ede5ed62b5a" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5
19935
39
448