@ericchen1990/pano-view 3.4.1 → 3.5.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/README.md +527 -74
- package/README.zh-CN.md +491 -72
- package/dist/data.cjs +903 -0
- package/dist/data.cjs.map +1 -0
- package/dist/data.d.mts +499 -0
- package/dist/data.d.ts +499 -0
- package/dist/data.mjs +880 -0
- package/dist/data.mjs.map +1 -0
- package/dist/index.cjs +8890 -8530
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +712 -562
- package/dist/index.d.ts +712 -562
- package/dist/index.mjs +8111 -7749
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -5
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { CSSProperties, ReactNode, ComponentPropsWithoutRef,
|
|
2
|
+
import { CSSProperties, ReactNode, ComponentPropsWithoutRef, IframeHTMLAttributes, RefObject } from 'react';
|
|
3
3
|
import { Texture, ColorRepresentation, Vector3 } from 'three';
|
|
4
4
|
|
|
5
5
|
declare const MAX_HOTSPOT_PITCH = 90;
|
|
@@ -229,6 +229,10 @@ type VideoHotspotProps = HotspotCommonProps & {
|
|
|
229
229
|
loop?: boolean;
|
|
230
230
|
muted?: boolean;
|
|
231
231
|
volume?: number;
|
|
232
|
+
/**
|
|
233
|
+
* Keep playback in the page. Defaults to true, including the WebKit and
|
|
234
|
+
* X5 attributes for iPhone Safari, WeChat, QQ, and UC.
|
|
235
|
+
*/
|
|
232
236
|
playsInline?: boolean;
|
|
233
237
|
preload?: "none" | "metadata" | "auto";
|
|
234
238
|
crossOrigin?: "" | "anonymous" | "use-credentials";
|
|
@@ -801,342 +805,80 @@ declare const PanoViewer: react.ForwardRefExoticComponent<Omit<Omit<react.Detail
|
|
|
801
805
|
dpr?: number | [number, number];
|
|
802
806
|
} & react.RefAttributes<PanoViewerHandle>>;
|
|
803
807
|
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
}
|
|
818
|
-
/**
|
|
819
|
-
* Adds automatic rotation to the nearest PanoViewer. Render one instance as a
|
|
820
|
-
* child of PanoViewer, alongside its panorama source.
|
|
821
|
-
*/
|
|
822
|
-
declare function AutoRotate({ enabled, speed, acceleration, startDelay, }: AutoRotateProps): null;
|
|
823
|
-
|
|
824
|
-
type AudioPlaybackState = "playing" | "paused" | "ended" | "blocked";
|
|
825
|
-
type AudioHotspotErrorEvent = {
|
|
826
|
-
id: string;
|
|
827
|
-
error: unknown;
|
|
828
|
-
};
|
|
829
|
-
type AudioHotspotProps = HotspotCommonProps & {
|
|
830
|
-
src: string | string[];
|
|
831
|
-
playing: boolean;
|
|
832
|
-
loop?: boolean;
|
|
833
|
-
muted?: boolean;
|
|
834
|
-
volume?: number;
|
|
835
|
-
/** Degrees of look-away before the source is silent. Defaults to 360 (no look attenuation). */
|
|
836
|
-
range?: number;
|
|
837
|
-
pauseWhenHidden?: boolean;
|
|
838
|
-
/** Optional stopped-state image. When omitted, a built-in speaker icon is used. */
|
|
839
|
-
icon?: string;
|
|
840
|
-
/** Optional playing-state image. Falls back to `icon`, then the built-in playing icon. */
|
|
841
|
-
playingIcon?: string;
|
|
842
|
-
/** When false, no visual marker is rendered. Audio still plays. Defaults to true. */
|
|
843
|
-
marker?: boolean;
|
|
844
|
-
crossOrigin?: "" | "anonymous" | "use-credentials";
|
|
845
|
-
onPlaybackStateChange?: (state: AudioPlaybackState) => void;
|
|
846
|
-
onPlaybackError?: (error: unknown) => void;
|
|
847
|
-
onEnded?: () => void;
|
|
848
|
-
onError?: (event: AudioHotspotErrorEvent) => void;
|
|
849
|
-
};
|
|
850
|
-
declare function AudioHotspot({ id, src, playing, loop, muted, volume, range, pauseWhenHidden, icon, playingIcon, marker, crossOrigin, width, height, opacity, onPlaybackStateChange, onPlaybackError, onEnded, onError, ...anchorProps }: AudioHotspotProps): react.JSX.Element;
|
|
808
|
+
type PanoDataErrorCode = "INVALID_OPTIONS" | "FETCH_FAILED" | "HTTP_ERROR" | "INVALID_JSON" | "INVALID_CONFIG" | "UNSUPPORTED_SCHEMA_VERSION" | "UNSUPPORTED_PROJECTION" | "INVALID_PROJECT" | "INVALID_REFERENCE" | "ABORTED";
|
|
809
|
+
declare class PanoDataError extends Error {
|
|
810
|
+
readonly code: PanoDataErrorCode;
|
|
811
|
+
readonly status?: number;
|
|
812
|
+
readonly sceneId?: string;
|
|
813
|
+
readonly field?: string;
|
|
814
|
+
readonly cause?: unknown;
|
|
815
|
+
constructor(code: PanoDataErrorCode, message: string, details?: {
|
|
816
|
+
status?: number;
|
|
817
|
+
sceneId?: string;
|
|
818
|
+
field?: string;
|
|
819
|
+
cause?: unknown;
|
|
820
|
+
});
|
|
821
|
+
}
|
|
851
822
|
|
|
852
|
-
|
|
853
|
-
type
|
|
854
|
-
|
|
823
|
+
/** The portable rendering contract shared by the converter and browser viewer. */
|
|
824
|
+
type ViewerCubeFace = "f" | "r" | "b" | "l" | "u" | "d";
|
|
825
|
+
type CubemapViewerConfig = {
|
|
826
|
+
type: "tile";
|
|
827
|
+
multires: {
|
|
828
|
+
tileSize: number;
|
|
829
|
+
levels: number[];
|
|
830
|
+
};
|
|
831
|
+
urlTemplate: string;
|
|
832
|
+
previewUrl: string;
|
|
833
|
+
previewFaceOrder: ViewerCubeFace[];
|
|
855
834
|
};
|
|
856
|
-
type
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
playing?: boolean;
|
|
869
|
-
/** Initial playing state when `playing` is omitted. Defaults to false. */
|
|
870
|
-
defaultPlaying?: boolean;
|
|
871
|
-
/** Defaults to true. */
|
|
872
|
-
loop?: boolean;
|
|
873
|
-
muted?: boolean;
|
|
874
|
-
volume?: number;
|
|
875
|
-
pauseWhenHidden?: boolean;
|
|
876
|
-
/** Crossfade duration when the resolved track changes. Defaults to 400; 0 is a hard cut. */
|
|
877
|
-
fadeMs?: number;
|
|
878
|
-
crossOrigin?: "" | "anonymous" | "use-credentials";
|
|
879
|
-
onPlaybackStateChange?: (state: AudioPlaybackState) => void;
|
|
880
|
-
onPlaybackError?: (error: unknown) => void;
|
|
881
|
-
onEnded?: () => void;
|
|
882
|
-
onError?: (event: BackgroundAudioErrorEvent) => void;
|
|
835
|
+
type SphereViewerConfig = {
|
|
836
|
+
type: "sphereTile";
|
|
837
|
+
multires: {
|
|
838
|
+
tileSize: number;
|
|
839
|
+
levels: {
|
|
840
|
+
width: number;
|
|
841
|
+
height: number;
|
|
842
|
+
}[];
|
|
843
|
+
};
|
|
844
|
+
urlTemplate: string;
|
|
845
|
+
previewUrl: string;
|
|
846
|
+
indexBase: 0 | 1;
|
|
883
847
|
};
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
* renderHotspots.
|
|
888
|
-
*/
|
|
889
|
-
declare function BackgroundAudio({ src, sources, sceneId, playing: controlledPlaying, defaultPlaying, loop, muted, volume, pauseWhenHidden, fadeMs, crossOrigin, onPlaybackStateChange, onPlaybackError, onEnded, onError, }: BackgroundAudioProps): null;
|
|
890
|
-
|
|
891
|
-
declare const PANO_FILTER_PRESETS: readonly ["none", "grayscale", "sepia", "vintage", "cool", "warm", "pencil", "coloredPencil", "crayon", "watercolor", "cartoon", "crosshatch"];
|
|
892
|
-
type PanoFilterPreset = (typeof PANO_FILTER_PRESETS)[number];
|
|
893
|
-
/** Row-major 4×5 RGBA matrix, applied in display (sRGB) space like an SVG color matrix. */
|
|
894
|
-
type PanoColorMatrix = readonly [
|
|
895
|
-
number,
|
|
896
|
-
number,
|
|
897
|
-
number,
|
|
898
|
-
number,
|
|
899
|
-
number,
|
|
900
|
-
number,
|
|
901
|
-
number,
|
|
902
|
-
number,
|
|
903
|
-
number,
|
|
904
|
-
number,
|
|
905
|
-
number,
|
|
906
|
-
number,
|
|
907
|
-
number,
|
|
908
|
-
number,
|
|
909
|
-
number,
|
|
910
|
-
number,
|
|
911
|
-
number,
|
|
912
|
-
number,
|
|
913
|
-
number,
|
|
914
|
-
number
|
|
915
|
-
];
|
|
916
|
-
|
|
917
|
-
type PanoFilterProps = {
|
|
918
|
-
/** Built-in look. Defaults to `none` (identity). */
|
|
919
|
-
preset?: PanoFilterPreset;
|
|
920
|
-
/** Mix with the original panorama, 0–1. Defaults to 1. */
|
|
921
|
-
intensity?: number;
|
|
922
|
-
/** Display-space RGBA matrix applied after the artistic preset. */
|
|
923
|
-
colorMatrix?: PanoColorMatrix | null;
|
|
924
|
-
/** `all` also filters hotspot textures. HTML tooltips/chrome remain host-styled. */
|
|
925
|
-
colorMatrixScope?: "panorama" | "all";
|
|
926
|
-
/** When false, the panorama renders without a filter. Defaults to true. */
|
|
927
|
-
enabled?: boolean;
|
|
848
|
+
type ViewerConfig = CubemapViewerConfig | SphereViewerConfig;
|
|
849
|
+
type ViewerDocument = ViewerConfig & {
|
|
850
|
+
schemaVersion: 1;
|
|
928
851
|
};
|
|
929
|
-
/**
|
|
930
|
-
* Applies a color or artistic filter to the panorama source of the nearest
|
|
931
|
-
* PanoViewer. Render one instance as a child of PanoViewer. colorMatrixScope
|
|
932
|
-
* can include hotspot textures; HTML chrome remains host-styled.
|
|
933
|
-
*/
|
|
934
|
-
declare function PanoFilter({ preset, intensity, enabled, colorMatrix, colorMatrixScope, }: PanoFilterProps): null;
|
|
935
|
-
|
|
936
|
-
type GyroTouchMode = "off" | "horizontaloffset" | "full" | "disablegyro";
|
|
937
852
|
|
|
938
|
-
type
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
* Requests iOS sensor permission. Call this directly from a user gesture
|
|
944
|
-
* before setting `enabled` to true.
|
|
945
|
-
*/
|
|
946
|
-
requestPermission: () => Promise<boolean>;
|
|
947
|
-
};
|
|
948
|
-
type GyroProps = {
|
|
949
|
-
/** Whether device-orientation control is requested. Defaults to false. */
|
|
950
|
-
enabled?: boolean;
|
|
951
|
-
/** Whether device roll levels the camera. Defaults to true. */
|
|
952
|
-
camroll?: boolean;
|
|
953
|
-
/** Whether to follow compass-oriented headings. Defaults to false. */
|
|
954
|
-
absolute?: boolean;
|
|
955
|
-
/** Panorama yaw that represents North, in degrees. Defaults to 0. */
|
|
956
|
-
north?: number;
|
|
957
|
-
/** Sensor smoothing from 0 (none) to 0.99 (strong). Defaults to 0. */
|
|
958
|
-
friction?: number;
|
|
959
|
-
/** How touch dragging combines with gyro movement. Defaults to "full". */
|
|
960
|
-
touchMode?: GyroTouchMode;
|
|
961
|
-
/** Seconds used to blend from the current view when enabling. Defaults to 0.5. */
|
|
962
|
-
softstart?: number;
|
|
963
|
-
/** Allow capability detection on desktop-class devices. Defaults to false. */
|
|
964
|
-
desktopSupport?: boolean;
|
|
965
|
-
onAvailable?: () => void;
|
|
966
|
-
onUnavailable?: () => void;
|
|
967
|
-
onEnable?: () => void;
|
|
968
|
-
onDisable?: () => void;
|
|
969
|
-
onDenied?: () => void;
|
|
853
|
+
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";
|
|
854
|
+
type SceneTransition = SceneTransitionPreset | {
|
|
855
|
+
preset: SceneTransitionPreset;
|
|
856
|
+
/** Overrides the preset default duration in seconds. */
|
|
857
|
+
duration?: number;
|
|
970
858
|
};
|
|
971
|
-
/**
|
|
972
|
-
* Adds device-orientation navigation to the nearest PanoViewer.
|
|
973
|
-
* Sensor access is opt-in and disabled by default.
|
|
974
|
-
*/
|
|
975
|
-
declare const Gyro: react.ForwardRefExoticComponent<GyroProps & react.RefAttributes<GyroHandle>>;
|
|
976
|
-
|
|
977
|
-
declare const WebVR: react.ForwardRefExoticComponent<WebVRProps & react.RefAttributes<WebVRHandle>>;
|
|
978
|
-
|
|
979
|
-
declare const DEFAULT_WEBVR_CHROME_APPEARANCE: Required<Omit<WebVRChromeAppearance, "setupTitle">>;
|
|
980
|
-
|
|
981
|
-
declare const WEBVR_PROFILE_IDS: readonly ["none", "cardboard-v1", "cardboard-v2", "gear-vr", "daydream"];
|
|
982
|
-
declare const WEBVR_PROFILES: Record<WebVRProfileId, WebVRProfile>;
|
|
983
|
-
|
|
984
|
-
declare const DEFAULT_WEBVR_CURSOR_DWELL_MS = 1500;
|
|
985
859
|
|
|
986
|
-
type
|
|
987
|
-
type
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
860
|
+
type CubeFaceCode = "f" | "r" | "b" | "l" | "u" | "d";
|
|
861
|
+
type TileAddress = {
|
|
862
|
+
face: CubeFaceCode;
|
|
863
|
+
level: number;
|
|
864
|
+
row: number;
|
|
865
|
+
col: number;
|
|
866
|
+
faceSize: number;
|
|
867
|
+
tileSize: number;
|
|
993
868
|
width: number;
|
|
994
869
|
height: number;
|
|
995
870
|
};
|
|
996
|
-
type
|
|
997
|
-
|
|
871
|
+
type TileMultiresConfig = {
|
|
872
|
+
tileSize: number;
|
|
873
|
+
/** Ascending face sizes. The first value maps to l1. */
|
|
874
|
+
levels: number[];
|
|
998
875
|
};
|
|
999
|
-
type
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
doubleclick: PanoramaPointerEvent;
|
|
1006
|
-
pointerdown: PanoramaPointerEvent;
|
|
1007
|
-
pointerup: PanoramaPointerEvent;
|
|
1008
|
-
pointermove: PanoramaPointerEvent;
|
|
1009
|
-
contextmenu: PanoramaPointerEvent;
|
|
1010
|
-
wheel: PanoWheelEvent;
|
|
1011
|
-
idle: undefined;
|
|
1012
|
-
idleend: undefined;
|
|
1013
|
-
enterfullscreen: undefined;
|
|
1014
|
-
exitfullscreen: undefined;
|
|
1015
|
-
resize: PanoResizeEvent;
|
|
1016
|
-
autorotatestart: undefined;
|
|
1017
|
-
autorotatestop: undefined;
|
|
1018
|
-
autorotateoneround: undefined;
|
|
1019
|
-
gyroavailable: undefined;
|
|
1020
|
-
gyrounavailable: undefined;
|
|
1021
|
-
gyroenable: undefined;
|
|
1022
|
-
gyrodisable: undefined;
|
|
1023
|
-
gyrodenied: undefined;
|
|
1024
|
-
vravailable: undefined;
|
|
1025
|
-
vrunavailable: undefined;
|
|
1026
|
-
vrenter: {
|
|
1027
|
-
mode: WebVRMode;
|
|
1028
|
-
};
|
|
1029
|
-
vrexit: {
|
|
1030
|
-
mode: WebVRMode;
|
|
1031
|
-
};
|
|
1032
|
-
vrdenied: {
|
|
1033
|
-
error?: unknown;
|
|
1034
|
-
};
|
|
1035
|
-
vrunknowndevice: undefined;
|
|
1036
|
-
};
|
|
1037
|
-
type PanoEventType = keyof PanoEventMap;
|
|
1038
|
-
type PanoEventListener<T extends PanoEventType> = (payload: PanoEventMap[T]) => void;
|
|
1039
|
-
type PanoEventBus = {
|
|
1040
|
-
subscribe: <T extends PanoEventType>(type: T, listener: PanoEventListener<T>) => () => void;
|
|
1041
|
-
emit: <T extends PanoEventType>(type: T, payload: PanoEventMap[T]) => void;
|
|
1042
|
-
};
|
|
1043
|
-
|
|
1044
|
-
type PanoEventsProps = {
|
|
1045
|
-
/**
|
|
1046
|
-
* Milliseconds without user interaction before `onIdle`. Defaults to 2000.
|
|
1047
|
-
* Each PanoEvents instance tracks idle independently.
|
|
1048
|
-
*/
|
|
1049
|
-
idleTime?: number;
|
|
1050
|
-
onViewChange?: (view: PanoViewerState) => void;
|
|
1051
|
-
onViewSettled?: (view: PanoViewerState) => void;
|
|
1052
|
-
onViewInteractionStart?: (event: ViewInteractionEvent) => void;
|
|
1053
|
-
onViewInteractionEnd?: (event: ViewInteractionEvent) => void;
|
|
1054
|
-
onClick?: (event: PanoramaPointerEvent) => void;
|
|
1055
|
-
onDoubleClick?: (event: PanoramaPointerEvent) => void;
|
|
1056
|
-
onPointerDown?: (event: PanoramaPointerEvent) => void;
|
|
1057
|
-
onPointerUp?: (event: PanoramaPointerEvent) => void;
|
|
1058
|
-
onPointerMove?: (event: PanoramaPointerEvent) => void;
|
|
1059
|
-
onContextMenu?: (event: PanoramaPointerEvent) => void;
|
|
1060
|
-
onWheel?: (event: PanoWheelEvent) => void;
|
|
1061
|
-
onIdle?: () => void;
|
|
1062
|
-
onIdleEnd?: () => void;
|
|
1063
|
-
onEnterFullscreen?: () => void;
|
|
1064
|
-
onExitFullscreen?: () => void;
|
|
1065
|
-
onResize?: (event: PanoResizeEvent) => void;
|
|
1066
|
-
onAutoRotateStart?: () => void;
|
|
1067
|
-
onAutoRotateStop?: () => void;
|
|
1068
|
-
onAutoRotateOneRound?: () => void;
|
|
1069
|
-
onGyroAvailable?: () => void;
|
|
1070
|
-
onGyroUnavailable?: () => void;
|
|
1071
|
-
onGyroEnable?: () => void;
|
|
1072
|
-
onGyroDisable?: () => void;
|
|
1073
|
-
onGyroDenied?: () => void;
|
|
1074
|
-
onVRAvailable?: () => void;
|
|
1075
|
-
onVRUnavailable?: () => void;
|
|
1076
|
-
onVREnter?: (mode: WebVRMode) => void;
|
|
1077
|
-
onVRExit?: (mode: WebVRMode) => void;
|
|
1078
|
-
onVRDenied?: (error?: unknown) => void;
|
|
1079
|
-
onVRUnknownDevice?: () => void;
|
|
1080
|
-
};
|
|
1081
|
-
/**
|
|
1082
|
-
* Subscribes to viewer-level panorama events. Must run inside PanoViewer.
|
|
1083
|
-
* Prefer the {@link PanoEvents} component for declarative usage.
|
|
1084
|
-
*/
|
|
1085
|
-
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;
|
|
1086
|
-
/**
|
|
1087
|
-
* Declarative viewer-level event listeners for the nearest PanoViewer.
|
|
1088
|
-
* Multiple instances may coexist; each tracks its own idle timer.
|
|
1089
|
-
*/
|
|
1090
|
-
declare function PanoEvents(props: PanoEventsProps): null;
|
|
1091
|
-
|
|
1092
|
-
type UsePanoViewerResult = PanoViewerHandle & {
|
|
1093
|
-
ref: RefObject<PanoViewerHandle | null>;
|
|
1094
|
-
};
|
|
1095
|
-
declare function usePanoViewer(): UsePanoViewerResult;
|
|
1096
|
-
|
|
1097
|
-
type MouseControlsProps = MouseControlsOptions & {
|
|
1098
|
-
/**
|
|
1099
|
-
* Maximum FOV change rate in degrees per second for wheel zoom. When
|
|
1100
|
-
* omitted, no extra rate cap is applied. Usually supplied by PanoViewer from
|
|
1101
|
-
* `controls.fovSpeed`.
|
|
1102
|
-
*/
|
|
1103
|
-
fovSpeed?: number;
|
|
1104
|
-
};
|
|
1105
|
-
/**
|
|
1106
|
-
* Adds mouse (and pen) drag / wheel navigation to the nearest PanoViewer.
|
|
1107
|
-
* Enabled by default; render this component only to override properties.
|
|
1108
|
-
*/
|
|
1109
|
-
declare function MouseControls({ enabled, rotateSpeed, zoomSpeed, wheel, invert, buttons, fovSpeed, }: MouseControlsProps): null;
|
|
1110
|
-
|
|
1111
|
-
type TouchControlsProps = TouchControlsOptions;
|
|
1112
|
-
/**
|
|
1113
|
-
* Adds touch drag and pinch-zoom navigation to the nearest PanoViewer.
|
|
1114
|
-
* Enabled by default; render this component only to override properties.
|
|
1115
|
-
*/
|
|
1116
|
-
declare function TouchControls({ enabled, rotateSpeed, invert, pinchZoom, }: TouchControlsProps): null;
|
|
1117
|
-
|
|
1118
|
-
type CubeFaceCode = "f" | "r" | "b" | "l" | "u" | "d";
|
|
1119
|
-
type TileAddress = {
|
|
1120
|
-
face: CubeFaceCode;
|
|
1121
|
-
level: number;
|
|
1122
|
-
row: number;
|
|
1123
|
-
col: number;
|
|
1124
|
-
faceSize: number;
|
|
1125
|
-
tileSize: number;
|
|
1126
|
-
width: number;
|
|
1127
|
-
height: number;
|
|
1128
|
-
};
|
|
1129
|
-
type TileMultiresConfig = {
|
|
1130
|
-
tileSize: number;
|
|
1131
|
-
/** Ascending face sizes. The first value maps to l1. */
|
|
1132
|
-
levels: number[];
|
|
1133
|
-
};
|
|
1134
|
-
type TileLoadProgress = {
|
|
1135
|
-
requested: number;
|
|
1136
|
-
loaded: number;
|
|
1137
|
-
failed: number;
|
|
1138
|
-
active: number;
|
|
1139
|
-
queued: number;
|
|
876
|
+
type TileLoadProgress = {
|
|
877
|
+
requested: number;
|
|
878
|
+
loaded: number;
|
|
879
|
+
failed: number;
|
|
880
|
+
active: number;
|
|
881
|
+
queued: number;
|
|
1140
882
|
};
|
|
1141
883
|
type TileLoadError = {
|
|
1142
884
|
address: TileAddress;
|
|
@@ -1171,7 +913,7 @@ type TileProps = {
|
|
|
1171
913
|
* vertical `%v`/`%y`/`%w`/`%r`, and index padding such as `%0h` or `%00v`.
|
|
1172
914
|
*/
|
|
1173
915
|
urlTemplate?: string;
|
|
1174
|
-
/** Returns a path
|
|
916
|
+
/** Returns a relative path or absolute URL; takes precedence over `urlTemplate`. */
|
|
1175
917
|
resolveTileUrl?: (address: TileAddress) => string;
|
|
1176
918
|
maxTextureMemoryMb?: number;
|
|
1177
919
|
maxConcurrentLoads?: number;
|
|
@@ -1249,95 +991,6 @@ type SphereTileProps = {
|
|
|
1249
991
|
onLevelChange?: (level: number) => void;
|
|
1250
992
|
};
|
|
1251
993
|
|
|
1252
|
-
declare function SphereTile({ multires, ...props }: SphereTileProps): react.JSX.Element;
|
|
1253
|
-
|
|
1254
|
-
type SphereProps = {
|
|
1255
|
-
src: string;
|
|
1256
|
-
/**
|
|
1257
|
-
* Low-resolution 2:1 equirectangular image shown while `src` loads.
|
|
1258
|
-
* Relative paths resolve against the directory of `src`. Root-absolute and
|
|
1259
|
-
* `http(s)` / `blob:` / `data:` URLs are used as-is. For krpano sphere
|
|
1260
|
-
* scenes, copy `<preview url>`.
|
|
1261
|
-
*/
|
|
1262
|
-
previewUrl: string;
|
|
1263
|
-
/** Horizontal image offset in degrees. */
|
|
1264
|
-
yawOffset?: number;
|
|
1265
|
-
/** Called once the first paintable texture (preview or `src`) is ready. */
|
|
1266
|
-
onReady?: () => void;
|
|
1267
|
-
onLoad?: (texture: Texture) => void;
|
|
1268
|
-
onError?: (error: unknown) => void;
|
|
1269
|
-
/** Called when `previewUrl` cannot be loaded; `src` still continues. */
|
|
1270
|
-
onPreviewError?: (error: unknown) => void;
|
|
1271
|
-
/** Keeps the source mounted for preloading without drawing it. */
|
|
1272
|
-
visible?: boolean;
|
|
1273
|
-
};
|
|
1274
|
-
declare function Sphere({ src, previewUrl, yawOffset, onReady, onLoad, onError, onPreviewError, visible, }: SphereProps): react.JSX.Element | null;
|
|
1275
|
-
|
|
1276
|
-
type PanoVideoProps = {
|
|
1277
|
-
/** Single-file shortcut when `variants` is omitted. */
|
|
1278
|
-
src?: string;
|
|
1279
|
-
poster?: string;
|
|
1280
|
-
variants?: readonly PanoVideoVariant[];
|
|
1281
|
-
defaultVariantId?: string;
|
|
1282
|
-
tracks?: readonly PanoVideoTrack[];
|
|
1283
|
-
/**
|
|
1284
|
-
* Caption overlay. `true` / omit uses the default appearance; `false`
|
|
1285
|
-
* hides captions and the control-bar language menu; an object merges
|
|
1286
|
-
* with the defaults.
|
|
1287
|
-
*/
|
|
1288
|
-
captions?: boolean | PanoVideoCaptionAppearance;
|
|
1289
|
-
/**
|
|
1290
|
-
* Playback chrome. `true` / omit mounts the default bar; `false` skips
|
|
1291
|
-
* it; an object mounts the default bar with appearance overrides.
|
|
1292
|
-
* Render `PanoVideoControls` as a PanoViewer child to replace the default.
|
|
1293
|
-
*/
|
|
1294
|
-
controls?: boolean | PanoVideoControlsAppearance;
|
|
1295
|
-
/** Horizontal video offset in degrees. */
|
|
1296
|
-
yawOffset?: number;
|
|
1297
|
-
loop?: boolean;
|
|
1298
|
-
muted?: boolean;
|
|
1299
|
-
volume?: number;
|
|
1300
|
-
autoPlay?: boolean;
|
|
1301
|
-
playsInline?: boolean;
|
|
1302
|
-
preload?: "none" | "metadata" | "auto";
|
|
1303
|
-
crossOrigin?: "" | "anonymous" | "use-credentials";
|
|
1304
|
-
playbackRates?: readonly number[];
|
|
1305
|
-
/** Keeps the source mounted for preloading without drawing it. */
|
|
1306
|
-
visible?: boolean;
|
|
1307
|
-
onLoad?: () => void;
|
|
1308
|
-
onError?: (event: PanoVideoErrorEvent) => void;
|
|
1309
|
-
onPlaybackStateChange?: (state: VideoPlaybackState) => void;
|
|
1310
|
-
onEnded?: () => void;
|
|
1311
|
-
onVariantChange?: (id: string) => void;
|
|
1312
|
-
onTrackChange?: (id: string | null) => void;
|
|
1313
|
-
};
|
|
1314
|
-
/**
|
|
1315
|
-
* Equirectangular 360 video mapped onto the panorama sphere. Mount inside
|
|
1316
|
-
* PanoViewer. Default playback chrome and captions portal to the viewer overlay.
|
|
1317
|
-
*/
|
|
1318
|
-
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;
|
|
1319
|
-
|
|
1320
|
-
declare const DEFAULT_PANO_VIDEO_CONTROLS_APPEARANCE: Required<PanoVideoControlsAppearance>;
|
|
1321
|
-
type PanoVideoControlsProps = {
|
|
1322
|
-
appearance?: PanoVideoControlsAppearance;
|
|
1323
|
-
};
|
|
1324
|
-
/**
|
|
1325
|
-
* Claims the default playback chrome slot for a custom replacement.
|
|
1326
|
-
* Render inside PanoViewer when overriding the built-in controls.
|
|
1327
|
-
*/
|
|
1328
|
-
declare function PanoVideoControls({ appearance }: PanoVideoControlsProps): null;
|
|
1329
|
-
|
|
1330
|
-
declare const DEFAULT_PANO_VIDEO_PLAYBACK_RATES: readonly [0.5, 1, 1.25, 1.5, 2];
|
|
1331
|
-
|
|
1332
|
-
declare const DEFAULT_PANO_VIDEO_CAPTION_APPEARANCE: Required<PanoVideoCaptionAppearance>;
|
|
1333
|
-
|
|
1334
|
-
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";
|
|
1335
|
-
type SceneTransition = SceneTransitionPreset | {
|
|
1336
|
-
preset: SceneTransitionPreset;
|
|
1337
|
-
/** Overrides the preset default duration in seconds. */
|
|
1338
|
-
duration?: number;
|
|
1339
|
-
};
|
|
1340
|
-
|
|
1341
994
|
type SphereScene = {
|
|
1342
995
|
id: string;
|
|
1343
996
|
type: "sphere";
|
|
@@ -1407,95 +1060,34 @@ type ScenesProps = {
|
|
|
1407
1060
|
};
|
|
1408
1061
|
declare function Scenes({ maxTextureMemoryMb, maxConcurrentTileLoads, activeSceneId: controlledId, defaultActiveSceneId, onActiveSceneIdChange, scenes, ...rest }: ScenesProps): react.JSX.Element;
|
|
1409
1062
|
|
|
1410
|
-
type
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
getSceneIds: () => readonly string[];
|
|
1416
|
-
isTransitioning: () => boolean;
|
|
1417
|
-
};
|
|
1418
|
-
|
|
1419
|
-
type ImageHotspotProps = HotspotCommonProps & {
|
|
1420
|
-
src: string;
|
|
1421
|
-
onLoad?: (texture: Texture) => void;
|
|
1422
|
-
onError?: (error: unknown) => void;
|
|
1063
|
+
type AssetUrlContext = {
|
|
1064
|
+
defaultUrl: string;
|
|
1065
|
+
kind: "tile" | "preview" | "hotspot";
|
|
1066
|
+
sceneId: string;
|
|
1067
|
+
hotspotId?: string;
|
|
1423
1068
|
};
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
type PolygonValidationIssue = {
|
|
1428
|
-
code: PolygonValidationCode;
|
|
1429
|
-
message: string;
|
|
1069
|
+
type AssetUrlResolver = (path: string, context: AssetUrlContext) => string;
|
|
1070
|
+
type JsonRequestOptions = {
|
|
1071
|
+
requestInit?: Pick<RequestInit, "headers" | "credentials" | "signal">;
|
|
1430
1072
|
};
|
|
1431
|
-
type
|
|
1073
|
+
type SceneFromViewerConfigOptions = {
|
|
1432
1074
|
id: string;
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
position: HotspotPosition;
|
|
1436
|
-
startPosition: HotspotPosition;
|
|
1437
|
-
};
|
|
1438
|
-
type PolygonHotspotProps = Omit<HotspotCommonProps, "position" | "width" | "height" | "scale" | "mode" | "distance" | "scaleMode" | "rotation" | "onDragStart" | "onPositionChange" | "onDragEnd"> & {
|
|
1439
|
-
vertices: HotspotPosition[];
|
|
1440
|
-
fill?: ColorRepresentation;
|
|
1441
|
-
fillOpacity?: number;
|
|
1442
|
-
stroke?: ColorRepresentation;
|
|
1443
|
-
/** Screen-space border width in CSS pixels. Defaults to 2. */
|
|
1444
|
-
strokeWidth?: number;
|
|
1445
|
-
/** Opacity of the polygon boundary, from 0 to 1. Defaults to 1. */
|
|
1446
|
-
strokeOpacity?: number;
|
|
1447
|
-
/** Dash length in CSS pixels. Omit or 0 for a solid stroke. */
|
|
1448
|
-
strokeDashSize?: number;
|
|
1449
|
-
/** Gap length in CSS pixels. Defaults to `strokeDashSize` when dashed. */
|
|
1450
|
-
strokeGapSize?: number;
|
|
1451
|
-
onVerticesChange?: (event: PolygonVerticesChangeEvent) => void;
|
|
1452
|
-
onDragStart?: (event: PolygonVerticesChangeEvent) => void;
|
|
1453
|
-
onDragEnd?: (event: PolygonVerticesChangeEvent) => void;
|
|
1454
|
-
onInvalid?: (issues: PolygonValidationIssue[]) => void;
|
|
1075
|
+
baseUrl: string;
|
|
1076
|
+
resolveAssetUrl?: AssetUrlResolver;
|
|
1455
1077
|
};
|
|
1456
|
-
type
|
|
1457
|
-
|
|
1078
|
+
type LoadSceneFromJsonOptions = Omit<SceneFromViewerConfigOptions, "baseUrl"> & JsonRequestOptions & {
|
|
1079
|
+
baseUrl?: string;
|
|
1458
1080
|
};
|
|
1459
|
-
declare function
|
|
1460
|
-
declare function
|
|
1461
|
-
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;
|
|
1081
|
+
declare function sceneFromViewerConfig(value: unknown, options: SceneFromViewerConfigOptions): TileScene | SphereTileScene;
|
|
1082
|
+
declare function loadSceneFromJson(url: string, options: LoadSceneFromJsonOptions): Promise<TileScene | SphereTileScene>;
|
|
1462
1083
|
|
|
1463
|
-
type
|
|
1464
|
-
|
|
1465
|
-
|
|
1084
|
+
type GraphicPaint = {
|
|
1085
|
+
fill?: string;
|
|
1086
|
+
stroke?: string;
|
|
1087
|
+
strokeWidth?: number;
|
|
1466
1088
|
};
|
|
1467
|
-
type
|
|
1468
|
-
|
|
1469
|
-
vertices: HotspotPosition[];
|
|
1470
|
-
startVertices: HotspotPosition[];
|
|
1471
|
-
position: HotspotPosition;
|
|
1472
|
-
startPosition: HotspotPosition;
|
|
1473
|
-
};
|
|
1474
|
-
type PolylineHotspotProps = Omit<HotspotCommonProps, "position" | "width" | "height" | "scale" | "mode" | "distance" | "scaleMode" | "rotation" | "onDragStart" | "onPositionChange" | "onDragEnd"> & {
|
|
1475
|
-
vertices: HotspotPosition[];
|
|
1476
|
-
stroke?: ColorRepresentation;
|
|
1477
|
-
/** Screen-space line width in CSS pixels. Defaults to 2. */
|
|
1478
|
-
strokeWidth?: number;
|
|
1479
|
-
strokeOpacity?: number;
|
|
1480
|
-
/** Dash length in CSS pixels. Omit or 0 for a solid stroke. */
|
|
1481
|
-
strokeDashSize?: number;
|
|
1482
|
-
/** Gap length in CSS pixels. Defaults to `strokeDashSize` when dashed. */
|
|
1483
|
-
strokeGapSize?: number;
|
|
1484
|
-
onVerticesChange?: (event: PolylineVerticesChangeEvent) => void;
|
|
1485
|
-
onDragStart?: (event: PolylineVerticesChangeEvent) => void;
|
|
1486
|
-
onDragEnd?: (event: PolylineVerticesChangeEvent) => void;
|
|
1487
|
-
onInvalid?: (issues: PolylineValidationIssue[]) => void;
|
|
1488
|
-
};
|
|
1489
|
-
declare function validatePolylineVertices(vertices: HotspotPosition[]): PolylineValidationIssue[];
|
|
1490
|
-
declare function PolylineHotspot({ id, vertices, stroke, strokeWidth, strokeOpacity, strokeDashSize, strokeGapSize, renderOrder, draggable, onVerticesChange, onDragStart, onDragEnd, onInvalid, ...anchorProps }: PolylineHotspotProps): react.JSX.Element | null;
|
|
1491
|
-
|
|
1492
|
-
type GraphicPaint = {
|
|
1493
|
-
fill?: string;
|
|
1494
|
-
stroke?: string;
|
|
1495
|
-
strokeWidth?: number;
|
|
1496
|
-
};
|
|
1497
|
-
type CircleGraphic = GraphicPaint & {
|
|
1498
|
-
kind: "circle";
|
|
1089
|
+
type CircleGraphic = GraphicPaint & {
|
|
1090
|
+
kind: "circle";
|
|
1499
1091
|
};
|
|
1500
1092
|
type TriangleGraphic = GraphicPaint & {
|
|
1501
1093
|
kind: "triangle";
|
|
@@ -1535,40 +1127,25 @@ type GraphicHotspotProps = HotspotCommonProps & {
|
|
|
1535
1127
|
};
|
|
1536
1128
|
declare function GraphicHotspot(props: GraphicHotspotProps): react.JSX.Element;
|
|
1537
1129
|
|
|
1538
|
-
type
|
|
1539
|
-
type
|
|
1540
|
-
id: string;
|
|
1541
|
-
total: number;
|
|
1542
|
-
loaded: number;
|
|
1543
|
-
failed: number;
|
|
1544
|
-
};
|
|
1545
|
-
type SequenceFrameEvent = {
|
|
1546
|
-
id: string;
|
|
1547
|
-
index: number;
|
|
1548
|
-
src: string;
|
|
1549
|
-
};
|
|
1550
|
-
type SequencePlaybackState = "playing" | "paused" | "ended";
|
|
1551
|
-
type SequenceHotspotErrorEvent = {
|
|
1552
|
-
id: string;
|
|
1553
|
-
src: string;
|
|
1554
|
-
error: unknown;
|
|
1555
|
-
};
|
|
1556
|
-
type SequenceHotspotProps = HotspotCommonProps & {
|
|
1557
|
-
/** A sprite sheet containing each frame in equally sized cells. */
|
|
1130
|
+
type IframePointerPolicy = "hotspot" | "content";
|
|
1131
|
+
type IframeHotspotProps = HotspotCommonProps & {
|
|
1558
1132
|
src: string;
|
|
1559
|
-
/**
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1133
|
+
/** Accessible iframe title. Falls back to ariaLabel. */
|
|
1134
|
+
title?: string;
|
|
1135
|
+
sandbox?: string;
|
|
1136
|
+
allow?: string;
|
|
1137
|
+
referrerPolicy?: IframeHTMLAttributes<HTMLIFrameElement>["referrerPolicy"];
|
|
1138
|
+
loading?: "eager" | "lazy";
|
|
1139
|
+
/**
|
|
1140
|
+
* `hotspot` lets panorama pointer events hit the WebGL plane.
|
|
1141
|
+
* `content` makes the embedded page interactive.
|
|
1142
|
+
*/
|
|
1143
|
+
pointerPolicy?: IframePointerPolicy;
|
|
1144
|
+
background?: string;
|
|
1145
|
+
onLoad?: () => void;
|
|
1146
|
+
onError?: (error: unknown) => void;
|
|
1570
1147
|
};
|
|
1571
|
-
declare function
|
|
1148
|
+
declare function IframeHotspot({ src, title, sandbox, allow, referrerPolicy, loading, pointerPolicy, background, opacity, width, height, onLoad, onError, interactive, pointerEvents, ...anchorProps }: IframeHotspotProps): react.JSX.Element;
|
|
1572
1149
|
|
|
1573
1150
|
type TextHotspotAlign = "left" | "center" | "right";
|
|
1574
1151
|
type TextHotspotVerticalAlign = "top" | "middle" | "bottom";
|
|
@@ -1605,37 +1182,6 @@ type TextHotspotProps = HotspotCommonProps & TextHotspotStyle & {
|
|
|
1605
1182
|
};
|
|
1606
1183
|
declare function TextHotspot({ text, width, height, opacity, fontFamily, fontSize, fontWeight, fontStyle, color, background, backgroundOpacity, padding, align, verticalAlign, lineHeight, whiteSpace, borderRadius, stroke, strokeWidth, onLoad, onError, ...anchorProps }: TextHotspotProps): react.JSX.Element;
|
|
1607
1184
|
|
|
1608
|
-
type IframePointerPolicy = "hotspot" | "content";
|
|
1609
|
-
type IframeHotspotProps = HotspotCommonProps & {
|
|
1610
|
-
src: string;
|
|
1611
|
-
/** Accessible iframe title. Falls back to ariaLabel. */
|
|
1612
|
-
title?: string;
|
|
1613
|
-
sandbox?: string;
|
|
1614
|
-
allow?: string;
|
|
1615
|
-
referrerPolicy?: IframeHTMLAttributes<HTMLIFrameElement>["referrerPolicy"];
|
|
1616
|
-
loading?: "eager" | "lazy";
|
|
1617
|
-
/**
|
|
1618
|
-
* `hotspot` lets panorama pointer events hit the WebGL plane.
|
|
1619
|
-
* `content` makes the embedded page interactive.
|
|
1620
|
-
*/
|
|
1621
|
-
pointerPolicy?: IframePointerPolicy;
|
|
1622
|
-
background?: string;
|
|
1623
|
-
onLoad?: () => void;
|
|
1624
|
-
onError?: (error: unknown) => void;
|
|
1625
|
-
};
|
|
1626
|
-
declare function IframeHotspot({ src, title, sandbox, allow, referrerPolicy, loading, pointerPolicy, background, opacity, width, height, onLoad, onError, interactive, pointerEvents, ...anchorProps }: IframeHotspotProps): react.JSX.Element;
|
|
1627
|
-
|
|
1628
|
-
declare function Tile({ baseUrl, multires, previewUrl, previewFaceOrder, urlTemplate, resolveTileUrl, maxTextureMemoryMb, maxConcurrentLoads, retryCount, loadMode, visible, onReady, onPreviewError, onLoadProgress, onTileError, onLevelChange, }: TileProps): react.JSX.Element;
|
|
1629
|
-
|
|
1630
|
-
declare function normalizePanoYaw(yaw: number): number;
|
|
1631
|
-
declare function clampPanoPitch(pitch: number): number;
|
|
1632
|
-
declare function normalizePanoPosition(position: HotspotPosition): HotspotPosition;
|
|
1633
|
-
declare function panoPositionToVector3(position: HotspotPosition, radius?: number): Vector3;
|
|
1634
|
-
declare function vector3ToPanoPosition(vector: Pick<Vector3, "x" | "y" | "z">): HotspotPosition;
|
|
1635
|
-
|
|
1636
|
-
declare const DEFAULT_HOTSPOT_TOOLTIP_OFFSET = 12;
|
|
1637
|
-
declare const DEFAULT_HOTSPOT_TOOLTIP_APPEARANCE: Required<HotspotTooltipAppearance>;
|
|
1638
|
-
|
|
1639
1185
|
/** Shared serializable fields for every saved hotspot definition. */
|
|
1640
1186
|
type HotspotDefinitionBase = {
|
|
1641
1187
|
id: string;
|
|
@@ -1750,4 +1296,608 @@ type PointHotspotDefinition = ImageHotspotDefinition | GraphicHotspotDefinition
|
|
|
1750
1296
|
/** A serializable, discriminated hotspot collection item. */
|
|
1751
1297
|
type HotspotDefinition = PointHotspotDefinition | PolygonHotspotDefinition | PolylineHotspotDefinition;
|
|
1752
1298
|
|
|
1753
|
-
|
|
1299
|
+
type ProjectHotspotDefinition = HotspotDefinition & {
|
|
1300
|
+
action?: {
|
|
1301
|
+
type: "scene";
|
|
1302
|
+
sceneId: string;
|
|
1303
|
+
};
|
|
1304
|
+
};
|
|
1305
|
+
|
|
1306
|
+
type PanoProjectSceneDefinition = {
|
|
1307
|
+
id: string;
|
|
1308
|
+
title?: string;
|
|
1309
|
+
source: ({
|
|
1310
|
+
viewerUrl: string;
|
|
1311
|
+
viewerConfig?: never;
|
|
1312
|
+
} | {
|
|
1313
|
+
viewerConfig: ViewerConfig;
|
|
1314
|
+
viewerUrl?: never;
|
|
1315
|
+
}) & {
|
|
1316
|
+
baseUrl?: string;
|
|
1317
|
+
};
|
|
1318
|
+
initialView?: Partial<PanoViewerState>;
|
|
1319
|
+
hotspots?: ProjectHotspotDefinition[];
|
|
1320
|
+
};
|
|
1321
|
+
type PanoProjectDefinition = {
|
|
1322
|
+
schemaVersion: 1;
|
|
1323
|
+
title?: string;
|
|
1324
|
+
initialSceneId?: string;
|
|
1325
|
+
scenes: PanoProjectSceneDefinition[];
|
|
1326
|
+
};
|
|
1327
|
+
type LoadedProjectScene = {
|
|
1328
|
+
scene: TileScene | SphereTileScene;
|
|
1329
|
+
title?: string;
|
|
1330
|
+
initialView?: PanoViewerState;
|
|
1331
|
+
hotspots: ProjectHotspotDefinition[];
|
|
1332
|
+
};
|
|
1333
|
+
type LoadedPanoProject = {
|
|
1334
|
+
title?: string;
|
|
1335
|
+
initialSceneId: string;
|
|
1336
|
+
scenes: LoadedProjectScene[];
|
|
1337
|
+
};
|
|
1338
|
+
type LoadPanoProjectOptions = JsonRequestOptions & {
|
|
1339
|
+
/** Directory used for project-relative references. Required for object input. */
|
|
1340
|
+
baseUrl?: string;
|
|
1341
|
+
resolveAssetUrl?: AssetUrlResolver;
|
|
1342
|
+
};
|
|
1343
|
+
declare function parsePanoProject(value: unknown): PanoProjectDefinition;
|
|
1344
|
+
declare function loadPanoProject(source: string | PanoProjectDefinition, options?: LoadPanoProjectOptions): Promise<LoadedPanoProject>;
|
|
1345
|
+
|
|
1346
|
+
type ProjectHotspotClickEvent = {
|
|
1347
|
+
sceneId: string;
|
|
1348
|
+
hotspot: ProjectHotspotDefinition;
|
|
1349
|
+
interaction: HotspotInteractionEvent;
|
|
1350
|
+
defaultPrevented: boolean;
|
|
1351
|
+
preventDefault: () => void;
|
|
1352
|
+
};
|
|
1353
|
+
type ProjectHotspotErrorEvent = {
|
|
1354
|
+
sceneId: string;
|
|
1355
|
+
hotspot: ProjectHotspotDefinition;
|
|
1356
|
+
error: unknown;
|
|
1357
|
+
};
|
|
1358
|
+
type ProjectHotspotRenderContext = {
|
|
1359
|
+
sceneId: string;
|
|
1360
|
+
playing: boolean;
|
|
1361
|
+
onClick: (event: HotspotInteractionEvent) => void;
|
|
1362
|
+
togglePlayback: () => void;
|
|
1363
|
+
reportError: (error: unknown) => void;
|
|
1364
|
+
renderDefault: () => ReactNode;
|
|
1365
|
+
};
|
|
1366
|
+
type ProjectScenesProps = Omit<ScenesProps, "scenes" | "defaultActiveSceneId" | "renderHotspots"> & {
|
|
1367
|
+
project: LoadedPanoProject;
|
|
1368
|
+
onHotspotClick?: (event: ProjectHotspotClickEvent) => void;
|
|
1369
|
+
onHotspotError?: (event: ProjectHotspotErrorEvent) => void;
|
|
1370
|
+
/** Return undefined for the default renderer, or null to hide this hotspot. */
|
|
1371
|
+
renderHotspot?: (hotspot: ProjectHotspotDefinition, context: ProjectHotspotRenderContext) => ReactNode;
|
|
1372
|
+
};
|
|
1373
|
+
declare function ProjectScenes({ project, activeSceneId, onActiveSceneIdChange, onSceneReady, onHotspotClick, onHotspotError, renderHotspot, ...options }: ProjectScenesProps): react.JSX.Element;
|
|
1374
|
+
|
|
1375
|
+
/** Options for automatic horizontal panorama rotation. */
|
|
1376
|
+
type AutoRotateProps = {
|
|
1377
|
+
/** Whether automatic rotation is active. Defaults to true. */
|
|
1378
|
+
enabled?: boolean;
|
|
1379
|
+
/** Rotation speed in degrees per second. Negative values rotate left. */
|
|
1380
|
+
speed?: number;
|
|
1381
|
+
/**
|
|
1382
|
+
* Rate at which rotation reaches its target speed, in degrees per second
|
|
1383
|
+
* squared. Use 0 to disable the speed ramp. Defaults to 18.
|
|
1384
|
+
*/
|
|
1385
|
+
acceleration?: number;
|
|
1386
|
+
/** Milliseconds to wait after enabling before rotation begins. */
|
|
1387
|
+
startDelay?: number;
|
|
1388
|
+
};
|
|
1389
|
+
/**
|
|
1390
|
+
* Adds automatic rotation to the nearest PanoViewer. Render one instance as a
|
|
1391
|
+
* child of PanoViewer, alongside its panorama source.
|
|
1392
|
+
*/
|
|
1393
|
+
declare function AutoRotate({ enabled, speed, acceleration, startDelay, }: AutoRotateProps): null;
|
|
1394
|
+
|
|
1395
|
+
type AudioPlaybackState = "playing" | "paused" | "ended" | "blocked";
|
|
1396
|
+
type AudioHotspotErrorEvent = {
|
|
1397
|
+
id: string;
|
|
1398
|
+
error: unknown;
|
|
1399
|
+
};
|
|
1400
|
+
type AudioHotspotProps = HotspotCommonProps & {
|
|
1401
|
+
src: string | string[];
|
|
1402
|
+
playing: boolean;
|
|
1403
|
+
loop?: boolean;
|
|
1404
|
+
muted?: boolean;
|
|
1405
|
+
volume?: number;
|
|
1406
|
+
/** Degrees of look-away before the source is silent. Defaults to 360 (no look attenuation). */
|
|
1407
|
+
range?: number;
|
|
1408
|
+
pauseWhenHidden?: boolean;
|
|
1409
|
+
/** Optional stopped-state image. When omitted, a built-in speaker icon is used. */
|
|
1410
|
+
icon?: string;
|
|
1411
|
+
/** Optional playing-state image. Falls back to `icon`, then the built-in playing icon. */
|
|
1412
|
+
playingIcon?: string;
|
|
1413
|
+
/** When false, no visual marker is rendered. Audio still plays. Defaults to true. */
|
|
1414
|
+
marker?: boolean;
|
|
1415
|
+
crossOrigin?: "" | "anonymous" | "use-credentials";
|
|
1416
|
+
onPlaybackStateChange?: (state: AudioPlaybackState) => void;
|
|
1417
|
+
onPlaybackError?: (error: unknown) => void;
|
|
1418
|
+
onEnded?: () => void;
|
|
1419
|
+
onError?: (event: AudioHotspotErrorEvent) => void;
|
|
1420
|
+
};
|
|
1421
|
+
declare function AudioHotspot({ id, src, playing, loop, muted, volume, range, pauseWhenHidden, icon, playingIcon, marker, crossOrigin, width, height, opacity, onPlaybackStateChange, onPlaybackError, onEnded, onError, ...anchorProps }: AudioHotspotProps): react.JSX.Element;
|
|
1422
|
+
|
|
1423
|
+
type BackgroundAudioSource = string | readonly string[];
|
|
1424
|
+
type BackgroundAudioErrorEvent = {
|
|
1425
|
+
error: unknown;
|
|
1426
|
+
};
|
|
1427
|
+
type BackgroundAudioProps = {
|
|
1428
|
+
/** Shared tour track when `sources` is omitted, or fallback when a scene has no entry. */
|
|
1429
|
+
src?: BackgroundAudioSource;
|
|
1430
|
+
/** Per-scene tracks keyed by `Scene.id`. Requires `sceneId`. */
|
|
1431
|
+
sources?: Readonly<Record<string, BackgroundAudioSource>>;
|
|
1432
|
+
/** Current scene id. Required when `sources` is set. */
|
|
1433
|
+
sceneId?: string;
|
|
1434
|
+
/**
|
|
1435
|
+
* Controlled playing state. When provided, the parent owns play/pause.
|
|
1436
|
+
* When omitted, the component manages its own state and imperative
|
|
1437
|
+
* `playBackgroundAudio` / `pauseBackgroundAudio` work directly.
|
|
1438
|
+
*/
|
|
1439
|
+
playing?: boolean;
|
|
1440
|
+
/** Initial playing state when `playing` is omitted. Defaults to false. */
|
|
1441
|
+
defaultPlaying?: boolean;
|
|
1442
|
+
/** Defaults to true. */
|
|
1443
|
+
loop?: boolean;
|
|
1444
|
+
muted?: boolean;
|
|
1445
|
+
volume?: number;
|
|
1446
|
+
pauseWhenHidden?: boolean;
|
|
1447
|
+
/** Crossfade duration when the resolved track changes. Defaults to 400; 0 is a hard cut. */
|
|
1448
|
+
fadeMs?: number;
|
|
1449
|
+
crossOrigin?: "" | "anonymous" | "use-credentials";
|
|
1450
|
+
onPlaybackStateChange?: (state: AudioPlaybackState) => void;
|
|
1451
|
+
onPlaybackError?: (error: unknown) => void;
|
|
1452
|
+
onEnded?: () => void;
|
|
1453
|
+
onError?: (event: BackgroundAudioErrorEvent) => void;
|
|
1454
|
+
};
|
|
1455
|
+
/**
|
|
1456
|
+
* Adds a non-spatial soundtrack to the nearest PanoViewer. Render one instance
|
|
1457
|
+
* as a child of PanoViewer, alongside Scenes or a panorama source — not inside
|
|
1458
|
+
* renderHotspots.
|
|
1459
|
+
*/
|
|
1460
|
+
declare function BackgroundAudio({ src, sources, sceneId, playing: controlledPlaying, defaultPlaying, loop, muted, volume, pauseWhenHidden, fadeMs, crossOrigin, onPlaybackStateChange, onPlaybackError, onEnded, onError, }: BackgroundAudioProps): null;
|
|
1461
|
+
|
|
1462
|
+
declare const PANO_FILTER_PRESETS: readonly ["none", "grayscale", "sepia", "vintage", "cool", "warm", "pencil", "coloredPencil", "crayon", "watercolor", "cartoon", "crosshatch"];
|
|
1463
|
+
type PanoFilterPreset = (typeof PANO_FILTER_PRESETS)[number];
|
|
1464
|
+
/** Row-major 4×5 RGBA matrix, applied in display (sRGB) space like an SVG color matrix. */
|
|
1465
|
+
type PanoColorMatrix = readonly [
|
|
1466
|
+
number,
|
|
1467
|
+
number,
|
|
1468
|
+
number,
|
|
1469
|
+
number,
|
|
1470
|
+
number,
|
|
1471
|
+
number,
|
|
1472
|
+
number,
|
|
1473
|
+
number,
|
|
1474
|
+
number,
|
|
1475
|
+
number,
|
|
1476
|
+
number,
|
|
1477
|
+
number,
|
|
1478
|
+
number,
|
|
1479
|
+
number,
|
|
1480
|
+
number,
|
|
1481
|
+
number,
|
|
1482
|
+
number,
|
|
1483
|
+
number,
|
|
1484
|
+
number,
|
|
1485
|
+
number
|
|
1486
|
+
];
|
|
1487
|
+
|
|
1488
|
+
type PanoFilterProps = {
|
|
1489
|
+
/** Built-in look. Defaults to `none` (identity). */
|
|
1490
|
+
preset?: PanoFilterPreset;
|
|
1491
|
+
/** Mix with the original panorama, 0–1. Defaults to 1. */
|
|
1492
|
+
intensity?: number;
|
|
1493
|
+
/** Display-space RGBA matrix applied after the artistic preset. */
|
|
1494
|
+
colorMatrix?: PanoColorMatrix | null;
|
|
1495
|
+
/** `all` also filters hotspot textures. HTML tooltips/chrome remain host-styled. */
|
|
1496
|
+
colorMatrixScope?: "panorama" | "all";
|
|
1497
|
+
/** When false, the panorama renders without a filter. Defaults to true. */
|
|
1498
|
+
enabled?: boolean;
|
|
1499
|
+
};
|
|
1500
|
+
/**
|
|
1501
|
+
* Applies a color or artistic filter to the panorama source of the nearest
|
|
1502
|
+
* PanoViewer. Render one instance as a child of PanoViewer. colorMatrixScope
|
|
1503
|
+
* can include hotspot textures; HTML chrome remains host-styled.
|
|
1504
|
+
*/
|
|
1505
|
+
declare function PanoFilter({ preset, intensity, enabled, colorMatrix, colorMatrixScope, }: PanoFilterProps): null;
|
|
1506
|
+
|
|
1507
|
+
type GyroTouchMode = "off" | "horizontaloffset" | "full" | "disablegyro";
|
|
1508
|
+
|
|
1509
|
+
type GyroHandle = {
|
|
1510
|
+
resetSensor: (yaw?: number, pitch?: number) => void;
|
|
1511
|
+
isAvailable: () => boolean;
|
|
1512
|
+
isEnabled: () => boolean;
|
|
1513
|
+
/**
|
|
1514
|
+
* Requests iOS sensor permission. Call this directly from a user gesture
|
|
1515
|
+
* before setting `enabled` to true.
|
|
1516
|
+
*/
|
|
1517
|
+
requestPermission: () => Promise<boolean>;
|
|
1518
|
+
};
|
|
1519
|
+
type GyroProps = {
|
|
1520
|
+
/** Whether device-orientation control is requested. Defaults to false. */
|
|
1521
|
+
enabled?: boolean;
|
|
1522
|
+
/** Whether device roll levels the camera. Defaults to true. */
|
|
1523
|
+
camroll?: boolean;
|
|
1524
|
+
/** Whether to follow compass-oriented headings. Defaults to false. */
|
|
1525
|
+
absolute?: boolean;
|
|
1526
|
+
/** Panorama yaw that represents North, in degrees. Defaults to 0. */
|
|
1527
|
+
north?: number;
|
|
1528
|
+
/** Sensor smoothing from 0 (none) to 0.99 (strong). Defaults to 0. */
|
|
1529
|
+
friction?: number;
|
|
1530
|
+
/** How touch dragging combines with gyro movement. Defaults to "full". */
|
|
1531
|
+
touchMode?: GyroTouchMode;
|
|
1532
|
+
/** Seconds used to blend from the current view when enabling. Defaults to 0.5. */
|
|
1533
|
+
softstart?: number;
|
|
1534
|
+
/** Allow capability detection on desktop-class devices. Defaults to false. */
|
|
1535
|
+
desktopSupport?: boolean;
|
|
1536
|
+
onAvailable?: () => void;
|
|
1537
|
+
onUnavailable?: () => void;
|
|
1538
|
+
onEnable?: () => void;
|
|
1539
|
+
onDisable?: () => void;
|
|
1540
|
+
onDenied?: () => void;
|
|
1541
|
+
};
|
|
1542
|
+
/**
|
|
1543
|
+
* Adds device-orientation navigation to the nearest PanoViewer.
|
|
1544
|
+
* Sensor access is opt-in and disabled by default.
|
|
1545
|
+
*/
|
|
1546
|
+
declare const Gyro: react.ForwardRefExoticComponent<GyroProps & react.RefAttributes<GyroHandle>>;
|
|
1547
|
+
|
|
1548
|
+
declare const WebVR: react.ForwardRefExoticComponent<WebVRProps & react.RefAttributes<WebVRHandle>>;
|
|
1549
|
+
|
|
1550
|
+
declare const DEFAULT_WEBVR_CHROME_APPEARANCE: Required<Omit<WebVRChromeAppearance, "setupTitle">>;
|
|
1551
|
+
|
|
1552
|
+
declare const WEBVR_PROFILE_IDS: readonly ["none", "cardboard-v1", "cardboard-v2", "gear-vr", "daydream"];
|
|
1553
|
+
declare const WEBVR_PROFILES: Record<WebVRProfileId, WebVRProfile>;
|
|
1554
|
+
|
|
1555
|
+
declare const DEFAULT_WEBVR_CURSOR_DWELL_MS = 1500;
|
|
1556
|
+
|
|
1557
|
+
type ViewInteractionSource = "mouse" | "touch" | "keyboard";
|
|
1558
|
+
type PanoWheelEvent = {
|
|
1559
|
+
/** Signed wheel delta (same sign convention as WheelEvent.deltaY). */
|
|
1560
|
+
delta: number;
|
|
1561
|
+
nativeEvent: WheelEvent;
|
|
1562
|
+
};
|
|
1563
|
+
type PanoResizeEvent = {
|
|
1564
|
+
width: number;
|
|
1565
|
+
height: number;
|
|
1566
|
+
};
|
|
1567
|
+
type ViewInteractionEvent = {
|
|
1568
|
+
source: ViewInteractionSource;
|
|
1569
|
+
};
|
|
1570
|
+
type PanoEventMap = {
|
|
1571
|
+
viewchange: PanoViewerState;
|
|
1572
|
+
viewsettled: PanoViewerState;
|
|
1573
|
+
viewinteractionstart: ViewInteractionEvent;
|
|
1574
|
+
viewinteractionend: ViewInteractionEvent;
|
|
1575
|
+
click: PanoramaPointerEvent;
|
|
1576
|
+
doubleclick: PanoramaPointerEvent;
|
|
1577
|
+
pointerdown: PanoramaPointerEvent;
|
|
1578
|
+
pointerup: PanoramaPointerEvent;
|
|
1579
|
+
pointermove: PanoramaPointerEvent;
|
|
1580
|
+
contextmenu: PanoramaPointerEvent;
|
|
1581
|
+
wheel: PanoWheelEvent;
|
|
1582
|
+
idle: undefined;
|
|
1583
|
+
idleend: undefined;
|
|
1584
|
+
enterfullscreen: undefined;
|
|
1585
|
+
exitfullscreen: undefined;
|
|
1586
|
+
resize: PanoResizeEvent;
|
|
1587
|
+
autorotatestart: undefined;
|
|
1588
|
+
autorotatestop: undefined;
|
|
1589
|
+
autorotateoneround: undefined;
|
|
1590
|
+
gyroavailable: undefined;
|
|
1591
|
+
gyrounavailable: undefined;
|
|
1592
|
+
gyroenable: undefined;
|
|
1593
|
+
gyrodisable: undefined;
|
|
1594
|
+
gyrodenied: undefined;
|
|
1595
|
+
vravailable: undefined;
|
|
1596
|
+
vrunavailable: undefined;
|
|
1597
|
+
vrenter: {
|
|
1598
|
+
mode: WebVRMode;
|
|
1599
|
+
};
|
|
1600
|
+
vrexit: {
|
|
1601
|
+
mode: WebVRMode;
|
|
1602
|
+
};
|
|
1603
|
+
vrdenied: {
|
|
1604
|
+
error?: unknown;
|
|
1605
|
+
};
|
|
1606
|
+
vrunknowndevice: undefined;
|
|
1607
|
+
};
|
|
1608
|
+
type PanoEventType = keyof PanoEventMap;
|
|
1609
|
+
type PanoEventListener<T extends PanoEventType> = (payload: PanoEventMap[T]) => void;
|
|
1610
|
+
type PanoEventBus = {
|
|
1611
|
+
subscribe: <T extends PanoEventType>(type: T, listener: PanoEventListener<T>) => () => void;
|
|
1612
|
+
emit: <T extends PanoEventType>(type: T, payload: PanoEventMap[T]) => void;
|
|
1613
|
+
};
|
|
1614
|
+
|
|
1615
|
+
type PanoEventsProps = {
|
|
1616
|
+
/**
|
|
1617
|
+
* Milliseconds without user interaction before `onIdle`. Defaults to 2000.
|
|
1618
|
+
* Each PanoEvents instance tracks idle independently.
|
|
1619
|
+
*/
|
|
1620
|
+
idleTime?: number;
|
|
1621
|
+
onViewChange?: (view: PanoViewerState) => void;
|
|
1622
|
+
onViewSettled?: (view: PanoViewerState) => void;
|
|
1623
|
+
onViewInteractionStart?: (event: ViewInteractionEvent) => void;
|
|
1624
|
+
onViewInteractionEnd?: (event: ViewInteractionEvent) => void;
|
|
1625
|
+
onClick?: (event: PanoramaPointerEvent) => void;
|
|
1626
|
+
onDoubleClick?: (event: PanoramaPointerEvent) => void;
|
|
1627
|
+
onPointerDown?: (event: PanoramaPointerEvent) => void;
|
|
1628
|
+
onPointerUp?: (event: PanoramaPointerEvent) => void;
|
|
1629
|
+
onPointerMove?: (event: PanoramaPointerEvent) => void;
|
|
1630
|
+
onContextMenu?: (event: PanoramaPointerEvent) => void;
|
|
1631
|
+
onWheel?: (event: PanoWheelEvent) => void;
|
|
1632
|
+
onIdle?: () => void;
|
|
1633
|
+
onIdleEnd?: () => void;
|
|
1634
|
+
onEnterFullscreen?: () => void;
|
|
1635
|
+
onExitFullscreen?: () => void;
|
|
1636
|
+
onResize?: (event: PanoResizeEvent) => void;
|
|
1637
|
+
onAutoRotateStart?: () => void;
|
|
1638
|
+
onAutoRotateStop?: () => void;
|
|
1639
|
+
onAutoRotateOneRound?: () => void;
|
|
1640
|
+
onGyroAvailable?: () => void;
|
|
1641
|
+
onGyroUnavailable?: () => void;
|
|
1642
|
+
onGyroEnable?: () => void;
|
|
1643
|
+
onGyroDisable?: () => void;
|
|
1644
|
+
onGyroDenied?: () => void;
|
|
1645
|
+
onVRAvailable?: () => void;
|
|
1646
|
+
onVRUnavailable?: () => void;
|
|
1647
|
+
onVREnter?: (mode: WebVRMode) => void;
|
|
1648
|
+
onVRExit?: (mode: WebVRMode) => void;
|
|
1649
|
+
onVRDenied?: (error?: unknown) => void;
|
|
1650
|
+
onVRUnknownDevice?: () => void;
|
|
1651
|
+
};
|
|
1652
|
+
/**
|
|
1653
|
+
* Subscribes to viewer-level panorama events. Must run inside PanoViewer.
|
|
1654
|
+
* Prefer the {@link PanoEvents} component for declarative usage.
|
|
1655
|
+
*/
|
|
1656
|
+
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;
|
|
1657
|
+
/**
|
|
1658
|
+
* Declarative viewer-level event listeners for the nearest PanoViewer.
|
|
1659
|
+
* Multiple instances may coexist; each tracks its own idle timer.
|
|
1660
|
+
*/
|
|
1661
|
+
declare function PanoEvents(props: PanoEventsProps): null;
|
|
1662
|
+
|
|
1663
|
+
type UsePanoViewerResult = PanoViewerHandle & {
|
|
1664
|
+
ref: RefObject<PanoViewerHandle | null>;
|
|
1665
|
+
};
|
|
1666
|
+
declare function usePanoViewer(): UsePanoViewerResult;
|
|
1667
|
+
|
|
1668
|
+
type MouseControlsProps = MouseControlsOptions & {
|
|
1669
|
+
/**
|
|
1670
|
+
* Maximum FOV change rate in degrees per second for wheel zoom. When
|
|
1671
|
+
* omitted, no extra rate cap is applied. Usually supplied by PanoViewer from
|
|
1672
|
+
* `controls.fovSpeed`.
|
|
1673
|
+
*/
|
|
1674
|
+
fovSpeed?: number;
|
|
1675
|
+
};
|
|
1676
|
+
/**
|
|
1677
|
+
* Adds mouse (and pen) drag / wheel navigation to the nearest PanoViewer.
|
|
1678
|
+
* Enabled by default; render this component only to override properties.
|
|
1679
|
+
*/
|
|
1680
|
+
declare function MouseControls({ enabled, rotateSpeed, zoomSpeed, wheel, invert, buttons, fovSpeed, }: MouseControlsProps): null;
|
|
1681
|
+
|
|
1682
|
+
type TouchControlsProps = TouchControlsOptions;
|
|
1683
|
+
/**
|
|
1684
|
+
* Adds touch drag and pinch-zoom navigation to the nearest PanoViewer.
|
|
1685
|
+
* Enabled by default; render this component only to override properties.
|
|
1686
|
+
*/
|
|
1687
|
+
declare function TouchControls({ enabled, rotateSpeed, invert, pinchZoom, }: TouchControlsProps): null;
|
|
1688
|
+
|
|
1689
|
+
declare function SphereTile({ multires, ...props }: SphereTileProps): react.JSX.Element;
|
|
1690
|
+
|
|
1691
|
+
type SphereProps = {
|
|
1692
|
+
src: string;
|
|
1693
|
+
/**
|
|
1694
|
+
* Low-resolution 2:1 equirectangular image shown while `src` loads.
|
|
1695
|
+
* Relative paths resolve against the directory of `src`. Root-absolute and
|
|
1696
|
+
* `http(s)` / `blob:` / `data:` URLs are used as-is. For krpano sphere
|
|
1697
|
+
* scenes, copy `<preview url>`.
|
|
1698
|
+
*/
|
|
1699
|
+
previewUrl: string;
|
|
1700
|
+
/** Horizontal image offset in degrees. */
|
|
1701
|
+
yawOffset?: number;
|
|
1702
|
+
/** Called once the first paintable texture (preview or `src`) is ready. */
|
|
1703
|
+
onReady?: () => void;
|
|
1704
|
+
onLoad?: (texture: Texture) => void;
|
|
1705
|
+
onError?: (error: unknown) => void;
|
|
1706
|
+
/** Called when `previewUrl` cannot be loaded; `src` still continues. */
|
|
1707
|
+
onPreviewError?: (error: unknown) => void;
|
|
1708
|
+
/** Keeps the source mounted for preloading without drawing it. */
|
|
1709
|
+
visible?: boolean;
|
|
1710
|
+
};
|
|
1711
|
+
declare function Sphere({ src, previewUrl, yawOffset, onReady, onLoad, onError, onPreviewError, visible, }: SphereProps): react.JSX.Element | null;
|
|
1712
|
+
|
|
1713
|
+
type PanoVideoProps = {
|
|
1714
|
+
/** Single-file shortcut when `variants` is omitted. */
|
|
1715
|
+
src?: string;
|
|
1716
|
+
poster?: string;
|
|
1717
|
+
variants?: readonly PanoVideoVariant[];
|
|
1718
|
+
defaultVariantId?: string;
|
|
1719
|
+
tracks?: readonly PanoVideoTrack[];
|
|
1720
|
+
/**
|
|
1721
|
+
* Caption overlay. `true` / omit uses the default appearance; `false`
|
|
1722
|
+
* hides captions and the control-bar language menu; an object merges
|
|
1723
|
+
* with the defaults.
|
|
1724
|
+
*/
|
|
1725
|
+
captions?: boolean | PanoVideoCaptionAppearance;
|
|
1726
|
+
/**
|
|
1727
|
+
* Playback chrome. `true` / omit mounts the default bar; `false` skips
|
|
1728
|
+
* it; an object mounts the default bar with appearance overrides.
|
|
1729
|
+
* Render `PanoVideoControls` as a PanoViewer child to replace the default.
|
|
1730
|
+
*/
|
|
1731
|
+
controls?: boolean | PanoVideoControlsAppearance;
|
|
1732
|
+
/** Horizontal video offset in degrees. */
|
|
1733
|
+
yawOffset?: number;
|
|
1734
|
+
loop?: boolean;
|
|
1735
|
+
muted?: boolean;
|
|
1736
|
+
volume?: number;
|
|
1737
|
+
autoPlay?: boolean;
|
|
1738
|
+
/**
|
|
1739
|
+
* Keep playback in the page. Defaults to true, including the WebKit and
|
|
1740
|
+
* X5 attributes for iPhone Safari, WeChat, QQ, and UC.
|
|
1741
|
+
*/
|
|
1742
|
+
playsInline?: boolean;
|
|
1743
|
+
preload?: "none" | "metadata" | "auto";
|
|
1744
|
+
crossOrigin?: "" | "anonymous" | "use-credentials";
|
|
1745
|
+
playbackRates?: readonly number[];
|
|
1746
|
+
/** Keeps the source mounted for preloading without drawing it. */
|
|
1747
|
+
visible?: boolean;
|
|
1748
|
+
onLoad?: () => void;
|
|
1749
|
+
onError?: (event: PanoVideoErrorEvent) => void;
|
|
1750
|
+
onPlaybackStateChange?: (state: VideoPlaybackState) => void;
|
|
1751
|
+
onEnded?: () => void;
|
|
1752
|
+
onVariantChange?: (id: string) => void;
|
|
1753
|
+
onTrackChange?: (id: string | null) => void;
|
|
1754
|
+
};
|
|
1755
|
+
/**
|
|
1756
|
+
* Equirectangular 360 video mapped onto the panorama sphere. Mount inside
|
|
1757
|
+
* PanoViewer. Default playback chrome and captions portal to the viewer overlay.
|
|
1758
|
+
*/
|
|
1759
|
+
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;
|
|
1760
|
+
|
|
1761
|
+
declare const DEFAULT_PANO_VIDEO_CONTROLS_APPEARANCE: Required<PanoVideoControlsAppearance>;
|
|
1762
|
+
type PanoVideoControlsProps = {
|
|
1763
|
+
appearance?: PanoVideoControlsAppearance;
|
|
1764
|
+
};
|
|
1765
|
+
/**
|
|
1766
|
+
* Claims the default playback chrome slot for a custom replacement.
|
|
1767
|
+
* Render inside PanoViewer when overriding the built-in controls.
|
|
1768
|
+
*/
|
|
1769
|
+
declare function PanoVideoControls({ appearance }: PanoVideoControlsProps): null;
|
|
1770
|
+
|
|
1771
|
+
declare const DEFAULT_PANO_VIDEO_PLAYBACK_RATES: readonly [0.5, 1, 1.25, 1.5, 2];
|
|
1772
|
+
|
|
1773
|
+
declare const DEFAULT_PANO_VIDEO_CAPTION_APPEARANCE: Required<PanoVideoCaptionAppearance>;
|
|
1774
|
+
|
|
1775
|
+
type ScenesController = {
|
|
1776
|
+
setScene: (id: string) => boolean;
|
|
1777
|
+
nextScene: () => boolean;
|
|
1778
|
+
previousScene: () => boolean;
|
|
1779
|
+
getActiveSceneId: () => string;
|
|
1780
|
+
getSceneIds: () => readonly string[];
|
|
1781
|
+
isTransitioning: () => boolean;
|
|
1782
|
+
};
|
|
1783
|
+
|
|
1784
|
+
type ImageHotspotProps = HotspotCommonProps & {
|
|
1785
|
+
src: string;
|
|
1786
|
+
onLoad?: (texture: Texture) => void;
|
|
1787
|
+
onError?: (error: unknown) => void;
|
|
1788
|
+
};
|
|
1789
|
+
declare function ImageHotspot({ src, width, height, opacity, onLoad, onError, ...anchorProps }: ImageHotspotProps): react.JSX.Element;
|
|
1790
|
+
|
|
1791
|
+
type PolygonValidationCode = "too_few_vertices" | "self_intersection" | "contains_pole" | "outside_hemisphere";
|
|
1792
|
+
type PolygonValidationIssue = {
|
|
1793
|
+
code: PolygonValidationCode;
|
|
1794
|
+
message: string;
|
|
1795
|
+
};
|
|
1796
|
+
type PolygonVerticesChangeEvent = {
|
|
1797
|
+
id: string;
|
|
1798
|
+
vertices: HotspotPosition[];
|
|
1799
|
+
startVertices: HotspotPosition[];
|
|
1800
|
+
position: HotspotPosition;
|
|
1801
|
+
startPosition: HotspotPosition;
|
|
1802
|
+
};
|
|
1803
|
+
type PolygonHotspotProps = Omit<HotspotCommonProps, "position" | "width" | "height" | "scale" | "mode" | "distance" | "scaleMode" | "rotation" | "onDragStart" | "onPositionChange" | "onDragEnd"> & {
|
|
1804
|
+
vertices: HotspotPosition[];
|
|
1805
|
+
fill?: ColorRepresentation;
|
|
1806
|
+
fillOpacity?: number;
|
|
1807
|
+
stroke?: ColorRepresentation;
|
|
1808
|
+
/** Screen-space border width in CSS pixels. Defaults to 2. */
|
|
1809
|
+
strokeWidth?: number;
|
|
1810
|
+
/** Opacity of the polygon boundary, from 0 to 1. Defaults to 1. */
|
|
1811
|
+
strokeOpacity?: number;
|
|
1812
|
+
/** Dash length in CSS pixels. Omit or 0 for a solid stroke. */
|
|
1813
|
+
strokeDashSize?: number;
|
|
1814
|
+
/** Gap length in CSS pixels. Defaults to `strokeDashSize` when dashed. */
|
|
1815
|
+
strokeGapSize?: number;
|
|
1816
|
+
onVerticesChange?: (event: PolygonVerticesChangeEvent) => void;
|
|
1817
|
+
onDragStart?: (event: PolygonVerticesChangeEvent) => void;
|
|
1818
|
+
onDragEnd?: (event: PolygonVerticesChangeEvent) => void;
|
|
1819
|
+
onInvalid?: (issues: PolygonValidationIssue[]) => void;
|
|
1820
|
+
};
|
|
1821
|
+
type UnwrappedVertex = HotspotPosition & {
|
|
1822
|
+
unwrappedYaw: number;
|
|
1823
|
+
};
|
|
1824
|
+
declare function unwrapPolygonVertices(vertices: HotspotPosition[]): UnwrappedVertex[];
|
|
1825
|
+
declare function validatePolygonVertices(vertices: HotspotPosition[]): PolygonValidationIssue[];
|
|
1826
|
+
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;
|
|
1827
|
+
|
|
1828
|
+
type PolylineValidationIssue = {
|
|
1829
|
+
code: "too_few_vertices";
|
|
1830
|
+
message: string;
|
|
1831
|
+
};
|
|
1832
|
+
type PolylineVerticesChangeEvent = {
|
|
1833
|
+
id: string;
|
|
1834
|
+
vertices: HotspotPosition[];
|
|
1835
|
+
startVertices: HotspotPosition[];
|
|
1836
|
+
position: HotspotPosition;
|
|
1837
|
+
startPosition: HotspotPosition;
|
|
1838
|
+
};
|
|
1839
|
+
type PolylineHotspotProps = Omit<HotspotCommonProps, "position" | "width" | "height" | "scale" | "mode" | "distance" | "scaleMode" | "rotation" | "onDragStart" | "onPositionChange" | "onDragEnd"> & {
|
|
1840
|
+
vertices: HotspotPosition[];
|
|
1841
|
+
stroke?: ColorRepresentation;
|
|
1842
|
+
/** Screen-space line width in CSS pixels. Defaults to 2. */
|
|
1843
|
+
strokeWidth?: number;
|
|
1844
|
+
strokeOpacity?: number;
|
|
1845
|
+
/** Dash length in CSS pixels. Omit or 0 for a solid stroke. */
|
|
1846
|
+
strokeDashSize?: number;
|
|
1847
|
+
/** Gap length in CSS pixels. Defaults to `strokeDashSize` when dashed. */
|
|
1848
|
+
strokeGapSize?: number;
|
|
1849
|
+
onVerticesChange?: (event: PolylineVerticesChangeEvent) => void;
|
|
1850
|
+
onDragStart?: (event: PolylineVerticesChangeEvent) => void;
|
|
1851
|
+
onDragEnd?: (event: PolylineVerticesChangeEvent) => void;
|
|
1852
|
+
onInvalid?: (issues: PolylineValidationIssue[]) => void;
|
|
1853
|
+
};
|
|
1854
|
+
declare function validatePolylineVertices(vertices: HotspotPosition[]): PolylineValidationIssue[];
|
|
1855
|
+
declare function PolylineHotspot({ id, vertices, stroke, strokeWidth, strokeOpacity, strokeDashSize, strokeGapSize, renderOrder, draggable, onVerticesChange, onDragStart, onDragEnd, onInvalid, ...anchorProps }: PolylineHotspotProps): react.JSX.Element | null;
|
|
1856
|
+
|
|
1857
|
+
type SequenceFrameDirection = "horizontal" | "vertical";
|
|
1858
|
+
type SequenceLoadProgress = {
|
|
1859
|
+
id: string;
|
|
1860
|
+
total: number;
|
|
1861
|
+
loaded: number;
|
|
1862
|
+
failed: number;
|
|
1863
|
+
};
|
|
1864
|
+
type SequenceFrameEvent = {
|
|
1865
|
+
id: string;
|
|
1866
|
+
index: number;
|
|
1867
|
+
src: string;
|
|
1868
|
+
};
|
|
1869
|
+
type SequencePlaybackState = "playing" | "paused" | "ended";
|
|
1870
|
+
type SequenceHotspotErrorEvent = {
|
|
1871
|
+
id: string;
|
|
1872
|
+
src: string;
|
|
1873
|
+
error: unknown;
|
|
1874
|
+
};
|
|
1875
|
+
type SequenceHotspotProps = HotspotCommonProps & {
|
|
1876
|
+
/** A sprite sheet containing each frame in equally sized cells. */
|
|
1877
|
+
src: string;
|
|
1878
|
+
/** Number of cells in the sprite sheet, from left-to-right or top-to-bottom. */
|
|
1879
|
+
frameCount: number;
|
|
1880
|
+
frameDirection?: SequenceFrameDirection;
|
|
1881
|
+
playing: boolean;
|
|
1882
|
+
fps?: number;
|
|
1883
|
+
loop?: boolean;
|
|
1884
|
+
onFrameChange?: (event: SequenceFrameEvent) => void;
|
|
1885
|
+
onLoadProgress?: (progress: SequenceLoadProgress) => void;
|
|
1886
|
+
onPlaybackStateChange?: (state: SequencePlaybackState) => void;
|
|
1887
|
+
onEnded?: () => void;
|
|
1888
|
+
onError?: (event: SequenceHotspotErrorEvent) => void;
|
|
1889
|
+
};
|
|
1890
|
+
declare function SequenceHotspot({ id, src, frameCount: requestedFrameCount, frameDirection, playing, fps, loop, width, height, opacity, onFrameChange, onLoadProgress, onPlaybackStateChange, onEnded, onError, ...anchorProps }: SequenceHotspotProps): react.JSX.Element;
|
|
1891
|
+
|
|
1892
|
+
declare function Tile({ baseUrl, multires, previewUrl, previewFaceOrder, urlTemplate, resolveTileUrl, maxTextureMemoryMb, maxConcurrentLoads, retryCount, loadMode, visible, onReady, onPreviewError, onLoadProgress, onTileError, onLevelChange, }: TileProps): react.JSX.Element;
|
|
1893
|
+
|
|
1894
|
+
declare function normalizePanoYaw(yaw: number): number;
|
|
1895
|
+
declare function clampPanoPitch(pitch: number): number;
|
|
1896
|
+
declare function normalizePanoPosition(position: HotspotPosition): HotspotPosition;
|
|
1897
|
+
declare function panoPositionToVector3(position: HotspotPosition, radius?: number): Vector3;
|
|
1898
|
+
declare function vector3ToPanoPosition(vector: Pick<Vector3, "x" | "y" | "z">): HotspotPosition;
|
|
1899
|
+
|
|
1900
|
+
declare const DEFAULT_HOTSPOT_TOOLTIP_OFFSET = 12;
|
|
1901
|
+
declare const DEFAULT_HOTSPOT_TOOLTIP_APPEARANCE: Required<HotspotTooltipAppearance>;
|
|
1902
|
+
|
|
1903
|
+
export { type ArrowGraphic, type AssetUrlContext, type AssetUrlResolver, AudioHotspot, type AudioHotspotDefinition, type AudioHotspotErrorEvent, type AudioHotspotProps, type AudioPlaybackState, AutoRotate, type AutoRotateProps, BackgroundAudio, type BackgroundAudioController, type BackgroundAudioErrorEvent, type BackgroundAudioProps, type BackgroundAudioSnapshot, type BackgroundAudioSource, type CircleGraphic, type CubeFaceCode, type CubemapViewerConfig, 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 JsonRequestOptions, type KeyboardControlAction, type KeyboardControlKeys, KeyboardControls, type KeyboardControlsProps, type LoadPanoProjectOptions, type LoadSceneFromJsonOptions, type LoadedPanoProject, type LoadedProjectScene, MAX_HOTSPOT_PITCH, MIN_PANO_CONTEXT_MENU_BACKGROUND_OPACITY, type MouseControlButton, MouseControls, type MouseControlsOptions, type MouseControlsProps, PANO_FILTER_PRESETS, type PanoColorMatrix, 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, PanoDataError, type PanoDataErrorCode, type PanoEventBus, type PanoEventListener, type PanoEventMap, type PanoEventType, PanoEvents, type PanoEventsProps, PanoFilter, type PanoFilterPreset, type PanoFilterProps, type PanoMediaActivationControls, type PanoMediaActivationOptions, type PanoProjectDefinition, type PanoProjectSceneDefinition, 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, type PanoViewEasing, type PanoViewLookToOptions, type PanoViewNavigationOptions, type PanoViewNavigationResult, 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 ProjectHotspotClickEvent, type ProjectHotspotDefinition, type ProjectHotspotErrorEvent, type ProjectHotspotRenderContext, ProjectScenes, type ProjectScenesProps, type RectangleGraphic, type RingGraphic, type Scene, type SceneFromViewerConfigOptions, type SceneTransition, type SceneTransitionEndEvent, type SceneTransitionErrorEvent, type SceneTransitionPreset, Scenes, type ScenesController, type ScenesProps, type SequenceFrameDirection, type SequenceFrameEvent, SequenceHotspot, type SequenceHotspotDefinition, type SequenceHotspotErrorEvent, type SequenceHotspotProps, type SequenceLoadProgress, type SequencePlaybackState, type SetPanoViewerOptions, Sphere, type SphereProps, type SphereScene, SphereTile, type SphereTileAddress, type SphereTileLevel, type SphereTileLoadError, type SphereTileMultiresConfig, type SphereTileProps, type SphereTileScene, type SphereViewerConfig, 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, type UsePanoViewerResult, VideoHotspot, type VideoHotspotDefinition, type VideoHotspotErrorEvent, type VideoHotspotProps, type VideoPlaybackState, type ViewInteractionEvent, type ViewInteractionSource, type ViewerConfig, type ViewerDocument, 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, loadPanoProject, loadSceneFromJson, normalizePanoPosition, normalizePanoYaw, panoPositionToVector3, parsePanoProject, resolvePanoContextMenuEntries, sceneFromViewerConfig, unwrapPolygonVertices, usePanoEvents, usePanoViewer, validatePolygonVertices, validatePolylineVertices, vector3ToPanoPosition };
|