@lglab/react-qr-code 1.4.10 → 1.6.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/dist/index.es.js +217 -153
- package/dist/src/components/data-modules.d.ts.map +1 -1
- package/dist/src/components/finder-patterns-inner.d.ts.map +1 -1
- package/dist/src/constants.d.ts +2 -0
- package/dist/src/constants.d.ts.map +1 -1
- package/dist/src/types/lib.d.ts +10 -2
- package/dist/src/types/lib.d.ts.map +1 -1
- package/dist/src/utils/data-modules.d.ts +11 -1
- package/dist/src/utils/data-modules.d.ts.map +1 -1
- package/dist/src/utils/settings.d.ts +1 -0
- package/dist/src/utils/settings.d.ts.map +1 -1
- package/dist/src/utils/svg.d.ts +1 -0
- package/dist/src/utils/svg.d.ts.map +1 -1
- package/package.json +7 -7
package/dist/index.es.js
CHANGED
|
@@ -20,7 +20,13 @@ var d = (e) => {
|
|
|
20
20
|
s += `${n === 0 ? "M" : "L"} ${l},${u} `;
|
|
21
21
|
}
|
|
22
22
|
return s + "Z";
|
|
23
|
-
}, p = (e, t, n, r) => `M ${e} ${t}Q ${e + r} ${t + n / 2}, ${e} ${t + n}Q ${e + n / 2} ${t + n - r}, ${e + n} ${t + n}Q ${e + n - r} ${t + n / 2}, ${e + n} ${t}Q ${e + n / 2} ${t + r}, ${e} ${t}Z`, m = (e, t, n) => {
|
|
23
|
+
}, p = (e, t, n, r) => `M ${e} ${t}Q ${e + r} ${t + n / 2}, ${e} ${t + n}Q ${e + n / 2} ${t + n - r}, ${e + n} ${t + n}Q ${e + n - r} ${t + n / 2}, ${e + n} ${t}Q ${e + n / 2} ${t + r}, ${e} ${t}Z`, m = .15, h = .1, g = .7, _ = 4, v = (e, t, n) => {
|
|
24
|
+
let r = n * m, i = n * h, a = n - r * 2, o = `M${e},${t + r}h${n}v${a}h${-n}Z`, s = n * g, c = e + (n - s) / 2, l = (s - i) / (_ - 1);
|
|
25
|
+
return o + Array.from({ length: _ }, (e, a) => {
|
|
26
|
+
let o = c + l * a;
|
|
27
|
+
return `M${o},${t}h${i}v${r}h${-i}ZM${o},${t + n - r}h${i}v${r}h${-i}Z`;
|
|
28
|
+
}).join("");
|
|
29
|
+
}, y = (e, t, n) => {
|
|
24
30
|
let r = n / 8;
|
|
25
31
|
return `M ${e + n} ${t + r * 3}
|
|
26
32
|
V ${t + r}
|
|
@@ -52,7 +58,7 @@ var d = (e) => {
|
|
|
52
58
|
V ${t + r * 3}
|
|
53
59
|
h ${r}
|
|
54
60
|
Z`;
|
|
55
|
-
},
|
|
61
|
+
}, b = (e, t, n) => {
|
|
56
62
|
let r = !1, i = 0;
|
|
57
63
|
return [
|
|
58
64
|
"M",
|
|
@@ -166,12 +172,12 @@ var d = (e) => {
|
|
|
166
172
|
.3262506,
|
|
167
173
|
"z"
|
|
168
174
|
].map((a) => typeof a == "string" ? (i = 0, r = a.toUpperCase() == a, a) : (i++, a *= n, r && (a += i % 2 == 1 ? e : t), u(a))).join(" ");
|
|
169
|
-
},
|
|
175
|
+
}, x = { "data-testid": "background" }, ee = ({ background: e, bgGradientId: t, numCells: n }) => {
|
|
170
176
|
if (!e) return null;
|
|
171
177
|
if (typeof e == "string") return /* @__PURE__ */ s("path", {
|
|
172
178
|
fill: e,
|
|
173
179
|
d: `M0,0 h${n}v${n}H0z`,
|
|
174
|
-
...
|
|
180
|
+
...x
|
|
175
181
|
});
|
|
176
182
|
let r = d(e?.rotation || 0);
|
|
177
183
|
return /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s("defs", { children: e.type === "linear" ? /* @__PURE__ */ s("linearGradient", {
|
|
@@ -195,17 +201,17 @@ var d = (e) => {
|
|
|
195
201
|
}) }), /* @__PURE__ */ s("path", {
|
|
196
202
|
fill: `url(#${t})`,
|
|
197
203
|
d: `M0,0 h${n}v${n}H0z`,
|
|
198
|
-
...
|
|
204
|
+
...x
|
|
199
205
|
})] });
|
|
200
|
-
},
|
|
206
|
+
}, S;
|
|
201
207
|
(function(e) {
|
|
202
208
|
class t {
|
|
203
209
|
static encodeText(e, n) {
|
|
204
|
-
let r =
|
|
210
|
+
let r = S.QrSegment.makeSegments(e);
|
|
205
211
|
return t.encodeSegments(r, n);
|
|
206
212
|
}
|
|
207
213
|
static encodeBinary(e, n) {
|
|
208
|
-
let r =
|
|
214
|
+
let r = S.QrSegment.makeBytes(e);
|
|
209
215
|
return t.encodeSegments([r], n);
|
|
210
216
|
}
|
|
211
217
|
static encodeSegments(e, r, o = 1, s = 40, c = -1, l = !0) {
|
|
@@ -399,7 +405,7 @@ var d = (e) => {
|
|
|
399
405
|
i == this.modules[n][r + 1] && i == this.modules[n + 1][r] && i == this.modules[n + 1][r + 1] && (e += t.PENALTY_N2);
|
|
400
406
|
}
|
|
401
407
|
let n = 0;
|
|
402
|
-
for (let e of this.modules) n = e.reduce((e, t) => e +
|
|
408
|
+
for (let e of this.modules) n = e.reduce((e, t) => e + +!!t, n);
|
|
403
409
|
let r = this.size * this.size, a = Math.ceil(Math.abs(n * 20 - r * 10) / r) - 1;
|
|
404
410
|
return i(0 <= a && a <= 9), e += a * t.PENALTY_N4, i(0 <= e && e <= 2568888), e;
|
|
405
411
|
}
|
|
@@ -918,7 +924,7 @@ var d = (e) => {
|
|
|
918
924
|
}
|
|
919
925
|
}
|
|
920
926
|
e.QrSegment = a;
|
|
921
|
-
})(
|
|
927
|
+
})(S ||= {}), (function(e) {
|
|
922
928
|
let t;
|
|
923
929
|
(function(e) {
|
|
924
930
|
class t {
|
|
@@ -940,7 +946,7 @@ var d = (e) => {
|
|
|
940
946
|
}
|
|
941
947
|
e.Ecc = t;
|
|
942
948
|
})(t ||= e.QrCode ||= {});
|
|
943
|
-
})(
|
|
949
|
+
})(S ||= {}), (function(e) {
|
|
944
950
|
let t;
|
|
945
951
|
(function(e) {
|
|
946
952
|
class t {
|
|
@@ -988,13 +994,13 @@ var d = (e) => {
|
|
|
988
994
|
}
|
|
989
995
|
e.Mode = t;
|
|
990
996
|
})(t ||= e.QrSegment ||= {});
|
|
991
|
-
})(
|
|
992
|
-
var
|
|
993
|
-
L:
|
|
994
|
-
M:
|
|
995
|
-
Q:
|
|
996
|
-
H:
|
|
997
|
-
},
|
|
997
|
+
})(S ||= {});
|
|
998
|
+
var C = S, w = {
|
|
999
|
+
L: C.QrCode.Ecc.LOW,
|
|
1000
|
+
M: C.QrCode.Ecc.MEDIUM,
|
|
1001
|
+
Q: C.QrCode.Ecc.QUARTILE,
|
|
1002
|
+
H: C.QrCode.Ecc.HIGH
|
|
1003
|
+
}, T = .5, E = .5, te = "react-qr-code", D = "react-qr-code-gradient", O = "react-qr-code-bg-gradient", ne = .1, k = [
|
|
998
1004
|
[
|
|
999
1005
|
1,
|
|
1000
1006
|
1,
|
|
@@ -1058,7 +1064,7 @@ var y = v, b = {
|
|
|
1058
1064
|
1,
|
|
1059
1065
|
1
|
|
1060
1066
|
]
|
|
1061
|
-
],
|
|
1067
|
+
], A = {
|
|
1062
1068
|
"inpoint-sm": [
|
|
1063
1069
|
0,
|
|
1064
1070
|
90,
|
|
@@ -1104,7 +1110,7 @@ var y = v, b = {
|
|
|
1104
1110
|
90,
|
|
1105
1111
|
-90
|
|
1106
1112
|
]
|
|
1107
|
-
},
|
|
1113
|
+
}, j = {
|
|
1108
1114
|
"rounded-sm": 3,
|
|
1109
1115
|
rounded: 4,
|
|
1110
1116
|
"rounded-lg": 5,
|
|
@@ -1117,7 +1123,7 @@ var y = v, b = {
|
|
|
1117
1123
|
"outpoint-sm": 3,
|
|
1118
1124
|
outpoint: 4,
|
|
1119
1125
|
"outpoint-lg": 5
|
|
1120
|
-
},
|
|
1126
|
+
}, M = {
|
|
1121
1127
|
square: 0,
|
|
1122
1128
|
diamond: 0,
|
|
1123
1129
|
circle: 3,
|
|
@@ -1133,7 +1139,7 @@ var y = v, b = {
|
|
|
1133
1139
|
"outpoint-sm": 1.5,
|
|
1134
1140
|
outpoint: 2,
|
|
1135
1141
|
"outpoint-lg": 2.3
|
|
1136
|
-
},
|
|
1142
|
+
}, N = [
|
|
1137
1143
|
[
|
|
1138
1144
|
0,
|
|
1139
1145
|
0,
|
|
@@ -1197,7 +1203,22 @@ var y = v, b = {
|
|
|
1197
1203
|
0,
|
|
1198
1204
|
0
|
|
1199
1205
|
]
|
|
1200
|
-
],
|
|
1206
|
+
], P = ({ x: e, y: t, numCells: n }) => !!(N[e]?.[t] || N[e - n + 7]?.[t] || N[e]?.[t - n + 7]), re = ({ x: e, y: t, radius: n }) => {
|
|
1207
|
+
let r = 3 - n, i = n / 2, a = 3 - i;
|
|
1208
|
+
return `M ${e} ${t + i}v ${r}a ${i} ${i}, 0, 0, 0, ${i} ${i}h ${a}v ${-a}a ${i} ${i}, 0, 0, 0, ${-i} ${-i}h ${-r}H ${e}z`;
|
|
1209
|
+
}, F = ({ x: e, y: t, radius: n }) => {
|
|
1210
|
+
let r = 3 - n, i = n / 2, a = 3 - i;
|
|
1211
|
+
return `M ${e} ${t + i}v ${r}a ${i} ${i}, 0, 0, 0, ${i} ${i}h ${a}v ${-a}a ${i} ${i}, 0, 0, 0, ${-i} ${-i}h ${-r}a ${i} ${i}, 0, 0, 0, ${-i} ${i}`;
|
|
1212
|
+
}, I = ({ x: e, y: t, numCells: n }) => !!(k[e]?.[t] || k[e - n + 7]?.[t] || k[e]?.[t - n + 7]), ie = ({ x: e, y: t, radius: n }) => {
|
|
1213
|
+
let r = 7 - n, i = n / 2;
|
|
1214
|
+
return `M ${e} ${t + i}v ${r}a ${i} ${i}, 0, 0, 0, ${i} ${i}h ${r}a ${i} ${i}, 0, 0, 0, ${i} ${-i}v ${-r}a ${i} ${i}, 0, 0, 0, ${-i} ${-i}h ${-r}a ${i} ${i}, 0, 0, 0, ${-i} ${i}M ${e + i} ${t + 1}h ${r}a ${i - 1} ${i - 1}, 0, 0, 1, ${i - 1} ${i - 1}v ${r}a ${i - 1} ${i - 1}, 0, 0, 1, ${-(i - 1)} ${i - 1}h ${-r}a ${i - 1} ${i - 1}, 0, 0, 1, ${-(i - 1)} ${-(i - 1)}v ${-r}a ${i - 1} ${i - 1}, 0, 0, 1, ${i - 1} ${-(i - 1)}`;
|
|
1215
|
+
}, ae = ({ x: e, y: t, radius: n }) => {
|
|
1216
|
+
let r = 7 - n, i = n / 2, a = 7 - i;
|
|
1217
|
+
return `M ${e} ${t + i}v ${r}a ${i} ${i}, 0, 0, 0, ${i} ${i}h ${a}v ${-a}a ${i} ${i}, 0, 0, 0, ${-i} ${-i}h ${-r}H ${e}zM ${e + i} ${t + 1}h ${r}a ${i - 1} ${i - 1}, 0, 0, 1, ${i - 1} ${i - 1}v ${a - 1}h ${-(a - 1)}a ${i - 1} ${i - 1}, 0, 0, 1, ${-(i - 1)} ${-(i - 1)}v ${-(a - 1)}z`;
|
|
1218
|
+
}, oe = ({ x: e, y: t, radius: n }) => {
|
|
1219
|
+
let r = 7 - n, i = n / 2, a = 7 - i;
|
|
1220
|
+
return `M ${e} ${t + i}v ${r}a ${i} ${i}, 0, 0, 0, ${i} ${i}h ${a}v ${-a}a ${i} ${i}, 0, 0, 0, ${-i} ${-i}h ${-r}a ${i} ${i}, 0, 0, 0, ${-i} ${i}M ${e + i} ${t + 1}h ${r}a ${i - 1} ${i - 1}, 0, 0, 1, ${i - 1} ${i - 1}v ${a - 1}h ${-(a - 1)}a ${i - 1} ${i - 1}, 0, 0, 1, ${-(i - 1)} ${-(i - 1)}v ${-r}a ${i - 1} ${i - 1}, 0, 0, 1, ${i - 1} ${-(i - 1)}`;
|
|
1221
|
+
}, L = (e) => e === "square" || e === "pinched-square" || e === "circle" || e === "star" || e === "heart" || e === "diamond" || e === "hashtag", se = (e, t, n = 1) => e === "square-sm" ? .75 : t ? Math.random() * .25 + .75 : L(e) ? n : 1, R = (e, t, n) => {
|
|
1201
1222
|
let r = {
|
|
1202
1223
|
left: e === 0 ? !1 : n[t][e - 1],
|
|
1203
1224
|
right: e === n[t].length - 1 ? !1 : n[t][e + 1],
|
|
@@ -1208,110 +1229,148 @@ var y = v, b = {
|
|
|
1208
1229
|
...r,
|
|
1209
1230
|
count: Object.values(r).filter(Boolean).length
|
|
1210
1231
|
};
|
|
1211
|
-
},
|
|
1232
|
+
}, z = ({ x: e, y: t, modules: n, numCells: r }) => t >= 0 && t < n.length && e >= 0 && e < n[t].length && n[t][e] && !I({
|
|
1233
|
+
x: e,
|
|
1234
|
+
y: t,
|
|
1235
|
+
numCells: r
|
|
1236
|
+
}) && !P({
|
|
1237
|
+
x: e,
|
|
1238
|
+
y: t,
|
|
1239
|
+
numCells: r
|
|
1240
|
+
}), ce = (e, t, n, r) => {
|
|
1241
|
+
let i = {
|
|
1242
|
+
left: z({
|
|
1243
|
+
x: e - 1,
|
|
1244
|
+
y: t,
|
|
1245
|
+
modules: n,
|
|
1246
|
+
numCells: r
|
|
1247
|
+
}),
|
|
1248
|
+
right: z({
|
|
1249
|
+
x: e + 1,
|
|
1250
|
+
y: t,
|
|
1251
|
+
modules: n,
|
|
1252
|
+
numCells: r
|
|
1253
|
+
}),
|
|
1254
|
+
top: z({
|
|
1255
|
+
x: e,
|
|
1256
|
+
y: t - 1,
|
|
1257
|
+
modules: n,
|
|
1258
|
+
numCells: r
|
|
1259
|
+
}),
|
|
1260
|
+
bottom: z({
|
|
1261
|
+
x: e,
|
|
1262
|
+
y: t + 1,
|
|
1263
|
+
modules: n,
|
|
1264
|
+
numCells: r
|
|
1265
|
+
})
|
|
1266
|
+
};
|
|
1267
|
+
return {
|
|
1268
|
+
...i,
|
|
1269
|
+
count: Object.values(i).filter(Boolean).length
|
|
1270
|
+
};
|
|
1271
|
+
}, B = (e, t, n, r) => `M${e},${t}h${n}v${r}h${-n}Z`, V = (e, t, n) => B(e, t, n, n), H = (e, t, n) => `M${e},${t + n / 2}a${n / 2},${n / 2} 0 1,0 ${n},0a${n / 2},${n / 2} 0 1,0 -${n},0Z`, le = (e, t, n) => `M${e},${t + n / 2}l${n / 2},-${n / 2}l${n / 2},${n / 2}l-${n / 2},${n / 2}Z`, U = (e, t, n) => `M${e - n},${t}a${n},${n} 0 1,1 ${n * 2},0a${n},${n} 0 1,1 ${-n * 2},0Z`, ue = ({ count: e }) => e === 1, de = (e, t) => `M ${e} ${t}
|
|
1212
1272
|
v 1
|
|
1213
1273
|
h 1
|
|
1214
1274
|
v -0.5
|
|
1215
|
-
a 0.5 0.5, 0, 0, 0, -0.5 -0.5`,
|
|
1275
|
+
a 0.5 0.5, 0, 0, 0, -0.5 -0.5`, W = (e, t) => `M ${e + 1} ${t}
|
|
1216
1276
|
v 1
|
|
1217
1277
|
h -1
|
|
1218
1278
|
v -0.5
|
|
1219
|
-
a 0.5 0.5, 0, 0, 1, 0.5 -0.5`,
|
|
1279
|
+
a 0.5 0.5, 0, 0, 1, 0.5 -0.5`, G = (e, t) => `M ${e} ${t}
|
|
1220
1280
|
v 1
|
|
1221
1281
|
h 0.5
|
|
1222
1282
|
a 0.5 0.5, 0, 0, 0, 0.5 -0.5
|
|
1223
1283
|
v -0.5
|
|
1224
|
-
h -1`,
|
|
1284
|
+
h -1`, K = (e, t) => `M ${e + 1} ${t}
|
|
1225
1285
|
v 1
|
|
1226
1286
|
h -0.5
|
|
1227
1287
|
a 0.5 0.5, 0, 0, 1, -0.5 -0.5
|
|
1228
1288
|
v -0.5
|
|
1229
|
-
h 1`,
|
|
1289
|
+
h 1`, q = (e, t) => `M ${e} ${t}
|
|
1230
1290
|
v 1
|
|
1231
1291
|
h 0.5
|
|
1232
|
-
a 0.5 0.5, 0, 0, 0, 0 -1`,
|
|
1292
|
+
a 0.5 0.5, 0, 0, 0, 0 -1`, J = (e, t) => `M ${e + 1} ${t}
|
|
1233
1293
|
v 1
|
|
1234
1294
|
h -0.5
|
|
1235
|
-
a 0.5 0.5, 0, 0, 1, 0 -1`,
|
|
1295
|
+
a 0.5 0.5, 0, 0, 1, 0 -1`, Y = (e, t) => `M ${e} ${t + 1}
|
|
1236
1296
|
h 1
|
|
1237
1297
|
v -0.5
|
|
1238
|
-
a 0.5 0.5, 0, 0, 0, -1 0`,
|
|
1298
|
+
a 0.5 0.5, 0, 0, 0, -1 0`, X = (e, t) => `M ${e} ${t}
|
|
1239
1299
|
h 1
|
|
1240
1300
|
v 0.5
|
|
1241
|
-
a 0.5 0.5, 0, 0, 1, -1 0`,
|
|
1242
|
-
let r = 3 - n, i = n / 2, a = 3 - i;
|
|
1243
|
-
return `M ${e} ${t + i}v ${r}a ${i} ${i}, 0, 0, 0, ${i} ${i}h ${a}v ${-a}a ${i} ${i}, 0, 0, 0, ${-i} ${-i}h ${-r}H ${e}z`;
|
|
1244
|
-
}, U = ({ x: e, y: t, radius: n }) => {
|
|
1245
|
-
let r = 3 - n, i = n / 2, a = 3 - i;
|
|
1246
|
-
return `M ${e} ${t + i}v ${r}a ${i} ${i}, 0, 0, 0, ${i} ${i}h ${a}v ${-a}a ${i} ${i}, 0, 0, 0, ${-i} ${-i}h ${-r}a ${i} ${i}, 0, 0, 0, ${-i} ${i}`;
|
|
1247
|
-
}, W = ({ x: e, y: t, numCells: n }) => !!(T[e]?.[t] || T[e - n + 7]?.[t] || T[e]?.[t - n + 7]), G = ({ x: e, y: t, radius: n }) => {
|
|
1248
|
-
let r = 7 - n, i = n / 2;
|
|
1249
|
-
return `M ${e} ${t + i}v ${r}a ${i} ${i}, 0, 0, 0, ${i} ${i}h ${r}a ${i} ${i}, 0, 0, 0, ${i} ${-i}v ${-r}a ${i} ${i}, 0, 0, 0, ${-i} ${-i}h ${-r}a ${i} ${i}, 0, 0, 0, ${-i} ${i}M ${e + i} ${t + 1}h ${r}a ${i - 1} ${i - 1}, 0, 0, 1, ${i - 1} ${i - 1}v ${r}a ${i - 1} ${i - 1}, 0, 0, 1, ${-(i - 1)} ${i - 1}h ${-r}a ${i - 1} ${i - 1}, 0, 0, 1, ${-(i - 1)} ${-(i - 1)}v ${-r}a ${i - 1} ${i - 1}, 0, 0, 1, ${i - 1} ${-(i - 1)}`;
|
|
1250
|
-
}, K = ({ x: e, y: t, radius: n }) => {
|
|
1251
|
-
let r = 7 - n, i = n / 2, a = 7 - i;
|
|
1252
|
-
return `M ${e} ${t + i}v ${r}a ${i} ${i}, 0, 0, 0, ${i} ${i}h ${a}v ${-a}a ${i} ${i}, 0, 0, 0, ${-i} ${-i}h ${-r}H ${e}zM ${e + i} ${t + 1}h ${r}a ${i - 1} ${i - 1}, 0, 0, 1, ${i - 1} ${i - 1}v ${a - 1}h ${-(a - 1)}a ${i - 1} ${i - 1}, 0, 0, 1, ${-(i - 1)} ${-(i - 1)}v ${-(a - 1)}z`;
|
|
1253
|
-
}, q = ({ x: e, y: t, radius: n }) => {
|
|
1254
|
-
let r = 7 - n, i = n / 2, a = 7 - i;
|
|
1255
|
-
return `M ${e} ${t + i}v ${r}a ${i} ${i}, 0, 0, 0, ${i} ${i}h ${a}v ${-a}a ${i} ${i}, 0, 0, 0, ${-i} ${-i}h ${-r}a ${i} ${i}, 0, 0, 0, ${-i} ${i}M ${e + i} ${t + 1}h ${r}a ${i - 1} ${i - 1}, 0, 0, 1, ${i - 1} ${i - 1}v ${a - 1}h ${-(a - 1)}a ${i - 1} ${i - 1}, 0, 0, 1, ${-(i - 1)} ${-(i - 1)}v ${-r}a ${i - 1} ${i - 1}, 0, 0, 1, ${i - 1} ${-(i - 1)}`;
|
|
1256
|
-
}, J = (e) => ({
|
|
1301
|
+
a 0.5 0.5, 0, 0, 1, -1 0`, fe = (e, t, n) => `M ${e + 1} ${t}h -${n / 2}a ${n / 2.5} ${n / 2.5}, 0, 0, 0, ${-n / 2.5} ${n / 2.5}v ${n / 2}h ${n / 2}a ${n / 2.5} ${n / 2.5}, 0, 0, 0, ${n / 2.5} ${-n / 2.5}`, pe = (e) => ({
|
|
1257
1302
|
color: e?.color || "#000000",
|
|
1258
1303
|
style: e?.style || "square",
|
|
1259
|
-
randomSize: e?.randomSize || !1
|
|
1260
|
-
|
|
1304
|
+
randomSize: e?.randomSize || !1,
|
|
1305
|
+
size: e?.size ?? 1
|
|
1306
|
+
}), me = (e) => ({
|
|
1261
1307
|
color: e?.color || "#000000",
|
|
1262
1308
|
style: e?.style || "square"
|
|
1263
|
-
}),
|
|
1309
|
+
}), he = (e) => ({
|
|
1264
1310
|
color: e?.color || "#000000",
|
|
1265
1311
|
style: e?.style || "square"
|
|
1266
|
-
}),
|
|
1267
|
-
let { color: c, style: l, randomSize: u } = i(() =>
|
|
1312
|
+
}), ge = ({ modules: e, margin: n, settings: r, gradient: a, gradientId: o }) => {
|
|
1313
|
+
let { color: c, style: l, randomSize: u, size: d } = i(() => pe(r), [r]), m = [], h = e.length, g = L(l) && u, _ = t(() => se(l, g, d), [
|
|
1314
|
+
l,
|
|
1315
|
+
g,
|
|
1316
|
+
d
|
|
1317
|
+
]);
|
|
1268
1318
|
return e.forEach((t, r) => {
|
|
1269
1319
|
t.forEach((t, i) => {
|
|
1270
|
-
if (
|
|
1320
|
+
if (I({
|
|
1271
1321
|
x: i,
|
|
1272
1322
|
y: r,
|
|
1273
|
-
numCells:
|
|
1274
|
-
}) ||
|
|
1323
|
+
numCells: h
|
|
1324
|
+
}) || P({
|
|
1275
1325
|
x: i,
|
|
1276
1326
|
y: r,
|
|
1277
|
-
numCells:
|
|
1327
|
+
numCells: h
|
|
1278
1328
|
})) return;
|
|
1279
|
-
let a =
|
|
1329
|
+
let a = _(), o = 1 * a, s = (1 - 1 * a) / 2, c = i + n + s, u = r + n + s;
|
|
1280
1330
|
if (t) {
|
|
1281
|
-
if (l === "
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1331
|
+
if (l === "circuit-board") {
|
|
1332
|
+
let t = i + n + .5, a = r + n + .5, o = T / 2, s = 1 + T, c = ce(i, r, e, h), { right: l, bottom: u, count: d } = c;
|
|
1333
|
+
if (l && m.push(B(t - o, a - o, s, T)), u && m.push(B(t - o, a - o, T, s)), d === 0) {
|
|
1334
|
+
let e = .75, t = (1 - e) / 2;
|
|
1335
|
+
m.push(V(i + n + t, r + n + t, e));
|
|
1336
|
+
} else ue({
|
|
1337
|
+
...c,
|
|
1338
|
+
count: d
|
|
1339
|
+
}) && m.push(U(t, a, E));
|
|
1340
|
+
} else if (l === "square" || l === "square-sm") m.push(V(c, u, o));
|
|
1341
|
+
else if (l === "pinched-square") m.push(p(c, u, o, .25));
|
|
1342
|
+
else if (l === "circle") m.push(H(c, u, o));
|
|
1343
|
+
else if (l === "diamond") m.push(le(c, u, o));
|
|
1344
|
+
else if (l === "star") m.push(f(c + o / 2, u + o / 2, o * 1.1, 5));
|
|
1345
|
+
else if (l === "heart") m.push(b(c, u, o));
|
|
1346
|
+
else if (l === "hashtag") m.push(y(c, u, o));
|
|
1288
1347
|
else if (l === "rounded") {
|
|
1289
|
-
let { left: t, right: n, top: a, bottom: o, count: s } =
|
|
1290
|
-
s === 0 ?
|
|
1348
|
+
let { left: t, right: n, top: a, bottom: o, count: s } = R(i, r, e);
|
|
1349
|
+
s === 0 ? m.push(H(c, u, 1)) : s > 2 || t && n || a && o ? m.push(V(c, u, 1)) : s === 2 ? t && a ? m.push(G(c, u)) : a && n ? m.push(K(c, u)) : n && o ? m.push(W(c, u)) : m.push(de(c, u)) : a ? m.push(X(c, u)) : n ? m.push(J(c, u)) : o ? m.push(Y(c, u)) : m.push(q(c, u));
|
|
1291
1350
|
} else if (l === "leaf") {
|
|
1292
|
-
let { left: t, right: n, top: a, bottom: s, count: l } =
|
|
1293
|
-
if (l === 0)
|
|
1351
|
+
let { left: t, right: n, top: a, bottom: s, count: l } = R(i, r, e);
|
|
1352
|
+
if (l === 0) m.push(fe(c, u, o));
|
|
1294
1353
|
else if (!t && !a) {
|
|
1295
|
-
|
|
1354
|
+
m.push(W(c, u));
|
|
1296
1355
|
return;
|
|
1297
|
-
} else !n && !s ?
|
|
1356
|
+
} else !n && !s ? m.push(G(c, u)) : m.push(V(c, u, 1));
|
|
1298
1357
|
} else if (l === "vertical-line") {
|
|
1299
|
-
let { left: t, right: n, top: a, bottom: o, count: s } =
|
|
1300
|
-
s === 0 || t && !(a || o) || n && !(a || o) ?
|
|
1358
|
+
let { left: t, right: n, top: a, bottom: o, count: s } = R(i, r, e);
|
|
1359
|
+
s === 0 || t && !(a || o) || n && !(a || o) ? m.push(H(c, u, 1)) : a && o ? m.push(V(c, u, 1)) : a && !o ? m.push(X(c, u)) : o && !a && m.push(Y(c, u));
|
|
1301
1360
|
} else if (l === "horizontal-line") {
|
|
1302
|
-
let { left: t, right: n, top: a, bottom: o, count: s } =
|
|
1303
|
-
s === 0 || a && !(t || n) || o && !(t || n) ?
|
|
1361
|
+
let { left: t, right: n, top: a, bottom: o, count: s } = R(i, r, e);
|
|
1362
|
+
s === 0 || a && !(t || n) || o && !(t || n) ? m.push(H(c, u, 1)) : t && n ? m.push(V(c, u, 1)) : t && !n ? m.push(q(c, u)) : n && !t && m.push(J(c, u));
|
|
1304
1363
|
}
|
|
1305
1364
|
}
|
|
1306
1365
|
});
|
|
1307
1366
|
}), /* @__PURE__ */ s("path", {
|
|
1308
1367
|
fill: a ? `url(#${o})` : c,
|
|
1309
|
-
d:
|
|
1368
|
+
d: m.join(""),
|
|
1310
1369
|
shapeRendering: l === "square" ? "crispEdges" : "geometricPrecision",
|
|
1311
1370
|
"data-testid": "data-modules"
|
|
1312
1371
|
});
|
|
1313
|
-
},
|
|
1314
|
-
let { color: o, style: c } = i(() =>
|
|
1372
|
+
}, Z = { "data-testid": "finder-patterns-inner" }, _e = ({ modules: e, margin: t, settings: n, gradient: r, gradientId: a }) => {
|
|
1373
|
+
let { color: o, style: c } = i(() => he(n), [n]), l = r ? `url(#${a})` : o, u = i(() => [
|
|
1315
1374
|
{
|
|
1316
1375
|
x: t + 2,
|
|
1317
1376
|
y: t + 2
|
|
@@ -1333,8 +1392,8 @@ var y = v, b = {
|
|
|
1333
1392
|
width: 3,
|
|
1334
1393
|
height: 3,
|
|
1335
1394
|
fill: l,
|
|
1336
|
-
rx:
|
|
1337
|
-
...
|
|
1395
|
+
rx: M[c],
|
|
1396
|
+
...Z
|
|
1338
1397
|
}, d(t, n));
|
|
1339
1398
|
});
|
|
1340
1399
|
if (c === "pinched-square") return u.map((e) => {
|
|
@@ -1342,7 +1401,7 @@ var y = v, b = {
|
|
|
1342
1401
|
return /* @__PURE__ */ s("path", {
|
|
1343
1402
|
fill: l,
|
|
1344
1403
|
d: p(t, n, 3, .25),
|
|
1345
|
-
...
|
|
1404
|
+
...Z
|
|
1346
1405
|
}, d(t, n));
|
|
1347
1406
|
});
|
|
1348
1407
|
if (c === "diamond") return u.map((e) => {
|
|
@@ -1358,46 +1417,51 @@ var y = v, b = {
|
|
|
1358
1417
|
transformOrigin: "center",
|
|
1359
1418
|
transformBox: "fill-box"
|
|
1360
1419
|
},
|
|
1361
|
-
...
|
|
1420
|
+
...Z
|
|
1362
1421
|
}, d(t, n));
|
|
1363
1422
|
});
|
|
1364
1423
|
if (c === "inpoint-sm" || c === "inpoint" || c === "inpoint-lg" || c === "outpoint-sm" || c === "outpoint" || c === "outpoint-lg" || c === "leaf-sm" || c === "leaf" || c === "leaf-lg") {
|
|
1365
|
-
let e = c === "leaf-sm" || c === "leaf" || c === "leaf-lg" ?
|
|
1424
|
+
let e = c === "leaf-sm" || c === "leaf" || c === "leaf-lg" ? re : F;
|
|
1366
1425
|
return u.map((e, t) => ({
|
|
1367
1426
|
...e,
|
|
1368
|
-
rotation:
|
|
1427
|
+
rotation: A[c][t]
|
|
1369
1428
|
})).map(({ x: t, y: n, rotation: r }) => /* @__PURE__ */ s("path", {
|
|
1370
1429
|
fill: l,
|
|
1371
1430
|
d: e({
|
|
1372
1431
|
x: t,
|
|
1373
1432
|
y: n,
|
|
1374
|
-
radius:
|
|
1433
|
+
radius: M[c]
|
|
1375
1434
|
}),
|
|
1376
1435
|
style: {
|
|
1377
1436
|
transform: `rotate(${r}deg)`,
|
|
1378
1437
|
transformOrigin: "center",
|
|
1379
1438
|
transformBox: "fill-box"
|
|
1380
1439
|
},
|
|
1381
|
-
...
|
|
1440
|
+
...Z
|
|
1382
1441
|
}, d(t, n)));
|
|
1383
1442
|
}
|
|
1384
1443
|
if (c === "heart") return u.map(({ x: e, y: t }) => /* @__PURE__ */ s("path", {
|
|
1385
1444
|
fill: l,
|
|
1386
|
-
d:
|
|
1387
|
-
...
|
|
1445
|
+
d: b(e, t, 3),
|
|
1446
|
+
...Z
|
|
1388
1447
|
}, d(e, t)));
|
|
1389
1448
|
if (c === "star") return u.map(({ x: e, y: t }) => /* @__PURE__ */ s("path", {
|
|
1390
1449
|
fill: l,
|
|
1391
1450
|
d: f(e + 3 / 2, t + 3 / 2, 3 * 1.2, 5),
|
|
1392
|
-
...
|
|
1451
|
+
...Z
|
|
1452
|
+
}, d(e, t)));
|
|
1453
|
+
if (c === "microchip") return u.map(({ x: e, y: t }) => /* @__PURE__ */ s("path", {
|
|
1454
|
+
fill: l,
|
|
1455
|
+
d: v(e, t, 3),
|
|
1456
|
+
...Z
|
|
1393
1457
|
}, d(e, t)));
|
|
1394
1458
|
if (c === "hashtag") return u.map(({ x: e, y: t }) => /* @__PURE__ */ s("path", {
|
|
1395
1459
|
fill: l,
|
|
1396
|
-
d:
|
|
1397
|
-
...
|
|
1460
|
+
d: y(e - .25, t - .25, 3.5),
|
|
1461
|
+
...Z
|
|
1398
1462
|
}, d(e, t)));
|
|
1399
|
-
},
|
|
1400
|
-
let { style: o, color: c } = i(() =>
|
|
1463
|
+
}, Q = { "data-testid": "finder-patterns-outer" }, ve = ({ modules: e, margin: t, settings: n, gradient: r, gradientId: a }) => {
|
|
1464
|
+
let { style: o, color: c } = i(() => me(n), [n]), l = r ? `url(#${a})` : c, u = [], d = i(() => [
|
|
1401
1465
|
{
|
|
1402
1466
|
x: t,
|
|
1403
1467
|
y: t
|
|
@@ -1421,10 +1485,10 @@ var y = v, b = {
|
|
|
1421
1485
|
].includes(o)) {
|
|
1422
1486
|
for (let e of d) {
|
|
1423
1487
|
let { x: t, y: n } = e;
|
|
1424
|
-
if (o === "rounded-sm" || o === "rounded" || o === "rounded-lg") u.push(
|
|
1488
|
+
if (o === "rounded-sm" || o === "rounded" || o === "rounded-lg") u.push(ie({
|
|
1425
1489
|
x: t,
|
|
1426
1490
|
y: n,
|
|
1427
|
-
radius:
|
|
1491
|
+
radius: j[o]
|
|
1428
1492
|
}));
|
|
1429
1493
|
else if (o === "circle") u.push(`M ${t + 7 / 2} ${n}a ${7 / 2} ${7 / 2} 0 1 0 0.01 0zzm 0 1a ${7 / 2 - 1} ${7 / 2 - 1} 0 1 1 -0.01 0Z`);
|
|
1430
1494
|
else if (o === "pinched-square") {
|
|
@@ -1435,30 +1499,30 @@ var y = v, b = {
|
|
|
1435
1499
|
return /* @__PURE__ */ s("path", {
|
|
1436
1500
|
fill: l,
|
|
1437
1501
|
d: u.join(""),
|
|
1438
|
-
...
|
|
1502
|
+
...Q
|
|
1439
1503
|
});
|
|
1440
1504
|
}
|
|
1441
1505
|
if (o === "inpoint-sm" || o === "inpoint" || o === "inpoint-lg" || o === "outpoint-sm" || o === "outpoint" || o === "outpoint-lg" || o === "leaf-sm" || o === "leaf" || o === "leaf-lg") {
|
|
1442
|
-
let e = o === "leaf-sm" || o === "leaf" || o === "leaf-lg" ?
|
|
1506
|
+
let e = o === "leaf-sm" || o === "leaf" || o === "leaf-lg" ? ae : oe;
|
|
1443
1507
|
return d.map((e, t) => ({
|
|
1444
1508
|
...e,
|
|
1445
|
-
rotation:
|
|
1509
|
+
rotation: A[o][t]
|
|
1446
1510
|
})).map(({ x: t, y: n, rotation: r }) => /* @__PURE__ */ s("path", {
|
|
1447
1511
|
fill: l,
|
|
1448
1512
|
d: e({
|
|
1449
1513
|
x: t,
|
|
1450
1514
|
y: n,
|
|
1451
|
-
radius:
|
|
1515
|
+
radius: j[o]
|
|
1452
1516
|
}),
|
|
1453
1517
|
style: {
|
|
1454
1518
|
transform: `rotate(${r}deg)`,
|
|
1455
1519
|
transformOrigin: "center",
|
|
1456
1520
|
transformBox: "fill-box"
|
|
1457
1521
|
},
|
|
1458
|
-
...
|
|
1522
|
+
...Q
|
|
1459
1523
|
}, `finder-patterns-outer-${o}-${t}-${n}`));
|
|
1460
1524
|
}
|
|
1461
|
-
},
|
|
1525
|
+
}, ye = ({ gradient: e, gradientId: t }) => {
|
|
1462
1526
|
if (!e) return null;
|
|
1463
1527
|
let n = d(e?.rotation || 0);
|
|
1464
1528
|
return /* @__PURE__ */ s("defs", { children: e.type === "linear" ? /* @__PURE__ */ s("linearGradient", {
|
|
@@ -1480,15 +1544,15 @@ var y = v, b = {
|
|
|
1480
1544
|
stopColor: e.color
|
|
1481
1545
|
}, t))
|
|
1482
1546
|
}) });
|
|
1483
|
-
},
|
|
1547
|
+
}, be = () => {
|
|
1484
1548
|
let e = n();
|
|
1485
1549
|
return {
|
|
1486
|
-
gradientId: `${
|
|
1487
|
-
bgGradientId: `${
|
|
1550
|
+
gradientId: `${D}-${e}`,
|
|
1551
|
+
bgGradientId: `${O}-${e}`
|
|
1488
1552
|
};
|
|
1489
|
-
},
|
|
1553
|
+
}, xe = (e, t) => e.slice().map((e, n) => n < t.y || n >= t.y + t.h ? e : e.map((e, n) => n < t.x || n >= t.x + t.w ? e : !1)), Se = (e, t, n, r) => {
|
|
1490
1554
|
if (r == null) return null;
|
|
1491
|
-
let i = e.length + n * 2, a = Math.floor(t *
|
|
1555
|
+
let i = e.length + n * 2, a = Math.floor(t * ne), o = i / t, s = (r.width || a) * o, c = (r.height || a) * o, l = r.x == null ? e.length / 2 - s / 2 : r.x * o, u = r.y == null ? e.length / 2 - c / 2 : r.y * o, d = r.opacity == null ? 1 : r.opacity, f = null;
|
|
1492
1556
|
if (r.excavate) {
|
|
1493
1557
|
let e = Math.floor(l), t = Math.floor(u);
|
|
1494
1558
|
f = {
|
|
@@ -1508,22 +1572,22 @@ var y = v, b = {
|
|
|
1508
1572
|
opacity: d,
|
|
1509
1573
|
crossOrigin: p
|
|
1510
1574
|
};
|
|
1511
|
-
},
|
|
1575
|
+
}, Ce = (e) => e == null ? 4 : Math.max(Math.floor(e), 0), we = ({ value: e, level: t, minVersion: n, marginSize: r, imageSettings: a, size: o, boostLevel: s }) => {
|
|
1512
1576
|
let c = i(() => {
|
|
1513
|
-
let r = (Array.isArray(e) ? e : [e]).reduce((e, t) => (e.push(...
|
|
1514
|
-
return
|
|
1577
|
+
let r = (Array.isArray(e) ? e : [e]).reduce((e, t) => (e.push(...C.QrSegment.makeSegments(t)), e), []);
|
|
1578
|
+
return C.QrCode.encodeSegments(r, w[t], n, void 0, void 0, s);
|
|
1515
1579
|
}, [
|
|
1516
1580
|
e,
|
|
1517
1581
|
t,
|
|
1518
1582
|
n,
|
|
1519
1583
|
s
|
|
1520
1584
|
]), { cells: l, margin: u, numCells: d, calculatedImageSettings: f } = i(() => {
|
|
1521
|
-
let e = c.getModules(), t =
|
|
1585
|
+
let e = c.getModules(), t = Ce(r);
|
|
1522
1586
|
return {
|
|
1523
1587
|
cells: e,
|
|
1524
1588
|
margin: t,
|
|
1525
1589
|
numCells: e.length + t * 2,
|
|
1526
|
-
calculatedImageSettings:
|
|
1590
|
+
calculatedImageSettings: Se(e, o, t, a)
|
|
1527
1591
|
};
|
|
1528
1592
|
}, [
|
|
1529
1593
|
c,
|
|
@@ -1538,13 +1602,13 @@ var y = v, b = {
|
|
|
1538
1602
|
numCells: d,
|
|
1539
1603
|
calculatedImageSettings: f
|
|
1540
1604
|
};
|
|
1541
|
-
},
|
|
1605
|
+
}, Te = ({ svgRef: e, fileSize: t, fileName: n }) => {
|
|
1542
1606
|
if (!e.current) return;
|
|
1543
1607
|
let r = e.current.cloneNode(!0);
|
|
1544
1608
|
r.setAttribute("width", t.toString()), r.setAttribute("height", t.toString());
|
|
1545
1609
|
let i = new XMLSerializer(), a = new Blob([i.serializeToString(r)], { type: "image/svg+xml" }), o = URL.createObjectURL(a), s = document.createElement("a");
|
|
1546
1610
|
s.href = o, s.download = `${n}.svg`, document.body.appendChild(s), s.click(), document.body.removeChild(s), URL.revokeObjectURL(o);
|
|
1547
|
-
},
|
|
1611
|
+
}, Ee = ({ svgRef: e, fileSize: t, fileName: n, fileFormat: r, imageSettings: i, calculatedImageSettings: a, size: o, numCells: s, margin: c }) => {
|
|
1548
1612
|
if (!e.current) return;
|
|
1549
1613
|
let l = document.createElement("canvas"), u = l.getContext("2d");
|
|
1550
1614
|
if (!u) return;
|
|
@@ -1565,83 +1629,83 @@ var y = v, b = {
|
|
|
1565
1629
|
}
|
|
1566
1630
|
}, m.onerror = (e) => console.error("Error loading QR code:", e);
|
|
1567
1631
|
}, $ = e((e, t) => {
|
|
1568
|
-
let { value: n, size: i = 128, level: o = "M", background: l, gradient: u, minVersion: d = 1, boostLevel: f, marginSize: p, finderPatternOuterSettings: m, finderPatternInnerSettings: h, dataModulesSettings: g, imageSettings:
|
|
1632
|
+
let { value: n, size: i = 128, level: o = "M", background: l, gradient: u, minVersion: d = 1, boostLevel: f, marginSize: p, finderPatternOuterSettings: m, finderPatternInnerSettings: h, dataModulesSettings: g, imageSettings: _, svgProps: v } = e, y = a(null), { gradientId: b, bgGradientId: x } = be(), { margin: S, cells: C, numCells: w, calculatedImageSettings: T } = we({
|
|
1569
1633
|
value: n,
|
|
1570
1634
|
level: o,
|
|
1571
1635
|
minVersion: d,
|
|
1572
1636
|
boostLevel: f,
|
|
1573
1637
|
marginSize: p,
|
|
1574
|
-
imageSettings:
|
|
1638
|
+
imageSettings: _,
|
|
1575
1639
|
size: i
|
|
1576
1640
|
});
|
|
1577
1641
|
r(t, () => ({
|
|
1578
|
-
svg:
|
|
1579
|
-
download: ({ name: e =
|
|
1580
|
-
|
|
1581
|
-
svgRef:
|
|
1642
|
+
svg: y.current,
|
|
1643
|
+
download: ({ name: e = te, format: t = "svg", size: n = 500 }) => {
|
|
1644
|
+
y.current && (t === "svg" ? Te({
|
|
1645
|
+
svgRef: y,
|
|
1582
1646
|
fileSize: n,
|
|
1583
1647
|
fileName: e
|
|
1584
|
-
}) :
|
|
1585
|
-
svgRef:
|
|
1648
|
+
}) : Ee({
|
|
1649
|
+
svgRef: y,
|
|
1586
1650
|
fileSize: n,
|
|
1587
1651
|
fileName: e,
|
|
1588
1652
|
fileFormat: t,
|
|
1589
|
-
imageSettings:
|
|
1590
|
-
calculatedImageSettings:
|
|
1653
|
+
imageSettings: _,
|
|
1654
|
+
calculatedImageSettings: T,
|
|
1591
1655
|
size: i,
|
|
1592
|
-
numCells:
|
|
1593
|
-
margin:
|
|
1656
|
+
numCells: w,
|
|
1657
|
+
margin: S
|
|
1594
1658
|
}));
|
|
1595
1659
|
}
|
|
1596
1660
|
}));
|
|
1597
|
-
let
|
|
1598
|
-
|
|
1599
|
-
href:
|
|
1600
|
-
height:
|
|
1601
|
-
width:
|
|
1602
|
-
x:
|
|
1603
|
-
y:
|
|
1661
|
+
let E = C, D = null;
|
|
1662
|
+
_ != null && T != null && (T.excavation != null && (E = xe(C, T.excavation)), D = /* @__PURE__ */ s("image", {
|
|
1663
|
+
href: _.src,
|
|
1664
|
+
height: T.h,
|
|
1665
|
+
width: T.w,
|
|
1666
|
+
x: T.x + S,
|
|
1667
|
+
y: T.y + S,
|
|
1604
1668
|
preserveAspectRatio: "none",
|
|
1605
|
-
opacity:
|
|
1606
|
-
crossOrigin:
|
|
1669
|
+
opacity: T.opacity,
|
|
1670
|
+
crossOrigin: T.crossOrigin
|
|
1607
1671
|
}));
|
|
1608
|
-
let
|
|
1609
|
-
modules:
|
|
1610
|
-
margin:
|
|
1672
|
+
let O = {
|
|
1673
|
+
modules: E,
|
|
1674
|
+
margin: S,
|
|
1611
1675
|
gradient: u,
|
|
1612
|
-
gradientId:
|
|
1676
|
+
gradientId: b
|
|
1613
1677
|
};
|
|
1614
1678
|
return /* @__PURE__ */ c("svg", {
|
|
1615
1679
|
height: i,
|
|
1616
1680
|
width: i,
|
|
1617
|
-
viewBox: `0 0 ${
|
|
1618
|
-
ref:
|
|
1681
|
+
viewBox: `0 0 ${w} ${w}`,
|
|
1682
|
+
ref: y,
|
|
1619
1683
|
role: "img",
|
|
1620
|
-
"aria-label":
|
|
1621
|
-
...
|
|
1684
|
+
"aria-label": v?.["aria-label"] || "QR Code",
|
|
1685
|
+
...v,
|
|
1622
1686
|
children: [
|
|
1623
|
-
/* @__PURE__ */ s(
|
|
1687
|
+
/* @__PURE__ */ s(ye, {
|
|
1624
1688
|
gradient: u,
|
|
1625
|
-
gradientId:
|
|
1689
|
+
gradientId: b
|
|
1626
1690
|
}),
|
|
1627
|
-
/* @__PURE__ */ s(
|
|
1691
|
+
/* @__PURE__ */ s(ee, {
|
|
1628
1692
|
background: l,
|
|
1629
|
-
bgGradientId:
|
|
1630
|
-
numCells:
|
|
1693
|
+
bgGradientId: x,
|
|
1694
|
+
numCells: w
|
|
1631
1695
|
}),
|
|
1632
|
-
/* @__PURE__ */ s(
|
|
1696
|
+
/* @__PURE__ */ s(ve, {
|
|
1633
1697
|
settings: m,
|
|
1634
|
-
...
|
|
1698
|
+
...O
|
|
1635
1699
|
}),
|
|
1636
|
-
/* @__PURE__ */ s(
|
|
1700
|
+
/* @__PURE__ */ s(_e, {
|
|
1637
1701
|
settings: h,
|
|
1638
|
-
...
|
|
1702
|
+
...O
|
|
1639
1703
|
}),
|
|
1640
|
-
/* @__PURE__ */ s(
|
|
1704
|
+
/* @__PURE__ */ s(ge, {
|
|
1641
1705
|
settings: g,
|
|
1642
|
-
...
|
|
1706
|
+
...O
|
|
1643
1707
|
}),
|
|
1644
|
-
|
|
1708
|
+
D
|
|
1645
1709
|
]
|
|
1646
1710
|
});
|
|
1647
1711
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-modules.d.ts","sourceRoot":"","sources":["../../../src/components/data-modules.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAwB,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"data-modules.d.ts","sourceRoot":"","sources":["../../../src/components/data-modules.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAwB,MAAM,OAAO,CAAA;AAO5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AA6BtD,eAAO,MAAM,WAAW,GAAI,sDAMzB,gBAAgB,KAAG,SAkKrB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"finder-patterns-inner.d.ts","sourceRoot":"","sources":["../../../src/components/finder-patterns-inner.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAW,MAAM,OAAO,CAAA;AAS/C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAA;AAY9D,eAAO,MAAM,mBAAmB,GAAI,sDAMjC,wBAAwB,KAAG,
|
|
1
|
+
{"version":3,"file":"finder-patterns-inner.d.ts","sourceRoot":"","sources":["../../../src/components/finder-patterns-inner.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAW,MAAM,OAAO,CAAA;AAS/C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAA;AAY9D,eAAO,MAAM,mBAAmB,GAAI,sDAMjC,wBAAwB,KAAG,SAwJ7B,CAAA"}
|
package/dist/src/constants.d.ts
CHANGED
|
@@ -16,6 +16,8 @@ export declare const DEFAULT_DATA_MODULES_COLOR = "#000000";
|
|
|
16
16
|
export declare const DEFAULT_FINDER_PATTERN_OUTER_STYLE: FinderPatternOuterStyle;
|
|
17
17
|
export declare const DEFAULT_FINDER_PATTERN_INNER_STYLE: FinderPatternInnerStyle;
|
|
18
18
|
export declare const DEFAULT_DATA_MODULES_STYLE: DataModulesStyle;
|
|
19
|
+
export declare const CIRCUIT_BOARD_LINE_WIDTH = 0.5;
|
|
20
|
+
export declare const CIRCUIT_BOARD_PAD_RADIUS = 0.5;
|
|
19
21
|
export declare const DEFAULT_FILENAME = "react-qr-code";
|
|
20
22
|
export declare const GRADIENT_ID = "react-qr-code-gradient";
|
|
21
23
|
export declare const BG_GRADIENT_ID = "react-qr-code-bg-gradient";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,aAAa,CAAA;AAEpB;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,uBAKpB,CAAA;AAEV;;GAEG;AACH,eAAO,MAAM,YAAY,MAAM,CAAA;AAC/B,eAAO,MAAM,aAAa,EAAE,oBAA0B,CAAA;AACtD,eAAO,MAAM,eAAe,YAAY,CAAA;AAExC,eAAO,MAAM,kBAAkB,IAAI,CAAA;AACnC,eAAO,MAAM,mBAAmB,IAAI,CAAA;AACpC,eAAO,MAAM,uBAAuB,IAAI,CAAA;AAExC,eAAO,MAAM,0BAA0B,YAAY,CAAA;AACnD,eAAO,MAAM,kCAAkC,EAAE,uBAAkC,CAAA;AACnF,eAAO,MAAM,kCAAkC,EAAE,uBAAkC,CAAA;AACnF,eAAO,MAAM,0BAA0B,EAAE,gBAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,aAAa,CAAA;AAEpB;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,uBAKpB,CAAA;AAEV;;GAEG;AACH,eAAO,MAAM,YAAY,MAAM,CAAA;AAC/B,eAAO,MAAM,aAAa,EAAE,oBAA0B,CAAA;AACtD,eAAO,MAAM,eAAe,YAAY,CAAA;AAExC,eAAO,MAAM,kBAAkB,IAAI,CAAA;AACnC,eAAO,MAAM,mBAAmB,IAAI,CAAA;AACpC,eAAO,MAAM,uBAAuB,IAAI,CAAA;AAExC,eAAO,MAAM,0BAA0B,YAAY,CAAA;AACnD,eAAO,MAAM,kCAAkC,EAAE,uBAAkC,CAAA;AACnF,eAAO,MAAM,kCAAkC,EAAE,uBAAkC,CAAA;AACnF,eAAO,MAAM,0BAA0B,EAAE,gBAA2B,CAAA;AACpE,eAAO,MAAM,wBAAwB,MAAM,CAAA;AAC3C,eAAO,MAAM,wBAAwB,MAAM,CAAA;AAE3C,eAAO,MAAM,gBAAgB,kBAAkB,CAAA;AAE/C,eAAO,MAAM,WAAW,2BAA2B,CAAA;AACnD,eAAO,MAAM,cAAc,8BAA8B,CAAA;AAMzD,eAAO,MAAM,iBAAiB,MAAM,CAAA;AAEpC;;GAEG;AAEH,eAAO,MAAM,mBAAmB,IAAI,CAAA;AACpC,eAAO,MAAM,yBAAyB,IAAI,CAAA;AAE1C,eAAO,MAAM,yBAAyB,YAQrC,CAAA;AAED,eAAO,MAAM,8BAA8B;;;;;;;;;;CAU1C,CAAA;AAED,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;CAazC,CAAA;AAED,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;CAgBzC,CAAA;AAED,eAAO,MAAM,yBAAyB,YAQrC,CAAA"}
|
package/dist/src/types/lib.d.ts
CHANGED
|
@@ -28,18 +28,26 @@ export interface GradientSettings {
|
|
|
28
28
|
stops: GradientSettingsStop[];
|
|
29
29
|
rotation?: number;
|
|
30
30
|
}
|
|
31
|
-
export type DataModulesStyle = 'square' | 'square-sm' | 'pinched-square' | 'rounded' | 'leaf' | 'vertical-line' | 'horizontal-line' | 'circle' | 'diamond' | 'star' | 'heart' | 'hashtag';
|
|
31
|
+
export type DataModulesStyle = 'square' | 'square-sm' | 'pinched-square' | 'rounded' | 'leaf' | 'vertical-line' | 'horizontal-line' | 'circuit-board' | 'circle' | 'diamond' | 'star' | 'heart' | 'hashtag';
|
|
32
32
|
export interface DataModulesSettings {
|
|
33
33
|
color?: string;
|
|
34
34
|
style?: DataModulesStyle;
|
|
35
35
|
randomSize?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Fixed size multiplier applied to each data module (1 = full size). Keep
|
|
38
|
+
* between 0.75 and 1 for best results — lower values may degrade
|
|
39
|
+
* scannability. Only applies to fillable styles (square, pinched-square,
|
|
40
|
+
* circle, diamond, heart, star, hashtag). Ignored when `randomSize` is true.
|
|
41
|
+
* @defaultValue 1
|
|
42
|
+
*/
|
|
43
|
+
size?: number;
|
|
36
44
|
}
|
|
37
45
|
export type FinderPatternOuterStyle = 'square' | 'pinched-square' | 'rounded-sm' | 'rounded' | 'rounded-lg' | 'circle' | 'inpoint-sm' | 'inpoint' | 'inpoint-lg' | 'outpoint-sm' | 'outpoint' | 'outpoint-lg' | 'leaf-sm' | 'leaf' | 'leaf-lg';
|
|
38
46
|
export interface FinderPatternOuterSettings {
|
|
39
47
|
color?: string;
|
|
40
48
|
style?: FinderPatternOuterStyle;
|
|
41
49
|
}
|
|
42
|
-
export type FinderPatternInnerStyle = 'square' | 'pinched-square' | 'rounded-sm' | 'rounded' | 'rounded-lg' | 'circle' | 'inpoint-sm' | 'inpoint' | 'inpoint-lg' | 'outpoint-sm' | 'outpoint' | 'outpoint-lg' | 'leaf-sm' | 'leaf' | 'leaf-lg' | 'diamond' | 'star' | 'heart' | 'hashtag';
|
|
50
|
+
export type FinderPatternInnerStyle = 'square' | 'pinched-square' | 'rounded-sm' | 'rounded' | 'rounded-lg' | 'circle' | 'inpoint-sm' | 'inpoint' | 'inpoint-lg' | 'outpoint-sm' | 'outpoint' | 'outpoint-lg' | 'leaf-sm' | 'leaf' | 'leaf-lg' | 'diamond' | 'star' | 'heart' | 'hashtag' | 'microchip';
|
|
43
51
|
export interface FinderPatternInnerSettings {
|
|
44
52
|
color?: string;
|
|
45
53
|
style?: FinderPatternInnerStyle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../../src/types/lib.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,kBAAkB,CAAA;AAE7C;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,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ACH,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IACxB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;;OAIG;IACH,KAAK,CAAC,EAAE,oBAAoB,CAAA;IAE5B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;;OAGG;IACH,UAAU,CAAC,EAAE,kBAAkB,CAAA;IAC/B;;OAEG;IACH,QAAQ,CAAC,EAAE,gBAAgB,CAAA;IAC3B;;OAEG;IACH,mBAAmB,CAAC,EAAE,mBAAmB,CAAA;IACzC;;OAEG;IACH,0BAA0B,CAAC,EAAE,0BAA0B,CAAA;IACvD;;OAEG;IACH,0BAA0B,CAAC,EAAE,0BAA0B,CAAA;IACvD;;OAEG;IACH,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAA;CACzC;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;OAGG;IACH,CAAC,CAAC,EAAE,MAAM,CAAA;IACV;;;OAGG;IACH,CAAC,CAAC,EAAE,MAAM,CAAA;IACV;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B"}
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import { DataModulesStyle, Modules } from '../types/lib';
|
|
2
2
|
import { DataModulesNeighbours } from '../types/utils';
|
|
3
3
|
export declare const dataModuleCanBeRandomSize: (style: DataModulesStyle) => boolean;
|
|
4
|
-
export declare const getScaleFactor: (style: string, isRandom: boolean) => number;
|
|
4
|
+
export declare const getScaleFactor: (style: string, isRandom: boolean, size?: number) => number;
|
|
5
5
|
export declare const getModuleNeighbours: (x: number, y: number, modules: Modules) => DataModulesNeighbours;
|
|
6
|
+
export declare const isRenderableDataModule: ({ x, y, modules, numCells, }: {
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
modules: Modules;
|
|
10
|
+
numCells: number;
|
|
11
|
+
}) => boolean;
|
|
12
|
+
export declare const getRenderableDataModuleNeighbours: (x: number, y: number, modules: Modules, numCells: number) => DataModulesNeighbours;
|
|
13
|
+
export declare const rect: (x: number, y: number, width: number, height: number) => string;
|
|
6
14
|
export declare const square: (x: number, y: number, size: number) => string;
|
|
7
15
|
export declare const circle: (x: number, y: number, size: number) => string;
|
|
8
16
|
export declare const diamond: (x: number, y: number, size: number) => string;
|
|
17
|
+
export declare const circuitBoardPad: (cx: number, cy: number, radius: number) => string;
|
|
18
|
+
export declare const circuitBoardShouldDrawPad: ({ count }: DataModulesNeighbours) => boolean;
|
|
9
19
|
export declare const topRightRounded: (x: number, y: number) => string;
|
|
10
20
|
export declare const topLeftRounded: (x: number, y: number) => string;
|
|
11
21
|
export declare const bottomRightRounded: (x: number, y: number) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-modules.d.ts","sourceRoot":"","sources":["../../../src/utils/data-modules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAC7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"data-modules.d.ts","sourceRoot":"","sources":["../../../src/utils/data-modules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,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AAEjC,eAAO,MAAM,cAAc,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,WAKnB,CAAA;AAEhC,eAAO,MAAM,kBAAkB,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,WAM/C,CAAA;AAER,eAAO,MAAM,iBAAiB,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,WAM/C,CAAA;AAEP,eAAO,MAAM,YAAY,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,WAIrB,CAAA;AAE5B,eAAO,MAAM,WAAW,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,WAIpB,CAAA;AAE5B,eAAO,MAAM,UAAU,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,WAInB,CAAA;AAE5B,eAAO,MAAM,aAAa,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,WAItB,CAAA;AAE5B,eAAO,MAAM,IAAI,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,MAAM,MAAM,WAStD,CAAA"}
|
|
@@ -3,6 +3,7 @@ export declare const sanitizeDataModulesSettings: (settings?: DataModulesSetting
|
|
|
3
3
|
color: string;
|
|
4
4
|
style: import('..').DataModulesStyle;
|
|
5
5
|
randomSize: boolean;
|
|
6
|
+
size: number;
|
|
6
7
|
};
|
|
7
8
|
export declare const sanitizeFinderPatternOuterSettings: (settings?: FinderPatternOuterSettings) => {
|
|
8
9
|
color: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../src/utils/settings.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,mBAAmB,EACnB,0BAA0B,EAC1B,0BAA0B,EAC3B,MAAM,cAAc,CAAA;AAErB,eAAO,MAAM,2BAA2B,GAAI,WAAW,mBAAmB
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../src/utils/settings.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,mBAAmB,EACnB,0BAA0B,EAC1B,0BAA0B,EAC3B,MAAM,cAAc,CAAA;AAErB,eAAO,MAAM,2BAA2B,GAAI,WAAW,mBAAmB;;;;;CAOzE,CAAA;AAED,eAAO,MAAM,kCAAkC,GAC7C,WAAW,0BAA0B;;;CAMtC,CAAA;AAED,eAAO,MAAM,kCAAkC,GAC7C,WAAW,0BAA0B;;;CAMtC,CAAA"}
|
package/dist/src/utils/svg.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export declare const calculateGradientVectors: (rotation: number) => {
|
|
|
7
7
|
};
|
|
8
8
|
export declare const star: (cx: number, cy: number, size: number, spikes: number) => string;
|
|
9
9
|
export declare const pinchedSquare: (x: number, y: number, size: number, controlOffset: number) => string;
|
|
10
|
+
export declare const microchip: (x: number, y: number, size: number) => string;
|
|
10
11
|
export declare const hashtag: (x: number, y: number, size: number) => string;
|
|
11
12
|
export declare const heart: (x: number, y: number, size: number) => string;
|
|
12
13
|
//# sourceMappingURL=svg.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"svg.d.ts","sourceRoot":"","sources":["../../../src/utils/svg.ts"],"names":[],"mappings":"AAEA,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,UAEtC;AAED,eAAO,MAAM,wBAAwB,GAAI,UAAU,MAAM;;;;;CAcxD,CAAA;AAED,eAAO,MAAM,IAAI,GAAI,IAAI,MAAM,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,EAAE,QAAQ,MAAM,KAAG,MAc3E,CAAA;AAED,eAAO,MAAM,aAAa,GACxB,GAAG,MAAM,EACT,GAAG,MAAM,EACT,MAAM,MAAM,EACZ,eAAe,MAAM,WAOlB,CAAA;
|
|
1
|
+
{"version":3,"file":"svg.d.ts","sourceRoot":"","sources":["../../../src/utils/svg.ts"],"names":[],"mappings":"AAEA,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,UAEtC;AAED,eAAO,MAAM,wBAAwB,GAAI,UAAU,MAAM;;;;;CAcxD,CAAA;AAED,eAAO,MAAM,IAAI,GAAI,IAAI,MAAM,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,EAAE,QAAQ,MAAM,KAAG,MAc3E,CAAA;AAED,eAAO,MAAM,aAAa,GACxB,GAAG,MAAM,EACT,GAAG,MAAM,EACT,MAAM,MAAM,EACZ,eAAe,MAAM,WAOlB,CAAA;AAOL,eAAO,MAAM,SAAS,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,MAAM,MAAM,WAgB3D,CAAA;AAED,eAAO,MAAM,OAAO,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,MAAM,MAAM,WAgCzD,CAAA;AAED,eAAO,MAAM,KAAK,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,MAAM,MAAM,WAiIvD,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lglab/react-qr-code",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "React library to generate QR codes",
|
|
5
5
|
"author": "LGLab",
|
|
6
6
|
"license": "MIT",
|
|
@@ -46,15 +46,15 @@
|
|
|
46
46
|
"react": "^18 || ^19"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@types/node": "^25.
|
|
49
|
+
"@types/node": "^25.6.0",
|
|
50
50
|
"@types/react": "^19.2.14",
|
|
51
51
|
"@types/react-dom": "^19.2.3",
|
|
52
52
|
"@vitejs/plugin-react": "^6.0.1",
|
|
53
|
-
"globals": "^17.
|
|
54
|
-
"react": "^19.2.
|
|
55
|
-
"react-dom": "^19.2.
|
|
56
|
-
"typescript": "~6.0.
|
|
57
|
-
"vite": "^8.0.
|
|
53
|
+
"globals": "^17.6.0",
|
|
54
|
+
"react": "^19.2.5",
|
|
55
|
+
"react-dom": "^19.2.5",
|
|
56
|
+
"typescript": "~6.0.3",
|
|
57
|
+
"vite": "^8.0.10",
|
|
58
58
|
"vite-plugin-dts": "^4.5.4"
|
|
59
59
|
},
|
|
60
60
|
"scripts": {
|