@dynamic-labs/utils 0.18.0-RC.15 → 0.18.0-RC.17
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/CHANGELOG.md +37 -0
- package/package.json +2 -2
- package/src/index.cjs +1 -0
- package/src/index.js +1 -1
- package/src/isMobile.cjs +20 -0
- package/src/isMobile.d.ts +1 -0
- package/src/isMobile.js +20 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,41 @@
|
|
|
1
1
|
|
|
2
|
+
## [0.18.0-RC.17](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.16...v0.18.0-RC.17) (2023-07-24)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add ongoingVerifications object disclaiming which verifications are in progress ([#2633](https://github.com/dynamic-labs/DynamicAuth/issues/2633)) ([948c778](https://github.com/dynamic-labs/DynamicAuth/commit/948c778e5955fcf80e31ac7f368e7605cd7eb7d5))
|
|
8
|
+
* add rabby wallet support ([#2590](https://github.com/dynamic-labs/DynamicAuth/issues/2590)) ([d70c49d](https://github.com/dynamic-labs/DynamicAuth/commit/d70c49d0b348ced3ee5691fdfc19b3eef5ba79db))
|
|
9
|
+
* **DYN-2399:** send dynamicContext props from sdk to api ([#2659](https://github.com/dynamic-labs/DynamicAuth/issues/2659)) ([f06787b](https://github.com/dynamic-labs/DynamicAuth/commit/f06787bf6ec1dc69c53ee6287fd3721d47901ad1))
|
|
10
|
+
* introduce MenuList and Dropdown components to unify previously redundant implementations ([#2675](https://github.com/dynamic-labs/DynamicAuth/issues/2675)) ([dfc63a5](https://github.com/dynamic-labs/DynamicAuth/commit/dfc63a5fef2c00cf0187e7a481dc3267d44f6cc3))
|
|
11
|
+
* **QNTM-101:** add loading state to button ([#2691](https://github.com/dynamic-labs/DynamicAuth/issues/2691)) ([5a7b539](https://github.com/dynamic-labs/DynamicAuth/commit/5a7b5392c4b17cc26ecc621d11afdf37f2f10c65))
|
|
12
|
+
* update blocto version to v2 ([#2651](https://github.com/dynamic-labs/DynamicAuth/issues/2651)) ([441f85e](https://github.com/dynamic-labs/DynamicAuth/commit/441f85efa3921a57b9b282631016162902c8aabb))
|
|
13
|
+
* verify connected wallets network at runtime ([#2667](https://github.com/dynamic-labs/DynamicAuth/issues/2667)) ([8fa8dcc](https://github.com/dynamic-labs/DynamicAuth/commit/8fa8dccdfcb56d9d76d0cd00a153a95e5d52b4dc))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* correctly round balance numbers on widget ([#2625](https://github.com/dynamic-labs/DynamicAuth/issues/2625)) ([7b45483](https://github.com/dynamic-labs/DynamicAuth/commit/7b45483e7bdb458434b7787f9df930ba9acbc8e0))
|
|
19
|
+
* decrease NetworkNotSupported useEffects calls to avoid race condition ([#2731](https://github.com/dynamic-labs/DynamicAuth/issues/2731)) ([6a7baf1](https://github.com/dynamic-labs/DynamicAuth/commit/6a7baf1c63e82b27d03540d670603fe11685348a))
|
|
20
|
+
* **GVTY-58:** do not allow users to submit empty whitespace strings in onboarding form ([#2720](https://github.com/dynamic-labs/DynamicAuth/issues/2720)) ([916f27a](https://github.com/dynamic-labs/DynamicAuth/commit/916f27a5c880281245c71af3f16217cda5317c26))
|
|
21
|
+
* playwright tests were failing due to new cookies popup that overlapped sdk modal ([#2709](https://github.com/dynamic-labs/DynamicAuth/issues/2709)) ([9254777](https://github.com/dynamic-labs/DynamicAuth/commit/92547773047687fcc50ad6b895b1b59176d42af7))
|
|
22
|
+
* **QNTM-111:** call onConnectSuccess with correct wallet connector in… ([#2724](https://github.com/dynamic-labs/DynamicAuth/issues/2724)) ([159e78c](https://github.com/dynamic-labs/DynamicAuth/commit/159e78ce458762f0e2ccbaf2acbc81efde35830a))
|
|
23
|
+
* **QNTM-98:** improve connectedWallets state management and connected wallets events listeners ([#2696](https://github.com/dynamic-labs/DynamicAuth/issues/2696)) ([3a91a37](https://github.com/dynamic-labs/DynamicAuth/commit/3a91a371423f50d28640141d0ca6a643a8dcf25a))
|
|
24
|
+
* update broken safe icon ([#2713](https://github.com/dynamic-labs/DynamicAuth/issues/2713)) ([42943b4](https://github.com/dynamic-labs/DynamicAuth/commit/42943b4684c165ec103fbed0e69e691bee4d305f))
|
|
25
|
+
|
|
26
|
+
## [0.18.0-RC.16](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.15...v0.18.0-RC.16) (2023-07-18)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Features
|
|
30
|
+
|
|
31
|
+
* **QNTM-30:** add spinner to log out button ([#2663](https://github.com/dynamic-labs/DynamicAuth/issues/2663)) ([fceafbb](https://github.com/dynamic-labs/DynamicAuth/commit/fceafbb6fecf323df39ac3a8f518ba8005d4b550))
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Bug Fixes
|
|
35
|
+
|
|
36
|
+
* handle edge cases for missing projectSettings for PoweredByDynamic ([#2684](https://github.com/dynamic-labs/DynamicAuth/issues/2684)) ([6f5b3d8](https://github.com/dynamic-labs/DynamicAuth/commit/6f5b3d8d1b1d4aed0dd2e73e5423f6e50347ff3d))
|
|
37
|
+
* typo in blocked view ([#2673](https://github.com/dynamic-labs/DynamicAuth/issues/2673)) ([034bdaf](https://github.com/dynamic-labs/DynamicAuth/commit/034bdafb44b767600ea7c0148f39dd026280e3b8))
|
|
38
|
+
|
|
2
39
|
## [0.18.0-RC.15](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.14...v0.18.0-RC.15) (2023-07-18)
|
|
3
40
|
|
|
4
41
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/utils",
|
|
3
|
-
"version": "0.18.0-RC.
|
|
3
|
+
"version": "0.18.0-RC.17",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"./package.json": "./package.json"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@dynamic-labs/types": "0.18.0-RC.
|
|
29
|
+
"@dynamic-labs/types": "0.18.0-RC.17"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {}
|
|
32
32
|
}
|
package/src/index.cjs
CHANGED
|
@@ -46,6 +46,7 @@ exports.isAndroid = isMobile.isAndroid;
|
|
|
46
46
|
exports.isIOS = isMobile.isIOS;
|
|
47
47
|
exports.isIPad = isMobile.isIPad;
|
|
48
48
|
exports.isIPhone = isMobile.isIPhone;
|
|
49
|
+
exports.isLegacySafari = isMobile.isLegacySafari;
|
|
49
50
|
exports.isMobile = isMobile.isMobile;
|
|
50
51
|
exports.isSamsungBrowser = isMobile.isSamsungBrowser;
|
|
51
52
|
exports.getItemAsync = localStorageAsync.getItemAsync;
|
package/src/index.js
CHANGED
|
@@ -15,6 +15,6 @@ export { MissingEnvironmentIdError } from './errors/MissingEnvironmentIdError.js
|
|
|
15
15
|
export { GateBlockedError } from './errors/GateBlockedError.js';
|
|
16
16
|
export { CancellablePromise } from './CancellablePromise/CancellablePromise.js';
|
|
17
17
|
export { isFunction } from './isFunction/isFunction.js';
|
|
18
|
-
export { isAndroid, isIOS, isIPad, isIPhone, isMobile, isSamsungBrowser } from './isMobile.js';
|
|
18
|
+
export { isAndroid, isIOS, isIPad, isIPhone, isLegacySafari, isMobile, isSamsungBrowser } from './isMobile.js';
|
|
19
19
|
export { getItemAsync, removeItemAsync, setItemAsync } from './localStorageAsync.js';
|
|
20
20
|
export { bufferToBase64 } from './bufferToBase64.js';
|
package/src/isMobile.cjs
CHANGED
|
@@ -41,6 +41,25 @@ const isIOS = (maxTouchPointsOverride) => {
|
|
|
41
41
|
return isIPhone() || isIPad(maxTouchPointsOverride);
|
|
42
42
|
};
|
|
43
43
|
const isAndroid = () => isMobile() && !isIOS();
|
|
44
|
+
const extractSafariVersion = () => {
|
|
45
|
+
const userAgent = navigator.userAgent.toLowerCase();
|
|
46
|
+
const versionIndex = userAgent.indexOf('version/');
|
|
47
|
+
if (versionIndex !== -1) {
|
|
48
|
+
const versionSubstring = userAgent.substring(versionIndex);
|
|
49
|
+
const endIndex = versionSubstring.indexOf(' ');
|
|
50
|
+
const version = versionSubstring.substring(8, endIndex);
|
|
51
|
+
return version;
|
|
52
|
+
}
|
|
53
|
+
return null;
|
|
54
|
+
};
|
|
55
|
+
const isLegacySafari = () => {
|
|
56
|
+
const safariVersion = extractSafariVersion();
|
|
57
|
+
if (!safariVersion) {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
const [version] = safariVersion.split('.');
|
|
61
|
+
return Number(version) < 15;
|
|
62
|
+
};
|
|
44
63
|
const isSamsungBrowser = () => {
|
|
45
64
|
if (typeof window === 'undefined' || typeof navigator === 'undefined') {
|
|
46
65
|
return false;
|
|
@@ -52,5 +71,6 @@ exports.isAndroid = isAndroid;
|
|
|
52
71
|
exports.isIOS = isIOS;
|
|
53
72
|
exports.isIPad = isIPad;
|
|
54
73
|
exports.isIPhone = isIPhone;
|
|
74
|
+
exports.isLegacySafari = isLegacySafari;
|
|
55
75
|
exports.isMobile = isMobile;
|
|
56
76
|
exports.isSamsungBrowser = isSamsungBrowser;
|
package/src/isMobile.d.ts
CHANGED
|
@@ -11,4 +11,5 @@ export declare const isIPhone: () => boolean;
|
|
|
11
11
|
export declare const isIPad: (maxTouchPointsOverride?: number) => boolean;
|
|
12
12
|
export declare const isIOS: (maxTouchPointsOverride?: number) => boolean;
|
|
13
13
|
export declare const isAndroid: () => boolean;
|
|
14
|
+
export declare const isLegacySafari: () => boolean;
|
|
14
15
|
export declare const isSamsungBrowser: () => boolean;
|
package/src/isMobile.js
CHANGED
|
@@ -37,6 +37,25 @@ const isIOS = (maxTouchPointsOverride) => {
|
|
|
37
37
|
return isIPhone() || isIPad(maxTouchPointsOverride);
|
|
38
38
|
};
|
|
39
39
|
const isAndroid = () => isMobile() && !isIOS();
|
|
40
|
+
const extractSafariVersion = () => {
|
|
41
|
+
const userAgent = navigator.userAgent.toLowerCase();
|
|
42
|
+
const versionIndex = userAgent.indexOf('version/');
|
|
43
|
+
if (versionIndex !== -1) {
|
|
44
|
+
const versionSubstring = userAgent.substring(versionIndex);
|
|
45
|
+
const endIndex = versionSubstring.indexOf(' ');
|
|
46
|
+
const version = versionSubstring.substring(8, endIndex);
|
|
47
|
+
return version;
|
|
48
|
+
}
|
|
49
|
+
return null;
|
|
50
|
+
};
|
|
51
|
+
const isLegacySafari = () => {
|
|
52
|
+
const safariVersion = extractSafariVersion();
|
|
53
|
+
if (!safariVersion) {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
const [version] = safariVersion.split('.');
|
|
57
|
+
return Number(version) < 15;
|
|
58
|
+
};
|
|
40
59
|
const isSamsungBrowser = () => {
|
|
41
60
|
if (typeof window === 'undefined' || typeof navigator === 'undefined') {
|
|
42
61
|
return false;
|
|
@@ -44,4 +63,4 @@ const isSamsungBrowser = () => {
|
|
|
44
63
|
return navigator.userAgent.includes('SamsungBrowser');
|
|
45
64
|
};
|
|
46
65
|
|
|
47
|
-
export { isAndroid, isIOS, isIPad, isIPhone, isMobile, isSamsungBrowser };
|
|
66
|
+
export { isAndroid, isIOS, isIPad, isIPhone, isLegacySafari, isMobile, isSamsungBrowser };
|