@pinwheel/react-native-pinwheel 2.3.17 → 2.4.0
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/README.md +4 -0
- package/lib/constants.d.ts +1 -1
- package/lib/constants.js +1 -1
- package/lib/index.d.ts +11 -11
- package/lib/index.js +15 -15
- package/package.json +4 -12
package/README.md
CHANGED
|
@@ -28,6 +28,10 @@ You may want to run the example app locally to get started.
|
|
|
28
28
|
###### Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65
|
|
29
29
|
- Try downloading Xcode 14.2 from https://developer.apple.com/download/all/?q=xcode
|
|
30
30
|
|
|
31
|
+
###### Failed to locate 'git', requesting installation of command line developer tools
|
|
32
|
+
For this or other errors related to command line developer tools:
|
|
33
|
+
- Make sure you have Command Line Tools for Xcode 14.2 installed
|
|
34
|
+
- Open Xcode > Click Xcode in the app menu > Settings > Locations > Command Line Tools dropdown and set the correct location
|
|
31
35
|
|
|
32
36
|
## Installation
|
|
33
37
|
|
package/lib/constants.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Importing package.json here causes a problem with the folder structure when we npm pack and publish.
|
|
3
3
|
*/
|
|
4
|
-
export declare const VERSION = "2.3.
|
|
4
|
+
export declare const VERSION = "2.3.18";
|
|
5
5
|
export declare const LINK_PAGE_URL = "https://cdn.getpinwheel.com/link-v2.3.0.html";
|
|
6
6
|
export declare const PINWHEEL_DOMAIN = "getpinwheel.com";
|
package/lib/constants.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Importing package.json here causes a problem with the folder structure when we npm pack and publish.
|
|
3
3
|
*/
|
|
4
|
-
export const VERSION = '2.3.
|
|
4
|
+
export const VERSION = '2.3.18';
|
|
5
5
|
export const LINK_PAGE_URL = 'https://cdn.getpinwheel.com/link-v2.3.0.html';
|
|
6
6
|
export const PINWHEEL_DOMAIN = 'getpinwheel.com';
|
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
export declare const PINWHEEL_MESSAGE_TYPES: {
|
|
3
3
|
PINWHEEL_EXIT: string;
|
|
4
4
|
PINWHEEL_MODAL_CLOSE: string;
|
|
@@ -6,7 +6,7 @@ export declare const PINWHEEL_MESSAGE_TYPES: {
|
|
|
6
6
|
PINWHEEL_SUCCESS: string;
|
|
7
7
|
PINWHEEL_EVENT: string;
|
|
8
8
|
};
|
|
9
|
-
export
|
|
9
|
+
export type LinkResult = {
|
|
10
10
|
accountId: string;
|
|
11
11
|
platformId: string;
|
|
12
12
|
job: string;
|
|
@@ -17,7 +17,7 @@ export declare type LinkResult = {
|
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
|
-
export
|
|
20
|
+
export type ScreenTransition = {
|
|
21
21
|
screenName: string;
|
|
22
22
|
selectedEmployerId?: string;
|
|
23
23
|
selectedEmployerName?: string;
|
|
@@ -28,21 +28,21 @@ export declare type ScreenTransition = {
|
|
|
28
28
|
* @deprecated This type will be removed in version 2.4. Use the renamed type `PinwheelErrorType`
|
|
29
29
|
* instead.
|
|
30
30
|
*/
|
|
31
|
-
export
|
|
32
|
-
export
|
|
31
|
+
export type ErrorType = 'clientError' | 'systemError' | 'userActionRequired' | 'platformError' | 'invalidAccountsConfiguration' | 'invalidUserInput' | 'invalidLinkToken';
|
|
32
|
+
export type PinwheelErrorType = ErrorType;
|
|
33
33
|
/**
|
|
34
34
|
* @deprecated The type should not be used as it clashes with the native JS `Error` object.
|
|
35
35
|
* You should use `PinwheelError` instead. `Error` will be removed in version 2.4
|
|
36
36
|
*/
|
|
37
|
-
export
|
|
37
|
+
export type Error = {
|
|
38
38
|
type: PinwheelErrorType;
|
|
39
39
|
code: string;
|
|
40
40
|
message: string;
|
|
41
41
|
pendingRetry: boolean;
|
|
42
42
|
};
|
|
43
|
-
export
|
|
44
|
-
export
|
|
45
|
-
export
|
|
43
|
+
export type PinwheelError = Error;
|
|
44
|
+
export type EmptyPayloadObject = Record<string, never>;
|
|
45
|
+
export type EventPayload = {
|
|
46
46
|
selectedEmployerId: string;
|
|
47
47
|
selectedEmployerName: string;
|
|
48
48
|
} | {
|
|
@@ -55,7 +55,7 @@ export declare type EventPayload = {
|
|
|
55
55
|
accountId: string;
|
|
56
56
|
platformId: string;
|
|
57
57
|
} | ScreenTransition | PinwheelError | EmptyPayloadObject | undefined;
|
|
58
|
-
|
|
58
|
+
type PinwheelProps = {
|
|
59
59
|
linkToken: string;
|
|
60
60
|
onLogin?: (result: {
|
|
61
61
|
accountId: string;
|
|
@@ -69,5 +69,5 @@ declare type PinwheelProps = {
|
|
|
69
69
|
onExit?: (error: PinwheelError | EmptyPayloadObject) => void;
|
|
70
70
|
onEvent?: (eventName: string, payload: EventPayload) => void;
|
|
71
71
|
};
|
|
72
|
-
declare const _default: ({ linkToken, onLogin, onLoginAttempt, onSuccess, onError, onExit, onEvent }: PinwheelProps) => JSX.Element;
|
|
72
|
+
declare const _default: ({ linkToken, onLogin, onLoginAttempt, onSuccess, onError, onExit, onEvent }: PinwheelProps) => React.JSX.Element;
|
|
73
73
|
export default _default;
|
package/lib/index.js
CHANGED
|
@@ -103,20 +103,20 @@ export default ({ linkToken, onLogin, onLoginAttempt, onSuccess, onError, onExit
|
|
|
103
103
|
`;
|
|
104
104
|
return (<SafeAreaView style={styles.container}>
|
|
105
105
|
<WebView source={{ uri: LINK_PAGE_URL }} onMessage={handleEvent} injectedJavaScript={runFirst} onShouldStartLoadWithRequest={(request) => {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
106
|
+
const targetURL = request.url;
|
|
107
|
+
const isLinkPage = targetURL.includes(PINWHEEL_DOMAIN);
|
|
108
|
+
if (!isLinkPage) {
|
|
109
|
+
Linking.canOpenURL(targetURL).then(supported => {
|
|
110
|
+
if (supported) {
|
|
111
|
+
Linking.openURL(targetURL).then(() => { });
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
console.warn('Don\'t know how to open URL: ' + targetURL);
|
|
115
|
+
}
|
|
116
|
+
return false;
|
|
117
|
+
}).catch(err => console.error('An error occurred ', err));
|
|
118
|
+
}
|
|
119
|
+
return isLinkPage;
|
|
120
|
+
}}/>
|
|
121
121
|
</SafeAreaView>);
|
|
122
122
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pinwheel/react-native-pinwheel",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Pinwheel React Native SDK",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -18,19 +18,11 @@
|
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"react": "^16.13.1 || ^17 || ^18",
|
|
20
20
|
"react-native": "*",
|
|
21
|
-
"react-native-webview": "
|
|
21
|
+
"react-native-webview": "*"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@types/react-native": "^0.
|
|
25
|
-
"react-native-webview": "^
|
|
24
|
+
"@types/react-native": "^0.72.2",
|
|
25
|
+
"react-native-webview": "^13.3.1",
|
|
26
26
|
"typescript": "^4.0.3"
|
|
27
|
-
},
|
|
28
|
-
"overrides": {
|
|
29
|
-
"react-native": {
|
|
30
|
-
"hermes-engine": "0.11.0"
|
|
31
|
-
},
|
|
32
|
-
"@react-native-community/cli-tools": {
|
|
33
|
-
"shell-quote": "^1.7.4"
|
|
34
|
-
}
|
|
35
27
|
}
|
|
36
28
|
}
|