@seatlayer/js 0.29.0 → 0.30.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
@@ -115,8 +115,10 @@ interface SeatingChartOptions {
115
115
  * Toggleable later with setColorblindSafe().
116
116
  */
117
117
  colorblindSafe?: boolean;
118
- /** Initial canvas projection. `perspective` enables exact-seat projected
119
- * 2.5D picking without changing booking identities or chart geometry. */
118
+ /** Initial canvas projection.
119
+ * @deprecated `'isometric'` and `'perspective'` are retired in favour of the
120
+ * real 3D venue view (`setBuyerView('venue3d')`); they remain accepted for
121
+ * source compatibility and will be removed in the next major. Use `'flat'`. */
120
122
  initialView?: RendererViewMode;
121
123
  /**
122
124
  * Built-in seat tooltip on mouse hover (seat · category · price · status).
@@ -266,7 +268,10 @@ declare class SeatingChart {
266
268
  setFloor(floorId: string): void;
267
269
  /** Toggle colorblind-safe rendering at runtime (see options.colorblindSafe). */
268
270
  setColorblindSafe(on: boolean): void;
269
- /** Switch between flat, isometric and exact-seat Perspective 2.5D views. */
271
+ /** Switch the 2D canvas projection.
272
+ * @deprecated `'isometric'` and `'perspective'` are retired in favour of the
273
+ * real 3D venue view (`setBuyerView('venue3d')`); accepted for source
274
+ * compatibility until the next major. */
270
275
  setViewMode(mode: RendererViewMode): void;
271
276
  /** Current canvas projection. */
272
277
  getViewMode(): RendererViewMode;
@@ -1172,9 +1177,34 @@ declare class SeatPicker {
1172
1177
  private normalizeInitialView;
1173
1178
  /** Current buyer view: the flat map, or the interactive 3D venue. */
1174
1179
  getBuyerView(): 'map' | 'venue3d';
1175
- /** Toggle between the flat Map and the 3D venue view. No-op when unchanged or
1176
- * when 3D is unavailable. */
1177
- setBuyerView(view: 'map' | 'venue3d'): void;
1180
+ /**
1181
+ * Switch between the flat seat **Map** and the interactive **3D venue** view
1182
+ * the same control the buyer's on-widget `Map | 3D` toggle drives.
1183
+ *
1184
+ * Entering `'venue3d'` with `opts.flyToSeatId` runs the cinematic tour: the
1185
+ * camera flies to the seat and holds in the live scene (a chip offers the
1186
+ * 360° view-from-seat) —
1187
+ * the widget enters 3D and auto-flies the camera to that seat, dissolving into
1188
+ * its view-from-seat panorama (the same chain as tapping "See the view from
1189
+ * here" on a seat's confirm card). When the widget is **already** in the 3D
1190
+ * view, the camera simply flies to the requested seat — the GL scene is not
1191
+ * torn down or rebuilt, so there is no flash or re-entry.
1192
+ *
1193
+ * No-op when the view is unchanged and no `flyToSeatId` is given, or when 3D is
1194
+ * unavailable for this chart.
1195
+ *
1196
+ * @param view `'map'` for the flat picker, `'venue3d'` for the 3D venue.
1197
+ * @param opts.flyToSeatId When entering (or already in) `'venue3d'`, the seat
1198
+ * id to fly the camera to — cinematic → panorama.
1199
+ * Ignored when `view` is `'map'`.
1200
+ *
1201
+ * @example
1202
+ * // Public 3D tour entry — enter 3D and fly straight to the buyer's seat:
1203
+ * picker.setBuyerView('venue3d', { flyToSeatId: 'A-12' });
1204
+ */
1205
+ setBuyerView(view: 'map' | 'venue3d', opts?: {
1206
+ flyToSeatId?: string;
1207
+ }): void;
1178
1208
  /** SeatStatus → the view3d palette state. Selection is layered separately. */
1179
1209
  private seatState3dFor;
1180
1210
  /** Push the full live availability snapshot into the 3D handle (selection is
package/dist/index.d.ts CHANGED
@@ -115,8 +115,10 @@ interface SeatingChartOptions {
115
115
  * Toggleable later with setColorblindSafe().
116
116
  */
117
117
  colorblindSafe?: boolean;
118
- /** Initial canvas projection. `perspective` enables exact-seat projected
119
- * 2.5D picking without changing booking identities or chart geometry. */
118
+ /** Initial canvas projection.
119
+ * @deprecated `'isometric'` and `'perspective'` are retired in favour of the
120
+ * real 3D venue view (`setBuyerView('venue3d')`); they remain accepted for
121
+ * source compatibility and will be removed in the next major. Use `'flat'`. */
120
122
  initialView?: RendererViewMode;
121
123
  /**
122
124
  * Built-in seat tooltip on mouse hover (seat · category · price · status).
@@ -266,7 +268,10 @@ declare class SeatingChart {
266
268
  setFloor(floorId: string): void;
267
269
  /** Toggle colorblind-safe rendering at runtime (see options.colorblindSafe). */
268
270
  setColorblindSafe(on: boolean): void;
269
- /** Switch between flat, isometric and exact-seat Perspective 2.5D views. */
271
+ /** Switch the 2D canvas projection.
272
+ * @deprecated `'isometric'` and `'perspective'` are retired in favour of the
273
+ * real 3D venue view (`setBuyerView('venue3d')`); accepted for source
274
+ * compatibility until the next major. */
270
275
  setViewMode(mode: RendererViewMode): void;
271
276
  /** Current canvas projection. */
272
277
  getViewMode(): RendererViewMode;
@@ -1172,9 +1177,34 @@ declare class SeatPicker {
1172
1177
  private normalizeInitialView;
1173
1178
  /** Current buyer view: the flat map, or the interactive 3D venue. */
1174
1179
  getBuyerView(): 'map' | 'venue3d';
1175
- /** Toggle between the flat Map and the 3D venue view. No-op when unchanged or
1176
- * when 3D is unavailable. */
1177
- setBuyerView(view: 'map' | 'venue3d'): void;
1180
+ /**
1181
+ * Switch between the flat seat **Map** and the interactive **3D venue** view
1182
+ * the same control the buyer's on-widget `Map | 3D` toggle drives.
1183
+ *
1184
+ * Entering `'venue3d'` with `opts.flyToSeatId` runs the cinematic tour: the
1185
+ * camera flies to the seat and holds in the live scene (a chip offers the
1186
+ * 360° view-from-seat) —
1187
+ * the widget enters 3D and auto-flies the camera to that seat, dissolving into
1188
+ * its view-from-seat panorama (the same chain as tapping "See the view from
1189
+ * here" on a seat's confirm card). When the widget is **already** in the 3D
1190
+ * view, the camera simply flies to the requested seat — the GL scene is not
1191
+ * torn down or rebuilt, so there is no flash or re-entry.
1192
+ *
1193
+ * No-op when the view is unchanged and no `flyToSeatId` is given, or when 3D is
1194
+ * unavailable for this chart.
1195
+ *
1196
+ * @param view `'map'` for the flat picker, `'venue3d'` for the 3D venue.
1197
+ * @param opts.flyToSeatId When entering (or already in) `'venue3d'`, the seat
1198
+ * id to fly the camera to — cinematic → panorama.
1199
+ * Ignored when `view` is `'map'`.
1200
+ *
1201
+ * @example
1202
+ * // Public 3D tour entry — enter 3D and fly straight to the buyer's seat:
1203
+ * picker.setBuyerView('venue3d', { flyToSeatId: 'A-12' });
1204
+ */
1205
+ setBuyerView(view: 'map' | 'venue3d', opts?: {
1206
+ flyToSeatId?: string;
1207
+ }): void;
1178
1208
  /** SeatStatus → the view3d palette state. Selection is layered separately. */
1179
1209
  private seatState3dFor;
1180
1210
  /** Push the full live availability snapshot into the 3D handle (selection is
package/dist/index.js CHANGED
@@ -386,7 +386,10 @@ var SeatingChart = class {
386
386
  setColorblindSafe(on) {
387
387
  this.controller.setColorblindSafe(on);
388
388
  }
389
- /** Switch between flat, isometric and exact-seat Perspective 2.5D views. */
389
+ /** Switch the 2D canvas projection.
390
+ * @deprecated `'isometric'` and `'perspective'` are retired in favour of the
391
+ * real 3D venue view (`setBuyerView('venue3d')`); accepted for source
392
+ * compatibility until the next major. */
390
393
  setViewMode(mode) {
391
394
  this.controller.setViewMode(mode);
392
395
  }
@@ -4524,12 +4527,42 @@ var SeatPicker = class _SeatPicker {
4524
4527
  getBuyerView() {
4525
4528
  return this.buyerView;
4526
4529
  }
4527
- /** Toggle between the flat Map and the 3D venue view. No-op when unchanged or
4528
- * when 3D is unavailable. */
4529
- setBuyerView(view) {
4530
- if (view === this.buyerView) return;
4531
- if (view === "venue3d") void this.enter3d();
4532
- else this.exit3d();
4530
+ /**
4531
+ * Switch between the flat seat **Map** and the interactive **3D venue** view
4532
+ * the same control the buyer's on-widget `Map | 3D` toggle drives.
4533
+ *
4534
+ * Entering `'venue3d'` with `opts.flyToSeatId` runs the cinematic tour: the
4535
+ * camera flies to the seat and holds in the live scene (a chip offers the
4536
+ * 360° view-from-seat) —
4537
+ * the widget enters 3D and auto-flies the camera to that seat, dissolving into
4538
+ * its view-from-seat panorama (the same chain as tapping "See the view from
4539
+ * here" on a seat's confirm card). When the widget is **already** in the 3D
4540
+ * view, the camera simply flies to the requested seat — the GL scene is not
4541
+ * torn down or rebuilt, so there is no flash or re-entry.
4542
+ *
4543
+ * No-op when the view is unchanged and no `flyToSeatId` is given, or when 3D is
4544
+ * unavailable for this chart.
4545
+ *
4546
+ * @param view `'map'` for the flat picker, `'venue3d'` for the 3D venue.
4547
+ * @param opts.flyToSeatId When entering (or already in) `'venue3d'`, the seat
4548
+ * id to fly the camera to — cinematic → panorama.
4549
+ * Ignored when `view` is `'map'`.
4550
+ *
4551
+ * @example
4552
+ * // Public 3D tour entry — enter 3D and fly straight to the buyer's seat:
4553
+ * picker.setBuyerView('venue3d', { flyToSeatId: 'A-12' });
4554
+ */
4555
+ setBuyerView(view, opts) {
4556
+ if (view === "map") {
4557
+ this.exit3d();
4558
+ return;
4559
+ }
4560
+ const flyToSeatId = opts?.flyToSeatId;
4561
+ if (this.buyerView === "venue3d") {
4562
+ if (flyToSeatId) void this.view3dHandle?.flyToSeat(flyToSeatId);
4563
+ return;
4564
+ }
4565
+ void this.enter3d(flyToSeatId);
4533
4566
  }
4534
4567
  /** SeatStatus → the view3d palette state. Selection is layered separately. */
4535
4568
  seatState3dFor(id) {