@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.js CHANGED
@@ -2275,7 +2275,8 @@ var CSS2 = `
2275
2275
  .slm input{font:inherit}
2276
2276
 
2277
2277
  /* top bar */
2278
- .slm-bar{display:flex;align-items:center;gap:14px;padding:10px 16px;border-bottom:1px solid var(--slm-line);flex:none;flex-wrap:wrap}
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:flex;align-items:center;gap:16px;margin-left:auto;flex-wrap:wrap}
2287
- .slm-kpi{display:flex;flex-direction:column;line-height:1.15}
2288
- .slm-kpi b{font-size:17px;font-weight:800;font-variant-numeric:tabular-nums}
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:12px;border:1px solid var(--slm-line);border-radius:12px;background:var(--slm-surface)}
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}
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}
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}.slm.compact .slm-barbtn{padding:6px 9px}
2384
- .slm.compact .slm-kpis{gap:9px}.slm.compact .slm-kpi:nth-child(n+5){display:none}
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;
@@ -3199,15 +3208,15 @@ var SeatManager = class {
3199
3208
  const rev = t3.revenueStatus === "current" ? fmtMoney(t3.grossRevenue, t3.currency) : "\u2014";
3200
3209
  const presence = this.controlRoomSnapshot?.presence;
3201
3210
  this.els.kpis.innerHTML = [
3202
- { n: t3.booked.toLocaleString(), l: "Sold", dot: "#22a06b" },
3203
- { n: t3.held.toLocaleString(), l: "Held", dot: "#f4b740" },
3204
- { n: presence ? presence.shoppingSessions.toLocaleString() : "\u2014", l: "Shopping" },
3205
- { n: presence ? presence.activeHolds.toLocaleString() : "\u2014", l: "Live holds" },
3206
- { n: t3.free.toLocaleString(), l: "Free", dot: "#6e7bff" },
3207
- { n: t3.blocked.toLocaleString(), l: "Blocked", dot: "#8b94ac" },
3208
- { n: `${t3.capacityPct}%`, l: "Capacity" },
3209
- { n: rev, l: "Gross" }
3210
- ].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("");
3211
3220
  }
3212
3221
  // ---- DOM: rails -----------------------------------------------------------
3213
3222
  paintRail() {
@@ -3306,9 +3315,9 @@ var SeatManager = class {
3306
3315
  const seat = seats[seats.length - 1];
3307
3316
  if (!seat) {
3308
3317
  this.els.rail.innerHTML = `
3309
- <p class="slm-eyebrow">Inspect</p>
3310
- <p class="slm-hint">Select any seat to see its live inventory context. Inspect is read-only and never changes availability.</p>
3311
- <div class="slm-empty">Choose a seat on the map.</div>`;
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>`;
3312
3321
  return;
3313
3322
  }
3314
3323
  const status = this.status.get(seat.label) ?? "free";
@@ -3317,17 +3326,20 @@ var SeatManager = class {
3317
3326
  const sectionLabel = this.sectionLabelById.get(sectionId) ?? "Other seats";
3318
3327
  const category = this.doc?.categories.find((item) => item.key === seat.categoryKey);
3319
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";
3320
3332
  this.els.rail.innerHTML = `
3321
- <p class="slm-eyebrow">Inspect</p>
3322
- <p class="slm-hint">Live inventory context. Booked seats remain read-only; order and payment actions belong to the host commerce system.</p>
3333
+ <p class="slm-eyebrow">${itemKind} details</p>
3334
+ <p class="slm-hint">Live availability and section performance.</p>
3323
3335
  <div class="slm-inspect-card">
3324
3336
  <div class="slm-inspect-label">${esc(seat.label)}</div>
3325
3337
  <div class="slm-inspect-grid">
3326
3338
  <div><span>Status</span><b>${statusLabel[status]}</b></div>
3327
3339
  <div><span>Section</span><b>${esc(sectionLabel)}</b></div>
3328
- <div><span>Row</span><b>${esc(seat.rowId)}</b></div>
3340
+ ${location ? `<div><span>${location.label}</span><b>${esc(location.value)}</b></div>` : ""}
3329
3341
  <div><span>Category</span><b>${esc(category?.label ?? seat.categoryKey)}</b></div>
3330
- <div><span>Section sold</span><b>${sectionMetric ? `${sectionMetric.booked}/${sectionMetric.total}` : "\u2014"}</b></div>
3342
+ <div><span>Sold in section</span><b>${sectionMetric ? `${sectionMetric.booked} of ${sectionMetric.total}` : "\u2014"}</b></div>
3331
3343
  <div><span>Section revenue</span><b>${sectionMetric && this.controlRoomSnapshot ? fmtMoney(sectionMetric.bookedRevenue, this.controlRoomSnapshot.currency) : "\u2014"}</b></div>
3332
3344
  </div>
3333
3345
  </div>`;