diff --git a/.babelrc b/.babelrc deleted file mode 100644 index c53b1eb0..00000000 --- a/.babelrc +++ /dev/null @@ -1,19 +0,0 @@ -{ - "presets": [ - [ - "@babel/typescript" - ], - [ - "@babel/preset-env" - ], - [ - "@babel/preset-react" - ] - ], - "plugins": [ - "@babel/plugin-proposal-class-properties", - "@babel/plugin-proposal-nullish-coalescing-operator", - "@babel/plugin-syntax-nullish-coalescing-operator", - "@babel/plugin-proposal-logical-assignment-operators" - ] -} diff --git a/.eslintignore b/.eslintignore index 0b38965c..311031c5 100644 --- a/.eslintignore +++ b/.eslintignore @@ -9,6 +9,7 @@ src/lib/noble-ed25519/index.js src/lib/dexie/ src/lib/axios-retry/ src/lib/is-retry-allowed/ +babel.config.js jest.config.js playwright.config.ts postcss.config.js diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 00000000..0db7c16b --- /dev/null +++ b/babel.config.js @@ -0,0 +1,19 @@ +module.exports = { + presets: [ + [ + '@babel/typescript' + ], + [ + '@babel/preset-env' + ], + [ + '@babel/preset-react' + ] + ], + plugins: [ + '@babel/plugin-proposal-class-properties', + '@babel/plugin-proposal-nullish-coalescing-operator', + '@babel/plugin-syntax-nullish-coalescing-operator', + '@babel/plugin-proposal-logical-assignment-operators' + ] +}; diff --git a/changelogs/3.2.7.txt b/changelogs/3.2.7.txt new file mode 100644 index 00000000..619f4cd5 --- /dev/null +++ b/changelogs/3.2.7.txt @@ -0,0 +1 @@ +Bug fixes and performance improvements diff --git a/jest.config.js b/jest.config.js index a26a92d7..eac97690 100644 --- a/jest.config.js +++ b/jest.config.js @@ -14,4 +14,7 @@ module.exports = { '\\.(jsx?|tsx?)$': 'babel-jest', '\\.txt$': 'jest-raw-loader', }, + transformIgnorePatterns: [ + '/node_modules/(?!(axios)/)', + ], }; diff --git a/package-lock.json b/package-lock.json index 9a2d15f0..d97cf14a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "mytonwallet", - "version": "3.2.6", + "version": "3.2.7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "mytonwallet", - "version": "3.2.6", + "version": "3.2.7", "license": "GPL-3.0-or-later", "dependencies": { "@awesome-cordova-plugins/core": "6.9.0", @@ -51,7 +51,7 @@ "qr-code-styling": "github:mytonwallet-org/qr-code-styling#8d56b409da29122a92da2767d049b45b1bc24db2", "qrcode-generator": "1.4.4", "stream-browserify": "3.0.0", - "tonapi-sdk-js": "2.0.3", + "tonapi-sdk-js": "2.0.7", "tonweb-mnemonic": "1.0.1", "tronweb": "6.0.0", "tweetnacl": "1.0.3", @@ -24154,7 +24154,9 @@ } }, "node_modules/tonapi-sdk-js": { - "version": "2.0.3", + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/tonapi-sdk-js/-/tonapi-sdk-js-2.0.7.tgz", + "integrity": "sha512-9NAaOTGwIxe2lch12swTIm1BrYeLrofDP/6LMVSXbUYdQKSaDBex/ekYnZ0h9CZAn4kdGnKZkcqTUb/jjcL81w==", "license": "MIT" }, "node_modules/tonweb-mnemonic": { diff --git a/package.json b/package.json index 956b5665..2439fa53 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mytonwallet", - "version": "3.2.6", + "version": "3.2.7", "description": "The most feature-rich web wallet and browser extension for TON – with support of multi-accounts, tokens (jettons), NFT, TON DNS, TON Sites, TON Proxy, and TON Magic.", "main": "index.js", "scripts": { @@ -225,7 +225,7 @@ "qr-code-styling": "github:mytonwallet-org/qr-code-styling#8d56b409da29122a92da2767d049b45b1bc24db2", "qrcode-generator": "1.4.4", "stream-browserify": "3.0.0", - "tonapi-sdk-js": "2.0.3", + "tonapi-sdk-js": "2.0.7", "tonweb-mnemonic": "1.0.1", "tronweb": "6.0.0", "tweetnacl": "1.0.3", diff --git a/public/static-sites/_common/images/QR-code-1.5x.webp b/public/static-sites/_common/images/QR-code-1.5x.webp deleted file mode 100644 index aeb05474..00000000 Binary files a/public/static-sites/_common/images/QR-code-1.5x.webp and /dev/null differ diff --git a/public/static-sites/_common/images/QR-code-1x.webp b/public/static-sites/_common/images/QR-code-1x.webp deleted file mode 100644 index 22a6d240..00000000 Binary files a/public/static-sites/_common/images/QR-code-1x.webp and /dev/null differ diff --git a/public/static-sites/_common/images/QR-code-2x.webp b/public/static-sites/_common/images/QR-code-2x.webp deleted file mode 100644 index d1bff43f..00000000 Binary files a/public/static-sites/_common/images/QR-code-2x.webp and /dev/null differ diff --git a/public/static-sites/_common/images/logo.svg b/public/static-sites/_common/images/logo.svg new file mode 100644 index 00000000..5e4d3a57 --- /dev/null +++ b/public/static-sites/_common/images/logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/static-sites/_common/index.css b/public/static-sites/_common/index.css index 49039834..e0b1429d 100644 --- a/public/static-sites/_common/index.css +++ b/public/static-sites/_common/index.css @@ -256,9 +256,23 @@ a:hover { border-radius: 1.25rem; } -.qr-code.without-margin { - margin: 0 !important; - margin-top: -16px !important; +.qr-code-canvas { + position: relative; + + width: 12rem; + height: 12rem; + + background: white; + border-radius: 1.25rem; +} + +.qr-code-canvas canvas { + position: absolute; + top: 0.5rem; + left: 0.5rem; + + width: calc(100% - 1rem); + height: calc(100% - 1rem); } .special-section { diff --git a/public/static-sites/connect/desktop.html b/public/static-sites/connect/desktop.html index e864aca4..a0b98178 100644 --- a/public/static-sites/connect/desktop.html +++ b/public/static-sites/connect/desktop.html @@ -5,6 +5,7 @@ MyTonWallet Connect +
@@ -15,11 +16,7 @@

Connect MyTonWallet

Scan QR to open the app
on your mobile device:

- +
On Desktop @@ -54,14 +51,33 @@

Connect MyTonWallet

const { pathname, search, + hash, } = location; - const redirectTo = search; + const QR_SIZE = 600; - document.getElementById('btn-sign-in').href = `mytonwallet-tc://${redirectTo}`; + const redirectTo = hash.slice(1) || search; + const fullRedirectUrl = `mytonwallet-tc://${redirectTo}`; + + document.getElementById('btn-sign-in').href = fullRedirectUrl; + + const qrCode = new QRCodeStyling({ + width: QR_SIZE, + height: QR_SIZE, + image: './images/logo.svg', + margin: 0, + type: 'canvas', + dotsOptions: { type: 'rounded' }, + cornersSquareOptions: { type: 'extra-rounded' }, + imageOptions: { imageSize: 0.4, margin: 8, crossOrigin: 'anonymous' }, + qrOptions: { errorCorrectionLevel: 'M' }, + data: fullRedirectUrl, + }); + + qrCode.append(document.querySelector(".qr-code-canvas")); if (!search?.includes('no-redirect')) { - location.href = `mytonwallet-tc://${redirectTo}`; + location.href = fullRedirectUrl; history.replaceState({}, '', `${pathname}${search}${search ? '&' : '?'}no-redirect`); } diff --git a/public/static-sites/connect/index.html b/public/static-sites/connect/index.html index 669454d5..1c0b00cd 100644 --- a/public/static-sites/connect/index.html +++ b/public/static-sites/connect/index.html @@ -36,14 +36,9 @@

Connect MyTonWallet

+ @@ -18,17 +19,31 @@

MyTonWallet App


on your mobile device: - +
+ diff --git a/public/static-sites/go/desktop.html b/public/static-sites/go/desktop.html index a255ae46..764c4492 100644 --- a/public/static-sites/go/desktop.html +++ b/public/static-sites/go/desktop.html @@ -5,6 +5,7 @@ Open MyTonWallet +
@@ -15,11 +16,7 @@

Open MyTonWallet

Scan QR to open the app
on your mobile device:

- +
On Desktop @@ -49,14 +46,33 @@

Open MyTonWallet

const { pathname, search, + hash, } = location; - const redirectTo = `${pathname.slice(1)}${search}`; + const QR_SIZE = 600; - document.getElementById('btn-sign-in').href = `mtw://${redirectTo}`; + const redirectTo = hash.slice(1) || `${pathname.slice(1)}${search}`; + const fullRedirectUrl = `mtw://${redirectTo}`; + + document.getElementById('btn-sign-in').href = fullRedirectUrl; + + const qrCode = new QRCodeStyling({ + width: QR_SIZE, + height: QR_SIZE, + image: './images/logo.svg', + margin: 0, + type: 'canvas', + dotsOptions: { type: 'rounded' }, + cornersSquareOptions: { type: 'extra-rounded' }, + imageOptions: { imageSize: 0.4, margin: 8, crossOrigin: 'anonymous' }, + qrOptions: { errorCorrectionLevel: 'M' }, + data: fullRedirectUrl, + }); + + qrCode.append(document.querySelector(".qr-code-canvas")); if (!search?.includes('no-redirect')) { - location.href = `mtw://${redirectTo}`; + location.href = fullRedirectUrl; history.replaceState({}, '', `${pathname}${search}${search ? '&' : '?'}no-redirect`); } diff --git a/public/static-sites/go/index.html b/public/static-sites/go/index.html index 65d5590e..e8ff4c0e 100644 --- a/public/static-sites/go/index.html +++ b/public/static-sites/go/index.html @@ -6,22 +6,22 @@ Open MyTonWallet