@returningai/react-native-widget-sdk 0.1.2 → 0.1.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
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.4
|
|
4
|
+
|
|
5
|
+
- Removes `ReturningAIWidgetEndpoints.adssProduction`. Hosts that need a
|
|
6
|
+
branded tenant pass a custom `ReturningAIWidgetEndpoints`.
|
|
7
|
+
|
|
8
|
+
## 0.1.3
|
|
9
|
+
|
|
10
|
+
- Covers the WebView with the themed shell until `rai-ready`. RN CLI / iOS 26
|
|
11
|
+
assigns origin with a GET of `/`, which painted a white document before the
|
|
12
|
+
HTML shell ran. The WebView stays opacity 0 over the shell background so that
|
|
13
|
+
flash is gone.
|
|
14
|
+
|
|
3
15
|
## 0.1.2
|
|
4
16
|
|
|
5
17
|
- RN CLI / iOS 26 / Fabric: widgets now reach `rai-ready` like Expo. Live
|
package/package.json
CHANGED
|
@@ -568,19 +568,21 @@ export function ReturningAIWidget(props: ReturningAIWidgetProps): ReactElement {
|
|
|
568
568
|
}, []);
|
|
569
569
|
|
|
570
570
|
const autoHeight = props.configuration.display.autoHeight;
|
|
571
|
-
const
|
|
572
|
-
const webViewStyle = autoHeight ? { height, width: "100%" as const } : styles.flex;
|
|
571
|
+
const coverUntilReady = isLoading && error === null;
|
|
573
572
|
const resolvedTheme = resolveReturningAIWidgetTheme(
|
|
574
573
|
props.configuration.theme,
|
|
575
574
|
platformBrightness,
|
|
576
575
|
);
|
|
576
|
+
const shellBackground = argbToCss(
|
|
577
|
+
returningAIShellBackgroundColor(resolvedTheme, props.configuration.display.backgroundColor),
|
|
578
|
+
);
|
|
579
|
+
const webViewStyle = [
|
|
580
|
+
autoHeight ? { height, width: "100%" as const } : styles.flex,
|
|
581
|
+
{ backgroundColor: shellBackground, opacity: coverUntilReady ? 0 : 1 },
|
|
582
|
+
];
|
|
577
583
|
const rootStyle = [
|
|
578
584
|
autoHeight ? { height } : styles.root,
|
|
579
|
-
{
|
|
580
|
-
backgroundColor: argbToCss(
|
|
581
|
-
returningAIShellBackgroundColor(resolvedTheme, props.configuration.display.backgroundColor),
|
|
582
|
-
),
|
|
583
|
-
},
|
|
585
|
+
{ backgroundColor: shellBackground },
|
|
584
586
|
props.style,
|
|
585
587
|
];
|
|
586
588
|
|
|
@@ -599,6 +601,7 @@ export function ReturningAIWidget(props: ReturningAIWidgetProps): ReactElement {
|
|
|
599
601
|
ref: attachWebView,
|
|
600
602
|
source,
|
|
601
603
|
style: webViewStyle,
|
|
604
|
+
containerStyle: { flex: 1, backgroundColor: shellBackground },
|
|
602
605
|
onMessage,
|
|
603
606
|
onShouldStartLoadWithRequest,
|
|
604
607
|
onError,
|
|
@@ -627,15 +630,20 @@ export function ReturningAIWidget(props: ReturningAIWidgetProps): ReactElement {
|
|
|
627
630
|
testID: "returningai-webview",
|
|
628
631
|
});
|
|
629
632
|
|
|
630
|
-
if (!showLoading && error === null) {
|
|
631
|
-
return createElement(View, { style: rootStyle }, webView);
|
|
632
|
-
}
|
|
633
|
-
|
|
634
633
|
return createElement(
|
|
635
634
|
View,
|
|
636
635
|
{ style: rootStyle },
|
|
637
636
|
webView,
|
|
638
|
-
|
|
637
|
+
coverUntilReady
|
|
638
|
+
? createElement(
|
|
639
|
+
View,
|
|
640
|
+
{
|
|
641
|
+
style: [styles.overlay, { backgroundColor: shellBackground }],
|
|
642
|
+
testID: "returningai-loading-cover",
|
|
643
|
+
},
|
|
644
|
+
props.loadingBuilder?.() ?? null,
|
|
645
|
+
)
|
|
646
|
+
: null,
|
|
639
647
|
error !== null
|
|
640
648
|
? createElement(
|
|
641
649
|
View,
|
|
@@ -128,19 +128,6 @@ export class ReturningAIWidgetEndpoints {
|
|
|
128
128
|
widgetAuthUrl: "http://localhost:1333",
|
|
129
129
|
apiV2Url: "http://localhost:1335",
|
|
130
130
|
});
|
|
131
|
-
|
|
132
|
-
/** ADSS production multi-service endpoint set (HTTPS). */
|
|
133
|
-
static readonly adssProduction = new ReturningAIWidgetEndpoints({
|
|
134
|
-
widgetAuthUrl: "https://adss-prod-widgets.returning.ai",
|
|
135
|
-
apiV2Url: "https://adss-api-v2.returning.ai",
|
|
136
|
-
widgetPathV2Url: "https://adss-prod-widgets.returning.ai",
|
|
137
|
-
baseUrl: "https://returning.ai",
|
|
138
|
-
authApiUrl: "https://adss-auth.returning.ai",
|
|
139
|
-
socketV2Url: "https://adss-socket-v2.returning.ai",
|
|
140
|
-
socketUrl: "https://adss-socket.returning.ai",
|
|
141
|
-
channelApiUrl: "https://adss-channels.returning.ai",
|
|
142
|
-
mfeUrl: "https://adss-production.returning.ai",
|
|
143
|
-
});
|
|
144
131
|
}
|
|
145
132
|
|
|
146
133
|
function optionalUrl(value: string | URL | undefined): URL | undefined {
|
package/src/packageInfo.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
export const RETURNING_AI_REACT_NATIVE_PACKAGE = {
|
|
15
15
|
/** Semver of `@returningai/react-native-widget-sdk`. */
|
|
16
|
-
version: "0.1.
|
|
16
|
+
version: "0.1.4",
|
|
17
17
|
/** Documented Expo SDK major this package targets. */
|
|
18
18
|
expoSdk: 57,
|
|
19
19
|
/** Documented React Native minor this package targets. */
|