@wise/dynamic-flow-client-internal 5.23.0 → 5.24.0-experimental-9265cac
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.css +33 -0
- package/build/main.js +1924 -680
- package/build/main.mjs +1825 -581
- package/build/tsconfig.types.tsbuildinfo +1 -1
- package/build/types/dynamicFlow/context-menu/useDFContextMenu.d.ts.map +1 -1
- package/build/types/dynamicFlow/getMergedRenderers.d.ts.map +1 -1
- package/build/types/dynamicFlow/messages.d.ts.map +1 -1
- package/build/types/dynamicFlow/renderers.d.ts +11 -5
- package/build/types/dynamicFlow/renderers.d.ts.map +1 -1
- package/build/types/dynamicFlow/telemetry/dispatchAnalyticsEvent.d.ts.map +1 -1
- package/build/types/dynamicFlow/telemetry/getLogEvent.d.ts.map +1 -1
- package/build/types/dynamicFlow/telemetry/getTrackEvent.d.ts.map +1 -1
- package/build/types/dynamicFlow/useWiseHttpClient.d.ts.map +1 -1
- package/build/types/dynamicFlow/useWiseToCoreProps.d.ts.map +1 -1
- package/build/types/i18n/index.d.ts.map +1 -1
- package/build/types/test-utils/NeptuneProviders.d.ts.map +1 -1
- package/build/types/test-utils/respond-with.d.ts.map +1 -1
- package/build/types/test-utils/rtl-utils.d.ts.map +1 -1
- package/build/types/test-utils/wait.d.ts.map +1 -1
- package/package.json +19 -19
package/build/main.mjs
CHANGED
|
@@ -311,7 +311,7 @@ var recursivelyRemoveNullish = (element) => {
|
|
|
311
311
|
};
|
|
312
312
|
|
|
313
313
|
// src/dynamicFlow/useWiseToCoreProps.tsx
|
|
314
|
-
import { useMemo as
|
|
314
|
+
import { useMemo as useMemo3 } from "react";
|
|
315
315
|
|
|
316
316
|
// src/dynamicFlow/getMergedRenderers.tsx
|
|
317
317
|
import { getDynamicSubflowRenderer } from "@wise/dynamic-flow-client";
|
|
@@ -642,7 +642,7 @@ var AvatarMedia = ({
|
|
|
642
642
|
}
|
|
643
643
|
);
|
|
644
644
|
}
|
|
645
|
-
const avatarsWithoutBadges = avatars.filter(({ asset, icon }) => asset || icon).slice(0, 2).map(({ asset, icon, backgroundColor, color }) => ({
|
|
645
|
+
const avatarsWithoutBadges = avatars.filter(({ asset, icon }) => Boolean(asset || icon)).slice(0, 2).map(({ asset, icon, backgroundColor, color }) => ({
|
|
646
646
|
asset: icon != null ? icon : asset,
|
|
647
647
|
style: { backgroundColor, color }
|
|
648
648
|
}));
|
|
@@ -723,22 +723,25 @@ var getImageNode = (image, size) => {
|
|
|
723
723
|
|
|
724
724
|
// ../renderers/src/components/Media/LegacyMedia.tsx
|
|
725
725
|
import { AvatarView as AvatarView3 } from "@transferwise/components";
|
|
726
|
-
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
726
|
+
import { Fragment, jsx as jsx12, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
727
727
|
var LegacyMedia = ({ image, icon, preferAvatar, size }) => {
|
|
728
728
|
const imageNode = getImageNode(image, size);
|
|
729
729
|
const iconNode = getIconNode(icon);
|
|
730
730
|
const badge = getBadgedMedia(iconNode, imageNode, size);
|
|
731
731
|
if (badge) {
|
|
732
|
-
return badge;
|
|
732
|
+
return /* @__PURE__ */ jsx12(Fragment, { children: badge });
|
|
733
733
|
}
|
|
734
734
|
if (imageNode) {
|
|
735
|
-
return preferAvatar ? /* @__PURE__ */ jsx12(AvatarView3, { children: imageNode }) :
|
|
735
|
+
return preferAvatar ? /* @__PURE__ */ jsx12(AvatarView3, { children: imageNode }) : /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
736
|
+
imageNode,
|
|
737
|
+
" "
|
|
738
|
+
] });
|
|
736
739
|
}
|
|
737
740
|
if (iconNode && icon) {
|
|
738
741
|
if ("text" in icon || size === 48) {
|
|
739
742
|
return /* @__PURE__ */ jsx12(AvatarView3, { size, children: iconNode });
|
|
740
743
|
}
|
|
741
|
-
return iconNode;
|
|
744
|
+
return /* @__PURE__ */ jsx12(Fragment, { children: iconNode });
|
|
742
745
|
}
|
|
743
746
|
return null;
|
|
744
747
|
};
|
|
@@ -911,9 +914,9 @@ function Help({ help, onClick }) {
|
|
|
911
914
|
var Help_default = Help;
|
|
912
915
|
|
|
913
916
|
// ../renderers/src/components/LabelContentWithHelp.tsx
|
|
914
|
-
import { jsx as jsx18, jsxs as
|
|
917
|
+
import { jsx as jsx18, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
915
918
|
function LabelContentWithHelp({ text, help }) {
|
|
916
|
-
return /* @__PURE__ */
|
|
919
|
+
return /* @__PURE__ */ jsxs4("div", { children: [
|
|
917
920
|
text,
|
|
918
921
|
/* @__PURE__ */ jsx18(Help_default, { help })
|
|
919
922
|
] });
|
|
@@ -1099,20 +1102,1386 @@ var getInlineAlertOrValidation = (validationState, inlineAlert) => {
|
|
|
1099
1102
|
}
|
|
1100
1103
|
return getInlineAlert(inlineAlert);
|
|
1101
1104
|
};
|
|
1102
|
-
var CheckboxInputRenderer_default = CheckboxInputRenderer;
|
|
1105
|
+
var CheckboxInputRenderer_default = CheckboxInputRenderer;
|
|
1106
|
+
|
|
1107
|
+
// ../renderers/src/CollectionRenderer/CollectionRenderer.tsx
|
|
1108
|
+
import { InlinePrompt, Link as DSLink } from "@transferwise/components";
|
|
1109
|
+
|
|
1110
|
+
// ../../node_modules/.pnpm/@tanstack+react-virtual@3.13.24_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/@tanstack/react-virtual/dist/esm/index.js
|
|
1111
|
+
import * as React from "react";
|
|
1112
|
+
import { flushSync } from "react-dom";
|
|
1113
|
+
|
|
1114
|
+
// ../../node_modules/.pnpm/@tanstack+virtual-core@3.14.0/node_modules/@tanstack/virtual-core/dist/esm/utils.js
|
|
1115
|
+
function memo(getDeps, fn, opts) {
|
|
1116
|
+
var _a;
|
|
1117
|
+
let deps = (_a = opts.initialDeps) != null ? _a : [];
|
|
1118
|
+
let result;
|
|
1119
|
+
let isInitial = true;
|
|
1120
|
+
function memoizedFunction() {
|
|
1121
|
+
var _a2, _b, _c;
|
|
1122
|
+
let depTime;
|
|
1123
|
+
if (opts.key && ((_a2 = opts.debug) == null ? void 0 : _a2.call(opts))) depTime = Date.now();
|
|
1124
|
+
const newDeps = getDeps();
|
|
1125
|
+
const depsChanged = newDeps.length !== deps.length || newDeps.some((dep, index) => deps[index] !== dep);
|
|
1126
|
+
if (!depsChanged) {
|
|
1127
|
+
return result;
|
|
1128
|
+
}
|
|
1129
|
+
deps = newDeps;
|
|
1130
|
+
let resultTime;
|
|
1131
|
+
if (opts.key && ((_b = opts.debug) == null ? void 0 : _b.call(opts))) resultTime = Date.now();
|
|
1132
|
+
result = fn(...newDeps);
|
|
1133
|
+
if (opts.key && ((_c = opts.debug) == null ? void 0 : _c.call(opts))) {
|
|
1134
|
+
const depEndTime = Math.round((Date.now() - depTime) * 100) / 100;
|
|
1135
|
+
const resultEndTime = Math.round((Date.now() - resultTime) * 100) / 100;
|
|
1136
|
+
const resultFpsPercentage = resultEndTime / 16;
|
|
1137
|
+
const pad = (str, num) => {
|
|
1138
|
+
str = String(str);
|
|
1139
|
+
while (str.length < num) {
|
|
1140
|
+
str = " " + str;
|
|
1141
|
+
}
|
|
1142
|
+
return str;
|
|
1143
|
+
};
|
|
1144
|
+
console.info(
|
|
1145
|
+
`%c\u23F1 ${pad(resultEndTime, 5)} /${pad(depEndTime, 5)} ms`,
|
|
1146
|
+
`
|
|
1147
|
+
font-size: .6rem;
|
|
1148
|
+
font-weight: bold;
|
|
1149
|
+
color: hsl(${Math.max(
|
|
1150
|
+
0,
|
|
1151
|
+
Math.min(120 - 120 * resultFpsPercentage, 120)
|
|
1152
|
+
)}deg 100% 31%);`,
|
|
1153
|
+
opts == null ? void 0 : opts.key
|
|
1154
|
+
);
|
|
1155
|
+
}
|
|
1156
|
+
if ((opts == null ? void 0 : opts.onChange) && !(isInitial && opts.skipInitialOnChange)) {
|
|
1157
|
+
opts.onChange(result);
|
|
1158
|
+
}
|
|
1159
|
+
isInitial = false;
|
|
1160
|
+
return result;
|
|
1161
|
+
}
|
|
1162
|
+
memoizedFunction.updateDeps = (newDeps) => {
|
|
1163
|
+
deps = newDeps;
|
|
1164
|
+
};
|
|
1165
|
+
return memoizedFunction;
|
|
1166
|
+
}
|
|
1167
|
+
function notUndefined(value, msg) {
|
|
1168
|
+
if (value === void 0) {
|
|
1169
|
+
throw new Error(`Unexpected undefined${msg ? `: ${msg}` : ""}`);
|
|
1170
|
+
} else {
|
|
1171
|
+
return value;
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
var approxEqual = (a, b) => Math.abs(a - b) < 1.01;
|
|
1175
|
+
var debounce = (targetWindow, fn, ms) => {
|
|
1176
|
+
let timeoutId;
|
|
1177
|
+
return function(...args) {
|
|
1178
|
+
targetWindow.clearTimeout(timeoutId);
|
|
1179
|
+
timeoutId = targetWindow.setTimeout(() => fn.apply(this, args), ms);
|
|
1180
|
+
};
|
|
1181
|
+
};
|
|
1182
|
+
|
|
1183
|
+
// ../../node_modules/.pnpm/@tanstack+virtual-core@3.14.0/node_modules/@tanstack/virtual-core/dist/esm/index.js
|
|
1184
|
+
var defaultKeyExtractor = (index) => index;
|
|
1185
|
+
var defaultRangeExtractor = (range) => {
|
|
1186
|
+
const start = Math.max(range.startIndex - range.overscan, 0);
|
|
1187
|
+
const end = Math.min(range.endIndex + range.overscan, range.count - 1);
|
|
1188
|
+
const arr = [];
|
|
1189
|
+
for (let i = start; i <= end; i++) {
|
|
1190
|
+
arr.push(i);
|
|
1191
|
+
}
|
|
1192
|
+
return arr;
|
|
1193
|
+
};
|
|
1194
|
+
var addEventListenerOptions = {
|
|
1195
|
+
passive: true
|
|
1196
|
+
};
|
|
1197
|
+
var observeWindowRect = (instance, cb) => {
|
|
1198
|
+
const element = instance.scrollElement;
|
|
1199
|
+
if (!element) {
|
|
1200
|
+
return;
|
|
1201
|
+
}
|
|
1202
|
+
const handler = () => {
|
|
1203
|
+
cb({ width: element.innerWidth, height: element.innerHeight });
|
|
1204
|
+
};
|
|
1205
|
+
handler();
|
|
1206
|
+
element.addEventListener("resize", handler, addEventListenerOptions);
|
|
1207
|
+
return () => {
|
|
1208
|
+
element.removeEventListener("resize", handler);
|
|
1209
|
+
};
|
|
1210
|
+
};
|
|
1211
|
+
var supportsScrollend = typeof window == "undefined" ? true : "onscrollend" in window;
|
|
1212
|
+
var observeWindowOffset = (instance, cb) => {
|
|
1213
|
+
const element = instance.scrollElement;
|
|
1214
|
+
if (!element) {
|
|
1215
|
+
return;
|
|
1216
|
+
}
|
|
1217
|
+
const targetWindow = instance.targetWindow;
|
|
1218
|
+
if (!targetWindow) {
|
|
1219
|
+
return;
|
|
1220
|
+
}
|
|
1221
|
+
let offset = 0;
|
|
1222
|
+
const fallback = instance.options.useScrollendEvent && supportsScrollend ? () => void 0 : debounce(
|
|
1223
|
+
targetWindow,
|
|
1224
|
+
() => {
|
|
1225
|
+
cb(offset, false);
|
|
1226
|
+
},
|
|
1227
|
+
instance.options.isScrollingResetDelay
|
|
1228
|
+
);
|
|
1229
|
+
const createHandler = (isScrolling) => () => {
|
|
1230
|
+
offset = element[instance.options.horizontal ? "scrollX" : "scrollY"];
|
|
1231
|
+
fallback();
|
|
1232
|
+
cb(offset, isScrolling);
|
|
1233
|
+
};
|
|
1234
|
+
const handler = createHandler(true);
|
|
1235
|
+
const endHandler = createHandler(false);
|
|
1236
|
+
element.addEventListener("scroll", handler, addEventListenerOptions);
|
|
1237
|
+
const registerScrollendEvent = instance.options.useScrollendEvent && supportsScrollend;
|
|
1238
|
+
if (registerScrollendEvent) {
|
|
1239
|
+
element.addEventListener("scrollend", endHandler, addEventListenerOptions);
|
|
1240
|
+
}
|
|
1241
|
+
return () => {
|
|
1242
|
+
element.removeEventListener("scroll", handler);
|
|
1243
|
+
if (registerScrollendEvent) {
|
|
1244
|
+
element.removeEventListener("scrollend", endHandler);
|
|
1245
|
+
}
|
|
1246
|
+
};
|
|
1247
|
+
};
|
|
1248
|
+
var measureElement = (element, entry, instance) => {
|
|
1249
|
+
if (entry == null ? void 0 : entry.borderBoxSize) {
|
|
1250
|
+
const box = entry.borderBoxSize[0];
|
|
1251
|
+
if (box) {
|
|
1252
|
+
const size = Math.round(
|
|
1253
|
+
box[instance.options.horizontal ? "inlineSize" : "blockSize"]
|
|
1254
|
+
);
|
|
1255
|
+
return size;
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1258
|
+
return element[instance.options.horizontal ? "offsetWidth" : "offsetHeight"];
|
|
1259
|
+
};
|
|
1260
|
+
var windowScroll = (offset, {
|
|
1261
|
+
adjustments = 0,
|
|
1262
|
+
behavior
|
|
1263
|
+
}, instance) => {
|
|
1264
|
+
var _a, _b;
|
|
1265
|
+
const toOffset = offset + adjustments;
|
|
1266
|
+
(_b = (_a = instance.scrollElement) == null ? void 0 : _a.scrollTo) == null ? void 0 : _b.call(_a, {
|
|
1267
|
+
[instance.options.horizontal ? "left" : "top"]: toOffset,
|
|
1268
|
+
behavior
|
|
1269
|
+
});
|
|
1270
|
+
};
|
|
1271
|
+
var Virtualizer = class {
|
|
1272
|
+
constructor(opts) {
|
|
1273
|
+
this.unsubs = [];
|
|
1274
|
+
this.scrollElement = null;
|
|
1275
|
+
this.targetWindow = null;
|
|
1276
|
+
this.isScrolling = false;
|
|
1277
|
+
this.scrollState = null;
|
|
1278
|
+
this.measurementsCache = [];
|
|
1279
|
+
this.itemSizeCache = /* @__PURE__ */ new Map();
|
|
1280
|
+
this.laneAssignments = /* @__PURE__ */ new Map();
|
|
1281
|
+
this.pendingMeasuredCacheIndexes = [];
|
|
1282
|
+
this.prevLanes = void 0;
|
|
1283
|
+
this.lanesChangedFlag = false;
|
|
1284
|
+
this.lanesSettling = false;
|
|
1285
|
+
this.scrollRect = null;
|
|
1286
|
+
this.scrollOffset = null;
|
|
1287
|
+
this.scrollDirection = null;
|
|
1288
|
+
this.scrollAdjustments = 0;
|
|
1289
|
+
this.elementsCache = /* @__PURE__ */ new Map();
|
|
1290
|
+
this.now = () => {
|
|
1291
|
+
var _a2;
|
|
1292
|
+
var _a, _b, _c;
|
|
1293
|
+
return (_a2 = (_c = (_b = (_a = this.targetWindow) == null ? void 0 : _a.performance) == null ? void 0 : _b.now) == null ? void 0 : _c.call(_b)) != null ? _a2 : Date.now();
|
|
1294
|
+
};
|
|
1295
|
+
this.observer = /* @__PURE__ */ (() => {
|
|
1296
|
+
let _ro = null;
|
|
1297
|
+
const get = () => {
|
|
1298
|
+
if (_ro) {
|
|
1299
|
+
return _ro;
|
|
1300
|
+
}
|
|
1301
|
+
if (!this.targetWindow || !this.targetWindow.ResizeObserver) {
|
|
1302
|
+
return null;
|
|
1303
|
+
}
|
|
1304
|
+
return _ro = new this.targetWindow.ResizeObserver((entries) => {
|
|
1305
|
+
entries.forEach((entry) => {
|
|
1306
|
+
const run = () => {
|
|
1307
|
+
const node = entry.target;
|
|
1308
|
+
const index = this.indexFromElement(node);
|
|
1309
|
+
if (!node.isConnected) {
|
|
1310
|
+
this.observer.unobserve(node);
|
|
1311
|
+
return;
|
|
1312
|
+
}
|
|
1313
|
+
if (this.shouldMeasureDuringScroll(index)) {
|
|
1314
|
+
this.resizeItem(
|
|
1315
|
+
index,
|
|
1316
|
+
this.options.measureElement(node, entry, this)
|
|
1317
|
+
);
|
|
1318
|
+
}
|
|
1319
|
+
};
|
|
1320
|
+
this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(run) : run();
|
|
1321
|
+
});
|
|
1322
|
+
});
|
|
1323
|
+
};
|
|
1324
|
+
return {
|
|
1325
|
+
disconnect: () => {
|
|
1326
|
+
var _a;
|
|
1327
|
+
(_a = get()) == null ? void 0 : _a.disconnect();
|
|
1328
|
+
_ro = null;
|
|
1329
|
+
},
|
|
1330
|
+
observe: (target) => {
|
|
1331
|
+
var _a;
|
|
1332
|
+
return (_a = get()) == null ? void 0 : _a.observe(target, { box: "border-box" });
|
|
1333
|
+
},
|
|
1334
|
+
unobserve: (target) => {
|
|
1335
|
+
var _a;
|
|
1336
|
+
return (_a = get()) == null ? void 0 : _a.unobserve(target);
|
|
1337
|
+
}
|
|
1338
|
+
};
|
|
1339
|
+
})();
|
|
1340
|
+
this.range = null;
|
|
1341
|
+
this.setOptions = (opts2) => {
|
|
1342
|
+
Object.entries(opts2).forEach(([key, value]) => {
|
|
1343
|
+
if (typeof value === "undefined") delete opts2[key];
|
|
1344
|
+
});
|
|
1345
|
+
this.options = __spreadValues({
|
|
1346
|
+
debug: false,
|
|
1347
|
+
initialOffset: 0,
|
|
1348
|
+
overscan: 1,
|
|
1349
|
+
paddingStart: 0,
|
|
1350
|
+
paddingEnd: 0,
|
|
1351
|
+
scrollPaddingStart: 0,
|
|
1352
|
+
scrollPaddingEnd: 0,
|
|
1353
|
+
horizontal: false,
|
|
1354
|
+
getItemKey: defaultKeyExtractor,
|
|
1355
|
+
rangeExtractor: defaultRangeExtractor,
|
|
1356
|
+
onChange: () => {
|
|
1357
|
+
},
|
|
1358
|
+
measureElement,
|
|
1359
|
+
initialRect: { width: 0, height: 0 },
|
|
1360
|
+
scrollMargin: 0,
|
|
1361
|
+
gap: 0,
|
|
1362
|
+
indexAttribute: "data-index",
|
|
1363
|
+
initialMeasurementsCache: [],
|
|
1364
|
+
lanes: 1,
|
|
1365
|
+
isScrollingResetDelay: 150,
|
|
1366
|
+
enabled: true,
|
|
1367
|
+
isRtl: false,
|
|
1368
|
+
useScrollendEvent: false,
|
|
1369
|
+
useAnimationFrameWithResizeObserver: false,
|
|
1370
|
+
laneAssignmentMode: "estimate"
|
|
1371
|
+
}, opts2);
|
|
1372
|
+
};
|
|
1373
|
+
this.notify = (sync) => {
|
|
1374
|
+
var _a, _b;
|
|
1375
|
+
(_b = (_a = this.options).onChange) == null ? void 0 : _b.call(_a, this, sync);
|
|
1376
|
+
};
|
|
1377
|
+
this.maybeNotify = memo(
|
|
1378
|
+
() => {
|
|
1379
|
+
this.calculateRange();
|
|
1380
|
+
return [
|
|
1381
|
+
this.isScrolling,
|
|
1382
|
+
this.range ? this.range.startIndex : null,
|
|
1383
|
+
this.range ? this.range.endIndex : null
|
|
1384
|
+
];
|
|
1385
|
+
},
|
|
1386
|
+
(isScrolling) => {
|
|
1387
|
+
this.notify(isScrolling);
|
|
1388
|
+
},
|
|
1389
|
+
{
|
|
1390
|
+
key: "maybeNotify",
|
|
1391
|
+
debug: () => this.options.debug,
|
|
1392
|
+
initialDeps: [
|
|
1393
|
+
this.isScrolling,
|
|
1394
|
+
this.range ? this.range.startIndex : null,
|
|
1395
|
+
this.range ? this.range.endIndex : null
|
|
1396
|
+
]
|
|
1397
|
+
}
|
|
1398
|
+
);
|
|
1399
|
+
this.cleanup = () => {
|
|
1400
|
+
this.unsubs.filter(Boolean).forEach((d) => d());
|
|
1401
|
+
this.unsubs = [];
|
|
1402
|
+
this.observer.disconnect();
|
|
1403
|
+
if (this.rafId != null && this.targetWindow) {
|
|
1404
|
+
this.targetWindow.cancelAnimationFrame(this.rafId);
|
|
1405
|
+
this.rafId = null;
|
|
1406
|
+
}
|
|
1407
|
+
this.scrollState = null;
|
|
1408
|
+
this.scrollElement = null;
|
|
1409
|
+
this.targetWindow = null;
|
|
1410
|
+
};
|
|
1411
|
+
this._didMount = () => {
|
|
1412
|
+
return () => {
|
|
1413
|
+
this.cleanup();
|
|
1414
|
+
};
|
|
1415
|
+
};
|
|
1416
|
+
this._willUpdate = () => {
|
|
1417
|
+
var _a2;
|
|
1418
|
+
var _a;
|
|
1419
|
+
const scrollElement = this.options.enabled ? this.options.getScrollElement() : null;
|
|
1420
|
+
if (this.scrollElement !== scrollElement) {
|
|
1421
|
+
this.cleanup();
|
|
1422
|
+
if (!scrollElement) {
|
|
1423
|
+
this.maybeNotify();
|
|
1424
|
+
return;
|
|
1425
|
+
}
|
|
1426
|
+
this.scrollElement = scrollElement;
|
|
1427
|
+
if (this.scrollElement && "ownerDocument" in this.scrollElement) {
|
|
1428
|
+
this.targetWindow = this.scrollElement.ownerDocument.defaultView;
|
|
1429
|
+
} else {
|
|
1430
|
+
this.targetWindow = (_a2 = (_a = this.scrollElement) == null ? void 0 : _a.window) != null ? _a2 : null;
|
|
1431
|
+
}
|
|
1432
|
+
this.elementsCache.forEach((cached) => {
|
|
1433
|
+
this.observer.observe(cached);
|
|
1434
|
+
});
|
|
1435
|
+
this.unsubs.push(
|
|
1436
|
+
this.options.observeElementRect(this, (rect) => {
|
|
1437
|
+
this.scrollRect = rect;
|
|
1438
|
+
this.maybeNotify();
|
|
1439
|
+
})
|
|
1440
|
+
);
|
|
1441
|
+
this.unsubs.push(
|
|
1442
|
+
this.options.observeElementOffset(this, (offset, isScrolling) => {
|
|
1443
|
+
this.scrollAdjustments = 0;
|
|
1444
|
+
this.scrollDirection = isScrolling ? this.getScrollOffset() < offset ? "forward" : "backward" : null;
|
|
1445
|
+
this.scrollOffset = offset;
|
|
1446
|
+
this.isScrolling = isScrolling;
|
|
1447
|
+
if (this.scrollState) {
|
|
1448
|
+
this.scheduleScrollReconcile();
|
|
1449
|
+
}
|
|
1450
|
+
this.maybeNotify();
|
|
1451
|
+
})
|
|
1452
|
+
);
|
|
1453
|
+
this._scrollToOffset(this.getScrollOffset(), {
|
|
1454
|
+
adjustments: void 0,
|
|
1455
|
+
behavior: void 0
|
|
1456
|
+
});
|
|
1457
|
+
}
|
|
1458
|
+
};
|
|
1459
|
+
this.rafId = null;
|
|
1460
|
+
this.getSize = () => {
|
|
1461
|
+
var _a;
|
|
1462
|
+
if (!this.options.enabled) {
|
|
1463
|
+
this.scrollRect = null;
|
|
1464
|
+
return 0;
|
|
1465
|
+
}
|
|
1466
|
+
this.scrollRect = (_a = this.scrollRect) != null ? _a : this.options.initialRect;
|
|
1467
|
+
return this.scrollRect[this.options.horizontal ? "width" : "height"];
|
|
1468
|
+
};
|
|
1469
|
+
this.getScrollOffset = () => {
|
|
1470
|
+
var _a;
|
|
1471
|
+
if (!this.options.enabled) {
|
|
1472
|
+
this.scrollOffset = null;
|
|
1473
|
+
return 0;
|
|
1474
|
+
}
|
|
1475
|
+
this.scrollOffset = (_a = this.scrollOffset) != null ? _a : typeof this.options.initialOffset === "function" ? this.options.initialOffset() : this.options.initialOffset;
|
|
1476
|
+
return this.scrollOffset;
|
|
1477
|
+
};
|
|
1478
|
+
this.getFurthestMeasurement = (measurements, index) => {
|
|
1479
|
+
const furthestMeasurementsFound = /* @__PURE__ */ new Map();
|
|
1480
|
+
const furthestMeasurements = /* @__PURE__ */ new Map();
|
|
1481
|
+
for (let m = index - 1; m >= 0; m--) {
|
|
1482
|
+
const measurement = measurements[m];
|
|
1483
|
+
if (furthestMeasurementsFound.has(measurement.lane)) {
|
|
1484
|
+
continue;
|
|
1485
|
+
}
|
|
1486
|
+
const previousFurthestMeasurement = furthestMeasurements.get(
|
|
1487
|
+
measurement.lane
|
|
1488
|
+
);
|
|
1489
|
+
if (previousFurthestMeasurement == null || measurement.end > previousFurthestMeasurement.end) {
|
|
1490
|
+
furthestMeasurements.set(measurement.lane, measurement);
|
|
1491
|
+
} else if (measurement.end < previousFurthestMeasurement.end) {
|
|
1492
|
+
furthestMeasurementsFound.set(measurement.lane, true);
|
|
1493
|
+
}
|
|
1494
|
+
if (furthestMeasurementsFound.size === this.options.lanes) {
|
|
1495
|
+
break;
|
|
1496
|
+
}
|
|
1497
|
+
}
|
|
1498
|
+
return furthestMeasurements.size === this.options.lanes ? Array.from(furthestMeasurements.values()).sort((a, b) => {
|
|
1499
|
+
if (a.end === b.end) {
|
|
1500
|
+
return a.index - b.index;
|
|
1501
|
+
}
|
|
1502
|
+
return a.end - b.end;
|
|
1503
|
+
})[0] : void 0;
|
|
1504
|
+
};
|
|
1505
|
+
this.getMeasurementOptions = memo(
|
|
1506
|
+
() => [
|
|
1507
|
+
this.options.count,
|
|
1508
|
+
this.options.paddingStart,
|
|
1509
|
+
this.options.scrollMargin,
|
|
1510
|
+
this.options.getItemKey,
|
|
1511
|
+
this.options.enabled,
|
|
1512
|
+
this.options.lanes,
|
|
1513
|
+
this.options.laneAssignmentMode
|
|
1514
|
+
],
|
|
1515
|
+
(count, paddingStart, scrollMargin, getItemKey, enabled, lanes, laneAssignmentMode) => {
|
|
1516
|
+
const lanesChanged = this.prevLanes !== void 0 && this.prevLanes !== lanes;
|
|
1517
|
+
if (lanesChanged) {
|
|
1518
|
+
this.lanesChangedFlag = true;
|
|
1519
|
+
}
|
|
1520
|
+
this.prevLanes = lanes;
|
|
1521
|
+
this.pendingMeasuredCacheIndexes = [];
|
|
1522
|
+
return {
|
|
1523
|
+
count,
|
|
1524
|
+
paddingStart,
|
|
1525
|
+
scrollMargin,
|
|
1526
|
+
getItemKey,
|
|
1527
|
+
enabled,
|
|
1528
|
+
lanes,
|
|
1529
|
+
laneAssignmentMode
|
|
1530
|
+
};
|
|
1531
|
+
},
|
|
1532
|
+
{
|
|
1533
|
+
key: false
|
|
1534
|
+
}
|
|
1535
|
+
);
|
|
1536
|
+
this.getMeasurements = memo(
|
|
1537
|
+
() => [this.getMeasurementOptions(), this.itemSizeCache],
|
|
1538
|
+
({
|
|
1539
|
+
count,
|
|
1540
|
+
paddingStart,
|
|
1541
|
+
scrollMargin,
|
|
1542
|
+
getItemKey,
|
|
1543
|
+
enabled,
|
|
1544
|
+
lanes,
|
|
1545
|
+
laneAssignmentMode
|
|
1546
|
+
}, itemSizeCache) => {
|
|
1547
|
+
if (!enabled) {
|
|
1548
|
+
this.measurementsCache = [];
|
|
1549
|
+
this.itemSizeCache.clear();
|
|
1550
|
+
this.laneAssignments.clear();
|
|
1551
|
+
return [];
|
|
1552
|
+
}
|
|
1553
|
+
if (this.laneAssignments.size > count) {
|
|
1554
|
+
for (const index of this.laneAssignments.keys()) {
|
|
1555
|
+
if (index >= count) {
|
|
1556
|
+
this.laneAssignments.delete(index);
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1559
|
+
}
|
|
1560
|
+
if (this.lanesChangedFlag) {
|
|
1561
|
+
this.lanesChangedFlag = false;
|
|
1562
|
+
this.lanesSettling = true;
|
|
1563
|
+
this.measurementsCache = [];
|
|
1564
|
+
this.itemSizeCache.clear();
|
|
1565
|
+
this.laneAssignments.clear();
|
|
1566
|
+
this.pendingMeasuredCacheIndexes = [];
|
|
1567
|
+
}
|
|
1568
|
+
if (this.measurementsCache.length === 0 && !this.lanesSettling) {
|
|
1569
|
+
this.measurementsCache = this.options.initialMeasurementsCache;
|
|
1570
|
+
this.measurementsCache.forEach((item) => {
|
|
1571
|
+
this.itemSizeCache.set(item.key, item.size);
|
|
1572
|
+
});
|
|
1573
|
+
}
|
|
1574
|
+
const min = this.lanesSettling ? 0 : this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
|
|
1575
|
+
this.pendingMeasuredCacheIndexes = [];
|
|
1576
|
+
if (this.lanesSettling && this.measurementsCache.length === count) {
|
|
1577
|
+
this.lanesSettling = false;
|
|
1578
|
+
}
|
|
1579
|
+
const measurements = this.measurementsCache.slice(0, min);
|
|
1580
|
+
const laneLastIndex = new Array(lanes).fill(
|
|
1581
|
+
void 0
|
|
1582
|
+
);
|
|
1583
|
+
for (let m = 0; m < min; m++) {
|
|
1584
|
+
const item = measurements[m];
|
|
1585
|
+
if (item) {
|
|
1586
|
+
laneLastIndex[item.lane] = m;
|
|
1587
|
+
}
|
|
1588
|
+
}
|
|
1589
|
+
for (let i = min; i < count; i++) {
|
|
1590
|
+
const key = getItemKey(i);
|
|
1591
|
+
const cachedLane = this.laneAssignments.get(i);
|
|
1592
|
+
let lane;
|
|
1593
|
+
let start;
|
|
1594
|
+
const shouldCacheLane = laneAssignmentMode === "estimate" || itemSizeCache.has(key);
|
|
1595
|
+
if (cachedLane !== void 0 && this.options.lanes > 1) {
|
|
1596
|
+
lane = cachedLane;
|
|
1597
|
+
const prevIndex = laneLastIndex[lane];
|
|
1598
|
+
const prevInLane = prevIndex !== void 0 ? measurements[prevIndex] : void 0;
|
|
1599
|
+
start = prevInLane ? prevInLane.end + this.options.gap : paddingStart + scrollMargin;
|
|
1600
|
+
} else {
|
|
1601
|
+
const furthestMeasurement = this.options.lanes === 1 ? measurements[i - 1] : this.getFurthestMeasurement(measurements, i);
|
|
1602
|
+
start = furthestMeasurement ? furthestMeasurement.end + this.options.gap : paddingStart + scrollMargin;
|
|
1603
|
+
lane = furthestMeasurement ? furthestMeasurement.lane : i % this.options.lanes;
|
|
1604
|
+
if (this.options.lanes > 1 && shouldCacheLane) {
|
|
1605
|
+
this.laneAssignments.set(i, lane);
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
const measuredSize = itemSizeCache.get(key);
|
|
1609
|
+
const size = typeof measuredSize === "number" ? measuredSize : this.options.estimateSize(i);
|
|
1610
|
+
const end = start + size;
|
|
1611
|
+
measurements[i] = {
|
|
1612
|
+
index: i,
|
|
1613
|
+
start,
|
|
1614
|
+
size,
|
|
1615
|
+
end,
|
|
1616
|
+
key,
|
|
1617
|
+
lane
|
|
1618
|
+
};
|
|
1619
|
+
laneLastIndex[lane] = i;
|
|
1620
|
+
}
|
|
1621
|
+
this.measurementsCache = measurements;
|
|
1622
|
+
return measurements;
|
|
1623
|
+
},
|
|
1624
|
+
{
|
|
1625
|
+
key: "getMeasurements",
|
|
1626
|
+
debug: () => this.options.debug
|
|
1627
|
+
}
|
|
1628
|
+
);
|
|
1629
|
+
this.calculateRange = memo(
|
|
1630
|
+
() => [
|
|
1631
|
+
this.getMeasurements(),
|
|
1632
|
+
this.getSize(),
|
|
1633
|
+
this.getScrollOffset(),
|
|
1634
|
+
this.options.lanes
|
|
1635
|
+
],
|
|
1636
|
+
(measurements, outerSize, scrollOffset, lanes) => {
|
|
1637
|
+
return this.range = measurements.length > 0 && outerSize > 0 ? calculateRange({
|
|
1638
|
+
measurements,
|
|
1639
|
+
outerSize,
|
|
1640
|
+
scrollOffset,
|
|
1641
|
+
lanes
|
|
1642
|
+
}) : null;
|
|
1643
|
+
},
|
|
1644
|
+
{
|
|
1645
|
+
key: "calculateRange",
|
|
1646
|
+
debug: () => this.options.debug
|
|
1647
|
+
}
|
|
1648
|
+
);
|
|
1649
|
+
this.getVirtualIndexes = memo(
|
|
1650
|
+
() => {
|
|
1651
|
+
let startIndex = null;
|
|
1652
|
+
let endIndex = null;
|
|
1653
|
+
const range = this.calculateRange();
|
|
1654
|
+
if (range) {
|
|
1655
|
+
startIndex = range.startIndex;
|
|
1656
|
+
endIndex = range.endIndex;
|
|
1657
|
+
}
|
|
1658
|
+
this.maybeNotify.updateDeps([this.isScrolling, startIndex, endIndex]);
|
|
1659
|
+
return [
|
|
1660
|
+
this.options.rangeExtractor,
|
|
1661
|
+
this.options.overscan,
|
|
1662
|
+
this.options.count,
|
|
1663
|
+
startIndex,
|
|
1664
|
+
endIndex
|
|
1665
|
+
];
|
|
1666
|
+
},
|
|
1667
|
+
(rangeExtractor, overscan, count, startIndex, endIndex) => {
|
|
1668
|
+
return startIndex === null || endIndex === null ? [] : rangeExtractor({
|
|
1669
|
+
startIndex,
|
|
1670
|
+
endIndex,
|
|
1671
|
+
overscan,
|
|
1672
|
+
count
|
|
1673
|
+
});
|
|
1674
|
+
},
|
|
1675
|
+
{
|
|
1676
|
+
key: "getVirtualIndexes",
|
|
1677
|
+
debug: () => this.options.debug
|
|
1678
|
+
}
|
|
1679
|
+
);
|
|
1680
|
+
this.indexFromElement = (node) => {
|
|
1681
|
+
const attributeName = this.options.indexAttribute;
|
|
1682
|
+
const indexStr = node.getAttribute(attributeName);
|
|
1683
|
+
if (!indexStr) {
|
|
1684
|
+
console.warn(
|
|
1685
|
+
`Missing attribute name '${attributeName}={index}' on measured element.`
|
|
1686
|
+
);
|
|
1687
|
+
return -1;
|
|
1688
|
+
}
|
|
1689
|
+
return parseInt(indexStr, 10);
|
|
1690
|
+
};
|
|
1691
|
+
this.shouldMeasureDuringScroll = (index) => {
|
|
1692
|
+
var _a2;
|
|
1693
|
+
var _a;
|
|
1694
|
+
if (!this.scrollState || this.scrollState.behavior !== "smooth") {
|
|
1695
|
+
return true;
|
|
1696
|
+
}
|
|
1697
|
+
const scrollIndex = (_a2 = this.scrollState.index) != null ? _a2 : (_a = this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)) == null ? void 0 : _a.index;
|
|
1698
|
+
if (scrollIndex !== void 0 && this.range) {
|
|
1699
|
+
const bufferSize = Math.max(
|
|
1700
|
+
this.options.overscan,
|
|
1701
|
+
Math.ceil((this.range.endIndex - this.range.startIndex) / 2)
|
|
1702
|
+
);
|
|
1703
|
+
const minIndex = Math.max(0, scrollIndex - bufferSize);
|
|
1704
|
+
const maxIndex = Math.min(
|
|
1705
|
+
this.options.count - 1,
|
|
1706
|
+
scrollIndex + bufferSize
|
|
1707
|
+
);
|
|
1708
|
+
return index >= minIndex && index <= maxIndex;
|
|
1709
|
+
}
|
|
1710
|
+
return true;
|
|
1711
|
+
};
|
|
1712
|
+
this.measureElement = (node) => {
|
|
1713
|
+
if (!node) {
|
|
1714
|
+
this.elementsCache.forEach((cached, key2) => {
|
|
1715
|
+
if (!cached.isConnected) {
|
|
1716
|
+
this.observer.unobserve(cached);
|
|
1717
|
+
this.elementsCache.delete(key2);
|
|
1718
|
+
}
|
|
1719
|
+
});
|
|
1720
|
+
return;
|
|
1721
|
+
}
|
|
1722
|
+
const index = this.indexFromElement(node);
|
|
1723
|
+
const key = this.options.getItemKey(index);
|
|
1724
|
+
const prevNode = this.elementsCache.get(key);
|
|
1725
|
+
if (prevNode !== node) {
|
|
1726
|
+
if (prevNode) {
|
|
1727
|
+
this.observer.unobserve(prevNode);
|
|
1728
|
+
}
|
|
1729
|
+
this.observer.observe(node);
|
|
1730
|
+
this.elementsCache.set(key, node);
|
|
1731
|
+
}
|
|
1732
|
+
if ((!this.isScrolling || this.scrollState) && this.shouldMeasureDuringScroll(index)) {
|
|
1733
|
+
this.resizeItem(index, this.options.measureElement(node, void 0, this));
|
|
1734
|
+
}
|
|
1735
|
+
};
|
|
1736
|
+
this.resizeItem = (index, size) => {
|
|
1737
|
+
var _a2;
|
|
1738
|
+
var _a;
|
|
1739
|
+
const item = this.measurementsCache[index];
|
|
1740
|
+
if (!item) return;
|
|
1741
|
+
const itemSize = (_a2 = this.itemSizeCache.get(item.key)) != null ? _a2 : item.size;
|
|
1742
|
+
const delta = size - itemSize;
|
|
1743
|
+
if (delta !== 0) {
|
|
1744
|
+
if (((_a = this.scrollState) == null ? void 0 : _a.behavior) !== "smooth" && (this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(item, delta, this) : item.start < this.getScrollOffset() + this.scrollAdjustments)) {
|
|
1745
|
+
if (this.options.debug) {
|
|
1746
|
+
console.info("correction", delta);
|
|
1747
|
+
}
|
|
1748
|
+
this._scrollToOffset(this.getScrollOffset(), {
|
|
1749
|
+
adjustments: this.scrollAdjustments += delta,
|
|
1750
|
+
behavior: void 0
|
|
1751
|
+
});
|
|
1752
|
+
}
|
|
1753
|
+
this.pendingMeasuredCacheIndexes.push(item.index);
|
|
1754
|
+
this.itemSizeCache = new Map(this.itemSizeCache.set(item.key, size));
|
|
1755
|
+
this.notify(false);
|
|
1756
|
+
}
|
|
1757
|
+
};
|
|
1758
|
+
this.getVirtualItems = memo(
|
|
1759
|
+
() => [this.getVirtualIndexes(), this.getMeasurements()],
|
|
1760
|
+
(indexes, measurements) => {
|
|
1761
|
+
const virtualItems = [];
|
|
1762
|
+
for (let k = 0, len = indexes.length; k < len; k++) {
|
|
1763
|
+
const i = indexes[k];
|
|
1764
|
+
const measurement = measurements[i];
|
|
1765
|
+
virtualItems.push(measurement);
|
|
1766
|
+
}
|
|
1767
|
+
return virtualItems;
|
|
1768
|
+
},
|
|
1769
|
+
{
|
|
1770
|
+
key: "getVirtualItems",
|
|
1771
|
+
debug: () => this.options.debug
|
|
1772
|
+
}
|
|
1773
|
+
);
|
|
1774
|
+
this.getVirtualItemForOffset = (offset) => {
|
|
1775
|
+
const measurements = this.getMeasurements();
|
|
1776
|
+
if (measurements.length === 0) {
|
|
1777
|
+
return void 0;
|
|
1778
|
+
}
|
|
1779
|
+
return notUndefined(
|
|
1780
|
+
measurements[findNearestBinarySearch(
|
|
1781
|
+
0,
|
|
1782
|
+
measurements.length - 1,
|
|
1783
|
+
(index) => notUndefined(measurements[index]).start,
|
|
1784
|
+
offset
|
|
1785
|
+
)]
|
|
1786
|
+
);
|
|
1787
|
+
};
|
|
1788
|
+
this.getMaxScrollOffset = () => {
|
|
1789
|
+
if (!this.scrollElement) return 0;
|
|
1790
|
+
if ("scrollHeight" in this.scrollElement) {
|
|
1791
|
+
return this.options.horizontal ? this.scrollElement.scrollWidth - this.scrollElement.clientWidth : this.scrollElement.scrollHeight - this.scrollElement.clientHeight;
|
|
1792
|
+
} else {
|
|
1793
|
+
const doc = this.scrollElement.document.documentElement;
|
|
1794
|
+
return this.options.horizontal ? doc.scrollWidth - this.scrollElement.innerWidth : doc.scrollHeight - this.scrollElement.innerHeight;
|
|
1795
|
+
}
|
|
1796
|
+
};
|
|
1797
|
+
this.getOffsetForAlignment = (toOffset, align, itemSize = 0) => {
|
|
1798
|
+
if (!this.scrollElement) return 0;
|
|
1799
|
+
const size = this.getSize();
|
|
1800
|
+
const scrollOffset = this.getScrollOffset();
|
|
1801
|
+
if (align === "auto") {
|
|
1802
|
+
align = toOffset >= scrollOffset + size ? "end" : "start";
|
|
1803
|
+
}
|
|
1804
|
+
if (align === "center") {
|
|
1805
|
+
toOffset += (itemSize - size) / 2;
|
|
1806
|
+
} else if (align === "end") {
|
|
1807
|
+
toOffset -= size;
|
|
1808
|
+
}
|
|
1809
|
+
const maxOffset = this.getMaxScrollOffset();
|
|
1810
|
+
return Math.max(Math.min(maxOffset, toOffset), 0);
|
|
1811
|
+
};
|
|
1812
|
+
this.getOffsetForIndex = (index, align = "auto") => {
|
|
1813
|
+
index = Math.max(0, Math.min(index, this.options.count - 1));
|
|
1814
|
+
const size = this.getSize();
|
|
1815
|
+
const scrollOffset = this.getScrollOffset();
|
|
1816
|
+
const item = this.measurementsCache[index];
|
|
1817
|
+
if (!item) return;
|
|
1818
|
+
if (align === "auto") {
|
|
1819
|
+
if (item.end >= scrollOffset + size - this.options.scrollPaddingEnd) {
|
|
1820
|
+
align = "end";
|
|
1821
|
+
} else if (item.start <= scrollOffset + this.options.scrollPaddingStart) {
|
|
1822
|
+
align = "start";
|
|
1823
|
+
} else {
|
|
1824
|
+
return [scrollOffset, align];
|
|
1825
|
+
}
|
|
1826
|
+
}
|
|
1827
|
+
if (align === "end" && index === this.options.count - 1) {
|
|
1828
|
+
return [this.getMaxScrollOffset(), align];
|
|
1829
|
+
}
|
|
1830
|
+
const toOffset = align === "end" ? item.end + this.options.scrollPaddingEnd : item.start - this.options.scrollPaddingStart;
|
|
1831
|
+
return [
|
|
1832
|
+
this.getOffsetForAlignment(toOffset, align, item.size),
|
|
1833
|
+
align
|
|
1834
|
+
];
|
|
1835
|
+
};
|
|
1836
|
+
this.scrollToOffset = (toOffset, { align = "start", behavior = "auto" } = {}) => {
|
|
1837
|
+
const offset = this.getOffsetForAlignment(toOffset, align);
|
|
1838
|
+
const now = this.now();
|
|
1839
|
+
this.scrollState = {
|
|
1840
|
+
index: null,
|
|
1841
|
+
align,
|
|
1842
|
+
behavior,
|
|
1843
|
+
startedAt: now,
|
|
1844
|
+
lastTargetOffset: offset,
|
|
1845
|
+
stableFrames: 0
|
|
1846
|
+
};
|
|
1847
|
+
this._scrollToOffset(offset, { adjustments: void 0, behavior });
|
|
1848
|
+
this.scheduleScrollReconcile();
|
|
1849
|
+
};
|
|
1850
|
+
this.scrollToIndex = (index, {
|
|
1851
|
+
align: initialAlign = "auto",
|
|
1852
|
+
behavior = "auto"
|
|
1853
|
+
} = {}) => {
|
|
1854
|
+
index = Math.max(0, Math.min(index, this.options.count - 1));
|
|
1855
|
+
const offsetInfo = this.getOffsetForIndex(index, initialAlign);
|
|
1856
|
+
if (!offsetInfo) {
|
|
1857
|
+
return;
|
|
1858
|
+
}
|
|
1859
|
+
const [offset, align] = offsetInfo;
|
|
1860
|
+
const now = this.now();
|
|
1861
|
+
this.scrollState = {
|
|
1862
|
+
index,
|
|
1863
|
+
align,
|
|
1864
|
+
behavior,
|
|
1865
|
+
startedAt: now,
|
|
1866
|
+
lastTargetOffset: offset,
|
|
1867
|
+
stableFrames: 0
|
|
1868
|
+
};
|
|
1869
|
+
this._scrollToOffset(offset, { adjustments: void 0, behavior });
|
|
1870
|
+
this.scheduleScrollReconcile();
|
|
1871
|
+
};
|
|
1872
|
+
this.scrollBy = (delta, { behavior = "auto" } = {}) => {
|
|
1873
|
+
const offset = this.getScrollOffset() + delta;
|
|
1874
|
+
const now = this.now();
|
|
1875
|
+
this.scrollState = {
|
|
1876
|
+
index: null,
|
|
1877
|
+
align: "start",
|
|
1878
|
+
behavior,
|
|
1879
|
+
startedAt: now,
|
|
1880
|
+
lastTargetOffset: offset,
|
|
1881
|
+
stableFrames: 0
|
|
1882
|
+
};
|
|
1883
|
+
this._scrollToOffset(offset, { adjustments: void 0, behavior });
|
|
1884
|
+
this.scheduleScrollReconcile();
|
|
1885
|
+
};
|
|
1886
|
+
this.getTotalSize = () => {
|
|
1887
|
+
var _a2;
|
|
1888
|
+
var _a;
|
|
1889
|
+
const measurements = this.getMeasurements();
|
|
1890
|
+
let end;
|
|
1891
|
+
if (measurements.length === 0) {
|
|
1892
|
+
end = this.options.paddingStart;
|
|
1893
|
+
} else if (this.options.lanes === 1) {
|
|
1894
|
+
end = (_a2 = (_a = measurements[measurements.length - 1]) == null ? void 0 : _a.end) != null ? _a2 : 0;
|
|
1895
|
+
} else {
|
|
1896
|
+
const endByLane = Array(this.options.lanes).fill(null);
|
|
1897
|
+
let endIndex = measurements.length - 1;
|
|
1898
|
+
while (endIndex >= 0 && endByLane.some((val) => val === null)) {
|
|
1899
|
+
const item = measurements[endIndex];
|
|
1900
|
+
if (endByLane[item.lane] === null) {
|
|
1901
|
+
endByLane[item.lane] = item.end;
|
|
1902
|
+
}
|
|
1903
|
+
endIndex--;
|
|
1904
|
+
}
|
|
1905
|
+
end = Math.max(...endByLane.filter((val) => val !== null));
|
|
1906
|
+
}
|
|
1907
|
+
return Math.max(
|
|
1908
|
+
end - this.options.scrollMargin + this.options.paddingEnd,
|
|
1909
|
+
0
|
|
1910
|
+
);
|
|
1911
|
+
};
|
|
1912
|
+
this._scrollToOffset = (offset, {
|
|
1913
|
+
adjustments,
|
|
1914
|
+
behavior
|
|
1915
|
+
}) => {
|
|
1916
|
+
this.options.scrollToFn(offset, { behavior, adjustments }, this);
|
|
1917
|
+
};
|
|
1918
|
+
this.measure = () => {
|
|
1919
|
+
this.itemSizeCache = /* @__PURE__ */ new Map();
|
|
1920
|
+
this.laneAssignments = /* @__PURE__ */ new Map();
|
|
1921
|
+
this.notify(false);
|
|
1922
|
+
};
|
|
1923
|
+
this.setOptions(opts);
|
|
1924
|
+
}
|
|
1925
|
+
scheduleScrollReconcile() {
|
|
1926
|
+
if (!this.targetWindow) {
|
|
1927
|
+
this.scrollState = null;
|
|
1928
|
+
return;
|
|
1929
|
+
}
|
|
1930
|
+
if (this.rafId != null) return;
|
|
1931
|
+
this.rafId = this.targetWindow.requestAnimationFrame(() => {
|
|
1932
|
+
this.rafId = null;
|
|
1933
|
+
this.reconcileScroll();
|
|
1934
|
+
});
|
|
1935
|
+
}
|
|
1936
|
+
reconcileScroll() {
|
|
1937
|
+
if (!this.scrollState) return;
|
|
1938
|
+
const el = this.scrollElement;
|
|
1939
|
+
if (!el) return;
|
|
1940
|
+
const MAX_RECONCILE_MS = 5e3;
|
|
1941
|
+
if (this.now() - this.scrollState.startedAt > MAX_RECONCILE_MS) {
|
|
1942
|
+
this.scrollState = null;
|
|
1943
|
+
return;
|
|
1944
|
+
}
|
|
1945
|
+
const offsetInfo = this.scrollState.index != null ? this.getOffsetForIndex(this.scrollState.index, this.scrollState.align) : void 0;
|
|
1946
|
+
const targetOffset = offsetInfo ? offsetInfo[0] : this.scrollState.lastTargetOffset;
|
|
1947
|
+
const STABLE_FRAMES = 1;
|
|
1948
|
+
const targetChanged = targetOffset !== this.scrollState.lastTargetOffset;
|
|
1949
|
+
if (!targetChanged && approxEqual(targetOffset, this.getScrollOffset())) {
|
|
1950
|
+
this.scrollState.stableFrames++;
|
|
1951
|
+
if (this.scrollState.stableFrames >= STABLE_FRAMES) {
|
|
1952
|
+
this.scrollState = null;
|
|
1953
|
+
return;
|
|
1954
|
+
}
|
|
1955
|
+
} else {
|
|
1956
|
+
this.scrollState.stableFrames = 0;
|
|
1957
|
+
if (targetChanged) {
|
|
1958
|
+
this.scrollState.lastTargetOffset = targetOffset;
|
|
1959
|
+
this.scrollState.behavior = "auto";
|
|
1960
|
+
this._scrollToOffset(targetOffset, {
|
|
1961
|
+
adjustments: void 0,
|
|
1962
|
+
behavior: "auto"
|
|
1963
|
+
});
|
|
1964
|
+
}
|
|
1965
|
+
}
|
|
1966
|
+
this.scheduleScrollReconcile();
|
|
1967
|
+
}
|
|
1968
|
+
};
|
|
1969
|
+
var findNearestBinarySearch = (low, high, getCurrentValue, value) => {
|
|
1970
|
+
while (low <= high) {
|
|
1971
|
+
const middle = (low + high) / 2 | 0;
|
|
1972
|
+
const currentValue = getCurrentValue(middle);
|
|
1973
|
+
if (currentValue < value) {
|
|
1974
|
+
low = middle + 1;
|
|
1975
|
+
} else if (currentValue > value) {
|
|
1976
|
+
high = middle - 1;
|
|
1977
|
+
} else {
|
|
1978
|
+
return middle;
|
|
1979
|
+
}
|
|
1980
|
+
}
|
|
1981
|
+
if (low > 0) {
|
|
1982
|
+
return low - 1;
|
|
1983
|
+
} else {
|
|
1984
|
+
return 0;
|
|
1985
|
+
}
|
|
1986
|
+
};
|
|
1987
|
+
function calculateRange({
|
|
1988
|
+
measurements,
|
|
1989
|
+
outerSize,
|
|
1990
|
+
scrollOffset,
|
|
1991
|
+
lanes
|
|
1992
|
+
}) {
|
|
1993
|
+
const lastIndex = measurements.length - 1;
|
|
1994
|
+
const getOffset = (index) => measurements[index].start;
|
|
1995
|
+
if (measurements.length <= lanes) {
|
|
1996
|
+
return {
|
|
1997
|
+
startIndex: 0,
|
|
1998
|
+
endIndex: lastIndex
|
|
1999
|
+
};
|
|
2000
|
+
}
|
|
2001
|
+
let startIndex = findNearestBinarySearch(
|
|
2002
|
+
0,
|
|
2003
|
+
lastIndex,
|
|
2004
|
+
getOffset,
|
|
2005
|
+
scrollOffset
|
|
2006
|
+
);
|
|
2007
|
+
let endIndex = startIndex;
|
|
2008
|
+
if (lanes === 1) {
|
|
2009
|
+
while (endIndex < lastIndex && measurements[endIndex].end < scrollOffset + outerSize) {
|
|
2010
|
+
endIndex++;
|
|
2011
|
+
}
|
|
2012
|
+
} else if (lanes > 1) {
|
|
2013
|
+
const endPerLane = Array(lanes).fill(0);
|
|
2014
|
+
while (endIndex < lastIndex && endPerLane.some((pos) => pos < scrollOffset + outerSize)) {
|
|
2015
|
+
const item = measurements[endIndex];
|
|
2016
|
+
endPerLane[item.lane] = item.end;
|
|
2017
|
+
endIndex++;
|
|
2018
|
+
}
|
|
2019
|
+
const startPerLane = Array(lanes).fill(scrollOffset + outerSize);
|
|
2020
|
+
while (startIndex >= 0 && startPerLane.some((pos) => pos >= scrollOffset)) {
|
|
2021
|
+
const item = measurements[startIndex];
|
|
2022
|
+
startPerLane[item.lane] = item.start;
|
|
2023
|
+
startIndex--;
|
|
2024
|
+
}
|
|
2025
|
+
startIndex = Math.max(0, startIndex - startIndex % lanes);
|
|
2026
|
+
endIndex = Math.min(lastIndex, endIndex + (lanes - 1 - endIndex % lanes));
|
|
2027
|
+
}
|
|
2028
|
+
return { startIndex, endIndex };
|
|
2029
|
+
}
|
|
2030
|
+
|
|
2031
|
+
// ../../node_modules/.pnpm/@tanstack+react-virtual@3.13.24_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/@tanstack/react-virtual/dist/esm/index.js
|
|
2032
|
+
var useIsomorphicLayoutEffect = typeof document !== "undefined" ? React.useLayoutEffect : React.useEffect;
|
|
2033
|
+
function useVirtualizerBase(_a) {
|
|
2034
|
+
var _b = _a, {
|
|
2035
|
+
useFlushSync = true
|
|
2036
|
+
} = _b, options = __objRest(_b, [
|
|
2037
|
+
"useFlushSync"
|
|
2038
|
+
]);
|
|
2039
|
+
const rerender = React.useReducer(() => ({}), {})[1];
|
|
2040
|
+
const resolvedOptions = __spreadProps(__spreadValues({}, options), {
|
|
2041
|
+
onChange: (instance2, sync) => {
|
|
2042
|
+
var _a2;
|
|
2043
|
+
if (useFlushSync && sync) {
|
|
2044
|
+
flushSync(rerender);
|
|
2045
|
+
} else {
|
|
2046
|
+
rerender();
|
|
2047
|
+
}
|
|
2048
|
+
(_a2 = options.onChange) == null ? void 0 : _a2.call(options, instance2, sync);
|
|
2049
|
+
}
|
|
2050
|
+
});
|
|
2051
|
+
const [instance] = React.useState(
|
|
2052
|
+
() => new Virtualizer(resolvedOptions)
|
|
2053
|
+
);
|
|
2054
|
+
instance.setOptions(resolvedOptions);
|
|
2055
|
+
useIsomorphicLayoutEffect(() => {
|
|
2056
|
+
return instance._didMount();
|
|
2057
|
+
}, []);
|
|
2058
|
+
useIsomorphicLayoutEffect(() => {
|
|
2059
|
+
return instance._willUpdate();
|
|
2060
|
+
});
|
|
2061
|
+
return instance;
|
|
2062
|
+
}
|
|
2063
|
+
function useWindowVirtualizer(options) {
|
|
2064
|
+
return useVirtualizerBase(__spreadValues({
|
|
2065
|
+
getScrollElement: () => typeof document !== "undefined" ? window : null,
|
|
2066
|
+
observeElementRect: observeWindowRect,
|
|
2067
|
+
observeElementOffset: observeWindowOffset,
|
|
2068
|
+
scrollToFn: windowScroll,
|
|
2069
|
+
initialOffset: () => typeof document !== "undefined" ? window.scrollY : 0
|
|
2070
|
+
}, options));
|
|
2071
|
+
}
|
|
2072
|
+
|
|
2073
|
+
// ../renderers/src/CollectionRenderer/components/ContentComponent.tsx
|
|
2074
|
+
import { ProcessIndicator, Button as Button4 } from "@transferwise/components";
|
|
2075
|
+
import { useRef as useRef3, useEffect as useEffect7, useMemo, useLayoutEffect as useLayoutEffect2 } from "react";
|
|
2076
|
+
|
|
2077
|
+
// ../renderers/src/step/StepFooter.tsx
|
|
2078
|
+
import { Button as Button3 } from "@transferwise/components";
|
|
2079
|
+
import { useEffect as useEffect6, useRef as useRef2, useState as useState5 } from "react";
|
|
2080
|
+
import { useIntl as useIntl3 } from "react-intl";
|
|
2081
|
+
|
|
2082
|
+
// ../renderers/src/messages/step.messages.ts
|
|
2083
|
+
import { defineMessages as defineMessages3 } from "react-intl";
|
|
2084
|
+
var step_messages_default = defineMessages3({
|
|
2085
|
+
scrollToBottom: {
|
|
2086
|
+
id: "df.wise.step.scrollToBottom",
|
|
2087
|
+
defaultMessage: "Scroll to bottom",
|
|
2088
|
+
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."
|
|
2089
|
+
}
|
|
2090
|
+
});
|
|
2091
|
+
|
|
2092
|
+
// ../renderers/src/step/StepFooter.tsx
|
|
2093
|
+
import { Fragment as Fragment2, jsx as jsx24, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
2094
|
+
var SCROLL_TO_BOTTOM = "scroll-to-bottom";
|
|
2095
|
+
var StepFooter = ({ footer, tags }) => {
|
|
2096
|
+
if (tags == null ? void 0 : tags.includes(SCROLL_TO_BOTTOM)) {
|
|
2097
|
+
return /* @__PURE__ */ jsx24(FooterWithScrollButton, { footer });
|
|
2098
|
+
}
|
|
2099
|
+
return /* @__PURE__ */ jsx24(DefaultFooter, { footer });
|
|
2100
|
+
};
|
|
2101
|
+
var DefaultFooter = ({ footer }) => {
|
|
2102
|
+
const hasFooter = footer && Array.isArray(footer) && footer.length > 0;
|
|
2103
|
+
return hasFooter ? /* @__PURE__ */ jsx24("div", { className: "df-step-fixed__footer", children: footer }) : void 0;
|
|
2104
|
+
};
|
|
2105
|
+
var FooterWithScrollButton = ({ footer }) => {
|
|
2106
|
+
const { formatMessage } = useIntl3();
|
|
2107
|
+
const endOfLayoutRef = useRef2(null);
|
|
2108
|
+
const isElementVisible = useIsElementVisible(endOfLayoutRef);
|
|
2109
|
+
const scrollButton = /* @__PURE__ */ jsx24(
|
|
2110
|
+
Button3,
|
|
2111
|
+
{
|
|
2112
|
+
className: "m-b-1",
|
|
2113
|
+
v2: true,
|
|
2114
|
+
block: true,
|
|
2115
|
+
priority: "tertiary",
|
|
2116
|
+
onClick: () => {
|
|
2117
|
+
var _a;
|
|
2118
|
+
(_a = endOfLayoutRef.current) == null ? void 0 : _a.scrollIntoView({ behavior: "smooth" });
|
|
2119
|
+
},
|
|
2120
|
+
children: formatMessage(step_messages_default.scrollToBottom)
|
|
2121
|
+
}
|
|
2122
|
+
);
|
|
2123
|
+
const hasStepFooterContent = footer && Array.isArray(footer) && footer.length > 0;
|
|
2124
|
+
if (isElementVisible && !hasStepFooterContent) {
|
|
2125
|
+
return /* @__PURE__ */ jsx24("div", { ref: endOfLayoutRef, "aria-hidden": "true" });
|
|
2126
|
+
}
|
|
2127
|
+
return /* @__PURE__ */ jsxs5(Fragment2, { children: [
|
|
2128
|
+
/* @__PURE__ */ jsx24("div", { ref: endOfLayoutRef, "aria-hidden": "true" }),
|
|
2129
|
+
/* @__PURE__ */ jsxs5("div", { className: "df-step-fixed__footer", children: [
|
|
2130
|
+
!isElementVisible && scrollButton,
|
|
2131
|
+
footer
|
|
2132
|
+
] })
|
|
2133
|
+
] });
|
|
2134
|
+
};
|
|
2135
|
+
var useIsElementVisible = (elementRef) => {
|
|
2136
|
+
const [isVisible, setIsVisible] = useState5(false);
|
|
2137
|
+
useEffect6(() => {
|
|
2138
|
+
const element = elementRef.current;
|
|
2139
|
+
if (!element) return;
|
|
2140
|
+
const observer = new IntersectionObserver(([entry]) => {
|
|
2141
|
+
setIsVisible(entry.isIntersecting);
|
|
2142
|
+
});
|
|
2143
|
+
observer.observe(element);
|
|
2144
|
+
return () => observer.disconnect();
|
|
2145
|
+
}, [elementRef]);
|
|
2146
|
+
return isVisible;
|
|
2147
|
+
};
|
|
2148
|
+
|
|
2149
|
+
// ../renderers/src/CollectionRenderer/components/ContentComponent.tsx
|
|
2150
|
+
import { jsx as jsx25, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2151
|
+
var ContentComponent = (props) => {
|
|
2152
|
+
const { state, status, SectionHeader, Item } = props;
|
|
2153
|
+
const endOfContentRef = useRef3(null);
|
|
2154
|
+
const isBottomVisible = useIsElementVisible(endOfContentRef);
|
|
2155
|
+
useEffect7(() => {
|
|
2156
|
+
var _a;
|
|
2157
|
+
console.log("bottom visible", status);
|
|
2158
|
+
if (isBottomVisible && status.type === "idle" && status.loadMore) {
|
|
2159
|
+
(_a = status.loadMore) == null ? void 0 : _a.call(status);
|
|
2160
|
+
}
|
|
2161
|
+
}, [isBottomVisible]);
|
|
2162
|
+
const stateCount = state.sections.reduce(
|
|
2163
|
+
(total, section) => section.items.length + total + (section.title ? 1 : 0),
|
|
2164
|
+
0
|
|
2165
|
+
);
|
|
2166
|
+
const items = useMemo(() => {
|
|
2167
|
+
return state.sections.reduce((acc, section) => {
|
|
2168
|
+
return [
|
|
2169
|
+
...acc,
|
|
2170
|
+
...section.title ? [
|
|
2171
|
+
{
|
|
2172
|
+
type: "header",
|
|
2173
|
+
title: section.title,
|
|
2174
|
+
items: section.items,
|
|
2175
|
+
id: section.id
|
|
2176
|
+
}
|
|
2177
|
+
] : [],
|
|
2178
|
+
...section.items.map((item) => ({
|
|
2179
|
+
item,
|
|
2180
|
+
type: "item"
|
|
2181
|
+
}))
|
|
2182
|
+
];
|
|
2183
|
+
}, []);
|
|
2184
|
+
}, [stateCount]);
|
|
2185
|
+
const listRef = useRef3(null);
|
|
2186
|
+
const listOffsetRef = useRef3(0);
|
|
2187
|
+
useLayoutEffect2(() => {
|
|
2188
|
+
var _a, _b;
|
|
2189
|
+
listOffsetRef.current = (_b = (_a = listRef.current) == null ? void 0 : _a.offsetTop) != null ? _b : 0;
|
|
2190
|
+
});
|
|
2191
|
+
const virtualizer = useWindowVirtualizer({
|
|
2192
|
+
count: stateCount,
|
|
2193
|
+
estimateSize: () => 120,
|
|
2194
|
+
// todo, we could be clever here. Is it worth it?
|
|
2195
|
+
overscan: 10,
|
|
2196
|
+
scrollMargin: listOffsetRef.current
|
|
2197
|
+
});
|
|
2198
|
+
const showState = status.type === "idle" || status.reason === "pagination";
|
|
2199
|
+
return /* @__PURE__ */ jsxs6("div", { ref: listRef, children: [
|
|
2200
|
+
showState && state.beforeSections,
|
|
2201
|
+
showState && /* @__PURE__ */ jsx25(
|
|
2202
|
+
"div",
|
|
2203
|
+
{
|
|
2204
|
+
style: {
|
|
2205
|
+
height: `${virtualizer.getTotalSize()}px`,
|
|
2206
|
+
width: "100%",
|
|
2207
|
+
position: "relative"
|
|
2208
|
+
},
|
|
2209
|
+
children: virtualizer.getVirtualItems().map((item) => {
|
|
2210
|
+
const i = items[item.index];
|
|
2211
|
+
if (!i) {
|
|
2212
|
+
return null;
|
|
2213
|
+
}
|
|
2214
|
+
return /* @__PURE__ */ jsx25(
|
|
2215
|
+
"div",
|
|
2216
|
+
{
|
|
2217
|
+
ref: virtualizer.measureElement,
|
|
2218
|
+
"data-index": item.index,
|
|
2219
|
+
style: {
|
|
2220
|
+
position: "absolute",
|
|
2221
|
+
top: 0,
|
|
2222
|
+
left: 0,
|
|
2223
|
+
width: "100%",
|
|
2224
|
+
transform: `translateY(${item.start - virtualizer.options.scrollMargin}px)`
|
|
2225
|
+
},
|
|
2226
|
+
children: i.type === "header" ? /* @__PURE__ */ jsx25(SectionHeader, __spreadValues({}, i)) : /* @__PURE__ */ jsx25(Item, __spreadValues({}, i.item))
|
|
2227
|
+
},
|
|
2228
|
+
item.key
|
|
2229
|
+
);
|
|
2230
|
+
})
|
|
2231
|
+
}
|
|
2232
|
+
),
|
|
2233
|
+
/* @__PURE__ */ jsxs6("div", { ref: endOfContentRef, className: "d-flex m-x-auto m-y-2", children: [
|
|
2234
|
+
status.type === "idle" && status.loadMore || status.type === "loading" ? /* @__PURE__ */ jsx25(ProcessIndicator, { size: "xs" }) : null,
|
|
2235
|
+
status.type === "error" && status.reason === "pagination" ? /* @__PURE__ */ jsx25("div", { className: "d-flex m-x-auto", children: /* @__PURE__ */ jsx25(Button4, { v2: true, size: "sm", priority: "secondary-neutral", onClick: status.retry, children: "Load more" }) }) : null
|
|
2236
|
+
] }),
|
|
2237
|
+
showState && state.afterSections
|
|
2238
|
+
] });
|
|
2239
|
+
};
|
|
2240
|
+
|
|
2241
|
+
// ../renderers/src/CollectionRenderer/components/SearchComponent.tsx
|
|
2242
|
+
import { InputGroup, Input } from "@transferwise/components";
|
|
2243
|
+
import { Search } from "@transferwise/icons";
|
|
2244
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
2245
|
+
var SearchComponent = ({ state, features }) => {
|
|
2246
|
+
const { search } = state;
|
|
2247
|
+
if (!search) {
|
|
2248
|
+
return;
|
|
2249
|
+
}
|
|
2250
|
+
return /* @__PURE__ */ jsx26(
|
|
2251
|
+
FieldInput_default,
|
|
2252
|
+
{
|
|
2253
|
+
id: "search",
|
|
2254
|
+
description: "",
|
|
2255
|
+
validation: void 0,
|
|
2256
|
+
help: "",
|
|
2257
|
+
label: search.title,
|
|
2258
|
+
features,
|
|
2259
|
+
children: /* @__PURE__ */ jsx26(InputGroup, { addonStart: { content: /* @__PURE__ */ jsx26(Search, { size: 24 }) }, children: /* @__PURE__ */ jsx26(
|
|
2260
|
+
Input,
|
|
2261
|
+
{
|
|
2262
|
+
id: "search",
|
|
2263
|
+
name: "search",
|
|
2264
|
+
shape: "pill",
|
|
2265
|
+
placeholder: search.hint,
|
|
2266
|
+
type: "text",
|
|
2267
|
+
value: search.query,
|
|
2268
|
+
onChange: ({ currentTarget: { value } }) => {
|
|
2269
|
+
search.onChange(value);
|
|
2270
|
+
}
|
|
2271
|
+
}
|
|
2272
|
+
) })
|
|
2273
|
+
}
|
|
2274
|
+
);
|
|
2275
|
+
};
|
|
2276
|
+
|
|
2277
|
+
// ../renderers/src/CollectionRenderer/components/FilterComponent.tsx
|
|
2278
|
+
import { Chips } from "@transferwise/components";
|
|
2279
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
2280
|
+
var FiltersComponent = ({ state }) => {
|
|
2281
|
+
const { filters } = state;
|
|
2282
|
+
return filters.map((filter) => {
|
|
2283
|
+
var _a;
|
|
2284
|
+
return /* @__PURE__ */ jsx27(FilterComponent, __spreadValues({}, filter), JSON.stringify((_a = filter.options) == null ? void 0 : _a.map((o) => o.value)));
|
|
2285
|
+
});
|
|
2286
|
+
};
|
|
2287
|
+
var FilterComponent = (filter) => {
|
|
2288
|
+
const { multiSelect, options } = filter;
|
|
2289
|
+
if (!options) {
|
|
2290
|
+
return null;
|
|
2291
|
+
}
|
|
2292
|
+
return /* @__PURE__ */ jsx27(
|
|
2293
|
+
Chips,
|
|
2294
|
+
{
|
|
2295
|
+
className: "m-b-1",
|
|
2296
|
+
multiple: multiSelect,
|
|
2297
|
+
selected: options.some((option) => option.selected) ? options.filter((option) => option.selected).map((option) => option.value) : multiSelect ? [] : "",
|
|
2298
|
+
chips: [
|
|
2299
|
+
...options.map((option) => ({
|
|
2300
|
+
value: option.value,
|
|
2301
|
+
label: option.title
|
|
2302
|
+
}))
|
|
2303
|
+
],
|
|
2304
|
+
onChange: (value) => {
|
|
2305
|
+
var _a;
|
|
2306
|
+
if (value.selectedValue === "") {
|
|
2307
|
+
options == null ? void 0 : options.filter((option) => option.selected).map((option) => option == null ? void 0 : option.onSelect());
|
|
2308
|
+
return;
|
|
2309
|
+
}
|
|
2310
|
+
(_a = options == null ? void 0 : options.find((option) => value.selectedValue === option.value)) == null ? void 0 : _a.onSelect();
|
|
2311
|
+
}
|
|
2312
|
+
},
|
|
2313
|
+
JSON.stringify(options)
|
|
2314
|
+
);
|
|
2315
|
+
};
|
|
2316
|
+
|
|
2317
|
+
// ../renderers/src/CollectionRenderer/components/ItemComponent.tsx
|
|
2318
|
+
import { ListItem as ListItem6 } from "@transferwise/components";
|
|
2319
|
+
|
|
2320
|
+
// ../renderers/src/utils/listItem/getAdditionalInfo.tsx
|
|
2321
|
+
import { ListItem as ListItem4 } from "@transferwise/components";
|
|
2322
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
2323
|
+
var getAdditionalInfo = (additionalInfo) => {
|
|
2324
|
+
var _a, _b;
|
|
2325
|
+
if (!additionalInfo) {
|
|
2326
|
+
return void 0;
|
|
2327
|
+
}
|
|
2328
|
+
const { href, text, onClick } = additionalInfo;
|
|
2329
|
+
if (href || onClick) {
|
|
2330
|
+
return /* @__PURE__ */ jsx28(
|
|
2331
|
+
ListItem4.AdditionalInfo,
|
|
2332
|
+
{
|
|
2333
|
+
action: __spreadValues({
|
|
2334
|
+
label: text
|
|
2335
|
+
}, (_b = (_a = additionalInfo.getAnchorProps) == null ? void 0 : _a.call(additionalInfo)) != null ? _b : { onClick })
|
|
2336
|
+
}
|
|
2337
|
+
);
|
|
2338
|
+
}
|
|
2339
|
+
return /* @__PURE__ */ jsx28(ListItem4.AdditionalInfo, { children: additionalInfo == null ? void 0 : additionalInfo.text });
|
|
2340
|
+
};
|
|
2341
|
+
|
|
2342
|
+
// ../renderers/src/utils/listItem/getCTAControl.tsx
|
|
2343
|
+
import { ListItem as ListItem5 } from "@transferwise/components";
|
|
2344
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
2345
|
+
var getCTAControl = (callToAction, { ctaSecondary, fullyInteractive }) => {
|
|
2346
|
+
if (!callToAction) {
|
|
2347
|
+
return void 0;
|
|
2348
|
+
}
|
|
2349
|
+
const { accessibilityDescription, title, context } = callToAction;
|
|
2350
|
+
const { priority, sentiment } = getPriorityAndSentiment(ctaSecondary, context);
|
|
2351
|
+
return /* @__PURE__ */ jsx29(
|
|
2352
|
+
ListItem5.Button,
|
|
2353
|
+
__spreadProps(__spreadValues({}, callToAction.getAnchorProps()), {
|
|
2354
|
+
partiallyInteractive: !fullyInteractive,
|
|
2355
|
+
priority,
|
|
2356
|
+
"aria-description": accessibilityDescription,
|
|
2357
|
+
sentiment,
|
|
2358
|
+
children: title
|
|
2359
|
+
})
|
|
2360
|
+
);
|
|
2361
|
+
};
|
|
2362
|
+
var getPriorityAndSentiment = (ctaSecondary, context) => {
|
|
2363
|
+
if (context === "negative") {
|
|
2364
|
+
return { priority: "secondary", sentiment: "negative" };
|
|
2365
|
+
}
|
|
2366
|
+
return { priority: ctaSecondary ? "secondary" : "secondary-neutral", sentiment: "default" };
|
|
2367
|
+
};
|
|
2368
|
+
|
|
2369
|
+
// ../renderers/src/utils/listItem/shouldUseAvatar.ts
|
|
2370
|
+
var shouldUseAvatar = (control, tags) => {
|
|
2371
|
+
var _a;
|
|
2372
|
+
return control === "with-avatar" || ((_a = tags == null ? void 0 : tags.includes("with-avatar")) != null ? _a : false);
|
|
2373
|
+
};
|
|
2374
|
+
|
|
2375
|
+
// ../renderers/src/CollectionRenderer/components/ItemComponent.tsx
|
|
2376
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
2377
|
+
var ItemComponent = (props) => {
|
|
2378
|
+
var _a, _b;
|
|
2379
|
+
const {
|
|
2380
|
+
title,
|
|
2381
|
+
description,
|
|
2382
|
+
supportingValues,
|
|
2383
|
+
media,
|
|
2384
|
+
additionalInfo,
|
|
2385
|
+
inlineAlert,
|
|
2386
|
+
href,
|
|
2387
|
+
onClick,
|
|
2388
|
+
callToAction,
|
|
2389
|
+
tags,
|
|
2390
|
+
parentTags,
|
|
2391
|
+
control
|
|
2392
|
+
} = props;
|
|
2393
|
+
const controlOptions = {
|
|
2394
|
+
ctaSecondary: (_a = tags == null ? void 0 : tags.includes("cta-secondary")) != null ? _a : false,
|
|
2395
|
+
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
2396
|
+
};
|
|
2397
|
+
return /* @__PURE__ */ jsx30(
|
|
2398
|
+
ListItem6,
|
|
2399
|
+
{
|
|
2400
|
+
title,
|
|
2401
|
+
subtitle: description,
|
|
2402
|
+
valueTitle: supportingValues == null ? void 0 : supportingValues.value,
|
|
2403
|
+
valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
|
|
2404
|
+
media: getMedia(media, shouldUseAvatar(control, parentTags)),
|
|
2405
|
+
prompt: getInlineAlert(inlineAlert),
|
|
2406
|
+
additionalInfo: getAdditionalInfo(additionalInfo),
|
|
2407
|
+
control: onClick || href ? getNavigationControl(onClick, href) : getCTAControl(callToAction, controlOptions)
|
|
2408
|
+
},
|
|
2409
|
+
title
|
|
2410
|
+
);
|
|
2411
|
+
};
|
|
2412
|
+
var getNavigationControl = (onClick, href) => {
|
|
2413
|
+
if (href) {
|
|
2414
|
+
return /* @__PURE__ */ jsx30(ListItem6.Navigation, { href });
|
|
2415
|
+
}
|
|
2416
|
+
if (onClick) {
|
|
2417
|
+
return /* @__PURE__ */ jsx30(ListItem6.Navigation, { onClick });
|
|
2418
|
+
}
|
|
2419
|
+
return null;
|
|
2420
|
+
};
|
|
2421
|
+
|
|
2422
|
+
// ../renderers/src/CollectionRenderer/components/SectionHeaderComponent.tsx
|
|
2423
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
2424
|
+
var SectionHeaderComponent = ({
|
|
2425
|
+
title,
|
|
2426
|
+
callToAction
|
|
2427
|
+
}) => /* @__PURE__ */ jsx31(Header, { title, callToAction });
|
|
2428
|
+
|
|
2429
|
+
// ../renderers/src/CollectionRenderer/createCollectionRenderer.tsx
|
|
2430
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
2431
|
+
var createCollectionRenderer = (canRender, components) => {
|
|
2432
|
+
const componeontsWithDefaults = __spreadValues({
|
|
2433
|
+
Search: SearchComponent,
|
|
2434
|
+
Filters: FiltersComponent,
|
|
2435
|
+
Filter: FilterComponent,
|
|
2436
|
+
Item: ItemComponent,
|
|
2437
|
+
SectionHeader: SectionHeaderComponent,
|
|
2438
|
+
Results: ContentComponent
|
|
2439
|
+
}, components);
|
|
2440
|
+
return {
|
|
2441
|
+
canRenderType: "collection",
|
|
2442
|
+
canRender,
|
|
2443
|
+
render: (props) => {
|
|
2444
|
+
return /* @__PURE__ */ jsx32(CollectionRendererComponent, __spreadValues(__spreadValues({}, props), componeontsWithDefaults));
|
|
2445
|
+
}
|
|
2446
|
+
};
|
|
2447
|
+
};
|
|
2448
|
+
|
|
2449
|
+
// ../renderers/src/CollectionRenderer/CollectionRenderer.tsx
|
|
2450
|
+
import { Fragment as Fragment3, jsx as jsx33, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2451
|
+
var CollectionRendererComponent = (props) => {
|
|
2452
|
+
const { status, Search: Search4, Filters, Results } = props;
|
|
2453
|
+
return /* @__PURE__ */ jsxs7(Fragment3, { children: [
|
|
2454
|
+
/* @__PURE__ */ jsx33(Search4, __spreadValues({}, props)),
|
|
2455
|
+
/* @__PURE__ */ jsx33(Filters, __spreadValues({}, props)),
|
|
2456
|
+
status.type === "idle" || status.type === "loading" ? /* @__PURE__ */ jsx33(Results, __spreadValues({}, props)) : void 0,
|
|
2457
|
+
status.type === "error" && status.reason === "search" && /* @__PURE__ */ jsxs7(InlinePrompt, { width: "full", sentiment: "negative", children: [
|
|
2458
|
+
"Something went wrong,\xA0",
|
|
2459
|
+
/* @__PURE__ */ jsx33(DSLink, { onClick: status.retry, children: "click here to retry" })
|
|
2460
|
+
] })
|
|
2461
|
+
] });
|
|
2462
|
+
};
|
|
2463
|
+
var CollectionRenderer = createCollectionRenderer(() => true, {
|
|
2464
|
+
Search: (props) => /* @__PURE__ */ jsx33(SearchComponent, __spreadValues({}, props)),
|
|
2465
|
+
Filters: (props) => /* @__PURE__ */ jsx33(FiltersComponent, __spreadValues({}, props)),
|
|
2466
|
+
Filter: (props) => /* @__PURE__ */ jsx33(FilterComponent, __spreadValues({}, props)),
|
|
2467
|
+
Item: (props) => /* @__PURE__ */ jsx33(ItemComponent, __spreadValues({}, props)),
|
|
2468
|
+
SectionHeader: (props) => /* @__PURE__ */ jsx33(SectionHeaderComponent, __spreadValues({}, props)),
|
|
2469
|
+
Results: (props) => /* @__PURE__ */ jsx33(ContentComponent, __spreadValues({}, props))
|
|
2470
|
+
});
|
|
2471
|
+
var CollectionRenderer_default = CollectionRenderer;
|
|
1103
2472
|
|
|
1104
2473
|
// ../renderers/src/ColumnsRenderer.tsx
|
|
1105
2474
|
var import_classnames3 = __toESM(require_classnames());
|
|
1106
2475
|
|
|
1107
2476
|
// ../renderers/src/utils/useIsCollapsed.ts
|
|
1108
|
-
import { useEffect as
|
|
2477
|
+
import { useEffect as useEffect8, useState as useState6 } from "react";
|
|
1109
2478
|
var COLLAPSE_QUERY = "(max-width: 767.98px)";
|
|
1110
2479
|
var supportsMatchMedia = () => typeof window !== "undefined" && !!window.matchMedia;
|
|
1111
2480
|
var useIsCollapsed = () => {
|
|
1112
|
-
const [collapsed, setCollapsed] =
|
|
2481
|
+
const [collapsed, setCollapsed] = useState6(
|
|
1113
2482
|
() => supportsMatchMedia() && window.matchMedia(COLLAPSE_QUERY).matches
|
|
1114
2483
|
);
|
|
1115
|
-
|
|
2484
|
+
useEffect8(() => {
|
|
1116
2485
|
if (supportsMatchMedia()) {
|
|
1117
2486
|
const mql = window.matchMedia(COLLAPSE_QUERY);
|
|
1118
2487
|
const update = () => setCollapsed(mql.matches);
|
|
@@ -1125,7 +2494,7 @@ var useIsCollapsed = () => {
|
|
|
1125
2494
|
};
|
|
1126
2495
|
|
|
1127
2496
|
// ../renderers/src/ColumnsRenderer.tsx
|
|
1128
|
-
import { jsx as
|
|
2497
|
+
import { jsx as jsx34, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1129
2498
|
var RIGHT_FIRST_STACKING = "right-first-stacking";
|
|
1130
2499
|
var ColumnsRenderer = {
|
|
1131
2500
|
canRenderType: "columns",
|
|
@@ -1141,9 +2510,9 @@ function ColumnsRendererComponent({
|
|
|
1141
2510
|
var _a;
|
|
1142
2511
|
const isCollapsed = useIsCollapsed();
|
|
1143
2512
|
const reverse = isCollapsed && ((_a = tags == null ? void 0 : tags.includes(RIGHT_FIRST_STACKING)) != null ? _a : false);
|
|
1144
|
-
const startColumn = /* @__PURE__ */
|
|
1145
|
-
const endColumn = /* @__PURE__ */
|
|
1146
|
-
return /* @__PURE__ */
|
|
2513
|
+
const startColumn = /* @__PURE__ */ jsx34("div", { className: "df-columns-renderer-column", children: startChildren });
|
|
2514
|
+
const endColumn = /* @__PURE__ */ jsx34("div", { className: "df-columns-renderer-column", children: endChildren });
|
|
2515
|
+
return /* @__PURE__ */ jsxs8(
|
|
1147
2516
|
"div",
|
|
1148
2517
|
{
|
|
1149
2518
|
className: (0, import_classnames3.default)("df-columns-renderer-container", getMargin(margin), {
|
|
@@ -1187,7 +2556,7 @@ var dateToDateString = (date) => {
|
|
|
1187
2556
|
};
|
|
1188
2557
|
|
|
1189
2558
|
// ../renderers/src/components/VariableDateInput.tsx
|
|
1190
|
-
import { jsx as
|
|
2559
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
1191
2560
|
function VariableDateInput({
|
|
1192
2561
|
control,
|
|
1193
2562
|
inputProps
|
|
@@ -1203,7 +2572,7 @@ function VariableDateInput({
|
|
|
1203
2572
|
onFocus
|
|
1204
2573
|
} = inputProps;
|
|
1205
2574
|
if (control === "date-lookup") {
|
|
1206
|
-
return /* @__PURE__ */
|
|
2575
|
+
return /* @__PURE__ */ jsx35(
|
|
1207
2576
|
DateLookup,
|
|
1208
2577
|
{
|
|
1209
2578
|
value: dateStringToDateOrNull(inputProps.value),
|
|
@@ -1219,7 +2588,7 @@ function VariableDateInput({
|
|
|
1219
2588
|
}
|
|
1220
2589
|
);
|
|
1221
2590
|
}
|
|
1222
|
-
return /* @__PURE__ */
|
|
2591
|
+
return /* @__PURE__ */ jsx35(
|
|
1223
2592
|
DateInput,
|
|
1224
2593
|
__spreadProps(__spreadValues({}, inputProps), {
|
|
1225
2594
|
dayAutoComplete: getAutocompleteString(autoComplete, "day"),
|
|
@@ -1236,7 +2605,7 @@ var getAutocompleteString = (value, suffix) => {
|
|
|
1236
2605
|
var VariableDateInput_default = VariableDateInput;
|
|
1237
2606
|
|
|
1238
2607
|
// ../renderers/src/DateInputRenderer.tsx
|
|
1239
|
-
import { jsx as
|
|
2608
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
1240
2609
|
var DateInputRenderer = {
|
|
1241
2610
|
canRenderType: "input-date",
|
|
1242
2611
|
render: (props) => {
|
|
@@ -1261,7 +2630,7 @@ var DateInputRenderer = {
|
|
|
1261
2630
|
]);
|
|
1262
2631
|
const value = initialValue != null ? initialValue : "";
|
|
1263
2632
|
const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
|
|
1264
|
-
return /* @__PURE__ */
|
|
2633
|
+
return /* @__PURE__ */ jsx36(
|
|
1265
2634
|
FieldInput_default,
|
|
1266
2635
|
{
|
|
1267
2636
|
id,
|
|
@@ -1272,7 +2641,7 @@ var DateInputRenderer = {
|
|
|
1272
2641
|
loadingState: props.fieldLoadingState,
|
|
1273
2642
|
help,
|
|
1274
2643
|
features: props.features,
|
|
1275
|
-
children: /* @__PURE__ */
|
|
2644
|
+
children: /* @__PURE__ */ jsx36(VariableDateInput_default, { control, inputProps })
|
|
1276
2645
|
}
|
|
1277
2646
|
);
|
|
1278
2647
|
}
|
|
@@ -1280,44 +2649,16 @@ var DateInputRenderer = {
|
|
|
1280
2649
|
var DateInputRenderer_default = DateInputRenderer;
|
|
1281
2650
|
|
|
1282
2651
|
// ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
|
|
1283
|
-
import { ListItem as
|
|
1284
|
-
|
|
1285
|
-
// ../renderers/src/utils/listItem/getAdditionalInfo.tsx
|
|
1286
|
-
import { ListItem as ListItem4 } from "@transferwise/components";
|
|
1287
|
-
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
1288
|
-
var getAdditionalInfo = (additionalInfo) => {
|
|
1289
|
-
var _a, _b;
|
|
1290
|
-
if (!additionalInfo) {
|
|
1291
|
-
return void 0;
|
|
1292
|
-
}
|
|
1293
|
-
const { href, text, onClick } = additionalInfo;
|
|
1294
|
-
if (href || onClick) {
|
|
1295
|
-
return /* @__PURE__ */ jsx27(
|
|
1296
|
-
ListItem4.AdditionalInfo,
|
|
1297
|
-
{
|
|
1298
|
-
action: __spreadValues({
|
|
1299
|
-
label: text
|
|
1300
|
-
}, (_b = (_a = additionalInfo.getAnchorProps) == null ? void 0 : _a.call(additionalInfo)) != null ? _b : { onClick })
|
|
1301
|
-
}
|
|
1302
|
-
);
|
|
1303
|
-
}
|
|
1304
|
-
return /* @__PURE__ */ jsx27(ListItem4.AdditionalInfo, { children: additionalInfo == null ? void 0 : additionalInfo.text });
|
|
1305
|
-
};
|
|
1306
|
-
|
|
1307
|
-
// ../renderers/src/utils/listItem/shouldUseAvatar.ts
|
|
1308
|
-
var shouldUseAvatar = (control, tags) => {
|
|
1309
|
-
var _a;
|
|
1310
|
-
return control === "with-avatar" || ((_a = tags == null ? void 0 : tags.includes("with-avatar")) != null ? _a : false);
|
|
1311
|
-
};
|
|
2652
|
+
import { ListItem as ListItem7 } from "@transferwise/components";
|
|
1312
2653
|
|
|
1313
2654
|
// ../renderers/src/DecisionRenderer/DecisionWrapper.tsx
|
|
1314
|
-
import { Header as
|
|
1315
|
-
import { useState as
|
|
1316
|
-
import { useIntl as
|
|
2655
|
+
import { Header as Header3, SearchInput } from "@transferwise/components";
|
|
2656
|
+
import { useState as useState7 } from "react";
|
|
2657
|
+
import { useIntl as useIntl5 } from "react-intl";
|
|
1317
2658
|
|
|
1318
2659
|
// ../renderers/src/messages/filter.messages.ts
|
|
1319
|
-
import { defineMessages as
|
|
1320
|
-
var filter_messages_default =
|
|
2660
|
+
import { defineMessages as defineMessages4 } from "react-intl";
|
|
2661
|
+
var filter_messages_default = defineMessages4({
|
|
1321
2662
|
placeholder: {
|
|
1322
2663
|
id: "df.wise.filter.placeholder",
|
|
1323
2664
|
defaultMessage: "Start typing to search",
|
|
@@ -1383,12 +2724,12 @@ function filterAndSortDecisionOptions(selectOptions, query) {
|
|
|
1383
2724
|
var normalizeAndRemoveAccents = (text) => text.trim().toLowerCase().normalize("NFKD").replace(new RegExp("\\p{Diacritic}", "gu"), "");
|
|
1384
2725
|
|
|
1385
2726
|
// ../renderers/src/DecisionRenderer/GroupedDecisionList.tsx
|
|
1386
|
-
import { Header, Section } from "@transferwise/components";
|
|
1387
|
-
import { useIntl as
|
|
2727
|
+
import { Header as Header2, Section } from "@transferwise/components";
|
|
2728
|
+
import { useIntl as useIntl4 } from "react-intl";
|
|
1388
2729
|
|
|
1389
2730
|
// ../renderers/src/messages/group.messages.ts
|
|
1390
|
-
import { defineMessages as
|
|
1391
|
-
var group_messages_default =
|
|
2731
|
+
import { defineMessages as defineMessages5 } from "react-intl";
|
|
2732
|
+
var group_messages_default = defineMessages5({
|
|
1392
2733
|
all: {
|
|
1393
2734
|
id: "df.wise.group.all",
|
|
1394
2735
|
defaultMessage: "All",
|
|
@@ -1422,19 +2763,19 @@ var getGroupsFromTags = (knownTags, items) => {
|
|
|
1422
2763
|
};
|
|
1423
2764
|
|
|
1424
2765
|
// ../renderers/src/DecisionRenderer/GroupedDecisionList.tsx
|
|
1425
|
-
import { Fragment, jsx as
|
|
2766
|
+
import { Fragment as Fragment4, jsx as jsx37, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1426
2767
|
var groupingTags = Object.keys(group_messages_default).filter((key) => key !== "all");
|
|
1427
2768
|
var isGroupedDecision = (options) => {
|
|
1428
2769
|
return getGroupsFromTags(groupingTags, options).length > 0;
|
|
1429
2770
|
};
|
|
1430
2771
|
var GroupedDecisionList = (_a) => {
|
|
1431
2772
|
var _b = _a, { renderDecisionList: renderDecisionList2 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
|
|
1432
|
-
const { formatMessage } =
|
|
2773
|
+
const { formatMessage } = useIntl4();
|
|
1433
2774
|
const { options } = rest;
|
|
1434
2775
|
const itemsByTag = [...getGroupsFromTags(groupingTags, options), { tag: "all", items: options }];
|
|
1435
|
-
return /* @__PURE__ */
|
|
1436
|
-
/* @__PURE__ */
|
|
1437
|
-
|
|
2776
|
+
return /* @__PURE__ */ jsx37(Fragment4, { children: itemsByTag.map(({ tag, items }) => /* @__PURE__ */ jsxs9(Section, { children: [
|
|
2777
|
+
/* @__PURE__ */ jsx37(
|
|
2778
|
+
Header2,
|
|
1438
2779
|
{
|
|
1439
2780
|
as: "h2",
|
|
1440
2781
|
title: tag in group_messages_default ? formatMessage(group_messages_default[tag]) : tag
|
|
@@ -1445,25 +2786,25 @@ var GroupedDecisionList = (_a) => {
|
|
|
1445
2786
|
};
|
|
1446
2787
|
|
|
1447
2788
|
// ../renderers/src/DecisionRenderer/DecisionWrapper.tsx
|
|
1448
|
-
import { Fragment as
|
|
2789
|
+
import { Fragment as Fragment5, jsx as jsx38, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1449
2790
|
var DecisionWrapper = (props) => {
|
|
1450
|
-
return /* @__PURE__ */
|
|
1451
|
-
props.title && /* @__PURE__ */
|
|
1452
|
-
props.control === "filtered" ? /* @__PURE__ */
|
|
2791
|
+
return /* @__PURE__ */ jsxs10("div", { className: getMargin(props.margin), children: [
|
|
2792
|
+
props.title && /* @__PURE__ */ jsx38(Header3, { as: "h2", title: props.title }),
|
|
2793
|
+
props.control === "filtered" ? /* @__PURE__ */ jsx38(FilteredDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ jsx38(UnfilteredDecisionList, __spreadValues({}, props))
|
|
1453
2794
|
] });
|
|
1454
2795
|
};
|
|
1455
2796
|
var UnfilteredDecisionList = (_a) => {
|
|
1456
2797
|
var _b = _a, { renderDecisionList: renderDecisionList2 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
|
|
1457
|
-
return isGroupedDecision(rest.options) ? /* @__PURE__ */
|
|
2798
|
+
return isGroupedDecision(rest.options) ? /* @__PURE__ */ jsx38(GroupedDecisionList, __spreadProps(__spreadValues({}, rest), { renderDecisionList: renderDecisionList2 })) : renderDecisionList2(rest);
|
|
1458
2799
|
};
|
|
1459
2800
|
var FilteredDecisionList = (props) => {
|
|
1460
|
-
const { formatMessage } =
|
|
1461
|
-
const [query, setQuery] =
|
|
2801
|
+
const { formatMessage } = useIntl5();
|
|
2802
|
+
const [query, setQuery] = useState7("");
|
|
1462
2803
|
const { control, options, renderDecisionList: renderDecisionList2 } = props;
|
|
1463
2804
|
const filteredOptions = (query == null ? void 0 : query.length) > 0 ? filterAndSortDecisionOptions(options, query) : options;
|
|
1464
2805
|
const isGrouped = isGroupedDecision(options);
|
|
1465
|
-
return /* @__PURE__ */
|
|
1466
|
-
/* @__PURE__ */
|
|
2806
|
+
return /* @__PURE__ */ jsxs10(Fragment5, { children: [
|
|
2807
|
+
/* @__PURE__ */ jsx38(
|
|
1467
2808
|
SearchInput,
|
|
1468
2809
|
{
|
|
1469
2810
|
placeholder: formatMessage(filter_messages_default.placeholder),
|
|
@@ -1475,25 +2816,25 @@ var FilteredDecisionList = (props) => {
|
|
|
1475
2816
|
}
|
|
1476
2817
|
}
|
|
1477
2818
|
),
|
|
1478
|
-
isGrouped && query.length === 0 ? /* @__PURE__ */
|
|
1479
|
-
query.length > 0 && /* @__PURE__ */
|
|
2819
|
+
isGrouped && query.length === 0 ? /* @__PURE__ */ jsx38(GroupedDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ jsxs10(Fragment5, { children: [
|
|
2820
|
+
query.length > 0 && /* @__PURE__ */ jsx38(Header3, { as: "h2", title: formatMessage(filter_messages_default.results), className: "m-t-4" }),
|
|
1480
2821
|
filteredOptions.length > 0 ? renderDecisionList2({
|
|
1481
2822
|
control,
|
|
1482
2823
|
className: query.length === 0 ? "m-t-3" : "",
|
|
1483
2824
|
options: filteredOptions
|
|
1484
|
-
}) : /* @__PURE__ */
|
|
2825
|
+
}) : /* @__PURE__ */ jsx38("p", { children: formatMessage(filter_messages_default.noResults) })
|
|
1485
2826
|
] })
|
|
1486
2827
|
] });
|
|
1487
2828
|
};
|
|
1488
2829
|
|
|
1489
2830
|
// ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
|
|
1490
|
-
import { Fragment as
|
|
2831
|
+
import { Fragment as Fragment6, jsx as jsx39 } from "react/jsx-runtime";
|
|
1491
2832
|
var DecisionRenderer = {
|
|
1492
2833
|
canRenderType: "decision",
|
|
1493
|
-
render: (props) => /* @__PURE__ */
|
|
2834
|
+
render: (props) => /* @__PURE__ */ jsx39(DecisionWrapper, __spreadProps(__spreadValues({}, props), { renderDecisionList }))
|
|
1494
2835
|
};
|
|
1495
2836
|
var renderDecisionList = ({ options, control }) => {
|
|
1496
|
-
return /* @__PURE__ */
|
|
2837
|
+
return /* @__PURE__ */ jsx39(Fragment6, { children: options.map((_a) => {
|
|
1497
2838
|
var _b = _a, { onClick } = _b, rest = __objRest(_b, ["onClick"]);
|
|
1498
2839
|
const {
|
|
1499
2840
|
description,
|
|
@@ -1506,8 +2847,8 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
1506
2847
|
supportingValues,
|
|
1507
2848
|
tags
|
|
1508
2849
|
} = rest;
|
|
1509
|
-
return /* @__PURE__ */
|
|
1510
|
-
|
|
2850
|
+
return /* @__PURE__ */ jsx39(
|
|
2851
|
+
ListItem7,
|
|
1511
2852
|
{
|
|
1512
2853
|
title: itemTitle,
|
|
1513
2854
|
subtitle: description,
|
|
@@ -1518,7 +2859,7 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
1518
2859
|
media: getMedia(media, shouldUseAvatar(control, tags)),
|
|
1519
2860
|
prompt: getInlineAlert(inlineAlert),
|
|
1520
2861
|
additionalInfo: additionalText ? getAdditionalInfo({ text: additionalText }) : void 0,
|
|
1521
|
-
control: /* @__PURE__ */
|
|
2862
|
+
control: /* @__PURE__ */ jsx39(ListItem7.Navigation, __spreadValues({}, getAnchorProps()))
|
|
1522
2863
|
},
|
|
1523
2864
|
JSON.stringify(rest)
|
|
1524
2865
|
);
|
|
@@ -1528,7 +2869,7 @@ var DecisionRenderer_default = DecisionRenderer;
|
|
|
1528
2869
|
|
|
1529
2870
|
// ../renderers/src/DividerRenderer.tsx
|
|
1530
2871
|
import { Divider } from "@transferwise/components";
|
|
1531
|
-
import { jsx as
|
|
2872
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
1532
2873
|
var mapControlToLevel = (control) => {
|
|
1533
2874
|
switch (control) {
|
|
1534
2875
|
case "section":
|
|
@@ -1541,16 +2882,16 @@ var mapControlToLevel = (control) => {
|
|
|
1541
2882
|
};
|
|
1542
2883
|
var DividerRenderer = {
|
|
1543
2884
|
canRenderType: "divider",
|
|
1544
|
-
render: ({ margin, control }) => /* @__PURE__ */
|
|
2885
|
+
render: ({ margin, control }) => /* @__PURE__ */ jsx40(Divider, { className: `m-t-0 d-block ${getMargin(margin)}`, level: mapControlToLevel(control) })
|
|
1545
2886
|
};
|
|
1546
2887
|
var DividerRenderer_default = DividerRenderer;
|
|
1547
2888
|
|
|
1548
2889
|
// ../renderers/src/ExternalConfirmationRenderer.tsx
|
|
1549
|
-
import { Button as
|
|
2890
|
+
import { Button as Button5, Markdown as Markdown2, Modal } from "@transferwise/components";
|
|
1550
2891
|
|
|
1551
2892
|
// ../renderers/src/messages/external-confirmation.messages.ts
|
|
1552
|
-
import { defineMessages as
|
|
1553
|
-
var external_confirmation_messages_default =
|
|
2893
|
+
import { defineMessages as defineMessages6 } from "react-intl";
|
|
2894
|
+
var external_confirmation_messages_default = defineMessages6({
|
|
1554
2895
|
title: {
|
|
1555
2896
|
id: "df.wise.ExternalConfirmation.title",
|
|
1556
2897
|
defaultMessage: "Please confirm",
|
|
@@ -1574,9 +2915,9 @@ var external_confirmation_messages_default = defineMessages5({
|
|
|
1574
2915
|
});
|
|
1575
2916
|
|
|
1576
2917
|
// ../renderers/src/ExternalConfirmationRenderer.tsx
|
|
1577
|
-
import { useIntl as
|
|
1578
|
-
import { useEffect as
|
|
1579
|
-
import { Fragment as
|
|
2918
|
+
import { useIntl as useIntl6 } from "react-intl";
|
|
2919
|
+
import { useEffect as useEffect9 } from "react";
|
|
2920
|
+
import { Fragment as Fragment7, jsx as jsx41, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1580
2921
|
var ExternalConfirmationRenderer = {
|
|
1581
2922
|
canRenderType: "external-confirmation",
|
|
1582
2923
|
render: ExternalConfirmationRendererComponent
|
|
@@ -1587,20 +2928,20 @@ function ExternalConfirmationRendererComponent({
|
|
|
1587
2928
|
open,
|
|
1588
2929
|
onCancel
|
|
1589
2930
|
}) {
|
|
1590
|
-
const { formatMessage } =
|
|
1591
|
-
|
|
2931
|
+
const { formatMessage } = useIntl6();
|
|
2932
|
+
useEffect9(() => {
|
|
1592
2933
|
open();
|
|
1593
2934
|
}, []);
|
|
1594
|
-
return /* @__PURE__ */
|
|
2935
|
+
return /* @__PURE__ */ jsx41(
|
|
1595
2936
|
Modal,
|
|
1596
2937
|
{
|
|
1597
2938
|
open: visible,
|
|
1598
2939
|
title: formatMessage(external_confirmation_messages_default.title),
|
|
1599
|
-
body: /* @__PURE__ */
|
|
1600
|
-
/* @__PURE__ */
|
|
1601
|
-
/* @__PURE__ */
|
|
1602
|
-
/* @__PURE__ */
|
|
1603
|
-
|
|
2940
|
+
body: /* @__PURE__ */ jsxs11(Fragment7, { children: [
|
|
2941
|
+
/* @__PURE__ */ jsx41(Markdown2, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(url) }) }),
|
|
2942
|
+
/* @__PURE__ */ jsx41("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ jsxs11("div", { className: "df-box-renderer-width-lg", children: [
|
|
2943
|
+
/* @__PURE__ */ jsx41(
|
|
2944
|
+
Button5,
|
|
1604
2945
|
{
|
|
1605
2946
|
v2: true,
|
|
1606
2947
|
block: true,
|
|
@@ -1613,7 +2954,7 @@ function ExternalConfirmationRendererComponent({
|
|
|
1613
2954
|
children: formatMessage(external_confirmation_messages_default.open)
|
|
1614
2955
|
}
|
|
1615
2956
|
),
|
|
1616
|
-
/* @__PURE__ */
|
|
2957
|
+
/* @__PURE__ */ jsx41(Button5, { v2: true, block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onCancel, children: formatMessage(external_confirmation_messages_default.cancel) })
|
|
1617
2958
|
] }) })
|
|
1618
2959
|
] }),
|
|
1619
2960
|
onClose: onCancel
|
|
@@ -1630,27 +2971,27 @@ function getOrigin(url) {
|
|
|
1630
2971
|
var ExternalConfirmationRenderer_default = ExternalConfirmationRenderer;
|
|
1631
2972
|
|
|
1632
2973
|
// ../renderers/src/FormRenderer.tsx
|
|
1633
|
-
import { jsx as
|
|
2974
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
1634
2975
|
var FormRenderer = {
|
|
1635
2976
|
canRenderType: "form",
|
|
1636
|
-
render: ({ children, margin }) => /* @__PURE__ */
|
|
2977
|
+
render: ({ children, margin }) => /* @__PURE__ */ jsx42("div", { className: getMargin(margin), children })
|
|
1637
2978
|
};
|
|
1638
2979
|
var FormRenderer_default = FormRenderer;
|
|
1639
2980
|
|
|
1640
2981
|
// ../renderers/src/FormSectionRenderer.tsx
|
|
1641
|
-
import { Header as
|
|
1642
|
-
import { jsx as
|
|
2982
|
+
import { Header as Header4 } from "@transferwise/components";
|
|
2983
|
+
import { jsx as jsx43, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1643
2984
|
var FormSectionRenderer = {
|
|
1644
2985
|
canRenderType: "form-section",
|
|
1645
|
-
render: ({ title, description, children }) => /* @__PURE__ */
|
|
1646
|
-
title && /* @__PURE__ */
|
|
1647
|
-
|
|
2986
|
+
render: ({ title, description, children }) => /* @__PURE__ */ jsxs12("fieldset", { children: [
|
|
2987
|
+
title && /* @__PURE__ */ jsx43(
|
|
2988
|
+
Header4,
|
|
1648
2989
|
{
|
|
1649
2990
|
as: "h2",
|
|
1650
2991
|
title
|
|
1651
2992
|
}
|
|
1652
2993
|
),
|
|
1653
|
-
description && /* @__PURE__ */
|
|
2994
|
+
description && /* @__PURE__ */ jsx43("p", { children: description }),
|
|
1654
2995
|
children
|
|
1655
2996
|
] })
|
|
1656
2997
|
};
|
|
@@ -1658,18 +2999,18 @@ var FormSectionRenderer_default = FormSectionRenderer;
|
|
|
1658
2999
|
|
|
1659
3000
|
// ../renderers/src/HeadingRenderer.tsx
|
|
1660
3001
|
import { Display, Title } from "@transferwise/components";
|
|
1661
|
-
import { jsx as
|
|
3002
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
1662
3003
|
var HeadingRenderer = {
|
|
1663
3004
|
canRenderType: "heading",
|
|
1664
|
-
render: (props) => /* @__PURE__ */
|
|
3005
|
+
render: (props) => /* @__PURE__ */ jsx44(Heading, __spreadValues({}, props))
|
|
1665
3006
|
};
|
|
1666
3007
|
function Heading(props) {
|
|
1667
3008
|
const { text, size, align, margin, control } = props;
|
|
1668
3009
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
1669
|
-
return control === "display" ? /* @__PURE__ */
|
|
3010
|
+
return control === "display" ? /* @__PURE__ */ jsx44(DisplayHeading, { size, text, className }) : /* @__PURE__ */ jsx44(StandardHeading, { size, text, className });
|
|
1670
3011
|
}
|
|
1671
3012
|
function DisplayHeading({ size, text, className }) {
|
|
1672
|
-
return /* @__PURE__ */
|
|
3013
|
+
return /* @__PURE__ */ jsx44(Display, { type: getDisplayType(size), className, children: text });
|
|
1673
3014
|
}
|
|
1674
3015
|
var getDisplayType = (size) => {
|
|
1675
3016
|
switch (size) {
|
|
@@ -1685,7 +3026,7 @@ var getDisplayType = (size) => {
|
|
|
1685
3026
|
}
|
|
1686
3027
|
};
|
|
1687
3028
|
function StandardHeading({ size, text, className }) {
|
|
1688
|
-
return /* @__PURE__ */
|
|
3029
|
+
return /* @__PURE__ */ jsx44(Title, { type: getTitleTypeBySize(size), className, children: text });
|
|
1689
3030
|
}
|
|
1690
3031
|
var getTitleTypeBySize = (size) => {
|
|
1691
3032
|
var _a;
|
|
@@ -1702,7 +3043,7 @@ var HeadingRenderer_default = HeadingRenderer;
|
|
|
1702
3043
|
|
|
1703
3044
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
1704
3045
|
import { Image } from "@transferwise/components";
|
|
1705
|
-
import { useEffect as
|
|
3046
|
+
import { useEffect as useEffect10, useState as useState8 } from "react";
|
|
1706
3047
|
|
|
1707
3048
|
// ../renderers/src/utils/api-utils.ts
|
|
1708
3049
|
function isRelativePath(url = "") {
|
|
@@ -1712,7 +3053,7 @@ function isRelativePath(url = "") {
|
|
|
1712
3053
|
}
|
|
1713
3054
|
|
|
1714
3055
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
1715
|
-
import { jsx as
|
|
3056
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
1716
3057
|
function UrlImage({
|
|
1717
3058
|
accessibilityDescription,
|
|
1718
3059
|
align,
|
|
@@ -1721,13 +3062,13 @@ function UrlImage({
|
|
|
1721
3062
|
uri,
|
|
1722
3063
|
httpClient
|
|
1723
3064
|
}) {
|
|
1724
|
-
const [imageSource, setImageSource] =
|
|
1725
|
-
|
|
3065
|
+
const [imageSource, setImageSource] = useState8("");
|
|
3066
|
+
useEffect10(() => {
|
|
1726
3067
|
if (!uri.startsWith("urn:")) {
|
|
1727
3068
|
void getImageSource(httpClient, uri).then(setImageSource);
|
|
1728
3069
|
}
|
|
1729
3070
|
}, [uri, httpClient]);
|
|
1730
|
-
return /* @__PURE__ */
|
|
3071
|
+
return /* @__PURE__ */ jsx45("div", { className: `df-image ${align} ${size || "md"} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx45(
|
|
1731
3072
|
Image,
|
|
1732
3073
|
{
|
|
1733
3074
|
className: "df-reserve-space",
|
|
@@ -1771,7 +3112,7 @@ var getImageSource = async (httpClient, imageUrl) => {
|
|
|
1771
3112
|
};
|
|
1772
3113
|
|
|
1773
3114
|
// ../renderers/src/ImageRenderer/UrnFlagImage.tsx
|
|
1774
|
-
import { jsx as
|
|
3115
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
1775
3116
|
var maxFlagSize = 600;
|
|
1776
3117
|
function UrnFlagImage({
|
|
1777
3118
|
accessibilityDescription,
|
|
@@ -1780,7 +3121,7 @@ function UrnFlagImage({
|
|
|
1780
3121
|
size,
|
|
1781
3122
|
uri
|
|
1782
3123
|
}) {
|
|
1783
|
-
return /* @__PURE__ */
|
|
3124
|
+
return /* @__PURE__ */ jsx46("div", { className: `df-image ${align} ${size || "md"} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx46(UrnFlag, { size: maxFlagSize, urn: uri, accessibilityDescription }) });
|
|
1784
3125
|
}
|
|
1785
3126
|
|
|
1786
3127
|
// ../renderers/src/ImageRenderer/UrnIllustration.tsx
|
|
@@ -1788,18 +3129,18 @@ import {
|
|
|
1788
3129
|
Illustration,
|
|
1789
3130
|
isIllustrationSupport3D
|
|
1790
3131
|
} from "@wise/art";
|
|
1791
|
-
import { useState as
|
|
3132
|
+
import { useState as useState9 } from "react";
|
|
1792
3133
|
|
|
1793
3134
|
// ../renderers/src/ImageRenderer/isAnimated.ts
|
|
1794
3135
|
var isAnimated = (uri) => {
|
|
1795
3136
|
const { rComponents } = stringToURN(uri);
|
|
1796
|
-
return rComponents
|
|
3137
|
+
return rComponents.type === "animated";
|
|
1797
3138
|
};
|
|
1798
3139
|
|
|
1799
3140
|
// ../renderers/src/ImageRenderer/SafeIllustration3D.tsx
|
|
1800
3141
|
import { Illustration3D } from "@wise/art";
|
|
1801
3142
|
import { Component } from "react";
|
|
1802
|
-
import { jsx as
|
|
3143
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
1803
3144
|
var Illustration3DErrorBoundary = class extends Component {
|
|
1804
3145
|
constructor(props) {
|
|
1805
3146
|
super(props);
|
|
@@ -1811,7 +3152,7 @@ var Illustration3DErrorBoundary = class extends Component {
|
|
|
1811
3152
|
componentDidCatch() {
|
|
1812
3153
|
this.props.onError();
|
|
1813
3154
|
}
|
|
1814
|
-
render() {
|
|
3155
|
+
async render() {
|
|
1815
3156
|
if (this.state.hasError) {
|
|
1816
3157
|
return null;
|
|
1817
3158
|
}
|
|
@@ -1823,12 +3164,12 @@ var SafeIllustration3D = ({
|
|
|
1823
3164
|
size,
|
|
1824
3165
|
onError
|
|
1825
3166
|
}) => {
|
|
1826
|
-
return /* @__PURE__ */
|
|
3167
|
+
return /* @__PURE__ */ jsx47(Illustration3DErrorBoundary, { onError, children: /* @__PURE__ */ jsx47(Illustration3D, { name, size }) });
|
|
1827
3168
|
};
|
|
1828
3169
|
var SafeIllustration3D_default = SafeIllustration3D;
|
|
1829
3170
|
|
|
1830
3171
|
// ../renderers/src/ImageRenderer/UrnIllustration.tsx
|
|
1831
|
-
import { jsx as
|
|
3172
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
1832
3173
|
var urnPrefix = "urn:wise:illustrations:";
|
|
1833
3174
|
var isUrnIllustration = (uri) => uri.startsWith(urnPrefix);
|
|
1834
3175
|
function UrnIllustration({
|
|
@@ -1838,12 +3179,12 @@ function UrnIllustration({
|
|
|
1838
3179
|
size,
|
|
1839
3180
|
uri
|
|
1840
3181
|
}) {
|
|
1841
|
-
const [has3DFailed, setHas3DFailed] =
|
|
3182
|
+
const [has3DFailed, setHas3DFailed] = useState9(false);
|
|
1842
3183
|
const illustrationSize = getIllustrationSize(size);
|
|
1843
3184
|
const illustrationName = getIllustrationName(uri);
|
|
1844
3185
|
const illustration3DName = getIllustration3DName(uri);
|
|
1845
3186
|
if (illustration3DName && isAnimated(uri) && !has3DFailed) {
|
|
1846
|
-
return /* @__PURE__ */
|
|
3187
|
+
return /* @__PURE__ */ jsx48("div", { className: `df-image ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx48(
|
|
1847
3188
|
SafeIllustration3D_default,
|
|
1848
3189
|
{
|
|
1849
3190
|
name: illustration3DName,
|
|
@@ -1852,7 +3193,7 @@ function UrnIllustration({
|
|
|
1852
3193
|
}
|
|
1853
3194
|
) });
|
|
1854
3195
|
}
|
|
1855
|
-
return /* @__PURE__ */
|
|
3196
|
+
return /* @__PURE__ */ jsx48("div", { className: `df-image ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx48(
|
|
1856
3197
|
Illustration,
|
|
1857
3198
|
{
|
|
1858
3199
|
className: "df-illustration",
|
|
@@ -1872,32 +3213,32 @@ var getIllustration3DName = (uri) => {
|
|
|
1872
3213
|
};
|
|
1873
3214
|
|
|
1874
3215
|
// ../renderers/src/ImageRenderer/UrnImage.tsx
|
|
1875
|
-
import { jsx as
|
|
3216
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
1876
3217
|
var isUrnImage = (uri) => uri.startsWith("urn:");
|
|
1877
3218
|
function UrnImage(props) {
|
|
1878
3219
|
const { uri } = props;
|
|
1879
3220
|
if (isUrnIllustration(uri)) {
|
|
1880
|
-
return /* @__PURE__ */
|
|
3221
|
+
return /* @__PURE__ */ jsx49(UrnIllustration, __spreadValues({}, props));
|
|
1881
3222
|
}
|
|
1882
3223
|
if (isUrnFlag(uri)) {
|
|
1883
|
-
return /* @__PURE__ */
|
|
3224
|
+
return /* @__PURE__ */ jsx49(UrnFlagImage, __spreadValues({}, props));
|
|
1884
3225
|
}
|
|
1885
3226
|
return null;
|
|
1886
3227
|
}
|
|
1887
3228
|
|
|
1888
3229
|
// ../renderers/src/ImageRenderer/ImageRenderer.tsx
|
|
1889
|
-
import { jsx as
|
|
3230
|
+
import { jsx as jsx50 } from "react/jsx-runtime";
|
|
1890
3231
|
var ImageRenderer = {
|
|
1891
3232
|
canRenderType: "image",
|
|
1892
|
-
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */
|
|
3233
|
+
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */ jsx50(UrnImage, __spreadValues({}, props)) : /* @__PURE__ */ jsx50(UrlImage, __spreadValues({}, props))
|
|
1893
3234
|
};
|
|
1894
3235
|
|
|
1895
3236
|
// ../renderers/src/ImageRenderer/index.tsx
|
|
1896
3237
|
var ImageRenderer_default = ImageRenderer;
|
|
1897
3238
|
|
|
1898
3239
|
// ../renderers/src/InstructionsRenderer.tsx
|
|
1899
|
-
import { Header as
|
|
1900
|
-
import { jsx as
|
|
3240
|
+
import { Header as Header5, InstructionsList } from "@transferwise/components";
|
|
3241
|
+
import { jsx as jsx51, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1901
3242
|
var doContext = ["positive", "neutral"];
|
|
1902
3243
|
var dontContext = ["warning", "negative"];
|
|
1903
3244
|
var InstructionsRenderer = {
|
|
@@ -1905,16 +3246,16 @@ var InstructionsRenderer = {
|
|
|
1905
3246
|
render: ({ items, margin, title }) => {
|
|
1906
3247
|
const dos = items.filter((item) => doContext.includes(item.context)).map(({ text }) => text);
|
|
1907
3248
|
const donts = items.filter((item) => dontContext.includes(item.context)).map(({ text }) => text);
|
|
1908
|
-
return /* @__PURE__ */
|
|
1909
|
-
title ? /* @__PURE__ */
|
|
1910
|
-
/* @__PURE__ */
|
|
3249
|
+
return /* @__PURE__ */ jsxs13("div", { className: getMargin(margin), children: [
|
|
3250
|
+
title ? /* @__PURE__ */ jsx51(Header5, { title }) : null,
|
|
3251
|
+
/* @__PURE__ */ jsx51(InstructionsList, { dos, donts })
|
|
1911
3252
|
] });
|
|
1912
3253
|
}
|
|
1913
3254
|
};
|
|
1914
3255
|
var InstructionsRenderer_default = InstructionsRenderer;
|
|
1915
3256
|
|
|
1916
3257
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
1917
|
-
import { Input, InputGroup } from "@transferwise/components";
|
|
3258
|
+
import { Input as Input2, InputGroup as InputGroup2 } from "@transferwise/components";
|
|
1918
3259
|
|
|
1919
3260
|
// ../renderers/src/utils/input-utils.ts
|
|
1920
3261
|
var onWheel = (event) => {
|
|
@@ -1939,7 +3280,7 @@ function pick(obj, ...keys) {
|
|
|
1939
3280
|
}
|
|
1940
3281
|
|
|
1941
3282
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
1942
|
-
import { jsx as
|
|
3283
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
1943
3284
|
var IntegerInputRenderer = {
|
|
1944
3285
|
canRenderType: "input-integer",
|
|
1945
3286
|
render: (props) => {
|
|
@@ -1954,7 +3295,7 @@ var IntegerInputRenderer = {
|
|
|
1954
3295
|
"maximum",
|
|
1955
3296
|
"minimum"
|
|
1956
3297
|
);
|
|
1957
|
-
return /* @__PURE__ */
|
|
3298
|
+
return /* @__PURE__ */ jsx52(
|
|
1958
3299
|
FieldInput_default,
|
|
1959
3300
|
{
|
|
1960
3301
|
id,
|
|
@@ -1965,8 +3306,8 @@ var IntegerInputRenderer = {
|
|
|
1965
3306
|
loadingState: props.fieldLoadingState,
|
|
1966
3307
|
help,
|
|
1967
3308
|
features: props.features,
|
|
1968
|
-
children: /* @__PURE__ */
|
|
1969
|
-
|
|
3309
|
+
children: /* @__PURE__ */ jsx52(InputGroup2, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ jsx52(
|
|
3310
|
+
Input2,
|
|
1970
3311
|
__spreadValues({
|
|
1971
3312
|
id,
|
|
1972
3313
|
name: id,
|
|
@@ -1988,39 +3329,12 @@ var IntegerInputRenderer = {
|
|
|
1988
3329
|
var IntegerInputRenderer_default = IntegerInputRenderer;
|
|
1989
3330
|
|
|
1990
3331
|
// ../renderers/src/ListRenderer.tsx
|
|
1991
|
-
import { ListItem as
|
|
1992
|
-
|
|
1993
|
-
// ../renderers/src/utils/listItem/getCTAControl.tsx
|
|
1994
|
-
import { ListItem as ListItem6 } from "@transferwise/components";
|
|
1995
|
-
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
1996
|
-
var getCTAControl = (callToAction, { ctaSecondary, fullyInteractive }) => {
|
|
1997
|
-
if (!callToAction) {
|
|
1998
|
-
return void 0;
|
|
1999
|
-
}
|
|
2000
|
-
const { accessibilityDescription, title, context } = callToAction;
|
|
2001
|
-
const { priority, sentiment } = getPriorityAndSentiment(ctaSecondary, context);
|
|
2002
|
-
return /* @__PURE__ */ jsx44(
|
|
2003
|
-
ListItem6.Button,
|
|
2004
|
-
__spreadProps(__spreadValues({}, callToAction.getAnchorProps()), {
|
|
2005
|
-
partiallyInteractive: !fullyInteractive,
|
|
2006
|
-
priority,
|
|
2007
|
-
"aria-description": accessibilityDescription,
|
|
2008
|
-
sentiment,
|
|
2009
|
-
children: title
|
|
2010
|
-
})
|
|
2011
|
-
);
|
|
2012
|
-
};
|
|
2013
|
-
var getPriorityAndSentiment = (ctaSecondary, context) => {
|
|
2014
|
-
if (context === "negative") {
|
|
2015
|
-
return { priority: "secondary", sentiment: "negative" };
|
|
2016
|
-
}
|
|
2017
|
-
return { priority: ctaSecondary ? "secondary" : "secondary-neutral", sentiment: "default" };
|
|
2018
|
-
};
|
|
3332
|
+
import { ListItem as ListItem8 } from "@transferwise/components";
|
|
2019
3333
|
|
|
2020
3334
|
// ../renderers/src/components/Header.tsx
|
|
2021
3335
|
import { Header as DSHeader } from "@transferwise/components";
|
|
2022
|
-
import { jsx as
|
|
2023
|
-
var
|
|
3336
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
3337
|
+
var Header = ({ title, callToAction }) => (title || callToAction) && /* @__PURE__ */ jsx53(DSHeader, { title: title != null ? title : "", action: getHeaderAction(callToAction) });
|
|
2024
3338
|
var getHeaderAction = (callToAction) => {
|
|
2025
3339
|
if (!callToAction) {
|
|
2026
3340
|
return void 0;
|
|
@@ -2032,11 +3346,11 @@ var getHeaderAction = (callToAction) => {
|
|
|
2032
3346
|
};
|
|
2033
3347
|
|
|
2034
3348
|
// ../renderers/src/ListRenderer.tsx
|
|
2035
|
-
import { jsx as
|
|
3349
|
+
import { jsx as jsx54, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2036
3350
|
var ListRenderer = {
|
|
2037
3351
|
canRenderType: "list",
|
|
2038
|
-
render: ({ callToAction, control, margin, items, tags, title }) => /* @__PURE__ */
|
|
2039
|
-
/* @__PURE__ */
|
|
3352
|
+
render: ({ callToAction, control, margin, items, tags, title }) => /* @__PURE__ */ jsxs14("div", { className: getMargin(margin), children: [
|
|
3353
|
+
/* @__PURE__ */ jsx54(Header, { title, callToAction }),
|
|
2040
3354
|
items.map((item) => {
|
|
2041
3355
|
var _a, _b;
|
|
2042
3356
|
const {
|
|
@@ -2053,8 +3367,8 @@ var ListRenderer = {
|
|
|
2053
3367
|
ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
|
|
2054
3368
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
2055
3369
|
};
|
|
2056
|
-
return /* @__PURE__ */
|
|
2057
|
-
|
|
3370
|
+
return /* @__PURE__ */ jsx54(
|
|
3371
|
+
ListItem8,
|
|
2058
3372
|
{
|
|
2059
3373
|
title: itemTitle,
|
|
2060
3374
|
subtitle: description,
|
|
@@ -2074,10 +3388,10 @@ var ListRenderer_default = ListRenderer;
|
|
|
2074
3388
|
|
|
2075
3389
|
// ../renderers/src/LoadingIndicatorRenderer.tsx
|
|
2076
3390
|
import { Loader } from "@transferwise/components";
|
|
2077
|
-
import { jsx as
|
|
3391
|
+
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
2078
3392
|
var LoadingIndicatorRenderer = {
|
|
2079
3393
|
canRenderType: "loading-indicator",
|
|
2080
|
-
render: ({ margin, size }) => /* @__PURE__ */
|
|
3394
|
+
render: ({ margin, size }) => /* @__PURE__ */ jsx55(
|
|
2081
3395
|
Loader,
|
|
2082
3396
|
{
|
|
2083
3397
|
size,
|
|
@@ -2091,10 +3405,10 @@ var LoadingIndicatorRenderer_default = LoadingIndicatorRenderer;
|
|
|
2091
3405
|
// ../renderers/src/MarkdownRenderer.tsx
|
|
2092
3406
|
import { Markdown as Markdown3 } from "@transferwise/components";
|
|
2093
3407
|
var import_classnames4 = __toESM(require_classnames());
|
|
2094
|
-
import { jsx as
|
|
3408
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
2095
3409
|
var MarkdownRenderer = {
|
|
2096
3410
|
canRenderType: "markdown",
|
|
2097
|
-
render: ({ content, align, margin, size }) => /* @__PURE__ */
|
|
3411
|
+
render: ({ content, align, margin, size }) => /* @__PURE__ */ jsx56("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ jsx56(
|
|
2098
3412
|
Markdown3,
|
|
2099
3413
|
{
|
|
2100
3414
|
className: (0, import_classnames4.default)(
|
|
@@ -2109,16 +3423,16 @@ var MarkdownRenderer = {
|
|
|
2109
3423
|
var MarkdownRenderer_default = MarkdownRenderer;
|
|
2110
3424
|
|
|
2111
3425
|
// ../renderers/src/MediaRenderer.tsx
|
|
2112
|
-
import { jsx as
|
|
3426
|
+
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
2113
3427
|
var MediaRenderer = {
|
|
2114
3428
|
canRenderType: "media",
|
|
2115
3429
|
render: (_a) => {
|
|
2116
3430
|
var _b = _a, { media } = _b, rest = __objRest(_b, ["media"]);
|
|
2117
3431
|
switch (media.type) {
|
|
2118
3432
|
case "avatar":
|
|
2119
|
-
return /* @__PURE__ */
|
|
3433
|
+
return /* @__PURE__ */ jsx57(AvatarMediaRendererComponent, __spreadValues({ media }, rest));
|
|
2120
3434
|
case "image":
|
|
2121
|
-
return /* @__PURE__ */
|
|
3435
|
+
return /* @__PURE__ */ jsx57(ImageMediaRendererComponent, __spreadValues({ media }, rest));
|
|
2122
3436
|
case "legacy":
|
|
2123
3437
|
return null;
|
|
2124
3438
|
}
|
|
@@ -2130,7 +3444,7 @@ var AvatarMediaRendererComponent = ({
|
|
|
2130
3444
|
margin,
|
|
2131
3445
|
size
|
|
2132
3446
|
}) => {
|
|
2133
|
-
return /* @__PURE__ */
|
|
3447
|
+
return /* @__PURE__ */ jsx57("div", { className: `df-media-layout-avatar ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx57(Media, { media, size: mapAvatarMediaSize(size) }) });
|
|
2134
3448
|
};
|
|
2135
3449
|
var ImageMediaRendererComponent = (_a) => {
|
|
2136
3450
|
var _b = _a, {
|
|
@@ -2138,7 +3452,7 @@ var ImageMediaRendererComponent = (_a) => {
|
|
|
2138
3452
|
} = _b, rest = __objRest(_b, [
|
|
2139
3453
|
"media"
|
|
2140
3454
|
]);
|
|
2141
|
-
return isUrnImage(media.uri) ? /* @__PURE__ */
|
|
3455
|
+
return isUrnImage(media.uri) ? /* @__PURE__ */ jsx57(UrnImage, __spreadValues({ uri: media.uri, accessibilityDescription: media.accessibilityDescription }, rest)) : /* @__PURE__ */ jsx57(UrlImage, __spreadValues({ uri: media.uri, accessibilityDescription: media.accessibilityDescription }, rest));
|
|
2142
3456
|
};
|
|
2143
3457
|
var mapAvatarMediaSize = (size) => {
|
|
2144
3458
|
switch (size) {
|
|
@@ -2156,20 +3470,20 @@ var mapAvatarMediaSize = (size) => {
|
|
|
2156
3470
|
};
|
|
2157
3471
|
|
|
2158
3472
|
// ../renderers/src/ModalLayoutRenderer.tsx
|
|
2159
|
-
import { Button as
|
|
2160
|
-
import { useState as
|
|
2161
|
-
import { jsx as
|
|
3473
|
+
import { Button as Button6, Modal as Modal2 } from "@transferwise/components";
|
|
3474
|
+
import { useState as useState10 } from "react";
|
|
3475
|
+
import { jsx as jsx58, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2162
3476
|
var ModalLayoutRenderer = {
|
|
2163
3477
|
canRenderType: "modal-layout",
|
|
2164
|
-
render: (props) => /* @__PURE__ */
|
|
3478
|
+
render: (props) => /* @__PURE__ */ jsx58(DFModal, __spreadValues({}, props))
|
|
2165
3479
|
};
|
|
2166
3480
|
var ModalLayoutRenderer_default = ModalLayoutRenderer;
|
|
2167
3481
|
function DFModal({ content, margin, trigger }) {
|
|
2168
|
-
const [visible, setVisible] =
|
|
3482
|
+
const [visible, setVisible] = useState10(false);
|
|
2169
3483
|
const { children, title } = content;
|
|
2170
|
-
return /* @__PURE__ */
|
|
2171
|
-
/* @__PURE__ */
|
|
2172
|
-
/* @__PURE__ */
|
|
3484
|
+
return /* @__PURE__ */ jsxs15("div", { className: getMargin(margin), children: [
|
|
3485
|
+
/* @__PURE__ */ jsx58(Button6, { v2: true, priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
|
|
3486
|
+
/* @__PURE__ */ jsx58(
|
|
2173
3487
|
Modal2,
|
|
2174
3488
|
{
|
|
2175
3489
|
scroll: "content",
|
|
@@ -2185,19 +3499,19 @@ function DFModal({ content, margin, trigger }) {
|
|
|
2185
3499
|
|
|
2186
3500
|
// ../renderers/src/ModalRenderer.tsx
|
|
2187
3501
|
import { Modal as Modal3 } from "@transferwise/components";
|
|
2188
|
-
import { jsx as
|
|
3502
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
2189
3503
|
var ModalRenderer = {
|
|
2190
3504
|
canRenderType: "modal",
|
|
2191
3505
|
render: ({ title, children, open, onClose }) => {
|
|
2192
|
-
return /* @__PURE__ */
|
|
3506
|
+
return /* @__PURE__ */ jsx59(Modal3, { open, title, body: children, onClose });
|
|
2193
3507
|
}
|
|
2194
3508
|
};
|
|
2195
3509
|
|
|
2196
3510
|
// ../renderers/src/MoneyInputRenderer.tsx
|
|
2197
3511
|
import { MoneyInput } from "@transferwise/components";
|
|
2198
|
-
import { useEffect as
|
|
2199
|
-
import { useIntl as
|
|
2200
|
-
import { jsx as
|
|
3512
|
+
import { useEffect as useEffect11 } from "react";
|
|
3513
|
+
import { useIntl as useIntl7 } from "react-intl";
|
|
3514
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
2201
3515
|
var groupingTags2 = Object.keys(group_messages_default).filter((key) => key !== "all");
|
|
2202
3516
|
var MoneyInputRenderer = {
|
|
2203
3517
|
canRenderType: "money-input",
|
|
@@ -2218,13 +3532,13 @@ function MoneyInputRendererComponent(props) {
|
|
|
2218
3532
|
onAmountChange,
|
|
2219
3533
|
onCurrencyChange
|
|
2220
3534
|
} = props;
|
|
2221
|
-
|
|
3535
|
+
useEffect11(() => {
|
|
2222
3536
|
if (!isValidIndex(selectedCurrencyIndex, currencies.length)) {
|
|
2223
3537
|
onCurrencyChange(0);
|
|
2224
3538
|
}
|
|
2225
3539
|
}, [selectedCurrencyIndex, onCurrencyChange, currencies.length]);
|
|
2226
|
-
const { formatMessage } =
|
|
2227
|
-
return /* @__PURE__ */
|
|
3540
|
+
const { formatMessage } = useIntl7();
|
|
3541
|
+
return /* @__PURE__ */ jsx60(
|
|
2228
3542
|
FieldInput_default,
|
|
2229
3543
|
{
|
|
2230
3544
|
id: uid,
|
|
@@ -2233,7 +3547,7 @@ function MoneyInputRendererComponent(props) {
|
|
|
2233
3547
|
validation: validationState,
|
|
2234
3548
|
help,
|
|
2235
3549
|
features: props.features,
|
|
2236
|
-
children: /* @__PURE__ */
|
|
3550
|
+
children: /* @__PURE__ */ jsx60(
|
|
2237
3551
|
MoneyInput,
|
|
2238
3552
|
{
|
|
2239
3553
|
amount: parseFloatOrNull(amountValue),
|
|
@@ -2295,8 +3609,8 @@ function assertCurrencyCodeIsString(currencyCode) {
|
|
|
2295
3609
|
}
|
|
2296
3610
|
|
|
2297
3611
|
// ../renderers/src/MultiSelectInputRenderer/InlineComponent.tsx
|
|
2298
|
-
import { ListItem as
|
|
2299
|
-
import { jsx as
|
|
3612
|
+
import { ListItem as ListItem9 } from "@transferwise/components";
|
|
3613
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
2300
3614
|
function InlineComponent(props) {
|
|
2301
3615
|
const {
|
|
2302
3616
|
id,
|
|
@@ -2310,7 +3624,7 @@ function InlineComponent(props) {
|
|
|
2310
3624
|
validationState,
|
|
2311
3625
|
onSelect
|
|
2312
3626
|
} = props;
|
|
2313
|
-
return /* @__PURE__ */
|
|
3627
|
+
return /* @__PURE__ */ jsx61(
|
|
2314
3628
|
FieldInput_default,
|
|
2315
3629
|
{
|
|
2316
3630
|
id,
|
|
@@ -2332,8 +3646,8 @@ function InlineComponent(props) {
|
|
|
2332
3646
|
childrenProps
|
|
2333
3647
|
} = option;
|
|
2334
3648
|
const key = (_a = childrenProps == null ? void 0 : childrenProps.uid) != null ? _a : index;
|
|
2335
|
-
return /* @__PURE__ */
|
|
2336
|
-
|
|
3649
|
+
return /* @__PURE__ */ jsx61(
|
|
3650
|
+
ListItem9,
|
|
2337
3651
|
{
|
|
2338
3652
|
title: itemTitle,
|
|
2339
3653
|
subtitle,
|
|
@@ -2341,10 +3655,10 @@ function InlineComponent(props) {
|
|
|
2341
3655
|
valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
|
|
2342
3656
|
media: getMedia(media, false),
|
|
2343
3657
|
prompt: getInlineAlert(inlineAlert),
|
|
2344
|
-
additionalInfo: additionalText ? /* @__PURE__ */
|
|
3658
|
+
additionalInfo: additionalText ? /* @__PURE__ */ jsx61(ListItem9.AdditionalInfo, { children: additionalText }) : void 0,
|
|
2345
3659
|
disabled: disabled || optionDisabled,
|
|
2346
|
-
control: /* @__PURE__ */
|
|
2347
|
-
|
|
3660
|
+
control: /* @__PURE__ */ jsx61(
|
|
3661
|
+
ListItem9.Checkbox,
|
|
2348
3662
|
{
|
|
2349
3663
|
checked: selectedIndices.includes(index),
|
|
2350
3664
|
onChange: (e) => {
|
|
@@ -2363,12 +3677,12 @@ function InlineComponent(props) {
|
|
|
2363
3677
|
|
|
2364
3678
|
// ../renderers/src/MultiSelectInputRenderer/DefaultComponent.tsx
|
|
2365
3679
|
import { SelectInput, SelectInputOptionContent } from "@transferwise/components";
|
|
2366
|
-
import { useState as
|
|
2367
|
-
import { useIntl as
|
|
3680
|
+
import { useState as useState11 } from "react";
|
|
3681
|
+
import { useIntl as useIntl8 } from "react-intl";
|
|
2368
3682
|
|
|
2369
3683
|
// ../renderers/src/messages/multi-select.messages.ts
|
|
2370
|
-
import { defineMessages as
|
|
2371
|
-
var multi_select_messages_default =
|
|
3684
|
+
import { defineMessages as defineMessages7 } from "react-intl";
|
|
3685
|
+
var multi_select_messages_default = defineMessages7({
|
|
2372
3686
|
summary: {
|
|
2373
3687
|
id: "df.wise.MultiSelect.summary",
|
|
2374
3688
|
defaultMessage: "{first} and {count} more",
|
|
@@ -2377,10 +3691,10 @@ var multi_select_messages_default = defineMessages6({
|
|
|
2377
3691
|
});
|
|
2378
3692
|
|
|
2379
3693
|
// ../renderers/src/MultiSelectInputRenderer/DefaultComponent.tsx
|
|
2380
|
-
import { jsx as
|
|
3694
|
+
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
2381
3695
|
function DefaultComponent(props) {
|
|
2382
|
-
const { formatMessage } =
|
|
2383
|
-
const [stagedIndices, setStagedIndices] =
|
|
3696
|
+
const { formatMessage } = useIntl8();
|
|
3697
|
+
const [stagedIndices, setStagedIndices] = useState11();
|
|
2384
3698
|
const {
|
|
2385
3699
|
id,
|
|
2386
3700
|
autoComplete,
|
|
@@ -2419,12 +3733,12 @@ function DefaultComponent(props) {
|
|
|
2419
3733
|
const contentProps = {
|
|
2420
3734
|
title: option.title,
|
|
2421
3735
|
description: option.description,
|
|
2422
|
-
icon: /* @__PURE__ */
|
|
3736
|
+
icon: /* @__PURE__ */ jsx62(OptionMedia, { media: option.media, preferAvatar: false })
|
|
2423
3737
|
};
|
|
2424
|
-
return /* @__PURE__ */
|
|
3738
|
+
return /* @__PURE__ */ jsx62(SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
2425
3739
|
};
|
|
2426
3740
|
const extraProps = { autoComplete };
|
|
2427
|
-
return /* @__PURE__ */
|
|
3741
|
+
return /* @__PURE__ */ jsx62(
|
|
2428
3742
|
FieldInput_default,
|
|
2429
3743
|
{
|
|
2430
3744
|
id,
|
|
@@ -2433,7 +3747,7 @@ function DefaultComponent(props) {
|
|
|
2433
3747
|
description,
|
|
2434
3748
|
validation: validationState,
|
|
2435
3749
|
features,
|
|
2436
|
-
children: /* @__PURE__ */
|
|
3750
|
+
children: /* @__PURE__ */ jsx62(
|
|
2437
3751
|
SelectInput,
|
|
2438
3752
|
__spreadValues({
|
|
2439
3753
|
id,
|
|
@@ -2473,7 +3787,7 @@ function DefaultComponent(props) {
|
|
|
2473
3787
|
|
|
2474
3788
|
// ../renderers/src/MultiSelectInputRenderer/InlineCheckboxComponent.tsx
|
|
2475
3789
|
import { Checkbox as Checkbox2 } from "@transferwise/components";
|
|
2476
|
-
import { jsx as
|
|
3790
|
+
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
2477
3791
|
function InlineCheckboxComponent(props) {
|
|
2478
3792
|
const {
|
|
2479
3793
|
id,
|
|
@@ -2487,7 +3801,7 @@ function InlineCheckboxComponent(props) {
|
|
|
2487
3801
|
validationState,
|
|
2488
3802
|
onSelect
|
|
2489
3803
|
} = props;
|
|
2490
|
-
return /* @__PURE__ */
|
|
3804
|
+
return /* @__PURE__ */ jsx63(
|
|
2491
3805
|
FieldInput_default,
|
|
2492
3806
|
{
|
|
2493
3807
|
id,
|
|
@@ -2516,24 +3830,24 @@ function InlineCheckboxComponent(props) {
|
|
|
2516
3830
|
onSelect(newSelectedIndices);
|
|
2517
3831
|
}
|
|
2518
3832
|
};
|
|
2519
|
-
return /* @__PURE__ */
|
|
3833
|
+
return /* @__PURE__ */ jsx63(Checkbox2, __spreadProps(__spreadValues({}, checkboxProps), { className: "m-t-1" }), key);
|
|
2520
3834
|
})
|
|
2521
3835
|
}
|
|
2522
3836
|
);
|
|
2523
3837
|
}
|
|
2524
3838
|
|
|
2525
3839
|
// ../renderers/src/MultiSelectInputRenderer/MultiSelectInputRenderer.tsx
|
|
2526
|
-
import { jsx as
|
|
3840
|
+
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
2527
3841
|
var MultiSelectInputRenderer = {
|
|
2528
3842
|
canRenderType: "input-multi-select",
|
|
2529
3843
|
render: (props) => {
|
|
2530
3844
|
switch (props.control) {
|
|
2531
3845
|
case "inline":
|
|
2532
|
-
return /* @__PURE__ */
|
|
3846
|
+
return /* @__PURE__ */ jsx64(InlineComponent, __spreadValues({}, props));
|
|
2533
3847
|
case "inline-checkbox-group":
|
|
2534
|
-
return /* @__PURE__ */
|
|
3848
|
+
return /* @__PURE__ */ jsx64(InlineCheckboxComponent, __spreadValues({}, props));
|
|
2535
3849
|
default:
|
|
2536
|
-
return /* @__PURE__ */
|
|
3850
|
+
return /* @__PURE__ */ jsx64(DefaultComponent, __spreadValues({}, props));
|
|
2537
3851
|
}
|
|
2538
3852
|
}
|
|
2539
3853
|
};
|
|
@@ -2544,7 +3858,7 @@ import { Status, UploadInput } from "@transferwise/components";
|
|
|
2544
3858
|
// ../renderers/src/components/UploadFieldInput.tsx
|
|
2545
3859
|
var import_classnames5 = __toESM(require_classnames());
|
|
2546
3860
|
import { InlineAlert as InlineAlert2 } from "@transferwise/components";
|
|
2547
|
-
import { jsx as
|
|
3861
|
+
import { jsx as jsx65, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2548
3862
|
function UploadFieldInput({
|
|
2549
3863
|
id,
|
|
2550
3864
|
children,
|
|
@@ -2554,10 +3868,10 @@ function UploadFieldInput({
|
|
|
2554
3868
|
validation,
|
|
2555
3869
|
features
|
|
2556
3870
|
}) {
|
|
2557
|
-
const labelContent = label && help ? /* @__PURE__ */
|
|
3871
|
+
const labelContent = label && help ? /* @__PURE__ */ jsx65(LabelContentWithHelp, { text: label, help }) : label;
|
|
2558
3872
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
2559
3873
|
const { ref } = useScrollToError(validation, features);
|
|
2560
|
-
return /* @__PURE__ */
|
|
3874
|
+
return /* @__PURE__ */ jsxs16(
|
|
2561
3875
|
"div",
|
|
2562
3876
|
{
|
|
2563
3877
|
ref,
|
|
@@ -2565,9 +3879,9 @@ function UploadFieldInput({
|
|
|
2565
3879
|
"has-error": (validation == null ? void 0 : validation.status) === "invalid"
|
|
2566
3880
|
}),
|
|
2567
3881
|
children: [
|
|
2568
|
-
/* @__PURE__ */
|
|
3882
|
+
/* @__PURE__ */ jsx65("label", { htmlFor: id, className: "control-label", children: labelContent }),
|
|
2569
3883
|
children,
|
|
2570
|
-
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */
|
|
3884
|
+
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ jsx65(InlineAlert2, { type: "negative", id: descriptionId, children: validation.message })
|
|
2571
3885
|
]
|
|
2572
3886
|
}
|
|
2573
3887
|
);
|
|
@@ -2602,7 +3916,7 @@ var getSizeLimit = (maxSize) => {
|
|
|
2602
3916
|
};
|
|
2603
3917
|
|
|
2604
3918
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
2605
|
-
import { jsx as
|
|
3919
|
+
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
2606
3920
|
var MultiUploadInputRenderer = {
|
|
2607
3921
|
canRenderType: "input-upload-multi",
|
|
2608
3922
|
render: (props) => {
|
|
@@ -2628,7 +3942,7 @@ var MultiUploadInputRenderer = {
|
|
|
2628
3942
|
};
|
|
2629
3943
|
const onDeleteFile = async (fileId) => onRemoveFile(value.findIndex((file) => file.id === fileId));
|
|
2630
3944
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
2631
|
-
return /* @__PURE__ */
|
|
3945
|
+
return /* @__PURE__ */ jsx66(
|
|
2632
3946
|
UploadFieldInput_default,
|
|
2633
3947
|
{
|
|
2634
3948
|
id,
|
|
@@ -2637,17 +3951,17 @@ var MultiUploadInputRenderer = {
|
|
|
2637
3951
|
validation: validationState,
|
|
2638
3952
|
help,
|
|
2639
3953
|
features,
|
|
2640
|
-
children: /* @__PURE__ */
|
|
3954
|
+
children: /* @__PURE__ */ jsx66(
|
|
2641
3955
|
UploadInput,
|
|
2642
3956
|
{
|
|
2643
3957
|
id,
|
|
2644
3958
|
"aria-describedby": descriptionId,
|
|
2645
3959
|
description,
|
|
2646
3960
|
disabled,
|
|
2647
|
-
files: value.map(({ id:
|
|
2648
|
-
id:
|
|
3961
|
+
files: value.map(({ id: fileId, file, validationState: fileValidationState }) => ({
|
|
3962
|
+
id: fileId,
|
|
2649
3963
|
filename: file.name,
|
|
2650
|
-
status: (
|
|
3964
|
+
status: (fileValidationState == null ? void 0 : fileValidationState.status) === "invalid" ? Status.FAILED : Status.SUCCEEDED
|
|
2651
3965
|
})),
|
|
2652
3966
|
fileTypes: acceptsToFileTypes(accepts),
|
|
2653
3967
|
maxFiles: maxItems,
|
|
@@ -2665,8 +3979,8 @@ var MultiUploadInputRenderer = {
|
|
|
2665
3979
|
var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
|
|
2666
3980
|
|
|
2667
3981
|
// ../renderers/src/NumberInputRenderer.tsx
|
|
2668
|
-
import { Input as
|
|
2669
|
-
import { jsx as
|
|
3982
|
+
import { Input as Input3, InputGroup as InputGroup3 } from "@transferwise/components";
|
|
3983
|
+
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
2670
3984
|
var NumberInputRenderer = {
|
|
2671
3985
|
canRenderType: "input-number",
|
|
2672
3986
|
render: (props) => {
|
|
@@ -2680,7 +3994,7 @@ var NumberInputRenderer = {
|
|
|
2680
3994
|
"maximum",
|
|
2681
3995
|
"minimum"
|
|
2682
3996
|
);
|
|
2683
|
-
return /* @__PURE__ */
|
|
3997
|
+
return /* @__PURE__ */ jsx67(
|
|
2684
3998
|
FieldInput_default,
|
|
2685
3999
|
{
|
|
2686
4000
|
id,
|
|
@@ -2691,8 +4005,8 @@ var NumberInputRenderer = {
|
|
|
2691
4005
|
loadingState: props.fieldLoadingState,
|
|
2692
4006
|
help,
|
|
2693
4007
|
features: props.features,
|
|
2694
|
-
children: /* @__PURE__ */
|
|
2695
|
-
|
|
4008
|
+
children: /* @__PURE__ */ jsx67(InputGroup3, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ jsx67(
|
|
4009
|
+
Input3,
|
|
2696
4010
|
__spreadValues({
|
|
2697
4011
|
id,
|
|
2698
4012
|
name: id,
|
|
@@ -2712,7 +4026,7 @@ var NumberInputRenderer = {
|
|
|
2712
4026
|
var NumberInputRenderer_default = NumberInputRenderer;
|
|
2713
4027
|
|
|
2714
4028
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
2715
|
-
import { useIntl as
|
|
4029
|
+
import { useIntl as useIntl9 } from "react-intl";
|
|
2716
4030
|
|
|
2717
4031
|
// ../renderers/src/hooks/useSnackBarIfAvailable.ts
|
|
2718
4032
|
import { SnackbarContext } from "@transferwise/components";
|
|
@@ -2725,11 +4039,11 @@ function useSnackBarIfAvailable() {
|
|
|
2725
4039
|
|
|
2726
4040
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
2727
4041
|
var import_classnames6 = __toESM(require_classnames());
|
|
2728
|
-
import { Button as
|
|
4042
|
+
import { Button as Button7, Input as Input4 } from "@transferwise/components";
|
|
2729
4043
|
|
|
2730
4044
|
// ../renderers/src/messages/paragraph.messages.ts
|
|
2731
|
-
import { defineMessages as
|
|
2732
|
-
var paragraph_messages_default =
|
|
4045
|
+
import { defineMessages as defineMessages8 } from "react-intl";
|
|
4046
|
+
var paragraph_messages_default = defineMessages8({
|
|
2733
4047
|
copy: {
|
|
2734
4048
|
id: "df.wise.DynamicParagraph.copy",
|
|
2735
4049
|
defaultMessage: "Copy",
|
|
@@ -2743,14 +4057,14 @@ var paragraph_messages_default = defineMessages7({
|
|
|
2743
4057
|
});
|
|
2744
4058
|
|
|
2745
4059
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
2746
|
-
import { jsx as
|
|
4060
|
+
import { jsx as jsx68, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2747
4061
|
var ParagraphRenderer = {
|
|
2748
4062
|
canRenderType: "paragraph",
|
|
2749
|
-
render: (props) => /* @__PURE__ */
|
|
4063
|
+
render: (props) => /* @__PURE__ */ jsx68(Paragraph, __spreadValues({}, props))
|
|
2750
4064
|
};
|
|
2751
4065
|
function Paragraph({ align, control, margin, size, text }) {
|
|
2752
4066
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
2753
|
-
return control === "copyable" ? /* @__PURE__ */
|
|
4067
|
+
return control === "copyable" ? /* @__PURE__ */ jsx68(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ jsx68(
|
|
2754
4068
|
"p",
|
|
2755
4069
|
{
|
|
2756
4070
|
className: `${["xs", "sm"].includes(size) ? "np-text-body-default" : "np-text-body-large"} ${className}`,
|
|
@@ -2763,16 +4077,16 @@ function CopyableParagraph({
|
|
|
2763
4077
|
align,
|
|
2764
4078
|
className
|
|
2765
4079
|
}) {
|
|
2766
|
-
const { formatMessage } =
|
|
4080
|
+
const { formatMessage } = useIntl9();
|
|
2767
4081
|
const createSnackbar = useSnackBarIfAvailable();
|
|
2768
4082
|
const copy = () => {
|
|
2769
4083
|
navigator.clipboard.writeText(text).then(() => createSnackbar({ text: formatMessage(paragraph_messages_default.copied) })).catch(() => {
|
|
2770
4084
|
});
|
|
2771
4085
|
};
|
|
2772
4086
|
const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
|
|
2773
|
-
return /* @__PURE__ */
|
|
2774
|
-
/* @__PURE__ */
|
|
2775
|
-
|
|
4087
|
+
return /* @__PURE__ */ jsxs17("div", { className, children: [
|
|
4088
|
+
/* @__PURE__ */ jsx68(
|
|
4089
|
+
Input4,
|
|
2776
4090
|
{
|
|
2777
4091
|
type: "text",
|
|
2778
4092
|
value: text,
|
|
@@ -2780,23 +4094,23 @@ function CopyableParagraph({
|
|
|
2780
4094
|
className: (0, import_classnames6.default)("text-ellipsis", inputAlignmentClasses)
|
|
2781
4095
|
}
|
|
2782
4096
|
),
|
|
2783
|
-
/* @__PURE__ */
|
|
4097
|
+
/* @__PURE__ */ jsx68(Button7, { v2: true, block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
2784
4098
|
] });
|
|
2785
4099
|
}
|
|
2786
4100
|
var ParagraphRenderer_default = ParagraphRenderer;
|
|
2787
4101
|
|
|
2788
4102
|
// ../renderers/src/ProgressRenderer.tsx
|
|
2789
4103
|
import { ProgressBar } from "@transferwise/components";
|
|
2790
|
-
import { jsx as
|
|
4104
|
+
import { jsx as jsx69 } from "react/jsx-runtime";
|
|
2791
4105
|
var ProgressRenderer = {
|
|
2792
4106
|
canRenderType: "progress",
|
|
2793
4107
|
render: ({ uid, title, help, progress, progressText, margin, description }) => {
|
|
2794
|
-
return /* @__PURE__ */
|
|
4108
|
+
return /* @__PURE__ */ jsx69(
|
|
2795
4109
|
ProgressBar,
|
|
2796
4110
|
{
|
|
2797
4111
|
id: uid,
|
|
2798
4112
|
className: getMargin(margin),
|
|
2799
|
-
title: title && help ? /* @__PURE__ */
|
|
4113
|
+
title: title && help ? /* @__PURE__ */ jsx69(LabelContentWithHelp, { text: title, help }) : title,
|
|
2800
4114
|
description,
|
|
2801
4115
|
progress: {
|
|
2802
4116
|
max: 1,
|
|
@@ -2810,14 +4124,14 @@ var ProgressRenderer = {
|
|
|
2810
4124
|
|
|
2811
4125
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
2812
4126
|
var import_classnames7 = __toESM(require_classnames());
|
|
2813
|
-
import { Button as
|
|
4127
|
+
import { Button as Button8, Header as Header6, InlineAlert as InlineAlert3, Modal as Modal4, NavigationOption } from "@transferwise/components";
|
|
2814
4128
|
import { Plus } from "@transferwise/icons";
|
|
2815
|
-
import { useState as
|
|
2816
|
-
import { useIntl as
|
|
4129
|
+
import { useState as useState12 } from "react";
|
|
4130
|
+
import { useIntl as useIntl10 } from "react-intl";
|
|
2817
4131
|
|
|
2818
4132
|
// ../renderers/src/messages/repeatable.messages.ts
|
|
2819
|
-
import { defineMessages as
|
|
2820
|
-
var repeatable_messages_default =
|
|
4133
|
+
import { defineMessages as defineMessages9 } from "react-intl";
|
|
4134
|
+
var repeatable_messages_default = defineMessages9({
|
|
2821
4135
|
addItemTitle: {
|
|
2822
4136
|
id: "df.wise.ArraySchema.addItemTitle",
|
|
2823
4137
|
defaultMessage: "Add Item",
|
|
@@ -2841,10 +4155,10 @@ var repeatable_messages_default = defineMessages8({
|
|
|
2841
4155
|
});
|
|
2842
4156
|
|
|
2843
4157
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
2844
|
-
import { Fragment as
|
|
4158
|
+
import { Fragment as Fragment8, jsx as jsx70, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2845
4159
|
var RepeatableRenderer = {
|
|
2846
4160
|
canRenderType: "repeatable",
|
|
2847
|
-
render: (props) => /* @__PURE__ */
|
|
4161
|
+
render: (props) => /* @__PURE__ */ jsx70(Repeatable, __spreadValues({}, props))
|
|
2848
4162
|
};
|
|
2849
4163
|
function Repeatable(props) {
|
|
2850
4164
|
const {
|
|
@@ -2861,8 +4175,8 @@ function Repeatable(props) {
|
|
|
2861
4175
|
onSave,
|
|
2862
4176
|
onRemove
|
|
2863
4177
|
} = props;
|
|
2864
|
-
const { formatMessage } =
|
|
2865
|
-
const [openModalType, setOpenModalType] =
|
|
4178
|
+
const { formatMessage } = useIntl10();
|
|
4179
|
+
const [openModalType, setOpenModalType] = useState12(null);
|
|
2866
4180
|
const { ref } = useScrollToError(validationState, features);
|
|
2867
4181
|
const onAddItem = () => {
|
|
2868
4182
|
onAdd();
|
|
@@ -2885,43 +4199,43 @@ function Repeatable(props) {
|
|
|
2885
4199
|
const onCancelEdit = () => {
|
|
2886
4200
|
setOpenModalType(null);
|
|
2887
4201
|
};
|
|
2888
|
-
return /* @__PURE__ */
|
|
2889
|
-
/* @__PURE__ */
|
|
2890
|
-
title && /* @__PURE__ */
|
|
2891
|
-
description && /* @__PURE__ */
|
|
2892
|
-
/* @__PURE__ */
|
|
4202
|
+
return /* @__PURE__ */ jsxs18(Fragment8, { children: [
|
|
4203
|
+
/* @__PURE__ */ jsxs18("div", { ref, children: [
|
|
4204
|
+
title && /* @__PURE__ */ jsx70(Header6, { title }),
|
|
4205
|
+
description && /* @__PURE__ */ jsx70("p", { children: description }),
|
|
4206
|
+
/* @__PURE__ */ jsxs18(
|
|
2893
4207
|
"div",
|
|
2894
4208
|
{
|
|
2895
4209
|
className: (0, import_classnames7.default)("form-group", {
|
|
2896
4210
|
"has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
|
|
2897
4211
|
}),
|
|
2898
4212
|
children: [
|
|
2899
|
-
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */
|
|
2900
|
-
/* @__PURE__ */
|
|
4213
|
+
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ jsx70(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
|
|
4214
|
+
/* @__PURE__ */ jsx70(
|
|
2901
4215
|
NavigationOption,
|
|
2902
4216
|
{
|
|
2903
|
-
media: /* @__PURE__ */
|
|
4217
|
+
media: /* @__PURE__ */ jsx70(Plus, {}),
|
|
2904
4218
|
title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
|
|
2905
4219
|
showMediaAtAllSizes: true,
|
|
2906
4220
|
onClick: () => onAddItem()
|
|
2907
4221
|
}
|
|
2908
4222
|
),
|
|
2909
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */
|
|
4223
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ jsx70(InlineAlert3, { type: "negative", children: validationState.message })
|
|
2910
4224
|
]
|
|
2911
4225
|
}
|
|
2912
4226
|
)
|
|
2913
4227
|
] }),
|
|
2914
|
-
/* @__PURE__ */
|
|
4228
|
+
/* @__PURE__ */ jsx70(
|
|
2915
4229
|
Modal4,
|
|
2916
4230
|
{
|
|
2917
4231
|
open: openModalType !== null,
|
|
2918
4232
|
title: (openModalType === "add" ? addItemTitle : editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
|
|
2919
|
-
body: /* @__PURE__ */
|
|
2920
|
-
/* @__PURE__ */
|
|
2921
|
-
/* @__PURE__ */
|
|
2922
|
-
/* @__PURE__ */
|
|
2923
|
-
/* @__PURE__ */
|
|
2924
|
-
|
|
4233
|
+
body: /* @__PURE__ */ jsxs18(Fragment8, { children: [
|
|
4234
|
+
/* @__PURE__ */ jsx70("div", { className: "m-b-2", children: editableItem }),
|
|
4235
|
+
/* @__PURE__ */ jsxs18("div", { children: [
|
|
4236
|
+
/* @__PURE__ */ jsx70(Button8, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
|
|
4237
|
+
/* @__PURE__ */ jsx70(
|
|
4238
|
+
Button8,
|
|
2925
4239
|
{
|
|
2926
4240
|
v2: true,
|
|
2927
4241
|
priority: "secondary",
|
|
@@ -2942,10 +4256,10 @@ function ItemSummaryOption({
|
|
|
2942
4256
|
item,
|
|
2943
4257
|
onClick
|
|
2944
4258
|
}) {
|
|
2945
|
-
return /* @__PURE__ */
|
|
4259
|
+
return /* @__PURE__ */ jsx70(
|
|
2946
4260
|
NavigationOption,
|
|
2947
4261
|
{
|
|
2948
|
-
media: /* @__PURE__ */
|
|
4262
|
+
media: /* @__PURE__ */ jsx70(OptionMedia, { media: item.media, preferAvatar: false }),
|
|
2949
4263
|
title: item.title,
|
|
2950
4264
|
content: item.description,
|
|
2951
4265
|
showMediaAtAllSizes: true,
|
|
@@ -2958,14 +4272,14 @@ var RepeatableRenderer_default = RepeatableRenderer;
|
|
|
2958
4272
|
|
|
2959
4273
|
// ../renderers/src/ReviewLegacyRenderer.tsx
|
|
2960
4274
|
import { DefinitionList } from "@transferwise/components";
|
|
2961
|
-
import { Fragment as
|
|
4275
|
+
import { Fragment as Fragment9, jsx as jsx71, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2962
4276
|
var ReviewRenderer = {
|
|
2963
4277
|
canRenderType: "review",
|
|
2964
4278
|
render: ({ callToAction, control, fields, margin, title, trackEvent }) => {
|
|
2965
4279
|
const orientation = mapControlToDefinitionListLayout(control);
|
|
2966
|
-
return /* @__PURE__ */
|
|
2967
|
-
/* @__PURE__ */
|
|
2968
|
-
/* @__PURE__ */
|
|
4280
|
+
return /* @__PURE__ */ jsxs19("div", { className: getMargin(margin), children: [
|
|
4281
|
+
/* @__PURE__ */ jsx71(Header, { title, callToAction }),
|
|
4282
|
+
/* @__PURE__ */ jsx71("div", { className: margin, children: /* @__PURE__ */ jsx71(
|
|
2969
4283
|
DefinitionList,
|
|
2970
4284
|
{
|
|
2971
4285
|
layout: orientation,
|
|
@@ -3003,20 +4317,20 @@ var mapControlToDefinitionListLayout = (control) => {
|
|
|
3003
4317
|
};
|
|
3004
4318
|
var getFieldLabel = (label, help, onClick) => {
|
|
3005
4319
|
if (help) {
|
|
3006
|
-
return /* @__PURE__ */
|
|
4320
|
+
return /* @__PURE__ */ jsxs19(Fragment9, { children: [
|
|
3007
4321
|
label,
|
|
3008
4322
|
" ",
|
|
3009
|
-
/* @__PURE__ */
|
|
4323
|
+
/* @__PURE__ */ jsx71(Help_default, { help, onClick })
|
|
3010
4324
|
] });
|
|
3011
4325
|
}
|
|
3012
4326
|
return label;
|
|
3013
4327
|
};
|
|
3014
4328
|
|
|
3015
4329
|
// ../renderers/src/ReviewRenderer.tsx
|
|
3016
|
-
import { ListItem as
|
|
4330
|
+
import { ListItem as ListItem10, Markdown as Markdown4, Popover } from "@transferwise/components";
|
|
3017
4331
|
import { QuestionMarkCircle } from "@transferwise/icons";
|
|
3018
|
-
import { useIntl as
|
|
3019
|
-
import { jsx as
|
|
4332
|
+
import { useIntl as useIntl11 } from "react-intl";
|
|
4333
|
+
import { jsx as jsx72, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3020
4334
|
var IGNORED_CONTROLS = [
|
|
3021
4335
|
"horizontal",
|
|
3022
4336
|
"horizontal-end-aligned",
|
|
@@ -3026,7 +4340,7 @@ var IGNORED_CONTROLS = [
|
|
|
3026
4340
|
var ReviewRenderer2 = {
|
|
3027
4341
|
canRenderType: "review",
|
|
3028
4342
|
canRender: ({ control }) => control ? !IGNORED_CONTROLS.includes(control) : true,
|
|
3029
|
-
render: (props) => /* @__PURE__ */
|
|
4343
|
+
render: (props) => /* @__PURE__ */ jsx72(Review, __spreadValues({}, props))
|
|
3030
4344
|
};
|
|
3031
4345
|
var Review = ({
|
|
3032
4346
|
callToAction,
|
|
@@ -3037,9 +4351,9 @@ var Review = ({
|
|
|
3037
4351
|
title,
|
|
3038
4352
|
trackEvent
|
|
3039
4353
|
}) => {
|
|
3040
|
-
const intl =
|
|
3041
|
-
return /* @__PURE__ */
|
|
3042
|
-
/* @__PURE__ */
|
|
4354
|
+
const intl = useIntl11();
|
|
4355
|
+
return /* @__PURE__ */ jsxs20("div", { className: getMargin(margin), children: [
|
|
4356
|
+
/* @__PURE__ */ jsx72(Header, { title, callToAction }),
|
|
3043
4357
|
fields.map((field) => {
|
|
3044
4358
|
var _a, _b, _c;
|
|
3045
4359
|
const {
|
|
@@ -3057,8 +4371,8 @@ var Review = ({
|
|
|
3057
4371
|
ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
|
|
3058
4372
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
3059
4373
|
};
|
|
3060
|
-
return /* @__PURE__ */
|
|
3061
|
-
|
|
4374
|
+
return /* @__PURE__ */ jsx72(
|
|
4375
|
+
ListItem10,
|
|
3062
4376
|
{
|
|
3063
4377
|
title: value,
|
|
3064
4378
|
subtitle: label,
|
|
@@ -3078,18 +4392,18 @@ var Review = ({
|
|
|
3078
4392
|
] });
|
|
3079
4393
|
};
|
|
3080
4394
|
var getHelpControl = (help, ariaLabel, onClick) => {
|
|
3081
|
-
return /* @__PURE__ */
|
|
4395
|
+
return /* @__PURE__ */ jsx72(Popover, { content: /* @__PURE__ */ jsx72(Markdown4, { config: { link: { target: "_blank" } }, children: help }), children: /* @__PURE__ */ jsx72(ListItem10.IconButton, { partiallyInteractive: true, "aria-label": ariaLabel, onClick, children: /* @__PURE__ */ jsx72(QuestionMarkCircle, {}) }) });
|
|
3082
4396
|
};
|
|
3083
4397
|
var ReviewRenderer_default = ReviewRenderer2;
|
|
3084
4398
|
|
|
3085
4399
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
3086
|
-
import { Input as
|
|
3087
|
-
import { useState as
|
|
3088
|
-
import { useIntl as
|
|
4400
|
+
import { Input as Input5, InputGroup as InputGroup4, List, ListItem as ListItem11, Markdown as Markdown5 } from "@transferwise/components";
|
|
4401
|
+
import { useState as useState13 } from "react";
|
|
4402
|
+
import { useIntl as useIntl13 } from "react-intl";
|
|
3089
4403
|
|
|
3090
4404
|
// ../renderers/src/messages/search.messages.ts
|
|
3091
|
-
import { defineMessages as
|
|
3092
|
-
var search_messages_default =
|
|
4405
|
+
import { defineMessages as defineMessages10 } from "react-intl";
|
|
4406
|
+
var search_messages_default = defineMessages10({
|
|
3093
4407
|
loading: {
|
|
3094
4408
|
id: "df.wise.SearchLayout.loading",
|
|
3095
4409
|
defaultMessage: "Loading...",
|
|
@@ -3098,11 +4412,11 @@ var search_messages_default = defineMessages9({
|
|
|
3098
4412
|
});
|
|
3099
4413
|
|
|
3100
4414
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
3101
|
-
import { useIntl as
|
|
4415
|
+
import { useIntl as useIntl12 } from "react-intl";
|
|
3102
4416
|
|
|
3103
4417
|
// ../renderers/src/messages/generic-error.messages.ts
|
|
3104
|
-
import { defineMessages as
|
|
3105
|
-
var generic_error_messages_default =
|
|
4418
|
+
import { defineMessages as defineMessages11 } from "react-intl";
|
|
4419
|
+
var generic_error_messages_default = defineMessages11({
|
|
3106
4420
|
genericErrorRetryHint: {
|
|
3107
4421
|
id: "df.wise.PersistAsyncSchema.genericError",
|
|
3108
4422
|
defaultMessage: "Something went wrong, please try again.",
|
|
@@ -3121,20 +4435,20 @@ var generic_error_messages_default = defineMessages10({
|
|
|
3121
4435
|
});
|
|
3122
4436
|
|
|
3123
4437
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
3124
|
-
import { Link } from "@transferwise/components";
|
|
3125
|
-
import { jsx as
|
|
4438
|
+
import { Link as DSLink2 } from "@transferwise/components";
|
|
4439
|
+
import { jsx as jsx73, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3126
4440
|
function ErrorResult({ state }) {
|
|
3127
|
-
const intl =
|
|
3128
|
-
return /* @__PURE__ */
|
|
4441
|
+
const intl = useIntl12();
|
|
4442
|
+
return /* @__PURE__ */ jsxs21("p", { className: "m-t-2", children: [
|
|
3129
4443
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
3130
4444
|
"\xA0",
|
|
3131
|
-
/* @__PURE__ */
|
|
4445
|
+
/* @__PURE__ */ jsx73(DSLink2, { onClick: () => state.onRetry(), children: intl.formatMessage(generic_error_messages_default.retry) })
|
|
3132
4446
|
] });
|
|
3133
4447
|
}
|
|
3134
4448
|
|
|
3135
4449
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
3136
|
-
import { Search } from "@transferwise/icons";
|
|
3137
|
-
import { Fragment as
|
|
4450
|
+
import { Search as Search2 } from "@transferwise/icons";
|
|
4451
|
+
import { Fragment as Fragment10, jsx as jsx74, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3138
4452
|
function BlockSearchRendererComponent({
|
|
3139
4453
|
id,
|
|
3140
4454
|
hint,
|
|
@@ -3147,10 +4461,10 @@ function BlockSearchRendererComponent({
|
|
|
3147
4461
|
trackEvent,
|
|
3148
4462
|
onChange
|
|
3149
4463
|
}) {
|
|
3150
|
-
const [hasSearched, setHasSearched] =
|
|
3151
|
-
const { formatMessage } =
|
|
3152
|
-
return /* @__PURE__ */
|
|
3153
|
-
/* @__PURE__ */
|
|
4464
|
+
const [hasSearched, setHasSearched] = useState13(false);
|
|
4465
|
+
const { formatMessage } = useIntl13();
|
|
4466
|
+
return /* @__PURE__ */ jsxs22("div", { className: getMargin(margin), children: [
|
|
4467
|
+
/* @__PURE__ */ jsx74(
|
|
3154
4468
|
FieldInput_default,
|
|
3155
4469
|
{
|
|
3156
4470
|
id,
|
|
@@ -3159,12 +4473,13 @@ function BlockSearchRendererComponent({
|
|
|
3159
4473
|
help: "",
|
|
3160
4474
|
label: title,
|
|
3161
4475
|
features,
|
|
3162
|
-
children: /* @__PURE__ */
|
|
3163
|
-
|
|
4476
|
+
children: /* @__PURE__ */ jsx74(InputGroup4, { addonStart: { content: /* @__PURE__ */ jsx74(Search2, { size: 24 }) }, children: /* @__PURE__ */ jsx74(
|
|
4477
|
+
Input5,
|
|
3164
4478
|
{
|
|
3165
4479
|
id,
|
|
3166
4480
|
name: id,
|
|
3167
4481
|
placeholder: hint,
|
|
4482
|
+
shape: "pill",
|
|
3168
4483
|
type: "text",
|
|
3169
4484
|
value: query,
|
|
3170
4485
|
onChange: ({ currentTarget: { value } }) => {
|
|
@@ -3178,7 +4493,7 @@ function BlockSearchRendererComponent({
|
|
|
3178
4493
|
) })
|
|
3179
4494
|
}
|
|
3180
4495
|
),
|
|
3181
|
-
isLoading ? /* @__PURE__ */
|
|
4496
|
+
isLoading ? /* @__PURE__ */ jsx74("span", { children: formatMessage(search_messages_default.loading) }) : /* @__PURE__ */ jsx74(SearchResultContent, { state, trackEvent })
|
|
3182
4497
|
] });
|
|
3183
4498
|
}
|
|
3184
4499
|
function SearchResultContent({
|
|
@@ -3187,39 +4502,39 @@ function SearchResultContent({
|
|
|
3187
4502
|
}) {
|
|
3188
4503
|
switch (state.type) {
|
|
3189
4504
|
case "error":
|
|
3190
|
-
return /* @__PURE__ */
|
|
4505
|
+
return /* @__PURE__ */ jsx74(ErrorResult, { state });
|
|
3191
4506
|
case "results":
|
|
3192
|
-
return /* @__PURE__ */
|
|
4507
|
+
return /* @__PURE__ */ jsx74(SearchResults, { state, trackEvent });
|
|
3193
4508
|
case "layout":
|
|
3194
|
-
return /* @__PURE__ */
|
|
4509
|
+
return /* @__PURE__ */ jsxs22(Fragment10, { children: [
|
|
3195
4510
|
" ",
|
|
3196
4511
|
state.layout,
|
|
3197
4512
|
" "
|
|
3198
4513
|
] });
|
|
3199
4514
|
case "noResults":
|
|
3200
|
-
return /* @__PURE__ */
|
|
4515
|
+
return /* @__PURE__ */ jsx74(EmptySearchResult, { state });
|
|
3201
4516
|
case "pending":
|
|
3202
4517
|
default:
|
|
3203
4518
|
return null;
|
|
3204
4519
|
}
|
|
3205
4520
|
}
|
|
3206
4521
|
function EmptySearchResult({ state }) {
|
|
3207
|
-
return /* @__PURE__ */
|
|
4522
|
+
return /* @__PURE__ */ jsx74(Markdown5, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
3208
4523
|
}
|
|
3209
4524
|
function SearchResults({
|
|
3210
4525
|
state,
|
|
3211
4526
|
trackEvent
|
|
3212
4527
|
}) {
|
|
3213
|
-
return /* @__PURE__ */
|
|
4528
|
+
return /* @__PURE__ */ jsx74(List, { children: state.results.map((result) => {
|
|
3214
4529
|
const { media } = result;
|
|
3215
|
-
return /* @__PURE__ */
|
|
3216
|
-
|
|
4530
|
+
return /* @__PURE__ */ jsx74(
|
|
4531
|
+
ListItem11,
|
|
3217
4532
|
{
|
|
3218
4533
|
title: result.title,
|
|
3219
4534
|
subtitle: result.description,
|
|
3220
|
-
media: media ? /* @__PURE__ */
|
|
3221
|
-
control: /* @__PURE__ */
|
|
3222
|
-
|
|
4535
|
+
media: media ? /* @__PURE__ */ jsx74(OptionMedia, { media, preferAvatar: false }) : void 0,
|
|
4536
|
+
control: /* @__PURE__ */ jsx74(
|
|
4537
|
+
ListItem11.Navigation,
|
|
3223
4538
|
{
|
|
3224
4539
|
onClick: () => {
|
|
3225
4540
|
trackEvent("Search Result Selected", __spreadValues({
|
|
@@ -3238,10 +4553,10 @@ var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
|
|
|
3238
4553
|
|
|
3239
4554
|
// ../renderers/src/SearchRenderer/InlineSearchRendererComponent.tsx
|
|
3240
4555
|
import { Markdown as Markdown6, Typeahead } from "@transferwise/components";
|
|
3241
|
-
import { Search as
|
|
3242
|
-
import { useState as
|
|
3243
|
-
import { useIntl as
|
|
3244
|
-
import { jsx as
|
|
4556
|
+
import { Search as Search3 } from "@transferwise/icons";
|
|
4557
|
+
import { useState as useState14 } from "react";
|
|
4558
|
+
import { useIntl as useIntl14 } from "react-intl";
|
|
4559
|
+
import { jsx as jsx75 } from "react/jsx-runtime";
|
|
3245
4560
|
function InlineSearchRenderer({
|
|
3246
4561
|
id,
|
|
3247
4562
|
hint,
|
|
@@ -3253,9 +4568,9 @@ function InlineSearchRenderer({
|
|
|
3253
4568
|
onChange,
|
|
3254
4569
|
trackEvent
|
|
3255
4570
|
}) {
|
|
3256
|
-
const [hasSearched, setHasSearched] =
|
|
3257
|
-
const intl =
|
|
3258
|
-
return /* @__PURE__ */
|
|
4571
|
+
const [hasSearched, setHasSearched] = useState14(false);
|
|
4572
|
+
const intl = useIntl14();
|
|
4573
|
+
return /* @__PURE__ */ jsx75("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx75(
|
|
3259
4574
|
FieldInput_default,
|
|
3260
4575
|
{
|
|
3261
4576
|
id,
|
|
@@ -3264,7 +4579,7 @@ function InlineSearchRenderer({
|
|
|
3264
4579
|
help: "",
|
|
3265
4580
|
label: title,
|
|
3266
4581
|
features,
|
|
3267
|
-
children: /* @__PURE__ */
|
|
4582
|
+
children: /* @__PURE__ */ jsx75(
|
|
3268
4583
|
Typeahead,
|
|
3269
4584
|
{
|
|
3270
4585
|
id: "typeahead-input-id",
|
|
@@ -3273,10 +4588,10 @@ function InlineSearchRenderer({
|
|
|
3273
4588
|
size: "md",
|
|
3274
4589
|
placeholder: hint,
|
|
3275
4590
|
maxHeight: 100,
|
|
3276
|
-
footer: /* @__PURE__ */
|
|
4591
|
+
footer: /* @__PURE__ */ jsx75(TypeaheadFooter, { state, isLoading }),
|
|
3277
4592
|
multiple: false,
|
|
3278
4593
|
clearable: false,
|
|
3279
|
-
addon: /* @__PURE__ */
|
|
4594
|
+
addon: /* @__PURE__ */ jsx75(Search3, { size: 24 }),
|
|
3280
4595
|
options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
|
|
3281
4596
|
minQueryLength: 1,
|
|
3282
4597
|
onChange: (values) => {
|
|
@@ -3313,28 +4628,28 @@ function mapResultToTypeaheadOption(result) {
|
|
|
3313
4628
|
};
|
|
3314
4629
|
}
|
|
3315
4630
|
function TypeaheadFooter({ state, isLoading }) {
|
|
3316
|
-
const { formatMessage } =
|
|
4631
|
+
const { formatMessage } = useIntl14();
|
|
3317
4632
|
if (state.type === "layout") {
|
|
3318
|
-
return /* @__PURE__ */
|
|
4633
|
+
return /* @__PURE__ */ jsx75("div", { className: "m-x-1 m-y-1", children: state.layout });
|
|
3319
4634
|
}
|
|
3320
4635
|
if (state.type === "noResults") {
|
|
3321
|
-
return /* @__PURE__ */
|
|
4636
|
+
return /* @__PURE__ */ jsx75(Markdown6, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
3322
4637
|
}
|
|
3323
4638
|
if (state.type === "error") {
|
|
3324
|
-
return /* @__PURE__ */
|
|
4639
|
+
return /* @__PURE__ */ jsx75("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ jsx75(ErrorResult, { state }) });
|
|
3325
4640
|
}
|
|
3326
4641
|
if (state.type === "pending" || isLoading) {
|
|
3327
|
-
return /* @__PURE__ */
|
|
4642
|
+
return /* @__PURE__ */ jsx75("p", { className: "m-t-2 m-x-2", children: formatMessage(search_messages_default.loading) });
|
|
3328
4643
|
}
|
|
3329
4644
|
return null;
|
|
3330
4645
|
}
|
|
3331
4646
|
var InlineSearchRendererComponent_default = InlineSearchRenderer;
|
|
3332
4647
|
|
|
3333
4648
|
// ../renderers/src/SearchRenderer/SearchRenderer.tsx
|
|
3334
|
-
import { jsx as
|
|
4649
|
+
import { jsx as jsx76 } from "react/jsx-runtime";
|
|
3335
4650
|
var SearchRenderer = {
|
|
3336
4651
|
canRenderType: "search",
|
|
3337
|
-
render: (props) => props.control === "inline" ? /* @__PURE__ */
|
|
4652
|
+
render: (props) => props.control === "inline" ? /* @__PURE__ */ jsx76(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ jsx76(BlockSearchRendererComponent_default, __spreadValues({}, props))
|
|
3338
4653
|
};
|
|
3339
4654
|
var SearchRenderer_default = SearchRenderer;
|
|
3340
4655
|
|
|
@@ -3363,12 +4678,12 @@ var getHeaderAction2 = (callToAction) => {
|
|
|
3363
4678
|
};
|
|
3364
4679
|
|
|
3365
4680
|
// ../renderers/src/SectionRenderer.tsx
|
|
3366
|
-
import { jsx as
|
|
4681
|
+
import { jsx as jsx77, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3367
4682
|
var SectionRenderer = {
|
|
3368
4683
|
canRenderType: "section",
|
|
3369
4684
|
render: ({ children, callToAction, margin, title }) => {
|
|
3370
|
-
return /* @__PURE__ */
|
|
3371
|
-
(title || callToAction) && /* @__PURE__ */
|
|
4685
|
+
return /* @__PURE__ */ jsxs23("section", { className: getMargin(margin), children: [
|
|
4686
|
+
(title || callToAction) && /* @__PURE__ */ jsx77(Header7, { title: title != null ? title : "", action: getHeaderAction2(callToAction) }),
|
|
3372
4687
|
children
|
|
3373
4688
|
] });
|
|
3374
4689
|
}
|
|
@@ -3377,7 +4692,7 @@ var SectionRenderer_default = SectionRenderer;
|
|
|
3377
4692
|
|
|
3378
4693
|
// ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
3379
4694
|
import { RadioGroup } from "@transferwise/components";
|
|
3380
|
-
import { Fragment as
|
|
4695
|
+
import { Fragment as Fragment11, jsx as jsx78, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3381
4696
|
function RadioInputRendererComponent(props) {
|
|
3382
4697
|
const {
|
|
3383
4698
|
id,
|
|
@@ -3392,8 +4707,8 @@ function RadioInputRendererComponent(props) {
|
|
|
3392
4707
|
validationState,
|
|
3393
4708
|
onSelect
|
|
3394
4709
|
} = props;
|
|
3395
|
-
return /* @__PURE__ */
|
|
3396
|
-
/* @__PURE__ */
|
|
4710
|
+
return /* @__PURE__ */ jsxs24(Fragment11, { children: [
|
|
4711
|
+
/* @__PURE__ */ jsx78(
|
|
3397
4712
|
FieldInput_default,
|
|
3398
4713
|
{
|
|
3399
4714
|
id,
|
|
@@ -3402,7 +4717,7 @@ function RadioInputRendererComponent(props) {
|
|
|
3402
4717
|
description,
|
|
3403
4718
|
validation: validationState,
|
|
3404
4719
|
features,
|
|
3405
|
-
children: /* @__PURE__ */
|
|
4720
|
+
children: /* @__PURE__ */ jsx78("span", { children: /* @__PURE__ */ jsx78(
|
|
3406
4721
|
RadioGroup,
|
|
3407
4722
|
{
|
|
3408
4723
|
name: id,
|
|
@@ -3411,7 +4726,7 @@ function RadioInputRendererComponent(props) {
|
|
|
3411
4726
|
value: index,
|
|
3412
4727
|
secondary: option.description,
|
|
3413
4728
|
disabled: option.disabled || disabled,
|
|
3414
|
-
avatar: /* @__PURE__ */
|
|
4729
|
+
avatar: /* @__PURE__ */ jsx78(OptionMedia, { media: option.media, preferAvatar: false })
|
|
3415
4730
|
})),
|
|
3416
4731
|
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
3417
4732
|
onChange: onSelect
|
|
@@ -3426,8 +4741,8 @@ function RadioInputRendererComponent(props) {
|
|
|
3426
4741
|
|
|
3427
4742
|
// ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
3428
4743
|
import { Tabs } from "@transferwise/components";
|
|
3429
|
-
import { useEffect as
|
|
3430
|
-
import { Fragment as
|
|
4744
|
+
import { useEffect as useEffect12 } from "react";
|
|
4745
|
+
import { Fragment as Fragment12, jsx as jsx79, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
3431
4746
|
function TabInputRendererComponent(props) {
|
|
3432
4747
|
const {
|
|
3433
4748
|
id,
|
|
@@ -3442,13 +4757,13 @@ function TabInputRendererComponent(props) {
|
|
|
3442
4757
|
validationState,
|
|
3443
4758
|
onSelect
|
|
3444
4759
|
} = props;
|
|
3445
|
-
|
|
4760
|
+
useEffect12(() => {
|
|
3446
4761
|
if (!isValidIndex2(selectedIndex, options.length)) {
|
|
3447
4762
|
onSelect(0);
|
|
3448
4763
|
}
|
|
3449
4764
|
}, [selectedIndex, onSelect, options.length]);
|
|
3450
|
-
return /* @__PURE__ */
|
|
3451
|
-
/* @__PURE__ */
|
|
4765
|
+
return /* @__PURE__ */ jsxs25(Fragment12, { children: [
|
|
4766
|
+
/* @__PURE__ */ jsx79(
|
|
3452
4767
|
FieldInput_default,
|
|
3453
4768
|
{
|
|
3454
4769
|
id,
|
|
@@ -3457,7 +4772,7 @@ function TabInputRendererComponent(props) {
|
|
|
3457
4772
|
description,
|
|
3458
4773
|
validation: validationState,
|
|
3459
4774
|
features,
|
|
3460
|
-
children: /* @__PURE__ */
|
|
4775
|
+
children: /* @__PURE__ */ jsx79(
|
|
3461
4776
|
Tabs,
|
|
3462
4777
|
{
|
|
3463
4778
|
name: id,
|
|
@@ -3466,7 +4781,7 @@ function TabInputRendererComponent(props) {
|
|
|
3466
4781
|
title: option.title,
|
|
3467
4782
|
// if we pass null, we get some props-types console errors
|
|
3468
4783
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
3469
|
-
content: /* @__PURE__ */
|
|
4784
|
+
content: /* @__PURE__ */ jsx79(Fragment12, {}),
|
|
3470
4785
|
disabled: option.disabled || disabled
|
|
3471
4786
|
})),
|
|
3472
4787
|
onTabSelect: onSelect
|
|
@@ -3481,7 +4796,7 @@ var isValidIndex2 = (index, options) => index !== null && index >= 0 && index <
|
|
|
3481
4796
|
|
|
3482
4797
|
// ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
3483
4798
|
import { SelectInput as SelectInput2, SelectInputOptionContent as SelectInputOptionContent2 } from "@transferwise/components";
|
|
3484
|
-
import { Fragment as
|
|
4799
|
+
import { Fragment as Fragment13, jsx as jsx80, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
3485
4800
|
function SelectInputRendererComponent(props) {
|
|
3486
4801
|
const {
|
|
3487
4802
|
id,
|
|
@@ -3522,13 +4837,13 @@ function SelectInputRendererComponent(props) {
|
|
|
3522
4837
|
} : {
|
|
3523
4838
|
title: option.title,
|
|
3524
4839
|
description: option.description,
|
|
3525
|
-
icon: /* @__PURE__ */
|
|
4840
|
+
icon: /* @__PURE__ */ jsx80(OptionMedia, { media: option.media, preferAvatar: false })
|
|
3526
4841
|
};
|
|
3527
|
-
return /* @__PURE__ */
|
|
4842
|
+
return /* @__PURE__ */ jsx80(SelectInputOptionContent2, __spreadValues({}, contentProps));
|
|
3528
4843
|
};
|
|
3529
4844
|
const extraProps = { autoComplete };
|
|
3530
|
-
return /* @__PURE__ */
|
|
3531
|
-
/* @__PURE__ */
|
|
4845
|
+
return /* @__PURE__ */ jsxs26(Fragment13, { children: [
|
|
4846
|
+
/* @__PURE__ */ jsx80(
|
|
3532
4847
|
FieldInput_default,
|
|
3533
4848
|
{
|
|
3534
4849
|
id,
|
|
@@ -3537,7 +4852,7 @@ function SelectInputRendererComponent(props) {
|
|
|
3537
4852
|
description,
|
|
3538
4853
|
validation: validationState,
|
|
3539
4854
|
features,
|
|
3540
|
-
children: /* @__PURE__ */
|
|
4855
|
+
children: /* @__PURE__ */ jsx80(
|
|
3541
4856
|
SelectInput2,
|
|
3542
4857
|
__spreadValues({
|
|
3543
4858
|
name: id,
|
|
@@ -3558,9 +4873,9 @@ function SelectInputRendererComponent(props) {
|
|
|
3558
4873
|
}
|
|
3559
4874
|
|
|
3560
4875
|
// ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
3561
|
-
import { useEffect as
|
|
4876
|
+
import { useEffect as useEffect13 } from "react";
|
|
3562
4877
|
import { SegmentedControl } from "@transferwise/components";
|
|
3563
|
-
import { Fragment as
|
|
4878
|
+
import { Fragment as Fragment14, jsx as jsx81, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
3564
4879
|
function SegmentedInputRendererComponent(props) {
|
|
3565
4880
|
const {
|
|
3566
4881
|
id,
|
|
@@ -3574,13 +4889,13 @@ function SegmentedInputRendererComponent(props) {
|
|
|
3574
4889
|
validationState,
|
|
3575
4890
|
onSelect
|
|
3576
4891
|
} = props;
|
|
3577
|
-
|
|
4892
|
+
useEffect13(() => {
|
|
3578
4893
|
if (!isValidIndex3(selectedIndex, options.length)) {
|
|
3579
4894
|
onSelect(0);
|
|
3580
4895
|
}
|
|
3581
4896
|
}, [selectedIndex, onSelect, options.length]);
|
|
3582
|
-
return /* @__PURE__ */
|
|
3583
|
-
/* @__PURE__ */
|
|
4897
|
+
return /* @__PURE__ */ jsxs27(Fragment14, { children: [
|
|
4898
|
+
/* @__PURE__ */ jsx81(
|
|
3584
4899
|
FieldInput_default,
|
|
3585
4900
|
{
|
|
3586
4901
|
id,
|
|
@@ -3589,7 +4904,7 @@ function SegmentedInputRendererComponent(props) {
|
|
|
3589
4904
|
description,
|
|
3590
4905
|
validation: validationState,
|
|
3591
4906
|
features,
|
|
3592
|
-
children: /* @__PURE__ */
|
|
4907
|
+
children: /* @__PURE__ */ jsx81(
|
|
3593
4908
|
SegmentedControl,
|
|
3594
4909
|
{
|
|
3595
4910
|
name: `${id}-segmented-control`,
|
|
@@ -3606,14 +4921,14 @@ function SegmentedInputRendererComponent(props) {
|
|
|
3606
4921
|
)
|
|
3607
4922
|
}
|
|
3608
4923
|
),
|
|
3609
|
-
/* @__PURE__ */
|
|
4924
|
+
/* @__PURE__ */ jsx81("div", { id: `${id}-children`, children })
|
|
3610
4925
|
] });
|
|
3611
4926
|
}
|
|
3612
4927
|
var isValidIndex3 = (index, options) => index !== null && index >= 0 && index < options;
|
|
3613
4928
|
|
|
3614
4929
|
// ../renderers/src/SelectInputRenderer/RadioItemRendererComponent.tsx
|
|
3615
|
-
import { Header as Header8, InlineAlert as InlineAlert4, List as List2, ListItem as
|
|
3616
|
-
import { jsx as
|
|
4930
|
+
import { Header as Header8, InlineAlert as InlineAlert4, List as List2, ListItem as ListItem12 } from "@transferwise/components";
|
|
4931
|
+
import { jsx as jsx82, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3617
4932
|
function RadioItemRendererComponent(props) {
|
|
3618
4933
|
const {
|
|
3619
4934
|
id,
|
|
@@ -3629,23 +4944,23 @@ function RadioItemRendererComponent(props) {
|
|
|
3629
4944
|
onSelect
|
|
3630
4945
|
} = props;
|
|
3631
4946
|
const { ref } = useScrollToError(validationState, features);
|
|
3632
|
-
return /* @__PURE__ */
|
|
3633
|
-
rootTitle && /* @__PURE__ */
|
|
4947
|
+
return /* @__PURE__ */ jsxs28("div", { ref, children: [
|
|
4948
|
+
rootTitle && /* @__PURE__ */ jsx82(
|
|
3634
4949
|
Header8,
|
|
3635
4950
|
{
|
|
3636
4951
|
as: "h2",
|
|
3637
|
-
title: help ? /* @__PURE__ */
|
|
4952
|
+
title: help ? /* @__PURE__ */ jsx82(LabelContentWithHelp, { text: rootTitle, help }) : rootTitle
|
|
3638
4953
|
}
|
|
3639
4954
|
),
|
|
3640
|
-
rootDescription && /* @__PURE__ */
|
|
3641
|
-
/* @__PURE__ */
|
|
3642
|
-
({ title, description, additionalText, inlineAlert, disabled, media, supportingValues }, index) => /* @__PURE__ */
|
|
3643
|
-
|
|
4955
|
+
rootDescription && /* @__PURE__ */ jsx82("p", { children: rootDescription }),
|
|
4956
|
+
/* @__PURE__ */ jsx82(List2, { children: options.map(
|
|
4957
|
+
({ title, description, additionalText, inlineAlert, disabled, media, supportingValues }, index) => /* @__PURE__ */ jsx82(
|
|
4958
|
+
ListItem12,
|
|
3644
4959
|
__spreadValues({
|
|
3645
4960
|
title,
|
|
3646
4961
|
subtitle: description,
|
|
3647
|
-
control: /* @__PURE__ */
|
|
3648
|
-
|
|
4962
|
+
control: /* @__PURE__ */ jsx82(
|
|
4963
|
+
ListItem12.Radio,
|
|
3649
4964
|
{
|
|
3650
4965
|
name: title,
|
|
3651
4966
|
checked: selectedIndex === index,
|
|
@@ -3660,50 +4975,50 @@ function RadioItemRendererComponent(props) {
|
|
|
3660
4975
|
title
|
|
3661
4976
|
)
|
|
3662
4977
|
) }, `${id}-${selectedIndex}`),
|
|
3663
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */
|
|
4978
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ jsx82(InlineAlert4, { type: "negative", children: validationState.message }),
|
|
3664
4979
|
children
|
|
3665
4980
|
] });
|
|
3666
4981
|
}
|
|
3667
4982
|
|
|
3668
4983
|
// ../renderers/src/SelectInputRenderer/SelectInputRenderer.tsx
|
|
3669
|
-
import { jsx as
|
|
4984
|
+
import { jsx as jsx83 } from "react/jsx-runtime";
|
|
3670
4985
|
var SelectInputRenderer = {
|
|
3671
4986
|
canRenderType: "input-select",
|
|
3672
4987
|
render: (props) => {
|
|
3673
4988
|
switch (props.control) {
|
|
3674
4989
|
case "radio":
|
|
3675
|
-
return /* @__PURE__ */
|
|
4990
|
+
return /* @__PURE__ */ jsx83(RadioInputRendererComponent, __spreadValues({}, props));
|
|
3676
4991
|
case "radio-item":
|
|
3677
|
-
return /* @__PURE__ */
|
|
4992
|
+
return /* @__PURE__ */ jsx83(RadioItemRendererComponent, __spreadValues({}, props));
|
|
3678
4993
|
case "tab":
|
|
3679
|
-
return props.options.length > 3 ? /* @__PURE__ */
|
|
4994
|
+
return props.options.length > 3 ? /* @__PURE__ */ jsx83(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx83(TabInputRendererComponent, __spreadValues({}, props));
|
|
3680
4995
|
case "segmented":
|
|
3681
|
-
return props.options.length > 3 ? /* @__PURE__ */
|
|
4996
|
+
return props.options.length > 3 ? /* @__PURE__ */ jsx83(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx83(SegmentedInputRendererComponent, __spreadValues({}, props));
|
|
3682
4997
|
case "select":
|
|
3683
4998
|
default:
|
|
3684
|
-
return /* @__PURE__ */
|
|
4999
|
+
return /* @__PURE__ */ jsx83(SelectInputRendererComponent, __spreadValues({}, props));
|
|
3685
5000
|
}
|
|
3686
5001
|
}
|
|
3687
5002
|
};
|
|
3688
5003
|
var SelectInputRenderer_default = SelectInputRenderer;
|
|
3689
5004
|
|
|
3690
5005
|
// ../renderers/src/StatusListRenderer.tsx
|
|
3691
|
-
import { AvatarView as AvatarView4, Header as Header9, ListItem as
|
|
3692
|
-
import { jsx as
|
|
5006
|
+
import { AvatarView as AvatarView4, Header as Header9, ListItem as ListItem13 } from "@transferwise/components";
|
|
5007
|
+
import { jsx as jsx84, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
3693
5008
|
var StatusListRenderer = {
|
|
3694
5009
|
canRenderType: "status-list",
|
|
3695
|
-
render: ({ margin, items, title }) => /* @__PURE__ */
|
|
3696
|
-
title ? /* @__PURE__ */
|
|
5010
|
+
render: ({ margin, items, title }) => /* @__PURE__ */ jsxs29("div", { className: getMargin(margin), children: [
|
|
5011
|
+
title ? /* @__PURE__ */ jsx84(Header9, { title }) : null,
|
|
3697
5012
|
items.map((item) => {
|
|
3698
5013
|
const { callToAction, description, title: itemTitle } = item;
|
|
3699
|
-
return /* @__PURE__ */
|
|
3700
|
-
|
|
5014
|
+
return /* @__PURE__ */ jsx84(
|
|
5015
|
+
ListItem13,
|
|
3701
5016
|
{
|
|
3702
5017
|
title: itemTitle,
|
|
3703
5018
|
subtitle: description,
|
|
3704
|
-
media: /* @__PURE__ */
|
|
3705
|
-
additionalInfo: callToAction ? /* @__PURE__ */
|
|
3706
|
-
|
|
5019
|
+
media: /* @__PURE__ */ jsx84(StatusListItemMedia, __spreadValues({}, item)),
|
|
5020
|
+
additionalInfo: callToAction ? /* @__PURE__ */ jsx84(
|
|
5021
|
+
ListItem13.AdditionalInfo,
|
|
3707
5022
|
{
|
|
3708
5023
|
action: __spreadValues({
|
|
3709
5024
|
label: callToAction.title
|
|
@@ -3721,10 +5036,10 @@ var StatusListItemMedia = ({ icon, status }) => {
|
|
|
3721
5036
|
return void 0;
|
|
3722
5037
|
}
|
|
3723
5038
|
if ("name" in icon) {
|
|
3724
|
-
return /* @__PURE__ */
|
|
5039
|
+
return /* @__PURE__ */ jsx84(AvatarView4, { badge: { status: mapStatus(status) }, children: /* @__PURE__ */ jsx84(DynamicIcon_default, { name: icon.name }) });
|
|
3725
5040
|
}
|
|
3726
5041
|
if ("text" in icon) {
|
|
3727
|
-
return /* @__PURE__ */
|
|
5042
|
+
return /* @__PURE__ */ jsx84(AvatarView4, { badge: { status: mapStatus(status) }, children: icon.text });
|
|
3728
5043
|
}
|
|
3729
5044
|
return void 0;
|
|
3730
5045
|
};
|
|
@@ -3742,12 +5057,12 @@ var StatusListRenderer_default = StatusListRenderer;
|
|
|
3742
5057
|
|
|
3743
5058
|
// ../renderers/src/utils/useCustomTheme.ts
|
|
3744
5059
|
import { useTheme } from "@wise/components-theming";
|
|
3745
|
-
import { useEffect as
|
|
5060
|
+
import { useEffect as useEffect14, useMemo as useMemo2 } from "react";
|
|
3746
5061
|
var ThemeRequiredEventName = "Theme Required";
|
|
3747
5062
|
var useCustomTheme = (theme, trackEvent) => {
|
|
3748
5063
|
const theming = useTheme();
|
|
3749
|
-
const previousTheme =
|
|
3750
|
-
|
|
5064
|
+
const previousTheme = useMemo2(() => theming.theme, []);
|
|
5065
|
+
useEffect14(() => {
|
|
3751
5066
|
theming.setTheme(theme);
|
|
3752
5067
|
trackEvent(ThemeRequiredEventName, { theme });
|
|
3753
5068
|
return theme !== previousTheme ? () => {
|
|
@@ -3758,86 +5073,14 @@ var useCustomTheme = (theme, trackEvent) => {
|
|
|
3758
5073
|
}, []);
|
|
3759
5074
|
};
|
|
3760
5075
|
|
|
3761
|
-
// ../renderers/src/step/StepFooter.tsx
|
|
3762
|
-
import { Button as Button7 } from "@transferwise/components";
|
|
3763
|
-
import { useEffect as useEffect12, useRef as useRef2, useState as useState13 } from "react";
|
|
3764
|
-
import { useIntl as useIntl14 } from "react-intl";
|
|
3765
|
-
|
|
3766
|
-
// ../renderers/src/messages/step.messages.ts
|
|
3767
|
-
import { defineMessages as defineMessages11 } from "react-intl";
|
|
3768
|
-
var step_messages_default = defineMessages11({
|
|
3769
|
-
scrollToBottom: {
|
|
3770
|
-
id: "df.wise.step.scrollToBottom",
|
|
3771
|
-
defaultMessage: "Scroll to bottom",
|
|
3772
|
-
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."
|
|
3773
|
-
}
|
|
3774
|
-
});
|
|
3775
|
-
|
|
3776
|
-
// ../renderers/src/step/StepFooter.tsx
|
|
3777
|
-
import { Fragment as Fragment12, jsx as jsx77, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
3778
|
-
var SCROLL_TO_BOTTOM = "scroll-to-bottom";
|
|
3779
|
-
var StepFooter = ({ footer, tags }) => {
|
|
3780
|
-
if (tags == null ? void 0 : tags.includes(SCROLL_TO_BOTTOM)) {
|
|
3781
|
-
return /* @__PURE__ */ jsx77(FooterWithScrollButton, { footer });
|
|
3782
|
-
}
|
|
3783
|
-
return /* @__PURE__ */ jsx77(DefaultFooter, { footer });
|
|
3784
|
-
};
|
|
3785
|
-
var DefaultFooter = ({ footer }) => {
|
|
3786
|
-
const hasFooter = footer && Array.isArray(footer) && footer.length > 0;
|
|
3787
|
-
return hasFooter ? /* @__PURE__ */ jsx77("div", { className: "df-step-fixed__footer", children: footer }) : void 0;
|
|
3788
|
-
};
|
|
3789
|
-
var FooterWithScrollButton = ({ footer }) => {
|
|
3790
|
-
const { formatMessage } = useIntl14();
|
|
3791
|
-
const endOfLayoutRef = useRef2(null);
|
|
3792
|
-
const isElementVisible = useIsElementVisible(endOfLayoutRef);
|
|
3793
|
-
const scrollButton = /* @__PURE__ */ jsx77(
|
|
3794
|
-
Button7,
|
|
3795
|
-
{
|
|
3796
|
-
className: "m-b-1",
|
|
3797
|
-
v2: true,
|
|
3798
|
-
block: true,
|
|
3799
|
-
priority: "tertiary",
|
|
3800
|
-
onClick: () => {
|
|
3801
|
-
var _a;
|
|
3802
|
-
(_a = endOfLayoutRef.current) == null ? void 0 : _a.scrollIntoView({ behavior: "smooth" });
|
|
3803
|
-
},
|
|
3804
|
-
children: formatMessage(step_messages_default.scrollToBottom)
|
|
3805
|
-
}
|
|
3806
|
-
);
|
|
3807
|
-
const hasStepFooterContent = footer && Array.isArray(footer) && footer.length > 0;
|
|
3808
|
-
if (isElementVisible && !hasStepFooterContent) {
|
|
3809
|
-
return /* @__PURE__ */ jsx77("div", { ref: endOfLayoutRef, "aria-hidden": "true" });
|
|
3810
|
-
}
|
|
3811
|
-
return /* @__PURE__ */ jsxs26(Fragment12, { children: [
|
|
3812
|
-
/* @__PURE__ */ jsx77("div", { ref: endOfLayoutRef, "aria-hidden": "true" }),
|
|
3813
|
-
/* @__PURE__ */ jsxs26("div", { className: "df-step-fixed__footer", children: [
|
|
3814
|
-
!isElementVisible && scrollButton,
|
|
3815
|
-
footer
|
|
3816
|
-
] })
|
|
3817
|
-
] });
|
|
3818
|
-
};
|
|
3819
|
-
var useIsElementVisible = (elementRef) => {
|
|
3820
|
-
const [isVisible, setIsVisible] = useState13(false);
|
|
3821
|
-
useEffect12(() => {
|
|
3822
|
-
const element = elementRef.current;
|
|
3823
|
-
if (!element) return;
|
|
3824
|
-
const observer = new IntersectionObserver(([entry]) => {
|
|
3825
|
-
setIsVisible(entry.isIntersecting);
|
|
3826
|
-
});
|
|
3827
|
-
observer.observe(element);
|
|
3828
|
-
return () => observer.disconnect();
|
|
3829
|
-
}, [elementRef]);
|
|
3830
|
-
return isVisible;
|
|
3831
|
-
};
|
|
3832
|
-
|
|
3833
5076
|
// ../renderers/src/step/StepHeader.tsx
|
|
3834
5077
|
import { Title as Title2 } from "@transferwise/components";
|
|
3835
|
-
import { Fragment as
|
|
5078
|
+
import { Fragment as Fragment15, jsx as jsx85, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
3836
5079
|
var StepHeader = ({ title, description, tags }) => {
|
|
3837
5080
|
const { titleType, alignmentClassName } = getHeaderStyle(tags);
|
|
3838
|
-
return /* @__PURE__ */
|
|
3839
|
-
title ? /* @__PURE__ */
|
|
3840
|
-
description ? /* @__PURE__ */
|
|
5081
|
+
return /* @__PURE__ */ jsxs30(Fragment15, { children: [
|
|
5082
|
+
title ? /* @__PURE__ */ jsx85(Title2, { as: "h1", type: titleType, className: `${alignmentClassName} m-b-2`, children: title }) : void 0,
|
|
5083
|
+
description ? /* @__PURE__ */ jsx85("p", { className: `${alignmentClassName} np-text-body-large`, children: description }) : void 0
|
|
3841
5084
|
] });
|
|
3842
5085
|
};
|
|
3843
5086
|
var getHeaderStyle = (tags) => {
|
|
@@ -3863,30 +5106,30 @@ var back_messages_default = defineMessages12({
|
|
|
3863
5106
|
});
|
|
3864
5107
|
|
|
3865
5108
|
// ../renderers/src/step/topbar/BackButton.tsx
|
|
3866
|
-
import { jsx as
|
|
5109
|
+
import { jsx as jsx86, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
3867
5110
|
function BackButton({ title, onClick }) {
|
|
3868
5111
|
const { formatMessage } = useIntl15();
|
|
3869
|
-
return /* @__PURE__ */
|
|
3870
|
-
/* @__PURE__ */
|
|
3871
|
-
/* @__PURE__ */
|
|
5112
|
+
return /* @__PURE__ */ jsxs31(IconButton, { className: "df-back-button", priority: "tertiary", onClick, children: [
|
|
5113
|
+
/* @__PURE__ */ jsx86("span", { className: "sr-only", children: title != null ? title : formatMessage(back_messages_default.back) }),
|
|
5114
|
+
/* @__PURE__ */ jsx86(ArrowLeft, {})
|
|
3872
5115
|
] });
|
|
3873
5116
|
}
|
|
3874
5117
|
|
|
3875
5118
|
// ../renderers/src/step/topbar/Toolbar.tsx
|
|
3876
|
-
import { Button as
|
|
3877
|
-
import { jsx as
|
|
5119
|
+
import { Button as Button9, IconButton as IconButton2 } from "@transferwise/components";
|
|
5120
|
+
import { jsx as jsx87, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
3878
5121
|
var Toolbar = ({ items }) => {
|
|
3879
|
-
return (items == null ? void 0 : items.length) > 0 ? /* @__PURE__ */
|
|
5122
|
+
return (items == null ? void 0 : items.length) > 0 ? /* @__PURE__ */ jsx87("div", { className: "df-toolbar", children: items.map((item, index) => /* @__PURE__ */ jsx87(ToolbarButton, __spreadValues({}, item), `${item.type}-${index}-${item.title}`)) }) : null;
|
|
3880
5123
|
};
|
|
3881
5124
|
function ToolbarButton(props) {
|
|
3882
|
-
return prefersMedia(props.control) ? /* @__PURE__ */
|
|
5125
|
+
return prefersMedia(props.control) ? /* @__PURE__ */ jsx87(MediaToolbarButton, __spreadValues({}, props)) : /* @__PURE__ */ jsx87(TextToolbarButton, __spreadValues({}, props));
|
|
3883
5126
|
}
|
|
3884
5127
|
function MediaToolbarButton(props) {
|
|
3885
5128
|
var _a;
|
|
3886
5129
|
const { context, control, media, accessibilityDescription, disabled, onClick } = props;
|
|
3887
5130
|
const priority = getIconButtonPriority(control);
|
|
3888
5131
|
const type = getSentiment2(context);
|
|
3889
|
-
return /* @__PURE__ */
|
|
5132
|
+
return /* @__PURE__ */ jsxs32(
|
|
3890
5133
|
IconButton2,
|
|
3891
5134
|
{
|
|
3892
5135
|
className: "df-toolbar-button",
|
|
@@ -3896,7 +5139,7 @@ function MediaToolbarButton(props) {
|
|
|
3896
5139
|
type,
|
|
3897
5140
|
onClick,
|
|
3898
5141
|
children: [
|
|
3899
|
-
accessibilityDescription ? /* @__PURE__ */
|
|
5142
|
+
accessibilityDescription ? /* @__PURE__ */ jsx87("span", { className: "sr-only", children: accessibilityDescription }) : null,
|
|
3900
5143
|
media ? (_a = getAddonStartMedia(media)) == null ? void 0 : _a.value : null
|
|
3901
5144
|
]
|
|
3902
5145
|
}
|
|
@@ -3907,8 +5150,8 @@ function TextToolbarButton(props) {
|
|
|
3907
5150
|
const addonStart = media ? getAddonStartMedia(media) : void 0;
|
|
3908
5151
|
const priority = getPriority2(control);
|
|
3909
5152
|
const sentiment = getSentiment2(context);
|
|
3910
|
-
return /* @__PURE__ */
|
|
3911
|
-
|
|
5153
|
+
return /* @__PURE__ */ jsx87(
|
|
5154
|
+
Button9,
|
|
3912
5155
|
{
|
|
3913
5156
|
v2: true,
|
|
3914
5157
|
size: "sm",
|
|
@@ -3937,18 +5180,18 @@ var getIconButtonPriority = (control) => {
|
|
|
3937
5180
|
};
|
|
3938
5181
|
|
|
3939
5182
|
// ../renderers/src/step/topbar/TopBar.tsx
|
|
3940
|
-
import { jsx as
|
|
5183
|
+
import { jsx as jsx88, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
3941
5184
|
function TopBar({ back, toolbar, tags }) {
|
|
3942
5185
|
const isBackAllowed = !(tags == null ? void 0 : tags.includes("non-dismissible"));
|
|
3943
5186
|
const backCTA = isBackAllowed ? back : void 0;
|
|
3944
|
-
return backCTA || toolbar ? /* @__PURE__ */
|
|
3945
|
-
backCTA ? /* @__PURE__ */
|
|
3946
|
-
toolbar ? /* @__PURE__ */
|
|
5187
|
+
return backCTA || toolbar ? /* @__PURE__ */ jsxs33("div", { className: "d-flex m-b-2", children: [
|
|
5188
|
+
backCTA ? /* @__PURE__ */ jsx88(BackButton, __spreadValues({}, backCTA)) : null,
|
|
5189
|
+
toolbar ? /* @__PURE__ */ jsx88(Toolbar, __spreadValues({}, toolbar)) : null
|
|
3947
5190
|
] }) : null;
|
|
3948
5191
|
}
|
|
3949
5192
|
|
|
3950
5193
|
// ../renderers/src/step/SplashCelebrationStepRenderer.tsx
|
|
3951
|
-
import { jsx as
|
|
5194
|
+
import { jsx as jsx89, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
3952
5195
|
var SplashCelebrationStepRenderer = {
|
|
3953
5196
|
canRenderType: "step",
|
|
3954
5197
|
canRender: ({ control }) => control === "splash-celebration",
|
|
@@ -3957,16 +5200,16 @@ var SplashCelebrationStepRenderer = {
|
|
|
3957
5200
|
function SplashCelebrationStepRendererComponent(props) {
|
|
3958
5201
|
const { back, title, description, toolbar, children, footer, tags, trackEvent } = props;
|
|
3959
5202
|
useCustomTheme("forest-green", trackEvent);
|
|
3960
|
-
return /* @__PURE__ */
|
|
3961
|
-
/* @__PURE__ */
|
|
3962
|
-
title || description ? /* @__PURE__ */
|
|
5203
|
+
return /* @__PURE__ */ jsxs34("div", { className: "splash-screen m-t-5", children: [
|
|
5204
|
+
/* @__PURE__ */ jsx89(TopBar, { back, toolbar, tags }),
|
|
5205
|
+
title || description ? /* @__PURE__ */ jsx89("div", { className: "m-b-4", children: /* @__PURE__ */ jsx89(StepHeader, { title, description, tags }) }) : void 0,
|
|
3963
5206
|
children,
|
|
3964
|
-
/* @__PURE__ */
|
|
5207
|
+
/* @__PURE__ */ jsx89(StepFooter, { footer, tags })
|
|
3965
5208
|
] });
|
|
3966
5209
|
}
|
|
3967
5210
|
|
|
3968
5211
|
// ../renderers/src/step/SplashStepRenderer.tsx
|
|
3969
|
-
import { jsx as
|
|
5212
|
+
import { jsx as jsx90, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
3970
5213
|
var SplashStepRenderer = {
|
|
3971
5214
|
canRenderType: "step",
|
|
3972
5215
|
canRender: ({ control }) => control === "splash",
|
|
@@ -3974,55 +5217,55 @@ var SplashStepRenderer = {
|
|
|
3974
5217
|
};
|
|
3975
5218
|
function SplashStepRendererComponent(props) {
|
|
3976
5219
|
const { back, title, description, toolbar, children, footer, tags } = props;
|
|
3977
|
-
return /* @__PURE__ */
|
|
3978
|
-
/* @__PURE__ */
|
|
3979
|
-
title || description ? /* @__PURE__ */
|
|
5220
|
+
return /* @__PURE__ */ jsxs35("div", { className: "splash-screen m-t-5", children: [
|
|
5221
|
+
/* @__PURE__ */ jsx90(TopBar, { back, toolbar, tags }),
|
|
5222
|
+
title || description ? /* @__PURE__ */ jsx90("div", { className: "m-b-4", children: /* @__PURE__ */ jsx90(StepHeader, { title, description, tags }) }) : void 0,
|
|
3980
5223
|
children,
|
|
3981
|
-
/* @__PURE__ */
|
|
5224
|
+
/* @__PURE__ */ jsx90(StepFooter, { footer, tags })
|
|
3982
5225
|
] });
|
|
3983
5226
|
}
|
|
3984
5227
|
|
|
3985
5228
|
// ../renderers/src/step/StepRenderer.tsx
|
|
3986
5229
|
import { Alert as Alert2 } from "@transferwise/components";
|
|
3987
|
-
import { jsx as
|
|
5230
|
+
import { jsx as jsx91, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
3988
5231
|
var StepRenderer = {
|
|
3989
5232
|
canRenderType: "step",
|
|
3990
5233
|
render: StepRendererComponent
|
|
3991
5234
|
};
|
|
3992
5235
|
function StepRendererComponent(props) {
|
|
3993
5236
|
const { back, description, error, title, children, toolbar, footer, tags } = props;
|
|
3994
|
-
return /* @__PURE__ */
|
|
3995
|
-
/* @__PURE__ */
|
|
3996
|
-
title || description ? /* @__PURE__ */
|
|
3997
|
-
error ? /* @__PURE__ */
|
|
5237
|
+
return /* @__PURE__ */ jsxs36("div", { children: [
|
|
5238
|
+
/* @__PURE__ */ jsx91(TopBar, { back, toolbar, tags }),
|
|
5239
|
+
title || description ? /* @__PURE__ */ jsx91("div", { className: "m-b-4", children: /* @__PURE__ */ jsx91(StepHeader, { title, description, tags }) }) : void 0,
|
|
5240
|
+
error ? /* @__PURE__ */ jsx91(Alert2, { type: "negative", className: "m-b-2", message: error }) : null,
|
|
3998
5241
|
children,
|
|
3999
|
-
/* @__PURE__ */
|
|
5242
|
+
/* @__PURE__ */ jsx91(StepFooter, { footer, tags })
|
|
4000
5243
|
] });
|
|
4001
5244
|
}
|
|
4002
5245
|
|
|
4003
5246
|
// ../renderers/src/TabsRenderer.tsx
|
|
4004
|
-
import { Chips, SegmentedControl as SegmentedControl2, Tabs as Tabs2 } from "@transferwise/components";
|
|
4005
|
-
import { useState as
|
|
4006
|
-
import { jsx as
|
|
5247
|
+
import { Chips as Chips2, SegmentedControl as SegmentedControl2, Tabs as Tabs2 } from "@transferwise/components";
|
|
5248
|
+
import { useState as useState15 } from "react";
|
|
5249
|
+
import { jsx as jsx92, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
4007
5250
|
var TabsRenderer = {
|
|
4008
5251
|
canRenderType: "tabs",
|
|
4009
5252
|
render: (props) => {
|
|
4010
5253
|
switch (props.control) {
|
|
4011
5254
|
case "segmented":
|
|
4012
5255
|
if (props.tabs.length > 3) {
|
|
4013
|
-
return /* @__PURE__ */
|
|
5256
|
+
return /* @__PURE__ */ jsx92(TabsRendererComponent, __spreadValues({}, props));
|
|
4014
5257
|
}
|
|
4015
|
-
return /* @__PURE__ */
|
|
5258
|
+
return /* @__PURE__ */ jsx92(SegmentedTabsRendererComponent, __spreadValues({}, props));
|
|
4016
5259
|
case "chips":
|
|
4017
|
-
return /* @__PURE__ */
|
|
5260
|
+
return /* @__PURE__ */ jsx92(ChipsTabsRendererComponent, __spreadValues({}, props));
|
|
4018
5261
|
default:
|
|
4019
|
-
return /* @__PURE__ */
|
|
5262
|
+
return /* @__PURE__ */ jsx92(TabsRendererComponent, __spreadValues({}, props));
|
|
4020
5263
|
}
|
|
4021
5264
|
}
|
|
4022
5265
|
};
|
|
4023
5266
|
function TabsRendererComponent({ uid, margin, tabs }) {
|
|
4024
|
-
const [selectedIndex, setSelectedIndex] =
|
|
4025
|
-
return /* @__PURE__ */
|
|
5267
|
+
const [selectedIndex, setSelectedIndex] = useState15(0);
|
|
5268
|
+
return /* @__PURE__ */ jsx92("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx92(
|
|
4026
5269
|
Tabs2,
|
|
4027
5270
|
{
|
|
4028
5271
|
name: uid,
|
|
@@ -4030,7 +5273,7 @@ function TabsRendererComponent({ uid, margin, tabs }) {
|
|
|
4030
5273
|
tabs: tabs.map((option) => ({
|
|
4031
5274
|
title: option.title,
|
|
4032
5275
|
disabled: false,
|
|
4033
|
-
content: /* @__PURE__ */
|
|
5276
|
+
content: /* @__PURE__ */ jsxs37("div", { className: "m-t-2", children: [
|
|
4034
5277
|
" ",
|
|
4035
5278
|
option.children,
|
|
4036
5279
|
" "
|
|
@@ -4042,9 +5285,9 @@ function TabsRendererComponent({ uid, margin, tabs }) {
|
|
|
4042
5285
|
}
|
|
4043
5286
|
function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
|
|
4044
5287
|
var _a;
|
|
4045
|
-
const [selectedIndex, setSelectedIndex] =
|
|
4046
|
-
return /* @__PURE__ */
|
|
4047
|
-
/* @__PURE__ */
|
|
5288
|
+
const [selectedIndex, setSelectedIndex] = useState15(0);
|
|
5289
|
+
return /* @__PURE__ */ jsxs37("div", { className: getMargin(margin), children: [
|
|
5290
|
+
/* @__PURE__ */ jsx92(
|
|
4048
5291
|
SegmentedControl2,
|
|
4049
5292
|
{
|
|
4050
5293
|
name: uid,
|
|
@@ -4059,37 +5302,37 @@ function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
|
|
|
4059
5302
|
onChange: (value) => setSelectedIndex(Number(value))
|
|
4060
5303
|
}
|
|
4061
5304
|
),
|
|
4062
|
-
/* @__PURE__ */
|
|
5305
|
+
/* @__PURE__ */ jsx92("div", { id: `${uid}-children`, className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
4063
5306
|
] });
|
|
4064
5307
|
}
|
|
4065
5308
|
function ChipsTabsRendererComponent({ margin, tabs }) {
|
|
4066
5309
|
var _a;
|
|
4067
|
-
const [selectedIndex, setSelectedIndex] =
|
|
4068
|
-
return /* @__PURE__ */
|
|
4069
|
-
/* @__PURE__ */
|
|
4070
|
-
|
|
5310
|
+
const [selectedIndex, setSelectedIndex] = useState15(0);
|
|
5311
|
+
return /* @__PURE__ */ jsxs37("div", { className: getMargin(margin), children: [
|
|
5312
|
+
/* @__PURE__ */ jsx92("div", { className: "chips-container", children: /* @__PURE__ */ jsx92(
|
|
5313
|
+
Chips2,
|
|
4071
5314
|
{
|
|
4072
5315
|
chips: tabs.map((tab, index) => ({ label: tab.title, value: index })),
|
|
4073
5316
|
selected: selectedIndex,
|
|
4074
5317
|
onChange: ({ selectedValue }) => setSelectedIndex(Number(selectedValue))
|
|
4075
5318
|
}
|
|
4076
5319
|
) }),
|
|
4077
|
-
/* @__PURE__ */
|
|
5320
|
+
/* @__PURE__ */ jsx92("div", { className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
4078
5321
|
] });
|
|
4079
5322
|
}
|
|
4080
5323
|
|
|
4081
5324
|
// ../renderers/src/TextInputRenderer.tsx
|
|
4082
|
-
import { InputGroup as
|
|
5325
|
+
import { InputGroup as InputGroup5 } from "@transferwise/components";
|
|
4083
5326
|
|
|
4084
5327
|
// ../renderers/src/components/VariableTextInput.tsx
|
|
4085
5328
|
import {
|
|
4086
|
-
Input as
|
|
5329
|
+
Input as Input6,
|
|
4087
5330
|
InputWithDisplayFormat,
|
|
4088
5331
|
PhoneNumberInput,
|
|
4089
5332
|
TextArea,
|
|
4090
5333
|
TextareaWithDisplayFormat
|
|
4091
5334
|
} from "@transferwise/components";
|
|
4092
|
-
import { jsx as
|
|
5335
|
+
import { jsx as jsx93 } from "react/jsx-runtime";
|
|
4093
5336
|
var commonKeys = [
|
|
4094
5337
|
"autoComplete",
|
|
4095
5338
|
"autoCapitalize",
|
|
@@ -4108,12 +5351,12 @@ function VariableTextInput(inputProps) {
|
|
|
4108
5351
|
const commonProps = __spreadProps(__spreadValues({}, pick(inputProps, ...commonKeys)), { name: id });
|
|
4109
5352
|
switch (control) {
|
|
4110
5353
|
case "email":
|
|
4111
|
-
return /* @__PURE__ */
|
|
5354
|
+
return /* @__PURE__ */ jsx93(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "email", onChange }));
|
|
4112
5355
|
case "password":
|
|
4113
|
-
return /* @__PURE__ */
|
|
5356
|
+
return /* @__PURE__ */ jsx93(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "password", onChange }));
|
|
4114
5357
|
case "numeric": {
|
|
4115
5358
|
const numericProps = __spreadProps(__spreadValues({}, commonProps), { type: "number", onWheel });
|
|
4116
|
-
return /* @__PURE__ */
|
|
5359
|
+
return /* @__PURE__ */ jsx93(
|
|
4117
5360
|
TextInput,
|
|
4118
5361
|
__spreadProps(__spreadValues({}, numericProps), {
|
|
4119
5362
|
onChange: (newValue) => {
|
|
@@ -4124,21 +5367,21 @@ function VariableTextInput(inputProps) {
|
|
|
4124
5367
|
);
|
|
4125
5368
|
}
|
|
4126
5369
|
case "phone-number":
|
|
4127
|
-
return /* @__PURE__ */
|
|
5370
|
+
return /* @__PURE__ */ jsx93(PhoneNumberInput, __spreadProps(__spreadValues({ initialValue: value }, commonProps), { onChange }));
|
|
4128
5371
|
default: {
|
|
4129
|
-
return /* @__PURE__ */
|
|
5372
|
+
return /* @__PURE__ */ jsx93(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "text", onChange }));
|
|
4130
5373
|
}
|
|
4131
5374
|
}
|
|
4132
5375
|
}
|
|
4133
5376
|
function TextInput(props) {
|
|
4134
5377
|
const _a = props, { control, displayFormat, onChange } = _a, commonProps = __objRest(_a, ["control", "displayFormat", "onChange"]);
|
|
4135
5378
|
const InputWithPattern = control === "textarea" ? TextareaWithDisplayFormat : InputWithDisplayFormat;
|
|
4136
|
-
const InputWithoutPattern = control === "textarea" ? TextArea :
|
|
4137
|
-
return displayFormat ? /* @__PURE__ */
|
|
5379
|
+
const InputWithoutPattern = control === "textarea" ? TextArea : Input6;
|
|
5380
|
+
return displayFormat ? /* @__PURE__ */ jsx93(InputWithPattern, __spreadProps(__spreadValues({ displayPattern: displayFormat }, commonProps), { onChange })) : /* @__PURE__ */ jsx93(InputWithoutPattern, __spreadProps(__spreadValues({}, commonProps), { onChange: (e) => onChange(e.target.value) }));
|
|
4138
5381
|
}
|
|
4139
5382
|
|
|
4140
5383
|
// ../renderers/src/TextInputRenderer.tsx
|
|
4141
|
-
import { jsx as
|
|
5384
|
+
import { jsx as jsx94 } from "react/jsx-runtime";
|
|
4142
5385
|
var TextInputRenderer = {
|
|
4143
5386
|
canRenderType: "input-text",
|
|
4144
5387
|
render: (props) => {
|
|
@@ -4171,7 +5414,7 @@ var TextInputRenderer = {
|
|
|
4171
5414
|
}
|
|
4172
5415
|
}
|
|
4173
5416
|
});
|
|
4174
|
-
return /* @__PURE__ */
|
|
5417
|
+
return /* @__PURE__ */ jsx94(
|
|
4175
5418
|
FieldInput_default,
|
|
4176
5419
|
{
|
|
4177
5420
|
id,
|
|
@@ -4182,7 +5425,7 @@ var TextInputRenderer = {
|
|
|
4182
5425
|
loadingState: props.fieldLoadingState,
|
|
4183
5426
|
help,
|
|
4184
5427
|
features: props.features,
|
|
4185
|
-
children: /* @__PURE__ */
|
|
5428
|
+
children: /* @__PURE__ */ jsx94(InputGroup5, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ jsx94(VariableTextInput, __spreadValues({}, inputProps)) })
|
|
4186
5429
|
}
|
|
4187
5430
|
);
|
|
4188
5431
|
}
|
|
@@ -4196,7 +5439,7 @@ import { Status as Status2, Upload, UploadInput as UploadInput2 } from "@transfe
|
|
|
4196
5439
|
var getRandomId = () => Math.random().toString(36).substring(2);
|
|
4197
5440
|
|
|
4198
5441
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
4199
|
-
import { jsx as
|
|
5442
|
+
import { jsx as jsx95 } from "react/jsx-runtime";
|
|
4200
5443
|
var UploadInputRenderer = {
|
|
4201
5444
|
canRenderType: "input-upload",
|
|
4202
5445
|
render: (props) => {
|
|
@@ -4223,7 +5466,7 @@ var UploadInputRenderer = {
|
|
|
4223
5466
|
};
|
|
4224
5467
|
return (
|
|
4225
5468
|
// We don't pass help here as there is no sensible place to display it
|
|
4226
|
-
/* @__PURE__ */
|
|
5469
|
+
/* @__PURE__ */ jsx95(
|
|
4227
5470
|
UploadFieldInput_default,
|
|
4228
5471
|
{
|
|
4229
5472
|
id,
|
|
@@ -4231,7 +5474,7 @@ var UploadInputRenderer = {
|
|
|
4231
5474
|
description: void 0,
|
|
4232
5475
|
validation: validationState,
|
|
4233
5476
|
features,
|
|
4234
|
-
children: /* @__PURE__ */
|
|
5477
|
+
children: /* @__PURE__ */ jsx95(
|
|
4235
5478
|
UploadInput2,
|
|
4236
5479
|
{
|
|
4237
5480
|
id,
|
|
@@ -4299,7 +5542,7 @@ var LargeUploadRenderer = {
|
|
|
4299
5542
|
};
|
|
4300
5543
|
const filetypes = acceptsToFileTypes(accepts);
|
|
4301
5544
|
const usAccept = filetypes === "*" ? "*" : filetypes.join(",");
|
|
4302
|
-
return /* @__PURE__ */
|
|
5545
|
+
return /* @__PURE__ */ jsx95(
|
|
4303
5546
|
FieldInput_default,
|
|
4304
5547
|
{
|
|
4305
5548
|
id,
|
|
@@ -4308,7 +5551,7 @@ var LargeUploadRenderer = {
|
|
|
4308
5551
|
validation: validationState,
|
|
4309
5552
|
help,
|
|
4310
5553
|
features,
|
|
4311
|
-
children: /* @__PURE__ */
|
|
5554
|
+
children: /* @__PURE__ */ jsx95(
|
|
4312
5555
|
Upload,
|
|
4313
5556
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
4314
5557
|
usAccept,
|
|
@@ -4325,16 +5568,16 @@ var LargeUploadRenderer = {
|
|
|
4325
5568
|
|
|
4326
5569
|
// ../renderers/src/UpsellRenderer.tsx
|
|
4327
5570
|
import { Nudge } from "@transferwise/components";
|
|
4328
|
-
import { useState as
|
|
4329
|
-
import { jsx as
|
|
5571
|
+
import { useState as useState16 } from "react";
|
|
5572
|
+
import { jsx as jsx96 } from "react/jsx-runtime";
|
|
4330
5573
|
var UpsellRenderer = {
|
|
4331
5574
|
canRenderType: "upsell",
|
|
4332
5575
|
render: UpsellRendererComponent
|
|
4333
5576
|
};
|
|
4334
5577
|
function UpsellRendererComponent(props) {
|
|
4335
5578
|
const { text, callToAction, media, margin, onDismiss } = props;
|
|
4336
|
-
const [isVisible, setIsVisible] =
|
|
4337
|
-
return isVisible ? /* @__PURE__ */
|
|
5579
|
+
const [isVisible, setIsVisible] = useState16(true);
|
|
5580
|
+
return isVisible ? /* @__PURE__ */ jsx96(
|
|
4338
5581
|
Nudge,
|
|
4339
5582
|
{
|
|
4340
5583
|
className: getMargin(margin),
|
|
@@ -4383,7 +5626,7 @@ var supportedMediaNames = [
|
|
|
4383
5626
|
// ../renderers/src/ButtonRenderer/CircularButtonRenderer.tsx
|
|
4384
5627
|
import { CircularButton } from "@transferwise/components";
|
|
4385
5628
|
var import_classnames8 = __toESM(require_classnames());
|
|
4386
|
-
import { jsx as
|
|
5629
|
+
import { jsx as jsx97 } from "react/jsx-runtime";
|
|
4387
5630
|
var CircularButtonRenderer = {
|
|
4388
5631
|
canRenderType: "button",
|
|
4389
5632
|
canRender: ({ control }) => control === "circular",
|
|
@@ -4393,7 +5636,7 @@ function CircularButtonComponent(props) {
|
|
|
4393
5636
|
var _a;
|
|
4394
5637
|
const { context, disabled, margin, media, tags, title, onClick } = props;
|
|
4395
5638
|
const priority = tags == null ? void 0 : tags.find((tag) => tag === "primary" || tag === "secondary");
|
|
4396
|
-
return /* @__PURE__ */
|
|
5639
|
+
return /* @__PURE__ */ jsx97("div", { className: (0, import_classnames8.default)(getMargin(margin), "df-button", "circular"), children: /* @__PURE__ */ jsx97(
|
|
4397
5640
|
CircularButton,
|
|
4398
5641
|
{
|
|
4399
5642
|
disabled,
|
|
@@ -4413,6 +5656,7 @@ var getWiseRenderers = () => [
|
|
|
4413
5656
|
CheckboxInputRenderer_default,
|
|
4414
5657
|
CircularButtonRenderer,
|
|
4415
5658
|
BoxRenderer_default,
|
|
5659
|
+
CollectionRenderer_default,
|
|
4416
5660
|
ButtonRenderer,
|
|
4417
5661
|
ColumnsRenderer_default,
|
|
4418
5662
|
DateInputRenderer_default,
|
|
@@ -4457,11 +5701,11 @@ var getWiseRenderers = () => [
|
|
|
4457
5701
|
|
|
4458
5702
|
// ../renderers/src/InitialLoadingStateRenderer.tsx
|
|
4459
5703
|
import { Loader as Loader2 } from "@transferwise/components";
|
|
4460
|
-
import { jsx as
|
|
5704
|
+
import { jsx as jsx98 } from "react/jsx-runtime";
|
|
4461
5705
|
var InitialLoadingStateRenderer = {
|
|
4462
5706
|
canRenderType: "loading-state",
|
|
4463
5707
|
canRender: ({ stepLoadingState }) => stepLoadingState === "initial",
|
|
4464
|
-
render: () => /* @__PURE__ */
|
|
5708
|
+
render: () => /* @__PURE__ */ jsx98(
|
|
4465
5709
|
Loader2,
|
|
4466
5710
|
{
|
|
4467
5711
|
size: "md",
|
|
@@ -4474,24 +5718,24 @@ var InitialLoadingStateRenderer = {
|
|
|
4474
5718
|
// src/dynamicFlow/DynamicFlowModal.tsx
|
|
4475
5719
|
import { useDynamicFlowModal } from "@wise/dynamic-flow-client";
|
|
4476
5720
|
import { Modal as Modal5 } from "@transferwise/components";
|
|
4477
|
-
import { jsx as
|
|
5721
|
+
import { jsx as jsx99 } from "react/jsx-runtime";
|
|
4478
5722
|
function DynamicFlowModal(props) {
|
|
4479
5723
|
const _a = props, { className = "" } = _a, rest = __objRest(_a, ["className"]);
|
|
4480
5724
|
const dfProps = useWiseToCoreProps(rest);
|
|
4481
5725
|
const df = useDynamicFlowModal(dfProps);
|
|
4482
|
-
return /* @__PURE__ */
|
|
5726
|
+
return /* @__PURE__ */ jsx99(
|
|
4483
5727
|
Modal5,
|
|
4484
5728
|
__spreadProps(__spreadValues({
|
|
4485
5729
|
className: `dynamic-flow-modal ${className}`,
|
|
4486
5730
|
disableDimmerClickToClose: true
|
|
4487
5731
|
}, df.modal), {
|
|
4488
|
-
body: /* @__PURE__ */
|
|
5732
|
+
body: /* @__PURE__ */ jsx99("div", { className: "dynamic-flow-modal", children: df.modal.body })
|
|
4489
5733
|
})
|
|
4490
5734
|
);
|
|
4491
5735
|
}
|
|
4492
5736
|
|
|
4493
5737
|
// src/dynamicFlow/getMergedRenderers.tsx
|
|
4494
|
-
import { jsx as
|
|
5738
|
+
import { jsx as jsx100 } from "react/jsx-runtime";
|
|
4495
5739
|
var wiseRenderers = getWiseRenderers();
|
|
4496
5740
|
var getMergedRenderers = (props) => {
|
|
4497
5741
|
var _d, _e;
|
|
@@ -4505,7 +5749,7 @@ var getMergedRenderers = (props) => {
|
|
|
4505
5749
|
method: initialRequest.method,
|
|
4506
5750
|
data: initialRequest.body
|
|
4507
5751
|
};
|
|
4508
|
-
return presentation.type === "push" ? /* @__PURE__ */
|
|
5752
|
+
return presentation.type === "push" ? /* @__PURE__ */ jsx100(DynamicFlow, __spreadProps(__spreadValues(__spreadValues({}, restProps), rest), { features: subflowFeatures, initialAction: action })) : /* @__PURE__ */ jsx100(
|
|
4509
5753
|
DynamicFlowModal,
|
|
4510
5754
|
__spreadProps(__spreadValues(__spreadValues({}, restProps), rest), {
|
|
4511
5755
|
features: subflowFeatures,
|
|
@@ -4664,10 +5908,10 @@ var useWiseToCoreProps = (props) => {
|
|
|
4664
5908
|
onLog
|
|
4665
5909
|
} = props;
|
|
4666
5910
|
const httpClient = useWiseHttpClient(customFetch);
|
|
4667
|
-
const mergedRenderers =
|
|
5911
|
+
const mergedRenderers = useMemo3(() => getMergedRenderers(props), [renderers]);
|
|
4668
5912
|
const createSnackBar = useCreateSnackBar();
|
|
4669
|
-
const logEvent =
|
|
4670
|
-
const trackEvent =
|
|
5913
|
+
const logEvent = useMemo3(() => getLogEvent(onLog), [onLog]);
|
|
5914
|
+
const trackEvent = useMemo3(() => getTrackEvent(onEvent, onAnalytics), [onEvent, onAnalytics]);
|
|
4671
5915
|
const onCopy = useOnCopy();
|
|
4672
5916
|
return __spreadProps(__spreadValues({}, props), {
|
|
4673
5917
|
httpClient,
|
|
@@ -4699,13 +5943,13 @@ var openLinkInNewTab = (url) => {
|
|
|
4699
5943
|
};
|
|
4700
5944
|
|
|
4701
5945
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
4702
|
-
import { jsxs as
|
|
5946
|
+
import { jsxs as jsxs38 } from "react/jsx-runtime";
|
|
4703
5947
|
function DynamicFlow(props) {
|
|
4704
5948
|
const { className = "" } = props;
|
|
4705
5949
|
const dfProps = useWiseToCoreProps(props);
|
|
4706
5950
|
const df = useDynamicFlow(dfProps);
|
|
4707
5951
|
const { onContextMenu, contextMenu } = useDFContextMenu(df.controller);
|
|
4708
|
-
return /* @__PURE__ */
|
|
5952
|
+
return /* @__PURE__ */ jsxs38("div", { className, onContextMenu, children: [
|
|
4709
5953
|
df.view,
|
|
4710
5954
|
contextMenu
|
|
4711
5955
|
] });
|
|
@@ -4717,7 +5961,7 @@ import {
|
|
|
4717
5961
|
useImperativeHandle
|
|
4718
5962
|
} from "react";
|
|
4719
5963
|
import { useDynamicFlow as useDynamicFlow2 } from "@wise/dynamic-flow-client";
|
|
4720
|
-
import { jsx as
|
|
5964
|
+
import { jsx as jsx101 } from "react/jsx-runtime";
|
|
4721
5965
|
var DynamicFlowWithRef = forwardRef(function DynamicFlowWithRef2(props, ref) {
|
|
4722
5966
|
const { className = "" } = props;
|
|
4723
5967
|
const dfProps = useWiseToCoreProps(props);
|
|
@@ -4733,14 +5977,14 @@ var DynamicFlowWithRef = forwardRef(function DynamicFlowWithRef2(props, ref) {
|
|
|
4733
5977
|
}),
|
|
4734
5978
|
[df]
|
|
4735
5979
|
);
|
|
4736
|
-
return /* @__PURE__ */
|
|
5980
|
+
return /* @__PURE__ */ jsx101("div", { className, children: df.view });
|
|
4737
5981
|
});
|
|
4738
5982
|
|
|
4739
5983
|
// src/index.ts
|
|
4740
5984
|
import { findRendererPropsByType } from "@wise/dynamic-flow-client";
|
|
4741
5985
|
|
|
4742
5986
|
// src/dynamicFlow/renderers.tsx
|
|
4743
|
-
var Header10 =
|
|
5987
|
+
var Header10 = Header;
|
|
4744
5988
|
var Media2 = Media;
|
|
4745
5989
|
var getMargin2 = getMargin;
|
|
4746
5990
|
|