@getuserfeedback/react-native 2.0.6 → 2.0.8
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/index.js
CHANGED
|
@@ -9,7 +9,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
import { assertNoSegmentExternalIdsInValueArgument, CommandSettlementTimeoutError, } from "@getuserfeedback/protocol/host";
|
|
12
|
+
import { assertNoSegmentExternalIdsInValueArgument, CommandSettlementTimeoutError, getWidgetLayoutPlanNowMs, } from "@getuserfeedback/protocol/host";
|
|
13
13
|
import { parseWebViewTransportNativeMessage } from "@getuserfeedback/protocol/webview-transport";
|
|
14
14
|
import { createContext, createElement, useCallback, useContext, useEffect, useMemo, useRef, useState, } from "react";
|
|
15
15
|
import { useResolvedHostViewport } from "./host-viewport.js";
|
|
@@ -70,15 +70,6 @@ const FallbackNativeView = (_a) => {
|
|
|
70
70
|
var { children } = _a, props = __rest(_a, ["children"]);
|
|
71
71
|
return createElement("div", props, children);
|
|
72
72
|
};
|
|
73
|
-
function getProviderWidgetLayoutPlanNowMs() {
|
|
74
|
-
var _a;
|
|
75
|
-
const performanceNow = typeof ((_a = globalThis.performance) === null || _a === void 0 ? void 0 : _a.now) === "function"
|
|
76
|
-
? globalThis.performance.now()
|
|
77
|
-
: undefined;
|
|
78
|
-
return typeof performanceNow === "number" && Number.isFinite(performanceNow)
|
|
79
|
-
? performanceNow
|
|
80
|
-
: Date.now();
|
|
81
|
-
}
|
|
82
73
|
function resolveReactNativeComponents() {
|
|
83
74
|
var _a;
|
|
84
75
|
try {
|
|
@@ -497,7 +488,7 @@ export function GetUserFeedbackProvider({ autoInit = true, children, commandTime
|
|
|
497
488
|
flowSize: {
|
|
498
489
|
height: widgetHostVisibility.flowHeight,
|
|
499
490
|
},
|
|
500
|
-
nowMs:
|
|
491
|
+
nowMs: getWidgetLayoutPlanNowMs(),
|
|
501
492
|
});
|
|
502
493
|
let sheetHostLayoutUpdate;
|
|
503
494
|
if (sheetHostLayoutPlan) {
|
|
@@ -507,6 +498,7 @@ export function GetUserFeedbackProvider({ autoInit = true, children, commandTime
|
|
|
507
498
|
(_a = previousSheetHostLayoutUpdateRef.current) !== null && _a !== void 0 ? _a : sheetHostLayoutPlan.update;
|
|
508
499
|
break;
|
|
509
500
|
case "instant":
|
|
501
|
+
case "timed":
|
|
510
502
|
sheetHostLayoutUpdate = sheetHostLayoutPlan.update;
|
|
511
503
|
break;
|
|
512
504
|
default: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type WidgetLayoutSizeUpdate, type
|
|
1
|
+
import { type WidgetLayoutComparableSizeUpdate, type WidgetLayoutSizeUpdate, type WidgetLayoutTimedCapableTransitionPlan } from "@getuserfeedback/protocol/host";
|
|
2
2
|
import { type ComponentType, type ReactElement, type ReactNode } from "react";
|
|
3
3
|
import type { WidgetHostProps } from "./widget-host.js";
|
|
4
4
|
type NativeViewComponent = ComponentType<Record<string, unknown>>;
|
|
@@ -13,18 +13,22 @@ export declare function toProviderWidgetSheetHostLayoutPlan(input: {
|
|
|
13
13
|
height?: number;
|
|
14
14
|
};
|
|
15
15
|
nowMs: number;
|
|
16
|
-
previous?:
|
|
16
|
+
previous?: WidgetLayoutComparableSizeUpdate;
|
|
17
17
|
viewport: WidgetHostProps["hostViewport"];
|
|
18
|
-
}):
|
|
18
|
+
}): WidgetLayoutTimedCapableTransitionPlan | undefined;
|
|
19
19
|
export declare function toProviderWidgetHostStyle({ isVisible, webViewStyle, }: {
|
|
20
20
|
isVisible: boolean;
|
|
21
21
|
webViewStyle: unknown;
|
|
22
22
|
}): unknown;
|
|
23
|
+
export declare function toProviderWidgetSheetStyle(input: {
|
|
24
|
+
isVisible: boolean;
|
|
25
|
+
sheetHostLayoutUpdate: WidgetLayoutComparableSizeUpdate | undefined;
|
|
26
|
+
}): unknown;
|
|
23
27
|
export declare function ProviderWidgetHostOverlay({ children, isVisible, nativeView, onRequestDismiss, sheetHostLayoutUpdate, }: {
|
|
24
28
|
children?: ReactNode;
|
|
25
29
|
isVisible: boolean;
|
|
26
30
|
nativeView: NativeViewComponent;
|
|
27
31
|
onRequestDismiss: () => void;
|
|
28
|
-
sheetHostLayoutUpdate:
|
|
32
|
+
sheetHostLayoutUpdate: WidgetLayoutComparableSizeUpdate | undefined;
|
|
29
33
|
}): ReactElement;
|
|
30
34
|
export {};
|
|
@@ -172,6 +172,12 @@ export function toProviderWidgetHostStyle({ isVisible, webViewStyle, }) {
|
|
|
172
172
|
? [visiblePresentationStyle, VISIBLE_WIDGET_HOST_STYLE]
|
|
173
173
|
: VISIBLE_WIDGET_HOST_STYLE;
|
|
174
174
|
}
|
|
175
|
+
export function toProviderWidgetSheetStyle(input) {
|
|
176
|
+
var _a;
|
|
177
|
+
const sheetHostViewport = (_a = input.sheetHostLayoutUpdate) === null || _a === void 0 ? void 0 : _a.size;
|
|
178
|
+
return input.isVisible && sheetHostViewport !== undefined
|
|
179
|
+
? Object.assign(Object.assign({}, WIDGET_SHEET_STYLE), { height: sheetHostViewport.height }) : HIDDEN_WIDGET_HOST_STYLE;
|
|
180
|
+
}
|
|
175
181
|
export function ProviderWidgetHostOverlay({ children, isVisible, nativeView, onRequestDismiss, sheetHostLayoutUpdate, }) {
|
|
176
182
|
const dragStartYRef = useRef(undefined);
|
|
177
183
|
const handleDragGrant = useCallback((event) => {
|
|
@@ -224,8 +230,6 @@ export function ProviderWidgetHostOverlay({ children, isVisible, nativeView, onR
|
|
|
224
230
|
};
|
|
225
231
|
}, [handleDragGrant, handleDragRelease, onRequestDismiss]);
|
|
226
232
|
const sheetHostViewport = sheetHostLayoutUpdate === null || sheetHostLayoutUpdate === void 0 ? void 0 : sheetHostLayoutUpdate.size;
|
|
227
|
-
const widgetSheetStyle = sheetHostViewport
|
|
228
|
-
? Object.assign(Object.assign({}, WIDGET_SHEET_STYLE), { height: sheetHostViewport.height }) : HIDDEN_WIDGET_HOST_STYLE;
|
|
229
233
|
const isSheetVisible = isVisible && sheetHostViewport !== undefined;
|
|
230
234
|
const pointerEvents = isSheetVisible ? "auto" : "none";
|
|
231
235
|
return createElement(nativeView, {
|
|
@@ -242,7 +246,10 @@ export function ProviderWidgetHostOverlay({ children, isVisible, nativeView, onR
|
|
|
242
246
|
testID: "gx-widget-host-backdrop",
|
|
243
247
|
}), createElement(nativeView, {
|
|
244
248
|
pointerEvents,
|
|
245
|
-
style:
|
|
249
|
+
style: toProviderWidgetSheetStyle({
|
|
250
|
+
isVisible,
|
|
251
|
+
sheetHostLayoutUpdate,
|
|
252
|
+
}),
|
|
246
253
|
testID: "gx-widget-host-sheet",
|
|
247
254
|
}, children, isSheetVisible
|
|
248
255
|
? createElement(nativeView, Object.assign(Object.assign({}, dragHandleGestureProps), { style: WIDGET_SHEET_DRAG_HANDLE_TOUCH_STYLE, testID: "gx-widget-host-drag-handle" }), createElement(nativeView, {
|
package/dist/version.js
CHANGED
|
@@ -3,4 +3,4 @@ const reactNativeSdkVersion = typeof __GX_REACT_NATIVE_SDK_VERSION__ === "string
|
|
|
3
3
|
: "";
|
|
4
4
|
// Build scripts patch this fallback to the package version for published artifacts.
|
|
5
5
|
// Source-linked workspace usage keeps the local fallback.
|
|
6
|
-
export const REACT_NATIVE_SDK_VERSION = reactNativeSdkVersion.length > 0 ? reactNativeSdkVersion : "2.0.
|
|
6
|
+
export const REACT_NATIVE_SDK_VERSION = reactNativeSdkVersion.length > 0 ? reactNativeSdkVersion : "2.0.8";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getuserfeedback/react-native",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.8",
|
|
4
4
|
"description": "getuserfeedback React Native SDK",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"getuserfeedback",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"lint": "ultracite check ."
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@getuserfeedback/protocol": "^3.0.
|
|
48
|
-
"@getuserfeedback/sdk": "^0.8.
|
|
47
|
+
"@getuserfeedback/protocol": "^3.0.12",
|
|
48
|
+
"@getuserfeedback/sdk": "^0.8.14",
|
|
49
49
|
"robot3": "^1.2.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|