@getuserfeedback/react-native 2.0.7 → 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
@@ -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,4 +1,4 @@
1
- import { type WidgetLayoutSizeUpdate, type WidgetLayoutTransitionPlan } from "@getuserfeedback/protocol/host";
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?: WidgetLayoutSizeUpdate;
16
+ previous?: WidgetLayoutComparableSizeUpdate;
17
17
  viewport: WidgetHostProps["hostViewport"];
18
- }): WidgetLayoutTransitionPlan | undefined;
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: WidgetLayoutSizeUpdate | undefined;
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: isSheetVisible ? widgetSheetStyle : HIDDEN_WIDGET_HOST_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.7";
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.7",
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.11",
48
- "@getuserfeedback/sdk": "^0.8.13",
47
+ "@getuserfeedback/protocol": "^3.0.12",
48
+ "@getuserfeedback/sdk": "^0.8.14",
49
49
  "robot3": "^1.2.0"
50
50
  },
51
51
  "peerDependencies": {