@wise/dynamic-flow-client-internal 3.14.0 → 3.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/main.js +427 -370
- package/build/main.min.js +1 -1
- package/build/main.mjs +240 -183
- package/package.json +7 -7
package/build/main.mjs
CHANGED
|
@@ -33,6 +33,9 @@ var __objRest = (source, exclude) => {
|
|
|
33
33
|
}
|
|
34
34
|
return target;
|
|
35
35
|
};
|
|
36
|
+
var __esm = (fn, res) => function __init() {
|
|
37
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
38
|
+
};
|
|
36
39
|
var __commonJS = (cb, mod) => function __require() {
|
|
37
40
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
38
41
|
};
|
|
@@ -114,6 +117,158 @@ var require_classnames = __commonJS({
|
|
|
114
117
|
}
|
|
115
118
|
});
|
|
116
119
|
|
|
120
|
+
// ../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
121
|
+
function r(e) {
|
|
122
|
+
var t, f, n = "";
|
|
123
|
+
if ("string" == typeof e || "number" == typeof e)
|
|
124
|
+
n += e;
|
|
125
|
+
else if ("object" == typeof e)
|
|
126
|
+
if (Array.isArray(e)) {
|
|
127
|
+
var o = e.length;
|
|
128
|
+
for (t = 0; t < o; t++)
|
|
129
|
+
e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
130
|
+
} else
|
|
131
|
+
for (f in e)
|
|
132
|
+
e[f] && (n && (n += " "), n += f);
|
|
133
|
+
return n;
|
|
134
|
+
}
|
|
135
|
+
function clsx() {
|
|
136
|
+
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++)
|
|
137
|
+
(e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
138
|
+
return n;
|
|
139
|
+
}
|
|
140
|
+
var init_clsx = __esm({
|
|
141
|
+
"../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs"() {
|
|
142
|
+
"use strict";
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
// ../../node_modules/.pnpm/@wise+art@2.14.0_@transferwise+neptune-css@14.12.1_@types+react@18.3.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index-93a0c34e.esm.js
|
|
147
|
+
import { useState, useEffect, forwardRef, Suspense, lazy } from "react";
|
|
148
|
+
import { jsx as jsx12, jsxs as jsxs3, Fragment } from "react/jsx-runtime";
|
|
149
|
+
var unknownFlagName, Flag, Sizes, ImageSizes, imageSizes, Assets, RenderMode;
|
|
150
|
+
var init_index_93a0c34e_esm = __esm({
|
|
151
|
+
"../../node_modules/.pnpm/@wise+art@2.14.0_@transferwise+neptune-css@14.12.1_@types+react@18.3.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index-93a0c34e.esm.js"() {
|
|
152
|
+
"use strict";
|
|
153
|
+
init_clsx();
|
|
154
|
+
unknownFlagName = "wise";
|
|
155
|
+
Flag = ({
|
|
156
|
+
code,
|
|
157
|
+
intrinsicSize = 64,
|
|
158
|
+
className = void 0
|
|
159
|
+
}) => {
|
|
160
|
+
const [fallback, setFallback] = useState(null);
|
|
161
|
+
useEffect(() => {
|
|
162
|
+
setFallback(null);
|
|
163
|
+
}, [code]);
|
|
164
|
+
const detailed = intrinsicSize >= 150;
|
|
165
|
+
const name = fallback !== "unknown" ? `${code.toLowerCase()}${fallback == null && detailed ? "-detailed" : ""}` : unknownFlagName;
|
|
166
|
+
return /* @__PURE__ */ jsx12("img", {
|
|
167
|
+
className: clsx(`wds-flag wds-flag-${name}`, className),
|
|
168
|
+
src: `https://wise.com/web-art/assets/flags/${name}.svg`,
|
|
169
|
+
alt: "",
|
|
170
|
+
width: intrinsicSize,
|
|
171
|
+
height: intrinsicSize,
|
|
172
|
+
onError: () => {
|
|
173
|
+
setFallback((prev) => prev == null && detailed ? "simple" : "unknown");
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
};
|
|
177
|
+
(function(Sizes2) {
|
|
178
|
+
Sizes2["SMALL"] = "small";
|
|
179
|
+
Sizes2["MEDIUM"] = "medium";
|
|
180
|
+
Sizes2["LARGE"] = "large";
|
|
181
|
+
})(Sizes || (Sizes = {}));
|
|
182
|
+
ImageSizes = {
|
|
183
|
+
[Sizes.SMALL]: 200,
|
|
184
|
+
[Sizes.MEDIUM]: 300,
|
|
185
|
+
[Sizes.LARGE]: 500
|
|
186
|
+
};
|
|
187
|
+
imageSizes = {
|
|
188
|
+
[Sizes.SMALL]: 200,
|
|
189
|
+
[Sizes.MEDIUM]: 300,
|
|
190
|
+
[Sizes.LARGE]: 500
|
|
191
|
+
};
|
|
192
|
+
(function(Assets2) {
|
|
193
|
+
Assets2["BELL"] = "bell";
|
|
194
|
+
Assets2["BRIEFCASE"] = "briefcase";
|
|
195
|
+
Assets2["BUSINESS_CARD"] = "business-card";
|
|
196
|
+
Assets2["CALENDAR"] = "calendar";
|
|
197
|
+
Assets2["CHECK_MARK"] = "check-mark";
|
|
198
|
+
Assets2["CLOSED_WINDOW"] = "closed-window";
|
|
199
|
+
Assets2["COIN_PILE_DOWN"] = "coin-pile-down";
|
|
200
|
+
Assets2["COIN_PILE_UP"] = "coin-pile-up";
|
|
201
|
+
Assets2["CONFETTI"] = "confetti";
|
|
202
|
+
Assets2["CONSTRUCTION_FENCE"] = "construction-fence";
|
|
203
|
+
Assets2["CONVERT"] = "convert";
|
|
204
|
+
Assets2["COOKIE"] = "cookie";
|
|
205
|
+
Assets2["DIGITAL_CARD_2"] = "digital-card-2";
|
|
206
|
+
Assets2["DIGITAL_CARD"] = "digital-card";
|
|
207
|
+
Assets2["DOCUMENTS"] = "documents";
|
|
208
|
+
Assets2["DOOR"] = "door";
|
|
209
|
+
Assets2["ECO_CARD"] = "eco-card";
|
|
210
|
+
Assets2["ELECTRIC_PLUG"] = "electric-plug";
|
|
211
|
+
Assets2["EMAIL_SUCCESS"] = "email-success";
|
|
212
|
+
Assets2["EMAIL"] = "email";
|
|
213
|
+
Assets2["EXCLAMATION_MARK"] = "exclamation-mark";
|
|
214
|
+
Assets2["FLAG"] = "flag";
|
|
215
|
+
Assets2["FLOWER"] = "flower";
|
|
216
|
+
Assets2["GEAR"] = "gear";
|
|
217
|
+
Assets2["GLOBE"] = "globe";
|
|
218
|
+
Assets2["GRAPH"] = "graph";
|
|
219
|
+
Assets2["HEART_2"] = "heart-2";
|
|
220
|
+
Assets2["HEART_3"] = "heart-3";
|
|
221
|
+
Assets2["HEART_4"] = "heart-4";
|
|
222
|
+
Assets2["HEART_5"] = "heart-5";
|
|
223
|
+
Assets2["HEART"] = "heart";
|
|
224
|
+
Assets2["HOUSE"] = "house";
|
|
225
|
+
Assets2["ID_CARD"] = "id-card";
|
|
226
|
+
Assets2["INFINITE"] = "infinite";
|
|
227
|
+
Assets2["INTEREST"] = "interest";
|
|
228
|
+
Assets2["INVITE_LETTER"] = "invite-letter";
|
|
229
|
+
Assets2["JARS"] = "jars";
|
|
230
|
+
Assets2["KEY"] = "key";
|
|
231
|
+
Assets2["LIGHT_BULB"] = "light-bulb";
|
|
232
|
+
Assets2["LOCK_PLATFORM"] = "lock-platform";
|
|
233
|
+
Assets2["LOCK"] = "lock";
|
|
234
|
+
Assets2["MAGNIFYING_GLASS"] = "magnifying-glass";
|
|
235
|
+
Assets2["MAP"] = "map";
|
|
236
|
+
Assets2["MARBLE_CARD_BUSINESS"] = "marble-card-business";
|
|
237
|
+
Assets2["MARBLE_CARD"] = "marble-card";
|
|
238
|
+
Assets2["MARBLE"] = "marble";
|
|
239
|
+
Assets2["MEGAPHONE"] = "megaphone";
|
|
240
|
+
Assets2["MULTI_CURRENCY"] = "multi-currency";
|
|
241
|
+
Assets2["ONE_INVITE_LETTER_OPENED"] = "one-invite-letter-opened";
|
|
242
|
+
Assets2["PALM_TREE"] = "palm-tree";
|
|
243
|
+
Assets2["PERCENTAGE"] = "percentage";
|
|
244
|
+
Assets2["PERSONAL_CARD"] = "personal-card";
|
|
245
|
+
Assets2["PHONES"] = "phones";
|
|
246
|
+
Assets2["PIE_CHART"] = "pie-chart";
|
|
247
|
+
Assets2["PLANE_2"] = "plane-2";
|
|
248
|
+
Assets2["PLANE"] = "plane";
|
|
249
|
+
Assets2["PUZZLE_PIECES"] = "puzzle-pieces";
|
|
250
|
+
Assets2["QUESTION_MARK"] = "question-mark";
|
|
251
|
+
Assets2["RECEIVE"] = "receive";
|
|
252
|
+
Assets2["REMINDER_LETTER"] = "reminder-letter";
|
|
253
|
+
Assets2["SAND_TIMER"] = "sand-timer";
|
|
254
|
+
Assets2["SATELLITE_PLATFORM"] = "satellite-platform";
|
|
255
|
+
Assets2["SHOPPING_BAG"] = "shopping-bag";
|
|
256
|
+
Assets2["SKIP_AUTHENTICATION"] = "skip-authentication";
|
|
257
|
+
Assets2["SPEECH_BUBBLE"] = "speech-bubble";
|
|
258
|
+
Assets2["STOPWATCH_PLATFORM"] = "stopwatch-platform";
|
|
259
|
+
Assets2["TARGET_PLATFORM"] = "target-platform";
|
|
260
|
+
Assets2["TOOL"] = "tool";
|
|
261
|
+
Assets2["TWO_INVITE_LETTERS_OPENED"] = "two-invite-letters-opened";
|
|
262
|
+
Assets2["WALLET"] = "wallet";
|
|
263
|
+
})(Assets || (Assets = {}));
|
|
264
|
+
(function(RenderMode2) {
|
|
265
|
+
RenderMode2[RenderMode2["INIT"] = 0] = "INIT";
|
|
266
|
+
RenderMode2[RenderMode2["FALLBACK"] = 1] = "FALLBACK";
|
|
267
|
+
RenderMode2[RenderMode2["ASSET_3D"] = 2] = "ASSET_3D";
|
|
268
|
+
})(RenderMode || (RenderMode = {}));
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
|
|
117
272
|
// src/index.ts
|
|
118
273
|
import { makeHttpClient } from "@wise/dynamic-flow-client";
|
|
119
274
|
import { JsonSchemaForm, isValidSchema } from "@wise/dynamic-flow-client";
|
|
@@ -1062,111 +1217,13 @@ var DateInputRenderer = {
|
|
|
1062
1217
|
var DateInputRenderer_default = DateInputRenderer;
|
|
1063
1218
|
|
|
1064
1219
|
// ../renderers/src/DecisionRenderer.tsx
|
|
1065
|
-
import { NavigationOptionsList, NavigationOption } from "@transferwise/components";
|
|
1220
|
+
import { NavigationOptionsList, NavigationOption, Header } from "@transferwise/components";
|
|
1066
1221
|
|
|
1067
|
-
// ../../node_modules/.pnpm/@wise+art@2.
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
code,
|
|
1073
|
-
intrinsicSize = 64
|
|
1074
|
-
}) => {
|
|
1075
|
-
const [fallback, setFallback] = useState(null);
|
|
1076
|
-
useEffect(() => {
|
|
1077
|
-
setFallback(null);
|
|
1078
|
-
}, [code]);
|
|
1079
|
-
const detailed = intrinsicSize >= 150;
|
|
1080
|
-
const name = fallback !== "unknown" ? `${code.toLowerCase()}${fallback == null && detailed ? "-detailed" : ""}` : unknownFlagName;
|
|
1081
|
-
return /* @__PURE__ */ jsx12("img", {
|
|
1082
|
-
src: `https://wise.com/web-art/assets/flags/${name}.svg`,
|
|
1083
|
-
alt: "",
|
|
1084
|
-
width: intrinsicSize,
|
|
1085
|
-
height: intrinsicSize,
|
|
1086
|
-
onError: () => {
|
|
1087
|
-
setFallback((prev) => prev == null && detailed ? "simple" : "unknown");
|
|
1088
|
-
}
|
|
1089
|
-
});
|
|
1090
|
-
};
|
|
1091
|
-
var Sizes;
|
|
1092
|
-
(function(Sizes2) {
|
|
1093
|
-
Sizes2["SMALL"] = "small";
|
|
1094
|
-
Sizes2["MEDIUM"] = "medium";
|
|
1095
|
-
Sizes2["LARGE"] = "large";
|
|
1096
|
-
})(Sizes || (Sizes = {}));
|
|
1097
|
-
var imageSizes = {
|
|
1098
|
-
[Sizes.SMALL]: 200,
|
|
1099
|
-
[Sizes.MEDIUM]: 300,
|
|
1100
|
-
[Sizes.LARGE]: 500
|
|
1101
|
-
};
|
|
1102
|
-
var Assets;
|
|
1103
|
-
(function(Assets2) {
|
|
1104
|
-
Assets2["BELL"] = "bell";
|
|
1105
|
-
Assets2["BRIEFCASE"] = "briefcase";
|
|
1106
|
-
Assets2["BUSINESS_CARD"] = "business-card";
|
|
1107
|
-
Assets2["CALENDAR"] = "calendar";
|
|
1108
|
-
Assets2["CHECK_MARK"] = "check-mark";
|
|
1109
|
-
Assets2["CLOSED_WINDOW"] = "closed-window";
|
|
1110
|
-
Assets2["COIN_PILE_DOWN"] = "coin-pile-down";
|
|
1111
|
-
Assets2["COIN_PILE_UP"] = "coin-pile-up";
|
|
1112
|
-
Assets2["CONFETTI"] = "confetti";
|
|
1113
|
-
Assets2["CONSTRUCTION_FENCE"] = "construction-fence";
|
|
1114
|
-
Assets2["CONVERT"] = "convert";
|
|
1115
|
-
Assets2["COOKIE"] = "cookie";
|
|
1116
|
-
Assets2["DIGITAL_CARD_2"] = "digital-card-2";
|
|
1117
|
-
Assets2["DIGITAL_CARD"] = "digital-card";
|
|
1118
|
-
Assets2["DOCUMENTS"] = "documents";
|
|
1119
|
-
Assets2["DOOR"] = "door";
|
|
1120
|
-
Assets2["ECO_CARD"] = "eco-card";
|
|
1121
|
-
Assets2["ELECTRIC_PLUG"] = "electric-plug";
|
|
1122
|
-
Assets2["EMAIL_SUCCESS"] = "email-success";
|
|
1123
|
-
Assets2["EMAIL"] = "email";
|
|
1124
|
-
Assets2["EXCLAMATION_MARK"] = "exclamation-mark";
|
|
1125
|
-
Assets2["FLAG"] = "flag";
|
|
1126
|
-
Assets2["FLOWER"] = "flower";
|
|
1127
|
-
Assets2["GEAR"] = "gear";
|
|
1128
|
-
Assets2["GLOBE"] = "globe";
|
|
1129
|
-
Assets2["GRAPH"] = "graph";
|
|
1130
|
-
Assets2["HEART_2"] = "heart-2";
|
|
1131
|
-
Assets2["HEART_3"] = "heart-3";
|
|
1132
|
-
Assets2["HEART_4"] = "heart-4";
|
|
1133
|
-
Assets2["HEART_5"] = "heart-5";
|
|
1134
|
-
Assets2["HEART"] = "heart";
|
|
1135
|
-
Assets2["HOUSE"] = "house";
|
|
1136
|
-
Assets2["ID_CARD"] = "id-card";
|
|
1137
|
-
Assets2["INFINITE"] = "infinite";
|
|
1138
|
-
Assets2["INVITE_LETTER"] = "invite-letter";
|
|
1139
|
-
Assets2["JARS"] = "jars";
|
|
1140
|
-
Assets2["KEY"] = "key";
|
|
1141
|
-
Assets2["LIGHT_BULB"] = "light-bulb";
|
|
1142
|
-
Assets2["LOCK"] = "lock";
|
|
1143
|
-
Assets2["MAGNIFYING_GLASS"] = "magnifying-glass";
|
|
1144
|
-
Assets2["MAP"] = "map";
|
|
1145
|
-
Assets2["MARBLE_CARD_BUSINESS"] = "marble-card-business";
|
|
1146
|
-
Assets2["MARBLE_CARD"] = "marble-card";
|
|
1147
|
-
Assets2["MARBLE"] = "marble";
|
|
1148
|
-
Assets2["MEGAPHONE"] = "megaphone";
|
|
1149
|
-
Assets2["MULTI_CURRENCY"] = "multi-currency";
|
|
1150
|
-
Assets2["ONE_INVITE_LETTER_OPENED"] = "one-invite-letter-opened";
|
|
1151
|
-
Assets2["PALM_TREE"] = "palm-tree";
|
|
1152
|
-
Assets2["PERCENTAGE"] = "percentage";
|
|
1153
|
-
Assets2["PERSONAL_CARD"] = "personal-card";
|
|
1154
|
-
Assets2["PHONES"] = "phones";
|
|
1155
|
-
Assets2["PIE_CHART"] = "pie-chart";
|
|
1156
|
-
Assets2["PLANE_2"] = "plane-2";
|
|
1157
|
-
Assets2["PLANE"] = "plane";
|
|
1158
|
-
Assets2["PUZZLE_PIECES"] = "puzzle-pieces";
|
|
1159
|
-
Assets2["QUESTION_MARK"] = "question-mark";
|
|
1160
|
-
Assets2["RECEIVE"] = "receive";
|
|
1161
|
-
Assets2["REMINDER_LETTER"] = "reminder-letter";
|
|
1162
|
-
Assets2["SAND_TIMER"] = "sand-timer";
|
|
1163
|
-
Assets2["SHOPPING_BAG"] = "shopping-bag";
|
|
1164
|
-
Assets2["SKIP_AUTHENTICATION"] = "skip-authentication";
|
|
1165
|
-
Assets2["SPEECH_BUBBLE"] = "speech-bubble";
|
|
1166
|
-
Assets2["TOOL"] = "tool";
|
|
1167
|
-
Assets2["TWO_INVITE_LETTERS_OPENED"] = "two-invite-letters-opened";
|
|
1168
|
-
Assets2["WALLET"] = "wallet";
|
|
1169
|
-
})(Assets || (Assets = {}));
|
|
1222
|
+
// ../../node_modules/.pnpm/@wise+art@2.14.0_@transferwise+neptune-css@14.12.1_@types+react@18.3.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index.esm.js
|
|
1223
|
+
init_index_93a0c34e_esm();
|
|
1224
|
+
init_clsx();
|
|
1225
|
+
import "react";
|
|
1226
|
+
import "react/jsx-runtime";
|
|
1170
1227
|
|
|
1171
1228
|
// ../renderers/src/components/icon/FlagIcon.tsx
|
|
1172
1229
|
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
@@ -1230,27 +1287,30 @@ function NavigationOptionMedia({ icon, image }) {
|
|
|
1230
1287
|
}
|
|
1231
1288
|
|
|
1232
1289
|
// ../renderers/src/DecisionRenderer.tsx
|
|
1233
|
-
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1290
|
+
import { jsx as jsx17, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1234
1291
|
var DecisionRenderer = {
|
|
1235
1292
|
canRenderType: "decision",
|
|
1236
1293
|
render: DecisionRendererComponent
|
|
1237
1294
|
};
|
|
1238
1295
|
var DecisionRenderer_default = DecisionRenderer;
|
|
1239
|
-
function DecisionRendererComponent({ margin, options }) {
|
|
1296
|
+
function DecisionRendererComponent({ margin, options, title }) {
|
|
1240
1297
|
const { isLoading } = useLoadingContext();
|
|
1241
|
-
return /* @__PURE__ */
|
|
1242
|
-
|
|
1243
|
-
{
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1298
|
+
return /* @__PURE__ */ jsxs4("div", { className: getMargin(margin), children: [
|
|
1299
|
+
title && /* @__PURE__ */ jsx17(Header, { as: "h2", title }),
|
|
1300
|
+
/* @__PURE__ */ jsx17(NavigationOptionsList, { children: options.map(({ description, disabled, icon, image, title: title2, onClick }) => /* @__PURE__ */ jsx17(
|
|
1301
|
+
NavigationOption,
|
|
1302
|
+
{
|
|
1303
|
+
title: title2,
|
|
1304
|
+
content: description,
|
|
1305
|
+
disabled: isLoading || disabled,
|
|
1306
|
+
media: /* @__PURE__ */ jsx17(NavigationOptionMedia, { icon, image }),
|
|
1307
|
+
showMediaCircle: false,
|
|
1308
|
+
showMediaAtAllSizes: true,
|
|
1309
|
+
onClick
|
|
1310
|
+
},
|
|
1311
|
+
JSON.stringify(title2)
|
|
1312
|
+
)) })
|
|
1313
|
+
] });
|
|
1254
1314
|
}
|
|
1255
1315
|
|
|
1256
1316
|
// ../renderers/src/DividerRenderer.tsx
|
|
@@ -1270,14 +1330,14 @@ var FormRenderer = {
|
|
|
1270
1330
|
var FormRenderer_default = FormRenderer;
|
|
1271
1331
|
|
|
1272
1332
|
// ../renderers/src/FormSectionRenderer.tsx
|
|
1273
|
-
import { Header } from "@transferwise/components";
|
|
1274
|
-
import { jsx as jsx20, jsxs as
|
|
1333
|
+
import { Header as Header2 } from "@transferwise/components";
|
|
1334
|
+
import { jsx as jsx20, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1275
1335
|
var FormSectionRenderer = {
|
|
1276
1336
|
canRenderType: "form-section",
|
|
1277
|
-
render: ({ title, description, children }) => /* @__PURE__ */
|
|
1337
|
+
render: ({ title, description, children }) => /* @__PURE__ */ jsxs5("fieldset", { children: [
|
|
1278
1338
|
title && // TODO - once section headers support help, we could show help in here
|
|
1279
1339
|
/* @__PURE__ */ jsx20(
|
|
1280
|
-
|
|
1340
|
+
Header2,
|
|
1281
1341
|
{
|
|
1282
1342
|
as: "h2",
|
|
1283
1343
|
title
|
|
@@ -1407,8 +1467,8 @@ var getImageSource = async (httpClient, imageUrl) => {
|
|
|
1407
1467
|
};
|
|
1408
1468
|
|
|
1409
1469
|
// ../renderers/src/InstructionsRenderer.tsx
|
|
1410
|
-
import { Header as
|
|
1411
|
-
import { jsx as jsx23, jsxs as
|
|
1470
|
+
import { Header as Header3, InstructionsList } from "@transferwise/components";
|
|
1471
|
+
import { jsx as jsx23, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1412
1472
|
var doContext = ["positive", "neutral"];
|
|
1413
1473
|
var dontContext = ["warning", "negative"];
|
|
1414
1474
|
var InstructionsRenderer = {
|
|
@@ -1416,8 +1476,8 @@ var InstructionsRenderer = {
|
|
|
1416
1476
|
render: ({ items, margin, title }) => {
|
|
1417
1477
|
const dos = items.filter((item) => doContext.includes(item.context)).map(({ text }) => text);
|
|
1418
1478
|
const donts = items.filter((item) => dontContext.includes(item.context)).map(({ text }) => text);
|
|
1419
|
-
return /* @__PURE__ */
|
|
1420
|
-
title ? /* @__PURE__ */ jsx23(
|
|
1479
|
+
return /* @__PURE__ */ jsxs6("div", { className: getMargin(margin), children: [
|
|
1480
|
+
title ? /* @__PURE__ */ jsx23(Header3, { title }) : null,
|
|
1421
1481
|
/* @__PURE__ */ jsx23(InstructionsList, { dos, donts })
|
|
1422
1482
|
] });
|
|
1423
1483
|
}
|
|
@@ -1488,7 +1548,7 @@ var MarkdownRenderer_default = MarkdownRenderer;
|
|
|
1488
1548
|
// ../renderers/src/ModalRenderer.tsx
|
|
1489
1549
|
import { Button as Button2, Modal } from "@transferwise/components";
|
|
1490
1550
|
import { useState as useState3 } from "react";
|
|
1491
|
-
import { jsx as jsx27, jsxs as
|
|
1551
|
+
import { jsx as jsx27, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1492
1552
|
var ModalRenderer = {
|
|
1493
1553
|
canRenderType: "modal",
|
|
1494
1554
|
render: (props) => /* @__PURE__ */ jsx27(DFModal, __spreadValues({}, props))
|
|
@@ -1496,7 +1556,7 @@ var ModalRenderer = {
|
|
|
1496
1556
|
var ModalRenderer_default = ModalRenderer;
|
|
1497
1557
|
function DFModal({ content, margin, trigger }) {
|
|
1498
1558
|
const [visible, setVisible] = useState3(false);
|
|
1499
|
-
return /* @__PURE__ */
|
|
1559
|
+
return /* @__PURE__ */ jsxs7("div", { className: getMargin(margin), children: [
|
|
1500
1560
|
/* @__PURE__ */ jsx27(Button2, { priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
|
|
1501
1561
|
/* @__PURE__ */ jsx27(
|
|
1502
1562
|
Modal,
|
|
@@ -1635,7 +1695,7 @@ import { UploadInput } from "@transferwise/components";
|
|
|
1635
1695
|
// ../renderers/src/components/UploadFieldInput.tsx
|
|
1636
1696
|
var import_classnames3 = __toESM(require_classnames());
|
|
1637
1697
|
import { InlineAlert } from "@transferwise/components";
|
|
1638
|
-
import { jsx as jsx30, jsxs as
|
|
1698
|
+
import { jsx as jsx30, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1639
1699
|
function UploadFieldInput({
|
|
1640
1700
|
id,
|
|
1641
1701
|
children,
|
|
@@ -1646,7 +1706,7 @@ function UploadFieldInput({
|
|
|
1646
1706
|
}) {
|
|
1647
1707
|
const labelContent = label && help ? /* @__PURE__ */ jsx30(LabelContentWithHelp, { text: label, help }) : label;
|
|
1648
1708
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
1649
|
-
return /* @__PURE__ */
|
|
1709
|
+
return /* @__PURE__ */ jsxs8(
|
|
1650
1710
|
"div",
|
|
1651
1711
|
{
|
|
1652
1712
|
className: (0, import_classnames3.default)("form-group d-block", {
|
|
@@ -1792,7 +1852,7 @@ var paragraph_messages_default = defineMessages3({
|
|
|
1792
1852
|
});
|
|
1793
1853
|
|
|
1794
1854
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
1795
|
-
import { jsx as jsx33, jsxs as
|
|
1855
|
+
import { jsx as jsx33, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1796
1856
|
var ParagraphRenderer = {
|
|
1797
1857
|
canRenderType: "paragraph",
|
|
1798
1858
|
render: (props) => /* @__PURE__ */ jsx33(Paragraph, __spreadValues({}, props))
|
|
@@ -1816,7 +1876,7 @@ function CopyableParagraph({
|
|
|
1816
1876
|
});
|
|
1817
1877
|
};
|
|
1818
1878
|
const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
|
|
1819
|
-
return /* @__PURE__ */
|
|
1879
|
+
return /* @__PURE__ */ jsxs9("div", { className, children: [
|
|
1820
1880
|
/* @__PURE__ */ jsx33(
|
|
1821
1881
|
Input3,
|
|
1822
1882
|
{
|
|
@@ -1832,7 +1892,7 @@ function CopyableParagraph({
|
|
|
1832
1892
|
var ParagraphRenderer_default = ParagraphRenderer;
|
|
1833
1893
|
|
|
1834
1894
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
1835
|
-
import { Button as Button4, Header as
|
|
1895
|
+
import { Button as Button4, Header as Header4, Modal as Modal2, NavigationOption as NavigationOption2, InlineAlert as InlineAlert2 } from "@transferwise/components";
|
|
1836
1896
|
import { useState as useState5 } from "react";
|
|
1837
1897
|
import { Plus } from "@transferwise/icons";
|
|
1838
1898
|
import { useIntl as useIntl4 } from "react-intl";
|
|
@@ -1864,7 +1924,7 @@ var repeatable_messages_default = defineMessages4({
|
|
|
1864
1924
|
|
|
1865
1925
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
1866
1926
|
var import_classnames5 = __toESM(require_classnames());
|
|
1867
|
-
import { Fragment as Fragment2, jsx as jsx34, jsxs as
|
|
1927
|
+
import { Fragment as Fragment2, jsx as jsx34, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1868
1928
|
var RepeatableRenderer = {
|
|
1869
1929
|
canRenderType: "repeatable",
|
|
1870
1930
|
render: (props) => /* @__PURE__ */ jsx34(Repeatable, __spreadValues({}, props))
|
|
@@ -1906,10 +1966,10 @@ function Repeatable(props) {
|
|
|
1906
1966
|
const onCancelEdit = () => {
|
|
1907
1967
|
setOpenModalType(null);
|
|
1908
1968
|
};
|
|
1909
|
-
return /* @__PURE__ */
|
|
1910
|
-
title && /* @__PURE__ */ jsx34(
|
|
1969
|
+
return /* @__PURE__ */ jsxs10(Fragment2, { children: [
|
|
1970
|
+
title && /* @__PURE__ */ jsx34(Header4, { title }),
|
|
1911
1971
|
description && /* @__PURE__ */ jsx34("p", { children: description }),
|
|
1912
|
-
/* @__PURE__ */
|
|
1972
|
+
/* @__PURE__ */ jsxs10(
|
|
1913
1973
|
"div",
|
|
1914
1974
|
{
|
|
1915
1975
|
className: (0, import_classnames5.default)("form-group", {
|
|
@@ -1935,9 +1995,9 @@ function Repeatable(props) {
|
|
|
1935
1995
|
{
|
|
1936
1996
|
open: openModalType !== null,
|
|
1937
1997
|
title: (openModalType === "add" ? addItemTitle : editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
|
|
1938
|
-
body: /* @__PURE__ */
|
|
1998
|
+
body: /* @__PURE__ */ jsxs10(Fragment2, { children: [
|
|
1939
1999
|
/* @__PURE__ */ jsx34("div", { className: "m-b-2", children: editableItem }),
|
|
1940
|
-
/* @__PURE__ */
|
|
2000
|
+
/* @__PURE__ */ jsxs10("div", { children: [
|
|
1941
2001
|
/* @__PURE__ */ jsx34(Button4, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
|
|
1942
2002
|
/* @__PURE__ */ jsx34(Button4, { priority: "secondary", type: "negative", block: true, onClick: () => onRemoveItem(), children: formatMessage(repeatable_messages_default.removeItem) })
|
|
1943
2003
|
] })
|
|
@@ -1991,10 +2051,10 @@ var generic_error_messages_default = defineMessages5({
|
|
|
1991
2051
|
});
|
|
1992
2052
|
|
|
1993
2053
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
1994
|
-
import { jsx as jsx35, jsxs as
|
|
2054
|
+
import { jsx as jsx35, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1995
2055
|
function ErrorResult({ state }) {
|
|
1996
2056
|
const intl = useIntl5();
|
|
1997
|
-
return /* @__PURE__ */
|
|
2057
|
+
return /* @__PURE__ */ jsxs11("p", { className: "m-t-2", children: [
|
|
1998
2058
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
1999
2059
|
"\xA0",
|
|
2000
2060
|
/* @__PURE__ */ jsx35(
|
|
@@ -2013,7 +2073,7 @@ function ErrorResult({ state }) {
|
|
|
2013
2073
|
|
|
2014
2074
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
2015
2075
|
import { useState as useState6 } from "react";
|
|
2016
|
-
import { Fragment as Fragment3, jsx as jsx36, jsxs as
|
|
2076
|
+
import { Fragment as Fragment3, jsx as jsx36, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2017
2077
|
function BlockSearchRendererComponent({
|
|
2018
2078
|
id,
|
|
2019
2079
|
isLoading,
|
|
@@ -2025,7 +2085,7 @@ function BlockSearchRendererComponent({
|
|
|
2025
2085
|
}) {
|
|
2026
2086
|
const [hasSearched, setHasSearched] = useState6(false);
|
|
2027
2087
|
const trackEvent = useTrackEvent();
|
|
2028
|
-
return /* @__PURE__ */
|
|
2088
|
+
return /* @__PURE__ */ jsxs12("div", { className: getMargin(margin), children: [
|
|
2029
2089
|
/* @__PURE__ */ jsx36(FieldInput_default, { id, description: "", error: "", help: "", label: title, children: /* @__PURE__ */ jsx36(
|
|
2030
2090
|
Input4,
|
|
2031
2091
|
{
|
|
@@ -2093,7 +2153,7 @@ var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
|
|
|
2093
2153
|
import { Markdown as Markdown4, Typeahead } from "@transferwise/components";
|
|
2094
2154
|
import { Search } from "@transferwise/icons";
|
|
2095
2155
|
import { useState as useState7 } from "react";
|
|
2096
|
-
import { jsx as jsx37
|
|
2156
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
2097
2157
|
function InlineSearchRenderer({
|
|
2098
2158
|
id,
|
|
2099
2159
|
isLoading,
|
|
@@ -2104,43 +2164,40 @@ function InlineSearchRenderer({
|
|
|
2104
2164
|
}) {
|
|
2105
2165
|
const [hasSearched, setHasSearched] = useState7(false);
|
|
2106
2166
|
const trackEvent = useTrackEvent();
|
|
2107
|
-
return /* @__PURE__ */ jsx37("div", { className: getMargin(margin), children: /* @__PURE__ */
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
}, result.type === "action" ? { actionId: result.id } : {}));
|
|
2130
|
-
result.onClick();
|
|
2131
|
-
}
|
|
2132
|
-
}
|
|
2133
|
-
},
|
|
2134
|
-
onInputChange: (query) => {
|
|
2135
|
-
if (!hasSearched) {
|
|
2136
|
-
setHasSearched(true);
|
|
2137
|
-
trackEvent("Search Started");
|
|
2167
|
+
return /* @__PURE__ */ jsx37("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx37(FieldInput_default, { id, description: "", error: "", help: "", label: title, children: /* @__PURE__ */ jsx37(
|
|
2168
|
+
Typeahead,
|
|
2169
|
+
{
|
|
2170
|
+
id: "typeahead-input-id",
|
|
2171
|
+
name: "typeahead-input-name",
|
|
2172
|
+
size: "md",
|
|
2173
|
+
maxHeight: 100,
|
|
2174
|
+
footer: /* @__PURE__ */ jsx37(TypeaheadFooter, { state, isLoading }),
|
|
2175
|
+
multiple: false,
|
|
2176
|
+
clearable: false,
|
|
2177
|
+
addon: /* @__PURE__ */ jsx37(Search, { size: 24 }),
|
|
2178
|
+
options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
|
|
2179
|
+
minQueryLength: 1,
|
|
2180
|
+
onChange: (values) => {
|
|
2181
|
+
if (values.length > 0) {
|
|
2182
|
+
const [updatedValue] = values;
|
|
2183
|
+
const { value: result } = updatedValue;
|
|
2184
|
+
if (result) {
|
|
2185
|
+
trackEvent("Search Result Selected", __spreadValues({
|
|
2186
|
+
type: result.type
|
|
2187
|
+
}, result.type === "action" ? { actionId: result.id } : {}));
|
|
2188
|
+
result.onClick();
|
|
2138
2189
|
}
|
|
2139
|
-
onChange(query);
|
|
2140
2190
|
}
|
|
2191
|
+
},
|
|
2192
|
+
onInputChange: (query) => {
|
|
2193
|
+
if (!hasSearched) {
|
|
2194
|
+
setHasSearched(true);
|
|
2195
|
+
trackEvent("Search Started");
|
|
2196
|
+
}
|
|
2197
|
+
onChange(query);
|
|
2141
2198
|
}
|
|
2142
|
-
|
|
2143
|
-
|
|
2199
|
+
}
|
|
2200
|
+
) }) });
|
|
2144
2201
|
}
|
|
2145
2202
|
function mapResultToTypeaheadOption(result) {
|
|
2146
2203
|
return {
|
|
@@ -2388,12 +2445,12 @@ var SelectInputRenderer = {
|
|
|
2388
2445
|
var SelectInputRenderer_default = SelectInputRenderer;
|
|
2389
2446
|
|
|
2390
2447
|
// ../renderers/src/StatusListRenderer.tsx
|
|
2391
|
-
import { Header as
|
|
2448
|
+
import { Header as Header5, Summary } from "@transferwise/components";
|
|
2392
2449
|
import { jsx as jsx45, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2393
2450
|
var StatusListRenderer = {
|
|
2394
2451
|
canRenderType: "status-list",
|
|
2395
2452
|
render: ({ margin, items, title }) => /* @__PURE__ */ jsxs17("div", { className: getMargin(margin), children: [
|
|
2396
|
-
title ? /* @__PURE__ */ jsx45(
|
|
2453
|
+
title ? /* @__PURE__ */ jsx45(Header5, { title }) : null,
|
|
2397
2454
|
items.map(({ description, icon, status, title: itemTitle }) => /* @__PURE__ */ jsx45(
|
|
2398
2455
|
Summary,
|
|
2399
2456
|
{
|
|
@@ -2607,7 +2664,7 @@ var LargeUploadRenderer = {
|
|
|
2607
2664
|
};
|
|
2608
2665
|
|
|
2609
2666
|
// ../renderers/src/ReviewRenderer.tsx
|
|
2610
|
-
import { DefinitionList, Header as
|
|
2667
|
+
import { DefinitionList, Header as Header6 } from "@transferwise/components";
|
|
2611
2668
|
import { Fragment as Fragment8, jsx as jsx49, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2612
2669
|
var ReviewRenderer = {
|
|
2613
2670
|
canRenderType: "review",
|
|
@@ -2621,7 +2678,7 @@ var ReviewRenderer = {
|
|
|
2621
2678
|
}
|
|
2622
2679
|
} : void 0;
|
|
2623
2680
|
return /* @__PURE__ */ jsxs18("div", { className: getMargin(margin), children: [
|
|
2624
|
-
(title || callToAction) && /* @__PURE__ */ jsx49(
|
|
2681
|
+
(title || callToAction) && /* @__PURE__ */ jsx49(Header6, { title: title != null ? title : "", action }),
|
|
2625
2682
|
/* @__PURE__ */ jsx49("div", { className: margin, children: /* @__PURE__ */ jsx49(
|
|
2626
2683
|
DefinitionList,
|
|
2627
2684
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wise/dynamic-flow-client-internal",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.15.0",
|
|
4
4
|
"description": "Dynamic Flow web client for Wise",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./build/main.min.js",
|
|
@@ -49,15 +49,15 @@
|
|
|
49
49
|
"@testing-library/react": "14.3.1",
|
|
50
50
|
"@testing-library/react-hooks": "8.0.1",
|
|
51
51
|
"@testing-library/user-event": "14.5.2",
|
|
52
|
-
"@transferwise/components": "46.
|
|
52
|
+
"@transferwise/components": "46.51.0",
|
|
53
53
|
"@transferwise/formatting": "^2.13.0",
|
|
54
54
|
"@transferwise/icons": "3.13.0",
|
|
55
|
-
"@transferwise/neptune-css": "14.
|
|
55
|
+
"@transferwise/neptune-css": "14.12.1",
|
|
56
56
|
"@types/jest": "29.5.12",
|
|
57
57
|
"@types/react": "18.3.3",
|
|
58
58
|
"@types/react-dom": "18.3.0",
|
|
59
|
-
"@wise/art": "2.
|
|
60
|
-
"@wise/components-theming": "^1.
|
|
59
|
+
"@wise/art": "2.14.0",
|
|
60
|
+
"@wise/components-theming": "^1.5.0",
|
|
61
61
|
"babel-jest": "29.7.0",
|
|
62
62
|
"currency-flags": "4.0.7",
|
|
63
63
|
"esbuild": "0.20.2",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"jest-environment-jsdom": "29.7.0",
|
|
66
66
|
"jest-fetch-mock": "^3.0.3",
|
|
67
67
|
"jest-watch-typeahead": "^2.2.2",
|
|
68
|
-
"npm-run-all2": "
|
|
68
|
+
"npm-run-all2": "6.2.2",
|
|
69
69
|
"postcss": "^8.4.38",
|
|
70
70
|
"postcss-cli": "^11.0.0",
|
|
71
71
|
"postcss-import": "^15.1.0",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
},
|
|
97
97
|
"dependencies": {
|
|
98
98
|
"classnames": "2.5.1",
|
|
99
|
-
"@wise/dynamic-flow-client": "3.
|
|
99
|
+
"@wise/dynamic-flow-client": "3.15.0",
|
|
100
100
|
"@wise/dynamic-flow-types": "2.16.0"
|
|
101
101
|
},
|
|
102
102
|
"scripts": {
|