@reown/appkit-ui-react-native 0.0.0-develop-20251030154825 → 0.0.0-develop-20251114173726
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/lib/commonjs/assets/svg/WalletConnect.js +4 -5
- package/lib/commonjs/assets/svg/WalletConnect.js.map +1 -1
- package/lib/commonjs/composites/wui-qr-code/index.js +51 -19
- package/lib/commonjs/composites/wui-qr-code/index.js.map +1 -1
- package/lib/commonjs/composites/wui-qr-code/styles.js +0 -3
- package/lib/commonjs/composites/wui-qr-code/styles.js.map +1 -1
- package/lib/commonjs/utils/QRCodeUtil.js +217 -116
- package/lib/commonjs/utils/QRCodeUtil.js.map +1 -1
- package/lib/module/assets/svg/WalletConnect.js +4 -5
- package/lib/module/assets/svg/WalletConnect.js.map +1 -1
- package/lib/module/composites/wui-qr-code/index.js +50 -19
- package/lib/module/composites/wui-qr-code/index.js.map +1 -1
- package/lib/module/composites/wui-qr-code/styles.js +0 -3
- package/lib/module/composites/wui-qr-code/styles.js.map +1 -1
- package/lib/module/utils/QRCodeUtil.js +216 -116
- package/lib/module/utils/QRCodeUtil.js.map +1 -1
- package/lib/typescript/assets/svg/WalletConnect.d.ts.map +1 -1
- package/lib/typescript/composites/wui-qr-code/index.d.ts +3 -1
- package/lib/typescript/composites/wui-qr-code/index.d.ts.map +1 -1
- package/lib/typescript/composites/wui-qr-code/styles.d.ts +0 -3
- package/lib/typescript/composites/wui-qr-code/styles.d.ts.map +1 -1
- package/lib/typescript/utils/QRCodeUtil.d.ts +22 -2
- package/lib/typescript/utils/QRCodeUtil.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/assets/svg/WalletConnect.tsx +4 -5
- package/src/composites/wui-qr-code/index.tsx +75 -16
- package/src/composites/wui-qr-code/styles.ts +0 -3
- package/src/utils/QRCodeUtil.tsx +265 -142
|
@@ -9,15 +9,14 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
9
9
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
10
10
|
const SvgWalletConnect = props => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeSvg.default, {
|
|
11
11
|
fill: "none",
|
|
12
|
-
viewBox: "0 0
|
|
12
|
+
viewBox: "0 0 37 23",
|
|
13
13
|
...props,
|
|
14
14
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Path, {
|
|
15
15
|
fill: props.fill ?? '#fff',
|
|
16
|
-
d: "
|
|
16
|
+
d: "M26.6428 8.62163L29.8418 5.42265C22.6115 -1.80755 13.6277 -1.80755 6.39746 5.42265L9.59644 8.62163C15.0953 3.12281 21.1477 3.12281 26.6465 8.62163H26.6428Z"
|
|
17
17
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Path, {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
d: "M25.67 19.15a32.06 32.06 0 0 1 44.66 0l1.5 1.48c.43.42.43 1.09 0 1.5l-5.15 5.05a.31.31 0 0 1-.44 0l-2.07-2.03a23.21 23.21 0 0 0-32.34 0l-2.22 2.18a.31.31 0 0 1-.44 0l-5.15-5.05a1.05 1.05 0 0 1 0-1.5l1.65-1.63ZM81 29.6l4.6 4.5c.42.41.42 1.09 0 1.5l-20.7 20.26c-.43.43-1.14.43-1.57 0L48.63 41.47a.9.9 0 0 0-1.26 0L32.68 55.85c-.43.43-1.14.43-1.57 0L10.42 35.6a1.05 1.05 0 0 1 0-1.5l4.59-4.5a1.13 1.13 0 0 1 1.57 0l14.68 14.38a.9.9 0 0 0 1.27 0l-.35-.35.35.35L47.22 29.6a1.13 1.13 0 0 1 1.56 0l14.7 14.38a.9.9 0 0 0 1.26 0L79.42 29.6a1.13 1.13 0 0 1 1.57 0Z"
|
|
18
|
+
fill: props.fill ?? '#fff',
|
|
19
|
+
d: "M25.5769 16.0749L18.1164 8.61435L10.6558 16.0749L3.19526 8.61435L0 11.8096L10.6558 22.4691L18.1164 15.0086L25.5769 22.4691L36.2328 11.8096L33.0375 8.61435L25.5769 16.0749Z"
|
|
21
20
|
})]
|
|
22
21
|
});
|
|
23
22
|
var _default = exports.default = SvgWalletConnect;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNativeSvg","_interopRequireWildcard","require","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","SvgWalletConnect","props","jsxs","fill","viewBox","children","jsx","Path","d","
|
|
1
|
+
{"version":3,"names":["_reactNativeSvg","_interopRequireWildcard","require","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","SvgWalletConnect","props","jsxs","fill","viewBox","children","jsx","Path","d","_default","exports","WalletConnectLightBrownSvg","G","clipPath","Defs","ClipPath","id"],"sourceRoot":"../../../../src","sources":["assets/svg/WalletConnect.tsx"],"mappings":";;;;;;AAAA,IAAAA,eAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA+E,IAAAC,WAAA,GAAAD,OAAA;AAAA,SAAAD,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAL,uBAAA,YAAAA,CAAAG,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,S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,CACC,CACN;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAnB,OAAA,GACaS,gBAAgB;AAExB,MAAMW,0BAA0B,GAAIV,KAAe,iBACxD,IAAArB,WAAA,CAAAsB,IAAA,EAACzB,eAAA,CAAAc,OAAG;EAACa,OAAO,EAAC,WAAW;EAACD,IAAI,EAAC,MAAM;EAAA,GAAKF,KAAK;EAAAI,QAAA,gBAC5C,IAAAzB,WAAA,CAAAsB,IAAA,EAACzB,eAAA,CAAAmC,CAAC;IAACC,QAAQ,EAAC,wBAAwB;IAAAR,QAAA,gBAClC,IAAAzB,WAAA,CAAA0B,GAAA,EAAC7B,eAAA,CAAA8B,IAAI;MACHC,CAAC,EAAC,4eAA4e;MAC9eL,IAAI,EAAC;IAAS,CACf,CAAC,eACF,IAAAvB,WAAA,CAAA0B,GAAA,EAAC7B,eAAA,CAAA8B,IAAI;MACHC,CAAC,EAAC,yhCAAyhC;MAC3hCL,IAAI,EAAC;IAAS,CACf,CAAC;EAAA,CACD,CAAC,eACJ,IAAAvB,WAAA,CAAA0B,GAAA,EAAC7B,eAAA,CAAAqC,IAAI;IAAAT,QAAA,eACH,IAAAzB,WAAA,CAAA0B,GAAA,EAAC7B,eAAA,CAAAsC,QAAQ;MAACC,EAAE,EAAC,kBAAkB;MAAAX,QAAA,eAC7B,IAAAzB,WAAA,CAAA0B,GAAA,EAAC7B,eAAA,CAAA8B,IAAI;QACHC,CAAC,EAAC,6GAA6G;QAC/GL,IAAI,EAAC;MAAO,CACb;IAAC,CACM;EAAC,CACP,CAAC;AAAA,CACJ,CACN;AAACO,OAAA,CAAAC,0BAAA,GAAAA,0BAAA","ignoreList":[]}
|
|
@@ -7,7 +7,7 @@ exports.QrCode = void 0;
|
|
|
7
7
|
exports.QrCode_ = QrCode_;
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _reactNative = require("react-native");
|
|
10
|
-
var _reactNativeSvg =
|
|
10
|
+
var _reactNativeSvg = _interopRequireWildcard(require("react-native-svg"));
|
|
11
11
|
var _wuiIcon = require("../../components/wui-icon");
|
|
12
12
|
var _wuiImage = require("../../components/wui-image");
|
|
13
13
|
var _wuiShimmer = require("../../components/wui-shimmer");
|
|
@@ -16,6 +16,7 @@ var _ThemeUtil = require("../../utils/ThemeUtil");
|
|
|
16
16
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
17
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
18
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
19
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
19
20
|
function QrCode_({
|
|
20
21
|
size,
|
|
21
22
|
uri,
|
|
@@ -23,13 +24,17 @@ function QrCode_({
|
|
|
23
24
|
testID,
|
|
24
25
|
arenaClear,
|
|
25
26
|
icon,
|
|
26
|
-
style
|
|
27
|
+
style,
|
|
28
|
+
logoSize,
|
|
29
|
+
logoBorderRadius
|
|
27
30
|
}) {
|
|
28
31
|
const Theme = _ThemeUtil.LightTheme;
|
|
29
32
|
const containerPadding = _ThemeUtil.Spacing.l;
|
|
30
33
|
const qrSize = size - containerPadding * 2;
|
|
31
|
-
const
|
|
32
|
-
const
|
|
34
|
+
const _logoSize = arenaClear ? 0 : logoSize ?? qrSize / 4;
|
|
35
|
+
const dotColor = Theme['inverse-000'];
|
|
36
|
+
const edgeColor = Theme['inverse-100'];
|
|
37
|
+
const qrData = (0, _react.useMemo)(() => uri ? _QRCodeUtil.QRCodeUtil.generate(uri, qrSize, _logoSize, logoBorderRadius) : null, [uri, qrSize, _logoSize, logoBorderRadius]);
|
|
33
38
|
const logoTemplate = () => {
|
|
34
39
|
if (arenaClear) {
|
|
35
40
|
return null;
|
|
@@ -37,40 +42,67 @@ function QrCode_({
|
|
|
37
42
|
if (imageSrc) {
|
|
38
43
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_wuiImage.Image, {
|
|
39
44
|
source: imageSrc,
|
|
40
|
-
style: [
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
45
|
+
style: [{
|
|
46
|
+
position: 'absolute',
|
|
47
|
+
height: _logoSize,
|
|
48
|
+
width: _logoSize,
|
|
49
|
+
borderRadius: logoBorderRadius
|
|
44
50
|
}]
|
|
45
51
|
});
|
|
46
52
|
}
|
|
47
53
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_wuiIcon.Icon, {
|
|
48
54
|
name: icon ?? 'walletConnect',
|
|
49
55
|
color: "accent-100",
|
|
50
|
-
height:
|
|
51
|
-
width:
|
|
52
|
-
style:
|
|
56
|
+
height: _logoSize,
|
|
57
|
+
width: _logoSize,
|
|
58
|
+
style: {
|
|
59
|
+
position: 'absolute'
|
|
60
|
+
}
|
|
53
61
|
});
|
|
54
62
|
};
|
|
55
|
-
|
|
63
|
+
if (!uri || !qrData) {
|
|
64
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_wuiShimmer.Shimmer, {
|
|
65
|
+
width: size,
|
|
66
|
+
height: size,
|
|
67
|
+
borderRadius: _ThemeUtil.BorderRadius.l
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
56
71
|
style: [_styles.default.container, {
|
|
57
72
|
width: size,
|
|
58
73
|
backgroundColor: Theme['inverse-100'],
|
|
59
74
|
padding: containerPadding
|
|
60
75
|
}, style],
|
|
61
76
|
testID: testID,
|
|
62
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.
|
|
77
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeSvg.default, {
|
|
63
78
|
height: qrSize,
|
|
64
79
|
width: qrSize,
|
|
65
|
-
children:
|
|
80
|
+
children: [qrData.rects.map(rect => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Rect, {
|
|
81
|
+
fill: rect.fillType === 'dot' ? dotColor : edgeColor,
|
|
82
|
+
height: rect.size,
|
|
83
|
+
rx: rect.size * 0.32,
|
|
84
|
+
ry: rect.size * 0.32,
|
|
85
|
+
width: rect.size,
|
|
86
|
+
x: rect.x,
|
|
87
|
+
y: rect.y
|
|
88
|
+
}, `rect_${rect.x}_${rect.y}`)), qrData.circles.map(circle => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Circle, {
|
|
89
|
+
cx: circle.cx,
|
|
90
|
+
cy: circle.cy,
|
|
91
|
+
fill: dotColor,
|
|
92
|
+
r: circle.r
|
|
93
|
+
}, `circle_${circle.cx}_${circle.cy}`)), qrData.lines.map(line => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Line, {
|
|
94
|
+
x1: line.x1,
|
|
95
|
+
x2: line.x2,
|
|
96
|
+
y1: line.y1,
|
|
97
|
+
y2: line.y2,
|
|
98
|
+
stroke: dotColor,
|
|
99
|
+
strokeWidth: line.strokeWidth,
|
|
100
|
+
strokeLinecap: "round"
|
|
101
|
+
}, `line_${line.x1}_${line.y1}_${line.y2}`))]
|
|
66
102
|
}), logoTemplate()]
|
|
67
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_wuiShimmer.Shimmer, {
|
|
68
|
-
width: size,
|
|
69
|
-
height: size,
|
|
70
|
-
borderRadius: _ThemeUtil.BorderRadius.l
|
|
71
103
|
});
|
|
72
104
|
}
|
|
73
105
|
const QrCode = exports.QrCode = /*#__PURE__*/(0, _react.memo)(QrCode_, (prevProps, nextProps) => {
|
|
74
|
-
return prevProps.size === nextProps.size && prevProps.uri === nextProps.uri && prevProps.style === nextProps.style;
|
|
106
|
+
return prevProps.size === nextProps.size && prevProps.uri === nextProps.uri && prevProps.style === nextProps.style && prevProps.logoBorderRadius === nextProps.logoBorderRadius;
|
|
75
107
|
});
|
|
76
108
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_reactNativeSvg","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_reactNativeSvg","_interopRequireWildcard","_wuiIcon","_wuiImage","_wuiShimmer","_QRCodeUtil","_ThemeUtil","_styles","_interopRequireDefault","_jsxRuntime","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","QrCode_","size","uri","imageSrc","testID","arenaClear","icon","style","logoSize","logoBorderRadius","Theme","LightTheme","containerPadding","Spacing","l","qrSize","_logoSize","dotColor","edgeColor","qrData","useMemo","QRCodeUtil","generate","logoTemplate","jsx","Image","source","position","height","width","borderRadius","Icon","name","color","Shimmer","BorderRadius","jsxs","View","styles","container","backgroundColor","padding","children","rects","map","rect","Rect","fill","fillType","rx","ry","x","y","circles","circle","Circle","cx","cy","lines","line","Line","x1","x2","y1","y2","stroke","strokeWidth","strokeLinecap","QrCode","exports","memo","prevProps","nextProps"],"sourceRoot":"../../../../src","sources":["composites/wui-qr-code/index.tsx"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAC,uBAAA,CAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA;AAEA,IAAAS,OAAA,GAAAC,sBAAA,CAAAV,OAAA;AAA8B,IAAAW,WAAA,GAAA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_default","exports","default","StyleSheet","create","container","alignItems","justifyContent","borderRadius","BorderRadius","l","padding","Spacing","alignSelf"
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_ThemeUtil","_default","exports","default","StyleSheet","create","container","alignItems","justifyContent","borderRadius","BorderRadius","l","padding","Spacing","alignSelf"],"sourceRoot":"../../../../src","sources":["composites/wui-qr-code/styles.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAA8D,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAE/CC,uBAAU,CAACC,MAAM,CAAC;EAC/BC,SAAS,EAAE;IACTC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBC,YAAY,EAAEC,uBAAY,CAACC,CAAC;IAC5BC,OAAO,EAAEC,kBAAO,CAACF,CAAC;IAClBG,SAAS,EAAE;EACb;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -4,15 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.QRCodeUtil = void 0;
|
|
7
|
-
|
|
7
|
+
exports.generateQRData = generateQRData;
|
|
8
8
|
var _qrcode = _interopRequireDefault(require("qrcode"));
|
|
9
|
-
var _ThemeUtil = require("../utils/ThemeUtil");
|
|
10
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
10
|
const CONNECTING_ERROR_MARGIN = 0.1;
|
|
13
11
|
const CIRCLE_SIZE_MODIFIER = 2.5;
|
|
14
12
|
const QRCODE_MATRIX_MARGIN = 7;
|
|
15
|
-
|
|
13
|
+
const LOGO_PADDING = 25;
|
|
14
|
+
function isAdjacentDots(cy, otherCy, cellSize) {
|
|
16
15
|
if (cy === otherCy) {
|
|
17
16
|
return false;
|
|
18
17
|
}
|
|
@@ -26,128 +25,230 @@ function getMatrix(value, errorCorrectionLevel) {
|
|
|
26
25
|
const sqrt = Math.sqrt(arr.length);
|
|
27
26
|
return arr.reduce((rows, key, index) => (index % sqrt === 0 ? rows.push([key]) : rows[rows.length - 1].push(key)) && rows, []);
|
|
28
27
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
y: y1 + cellSize * i
|
|
63
|
-
}, `rect_${x1 + cellSize * i}_${y1 + cellSize * i}`));
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
const clearArenaSize = Math.floor((logoSize + 25) / cellSize);
|
|
67
|
-
const matrixMiddleStart = matrix.length / 2 - clearArenaSize / 2;
|
|
68
|
-
const matrixMiddleEnd = matrix.length / 2 + clearArenaSize / 2 - 1;
|
|
69
|
-
const circles = [];
|
|
70
|
-
|
|
71
|
-
// Getting coordinates for each of the QR code dots
|
|
72
|
-
matrix.forEach((row, i) => {
|
|
73
|
-
row.forEach((_, j) => {
|
|
74
|
-
if (matrix[i][j]) {
|
|
75
|
-
if (!(i < QRCODE_MATRIX_MARGIN && j < QRCODE_MATRIX_MARGIN || i > matrix.length - (QRCODE_MATRIX_MARGIN + 1) && j < QRCODE_MATRIX_MARGIN || i < QRCODE_MATRIX_MARGIN && j > matrix.length - (QRCODE_MATRIX_MARGIN + 1))) {
|
|
76
|
-
if (!(i > matrixMiddleStart && i < matrixMiddleEnd && j > matrixMiddleStart && j < matrixMiddleEnd)) {
|
|
77
|
-
const cx = i * cellSize + cellSize / 2;
|
|
78
|
-
const cy = j * cellSize + cellSize / 2;
|
|
79
|
-
circles.push([cx, cy]);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
28
|
+
function processQRMatrix(matrix, size, logoSize, logoBorderRadius) {
|
|
29
|
+
const matrixLength = matrix.length;
|
|
30
|
+
const cellSize = size / matrixLength;
|
|
31
|
+
const halfCellSize = cellSize / 2;
|
|
32
|
+
const strokeWidth = cellSize / (CIRCLE_SIZE_MODIFIER / 2);
|
|
33
|
+
const circleRadius = cellSize / CIRCLE_SIZE_MODIFIER;
|
|
34
|
+
const rects = [];
|
|
35
|
+
const circles = [];
|
|
36
|
+
const lines = [];
|
|
37
|
+
|
|
38
|
+
// Generate corner rectangles - optimized with direct indexing
|
|
39
|
+
const qrList = [{
|
|
40
|
+
x: 0,
|
|
41
|
+
y: 0
|
|
42
|
+
}, {
|
|
43
|
+
x: 1,
|
|
44
|
+
y: 0
|
|
45
|
+
}, {
|
|
46
|
+
x: 0,
|
|
47
|
+
y: 1
|
|
48
|
+
}];
|
|
49
|
+
const baseOffset = (matrixLength - QRCODE_MATRIX_MARGIN) * cellSize;
|
|
50
|
+
for (let qrIdx = 0; qrIdx < 3; qrIdx++) {
|
|
51
|
+
const qr = qrList[qrIdx];
|
|
52
|
+
const x1 = baseOffset * qr.x;
|
|
53
|
+
const y1 = baseOffset * qr.y;
|
|
54
|
+
for (let i = 0; i < 3; i++) {
|
|
55
|
+
const dotSize = cellSize * (QRCODE_MATRIX_MARGIN - i * 2);
|
|
56
|
+
rects.push({
|
|
57
|
+
x: x1 + cellSize * i,
|
|
58
|
+
y: y1 + cellSize * i,
|
|
59
|
+
size: dotSize,
|
|
60
|
+
fillType: i % 2 === 0 ? 'dot' : 'edge'
|
|
83
61
|
});
|
|
84
|
-
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
const circleCoords = [];
|
|
65
|
+
|
|
66
|
+
// Determine if using circular or rounded rectangle hole
|
|
67
|
+
const isCircular = logoBorderRadius === undefined;
|
|
68
|
+
const effectiveBorderRadius = logoBorderRadius ?? (logoSize + LOGO_PADDING) / 2;
|
|
85
69
|
|
|
86
|
-
|
|
87
|
-
|
|
70
|
+
// Calculate circle coordinates - optimized with configurable hole shape
|
|
71
|
+
for (let i = 0; i < matrixLength; i++) {
|
|
72
|
+
const row = matrix[i];
|
|
73
|
+
const rowLength = row.length;
|
|
74
|
+
for (let j = 0; j < rowLength; j++) {
|
|
75
|
+
if (!row[j]) continue;
|
|
76
|
+
|
|
77
|
+
// Skip corners check
|
|
78
|
+
if (i < QRCODE_MATRIX_MARGIN && j < QRCODE_MATRIX_MARGIN || i > matrixLength - (QRCODE_MATRIX_MARGIN + 1) && j < QRCODE_MATRIX_MARGIN || i < QRCODE_MATRIX_MARGIN && j > matrixLength - (QRCODE_MATRIX_MARGIN + 1)) {
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
88
81
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
82
|
+
// Calculate pixel coordinates first
|
|
83
|
+
const cx = i * cellSize + halfCellSize;
|
|
84
|
+
const cy = j * cellSize + halfCellSize;
|
|
85
|
+
|
|
86
|
+
// Skip hole calculation if logoSize is 0 (arenaClear)
|
|
87
|
+
if (logoSize === 0) {
|
|
88
|
+
circleCoords.push([cx, cy]);
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Calculate distance from center in pixel space
|
|
93
|
+
const centerX = size / 2;
|
|
94
|
+
const centerY = size / 2;
|
|
95
|
+
let isOutsideLogoArea = false;
|
|
96
|
+
if (isCircular) {
|
|
97
|
+
// Circular hole
|
|
98
|
+
const dx = cx - centerX;
|
|
99
|
+
const dy = cy - centerY;
|
|
100
|
+
const distanceFromCenter = Math.sqrt(dx * dx + dy * dy);
|
|
101
|
+
const pixelRadius = (logoSize + LOGO_PADDING) / 2;
|
|
102
|
+
isOutsideLogoArea = distanceFromCenter >= pixelRadius;
|
|
93
103
|
} else {
|
|
94
|
-
|
|
104
|
+
// Rounded rectangle hole
|
|
105
|
+
const halfLogoArea = (logoSize + LOGO_PADDING) / 2;
|
|
106
|
+
const dx = Math.abs(cx - centerX);
|
|
107
|
+
const dy = Math.abs(cy - centerY);
|
|
108
|
+
|
|
109
|
+
// Check if point is outside the rounded rectangle
|
|
110
|
+
if (dx > halfLogoArea || dy > halfLogoArea) {
|
|
111
|
+
isOutsideLogoArea = true;
|
|
112
|
+
} else if (dx > halfLogoArea - effectiveBorderRadius && dy > halfLogoArea - effectiveBorderRadius) {
|
|
113
|
+
// Check corner radius
|
|
114
|
+
const cornerDx = dx - (halfLogoArea - effectiveBorderRadius);
|
|
115
|
+
const cornerDy = dy - (halfLogoArea - effectiveBorderRadius);
|
|
116
|
+
const cornerDistance = Math.sqrt(cornerDx * cornerDx + cornerDy * cornerDy);
|
|
117
|
+
isOutsideLogoArea = cornerDistance >= effectiveBorderRadius;
|
|
118
|
+
} else {
|
|
119
|
+
isOutsideLogoArea = false;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
if (isOutsideLogoArea) {
|
|
123
|
+
circleCoords.push([cx, cy]);
|
|
95
124
|
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// Build circlesToConnect - optimized loop
|
|
129
|
+
const circlesToConnect = {};
|
|
130
|
+
for (let k = 0; k < circleCoords.length; k++) {
|
|
131
|
+
const [cx, cy] = circleCoords[k];
|
|
132
|
+
const existing = circlesToConnect[cx];
|
|
133
|
+
if (existing) {
|
|
134
|
+
existing.push(cy);
|
|
135
|
+
} else {
|
|
136
|
+
circlesToConnect[cx] = [cy];
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Process circles and lines - optimized to avoid Object.entries
|
|
141
|
+
for (const cxKey in circlesToConnect) {
|
|
142
|
+
const cx = Number(cxKey);
|
|
143
|
+
const cys = circlesToConnect[cxKey];
|
|
144
|
+
if (cys.length === 1) {
|
|
145
|
+
const firstCy = cys[0];
|
|
146
|
+
if (firstCy === undefined) continue;
|
|
147
|
+
|
|
148
|
+
// Single dot, add as circle
|
|
149
|
+
circles.push({
|
|
150
|
+
cx,
|
|
151
|
+
cy: firstCy,
|
|
152
|
+
r: circleRadius
|
|
112
153
|
});
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
//
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
154
|
+
continue;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// Sort once for line grouping
|
|
158
|
+
cys.sort((a, b) => a - b);
|
|
159
|
+
|
|
160
|
+
// Track which dots are connected and which are lonely
|
|
161
|
+
const isConnected = new Array(cys.length).fill(false);
|
|
162
|
+
|
|
163
|
+
// Find all adjacent pairs
|
|
164
|
+
for (let i = 0; i < cys.length - 1; i++) {
|
|
165
|
+
const currentCy = cys[i];
|
|
166
|
+
const nextCy = cys[i + 1];
|
|
167
|
+
if (currentCy !== undefined && nextCy !== undefined && isAdjacentDots(currentCy, nextCy, cellSize)) {
|
|
168
|
+
isConnected[i] = true;
|
|
169
|
+
isConnected[i + 1] = true;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// Add lonely dots as circles and build line groups
|
|
174
|
+
let groupStart = -1;
|
|
175
|
+
let groupEnd = -1;
|
|
176
|
+
for (let i = 0; i < cys.length; i++) {
|
|
177
|
+
const cy = cys[i];
|
|
178
|
+
if (cy === undefined) continue;
|
|
179
|
+
if (!isConnected[i]) {
|
|
180
|
+
// Lonely dot - add as circle
|
|
181
|
+
circles.push({
|
|
182
|
+
cx,
|
|
183
|
+
cy,
|
|
184
|
+
r: circleRadius
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
// Finish any ongoing line group
|
|
188
|
+
if (groupStart !== -1 && groupEnd !== -1 && groupStart !== groupEnd) {
|
|
189
|
+
lines.push({
|
|
190
|
+
x1: cx,
|
|
191
|
+
x2: cx,
|
|
192
|
+
y1: groupStart,
|
|
193
|
+
y2: groupEnd,
|
|
194
|
+
strokeWidth
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
groupStart = -1;
|
|
198
|
+
groupEnd = -1;
|
|
199
|
+
} else {
|
|
200
|
+
// Part of a line group
|
|
201
|
+
if (groupStart === -1) {
|
|
202
|
+
groupStart = cy;
|
|
203
|
+
groupEnd = cy;
|
|
132
204
|
} else {
|
|
133
|
-
|
|
205
|
+
// Check if adjacent to previous
|
|
206
|
+
const prevCy = cys[i - 1];
|
|
207
|
+
if (i > 0 && prevCy !== undefined && isAdjacentDots(cy, prevCy, cellSize)) {
|
|
208
|
+
groupEnd = cy;
|
|
209
|
+
} else {
|
|
210
|
+
// Gap in the group, finish previous line
|
|
211
|
+
if (groupStart !== groupEnd) {
|
|
212
|
+
lines.push({
|
|
213
|
+
x1: cx,
|
|
214
|
+
x2: cx,
|
|
215
|
+
y1: groupStart,
|
|
216
|
+
y2: groupEnd,
|
|
217
|
+
strokeWidth
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
groupStart = cy;
|
|
221
|
+
groupEnd = cy;
|
|
222
|
+
}
|
|
134
223
|
}
|
|
135
224
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
strokeLinecap: "round"
|
|
147
|
-
}, `line_${cx}_${y1}_${y2}`));
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// Don't forget the last group
|
|
228
|
+
if (groupStart !== -1 && groupEnd !== -1 && groupStart !== groupEnd) {
|
|
229
|
+
lines.push({
|
|
230
|
+
x1: cx,
|
|
231
|
+
x2: cx,
|
|
232
|
+
y1: groupStart,
|
|
233
|
+
y2: groupEnd,
|
|
234
|
+
strokeWidth
|
|
148
235
|
});
|
|
149
|
-
}
|
|
150
|
-
return dots;
|
|
236
|
+
}
|
|
151
237
|
}
|
|
238
|
+
return {
|
|
239
|
+
rects,
|
|
240
|
+
circles,
|
|
241
|
+
lines
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
function generateQRData(uri, size, logoSize, logoBorderRadius) {
|
|
245
|
+
if (!uri || size <= 0) {
|
|
246
|
+
throw new Error('Invalid QR code parameters');
|
|
247
|
+
}
|
|
248
|
+
const matrix = getMatrix(uri, 'Q');
|
|
249
|
+
return processQRMatrix(matrix, size, logoSize, logoBorderRadius);
|
|
250
|
+
}
|
|
251
|
+
const QRCodeUtil = exports.QRCodeUtil = {
|
|
252
|
+
generate: generateQRData
|
|
152
253
|
};
|
|
153
254
|
//# sourceMappingURL=QRCodeUtil.js.map
|