@wise/dynamic-flow-client 4.3.3 → 4.3.5
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/i18n/cs.json +5 -5
- package/build/main.js +42 -22
- package/build/main.mjs +43 -23
- package/build/types/revamp/flow/executeRefresh.d.ts +2 -1
- package/build/types/revamp/flow/executeSubmission.d.ts +2 -1
- package/build/types/revamp/flow/getErrorMessage.d.ts +1 -0
- package/package.json +16 -16
package/build/i18n/cs.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"dynamicFlows.ArraySchema.addItem": "Uložit",
|
|
3
|
-
"dynamicFlows.ArraySchema.addItemTitle": "
|
|
3
|
+
"dynamicFlows.ArraySchema.addItemTitle": "Přidat položku",
|
|
4
4
|
"dynamicFlows.ArraySchema.editItem": "Uložit",
|
|
5
5
|
"dynamicFlows.ArraySchema.maxItemsError": "Přidejte {maxItems} nebo méně.",
|
|
6
6
|
"dynamicFlows.ArraySchema.minItemsError": "Přidejte alespoň {minItems}.",
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"dynamicFlows.ErrorBoundary.errorAlert": "Něco se pokazilo.",
|
|
35
35
|
"dynamicFlows.ErrorBoundary.retry": "Zkusit znovu",
|
|
36
36
|
"dynamicFlows.ExternalConfirmation.cancel": "Zrušit",
|
|
37
|
-
"dynamicFlows.ExternalConfirmation.description": "
|
|
38
|
-
"dynamicFlows.ExternalConfirmation.open": "
|
|
39
|
-
"dynamicFlows.ExternalConfirmation.title": "
|
|
37
|
+
"dynamicFlows.ExternalConfirmation.description": "Potvrďte, že chcete otevřít **{origin}** v nové kartě prohlížeče.",
|
|
38
|
+
"dynamicFlows.ExternalConfirmation.open": "Otevřít v nové kartě",
|
|
39
|
+
"dynamicFlows.ExternalConfirmation.title": "Potvrďte",
|
|
40
40
|
"dynamicFlows.FileUploadSchema.maxFileSizeError": "Pardon, tento soubor je příliš velký. Nahrajte prosím menší soubor.",
|
|
41
|
-
"dynamicFlows.FileUploadSchema.wrongFileTypeError": "
|
|
41
|
+
"dynamicFlows.FileUploadSchema.wrongFileTypeError": "Je nám líto, tento formát souboru není podporován. Nahrajte jiný soubor.",
|
|
42
42
|
"dynamicFlows.Help.ariaLabel": "Pro více informací klikněte sem.",
|
|
43
43
|
"dynamicFlows.MultiSelect.summary": "{first} a {count} více",
|
|
44
44
|
"dynamicFlows.MultipleFileUploadSchema.maxFileSizeError": "Pardon, tento soubor je příliš velký. Nahrajte prosím menší soubor.",
|
package/build/main.js
CHANGED
|
@@ -6090,9 +6090,14 @@ var executePoll = async (props) => {
|
|
|
6090
6090
|
}
|
|
6091
6091
|
};
|
|
6092
6092
|
|
|
6093
|
+
// src/revamp/flow/getErrorMessage.ts
|
|
6094
|
+
var getErrorMessage = (error) => {
|
|
6095
|
+
return error instanceof Error ? error.message : typeof error === "string" ? error : `Unknown Error: type is ${typeof error}`;
|
|
6096
|
+
};
|
|
6097
|
+
|
|
6093
6098
|
// src/revamp/flow/executeRefresh.ts
|
|
6094
6099
|
var executeRefresh = async (props) => {
|
|
6095
|
-
const { abortSignal, url, model, schemaId, etag, httpClient, trackEvent } = props;
|
|
6100
|
+
const { abortSignal, url, model, schemaId, etag, httpClient, trackEvent, logEvent } = props;
|
|
6096
6101
|
trackEvent("Refresh Triggered", { schema: schemaId });
|
|
6097
6102
|
try {
|
|
6098
6103
|
const response = await httpClient(url != null ? url : "", {
|
|
@@ -6114,6 +6119,7 @@ var executeRefresh = async (props) => {
|
|
|
6114
6119
|
schema: schemaId,
|
|
6115
6120
|
statusCode: response.status
|
|
6116
6121
|
}));
|
|
6122
|
+
logEvent("error", "Dynamic Flow - Refresh Failed", { schemaId, statusCode: response.status });
|
|
6117
6123
|
return { type: "error", body: body2, statusCode: response.status };
|
|
6118
6124
|
}
|
|
6119
6125
|
const newEtag = response.headers.get("etag") || null;
|
|
@@ -6127,13 +6133,17 @@ var executeRefresh = async (props) => {
|
|
|
6127
6133
|
return { type: "noop" };
|
|
6128
6134
|
}
|
|
6129
6135
|
trackEvent("Refresh Failed", { schema: schemaId });
|
|
6136
|
+
logEvent("error", "Dynamic Flow - Refresh Failed", {
|
|
6137
|
+
schemaId,
|
|
6138
|
+
errorMessage: getErrorMessage(error)
|
|
6139
|
+
});
|
|
6130
6140
|
return { type: "error", body: {} };
|
|
6131
6141
|
}
|
|
6132
6142
|
};
|
|
6133
6143
|
|
|
6134
6144
|
// src/revamp/flow/executeSubmission.ts
|
|
6135
6145
|
var executeSubmission = async (props) => {
|
|
6136
|
-
const { httpClient, trackEvent } = props;
|
|
6146
|
+
const { httpClient, trackEvent, logEvent } = props;
|
|
6137
6147
|
const triggerAction = async (action, model, isInitial) => {
|
|
6138
6148
|
const { exit, url, method = "POST", result = null, id: actionId } = action;
|
|
6139
6149
|
const trackSubmissionEvent = !isInitial ? trackEvent : () => {
|
|
@@ -6157,7 +6167,9 @@ var executeSubmission = async (props) => {
|
|
|
6157
6167
|
headers: { "Content-Type": "application/json" }
|
|
6158
6168
|
});
|
|
6159
6169
|
if (!response) {
|
|
6160
|
-
|
|
6170
|
+
const extra = { actionId, errorMessage: "Network Error" };
|
|
6171
|
+
trackEvent("Action Failed", extra);
|
|
6172
|
+
logEvent("error", "Dynamic Flow - Action Failed Unexpectedly", extra);
|
|
6161
6173
|
return { type: "error", body: {} };
|
|
6162
6174
|
}
|
|
6163
6175
|
if (!response.ok) {
|
|
@@ -6190,7 +6202,9 @@ var executeSubmission = async (props) => {
|
|
|
6190
6202
|
}
|
|
6191
6203
|
}
|
|
6192
6204
|
} catch (error) {
|
|
6193
|
-
|
|
6205
|
+
const errorMessage = getErrorMessage(error);
|
|
6206
|
+
trackSubmissionEvent("Action Failed", { actionId, errorMessage });
|
|
6207
|
+
logEvent("error", "Dynamic Flow - Action Failed Unexpectedly", { actionId, errorMessage });
|
|
6194
6208
|
throw error;
|
|
6195
6209
|
}
|
|
6196
6210
|
};
|
|
@@ -6507,18 +6521,12 @@ function useDynamicFlowCore(props) {
|
|
|
6507
6521
|
() => getSchemaErrorMessageFunction(formatMessage, locale),
|
|
6508
6522
|
[formatMessage, locale]
|
|
6509
6523
|
);
|
|
6510
|
-
const
|
|
6511
|
-
|
|
6512
|
-
);
|
|
6513
|
-
const rootComponentRef = (0, import_react3.useRef)(rootComponent);
|
|
6524
|
+
const rerender = useRerender();
|
|
6525
|
+
const rootComponentRef = (0, import_react3.useRef)(createRootDomainComponent());
|
|
6514
6526
|
const updateComponent = (0, import_react3.useCallback)(
|
|
6515
6527
|
(id, update) => {
|
|
6516
6528
|
update(findComponent([rootComponentRef.current], id, logEvent));
|
|
6517
|
-
|
|
6518
|
-
const newRootDomainComponent = __spreadValues({}, rootComponentRef.current);
|
|
6519
|
-
rootComponentRef.current = newRootDomainComponent;
|
|
6520
|
-
return newRootDomainComponent;
|
|
6521
|
-
});
|
|
6529
|
+
rerender();
|
|
6522
6530
|
},
|
|
6523
6531
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6524
6532
|
[]
|
|
@@ -6541,6 +6549,9 @@ function useDynamicFlowCore(props) {
|
|
|
6541
6549
|
createStep(initialStep, null);
|
|
6542
6550
|
trackCoreEvent("Step Shown", { isFirstStep: true });
|
|
6543
6551
|
}
|
|
6552
|
+
return () => {
|
|
6553
|
+
rootComponentRef.current.stop();
|
|
6554
|
+
};
|
|
6544
6555
|
}, []);
|
|
6545
6556
|
const createStep = (0, import_react3.useCallback)((newStep, etag) => {
|
|
6546
6557
|
if (rootComponentRef.current.hasStep()) {
|
|
@@ -6626,6 +6637,7 @@ function useDynamicFlowCore(props) {
|
|
|
6626
6637
|
(error, analytics, statusCode) => {
|
|
6627
6638
|
rootComponentRef.current.stop();
|
|
6628
6639
|
trackCoreEvent("Failed", __spreadValues({}, analytics));
|
|
6640
|
+
logEvent("error", "Dynamic Flow failed", { errorMessage: getErrorMessage(error), analytics });
|
|
6629
6641
|
onError(error, statusCode);
|
|
6630
6642
|
},
|
|
6631
6643
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -6641,7 +6653,8 @@ function useDynamicFlowCore(props) {
|
|
|
6641
6653
|
model,
|
|
6642
6654
|
isInitial: stepRef.current === null,
|
|
6643
6655
|
httpClient,
|
|
6644
|
-
trackEvent: trackCoreEvent
|
|
6656
|
+
trackEvent: trackCoreEvent,
|
|
6657
|
+
logEvent
|
|
6645
6658
|
});
|
|
6646
6659
|
switch (command.type) {
|
|
6647
6660
|
case "complete": {
|
|
@@ -6675,7 +6688,13 @@ function useDynamicFlowCore(props) {
|
|
|
6675
6688
|
etagRef.current
|
|
6676
6689
|
);
|
|
6677
6690
|
} else {
|
|
6678
|
-
closeWithError(
|
|
6691
|
+
closeWithError(
|
|
6692
|
+
new Error("Initial request failed", {
|
|
6693
|
+
cause: `method: ${action.method}, url: ${action.url}`
|
|
6694
|
+
}),
|
|
6695
|
+
{},
|
|
6696
|
+
command.statusCode
|
|
6697
|
+
);
|
|
6679
6698
|
}
|
|
6680
6699
|
break;
|
|
6681
6700
|
}
|
|
@@ -6702,7 +6721,8 @@ function useDynamicFlowCore(props) {
|
|
|
6702
6721
|
schemaId,
|
|
6703
6722
|
etag: etagRef.current,
|
|
6704
6723
|
httpClient,
|
|
6705
|
-
trackEvent: trackCoreEvent
|
|
6724
|
+
trackEvent: trackCoreEvent,
|
|
6725
|
+
logEvent
|
|
6706
6726
|
});
|
|
6707
6727
|
switch (command.type) {
|
|
6708
6728
|
case "refresh-step":
|
|
@@ -6758,13 +6778,17 @@ function useDynamicFlowCore(props) {
|
|
|
6758
6778
|
);
|
|
6759
6779
|
return { rootComponent: rootComponentRef.current };
|
|
6760
6780
|
}
|
|
6781
|
+
var useRerender = () => {
|
|
6782
|
+
const [, setState] = (0, import_react3.useState)({});
|
|
6783
|
+
return (0, import_react3.useCallback)(() => setState({}), []);
|
|
6784
|
+
};
|
|
6761
6785
|
|
|
6762
6786
|
// src/revamp/DynamicFlowCore.tsx
|
|
6763
6787
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
6764
6788
|
function DynamicFlowCore(props) {
|
|
6765
6789
|
var _a;
|
|
6766
6790
|
const { rootComponent } = useDynamicFlowCore(props);
|
|
6767
|
-
const { renderers, httpClient, onEvent, onError } = props;
|
|
6791
|
+
const { renderers, httpClient, onEvent, onError, onLog } = props;
|
|
6768
6792
|
const render = (0, import_react4.useMemo)(
|
|
6769
6793
|
() => getRenderFunction([CoreRootRenderer, CoreContainerRenderer, ...renderers]),
|
|
6770
6794
|
[renderers]
|
|
@@ -6776,17 +6800,13 @@ function DynamicFlowCore(props) {
|
|
|
6776
6800
|
},
|
|
6777
6801
|
stepLoadingState: rootComponent.getLoadingState()
|
|
6778
6802
|
});
|
|
6779
|
-
(0, import_react4.useEffect)(() => {
|
|
6780
|
-
return () => {
|
|
6781
|
-
rootComponent.stop();
|
|
6782
|
-
};
|
|
6783
|
-
}, []);
|
|
6784
6803
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
6785
6804
|
ErrorBoundary_default,
|
|
6786
6805
|
{
|
|
6787
6806
|
onError: (error) => {
|
|
6788
6807
|
onEvent == null ? void 0 : onEvent("Dynamic Flow - Failed", { error });
|
|
6789
6808
|
onError == null ? void 0 : onError(error);
|
|
6809
|
+
onLog == null ? void 0 : onLog("error", "Dynamic Flow - ErrorBoundary", { errorMessage: getErrorMessage(error) });
|
|
6790
6810
|
},
|
|
6791
6811
|
children: render(tree)
|
|
6792
6812
|
}
|
package/build/main.mjs
CHANGED
|
@@ -925,7 +925,7 @@ var translations = {
|
|
|
925
925
|
var i18n_default = translations;
|
|
926
926
|
|
|
927
927
|
// src/revamp/DynamicFlowCore.tsx
|
|
928
|
-
import {
|
|
928
|
+
import { useMemo as useMemo2 } from "react";
|
|
929
929
|
|
|
930
930
|
// src/common/errorBoundary/ErrorBoundary.tsx
|
|
931
931
|
import { Component } from "react";
|
|
@@ -6047,9 +6047,14 @@ var executePoll = async (props) => {
|
|
|
6047
6047
|
}
|
|
6048
6048
|
};
|
|
6049
6049
|
|
|
6050
|
+
// src/revamp/flow/getErrorMessage.ts
|
|
6051
|
+
var getErrorMessage = (error) => {
|
|
6052
|
+
return error instanceof Error ? error.message : typeof error === "string" ? error : `Unknown Error: type is ${typeof error}`;
|
|
6053
|
+
};
|
|
6054
|
+
|
|
6050
6055
|
// src/revamp/flow/executeRefresh.ts
|
|
6051
6056
|
var executeRefresh = async (props) => {
|
|
6052
|
-
const { abortSignal, url, model, schemaId, etag, httpClient, trackEvent } = props;
|
|
6057
|
+
const { abortSignal, url, model, schemaId, etag, httpClient, trackEvent, logEvent } = props;
|
|
6053
6058
|
trackEvent("Refresh Triggered", { schema: schemaId });
|
|
6054
6059
|
try {
|
|
6055
6060
|
const response = await httpClient(url != null ? url : "", {
|
|
@@ -6071,6 +6076,7 @@ var executeRefresh = async (props) => {
|
|
|
6071
6076
|
schema: schemaId,
|
|
6072
6077
|
statusCode: response.status
|
|
6073
6078
|
}));
|
|
6079
|
+
logEvent("error", "Dynamic Flow - Refresh Failed", { schemaId, statusCode: response.status });
|
|
6074
6080
|
return { type: "error", body: body2, statusCode: response.status };
|
|
6075
6081
|
}
|
|
6076
6082
|
const newEtag = response.headers.get("etag") || null;
|
|
@@ -6084,13 +6090,17 @@ var executeRefresh = async (props) => {
|
|
|
6084
6090
|
return { type: "noop" };
|
|
6085
6091
|
}
|
|
6086
6092
|
trackEvent("Refresh Failed", { schema: schemaId });
|
|
6093
|
+
logEvent("error", "Dynamic Flow - Refresh Failed", {
|
|
6094
|
+
schemaId,
|
|
6095
|
+
errorMessage: getErrorMessage(error)
|
|
6096
|
+
});
|
|
6087
6097
|
return { type: "error", body: {} };
|
|
6088
6098
|
}
|
|
6089
6099
|
};
|
|
6090
6100
|
|
|
6091
6101
|
// src/revamp/flow/executeSubmission.ts
|
|
6092
6102
|
var executeSubmission = async (props) => {
|
|
6093
|
-
const { httpClient, trackEvent } = props;
|
|
6103
|
+
const { httpClient, trackEvent, logEvent } = props;
|
|
6094
6104
|
const triggerAction = async (action, model, isInitial) => {
|
|
6095
6105
|
const { exit, url, method = "POST", result = null, id: actionId } = action;
|
|
6096
6106
|
const trackSubmissionEvent = !isInitial ? trackEvent : () => {
|
|
@@ -6114,7 +6124,9 @@ var executeSubmission = async (props) => {
|
|
|
6114
6124
|
headers: { "Content-Type": "application/json" }
|
|
6115
6125
|
});
|
|
6116
6126
|
if (!response) {
|
|
6117
|
-
|
|
6127
|
+
const extra = { actionId, errorMessage: "Network Error" };
|
|
6128
|
+
trackEvent("Action Failed", extra);
|
|
6129
|
+
logEvent("error", "Dynamic Flow - Action Failed Unexpectedly", extra);
|
|
6118
6130
|
return { type: "error", body: {} };
|
|
6119
6131
|
}
|
|
6120
6132
|
if (!response.ok) {
|
|
@@ -6147,7 +6159,9 @@ var executeSubmission = async (props) => {
|
|
|
6147
6159
|
}
|
|
6148
6160
|
}
|
|
6149
6161
|
} catch (error) {
|
|
6150
|
-
|
|
6162
|
+
const errorMessage = getErrorMessage(error);
|
|
6163
|
+
trackSubmissionEvent("Action Failed", { actionId, errorMessage });
|
|
6164
|
+
logEvent("error", "Dynamic Flow - Action Failed Unexpectedly", { actionId, errorMessage });
|
|
6151
6165
|
throw error;
|
|
6152
6166
|
}
|
|
6153
6167
|
};
|
|
@@ -6464,18 +6478,12 @@ function useDynamicFlowCore(props) {
|
|
|
6464
6478
|
() => getSchemaErrorMessageFunction(formatMessage, locale),
|
|
6465
6479
|
[formatMessage, locale]
|
|
6466
6480
|
);
|
|
6467
|
-
const
|
|
6468
|
-
|
|
6469
|
-
);
|
|
6470
|
-
const rootComponentRef = useRef2(rootComponent);
|
|
6481
|
+
const rerender = useRerender();
|
|
6482
|
+
const rootComponentRef = useRef2(createRootDomainComponent());
|
|
6471
6483
|
const updateComponent = useCallback2(
|
|
6472
6484
|
(id, update) => {
|
|
6473
6485
|
update(findComponent([rootComponentRef.current], id, logEvent));
|
|
6474
|
-
|
|
6475
|
-
const newRootDomainComponent = __spreadValues({}, rootComponentRef.current);
|
|
6476
|
-
rootComponentRef.current = newRootDomainComponent;
|
|
6477
|
-
return newRootDomainComponent;
|
|
6478
|
-
});
|
|
6486
|
+
rerender();
|
|
6479
6487
|
},
|
|
6480
6488
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6481
6489
|
[]
|
|
@@ -6498,6 +6506,9 @@ function useDynamicFlowCore(props) {
|
|
|
6498
6506
|
createStep(initialStep, null);
|
|
6499
6507
|
trackCoreEvent("Step Shown", { isFirstStep: true });
|
|
6500
6508
|
}
|
|
6509
|
+
return () => {
|
|
6510
|
+
rootComponentRef.current.stop();
|
|
6511
|
+
};
|
|
6501
6512
|
}, []);
|
|
6502
6513
|
const createStep = useCallback2((newStep, etag) => {
|
|
6503
6514
|
if (rootComponentRef.current.hasStep()) {
|
|
@@ -6583,6 +6594,7 @@ function useDynamicFlowCore(props) {
|
|
|
6583
6594
|
(error, analytics, statusCode) => {
|
|
6584
6595
|
rootComponentRef.current.stop();
|
|
6585
6596
|
trackCoreEvent("Failed", __spreadValues({}, analytics));
|
|
6597
|
+
logEvent("error", "Dynamic Flow failed", { errorMessage: getErrorMessage(error), analytics });
|
|
6586
6598
|
onError(error, statusCode);
|
|
6587
6599
|
},
|
|
6588
6600
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -6598,7 +6610,8 @@ function useDynamicFlowCore(props) {
|
|
|
6598
6610
|
model,
|
|
6599
6611
|
isInitial: stepRef.current === null,
|
|
6600
6612
|
httpClient,
|
|
6601
|
-
trackEvent: trackCoreEvent
|
|
6613
|
+
trackEvent: trackCoreEvent,
|
|
6614
|
+
logEvent
|
|
6602
6615
|
});
|
|
6603
6616
|
switch (command.type) {
|
|
6604
6617
|
case "complete": {
|
|
@@ -6632,7 +6645,13 @@ function useDynamicFlowCore(props) {
|
|
|
6632
6645
|
etagRef.current
|
|
6633
6646
|
);
|
|
6634
6647
|
} else {
|
|
6635
|
-
closeWithError(
|
|
6648
|
+
closeWithError(
|
|
6649
|
+
new Error("Initial request failed", {
|
|
6650
|
+
cause: `method: ${action.method}, url: ${action.url}`
|
|
6651
|
+
}),
|
|
6652
|
+
{},
|
|
6653
|
+
command.statusCode
|
|
6654
|
+
);
|
|
6636
6655
|
}
|
|
6637
6656
|
break;
|
|
6638
6657
|
}
|
|
@@ -6659,7 +6678,8 @@ function useDynamicFlowCore(props) {
|
|
|
6659
6678
|
schemaId,
|
|
6660
6679
|
etag: etagRef.current,
|
|
6661
6680
|
httpClient,
|
|
6662
|
-
trackEvent: trackCoreEvent
|
|
6681
|
+
trackEvent: trackCoreEvent,
|
|
6682
|
+
logEvent
|
|
6663
6683
|
});
|
|
6664
6684
|
switch (command.type) {
|
|
6665
6685
|
case "refresh-step":
|
|
@@ -6715,13 +6735,17 @@ function useDynamicFlowCore(props) {
|
|
|
6715
6735
|
);
|
|
6716
6736
|
return { rootComponent: rootComponentRef.current };
|
|
6717
6737
|
}
|
|
6738
|
+
var useRerender = () => {
|
|
6739
|
+
const [, setState] = useState({});
|
|
6740
|
+
return useCallback2(() => setState({}), []);
|
|
6741
|
+
};
|
|
6718
6742
|
|
|
6719
6743
|
// src/revamp/DynamicFlowCore.tsx
|
|
6720
6744
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
6721
6745
|
function DynamicFlowCore(props) {
|
|
6722
6746
|
var _a;
|
|
6723
6747
|
const { rootComponent } = useDynamicFlowCore(props);
|
|
6724
|
-
const { renderers, httpClient, onEvent, onError } = props;
|
|
6748
|
+
const { renderers, httpClient, onEvent, onError, onLog } = props;
|
|
6725
6749
|
const render = useMemo2(
|
|
6726
6750
|
() => getRenderFunction([CoreRootRenderer, CoreContainerRenderer, ...renderers]),
|
|
6727
6751
|
[renderers]
|
|
@@ -6733,17 +6757,13 @@ function DynamicFlowCore(props) {
|
|
|
6733
6757
|
},
|
|
6734
6758
|
stepLoadingState: rootComponent.getLoadingState()
|
|
6735
6759
|
});
|
|
6736
|
-
useEffect2(() => {
|
|
6737
|
-
return () => {
|
|
6738
|
-
rootComponent.stop();
|
|
6739
|
-
};
|
|
6740
|
-
}, []);
|
|
6741
6760
|
return /* @__PURE__ */ jsx6(
|
|
6742
6761
|
ErrorBoundary_default,
|
|
6743
6762
|
{
|
|
6744
6763
|
onError: (error) => {
|
|
6745
6764
|
onEvent == null ? void 0 : onEvent("Dynamic Flow - Failed", { error });
|
|
6746
6765
|
onError == null ? void 0 : onError(error);
|
|
6766
|
+
onLog == null ? void 0 : onLog("error", "Dynamic Flow - ErrorBoundary", { errorMessage: getErrorMessage(error) });
|
|
6747
6767
|
},
|
|
6748
6768
|
children: render(tree)
|
|
6749
6769
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Model, Step, ErrorResponseBody } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
-
import type { AnalyticsEventDispatcher } from '../domain/features/events';
|
|
2
|
+
import type { AnalyticsEventDispatcher, LoggingEventDispatcher } from '../domain/features/events';
|
|
3
3
|
type Command = {
|
|
4
4
|
type: 'refresh-step';
|
|
5
5
|
step: Step;
|
|
@@ -19,5 +19,6 @@ export declare const executeRefresh: (props: {
|
|
|
19
19
|
etag: string | null;
|
|
20
20
|
httpClient: typeof fetch;
|
|
21
21
|
trackEvent: AnalyticsEventDispatcher;
|
|
22
|
+
logEvent: LoggingEventDispatcher;
|
|
22
23
|
}) => Promise<Command>;
|
|
23
24
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Action, ErrorResponseBody, Model, Step } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
-
import type { AnalyticsEventDispatcher } from '../domain/features/events';
|
|
2
|
+
import type { AnalyticsEventDispatcher, LoggingEventDispatcher } from '../domain/features/events';
|
|
3
3
|
type Command = {
|
|
4
4
|
type: 'complete';
|
|
5
5
|
result: Model;
|
|
@@ -27,5 +27,6 @@ export declare const executeSubmission: (props: {
|
|
|
27
27
|
isInitial: boolean;
|
|
28
28
|
httpClient: typeof fetch;
|
|
29
29
|
trackEvent: AnalyticsEventDispatcher;
|
|
30
|
+
logEvent: LoggingEventDispatcher;
|
|
30
31
|
}) => Promise<Command>;
|
|
31
32
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getErrorMessage: (error: unknown) => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wise/dynamic-flow-client",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.5",
|
|
4
4
|
"description": "Dynamic Flow web client",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./build/main.js",
|
|
@@ -35,20 +35,20 @@
|
|
|
35
35
|
"@babel/plugin-transform-react-jsx": "7.25.9",
|
|
36
36
|
"@babel/preset-env": "7.26.9",
|
|
37
37
|
"@babel/preset-react": "7.26.3",
|
|
38
|
-
"@babel/preset-typescript": "7.
|
|
38
|
+
"@babel/preset-typescript": "7.27.0",
|
|
39
39
|
"@chromatic-com/storybook": "3.2.6",
|
|
40
|
-
"@formatjs/cli": "^6.6.
|
|
41
|
-
"@storybook/addon-a11y": "^8.6.
|
|
42
|
-
"@storybook/addon-actions": "^8.6.
|
|
43
|
-
"@storybook/addon-essentials": "^8.6.
|
|
44
|
-
"@storybook/addon-interactions": "^8.6.
|
|
45
|
-
"@storybook/addon-links": "^8.6.
|
|
40
|
+
"@formatjs/cli": "^6.6.3",
|
|
41
|
+
"@storybook/addon-a11y": "^8.6.11",
|
|
42
|
+
"@storybook/addon-actions": "^8.6.11",
|
|
43
|
+
"@storybook/addon-essentials": "^8.6.11",
|
|
44
|
+
"@storybook/addon-interactions": "^8.6.11",
|
|
45
|
+
"@storybook/addon-links": "^8.6.11",
|
|
46
46
|
"@storybook/addon-webpack5-compiler-babel": "^3.0.5",
|
|
47
|
-
"@storybook/manager-api": "^8.6.
|
|
48
|
-
"@storybook/react": "^8.6.
|
|
49
|
-
"@storybook/react-webpack5": "^8.6.
|
|
50
|
-
"@storybook/test": "^8.6.
|
|
51
|
-
"@storybook/types": "^8.6.
|
|
47
|
+
"@storybook/manager-api": "^8.6.11",
|
|
48
|
+
"@storybook/react": "^8.6.11",
|
|
49
|
+
"@storybook/react-webpack5": "^8.6.11",
|
|
50
|
+
"@storybook/test": "^8.6.11",
|
|
51
|
+
"@storybook/types": "^8.6.11",
|
|
52
52
|
"@testing-library/dom": "10.4.0",
|
|
53
53
|
"@testing-library/jest-dom": "6.6.3",
|
|
54
54
|
"@testing-library/react": "16.2.0",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"@transferwise/formatting": "^2.13.1",
|
|
58
58
|
"@transferwise/icons": "3.19.1",
|
|
59
59
|
"@transferwise/neptune-css": "14.23.0",
|
|
60
|
-
"@types/node": "22.13.
|
|
60
|
+
"@types/node": "22.13.14",
|
|
61
61
|
"@types/jest": "29.5.14",
|
|
62
62
|
"@types/react": "18.3.20",
|
|
63
63
|
"@types/react-dom": "18.3.5",
|
|
@@ -77,8 +77,8 @@
|
|
|
77
77
|
"react": "18.3.1",
|
|
78
78
|
"react-dom": "18.3.1",
|
|
79
79
|
"react-intl": "6.8.9",
|
|
80
|
-
"storybook": "^8.6.
|
|
81
|
-
"stylelint": "16.
|
|
80
|
+
"storybook": "^8.6.11",
|
|
81
|
+
"stylelint": "16.17.0",
|
|
82
82
|
"stylelint-config-standard": "36.0.1",
|
|
83
83
|
"stylelint-no-unsupported-browser-features": "8.0.4",
|
|
84
84
|
"stylelint-value-no-unknown-custom-properties": "6.0.1",
|