@seatlayer/core 0.46.0 → 0.47.1
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-AZODENEL.js +97 -0
- package/dist/chunk-AZODENEL.js.map +1 -0
- package/dist/chunk-FVCOOLJO.js +335 -0
- package/dist/chunk-FVCOOLJO.js.map +1 -0
- package/dist/{chunk-5MRJCIZP.js → chunk-TCTAS4Z2.js} +88 -14
- package/dist/chunk-TCTAS4Z2.js.map +1 -0
- package/dist/{de-UHAOVDS3.js → de-ST4H423D.js} +6 -3
- package/dist/{de-UHAOVDS3.js.map → de-ST4H423D.js.map} +1 -1
- package/dist/{es-6TJS2L7S.js → es-WEC5NHRT.js} +6 -3
- package/dist/{es-6TJS2L7S.js.map → es-WEC5NHRT.js.map} +1 -1
- package/dist/{fr-MMSY7FPE.js → fr-SGBFNAQV.js} +6 -3
- package/dist/{fr-MMSY7FPE.js.map → fr-SGBFNAQV.js.map} +1 -1
- package/dist/index.cjs +251 -39
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +119 -4
- package/dist/index.d.ts +119 -4
- package/dist/index.js +152 -24
- package/dist/index.js.map +1 -1
- package/dist/{types-DBnRO2hX.d.cts → types-CE63BK0j.d.cts} +88 -10
- package/dist/{types-DBnRO2hX.d.ts → types-CE63BK0j.d.ts} +88 -10
- package/dist/view/panoramaDelivery.cjs +126 -0
- package/dist/view/panoramaDelivery.cjs.map +1 -0
- package/dist/view/panoramaDelivery.d.cts +34 -0
- package/dist/view/panoramaDelivery.d.ts +34 -0
- package/dist/view/panoramaDelivery.js +17 -0
- package/dist/view/panoramaDelivery.js.map +1 -0
- package/dist/view3d/crossfade/panorama.cjs +453 -0
- package/dist/view3d/crossfade/panorama.cjs.map +1 -0
- package/dist/view3d/crossfade/panorama.d.cts +110 -0
- package/dist/view3d/crossfade/panorama.d.ts +110 -0
- package/dist/view3d/crossfade/panorama.js +30 -0
- package/dist/view3d/crossfade/panorama.js.map +1 -0
- package/dist/view3d/index.cjs +1176 -128
- package/dist/view3d/index.cjs.map +1 -1
- package/dist/view3d/index.d.cts +73 -35
- package/dist/view3d/index.d.ts +73 -35
- package/dist/view3d/index.js +960 -300
- package/dist/view3d/index.js.map +1 -1
- package/package.json +28 -1
- package/dist/chunk-5MRJCIZP.js.map +0 -1
|
@@ -48,7 +48,10 @@ var SURROUNDINGS_SHAPE_ROLES = [
|
|
|
48
48
|
"sound",
|
|
49
49
|
"concession",
|
|
50
50
|
"coat",
|
|
51
|
-
"wall"
|
|
51
|
+
"wall",
|
|
52
|
+
"rail",
|
|
53
|
+
"suite",
|
|
54
|
+
"obstruction"
|
|
52
55
|
];
|
|
53
56
|
var SURROUNDINGS_SHAPE_ROLE_SET = new Set(SURROUNDINGS_SHAPE_ROLES);
|
|
54
57
|
function layerOf(obj) {
|
|
@@ -121,6 +124,48 @@ function sectionGeometry(section, context = {}) {
|
|
|
121
124
|
return { height, rake };
|
|
122
125
|
}
|
|
123
126
|
|
|
127
|
+
// src/core/textLayout.ts
|
|
128
|
+
var glyphAdvance = (text) => Math.max(1, text.fontSize * 0.6 + (text.letterSpacing ?? 0));
|
|
129
|
+
function wrappedLineCount(text, usableWidth) {
|
|
130
|
+
const explicit = text.text.split(/\r?\n/);
|
|
131
|
+
if (!text.width) return Math.max(1, explicit.length);
|
|
132
|
+
const perLine = Math.max(1, Math.floor(usableWidth / glyphAdvance(text)));
|
|
133
|
+
let lines = 0;
|
|
134
|
+
for (const source of explicit) {
|
|
135
|
+
if (!source.length) {
|
|
136
|
+
lines += 1;
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
let used = 0;
|
|
140
|
+
for (const word of source.split(/\s+/)) {
|
|
141
|
+
const length = word.length;
|
|
142
|
+
if (!used) {
|
|
143
|
+
lines += Math.max(1, Math.ceil(length / perLine));
|
|
144
|
+
used = length % perLine;
|
|
145
|
+
} else if (used + 1 + length <= perLine) used += 1 + length;
|
|
146
|
+
else {
|
|
147
|
+
lines += Math.max(1, Math.ceil(length / perLine));
|
|
148
|
+
used = length % perLine;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return Math.max(1, lines);
|
|
153
|
+
}
|
|
154
|
+
function textLayoutMetrics(text) {
|
|
155
|
+
const padding = text.background?.padding ?? 0;
|
|
156
|
+
const explicitLines = text.text.split(/\r?\n/);
|
|
157
|
+
const naturalWidth = Math.max(1, ...explicitLines.map((line) => line.length)) * glyphAdvance(text);
|
|
158
|
+
const width = text.width ?? naturalWidth + padding * 2;
|
|
159
|
+
const usableWidth = Math.max(1, width - padding * 2);
|
|
160
|
+
const lineCount = wrappedLineCount(text, usableWidth);
|
|
161
|
+
return {
|
|
162
|
+
width,
|
|
163
|
+
height: lineCount * text.fontSize * (text.lineHeight ?? 1.2) + padding * 2,
|
|
164
|
+
lineCount,
|
|
165
|
+
padding
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
|
|
124
169
|
// src/core/complexGeometry.ts
|
|
125
170
|
function cubicPoint(path, t) {
|
|
126
171
|
const u = 1 - t;
|
|
@@ -357,7 +402,8 @@ function resolveSegmentedRowGroups(objects) {
|
|
|
357
402
|
displayLabel: first.displayLabel,
|
|
358
403
|
totalSeats,
|
|
359
404
|
canonical: ordered[0],
|
|
360
|
-
viewFromSeatUrl: first.viewFromSeatUrl
|
|
405
|
+
viewFromSeatUrl: first.viewFromSeatUrl,
|
|
406
|
+
viewFromSeatMeta: first.viewFromSeatMeta
|
|
361
407
|
});
|
|
362
408
|
adjacencyOffset += row.seatCount;
|
|
363
409
|
displayOffset += row.seatCount;
|
|
@@ -896,6 +942,7 @@ function expandRowSlots(row, placement) {
|
|
|
896
942
|
wheelchairSpaceType: o?.wheelchairSpaceType,
|
|
897
943
|
commercial: Object.values(commercial).some((value) => value !== void 0 && value !== false && value !== "") ? commercial : void 0,
|
|
898
944
|
viewUrl: o?.viewFromSeatUrl ?? row.viewFromSeatUrl,
|
|
945
|
+
viewMeta: o?.viewFromSeatUrl ? o.viewFromSeatMeta : row.viewFromSeatMeta,
|
|
899
946
|
labelStyle: o?.labelStyle
|
|
900
947
|
};
|
|
901
948
|
});
|
|
@@ -917,6 +964,7 @@ function expandRow(row) {
|
|
|
917
964
|
wheelchairSpaceType: slot.wheelchairSpaceType,
|
|
918
965
|
commercial: slot.commercial,
|
|
919
966
|
viewUrl: slot.viewUrl,
|
|
967
|
+
viewMeta: slot.viewMeta,
|
|
920
968
|
labelStyle: slot.labelStyle
|
|
921
969
|
});
|
|
922
970
|
}
|
|
@@ -955,6 +1003,7 @@ function expandTableSlots(t) {
|
|
|
955
1003
|
wheelchairSpaceType: override?.wheelchairSpaceType,
|
|
956
1004
|
commercial: override?.commercial,
|
|
957
1005
|
viewUrl: override?.viewFromSeatUrl,
|
|
1006
|
+
viewMeta: override?.viewFromSeatUrl ? override.viewFromSeatMeta : void 0,
|
|
958
1007
|
labelStyle: override?.labelStyle,
|
|
959
1008
|
...side ? { side } : {}
|
|
960
1009
|
};
|
|
@@ -1026,6 +1075,7 @@ function expandTable(t) {
|
|
|
1026
1075
|
...slot.wheelchairSpaceType ? { wheelchairSpaceType: slot.wheelchairSpaceType } : {},
|
|
1027
1076
|
...slot.commercial ? { commercial: slot.commercial } : {},
|
|
1028
1077
|
...slot.viewUrl ? { viewUrl: slot.viewUrl } : {},
|
|
1078
|
+
...slot.viewUrl && slot.viewMeta ? { viewMeta: slot.viewMeta } : {},
|
|
1029
1079
|
...slot.labelStyle ? { labelStyle: slot.labelStyle } : {}
|
|
1030
1080
|
}));
|
|
1031
1081
|
}
|
|
@@ -1208,7 +1258,10 @@ function expandFloorObjects(objects, zones, fallbackFocal, viewFallback) {
|
|
|
1208
1258
|
if (!overrides.get(physicalIndex)?.displayLabel) {
|
|
1209
1259
|
seat.displayLabel = seatDisplayLabel(obj, physicalIndex, logical);
|
|
1210
1260
|
}
|
|
1211
|
-
seat.viewUrl
|
|
1261
|
+
if (!seat.viewUrl && logical.viewFromSeatUrl) {
|
|
1262
|
+
seat.viewUrl = logical.viewFromSeatUrl;
|
|
1263
|
+
seat.viewMeta = logical.viewFromSeatMeta;
|
|
1264
|
+
}
|
|
1212
1265
|
}
|
|
1213
1266
|
}
|
|
1214
1267
|
}
|
|
@@ -1217,8 +1270,14 @@ function expandFloorObjects(objects, zones, fallbackFocal, viewFallback) {
|
|
|
1217
1270
|
const zone = owner?.zone ? zones?.find((candidate) => candidate.id === owner.zone) : void 0;
|
|
1218
1271
|
const resolvedFocal = zone?.focalPoint ?? fallbackFocal;
|
|
1219
1272
|
for (const seat of seats) {
|
|
1220
|
-
if (
|
|
1221
|
-
|
|
1273
|
+
if (!seat.viewUrl && inheritedView) {
|
|
1274
|
+
seat.viewUrl = inheritedView;
|
|
1275
|
+
seat.viewMeta = owner?.viewFromSeatMeta;
|
|
1276
|
+
}
|
|
1277
|
+
if (!seat.viewUrl && viewFallback) {
|
|
1278
|
+
seat.viewUrl = viewFallback.url;
|
|
1279
|
+
seat.viewMeta = viewFallback.meta;
|
|
1280
|
+
}
|
|
1222
1281
|
if (owner) seat.sectionId = owner.logicalSectionId ?? owner.id;
|
|
1223
1282
|
if (owner?.zone) seat.zoneId = owner.zone;
|
|
1224
1283
|
if (resolvedFocal) seat.focalPoint = { ...resolvedFocal };
|
|
@@ -1232,15 +1291,24 @@ function expandChart(doc, options = {}) {
|
|
|
1232
1291
|
const out2 = [];
|
|
1233
1292
|
for (const floor of doc.floors) {
|
|
1234
1293
|
const floorFocal = floor.focalPoint ?? doc.focalPoint;
|
|
1235
|
-
const floorView = floor.viewFromSeatUrl
|
|
1294
|
+
const floorView = floor.viewFromSeatUrl ? { url: floor.viewFromSeatUrl, meta: floor.viewFromSeatMeta } : doc.viewFromSeatUrl ? { url: doc.viewFromSeatUrl, meta: doc.viewFromSeatMeta } : void 0;
|
|
1236
1295
|
const seats = expandFloorObjects(floor.objects, doc.zones, floorFocal, floorView);
|
|
1237
|
-
|
|
1296
|
+
if (options.resolveEyeHeights !== false) {
|
|
1297
|
+
assignEyeHeights(floor.objects, floor.focalPoint ?? doc.focalPoint, floor.baseHeightM ?? 0, seats);
|
|
1298
|
+
}
|
|
1238
1299
|
out2.push(...seats);
|
|
1239
1300
|
}
|
|
1240
1301
|
return out2;
|
|
1241
1302
|
}
|
|
1242
|
-
const out = expandFloorObjects(
|
|
1243
|
-
|
|
1303
|
+
const out = expandFloorObjects(
|
|
1304
|
+
doc.objects,
|
|
1305
|
+
doc.zones,
|
|
1306
|
+
doc.focalPoint,
|
|
1307
|
+
doc.viewFromSeatUrl ? { url: doc.viewFromSeatUrl, meta: doc.viewFromSeatMeta } : void 0
|
|
1308
|
+
);
|
|
1309
|
+
if (options.resolveEyeHeights !== false) {
|
|
1310
|
+
assignEyeHeights(doc.objects, doc.focalPoint, options.floorBaseHeightM ?? 0, out);
|
|
1311
|
+
}
|
|
1244
1312
|
return out;
|
|
1245
1313
|
}
|
|
1246
1314
|
function assignEyeHeights(objects, focal, floorBaseHeightM, seats) {
|
|
@@ -1298,9 +1366,15 @@ function chartBounds(doc) {
|
|
|
1298
1366
|
if (x > maxX) maxX = x;
|
|
1299
1367
|
if (y > maxY) maxY = y;
|
|
1300
1368
|
};
|
|
1301
|
-
for (const s of expandChart(doc)) acc(s.x, s.y);
|
|
1302
1369
|
for (const obj of allObjects(doc)) {
|
|
1303
|
-
if (obj.type === "
|
|
1370
|
+
if (obj.type === "row") {
|
|
1371
|
+
const overrides = new Map((obj.overrides ?? []).map((override) => [override.index, override]));
|
|
1372
|
+
rowSeatPositions(obj).forEach((point, index) => {
|
|
1373
|
+
const override = overrides.get(index);
|
|
1374
|
+
if (override?.skip) return;
|
|
1375
|
+
acc(point.x + (override?.dx ?? 0), point.y + (override?.dy ?? 0));
|
|
1376
|
+
});
|
|
1377
|
+
} else if (obj.type === "gaArea") {
|
|
1304
1378
|
for (const p of obj.points) acc(p.x, p.y);
|
|
1305
1379
|
} else if (obj.type === "section") {
|
|
1306
1380
|
for (const p of obj.outline) acc(p.x, p.y);
|
|
@@ -1324,9 +1398,9 @@ function chartBounds(doc) {
|
|
|
1324
1398
|
acc(obj.center.x - ext, obj.center.y - ext);
|
|
1325
1399
|
acc(obj.center.x + ext, obj.center.y + ext);
|
|
1326
1400
|
} else if (obj.type === "text") {
|
|
1327
|
-
const
|
|
1401
|
+
const box = textLayoutMetrics(obj);
|
|
1328
1402
|
acc(obj.position.x, obj.position.y);
|
|
1329
|
-
acc(obj.position.x +
|
|
1403
|
+
acc(obj.position.x + box.width, obj.position.y + box.height);
|
|
1330
1404
|
}
|
|
1331
1405
|
}
|
|
1332
1406
|
for (const image of [doc.referenceImage, doc.backgroundImage]) {
|
|
@@ -1391,4 +1465,4 @@ export {
|
|
|
1391
1465
|
expandChart,
|
|
1392
1466
|
chartBounds
|
|
1393
1467
|
};
|
|
1394
|
-
//# sourceMappingURL=chunk-
|
|
1468
|
+
//# sourceMappingURL=chunk-TCTAS4Z2.js.map
|