@ericchen1990/pano-view 1.0.0 → 2.0.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.ts CHANGED
@@ -31,6 +31,11 @@ type HotspotDragEvent = HotspotInteractionEvent & {
31
31
  };
32
32
  /** When a hotspot tooltip is shown. Defaults to `"always"`. */
33
33
  type HotspotTooltipTrigger = "always" | "hover" | "click";
34
+ /**
35
+ * Pointer hit-testing for a hotspot. `"none"` ignores mouse, touch, and pen
36
+ * so events pass through to the panorama. Defaults to `"auto"`.
37
+ */
38
+ type HotspotPointerEvents = "auto" | "none";
34
39
  /** Where the tooltip sits relative to the hotspot. Defaults to `"top"`. */
35
40
  type HotspotTooltipPlacement = "top" | "bottom" | "left" | "right";
36
41
  /** Plain-text and/or image content for a hotspot tooltip. */
@@ -39,6 +44,16 @@ type HotspotTooltipContent = {
39
44
  image?: string;
40
45
  imageAlt?: string;
41
46
  };
47
+ /** Visual styling for a hotspot tooltip bubble. */
48
+ type HotspotTooltipAppearance = {
49
+ background?: string;
50
+ color?: string;
51
+ border?: string;
52
+ borderRadius?: number | string;
53
+ shadow?: string;
54
+ padding?: number | string;
55
+ fontSize?: number | string;
56
+ };
42
57
  type HotspotCommonProps = {
43
58
  id: string;
44
59
  position: HotspotPosition;
@@ -47,15 +62,17 @@ type HotspotCommonProps = {
47
62
  * Defaults to always visible when content is present.
48
63
  */
49
64
  tooltip?: string | HotspotTooltipContent;
50
- /** Defaults to `"always"`. `"hover"` and `"click"` require `interactive`. */
65
+ /** Defaults to `"always"`. `"hover"` and `"click"` require `interactive` and `pointerEvents` other than `"none"`. */
51
66
  tooltipTrigger?: HotspotTooltipTrigger;
52
- /** Defaults to `"top"`. */
67
+ /** Screen direction for the tooltip. Defaults to `"top"`. */
53
68
  tooltipPlacement?: HotspotTooltipPlacement;
54
69
  /**
55
70
  * Screen-space gap in CSS pixels between the hotspot edge and the tooltip.
56
71
  * Defaults to 12.
57
72
  */
58
73
  tooltipOffset?: number;
74
+ /** Optional bubble paint overrides. Unset fields use the library default theme. */
75
+ tooltipAppearance?: HotspotTooltipAppearance;
59
76
  /** Angular width in degrees. Defaults to 12. */
60
77
  width?: number;
61
78
  /** Angular height in degrees. Defaults to 8. */
@@ -80,6 +97,12 @@ type HotspotCommonProps = {
80
97
  visible?: boolean;
81
98
  /** Whether the hotspot accepts pointer and keyboard interaction. Defaults to true. */
82
99
  interactive?: boolean;
100
+ /**
101
+ * Pointer hit-testing. `"none"` ignores mouse, touch, and pen so events
102
+ * pass through to the panorama. Defaults to `"auto"`.
103
+ * `interactive={false}` also disables pointer hits.
104
+ */
105
+ pointerEvents?: HotspotPointerEvents;
83
106
  /**
84
107
  * Canvas cursor while this hotspot is hovered. Defaults to the viewer's
85
108
  * `cursors.hotspot` value (`"pointer"`).
@@ -145,7 +168,8 @@ declare function cycleSceneId(scenes: readonly {
145
168
  * Adds keyboard navigation to the nearest PanoViewer. Enabled by default;
146
169
  * render this component only to override properties, bindings, or scene
147
170
  * callbacks. Hold movement/zoom keys for continuous motion; scene and reset
148
- * bindings fire once per key press.
171
+ * bindings fire once per key press. Click the viewer to focus it before
172
+ * keys are received.
149
173
  */
150
174
  declare function KeyboardControls({ enabled, keys, rotateSpeed, zoomSpeed, shiftMultiplier, invert, fovSpeed, onPreviousScene, onNextScene, }: KeyboardControlsProps): null;
151
175
 
@@ -493,6 +517,150 @@ type AutoRotateProps = {
493
517
  */
494
518
  declare function AutoRotate({ enabled, speed, acceleration, startDelay, }: AutoRotateProps): null;
495
519
 
520
+ declare const PANO_FILTER_PRESETS: readonly ["none", "grayscale", "sepia", "vintage", "cool", "warm", "pencil", "coloredPencil", "crayon", "watercolor", "cartoon", "crosshatch"];
521
+ type PanoFilterPreset = (typeof PANO_FILTER_PRESETS)[number];
522
+
523
+ type PanoFilterProps = {
524
+ /** Built-in look. Defaults to `none` (identity). */
525
+ preset?: PanoFilterPreset;
526
+ /** Mix with the original panorama, 0–1. Defaults to 1. */
527
+ intensity?: number;
528
+ /** When false, the panorama renders without a filter. Defaults to true. */
529
+ enabled?: boolean;
530
+ };
531
+ /**
532
+ * Applies a color or artistic filter to the panorama source of the nearest
533
+ * PanoViewer. Render one instance as a child of PanoViewer. Hotspots and HTML
534
+ * chrome are not filtered.
535
+ */
536
+ declare function PanoFilter({ preset, intensity, enabled, }: PanoFilterProps): null;
537
+
538
+ type GyroTouchMode = "off" | "horizontaloffset" | "full" | "disablegyro";
539
+
540
+ type GyroHandle = {
541
+ resetSensor: (yaw?: number, pitch?: number) => void;
542
+ isAvailable: () => boolean;
543
+ isEnabled: () => boolean;
544
+ /**
545
+ * Requests iOS sensor permission. Call this directly from a user gesture
546
+ * before setting `enabled` to true.
547
+ */
548
+ requestPermission: () => Promise<boolean>;
549
+ };
550
+ type GyroProps = {
551
+ /** Whether device-orientation control is requested. Defaults to false. */
552
+ enabled?: boolean;
553
+ /** Whether device roll levels the camera. Defaults to true. */
554
+ camroll?: boolean;
555
+ /** Whether to follow compass-oriented headings. Defaults to false. */
556
+ absolute?: boolean;
557
+ /** Panorama yaw that represents North, in degrees. Defaults to 0. */
558
+ north?: number;
559
+ /** Sensor smoothing from 0 (none) to 0.99 (strong). Defaults to 0. */
560
+ friction?: number;
561
+ /** How touch dragging combines with gyro movement. Defaults to "full". */
562
+ touchMode?: GyroTouchMode;
563
+ /** Seconds used to blend from the current view when enabling. Defaults to 0.5. */
564
+ softstart?: number;
565
+ /** Allow capability detection on desktop-class devices. Defaults to false. */
566
+ desktopSupport?: boolean;
567
+ onAvailable?: () => void;
568
+ onUnavailable?: () => void;
569
+ onEnable?: () => void;
570
+ onDisable?: () => void;
571
+ onDenied?: () => void;
572
+ };
573
+ /**
574
+ * Adds device-orientation navigation to the nearest PanoViewer.
575
+ * Sensor access is opt-in and disabled by default.
576
+ */
577
+ declare const Gyro: react.ForwardRefExoticComponent<GyroProps & react.RefAttributes<GyroHandle>>;
578
+
579
+ type WebVRMode = "webxr" | "mobilevr" | "fake";
580
+ type WebVRProfileId = "none" | "cardboard-v1" | "cardboard-v2" | "gear-vr" | "daydream";
581
+ type WebVRProfile = {
582
+ id?: string;
583
+ label?: string;
584
+ /** Vertical field of view for each eye, in degrees. */
585
+ fov: number;
586
+ /** Distance between the eyes, in millimetres. */
587
+ ipdMm: number;
588
+ /** Distance from the display to the headset lens, in millimetres. */
589
+ screenToLensMm?: number;
590
+ /** Radial lens distortion coefficients. Zero disables distortion. */
591
+ k1: number;
592
+ k2: number;
593
+ };
594
+ type WebVRChromeAppearance = {
595
+ background?: CSSProperties["background"];
596
+ color?: CSSProperties["color"];
597
+ accent?: CSSProperties["color"];
598
+ borderRadius?: CSSProperties["borderRadius"];
599
+ fontSize?: CSSProperties["fontSize"];
600
+ setupTitle?: ReactNode;
601
+ };
602
+ type WebVRChrome = boolean | WebVRChromeAppearance;
603
+ type WebVRProps = {
604
+ /** Mount the built-in Enter / Exit / Setup chrome. Defaults to true. */
605
+ chrome?: WebVRChrome;
606
+ /** Enable the phone stereoscopic fallback. Defaults to true. */
607
+ mobileVr?: boolean;
608
+ /** Treat desktop device-orientation sensors as MobileVR. Defaults to false. */
609
+ desktopSupport?: boolean;
610
+ /** Allow a mouse-driven stereoscopic desktop simulation. Defaults to true. */
611
+ fakeSupport?: boolean;
612
+ /** Physical diagonal screen size in inches, or automatic detection. */
613
+ screensize?: number | "auto";
614
+ /** Headset preset or a custom lens profile. */
615
+ profile?: WebVRProfileId | WebVRProfile;
616
+ /** Show a center reticle in VR. Defaults to true. */
617
+ cursor?: boolean;
618
+ /**
619
+ * Milliseconds to keep looking at a hotspot before a gaze click.
620
+ * Defaults to 1500. Set to 0 to disable auto-click.
621
+ */
622
+ cursorDwellMs?: number;
623
+ /**
624
+ * Keep the display awake while MobileVR or simulated VR is active.
625
+ * Uses the Screen Wake Lock API when available, otherwise a looping
626
+ * hidden video. Defaults to true.
627
+ */
628
+ wakelock?: boolean;
629
+ /**
630
+ * Lock the mouse in simulated desktop VR so movement looks around with
631
+ * no visible cursor. Click the view to re-lock after Escape. Defaults to true.
632
+ */
633
+ mousePointerLock?: boolean;
634
+ onAvailable?: () => void;
635
+ onUnavailable?: () => void;
636
+ onEnterVR?: (mode: WebVRMode) => void;
637
+ onExitVR?: (mode: WebVRMode) => void;
638
+ onDenied?: (error?: unknown) => void;
639
+ onUnknownDevice?: () => void;
640
+ };
641
+ type WebVRHandle = {
642
+ enterVR: () => Promise<boolean>;
643
+ exitVR: () => Promise<void>;
644
+ toggleVR: () => Promise<boolean>;
645
+ isAvailable: () => boolean;
646
+ isEnabled: () => boolean;
647
+ getMode: () => WebVRMode | null;
648
+ requestPermission: () => Promise<boolean>;
649
+ };
650
+ type WebVRSettings = {
651
+ screensize: number | "auto";
652
+ profileId: WebVRProfileId;
653
+ };
654
+
655
+ declare const WebVR: react.ForwardRefExoticComponent<WebVRProps & react.RefAttributes<WebVRHandle>>;
656
+
657
+ declare const DEFAULT_WEBVR_CHROME_APPEARANCE: Required<Omit<WebVRChromeAppearance, "setupTitle">>;
658
+
659
+ declare const WEBVR_PROFILE_IDS: readonly ["none", "cardboard-v1", "cardboard-v2", "gear-vr", "daydream"];
660
+ declare const WEBVR_PROFILES: Record<WebVRProfileId, WebVRProfile>;
661
+
662
+ declare const DEFAULT_WEBVR_CURSOR_DWELL_MS = 1500;
663
+
496
664
  type ViewInteractionSource = "mouse" | "touch" | "keyboard";
497
665
  type PanoWheelEvent = {
498
666
  /** Signed wheel delta (same sign convention as WheelEvent.deltaY). */
@@ -526,6 +694,23 @@ type PanoEventMap = {
526
694
  autorotatestart: undefined;
527
695
  autorotatestop: undefined;
528
696
  autorotateoneround: undefined;
697
+ gyroavailable: undefined;
698
+ gyrounavailable: undefined;
699
+ gyroenable: undefined;
700
+ gyrodisable: undefined;
701
+ gyrodenied: undefined;
702
+ vravailable: undefined;
703
+ vrunavailable: undefined;
704
+ vrenter: {
705
+ mode: WebVRMode;
706
+ };
707
+ vrexit: {
708
+ mode: WebVRMode;
709
+ };
710
+ vrdenied: {
711
+ error?: unknown;
712
+ };
713
+ vrunknowndevice: undefined;
529
714
  };
530
715
  type PanoEventType = keyof PanoEventMap;
531
716
  type PanoEventListener<T extends PanoEventType> = (payload: PanoEventMap[T]) => void;
@@ -559,12 +744,23 @@ type PanoEventsProps = {
559
744
  onAutoRotateStart?: () => void;
560
745
  onAutoRotateStop?: () => void;
561
746
  onAutoRotateOneRound?: () => void;
747
+ onGyroAvailable?: () => void;
748
+ onGyroUnavailable?: () => void;
749
+ onGyroEnable?: () => void;
750
+ onGyroDisable?: () => void;
751
+ onGyroDenied?: () => void;
752
+ onVRAvailable?: () => void;
753
+ onVRUnavailable?: () => void;
754
+ onVREnter?: (mode: WebVRMode) => void;
755
+ onVRExit?: (mode: WebVRMode) => void;
756
+ onVRDenied?: (error?: unknown) => void;
757
+ onVRUnknownDevice?: () => void;
562
758
  };
563
759
  /**
564
760
  * Subscribes to viewer-level panorama events. Must run inside PanoViewer.
565
761
  * Prefer the {@link PanoEvents} component for declarative usage.
566
762
  */
567
- declare function usePanoEvents({ idleTime, onViewChange, onViewSettled, onViewInteractionStart, onViewInteractionEnd, onClick, onDoubleClick, onPointerDown, onPointerUp, onPointerMove, onContextMenu, onWheel, onIdle, onIdleEnd, onEnterFullscreen, onExitFullscreen, onResize, onAutoRotateStart, onAutoRotateStop, onAutoRotateOneRound, }: PanoEventsProps): void;
763
+ declare function usePanoEvents({ idleTime, onViewChange, onViewSettled, onViewInteractionStart, onViewInteractionEnd, onClick, onDoubleClick, onPointerDown, onPointerUp, onPointerMove, onContextMenu, onWheel, onIdle, onIdleEnd, onEnterFullscreen, onExitFullscreen, onResize, onAutoRotateStart, onAutoRotateStop, onAutoRotateOneRound, onGyroAvailable, onGyroUnavailable, onGyroEnable, onGyroDisable, onGyroDenied, onVRAvailable, onVRUnavailable, onVREnter, onVRExit, onVRDenied, onVRUnknownDevice, }: PanoEventsProps): void;
568
764
  /**
569
765
  * Declarative viewer-level event listeners for the nearest PanoViewer.
570
766
  * Multiple instances may coexist; each tracks its own idle timer.
@@ -603,6 +799,178 @@ type SphereProps = {
603
799
  };
604
800
  declare function Sphere({ src, yawOffset, onLoad, onError, visible, }: SphereProps): react.JSX.Element | null;
605
801
 
802
+ type VideoPlaybackState = "playing" | "paused" | "ended" | "blocked";
803
+ type VideoHotspotErrorEvent = {
804
+ id: string;
805
+ source: "poster" | "video";
806
+ error: unknown;
807
+ };
808
+ type VideoHotspotProps = HotspotCommonProps & {
809
+ src: string;
810
+ playing: boolean;
811
+ poster?: string;
812
+ loop?: boolean;
813
+ muted?: boolean;
814
+ volume?: number;
815
+ playsInline?: boolean;
816
+ preload?: "none" | "metadata" | "auto";
817
+ crossOrigin?: "" | "anonymous" | "use-credentials";
818
+ onPlaybackStateChange?: (state: VideoPlaybackState) => void;
819
+ onPlaybackError?: (error: unknown) => void;
820
+ onEnded?: () => void;
821
+ onError?: (event: VideoHotspotErrorEvent) => void;
822
+ };
823
+ declare function VideoHotspot({ id, src, playing, poster, loop, muted, volume, playsInline, preload, crossOrigin, width, height, opacity, onPlaybackStateChange, onPlaybackError, onEnded, onError, ...anchorProps }: VideoHotspotProps): react.JSX.Element;
824
+
825
+ type PanoVideoSource = {
826
+ src: string;
827
+ type?: string;
828
+ };
829
+ type PanoVideoVariant = {
830
+ id: string;
831
+ label: string;
832
+ poster?: string;
833
+ sources: readonly PanoVideoSource[];
834
+ };
835
+ type PanoVideoTrackKind = "subtitles" | "captions";
836
+ type PanoVideoTrack = {
837
+ /** Defaults to `srcLang`. */
838
+ id?: string;
839
+ src: string;
840
+ srcLang: string;
841
+ label: string;
842
+ kind?: PanoVideoTrackKind;
843
+ default?: boolean;
844
+ };
845
+ type PanoVideoCaptionAppearance = {
846
+ color?: string;
847
+ background?: string;
848
+ fontSize?: number | string;
849
+ fontFamily?: string;
850
+ fontWeight?: CSSProperties["fontWeight"];
851
+ textShadow?: string;
852
+ padding?: string;
853
+ borderRadius?: number | string;
854
+ maxWidth?: number | string;
855
+ bottom?: number | string;
856
+ lineHeight?: number | string;
857
+ };
858
+ type PanoVideoControlsAppearance = {
859
+ background?: string;
860
+ color?: string;
861
+ accent?: string;
862
+ borderRadius?: number | string;
863
+ fontSize?: number | string;
864
+ padding?: string;
865
+ };
866
+ type PanoVideoErrorSource = "poster" | "video" | "track";
867
+ type PanoVideoErrorEvent = {
868
+ source: PanoVideoErrorSource;
869
+ error: unknown;
870
+ };
871
+ type PanoVideoPlaybackSnapshot = {
872
+ ready: boolean;
873
+ playing: boolean;
874
+ blocked: boolean;
875
+ ended: boolean;
876
+ currentTime: number;
877
+ duration: number;
878
+ volume: number;
879
+ /** False when the element ignores `volume` (iOS Safari). Mute still works. */
880
+ volumeAdjustable: boolean;
881
+ muted: boolean;
882
+ playbackRate: number;
883
+ variantId: string;
884
+ variants: readonly PanoVideoVariant[];
885
+ trackId: string | null;
886
+ tracks: readonly PanoVideoTrack[];
887
+ captionText: string;
888
+ captionAppearance: Required<PanoVideoCaptionAppearance>;
889
+ captionsEnabled: boolean;
890
+ playbackRates: readonly number[];
891
+ playbackState: VideoPlaybackState;
892
+ };
893
+ type PanoVideoController = {
894
+ subscribe: (onStoreChange: () => void) => () => void;
895
+ getSnapshot: () => PanoVideoPlaybackSnapshot;
896
+ play: () => Promise<void>;
897
+ pause: () => void;
898
+ togglePlay: () => void;
899
+ seek: (time: number) => void;
900
+ setVolume: (volume: number) => void;
901
+ setMuted: (muted: boolean) => void;
902
+ toggleMuted: () => void;
903
+ setPlaybackRate: (rate: number) => void;
904
+ setVariantId: (id: string) => void;
905
+ setTrackId: (id: string | null) => void;
906
+ setCaptionAppearance: (appearance: Partial<PanoVideoCaptionAppearance>) => void;
907
+ };
908
+
909
+ type PanoVideoProps = {
910
+ /** Single-file shortcut when `variants` is omitted. */
911
+ src?: string;
912
+ poster?: string;
913
+ variants?: readonly PanoVideoVariant[];
914
+ defaultVariantId?: string;
915
+ tracks?: readonly PanoVideoTrack[];
916
+ /**
917
+ * Caption overlay. `true` / omit uses the default appearance; `false`
918
+ * hides captions and the control-bar language menu; an object merges
919
+ * with the defaults.
920
+ */
921
+ captions?: boolean | PanoVideoCaptionAppearance;
922
+ /**
923
+ * Playback chrome. `true` / omit mounts the default bar; `false` skips
924
+ * it; an object mounts the default bar with appearance overrides.
925
+ * Render `PanoVideoControls` as a PanoViewer child to replace the default.
926
+ */
927
+ controls?: boolean | PanoVideoControlsAppearance;
928
+ /** Horizontal video offset in degrees. */
929
+ yawOffset?: number;
930
+ loop?: boolean;
931
+ muted?: boolean;
932
+ volume?: number;
933
+ autoPlay?: boolean;
934
+ playsInline?: boolean;
935
+ preload?: "none" | "metadata" | "auto";
936
+ crossOrigin?: "" | "anonymous" | "use-credentials";
937
+ playbackRates?: readonly number[];
938
+ /** Keeps the source mounted for preloading without drawing it. */
939
+ visible?: boolean;
940
+ onLoad?: () => void;
941
+ onError?: (event: PanoVideoErrorEvent) => void;
942
+ onPlaybackStateChange?: (state: VideoPlaybackState) => void;
943
+ onEnded?: () => void;
944
+ onVariantChange?: (id: string) => void;
945
+ onTrackChange?: (id: string | null) => void;
946
+ };
947
+ /**
948
+ * Equirectangular 360 video mapped onto the panorama sphere. Mount inside
949
+ * PanoViewer. Default playback chrome and captions portal to the viewer overlay.
950
+ */
951
+ declare function PanoVideo({ src, poster, variants: variantsProp, defaultVariantId, tracks: tracksProp, captions, controls, yawOffset, loop, muted, volume, autoPlay, playsInline, preload, crossOrigin, playbackRates, visible, onLoad, onError, onPlaybackStateChange, onEnded, onVariantChange, onTrackChange, }: PanoVideoProps): react.JSX.Element | null;
952
+
953
+ declare const DEFAULT_PANO_VIDEO_CONTROLS_APPEARANCE: Required<PanoVideoControlsAppearance>;
954
+ type PanoVideoControlsProps = {
955
+ appearance?: PanoVideoControlsAppearance;
956
+ };
957
+ /**
958
+ * Claims the default playback chrome slot for a custom replacement.
959
+ * Render inside PanoViewer when overriding the built-in controls.
960
+ */
961
+ declare function PanoVideoControls({ appearance }: PanoVideoControlsProps): null;
962
+
963
+ declare const DEFAULT_PANO_VIDEO_PLAYBACK_RATES: readonly [0.5, 1, 1.25, 1.5, 2];
964
+
965
+ declare const DEFAULT_PANO_VIDEO_CAPTION_APPEARANCE: Required<PanoVideoCaptionAppearance>;
966
+
967
+ type SceneTransitionPreset = "none" | "crossfade" | "zoom" | "blackout" | "whiteFlash" | "slideRightToLeft" | "slideTopToBottom" | "slideDiagonal" | "circleOpen" | "verticalOpen" | "horizontalOpen" | "ellipticZoomOpen" | "pixelate" | "gridWipe" | "gridWipeUp" | "gridWipeRight" | "gridWipeDiagonal" | "gridWipeCenter" | "gridWipeChecker" | "dissolve" | "shatter" | "particles" | "glitch" | "swirl" | "clockWipe" | "ripple" | "zoomBlur" | "hexDissolve" | "filmBurn";
968
+ type SceneTransition = SceneTransitionPreset | {
969
+ preset: SceneTransitionPreset;
970
+ /** Overrides the preset default duration in seconds. */
971
+ duration?: number;
972
+ };
973
+
606
974
  type CubeFaceCode = "f" | "r" | "b" | "l" | "u" | "d";
607
975
  type TileAddress = {
608
976
  face: CubeFaceCode;
@@ -668,12 +1036,6 @@ type TileProps = {
668
1036
  onLevelChange?: (level: number) => void;
669
1037
  };
670
1038
 
671
- type SceneTransitionPreset = "none" | "crossfade" | "zoom" | "blackout" | "whiteFlash" | "slideRightToLeft" | "slideTopToBottom" | "slideDiagonal" | "circleOpen" | "verticalOpen" | "horizontalOpen" | "ellipticZoomOpen";
672
- type SceneTransition = SceneTransitionPreset | {
673
- preset: SceneTransitionPreset;
674
- /** Overrides the KRpano-compatible default duration in seconds. */
675
- duration?: number;
676
- };
677
1039
  type SphereScene = {
678
1040
  id: string;
679
1041
  type: "sphere";
@@ -739,6 +1101,10 @@ type PolygonHotspotProps = Omit<HotspotCommonProps, "position" | "width" | "heig
739
1101
  strokeWidth?: number;
740
1102
  /** Opacity of the polygon boundary, from 0 to 1. Defaults to 1. */
741
1103
  strokeOpacity?: number;
1104
+ /** Dash length in CSS pixels. Omit or 0 for a solid stroke. */
1105
+ strokeDashSize?: number;
1106
+ /** Gap length in CSS pixels. Defaults to `strokeDashSize` when dashed. */
1107
+ strokeGapSize?: number;
742
1108
  onVerticesChange?: (event: PolygonVerticesChangeEvent) => void;
743
1109
  onDragStart?: (event: PolygonVerticesChangeEvent) => void;
744
1110
  onDragEnd?: (event: PolygonVerticesChangeEvent) => void;
@@ -749,7 +1115,7 @@ type UnwrappedVertex = HotspotPosition & {
749
1115
  };
750
1116
  declare function unwrapPolygonVertices(vertices: HotspotPosition[]): UnwrappedVertex[];
751
1117
  declare function validatePolygonVertices(vertices: HotspotPosition[]): PolygonValidationIssue[];
752
- declare function PolygonHotspot({ id, vertices, fill, fillOpacity, stroke, strokeWidth, strokeOpacity, interactive, renderOrder, draggable, onVerticesChange, onDragStart, onDragEnd, onInvalid, ...anchorProps }: PolygonHotspotProps): react.JSX.Element | null;
1118
+ declare function PolygonHotspot({ id, vertices, fill, fillOpacity, stroke, strokeWidth, strokeOpacity, strokeDashSize, strokeGapSize, interactive, renderOrder, draggable, onVerticesChange, onDragStart, onDragEnd, onInvalid, ...anchorProps }: PolygonHotspotProps): react.JSX.Element | null;
753
1119
 
754
1120
  type PolylineValidationIssue = {
755
1121
  code: "too_few_vertices";
@@ -768,13 +1134,17 @@ type PolylineHotspotProps = Omit<HotspotCommonProps, "position" | "width" | "hei
768
1134
  /** Screen-space line width in CSS pixels. Defaults to 2. */
769
1135
  strokeWidth?: number;
770
1136
  strokeOpacity?: number;
1137
+ /** Dash length in CSS pixels. Omit or 0 for a solid stroke. */
1138
+ strokeDashSize?: number;
1139
+ /** Gap length in CSS pixels. Defaults to `strokeDashSize` when dashed. */
1140
+ strokeGapSize?: number;
771
1141
  onVerticesChange?: (event: PolylineVerticesChangeEvent) => void;
772
1142
  onDragStart?: (event: PolylineVerticesChangeEvent) => void;
773
1143
  onDragEnd?: (event: PolylineVerticesChangeEvent) => void;
774
1144
  onInvalid?: (issues: PolylineValidationIssue[]) => void;
775
1145
  };
776
1146
  declare function validatePolylineVertices(vertices: HotspotPosition[]): PolylineValidationIssue[];
777
- declare function PolylineHotspot({ id, vertices, stroke, strokeWidth, strokeOpacity, renderOrder, draggable, onVerticesChange, onDragStart, onDragEnd, onInvalid, ...anchorProps }: PolylineHotspotProps): react.JSX.Element | null;
1147
+ declare function PolylineHotspot({ id, vertices, stroke, strokeWidth, strokeOpacity, strokeDashSize, strokeGapSize, renderOrder, draggable, onVerticesChange, onDragStart, onDragEnd, onInvalid, ...anchorProps }: PolylineHotspotProps): react.JSX.Element | null;
778
1148
 
779
1149
  type GraphicPaint = {
780
1150
  fill?: string;
@@ -857,29 +1227,6 @@ type SequenceHotspotProps = HotspotCommonProps & {
857
1227
  };
858
1228
  declare function SequenceHotspot({ id, src, frameCount: requestedFrameCount, frameDirection, playing, fps, loop, width, height, opacity, onFrameChange, onLoadProgress, onPlaybackStateChange, onEnded, onError, ...anchorProps }: SequenceHotspotProps): react.JSX.Element;
859
1229
 
860
- type VideoPlaybackState = "playing" | "paused" | "ended" | "blocked";
861
- type VideoHotspotErrorEvent = {
862
- id: string;
863
- source: "poster" | "video";
864
- error: unknown;
865
- };
866
- type VideoHotspotProps = HotspotCommonProps & {
867
- src: string;
868
- playing: boolean;
869
- poster?: string;
870
- loop?: boolean;
871
- muted?: boolean;
872
- volume?: number;
873
- playsInline?: boolean;
874
- preload?: "none" | "metadata" | "auto";
875
- crossOrigin?: "" | "anonymous" | "use-credentials";
876
- onPlaybackStateChange?: (state: VideoPlaybackState) => void;
877
- onPlaybackError?: (error: unknown) => void;
878
- onEnded?: () => void;
879
- onError?: (event: VideoHotspotErrorEvent) => void;
880
- };
881
- declare function VideoHotspot({ id, src, playing, poster, loop, muted, volume, playsInline, preload, crossOrigin, width, height, opacity, onPlaybackStateChange, onPlaybackError, onEnded, onError, ...anchorProps }: VideoHotspotProps): react.JSX.Element;
882
-
883
1230
  type TextHotspotAlign = "left" | "center" | "right";
884
1231
  type TextHotspotVerticalAlign = "top" | "middle" | "bottom";
885
1232
  type TextHotspotWhiteSpace = "normal" | "nowrap";
@@ -887,9 +1234,11 @@ type TextHotspotFontStyle = "normal" | "italic";
887
1234
  /** Serializable typography and panel paint for a text hotspot. */
888
1235
  type TextHotspotStyle = {
889
1236
  fontFamily?: string;
890
- /** Fraction of the texture height. Defaults to 0.18. */
1237
+ /** Canvas pixels. Defaults to 96. */
891
1238
  fontSize?: number;
1239
+ /** CSS font-weight. Defaults to 600. */
892
1240
  fontWeight?: number | string;
1241
+ /** CSS font-style. Defaults to `"normal"`. */
893
1242
  fontStyle?: TextHotspotFontStyle;
894
1243
  color?: string;
895
1244
  /** CSS color. An empty string skips the panel fill. */
@@ -931,7 +1280,7 @@ type IframeHotspotProps = HotspotCommonProps & {
931
1280
  onLoad?: () => void;
932
1281
  onError?: (error: unknown) => void;
933
1282
  };
934
- declare function IframeHotspot({ src, title, sandbox, allow, referrerPolicy, loading, pointerPolicy, background, opacity, width, height, onLoad, onError, ...anchorProps }: IframeHotspotProps): react.JSX.Element;
1283
+ declare function IframeHotspot({ src, title, sandbox, allow, referrerPolicy, loading, pointerPolicy, background, opacity, width, height, onLoad, onError, interactive, pointerEvents, ...anchorProps }: IframeHotspotProps): react.JSX.Element;
935
1284
 
936
1285
  declare function Tile({ baseUrl, multires, previewUrl, previewFaceOrder, urlTemplate, resolveTileUrl, maxTextureMemoryMb, maxConcurrentLoads, retryCount, loadMode, visible, onReady, onPreviewError, onLoadProgress, onTileError, onLevelChange, }: TileProps): react.JSX.Element;
937
1286
 
@@ -942,6 +1291,7 @@ declare function panoPositionToVector3(position: HotspotPosition, radius?: numbe
942
1291
  declare function vector3ToPanoPosition(vector: Pick<Vector3, "x" | "y" | "z">): HotspotPosition;
943
1292
 
944
1293
  declare const DEFAULT_HOTSPOT_TOOLTIP_OFFSET = 12;
1294
+ declare const DEFAULT_HOTSPOT_TOOLTIP_APPEARANCE: Required<HotspotTooltipAppearance>;
945
1295
 
946
1296
  /** Shared serializable fields for every saved hotspot definition. */
947
1297
  type HotspotDefinitionBase = {
@@ -950,6 +1300,8 @@ type HotspotDefinitionBase = {
950
1300
  label?: string;
951
1301
  visible?: boolean;
952
1302
  interactive?: boolean;
1303
+ /** Pointer hit-testing. `"none"` ignores mouse, touch, and pen. */
1304
+ pointerEvents?: HotspotPointerEvents;
953
1305
  /** Canvas cursor while this hotspot is hovered. */
954
1306
  cursor?: CSSProperties["cursor"];
955
1307
  renderOrder?: number;
@@ -957,6 +1309,7 @@ type HotspotDefinitionBase = {
957
1309
  tooltipTrigger?: HotspotTooltipTrigger;
958
1310
  tooltipPlacement?: HotspotTooltipPlacement;
959
1311
  tooltipOffset?: number;
1312
+ tooltipAppearance?: HotspotTooltipAppearance;
960
1313
  };
961
1314
  /** Shared serializable fields for a hotspot anchored at one yaw/pitch point. */
962
1315
  type PointHotspotDefinitionBase = HotspotDefinitionBase & {
@@ -1023,6 +1376,8 @@ type PolygonHotspotDefinition = HotspotDefinitionBase & {
1023
1376
  stroke?: string;
1024
1377
  strokeWidth?: number;
1025
1378
  strokeOpacity?: number;
1379
+ strokeDashSize?: number;
1380
+ strokeGapSize?: number;
1026
1381
  };
1027
1382
  /** An open path. This extends the original point and polygon hotspot categories. */
1028
1383
  type PolylineHotspotDefinition = HotspotDefinitionBase & {
@@ -1031,9 +1386,11 @@ type PolylineHotspotDefinition = HotspotDefinitionBase & {
1031
1386
  stroke?: string;
1032
1387
  strokeWidth?: number;
1033
1388
  strokeOpacity?: number;
1389
+ strokeDashSize?: number;
1390
+ strokeGapSize?: number;
1034
1391
  };
1035
1392
  type PointHotspotDefinition = ImageHotspotDefinition | GraphicHotspotDefinition | SequenceHotspotDefinition | VideoHotspotDefinition | TextHotspotDefinition | IframeHotspotDefinition;
1036
1393
  /** A serializable, discriminated hotspot collection item. */
1037
1394
  type HotspotDefinition = PointHotspotDefinition | PolygonHotspotDefinition | PolylineHotspotDefinition;
1038
1395
 
1039
- export { type ArrowGraphic, AutoRotate, type AutoRotateProps, type CircleGraphic, type CubeFaceCode, DEFAULT_HOTSPOT_TOOLTIP_OFFSET, DEFAULT_PANO_CURSORS, type DiamondGraphic, type GraphicDefinition, GraphicHotspot, type GraphicHotspotDefinition, type GraphicHotspotProps, type HotspotCommonProps, type HotspotDefinition, type HotspotDefinitionBase, type HotspotDragEvent, type HotspotInputSource, type HotspotInteractionEvent, type HotspotMode, type HotspotPosition, type HotspotScaleMode, type HotspotTooltipContent, type HotspotTooltipPlacement, type HotspotTooltipTrigger, IframeHotspot, type IframeHotspotDefinition, type IframeHotspotProps, type IframePointerPolicy, ImageHotspot, type ImageHotspotDefinition, type ImageHotspotProps, type KeyboardControlAction, type KeyboardControlKeys, KeyboardControls, type KeyboardControlsProps, MAX_HOTSPOT_PITCH, MIN_PANO_CONTEXT_MENU_BACKGROUND_OPACITY, type MouseControlButton, MouseControls, type MouseControlsOptions, type MouseControlsProps, PanoContextMenu, type PanoContextMenuActionItem, type PanoContextMenuAppearance, type PanoContextMenuEntry, type PanoContextMenuItem, type PanoContextMenuPresetActions, type PanoContextMenuPresetId, type PanoContextMenuPresetRef, type PanoContextMenuPresets, type PanoContextMenuProps, type PanoContextMenuRenderProps, type PanoContextMenuSelectContext, type PanoContextMenuSeparatorItem, type PanoCursor, type PanoCursors, type PanoEventBus, type PanoEventListener, type PanoEventMap, type PanoEventType, PanoEvents, type PanoEventsProps, type PanoResizeEvent, PanoViewer, type PanoViewerHandle, type PanoViewerProps, type PanoViewerState, type PanoWheelEvent, type PanoramaControlsOptions, type PanoramaPointerEvent, type PointHotspotDefinition, type PointHotspotDefinitionBase, PolygonHotspot, type PolygonHotspotDefinition, type PolygonHotspotProps, type PolygonValidationCode, type PolygonValidationIssue, type PolygonVerticesChangeEvent, PolylineHotspot, type PolylineHotspotDefinition, type PolylineHotspotProps, type PolylineValidationIssue, type PolylineVerticesChangeEvent, type RectangleGraphic, type RingGraphic, type Scene, type SceneTransition, type SceneTransitionEndEvent, type SceneTransitionErrorEvent, type SceneTransitionPreset, Scenes, type ScenesProps, type SequenceFrameDirection, type SequenceFrameEvent, SequenceHotspot, type SequenceHotspotDefinition, type SequenceHotspotErrorEvent, type SequenceHotspotProps, type SequenceLoadProgress, type SequencePlaybackState, type SetPanoViewerOptions, Sphere, type SphereProps, type SphereScene, type StarGraphic, type SvgGraphic, type SvgPathGraphic, TextHotspot, type TextHotspotAlign, type TextHotspotDefinition, type TextHotspotFontStyle, type TextHotspotProps, type TextHotspotStyle, type TextHotspotVerticalAlign, type TextHotspotWhiteSpace, Tile, type TileAddress, type TileLoadError, type TileLoadProgress, type TileMultiresConfig, type TileProps, type TileScene, TouchControls, type TouchControlsOptions, type TouchControlsProps, type TriangleGraphic, VideoHotspot, type VideoHotspotDefinition, type VideoHotspotErrorEvent, type VideoHotspotProps, type VideoPlaybackState, type ViewInteractionEvent, type ViewInteractionSource, clampPanoPitch, composePanoContextMenuItems, createDefaultPanoContextMenuItems, createPanoContextMenuPresets, cycleSceneId, normalizePanoPosition, normalizePanoYaw, panoPositionToVector3, resolvePanoContextMenuEntries, unwrapPolygonVertices, usePanoEvents, validatePolygonVertices, validatePolylineVertices, vector3ToPanoPosition };
1396
+ export { type ArrowGraphic, AutoRotate, type AutoRotateProps, type CircleGraphic, type CubeFaceCode, DEFAULT_HOTSPOT_TOOLTIP_APPEARANCE, DEFAULT_HOTSPOT_TOOLTIP_OFFSET, DEFAULT_PANO_CURSORS, DEFAULT_PANO_VIDEO_CAPTION_APPEARANCE, DEFAULT_PANO_VIDEO_CONTROLS_APPEARANCE, DEFAULT_PANO_VIDEO_PLAYBACK_RATES, DEFAULT_WEBVR_CHROME_APPEARANCE, DEFAULT_WEBVR_CURSOR_DWELL_MS, type DiamondGraphic, type GraphicDefinition, GraphicHotspot, type GraphicHotspotDefinition, type GraphicHotspotProps, Gyro, type GyroHandle, type GyroProps, type GyroTouchMode, type HotspotCommonProps, type HotspotDefinition, type HotspotDefinitionBase, type HotspotDragEvent, type HotspotInputSource, type HotspotInteractionEvent, type HotspotMode, type HotspotPointerEvents, type HotspotPosition, type HotspotScaleMode, type HotspotTooltipAppearance, type HotspotTooltipContent, type HotspotTooltipPlacement, type HotspotTooltipTrigger, IframeHotspot, type IframeHotspotDefinition, type IframeHotspotProps, type IframePointerPolicy, ImageHotspot, type ImageHotspotDefinition, type ImageHotspotProps, type KeyboardControlAction, type KeyboardControlKeys, KeyboardControls, type KeyboardControlsProps, MAX_HOTSPOT_PITCH, MIN_PANO_CONTEXT_MENU_BACKGROUND_OPACITY, type MouseControlButton, MouseControls, type MouseControlsOptions, type MouseControlsProps, PANO_FILTER_PRESETS, PanoContextMenu, type PanoContextMenuActionItem, type PanoContextMenuAppearance, type PanoContextMenuEntry, type PanoContextMenuItem, type PanoContextMenuPresetActions, type PanoContextMenuPresetId, type PanoContextMenuPresetRef, type PanoContextMenuPresets, type PanoContextMenuProps, type PanoContextMenuRenderProps, type PanoContextMenuSelectContext, type PanoContextMenuSeparatorItem, type PanoCursor, type PanoCursors, type PanoEventBus, type PanoEventListener, type PanoEventMap, type PanoEventType, PanoEvents, type PanoEventsProps, PanoFilter, type PanoFilterPreset, type PanoFilterProps, type PanoResizeEvent, PanoVideo, type PanoVideoCaptionAppearance, type PanoVideoController, PanoVideoControls, type PanoVideoControlsAppearance, type PanoVideoControlsProps, type PanoVideoErrorEvent, type PanoVideoErrorSource, type PanoVideoPlaybackSnapshot, type PanoVideoProps, type PanoVideoSource, type PanoVideoTrack, type PanoVideoTrackKind, type PanoVideoVariant, PanoViewer, type PanoViewerHandle, type PanoViewerProps, type PanoViewerState, type PanoWheelEvent, type PanoramaControlsOptions, type PanoramaPointerEvent, type PointHotspotDefinition, type PointHotspotDefinitionBase, PolygonHotspot, type PolygonHotspotDefinition, type PolygonHotspotProps, type PolygonValidationCode, type PolygonValidationIssue, type PolygonVerticesChangeEvent, PolylineHotspot, type PolylineHotspotDefinition, type PolylineHotspotProps, type PolylineValidationIssue, type PolylineVerticesChangeEvent, type RectangleGraphic, type RingGraphic, type Scene, type SceneTransition, type SceneTransitionEndEvent, type SceneTransitionErrorEvent, type SceneTransitionPreset, Scenes, type ScenesProps, type SequenceFrameDirection, type SequenceFrameEvent, SequenceHotspot, type SequenceHotspotDefinition, type SequenceHotspotErrorEvent, type SequenceHotspotProps, type SequenceLoadProgress, type SequencePlaybackState, type SetPanoViewerOptions, Sphere, type SphereProps, type SphereScene, type StarGraphic, type SvgGraphic, type SvgPathGraphic, TextHotspot, type TextHotspotAlign, type TextHotspotDefinition, type TextHotspotFontStyle, type TextHotspotProps, type TextHotspotStyle, type TextHotspotVerticalAlign, type TextHotspotWhiteSpace, Tile, type TileAddress, type TileLoadError, type TileLoadProgress, type TileMultiresConfig, type TileProps, type TileScene, TouchControls, type TouchControlsOptions, type TouchControlsProps, type TriangleGraphic, VideoHotspot, type VideoHotspotDefinition, type VideoHotspotErrorEvent, type VideoHotspotProps, type VideoPlaybackState, type ViewInteractionEvent, type ViewInteractionSource, WEBVR_PROFILES, WEBVR_PROFILE_IDS, WebVR, type WebVRChrome, type WebVRChromeAppearance, type WebVRHandle, type WebVRMode, type WebVRProfile, type WebVRProfileId, type WebVRProps, type WebVRSettings, clampPanoPitch, composePanoContextMenuItems, createDefaultPanoContextMenuItems, createPanoContextMenuPresets, cycleSceneId, normalizePanoPosition, normalizePanoYaw, panoPositionToVector3, resolvePanoContextMenuEntries, unwrapPolygonVertices, usePanoEvents, validatePolygonVertices, validatePolylineVertices, vector3ToPanoPosition };