@wise/dynamic-flow-client-internal 4.11.2 → 4.12.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
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
"df.wise.ArraySchema.editItem": "Uložit",
|
|
5
5
|
"df.wise.ArraySchema.maxItemsError": "Přidejte {maxItems} nebo méně.",
|
|
6
6
|
"df.wise.ArraySchema.minItemsError": "Přidejte alespoň {minItems}.",
|
|
7
|
-
"df.wise.ArraySchema.removeItem": "
|
|
7
|
+
"df.wise.ArraySchema.removeItem": "Odebrat",
|
|
8
8
|
"df.wise.ControlFeedback.maxLength": "Zadejte {maxLength} nebo méně znaků.",
|
|
9
9
|
"df.wise.ControlFeedback.maximum": "Zadejte číslo, které je {maximum} nebo menší.",
|
|
10
|
-
"df.wise.ControlFeedback.maximumDate": "Zadejte datum, které je
|
|
11
|
-
"df.wise.ControlFeedback.minLength": "Zadejte alespoň {minLength}
|
|
12
|
-
"df.wise.ControlFeedback.minimum": "Zadejte číslo, které je {minimum} nebo
|
|
13
|
-
"df.wise.ControlFeedback.minimumDate": "Zadejte datum, které je
|
|
10
|
+
"df.wise.ControlFeedback.maximumDate": "Zadejte datum, které je {maximum} nebo předtím.",
|
|
11
|
+
"df.wise.ControlFeedback.minLength": "Zadejte alespoň následující počet znaků: {minLength}.",
|
|
12
|
+
"df.wise.ControlFeedback.minimum": "Zadejte číslo, které je {minimum} nebo vyšší.",
|
|
13
|
+
"df.wise.ControlFeedback.minimumDate": "Zadejte datum, které je {minimum} nebo potom.",
|
|
14
14
|
"df.wise.ControlFeedback.pattern": "Zadejte to prosím ve správném formátu.",
|
|
15
15
|
"df.wise.ControlFeedback.patternDate": "Zadejte prosím datum ve správném formátu.",
|
|
16
16
|
"df.wise.ControlFeedback.required": "Vyplňte prosím toto pole.",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"df.wise.ExternalConfirmation.open": "Otevřít v nové kartě",
|
|
25
25
|
"df.wise.ExternalConfirmation.title": "Potvrďte",
|
|
26
26
|
"df.wise.Help.ariaLabel": "Pro více informací klikněte sem.",
|
|
27
|
-
"df.wise.MultiSelect.summary": "{first} a {count}
|
|
28
|
-
"df.wise.MultipleFileUploadSchema.maxFileSizeError": "
|
|
27
|
+
"df.wise.MultiSelect.summary": "{first} a {count} další(ch)",
|
|
28
|
+
"df.wise.MultipleFileUploadSchema.maxFileSizeError": "Je nám líto, ale tento soubor je příliš velký. Nahrajte prosím menší soubor.",
|
|
29
29
|
"df.wise.MultipleFileUploadSchema.maxItemsError": "Nahrajte {maxItems} nebo méně souborů.",
|
|
30
|
-
"df.wise.MultipleFileUploadSchema.minItemsError": "Nahrajte prosím alespoň {minItems}
|
|
31
|
-
"df.wise.PersistAsyncSchema.genericError": "Něco se pokazilo.
|
|
30
|
+
"df.wise.MultipleFileUploadSchema.minItemsError": "Nahrajte prosím alespoň následující počet souborů: {minItems}.",
|
|
31
|
+
"df.wise.PersistAsyncSchema.genericError": "Něco se pokazilo. Zkuste to prosím znovu.",
|
|
32
32
|
"df.wise.SearchLayout.loading": "Načítání..."
|
|
33
33
|
}
|
package/build/main.js
CHANGED
|
@@ -665,7 +665,7 @@ var translations = languages.reduce(
|
|
|
665
665
|
var i18n_default = translations;
|
|
666
666
|
|
|
667
667
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
668
|
-
var
|
|
668
|
+
var import_react13 = require("react");
|
|
669
669
|
var import_react_intl16 = require("react-intl");
|
|
670
670
|
var import_dynamic_flow_client2 = require("@wise/dynamic-flow-client");
|
|
671
671
|
|
|
@@ -854,27 +854,39 @@ var BoxRenderer_default = BoxRenderer;
|
|
|
854
854
|
|
|
855
855
|
// ../renderers/src/ButtonRenderer.tsx
|
|
856
856
|
var import_components5 = require("@transferwise/components");
|
|
857
|
+
var import_react = require("react");
|
|
857
858
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
858
859
|
var ButtonRenderer = {
|
|
859
860
|
canRenderType: "button",
|
|
860
|
-
render:
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
861
|
+
render: ButtonComponent
|
|
862
|
+
};
|
|
863
|
+
function ButtonComponent(props) {
|
|
864
|
+
const { control, context, disabled, margin, title, size, stepLoadingState, onClick } = props;
|
|
865
|
+
const [isActive, setActive] = (0, import_react.useState)(false);
|
|
866
|
+
const isLoading = isActive && stepLoadingState !== "idle";
|
|
867
|
+
const priority = mapControl(control);
|
|
868
|
+
const type = priority === "tertiary" ? void 0 : mapContext(context);
|
|
869
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
870
|
+
import_components5.Button,
|
|
871
|
+
{
|
|
872
|
+
block: true,
|
|
873
|
+
className: getMargin(margin),
|
|
874
|
+
disabled: isLoading ? false : disabled,
|
|
875
|
+
priority,
|
|
876
|
+
size: mapSize(size),
|
|
877
|
+
loading: isLoading,
|
|
878
|
+
type,
|
|
879
|
+
onClick: () => {
|
|
880
|
+
setActive(true);
|
|
881
|
+
onClick();
|
|
882
|
+
},
|
|
883
|
+
onBlur: () => {
|
|
884
|
+
setActive(false);
|
|
885
|
+
},
|
|
886
|
+
children: title
|
|
887
|
+
}
|
|
888
|
+
);
|
|
889
|
+
}
|
|
878
890
|
var mapContext = (context) => {
|
|
879
891
|
switch (context) {
|
|
880
892
|
case "neutral":
|
|
@@ -1279,7 +1291,7 @@ var HeadingRenderer_default = HeadingRenderer;
|
|
|
1279
1291
|
|
|
1280
1292
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
1281
1293
|
var import_components12 = require("@transferwise/components");
|
|
1282
|
-
var
|
|
1294
|
+
var import_react2 = require("react");
|
|
1283
1295
|
|
|
1284
1296
|
// ../renderers/src/utils/api-utils.ts
|
|
1285
1297
|
function isRelativePath(url = "") {
|
|
@@ -1298,8 +1310,8 @@ function UrlImage({
|
|
|
1298
1310
|
uri,
|
|
1299
1311
|
httpClient
|
|
1300
1312
|
}) {
|
|
1301
|
-
const [imageSource, setImageSource] = (0,
|
|
1302
|
-
(0,
|
|
1313
|
+
const [imageSource, setImageSource] = (0, import_react2.useState)("");
|
|
1314
|
+
(0, import_react2.useEffect)(() => {
|
|
1303
1315
|
if (!uri.startsWith("urn:")) {
|
|
1304
1316
|
void getImageSource(httpClient, uri).then(setImageSource);
|
|
1305
1317
|
}
|
|
@@ -1571,13 +1583,13 @@ var import_components17 = require("@transferwise/components");
|
|
|
1571
1583
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1572
1584
|
var MarkdownRenderer = {
|
|
1573
1585
|
canRenderType: "markdown",
|
|
1574
|
-
render: ({ content, align, margin }) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_components17.Markdown, { config: { link: { target: "_blank" } }, children: content }) })
|
|
1586
|
+
render: ({ content, align, margin }) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_components17.Markdown, { className: "np-text-body-large", config: { link: { target: "_blank" } }, children: content }) })
|
|
1575
1587
|
};
|
|
1576
1588
|
var MarkdownRenderer_default = MarkdownRenderer;
|
|
1577
1589
|
|
|
1578
1590
|
// ../renderers/src/ModalRenderer.tsx
|
|
1579
1591
|
var import_components18 = require("@transferwise/components");
|
|
1580
|
-
var
|
|
1592
|
+
var import_react3 = require("react");
|
|
1581
1593
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1582
1594
|
var ModalRenderer = {
|
|
1583
1595
|
canRenderType: "modal",
|
|
@@ -1585,7 +1597,7 @@ var ModalRenderer = {
|
|
|
1585
1597
|
};
|
|
1586
1598
|
var ModalRenderer_default = ModalRenderer;
|
|
1587
1599
|
function DFModal({ content, margin, trigger }) {
|
|
1588
|
-
const [visible, setVisible] = (0,
|
|
1600
|
+
const [visible, setVisible] = (0, import_react3.useState)(false);
|
|
1589
1601
|
const { children, title } = content;
|
|
1590
1602
|
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: getMargin(margin), children: [
|
|
1591
1603
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_components18.Button, { priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
|
|
@@ -1605,7 +1617,7 @@ function DFModal({ content, margin, trigger }) {
|
|
|
1605
1617
|
|
|
1606
1618
|
// ../renderers/src/MultiSelectInputRenderer.tsx
|
|
1607
1619
|
var import_components19 = require("@transferwise/components");
|
|
1608
|
-
var
|
|
1620
|
+
var import_react4 = require("react");
|
|
1609
1621
|
var import_react_intl4 = require("react-intl");
|
|
1610
1622
|
|
|
1611
1623
|
// ../renderers/src/messages/multi-select.messages.ts
|
|
@@ -1626,7 +1638,7 @@ var MultiSelectInputRenderer = {
|
|
|
1626
1638
|
};
|
|
1627
1639
|
function MultiSelectInputRendererComponent(props) {
|
|
1628
1640
|
const { formatMessage } = (0, import_react_intl4.useIntl)();
|
|
1629
|
-
const [stagedIndices, setStagedIndices] = (0,
|
|
1641
|
+
const [stagedIndices, setStagedIndices] = (0, import_react4.useState)();
|
|
1630
1642
|
const {
|
|
1631
1643
|
id,
|
|
1632
1644
|
autoComplete,
|
|
@@ -1874,9 +1886,9 @@ var import_react_intl6 = require("react-intl");
|
|
|
1874
1886
|
|
|
1875
1887
|
// ../renderers/src/hooks/useSnackBarIfAvailable.ts
|
|
1876
1888
|
var import_components23 = require("@transferwise/components");
|
|
1877
|
-
var
|
|
1889
|
+
var import_react5 = require("react");
|
|
1878
1890
|
function useSnackBarIfAvailable() {
|
|
1879
|
-
const context = (0,
|
|
1891
|
+
const context = (0, import_react5.useContext)(import_components23.SnackbarContext);
|
|
1880
1892
|
return context ? context.createSnackbar : () => {
|
|
1881
1893
|
};
|
|
1882
1894
|
}
|
|
@@ -1944,7 +1956,7 @@ var ParagraphRenderer_default = ParagraphRenderer;
|
|
|
1944
1956
|
var import_components25 = require("@transferwise/components");
|
|
1945
1957
|
var import_icons = require("@transferwise/icons");
|
|
1946
1958
|
var import_classnames5 = __toESM(require("classnames"));
|
|
1947
|
-
var
|
|
1959
|
+
var import_react6 = require("react");
|
|
1948
1960
|
var import_react_intl8 = require("react-intl");
|
|
1949
1961
|
|
|
1950
1962
|
// ../renderers/src/messages/repeatable.messages.ts
|
|
@@ -1993,7 +2005,7 @@ function Repeatable(props) {
|
|
|
1993
2005
|
onRemove
|
|
1994
2006
|
} = props;
|
|
1995
2007
|
const { formatMessage } = (0, import_react_intl8.useIntl)();
|
|
1996
|
-
const [openModalType, setOpenModalType] = (0,
|
|
2008
|
+
const [openModalType, setOpenModalType] = (0, import_react6.useState)(null);
|
|
1997
2009
|
const onAddItem = () => {
|
|
1998
2010
|
onAdd();
|
|
1999
2011
|
setOpenModalType("add");
|
|
@@ -2075,7 +2087,7 @@ var RepeatableRenderer_default = RepeatableRenderer;
|
|
|
2075
2087
|
|
|
2076
2088
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
2077
2089
|
var import_components27 = require("@transferwise/components");
|
|
2078
|
-
var
|
|
2090
|
+
var import_react7 = require("react");
|
|
2079
2091
|
var import_react_intl12 = require("react-intl");
|
|
2080
2092
|
|
|
2081
2093
|
// ../renderers/src/messages/search.messages.ts
|
|
@@ -2148,7 +2160,7 @@ function BlockSearchRendererComponent({
|
|
|
2148
2160
|
trackEvent,
|
|
2149
2161
|
onChange
|
|
2150
2162
|
}) {
|
|
2151
|
-
const [hasSearched, setHasSearched] = (0,
|
|
2163
|
+
const [hasSearched, setHasSearched] = (0, import_react7.useState)(false);
|
|
2152
2164
|
const { formatMessage } = (0, import_react_intl12.useIntl)();
|
|
2153
2165
|
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: getMargin(margin), children: [
|
|
2154
2166
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
@@ -2220,7 +2232,7 @@ var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
|
|
|
2220
2232
|
// ../renderers/src/SearchRenderer/InlineSearchRendererComponent.tsx
|
|
2221
2233
|
var import_components28 = require("@transferwise/components");
|
|
2222
2234
|
var import_icons2 = require("@transferwise/icons");
|
|
2223
|
-
var
|
|
2235
|
+
var import_react8 = require("react");
|
|
2224
2236
|
var import_react_intl13 = require("react-intl");
|
|
2225
2237
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2226
2238
|
function InlineSearchRenderer({
|
|
@@ -2232,7 +2244,7 @@ function InlineSearchRenderer({
|
|
|
2232
2244
|
title,
|
|
2233
2245
|
trackEvent
|
|
2234
2246
|
}) {
|
|
2235
|
-
const [hasSearched, setHasSearched] = (0,
|
|
2247
|
+
const [hasSearched, setHasSearched] = (0, import_react8.useState)(false);
|
|
2236
2248
|
const intl = (0, import_react_intl13.useIntl)();
|
|
2237
2249
|
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2238
2250
|
import_components28.Typeahead,
|
|
@@ -2351,7 +2363,7 @@ function RadioInputRendererComponent(props) {
|
|
|
2351
2363
|
|
|
2352
2364
|
// ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
2353
2365
|
var import_components30 = require("@transferwise/components");
|
|
2354
|
-
var
|
|
2366
|
+
var import_react9 = require("react");
|
|
2355
2367
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
2356
2368
|
function TabInputRendererComponent(props) {
|
|
2357
2369
|
const {
|
|
@@ -2366,7 +2378,7 @@ function TabInputRendererComponent(props) {
|
|
|
2366
2378
|
validationState,
|
|
2367
2379
|
onSelect
|
|
2368
2380
|
} = props;
|
|
2369
|
-
(0,
|
|
2381
|
+
(0, import_react9.useEffect)(() => {
|
|
2370
2382
|
if (!isValidIndex(selectedIndex, options.length)) {
|
|
2371
2383
|
onSelect(0);
|
|
2372
2384
|
}
|
|
@@ -2479,7 +2491,7 @@ function SelectInputRendererComponent(props) {
|
|
|
2479
2491
|
}
|
|
2480
2492
|
|
|
2481
2493
|
// ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
2482
|
-
var
|
|
2494
|
+
var import_react10 = require("react");
|
|
2483
2495
|
var import_components32 = require("@transferwise/components");
|
|
2484
2496
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
2485
2497
|
function SegmentedInputRendererComponent(props) {
|
|
@@ -2494,7 +2506,7 @@ function SegmentedInputRendererComponent(props) {
|
|
|
2494
2506
|
validationState,
|
|
2495
2507
|
onSelect
|
|
2496
2508
|
} = props;
|
|
2497
|
-
(0,
|
|
2509
|
+
(0, import_react10.useEffect)(() => {
|
|
2498
2510
|
if (!isValidIndex2(selectedIndex, options.length)) {
|
|
2499
2511
|
onSelect(0);
|
|
2500
2512
|
}
|
|
@@ -3010,12 +3022,12 @@ function SplashStepRendererComponent(props) {
|
|
|
3010
3022
|
|
|
3011
3023
|
// ../renderers/src/utils/useCustomTheme.ts
|
|
3012
3024
|
var import_components_theming = require("@wise/components-theming");
|
|
3013
|
-
var
|
|
3025
|
+
var import_react11 = require("react");
|
|
3014
3026
|
var ThemeRequiredEventName = "Theme Required";
|
|
3015
3027
|
var useCustomTheme = (theme, trackEvent) => {
|
|
3016
3028
|
const previousThemeHookValue = (0, import_components_theming.useTheme)();
|
|
3017
|
-
const previousTheme = (0,
|
|
3018
|
-
(0,
|
|
3029
|
+
const previousTheme = (0, import_react11.useMemo)(() => previousThemeHookValue.theme, []);
|
|
3030
|
+
(0, import_react11.useEffect)(() => {
|
|
3019
3031
|
trackEvent(ThemeRequiredEventName, { theme });
|
|
3020
3032
|
return theme !== previousTheme ? () => {
|
|
3021
3033
|
trackEvent(ThemeRequiredEventName, { theme: previousTheme });
|
|
@@ -3070,7 +3082,7 @@ var external_confirmation_messages_default = (0, import_react_intl14.defineMessa
|
|
|
3070
3082
|
|
|
3071
3083
|
// ../renderers/src/ExternalConfirmationRenderer.tsx
|
|
3072
3084
|
var import_react_intl15 = require("react-intl");
|
|
3073
|
-
var
|
|
3085
|
+
var import_react12 = require("react");
|
|
3074
3086
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
3075
3087
|
var ExternalConfirmationRenderer = {
|
|
3076
3088
|
canRenderType: "external-confirmation",
|
|
@@ -3084,7 +3096,7 @@ function ExternalConfirmationRendererComponent({
|
|
|
3084
3096
|
onCancel
|
|
3085
3097
|
}) {
|
|
3086
3098
|
const { formatMessage } = (0, import_react_intl15.useIntl)();
|
|
3087
|
-
(0,
|
|
3099
|
+
(0, import_react12.useEffect)(() => {
|
|
3088
3100
|
if (url) {
|
|
3089
3101
|
const w = window.open(url, "_blank");
|
|
3090
3102
|
if (w) {
|
|
@@ -3181,7 +3193,7 @@ var ModalContentRenderer = {
|
|
|
3181
3193
|
};
|
|
3182
3194
|
|
|
3183
3195
|
// src/dynamicFlow/telemetry/app-version.ts
|
|
3184
|
-
var appVersion = "4.
|
|
3196
|
+
var appVersion = "4.12.0";
|
|
3185
3197
|
|
|
3186
3198
|
// src/dynamicFlow/telemetry/getLogEvent.ts
|
|
3187
3199
|
var getLogEvent = (onLog) => (level, message, extra) => {
|
|
@@ -3238,12 +3250,12 @@ function DynamicFlowRevamp(props) {
|
|
|
3238
3250
|
onThemeChange
|
|
3239
3251
|
} = props;
|
|
3240
3252
|
const httpClient = useWiseHttpClient(customFetch);
|
|
3241
|
-
const mergedRenderers = (0,
|
|
3253
|
+
const mergedRenderers = (0, import_react13.useMemo)(
|
|
3242
3254
|
() => [ModalContentRenderer, ...renderers != null ? renderers : [], ...wiseRenderers],
|
|
3243
3255
|
[renderers]
|
|
3244
3256
|
);
|
|
3245
|
-
const logEvent = (0,
|
|
3246
|
-
const trackEvent = (0,
|
|
3257
|
+
const logEvent = (0, import_react13.useMemo)(() => getLogEvent(onLog), [onLog]);
|
|
3258
|
+
const trackEvent = (0, import_react13.useMemo)(
|
|
3247
3259
|
() => getTrackEvent(onEvent, onAnalytics, onThemeChange),
|
|
3248
3260
|
[onEvent, onAnalytics, onThemeChange]
|
|
3249
3261
|
);
|
|
@@ -3256,7 +3268,7 @@ function DynamicFlowRevamp(props) {
|
|
|
3256
3268
|
});
|
|
3257
3269
|
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_dynamic_flow_client2.DynamicFlowCoreRevamp, __spreadValues({}, coreProps));
|
|
3258
3270
|
}
|
|
3259
|
-
var DynamicForm = (0,
|
|
3271
|
+
var DynamicForm = (0, import_react13.forwardRef)(function DynamicForm2(props, ref) {
|
|
3260
3272
|
const {
|
|
3261
3273
|
customFetch = globalThis.fetch,
|
|
3262
3274
|
renderers,
|
|
@@ -3267,12 +3279,12 @@ var DynamicForm = (0, import_react12.forwardRef)(function DynamicForm2(props, re
|
|
|
3267
3279
|
onThemeChange
|
|
3268
3280
|
} = props;
|
|
3269
3281
|
const httpClient = useWiseHttpClient(customFetch);
|
|
3270
|
-
const mergedRenderers = (0,
|
|
3282
|
+
const mergedRenderers = (0, import_react13.useMemo)(
|
|
3271
3283
|
() => [ModalContentRenderer, ...renderers != null ? renderers : [], ...wiseRenderers],
|
|
3272
3284
|
[renderers]
|
|
3273
3285
|
);
|
|
3274
|
-
const logEvent = (0,
|
|
3275
|
-
const trackEvent = (0,
|
|
3286
|
+
const logEvent = (0, import_react13.useMemo)(() => getLogEvent(onLog), [onLog]);
|
|
3287
|
+
const trackEvent = (0, import_react13.useMemo)(
|
|
3276
3288
|
() => getTrackEvent(onEvent, onAnalytics, onThemeChange),
|
|
3277
3289
|
[onEvent, onAnalytics, onThemeChange]
|
|
3278
3290
|
);
|
|
@@ -3287,11 +3299,16 @@ var DynamicForm = (0, import_react12.forwardRef)(function DynamicForm2(props, re
|
|
|
3287
3299
|
});
|
|
3288
3300
|
var useWiseHttpClient = (httpClient) => {
|
|
3289
3301
|
const { locale } = (0, import_react_intl16.useIntl)();
|
|
3290
|
-
return (0,
|
|
3302
|
+
return (0, import_react13.useCallback)(
|
|
3291
3303
|
async (input, init = {}) => {
|
|
3292
3304
|
const headers = new Headers(init.headers);
|
|
3293
3305
|
headers.set("accept-language", locale);
|
|
3294
|
-
return httpClient(input, __spreadProps(__spreadValues({}, init), { credentials: "include", headers }))
|
|
3306
|
+
return httpClient(input, __spreadProps(__spreadValues({}, init), { credentials: "include", headers })).catch((error) => {
|
|
3307
|
+
if (error instanceof Error && error.message === "SCA_MODAL_CLOSED") {
|
|
3308
|
+
return new Response(JSON.stringify({ validation: {} }), { status: 400 });
|
|
3309
|
+
}
|
|
3310
|
+
throw error;
|
|
3311
|
+
});
|
|
3295
3312
|
},
|
|
3296
3313
|
[httpClient, locale]
|
|
3297
3314
|
);
|
package/build/main.mjs
CHANGED
|
@@ -820,27 +820,39 @@ var BoxRenderer_default = BoxRenderer;
|
|
|
820
820
|
|
|
821
821
|
// ../renderers/src/ButtonRenderer.tsx
|
|
822
822
|
import { Button } from "@transferwise/components";
|
|
823
|
+
import { useState } from "react";
|
|
823
824
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
824
825
|
var ButtonRenderer = {
|
|
825
826
|
canRenderType: "button",
|
|
826
|
-
render:
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
827
|
+
render: ButtonComponent
|
|
828
|
+
};
|
|
829
|
+
function ButtonComponent(props) {
|
|
830
|
+
const { control, context, disabled, margin, title, size, stepLoadingState, onClick } = props;
|
|
831
|
+
const [isActive, setActive] = useState(false);
|
|
832
|
+
const isLoading = isActive && stepLoadingState !== "idle";
|
|
833
|
+
const priority = mapControl(control);
|
|
834
|
+
const type = priority === "tertiary" ? void 0 : mapContext(context);
|
|
835
|
+
return /* @__PURE__ */ jsx7(
|
|
836
|
+
Button,
|
|
837
|
+
{
|
|
838
|
+
block: true,
|
|
839
|
+
className: getMargin(margin),
|
|
840
|
+
disabled: isLoading ? false : disabled,
|
|
841
|
+
priority,
|
|
842
|
+
size: mapSize(size),
|
|
843
|
+
loading: isLoading,
|
|
844
|
+
type,
|
|
845
|
+
onClick: () => {
|
|
846
|
+
setActive(true);
|
|
847
|
+
onClick();
|
|
848
|
+
},
|
|
849
|
+
onBlur: () => {
|
|
850
|
+
setActive(false);
|
|
851
|
+
},
|
|
852
|
+
children: title
|
|
853
|
+
}
|
|
854
|
+
);
|
|
855
|
+
}
|
|
844
856
|
var mapContext = (context) => {
|
|
845
857
|
switch (context) {
|
|
846
858
|
case "neutral":
|
|
@@ -1245,7 +1257,7 @@ var HeadingRenderer_default = HeadingRenderer;
|
|
|
1245
1257
|
|
|
1246
1258
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
1247
1259
|
import { Image } from "@transferwise/components";
|
|
1248
|
-
import { useEffect, useState } from "react";
|
|
1260
|
+
import { useEffect, useState as useState2 } from "react";
|
|
1249
1261
|
|
|
1250
1262
|
// ../renderers/src/utils/api-utils.ts
|
|
1251
1263
|
function isRelativePath(url = "") {
|
|
@@ -1264,7 +1276,7 @@ function UrlImage({
|
|
|
1264
1276
|
uri,
|
|
1265
1277
|
httpClient
|
|
1266
1278
|
}) {
|
|
1267
|
-
const [imageSource, setImageSource] =
|
|
1279
|
+
const [imageSource, setImageSource] = useState2("");
|
|
1268
1280
|
useEffect(() => {
|
|
1269
1281
|
if (!uri.startsWith("urn:")) {
|
|
1270
1282
|
void getImageSource(httpClient, uri).then(setImageSource);
|
|
@@ -1541,13 +1553,13 @@ import { Markdown as Markdown2 } from "@transferwise/components";
|
|
|
1541
1553
|
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
1542
1554
|
var MarkdownRenderer = {
|
|
1543
1555
|
canRenderType: "markdown",
|
|
1544
|
-
render: ({ content, align, margin }) => /* @__PURE__ */ jsx31("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ jsx31(Markdown2, { config: { link: { target: "_blank" } }, children: content }) })
|
|
1556
|
+
render: ({ content, align, margin }) => /* @__PURE__ */ jsx31("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ jsx31(Markdown2, { className: "np-text-body-large", config: { link: { target: "_blank" } }, children: content }) })
|
|
1545
1557
|
};
|
|
1546
1558
|
var MarkdownRenderer_default = MarkdownRenderer;
|
|
1547
1559
|
|
|
1548
1560
|
// ../renderers/src/ModalRenderer.tsx
|
|
1549
1561
|
import { Button as Button2, Modal } from "@transferwise/components";
|
|
1550
|
-
import { useState as
|
|
1562
|
+
import { useState as useState3 } from "react";
|
|
1551
1563
|
import { jsx as jsx32, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1552
1564
|
var ModalRenderer = {
|
|
1553
1565
|
canRenderType: "modal",
|
|
@@ -1555,7 +1567,7 @@ var ModalRenderer = {
|
|
|
1555
1567
|
};
|
|
1556
1568
|
var ModalRenderer_default = ModalRenderer;
|
|
1557
1569
|
function DFModal({ content, margin, trigger }) {
|
|
1558
|
-
const [visible, setVisible] =
|
|
1570
|
+
const [visible, setVisible] = useState3(false);
|
|
1559
1571
|
const { children, title } = content;
|
|
1560
1572
|
return /* @__PURE__ */ jsxs6("div", { className: getMargin(margin), children: [
|
|
1561
1573
|
/* @__PURE__ */ jsx32(Button2, { priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
|
|
@@ -1575,7 +1587,7 @@ function DFModal({ content, margin, trigger }) {
|
|
|
1575
1587
|
|
|
1576
1588
|
// ../renderers/src/MultiSelectInputRenderer.tsx
|
|
1577
1589
|
import { SelectInput, SelectInputOptionContent } from "@transferwise/components";
|
|
1578
|
-
import { useState as
|
|
1590
|
+
import { useState as useState4 } from "react";
|
|
1579
1591
|
import { useIntl as useIntl2 } from "react-intl";
|
|
1580
1592
|
|
|
1581
1593
|
// ../renderers/src/messages/multi-select.messages.ts
|
|
@@ -1596,7 +1608,7 @@ var MultiSelectInputRenderer = {
|
|
|
1596
1608
|
};
|
|
1597
1609
|
function MultiSelectInputRendererComponent(props) {
|
|
1598
1610
|
const { formatMessage } = useIntl2();
|
|
1599
|
-
const [stagedIndices, setStagedIndices] =
|
|
1611
|
+
const [stagedIndices, setStagedIndices] = useState4();
|
|
1600
1612
|
const {
|
|
1601
1613
|
id,
|
|
1602
1614
|
autoComplete,
|
|
@@ -1914,7 +1926,7 @@ var ParagraphRenderer_default = ParagraphRenderer;
|
|
|
1914
1926
|
import { Button as Button4, Header as Header4, InlineAlert as InlineAlert2, Modal as Modal2, NavigationOption as NavigationOption2 } from "@transferwise/components";
|
|
1915
1927
|
import { Plus } from "@transferwise/icons";
|
|
1916
1928
|
import classNames5 from "classnames";
|
|
1917
|
-
import { useState as
|
|
1929
|
+
import { useState as useState5 } from "react";
|
|
1918
1930
|
import { useIntl as useIntl4 } from "react-intl";
|
|
1919
1931
|
|
|
1920
1932
|
// ../renderers/src/messages/repeatable.messages.ts
|
|
@@ -1963,7 +1975,7 @@ function Repeatable(props) {
|
|
|
1963
1975
|
onRemove
|
|
1964
1976
|
} = props;
|
|
1965
1977
|
const { formatMessage } = useIntl4();
|
|
1966
|
-
const [openModalType, setOpenModalType] =
|
|
1978
|
+
const [openModalType, setOpenModalType] = useState5(null);
|
|
1967
1979
|
const onAddItem = () => {
|
|
1968
1980
|
onAdd();
|
|
1969
1981
|
setOpenModalType("add");
|
|
@@ -2045,7 +2057,7 @@ var RepeatableRenderer_default = RepeatableRenderer;
|
|
|
2045
2057
|
|
|
2046
2058
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
2047
2059
|
import { Input as Input4, Markdown as Markdown3, NavigationOption as NavigationOption3, NavigationOptionsList as NavigationOptionsList2 } from "@transferwise/components";
|
|
2048
|
-
import { useState as
|
|
2060
|
+
import { useState as useState6 } from "react";
|
|
2049
2061
|
import { useIntl as useIntl6 } from "react-intl";
|
|
2050
2062
|
|
|
2051
2063
|
// ../renderers/src/messages/search.messages.ts
|
|
@@ -2118,7 +2130,7 @@ function BlockSearchRendererComponent({
|
|
|
2118
2130
|
trackEvent,
|
|
2119
2131
|
onChange
|
|
2120
2132
|
}) {
|
|
2121
|
-
const [hasSearched, setHasSearched] =
|
|
2133
|
+
const [hasSearched, setHasSearched] = useState6(false);
|
|
2122
2134
|
const { formatMessage } = useIntl6();
|
|
2123
2135
|
return /* @__PURE__ */ jsxs11("div", { className: getMargin(margin), children: [
|
|
2124
2136
|
/* @__PURE__ */ jsx40(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ jsx40(
|
|
@@ -2190,7 +2202,7 @@ var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
|
|
|
2190
2202
|
// ../renderers/src/SearchRenderer/InlineSearchRendererComponent.tsx
|
|
2191
2203
|
import { Markdown as Markdown4, Typeahead } from "@transferwise/components";
|
|
2192
2204
|
import { Search } from "@transferwise/icons";
|
|
2193
|
-
import { useState as
|
|
2205
|
+
import { useState as useState7 } from "react";
|
|
2194
2206
|
import { useIntl as useIntl7 } from "react-intl";
|
|
2195
2207
|
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
2196
2208
|
function InlineSearchRenderer({
|
|
@@ -2202,7 +2214,7 @@ function InlineSearchRenderer({
|
|
|
2202
2214
|
title,
|
|
2203
2215
|
trackEvent
|
|
2204
2216
|
}) {
|
|
2205
|
-
const [hasSearched, setHasSearched] =
|
|
2217
|
+
const [hasSearched, setHasSearched] = useState7(false);
|
|
2206
2218
|
const intl = useIntl7();
|
|
2207
2219
|
return /* @__PURE__ */ jsx41("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx41(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ jsx41(
|
|
2208
2220
|
Typeahead,
|
|
@@ -3157,7 +3169,7 @@ var ModalContentRenderer = {
|
|
|
3157
3169
|
};
|
|
3158
3170
|
|
|
3159
3171
|
// src/dynamicFlow/telemetry/app-version.ts
|
|
3160
|
-
var appVersion = "4.
|
|
3172
|
+
var appVersion = "4.12.0";
|
|
3161
3173
|
|
|
3162
3174
|
// src/dynamicFlow/telemetry/getLogEvent.ts
|
|
3163
3175
|
var getLogEvent = (onLog) => (level, message, extra) => {
|
|
@@ -3267,7 +3279,12 @@ var useWiseHttpClient = (httpClient) => {
|
|
|
3267
3279
|
async (input, init = {}) => {
|
|
3268
3280
|
const headers = new Headers(init.headers);
|
|
3269
3281
|
headers.set("accept-language", locale);
|
|
3270
|
-
return httpClient(input, __spreadProps(__spreadValues({}, init), { credentials: "include", headers }))
|
|
3282
|
+
return httpClient(input, __spreadProps(__spreadValues({}, init), { credentials: "include", headers })).catch((error) => {
|
|
3283
|
+
if (error instanceof Error && error.message === "SCA_MODAL_CLOSED") {
|
|
3284
|
+
return new Response(JSON.stringify({ validation: {} }), { status: 400 });
|
|
3285
|
+
}
|
|
3286
|
+
throw error;
|
|
3287
|
+
});
|
|
3271
3288
|
},
|
|
3272
3289
|
[httpClient, locale]
|
|
3273
3290
|
);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DynamicFlowRevamp } from '../index';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
component: typeof DynamicFlowRevamp;
|
|
4
|
+
title: string;
|
|
5
|
+
parameters: {
|
|
6
|
+
chromatic: {
|
|
7
|
+
disableSnapshot: boolean;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
12
|
+
export declare function SCAIntegration(): import("react/jsx-runtime").JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wise/dynamic-flow-client-internal",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.12.0",
|
|
4
4
|
"description": "Dynamic Flow web client for Wise",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./build/main.js",
|
|
@@ -30,14 +30,14 @@
|
|
|
30
30
|
"url": "git+https://github.com/transferwise/dynamic-flow.git"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@babel/core": "7.
|
|
34
|
-
"@babel/plugin-syntax-flow": "7.
|
|
35
|
-
"@babel/plugin-transform-react-jsx": "7.
|
|
36
|
-
"@babel/preset-env": "7.
|
|
37
|
-
"@babel/preset-react": "7.
|
|
38
|
-
"@babel/preset-typescript": "7.27.
|
|
33
|
+
"@babel/core": "7.27.1",
|
|
34
|
+
"@babel/plugin-syntax-flow": "7.27.1",
|
|
35
|
+
"@babel/plugin-transform-react-jsx": "7.27.1",
|
|
36
|
+
"@babel/preset-env": "7.27.2",
|
|
37
|
+
"@babel/preset-react": "7.27.1",
|
|
38
|
+
"@babel/preset-typescript": "7.27.1",
|
|
39
39
|
"@chromatic-com/storybook": "3.2.6",
|
|
40
|
-
"@formatjs/cli": "^6.
|
|
40
|
+
"@formatjs/cli": "^6.7.1",
|
|
41
41
|
"@storybook/addon-a11y": "^8.6.12",
|
|
42
42
|
"@storybook/addon-actions": "^8.6.12",
|
|
43
43
|
"@storybook/addon-essentials": "^8.6.12",
|
|
@@ -51,18 +51,18 @@
|
|
|
51
51
|
"@testing-library/jest-dom": "6.6.3",
|
|
52
52
|
"@testing-library/react": "16.3.0",
|
|
53
53
|
"@testing-library/user-event": "14.6.1",
|
|
54
|
-
"@transferwise/components": "46.97.
|
|
54
|
+
"@transferwise/components": "46.97.2",
|
|
55
55
|
"@transferwise/formatting": "^2.13.1",
|
|
56
56
|
"@transferwise/icons": "3.21.0",
|
|
57
|
-
"@transferwise/neptune-css": "14.24.
|
|
57
|
+
"@transferwise/neptune-css": "14.24.4",
|
|
58
58
|
"@types/jest": "29.5.14",
|
|
59
|
-
"@types/react": "18.3.
|
|
60
|
-
"@types/react-dom": "18.3.
|
|
61
|
-
"@wise/art": "2.20.
|
|
59
|
+
"@types/react": "18.3.21",
|
|
60
|
+
"@types/react-dom": "18.3.7",
|
|
61
|
+
"@wise/art": "2.20.2",
|
|
62
62
|
"@wise/components-theming": "^1.6.2",
|
|
63
63
|
"babel-jest": "29.7.0",
|
|
64
64
|
"currency-flags": "4.0.7",
|
|
65
|
-
"esbuild": "0.25.
|
|
65
|
+
"esbuild": "0.25.4",
|
|
66
66
|
"jest": "29.7.0",
|
|
67
67
|
"jest-environment-jsdom": "29.7.0",
|
|
68
68
|
"jest-fetch-mock": "^3.0.3",
|
|
@@ -79,12 +79,12 @@
|
|
|
79
79
|
"stylelint-config-standard": "36.0.1",
|
|
80
80
|
"stylelint-no-unsupported-browser-features": "8.0.4",
|
|
81
81
|
"stylelint-value-no-unknown-custom-properties": "6.0.1",
|
|
82
|
-
"tsx": "4.19.
|
|
82
|
+
"tsx": "4.19.4",
|
|
83
83
|
"typescript": "5.8.3",
|
|
84
|
-
"webpack": "5.99.
|
|
85
|
-
"@wise/dynamic-flow-renderers": "0.0.0",
|
|
84
|
+
"webpack": "5.99.8",
|
|
86
85
|
"@wise/dynamic-flow-fixtures": "0.0.1",
|
|
87
|
-
"@wise/dynamic-flow-types": "3.3.
|
|
86
|
+
"@wise/dynamic-flow-types": "3.3.2",
|
|
87
|
+
"@wise/dynamic-flow-renderers": "0.0.0"
|
|
88
88
|
},
|
|
89
89
|
"peerDependencies": {
|
|
90
90
|
"@transferwise/components": "^46.92.0",
|
|
@@ -99,8 +99,8 @@
|
|
|
99
99
|
},
|
|
100
100
|
"dependencies": {
|
|
101
101
|
"classnames": "2.5.1",
|
|
102
|
-
"@wise/dynamic-flow-client": "4.5.
|
|
103
|
-
"@wise/dynamic-flow-types": "3.3.
|
|
102
|
+
"@wise/dynamic-flow-client": "4.5.3",
|
|
103
|
+
"@wise/dynamic-flow-types": "3.3.2"
|
|
104
104
|
},
|
|
105
105
|
"scripts": {
|
|
106
106
|
"dev": "pnpm build:visual-tests && storybook dev -p 3005",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|