From 18860c330785cc835e2efa21e3910ce373acf091 Mon Sep 17 00:00:00 2001 From: aineo <124525926+aineo@users.noreply.github.com> Date: Mon, 10 Jun 2024 15:38:12 +0300 Subject: [PATCH 01/13] chore: update zxing library to version 21 --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7e5799b79..645ef385d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,7 +20,7 @@ "@mdi/font": "^7.4.47", "@stablelib/utf8": "^1.0.2", "@zxing/browser": "^0.1.4", - "@zxing/library": "^0.20.0", + "@zxing/library": "^0.21.0", "assert": "^2.1.0", "axios": "^1.6.8", "b64-to-blob": "^1.2.19", @@ -6682,9 +6682,9 @@ } }, "node_modules/@zxing/library": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/@zxing/library/-/library-0.20.0.tgz", - "integrity": "sha512-6Ev6rcqVjMakZFIDvbUf0dtpPGeZMTfyxYg4HkVWioWeN7cRcnUWT3bU6sdohc82O1nPXcjq6WiGfXX2Pnit6A==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@zxing/library/-/library-0.21.0.tgz", + "integrity": "sha512-2+DFYM6NLl+ZXXUbDOkmVn4TAAOgTniEx5MJD2kStujcxSl6j9CfAgIT8DcsBYIlT5DW7oeiShEzWZjpL0hNOw==", "dependencies": { "ts-custom-error": "^3.2.1" }, diff --git a/package.json b/package.json index c9b7b2210..cb02de43d 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "@mdi/font": "^7.4.47", "@stablelib/utf8": "^1.0.2", "@zxing/browser": "^0.1.4", - "@zxing/library": "^0.20.0", + "@zxing/library": "^0.21.0", "assert": "^2.1.0", "axios": "^1.6.8", "b64-to-blob": "^1.2.19", From 7e33e13033c7da642ef58c57f7249cbda8ad0a7e Mon Sep 17 00:00:00 2001 From: aineo <124525926+aineo@users.noreply.github.com> Date: Mon, 10 Jun 2024 15:49:23 +0300 Subject: [PATCH 02/13] chore: update zxing browser to version 5 --- package-lock.json | 10 +++++----- package.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 645ef385d..b0a4f9e94 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "@liskhq/lisk-validator": "^0.9.0", "@mdi/font": "^7.4.47", "@stablelib/utf8": "^1.0.2", - "@zxing/browser": "^0.1.4", + "@zxing/browser": "^0.1.5", "@zxing/library": "^0.21.0", "assert": "^2.1.0", "axios": "^1.6.8", @@ -6671,14 +6671,14 @@ "peer": true }, "node_modules/@zxing/browser": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/@zxing/browser/-/browser-0.1.4.tgz", - "integrity": "sha512-WYjaav7St4sj/u/Km2llE4NU2Pq3JFIWnczr0tmyCC1KUlp08rV3qpu7iiEB4kOx/CgcCzrSebNnSmFt5B3IFg==", + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/@zxing/browser/-/browser-0.1.5.tgz", + "integrity": "sha512-4Lmrn/il4+UNb87Gk8h1iWnhj39TASEHpd91CwwSJtY5u+wa0iH9qS0wNLAWbNVYXR66WmT5uiMhZ7oVTrKfxw==", "optionalDependencies": { "@zxing/text-encoding": "^0.9.0" }, "peerDependencies": { - "@zxing/library": "^0.20.0" + "@zxing/library": "^0.21.0" } }, "node_modules/@zxing/library": { diff --git a/package.json b/package.json index cb02de43d..1bd5437da 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "@liskhq/lisk-validator": "^0.9.0", "@mdi/font": "^7.4.47", "@stablelib/utf8": "^1.0.2", - "@zxing/browser": "^0.1.4", + "@zxing/browser": "^0.1.5", "@zxing/library": "^0.21.0", "assert": "^2.1.0", "axios": "^1.6.8", From 1ca56c74c7e643947e2aff160b42760c05d00b3c Mon Sep 17 00:00:00 2001 From: aineo <124525926+aineo@users.noreply.github.com> Date: Mon, 10 Jun 2024 15:58:00 +0300 Subject: [PATCH 03/13] fix: mobile devices can contain more than two cameras --- src/components/QrcodeScannerDialog.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/QrcodeScannerDialog.vue b/src/components/QrcodeScannerDialog.vue index d33ddde05..c73564d21 100644 --- a/src/components/QrcodeScannerDialog.vue +++ b/src/components/QrcodeScannerDialog.vue @@ -106,7 +106,7 @@ export default { watch: { cameras(cameras) { if (cameras.length > 0) { - const cameraKey = cameras.length === 2 ? 1 : 0 + const cameraKey = cameras.length >= 2 ? 1 : 0 this.currentCamera = this.cameras[cameraKey].deviceId this.cameraStatus = 'active' From 597b5fa86072dfb16e14e5dcbab3363166c13de8 Mon Sep 17 00:00:00 2001 From: aineo <124525926+aineo@users.noreply.github.com> Date: Fri, 14 Jun 2024 12:42:53 +0300 Subject: [PATCH 04/13] chore: refactor to composition api & from zxing/library to zxing/browser --- src/components/QrcodeScannerDialog.vue | 172 +++++++++++++++---------- src/lib/zxing/index.js | 30 ----- src/lib/zxing/index.ts | 26 ++++ 3 files changed, 132 insertions(+), 96 deletions(-) delete mode 100644 src/lib/zxing/index.js create mode 100644 src/lib/zxing/index.ts diff --git a/src/components/QrcodeScannerDialog.vue b/src/components/QrcodeScannerDialog.vue index c73564d21..7472b8943 100644 --- a/src/components/QrcodeScannerDialog.vue +++ b/src/components/QrcodeScannerDialog.vue @@ -1,6 +1,6 @@