@seatlayer/core 0.50.2 → 0.52.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/dist/{chunk-GD267BFB.js → chunk-UID7KN44.js} +75 -2
- package/dist/chunk-UID7KN44.js.map +1 -0
- package/dist/core/seatConfidence.d.cts +1 -1
- package/dist/core/seatConfidence.d.ts +1 -1
- package/dist/de-YGODYJ3E.js +292 -0
- package/dist/de-YGODYJ3E.js.map +1 -0
- package/dist/es-VMBTGVFQ.js +292 -0
- package/dist/es-VMBTGVFQ.js.map +1 -0
- package/dist/fr-SLBE2ULB.js +292 -0
- package/dist/fr-SLBE2ULB.js.map +1 -0
- package/dist/index.cjs +1606 -64
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +138 -17
- package/dist/index.d.ts +138 -17
- package/dist/index.js +829 -65
- package/dist/index.js.map +1 -1
- package/dist/picker/minimapGeometry.cjs +80 -0
- package/dist/picker/minimapGeometry.cjs.map +1 -0
- package/dist/picker/minimapGeometry.d.cts +37 -0
- package/dist/picker/minimapGeometry.d.ts +37 -0
- package/dist/picker/minimapGeometry.js +52 -0
- package/dist/picker/minimapGeometry.js.map +1 -0
- package/dist/{types-DR54nqKL.d.cts → types-tLOunI-B.d.cts} +131 -1
- package/dist/{types-DR54nqKL.d.ts → types-tLOunI-B.d.ts} +131 -1
- package/dist/view3d/crossfade/panorama.d.cts +1 -1
- package/dist/view3d/crossfade/panorama.d.ts +1 -1
- package/dist/view3d/index.cjs +1158 -123
- package/dist/view3d/index.cjs.map +1 -1
- package/dist/view3d/index.d.cts +20 -12
- package/dist/view3d/index.d.ts +20 -12
- package/dist/view3d/index.js +1158 -122
- package/dist/view3d/index.js.map +1 -1
- package/package.json +14 -1
- package/dist/chunk-GD267BFB.js.map +0 -1
- package/dist/de-ST4H423D.js +0 -56
- package/dist/de-ST4H423D.js.map +0 -1
- package/dist/es-WEC5NHRT.js +0 -56
- package/dist/es-WEC5NHRT.js.map +0 -1
- package/dist/fr-SGBFNAQV.js +0 -56
- package/dist/fr-SGBFNAQV.js.map +0 -1
|
@@ -388,7 +388,7 @@ function resolveSegmentedRowGroups(objects) {
|
|
|
388
388
|
const expectedCount = ordered[0]?.segmentedRow?.componentCount ?? 0;
|
|
389
389
|
const first = ordered[0]?.segmentedRow;
|
|
390
390
|
if (!first) continue;
|
|
391
|
-
const valid = expectedCount >= 2 && ordered.length === expectedCount && first?.boundaryBefore === "start" && ordered.every((row, index) => row.segmentedRow?.kind === "segmented-row-v1" && row.segmentedRow.groupId === groupId && row.segmentedRow.componentCount === expectedCount && row.segmentedRow.componentIndex === index && (index === 0 ? row.segmentedRow.boundaryBefore === "start" : row.segmentedRow.boundaryBefore !== "start") && row.segmentedRow.displayLabel === first.displayLabel);
|
|
391
|
+
const valid = expectedCount >= 2 && ordered.length === expectedCount && first?.boundaryBefore === "start" && ordered.every((row, index) => row.segmentedRow?.kind === "segmented-row-v1" && row.segmentedRow.groupId === groupId && row.segmentedRow.componentCount === expectedCount && row.segmentedRow.componentIndex === index && row.segmentedRow.repeatLabelOnComponents === first.repeatLabelOnComponents && (index === 0 ? row.segmentedRow.boundaryBefore === "start" : row.segmentedRow.boundaryBefore !== "start") && row.segmentedRow.displayLabel === first.displayLabel);
|
|
392
392
|
if (!valid) continue;
|
|
393
393
|
const totalSeats = ordered.reduce((sum, row) => sum + row.seatCount, 0);
|
|
394
394
|
let adjacencyOffset = 0;
|
|
@@ -1238,6 +1238,75 @@ function stackFloors(doc, spread = 900) {
|
|
|
1238
1238
|
});
|
|
1239
1239
|
return { ...doc, objects, floors: void 0 };
|
|
1240
1240
|
}
|
|
1241
|
+
function layoutFloorOverview(doc) {
|
|
1242
|
+
const floors = doc.floors;
|
|
1243
|
+
if (!floors || floors.length < 2) return doc;
|
|
1244
|
+
const translations = floorOverviewTranslations(doc);
|
|
1245
|
+
const objects = [];
|
|
1246
|
+
floors.forEach((floor, index) => {
|
|
1247
|
+
const { x: dx, y: dy } = translations[index];
|
|
1248
|
+
for (const object of floor.objects) objects.push(translateObject(object, dx, dy));
|
|
1249
|
+
});
|
|
1250
|
+
return {
|
|
1251
|
+
...doc,
|
|
1252
|
+
objects,
|
|
1253
|
+
floors: void 0,
|
|
1254
|
+
referenceImage: void 0,
|
|
1255
|
+
backgroundImage: void 0
|
|
1256
|
+
};
|
|
1257
|
+
}
|
|
1258
|
+
function floorOverviewTranslations(doc) {
|
|
1259
|
+
const floors = doc.floors;
|
|
1260
|
+
if (!floors?.length) return [{ x: 0, y: 0 }];
|
|
1261
|
+
if (floors.length < 2) return floors.map(() => ({ x: 0, y: 0 }));
|
|
1262
|
+
const bounds = floors.map((floor) => chartBounds({
|
|
1263
|
+
...doc,
|
|
1264
|
+
objects: floor.objects,
|
|
1265
|
+
floors: void 0,
|
|
1266
|
+
focalPoint: floor.focalPoint,
|
|
1267
|
+
referenceImage: void 0,
|
|
1268
|
+
backgroundImage: void 0
|
|
1269
|
+
}));
|
|
1270
|
+
const characteristic = Math.max(1, ...bounds.map((bound) => Math.max(bound.width, bound.height)));
|
|
1271
|
+
const gap = Math.max(64, Math.min(240, characteristic * 0.08));
|
|
1272
|
+
const targetAspect = 16 / 10;
|
|
1273
|
+
let best = null;
|
|
1274
|
+
for (let columns2 = 1; columns2 <= floors.length; columns2 += 1) {
|
|
1275
|
+
const rows = Math.ceil(floors.length / columns2);
|
|
1276
|
+
const columnWidths2 = new Array(columns2).fill(0);
|
|
1277
|
+
const rowHeights2 = new Array(rows).fill(0);
|
|
1278
|
+
bounds.forEach((bound, index) => {
|
|
1279
|
+
const column = index % columns2;
|
|
1280
|
+
const row = Math.floor(index / columns2);
|
|
1281
|
+
columnWidths2[column] = Math.max(columnWidths2[column], bound.width);
|
|
1282
|
+
rowHeights2[row] = Math.max(rowHeights2[row], bound.height);
|
|
1283
|
+
});
|
|
1284
|
+
const width = columnWidths2.reduce((sum, value) => sum + value, 0) + gap * (columns2 - 1);
|
|
1285
|
+
const height = rowHeights2.reduce((sum, value) => sum + value, 0) + gap * (rows - 1);
|
|
1286
|
+
const unusedCells = columns2 * rows - floors.length;
|
|
1287
|
+
const score = Math.abs(Math.log(width / Math.max(1, height) / targetAspect)) + unusedCells * 0.04;
|
|
1288
|
+
if (!best || score < best.score) best = { columns: columns2, columnWidths: columnWidths2, rowHeights: rowHeights2, score };
|
|
1289
|
+
}
|
|
1290
|
+
const { columns, columnWidths, rowHeights } = best;
|
|
1291
|
+
const columnOffsets = [];
|
|
1292
|
+
const rowOffsets = [];
|
|
1293
|
+
columnWidths.reduce((offset, width, index) => {
|
|
1294
|
+
columnOffsets[index] = offset;
|
|
1295
|
+
return offset + width + gap;
|
|
1296
|
+
}, 0);
|
|
1297
|
+
rowHeights.reduce((offset, height, index) => {
|
|
1298
|
+
rowOffsets[index] = offset;
|
|
1299
|
+
return offset + height + gap;
|
|
1300
|
+
}, 0);
|
|
1301
|
+
return floors.map((_floor, index) => {
|
|
1302
|
+
const bound = bounds[index];
|
|
1303
|
+
const column = index % columns;
|
|
1304
|
+
const row = Math.floor(index / columns);
|
|
1305
|
+
const targetX = columnOffsets[column] + (columnWidths[column] - bound.width) / 2;
|
|
1306
|
+
const targetY = rowOffsets[row] + (rowHeights[row] - bound.height) / 2;
|
|
1307
|
+
return { x: targetX - bound.x, y: targetY - bound.y };
|
|
1308
|
+
});
|
|
1309
|
+
}
|
|
1241
1310
|
function expandFloorObjects(objects, zones, fallbackFocal, activeConfigurationId, viewFallback, confidenceFallback) {
|
|
1242
1311
|
const out = [];
|
|
1243
1312
|
const segmented = resolveSegmentedRowGroups(objects);
|
|
@@ -1471,6 +1540,7 @@ export {
|
|
|
1471
1540
|
sectionElevationTier,
|
|
1472
1541
|
sectionGeometry,
|
|
1473
1542
|
distanceToPolyline,
|
|
1543
|
+
fitCircle,
|
|
1474
1544
|
resolveSection,
|
|
1475
1545
|
rowSeatPositions,
|
|
1476
1546
|
rowInventoryCount,
|
|
@@ -1489,8 +1559,11 @@ export {
|
|
|
1489
1559
|
floorsOf,
|
|
1490
1560
|
floorObjects,
|
|
1491
1561
|
allObjects,
|
|
1562
|
+
translateObject,
|
|
1492
1563
|
stackFloors,
|
|
1564
|
+
layoutFloorOverview,
|
|
1565
|
+
floorOverviewTranslations,
|
|
1493
1566
|
expandChart,
|
|
1494
1567
|
chartBounds
|
|
1495
1568
|
};
|
|
1496
|
-
//# sourceMappingURL=chunk-
|
|
1569
|
+
//# sourceMappingURL=chunk-UID7KN44.js.map
|