@getuserfeedback/react-native 4.0.2 → 4.0.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/dist/index.js +6 -32
- package/dist/version.js +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -44,7 +44,6 @@ const toFlowHandleIdFromResult = (result) => {
|
|
|
44
44
|
return handle === null || handle === void 0 ? void 0 : handle.flowHandleId;
|
|
45
45
|
};
|
|
46
46
|
const createReactNativeFlowRunController = (flowId, { enqueueFlowCommand, enqueueScopedClose, reportCommandError, }) => {
|
|
47
|
-
let pendingClose = false;
|
|
48
47
|
const handleClient = createFlowCommandHandleController({
|
|
49
48
|
getHandleIdFromSettlement: toFlowHandleIdFromResult,
|
|
50
49
|
isStaleHandleError,
|
|
@@ -54,11 +53,7 @@ const createReactNativeFlowRunController = (flowId, { enqueueFlowCommand, enqueu
|
|
|
54
53
|
reportCommandError(error instanceof Error ? error : new Error(String(error)));
|
|
55
54
|
throw error;
|
|
56
55
|
});
|
|
57
|
-
const clearResolvedHandle = () => {
|
|
58
|
-
handleClient.clearResolvedHandle();
|
|
59
|
-
};
|
|
60
56
|
const reset = () => {
|
|
61
|
-
pendingClose = false;
|
|
62
57
|
handleClient.reset();
|
|
63
58
|
};
|
|
64
59
|
const resetIdleHandle = () => {
|
|
@@ -68,21 +63,8 @@ const createReactNativeFlowRunController = (flowId, { enqueueFlowCommand, enqueu
|
|
|
68
63
|
reset();
|
|
69
64
|
};
|
|
70
65
|
const enqueueAndWaitForSettlement = async (buildPayload) => {
|
|
71
|
-
|
|
72
|
-
await handleClient.runCommand(buildPayload, enqueueFlowCommand);
|
|
73
|
-
}
|
|
74
|
-
catch (error) {
|
|
75
|
-
pendingClose = false;
|
|
76
|
-
throw error;
|
|
77
|
-
}
|
|
66
|
+
await handleClient.runCommand(buildPayload, enqueueFlowCommand);
|
|
78
67
|
};
|
|
79
|
-
handleClient.subscribeHandle((flowHandleId) => {
|
|
80
|
-
if (!pendingClose) {
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
pendingClose = false;
|
|
84
|
-
reportAsyncCommandError(enqueueScopedClose(flowHandleId)).catch(() => { });
|
|
85
|
-
});
|
|
86
68
|
return {
|
|
87
69
|
flowId,
|
|
88
70
|
open: (options) => reportAsyncCommandError(enqueueAndWaitForSettlement((flowHandleId) => ({
|
|
@@ -104,20 +86,12 @@ const createReactNativeFlowRunController = (flowId, { enqueueFlowCommand, enqueu
|
|
|
104
86
|
hideCloseButton: options === null || options === void 0 ? void 0 : options.hideCloseButton,
|
|
105
87
|
}))),
|
|
106
88
|
close: () => {
|
|
107
|
-
|
|
108
|
-
if (!flowHandleId) {
|
|
109
|
-
pendingClose = handleClient.hasPendingCommands();
|
|
110
|
-
return Promise.resolve();
|
|
111
|
-
}
|
|
112
|
-
if (handleClient.hasPendingCommands()) {
|
|
113
|
-
pendingClose = true;
|
|
114
|
-
return Promise.resolve();
|
|
115
|
-
}
|
|
116
|
-
pendingClose = false;
|
|
117
|
-
return reportAsyncCommandError(enqueueScopedClose(flowHandleId));
|
|
89
|
+
return reportAsyncCommandError(handleClient.runResolvedHandleCommand((flowHandleId) => flowHandleId, enqueueScopedClose));
|
|
118
90
|
},
|
|
119
|
-
clearResolvedHandle,
|
|
120
91
|
hasFlowHandleId: (flowHandleId) => handleClient.getHandleId() === flowHandleId,
|
|
92
|
+
invalidateResolvedHandle: (flowHandleId) => {
|
|
93
|
+
handleClient.invalidateResolvedHandle(flowHandleId);
|
|
94
|
+
},
|
|
121
95
|
reset,
|
|
122
96
|
resetIdleHandle,
|
|
123
97
|
};
|
|
@@ -439,7 +413,7 @@ export function GetUserFeedbackProvider({ autoInit = true, children, commandTime
|
|
|
439
413
|
const handleFlowHandleInvalidated = useCallback((flowHandleId) => {
|
|
440
414
|
for (const flowRun of flowRunsRef.current.values()) {
|
|
441
415
|
if (flowRun.hasFlowHandleId(flowHandleId)) {
|
|
442
|
-
flowRun.
|
|
416
|
+
flowRun.invalidateResolvedHandle(flowHandleId);
|
|
443
417
|
}
|
|
444
418
|
}
|
|
445
419
|
setWidgetHostVisibility((visibility) => clearFlowHandleFromVisibility(visibility, flowHandleId));
|
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.
|
|
6
|
+
export const REACT_NATIVE_SDK_VERSION = reactNativeSdkVersion.length > 0 ? reactNativeSdkVersion : "4.0.4";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getuserfeedback/react-native",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.4",
|
|
4
4
|
"description": "getuserfeedback React Native SDK",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"getuserfeedback",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"lint": "biome check ."
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@getuserfeedback/protocol": "^3.25.
|
|
48
|
-
"@getuserfeedback/sdk": "^0.12.
|
|
47
|
+
"@getuserfeedback/protocol": "^3.25.1",
|
|
48
|
+
"@getuserfeedback/sdk": "^0.12.13",
|
|
49
49
|
"robot3": "^1.2.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|