@quiltt/react-native 3.9.2 → 3.9.4
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 +20 -0
- package/dist/index.js +47 -12
- package/package.json +6 -6
- package/src/components/QuilttConnector.tsx +39 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @quiltt/react-native
|
|
2
2
|
|
|
3
|
+
## 3.9.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#321](https://github.com/quiltt/quiltt-js/pull/321) [`642ec0f`](https://github.com/quiltt/quiltt-js/commit/642ec0f34f2506672993b82785b5b5ddb5c69069) Thanks [@zubairaziz](https://github.com/zubairaziz)! - Bugfix: iOS WebView header drag behavior and scrolling
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`642ec0f`](https://github.com/quiltt/quiltt-js/commit/642ec0f34f2506672993b82785b5b5ddb5c69069)]:
|
|
10
|
+
- @quiltt/core@3.9.4
|
|
11
|
+
- @quiltt/react@3.9.4
|
|
12
|
+
|
|
13
|
+
## 3.9.3
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [#319](https://github.com/quiltt/quiltt-js/pull/319) [`b97a814`](https://github.com/quiltt/quiltt-js/commit/b97a814b87b8bfec9f8b4bb155e1140724e441eb) Thanks [@zubairaziz](https://github.com/zubairaziz)! - Improve typings for query client and react components
|
|
18
|
+
|
|
19
|
+
- Updated dependencies [[`b97a814`](https://github.com/quiltt/quiltt-js/commit/b97a814b87b8bfec9f8b4bb155e1140724e441eb)]:
|
|
20
|
+
- @quiltt/react@3.9.3
|
|
21
|
+
- @quiltt/core@3.9.3
|
|
22
|
+
|
|
3
23
|
## 3.9.2
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -3,13 +3,13 @@ export * from '@quiltt/core';
|
|
|
3
3
|
import { useQuilttSession, ConnectorSDKEventType } from '@quiltt/react';
|
|
4
4
|
export { QuilttAuthProvider, QuilttProvider, QuilttSettingsProvider, useQuilttClient, useQuilttConnector, useQuilttSession, useQuilttSettings, useSession, useStorage } from '@quiltt/react';
|
|
5
5
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
|
-
import { useRef, useState, useMemo, useEffect
|
|
6
|
+
import { useRef, useState, useCallback, useMemo, useEffect } from 'react';
|
|
7
7
|
import { StyleSheet, Platform, StatusBar, SafeAreaView, View, Text, Pressable, ActivityIndicator, Linking } from 'react-native';
|
|
8
8
|
import { URL } from 'react-native-url-polyfill';
|
|
9
9
|
import { WebView } from 'react-native-webview';
|
|
10
10
|
import { generateStackTrace, makeBacktrace, getCauses } from '@honeybadger-io/core/build/src/util';
|
|
11
11
|
|
|
12
|
-
var version = "3.9.
|
|
12
|
+
var version = "3.9.4";
|
|
13
13
|
|
|
14
14
|
const ErrorReporterConfig = {
|
|
15
15
|
honeybadger_api_key: 'undefined'
|
|
@@ -101,10 +101,10 @@ const getErrorMessage = (responseStatus, error)=>{
|
|
|
101
101
|
|
|
102
102
|
const AndroidSafeAreaView = ({ testId, children })=>/*#__PURE__*/ jsx(SafeAreaView, {
|
|
103
103
|
testID: testId,
|
|
104
|
-
style: styles$
|
|
104
|
+
style: styles$2.AndroidSafeArea,
|
|
105
105
|
children: children
|
|
106
106
|
});
|
|
107
|
-
const styles$
|
|
107
|
+
const styles$2 = StyleSheet.create({
|
|
108
108
|
AndroidSafeArea: {
|
|
109
109
|
flex: 1,
|
|
110
110
|
backgroundColor: 'white',
|
|
@@ -116,8 +116,8 @@ const ErrorScreen = ({ testId, error, cta })=>/*#__PURE__*/ jsx(AndroidSafeAreaV
|
|
|
116
116
|
testId: testId,
|
|
117
117
|
children: /*#__PURE__*/ jsxs(View, {
|
|
118
118
|
style: [
|
|
119
|
-
styles.container,
|
|
120
|
-
styles.padding
|
|
119
|
+
styles$1.container,
|
|
120
|
+
styles$1.padding
|
|
121
121
|
],
|
|
122
122
|
children: [
|
|
123
123
|
/*#__PURE__*/ jsxs(View, {
|
|
@@ -135,14 +135,14 @@ const ErrorScreen = ({ testId, error, cta })=>/*#__PURE__*/ jsx(AndroidSafeAreaV
|
|
|
135
135
|
},
|
|
136
136
|
children: /*#__PURE__*/ jsx(Text, {
|
|
137
137
|
style: [
|
|
138
|
-
styles.title
|
|
138
|
+
styles$1.title
|
|
139
139
|
],
|
|
140
140
|
children: "Cannot connect to the internet."
|
|
141
141
|
})
|
|
142
142
|
}),
|
|
143
143
|
/*#__PURE__*/ jsx(Text, {
|
|
144
144
|
style: [
|
|
145
|
-
styles.subtitle
|
|
145
|
+
styles$1.subtitle
|
|
146
146
|
],
|
|
147
147
|
children: error
|
|
148
148
|
})
|
|
@@ -150,12 +150,12 @@ const ErrorScreen = ({ testId, error, cta })=>/*#__PURE__*/ jsx(AndroidSafeAreaV
|
|
|
150
150
|
}),
|
|
151
151
|
/*#__PURE__*/ jsx(Pressable, {
|
|
152
152
|
style: [
|
|
153
|
-
styles.pressable
|
|
153
|
+
styles$1.pressable
|
|
154
154
|
],
|
|
155
155
|
onPress: cta,
|
|
156
156
|
children: /*#__PURE__*/ jsx(Text, {
|
|
157
157
|
style: [
|
|
158
|
-
styles.pressableText
|
|
158
|
+
styles$1.pressableText
|
|
159
159
|
],
|
|
160
160
|
children: "Exit"
|
|
161
161
|
})
|
|
@@ -163,7 +163,7 @@ const ErrorScreen = ({ testId, error, cta })=>/*#__PURE__*/ jsx(AndroidSafeAreaV
|
|
|
163
163
|
]
|
|
164
164
|
})
|
|
165
165
|
});
|
|
166
|
-
const styles = StyleSheet.create({
|
|
166
|
+
const styles$1 = StyleSheet.create({
|
|
167
167
|
container: {
|
|
168
168
|
flex: 1,
|
|
169
169
|
flexDirection: 'column',
|
|
@@ -259,6 +259,24 @@ const QuilttConnector = ({ testId, connectorId, connectionId, institution, oauth
|
|
|
259
259
|
const [preFlightCheck, setPreFlightCheck] = useState({
|
|
260
260
|
checked: false
|
|
261
261
|
});
|
|
262
|
+
// Script to disable scrolling on header
|
|
263
|
+
const disableHeaderScrollScript = `
|
|
264
|
+
(function() {
|
|
265
|
+
const header = document.querySelector('header');
|
|
266
|
+
if (header) {
|
|
267
|
+
header.style.position = 'fixed';
|
|
268
|
+
header.style.top = '0';
|
|
269
|
+
header.style.left = '0';
|
|
270
|
+
header.style.right = '0';
|
|
271
|
+
header.style.zIndex = '1000';
|
|
272
|
+
}
|
|
273
|
+
})();
|
|
274
|
+
`;
|
|
275
|
+
const onLoadEnd = useCallback(()=>{
|
|
276
|
+
if (Platform.OS === 'ios') {
|
|
277
|
+
webViewRef.current?.injectJavaScript(disableHeaderScrollScript);
|
|
278
|
+
}
|
|
279
|
+
}, []);
|
|
262
280
|
const encodedOAuthRedirectUrl = useMemo(()=>encodeURIComponent(oauthRedirectUrl), [
|
|
263
281
|
oauthRedirectUrl
|
|
264
282
|
]);
|
|
@@ -402,6 +420,7 @@ const QuilttConnector = ({ testId, connectorId, connectionId, institution, oauth
|
|
|
402
420
|
ref: webViewRef,
|
|
403
421
|
// Plaid keeps sending window.location = 'about:srcdoc' and causes some noise in RN
|
|
404
422
|
// All whitelists are now handled in requestHandler, handleQuilttEvent and handleOAuthUrl
|
|
423
|
+
style: styles.webview,
|
|
405
424
|
originWhitelist: [
|
|
406
425
|
'*'
|
|
407
426
|
],
|
|
@@ -409,6 +428,7 @@ const QuilttConnector = ({ testId, connectorId, connectionId, institution, oauth
|
|
|
409
428
|
uri: connectorUrl
|
|
410
429
|
},
|
|
411
430
|
onShouldStartLoadWithRequest: requestHandler,
|
|
431
|
+
onLoadEnd: onLoadEnd,
|
|
412
432
|
javaScriptEnabled: true,
|
|
413
433
|
domStorageEnabled: true,
|
|
414
434
|
webviewDebuggingEnabled: true,
|
|
@@ -417,13 +437,17 @@ const QuilttConnector = ({ testId, connectorId, connectionId, institution, oauth
|
|
|
417
437
|
automaticallyAdjustContentInsets: false,
|
|
418
438
|
contentInsetAdjustmentBehavior: "never" // Controls how the WebView adjusts its content layout relative to safe areas and system UI
|
|
419
439
|
,
|
|
440
|
+
showsVerticalScrollIndicator: false,
|
|
441
|
+
showsHorizontalScrollIndicator: false,
|
|
420
442
|
...Platform.OS === 'ios' ? {
|
|
421
443
|
decelerationRate: 'normal',
|
|
422
444
|
keyboardDisplayRequiresUserAction: false,
|
|
423
445
|
dataDetectorTypes: 'none',
|
|
424
446
|
allowsInlineMediaPlayback: true,
|
|
425
447
|
allowsBackForwardNavigationGestures: false,
|
|
426
|
-
startInLoadingState: true
|
|
448
|
+
startInLoadingState: true,
|
|
449
|
+
scrollEventThrottle: 16,
|
|
450
|
+
overScrollMode: 'never'
|
|
427
451
|
} : {
|
|
428
452
|
androidLayerType: 'hardware',
|
|
429
453
|
cacheEnabled: true,
|
|
@@ -432,6 +456,17 @@ const QuilttConnector = ({ testId, connectorId, connectionId, institution, oauth
|
|
|
432
456
|
})
|
|
433
457
|
});
|
|
434
458
|
};
|
|
459
|
+
// Add styles for the WebView container
|
|
460
|
+
const styles = StyleSheet.create({
|
|
461
|
+
webviewContainer: {
|
|
462
|
+
flex: 1,
|
|
463
|
+
backgroundColor: '#ffffff'
|
|
464
|
+
},
|
|
465
|
+
webview: {
|
|
466
|
+
flex: 1,
|
|
467
|
+
overflow: 'hidden'
|
|
468
|
+
}
|
|
469
|
+
});
|
|
435
470
|
QuilttConnector.displayName = 'QuilttConnector';
|
|
436
471
|
|
|
437
472
|
// Hermes doesn't have atob
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quiltt/react-native",
|
|
3
|
-
"version": "3.9.
|
|
3
|
+
"version": "3.9.4",
|
|
4
4
|
"description": "React Native Components for Quiltt Connector",
|
|
5
5
|
"homepage": "https://github.com/quiltt/quiltt-js/tree/main/packages/react-native#readme",
|
|
6
6
|
"repository": {
|
|
@@ -30,23 +30,23 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@honeybadger-io/core": "6.6.0",
|
|
32
32
|
"lodash.debounce": "4.0.8",
|
|
33
|
-
"@quiltt/
|
|
34
|
-
"@quiltt/
|
|
33
|
+
"@quiltt/core": "3.9.4",
|
|
34
|
+
"@quiltt/react": "3.9.4"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@biomejs/biome": "1.9.4",
|
|
38
38
|
"@types/base-64": "1.0.2",
|
|
39
39
|
"@types/lodash.debounce": "4.0.9",
|
|
40
|
-
"@types/node": "22.10.
|
|
40
|
+
"@types/node": "22.10.5",
|
|
41
41
|
"@types/react": "18.3.12",
|
|
42
42
|
"base-64": "1.0.0",
|
|
43
|
-
"bunchee": "
|
|
43
|
+
"bunchee": "6.2.0",
|
|
44
44
|
"react": "18.3.1",
|
|
45
45
|
"react-native": "0.76.5",
|
|
46
46
|
"react-native-url-polyfill": "2.0.0",
|
|
47
47
|
"react-native-webview": "13.12.5",
|
|
48
48
|
"rimraf": "6.0.1",
|
|
49
|
-
"typescript": "5.7.
|
|
49
|
+
"typescript": "5.7.3"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"base-64": "^1.0.0",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
|
2
2
|
import { Linking, Platform } from 'react-native'
|
|
3
|
+
import { StyleSheet } from 'react-native'
|
|
3
4
|
import { URL } from 'react-native-url-polyfill' // https://github.com/facebook/react-native/issues/16434
|
|
4
5
|
import { WebView } from 'react-native-webview'
|
|
5
6
|
import type { ShouldStartLoadRequest } from 'react-native-webview/lib/WebViewTypes'
|
|
@@ -83,6 +84,26 @@ const QuilttConnector = ({
|
|
|
83
84
|
const { session } = useQuilttSession()
|
|
84
85
|
const [preFlightCheck, setPreFlightCheck] = useState<PreFlightCheck>({ checked: false })
|
|
85
86
|
|
|
87
|
+
// Script to disable scrolling on header
|
|
88
|
+
const disableHeaderScrollScript = `
|
|
89
|
+
(function() {
|
|
90
|
+
const header = document.querySelector('header');
|
|
91
|
+
if (header) {
|
|
92
|
+
header.style.position = 'fixed';
|
|
93
|
+
header.style.top = '0';
|
|
94
|
+
header.style.left = '0';
|
|
95
|
+
header.style.right = '0';
|
|
96
|
+
header.style.zIndex = '1000';
|
|
97
|
+
}
|
|
98
|
+
})();
|
|
99
|
+
`
|
|
100
|
+
|
|
101
|
+
const onLoadEnd = useCallback(() => {
|
|
102
|
+
if (Platform.OS === 'ios') {
|
|
103
|
+
webViewRef.current?.injectJavaScript(disableHeaderScrollScript)
|
|
104
|
+
}
|
|
105
|
+
}, [])
|
|
106
|
+
|
|
86
107
|
const encodedOAuthRedirectUrl = useMemo(
|
|
87
108
|
() => encodeURIComponent(oauthRedirectUrl),
|
|
88
109
|
[oauthRedirectUrl]
|
|
@@ -227,9 +248,11 @@ const QuilttConnector = ({
|
|
|
227
248
|
ref={webViewRef}
|
|
228
249
|
// Plaid keeps sending window.location = 'about:srcdoc' and causes some noise in RN
|
|
229
250
|
// All whitelists are now handled in requestHandler, handleQuilttEvent and handleOAuthUrl
|
|
251
|
+
style={styles.webview}
|
|
230
252
|
originWhitelist={['*']}
|
|
231
253
|
source={{ uri: connectorUrl }}
|
|
232
254
|
onShouldStartLoadWithRequest={requestHandler}
|
|
255
|
+
onLoadEnd={onLoadEnd}
|
|
233
256
|
javaScriptEnabled
|
|
234
257
|
domStorageEnabled // To enable localStorage in Android webview
|
|
235
258
|
webviewDebuggingEnabled
|
|
@@ -237,6 +260,8 @@ const QuilttConnector = ({
|
|
|
237
260
|
scrollEnabled={true} // Enables scrolling within the WebView
|
|
238
261
|
automaticallyAdjustContentInsets={false} // Disables automatic padding adjustments based on navigation bars/safe areas
|
|
239
262
|
contentInsetAdjustmentBehavior="never" // Controls how the WebView adjusts its content layout relative to safe areas and system UI
|
|
263
|
+
showsVerticalScrollIndicator={false}
|
|
264
|
+
showsHorizontalScrollIndicator={false}
|
|
240
265
|
{...(Platform.OS === 'ios'
|
|
241
266
|
? {
|
|
242
267
|
decelerationRate: 'normal',
|
|
@@ -245,6 +270,8 @@ const QuilttConnector = ({
|
|
|
245
270
|
allowsInlineMediaPlayback: true,
|
|
246
271
|
allowsBackForwardNavigationGestures: false,
|
|
247
272
|
startInLoadingState: true,
|
|
273
|
+
scrollEventThrottle: 16, // Optimize scroll performance
|
|
274
|
+
overScrollMode: 'never', // Prevent overscroll effect
|
|
248
275
|
}
|
|
249
276
|
: {
|
|
250
277
|
androidLayerType: 'hardware',
|
|
@@ -256,6 +283,18 @@ const QuilttConnector = ({
|
|
|
256
283
|
)
|
|
257
284
|
}
|
|
258
285
|
|
|
286
|
+
// Add styles for the WebView container
|
|
287
|
+
const styles = StyleSheet.create({
|
|
288
|
+
webviewContainer: {
|
|
289
|
+
flex: 1,
|
|
290
|
+
backgroundColor: '#ffffff',
|
|
291
|
+
},
|
|
292
|
+
webview: {
|
|
293
|
+
flex: 1,
|
|
294
|
+
overflow: 'hidden', // Prevent content from overflowing
|
|
295
|
+
},
|
|
296
|
+
})
|
|
297
|
+
|
|
259
298
|
QuilttConnector.displayName = 'QuilttConnector'
|
|
260
299
|
|
|
261
300
|
export { QuilttConnector }
|