@dicebear/identicon 5.0.0-alpha.8 → 5.0.0-beta.0
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/README.md +3 -3
- package/lib/components/index.d.ts +11 -0
- package/lib/components/index.js +11 -0
- package/lib/components/row1.d.ts +8 -0
- package/lib/components/row1.js +16 -0
- package/lib/components/row2.d.ts +8 -0
- package/lib/components/row2.js +16 -0
- package/lib/components/row3.d.ts +8 -0
- package/lib/components/row3.js +16 -0
- package/lib/components/row4.d.ts +8 -0
- package/lib/components/row4.js +16 -0
- package/lib/components/row5.d.ts +8 -0
- package/lib/components/row5.js +16 -0
- package/lib/core.d.ts +9 -0
- package/lib/core.js +37 -0
- package/lib/hooks/onPostCreate.d.ts +16 -0
- package/lib/hooks/onPostCreate.js +9 -0
- package/lib/hooks/onPreCreate.d.ts +14 -0
- package/lib/hooks/onPreCreate.js +9 -0
- package/lib/index.d.ts +9 -0
- package/lib/index.js +18 -0
- package/lib/schema.d.ts +8 -0
- package/lib/schema.js +159 -0
- package/lib/types.d.ts +23 -0
- package/lib/types.js +7 -0
- package/lib/utils/getColors.d.ts +14 -0
- package/lib/utils/getColors.js +13 -0
- package/lib/utils/getComponents.d.ts +14 -0
- package/lib/utils/getComponents.js +42 -0
- package/lib/utils/pickComponent.d.ts +15 -0
- package/lib/utils/pickComponent.js +20 -0
- package/package.json +19 -28
- package/dist/index.d.ts +0 -16
- package/dist/index.d.ts.map +0 -1
- package/dist/index.es.js +0 -332
- package/dist/index.es.js.map +0 -1
- package/dist/index.js +0 -336
- package/dist/index.js.map +0 -1
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<h1 align="center"><img src="./tests/svg/0.svg" width="124" /> <br />Identicon</h1>
|
|
2
2
|
<p align="center">
|
|
3
3
|
<strong>Avatar Style for <a href="https://dicebear.com/">DiceBear</a></strong><br />
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
Identicon
|
|
5
|
+
by Florian Körner
|
|
6
6
|
</p>
|
|
7
7
|
|
|
8
8
|
<p align="center">
|
|
9
9
|
While our code is MIT licensed, the design is licensed under
|
|
10
|
-
|
|
10
|
+
<a href="https://creativecommons.org/publicdomain/zero/1.0/">CC0 1.0</a>.
|
|
11
11
|
See <a href="https://dicebear.com/licenses">license overview</a> for more information.
|
|
12
12
|
</p>
|
|
13
13
|
|
|
@@ -0,0 +1,11 @@
|
|
|
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/np7zgQo9412LDvi1mA1UmK/%40dicebear%2Fidenticon?node-id=1%3A34
|
|
6
|
+
*/
|
|
7
|
+
export { row1 } from './row1.js';
|
|
8
|
+
export { row2 } from './row2.js';
|
|
9
|
+
export { row3 } from './row3.js';
|
|
10
|
+
export { row4 } from './row4.js';
|
|
11
|
+
export { row5 } from './row5.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
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/np7zgQo9412LDvi1mA1UmK/%40dicebear%2Fidenticon?node-id=1%3A34
|
|
6
|
+
*/
|
|
7
|
+
export { row1 } from './row1.js';
|
|
8
|
+
export { row2 } from './row2.js';
|
|
9
|
+
export { row3 } from './row3.js';
|
|
10
|
+
export { row4 } from './row4.js';
|
|
11
|
+
export { row5 } from './row5.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
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/np7zgQo9412LDvi1mA1UmK/%40dicebear%2Fidenticon?node-id=1%3A34
|
|
6
|
+
*/
|
|
7
|
+
import type { ComponentGroup } from '../types.js';
|
|
8
|
+
export declare const row1: ComponentGroup;
|
|
@@ -0,0 +1,16 @@
|
|
|
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/np7zgQo9412LDvi1mA1UmK/%40dicebear%2Fidenticon?node-id=1%3A34
|
|
6
|
+
*/
|
|
7
|
+
import { escape } from '@dicebear/core';
|
|
8
|
+
export const row1 = {
|
|
9
|
+
'xooox': (components, colors) => `<path d="M1 0H0v1h1V0ZM5 0H4v1h1V0Z" fill="${escape.xml(`#${colors.row}`)}"/>`,
|
|
10
|
+
'xxoxx': (components, colors) => `<path d="M2 0H0v1h2V0ZM5 0H3v1h2V0Z" fill="${escape.xml(`#${colors.row}`)}"/>`,
|
|
11
|
+
'xoxox': (components, colors) => `<path d="M0 0h1v1H0V0ZM4 0h1v1H4V0ZM3 0H2v1h1V0Z" fill="${escape.xml(`#${colors.row}`)}"/>`,
|
|
12
|
+
'oxxxo': (components, colors) => `<path fill="${escape.xml(`#${colors.row}`)}" d="M1 0h3v1H1z"/>`,
|
|
13
|
+
'xxxxx': (components, colors) => `<path fill="${escape.xml(`#${colors.row}`)}" d="M0 0h5v1H0z"/>`,
|
|
14
|
+
'oxoxo': (components, colors) => `<path d="M2 0H1v1h1V0ZM4 0H3v1h1V0Z" fill="${escape.xml(`#${colors.row}`)}"/>`,
|
|
15
|
+
'ooxoo': (components, colors) => `<path fill="${escape.xml(`#${colors.row}`)}" d="M2 0h1v1H2z"/>`,
|
|
16
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
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/np7zgQo9412LDvi1mA1UmK/%40dicebear%2Fidenticon?node-id=1%3A34
|
|
6
|
+
*/
|
|
7
|
+
import type { ComponentGroup } from '../types.js';
|
|
8
|
+
export declare const row2: ComponentGroup;
|
|
@@ -0,0 +1,16 @@
|
|
|
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/np7zgQo9412LDvi1mA1UmK/%40dicebear%2Fidenticon?node-id=1%3A34
|
|
6
|
+
*/
|
|
7
|
+
import { escape } from '@dicebear/core';
|
|
8
|
+
export const row2 = {
|
|
9
|
+
'xooox': (components, colors) => `<path d="M1 1H0v1h1V1ZM5 1H4v1h1V1Z" fill="${escape.xml(`#${colors.row}`)}"/>`,
|
|
10
|
+
'xxoxx': (components, colors) => `<path d="M2 1H0v1h2V1ZM5 1H3v1h2V1Z" fill="${escape.xml(`#${colors.row}`)}"/>`,
|
|
11
|
+
'xoxox': (components, colors) => `<path d="M0 1h1v1H0V1ZM4 1h1v1H4V1ZM3 1H2v1h1V1Z" fill="${escape.xml(`#${colors.row}`)}"/>`,
|
|
12
|
+
'oxxxo': (components, colors) => `<path fill="${escape.xml(`#${colors.row}`)}" d="M1 1h3v1H1z"/>`,
|
|
13
|
+
'xxxxx': (components, colors) => `<path fill="${escape.xml(`#${colors.row}`)}" d="M0 1h5v1H0z"/>`,
|
|
14
|
+
'oxoxo': (components, colors) => `<path d="M2 1H1v1h1V1ZM4 1H3v1h1V1Z" fill="${escape.xml(`#${colors.row}`)}"/>`,
|
|
15
|
+
'ooxoo': (components, colors) => `<path fill="${escape.xml(`#${colors.row}`)}" d="M2 1h1v1H2z"/>`,
|
|
16
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
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/np7zgQo9412LDvi1mA1UmK/%40dicebear%2Fidenticon?node-id=1%3A34
|
|
6
|
+
*/
|
|
7
|
+
import type { ComponentGroup } from '../types.js';
|
|
8
|
+
export declare const row3: ComponentGroup;
|
|
@@ -0,0 +1,16 @@
|
|
|
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/np7zgQo9412LDvi1mA1UmK/%40dicebear%2Fidenticon?node-id=1%3A34
|
|
6
|
+
*/
|
|
7
|
+
import { escape } from '@dicebear/core';
|
|
8
|
+
export const row3 = {
|
|
9
|
+
'xooox': (components, colors) => `<path d="M1 2H0v1h1V2ZM5 2H4v1h1V2Z" fill="${escape.xml(`#${colors.row}`)}"/>`,
|
|
10
|
+
'xxoxx': (components, colors) => `<path d="M2 2H0v1h2V2ZM5 2H3v1h2V2Z" fill="${escape.xml(`#${colors.row}`)}"/>`,
|
|
11
|
+
'xoxox': (components, colors) => `<path d="M0 2h1v1H0V2ZM4 2h1v1H4V2ZM3 2H2v1h1V2Z" fill="${escape.xml(`#${colors.row}`)}"/>`,
|
|
12
|
+
'oxxxo': (components, colors) => `<path fill="${escape.xml(`#${colors.row}`)}" d="M1 2h3v1H1z"/>`,
|
|
13
|
+
'xxxxx': (components, colors) => `<path fill="${escape.xml(`#${colors.row}`)}" d="M0 2h5v1H0z"/>`,
|
|
14
|
+
'oxoxo': (components, colors) => `<path d="M2 2H1v1h1V2ZM4 2H3v1h1V2Z" fill="${escape.xml(`#${colors.row}`)}"/>`,
|
|
15
|
+
'ooxoo': (components, colors) => `<path fill="${escape.xml(`#${colors.row}`)}" d="M2 2h1v1H2z"/>`,
|
|
16
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
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/np7zgQo9412LDvi1mA1UmK/%40dicebear%2Fidenticon?node-id=1%3A34
|
|
6
|
+
*/
|
|
7
|
+
import type { ComponentGroup } from '../types.js';
|
|
8
|
+
export declare const row4: ComponentGroup;
|
|
@@ -0,0 +1,16 @@
|
|
|
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/np7zgQo9412LDvi1mA1UmK/%40dicebear%2Fidenticon?node-id=1%3A34
|
|
6
|
+
*/
|
|
7
|
+
import { escape } from '@dicebear/core';
|
|
8
|
+
export const row4 = {
|
|
9
|
+
'xooox': (components, colors) => `<path d="M1 3H0v1h1V3ZM5 3H4v1h1V3Z" fill="${escape.xml(`#${colors.row}`)}"/>`,
|
|
10
|
+
'xxoxx': (components, colors) => `<path d="M2 3H0v1h2V3ZM5 3H3v1h2V3Z" fill="${escape.xml(`#${colors.row}`)}"/>`,
|
|
11
|
+
'xoxox': (components, colors) => `<path d="M0 3h1v1H0V3ZM4 3h1v1H4V3ZM3 3H2v1h1V3Z" fill="${escape.xml(`#${colors.row}`)}"/>`,
|
|
12
|
+
'oxxxo': (components, colors) => `<path fill="${escape.xml(`#${colors.row}`)}" d="M1 3h3v1H1z"/>`,
|
|
13
|
+
'xxxxx': (components, colors) => `<path fill="${escape.xml(`#${colors.row}`)}" d="M0 3h5v1H0z"/>`,
|
|
14
|
+
'oxoxo': (components, colors) => `<path d="M2 3H1v1h1V3ZM4 3H3v1h1V3Z" fill="${escape.xml(`#${colors.row}`)}"/>`,
|
|
15
|
+
'ooxoo': (components, colors) => `<path fill="${escape.xml(`#${colors.row}`)}" d="M2 3h1v1H2z"/>`,
|
|
16
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
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/np7zgQo9412LDvi1mA1UmK/%40dicebear%2Fidenticon?node-id=1%3A34
|
|
6
|
+
*/
|
|
7
|
+
import type { ComponentGroup } from '../types.js';
|
|
8
|
+
export declare const row5: ComponentGroup;
|
|
@@ -0,0 +1,16 @@
|
|
|
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/np7zgQo9412LDvi1mA1UmK/%40dicebear%2Fidenticon?node-id=1%3A34
|
|
6
|
+
*/
|
|
7
|
+
import { escape } from '@dicebear/core';
|
|
8
|
+
export const row5 = {
|
|
9
|
+
'xooox': (components, colors) => `<path d="M1 4H0v1h1V4ZM5 4H4v1h1V4Z" fill="${escape.xml(`#${colors.row}`)}"/>`,
|
|
10
|
+
'xxoxx': (components, colors) => `<path d="M2 4H0v1h2V4ZM5 4H3v1h2V4Z" fill="${escape.xml(`#${colors.row}`)}"/>`,
|
|
11
|
+
'xoxox': (components, colors) => `<path d="M0 4h1v1H0V4ZM4 4h1v1H4V4ZM3 4H2v1h1V4Z" fill="${escape.xml(`#${colors.row}`)}"/>`,
|
|
12
|
+
'oxxxo': (components, colors) => `<path fill="${escape.xml(`#${colors.row}`)}" d="M1 4h3v1H1z"/>`,
|
|
13
|
+
'xxxxx': (components, colors) => `<path fill="${escape.xml(`#${colors.row}`)}" d="M0 4h5v1H0z"/>`,
|
|
14
|
+
'oxoxo': (components, colors) => `<path d="M2 4H1v1h1V4ZM4 4H3v1h1V4Z" fill="${escape.xml(`#${colors.row}`)}"/>`,
|
|
15
|
+
'ooxoo': (components, colors) => `<path fill="${escape.xml(`#${colors.row}`)}" d="M2 4h1v1H2z"/>`,
|
|
16
|
+
};
|
package/lib/core.d.ts
ADDED
|
@@ -0,0 +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/np7zgQo9412LDvi1mA1UmK/%40dicebear%2Fidenticon?node-id=1%3A34
|
|
6
|
+
*/
|
|
7
|
+
import type { Style } from '@dicebear/core';
|
|
8
|
+
import type { Options } from './types.js';
|
|
9
|
+
export declare const style: Style<Options>;
|
package/lib/core.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
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/np7zgQo9412LDvi1mA1UmK/%40dicebear%2Fidenticon?node-id=1%3A34
|
|
6
|
+
*/
|
|
7
|
+
import { schema } from './schema.js';
|
|
8
|
+
import { getComponents } from './utils/getComponents.js';
|
|
9
|
+
import { getColors } from './utils/getColors.js';
|
|
10
|
+
import { onPreCreate } from './hooks/onPreCreate.js';
|
|
11
|
+
import { onPostCreate } from './hooks/onPostCreate.js';
|
|
12
|
+
export const style = {
|
|
13
|
+
meta: {
|
|
14
|
+
title: 'Identicon',
|
|
15
|
+
creator: 'Florian Körner',
|
|
16
|
+
license: {
|
|
17
|
+
name: 'CC0 1.0',
|
|
18
|
+
url: 'https://creativecommons.org/publicdomain/zero/1.0/',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
schema: schema,
|
|
22
|
+
create: ({ prng, options }) => {
|
|
23
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
24
|
+
onPreCreate({ prng, options });
|
|
25
|
+
const components = getComponents({ prng, options });
|
|
26
|
+
const colors = getColors({ prng, options });
|
|
27
|
+
onPostCreate({ prng, options, components, colors });
|
|
28
|
+
return {
|
|
29
|
+
attributes: {
|
|
30
|
+
viewBox: '0 0 5 5',
|
|
31
|
+
fill: 'none',
|
|
32
|
+
'shape-rendering': 'crispEdges'
|
|
33
|
+
},
|
|
34
|
+
body: `${(_b = (_a = components.row1) === null || _a === void 0 ? void 0 : _a.value(components, colors)) !== null && _b !== void 0 ? _b : ''}${(_d = (_c = components.row2) === null || _c === void 0 ? void 0 : _c.value(components, colors)) !== null && _d !== void 0 ? _d : ''}${(_f = (_e = components.row3) === null || _e === void 0 ? void 0 : _e.value(components, colors)) !== null && _f !== void 0 ? _f : ''}${(_h = (_g = components.row4) === null || _g === void 0 ? void 0 : _g.value(components, colors)) !== null && _h !== void 0 ? _h : ''}${(_k = (_j = components.row5) === null || _j === void 0 ? void 0 : _j.value(components, colors)) !== null && _k !== void 0 ? _k : ''}`,
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
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/np7zgQo9412LDvi1mA1UmK/%40dicebear%2Fidenticon?node-id=1%3A34
|
|
6
|
+
*/
|
|
7
|
+
import { Prng, StyleOptions } from "@dicebear/core";
|
|
8
|
+
import { Options, ColorPickCollection, ComponentPickCollection } from "../types.js";
|
|
9
|
+
declare type Props = {
|
|
10
|
+
prng: Prng;
|
|
11
|
+
options: StyleOptions<Options>;
|
|
12
|
+
components: ComponentPickCollection;
|
|
13
|
+
colors: ColorPickCollection;
|
|
14
|
+
};
|
|
15
|
+
export declare function onPostCreate({ prng, options, components, colors }: Props): void;
|
|
16
|
+
export {};
|
|
@@ -0,0 +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/np7zgQo9412LDvi1mA1UmK/%40dicebear%2Fidenticon?node-id=1%3A34
|
|
6
|
+
*/
|
|
7
|
+
export function onPostCreate({ prng, options, components, colors }) {
|
|
8
|
+
// Write your modifications here
|
|
9
|
+
}
|
|
@@ -0,0 +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/np7zgQo9412LDvi1mA1UmK/%40dicebear%2Fidenticon?node-id=1%3A34
|
|
6
|
+
*/
|
|
7
|
+
import { Prng, StyleOptions } from "@dicebear/core";
|
|
8
|
+
import { Options } from "../types.js";
|
|
9
|
+
declare type Props = {
|
|
10
|
+
prng: Prng;
|
|
11
|
+
options: StyleOptions<Options>;
|
|
12
|
+
};
|
|
13
|
+
export declare function onPreCreate({ prng, options }: Props): void;
|
|
14
|
+
export {};
|
|
@@ -0,0 +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/np7zgQo9412LDvi1mA1UmK/%40dicebear%2Fidenticon?node-id=1%3A34
|
|
6
|
+
*/
|
|
7
|
+
export function onPreCreate({ prng, options }) {
|
|
8
|
+
// Write your modifications here
|
|
9
|
+
}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +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/np7zgQo9412LDvi1mA1UmK/%40dicebear%2Fidenticon?node-id=1%3A34
|
|
6
|
+
*/
|
|
7
|
+
declare const create: import("@dicebear/core").StyleCreate<import("./types.js").Options>, meta: import("@dicebear/core").StyleMeta, schema: import("json-schema").JSONSchema7;
|
|
8
|
+
export { create, meta, schema };
|
|
9
|
+
export type { Options } from './types.js';
|
package/lib/index.js
ADDED
|
@@ -0,0 +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/np7zgQo9412LDvi1mA1UmK/%40dicebear%2Fidenticon?node-id=1%3A34
|
|
6
|
+
*/
|
|
7
|
+
/*!
|
|
8
|
+
* Identicon (@dicebear/identicon)
|
|
9
|
+
*
|
|
10
|
+
* Code licensed under MIT License.
|
|
11
|
+
* Copyright (c) 2022 Florian Körner
|
|
12
|
+
*
|
|
13
|
+
* Design "Identicon" by Florian Körner licensed under CC0 1.0. / Remix of the original.
|
|
14
|
+
* License: https://creativecommons.org/publicdomain/zero/1.0/
|
|
15
|
+
*/
|
|
16
|
+
import { style } from './core.js';
|
|
17
|
+
const { create, meta, schema } = style;
|
|
18
|
+
export { create, meta, schema };
|
package/lib/schema.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
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/np7zgQo9412LDvi1mA1UmK/%40dicebear%2Fidenticon?node-id=1%3A34
|
|
6
|
+
*/
|
|
7
|
+
import type { StyleSchema } from '@dicebear/core';
|
|
8
|
+
export declare const schema: StyleSchema;
|
package/lib/schema.js
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
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/np7zgQo9412LDvi1mA1UmK/%40dicebear%2Fidenticon?node-id=1%3A34
|
|
6
|
+
*/
|
|
7
|
+
export const schema = {
|
|
8
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
9
|
+
"properties": {
|
|
10
|
+
"row1": {
|
|
11
|
+
"type": "array",
|
|
12
|
+
"items": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"enum": [
|
|
15
|
+
"xooox",
|
|
16
|
+
"xxoxx",
|
|
17
|
+
"xoxox",
|
|
18
|
+
"oxxxo",
|
|
19
|
+
"xxxxx",
|
|
20
|
+
"oxoxo",
|
|
21
|
+
"ooxoo"
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
"default": [
|
|
25
|
+
"xooox",
|
|
26
|
+
"xxoxx",
|
|
27
|
+
"xoxox",
|
|
28
|
+
"oxxxo",
|
|
29
|
+
"xxxxx",
|
|
30
|
+
"oxoxo",
|
|
31
|
+
"ooxoo"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"row2": {
|
|
35
|
+
"type": "array",
|
|
36
|
+
"items": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"enum": [
|
|
39
|
+
"xooox",
|
|
40
|
+
"xxoxx",
|
|
41
|
+
"xoxox",
|
|
42
|
+
"oxxxo",
|
|
43
|
+
"xxxxx",
|
|
44
|
+
"oxoxo",
|
|
45
|
+
"ooxoo"
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
"default": [
|
|
49
|
+
"xooox",
|
|
50
|
+
"xxoxx",
|
|
51
|
+
"xoxox",
|
|
52
|
+
"oxxxo",
|
|
53
|
+
"xxxxx",
|
|
54
|
+
"oxoxo",
|
|
55
|
+
"ooxoo"
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
"row3": {
|
|
59
|
+
"type": "array",
|
|
60
|
+
"items": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"enum": [
|
|
63
|
+
"xooox",
|
|
64
|
+
"xxoxx",
|
|
65
|
+
"xoxox",
|
|
66
|
+
"oxxxo",
|
|
67
|
+
"xxxxx",
|
|
68
|
+
"oxoxo",
|
|
69
|
+
"ooxoo"
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
"default": [
|
|
73
|
+
"xooox",
|
|
74
|
+
"xxoxx",
|
|
75
|
+
"xoxox",
|
|
76
|
+
"oxxxo",
|
|
77
|
+
"xxxxx",
|
|
78
|
+
"oxoxo",
|
|
79
|
+
"ooxoo"
|
|
80
|
+
]
|
|
81
|
+
},
|
|
82
|
+
"row4": {
|
|
83
|
+
"type": "array",
|
|
84
|
+
"items": {
|
|
85
|
+
"type": "string",
|
|
86
|
+
"enum": [
|
|
87
|
+
"xooox",
|
|
88
|
+
"xxoxx",
|
|
89
|
+
"xoxox",
|
|
90
|
+
"oxxxo",
|
|
91
|
+
"xxxxx",
|
|
92
|
+
"oxoxo",
|
|
93
|
+
"ooxoo"
|
|
94
|
+
]
|
|
95
|
+
},
|
|
96
|
+
"default": [
|
|
97
|
+
"xooox",
|
|
98
|
+
"xxoxx",
|
|
99
|
+
"xoxox",
|
|
100
|
+
"oxxxo",
|
|
101
|
+
"xxxxx",
|
|
102
|
+
"oxoxo",
|
|
103
|
+
"ooxoo"
|
|
104
|
+
]
|
|
105
|
+
},
|
|
106
|
+
"row5": {
|
|
107
|
+
"type": "array",
|
|
108
|
+
"items": {
|
|
109
|
+
"type": "string",
|
|
110
|
+
"enum": [
|
|
111
|
+
"xooox",
|
|
112
|
+
"xxoxx",
|
|
113
|
+
"xoxox",
|
|
114
|
+
"oxxxo",
|
|
115
|
+
"xxxxx",
|
|
116
|
+
"oxoxo",
|
|
117
|
+
"ooxoo"
|
|
118
|
+
]
|
|
119
|
+
},
|
|
120
|
+
"default": [
|
|
121
|
+
"xooox",
|
|
122
|
+
"xxoxx",
|
|
123
|
+
"xoxox",
|
|
124
|
+
"oxxxo",
|
|
125
|
+
"xxxxx",
|
|
126
|
+
"oxoxo",
|
|
127
|
+
"ooxoo"
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
"rowColor": {
|
|
131
|
+
"type": "array",
|
|
132
|
+
"items": {
|
|
133
|
+
"type": "string",
|
|
134
|
+
"pattern": "^[a-fA-F0-9]{6}$"
|
|
135
|
+
},
|
|
136
|
+
"default": [
|
|
137
|
+
"e53935",
|
|
138
|
+
"ffb300",
|
|
139
|
+
"1e88e5",
|
|
140
|
+
"546e7a",
|
|
141
|
+
"6d4c41",
|
|
142
|
+
"00acc1",
|
|
143
|
+
"f4511e",
|
|
144
|
+
"5e35b1",
|
|
145
|
+
"43a047",
|
|
146
|
+
"757575",
|
|
147
|
+
"3949ab",
|
|
148
|
+
"039be5",
|
|
149
|
+
"7cb342",
|
|
150
|
+
"c0ca33",
|
|
151
|
+
"fb8c00",
|
|
152
|
+
"d81b60",
|
|
153
|
+
"8e24aa",
|
|
154
|
+
"00897b",
|
|
155
|
+
"fdd835"
|
|
156
|
+
]
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
};
|
package/lib/types.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
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/np7zgQo9412LDvi1mA1UmK/%40dicebear%2Fidenticon?node-id=1%3A34
|
|
6
|
+
*/
|
|
7
|
+
export interface Options {
|
|
8
|
+
row1?: ('xooox' | 'xxoxx' | 'xoxox' | 'oxxxo' | 'xxxxx' | 'oxoxo' | 'ooxoo')[];
|
|
9
|
+
row2?: ('xooox' | 'xxoxx' | 'xoxox' | 'oxxxo' | 'xxxxx' | 'oxoxo' | 'ooxoo')[];
|
|
10
|
+
row3?: ('xooox' | 'xxoxx' | 'xoxox' | 'oxxxo' | 'xxxxx' | 'oxoxo' | 'ooxoo')[];
|
|
11
|
+
row4?: ('xooox' | 'xxoxx' | 'xoxox' | 'oxxxo' | 'xxxxx' | 'oxoxo' | 'ooxoo')[];
|
|
12
|
+
row5?: ('xooox' | 'xxoxx' | 'xoxox' | 'oxxxo' | 'xxxxx' | 'oxoxo' | 'ooxoo')[];
|
|
13
|
+
rowColor?: string[];
|
|
14
|
+
}
|
|
15
|
+
export declare type ColorPickCollection = Record<string, string>;
|
|
16
|
+
export declare type ComponentGroup = Record<string, ComponentGroupItem>;
|
|
17
|
+
export declare type ComponentGroupCollection = Record<string, ComponentGroup>;
|
|
18
|
+
export declare type ComponentGroupItem = (components: ComponentPickCollection, colors: ColorPickCollection) => string;
|
|
19
|
+
export declare type ComponentPickCollection = Record<string, ComponentPick>;
|
|
20
|
+
export declare type ComponentPick = {
|
|
21
|
+
name: string;
|
|
22
|
+
value: ComponentGroupItem;
|
|
23
|
+
} | undefined;
|
package/lib/types.js
ADDED
|
@@ -0,0 +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/np7zgQo9412LDvi1mA1UmK/%40dicebear%2Fidenticon?node-id=1%3A34
|
|
6
|
+
*/
|
|
7
|
+
export {};
|
|
@@ -0,0 +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/np7zgQo9412LDvi1mA1UmK/%40dicebear%2Fidenticon?node-id=1%3A34
|
|
6
|
+
*/
|
|
7
|
+
import type { Prng } from '@dicebear/core';
|
|
8
|
+
import type { Options, ColorPickCollection } from '../types.js';
|
|
9
|
+
declare type Props = {
|
|
10
|
+
prng: Prng;
|
|
11
|
+
options: Options;
|
|
12
|
+
};
|
|
13
|
+
export declare function getColors({ prng, options }: Props): ColorPickCollection;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
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/np7zgQo9412LDvi1mA1UmK/%40dicebear%2Fidenticon?node-id=1%3A34
|
|
6
|
+
*/
|
|
7
|
+
export function getColors({ prng, options }) {
|
|
8
|
+
var _a, _b;
|
|
9
|
+
return {
|
|
10
|
+
'row': (_b = prng.pick((_a = options.rowColor) !== null && _a !== void 0 ? _a : [])) !== null && _b !== void 0 ? _b : 'transparent',
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
;
|
|
@@ -0,0 +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/np7zgQo9412LDvi1mA1UmK/%40dicebear%2Fidenticon?node-id=1%3A34
|
|
6
|
+
*/
|
|
7
|
+
import type { Prng } from '@dicebear/core';
|
|
8
|
+
import type { Options, ComponentPickCollection } from '../types.js';
|
|
9
|
+
declare type Props = {
|
|
10
|
+
prng: Prng;
|
|
11
|
+
options: Options;
|
|
12
|
+
};
|
|
13
|
+
export declare function getComponents({ prng, options }: Props): ComponentPickCollection;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
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/np7zgQo9412LDvi1mA1UmK/%40dicebear%2Fidenticon?node-id=1%3A34
|
|
6
|
+
*/
|
|
7
|
+
import { pickComponent } from './pickComponent.js';
|
|
8
|
+
export function getComponents({ prng, options }) {
|
|
9
|
+
const row1Component = pickComponent({
|
|
10
|
+
prng,
|
|
11
|
+
group: 'row1',
|
|
12
|
+
values: options.row1
|
|
13
|
+
});
|
|
14
|
+
const row2Component = pickComponent({
|
|
15
|
+
prng,
|
|
16
|
+
group: 'row2',
|
|
17
|
+
values: options.row2
|
|
18
|
+
});
|
|
19
|
+
const row3Component = pickComponent({
|
|
20
|
+
prng,
|
|
21
|
+
group: 'row3',
|
|
22
|
+
values: options.row3
|
|
23
|
+
});
|
|
24
|
+
const row4Component = pickComponent({
|
|
25
|
+
prng,
|
|
26
|
+
group: 'row4',
|
|
27
|
+
values: options.row4
|
|
28
|
+
});
|
|
29
|
+
const row5Component = pickComponent({
|
|
30
|
+
prng,
|
|
31
|
+
group: 'row5',
|
|
32
|
+
values: options.row5
|
|
33
|
+
});
|
|
34
|
+
return {
|
|
35
|
+
'row1': row1Component,
|
|
36
|
+
'row2': row2Component,
|
|
37
|
+
'row3': row3Component,
|
|
38
|
+
'row4': row4Component,
|
|
39
|
+
'row5': row5Component,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
;
|
|
@@ -0,0 +1,15 @@
|
|
|
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/np7zgQo9412LDvi1mA1UmK/%40dicebear%2Fidenticon?node-id=1%3A34
|
|
6
|
+
*/
|
|
7
|
+
import type { Prng } from '@dicebear/core';
|
|
8
|
+
import type { ComponentPick } from '../types.js';
|
|
9
|
+
declare type Props = {
|
|
10
|
+
prng: Prng;
|
|
11
|
+
group: string;
|
|
12
|
+
values?: string[];
|
|
13
|
+
};
|
|
14
|
+
export declare function pickComponent({ prng, group, values }: Props): ComponentPick;
|
|
15
|
+
export {};
|