@seatlayer/js 0.12.1 → 0.12.3
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 +45 -30
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +45 -30
- 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;
|
|
@@ -1022,4 +1032,4 @@ declare class SeatManager {
|
|
|
1022
1032
|
private fail;
|
|
1023
1033
|
}
|
|
1024
1034
|
|
|
1025
|
-
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;
|
|
@@ -1022,4 +1032,4 @@ declare class SeatManager {
|
|
|
1022
1032
|
private fail;
|
|
1023
1033
|
}
|
|
1024
1034
|
|
|
1025
|
-
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
|
@@ -2275,7 +2275,8 @@ var CSS2 = `
|
|
|
2275
2275
|
.slm input{font:inherit}
|
|
2276
2276
|
|
|
2277
2277
|
/* top bar */
|
|
2278
|
-
.slm-bar{display:
|
|
2278
|
+
.slm-bar{display:grid;grid-template-columns:auto auto minmax(0,1fr);align-items:center;column-gap:14px;row-gap:10px;
|
|
2279
|
+
padding:10px 16px;border-bottom:1px solid var(--slm-line);flex:none}
|
|
2279
2280
|
.slm-modes{display:inline-flex;background:var(--slm-surface);border:1px solid var(--slm-line);border-radius:999px;padding:3px}
|
|
2280
2281
|
.slm-mode{padding:6px 16px;border-radius:999px;font-weight:700;font-size:13px;color:var(--slm-muted)}
|
|
2281
2282
|
.slm-mode.on{background:var(--slm-accent);color:var(--slm-accent-ink)}
|
|
@@ -2283,9 +2284,11 @@ var CSS2 = `
|
|
|
2283
2284
|
.slm-live-dot{width:8px;height:8px;border-radius:50%;background:#8b94ac}
|
|
2284
2285
|
.slm.live .slm-live-dot{background:#22a06b;box-shadow:0 0 0 0 rgba(34,160,107,.55);animation:slm-pulse 2s infinite}
|
|
2285
2286
|
@keyframes slm-pulse{0%{box-shadow:0 0 0 0 rgba(34,160,107,.5)}70%{box-shadow:0 0 0 7px rgba(34,160,107,0)}100%{box-shadow:0 0 0 0 rgba(34,160,107,0)}}
|
|
2286
|
-
.slm-kpis{display:
|
|
2287
|
-
|
|
2288
|
-
.slm-kpi
|
|
2287
|
+
.slm-kpis{grid-column:1/-1;display:grid;grid-template-columns:repeat(8,minmax(0,1fr));width:100%;padding-top:10px;
|
|
2288
|
+
border-top:1px solid var(--slm-line)}
|
|
2289
|
+
.slm-kpi{display:flex;min-width:0;flex-direction:column;align-items:center;padding:0 5px;line-height:1.15;text-align:center}
|
|
2290
|
+
.slm-kpi b{display:flex;min-width:0;align-items:baseline;justify-content:center;font-size:17px;font-weight:800;
|
|
2291
|
+
font-variant-numeric:tabular-nums;white-space:nowrap}
|
|
2289
2292
|
.slm-kpi span{font-size:9.5px;letter-spacing:.1em;text-transform:uppercase;color:var(--slm-muted);font-weight:700}
|
|
2290
2293
|
.slm-kpi .dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:5px;vertical-align:baseline}
|
|
2291
2294
|
.slm-barbtn{padding:7px 13px;border-radius:9px;border:1px solid var(--slm-line);color:var(--slm-text);font-weight:700;font-size:12.5px}
|
|
@@ -2354,7 +2357,7 @@ var CSS2 = `
|
|
|
2354
2357
|
.slm-toast.ok{background:#1f7a4d;color:#fff;border-color:#1f7a4d}
|
|
2355
2358
|
|
|
2356
2359
|
/* control-room actions + insights */
|
|
2357
|
-
.slm-bar-actions{display:flex;align-items:center;gap:7px}
|
|
2360
|
+
.slm-bar-actions{display:flex;align-items:center;justify-self:end;gap:7px}
|
|
2358
2361
|
.slm-barbtn.on{background:rgba(244,183,64,.13);border-color:#f4b740;color:#f7ca6b}
|
|
2359
2362
|
.slm-sectionlist{display:flex;flex-direction:column;gap:8px;margin-top:4px}
|
|
2360
2363
|
.slm-sectionlist + .slm-eyebrow{margin-top:18px}
|
|
@@ -2372,16 +2375,22 @@ var CSS2 = `
|
|
|
2372
2375
|
.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
2376
|
.slm-momentumgradient{height:6px;min-width:64px;flex:1;border-radius:999px;background:linear-gradient(90deg,#f4b740,#ef4444)}
|
|
2374
2377
|
.slm-momentumcopy{margin-top:7px;color:var(--slm-muted);font-size:11px;line-height:1.45}
|
|
2375
|
-
.slm-inspect-card{padding:
|
|
2376
|
-
.slm-inspect-label{font-size:24px;font-weight:850;letter-spacing:-.02em
|
|
2377
|
-
.slm-inspect-grid
|
|
2378
|
+
.slm-inspect-card{padding:16px;border:1px solid var(--slm-line);border-radius:12px;background:var(--slm-surface)}
|
|
2379
|
+
.slm-inspect-label{font-size:24px;font-weight:850;letter-spacing:-.02em;line-height:1.1}
|
|
2380
|
+
.slm-inspect-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 20px;margin-top:18px}
|
|
2381
|
+
.slm-inspect-grid>div{min-width:0}.slm-inspect-grid span{display:block;color:var(--slm-muted);font-size:10px;
|
|
2382
|
+
text-transform:uppercase;letter-spacing:.08em}.slm-inspect-grid b{display:block;margin-top:4px;font-size:13px;line-height:1.35;overflow-wrap:anywhere}
|
|
2378
2383
|
.slm:fullscreen{border-radius:0;min-height:100vh;background:var(--slm-bg)}
|
|
2379
2384
|
.slm:fullscreen .slm-bar{padding:14px 22px}.slm:fullscreen .slm-kpi b{font-size:21px}.slm:fullscreen .slm-rail{width:360px}
|
|
2380
2385
|
|
|
2381
2386
|
.slm.compact .slm-rail{width:100%;border-left:0;border-top:1px solid var(--slm-line);height:44%}
|
|
2382
2387
|
.slm.compact .slm-body{flex-direction:column}
|
|
2383
|
-
.slm.compact .slm-bar{gap:8px;padding:8px}
|
|
2384
|
-
.slm.compact .slm-
|
|
2388
|
+
.slm.compact .slm-bar{grid-template-columns:minmax(0,1fr) auto;gap:8px;padding:8px}
|
|
2389
|
+
.slm.compact .slm-modes{min-width:0}.slm.compact .slm-mode{padding-inline:11px}
|
|
2390
|
+
.slm.compact .slm-live{justify-self:end}.slm.compact .slm-bar-actions{grid-column:1/-1;justify-self:stretch}
|
|
2391
|
+
.slm.compact .slm-barbtn{flex:1;padding:6px 9px}.slm.compact .slm-kpis{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
|
|
2392
|
+
.slm.compact .slm-kpi[data-kpi="buyers"],.slm.compact .slm-kpi[data-kpi="active-holds"],
|
|
2393
|
+
.slm.compact .slm-kpi[data-kpi="sold-pct"],.slm.compact .slm-kpi[data-kpi="gross-sales"]{display:none}
|
|
2385
2394
|
`;
|
|
2386
2395
|
function injectStyle() {
|
|
2387
2396
|
if (typeof document === "undefined" || document.getElementById(STYLE_ID2)) return;
|
|
@@ -2500,11 +2509,12 @@ var SeatManager = class {
|
|
|
2500
2509
|
}
|
|
2501
2510
|
this.buildRenderer();
|
|
2502
2511
|
this.buildSectionOptions();
|
|
2503
|
-
await Promise.all([
|
|
2512
|
+
const [, controlRoom] = await Promise.all([
|
|
2504
2513
|
this.resnapshot(),
|
|
2505
2514
|
this.refreshControlRoom().catch((err) => this.opts.onError?.(err))
|
|
2506
2515
|
]);
|
|
2507
|
-
|
|
2516
|
+
if (controlRoom?.activity) this.seedFeed(controlRoom.activity);
|
|
2517
|
+
else this.api.log(this.key, { limit: 24 }).then((page) => this.seedFeed(page.entries)).catch(() => {
|
|
2508
2518
|
});
|
|
2509
2519
|
this.connect();
|
|
2510
2520
|
this.startFeedClock();
|
|
@@ -3010,7 +3020,8 @@ var SeatManager = class {
|
|
|
3010
3020
|
release: "released",
|
|
3011
3021
|
expire: "expired",
|
|
3012
3022
|
block: "blocked",
|
|
3013
|
-
unblock: "unblocked"
|
|
3023
|
+
unblock: "unblocked",
|
|
3024
|
+
unbook: "cancelled"
|
|
3014
3025
|
};
|
|
3015
3026
|
const stByAction = {
|
|
3016
3027
|
hold: "held",
|
|
@@ -3018,7 +3029,8 @@ var SeatManager = class {
|
|
|
3018
3029
|
release: "free",
|
|
3019
3030
|
expire: "free",
|
|
3020
3031
|
block: "blocked",
|
|
3021
|
-
unblock: "free"
|
|
3032
|
+
unblock: "free",
|
|
3033
|
+
unbook: "free"
|
|
3022
3034
|
};
|
|
3023
3035
|
for (const e of entries) {
|
|
3024
3036
|
const label = e.labels[0];
|
|
@@ -3196,15 +3208,15 @@ var SeatManager = class {
|
|
|
3196
3208
|
const rev = t3.revenueStatus === "current" ? fmtMoney(t3.grossRevenue, t3.currency) : "\u2014";
|
|
3197
3209
|
const presence = this.controlRoomSnapshot?.presence;
|
|
3198
3210
|
this.els.kpis.innerHTML = [
|
|
3199
|
-
{ n: t3.booked.toLocaleString(), l: "Sold", dot: "#22a06b" },
|
|
3200
|
-
{ n: t3.held.toLocaleString(), l: "Held", dot: "#f4b740" },
|
|
3201
|
-
{ n: presence ? presence.shoppingSessions.toLocaleString() : "\u2014", l: "
|
|
3202
|
-
{ n: presence ? presence.activeHolds.toLocaleString() : "\u2014", l: "
|
|
3203
|
-
{ n: t3.free.toLocaleString(), l: "Free", dot: "#6e7bff" },
|
|
3204
|
-
{ n: t3.blocked.toLocaleString(), l: "Blocked", dot: "#8b94ac" },
|
|
3205
|
-
{ n: `${t3.capacityPct}%`, l: "
|
|
3206
|
-
{ n: rev, l: "Gross" }
|
|
3207
|
-
].map((k) => `<div class="slm-kpi"><b>${k.dot ? `<span class="dot" style="background:${k.dot}"></span>` : ""}${k.n}</b><span>${k.l}</span></div>`).join("");
|
|
3211
|
+
{ key: "sold-seats", n: t3.booked.toLocaleString(), l: "Sold seats", dot: "#22a06b" },
|
|
3212
|
+
{ key: "held-seats", n: t3.held.toLocaleString(), l: "Held seats", dot: "#f4b740" },
|
|
3213
|
+
{ key: "buyers", n: presence ? presence.shoppingSessions.toLocaleString() : "\u2014", l: "Buyers" },
|
|
3214
|
+
{ key: "active-holds", n: presence ? presence.activeHolds.toLocaleString() : "\u2014", l: "Active holds" },
|
|
3215
|
+
{ key: "free-seats", n: t3.free.toLocaleString(), l: "Free seats", dot: "#6e7bff" },
|
|
3216
|
+
{ key: "blocked", n: t3.blocked.toLocaleString(), l: "Blocked", dot: "#8b94ac" },
|
|
3217
|
+
{ key: "sold-pct", n: `${t3.capacityPct}%`, l: "Sold" },
|
|
3218
|
+
{ key: "gross-sales", n: rev, l: "Gross sales" }
|
|
3219
|
+
].map((k) => `<div class="slm-kpi" data-kpi="${k.key}"><b>${k.dot ? `<span class="dot" style="background:${k.dot}"></span>` : ""}${k.n}</b><span>${k.l}</span></div>`).join("");
|
|
3208
3220
|
}
|
|
3209
3221
|
// ---- DOM: rails -----------------------------------------------------------
|
|
3210
3222
|
paintRail() {
|
|
@@ -3303,9 +3315,9 @@ var SeatManager = class {
|
|
|
3303
3315
|
const seat = seats[seats.length - 1];
|
|
3304
3316
|
if (!seat) {
|
|
3305
3317
|
this.els.rail.innerHTML = `
|
|
3306
|
-
<p class="slm-eyebrow">Inspect</p>
|
|
3307
|
-
<p class="slm-hint">Select
|
|
3308
|
-
<div class="slm-empty">
|
|
3318
|
+
<p class="slm-eyebrow">Inspect seats</p>
|
|
3319
|
+
<p class="slm-hint">Select a seat to see its availability and sales context. Nothing changes in this view.</p>
|
|
3320
|
+
<div class="slm-empty">Select a seat on the map.</div>`;
|
|
3309
3321
|
return;
|
|
3310
3322
|
}
|
|
3311
3323
|
const status = this.status.get(seat.label) ?? "free";
|
|
@@ -3314,17 +3326,20 @@ var SeatManager = class {
|
|
|
3314
3326
|
const sectionLabel = this.sectionLabelById.get(sectionId) ?? "Other seats";
|
|
3315
3327
|
const category = this.doc?.categories.find((item) => item.key === seat.categoryKey);
|
|
3316
3328
|
const sectionMetric = this.controlRoomSnapshot?.revenue.bySection.find((row) => row.sectionId === sectionId);
|
|
3329
|
+
const object = this.doc?.objects.find((item) => item.id === seat.rowId);
|
|
3330
|
+
const location = object?.type === "row" ? { label: "Row", value: object.label } : object?.type === "table" ? { label: "Table", value: object.label } : seat.kind === "booth" ? { label: "Type", value: "Booth" } : null;
|
|
3331
|
+
const itemKind = seat.kind === "booth" ? "Booth" : "Seat";
|
|
3317
3332
|
this.els.rail.innerHTML = `
|
|
3318
|
-
<p class="slm-eyebrow"
|
|
3319
|
-
<p class="slm-hint">Live
|
|
3333
|
+
<p class="slm-eyebrow">${itemKind} details</p>
|
|
3334
|
+
<p class="slm-hint">Live availability and section performance.</p>
|
|
3320
3335
|
<div class="slm-inspect-card">
|
|
3321
3336
|
<div class="slm-inspect-label">${esc(seat.label)}</div>
|
|
3322
3337
|
<div class="slm-inspect-grid">
|
|
3323
3338
|
<div><span>Status</span><b>${statusLabel[status]}</b></div>
|
|
3324
3339
|
<div><span>Section</span><b>${esc(sectionLabel)}</b></div>
|
|
3325
|
-
|
|
3340
|
+
${location ? `<div><span>${location.label}</span><b>${esc(location.value)}</b></div>` : ""}
|
|
3326
3341
|
<div><span>Category</span><b>${esc(category?.label ?? seat.categoryKey)}</b></div>
|
|
3327
|
-
<div><span>
|
|
3342
|
+
<div><span>Sold in section</span><b>${sectionMetric ? `${sectionMetric.booked} of ${sectionMetric.total}` : "\u2014"}</b></div>
|
|
3328
3343
|
<div><span>Section revenue</span><b>${sectionMetric && this.controlRoomSnapshot ? fmtMoney(sectionMetric.bookedRevenue, this.controlRoomSnapshot.currency) : "\u2014"}</b></div>
|
|
3329
3344
|
</div>
|
|
3330
3345
|
</div>`;
|