@seatlayer/js 0.50.1 → 0.50.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/dist/index.d.cts CHANGED
@@ -1725,6 +1725,8 @@ declare class SeatPicker {
1725
1725
  private fsEscHandler;
1726
1726
  /** Host-level event chrome owns the duplicate identity outside full screen. */
1727
1727
  private eventDetailsHidden;
1728
+ /** True while the hold note reads "N more selected" — the tick must not overwrite it. */
1729
+ private holdCopyPending;
1728
1730
  /** Wide-layout ticket panel collapsed (map owns the full width). */
1729
1731
  private sideCollapsed;
1730
1732
  private sideToggleEl;
@@ -2072,9 +2074,20 @@ declare class SeatPicker {
2072
2074
  /** A live delta took one of OUR selected (not yet held) seats — evict + tell the buyer. */
2073
2075
  private evictTakenSelections;
2074
2076
  private syncTray;
2077
+ /**
2078
+ * The bottom-sheet's collapsed one-liner. Called from syncTray on every
2079
+ * repaint AND from setCtaPhase: while the widget is securing seats or
2080
+ * opening checkout, the peek is the phone buyer's ONLY line of sight, and a
2081
+ * pill still reading "Continue" at the moment money is about to move is the
2082
+ * emotional trapdoor the audit flagged. The phase lines restate what is
2083
+ * secured and promise no charge yet.
2084
+ */
2085
+ private renderPeek;
2075
2086
  private removeHeldLabel;
2076
2087
  private handleChangeSeats;
2077
2088
  private handleCta;
2089
+ /** "Yours for m:ss — you won't be charged yet." — the hold note's promise. */
2090
+ private holdReassuranceText;
2078
2091
  private startHoldTimer;
2079
2092
  private stopHoldTimer;
2080
2093
  /** Show/refresh (or hide) the "Need more time?" prompt with the live seconds left. */
package/dist/index.d.ts CHANGED
@@ -1725,6 +1725,8 @@ declare class SeatPicker {
1725
1725
  private fsEscHandler;
1726
1726
  /** Host-level event chrome owns the duplicate identity outside full screen. */
1727
1727
  private eventDetailsHidden;
1728
+ /** True while the hold note reads "N more selected" — the tick must not overwrite it. */
1729
+ private holdCopyPending;
1728
1730
  /** Wide-layout ticket panel collapsed (map owns the full width). */
1729
1731
  private sideCollapsed;
1730
1732
  private sideToggleEl;
@@ -2072,9 +2074,20 @@ declare class SeatPicker {
2072
2074
  /** A live delta took one of OUR selected (not yet held) seats — evict + tell the buyer. */
2073
2075
  private evictTakenSelections;
2074
2076
  private syncTray;
2077
+ /**
2078
+ * The bottom-sheet's collapsed one-liner. Called from syncTray on every
2079
+ * repaint AND from setCtaPhase: while the widget is securing seats or
2080
+ * opening checkout, the peek is the phone buyer's ONLY line of sight, and a
2081
+ * pill still reading "Continue" at the moment money is about to move is the
2082
+ * emotional trapdoor the audit flagged. The phase lines restate what is
2083
+ * secured and promise no charge yet.
2084
+ */
2085
+ private renderPeek;
2075
2086
  private removeHeldLabel;
2076
2087
  private handleChangeSeats;
2077
2088
  private handleCta;
2089
+ /** "Yours for m:ss — you won't be charged yet." — the hold note's promise. */
2090
+ private holdReassuranceText;
2078
2091
  private startHoldTimer;
2079
2092
  private stopHoldTimer;
2080
2093
  /** Show/refresh (or hide) the "Need more time?" prompt with the live seconds left. */
package/dist/index.js CHANGED
@@ -3568,6 +3568,8 @@ var SeatPicker = class _SeatPicker {
3568
3568
  this.fsEscHandler = null;
3569
3569
  /** Host-level event chrome owns the duplicate identity outside full screen. */
3570
3570
  this.eventDetailsHidden = false;
3571
+ /** True while the hold note reads "N more selected" — the tick must not overwrite it. */
3572
+ this.holdCopyPending = false;
3571
3573
  /** Wide-layout ticket panel collapsed (map owns the full width). */
3572
3574
  this.sideCollapsed = false;
3573
3575
  this.sideToggleEl = null;
@@ -4150,7 +4152,7 @@ var SeatPicker = class _SeatPicker {
4150
4152
  <div class="sl-foot" data-ref="foot">
4151
4153
  <div class="sl-hold-note" data-ref="holdNote" role="status" aria-live="polite">
4152
4154
  <svg viewBox="0 0 24 24" aria-hidden="true"><path d="M20 6L9 17l-5-5"/></svg>
4153
- <span><b data-ref="holdTitle">Seats secured</b><span class="sl-hold-copy" data-ref="holdCopy">Checkout timer is running.</span></span>
4155
+ <span><b data-ref="holdTitle">Seats secured</b><span class="sl-hold-copy" data-ref="holdCopy">You won\u2019t be charged yet.</span></span>
4154
4156
  <button type="button" class="sl-hold-change" data-ref="holdChange" aria-label="Release held tickets and choose different seats">Change</button>
4155
4157
  </div>
4156
4158
  <div class="sl-total"><span data-ref="count"></span><b data-ref="total"></b></div>
@@ -4757,7 +4759,7 @@ var SeatPicker = class _SeatPicker {
4757
4759
  }
4758
4760
  if (this.ctaPhase === "checkout") {
4759
4761
  cta.disabled = true;
4760
- cta.innerHTML = '<span class="sl-cta-spin" aria-hidden="true"></span>Opening checkout\u2026';
4762
+ cta.innerHTML = '<span class="sl-cta-spin" aria-hidden="true"></span>Opening secure checkout\u2026';
4761
4763
  return;
4762
4764
  }
4763
4765
  cta.disabled = count === 0;
@@ -4766,11 +4768,13 @@ var SeatPicker = class _SeatPicker {
4766
4768
  setCtaPhase(phase) {
4767
4769
  this.ctaPhase = phase;
4768
4770
  this.syncCta();
4771
+ this.renderPeek(this.lastTrayCount, this.lastTrayTotal, this.pendingSelectionCount());
4769
4772
  if (phase === "checkout") {
4770
4773
  this.scheduleMotion(() => {
4771
4774
  if (this.ctaPhase !== "checkout") return;
4772
4775
  this.ctaPhase = "idle";
4773
4776
  this.syncCta();
4777
+ this.renderPeek(this.lastTrayCount, this.lastTrayTotal, this.pendingSelectionCount());
4774
4778
  }, 1100);
4775
4779
  }
4776
4780
  }
@@ -6178,7 +6182,8 @@ var SeatPicker = class _SeatPicker {
6178
6182
  this.els.holdTitle.textContent = `${securedCount} secured`;
6179
6183
  }
6180
6184
  if (this.els.holdCopy) {
6181
- this.els.holdCopy.textContent = pendingCount ? `${pendingCount} more selected` : "Checkout timer running";
6185
+ this.holdCopyPending = pendingCount > 0;
6186
+ this.els.holdCopy.textContent = pendingCount ? `${pendingCount} more selected` : this.holdReassuranceText();
6182
6187
  }
6183
6188
  const change = this.els.holdChange;
6184
6189
  if (change) {
@@ -6192,21 +6197,39 @@ var SeatPicker = class _SeatPicker {
6192
6197
  this.animateOnce(this.els.cta, "sl-ready", 520);
6193
6198
  if (this.sideCollapsed && this.root?.dataset.layout !== "narrow") this.setPanelCollapsed(false);
6194
6199
  }
6195
- if (this.els.peek) {
6196
- if (count) {
6197
- const holding = !!this.hold && !pendingCount;
6198
- this.els.peek.innerHTML = `<span>${count} ${count === 1 ? "ticket" : "tickets"} \xB7 ${this.money(total)}</span><button type="button" class="go sl-sheet-go" data-act="${holding ? "checkout" : "open"}">${this.hold ? pendingCount ? "Secure more" : "Continue" : "Review"}</button>`;
6199
- } else if (this.salesClosed) {
6200
- this.els.peek.innerHTML = `<span>${this.tf("picker.salesClosedPill", "Sales are closed")}</span>`;
6201
- } else {
6202
- const prices = (this.controller.doc?.categories ?? []).map((c) => this.catPrice(c)).filter((p) => p != null);
6203
- this.els.peek.innerHTML = (prices.length ? `<span>From ${this.money(Math.min(...prices))}</span>` : "<span>Pick your seats</span>") + `<button type="button" class="go sl-sheet-go" data-act="open">\u2726 Best seats</button>`;
6204
- }
6205
- }
6200
+ this.renderPeek(count, total, pendingCount);
6206
6201
  this.lastTrayCount = count;
6207
6202
  this.lastTrayTotal = total;
6208
6203
  this.opts.onSelectionChange?.(seats);
6209
6204
  }
6205
+ /**
6206
+ * The bottom-sheet's collapsed one-liner. Called from syncTray on every
6207
+ * repaint AND from setCtaPhase: while the widget is securing seats or
6208
+ * opening checkout, the peek is the phone buyer's ONLY line of sight, and a
6209
+ * pill still reading "Continue" at the moment money is about to move is the
6210
+ * emotional trapdoor the audit flagged. The phase lines restate what is
6211
+ * secured and promise no charge yet.
6212
+ */
6213
+ renderPeek(count, total, pendingCount) {
6214
+ if (!this.els.peek) return;
6215
+ if (count && this.ctaPhase === "holding") {
6216
+ this.els.peek.innerHTML = `<span>Securing your seats\u2026</span>`;
6217
+ return;
6218
+ }
6219
+ if (count && this.ctaPhase === "checkout") {
6220
+ this.els.peek.innerHTML = `<span>\u2713 ${count} ${count === 1 ? "ticket" : "tickets"} secured \xB7 ${this.money(total)} \u2014 you won\u2019t be charged yet</span>`;
6221
+ return;
6222
+ }
6223
+ if (count) {
6224
+ const holding = !!this.hold && !pendingCount;
6225
+ this.els.peek.innerHTML = `<span>${count} ${count === 1 ? "ticket" : "tickets"} \xB7 ${this.money(total)}</span><button type="button" class="go sl-sheet-go" data-act="${holding ? "checkout" : "open"}">${this.hold ? pendingCount ? "Secure more" : "Continue" : "Review"}</button>`;
6226
+ } else if (this.salesClosed) {
6227
+ this.els.peek.innerHTML = `<span>${this.tf("picker.salesClosedPill", "Sales are closed")}</span>`;
6228
+ } else {
6229
+ const prices = (this.controller.doc?.categories ?? []).map((c) => this.catPrice(c)).filter((p) => p != null);
6230
+ this.els.peek.innerHTML = (prices.length ? `<span>From ${this.money(Math.min(...prices))}</span>` : "<span>Pick your seats</span>") + `<button type="button" class="go sl-sheet-go" data-act="open">\u2726 Best seats</button>`;
6231
+ }
6232
+ }
6210
6233
  async removeHeldLabel(label, chip) {
6211
6234
  if (!label || this.releasingLabels.has(label)) return false;
6212
6235
  this.releasingLabels.add(label);
@@ -6315,6 +6338,13 @@ var SeatPicker = class _SeatPicker {
6315
6338
  this.syncTray();
6316
6339
  }
6317
6340
  }
6341
+ /** "Yours for m:ss — you won't be charged yet." — the hold note's promise. */
6342
+ holdReassuranceText() {
6343
+ const ms = Math.max(0, this.holdExpiresAt - Date.now());
6344
+ const m = Math.floor(ms / 6e4);
6345
+ const s = String(Math.floor(ms % 6e4 / 1e3)).padStart(2, "0");
6346
+ return `Yours for ${m}:${s} \u2014 you won\u2019t be charged yet.`;
6347
+ }
6318
6348
  startHoldTimer(expiresAt) {
6319
6349
  this.stopHoldTimer();
6320
6350
  this.holdExpiresAt = expiresAt;
@@ -6328,6 +6358,9 @@ var SeatPicker = class _SeatPicker {
6328
6358
  const m = Math.floor(ms / 6e4);
6329
6359
  const s = String(Math.floor(ms % 6e4 / 1e3)).padStart(2, "0");
6330
6360
  if (time) time.textContent = `${m}:${s}`;
6361
+ if (!this.holdCopyPending && this.els.holdCopy) {
6362
+ this.els.holdCopy.textContent = this.holdReassuranceText();
6363
+ }
6331
6364
  pill.classList.add("on");
6332
6365
  pill.classList.toggle("is-expiring", ms > 0 && ms <= EXTEND_PROMPT_MS);
6333
6366
  this.setExtendPrompt(ms > 0 && ms <= EXTEND_PROMPT_MS, ms);
@@ -6347,8 +6380,10 @@ var SeatPicker = class _SeatPicker {
6347
6380
  setExtendPrompt(show, ms) {
6348
6381
  if (!this.extendEl) return;
6349
6382
  if (show && this.controller.currentHold() && !this.bookedShown) {
6350
- const secs = Math.ceil(ms / 1e3);
6351
- this.els.extendTxt.innerHTML = `Your seats are held for <b>0:${String(secs).padStart(2, "0")}</b>. Need more time?`;
6383
+ const totalSecs = Math.ceil(ms / 1e3);
6384
+ const m = Math.floor(totalSecs / 60);
6385
+ const s = String(totalSecs % 60).padStart(2, "0");
6386
+ this.els.extendTxt.innerHTML = `Your seats are held for <b>${m}:${s}</b>. Need more time?`;
6352
6387
  this.extendEl.classList.add("on");
6353
6388
  } else {
6354
6389
  this.extendEl.classList.remove("on");