@dynamic-labs/utils 0.19.0-alpha.10 → 0.19.0-alpha.12

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 CHANGED
@@ -1,4 +1,33 @@
1
1
 
2
+ ## [0.19.0-alpha.12](https://github.com/dynamic-labs/DynamicAuth/compare/v0.19.0-alpha.11...v0.19.0-alpha.12) (2023-10-03)
3
+
4
+
5
+ ### Features
6
+
7
+ * filter wallet list for wallets which have not been connected ([#3499](https://github.com/dynamic-labs/DynamicAuth/issues/3499)) ([10e531f](https://github.com/dynamic-labs/DynamicAuth/commit/10e531f0836b029ab43713b9b2c7ecf273a4018c))
8
+ * passkey flow copies should be fully editable ([#3504](https://github.com/dynamic-labs/DynamicAuth/issues/3504)) ([390392c](https://github.com/dynamic-labs/DynamicAuth/commit/390392cc5c95afd0226f29a72560c295fa2be391))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * remove useEffect in useSetWalletConnectorVerifiedCredentials to avoid race conditions ([#3495](https://github.com/dynamic-labs/DynamicAuth/issues/3495)) ([aa17676](https://github.com/dynamic-labs/DynamicAuth/commit/aa176761f324806000317db1f683d545ec642619))
14
+ * show android touch id icon for those with it available on passkey intro ([#3503](https://github.com/dynamic-labs/DynamicAuth/issues/3503)) ([4017f16](https://github.com/dynamic-labs/DynamicAuth/commit/4017f16fe0b0ceeb03f064ac9e9d34b71764b242))
15
+
16
+ ## [0.19.0-alpha.11](https://github.com/dynamic-labs/DynamicAuth/compare/v0.19.0-alpha.10...v0.19.0-alpha.11) (2023-10-02)
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * **AuthProviderIcon:** ensure social icon shows up ([#3439](https://github.com/dynamic-labs/DynamicAuth/issues/3439)) ([5064f28](https://github.com/dynamic-labs/DynamicAuth/commit/5064f28af9125699c8e23597812c6c526bb8a213))
22
+ * fix passkey on Windows ([#3440](https://github.com/dynamic-labs/DynamicAuth/issues/3440)) ([c0da96c](https://github.com/dynamic-labs/DynamicAuth/commit/c0da96c17c6c10a736fb394b6b1e6be3ccd616b2))
23
+ * missing popper provider ([#3488](https://github.com/dynamic-labs/DynamicAuth/issues/3488)) ([d7ca76e](https://github.com/dynamic-labs/DynamicAuth/commit/d7ca76e21dc5e842c316a654cb20d9dd115d7204))
24
+ * passkey intro view should have a logout button ([#3466](https://github.com/dynamic-labs/DynamicAuth/issues/3466)) ([7ae626f](https://github.com/dynamic-labs/DynamicAuth/commit/7ae626fd2b2b6f685e48257c38ed00dae95d06e4))
25
+ * passkey intro view should not be closed until user create wallet ([#3458](https://github.com/dynamic-labs/DynamicAuth/issues/3458)) ([651459b](https://github.com/dynamic-labs/DynamicAuth/commit/651459b8d8a4ad131381ed8de52c9ef0c42191df))
26
+ * removing weird passkey intro logout button hover background ([#3490](https://github.com/dynamic-labs/DynamicAuth/issues/3490)) ([1adedfa](https://github.com/dynamic-labs/DynamicAuth/commit/1adedfaf87e6fd01e8528ff43ccf75fcb020ef65))
27
+ * resolve promise if there's no error, even if result is falsy ([#3477](https://github.com/dynamic-labs/DynamicAuth/issues/3477)) ([1b570dc](https://github.com/dynamic-labs/DynamicAuth/commit/1b570dc8ae6b104567790d93ebb57efed032ba1c))
28
+ * return promise from createEmbeddedWallet ([#3476](https://github.com/dynamic-labs/DynamicAuth/issues/3476)) ([5a9591e](https://github.com/dynamic-labs/DynamicAuth/commit/5a9591e0808d5d16fb886901902d763eabd8ec61))
29
+ * utilize the wallet connector key when looking up the wallet in localstorage during getWalletConnectorByKey ([#3386](https://github.com/dynamic-labs/DynamicAuth/issues/3386)) ([13a8ef4](https://github.com/dynamic-labs/DynamicAuth/commit/13a8ef4581e7799cc467bddb7cd1435dc4ab4de5))
30
+
2
31
  ## [0.19.0-alpha.10](https://github.com/dynamic-labs/DynamicAuth/compare/v0.19.0-alpha.9...v0.19.0-alpha.10) (2023-09-28)
3
32
 
4
33
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/utils",
3
- "version": "0.19.0-alpha.10",
3
+ "version": "0.19.0-alpha.12",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -29,7 +29,7 @@
29
29
  "viem": "^1.5.3"
30
30
  },
31
31
  "dependencies": {
32
- "@dynamic-labs/logger": "0.19.0-alpha.10",
33
- "@dynamic-labs/types": "0.19.0-alpha.10"
32
+ "@dynamic-labs/logger": "0.19.0-alpha.12",
33
+ "@dynamic-labs/types": "0.19.0-alpha.12"
34
34
  }
35
35
  }
package/src/index.cjs CHANGED
@@ -54,6 +54,7 @@ exports.UserHasAccountWithEmailError = UserHasAccountWithEmailError.UserHasAccou
54
54
  exports.SocialAccountAlreadyExistsError = SocialAccountAlreadyExistsError.SocialAccountAlreadyExistsError;
55
55
  exports.CancellablePromise = CancellablePromise.CancellablePromise;
56
56
  exports.isFunction = isFunction.isFunction;
57
+ exports.getAndroidVersion = isMobile.getAndroidVersion;
57
58
  exports.isAndroid = isMobile.isAndroid;
58
59
  exports.isIOS = isMobile.isIOS;
59
60
  exports.isIPad = isMobile.isIPad;
@@ -62,6 +63,7 @@ exports.isIPhone8OrEarlier = isMobile.isIPhone8OrEarlier;
62
63
  exports.isLegacySafari = isMobile.isLegacySafari;
63
64
  exports.isMobile = isMobile.isMobile;
64
65
  exports.isSamsungBrowser = isMobile.isSamsungBrowser;
66
+ exports.isWindows = isMobile.isWindows;
65
67
  exports.getItemAsync = localStorageAsync.getItemAsync;
66
68
  exports.removeItemAsync = localStorageAsync.removeItemAsync;
67
69
  exports.setItemAsync = localStorageAsync.setItemAsync;
package/src/index.js CHANGED
@@ -18,7 +18,7 @@ export { UserHasAccountWithEmailError } from './errors/UserHasAccountWithEmailEr
18
18
  export { SocialAccountAlreadyExistsError } from './errors/SocialAccountAlreadyExistsError.js';
19
19
  export { CancellablePromise } from './CancellablePromise/CancellablePromise.js';
20
20
  export { isFunction } from './isFunction/isFunction.js';
21
- export { isAndroid, isIOS, isIPad, isIPhone, isIPhone8OrEarlier, isLegacySafari, isMobile, isSamsungBrowser } from './isMobile.js';
21
+ export { getAndroidVersion, isAndroid, isIOS, isIPad, isIPhone, isIPhone8OrEarlier, isLegacySafari, isMobile, isSamsungBrowser, isWindows } from './isMobile.js';
22
22
  export { getItemAsync, removeItemAsync, setItemAsync } from './localStorageAsync.js';
23
23
  export { bufferToBase64 } from './bufferToBase64.js';
24
24
  export { last } from './last.js';
package/src/isMobile.cjs CHANGED
@@ -62,6 +62,7 @@ const isSamsungBrowser = () => {
62
62
  }
63
63
  return navigator.userAgent.includes('SamsungBrowser');
64
64
  };
65
+ const isWindows = () => window.navigator.userAgent.indexOf('Windows') !== -1;
65
66
  // regex from: https://github.com/matomo-org/device-detector/blob/master/regexes/device/mobiles.yml
66
67
  const iPhoneLegacyRegex = [
67
68
  {
@@ -113,7 +114,16 @@ const iPhoneLegacyRegex = [
113
114
  regex: /(?:MDCR_|ICRU_|Apple-)?(?:iPh(?:one)?10[C,_]25|8PLUS)$/,
114
115
  },
115
116
  ];
117
+ const getAndroidVersion = () => {
118
+ const androidVersionMatch = navigator.userAgent.match(/Android (\d+(\.\d+)?)/);
119
+ if (!androidVersionMatch) {
120
+ return;
121
+ }
122
+ const androidVersion = parseFloat(androidVersionMatch[1]);
123
+ return androidVersion;
124
+ };
116
125
 
126
+ exports.getAndroidVersion = getAndroidVersion;
117
127
  exports.isAndroid = isAndroid;
118
128
  exports.isIOS = isIOS;
119
129
  exports.isIPad = isIPad;
@@ -122,3 +132,4 @@ exports.isIPhone8OrEarlier = isIPhone8OrEarlier;
122
132
  exports.isLegacySafari = isLegacySafari;
123
133
  exports.isMobile = isMobile;
124
134
  exports.isSamsungBrowser = isSamsungBrowser;
135
+ exports.isWindows = isWindows;
package/src/isMobile.d.ts CHANGED
@@ -14,3 +14,5 @@ export declare const isIOS: (maxTouchPointsOverride?: number) => boolean;
14
14
  export declare const isAndroid: () => boolean;
15
15
  export declare const isLegacySafari: () => boolean;
16
16
  export declare const isSamsungBrowser: () => boolean;
17
+ export declare const isWindows: () => boolean;
18
+ export declare const getAndroidVersion: () => number | undefined;
package/src/isMobile.js CHANGED
@@ -58,6 +58,7 @@ const isSamsungBrowser = () => {
58
58
  }
59
59
  return navigator.userAgent.includes('SamsungBrowser');
60
60
  };
61
+ const isWindows = () => window.navigator.userAgent.indexOf('Windows') !== -1;
61
62
  // regex from: https://github.com/matomo-org/device-detector/blob/master/regexes/device/mobiles.yml
62
63
  const iPhoneLegacyRegex = [
63
64
  {
@@ -109,5 +110,13 @@ const iPhoneLegacyRegex = [
109
110
  regex: /(?:MDCR_|ICRU_|Apple-)?(?:iPh(?:one)?10[C,_]25|8PLUS)$/,
110
111
  },
111
112
  ];
113
+ const getAndroidVersion = () => {
114
+ const androidVersionMatch = navigator.userAgent.match(/Android (\d+(\.\d+)?)/);
115
+ if (!androidVersionMatch) {
116
+ return;
117
+ }
118
+ const androidVersion = parseFloat(androidVersionMatch[1]);
119
+ return androidVersion;
120
+ };
112
121
 
113
- export { isAndroid, isIOS, isIPad, isIPhone, isIPhone8OrEarlier, isLegacySafari, isMobile, isSamsungBrowser };
122
+ export { getAndroidVersion, isAndroid, isIOS, isIPad, isIPhone, isIPhone8OrEarlier, isLegacySafari, isMobile, isSamsungBrowser, isWindows };