@seatlayer/core 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/dist/index.d.cts CHANGED
@@ -433,6 +433,19 @@ interface ISeatmapRenderer {
433
433
  }): void;
434
434
  /** Bulk status update; re-renders affected seats only. */
435
435
  setStatus(seatIds: string[], status: SeatStatus): void;
436
+ /**
437
+ * Mark the active buyer's own held seats. They remain server-status `held`,
438
+ * but render with the buyer selection treatment instead of the anonymous
439
+ * unavailable treatment used for another buyer's hold.
440
+ */
441
+ setOwnedHold?(seatIds: string[] | null): void;
442
+ /**
443
+ * Mark one selected seat as the buyer's pending confirmation candidate.
444
+ * The candidate receives a strong focus halo while unrelated seats recede;
445
+ * pass null after Select/Cancel. This is visual only and never mutates the
446
+ * renderer selection.
447
+ */
448
+ setSelectionFocus?(seatId: string | null): void;
436
449
  /**
437
450
  * SYNCHRONOUS repaint that bypasses requestAnimationFrame. Konva's batchDraw()
438
451
  * (used by setStatus and friends) schedules the actual paint on the next rAF
@@ -774,6 +787,8 @@ declare class SeatmapRenderer implements ISeatmapRenderer {
774
787
  private circleById;
775
788
  /** Booth block geometry, keyed by booth id (= the unit's rowId). */
776
789
  private boothDims;
790
+ /** Booth label node so status changes can say HELD/SOLD on the full block. */
791
+ private boothLabelById;
777
792
  private statusById;
778
793
  private catColor;
779
794
  private theme;
@@ -784,7 +799,12 @@ declare class SeatmapRenderer implements ISeatmapRenderer {
784
799
  /** Category order from the doc — the stable index into the CB palette. */
785
800
  private catOrder;
786
801
  private selection;
787
- private selectionRings;
802
+ /** Whole-seat/block selection markers: outline + non-colour check cue. */
803
+ private selectionMarkers;
804
+ /** Held by this picker instance, not by another buyer. */
805
+ private ownedHold;
806
+ /** One selected seat being inspected before it is committed to the cart. */
807
+ private selectionFocusId;
788
808
  private hoverRing;
789
809
  /** Keyboard-navigation focus ring + the currently focused seat id. */
790
810
  private focusRing;
@@ -852,7 +872,9 @@ declare class SeatmapRenderer implements ISeatmapRenderer {
852
872
  private pointers;
853
873
  private pinch;
854
874
  private panLast;
855
- /** Cumulative gesture movement in px — clicks are suppressed after a real pan/pinch. */
875
+ private panStart;
876
+ private panStarted;
877
+ /** Maximum displacement from gesture start — suppress taps only after a real pan/pinch. */
856
878
  private moved;
857
879
  /**
858
880
  * Manage-mode rubber-band marquee (option-gated). `start`/`cur` are WORLD-space
@@ -881,6 +903,8 @@ declare class SeatmapRenderer implements ISeatmapRenderer {
881
903
  }[];
882
904
  getActiveFloorId(): string;
883
905
  setStatus(seatIds: string[], status: SeatStatus): void;
906
+ setOwnedHold(seatIds: string[] | null): void;
907
+ setSelectionFocus(seatId: string | null): void;
884
908
  getStatus(seatId: string): SeatStatus;
885
909
  getSelection(): ExpandedSeat[];
886
910
  clearSelection(): void;
@@ -1138,6 +1162,8 @@ declare class SeatmapRenderer implements ISeatmapRenderer {
1138
1162
  */
1139
1163
  private resolveSelectionColor;
1140
1164
  private setSelected;
1165
+ /** Rebuild one marker after selected/held/candidate state changes. */
1166
+ private syncSelectionMarker;
1141
1167
  /**
1142
1168
  * The stage scale `focusRegion(id)` would settle at — i.e. the zoom that
1143
1169
  * frames this section in the current viewport. Used to decide whether
@@ -1200,6 +1226,7 @@ declare class SeatmapRenderer implements ISeatmapRenderer {
1200
1226
  height: number;
1201
1227
  }, opts?: {
1202
1228
  animate?: boolean;
1229
+ minScale?: number;
1203
1230
  }): void;
1204
1231
  /** Cancel an in-flight camera glide (a grab or a newer glide interrupts it). */
1205
1232
  private cancelGlide;
@@ -1255,6 +1282,10 @@ interface SeatHoverDetails extends PickerSeat {
1255
1282
  categoryColor: string;
1256
1283
  status: SeatStatus;
1257
1284
  currency: string;
1285
+ /** Human-readable spatial context for hover and confirmation UI. */
1286
+ sectionLabel?: string;
1287
+ rowLabel?: string;
1288
+ seatNumber?: string;
1258
1289
  }
1259
1290
  interface HoldConflict {
1260
1291
  label: string;
@@ -1302,6 +1333,9 @@ interface HoldResponse {
1302
1333
  expiresAt: number;
1303
1334
  items?: HoldServerItem[];
1304
1335
  }
1336
+ interface ResumeHoldResponse extends HoldResponse {
1337
+ items: HoldServerItem[];
1338
+ }
1305
1339
  interface HoldServerItem {
1306
1340
  label: string;
1307
1341
  objectId: string;
@@ -1341,6 +1375,8 @@ interface PickerTransport {
1341
1375
  hold(key: string, selections: HoldSelectionRequest[], ttlMs?: number, replaceHoldId?: string): Promise<HoldResponse>;
1342
1376
  bestAvailable(key: string, qty: number, categoryKey?: string): Promise<BestAvailableResponse>;
1343
1377
  release(key: string, labels: string[], holdId: string): Promise<unknown>;
1378
+ /** Optional capability-style lookup used to restore an active browser hold. */
1379
+ resume?(key: string, holdId: string): Promise<ResumeHoldResponse>;
1344
1380
  /** Optional — the SDK omits booking (it hands the holdId to the host page). */
1345
1381
  book?(key: string, labels: string[], holdId: string, bookingRef: string): Promise<unknown>;
1346
1382
  /** Optional (P4) — push an active hold's expiry out ("need more time?"). */
@@ -1356,6 +1392,8 @@ interface PickerCallbacks extends RendererCallbacks {
1356
1392
  onSelectionChange?: (seats: PickerSeat[]) => void;
1357
1393
  /** A hold opened (manual hold or best-available). */
1358
1394
  onHold?: (hold: HoldInfo) => void;
1395
+ /** A prior active hold was restored from its opaque hold id. */
1396
+ onHoldRestored?: (hold: HoldInfo) => void;
1359
1397
  /** The open hold expired server-side (the controller has already released it). */
1360
1398
  onHoldExpired?: () => void;
1361
1399
  /** A booking completed with this ref. */
@@ -1430,6 +1468,8 @@ declare class PickerController {
1430
1468
  private seatTiers;
1431
1469
  /** id → seat, for the section-summary breakdown (renderer members are ids). */
1432
1470
  private seatById;
1471
+ /** id → buyer-facing spatial metadata used by every tooltip/confirm surface. */
1472
+ private seatContext;
1433
1473
  private allIds;
1434
1474
  private ws;
1435
1475
  private reconnectTimer;
@@ -1470,6 +1510,8 @@ declare class PickerController {
1470
1510
  mode?: string;
1471
1511
  } | null>;
1472
1512
  getSelection(): PickerSeat[];
1513
+ /** Enriched metadata for a seat confirmation card or tooltip. */
1514
+ seatDetails(seatId: string): SeatHoverDetails | null;
1473
1515
  clearSelection(): void;
1474
1516
  deselect(ids: string[]): void;
1475
1517
  /**
@@ -1479,6 +1521,8 @@ declare class PickerController {
1479
1521
  * there's nothing to hold.
1480
1522
  */
1481
1523
  hold(labelsArg?: string[], ttlMs?: number): Promise<HoldInfo | null>;
1524
+ /** Restore an active server hold without creating or extending inventory. */
1525
+ resumeHold(holdId: string): Promise<HoldInfo | null>;
1482
1526
  /**
1483
1527
  * P4 "need more time?": extend the OPEN hold's server-side expiry and re-arm
1484
1528
  * the client expiry timer to match (via setHold), so the controller doesn't
@@ -1523,12 +1567,14 @@ declare class PickerController {
1523
1567
  */
1524
1568
  book(bookingRef: string, labelsArg?: string[]): Promise<string[] | null>;
1525
1569
  /** Release the whole open hold (if any), repaint those seats free. */
1526
- release(): Promise<void>;
1570
+ release(): Promise<boolean>;
1527
1571
  /**
1528
1572
  * Release just some labels from the open hold, keeping the rest held (used when
1529
1573
  * a buyer removes one seat chip). Clears the hold entirely once it empties.
1530
1574
  */
1531
- releaseLabels(labels: string[]): Promise<void>;
1575
+ releaseLabels(labels: string[]): Promise<boolean>;
1576
+ /** New transports return the exact labels released; tolerate older adapters. */
1577
+ private releaseConfirmed;
1532
1578
  setStatus(ids: string[], status: SeatStatus): void;
1533
1579
  getStatus(id: string): SeatStatus | undefined;
1534
1580
  flashSeat(id: string, color?: string): void;
@@ -1542,6 +1588,7 @@ declare class PickerController {
1542
1588
  x: number;
1543
1589
  y: number;
1544
1590
  };
1591
+ setSelectionFocus(seatId: string | null): void;
1545
1592
  setAccessibilityFilter(types: string[] | null): void;
1546
1593
  /** Floors for the buyer's switcher (>1 ⇒ show it). Single-floor ⇒ one entry. */
1547
1594
  getFloors(): {
package/dist/index.d.ts CHANGED
@@ -433,6 +433,19 @@ interface ISeatmapRenderer {
433
433
  }): void;
434
434
  /** Bulk status update; re-renders affected seats only. */
435
435
  setStatus(seatIds: string[], status: SeatStatus): void;
436
+ /**
437
+ * Mark the active buyer's own held seats. They remain server-status `held`,
438
+ * but render with the buyer selection treatment instead of the anonymous
439
+ * unavailable treatment used for another buyer's hold.
440
+ */
441
+ setOwnedHold?(seatIds: string[] | null): void;
442
+ /**
443
+ * Mark one selected seat as the buyer's pending confirmation candidate.
444
+ * The candidate receives a strong focus halo while unrelated seats recede;
445
+ * pass null after Select/Cancel. This is visual only and never mutates the
446
+ * renderer selection.
447
+ */
448
+ setSelectionFocus?(seatId: string | null): void;
436
449
  /**
437
450
  * SYNCHRONOUS repaint that bypasses requestAnimationFrame. Konva's batchDraw()
438
451
  * (used by setStatus and friends) schedules the actual paint on the next rAF
@@ -774,6 +787,8 @@ declare class SeatmapRenderer implements ISeatmapRenderer {
774
787
  private circleById;
775
788
  /** Booth block geometry, keyed by booth id (= the unit's rowId). */
776
789
  private boothDims;
790
+ /** Booth label node so status changes can say HELD/SOLD on the full block. */
791
+ private boothLabelById;
777
792
  private statusById;
778
793
  private catColor;
779
794
  private theme;
@@ -784,7 +799,12 @@ declare class SeatmapRenderer implements ISeatmapRenderer {
784
799
  /** Category order from the doc — the stable index into the CB palette. */
785
800
  private catOrder;
786
801
  private selection;
787
- private selectionRings;
802
+ /** Whole-seat/block selection markers: outline + non-colour check cue. */
803
+ private selectionMarkers;
804
+ /** Held by this picker instance, not by another buyer. */
805
+ private ownedHold;
806
+ /** One selected seat being inspected before it is committed to the cart. */
807
+ private selectionFocusId;
788
808
  private hoverRing;
789
809
  /** Keyboard-navigation focus ring + the currently focused seat id. */
790
810
  private focusRing;
@@ -852,7 +872,9 @@ declare class SeatmapRenderer implements ISeatmapRenderer {
852
872
  private pointers;
853
873
  private pinch;
854
874
  private panLast;
855
- /** Cumulative gesture movement in px — clicks are suppressed after a real pan/pinch. */
875
+ private panStart;
876
+ private panStarted;
877
+ /** Maximum displacement from gesture start — suppress taps only after a real pan/pinch. */
856
878
  private moved;
857
879
  /**
858
880
  * Manage-mode rubber-band marquee (option-gated). `start`/`cur` are WORLD-space
@@ -881,6 +903,8 @@ declare class SeatmapRenderer implements ISeatmapRenderer {
881
903
  }[];
882
904
  getActiveFloorId(): string;
883
905
  setStatus(seatIds: string[], status: SeatStatus): void;
906
+ setOwnedHold(seatIds: string[] | null): void;
907
+ setSelectionFocus(seatId: string | null): void;
884
908
  getStatus(seatId: string): SeatStatus;
885
909
  getSelection(): ExpandedSeat[];
886
910
  clearSelection(): void;
@@ -1138,6 +1162,8 @@ declare class SeatmapRenderer implements ISeatmapRenderer {
1138
1162
  */
1139
1163
  private resolveSelectionColor;
1140
1164
  private setSelected;
1165
+ /** Rebuild one marker after selected/held/candidate state changes. */
1166
+ private syncSelectionMarker;
1141
1167
  /**
1142
1168
  * The stage scale `focusRegion(id)` would settle at — i.e. the zoom that
1143
1169
  * frames this section in the current viewport. Used to decide whether
@@ -1200,6 +1226,7 @@ declare class SeatmapRenderer implements ISeatmapRenderer {
1200
1226
  height: number;
1201
1227
  }, opts?: {
1202
1228
  animate?: boolean;
1229
+ minScale?: number;
1203
1230
  }): void;
1204
1231
  /** Cancel an in-flight camera glide (a grab or a newer glide interrupts it). */
1205
1232
  private cancelGlide;
@@ -1255,6 +1282,10 @@ interface SeatHoverDetails extends PickerSeat {
1255
1282
  categoryColor: string;
1256
1283
  status: SeatStatus;
1257
1284
  currency: string;
1285
+ /** Human-readable spatial context for hover and confirmation UI. */
1286
+ sectionLabel?: string;
1287
+ rowLabel?: string;
1288
+ seatNumber?: string;
1258
1289
  }
1259
1290
  interface HoldConflict {
1260
1291
  label: string;
@@ -1302,6 +1333,9 @@ interface HoldResponse {
1302
1333
  expiresAt: number;
1303
1334
  items?: HoldServerItem[];
1304
1335
  }
1336
+ interface ResumeHoldResponse extends HoldResponse {
1337
+ items: HoldServerItem[];
1338
+ }
1305
1339
  interface HoldServerItem {
1306
1340
  label: string;
1307
1341
  objectId: string;
@@ -1341,6 +1375,8 @@ interface PickerTransport {
1341
1375
  hold(key: string, selections: HoldSelectionRequest[], ttlMs?: number, replaceHoldId?: string): Promise<HoldResponse>;
1342
1376
  bestAvailable(key: string, qty: number, categoryKey?: string): Promise<BestAvailableResponse>;
1343
1377
  release(key: string, labels: string[], holdId: string): Promise<unknown>;
1378
+ /** Optional capability-style lookup used to restore an active browser hold. */
1379
+ resume?(key: string, holdId: string): Promise<ResumeHoldResponse>;
1344
1380
  /** Optional — the SDK omits booking (it hands the holdId to the host page). */
1345
1381
  book?(key: string, labels: string[], holdId: string, bookingRef: string): Promise<unknown>;
1346
1382
  /** Optional (P4) — push an active hold's expiry out ("need more time?"). */
@@ -1356,6 +1392,8 @@ interface PickerCallbacks extends RendererCallbacks {
1356
1392
  onSelectionChange?: (seats: PickerSeat[]) => void;
1357
1393
  /** A hold opened (manual hold or best-available). */
1358
1394
  onHold?: (hold: HoldInfo) => void;
1395
+ /** A prior active hold was restored from its opaque hold id. */
1396
+ onHoldRestored?: (hold: HoldInfo) => void;
1359
1397
  /** The open hold expired server-side (the controller has already released it). */
1360
1398
  onHoldExpired?: () => void;
1361
1399
  /** A booking completed with this ref. */
@@ -1430,6 +1468,8 @@ declare class PickerController {
1430
1468
  private seatTiers;
1431
1469
  /** id → seat, for the section-summary breakdown (renderer members are ids). */
1432
1470
  private seatById;
1471
+ /** id → buyer-facing spatial metadata used by every tooltip/confirm surface. */
1472
+ private seatContext;
1433
1473
  private allIds;
1434
1474
  private ws;
1435
1475
  private reconnectTimer;
@@ -1470,6 +1510,8 @@ declare class PickerController {
1470
1510
  mode?: string;
1471
1511
  } | null>;
1472
1512
  getSelection(): PickerSeat[];
1513
+ /** Enriched metadata for a seat confirmation card or tooltip. */
1514
+ seatDetails(seatId: string): SeatHoverDetails | null;
1473
1515
  clearSelection(): void;
1474
1516
  deselect(ids: string[]): void;
1475
1517
  /**
@@ -1479,6 +1521,8 @@ declare class PickerController {
1479
1521
  * there's nothing to hold.
1480
1522
  */
1481
1523
  hold(labelsArg?: string[], ttlMs?: number): Promise<HoldInfo | null>;
1524
+ /** Restore an active server hold without creating or extending inventory. */
1525
+ resumeHold(holdId: string): Promise<HoldInfo | null>;
1482
1526
  /**
1483
1527
  * P4 "need more time?": extend the OPEN hold's server-side expiry and re-arm
1484
1528
  * the client expiry timer to match (via setHold), so the controller doesn't
@@ -1523,12 +1567,14 @@ declare class PickerController {
1523
1567
  */
1524
1568
  book(bookingRef: string, labelsArg?: string[]): Promise<string[] | null>;
1525
1569
  /** Release the whole open hold (if any), repaint those seats free. */
1526
- release(): Promise<void>;
1570
+ release(): Promise<boolean>;
1527
1571
  /**
1528
1572
  * Release just some labels from the open hold, keeping the rest held (used when
1529
1573
  * a buyer removes one seat chip). Clears the hold entirely once it empties.
1530
1574
  */
1531
- releaseLabels(labels: string[]): Promise<void>;
1575
+ releaseLabels(labels: string[]): Promise<boolean>;
1576
+ /** New transports return the exact labels released; tolerate older adapters. */
1577
+ private releaseConfirmed;
1532
1578
  setStatus(ids: string[], status: SeatStatus): void;
1533
1579
  getStatus(id: string): SeatStatus | undefined;
1534
1580
  flashSeat(id: string, color?: string): void;
@@ -1542,6 +1588,7 @@ declare class PickerController {
1542
1588
  x: number;
1543
1589
  y: number;
1544
1590
  };
1591
+ setSelectionFocus(seatId: string | null): void;
1545
1592
  setAccessibilityFilter(types: string[] | null): void;
1546
1593
  /** Floors for the buyer's switcher (>1 ⇒ show it). Single-floor ⇒ one entry. */
1547
1594
  getFloors(): {