@dicebear/shapes 9.2.2 → 9.2.4

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.
@@ -6,11 +6,11 @@
6
6
  */
7
7
  import { escape } from '@dicebear/core';
8
8
  export const shape1 = {
9
- 'rectangle': (components, colors) => `<path fill-rule="evenodd" clip-rule="evenodd" d="M90 10H10v80h80V10ZM0 0v100h100V0H0Z" fill="${escape.xml(`${colors.shape1}`)}"/>`,
10
- 'rectangleFilled': (components, colors) => `<path d="M0 0h100v100H0V0Z" fill="${escape.xml(`${colors.shape1}`)}"/>`,
11
- 'ellipseFilled': (components, colors) => `<path d="M100 50A50 50 0 1 1 0 50a50 50 0 0 1 100 0Z" fill="${escape.xml(`${colors.shape1}`)}"/>`,
12
- 'ellipse': (components, colors) => `<path fill-rule="evenodd" clip-rule="evenodd" d="M50 90a40 40 0 1 0 0-80 40 40 0 0 0 0 80Zm0 10A50 50 0 1 0 50 0a50 50 0 0 0 0 100Z" fill="${escape.xml(`${colors.shape1}`)}"/>`,
13
- 'polygonFilled': (components, colors) => `<path d="m50 7 50 86.6H0L50 7Z" fill="${escape.xml(`${colors.shape1}`)}"/>`,
14
- 'polygon': (components, colors) => `<path fill-rule="evenodd" clip-rule="evenodd" d="M50 7 0 93.6h100L50 7Zm0 20L17.3 83.6h65.4L50 27Z" fill="${escape.xml(`${colors.shape1}`)}"/>`,
15
- 'line': (components, colors) => `<path fill="${escape.xml(`${colors.shape1}`)}" d="M45-150h10v400H45z"/>`,
9
+ rectangle: (components, colors) => `<path fill-rule="evenodd" clip-rule="evenodd" d="M90 10H10v80h80V10ZM0 0v100h100V0H0Z" fill="${escape.xml(`${colors.shape1}`)}"/>`,
10
+ rectangleFilled: (components, colors) => `<path d="M0 0h100v100H0V0Z" fill="${escape.xml(`${colors.shape1}`)}"/>`,
11
+ ellipseFilled: (components, colors) => `<path d="M100 50A50 50 0 1 1 0 50a50 50 0 0 1 100 0Z" fill="${escape.xml(`${colors.shape1}`)}"/>`,
12
+ ellipse: (components, colors) => `<path fill-rule="evenodd" clip-rule="evenodd" d="M50 90a40 40 0 1 0 0-80 40 40 0 0 0 0 80Zm0 10A50 50 0 1 0 50 0a50 50 0 0 0 0 100Z" fill="${escape.xml(`${colors.shape1}`)}"/>`,
13
+ polygonFilled: (components, colors) => `<path d="m50 7 50 86.6H0L50 7Z" fill="${escape.xml(`${colors.shape1}`)}"/>`,
14
+ polygon: (components, colors) => `<path fill-rule="evenodd" clip-rule="evenodd" d="M50 7 0 93.6h100L50 7Zm0 20L17.3 83.6h65.4L50 27Z" fill="${escape.xml(`${colors.shape1}`)}"/>`,
15
+ line: (components, colors) => `<path fill="${escape.xml(`${colors.shape1}`)}" d="M45-150h10v400H45z"/>`,
16
16
  };
@@ -6,11 +6,11 @@
6
6
  */
7
7
  import { escape } from '@dicebear/core';
8
8
  export const shape2 = {
9
- 'rectangle': (components, colors) => `<path fill-rule="evenodd" clip-rule="evenodd" d="M90 10H10v80h80V10ZM0 0v100h100V0H0Z" fill="${escape.xml(`${colors.shape2}`)}"/>`,
10
- 'rectangleFilled': (components, colors) => `<path d="M0 0h100v100H0V0Z" fill="${escape.xml(`${colors.shape2}`)}"/>`,
11
- 'ellipseFilled': (components, colors) => `<path d="M100 50A50 50 0 1 1 0 50a50 50 0 0 1 100 0Z" fill="${escape.xml(`${colors.shape2}`)}"/>`,
12
- 'ellipse': (components, colors) => `<path fill-rule="evenodd" clip-rule="evenodd" d="M50 90a40 40 0 1 0 0-80 40 40 0 0 0 0 80Zm0 10A50 50 0 1 0 50 0a50 50 0 0 0 0 100Z" fill="${escape.xml(`${colors.shape2}`)}"/>`,
13
- 'polygonFilled': (components, colors) => `<path d="m50 7 50 86.6H0L50 7Z" fill="${escape.xml(`${colors.shape2}`)}"/>`,
14
- 'polygon': (components, colors) => `<path fill-rule="evenodd" clip-rule="evenodd" d="M50 7 0 93.6h100L50 7Zm0 20L17.3 83.6h65.4L50 27Z" fill="${escape.xml(`${colors.shape2}`)}"/>`,
15
- 'line': (components, colors) => `<path fill="${escape.xml(`${colors.shape2}`)}" d="M45-150h10v400H45z"/>`,
9
+ rectangle: (components, colors) => `<path fill-rule="evenodd" clip-rule="evenodd" d="M90 10H10v80h80V10ZM0 0v100h100V0H0Z" fill="${escape.xml(`${colors.shape2}`)}"/>`,
10
+ rectangleFilled: (components, colors) => `<path d="M0 0h100v100H0V0Z" fill="${escape.xml(`${colors.shape2}`)}"/>`,
11
+ ellipseFilled: (components, colors) => `<path d="M100 50A50 50 0 1 1 0 50a50 50 0 0 1 100 0Z" fill="${escape.xml(`${colors.shape2}`)}"/>`,
12
+ ellipse: (components, colors) => `<path fill-rule="evenodd" clip-rule="evenodd" d="M50 90a40 40 0 1 0 0-80 40 40 0 0 0 0 80Zm0 10A50 50 0 1 0 50 0a50 50 0 0 0 0 100Z" fill="${escape.xml(`${colors.shape2}`)}"/>`,
13
+ polygonFilled: (components, colors) => `<path d="m50 7 50 86.6H0L50 7Z" fill="${escape.xml(`${colors.shape2}`)}"/>`,
14
+ polygon: (components, colors) => `<path fill-rule="evenodd" clip-rule="evenodd" d="M50 7 0 93.6h100L50 7Zm0 20L17.3 83.6h65.4L50 27Z" fill="${escape.xml(`${colors.shape2}`)}"/>`,
15
+ line: (components, colors) => `<path fill="${escape.xml(`${colors.shape2}`)}" d="M45-150h10v400H45z"/>`,
16
16
  };
@@ -6,11 +6,11 @@
6
6
  */
7
7
  import { escape } from '@dicebear/core';
8
8
  export const shape3 = {
9
- 'rectangle': (components, colors) => `<path fill-rule="evenodd" clip-rule="evenodd" d="M90 10H10v80h80V10ZM0 0v100h100V0H0Z" fill="${escape.xml(`${colors.shape3}`)}"/>`,
10
- 'rectangleFilled': (components, colors) => `<path d="M0 0h100v100H0V0Z" fill="${escape.xml(`${colors.shape3}`)}"/>`,
11
- 'ellipseFilled': (components, colors) => `<path d="M100 50A50 50 0 1 1 0 50a50 50 0 0 1 100 0Z" fill="${escape.xml(`${colors.shape3}`)}"/>`,
12
- 'ellipse': (components, colors) => `<path fill-rule="evenodd" clip-rule="evenodd" d="M50 90a40 40 0 1 0 0-80 40 40 0 0 0 0 80Zm0 10A50 50 0 1 0 50 0a50 50 0 0 0 0 100Z" fill="${escape.xml(`${colors.shape3}`)}"/>`,
13
- 'polygonFilled': (components, colors) => `<path d="m50 7 50 86.6H0L50 7Z" fill="${escape.xml(`${colors.shape3}`)}"/>`,
14
- 'polygon': (components, colors) => `<path fill-rule="evenodd" clip-rule="evenodd" d="M50 7 0 93.6h100L50 7Zm0 20L17.3 83.6h65.4L50 27Z" fill="${escape.xml(`${colors.shape3}`)}"/>`,
15
- 'line': (components, colors) => `<path fill="${escape.xml(`${colors.shape3}`)}" d="M45-150h10v400H45z"/>`,
9
+ rectangle: (components, colors) => `<path fill-rule="evenodd" clip-rule="evenodd" d="M90 10H10v80h80V10ZM0 0v100h100V0H0Z" fill="${escape.xml(`${colors.shape3}`)}"/>`,
10
+ rectangleFilled: (components, colors) => `<path d="M0 0h100v100H0V0Z" fill="${escape.xml(`${colors.shape3}`)}"/>`,
11
+ ellipseFilled: (components, colors) => `<path d="M100 50A50 50 0 1 1 0 50a50 50 0 0 1 100 0Z" fill="${escape.xml(`${colors.shape3}`)}"/>`,
12
+ ellipse: (components, colors) => `<path fill-rule="evenodd" clip-rule="evenodd" d="M50 90a40 40 0 1 0 0-80 40 40 0 0 0 0 80Zm0 10A50 50 0 1 0 50 0a50 50 0 0 0 0 100Z" fill="${escape.xml(`${colors.shape3}`)}"/>`,
13
+ polygonFilled: (components, colors) => `<path d="m50 7 50 86.6H0L50 7Z" fill="${escape.xml(`${colors.shape3}`)}"/>`,
14
+ polygon: (components, colors) => `<path fill-rule="evenodd" clip-rule="evenodd" d="M50 7 0 93.6h100L50 7Zm0 20L17.3 83.6h65.4L50 27Z" fill="${escape.xml(`${colors.shape3}`)}"/>`,
15
+ line: (components, colors) => `<path fill="${escape.xml(`${colors.shape3}`)}" d="M45-150h10v400H45z"/>`,
16
16
  };
@@ -4,8 +4,8 @@
4
4
  * Plugin: https://www.figma.com/community/plugin/1005765655729342787
5
5
  * File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
6
6
  */
7
- import { Prng, StyleOptions } from "@dicebear/core";
8
- import { Options } from "../types.js";
7
+ import { Prng, StyleOptions } from '@dicebear/core';
8
+ import { Options } from '../types.js';
9
9
  type Props = {
10
10
  prng: Prng;
11
11
  options: StyleOptions<Options>;
package/lib/index.js CHANGED
@@ -26,7 +26,7 @@ export const create = ({ prng, options }) => {
26
26
  attributes: {
27
27
  viewBox: '0 0 100 100',
28
28
  fill: 'none',
29
- 'shape-rendering': 'auto'
29
+ 'shape-rendering': 'auto',
30
30
  },
31
31
  body: `<g transform="matrix(1.2 0 0 1.2 -10 -10)">${(_b = (_a = components.shape1) === null || _a === void 0 ? void 0 : _a.value(components, colors)) !== null && _b !== void 0 ? _b : ''}</g><g transform="matrix(.8 0 0 .8 10 10)">${(_d = (_c = components.shape2) === null || _c === void 0 ? void 0 : _c.value(components, colors)) !== null && _d !== void 0 ? _d : ''}</g><g transform="matrix(.4 0 0 .4 30 30)">${(_f = (_e = components.shape3) === null || _e === void 0 ? void 0 : _e.value(components, colors)) !== null && _f !== void 0 ? _f : ''}</g>`,
32
32
  extra: () => ({
package/lib/schema.js CHANGED
@@ -5,245 +5,185 @@
5
5
  * File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
6
6
  */
7
7
  export const schema = {
8
- "$schema": "http://json-schema.org/draft-07/schema#",
9
- "properties": {
10
- "backgroundColor": {
11
- "type": "array",
12
- "items": {
13
- "type": "string",
14
- "pattern": "^(transparent|[a-fA-F0-9]{6})$"
15
- },
16
- "default": [
17
- "0a5b83",
18
- "1c799f",
19
- "69d2e7",
20
- "f1f4dc",
21
- "f88c49"
22
- ]
23
- },
24
- "shape1": {
25
- "type": "array",
26
- "items": {
27
- "type": "string",
28
- "enum": [
29
- "rectangle",
30
- "rectangleFilled",
31
- "ellipseFilled",
32
- "ellipse",
33
- "polygonFilled",
34
- "polygon",
35
- "line"
36
- ]
37
- },
38
- "default": [
39
- "rectangleFilled",
40
- "ellipseFilled",
41
- "polygonFilled"
42
- ]
43
- },
44
- "shape1Color": {
45
- "type": "array",
46
- "items": {
47
- "type": "string",
48
- "pattern": "^(transparent|[a-fA-F0-9]{6})$"
49
- },
50
- "default": [
51
- "0a5b83",
52
- "1c799f",
53
- "69d2e7",
54
- "f1f4dc",
55
- "f88c49"
56
- ]
57
- },
58
- "shape1OffsetX": {
59
- "type": "array",
60
- "items": {
61
- "type": "integer",
62
- "minimum": -65,
63
- "maximum": 65
64
- },
65
- "maxItems": 2,
66
- "default": [
67
- -65,
68
- 65
69
- ]
70
- },
71
- "shape1OffsetY": {
72
- "type": "array",
73
- "items": {
74
- "type": "integer",
75
- "minimum": -45,
76
- "maximum": 45
77
- },
78
- "maxItems": 2,
79
- "default": [
80
- -45,
81
- 45
82
- ]
83
- },
84
- "shape1Rotation": {
85
- "type": "array",
86
- "items": {
87
- "type": "integer",
88
- "minimum": -160,
89
- "maximum": 160
90
- },
91
- "maxItems": 2,
92
- "default": [
93
- -160,
94
- 160
95
- ]
96
- },
97
- "shape2": {
98
- "type": "array",
99
- "items": {
100
- "type": "string",
101
- "enum": [
102
- "rectangle",
103
- "rectangleFilled",
104
- "ellipseFilled",
105
- "ellipse",
106
- "polygonFilled",
107
- "polygon",
108
- "line"
109
- ]
110
- },
111
- "default": [
112
- "rectangleFilled",
113
- "ellipseFilled",
114
- "polygonFilled",
115
- "line"
116
- ]
117
- },
118
- "shape2Color": {
119
- "type": "array",
120
- "items": {
121
- "type": "string",
122
- "pattern": "^(transparent|[a-fA-F0-9]{6})$"
123
- },
124
- "default": [
125
- "0a5b83",
126
- "1c799f",
127
- "69d2e7",
128
- "f1f4dc",
129
- "f88c49"
130
- ]
131
- },
132
- "shape2OffsetX": {
133
- "type": "array",
134
- "items": {
135
- "type": "integer",
136
- "minimum": -40,
137
- "maximum": 40
138
- },
139
- "maxItems": 2,
140
- "default": [
141
- -40,
142
- 40
143
- ]
144
- },
145
- "shape2OffsetY": {
146
- "type": "array",
147
- "items": {
148
- "type": "integer",
149
- "minimum": -40,
150
- "maximum": 40
151
- },
152
- "maxItems": 2,
153
- "default": [
154
- -40,
155
- 40
156
- ]
157
- },
158
- "shape2Rotation": {
159
- "type": "array",
160
- "items": {
161
- "type": "integer",
162
- "minimum": -180,
163
- "maximum": 180
164
- },
165
- "maxItems": 2,
166
- "default": [
167
- -180,
168
- 180
169
- ]
170
- },
171
- "shape3": {
172
- "type": "array",
173
- "items": {
174
- "type": "string",
175
- "enum": [
176
- "rectangle",
177
- "rectangleFilled",
178
- "ellipseFilled",
179
- "ellipse",
180
- "polygonFilled",
181
- "polygon",
182
- "line"
183
- ]
184
- },
185
- "default": [
186
- "rectangle",
187
- "rectangleFilled",
188
- "ellipseFilled",
189
- "ellipse",
190
- "polygonFilled",
191
- "polygon",
192
- "line"
193
- ]
194
- },
195
- "shape3Color": {
196
- "type": "array",
197
- "items": {
198
- "type": "string",
199
- "pattern": "^(transparent|[a-fA-F0-9]{6})$"
200
- },
201
- "default": [
202
- "0a5b83",
203
- "1c799f",
204
- "69d2e7",
205
- "f1f4dc",
206
- "f88c49"
207
- ]
208
- },
209
- "shape3OffsetX": {
210
- "type": "array",
211
- "items": {
212
- "type": "integer",
213
- "minimum": -25,
214
- "maximum": 25
215
- },
216
- "maxItems": 2,
217
- "default": [
218
- -25,
219
- 25
220
- ]
221
- },
222
- "shape3OffsetY": {
223
- "type": "array",
224
- "items": {
225
- "type": "integer",
226
- "minimum": -25,
227
- "maximum": 25
228
- },
229
- "maxItems": 2,
230
- "default": [
231
- -25,
232
- 25
233
- ]
234
- },
235
- "shape3Rotation": {
236
- "type": "array",
237
- "items": {
238
- "type": "integer",
239
- "minimum": -180,
240
- "maximum": 180
241
- },
242
- "maxItems": 2,
243
- "default": [
244
- -180,
245
- 180
246
- ]
247
- }
248
- }
8
+ $schema: 'http://json-schema.org/draft-07/schema#',
9
+ properties: {
10
+ backgroundColor: {
11
+ type: 'array',
12
+ items: {
13
+ type: 'string',
14
+ pattern: '^(transparent|[a-fA-F0-9]{6})$',
15
+ },
16
+ default: ['0a5b83', '1c799f', '69d2e7', 'f1f4dc', 'f88c49'],
17
+ },
18
+ shape1: {
19
+ type: 'array',
20
+ items: {
21
+ type: 'string',
22
+ enum: [
23
+ 'rectangle',
24
+ 'rectangleFilled',
25
+ 'ellipseFilled',
26
+ 'ellipse',
27
+ 'polygonFilled',
28
+ 'polygon',
29
+ 'line',
30
+ ],
31
+ },
32
+ default: ['rectangleFilled', 'ellipseFilled', 'polygonFilled'],
33
+ },
34
+ shape1Color: {
35
+ type: 'array',
36
+ items: {
37
+ type: 'string',
38
+ pattern: '^(transparent|[a-fA-F0-9]{6})$',
39
+ },
40
+ default: ['0a5b83', '1c799f', '69d2e7', 'f1f4dc', 'f88c49'],
41
+ },
42
+ shape1OffsetX: {
43
+ type: 'array',
44
+ items: {
45
+ type: 'integer',
46
+ minimum: -65,
47
+ maximum: 65,
48
+ },
49
+ maxItems: 2,
50
+ default: [-65, 65],
51
+ },
52
+ shape1OffsetY: {
53
+ type: 'array',
54
+ items: {
55
+ type: 'integer',
56
+ minimum: -45,
57
+ maximum: 45,
58
+ },
59
+ maxItems: 2,
60
+ default: [-45, 45],
61
+ },
62
+ shape1Rotation: {
63
+ type: 'array',
64
+ items: {
65
+ type: 'integer',
66
+ minimum: -160,
67
+ maximum: 160,
68
+ },
69
+ maxItems: 2,
70
+ default: [-160, 160],
71
+ },
72
+ shape2: {
73
+ type: 'array',
74
+ items: {
75
+ type: 'string',
76
+ enum: [
77
+ 'rectangle',
78
+ 'rectangleFilled',
79
+ 'ellipseFilled',
80
+ 'ellipse',
81
+ 'polygonFilled',
82
+ 'polygon',
83
+ 'line',
84
+ ],
85
+ },
86
+ default: ['rectangleFilled', 'ellipseFilled', 'polygonFilled', 'line'],
87
+ },
88
+ shape2Color: {
89
+ type: 'array',
90
+ items: {
91
+ type: 'string',
92
+ pattern: '^(transparent|[a-fA-F0-9]{6})$',
93
+ },
94
+ default: ['0a5b83', '1c799f', '69d2e7', 'f1f4dc', 'f88c49'],
95
+ },
96
+ shape2OffsetX: {
97
+ type: 'array',
98
+ items: {
99
+ type: 'integer',
100
+ minimum: -40,
101
+ maximum: 40,
102
+ },
103
+ maxItems: 2,
104
+ default: [-40, 40],
105
+ },
106
+ shape2OffsetY: {
107
+ type: 'array',
108
+ items: {
109
+ type: 'integer',
110
+ minimum: -40,
111
+ maximum: 40,
112
+ },
113
+ maxItems: 2,
114
+ default: [-40, 40],
115
+ },
116
+ shape2Rotation: {
117
+ type: 'array',
118
+ items: {
119
+ type: 'integer',
120
+ minimum: -180,
121
+ maximum: 180,
122
+ },
123
+ maxItems: 2,
124
+ default: [-180, 180],
125
+ },
126
+ shape3: {
127
+ type: 'array',
128
+ items: {
129
+ type: 'string',
130
+ enum: [
131
+ 'rectangle',
132
+ 'rectangleFilled',
133
+ 'ellipseFilled',
134
+ 'ellipse',
135
+ 'polygonFilled',
136
+ 'polygon',
137
+ 'line',
138
+ ],
139
+ },
140
+ default: [
141
+ 'rectangle',
142
+ 'rectangleFilled',
143
+ 'ellipseFilled',
144
+ 'ellipse',
145
+ 'polygonFilled',
146
+ 'polygon',
147
+ 'line',
148
+ ],
149
+ },
150
+ shape3Color: {
151
+ type: 'array',
152
+ items: {
153
+ type: 'string',
154
+ pattern: '^(transparent|[a-fA-F0-9]{6})$',
155
+ },
156
+ default: ['0a5b83', '1c799f', '69d2e7', 'f1f4dc', 'f88c49'],
157
+ },
158
+ shape3OffsetX: {
159
+ type: 'array',
160
+ items: {
161
+ type: 'integer',
162
+ minimum: -25,
163
+ maximum: 25,
164
+ },
165
+ maxItems: 2,
166
+ default: [-25, 25],
167
+ },
168
+ shape3OffsetY: {
169
+ type: 'array',
170
+ items: {
171
+ type: 'integer',
172
+ minimum: -25,
173
+ maximum: 25,
174
+ },
175
+ maxItems: 2,
176
+ default: [-25, 25],
177
+ },
178
+ shape3Rotation: {
179
+ type: 'array',
180
+ items: {
181
+ type: 'integer',
182
+ minimum: -180,
183
+ maximum: 180,
184
+ },
185
+ maxItems: 2,
186
+ default: [-180, 180],
187
+ },
188
+ },
249
189
  };
@@ -8,9 +8,8 @@ import { convertColor } from './convertColor.js';
8
8
  export function getColors({ prng, options }) {
9
9
  var _a, _b, _c;
10
10
  return {
11
- 'shape1': convertColor(prng.pick((_a = options.shape1Color) !== null && _a !== void 0 ? _a : [], 'transparent')),
12
- 'shape2': convertColor(prng.pick((_b = options.shape2Color) !== null && _b !== void 0 ? _b : [], 'transparent')),
13
- 'shape3': convertColor(prng.pick((_c = options.shape3Color) !== null && _c !== void 0 ? _c : [], 'transparent')),
11
+ shape1: convertColor(prng.pick((_a = options.shape1Color) !== null && _a !== void 0 ? _a : [], 'transparent')),
12
+ shape2: convertColor(prng.pick((_b = options.shape2Color) !== null && _b !== void 0 ? _b : [], 'transparent')),
13
+ shape3: convertColor(prng.pick((_c = options.shape3Color) !== null && _c !== void 0 ? _c : [], 'transparent')),
14
14
  };
15
15
  }
16
- ;
@@ -10,5 +10,5 @@ type Props = {
10
10
  prng: Prng;
11
11
  options: Options;
12
12
  };
13
- export declare function getComponents({ prng, options }: Props): ComponentPickCollection;
13
+ export declare function getComponents({ prng, options, }: Props): ComponentPickCollection;
14
14
  export {};
@@ -5,7 +5,7 @@
5
5
  * File: https://www.figma.com/file/bX8ZT8jK2fo5Uy8G6j2Qic
6
6
  */
7
7
  import { pickComponent } from './pickComponent.js';
8
- export function getComponents({ prng, options }) {
8
+ export function getComponents({ prng, options, }) {
9
9
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
10
10
  const shape1Component = pickComponent({
11
11
  prng,
@@ -38,9 +38,8 @@ export function getComponents({ prng, options }) {
38
38
  offsetY: ((_j = options.shape3OffsetY) === null || _j === void 0 ? void 0 : _j.length) ? options.shape3OffsetY : [0],
39
39
  });
40
40
  return {
41
- 'shape1': shape1Component,
42
- 'shape2': shape2Component,
43
- 'shape3': shape3Component,
41
+ shape1: shape1Component,
42
+ shape2: shape2Component,
43
+ shape3: shape3Component,
44
44
  };
45
45
  }
46
- ;
@@ -16,5 +16,5 @@ type Props = {
16
16
  offsetX: number[];
17
17
  offsetY: number[];
18
18
  };
19
- export declare function pickComponent({ prng, group, width, height, values, rotation, offsetX, offsetY }: Props): ComponentPick;
19
+ export declare function pickComponent({ prng, group, width, height, values, rotation, offsetX, offsetY, }: Props): ComponentPick;
20
20
  export {};
@@ -5,7 +5,7 @@
5
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, width, height, 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, width, height, values = [], rotatio
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} ${width / 2} ${height / 2})">${result}</g>`;
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": "9.2.2",
3
+ "version": "9.2.4",
4
4
  "description": "Avatar style for DiceBear",
5
5
  "keywords": [
6
6
  "dicebear"
@@ -29,10 +29,10 @@
29
29
  "test": "uvu tests"
30
30
  },
31
31
  "devDependencies": {
32
- "@dicebear/core": "9.2.2",
33
- "@tsconfig/recommended": "^1.0.2",
34
- "del-cli": "^5.0.0",
35
- "typescript": "^5.1.6",
32
+ "@dicebear/core": "9.2.4",
33
+ "@tsconfig/recommended": "^1.0.10",
34
+ "del-cli": "^6.0.0",
35
+ "typescript": "^5.8.3",
36
36
  "uvu": "^0.5.6"
37
37
  },
38
38
  "peerDependencies": {
@@ -44,5 +44,5 @@
44
44
  "publishConfig": {
45
45
  "access": "public"
46
46
  },
47
- "gitHead": "bf5b31d047f707f50299142660bc89ef020d9b24"
47
+ "gitHead": "b19e1a8e417d6cdaffbc46ca6dee3522bb266b29"
48
48
  }