@wise/dynamic-flow-client-internal 4.22.0 → 4.23.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/i18n/cs.json +1 -1
- package/build/i18n/pl.json +2 -2
- package/build/i18n/ro.json +1 -1
- package/build/main.css +7 -9
- package/build/main.js +454 -327
- package/build/main.mjs +397 -271
- package/package.json +11 -11
package/build/main.js
CHANGED
|
@@ -83,7 +83,7 @@ var cs_default = {
|
|
|
83
83
|
"df.wise.ArraySchema.maxItemsError": "P\u0159idejte {maxItems} nebo m\xE9n\u011B.",
|
|
84
84
|
"df.wise.ArraySchema.minItemsError": "P\u0159idejte alespo\u0148 {minItems}.",
|
|
85
85
|
"df.wise.ArraySchema.removeItem": "Odebrat",
|
|
86
|
-
"df.wise.ButtonLayout.buttonLoadingMessage": "
|
|
86
|
+
"df.wise.ButtonLayout.buttonLoadingMessage": "M\u016F\u017Ee to trvat p\xE1r sekund",
|
|
87
87
|
"df.wise.ControlFeedback.maxLength": "Zadejte {maxLength} nebo m\xE9n\u011B znak\u016F.",
|
|
88
88
|
"df.wise.ControlFeedback.maximum": "Zadejte \u010D\xEDslo, kter\xE9 je {maximum} nebo men\u0161\xED.",
|
|
89
89
|
"df.wise.ControlFeedback.maximumDate": "Zadejte datum, kter\xE9 je {maximum} nebo p\u0159edt\xEDm.",
|
|
@@ -537,10 +537,10 @@ var pl_default = {
|
|
|
537
537
|
"df.wise.CopyFeedback.copy": "Skopiowano do schowka",
|
|
538
538
|
"df.wise.CopyFeedback.copyFailed": "Nie uda\u0142o si\u0119 skopiowa\u0107 do schowka",
|
|
539
539
|
"df.wise.Decision.all": "Wszystkie",
|
|
540
|
-
"df.wise.Decision.filterPlaceholder": "
|
|
540
|
+
"df.wise.Decision.filterPlaceholder": "Zacznij pisa\u0107, \u017Ceby wyszuka\u0107",
|
|
541
541
|
"df.wise.Decision.noResults": "Brak wynik\xF3w",
|
|
542
542
|
"df.wise.Decision.popular": "Popularne",
|
|
543
|
-
"df.wise.Decision.recent": "
|
|
543
|
+
"df.wise.Decision.recent": "Ostatnie",
|
|
544
544
|
"df.wise.Decision.results": "Wyniki wyszukiwania",
|
|
545
545
|
"df.wise.DynamicParagraph.copied": "Skopiowano do schowka",
|
|
546
546
|
"df.wise.DynamicParagraph.copy": "Kopiuj",
|
|
@@ -625,7 +625,7 @@ var ro_default = {
|
|
|
625
625
|
"df.wise.CopyFeedback.copy": "Copiat \xEEn clipboard",
|
|
626
626
|
"df.wise.CopyFeedback.copyFailed": "Copierea \xEEn clipboard a e\u0219uat",
|
|
627
627
|
"df.wise.Decision.all": "Toate",
|
|
628
|
-
"df.wise.Decision.filterPlaceholder": "
|
|
628
|
+
"df.wise.Decision.filterPlaceholder": "\xCEncepe s\u0103 tastezi pentru a c\u0103uta",
|
|
629
629
|
"df.wise.Decision.noResults": "Niciun rezultat",
|
|
630
630
|
"df.wise.Decision.popular": "Populare",
|
|
631
631
|
"df.wise.Decision.recent": "Recente",
|
|
@@ -899,13 +899,12 @@ var translations = languages.reduce(
|
|
|
899
899
|
var i18n_default = translations;
|
|
900
900
|
|
|
901
901
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
902
|
-
var
|
|
902
|
+
var import_react18 = require("react");
|
|
903
903
|
var import_react_intl22 = require("react-intl");
|
|
904
904
|
var import_dynamic_flow_client2 = require("@wise/dynamic-flow-client");
|
|
905
905
|
|
|
906
|
-
// ../renderers/src/
|
|
906
|
+
// ../renderers/src/AlertRenderer.tsx
|
|
907
907
|
var import_components = require("@transferwise/components");
|
|
908
|
-
var import_react_intl2 = require("react-intl");
|
|
909
908
|
|
|
910
909
|
// ../renderers/src/utils/layout-utils.ts
|
|
911
910
|
var getMargin = (size) => {
|
|
@@ -937,6 +936,59 @@ var getTextAlignment = (align) => {
|
|
|
937
936
|
};
|
|
938
937
|
var getTextAlignmentAndMargin = (component) => `${getTextAlignment(component.align)} ${getMargin(component.margin)}`;
|
|
939
938
|
|
|
939
|
+
// ../renderers/src/AlertRenderer.tsx
|
|
940
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
941
|
+
var AlertRenderer = {
|
|
942
|
+
canRenderType: "alert",
|
|
943
|
+
render: ({ context, markdown, margin, callToAction }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
944
|
+
import_components.Alert,
|
|
945
|
+
{
|
|
946
|
+
type: context,
|
|
947
|
+
className: getMargin(margin),
|
|
948
|
+
message: markdown,
|
|
949
|
+
action: mapCtaToAlertAction(callToAction)
|
|
950
|
+
}
|
|
951
|
+
)
|
|
952
|
+
};
|
|
953
|
+
var mapCtaToAlertAction = (callToAction) => {
|
|
954
|
+
if (callToAction) {
|
|
955
|
+
return __spreadValues(__spreadValues({
|
|
956
|
+
text: callToAction.title,
|
|
957
|
+
"aria-label": callToAction.accessibilityDescription
|
|
958
|
+
}, "onClick" in callToAction ? { onClick: callToAction.onClick } : {}), callToAction.type === "link" ? { href: callToAction.href, target: "_blank" } : {});
|
|
959
|
+
}
|
|
960
|
+
return void 0;
|
|
961
|
+
};
|
|
962
|
+
var AlertRenderer_default = AlertRenderer;
|
|
963
|
+
|
|
964
|
+
// ../renderers/src/BoxRenderer.tsx
|
|
965
|
+
var import_classnames = __toESM(require("classnames"));
|
|
966
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
967
|
+
var BoxRenderer = {
|
|
968
|
+
canRenderType: "box",
|
|
969
|
+
render: ({ children, control, margin, width }) => {
|
|
970
|
+
const hasFixedWidth = width !== "xl";
|
|
971
|
+
const hasBorder = control === "bordered" || control === "bordered-web";
|
|
972
|
+
const contents = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
973
|
+
"div",
|
|
974
|
+
{
|
|
975
|
+
className: (0, import_classnames.default)({
|
|
976
|
+
"df-box-renderer-border": hasBorder,
|
|
977
|
+
[`df-box-renderer-width-${width}`]: hasFixedWidth,
|
|
978
|
+
[getMargin(margin)]: !hasFixedWidth
|
|
979
|
+
}),
|
|
980
|
+
children
|
|
981
|
+
}
|
|
982
|
+
);
|
|
983
|
+
return hasFixedWidth ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: (0, import_classnames.default)("df-box-renderer-fixed-width", getMargin(margin)), children: contents }) : contents;
|
|
984
|
+
}
|
|
985
|
+
};
|
|
986
|
+
var BoxRenderer_default = BoxRenderer;
|
|
987
|
+
|
|
988
|
+
// ../renderers/src/ButtonRenderer/AddressValidationButtonRenderer.tsx
|
|
989
|
+
var import_components2 = require("@transferwise/components");
|
|
990
|
+
var import_react_intl2 = require("react-intl");
|
|
991
|
+
|
|
940
992
|
// ../renderers/src/messages/loading-button.messages.ts
|
|
941
993
|
var import_react_intl = require("react-intl");
|
|
942
994
|
var loading_button_messages_default = (0, import_react_intl.defineMessages)({
|
|
@@ -949,7 +1001,7 @@ var loading_button_messages_default = (0, import_react_intl.defineMessages)({
|
|
|
949
1001
|
|
|
950
1002
|
// ../renderers/src/ButtonRenderer/AddressValidationButtonRenderer.tsx
|
|
951
1003
|
var import_react = require("react");
|
|
952
|
-
var
|
|
1004
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
953
1005
|
var AddressValidationButtonRenderer = {
|
|
954
1006
|
canRenderType: "button",
|
|
955
1007
|
canRender: ({ control }) => control === "address-validation",
|
|
@@ -964,9 +1016,9 @@ function AddressValidationButtonComponent(props) {
|
|
|
964
1016
|
setSpinny(false);
|
|
965
1017
|
}
|
|
966
1018
|
}, [stepLoadingState]);
|
|
967
|
-
return /* @__PURE__ */ (0,
|
|
968
|
-
/* @__PURE__ */ (0,
|
|
969
|
-
|
|
1019
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: `d-flex flex-column ${getMargin(margin)}`, children: [
|
|
1020
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1021
|
+
import_components2.Button,
|
|
970
1022
|
{
|
|
971
1023
|
v2: true,
|
|
972
1024
|
block: true,
|
|
@@ -981,61 +1033,11 @@ function AddressValidationButtonComponent(props) {
|
|
|
981
1033
|
children: title
|
|
982
1034
|
}
|
|
983
1035
|
),
|
|
984
|
-
spinny && /* @__PURE__ */ (0,
|
|
1036
|
+
spinny && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_components2.InlineAlert, { type: "warning", className: "m-x-auto", children: formatMessage(loading_button_messages_default.buttonLoadingMessage) })
|
|
985
1037
|
] });
|
|
986
1038
|
}
|
|
987
1039
|
var AddressValidationButtonRenderer_default = AddressValidationButtonRenderer;
|
|
988
1040
|
|
|
989
|
-
// ../renderers/src/AlertRenderer.tsx
|
|
990
|
-
var import_components2 = require("@transferwise/components");
|
|
991
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
992
|
-
var AlertRenderer = {
|
|
993
|
-
canRenderType: "alert",
|
|
994
|
-
render: ({ context, markdown, margin, callToAction }) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
995
|
-
import_components2.Alert,
|
|
996
|
-
{
|
|
997
|
-
type: context,
|
|
998
|
-
className: getMargin(margin),
|
|
999
|
-
message: markdown,
|
|
1000
|
-
action: mapCtaToAlertAction(callToAction)
|
|
1001
|
-
}
|
|
1002
|
-
)
|
|
1003
|
-
};
|
|
1004
|
-
var mapCtaToAlertAction = (callToAction) => {
|
|
1005
|
-
if (callToAction) {
|
|
1006
|
-
return __spreadValues(__spreadValues({
|
|
1007
|
-
text: callToAction.title,
|
|
1008
|
-
"aria-label": callToAction.accessibilityDescription
|
|
1009
|
-
}, "onClick" in callToAction ? { onClick: callToAction.onClick } : {}), callToAction.type === "link" ? { href: callToAction.href, target: "_blank" } : {});
|
|
1010
|
-
}
|
|
1011
|
-
return void 0;
|
|
1012
|
-
};
|
|
1013
|
-
var AlertRenderer_default = AlertRenderer;
|
|
1014
|
-
|
|
1015
|
-
// ../renderers/src/BoxRenderer.tsx
|
|
1016
|
-
var import_classnames = __toESM(require("classnames"));
|
|
1017
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
1018
|
-
var BoxRenderer = {
|
|
1019
|
-
canRenderType: "box",
|
|
1020
|
-
render: ({ children, control, margin, width }) => {
|
|
1021
|
-
const hasFixedWidth = width !== "xl";
|
|
1022
|
-
const hasBorder = control === "bordered" || control === "bordered-web";
|
|
1023
|
-
const contents = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1024
|
-
"div",
|
|
1025
|
-
{
|
|
1026
|
-
className: (0, import_classnames.default)({
|
|
1027
|
-
"df-box-renderer-border": hasBorder,
|
|
1028
|
-
[`df-box-renderer-width-${width}`]: hasFixedWidth,
|
|
1029
|
-
[getMargin(margin)]: !hasFixedWidth
|
|
1030
|
-
}),
|
|
1031
|
-
children
|
|
1032
|
-
}
|
|
1033
|
-
);
|
|
1034
|
-
return hasFixedWidth ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: (0, import_classnames.default)("df-box-renderer-fixed-width", getMargin(margin)), children: contents }) : contents;
|
|
1035
|
-
}
|
|
1036
|
-
};
|
|
1037
|
-
var BoxRenderer_default = BoxRenderer;
|
|
1038
|
-
|
|
1039
1041
|
// ../renderers/src/ButtonRenderer/ButtonRenderer.tsx
|
|
1040
1042
|
var import_components3 = require("@transferwise/components");
|
|
1041
1043
|
var import_react2 = require("react");
|
|
@@ -1517,9 +1519,10 @@ var resolveUri = (uri, size) => {
|
|
|
1517
1519
|
var _a, _b;
|
|
1518
1520
|
const { name, qComponents = [] } = stringToURN(uri);
|
|
1519
1521
|
if (isValidIconUrn(name)) {
|
|
1522
|
+
const icon = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DynamicIcon_default, { name: name.replace("urn:wise:icons:", "") });
|
|
1520
1523
|
return {
|
|
1521
|
-
|
|
1522
|
-
backgroundColor: (_a = qComponents.find(([key]) => key === "background-color")) == null ? void 0 : _a[1]
|
|
1524
|
+
icon,
|
|
1525
|
+
backgroundColor: formatColor((_a = qComponents.find(([key]) => key === "background-color")) == null ? void 0 : _a[1])
|
|
1523
1526
|
};
|
|
1524
1527
|
}
|
|
1525
1528
|
if (isUrnFlag(name)) {
|
|
@@ -1531,7 +1534,7 @@ var resolveUri = (uri, size) => {
|
|
|
1531
1534
|
const text = decodeURI(name.replace("data:text/plain,", ""));
|
|
1532
1535
|
return {
|
|
1533
1536
|
asset: text,
|
|
1534
|
-
backgroundColor: (_b = qComponents.find(([key]) => key === "background-color")) == null ? void 0 : _b[1]
|
|
1537
|
+
backgroundColor: formatColor((_b = qComponents.find(([key]) => key === "background-color")) == null ? void 0 : _b[1])
|
|
1535
1538
|
};
|
|
1536
1539
|
}
|
|
1537
1540
|
if (!uri.startsWith("urn:")) {
|
|
@@ -1539,6 +1542,15 @@ var resolveUri = (uri, size) => {
|
|
|
1539
1542
|
}
|
|
1540
1543
|
return { asset: void 0 };
|
|
1541
1544
|
};
|
|
1545
|
+
var formatColor = (color) => {
|
|
1546
|
+
if (!color) {
|
|
1547
|
+
return void 0;
|
|
1548
|
+
}
|
|
1549
|
+
if (color.startsWith("#")) {
|
|
1550
|
+
return color;
|
|
1551
|
+
}
|
|
1552
|
+
return `var(--color-${color.replace(/^base-|brand-/, "")})`;
|
|
1553
|
+
};
|
|
1542
1554
|
|
|
1543
1555
|
// ../renderers/src/components/Media/AvatarMedia.tsx
|
|
1544
1556
|
var import_components8 = require("@transferwise/components");
|
|
@@ -1553,24 +1565,29 @@ var AvatarMedia = ({
|
|
|
1553
1565
|
return { asset: avatar.text };
|
|
1554
1566
|
}
|
|
1555
1567
|
return __spreadProps(__spreadValues({}, resolveUri(avatar.uri, size)), {
|
|
1556
|
-
badge: avatar.badgeUri ? resolveUri(avatar.badgeUri, 16)
|
|
1568
|
+
badge: avatar.badgeUri ? resolveUri(avatar.badgeUri, 16) : void 0
|
|
1557
1569
|
});
|
|
1558
1570
|
};
|
|
1559
1571
|
const avatars = content.map(getRenderableAvatar);
|
|
1560
1572
|
if (avatars.length === 1) {
|
|
1561
|
-
const { badge, backgroundColor, asset } = avatars[0];
|
|
1573
|
+
const { badge, backgroundColor, asset, icon } = avatars[0];
|
|
1574
|
+
if (!asset && !icon) {
|
|
1575
|
+
return null;
|
|
1576
|
+
}
|
|
1562
1577
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1563
1578
|
import_components8.AvatarView,
|
|
1564
1579
|
{
|
|
1565
1580
|
"aria-label": accessibilityDescription,
|
|
1566
1581
|
size,
|
|
1567
|
-
badge: {
|
|
1582
|
+
badge: badge ? __spreadProps(__spreadValues({}, badge), {
|
|
1583
|
+
type: "reference"
|
|
1584
|
+
}) : void 0,
|
|
1568
1585
|
style: { backgroundColor },
|
|
1569
|
-
children: asset
|
|
1586
|
+
children: icon != null ? icon : asset
|
|
1570
1587
|
}
|
|
1571
1588
|
);
|
|
1572
1589
|
}
|
|
1573
|
-
const avatarsWithoutBadges = avatars.map((_a) => {
|
|
1590
|
+
const avatarsWithoutBadges = avatars.filter(({ asset }) => asset).slice(0, 2).map((_a) => {
|
|
1574
1591
|
var _b = _a, { badge } = _b, rest = __objRest(_b, ["badge"]);
|
|
1575
1592
|
return __spreadValues({}, rest);
|
|
1576
1593
|
});
|
|
@@ -1591,7 +1608,7 @@ var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
|
1591
1608
|
var getBadgedMedia = (iconNode, imageNode, size) => {
|
|
1592
1609
|
if (iconNode && imageNode) {
|
|
1593
1610
|
if (imageNode && iconNode) {
|
|
1594
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_components9.AvatarView, { size, badge: { asset: iconNode }, children: imageNode });
|
|
1611
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_components9.AvatarView, { size, badge: { asset: iconNode, type: "reference" }, children: imageNode });
|
|
1595
1612
|
}
|
|
1596
1613
|
}
|
|
1597
1614
|
return null;
|
|
@@ -2044,7 +2061,8 @@ function UrnFlagImage({
|
|
|
2044
2061
|
}
|
|
2045
2062
|
|
|
2046
2063
|
// ../renderers/src/ImageRenderer/UrnIllustration.tsx
|
|
2047
|
-
var
|
|
2064
|
+
var import_art4 = require("@wise/art");
|
|
2065
|
+
var import_react7 = require("react");
|
|
2048
2066
|
|
|
2049
2067
|
// ../renderers/src/ImageRenderer/isAnimated.ts
|
|
2050
2068
|
var isAnimated = (uri) => {
|
|
@@ -2053,8 +2071,39 @@ var isAnimated = (uri) => {
|
|
|
2053
2071
|
return (_a = rComponents == null ? void 0 : rComponents.some(([key, value]) => key === "type" && value === "animated")) != null ? _a : false;
|
|
2054
2072
|
};
|
|
2055
2073
|
|
|
2056
|
-
// ../renderers/src/ImageRenderer/
|
|
2074
|
+
// ../renderers/src/ImageRenderer/SafeIllustration3D.tsx
|
|
2075
|
+
var import_art3 = require("@wise/art");
|
|
2076
|
+
var import_react6 = require("react");
|
|
2057
2077
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2078
|
+
var Illustration3DErrorBoundary = class extends import_react6.Component {
|
|
2079
|
+
constructor(props) {
|
|
2080
|
+
super(props);
|
|
2081
|
+
this.state = { hasError: false };
|
|
2082
|
+
}
|
|
2083
|
+
static getDerivedStateFromError() {
|
|
2084
|
+
return { hasError: true };
|
|
2085
|
+
}
|
|
2086
|
+
componentDidCatch() {
|
|
2087
|
+
this.props.onError();
|
|
2088
|
+
}
|
|
2089
|
+
render() {
|
|
2090
|
+
if (this.state.hasError) {
|
|
2091
|
+
return null;
|
|
2092
|
+
}
|
|
2093
|
+
return this.props.children;
|
|
2094
|
+
}
|
|
2095
|
+
};
|
|
2096
|
+
var SafeIllustration3D = ({
|
|
2097
|
+
name,
|
|
2098
|
+
size,
|
|
2099
|
+
onError
|
|
2100
|
+
}) => {
|
|
2101
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Illustration3DErrorBoundary, { onError, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_art3.Illustration3D, { name, size }) });
|
|
2102
|
+
};
|
|
2103
|
+
var SafeIllustration3D_default = SafeIllustration3D;
|
|
2104
|
+
|
|
2105
|
+
// ../renderers/src/ImageRenderer/UrnIllustration.tsx
|
|
2106
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2058
2107
|
var urnPrefix = "urn:wise:illustrations:";
|
|
2059
2108
|
var isUrnIllustration = (uri) => uri.startsWith(urnPrefix);
|
|
2060
2109
|
function UrnIllustration({
|
|
@@ -2064,14 +2113,22 @@ function UrnIllustration({
|
|
|
2064
2113
|
size,
|
|
2065
2114
|
uri
|
|
2066
2115
|
}) {
|
|
2116
|
+
const [has3DFailed, setHas3DFailed] = (0, import_react7.useState)(false);
|
|
2067
2117
|
const illustrationSize = getIllustrationSize(size);
|
|
2068
2118
|
const illustrationName = getIllustrationName(uri);
|
|
2069
2119
|
const illustration3DName = getIllustration3DName(uri);
|
|
2070
|
-
if (illustration3DName && isAnimated(uri)) {
|
|
2071
|
-
return /* @__PURE__ */ (0,
|
|
2120
|
+
if (illustration3DName && isAnimated(uri) && !has3DFailed) {
|
|
2121
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: `df-image ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2122
|
+
SafeIllustration3D_default,
|
|
2123
|
+
{
|
|
2124
|
+
name: illustration3DName,
|
|
2125
|
+
size: illustrationSize,
|
|
2126
|
+
onError: () => setHas3DFailed(true)
|
|
2127
|
+
}
|
|
2128
|
+
) });
|
|
2072
2129
|
}
|
|
2073
|
-
return /* @__PURE__ */ (0,
|
|
2074
|
-
|
|
2130
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: `df-image ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2131
|
+
import_art4.Illustration,
|
|
2075
2132
|
{
|
|
2076
2133
|
className: "df-illustration",
|
|
2077
2134
|
name: illustrationName,
|
|
@@ -2086,28 +2143,28 @@ var getIllustrationName = (uri) => {
|
|
|
2086
2143
|
};
|
|
2087
2144
|
var getIllustration3DName = (uri) => {
|
|
2088
2145
|
const illustrationName = getIllustrationName(uri);
|
|
2089
|
-
return (0,
|
|
2146
|
+
return (0, import_art4.isIllustrationSupport3D)(illustrationName) ? illustrationName : null;
|
|
2090
2147
|
};
|
|
2091
2148
|
|
|
2092
2149
|
// ../renderers/src/ImageRenderer/UrnImage.tsx
|
|
2093
|
-
var
|
|
2150
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2094
2151
|
var isUrnImage = (uri) => uri.startsWith("urn:");
|
|
2095
2152
|
function UrnImage(props) {
|
|
2096
2153
|
const { uri } = props;
|
|
2097
2154
|
if (isUrnIllustration(uri)) {
|
|
2098
|
-
return /* @__PURE__ */ (0,
|
|
2155
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(UrnIllustration, __spreadValues({}, props));
|
|
2099
2156
|
}
|
|
2100
2157
|
if (isUrnFlag(uri)) {
|
|
2101
|
-
return /* @__PURE__ */ (0,
|
|
2158
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(UrnFlagImage, __spreadValues({}, props));
|
|
2102
2159
|
}
|
|
2103
2160
|
return null;
|
|
2104
2161
|
}
|
|
2105
2162
|
|
|
2106
2163
|
// ../renderers/src/ImageRenderer/ImageRenderer.tsx
|
|
2107
|
-
var
|
|
2164
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2108
2165
|
var ImageRenderer = {
|
|
2109
2166
|
canRenderType: "image",
|
|
2110
|
-
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */ (0,
|
|
2167
|
+
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(UrnImage, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(UrlImage, __spreadValues({}, props))
|
|
2111
2168
|
};
|
|
2112
2169
|
|
|
2113
2170
|
// ../renderers/src/ImageRenderer/index.tsx
|
|
@@ -2115,7 +2172,7 @@ var ImageRenderer_default = ImageRenderer;
|
|
|
2115
2172
|
|
|
2116
2173
|
// ../renderers/src/InstructionsRenderer.tsx
|
|
2117
2174
|
var import_components19 = require("@transferwise/components");
|
|
2118
|
-
var
|
|
2175
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
2119
2176
|
var doContext = ["positive", "neutral"];
|
|
2120
2177
|
var dontContext = ["warning", "negative"];
|
|
2121
2178
|
var InstructionsRenderer = {
|
|
@@ -2123,9 +2180,9 @@ var InstructionsRenderer = {
|
|
|
2123
2180
|
render: ({ items, margin, title }) => {
|
|
2124
2181
|
const dos = items.filter((item) => doContext.includes(item.context)).map(({ text }) => text);
|
|
2125
2182
|
const donts = items.filter((item) => dontContext.includes(item.context)).map(({ text }) => text);
|
|
2126
|
-
return /* @__PURE__ */ (0,
|
|
2127
|
-
title ? /* @__PURE__ */ (0,
|
|
2128
|
-
/* @__PURE__ */ (0,
|
|
2183
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: getMargin(margin), children: [
|
|
2184
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_components19.Header, { title }) : null,
|
|
2185
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_components19.InstructionsList, { dos, donts })
|
|
2129
2186
|
] });
|
|
2130
2187
|
}
|
|
2131
2188
|
};
|
|
@@ -2157,7 +2214,7 @@ function pick(obj, ...keys) {
|
|
|
2157
2214
|
}
|
|
2158
2215
|
|
|
2159
2216
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
2160
|
-
var
|
|
2217
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
2161
2218
|
var IntegerInputRenderer = {
|
|
2162
2219
|
canRenderType: "input-integer",
|
|
2163
2220
|
render: (props) => {
|
|
@@ -2172,7 +2229,7 @@ var IntegerInputRenderer = {
|
|
|
2172
2229
|
"maximum",
|
|
2173
2230
|
"minimum"
|
|
2174
2231
|
);
|
|
2175
|
-
return /* @__PURE__ */ (0,
|
|
2232
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2176
2233
|
FieldInput_default,
|
|
2177
2234
|
{
|
|
2178
2235
|
id,
|
|
@@ -2180,7 +2237,7 @@ var IntegerInputRenderer = {
|
|
|
2180
2237
|
description,
|
|
2181
2238
|
validation: validationState,
|
|
2182
2239
|
help,
|
|
2183
|
-
children: /* @__PURE__ */ (0,
|
|
2240
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_components20.InputGroup, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2184
2241
|
import_components20.Input,
|
|
2185
2242
|
__spreadValues({
|
|
2186
2243
|
id,
|
|
@@ -2205,12 +2262,12 @@ var IntegerInputRenderer_default = IntegerInputRenderer;
|
|
|
2205
2262
|
// ../renderers/src/ListRenderer.tsx
|
|
2206
2263
|
var import_components21 = require("@transferwise/components");
|
|
2207
2264
|
var import_classnames3 = __toESM(require("classnames"));
|
|
2208
|
-
var
|
|
2265
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2209
2266
|
var ListRenderer = {
|
|
2210
2267
|
canRenderType: "list",
|
|
2211
|
-
render: ({ callToAction, control, margin, items, title }) => /* @__PURE__ */ (0,
|
|
2212
|
-
(title || callToAction) && /* @__PURE__ */ (0,
|
|
2213
|
-
items.map((props) => /* @__PURE__ */ (0,
|
|
2268
|
+
render: ({ callToAction, control, margin, items, title }) => /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: getMargin(margin), children: [
|
|
2269
|
+
(title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_components21.Header, { as: "h2", title: title != null ? title : "", action: getListAction(callToAction) }),
|
|
2270
|
+
items.map((props) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DesignSystemListItem, __spreadProps(__spreadValues({}, props), { control }), props.title))
|
|
2214
2271
|
] })
|
|
2215
2272
|
};
|
|
2216
2273
|
var DesignSystemListItem = ({
|
|
@@ -2222,15 +2279,15 @@ var DesignSystemListItem = ({
|
|
|
2222
2279
|
media,
|
|
2223
2280
|
control,
|
|
2224
2281
|
tag
|
|
2225
|
-
}) => /* @__PURE__ */ (0,
|
|
2282
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2226
2283
|
"label",
|
|
2227
2284
|
{
|
|
2228
2285
|
className: (0, import_classnames3.default)("np-option p-a-2", {
|
|
2229
2286
|
"np-option__sm-media": true,
|
|
2230
2287
|
"np-option__container-aligned": true
|
|
2231
2288
|
}),
|
|
2232
|
-
children: /* @__PURE__ */ (0,
|
|
2233
|
-
icon || image || media ? /* @__PURE__ */ (0,
|
|
2289
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "media", children: [
|
|
2290
|
+
icon || image || media ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "media-left", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2234
2291
|
ListItemMedia,
|
|
2235
2292
|
{
|
|
2236
2293
|
icon,
|
|
@@ -2238,14 +2295,14 @@ var DesignSystemListItem = ({
|
|
|
2238
2295
|
preferAvatar: control === "with-avatar" || tag === "with-avatar"
|
|
2239
2296
|
}
|
|
2240
2297
|
) }) : null,
|
|
2241
|
-
/* @__PURE__ */ (0,
|
|
2242
|
-
/* @__PURE__ */ (0,
|
|
2243
|
-
/* @__PURE__ */ (0,
|
|
2244
|
-
/* @__PURE__ */ (0,
|
|
2298
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "media-body", children: [
|
|
2299
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "d-flex justify-content-between", children: [
|
|
2300
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("h4", { className: "np-text-body-large-bold text-primary np-option__title", children: title }),
|
|
2301
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("h4", { className: "np-text-body-large-bold text-primary np-option__title", children: supportingValues == null ? void 0 : supportingValues.value })
|
|
2245
2302
|
] }),
|
|
2246
|
-
/* @__PURE__ */ (0,
|
|
2247
|
-
/* @__PURE__ */ (0,
|
|
2248
|
-
/* @__PURE__ */ (0,
|
|
2303
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "d-flex justify-content-between", children: [
|
|
2304
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_components21.Body, { className: "d-block np-option__body", children: description }),
|
|
2305
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_components21.Body, { className: "d-block np-option__body", children: supportingValues == null ? void 0 : supportingValues.subvalue })
|
|
2249
2306
|
] })
|
|
2250
2307
|
] })
|
|
2251
2308
|
] })
|
|
@@ -2258,9 +2315,9 @@ var ListItemMedia = ({
|
|
|
2258
2315
|
preferAvatar
|
|
2259
2316
|
}) => {
|
|
2260
2317
|
if (icon) {
|
|
2261
|
-
return /* @__PURE__ */ (0,
|
|
2318
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "circle circle-sm text-primary circle-inverse", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(OptionMedia, { media, preferAvatar }) });
|
|
2262
2319
|
}
|
|
2263
|
-
return /* @__PURE__ */ (0,
|
|
2320
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "np-option__no-media-circle", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(OptionMedia, { media, preferAvatar }) });
|
|
2264
2321
|
};
|
|
2265
2322
|
var getListAction = (callToAction) => {
|
|
2266
2323
|
if (callToAction) {
|
|
@@ -2276,10 +2333,10 @@ var ListRenderer_default = ListRenderer;
|
|
|
2276
2333
|
|
|
2277
2334
|
// ../renderers/src/LoadingIndicatorRenderer.tsx
|
|
2278
2335
|
var import_components22 = require("@transferwise/components");
|
|
2279
|
-
var
|
|
2336
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2280
2337
|
var LoadingIndicatorRenderer = {
|
|
2281
2338
|
canRenderType: "loading-indicator",
|
|
2282
|
-
render: ({ margin, size }) => /* @__PURE__ */ (0,
|
|
2339
|
+
render: ({ margin, size }) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2283
2340
|
import_components22.Loader,
|
|
2284
2341
|
{
|
|
2285
2342
|
size,
|
|
@@ -2292,28 +2349,28 @@ var LoadingIndicatorRenderer_default = LoadingIndicatorRenderer;
|
|
|
2292
2349
|
|
|
2293
2350
|
// ../renderers/src/MarkdownRenderer.tsx
|
|
2294
2351
|
var import_components23 = require("@transferwise/components");
|
|
2295
|
-
var
|
|
2352
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2296
2353
|
var MarkdownRenderer = {
|
|
2297
2354
|
canRenderType: "markdown",
|
|
2298
|
-
render: ({ content, align, margin }) => /* @__PURE__ */ (0,
|
|
2355
|
+
render: ({ content, align, margin }) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_components23.Markdown, { className: "np-text-body-large", config: { link: { target: "_blank" } }, children: content }) })
|
|
2299
2356
|
};
|
|
2300
2357
|
var MarkdownRenderer_default = MarkdownRenderer;
|
|
2301
2358
|
|
|
2302
2359
|
// ../renderers/src/ModalLayoutRenderer.tsx
|
|
2303
2360
|
var import_components24 = require("@transferwise/components");
|
|
2304
|
-
var
|
|
2305
|
-
var
|
|
2361
|
+
var import_react8 = require("react");
|
|
2362
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
2306
2363
|
var ModalLayoutRenderer = {
|
|
2307
2364
|
canRenderType: "modal-layout",
|
|
2308
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
2365
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(DFModal, __spreadValues({}, props))
|
|
2309
2366
|
};
|
|
2310
2367
|
var ModalLayoutRenderer_default = ModalLayoutRenderer;
|
|
2311
2368
|
function DFModal({ content, margin, trigger }) {
|
|
2312
|
-
const [visible, setVisible] = (0,
|
|
2369
|
+
const [visible, setVisible] = (0, import_react8.useState)(false);
|
|
2313
2370
|
const { children, title } = content;
|
|
2314
|
-
return /* @__PURE__ */ (0,
|
|
2315
|
-
/* @__PURE__ */ (0,
|
|
2316
|
-
/* @__PURE__ */ (0,
|
|
2371
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: getMargin(margin), children: [
|
|
2372
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_components24.Button, { priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
|
|
2373
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2317
2374
|
import_components24.Modal,
|
|
2318
2375
|
{
|
|
2319
2376
|
scroll: "content",
|
|
@@ -2329,17 +2386,17 @@ function DFModal({ content, margin, trigger }) {
|
|
|
2329
2386
|
|
|
2330
2387
|
// ../renderers/src/ModalRenderer.tsx
|
|
2331
2388
|
var import_components25 = require("@transferwise/components");
|
|
2332
|
-
var
|
|
2389
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
2333
2390
|
var ModalRenderer = {
|
|
2334
2391
|
canRenderType: "modal",
|
|
2335
2392
|
render: ({ title, children, open, onClose }) => {
|
|
2336
|
-
return /* @__PURE__ */ (0,
|
|
2393
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_components25.Modal, { open, title, body: children, onClose });
|
|
2337
2394
|
}
|
|
2338
2395
|
};
|
|
2339
2396
|
|
|
2340
2397
|
// ../renderers/src/MultiSelectInputRenderer.tsx
|
|
2341
2398
|
var import_components26 = require("@transferwise/components");
|
|
2342
|
-
var
|
|
2399
|
+
var import_react9 = require("react");
|
|
2343
2400
|
var import_react_intl11 = require("react-intl");
|
|
2344
2401
|
|
|
2345
2402
|
// ../renderers/src/messages/multi-select.messages.ts
|
|
@@ -2353,14 +2410,14 @@ var multi_select_messages_default = (0, import_react_intl10.defineMessages)({
|
|
|
2353
2410
|
});
|
|
2354
2411
|
|
|
2355
2412
|
// ../renderers/src/MultiSelectInputRenderer.tsx
|
|
2356
|
-
var
|
|
2413
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
2357
2414
|
var MultiSelectInputRenderer = {
|
|
2358
2415
|
canRenderType: "input-multi-select",
|
|
2359
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
2416
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(MultiSelectInputRendererComponent, __spreadValues({}, props))
|
|
2360
2417
|
};
|
|
2361
2418
|
function MultiSelectInputRendererComponent(props) {
|
|
2362
2419
|
const { formatMessage } = (0, import_react_intl11.useIntl)();
|
|
2363
|
-
const [stagedIndices, setStagedIndices] = (0,
|
|
2420
|
+
const [stagedIndices, setStagedIndices] = (0, import_react9.useState)();
|
|
2364
2421
|
const {
|
|
2365
2422
|
id,
|
|
2366
2423
|
autoComplete,
|
|
@@ -2398,12 +2455,12 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
2398
2455
|
const contentProps = {
|
|
2399
2456
|
title: option.title,
|
|
2400
2457
|
description: option.description,
|
|
2401
|
-
icon: /* @__PURE__ */ (0,
|
|
2458
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(OptionMedia, { media: option.media, preferAvatar: false })
|
|
2402
2459
|
};
|
|
2403
|
-
return /* @__PURE__ */ (0,
|
|
2460
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_components26.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
2404
2461
|
};
|
|
2405
2462
|
const extraProps = { autoComplete };
|
|
2406
|
-
return /* @__PURE__ */ (0,
|
|
2463
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
2407
2464
|
FieldInput_default,
|
|
2408
2465
|
{
|
|
2409
2466
|
id,
|
|
@@ -2411,7 +2468,7 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
2411
2468
|
help,
|
|
2412
2469
|
description,
|
|
2413
2470
|
validation: validationState,
|
|
2414
|
-
children: /* @__PURE__ */ (0,
|
|
2471
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
2415
2472
|
import_components26.SelectInput,
|
|
2416
2473
|
__spreadValues({
|
|
2417
2474
|
id,
|
|
@@ -2456,7 +2513,7 @@ var import_components28 = require("@transferwise/components");
|
|
|
2456
2513
|
// ../renderers/src/components/UploadFieldInput.tsx
|
|
2457
2514
|
var import_components27 = require("@transferwise/components");
|
|
2458
2515
|
var import_classnames4 = __toESM(require("classnames"));
|
|
2459
|
-
var
|
|
2516
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
2460
2517
|
function UploadFieldInput({
|
|
2461
2518
|
id,
|
|
2462
2519
|
children,
|
|
@@ -2465,18 +2522,18 @@ function UploadFieldInput({
|
|
|
2465
2522
|
help,
|
|
2466
2523
|
validation
|
|
2467
2524
|
}) {
|
|
2468
|
-
const labelContent = label && help ? /* @__PURE__ */ (0,
|
|
2525
|
+
const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(LabelContentWithHelp, { text: label, help }) : label;
|
|
2469
2526
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
2470
|
-
return /* @__PURE__ */ (0,
|
|
2527
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
2471
2528
|
"div",
|
|
2472
2529
|
{
|
|
2473
2530
|
className: (0, import_classnames4.default)("form-group d-block", {
|
|
2474
2531
|
"has-error": (validation == null ? void 0 : validation.status) === "invalid"
|
|
2475
2532
|
}),
|
|
2476
2533
|
children: [
|
|
2477
|
-
/* @__PURE__ */ (0,
|
|
2534
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("label", { htmlFor: id, className: "control-label", children: labelContent }),
|
|
2478
2535
|
children,
|
|
2479
|
-
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ (0,
|
|
2536
|
+
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_components27.InlineAlert, { type: "negative", id: descriptionId, children: validation.message })
|
|
2480
2537
|
]
|
|
2481
2538
|
}
|
|
2482
2539
|
);
|
|
@@ -2511,7 +2568,7 @@ var getSizeLimit = (maxSize) => {
|
|
|
2511
2568
|
};
|
|
2512
2569
|
|
|
2513
2570
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
2514
|
-
var
|
|
2571
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
2515
2572
|
var MultiUploadInputRenderer = {
|
|
2516
2573
|
canRenderType: "input-upload-multi",
|
|
2517
2574
|
render: (props) => {
|
|
@@ -2536,7 +2593,7 @@ var MultiUploadInputRenderer = {
|
|
|
2536
2593
|
};
|
|
2537
2594
|
const onDeleteFile = async (fileId) => onRemoveFile(value.findIndex((file) => file.id === fileId));
|
|
2538
2595
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
2539
|
-
return /* @__PURE__ */ (0,
|
|
2596
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
2540
2597
|
UploadFieldInput_default,
|
|
2541
2598
|
{
|
|
2542
2599
|
id,
|
|
@@ -2544,7 +2601,7 @@ var MultiUploadInputRenderer = {
|
|
|
2544
2601
|
description,
|
|
2545
2602
|
validation: validationState,
|
|
2546
2603
|
help,
|
|
2547
|
-
children: /* @__PURE__ */ (0,
|
|
2604
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
2548
2605
|
import_components28.UploadInput,
|
|
2549
2606
|
{
|
|
2550
2607
|
id,
|
|
@@ -2568,7 +2625,7 @@ var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
|
|
|
2568
2625
|
|
|
2569
2626
|
// ../renderers/src/NumberInputRenderer.tsx
|
|
2570
2627
|
var import_components29 = require("@transferwise/components");
|
|
2571
|
-
var
|
|
2628
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
2572
2629
|
var NumberInputRenderer = {
|
|
2573
2630
|
canRenderType: "input-number",
|
|
2574
2631
|
render: (props) => {
|
|
@@ -2582,7 +2639,7 @@ var NumberInputRenderer = {
|
|
|
2582
2639
|
"maximum",
|
|
2583
2640
|
"minimum"
|
|
2584
2641
|
);
|
|
2585
|
-
return /* @__PURE__ */ (0,
|
|
2642
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
2586
2643
|
FieldInput_default,
|
|
2587
2644
|
{
|
|
2588
2645
|
id,
|
|
@@ -2590,7 +2647,7 @@ var NumberInputRenderer = {
|
|
|
2590
2647
|
description,
|
|
2591
2648
|
validation: validationState,
|
|
2592
2649
|
help,
|
|
2593
|
-
children: /* @__PURE__ */ (0,
|
|
2650
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_components29.InputGroup, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
2594
2651
|
import_components29.Input,
|
|
2595
2652
|
__spreadValues({
|
|
2596
2653
|
id,
|
|
@@ -2615,9 +2672,9 @@ var import_react_intl13 = require("react-intl");
|
|
|
2615
2672
|
|
|
2616
2673
|
// ../renderers/src/hooks/useSnackBarIfAvailable.ts
|
|
2617
2674
|
var import_components30 = require("@transferwise/components");
|
|
2618
|
-
var
|
|
2675
|
+
var import_react10 = require("react");
|
|
2619
2676
|
function useSnackBarIfAvailable() {
|
|
2620
|
-
const context = (0,
|
|
2677
|
+
const context = (0, import_react10.useContext)(import_components30.SnackbarContext);
|
|
2621
2678
|
return context ? context.createSnackbar : () => {
|
|
2622
2679
|
};
|
|
2623
2680
|
}
|
|
@@ -2642,17 +2699,17 @@ var paragraph_messages_default = (0, import_react_intl12.defineMessages)({
|
|
|
2642
2699
|
});
|
|
2643
2700
|
|
|
2644
2701
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
2645
|
-
var
|
|
2702
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
2646
2703
|
var ParagraphRenderer = {
|
|
2647
2704
|
canRenderType: "paragraph",
|
|
2648
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
2705
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Paragraph, __spreadValues({}, props))
|
|
2649
2706
|
};
|
|
2650
2707
|
function Paragraph({ align, control, margin, text }) {
|
|
2651
2708
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
2652
|
-
return control === "copyable" ? /* @__PURE__ */ (0,
|
|
2709
|
+
return control === "copyable" ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(StandardParagraph, { className, text });
|
|
2653
2710
|
}
|
|
2654
2711
|
function StandardParagraph({ text, className }) {
|
|
2655
|
-
return /* @__PURE__ */ (0,
|
|
2712
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: `np-text-body-large ${className}`, children: text });
|
|
2656
2713
|
}
|
|
2657
2714
|
function CopyableParagraph({
|
|
2658
2715
|
text,
|
|
@@ -2666,8 +2723,8 @@ function CopyableParagraph({
|
|
|
2666
2723
|
});
|
|
2667
2724
|
};
|
|
2668
2725
|
const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
|
|
2669
|
-
return /* @__PURE__ */ (0,
|
|
2670
|
-
/* @__PURE__ */ (0,
|
|
2726
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className, children: [
|
|
2727
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
2671
2728
|
import_components31.Input,
|
|
2672
2729
|
{
|
|
2673
2730
|
type: "text",
|
|
@@ -2676,7 +2733,7 @@ function CopyableParagraph({
|
|
|
2676
2733
|
className: (0, import_classnames5.default)("text-ellipsis", inputAlignmentClasses)
|
|
2677
2734
|
}
|
|
2678
2735
|
),
|
|
2679
|
-
/* @__PURE__ */ (0,
|
|
2736
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_components31.Button, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
2680
2737
|
] });
|
|
2681
2738
|
}
|
|
2682
2739
|
var ParagraphRenderer_default = ParagraphRenderer;
|
|
@@ -2685,7 +2742,7 @@ var ParagraphRenderer_default = ParagraphRenderer;
|
|
|
2685
2742
|
var import_components32 = require("@transferwise/components");
|
|
2686
2743
|
var import_icons = require("@transferwise/icons");
|
|
2687
2744
|
var import_classnames6 = __toESM(require("classnames"));
|
|
2688
|
-
var
|
|
2745
|
+
var import_react11 = require("react");
|
|
2689
2746
|
var import_react_intl15 = require("react-intl");
|
|
2690
2747
|
|
|
2691
2748
|
// ../renderers/src/messages/repeatable.messages.ts
|
|
@@ -2714,10 +2771,10 @@ var repeatable_messages_default = (0, import_react_intl14.defineMessages)({
|
|
|
2714
2771
|
});
|
|
2715
2772
|
|
|
2716
2773
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
2717
|
-
var
|
|
2774
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
2718
2775
|
var RepeatableRenderer = {
|
|
2719
2776
|
canRenderType: "repeatable",
|
|
2720
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
2777
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Repeatable, __spreadValues({}, props))
|
|
2721
2778
|
};
|
|
2722
2779
|
function Repeatable(props) {
|
|
2723
2780
|
const {
|
|
@@ -2734,7 +2791,7 @@ function Repeatable(props) {
|
|
|
2734
2791
|
onRemove
|
|
2735
2792
|
} = props;
|
|
2736
2793
|
const { formatMessage } = (0, import_react_intl15.useIntl)();
|
|
2737
|
-
const [openModalType, setOpenModalType] = (0,
|
|
2794
|
+
const [openModalType, setOpenModalType] = (0, import_react11.useState)(null);
|
|
2738
2795
|
const onAddItem = () => {
|
|
2739
2796
|
onAdd();
|
|
2740
2797
|
setOpenModalType("add");
|
|
@@ -2756,40 +2813,40 @@ function Repeatable(props) {
|
|
|
2756
2813
|
const onCancelEdit = () => {
|
|
2757
2814
|
setOpenModalType(null);
|
|
2758
2815
|
};
|
|
2759
|
-
return /* @__PURE__ */ (0,
|
|
2760
|
-
title && /* @__PURE__ */ (0,
|
|
2761
|
-
description && /* @__PURE__ */ (0,
|
|
2762
|
-
/* @__PURE__ */ (0,
|
|
2816
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [
|
|
2817
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components32.Header, { title }),
|
|
2818
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { children: description }),
|
|
2819
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
2763
2820
|
"div",
|
|
2764
2821
|
{
|
|
2765
2822
|
className: (0, import_classnames6.default)("form-group", {
|
|
2766
2823
|
"has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
|
|
2767
2824
|
}),
|
|
2768
2825
|
children: [
|
|
2769
|
-
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0,
|
|
2770
|
-
/* @__PURE__ */ (0,
|
|
2826
|
+
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
|
|
2827
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
2771
2828
|
import_components32.NavigationOption,
|
|
2772
2829
|
{
|
|
2773
|
-
media: /* @__PURE__ */ (0,
|
|
2830
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_icons.Plus, {}),
|
|
2774
2831
|
title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
|
|
2775
2832
|
showMediaAtAllSizes: true,
|
|
2776
2833
|
onClick: () => onAddItem()
|
|
2777
2834
|
}
|
|
2778
2835
|
),
|
|
2779
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0,
|
|
2836
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components32.InlineAlert, { type: "negative", children: validationState.message })
|
|
2780
2837
|
]
|
|
2781
2838
|
}
|
|
2782
2839
|
),
|
|
2783
|
-
/* @__PURE__ */ (0,
|
|
2840
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
2784
2841
|
import_components32.Modal,
|
|
2785
2842
|
{
|
|
2786
2843
|
open: openModalType !== null,
|
|
2787
2844
|
title: (openModalType === "add" ? addItemTitle : editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
|
|
2788
|
-
body: /* @__PURE__ */ (0,
|
|
2789
|
-
/* @__PURE__ */ (0,
|
|
2790
|
-
/* @__PURE__ */ (0,
|
|
2791
|
-
/* @__PURE__ */ (0,
|
|
2792
|
-
/* @__PURE__ */ (0,
|
|
2845
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [
|
|
2846
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "m-b-2", children: editableItem }),
|
|
2847
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { children: [
|
|
2848
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components32.Button, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
|
|
2849
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components32.Button, { priority: "secondary", type: "negative", block: true, onClick: () => onRemoveItem(), children: formatMessage(repeatable_messages_default.removeItem) })
|
|
2793
2850
|
] })
|
|
2794
2851
|
] }),
|
|
2795
2852
|
onClose: () => onCancelEdit()
|
|
@@ -2801,10 +2858,10 @@ function ItemSummaryOption({
|
|
|
2801
2858
|
item,
|
|
2802
2859
|
onClick
|
|
2803
2860
|
}) {
|
|
2804
|
-
return /* @__PURE__ */ (0,
|
|
2861
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
2805
2862
|
import_components32.NavigationOption,
|
|
2806
2863
|
{
|
|
2807
|
-
media: /* @__PURE__ */ (0,
|
|
2864
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(OptionMedia, { media: item.media, preferAvatar: false }),
|
|
2808
2865
|
title: item.title,
|
|
2809
2866
|
content: item.description,
|
|
2810
2867
|
showMediaAtAllSizes: true,
|
|
@@ -2839,14 +2896,14 @@ var getHeaderAction = (callToAction) => {
|
|
|
2839
2896
|
};
|
|
2840
2897
|
|
|
2841
2898
|
// ../renderers/src/ReviewRenderer.tsx
|
|
2842
|
-
var
|
|
2899
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
2843
2900
|
var ReviewRenderer = {
|
|
2844
2901
|
canRenderType: "review",
|
|
2845
2902
|
render: ({ callToAction, control, fields, margin, title, trackEvent }) => {
|
|
2846
2903
|
const orientation = mapControlToDefinitionListLayout(control);
|
|
2847
|
-
return /* @__PURE__ */ (0,
|
|
2848
|
-
(title || callToAction) && /* @__PURE__ */ (0,
|
|
2849
|
-
/* @__PURE__ */ (0,
|
|
2904
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: getMargin(margin), children: [
|
|
2905
|
+
(title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_components33.Header, { title: title != null ? title : "", action: getHeaderAction(callToAction) }),
|
|
2906
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
2850
2907
|
import_components33.DefinitionList,
|
|
2851
2908
|
{
|
|
2852
2909
|
layout: orientation,
|
|
@@ -2885,14 +2942,14 @@ var mapControlToDefinitionListLayout = (control) => {
|
|
|
2885
2942
|
};
|
|
2886
2943
|
var getFieldValue = (value, help, orientation, onClick) => {
|
|
2887
2944
|
if (help) {
|
|
2888
|
-
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ (0,
|
|
2889
|
-
/* @__PURE__ */ (0,
|
|
2945
|
+
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
|
|
2946
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Help_default, { help, onClick }),
|
|
2890
2947
|
" ",
|
|
2891
2948
|
value
|
|
2892
|
-
] }) : /* @__PURE__ */ (0,
|
|
2949
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
|
|
2893
2950
|
value,
|
|
2894
2951
|
" ",
|
|
2895
|
-
/* @__PURE__ */ (0,
|
|
2952
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Help_default, { help, onClick })
|
|
2896
2953
|
] });
|
|
2897
2954
|
}
|
|
2898
2955
|
return value;
|
|
@@ -2900,7 +2957,7 @@ var getFieldValue = (value, help, orientation, onClick) => {
|
|
|
2900
2957
|
|
|
2901
2958
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
2902
2959
|
var import_components35 = require("@transferwise/components");
|
|
2903
|
-
var
|
|
2960
|
+
var import_react12 = require("react");
|
|
2904
2961
|
var import_react_intl19 = require("react-intl");
|
|
2905
2962
|
|
|
2906
2963
|
// ../renderers/src/messages/search.messages.ts
|
|
@@ -2938,7 +2995,7 @@ var generic_error_messages_default = (0, import_react_intl17.defineMessages)({
|
|
|
2938
2995
|
|
|
2939
2996
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
2940
2997
|
var import_components34 = require("@transferwise/components");
|
|
2941
|
-
var
|
|
2998
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
2942
2999
|
function ErrorResult({ state }) {
|
|
2943
3000
|
const intl = (0, import_react_intl18.useIntl)();
|
|
2944
3001
|
const buttonVisualProps = {
|
|
@@ -2946,10 +3003,10 @@ function ErrorResult({ state }) {
|
|
|
2946
3003
|
size: "sm",
|
|
2947
3004
|
style: { marginTop: "-2px", padding: "0", width: "auto", display: "inline" }
|
|
2948
3005
|
};
|
|
2949
|
-
return /* @__PURE__ */ (0,
|
|
3006
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("p", { className: "m-t-2", children: [
|
|
2950
3007
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
2951
3008
|
"\xA0",
|
|
2952
|
-
/* @__PURE__ */ (0,
|
|
3009
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
2953
3010
|
import_components34.Button,
|
|
2954
3011
|
__spreadProps(__spreadValues({}, buttonVisualProps), {
|
|
2955
3012
|
onClick: () => {
|
|
@@ -2962,7 +3019,7 @@ function ErrorResult({ state }) {
|
|
|
2962
3019
|
}
|
|
2963
3020
|
|
|
2964
3021
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
2965
|
-
var
|
|
3022
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
2966
3023
|
function BlockSearchRendererComponent({
|
|
2967
3024
|
id,
|
|
2968
3025
|
isLoading,
|
|
@@ -2973,10 +3030,10 @@ function BlockSearchRendererComponent({
|
|
|
2973
3030
|
trackEvent,
|
|
2974
3031
|
onChange
|
|
2975
3032
|
}) {
|
|
2976
|
-
const [hasSearched, setHasSearched] = (0,
|
|
3033
|
+
const [hasSearched, setHasSearched] = (0, import_react12.useState)(false);
|
|
2977
3034
|
const { formatMessage } = (0, import_react_intl19.useIntl)();
|
|
2978
|
-
return /* @__PURE__ */ (0,
|
|
2979
|
-
/* @__PURE__ */ (0,
|
|
3035
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: getMargin(margin), children: [
|
|
3036
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
2980
3037
|
import_components35.Input,
|
|
2981
3038
|
{
|
|
2982
3039
|
id,
|
|
@@ -2993,7 +3050,7 @@ function BlockSearchRendererComponent({
|
|
|
2993
3050
|
}
|
|
2994
3051
|
}
|
|
2995
3052
|
) }),
|
|
2996
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
3053
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_jsx_runtime52.Fragment, { children: formatMessage(search_messages_default.loading) }) : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(SearchResultContent, { state, trackEvent })
|
|
2997
3054
|
] });
|
|
2998
3055
|
}
|
|
2999
3056
|
function SearchResultContent({
|
|
@@ -3002,26 +3059,26 @@ function SearchResultContent({
|
|
|
3002
3059
|
}) {
|
|
3003
3060
|
switch (state.type) {
|
|
3004
3061
|
case "error":
|
|
3005
|
-
return /* @__PURE__ */ (0,
|
|
3062
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ErrorResult, { state });
|
|
3006
3063
|
case "results":
|
|
3007
|
-
return /* @__PURE__ */ (0,
|
|
3064
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(SearchResults, { state, trackEvent });
|
|
3008
3065
|
case "noResults":
|
|
3009
|
-
return /* @__PURE__ */ (0,
|
|
3066
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(EmptySearchResult, { state });
|
|
3010
3067
|
case "pending":
|
|
3011
3068
|
default:
|
|
3012
3069
|
return null;
|
|
3013
3070
|
}
|
|
3014
3071
|
}
|
|
3015
3072
|
function EmptySearchResult({ state }) {
|
|
3016
|
-
return /* @__PURE__ */ (0,
|
|
3073
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components35.Markdown, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
3017
3074
|
}
|
|
3018
3075
|
function SearchResults({
|
|
3019
3076
|
state,
|
|
3020
3077
|
trackEvent
|
|
3021
3078
|
}) {
|
|
3022
|
-
return /* @__PURE__ */ (0,
|
|
3079
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components35.NavigationOptionsList, { children: state.results.map((result) => {
|
|
3023
3080
|
const { media } = result;
|
|
3024
|
-
return /* @__PURE__ */ (0,
|
|
3081
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
3025
3082
|
import_components35.NavigationOption,
|
|
3026
3083
|
{
|
|
3027
3084
|
title: result.title,
|
|
@@ -3045,9 +3102,9 @@ var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
|
|
|
3045
3102
|
// ../renderers/src/SearchRenderer/InlineSearchRendererComponent.tsx
|
|
3046
3103
|
var import_components36 = require("@transferwise/components");
|
|
3047
3104
|
var import_icons2 = require("@transferwise/icons");
|
|
3048
|
-
var
|
|
3105
|
+
var import_react13 = require("react");
|
|
3049
3106
|
var import_react_intl20 = require("react-intl");
|
|
3050
|
-
var
|
|
3107
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
3051
3108
|
function InlineSearchRenderer({
|
|
3052
3109
|
id,
|
|
3053
3110
|
isLoading,
|
|
@@ -3057,9 +3114,9 @@ function InlineSearchRenderer({
|
|
|
3057
3114
|
title,
|
|
3058
3115
|
trackEvent
|
|
3059
3116
|
}) {
|
|
3060
|
-
const [hasSearched, setHasSearched] = (0,
|
|
3117
|
+
const [hasSearched, setHasSearched] = (0, import_react13.useState)(false);
|
|
3061
3118
|
const intl = (0, import_react_intl20.useIntl)();
|
|
3062
|
-
return /* @__PURE__ */ (0,
|
|
3119
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
3063
3120
|
import_components36.Typeahead,
|
|
3064
3121
|
{
|
|
3065
3122
|
id: "typeahead-input-id",
|
|
@@ -3067,10 +3124,10 @@ function InlineSearchRenderer({
|
|
|
3067
3124
|
name: "typeahead-input-name",
|
|
3068
3125
|
size: "md",
|
|
3069
3126
|
maxHeight: 100,
|
|
3070
|
-
footer: /* @__PURE__ */ (0,
|
|
3127
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(TypeaheadFooter, { state, isLoading }),
|
|
3071
3128
|
multiple: false,
|
|
3072
3129
|
clearable: false,
|
|
3073
|
-
addon: /* @__PURE__ */ (0,
|
|
3130
|
+
addon: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_icons2.Search, { size: 24 }),
|
|
3074
3131
|
options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
|
|
3075
3132
|
minQueryLength: 1,
|
|
3076
3133
|
onChange: (values) => {
|
|
@@ -3107,34 +3164,34 @@ function mapResultToTypeaheadOption(result) {
|
|
|
3107
3164
|
function TypeaheadFooter({ state, isLoading }) {
|
|
3108
3165
|
const { formatMessage } = (0, import_react_intl20.useIntl)();
|
|
3109
3166
|
if (state.type === "noResults") {
|
|
3110
|
-
return /* @__PURE__ */ (0,
|
|
3167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components36.Markdown, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
3111
3168
|
}
|
|
3112
3169
|
if (state.type === "error") {
|
|
3113
|
-
return /* @__PURE__ */ (0,
|
|
3170
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ErrorResult, { state }) });
|
|
3114
3171
|
}
|
|
3115
3172
|
if (state.type === "pending" || isLoading) {
|
|
3116
|
-
return /* @__PURE__ */ (0,
|
|
3173
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "m-t-2 m-x-2", children: formatMessage(search_messages_default.loading) });
|
|
3117
3174
|
}
|
|
3118
3175
|
return null;
|
|
3119
3176
|
}
|
|
3120
3177
|
var InlineSearchRendererComponent_default = InlineSearchRenderer;
|
|
3121
3178
|
|
|
3122
3179
|
// ../renderers/src/SearchRenderer/SearchRenderer.tsx
|
|
3123
|
-
var
|
|
3180
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
3124
3181
|
var SearchRenderer = {
|
|
3125
3182
|
canRenderType: "search",
|
|
3126
|
-
render: (props) => props.control === "inline" ? /* @__PURE__ */ (0,
|
|
3183
|
+
render: (props) => props.control === "inline" ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(BlockSearchRendererComponent_default, __spreadValues({}, props))
|
|
3127
3184
|
};
|
|
3128
3185
|
var SearchRenderer_default = SearchRenderer;
|
|
3129
3186
|
|
|
3130
3187
|
// ../renderers/src/SectionRenderer.tsx
|
|
3131
3188
|
var import_components37 = require("@transferwise/components");
|
|
3132
|
-
var
|
|
3189
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
3133
3190
|
var SectionRenderer = {
|
|
3134
3191
|
canRenderType: "section",
|
|
3135
3192
|
render: ({ children, callToAction, margin, title }) => {
|
|
3136
|
-
return /* @__PURE__ */ (0,
|
|
3137
|
-
(title || callToAction) && /* @__PURE__ */ (0,
|
|
3193
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("section", { className: getMargin(margin), children: [
|
|
3194
|
+
(title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_components37.Header, { title: title != null ? title : "", action: getHeaderAction(callToAction) }),
|
|
3138
3195
|
children
|
|
3139
3196
|
] });
|
|
3140
3197
|
}
|
|
@@ -3143,7 +3200,7 @@ var SectionRenderer_default = SectionRenderer;
|
|
|
3143
3200
|
|
|
3144
3201
|
// ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
3145
3202
|
var import_components38 = require("@transferwise/components");
|
|
3146
|
-
var
|
|
3203
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
3147
3204
|
function RadioInputRendererComponent(props) {
|
|
3148
3205
|
const {
|
|
3149
3206
|
id,
|
|
@@ -3157,8 +3214,8 @@ function RadioInputRendererComponent(props) {
|
|
|
3157
3214
|
validationState,
|
|
3158
3215
|
onSelect
|
|
3159
3216
|
} = props;
|
|
3160
|
-
return /* @__PURE__ */ (0,
|
|
3161
|
-
/* @__PURE__ */ (0,
|
|
3217
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
|
|
3218
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
3162
3219
|
FieldInput_default,
|
|
3163
3220
|
{
|
|
3164
3221
|
id,
|
|
@@ -3166,7 +3223,7 @@ function RadioInputRendererComponent(props) {
|
|
|
3166
3223
|
help,
|
|
3167
3224
|
description,
|
|
3168
3225
|
validation: validationState,
|
|
3169
|
-
children: /* @__PURE__ */ (0,
|
|
3226
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
3170
3227
|
import_components38.RadioGroup,
|
|
3171
3228
|
{
|
|
3172
3229
|
name: id,
|
|
@@ -3175,7 +3232,7 @@ function RadioInputRendererComponent(props) {
|
|
|
3175
3232
|
value: index,
|
|
3176
3233
|
secondary: option.description,
|
|
3177
3234
|
disabled: option.disabled || disabled,
|
|
3178
|
-
avatar: /* @__PURE__ */ (0,
|
|
3235
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(OptionMedia, { media: option.media, preferAvatar: false })
|
|
3179
3236
|
})),
|
|
3180
3237
|
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
3181
3238
|
onChange: onSelect
|
|
@@ -3190,8 +3247,8 @@ function RadioInputRendererComponent(props) {
|
|
|
3190
3247
|
|
|
3191
3248
|
// ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
3192
3249
|
var import_components39 = require("@transferwise/components");
|
|
3193
|
-
var
|
|
3194
|
-
var
|
|
3250
|
+
var import_react14 = require("react");
|
|
3251
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
3195
3252
|
function TabInputRendererComponent(props) {
|
|
3196
3253
|
const {
|
|
3197
3254
|
id,
|
|
@@ -3205,13 +3262,13 @@ function TabInputRendererComponent(props) {
|
|
|
3205
3262
|
validationState,
|
|
3206
3263
|
onSelect
|
|
3207
3264
|
} = props;
|
|
3208
|
-
(0,
|
|
3265
|
+
(0, import_react14.useEffect)(() => {
|
|
3209
3266
|
if (!isValidIndex(selectedIndex, options.length)) {
|
|
3210
3267
|
onSelect(0);
|
|
3211
3268
|
}
|
|
3212
3269
|
}, [selectedIndex, onSelect, options.length]);
|
|
3213
|
-
return /* @__PURE__ */ (0,
|
|
3214
|
-
/* @__PURE__ */ (0,
|
|
3270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
|
|
3271
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
3215
3272
|
FieldInput_default,
|
|
3216
3273
|
{
|
|
3217
3274
|
id,
|
|
@@ -3219,7 +3276,7 @@ function TabInputRendererComponent(props) {
|
|
|
3219
3276
|
help,
|
|
3220
3277
|
description,
|
|
3221
3278
|
validation: validationState,
|
|
3222
|
-
children: /* @__PURE__ */ (0,
|
|
3279
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
3223
3280
|
import_components39.Tabs,
|
|
3224
3281
|
{
|
|
3225
3282
|
name: id,
|
|
@@ -3228,7 +3285,7 @@ function TabInputRendererComponent(props) {
|
|
|
3228
3285
|
title: option.title,
|
|
3229
3286
|
// if we pass null, we get some props-types console errors
|
|
3230
3287
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
3231
|
-
content: /* @__PURE__ */ (0,
|
|
3288
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_jsx_runtime57.Fragment, {}),
|
|
3232
3289
|
disabled: option.disabled || disabled
|
|
3233
3290
|
})),
|
|
3234
3291
|
onTabSelect: onSelect
|
|
@@ -3243,7 +3300,7 @@ var isValidIndex = (index, options) => index !== null && index >= 0 && index < o
|
|
|
3243
3300
|
|
|
3244
3301
|
// ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
3245
3302
|
var import_components40 = require("@transferwise/components");
|
|
3246
|
-
var
|
|
3303
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
3247
3304
|
function SelectInputRendererComponent(props) {
|
|
3248
3305
|
const {
|
|
3249
3306
|
id,
|
|
@@ -3283,13 +3340,13 @@ function SelectInputRendererComponent(props) {
|
|
|
3283
3340
|
} : {
|
|
3284
3341
|
title: option.title,
|
|
3285
3342
|
description: option.description,
|
|
3286
|
-
icon: /* @__PURE__ */ (0,
|
|
3343
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(OptionMedia, { media: option.media, preferAvatar: false })
|
|
3287
3344
|
};
|
|
3288
|
-
return /* @__PURE__ */ (0,
|
|
3345
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_components40.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
3289
3346
|
};
|
|
3290
3347
|
const extraProps = { autoComplete };
|
|
3291
|
-
return /* @__PURE__ */ (0,
|
|
3292
|
-
/* @__PURE__ */ (0,
|
|
3348
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_jsx_runtime58.Fragment, { children: [
|
|
3349
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
3293
3350
|
FieldInput_default,
|
|
3294
3351
|
{
|
|
3295
3352
|
id,
|
|
@@ -3297,7 +3354,7 @@ function SelectInputRendererComponent(props) {
|
|
|
3297
3354
|
help,
|
|
3298
3355
|
description,
|
|
3299
3356
|
validation: validationState,
|
|
3300
|
-
children: /* @__PURE__ */ (0,
|
|
3357
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
3301
3358
|
import_components40.SelectInput,
|
|
3302
3359
|
__spreadValues({
|
|
3303
3360
|
name: id,
|
|
@@ -3318,9 +3375,9 @@ function SelectInputRendererComponent(props) {
|
|
|
3318
3375
|
}
|
|
3319
3376
|
|
|
3320
3377
|
// ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
3321
|
-
var
|
|
3378
|
+
var import_react15 = require("react");
|
|
3322
3379
|
var import_components41 = require("@transferwise/components");
|
|
3323
|
-
var
|
|
3380
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
3324
3381
|
function SegmentedInputRendererComponent(props) {
|
|
3325
3382
|
const {
|
|
3326
3383
|
id,
|
|
@@ -3333,13 +3390,13 @@ function SegmentedInputRendererComponent(props) {
|
|
|
3333
3390
|
validationState,
|
|
3334
3391
|
onSelect
|
|
3335
3392
|
} = props;
|
|
3336
|
-
(0,
|
|
3393
|
+
(0, import_react15.useEffect)(() => {
|
|
3337
3394
|
if (!isValidIndex2(selectedIndex, options.length)) {
|
|
3338
3395
|
onSelect(0);
|
|
3339
3396
|
}
|
|
3340
3397
|
}, [selectedIndex, onSelect, options.length]);
|
|
3341
|
-
return /* @__PURE__ */ (0,
|
|
3342
|
-
/* @__PURE__ */ (0,
|
|
3398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_jsx_runtime59.Fragment, { children: [
|
|
3399
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
3343
3400
|
FieldInput_default,
|
|
3344
3401
|
{
|
|
3345
3402
|
id,
|
|
@@ -3347,7 +3404,7 @@ function SegmentedInputRendererComponent(props) {
|
|
|
3347
3404
|
help,
|
|
3348
3405
|
description,
|
|
3349
3406
|
validation: validationState,
|
|
3350
|
-
children: /* @__PURE__ */ (0,
|
|
3407
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
3351
3408
|
import_components41.SegmentedControl,
|
|
3352
3409
|
{
|
|
3353
3410
|
name: `${id}-segmented-control`,
|
|
@@ -3364,26 +3421,26 @@ function SegmentedInputRendererComponent(props) {
|
|
|
3364
3421
|
)
|
|
3365
3422
|
}
|
|
3366
3423
|
),
|
|
3367
|
-
/* @__PURE__ */ (0,
|
|
3424
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { id: `${id}-children`, children })
|
|
3368
3425
|
] });
|
|
3369
3426
|
}
|
|
3370
3427
|
var isValidIndex2 = (index, options) => index !== null && index >= 0 && index < options;
|
|
3371
3428
|
|
|
3372
3429
|
// ../renderers/src/SelectInputRenderer/SelectInputRenderer.tsx
|
|
3373
|
-
var
|
|
3430
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
3374
3431
|
var SelectInputRenderer = {
|
|
3375
3432
|
canRenderType: "input-select",
|
|
3376
3433
|
render: (props) => {
|
|
3377
3434
|
switch (props.control) {
|
|
3378
3435
|
case "radio":
|
|
3379
|
-
return /* @__PURE__ */ (0,
|
|
3436
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(RadioInputRendererComponent, __spreadValues({}, props));
|
|
3380
3437
|
case "tab":
|
|
3381
|
-
return props.options.length > 3 ? /* @__PURE__ */ (0,
|
|
3438
|
+
return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TabInputRendererComponent, __spreadValues({}, props));
|
|
3382
3439
|
case "segmented":
|
|
3383
|
-
return props.options.length > 3 ? /* @__PURE__ */ (0,
|
|
3440
|
+
return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(SegmentedInputRendererComponent, __spreadValues({}, props));
|
|
3384
3441
|
case "select":
|
|
3385
3442
|
default:
|
|
3386
|
-
return /* @__PURE__ */ (0,
|
|
3443
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(SelectInputRendererComponent, __spreadValues({}, props));
|
|
3387
3444
|
}
|
|
3388
3445
|
}
|
|
3389
3446
|
};
|
|
@@ -3391,17 +3448,17 @@ var SelectInputRenderer_default = SelectInputRenderer;
|
|
|
3391
3448
|
|
|
3392
3449
|
// ../renderers/src/StatusListRenderer.tsx
|
|
3393
3450
|
var import_components42 = require("@transferwise/components");
|
|
3394
|
-
var
|
|
3451
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
3395
3452
|
var StatusListRenderer = {
|
|
3396
3453
|
canRenderType: "status-list",
|
|
3397
|
-
render: ({ margin, items, title }) => /* @__PURE__ */ (0,
|
|
3398
|
-
title ? /* @__PURE__ */ (0,
|
|
3399
|
-
items.map(({ callToAction, description, icon, status, title: itemTitle }) => /* @__PURE__ */ (0,
|
|
3454
|
+
render: ({ margin, items, title }) => /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: getMargin(margin), children: [
|
|
3455
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_components42.Header, { title, className: "m-b-2" }) : null,
|
|
3456
|
+
items.map(({ callToAction, description, icon, status, title: itemTitle }) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
3400
3457
|
import_components42.Summary,
|
|
3401
3458
|
{
|
|
3402
3459
|
title: itemTitle,
|
|
3403
3460
|
description,
|
|
3404
|
-
icon: icon && "name" in icon ? /* @__PURE__ */ (0,
|
|
3461
|
+
icon: icon && "name" in icon ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(DynamicIcon_default, { name: icon.name }) : null,
|
|
3405
3462
|
status: mapStatus(status),
|
|
3406
3463
|
action: getSummaryAction(callToAction)
|
|
3407
3464
|
},
|
|
@@ -3438,12 +3495,12 @@ var mapStatus = (status) => {
|
|
|
3438
3495
|
|
|
3439
3496
|
// ../renderers/src/utils/useCustomTheme.ts
|
|
3440
3497
|
var import_components_theming = require("@wise/components-theming");
|
|
3441
|
-
var
|
|
3498
|
+
var import_react16 = require("react");
|
|
3442
3499
|
var ThemeRequiredEventName = "Theme Required";
|
|
3443
3500
|
var useCustomTheme = (theme, trackEvent) => {
|
|
3444
3501
|
const previousThemeHookValue = (0, import_components_theming.useTheme)();
|
|
3445
|
-
const previousTheme = (0,
|
|
3446
|
-
(0,
|
|
3502
|
+
const previousTheme = (0, import_react16.useMemo)(() => previousThemeHookValue.theme, []);
|
|
3503
|
+
(0, import_react16.useEffect)(() => {
|
|
3447
3504
|
trackEvent(ThemeRequiredEventName, { theme });
|
|
3448
3505
|
return theme !== previousTheme ? () => {
|
|
3449
3506
|
trackEvent(ThemeRequiredEventName, { theme: previousTheme });
|
|
@@ -3452,110 +3509,180 @@ var useCustomTheme = (theme, trackEvent) => {
|
|
|
3452
3509
|
}, []);
|
|
3453
3510
|
};
|
|
3454
3511
|
|
|
3455
|
-
// ../renderers/src/step/BackButton.tsx
|
|
3512
|
+
// ../renderers/src/step/topbar/BackButton.tsx
|
|
3456
3513
|
var import_components43 = require("@transferwise/components");
|
|
3457
3514
|
var import_icons3 = require("@transferwise/icons");
|
|
3458
|
-
var
|
|
3515
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
3459
3516
|
function BackButton({ title, onClick }) {
|
|
3460
|
-
return /* @__PURE__ */ (0,
|
|
3461
|
-
"
|
|
3517
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_components43.IconButton, { priority: "tertiary", onClick, children: [
|
|
3518
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "sr-only", children: title }),
|
|
3519
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_icons3.ArrowLeft, {})
|
|
3520
|
+
] });
|
|
3521
|
+
}
|
|
3522
|
+
|
|
3523
|
+
// ../renderers/src/step/topbar/Toolbar.tsx
|
|
3524
|
+
var import_components44 = require("@transferwise/components");
|
|
3525
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
3526
|
+
var Toolbar = ({ items }) => {
|
|
3527
|
+
return (items == null ? void 0 : items.length) > 0 ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "df-toolbar", children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(ToolbarButton, __spreadValues({}, item), `${item.type}-${index}-${item.title}`)) }) : null;
|
|
3528
|
+
};
|
|
3529
|
+
function ToolbarButton(props) {
|
|
3530
|
+
return prefersMedia(props.control) ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(MediaToolbarButton, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(TextToolbarButton, __spreadValues({}, props));
|
|
3531
|
+
}
|
|
3532
|
+
function MediaToolbarButton(props) {
|
|
3533
|
+
var _a;
|
|
3534
|
+
const { context, control, media, accessibilityDescription, disabled, onClick } = props;
|
|
3535
|
+
const priority = getPriority(control);
|
|
3536
|
+
const type = getSentiment(context);
|
|
3537
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
3538
|
+
import_components44.IconButton,
|
|
3462
3539
|
{
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3540
|
+
className: "df-toolbar-button",
|
|
3541
|
+
disabled,
|
|
3542
|
+
priority,
|
|
3543
|
+
size: 32,
|
|
3544
|
+
type,
|
|
3467
3545
|
onClick,
|
|
3468
3546
|
children: [
|
|
3469
|
-
/* @__PURE__ */ (0,
|
|
3470
|
-
|
|
3547
|
+
accessibilityDescription ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "sr-only", children: accessibilityDescription }) : null,
|
|
3548
|
+
media ? (_a = getAddonStart(media)) == null ? void 0 : _a.value : null
|
|
3471
3549
|
]
|
|
3472
3550
|
}
|
|
3473
|
-
)
|
|
3551
|
+
);
|
|
3552
|
+
}
|
|
3553
|
+
function TextToolbarButton(props) {
|
|
3554
|
+
const { context, control, title, media, disabled, onClick } = props;
|
|
3555
|
+
const addonStart = media ? getAddonStart(media) : void 0;
|
|
3556
|
+
const priority = getPriority(control);
|
|
3557
|
+
const sentiment = getSentiment(context);
|
|
3558
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
3559
|
+
import_components44.Button,
|
|
3560
|
+
{
|
|
3561
|
+
v2: true,
|
|
3562
|
+
size: "sm",
|
|
3563
|
+
className: "df-toolbar-button",
|
|
3564
|
+
disabled,
|
|
3565
|
+
priority,
|
|
3566
|
+
addonStart,
|
|
3567
|
+
sentiment,
|
|
3568
|
+
onClick,
|
|
3569
|
+
children: title
|
|
3570
|
+
}
|
|
3571
|
+
);
|
|
3572
|
+
}
|
|
3573
|
+
var getAddonStart = (media) => {
|
|
3574
|
+
if (media.type === "avatar") {
|
|
3575
|
+
if (media.content.length === 1) {
|
|
3576
|
+
if (media.content[0].type === "text") {
|
|
3577
|
+
return { type: "icon", value: media.content[0].text };
|
|
3578
|
+
}
|
|
3579
|
+
if (media.content[0].type === "uri" && isValidIconUrn(media.content[0].uri)) {
|
|
3580
|
+
const { asset, icon } = resolveUri(media.content[0].uri, 24);
|
|
3581
|
+
return { type: "icon", value: icon != null ? icon : asset };
|
|
3582
|
+
}
|
|
3583
|
+
}
|
|
3584
|
+
return void 0;
|
|
3585
|
+
}
|
|
3586
|
+
};
|
|
3587
|
+
var getPriority = (control) => isKnownControl(control) && control.startsWith("primary") ? "primary" : "secondary";
|
|
3588
|
+
var prefersMedia = (control) => isKnownControl(control) && control.endsWith("-prefers-media");
|
|
3589
|
+
var knownControls = ["primary", "primary-prefers-media", "secondary", "secondary-prefers-media"];
|
|
3590
|
+
var isKnownControl = (control) => control !== void 0 && knownControls.includes(control);
|
|
3591
|
+
var getSentiment = (context) => {
|
|
3592
|
+
return "default";
|
|
3593
|
+
};
|
|
3594
|
+
|
|
3595
|
+
// ../renderers/src/step/topbar/TopBar.tsx
|
|
3596
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
3597
|
+
function TopBar({ back, toolbar }) {
|
|
3598
|
+
return back || toolbar ? /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "d-flex m-b-2", children: [
|
|
3599
|
+
back ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(BackButton, __spreadValues({}, back)) : null,
|
|
3600
|
+
toolbar ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Toolbar, __spreadValues({}, toolbar)) : null
|
|
3601
|
+
] }) : null;
|
|
3474
3602
|
}
|
|
3475
|
-
var BackButton_default = BackButton;
|
|
3476
3603
|
|
|
3477
3604
|
// ../renderers/src/step/SplashCelebrationStepRenderer.tsx
|
|
3478
|
-
var
|
|
3605
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
3479
3606
|
var SplashCelebrationStepRenderer = {
|
|
3480
3607
|
canRenderType: "step",
|
|
3481
3608
|
canRender: ({ control }) => control === "splash-celebration",
|
|
3482
3609
|
render: SplashCelebrationStepRendererComponent
|
|
3483
3610
|
};
|
|
3484
3611
|
function SplashCelebrationStepRendererComponent(props) {
|
|
3485
|
-
const { back, children, trackEvent } = props;
|
|
3612
|
+
const { back, toolbar, children, trackEvent } = props;
|
|
3486
3613
|
useCustomTheme("forest-green", trackEvent);
|
|
3487
|
-
return /* @__PURE__ */ (0,
|
|
3488
|
-
|
|
3614
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "splash-screen m-t-5", children: [
|
|
3615
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(TopBar, { back, toolbar }),
|
|
3489
3616
|
children
|
|
3490
3617
|
] });
|
|
3491
3618
|
}
|
|
3492
3619
|
|
|
3493
3620
|
// ../renderers/src/step/SplashStepRenderer.tsx
|
|
3494
|
-
var
|
|
3621
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
3495
3622
|
var SplashStepRenderer = {
|
|
3496
3623
|
canRenderType: "step",
|
|
3497
3624
|
canRender: ({ control }) => control === "splash",
|
|
3498
3625
|
render: SplashStepRendererComponent
|
|
3499
3626
|
};
|
|
3500
3627
|
function SplashStepRendererComponent(props) {
|
|
3501
|
-
const { back, children } = props;
|
|
3502
|
-
return /* @__PURE__ */ (0,
|
|
3503
|
-
|
|
3628
|
+
const { back, toolbar, children } = props;
|
|
3629
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "splash-screen m-t-5", children: [
|
|
3630
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(TopBar, { back, toolbar }),
|
|
3504
3631
|
children
|
|
3505
3632
|
] });
|
|
3506
3633
|
}
|
|
3507
3634
|
|
|
3508
3635
|
// ../renderers/src/step/StepRenderer.tsx
|
|
3509
|
-
var
|
|
3510
|
-
var
|
|
3636
|
+
var import_components45 = require("@transferwise/components");
|
|
3637
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
3511
3638
|
var StepRenderer = {
|
|
3512
3639
|
canRenderType: "step",
|
|
3513
3640
|
render: StepRendererComponent
|
|
3514
3641
|
};
|
|
3515
3642
|
function StepRendererComponent(props) {
|
|
3516
|
-
const { back, description, error, title, children } = props;
|
|
3517
|
-
return /* @__PURE__ */ (0,
|
|
3518
|
-
|
|
3519
|
-
title || description ? /* @__PURE__ */ (0,
|
|
3520
|
-
title ? /* @__PURE__ */ (0,
|
|
3521
|
-
description ? /* @__PURE__ */ (0,
|
|
3643
|
+
const { back, description, error, title, children, toolbar } = props;
|
|
3644
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_jsx_runtime67.Fragment, { children: [
|
|
3645
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(TopBar, { back, toolbar }),
|
|
3646
|
+
title || description ? /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "m-b-4", children: [
|
|
3647
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_components45.Title, { as: "h1", type: "title-section", className: "text-xs-center m-b-2", children: title }) : void 0,
|
|
3648
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("p", { className: "text-xs-center np-text-body-large", children: description }) : void 0
|
|
3522
3649
|
] }) : void 0,
|
|
3523
|
-
error ? /* @__PURE__ */ (0,
|
|
3650
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_components45.Alert, { type: "negative", className: "m-b-2", message: error }) : void 0,
|
|
3524
3651
|
children
|
|
3525
3652
|
] });
|
|
3526
3653
|
}
|
|
3527
3654
|
|
|
3528
3655
|
// ../renderers/src/TabsRenderer.tsx
|
|
3529
|
-
var
|
|
3530
|
-
var
|
|
3531
|
-
var
|
|
3656
|
+
var import_components46 = require("@transferwise/components");
|
|
3657
|
+
var import_react17 = require("react");
|
|
3658
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
3532
3659
|
var TabsRenderer = {
|
|
3533
3660
|
canRenderType: "tabs",
|
|
3534
3661
|
render: (props) => {
|
|
3535
3662
|
switch (props.control) {
|
|
3536
3663
|
case "segmented":
|
|
3537
3664
|
if (props.tabs.length > 3) {
|
|
3538
|
-
return /* @__PURE__ */ (0,
|
|
3665
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(TabsRendererComponent, __spreadValues({}, props));
|
|
3539
3666
|
}
|
|
3540
|
-
return /* @__PURE__ */ (0,
|
|
3667
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(SegmentedTabsRendererComponent, __spreadValues({}, props));
|
|
3541
3668
|
case "chips":
|
|
3542
|
-
return /* @__PURE__ */ (0,
|
|
3669
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ChipsTabsRendererComponent, __spreadValues({}, props));
|
|
3543
3670
|
default:
|
|
3544
|
-
return /* @__PURE__ */ (0,
|
|
3671
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(TabsRendererComponent, __spreadValues({}, props));
|
|
3545
3672
|
}
|
|
3546
3673
|
}
|
|
3547
3674
|
};
|
|
3548
3675
|
function TabsRendererComponent({ uid, margin, tabs }) {
|
|
3549
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
3550
|
-
return /* @__PURE__ */ (0,
|
|
3551
|
-
|
|
3676
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react17.useState)(0);
|
|
3677
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
3678
|
+
import_components46.Tabs,
|
|
3552
3679
|
{
|
|
3553
3680
|
name: uid,
|
|
3554
3681
|
selected: selectedIndex != null ? selectedIndex : 0,
|
|
3555
3682
|
tabs: tabs.map((option) => ({
|
|
3556
3683
|
title: option.title,
|
|
3557
3684
|
disabled: false,
|
|
3558
|
-
content: /* @__PURE__ */ (0,
|
|
3685
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "m-t-2", children: [
|
|
3559
3686
|
" ",
|
|
3560
3687
|
option.children,
|
|
3561
3688
|
" "
|
|
@@ -3567,10 +3694,10 @@ function TabsRendererComponent({ uid, margin, tabs }) {
|
|
|
3567
3694
|
}
|
|
3568
3695
|
function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
|
|
3569
3696
|
var _a;
|
|
3570
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
3571
|
-
return /* @__PURE__ */ (0,
|
|
3572
|
-
/* @__PURE__ */ (0,
|
|
3573
|
-
|
|
3697
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react17.useState)(0);
|
|
3698
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: getMargin(margin), children: [
|
|
3699
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
3700
|
+
import_components46.SegmentedControl,
|
|
3574
3701
|
{
|
|
3575
3702
|
name: uid,
|
|
3576
3703
|
value: String(selectedIndex),
|
|
@@ -3584,31 +3711,31 @@ function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
|
|
|
3584
3711
|
onChange: (value) => setSelectedIndex(Number(value))
|
|
3585
3712
|
}
|
|
3586
3713
|
),
|
|
3587
|
-
/* @__PURE__ */ (0,
|
|
3714
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { id: `${uid}-children`, className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
3588
3715
|
] });
|
|
3589
3716
|
}
|
|
3590
3717
|
function ChipsTabsRendererComponent({ margin, tabs }) {
|
|
3591
3718
|
var _a;
|
|
3592
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
3593
|
-
return /* @__PURE__ */ (0,
|
|
3594
|
-
/* @__PURE__ */ (0,
|
|
3595
|
-
|
|
3719
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react17.useState)(0);
|
|
3720
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: getMargin(margin), children: [
|
|
3721
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "chips-container", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
3722
|
+
import_components46.Chips,
|
|
3596
3723
|
{
|
|
3597
3724
|
chips: tabs.map((tab, index) => ({ label: tab.title, value: index })),
|
|
3598
3725
|
selected: selectedIndex,
|
|
3599
3726
|
onChange: ({ selectedValue }) => setSelectedIndex(Number(selectedValue))
|
|
3600
3727
|
}
|
|
3601
3728
|
) }),
|
|
3602
|
-
/* @__PURE__ */ (0,
|
|
3729
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
3603
3730
|
] });
|
|
3604
3731
|
}
|
|
3605
3732
|
|
|
3606
3733
|
// ../renderers/src/TextInputRenderer.tsx
|
|
3607
|
-
var
|
|
3734
|
+
var import_components48 = require("@transferwise/components");
|
|
3608
3735
|
|
|
3609
3736
|
// ../renderers/src/components/VariableTextInput.tsx
|
|
3610
|
-
var
|
|
3611
|
-
var
|
|
3737
|
+
var import_components47 = require("@transferwise/components");
|
|
3738
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
3612
3739
|
var commonKeys = [
|
|
3613
3740
|
"autoComplete",
|
|
3614
3741
|
"autoCapitalize",
|
|
@@ -3627,12 +3754,12 @@ function VariableTextInput(inputProps) {
|
|
|
3627
3754
|
const commonProps = __spreadProps(__spreadValues({}, pick(inputProps, ...commonKeys)), { name: id });
|
|
3628
3755
|
switch (control) {
|
|
3629
3756
|
case "email":
|
|
3630
|
-
return /* @__PURE__ */ (0,
|
|
3757
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "email", onChange }));
|
|
3631
3758
|
case "password":
|
|
3632
|
-
return /* @__PURE__ */ (0,
|
|
3759
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "password", onChange }));
|
|
3633
3760
|
case "numeric": {
|
|
3634
3761
|
const numericProps = __spreadProps(__spreadValues({}, commonProps), { type: "number", onWheel });
|
|
3635
|
-
return /* @__PURE__ */ (0,
|
|
3762
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
3636
3763
|
TextInput,
|
|
3637
3764
|
__spreadProps(__spreadValues({}, numericProps), {
|
|
3638
3765
|
onChange: (newValue) => {
|
|
@@ -3643,21 +3770,21 @@ function VariableTextInput(inputProps) {
|
|
|
3643
3770
|
);
|
|
3644
3771
|
}
|
|
3645
3772
|
case "phone-number":
|
|
3646
|
-
return /* @__PURE__ */ (0,
|
|
3773
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_components47.PhoneNumberInput, __spreadProps(__spreadValues({ initialValue: value }, commonProps), { onChange }));
|
|
3647
3774
|
default: {
|
|
3648
|
-
return /* @__PURE__ */ (0,
|
|
3775
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "text", onChange }));
|
|
3649
3776
|
}
|
|
3650
3777
|
}
|
|
3651
3778
|
}
|
|
3652
3779
|
function TextInput(props) {
|
|
3653
3780
|
const _a = props, { control, displayFormat, onChange } = _a, commonProps = __objRest(_a, ["control", "displayFormat", "onChange"]);
|
|
3654
|
-
const InputWithPattern = control === "textarea" ?
|
|
3655
|
-
const InputWithoutPattern = control === "textarea" ?
|
|
3656
|
-
return displayFormat ? /* @__PURE__ */ (0,
|
|
3781
|
+
const InputWithPattern = control === "textarea" ? import_components47.TextareaWithDisplayFormat : import_components47.InputWithDisplayFormat;
|
|
3782
|
+
const InputWithoutPattern = control === "textarea" ? import_components47.TextArea : import_components47.Input;
|
|
3783
|
+
return displayFormat ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(InputWithPattern, __spreadProps(__spreadValues({ displayPattern: displayFormat }, commonProps), { onChange })) : /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(InputWithoutPattern, __spreadProps(__spreadValues({}, commonProps), { onChange: (e) => onChange(e.target.value) }));
|
|
3657
3784
|
}
|
|
3658
3785
|
|
|
3659
3786
|
// ../renderers/src/TextInputRenderer.tsx
|
|
3660
|
-
var
|
|
3787
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
3661
3788
|
var TextInputRenderer = {
|
|
3662
3789
|
canRenderType: "input-text",
|
|
3663
3790
|
render: (props) => {
|
|
@@ -3690,7 +3817,7 @@ var TextInputRenderer = {
|
|
|
3690
3817
|
}
|
|
3691
3818
|
}
|
|
3692
3819
|
});
|
|
3693
|
-
return /* @__PURE__ */ (0,
|
|
3820
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
3694
3821
|
FieldInput_default,
|
|
3695
3822
|
{
|
|
3696
3823
|
id,
|
|
@@ -3698,7 +3825,7 @@ var TextInputRenderer = {
|
|
|
3698
3825
|
description,
|
|
3699
3826
|
validation: validationState,
|
|
3700
3827
|
help,
|
|
3701
|
-
children: /* @__PURE__ */ (0,
|
|
3828
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_components48.InputGroup, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(VariableTextInput, __spreadValues({}, inputProps)) })
|
|
3702
3829
|
}
|
|
3703
3830
|
);
|
|
3704
3831
|
}
|
|
@@ -3706,13 +3833,13 @@ var TextInputRenderer = {
|
|
|
3706
3833
|
var TextInputRenderer_default = TextInputRenderer;
|
|
3707
3834
|
|
|
3708
3835
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
3709
|
-
var
|
|
3836
|
+
var import_components49 = require("@transferwise/components");
|
|
3710
3837
|
|
|
3711
3838
|
// ../renderers/src/utils/getRandomId.ts
|
|
3712
3839
|
var getRandomId = () => Math.random().toString(36).substring(2);
|
|
3713
3840
|
|
|
3714
3841
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
3715
|
-
var
|
|
3842
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
3716
3843
|
var UploadInputRenderer = {
|
|
3717
3844
|
canRenderType: "input-upload",
|
|
3718
3845
|
render: (props) => {
|
|
@@ -3728,15 +3855,15 @@ var UploadInputRenderer = {
|
|
|
3728
3855
|
};
|
|
3729
3856
|
return (
|
|
3730
3857
|
// We don't pass help here as there is no sensible place to display it
|
|
3731
|
-
/* @__PURE__ */ (0,
|
|
3858
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
3732
3859
|
UploadFieldInput_default,
|
|
3733
3860
|
{
|
|
3734
3861
|
id,
|
|
3735
3862
|
label: void 0,
|
|
3736
3863
|
description: void 0,
|
|
3737
3864
|
validation: validationState,
|
|
3738
|
-
children: /* @__PURE__ */ (0,
|
|
3739
|
-
|
|
3865
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
3866
|
+
import_components49.UploadInput,
|
|
3740
3867
|
{
|
|
3741
3868
|
id,
|
|
3742
3869
|
description,
|
|
@@ -3794,7 +3921,7 @@ var LargeUploadRenderer = {
|
|
|
3794
3921
|
};
|
|
3795
3922
|
const filetypes = acceptsToFileTypes(accepts);
|
|
3796
3923
|
const usAccept = filetypes === "*" ? "*" : filetypes.join(",");
|
|
3797
|
-
return /* @__PURE__ */ (0,
|
|
3924
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
3798
3925
|
FieldInput_default,
|
|
3799
3926
|
{
|
|
3800
3927
|
id,
|
|
@@ -3802,8 +3929,8 @@ var LargeUploadRenderer = {
|
|
|
3802
3929
|
description,
|
|
3803
3930
|
validation: validationState,
|
|
3804
3931
|
help,
|
|
3805
|
-
children: /* @__PURE__ */ (0,
|
|
3806
|
-
|
|
3932
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
3933
|
+
import_components49.Upload,
|
|
3807
3934
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
3808
3935
|
usAccept,
|
|
3809
3936
|
usDisabled: disabled,
|
|
@@ -3862,7 +3989,7 @@ var getWiseRenderers = () => [
|
|
|
3862
3989
|
// src/dynamicFlow/telemetry/app-version.ts
|
|
3863
3990
|
var appVersion = (
|
|
3864
3991
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
3865
|
-
typeof process !== "undefined" ? "4.
|
|
3992
|
+
typeof process !== "undefined" ? "4.23.0" : "0.0.0"
|
|
3866
3993
|
);
|
|
3867
3994
|
|
|
3868
3995
|
// src/dynamicFlow/telemetry/getLogEvent.ts
|
|
@@ -3917,12 +4044,12 @@ var messages_default = (0, import_react_intl21.defineMessages)({
|
|
|
3917
4044
|
});
|
|
3918
4045
|
|
|
3919
4046
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
3920
|
-
var
|
|
4047
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
3921
4048
|
var wiseRenderers = getWiseRenderers();
|
|
3922
4049
|
function DynamicFlowLegacy(props) {
|
|
3923
4050
|
const { customFetch = globalThis.fetch } = props;
|
|
3924
4051
|
const coreProps = __spreadProps(__spreadValues({}, props), { httpClient: customFetch });
|
|
3925
|
-
return /* @__PURE__ */ (0,
|
|
4052
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_dynamic_flow_client2.DynamicFlow, __spreadValues({}, coreProps));
|
|
3926
4053
|
}
|
|
3927
4054
|
function DynamicFlowRevamp(props) {
|
|
3928
4055
|
const {
|
|
@@ -3938,9 +4065,9 @@ function DynamicFlowRevamp(props) {
|
|
|
3938
4065
|
const { formatMessage } = (0, import_react_intl22.useIntl)();
|
|
3939
4066
|
const createSnackBar = useSnackBarIfAvailable();
|
|
3940
4067
|
const httpClient = useWiseHttpClient(customFetch);
|
|
3941
|
-
const mergedRenderers = (0,
|
|
3942
|
-
const logEvent = (0,
|
|
3943
|
-
const trackEvent = (0,
|
|
4068
|
+
const mergedRenderers = (0, import_react18.useMemo)(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
|
|
4069
|
+
const logEvent = (0, import_react18.useMemo)(() => getLogEvent(onLog), [onLog]);
|
|
4070
|
+
const trackEvent = (0, import_react18.useMemo)(
|
|
3944
4071
|
() => getTrackEvent(onEvent, onAnalytics, onThemeChange),
|
|
3945
4072
|
[onEvent, onAnalytics, onThemeChange]
|
|
3946
4073
|
);
|
|
@@ -3959,9 +4086,9 @@ function DynamicFlowRevamp(props) {
|
|
|
3959
4086
|
onLink,
|
|
3960
4087
|
onCopy
|
|
3961
4088
|
});
|
|
3962
|
-
return /* @__PURE__ */ (0,
|
|
4089
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { className, children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_dynamic_flow_client2.DynamicFlowCoreRevamp, __spreadValues({}, coreProps)) });
|
|
3963
4090
|
}
|
|
3964
|
-
var DynamicForm = (0,
|
|
4091
|
+
var DynamicForm = (0, import_react18.forwardRef)(function DynamicForm2(props, ref) {
|
|
3965
4092
|
const {
|
|
3966
4093
|
className = "",
|
|
3967
4094
|
customFetch = globalThis.fetch,
|
|
@@ -3975,9 +4102,9 @@ var DynamicForm = (0, import_react16.forwardRef)(function DynamicForm2(props, re
|
|
|
3975
4102
|
const { formatMessage } = (0, import_react_intl22.useIntl)();
|
|
3976
4103
|
const createSnackBar = useSnackBarIfAvailable();
|
|
3977
4104
|
const httpClient = useWiseHttpClient(customFetch);
|
|
3978
|
-
const mergedRenderers = (0,
|
|
3979
|
-
const logEvent = (0,
|
|
3980
|
-
const trackEvent = (0,
|
|
4105
|
+
const mergedRenderers = (0, import_react18.useMemo)(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
|
|
4106
|
+
const logEvent = (0, import_react18.useMemo)(() => getLogEvent(onLog), [onLog]);
|
|
4107
|
+
const trackEvent = (0, import_react18.useMemo)(
|
|
3981
4108
|
() => getTrackEvent(onEvent, onAnalytics, onThemeChange),
|
|
3982
4109
|
[onEvent, onAnalytics, onThemeChange]
|
|
3983
4110
|
);
|
|
@@ -3996,11 +4123,11 @@ var DynamicForm = (0, import_react16.forwardRef)(function DynamicForm2(props, re
|
|
|
3996
4123
|
onLink,
|
|
3997
4124
|
onCopy
|
|
3998
4125
|
});
|
|
3999
|
-
return /* @__PURE__ */ (0,
|
|
4126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { className, children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_dynamic_flow_client2.DynamicFormCore, __spreadProps(__spreadValues({}, coreProps), { ref })) });
|
|
4000
4127
|
});
|
|
4001
4128
|
var useWiseHttpClient = (httpClient) => {
|
|
4002
4129
|
const { locale } = (0, import_react_intl22.useIntl)();
|
|
4003
|
-
return (0,
|
|
4130
|
+
return (0, import_react18.useCallback)(
|
|
4004
4131
|
async (input, init = {}) => {
|
|
4005
4132
|
const headers = new Headers(init.headers);
|
|
4006
4133
|
headers.set("accept-language", locale);
|