@getuserfeedback/react-native 2.0.7 → 2.0.9
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
|
@@ -498,6 +498,7 @@ export function GetUserFeedbackProvider({ autoInit = true, children, commandTime
|
|
|
498
498
|
(_a = previousSheetHostLayoutUpdateRef.current) !== null && _a !== void 0 ? _a : sheetHostLayoutPlan.update;
|
|
499
499
|
break;
|
|
500
500
|
case "instant":
|
|
501
|
+
case "timed":
|
|
501
502
|
sheetHostLayoutUpdate = sheetHostLayoutPlan.update;
|
|
502
503
|
break;
|
|
503
504
|
default: {
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { type WidgetLayoutSizeUpdate, type
|
|
1
|
+
import { type WidgetLayoutComparableSizeUpdate, type WidgetLayoutSizeUpdate, type WidgetLayoutTimedCapableTransitionPlan, type WidgetLayoutTransitionPolicy } 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>>;
|
|
5
5
|
export declare function toProviderWidgetSheetHostViewport(viewport: WidgetHostProps["hostViewport"], flowSize?: {
|
|
6
6
|
height?: number;
|
|
7
7
|
}): WidgetHostProps["hostViewport"];
|
|
8
|
+
export declare function toProviderWidgetSheetHostLayoutSize(viewport: WidgetHostProps["hostViewport"], flowSize?: {
|
|
9
|
+
height?: number;
|
|
10
|
+
}): WidgetHostProps["hostViewport"];
|
|
8
11
|
export declare function toProviderWidgetSheetHostLayoutUpdate(viewport: WidgetHostProps["hostViewport"], flowSize?: {
|
|
9
12
|
height?: number;
|
|
10
13
|
}): WidgetLayoutSizeUpdate | undefined;
|
|
@@ -13,18 +16,23 @@ export declare function toProviderWidgetSheetHostLayoutPlan(input: {
|
|
|
13
16
|
height?: number;
|
|
14
17
|
};
|
|
15
18
|
nowMs: number;
|
|
16
|
-
previous?:
|
|
19
|
+
previous?: WidgetLayoutComparableSizeUpdate;
|
|
20
|
+
transitionPolicy?: WidgetLayoutTransitionPolicy;
|
|
17
21
|
viewport: WidgetHostProps["hostViewport"];
|
|
18
|
-
}):
|
|
22
|
+
}): WidgetLayoutTimedCapableTransitionPlan | undefined;
|
|
19
23
|
export declare function toProviderWidgetHostStyle({ isVisible, webViewStyle, }: {
|
|
20
24
|
isVisible: boolean;
|
|
21
25
|
webViewStyle: unknown;
|
|
22
26
|
}): unknown;
|
|
27
|
+
export declare function toProviderWidgetSheetStyle(input: {
|
|
28
|
+
isVisible: boolean;
|
|
29
|
+
sheetHostLayoutUpdate: WidgetLayoutComparableSizeUpdate | undefined;
|
|
30
|
+
}): unknown;
|
|
23
31
|
export declare function ProviderWidgetHostOverlay({ children, isVisible, nativeView, onRequestDismiss, sheetHostLayoutUpdate, }: {
|
|
24
32
|
children?: ReactNode;
|
|
25
33
|
isVisible: boolean;
|
|
26
34
|
nativeView: NativeViewComponent;
|
|
27
35
|
onRequestDismiss: () => void;
|
|
28
|
-
sheetHostLayoutUpdate:
|
|
36
|
+
sheetHostLayoutUpdate: WidgetLayoutComparableSizeUpdate | undefined;
|
|
29
37
|
}): ReactElement;
|
|
30
38
|
export {};
|
|
@@ -110,10 +110,9 @@ function toResponderPageY(event) {
|
|
|
110
110
|
: undefined;
|
|
111
111
|
}
|
|
112
112
|
export function toProviderWidgetSheetHostViewport(viewport, flowSize) {
|
|
113
|
-
|
|
114
|
-
return (_a = toProviderWidgetSheetHostLayoutUpdate(viewport, flowSize)) === null || _a === void 0 ? void 0 : _a.size;
|
|
113
|
+
return toProviderWidgetSheetHostLayoutSize(viewport, flowSize);
|
|
115
114
|
}
|
|
116
|
-
export function
|
|
115
|
+
export function toProviderWidgetSheetHostLayoutSize(viewport, flowSize) {
|
|
117
116
|
if (!viewport) {
|
|
118
117
|
return undefined;
|
|
119
118
|
}
|
|
@@ -122,22 +121,27 @@ export function toProviderWidgetSheetHostLayoutUpdate(viewport, flowSize) {
|
|
|
122
121
|
flowSize.height > 0
|
|
123
122
|
? flowSize.height
|
|
124
123
|
: undefined;
|
|
125
|
-
return
|
|
124
|
+
return {
|
|
126
125
|
width: viewport.width,
|
|
127
126
|
height: Math.min(viewport.height, measuredHeight === undefined
|
|
128
127
|
? LOADER_FLOATING_CONTAINER_MIN_HEIGHT
|
|
129
128
|
: Math.max(LOADER_FLOATING_CONTAINER_MIN_HEIGHT, Math.ceil(measuredHeight))),
|
|
130
|
-
}
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
export function toProviderWidgetSheetHostLayoutUpdate(viewport, flowSize) {
|
|
132
|
+
const size = toProviderWidgetSheetHostLayoutSize(viewport, flowSize);
|
|
133
|
+
return size === undefined ? undefined : toInstantWidgetLayoutSizeUpdate(size);
|
|
131
134
|
}
|
|
132
135
|
export function toProviderWidgetSheetHostLayoutPlan(input) {
|
|
133
|
-
const
|
|
134
|
-
if (!
|
|
136
|
+
const size = toProviderWidgetSheetHostLayoutSize(input.viewport, input.flowSize);
|
|
137
|
+
if (!size) {
|
|
135
138
|
return undefined;
|
|
136
139
|
}
|
|
137
140
|
return planWidgetLayoutTransition({
|
|
138
141
|
previous: input.previous,
|
|
139
|
-
|
|
142
|
+
size,
|
|
140
143
|
nowMs: input.nowMs,
|
|
144
|
+
transitionPolicy: input.transitionPolicy,
|
|
141
145
|
});
|
|
142
146
|
}
|
|
143
147
|
function toVisibleWidgetHostPresentationStyle(style) {
|
|
@@ -172,6 +176,12 @@ export function toProviderWidgetHostStyle({ isVisible, webViewStyle, }) {
|
|
|
172
176
|
? [visiblePresentationStyle, VISIBLE_WIDGET_HOST_STYLE]
|
|
173
177
|
: VISIBLE_WIDGET_HOST_STYLE;
|
|
174
178
|
}
|
|
179
|
+
export function toProviderWidgetSheetStyle(input) {
|
|
180
|
+
var _a;
|
|
181
|
+
const sheetHostViewport = (_a = input.sheetHostLayoutUpdate) === null || _a === void 0 ? void 0 : _a.size;
|
|
182
|
+
return input.isVisible && sheetHostViewport !== undefined
|
|
183
|
+
? Object.assign(Object.assign({}, WIDGET_SHEET_STYLE), { height: sheetHostViewport.height }) : HIDDEN_WIDGET_HOST_STYLE;
|
|
184
|
+
}
|
|
175
185
|
export function ProviderWidgetHostOverlay({ children, isVisible, nativeView, onRequestDismiss, sheetHostLayoutUpdate, }) {
|
|
176
186
|
const dragStartYRef = useRef(undefined);
|
|
177
187
|
const handleDragGrant = useCallback((event) => {
|
|
@@ -224,8 +234,6 @@ export function ProviderWidgetHostOverlay({ children, isVisible, nativeView, onR
|
|
|
224
234
|
};
|
|
225
235
|
}, [handleDragGrant, handleDragRelease, onRequestDismiss]);
|
|
226
236
|
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
237
|
const isSheetVisible = isVisible && sheetHostViewport !== undefined;
|
|
230
238
|
const pointerEvents = isSheetVisible ? "auto" : "none";
|
|
231
239
|
return createElement(nativeView, {
|
|
@@ -242,7 +250,10 @@ export function ProviderWidgetHostOverlay({ children, isVisible, nativeView, onR
|
|
|
242
250
|
testID: "gx-widget-host-backdrop",
|
|
243
251
|
}), createElement(nativeView, {
|
|
244
252
|
pointerEvents,
|
|
245
|
-
style:
|
|
253
|
+
style: toProviderWidgetSheetStyle({
|
|
254
|
+
isVisible,
|
|
255
|
+
sheetHostLayoutUpdate,
|
|
256
|
+
}),
|
|
246
257
|
testID: "gx-widget-host-sheet",
|
|
247
258
|
}, children, isSheetVisible
|
|
248
259
|
? 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.9";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getuserfeedback/react-native",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.9",
|
|
4
4
|
"description": "getuserfeedback React Native SDK",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"getuserfeedback",
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
"typecheck": "tsc -b tsconfig.json",
|
|
42
42
|
"test": "bun test --dots",
|
|
43
43
|
"test:changed": "bun test --changed=${TEST_CHANGED_BASE:-HEAD} --pass-with-no-tests --dots",
|
|
44
|
-
"lint": "
|
|
44
|
+
"lint": "biome check ."
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@getuserfeedback/protocol": "^3.0.
|
|
48
|
-
"@getuserfeedback/sdk": "^0.8.
|
|
47
|
+
"@getuserfeedback/protocol": "^3.0.13",
|
|
48
|
+
"@getuserfeedback/sdk": "^0.8.15",
|
|
49
49
|
"robot3": "^1.2.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|