@seatlayer/core 0.46.0 → 0.47.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 (40) hide show
  1. package/dist/chunk-AZODENEL.js +97 -0
  2. package/dist/chunk-AZODENEL.js.map +1 -0
  3. package/dist/chunk-FVCOOLJO.js +335 -0
  4. package/dist/chunk-FVCOOLJO.js.map +1 -0
  5. package/dist/{chunk-5MRJCIZP.js → chunk-TCTAS4Z2.js} +88 -14
  6. package/dist/chunk-TCTAS4Z2.js.map +1 -0
  7. package/dist/{de-UHAOVDS3.js → de-ST4H423D.js} +6 -3
  8. package/dist/{de-UHAOVDS3.js.map → de-ST4H423D.js.map} +1 -1
  9. package/dist/{es-6TJS2L7S.js → es-WEC5NHRT.js} +6 -3
  10. package/dist/{es-6TJS2L7S.js.map → es-WEC5NHRT.js.map} +1 -1
  11. package/dist/{fr-MMSY7FPE.js → fr-SGBFNAQV.js} +6 -3
  12. package/dist/{fr-MMSY7FPE.js.map → fr-SGBFNAQV.js.map} +1 -1
  13. package/dist/index.cjs +251 -39
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.d.cts +119 -4
  16. package/dist/index.d.ts +119 -4
  17. package/dist/index.js +152 -24
  18. package/dist/index.js.map +1 -1
  19. package/dist/{types-DBnRO2hX.d.cts → types-CE63BK0j.d.cts} +88 -10
  20. package/dist/{types-DBnRO2hX.d.ts → types-CE63BK0j.d.ts} +88 -10
  21. package/dist/view/panoramaDelivery.cjs +126 -0
  22. package/dist/view/panoramaDelivery.cjs.map +1 -0
  23. package/dist/view/panoramaDelivery.d.cts +34 -0
  24. package/dist/view/panoramaDelivery.d.ts +34 -0
  25. package/dist/view/panoramaDelivery.js +17 -0
  26. package/dist/view/panoramaDelivery.js.map +1 -0
  27. package/dist/view3d/crossfade/panorama.cjs +453 -0
  28. package/dist/view3d/crossfade/panorama.cjs.map +1 -0
  29. package/dist/view3d/crossfade/panorama.d.cts +110 -0
  30. package/dist/view3d/crossfade/panorama.d.ts +110 -0
  31. package/dist/view3d/crossfade/panorama.js +30 -0
  32. package/dist/view3d/crossfade/panorama.js.map +1 -0
  33. package/dist/view3d/index.cjs +1161 -128
  34. package/dist/view3d/index.cjs.map +1 -1
  35. package/dist/view3d/index.d.cts +60 -35
  36. package/dist/view3d/index.d.ts +60 -35
  37. package/dist/view3d/index.js +945 -300
  38. package/dist/view3d/index.js.map +1 -1
  39. package/package.json +28 -1
  40. package/dist/chunk-5MRJCIZP.js.map +0 -1
@@ -0,0 +1,110 @@
1
+ import { a9 as SeatViewCoverage } from '../../types-CE63BK0j.cjs';
2
+
3
+ /**
4
+ * Slice 3 hand-off — the DOM panorama overlay the fly-to-seat cinematic
5
+ * dissolves into. Decoupled by design: the CALLER supplies the equirectangular
6
+ * image (via mountVenue3D's getSeatView), so view3d never imports the app's
7
+ * panorama generator and the chunk stays lean.
8
+ *
9
+ * Technique (mirrors SeatPicker.openSeatView, reimplemented small): an equirect
10
+ * image panned with `repeat-x`; the initial horizontal offset is set so the
11
+ * panorama's bearing matches the final camera yaw — the dissolve reads as the
12
+ * same view sharpening, not a cut. CSS opacity fade is compositor-only.
13
+ */
14
+
15
+ interface SeatView {
16
+ url: string;
17
+ /** Lightweight equirect used for first paint before `url` replaces it. */
18
+ previewUrl?: string;
19
+ sourceWidth?: number;
20
+ sourceHeight?: number;
21
+ previewWidth?: number;
22
+ previewHeight?: number;
23
+ /**
24
+ * True when `url` is a SYNTHESISED panorama rather than a real photograph.
25
+ *
26
+ * It decides which of two very different things the buyer gets, so the caller
27
+ * must say rather than the renderer guess. A generated equirect is a picture
28
+ * of a 3D scene the renderer already has: at 2048×1024 it covers 106° of
29
+ * horizontal view in ~600 source pixels, which a 3072-device-pixel viewport
30
+ * magnifies FIVE times, and no amount of art survives that. So a generated
31
+ * view is not drawn as an image at all — the camera simply looks around the
32
+ * real scene, which has no resolution ceiling.
33
+ *
34
+ * A real photo has no such substitute and goes on the sphere, where a 5760 or
35
+ * 8192-wide capture has three to four times the detail to give.
36
+ */
37
+ generated?: boolean;
38
+ /** Bearing (deg, 0 = facing the focal/stage) the panorama should open centred
39
+ * on, to match the camera's final yaw. Default 0 (both face the stage). */
40
+ initialBearingDeg?: number;
41
+ /** Initial vertical orientation. Positive looks up; clamped to the viewer's
42
+ * safe pitch range. Uploaded captures use this to match the live seat pose. */
43
+ initialPitchDeg?: number;
44
+ /** How specifically this image represents the selected inventory unit. */
45
+ coverage?: SeatViewCoverage;
46
+ /** ISO capture date/time when known. Unknown is preferable to invented age. */
47
+ capturedAt?: string;
48
+ /** Optional buyer-safe provenance, for example "Provided by the venue". */
49
+ sourceLabel?: string;
50
+ }
51
+ /** Honest, compact buyer disclosure for the panorama currently on screen. */
52
+ declare function seatViewDisclosure(view: SeatView): string;
53
+ /** True only when the panorama should be presented as organizer-authored media.
54
+ * Representative AI demo assets travel through the same URL field as venue
55
+ * photos, so provenance—not URL presence—must decide the buyer badge. */
56
+ declare function isAuthoredSeatView(view: SeatView): boolean;
57
+ interface PanoramaHandle {
58
+ /** Fade out and return to the (frozen) 3D view; calls opts.onClose after. */
59
+ close(): void;
60
+ /** Immediate teardown (dispose) — no fade, no onClose. */
61
+ dispose(): void;
62
+ }
63
+ /**
64
+ * Vertical field of view (deg) the windowed panorama shows. The source image is
65
+ * a full 180° equirect sphere; showing it raw wastes ~⅔ of the frame on dead sky
66
+ * and black floor, with the horizon content band squished into the middle. We
67
+ * instead scale the image so only this central slice fills the viewport height,
68
+ * horizon-centred, and let the user drag pitch within ±`MAX_PITCH_DEG`.
69
+ */
70
+ declare const VFOV_DEG = 70;
71
+ declare const MIN_VFOV_DEG = 35;
72
+ declare const MAX_VFOV_DEG = 90;
73
+ /** Keep wheel, keyboard and pinch zoom inside a useful, non-disorienting range. */
74
+ declare function clampPanoramaFov(fovDeg: number): number;
75
+ /** Users may look this far up/down from the horizon; well inside the image so
76
+ * the clamp never reveals past its top/bottom edge. */
77
+ declare const MAX_PITCH_DEG = 35;
78
+ /**
79
+ * Horizontal background-position (px) that centres `bearingDeg` in the viewport,
80
+ * assuming the equirect image's yaw 0 sits at its horizontal centre. `bgW` is the
81
+ * full scaled image width representing 360° — so this is invariant to the vertical
82
+ * FOV windowing (which scales width and height by the same factor). `repeat-x`
83
+ * handles the wrap, so any real value is valid.
84
+ */
85
+ declare function bearingToOffsetPx(bearingDeg: number, viewportW: number, bgW: number): number;
86
+ /**
87
+ * Full scaled image height (px) so that a `vfovDeg`-tall slice fills `viewportH`.
88
+ * The image spans 180° vertically, so height = viewportH · 180/vfov.
89
+ */
90
+ declare function windowedBgHeight(viewportH: number, vfovDeg?: number): number;
91
+ /**
92
+ * background-position Y (px) that centres the image's horizon (its vertical
93
+ * centre) in the viewport, offset by `pitchPx` (deviation from the horizon,
94
+ * clamped to ±`MAX_PITCH_DEG`). Positive `pitchPx` looks up.
95
+ */
96
+ declare function horizonOffsetPy(viewportH: number, bgH: number, pitchPx: number): number;
97
+ /** Clamp a pitch drag (px) to ±MAX_PITCH_DEG of image travel, and never past the
98
+ * image edge. `bgH` px map the full 180°, so a degree is `bgH/180` px. */
99
+ declare function clampPitchPx(pitchPx: number, bgH: number): number;
100
+ interface PanoramaOptions {
101
+ fadeMs?: number;
102
+ seatLabel?: string;
103
+ disclosure?: string;
104
+ onClose?: () => void;
105
+ /** Cancels stale preview/full-resolution image work when a flight is retargeted. */
106
+ signal?: AbortSignal;
107
+ }
108
+ declare function mountPanorama(container: HTMLElement, view: SeatView, opts?: PanoramaOptions): PanoramaHandle;
109
+
110
+ export { MAX_PITCH_DEG, MAX_VFOV_DEG, MIN_VFOV_DEG, type PanoramaHandle, type PanoramaOptions, type SeatView, VFOV_DEG, bearingToOffsetPx, clampPanoramaFov, clampPitchPx, horizonOffsetPy, isAuthoredSeatView, mountPanorama, seatViewDisclosure, windowedBgHeight };
@@ -0,0 +1,110 @@
1
+ import { a9 as SeatViewCoverage } from '../../types-CE63BK0j.js';
2
+
3
+ /**
4
+ * Slice 3 hand-off — the DOM panorama overlay the fly-to-seat cinematic
5
+ * dissolves into. Decoupled by design: the CALLER supplies the equirectangular
6
+ * image (via mountVenue3D's getSeatView), so view3d never imports the app's
7
+ * panorama generator and the chunk stays lean.
8
+ *
9
+ * Technique (mirrors SeatPicker.openSeatView, reimplemented small): an equirect
10
+ * image panned with `repeat-x`; the initial horizontal offset is set so the
11
+ * panorama's bearing matches the final camera yaw — the dissolve reads as the
12
+ * same view sharpening, not a cut. CSS opacity fade is compositor-only.
13
+ */
14
+
15
+ interface SeatView {
16
+ url: string;
17
+ /** Lightweight equirect used for first paint before `url` replaces it. */
18
+ previewUrl?: string;
19
+ sourceWidth?: number;
20
+ sourceHeight?: number;
21
+ previewWidth?: number;
22
+ previewHeight?: number;
23
+ /**
24
+ * True when `url` is a SYNTHESISED panorama rather than a real photograph.
25
+ *
26
+ * It decides which of two very different things the buyer gets, so the caller
27
+ * must say rather than the renderer guess. A generated equirect is a picture
28
+ * of a 3D scene the renderer already has: at 2048×1024 it covers 106° of
29
+ * horizontal view in ~600 source pixels, which a 3072-device-pixel viewport
30
+ * magnifies FIVE times, and no amount of art survives that. So a generated
31
+ * view is not drawn as an image at all — the camera simply looks around the
32
+ * real scene, which has no resolution ceiling.
33
+ *
34
+ * A real photo has no such substitute and goes on the sphere, where a 5760 or
35
+ * 8192-wide capture has three to four times the detail to give.
36
+ */
37
+ generated?: boolean;
38
+ /** Bearing (deg, 0 = facing the focal/stage) the panorama should open centred
39
+ * on, to match the camera's final yaw. Default 0 (both face the stage). */
40
+ initialBearingDeg?: number;
41
+ /** Initial vertical orientation. Positive looks up; clamped to the viewer's
42
+ * safe pitch range. Uploaded captures use this to match the live seat pose. */
43
+ initialPitchDeg?: number;
44
+ /** How specifically this image represents the selected inventory unit. */
45
+ coverage?: SeatViewCoverage;
46
+ /** ISO capture date/time when known. Unknown is preferable to invented age. */
47
+ capturedAt?: string;
48
+ /** Optional buyer-safe provenance, for example "Provided by the venue". */
49
+ sourceLabel?: string;
50
+ }
51
+ /** Honest, compact buyer disclosure for the panorama currently on screen. */
52
+ declare function seatViewDisclosure(view: SeatView): string;
53
+ /** True only when the panorama should be presented as organizer-authored media.
54
+ * Representative AI demo assets travel through the same URL field as venue
55
+ * photos, so provenance—not URL presence—must decide the buyer badge. */
56
+ declare function isAuthoredSeatView(view: SeatView): boolean;
57
+ interface PanoramaHandle {
58
+ /** Fade out and return to the (frozen) 3D view; calls opts.onClose after. */
59
+ close(): void;
60
+ /** Immediate teardown (dispose) — no fade, no onClose. */
61
+ dispose(): void;
62
+ }
63
+ /**
64
+ * Vertical field of view (deg) the windowed panorama shows. The source image is
65
+ * a full 180° equirect sphere; showing it raw wastes ~⅔ of the frame on dead sky
66
+ * and black floor, with the horizon content band squished into the middle. We
67
+ * instead scale the image so only this central slice fills the viewport height,
68
+ * horizon-centred, and let the user drag pitch within ±`MAX_PITCH_DEG`.
69
+ */
70
+ declare const VFOV_DEG = 70;
71
+ declare const MIN_VFOV_DEG = 35;
72
+ declare const MAX_VFOV_DEG = 90;
73
+ /** Keep wheel, keyboard and pinch zoom inside a useful, non-disorienting range. */
74
+ declare function clampPanoramaFov(fovDeg: number): number;
75
+ /** Users may look this far up/down from the horizon; well inside the image so
76
+ * the clamp never reveals past its top/bottom edge. */
77
+ declare const MAX_PITCH_DEG = 35;
78
+ /**
79
+ * Horizontal background-position (px) that centres `bearingDeg` in the viewport,
80
+ * assuming the equirect image's yaw 0 sits at its horizontal centre. `bgW` is the
81
+ * full scaled image width representing 360° — so this is invariant to the vertical
82
+ * FOV windowing (which scales width and height by the same factor). `repeat-x`
83
+ * handles the wrap, so any real value is valid.
84
+ */
85
+ declare function bearingToOffsetPx(bearingDeg: number, viewportW: number, bgW: number): number;
86
+ /**
87
+ * Full scaled image height (px) so that a `vfovDeg`-tall slice fills `viewportH`.
88
+ * The image spans 180° vertically, so height = viewportH · 180/vfov.
89
+ */
90
+ declare function windowedBgHeight(viewportH: number, vfovDeg?: number): number;
91
+ /**
92
+ * background-position Y (px) that centres the image's horizon (its vertical
93
+ * centre) in the viewport, offset by `pitchPx` (deviation from the horizon,
94
+ * clamped to ±`MAX_PITCH_DEG`). Positive `pitchPx` looks up.
95
+ */
96
+ declare function horizonOffsetPy(viewportH: number, bgH: number, pitchPx: number): number;
97
+ /** Clamp a pitch drag (px) to ±MAX_PITCH_DEG of image travel, and never past the
98
+ * image edge. `bgH` px map the full 180°, so a degree is `bgH/180` px. */
99
+ declare function clampPitchPx(pitchPx: number, bgH: number): number;
100
+ interface PanoramaOptions {
101
+ fadeMs?: number;
102
+ seatLabel?: string;
103
+ disclosure?: string;
104
+ onClose?: () => void;
105
+ /** Cancels stale preview/full-resolution image work when a flight is retargeted. */
106
+ signal?: AbortSignal;
107
+ }
108
+ declare function mountPanorama(container: HTMLElement, view: SeatView, opts?: PanoramaOptions): PanoramaHandle;
109
+
110
+ export { MAX_PITCH_DEG, MAX_VFOV_DEG, MIN_VFOV_DEG, type PanoramaHandle, type PanoramaOptions, type SeatView, VFOV_DEG, bearingToOffsetPx, clampPanoramaFov, clampPitchPx, horizonOffsetPy, isAuthoredSeatView, mountPanorama, seatViewDisclosure, windowedBgHeight };
@@ -0,0 +1,30 @@
1
+ import {
2
+ MAX_PITCH_DEG,
3
+ MAX_VFOV_DEG,
4
+ MIN_VFOV_DEG,
5
+ VFOV_DEG,
6
+ bearingToOffsetPx,
7
+ clampPanoramaFov,
8
+ clampPitchPx,
9
+ horizonOffsetPy,
10
+ isAuthoredSeatView,
11
+ mountPanorama,
12
+ seatViewDisclosure,
13
+ windowedBgHeight
14
+ } from "../../chunk-FVCOOLJO.js";
15
+ import "../../chunk-AZODENEL.js";
16
+ export {
17
+ MAX_PITCH_DEG,
18
+ MAX_VFOV_DEG,
19
+ MIN_VFOV_DEG,
20
+ VFOV_DEG,
21
+ bearingToOffsetPx,
22
+ clampPanoramaFov,
23
+ clampPitchPx,
24
+ horizonOffsetPy,
25
+ isAuthoredSeatView,
26
+ mountPanorama,
27
+ seatViewDisclosure,
28
+ windowedBgHeight
29
+ };
30
+ //# sourceMappingURL=panorama.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}