@seatlayer/js 0.14.0 → 0.15.1
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/README.md +6 -2
- package/dist/index.cjs +328 -51
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +60 -3
- package/dist/index.d.ts +60 -3
- package/dist/index.js +328 -51
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
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
|
-
*
|
|
358
|
-
*
|
|
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,8 +406,16 @@ 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;
|
|
@@ -389,6 +423,7 @@ interface SeatPickerOptions {
|
|
|
389
423
|
declare class SeatPicker {
|
|
390
424
|
private readonly opts;
|
|
391
425
|
private readonly api;
|
|
426
|
+
private readonly apiBase;
|
|
392
427
|
private readonly controller;
|
|
393
428
|
private root;
|
|
394
429
|
private mapHost;
|
|
@@ -446,6 +481,9 @@ declare class SeatPicker {
|
|
|
446
481
|
/** Stable item keys prevent tray chips re-animating on unrelated realtime syncs. */
|
|
447
482
|
private lastTrayKeys;
|
|
448
483
|
private bestAvailableBusy;
|
|
484
|
+
private releasingLabels;
|
|
485
|
+
/** Selected labels awaiting the hold response; their own realtime echo can arrive first. */
|
|
486
|
+
private holdingLabels;
|
|
449
487
|
private ctaPhase;
|
|
450
488
|
private a11yChipsEl;
|
|
451
489
|
private cbEl;
|
|
@@ -495,9 +533,17 @@ declare class SeatPicker {
|
|
|
495
533
|
/** A completed hold gets one short map ripple per concrete seat. */
|
|
496
534
|
private flashHeldSeats;
|
|
497
535
|
/** Update only the action affordance; selection callbacks must not refire. */
|
|
536
|
+
private committedSelection;
|
|
498
537
|
private pendingSelectionCount;
|
|
499
538
|
private syncCta;
|
|
500
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;
|
|
501
547
|
/** Section-bearing objects on the active floor (single-floor → doc.objects). */
|
|
502
548
|
private activeFloorObjects;
|
|
503
549
|
/**
|
|
@@ -553,6 +599,9 @@ declare class SeatPicker {
|
|
|
553
599
|
private announceSeat;
|
|
554
600
|
private showConfirm;
|
|
555
601
|
private reanchorConfirm;
|
|
602
|
+
private dismissConfirm;
|
|
603
|
+
private commitConfirm;
|
|
604
|
+
private cancelConfirm;
|
|
556
605
|
private closeConfirm;
|
|
557
606
|
private seatViewEnabled;
|
|
558
607
|
/** Every bookable seat (cached) — neighbor heads for the generated panorama. */
|
|
@@ -570,6 +619,7 @@ declare class SeatPicker {
|
|
|
570
619
|
/** A live delta took one of OUR selected (not yet held) seats — evict + tell the buyer. */
|
|
571
620
|
private evictTakenSelections;
|
|
572
621
|
private syncTray;
|
|
622
|
+
private removeHeldLabel;
|
|
573
623
|
private handleCta;
|
|
574
624
|
private startHoldTimer;
|
|
575
625
|
private stopHoldTimer;
|
|
@@ -588,10 +638,17 @@ declare class SeatPicker {
|
|
|
588
638
|
private showBooked;
|
|
589
639
|
/** Assemble the stable {@link CheckoutHandoff} from a hold's server line items. */
|
|
590
640
|
private buildHandoff;
|
|
641
|
+
private emitHoldChange;
|
|
591
642
|
private toast;
|
|
592
643
|
private placeTooltip;
|
|
593
644
|
private updateTooltip;
|
|
594
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>;
|
|
595
652
|
bestAvailable(qty: number, categoryKey?: string): Promise<HoldResult | null>;
|
|
596
653
|
release(): Promise<void>;
|
|
597
654
|
destroy(): void;
|
|
@@ -1068,4 +1125,4 @@ declare class SeatManager {
|
|
|
1068
1125
|
private fail;
|
|
1069
1126
|
}
|
|
1070
1127
|
|
|
1071
|
-
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
|
-
*
|
|
358
|
-
*
|
|
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,8 +406,16 @@ 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;
|
|
@@ -389,6 +423,7 @@ interface SeatPickerOptions {
|
|
|
389
423
|
declare class SeatPicker {
|
|
390
424
|
private readonly opts;
|
|
391
425
|
private readonly api;
|
|
426
|
+
private readonly apiBase;
|
|
392
427
|
private readonly controller;
|
|
393
428
|
private root;
|
|
394
429
|
private mapHost;
|
|
@@ -446,6 +481,9 @@ declare class SeatPicker {
|
|
|
446
481
|
/** Stable item keys prevent tray chips re-animating on unrelated realtime syncs. */
|
|
447
482
|
private lastTrayKeys;
|
|
448
483
|
private bestAvailableBusy;
|
|
484
|
+
private releasingLabels;
|
|
485
|
+
/** Selected labels awaiting the hold response; their own realtime echo can arrive first. */
|
|
486
|
+
private holdingLabels;
|
|
449
487
|
private ctaPhase;
|
|
450
488
|
private a11yChipsEl;
|
|
451
489
|
private cbEl;
|
|
@@ -495,9 +533,17 @@ declare class SeatPicker {
|
|
|
495
533
|
/** A completed hold gets one short map ripple per concrete seat. */
|
|
496
534
|
private flashHeldSeats;
|
|
497
535
|
/** Update only the action affordance; selection callbacks must not refire. */
|
|
536
|
+
private committedSelection;
|
|
498
537
|
private pendingSelectionCount;
|
|
499
538
|
private syncCta;
|
|
500
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;
|
|
501
547
|
/** Section-bearing objects on the active floor (single-floor → doc.objects). */
|
|
502
548
|
private activeFloorObjects;
|
|
503
549
|
/**
|
|
@@ -553,6 +599,9 @@ declare class SeatPicker {
|
|
|
553
599
|
private announceSeat;
|
|
554
600
|
private showConfirm;
|
|
555
601
|
private reanchorConfirm;
|
|
602
|
+
private dismissConfirm;
|
|
603
|
+
private commitConfirm;
|
|
604
|
+
private cancelConfirm;
|
|
556
605
|
private closeConfirm;
|
|
557
606
|
private seatViewEnabled;
|
|
558
607
|
/** Every bookable seat (cached) — neighbor heads for the generated panorama. */
|
|
@@ -570,6 +619,7 @@ declare class SeatPicker {
|
|
|
570
619
|
/** A live delta took one of OUR selected (not yet held) seats — evict + tell the buyer. */
|
|
571
620
|
private evictTakenSelections;
|
|
572
621
|
private syncTray;
|
|
622
|
+
private removeHeldLabel;
|
|
573
623
|
private handleCta;
|
|
574
624
|
private startHoldTimer;
|
|
575
625
|
private stopHoldTimer;
|
|
@@ -588,10 +638,17 @@ declare class SeatPicker {
|
|
|
588
638
|
private showBooked;
|
|
589
639
|
/** Assemble the stable {@link CheckoutHandoff} from a hold's server line items. */
|
|
590
640
|
private buildHandoff;
|
|
641
|
+
private emitHoldChange;
|
|
591
642
|
private toast;
|
|
592
643
|
private placeTooltip;
|
|
593
644
|
private updateTooltip;
|
|
594
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>;
|
|
595
652
|
bestAvailable(qty: number, categoryKey?: string): Promise<HoldResult | null>;
|
|
596
653
|
release(): Promise<void>;
|
|
597
654
|
destroy(): void;
|
|
@@ -1068,4 +1125,4 @@ declare class SeatManager {
|
|
|
1068
1125
|
private fail;
|
|
1069
1126
|
}
|
|
1070
1127
|
|
|
1071
|
-
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 };
|