@wise/dynamic-flow-client 3.34.3 → 3.34.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/build/main.js +15 -8
- package/build/main.min.js +1 -1
- package/build/main.mjs +15 -8
- package/package.json +3 -3
package/build/main.mjs
CHANGED
|
@@ -11434,13 +11434,20 @@ function useDynamicFlowCore(props) {
|
|
|
11434
11434
|
void onAction(__spreadValues({ method: "GET" }, initialAction));
|
|
11435
11435
|
}
|
|
11436
11436
|
if (initialStep && !initialAction) {
|
|
11437
|
-
|
|
11437
|
+
createStep(initialStep, null);
|
|
11438
11438
|
trackCoreEvent("Step Shown", { isFirstStep: true });
|
|
11439
11439
|
}
|
|
11440
11440
|
}, []);
|
|
11441
|
+
const createStep = useCallback2((newStep, etag) => {
|
|
11442
|
+
initialiseWithStep(newStep, etag, null);
|
|
11443
|
+
}, []);
|
|
11444
|
+
const updateStep = useCallback2((newStep, etag) => {
|
|
11445
|
+
var _a2, _b;
|
|
11446
|
+
initialiseWithStep(newStep, etag, (_b = (_a2 = stepComponentRef.current) == null ? void 0 : _a2.getLocalValue()) != null ? _b : null);
|
|
11447
|
+
}, []);
|
|
11441
11448
|
const initialiseWithStep = useCallback2(
|
|
11442
|
-
(newStep, etag) => {
|
|
11443
|
-
var _a2
|
|
11449
|
+
(newStep, etag, localValue) => {
|
|
11450
|
+
var _a2;
|
|
11444
11451
|
(_a2 = stepComponentRef.current) == null ? void 0 : _a2.stop();
|
|
11445
11452
|
stepRef.current = newStep;
|
|
11446
11453
|
etagRef.current = etag;
|
|
@@ -11463,7 +11470,7 @@ function useDynamicFlowCore(props) {
|
|
|
11463
11470
|
};
|
|
11464
11471
|
try {
|
|
11465
11472
|
const newStepComponent = mapStepToComponent({
|
|
11466
|
-
stepLocalValue:
|
|
11473
|
+
stepLocalValue: localValue,
|
|
11467
11474
|
step: newStep,
|
|
11468
11475
|
displayStepTitle,
|
|
11469
11476
|
loadingState: "idle",
|
|
@@ -11548,7 +11555,7 @@ function useDynamicFlowCore(props) {
|
|
|
11548
11555
|
}
|
|
11549
11556
|
case "replace-step": {
|
|
11550
11557
|
const isFirstStep = stepRef.current === null;
|
|
11551
|
-
|
|
11558
|
+
createStep(command.step, command.etag);
|
|
11552
11559
|
trackCoreEvent("Step Shown", { isFirstStep });
|
|
11553
11560
|
break;
|
|
11554
11561
|
}
|
|
@@ -11556,7 +11563,7 @@ function useDynamicFlowCore(props) {
|
|
|
11556
11563
|
const genericErrorMessage = getErrorMessageFunctions().genericErrorWithRetry();
|
|
11557
11564
|
const { errors = { error: genericErrorMessage } } = command.body;
|
|
11558
11565
|
if (stepRef.current) {
|
|
11559
|
-
|
|
11566
|
+
updateStep(
|
|
11560
11567
|
__spreadProps(__spreadValues({}, stepRef.current), {
|
|
11561
11568
|
// the existing step
|
|
11562
11569
|
errors,
|
|
@@ -11604,7 +11611,7 @@ function useDynamicFlowCore(props) {
|
|
|
11604
11611
|
case "refresh-step":
|
|
11605
11612
|
{
|
|
11606
11613
|
const errors = errorsOverride != null ? errorsOverride : command.step.errors;
|
|
11607
|
-
|
|
11614
|
+
updateStep(__spreadProps(__spreadValues({}, command.step), { errors }), command.etag);
|
|
11608
11615
|
}
|
|
11609
11616
|
break;
|
|
11610
11617
|
case "error": {
|
|
@@ -11637,7 +11644,7 @@ function useDynamicFlowCore(props) {
|
|
|
11637
11644
|
});
|
|
11638
11645
|
switch (command.type) {
|
|
11639
11646
|
case "replace-step":
|
|
11640
|
-
|
|
11647
|
+
createStep(command.step, command.etag);
|
|
11641
11648
|
return true;
|
|
11642
11649
|
case "action":
|
|
11643
11650
|
void onAction(command.action);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wise/dynamic-flow-client",
|
|
3
|
-
"version": "3.34.
|
|
3
|
+
"version": "3.34.4",
|
|
4
4
|
"description": "Dynamic Flow web client",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./build/main.min.js",
|
|
@@ -85,8 +85,8 @@
|
|
|
85
85
|
"tsx": "4.19.2",
|
|
86
86
|
"typescript": "5.7.3",
|
|
87
87
|
"webpack": "5.97.1",
|
|
88
|
-
"@wise/dynamic-flow-
|
|
89
|
-
"@wise/dynamic-flow-
|
|
88
|
+
"@wise/dynamic-flow-renderers": "0.0.0",
|
|
89
|
+
"@wise/dynamic-flow-fixtures": "0.0.1"
|
|
90
90
|
},
|
|
91
91
|
"peerDependencies": {
|
|
92
92
|
"@transferwise/components": "^46.31",
|