@wise/dynamic-flow-client-internal 5.30.0 → 5.31.0-experimental-a2135d6
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/en.json +2 -0
- package/build/main.js +295 -66
- package/build/main.mjs +285 -55
- package/build/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +4 -4
package/build/i18n/en.json
CHANGED
|
@@ -44,5 +44,7 @@
|
|
|
44
44
|
"df.wise.group.currencies-with-account-details": "Currencies with account details",
|
|
45
45
|
"df.wise.group.popular": "Popular",
|
|
46
46
|
"df.wise.group.recent": "Recent",
|
|
47
|
+
"df.wise.ssnInput.hideValue": "Hide value",
|
|
48
|
+
"df.wise.ssnInput.showValue": "Show value",
|
|
47
49
|
"df.wise.step.scrollToBottom": "Scroll to bottom"
|
|
48
50
|
}
|
package/build/main.js
CHANGED
|
@@ -336,7 +336,7 @@ var recursivelyRemoveNullish = (element) => {
|
|
|
336
336
|
};
|
|
337
337
|
|
|
338
338
|
// src/dynamicFlow/useWiseToCoreProps.tsx
|
|
339
|
-
var
|
|
339
|
+
var import_react32 = require("react");
|
|
340
340
|
|
|
341
341
|
// src/dynamicFlow/getMergedRenderers.tsx
|
|
342
342
|
var import_dynamic_flow_client2 = require("@wise/dynamic-flow-client");
|
|
@@ -6779,9 +6779,101 @@ function ChipsTabsRendererComponent({ margin, tabs, control, tags }) {
|
|
|
6779
6779
|
|
|
6780
6780
|
// ../renderers/src/TextInputRenderer.tsx
|
|
6781
6781
|
var import_components69 = require("@transferwise/components");
|
|
6782
|
+
var import_react28 = require("react");
|
|
6782
6783
|
|
|
6783
6784
|
// ../renderers/src/components/VariableTextInput.tsx
|
|
6784
6785
|
var import_components68 = require("@transferwise/components");
|
|
6786
|
+
var import_icons7 = require("@transferwise/icons");
|
|
6787
|
+
var import_react_intl36 = require("react-intl");
|
|
6788
|
+
var import_react27 = require("react");
|
|
6789
|
+
|
|
6790
|
+
// ../renderers/src/messages/ssn-input.messages.ts
|
|
6791
|
+
var import_react_intl35 = require("react-intl");
|
|
6792
|
+
var ssn_input_messages_default = (0, import_react_intl35.defineMessages)({
|
|
6793
|
+
showValue: {
|
|
6794
|
+
id: "df.wise.ssnInput.showValue",
|
|
6795
|
+
defaultMessage: "Show value",
|
|
6796
|
+
description: "Accessible label for showing a masked SSN or SIN value"
|
|
6797
|
+
},
|
|
6798
|
+
hideValue: {
|
|
6799
|
+
id: "df.wise.ssnInput.hideValue",
|
|
6800
|
+
defaultMessage: "Hide value",
|
|
6801
|
+
description: "Accessible label for hiding an SSN or SIN value"
|
|
6802
|
+
}
|
|
6803
|
+
});
|
|
6804
|
+
|
|
6805
|
+
// ../renderers/src/components/ssnInputUtils.ts
|
|
6806
|
+
function formatSsnValue(rawValue, displayFormat, isVisible) {
|
|
6807
|
+
if (!displayFormat) {
|
|
6808
|
+
return isVisible ? rawValue : "\u2022".repeat(rawValue.length);
|
|
6809
|
+
}
|
|
6810
|
+
const formattedValue = displayFormat.split("").reduce(
|
|
6811
|
+
({ display, digitsUsed }, character) => {
|
|
6812
|
+
if (character === "*") {
|
|
6813
|
+
return digitsUsed < rawValue.length ? {
|
|
6814
|
+
display: `${display}${isVisible ? rawValue[digitsUsed] : "\u2022"}`,
|
|
6815
|
+
digitsUsed: digitsUsed + 1
|
|
6816
|
+
} : { display, digitsUsed };
|
|
6817
|
+
}
|
|
6818
|
+
return digitsUsed > 0 && digitsUsed < rawValue.length ? { display: `${display}${character}`, digitsUsed } : { display, digitsUsed };
|
|
6819
|
+
},
|
|
6820
|
+
{ display: "", digitsUsed: 0 }
|
|
6821
|
+
).display;
|
|
6822
|
+
const displayFormatDigitCount = displayFormat.split("").filter((character) => character === "*").length;
|
|
6823
|
+
const extraValue = rawValue.slice(displayFormatDigitCount);
|
|
6824
|
+
return `${formattedValue}${isVisible ? extraValue : "\u2022".repeat(extraValue.length)}`;
|
|
6825
|
+
}
|
|
6826
|
+
function getRawOffset(displayValue, displayOffset, rawValueLength) {
|
|
6827
|
+
return Math.min(
|
|
6828
|
+
displayValue.slice(0, displayOffset).split("").filter((character) => character === "\u2022" || /\d/.test(character)).length,
|
|
6829
|
+
rawValueLength
|
|
6830
|
+
);
|
|
6831
|
+
}
|
|
6832
|
+
function replaceSsnSelection(rawValue, displayValue, insertedValue, start, end) {
|
|
6833
|
+
const startOffset = getRawOffset(displayValue, start, rawValue.length);
|
|
6834
|
+
const endOffset = getRawOffset(displayValue, end, rawValue.length);
|
|
6835
|
+
if (!insertedValue) {
|
|
6836
|
+
return void 0;
|
|
6837
|
+
}
|
|
6838
|
+
return {
|
|
6839
|
+
value: `${rawValue.slice(0, startOffset)}${insertedValue}${rawValue.slice(endOffset)}`,
|
|
6840
|
+
caret: startOffset + insertedValue.length
|
|
6841
|
+
};
|
|
6842
|
+
}
|
|
6843
|
+
function deleteSsnSelection(rawValue, displayValue, start, end, backward) {
|
|
6844
|
+
let startOffset = getRawOffset(displayValue, start, rawValue.length);
|
|
6845
|
+
let endOffset = getRawOffset(displayValue, end, rawValue.length);
|
|
6846
|
+
if (startOffset === endOffset) {
|
|
6847
|
+
if (backward) {
|
|
6848
|
+
startOffset = Math.max(0, startOffset - 1);
|
|
6849
|
+
} else {
|
|
6850
|
+
endOffset = Math.min(rawValue.length, endOffset + 1);
|
|
6851
|
+
}
|
|
6852
|
+
}
|
|
6853
|
+
return {
|
|
6854
|
+
value: `${rawValue.slice(0, startOffset)}${rawValue.slice(endOffset)}`,
|
|
6855
|
+
caret: startOffset
|
|
6856
|
+
};
|
|
6857
|
+
}
|
|
6858
|
+
function getDisplayOffset(displayValue, rawOffset) {
|
|
6859
|
+
if (rawOffset === 0) {
|
|
6860
|
+
return 0;
|
|
6861
|
+
}
|
|
6862
|
+
let displayOffset = 0;
|
|
6863
|
+
let digitsSeen = 0;
|
|
6864
|
+
for (const character of displayValue) {
|
|
6865
|
+
if (character === "\u2022" || /\d/.test(character)) {
|
|
6866
|
+
digitsSeen += 1;
|
|
6867
|
+
if (digitsSeen === rawOffset) {
|
|
6868
|
+
return displayOffset + 1;
|
|
6869
|
+
}
|
|
6870
|
+
}
|
|
6871
|
+
displayOffset += 1;
|
|
6872
|
+
}
|
|
6873
|
+
return displayOffset;
|
|
6874
|
+
}
|
|
6875
|
+
|
|
6876
|
+
// ../renderers/src/components/VariableTextInput.tsx
|
|
6785
6877
|
var import_jsx_runtime100 = require("react/jsx-runtime");
|
|
6786
6878
|
var commonKeys = [
|
|
6787
6879
|
"autoComplete",
|
|
@@ -6797,13 +6889,15 @@ var commonKeys = [
|
|
|
6797
6889
|
"value"
|
|
6798
6890
|
];
|
|
6799
6891
|
function VariableTextInput(inputProps) {
|
|
6800
|
-
const { id, value, control, onChange } = inputProps;
|
|
6892
|
+
const { id, value, control, onChange, isSsnVisible } = inputProps;
|
|
6801
6893
|
const commonProps = __spreadProps(__spreadValues({}, pick(inputProps, ...commonKeys)), { name: id });
|
|
6802
6894
|
switch (control) {
|
|
6803
6895
|
case "email":
|
|
6804
6896
|
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "email", onChange }));
|
|
6805
6897
|
case "password":
|
|
6806
6898
|
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "password", onChange }));
|
|
6899
|
+
case "ssn-input":
|
|
6900
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(SsnInput, __spreadProps(__spreadValues({}, commonProps), { isVisible: isSsnVisible, onChange }));
|
|
6807
6901
|
case "numeric": {
|
|
6808
6902
|
const numericProps = __spreadProps(__spreadValues({}, commonProps), { type: "number", onWheel });
|
|
6809
6903
|
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
@@ -6823,65 +6917,198 @@ function VariableTextInput(inputProps) {
|
|
|
6823
6917
|
}
|
|
6824
6918
|
}
|
|
6825
6919
|
}
|
|
6920
|
+
function SsnInputToggle({
|
|
6921
|
+
isVisible,
|
|
6922
|
+
onClick
|
|
6923
|
+
}) {
|
|
6924
|
+
const { formatMessage } = (0, import_react_intl36.useIntl)();
|
|
6925
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
6926
|
+
import_components68.IconButton,
|
|
6927
|
+
{
|
|
6928
|
+
priority: "minimal",
|
|
6929
|
+
size: 24,
|
|
6930
|
+
"aria-label": formatMessage(isVisible ? ssn_input_messages_default.hideValue : ssn_input_messages_default.showValue),
|
|
6931
|
+
"aria-pressed": isVisible,
|
|
6932
|
+
onClick,
|
|
6933
|
+
children: isVisible ? /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_icons7.EyeShut, { size: 24 }) : /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_icons7.Eye, { size: 24 })
|
|
6934
|
+
}
|
|
6935
|
+
);
|
|
6936
|
+
}
|
|
6826
6937
|
function TextInput(props) {
|
|
6827
|
-
const _a = props, { control, displayFormat, onChange } = _a, commonProps = __objRest(_a, ["control", "displayFormat", "onChange"]);
|
|
6938
|
+
const _a = props, { control, displayFormat, onChange, type } = _a, commonProps = __objRest(_a, ["control", "displayFormat", "onChange", "type"]);
|
|
6828
6939
|
const InputWithPattern = control === "textarea" ? import_components68.TextareaWithDisplayFormat : import_components68.InputWithDisplayFormat;
|
|
6829
6940
|
const InputWithoutPattern = control === "textarea" ? import_components68.TextArea : import_components68.Input;
|
|
6830
|
-
return displayFormat ? /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(InputWithPattern, __spreadProps(__spreadValues({ displayPattern: displayFormat }, commonProps), { onChange })) : /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(InputWithoutPattern, __spreadProps(__spreadValues({}, commonProps), { onChange: (e) => onChange(e.target.value) }));
|
|
6941
|
+
return displayFormat ? /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(InputWithPattern, __spreadProps(__spreadValues({ displayPattern: displayFormat }, commonProps), { onChange })) : /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(InputWithoutPattern, __spreadProps(__spreadValues({}, commonProps), { type, onChange: (e) => onChange(e.target.value) }));
|
|
6942
|
+
}
|
|
6943
|
+
function SsnInput(props) {
|
|
6944
|
+
const _a = props, { displayFormat = "", isVisible = false, onChange, value = "" } = _a, commonProps = __objRest(_a, ["displayFormat", "isVisible", "onChange", "value"]);
|
|
6945
|
+
const [editVersion, setEditVersion] = (0, import_react27.useState)(0);
|
|
6946
|
+
const inputRef = (0, import_react27.useRef)(null);
|
|
6947
|
+
const selection = (0, import_react27.useRef)({ start: 0, end: 0 });
|
|
6948
|
+
const pendingCaret = (0, import_react27.useRef)(null);
|
|
6949
|
+
const rawValue = value.replace(/\D/g, "");
|
|
6950
|
+
const formattedValue = formatSsnValue(rawValue, displayFormat, isVisible);
|
|
6951
|
+
const scheduleCaret = (rawOffset) => {
|
|
6952
|
+
pendingCaret.current = rawOffset;
|
|
6953
|
+
setEditVersion((version) => version + 1);
|
|
6954
|
+
};
|
|
6955
|
+
const replaceSelection = (insertedValue, start, end) => {
|
|
6956
|
+
const result = replaceSsnSelection(rawValue, formattedValue, insertedValue, start, end);
|
|
6957
|
+
if (!result) {
|
|
6958
|
+
return;
|
|
6959
|
+
}
|
|
6960
|
+
scheduleCaret(result.caret);
|
|
6961
|
+
onChange(result.value);
|
|
6962
|
+
};
|
|
6963
|
+
const deleteSelection = (start, end, backward) => {
|
|
6964
|
+
const result = deleteSsnSelection(rawValue, formattedValue, start, end, backward);
|
|
6965
|
+
scheduleCaret(result.caret);
|
|
6966
|
+
onChange(result.value);
|
|
6967
|
+
};
|
|
6968
|
+
(0, import_react27.useLayoutEffect)(() => {
|
|
6969
|
+
if (pendingCaret.current === null || !inputRef.current) {
|
|
6970
|
+
return;
|
|
6971
|
+
}
|
|
6972
|
+
inputRef.current.setSelectionRange(
|
|
6973
|
+
getDisplayOffset(formattedValue, pendingCaret.current),
|
|
6974
|
+
getDisplayOffset(formattedValue, pendingCaret.current)
|
|
6975
|
+
);
|
|
6976
|
+
pendingCaret.current = null;
|
|
6977
|
+
}, [editVersion, formattedValue, rawValue]);
|
|
6978
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
6979
|
+
"input",
|
|
6980
|
+
__spreadProps(__spreadValues({
|
|
6981
|
+
ref: inputRef
|
|
6982
|
+
}, commonProps), {
|
|
6983
|
+
className: "form-control np-form-control np-input np-input--shape-rectangle",
|
|
6984
|
+
type: "text",
|
|
6985
|
+
inputMode: "numeric",
|
|
6986
|
+
value: formattedValue,
|
|
6987
|
+
onChange: (event) => {
|
|
6988
|
+
const nextValue = event.currentTarget.value;
|
|
6989
|
+
const inputType = event.nativeEvent.inputType;
|
|
6990
|
+
const start = selection.current.start;
|
|
6991
|
+
const end = selection.current.end;
|
|
6992
|
+
if (isVisible || /^\d+$/.test(nextValue)) {
|
|
6993
|
+
const nextRawValue = nextValue.replace(/\D/g, "");
|
|
6994
|
+
scheduleCaret(nextRawValue.length);
|
|
6995
|
+
onChange(nextRawValue);
|
|
6996
|
+
} else if ((inputType == null ? void 0 : inputType.startsWith("delete")) || nextValue.length < formattedValue.length) {
|
|
6997
|
+
deleteSelection(start, end, inputType === "deleteContentBackward");
|
|
6998
|
+
} else {
|
|
6999
|
+
replaceSelection(nextValue.replace(/\D/g, ""), start, end);
|
|
7000
|
+
}
|
|
7001
|
+
},
|
|
7002
|
+
onSelect: (event) => {
|
|
7003
|
+
var _a2, _b;
|
|
7004
|
+
selection.current = {
|
|
7005
|
+
start: (_a2 = event.currentTarget.selectionStart) != null ? _a2 : 0,
|
|
7006
|
+
end: (_b = event.currentTarget.selectionEnd) != null ? _b : 0
|
|
7007
|
+
};
|
|
7008
|
+
},
|
|
7009
|
+
onKeyDown: (event) => {
|
|
7010
|
+
var _a2, _b;
|
|
7011
|
+
selection.current = {
|
|
7012
|
+
start: (_a2 = event.currentTarget.selectionStart) != null ? _a2 : 0,
|
|
7013
|
+
end: (_b = event.currentTarget.selectionEnd) != null ? _b : 0
|
|
7014
|
+
};
|
|
7015
|
+
if (/^\d$/.test(event.key)) {
|
|
7016
|
+
event.preventDefault();
|
|
7017
|
+
replaceSelection(event.key, selection.current.start, selection.current.end);
|
|
7018
|
+
} else if (event.key === "Backspace") {
|
|
7019
|
+
event.preventDefault();
|
|
7020
|
+
deleteSelection(selection.current.start, selection.current.end, true);
|
|
7021
|
+
} else if (event.key === "Delete") {
|
|
7022
|
+
event.preventDefault();
|
|
7023
|
+
deleteSelection(selection.current.start, selection.current.end, false);
|
|
7024
|
+
}
|
|
7025
|
+
},
|
|
7026
|
+
onPaste: (event) => {
|
|
7027
|
+
var _a2, _b;
|
|
7028
|
+
event.preventDefault();
|
|
7029
|
+
selection.current = {
|
|
7030
|
+
start: (_a2 = event.currentTarget.selectionStart) != null ? _a2 : 0,
|
|
7031
|
+
end: (_b = event.currentTarget.selectionEnd) != null ? _b : 0
|
|
7032
|
+
};
|
|
7033
|
+
const pastedValue = event.clipboardData.getData("text").replace(/\D/g, "");
|
|
7034
|
+
replaceSelection(pastedValue, selection.current.start, selection.current.end);
|
|
7035
|
+
}
|
|
7036
|
+
})
|
|
7037
|
+
);
|
|
6831
7038
|
}
|
|
6832
7039
|
|
|
6833
7040
|
// ../renderers/src/TextInputRenderer.tsx
|
|
6834
7041
|
var import_jsx_runtime101 = require("react/jsx-runtime");
|
|
6835
7042
|
var TextInputRenderer = {
|
|
6836
7043
|
canRenderType: "input-text",
|
|
6837
|
-
render: (props) => {
|
|
6838
|
-
|
|
7044
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(TextInputRendererComponent, __spreadValues({}, props))
|
|
7045
|
+
};
|
|
7046
|
+
function TextInputRendererComponent(props) {
|
|
7047
|
+
const [isSsnVisible, setIsSsnVisible] = (0, import_react28.useState)(false);
|
|
7048
|
+
const _a = props, {
|
|
7049
|
+
id,
|
|
7050
|
+
title,
|
|
7051
|
+
description,
|
|
7052
|
+
help,
|
|
7053
|
+
media,
|
|
7054
|
+
validationState,
|
|
7055
|
+
value: initialValue,
|
|
7056
|
+
onChange
|
|
7057
|
+
} = _a, rest = __objRest(_a, [
|
|
7058
|
+
"id",
|
|
7059
|
+
"title",
|
|
7060
|
+
"description",
|
|
7061
|
+
"help",
|
|
7062
|
+
"media",
|
|
7063
|
+
"validationState",
|
|
7064
|
+
"value",
|
|
7065
|
+
"onChange"
|
|
7066
|
+
]);
|
|
7067
|
+
const value = initialValue != null ? initialValue : "";
|
|
7068
|
+
const isSsnInput = props.control === "ssn-input";
|
|
7069
|
+
const inputProps = __spreadProps(__spreadValues({}, rest), {
|
|
7070
|
+
value,
|
|
7071
|
+
id,
|
|
7072
|
+
isSsnVisible,
|
|
7073
|
+
onChange: (newValue) => {
|
|
7074
|
+
if ((value != null ? value : "") !== (newValue != null ? newValue : "")) {
|
|
7075
|
+
onChange(newValue);
|
|
7076
|
+
}
|
|
7077
|
+
}
|
|
7078
|
+
});
|
|
7079
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
7080
|
+
FieldInput_default,
|
|
7081
|
+
{
|
|
6839
7082
|
id,
|
|
6840
|
-
title,
|
|
7083
|
+
label: title,
|
|
6841
7084
|
description,
|
|
7085
|
+
validation: validationState,
|
|
7086
|
+
inlineAlert: props.inlineAlert,
|
|
7087
|
+
loadingState: props.fieldLoadingState,
|
|
6842
7088
|
help,
|
|
6843
|
-
|
|
6844
|
-
|
|
6845
|
-
|
|
6846
|
-
|
|
6847
|
-
|
|
6848
|
-
|
|
6849
|
-
|
|
6850
|
-
|
|
6851
|
-
|
|
6852
|
-
|
|
6853
|
-
|
|
6854
|
-
|
|
6855
|
-
|
|
6856
|
-
|
|
6857
|
-
|
|
6858
|
-
|
|
6859
|
-
|
|
6860
|
-
|
|
6861
|
-
onChange: (newValue) => {
|
|
6862
|
-
if ((value != null ? value : "") !== (newValue != null ? newValue : "")) {
|
|
6863
|
-
onChange(newValue);
|
|
7089
|
+
features: props.features,
|
|
7090
|
+
control: props.control,
|
|
7091
|
+
tags: props.tags,
|
|
7092
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
7093
|
+
import_components69.InputGroup,
|
|
7094
|
+
{
|
|
7095
|
+
addonStart: getInputGroupAddonStart(media),
|
|
7096
|
+
addonEnd: isSsnInput ? {
|
|
7097
|
+
interactive: true,
|
|
7098
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
7099
|
+
SsnInputToggle,
|
|
7100
|
+
{
|
|
7101
|
+
isVisible: isSsnVisible,
|
|
7102
|
+
onClick: () => setIsSsnVisible((visible) => !visible)
|
|
7103
|
+
}
|
|
7104
|
+
)
|
|
7105
|
+
} : void 0,
|
|
7106
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(VariableTextInput, __spreadValues({}, inputProps))
|
|
6864
7107
|
}
|
|
6865
|
-
|
|
6866
|
-
}
|
|
6867
|
-
|
|
6868
|
-
|
|
6869
|
-
{
|
|
6870
|
-
id,
|
|
6871
|
-
label: title,
|
|
6872
|
-
description,
|
|
6873
|
-
validation: validationState,
|
|
6874
|
-
inlineAlert: props.inlineAlert,
|
|
6875
|
-
loadingState: props.fieldLoadingState,
|
|
6876
|
-
help,
|
|
6877
|
-
features: props.features,
|
|
6878
|
-
control: props.control,
|
|
6879
|
-
tags: props.tags,
|
|
6880
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_components69.InputGroup, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(VariableTextInput, __spreadValues({}, inputProps)) })
|
|
6881
|
-
}
|
|
6882
|
-
);
|
|
6883
|
-
}
|
|
6884
|
-
};
|
|
7108
|
+
)
|
|
7109
|
+
}
|
|
7110
|
+
);
|
|
7111
|
+
}
|
|
6885
7112
|
var TextInputRenderer_default = TextInputRenderer;
|
|
6886
7113
|
|
|
6887
7114
|
// ../renderers/src/UpdatableRenderer.tsx
|
|
@@ -7039,7 +7266,7 @@ var LargeUploadRenderer = {
|
|
|
7039
7266
|
// ../renderers/src/UpsellRenderer.tsx
|
|
7040
7267
|
var import_components71 = require("@transferwise/components");
|
|
7041
7268
|
var import_classnames35 = __toESM(require_classnames());
|
|
7042
|
-
var
|
|
7269
|
+
var import_react29 = require("react");
|
|
7043
7270
|
var import_jsx_runtime104 = require("react/jsx-runtime");
|
|
7044
7271
|
var UpsellRenderer = {
|
|
7045
7272
|
canRenderType: "upsell",
|
|
@@ -7047,7 +7274,7 @@ var UpsellRenderer = {
|
|
|
7047
7274
|
};
|
|
7048
7275
|
function UpsellRendererComponent(props) {
|
|
7049
7276
|
const { text, callToAction, media, margin, onDismiss, control, tags } = props;
|
|
7050
|
-
const [isVisible, setIsVisible] = (0,
|
|
7277
|
+
const [isVisible, setIsVisible] = (0, import_react29.useState)(true);
|
|
7051
7278
|
return isVisible ? /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
7052
7279
|
import_components71.Nudge,
|
|
7053
7280
|
{
|
|
@@ -7276,12 +7503,12 @@ var customEventsToAnalytics = {
|
|
|
7276
7503
|
};
|
|
7277
7504
|
|
|
7278
7505
|
// src/dynamicFlow/useOnCopy.tsx
|
|
7279
|
-
var
|
|
7280
|
-
var
|
|
7506
|
+
var import_react30 = require("react");
|
|
7507
|
+
var import_react_intl38 = require("react-intl");
|
|
7281
7508
|
|
|
7282
7509
|
// src/dynamicFlow/messages.ts
|
|
7283
|
-
var
|
|
7284
|
-
var messages_default = (0,
|
|
7510
|
+
var import_react_intl37 = require("react-intl");
|
|
7511
|
+
var messages_default = (0, import_react_intl37.defineMessages)({
|
|
7285
7512
|
copied: {
|
|
7286
7513
|
id: "df.wise.CopyFeedback.copy",
|
|
7287
7514
|
defaultMessage: "Copied to clipboard",
|
|
@@ -7296,9 +7523,9 @@ var messages_default = (0, import_react_intl35.defineMessages)({
|
|
|
7296
7523
|
|
|
7297
7524
|
// src/dynamicFlow/useOnCopy.tsx
|
|
7298
7525
|
var useOnCopy = () => {
|
|
7299
|
-
const { formatMessage } = (0,
|
|
7526
|
+
const { formatMessage } = (0, import_react_intl38.useIntl)();
|
|
7300
7527
|
const createSnackBar = useSnackBarIfAvailable();
|
|
7301
|
-
return (0,
|
|
7528
|
+
return (0, import_react30.useCallback)(
|
|
7302
7529
|
(copiedContent) => {
|
|
7303
7530
|
if (copiedContent) {
|
|
7304
7531
|
createSnackBar({ text: formatMessage(messages_default.copied) });
|
|
@@ -7311,11 +7538,11 @@ var useOnCopy = () => {
|
|
|
7311
7538
|
};
|
|
7312
7539
|
|
|
7313
7540
|
// src/dynamicFlow/useWiseHttpClient.tsx
|
|
7314
|
-
var
|
|
7315
|
-
var
|
|
7541
|
+
var import_react31 = require("react");
|
|
7542
|
+
var import_react_intl39 = require("react-intl");
|
|
7316
7543
|
var useWiseHttpClient = (httpClient) => {
|
|
7317
|
-
const { locale } = (0,
|
|
7318
|
-
return (0,
|
|
7544
|
+
const { locale } = (0, import_react_intl39.useIntl)();
|
|
7545
|
+
return (0, import_react31.useCallback)(
|
|
7319
7546
|
async (input, init = {}) => {
|
|
7320
7547
|
const headers = new Headers(init.headers);
|
|
7321
7548
|
headers.set("accept-language", locale);
|
|
@@ -7356,10 +7583,10 @@ var useWiseToCoreProps = (props) => {
|
|
|
7356
7583
|
onLog
|
|
7357
7584
|
} = props;
|
|
7358
7585
|
const httpClient = useWiseHttpClient(customFetch);
|
|
7359
|
-
const mergedRenderers = (0,
|
|
7586
|
+
const mergedRenderers = (0, import_react32.useMemo)(() => getMergedRenderers(props), [renderers]);
|
|
7360
7587
|
const createSnackBar = useCreateSnackBar();
|
|
7361
|
-
const logEvent = (0,
|
|
7362
|
-
const trackEvent = (0,
|
|
7588
|
+
const logEvent = (0, import_react32.useMemo)(() => getLogEvent(onLog), [onLog]);
|
|
7589
|
+
const trackEvent = (0, import_react32.useMemo)(() => getTrackEvent(onEvent, onAnalytics), [onEvent, onAnalytics]);
|
|
7363
7590
|
const onCopy = useOnCopy();
|
|
7364
7591
|
return __spreadProps(__spreadValues({}, props), {
|
|
7365
7592
|
httpClient,
|
|
@@ -7407,14 +7634,14 @@ function DynamicFlow(props) {
|
|
|
7407
7634
|
}
|
|
7408
7635
|
|
|
7409
7636
|
// src/dynamicFlow/DynamicFlowWithRef.tsx
|
|
7410
|
-
var
|
|
7637
|
+
var import_react33 = require("react");
|
|
7411
7638
|
var import_dynamic_flow_client5 = require("@wise/dynamic-flow-client");
|
|
7412
7639
|
var import_jsx_runtime109 = require("react/jsx-runtime");
|
|
7413
|
-
var DynamicFlowWithRef = (0,
|
|
7640
|
+
var DynamicFlowWithRef = (0, import_react33.forwardRef)(function DynamicFlowWithRef2(props, ref) {
|
|
7414
7641
|
const { className = "" } = props;
|
|
7415
7642
|
const dfProps = useWiseToCoreProps(props);
|
|
7416
7643
|
const df = (0, import_dynamic_flow_client5.useDynamicFlow)(dfProps);
|
|
7417
|
-
(0,
|
|
7644
|
+
(0, import_react33.useImperativeHandle)(
|
|
7418
7645
|
ref,
|
|
7419
7646
|
() => ({
|
|
7420
7647
|
getValue: () => {
|
|
@@ -7587,6 +7814,8 @@ var en_default = {
|
|
|
7587
7814
|
"df.wise.group.currencies-with-account-details": "Currencies with account details",
|
|
7588
7815
|
"df.wise.group.popular": "Popular",
|
|
7589
7816
|
"df.wise.group.recent": "Recent",
|
|
7817
|
+
"df.wise.ssnInput.hideValue": "Hide value",
|
|
7818
|
+
"df.wise.ssnInput.showValue": "Show value",
|
|
7590
7819
|
"df.wise.step.scrollToBottom": "Scroll to bottom"
|
|
7591
7820
|
};
|
|
7592
7821
|
|