@wise/dynamic-flow-client 4.7.0 → 4.8.0
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.css +37 -13
- package/build/main.js +73 -8
- package/build/main.mjs +73 -8
- package/build/types/revamp/domain/components/TabsComponent.d.ts +11 -0
- package/build/types/revamp/domain/mappers/layout/tabsLayoutToComponent.d.ts +5 -0
- package/build/types/revamp/domain/types.d.ts +2 -1
- package/build/types/revamp/flow/executeSubmission.d.ts +5 -2
- package/build/types/revamp/flow/response-utils.d.ts +1 -0
- package/build/types/revamp/renderers/mappers/tabsComponentToProps.d.ts +4 -0
- package/package.json +9 -9
package/build/main.css
CHANGED
|
@@ -287,39 +287,63 @@ button.df-back-btn {
|
|
|
287
287
|
height: auto;
|
|
288
288
|
width: 100%;
|
|
289
289
|
}
|
|
290
|
-
/*
|
|
290
|
+
/* wide screens (or default) */
|
|
291
291
|
.df-image.xs img {
|
|
292
|
-
width:
|
|
292
|
+
width: 100px;
|
|
293
293
|
}
|
|
294
294
|
.df-image.sm img {
|
|
295
|
-
width:
|
|
295
|
+
width: 200px;
|
|
296
296
|
}
|
|
297
297
|
.df-image.md img {
|
|
298
|
-
width:
|
|
298
|
+
width: 300px;
|
|
299
299
|
}
|
|
300
300
|
.df-image.lg img {
|
|
301
|
-
width:
|
|
301
|
+
width: 500px;
|
|
302
302
|
}
|
|
303
|
-
|
|
304
|
-
|
|
303
|
+
.df-image.xl img {
|
|
304
|
+
max-width: 600px;
|
|
305
|
+
}
|
|
306
|
+
/* narrow screens */
|
|
307
|
+
@media (width <576px) {
|
|
305
308
|
.df-image.xs img {
|
|
306
|
-
width:
|
|
309
|
+
width: 50px;
|
|
307
310
|
}
|
|
308
311
|
|
|
309
312
|
.df-image.sm img {
|
|
310
|
-
width:
|
|
313
|
+
width: 100px;
|
|
311
314
|
}
|
|
312
315
|
|
|
313
316
|
.df-image.md img {
|
|
314
|
-
width:
|
|
317
|
+
width: 200px;
|
|
315
318
|
}
|
|
316
319
|
|
|
317
320
|
.df-image.lg img {
|
|
318
|
-
width:
|
|
321
|
+
width: 300px;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* This speficies the container for container queries about width.
|
|
326
|
+
* We don't use it by default, but integrations can specify it using the className prop in the DF component.
|
|
327
|
+
*/
|
|
328
|
+
.df-prefer-container-queries {
|
|
329
|
+
container-type: inline-size;
|
|
330
|
+
}
|
|
331
|
+
/* narrow container */
|
|
332
|
+
@container (max-width: 576px) {
|
|
333
|
+
.df-image.xs img {
|
|
334
|
+
width: 50px;
|
|
319
335
|
}
|
|
320
336
|
|
|
321
|
-
.df-image.
|
|
322
|
-
|
|
337
|
+
.df-image.sm img {
|
|
338
|
+
width: 100px;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.df-image.md img {
|
|
342
|
+
width: 200px;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
.df-image.lg img {
|
|
346
|
+
width: 300px;
|
|
323
347
|
}
|
|
324
348
|
}
|
|
325
349
|
.df-back-btn .tw-avatar__content {
|
package/build/main.js
CHANGED
|
@@ -1100,6 +1100,8 @@ function getChildren(node) {
|
|
|
1100
1100
|
return node.editableItemProps ? [node.editableItemProps] : [];
|
|
1101
1101
|
case "input-select":
|
|
1102
1102
|
return node.childrenProps ? [node.childrenProps] : [];
|
|
1103
|
+
case "tabs":
|
|
1104
|
+
return node.tabs.flatMap((c) => c.childrenProps);
|
|
1103
1105
|
case "alert":
|
|
1104
1106
|
case "button":
|
|
1105
1107
|
case "input-checkbox":
|
|
@@ -1791,6 +1793,22 @@ var uploadInputComponentToProps = (component, rendererMapperProps) => {
|
|
|
1791
1793
|
});
|
|
1792
1794
|
};
|
|
1793
1795
|
|
|
1796
|
+
// src/revamp/renderers/mappers/tabsComponentToProps.ts
|
|
1797
|
+
var tabsComponentToProps = (component, rendererMapperProps) => {
|
|
1798
|
+
const tabs = component.tabs.map(({ components, tag, title }) => {
|
|
1799
|
+
const childrenProps = components.map((c) => componentToRendererProps(c, rendererMapperProps));
|
|
1800
|
+
return {
|
|
1801
|
+
title,
|
|
1802
|
+
tag,
|
|
1803
|
+
childrenProps,
|
|
1804
|
+
children: childrenProps.map(rendererMapperProps.render)
|
|
1805
|
+
};
|
|
1806
|
+
});
|
|
1807
|
+
return __spreadProps(__spreadValues(__spreadValues({}, pick(component, "uid", "type", "control", "margin")), rendererMapperProps), {
|
|
1808
|
+
tabs
|
|
1809
|
+
});
|
|
1810
|
+
};
|
|
1811
|
+
|
|
1794
1812
|
// src/revamp/renderers/mappers/componentToRendererProps.ts
|
|
1795
1813
|
var componentToRendererProps = (component, rendererMapperProps) => {
|
|
1796
1814
|
if (isHiddenComponent(component)) {
|
|
@@ -1881,6 +1899,8 @@ var getComponentProps = (component, rendererMapperProps) => {
|
|
|
1881
1899
|
return selectInputComponentToProps(component, rendererMapperProps);
|
|
1882
1900
|
case "status-list":
|
|
1883
1901
|
return statusListComponentToProps(component, rendererMapperProps);
|
|
1902
|
+
case "tabs":
|
|
1903
|
+
return tabsComponentToProps(component, rendererMapperProps);
|
|
1884
1904
|
case "text":
|
|
1885
1905
|
return textInputComponentToProps(component, rendererMapperProps);
|
|
1886
1906
|
case "tuple":
|
|
@@ -2868,6 +2888,30 @@ var sectionLayoutToComponent = (uid, { control, title, components, callToAction,
|
|
|
2868
2888
|
});
|
|
2869
2889
|
};
|
|
2870
2890
|
|
|
2891
|
+
// src/revamp/domain/components/TabsComponent.ts
|
|
2892
|
+
var createTabsComponent = (tabsProps) => __spreadProps(__spreadValues({}, tabsProps), {
|
|
2893
|
+
type: "tabs"
|
|
2894
|
+
});
|
|
2895
|
+
|
|
2896
|
+
// src/revamp/domain/mappers/layout/tabsLayoutToComponent.ts
|
|
2897
|
+
var tabsLayoutToComponent = (uid, { control, margin = "md", tabs }, mapperProps, schemaComponents) => createTabsComponent({
|
|
2898
|
+
uid,
|
|
2899
|
+
control,
|
|
2900
|
+
margin,
|
|
2901
|
+
tabs: tabs.map(({ components, tag, title }, tabIndex) => ({
|
|
2902
|
+
tag,
|
|
2903
|
+
title,
|
|
2904
|
+
components: components.map(
|
|
2905
|
+
(c, componentIndex) => mapLayoutToComponent(
|
|
2906
|
+
`${uid}.tabs-${tabIndex}-${componentIndex}`,
|
|
2907
|
+
c,
|
|
2908
|
+
mapperProps,
|
|
2909
|
+
schemaComponents
|
|
2910
|
+
)
|
|
2911
|
+
)
|
|
2912
|
+
}))
|
|
2913
|
+
});
|
|
2914
|
+
|
|
2871
2915
|
// src/revamp/domain/mappers/mapLayoutToComponent.ts
|
|
2872
2916
|
var mapLayoutToComponent = (uid, layout, mapperProps, schemaComponents) => {
|
|
2873
2917
|
switch (layout.type) {
|
|
@@ -2911,6 +2955,8 @@ var mapLayoutToComponent = (uid, layout, mapperProps, schemaComponents) => {
|
|
|
2911
2955
|
return sectionLayoutToComponent(uid, layout, mapperProps, schemaComponents);
|
|
2912
2956
|
case "status-list":
|
|
2913
2957
|
return statusListLayoutToComponent(uid, layout, mapperProps);
|
|
2958
|
+
case "tabs":
|
|
2959
|
+
return tabsLayoutToComponent(uid, layout, mapperProps, schemaComponents);
|
|
2914
2960
|
default:
|
|
2915
2961
|
throw new Error(`Invalid layout type in ${JSON.stringify(layout)}`);
|
|
2916
2962
|
}
|
|
@@ -3542,6 +3588,13 @@ var parseResponseBodyAsJsonElement = async (response) => {
|
|
|
3542
3588
|
return null;
|
|
3543
3589
|
}
|
|
3544
3590
|
};
|
|
3591
|
+
var parseResponseBodyAsText = async (response) => {
|
|
3592
|
+
try {
|
|
3593
|
+
return await response.text();
|
|
3594
|
+
} catch (e) {
|
|
3595
|
+
return null;
|
|
3596
|
+
}
|
|
3597
|
+
};
|
|
3545
3598
|
function isActionResponseBody(body) {
|
|
3546
3599
|
return (0, import_dynamic_flow_types.validateActionResponse)(body).valid;
|
|
3547
3600
|
}
|
|
@@ -6019,7 +6072,7 @@ var executeSubmission = async (props) => {
|
|
|
6019
6072
|
const extra = { actionId, errorMessage: "Network Error" };
|
|
6020
6073
|
trackEvent("Action Failed", extra);
|
|
6021
6074
|
logEvent("error", "Dynamic Flow - Action Failed Unexpectedly", extra);
|
|
6022
|
-
return { type: "error"
|
|
6075
|
+
return { type: "error" };
|
|
6023
6076
|
}
|
|
6024
6077
|
if (!response.ok) {
|
|
6025
6078
|
return handleErrorResponse(response, actionId);
|
|
@@ -6062,16 +6115,27 @@ var executeSubmission = async (props) => {
|
|
|
6062
6115
|
}
|
|
6063
6116
|
};
|
|
6064
6117
|
const handleErrorResponse = async (response, actionId) => {
|
|
6065
|
-
const body = await parseResponseBodyAsJsonElement(response);
|
|
6118
|
+
const body = await parseResponseBodyAsJsonElement(response.clone());
|
|
6066
6119
|
if (isErrorResponseBody(body)) {
|
|
6067
6120
|
const refreshUrl = body.refreshUrl || body.refreshFormUrl;
|
|
6068
6121
|
const { error, validation, analytics } = body;
|
|
6069
6122
|
trackEvent("Action Failed", __spreadProps(__spreadValues({}, analytics), { actionId, statusCode: response.status }));
|
|
6070
6123
|
const errors = { error, validation };
|
|
6071
|
-
return refreshUrl ? { type: "refresh", body: { refreshUrl, errors } } : {
|
|
6124
|
+
return refreshUrl ? { type: "refresh", body: { refreshUrl, errors } } : {
|
|
6125
|
+
type: "error",
|
|
6126
|
+
body: { errors, analytics },
|
|
6127
|
+
httpError: { statusCode: response.status }
|
|
6128
|
+
};
|
|
6072
6129
|
}
|
|
6073
6130
|
trackEvent("Action Failed", { actionId, statusCode: response.status });
|
|
6074
|
-
|
|
6131
|
+
const errorMessage = await parseResponseBodyAsText(response);
|
|
6132
|
+
return {
|
|
6133
|
+
type: "error",
|
|
6134
|
+
httpError: {
|
|
6135
|
+
message: errorMessage || void 0,
|
|
6136
|
+
statusCode: response.status
|
|
6137
|
+
}
|
|
6138
|
+
};
|
|
6075
6139
|
};
|
|
6076
6140
|
return triggerAction(props.action, props.model, props.isInitial);
|
|
6077
6141
|
};
|
|
@@ -6495,7 +6559,7 @@ function useDynamicFlowCore(props) {
|
|
|
6495
6559
|
}
|
|
6496
6560
|
}, []);
|
|
6497
6561
|
const onAction = (0, import_react3.useCallback)(async (action) => {
|
|
6498
|
-
var _a2;
|
|
6562
|
+
var _a2, _b, _c, _d, _e, _f, _g;
|
|
6499
6563
|
try {
|
|
6500
6564
|
rootComponentRef.current.setLoadingState("submitting");
|
|
6501
6565
|
const model = (_a2 = await rootComponentRef.current.getSubmittableValue()) != null ? _a2 : null;
|
|
@@ -6522,7 +6586,7 @@ function useDynamicFlowCore(props) {
|
|
|
6522
6586
|
}
|
|
6523
6587
|
case "error": {
|
|
6524
6588
|
const genericErrorMessage = getErrorMessageFunctions().genericErrorWithRetry();
|
|
6525
|
-
const
|
|
6589
|
+
const errors = (_c = (_b = command.body) == null ? void 0 : _b.errors) != null ? _c : { error: genericErrorMessage };
|
|
6526
6590
|
if (stepRef.current) {
|
|
6527
6591
|
updateStep(
|
|
6528
6592
|
__spreadProps(__spreadValues({}, stepRef.current), {
|
|
@@ -6539,12 +6603,13 @@ function useDynamicFlowCore(props) {
|
|
|
6539
6603
|
etagRef.current
|
|
6540
6604
|
);
|
|
6541
6605
|
} else {
|
|
6606
|
+
const errorMessage = ((_e = (_d = command.body) == null ? void 0 : _d.errors) == null ? void 0 : _e.error) || ((_f = command.httpError) == null ? void 0 : _f.message) || "Initial request failed";
|
|
6542
6607
|
closeWithError(
|
|
6543
|
-
new Error(
|
|
6608
|
+
new Error(errorMessage, {
|
|
6544
6609
|
cause: `method: ${action.method}, url: ${action.url}`
|
|
6545
6610
|
}),
|
|
6546
6611
|
{},
|
|
6547
|
-
command.statusCode
|
|
6612
|
+
(_g = command.httpError) == null ? void 0 : _g.statusCode
|
|
6548
6613
|
);
|
|
6549
6614
|
}
|
|
6550
6615
|
break;
|
package/build/main.mjs
CHANGED
|
@@ -1057,6 +1057,8 @@ function getChildren(node) {
|
|
|
1057
1057
|
return node.editableItemProps ? [node.editableItemProps] : [];
|
|
1058
1058
|
case "input-select":
|
|
1059
1059
|
return node.childrenProps ? [node.childrenProps] : [];
|
|
1060
|
+
case "tabs":
|
|
1061
|
+
return node.tabs.flatMap((c) => c.childrenProps);
|
|
1060
1062
|
case "alert":
|
|
1061
1063
|
case "button":
|
|
1062
1064
|
case "input-checkbox":
|
|
@@ -1748,6 +1750,22 @@ var uploadInputComponentToProps = (component, rendererMapperProps) => {
|
|
|
1748
1750
|
});
|
|
1749
1751
|
};
|
|
1750
1752
|
|
|
1753
|
+
// src/revamp/renderers/mappers/tabsComponentToProps.ts
|
|
1754
|
+
var tabsComponentToProps = (component, rendererMapperProps) => {
|
|
1755
|
+
const tabs = component.tabs.map(({ components, tag, title }) => {
|
|
1756
|
+
const childrenProps = components.map((c) => componentToRendererProps(c, rendererMapperProps));
|
|
1757
|
+
return {
|
|
1758
|
+
title,
|
|
1759
|
+
tag,
|
|
1760
|
+
childrenProps,
|
|
1761
|
+
children: childrenProps.map(rendererMapperProps.render)
|
|
1762
|
+
};
|
|
1763
|
+
});
|
|
1764
|
+
return __spreadProps(__spreadValues(__spreadValues({}, pick(component, "uid", "type", "control", "margin")), rendererMapperProps), {
|
|
1765
|
+
tabs
|
|
1766
|
+
});
|
|
1767
|
+
};
|
|
1768
|
+
|
|
1751
1769
|
// src/revamp/renderers/mappers/componentToRendererProps.ts
|
|
1752
1770
|
var componentToRendererProps = (component, rendererMapperProps) => {
|
|
1753
1771
|
if (isHiddenComponent(component)) {
|
|
@@ -1838,6 +1856,8 @@ var getComponentProps = (component, rendererMapperProps) => {
|
|
|
1838
1856
|
return selectInputComponentToProps(component, rendererMapperProps);
|
|
1839
1857
|
case "status-list":
|
|
1840
1858
|
return statusListComponentToProps(component, rendererMapperProps);
|
|
1859
|
+
case "tabs":
|
|
1860
|
+
return tabsComponentToProps(component, rendererMapperProps);
|
|
1841
1861
|
case "text":
|
|
1842
1862
|
return textInputComponentToProps(component, rendererMapperProps);
|
|
1843
1863
|
case "tuple":
|
|
@@ -2825,6 +2845,30 @@ var sectionLayoutToComponent = (uid, { control, title, components, callToAction,
|
|
|
2825
2845
|
});
|
|
2826
2846
|
};
|
|
2827
2847
|
|
|
2848
|
+
// src/revamp/domain/components/TabsComponent.ts
|
|
2849
|
+
var createTabsComponent = (tabsProps) => __spreadProps(__spreadValues({}, tabsProps), {
|
|
2850
|
+
type: "tabs"
|
|
2851
|
+
});
|
|
2852
|
+
|
|
2853
|
+
// src/revamp/domain/mappers/layout/tabsLayoutToComponent.ts
|
|
2854
|
+
var tabsLayoutToComponent = (uid, { control, margin = "md", tabs }, mapperProps, schemaComponents) => createTabsComponent({
|
|
2855
|
+
uid,
|
|
2856
|
+
control,
|
|
2857
|
+
margin,
|
|
2858
|
+
tabs: tabs.map(({ components, tag, title }, tabIndex) => ({
|
|
2859
|
+
tag,
|
|
2860
|
+
title,
|
|
2861
|
+
components: components.map(
|
|
2862
|
+
(c, componentIndex) => mapLayoutToComponent(
|
|
2863
|
+
`${uid}.tabs-${tabIndex}-${componentIndex}`,
|
|
2864
|
+
c,
|
|
2865
|
+
mapperProps,
|
|
2866
|
+
schemaComponents
|
|
2867
|
+
)
|
|
2868
|
+
)
|
|
2869
|
+
}))
|
|
2870
|
+
});
|
|
2871
|
+
|
|
2828
2872
|
// src/revamp/domain/mappers/mapLayoutToComponent.ts
|
|
2829
2873
|
var mapLayoutToComponent = (uid, layout, mapperProps, schemaComponents) => {
|
|
2830
2874
|
switch (layout.type) {
|
|
@@ -2868,6 +2912,8 @@ var mapLayoutToComponent = (uid, layout, mapperProps, schemaComponents) => {
|
|
|
2868
2912
|
return sectionLayoutToComponent(uid, layout, mapperProps, schemaComponents);
|
|
2869
2913
|
case "status-list":
|
|
2870
2914
|
return statusListLayoutToComponent(uid, layout, mapperProps);
|
|
2915
|
+
case "tabs":
|
|
2916
|
+
return tabsLayoutToComponent(uid, layout, mapperProps, schemaComponents);
|
|
2871
2917
|
default:
|
|
2872
2918
|
throw new Error(`Invalid layout type in ${JSON.stringify(layout)}`);
|
|
2873
2919
|
}
|
|
@@ -3499,6 +3545,13 @@ var parseResponseBodyAsJsonElement = async (response) => {
|
|
|
3499
3545
|
return null;
|
|
3500
3546
|
}
|
|
3501
3547
|
};
|
|
3548
|
+
var parseResponseBodyAsText = async (response) => {
|
|
3549
|
+
try {
|
|
3550
|
+
return await response.text();
|
|
3551
|
+
} catch (e) {
|
|
3552
|
+
return null;
|
|
3553
|
+
}
|
|
3554
|
+
};
|
|
3502
3555
|
function isActionResponseBody(body) {
|
|
3503
3556
|
return validateActionResponse(body).valid;
|
|
3504
3557
|
}
|
|
@@ -5976,7 +6029,7 @@ var executeSubmission = async (props) => {
|
|
|
5976
6029
|
const extra = { actionId, errorMessage: "Network Error" };
|
|
5977
6030
|
trackEvent("Action Failed", extra);
|
|
5978
6031
|
logEvent("error", "Dynamic Flow - Action Failed Unexpectedly", extra);
|
|
5979
|
-
return { type: "error"
|
|
6032
|
+
return { type: "error" };
|
|
5980
6033
|
}
|
|
5981
6034
|
if (!response.ok) {
|
|
5982
6035
|
return handleErrorResponse(response, actionId);
|
|
@@ -6019,16 +6072,27 @@ var executeSubmission = async (props) => {
|
|
|
6019
6072
|
}
|
|
6020
6073
|
};
|
|
6021
6074
|
const handleErrorResponse = async (response, actionId) => {
|
|
6022
|
-
const body = await parseResponseBodyAsJsonElement(response);
|
|
6075
|
+
const body = await parseResponseBodyAsJsonElement(response.clone());
|
|
6023
6076
|
if (isErrorResponseBody(body)) {
|
|
6024
6077
|
const refreshUrl = body.refreshUrl || body.refreshFormUrl;
|
|
6025
6078
|
const { error, validation, analytics } = body;
|
|
6026
6079
|
trackEvent("Action Failed", __spreadProps(__spreadValues({}, analytics), { actionId, statusCode: response.status }));
|
|
6027
6080
|
const errors = { error, validation };
|
|
6028
|
-
return refreshUrl ? { type: "refresh", body: { refreshUrl, errors } } : {
|
|
6081
|
+
return refreshUrl ? { type: "refresh", body: { refreshUrl, errors } } : {
|
|
6082
|
+
type: "error",
|
|
6083
|
+
body: { errors, analytics },
|
|
6084
|
+
httpError: { statusCode: response.status }
|
|
6085
|
+
};
|
|
6029
6086
|
}
|
|
6030
6087
|
trackEvent("Action Failed", { actionId, statusCode: response.status });
|
|
6031
|
-
|
|
6088
|
+
const errorMessage = await parseResponseBodyAsText(response);
|
|
6089
|
+
return {
|
|
6090
|
+
type: "error",
|
|
6091
|
+
httpError: {
|
|
6092
|
+
message: errorMessage || void 0,
|
|
6093
|
+
statusCode: response.status
|
|
6094
|
+
}
|
|
6095
|
+
};
|
|
6032
6096
|
};
|
|
6033
6097
|
return triggerAction(props.action, props.model, props.isInitial);
|
|
6034
6098
|
};
|
|
@@ -6452,7 +6516,7 @@ function useDynamicFlowCore(props) {
|
|
|
6452
6516
|
}
|
|
6453
6517
|
}, []);
|
|
6454
6518
|
const onAction = useCallback2(async (action) => {
|
|
6455
|
-
var _a2;
|
|
6519
|
+
var _a2, _b, _c, _d, _e, _f, _g;
|
|
6456
6520
|
try {
|
|
6457
6521
|
rootComponentRef.current.setLoadingState("submitting");
|
|
6458
6522
|
const model = (_a2 = await rootComponentRef.current.getSubmittableValue()) != null ? _a2 : null;
|
|
@@ -6479,7 +6543,7 @@ function useDynamicFlowCore(props) {
|
|
|
6479
6543
|
}
|
|
6480
6544
|
case "error": {
|
|
6481
6545
|
const genericErrorMessage = getErrorMessageFunctions().genericErrorWithRetry();
|
|
6482
|
-
const
|
|
6546
|
+
const errors = (_c = (_b = command.body) == null ? void 0 : _b.errors) != null ? _c : { error: genericErrorMessage };
|
|
6483
6547
|
if (stepRef.current) {
|
|
6484
6548
|
updateStep(
|
|
6485
6549
|
__spreadProps(__spreadValues({}, stepRef.current), {
|
|
@@ -6496,12 +6560,13 @@ function useDynamicFlowCore(props) {
|
|
|
6496
6560
|
etagRef.current
|
|
6497
6561
|
);
|
|
6498
6562
|
} else {
|
|
6563
|
+
const errorMessage = ((_e = (_d = command.body) == null ? void 0 : _d.errors) == null ? void 0 : _e.error) || ((_f = command.httpError) == null ? void 0 : _f.message) || "Initial request failed";
|
|
6499
6564
|
closeWithError(
|
|
6500
|
-
new Error(
|
|
6565
|
+
new Error(errorMessage, {
|
|
6501
6566
|
cause: `method: ${action.method}, url: ${action.url}`
|
|
6502
6567
|
}),
|
|
6503
6568
|
{},
|
|
6504
|
-
command.statusCode
|
|
6569
|
+
(_g = command.httpError) == null ? void 0 : _g.statusCode
|
|
6505
6570
|
);
|
|
6506
6571
|
}
|
|
6507
6572
|
break;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseLayoutComponent, DomainComponent } from '../types';
|
|
2
|
+
export type TabsComponent = BaseLayoutComponent & {
|
|
3
|
+
type: 'tabs';
|
|
4
|
+
tabs: Tab[];
|
|
5
|
+
};
|
|
6
|
+
export type Tab = {
|
|
7
|
+
title: string;
|
|
8
|
+
components: DomainComponent[];
|
|
9
|
+
tag?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const createTabsComponent: (tabsProps: Pick<TabsComponent, "uid" | "control" | "margin" | "tabs">) => TabsComponent;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { TabsLayout } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
+
import { TabsComponent } from '../../components/TabsComponent';
|
|
3
|
+
import { MapperProps } from '../schema/types';
|
|
4
|
+
import { SchemaComponent } from '../../types';
|
|
5
|
+
export declare const tabsLayoutToComponent: (uid: string, { control, margin, tabs }: TabsLayout, mapperProps: MapperProps, schemaComponents: SchemaComponent[]) => TabsComponent;
|
|
@@ -38,9 +38,10 @@ import type { StepDomainComponent } from './components/step/StepDomainComponent'
|
|
|
38
38
|
import type { TextInputComponent } from './components/TextInputComponent';
|
|
39
39
|
import type { TupleComponent } from './components/TupleComponent';
|
|
40
40
|
import type { UploadInputComponent } from './components/UploadInputComponent';
|
|
41
|
+
import { TabsComponent } from './components/TabsComponent';
|
|
41
42
|
export type DomainComponent = SchemaComponent | LayoutComponent | RootDomainComponent | StepDomainComponent;
|
|
42
43
|
export type SchemaComponent = PersistAsyncComponent | AllOfComponent | BooleanInputComponent | ConstComponent | DateInputComponent | IntegerInputComponent | MultiSelectComponent | MultiUploadInputComponent | NumberInputComponent | ObjectComponent | RepeatableComponent | SelectInputComponent | TextInputComponent | TupleComponent | UploadInputComponent;
|
|
43
|
-
export type LayoutComponent = AlertComponent | BoxComponent | ButtonComponent | ColumnsComponent | ContainerComponent | DecisionComponent | DividerComponent | ExternalConfirmationComponent | FormComponent | HeadingComponent | ImageComponent | InstructionsComponent | ListComponent | LoadingIndicatorComponent | MarkdownComponent | ModalComponent | ModalContentComponent | ParagraphComponent | ReviewComponent | SearchComponent | SectionComponent | StatusListComponent;
|
|
44
|
+
export type LayoutComponent = AlertComponent | BoxComponent | ButtonComponent | ColumnsComponent | ContainerComponent | DecisionComponent | DividerComponent | ExternalConfirmationComponent | FormComponent | HeadingComponent | ImageComponent | InstructionsComponent | ListComponent | LoadingIndicatorComponent | MarkdownComponent | ModalComponent | ModalContentComponent | ParagraphComponent | ReviewComponent | SearchComponent | SectionComponent | StatusListComponent | TabsComponent;
|
|
44
45
|
export type LocalValue = LocalValuePrimitive | LocalValueObject | LocalValueArray;
|
|
45
46
|
export type LocalValuePrimitive = string | number | boolean | File | null;
|
|
46
47
|
export interface LocalValueObject extends Record<string, LocalValuePrimitive | LocalValueObject | LocalValueArray> {
|
|
@@ -10,11 +10,14 @@ type Command = {
|
|
|
10
10
|
etag: string | null;
|
|
11
11
|
} | {
|
|
12
12
|
type: 'error';
|
|
13
|
-
body
|
|
13
|
+
body?: {
|
|
14
14
|
analytics?: ErrorResponseBody['analytics'];
|
|
15
15
|
errors?: Step['errors'];
|
|
16
16
|
};
|
|
17
|
-
|
|
17
|
+
httpError?: {
|
|
18
|
+
message?: string;
|
|
19
|
+
statusCode?: number;
|
|
20
|
+
};
|
|
18
21
|
} | {
|
|
19
22
|
type: 'refresh';
|
|
20
23
|
body: {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ActionResponseBody, ErrorResponseBody, JsonElement, ModalBehavior, Step } from '@wise/dynamic-flow-types/build/next';
|
|
2
2
|
export declare const assertResponseIsValid: (response: unknown) => void;
|
|
3
3
|
export declare const parseResponseBodyAsJsonElement: (response: Response) => Promise<JsonElement>;
|
|
4
|
+
export declare const parseResponseBodyAsText: (response: Response) => Promise<string | null>;
|
|
4
5
|
export declare function isActionResponseBody(body: unknown): body is ActionResponseBody;
|
|
5
6
|
export declare function assertActionResponseBody(body: unknown): asserts body is ActionResponseBody;
|
|
6
7
|
export declare function assertModalResponseBody(body: unknown): asserts body is Omit<ModalBehavior, 'type'>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { TabsRendererProps } from '@wise/dynamic-flow-types/build/renderers';
|
|
2
|
+
import { TabsComponent } from '../../domain/components/TabsComponent';
|
|
3
|
+
import { RendererMapperProps } from './componentToRendererProps';
|
|
4
|
+
export declare const tabsComponentToProps: (component: TabsComponent, rendererMapperProps: RendererMapperProps) => TabsRendererProps;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wise/dynamic-flow-client",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.8.0",
|
|
4
4
|
"description": "Dynamic Flow web client",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./build/main.js",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@testing-library/jest-dom": "6.6.3",
|
|
47
47
|
"@testing-library/react": "16.3.0",
|
|
48
48
|
"@testing-library/user-event": "14.6.1",
|
|
49
|
-
"@transferwise/components": "46.
|
|
49
|
+
"@transferwise/components": "46.98.1",
|
|
50
50
|
"@transferwise/formatting": "^2.13.1",
|
|
51
51
|
"@transferwise/icons": "3.22.0",
|
|
52
52
|
"@transferwise/neptune-css": "14.24.4",
|
|
@@ -57,13 +57,13 @@
|
|
|
57
57
|
"@types/react-intl": "3.0.0",
|
|
58
58
|
"@wise/art": "2.21.2",
|
|
59
59
|
"@wise/components-theming": "^1.6.3",
|
|
60
|
-
"babel-jest": "
|
|
60
|
+
"babel-jest": "30.0.2",
|
|
61
61
|
"esbuild": "0.25.5",
|
|
62
62
|
"eslint-plugin-storybook": "9.0.10",
|
|
63
|
-
"jest": "
|
|
64
|
-
"jest-environment-jsdom": "
|
|
63
|
+
"jest": "30.0.2",
|
|
64
|
+
"jest-environment-jsdom": "30.0.2",
|
|
65
65
|
"jest-fetch-mock": "^3.0.3",
|
|
66
|
-
"jest-watch-typeahead": "^
|
|
66
|
+
"jest-watch-typeahead": "^3.0.1",
|
|
67
67
|
"npm-run-all2": "7.0.2",
|
|
68
68
|
"postcss": "^8.5.5",
|
|
69
69
|
"postcss-cli": "^11.0.1",
|
|
@@ -78,8 +78,8 @@
|
|
|
78
78
|
"stylelint-value-no-unknown-custom-properties": "6.0.1",
|
|
79
79
|
"tsx": "4.20.3",
|
|
80
80
|
"typescript": "5.8.3",
|
|
81
|
-
"@wise/dynamic-flow-
|
|
82
|
-
"@wise/dynamic-flow-
|
|
81
|
+
"@wise/dynamic-flow-fixtures": "0.0.1",
|
|
82
|
+
"@wise/dynamic-flow-renderers": "0.0.0"
|
|
83
83
|
},
|
|
84
84
|
"peerDependencies": {
|
|
85
85
|
"@transferwise/components": "^46.92.0",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"classnames": "2.5.1",
|
|
96
96
|
"react-webcam": "^7.2.0",
|
|
97
97
|
"screenfull": "^5.2.0",
|
|
98
|
-
"@wise/dynamic-flow-types": "3.
|
|
98
|
+
"@wise/dynamic-flow-types": "3.6.0"
|
|
99
99
|
},
|
|
100
100
|
"scripts": {
|
|
101
101
|
"dev": "pnpm build:visual-tests && storybook dev -p 3003",
|