@cobbai/react-native-sdk 1.0.0-beta.0 → 1.0.0-beta.1
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/CobbaiChatScreen.d.ts.map +1 -1
- package/dist/CobbaiChatScreen.js +11 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/src/CobbaiChatScreen.tsx +17 -1
- package/src/version.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CobbaiChatScreen.d.ts","sourceRoot":"","sources":["../src/CobbaiChatScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAoCjF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAErD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"CobbaiChatScreen.d.ts","sourceRoot":"","sources":["../src/CobbaiChatScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAoCjF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAErD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAyShF"}
|
package/dist/CobbaiChatScreen.js
CHANGED
|
@@ -170,7 +170,10 @@ function CobbaiChatScreen(props) {
|
|
|
170
170
|
(0, openChatScreen_1.openChatScreen)();
|
|
171
171
|
} })) : null, inAppBanner ? ((0, jsx_runtime_1.jsx)(CobbaiInAppBanner_1.CobbaiInAppBanner, { banner: activeBanner, locale: config.locale, safeArea: safeArea, launcherAppearance: launcherAppearance, onAutoHide: handleBannerAutoHide, onPress: handleBannerPress })) : null, shouldRenderWebView ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_native_1.Animated.View, { style: [styles.backdrop, { opacity: backdropOpacity }], pointerEvents: visible ? 'auto' : 'none', accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", accessible: false }), (0, jsx_runtime_1.jsxs)(react_native_1.Animated.View, { style: [overlayStyle, { transform: [{ translateY: overlayTranslateY }] }], pointerEvents: visible ? 'auto' : 'none', accessibilityElementsHidden: !visible, importantForAccessibility: visible ? 'auto' : 'no-hide-descendants',
|
|
172
172
|
// iOS: while open, VoiceOver stays inside the chat instead of reaching the app behind it
|
|
173
|
-
accessibilityViewIsModal: visible, children: [
|
|
173
|
+
accessibilityViewIsModal: visible, children: [keyboardFrame.isApplied ? (
|
|
174
|
+
// Under the keyboard, below the sheet: the rounded corners of the iOS keyboard show this white,
|
|
175
|
+
// the one of the chat window, rather than the backdrop and the app behind it
|
|
176
|
+
(0, jsx_runtime_1.jsx)(react_native_1.View, { style: [styles.keyboardUnderlay, { height: keyboardFrame.overlayBottomInset }], pointerEvents: "none" })) : null, (0, jsx_runtime_1.jsx)(CobbaiWebView_1.CobbaiWebView, { config: config, generation: webViewGeneration, initialSafeArea: initialSafeAreaRef.current, onReady: handleReady, onClose: handleClose, onError: handleError, onNewMessage: handleNewMessage, onUnread: handleUnread, onPushTokenRegistered: handlePushTokenRegistered, onLauncherAppearance: setLauncherAppearance, onProcessGone: handleProcessGone, onWebViewRef: (ref) => {
|
|
174
177
|
webViewRef.current = ref;
|
|
175
178
|
} }), loaderMounted ? ((0, jsx_runtime_1.jsx)(ChatPlaceholder_1.ChatPlaceholder, { mode: placeholderState === 'unavailable' ? 'unavailable' : 'loading', locale: config.locale, opacity: loaderOpacity, onClose: handleClose, onRetry: retry })) : null] })] })) : null] }));
|
|
176
179
|
}
|
|
@@ -193,4 +196,11 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
193
196
|
backgroundColor: 'transparent',
|
|
194
197
|
zIndex: 2147483647,
|
|
195
198
|
},
|
|
199
|
+
keyboardUnderlay: {
|
|
200
|
+
position: 'absolute',
|
|
201
|
+
top: '100%',
|
|
202
|
+
right: 0,
|
|
203
|
+
left: 0,
|
|
204
|
+
backgroundColor: '#FFFFFF',
|
|
205
|
+
},
|
|
196
206
|
});
|
package/dist/version.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Version of this package, sent to the Cobbai server so that it stays compatible with this release.
|
|
3
3
|
* Must equal `version` in package.json (checked by a test): bump both together.
|
|
4
4
|
*/
|
|
5
|
-
export declare const SDK_VERSION = "1.0.0-beta.
|
|
5
|
+
export declare const SDK_VERSION = "1.0.0-beta.1";
|
|
6
6
|
/** Version of the protocol between the SDK and the Cobbai server that this release implements. Internal: not exported. */
|
|
7
7
|
export declare const CONTRACT_VERSION = "1.16";
|
|
8
8
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.js
CHANGED
|
@@ -5,6 +5,6 @@ exports.CONTRACT_VERSION = exports.SDK_VERSION = void 0;
|
|
|
5
5
|
* Version of this package, sent to the Cobbai server so that it stays compatible with this release.
|
|
6
6
|
* Must equal `version` in package.json (checked by a test): bump both together.
|
|
7
7
|
*/
|
|
8
|
-
exports.SDK_VERSION = '1.0.0-beta.
|
|
8
|
+
exports.SDK_VERSION = '1.0.0-beta.1';
|
|
9
9
|
/** Version of the protocol between the SDK and the Cobbai server that this release implements. Internal: not exported. */
|
|
10
10
|
exports.CONTRACT_VERSION = '1.16';
|
package/package.json
CHANGED
package/src/CobbaiChatScreen.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
2
|
-
import { Animated, BackHandler, Platform, StyleSheet } from 'react-native';
|
|
2
|
+
import { Animated, BackHandler, Platform, StyleSheet, View } from 'react-native';
|
|
3
3
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
4
4
|
import { CobbaiWebView, type CobbaiWebViewRef } from './CobbaiWebView';
|
|
5
5
|
import { hostPageKey } from './host/hostPageKey';
|
|
@@ -293,6 +293,15 @@ export function CobbaiChatScreen(props: CobbaiChatScreenProps): React.JSX.Elemen
|
|
|
293
293
|
// iOS: while open, VoiceOver stays inside the chat instead of reaching the app behind it
|
|
294
294
|
accessibilityViewIsModal={visible}
|
|
295
295
|
>
|
|
296
|
+
{keyboardFrame.isApplied ? (
|
|
297
|
+
// Under the keyboard, below the sheet: the rounded corners of the iOS keyboard show this white,
|
|
298
|
+
// the one of the chat window, rather than the backdrop and the app behind it
|
|
299
|
+
<View
|
|
300
|
+
style={[styles.keyboardUnderlay, { height: keyboardFrame.overlayBottomInset }]}
|
|
301
|
+
pointerEvents="none"
|
|
302
|
+
/>
|
|
303
|
+
) : null}
|
|
304
|
+
|
|
296
305
|
<CobbaiWebView
|
|
297
306
|
config={config}
|
|
298
307
|
generation={webViewGeneration}
|
|
@@ -345,4 +354,11 @@ const styles = StyleSheet.create({
|
|
|
345
354
|
backgroundColor: 'transparent',
|
|
346
355
|
zIndex: 2147483647,
|
|
347
356
|
},
|
|
357
|
+
keyboardUnderlay: {
|
|
358
|
+
position: 'absolute',
|
|
359
|
+
top: '100%',
|
|
360
|
+
right: 0,
|
|
361
|
+
left: 0,
|
|
362
|
+
backgroundColor: '#FFFFFF',
|
|
363
|
+
},
|
|
348
364
|
});
|
package/src/version.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Version of this package, sent to the Cobbai server so that it stays compatible with this release.
|
|
3
3
|
* Must equal `version` in package.json (checked by a test): bump both together.
|
|
4
4
|
*/
|
|
5
|
-
export const SDK_VERSION = '1.0.0-beta.
|
|
5
|
+
export const SDK_VERSION = '1.0.0-beta.1';
|
|
6
6
|
|
|
7
7
|
/** Version of the protocol between the SDK and the Cobbai server that this release implements. Internal: not exported. */
|
|
8
8
|
export const CONTRACT_VERSION = '1.16';
|