@seatlayer/js 0.12.0 → 0.12.2
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/README.md +1 -1
- package/dist/index.cjs +33 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.js +33 -6
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -656,6 +656,14 @@ interface ControlRoomSectionMetric {
|
|
|
656
656
|
not_for_sale: number;
|
|
657
657
|
bookedRevenue: number;
|
|
658
658
|
}
|
|
659
|
+
/** Recent seat-state change safe for an event:view control-room grant. Full
|
|
660
|
+
* audit references remain available only through the event:reports log API. */
|
|
661
|
+
interface ControlRoomActivityEntry {
|
|
662
|
+
id: number;
|
|
663
|
+
at: number;
|
|
664
|
+
action: string;
|
|
665
|
+
labels: string[];
|
|
666
|
+
}
|
|
659
667
|
interface ControlRoomSnapshot {
|
|
660
668
|
version: number;
|
|
661
669
|
currency: string;
|
|
@@ -683,6 +691,8 @@ interface ControlRoomSnapshot {
|
|
|
683
691
|
shoppingSessions: number;
|
|
684
692
|
activeHolds: number;
|
|
685
693
|
};
|
|
694
|
+
/** Present on workers that support reload-safe activity hydration. */
|
|
695
|
+
activity?: ControlRoomActivityEntry[];
|
|
686
696
|
event: {
|
|
687
697
|
key: string;
|
|
688
698
|
name: string;
|
|
@@ -999,6 +1009,7 @@ declare class SeatManager {
|
|
|
999
1009
|
private buildSectionOptions;
|
|
1000
1010
|
private paintModeTabs;
|
|
1001
1011
|
private paintHeatButton;
|
|
1012
|
+
private paintMomentumHelp;
|
|
1002
1013
|
private paintFullscreenButton;
|
|
1003
1014
|
private paintTrendWindow;
|
|
1004
1015
|
private setLive;
|
|
@@ -1021,4 +1032,4 @@ declare class SeatManager {
|
|
|
1021
1032
|
private fail;
|
|
1022
1033
|
}
|
|
1023
1034
|
|
|
1024
|
-
export { ApiError, type BestAvailableResult, type CheckoutHandoff, type CheckoutLineItem, type ControlRoomSectionMetric, type ControlRoomSnapshot, EmbeddedDesigner, type EmbeddedDesignerEventType, type EmbeddedDesignerMessage, type EmbeddedDesignerOptions, type GAAreaAvailability, type HoldConflict, type HoldLineItem, type HoldResult, type LogEntry, type LogPage, ManageApi, ManageApiError, type ReportByStatus, type ReportCategoryMeta, type ReportCategoryRow, type ReportResult, SeatManager, type SeatManagerActionResult, type SeatManagerActivity, type SeatManagerMode, type SeatManagerOptions, type SeatManagerTallies, SeatPicker, type SeatPickerOptions, type SeatPickerTheme, SeatingChart, type SeatingChartOptions, type SelectedSeat };
|
|
1035
|
+
export { ApiError, type BestAvailableResult, type CheckoutHandoff, type CheckoutLineItem, type ControlRoomActivityEntry, type ControlRoomSectionMetric, type ControlRoomSnapshot, EmbeddedDesigner, type EmbeddedDesignerEventType, type EmbeddedDesignerMessage, type EmbeddedDesignerOptions, type GAAreaAvailability, type HoldConflict, type HoldLineItem, type HoldResult, type LogEntry, type LogPage, ManageApi, ManageApiError, type ReportByStatus, type ReportCategoryMeta, type ReportCategoryRow, type ReportResult, SeatManager, type SeatManagerActionResult, type SeatManagerActivity, type SeatManagerMode, type SeatManagerOptions, type SeatManagerTallies, SeatPicker, type SeatPickerOptions, type SeatPickerTheme, SeatingChart, type SeatingChartOptions, type SelectedSeat };
|
package/dist/index.d.ts
CHANGED
|
@@ -656,6 +656,14 @@ interface ControlRoomSectionMetric {
|
|
|
656
656
|
not_for_sale: number;
|
|
657
657
|
bookedRevenue: number;
|
|
658
658
|
}
|
|
659
|
+
/** Recent seat-state change safe for an event:view control-room grant. Full
|
|
660
|
+
* audit references remain available only through the event:reports log API. */
|
|
661
|
+
interface ControlRoomActivityEntry {
|
|
662
|
+
id: number;
|
|
663
|
+
at: number;
|
|
664
|
+
action: string;
|
|
665
|
+
labels: string[];
|
|
666
|
+
}
|
|
659
667
|
interface ControlRoomSnapshot {
|
|
660
668
|
version: number;
|
|
661
669
|
currency: string;
|
|
@@ -683,6 +691,8 @@ interface ControlRoomSnapshot {
|
|
|
683
691
|
shoppingSessions: number;
|
|
684
692
|
activeHolds: number;
|
|
685
693
|
};
|
|
694
|
+
/** Present on workers that support reload-safe activity hydration. */
|
|
695
|
+
activity?: ControlRoomActivityEntry[];
|
|
686
696
|
event: {
|
|
687
697
|
key: string;
|
|
688
698
|
name: string;
|
|
@@ -999,6 +1009,7 @@ declare class SeatManager {
|
|
|
999
1009
|
private buildSectionOptions;
|
|
1000
1010
|
private paintModeTabs;
|
|
1001
1011
|
private paintHeatButton;
|
|
1012
|
+
private paintMomentumHelp;
|
|
1002
1013
|
private paintFullscreenButton;
|
|
1003
1014
|
private paintTrendWindow;
|
|
1004
1015
|
private setLive;
|
|
@@ -1021,4 +1032,4 @@ declare class SeatManager {
|
|
|
1021
1032
|
private fail;
|
|
1022
1033
|
}
|
|
1023
1034
|
|
|
1024
|
-
export { ApiError, type BestAvailableResult, type CheckoutHandoff, type CheckoutLineItem, type ControlRoomSectionMetric, type ControlRoomSnapshot, EmbeddedDesigner, type EmbeddedDesignerEventType, type EmbeddedDesignerMessage, type EmbeddedDesignerOptions, type GAAreaAvailability, type HoldConflict, type HoldLineItem, type HoldResult, type LogEntry, type LogPage, ManageApi, ManageApiError, type ReportByStatus, type ReportCategoryMeta, type ReportCategoryRow, type ReportResult, SeatManager, type SeatManagerActionResult, type SeatManagerActivity, type SeatManagerMode, type SeatManagerOptions, type SeatManagerTallies, SeatPicker, type SeatPickerOptions, type SeatPickerTheme, SeatingChart, type SeatingChartOptions, type SelectedSeat };
|
|
1035
|
+
export { ApiError, type BestAvailableResult, type CheckoutHandoff, type CheckoutLineItem, type ControlRoomActivityEntry, type ControlRoomSectionMetric, type ControlRoomSnapshot, EmbeddedDesigner, type EmbeddedDesignerEventType, type EmbeddedDesignerMessage, type EmbeddedDesignerOptions, type GAAreaAvailability, type HoldConflict, type HoldLineItem, type HoldResult, type LogEntry, type LogPage, ManageApi, ManageApiError, type ReportByStatus, type ReportCategoryMeta, type ReportCategoryRow, type ReportResult, SeatManager, type SeatManagerActionResult, type SeatManagerActivity, type SeatManagerMode, type SeatManagerOptions, type SeatManagerTallies, SeatPicker, type SeatPickerOptions, type SeatPickerTheme, SeatingChart, type SeatingChartOptions, type SelectedSeat };
|
package/dist/index.js
CHANGED
|
@@ -2368,6 +2368,10 @@ var CSS2 = `
|
|
|
2368
2368
|
.slm-sectionhead{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-top:18px}
|
|
2369
2369
|
.slm-windows{display:flex;gap:3px;padding:2px;border:1px solid var(--slm-line);border-radius:8px;background:var(--slm-surface)}
|
|
2370
2370
|
.slm-window{padding:4px 6px;border-radius:6px;font-size:10px;font-weight:800;color:var(--slm-muted)}.slm-window.on{background:var(--slm-accent);color:var(--slm-accent-ink)}
|
|
2371
|
+
.slm-momentumhelp{margin:10px 0 14px;padding:10px;border:1px solid rgba(244,183,64,.28);border-radius:10px;background:rgba(244,183,64,.07)}
|
|
2372
|
+
.slm-momentumhelp[hidden]{display:none}.slm-momentumscale{display:flex;align-items:center;gap:7px;color:var(--slm-muted);font-size:10px;font-weight:750;text-transform:uppercase;letter-spacing:.07em}
|
|
2373
|
+
.slm-momentumgradient{height:6px;min-width:64px;flex:1;border-radius:999px;background:linear-gradient(90deg,#f4b740,#ef4444)}
|
|
2374
|
+
.slm-momentumcopy{margin-top:7px;color:var(--slm-muted);font-size:11px;line-height:1.45}
|
|
2371
2375
|
.slm-inspect-card{padding:12px;border:1px solid var(--slm-line);border-radius:12px;background:var(--slm-surface)}
|
|
2372
2376
|
.slm-inspect-label{font-size:24px;font-weight:850;letter-spacing:-.02em}.slm-inspect-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:14px}
|
|
2373
2377
|
.slm-inspect-grid span{display:block;color:var(--slm-muted);font-size:10px;text-transform:uppercase;letter-spacing:.08em}.slm-inspect-grid b{display:block;margin-top:3px;font-size:12.5px}
|
|
@@ -2496,11 +2500,12 @@ var SeatManager = class {
|
|
|
2496
2500
|
}
|
|
2497
2501
|
this.buildRenderer();
|
|
2498
2502
|
this.buildSectionOptions();
|
|
2499
|
-
await Promise.all([
|
|
2503
|
+
const [, controlRoom] = await Promise.all([
|
|
2500
2504
|
this.resnapshot(),
|
|
2501
2505
|
this.refreshControlRoom().catch((err) => this.opts.onError?.(err))
|
|
2502
2506
|
]);
|
|
2503
|
-
|
|
2507
|
+
if (controlRoom?.activity) this.seedFeed(controlRoom.activity);
|
|
2508
|
+
else this.api.log(this.key, { limit: 24 }).then((page) => this.seedFeed(page.entries)).catch(() => {
|
|
2504
2509
|
});
|
|
2505
2510
|
this.connect();
|
|
2506
2511
|
this.startFeedClock();
|
|
@@ -3006,7 +3011,8 @@ var SeatManager = class {
|
|
|
3006
3011
|
release: "released",
|
|
3007
3012
|
expire: "expired",
|
|
3008
3013
|
block: "blocked",
|
|
3009
|
-
unblock: "unblocked"
|
|
3014
|
+
unblock: "unblocked",
|
|
3015
|
+
unbook: "cancelled"
|
|
3010
3016
|
};
|
|
3011
3017
|
const stByAction = {
|
|
3012
3018
|
hold: "held",
|
|
@@ -3014,7 +3020,8 @@ var SeatManager = class {
|
|
|
3014
3020
|
release: "free",
|
|
3015
3021
|
expire: "free",
|
|
3016
3022
|
block: "blocked",
|
|
3017
|
-
unblock: "free"
|
|
3023
|
+
unblock: "free",
|
|
3024
|
+
unbook: "free"
|
|
3018
3025
|
};
|
|
3019
3026
|
for (const e of entries) {
|
|
3020
3027
|
const label = e.labels[0];
|
|
@@ -3071,7 +3078,9 @@ var SeatManager = class {
|
|
|
3071
3078
|
</div>
|
|
3072
3079
|
<span class="slm-live"><span class="slm-live-dot"></span><span data-ref="livetext">CONNECTING</span></span>
|
|
3073
3080
|
<div class="slm-bar-actions">
|
|
3074
|
-
<button class="slm-barbtn" data-ref="heat" aria-pressed="false"
|
|
3081
|
+
<button class="slm-barbtn" data-ref="heat" aria-pressed="false"
|
|
3082
|
+
aria-label="Sales momentum overlay off"
|
|
3083
|
+
title="Highlight sections selling fastest in the selected time window">Sales momentum</button>
|
|
3075
3084
|
<button class="slm-barbtn" data-ref="fullscreen" title="Full screen (F)" aria-keyshortcuts="F">Full screen</button>
|
|
3076
3085
|
</div>
|
|
3077
3086
|
<div class="slm-kpis" data-ref="kpis"></div>
|
|
@@ -3150,7 +3159,19 @@ var SeatManager = class {
|
|
|
3150
3159
|
if (!button) return;
|
|
3151
3160
|
button.classList.toggle("on", this.heatEnabled);
|
|
3152
3161
|
button.setAttribute("aria-pressed", String(this.heatEnabled));
|
|
3153
|
-
button.
|
|
3162
|
+
button.setAttribute("aria-label", `Sales momentum overlay ${this.heatEnabled ? "on" : "off"}`);
|
|
3163
|
+
button.setAttribute("title", `${this.heatEnabled ? "Hide" : "Highlight"} sections selling fastest in the selected time window`);
|
|
3164
|
+
button.textContent = "Sales momentum";
|
|
3165
|
+
this.paintMomentumHelp();
|
|
3166
|
+
}
|
|
3167
|
+
paintMomentumHelp() {
|
|
3168
|
+
const help = this.els.rail?.querySelector('[data-ref="momentumhelp"]');
|
|
3169
|
+
if (!help) return;
|
|
3170
|
+
help.hidden = !this.heatEnabled;
|
|
3171
|
+
const copy = help.querySelector('[data-ref="momentumcopy"]');
|
|
3172
|
+
if (!copy) return;
|
|
3173
|
+
const hasRecentSales = this.controlRoomSnapshot?.velocity.bySection.some((row) => row.netBooked > 0);
|
|
3174
|
+
copy.textContent = hasRecentSales ? "Warmer sections have more completed bookings, adjusted for section size. Holds and viewers are not counted." : `No completed bookings in the last ${this.trendWindowMinutes} minutes.`;
|
|
3154
3175
|
}
|
|
3155
3176
|
paintFullscreenButton() {
|
|
3156
3177
|
if (!this.els.fullscreen) return;
|
|
@@ -3207,6 +3228,10 @@ var SeatManager = class {
|
|
|
3207
3228
|
${[5, 15, 30, 60].map((window2) => `<button class="slm-window" data-window="${window2}">${window2}m</button>`).join("")}
|
|
3208
3229
|
</div>
|
|
3209
3230
|
</div>
|
|
3231
|
+
<div class="slm-momentumhelp" data-ref="momentumhelp" ${this.heatEnabled ? "" : "hidden"}>
|
|
3232
|
+
<div class="slm-momentumscale"><span>Warm</span><span class="slm-momentumgradient"></span><span>Hot</span></div>
|
|
3233
|
+
<p class="slm-momentumcopy" data-ref="momentumcopy"></p>
|
|
3234
|
+
</div>
|
|
3210
3235
|
<div class="slm-sectionlist" data-ref="sections"></div>
|
|
3211
3236
|
<p class="slm-eyebrow">Activity</p>
|
|
3212
3237
|
<div class="slm-feed" data-ref="feed"></div>
|
|
@@ -3222,6 +3247,7 @@ var SeatManager = class {
|
|
|
3222
3247
|
this.recomputeTallies();
|
|
3223
3248
|
this.paintMonitorInsights();
|
|
3224
3249
|
this.paintTrendWindow();
|
|
3250
|
+
this.paintMomentumHelp();
|
|
3225
3251
|
this.paintFeed();
|
|
3226
3252
|
}
|
|
3227
3253
|
paintMonitorInsights() {
|
|
@@ -3258,6 +3284,7 @@ var SeatManager = class {
|
|
|
3258
3284
|
</div>`;
|
|
3259
3285
|
}).join("") : '<div class="slm-empty">No section metrics are available for this chart.</div>';
|
|
3260
3286
|
this.paintTrendWindow();
|
|
3287
|
+
this.paintMomentumHelp();
|
|
3261
3288
|
}
|
|
3262
3289
|
applyHeatOverlay() {
|
|
3263
3290
|
const snapshot = this.controlRoomSnapshot;
|