@seatlayer/js 0.12.2 → 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 +38 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +38 -26
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -2294,7 +2294,8 @@ var CSS2 = `
|
|
|
2294
2294
|
.slm input{font:inherit}
|
|
2295
2295
|
|
|
2296
2296
|
/* top bar */
|
|
2297
|
-
.slm-bar{display:
|
|
2297
|
+
.slm-bar{display:grid;grid-template-columns:auto auto minmax(0,1fr);align-items:center;column-gap:14px;row-gap:10px;
|
|
2298
|
+
padding:10px 16px;border-bottom:1px solid var(--slm-line);flex:none}
|
|
2298
2299
|
.slm-modes{display:inline-flex;background:var(--slm-surface);border:1px solid var(--slm-line);border-radius:999px;padding:3px}
|
|
2299
2300
|
.slm-mode{padding:6px 16px;border-radius:999px;font-weight:700;font-size:13px;color:var(--slm-muted)}
|
|
2300
2301
|
.slm-mode.on{background:var(--slm-accent);color:var(--slm-accent-ink)}
|
|
@@ -2302,9 +2303,11 @@ var CSS2 = `
|
|
|
2302
2303
|
.slm-live-dot{width:8px;height:8px;border-radius:50%;background:#8b94ac}
|
|
2303
2304
|
.slm.live .slm-live-dot{background:#22a06b;box-shadow:0 0 0 0 rgba(34,160,107,.55);animation:slm-pulse 2s infinite}
|
|
2304
2305
|
@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)}}
|
|
2305
|
-
.slm-kpis{display:
|
|
2306
|
-
|
|
2307
|
-
.slm-kpi
|
|
2306
|
+
.slm-kpis{grid-column:1/-1;display:grid;grid-template-columns:repeat(8,minmax(0,1fr));width:100%;padding-top:10px;
|
|
2307
|
+
border-top:1px solid var(--slm-line)}
|
|
2308
|
+
.slm-kpi{display:flex;min-width:0;flex-direction:column;align-items:center;padding:0 5px;line-height:1.15;text-align:center}
|
|
2309
|
+
.slm-kpi b{display:flex;min-width:0;align-items:baseline;justify-content:center;font-size:17px;font-weight:800;
|
|
2310
|
+
font-variant-numeric:tabular-nums;white-space:nowrap}
|
|
2308
2311
|
.slm-kpi span{font-size:9.5px;letter-spacing:.1em;text-transform:uppercase;color:var(--slm-muted);font-weight:700}
|
|
2309
2312
|
.slm-kpi .dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:5px;vertical-align:baseline}
|
|
2310
2313
|
.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}
|
|
@@ -2373,7 +2376,7 @@ var CSS2 = `
|
|
|
2373
2376
|
.slm-toast.ok{background:#1f7a4d;color:#fff;border-color:#1f7a4d}
|
|
2374
2377
|
|
|
2375
2378
|
/* control-room actions + insights */
|
|
2376
|
-
.slm-bar-actions{display:flex;align-items:center;gap:7px}
|
|
2379
|
+
.slm-bar-actions{display:flex;align-items:center;justify-self:end;gap:7px}
|
|
2377
2380
|
.slm-barbtn.on{background:rgba(244,183,64,.13);border-color:#f4b740;color:#f7ca6b}
|
|
2378
2381
|
.slm-sectionlist{display:flex;flex-direction:column;gap:8px;margin-top:4px}
|
|
2379
2382
|
.slm-sectionlist + .slm-eyebrow{margin-top:18px}
|
|
@@ -2391,16 +2394,22 @@ var CSS2 = `
|
|
|
2391
2394
|
.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}
|
|
2392
2395
|
.slm-momentumgradient{height:6px;min-width:64px;flex:1;border-radius:999px;background:linear-gradient(90deg,#f4b740,#ef4444)}
|
|
2393
2396
|
.slm-momentumcopy{margin-top:7px;color:var(--slm-muted);font-size:11px;line-height:1.45}
|
|
2394
|
-
.slm-inspect-card{padding:
|
|
2395
|
-
.slm-inspect-label{font-size:24px;font-weight:850;letter-spacing:-.02em
|
|
2396
|
-
.slm-inspect-grid
|
|
2397
|
+
.slm-inspect-card{padding:16px;border:1px solid var(--slm-line);border-radius:12px;background:var(--slm-surface)}
|
|
2398
|
+
.slm-inspect-label{font-size:24px;font-weight:850;letter-spacing:-.02em;line-height:1.1}
|
|
2399
|
+
.slm-inspect-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 20px;margin-top:18px}
|
|
2400
|
+
.slm-inspect-grid>div{min-width:0}.slm-inspect-grid span{display:block;color:var(--slm-muted);font-size:10px;
|
|
2401
|
+
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}
|
|
2397
2402
|
.slm:fullscreen{border-radius:0;min-height:100vh;background:var(--slm-bg)}
|
|
2398
2403
|
.slm:fullscreen .slm-bar{padding:14px 22px}.slm:fullscreen .slm-kpi b{font-size:21px}.slm:fullscreen .slm-rail{width:360px}
|
|
2399
2404
|
|
|
2400
2405
|
.slm.compact .slm-rail{width:100%;border-left:0;border-top:1px solid var(--slm-line);height:44%}
|
|
2401
2406
|
.slm.compact .slm-body{flex-direction:column}
|
|
2402
|
-
.slm.compact .slm-bar{gap:8px;padding:8px}
|
|
2403
|
-
.slm.compact .slm-
|
|
2407
|
+
.slm.compact .slm-bar{grid-template-columns:minmax(0,1fr) auto;gap:8px;padding:8px}
|
|
2408
|
+
.slm.compact .slm-modes{min-width:0}.slm.compact .slm-mode{padding-inline:11px}
|
|
2409
|
+
.slm.compact .slm-live{justify-self:end}.slm.compact .slm-bar-actions{grid-column:1/-1;justify-self:stretch}
|
|
2410
|
+
.slm.compact .slm-barbtn{flex:1;padding:6px 9px}.slm.compact .slm-kpis{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
|
|
2411
|
+
.slm.compact .slm-kpi[data-kpi="buyers"],.slm.compact .slm-kpi[data-kpi="active-holds"],
|
|
2412
|
+
.slm.compact .slm-kpi[data-kpi="sold-pct"],.slm.compact .slm-kpi[data-kpi="gross-sales"]{display:none}
|
|
2404
2413
|
`;
|
|
2405
2414
|
function injectStyle() {
|
|
2406
2415
|
if (typeof document === "undefined" || document.getElementById(STYLE_ID2)) return;
|
|
@@ -3218,15 +3227,15 @@ var SeatManager = class {
|
|
|
3218
3227
|
const rev = t3.revenueStatus === "current" ? fmtMoney(t3.grossRevenue, t3.currency) : "\u2014";
|
|
3219
3228
|
const presence = this.controlRoomSnapshot?.presence;
|
|
3220
3229
|
this.els.kpis.innerHTML = [
|
|
3221
|
-
{ n: t3.booked.toLocaleString(), l: "Sold", dot: "#22a06b" },
|
|
3222
|
-
{ n: t3.held.toLocaleString(), l: "Held", dot: "#f4b740" },
|
|
3223
|
-
{ n: presence ? presence.shoppingSessions.toLocaleString() : "\u2014", l: "
|
|
3224
|
-
{ n: presence ? presence.activeHolds.toLocaleString() : "\u2014", l: "
|
|
3225
|
-
{ n: t3.free.toLocaleString(), l: "Free", dot: "#6e7bff" },
|
|
3226
|
-
{ n: t3.blocked.toLocaleString(), l: "Blocked", dot: "#8b94ac" },
|
|
3227
|
-
{ n: `${t3.capacityPct}%`, l: "
|
|
3228
|
-
{ n: rev, l: "Gross" }
|
|
3229
|
-
].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("");
|
|
3230
|
+
{ key: "sold-seats", n: t3.booked.toLocaleString(), l: "Sold seats", dot: "#22a06b" },
|
|
3231
|
+
{ key: "held-seats", n: t3.held.toLocaleString(), l: "Held seats", dot: "#f4b740" },
|
|
3232
|
+
{ key: "buyers", n: presence ? presence.shoppingSessions.toLocaleString() : "\u2014", l: "Buyers" },
|
|
3233
|
+
{ key: "active-holds", n: presence ? presence.activeHolds.toLocaleString() : "\u2014", l: "Active holds" },
|
|
3234
|
+
{ key: "free-seats", n: t3.free.toLocaleString(), l: "Free seats", dot: "#6e7bff" },
|
|
3235
|
+
{ key: "blocked", n: t3.blocked.toLocaleString(), l: "Blocked", dot: "#8b94ac" },
|
|
3236
|
+
{ key: "sold-pct", n: `${t3.capacityPct}%`, l: "Sold" },
|
|
3237
|
+
{ key: "gross-sales", n: rev, l: "Gross sales" }
|
|
3238
|
+
].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("");
|
|
3230
3239
|
}
|
|
3231
3240
|
// ---- DOM: rails -----------------------------------------------------------
|
|
3232
3241
|
paintRail() {
|
|
@@ -3325,9 +3334,9 @@ var SeatManager = class {
|
|
|
3325
3334
|
const seat = seats[seats.length - 1];
|
|
3326
3335
|
if (!seat) {
|
|
3327
3336
|
this.els.rail.innerHTML = `
|
|
3328
|
-
<p class="slm-eyebrow">Inspect</p>
|
|
3329
|
-
<p class="slm-hint">Select
|
|
3330
|
-
<div class="slm-empty">
|
|
3337
|
+
<p class="slm-eyebrow">Inspect seats</p>
|
|
3338
|
+
<p class="slm-hint">Select a seat to see its availability and sales context. Nothing changes in this view.</p>
|
|
3339
|
+
<div class="slm-empty">Select a seat on the map.</div>`;
|
|
3331
3340
|
return;
|
|
3332
3341
|
}
|
|
3333
3342
|
const status = this.status.get(seat.label) ?? "free";
|
|
@@ -3336,17 +3345,20 @@ var SeatManager = class {
|
|
|
3336
3345
|
const sectionLabel = this.sectionLabelById.get(sectionId) ?? "Other seats";
|
|
3337
3346
|
const category = this.doc?.categories.find((item) => item.key === seat.categoryKey);
|
|
3338
3347
|
const sectionMetric = this.controlRoomSnapshot?.revenue.bySection.find((row) => row.sectionId === sectionId);
|
|
3348
|
+
const object = this.doc?.objects.find((item) => item.id === seat.rowId);
|
|
3349
|
+
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;
|
|
3350
|
+
const itemKind = seat.kind === "booth" ? "Booth" : "Seat";
|
|
3339
3351
|
this.els.rail.innerHTML = `
|
|
3340
|
-
<p class="slm-eyebrow"
|
|
3341
|
-
<p class="slm-hint">Live
|
|
3352
|
+
<p class="slm-eyebrow">${itemKind} details</p>
|
|
3353
|
+
<p class="slm-hint">Live availability and section performance.</p>
|
|
3342
3354
|
<div class="slm-inspect-card">
|
|
3343
3355
|
<div class="slm-inspect-label">${esc(seat.label)}</div>
|
|
3344
3356
|
<div class="slm-inspect-grid">
|
|
3345
3357
|
<div><span>Status</span><b>${statusLabel[status]}</b></div>
|
|
3346
3358
|
<div><span>Section</span><b>${esc(sectionLabel)}</b></div>
|
|
3347
|
-
|
|
3359
|
+
${location ? `<div><span>${location.label}</span><b>${esc(location.value)}</b></div>` : ""}
|
|
3348
3360
|
<div><span>Category</span><b>${esc(category?.label ?? seat.categoryKey)}</b></div>
|
|
3349
|
-
<div><span>
|
|
3361
|
+
<div><span>Sold in section</span><b>${sectionMetric ? `${sectionMetric.booked} of ${sectionMetric.total}` : "\u2014"}</b></div>
|
|
3350
3362
|
<div><span>Section revenue</span><b>${sectionMetric && this.controlRoomSnapshot ? fmtMoney(sectionMetric.bookedRevenue, this.controlRoomSnapshot.currency) : "\u2014"}</b></div>
|
|
3351
3363
|
</div>
|
|
3352
3364
|
</div>`;
|