@seatlayer/js 0.28.4 → 0.29.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
@@ -1,4 +1,4 @@
1
- import { PickerSeat, SeatHoverDetails, PickerTransport, RendererViewMode, ChartDoc, AvailabilityRule, ChartTheme, ExpandedSeat } from '@seatlayer/core';
1
+ import { PickerSeat, RendererViewMode, SeatHoverDetails, PickerTransport, ChartDoc, AvailabilityRule, ChartTheme, ExpandedSeat } from '@seatlayer/core';
2
2
  export { ExpandedSeat, SeatHoverDetails } from '@seatlayer/core';
3
3
 
4
4
  /**
@@ -53,6 +53,7 @@ interface BestAvailableResult {
53
53
  labels: string[];
54
54
  seats?: PickerSeat[];
55
55
  items?: HoldResult['items'];
56
+ zoneId?: string;
56
57
  }
57
58
 
58
59
  /**
@@ -75,6 +76,9 @@ interface GAAreaAvailability {
75
76
  categoryKey: string;
76
77
  price: number;
77
78
  currency: string;
79
+ /** Buyer-facing copy authored separately from stable inventory identity. */
80
+ displayLabel?: string;
81
+ displayType?: string;
78
82
  tiers?: Array<{
79
83
  id: string;
80
84
  name: string;
@@ -111,6 +115,9 @@ interface SeatingChartOptions {
111
115
  * Toggleable later with setColorblindSafe().
112
116
  */
113
117
  colorblindSafe?: boolean;
118
+ /** Initial canvas projection. `perspective` enables exact-seat projected
119
+ * 2.5D picking without changing booking identities or chart geometry. */
120
+ initialView?: RendererViewMode;
114
121
  /**
115
122
  * Built-in seat tooltip on mouse hover (seat · category · price · status).
116
123
  * Rendered inside the widget so every host gets it; default true. Turn off
@@ -259,6 +266,10 @@ declare class SeatingChart {
259
266
  setFloor(floorId: string): void;
260
267
  /** Toggle colorblind-safe rendering at runtime (see options.colorblindSafe). */
261
268
  setColorblindSafe(on: boolean): void;
269
+ /** Switch between flat, isometric and exact-seat Perspective 2.5D views. */
270
+ setViewMode(mode: RendererViewMode): void;
271
+ /** Current canvas projection. */
272
+ getViewMode(): RendererViewMode;
262
273
  /** Zoom in one step (same increment as the wheel/pinch gesture). */
263
274
  zoomIn(): void;
264
275
  /** Zoom out one step. */
@@ -638,9 +649,26 @@ interface SeatPickerOptions {
638
649
  currency?: string;
639
650
  /** Colorblind-safe rendering (Okabe-Ito palette, hollow booked seats). */
640
651
  colorblindSafe?: boolean;
641
- /** Initial map projection. `perspective` is the exact-seat projected 2.5D
642
- * buyer view; all authoring and inventory identities remain unchanged. */
652
+ /** Initial map projection. Buyers now toggle **Map (flat 2D) + 3D** only; the
653
+ * legacy `perspective` (2.5D) value is still ACCEPTED for source compatibility
654
+ * but is deprecated — it is coerced to `flat` with a one-time console warning.
655
+ * The 3D venue view is entered from the Map/3D control, not this option. */
643
656
  initialView?: RendererViewMode;
657
+ /**
658
+ * Offer the interactive 3D venue view (Map | 3D toggle + a "See it in 3D"
659
+ * action on the seat-confirm card). Default true. The 3D button is shown only
660
+ * when this is not false AND the browser exposes WebGL2; there are ZERO GL
661
+ * bytes on the wire until the buyer actually opens 3D (the OGL chunk is
662
+ * dynamically imported on first use). Set false for embed hosts that must
663
+ * stay strictly 2D. */
664
+ enable3D?: boolean;
665
+ /**
666
+ * Optional analytics sink for the widget's own journey events. Currently emits
667
+ * the 3D venue-view journey (`3d_opened`, `3d_orbit_engaged`, `3d_seat_picked`,
668
+ * `3d_cinematic_played`/`_skipped`/`_cancelled`, `3d_panorama_opened`/`_closed`)
669
+ * with `{ surface: 'buyer' }` merged into the props. A throwing sink never
670
+ * breaks the widget. Route it to your product analytics (e.g. PostHog). */
671
+ onAnalytics?: (event: string, props: Record<string, unknown>) => void;
644
672
  /**
645
673
  * Hide the "Powered by SeatLayer" attribution badge in the side panel foot.
646
674
  * The chart theme's own `hideBadge` flag (paid orgs) also hides it — the badge
@@ -770,6 +798,14 @@ declare class SeatPicker {
770
798
  private cbSafe;
771
799
  private rungsEl;
772
800
  private projectionEl;
801
+ private buyerView;
802
+ private view3dEl;
803
+ private view3dHandle;
804
+ /** Monotonic token so a stale async mount (buyer left before OGL finished
805
+ * loading) never installs its handle over a newer state. */
806
+ private view3dGen;
807
+ /** Seat whose 2D confirm card launched "See it in 3D"; re-shown on return. */
808
+ private view3dReturnSeat;
773
809
  private floorsEl;
774
810
  private secCardEl;
775
811
  private viewEl;
@@ -819,6 +855,10 @@ declare class SeatPicker {
819
855
  * (OV-52)
820
856
  */
821
857
  private confirmThumbHtml;
858
+ /** "See it in 3D" (2D) / "View from this seat" (already in 3D) action for the
859
+ * confirm card. Only when 3D is available — the purchase-moment bridge into
860
+ * the cinematic that reaches buyers who never press the Map | 3D toggle. */
861
+ private see3dConfirmHtml;
822
862
  /** Minimal HTML/attribute escaper for buyer-authored commercial text (notes). */
823
863
  private escCx;
824
864
  /** Localized "Restricted view" / "Obstructed view" label for a seat's flags,
@@ -1001,6 +1041,9 @@ declare class SeatPicker {
1001
1041
  /** Reflect the engine's current LOD rung onto the pill group. */
1002
1042
  private syncRung;
1003
1043
  private syncProjection;
1044
+ /** Can this picker offer the 3D venue view? Requires the option (default on)
1045
+ * and WebGL2, and a chart to render. */
1046
+ private canOffer3d;
1004
1047
  /** Reflect the active floor onto the switcher rail. */
1005
1048
  private syncFloors;
1006
1049
  /** Show (or clear, on null) the tapped-section summary card. */
@@ -1118,10 +1161,37 @@ declare class SeatPicker {
1118
1161
  * cross-surface preference, and the in-widget button's pressed state together
1119
1162
  * so the two controls never diverge. */
1120
1163
  setColorblindSafe(on: boolean): void;
1121
- /** Switch the buyer canvas between flat, isometric and Perspective 2.5D. */
1164
+ /** Switch the underlying 2D renderer projection (flat / isometric). The buyer
1165
+ * UI no longer exposes `perspective`; it is coerced to `flat`. */
1122
1166
  setViewMode(mode: RendererViewMode): void;
1123
1167
  /** Current buyer canvas projection. */
1124
1168
  getViewMode(): RendererViewMode;
1169
+ /** `perspective` (2.5D) is retired from the buyer surface — accept it for
1170
+ * source compatibility but coerce to `flat` with a one-time deprecation warn. */
1171
+ private perspectiveWarned;
1172
+ private normalizeInitialView;
1173
+ /** Current buyer view: the flat map, or the interactive 3D venue. */
1174
+ 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;
1178
+ /** SeatStatus → the view3d palette state. Selection is layered separately. */
1179
+ private seatState3dFor;
1180
+ /** Push the full live availability snapshot into the 3D handle (selection is
1181
+ * preserved inside the module). Cheap enough per status delta. */
1182
+ private pushAvailabilityTo3d;
1183
+ /** Mirror the authoritative widget selection into the 3D handle. */
1184
+ private syncSelectionTo3d;
1185
+ /** Build the view-from-seat panorama the cinematic dissolves into — reuses the
1186
+ * exact input path as the 2D `openSeatView` (organizer photo, else generated). */
1187
+ private seatViewFor3d;
1188
+ /** Route the module's decoupled analytics into the host callback, tagged buyer. */
1189
+ private emit3dAnalytics;
1190
+ /** A 3D seat tap runs the SAME selection path as a 2D tap: toggle through the
1191
+ * controller, then raise the shared confirm card (bottom-sheeted in 3D). */
1192
+ private onView3dSeatPick;
1193
+ private enter3d;
1194
+ private exit3d;
1125
1195
  /** Current active/restored hold reflected in the tray. */
1126
1196
  getCurrentHold(): HoldResult | null;
1127
1197
  /** Explicit host-driven hold restore (automatic session restore is on by default). */
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { PickerSeat, SeatHoverDetails, PickerTransport, RendererViewMode, ChartDoc, AvailabilityRule, ChartTheme, ExpandedSeat } from '@seatlayer/core';
1
+ import { PickerSeat, RendererViewMode, SeatHoverDetails, PickerTransport, ChartDoc, AvailabilityRule, ChartTheme, ExpandedSeat } from '@seatlayer/core';
2
2
  export { ExpandedSeat, SeatHoverDetails } from '@seatlayer/core';
3
3
 
4
4
  /**
@@ -53,6 +53,7 @@ interface BestAvailableResult {
53
53
  labels: string[];
54
54
  seats?: PickerSeat[];
55
55
  items?: HoldResult['items'];
56
+ zoneId?: string;
56
57
  }
57
58
 
58
59
  /**
@@ -75,6 +76,9 @@ interface GAAreaAvailability {
75
76
  categoryKey: string;
76
77
  price: number;
77
78
  currency: string;
79
+ /** Buyer-facing copy authored separately from stable inventory identity. */
80
+ displayLabel?: string;
81
+ displayType?: string;
78
82
  tiers?: Array<{
79
83
  id: string;
80
84
  name: string;
@@ -111,6 +115,9 @@ interface SeatingChartOptions {
111
115
  * Toggleable later with setColorblindSafe().
112
116
  */
113
117
  colorblindSafe?: boolean;
118
+ /** Initial canvas projection. `perspective` enables exact-seat projected
119
+ * 2.5D picking without changing booking identities or chart geometry. */
120
+ initialView?: RendererViewMode;
114
121
  /**
115
122
  * Built-in seat tooltip on mouse hover (seat · category · price · status).
116
123
  * Rendered inside the widget so every host gets it; default true. Turn off
@@ -259,6 +266,10 @@ declare class SeatingChart {
259
266
  setFloor(floorId: string): void;
260
267
  /** Toggle colorblind-safe rendering at runtime (see options.colorblindSafe). */
261
268
  setColorblindSafe(on: boolean): void;
269
+ /** Switch between flat, isometric and exact-seat Perspective 2.5D views. */
270
+ setViewMode(mode: RendererViewMode): void;
271
+ /** Current canvas projection. */
272
+ getViewMode(): RendererViewMode;
262
273
  /** Zoom in one step (same increment as the wheel/pinch gesture). */
263
274
  zoomIn(): void;
264
275
  /** Zoom out one step. */
@@ -638,9 +649,26 @@ interface SeatPickerOptions {
638
649
  currency?: string;
639
650
  /** Colorblind-safe rendering (Okabe-Ito palette, hollow booked seats). */
640
651
  colorblindSafe?: boolean;
641
- /** Initial map projection. `perspective` is the exact-seat projected 2.5D
642
- * buyer view; all authoring and inventory identities remain unchanged. */
652
+ /** Initial map projection. Buyers now toggle **Map (flat 2D) + 3D** only; the
653
+ * legacy `perspective` (2.5D) value is still ACCEPTED for source compatibility
654
+ * but is deprecated — it is coerced to `flat` with a one-time console warning.
655
+ * The 3D venue view is entered from the Map/3D control, not this option. */
643
656
  initialView?: RendererViewMode;
657
+ /**
658
+ * Offer the interactive 3D venue view (Map | 3D toggle + a "See it in 3D"
659
+ * action on the seat-confirm card). Default true. The 3D button is shown only
660
+ * when this is not false AND the browser exposes WebGL2; there are ZERO GL
661
+ * bytes on the wire until the buyer actually opens 3D (the OGL chunk is
662
+ * dynamically imported on first use). Set false for embed hosts that must
663
+ * stay strictly 2D. */
664
+ enable3D?: boolean;
665
+ /**
666
+ * Optional analytics sink for the widget's own journey events. Currently emits
667
+ * the 3D venue-view journey (`3d_opened`, `3d_orbit_engaged`, `3d_seat_picked`,
668
+ * `3d_cinematic_played`/`_skipped`/`_cancelled`, `3d_panorama_opened`/`_closed`)
669
+ * with `{ surface: 'buyer' }` merged into the props. A throwing sink never
670
+ * breaks the widget. Route it to your product analytics (e.g. PostHog). */
671
+ onAnalytics?: (event: string, props: Record<string, unknown>) => void;
644
672
  /**
645
673
  * Hide the "Powered by SeatLayer" attribution badge in the side panel foot.
646
674
  * The chart theme's own `hideBadge` flag (paid orgs) also hides it — the badge
@@ -770,6 +798,14 @@ declare class SeatPicker {
770
798
  private cbSafe;
771
799
  private rungsEl;
772
800
  private projectionEl;
801
+ private buyerView;
802
+ private view3dEl;
803
+ private view3dHandle;
804
+ /** Monotonic token so a stale async mount (buyer left before OGL finished
805
+ * loading) never installs its handle over a newer state. */
806
+ private view3dGen;
807
+ /** Seat whose 2D confirm card launched "See it in 3D"; re-shown on return. */
808
+ private view3dReturnSeat;
773
809
  private floorsEl;
774
810
  private secCardEl;
775
811
  private viewEl;
@@ -819,6 +855,10 @@ declare class SeatPicker {
819
855
  * (OV-52)
820
856
  */
821
857
  private confirmThumbHtml;
858
+ /** "See it in 3D" (2D) / "View from this seat" (already in 3D) action for the
859
+ * confirm card. Only when 3D is available — the purchase-moment bridge into
860
+ * the cinematic that reaches buyers who never press the Map | 3D toggle. */
861
+ private see3dConfirmHtml;
822
862
  /** Minimal HTML/attribute escaper for buyer-authored commercial text (notes). */
823
863
  private escCx;
824
864
  /** Localized "Restricted view" / "Obstructed view" label for a seat's flags,
@@ -1001,6 +1041,9 @@ declare class SeatPicker {
1001
1041
  /** Reflect the engine's current LOD rung onto the pill group. */
1002
1042
  private syncRung;
1003
1043
  private syncProjection;
1044
+ /** Can this picker offer the 3D venue view? Requires the option (default on)
1045
+ * and WebGL2, and a chart to render. */
1046
+ private canOffer3d;
1004
1047
  /** Reflect the active floor onto the switcher rail. */
1005
1048
  private syncFloors;
1006
1049
  /** Show (or clear, on null) the tapped-section summary card. */
@@ -1118,10 +1161,37 @@ declare class SeatPicker {
1118
1161
  * cross-surface preference, and the in-widget button's pressed state together
1119
1162
  * so the two controls never diverge. */
1120
1163
  setColorblindSafe(on: boolean): void;
1121
- /** Switch the buyer canvas between flat, isometric and Perspective 2.5D. */
1164
+ /** Switch the underlying 2D renderer projection (flat / isometric). The buyer
1165
+ * UI no longer exposes `perspective`; it is coerced to `flat`. */
1122
1166
  setViewMode(mode: RendererViewMode): void;
1123
1167
  /** Current buyer canvas projection. */
1124
1168
  getViewMode(): RendererViewMode;
1169
+ /** `perspective` (2.5D) is retired from the buyer surface — accept it for
1170
+ * source compatibility but coerce to `flat` with a one-time deprecation warn. */
1171
+ private perspectiveWarned;
1172
+ private normalizeInitialView;
1173
+ /** Current buyer view: the flat map, or the interactive 3D venue. */
1174
+ 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;
1178
+ /** SeatStatus → the view3d palette state. Selection is layered separately. */
1179
+ private seatState3dFor;
1180
+ /** Push the full live availability snapshot into the 3D handle (selection is
1181
+ * preserved inside the module). Cheap enough per status delta. */
1182
+ private pushAvailabilityTo3d;
1183
+ /** Mirror the authoritative widget selection into the 3D handle. */
1184
+ private syncSelectionTo3d;
1185
+ /** Build the view-from-seat panorama the cinematic dissolves into — reuses the
1186
+ * exact input path as the 2D `openSeatView` (organizer photo, else generated). */
1187
+ private seatViewFor3d;
1188
+ /** Route the module's decoupled analytics into the host callback, tagged buyer. */
1189
+ private emit3dAnalytics;
1190
+ /** A 3D seat tap runs the SAME selection path as a 2D tap: toggle through the
1191
+ * controller, then raise the shared confirm card (bottom-sheeted in 3D). */
1192
+ private onView3dSeatPick;
1193
+ private enter3d;
1194
+ private exit3d;
1125
1195
  /** Current active/restored hold reflected in the tray. */
1126
1196
  getCurrentHold(): HoldResult | null;
1127
1197
  /** Explicit host-driven hold restore (automatic session restore is on by default). */