@wise/dynamic-flow-client-internal 5.13.3 → 5.14.0-experimental-context-menu-version-6a043b0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/main.js
CHANGED
|
@@ -138,6 +138,12 @@ var import_dynamic_flow_client6 = require("@wise/dynamic-flow-client");
|
|
|
138
138
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
139
139
|
var import_dynamic_flow_client3 = require("@wise/dynamic-flow-client");
|
|
140
140
|
|
|
141
|
+
// src/dynamicFlow/telemetry/app-version.ts
|
|
142
|
+
var appVersion = (
|
|
143
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
144
|
+
typeof process !== "undefined" ? "5.13.4" : "0.0.0"
|
|
145
|
+
);
|
|
146
|
+
|
|
141
147
|
// src/dynamicFlow/context-menu/useContextMenu.tsx
|
|
142
148
|
var import_react = require("react");
|
|
143
149
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -200,15 +206,21 @@ var useDFContextMenu = (controller) => {
|
|
|
200
206
|
};
|
|
201
207
|
const getEncodedCurrentStep = () => {
|
|
202
208
|
const step = controller.getCurrentStep();
|
|
203
|
-
return step ? toBase64(JSON.stringify(step, null, 2)) : null;
|
|
209
|
+
return step ? toBase64(JSON.stringify(recursivelyRemoveNullUndefined(step), null, 2)) : null;
|
|
204
210
|
};
|
|
205
211
|
const getEncodedCurrentStepWithModel = async () => {
|
|
206
212
|
const step = await getCurrentStepWithModel();
|
|
207
|
-
return step ? toBase64(JSON.stringify(step, null, 2)) : null;
|
|
213
|
+
return step ? toBase64(JSON.stringify(recursivelyRemoveNullUndefined(step), null, 2)) : null;
|
|
208
214
|
};
|
|
209
215
|
return useContextMenu({
|
|
210
216
|
title: "DynamicFlow Menu (Dev/Staging only)",
|
|
211
217
|
items: isDevOrStaging() ? [
|
|
218
|
+
{
|
|
219
|
+
label: `DF client version: ${appVersion}`,
|
|
220
|
+
onClick: () => {
|
|
221
|
+
copyToClipboard(`@wise/dynamic-flow-client-internal@${appVersion}`);
|
|
222
|
+
}
|
|
223
|
+
},
|
|
212
224
|
{
|
|
213
225
|
label: "Open in Sandbox",
|
|
214
226
|
onClick: () => {
|
|
@@ -246,9 +258,13 @@ var openInSandbox = (base64Step) => {
|
|
|
246
258
|
window.open(`https://df.wise.com/sandbox#${base64Step}`, "_blank");
|
|
247
259
|
}
|
|
248
260
|
};
|
|
249
|
-
var copyToClipboard = (
|
|
250
|
-
if (
|
|
251
|
-
void navigator.clipboard.writeText(
|
|
261
|
+
var copyToClipboard = (value) => {
|
|
262
|
+
if (typeof value === "string") {
|
|
263
|
+
void navigator.clipboard.writeText(value);
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
if (value) {
|
|
267
|
+
void navigator.clipboard.writeText(JSON.stringify(value, null, 2));
|
|
252
268
|
}
|
|
253
269
|
};
|
|
254
270
|
var isDevOrStaging = () => {
|
|
@@ -268,16 +284,22 @@ var isDevOrStaging = () => {
|
|
|
268
284
|
return false;
|
|
269
285
|
}
|
|
270
286
|
};
|
|
287
|
+
var recursivelyRemoveNullUndefined = (element) => {
|
|
288
|
+
if (Array.isArray(element)) {
|
|
289
|
+
return element.map(recursivelyRemoveNullUndefined);
|
|
290
|
+
}
|
|
291
|
+
if (element !== null && typeof element === "object") {
|
|
292
|
+
return Object.entries(element).reduce(
|
|
293
|
+
(acc, [key, value]) => value !== null && value !== void 0 ? __spreadProps(__spreadValues({}, acc), { [key]: recursivelyRemoveNullUndefined(value) }) : acc,
|
|
294
|
+
{}
|
|
295
|
+
);
|
|
296
|
+
}
|
|
297
|
+
return element;
|
|
298
|
+
};
|
|
271
299
|
|
|
272
300
|
// src/dynamicFlow/useWiseToCoreProps.tsx
|
|
273
301
|
var import_react24 = require("react");
|
|
274
302
|
|
|
275
|
-
// src/dynamicFlow/telemetry/app-version.ts
|
|
276
|
-
var appVersion = (
|
|
277
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
278
|
-
typeof process !== "undefined" ? "5.13.3" : "0.0.0"
|
|
279
|
-
);
|
|
280
|
-
|
|
281
303
|
// src/dynamicFlow/telemetry/getLogEvent.ts
|
|
282
304
|
var getLogEvent = (onLog) => (level, message, extra) => {
|
|
283
305
|
const extraWithVersion = __spreadProps(__spreadValues({}, extra), {
|
|
@@ -453,7 +475,7 @@ function AddressValidationButtonComponent(props) {
|
|
|
453
475
|
block: true,
|
|
454
476
|
disabled,
|
|
455
477
|
priority: "primary",
|
|
456
|
-
size: "
|
|
478
|
+
size: "lg",
|
|
457
479
|
loading: spinny,
|
|
458
480
|
onClick: () => {
|
|
459
481
|
setSpinny(true);
|
|
@@ -3575,14 +3597,103 @@ var useCustomTheme = (theme, trackEvent) => {
|
|
|
3575
3597
|
}, []);
|
|
3576
3598
|
};
|
|
3577
3599
|
|
|
3578
|
-
// ../renderers/src/step/
|
|
3600
|
+
// ../renderers/src/step/StepFooter.tsx
|
|
3579
3601
|
var import_components53 = require("@transferwise/components");
|
|
3580
|
-
var
|
|
3602
|
+
var import_react19 = require("react");
|
|
3581
3603
|
var import_react_intl25 = require("react-intl");
|
|
3582
3604
|
|
|
3583
|
-
// ../renderers/src/messages/
|
|
3605
|
+
// ../renderers/src/messages/step.messages.ts
|
|
3584
3606
|
var import_react_intl24 = require("react-intl");
|
|
3585
|
-
var
|
|
3607
|
+
var step_messages_default = (0, import_react_intl24.defineMessages)({
|
|
3608
|
+
scrollToBottom: {
|
|
3609
|
+
id: "df.wise.step.scrollToBottom",
|
|
3610
|
+
defaultMessage: "Scroll to bottom",
|
|
3611
|
+
description: "Label for a button that appears when the content of a step is too long and the user needs to scroll to the bottom to see all the content."
|
|
3612
|
+
}
|
|
3613
|
+
});
|
|
3614
|
+
|
|
3615
|
+
// ../renderers/src/step/StepFooter.tsx
|
|
3616
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
3617
|
+
var SCROLL_TO_BOTTOM = "scroll-to-bottom";
|
|
3618
|
+
var StepFooter = ({ footer, tags }) => {
|
|
3619
|
+
if (tags == null ? void 0 : tags.includes(SCROLL_TO_BOTTOM)) {
|
|
3620
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(FooterWithScrollButton, { footer });
|
|
3621
|
+
}
|
|
3622
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(DefaultFooter, { footer });
|
|
3623
|
+
};
|
|
3624
|
+
var DefaultFooter = ({ footer }) => {
|
|
3625
|
+
const hasFooter = footer && Array.isArray(footer) && footer.length > 0;
|
|
3626
|
+
return hasFooter ? /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", { className: "df-step-fixed__footer", children: footer }) : void 0;
|
|
3627
|
+
};
|
|
3628
|
+
var FooterWithScrollButton = ({ footer }) => {
|
|
3629
|
+
const { formatMessage } = (0, import_react_intl25.useIntl)();
|
|
3630
|
+
const endOfLayoutRef = (0, import_react19.useRef)(null);
|
|
3631
|
+
const isElementVisible = useIsElementVisible(endOfLayoutRef);
|
|
3632
|
+
const scrollButton = /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
3633
|
+
import_components53.Button,
|
|
3634
|
+
{
|
|
3635
|
+
className: "m-b-1",
|
|
3636
|
+
v2: true,
|
|
3637
|
+
block: true,
|
|
3638
|
+
priority: "tertiary",
|
|
3639
|
+
onClick: () => {
|
|
3640
|
+
var _a;
|
|
3641
|
+
(_a = endOfLayoutRef.current) == null ? void 0 : _a.scrollIntoView({ behavior: "smooth" });
|
|
3642
|
+
},
|
|
3643
|
+
children: formatMessage(step_messages_default.scrollToBottom)
|
|
3644
|
+
}
|
|
3645
|
+
);
|
|
3646
|
+
const hasStepFooterContent = footer && Array.isArray(footer) && footer.length > 0;
|
|
3647
|
+
if (isElementVisible && !hasStepFooterContent) {
|
|
3648
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", { ref: endOfLayoutRef, "aria-hidden": "true" });
|
|
3649
|
+
}
|
|
3650
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_jsx_runtime76.Fragment, { children: [
|
|
3651
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", { ref: endOfLayoutRef, "aria-hidden": "true" }),
|
|
3652
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "df-step-fixed__footer", children: [
|
|
3653
|
+
!isElementVisible && scrollButton,
|
|
3654
|
+
footer
|
|
3655
|
+
] })
|
|
3656
|
+
] });
|
|
3657
|
+
};
|
|
3658
|
+
var useIsElementVisible = (elementRef) => {
|
|
3659
|
+
const [isVisible, setIsVisible] = (0, import_react19.useState)(false);
|
|
3660
|
+
(0, import_react19.useEffect)(() => {
|
|
3661
|
+
const element = elementRef.current;
|
|
3662
|
+
if (!element) return;
|
|
3663
|
+
const observer = new IntersectionObserver(([entry]) => {
|
|
3664
|
+
setIsVisible(entry.isIntersecting);
|
|
3665
|
+
});
|
|
3666
|
+
observer.observe(element);
|
|
3667
|
+
return () => observer.disconnect();
|
|
3668
|
+
}, [elementRef]);
|
|
3669
|
+
return isVisible;
|
|
3670
|
+
};
|
|
3671
|
+
|
|
3672
|
+
// ../renderers/src/step/StepHeader.tsx
|
|
3673
|
+
var import_components54 = require("@transferwise/components");
|
|
3674
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
3675
|
+
var StepHeader = ({ title, description, tags }) => {
|
|
3676
|
+
const { titleType, alignmentClassName } = getHeaderStyle(tags);
|
|
3677
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(import_jsx_runtime77.Fragment, { children: [
|
|
3678
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_components54.Title, { as: "h1", type: titleType, className: `${alignmentClassName} m-b-2`, children: title }) : void 0,
|
|
3679
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("p", { className: `${alignmentClassName} np-text-body-large`, children: description }) : void 0
|
|
3680
|
+
] });
|
|
3681
|
+
};
|
|
3682
|
+
var getHeaderStyle = (tags) => {
|
|
3683
|
+
if (tags == null ? void 0 : tags.includes("root-screen")) {
|
|
3684
|
+
return { titleType: "title-screen", alignmentClassName: "text-xs-left" };
|
|
3685
|
+
}
|
|
3686
|
+
return { titleType: "title-section", alignmentClassName: "text-xs-center" };
|
|
3687
|
+
};
|
|
3688
|
+
|
|
3689
|
+
// ../renderers/src/step/topbar/BackButton.tsx
|
|
3690
|
+
var import_components55 = require("@transferwise/components");
|
|
3691
|
+
var import_icons5 = require("@transferwise/icons");
|
|
3692
|
+
var import_react_intl27 = require("react-intl");
|
|
3693
|
+
|
|
3694
|
+
// ../renderers/src/messages/back.messages.ts
|
|
3695
|
+
var import_react_intl26 = require("react-intl");
|
|
3696
|
+
var back_messages_default = (0, import_react_intl26.defineMessages)({
|
|
3586
3697
|
back: {
|
|
3587
3698
|
id: "df.wise.back.label",
|
|
3588
3699
|
defaultMessage: "Back",
|
|
@@ -3591,31 +3702,31 @@ var back_messages_default = (0, import_react_intl24.defineMessages)({
|
|
|
3591
3702
|
});
|
|
3592
3703
|
|
|
3593
3704
|
// ../renderers/src/step/topbar/BackButton.tsx
|
|
3594
|
-
var
|
|
3705
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
3595
3706
|
function BackButton({ title, onClick }) {
|
|
3596
|
-
const { formatMessage } = (0,
|
|
3597
|
-
return /* @__PURE__ */ (0,
|
|
3598
|
-
/* @__PURE__ */ (0,
|
|
3599
|
-
/* @__PURE__ */ (0,
|
|
3707
|
+
const { formatMessage } = (0, import_react_intl27.useIntl)();
|
|
3708
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_components55.IconButton, { className: "df-back-button", priority: "tertiary", onClick, children: [
|
|
3709
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: "sr-only", children: title != null ? title : formatMessage(back_messages_default.back) }),
|
|
3710
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_icons5.ArrowLeft, {})
|
|
3600
3711
|
] });
|
|
3601
3712
|
}
|
|
3602
3713
|
|
|
3603
3714
|
// ../renderers/src/step/topbar/Toolbar.tsx
|
|
3604
|
-
var
|
|
3605
|
-
var
|
|
3715
|
+
var import_components56 = require("@transferwise/components");
|
|
3716
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
3606
3717
|
var Toolbar = ({ items }) => {
|
|
3607
|
-
return (items == null ? void 0 : items.length) > 0 ? /* @__PURE__ */ (0,
|
|
3718
|
+
return (items == null ? void 0 : items.length) > 0 ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "df-toolbar", children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(ToolbarButton, __spreadValues({}, item), `${item.type}-${index}-${item.title}`)) }) : null;
|
|
3608
3719
|
};
|
|
3609
3720
|
function ToolbarButton(props) {
|
|
3610
|
-
return prefersMedia(props.control) ? /* @__PURE__ */ (0,
|
|
3721
|
+
return prefersMedia(props.control) ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(MediaToolbarButton, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(TextToolbarButton, __spreadValues({}, props));
|
|
3611
3722
|
}
|
|
3612
3723
|
function MediaToolbarButton(props) {
|
|
3613
3724
|
var _a;
|
|
3614
3725
|
const { context, control, media, accessibilityDescription, disabled, onClick } = props;
|
|
3615
3726
|
const priority = getIconButtonPriority(control);
|
|
3616
3727
|
const type = getSentiment2(context);
|
|
3617
|
-
return /* @__PURE__ */ (0,
|
|
3618
|
-
|
|
3728
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(
|
|
3729
|
+
import_components56.IconButton,
|
|
3619
3730
|
{
|
|
3620
3731
|
className: "df-toolbar-button",
|
|
3621
3732
|
disabled,
|
|
@@ -3624,7 +3735,7 @@ function MediaToolbarButton(props) {
|
|
|
3624
3735
|
type,
|
|
3625
3736
|
onClick,
|
|
3626
3737
|
children: [
|
|
3627
|
-
accessibilityDescription ? /* @__PURE__ */ (0,
|
|
3738
|
+
accessibilityDescription ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: "sr-only", children: accessibilityDescription }) : null,
|
|
3628
3739
|
media ? (_a = getAddonStartMedia(media)) == null ? void 0 : _a.value : null
|
|
3629
3740
|
]
|
|
3630
3741
|
}
|
|
@@ -3635,8 +3746,8 @@ function TextToolbarButton(props) {
|
|
|
3635
3746
|
const addonStart = media ? getAddonStartMedia(media) : void 0;
|
|
3636
3747
|
const priority = getPriority2(control);
|
|
3637
3748
|
const sentiment = getSentiment2(context);
|
|
3638
|
-
return /* @__PURE__ */ (0,
|
|
3639
|
-
|
|
3749
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
3750
|
+
import_components56.Button,
|
|
3640
3751
|
{
|
|
3641
3752
|
v2: true,
|
|
3642
3753
|
size: "sm",
|
|
@@ -3665,140 +3776,51 @@ var getIconButtonPriority = (control) => {
|
|
|
3665
3776
|
};
|
|
3666
3777
|
|
|
3667
3778
|
// ../renderers/src/step/topbar/TopBar.tsx
|
|
3668
|
-
var
|
|
3779
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
3669
3780
|
function TopBar({ back, toolbar }) {
|
|
3670
|
-
return back || toolbar ? /* @__PURE__ */ (0,
|
|
3671
|
-
back ? /* @__PURE__ */ (0,
|
|
3672
|
-
toolbar ? /* @__PURE__ */ (0,
|
|
3781
|
+
return back || toolbar ? /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "d-flex m-b-2", children: [
|
|
3782
|
+
back ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(BackButton, __spreadValues({}, back)) : null,
|
|
3783
|
+
toolbar ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Toolbar, __spreadValues({}, toolbar)) : null
|
|
3673
3784
|
] }) : null;
|
|
3674
3785
|
}
|
|
3675
3786
|
|
|
3676
|
-
// ../renderers/src/step/StepFooter.tsx
|
|
3677
|
-
var import_components55 = require("@transferwise/components");
|
|
3678
|
-
var import_react19 = require("react");
|
|
3679
|
-
var import_react_intl27 = require("react-intl");
|
|
3680
|
-
|
|
3681
|
-
// ../renderers/src/messages/step.messages.ts
|
|
3682
|
-
var import_react_intl26 = require("react-intl");
|
|
3683
|
-
var step_messages_default = (0, import_react_intl26.defineMessages)({
|
|
3684
|
-
scrollToBottom: {
|
|
3685
|
-
id: "df.wise.step.scrollToBottom",
|
|
3686
|
-
defaultMessage: "Scroll to bottom",
|
|
3687
|
-
description: "Label for a button that appears when the content of a step is too long and the user needs to scroll to the bottom to see all the content."
|
|
3688
|
-
}
|
|
3689
|
-
});
|
|
3690
|
-
|
|
3691
|
-
// ../renderers/src/step/StepFooter.tsx
|
|
3692
|
-
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
3693
|
-
var SCROLL_TO_BOTTOM = "scroll-to-bottom";
|
|
3694
|
-
var StepFooter = ({ footer, tags }) => {
|
|
3695
|
-
if (tags == null ? void 0 : tags.includes(SCROLL_TO_BOTTOM)) {
|
|
3696
|
-
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(FooterWithScrollButton, { footer });
|
|
3697
|
-
}
|
|
3698
|
-
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(DefaultFooter, { footer });
|
|
3699
|
-
};
|
|
3700
|
-
var DefaultFooter = ({ footer }) => {
|
|
3701
|
-
const hasFooter = footer && Array.isArray(footer) && footer.length > 0;
|
|
3702
|
-
return hasFooter ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "df-step-fixed__footer", children: footer }) : void 0;
|
|
3703
|
-
};
|
|
3704
|
-
var FooterWithScrollButton = ({ footer }) => {
|
|
3705
|
-
const { formatMessage } = (0, import_react_intl27.useIntl)();
|
|
3706
|
-
const endOfLayoutRef = (0, import_react19.useRef)(null);
|
|
3707
|
-
const isElementVisible = useIsElementVisible(endOfLayoutRef);
|
|
3708
|
-
const scrollButton = /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
3709
|
-
import_components55.Button,
|
|
3710
|
-
{
|
|
3711
|
-
className: "m-b-1",
|
|
3712
|
-
v2: true,
|
|
3713
|
-
block: true,
|
|
3714
|
-
priority: "tertiary",
|
|
3715
|
-
onClick: () => {
|
|
3716
|
-
var _a;
|
|
3717
|
-
(_a = endOfLayoutRef.current) == null ? void 0 : _a.scrollIntoView({ behavior: "smooth" });
|
|
3718
|
-
},
|
|
3719
|
-
children: formatMessage(step_messages_default.scrollToBottom)
|
|
3720
|
-
}
|
|
3721
|
-
);
|
|
3722
|
-
const hasStepFooterContent = footer && Array.isArray(footer) && footer.length > 0;
|
|
3723
|
-
if (isElementVisible && !hasStepFooterContent) {
|
|
3724
|
-
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { ref: endOfLayoutRef, "aria-hidden": "true" });
|
|
3725
|
-
}
|
|
3726
|
-
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_jsx_runtime79.Fragment, { children: [
|
|
3727
|
-
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { ref: endOfLayoutRef, "aria-hidden": "true" }),
|
|
3728
|
-
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "df-step-fixed__footer", children: [
|
|
3729
|
-
!isElementVisible && scrollButton,
|
|
3730
|
-
footer
|
|
3731
|
-
] })
|
|
3732
|
-
] });
|
|
3733
|
-
};
|
|
3734
|
-
var useIsElementVisible = (elementRef) => {
|
|
3735
|
-
const [isVisible, setIsVisible] = (0, import_react19.useState)(false);
|
|
3736
|
-
(0, import_react19.useEffect)(() => {
|
|
3737
|
-
const element = elementRef.current;
|
|
3738
|
-
if (!element) return;
|
|
3739
|
-
const observer = new IntersectionObserver(([entry]) => {
|
|
3740
|
-
setIsVisible(entry.isIntersecting);
|
|
3741
|
-
});
|
|
3742
|
-
observer.observe(element);
|
|
3743
|
-
return () => observer.disconnect();
|
|
3744
|
-
}, [elementRef]);
|
|
3745
|
-
return isVisible;
|
|
3746
|
-
};
|
|
3747
|
-
|
|
3748
3787
|
// ../renderers/src/step/SplashCelebrationStepRenderer.tsx
|
|
3749
|
-
var
|
|
3788
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
3750
3789
|
var SplashCelebrationStepRenderer = {
|
|
3751
3790
|
canRenderType: "step",
|
|
3752
3791
|
canRender: ({ control }) => control === "splash-celebration",
|
|
3753
3792
|
render: SplashCelebrationStepRendererComponent
|
|
3754
3793
|
};
|
|
3755
3794
|
function SplashCelebrationStepRendererComponent(props) {
|
|
3756
|
-
const { back, toolbar, children, footer, tags, trackEvent } = props;
|
|
3795
|
+
const { back, title, description, toolbar, children, footer, tags, trackEvent } = props;
|
|
3757
3796
|
useCustomTheme("forest-green", trackEvent);
|
|
3758
|
-
return /* @__PURE__ */ (0,
|
|
3759
|
-
/* @__PURE__ */ (0,
|
|
3797
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "splash-screen m-t-5", children: [
|
|
3798
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(TopBar, { back, toolbar }),
|
|
3799
|
+
title || description ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "m-b-4", children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(StepHeader, { title, description, tags }) }) : void 0,
|
|
3760
3800
|
children,
|
|
3761
|
-
/* @__PURE__ */ (0,
|
|
3801
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(StepFooter, { footer, tags })
|
|
3762
3802
|
] });
|
|
3763
3803
|
}
|
|
3764
3804
|
|
|
3765
3805
|
// ../renderers/src/step/SplashStepRenderer.tsx
|
|
3766
|
-
var
|
|
3806
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
3767
3807
|
var SplashStepRenderer = {
|
|
3768
3808
|
canRenderType: "step",
|
|
3769
3809
|
canRender: ({ control }) => control === "splash",
|
|
3770
3810
|
render: SplashStepRendererComponent
|
|
3771
3811
|
};
|
|
3772
3812
|
function SplashStepRendererComponent(props) {
|
|
3773
|
-
const { back, toolbar, children, footer, tags } = props;
|
|
3774
|
-
return /* @__PURE__ */ (0,
|
|
3775
|
-
/* @__PURE__ */ (0,
|
|
3813
|
+
const { back, title, description, toolbar, children, footer, tags } = props;
|
|
3814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "splash-screen m-t-5", children: [
|
|
3815
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(TopBar, { back, toolbar }),
|
|
3816
|
+
title || description ? /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: "m-b-4", children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(StepHeader, { title, description, tags }) }) : void 0,
|
|
3776
3817
|
children,
|
|
3777
|
-
/* @__PURE__ */ (0,
|
|
3818
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(StepFooter, { footer, tags })
|
|
3778
3819
|
] });
|
|
3779
3820
|
}
|
|
3780
3821
|
|
|
3781
3822
|
// ../renderers/src/step/StepRenderer.tsx
|
|
3782
3823
|
var import_components57 = require("@transferwise/components");
|
|
3783
|
-
|
|
3784
|
-
// ../renderers/src/step/StepHeader.tsx
|
|
3785
|
-
var import_components56 = require("@transferwise/components");
|
|
3786
|
-
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
3787
|
-
var StepHeader = ({ title, description, tags }) => {
|
|
3788
|
-
const { titleType, alignmentClassName } = getHeaderStyle(tags);
|
|
3789
|
-
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(import_jsx_runtime82.Fragment, { children: [
|
|
3790
|
-
title ? /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_components56.Title, { as: "h1", type: titleType, className: `${alignmentClassName} m-b-2`, children: title }) : void 0,
|
|
3791
|
-
description ? /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("p", { className: `${alignmentClassName} np-text-body-large`, children: description }) : void 0
|
|
3792
|
-
] });
|
|
3793
|
-
};
|
|
3794
|
-
var getHeaderStyle = (tags) => {
|
|
3795
|
-
if (tags == null ? void 0 : tags.includes("root-screen")) {
|
|
3796
|
-
return { titleType: "title-screen", alignmentClassName: "text-xs-left" };
|
|
3797
|
-
}
|
|
3798
|
-
return { titleType: "title-section", alignmentClassName: "text-xs-center" };
|
|
3799
|
-
};
|
|
3800
|
-
|
|
3801
|
-
// ../renderers/src/step/StepRenderer.tsx
|
|
3802
3824
|
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
3803
3825
|
var StepRenderer = {
|
|
3804
3826
|
canRenderType: "step",
|