@wise/dynamic-flow-client-internal 5.23.0-experimental-2dcb025 → 5.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/main.js +663 -1871
- package/build/main.mjs +593 -1801
- package/build/tsconfig.types.tsbuildinfo +1 -1
- package/build/types/dynamicFlow/context-menu/useDFContextMenu.d.ts.map +1 -1
- package/build/types/dynamicFlow/getMergedRenderers.d.ts.map +1 -1
- package/build/types/dynamicFlow/messages.d.ts.map +1 -1
- package/build/types/dynamicFlow/renderers.d.ts +10 -4
- package/build/types/dynamicFlow/renderers.d.ts.map +1 -1
- package/build/types/dynamicFlow/telemetry/dispatchAnalyticsEvent.d.ts.map +1 -1
- package/build/types/dynamicFlow/telemetry/getLogEvent.d.ts.map +1 -1
- package/build/types/dynamicFlow/telemetry/getTrackEvent.d.ts.map +1 -1
- package/build/types/dynamicFlow/useWiseHttpClient.d.ts.map +1 -1
- package/build/types/dynamicFlow/useWiseToCoreProps.d.ts.map +1 -1
- package/build/types/i18n/index.d.ts.map +1 -1
- package/build/types/test-utils/NeptuneProviders.d.ts.map +1 -1
- package/build/types/test-utils/respond-with.d.ts.map +1 -1
- package/build/types/test-utils/rtl-utils.d.ts.map +1 -1
- package/build/types/test-utils/wait.d.ts.map +1 -1
- package/package.json +6 -6
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.23.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 useMemo2 } from "react";
|
|
315
315
|
|
|
316
316
|
// src/dynamicFlow/getMergedRenderers.tsx
|
|
317
317
|
import { getDynamicSubflowRenderer } from "@wise/dynamic-flow-client";
|
|
@@ -1101,1383 +1101,49 @@ var getInlineAlertOrValidation = (validationState, inlineAlert) => {
|
|
|
1101
1101
|
};
|
|
1102
1102
|
var CheckboxInputRenderer_default = CheckboxInputRenderer;
|
|
1103
1103
|
|
|
1104
|
-
// ../renderers/src/
|
|
1105
|
-
|
|
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
|
-
}
|
|
1104
|
+
// ../renderers/src/ColumnsRenderer.tsx
|
|
1105
|
+
var import_classnames3 = __toESM(require_classnames());
|
|
2027
1106
|
|
|
2028
|
-
//
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
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)
|
|
1107
|
+
// ../renderers/src/utils/useIsCollapsed.ts
|
|
1108
|
+
import { useEffect as useEffect5, useState as useState4 } from "react";
|
|
1109
|
+
var COLLAPSE_QUERY = "(max-width: 767.98px)";
|
|
1110
|
+
var supportsMatchMedia = () => typeof window !== "undefined" && !!window.matchMedia;
|
|
1111
|
+
var useIsCollapsed = () => {
|
|
1112
|
+
const [collapsed, setCollapsed] = useState4(
|
|
1113
|
+
() => supportsMatchMedia() && window.matchMedia(COLLAPSE_QUERY).matches
|
|
2050
1114
|
);
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
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)
|
|
1115
|
+
useEffect5(() => {
|
|
1116
|
+
if (supportsMatchMedia()) {
|
|
1117
|
+
const mql = window.matchMedia(COLLAPSE_QUERY);
|
|
1118
|
+
const update = () => setCollapsed(mql.matches);
|
|
1119
|
+
mql.addEventListener("change", update);
|
|
1120
|
+
return () => mql.removeEventListener("change", update);
|
|
2118
1121
|
}
|
|
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
1122
|
return void 0;
|
|
2329
|
-
}
|
|
2330
|
-
|
|
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
|
-
] });
|
|
1123
|
+
}, []);
|
|
1124
|
+
return collapsed;
|
|
2464
1125
|
};
|
|
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
1126
|
|
|
2475
1127
|
// ../renderers/src/ColumnsRenderer.tsx
|
|
2476
|
-
|
|
2477
|
-
|
|
1128
|
+
import { jsx as jsx24, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1129
|
+
var RIGHT_FIRST_STACKING = "right-first-stacking";
|
|
2478
1130
|
var ColumnsRenderer = {
|
|
2479
1131
|
canRenderType: "columns",
|
|
2480
|
-
render:
|
|
1132
|
+
render: ColumnsRendererComponent
|
|
1133
|
+
};
|
|
1134
|
+
function ColumnsRendererComponent({
|
|
1135
|
+
bias,
|
|
1136
|
+
margin,
|
|
1137
|
+
startChildren,
|
|
1138
|
+
endChildren,
|
|
1139
|
+
tags
|
|
1140
|
+
}) {
|
|
1141
|
+
var _a;
|
|
1142
|
+
const isCollapsed = useIsCollapsed();
|
|
1143
|
+
const reverse = isCollapsed && ((_a = tags == null ? void 0 : tags.includes(RIGHT_FIRST_STACKING)) != null ? _a : false);
|
|
1144
|
+
const startColumn = /* @__PURE__ */ jsx24("div", { className: "df-columns-renderer-column", children: startChildren });
|
|
1145
|
+
const endColumn = /* @__PURE__ */ jsx24("div", { className: "df-columns-renderer-column", children: endChildren });
|
|
1146
|
+
return /* @__PURE__ */ jsxs4(
|
|
2481
1147
|
"div",
|
|
2482
1148
|
{
|
|
2483
1149
|
className: (0, import_classnames3.default)("df-columns-renderer-container", getMargin(margin), {
|
|
@@ -2485,12 +1151,12 @@ var ColumnsRenderer = {
|
|
|
2485
1151
|
"df-columns-renderer-bias-end": bias === "end"
|
|
2486
1152
|
}),
|
|
2487
1153
|
children: [
|
|
2488
|
-
|
|
2489
|
-
|
|
1154
|
+
reverse ? endColumn : startColumn,
|
|
1155
|
+
reverse ? startColumn : endColumn
|
|
2490
1156
|
]
|
|
2491
1157
|
}
|
|
2492
|
-
)
|
|
2493
|
-
}
|
|
1158
|
+
);
|
|
1159
|
+
}
|
|
2494
1160
|
var ColumnsRenderer_default = ColumnsRenderer;
|
|
2495
1161
|
|
|
2496
1162
|
// ../renderers/src/components/VariableDateInput.tsx
|
|
@@ -2521,7 +1187,7 @@ var dateToDateString = (date) => {
|
|
|
2521
1187
|
};
|
|
2522
1188
|
|
|
2523
1189
|
// ../renderers/src/components/VariableDateInput.tsx
|
|
2524
|
-
import { jsx as
|
|
1190
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
2525
1191
|
function VariableDateInput({
|
|
2526
1192
|
control,
|
|
2527
1193
|
inputProps
|
|
@@ -2537,7 +1203,7 @@ function VariableDateInput({
|
|
|
2537
1203
|
onFocus
|
|
2538
1204
|
} = inputProps;
|
|
2539
1205
|
if (control === "date-lookup") {
|
|
2540
|
-
return /* @__PURE__ */
|
|
1206
|
+
return /* @__PURE__ */ jsx25(
|
|
2541
1207
|
DateLookup,
|
|
2542
1208
|
{
|
|
2543
1209
|
value: dateStringToDateOrNull(inputProps.value),
|
|
@@ -2553,7 +1219,7 @@ function VariableDateInput({
|
|
|
2553
1219
|
}
|
|
2554
1220
|
);
|
|
2555
1221
|
}
|
|
2556
|
-
return /* @__PURE__ */
|
|
1222
|
+
return /* @__PURE__ */ jsx25(
|
|
2557
1223
|
DateInput,
|
|
2558
1224
|
__spreadProps(__spreadValues({}, inputProps), {
|
|
2559
1225
|
dayAutoComplete: getAutocompleteString(autoComplete, "day"),
|
|
@@ -2570,7 +1236,7 @@ var getAutocompleteString = (value, suffix) => {
|
|
|
2570
1236
|
var VariableDateInput_default = VariableDateInput;
|
|
2571
1237
|
|
|
2572
1238
|
// ../renderers/src/DateInputRenderer.tsx
|
|
2573
|
-
import { jsx as
|
|
1239
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
2574
1240
|
var DateInputRenderer = {
|
|
2575
1241
|
canRenderType: "input-date",
|
|
2576
1242
|
render: (props) => {
|
|
@@ -2595,7 +1261,7 @@ var DateInputRenderer = {
|
|
|
2595
1261
|
]);
|
|
2596
1262
|
const value = initialValue != null ? initialValue : "";
|
|
2597
1263
|
const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
|
|
2598
|
-
return /* @__PURE__ */
|
|
1264
|
+
return /* @__PURE__ */ jsx26(
|
|
2599
1265
|
FieldInput_default,
|
|
2600
1266
|
{
|
|
2601
1267
|
id,
|
|
@@ -2606,7 +1272,7 @@ var DateInputRenderer = {
|
|
|
2606
1272
|
loadingState: props.fieldLoadingState,
|
|
2607
1273
|
help,
|
|
2608
1274
|
features: props.features,
|
|
2609
|
-
children: /* @__PURE__ */
|
|
1275
|
+
children: /* @__PURE__ */ jsx26(VariableDateInput_default, { control, inputProps })
|
|
2610
1276
|
}
|
|
2611
1277
|
);
|
|
2612
1278
|
}
|
|
@@ -2614,16 +1280,44 @@ var DateInputRenderer = {
|
|
|
2614
1280
|
var DateInputRenderer_default = DateInputRenderer;
|
|
2615
1281
|
|
|
2616
1282
|
// ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
|
|
2617
|
-
import { ListItem as
|
|
1283
|
+
import { ListItem as ListItem5 } from "@transferwise/components";
|
|
1284
|
+
|
|
1285
|
+
// ../renderers/src/utils/listItem/getAdditionalInfo.tsx
|
|
1286
|
+
import { ListItem as ListItem4 } from "@transferwise/components";
|
|
1287
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
1288
|
+
var getAdditionalInfo = (additionalInfo) => {
|
|
1289
|
+
var _a, _b;
|
|
1290
|
+
if (!additionalInfo) {
|
|
1291
|
+
return void 0;
|
|
1292
|
+
}
|
|
1293
|
+
const { href, text, onClick } = additionalInfo;
|
|
1294
|
+
if (href || onClick) {
|
|
1295
|
+
return /* @__PURE__ */ jsx27(
|
|
1296
|
+
ListItem4.AdditionalInfo,
|
|
1297
|
+
{
|
|
1298
|
+
action: __spreadValues({
|
|
1299
|
+
label: text
|
|
1300
|
+
}, (_b = (_a = additionalInfo.getAnchorProps) == null ? void 0 : _a.call(additionalInfo)) != null ? _b : { onClick })
|
|
1301
|
+
}
|
|
1302
|
+
);
|
|
1303
|
+
}
|
|
1304
|
+
return /* @__PURE__ */ jsx27(ListItem4.AdditionalInfo, { children: additionalInfo == null ? void 0 : additionalInfo.text });
|
|
1305
|
+
};
|
|
1306
|
+
|
|
1307
|
+
// ../renderers/src/utils/listItem/shouldUseAvatar.ts
|
|
1308
|
+
var shouldUseAvatar = (control, tags) => {
|
|
1309
|
+
var _a;
|
|
1310
|
+
return control === "with-avatar" || ((_a = tags == null ? void 0 : tags.includes("with-avatar")) != null ? _a : false);
|
|
1311
|
+
};
|
|
2618
1312
|
|
|
2619
1313
|
// ../renderers/src/DecisionRenderer/DecisionWrapper.tsx
|
|
2620
|
-
import { Header as
|
|
2621
|
-
import { useState as
|
|
2622
|
-
import { useIntl as
|
|
1314
|
+
import { Header as Header2, SearchInput } from "@transferwise/components";
|
|
1315
|
+
import { useState as useState5 } from "react";
|
|
1316
|
+
import { useIntl as useIntl4 } from "react-intl";
|
|
2623
1317
|
|
|
2624
1318
|
// ../renderers/src/messages/filter.messages.ts
|
|
2625
|
-
import { defineMessages as
|
|
2626
|
-
var filter_messages_default =
|
|
1319
|
+
import { defineMessages as defineMessages3 } from "react-intl";
|
|
1320
|
+
var filter_messages_default = defineMessages3({
|
|
2627
1321
|
placeholder: {
|
|
2628
1322
|
id: "df.wise.filter.placeholder",
|
|
2629
1323
|
defaultMessage: "Start typing to search",
|
|
@@ -2689,12 +1383,12 @@ function filterAndSortDecisionOptions(selectOptions, query) {
|
|
|
2689
1383
|
var normalizeAndRemoveAccents = (text) => text.trim().toLowerCase().normalize("NFKD").replace(new RegExp("\\p{Diacritic}", "gu"), "");
|
|
2690
1384
|
|
|
2691
1385
|
// ../renderers/src/DecisionRenderer/GroupedDecisionList.tsx
|
|
2692
|
-
import { Header
|
|
2693
|
-
import { useIntl as
|
|
1386
|
+
import { Header, Section } from "@transferwise/components";
|
|
1387
|
+
import { useIntl as useIntl3 } from "react-intl";
|
|
2694
1388
|
|
|
2695
1389
|
// ../renderers/src/messages/group.messages.ts
|
|
2696
|
-
import { defineMessages as
|
|
2697
|
-
var group_messages_default =
|
|
1390
|
+
import { defineMessages as defineMessages4 } from "react-intl";
|
|
1391
|
+
var group_messages_default = defineMessages4({
|
|
2698
1392
|
all: {
|
|
2699
1393
|
id: "df.wise.group.all",
|
|
2700
1394
|
defaultMessage: "All",
|
|
@@ -2728,19 +1422,19 @@ var getGroupsFromTags = (knownTags, items) => {
|
|
|
2728
1422
|
};
|
|
2729
1423
|
|
|
2730
1424
|
// ../renderers/src/DecisionRenderer/GroupedDecisionList.tsx
|
|
2731
|
-
import { Fragment
|
|
1425
|
+
import { Fragment, jsx as jsx28, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
2732
1426
|
var groupingTags = Object.keys(group_messages_default).filter((key) => key !== "all");
|
|
2733
1427
|
var isGroupedDecision = (options) => {
|
|
2734
1428
|
return getGroupsFromTags(groupingTags, options).length > 0;
|
|
2735
1429
|
};
|
|
2736
1430
|
var GroupedDecisionList = (_a) => {
|
|
2737
1431
|
var _b = _a, { renderDecisionList: renderDecisionList2 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
|
|
2738
|
-
const { formatMessage } =
|
|
1432
|
+
const { formatMessage } = useIntl3();
|
|
2739
1433
|
const { options } = rest;
|
|
2740
1434
|
const itemsByTag = [...getGroupsFromTags(groupingTags, options), { tag: "all", items: options }];
|
|
2741
|
-
return /* @__PURE__ */
|
|
2742
|
-
/* @__PURE__ */
|
|
2743
|
-
|
|
1435
|
+
return /* @__PURE__ */ jsx28(Fragment, { children: itemsByTag.map(({ tag, items }) => /* @__PURE__ */ jsxs5(Section, { children: [
|
|
1436
|
+
/* @__PURE__ */ jsx28(
|
|
1437
|
+
Header,
|
|
2744
1438
|
{
|
|
2745
1439
|
as: "h2",
|
|
2746
1440
|
title: tag in group_messages_default ? formatMessage(group_messages_default[tag]) : tag
|
|
@@ -2751,25 +1445,25 @@ var GroupedDecisionList = (_a) => {
|
|
|
2751
1445
|
};
|
|
2752
1446
|
|
|
2753
1447
|
// ../renderers/src/DecisionRenderer/DecisionWrapper.tsx
|
|
2754
|
-
import { Fragment as
|
|
1448
|
+
import { Fragment as Fragment2, jsx as jsx29, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2755
1449
|
var DecisionWrapper = (props) => {
|
|
2756
|
-
return /* @__PURE__ */
|
|
2757
|
-
props.title && /* @__PURE__ */
|
|
2758
|
-
props.control === "filtered" ? /* @__PURE__ */
|
|
1450
|
+
return /* @__PURE__ */ jsxs6("div", { className: getMargin(props.margin), children: [
|
|
1451
|
+
props.title && /* @__PURE__ */ jsx29(Header2, { as: "h2", title: props.title }),
|
|
1452
|
+
props.control === "filtered" ? /* @__PURE__ */ jsx29(FilteredDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ jsx29(UnfilteredDecisionList, __spreadValues({}, props))
|
|
2759
1453
|
] });
|
|
2760
1454
|
};
|
|
2761
1455
|
var UnfilteredDecisionList = (_a) => {
|
|
2762
1456
|
var _b = _a, { renderDecisionList: renderDecisionList2 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
|
|
2763
|
-
return isGroupedDecision(rest.options) ? /* @__PURE__ */
|
|
1457
|
+
return isGroupedDecision(rest.options) ? /* @__PURE__ */ jsx29(GroupedDecisionList, __spreadProps(__spreadValues({}, rest), { renderDecisionList: renderDecisionList2 })) : renderDecisionList2(rest);
|
|
2764
1458
|
};
|
|
2765
1459
|
var FilteredDecisionList = (props) => {
|
|
2766
|
-
const { formatMessage } =
|
|
2767
|
-
const [query, setQuery] =
|
|
1460
|
+
const { formatMessage } = useIntl4();
|
|
1461
|
+
const [query, setQuery] = useState5("");
|
|
2768
1462
|
const { control, options, renderDecisionList: renderDecisionList2 } = props;
|
|
2769
1463
|
const filteredOptions = (query == null ? void 0 : query.length) > 0 ? filterAndSortDecisionOptions(options, query) : options;
|
|
2770
1464
|
const isGrouped = isGroupedDecision(options);
|
|
2771
|
-
return /* @__PURE__ */
|
|
2772
|
-
/* @__PURE__ */
|
|
1465
|
+
return /* @__PURE__ */ jsxs6(Fragment2, { children: [
|
|
1466
|
+
/* @__PURE__ */ jsx29(
|
|
2773
1467
|
SearchInput,
|
|
2774
1468
|
{
|
|
2775
1469
|
placeholder: formatMessage(filter_messages_default.placeholder),
|
|
@@ -2781,25 +1475,25 @@ var FilteredDecisionList = (props) => {
|
|
|
2781
1475
|
}
|
|
2782
1476
|
}
|
|
2783
1477
|
),
|
|
2784
|
-
isGrouped && query.length === 0 ? /* @__PURE__ */
|
|
2785
|
-
query.length > 0 && /* @__PURE__ */
|
|
1478
|
+
isGrouped && query.length === 0 ? /* @__PURE__ */ jsx29(GroupedDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ jsxs6(Fragment2, { children: [
|
|
1479
|
+
query.length > 0 && /* @__PURE__ */ jsx29(Header2, { as: "h2", title: formatMessage(filter_messages_default.results), className: "m-t-4" }),
|
|
2786
1480
|
filteredOptions.length > 0 ? renderDecisionList2({
|
|
2787
1481
|
control,
|
|
2788
1482
|
className: query.length === 0 ? "m-t-3" : "",
|
|
2789
1483
|
options: filteredOptions
|
|
2790
|
-
}) : /* @__PURE__ */
|
|
1484
|
+
}) : /* @__PURE__ */ jsx29("p", { children: formatMessage(filter_messages_default.noResults) })
|
|
2791
1485
|
] })
|
|
2792
1486
|
] });
|
|
2793
1487
|
};
|
|
2794
1488
|
|
|
2795
1489
|
// ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
|
|
2796
|
-
import { Fragment as
|
|
1490
|
+
import { Fragment as Fragment3, jsx as jsx30 } from "react/jsx-runtime";
|
|
2797
1491
|
var DecisionRenderer = {
|
|
2798
1492
|
canRenderType: "decision",
|
|
2799
|
-
render: (props) => /* @__PURE__ */
|
|
1493
|
+
render: (props) => /* @__PURE__ */ jsx30(DecisionWrapper, __spreadProps(__spreadValues({}, props), { renderDecisionList }))
|
|
2800
1494
|
};
|
|
2801
1495
|
var renderDecisionList = ({ options, control }) => {
|
|
2802
|
-
return /* @__PURE__ */
|
|
1496
|
+
return /* @__PURE__ */ jsx30(Fragment3, { children: options.map((_a) => {
|
|
2803
1497
|
var _b = _a, { onClick } = _b, rest = __objRest(_b, ["onClick"]);
|
|
2804
1498
|
const {
|
|
2805
1499
|
description,
|
|
@@ -2812,8 +1506,8 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
2812
1506
|
supportingValues,
|
|
2813
1507
|
tags
|
|
2814
1508
|
} = rest;
|
|
2815
|
-
return /* @__PURE__ */
|
|
2816
|
-
|
|
1509
|
+
return /* @__PURE__ */ jsx30(
|
|
1510
|
+
ListItem5,
|
|
2817
1511
|
{
|
|
2818
1512
|
title: itemTitle,
|
|
2819
1513
|
subtitle: description,
|
|
@@ -2824,7 +1518,7 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
2824
1518
|
media: getMedia(media, shouldUseAvatar(control, tags)),
|
|
2825
1519
|
prompt: getInlineAlert(inlineAlert),
|
|
2826
1520
|
additionalInfo: additionalText ? getAdditionalInfo({ text: additionalText }) : void 0,
|
|
2827
|
-
control: /* @__PURE__ */
|
|
1521
|
+
control: /* @__PURE__ */ jsx30(ListItem5.Navigation, __spreadValues({}, getAnchorProps()))
|
|
2828
1522
|
},
|
|
2829
1523
|
JSON.stringify(rest)
|
|
2830
1524
|
);
|
|
@@ -2834,7 +1528,7 @@ var DecisionRenderer_default = DecisionRenderer;
|
|
|
2834
1528
|
|
|
2835
1529
|
// ../renderers/src/DividerRenderer.tsx
|
|
2836
1530
|
import { Divider } from "@transferwise/components";
|
|
2837
|
-
import { jsx as
|
|
1531
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
2838
1532
|
var mapControlToLevel = (control) => {
|
|
2839
1533
|
switch (control) {
|
|
2840
1534
|
case "section":
|
|
@@ -2847,16 +1541,16 @@ var mapControlToLevel = (control) => {
|
|
|
2847
1541
|
};
|
|
2848
1542
|
var DividerRenderer = {
|
|
2849
1543
|
canRenderType: "divider",
|
|
2850
|
-
render: ({ margin, control }) => /* @__PURE__ */
|
|
1544
|
+
render: ({ margin, control }) => /* @__PURE__ */ jsx31(Divider, { className: `m-t-0 d-block ${getMargin(margin)}`, level: mapControlToLevel(control) })
|
|
2851
1545
|
};
|
|
2852
1546
|
var DividerRenderer_default = DividerRenderer;
|
|
2853
1547
|
|
|
2854
1548
|
// ../renderers/src/ExternalConfirmationRenderer.tsx
|
|
2855
|
-
import { Button as
|
|
1549
|
+
import { Button as Button3, Markdown as Markdown2, Modal } from "@transferwise/components";
|
|
2856
1550
|
|
|
2857
1551
|
// ../renderers/src/messages/external-confirmation.messages.ts
|
|
2858
|
-
import { defineMessages as
|
|
2859
|
-
var external_confirmation_messages_default =
|
|
1552
|
+
import { defineMessages as defineMessages5 } from "react-intl";
|
|
1553
|
+
var external_confirmation_messages_default = defineMessages5({
|
|
2860
1554
|
title: {
|
|
2861
1555
|
id: "df.wise.ExternalConfirmation.title",
|
|
2862
1556
|
defaultMessage: "Please confirm",
|
|
@@ -2880,9 +1574,9 @@ var external_confirmation_messages_default = defineMessages6({
|
|
|
2880
1574
|
});
|
|
2881
1575
|
|
|
2882
1576
|
// ../renderers/src/ExternalConfirmationRenderer.tsx
|
|
2883
|
-
import { useIntl as
|
|
2884
|
-
import { useEffect as
|
|
2885
|
-
import { Fragment as
|
|
1577
|
+
import { useIntl as useIntl5 } from "react-intl";
|
|
1578
|
+
import { useEffect as useEffect6 } from "react";
|
|
1579
|
+
import { Fragment as Fragment4, jsx as jsx32, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2886
1580
|
var ExternalConfirmationRenderer = {
|
|
2887
1581
|
canRenderType: "external-confirmation",
|
|
2888
1582
|
render: ExternalConfirmationRendererComponent
|
|
@@ -2893,20 +1587,20 @@ function ExternalConfirmationRendererComponent({
|
|
|
2893
1587
|
open,
|
|
2894
1588
|
onCancel
|
|
2895
1589
|
}) {
|
|
2896
|
-
const { formatMessage } =
|
|
2897
|
-
|
|
1590
|
+
const { formatMessage } = useIntl5();
|
|
1591
|
+
useEffect6(() => {
|
|
2898
1592
|
open();
|
|
2899
1593
|
}, []);
|
|
2900
|
-
return /* @__PURE__ */
|
|
1594
|
+
return /* @__PURE__ */ jsx32(
|
|
2901
1595
|
Modal,
|
|
2902
1596
|
{
|
|
2903
1597
|
open: visible,
|
|
2904
1598
|
title: formatMessage(external_confirmation_messages_default.title),
|
|
2905
|
-
body: /* @__PURE__ */
|
|
2906
|
-
/* @__PURE__ */
|
|
2907
|
-
/* @__PURE__ */
|
|
2908
|
-
/* @__PURE__ */
|
|
2909
|
-
|
|
1599
|
+
body: /* @__PURE__ */ jsxs7(Fragment4, { children: [
|
|
1600
|
+
/* @__PURE__ */ jsx32(Markdown2, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(url) }) }),
|
|
1601
|
+
/* @__PURE__ */ jsx32("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ jsxs7("div", { className: "df-box-renderer-width-lg", children: [
|
|
1602
|
+
/* @__PURE__ */ jsx32(
|
|
1603
|
+
Button3,
|
|
2910
1604
|
{
|
|
2911
1605
|
v2: true,
|
|
2912
1606
|
block: true,
|
|
@@ -2919,7 +1613,7 @@ function ExternalConfirmationRendererComponent({
|
|
|
2919
1613
|
children: formatMessage(external_confirmation_messages_default.open)
|
|
2920
1614
|
}
|
|
2921
1615
|
),
|
|
2922
|
-
/* @__PURE__ */
|
|
1616
|
+
/* @__PURE__ */ jsx32(Button3, { v2: true, block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onCancel, children: formatMessage(external_confirmation_messages_default.cancel) })
|
|
2923
1617
|
] }) })
|
|
2924
1618
|
] }),
|
|
2925
1619
|
onClose: onCancel
|
|
@@ -2936,27 +1630,27 @@ function getOrigin(url) {
|
|
|
2936
1630
|
var ExternalConfirmationRenderer_default = ExternalConfirmationRenderer;
|
|
2937
1631
|
|
|
2938
1632
|
// ../renderers/src/FormRenderer.tsx
|
|
2939
|
-
import { jsx as
|
|
1633
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
2940
1634
|
var FormRenderer = {
|
|
2941
1635
|
canRenderType: "form",
|
|
2942
|
-
render: ({ children, margin }) => /* @__PURE__ */
|
|
1636
|
+
render: ({ children, margin }) => /* @__PURE__ */ jsx33("div", { className: getMargin(margin), children })
|
|
2943
1637
|
};
|
|
2944
1638
|
var FormRenderer_default = FormRenderer;
|
|
2945
1639
|
|
|
2946
1640
|
// ../renderers/src/FormSectionRenderer.tsx
|
|
2947
|
-
import { Header as
|
|
2948
|
-
import { jsx as
|
|
1641
|
+
import { Header as Header3 } from "@transferwise/components";
|
|
1642
|
+
import { jsx as jsx34, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2949
1643
|
var FormSectionRenderer = {
|
|
2950
1644
|
canRenderType: "form-section",
|
|
2951
|
-
render: ({ title, description, children }) => /* @__PURE__ */
|
|
2952
|
-
title && /* @__PURE__ */
|
|
2953
|
-
|
|
1645
|
+
render: ({ title, description, children }) => /* @__PURE__ */ jsxs8("fieldset", { children: [
|
|
1646
|
+
title && /* @__PURE__ */ jsx34(
|
|
1647
|
+
Header3,
|
|
2954
1648
|
{
|
|
2955
1649
|
as: "h2",
|
|
2956
1650
|
title
|
|
2957
1651
|
}
|
|
2958
1652
|
),
|
|
2959
|
-
description && /* @__PURE__ */
|
|
1653
|
+
description && /* @__PURE__ */ jsx34("p", { children: description }),
|
|
2960
1654
|
children
|
|
2961
1655
|
] })
|
|
2962
1656
|
};
|
|
@@ -2964,18 +1658,18 @@ var FormSectionRenderer_default = FormSectionRenderer;
|
|
|
2964
1658
|
|
|
2965
1659
|
// ../renderers/src/HeadingRenderer.tsx
|
|
2966
1660
|
import { Display, Title } from "@transferwise/components";
|
|
2967
|
-
import { jsx as
|
|
1661
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
2968
1662
|
var HeadingRenderer = {
|
|
2969
1663
|
canRenderType: "heading",
|
|
2970
|
-
render: (props) => /* @__PURE__ */
|
|
1664
|
+
render: (props) => /* @__PURE__ */ jsx35(Heading, __spreadValues({}, props))
|
|
2971
1665
|
};
|
|
2972
1666
|
function Heading(props) {
|
|
2973
1667
|
const { text, size, align, margin, control } = props;
|
|
2974
1668
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
2975
|
-
return control === "display" ? /* @__PURE__ */
|
|
1669
|
+
return control === "display" ? /* @__PURE__ */ jsx35(DisplayHeading, { size, text, className }) : /* @__PURE__ */ jsx35(StandardHeading, { size, text, className });
|
|
2976
1670
|
}
|
|
2977
1671
|
function DisplayHeading({ size, text, className }) {
|
|
2978
|
-
return /* @__PURE__ */
|
|
1672
|
+
return /* @__PURE__ */ jsx35(Display, { type: getDisplayType(size), className, children: text });
|
|
2979
1673
|
}
|
|
2980
1674
|
var getDisplayType = (size) => {
|
|
2981
1675
|
switch (size) {
|
|
@@ -2991,7 +1685,7 @@ var getDisplayType = (size) => {
|
|
|
2991
1685
|
}
|
|
2992
1686
|
};
|
|
2993
1687
|
function StandardHeading({ size, text, className }) {
|
|
2994
|
-
return /* @__PURE__ */
|
|
1688
|
+
return /* @__PURE__ */ jsx35(Title, { type: getTitleTypeBySize(size), className, children: text });
|
|
2995
1689
|
}
|
|
2996
1690
|
var getTitleTypeBySize = (size) => {
|
|
2997
1691
|
var _a;
|
|
@@ -3008,7 +1702,7 @@ var HeadingRenderer_default = HeadingRenderer;
|
|
|
3008
1702
|
|
|
3009
1703
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
3010
1704
|
import { Image } from "@transferwise/components";
|
|
3011
|
-
import { useEffect as
|
|
1705
|
+
import { useEffect as useEffect7, useState as useState6 } from "react";
|
|
3012
1706
|
|
|
3013
1707
|
// ../renderers/src/utils/api-utils.ts
|
|
3014
1708
|
function isRelativePath(url = "") {
|
|
@@ -3018,7 +1712,7 @@ function isRelativePath(url = "") {
|
|
|
3018
1712
|
}
|
|
3019
1713
|
|
|
3020
1714
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
3021
|
-
import { jsx as
|
|
1715
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
3022
1716
|
function UrlImage({
|
|
3023
1717
|
accessibilityDescription,
|
|
3024
1718
|
align,
|
|
@@ -3027,13 +1721,13 @@ function UrlImage({
|
|
|
3027
1721
|
uri,
|
|
3028
1722
|
httpClient
|
|
3029
1723
|
}) {
|
|
3030
|
-
const [imageSource, setImageSource] =
|
|
3031
|
-
|
|
1724
|
+
const [imageSource, setImageSource] = useState6("");
|
|
1725
|
+
useEffect7(() => {
|
|
3032
1726
|
if (!uri.startsWith("urn:")) {
|
|
3033
1727
|
void getImageSource(httpClient, uri).then(setImageSource);
|
|
3034
1728
|
}
|
|
3035
1729
|
}, [uri, httpClient]);
|
|
3036
|
-
return /* @__PURE__ */
|
|
1730
|
+
return /* @__PURE__ */ jsx36("div", { className: `df-image ${align} ${size || "md"} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx36(
|
|
3037
1731
|
Image,
|
|
3038
1732
|
{
|
|
3039
1733
|
className: "df-reserve-space",
|
|
@@ -3077,7 +1771,7 @@ var getImageSource = async (httpClient, imageUrl) => {
|
|
|
3077
1771
|
};
|
|
3078
1772
|
|
|
3079
1773
|
// ../renderers/src/ImageRenderer/UrnFlagImage.tsx
|
|
3080
|
-
import { jsx as
|
|
1774
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
3081
1775
|
var maxFlagSize = 600;
|
|
3082
1776
|
function UrnFlagImage({
|
|
3083
1777
|
accessibilityDescription,
|
|
@@ -3086,7 +1780,7 @@ function UrnFlagImage({
|
|
|
3086
1780
|
size,
|
|
3087
1781
|
uri
|
|
3088
1782
|
}) {
|
|
3089
|
-
return /* @__PURE__ */
|
|
1783
|
+
return /* @__PURE__ */ jsx37("div", { className: `df-image ${align} ${size || "md"} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx37(UrnFlag, { size: maxFlagSize, urn: uri, accessibilityDescription }) });
|
|
3090
1784
|
}
|
|
3091
1785
|
|
|
3092
1786
|
// ../renderers/src/ImageRenderer/UrnIllustration.tsx
|
|
@@ -3094,7 +1788,7 @@ import {
|
|
|
3094
1788
|
Illustration,
|
|
3095
1789
|
isIllustrationSupport3D
|
|
3096
1790
|
} from "@wise/art";
|
|
3097
|
-
import { useState as
|
|
1791
|
+
import { useState as useState7 } from "react";
|
|
3098
1792
|
|
|
3099
1793
|
// ../renderers/src/ImageRenderer/isAnimated.ts
|
|
3100
1794
|
var isAnimated = (uri) => {
|
|
@@ -3105,7 +1799,7 @@ var isAnimated = (uri) => {
|
|
|
3105
1799
|
// ../renderers/src/ImageRenderer/SafeIllustration3D.tsx
|
|
3106
1800
|
import { Illustration3D } from "@wise/art";
|
|
3107
1801
|
import { Component } from "react";
|
|
3108
|
-
import { jsx as
|
|
1802
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
3109
1803
|
var Illustration3DErrorBoundary = class extends Component {
|
|
3110
1804
|
constructor(props) {
|
|
3111
1805
|
super(props);
|
|
@@ -3129,12 +1823,12 @@ var SafeIllustration3D = ({
|
|
|
3129
1823
|
size,
|
|
3130
1824
|
onError
|
|
3131
1825
|
}) => {
|
|
3132
|
-
return /* @__PURE__ */
|
|
1826
|
+
return /* @__PURE__ */ jsx38(Illustration3DErrorBoundary, { onError, children: /* @__PURE__ */ jsx38(Illustration3D, { name, size }) });
|
|
3133
1827
|
};
|
|
3134
1828
|
var SafeIllustration3D_default = SafeIllustration3D;
|
|
3135
1829
|
|
|
3136
1830
|
// ../renderers/src/ImageRenderer/UrnIllustration.tsx
|
|
3137
|
-
import { jsx as
|
|
1831
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
3138
1832
|
var urnPrefix = "urn:wise:illustrations:";
|
|
3139
1833
|
var isUrnIllustration = (uri) => uri.startsWith(urnPrefix);
|
|
3140
1834
|
function UrnIllustration({
|
|
@@ -3144,12 +1838,12 @@ function UrnIllustration({
|
|
|
3144
1838
|
size,
|
|
3145
1839
|
uri
|
|
3146
1840
|
}) {
|
|
3147
|
-
const [has3DFailed, setHas3DFailed] =
|
|
1841
|
+
const [has3DFailed, setHas3DFailed] = useState7(false);
|
|
3148
1842
|
const illustrationSize = getIllustrationSize(size);
|
|
3149
1843
|
const illustrationName = getIllustrationName(uri);
|
|
3150
1844
|
const illustration3DName = getIllustration3DName(uri);
|
|
3151
1845
|
if (illustration3DName && isAnimated(uri) && !has3DFailed) {
|
|
3152
|
-
return /* @__PURE__ */
|
|
1846
|
+
return /* @__PURE__ */ jsx39("div", { className: `df-image ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx39(
|
|
3153
1847
|
SafeIllustration3D_default,
|
|
3154
1848
|
{
|
|
3155
1849
|
name: illustration3DName,
|
|
@@ -3158,7 +1852,7 @@ function UrnIllustration({
|
|
|
3158
1852
|
}
|
|
3159
1853
|
) });
|
|
3160
1854
|
}
|
|
3161
|
-
return /* @__PURE__ */
|
|
1855
|
+
return /* @__PURE__ */ jsx39("div", { className: `df-image ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx39(
|
|
3162
1856
|
Illustration,
|
|
3163
1857
|
{
|
|
3164
1858
|
className: "df-illustration",
|
|
@@ -3178,32 +1872,32 @@ var getIllustration3DName = (uri) => {
|
|
|
3178
1872
|
};
|
|
3179
1873
|
|
|
3180
1874
|
// ../renderers/src/ImageRenderer/UrnImage.tsx
|
|
3181
|
-
import { jsx as
|
|
1875
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
3182
1876
|
var isUrnImage = (uri) => uri.startsWith("urn:");
|
|
3183
1877
|
function UrnImage(props) {
|
|
3184
1878
|
const { uri } = props;
|
|
3185
1879
|
if (isUrnIllustration(uri)) {
|
|
3186
|
-
return /* @__PURE__ */
|
|
1880
|
+
return /* @__PURE__ */ jsx40(UrnIllustration, __spreadValues({}, props));
|
|
3187
1881
|
}
|
|
3188
1882
|
if (isUrnFlag(uri)) {
|
|
3189
|
-
return /* @__PURE__ */
|
|
1883
|
+
return /* @__PURE__ */ jsx40(UrnFlagImage, __spreadValues({}, props));
|
|
3190
1884
|
}
|
|
3191
1885
|
return null;
|
|
3192
1886
|
}
|
|
3193
1887
|
|
|
3194
1888
|
// ../renderers/src/ImageRenderer/ImageRenderer.tsx
|
|
3195
|
-
import { jsx as
|
|
1889
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
3196
1890
|
var ImageRenderer = {
|
|
3197
1891
|
canRenderType: "image",
|
|
3198
|
-
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */
|
|
1892
|
+
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */ jsx41(UrnImage, __spreadValues({}, props)) : /* @__PURE__ */ jsx41(UrlImage, __spreadValues({}, props))
|
|
3199
1893
|
};
|
|
3200
1894
|
|
|
3201
1895
|
// ../renderers/src/ImageRenderer/index.tsx
|
|
3202
1896
|
var ImageRenderer_default = ImageRenderer;
|
|
3203
1897
|
|
|
3204
1898
|
// ../renderers/src/InstructionsRenderer.tsx
|
|
3205
|
-
import { Header as
|
|
3206
|
-
import { jsx as
|
|
1899
|
+
import { Header as Header4, InstructionsList } from "@transferwise/components";
|
|
1900
|
+
import { jsx as jsx42, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
3207
1901
|
var doContext = ["positive", "neutral"];
|
|
3208
1902
|
var dontContext = ["warning", "negative"];
|
|
3209
1903
|
var InstructionsRenderer = {
|
|
@@ -3211,16 +1905,16 @@ var InstructionsRenderer = {
|
|
|
3211
1905
|
render: ({ items, margin, title }) => {
|
|
3212
1906
|
const dos = items.filter((item) => doContext.includes(item.context)).map(({ text }) => text);
|
|
3213
1907
|
const donts = items.filter((item) => dontContext.includes(item.context)).map(({ text }) => text);
|
|
3214
|
-
return /* @__PURE__ */
|
|
3215
|
-
title ? /* @__PURE__ */
|
|
3216
|
-
/* @__PURE__ */
|
|
1908
|
+
return /* @__PURE__ */ jsxs9("div", { className: getMargin(margin), children: [
|
|
1909
|
+
title ? /* @__PURE__ */ jsx42(Header4, { title }) : null,
|
|
1910
|
+
/* @__PURE__ */ jsx42(InstructionsList, { dos, donts })
|
|
3217
1911
|
] });
|
|
3218
1912
|
}
|
|
3219
1913
|
};
|
|
3220
1914
|
var InstructionsRenderer_default = InstructionsRenderer;
|
|
3221
1915
|
|
|
3222
1916
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
3223
|
-
import { Input
|
|
1917
|
+
import { Input, InputGroup } from "@transferwise/components";
|
|
3224
1918
|
|
|
3225
1919
|
// ../renderers/src/utils/input-utils.ts
|
|
3226
1920
|
var onWheel = (event) => {
|
|
@@ -3245,7 +1939,7 @@ function pick(obj, ...keys) {
|
|
|
3245
1939
|
}
|
|
3246
1940
|
|
|
3247
1941
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
3248
|
-
import { jsx as
|
|
1942
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
3249
1943
|
var IntegerInputRenderer = {
|
|
3250
1944
|
canRenderType: "input-integer",
|
|
3251
1945
|
render: (props) => {
|
|
@@ -3260,7 +1954,7 @@ var IntegerInputRenderer = {
|
|
|
3260
1954
|
"maximum",
|
|
3261
1955
|
"minimum"
|
|
3262
1956
|
);
|
|
3263
|
-
return /* @__PURE__ */
|
|
1957
|
+
return /* @__PURE__ */ jsx43(
|
|
3264
1958
|
FieldInput_default,
|
|
3265
1959
|
{
|
|
3266
1960
|
id,
|
|
@@ -3271,8 +1965,8 @@ var IntegerInputRenderer = {
|
|
|
3271
1965
|
loadingState: props.fieldLoadingState,
|
|
3272
1966
|
help,
|
|
3273
1967
|
features: props.features,
|
|
3274
|
-
children: /* @__PURE__ */
|
|
3275
|
-
|
|
1968
|
+
children: /* @__PURE__ */ jsx43(InputGroup, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ jsx43(
|
|
1969
|
+
Input,
|
|
3276
1970
|
__spreadValues({
|
|
3277
1971
|
id,
|
|
3278
1972
|
name: id,
|
|
@@ -3294,12 +1988,39 @@ var IntegerInputRenderer = {
|
|
|
3294
1988
|
var IntegerInputRenderer_default = IntegerInputRenderer;
|
|
3295
1989
|
|
|
3296
1990
|
// ../renderers/src/ListRenderer.tsx
|
|
3297
|
-
import { ListItem as
|
|
1991
|
+
import { ListItem as ListItem7 } from "@transferwise/components";
|
|
1992
|
+
|
|
1993
|
+
// ../renderers/src/utils/listItem/getCTAControl.tsx
|
|
1994
|
+
import { ListItem as ListItem6 } from "@transferwise/components";
|
|
1995
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
1996
|
+
var getCTAControl = (callToAction, { ctaSecondary, fullyInteractive }) => {
|
|
1997
|
+
if (!callToAction) {
|
|
1998
|
+
return void 0;
|
|
1999
|
+
}
|
|
2000
|
+
const { accessibilityDescription, title, context } = callToAction;
|
|
2001
|
+
const { priority, sentiment } = getPriorityAndSentiment(ctaSecondary, context);
|
|
2002
|
+
return /* @__PURE__ */ jsx44(
|
|
2003
|
+
ListItem6.Button,
|
|
2004
|
+
__spreadProps(__spreadValues({}, callToAction.getAnchorProps()), {
|
|
2005
|
+
partiallyInteractive: !fullyInteractive,
|
|
2006
|
+
priority,
|
|
2007
|
+
"aria-description": accessibilityDescription,
|
|
2008
|
+
sentiment,
|
|
2009
|
+
children: title
|
|
2010
|
+
})
|
|
2011
|
+
);
|
|
2012
|
+
};
|
|
2013
|
+
var getPriorityAndSentiment = (ctaSecondary, context) => {
|
|
2014
|
+
if (context === "negative") {
|
|
2015
|
+
return { priority: "secondary", sentiment: "negative" };
|
|
2016
|
+
}
|
|
2017
|
+
return { priority: ctaSecondary ? "secondary" : "secondary-neutral", sentiment: "default" };
|
|
2018
|
+
};
|
|
3298
2019
|
|
|
3299
2020
|
// ../renderers/src/components/Header.tsx
|
|
3300
2021
|
import { Header as DSHeader } from "@transferwise/components";
|
|
3301
|
-
import { jsx as
|
|
3302
|
-
var
|
|
2022
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
2023
|
+
var Header5 = ({ title, callToAction }) => (title || callToAction) && /* @__PURE__ */ jsx45(DSHeader, { title: title != null ? title : "", action: getHeaderAction(callToAction) });
|
|
3303
2024
|
var getHeaderAction = (callToAction) => {
|
|
3304
2025
|
if (!callToAction) {
|
|
3305
2026
|
return void 0;
|
|
@@ -3311,11 +2032,11 @@ var getHeaderAction = (callToAction) => {
|
|
|
3311
2032
|
};
|
|
3312
2033
|
|
|
3313
2034
|
// ../renderers/src/ListRenderer.tsx
|
|
3314
|
-
import { jsx as
|
|
2035
|
+
import { jsx as jsx46, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3315
2036
|
var ListRenderer = {
|
|
3316
2037
|
canRenderType: "list",
|
|
3317
|
-
render: ({ callToAction, control, margin, items, tags, title }) => /* @__PURE__ */
|
|
3318
|
-
/* @__PURE__ */
|
|
2038
|
+
render: ({ callToAction, control, margin, items, tags, title }) => /* @__PURE__ */ jsxs10("div", { className: getMargin(margin), children: [
|
|
2039
|
+
/* @__PURE__ */ jsx46(Header5, { title, callToAction }),
|
|
3319
2040
|
items.map((item) => {
|
|
3320
2041
|
var _a, _b;
|
|
3321
2042
|
const {
|
|
@@ -3332,8 +2053,8 @@ var ListRenderer = {
|
|
|
3332
2053
|
ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
|
|
3333
2054
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
3334
2055
|
};
|
|
3335
|
-
return /* @__PURE__ */
|
|
3336
|
-
|
|
2056
|
+
return /* @__PURE__ */ jsx46(
|
|
2057
|
+
ListItem7,
|
|
3337
2058
|
{
|
|
3338
2059
|
title: itemTitle,
|
|
3339
2060
|
subtitle: description,
|
|
@@ -3353,10 +2074,10 @@ var ListRenderer_default = ListRenderer;
|
|
|
3353
2074
|
|
|
3354
2075
|
// ../renderers/src/LoadingIndicatorRenderer.tsx
|
|
3355
2076
|
import { Loader } from "@transferwise/components";
|
|
3356
|
-
import { jsx as
|
|
2077
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
3357
2078
|
var LoadingIndicatorRenderer = {
|
|
3358
2079
|
canRenderType: "loading-indicator",
|
|
3359
|
-
render: ({ margin, size }) => /* @__PURE__ */
|
|
2080
|
+
render: ({ margin, size }) => /* @__PURE__ */ jsx47(
|
|
3360
2081
|
Loader,
|
|
3361
2082
|
{
|
|
3362
2083
|
size,
|
|
@@ -3370,10 +2091,10 @@ var LoadingIndicatorRenderer_default = LoadingIndicatorRenderer;
|
|
|
3370
2091
|
// ../renderers/src/MarkdownRenderer.tsx
|
|
3371
2092
|
import { Markdown as Markdown3 } from "@transferwise/components";
|
|
3372
2093
|
var import_classnames4 = __toESM(require_classnames());
|
|
3373
|
-
import { jsx as
|
|
2094
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
3374
2095
|
var MarkdownRenderer = {
|
|
3375
2096
|
canRenderType: "markdown",
|
|
3376
|
-
render: ({ content, align, margin, size }) => /* @__PURE__ */
|
|
2097
|
+
render: ({ content, align, margin, size }) => /* @__PURE__ */ jsx48("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ jsx48(
|
|
3377
2098
|
Markdown3,
|
|
3378
2099
|
{
|
|
3379
2100
|
className: (0, import_classnames4.default)(
|
|
@@ -3388,16 +2109,16 @@ var MarkdownRenderer = {
|
|
|
3388
2109
|
var MarkdownRenderer_default = MarkdownRenderer;
|
|
3389
2110
|
|
|
3390
2111
|
// ../renderers/src/MediaRenderer.tsx
|
|
3391
|
-
import { jsx as
|
|
2112
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
3392
2113
|
var MediaRenderer = {
|
|
3393
2114
|
canRenderType: "media",
|
|
3394
2115
|
render: (_a) => {
|
|
3395
2116
|
var _b = _a, { media } = _b, rest = __objRest(_b, ["media"]);
|
|
3396
2117
|
switch (media.type) {
|
|
3397
2118
|
case "avatar":
|
|
3398
|
-
return /* @__PURE__ */
|
|
2119
|
+
return /* @__PURE__ */ jsx49(AvatarMediaRendererComponent, __spreadValues({ media }, rest));
|
|
3399
2120
|
case "image":
|
|
3400
|
-
return /* @__PURE__ */
|
|
2121
|
+
return /* @__PURE__ */ jsx49(ImageMediaRendererComponent, __spreadValues({ media }, rest));
|
|
3401
2122
|
case "legacy":
|
|
3402
2123
|
return null;
|
|
3403
2124
|
}
|
|
@@ -3409,7 +2130,7 @@ var AvatarMediaRendererComponent = ({
|
|
|
3409
2130
|
margin,
|
|
3410
2131
|
size
|
|
3411
2132
|
}) => {
|
|
3412
|
-
return /* @__PURE__ */
|
|
2133
|
+
return /* @__PURE__ */ jsx49("div", { className: `df-media-layout-avatar ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx49(Media, { media, size: mapAvatarMediaSize(size) }) });
|
|
3413
2134
|
};
|
|
3414
2135
|
var ImageMediaRendererComponent = (_a) => {
|
|
3415
2136
|
var _b = _a, {
|
|
@@ -3417,7 +2138,7 @@ var ImageMediaRendererComponent = (_a) => {
|
|
|
3417
2138
|
} = _b, rest = __objRest(_b, [
|
|
3418
2139
|
"media"
|
|
3419
2140
|
]);
|
|
3420
|
-
return isUrnImage(media.uri) ? /* @__PURE__ */
|
|
2141
|
+
return isUrnImage(media.uri) ? /* @__PURE__ */ jsx49(UrnImage, __spreadValues({ uri: media.uri, accessibilityDescription: media.accessibilityDescription }, rest)) : /* @__PURE__ */ jsx49(UrlImage, __spreadValues({ uri: media.uri, accessibilityDescription: media.accessibilityDescription }, rest));
|
|
3421
2142
|
};
|
|
3422
2143
|
var mapAvatarMediaSize = (size) => {
|
|
3423
2144
|
switch (size) {
|
|
@@ -3435,20 +2156,20 @@ var mapAvatarMediaSize = (size) => {
|
|
|
3435
2156
|
};
|
|
3436
2157
|
|
|
3437
2158
|
// ../renderers/src/ModalLayoutRenderer.tsx
|
|
3438
|
-
import { Button as
|
|
3439
|
-
import { useState as
|
|
3440
|
-
import { jsx as
|
|
2159
|
+
import { Button as Button4, Modal as Modal2 } from "@transferwise/components";
|
|
2160
|
+
import { useState as useState8 } from "react";
|
|
2161
|
+
import { jsx as jsx50, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3441
2162
|
var ModalLayoutRenderer = {
|
|
3442
2163
|
canRenderType: "modal-layout",
|
|
3443
|
-
render: (props) => /* @__PURE__ */
|
|
2164
|
+
render: (props) => /* @__PURE__ */ jsx50(DFModal, __spreadValues({}, props))
|
|
3444
2165
|
};
|
|
3445
2166
|
var ModalLayoutRenderer_default = ModalLayoutRenderer;
|
|
3446
2167
|
function DFModal({ content, margin, trigger }) {
|
|
3447
|
-
const [visible, setVisible] =
|
|
2168
|
+
const [visible, setVisible] = useState8(false);
|
|
3448
2169
|
const { children, title } = content;
|
|
3449
|
-
return /* @__PURE__ */
|
|
3450
|
-
/* @__PURE__ */
|
|
3451
|
-
/* @__PURE__ */
|
|
2170
|
+
return /* @__PURE__ */ jsxs11("div", { className: getMargin(margin), children: [
|
|
2171
|
+
/* @__PURE__ */ jsx50(Button4, { v2: true, priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
|
|
2172
|
+
/* @__PURE__ */ jsx50(
|
|
3452
2173
|
Modal2,
|
|
3453
2174
|
{
|
|
3454
2175
|
scroll: "content",
|
|
@@ -3464,19 +2185,19 @@ function DFModal({ content, margin, trigger }) {
|
|
|
3464
2185
|
|
|
3465
2186
|
// ../renderers/src/ModalRenderer.tsx
|
|
3466
2187
|
import { Modal as Modal3 } from "@transferwise/components";
|
|
3467
|
-
import { jsx as
|
|
2188
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
3468
2189
|
var ModalRenderer = {
|
|
3469
2190
|
canRenderType: "modal",
|
|
3470
2191
|
render: ({ title, children, open, onClose }) => {
|
|
3471
|
-
return /* @__PURE__ */
|
|
2192
|
+
return /* @__PURE__ */ jsx51(Modal3, { open, title, body: children, onClose });
|
|
3472
2193
|
}
|
|
3473
2194
|
};
|
|
3474
2195
|
|
|
3475
2196
|
// ../renderers/src/MoneyInputRenderer.tsx
|
|
3476
2197
|
import { MoneyInput } from "@transferwise/components";
|
|
3477
|
-
import { useEffect as
|
|
3478
|
-
import { useIntl as
|
|
3479
|
-
import { jsx as
|
|
2198
|
+
import { useEffect as useEffect8 } from "react";
|
|
2199
|
+
import { useIntl as useIntl6 } from "react-intl";
|
|
2200
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
3480
2201
|
var groupingTags2 = Object.keys(group_messages_default).filter((key) => key !== "all");
|
|
3481
2202
|
var MoneyInputRenderer = {
|
|
3482
2203
|
canRenderType: "money-input",
|
|
@@ -3497,13 +2218,13 @@ function MoneyInputRendererComponent(props) {
|
|
|
3497
2218
|
onAmountChange,
|
|
3498
2219
|
onCurrencyChange
|
|
3499
2220
|
} = props;
|
|
3500
|
-
|
|
2221
|
+
useEffect8(() => {
|
|
3501
2222
|
if (!isValidIndex(selectedCurrencyIndex, currencies.length)) {
|
|
3502
2223
|
onCurrencyChange(0);
|
|
3503
2224
|
}
|
|
3504
2225
|
}, [selectedCurrencyIndex, onCurrencyChange, currencies.length]);
|
|
3505
|
-
const { formatMessage } =
|
|
3506
|
-
return /* @__PURE__ */
|
|
2226
|
+
const { formatMessage } = useIntl6();
|
|
2227
|
+
return /* @__PURE__ */ jsx52(
|
|
3507
2228
|
FieldInput_default,
|
|
3508
2229
|
{
|
|
3509
2230
|
id: uid,
|
|
@@ -3512,7 +2233,7 @@ function MoneyInputRendererComponent(props) {
|
|
|
3512
2233
|
validation: validationState,
|
|
3513
2234
|
help,
|
|
3514
2235
|
features: props.features,
|
|
3515
|
-
children: /* @__PURE__ */
|
|
2236
|
+
children: /* @__PURE__ */ jsx52(
|
|
3516
2237
|
MoneyInput,
|
|
3517
2238
|
{
|
|
3518
2239
|
amount: parseFloatOrNull(amountValue),
|
|
@@ -3574,8 +2295,8 @@ function assertCurrencyCodeIsString(currencyCode) {
|
|
|
3574
2295
|
}
|
|
3575
2296
|
|
|
3576
2297
|
// ../renderers/src/MultiSelectInputRenderer/InlineComponent.tsx
|
|
3577
|
-
import { ListItem as
|
|
3578
|
-
import { jsx as
|
|
2298
|
+
import { ListItem as ListItem8 } from "@transferwise/components";
|
|
2299
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
3579
2300
|
function InlineComponent(props) {
|
|
3580
2301
|
const {
|
|
3581
2302
|
id,
|
|
@@ -3589,7 +2310,7 @@ function InlineComponent(props) {
|
|
|
3589
2310
|
validationState,
|
|
3590
2311
|
onSelect
|
|
3591
2312
|
} = props;
|
|
3592
|
-
return /* @__PURE__ */
|
|
2313
|
+
return /* @__PURE__ */ jsx53(
|
|
3593
2314
|
FieldInput_default,
|
|
3594
2315
|
{
|
|
3595
2316
|
id,
|
|
@@ -3611,8 +2332,8 @@ function InlineComponent(props) {
|
|
|
3611
2332
|
childrenProps
|
|
3612
2333
|
} = option;
|
|
3613
2334
|
const key = (_a = childrenProps == null ? void 0 : childrenProps.uid) != null ? _a : index;
|
|
3614
|
-
return /* @__PURE__ */
|
|
3615
|
-
|
|
2335
|
+
return /* @__PURE__ */ jsx53(
|
|
2336
|
+
ListItem8,
|
|
3616
2337
|
{
|
|
3617
2338
|
title: itemTitle,
|
|
3618
2339
|
subtitle,
|
|
@@ -3620,10 +2341,10 @@ function InlineComponent(props) {
|
|
|
3620
2341
|
valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
|
|
3621
2342
|
media: getMedia(media, false),
|
|
3622
2343
|
prompt: getInlineAlert(inlineAlert),
|
|
3623
|
-
additionalInfo: additionalText ? /* @__PURE__ */
|
|
2344
|
+
additionalInfo: additionalText ? /* @__PURE__ */ jsx53(ListItem8.AdditionalInfo, { children: additionalText }) : void 0,
|
|
3624
2345
|
disabled: disabled || optionDisabled,
|
|
3625
|
-
control: /* @__PURE__ */
|
|
3626
|
-
|
|
2346
|
+
control: /* @__PURE__ */ jsx53(
|
|
2347
|
+
ListItem8.Checkbox,
|
|
3627
2348
|
{
|
|
3628
2349
|
checked: selectedIndices.includes(index),
|
|
3629
2350
|
onChange: (e) => {
|
|
@@ -3642,12 +2363,12 @@ function InlineComponent(props) {
|
|
|
3642
2363
|
|
|
3643
2364
|
// ../renderers/src/MultiSelectInputRenderer/DefaultComponent.tsx
|
|
3644
2365
|
import { SelectInput, SelectInputOptionContent } from "@transferwise/components";
|
|
3645
|
-
import { useState as
|
|
3646
|
-
import { useIntl as
|
|
2366
|
+
import { useState as useState9 } from "react";
|
|
2367
|
+
import { useIntl as useIntl7 } from "react-intl";
|
|
3647
2368
|
|
|
3648
2369
|
// ../renderers/src/messages/multi-select.messages.ts
|
|
3649
|
-
import { defineMessages as
|
|
3650
|
-
var multi_select_messages_default =
|
|
2370
|
+
import { defineMessages as defineMessages6 } from "react-intl";
|
|
2371
|
+
var multi_select_messages_default = defineMessages6({
|
|
3651
2372
|
summary: {
|
|
3652
2373
|
id: "df.wise.MultiSelect.summary",
|
|
3653
2374
|
defaultMessage: "{first} and {count} more",
|
|
@@ -3656,10 +2377,10 @@ var multi_select_messages_default = defineMessages7({
|
|
|
3656
2377
|
});
|
|
3657
2378
|
|
|
3658
2379
|
// ../renderers/src/MultiSelectInputRenderer/DefaultComponent.tsx
|
|
3659
|
-
import { jsx as
|
|
2380
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
3660
2381
|
function DefaultComponent(props) {
|
|
3661
|
-
const { formatMessage } =
|
|
3662
|
-
const [stagedIndices, setStagedIndices] =
|
|
2382
|
+
const { formatMessage } = useIntl7();
|
|
2383
|
+
const [stagedIndices, setStagedIndices] = useState9();
|
|
3663
2384
|
const {
|
|
3664
2385
|
id,
|
|
3665
2386
|
autoComplete,
|
|
@@ -3698,12 +2419,12 @@ function DefaultComponent(props) {
|
|
|
3698
2419
|
const contentProps = {
|
|
3699
2420
|
title: option.title,
|
|
3700
2421
|
description: option.description,
|
|
3701
|
-
icon: /* @__PURE__ */
|
|
2422
|
+
icon: /* @__PURE__ */ jsx54(OptionMedia, { media: option.media, preferAvatar: false })
|
|
3702
2423
|
};
|
|
3703
|
-
return /* @__PURE__ */
|
|
2424
|
+
return /* @__PURE__ */ jsx54(SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
3704
2425
|
};
|
|
3705
2426
|
const extraProps = { autoComplete };
|
|
3706
|
-
return /* @__PURE__ */
|
|
2427
|
+
return /* @__PURE__ */ jsx54(
|
|
3707
2428
|
FieldInput_default,
|
|
3708
2429
|
{
|
|
3709
2430
|
id,
|
|
@@ -3712,7 +2433,7 @@ function DefaultComponent(props) {
|
|
|
3712
2433
|
description,
|
|
3713
2434
|
validation: validationState,
|
|
3714
2435
|
features,
|
|
3715
|
-
children: /* @__PURE__ */
|
|
2436
|
+
children: /* @__PURE__ */ jsx54(
|
|
3716
2437
|
SelectInput,
|
|
3717
2438
|
__spreadValues({
|
|
3718
2439
|
id,
|
|
@@ -3752,7 +2473,7 @@ function DefaultComponent(props) {
|
|
|
3752
2473
|
|
|
3753
2474
|
// ../renderers/src/MultiSelectInputRenderer/InlineCheckboxComponent.tsx
|
|
3754
2475
|
import { Checkbox as Checkbox2 } from "@transferwise/components";
|
|
3755
|
-
import { jsx as
|
|
2476
|
+
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
3756
2477
|
function InlineCheckboxComponent(props) {
|
|
3757
2478
|
const {
|
|
3758
2479
|
id,
|
|
@@ -3766,7 +2487,7 @@ function InlineCheckboxComponent(props) {
|
|
|
3766
2487
|
validationState,
|
|
3767
2488
|
onSelect
|
|
3768
2489
|
} = props;
|
|
3769
|
-
return /* @__PURE__ */
|
|
2490
|
+
return /* @__PURE__ */ jsx55(
|
|
3770
2491
|
FieldInput_default,
|
|
3771
2492
|
{
|
|
3772
2493
|
id,
|
|
@@ -3795,24 +2516,24 @@ function InlineCheckboxComponent(props) {
|
|
|
3795
2516
|
onSelect(newSelectedIndices);
|
|
3796
2517
|
}
|
|
3797
2518
|
};
|
|
3798
|
-
return /* @__PURE__ */
|
|
2519
|
+
return /* @__PURE__ */ jsx55(Checkbox2, __spreadProps(__spreadValues({}, checkboxProps), { className: "m-t-1" }), key);
|
|
3799
2520
|
})
|
|
3800
2521
|
}
|
|
3801
2522
|
);
|
|
3802
2523
|
}
|
|
3803
2524
|
|
|
3804
2525
|
// ../renderers/src/MultiSelectInputRenderer/MultiSelectInputRenderer.tsx
|
|
3805
|
-
import { jsx as
|
|
2526
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
3806
2527
|
var MultiSelectInputRenderer = {
|
|
3807
2528
|
canRenderType: "input-multi-select",
|
|
3808
2529
|
render: (props) => {
|
|
3809
2530
|
switch (props.control) {
|
|
3810
2531
|
case "inline":
|
|
3811
|
-
return /* @__PURE__ */
|
|
2532
|
+
return /* @__PURE__ */ jsx56(InlineComponent, __spreadValues({}, props));
|
|
3812
2533
|
case "inline-checkbox-group":
|
|
3813
|
-
return /* @__PURE__ */
|
|
2534
|
+
return /* @__PURE__ */ jsx56(InlineCheckboxComponent, __spreadValues({}, props));
|
|
3814
2535
|
default:
|
|
3815
|
-
return /* @__PURE__ */
|
|
2536
|
+
return /* @__PURE__ */ jsx56(DefaultComponent, __spreadValues({}, props));
|
|
3816
2537
|
}
|
|
3817
2538
|
}
|
|
3818
2539
|
};
|
|
@@ -3823,7 +2544,7 @@ import { Status, UploadInput } from "@transferwise/components";
|
|
|
3823
2544
|
// ../renderers/src/components/UploadFieldInput.tsx
|
|
3824
2545
|
var import_classnames5 = __toESM(require_classnames());
|
|
3825
2546
|
import { InlineAlert as InlineAlert2 } from "@transferwise/components";
|
|
3826
|
-
import { jsx as
|
|
2547
|
+
import { jsx as jsx57, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
3827
2548
|
function UploadFieldInput({
|
|
3828
2549
|
id,
|
|
3829
2550
|
children,
|
|
@@ -3833,10 +2554,10 @@ function UploadFieldInput({
|
|
|
3833
2554
|
validation,
|
|
3834
2555
|
features
|
|
3835
2556
|
}) {
|
|
3836
|
-
const labelContent = label && help ? /* @__PURE__ */
|
|
2557
|
+
const labelContent = label && help ? /* @__PURE__ */ jsx57(LabelContentWithHelp, { text: label, help }) : label;
|
|
3837
2558
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
3838
2559
|
const { ref } = useScrollToError(validation, features);
|
|
3839
|
-
return /* @__PURE__ */
|
|
2560
|
+
return /* @__PURE__ */ jsxs12(
|
|
3840
2561
|
"div",
|
|
3841
2562
|
{
|
|
3842
2563
|
ref,
|
|
@@ -3844,9 +2565,9 @@ function UploadFieldInput({
|
|
|
3844
2565
|
"has-error": (validation == null ? void 0 : validation.status) === "invalid"
|
|
3845
2566
|
}),
|
|
3846
2567
|
children: [
|
|
3847
|
-
/* @__PURE__ */
|
|
2568
|
+
/* @__PURE__ */ jsx57("label", { htmlFor: id, className: "control-label", children: labelContent }),
|
|
3848
2569
|
children,
|
|
3849
|
-
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */
|
|
2570
|
+
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ jsx57(InlineAlert2, { type: "negative", id: descriptionId, children: validation.message })
|
|
3850
2571
|
]
|
|
3851
2572
|
}
|
|
3852
2573
|
);
|
|
@@ -3881,7 +2602,7 @@ var getSizeLimit = (maxSize) => {
|
|
|
3881
2602
|
};
|
|
3882
2603
|
|
|
3883
2604
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
3884
|
-
import { jsx as
|
|
2605
|
+
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
3885
2606
|
var MultiUploadInputRenderer = {
|
|
3886
2607
|
canRenderType: "input-upload-multi",
|
|
3887
2608
|
render: (props) => {
|
|
@@ -3907,7 +2628,7 @@ var MultiUploadInputRenderer = {
|
|
|
3907
2628
|
};
|
|
3908
2629
|
const onDeleteFile = async (fileId) => onRemoveFile(value.findIndex((file) => file.id === fileId));
|
|
3909
2630
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
3910
|
-
return /* @__PURE__ */
|
|
2631
|
+
return /* @__PURE__ */ jsx58(
|
|
3911
2632
|
UploadFieldInput_default,
|
|
3912
2633
|
{
|
|
3913
2634
|
id,
|
|
@@ -3916,7 +2637,7 @@ var MultiUploadInputRenderer = {
|
|
|
3916
2637
|
validation: validationState,
|
|
3917
2638
|
help,
|
|
3918
2639
|
features,
|
|
3919
|
-
children: /* @__PURE__ */
|
|
2640
|
+
children: /* @__PURE__ */ jsx58(
|
|
3920
2641
|
UploadInput,
|
|
3921
2642
|
{
|
|
3922
2643
|
id,
|
|
@@ -3944,8 +2665,8 @@ var MultiUploadInputRenderer = {
|
|
|
3944
2665
|
var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
|
|
3945
2666
|
|
|
3946
2667
|
// ../renderers/src/NumberInputRenderer.tsx
|
|
3947
|
-
import { Input as
|
|
3948
|
-
import { jsx as
|
|
2668
|
+
import { Input as Input2, InputGroup as InputGroup2 } from "@transferwise/components";
|
|
2669
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
3949
2670
|
var NumberInputRenderer = {
|
|
3950
2671
|
canRenderType: "input-number",
|
|
3951
2672
|
render: (props) => {
|
|
@@ -3959,7 +2680,7 @@ var NumberInputRenderer = {
|
|
|
3959
2680
|
"maximum",
|
|
3960
2681
|
"minimum"
|
|
3961
2682
|
);
|
|
3962
|
-
return /* @__PURE__ */
|
|
2683
|
+
return /* @__PURE__ */ jsx59(
|
|
3963
2684
|
FieldInput_default,
|
|
3964
2685
|
{
|
|
3965
2686
|
id,
|
|
@@ -3970,8 +2691,8 @@ var NumberInputRenderer = {
|
|
|
3970
2691
|
loadingState: props.fieldLoadingState,
|
|
3971
2692
|
help,
|
|
3972
2693
|
features: props.features,
|
|
3973
|
-
children: /* @__PURE__ */
|
|
3974
|
-
|
|
2694
|
+
children: /* @__PURE__ */ jsx59(InputGroup2, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ jsx59(
|
|
2695
|
+
Input2,
|
|
3975
2696
|
__spreadValues({
|
|
3976
2697
|
id,
|
|
3977
2698
|
name: id,
|
|
@@ -3991,7 +2712,7 @@ var NumberInputRenderer = {
|
|
|
3991
2712
|
var NumberInputRenderer_default = NumberInputRenderer;
|
|
3992
2713
|
|
|
3993
2714
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
3994
|
-
import { useIntl as
|
|
2715
|
+
import { useIntl as useIntl8 } from "react-intl";
|
|
3995
2716
|
|
|
3996
2717
|
// ../renderers/src/hooks/useSnackBarIfAvailable.ts
|
|
3997
2718
|
import { SnackbarContext } from "@transferwise/components";
|
|
@@ -4004,11 +2725,11 @@ function useSnackBarIfAvailable() {
|
|
|
4004
2725
|
|
|
4005
2726
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
4006
2727
|
var import_classnames6 = __toESM(require_classnames());
|
|
4007
|
-
import { Button as
|
|
2728
|
+
import { Button as Button5, Input as Input3 } from "@transferwise/components";
|
|
4008
2729
|
|
|
4009
2730
|
// ../renderers/src/messages/paragraph.messages.ts
|
|
4010
|
-
import { defineMessages as
|
|
4011
|
-
var paragraph_messages_default =
|
|
2731
|
+
import { defineMessages as defineMessages7 } from "react-intl";
|
|
2732
|
+
var paragraph_messages_default = defineMessages7({
|
|
4012
2733
|
copy: {
|
|
4013
2734
|
id: "df.wise.DynamicParagraph.copy",
|
|
4014
2735
|
defaultMessage: "Copy",
|
|
@@ -4022,14 +2743,14 @@ var paragraph_messages_default = defineMessages8({
|
|
|
4022
2743
|
});
|
|
4023
2744
|
|
|
4024
2745
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
4025
|
-
import { jsx as
|
|
2746
|
+
import { jsx as jsx60, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
4026
2747
|
var ParagraphRenderer = {
|
|
4027
2748
|
canRenderType: "paragraph",
|
|
4028
|
-
render: (props) => /* @__PURE__ */
|
|
2749
|
+
render: (props) => /* @__PURE__ */ jsx60(Paragraph, __spreadValues({}, props))
|
|
4029
2750
|
};
|
|
4030
2751
|
function Paragraph({ align, control, margin, size, text }) {
|
|
4031
2752
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
4032
|
-
return control === "copyable" ? /* @__PURE__ */
|
|
2753
|
+
return control === "copyable" ? /* @__PURE__ */ jsx60(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ jsx60(
|
|
4033
2754
|
"p",
|
|
4034
2755
|
{
|
|
4035
2756
|
className: `${["xs", "sm"].includes(size) ? "np-text-body-default" : "np-text-body-large"} ${className}`,
|
|
@@ -4042,16 +2763,16 @@ function CopyableParagraph({
|
|
|
4042
2763
|
align,
|
|
4043
2764
|
className
|
|
4044
2765
|
}) {
|
|
4045
|
-
const { formatMessage } =
|
|
2766
|
+
const { formatMessage } = useIntl8();
|
|
4046
2767
|
const createSnackbar = useSnackBarIfAvailable();
|
|
4047
2768
|
const copy = () => {
|
|
4048
2769
|
navigator.clipboard.writeText(text).then(() => createSnackbar({ text: formatMessage(paragraph_messages_default.copied) })).catch(() => {
|
|
4049
2770
|
});
|
|
4050
2771
|
};
|
|
4051
2772
|
const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
|
|
4052
|
-
return /* @__PURE__ */
|
|
4053
|
-
/* @__PURE__ */
|
|
4054
|
-
|
|
2773
|
+
return /* @__PURE__ */ jsxs13("div", { className, children: [
|
|
2774
|
+
/* @__PURE__ */ jsx60(
|
|
2775
|
+
Input3,
|
|
4055
2776
|
{
|
|
4056
2777
|
type: "text",
|
|
4057
2778
|
value: text,
|
|
@@ -4059,23 +2780,23 @@ function CopyableParagraph({
|
|
|
4059
2780
|
className: (0, import_classnames6.default)("text-ellipsis", inputAlignmentClasses)
|
|
4060
2781
|
}
|
|
4061
2782
|
),
|
|
4062
|
-
/* @__PURE__ */
|
|
2783
|
+
/* @__PURE__ */ jsx60(Button5, { v2: true, block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
4063
2784
|
] });
|
|
4064
2785
|
}
|
|
4065
2786
|
var ParagraphRenderer_default = ParagraphRenderer;
|
|
4066
2787
|
|
|
4067
2788
|
// ../renderers/src/ProgressRenderer.tsx
|
|
4068
2789
|
import { ProgressBar } from "@transferwise/components";
|
|
4069
|
-
import { jsx as
|
|
2790
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
4070
2791
|
var ProgressRenderer = {
|
|
4071
2792
|
canRenderType: "progress",
|
|
4072
2793
|
render: ({ uid, title, help, progress, progressText, margin, description }) => {
|
|
4073
|
-
return /* @__PURE__ */
|
|
2794
|
+
return /* @__PURE__ */ jsx61(
|
|
4074
2795
|
ProgressBar,
|
|
4075
2796
|
{
|
|
4076
2797
|
id: uid,
|
|
4077
2798
|
className: getMargin(margin),
|
|
4078
|
-
title: title && help ? /* @__PURE__ */
|
|
2799
|
+
title: title && help ? /* @__PURE__ */ jsx61(LabelContentWithHelp, { text: title, help }) : title,
|
|
4079
2800
|
description,
|
|
4080
2801
|
progress: {
|
|
4081
2802
|
max: 1,
|
|
@@ -4089,14 +2810,14 @@ var ProgressRenderer = {
|
|
|
4089
2810
|
|
|
4090
2811
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
4091
2812
|
var import_classnames7 = __toESM(require_classnames());
|
|
4092
|
-
import { Button as
|
|
2813
|
+
import { Button as Button6, Header as Header6, InlineAlert as InlineAlert3, Modal as Modal4, NavigationOption } from "@transferwise/components";
|
|
4093
2814
|
import { Plus } from "@transferwise/icons";
|
|
4094
|
-
import { useState as
|
|
4095
|
-
import { useIntl as
|
|
2815
|
+
import { useState as useState10 } from "react";
|
|
2816
|
+
import { useIntl as useIntl9 } from "react-intl";
|
|
4096
2817
|
|
|
4097
2818
|
// ../renderers/src/messages/repeatable.messages.ts
|
|
4098
|
-
import { defineMessages as
|
|
4099
|
-
var repeatable_messages_default =
|
|
2819
|
+
import { defineMessages as defineMessages8 } from "react-intl";
|
|
2820
|
+
var repeatable_messages_default = defineMessages8({
|
|
4100
2821
|
addItemTitle: {
|
|
4101
2822
|
id: "df.wise.ArraySchema.addItemTitle",
|
|
4102
2823
|
defaultMessage: "Add Item",
|
|
@@ -4120,10 +2841,10 @@ var repeatable_messages_default = defineMessages9({
|
|
|
4120
2841
|
});
|
|
4121
2842
|
|
|
4122
2843
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
4123
|
-
import { Fragment as
|
|
2844
|
+
import { Fragment as Fragment5, jsx as jsx62, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
4124
2845
|
var RepeatableRenderer = {
|
|
4125
2846
|
canRenderType: "repeatable",
|
|
4126
|
-
render: (props) => /* @__PURE__ */
|
|
2847
|
+
render: (props) => /* @__PURE__ */ jsx62(Repeatable, __spreadValues({}, props))
|
|
4127
2848
|
};
|
|
4128
2849
|
function Repeatable(props) {
|
|
4129
2850
|
const {
|
|
@@ -4140,8 +2861,8 @@ function Repeatable(props) {
|
|
|
4140
2861
|
onSave,
|
|
4141
2862
|
onRemove
|
|
4142
2863
|
} = props;
|
|
4143
|
-
const { formatMessage } =
|
|
4144
|
-
const [openModalType, setOpenModalType] =
|
|
2864
|
+
const { formatMessage } = useIntl9();
|
|
2865
|
+
const [openModalType, setOpenModalType] = useState10(null);
|
|
4145
2866
|
const { ref } = useScrollToError(validationState, features);
|
|
4146
2867
|
const onAddItem = () => {
|
|
4147
2868
|
onAdd();
|
|
@@ -4164,43 +2885,43 @@ function Repeatable(props) {
|
|
|
4164
2885
|
const onCancelEdit = () => {
|
|
4165
2886
|
setOpenModalType(null);
|
|
4166
2887
|
};
|
|
4167
|
-
return /* @__PURE__ */
|
|
4168
|
-
/* @__PURE__ */
|
|
4169
|
-
title && /* @__PURE__ */
|
|
4170
|
-
description && /* @__PURE__ */
|
|
4171
|
-
/* @__PURE__ */
|
|
2888
|
+
return /* @__PURE__ */ jsxs14(Fragment5, { children: [
|
|
2889
|
+
/* @__PURE__ */ jsxs14("div", { ref, children: [
|
|
2890
|
+
title && /* @__PURE__ */ jsx62(Header6, { title }),
|
|
2891
|
+
description && /* @__PURE__ */ jsx62("p", { children: description }),
|
|
2892
|
+
/* @__PURE__ */ jsxs14(
|
|
4172
2893
|
"div",
|
|
4173
2894
|
{
|
|
4174
2895
|
className: (0, import_classnames7.default)("form-group", {
|
|
4175
2896
|
"has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
|
|
4176
2897
|
}),
|
|
4177
2898
|
children: [
|
|
4178
|
-
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */
|
|
4179
|
-
/* @__PURE__ */
|
|
2899
|
+
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ jsx62(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
|
|
2900
|
+
/* @__PURE__ */ jsx62(
|
|
4180
2901
|
NavigationOption,
|
|
4181
2902
|
{
|
|
4182
|
-
media: /* @__PURE__ */
|
|
2903
|
+
media: /* @__PURE__ */ jsx62(Plus, {}),
|
|
4183
2904
|
title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
|
|
4184
2905
|
showMediaAtAllSizes: true,
|
|
4185
2906
|
onClick: () => onAddItem()
|
|
4186
2907
|
}
|
|
4187
2908
|
),
|
|
4188
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */
|
|
2909
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ jsx62(InlineAlert3, { type: "negative", children: validationState.message })
|
|
4189
2910
|
]
|
|
4190
2911
|
}
|
|
4191
2912
|
)
|
|
4192
2913
|
] }),
|
|
4193
|
-
/* @__PURE__ */
|
|
2914
|
+
/* @__PURE__ */ jsx62(
|
|
4194
2915
|
Modal4,
|
|
4195
2916
|
{
|
|
4196
2917
|
open: openModalType !== null,
|
|
4197
2918
|
title: (openModalType === "add" ? addItemTitle : editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
|
|
4198
|
-
body: /* @__PURE__ */
|
|
4199
|
-
/* @__PURE__ */
|
|
4200
|
-
/* @__PURE__ */
|
|
4201
|
-
/* @__PURE__ */
|
|
4202
|
-
/* @__PURE__ */
|
|
4203
|
-
|
|
2919
|
+
body: /* @__PURE__ */ jsxs14(Fragment5, { children: [
|
|
2920
|
+
/* @__PURE__ */ jsx62("div", { className: "m-b-2", children: editableItem }),
|
|
2921
|
+
/* @__PURE__ */ jsxs14("div", { children: [
|
|
2922
|
+
/* @__PURE__ */ jsx62(Button6, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
|
|
2923
|
+
/* @__PURE__ */ jsx62(
|
|
2924
|
+
Button6,
|
|
4204
2925
|
{
|
|
4205
2926
|
v2: true,
|
|
4206
2927
|
priority: "secondary",
|
|
@@ -4221,10 +2942,10 @@ function ItemSummaryOption({
|
|
|
4221
2942
|
item,
|
|
4222
2943
|
onClick
|
|
4223
2944
|
}) {
|
|
4224
|
-
return /* @__PURE__ */
|
|
2945
|
+
return /* @__PURE__ */ jsx62(
|
|
4225
2946
|
NavigationOption,
|
|
4226
2947
|
{
|
|
4227
|
-
media: /* @__PURE__ */
|
|
2948
|
+
media: /* @__PURE__ */ jsx62(OptionMedia, { media: item.media, preferAvatar: false }),
|
|
4228
2949
|
title: item.title,
|
|
4229
2950
|
content: item.description,
|
|
4230
2951
|
showMediaAtAllSizes: true,
|
|
@@ -4237,14 +2958,14 @@ var RepeatableRenderer_default = RepeatableRenderer;
|
|
|
4237
2958
|
|
|
4238
2959
|
// ../renderers/src/ReviewLegacyRenderer.tsx
|
|
4239
2960
|
import { DefinitionList } from "@transferwise/components";
|
|
4240
|
-
import { Fragment as
|
|
2961
|
+
import { Fragment as Fragment6, jsx as jsx63, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
4241
2962
|
var ReviewRenderer = {
|
|
4242
2963
|
canRenderType: "review",
|
|
4243
2964
|
render: ({ callToAction, control, fields, margin, title, trackEvent }) => {
|
|
4244
2965
|
const orientation = mapControlToDefinitionListLayout(control);
|
|
4245
|
-
return /* @__PURE__ */
|
|
4246
|
-
/* @__PURE__ */
|
|
4247
|
-
/* @__PURE__ */
|
|
2966
|
+
return /* @__PURE__ */ jsxs15("div", { className: getMargin(margin), children: [
|
|
2967
|
+
/* @__PURE__ */ jsx63(Header5, { title, callToAction }),
|
|
2968
|
+
/* @__PURE__ */ jsx63("div", { className: margin, children: /* @__PURE__ */ jsx63(
|
|
4248
2969
|
DefinitionList,
|
|
4249
2970
|
{
|
|
4250
2971
|
layout: orientation,
|
|
@@ -4282,20 +3003,20 @@ var mapControlToDefinitionListLayout = (control) => {
|
|
|
4282
3003
|
};
|
|
4283
3004
|
var getFieldLabel = (label, help, onClick) => {
|
|
4284
3005
|
if (help) {
|
|
4285
|
-
return /* @__PURE__ */
|
|
3006
|
+
return /* @__PURE__ */ jsxs15(Fragment6, { children: [
|
|
4286
3007
|
label,
|
|
4287
3008
|
" ",
|
|
4288
|
-
/* @__PURE__ */
|
|
3009
|
+
/* @__PURE__ */ jsx63(Help_default, { help, onClick })
|
|
4289
3010
|
] });
|
|
4290
3011
|
}
|
|
4291
3012
|
return label;
|
|
4292
3013
|
};
|
|
4293
3014
|
|
|
4294
3015
|
// ../renderers/src/ReviewRenderer.tsx
|
|
4295
|
-
import { ListItem as
|
|
3016
|
+
import { ListItem as ListItem9, Markdown as Markdown4, Popover } from "@transferwise/components";
|
|
4296
3017
|
import { QuestionMarkCircle } from "@transferwise/icons";
|
|
4297
|
-
import { useIntl as
|
|
4298
|
-
import { jsx as
|
|
3018
|
+
import { useIntl as useIntl10 } from "react-intl";
|
|
3019
|
+
import { jsx as jsx64, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
4299
3020
|
var IGNORED_CONTROLS = [
|
|
4300
3021
|
"horizontal",
|
|
4301
3022
|
"horizontal-end-aligned",
|
|
@@ -4305,7 +3026,7 @@ var IGNORED_CONTROLS = [
|
|
|
4305
3026
|
var ReviewRenderer2 = {
|
|
4306
3027
|
canRenderType: "review",
|
|
4307
3028
|
canRender: ({ control }) => control ? !IGNORED_CONTROLS.includes(control) : true,
|
|
4308
|
-
render: (props) => /* @__PURE__ */
|
|
3029
|
+
render: (props) => /* @__PURE__ */ jsx64(Review, __spreadValues({}, props))
|
|
4309
3030
|
};
|
|
4310
3031
|
var Review = ({
|
|
4311
3032
|
callToAction,
|
|
@@ -4316,9 +3037,9 @@ var Review = ({
|
|
|
4316
3037
|
title,
|
|
4317
3038
|
trackEvent
|
|
4318
3039
|
}) => {
|
|
4319
|
-
const intl =
|
|
4320
|
-
return /* @__PURE__ */
|
|
4321
|
-
/* @__PURE__ */
|
|
3040
|
+
const intl = useIntl10();
|
|
3041
|
+
return /* @__PURE__ */ jsxs16("div", { className: getMargin(margin), children: [
|
|
3042
|
+
/* @__PURE__ */ jsx64(Header5, { title, callToAction }),
|
|
4322
3043
|
fields.map((field) => {
|
|
4323
3044
|
var _a, _b, _c;
|
|
4324
3045
|
const {
|
|
@@ -4336,8 +3057,8 @@ var Review = ({
|
|
|
4336
3057
|
ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
|
|
4337
3058
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
4338
3059
|
};
|
|
4339
|
-
return /* @__PURE__ */
|
|
4340
|
-
|
|
3060
|
+
return /* @__PURE__ */ jsx64(
|
|
3061
|
+
ListItem9,
|
|
4341
3062
|
{
|
|
4342
3063
|
title: value,
|
|
4343
3064
|
subtitle: label,
|
|
@@ -4357,18 +3078,18 @@ var Review = ({
|
|
|
4357
3078
|
] });
|
|
4358
3079
|
};
|
|
4359
3080
|
var getHelpControl = (help, ariaLabel, onClick) => {
|
|
4360
|
-
return /* @__PURE__ */
|
|
3081
|
+
return /* @__PURE__ */ jsx64(Popover, { content: /* @__PURE__ */ jsx64(Markdown4, { config: { link: { target: "_blank" } }, children: help }), children: /* @__PURE__ */ jsx64(ListItem9.IconButton, { partiallyInteractive: true, "aria-label": ariaLabel, onClick, children: /* @__PURE__ */ jsx64(QuestionMarkCircle, {}) }) });
|
|
4361
3082
|
};
|
|
4362
3083
|
var ReviewRenderer_default = ReviewRenderer2;
|
|
4363
3084
|
|
|
4364
3085
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
4365
|
-
import { Input as
|
|
4366
|
-
import { useState as
|
|
4367
|
-
import { useIntl as
|
|
3086
|
+
import { Input as Input4, InputGroup as InputGroup3, List, ListItem as ListItem10, Markdown as Markdown5 } from "@transferwise/components";
|
|
3087
|
+
import { useState as useState11 } from "react";
|
|
3088
|
+
import { useIntl as useIntl12 } from "react-intl";
|
|
4368
3089
|
|
|
4369
3090
|
// ../renderers/src/messages/search.messages.ts
|
|
4370
|
-
import { defineMessages as
|
|
4371
|
-
var search_messages_default =
|
|
3091
|
+
import { defineMessages as defineMessages9 } from "react-intl";
|
|
3092
|
+
var search_messages_default = defineMessages9({
|
|
4372
3093
|
loading: {
|
|
4373
3094
|
id: "df.wise.SearchLayout.loading",
|
|
4374
3095
|
defaultMessage: "Loading...",
|
|
@@ -4377,11 +3098,11 @@ var search_messages_default = defineMessages10({
|
|
|
4377
3098
|
});
|
|
4378
3099
|
|
|
4379
3100
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
4380
|
-
import { useIntl as
|
|
3101
|
+
import { useIntl as useIntl11 } from "react-intl";
|
|
4381
3102
|
|
|
4382
3103
|
// ../renderers/src/messages/generic-error.messages.ts
|
|
4383
|
-
import { defineMessages as
|
|
4384
|
-
var generic_error_messages_default =
|
|
3104
|
+
import { defineMessages as defineMessages10 } from "react-intl";
|
|
3105
|
+
var generic_error_messages_default = defineMessages10({
|
|
4385
3106
|
genericErrorRetryHint: {
|
|
4386
3107
|
id: "df.wise.PersistAsyncSchema.genericError",
|
|
4387
3108
|
defaultMessage: "Something went wrong, please try again.",
|
|
@@ -4401,19 +3122,19 @@ var generic_error_messages_default = defineMessages11({
|
|
|
4401
3122
|
|
|
4402
3123
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
4403
3124
|
import { Link } from "@transferwise/components";
|
|
4404
|
-
import { jsx as
|
|
3125
|
+
import { jsx as jsx65, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
4405
3126
|
function ErrorResult({ state }) {
|
|
4406
|
-
const intl =
|
|
4407
|
-
return /* @__PURE__ */
|
|
3127
|
+
const intl = useIntl11();
|
|
3128
|
+
return /* @__PURE__ */ jsxs17("p", { className: "m-t-2", children: [
|
|
4408
3129
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
4409
3130
|
"\xA0",
|
|
4410
|
-
/* @__PURE__ */
|
|
3131
|
+
/* @__PURE__ */ jsx65(Link, { onClick: () => state.onRetry(), children: intl.formatMessage(generic_error_messages_default.retry) })
|
|
4411
3132
|
] });
|
|
4412
3133
|
}
|
|
4413
3134
|
|
|
4414
3135
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
4415
|
-
import { Search
|
|
4416
|
-
import { Fragment as
|
|
3136
|
+
import { Search } from "@transferwise/icons";
|
|
3137
|
+
import { Fragment as Fragment7, jsx as jsx66, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
4417
3138
|
function BlockSearchRendererComponent({
|
|
4418
3139
|
id,
|
|
4419
3140
|
hint,
|
|
@@ -4426,10 +3147,10 @@ function BlockSearchRendererComponent({
|
|
|
4426
3147
|
trackEvent,
|
|
4427
3148
|
onChange
|
|
4428
3149
|
}) {
|
|
4429
|
-
const [hasSearched, setHasSearched] =
|
|
4430
|
-
const { formatMessage } =
|
|
4431
|
-
return /* @__PURE__ */
|
|
4432
|
-
/* @__PURE__ */
|
|
3150
|
+
const [hasSearched, setHasSearched] = useState11(false);
|
|
3151
|
+
const { formatMessage } = useIntl12();
|
|
3152
|
+
return /* @__PURE__ */ jsxs18("div", { className: getMargin(margin), children: [
|
|
3153
|
+
/* @__PURE__ */ jsx66(
|
|
4433
3154
|
FieldInput_default,
|
|
4434
3155
|
{
|
|
4435
3156
|
id,
|
|
@@ -4438,8 +3159,8 @@ function BlockSearchRendererComponent({
|
|
|
4438
3159
|
help: "",
|
|
4439
3160
|
label: title,
|
|
4440
3161
|
features,
|
|
4441
|
-
children: /* @__PURE__ */
|
|
4442
|
-
|
|
3162
|
+
children: /* @__PURE__ */ jsx66(InputGroup3, { addonStart: { content: /* @__PURE__ */ jsx66(Search, { size: 24 }) }, children: /* @__PURE__ */ jsx66(
|
|
3163
|
+
Input4,
|
|
4443
3164
|
{
|
|
4444
3165
|
id,
|
|
4445
3166
|
name: id,
|
|
@@ -4457,7 +3178,7 @@ function BlockSearchRendererComponent({
|
|
|
4457
3178
|
) })
|
|
4458
3179
|
}
|
|
4459
3180
|
),
|
|
4460
|
-
isLoading ? /* @__PURE__ */
|
|
3181
|
+
isLoading ? /* @__PURE__ */ jsx66("span", { children: formatMessage(search_messages_default.loading) }) : /* @__PURE__ */ jsx66(SearchResultContent, { state, trackEvent })
|
|
4461
3182
|
] });
|
|
4462
3183
|
}
|
|
4463
3184
|
function SearchResultContent({
|
|
@@ -4466,39 +3187,39 @@ function SearchResultContent({
|
|
|
4466
3187
|
}) {
|
|
4467
3188
|
switch (state.type) {
|
|
4468
3189
|
case "error":
|
|
4469
|
-
return /* @__PURE__ */
|
|
3190
|
+
return /* @__PURE__ */ jsx66(ErrorResult, { state });
|
|
4470
3191
|
case "results":
|
|
4471
|
-
return /* @__PURE__ */
|
|
3192
|
+
return /* @__PURE__ */ jsx66(SearchResults, { state, trackEvent });
|
|
4472
3193
|
case "layout":
|
|
4473
|
-
return /* @__PURE__ */
|
|
3194
|
+
return /* @__PURE__ */ jsxs18(Fragment7, { children: [
|
|
4474
3195
|
" ",
|
|
4475
3196
|
state.layout,
|
|
4476
3197
|
" "
|
|
4477
3198
|
] });
|
|
4478
3199
|
case "noResults":
|
|
4479
|
-
return /* @__PURE__ */
|
|
3200
|
+
return /* @__PURE__ */ jsx66(EmptySearchResult, { state });
|
|
4480
3201
|
case "pending":
|
|
4481
3202
|
default:
|
|
4482
3203
|
return null;
|
|
4483
3204
|
}
|
|
4484
3205
|
}
|
|
4485
3206
|
function EmptySearchResult({ state }) {
|
|
4486
|
-
return /* @__PURE__ */
|
|
3207
|
+
return /* @__PURE__ */ jsx66(Markdown5, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
4487
3208
|
}
|
|
4488
3209
|
function SearchResults({
|
|
4489
3210
|
state,
|
|
4490
3211
|
trackEvent
|
|
4491
3212
|
}) {
|
|
4492
|
-
return /* @__PURE__ */
|
|
3213
|
+
return /* @__PURE__ */ jsx66(List, { children: state.results.map((result) => {
|
|
4493
3214
|
const { media } = result;
|
|
4494
|
-
return /* @__PURE__ */
|
|
4495
|
-
|
|
3215
|
+
return /* @__PURE__ */ jsx66(
|
|
3216
|
+
ListItem10,
|
|
4496
3217
|
{
|
|
4497
3218
|
title: result.title,
|
|
4498
3219
|
subtitle: result.description,
|
|
4499
|
-
media: media ? /* @__PURE__ */
|
|
4500
|
-
control: /* @__PURE__ */
|
|
4501
|
-
|
|
3220
|
+
media: media ? /* @__PURE__ */ jsx66(OptionMedia, { media, preferAvatar: false }) : void 0,
|
|
3221
|
+
control: /* @__PURE__ */ jsx66(
|
|
3222
|
+
ListItem10.Navigation,
|
|
4502
3223
|
{
|
|
4503
3224
|
onClick: () => {
|
|
4504
3225
|
trackEvent("Search Result Selected", __spreadValues({
|
|
@@ -4517,10 +3238,10 @@ var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
|
|
|
4517
3238
|
|
|
4518
3239
|
// ../renderers/src/SearchRenderer/InlineSearchRendererComponent.tsx
|
|
4519
3240
|
import { Markdown as Markdown6, Typeahead } from "@transferwise/components";
|
|
4520
|
-
import { Search as
|
|
4521
|
-
import { useState as
|
|
4522
|
-
import { useIntl as
|
|
4523
|
-
import { jsx as
|
|
3241
|
+
import { Search as Search2 } from "@transferwise/icons";
|
|
3242
|
+
import { useState as useState12 } from "react";
|
|
3243
|
+
import { useIntl as useIntl13 } from "react-intl";
|
|
3244
|
+
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
4524
3245
|
function InlineSearchRenderer({
|
|
4525
3246
|
id,
|
|
4526
3247
|
hint,
|
|
@@ -4532,9 +3253,9 @@ function InlineSearchRenderer({
|
|
|
4532
3253
|
onChange,
|
|
4533
3254
|
trackEvent
|
|
4534
3255
|
}) {
|
|
4535
|
-
const [hasSearched, setHasSearched] =
|
|
4536
|
-
const intl =
|
|
4537
|
-
return /* @__PURE__ */
|
|
3256
|
+
const [hasSearched, setHasSearched] = useState12(false);
|
|
3257
|
+
const intl = useIntl13();
|
|
3258
|
+
return /* @__PURE__ */ jsx67("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx67(
|
|
4538
3259
|
FieldInput_default,
|
|
4539
3260
|
{
|
|
4540
3261
|
id,
|
|
@@ -4543,7 +3264,7 @@ function InlineSearchRenderer({
|
|
|
4543
3264
|
help: "",
|
|
4544
3265
|
label: title,
|
|
4545
3266
|
features,
|
|
4546
|
-
children: /* @__PURE__ */
|
|
3267
|
+
children: /* @__PURE__ */ jsx67(
|
|
4547
3268
|
Typeahead,
|
|
4548
3269
|
{
|
|
4549
3270
|
id: "typeahead-input-id",
|
|
@@ -4552,10 +3273,10 @@ function InlineSearchRenderer({
|
|
|
4552
3273
|
size: "md",
|
|
4553
3274
|
placeholder: hint,
|
|
4554
3275
|
maxHeight: 100,
|
|
4555
|
-
footer: /* @__PURE__ */
|
|
3276
|
+
footer: /* @__PURE__ */ jsx67(TypeaheadFooter, { state, isLoading }),
|
|
4556
3277
|
multiple: false,
|
|
4557
3278
|
clearable: false,
|
|
4558
|
-
addon: /* @__PURE__ */
|
|
3279
|
+
addon: /* @__PURE__ */ jsx67(Search2, { size: 24 }),
|
|
4559
3280
|
options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
|
|
4560
3281
|
minQueryLength: 1,
|
|
4561
3282
|
onChange: (values) => {
|
|
@@ -4592,28 +3313,28 @@ function mapResultToTypeaheadOption(result) {
|
|
|
4592
3313
|
};
|
|
4593
3314
|
}
|
|
4594
3315
|
function TypeaheadFooter({ state, isLoading }) {
|
|
4595
|
-
const { formatMessage } =
|
|
3316
|
+
const { formatMessage } = useIntl13();
|
|
4596
3317
|
if (state.type === "layout") {
|
|
4597
|
-
return /* @__PURE__ */
|
|
3318
|
+
return /* @__PURE__ */ jsx67("div", { className: "m-x-1 m-y-1", children: state.layout });
|
|
4598
3319
|
}
|
|
4599
3320
|
if (state.type === "noResults") {
|
|
4600
|
-
return /* @__PURE__ */
|
|
3321
|
+
return /* @__PURE__ */ jsx67(Markdown6, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
4601
3322
|
}
|
|
4602
3323
|
if (state.type === "error") {
|
|
4603
|
-
return /* @__PURE__ */
|
|
3324
|
+
return /* @__PURE__ */ jsx67("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ jsx67(ErrorResult, { state }) });
|
|
4604
3325
|
}
|
|
4605
3326
|
if (state.type === "pending" || isLoading) {
|
|
4606
|
-
return /* @__PURE__ */
|
|
3327
|
+
return /* @__PURE__ */ jsx67("p", { className: "m-t-2 m-x-2", children: formatMessage(search_messages_default.loading) });
|
|
4607
3328
|
}
|
|
4608
3329
|
return null;
|
|
4609
3330
|
}
|
|
4610
3331
|
var InlineSearchRendererComponent_default = InlineSearchRenderer;
|
|
4611
3332
|
|
|
4612
3333
|
// ../renderers/src/SearchRenderer/SearchRenderer.tsx
|
|
4613
|
-
import { jsx as
|
|
3334
|
+
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
4614
3335
|
var SearchRenderer = {
|
|
4615
3336
|
canRenderType: "search",
|
|
4616
|
-
render: (props) => props.control === "inline" ? /* @__PURE__ */
|
|
3337
|
+
render: (props) => props.control === "inline" ? /* @__PURE__ */ jsx68(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ jsx68(BlockSearchRendererComponent_default, __spreadValues({}, props))
|
|
4617
3338
|
};
|
|
4618
3339
|
var SearchRenderer_default = SearchRenderer;
|
|
4619
3340
|
|
|
@@ -4642,12 +3363,12 @@ var getHeaderAction2 = (callToAction) => {
|
|
|
4642
3363
|
};
|
|
4643
3364
|
|
|
4644
3365
|
// ../renderers/src/SectionRenderer.tsx
|
|
4645
|
-
import { jsx as
|
|
3366
|
+
import { jsx as jsx69, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
4646
3367
|
var SectionRenderer = {
|
|
4647
3368
|
canRenderType: "section",
|
|
4648
3369
|
render: ({ children, callToAction, margin, title }) => {
|
|
4649
|
-
return /* @__PURE__ */
|
|
4650
|
-
(title || callToAction) && /* @__PURE__ */
|
|
3370
|
+
return /* @__PURE__ */ jsxs19("section", { className: getMargin(margin), children: [
|
|
3371
|
+
(title || callToAction) && /* @__PURE__ */ jsx69(Header7, { title: title != null ? title : "", action: getHeaderAction2(callToAction) }),
|
|
4651
3372
|
children
|
|
4652
3373
|
] });
|
|
4653
3374
|
}
|
|
@@ -4656,7 +3377,7 @@ var SectionRenderer_default = SectionRenderer;
|
|
|
4656
3377
|
|
|
4657
3378
|
// ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
4658
3379
|
import { RadioGroup } from "@transferwise/components";
|
|
4659
|
-
import { Fragment as
|
|
3380
|
+
import { Fragment as Fragment8, jsx as jsx70, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
4660
3381
|
function RadioInputRendererComponent(props) {
|
|
4661
3382
|
const {
|
|
4662
3383
|
id,
|
|
@@ -4671,8 +3392,8 @@ function RadioInputRendererComponent(props) {
|
|
|
4671
3392
|
validationState,
|
|
4672
3393
|
onSelect
|
|
4673
3394
|
} = props;
|
|
4674
|
-
return /* @__PURE__ */
|
|
4675
|
-
/* @__PURE__ */
|
|
3395
|
+
return /* @__PURE__ */ jsxs20(Fragment8, { children: [
|
|
3396
|
+
/* @__PURE__ */ jsx70(
|
|
4676
3397
|
FieldInput_default,
|
|
4677
3398
|
{
|
|
4678
3399
|
id,
|
|
@@ -4681,7 +3402,7 @@ function RadioInputRendererComponent(props) {
|
|
|
4681
3402
|
description,
|
|
4682
3403
|
validation: validationState,
|
|
4683
3404
|
features,
|
|
4684
|
-
children: /* @__PURE__ */
|
|
3405
|
+
children: /* @__PURE__ */ jsx70("span", { children: /* @__PURE__ */ jsx70(
|
|
4685
3406
|
RadioGroup,
|
|
4686
3407
|
{
|
|
4687
3408
|
name: id,
|
|
@@ -4690,7 +3411,7 @@ function RadioInputRendererComponent(props) {
|
|
|
4690
3411
|
value: index,
|
|
4691
3412
|
secondary: option.description,
|
|
4692
3413
|
disabled: option.disabled || disabled,
|
|
4693
|
-
avatar: /* @__PURE__ */
|
|
3414
|
+
avatar: /* @__PURE__ */ jsx70(OptionMedia, { media: option.media, preferAvatar: false })
|
|
4694
3415
|
})),
|
|
4695
3416
|
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
4696
3417
|
onChange: onSelect
|
|
@@ -4705,8 +3426,8 @@ function RadioInputRendererComponent(props) {
|
|
|
4705
3426
|
|
|
4706
3427
|
// ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
4707
3428
|
import { Tabs } from "@transferwise/components";
|
|
4708
|
-
import { useEffect as
|
|
4709
|
-
import { Fragment as
|
|
3429
|
+
import { useEffect as useEffect9 } from "react";
|
|
3430
|
+
import { Fragment as Fragment9, jsx as jsx71, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4710
3431
|
function TabInputRendererComponent(props) {
|
|
4711
3432
|
const {
|
|
4712
3433
|
id,
|
|
@@ -4721,13 +3442,13 @@ function TabInputRendererComponent(props) {
|
|
|
4721
3442
|
validationState,
|
|
4722
3443
|
onSelect
|
|
4723
3444
|
} = props;
|
|
4724
|
-
|
|
3445
|
+
useEffect9(() => {
|
|
4725
3446
|
if (!isValidIndex2(selectedIndex, options.length)) {
|
|
4726
3447
|
onSelect(0);
|
|
4727
3448
|
}
|
|
4728
3449
|
}, [selectedIndex, onSelect, options.length]);
|
|
4729
|
-
return /* @__PURE__ */
|
|
4730
|
-
/* @__PURE__ */
|
|
3450
|
+
return /* @__PURE__ */ jsxs21(Fragment9, { children: [
|
|
3451
|
+
/* @__PURE__ */ jsx71(
|
|
4731
3452
|
FieldInput_default,
|
|
4732
3453
|
{
|
|
4733
3454
|
id,
|
|
@@ -4736,7 +3457,7 @@ function TabInputRendererComponent(props) {
|
|
|
4736
3457
|
description,
|
|
4737
3458
|
validation: validationState,
|
|
4738
3459
|
features,
|
|
4739
|
-
children: /* @__PURE__ */
|
|
3460
|
+
children: /* @__PURE__ */ jsx71(
|
|
4740
3461
|
Tabs,
|
|
4741
3462
|
{
|
|
4742
3463
|
name: id,
|
|
@@ -4745,7 +3466,7 @@ function TabInputRendererComponent(props) {
|
|
|
4745
3466
|
title: option.title,
|
|
4746
3467
|
// if we pass null, we get some props-types console errors
|
|
4747
3468
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
4748
|
-
content: /* @__PURE__ */
|
|
3469
|
+
content: /* @__PURE__ */ jsx71(Fragment9, {}),
|
|
4749
3470
|
disabled: option.disabled || disabled
|
|
4750
3471
|
})),
|
|
4751
3472
|
onTabSelect: onSelect
|
|
@@ -4760,7 +3481,7 @@ var isValidIndex2 = (index, options) => index !== null && index >= 0 && index <
|
|
|
4760
3481
|
|
|
4761
3482
|
// ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
4762
3483
|
import { SelectInput as SelectInput2, SelectInputOptionContent as SelectInputOptionContent2 } from "@transferwise/components";
|
|
4763
|
-
import { Fragment as
|
|
3484
|
+
import { Fragment as Fragment10, jsx as jsx72, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
4764
3485
|
function SelectInputRendererComponent(props) {
|
|
4765
3486
|
const {
|
|
4766
3487
|
id,
|
|
@@ -4801,13 +3522,13 @@ function SelectInputRendererComponent(props) {
|
|
|
4801
3522
|
} : {
|
|
4802
3523
|
title: option.title,
|
|
4803
3524
|
description: option.description,
|
|
4804
|
-
icon: /* @__PURE__ */
|
|
3525
|
+
icon: /* @__PURE__ */ jsx72(OptionMedia, { media: option.media, preferAvatar: false })
|
|
4805
3526
|
};
|
|
4806
|
-
return /* @__PURE__ */
|
|
3527
|
+
return /* @__PURE__ */ jsx72(SelectInputOptionContent2, __spreadValues({}, contentProps));
|
|
4807
3528
|
};
|
|
4808
3529
|
const extraProps = { autoComplete };
|
|
4809
|
-
return /* @__PURE__ */
|
|
4810
|
-
/* @__PURE__ */
|
|
3530
|
+
return /* @__PURE__ */ jsxs22(Fragment10, { children: [
|
|
3531
|
+
/* @__PURE__ */ jsx72(
|
|
4811
3532
|
FieldInput_default,
|
|
4812
3533
|
{
|
|
4813
3534
|
id,
|
|
@@ -4816,7 +3537,7 @@ function SelectInputRendererComponent(props) {
|
|
|
4816
3537
|
description,
|
|
4817
3538
|
validation: validationState,
|
|
4818
3539
|
features,
|
|
4819
|
-
children: /* @__PURE__ */
|
|
3540
|
+
children: /* @__PURE__ */ jsx72(
|
|
4820
3541
|
SelectInput2,
|
|
4821
3542
|
__spreadValues({
|
|
4822
3543
|
name: id,
|
|
@@ -4837,9 +3558,9 @@ function SelectInputRendererComponent(props) {
|
|
|
4837
3558
|
}
|
|
4838
3559
|
|
|
4839
3560
|
// ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
4840
|
-
import { useEffect as
|
|
3561
|
+
import { useEffect as useEffect10 } from "react";
|
|
4841
3562
|
import { SegmentedControl } from "@transferwise/components";
|
|
4842
|
-
import { Fragment as
|
|
3563
|
+
import { Fragment as Fragment11, jsx as jsx73, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
4843
3564
|
function SegmentedInputRendererComponent(props) {
|
|
4844
3565
|
const {
|
|
4845
3566
|
id,
|
|
@@ -4853,13 +3574,13 @@ function SegmentedInputRendererComponent(props) {
|
|
|
4853
3574
|
validationState,
|
|
4854
3575
|
onSelect
|
|
4855
3576
|
} = props;
|
|
4856
|
-
|
|
3577
|
+
useEffect10(() => {
|
|
4857
3578
|
if (!isValidIndex3(selectedIndex, options.length)) {
|
|
4858
3579
|
onSelect(0);
|
|
4859
3580
|
}
|
|
4860
3581
|
}, [selectedIndex, onSelect, options.length]);
|
|
4861
|
-
return /* @__PURE__ */
|
|
4862
|
-
/* @__PURE__ */
|
|
3582
|
+
return /* @__PURE__ */ jsxs23(Fragment11, { children: [
|
|
3583
|
+
/* @__PURE__ */ jsx73(
|
|
4863
3584
|
FieldInput_default,
|
|
4864
3585
|
{
|
|
4865
3586
|
id,
|
|
@@ -4868,7 +3589,7 @@ function SegmentedInputRendererComponent(props) {
|
|
|
4868
3589
|
description,
|
|
4869
3590
|
validation: validationState,
|
|
4870
3591
|
features,
|
|
4871
|
-
children: /* @__PURE__ */
|
|
3592
|
+
children: /* @__PURE__ */ jsx73(
|
|
4872
3593
|
SegmentedControl,
|
|
4873
3594
|
{
|
|
4874
3595
|
name: `${id}-segmented-control`,
|
|
@@ -4885,14 +3606,14 @@ function SegmentedInputRendererComponent(props) {
|
|
|
4885
3606
|
)
|
|
4886
3607
|
}
|
|
4887
3608
|
),
|
|
4888
|
-
/* @__PURE__ */
|
|
3609
|
+
/* @__PURE__ */ jsx73("div", { id: `${id}-children`, children })
|
|
4889
3610
|
] });
|
|
4890
3611
|
}
|
|
4891
3612
|
var isValidIndex3 = (index, options) => index !== null && index >= 0 && index < options;
|
|
4892
3613
|
|
|
4893
3614
|
// ../renderers/src/SelectInputRenderer/RadioItemRendererComponent.tsx
|
|
4894
|
-
import { Header as Header8, InlineAlert as InlineAlert4, List as List2, ListItem as
|
|
4895
|
-
import { jsx as
|
|
3615
|
+
import { Header as Header8, InlineAlert as InlineAlert4, List as List2, ListItem as ListItem11 } from "@transferwise/components";
|
|
3616
|
+
import { jsx as jsx74, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
4896
3617
|
function RadioItemRendererComponent(props) {
|
|
4897
3618
|
const {
|
|
4898
3619
|
id,
|
|
@@ -4908,23 +3629,23 @@ function RadioItemRendererComponent(props) {
|
|
|
4908
3629
|
onSelect
|
|
4909
3630
|
} = props;
|
|
4910
3631
|
const { ref } = useScrollToError(validationState, features);
|
|
4911
|
-
return /* @__PURE__ */
|
|
4912
|
-
rootTitle && /* @__PURE__ */
|
|
3632
|
+
return /* @__PURE__ */ jsxs24("div", { ref, children: [
|
|
3633
|
+
rootTitle && /* @__PURE__ */ jsx74(
|
|
4913
3634
|
Header8,
|
|
4914
3635
|
{
|
|
4915
3636
|
as: "h2",
|
|
4916
|
-
title: help ? /* @__PURE__ */
|
|
3637
|
+
title: help ? /* @__PURE__ */ jsx74(LabelContentWithHelp, { text: rootTitle, help }) : rootTitle
|
|
4917
3638
|
}
|
|
4918
3639
|
),
|
|
4919
|
-
rootDescription && /* @__PURE__ */
|
|
4920
|
-
/* @__PURE__ */
|
|
4921
|
-
({ title, description, additionalText, inlineAlert, disabled, media, supportingValues }, index) => /* @__PURE__ */
|
|
4922
|
-
|
|
3640
|
+
rootDescription && /* @__PURE__ */ jsx74("p", { children: rootDescription }),
|
|
3641
|
+
/* @__PURE__ */ jsx74(List2, { children: options.map(
|
|
3642
|
+
({ title, description, additionalText, inlineAlert, disabled, media, supportingValues }, index) => /* @__PURE__ */ jsx74(
|
|
3643
|
+
ListItem11,
|
|
4923
3644
|
__spreadValues({
|
|
4924
3645
|
title,
|
|
4925
3646
|
subtitle: description,
|
|
4926
|
-
control: /* @__PURE__ */
|
|
4927
|
-
|
|
3647
|
+
control: /* @__PURE__ */ jsx74(
|
|
3648
|
+
ListItem11.Radio,
|
|
4928
3649
|
{
|
|
4929
3650
|
name: title,
|
|
4930
3651
|
checked: selectedIndex === index,
|
|
@@ -4939,50 +3660,50 @@ function RadioItemRendererComponent(props) {
|
|
|
4939
3660
|
title
|
|
4940
3661
|
)
|
|
4941
3662
|
) }, `${id}-${selectedIndex}`),
|
|
4942
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */
|
|
3663
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ jsx74(InlineAlert4, { type: "negative", children: validationState.message }),
|
|
4943
3664
|
children
|
|
4944
3665
|
] });
|
|
4945
3666
|
}
|
|
4946
3667
|
|
|
4947
3668
|
// ../renderers/src/SelectInputRenderer/SelectInputRenderer.tsx
|
|
4948
|
-
import { jsx as
|
|
3669
|
+
import { jsx as jsx75 } from "react/jsx-runtime";
|
|
4949
3670
|
var SelectInputRenderer = {
|
|
4950
3671
|
canRenderType: "input-select",
|
|
4951
3672
|
render: (props) => {
|
|
4952
3673
|
switch (props.control) {
|
|
4953
3674
|
case "radio":
|
|
4954
|
-
return /* @__PURE__ */
|
|
3675
|
+
return /* @__PURE__ */ jsx75(RadioInputRendererComponent, __spreadValues({}, props));
|
|
4955
3676
|
case "radio-item":
|
|
4956
|
-
return /* @__PURE__ */
|
|
3677
|
+
return /* @__PURE__ */ jsx75(RadioItemRendererComponent, __spreadValues({}, props));
|
|
4957
3678
|
case "tab":
|
|
4958
|
-
return props.options.length > 3 ? /* @__PURE__ */
|
|
3679
|
+
return props.options.length > 3 ? /* @__PURE__ */ jsx75(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx75(TabInputRendererComponent, __spreadValues({}, props));
|
|
4959
3680
|
case "segmented":
|
|
4960
|
-
return props.options.length > 3 ? /* @__PURE__ */
|
|
3681
|
+
return props.options.length > 3 ? /* @__PURE__ */ jsx75(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx75(SegmentedInputRendererComponent, __spreadValues({}, props));
|
|
4961
3682
|
case "select":
|
|
4962
3683
|
default:
|
|
4963
|
-
return /* @__PURE__ */
|
|
3684
|
+
return /* @__PURE__ */ jsx75(SelectInputRendererComponent, __spreadValues({}, props));
|
|
4964
3685
|
}
|
|
4965
3686
|
}
|
|
4966
3687
|
};
|
|
4967
3688
|
var SelectInputRenderer_default = SelectInputRenderer;
|
|
4968
3689
|
|
|
4969
3690
|
// ../renderers/src/StatusListRenderer.tsx
|
|
4970
|
-
import { AvatarView as AvatarView4, Header as Header9, ListItem as
|
|
4971
|
-
import { jsx as
|
|
3691
|
+
import { AvatarView as AvatarView4, Header as Header9, ListItem as ListItem12 } from "@transferwise/components";
|
|
3692
|
+
import { jsx as jsx76, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
4972
3693
|
var StatusListRenderer = {
|
|
4973
3694
|
canRenderType: "status-list",
|
|
4974
|
-
render: ({ margin, items, title }) => /* @__PURE__ */
|
|
4975
|
-
title ? /* @__PURE__ */
|
|
3695
|
+
render: ({ margin, items, title }) => /* @__PURE__ */ jsxs25("div", { className: getMargin(margin), children: [
|
|
3696
|
+
title ? /* @__PURE__ */ jsx76(Header9, { title }) : null,
|
|
4976
3697
|
items.map((item) => {
|
|
4977
3698
|
const { callToAction, description, title: itemTitle } = item;
|
|
4978
|
-
return /* @__PURE__ */
|
|
4979
|
-
|
|
3699
|
+
return /* @__PURE__ */ jsx76(
|
|
3700
|
+
ListItem12,
|
|
4980
3701
|
{
|
|
4981
3702
|
title: itemTitle,
|
|
4982
3703
|
subtitle: description,
|
|
4983
|
-
media: /* @__PURE__ */
|
|
4984
|
-
additionalInfo: callToAction ? /* @__PURE__ */
|
|
4985
|
-
|
|
3704
|
+
media: /* @__PURE__ */ jsx76(StatusListItemMedia, __spreadValues({}, item)),
|
|
3705
|
+
additionalInfo: callToAction ? /* @__PURE__ */ jsx76(
|
|
3706
|
+
ListItem12.AdditionalInfo,
|
|
4986
3707
|
{
|
|
4987
3708
|
action: __spreadValues({
|
|
4988
3709
|
label: callToAction.title
|
|
@@ -5000,10 +3721,10 @@ var StatusListItemMedia = ({ icon, status }) => {
|
|
|
5000
3721
|
return void 0;
|
|
5001
3722
|
}
|
|
5002
3723
|
if ("name" in icon) {
|
|
5003
|
-
return /* @__PURE__ */
|
|
3724
|
+
return /* @__PURE__ */ jsx76(AvatarView4, { badge: { status: mapStatus(status) }, children: /* @__PURE__ */ jsx76(DynamicIcon_default, { name: icon.name }) });
|
|
5004
3725
|
}
|
|
5005
3726
|
if ("text" in icon) {
|
|
5006
|
-
return /* @__PURE__ */
|
|
3727
|
+
return /* @__PURE__ */ jsx76(AvatarView4, { badge: { status: mapStatus(status) }, children: icon.text });
|
|
5007
3728
|
}
|
|
5008
3729
|
return void 0;
|
|
5009
3730
|
};
|
|
@@ -5021,12 +3742,12 @@ var StatusListRenderer_default = StatusListRenderer;
|
|
|
5021
3742
|
|
|
5022
3743
|
// ../renderers/src/utils/useCustomTheme.ts
|
|
5023
3744
|
import { useTheme } from "@wise/components-theming";
|
|
5024
|
-
import { useEffect as
|
|
3745
|
+
import { useEffect as useEffect11, useMemo } from "react";
|
|
5025
3746
|
var ThemeRequiredEventName = "Theme Required";
|
|
5026
3747
|
var useCustomTheme = (theme, trackEvent) => {
|
|
5027
3748
|
const theming = useTheme();
|
|
5028
|
-
const previousTheme =
|
|
5029
|
-
|
|
3749
|
+
const previousTheme = useMemo(() => theming.theme, []);
|
|
3750
|
+
useEffect11(() => {
|
|
5030
3751
|
theming.setTheme(theme);
|
|
5031
3752
|
trackEvent(ThemeRequiredEventName, { theme });
|
|
5032
3753
|
return theme !== previousTheme ? () => {
|
|
@@ -5037,14 +3758,86 @@ var useCustomTheme = (theme, trackEvent) => {
|
|
|
5037
3758
|
}, []);
|
|
5038
3759
|
};
|
|
5039
3760
|
|
|
3761
|
+
// ../renderers/src/step/StepFooter.tsx
|
|
3762
|
+
import { Button as Button7 } from "@transferwise/components";
|
|
3763
|
+
import { useEffect as useEffect12, useRef as useRef2, useState as useState13 } from "react";
|
|
3764
|
+
import { useIntl as useIntl14 } from "react-intl";
|
|
3765
|
+
|
|
3766
|
+
// ../renderers/src/messages/step.messages.ts
|
|
3767
|
+
import { defineMessages as defineMessages11 } from "react-intl";
|
|
3768
|
+
var step_messages_default = defineMessages11({
|
|
3769
|
+
scrollToBottom: {
|
|
3770
|
+
id: "df.wise.step.scrollToBottom",
|
|
3771
|
+
defaultMessage: "Scroll to bottom",
|
|
3772
|
+
description: "Label for a button that appears when the content of a step is too long and the user needs to scroll to the bottom to see all the content."
|
|
3773
|
+
}
|
|
3774
|
+
});
|
|
3775
|
+
|
|
3776
|
+
// ../renderers/src/step/StepFooter.tsx
|
|
3777
|
+
import { Fragment as Fragment12, jsx as jsx77, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
3778
|
+
var SCROLL_TO_BOTTOM = "scroll-to-bottom";
|
|
3779
|
+
var StepFooter = ({ footer, tags }) => {
|
|
3780
|
+
if (tags == null ? void 0 : tags.includes(SCROLL_TO_BOTTOM)) {
|
|
3781
|
+
return /* @__PURE__ */ jsx77(FooterWithScrollButton, { footer });
|
|
3782
|
+
}
|
|
3783
|
+
return /* @__PURE__ */ jsx77(DefaultFooter, { footer });
|
|
3784
|
+
};
|
|
3785
|
+
var DefaultFooter = ({ footer }) => {
|
|
3786
|
+
const hasFooter = footer && Array.isArray(footer) && footer.length > 0;
|
|
3787
|
+
return hasFooter ? /* @__PURE__ */ jsx77("div", { className: "df-step-fixed__footer", children: footer }) : void 0;
|
|
3788
|
+
};
|
|
3789
|
+
var FooterWithScrollButton = ({ footer }) => {
|
|
3790
|
+
const { formatMessage } = useIntl14();
|
|
3791
|
+
const endOfLayoutRef = useRef2(null);
|
|
3792
|
+
const isElementVisible = useIsElementVisible(endOfLayoutRef);
|
|
3793
|
+
const scrollButton = /* @__PURE__ */ jsx77(
|
|
3794
|
+
Button7,
|
|
3795
|
+
{
|
|
3796
|
+
className: "m-b-1",
|
|
3797
|
+
v2: true,
|
|
3798
|
+
block: true,
|
|
3799
|
+
priority: "tertiary",
|
|
3800
|
+
onClick: () => {
|
|
3801
|
+
var _a;
|
|
3802
|
+
(_a = endOfLayoutRef.current) == null ? void 0 : _a.scrollIntoView({ behavior: "smooth" });
|
|
3803
|
+
},
|
|
3804
|
+
children: formatMessage(step_messages_default.scrollToBottom)
|
|
3805
|
+
}
|
|
3806
|
+
);
|
|
3807
|
+
const hasStepFooterContent = footer && Array.isArray(footer) && footer.length > 0;
|
|
3808
|
+
if (isElementVisible && !hasStepFooterContent) {
|
|
3809
|
+
return /* @__PURE__ */ jsx77("div", { ref: endOfLayoutRef, "aria-hidden": "true" });
|
|
3810
|
+
}
|
|
3811
|
+
return /* @__PURE__ */ jsxs26(Fragment12, { children: [
|
|
3812
|
+
/* @__PURE__ */ jsx77("div", { ref: endOfLayoutRef, "aria-hidden": "true" }),
|
|
3813
|
+
/* @__PURE__ */ jsxs26("div", { className: "df-step-fixed__footer", children: [
|
|
3814
|
+
!isElementVisible && scrollButton,
|
|
3815
|
+
footer
|
|
3816
|
+
] })
|
|
3817
|
+
] });
|
|
3818
|
+
};
|
|
3819
|
+
var useIsElementVisible = (elementRef) => {
|
|
3820
|
+
const [isVisible, setIsVisible] = useState13(false);
|
|
3821
|
+
useEffect12(() => {
|
|
3822
|
+
const element = elementRef.current;
|
|
3823
|
+
if (!element) return;
|
|
3824
|
+
const observer = new IntersectionObserver(([entry]) => {
|
|
3825
|
+
setIsVisible(entry.isIntersecting);
|
|
3826
|
+
});
|
|
3827
|
+
observer.observe(element);
|
|
3828
|
+
return () => observer.disconnect();
|
|
3829
|
+
}, [elementRef]);
|
|
3830
|
+
return isVisible;
|
|
3831
|
+
};
|
|
3832
|
+
|
|
5040
3833
|
// ../renderers/src/step/StepHeader.tsx
|
|
5041
3834
|
import { Title as Title2 } from "@transferwise/components";
|
|
5042
|
-
import { Fragment as
|
|
3835
|
+
import { Fragment as Fragment13, jsx as jsx78, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
5043
3836
|
var StepHeader = ({ title, description, tags }) => {
|
|
5044
3837
|
const { titleType, alignmentClassName } = getHeaderStyle(tags);
|
|
5045
|
-
return /* @__PURE__ */
|
|
5046
|
-
title ? /* @__PURE__ */
|
|
5047
|
-
description ? /* @__PURE__ */
|
|
3838
|
+
return /* @__PURE__ */ jsxs27(Fragment13, { children: [
|
|
3839
|
+
title ? /* @__PURE__ */ jsx78(Title2, { as: "h1", type: titleType, className: `${alignmentClassName} m-b-2`, children: title }) : void 0,
|
|
3840
|
+
description ? /* @__PURE__ */ jsx78("p", { className: `${alignmentClassName} np-text-body-large`, children: description }) : void 0
|
|
5048
3841
|
] });
|
|
5049
3842
|
};
|
|
5050
3843
|
var getHeaderStyle = (tags) => {
|
|
@@ -5070,30 +3863,30 @@ var back_messages_default = defineMessages12({
|
|
|
5070
3863
|
});
|
|
5071
3864
|
|
|
5072
3865
|
// ../renderers/src/step/topbar/BackButton.tsx
|
|
5073
|
-
import { jsx as
|
|
3866
|
+
import { jsx as jsx79, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
5074
3867
|
function BackButton({ title, onClick }) {
|
|
5075
3868
|
const { formatMessage } = useIntl15();
|
|
5076
|
-
return /* @__PURE__ */
|
|
5077
|
-
/* @__PURE__ */
|
|
5078
|
-
/* @__PURE__ */
|
|
3869
|
+
return /* @__PURE__ */ jsxs28(IconButton, { className: "df-back-button", priority: "tertiary", onClick, children: [
|
|
3870
|
+
/* @__PURE__ */ jsx79("span", { className: "sr-only", children: title != null ? title : formatMessage(back_messages_default.back) }),
|
|
3871
|
+
/* @__PURE__ */ jsx79(ArrowLeft, {})
|
|
5079
3872
|
] });
|
|
5080
3873
|
}
|
|
5081
3874
|
|
|
5082
3875
|
// ../renderers/src/step/topbar/Toolbar.tsx
|
|
5083
|
-
import { Button as
|
|
5084
|
-
import { jsx as
|
|
3876
|
+
import { Button as Button8, IconButton as IconButton2 } from "@transferwise/components";
|
|
3877
|
+
import { jsx as jsx80, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
5085
3878
|
var Toolbar = ({ items }) => {
|
|
5086
|
-
return (items == null ? void 0 : items.length) > 0 ? /* @__PURE__ */
|
|
3879
|
+
return (items == null ? void 0 : items.length) > 0 ? /* @__PURE__ */ jsx80("div", { className: "df-toolbar", children: items.map((item, index) => /* @__PURE__ */ jsx80(ToolbarButton, __spreadValues({}, item), `${item.type}-${index}-${item.title}`)) }) : null;
|
|
5087
3880
|
};
|
|
5088
3881
|
function ToolbarButton(props) {
|
|
5089
|
-
return prefersMedia(props.control) ? /* @__PURE__ */
|
|
3882
|
+
return prefersMedia(props.control) ? /* @__PURE__ */ jsx80(MediaToolbarButton, __spreadValues({}, props)) : /* @__PURE__ */ jsx80(TextToolbarButton, __spreadValues({}, props));
|
|
5090
3883
|
}
|
|
5091
3884
|
function MediaToolbarButton(props) {
|
|
5092
3885
|
var _a;
|
|
5093
3886
|
const { context, control, media, accessibilityDescription, disabled, onClick } = props;
|
|
5094
3887
|
const priority = getIconButtonPriority(control);
|
|
5095
3888
|
const type = getSentiment2(context);
|
|
5096
|
-
return /* @__PURE__ */
|
|
3889
|
+
return /* @__PURE__ */ jsxs29(
|
|
5097
3890
|
IconButton2,
|
|
5098
3891
|
{
|
|
5099
3892
|
className: "df-toolbar-button",
|
|
@@ -5103,7 +3896,7 @@ function MediaToolbarButton(props) {
|
|
|
5103
3896
|
type,
|
|
5104
3897
|
onClick,
|
|
5105
3898
|
children: [
|
|
5106
|
-
accessibilityDescription ? /* @__PURE__ */
|
|
3899
|
+
accessibilityDescription ? /* @__PURE__ */ jsx80("span", { className: "sr-only", children: accessibilityDescription }) : null,
|
|
5107
3900
|
media ? (_a = getAddonStartMedia(media)) == null ? void 0 : _a.value : null
|
|
5108
3901
|
]
|
|
5109
3902
|
}
|
|
@@ -5114,8 +3907,8 @@ function TextToolbarButton(props) {
|
|
|
5114
3907
|
const addonStart = media ? getAddonStartMedia(media) : void 0;
|
|
5115
3908
|
const priority = getPriority2(control);
|
|
5116
3909
|
const sentiment = getSentiment2(context);
|
|
5117
|
-
return /* @__PURE__ */
|
|
5118
|
-
|
|
3910
|
+
return /* @__PURE__ */ jsx80(
|
|
3911
|
+
Button8,
|
|
5119
3912
|
{
|
|
5120
3913
|
v2: true,
|
|
5121
3914
|
size: "sm",
|
|
@@ -5144,18 +3937,18 @@ var getIconButtonPriority = (control) => {
|
|
|
5144
3937
|
};
|
|
5145
3938
|
|
|
5146
3939
|
// ../renderers/src/step/topbar/TopBar.tsx
|
|
5147
|
-
import { jsx as
|
|
3940
|
+
import { jsx as jsx81, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
5148
3941
|
function TopBar({ back, toolbar, tags }) {
|
|
5149
3942
|
const isBackAllowed = !(tags == null ? void 0 : tags.includes("non-dismissible"));
|
|
5150
3943
|
const backCTA = isBackAllowed ? back : void 0;
|
|
5151
|
-
return backCTA || toolbar ? /* @__PURE__ */
|
|
5152
|
-
backCTA ? /* @__PURE__ */
|
|
5153
|
-
toolbar ? /* @__PURE__ */
|
|
3944
|
+
return backCTA || toolbar ? /* @__PURE__ */ jsxs30("div", { className: "d-flex m-b-2", children: [
|
|
3945
|
+
backCTA ? /* @__PURE__ */ jsx81(BackButton, __spreadValues({}, backCTA)) : null,
|
|
3946
|
+
toolbar ? /* @__PURE__ */ jsx81(Toolbar, __spreadValues({}, toolbar)) : null
|
|
5154
3947
|
] }) : null;
|
|
5155
3948
|
}
|
|
5156
3949
|
|
|
5157
3950
|
// ../renderers/src/step/SplashCelebrationStepRenderer.tsx
|
|
5158
|
-
import { jsx as
|
|
3951
|
+
import { jsx as jsx82, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
5159
3952
|
var SplashCelebrationStepRenderer = {
|
|
5160
3953
|
canRenderType: "step",
|
|
5161
3954
|
canRender: ({ control }) => control === "splash-celebration",
|
|
@@ -5164,16 +3957,16 @@ var SplashCelebrationStepRenderer = {
|
|
|
5164
3957
|
function SplashCelebrationStepRendererComponent(props) {
|
|
5165
3958
|
const { back, title, description, toolbar, children, footer, tags, trackEvent } = props;
|
|
5166
3959
|
useCustomTheme("forest-green", trackEvent);
|
|
5167
|
-
return /* @__PURE__ */
|
|
5168
|
-
/* @__PURE__ */
|
|
5169
|
-
title || description ? /* @__PURE__ */
|
|
3960
|
+
return /* @__PURE__ */ jsxs31("div", { className: "splash-screen m-t-5", children: [
|
|
3961
|
+
/* @__PURE__ */ jsx82(TopBar, { back, toolbar, tags }),
|
|
3962
|
+
title || description ? /* @__PURE__ */ jsx82("div", { className: "m-b-4", children: /* @__PURE__ */ jsx82(StepHeader, { title, description, tags }) }) : void 0,
|
|
5170
3963
|
children,
|
|
5171
|
-
/* @__PURE__ */
|
|
3964
|
+
/* @__PURE__ */ jsx82(StepFooter, { footer, tags })
|
|
5172
3965
|
] });
|
|
5173
3966
|
}
|
|
5174
3967
|
|
|
5175
3968
|
// ../renderers/src/step/SplashStepRenderer.tsx
|
|
5176
|
-
import { jsx as
|
|
3969
|
+
import { jsx as jsx83, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
5177
3970
|
var SplashStepRenderer = {
|
|
5178
3971
|
canRenderType: "step",
|
|
5179
3972
|
canRender: ({ control }) => control === "splash",
|
|
@@ -5181,55 +3974,55 @@ var SplashStepRenderer = {
|
|
|
5181
3974
|
};
|
|
5182
3975
|
function SplashStepRendererComponent(props) {
|
|
5183
3976
|
const { back, title, description, toolbar, children, footer, tags } = props;
|
|
5184
|
-
return /* @__PURE__ */
|
|
5185
|
-
/* @__PURE__ */
|
|
5186
|
-
title || description ? /* @__PURE__ */
|
|
3977
|
+
return /* @__PURE__ */ jsxs32("div", { className: "splash-screen m-t-5", children: [
|
|
3978
|
+
/* @__PURE__ */ jsx83(TopBar, { back, toolbar, tags }),
|
|
3979
|
+
title || description ? /* @__PURE__ */ jsx83("div", { className: "m-b-4", children: /* @__PURE__ */ jsx83(StepHeader, { title, description, tags }) }) : void 0,
|
|
5187
3980
|
children,
|
|
5188
|
-
/* @__PURE__ */
|
|
3981
|
+
/* @__PURE__ */ jsx83(StepFooter, { footer, tags })
|
|
5189
3982
|
] });
|
|
5190
3983
|
}
|
|
5191
3984
|
|
|
5192
3985
|
// ../renderers/src/step/StepRenderer.tsx
|
|
5193
3986
|
import { Alert as Alert2 } from "@transferwise/components";
|
|
5194
|
-
import { jsx as
|
|
3987
|
+
import { jsx as jsx84, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
5195
3988
|
var StepRenderer = {
|
|
5196
3989
|
canRenderType: "step",
|
|
5197
3990
|
render: StepRendererComponent
|
|
5198
3991
|
};
|
|
5199
3992
|
function StepRendererComponent(props) {
|
|
5200
3993
|
const { back, description, error, title, children, toolbar, footer, tags } = props;
|
|
5201
|
-
return /* @__PURE__ */
|
|
5202
|
-
/* @__PURE__ */
|
|
5203
|
-
title || description ? /* @__PURE__ */
|
|
5204
|
-
error ? /* @__PURE__ */
|
|
3994
|
+
return /* @__PURE__ */ jsxs33("div", { children: [
|
|
3995
|
+
/* @__PURE__ */ jsx84(TopBar, { back, toolbar, tags }),
|
|
3996
|
+
title || description ? /* @__PURE__ */ jsx84("div", { className: "m-b-4", children: /* @__PURE__ */ jsx84(StepHeader, { title, description, tags }) }) : void 0,
|
|
3997
|
+
error ? /* @__PURE__ */ jsx84(Alert2, { type: "negative", className: "m-b-2", message: error }) : null,
|
|
5205
3998
|
children,
|
|
5206
|
-
/* @__PURE__ */
|
|
3999
|
+
/* @__PURE__ */ jsx84(StepFooter, { footer, tags })
|
|
5207
4000
|
] });
|
|
5208
4001
|
}
|
|
5209
4002
|
|
|
5210
4003
|
// ../renderers/src/TabsRenderer.tsx
|
|
5211
|
-
import { Chips
|
|
4004
|
+
import { Chips, SegmentedControl as SegmentedControl2, Tabs as Tabs2 } from "@transferwise/components";
|
|
5212
4005
|
import { useState as useState14 } from "react";
|
|
5213
|
-
import { jsx as
|
|
4006
|
+
import { jsx as jsx85, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
5214
4007
|
var TabsRenderer = {
|
|
5215
4008
|
canRenderType: "tabs",
|
|
5216
4009
|
render: (props) => {
|
|
5217
4010
|
switch (props.control) {
|
|
5218
4011
|
case "segmented":
|
|
5219
4012
|
if (props.tabs.length > 3) {
|
|
5220
|
-
return /* @__PURE__ */
|
|
4013
|
+
return /* @__PURE__ */ jsx85(TabsRendererComponent, __spreadValues({}, props));
|
|
5221
4014
|
}
|
|
5222
|
-
return /* @__PURE__ */
|
|
4015
|
+
return /* @__PURE__ */ jsx85(SegmentedTabsRendererComponent, __spreadValues({}, props));
|
|
5223
4016
|
case "chips":
|
|
5224
|
-
return /* @__PURE__ */
|
|
4017
|
+
return /* @__PURE__ */ jsx85(ChipsTabsRendererComponent, __spreadValues({}, props));
|
|
5225
4018
|
default:
|
|
5226
|
-
return /* @__PURE__ */
|
|
4019
|
+
return /* @__PURE__ */ jsx85(TabsRendererComponent, __spreadValues({}, props));
|
|
5227
4020
|
}
|
|
5228
4021
|
}
|
|
5229
4022
|
};
|
|
5230
4023
|
function TabsRendererComponent({ uid, margin, tabs }) {
|
|
5231
4024
|
const [selectedIndex, setSelectedIndex] = useState14(0);
|
|
5232
|
-
return /* @__PURE__ */
|
|
4025
|
+
return /* @__PURE__ */ jsx85("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx85(
|
|
5233
4026
|
Tabs2,
|
|
5234
4027
|
{
|
|
5235
4028
|
name: uid,
|
|
@@ -5237,7 +4030,7 @@ function TabsRendererComponent({ uid, margin, tabs }) {
|
|
|
5237
4030
|
tabs: tabs.map((option) => ({
|
|
5238
4031
|
title: option.title,
|
|
5239
4032
|
disabled: false,
|
|
5240
|
-
content: /* @__PURE__ */
|
|
4033
|
+
content: /* @__PURE__ */ jsxs34("div", { className: "m-t-2", children: [
|
|
5241
4034
|
" ",
|
|
5242
4035
|
option.children,
|
|
5243
4036
|
" "
|
|
@@ -5250,8 +4043,8 @@ function TabsRendererComponent({ uid, margin, tabs }) {
|
|
|
5250
4043
|
function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
|
|
5251
4044
|
var _a;
|
|
5252
4045
|
const [selectedIndex, setSelectedIndex] = useState14(0);
|
|
5253
|
-
return /* @__PURE__ */
|
|
5254
|
-
/* @__PURE__ */
|
|
4046
|
+
return /* @__PURE__ */ jsxs34("div", { className: getMargin(margin), children: [
|
|
4047
|
+
/* @__PURE__ */ jsx85(
|
|
5255
4048
|
SegmentedControl2,
|
|
5256
4049
|
{
|
|
5257
4050
|
name: uid,
|
|
@@ -5266,37 +4059,37 @@ function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
|
|
|
5266
4059
|
onChange: (value) => setSelectedIndex(Number(value))
|
|
5267
4060
|
}
|
|
5268
4061
|
),
|
|
5269
|
-
/* @__PURE__ */
|
|
4062
|
+
/* @__PURE__ */ jsx85("div", { id: `${uid}-children`, className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
5270
4063
|
] });
|
|
5271
4064
|
}
|
|
5272
4065
|
function ChipsTabsRendererComponent({ margin, tabs }) {
|
|
5273
4066
|
var _a;
|
|
5274
4067
|
const [selectedIndex, setSelectedIndex] = useState14(0);
|
|
5275
|
-
return /* @__PURE__ */
|
|
5276
|
-
/* @__PURE__ */
|
|
5277
|
-
|
|
4068
|
+
return /* @__PURE__ */ jsxs34("div", { className: getMargin(margin), children: [
|
|
4069
|
+
/* @__PURE__ */ jsx85("div", { className: "chips-container", children: /* @__PURE__ */ jsx85(
|
|
4070
|
+
Chips,
|
|
5278
4071
|
{
|
|
5279
4072
|
chips: tabs.map((tab, index) => ({ label: tab.title, value: index })),
|
|
5280
4073
|
selected: selectedIndex,
|
|
5281
4074
|
onChange: ({ selectedValue }) => setSelectedIndex(Number(selectedValue))
|
|
5282
4075
|
}
|
|
5283
4076
|
) }),
|
|
5284
|
-
/* @__PURE__ */
|
|
4077
|
+
/* @__PURE__ */ jsx85("div", { className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
5285
4078
|
] });
|
|
5286
4079
|
}
|
|
5287
4080
|
|
|
5288
4081
|
// ../renderers/src/TextInputRenderer.tsx
|
|
5289
|
-
import { InputGroup as
|
|
4082
|
+
import { InputGroup as InputGroup4 } from "@transferwise/components";
|
|
5290
4083
|
|
|
5291
4084
|
// ../renderers/src/components/VariableTextInput.tsx
|
|
5292
4085
|
import {
|
|
5293
|
-
Input as
|
|
4086
|
+
Input as Input5,
|
|
5294
4087
|
InputWithDisplayFormat,
|
|
5295
4088
|
PhoneNumberInput,
|
|
5296
4089
|
TextArea,
|
|
5297
4090
|
TextareaWithDisplayFormat
|
|
5298
4091
|
} from "@transferwise/components";
|
|
5299
|
-
import { jsx as
|
|
4092
|
+
import { jsx as jsx86 } from "react/jsx-runtime";
|
|
5300
4093
|
var commonKeys = [
|
|
5301
4094
|
"autoComplete",
|
|
5302
4095
|
"autoCapitalize",
|
|
@@ -5315,12 +4108,12 @@ function VariableTextInput(inputProps) {
|
|
|
5315
4108
|
const commonProps = __spreadProps(__spreadValues({}, pick(inputProps, ...commonKeys)), { name: id });
|
|
5316
4109
|
switch (control) {
|
|
5317
4110
|
case "email":
|
|
5318
|
-
return /* @__PURE__ */
|
|
4111
|
+
return /* @__PURE__ */ jsx86(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "email", onChange }));
|
|
5319
4112
|
case "password":
|
|
5320
|
-
return /* @__PURE__ */
|
|
4113
|
+
return /* @__PURE__ */ jsx86(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "password", onChange }));
|
|
5321
4114
|
case "numeric": {
|
|
5322
4115
|
const numericProps = __spreadProps(__spreadValues({}, commonProps), { type: "number", onWheel });
|
|
5323
|
-
return /* @__PURE__ */
|
|
4116
|
+
return /* @__PURE__ */ jsx86(
|
|
5324
4117
|
TextInput,
|
|
5325
4118
|
__spreadProps(__spreadValues({}, numericProps), {
|
|
5326
4119
|
onChange: (newValue) => {
|
|
@@ -5331,21 +4124,21 @@ function VariableTextInput(inputProps) {
|
|
|
5331
4124
|
);
|
|
5332
4125
|
}
|
|
5333
4126
|
case "phone-number":
|
|
5334
|
-
return /* @__PURE__ */
|
|
4127
|
+
return /* @__PURE__ */ jsx86(PhoneNumberInput, __spreadProps(__spreadValues({ initialValue: value }, commonProps), { onChange }));
|
|
5335
4128
|
default: {
|
|
5336
|
-
return /* @__PURE__ */
|
|
4129
|
+
return /* @__PURE__ */ jsx86(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "text", onChange }));
|
|
5337
4130
|
}
|
|
5338
4131
|
}
|
|
5339
4132
|
}
|
|
5340
4133
|
function TextInput(props) {
|
|
5341
4134
|
const _a = props, { control, displayFormat, onChange } = _a, commonProps = __objRest(_a, ["control", "displayFormat", "onChange"]);
|
|
5342
4135
|
const InputWithPattern = control === "textarea" ? TextareaWithDisplayFormat : InputWithDisplayFormat;
|
|
5343
|
-
const InputWithoutPattern = control === "textarea" ? TextArea :
|
|
5344
|
-
return displayFormat ? /* @__PURE__ */
|
|
4136
|
+
const InputWithoutPattern = control === "textarea" ? TextArea : Input5;
|
|
4137
|
+
return displayFormat ? /* @__PURE__ */ jsx86(InputWithPattern, __spreadProps(__spreadValues({ displayPattern: displayFormat }, commonProps), { onChange })) : /* @__PURE__ */ jsx86(InputWithoutPattern, __spreadProps(__spreadValues({}, commonProps), { onChange: (e) => onChange(e.target.value) }));
|
|
5345
4138
|
}
|
|
5346
4139
|
|
|
5347
4140
|
// ../renderers/src/TextInputRenderer.tsx
|
|
5348
|
-
import { jsx as
|
|
4141
|
+
import { jsx as jsx87 } from "react/jsx-runtime";
|
|
5349
4142
|
var TextInputRenderer = {
|
|
5350
4143
|
canRenderType: "input-text",
|
|
5351
4144
|
render: (props) => {
|
|
@@ -5378,7 +4171,7 @@ var TextInputRenderer = {
|
|
|
5378
4171
|
}
|
|
5379
4172
|
}
|
|
5380
4173
|
});
|
|
5381
|
-
return /* @__PURE__ */
|
|
4174
|
+
return /* @__PURE__ */ jsx87(
|
|
5382
4175
|
FieldInput_default,
|
|
5383
4176
|
{
|
|
5384
4177
|
id,
|
|
@@ -5389,7 +4182,7 @@ var TextInputRenderer = {
|
|
|
5389
4182
|
loadingState: props.fieldLoadingState,
|
|
5390
4183
|
help,
|
|
5391
4184
|
features: props.features,
|
|
5392
|
-
children: /* @__PURE__ */
|
|
4185
|
+
children: /* @__PURE__ */ jsx87(InputGroup4, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ jsx87(VariableTextInput, __spreadValues({}, inputProps)) })
|
|
5393
4186
|
}
|
|
5394
4187
|
);
|
|
5395
4188
|
}
|
|
@@ -5403,7 +4196,7 @@ import { Status as Status2, Upload, UploadInput as UploadInput2 } from "@transfe
|
|
|
5403
4196
|
var getRandomId = () => Math.random().toString(36).substring(2);
|
|
5404
4197
|
|
|
5405
4198
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
5406
|
-
import { jsx as
|
|
4199
|
+
import { jsx as jsx88 } from "react/jsx-runtime";
|
|
5407
4200
|
var UploadInputRenderer = {
|
|
5408
4201
|
canRenderType: "input-upload",
|
|
5409
4202
|
render: (props) => {
|
|
@@ -5430,7 +4223,7 @@ var UploadInputRenderer = {
|
|
|
5430
4223
|
};
|
|
5431
4224
|
return (
|
|
5432
4225
|
// We don't pass help here as there is no sensible place to display it
|
|
5433
|
-
/* @__PURE__ */
|
|
4226
|
+
/* @__PURE__ */ jsx88(
|
|
5434
4227
|
UploadFieldInput_default,
|
|
5435
4228
|
{
|
|
5436
4229
|
id,
|
|
@@ -5438,7 +4231,7 @@ var UploadInputRenderer = {
|
|
|
5438
4231
|
description: void 0,
|
|
5439
4232
|
validation: validationState,
|
|
5440
4233
|
features,
|
|
5441
|
-
children: /* @__PURE__ */
|
|
4234
|
+
children: /* @__PURE__ */ jsx88(
|
|
5442
4235
|
UploadInput2,
|
|
5443
4236
|
{
|
|
5444
4237
|
id,
|
|
@@ -5506,7 +4299,7 @@ var LargeUploadRenderer = {
|
|
|
5506
4299
|
};
|
|
5507
4300
|
const filetypes = acceptsToFileTypes(accepts);
|
|
5508
4301
|
const usAccept = filetypes === "*" ? "*" : filetypes.join(",");
|
|
5509
|
-
return /* @__PURE__ */
|
|
4302
|
+
return /* @__PURE__ */ jsx88(
|
|
5510
4303
|
FieldInput_default,
|
|
5511
4304
|
{
|
|
5512
4305
|
id,
|
|
@@ -5515,7 +4308,7 @@ var LargeUploadRenderer = {
|
|
|
5515
4308
|
validation: validationState,
|
|
5516
4309
|
help,
|
|
5517
4310
|
features,
|
|
5518
|
-
children: /* @__PURE__ */
|
|
4311
|
+
children: /* @__PURE__ */ jsx88(
|
|
5519
4312
|
Upload,
|
|
5520
4313
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
5521
4314
|
usAccept,
|
|
@@ -5533,7 +4326,7 @@ var LargeUploadRenderer = {
|
|
|
5533
4326
|
// ../renderers/src/UpsellRenderer.tsx
|
|
5534
4327
|
import { Nudge } from "@transferwise/components";
|
|
5535
4328
|
import { useState as useState15 } from "react";
|
|
5536
|
-
import { jsx as
|
|
4329
|
+
import { jsx as jsx89 } from "react/jsx-runtime";
|
|
5537
4330
|
var UpsellRenderer = {
|
|
5538
4331
|
canRenderType: "upsell",
|
|
5539
4332
|
render: UpsellRendererComponent
|
|
@@ -5541,7 +4334,7 @@ var UpsellRenderer = {
|
|
|
5541
4334
|
function UpsellRendererComponent(props) {
|
|
5542
4335
|
const { text, callToAction, media, margin, onDismiss } = props;
|
|
5543
4336
|
const [isVisible, setIsVisible] = useState15(true);
|
|
5544
|
-
return isVisible ? /* @__PURE__ */
|
|
4337
|
+
return isVisible ? /* @__PURE__ */ jsx89(
|
|
5545
4338
|
Nudge,
|
|
5546
4339
|
{
|
|
5547
4340
|
className: getMargin(margin),
|
|
@@ -5590,7 +4383,7 @@ var supportedMediaNames = [
|
|
|
5590
4383
|
// ../renderers/src/ButtonRenderer/CircularButtonRenderer.tsx
|
|
5591
4384
|
import { CircularButton } from "@transferwise/components";
|
|
5592
4385
|
var import_classnames8 = __toESM(require_classnames());
|
|
5593
|
-
import { jsx as
|
|
4386
|
+
import { jsx as jsx90 } from "react/jsx-runtime";
|
|
5594
4387
|
var CircularButtonRenderer = {
|
|
5595
4388
|
canRenderType: "button",
|
|
5596
4389
|
canRender: ({ control }) => control === "circular",
|
|
@@ -5600,7 +4393,7 @@ function CircularButtonComponent(props) {
|
|
|
5600
4393
|
var _a;
|
|
5601
4394
|
const { context, disabled, margin, media, tags, title, onClick } = props;
|
|
5602
4395
|
const priority = tags == null ? void 0 : tags.find((tag) => tag === "primary" || tag === "secondary");
|
|
5603
|
-
return /* @__PURE__ */
|
|
4396
|
+
return /* @__PURE__ */ jsx90("div", { className: (0, import_classnames8.default)(getMargin(margin), "df-button", "circular"), children: /* @__PURE__ */ jsx90(
|
|
5604
4397
|
CircularButton,
|
|
5605
4398
|
{
|
|
5606
4399
|
disabled,
|
|
@@ -5620,7 +4413,6 @@ var getWiseRenderers = () => [
|
|
|
5620
4413
|
CheckboxInputRenderer_default,
|
|
5621
4414
|
CircularButtonRenderer,
|
|
5622
4415
|
BoxRenderer_default,
|
|
5623
|
-
CollectionRenderer_default,
|
|
5624
4416
|
ButtonRenderer,
|
|
5625
4417
|
ColumnsRenderer_default,
|
|
5626
4418
|
DateInputRenderer_default,
|
|
@@ -5665,11 +4457,11 @@ var getWiseRenderers = () => [
|
|
|
5665
4457
|
|
|
5666
4458
|
// ../renderers/src/InitialLoadingStateRenderer.tsx
|
|
5667
4459
|
import { Loader as Loader2 } from "@transferwise/components";
|
|
5668
|
-
import { jsx as
|
|
4460
|
+
import { jsx as jsx91 } from "react/jsx-runtime";
|
|
5669
4461
|
var InitialLoadingStateRenderer = {
|
|
5670
4462
|
canRenderType: "loading-state",
|
|
5671
4463
|
canRender: ({ stepLoadingState }) => stepLoadingState === "initial",
|
|
5672
|
-
render: () => /* @__PURE__ */
|
|
4464
|
+
render: () => /* @__PURE__ */ jsx91(
|
|
5673
4465
|
Loader2,
|
|
5674
4466
|
{
|
|
5675
4467
|
size: "md",
|
|
@@ -5682,24 +4474,24 @@ var InitialLoadingStateRenderer = {
|
|
|
5682
4474
|
// src/dynamicFlow/DynamicFlowModal.tsx
|
|
5683
4475
|
import { useDynamicFlowModal } from "@wise/dynamic-flow-client";
|
|
5684
4476
|
import { Modal as Modal5 } from "@transferwise/components";
|
|
5685
|
-
import { jsx as
|
|
4477
|
+
import { jsx as jsx92 } from "react/jsx-runtime";
|
|
5686
4478
|
function DynamicFlowModal(props) {
|
|
5687
4479
|
const _a = props, { className = "" } = _a, rest = __objRest(_a, ["className"]);
|
|
5688
4480
|
const dfProps = useWiseToCoreProps(rest);
|
|
5689
4481
|
const df = useDynamicFlowModal(dfProps);
|
|
5690
|
-
return /* @__PURE__ */
|
|
4482
|
+
return /* @__PURE__ */ jsx92(
|
|
5691
4483
|
Modal5,
|
|
5692
4484
|
__spreadProps(__spreadValues({
|
|
5693
4485
|
className: `dynamic-flow-modal ${className}`,
|
|
5694
4486
|
disableDimmerClickToClose: true
|
|
5695
4487
|
}, df.modal), {
|
|
5696
|
-
body: /* @__PURE__ */
|
|
4488
|
+
body: /* @__PURE__ */ jsx92("div", { className: "dynamic-flow-modal", children: df.modal.body })
|
|
5697
4489
|
})
|
|
5698
4490
|
);
|
|
5699
4491
|
}
|
|
5700
4492
|
|
|
5701
4493
|
// src/dynamicFlow/getMergedRenderers.tsx
|
|
5702
|
-
import { jsx as
|
|
4494
|
+
import { jsx as jsx93 } from "react/jsx-runtime";
|
|
5703
4495
|
var wiseRenderers = getWiseRenderers();
|
|
5704
4496
|
var getMergedRenderers = (props) => {
|
|
5705
4497
|
var _d, _e;
|
|
@@ -5713,7 +4505,7 @@ var getMergedRenderers = (props) => {
|
|
|
5713
4505
|
method: initialRequest.method,
|
|
5714
4506
|
data: initialRequest.body
|
|
5715
4507
|
};
|
|
5716
|
-
return presentation.type === "push" ? /* @__PURE__ */
|
|
4508
|
+
return presentation.type === "push" ? /* @__PURE__ */ jsx93(DynamicFlow, __spreadProps(__spreadValues(__spreadValues({}, restProps), rest), { features: subflowFeatures, initialAction: action })) : /* @__PURE__ */ jsx93(
|
|
5717
4509
|
DynamicFlowModal,
|
|
5718
4510
|
__spreadProps(__spreadValues(__spreadValues({}, restProps), rest), {
|
|
5719
4511
|
features: subflowFeatures,
|
|
@@ -5872,10 +4664,10 @@ var useWiseToCoreProps = (props) => {
|
|
|
5872
4664
|
onLog
|
|
5873
4665
|
} = props;
|
|
5874
4666
|
const httpClient = useWiseHttpClient(customFetch);
|
|
5875
|
-
const mergedRenderers =
|
|
4667
|
+
const mergedRenderers = useMemo2(() => getMergedRenderers(props), [renderers]);
|
|
5876
4668
|
const createSnackBar = useCreateSnackBar();
|
|
5877
|
-
const logEvent =
|
|
5878
|
-
const trackEvent =
|
|
4669
|
+
const logEvent = useMemo2(() => getLogEvent(onLog), [onLog]);
|
|
4670
|
+
const trackEvent = useMemo2(() => getTrackEvent(onEvent, onAnalytics), [onEvent, onAnalytics]);
|
|
5879
4671
|
const onCopy = useOnCopy();
|
|
5880
4672
|
return __spreadProps(__spreadValues({}, props), {
|
|
5881
4673
|
httpClient,
|
|
@@ -5907,13 +4699,13 @@ var openLinkInNewTab = (url) => {
|
|
|
5907
4699
|
};
|
|
5908
4700
|
|
|
5909
4701
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
5910
|
-
import { jsxs as
|
|
4702
|
+
import { jsxs as jsxs35 } from "react/jsx-runtime";
|
|
5911
4703
|
function DynamicFlow(props) {
|
|
5912
4704
|
const { className = "" } = props;
|
|
5913
4705
|
const dfProps = useWiseToCoreProps(props);
|
|
5914
4706
|
const df = useDynamicFlow(dfProps);
|
|
5915
4707
|
const { onContextMenu, contextMenu } = useDFContextMenu(df.controller);
|
|
5916
|
-
return /* @__PURE__ */
|
|
4708
|
+
return /* @__PURE__ */ jsxs35("div", { className, onContextMenu, children: [
|
|
5917
4709
|
df.view,
|
|
5918
4710
|
contextMenu
|
|
5919
4711
|
] });
|
|
@@ -5925,7 +4717,7 @@ import {
|
|
|
5925
4717
|
useImperativeHandle
|
|
5926
4718
|
} from "react";
|
|
5927
4719
|
import { useDynamicFlow as useDynamicFlow2 } from "@wise/dynamic-flow-client";
|
|
5928
|
-
import { jsx as
|
|
4720
|
+
import { jsx as jsx94 } from "react/jsx-runtime";
|
|
5929
4721
|
var DynamicFlowWithRef = forwardRef(function DynamicFlowWithRef2(props, ref) {
|
|
5930
4722
|
const { className = "" } = props;
|
|
5931
4723
|
const dfProps = useWiseToCoreProps(props);
|
|
@@ -5941,14 +4733,14 @@ var DynamicFlowWithRef = forwardRef(function DynamicFlowWithRef2(props, ref) {
|
|
|
5941
4733
|
}),
|
|
5942
4734
|
[df]
|
|
5943
4735
|
);
|
|
5944
|
-
return /* @__PURE__ */
|
|
4736
|
+
return /* @__PURE__ */ jsx94("div", { className, children: df.view });
|
|
5945
4737
|
});
|
|
5946
4738
|
|
|
5947
4739
|
// src/index.ts
|
|
5948
4740
|
import { findRendererPropsByType } from "@wise/dynamic-flow-client";
|
|
5949
4741
|
|
|
5950
4742
|
// src/dynamicFlow/renderers.tsx
|
|
5951
|
-
var Header10 =
|
|
4743
|
+
var Header10 = Header5;
|
|
5952
4744
|
var Media2 = Media;
|
|
5953
4745
|
var getMargin2 = getMargin;
|
|
5954
4746
|
|