@seatlayer/core 0.11.0 → 0.12.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/index.cjs +46 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +27 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +46 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -448,6 +448,19 @@ interface ISeatmapRenderer {
|
|
|
448
448
|
getStatus(seatId: string): SeatStatus;
|
|
449
449
|
getSelection(): ExpandedSeat[];
|
|
450
450
|
clearSelection(): void;
|
|
451
|
+
/**
|
|
452
|
+
* Dynamically update organizer-only interaction without rebuilding the
|
|
453
|
+
* renderer. No buyer surface calls this; every behavior remains gated by
|
|
454
|
+
* `manageMode` exactly as it is at construction time.
|
|
455
|
+
*/
|
|
456
|
+
setManageInteraction?(options: {
|
|
457
|
+
manageMode: boolean;
|
|
458
|
+
marqueeSelect: boolean;
|
|
459
|
+
selectableStatuses: SeatStatus[];
|
|
460
|
+
maxSelection?: number;
|
|
461
|
+
}): void;
|
|
462
|
+
/** Organizer-only section heat overlay. Values are normalized 0..1. */
|
|
463
|
+
setSectionHeat?(scores: Record<string, number> | null): void;
|
|
451
464
|
/**
|
|
452
465
|
* Manage-mode bulk selection helpers (no-op / empty unless `manageMode`).
|
|
453
466
|
* They select the matching SELECTABLE seats (respecting `selectableStatuses`
|
|
@@ -793,6 +806,8 @@ declare class SeatmapRenderer implements ISeatmapRenderer {
|
|
|
793
806
|
private currency;
|
|
794
807
|
/** Section/zone ids to render dimmed (organizer manager: held-back inventory). */
|
|
795
808
|
private dimmedSections;
|
|
809
|
+
/** Organizer control-room velocity overlay; absent on buyer surfaces. */
|
|
810
|
+
private sectionHeat;
|
|
796
811
|
/** Phase 2: section/zone ids in the event-level `closed` state — flat grey
|
|
797
812
|
* block, seats greyed + not pickable, but the section stays rendered. */
|
|
798
813
|
private closedSections;
|
|
@@ -869,6 +884,17 @@ declare class SeatmapRenderer implements ISeatmapRenderer {
|
|
|
869
884
|
getStatus(seatId: string): SeatStatus;
|
|
870
885
|
getSelection(): ExpandedSeat[];
|
|
871
886
|
clearSelection(): void;
|
|
887
|
+
/** Switch organizer interaction in place so the host preserves camera, LOD,
|
|
888
|
+
* focus and live status state while moving between Monitor and Block. */
|
|
889
|
+
setManageInteraction(options: {
|
|
890
|
+
manageMode: boolean;
|
|
891
|
+
marqueeSelect: boolean;
|
|
892
|
+
selectableStatuses: SeatStatus[];
|
|
893
|
+
maxSelection?: number;
|
|
894
|
+
}): void;
|
|
895
|
+
/** Apply a non-destructive velocity treatment to section outlines. Seat
|
|
896
|
+
* category/status fills remain untouched so heat never changes seat meaning. */
|
|
897
|
+
setSectionHeat(scores: Record<string, number> | null): void;
|
|
872
898
|
deselect(seatIds: string[]): void;
|
|
873
899
|
/** Select every selectable seat on the chart (⌘A). Returns the added seats. */
|
|
874
900
|
selectAllSelectable(): ExpandedSeat[];
|
|
@@ -1047,6 +1073,7 @@ declare class SeatmapRenderer implements ISeatmapRenderer {
|
|
|
1047
1073
|
* availability count are precomputed here (once), not per frame.
|
|
1048
1074
|
*/
|
|
1049
1075
|
private renderSection;
|
|
1076
|
+
private refreshSectionHeat;
|
|
1050
1077
|
/** Recompute a section's availability-tinted fill + "N LEFT" (cheap; on status change). */
|
|
1051
1078
|
private refreshSectionFill;
|
|
1052
1079
|
/** True when a section/zone is currently in the `closed` event-state. */
|
package/dist/index.d.ts
CHANGED
|
@@ -448,6 +448,19 @@ interface ISeatmapRenderer {
|
|
|
448
448
|
getStatus(seatId: string): SeatStatus;
|
|
449
449
|
getSelection(): ExpandedSeat[];
|
|
450
450
|
clearSelection(): void;
|
|
451
|
+
/**
|
|
452
|
+
* Dynamically update organizer-only interaction without rebuilding the
|
|
453
|
+
* renderer. No buyer surface calls this; every behavior remains gated by
|
|
454
|
+
* `manageMode` exactly as it is at construction time.
|
|
455
|
+
*/
|
|
456
|
+
setManageInteraction?(options: {
|
|
457
|
+
manageMode: boolean;
|
|
458
|
+
marqueeSelect: boolean;
|
|
459
|
+
selectableStatuses: SeatStatus[];
|
|
460
|
+
maxSelection?: number;
|
|
461
|
+
}): void;
|
|
462
|
+
/** Organizer-only section heat overlay. Values are normalized 0..1. */
|
|
463
|
+
setSectionHeat?(scores: Record<string, number> | null): void;
|
|
451
464
|
/**
|
|
452
465
|
* Manage-mode bulk selection helpers (no-op / empty unless `manageMode`).
|
|
453
466
|
* They select the matching SELECTABLE seats (respecting `selectableStatuses`
|
|
@@ -793,6 +806,8 @@ declare class SeatmapRenderer implements ISeatmapRenderer {
|
|
|
793
806
|
private currency;
|
|
794
807
|
/** Section/zone ids to render dimmed (organizer manager: held-back inventory). */
|
|
795
808
|
private dimmedSections;
|
|
809
|
+
/** Organizer control-room velocity overlay; absent on buyer surfaces. */
|
|
810
|
+
private sectionHeat;
|
|
796
811
|
/** Phase 2: section/zone ids in the event-level `closed` state — flat grey
|
|
797
812
|
* block, seats greyed + not pickable, but the section stays rendered. */
|
|
798
813
|
private closedSections;
|
|
@@ -869,6 +884,17 @@ declare class SeatmapRenderer implements ISeatmapRenderer {
|
|
|
869
884
|
getStatus(seatId: string): SeatStatus;
|
|
870
885
|
getSelection(): ExpandedSeat[];
|
|
871
886
|
clearSelection(): void;
|
|
887
|
+
/** Switch organizer interaction in place so the host preserves camera, LOD,
|
|
888
|
+
* focus and live status state while moving between Monitor and Block. */
|
|
889
|
+
setManageInteraction(options: {
|
|
890
|
+
manageMode: boolean;
|
|
891
|
+
marqueeSelect: boolean;
|
|
892
|
+
selectableStatuses: SeatStatus[];
|
|
893
|
+
maxSelection?: number;
|
|
894
|
+
}): void;
|
|
895
|
+
/** Apply a non-destructive velocity treatment to section outlines. Seat
|
|
896
|
+
* category/status fills remain untouched so heat never changes seat meaning. */
|
|
897
|
+
setSectionHeat(scores: Record<string, number> | null): void;
|
|
872
898
|
deselect(seatIds: string[]): void;
|
|
873
899
|
/** Select every selectable seat on the chart (⌘A). Returns the added seats. */
|
|
874
900
|
selectAllSelectable(): ExpandedSeat[];
|
|
@@ -1047,6 +1073,7 @@ declare class SeatmapRenderer implements ISeatmapRenderer {
|
|
|
1047
1073
|
* availability count are precomputed here (once), not per frame.
|
|
1048
1074
|
*/
|
|
1049
1075
|
private renderSection;
|
|
1076
|
+
private refreshSectionHeat;
|
|
1050
1077
|
/** Recompute a section's availability-tinted fill + "N LEFT" (cheap; on status change). */
|
|
1051
1078
|
private refreshSectionFill;
|
|
1052
1079
|
/** True when a section/zone is currently in the `closed` event-state. */
|
package/dist/index.js
CHANGED
|
@@ -814,6 +814,8 @@ var _SeatmapRenderer = class _SeatmapRenderer {
|
|
|
814
814
|
this.catPrice = /* @__PURE__ */ new Map();
|
|
815
815
|
/** Section/zone ids to render dimmed (organizer manager: held-back inventory). */
|
|
816
816
|
this.dimmedSections = /* @__PURE__ */ new Set();
|
|
817
|
+
/** Organizer control-room velocity overlay; absent on buyer surfaces. */
|
|
818
|
+
this.sectionHeat = /* @__PURE__ */ new Map();
|
|
817
819
|
/** Phase 2: section/zone ids in the event-level `closed` state — flat grey
|
|
818
820
|
* block, seats greyed + not pickable, but the section stays rendered. */
|
|
819
821
|
this.closedSections = /* @__PURE__ */ new Set();
|
|
@@ -1195,6 +1197,31 @@ var _SeatmapRenderer = class _SeatmapRenderer {
|
|
|
1195
1197
|
for (const id of ids) this.setSelected(id, false, true);
|
|
1196
1198
|
this.overlayLayer.batchDraw();
|
|
1197
1199
|
}
|
|
1200
|
+
/** Switch organizer interaction in place so the host preserves camera, LOD,
|
|
1201
|
+
* focus and live status state while moving between Monitor and Block. */
|
|
1202
|
+
setManageInteraction(options) {
|
|
1203
|
+
if (this.marquee) this.cancelMarquee();
|
|
1204
|
+
this.panLast = null;
|
|
1205
|
+
this.opts.manageMode = options.manageMode;
|
|
1206
|
+
this.opts.marqueeSelect = options.marqueeSelect;
|
|
1207
|
+
this.opts.selectableStatuses = [...options.selectableStatuses];
|
|
1208
|
+
if (options.maxSelection != null) this.opts.maxSelection = options.maxSelection;
|
|
1209
|
+
const invalid = [...this.selection].filter((id) => !this.isSelectable(id));
|
|
1210
|
+
if (invalid.length) this.deselect(invalid);
|
|
1211
|
+
if (!options.manageMode && this.selection.size) this.clearSelection();
|
|
1212
|
+
this.container.style.cursor = "default";
|
|
1213
|
+
this.overlayLayer.batchDraw();
|
|
1214
|
+
}
|
|
1215
|
+
/** Apply a non-destructive velocity treatment to section outlines. Seat
|
|
1216
|
+
* category/status fills remain untouched so heat never changes seat meaning. */
|
|
1217
|
+
setSectionHeat(scores) {
|
|
1218
|
+
this.sectionHeat.clear();
|
|
1219
|
+
for (const [sectionId, raw] of Object.entries(scores ?? {})) {
|
|
1220
|
+
if (Number.isFinite(raw)) this.sectionHeat.set(sectionId, Math.max(0, Math.min(1, raw)));
|
|
1221
|
+
}
|
|
1222
|
+
for (const section of this.sections) this.refreshSectionHeat(section);
|
|
1223
|
+
this.bgLayer.batchDraw();
|
|
1224
|
+
}
|
|
1198
1225
|
deselect(seatIds) {
|
|
1199
1226
|
let changed = false;
|
|
1200
1227
|
for (const id of seatIds) {
|
|
@@ -2391,6 +2418,7 @@ var _SeatmapRenderer = class _SeatmapRenderer {
|
|
|
2391
2418
|
total: memberIds.length,
|
|
2392
2419
|
free,
|
|
2393
2420
|
baseFill,
|
|
2421
|
+
outlineTint,
|
|
2394
2422
|
outlinePoly,
|
|
2395
2423
|
blockPoly,
|
|
2396
2424
|
rowLines,
|
|
@@ -2403,8 +2431,26 @@ var _SeatmapRenderer = class _SeatmapRenderer {
|
|
|
2403
2431
|
};
|
|
2404
2432
|
for (const id of memberIds) this.seatSection.set(id, sec);
|
|
2405
2433
|
this.refreshSectionFill(sec);
|
|
2434
|
+
this.refreshSectionHeat(sec);
|
|
2406
2435
|
this.sections.push(sec);
|
|
2407
2436
|
}
|
|
2437
|
+
refreshSectionHeat(sec) {
|
|
2438
|
+
const raw = this.sectionHeat.get(sec.id) ?? (sec.zone ? this.sectionHeat.get(sec.zone) : void 0);
|
|
2439
|
+
if (raw == null || raw <= 0) {
|
|
2440
|
+
sec.outlinePoly.stroke(rgba(sec.outlineTint, 0.5));
|
|
2441
|
+
sec.outlinePoly.fill(rgba(sec.outlineTint, 0.08));
|
|
2442
|
+
sec.outlinePoly.strokeWidth(1.75);
|
|
2443
|
+
sec.outlinePoly.shadowOpacity(0);
|
|
2444
|
+
return;
|
|
2445
|
+
}
|
|
2446
|
+
const color = lerpColor("#f4b740", "#ef4444", raw);
|
|
2447
|
+
sec.outlinePoly.stroke(rgba(color, 0.72 + raw * 0.25));
|
|
2448
|
+
sec.outlinePoly.fill(rgba(color, 0.08 + raw * 0.13));
|
|
2449
|
+
sec.outlinePoly.strokeWidth(2 + raw * 3.5);
|
|
2450
|
+
sec.outlinePoly.shadowColor(color);
|
|
2451
|
+
sec.outlinePoly.shadowBlur(4 + raw * 12);
|
|
2452
|
+
sec.outlinePoly.shadowOpacity(0.25 + raw * 0.45);
|
|
2453
|
+
}
|
|
2408
2454
|
/** Recompute a section's availability-tinted fill + "N LEFT" (cheap; on status change). */
|
|
2409
2455
|
refreshSectionFill(sec) {
|
|
2410
2456
|
sec.blockPoly.fill(this.sectionBlockFill(sec));
|