@wise/dynamic-flow-client-internal 5.20.0 → 5.21.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 +38 -7
- package/build/main.js +106 -100
- package/build/main.mjs +84 -78
- package/build/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +1 -1
package/build/main.css
CHANGED
|
@@ -52,6 +52,37 @@
|
|
|
52
52
|
width: 66.66%;
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
+
/* container queries (when .df-prefer-container-queries is set on a parent) */
|
|
56
|
+
.df-prefer-container-queries .df-box-renderer.df-box-renderer-border {
|
|
57
|
+
padding: var(--size-16);
|
|
58
|
+
}
|
|
59
|
+
.df-prefer-container-queries .df-box-renderer.df-box-renderer-width-xs,
|
|
60
|
+
.df-prefer-container-queries .df-box-renderer.df-box-renderer-width-sm,
|
|
61
|
+
.df-prefer-container-queries .df-box-renderer.df-box-renderer-width-md,
|
|
62
|
+
.df-prefer-container-queries .df-box-renderer.df-box-renderer-width-lg {
|
|
63
|
+
width: 100%;
|
|
64
|
+
}
|
|
65
|
+
@container (min-width: 480px) {
|
|
66
|
+
.df-prefer-container-queries .df-box-renderer.df-box-renderer-border {
|
|
67
|
+
padding: var(--size-24);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.df-prefer-container-queries .df-box-renderer.df-box-renderer-width-xs {
|
|
71
|
+
width: 33.33%;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.df-prefer-container-queries .df-box-renderer.df-box-renderer-width-sm {
|
|
75
|
+
width: 50%;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.df-prefer-container-queries .df-box-renderer.df-box-renderer-width-md {
|
|
79
|
+
width: 66.66%;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.df-prefer-container-queries .df-box-renderer.df-box-renderer-width-lg {
|
|
83
|
+
width: 83.33%;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
55
86
|
.df-columns-renderer-container {
|
|
56
87
|
display: flex;
|
|
57
88
|
gap: var(--size-4);
|
|
@@ -137,13 +168,6 @@
|
|
|
137
168
|
width: 300px;
|
|
138
169
|
}
|
|
139
170
|
}
|
|
140
|
-
/**
|
|
141
|
-
* This speficies the container for container queries about width.
|
|
142
|
-
* We don't use it by default, but integrations can specify it using the className prop in the DF component.
|
|
143
|
-
*/
|
|
144
|
-
.df-prefer-container-queries {
|
|
145
|
-
container-type: inline-size;
|
|
146
|
-
}
|
|
147
171
|
/* narrow container */
|
|
148
172
|
@container (max-width: 576px) {
|
|
149
173
|
.df-image.xs img.df-reserve-space {
|
|
@@ -230,6 +254,13 @@
|
|
|
230
254
|
margin-left: auto;
|
|
231
255
|
margin-right: auto;
|
|
232
256
|
}
|
|
257
|
+
/**
|
|
258
|
+
* This specifies the container for container queries about width.
|
|
259
|
+
* We don't use it by default, but integrations can specify it using the className prop in the DF component.
|
|
260
|
+
*/
|
|
261
|
+
.df-prefer-container-queries {
|
|
262
|
+
container-type: inline-size;
|
|
263
|
+
}
|
|
233
264
|
.df-context-menu {
|
|
234
265
|
position: fixed;
|
|
235
266
|
z-index: 10;
|
package/build/main.js
CHANGED
|
@@ -145,7 +145,7 @@ var import_dynamic_flow_client4 = require("@wise/dynamic-flow-client");
|
|
|
145
145
|
// src/dynamicFlow/telemetry/app-version.ts
|
|
146
146
|
var appVersion = (
|
|
147
147
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
148
|
-
typeof process !== "undefined" ? "5.
|
|
148
|
+
typeof process !== "undefined" ? "5.21.0" : "0.0.0"
|
|
149
149
|
);
|
|
150
150
|
|
|
151
151
|
// src/dynamicFlow/context-menu/useContextMenu.tsx
|
|
@@ -329,7 +329,7 @@ var recursivelyRemoveNullish = (element) => {
|
|
|
329
329
|
};
|
|
330
330
|
|
|
331
331
|
// src/dynamicFlow/useWiseToCoreProps.tsx
|
|
332
|
-
var
|
|
332
|
+
var import_react25 = require("react");
|
|
333
333
|
|
|
334
334
|
// src/dynamicFlow/getMergedRenderers.tsx
|
|
335
335
|
var import_dynamic_flow_client2 = require("@wise/dynamic-flow-client");
|
|
@@ -403,7 +403,7 @@ var BoxRenderer = {
|
|
|
403
403
|
const contents = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
404
404
|
"div",
|
|
405
405
|
{
|
|
406
|
-
className: (0, import_classnames.default)({
|
|
406
|
+
className: (0, import_classnames.default)("df-box-renderer", {
|
|
407
407
|
"df-box-renderer-border": hasBorder,
|
|
408
408
|
[`df-box-renderer-width-${width}`]: hasFixedWidth,
|
|
409
409
|
[getMargin(margin)]: !hasFixedWidth
|
|
@@ -869,11 +869,24 @@ var getPriority = (control, tags) => {
|
|
|
869
869
|
return control && isButtonPriority(control) ? control : "secondary";
|
|
870
870
|
};
|
|
871
871
|
|
|
872
|
+
// ../renderers/src/CheckboxInputRenderer.tsx
|
|
873
|
+
var import_components11 = require("@transferwise/components");
|
|
874
|
+
|
|
872
875
|
// ../renderers/src/components/FieldInput.tsx
|
|
873
876
|
var import_components8 = require("@transferwise/components");
|
|
874
|
-
var import_react4 = require("react");
|
|
875
877
|
|
|
876
|
-
// ../renderers/src/utils/
|
|
878
|
+
// ../renderers/src/utils/useScrollToError.ts
|
|
879
|
+
var import_react4 = require("react");
|
|
880
|
+
var useScrollToError = (validationState, features) => {
|
|
881
|
+
const ref = (0, import_react4.useRef)(null);
|
|
882
|
+
const enabled = (features == null ? void 0 : features.scrollToError) !== false;
|
|
883
|
+
(0, import_react4.useEffect)(() => {
|
|
884
|
+
if ((validationState == null ? void 0 : validationState.status) === "invalid" && (validationState == null ? void 0 : validationState.message) && enabled) {
|
|
885
|
+
scrollToIfNotVisible(ref.current);
|
|
886
|
+
}
|
|
887
|
+
}, [validationState == null ? void 0 : validationState.status, validationState == null ? void 0 : validationState.message, enabled]);
|
|
888
|
+
return { ref };
|
|
889
|
+
};
|
|
877
890
|
var scrollToIfNotVisible = (ref) => {
|
|
878
891
|
const rect = ref == null ? void 0 : ref.getBoundingClientRect();
|
|
879
892
|
if (!ref || !rect) {
|
|
@@ -937,22 +950,16 @@ function FieldInput({
|
|
|
937
950
|
inlineAlert,
|
|
938
951
|
features
|
|
939
952
|
}) {
|
|
953
|
+
var _a;
|
|
940
954
|
const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(LabelContentWithHelp, { text: label, help }) : label;
|
|
941
|
-
const
|
|
942
|
-
const ref = (0, import_react4.useRef)(null);
|
|
943
|
-
const shouldScrollToError = features.scrollToError !== false;
|
|
944
|
-
(0, import_react4.useEffect)(() => {
|
|
945
|
-
if (message && shouldScrollToError) {
|
|
946
|
-
scrollToIfNotVisible(ref.current);
|
|
947
|
-
}
|
|
948
|
-
}, [message, shouldScrollToError]);
|
|
955
|
+
const { ref } = useScrollToError(validation, features);
|
|
949
956
|
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { ref, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
950
957
|
import_components8.Field,
|
|
951
958
|
{
|
|
952
959
|
id,
|
|
953
960
|
label: labelContent,
|
|
954
961
|
description,
|
|
955
|
-
message: message != null ?
|
|
962
|
+
message: (_a = validation == null ? void 0 : validation.message) != null ? _a : inlineAlert == null ? void 0 : inlineAlert.content,
|
|
956
963
|
messageLoading: loadingState !== "idle",
|
|
957
964
|
sentiment: mapStatusToSentiment(validation, inlineAlert == null ? void 0 : inlineAlert.context),
|
|
958
965
|
children
|
|
@@ -972,33 +979,30 @@ var mapStatusToSentiment = (validation, defaultContext) => {
|
|
|
972
979
|
};
|
|
973
980
|
var FieldInput_default = FieldInput;
|
|
974
981
|
|
|
975
|
-
// ../renderers/src/CheckboxInputRenderer.tsx
|
|
976
|
-
var import_components11 = require("@transferwise/components");
|
|
977
|
-
|
|
978
|
-
// ../renderers/src/utils/listItem/getMedia.tsx
|
|
979
|
-
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
980
|
-
var getMedia = (media, preferAvatar) => media ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(OptionMedia, { media, preferAvatar }) : void 0;
|
|
981
|
-
|
|
982
982
|
// ../renderers/src/utils/listItem/getAdditionalText.tsx
|
|
983
983
|
var import_components9 = require("@transferwise/components");
|
|
984
|
-
var
|
|
984
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
985
985
|
var getAdditionalText = (additionalText) => {
|
|
986
986
|
if (!additionalText) {
|
|
987
987
|
return void 0;
|
|
988
988
|
}
|
|
989
|
-
return /* @__PURE__ */ (0,
|
|
989
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_components9.ListItem.AdditionalInfo, { children: additionalText });
|
|
990
990
|
};
|
|
991
991
|
|
|
992
|
+
// ../renderers/src/utils/listItem/getInlineAlert.tsx
|
|
993
|
+
var import_components10 = require("@transferwise/components");
|
|
994
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
995
|
+
var getInlineAlert = (inlineAlert) => inlineAlert ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_components10.ListItem.Prompt, { sentiment: inlineAlert == null ? void 0 : inlineAlert.context, children: inlineAlert.content }) : void 0;
|
|
996
|
+
|
|
997
|
+
// ../renderers/src/utils/listItem/getMedia.tsx
|
|
998
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
999
|
+
var getMedia = (media, preferAvatar) => media ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(OptionMedia, { media, preferAvatar }) : void 0;
|
|
1000
|
+
|
|
992
1001
|
// ../renderers/src/utils/listItem/getSupportingValues.ts
|
|
993
1002
|
var getSupportingValues = (supportingValues) => {
|
|
994
1003
|
return __spreadValues(__spreadValues({}, (supportingValues == null ? void 0 : supportingValues.value) ? { valueTitle: supportingValues.value } : {}), (supportingValues == null ? void 0 : supportingValues.subvalue) ? { valueSubtitle: supportingValues.subvalue } : {});
|
|
995
1004
|
};
|
|
996
1005
|
|
|
997
|
-
// ../renderers/src/utils/listItem/getInlineAlert.tsx
|
|
998
|
-
var import_components10 = require("@transferwise/components");
|
|
999
|
-
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1000
|
-
var getInlineAlert = (inlineAlert) => inlineAlert ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_components10.ListItem.Prompt, { sentiment: inlineAlert == null ? void 0 : inlineAlert.context, children: inlineAlert.content }) : void 0;
|
|
1001
|
-
|
|
1002
1006
|
// ../renderers/src/CheckboxInputRenderer.tsx
|
|
1003
1007
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1004
1008
|
var CheckboxInputRenderer = {
|
|
@@ -1062,9 +1066,11 @@ var CheckboxItemComponent = (props) => {
|
|
|
1062
1066
|
title,
|
|
1063
1067
|
validationState,
|
|
1064
1068
|
value,
|
|
1069
|
+
features,
|
|
1065
1070
|
onChange
|
|
1066
1071
|
} = props;
|
|
1067
|
-
|
|
1072
|
+
const { ref } = useScrollToError(validationState, features);
|
|
1073
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { ref, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1068
1074
|
import_components11.ListItem,
|
|
1069
1075
|
__spreadValues({
|
|
1070
1076
|
title,
|
|
@@ -1075,7 +1081,7 @@ var CheckboxItemComponent = (props) => {
|
|
|
1075
1081
|
prompt: getInlineAlertOrValidation(validationState, inlineAlert),
|
|
1076
1082
|
control: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components11.ListItem.Checkbox, { checked: value, onChange: () => onChange(!value) })
|
|
1077
1083
|
}, getSupportingValues(supportingValues))
|
|
1078
|
-
);
|
|
1084
|
+
) });
|
|
1079
1085
|
};
|
|
1080
1086
|
var SwitchItemComponent = (props) => {
|
|
1081
1087
|
const {
|
|
@@ -1088,9 +1094,11 @@ var SwitchItemComponent = (props) => {
|
|
|
1088
1094
|
title,
|
|
1089
1095
|
validationState,
|
|
1090
1096
|
value,
|
|
1097
|
+
features,
|
|
1091
1098
|
onChange
|
|
1092
1099
|
} = props;
|
|
1093
|
-
|
|
1100
|
+
const { ref } = useScrollToError(validationState, features);
|
|
1101
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { ref, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1094
1102
|
import_components11.ListItem,
|
|
1095
1103
|
__spreadValues({
|
|
1096
1104
|
title,
|
|
@@ -1101,7 +1109,7 @@ var SwitchItemComponent = (props) => {
|
|
|
1101
1109
|
prompt: getInlineAlertOrValidation(validationState, inlineAlert),
|
|
1102
1110
|
control: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components11.ListItem.Switch, { checked: value, onClick: () => onChange(!value) })
|
|
1103
1111
|
}, getSupportingValues(supportingValues))
|
|
1104
|
-
);
|
|
1112
|
+
) });
|
|
1105
1113
|
};
|
|
1106
1114
|
var getInlineAlertOrValidation = (validationState, inlineAlert) => {
|
|
1107
1115
|
if ((validationState == null ? void 0 : validationState.status) === "invalid") {
|
|
@@ -2510,7 +2518,6 @@ var import_components36 = require("@transferwise/components");
|
|
|
2510
2518
|
// ../renderers/src/components/UploadFieldInput.tsx
|
|
2511
2519
|
var import_components35 = require("@transferwise/components");
|
|
2512
2520
|
var import_classnames4 = __toESM(require_classnames());
|
|
2513
|
-
var import_react13 = require("react");
|
|
2514
2521
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
2515
2522
|
function UploadFieldInput({
|
|
2516
2523
|
id,
|
|
@@ -2523,14 +2530,7 @@ function UploadFieldInput({
|
|
|
2523
2530
|
}) {
|
|
2524
2531
|
const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(LabelContentWithHelp, { text: label, help }) : label;
|
|
2525
2532
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
2526
|
-
const
|
|
2527
|
-
const ref = (0, import_react13.useRef)(null);
|
|
2528
|
-
const shouldScrollToError = features.scrollToError !== false;
|
|
2529
|
-
(0, import_react13.useEffect)(() => {
|
|
2530
|
-
if (message && shouldScrollToError) {
|
|
2531
|
-
scrollToIfNotVisible(ref.current);
|
|
2532
|
-
}
|
|
2533
|
-
}, [message, shouldScrollToError]);
|
|
2533
|
+
const { ref } = useScrollToError(validation, features);
|
|
2534
2534
|
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
2535
2535
|
"div",
|
|
2536
2536
|
{
|
|
@@ -2690,9 +2690,9 @@ var import_react_intl15 = require("react-intl");
|
|
|
2690
2690
|
|
|
2691
2691
|
// ../renderers/src/hooks/useSnackBarIfAvailable.ts
|
|
2692
2692
|
var import_components38 = require("@transferwise/components");
|
|
2693
|
-
var
|
|
2693
|
+
var import_react13 = require("react");
|
|
2694
2694
|
function useSnackBarIfAvailable() {
|
|
2695
|
-
const context = (0,
|
|
2695
|
+
const context = (0, import_react13.useContext)(import_components38.SnackbarContext);
|
|
2696
2696
|
return context ? context.createSnackbar : () => {
|
|
2697
2697
|
};
|
|
2698
2698
|
}
|
|
@@ -2786,7 +2786,7 @@ var ProgressRenderer = {
|
|
|
2786
2786
|
var import_components41 = require("@transferwise/components");
|
|
2787
2787
|
var import_icons = require("@transferwise/icons");
|
|
2788
2788
|
var import_classnames6 = __toESM(require_classnames());
|
|
2789
|
-
var
|
|
2789
|
+
var import_react14 = require("react");
|
|
2790
2790
|
var import_react_intl17 = require("react-intl");
|
|
2791
2791
|
|
|
2792
2792
|
// ../renderers/src/messages/repeatable.messages.ts
|
|
@@ -2826,6 +2826,7 @@ function Repeatable(props) {
|
|
|
2826
2826
|
description,
|
|
2827
2827
|
editableItem,
|
|
2828
2828
|
editItemTitle,
|
|
2829
|
+
features,
|
|
2829
2830
|
items,
|
|
2830
2831
|
title,
|
|
2831
2832
|
validationState,
|
|
@@ -2835,7 +2836,8 @@ function Repeatable(props) {
|
|
|
2835
2836
|
onRemove
|
|
2836
2837
|
} = props;
|
|
2837
2838
|
const { formatMessage } = (0, import_react_intl17.useIntl)();
|
|
2838
|
-
const [openModalType, setOpenModalType] = (0,
|
|
2839
|
+
const [openModalType, setOpenModalType] = (0, import_react14.useState)(null);
|
|
2840
|
+
const { ref } = useScrollToError(validationState, features);
|
|
2839
2841
|
const onAddItem = () => {
|
|
2840
2842
|
onAdd();
|
|
2841
2843
|
setOpenModalType("add");
|
|
@@ -2858,29 +2860,31 @@ function Repeatable(props) {
|
|
|
2858
2860
|
setOpenModalType(null);
|
|
2859
2861
|
};
|
|
2860
2862
|
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_jsx_runtime62.Fragment, { children: [
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2863
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { ref, children: [
|
|
2864
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_components41.Header, { title }),
|
|
2865
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("p", { children: description }),
|
|
2866
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
2867
|
+
"div",
|
|
2868
|
+
{
|
|
2869
|
+
className: (0, import_classnames6.default)("form-group", {
|
|
2870
|
+
"has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
|
|
2871
|
+
}),
|
|
2872
|
+
children: [
|
|
2873
|
+
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
|
|
2874
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
2875
|
+
import_components41.NavigationOption,
|
|
2876
|
+
{
|
|
2877
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_icons.Plus, {}),
|
|
2878
|
+
title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
|
|
2879
|
+
showMediaAtAllSizes: true,
|
|
2880
|
+
onClick: () => onAddItem()
|
|
2881
|
+
}
|
|
2882
|
+
),
|
|
2883
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_components41.InlineAlert, { type: "negative", children: validationState.message })
|
|
2884
|
+
]
|
|
2885
|
+
}
|
|
2886
|
+
)
|
|
2887
|
+
] }),
|
|
2884
2888
|
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
2885
2889
|
import_components41.Modal,
|
|
2886
2890
|
{
|
|
@@ -3054,7 +3058,7 @@ var ReviewRenderer_default = ReviewRenderer2;
|
|
|
3054
3058
|
|
|
3055
3059
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
3056
3060
|
var import_components45 = require("@transferwise/components");
|
|
3057
|
-
var
|
|
3061
|
+
var import_react15 = require("react");
|
|
3058
3062
|
var import_react_intl22 = require("react-intl");
|
|
3059
3063
|
|
|
3060
3064
|
// ../renderers/src/messages/search.messages.ts
|
|
@@ -3117,7 +3121,7 @@ function BlockSearchRendererComponent({
|
|
|
3117
3121
|
trackEvent,
|
|
3118
3122
|
onChange
|
|
3119
3123
|
}) {
|
|
3120
|
-
const [hasSearched, setHasSearched] = (0,
|
|
3124
|
+
const [hasSearched, setHasSearched] = (0, import_react15.useState)(false);
|
|
3121
3125
|
const { formatMessage } = (0, import_react_intl22.useIntl)();
|
|
3122
3126
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: getMargin(margin), children: [
|
|
3123
3127
|
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
@@ -3209,7 +3213,7 @@ var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
|
|
|
3209
3213
|
// ../renderers/src/SearchRenderer/InlineSearchRendererComponent.tsx
|
|
3210
3214
|
var import_components46 = require("@transferwise/components");
|
|
3211
3215
|
var import_icons4 = require("@transferwise/icons");
|
|
3212
|
-
var
|
|
3216
|
+
var import_react16 = require("react");
|
|
3213
3217
|
var import_react_intl23 = require("react-intl");
|
|
3214
3218
|
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
3215
3219
|
function InlineSearchRenderer({
|
|
@@ -3223,7 +3227,7 @@ function InlineSearchRenderer({
|
|
|
3223
3227
|
onChange,
|
|
3224
3228
|
trackEvent
|
|
3225
3229
|
}) {
|
|
3226
|
-
const [hasSearched, setHasSearched] = (0,
|
|
3230
|
+
const [hasSearched, setHasSearched] = (0, import_react16.useState)(false);
|
|
3227
3231
|
const intl = (0, import_react_intl23.useIntl)();
|
|
3228
3232
|
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
3229
3233
|
FieldInput_default,
|
|
@@ -3396,7 +3400,7 @@ function RadioInputRendererComponent(props) {
|
|
|
3396
3400
|
|
|
3397
3401
|
// ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
3398
3402
|
var import_components49 = require("@transferwise/components");
|
|
3399
|
-
var
|
|
3403
|
+
var import_react17 = require("react");
|
|
3400
3404
|
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
3401
3405
|
function TabInputRendererComponent(props) {
|
|
3402
3406
|
const {
|
|
@@ -3412,7 +3416,7 @@ function TabInputRendererComponent(props) {
|
|
|
3412
3416
|
validationState,
|
|
3413
3417
|
onSelect
|
|
3414
3418
|
} = props;
|
|
3415
|
-
(0,
|
|
3419
|
+
(0, import_react17.useEffect)(() => {
|
|
3416
3420
|
if (!isValidIndex2(selectedIndex, options.length)) {
|
|
3417
3421
|
onSelect(0);
|
|
3418
3422
|
}
|
|
@@ -3528,7 +3532,7 @@ function SelectInputRendererComponent(props) {
|
|
|
3528
3532
|
}
|
|
3529
3533
|
|
|
3530
3534
|
// ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
3531
|
-
var
|
|
3535
|
+
var import_react18 = require("react");
|
|
3532
3536
|
var import_components51 = require("@transferwise/components");
|
|
3533
3537
|
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
3534
3538
|
function SegmentedInputRendererComponent(props) {
|
|
@@ -3544,7 +3548,7 @@ function SegmentedInputRendererComponent(props) {
|
|
|
3544
3548
|
validationState,
|
|
3545
3549
|
onSelect
|
|
3546
3550
|
} = props;
|
|
3547
|
-
(0,
|
|
3551
|
+
(0, import_react18.useEffect)(() => {
|
|
3548
3552
|
if (!isValidIndex3(selectedIndex, options.length)) {
|
|
3549
3553
|
onSelect(0);
|
|
3550
3554
|
}
|
|
@@ -3590,6 +3594,7 @@ function RadioItemRendererComponent(props) {
|
|
|
3590
3594
|
children,
|
|
3591
3595
|
description: rootDescription,
|
|
3592
3596
|
disabled: rootDisabled,
|
|
3597
|
+
features,
|
|
3593
3598
|
help,
|
|
3594
3599
|
title: rootTitle,
|
|
3595
3600
|
options,
|
|
@@ -3597,7 +3602,8 @@ function RadioItemRendererComponent(props) {
|
|
|
3597
3602
|
validationState,
|
|
3598
3603
|
onSelect
|
|
3599
3604
|
} = props;
|
|
3600
|
-
|
|
3605
|
+
const { ref } = useScrollToError(validationState, features);
|
|
3606
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { ref, children: [
|
|
3601
3607
|
rootTitle && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
3602
3608
|
import_components52.Header,
|
|
3603
3609
|
{
|
|
@@ -3710,12 +3716,12 @@ var StatusListRenderer_default = StatusListRenderer;
|
|
|
3710
3716
|
|
|
3711
3717
|
// ../renderers/src/utils/useCustomTheme.ts
|
|
3712
3718
|
var import_components_theming = require("@wise/components-theming");
|
|
3713
|
-
var
|
|
3719
|
+
var import_react19 = require("react");
|
|
3714
3720
|
var ThemeRequiredEventName = "Theme Required";
|
|
3715
3721
|
var useCustomTheme = (theme, trackEvent) => {
|
|
3716
3722
|
const theming = (0, import_components_theming.useTheme)();
|
|
3717
|
-
const previousTheme = (0,
|
|
3718
|
-
(0,
|
|
3723
|
+
const previousTheme = (0, import_react19.useMemo)(() => theming.theme, []);
|
|
3724
|
+
(0, import_react19.useEffect)(() => {
|
|
3719
3725
|
theming.setTheme(theme);
|
|
3720
3726
|
trackEvent(ThemeRequiredEventName, { theme });
|
|
3721
3727
|
return theme !== previousTheme ? () => {
|
|
@@ -3728,7 +3734,7 @@ var useCustomTheme = (theme, trackEvent) => {
|
|
|
3728
3734
|
|
|
3729
3735
|
// ../renderers/src/step/StepFooter.tsx
|
|
3730
3736
|
var import_components54 = require("@transferwise/components");
|
|
3731
|
-
var
|
|
3737
|
+
var import_react20 = require("react");
|
|
3732
3738
|
var import_react_intl25 = require("react-intl");
|
|
3733
3739
|
|
|
3734
3740
|
// ../renderers/src/messages/step.messages.ts
|
|
@@ -3756,7 +3762,7 @@ var DefaultFooter = ({ footer }) => {
|
|
|
3756
3762
|
};
|
|
3757
3763
|
var FooterWithScrollButton = ({ footer }) => {
|
|
3758
3764
|
const { formatMessage } = (0, import_react_intl25.useIntl)();
|
|
3759
|
-
const endOfLayoutRef = (0,
|
|
3765
|
+
const endOfLayoutRef = (0, import_react20.useRef)(null);
|
|
3760
3766
|
const isElementVisible = useIsElementVisible(endOfLayoutRef);
|
|
3761
3767
|
const scrollButton = /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
3762
3768
|
import_components54.Button,
|
|
@@ -3785,8 +3791,8 @@ var FooterWithScrollButton = ({ footer }) => {
|
|
|
3785
3791
|
] });
|
|
3786
3792
|
};
|
|
3787
3793
|
var useIsElementVisible = (elementRef) => {
|
|
3788
|
-
const [isVisible, setIsVisible] = (0,
|
|
3789
|
-
(0,
|
|
3794
|
+
const [isVisible, setIsVisible] = (0, import_react20.useState)(false);
|
|
3795
|
+
(0, import_react20.useEffect)(() => {
|
|
3790
3796
|
const element = elementRef.current;
|
|
3791
3797
|
if (!element) return;
|
|
3792
3798
|
const observer = new IntersectionObserver(([entry]) => {
|
|
@@ -3970,7 +3976,7 @@ function StepRendererComponent(props) {
|
|
|
3970
3976
|
|
|
3971
3977
|
// ../renderers/src/TabsRenderer.tsx
|
|
3972
3978
|
var import_components59 = require("@transferwise/components");
|
|
3973
|
-
var
|
|
3979
|
+
var import_react21 = require("react");
|
|
3974
3980
|
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
3975
3981
|
var TabsRenderer = {
|
|
3976
3982
|
canRenderType: "tabs",
|
|
@@ -3989,7 +3995,7 @@ var TabsRenderer = {
|
|
|
3989
3995
|
}
|
|
3990
3996
|
};
|
|
3991
3997
|
function TabsRendererComponent({ uid, margin, tabs }) {
|
|
3992
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
3998
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react21.useState)(0);
|
|
3993
3999
|
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
3994
4000
|
import_components59.Tabs,
|
|
3995
4001
|
{
|
|
@@ -4010,7 +4016,7 @@ function TabsRendererComponent({ uid, margin, tabs }) {
|
|
|
4010
4016
|
}
|
|
4011
4017
|
function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
|
|
4012
4018
|
var _a;
|
|
4013
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
4019
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react21.useState)(0);
|
|
4014
4020
|
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: getMargin(margin), children: [
|
|
4015
4021
|
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
4016
4022
|
import_components59.SegmentedControl,
|
|
@@ -4032,7 +4038,7 @@ function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
|
|
|
4032
4038
|
}
|
|
4033
4039
|
function ChipsTabsRendererComponent({ margin, tabs }) {
|
|
4034
4040
|
var _a;
|
|
4035
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
4041
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react21.useState)(0);
|
|
4036
4042
|
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: getMargin(margin), children: [
|
|
4037
4043
|
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "chips-container", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
4038
4044
|
import_components59.Chips,
|
|
@@ -4287,7 +4293,7 @@ var LargeUploadRenderer = {
|
|
|
4287
4293
|
|
|
4288
4294
|
// ../renderers/src/UpsellRenderer.tsx
|
|
4289
4295
|
var import_components63 = require("@transferwise/components");
|
|
4290
|
-
var
|
|
4296
|
+
var import_react22 = require("react");
|
|
4291
4297
|
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
4292
4298
|
var UpsellRenderer = {
|
|
4293
4299
|
canRenderType: "upsell",
|
|
@@ -4295,7 +4301,7 @@ var UpsellRenderer = {
|
|
|
4295
4301
|
};
|
|
4296
4302
|
function UpsellRendererComponent(props) {
|
|
4297
4303
|
const { text, callToAction, media, margin, onDismiss } = props;
|
|
4298
|
-
const [isVisible, setIsVisible] = (0,
|
|
4304
|
+
const [isVisible, setIsVisible] = (0, import_react22.useState)(true);
|
|
4299
4305
|
return isVisible ? /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
4300
4306
|
import_components63.Nudge,
|
|
4301
4307
|
{
|
|
@@ -4543,7 +4549,7 @@ var customEventsToAnalytics = {
|
|
|
4543
4549
|
};
|
|
4544
4550
|
|
|
4545
4551
|
// src/dynamicFlow/useOnCopy.tsx
|
|
4546
|
-
var
|
|
4552
|
+
var import_react23 = require("react");
|
|
4547
4553
|
var import_react_intl29 = require("react-intl");
|
|
4548
4554
|
|
|
4549
4555
|
// src/dynamicFlow/messages.ts
|
|
@@ -4565,7 +4571,7 @@ var messages_default = (0, import_react_intl28.defineMessages)({
|
|
|
4565
4571
|
var useOnCopy = () => {
|
|
4566
4572
|
const { formatMessage } = (0, import_react_intl29.useIntl)();
|
|
4567
4573
|
const createSnackBar = useSnackBarIfAvailable();
|
|
4568
|
-
return (0,
|
|
4574
|
+
return (0, import_react23.useCallback)(
|
|
4569
4575
|
(copiedContent) => {
|
|
4570
4576
|
if (copiedContent) {
|
|
4571
4577
|
createSnackBar({ text: formatMessage(messages_default.copied) });
|
|
@@ -4578,11 +4584,11 @@ var useOnCopy = () => {
|
|
|
4578
4584
|
};
|
|
4579
4585
|
|
|
4580
4586
|
// src/dynamicFlow/useWiseHttpClient.tsx
|
|
4581
|
-
var
|
|
4587
|
+
var import_react24 = require("react");
|
|
4582
4588
|
var import_react_intl30 = require("react-intl");
|
|
4583
4589
|
var useWiseHttpClient = (httpClient) => {
|
|
4584
4590
|
const { locale } = (0, import_react_intl30.useIntl)();
|
|
4585
|
-
return (0,
|
|
4591
|
+
return (0, import_react24.useCallback)(
|
|
4586
4592
|
async (input, init = {}) => {
|
|
4587
4593
|
const headers = new Headers(init.headers);
|
|
4588
4594
|
headers.set("accept-language", locale);
|
|
@@ -4623,10 +4629,10 @@ var useWiseToCoreProps = (props) => {
|
|
|
4623
4629
|
onLog
|
|
4624
4630
|
} = props;
|
|
4625
4631
|
const httpClient = useWiseHttpClient(customFetch);
|
|
4626
|
-
const mergedRenderers = (0,
|
|
4632
|
+
const mergedRenderers = (0, import_react25.useMemo)(() => getMergedRenderers(props), [renderers]);
|
|
4627
4633
|
const createSnackBar = useCreateSnackBar();
|
|
4628
|
-
const logEvent = (0,
|
|
4629
|
-
const trackEvent = (0,
|
|
4634
|
+
const logEvent = (0, import_react25.useMemo)(() => getLogEvent(onLog), [onLog]);
|
|
4635
|
+
const trackEvent = (0, import_react25.useMemo)(() => getTrackEvent(onEvent, onAnalytics), [onEvent, onAnalytics]);
|
|
4630
4636
|
const onCopy = useOnCopy();
|
|
4631
4637
|
return __spreadProps(__spreadValues({}, props), {
|
|
4632
4638
|
httpClient,
|
|
@@ -4671,14 +4677,14 @@ function DynamicFlow(props) {
|
|
|
4671
4677
|
}
|
|
4672
4678
|
|
|
4673
4679
|
// src/dynamicFlow/DynamicFlowWithRef.tsx
|
|
4674
|
-
var
|
|
4680
|
+
var import_react26 = require("react");
|
|
4675
4681
|
var import_dynamic_flow_client5 = require("@wise/dynamic-flow-client");
|
|
4676
4682
|
var import_jsx_runtime95 = require("react/jsx-runtime");
|
|
4677
|
-
var DynamicFlowWithRef = (0,
|
|
4683
|
+
var DynamicFlowWithRef = (0, import_react26.forwardRef)(function DynamicFlowWithRef2(props, ref) {
|
|
4678
4684
|
const { className = "" } = props;
|
|
4679
4685
|
const dfProps = useWiseToCoreProps(props);
|
|
4680
4686
|
const df = (0, import_dynamic_flow_client5.useDynamicFlow)(dfProps);
|
|
4681
|
-
(0,
|
|
4687
|
+
(0, import_react26.useImperativeHandle)(
|
|
4682
4688
|
ref,
|
|
4683
4689
|
() => ({
|
|
4684
4690
|
getValue: async () => {
|