@getpara/react-common 2.0.0-alpha.13 → 2.0.0-alpha.14
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/dist/hooks/index.d.ts
CHANGED
package/dist/hooks/index.js
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../chunk-GOCCUU3Z.js";
|
|
3
|
+
import { UAParser } from "ua-parser-js";
|
|
4
|
+
function useUserAgent() {
|
|
5
|
+
const userAgent = typeof window !== "undefined" ? window.navigator.userAgent : void 0;
|
|
6
|
+
return UAParser(userAgent);
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
useUserAgent
|
|
10
|
+
};
|
|
@@ -10,5 +10,5 @@ export type BiometricHints = {
|
|
|
10
10
|
isOnKnownDevice: boolean;
|
|
11
11
|
formattedHints: FormattedBiometricHint[];
|
|
12
12
|
};
|
|
13
|
-
export declare const formatBiometricHints: (hints: BiometricLocationHint[]) => BiometricHints;
|
|
13
|
+
export declare const formatBiometricHints: (hints: BiometricLocationHint[], isPasskeySupported?: boolean) => BiometricHints;
|
|
14
14
|
export {};
|
|
@@ -10,7 +10,7 @@ const formatStringToUUID = (str) => {
|
|
|
10
10
|
}
|
|
11
11
|
return `${str.slice(0, 8)}-${str.slice(8, 12)}-${str.slice(12, 16)}-${str.slice(16, 20)}-${str.slice(20)}`;
|
|
12
12
|
};
|
|
13
|
-
const formatBiometricHints = (hints) => {
|
|
13
|
+
const formatBiometricHints = (hints, isPasskeySupported = false) => {
|
|
14
14
|
let hasMobileDevice = false, isOnKnownDevice = false;
|
|
15
15
|
const deviceParsedUA = UAParser();
|
|
16
16
|
const formattedHintsByKey = {};
|
|
@@ -24,7 +24,7 @@ const formatBiometricHints = (hints) => {
|
|
|
24
24
|
hasMobileDevice = true;
|
|
25
25
|
}
|
|
26
26
|
if (deviceParsedUA) {
|
|
27
|
-
if (deviceParsedUA.browser.name === parsedUA.browser.name && deviceParsedUA.device.type === parsedUA.device.type && deviceParsedUA.device.vendor === parsedUA.device.vendor && deviceParsedUA.device.model === parsedUA.device.model) {
|
|
27
|
+
if (isPasskeySupported && deviceParsedUA.browser.name === parsedUA.browser.name && deviceParsedUA.device.type === parsedUA.device.type && deviceParsedUA.device.vendor === parsedUA.device.vendor && deviceParsedUA.device.model === parsedUA.device.model) {
|
|
28
28
|
isOnKnownDevice = true;
|
|
29
29
|
isKnownDevice = true;
|
|
30
30
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/react-common",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.14",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"*.css"
|
|
12
12
|
],
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@getpara/react-components": "2.0.0-alpha.
|
|
15
|
-
"@getpara/web-sdk": "2.0.0-alpha.
|
|
14
|
+
"@getpara/react-components": "2.0.0-alpha.14",
|
|
15
|
+
"@getpara/web-sdk": "2.0.0-alpha.14",
|
|
16
16
|
"@moonpay/moonpay-react": "^1.8.3",
|
|
17
17
|
"@ramp-network/ramp-instant-sdk": "^4.0.5",
|
|
18
18
|
"@stripe/crypto": "^0.0.4",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"resolutions": {
|
|
43
43
|
"styled-components": "^6"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "03898846281bf37536a6ed12dede119e6171ad45"
|
|
46
46
|
}
|