@wise/dynamic-flow-client-internal 5.21.3 → 5.23.0-experimental-2dcb025
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/main.js +1915 -670
- package/build/main.mjs +1810 -565
- package/build/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +5 -5
package/build/main.mjs
CHANGED
|
@@ -127,7 +127,7 @@ import { useDynamicFlow } from "@wise/dynamic-flow-client";
|
|
|
127
127
|
// src/dynamicFlow/telemetry/app-version.ts
|
|
128
128
|
var appVersion = (
|
|
129
129
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
130
|
-
typeof process !== "undefined" ? "5.
|
|
130
|
+
typeof process !== "undefined" ? "5.22.0" : "0.0.0"
|
|
131
131
|
);
|
|
132
132
|
|
|
133
133
|
// src/dynamicFlow/context-menu/useContextMenu.tsx
|
|
@@ -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";
|
|
@@ -1101,12 +1101,1383 @@ var getInlineAlertOrValidation = (validationState, inlineAlert) => {
|
|
|
1101
1101
|
};
|
|
1102
1102
|
var CheckboxInputRenderer_default = CheckboxInputRenderer;
|
|
1103
1103
|
|
|
1104
|
+
// ../renderers/src/CollectionRenderer/CollectionRenderer.tsx
|
|
1105
|
+
import { InlinePrompt, Link as DSLink } from "@transferwise/components";
|
|
1106
|
+
|
|
1107
|
+
// ../../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
|
|
1108
|
+
import * as React from "react";
|
|
1109
|
+
import { flushSync } from "react-dom";
|
|
1110
|
+
|
|
1111
|
+
// ../../node_modules/.pnpm/@tanstack+virtual-core@3.14.0/node_modules/@tanstack/virtual-core/dist/esm/utils.js
|
|
1112
|
+
function memo(getDeps, fn, opts) {
|
|
1113
|
+
var _a;
|
|
1114
|
+
let deps = (_a = opts.initialDeps) != null ? _a : [];
|
|
1115
|
+
let result;
|
|
1116
|
+
let isInitial = true;
|
|
1117
|
+
function memoizedFunction() {
|
|
1118
|
+
var _a2, _b, _c;
|
|
1119
|
+
let depTime;
|
|
1120
|
+
if (opts.key && ((_a2 = opts.debug) == null ? void 0 : _a2.call(opts))) depTime = Date.now();
|
|
1121
|
+
const newDeps = getDeps();
|
|
1122
|
+
const depsChanged = newDeps.length !== deps.length || newDeps.some((dep, index) => deps[index] !== dep);
|
|
1123
|
+
if (!depsChanged) {
|
|
1124
|
+
return result;
|
|
1125
|
+
}
|
|
1126
|
+
deps = newDeps;
|
|
1127
|
+
let resultTime;
|
|
1128
|
+
if (opts.key && ((_b = opts.debug) == null ? void 0 : _b.call(opts))) resultTime = Date.now();
|
|
1129
|
+
result = fn(...newDeps);
|
|
1130
|
+
if (opts.key && ((_c = opts.debug) == null ? void 0 : _c.call(opts))) {
|
|
1131
|
+
const depEndTime = Math.round((Date.now() - depTime) * 100) / 100;
|
|
1132
|
+
const resultEndTime = Math.round((Date.now() - resultTime) * 100) / 100;
|
|
1133
|
+
const resultFpsPercentage = resultEndTime / 16;
|
|
1134
|
+
const pad = (str, num) => {
|
|
1135
|
+
str = String(str);
|
|
1136
|
+
while (str.length < num) {
|
|
1137
|
+
str = " " + str;
|
|
1138
|
+
}
|
|
1139
|
+
return str;
|
|
1140
|
+
};
|
|
1141
|
+
console.info(
|
|
1142
|
+
`%c\u23F1 ${pad(resultEndTime, 5)} /${pad(depEndTime, 5)} ms`,
|
|
1143
|
+
`
|
|
1144
|
+
font-size: .6rem;
|
|
1145
|
+
font-weight: bold;
|
|
1146
|
+
color: hsl(${Math.max(
|
|
1147
|
+
0,
|
|
1148
|
+
Math.min(120 - 120 * resultFpsPercentage, 120)
|
|
1149
|
+
)}deg 100% 31%);`,
|
|
1150
|
+
opts == null ? void 0 : opts.key
|
|
1151
|
+
);
|
|
1152
|
+
}
|
|
1153
|
+
if ((opts == null ? void 0 : opts.onChange) && !(isInitial && opts.skipInitialOnChange)) {
|
|
1154
|
+
opts.onChange(result);
|
|
1155
|
+
}
|
|
1156
|
+
isInitial = false;
|
|
1157
|
+
return result;
|
|
1158
|
+
}
|
|
1159
|
+
memoizedFunction.updateDeps = (newDeps) => {
|
|
1160
|
+
deps = newDeps;
|
|
1161
|
+
};
|
|
1162
|
+
return memoizedFunction;
|
|
1163
|
+
}
|
|
1164
|
+
function notUndefined(value, msg) {
|
|
1165
|
+
if (value === void 0) {
|
|
1166
|
+
throw new Error(`Unexpected undefined${msg ? `: ${msg}` : ""}`);
|
|
1167
|
+
} else {
|
|
1168
|
+
return value;
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
var approxEqual = (a, b) => Math.abs(a - b) < 1.01;
|
|
1172
|
+
var debounce = (targetWindow, fn, ms) => {
|
|
1173
|
+
let timeoutId;
|
|
1174
|
+
return function(...args) {
|
|
1175
|
+
targetWindow.clearTimeout(timeoutId);
|
|
1176
|
+
timeoutId = targetWindow.setTimeout(() => fn.apply(this, args), ms);
|
|
1177
|
+
};
|
|
1178
|
+
};
|
|
1179
|
+
|
|
1180
|
+
// ../../node_modules/.pnpm/@tanstack+virtual-core@3.14.0/node_modules/@tanstack/virtual-core/dist/esm/index.js
|
|
1181
|
+
var defaultKeyExtractor = (index) => index;
|
|
1182
|
+
var defaultRangeExtractor = (range) => {
|
|
1183
|
+
const start = Math.max(range.startIndex - range.overscan, 0);
|
|
1184
|
+
const end = Math.min(range.endIndex + range.overscan, range.count - 1);
|
|
1185
|
+
const arr = [];
|
|
1186
|
+
for (let i = start; i <= end; i++) {
|
|
1187
|
+
arr.push(i);
|
|
1188
|
+
}
|
|
1189
|
+
return arr;
|
|
1190
|
+
};
|
|
1191
|
+
var addEventListenerOptions = {
|
|
1192
|
+
passive: true
|
|
1193
|
+
};
|
|
1194
|
+
var observeWindowRect = (instance, cb) => {
|
|
1195
|
+
const element = instance.scrollElement;
|
|
1196
|
+
if (!element) {
|
|
1197
|
+
return;
|
|
1198
|
+
}
|
|
1199
|
+
const handler = () => {
|
|
1200
|
+
cb({ width: element.innerWidth, height: element.innerHeight });
|
|
1201
|
+
};
|
|
1202
|
+
handler();
|
|
1203
|
+
element.addEventListener("resize", handler, addEventListenerOptions);
|
|
1204
|
+
return () => {
|
|
1205
|
+
element.removeEventListener("resize", handler);
|
|
1206
|
+
};
|
|
1207
|
+
};
|
|
1208
|
+
var supportsScrollend = typeof window == "undefined" ? true : "onscrollend" in window;
|
|
1209
|
+
var observeWindowOffset = (instance, cb) => {
|
|
1210
|
+
const element = instance.scrollElement;
|
|
1211
|
+
if (!element) {
|
|
1212
|
+
return;
|
|
1213
|
+
}
|
|
1214
|
+
const targetWindow = instance.targetWindow;
|
|
1215
|
+
if (!targetWindow) {
|
|
1216
|
+
return;
|
|
1217
|
+
}
|
|
1218
|
+
let offset = 0;
|
|
1219
|
+
const fallback = instance.options.useScrollendEvent && supportsScrollend ? () => void 0 : debounce(
|
|
1220
|
+
targetWindow,
|
|
1221
|
+
() => {
|
|
1222
|
+
cb(offset, false);
|
|
1223
|
+
},
|
|
1224
|
+
instance.options.isScrollingResetDelay
|
|
1225
|
+
);
|
|
1226
|
+
const createHandler = (isScrolling) => () => {
|
|
1227
|
+
offset = element[instance.options.horizontal ? "scrollX" : "scrollY"];
|
|
1228
|
+
fallback();
|
|
1229
|
+
cb(offset, isScrolling);
|
|
1230
|
+
};
|
|
1231
|
+
const handler = createHandler(true);
|
|
1232
|
+
const endHandler = createHandler(false);
|
|
1233
|
+
element.addEventListener("scroll", handler, addEventListenerOptions);
|
|
1234
|
+
const registerScrollendEvent = instance.options.useScrollendEvent && supportsScrollend;
|
|
1235
|
+
if (registerScrollendEvent) {
|
|
1236
|
+
element.addEventListener("scrollend", endHandler, addEventListenerOptions);
|
|
1237
|
+
}
|
|
1238
|
+
return () => {
|
|
1239
|
+
element.removeEventListener("scroll", handler);
|
|
1240
|
+
if (registerScrollendEvent) {
|
|
1241
|
+
element.removeEventListener("scrollend", endHandler);
|
|
1242
|
+
}
|
|
1243
|
+
};
|
|
1244
|
+
};
|
|
1245
|
+
var measureElement = (element, entry, instance) => {
|
|
1246
|
+
if (entry == null ? void 0 : entry.borderBoxSize) {
|
|
1247
|
+
const box = entry.borderBoxSize[0];
|
|
1248
|
+
if (box) {
|
|
1249
|
+
const size = Math.round(
|
|
1250
|
+
box[instance.options.horizontal ? "inlineSize" : "blockSize"]
|
|
1251
|
+
);
|
|
1252
|
+
return size;
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
return element[instance.options.horizontal ? "offsetWidth" : "offsetHeight"];
|
|
1256
|
+
};
|
|
1257
|
+
var windowScroll = (offset, {
|
|
1258
|
+
adjustments = 0,
|
|
1259
|
+
behavior
|
|
1260
|
+
}, instance) => {
|
|
1261
|
+
var _a, _b;
|
|
1262
|
+
const toOffset = offset + adjustments;
|
|
1263
|
+
(_b = (_a = instance.scrollElement) == null ? void 0 : _a.scrollTo) == null ? void 0 : _b.call(_a, {
|
|
1264
|
+
[instance.options.horizontal ? "left" : "top"]: toOffset,
|
|
1265
|
+
behavior
|
|
1266
|
+
});
|
|
1267
|
+
};
|
|
1268
|
+
var Virtualizer = class {
|
|
1269
|
+
constructor(opts) {
|
|
1270
|
+
this.unsubs = [];
|
|
1271
|
+
this.scrollElement = null;
|
|
1272
|
+
this.targetWindow = null;
|
|
1273
|
+
this.isScrolling = false;
|
|
1274
|
+
this.scrollState = null;
|
|
1275
|
+
this.measurementsCache = [];
|
|
1276
|
+
this.itemSizeCache = /* @__PURE__ */ new Map();
|
|
1277
|
+
this.laneAssignments = /* @__PURE__ */ new Map();
|
|
1278
|
+
this.pendingMeasuredCacheIndexes = [];
|
|
1279
|
+
this.prevLanes = void 0;
|
|
1280
|
+
this.lanesChangedFlag = false;
|
|
1281
|
+
this.lanesSettling = false;
|
|
1282
|
+
this.scrollRect = null;
|
|
1283
|
+
this.scrollOffset = null;
|
|
1284
|
+
this.scrollDirection = null;
|
|
1285
|
+
this.scrollAdjustments = 0;
|
|
1286
|
+
this.elementsCache = /* @__PURE__ */ new Map();
|
|
1287
|
+
this.now = () => {
|
|
1288
|
+
var _a2;
|
|
1289
|
+
var _a, _b, _c;
|
|
1290
|
+
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();
|
|
1291
|
+
};
|
|
1292
|
+
this.observer = /* @__PURE__ */ (() => {
|
|
1293
|
+
let _ro = null;
|
|
1294
|
+
const get = () => {
|
|
1295
|
+
if (_ro) {
|
|
1296
|
+
return _ro;
|
|
1297
|
+
}
|
|
1298
|
+
if (!this.targetWindow || !this.targetWindow.ResizeObserver) {
|
|
1299
|
+
return null;
|
|
1300
|
+
}
|
|
1301
|
+
return _ro = new this.targetWindow.ResizeObserver((entries) => {
|
|
1302
|
+
entries.forEach((entry) => {
|
|
1303
|
+
const run = () => {
|
|
1304
|
+
const node = entry.target;
|
|
1305
|
+
const index = this.indexFromElement(node);
|
|
1306
|
+
if (!node.isConnected) {
|
|
1307
|
+
this.observer.unobserve(node);
|
|
1308
|
+
return;
|
|
1309
|
+
}
|
|
1310
|
+
if (this.shouldMeasureDuringScroll(index)) {
|
|
1311
|
+
this.resizeItem(
|
|
1312
|
+
index,
|
|
1313
|
+
this.options.measureElement(node, entry, this)
|
|
1314
|
+
);
|
|
1315
|
+
}
|
|
1316
|
+
};
|
|
1317
|
+
this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(run) : run();
|
|
1318
|
+
});
|
|
1319
|
+
});
|
|
1320
|
+
};
|
|
1321
|
+
return {
|
|
1322
|
+
disconnect: () => {
|
|
1323
|
+
var _a;
|
|
1324
|
+
(_a = get()) == null ? void 0 : _a.disconnect();
|
|
1325
|
+
_ro = null;
|
|
1326
|
+
},
|
|
1327
|
+
observe: (target) => {
|
|
1328
|
+
var _a;
|
|
1329
|
+
return (_a = get()) == null ? void 0 : _a.observe(target, { box: "border-box" });
|
|
1330
|
+
},
|
|
1331
|
+
unobserve: (target) => {
|
|
1332
|
+
var _a;
|
|
1333
|
+
return (_a = get()) == null ? void 0 : _a.unobserve(target);
|
|
1334
|
+
}
|
|
1335
|
+
};
|
|
1336
|
+
})();
|
|
1337
|
+
this.range = null;
|
|
1338
|
+
this.setOptions = (opts2) => {
|
|
1339
|
+
Object.entries(opts2).forEach(([key, value]) => {
|
|
1340
|
+
if (typeof value === "undefined") delete opts2[key];
|
|
1341
|
+
});
|
|
1342
|
+
this.options = __spreadValues({
|
|
1343
|
+
debug: false,
|
|
1344
|
+
initialOffset: 0,
|
|
1345
|
+
overscan: 1,
|
|
1346
|
+
paddingStart: 0,
|
|
1347
|
+
paddingEnd: 0,
|
|
1348
|
+
scrollPaddingStart: 0,
|
|
1349
|
+
scrollPaddingEnd: 0,
|
|
1350
|
+
horizontal: false,
|
|
1351
|
+
getItemKey: defaultKeyExtractor,
|
|
1352
|
+
rangeExtractor: defaultRangeExtractor,
|
|
1353
|
+
onChange: () => {
|
|
1354
|
+
},
|
|
1355
|
+
measureElement,
|
|
1356
|
+
initialRect: { width: 0, height: 0 },
|
|
1357
|
+
scrollMargin: 0,
|
|
1358
|
+
gap: 0,
|
|
1359
|
+
indexAttribute: "data-index",
|
|
1360
|
+
initialMeasurementsCache: [],
|
|
1361
|
+
lanes: 1,
|
|
1362
|
+
isScrollingResetDelay: 150,
|
|
1363
|
+
enabled: true,
|
|
1364
|
+
isRtl: false,
|
|
1365
|
+
useScrollendEvent: false,
|
|
1366
|
+
useAnimationFrameWithResizeObserver: false,
|
|
1367
|
+
laneAssignmentMode: "estimate"
|
|
1368
|
+
}, opts2);
|
|
1369
|
+
};
|
|
1370
|
+
this.notify = (sync) => {
|
|
1371
|
+
var _a, _b;
|
|
1372
|
+
(_b = (_a = this.options).onChange) == null ? void 0 : _b.call(_a, this, sync);
|
|
1373
|
+
};
|
|
1374
|
+
this.maybeNotify = memo(
|
|
1375
|
+
() => {
|
|
1376
|
+
this.calculateRange();
|
|
1377
|
+
return [
|
|
1378
|
+
this.isScrolling,
|
|
1379
|
+
this.range ? this.range.startIndex : null,
|
|
1380
|
+
this.range ? this.range.endIndex : null
|
|
1381
|
+
];
|
|
1382
|
+
},
|
|
1383
|
+
(isScrolling) => {
|
|
1384
|
+
this.notify(isScrolling);
|
|
1385
|
+
},
|
|
1386
|
+
{
|
|
1387
|
+
key: "maybeNotify",
|
|
1388
|
+
debug: () => this.options.debug,
|
|
1389
|
+
initialDeps: [
|
|
1390
|
+
this.isScrolling,
|
|
1391
|
+
this.range ? this.range.startIndex : null,
|
|
1392
|
+
this.range ? this.range.endIndex : null
|
|
1393
|
+
]
|
|
1394
|
+
}
|
|
1395
|
+
);
|
|
1396
|
+
this.cleanup = () => {
|
|
1397
|
+
this.unsubs.filter(Boolean).forEach((d) => d());
|
|
1398
|
+
this.unsubs = [];
|
|
1399
|
+
this.observer.disconnect();
|
|
1400
|
+
if (this.rafId != null && this.targetWindow) {
|
|
1401
|
+
this.targetWindow.cancelAnimationFrame(this.rafId);
|
|
1402
|
+
this.rafId = null;
|
|
1403
|
+
}
|
|
1404
|
+
this.scrollState = null;
|
|
1405
|
+
this.scrollElement = null;
|
|
1406
|
+
this.targetWindow = null;
|
|
1407
|
+
};
|
|
1408
|
+
this._didMount = () => {
|
|
1409
|
+
return () => {
|
|
1410
|
+
this.cleanup();
|
|
1411
|
+
};
|
|
1412
|
+
};
|
|
1413
|
+
this._willUpdate = () => {
|
|
1414
|
+
var _a2;
|
|
1415
|
+
var _a;
|
|
1416
|
+
const scrollElement = this.options.enabled ? this.options.getScrollElement() : null;
|
|
1417
|
+
if (this.scrollElement !== scrollElement) {
|
|
1418
|
+
this.cleanup();
|
|
1419
|
+
if (!scrollElement) {
|
|
1420
|
+
this.maybeNotify();
|
|
1421
|
+
return;
|
|
1422
|
+
}
|
|
1423
|
+
this.scrollElement = scrollElement;
|
|
1424
|
+
if (this.scrollElement && "ownerDocument" in this.scrollElement) {
|
|
1425
|
+
this.targetWindow = this.scrollElement.ownerDocument.defaultView;
|
|
1426
|
+
} else {
|
|
1427
|
+
this.targetWindow = (_a2 = (_a = this.scrollElement) == null ? void 0 : _a.window) != null ? _a2 : null;
|
|
1428
|
+
}
|
|
1429
|
+
this.elementsCache.forEach((cached) => {
|
|
1430
|
+
this.observer.observe(cached);
|
|
1431
|
+
});
|
|
1432
|
+
this.unsubs.push(
|
|
1433
|
+
this.options.observeElementRect(this, (rect) => {
|
|
1434
|
+
this.scrollRect = rect;
|
|
1435
|
+
this.maybeNotify();
|
|
1436
|
+
})
|
|
1437
|
+
);
|
|
1438
|
+
this.unsubs.push(
|
|
1439
|
+
this.options.observeElementOffset(this, (offset, isScrolling) => {
|
|
1440
|
+
this.scrollAdjustments = 0;
|
|
1441
|
+
this.scrollDirection = isScrolling ? this.getScrollOffset() < offset ? "forward" : "backward" : null;
|
|
1442
|
+
this.scrollOffset = offset;
|
|
1443
|
+
this.isScrolling = isScrolling;
|
|
1444
|
+
if (this.scrollState) {
|
|
1445
|
+
this.scheduleScrollReconcile();
|
|
1446
|
+
}
|
|
1447
|
+
this.maybeNotify();
|
|
1448
|
+
})
|
|
1449
|
+
);
|
|
1450
|
+
this._scrollToOffset(this.getScrollOffset(), {
|
|
1451
|
+
adjustments: void 0,
|
|
1452
|
+
behavior: void 0
|
|
1453
|
+
});
|
|
1454
|
+
}
|
|
1455
|
+
};
|
|
1456
|
+
this.rafId = null;
|
|
1457
|
+
this.getSize = () => {
|
|
1458
|
+
var _a;
|
|
1459
|
+
if (!this.options.enabled) {
|
|
1460
|
+
this.scrollRect = null;
|
|
1461
|
+
return 0;
|
|
1462
|
+
}
|
|
1463
|
+
this.scrollRect = (_a = this.scrollRect) != null ? _a : this.options.initialRect;
|
|
1464
|
+
return this.scrollRect[this.options.horizontal ? "width" : "height"];
|
|
1465
|
+
};
|
|
1466
|
+
this.getScrollOffset = () => {
|
|
1467
|
+
var _a;
|
|
1468
|
+
if (!this.options.enabled) {
|
|
1469
|
+
this.scrollOffset = null;
|
|
1470
|
+
return 0;
|
|
1471
|
+
}
|
|
1472
|
+
this.scrollOffset = (_a = this.scrollOffset) != null ? _a : typeof this.options.initialOffset === "function" ? this.options.initialOffset() : this.options.initialOffset;
|
|
1473
|
+
return this.scrollOffset;
|
|
1474
|
+
};
|
|
1475
|
+
this.getFurthestMeasurement = (measurements, index) => {
|
|
1476
|
+
const furthestMeasurementsFound = /* @__PURE__ */ new Map();
|
|
1477
|
+
const furthestMeasurements = /* @__PURE__ */ new Map();
|
|
1478
|
+
for (let m = index - 1; m >= 0; m--) {
|
|
1479
|
+
const measurement = measurements[m];
|
|
1480
|
+
if (furthestMeasurementsFound.has(measurement.lane)) {
|
|
1481
|
+
continue;
|
|
1482
|
+
}
|
|
1483
|
+
const previousFurthestMeasurement = furthestMeasurements.get(
|
|
1484
|
+
measurement.lane
|
|
1485
|
+
);
|
|
1486
|
+
if (previousFurthestMeasurement == null || measurement.end > previousFurthestMeasurement.end) {
|
|
1487
|
+
furthestMeasurements.set(measurement.lane, measurement);
|
|
1488
|
+
} else if (measurement.end < previousFurthestMeasurement.end) {
|
|
1489
|
+
furthestMeasurementsFound.set(measurement.lane, true);
|
|
1490
|
+
}
|
|
1491
|
+
if (furthestMeasurementsFound.size === this.options.lanes) {
|
|
1492
|
+
break;
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1495
|
+
return furthestMeasurements.size === this.options.lanes ? Array.from(furthestMeasurements.values()).sort((a, b) => {
|
|
1496
|
+
if (a.end === b.end) {
|
|
1497
|
+
return a.index - b.index;
|
|
1498
|
+
}
|
|
1499
|
+
return a.end - b.end;
|
|
1500
|
+
})[0] : void 0;
|
|
1501
|
+
};
|
|
1502
|
+
this.getMeasurementOptions = memo(
|
|
1503
|
+
() => [
|
|
1504
|
+
this.options.count,
|
|
1505
|
+
this.options.paddingStart,
|
|
1506
|
+
this.options.scrollMargin,
|
|
1507
|
+
this.options.getItemKey,
|
|
1508
|
+
this.options.enabled,
|
|
1509
|
+
this.options.lanes,
|
|
1510
|
+
this.options.laneAssignmentMode
|
|
1511
|
+
],
|
|
1512
|
+
(count, paddingStart, scrollMargin, getItemKey, enabled, lanes, laneAssignmentMode) => {
|
|
1513
|
+
const lanesChanged = this.prevLanes !== void 0 && this.prevLanes !== lanes;
|
|
1514
|
+
if (lanesChanged) {
|
|
1515
|
+
this.lanesChangedFlag = true;
|
|
1516
|
+
}
|
|
1517
|
+
this.prevLanes = lanes;
|
|
1518
|
+
this.pendingMeasuredCacheIndexes = [];
|
|
1519
|
+
return {
|
|
1520
|
+
count,
|
|
1521
|
+
paddingStart,
|
|
1522
|
+
scrollMargin,
|
|
1523
|
+
getItemKey,
|
|
1524
|
+
enabled,
|
|
1525
|
+
lanes,
|
|
1526
|
+
laneAssignmentMode
|
|
1527
|
+
};
|
|
1528
|
+
},
|
|
1529
|
+
{
|
|
1530
|
+
key: false
|
|
1531
|
+
}
|
|
1532
|
+
);
|
|
1533
|
+
this.getMeasurements = memo(
|
|
1534
|
+
() => [this.getMeasurementOptions(), this.itemSizeCache],
|
|
1535
|
+
({
|
|
1536
|
+
count,
|
|
1537
|
+
paddingStart,
|
|
1538
|
+
scrollMargin,
|
|
1539
|
+
getItemKey,
|
|
1540
|
+
enabled,
|
|
1541
|
+
lanes,
|
|
1542
|
+
laneAssignmentMode
|
|
1543
|
+
}, itemSizeCache) => {
|
|
1544
|
+
if (!enabled) {
|
|
1545
|
+
this.measurementsCache = [];
|
|
1546
|
+
this.itemSizeCache.clear();
|
|
1547
|
+
this.laneAssignments.clear();
|
|
1548
|
+
return [];
|
|
1549
|
+
}
|
|
1550
|
+
if (this.laneAssignments.size > count) {
|
|
1551
|
+
for (const index of this.laneAssignments.keys()) {
|
|
1552
|
+
if (index >= count) {
|
|
1553
|
+
this.laneAssignments.delete(index);
|
|
1554
|
+
}
|
|
1555
|
+
}
|
|
1556
|
+
}
|
|
1557
|
+
if (this.lanesChangedFlag) {
|
|
1558
|
+
this.lanesChangedFlag = false;
|
|
1559
|
+
this.lanesSettling = true;
|
|
1560
|
+
this.measurementsCache = [];
|
|
1561
|
+
this.itemSizeCache.clear();
|
|
1562
|
+
this.laneAssignments.clear();
|
|
1563
|
+
this.pendingMeasuredCacheIndexes = [];
|
|
1564
|
+
}
|
|
1565
|
+
if (this.measurementsCache.length === 0 && !this.lanesSettling) {
|
|
1566
|
+
this.measurementsCache = this.options.initialMeasurementsCache;
|
|
1567
|
+
this.measurementsCache.forEach((item) => {
|
|
1568
|
+
this.itemSizeCache.set(item.key, item.size);
|
|
1569
|
+
});
|
|
1570
|
+
}
|
|
1571
|
+
const min = this.lanesSettling ? 0 : this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
|
|
1572
|
+
this.pendingMeasuredCacheIndexes = [];
|
|
1573
|
+
if (this.lanesSettling && this.measurementsCache.length === count) {
|
|
1574
|
+
this.lanesSettling = false;
|
|
1575
|
+
}
|
|
1576
|
+
const measurements = this.measurementsCache.slice(0, min);
|
|
1577
|
+
const laneLastIndex = new Array(lanes).fill(
|
|
1578
|
+
void 0
|
|
1579
|
+
);
|
|
1580
|
+
for (let m = 0; m < min; m++) {
|
|
1581
|
+
const item = measurements[m];
|
|
1582
|
+
if (item) {
|
|
1583
|
+
laneLastIndex[item.lane] = m;
|
|
1584
|
+
}
|
|
1585
|
+
}
|
|
1586
|
+
for (let i = min; i < count; i++) {
|
|
1587
|
+
const key = getItemKey(i);
|
|
1588
|
+
const cachedLane = this.laneAssignments.get(i);
|
|
1589
|
+
let lane;
|
|
1590
|
+
let start;
|
|
1591
|
+
const shouldCacheLane = laneAssignmentMode === "estimate" || itemSizeCache.has(key);
|
|
1592
|
+
if (cachedLane !== void 0 && this.options.lanes > 1) {
|
|
1593
|
+
lane = cachedLane;
|
|
1594
|
+
const prevIndex = laneLastIndex[lane];
|
|
1595
|
+
const prevInLane = prevIndex !== void 0 ? measurements[prevIndex] : void 0;
|
|
1596
|
+
start = prevInLane ? prevInLane.end + this.options.gap : paddingStart + scrollMargin;
|
|
1597
|
+
} else {
|
|
1598
|
+
const furthestMeasurement = this.options.lanes === 1 ? measurements[i - 1] : this.getFurthestMeasurement(measurements, i);
|
|
1599
|
+
start = furthestMeasurement ? furthestMeasurement.end + this.options.gap : paddingStart + scrollMargin;
|
|
1600
|
+
lane = furthestMeasurement ? furthestMeasurement.lane : i % this.options.lanes;
|
|
1601
|
+
if (this.options.lanes > 1 && shouldCacheLane) {
|
|
1602
|
+
this.laneAssignments.set(i, lane);
|
|
1603
|
+
}
|
|
1604
|
+
}
|
|
1605
|
+
const measuredSize = itemSizeCache.get(key);
|
|
1606
|
+
const size = typeof measuredSize === "number" ? measuredSize : this.options.estimateSize(i);
|
|
1607
|
+
const end = start + size;
|
|
1608
|
+
measurements[i] = {
|
|
1609
|
+
index: i,
|
|
1610
|
+
start,
|
|
1611
|
+
size,
|
|
1612
|
+
end,
|
|
1613
|
+
key,
|
|
1614
|
+
lane
|
|
1615
|
+
};
|
|
1616
|
+
laneLastIndex[lane] = i;
|
|
1617
|
+
}
|
|
1618
|
+
this.measurementsCache = measurements;
|
|
1619
|
+
return measurements;
|
|
1620
|
+
},
|
|
1621
|
+
{
|
|
1622
|
+
key: "getMeasurements",
|
|
1623
|
+
debug: () => this.options.debug
|
|
1624
|
+
}
|
|
1625
|
+
);
|
|
1626
|
+
this.calculateRange = memo(
|
|
1627
|
+
() => [
|
|
1628
|
+
this.getMeasurements(),
|
|
1629
|
+
this.getSize(),
|
|
1630
|
+
this.getScrollOffset(),
|
|
1631
|
+
this.options.lanes
|
|
1632
|
+
],
|
|
1633
|
+
(measurements, outerSize, scrollOffset, lanes) => {
|
|
1634
|
+
return this.range = measurements.length > 0 && outerSize > 0 ? calculateRange({
|
|
1635
|
+
measurements,
|
|
1636
|
+
outerSize,
|
|
1637
|
+
scrollOffset,
|
|
1638
|
+
lanes
|
|
1639
|
+
}) : null;
|
|
1640
|
+
},
|
|
1641
|
+
{
|
|
1642
|
+
key: "calculateRange",
|
|
1643
|
+
debug: () => this.options.debug
|
|
1644
|
+
}
|
|
1645
|
+
);
|
|
1646
|
+
this.getVirtualIndexes = memo(
|
|
1647
|
+
() => {
|
|
1648
|
+
let startIndex = null;
|
|
1649
|
+
let endIndex = null;
|
|
1650
|
+
const range = this.calculateRange();
|
|
1651
|
+
if (range) {
|
|
1652
|
+
startIndex = range.startIndex;
|
|
1653
|
+
endIndex = range.endIndex;
|
|
1654
|
+
}
|
|
1655
|
+
this.maybeNotify.updateDeps([this.isScrolling, startIndex, endIndex]);
|
|
1656
|
+
return [
|
|
1657
|
+
this.options.rangeExtractor,
|
|
1658
|
+
this.options.overscan,
|
|
1659
|
+
this.options.count,
|
|
1660
|
+
startIndex,
|
|
1661
|
+
endIndex
|
|
1662
|
+
];
|
|
1663
|
+
},
|
|
1664
|
+
(rangeExtractor, overscan, count, startIndex, endIndex) => {
|
|
1665
|
+
return startIndex === null || endIndex === null ? [] : rangeExtractor({
|
|
1666
|
+
startIndex,
|
|
1667
|
+
endIndex,
|
|
1668
|
+
overscan,
|
|
1669
|
+
count
|
|
1670
|
+
});
|
|
1671
|
+
},
|
|
1672
|
+
{
|
|
1673
|
+
key: "getVirtualIndexes",
|
|
1674
|
+
debug: () => this.options.debug
|
|
1675
|
+
}
|
|
1676
|
+
);
|
|
1677
|
+
this.indexFromElement = (node) => {
|
|
1678
|
+
const attributeName = this.options.indexAttribute;
|
|
1679
|
+
const indexStr = node.getAttribute(attributeName);
|
|
1680
|
+
if (!indexStr) {
|
|
1681
|
+
console.warn(
|
|
1682
|
+
`Missing attribute name '${attributeName}={index}' on measured element.`
|
|
1683
|
+
);
|
|
1684
|
+
return -1;
|
|
1685
|
+
}
|
|
1686
|
+
return parseInt(indexStr, 10);
|
|
1687
|
+
};
|
|
1688
|
+
this.shouldMeasureDuringScroll = (index) => {
|
|
1689
|
+
var _a2;
|
|
1690
|
+
var _a;
|
|
1691
|
+
if (!this.scrollState || this.scrollState.behavior !== "smooth") {
|
|
1692
|
+
return true;
|
|
1693
|
+
}
|
|
1694
|
+
const scrollIndex = (_a2 = this.scrollState.index) != null ? _a2 : (_a = this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)) == null ? void 0 : _a.index;
|
|
1695
|
+
if (scrollIndex !== void 0 && this.range) {
|
|
1696
|
+
const bufferSize = Math.max(
|
|
1697
|
+
this.options.overscan,
|
|
1698
|
+
Math.ceil((this.range.endIndex - this.range.startIndex) / 2)
|
|
1699
|
+
);
|
|
1700
|
+
const minIndex = Math.max(0, scrollIndex - bufferSize);
|
|
1701
|
+
const maxIndex = Math.min(
|
|
1702
|
+
this.options.count - 1,
|
|
1703
|
+
scrollIndex + bufferSize
|
|
1704
|
+
);
|
|
1705
|
+
return index >= minIndex && index <= maxIndex;
|
|
1706
|
+
}
|
|
1707
|
+
return true;
|
|
1708
|
+
};
|
|
1709
|
+
this.measureElement = (node) => {
|
|
1710
|
+
if (!node) {
|
|
1711
|
+
this.elementsCache.forEach((cached, key2) => {
|
|
1712
|
+
if (!cached.isConnected) {
|
|
1713
|
+
this.observer.unobserve(cached);
|
|
1714
|
+
this.elementsCache.delete(key2);
|
|
1715
|
+
}
|
|
1716
|
+
});
|
|
1717
|
+
return;
|
|
1718
|
+
}
|
|
1719
|
+
const index = this.indexFromElement(node);
|
|
1720
|
+
const key = this.options.getItemKey(index);
|
|
1721
|
+
const prevNode = this.elementsCache.get(key);
|
|
1722
|
+
if (prevNode !== node) {
|
|
1723
|
+
if (prevNode) {
|
|
1724
|
+
this.observer.unobserve(prevNode);
|
|
1725
|
+
}
|
|
1726
|
+
this.observer.observe(node);
|
|
1727
|
+
this.elementsCache.set(key, node);
|
|
1728
|
+
}
|
|
1729
|
+
if ((!this.isScrolling || this.scrollState) && this.shouldMeasureDuringScroll(index)) {
|
|
1730
|
+
this.resizeItem(index, this.options.measureElement(node, void 0, this));
|
|
1731
|
+
}
|
|
1732
|
+
};
|
|
1733
|
+
this.resizeItem = (index, size) => {
|
|
1734
|
+
var _a2;
|
|
1735
|
+
var _a;
|
|
1736
|
+
const item = this.measurementsCache[index];
|
|
1737
|
+
if (!item) return;
|
|
1738
|
+
const itemSize = (_a2 = this.itemSizeCache.get(item.key)) != null ? _a2 : item.size;
|
|
1739
|
+
const delta = size - itemSize;
|
|
1740
|
+
if (delta !== 0) {
|
|
1741
|
+
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)) {
|
|
1742
|
+
if (this.options.debug) {
|
|
1743
|
+
console.info("correction", delta);
|
|
1744
|
+
}
|
|
1745
|
+
this._scrollToOffset(this.getScrollOffset(), {
|
|
1746
|
+
adjustments: this.scrollAdjustments += delta,
|
|
1747
|
+
behavior: void 0
|
|
1748
|
+
});
|
|
1749
|
+
}
|
|
1750
|
+
this.pendingMeasuredCacheIndexes.push(item.index);
|
|
1751
|
+
this.itemSizeCache = new Map(this.itemSizeCache.set(item.key, size));
|
|
1752
|
+
this.notify(false);
|
|
1753
|
+
}
|
|
1754
|
+
};
|
|
1755
|
+
this.getVirtualItems = memo(
|
|
1756
|
+
() => [this.getVirtualIndexes(), this.getMeasurements()],
|
|
1757
|
+
(indexes, measurements) => {
|
|
1758
|
+
const virtualItems = [];
|
|
1759
|
+
for (let k = 0, len = indexes.length; k < len; k++) {
|
|
1760
|
+
const i = indexes[k];
|
|
1761
|
+
const measurement = measurements[i];
|
|
1762
|
+
virtualItems.push(measurement);
|
|
1763
|
+
}
|
|
1764
|
+
return virtualItems;
|
|
1765
|
+
},
|
|
1766
|
+
{
|
|
1767
|
+
key: "getVirtualItems",
|
|
1768
|
+
debug: () => this.options.debug
|
|
1769
|
+
}
|
|
1770
|
+
);
|
|
1771
|
+
this.getVirtualItemForOffset = (offset) => {
|
|
1772
|
+
const measurements = this.getMeasurements();
|
|
1773
|
+
if (measurements.length === 0) {
|
|
1774
|
+
return void 0;
|
|
1775
|
+
}
|
|
1776
|
+
return notUndefined(
|
|
1777
|
+
measurements[findNearestBinarySearch(
|
|
1778
|
+
0,
|
|
1779
|
+
measurements.length - 1,
|
|
1780
|
+
(index) => notUndefined(measurements[index]).start,
|
|
1781
|
+
offset
|
|
1782
|
+
)]
|
|
1783
|
+
);
|
|
1784
|
+
};
|
|
1785
|
+
this.getMaxScrollOffset = () => {
|
|
1786
|
+
if (!this.scrollElement) return 0;
|
|
1787
|
+
if ("scrollHeight" in this.scrollElement) {
|
|
1788
|
+
return this.options.horizontal ? this.scrollElement.scrollWidth - this.scrollElement.clientWidth : this.scrollElement.scrollHeight - this.scrollElement.clientHeight;
|
|
1789
|
+
} else {
|
|
1790
|
+
const doc = this.scrollElement.document.documentElement;
|
|
1791
|
+
return this.options.horizontal ? doc.scrollWidth - this.scrollElement.innerWidth : doc.scrollHeight - this.scrollElement.innerHeight;
|
|
1792
|
+
}
|
|
1793
|
+
};
|
|
1794
|
+
this.getOffsetForAlignment = (toOffset, align, itemSize = 0) => {
|
|
1795
|
+
if (!this.scrollElement) return 0;
|
|
1796
|
+
const size = this.getSize();
|
|
1797
|
+
const scrollOffset = this.getScrollOffset();
|
|
1798
|
+
if (align === "auto") {
|
|
1799
|
+
align = toOffset >= scrollOffset + size ? "end" : "start";
|
|
1800
|
+
}
|
|
1801
|
+
if (align === "center") {
|
|
1802
|
+
toOffset += (itemSize - size) / 2;
|
|
1803
|
+
} else if (align === "end") {
|
|
1804
|
+
toOffset -= size;
|
|
1805
|
+
}
|
|
1806
|
+
const maxOffset = this.getMaxScrollOffset();
|
|
1807
|
+
return Math.max(Math.min(maxOffset, toOffset), 0);
|
|
1808
|
+
};
|
|
1809
|
+
this.getOffsetForIndex = (index, align = "auto") => {
|
|
1810
|
+
index = Math.max(0, Math.min(index, this.options.count - 1));
|
|
1811
|
+
const size = this.getSize();
|
|
1812
|
+
const scrollOffset = this.getScrollOffset();
|
|
1813
|
+
const item = this.measurementsCache[index];
|
|
1814
|
+
if (!item) return;
|
|
1815
|
+
if (align === "auto") {
|
|
1816
|
+
if (item.end >= scrollOffset + size - this.options.scrollPaddingEnd) {
|
|
1817
|
+
align = "end";
|
|
1818
|
+
} else if (item.start <= scrollOffset + this.options.scrollPaddingStart) {
|
|
1819
|
+
align = "start";
|
|
1820
|
+
} else {
|
|
1821
|
+
return [scrollOffset, align];
|
|
1822
|
+
}
|
|
1823
|
+
}
|
|
1824
|
+
if (align === "end" && index === this.options.count - 1) {
|
|
1825
|
+
return [this.getMaxScrollOffset(), align];
|
|
1826
|
+
}
|
|
1827
|
+
const toOffset = align === "end" ? item.end + this.options.scrollPaddingEnd : item.start - this.options.scrollPaddingStart;
|
|
1828
|
+
return [
|
|
1829
|
+
this.getOffsetForAlignment(toOffset, align, item.size),
|
|
1830
|
+
align
|
|
1831
|
+
];
|
|
1832
|
+
};
|
|
1833
|
+
this.scrollToOffset = (toOffset, { align = "start", behavior = "auto" } = {}) => {
|
|
1834
|
+
const offset = this.getOffsetForAlignment(toOffset, align);
|
|
1835
|
+
const now = this.now();
|
|
1836
|
+
this.scrollState = {
|
|
1837
|
+
index: null,
|
|
1838
|
+
align,
|
|
1839
|
+
behavior,
|
|
1840
|
+
startedAt: now,
|
|
1841
|
+
lastTargetOffset: offset,
|
|
1842
|
+
stableFrames: 0
|
|
1843
|
+
};
|
|
1844
|
+
this._scrollToOffset(offset, { adjustments: void 0, behavior });
|
|
1845
|
+
this.scheduleScrollReconcile();
|
|
1846
|
+
};
|
|
1847
|
+
this.scrollToIndex = (index, {
|
|
1848
|
+
align: initialAlign = "auto",
|
|
1849
|
+
behavior = "auto"
|
|
1850
|
+
} = {}) => {
|
|
1851
|
+
index = Math.max(0, Math.min(index, this.options.count - 1));
|
|
1852
|
+
const offsetInfo = this.getOffsetForIndex(index, initialAlign);
|
|
1853
|
+
if (!offsetInfo) {
|
|
1854
|
+
return;
|
|
1855
|
+
}
|
|
1856
|
+
const [offset, align] = offsetInfo;
|
|
1857
|
+
const now = this.now();
|
|
1858
|
+
this.scrollState = {
|
|
1859
|
+
index,
|
|
1860
|
+
align,
|
|
1861
|
+
behavior,
|
|
1862
|
+
startedAt: now,
|
|
1863
|
+
lastTargetOffset: offset,
|
|
1864
|
+
stableFrames: 0
|
|
1865
|
+
};
|
|
1866
|
+
this._scrollToOffset(offset, { adjustments: void 0, behavior });
|
|
1867
|
+
this.scheduleScrollReconcile();
|
|
1868
|
+
};
|
|
1869
|
+
this.scrollBy = (delta, { behavior = "auto" } = {}) => {
|
|
1870
|
+
const offset = this.getScrollOffset() + delta;
|
|
1871
|
+
const now = this.now();
|
|
1872
|
+
this.scrollState = {
|
|
1873
|
+
index: null,
|
|
1874
|
+
align: "start",
|
|
1875
|
+
behavior,
|
|
1876
|
+
startedAt: now,
|
|
1877
|
+
lastTargetOffset: offset,
|
|
1878
|
+
stableFrames: 0
|
|
1879
|
+
};
|
|
1880
|
+
this._scrollToOffset(offset, { adjustments: void 0, behavior });
|
|
1881
|
+
this.scheduleScrollReconcile();
|
|
1882
|
+
};
|
|
1883
|
+
this.getTotalSize = () => {
|
|
1884
|
+
var _a2;
|
|
1885
|
+
var _a;
|
|
1886
|
+
const measurements = this.getMeasurements();
|
|
1887
|
+
let end;
|
|
1888
|
+
if (measurements.length === 0) {
|
|
1889
|
+
end = this.options.paddingStart;
|
|
1890
|
+
} else if (this.options.lanes === 1) {
|
|
1891
|
+
end = (_a2 = (_a = measurements[measurements.length - 1]) == null ? void 0 : _a.end) != null ? _a2 : 0;
|
|
1892
|
+
} else {
|
|
1893
|
+
const endByLane = Array(this.options.lanes).fill(null);
|
|
1894
|
+
let endIndex = measurements.length - 1;
|
|
1895
|
+
while (endIndex >= 0 && endByLane.some((val) => val === null)) {
|
|
1896
|
+
const item = measurements[endIndex];
|
|
1897
|
+
if (endByLane[item.lane] === null) {
|
|
1898
|
+
endByLane[item.lane] = item.end;
|
|
1899
|
+
}
|
|
1900
|
+
endIndex--;
|
|
1901
|
+
}
|
|
1902
|
+
end = Math.max(...endByLane.filter((val) => val !== null));
|
|
1903
|
+
}
|
|
1904
|
+
return Math.max(
|
|
1905
|
+
end - this.options.scrollMargin + this.options.paddingEnd,
|
|
1906
|
+
0
|
|
1907
|
+
);
|
|
1908
|
+
};
|
|
1909
|
+
this._scrollToOffset = (offset, {
|
|
1910
|
+
adjustments,
|
|
1911
|
+
behavior
|
|
1912
|
+
}) => {
|
|
1913
|
+
this.options.scrollToFn(offset, { behavior, adjustments }, this);
|
|
1914
|
+
};
|
|
1915
|
+
this.measure = () => {
|
|
1916
|
+
this.itemSizeCache = /* @__PURE__ */ new Map();
|
|
1917
|
+
this.laneAssignments = /* @__PURE__ */ new Map();
|
|
1918
|
+
this.notify(false);
|
|
1919
|
+
};
|
|
1920
|
+
this.setOptions(opts);
|
|
1921
|
+
}
|
|
1922
|
+
scheduleScrollReconcile() {
|
|
1923
|
+
if (!this.targetWindow) {
|
|
1924
|
+
this.scrollState = null;
|
|
1925
|
+
return;
|
|
1926
|
+
}
|
|
1927
|
+
if (this.rafId != null) return;
|
|
1928
|
+
this.rafId = this.targetWindow.requestAnimationFrame(() => {
|
|
1929
|
+
this.rafId = null;
|
|
1930
|
+
this.reconcileScroll();
|
|
1931
|
+
});
|
|
1932
|
+
}
|
|
1933
|
+
reconcileScroll() {
|
|
1934
|
+
if (!this.scrollState) return;
|
|
1935
|
+
const el = this.scrollElement;
|
|
1936
|
+
if (!el) return;
|
|
1937
|
+
const MAX_RECONCILE_MS = 5e3;
|
|
1938
|
+
if (this.now() - this.scrollState.startedAt > MAX_RECONCILE_MS) {
|
|
1939
|
+
this.scrollState = null;
|
|
1940
|
+
return;
|
|
1941
|
+
}
|
|
1942
|
+
const offsetInfo = this.scrollState.index != null ? this.getOffsetForIndex(this.scrollState.index, this.scrollState.align) : void 0;
|
|
1943
|
+
const targetOffset = offsetInfo ? offsetInfo[0] : this.scrollState.lastTargetOffset;
|
|
1944
|
+
const STABLE_FRAMES = 1;
|
|
1945
|
+
const targetChanged = targetOffset !== this.scrollState.lastTargetOffset;
|
|
1946
|
+
if (!targetChanged && approxEqual(targetOffset, this.getScrollOffset())) {
|
|
1947
|
+
this.scrollState.stableFrames++;
|
|
1948
|
+
if (this.scrollState.stableFrames >= STABLE_FRAMES) {
|
|
1949
|
+
this.scrollState = null;
|
|
1950
|
+
return;
|
|
1951
|
+
}
|
|
1952
|
+
} else {
|
|
1953
|
+
this.scrollState.stableFrames = 0;
|
|
1954
|
+
if (targetChanged) {
|
|
1955
|
+
this.scrollState.lastTargetOffset = targetOffset;
|
|
1956
|
+
this.scrollState.behavior = "auto";
|
|
1957
|
+
this._scrollToOffset(targetOffset, {
|
|
1958
|
+
adjustments: void 0,
|
|
1959
|
+
behavior: "auto"
|
|
1960
|
+
});
|
|
1961
|
+
}
|
|
1962
|
+
}
|
|
1963
|
+
this.scheduleScrollReconcile();
|
|
1964
|
+
}
|
|
1965
|
+
};
|
|
1966
|
+
var findNearestBinarySearch = (low, high, getCurrentValue, value) => {
|
|
1967
|
+
while (low <= high) {
|
|
1968
|
+
const middle = (low + high) / 2 | 0;
|
|
1969
|
+
const currentValue = getCurrentValue(middle);
|
|
1970
|
+
if (currentValue < value) {
|
|
1971
|
+
low = middle + 1;
|
|
1972
|
+
} else if (currentValue > value) {
|
|
1973
|
+
high = middle - 1;
|
|
1974
|
+
} else {
|
|
1975
|
+
return middle;
|
|
1976
|
+
}
|
|
1977
|
+
}
|
|
1978
|
+
if (low > 0) {
|
|
1979
|
+
return low - 1;
|
|
1980
|
+
} else {
|
|
1981
|
+
return 0;
|
|
1982
|
+
}
|
|
1983
|
+
};
|
|
1984
|
+
function calculateRange({
|
|
1985
|
+
measurements,
|
|
1986
|
+
outerSize,
|
|
1987
|
+
scrollOffset,
|
|
1988
|
+
lanes
|
|
1989
|
+
}) {
|
|
1990
|
+
const lastIndex = measurements.length - 1;
|
|
1991
|
+
const getOffset = (index) => measurements[index].start;
|
|
1992
|
+
if (measurements.length <= lanes) {
|
|
1993
|
+
return {
|
|
1994
|
+
startIndex: 0,
|
|
1995
|
+
endIndex: lastIndex
|
|
1996
|
+
};
|
|
1997
|
+
}
|
|
1998
|
+
let startIndex = findNearestBinarySearch(
|
|
1999
|
+
0,
|
|
2000
|
+
lastIndex,
|
|
2001
|
+
getOffset,
|
|
2002
|
+
scrollOffset
|
|
2003
|
+
);
|
|
2004
|
+
let endIndex = startIndex;
|
|
2005
|
+
if (lanes === 1) {
|
|
2006
|
+
while (endIndex < lastIndex && measurements[endIndex].end < scrollOffset + outerSize) {
|
|
2007
|
+
endIndex++;
|
|
2008
|
+
}
|
|
2009
|
+
} else if (lanes > 1) {
|
|
2010
|
+
const endPerLane = Array(lanes).fill(0);
|
|
2011
|
+
while (endIndex < lastIndex && endPerLane.some((pos) => pos < scrollOffset + outerSize)) {
|
|
2012
|
+
const item = measurements[endIndex];
|
|
2013
|
+
endPerLane[item.lane] = item.end;
|
|
2014
|
+
endIndex++;
|
|
2015
|
+
}
|
|
2016
|
+
const startPerLane = Array(lanes).fill(scrollOffset + outerSize);
|
|
2017
|
+
while (startIndex >= 0 && startPerLane.some((pos) => pos >= scrollOffset)) {
|
|
2018
|
+
const item = measurements[startIndex];
|
|
2019
|
+
startPerLane[item.lane] = item.start;
|
|
2020
|
+
startIndex--;
|
|
2021
|
+
}
|
|
2022
|
+
startIndex = Math.max(0, startIndex - startIndex % lanes);
|
|
2023
|
+
endIndex = Math.min(lastIndex, endIndex + (lanes - 1 - endIndex % lanes));
|
|
2024
|
+
}
|
|
2025
|
+
return { startIndex, endIndex };
|
|
2026
|
+
}
|
|
2027
|
+
|
|
2028
|
+
// ../../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
|
|
2029
|
+
var useIsomorphicLayoutEffect = typeof document !== "undefined" ? React.useLayoutEffect : React.useEffect;
|
|
2030
|
+
function useVirtualizerBase(_a) {
|
|
2031
|
+
var _b = _a, {
|
|
2032
|
+
useFlushSync = true
|
|
2033
|
+
} = _b, options = __objRest(_b, [
|
|
2034
|
+
"useFlushSync"
|
|
2035
|
+
]);
|
|
2036
|
+
const rerender = React.useReducer(() => ({}), {})[1];
|
|
2037
|
+
const resolvedOptions = __spreadProps(__spreadValues({}, options), {
|
|
2038
|
+
onChange: (instance2, sync) => {
|
|
2039
|
+
var _a2;
|
|
2040
|
+
if (useFlushSync && sync) {
|
|
2041
|
+
flushSync(rerender);
|
|
2042
|
+
} else {
|
|
2043
|
+
rerender();
|
|
2044
|
+
}
|
|
2045
|
+
(_a2 = options.onChange) == null ? void 0 : _a2.call(options, instance2, sync);
|
|
2046
|
+
}
|
|
2047
|
+
});
|
|
2048
|
+
const [instance] = React.useState(
|
|
2049
|
+
() => new Virtualizer(resolvedOptions)
|
|
2050
|
+
);
|
|
2051
|
+
instance.setOptions(resolvedOptions);
|
|
2052
|
+
useIsomorphicLayoutEffect(() => {
|
|
2053
|
+
return instance._didMount();
|
|
2054
|
+
}, []);
|
|
2055
|
+
useIsomorphicLayoutEffect(() => {
|
|
2056
|
+
return instance._willUpdate();
|
|
2057
|
+
});
|
|
2058
|
+
return instance;
|
|
2059
|
+
}
|
|
2060
|
+
function useWindowVirtualizer(options) {
|
|
2061
|
+
return useVirtualizerBase(__spreadValues({
|
|
2062
|
+
getScrollElement: () => typeof document !== "undefined" ? window : null,
|
|
2063
|
+
observeElementRect: observeWindowRect,
|
|
2064
|
+
observeElementOffset: observeWindowOffset,
|
|
2065
|
+
scrollToFn: windowScroll,
|
|
2066
|
+
initialOffset: () => typeof document !== "undefined" ? window.scrollY : 0
|
|
2067
|
+
}, options));
|
|
2068
|
+
}
|
|
2069
|
+
|
|
2070
|
+
// ../renderers/src/CollectionRenderer/components/ContentComponent.tsx
|
|
2071
|
+
import { ProcessIndicator, Button as Button4 } from "@transferwise/components";
|
|
2072
|
+
import { useRef as useRef3, useEffect as useEffect7, useMemo, useLayoutEffect as useLayoutEffect2 } from "react";
|
|
2073
|
+
|
|
2074
|
+
// ../renderers/src/step/StepFooter.tsx
|
|
2075
|
+
import { Button as Button3 } from "@transferwise/components";
|
|
2076
|
+
import { useEffect as useEffect6, useRef as useRef2, useState as useState5 } from "react";
|
|
2077
|
+
import { useIntl as useIntl3 } from "react-intl";
|
|
2078
|
+
|
|
2079
|
+
// ../renderers/src/messages/step.messages.ts
|
|
2080
|
+
import { defineMessages as defineMessages3 } from "react-intl";
|
|
2081
|
+
var step_messages_default = defineMessages3({
|
|
2082
|
+
scrollToBottom: {
|
|
2083
|
+
id: "df.wise.step.scrollToBottom",
|
|
2084
|
+
defaultMessage: "Scroll to bottom",
|
|
2085
|
+
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."
|
|
2086
|
+
}
|
|
2087
|
+
});
|
|
2088
|
+
|
|
2089
|
+
// ../renderers/src/step/StepFooter.tsx
|
|
2090
|
+
import { Fragment, jsx as jsx24, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
2091
|
+
var SCROLL_TO_BOTTOM = "scroll-to-bottom";
|
|
2092
|
+
var StepFooter = ({ footer, tags }) => {
|
|
2093
|
+
if (tags == null ? void 0 : tags.includes(SCROLL_TO_BOTTOM)) {
|
|
2094
|
+
return /* @__PURE__ */ jsx24(FooterWithScrollButton, { footer });
|
|
2095
|
+
}
|
|
2096
|
+
return /* @__PURE__ */ jsx24(DefaultFooter, { footer });
|
|
2097
|
+
};
|
|
2098
|
+
var DefaultFooter = ({ footer }) => {
|
|
2099
|
+
const hasFooter = footer && Array.isArray(footer) && footer.length > 0;
|
|
2100
|
+
return hasFooter ? /* @__PURE__ */ jsx24("div", { className: "df-step-fixed__footer", children: footer }) : void 0;
|
|
2101
|
+
};
|
|
2102
|
+
var FooterWithScrollButton = ({ footer }) => {
|
|
2103
|
+
const { formatMessage } = useIntl3();
|
|
2104
|
+
const endOfLayoutRef = useRef2(null);
|
|
2105
|
+
const isElementVisible = useIsElementVisible(endOfLayoutRef);
|
|
2106
|
+
const scrollButton = /* @__PURE__ */ jsx24(
|
|
2107
|
+
Button3,
|
|
2108
|
+
{
|
|
2109
|
+
className: "m-b-1",
|
|
2110
|
+
v2: true,
|
|
2111
|
+
block: true,
|
|
2112
|
+
priority: "tertiary",
|
|
2113
|
+
onClick: () => {
|
|
2114
|
+
var _a;
|
|
2115
|
+
(_a = endOfLayoutRef.current) == null ? void 0 : _a.scrollIntoView({ behavior: "smooth" });
|
|
2116
|
+
},
|
|
2117
|
+
children: formatMessage(step_messages_default.scrollToBottom)
|
|
2118
|
+
}
|
|
2119
|
+
);
|
|
2120
|
+
const hasStepFooterContent = footer && Array.isArray(footer) && footer.length > 0;
|
|
2121
|
+
if (isElementVisible && !hasStepFooterContent) {
|
|
2122
|
+
return /* @__PURE__ */ jsx24("div", { ref: endOfLayoutRef, "aria-hidden": "true" });
|
|
2123
|
+
}
|
|
2124
|
+
return /* @__PURE__ */ jsxs4(Fragment, { children: [
|
|
2125
|
+
/* @__PURE__ */ jsx24("div", { ref: endOfLayoutRef, "aria-hidden": "true" }),
|
|
2126
|
+
/* @__PURE__ */ jsxs4("div", { className: "df-step-fixed__footer", children: [
|
|
2127
|
+
!isElementVisible && scrollButton,
|
|
2128
|
+
footer
|
|
2129
|
+
] })
|
|
2130
|
+
] });
|
|
2131
|
+
};
|
|
2132
|
+
var useIsElementVisible = (elementRef) => {
|
|
2133
|
+
const [isVisible, setIsVisible] = useState5(false);
|
|
2134
|
+
useEffect6(() => {
|
|
2135
|
+
const element = elementRef.current;
|
|
2136
|
+
if (!element) return;
|
|
2137
|
+
const observer = new IntersectionObserver(([entry]) => {
|
|
2138
|
+
setIsVisible(entry.isIntersecting);
|
|
2139
|
+
});
|
|
2140
|
+
observer.observe(element);
|
|
2141
|
+
return () => observer.disconnect();
|
|
2142
|
+
}, [elementRef]);
|
|
2143
|
+
return isVisible;
|
|
2144
|
+
};
|
|
2145
|
+
|
|
2146
|
+
// ../renderers/src/CollectionRenderer/components/ContentComponent.tsx
|
|
2147
|
+
import { jsx as jsx25, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
2148
|
+
var ContentComponent = (props) => {
|
|
2149
|
+
const { state, status, SectionHeader, Item } = props;
|
|
2150
|
+
const endOfContentRef = useRef3(null);
|
|
2151
|
+
const isBottomVisible = useIsElementVisible(endOfContentRef);
|
|
2152
|
+
useEffect7(() => {
|
|
2153
|
+
var _a;
|
|
2154
|
+
if (isBottomVisible && status.type === "idle" && status.loadMore) {
|
|
2155
|
+
(_a = status.loadMore) == null ? void 0 : _a.call(status);
|
|
2156
|
+
}
|
|
2157
|
+
}, [isBottomVisible]);
|
|
2158
|
+
const stateCount = state.sections.reduce(
|
|
2159
|
+
(total, section) => section.items.length + total + (section.title ? 1 : 0),
|
|
2160
|
+
0
|
|
2161
|
+
);
|
|
2162
|
+
const items = useMemo(() => {
|
|
2163
|
+
return state.sections.reduce((acc, section) => {
|
|
2164
|
+
return [
|
|
2165
|
+
...acc,
|
|
2166
|
+
...section.title ? [
|
|
2167
|
+
{
|
|
2168
|
+
type: "header",
|
|
2169
|
+
title: section.title,
|
|
2170
|
+
items: section.items,
|
|
2171
|
+
id: section.id
|
|
2172
|
+
}
|
|
2173
|
+
] : [],
|
|
2174
|
+
...section.items.map((item) => ({
|
|
2175
|
+
item,
|
|
2176
|
+
type: "item"
|
|
2177
|
+
}))
|
|
2178
|
+
];
|
|
2179
|
+
}, []);
|
|
2180
|
+
}, [stateCount]);
|
|
2181
|
+
const listRef = useRef3(null);
|
|
2182
|
+
const listOffsetRef = useRef3(0);
|
|
2183
|
+
useLayoutEffect2(() => {
|
|
2184
|
+
var _a, _b;
|
|
2185
|
+
listOffsetRef.current = (_b = (_a = listRef.current) == null ? void 0 : _a.offsetTop) != null ? _b : 0;
|
|
2186
|
+
});
|
|
2187
|
+
const virtualizer = useWindowVirtualizer({
|
|
2188
|
+
count: stateCount,
|
|
2189
|
+
estimateSize: () => 120,
|
|
2190
|
+
// todo, we could be clever here. Is it worth it?
|
|
2191
|
+
overscan: 10,
|
|
2192
|
+
scrollMargin: listOffsetRef.current
|
|
2193
|
+
});
|
|
2194
|
+
return /* @__PURE__ */ jsxs5("div", { ref: listRef, children: [
|
|
2195
|
+
state.beforeSections,
|
|
2196
|
+
/* @__PURE__ */ jsx25(
|
|
2197
|
+
"div",
|
|
2198
|
+
{
|
|
2199
|
+
style: {
|
|
2200
|
+
height: `${virtualizer.getTotalSize()}px`,
|
|
2201
|
+
width: "100%",
|
|
2202
|
+
position: "relative"
|
|
2203
|
+
},
|
|
2204
|
+
children: virtualizer.getVirtualItems().map((item) => {
|
|
2205
|
+
const i = items[item.index];
|
|
2206
|
+
if (!i) {
|
|
2207
|
+
return null;
|
|
2208
|
+
}
|
|
2209
|
+
return /* @__PURE__ */ jsx25(
|
|
2210
|
+
"div",
|
|
2211
|
+
{
|
|
2212
|
+
ref: virtualizer.measureElement,
|
|
2213
|
+
"data-index": item.index,
|
|
2214
|
+
style: {
|
|
2215
|
+
position: "absolute",
|
|
2216
|
+
top: 0,
|
|
2217
|
+
left: 0,
|
|
2218
|
+
width: "100%",
|
|
2219
|
+
transform: `translateY(${item.start - virtualizer.options.scrollMargin}px)`
|
|
2220
|
+
},
|
|
2221
|
+
children: i.type === "header" ? /* @__PURE__ */ jsx25(SectionHeader, __spreadValues({}, i)) : /* @__PURE__ */ jsx25(Item, __spreadValues({}, i.item))
|
|
2222
|
+
},
|
|
2223
|
+
item.key
|
|
2224
|
+
);
|
|
2225
|
+
})
|
|
2226
|
+
}
|
|
2227
|
+
),
|
|
2228
|
+
/* @__PURE__ */ jsxs5("div", { ref: endOfContentRef, className: "d-flex m-x-auto m-y-2", children: [
|
|
2229
|
+
status.type === "idle" || status.type === "loading" && status.reason === "pagination" ? /* @__PURE__ */ jsx25(ProcessIndicator, { size: "xs" }) : null,
|
|
2230
|
+
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
|
|
2231
|
+
] }),
|
|
2232
|
+
state.afterSections
|
|
2233
|
+
] });
|
|
2234
|
+
};
|
|
2235
|
+
|
|
2236
|
+
// ../renderers/src/CollectionRenderer/components/SearchComponent.tsx
|
|
2237
|
+
import { InputGroup, Input } from "@transferwise/components";
|
|
2238
|
+
import { Search } from "@transferwise/icons";
|
|
2239
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
2240
|
+
var SearchComponent = ({ state, features }) => {
|
|
2241
|
+
const { search } = state;
|
|
2242
|
+
if (!search) {
|
|
2243
|
+
return;
|
|
2244
|
+
}
|
|
2245
|
+
return /* @__PURE__ */ jsx26(
|
|
2246
|
+
FieldInput_default,
|
|
2247
|
+
{
|
|
2248
|
+
id: "search",
|
|
2249
|
+
description: "",
|
|
2250
|
+
validation: void 0,
|
|
2251
|
+
help: "",
|
|
2252
|
+
label: search.title,
|
|
2253
|
+
features,
|
|
2254
|
+
children: /* @__PURE__ */ jsx26(InputGroup, { addonStart: { content: /* @__PURE__ */ jsx26(Search, { size: 24 }) }, children: /* @__PURE__ */ jsx26(
|
|
2255
|
+
Input,
|
|
2256
|
+
{
|
|
2257
|
+
id: "search",
|
|
2258
|
+
name: "search",
|
|
2259
|
+
shape: "pill",
|
|
2260
|
+
placeholder: search.hint,
|
|
2261
|
+
type: "text",
|
|
2262
|
+
value: search.query,
|
|
2263
|
+
onChange: ({ currentTarget: { value } }) => {
|
|
2264
|
+
search.onChange(value);
|
|
2265
|
+
}
|
|
2266
|
+
}
|
|
2267
|
+
) })
|
|
2268
|
+
}
|
|
2269
|
+
);
|
|
2270
|
+
};
|
|
2271
|
+
|
|
2272
|
+
// ../renderers/src/CollectionRenderer/components/FilterComponent.tsx
|
|
2273
|
+
import { Chips } from "@transferwise/components";
|
|
2274
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
2275
|
+
var FiltersComponent = ({ state }) => {
|
|
2276
|
+
const { filters } = state;
|
|
2277
|
+
return filters.map((filter) => {
|
|
2278
|
+
var _a;
|
|
2279
|
+
return /* @__PURE__ */ jsx27(FilterComponent, __spreadValues({}, filter), JSON.stringify((_a = filter.options) == null ? void 0 : _a.map((o) => o.value)));
|
|
2280
|
+
});
|
|
2281
|
+
};
|
|
2282
|
+
var FilterComponent = (filter) => {
|
|
2283
|
+
const { multiSelect, options } = filter;
|
|
2284
|
+
if (!options) {
|
|
2285
|
+
return null;
|
|
2286
|
+
}
|
|
2287
|
+
return /* @__PURE__ */ jsx27(
|
|
2288
|
+
Chips,
|
|
2289
|
+
{
|
|
2290
|
+
className: "m-b-1",
|
|
2291
|
+
multiple: multiSelect,
|
|
2292
|
+
selected: options.some((option) => option.selected) ? options.filter((option) => option.selected).map((option) => option.value) : multiSelect ? [] : "",
|
|
2293
|
+
chips: [
|
|
2294
|
+
...multiSelect ? [
|
|
2295
|
+
{
|
|
2296
|
+
value: "",
|
|
2297
|
+
// this is a placeholder for now, only for single selects, when it is not possible to de-select options
|
|
2298
|
+
label: "All"
|
|
2299
|
+
}
|
|
2300
|
+
] : [],
|
|
2301
|
+
...options.map((option) => ({
|
|
2302
|
+
value: option.value,
|
|
2303
|
+
label: option.title
|
|
2304
|
+
}))
|
|
2305
|
+
],
|
|
2306
|
+
onChange: (value) => {
|
|
2307
|
+
var _a;
|
|
2308
|
+
if (value.selectedValue === "") {
|
|
2309
|
+
options == null ? void 0 : options.filter((option) => option.selected).map((option) => option == null ? void 0 : option.onSelect());
|
|
2310
|
+
return;
|
|
2311
|
+
}
|
|
2312
|
+
(_a = options == null ? void 0 : options.find((option) => value.selectedValue === option.value)) == null ? void 0 : _a.onSelect();
|
|
2313
|
+
}
|
|
2314
|
+
},
|
|
2315
|
+
JSON.stringify(options)
|
|
2316
|
+
);
|
|
2317
|
+
};
|
|
2318
|
+
|
|
2319
|
+
// ../renderers/src/CollectionRenderer/components/ItemComponent.tsx
|
|
2320
|
+
import { ListItem as ListItem6 } from "@transferwise/components";
|
|
2321
|
+
|
|
2322
|
+
// ../renderers/src/utils/listItem/getAdditionalInfo.tsx
|
|
2323
|
+
import { ListItem as ListItem4 } from "@transferwise/components";
|
|
2324
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
2325
|
+
var getAdditionalInfo = (additionalInfo) => {
|
|
2326
|
+
var _a, _b;
|
|
2327
|
+
if (!additionalInfo) {
|
|
2328
|
+
return void 0;
|
|
2329
|
+
}
|
|
2330
|
+
const { href, text, onClick } = additionalInfo;
|
|
2331
|
+
if (href || onClick) {
|
|
2332
|
+
return /* @__PURE__ */ jsx28(
|
|
2333
|
+
ListItem4.AdditionalInfo,
|
|
2334
|
+
{
|
|
2335
|
+
action: __spreadValues({
|
|
2336
|
+
label: text
|
|
2337
|
+
}, (_b = (_a = additionalInfo.getAnchorProps) == null ? void 0 : _a.call(additionalInfo)) != null ? _b : { onClick })
|
|
2338
|
+
}
|
|
2339
|
+
);
|
|
2340
|
+
}
|
|
2341
|
+
return /* @__PURE__ */ jsx28(ListItem4.AdditionalInfo, { children: additionalInfo == null ? void 0 : additionalInfo.text });
|
|
2342
|
+
};
|
|
2343
|
+
|
|
2344
|
+
// ../renderers/src/utils/listItem/getCTAControl.tsx
|
|
2345
|
+
import { ListItem as ListItem5 } from "@transferwise/components";
|
|
2346
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
2347
|
+
var getCTAControl = (callToAction, { ctaSecondary, fullyInteractive }) => {
|
|
2348
|
+
if (!callToAction) {
|
|
2349
|
+
return void 0;
|
|
2350
|
+
}
|
|
2351
|
+
const { accessibilityDescription, title, context } = callToAction;
|
|
2352
|
+
const { priority, sentiment } = getPriorityAndSentiment(ctaSecondary, context);
|
|
2353
|
+
return /* @__PURE__ */ jsx29(
|
|
2354
|
+
ListItem5.Button,
|
|
2355
|
+
__spreadProps(__spreadValues({}, callToAction.getAnchorProps()), {
|
|
2356
|
+
partiallyInteractive: !fullyInteractive,
|
|
2357
|
+
priority,
|
|
2358
|
+
"aria-description": accessibilityDescription,
|
|
2359
|
+
sentiment,
|
|
2360
|
+
children: title
|
|
2361
|
+
})
|
|
2362
|
+
);
|
|
2363
|
+
};
|
|
2364
|
+
var getPriorityAndSentiment = (ctaSecondary, context) => {
|
|
2365
|
+
if (context === "negative") {
|
|
2366
|
+
return { priority: "secondary", sentiment: "negative" };
|
|
2367
|
+
}
|
|
2368
|
+
return { priority: ctaSecondary ? "secondary" : "secondary-neutral", sentiment: "default" };
|
|
2369
|
+
};
|
|
2370
|
+
|
|
2371
|
+
// ../renderers/src/utils/listItem/shouldUseAvatar.ts
|
|
2372
|
+
var shouldUseAvatar = (control, tags) => {
|
|
2373
|
+
var _a;
|
|
2374
|
+
return control === "with-avatar" || ((_a = tags == null ? void 0 : tags.includes("with-avatar")) != null ? _a : false);
|
|
2375
|
+
};
|
|
2376
|
+
|
|
2377
|
+
// ../renderers/src/CollectionRenderer/components/ItemComponent.tsx
|
|
2378
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
2379
|
+
var ItemComponent = (props) => {
|
|
2380
|
+
var _a, _b;
|
|
2381
|
+
const {
|
|
2382
|
+
title,
|
|
2383
|
+
description,
|
|
2384
|
+
supportingValues,
|
|
2385
|
+
media,
|
|
2386
|
+
additionalInfo,
|
|
2387
|
+
inlineAlert,
|
|
2388
|
+
href,
|
|
2389
|
+
onClick,
|
|
2390
|
+
callToAction,
|
|
2391
|
+
tags,
|
|
2392
|
+
parentTags,
|
|
2393
|
+
control
|
|
2394
|
+
} = props;
|
|
2395
|
+
const controlOptions = {
|
|
2396
|
+
ctaSecondary: (_a = tags == null ? void 0 : tags.includes("cta-secondary")) != null ? _a : false,
|
|
2397
|
+
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
2398
|
+
};
|
|
2399
|
+
return /* @__PURE__ */ jsx30(
|
|
2400
|
+
ListItem6,
|
|
2401
|
+
{
|
|
2402
|
+
title,
|
|
2403
|
+
subtitle: description,
|
|
2404
|
+
valueTitle: supportingValues == null ? void 0 : supportingValues.value,
|
|
2405
|
+
valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
|
|
2406
|
+
media: getMedia(media, shouldUseAvatar(control, parentTags)),
|
|
2407
|
+
prompt: getInlineAlert(inlineAlert),
|
|
2408
|
+
additionalInfo: getAdditionalInfo(additionalInfo),
|
|
2409
|
+
control: onClick || href ? getNavigationControl(onClick, href) : getCTAControl(callToAction, controlOptions)
|
|
2410
|
+
},
|
|
2411
|
+
title
|
|
2412
|
+
);
|
|
2413
|
+
};
|
|
2414
|
+
var getNavigationControl = (onClick, href) => {
|
|
2415
|
+
if (href) {
|
|
2416
|
+
return /* @__PURE__ */ jsx30(ListItem6.Navigation, { href });
|
|
2417
|
+
}
|
|
2418
|
+
if (onClick) {
|
|
2419
|
+
return /* @__PURE__ */ jsx30(ListItem6.Navigation, { onClick });
|
|
2420
|
+
}
|
|
2421
|
+
return null;
|
|
2422
|
+
};
|
|
2423
|
+
|
|
2424
|
+
// ../renderers/src/CollectionRenderer/components/SectionHeaderComponent.tsx
|
|
2425
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
2426
|
+
var SectionHeaderComponent = ({
|
|
2427
|
+
title,
|
|
2428
|
+
callToAction
|
|
2429
|
+
}) => /* @__PURE__ */ jsx31(Header, { title, callToAction });
|
|
2430
|
+
|
|
2431
|
+
// ../renderers/src/CollectionRenderer/createCollectionRenderer.tsx
|
|
2432
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
2433
|
+
var createCollectionRenderer = (canRender, components) => {
|
|
2434
|
+
const componeontsWithDefaults = __spreadValues({
|
|
2435
|
+
Search: SearchComponent,
|
|
2436
|
+
Filters: FiltersComponent,
|
|
2437
|
+
Filter: FilterComponent,
|
|
2438
|
+
Item: ItemComponent,
|
|
2439
|
+
SectionHeader: SectionHeaderComponent,
|
|
2440
|
+
Results: ContentComponent
|
|
2441
|
+
}, components);
|
|
2442
|
+
return {
|
|
2443
|
+
canRenderType: "collection",
|
|
2444
|
+
canRender,
|
|
2445
|
+
render: (props) => {
|
|
2446
|
+
return /* @__PURE__ */ jsx32(CollectionRendererComponent, __spreadValues(__spreadValues({}, props), componeontsWithDefaults));
|
|
2447
|
+
}
|
|
2448
|
+
};
|
|
2449
|
+
};
|
|
2450
|
+
|
|
2451
|
+
// ../renderers/src/CollectionRenderer/CollectionRenderer.tsx
|
|
2452
|
+
import { Fragment as Fragment2, jsx as jsx33, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2453
|
+
var CollectionRendererComponent = (props) => {
|
|
2454
|
+
const { status, Search: Search4, Filters, Results } = props;
|
|
2455
|
+
return /* @__PURE__ */ jsxs6(Fragment2, { children: [
|
|
2456
|
+
/* @__PURE__ */ jsx33(Search4, __spreadValues({}, props)),
|
|
2457
|
+
/* @__PURE__ */ jsx33(Filters, __spreadValues({}, props)),
|
|
2458
|
+
status.type === "idle" || status.reason === "pagination" ? /* @__PURE__ */ jsx33(Results, __spreadValues({}, props)) : void 0,
|
|
2459
|
+
status.type === "error" && status.reason === "search" && /* @__PURE__ */ jsxs6(InlinePrompt, { width: "full", sentiment: "negative", children: [
|
|
2460
|
+
"Something went wrong,\xA0",
|
|
2461
|
+
/* @__PURE__ */ jsx33(DSLink, { onClick: status.retry, children: "click here to retry" })
|
|
2462
|
+
] })
|
|
2463
|
+
] });
|
|
2464
|
+
};
|
|
2465
|
+
var CollectionRenderer = createCollectionRenderer(() => true, {
|
|
2466
|
+
Search: (props) => /* @__PURE__ */ jsx33(SearchComponent, __spreadValues({}, props)),
|
|
2467
|
+
Filters: (props) => /* @__PURE__ */ jsx33(FiltersComponent, __spreadValues({}, props)),
|
|
2468
|
+
Filter: (props) => /* @__PURE__ */ jsx33(FilterComponent, __spreadValues({}, props)),
|
|
2469
|
+
Item: (props) => /* @__PURE__ */ jsx33(ItemComponent, __spreadValues({}, props)),
|
|
2470
|
+
SectionHeader: (props) => /* @__PURE__ */ jsx33(SectionHeaderComponent, __spreadValues({}, props)),
|
|
2471
|
+
Results: (props) => /* @__PURE__ */ jsx33(ContentComponent, __spreadValues({}, props))
|
|
2472
|
+
});
|
|
2473
|
+
var CollectionRenderer_default = CollectionRenderer;
|
|
2474
|
+
|
|
1104
2475
|
// ../renderers/src/ColumnsRenderer.tsx
|
|
1105
2476
|
var import_classnames3 = __toESM(require_classnames());
|
|
1106
|
-
import { jsx as
|
|
2477
|
+
import { jsx as jsx34, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1107
2478
|
var ColumnsRenderer = {
|
|
1108
2479
|
canRenderType: "columns",
|
|
1109
|
-
render: ({ bias, margin, startChildren, endChildren }) => /* @__PURE__ */
|
|
2480
|
+
render: ({ bias, margin, startChildren, endChildren }) => /* @__PURE__ */ jsxs7(
|
|
1110
2481
|
"div",
|
|
1111
2482
|
{
|
|
1112
2483
|
className: (0, import_classnames3.default)("df-columns-renderer-container", getMargin(margin), {
|
|
@@ -1114,8 +2485,8 @@ var ColumnsRenderer = {
|
|
|
1114
2485
|
"df-columns-renderer-bias-end": bias === "end"
|
|
1115
2486
|
}),
|
|
1116
2487
|
children: [
|
|
1117
|
-
/* @__PURE__ */
|
|
1118
|
-
/* @__PURE__ */
|
|
2488
|
+
/* @__PURE__ */ jsx34("div", { className: "df-columns-renderer-column", children: startChildren }),
|
|
2489
|
+
/* @__PURE__ */ jsx34("div", { className: "df-columns-renderer-column", children: endChildren })
|
|
1119
2490
|
]
|
|
1120
2491
|
}
|
|
1121
2492
|
)
|
|
@@ -1150,7 +2521,7 @@ var dateToDateString = (date) => {
|
|
|
1150
2521
|
};
|
|
1151
2522
|
|
|
1152
2523
|
// ../renderers/src/components/VariableDateInput.tsx
|
|
1153
|
-
import { jsx as
|
|
2524
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
1154
2525
|
function VariableDateInput({
|
|
1155
2526
|
control,
|
|
1156
2527
|
inputProps
|
|
@@ -1166,7 +2537,7 @@ function VariableDateInput({
|
|
|
1166
2537
|
onFocus
|
|
1167
2538
|
} = inputProps;
|
|
1168
2539
|
if (control === "date-lookup") {
|
|
1169
|
-
return /* @__PURE__ */
|
|
2540
|
+
return /* @__PURE__ */ jsx35(
|
|
1170
2541
|
DateLookup,
|
|
1171
2542
|
{
|
|
1172
2543
|
value: dateStringToDateOrNull(inputProps.value),
|
|
@@ -1182,7 +2553,7 @@ function VariableDateInput({
|
|
|
1182
2553
|
}
|
|
1183
2554
|
);
|
|
1184
2555
|
}
|
|
1185
|
-
return /* @__PURE__ */
|
|
2556
|
+
return /* @__PURE__ */ jsx35(
|
|
1186
2557
|
DateInput,
|
|
1187
2558
|
__spreadProps(__spreadValues({}, inputProps), {
|
|
1188
2559
|
dayAutoComplete: getAutocompleteString(autoComplete, "day"),
|
|
@@ -1199,7 +2570,7 @@ var getAutocompleteString = (value, suffix) => {
|
|
|
1199
2570
|
var VariableDateInput_default = VariableDateInput;
|
|
1200
2571
|
|
|
1201
2572
|
// ../renderers/src/DateInputRenderer.tsx
|
|
1202
|
-
import { jsx as
|
|
2573
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
1203
2574
|
var DateInputRenderer = {
|
|
1204
2575
|
canRenderType: "input-date",
|
|
1205
2576
|
render: (props) => {
|
|
@@ -1224,7 +2595,7 @@ var DateInputRenderer = {
|
|
|
1224
2595
|
]);
|
|
1225
2596
|
const value = initialValue != null ? initialValue : "";
|
|
1226
2597
|
const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
|
|
1227
|
-
return /* @__PURE__ */
|
|
2598
|
+
return /* @__PURE__ */ jsx36(
|
|
1228
2599
|
FieldInput_default,
|
|
1229
2600
|
{
|
|
1230
2601
|
id,
|
|
@@ -1235,7 +2606,7 @@ var DateInputRenderer = {
|
|
|
1235
2606
|
loadingState: props.fieldLoadingState,
|
|
1236
2607
|
help,
|
|
1237
2608
|
features: props.features,
|
|
1238
|
-
children: /* @__PURE__ */
|
|
2609
|
+
children: /* @__PURE__ */ jsx36(VariableDateInput_default, { control, inputProps })
|
|
1239
2610
|
}
|
|
1240
2611
|
);
|
|
1241
2612
|
}
|
|
@@ -1243,44 +2614,16 @@ var DateInputRenderer = {
|
|
|
1243
2614
|
var DateInputRenderer_default = DateInputRenderer;
|
|
1244
2615
|
|
|
1245
2616
|
// ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
|
|
1246
|
-
import { ListItem as
|
|
1247
|
-
|
|
1248
|
-
// ../renderers/src/utils/listItem/getAdditionalInfo.tsx
|
|
1249
|
-
import { ListItem as ListItem4 } from "@transferwise/components";
|
|
1250
|
-
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
1251
|
-
var getAdditionalInfo = (additionalInfo) => {
|
|
1252
|
-
var _a, _b;
|
|
1253
|
-
if (!additionalInfo) {
|
|
1254
|
-
return void 0;
|
|
1255
|
-
}
|
|
1256
|
-
const { href, text, onClick } = additionalInfo;
|
|
1257
|
-
if (href || onClick) {
|
|
1258
|
-
return /* @__PURE__ */ jsx27(
|
|
1259
|
-
ListItem4.AdditionalInfo,
|
|
1260
|
-
{
|
|
1261
|
-
action: __spreadValues({
|
|
1262
|
-
label: text
|
|
1263
|
-
}, (_b = (_a = additionalInfo.getAnchorProps) == null ? void 0 : _a.call(additionalInfo)) != null ? _b : { onClick })
|
|
1264
|
-
}
|
|
1265
|
-
);
|
|
1266
|
-
}
|
|
1267
|
-
return /* @__PURE__ */ jsx27(ListItem4.AdditionalInfo, { children: additionalInfo == null ? void 0 : additionalInfo.text });
|
|
1268
|
-
};
|
|
1269
|
-
|
|
1270
|
-
// ../renderers/src/utils/listItem/shouldUseAvatar.ts
|
|
1271
|
-
var shouldUseAvatar = (control, tags) => {
|
|
1272
|
-
var _a;
|
|
1273
|
-
return control === "with-avatar" || ((_a = tags == null ? void 0 : tags.includes("with-avatar")) != null ? _a : false);
|
|
1274
|
-
};
|
|
2617
|
+
import { ListItem as ListItem7 } from "@transferwise/components";
|
|
1275
2618
|
|
|
1276
2619
|
// ../renderers/src/DecisionRenderer/DecisionWrapper.tsx
|
|
1277
|
-
import { Header as
|
|
1278
|
-
import { useState as
|
|
1279
|
-
import { useIntl as
|
|
2620
|
+
import { Header as Header3, SearchInput } from "@transferwise/components";
|
|
2621
|
+
import { useState as useState6 } from "react";
|
|
2622
|
+
import { useIntl as useIntl5 } from "react-intl";
|
|
1280
2623
|
|
|
1281
2624
|
// ../renderers/src/messages/filter.messages.ts
|
|
1282
|
-
import { defineMessages as
|
|
1283
|
-
var filter_messages_default =
|
|
2625
|
+
import { defineMessages as defineMessages4 } from "react-intl";
|
|
2626
|
+
var filter_messages_default = defineMessages4({
|
|
1284
2627
|
placeholder: {
|
|
1285
2628
|
id: "df.wise.filter.placeholder",
|
|
1286
2629
|
defaultMessage: "Start typing to search",
|
|
@@ -1346,12 +2689,12 @@ function filterAndSortDecisionOptions(selectOptions, query) {
|
|
|
1346
2689
|
var normalizeAndRemoveAccents = (text) => text.trim().toLowerCase().normalize("NFKD").replace(new RegExp("\\p{Diacritic}", "gu"), "");
|
|
1347
2690
|
|
|
1348
2691
|
// ../renderers/src/DecisionRenderer/GroupedDecisionList.tsx
|
|
1349
|
-
import { Header, Section } from "@transferwise/components";
|
|
1350
|
-
import { useIntl as
|
|
2692
|
+
import { Header as Header2, Section } from "@transferwise/components";
|
|
2693
|
+
import { useIntl as useIntl4 } from "react-intl";
|
|
1351
2694
|
|
|
1352
2695
|
// ../renderers/src/messages/group.messages.ts
|
|
1353
|
-
import { defineMessages as
|
|
1354
|
-
var group_messages_default =
|
|
2696
|
+
import { defineMessages as defineMessages5 } from "react-intl";
|
|
2697
|
+
var group_messages_default = defineMessages5({
|
|
1355
2698
|
all: {
|
|
1356
2699
|
id: "df.wise.group.all",
|
|
1357
2700
|
defaultMessage: "All",
|
|
@@ -1385,19 +2728,19 @@ var getGroupsFromTags = (knownTags, items) => {
|
|
|
1385
2728
|
};
|
|
1386
2729
|
|
|
1387
2730
|
// ../renderers/src/DecisionRenderer/GroupedDecisionList.tsx
|
|
1388
|
-
import { Fragment, jsx as
|
|
2731
|
+
import { Fragment as Fragment3, jsx as jsx37, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1389
2732
|
var groupingTags = Object.keys(group_messages_default).filter((key) => key !== "all");
|
|
1390
2733
|
var isGroupedDecision = (options) => {
|
|
1391
2734
|
return getGroupsFromTags(groupingTags, options).length > 0;
|
|
1392
2735
|
};
|
|
1393
2736
|
var GroupedDecisionList = (_a) => {
|
|
1394
2737
|
var _b = _a, { renderDecisionList: renderDecisionList2 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
|
|
1395
|
-
const { formatMessage } =
|
|
2738
|
+
const { formatMessage } = useIntl4();
|
|
1396
2739
|
const { options } = rest;
|
|
1397
2740
|
const itemsByTag = [...getGroupsFromTags(groupingTags, options), { tag: "all", items: options }];
|
|
1398
|
-
return /* @__PURE__ */
|
|
1399
|
-
/* @__PURE__ */
|
|
1400
|
-
|
|
2741
|
+
return /* @__PURE__ */ jsx37(Fragment3, { children: itemsByTag.map(({ tag, items }) => /* @__PURE__ */ jsxs8(Section, { children: [
|
|
2742
|
+
/* @__PURE__ */ jsx37(
|
|
2743
|
+
Header2,
|
|
1401
2744
|
{
|
|
1402
2745
|
as: "h2",
|
|
1403
2746
|
title: tag in group_messages_default ? formatMessage(group_messages_default[tag]) : tag
|
|
@@ -1408,25 +2751,25 @@ var GroupedDecisionList = (_a) => {
|
|
|
1408
2751
|
};
|
|
1409
2752
|
|
|
1410
2753
|
// ../renderers/src/DecisionRenderer/DecisionWrapper.tsx
|
|
1411
|
-
import { Fragment as
|
|
2754
|
+
import { Fragment as Fragment4, jsx as jsx38, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1412
2755
|
var DecisionWrapper = (props) => {
|
|
1413
|
-
return /* @__PURE__ */
|
|
1414
|
-
props.title && /* @__PURE__ */
|
|
1415
|
-
props.control === "filtered" ? /* @__PURE__ */
|
|
2756
|
+
return /* @__PURE__ */ jsxs9("div", { className: getMargin(props.margin), children: [
|
|
2757
|
+
props.title && /* @__PURE__ */ jsx38(Header3, { as: "h2", title: props.title }),
|
|
2758
|
+
props.control === "filtered" ? /* @__PURE__ */ jsx38(FilteredDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ jsx38(UnfilteredDecisionList, __spreadValues({}, props))
|
|
1416
2759
|
] });
|
|
1417
2760
|
};
|
|
1418
2761
|
var UnfilteredDecisionList = (_a) => {
|
|
1419
2762
|
var _b = _a, { renderDecisionList: renderDecisionList2 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
|
|
1420
|
-
return isGroupedDecision(rest.options) ? /* @__PURE__ */
|
|
2763
|
+
return isGroupedDecision(rest.options) ? /* @__PURE__ */ jsx38(GroupedDecisionList, __spreadProps(__spreadValues({}, rest), { renderDecisionList: renderDecisionList2 })) : renderDecisionList2(rest);
|
|
1421
2764
|
};
|
|
1422
2765
|
var FilteredDecisionList = (props) => {
|
|
1423
|
-
const { formatMessage } =
|
|
1424
|
-
const [query, setQuery] =
|
|
2766
|
+
const { formatMessage } = useIntl5();
|
|
2767
|
+
const [query, setQuery] = useState6("");
|
|
1425
2768
|
const { control, options, renderDecisionList: renderDecisionList2 } = props;
|
|
1426
2769
|
const filteredOptions = (query == null ? void 0 : query.length) > 0 ? filterAndSortDecisionOptions(options, query) : options;
|
|
1427
2770
|
const isGrouped = isGroupedDecision(options);
|
|
1428
|
-
return /* @__PURE__ */
|
|
1429
|
-
/* @__PURE__ */
|
|
2771
|
+
return /* @__PURE__ */ jsxs9(Fragment4, { children: [
|
|
2772
|
+
/* @__PURE__ */ jsx38(
|
|
1430
2773
|
SearchInput,
|
|
1431
2774
|
{
|
|
1432
2775
|
placeholder: formatMessage(filter_messages_default.placeholder),
|
|
@@ -1438,25 +2781,25 @@ var FilteredDecisionList = (props) => {
|
|
|
1438
2781
|
}
|
|
1439
2782
|
}
|
|
1440
2783
|
),
|
|
1441
|
-
isGrouped && query.length === 0 ? /* @__PURE__ */
|
|
1442
|
-
query.length > 0 && /* @__PURE__ */
|
|
2784
|
+
isGrouped && query.length === 0 ? /* @__PURE__ */ jsx38(GroupedDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ jsxs9(Fragment4, { children: [
|
|
2785
|
+
query.length > 0 && /* @__PURE__ */ jsx38(Header3, { as: "h2", title: formatMessage(filter_messages_default.results), className: "m-t-4" }),
|
|
1443
2786
|
filteredOptions.length > 0 ? renderDecisionList2({
|
|
1444
2787
|
control,
|
|
1445
2788
|
className: query.length === 0 ? "m-t-3" : "",
|
|
1446
2789
|
options: filteredOptions
|
|
1447
|
-
}) : /* @__PURE__ */
|
|
2790
|
+
}) : /* @__PURE__ */ jsx38("p", { children: formatMessage(filter_messages_default.noResults) })
|
|
1448
2791
|
] })
|
|
1449
2792
|
] });
|
|
1450
2793
|
};
|
|
1451
2794
|
|
|
1452
2795
|
// ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
|
|
1453
|
-
import { Fragment as
|
|
2796
|
+
import { Fragment as Fragment5, jsx as jsx39 } from "react/jsx-runtime";
|
|
1454
2797
|
var DecisionRenderer = {
|
|
1455
2798
|
canRenderType: "decision",
|
|
1456
|
-
render: (props) => /* @__PURE__ */
|
|
2799
|
+
render: (props) => /* @__PURE__ */ jsx39(DecisionWrapper, __spreadProps(__spreadValues({}, props), { renderDecisionList }))
|
|
1457
2800
|
};
|
|
1458
2801
|
var renderDecisionList = ({ options, control }) => {
|
|
1459
|
-
return /* @__PURE__ */
|
|
2802
|
+
return /* @__PURE__ */ jsx39(Fragment5, { children: options.map((_a) => {
|
|
1460
2803
|
var _b = _a, { onClick } = _b, rest = __objRest(_b, ["onClick"]);
|
|
1461
2804
|
const {
|
|
1462
2805
|
description,
|
|
@@ -1469,8 +2812,8 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
1469
2812
|
supportingValues,
|
|
1470
2813
|
tags
|
|
1471
2814
|
} = rest;
|
|
1472
|
-
return /* @__PURE__ */
|
|
1473
|
-
|
|
2815
|
+
return /* @__PURE__ */ jsx39(
|
|
2816
|
+
ListItem7,
|
|
1474
2817
|
{
|
|
1475
2818
|
title: itemTitle,
|
|
1476
2819
|
subtitle: description,
|
|
@@ -1481,7 +2824,7 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
1481
2824
|
media: getMedia(media, shouldUseAvatar(control, tags)),
|
|
1482
2825
|
prompt: getInlineAlert(inlineAlert),
|
|
1483
2826
|
additionalInfo: additionalText ? getAdditionalInfo({ text: additionalText }) : void 0,
|
|
1484
|
-
control: /* @__PURE__ */
|
|
2827
|
+
control: /* @__PURE__ */ jsx39(ListItem7.Navigation, __spreadValues({}, getAnchorProps()))
|
|
1485
2828
|
},
|
|
1486
2829
|
JSON.stringify(rest)
|
|
1487
2830
|
);
|
|
@@ -1491,7 +2834,7 @@ var DecisionRenderer_default = DecisionRenderer;
|
|
|
1491
2834
|
|
|
1492
2835
|
// ../renderers/src/DividerRenderer.tsx
|
|
1493
2836
|
import { Divider } from "@transferwise/components";
|
|
1494
|
-
import { jsx as
|
|
2837
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
1495
2838
|
var mapControlToLevel = (control) => {
|
|
1496
2839
|
switch (control) {
|
|
1497
2840
|
case "section":
|
|
@@ -1504,16 +2847,16 @@ var mapControlToLevel = (control) => {
|
|
|
1504
2847
|
};
|
|
1505
2848
|
var DividerRenderer = {
|
|
1506
2849
|
canRenderType: "divider",
|
|
1507
|
-
render: ({ margin, control }) => /* @__PURE__ */
|
|
2850
|
+
render: ({ margin, control }) => /* @__PURE__ */ jsx40(Divider, { className: `m-t-0 d-block ${getMargin(margin)}`, level: mapControlToLevel(control) })
|
|
1508
2851
|
};
|
|
1509
2852
|
var DividerRenderer_default = DividerRenderer;
|
|
1510
2853
|
|
|
1511
2854
|
// ../renderers/src/ExternalConfirmationRenderer.tsx
|
|
1512
|
-
import { Button as
|
|
2855
|
+
import { Button as Button5, Markdown as Markdown2, Modal } from "@transferwise/components";
|
|
1513
2856
|
|
|
1514
2857
|
// ../renderers/src/messages/external-confirmation.messages.ts
|
|
1515
|
-
import { defineMessages as
|
|
1516
|
-
var external_confirmation_messages_default =
|
|
2858
|
+
import { defineMessages as defineMessages6 } from "react-intl";
|
|
2859
|
+
var external_confirmation_messages_default = defineMessages6({
|
|
1517
2860
|
title: {
|
|
1518
2861
|
id: "df.wise.ExternalConfirmation.title",
|
|
1519
2862
|
defaultMessage: "Please confirm",
|
|
@@ -1537,9 +2880,9 @@ var external_confirmation_messages_default = defineMessages5({
|
|
|
1537
2880
|
});
|
|
1538
2881
|
|
|
1539
2882
|
// ../renderers/src/ExternalConfirmationRenderer.tsx
|
|
1540
|
-
import { useIntl as
|
|
1541
|
-
import { useEffect as
|
|
1542
|
-
import { Fragment as
|
|
2883
|
+
import { useIntl as useIntl6 } from "react-intl";
|
|
2884
|
+
import { useEffect as useEffect8 } from "react";
|
|
2885
|
+
import { Fragment as Fragment6, jsx as jsx41, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1543
2886
|
var ExternalConfirmationRenderer = {
|
|
1544
2887
|
canRenderType: "external-confirmation",
|
|
1545
2888
|
render: ExternalConfirmationRendererComponent
|
|
@@ -1550,20 +2893,20 @@ function ExternalConfirmationRendererComponent({
|
|
|
1550
2893
|
open,
|
|
1551
2894
|
onCancel
|
|
1552
2895
|
}) {
|
|
1553
|
-
const { formatMessage } =
|
|
1554
|
-
|
|
2896
|
+
const { formatMessage } = useIntl6();
|
|
2897
|
+
useEffect8(() => {
|
|
1555
2898
|
open();
|
|
1556
2899
|
}, []);
|
|
1557
|
-
return /* @__PURE__ */
|
|
2900
|
+
return /* @__PURE__ */ jsx41(
|
|
1558
2901
|
Modal,
|
|
1559
2902
|
{
|
|
1560
2903
|
open: visible,
|
|
1561
2904
|
title: formatMessage(external_confirmation_messages_default.title),
|
|
1562
|
-
body: /* @__PURE__ */
|
|
1563
|
-
/* @__PURE__ */
|
|
1564
|
-
/* @__PURE__ */
|
|
1565
|
-
/* @__PURE__ */
|
|
1566
|
-
|
|
2905
|
+
body: /* @__PURE__ */ jsxs10(Fragment6, { children: [
|
|
2906
|
+
/* @__PURE__ */ jsx41(Markdown2, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(url) }) }),
|
|
2907
|
+
/* @__PURE__ */ jsx41("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ jsxs10("div", { className: "df-box-renderer-width-lg", children: [
|
|
2908
|
+
/* @__PURE__ */ jsx41(
|
|
2909
|
+
Button5,
|
|
1567
2910
|
{
|
|
1568
2911
|
v2: true,
|
|
1569
2912
|
block: true,
|
|
@@ -1576,7 +2919,7 @@ function ExternalConfirmationRendererComponent({
|
|
|
1576
2919
|
children: formatMessage(external_confirmation_messages_default.open)
|
|
1577
2920
|
}
|
|
1578
2921
|
),
|
|
1579
|
-
/* @__PURE__ */
|
|
2922
|
+
/* @__PURE__ */ jsx41(Button5, { v2: true, block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onCancel, children: formatMessage(external_confirmation_messages_default.cancel) })
|
|
1580
2923
|
] }) })
|
|
1581
2924
|
] }),
|
|
1582
2925
|
onClose: onCancel
|
|
@@ -1593,27 +2936,27 @@ function getOrigin(url) {
|
|
|
1593
2936
|
var ExternalConfirmationRenderer_default = ExternalConfirmationRenderer;
|
|
1594
2937
|
|
|
1595
2938
|
// ../renderers/src/FormRenderer.tsx
|
|
1596
|
-
import { jsx as
|
|
2939
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
1597
2940
|
var FormRenderer = {
|
|
1598
2941
|
canRenderType: "form",
|
|
1599
|
-
render: ({ children, margin }) => /* @__PURE__ */
|
|
2942
|
+
render: ({ children, margin }) => /* @__PURE__ */ jsx42("div", { className: getMargin(margin), children })
|
|
1600
2943
|
};
|
|
1601
2944
|
var FormRenderer_default = FormRenderer;
|
|
1602
2945
|
|
|
1603
2946
|
// ../renderers/src/FormSectionRenderer.tsx
|
|
1604
|
-
import { Header as
|
|
1605
|
-
import { jsx as
|
|
2947
|
+
import { Header as Header4 } from "@transferwise/components";
|
|
2948
|
+
import { jsx as jsx43, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1606
2949
|
var FormSectionRenderer = {
|
|
1607
2950
|
canRenderType: "form-section",
|
|
1608
|
-
render: ({ title, description, children }) => /* @__PURE__ */
|
|
1609
|
-
title && /* @__PURE__ */
|
|
1610
|
-
|
|
2951
|
+
render: ({ title, description, children }) => /* @__PURE__ */ jsxs11("fieldset", { children: [
|
|
2952
|
+
title && /* @__PURE__ */ jsx43(
|
|
2953
|
+
Header4,
|
|
1611
2954
|
{
|
|
1612
2955
|
as: "h2",
|
|
1613
2956
|
title
|
|
1614
2957
|
}
|
|
1615
2958
|
),
|
|
1616
|
-
description && /* @__PURE__ */
|
|
2959
|
+
description && /* @__PURE__ */ jsx43("p", { children: description }),
|
|
1617
2960
|
children
|
|
1618
2961
|
] })
|
|
1619
2962
|
};
|
|
@@ -1621,18 +2964,18 @@ var FormSectionRenderer_default = FormSectionRenderer;
|
|
|
1621
2964
|
|
|
1622
2965
|
// ../renderers/src/HeadingRenderer.tsx
|
|
1623
2966
|
import { Display, Title } from "@transferwise/components";
|
|
1624
|
-
import { jsx as
|
|
2967
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
1625
2968
|
var HeadingRenderer = {
|
|
1626
2969
|
canRenderType: "heading",
|
|
1627
|
-
render: (props) => /* @__PURE__ */
|
|
2970
|
+
render: (props) => /* @__PURE__ */ jsx44(Heading, __spreadValues({}, props))
|
|
1628
2971
|
};
|
|
1629
2972
|
function Heading(props) {
|
|
1630
2973
|
const { text, size, align, margin, control } = props;
|
|
1631
2974
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
1632
|
-
return control === "display" ? /* @__PURE__ */
|
|
2975
|
+
return control === "display" ? /* @__PURE__ */ jsx44(DisplayHeading, { size, text, className }) : /* @__PURE__ */ jsx44(StandardHeading, { size, text, className });
|
|
1633
2976
|
}
|
|
1634
2977
|
function DisplayHeading({ size, text, className }) {
|
|
1635
|
-
return /* @__PURE__ */
|
|
2978
|
+
return /* @__PURE__ */ jsx44(Display, { type: getDisplayType(size), className, children: text });
|
|
1636
2979
|
}
|
|
1637
2980
|
var getDisplayType = (size) => {
|
|
1638
2981
|
switch (size) {
|
|
@@ -1648,7 +2991,7 @@ var getDisplayType = (size) => {
|
|
|
1648
2991
|
}
|
|
1649
2992
|
};
|
|
1650
2993
|
function StandardHeading({ size, text, className }) {
|
|
1651
|
-
return /* @__PURE__ */
|
|
2994
|
+
return /* @__PURE__ */ jsx44(Title, { type: getTitleTypeBySize(size), className, children: text });
|
|
1652
2995
|
}
|
|
1653
2996
|
var getTitleTypeBySize = (size) => {
|
|
1654
2997
|
var _a;
|
|
@@ -1665,7 +3008,7 @@ var HeadingRenderer_default = HeadingRenderer;
|
|
|
1665
3008
|
|
|
1666
3009
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
1667
3010
|
import { Image } from "@transferwise/components";
|
|
1668
|
-
import { useEffect as
|
|
3011
|
+
import { useEffect as useEffect9, useState as useState7 } from "react";
|
|
1669
3012
|
|
|
1670
3013
|
// ../renderers/src/utils/api-utils.ts
|
|
1671
3014
|
function isRelativePath(url = "") {
|
|
@@ -1675,7 +3018,7 @@ function isRelativePath(url = "") {
|
|
|
1675
3018
|
}
|
|
1676
3019
|
|
|
1677
3020
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
1678
|
-
import { jsx as
|
|
3021
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
1679
3022
|
function UrlImage({
|
|
1680
3023
|
accessibilityDescription,
|
|
1681
3024
|
align,
|
|
@@ -1684,13 +3027,13 @@ function UrlImage({
|
|
|
1684
3027
|
uri,
|
|
1685
3028
|
httpClient
|
|
1686
3029
|
}) {
|
|
1687
|
-
const [imageSource, setImageSource] =
|
|
1688
|
-
|
|
3030
|
+
const [imageSource, setImageSource] = useState7("");
|
|
3031
|
+
useEffect9(() => {
|
|
1689
3032
|
if (!uri.startsWith("urn:")) {
|
|
1690
3033
|
void getImageSource(httpClient, uri).then(setImageSource);
|
|
1691
3034
|
}
|
|
1692
3035
|
}, [uri, httpClient]);
|
|
1693
|
-
return /* @__PURE__ */
|
|
3036
|
+
return /* @__PURE__ */ jsx45("div", { className: `df-image ${align} ${size || "md"} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx45(
|
|
1694
3037
|
Image,
|
|
1695
3038
|
{
|
|
1696
3039
|
className: "df-reserve-space",
|
|
@@ -1734,7 +3077,7 @@ var getImageSource = async (httpClient, imageUrl) => {
|
|
|
1734
3077
|
};
|
|
1735
3078
|
|
|
1736
3079
|
// ../renderers/src/ImageRenderer/UrnFlagImage.tsx
|
|
1737
|
-
import { jsx as
|
|
3080
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
1738
3081
|
var maxFlagSize = 600;
|
|
1739
3082
|
function UrnFlagImage({
|
|
1740
3083
|
accessibilityDescription,
|
|
@@ -1743,7 +3086,7 @@ function UrnFlagImage({
|
|
|
1743
3086
|
size,
|
|
1744
3087
|
uri
|
|
1745
3088
|
}) {
|
|
1746
|
-
return /* @__PURE__ */
|
|
3089
|
+
return /* @__PURE__ */ jsx46("div", { className: `df-image ${align} ${size || "md"} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx46(UrnFlag, { size: maxFlagSize, urn: uri, accessibilityDescription }) });
|
|
1747
3090
|
}
|
|
1748
3091
|
|
|
1749
3092
|
// ../renderers/src/ImageRenderer/UrnIllustration.tsx
|
|
@@ -1751,7 +3094,7 @@ import {
|
|
|
1751
3094
|
Illustration,
|
|
1752
3095
|
isIllustrationSupport3D
|
|
1753
3096
|
} from "@wise/art";
|
|
1754
|
-
import { useState as
|
|
3097
|
+
import { useState as useState8 } from "react";
|
|
1755
3098
|
|
|
1756
3099
|
// ../renderers/src/ImageRenderer/isAnimated.ts
|
|
1757
3100
|
var isAnimated = (uri) => {
|
|
@@ -1762,7 +3105,7 @@ var isAnimated = (uri) => {
|
|
|
1762
3105
|
// ../renderers/src/ImageRenderer/SafeIllustration3D.tsx
|
|
1763
3106
|
import { Illustration3D } from "@wise/art";
|
|
1764
3107
|
import { Component } from "react";
|
|
1765
|
-
import { jsx as
|
|
3108
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
1766
3109
|
var Illustration3DErrorBoundary = class extends Component {
|
|
1767
3110
|
constructor(props) {
|
|
1768
3111
|
super(props);
|
|
@@ -1786,12 +3129,12 @@ var SafeIllustration3D = ({
|
|
|
1786
3129
|
size,
|
|
1787
3130
|
onError
|
|
1788
3131
|
}) => {
|
|
1789
|
-
return /* @__PURE__ */
|
|
3132
|
+
return /* @__PURE__ */ jsx47(Illustration3DErrorBoundary, { onError, children: /* @__PURE__ */ jsx47(Illustration3D, { name, size }) });
|
|
1790
3133
|
};
|
|
1791
3134
|
var SafeIllustration3D_default = SafeIllustration3D;
|
|
1792
3135
|
|
|
1793
3136
|
// ../renderers/src/ImageRenderer/UrnIllustration.tsx
|
|
1794
|
-
import { jsx as
|
|
3137
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
1795
3138
|
var urnPrefix = "urn:wise:illustrations:";
|
|
1796
3139
|
var isUrnIllustration = (uri) => uri.startsWith(urnPrefix);
|
|
1797
3140
|
function UrnIllustration({
|
|
@@ -1801,12 +3144,12 @@ function UrnIllustration({
|
|
|
1801
3144
|
size,
|
|
1802
3145
|
uri
|
|
1803
3146
|
}) {
|
|
1804
|
-
const [has3DFailed, setHas3DFailed] =
|
|
3147
|
+
const [has3DFailed, setHas3DFailed] = useState8(false);
|
|
1805
3148
|
const illustrationSize = getIllustrationSize(size);
|
|
1806
3149
|
const illustrationName = getIllustrationName(uri);
|
|
1807
3150
|
const illustration3DName = getIllustration3DName(uri);
|
|
1808
3151
|
if (illustration3DName && isAnimated(uri) && !has3DFailed) {
|
|
1809
|
-
return /* @__PURE__ */
|
|
3152
|
+
return /* @__PURE__ */ jsx48("div", { className: `df-image ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx48(
|
|
1810
3153
|
SafeIllustration3D_default,
|
|
1811
3154
|
{
|
|
1812
3155
|
name: illustration3DName,
|
|
@@ -1815,7 +3158,7 @@ function UrnIllustration({
|
|
|
1815
3158
|
}
|
|
1816
3159
|
) });
|
|
1817
3160
|
}
|
|
1818
|
-
return /* @__PURE__ */
|
|
3161
|
+
return /* @__PURE__ */ jsx48("div", { className: `df-image ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx48(
|
|
1819
3162
|
Illustration,
|
|
1820
3163
|
{
|
|
1821
3164
|
className: "df-illustration",
|
|
@@ -1835,32 +3178,32 @@ var getIllustration3DName = (uri) => {
|
|
|
1835
3178
|
};
|
|
1836
3179
|
|
|
1837
3180
|
// ../renderers/src/ImageRenderer/UrnImage.tsx
|
|
1838
|
-
import { jsx as
|
|
3181
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
1839
3182
|
var isUrnImage = (uri) => uri.startsWith("urn:");
|
|
1840
3183
|
function UrnImage(props) {
|
|
1841
3184
|
const { uri } = props;
|
|
1842
3185
|
if (isUrnIllustration(uri)) {
|
|
1843
|
-
return /* @__PURE__ */
|
|
3186
|
+
return /* @__PURE__ */ jsx49(UrnIllustration, __spreadValues({}, props));
|
|
1844
3187
|
}
|
|
1845
3188
|
if (isUrnFlag(uri)) {
|
|
1846
|
-
return /* @__PURE__ */
|
|
3189
|
+
return /* @__PURE__ */ jsx49(UrnFlagImage, __spreadValues({}, props));
|
|
1847
3190
|
}
|
|
1848
3191
|
return null;
|
|
1849
3192
|
}
|
|
1850
3193
|
|
|
1851
3194
|
// ../renderers/src/ImageRenderer/ImageRenderer.tsx
|
|
1852
|
-
import { jsx as
|
|
3195
|
+
import { jsx as jsx50 } from "react/jsx-runtime";
|
|
1853
3196
|
var ImageRenderer = {
|
|
1854
3197
|
canRenderType: "image",
|
|
1855
|
-
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */
|
|
3198
|
+
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */ jsx50(UrnImage, __spreadValues({}, props)) : /* @__PURE__ */ jsx50(UrlImage, __spreadValues({}, props))
|
|
1856
3199
|
};
|
|
1857
3200
|
|
|
1858
3201
|
// ../renderers/src/ImageRenderer/index.tsx
|
|
1859
3202
|
var ImageRenderer_default = ImageRenderer;
|
|
1860
3203
|
|
|
1861
3204
|
// ../renderers/src/InstructionsRenderer.tsx
|
|
1862
|
-
import { Header as
|
|
1863
|
-
import { jsx as
|
|
3205
|
+
import { Header as Header5, InstructionsList } from "@transferwise/components";
|
|
3206
|
+
import { jsx as jsx51, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1864
3207
|
var doContext = ["positive", "neutral"];
|
|
1865
3208
|
var dontContext = ["warning", "negative"];
|
|
1866
3209
|
var InstructionsRenderer = {
|
|
@@ -1868,16 +3211,16 @@ var InstructionsRenderer = {
|
|
|
1868
3211
|
render: ({ items, margin, title }) => {
|
|
1869
3212
|
const dos = items.filter((item) => doContext.includes(item.context)).map(({ text }) => text);
|
|
1870
3213
|
const donts = items.filter((item) => dontContext.includes(item.context)).map(({ text }) => text);
|
|
1871
|
-
return /* @__PURE__ */
|
|
1872
|
-
title ? /* @__PURE__ */
|
|
1873
|
-
/* @__PURE__ */
|
|
3214
|
+
return /* @__PURE__ */ jsxs12("div", { className: getMargin(margin), children: [
|
|
3215
|
+
title ? /* @__PURE__ */ jsx51(Header5, { title }) : null,
|
|
3216
|
+
/* @__PURE__ */ jsx51(InstructionsList, { dos, donts })
|
|
1874
3217
|
] });
|
|
1875
3218
|
}
|
|
1876
3219
|
};
|
|
1877
3220
|
var InstructionsRenderer_default = InstructionsRenderer;
|
|
1878
3221
|
|
|
1879
3222
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
1880
|
-
import { Input, InputGroup } from "@transferwise/components";
|
|
3223
|
+
import { Input as Input2, InputGroup as InputGroup2 } from "@transferwise/components";
|
|
1881
3224
|
|
|
1882
3225
|
// ../renderers/src/utils/input-utils.ts
|
|
1883
3226
|
var onWheel = (event) => {
|
|
@@ -1902,7 +3245,7 @@ function pick(obj, ...keys) {
|
|
|
1902
3245
|
}
|
|
1903
3246
|
|
|
1904
3247
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
1905
|
-
import { jsx as
|
|
3248
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
1906
3249
|
var IntegerInputRenderer = {
|
|
1907
3250
|
canRenderType: "input-integer",
|
|
1908
3251
|
render: (props) => {
|
|
@@ -1917,7 +3260,7 @@ var IntegerInputRenderer = {
|
|
|
1917
3260
|
"maximum",
|
|
1918
3261
|
"minimum"
|
|
1919
3262
|
);
|
|
1920
|
-
return /* @__PURE__ */
|
|
3263
|
+
return /* @__PURE__ */ jsx52(
|
|
1921
3264
|
FieldInput_default,
|
|
1922
3265
|
{
|
|
1923
3266
|
id,
|
|
@@ -1928,8 +3271,8 @@ var IntegerInputRenderer = {
|
|
|
1928
3271
|
loadingState: props.fieldLoadingState,
|
|
1929
3272
|
help,
|
|
1930
3273
|
features: props.features,
|
|
1931
|
-
children: /* @__PURE__ */
|
|
1932
|
-
|
|
3274
|
+
children: /* @__PURE__ */ jsx52(InputGroup2, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ jsx52(
|
|
3275
|
+
Input2,
|
|
1933
3276
|
__spreadValues({
|
|
1934
3277
|
id,
|
|
1935
3278
|
name: id,
|
|
@@ -1951,39 +3294,12 @@ var IntegerInputRenderer = {
|
|
|
1951
3294
|
var IntegerInputRenderer_default = IntegerInputRenderer;
|
|
1952
3295
|
|
|
1953
3296
|
// ../renderers/src/ListRenderer.tsx
|
|
1954
|
-
import { ListItem as
|
|
1955
|
-
|
|
1956
|
-
// ../renderers/src/utils/listItem/getCTAControl.tsx
|
|
1957
|
-
import { ListItem as ListItem6 } from "@transferwise/components";
|
|
1958
|
-
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
1959
|
-
var getCTAControl = (callToAction, { ctaSecondary, fullyInteractive }) => {
|
|
1960
|
-
if (!callToAction) {
|
|
1961
|
-
return void 0;
|
|
1962
|
-
}
|
|
1963
|
-
const { accessibilityDescription, title, context } = callToAction;
|
|
1964
|
-
const { priority, sentiment } = getPriorityAndSentiment(ctaSecondary, context);
|
|
1965
|
-
return /* @__PURE__ */ jsx44(
|
|
1966
|
-
ListItem6.Button,
|
|
1967
|
-
__spreadProps(__spreadValues({}, callToAction.getAnchorProps()), {
|
|
1968
|
-
partiallyInteractive: !fullyInteractive,
|
|
1969
|
-
priority,
|
|
1970
|
-
"aria-description": accessibilityDescription,
|
|
1971
|
-
sentiment,
|
|
1972
|
-
children: title
|
|
1973
|
-
})
|
|
1974
|
-
);
|
|
1975
|
-
};
|
|
1976
|
-
var getPriorityAndSentiment = (ctaSecondary, context) => {
|
|
1977
|
-
if (context === "negative") {
|
|
1978
|
-
return { priority: "secondary", sentiment: "negative" };
|
|
1979
|
-
}
|
|
1980
|
-
return { priority: ctaSecondary ? "secondary" : "secondary-neutral", sentiment: "default" };
|
|
1981
|
-
};
|
|
3297
|
+
import { ListItem as ListItem8 } from "@transferwise/components";
|
|
1982
3298
|
|
|
1983
3299
|
// ../renderers/src/components/Header.tsx
|
|
1984
3300
|
import { Header as DSHeader } from "@transferwise/components";
|
|
1985
|
-
import { jsx as
|
|
1986
|
-
var
|
|
3301
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
3302
|
+
var Header = ({ title, callToAction }) => (title || callToAction) && /* @__PURE__ */ jsx53(DSHeader, { title: title != null ? title : "", action: getHeaderAction(callToAction) });
|
|
1987
3303
|
var getHeaderAction = (callToAction) => {
|
|
1988
3304
|
if (!callToAction) {
|
|
1989
3305
|
return void 0;
|
|
@@ -1995,11 +3311,11 @@ var getHeaderAction = (callToAction) => {
|
|
|
1995
3311
|
};
|
|
1996
3312
|
|
|
1997
3313
|
// ../renderers/src/ListRenderer.tsx
|
|
1998
|
-
import { jsx as
|
|
3314
|
+
import { jsx as jsx54, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1999
3315
|
var ListRenderer = {
|
|
2000
3316
|
canRenderType: "list",
|
|
2001
|
-
render: ({ callToAction, control, margin, items, tags, title }) => /* @__PURE__ */
|
|
2002
|
-
/* @__PURE__ */
|
|
3317
|
+
render: ({ callToAction, control, margin, items, tags, title }) => /* @__PURE__ */ jsxs13("div", { className: getMargin(margin), children: [
|
|
3318
|
+
/* @__PURE__ */ jsx54(Header, { title, callToAction }),
|
|
2003
3319
|
items.map((item) => {
|
|
2004
3320
|
var _a, _b;
|
|
2005
3321
|
const {
|
|
@@ -2016,8 +3332,8 @@ var ListRenderer = {
|
|
|
2016
3332
|
ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
|
|
2017
3333
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
2018
3334
|
};
|
|
2019
|
-
return /* @__PURE__ */
|
|
2020
|
-
|
|
3335
|
+
return /* @__PURE__ */ jsx54(
|
|
3336
|
+
ListItem8,
|
|
2021
3337
|
{
|
|
2022
3338
|
title: itemTitle,
|
|
2023
3339
|
subtitle: description,
|
|
@@ -2037,10 +3353,10 @@ var ListRenderer_default = ListRenderer;
|
|
|
2037
3353
|
|
|
2038
3354
|
// ../renderers/src/LoadingIndicatorRenderer.tsx
|
|
2039
3355
|
import { Loader } from "@transferwise/components";
|
|
2040
|
-
import { jsx as
|
|
3356
|
+
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
2041
3357
|
var LoadingIndicatorRenderer = {
|
|
2042
3358
|
canRenderType: "loading-indicator",
|
|
2043
|
-
render: ({ margin, size }) => /* @__PURE__ */
|
|
3359
|
+
render: ({ margin, size }) => /* @__PURE__ */ jsx55(
|
|
2044
3360
|
Loader,
|
|
2045
3361
|
{
|
|
2046
3362
|
size,
|
|
@@ -2054,10 +3370,10 @@ var LoadingIndicatorRenderer_default = LoadingIndicatorRenderer;
|
|
|
2054
3370
|
// ../renderers/src/MarkdownRenderer.tsx
|
|
2055
3371
|
import { Markdown as Markdown3 } from "@transferwise/components";
|
|
2056
3372
|
var import_classnames4 = __toESM(require_classnames());
|
|
2057
|
-
import { jsx as
|
|
3373
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
2058
3374
|
var MarkdownRenderer = {
|
|
2059
3375
|
canRenderType: "markdown",
|
|
2060
|
-
render: ({ content, align, margin, size }) => /* @__PURE__ */
|
|
3376
|
+
render: ({ content, align, margin, size }) => /* @__PURE__ */ jsx56("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ jsx56(
|
|
2061
3377
|
Markdown3,
|
|
2062
3378
|
{
|
|
2063
3379
|
className: (0, import_classnames4.default)(
|
|
@@ -2072,16 +3388,16 @@ var MarkdownRenderer = {
|
|
|
2072
3388
|
var MarkdownRenderer_default = MarkdownRenderer;
|
|
2073
3389
|
|
|
2074
3390
|
// ../renderers/src/MediaRenderer.tsx
|
|
2075
|
-
import { jsx as
|
|
3391
|
+
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
2076
3392
|
var MediaRenderer = {
|
|
2077
3393
|
canRenderType: "media",
|
|
2078
3394
|
render: (_a) => {
|
|
2079
3395
|
var _b = _a, { media } = _b, rest = __objRest(_b, ["media"]);
|
|
2080
3396
|
switch (media.type) {
|
|
2081
3397
|
case "avatar":
|
|
2082
|
-
return /* @__PURE__ */
|
|
3398
|
+
return /* @__PURE__ */ jsx57(AvatarMediaRendererComponent, __spreadValues({ media }, rest));
|
|
2083
3399
|
case "image":
|
|
2084
|
-
return /* @__PURE__ */
|
|
3400
|
+
return /* @__PURE__ */ jsx57(ImageMediaRendererComponent, __spreadValues({ media }, rest));
|
|
2085
3401
|
case "legacy":
|
|
2086
3402
|
return null;
|
|
2087
3403
|
}
|
|
@@ -2093,7 +3409,7 @@ var AvatarMediaRendererComponent = ({
|
|
|
2093
3409
|
margin,
|
|
2094
3410
|
size
|
|
2095
3411
|
}) => {
|
|
2096
|
-
return /* @__PURE__ */
|
|
3412
|
+
return /* @__PURE__ */ jsx57("div", { className: `df-media-layout-avatar ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx57(Media, { media, size: mapAvatarMediaSize(size) }) });
|
|
2097
3413
|
};
|
|
2098
3414
|
var ImageMediaRendererComponent = (_a) => {
|
|
2099
3415
|
var _b = _a, {
|
|
@@ -2101,7 +3417,7 @@ var ImageMediaRendererComponent = (_a) => {
|
|
|
2101
3417
|
} = _b, rest = __objRest(_b, [
|
|
2102
3418
|
"media"
|
|
2103
3419
|
]);
|
|
2104
|
-
return isUrnImage(media.uri) ? /* @__PURE__ */
|
|
3420
|
+
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));
|
|
2105
3421
|
};
|
|
2106
3422
|
var mapAvatarMediaSize = (size) => {
|
|
2107
3423
|
switch (size) {
|
|
@@ -2119,20 +3435,20 @@ var mapAvatarMediaSize = (size) => {
|
|
|
2119
3435
|
};
|
|
2120
3436
|
|
|
2121
3437
|
// ../renderers/src/ModalLayoutRenderer.tsx
|
|
2122
|
-
import { Button as
|
|
2123
|
-
import { useState as
|
|
2124
|
-
import { jsx as
|
|
3438
|
+
import { Button as Button6, Modal as Modal2 } from "@transferwise/components";
|
|
3439
|
+
import { useState as useState9 } from "react";
|
|
3440
|
+
import { jsx as jsx58, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2125
3441
|
var ModalLayoutRenderer = {
|
|
2126
3442
|
canRenderType: "modal-layout",
|
|
2127
|
-
render: (props) => /* @__PURE__ */
|
|
3443
|
+
render: (props) => /* @__PURE__ */ jsx58(DFModal, __spreadValues({}, props))
|
|
2128
3444
|
};
|
|
2129
3445
|
var ModalLayoutRenderer_default = ModalLayoutRenderer;
|
|
2130
3446
|
function DFModal({ content, margin, trigger }) {
|
|
2131
|
-
const [visible, setVisible] =
|
|
3447
|
+
const [visible, setVisible] = useState9(false);
|
|
2132
3448
|
const { children, title } = content;
|
|
2133
|
-
return /* @__PURE__ */
|
|
2134
|
-
/* @__PURE__ */
|
|
2135
|
-
/* @__PURE__ */
|
|
3449
|
+
return /* @__PURE__ */ jsxs14("div", { className: getMargin(margin), children: [
|
|
3450
|
+
/* @__PURE__ */ jsx58(Button6, { v2: true, priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
|
|
3451
|
+
/* @__PURE__ */ jsx58(
|
|
2136
3452
|
Modal2,
|
|
2137
3453
|
{
|
|
2138
3454
|
scroll: "content",
|
|
@@ -2148,19 +3464,19 @@ function DFModal({ content, margin, trigger }) {
|
|
|
2148
3464
|
|
|
2149
3465
|
// ../renderers/src/ModalRenderer.tsx
|
|
2150
3466
|
import { Modal as Modal3 } from "@transferwise/components";
|
|
2151
|
-
import { jsx as
|
|
3467
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
2152
3468
|
var ModalRenderer = {
|
|
2153
3469
|
canRenderType: "modal",
|
|
2154
3470
|
render: ({ title, children, open, onClose }) => {
|
|
2155
|
-
return /* @__PURE__ */
|
|
3471
|
+
return /* @__PURE__ */ jsx59(Modal3, { open, title, body: children, onClose });
|
|
2156
3472
|
}
|
|
2157
3473
|
};
|
|
2158
3474
|
|
|
2159
3475
|
// ../renderers/src/MoneyInputRenderer.tsx
|
|
2160
3476
|
import { MoneyInput } from "@transferwise/components";
|
|
2161
|
-
import { useEffect as
|
|
2162
|
-
import { useIntl as
|
|
2163
|
-
import { jsx as
|
|
3477
|
+
import { useEffect as useEffect10 } from "react";
|
|
3478
|
+
import { useIntl as useIntl7 } from "react-intl";
|
|
3479
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
2164
3480
|
var groupingTags2 = Object.keys(group_messages_default).filter((key) => key !== "all");
|
|
2165
3481
|
var MoneyInputRenderer = {
|
|
2166
3482
|
canRenderType: "money-input",
|
|
@@ -2181,13 +3497,13 @@ function MoneyInputRendererComponent(props) {
|
|
|
2181
3497
|
onAmountChange,
|
|
2182
3498
|
onCurrencyChange
|
|
2183
3499
|
} = props;
|
|
2184
|
-
|
|
3500
|
+
useEffect10(() => {
|
|
2185
3501
|
if (!isValidIndex(selectedCurrencyIndex, currencies.length)) {
|
|
2186
3502
|
onCurrencyChange(0);
|
|
2187
3503
|
}
|
|
2188
3504
|
}, [selectedCurrencyIndex, onCurrencyChange, currencies.length]);
|
|
2189
|
-
const { formatMessage } =
|
|
2190
|
-
return /* @__PURE__ */
|
|
3505
|
+
const { formatMessage } = useIntl7();
|
|
3506
|
+
return /* @__PURE__ */ jsx60(
|
|
2191
3507
|
FieldInput_default,
|
|
2192
3508
|
{
|
|
2193
3509
|
id: uid,
|
|
@@ -2196,7 +3512,7 @@ function MoneyInputRendererComponent(props) {
|
|
|
2196
3512
|
validation: validationState,
|
|
2197
3513
|
help,
|
|
2198
3514
|
features: props.features,
|
|
2199
|
-
children: /* @__PURE__ */
|
|
3515
|
+
children: /* @__PURE__ */ jsx60(
|
|
2200
3516
|
MoneyInput,
|
|
2201
3517
|
{
|
|
2202
3518
|
amount: parseFloatOrNull(amountValue),
|
|
@@ -2258,8 +3574,8 @@ function assertCurrencyCodeIsString(currencyCode) {
|
|
|
2258
3574
|
}
|
|
2259
3575
|
|
|
2260
3576
|
// ../renderers/src/MultiSelectInputRenderer/InlineComponent.tsx
|
|
2261
|
-
import { ListItem as
|
|
2262
|
-
import { jsx as
|
|
3577
|
+
import { ListItem as ListItem9 } from "@transferwise/components";
|
|
3578
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
2263
3579
|
function InlineComponent(props) {
|
|
2264
3580
|
const {
|
|
2265
3581
|
id,
|
|
@@ -2273,7 +3589,7 @@ function InlineComponent(props) {
|
|
|
2273
3589
|
validationState,
|
|
2274
3590
|
onSelect
|
|
2275
3591
|
} = props;
|
|
2276
|
-
return /* @__PURE__ */
|
|
3592
|
+
return /* @__PURE__ */ jsx61(
|
|
2277
3593
|
FieldInput_default,
|
|
2278
3594
|
{
|
|
2279
3595
|
id,
|
|
@@ -2295,8 +3611,8 @@ function InlineComponent(props) {
|
|
|
2295
3611
|
childrenProps
|
|
2296
3612
|
} = option;
|
|
2297
3613
|
const key = (_a = childrenProps == null ? void 0 : childrenProps.uid) != null ? _a : index;
|
|
2298
|
-
return /* @__PURE__ */
|
|
2299
|
-
|
|
3614
|
+
return /* @__PURE__ */ jsx61(
|
|
3615
|
+
ListItem9,
|
|
2300
3616
|
{
|
|
2301
3617
|
title: itemTitle,
|
|
2302
3618
|
subtitle,
|
|
@@ -2304,10 +3620,10 @@ function InlineComponent(props) {
|
|
|
2304
3620
|
valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
|
|
2305
3621
|
media: getMedia(media, false),
|
|
2306
3622
|
prompt: getInlineAlert(inlineAlert),
|
|
2307
|
-
additionalInfo: additionalText ? /* @__PURE__ */
|
|
3623
|
+
additionalInfo: additionalText ? /* @__PURE__ */ jsx61(ListItem9.AdditionalInfo, { children: additionalText }) : void 0,
|
|
2308
3624
|
disabled: disabled || optionDisabled,
|
|
2309
|
-
control: /* @__PURE__ */
|
|
2310
|
-
|
|
3625
|
+
control: /* @__PURE__ */ jsx61(
|
|
3626
|
+
ListItem9.Checkbox,
|
|
2311
3627
|
{
|
|
2312
3628
|
checked: selectedIndices.includes(index),
|
|
2313
3629
|
onChange: (e) => {
|
|
@@ -2326,12 +3642,12 @@ function InlineComponent(props) {
|
|
|
2326
3642
|
|
|
2327
3643
|
// ../renderers/src/MultiSelectInputRenderer/DefaultComponent.tsx
|
|
2328
3644
|
import { SelectInput, SelectInputOptionContent } from "@transferwise/components";
|
|
2329
|
-
import { useState as
|
|
2330
|
-
import { useIntl as
|
|
3645
|
+
import { useState as useState10 } from "react";
|
|
3646
|
+
import { useIntl as useIntl8 } from "react-intl";
|
|
2331
3647
|
|
|
2332
3648
|
// ../renderers/src/messages/multi-select.messages.ts
|
|
2333
|
-
import { defineMessages as
|
|
2334
|
-
var multi_select_messages_default =
|
|
3649
|
+
import { defineMessages as defineMessages7 } from "react-intl";
|
|
3650
|
+
var multi_select_messages_default = defineMessages7({
|
|
2335
3651
|
summary: {
|
|
2336
3652
|
id: "df.wise.MultiSelect.summary",
|
|
2337
3653
|
defaultMessage: "{first} and {count} more",
|
|
@@ -2340,10 +3656,10 @@ var multi_select_messages_default = defineMessages6({
|
|
|
2340
3656
|
});
|
|
2341
3657
|
|
|
2342
3658
|
// ../renderers/src/MultiSelectInputRenderer/DefaultComponent.tsx
|
|
2343
|
-
import { jsx as
|
|
3659
|
+
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
2344
3660
|
function DefaultComponent(props) {
|
|
2345
|
-
const { formatMessage } =
|
|
2346
|
-
const [stagedIndices, setStagedIndices] =
|
|
3661
|
+
const { formatMessage } = useIntl8();
|
|
3662
|
+
const [stagedIndices, setStagedIndices] = useState10();
|
|
2347
3663
|
const {
|
|
2348
3664
|
id,
|
|
2349
3665
|
autoComplete,
|
|
@@ -2382,12 +3698,12 @@ function DefaultComponent(props) {
|
|
|
2382
3698
|
const contentProps = {
|
|
2383
3699
|
title: option.title,
|
|
2384
3700
|
description: option.description,
|
|
2385
|
-
icon: /* @__PURE__ */
|
|
3701
|
+
icon: /* @__PURE__ */ jsx62(OptionMedia, { media: option.media, preferAvatar: false })
|
|
2386
3702
|
};
|
|
2387
|
-
return /* @__PURE__ */
|
|
3703
|
+
return /* @__PURE__ */ jsx62(SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
2388
3704
|
};
|
|
2389
3705
|
const extraProps = { autoComplete };
|
|
2390
|
-
return /* @__PURE__ */
|
|
3706
|
+
return /* @__PURE__ */ jsx62(
|
|
2391
3707
|
FieldInput_default,
|
|
2392
3708
|
{
|
|
2393
3709
|
id,
|
|
@@ -2396,7 +3712,7 @@ function DefaultComponent(props) {
|
|
|
2396
3712
|
description,
|
|
2397
3713
|
validation: validationState,
|
|
2398
3714
|
features,
|
|
2399
|
-
children: /* @__PURE__ */
|
|
3715
|
+
children: /* @__PURE__ */ jsx62(
|
|
2400
3716
|
SelectInput,
|
|
2401
3717
|
__spreadValues({
|
|
2402
3718
|
id,
|
|
@@ -2436,7 +3752,7 @@ function DefaultComponent(props) {
|
|
|
2436
3752
|
|
|
2437
3753
|
// ../renderers/src/MultiSelectInputRenderer/InlineCheckboxComponent.tsx
|
|
2438
3754
|
import { Checkbox as Checkbox2 } from "@transferwise/components";
|
|
2439
|
-
import { jsx as
|
|
3755
|
+
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
2440
3756
|
function InlineCheckboxComponent(props) {
|
|
2441
3757
|
const {
|
|
2442
3758
|
id,
|
|
@@ -2450,7 +3766,7 @@ function InlineCheckboxComponent(props) {
|
|
|
2450
3766
|
validationState,
|
|
2451
3767
|
onSelect
|
|
2452
3768
|
} = props;
|
|
2453
|
-
return /* @__PURE__ */
|
|
3769
|
+
return /* @__PURE__ */ jsx63(
|
|
2454
3770
|
FieldInput_default,
|
|
2455
3771
|
{
|
|
2456
3772
|
id,
|
|
@@ -2479,24 +3795,24 @@ function InlineCheckboxComponent(props) {
|
|
|
2479
3795
|
onSelect(newSelectedIndices);
|
|
2480
3796
|
}
|
|
2481
3797
|
};
|
|
2482
|
-
return /* @__PURE__ */
|
|
3798
|
+
return /* @__PURE__ */ jsx63(Checkbox2, __spreadProps(__spreadValues({}, checkboxProps), { className: "m-t-1" }), key);
|
|
2483
3799
|
})
|
|
2484
3800
|
}
|
|
2485
3801
|
);
|
|
2486
3802
|
}
|
|
2487
3803
|
|
|
2488
3804
|
// ../renderers/src/MultiSelectInputRenderer/MultiSelectInputRenderer.tsx
|
|
2489
|
-
import { jsx as
|
|
3805
|
+
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
2490
3806
|
var MultiSelectInputRenderer = {
|
|
2491
3807
|
canRenderType: "input-multi-select",
|
|
2492
3808
|
render: (props) => {
|
|
2493
3809
|
switch (props.control) {
|
|
2494
3810
|
case "inline":
|
|
2495
|
-
return /* @__PURE__ */
|
|
3811
|
+
return /* @__PURE__ */ jsx64(InlineComponent, __spreadValues({}, props));
|
|
2496
3812
|
case "inline-checkbox-group":
|
|
2497
|
-
return /* @__PURE__ */
|
|
3813
|
+
return /* @__PURE__ */ jsx64(InlineCheckboxComponent, __spreadValues({}, props));
|
|
2498
3814
|
default:
|
|
2499
|
-
return /* @__PURE__ */
|
|
3815
|
+
return /* @__PURE__ */ jsx64(DefaultComponent, __spreadValues({}, props));
|
|
2500
3816
|
}
|
|
2501
3817
|
}
|
|
2502
3818
|
};
|
|
@@ -2507,7 +3823,7 @@ import { Status, UploadInput } from "@transferwise/components";
|
|
|
2507
3823
|
// ../renderers/src/components/UploadFieldInput.tsx
|
|
2508
3824
|
var import_classnames5 = __toESM(require_classnames());
|
|
2509
3825
|
import { InlineAlert as InlineAlert2 } from "@transferwise/components";
|
|
2510
|
-
import { jsx as
|
|
3826
|
+
import { jsx as jsx65, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2511
3827
|
function UploadFieldInput({
|
|
2512
3828
|
id,
|
|
2513
3829
|
children,
|
|
@@ -2517,10 +3833,10 @@ function UploadFieldInput({
|
|
|
2517
3833
|
validation,
|
|
2518
3834
|
features
|
|
2519
3835
|
}) {
|
|
2520
|
-
const labelContent = label && help ? /* @__PURE__ */
|
|
3836
|
+
const labelContent = label && help ? /* @__PURE__ */ jsx65(LabelContentWithHelp, { text: label, help }) : label;
|
|
2521
3837
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
2522
3838
|
const { ref } = useScrollToError(validation, features);
|
|
2523
|
-
return /* @__PURE__ */
|
|
3839
|
+
return /* @__PURE__ */ jsxs15(
|
|
2524
3840
|
"div",
|
|
2525
3841
|
{
|
|
2526
3842
|
ref,
|
|
@@ -2528,9 +3844,9 @@ function UploadFieldInput({
|
|
|
2528
3844
|
"has-error": (validation == null ? void 0 : validation.status) === "invalid"
|
|
2529
3845
|
}),
|
|
2530
3846
|
children: [
|
|
2531
|
-
/* @__PURE__ */
|
|
3847
|
+
/* @__PURE__ */ jsx65("label", { htmlFor: id, className: "control-label", children: labelContent }),
|
|
2532
3848
|
children,
|
|
2533
|
-
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */
|
|
3849
|
+
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ jsx65(InlineAlert2, { type: "negative", id: descriptionId, children: validation.message })
|
|
2534
3850
|
]
|
|
2535
3851
|
}
|
|
2536
3852
|
);
|
|
@@ -2565,7 +3881,7 @@ var getSizeLimit = (maxSize) => {
|
|
|
2565
3881
|
};
|
|
2566
3882
|
|
|
2567
3883
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
2568
|
-
import { jsx as
|
|
3884
|
+
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
2569
3885
|
var MultiUploadInputRenderer = {
|
|
2570
3886
|
canRenderType: "input-upload-multi",
|
|
2571
3887
|
render: (props) => {
|
|
@@ -2591,7 +3907,7 @@ var MultiUploadInputRenderer = {
|
|
|
2591
3907
|
};
|
|
2592
3908
|
const onDeleteFile = async (fileId) => onRemoveFile(value.findIndex((file) => file.id === fileId));
|
|
2593
3909
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
2594
|
-
return /* @__PURE__ */
|
|
3910
|
+
return /* @__PURE__ */ jsx66(
|
|
2595
3911
|
UploadFieldInput_default,
|
|
2596
3912
|
{
|
|
2597
3913
|
id,
|
|
@@ -2600,7 +3916,7 @@ var MultiUploadInputRenderer = {
|
|
|
2600
3916
|
validation: validationState,
|
|
2601
3917
|
help,
|
|
2602
3918
|
features,
|
|
2603
|
-
children: /* @__PURE__ */
|
|
3919
|
+
children: /* @__PURE__ */ jsx66(
|
|
2604
3920
|
UploadInput,
|
|
2605
3921
|
{
|
|
2606
3922
|
id,
|
|
@@ -2628,8 +3944,8 @@ var MultiUploadInputRenderer = {
|
|
|
2628
3944
|
var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
|
|
2629
3945
|
|
|
2630
3946
|
// ../renderers/src/NumberInputRenderer.tsx
|
|
2631
|
-
import { Input as
|
|
2632
|
-
import { jsx as
|
|
3947
|
+
import { Input as Input3, InputGroup as InputGroup3 } from "@transferwise/components";
|
|
3948
|
+
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
2633
3949
|
var NumberInputRenderer = {
|
|
2634
3950
|
canRenderType: "input-number",
|
|
2635
3951
|
render: (props) => {
|
|
@@ -2643,7 +3959,7 @@ var NumberInputRenderer = {
|
|
|
2643
3959
|
"maximum",
|
|
2644
3960
|
"minimum"
|
|
2645
3961
|
);
|
|
2646
|
-
return /* @__PURE__ */
|
|
3962
|
+
return /* @__PURE__ */ jsx67(
|
|
2647
3963
|
FieldInput_default,
|
|
2648
3964
|
{
|
|
2649
3965
|
id,
|
|
@@ -2654,8 +3970,8 @@ var NumberInputRenderer = {
|
|
|
2654
3970
|
loadingState: props.fieldLoadingState,
|
|
2655
3971
|
help,
|
|
2656
3972
|
features: props.features,
|
|
2657
|
-
children: /* @__PURE__ */
|
|
2658
|
-
|
|
3973
|
+
children: /* @__PURE__ */ jsx67(InputGroup3, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ jsx67(
|
|
3974
|
+
Input3,
|
|
2659
3975
|
__spreadValues({
|
|
2660
3976
|
id,
|
|
2661
3977
|
name: id,
|
|
@@ -2675,7 +3991,7 @@ var NumberInputRenderer = {
|
|
|
2675
3991
|
var NumberInputRenderer_default = NumberInputRenderer;
|
|
2676
3992
|
|
|
2677
3993
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
2678
|
-
import { useIntl as
|
|
3994
|
+
import { useIntl as useIntl9 } from "react-intl";
|
|
2679
3995
|
|
|
2680
3996
|
// ../renderers/src/hooks/useSnackBarIfAvailable.ts
|
|
2681
3997
|
import { SnackbarContext } from "@transferwise/components";
|
|
@@ -2688,11 +4004,11 @@ function useSnackBarIfAvailable() {
|
|
|
2688
4004
|
|
|
2689
4005
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
2690
4006
|
var import_classnames6 = __toESM(require_classnames());
|
|
2691
|
-
import { Button as
|
|
4007
|
+
import { Button as Button7, Input as Input4 } from "@transferwise/components";
|
|
2692
4008
|
|
|
2693
4009
|
// ../renderers/src/messages/paragraph.messages.ts
|
|
2694
|
-
import { defineMessages as
|
|
2695
|
-
var paragraph_messages_default =
|
|
4010
|
+
import { defineMessages as defineMessages8 } from "react-intl";
|
|
4011
|
+
var paragraph_messages_default = defineMessages8({
|
|
2696
4012
|
copy: {
|
|
2697
4013
|
id: "df.wise.DynamicParagraph.copy",
|
|
2698
4014
|
defaultMessage: "Copy",
|
|
@@ -2706,14 +4022,14 @@ var paragraph_messages_default = defineMessages7({
|
|
|
2706
4022
|
});
|
|
2707
4023
|
|
|
2708
4024
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
2709
|
-
import { jsx as
|
|
4025
|
+
import { jsx as jsx68, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2710
4026
|
var ParagraphRenderer = {
|
|
2711
4027
|
canRenderType: "paragraph",
|
|
2712
|
-
render: (props) => /* @__PURE__ */
|
|
4028
|
+
render: (props) => /* @__PURE__ */ jsx68(Paragraph, __spreadValues({}, props))
|
|
2713
4029
|
};
|
|
2714
4030
|
function Paragraph({ align, control, margin, size, text }) {
|
|
2715
4031
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
2716
|
-
return control === "copyable" ? /* @__PURE__ */
|
|
4032
|
+
return control === "copyable" ? /* @__PURE__ */ jsx68(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ jsx68(
|
|
2717
4033
|
"p",
|
|
2718
4034
|
{
|
|
2719
4035
|
className: `${["xs", "sm"].includes(size) ? "np-text-body-default" : "np-text-body-large"} ${className}`,
|
|
@@ -2726,16 +4042,16 @@ function CopyableParagraph({
|
|
|
2726
4042
|
align,
|
|
2727
4043
|
className
|
|
2728
4044
|
}) {
|
|
2729
|
-
const { formatMessage } =
|
|
4045
|
+
const { formatMessage } = useIntl9();
|
|
2730
4046
|
const createSnackbar = useSnackBarIfAvailable();
|
|
2731
4047
|
const copy = () => {
|
|
2732
4048
|
navigator.clipboard.writeText(text).then(() => createSnackbar({ text: formatMessage(paragraph_messages_default.copied) })).catch(() => {
|
|
2733
4049
|
});
|
|
2734
4050
|
};
|
|
2735
4051
|
const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
|
|
2736
|
-
return /* @__PURE__ */
|
|
2737
|
-
/* @__PURE__ */
|
|
2738
|
-
|
|
4052
|
+
return /* @__PURE__ */ jsxs16("div", { className, children: [
|
|
4053
|
+
/* @__PURE__ */ jsx68(
|
|
4054
|
+
Input4,
|
|
2739
4055
|
{
|
|
2740
4056
|
type: "text",
|
|
2741
4057
|
value: text,
|
|
@@ -2743,23 +4059,23 @@ function CopyableParagraph({
|
|
|
2743
4059
|
className: (0, import_classnames6.default)("text-ellipsis", inputAlignmentClasses)
|
|
2744
4060
|
}
|
|
2745
4061
|
),
|
|
2746
|
-
/* @__PURE__ */
|
|
4062
|
+
/* @__PURE__ */ jsx68(Button7, { v2: true, block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
2747
4063
|
] });
|
|
2748
4064
|
}
|
|
2749
4065
|
var ParagraphRenderer_default = ParagraphRenderer;
|
|
2750
4066
|
|
|
2751
4067
|
// ../renderers/src/ProgressRenderer.tsx
|
|
2752
4068
|
import { ProgressBar } from "@transferwise/components";
|
|
2753
|
-
import { jsx as
|
|
4069
|
+
import { jsx as jsx69 } from "react/jsx-runtime";
|
|
2754
4070
|
var ProgressRenderer = {
|
|
2755
4071
|
canRenderType: "progress",
|
|
2756
4072
|
render: ({ uid, title, help, progress, progressText, margin, description }) => {
|
|
2757
|
-
return /* @__PURE__ */
|
|
4073
|
+
return /* @__PURE__ */ jsx69(
|
|
2758
4074
|
ProgressBar,
|
|
2759
4075
|
{
|
|
2760
4076
|
id: uid,
|
|
2761
4077
|
className: getMargin(margin),
|
|
2762
|
-
title: title && help ? /* @__PURE__ */
|
|
4078
|
+
title: title && help ? /* @__PURE__ */ jsx69(LabelContentWithHelp, { text: title, help }) : title,
|
|
2763
4079
|
description,
|
|
2764
4080
|
progress: {
|
|
2765
4081
|
max: 1,
|
|
@@ -2773,14 +4089,14 @@ var ProgressRenderer = {
|
|
|
2773
4089
|
|
|
2774
4090
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
2775
4091
|
var import_classnames7 = __toESM(require_classnames());
|
|
2776
|
-
import { Button as
|
|
4092
|
+
import { Button as Button8, Header as Header6, InlineAlert as InlineAlert3, Modal as Modal4, NavigationOption } from "@transferwise/components";
|
|
2777
4093
|
import { Plus } from "@transferwise/icons";
|
|
2778
|
-
import { useState as
|
|
2779
|
-
import { useIntl as
|
|
4094
|
+
import { useState as useState11 } from "react";
|
|
4095
|
+
import { useIntl as useIntl10 } from "react-intl";
|
|
2780
4096
|
|
|
2781
4097
|
// ../renderers/src/messages/repeatable.messages.ts
|
|
2782
|
-
import { defineMessages as
|
|
2783
|
-
var repeatable_messages_default =
|
|
4098
|
+
import { defineMessages as defineMessages9 } from "react-intl";
|
|
4099
|
+
var repeatable_messages_default = defineMessages9({
|
|
2784
4100
|
addItemTitle: {
|
|
2785
4101
|
id: "df.wise.ArraySchema.addItemTitle",
|
|
2786
4102
|
defaultMessage: "Add Item",
|
|
@@ -2804,10 +4120,10 @@ var repeatable_messages_default = defineMessages8({
|
|
|
2804
4120
|
});
|
|
2805
4121
|
|
|
2806
4122
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
2807
|
-
import { Fragment as
|
|
4123
|
+
import { Fragment as Fragment7, jsx as jsx70, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2808
4124
|
var RepeatableRenderer = {
|
|
2809
4125
|
canRenderType: "repeatable",
|
|
2810
|
-
render: (props) => /* @__PURE__ */
|
|
4126
|
+
render: (props) => /* @__PURE__ */ jsx70(Repeatable, __spreadValues({}, props))
|
|
2811
4127
|
};
|
|
2812
4128
|
function Repeatable(props) {
|
|
2813
4129
|
const {
|
|
@@ -2824,8 +4140,8 @@ function Repeatable(props) {
|
|
|
2824
4140
|
onSave,
|
|
2825
4141
|
onRemove
|
|
2826
4142
|
} = props;
|
|
2827
|
-
const { formatMessage } =
|
|
2828
|
-
const [openModalType, setOpenModalType] =
|
|
4143
|
+
const { formatMessage } = useIntl10();
|
|
4144
|
+
const [openModalType, setOpenModalType] = useState11(null);
|
|
2829
4145
|
const { ref } = useScrollToError(validationState, features);
|
|
2830
4146
|
const onAddItem = () => {
|
|
2831
4147
|
onAdd();
|
|
@@ -2848,43 +4164,43 @@ function Repeatable(props) {
|
|
|
2848
4164
|
const onCancelEdit = () => {
|
|
2849
4165
|
setOpenModalType(null);
|
|
2850
4166
|
};
|
|
2851
|
-
return /* @__PURE__ */
|
|
2852
|
-
/* @__PURE__ */
|
|
2853
|
-
title && /* @__PURE__ */
|
|
2854
|
-
description && /* @__PURE__ */
|
|
2855
|
-
/* @__PURE__ */
|
|
4167
|
+
return /* @__PURE__ */ jsxs17(Fragment7, { children: [
|
|
4168
|
+
/* @__PURE__ */ jsxs17("div", { ref, children: [
|
|
4169
|
+
title && /* @__PURE__ */ jsx70(Header6, { title }),
|
|
4170
|
+
description && /* @__PURE__ */ jsx70("p", { children: description }),
|
|
4171
|
+
/* @__PURE__ */ jsxs17(
|
|
2856
4172
|
"div",
|
|
2857
4173
|
{
|
|
2858
4174
|
className: (0, import_classnames7.default)("form-group", {
|
|
2859
4175
|
"has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
|
|
2860
4176
|
}),
|
|
2861
4177
|
children: [
|
|
2862
|
-
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */
|
|
2863
|
-
/* @__PURE__ */
|
|
4178
|
+
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ jsx70(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
|
|
4179
|
+
/* @__PURE__ */ jsx70(
|
|
2864
4180
|
NavigationOption,
|
|
2865
4181
|
{
|
|
2866
|
-
media: /* @__PURE__ */
|
|
4182
|
+
media: /* @__PURE__ */ jsx70(Plus, {}),
|
|
2867
4183
|
title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
|
|
2868
4184
|
showMediaAtAllSizes: true,
|
|
2869
4185
|
onClick: () => onAddItem()
|
|
2870
4186
|
}
|
|
2871
4187
|
),
|
|
2872
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */
|
|
4188
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ jsx70(InlineAlert3, { type: "negative", children: validationState.message })
|
|
2873
4189
|
]
|
|
2874
4190
|
}
|
|
2875
4191
|
)
|
|
2876
4192
|
] }),
|
|
2877
|
-
/* @__PURE__ */
|
|
4193
|
+
/* @__PURE__ */ jsx70(
|
|
2878
4194
|
Modal4,
|
|
2879
4195
|
{
|
|
2880
4196
|
open: openModalType !== null,
|
|
2881
4197
|
title: (openModalType === "add" ? addItemTitle : editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
|
|
2882
|
-
body: /* @__PURE__ */
|
|
2883
|
-
/* @__PURE__ */
|
|
2884
|
-
/* @__PURE__ */
|
|
2885
|
-
/* @__PURE__ */
|
|
2886
|
-
/* @__PURE__ */
|
|
2887
|
-
|
|
4198
|
+
body: /* @__PURE__ */ jsxs17(Fragment7, { children: [
|
|
4199
|
+
/* @__PURE__ */ jsx70("div", { className: "m-b-2", children: editableItem }),
|
|
4200
|
+
/* @__PURE__ */ jsxs17("div", { children: [
|
|
4201
|
+
/* @__PURE__ */ jsx70(Button8, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
|
|
4202
|
+
/* @__PURE__ */ jsx70(
|
|
4203
|
+
Button8,
|
|
2888
4204
|
{
|
|
2889
4205
|
v2: true,
|
|
2890
4206
|
priority: "secondary",
|
|
@@ -2905,10 +4221,10 @@ function ItemSummaryOption({
|
|
|
2905
4221
|
item,
|
|
2906
4222
|
onClick
|
|
2907
4223
|
}) {
|
|
2908
|
-
return /* @__PURE__ */
|
|
4224
|
+
return /* @__PURE__ */ jsx70(
|
|
2909
4225
|
NavigationOption,
|
|
2910
4226
|
{
|
|
2911
|
-
media: /* @__PURE__ */
|
|
4227
|
+
media: /* @__PURE__ */ jsx70(OptionMedia, { media: item.media, preferAvatar: false }),
|
|
2912
4228
|
title: item.title,
|
|
2913
4229
|
content: item.description,
|
|
2914
4230
|
showMediaAtAllSizes: true,
|
|
@@ -2921,14 +4237,14 @@ var RepeatableRenderer_default = RepeatableRenderer;
|
|
|
2921
4237
|
|
|
2922
4238
|
// ../renderers/src/ReviewLegacyRenderer.tsx
|
|
2923
4239
|
import { DefinitionList } from "@transferwise/components";
|
|
2924
|
-
import { Fragment as
|
|
4240
|
+
import { Fragment as Fragment8, jsx as jsx71, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2925
4241
|
var ReviewRenderer = {
|
|
2926
4242
|
canRenderType: "review",
|
|
2927
4243
|
render: ({ callToAction, control, fields, margin, title, trackEvent }) => {
|
|
2928
4244
|
const orientation = mapControlToDefinitionListLayout(control);
|
|
2929
|
-
return /* @__PURE__ */
|
|
2930
|
-
/* @__PURE__ */
|
|
2931
|
-
/* @__PURE__ */
|
|
4245
|
+
return /* @__PURE__ */ jsxs18("div", { className: getMargin(margin), children: [
|
|
4246
|
+
/* @__PURE__ */ jsx71(Header, { title, callToAction }),
|
|
4247
|
+
/* @__PURE__ */ jsx71("div", { className: margin, children: /* @__PURE__ */ jsx71(
|
|
2932
4248
|
DefinitionList,
|
|
2933
4249
|
{
|
|
2934
4250
|
layout: orientation,
|
|
@@ -2966,20 +4282,20 @@ var mapControlToDefinitionListLayout = (control) => {
|
|
|
2966
4282
|
};
|
|
2967
4283
|
var getFieldLabel = (label, help, onClick) => {
|
|
2968
4284
|
if (help) {
|
|
2969
|
-
return /* @__PURE__ */
|
|
4285
|
+
return /* @__PURE__ */ jsxs18(Fragment8, { children: [
|
|
2970
4286
|
label,
|
|
2971
4287
|
" ",
|
|
2972
|
-
/* @__PURE__ */
|
|
4288
|
+
/* @__PURE__ */ jsx71(Help_default, { help, onClick })
|
|
2973
4289
|
] });
|
|
2974
4290
|
}
|
|
2975
4291
|
return label;
|
|
2976
4292
|
};
|
|
2977
4293
|
|
|
2978
4294
|
// ../renderers/src/ReviewRenderer.tsx
|
|
2979
|
-
import { ListItem as
|
|
4295
|
+
import { ListItem as ListItem10, Markdown as Markdown4, Popover } from "@transferwise/components";
|
|
2980
4296
|
import { QuestionMarkCircle } from "@transferwise/icons";
|
|
2981
|
-
import { useIntl as
|
|
2982
|
-
import { jsx as
|
|
4297
|
+
import { useIntl as useIntl11 } from "react-intl";
|
|
4298
|
+
import { jsx as jsx72, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2983
4299
|
var IGNORED_CONTROLS = [
|
|
2984
4300
|
"horizontal",
|
|
2985
4301
|
"horizontal-end-aligned",
|
|
@@ -2989,7 +4305,7 @@ var IGNORED_CONTROLS = [
|
|
|
2989
4305
|
var ReviewRenderer2 = {
|
|
2990
4306
|
canRenderType: "review",
|
|
2991
4307
|
canRender: ({ control }) => control ? !IGNORED_CONTROLS.includes(control) : true,
|
|
2992
|
-
render: (props) => /* @__PURE__ */
|
|
4308
|
+
render: (props) => /* @__PURE__ */ jsx72(Review, __spreadValues({}, props))
|
|
2993
4309
|
};
|
|
2994
4310
|
var Review = ({
|
|
2995
4311
|
callToAction,
|
|
@@ -3000,9 +4316,9 @@ var Review = ({
|
|
|
3000
4316
|
title,
|
|
3001
4317
|
trackEvent
|
|
3002
4318
|
}) => {
|
|
3003
|
-
const intl =
|
|
3004
|
-
return /* @__PURE__ */
|
|
3005
|
-
/* @__PURE__ */
|
|
4319
|
+
const intl = useIntl11();
|
|
4320
|
+
return /* @__PURE__ */ jsxs19("div", { className: getMargin(margin), children: [
|
|
4321
|
+
/* @__PURE__ */ jsx72(Header, { title, callToAction }),
|
|
3006
4322
|
fields.map((field) => {
|
|
3007
4323
|
var _a, _b, _c;
|
|
3008
4324
|
const {
|
|
@@ -3020,8 +4336,8 @@ var Review = ({
|
|
|
3020
4336
|
ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
|
|
3021
4337
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
3022
4338
|
};
|
|
3023
|
-
return /* @__PURE__ */
|
|
3024
|
-
|
|
4339
|
+
return /* @__PURE__ */ jsx72(
|
|
4340
|
+
ListItem10,
|
|
3025
4341
|
{
|
|
3026
4342
|
title: value,
|
|
3027
4343
|
subtitle: label,
|
|
@@ -3041,18 +4357,18 @@ var Review = ({
|
|
|
3041
4357
|
] });
|
|
3042
4358
|
};
|
|
3043
4359
|
var getHelpControl = (help, ariaLabel, onClick) => {
|
|
3044
|
-
return /* @__PURE__ */
|
|
4360
|
+
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, {}) }) });
|
|
3045
4361
|
};
|
|
3046
4362
|
var ReviewRenderer_default = ReviewRenderer2;
|
|
3047
4363
|
|
|
3048
4364
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
3049
|
-
import { Input as
|
|
3050
|
-
import { useState as
|
|
3051
|
-
import { useIntl as
|
|
4365
|
+
import { Input as Input5, InputGroup as InputGroup4, List, ListItem as ListItem11, Markdown as Markdown5 } from "@transferwise/components";
|
|
4366
|
+
import { useState as useState12 } from "react";
|
|
4367
|
+
import { useIntl as useIntl13 } from "react-intl";
|
|
3052
4368
|
|
|
3053
4369
|
// ../renderers/src/messages/search.messages.ts
|
|
3054
|
-
import { defineMessages as
|
|
3055
|
-
var search_messages_default =
|
|
4370
|
+
import { defineMessages as defineMessages10 } from "react-intl";
|
|
4371
|
+
var search_messages_default = defineMessages10({
|
|
3056
4372
|
loading: {
|
|
3057
4373
|
id: "df.wise.SearchLayout.loading",
|
|
3058
4374
|
defaultMessage: "Loading...",
|
|
@@ -3061,11 +4377,11 @@ var search_messages_default = defineMessages9({
|
|
|
3061
4377
|
});
|
|
3062
4378
|
|
|
3063
4379
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
3064
|
-
import { useIntl as
|
|
4380
|
+
import { useIntl as useIntl12 } from "react-intl";
|
|
3065
4381
|
|
|
3066
4382
|
// ../renderers/src/messages/generic-error.messages.ts
|
|
3067
|
-
import { defineMessages as
|
|
3068
|
-
var generic_error_messages_default =
|
|
4383
|
+
import { defineMessages as defineMessages11 } from "react-intl";
|
|
4384
|
+
var generic_error_messages_default = defineMessages11({
|
|
3069
4385
|
genericErrorRetryHint: {
|
|
3070
4386
|
id: "df.wise.PersistAsyncSchema.genericError",
|
|
3071
4387
|
defaultMessage: "Something went wrong, please try again.",
|
|
@@ -3085,19 +4401,19 @@ var generic_error_messages_default = defineMessages10({
|
|
|
3085
4401
|
|
|
3086
4402
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
3087
4403
|
import { Link } from "@transferwise/components";
|
|
3088
|
-
import { jsx as
|
|
4404
|
+
import { jsx as jsx73, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3089
4405
|
function ErrorResult({ state }) {
|
|
3090
|
-
const intl =
|
|
3091
|
-
return /* @__PURE__ */
|
|
4406
|
+
const intl = useIntl12();
|
|
4407
|
+
return /* @__PURE__ */ jsxs20("p", { className: "m-t-2", children: [
|
|
3092
4408
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
3093
4409
|
"\xA0",
|
|
3094
|
-
/* @__PURE__ */
|
|
4410
|
+
/* @__PURE__ */ jsx73(Link, { onClick: () => state.onRetry(), children: intl.formatMessage(generic_error_messages_default.retry) })
|
|
3095
4411
|
] });
|
|
3096
4412
|
}
|
|
3097
4413
|
|
|
3098
4414
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
3099
|
-
import { Search } from "@transferwise/icons";
|
|
3100
|
-
import { Fragment as
|
|
4415
|
+
import { Search as Search2 } from "@transferwise/icons";
|
|
4416
|
+
import { Fragment as Fragment9, jsx as jsx74, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3101
4417
|
function BlockSearchRendererComponent({
|
|
3102
4418
|
id,
|
|
3103
4419
|
hint,
|
|
@@ -3110,10 +4426,10 @@ function BlockSearchRendererComponent({
|
|
|
3110
4426
|
trackEvent,
|
|
3111
4427
|
onChange
|
|
3112
4428
|
}) {
|
|
3113
|
-
const [hasSearched, setHasSearched] =
|
|
3114
|
-
const { formatMessage } =
|
|
3115
|
-
return /* @__PURE__ */
|
|
3116
|
-
/* @__PURE__ */
|
|
4429
|
+
const [hasSearched, setHasSearched] = useState12(false);
|
|
4430
|
+
const { formatMessage } = useIntl13();
|
|
4431
|
+
return /* @__PURE__ */ jsxs21("div", { className: getMargin(margin), children: [
|
|
4432
|
+
/* @__PURE__ */ jsx74(
|
|
3117
4433
|
FieldInput_default,
|
|
3118
4434
|
{
|
|
3119
4435
|
id,
|
|
@@ -3122,8 +4438,8 @@ function BlockSearchRendererComponent({
|
|
|
3122
4438
|
help: "",
|
|
3123
4439
|
label: title,
|
|
3124
4440
|
features,
|
|
3125
|
-
children: /* @__PURE__ */
|
|
3126
|
-
|
|
4441
|
+
children: /* @__PURE__ */ jsx74(InputGroup4, { addonStart: { content: /* @__PURE__ */ jsx74(Search2, { size: 24 }) }, children: /* @__PURE__ */ jsx74(
|
|
4442
|
+
Input5,
|
|
3127
4443
|
{
|
|
3128
4444
|
id,
|
|
3129
4445
|
name: id,
|
|
@@ -3141,7 +4457,7 @@ function BlockSearchRendererComponent({
|
|
|
3141
4457
|
) })
|
|
3142
4458
|
}
|
|
3143
4459
|
),
|
|
3144
|
-
isLoading ? /* @__PURE__ */
|
|
4460
|
+
isLoading ? /* @__PURE__ */ jsx74("span", { children: formatMessage(search_messages_default.loading) }) : /* @__PURE__ */ jsx74(SearchResultContent, { state, trackEvent })
|
|
3145
4461
|
] });
|
|
3146
4462
|
}
|
|
3147
4463
|
function SearchResultContent({
|
|
@@ -3150,39 +4466,39 @@ function SearchResultContent({
|
|
|
3150
4466
|
}) {
|
|
3151
4467
|
switch (state.type) {
|
|
3152
4468
|
case "error":
|
|
3153
|
-
return /* @__PURE__ */
|
|
4469
|
+
return /* @__PURE__ */ jsx74(ErrorResult, { state });
|
|
3154
4470
|
case "results":
|
|
3155
|
-
return /* @__PURE__ */
|
|
4471
|
+
return /* @__PURE__ */ jsx74(SearchResults, { state, trackEvent });
|
|
3156
4472
|
case "layout":
|
|
3157
|
-
return /* @__PURE__ */
|
|
4473
|
+
return /* @__PURE__ */ jsxs21(Fragment9, { children: [
|
|
3158
4474
|
" ",
|
|
3159
4475
|
state.layout,
|
|
3160
4476
|
" "
|
|
3161
4477
|
] });
|
|
3162
4478
|
case "noResults":
|
|
3163
|
-
return /* @__PURE__ */
|
|
4479
|
+
return /* @__PURE__ */ jsx74(EmptySearchResult, { state });
|
|
3164
4480
|
case "pending":
|
|
3165
4481
|
default:
|
|
3166
4482
|
return null;
|
|
3167
4483
|
}
|
|
3168
4484
|
}
|
|
3169
4485
|
function EmptySearchResult({ state }) {
|
|
3170
|
-
return /* @__PURE__ */
|
|
4486
|
+
return /* @__PURE__ */ jsx74(Markdown5, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
3171
4487
|
}
|
|
3172
4488
|
function SearchResults({
|
|
3173
4489
|
state,
|
|
3174
4490
|
trackEvent
|
|
3175
4491
|
}) {
|
|
3176
|
-
return /* @__PURE__ */
|
|
4492
|
+
return /* @__PURE__ */ jsx74(List, { children: state.results.map((result) => {
|
|
3177
4493
|
const { media } = result;
|
|
3178
|
-
return /* @__PURE__ */
|
|
3179
|
-
|
|
4494
|
+
return /* @__PURE__ */ jsx74(
|
|
4495
|
+
ListItem11,
|
|
3180
4496
|
{
|
|
3181
4497
|
title: result.title,
|
|
3182
4498
|
subtitle: result.description,
|
|
3183
|
-
media: media ? /* @__PURE__ */
|
|
3184
|
-
control: /* @__PURE__ */
|
|
3185
|
-
|
|
4499
|
+
media: media ? /* @__PURE__ */ jsx74(OptionMedia, { media, preferAvatar: false }) : void 0,
|
|
4500
|
+
control: /* @__PURE__ */ jsx74(
|
|
4501
|
+
ListItem11.Navigation,
|
|
3186
4502
|
{
|
|
3187
4503
|
onClick: () => {
|
|
3188
4504
|
trackEvent("Search Result Selected", __spreadValues({
|
|
@@ -3201,10 +4517,10 @@ var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
|
|
|
3201
4517
|
|
|
3202
4518
|
// ../renderers/src/SearchRenderer/InlineSearchRendererComponent.tsx
|
|
3203
4519
|
import { Markdown as Markdown6, Typeahead } from "@transferwise/components";
|
|
3204
|
-
import { Search as
|
|
3205
|
-
import { useState as
|
|
3206
|
-
import { useIntl as
|
|
3207
|
-
import { jsx as
|
|
4520
|
+
import { Search as Search3 } from "@transferwise/icons";
|
|
4521
|
+
import { useState as useState13 } from "react";
|
|
4522
|
+
import { useIntl as useIntl14 } from "react-intl";
|
|
4523
|
+
import { jsx as jsx75 } from "react/jsx-runtime";
|
|
3208
4524
|
function InlineSearchRenderer({
|
|
3209
4525
|
id,
|
|
3210
4526
|
hint,
|
|
@@ -3216,9 +4532,9 @@ function InlineSearchRenderer({
|
|
|
3216
4532
|
onChange,
|
|
3217
4533
|
trackEvent
|
|
3218
4534
|
}) {
|
|
3219
|
-
const [hasSearched, setHasSearched] =
|
|
3220
|
-
const intl =
|
|
3221
|
-
return /* @__PURE__ */
|
|
4535
|
+
const [hasSearched, setHasSearched] = useState13(false);
|
|
4536
|
+
const intl = useIntl14();
|
|
4537
|
+
return /* @__PURE__ */ jsx75("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx75(
|
|
3222
4538
|
FieldInput_default,
|
|
3223
4539
|
{
|
|
3224
4540
|
id,
|
|
@@ -3227,7 +4543,7 @@ function InlineSearchRenderer({
|
|
|
3227
4543
|
help: "",
|
|
3228
4544
|
label: title,
|
|
3229
4545
|
features,
|
|
3230
|
-
children: /* @__PURE__ */
|
|
4546
|
+
children: /* @__PURE__ */ jsx75(
|
|
3231
4547
|
Typeahead,
|
|
3232
4548
|
{
|
|
3233
4549
|
id: "typeahead-input-id",
|
|
@@ -3236,10 +4552,10 @@ function InlineSearchRenderer({
|
|
|
3236
4552
|
size: "md",
|
|
3237
4553
|
placeholder: hint,
|
|
3238
4554
|
maxHeight: 100,
|
|
3239
|
-
footer: /* @__PURE__ */
|
|
4555
|
+
footer: /* @__PURE__ */ jsx75(TypeaheadFooter, { state, isLoading }),
|
|
3240
4556
|
multiple: false,
|
|
3241
4557
|
clearable: false,
|
|
3242
|
-
addon: /* @__PURE__ */
|
|
4558
|
+
addon: /* @__PURE__ */ jsx75(Search3, { size: 24 }),
|
|
3243
4559
|
options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
|
|
3244
4560
|
minQueryLength: 1,
|
|
3245
4561
|
onChange: (values) => {
|
|
@@ -3276,28 +4592,28 @@ function mapResultToTypeaheadOption(result) {
|
|
|
3276
4592
|
};
|
|
3277
4593
|
}
|
|
3278
4594
|
function TypeaheadFooter({ state, isLoading }) {
|
|
3279
|
-
const { formatMessage } =
|
|
4595
|
+
const { formatMessage } = useIntl14();
|
|
3280
4596
|
if (state.type === "layout") {
|
|
3281
|
-
return /* @__PURE__ */
|
|
4597
|
+
return /* @__PURE__ */ jsx75("div", { className: "m-x-1 m-y-1", children: state.layout });
|
|
3282
4598
|
}
|
|
3283
4599
|
if (state.type === "noResults") {
|
|
3284
|
-
return /* @__PURE__ */
|
|
4600
|
+
return /* @__PURE__ */ jsx75(Markdown6, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
3285
4601
|
}
|
|
3286
4602
|
if (state.type === "error") {
|
|
3287
|
-
return /* @__PURE__ */
|
|
4603
|
+
return /* @__PURE__ */ jsx75("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ jsx75(ErrorResult, { state }) });
|
|
3288
4604
|
}
|
|
3289
4605
|
if (state.type === "pending" || isLoading) {
|
|
3290
|
-
return /* @__PURE__ */
|
|
4606
|
+
return /* @__PURE__ */ jsx75("p", { className: "m-t-2 m-x-2", children: formatMessage(search_messages_default.loading) });
|
|
3291
4607
|
}
|
|
3292
4608
|
return null;
|
|
3293
4609
|
}
|
|
3294
4610
|
var InlineSearchRendererComponent_default = InlineSearchRenderer;
|
|
3295
4611
|
|
|
3296
4612
|
// ../renderers/src/SearchRenderer/SearchRenderer.tsx
|
|
3297
|
-
import { jsx as
|
|
4613
|
+
import { jsx as jsx76 } from "react/jsx-runtime";
|
|
3298
4614
|
var SearchRenderer = {
|
|
3299
4615
|
canRenderType: "search",
|
|
3300
|
-
render: (props) => props.control === "inline" ? /* @__PURE__ */
|
|
4616
|
+
render: (props) => props.control === "inline" ? /* @__PURE__ */ jsx76(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ jsx76(BlockSearchRendererComponent_default, __spreadValues({}, props))
|
|
3301
4617
|
};
|
|
3302
4618
|
var SearchRenderer_default = SearchRenderer;
|
|
3303
4619
|
|
|
@@ -3326,12 +4642,12 @@ var getHeaderAction2 = (callToAction) => {
|
|
|
3326
4642
|
};
|
|
3327
4643
|
|
|
3328
4644
|
// ../renderers/src/SectionRenderer.tsx
|
|
3329
|
-
import { jsx as
|
|
4645
|
+
import { jsx as jsx77, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3330
4646
|
var SectionRenderer = {
|
|
3331
4647
|
canRenderType: "section",
|
|
3332
4648
|
render: ({ children, callToAction, margin, title }) => {
|
|
3333
|
-
return /* @__PURE__ */
|
|
3334
|
-
(title || callToAction) && /* @__PURE__ */
|
|
4649
|
+
return /* @__PURE__ */ jsxs22("section", { className: getMargin(margin), children: [
|
|
4650
|
+
(title || callToAction) && /* @__PURE__ */ jsx77(Header7, { title: title != null ? title : "", action: getHeaderAction2(callToAction) }),
|
|
3335
4651
|
children
|
|
3336
4652
|
] });
|
|
3337
4653
|
}
|
|
@@ -3340,7 +4656,7 @@ var SectionRenderer_default = SectionRenderer;
|
|
|
3340
4656
|
|
|
3341
4657
|
// ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
3342
4658
|
import { RadioGroup } from "@transferwise/components";
|
|
3343
|
-
import { Fragment as
|
|
4659
|
+
import { Fragment as Fragment10, jsx as jsx78, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3344
4660
|
function RadioInputRendererComponent(props) {
|
|
3345
4661
|
const {
|
|
3346
4662
|
id,
|
|
@@ -3355,8 +4671,8 @@ function RadioInputRendererComponent(props) {
|
|
|
3355
4671
|
validationState,
|
|
3356
4672
|
onSelect
|
|
3357
4673
|
} = props;
|
|
3358
|
-
return /* @__PURE__ */
|
|
3359
|
-
/* @__PURE__ */
|
|
4674
|
+
return /* @__PURE__ */ jsxs23(Fragment10, { children: [
|
|
4675
|
+
/* @__PURE__ */ jsx78(
|
|
3360
4676
|
FieldInput_default,
|
|
3361
4677
|
{
|
|
3362
4678
|
id,
|
|
@@ -3365,7 +4681,7 @@ function RadioInputRendererComponent(props) {
|
|
|
3365
4681
|
description,
|
|
3366
4682
|
validation: validationState,
|
|
3367
4683
|
features,
|
|
3368
|
-
children: /* @__PURE__ */
|
|
4684
|
+
children: /* @__PURE__ */ jsx78("span", { children: /* @__PURE__ */ jsx78(
|
|
3369
4685
|
RadioGroup,
|
|
3370
4686
|
{
|
|
3371
4687
|
name: id,
|
|
@@ -3374,7 +4690,7 @@ function RadioInputRendererComponent(props) {
|
|
|
3374
4690
|
value: index,
|
|
3375
4691
|
secondary: option.description,
|
|
3376
4692
|
disabled: option.disabled || disabled,
|
|
3377
|
-
avatar: /* @__PURE__ */
|
|
4693
|
+
avatar: /* @__PURE__ */ jsx78(OptionMedia, { media: option.media, preferAvatar: false })
|
|
3378
4694
|
})),
|
|
3379
4695
|
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
3380
4696
|
onChange: onSelect
|
|
@@ -3389,8 +4705,8 @@ function RadioInputRendererComponent(props) {
|
|
|
3389
4705
|
|
|
3390
4706
|
// ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
3391
4707
|
import { Tabs } from "@transferwise/components";
|
|
3392
|
-
import { useEffect as
|
|
3393
|
-
import { Fragment as
|
|
4708
|
+
import { useEffect as useEffect11 } from "react";
|
|
4709
|
+
import { Fragment as Fragment11, jsx as jsx79, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3394
4710
|
function TabInputRendererComponent(props) {
|
|
3395
4711
|
const {
|
|
3396
4712
|
id,
|
|
@@ -3405,13 +4721,13 @@ function TabInputRendererComponent(props) {
|
|
|
3405
4721
|
validationState,
|
|
3406
4722
|
onSelect
|
|
3407
4723
|
} = props;
|
|
3408
|
-
|
|
4724
|
+
useEffect11(() => {
|
|
3409
4725
|
if (!isValidIndex2(selectedIndex, options.length)) {
|
|
3410
4726
|
onSelect(0);
|
|
3411
4727
|
}
|
|
3412
4728
|
}, [selectedIndex, onSelect, options.length]);
|
|
3413
|
-
return /* @__PURE__ */
|
|
3414
|
-
/* @__PURE__ */
|
|
4729
|
+
return /* @__PURE__ */ jsxs24(Fragment11, { children: [
|
|
4730
|
+
/* @__PURE__ */ jsx79(
|
|
3415
4731
|
FieldInput_default,
|
|
3416
4732
|
{
|
|
3417
4733
|
id,
|
|
@@ -3420,7 +4736,7 @@ function TabInputRendererComponent(props) {
|
|
|
3420
4736
|
description,
|
|
3421
4737
|
validation: validationState,
|
|
3422
4738
|
features,
|
|
3423
|
-
children: /* @__PURE__ */
|
|
4739
|
+
children: /* @__PURE__ */ jsx79(
|
|
3424
4740
|
Tabs,
|
|
3425
4741
|
{
|
|
3426
4742
|
name: id,
|
|
@@ -3429,7 +4745,7 @@ function TabInputRendererComponent(props) {
|
|
|
3429
4745
|
title: option.title,
|
|
3430
4746
|
// if we pass null, we get some props-types console errors
|
|
3431
4747
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
3432
|
-
content: /* @__PURE__ */
|
|
4748
|
+
content: /* @__PURE__ */ jsx79(Fragment11, {}),
|
|
3433
4749
|
disabled: option.disabled || disabled
|
|
3434
4750
|
})),
|
|
3435
4751
|
onTabSelect: onSelect
|
|
@@ -3444,7 +4760,7 @@ var isValidIndex2 = (index, options) => index !== null && index >= 0 && index <
|
|
|
3444
4760
|
|
|
3445
4761
|
// ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
3446
4762
|
import { SelectInput as SelectInput2, SelectInputOptionContent as SelectInputOptionContent2 } from "@transferwise/components";
|
|
3447
|
-
import { Fragment as
|
|
4763
|
+
import { Fragment as Fragment12, jsx as jsx80, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
3448
4764
|
function SelectInputRendererComponent(props) {
|
|
3449
4765
|
const {
|
|
3450
4766
|
id,
|
|
@@ -3485,13 +4801,13 @@ function SelectInputRendererComponent(props) {
|
|
|
3485
4801
|
} : {
|
|
3486
4802
|
title: option.title,
|
|
3487
4803
|
description: option.description,
|
|
3488
|
-
icon: /* @__PURE__ */
|
|
4804
|
+
icon: /* @__PURE__ */ jsx80(OptionMedia, { media: option.media, preferAvatar: false })
|
|
3489
4805
|
};
|
|
3490
|
-
return /* @__PURE__ */
|
|
4806
|
+
return /* @__PURE__ */ jsx80(SelectInputOptionContent2, __spreadValues({}, contentProps));
|
|
3491
4807
|
};
|
|
3492
4808
|
const extraProps = { autoComplete };
|
|
3493
|
-
return /* @__PURE__ */
|
|
3494
|
-
/* @__PURE__ */
|
|
4809
|
+
return /* @__PURE__ */ jsxs25(Fragment12, { children: [
|
|
4810
|
+
/* @__PURE__ */ jsx80(
|
|
3495
4811
|
FieldInput_default,
|
|
3496
4812
|
{
|
|
3497
4813
|
id,
|
|
@@ -3500,7 +4816,7 @@ function SelectInputRendererComponent(props) {
|
|
|
3500
4816
|
description,
|
|
3501
4817
|
validation: validationState,
|
|
3502
4818
|
features,
|
|
3503
|
-
children: /* @__PURE__ */
|
|
4819
|
+
children: /* @__PURE__ */ jsx80(
|
|
3504
4820
|
SelectInput2,
|
|
3505
4821
|
__spreadValues({
|
|
3506
4822
|
name: id,
|
|
@@ -3521,9 +4837,9 @@ function SelectInputRendererComponent(props) {
|
|
|
3521
4837
|
}
|
|
3522
4838
|
|
|
3523
4839
|
// ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
3524
|
-
import { useEffect as
|
|
4840
|
+
import { useEffect as useEffect12 } from "react";
|
|
3525
4841
|
import { SegmentedControl } from "@transferwise/components";
|
|
3526
|
-
import { Fragment as
|
|
4842
|
+
import { Fragment as Fragment13, jsx as jsx81, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
3527
4843
|
function SegmentedInputRendererComponent(props) {
|
|
3528
4844
|
const {
|
|
3529
4845
|
id,
|
|
@@ -3537,13 +4853,13 @@ function SegmentedInputRendererComponent(props) {
|
|
|
3537
4853
|
validationState,
|
|
3538
4854
|
onSelect
|
|
3539
4855
|
} = props;
|
|
3540
|
-
|
|
4856
|
+
useEffect12(() => {
|
|
3541
4857
|
if (!isValidIndex3(selectedIndex, options.length)) {
|
|
3542
4858
|
onSelect(0);
|
|
3543
4859
|
}
|
|
3544
4860
|
}, [selectedIndex, onSelect, options.length]);
|
|
3545
|
-
return /* @__PURE__ */
|
|
3546
|
-
/* @__PURE__ */
|
|
4861
|
+
return /* @__PURE__ */ jsxs26(Fragment13, { children: [
|
|
4862
|
+
/* @__PURE__ */ jsx81(
|
|
3547
4863
|
FieldInput_default,
|
|
3548
4864
|
{
|
|
3549
4865
|
id,
|
|
@@ -3552,7 +4868,7 @@ function SegmentedInputRendererComponent(props) {
|
|
|
3552
4868
|
description,
|
|
3553
4869
|
validation: validationState,
|
|
3554
4870
|
features,
|
|
3555
|
-
children: /* @__PURE__ */
|
|
4871
|
+
children: /* @__PURE__ */ jsx81(
|
|
3556
4872
|
SegmentedControl,
|
|
3557
4873
|
{
|
|
3558
4874
|
name: `${id}-segmented-control`,
|
|
@@ -3569,14 +4885,14 @@ function SegmentedInputRendererComponent(props) {
|
|
|
3569
4885
|
)
|
|
3570
4886
|
}
|
|
3571
4887
|
),
|
|
3572
|
-
/* @__PURE__ */
|
|
4888
|
+
/* @__PURE__ */ jsx81("div", { id: `${id}-children`, children })
|
|
3573
4889
|
] });
|
|
3574
4890
|
}
|
|
3575
4891
|
var isValidIndex3 = (index, options) => index !== null && index >= 0 && index < options;
|
|
3576
4892
|
|
|
3577
4893
|
// ../renderers/src/SelectInputRenderer/RadioItemRendererComponent.tsx
|
|
3578
|
-
import { Header as Header8, InlineAlert as InlineAlert4, List as List2, ListItem as
|
|
3579
|
-
import { jsx as
|
|
4894
|
+
import { Header as Header8, InlineAlert as InlineAlert4, List as List2, ListItem as ListItem12 } from "@transferwise/components";
|
|
4895
|
+
import { jsx as jsx82, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
3580
4896
|
function RadioItemRendererComponent(props) {
|
|
3581
4897
|
const {
|
|
3582
4898
|
id,
|
|
@@ -3592,23 +4908,23 @@ function RadioItemRendererComponent(props) {
|
|
|
3592
4908
|
onSelect
|
|
3593
4909
|
} = props;
|
|
3594
4910
|
const { ref } = useScrollToError(validationState, features);
|
|
3595
|
-
return /* @__PURE__ */
|
|
3596
|
-
rootTitle && /* @__PURE__ */
|
|
4911
|
+
return /* @__PURE__ */ jsxs27("div", { ref, children: [
|
|
4912
|
+
rootTitle && /* @__PURE__ */ jsx82(
|
|
3597
4913
|
Header8,
|
|
3598
4914
|
{
|
|
3599
4915
|
as: "h2",
|
|
3600
|
-
title: help ? /* @__PURE__ */
|
|
4916
|
+
title: help ? /* @__PURE__ */ jsx82(LabelContentWithHelp, { text: rootTitle, help }) : rootTitle
|
|
3601
4917
|
}
|
|
3602
4918
|
),
|
|
3603
|
-
rootDescription && /* @__PURE__ */
|
|
3604
|
-
/* @__PURE__ */
|
|
3605
|
-
({ title, description, additionalText, inlineAlert, disabled, media, supportingValues }, index) => /* @__PURE__ */
|
|
3606
|
-
|
|
4919
|
+
rootDescription && /* @__PURE__ */ jsx82("p", { children: rootDescription }),
|
|
4920
|
+
/* @__PURE__ */ jsx82(List2, { children: options.map(
|
|
4921
|
+
({ title, description, additionalText, inlineAlert, disabled, media, supportingValues }, index) => /* @__PURE__ */ jsx82(
|
|
4922
|
+
ListItem12,
|
|
3607
4923
|
__spreadValues({
|
|
3608
4924
|
title,
|
|
3609
4925
|
subtitle: description,
|
|
3610
|
-
control: /* @__PURE__ */
|
|
3611
|
-
|
|
4926
|
+
control: /* @__PURE__ */ jsx82(
|
|
4927
|
+
ListItem12.Radio,
|
|
3612
4928
|
{
|
|
3613
4929
|
name: title,
|
|
3614
4930
|
checked: selectedIndex === index,
|
|
@@ -3623,50 +4939,50 @@ function RadioItemRendererComponent(props) {
|
|
|
3623
4939
|
title
|
|
3624
4940
|
)
|
|
3625
4941
|
) }, `${id}-${selectedIndex}`),
|
|
3626
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */
|
|
4942
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ jsx82(InlineAlert4, { type: "negative", children: validationState.message }),
|
|
3627
4943
|
children
|
|
3628
4944
|
] });
|
|
3629
4945
|
}
|
|
3630
4946
|
|
|
3631
4947
|
// ../renderers/src/SelectInputRenderer/SelectInputRenderer.tsx
|
|
3632
|
-
import { jsx as
|
|
4948
|
+
import { jsx as jsx83 } from "react/jsx-runtime";
|
|
3633
4949
|
var SelectInputRenderer = {
|
|
3634
4950
|
canRenderType: "input-select",
|
|
3635
4951
|
render: (props) => {
|
|
3636
4952
|
switch (props.control) {
|
|
3637
4953
|
case "radio":
|
|
3638
|
-
return /* @__PURE__ */
|
|
4954
|
+
return /* @__PURE__ */ jsx83(RadioInputRendererComponent, __spreadValues({}, props));
|
|
3639
4955
|
case "radio-item":
|
|
3640
|
-
return /* @__PURE__ */
|
|
4956
|
+
return /* @__PURE__ */ jsx83(RadioItemRendererComponent, __spreadValues({}, props));
|
|
3641
4957
|
case "tab":
|
|
3642
|
-
return props.options.length > 3 ? /* @__PURE__ */
|
|
4958
|
+
return props.options.length > 3 ? /* @__PURE__ */ jsx83(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx83(TabInputRendererComponent, __spreadValues({}, props));
|
|
3643
4959
|
case "segmented":
|
|
3644
|
-
return props.options.length > 3 ? /* @__PURE__ */
|
|
4960
|
+
return props.options.length > 3 ? /* @__PURE__ */ jsx83(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx83(SegmentedInputRendererComponent, __spreadValues({}, props));
|
|
3645
4961
|
case "select":
|
|
3646
4962
|
default:
|
|
3647
|
-
return /* @__PURE__ */
|
|
4963
|
+
return /* @__PURE__ */ jsx83(SelectInputRendererComponent, __spreadValues({}, props));
|
|
3648
4964
|
}
|
|
3649
4965
|
}
|
|
3650
4966
|
};
|
|
3651
4967
|
var SelectInputRenderer_default = SelectInputRenderer;
|
|
3652
4968
|
|
|
3653
4969
|
// ../renderers/src/StatusListRenderer.tsx
|
|
3654
|
-
import { AvatarView as AvatarView4, Header as Header9, ListItem as
|
|
3655
|
-
import { jsx as
|
|
4970
|
+
import { AvatarView as AvatarView4, Header as Header9, ListItem as ListItem13 } from "@transferwise/components";
|
|
4971
|
+
import { jsx as jsx84, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3656
4972
|
var StatusListRenderer = {
|
|
3657
4973
|
canRenderType: "status-list",
|
|
3658
|
-
render: ({ margin, items, title }) => /* @__PURE__ */
|
|
3659
|
-
title ? /* @__PURE__ */
|
|
4974
|
+
render: ({ margin, items, title }) => /* @__PURE__ */ jsxs28("div", { className: getMargin(margin), children: [
|
|
4975
|
+
title ? /* @__PURE__ */ jsx84(Header9, { title }) : null,
|
|
3660
4976
|
items.map((item) => {
|
|
3661
4977
|
const { callToAction, description, title: itemTitle } = item;
|
|
3662
|
-
return /* @__PURE__ */
|
|
3663
|
-
|
|
4978
|
+
return /* @__PURE__ */ jsx84(
|
|
4979
|
+
ListItem13,
|
|
3664
4980
|
{
|
|
3665
4981
|
title: itemTitle,
|
|
3666
4982
|
subtitle: description,
|
|
3667
|
-
media: /* @__PURE__ */
|
|
3668
|
-
additionalInfo: callToAction ? /* @__PURE__ */
|
|
3669
|
-
|
|
4983
|
+
media: /* @__PURE__ */ jsx84(StatusListItemMedia, __spreadValues({}, item)),
|
|
4984
|
+
additionalInfo: callToAction ? /* @__PURE__ */ jsx84(
|
|
4985
|
+
ListItem13.AdditionalInfo,
|
|
3670
4986
|
{
|
|
3671
4987
|
action: __spreadValues({
|
|
3672
4988
|
label: callToAction.title
|
|
@@ -3684,10 +5000,10 @@ var StatusListItemMedia = ({ icon, status }) => {
|
|
|
3684
5000
|
return void 0;
|
|
3685
5001
|
}
|
|
3686
5002
|
if ("name" in icon) {
|
|
3687
|
-
return /* @__PURE__ */
|
|
5003
|
+
return /* @__PURE__ */ jsx84(AvatarView4, { badge: { status: mapStatus(status) }, children: /* @__PURE__ */ jsx84(DynamicIcon_default, { name: icon.name }) });
|
|
3688
5004
|
}
|
|
3689
5005
|
if ("text" in icon) {
|
|
3690
|
-
return /* @__PURE__ */
|
|
5006
|
+
return /* @__PURE__ */ jsx84(AvatarView4, { badge: { status: mapStatus(status) }, children: icon.text });
|
|
3691
5007
|
}
|
|
3692
5008
|
return void 0;
|
|
3693
5009
|
};
|
|
@@ -3705,12 +5021,12 @@ var StatusListRenderer_default = StatusListRenderer;
|
|
|
3705
5021
|
|
|
3706
5022
|
// ../renderers/src/utils/useCustomTheme.ts
|
|
3707
5023
|
import { useTheme } from "@wise/components-theming";
|
|
3708
|
-
import { useEffect as
|
|
5024
|
+
import { useEffect as useEffect13, useMemo as useMemo2 } from "react";
|
|
3709
5025
|
var ThemeRequiredEventName = "Theme Required";
|
|
3710
5026
|
var useCustomTheme = (theme, trackEvent) => {
|
|
3711
5027
|
const theming = useTheme();
|
|
3712
|
-
const previousTheme =
|
|
3713
|
-
|
|
5028
|
+
const previousTheme = useMemo2(() => theming.theme, []);
|
|
5029
|
+
useEffect13(() => {
|
|
3714
5030
|
theming.setTheme(theme);
|
|
3715
5031
|
trackEvent(ThemeRequiredEventName, { theme });
|
|
3716
5032
|
return theme !== previousTheme ? () => {
|
|
@@ -3721,86 +5037,14 @@ var useCustomTheme = (theme, trackEvent) => {
|
|
|
3721
5037
|
}, []);
|
|
3722
5038
|
};
|
|
3723
5039
|
|
|
3724
|
-
// ../renderers/src/step/StepFooter.tsx
|
|
3725
|
-
import { Button as Button7 } from "@transferwise/components";
|
|
3726
|
-
import { useEffect as useEffect11, useRef as useRef2, useState as useState12 } from "react";
|
|
3727
|
-
import { useIntl as useIntl14 } from "react-intl";
|
|
3728
|
-
|
|
3729
|
-
// ../renderers/src/messages/step.messages.ts
|
|
3730
|
-
import { defineMessages as defineMessages11 } from "react-intl";
|
|
3731
|
-
var step_messages_default = defineMessages11({
|
|
3732
|
-
scrollToBottom: {
|
|
3733
|
-
id: "df.wise.step.scrollToBottom",
|
|
3734
|
-
defaultMessage: "Scroll to bottom",
|
|
3735
|
-
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."
|
|
3736
|
-
}
|
|
3737
|
-
});
|
|
3738
|
-
|
|
3739
|
-
// ../renderers/src/step/StepFooter.tsx
|
|
3740
|
-
import { Fragment as Fragment12, jsx as jsx77, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
3741
|
-
var SCROLL_TO_BOTTOM = "scroll-to-bottom";
|
|
3742
|
-
var StepFooter = ({ footer, tags }) => {
|
|
3743
|
-
if (tags == null ? void 0 : tags.includes(SCROLL_TO_BOTTOM)) {
|
|
3744
|
-
return /* @__PURE__ */ jsx77(FooterWithScrollButton, { footer });
|
|
3745
|
-
}
|
|
3746
|
-
return /* @__PURE__ */ jsx77(DefaultFooter, { footer });
|
|
3747
|
-
};
|
|
3748
|
-
var DefaultFooter = ({ footer }) => {
|
|
3749
|
-
const hasFooter = footer && Array.isArray(footer) && footer.length > 0;
|
|
3750
|
-
return hasFooter ? /* @__PURE__ */ jsx77("div", { className: "df-step-fixed__footer", children: footer }) : void 0;
|
|
3751
|
-
};
|
|
3752
|
-
var FooterWithScrollButton = ({ footer }) => {
|
|
3753
|
-
const { formatMessage } = useIntl14();
|
|
3754
|
-
const endOfLayoutRef = useRef2(null);
|
|
3755
|
-
const isElementVisible = useIsElementVisible(endOfLayoutRef);
|
|
3756
|
-
const scrollButton = /* @__PURE__ */ jsx77(
|
|
3757
|
-
Button7,
|
|
3758
|
-
{
|
|
3759
|
-
className: "m-b-1",
|
|
3760
|
-
v2: true,
|
|
3761
|
-
block: true,
|
|
3762
|
-
priority: "tertiary",
|
|
3763
|
-
onClick: () => {
|
|
3764
|
-
var _a;
|
|
3765
|
-
(_a = endOfLayoutRef.current) == null ? void 0 : _a.scrollIntoView({ behavior: "smooth" });
|
|
3766
|
-
},
|
|
3767
|
-
children: formatMessage(step_messages_default.scrollToBottom)
|
|
3768
|
-
}
|
|
3769
|
-
);
|
|
3770
|
-
const hasStepFooterContent = footer && Array.isArray(footer) && footer.length > 0;
|
|
3771
|
-
if (isElementVisible && !hasStepFooterContent) {
|
|
3772
|
-
return /* @__PURE__ */ jsx77("div", { ref: endOfLayoutRef, "aria-hidden": "true" });
|
|
3773
|
-
}
|
|
3774
|
-
return /* @__PURE__ */ jsxs26(Fragment12, { children: [
|
|
3775
|
-
/* @__PURE__ */ jsx77("div", { ref: endOfLayoutRef, "aria-hidden": "true" }),
|
|
3776
|
-
/* @__PURE__ */ jsxs26("div", { className: "df-step-fixed__footer", children: [
|
|
3777
|
-
!isElementVisible && scrollButton,
|
|
3778
|
-
footer
|
|
3779
|
-
] })
|
|
3780
|
-
] });
|
|
3781
|
-
};
|
|
3782
|
-
var useIsElementVisible = (elementRef) => {
|
|
3783
|
-
const [isVisible, setIsVisible] = useState12(false);
|
|
3784
|
-
useEffect11(() => {
|
|
3785
|
-
const element = elementRef.current;
|
|
3786
|
-
if (!element) return;
|
|
3787
|
-
const observer = new IntersectionObserver(([entry]) => {
|
|
3788
|
-
setIsVisible(entry.isIntersecting);
|
|
3789
|
-
});
|
|
3790
|
-
observer.observe(element);
|
|
3791
|
-
return () => observer.disconnect();
|
|
3792
|
-
}, [elementRef]);
|
|
3793
|
-
return isVisible;
|
|
3794
|
-
};
|
|
3795
|
-
|
|
3796
5040
|
// ../renderers/src/step/StepHeader.tsx
|
|
3797
5041
|
import { Title as Title2 } from "@transferwise/components";
|
|
3798
|
-
import { Fragment as
|
|
5042
|
+
import { Fragment as Fragment14, jsx as jsx85, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
3799
5043
|
var StepHeader = ({ title, description, tags }) => {
|
|
3800
5044
|
const { titleType, alignmentClassName } = getHeaderStyle(tags);
|
|
3801
|
-
return /* @__PURE__ */
|
|
3802
|
-
title ? /* @__PURE__ */
|
|
3803
|
-
description ? /* @__PURE__ */
|
|
5045
|
+
return /* @__PURE__ */ jsxs29(Fragment14, { children: [
|
|
5046
|
+
title ? /* @__PURE__ */ jsx85(Title2, { as: "h1", type: titleType, className: `${alignmentClassName} m-b-2`, children: title }) : void 0,
|
|
5047
|
+
description ? /* @__PURE__ */ jsx85("p", { className: `${alignmentClassName} np-text-body-large`, children: description }) : void 0
|
|
3804
5048
|
] });
|
|
3805
5049
|
};
|
|
3806
5050
|
var getHeaderStyle = (tags) => {
|
|
@@ -3826,30 +5070,30 @@ var back_messages_default = defineMessages12({
|
|
|
3826
5070
|
});
|
|
3827
5071
|
|
|
3828
5072
|
// ../renderers/src/step/topbar/BackButton.tsx
|
|
3829
|
-
import { jsx as
|
|
5073
|
+
import { jsx as jsx86, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
3830
5074
|
function BackButton({ title, onClick }) {
|
|
3831
5075
|
const { formatMessage } = useIntl15();
|
|
3832
|
-
return /* @__PURE__ */
|
|
3833
|
-
/* @__PURE__ */
|
|
3834
|
-
/* @__PURE__ */
|
|
5076
|
+
return /* @__PURE__ */ jsxs30(IconButton, { className: "df-back-button", priority: "tertiary", onClick, children: [
|
|
5077
|
+
/* @__PURE__ */ jsx86("span", { className: "sr-only", children: title != null ? title : formatMessage(back_messages_default.back) }),
|
|
5078
|
+
/* @__PURE__ */ jsx86(ArrowLeft, {})
|
|
3835
5079
|
] });
|
|
3836
5080
|
}
|
|
3837
5081
|
|
|
3838
5082
|
// ../renderers/src/step/topbar/Toolbar.tsx
|
|
3839
|
-
import { Button as
|
|
3840
|
-
import { jsx as
|
|
5083
|
+
import { Button as Button9, IconButton as IconButton2 } from "@transferwise/components";
|
|
5084
|
+
import { jsx as jsx87, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
3841
5085
|
var Toolbar = ({ items }) => {
|
|
3842
|
-
return (items == null ? void 0 : items.length) > 0 ? /* @__PURE__ */
|
|
5086
|
+
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;
|
|
3843
5087
|
};
|
|
3844
5088
|
function ToolbarButton(props) {
|
|
3845
|
-
return prefersMedia(props.control) ? /* @__PURE__ */
|
|
5089
|
+
return prefersMedia(props.control) ? /* @__PURE__ */ jsx87(MediaToolbarButton, __spreadValues({}, props)) : /* @__PURE__ */ jsx87(TextToolbarButton, __spreadValues({}, props));
|
|
3846
5090
|
}
|
|
3847
5091
|
function MediaToolbarButton(props) {
|
|
3848
5092
|
var _a;
|
|
3849
5093
|
const { context, control, media, accessibilityDescription, disabled, onClick } = props;
|
|
3850
5094
|
const priority = getIconButtonPriority(control);
|
|
3851
5095
|
const type = getSentiment2(context);
|
|
3852
|
-
return /* @__PURE__ */
|
|
5096
|
+
return /* @__PURE__ */ jsxs31(
|
|
3853
5097
|
IconButton2,
|
|
3854
5098
|
{
|
|
3855
5099
|
className: "df-toolbar-button",
|
|
@@ -3859,7 +5103,7 @@ function MediaToolbarButton(props) {
|
|
|
3859
5103
|
type,
|
|
3860
5104
|
onClick,
|
|
3861
5105
|
children: [
|
|
3862
|
-
accessibilityDescription ? /* @__PURE__ */
|
|
5106
|
+
accessibilityDescription ? /* @__PURE__ */ jsx87("span", { className: "sr-only", children: accessibilityDescription }) : null,
|
|
3863
5107
|
media ? (_a = getAddonStartMedia(media)) == null ? void 0 : _a.value : null
|
|
3864
5108
|
]
|
|
3865
5109
|
}
|
|
@@ -3870,8 +5114,8 @@ function TextToolbarButton(props) {
|
|
|
3870
5114
|
const addonStart = media ? getAddonStartMedia(media) : void 0;
|
|
3871
5115
|
const priority = getPriority2(control);
|
|
3872
5116
|
const sentiment = getSentiment2(context);
|
|
3873
|
-
return /* @__PURE__ */
|
|
3874
|
-
|
|
5117
|
+
return /* @__PURE__ */ jsx87(
|
|
5118
|
+
Button9,
|
|
3875
5119
|
{
|
|
3876
5120
|
v2: true,
|
|
3877
5121
|
size: "sm",
|
|
@@ -3900,18 +5144,18 @@ var getIconButtonPriority = (control) => {
|
|
|
3900
5144
|
};
|
|
3901
5145
|
|
|
3902
5146
|
// ../renderers/src/step/topbar/TopBar.tsx
|
|
3903
|
-
import { jsx as
|
|
5147
|
+
import { jsx as jsx88, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
3904
5148
|
function TopBar({ back, toolbar, tags }) {
|
|
3905
5149
|
const isBackAllowed = !(tags == null ? void 0 : tags.includes("non-dismissible"));
|
|
3906
5150
|
const backCTA = isBackAllowed ? back : void 0;
|
|
3907
|
-
return backCTA || toolbar ? /* @__PURE__ */
|
|
3908
|
-
backCTA ? /* @__PURE__ */
|
|
3909
|
-
toolbar ? /* @__PURE__ */
|
|
5151
|
+
return backCTA || toolbar ? /* @__PURE__ */ jsxs32("div", { className: "d-flex m-b-2", children: [
|
|
5152
|
+
backCTA ? /* @__PURE__ */ jsx88(BackButton, __spreadValues({}, backCTA)) : null,
|
|
5153
|
+
toolbar ? /* @__PURE__ */ jsx88(Toolbar, __spreadValues({}, toolbar)) : null
|
|
3910
5154
|
] }) : null;
|
|
3911
5155
|
}
|
|
3912
5156
|
|
|
3913
5157
|
// ../renderers/src/step/SplashCelebrationStepRenderer.tsx
|
|
3914
|
-
import { jsx as
|
|
5158
|
+
import { jsx as jsx89, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
3915
5159
|
var SplashCelebrationStepRenderer = {
|
|
3916
5160
|
canRenderType: "step",
|
|
3917
5161
|
canRender: ({ control }) => control === "splash-celebration",
|
|
@@ -3920,16 +5164,16 @@ var SplashCelebrationStepRenderer = {
|
|
|
3920
5164
|
function SplashCelebrationStepRendererComponent(props) {
|
|
3921
5165
|
const { back, title, description, toolbar, children, footer, tags, trackEvent } = props;
|
|
3922
5166
|
useCustomTheme("forest-green", trackEvent);
|
|
3923
|
-
return /* @__PURE__ */
|
|
3924
|
-
/* @__PURE__ */
|
|
3925
|
-
title || description ? /* @__PURE__ */
|
|
5167
|
+
return /* @__PURE__ */ jsxs33("div", { className: "splash-screen m-t-5", children: [
|
|
5168
|
+
/* @__PURE__ */ jsx89(TopBar, { back, toolbar, tags }),
|
|
5169
|
+
title || description ? /* @__PURE__ */ jsx89("div", { className: "m-b-4", children: /* @__PURE__ */ jsx89(StepHeader, { title, description, tags }) }) : void 0,
|
|
3926
5170
|
children,
|
|
3927
|
-
/* @__PURE__ */
|
|
5171
|
+
/* @__PURE__ */ jsx89(StepFooter, { footer, tags })
|
|
3928
5172
|
] });
|
|
3929
5173
|
}
|
|
3930
5174
|
|
|
3931
5175
|
// ../renderers/src/step/SplashStepRenderer.tsx
|
|
3932
|
-
import { jsx as
|
|
5176
|
+
import { jsx as jsx90, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
3933
5177
|
var SplashStepRenderer = {
|
|
3934
5178
|
canRenderType: "step",
|
|
3935
5179
|
canRender: ({ control }) => control === "splash",
|
|
@@ -3937,55 +5181,55 @@ var SplashStepRenderer = {
|
|
|
3937
5181
|
};
|
|
3938
5182
|
function SplashStepRendererComponent(props) {
|
|
3939
5183
|
const { back, title, description, toolbar, children, footer, tags } = props;
|
|
3940
|
-
return /* @__PURE__ */
|
|
3941
|
-
/* @__PURE__ */
|
|
3942
|
-
title || description ? /* @__PURE__ */
|
|
5184
|
+
return /* @__PURE__ */ jsxs34("div", { className: "splash-screen m-t-5", children: [
|
|
5185
|
+
/* @__PURE__ */ jsx90(TopBar, { back, toolbar, tags }),
|
|
5186
|
+
title || description ? /* @__PURE__ */ jsx90("div", { className: "m-b-4", children: /* @__PURE__ */ jsx90(StepHeader, { title, description, tags }) }) : void 0,
|
|
3943
5187
|
children,
|
|
3944
|
-
/* @__PURE__ */
|
|
5188
|
+
/* @__PURE__ */ jsx90(StepFooter, { footer, tags })
|
|
3945
5189
|
] });
|
|
3946
5190
|
}
|
|
3947
5191
|
|
|
3948
5192
|
// ../renderers/src/step/StepRenderer.tsx
|
|
3949
5193
|
import { Alert as Alert2 } from "@transferwise/components";
|
|
3950
|
-
import { jsx as
|
|
5194
|
+
import { jsx as jsx91, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
3951
5195
|
var StepRenderer = {
|
|
3952
5196
|
canRenderType: "step",
|
|
3953
5197
|
render: StepRendererComponent
|
|
3954
5198
|
};
|
|
3955
5199
|
function StepRendererComponent(props) {
|
|
3956
5200
|
const { back, description, error, title, children, toolbar, footer, tags } = props;
|
|
3957
|
-
return /* @__PURE__ */
|
|
3958
|
-
/* @__PURE__ */
|
|
3959
|
-
title || description ? /* @__PURE__ */
|
|
3960
|
-
error ? /* @__PURE__ */
|
|
5201
|
+
return /* @__PURE__ */ jsxs35("div", { children: [
|
|
5202
|
+
/* @__PURE__ */ jsx91(TopBar, { back, toolbar, tags }),
|
|
5203
|
+
title || description ? /* @__PURE__ */ jsx91("div", { className: "m-b-4", children: /* @__PURE__ */ jsx91(StepHeader, { title, description, tags }) }) : void 0,
|
|
5204
|
+
error ? /* @__PURE__ */ jsx91(Alert2, { type: "negative", className: "m-b-2", message: error }) : null,
|
|
3961
5205
|
children,
|
|
3962
|
-
/* @__PURE__ */
|
|
5206
|
+
/* @__PURE__ */ jsx91(StepFooter, { footer, tags })
|
|
3963
5207
|
] });
|
|
3964
5208
|
}
|
|
3965
5209
|
|
|
3966
5210
|
// ../renderers/src/TabsRenderer.tsx
|
|
3967
|
-
import { Chips, SegmentedControl as SegmentedControl2, Tabs as Tabs2 } from "@transferwise/components";
|
|
3968
|
-
import { useState as
|
|
3969
|
-
import { jsx as
|
|
5211
|
+
import { Chips as Chips2, SegmentedControl as SegmentedControl2, Tabs as Tabs2 } from "@transferwise/components";
|
|
5212
|
+
import { useState as useState14 } from "react";
|
|
5213
|
+
import { jsx as jsx92, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
3970
5214
|
var TabsRenderer = {
|
|
3971
5215
|
canRenderType: "tabs",
|
|
3972
5216
|
render: (props) => {
|
|
3973
5217
|
switch (props.control) {
|
|
3974
5218
|
case "segmented":
|
|
3975
5219
|
if (props.tabs.length > 3) {
|
|
3976
|
-
return /* @__PURE__ */
|
|
5220
|
+
return /* @__PURE__ */ jsx92(TabsRendererComponent, __spreadValues({}, props));
|
|
3977
5221
|
}
|
|
3978
|
-
return /* @__PURE__ */
|
|
5222
|
+
return /* @__PURE__ */ jsx92(SegmentedTabsRendererComponent, __spreadValues({}, props));
|
|
3979
5223
|
case "chips":
|
|
3980
|
-
return /* @__PURE__ */
|
|
5224
|
+
return /* @__PURE__ */ jsx92(ChipsTabsRendererComponent, __spreadValues({}, props));
|
|
3981
5225
|
default:
|
|
3982
|
-
return /* @__PURE__ */
|
|
5226
|
+
return /* @__PURE__ */ jsx92(TabsRendererComponent, __spreadValues({}, props));
|
|
3983
5227
|
}
|
|
3984
5228
|
}
|
|
3985
5229
|
};
|
|
3986
5230
|
function TabsRendererComponent({ uid, margin, tabs }) {
|
|
3987
|
-
const [selectedIndex, setSelectedIndex] =
|
|
3988
|
-
return /* @__PURE__ */
|
|
5231
|
+
const [selectedIndex, setSelectedIndex] = useState14(0);
|
|
5232
|
+
return /* @__PURE__ */ jsx92("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx92(
|
|
3989
5233
|
Tabs2,
|
|
3990
5234
|
{
|
|
3991
5235
|
name: uid,
|
|
@@ -3993,7 +5237,7 @@ function TabsRendererComponent({ uid, margin, tabs }) {
|
|
|
3993
5237
|
tabs: tabs.map((option) => ({
|
|
3994
5238
|
title: option.title,
|
|
3995
5239
|
disabled: false,
|
|
3996
|
-
content: /* @__PURE__ */
|
|
5240
|
+
content: /* @__PURE__ */ jsxs36("div", { className: "m-t-2", children: [
|
|
3997
5241
|
" ",
|
|
3998
5242
|
option.children,
|
|
3999
5243
|
" "
|
|
@@ -4005,9 +5249,9 @@ function TabsRendererComponent({ uid, margin, tabs }) {
|
|
|
4005
5249
|
}
|
|
4006
5250
|
function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
|
|
4007
5251
|
var _a;
|
|
4008
|
-
const [selectedIndex, setSelectedIndex] =
|
|
4009
|
-
return /* @__PURE__ */
|
|
4010
|
-
/* @__PURE__ */
|
|
5252
|
+
const [selectedIndex, setSelectedIndex] = useState14(0);
|
|
5253
|
+
return /* @__PURE__ */ jsxs36("div", { className: getMargin(margin), children: [
|
|
5254
|
+
/* @__PURE__ */ jsx92(
|
|
4011
5255
|
SegmentedControl2,
|
|
4012
5256
|
{
|
|
4013
5257
|
name: uid,
|
|
@@ -4022,37 +5266,37 @@ function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
|
|
|
4022
5266
|
onChange: (value) => setSelectedIndex(Number(value))
|
|
4023
5267
|
}
|
|
4024
5268
|
),
|
|
4025
|
-
/* @__PURE__ */
|
|
5269
|
+
/* @__PURE__ */ jsx92("div", { id: `${uid}-children`, className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
4026
5270
|
] });
|
|
4027
5271
|
}
|
|
4028
5272
|
function ChipsTabsRendererComponent({ margin, tabs }) {
|
|
4029
5273
|
var _a;
|
|
4030
|
-
const [selectedIndex, setSelectedIndex] =
|
|
4031
|
-
return /* @__PURE__ */
|
|
4032
|
-
/* @__PURE__ */
|
|
4033
|
-
|
|
5274
|
+
const [selectedIndex, setSelectedIndex] = useState14(0);
|
|
5275
|
+
return /* @__PURE__ */ jsxs36("div", { className: getMargin(margin), children: [
|
|
5276
|
+
/* @__PURE__ */ jsx92("div", { className: "chips-container", children: /* @__PURE__ */ jsx92(
|
|
5277
|
+
Chips2,
|
|
4034
5278
|
{
|
|
4035
5279
|
chips: tabs.map((tab, index) => ({ label: tab.title, value: index })),
|
|
4036
5280
|
selected: selectedIndex,
|
|
4037
5281
|
onChange: ({ selectedValue }) => setSelectedIndex(Number(selectedValue))
|
|
4038
5282
|
}
|
|
4039
5283
|
) }),
|
|
4040
|
-
/* @__PURE__ */
|
|
5284
|
+
/* @__PURE__ */ jsx92("div", { className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
4041
5285
|
] });
|
|
4042
5286
|
}
|
|
4043
5287
|
|
|
4044
5288
|
// ../renderers/src/TextInputRenderer.tsx
|
|
4045
|
-
import { InputGroup as
|
|
5289
|
+
import { InputGroup as InputGroup5 } from "@transferwise/components";
|
|
4046
5290
|
|
|
4047
5291
|
// ../renderers/src/components/VariableTextInput.tsx
|
|
4048
5292
|
import {
|
|
4049
|
-
Input as
|
|
5293
|
+
Input as Input6,
|
|
4050
5294
|
InputWithDisplayFormat,
|
|
4051
5295
|
PhoneNumberInput,
|
|
4052
5296
|
TextArea,
|
|
4053
5297
|
TextareaWithDisplayFormat
|
|
4054
5298
|
} from "@transferwise/components";
|
|
4055
|
-
import { jsx as
|
|
5299
|
+
import { jsx as jsx93 } from "react/jsx-runtime";
|
|
4056
5300
|
var commonKeys = [
|
|
4057
5301
|
"autoComplete",
|
|
4058
5302
|
"autoCapitalize",
|
|
@@ -4071,12 +5315,12 @@ function VariableTextInput(inputProps) {
|
|
|
4071
5315
|
const commonProps = __spreadProps(__spreadValues({}, pick(inputProps, ...commonKeys)), { name: id });
|
|
4072
5316
|
switch (control) {
|
|
4073
5317
|
case "email":
|
|
4074
|
-
return /* @__PURE__ */
|
|
5318
|
+
return /* @__PURE__ */ jsx93(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "email", onChange }));
|
|
4075
5319
|
case "password":
|
|
4076
|
-
return /* @__PURE__ */
|
|
5320
|
+
return /* @__PURE__ */ jsx93(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "password", onChange }));
|
|
4077
5321
|
case "numeric": {
|
|
4078
5322
|
const numericProps = __spreadProps(__spreadValues({}, commonProps), { type: "number", onWheel });
|
|
4079
|
-
return /* @__PURE__ */
|
|
5323
|
+
return /* @__PURE__ */ jsx93(
|
|
4080
5324
|
TextInput,
|
|
4081
5325
|
__spreadProps(__spreadValues({}, numericProps), {
|
|
4082
5326
|
onChange: (newValue) => {
|
|
@@ -4087,21 +5331,21 @@ function VariableTextInput(inputProps) {
|
|
|
4087
5331
|
);
|
|
4088
5332
|
}
|
|
4089
5333
|
case "phone-number":
|
|
4090
|
-
return /* @__PURE__ */
|
|
5334
|
+
return /* @__PURE__ */ jsx93(PhoneNumberInput, __spreadProps(__spreadValues({ initialValue: value }, commonProps), { onChange }));
|
|
4091
5335
|
default: {
|
|
4092
|
-
return /* @__PURE__ */
|
|
5336
|
+
return /* @__PURE__ */ jsx93(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "text", onChange }));
|
|
4093
5337
|
}
|
|
4094
5338
|
}
|
|
4095
5339
|
}
|
|
4096
5340
|
function TextInput(props) {
|
|
4097
5341
|
const _a = props, { control, displayFormat, onChange } = _a, commonProps = __objRest(_a, ["control", "displayFormat", "onChange"]);
|
|
4098
5342
|
const InputWithPattern = control === "textarea" ? TextareaWithDisplayFormat : InputWithDisplayFormat;
|
|
4099
|
-
const InputWithoutPattern = control === "textarea" ? TextArea :
|
|
4100
|
-
return displayFormat ? /* @__PURE__ */
|
|
5343
|
+
const InputWithoutPattern = control === "textarea" ? TextArea : Input6;
|
|
5344
|
+
return displayFormat ? /* @__PURE__ */ jsx93(InputWithPattern, __spreadProps(__spreadValues({ displayPattern: displayFormat }, commonProps), { onChange })) : /* @__PURE__ */ jsx93(InputWithoutPattern, __spreadProps(__spreadValues({}, commonProps), { onChange: (e) => onChange(e.target.value) }));
|
|
4101
5345
|
}
|
|
4102
5346
|
|
|
4103
5347
|
// ../renderers/src/TextInputRenderer.tsx
|
|
4104
|
-
import { jsx as
|
|
5348
|
+
import { jsx as jsx94 } from "react/jsx-runtime";
|
|
4105
5349
|
var TextInputRenderer = {
|
|
4106
5350
|
canRenderType: "input-text",
|
|
4107
5351
|
render: (props) => {
|
|
@@ -4134,7 +5378,7 @@ var TextInputRenderer = {
|
|
|
4134
5378
|
}
|
|
4135
5379
|
}
|
|
4136
5380
|
});
|
|
4137
|
-
return /* @__PURE__ */
|
|
5381
|
+
return /* @__PURE__ */ jsx94(
|
|
4138
5382
|
FieldInput_default,
|
|
4139
5383
|
{
|
|
4140
5384
|
id,
|
|
@@ -4145,7 +5389,7 @@ var TextInputRenderer = {
|
|
|
4145
5389
|
loadingState: props.fieldLoadingState,
|
|
4146
5390
|
help,
|
|
4147
5391
|
features: props.features,
|
|
4148
|
-
children: /* @__PURE__ */
|
|
5392
|
+
children: /* @__PURE__ */ jsx94(InputGroup5, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ jsx94(VariableTextInput, __spreadValues({}, inputProps)) })
|
|
4149
5393
|
}
|
|
4150
5394
|
);
|
|
4151
5395
|
}
|
|
@@ -4159,7 +5403,7 @@ import { Status as Status2, Upload, UploadInput as UploadInput2 } from "@transfe
|
|
|
4159
5403
|
var getRandomId = () => Math.random().toString(36).substring(2);
|
|
4160
5404
|
|
|
4161
5405
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
4162
|
-
import { jsx as
|
|
5406
|
+
import { jsx as jsx95 } from "react/jsx-runtime";
|
|
4163
5407
|
var UploadInputRenderer = {
|
|
4164
5408
|
canRenderType: "input-upload",
|
|
4165
5409
|
render: (props) => {
|
|
@@ -4186,7 +5430,7 @@ var UploadInputRenderer = {
|
|
|
4186
5430
|
};
|
|
4187
5431
|
return (
|
|
4188
5432
|
// We don't pass help here as there is no sensible place to display it
|
|
4189
|
-
/* @__PURE__ */
|
|
5433
|
+
/* @__PURE__ */ jsx95(
|
|
4190
5434
|
UploadFieldInput_default,
|
|
4191
5435
|
{
|
|
4192
5436
|
id,
|
|
@@ -4194,7 +5438,7 @@ var UploadInputRenderer = {
|
|
|
4194
5438
|
description: void 0,
|
|
4195
5439
|
validation: validationState,
|
|
4196
5440
|
features,
|
|
4197
|
-
children: /* @__PURE__ */
|
|
5441
|
+
children: /* @__PURE__ */ jsx95(
|
|
4198
5442
|
UploadInput2,
|
|
4199
5443
|
{
|
|
4200
5444
|
id,
|
|
@@ -4262,7 +5506,7 @@ var LargeUploadRenderer = {
|
|
|
4262
5506
|
};
|
|
4263
5507
|
const filetypes = acceptsToFileTypes(accepts);
|
|
4264
5508
|
const usAccept = filetypes === "*" ? "*" : filetypes.join(",");
|
|
4265
|
-
return /* @__PURE__ */
|
|
5509
|
+
return /* @__PURE__ */ jsx95(
|
|
4266
5510
|
FieldInput_default,
|
|
4267
5511
|
{
|
|
4268
5512
|
id,
|
|
@@ -4271,7 +5515,7 @@ var LargeUploadRenderer = {
|
|
|
4271
5515
|
validation: validationState,
|
|
4272
5516
|
help,
|
|
4273
5517
|
features,
|
|
4274
|
-
children: /* @__PURE__ */
|
|
5518
|
+
children: /* @__PURE__ */ jsx95(
|
|
4275
5519
|
Upload,
|
|
4276
5520
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
4277
5521
|
usAccept,
|
|
@@ -4288,16 +5532,16 @@ var LargeUploadRenderer = {
|
|
|
4288
5532
|
|
|
4289
5533
|
// ../renderers/src/UpsellRenderer.tsx
|
|
4290
5534
|
import { Nudge } from "@transferwise/components";
|
|
4291
|
-
import { useState as
|
|
4292
|
-
import { jsx as
|
|
5535
|
+
import { useState as useState15 } from "react";
|
|
5536
|
+
import { jsx as jsx96 } from "react/jsx-runtime";
|
|
4293
5537
|
var UpsellRenderer = {
|
|
4294
5538
|
canRenderType: "upsell",
|
|
4295
5539
|
render: UpsellRendererComponent
|
|
4296
5540
|
};
|
|
4297
5541
|
function UpsellRendererComponent(props) {
|
|
4298
5542
|
const { text, callToAction, media, margin, onDismiss } = props;
|
|
4299
|
-
const [isVisible, setIsVisible] =
|
|
4300
|
-
return isVisible ? /* @__PURE__ */
|
|
5543
|
+
const [isVisible, setIsVisible] = useState15(true);
|
|
5544
|
+
return isVisible ? /* @__PURE__ */ jsx96(
|
|
4301
5545
|
Nudge,
|
|
4302
5546
|
{
|
|
4303
5547
|
className: getMargin(margin),
|
|
@@ -4346,7 +5590,7 @@ var supportedMediaNames = [
|
|
|
4346
5590
|
// ../renderers/src/ButtonRenderer/CircularButtonRenderer.tsx
|
|
4347
5591
|
import { CircularButton } from "@transferwise/components";
|
|
4348
5592
|
var import_classnames8 = __toESM(require_classnames());
|
|
4349
|
-
import { jsx as
|
|
5593
|
+
import { jsx as jsx97 } from "react/jsx-runtime";
|
|
4350
5594
|
var CircularButtonRenderer = {
|
|
4351
5595
|
canRenderType: "button",
|
|
4352
5596
|
canRender: ({ control }) => control === "circular",
|
|
@@ -4356,7 +5600,7 @@ function CircularButtonComponent(props) {
|
|
|
4356
5600
|
var _a;
|
|
4357
5601
|
const { context, disabled, margin, media, tags, title, onClick } = props;
|
|
4358
5602
|
const priority = tags == null ? void 0 : tags.find((tag) => tag === "primary" || tag === "secondary");
|
|
4359
|
-
return /* @__PURE__ */
|
|
5603
|
+
return /* @__PURE__ */ jsx97("div", { className: (0, import_classnames8.default)(getMargin(margin), "df-button", "circular"), children: /* @__PURE__ */ jsx97(
|
|
4360
5604
|
CircularButton,
|
|
4361
5605
|
{
|
|
4362
5606
|
disabled,
|
|
@@ -4376,6 +5620,7 @@ var getWiseRenderers = () => [
|
|
|
4376
5620
|
CheckboxInputRenderer_default,
|
|
4377
5621
|
CircularButtonRenderer,
|
|
4378
5622
|
BoxRenderer_default,
|
|
5623
|
+
CollectionRenderer_default,
|
|
4379
5624
|
ButtonRenderer,
|
|
4380
5625
|
ColumnsRenderer_default,
|
|
4381
5626
|
DateInputRenderer_default,
|
|
@@ -4420,11 +5665,11 @@ var getWiseRenderers = () => [
|
|
|
4420
5665
|
|
|
4421
5666
|
// ../renderers/src/InitialLoadingStateRenderer.tsx
|
|
4422
5667
|
import { Loader as Loader2 } from "@transferwise/components";
|
|
4423
|
-
import { jsx as
|
|
5668
|
+
import { jsx as jsx98 } from "react/jsx-runtime";
|
|
4424
5669
|
var InitialLoadingStateRenderer = {
|
|
4425
5670
|
canRenderType: "loading-state",
|
|
4426
5671
|
canRender: ({ stepLoadingState }) => stepLoadingState === "initial",
|
|
4427
|
-
render: () => /* @__PURE__ */
|
|
5672
|
+
render: () => /* @__PURE__ */ jsx98(
|
|
4428
5673
|
Loader2,
|
|
4429
5674
|
{
|
|
4430
5675
|
size: "md",
|
|
@@ -4437,24 +5682,24 @@ var InitialLoadingStateRenderer = {
|
|
|
4437
5682
|
// src/dynamicFlow/DynamicFlowModal.tsx
|
|
4438
5683
|
import { useDynamicFlowModal } from "@wise/dynamic-flow-client";
|
|
4439
5684
|
import { Modal as Modal5 } from "@transferwise/components";
|
|
4440
|
-
import { jsx as
|
|
5685
|
+
import { jsx as jsx99 } from "react/jsx-runtime";
|
|
4441
5686
|
function DynamicFlowModal(props) {
|
|
4442
5687
|
const _a = props, { className = "" } = _a, rest = __objRest(_a, ["className"]);
|
|
4443
5688
|
const dfProps = useWiseToCoreProps(rest);
|
|
4444
5689
|
const df = useDynamicFlowModal(dfProps);
|
|
4445
|
-
return /* @__PURE__ */
|
|
5690
|
+
return /* @__PURE__ */ jsx99(
|
|
4446
5691
|
Modal5,
|
|
4447
5692
|
__spreadProps(__spreadValues({
|
|
4448
5693
|
className: `dynamic-flow-modal ${className}`,
|
|
4449
5694
|
disableDimmerClickToClose: true
|
|
4450
5695
|
}, df.modal), {
|
|
4451
|
-
body: /* @__PURE__ */
|
|
5696
|
+
body: /* @__PURE__ */ jsx99("div", { className: "dynamic-flow-modal", children: df.modal.body })
|
|
4452
5697
|
})
|
|
4453
5698
|
);
|
|
4454
5699
|
}
|
|
4455
5700
|
|
|
4456
5701
|
// src/dynamicFlow/getMergedRenderers.tsx
|
|
4457
|
-
import { jsx as
|
|
5702
|
+
import { jsx as jsx100 } from "react/jsx-runtime";
|
|
4458
5703
|
var wiseRenderers = getWiseRenderers();
|
|
4459
5704
|
var getMergedRenderers = (props) => {
|
|
4460
5705
|
var _d, _e;
|
|
@@ -4468,7 +5713,7 @@ var getMergedRenderers = (props) => {
|
|
|
4468
5713
|
method: initialRequest.method,
|
|
4469
5714
|
data: initialRequest.body
|
|
4470
5715
|
};
|
|
4471
|
-
return presentation.type === "push" ? /* @__PURE__ */
|
|
5716
|
+
return presentation.type === "push" ? /* @__PURE__ */ jsx100(DynamicFlow, __spreadProps(__spreadValues(__spreadValues({}, restProps), rest), { features: subflowFeatures, initialAction: action })) : /* @__PURE__ */ jsx100(
|
|
4472
5717
|
DynamicFlowModal,
|
|
4473
5718
|
__spreadProps(__spreadValues(__spreadValues({}, restProps), rest), {
|
|
4474
5719
|
features: subflowFeatures,
|
|
@@ -4627,10 +5872,10 @@ var useWiseToCoreProps = (props) => {
|
|
|
4627
5872
|
onLog
|
|
4628
5873
|
} = props;
|
|
4629
5874
|
const httpClient = useWiseHttpClient(customFetch);
|
|
4630
|
-
const mergedRenderers =
|
|
5875
|
+
const mergedRenderers = useMemo3(() => getMergedRenderers(props), [renderers]);
|
|
4631
5876
|
const createSnackBar = useCreateSnackBar();
|
|
4632
|
-
const logEvent =
|
|
4633
|
-
const trackEvent =
|
|
5877
|
+
const logEvent = useMemo3(() => getLogEvent(onLog), [onLog]);
|
|
5878
|
+
const trackEvent = useMemo3(() => getTrackEvent(onEvent, onAnalytics), [onEvent, onAnalytics]);
|
|
4634
5879
|
const onCopy = useOnCopy();
|
|
4635
5880
|
return __spreadProps(__spreadValues({}, props), {
|
|
4636
5881
|
httpClient,
|
|
@@ -4662,13 +5907,13 @@ var openLinkInNewTab = (url) => {
|
|
|
4662
5907
|
};
|
|
4663
5908
|
|
|
4664
5909
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
4665
|
-
import { jsxs as
|
|
5910
|
+
import { jsxs as jsxs37 } from "react/jsx-runtime";
|
|
4666
5911
|
function DynamicFlow(props) {
|
|
4667
5912
|
const { className = "" } = props;
|
|
4668
5913
|
const dfProps = useWiseToCoreProps(props);
|
|
4669
5914
|
const df = useDynamicFlow(dfProps);
|
|
4670
5915
|
const { onContextMenu, contextMenu } = useDFContextMenu(df.controller);
|
|
4671
|
-
return /* @__PURE__ */
|
|
5916
|
+
return /* @__PURE__ */ jsxs37("div", { className, onContextMenu, children: [
|
|
4672
5917
|
df.view,
|
|
4673
5918
|
contextMenu
|
|
4674
5919
|
] });
|
|
@@ -4680,7 +5925,7 @@ import {
|
|
|
4680
5925
|
useImperativeHandle
|
|
4681
5926
|
} from "react";
|
|
4682
5927
|
import { useDynamicFlow as useDynamicFlow2 } from "@wise/dynamic-flow-client";
|
|
4683
|
-
import { jsx as
|
|
5928
|
+
import { jsx as jsx101 } from "react/jsx-runtime";
|
|
4684
5929
|
var DynamicFlowWithRef = forwardRef(function DynamicFlowWithRef2(props, ref) {
|
|
4685
5930
|
const { className = "" } = props;
|
|
4686
5931
|
const dfProps = useWiseToCoreProps(props);
|
|
@@ -4696,14 +5941,14 @@ var DynamicFlowWithRef = forwardRef(function DynamicFlowWithRef2(props, ref) {
|
|
|
4696
5941
|
}),
|
|
4697
5942
|
[df]
|
|
4698
5943
|
);
|
|
4699
|
-
return /* @__PURE__ */
|
|
5944
|
+
return /* @__PURE__ */ jsx101("div", { className, children: df.view });
|
|
4700
5945
|
});
|
|
4701
5946
|
|
|
4702
5947
|
// src/index.ts
|
|
4703
5948
|
import { findRendererPropsByType } from "@wise/dynamic-flow-client";
|
|
4704
5949
|
|
|
4705
5950
|
// src/dynamicFlow/renderers.tsx
|
|
4706
|
-
var Header10 =
|
|
5951
|
+
var Header10 = Header;
|
|
4707
5952
|
var Media2 = Media;
|
|
4708
5953
|
var getMargin2 = getMargin;
|
|
4709
5954
|
|