@dicebear/shapes 8.0.0-rc.2 → 8.0.1
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 +3 -3
- package/README.md +8 -8
- package/lib/components/index.d.ts +1 -1
- package/lib/components/index.js +1 -1
- package/lib/components/shape1.d.ts +1 -1
- package/lib/components/shape1.js +1 -1
- package/lib/components/shape2.d.ts +1 -1
- package/lib/components/shape2.js +1 -1
- package/lib/components/shape3.d.ts +1 -1
- package/lib/components/shape3.js +1 -1
- package/lib/hooks/onPreCreate.d.ts +1 -1
- package/lib/hooks/onPreCreate.js +1 -1
- package/lib/index.d.ts +5 -5
- package/lib/index.js +4 -4
- package/lib/schema.d.ts +1 -1
- package/lib/schema.js +1 -1
- package/lib/types.d.ts +1 -1
- package/lib/types.js +1 -1
- package/lib/utils/convertColor.d.ts +1 -1
- package/lib/utils/convertColor.js +1 -1
- package/lib/utils/getColors.d.ts +1 -1
- package/lib/utils/getColors.js +1 -1
- package/lib/utils/getComponents.d.ts +1 -1
- package/lib/utils/getComponents.js +7 -1
- package/lib/utils/pickComponent.d.ts +4 -2
- package/lib/utils/pickComponent.js +3 -3
- package/package.json +4 -4
package/LICENSE
CHANGED
|
@@ -4,8 +4,8 @@ Licenses
|
|
|
4
4
|
# Design
|
|
5
5
|
Applies to all design files in this package.
|
|
6
6
|
|
|
7
|
-
Source: Shapes (https://dicebear.com)
|
|
8
|
-
Designer:
|
|
7
|
+
Source: Shapes (https://www.dicebear.com)
|
|
8
|
+
Designer: DiceBear (https://www.dicebear.com)
|
|
9
9
|
License: CC0 1.0 (https://creativecommons.org/publicdomain/zero/1.0/)
|
|
10
10
|
|
|
11
11
|
# Code
|
|
@@ -13,7 +13,7 @@ Applies to all non-design files in this package.
|
|
|
13
13
|
|
|
14
14
|
MIT License
|
|
15
15
|
|
|
16
|
-
Copyright (c)
|
|
16
|
+
Copyright (c) 2024 Florian Körner
|
|
17
17
|
|
|
18
18
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
19
19
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
<h1 align="center"><img src="https://dicebear.com/logo-readme.svg" width="96" /> <br />DiceBear Shapes</h1>
|
|
1
|
+
<h1 align="center"><img src="https://www.dicebear.com/logo-readme.svg" width="96" /> <br />DiceBear Shapes</h1>
|
|
2
2
|
<p align="center">
|
|
3
|
-
<strong>Avatar Style for <a href="https://dicebear.com/">DiceBear</a></strong><br />
|
|
4
|
-
<a href="https://dicebear.com">Shapes</a> by <a href="https://dicebear.com">
|
|
3
|
+
<strong>Avatar Style for <a href="https://www.dicebear.com/">DiceBear</a></strong><br />
|
|
4
|
+
<a href="https://www.dicebear.com">Shapes</a> by <a href="https://www.dicebear.com">DiceBear</a>
|
|
5
5
|
</p>
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
@@ -15,16 +15,16 @@
|
|
|
15
15
|
</p>
|
|
16
16
|
|
|
17
17
|
<p align="center">
|
|
18
|
-
|
|
19
|
-
<a href="https://dicebear.com">
|
|
20
|
-
<a href="https://creativecommons.org/publicdomain/zero/1.0/">CC0 1.0</a>.
|
|
18
|
+
<a href="https://www.dicebear.com">Shapes</a> by
|
|
19
|
+
<a href="https://www.dicebear.com">DiceBear</a>, licensed under
|
|
20
|
+
<a href="https://creativecommons.org/publicdomain/zero/1.0/">CC0 1.0</a>.
|
|
21
21
|
</p>
|
|
22
22
|
<p align="center">
|
|
23
|
-
See <a href="https://dicebear.com/licenses">license overview</a> for more information.
|
|
23
|
+
See <a href="https://www.dicebear.com/licenses">license overview</a> for more information.
|
|
24
24
|
</p>
|
|
25
25
|
|
|
26
26
|
<p align="center">
|
|
27
|
-
<a href="https://dicebear.com/styles/shapes">
|
|
27
|
+
<a href="https://www.dicebear.com/styles/shapes">
|
|
28
28
|
Read Documentation
|
|
29
29
|
</a>
|
|
30
30
|
</p>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
|
|
3
3
|
*
|
|
4
4
|
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
|
|
5
|
-
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
5
|
+
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
6
6
|
*/
|
|
7
7
|
export { shape1 } from './shape1.js';
|
|
8
8
|
export { shape2 } from './shape2.js';
|
package/lib/components/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
|
|
3
3
|
*
|
|
4
4
|
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
|
|
5
|
-
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
5
|
+
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
6
6
|
*/
|
|
7
7
|
export { shape1 } from './shape1.js';
|
|
8
8
|
export { shape2 } from './shape2.js';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
|
|
3
3
|
*
|
|
4
4
|
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
|
|
5
|
-
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
5
|
+
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
6
6
|
*/
|
|
7
7
|
import type { ComponentGroup } from '../types.js';
|
|
8
8
|
export declare const shape1: ComponentGroup;
|
package/lib/components/shape1.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
|
|
3
3
|
*
|
|
4
4
|
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
|
|
5
|
-
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
5
|
+
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
6
6
|
*/
|
|
7
7
|
import { escape } from '@dicebear/core';
|
|
8
8
|
export const shape1 = {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
|
|
3
3
|
*
|
|
4
4
|
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
|
|
5
|
-
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
5
|
+
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
6
6
|
*/
|
|
7
7
|
import type { ComponentGroup } from '../types.js';
|
|
8
8
|
export declare const shape2: ComponentGroup;
|
package/lib/components/shape2.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
|
|
3
3
|
*
|
|
4
4
|
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
|
|
5
|
-
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
5
|
+
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
6
6
|
*/
|
|
7
7
|
import { escape } from '@dicebear/core';
|
|
8
8
|
export const shape2 = {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
|
|
3
3
|
*
|
|
4
4
|
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
|
|
5
|
-
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
5
|
+
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
6
6
|
*/
|
|
7
7
|
import type { ComponentGroup } from '../types.js';
|
|
8
8
|
export declare const shape3: ComponentGroup;
|
package/lib/components/shape3.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
|
|
3
3
|
*
|
|
4
4
|
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
|
|
5
|
-
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
5
|
+
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
6
6
|
*/
|
|
7
7
|
import { escape } from '@dicebear/core';
|
|
8
8
|
export const shape3 = {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
|
|
3
3
|
*
|
|
4
4
|
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
|
|
5
|
-
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
5
|
+
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
6
6
|
*/
|
|
7
7
|
import { Prng, StyleOptions } from "@dicebear/core";
|
|
8
8
|
import { Options } from "../types.js";
|
package/lib/hooks/onPreCreate.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
|
|
3
3
|
*
|
|
4
4
|
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
|
|
5
|
-
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
5
|
+
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
6
6
|
*/
|
|
7
7
|
export function onPreCreate({ prng, options }) {
|
|
8
8
|
var _a, _b, _c, _d;
|
package/lib/index.d.ts
CHANGED
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
|
|
3
3
|
*
|
|
4
4
|
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
|
|
5
|
-
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
5
|
+
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
6
6
|
*/
|
|
7
7
|
/*!
|
|
8
8
|
* Shapes (@dicebear/shapes)
|
|
9
9
|
*
|
|
10
10
|
* Code licensed under MIT License.
|
|
11
|
-
* Copyright (c)
|
|
11
|
+
* Copyright (c) 2024 Florian Körner
|
|
12
12
|
*
|
|
13
|
-
* Design "Shapes" by
|
|
14
|
-
* Source: https://dicebear.com
|
|
15
|
-
* Homepage: https://dicebear.com
|
|
13
|
+
* Design "Shapes" by DiceBear licensed under CC0 1.0.
|
|
14
|
+
* Source: https://www.dicebear.com
|
|
15
|
+
* Homepage: https://www.dicebear.com
|
|
16
16
|
* License: https://creativecommons.org/publicdomain/zero/1.0/
|
|
17
17
|
*/
|
|
18
18
|
import type { StyleCreate, StyleMeta } from '@dicebear/core';
|
package/lib/index.js
CHANGED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
|
|
3
3
|
*
|
|
4
4
|
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
|
|
5
|
-
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
5
|
+
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
6
6
|
*/
|
|
7
7
|
import { getComponents } from './utils/getComponents.js';
|
|
8
8
|
import { getColors } from './utils/getColors.js';
|
|
9
9
|
import { onPreCreate } from './hooks/onPreCreate.js';
|
|
10
10
|
export const meta = {
|
|
11
11
|
title: 'Shapes',
|
|
12
|
-
creator: '
|
|
13
|
-
source: 'https://dicebear.com',
|
|
14
|
-
homepage: 'https://dicebear.com',
|
|
12
|
+
creator: 'DiceBear',
|
|
13
|
+
source: 'https://www.dicebear.com',
|
|
14
|
+
homepage: 'https://www.dicebear.com',
|
|
15
15
|
license: {
|
|
16
16
|
name: 'CC0 1.0',
|
|
17
17
|
url: 'https://creativecommons.org/publicdomain/zero/1.0/',
|
package/lib/schema.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
|
|
3
3
|
*
|
|
4
4
|
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
|
|
5
|
-
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
5
|
+
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
6
6
|
*/
|
|
7
7
|
import type { StyleSchema } from '@dicebear/core';
|
|
8
8
|
export declare const schema: StyleSchema;
|
package/lib/schema.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
|
|
3
3
|
*
|
|
4
4
|
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
|
|
5
|
-
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
5
|
+
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
6
6
|
*/
|
|
7
7
|
export const schema = {
|
|
8
8
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
package/lib/types.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
|
|
3
3
|
*
|
|
4
4
|
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
|
|
5
|
-
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
5
|
+
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
6
6
|
*/
|
|
7
7
|
export interface Options {
|
|
8
8
|
shape1?: ('rectangle' | 'rectangleFilled' | 'ellipseFilled' | 'ellipse' | 'polygonFilled' | 'polygon' | 'line')[];
|
package/lib/types.js
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
|
|
3
3
|
*
|
|
4
4
|
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
|
|
5
|
-
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
5
|
+
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
6
6
|
*/
|
|
7
7
|
export {};
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
|
|
3
3
|
*
|
|
4
4
|
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
|
|
5
|
-
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
5
|
+
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
6
6
|
*/
|
|
7
7
|
export declare function convertColor(color: string): string;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
|
|
3
3
|
*
|
|
4
4
|
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
|
|
5
|
-
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
5
|
+
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
6
6
|
*/
|
|
7
7
|
export function convertColor(color) {
|
|
8
8
|
return 'transparent' === color ? color : `#${color}`;
|
package/lib/utils/getColors.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
|
|
3
3
|
*
|
|
4
4
|
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
|
|
5
|
-
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
5
|
+
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
6
6
|
*/
|
|
7
7
|
import type { Prng } from '@dicebear/core';
|
|
8
8
|
import type { Options, ColorPickCollection } from '../types.js';
|
package/lib/utils/getColors.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
|
|
3
3
|
*
|
|
4
4
|
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
|
|
5
|
-
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
5
|
+
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
6
6
|
*/
|
|
7
7
|
import { convertColor } from './convertColor.js';
|
|
8
8
|
export function getColors({ prng, options }) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
|
|
3
3
|
*
|
|
4
4
|
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
|
|
5
|
-
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
5
|
+
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
6
6
|
*/
|
|
7
7
|
import type { Prng } from '@dicebear/core';
|
|
8
8
|
import type { Options, ComponentPickCollection } from '../types.js';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
|
|
3
3
|
*
|
|
4
4
|
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
|
|
5
|
-
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
5
|
+
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
6
6
|
*/
|
|
7
7
|
import { pickComponent } from './pickComponent.js';
|
|
8
8
|
export function getComponents({ prng, options }) {
|
|
@@ -11,6 +11,8 @@ export function getComponents({ prng, options }) {
|
|
|
11
11
|
prng,
|
|
12
12
|
group: 'shape1',
|
|
13
13
|
values: options.shape1,
|
|
14
|
+
width: 100,
|
|
15
|
+
height: 100,
|
|
14
16
|
rotation: ((_a = options.shape1Rotation) === null || _a === void 0 ? void 0 : _a.length) ? options.shape1Rotation : [0],
|
|
15
17
|
offsetX: ((_b = options.shape1OffsetX) === null || _b === void 0 ? void 0 : _b.length) ? options.shape1OffsetX : [0],
|
|
16
18
|
offsetY: ((_c = options.shape1OffsetY) === null || _c === void 0 ? void 0 : _c.length) ? options.shape1OffsetY : [0],
|
|
@@ -19,6 +21,8 @@ export function getComponents({ prng, options }) {
|
|
|
19
21
|
prng,
|
|
20
22
|
group: 'shape2',
|
|
21
23
|
values: options.shape2,
|
|
24
|
+
width: 100,
|
|
25
|
+
height: 100,
|
|
22
26
|
rotation: ((_d = options.shape2Rotation) === null || _d === void 0 ? void 0 : _d.length) ? options.shape2Rotation : [0],
|
|
23
27
|
offsetX: ((_e = options.shape2OffsetX) === null || _e === void 0 ? void 0 : _e.length) ? options.shape2OffsetX : [0],
|
|
24
28
|
offsetY: ((_f = options.shape2OffsetY) === null || _f === void 0 ? void 0 : _f.length) ? options.shape2OffsetY : [0],
|
|
@@ -27,6 +31,8 @@ export function getComponents({ prng, options }) {
|
|
|
27
31
|
prng,
|
|
28
32
|
group: 'shape3',
|
|
29
33
|
values: options.shape3,
|
|
34
|
+
width: 100,
|
|
35
|
+
height: 100,
|
|
30
36
|
rotation: ((_g = options.shape3Rotation) === null || _g === void 0 ? void 0 : _g.length) ? options.shape3Rotation : [0],
|
|
31
37
|
offsetX: ((_h = options.shape3OffsetX) === null || _h === void 0 ? void 0 : _h.length) ? options.shape3OffsetX : [0],
|
|
32
38
|
offsetY: ((_j = options.shape3OffsetY) === null || _j === void 0 ? void 0 : _j.length) ? options.shape3OffsetY : [0],
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
|
|
3
3
|
*
|
|
4
4
|
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
|
|
5
|
-
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
5
|
+
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
6
6
|
*/
|
|
7
7
|
import type { Prng } from '@dicebear/core';
|
|
8
8
|
import type { ComponentPick } from '../types.js';
|
|
@@ -10,9 +10,11 @@ type Props = {
|
|
|
10
10
|
prng: Prng;
|
|
11
11
|
group: string;
|
|
12
12
|
values?: string[];
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
13
15
|
rotation: number[];
|
|
14
16
|
offsetX: number[];
|
|
15
17
|
offsetY: number[];
|
|
16
18
|
};
|
|
17
|
-
export declare function pickComponent({ prng, group, values, rotation, offsetX, offsetY }: Props): ComponentPick;
|
|
19
|
+
export declare function pickComponent({ prng, group, width, height, values, rotation, offsetX, offsetY }: Props): ComponentPick;
|
|
18
20
|
export {};
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
|
|
3
3
|
*
|
|
4
4
|
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
|
|
5
|
-
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
5
|
+
* File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
|
|
6
6
|
*/
|
|
7
7
|
import * as components from '../components/index.js';
|
|
8
|
-
export function pickComponent({ prng, group, values = [], rotation, offsetX, offsetY }) {
|
|
8
|
+
export function pickComponent({ prng, group, width, height, values = [], rotation, offsetX, offsetY }) {
|
|
9
9
|
const componentCollection = components;
|
|
10
10
|
const key = prng.pick(values);
|
|
11
11
|
const pickedRotation = prng.integer(Math.min(...rotation), Math.max(...rotation));
|
|
@@ -18,7 +18,7 @@ export function pickComponent({ prng, group, values = [], rotation, offsetX, off
|
|
|
18
18
|
var _a, _b, _c;
|
|
19
19
|
let result = componentCollection[group][key](components, colors);
|
|
20
20
|
if (this.rotation || this.offsetX || this.offsetY) {
|
|
21
|
-
result = `<g transform="translate(${((_a = this.offsetX) !== null && _a !== void 0 ? _a : 0)}, ${(_b = this.offsetY) !== null && _b !== void 0 ? _b : 0}) rotate(${(_c = this.rotation) !== null && _c !== void 0 ? _c : 0}
|
|
21
|
+
result = `<g transform="translate(${((_a = this.offsetX) !== null && _a !== void 0 ? _a : 0)}, ${(_b = this.offsetY) !== null && _b !== void 0 ? _b : 0}) rotate(${(_c = this.rotation) !== null && _c !== void 0 ? _c : 0} ${width / 2} ${height / 2})">${result}</g>`;
|
|
22
22
|
}
|
|
23
23
|
return result;
|
|
24
24
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dicebear/shapes",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.1",
|
|
4
4
|
"description": "Avatar style for DiceBear",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dicebear"
|
|
@@ -29,14 +29,14 @@
|
|
|
29
29
|
"test": "uvu tests"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@dicebear/core": "8.0.
|
|
32
|
+
"@dicebear/core": "8.0.1",
|
|
33
33
|
"@tsconfig/recommended": "^1.0.2",
|
|
34
34
|
"del-cli": "^5.0.0",
|
|
35
35
|
"typescript": "^5.1.6",
|
|
36
36
|
"uvu": "^0.5.6"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@dicebear/core": "^8.0.0
|
|
39
|
+
"@dicebear/core": "^8.0.0"
|
|
40
40
|
},
|
|
41
41
|
"engines": {
|
|
42
42
|
"node": ">=16.0.0"
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"publishConfig": {
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "dc11ff0fa0328c521e5769fde4414ad5a6dc7d2d"
|
|
48
48
|
}
|