@seatlayer/js 0.13.0 → 0.15.0

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
@@ -42,6 +42,10 @@ interface HoldResult {
42
42
  seats?: PickerSeat[];
43
43
  items?: HoldLineItem[];
44
44
  }
45
+ /** Browser-safe active-hold projection returned by the resume endpoint. */
46
+ interface ResumedHoldResult extends HoldResult {
47
+ items: HoldLineItem[];
48
+ }
45
49
  /** Best-available response — the server-picked seats plus the hold they landed in. */
46
50
  interface BestAvailableResult {
47
51
  holdId: string;
@@ -121,6 +125,8 @@ interface SeatingChartOptions {
121
125
  onSeatHover?: (details: SeatHoverDetails | null) => void;
122
126
  onSelectionChange?: (seats: SelectedSeat[]) => void;
123
127
  onHold?: (result: HoldResult) => void;
128
+ /** A prior active hold was restored with resumeHold(). */
129
+ onHoldRestored?: (result: HoldResult) => void;
124
130
  onHoldExpired?: () => void;
125
131
  onGAClick?: (area: GAAreaAvailability) => void;
126
132
  onError?: (err: unknown) => void;
@@ -159,6 +165,10 @@ declare class SeatingChart {
159
165
  hold(options?: {
160
166
  ttlMs?: number;
161
167
  }): Promise<HoldResult | null>;
168
+ /** Restore an active hold by its opaque id without extending its expiry. */
169
+ resumeHold(holdId: string): Promise<HoldResult | null>;
170
+ /** Current active hold known to this chart, if any. */
171
+ getCurrentHold(): HoldResult | null;
162
172
  getGAAreas(): GAAreaAvailability[];
163
173
  holdGA(areaId: string, qty: number, options?: {
164
174
  tierId?: string | null;
@@ -195,6 +205,8 @@ declare class SeatingChart {
195
205
  zoomToFit(): void;
196
206
  /** Release the current hold (if any). No-op when nothing is held. */
197
207
  release(): Promise<void>;
208
+ /** Release selected labels from the current hold while keeping the remainder. */
209
+ releaseLabels(labels: string[]): Promise<boolean>;
198
210
  /** Tear everything down: close the socket, stop timers, drop the canvas. */
199
211
  destroy(): void;
200
212
  }
@@ -354,8 +366,22 @@ interface SeatPickerOptions {
354
366
  /** Hold TTL in ms passed to hold(); server clamps to its own limits. */
355
367
  holdTtlMs?: number;
356
368
  /**
357
- * Confirm mode: tapping a seat shows an anchored popover (seat · category ·
358
- * price · Add/Cancel) instead of adding straight to the tray. Default false.
369
+ * An opaque hold id supplied by the host to restore after navigation. It is
370
+ * verified against the event and active server state before anything renders
371
+ * as owned by this buyer.
372
+ */
373
+ initialHoldId?: string;
374
+ /**
375
+ * Automatically remember the active hold id in sessionStorage and restore it
376
+ * when this event's picker mounts again. Default true. Set false when the host
377
+ * owns hold persistence and supplies initialHoldId itself.
378
+ */
379
+ restoreHold?: boolean;
380
+ /**
381
+ * Confirm mode: tapping a seat shows a confirmation card with section, row,
382
+ * seat, category, price and Select/Cancel before it enters the tray. Default
383
+ * true for the full buyer picker; set false only when the host supplies its
384
+ * own equivalent confirmation UI.
359
385
  */
360
386
  confirmSelection?: boolean;
361
387
  /**
@@ -380,14 +406,24 @@ interface SeatPickerOptions {
380
406
  onBooked?: (handoff: CheckoutHandoff) => void;
381
407
  /** Selection changed (tap or best-available). */
382
408
  onSelectionChange?: (seats: PickerSeat[]) => void;
409
+ /**
410
+ * Active hold changed because it was created, restored, extended, partially
411
+ * released, or fully released. Hosts should persist this state for route
412
+ * navigation and clear their checkout cart when `hold` becomes null.
413
+ */
414
+ onHoldChange?: (hold: HoldResult | null, seats: PickerSeat[], handoff: CheckoutHandoff | null) => void;
383
415
  /** The open hold expired server-side (widget already reset itself). */
384
416
  onHoldExpired?: () => void;
417
+ /** A prior active hold was verified and restored into the tray. */
418
+ onHoldRestored?: (hold: HoldResult, seats: PickerSeat[], handoff: CheckoutHandoff) => void;
385
419
  /** Modal only: the buyer closed the picker (ESC / scrim / ✕). */
386
420
  onClose?: () => void;
387
421
  onError?: (err: unknown) => void;
388
422
  }
389
423
  declare class SeatPicker {
390
424
  private readonly opts;
425
+ private readonly api;
426
+ private readonly apiBase;
391
427
  private readonly controller;
392
428
  private root;
393
429
  private mapHost;
@@ -399,6 +435,8 @@ declare class SeatPicker {
399
435
  private ro;
400
436
  private holdTimer;
401
437
  private toastTimer;
438
+ /** Short-lived UI motion timers; all are cancelled on destroy. */
439
+ private motionTimers;
402
440
  private currency;
403
441
  private hold;
404
442
  /** Latest server expiry for the open hold (moves on extend). */
@@ -438,6 +476,15 @@ declare class SeatPicker {
438
476
  private secCardShownAt;
439
477
  /** Previous tray ticket count — first 0→n transition auto-expands the mobile sheet. */
440
478
  private lastTrayCount;
479
+ /** Previous computed total — drives a single explanatory value bump. */
480
+ private lastTrayTotal;
481
+ /** Stable item keys prevent tray chips re-animating on unrelated realtime syncs. */
482
+ private lastTrayKeys;
483
+ private bestAvailableBusy;
484
+ private releasingLabels;
485
+ /** Selected labels awaiting the hold response; their own realtime echo can arrive first. */
486
+ private holdingLabels;
487
+ private ctaPhase;
441
488
  private a11yChipsEl;
442
489
  private cbEl;
443
490
  private modalScrim;
@@ -476,6 +523,27 @@ declare class SeatPicker {
476
523
  private buildRegions;
477
524
  /** Read a resolved --sl-* token value (canvas needs a real color, not var()). */
478
525
  private cssVar;
526
+ /** Motion is progressive enhancement; all state remains legible when reduced. */
527
+ private reducedMotion;
528
+ private scheduleMotion;
529
+ /** Restart one finite CSS animation without leaving a permanent state class. */
530
+ private animateOnce;
531
+ /** Selection feedback belongs on the selected seat, not across the whole map. */
532
+ private flashPickedSeat;
533
+ /** A completed hold gets one short map ripple per concrete seat. */
534
+ private flashHeldSeats;
535
+ /** Update only the action affordance; selection callbacks must not refire. */
536
+ private committedSelection;
537
+ private pendingSelectionCount;
538
+ private syncCta;
539
+ private setCtaPhase;
540
+ /** Session-scoped capability key: isolated by API origin and event. */
541
+ private holdStorageKey;
542
+ private rememberedHoldId;
543
+ private rememberHold;
544
+ private forgetHold;
545
+ private resumeHoldFromServer;
546
+ private restoreRememberedHold;
479
547
  /** Section-bearing objects on the active floor (single-floor → doc.objects). */
480
548
  private activeFloorObjects;
481
549
  /**
@@ -531,6 +599,9 @@ declare class SeatPicker {
531
599
  private announceSeat;
532
600
  private showConfirm;
533
601
  private reanchorConfirm;
602
+ private dismissConfirm;
603
+ private commitConfirm;
604
+ private cancelConfirm;
534
605
  private closeConfirm;
535
606
  private seatViewEnabled;
536
607
  /** Every bookable seat (cached) — neighbor heads for the generated panorama. */
@@ -548,6 +619,7 @@ declare class SeatPicker {
548
619
  /** A live delta took one of OUR selected (not yet held) seats — evict + tell the buyer. */
549
620
  private evictTakenSelections;
550
621
  private syncTray;
622
+ private removeHeldLabel;
551
623
  private handleCta;
552
624
  private startHoldTimer;
553
625
  private stopHoldTimer;
@@ -566,10 +638,17 @@ declare class SeatPicker {
566
638
  private showBooked;
567
639
  /** Assemble the stable {@link CheckoutHandoff} from a hold's server line items. */
568
640
  private buildHandoff;
641
+ private emitHoldChange;
569
642
  private toast;
570
643
  private placeTooltip;
571
644
  private updateTooltip;
572
645
  getSelection(): PickerSeat[];
646
+ /** Current active/restored hold reflected in the tray. */
647
+ getCurrentHold(): HoldResult | null;
648
+ /** Explicit host-driven hold restore (automatic session restore is on by default). */
649
+ resumeHold(holdId: string): Promise<HoldResult | null>;
650
+ /** Remove one server-held ticket while keeping the rest of the hold active. */
651
+ removeHeldTicket(label: string): Promise<boolean>;
573
652
  bestAvailable(qty: number, categoryKey?: string): Promise<HoldResult | null>;
574
653
  release(): Promise<void>;
575
654
  destroy(): void;
@@ -1046,4 +1125,4 @@ declare class SeatManager {
1046
1125
  private fail;
1047
1126
  }
1048
1127
 
1049
- 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 };
1128
+ 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, type ResumedHoldResult, 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
@@ -42,6 +42,10 @@ interface HoldResult {
42
42
  seats?: PickerSeat[];
43
43
  items?: HoldLineItem[];
44
44
  }
45
+ /** Browser-safe active-hold projection returned by the resume endpoint. */
46
+ interface ResumedHoldResult extends HoldResult {
47
+ items: HoldLineItem[];
48
+ }
45
49
  /** Best-available response — the server-picked seats plus the hold they landed in. */
46
50
  interface BestAvailableResult {
47
51
  holdId: string;
@@ -121,6 +125,8 @@ interface SeatingChartOptions {
121
125
  onSeatHover?: (details: SeatHoverDetails | null) => void;
122
126
  onSelectionChange?: (seats: SelectedSeat[]) => void;
123
127
  onHold?: (result: HoldResult) => void;
128
+ /** A prior active hold was restored with resumeHold(). */
129
+ onHoldRestored?: (result: HoldResult) => void;
124
130
  onHoldExpired?: () => void;
125
131
  onGAClick?: (area: GAAreaAvailability) => void;
126
132
  onError?: (err: unknown) => void;
@@ -159,6 +165,10 @@ declare class SeatingChart {
159
165
  hold(options?: {
160
166
  ttlMs?: number;
161
167
  }): Promise<HoldResult | null>;
168
+ /** Restore an active hold by its opaque id without extending its expiry. */
169
+ resumeHold(holdId: string): Promise<HoldResult | null>;
170
+ /** Current active hold known to this chart, if any. */
171
+ getCurrentHold(): HoldResult | null;
162
172
  getGAAreas(): GAAreaAvailability[];
163
173
  holdGA(areaId: string, qty: number, options?: {
164
174
  tierId?: string | null;
@@ -195,6 +205,8 @@ declare class SeatingChart {
195
205
  zoomToFit(): void;
196
206
  /** Release the current hold (if any). No-op when nothing is held. */
197
207
  release(): Promise<void>;
208
+ /** Release selected labels from the current hold while keeping the remainder. */
209
+ releaseLabels(labels: string[]): Promise<boolean>;
198
210
  /** Tear everything down: close the socket, stop timers, drop the canvas. */
199
211
  destroy(): void;
200
212
  }
@@ -354,8 +366,22 @@ interface SeatPickerOptions {
354
366
  /** Hold TTL in ms passed to hold(); server clamps to its own limits. */
355
367
  holdTtlMs?: number;
356
368
  /**
357
- * Confirm mode: tapping a seat shows an anchored popover (seat · category ·
358
- * price · Add/Cancel) instead of adding straight to the tray. Default false.
369
+ * An opaque hold id supplied by the host to restore after navigation. It is
370
+ * verified against the event and active server state before anything renders
371
+ * as owned by this buyer.
372
+ */
373
+ initialHoldId?: string;
374
+ /**
375
+ * Automatically remember the active hold id in sessionStorage and restore it
376
+ * when this event's picker mounts again. Default true. Set false when the host
377
+ * owns hold persistence and supplies initialHoldId itself.
378
+ */
379
+ restoreHold?: boolean;
380
+ /**
381
+ * Confirm mode: tapping a seat shows a confirmation card with section, row,
382
+ * seat, category, price and Select/Cancel before it enters the tray. Default
383
+ * true for the full buyer picker; set false only when the host supplies its
384
+ * own equivalent confirmation UI.
359
385
  */
360
386
  confirmSelection?: boolean;
361
387
  /**
@@ -380,14 +406,24 @@ interface SeatPickerOptions {
380
406
  onBooked?: (handoff: CheckoutHandoff) => void;
381
407
  /** Selection changed (tap or best-available). */
382
408
  onSelectionChange?: (seats: PickerSeat[]) => void;
409
+ /**
410
+ * Active hold changed because it was created, restored, extended, partially
411
+ * released, or fully released. Hosts should persist this state for route
412
+ * navigation and clear their checkout cart when `hold` becomes null.
413
+ */
414
+ onHoldChange?: (hold: HoldResult | null, seats: PickerSeat[], handoff: CheckoutHandoff | null) => void;
383
415
  /** The open hold expired server-side (widget already reset itself). */
384
416
  onHoldExpired?: () => void;
417
+ /** A prior active hold was verified and restored into the tray. */
418
+ onHoldRestored?: (hold: HoldResult, seats: PickerSeat[], handoff: CheckoutHandoff) => void;
385
419
  /** Modal only: the buyer closed the picker (ESC / scrim / ✕). */
386
420
  onClose?: () => void;
387
421
  onError?: (err: unknown) => void;
388
422
  }
389
423
  declare class SeatPicker {
390
424
  private readonly opts;
425
+ private readonly api;
426
+ private readonly apiBase;
391
427
  private readonly controller;
392
428
  private root;
393
429
  private mapHost;
@@ -399,6 +435,8 @@ declare class SeatPicker {
399
435
  private ro;
400
436
  private holdTimer;
401
437
  private toastTimer;
438
+ /** Short-lived UI motion timers; all are cancelled on destroy. */
439
+ private motionTimers;
402
440
  private currency;
403
441
  private hold;
404
442
  /** Latest server expiry for the open hold (moves on extend). */
@@ -438,6 +476,15 @@ declare class SeatPicker {
438
476
  private secCardShownAt;
439
477
  /** Previous tray ticket count — first 0→n transition auto-expands the mobile sheet. */
440
478
  private lastTrayCount;
479
+ /** Previous computed total — drives a single explanatory value bump. */
480
+ private lastTrayTotal;
481
+ /** Stable item keys prevent tray chips re-animating on unrelated realtime syncs. */
482
+ private lastTrayKeys;
483
+ private bestAvailableBusy;
484
+ private releasingLabels;
485
+ /** Selected labels awaiting the hold response; their own realtime echo can arrive first. */
486
+ private holdingLabels;
487
+ private ctaPhase;
441
488
  private a11yChipsEl;
442
489
  private cbEl;
443
490
  private modalScrim;
@@ -476,6 +523,27 @@ declare class SeatPicker {
476
523
  private buildRegions;
477
524
  /** Read a resolved --sl-* token value (canvas needs a real color, not var()). */
478
525
  private cssVar;
526
+ /** Motion is progressive enhancement; all state remains legible when reduced. */
527
+ private reducedMotion;
528
+ private scheduleMotion;
529
+ /** Restart one finite CSS animation without leaving a permanent state class. */
530
+ private animateOnce;
531
+ /** Selection feedback belongs on the selected seat, not across the whole map. */
532
+ private flashPickedSeat;
533
+ /** A completed hold gets one short map ripple per concrete seat. */
534
+ private flashHeldSeats;
535
+ /** Update only the action affordance; selection callbacks must not refire. */
536
+ private committedSelection;
537
+ private pendingSelectionCount;
538
+ private syncCta;
539
+ private setCtaPhase;
540
+ /** Session-scoped capability key: isolated by API origin and event. */
541
+ private holdStorageKey;
542
+ private rememberedHoldId;
543
+ private rememberHold;
544
+ private forgetHold;
545
+ private resumeHoldFromServer;
546
+ private restoreRememberedHold;
479
547
  /** Section-bearing objects on the active floor (single-floor → doc.objects). */
480
548
  private activeFloorObjects;
481
549
  /**
@@ -531,6 +599,9 @@ declare class SeatPicker {
531
599
  private announceSeat;
532
600
  private showConfirm;
533
601
  private reanchorConfirm;
602
+ private dismissConfirm;
603
+ private commitConfirm;
604
+ private cancelConfirm;
534
605
  private closeConfirm;
535
606
  private seatViewEnabled;
536
607
  /** Every bookable seat (cached) — neighbor heads for the generated panorama. */
@@ -548,6 +619,7 @@ declare class SeatPicker {
548
619
  /** A live delta took one of OUR selected (not yet held) seats — evict + tell the buyer. */
549
620
  private evictTakenSelections;
550
621
  private syncTray;
622
+ private removeHeldLabel;
551
623
  private handleCta;
552
624
  private startHoldTimer;
553
625
  private stopHoldTimer;
@@ -566,10 +638,17 @@ declare class SeatPicker {
566
638
  private showBooked;
567
639
  /** Assemble the stable {@link CheckoutHandoff} from a hold's server line items. */
568
640
  private buildHandoff;
641
+ private emitHoldChange;
569
642
  private toast;
570
643
  private placeTooltip;
571
644
  private updateTooltip;
572
645
  getSelection(): PickerSeat[];
646
+ /** Current active/restored hold reflected in the tray. */
647
+ getCurrentHold(): HoldResult | null;
648
+ /** Explicit host-driven hold restore (automatic session restore is on by default). */
649
+ resumeHold(holdId: string): Promise<HoldResult | null>;
650
+ /** Remove one server-held ticket while keeping the rest of the hold active. */
651
+ removeHeldTicket(label: string): Promise<boolean>;
573
652
  bestAvailable(qty: number, categoryKey?: string): Promise<HoldResult | null>;
574
653
  release(): Promise<void>;
575
654
  destroy(): void;
@@ -1046,4 +1125,4 @@ declare class SeatManager {
1046
1125
  private fail;
1047
1126
  }
1048
1127
 
1049
- 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 };
1128
+ 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, type ResumedHoldResult, SeatManager, type SeatManagerActionResult, type SeatManagerActivity, type SeatManagerMode, type SeatManagerOptions, type SeatManagerTallies, SeatPicker, type SeatPickerOptions, type SeatPickerTheme, SeatingChart, type SeatingChartOptions, type SelectedSeat };