@getuserfeedback/react-native 4.0.9 → 4.0.11

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.
@@ -14,6 +14,14 @@ import { buildCoreWebViewBridgeScript, parseCoreWebViewBridgeMessage, toExternal
14
14
  import { createCoreWebViewHostController, } from "./core-webview-host-controller.js";
15
15
  import { WebViewDocumentHost } from "./webview-document-host.js";
16
16
  let nextBridgeId = 0;
17
+ const CORE_WEBVIEW_HOST_STYLE = {
18
+ height: 1,
19
+ left: -10000,
20
+ opacity: 0,
21
+ position: "absolute",
22
+ top: 0,
23
+ width: 1,
24
+ };
17
25
  function CoreWebViewHostDocument({ externalCoreUrl, onConnected, onDisconnected, onInvalidMessage, webViewComponent, webViewProps, }) {
18
26
  const bridgeIdRef = useRef(null);
19
27
  if (bridgeIdRef.current === null) {
@@ -41,6 +49,7 @@ function CoreWebViewHostDocument({ externalCoreUrl, onConnected, onDisconnected,
41
49
  const controller = controllerRef.current;
42
50
  const buildDocumentStartScript = useMemo(() => () => buildCoreWebViewBridgeScript({ bridgeId, phase: "documentStart" }), [bridgeId]);
43
51
  const source = useMemo(() => ({ uri: externalCoreUrl }), [externalCoreUrl]);
52
+ const resolvedWebViewProps = useMemo(() => (Object.assign(Object.assign({}, webViewProps), { containerStyle: CORE_WEBVIEW_HOST_STYLE, pointerEvents: "none", style: CORE_WEBVIEW_HOST_STYLE })), [webViewProps]);
44
53
  return createElement((WebViewDocumentHost), {
45
54
  bridgeId,
46
55
  buildDocumentStartScript,
@@ -48,7 +57,7 @@ function CoreWebViewHostDocument({ externalCoreUrl, onConnected, onDisconnected,
48
57
  parseMessage: parseCoreWebViewBridgeMessage,
49
58
  source,
50
59
  webViewComponent,
51
- webViewProps,
60
+ webViewProps: resolvedWebViewProps,
52
61
  onInvalidMessage,
53
62
  });
54
63
  }
@@ -12,19 +12,24 @@ export function createNativeDirectCommandSession(input) {
12
12
  throw new Error(`Expected ${input.expectedKind} settlement for requestId "${input.envelope.requestId}" and instanceId "${input.envelope.instanceId}"`);
13
13
  }
14
14
  };
15
- const assertAllocationSettlement = (envelope, command, settlement) => {
15
+ const assertFlowHandleSettlement = (envelope, command, settlement) => {
16
16
  assertSettlementMatches({
17
17
  envelope,
18
18
  expectedKind: command.kind,
19
19
  settlement,
20
20
  });
21
- const allocation = getFlowHandleFromSettlementDetail(settlement);
22
- if (!(allocation === null || allocation === void 0 ? void 0 : allocation.flowRunId) ||
21
+ const handle = getFlowHandleFromSettlementDetail(settlement);
22
+ const requiresFlowRunId = command.kind !== "prefetch";
23
+ if (!handle ||
24
+ (requiresFlowRunId && !handle.flowRunId) ||
23
25
  (command.flowHandleId !== undefined &&
24
- allocation.flowHandleId !== command.flowHandleId)) {
26
+ handle.flowHandleId !== command.flowHandleId)) {
27
+ const expectedResult = requiresFlowRunId
28
+ ? "flowHandleId and flowRunId"
29
+ : "flowHandleId";
25
30
  throw new Error(command.flowHandleId === undefined
26
- ? `Expected ${command.kind} settlement to include flowHandleId and flowRunId`
27
- : `Expected ${command.kind} settlement to include matching flowHandleId and flowRunId`);
31
+ ? `Expected ${command.kind} settlement to include ${expectedResult}`
32
+ : `Expected ${command.kind} settlement to include matching ${expectedResult}`);
28
33
  }
29
34
  };
30
35
  return {
@@ -32,8 +37,9 @@ export function createNativeDirectCommandSession(input) {
32
37
  const settlement = await dispatchToCore(envelope, envelope.command);
33
38
  switch (envelope.command.kind) {
34
39
  case "open":
40
+ case "prefetch":
35
41
  case "prerender":
36
- assertAllocationSettlement(envelope, envelope.command, settlement);
42
+ assertFlowHandleSettlement(envelope, envelope.command, settlement);
37
43
  break;
38
44
  case "close":
39
45
  assertSettlementMatches({
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 : "4.0.9";
6
+ export const REACT_NATIVE_SDK_VERSION = reactNativeSdkVersion.length > 0 ? reactNativeSdkVersion : "4.0.11";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getuserfeedback/react-native",
3
- "version": "4.0.9",
3
+ "version": "4.0.11",
4
4
  "description": "getuserfeedback React Native SDK",
5
5
  "keywords": [
6
6
  "getuserfeedback",