@seatlayer/core 0.51.0 → 0.53.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.
Files changed (55) hide show
  1. package/LICENSE +16 -17
  2. package/README.md +8 -18
  3. package/dist/chunk-54A7LIL5.js +1 -0
  4. package/dist/chunk-IJI4WU57.js +1 -0
  5. package/dist/chunk-XPPT3OGQ.js +1 -0
  6. package/dist/core/seatConfidence.cjs +1 -76
  7. package/dist/core/seatConfidence.d.cts +1 -1
  8. package/dist/core/seatConfidence.d.ts +1 -1
  9. package/dist/core/seatConfidence.js +1 -51
  10. package/dist/de-75NWRKC5.js +1 -0
  11. package/dist/es-BM7EJ7PW.js +1 -0
  12. package/dist/fr-HPXQHIB4.js +1 -0
  13. package/dist/index.cjs +1 -12130
  14. package/dist/index.d.cts +169 -70
  15. package/dist/index.d.ts +169 -70
  16. package/dist/index.js +1 -9718
  17. package/dist/picker/minimapGeometry.cjs +1 -0
  18. package/dist/picker/minimapGeometry.d.cts +37 -0
  19. package/dist/picker/minimapGeometry.d.ts +37 -0
  20. package/dist/picker/minimapGeometry.js +1 -0
  21. package/dist/{types-DR54nqKL.d.cts → types-tLOunI-B.d.cts} +131 -1
  22. package/dist/{types-DR54nqKL.d.ts → types-tLOunI-B.d.ts} +131 -1
  23. package/dist/view/panoramaDelivery.cjs +1 -126
  24. package/dist/view/panoramaDelivery.js +1 -17
  25. package/dist/view3d/crossfade/panorama.cjs +1 -459
  26. package/dist/view3d/crossfade/panorama.d.cts +2 -4
  27. package/dist/view3d/crossfade/panorama.d.ts +2 -4
  28. package/dist/view3d/crossfade/panorama.js +1 -30
  29. package/dist/view3d/index.cjs +63 -6930
  30. package/dist/view3d/index.d.cts +82 -33
  31. package/dist/view3d/index.d.ts +82 -33
  32. package/dist/view3d/index.js +63 -6062
  33. package/package.json +15 -7
  34. package/dist/chunk-AZODENEL.js +0 -97
  35. package/dist/chunk-AZODENEL.js.map +0 -1
  36. package/dist/chunk-BE3F7CT3.js +0 -341
  37. package/dist/chunk-BE3F7CT3.js.map +0 -1
  38. package/dist/chunk-GD267BFB.js +0 -1496
  39. package/dist/chunk-GD267BFB.js.map +0 -1
  40. package/dist/core/seatConfidence.cjs.map +0 -1
  41. package/dist/core/seatConfidence.js.map +0 -1
  42. package/dist/de-V53JPFHN.js +0 -292
  43. package/dist/de-V53JPFHN.js.map +0 -1
  44. package/dist/es-37ISLCZA.js +0 -292
  45. package/dist/es-37ISLCZA.js.map +0 -1
  46. package/dist/fr-QKK2T64Q.js +0 -292
  47. package/dist/fr-QKK2T64Q.js.map +0 -1
  48. package/dist/index.cjs.map +0 -1
  49. package/dist/index.js.map +0 -1
  50. package/dist/view/panoramaDelivery.cjs.map +0 -1
  51. package/dist/view/panoramaDelivery.js.map +0 -1
  52. package/dist/view3d/crossfade/panorama.cjs.map +0 -1
  53. package/dist/view3d/crossfade/panorama.js.map +0 -1
  54. package/dist/view3d/index.cjs.map +0 -1
  55. package/dist/view3d/index.js.map +0 -1
@@ -1,18 +1,6 @@
1
- import { C as ChartDoc, E as ExpandedSeat } from '../types-DR54nqKL.cjs';
1
+ import { C as ChartDoc, E as ExpandedSeat } from '../types-tLOunI-B.cjs';
2
2
  import { SeatView } from './crossfade/panorama.cjs';
3
3
 
4
- /**
5
- * Dirty-flag render loop. A frame is drawn only while the camera is moving /
6
- * damping or an availability update arrived; when idle, no rAF is scheduled at
7
- * all (zero CPU/GPU when parked). Tracks an FPS EMA over frames actually
8
- * rendered — it reads as "idle" when nothing is scheduled.
9
- */
10
- interface RenderLoopStats {
11
- fps: number;
12
- rendered: number;
13
- idle: boolean;
14
- }
15
-
16
4
  /**
17
5
  * view3d palette + seat-state model — the single source of colour truth for the
18
6
  * OGL venue view. Pure data (no GPU, no DOM) so the scene builder and the unit
@@ -21,6 +9,7 @@ interface RenderLoopStats {
21
9
  * Look brief (docs/3d-usp-strategy §3): desaturated cool greys for structure,
22
10
  * one warm accent for the stage, availability colours only on seats.
23
11
  */
12
+
24
13
  type SeatState3D = 'available' | 'held' | 'sold' | 'selected' | 'dimmed';
25
14
  type RGB = [number, number, number];
26
15
  /** Structure palette — cool desaturated greys + one warm stage accent. */
@@ -119,7 +108,7 @@ interface Theme3D {
119
108
  * unreadable confetti.
120
109
  */
121
110
 
122
- type LabelKind = 'zone' | 'section' | 'ga' | 'annotation' | 'booth' | 'row' | 'seat';
111
+ type LabelKind = 'floor' | 'zone' | 'section' | 'ga' | 'annotation' | 'booth' | 'row' | 'seat';
123
112
  interface SceneLabel {
124
113
  id: string;
125
114
  kind: LabelKind;
@@ -130,6 +119,8 @@ interface SceneLabel {
130
119
  color?: string;
131
120
  /** Authored rotation in degrees, for annotations that specify one. */
132
121
  rotation?: number;
122
+ /** Owning physical level, so a focused floor never keeps another level's text. */
123
+ floorIndex?: number;
133
124
  }
134
125
 
135
126
  /**
@@ -287,6 +278,7 @@ interface SceneZone {
287
278
  */
288
279
  interface SceneSection {
289
280
  id: string;
281
+ floorIndex: number;
290
282
  /** Buyer-facing name, matching the section label. */
291
283
  label: string;
292
284
  seatCount: number;
@@ -314,6 +306,13 @@ interface SceneFloor {
314
306
  seatCount: number;
315
307
  center: [number, number, number];
316
308
  radius: number;
309
+ /** Complete active-level fit, including its inferred physical relief. */
310
+ box: {
311
+ min: [number, number, number];
312
+ max: [number, number, number];
313
+ };
314
+ /** Presentation-adjusted focal point used by section and seat views. */
315
+ focalWorld: [number, number, number];
317
316
  }
318
317
  interface SceneModel {
319
318
  /** Every non-seat surface merged into one triangle soup (1 draw call). */
@@ -368,10 +367,9 @@ interface SceneModel {
368
367
  /**
369
368
  * The venue's floors, in authored order. A single-floor chart reports one.
370
369
  *
371
- * Every shipped multi-floor template puts all its floors at baseHeightM 0 and
372
- * takes height from the sections instead, so floors are a logical grouping,
373
- * not a physical stack. What they need is ISOLATION: draw all three of an
374
- * opera house at once and the balcony sits over the parterre.
370
+ * Multi-floor scenes retain the authored x/z registration and the
371
+ * authored/inferred baseHeightM relief. Selecting a floor isolates it without
372
+ * changing the canonical chart.
375
373
  */
376
374
  floors: SceneFloor[];
377
375
  /**
@@ -389,6 +387,34 @@ interface SceneModelInput {
389
387
  /** Optional initial per-seat state (default all available). */
390
388
  initialState?: (seat: ExpandedSeat) => SeatState3D;
391
389
  }
390
+
391
+ /**
392
+ * The JS-side source of truth for the 3D scene — a pure, GPU-free description
393
+ * built once from the chart's existing height contract. Everything the renderer
394
+ * uploads (merged solid geometry, the instanced seat cloud, camera-framing
395
+ * bounds, the seat-state colour LUT) is derived here, so it survives a WebGL
396
+ * context loss: on `webglcontextrestored` the renderer simply re-uploads from
397
+ * this model without recomputing anything.
398
+ *
399
+ * Feeds 100% from `sectionGeometry` / `Floor.baseHeightM` / `ExpandedSeat`
400
+ * (docs/3d-program-workorder §Architecture) — no new chart data is invented.
401
+ *
402
+ * This module is the ORCHESTRATOR and the public face of `scene/model/`: it
403
+ * sequences the passes and re-exports every type and helper the rest of the
404
+ * codebase, the tests and the SDK import from `scene/sceneModel`. The passes
405
+ * themselves live in `scene/model/` — see `docs/architecture` for the layering:
406
+ *
407
+ * types the shapes everything below is described in
408
+ * paint AO + how an authored colour becomes an architectural tone
409
+ * footprints configuration filtering, floor units, plan-space polygons
410
+ * shapeArchitecture décor vocabulary → architecture, and coplanar claims
411
+ * objectBuilders one prism per booth / table / shape / décor / GA area
412
+ * tiers per-section decks and the per-floor bowl
413
+ * labels zones, sections, rows and everything worth naming
414
+ * floors per-level boxes, and the per-seat floor attribute
415
+ * bounds chart footprint, ground datum, render + overview volumes
416
+ */
417
+
392
418
  declare function buildSceneModel(input: SceneModelInput): SceneModel;
393
419
 
394
420
  /**
@@ -431,16 +457,26 @@ interface PrepareVenue3DInput {
431
457
  declare function prepareVenue3D(input: PrepareVenue3DInput): Promise<PreparedVenue3D>;
432
458
 
433
459
  /**
434
- * view3d the sole dynamic-import boundary for the lazy OGL venue-view chunk.
435
- *
436
- * const { mountVenue3D } = await import('../view3d');
437
- * const handle = mountVenue3D(container, { doc, seats }, { onSeatPick, getSeatView });
438
- * await handle.flyToSeat(seatId);
460
+ * Dirty-flag render loop. A frame is drawn only while the camera is moving /
461
+ * damping or an availability update arrived; when idle, no rAF is scheduled at
462
+ * all (zero CPU/GPU when parked). Tracks an FPS EMA over frames actually
463
+ * rendered it reads as "idle" when nothing is scheduled.
464
+ */
465
+ interface RenderLoopStats {
466
+ fps: number;
467
+ rendered: number;
468
+ idle: boolean;
469
+ }
470
+
471
+ /**
472
+ * The public contract of the lazy venue-view chunk: what you mount it with
473
+ * (`Venue3DInput`), how you configure it (`Venue3DOptions`), and what you get
474
+ * back (`Venue3DHandle`).
439
475
  *
440
- * Read-only 3D of any chart, fed entirely from the existing height contract.
441
- * Slice 1: orbit camera, extruded tiers/stage/GA, instanced seat dots, sub-range
442
- * availability, dispose + context-loss survival. Slice 2: GPU color-pick. Slice
443
- * 3: the fly-to-seat cinematic that dissolves into the view-from-seat panorama.
476
+ * Split out of `index.ts` so the mount closure and the UI/interaction modules
477
+ * can share them without importing the entry. `index.ts` re-exports all four —
478
+ * that is the path the SDK (`@seatlayer/core/view3d`), the picker, the designer
479
+ * preview and the harness import from, and it must never move.
444
480
  */
445
481
 
446
482
  interface Venue3DInput {
@@ -507,7 +543,7 @@ interface Venue3DHandle {
507
543
  * view-from-seat panorama. Resolves at flight end; a drag cancels it, a second
508
544
  * call retargets, dispose resolves early. Reduced-motion → a short fade. */
509
545
  flyToSeat(seatId: string): Promise<void>;
510
- /** Cancel a seat flight/panorama and frame the complete venue. */
546
+ /** Cancel a seat flight/panorama and fit the active floor or complete venue. */
511
547
  focusOverview(): void;
512
548
  resize(): void;
513
549
  stats(): Venue3DStats;
@@ -549,14 +585,27 @@ interface Venue3DHandle {
549
585
  /**
550
586
  * Isolate one floor, or pass null to show the whole venue.
551
587
  *
552
- * Every shipped multi-floor chart puts its floors at the same base height and
553
- * takes relief from the sections, so all three of an opera house draw at once
554
- * and the balcony sits over the parterre. Unfocused floors are DIMMED rather
555
- * than hidden, so the buyer keeps the venue as context while looking at the
556
- * level they are booking. Returns false for an unknown index.
588
+ * The complete venue uses a rigid, non-overlapping level composition derived
589
+ * from the same native 2D geometry. Entering a level hides the other levels so
590
+ * opaque decks cannot cover the seats being inspected. Returns false for an
591
+ * unknown index.
557
592
  */
558
593
  focusFloor(index: number | null): boolean;
559
594
  }
595
+
596
+ /**
597
+ * view3d — the sole dynamic-import boundary for the lazy OGL venue-view chunk.
598
+ *
599
+ * const { mountVenue3D } = await import('../view3d');
600
+ * const handle = mountVenue3D(container, { doc, seats }, { onSeatPick, getSeatView });
601
+ * await handle.flyToSeat(seatId);
602
+ *
603
+ * Read-only 3D of any chart, fed entirely from the existing height contract.
604
+ * Slice 1: orbit camera, extruded tiers/stage/GA, instanced seat dots, sub-range
605
+ * availability, dispose + context-loss survival. Slice 2: GPU color-pick. Slice
606
+ * 3: the fly-to-seat cinematic that dissolves into the view-from-seat panorama.
607
+ */
608
+
560
609
  declare function mountVenue3D(container: HTMLElement, input: Venue3DInput, opts?: Venue3DOptions): Venue3DHandle;
561
610
 
562
611
  export { type Analytics3DCallback, type Scene3DPrepSource, type SeatState3D, SeatView, type Venue3DHandle, type Venue3DInput, type Venue3DOptions, type Venue3DStats, buildSceneModel, mountVenue3D, prepareVenue3D };
@@ -1,18 +1,6 @@
1
- import { C as ChartDoc, E as ExpandedSeat } from '../types-DR54nqKL.js';
1
+ import { C as ChartDoc, E as ExpandedSeat } from '../types-tLOunI-B.js';
2
2
  import { SeatView } from './crossfade/panorama.js';
3
3
 
4
- /**
5
- * Dirty-flag render loop. A frame is drawn only while the camera is moving /
6
- * damping or an availability update arrived; when idle, no rAF is scheduled at
7
- * all (zero CPU/GPU when parked). Tracks an FPS EMA over frames actually
8
- * rendered — it reads as "idle" when nothing is scheduled.
9
- */
10
- interface RenderLoopStats {
11
- fps: number;
12
- rendered: number;
13
- idle: boolean;
14
- }
15
-
16
4
  /**
17
5
  * view3d palette + seat-state model — the single source of colour truth for the
18
6
  * OGL venue view. Pure data (no GPU, no DOM) so the scene builder and the unit
@@ -21,6 +9,7 @@ interface RenderLoopStats {
21
9
  * Look brief (docs/3d-usp-strategy §3): desaturated cool greys for structure,
22
10
  * one warm accent for the stage, availability colours only on seats.
23
11
  */
12
+
24
13
  type SeatState3D = 'available' | 'held' | 'sold' | 'selected' | 'dimmed';
25
14
  type RGB = [number, number, number];
26
15
  /** Structure palette — cool desaturated greys + one warm stage accent. */
@@ -119,7 +108,7 @@ interface Theme3D {
119
108
  * unreadable confetti.
120
109
  */
121
110
 
122
- type LabelKind = 'zone' | 'section' | 'ga' | 'annotation' | 'booth' | 'row' | 'seat';
111
+ type LabelKind = 'floor' | 'zone' | 'section' | 'ga' | 'annotation' | 'booth' | 'row' | 'seat';
123
112
  interface SceneLabel {
124
113
  id: string;
125
114
  kind: LabelKind;
@@ -130,6 +119,8 @@ interface SceneLabel {
130
119
  color?: string;
131
120
  /** Authored rotation in degrees, for annotations that specify one. */
132
121
  rotation?: number;
122
+ /** Owning physical level, so a focused floor never keeps another level's text. */
123
+ floorIndex?: number;
133
124
  }
134
125
 
135
126
  /**
@@ -287,6 +278,7 @@ interface SceneZone {
287
278
  */
288
279
  interface SceneSection {
289
280
  id: string;
281
+ floorIndex: number;
290
282
  /** Buyer-facing name, matching the section label. */
291
283
  label: string;
292
284
  seatCount: number;
@@ -314,6 +306,13 @@ interface SceneFloor {
314
306
  seatCount: number;
315
307
  center: [number, number, number];
316
308
  radius: number;
309
+ /** Complete active-level fit, including its inferred physical relief. */
310
+ box: {
311
+ min: [number, number, number];
312
+ max: [number, number, number];
313
+ };
314
+ /** Presentation-adjusted focal point used by section and seat views. */
315
+ focalWorld: [number, number, number];
317
316
  }
318
317
  interface SceneModel {
319
318
  /** Every non-seat surface merged into one triangle soup (1 draw call). */
@@ -368,10 +367,9 @@ interface SceneModel {
368
367
  /**
369
368
  * The venue's floors, in authored order. A single-floor chart reports one.
370
369
  *
371
- * Every shipped multi-floor template puts all its floors at baseHeightM 0 and
372
- * takes height from the sections instead, so floors are a logical grouping,
373
- * not a physical stack. What they need is ISOLATION: draw all three of an
374
- * opera house at once and the balcony sits over the parterre.
370
+ * Multi-floor scenes retain the authored x/z registration and the
371
+ * authored/inferred baseHeightM relief. Selecting a floor isolates it without
372
+ * changing the canonical chart.
375
373
  */
376
374
  floors: SceneFloor[];
377
375
  /**
@@ -389,6 +387,34 @@ interface SceneModelInput {
389
387
  /** Optional initial per-seat state (default all available). */
390
388
  initialState?: (seat: ExpandedSeat) => SeatState3D;
391
389
  }
390
+
391
+ /**
392
+ * The JS-side source of truth for the 3D scene — a pure, GPU-free description
393
+ * built once from the chart's existing height contract. Everything the renderer
394
+ * uploads (merged solid geometry, the instanced seat cloud, camera-framing
395
+ * bounds, the seat-state colour LUT) is derived here, so it survives a WebGL
396
+ * context loss: on `webglcontextrestored` the renderer simply re-uploads from
397
+ * this model without recomputing anything.
398
+ *
399
+ * Feeds 100% from `sectionGeometry` / `Floor.baseHeightM` / `ExpandedSeat`
400
+ * (docs/3d-program-workorder §Architecture) — no new chart data is invented.
401
+ *
402
+ * This module is the ORCHESTRATOR and the public face of `scene/model/`: it
403
+ * sequences the passes and re-exports every type and helper the rest of the
404
+ * codebase, the tests and the SDK import from `scene/sceneModel`. The passes
405
+ * themselves live in `scene/model/` — see `docs/architecture` for the layering:
406
+ *
407
+ * types the shapes everything below is described in
408
+ * paint AO + how an authored colour becomes an architectural tone
409
+ * footprints configuration filtering, floor units, plan-space polygons
410
+ * shapeArchitecture décor vocabulary → architecture, and coplanar claims
411
+ * objectBuilders one prism per booth / table / shape / décor / GA area
412
+ * tiers per-section decks and the per-floor bowl
413
+ * labels zones, sections, rows and everything worth naming
414
+ * floors per-level boxes, and the per-seat floor attribute
415
+ * bounds chart footprint, ground datum, render + overview volumes
416
+ */
417
+
392
418
  declare function buildSceneModel(input: SceneModelInput): SceneModel;
393
419
 
394
420
  /**
@@ -431,16 +457,26 @@ interface PrepareVenue3DInput {
431
457
  declare function prepareVenue3D(input: PrepareVenue3DInput): Promise<PreparedVenue3D>;
432
458
 
433
459
  /**
434
- * view3d the sole dynamic-import boundary for the lazy OGL venue-view chunk.
435
- *
436
- * const { mountVenue3D } = await import('../view3d');
437
- * const handle = mountVenue3D(container, { doc, seats }, { onSeatPick, getSeatView });
438
- * await handle.flyToSeat(seatId);
460
+ * Dirty-flag render loop. A frame is drawn only while the camera is moving /
461
+ * damping or an availability update arrived; when idle, no rAF is scheduled at
462
+ * all (zero CPU/GPU when parked). Tracks an FPS EMA over frames actually
463
+ * rendered it reads as "idle" when nothing is scheduled.
464
+ */
465
+ interface RenderLoopStats {
466
+ fps: number;
467
+ rendered: number;
468
+ idle: boolean;
469
+ }
470
+
471
+ /**
472
+ * The public contract of the lazy venue-view chunk: what you mount it with
473
+ * (`Venue3DInput`), how you configure it (`Venue3DOptions`), and what you get
474
+ * back (`Venue3DHandle`).
439
475
  *
440
- * Read-only 3D of any chart, fed entirely from the existing height contract.
441
- * Slice 1: orbit camera, extruded tiers/stage/GA, instanced seat dots, sub-range
442
- * availability, dispose + context-loss survival. Slice 2: GPU color-pick. Slice
443
- * 3: the fly-to-seat cinematic that dissolves into the view-from-seat panorama.
476
+ * Split out of `index.ts` so the mount closure and the UI/interaction modules
477
+ * can share them without importing the entry. `index.ts` re-exports all four —
478
+ * that is the path the SDK (`@seatlayer/core/view3d`), the picker, the designer
479
+ * preview and the harness import from, and it must never move.
444
480
  */
445
481
 
446
482
  interface Venue3DInput {
@@ -507,7 +543,7 @@ interface Venue3DHandle {
507
543
  * view-from-seat panorama. Resolves at flight end; a drag cancels it, a second
508
544
  * call retargets, dispose resolves early. Reduced-motion → a short fade. */
509
545
  flyToSeat(seatId: string): Promise<void>;
510
- /** Cancel a seat flight/panorama and frame the complete venue. */
546
+ /** Cancel a seat flight/panorama and fit the active floor or complete venue. */
511
547
  focusOverview(): void;
512
548
  resize(): void;
513
549
  stats(): Venue3DStats;
@@ -549,14 +585,27 @@ interface Venue3DHandle {
549
585
  /**
550
586
  * Isolate one floor, or pass null to show the whole venue.
551
587
  *
552
- * Every shipped multi-floor chart puts its floors at the same base height and
553
- * takes relief from the sections, so all three of an opera house draw at once
554
- * and the balcony sits over the parterre. Unfocused floors are DIMMED rather
555
- * than hidden, so the buyer keeps the venue as context while looking at the
556
- * level they are booking. Returns false for an unknown index.
588
+ * The complete venue uses a rigid, non-overlapping level composition derived
589
+ * from the same native 2D geometry. Entering a level hides the other levels so
590
+ * opaque decks cannot cover the seats being inspected. Returns false for an
591
+ * unknown index.
557
592
  */
558
593
  focusFloor(index: number | null): boolean;
559
594
  }
595
+
596
+ /**
597
+ * view3d — the sole dynamic-import boundary for the lazy OGL venue-view chunk.
598
+ *
599
+ * const { mountVenue3D } = await import('../view3d');
600
+ * const handle = mountVenue3D(container, { doc, seats }, { onSeatPick, getSeatView });
601
+ * await handle.flyToSeat(seatId);
602
+ *
603
+ * Read-only 3D of any chart, fed entirely from the existing height contract.
604
+ * Slice 1: orbit camera, extruded tiers/stage/GA, instanced seat dots, sub-range
605
+ * availability, dispose + context-loss survival. Slice 2: GPU color-pick. Slice
606
+ * 3: the fly-to-seat cinematic that dissolves into the view-from-seat panorama.
607
+ */
608
+
560
609
  declare function mountVenue3D(container: HTMLElement, input: Venue3DInput, opts?: Venue3DOptions): Venue3DHandle;
561
610
 
562
611
  export { type Analytics3DCallback, type Scene3DPrepSource, type SeatState3D, SeatView, type Venue3DHandle, type Venue3DInput, type Venue3DOptions, type Venue3DStats, buildSceneModel, mountVenue3D, prepareVenue3D };