@ericchen1990/pano-view 3.4.2 → 3.6.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 +615 -73
- package/README.zh-CN.md +583 -71
- package/dist/data.cjs +1080 -0
- package/dist/data.cjs.map +1 -0
- package/dist/data.d.mts +581 -0
- package/dist/data.d.ts +581 -0
- package/dist/data.mjs +1057 -0
- package/dist/data.mjs.map +1 -0
- package/dist/index.cjs +9120 -8431
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +904 -625
- package/dist/index.d.ts +904 -625
- package/dist/index.mjs +9273 -8578
- package/dist/index.mjs.map +1 -1
- package/dist/ui/styles.css +70 -0
- package/dist/ui.cjs +195 -0
- package/dist/ui.cjs.map +1 -0
- package/dist/ui.d.mts +63 -0
- package/dist/ui.d.ts +63 -0
- package/dist/ui.mjs +152 -0
- package/dist/ui.mjs.map +1 -0
- package/docs/dialogs.md +606 -0
- package/docs/dialogs.zh-CN.md +606 -0
- package/package.json +20 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,23 @@
|
|
|
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
|
+
/** Camera-center limits in degrees. A yaw min greater than max crosses ±180°. */
|
|
6
|
+
type PanoViewLimits = {
|
|
7
|
+
yaw?: {
|
|
8
|
+
min: number;
|
|
9
|
+
max: number;
|
|
10
|
+
};
|
|
11
|
+
pitch?: {
|
|
12
|
+
min: number;
|
|
13
|
+
max: number;
|
|
14
|
+
};
|
|
15
|
+
fov?: {
|
|
16
|
+
min: number;
|
|
17
|
+
max: number;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
|
|
5
21
|
declare const MAX_HOTSPOT_PITCH = 90;
|
|
6
22
|
type HotspotPosition = {
|
|
7
23
|
/** Horizontal panorama angle in degrees. Positive values look right. */
|
|
@@ -100,6 +116,8 @@ type HotspotCommonProps = {
|
|
|
100
116
|
opacity?: number;
|
|
101
117
|
renderOrder?: number;
|
|
102
118
|
visible?: boolean;
|
|
119
|
+
/** Show a 3px selection border around a point hotspot. Defaults to false. */
|
|
120
|
+
selected?: boolean;
|
|
103
121
|
/** Whether the hotspot accepts pointer and keyboard interaction. Defaults to true. */
|
|
104
122
|
interactive?: boolean;
|
|
105
123
|
/**
|
|
@@ -736,9 +754,40 @@ type PanoCursors = {
|
|
|
736
754
|
};
|
|
737
755
|
declare const DEFAULT_PANO_CURSORS: Required<PanoCursors>;
|
|
738
756
|
|
|
757
|
+
type PanoOverlayRenderContext = {
|
|
758
|
+
/** Stable viewer-local portal target; null until the DOM has mounted. */
|
|
759
|
+
portalContainer: HTMLDivElement | null;
|
|
760
|
+
/** Available viewer space in CSS pixels, independent of nested portal targets. */
|
|
761
|
+
size: {
|
|
762
|
+
width: number;
|
|
763
|
+
height: number;
|
|
764
|
+
};
|
|
765
|
+
/** Screen-visible part of the viewer, in viewer-local CSS pixels. */
|
|
766
|
+
visibleRect: {
|
|
767
|
+
left: number;
|
|
768
|
+
top: number;
|
|
769
|
+
width: number;
|
|
770
|
+
height: number;
|
|
771
|
+
};
|
|
772
|
+
isFullscreen: boolean;
|
|
773
|
+
};
|
|
774
|
+
/** Read inside PanoViewer.renderOverlay or its DOM descendants. */
|
|
775
|
+
declare function usePanoOverlay(): PanoOverlayRenderContext;
|
|
776
|
+
/** Coordinate a custom modal with viewer inputs. Accessibility stays with the modal. */
|
|
777
|
+
declare function usePanoModal(open: boolean): void;
|
|
778
|
+
/** Keep nested portals inside the active dialog's interactive subtree. */
|
|
779
|
+
declare function PanoOverlayPortalProvider({ container, children, }: {
|
|
780
|
+
container: HTMLDivElement | null;
|
|
781
|
+
children: ReactNode;
|
|
782
|
+
}): react.JSX.Element;
|
|
783
|
+
|
|
739
784
|
type PanoViewerProps = Omit<ComponentPropsWithoutRef<"div">, "children" | "onChange" | "contextMenu"> & {
|
|
740
785
|
children?: ReactNode;
|
|
786
|
+
/** Viewer-local DOM UI, rendered outside the Three.js tree, including in fullscreen. */
|
|
787
|
+
renderOverlay?: (context: PanoOverlayRenderContext) => ReactNode;
|
|
741
788
|
initialView?: Partial<PanoViewerState>;
|
|
789
|
+
/** Camera-center limits; scene limits override individual axes. */
|
|
790
|
+
viewLimits?: PanoViewLimits;
|
|
742
791
|
minFov?: number;
|
|
743
792
|
maxFov?: number;
|
|
744
793
|
controls?: boolean | PanoramaControlsOptions;
|
|
@@ -772,7 +821,11 @@ type PanoViewerProps = Omit<ComponentPropsWithoutRef<"div">, "children" | "onCha
|
|
|
772
821
|
};
|
|
773
822
|
declare const PanoViewer: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "children" | "onChange" | "contextMenu"> & {
|
|
774
823
|
children?: ReactNode;
|
|
824
|
+
/** Viewer-local DOM UI, rendered outside the Three.js tree, including in fullscreen. */
|
|
825
|
+
renderOverlay?: (context: PanoOverlayRenderContext) => ReactNode;
|
|
775
826
|
initialView?: Partial<PanoViewerState>;
|
|
827
|
+
/** Camera-center limits; scene limits override individual axes. */
|
|
828
|
+
viewLimits?: PanoViewLimits;
|
|
776
829
|
minFov?: number;
|
|
777
830
|
maxFov?: number;
|
|
778
831
|
controls?: boolean | PanoramaControlsOptions;
|
|
@@ -805,185 +858,836 @@ declare const PanoViewer: react.ForwardRefExoticComponent<Omit<Omit<react.Detail
|
|
|
805
858
|
dpr?: number | [number, number];
|
|
806
859
|
} & react.RefAttributes<PanoViewerHandle>>;
|
|
807
860
|
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
}
|
|
822
|
-
/**
|
|
823
|
-
* Adds automatic rotation to the nearest PanoViewer. Render one instance as a
|
|
824
|
-
* child of PanoViewer, alongside its panorama source.
|
|
825
|
-
*/
|
|
826
|
-
declare function AutoRotate({ enabled, speed, acceleration, startDelay, }: AutoRotateProps): null;
|
|
861
|
+
type PanoDataErrorCode = "INVALID_OPTIONS" | "FETCH_FAILED" | "HTTP_ERROR" | "INVALID_JSON" | "INVALID_CONFIG" | "UNSUPPORTED_SCHEMA_VERSION" | "UNSUPPORTED_PROJECTION" | "INVALID_PROJECT" | "INVALID_REFERENCE" | "ABORTED";
|
|
862
|
+
declare class PanoDataError extends Error {
|
|
863
|
+
readonly code: PanoDataErrorCode;
|
|
864
|
+
readonly status?: number;
|
|
865
|
+
readonly sceneId?: string;
|
|
866
|
+
readonly field?: string;
|
|
867
|
+
readonly cause?: unknown;
|
|
868
|
+
constructor(code: PanoDataErrorCode, message: string, details?: {
|
|
869
|
+
status?: number;
|
|
870
|
+
sceneId?: string;
|
|
871
|
+
field?: string;
|
|
872
|
+
cause?: unknown;
|
|
873
|
+
});
|
|
874
|
+
}
|
|
827
875
|
|
|
828
|
-
|
|
829
|
-
type
|
|
830
|
-
|
|
831
|
-
|
|
876
|
+
/** The portable rendering contract shared by the converter and browser viewer. */
|
|
877
|
+
type ViewerCubeFace = "f" | "r" | "b" | "l" | "u" | "d";
|
|
878
|
+
type CubemapViewerConfig = {
|
|
879
|
+
type: "tile";
|
|
880
|
+
multires: {
|
|
881
|
+
tileSize: number;
|
|
882
|
+
levels: number[];
|
|
883
|
+
};
|
|
884
|
+
urlTemplate: string;
|
|
885
|
+
previewUrl: string;
|
|
886
|
+
previewFaceOrder: ViewerCubeFace[];
|
|
832
887
|
};
|
|
833
|
-
type
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
onPlaybackStateChange?: (state: AudioPlaybackState) => void;
|
|
850
|
-
onPlaybackError?: (error: unknown) => void;
|
|
851
|
-
onEnded?: () => void;
|
|
852
|
-
onError?: (event: AudioHotspotErrorEvent) => void;
|
|
888
|
+
type SphereViewerConfig = {
|
|
889
|
+
type: "sphereTile";
|
|
890
|
+
multires: {
|
|
891
|
+
tileSize: number;
|
|
892
|
+
levels: {
|
|
893
|
+
width: number;
|
|
894
|
+
height: number;
|
|
895
|
+
}[];
|
|
896
|
+
};
|
|
897
|
+
urlTemplate: string;
|
|
898
|
+
previewUrl: string;
|
|
899
|
+
indexBase: 0 | 1;
|
|
900
|
+
};
|
|
901
|
+
type ViewerConfig = CubemapViewerConfig | SphereViewerConfig;
|
|
902
|
+
type ViewerDocument = ViewerConfig & {
|
|
903
|
+
schemaVersion: 1;
|
|
853
904
|
};
|
|
854
|
-
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;
|
|
855
905
|
|
|
856
|
-
type
|
|
857
|
-
type
|
|
906
|
+
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";
|
|
907
|
+
type SceneTransition = SceneTransitionPreset | {
|
|
908
|
+
preset: SceneTransitionPreset;
|
|
909
|
+
/** Overrides the preset default duration in seconds. */
|
|
910
|
+
duration?: number;
|
|
911
|
+
};
|
|
912
|
+
|
|
913
|
+
type CubeFaceCode = "f" | "r" | "b" | "l" | "u" | "d";
|
|
914
|
+
type TileAddress = {
|
|
915
|
+
face: CubeFaceCode;
|
|
916
|
+
level: number;
|
|
917
|
+
row: number;
|
|
918
|
+
col: number;
|
|
919
|
+
faceSize: number;
|
|
920
|
+
tileSize: number;
|
|
921
|
+
width: number;
|
|
922
|
+
height: number;
|
|
923
|
+
};
|
|
924
|
+
type TileMultiresConfig = {
|
|
925
|
+
tileSize: number;
|
|
926
|
+
/** Ascending face sizes. The first value maps to l1. */
|
|
927
|
+
levels: number[];
|
|
928
|
+
};
|
|
929
|
+
type TileLoadProgress = {
|
|
930
|
+
requested: number;
|
|
931
|
+
loaded: number;
|
|
932
|
+
failed: number;
|
|
933
|
+
active: number;
|
|
934
|
+
queued: number;
|
|
935
|
+
};
|
|
936
|
+
type TileLoadError = {
|
|
937
|
+
address: TileAddress;
|
|
938
|
+
url: string;
|
|
858
939
|
error: unknown;
|
|
859
940
|
};
|
|
860
|
-
type
|
|
861
|
-
|
|
862
|
-
src?: BackgroundAudioSource;
|
|
863
|
-
/** Per-scene tracks keyed by `Scene.id`. Requires `sceneId`. */
|
|
864
|
-
sources?: Readonly<Record<string, BackgroundAudioSource>>;
|
|
865
|
-
/** Current scene id. Required when `sources` is set. */
|
|
866
|
-
sceneId?: string;
|
|
941
|
+
type TileProps = {
|
|
942
|
+
baseUrl: string;
|
|
867
943
|
/**
|
|
868
|
-
*
|
|
869
|
-
*
|
|
870
|
-
* `playBackgroundAudio` / `pauseBackgroundAudio` work directly.
|
|
944
|
+
* Tile size followed by ascending cube-face sizes (`TILESIZE,LEVELSIZE1,...`).
|
|
945
|
+
* For krpano output, copy `image.cube.multires` from the XML.
|
|
871
946
|
*/
|
|
872
|
-
|
|
873
|
-
/** Initial playing state when `playing` is omitted. Defaults to false. */
|
|
874
|
-
defaultPlaying?: boolean;
|
|
875
|
-
/** Defaults to true. */
|
|
876
|
-
loop?: boolean;
|
|
877
|
-
muted?: boolean;
|
|
878
|
-
volume?: number;
|
|
879
|
-
pauseWhenHidden?: boolean;
|
|
880
|
-
/** Crossfade duration when the resolved track changes. Defaults to 400; 0 is a hard cut. */
|
|
881
|
-
fadeMs?: number;
|
|
882
|
-
crossOrigin?: "" | "anonymous" | "use-credentials";
|
|
883
|
-
onPlaybackStateChange?: (state: AudioPlaybackState) => void;
|
|
884
|
-
onPlaybackError?: (error: unknown) => void;
|
|
885
|
-
onEnded?: () => void;
|
|
886
|
-
onError?: (event: BackgroundAudioErrorEvent) => void;
|
|
887
|
-
};
|
|
888
|
-
/**
|
|
889
|
-
* Adds a non-spatial soundtrack to the nearest PanoViewer. Render one instance
|
|
890
|
-
* as a child of PanoViewer, alongside Scenes or a panorama source — not inside
|
|
891
|
-
* renderHotspots.
|
|
892
|
-
*/
|
|
893
|
-
declare function BackgroundAudio({ src, sources, sceneId, playing: controlledPlaying, defaultPlaying, loop, muted, volume, pauseWhenHidden, fadeMs, crossOrigin, onPlaybackStateChange, onPlaybackError, onEnded, onError, }: BackgroundAudioProps): null;
|
|
894
|
-
|
|
895
|
-
declare const PANO_FILTER_PRESETS: readonly ["none", "grayscale", "sepia", "vintage", "cool", "warm", "pencil", "coloredPencil", "crayon", "watercolor", "cartoon", "crosshatch"];
|
|
896
|
-
type PanoFilterPreset = (typeof PANO_FILTER_PRESETS)[number];
|
|
897
|
-
/** Row-major 4×5 RGBA matrix, applied in display (sRGB) space like an SVG color matrix. */
|
|
898
|
-
type PanoColorMatrix = readonly [
|
|
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
|
-
number,
|
|
916
|
-
number,
|
|
917
|
-
number,
|
|
918
|
-
number
|
|
919
|
-
];
|
|
920
|
-
|
|
921
|
-
type PanoFilterProps = {
|
|
922
|
-
/** Built-in look. Defaults to `none` (identity). */
|
|
923
|
-
preset?: PanoFilterPreset;
|
|
924
|
-
/** Mix with the original panorama, 0–1. Defaults to 1. */
|
|
925
|
-
intensity?: number;
|
|
926
|
-
/** Display-space RGBA matrix applied after the artistic preset. */
|
|
927
|
-
colorMatrix?: PanoColorMatrix | null;
|
|
928
|
-
/** `all` also filters hotspot textures. HTML tooltips/chrome remain host-styled. */
|
|
929
|
-
colorMatrixScope?: "panorama" | "all";
|
|
930
|
-
/** When false, the panorama renders without a filter. Defaults to true. */
|
|
931
|
-
enabled?: boolean;
|
|
932
|
-
};
|
|
933
|
-
/**
|
|
934
|
-
* Applies a color or artistic filter to the panorama source of the nearest
|
|
935
|
-
* PanoViewer. Render one instance as a child of PanoViewer. colorMatrixScope
|
|
936
|
-
* can include hotspot textures; HTML chrome remains host-styled.
|
|
937
|
-
*/
|
|
938
|
-
declare function PanoFilter({ preset, intensity, enabled, colorMatrix, colorMatrixScope, }: PanoFilterProps): null;
|
|
939
|
-
|
|
940
|
-
type GyroTouchMode = "off" | "horizontaloffset" | "full" | "disablegyro";
|
|
941
|
-
|
|
942
|
-
type GyroHandle = {
|
|
943
|
-
resetSensor: (yaw?: number, pitch?: number) => void;
|
|
944
|
-
isAvailable: () => boolean;
|
|
945
|
-
isEnabled: () => boolean;
|
|
947
|
+
multires: string | TileMultiresConfig;
|
|
946
948
|
/**
|
|
947
|
-
*
|
|
948
|
-
*
|
|
949
|
+
* Preview atlas path. Relative paths resolve against `baseUrl`; root-absolute
|
|
950
|
+
* and `http(s)` / `blob:` / `data:` URLs are used as-is. For krpano output,
|
|
951
|
+
* copy `<preview url>` (often `preview.jpg` at the scene root). This package's
|
|
952
|
+
* common cube atlas path is `previews/cube-vertical.webp`.
|
|
949
953
|
*/
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
/**
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
954
|
+
previewUrl: string;
|
|
955
|
+
/**
|
|
956
|
+
* Face order in the vertical preview atlas, from top to bottom. Defaults to
|
|
957
|
+
* `l/f/r/b/u/d`, matching krpano `preview.striporder` `LFRBUD`.
|
|
958
|
+
*/
|
|
959
|
+
previewFaceOrder?: readonly CubeFaceCode[];
|
|
960
|
+
/**
|
|
961
|
+
* Path relative to `baseUrl`. Defaults to
|
|
962
|
+
* `tiles/%s/l%l/%v/l%l_%s_%h_%v.webp`. For krpano output, copy `<cube url>`
|
|
963
|
+
* from the XML; krpano templates often use `%v_%h` instead of this default
|
|
964
|
+
* `%h_%v`, so omitting `urlTemplate` requests the wrong files. Supports
|
|
965
|
+
* krpano cube-tile `%s` and `%l` placeholders, horizontal `%h`/`%x`/`%u`/`%c`,
|
|
966
|
+
* vertical `%v`/`%y`/`%w`/`%r`, and index padding such as `%0h` or `%00v`.
|
|
967
|
+
*/
|
|
968
|
+
urlTemplate?: string;
|
|
969
|
+
/** Returns a relative path or absolute URL; takes precedence over `urlTemplate`. */
|
|
970
|
+
resolveTileUrl?: (address: TileAddress) => string;
|
|
971
|
+
maxTextureMemoryMb?: number;
|
|
972
|
+
maxConcurrentLoads?: number;
|
|
973
|
+
retryCount?: number;
|
|
974
|
+
/**
|
|
975
|
+
* `preview` loads only the preview atlas; `base` also preloads the visible
|
|
976
|
+
* lowest-resolution tiles before full-resolution loading begins.
|
|
977
|
+
*/
|
|
978
|
+
loadMode?: "full" | "preview" | "base";
|
|
979
|
+
/** Keeps the source mounted for preloading without drawing it. */
|
|
980
|
+
visible?: boolean;
|
|
981
|
+
/** Called when the preview atlas is ready for display. */
|
|
982
|
+
onReady?: () => void;
|
|
983
|
+
/** Called when the preview atlas cannot be loaded. */
|
|
984
|
+
onPreviewError?: (error: unknown) => void;
|
|
985
|
+
onLoadProgress?: (progress: TileLoadProgress) => void;
|
|
986
|
+
onTileError?: (event: TileLoadError) => void;
|
|
987
|
+
onLevelChange?: (level: number) => void;
|
|
974
988
|
};
|
|
975
|
-
/**
|
|
976
|
-
* Adds device-orientation navigation to the nearest PanoViewer.
|
|
977
|
-
* Sensor access is opt-in and disabled by default.
|
|
978
|
-
*/
|
|
979
|
-
declare const Gyro: react.ForwardRefExoticComponent<GyroProps & react.RefAttributes<GyroHandle>>;
|
|
980
|
-
|
|
981
|
-
declare const WebVR: react.ForwardRefExoticComponent<WebVRProps & react.RefAttributes<WebVRHandle>>;
|
|
982
989
|
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
990
|
+
type SphereTileLevel = {
|
|
991
|
+
width: number;
|
|
992
|
+
height: number;
|
|
993
|
+
};
|
|
994
|
+
type SphereTileMultiresConfig = {
|
|
995
|
+
tileSize: number;
|
|
996
|
+
/** Ascending image dimensions. The first item maps to level 0. */
|
|
997
|
+
levels: SphereTileLevel[];
|
|
998
|
+
};
|
|
999
|
+
type SphereTileAddress = {
|
|
1000
|
+
/** Zero-based logical level, column and row; URL indices add indexBase. */
|
|
1001
|
+
level: number;
|
|
1002
|
+
col: number;
|
|
1003
|
+
row: number;
|
|
1004
|
+
imageWidth: number;
|
|
1005
|
+
imageHeight: number;
|
|
1006
|
+
tileSize: number;
|
|
1007
|
+
/** Actual tile dimensions, including partial edge tiles. */
|
|
1008
|
+
width: number;
|
|
1009
|
+
height: number;
|
|
1010
|
+
};
|
|
1011
|
+
type SphereTileLoadError = {
|
|
1012
|
+
address: SphereTileAddress;
|
|
1013
|
+
url: string;
|
|
1014
|
+
error: unknown;
|
|
1015
|
+
};
|
|
1016
|
+
type SphereTileProps = {
|
|
1017
|
+
baseUrl: string;
|
|
1018
|
+
/** `512,500x250,1000x500,2000x1000` or explicit ascending dimensions. */
|
|
1019
|
+
multires: string | SphereTileMultiresConfig;
|
|
1020
|
+
/** A 2:1 equirectangular preview, resolved relative to baseUrl. */
|
|
1021
|
+
previewUrl: string;
|
|
1022
|
+
/** Defaults to `tiles/%l/%h_%v.webp`. No tile overlap. */
|
|
1023
|
+
urlTemplate?: string;
|
|
1024
|
+
/** URL indices start at 1 for krpano (default), or 0 for raw Sharp Deep Zoom. */
|
|
1025
|
+
indexBase?: 0 | 1;
|
|
1026
|
+
/** Takes precedence over urlTemplate and indexBase. Receives zero-based addresses. */
|
|
1027
|
+
resolveTileUrl?: (address: SphereTileAddress) => string;
|
|
1028
|
+
/** Horizontal source rotation in degrees. Defaults to 0. */
|
|
1029
|
+
yawOffset?: number;
|
|
1030
|
+
/** Tile cache budget in MiB. Defaults to 128. Preview memory is separate. */
|
|
1031
|
+
maxTextureMemoryMb?: number;
|
|
1032
|
+
/** Defaults to 4. */
|
|
1033
|
+
maxConcurrentLoads?: number;
|
|
1034
|
+
/** Retries after the initial attempt. Defaults to 1. */
|
|
1035
|
+
retryCount?: number;
|
|
1036
|
+
loadMode?: "full" | "preview" | "base";
|
|
1037
|
+
visible?: boolean;
|
|
1038
|
+
/** First paintable preview or tile is ready, even if the preview failed. */
|
|
1039
|
+
onReady?: () => void;
|
|
1040
|
+
onPreviewError?: (error: unknown) => void;
|
|
1041
|
+
onLoadProgress?: (progress: TileLoadProgress) => void;
|
|
1042
|
+
onTileError?: (event: SphereTileLoadError) => void;
|
|
1043
|
+
/** Zero-based selected level. */
|
|
1044
|
+
onLevelChange?: (level: number) => void;
|
|
1045
|
+
};
|
|
1046
|
+
|
|
1047
|
+
type SceneViewOptions = {
|
|
1048
|
+
viewLimits?: PanoViewLimits;
|
|
1049
|
+
};
|
|
1050
|
+
type SphereScene = SceneViewOptions & {
|
|
1051
|
+
id: string;
|
|
1052
|
+
type: "sphere";
|
|
1053
|
+
src: string;
|
|
1054
|
+
previewUrl: string;
|
|
1055
|
+
yawOffset?: number;
|
|
1056
|
+
};
|
|
1057
|
+
type TileScene = Omit<TileProps, "loadMode" | "visible" | "onReady" | "onPreviewError" | "onLoadProgress" | "onTileError" | "onLevelChange"> & SceneViewOptions & {
|
|
1058
|
+
id: string;
|
|
1059
|
+
type: "tile";
|
|
1060
|
+
};
|
|
1061
|
+
type SphereTileScene = Omit<SphereTileProps, "loadMode" | "visible" | "onReady" | "onPreviewError" | "onLoadProgress" | "onTileError" | "onLevelChange"> & SceneViewOptions & {
|
|
1062
|
+
id: string;
|
|
1063
|
+
type: "sphereTile";
|
|
1064
|
+
};
|
|
1065
|
+
type Scene = SphereScene | TileScene | SphereTileScene;
|
|
1066
|
+
type SceneTransitionEndEvent = {
|
|
1067
|
+
previousSceneId: string;
|
|
1068
|
+
sceneId: string;
|
|
1069
|
+
preset: SceneTransitionPreset;
|
|
1070
|
+
};
|
|
1071
|
+
type SceneTransitionErrorEvent = {
|
|
1072
|
+
sceneId: string;
|
|
1073
|
+
error: unknown;
|
|
1074
|
+
};
|
|
1075
|
+
type ScenesProps = {
|
|
1076
|
+
scenes: readonly Scene[];
|
|
1077
|
+
/**
|
|
1078
|
+
* Controlled scene id. When provided, the parent owns the active scene.
|
|
1079
|
+
* Imperative `setScene` / `nextScene` / `previousScene` will call
|
|
1080
|
+
* `onActiveSceneIdChange` so the parent can update its state.
|
|
1081
|
+
*/
|
|
1082
|
+
activeSceneId?: string;
|
|
1083
|
+
/**
|
|
1084
|
+
* Uncontrolled initial scene id. Used when `activeSceneId` is omitted.
|
|
1085
|
+
* Imperative calls update the internal state directly.
|
|
1086
|
+
*/
|
|
1087
|
+
defaultActiveSceneId?: string;
|
|
1088
|
+
/** Called when imperative scene methods request a scene change in controlled mode. */
|
|
1089
|
+
onActiveSceneIdChange?: (id: string) => void;
|
|
1090
|
+
transition?: SceneTransition;
|
|
1091
|
+
/** Rendered only after a scene has finished transitioning in. */
|
|
1092
|
+
renderHotspots?: (scene: Scene) => ReactNode;
|
|
1093
|
+
/** First paintable scene, or an incoming scene taking over after snapshot capture.
|
|
1094
|
+
* The transition may still be running, and full detail may still be loading.
|
|
1095
|
+
* Safe to apply the incoming camera view here.
|
|
1096
|
+
*/
|
|
1097
|
+
onSceneReady?: (sceneId: string) => void;
|
|
1098
|
+
/**
|
|
1099
|
+
* Extra milliseconds to hold the outgoing snapshot after it is captured and the
|
|
1100
|
+
* incoming scene has switched to full detail. `0` (default) starts the blend
|
|
1101
|
+
* immediately and keeps loading detail during it. A positive value starts the
|
|
1102
|
+
* blend early when the current view is already sharp, otherwise it waits at
|
|
1103
|
+
* most this long. The wait is separate from the blend duration. Negative and
|
|
1104
|
+
* non-finite values are treated as `0`. `transition="none"` cuts over directly
|
|
1105
|
+
* once the same condition is met.
|
|
1106
|
+
*/
|
|
1107
|
+
transitionWaitForDetailMs?: number;
|
|
1108
|
+
onTransitionEnd?: (event: SceneTransitionEndEvent) => void;
|
|
1109
|
+
onTransitionError?: (event: SceneTransitionErrorEvent) => void;
|
|
1110
|
+
/** Viewer-wide budget shared by every tile scene. Defaults to 128 MiB. */
|
|
1111
|
+
maxTextureMemoryMb?: number;
|
|
1112
|
+
/** Viewer-wide tile request limit. Defaults to 4. */
|
|
1113
|
+
maxConcurrentTileLoads?: number;
|
|
1114
|
+
/** Maximum physical-pixel area of the outgoing GPU snapshot. */
|
|
1115
|
+
snapshotMaxPixels?: number;
|
|
1116
|
+
};
|
|
1117
|
+
declare function Scenes({ maxTextureMemoryMb, maxConcurrentTileLoads, activeSceneId: controlledId, defaultActiveSceneId, onActiveSceneIdChange, scenes, ...rest }: ScenesProps): react.JSX.Element;
|
|
1118
|
+
|
|
1119
|
+
type AssetUrlContext = {
|
|
1120
|
+
defaultUrl: string;
|
|
1121
|
+
kind: "tile" | "preview" | "hotspot";
|
|
1122
|
+
sceneId: string;
|
|
1123
|
+
hotspotId?: string;
|
|
1124
|
+
};
|
|
1125
|
+
type AssetUrlResolver = (path: string, context: AssetUrlContext) => string;
|
|
1126
|
+
type JsonRequestOptions = {
|
|
1127
|
+
requestInit?: Pick<RequestInit, "headers" | "credentials" | "signal">;
|
|
1128
|
+
};
|
|
1129
|
+
type SceneFromViewerConfigOptions = {
|
|
1130
|
+
id: string;
|
|
1131
|
+
baseUrl: string;
|
|
1132
|
+
resolveAssetUrl?: AssetUrlResolver;
|
|
1133
|
+
};
|
|
1134
|
+
type LoadSceneFromJsonOptions = Omit<SceneFromViewerConfigOptions, "baseUrl"> & JsonRequestOptions & {
|
|
1135
|
+
baseUrl?: string;
|
|
1136
|
+
};
|
|
1137
|
+
declare function sceneFromViewerConfig(value: unknown, options: SceneFromViewerConfigOptions): TileScene | SphereTileScene;
|
|
1138
|
+
declare function loadSceneFromJson(url: string, options: LoadSceneFromJsonOptions): Promise<TileScene | SphereTileScene>;
|
|
1139
|
+
|
|
1140
|
+
type ProjectPopupBlock = {
|
|
1141
|
+
id: string;
|
|
1142
|
+
} & ({
|
|
1143
|
+
type: "text";
|
|
1144
|
+
text: string;
|
|
1145
|
+
} | {
|
|
1146
|
+
type: "image";
|
|
1147
|
+
src: string;
|
|
1148
|
+
alt?: string;
|
|
1149
|
+
} | {
|
|
1150
|
+
type: "video";
|
|
1151
|
+
src: string;
|
|
1152
|
+
poster?: string;
|
|
1153
|
+
} | {
|
|
1154
|
+
type: "audio";
|
|
1155
|
+
src: string;
|
|
1156
|
+
});
|
|
1157
|
+
type ProjectPopupDefinition = {
|
|
1158
|
+
id: string;
|
|
1159
|
+
title: string;
|
|
1160
|
+
blocks: ProjectPopupBlock[];
|
|
1161
|
+
};
|
|
1162
|
+
type PopupAssetUrlContext = {
|
|
1163
|
+
defaultUrl: string;
|
|
1164
|
+
popupId: string;
|
|
1165
|
+
blockId: string;
|
|
1166
|
+
field: "src" | "poster";
|
|
1167
|
+
};
|
|
1168
|
+
type PopupAssetUrlResolver = (path: string, context: PopupAssetUrlContext) => string;
|
|
1169
|
+
declare function resolveProjectPopupAssets(popup: ProjectPopupDefinition, baseUrl: string, resolver?: PopupAssetUrlResolver): ProjectPopupDefinition;
|
|
1170
|
+
|
|
1171
|
+
type GraphicPaint = {
|
|
1172
|
+
fill?: string;
|
|
1173
|
+
stroke?: string;
|
|
1174
|
+
strokeWidth?: number;
|
|
1175
|
+
};
|
|
1176
|
+
type CircleGraphic = GraphicPaint & {
|
|
1177
|
+
kind: "circle";
|
|
1178
|
+
};
|
|
1179
|
+
type TriangleGraphic = GraphicPaint & {
|
|
1180
|
+
kind: "triangle";
|
|
1181
|
+
};
|
|
1182
|
+
type DiamondGraphic = GraphicPaint & {
|
|
1183
|
+
kind: "diamond";
|
|
1184
|
+
};
|
|
1185
|
+
type StarGraphic = GraphicPaint & {
|
|
1186
|
+
kind: "star";
|
|
1187
|
+
};
|
|
1188
|
+
type ArrowGraphic = GraphicPaint & {
|
|
1189
|
+
kind: "arrow";
|
|
1190
|
+
};
|
|
1191
|
+
type RectangleGraphic = GraphicPaint & {
|
|
1192
|
+
kind: "rectangle";
|
|
1193
|
+
/** Relative radius from 0 (square corners) to 0.5 (maximum rounded corners). */
|
|
1194
|
+
cornerRadius?: number;
|
|
1195
|
+
};
|
|
1196
|
+
type RingGraphic = GraphicPaint & {
|
|
1197
|
+
kind: "ring";
|
|
1198
|
+
innerRadius?: number;
|
|
1199
|
+
};
|
|
1200
|
+
type SvgGraphic = {
|
|
1201
|
+
kind: "svg";
|
|
1202
|
+
src: string;
|
|
1203
|
+
};
|
|
1204
|
+
type SvgPathGraphic = GraphicPaint & {
|
|
1205
|
+
kind: "path";
|
|
1206
|
+
path: string;
|
|
1207
|
+
viewBox: [x: number, y: number, width: number, height: number];
|
|
1208
|
+
};
|
|
1209
|
+
type GraphicDefinition = CircleGraphic | TriangleGraphic | DiamondGraphic | StarGraphic | ArrowGraphic | RectangleGraphic | RingGraphic | SvgGraphic | SvgPathGraphic;
|
|
1210
|
+
type GraphicHotspotProps = HotspotCommonProps & {
|
|
1211
|
+
graphic: GraphicDefinition;
|
|
1212
|
+
onLoad?: (texture: Texture) => void;
|
|
1213
|
+
onError?: (error: unknown) => void;
|
|
1214
|
+
};
|
|
1215
|
+
declare function GraphicHotspot(props: GraphicHotspotProps): react.JSX.Element;
|
|
1216
|
+
|
|
1217
|
+
type IframePointerPolicy = "hotspot" | "content";
|
|
1218
|
+
type IframeHotspotProps = HotspotCommonProps & {
|
|
1219
|
+
src: string;
|
|
1220
|
+
/** Accessible iframe title. Falls back to ariaLabel. */
|
|
1221
|
+
title?: string;
|
|
1222
|
+
sandbox?: string;
|
|
1223
|
+
allow?: string;
|
|
1224
|
+
referrerPolicy?: IframeHTMLAttributes<HTMLIFrameElement>["referrerPolicy"];
|
|
1225
|
+
loading?: "eager" | "lazy";
|
|
1226
|
+
/**
|
|
1227
|
+
* `hotspot` lets panorama pointer events hit the WebGL plane.
|
|
1228
|
+
* `content` makes the embedded page interactive.
|
|
1229
|
+
*/
|
|
1230
|
+
pointerPolicy?: IframePointerPolicy;
|
|
1231
|
+
background?: string;
|
|
1232
|
+
onLoad?: () => void;
|
|
1233
|
+
onError?: (error: unknown) => void;
|
|
1234
|
+
};
|
|
1235
|
+
declare function IframeHotspot({ src, title, sandbox, allow, referrerPolicy, loading, pointerPolicy, background, opacity, width, height, onLoad, onError, interactive, pointerEvents, ...anchorProps }: IframeHotspotProps): react.JSX.Element;
|
|
1236
|
+
|
|
1237
|
+
type TextHotspotAlign = "left" | "center" | "right";
|
|
1238
|
+
type TextHotspotVerticalAlign = "top" | "middle" | "bottom";
|
|
1239
|
+
type TextHotspotWhiteSpace = "normal" | "nowrap";
|
|
1240
|
+
type TextHotspotFontStyle = "normal" | "italic";
|
|
1241
|
+
/** Serializable typography and panel paint for a text hotspot. */
|
|
1242
|
+
type TextHotspotStyle = {
|
|
1243
|
+
fontFamily?: string;
|
|
1244
|
+
/** Canvas pixels. Defaults to 96. */
|
|
1245
|
+
fontSize?: number;
|
|
1246
|
+
/** CSS font-weight. Defaults to 600. */
|
|
1247
|
+
fontWeight?: number | string;
|
|
1248
|
+
/** CSS font-style. Defaults to `"normal"`. */
|
|
1249
|
+
fontStyle?: TextHotspotFontStyle;
|
|
1250
|
+
color?: string;
|
|
1251
|
+
/** CSS color. An empty string skips the panel fill. */
|
|
1252
|
+
background?: string;
|
|
1253
|
+
backgroundOpacity?: number;
|
|
1254
|
+
/** Fraction of the texture's shorter side. */
|
|
1255
|
+
padding?: number;
|
|
1256
|
+
align?: TextHotspotAlign;
|
|
1257
|
+
verticalAlign?: TextHotspotVerticalAlign;
|
|
1258
|
+
lineHeight?: number;
|
|
1259
|
+
whiteSpace?: TextHotspotWhiteSpace;
|
|
1260
|
+
/** Fraction of the texture's shorter side, from 0 to 0.5. */
|
|
1261
|
+
borderRadius?: number;
|
|
1262
|
+
stroke?: string;
|
|
1263
|
+
strokeWidth?: number;
|
|
1264
|
+
};
|
|
1265
|
+
type TextHotspotProps = HotspotCommonProps & TextHotspotStyle & {
|
|
1266
|
+
text: string;
|
|
1267
|
+
onLoad?: (texture: Texture) => void;
|
|
1268
|
+
onError?: (error: unknown) => void;
|
|
1269
|
+
};
|
|
1270
|
+
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;
|
|
1271
|
+
|
|
1272
|
+
/** Shared serializable fields for every saved hotspot definition. */
|
|
1273
|
+
type HotspotDefinitionBase = {
|
|
1274
|
+
id: string;
|
|
1275
|
+
/** Human-readable label; use it as the source for the rendered ariaLabel. */
|
|
1276
|
+
label?: string;
|
|
1277
|
+
visible?: boolean;
|
|
1278
|
+
interactive?: boolean;
|
|
1279
|
+
/** Pointer hit-testing. `"none"` ignores mouse, touch, and pen. */
|
|
1280
|
+
pointerEvents?: HotspotPointerEvents;
|
|
1281
|
+
/** Canvas cursor while this hotspot is hovered. */
|
|
1282
|
+
cursor?: CSSProperties["cursor"];
|
|
1283
|
+
renderOrder?: number;
|
|
1284
|
+
tooltip?: string | HotspotTooltipContent;
|
|
1285
|
+
tooltipTrigger?: HotspotTooltipTrigger;
|
|
1286
|
+
tooltipPlacement?: HotspotTooltipPlacement;
|
|
1287
|
+
tooltipOffset?: number;
|
|
1288
|
+
tooltipAppearance?: HotspotTooltipAppearance;
|
|
1289
|
+
};
|
|
1290
|
+
/** Shared serializable fields for a hotspot anchored at one yaw/pitch point. */
|
|
1291
|
+
type PointHotspotDefinitionBase = HotspotDefinitionBase & {
|
|
1292
|
+
position: HotspotPosition;
|
|
1293
|
+
width?: number;
|
|
1294
|
+
height?: number;
|
|
1295
|
+
scale?: number;
|
|
1296
|
+
mode?: HotspotMode;
|
|
1297
|
+
distance?: number;
|
|
1298
|
+
scaleMode?: HotspotScaleMode;
|
|
1299
|
+
referenceFov?: number;
|
|
1300
|
+
rotation?: number;
|
|
1301
|
+
opacity?: number;
|
|
1302
|
+
};
|
|
1303
|
+
type ImageHotspotDefinition = PointHotspotDefinitionBase & {
|
|
1304
|
+
type: "image";
|
|
1305
|
+
src: string;
|
|
1306
|
+
};
|
|
1307
|
+
type GraphicHotspotDefinition = PointHotspotDefinitionBase & {
|
|
1308
|
+
type: "graphic";
|
|
1309
|
+
graphic: GraphicDefinition;
|
|
1310
|
+
};
|
|
1311
|
+
type SequenceHotspotDefinition = PointHotspotDefinitionBase & {
|
|
1312
|
+
type: "sequence";
|
|
1313
|
+
src: string;
|
|
1314
|
+
frameCount: number;
|
|
1315
|
+
frameDirection?: "horizontal" | "vertical";
|
|
1316
|
+
playing?: boolean;
|
|
1317
|
+
fps?: number;
|
|
1318
|
+
loop?: boolean;
|
|
1319
|
+
};
|
|
1320
|
+
type VideoHotspotDefinition = PointHotspotDefinitionBase & {
|
|
1321
|
+
type: "video";
|
|
1322
|
+
src: string;
|
|
1323
|
+
poster?: string;
|
|
1324
|
+
playing?: boolean;
|
|
1325
|
+
loop?: boolean;
|
|
1326
|
+
muted?: boolean;
|
|
1327
|
+
volume?: number;
|
|
1328
|
+
playsInline?: boolean;
|
|
1329
|
+
preload?: "none" | "metadata" | "auto";
|
|
1330
|
+
crossOrigin?: "" | "anonymous" | "use-credentials";
|
|
1331
|
+
};
|
|
1332
|
+
type AudioHotspotDefinition = PointHotspotDefinitionBase & {
|
|
1333
|
+
type: "audio";
|
|
1334
|
+
src: string | string[];
|
|
1335
|
+
format?: string | string[];
|
|
1336
|
+
playing?: boolean;
|
|
1337
|
+
loop?: boolean;
|
|
1338
|
+
muted?: boolean;
|
|
1339
|
+
volume?: number;
|
|
1340
|
+
pauseWhenHidden?: boolean;
|
|
1341
|
+
range?: number;
|
|
1342
|
+
icon?: string;
|
|
1343
|
+
playingIcon?: string;
|
|
1344
|
+
marker?: boolean;
|
|
1345
|
+
crossOrigin?: "" | "anonymous" | "use-credentials";
|
|
1346
|
+
};
|
|
1347
|
+
type TextHotspotDefinition = PointHotspotDefinitionBase & TextHotspotStyle & {
|
|
1348
|
+
type: "text";
|
|
1349
|
+
text: string;
|
|
1350
|
+
};
|
|
1351
|
+
type IframeHotspotDefinition = PointHotspotDefinitionBase & {
|
|
1352
|
+
type: "iframe";
|
|
1353
|
+
src: string;
|
|
1354
|
+
title?: string;
|
|
1355
|
+
sandbox?: string;
|
|
1356
|
+
allow?: string;
|
|
1357
|
+
referrerPolicy?: string;
|
|
1358
|
+
loading?: "eager" | "lazy";
|
|
1359
|
+
pointerPolicy?: IframePointerPolicy;
|
|
1360
|
+
background?: string;
|
|
1361
|
+
};
|
|
1362
|
+
type PolygonHotspotDefinition = HotspotDefinitionBase & {
|
|
1363
|
+
type: "polygon";
|
|
1364
|
+
vertices: HotspotPosition[];
|
|
1365
|
+
fill?: string;
|
|
1366
|
+
fillOpacity?: number;
|
|
1367
|
+
stroke?: string;
|
|
1368
|
+
strokeWidth?: number;
|
|
1369
|
+
strokeOpacity?: number;
|
|
1370
|
+
strokeDashSize?: number;
|
|
1371
|
+
strokeGapSize?: number;
|
|
1372
|
+
};
|
|
1373
|
+
/** An open path. This extends the original point and polygon hotspot categories. */
|
|
1374
|
+
type PolylineHotspotDefinition = HotspotDefinitionBase & {
|
|
1375
|
+
type: "polyline";
|
|
1376
|
+
vertices: HotspotPosition[];
|
|
1377
|
+
stroke?: string;
|
|
1378
|
+
strokeWidth?: number;
|
|
1379
|
+
strokeOpacity?: number;
|
|
1380
|
+
strokeDashSize?: number;
|
|
1381
|
+
strokeGapSize?: number;
|
|
1382
|
+
};
|
|
1383
|
+
type PointHotspotDefinition = ImageHotspotDefinition | GraphicHotspotDefinition | SequenceHotspotDefinition | VideoHotspotDefinition | AudioHotspotDefinition | TextHotspotDefinition | IframeHotspotDefinition;
|
|
1384
|
+
/** A serializable, discriminated hotspot collection item. */
|
|
1385
|
+
type HotspotDefinition = PointHotspotDefinition | PolygonHotspotDefinition | PolylineHotspotDefinition;
|
|
1386
|
+
|
|
1387
|
+
type JsonValue = null | boolean | number | string | JsonValue[] | JsonObject;
|
|
1388
|
+
type JsonObject = {
|
|
1389
|
+
[key: string]: JsonValue;
|
|
1390
|
+
};
|
|
1391
|
+
declare const projectHotspotTriggers: readonly ["click", "pointerenter", "pointerleave"];
|
|
1392
|
+
type ProjectHotspotTrigger = typeof projectHotspotTriggers[number];
|
|
1393
|
+
type ProjectCustomHotspotAction = {
|
|
1394
|
+
type: "custom";
|
|
1395
|
+
actionId: string;
|
|
1396
|
+
params?: JsonObject;
|
|
1397
|
+
};
|
|
1398
|
+
declare function hotspotAction(hotspot: ProjectHotspotDefinition, trigger: ProjectHotspotTrigger): ProjectHotspotAction | undefined;
|
|
1399
|
+
declare function setHotspotAction(hotspot: ProjectHotspotDefinition, trigger: ProjectHotspotTrigger, action?: ProjectHotspotAction): ProjectHotspotDefinition;
|
|
1400
|
+
type ProjectHotspotAction = ProjectCustomHotspotAction | {
|
|
1401
|
+
type: "scene";
|
|
1402
|
+
sceneId: string;
|
|
1403
|
+
} | {
|
|
1404
|
+
type: "view";
|
|
1405
|
+
view: PanoViewerState;
|
|
1406
|
+
duration?: number;
|
|
1407
|
+
} | {
|
|
1408
|
+
type: "popup";
|
|
1409
|
+
popupId: string;
|
|
1410
|
+
};
|
|
1411
|
+
type ProjectHotspotDefinition = HotspotDefinition & {
|
|
1412
|
+
/** Legacy click fallback. events.click takes precedence. */
|
|
1413
|
+
action?: ProjectHotspotAction;
|
|
1414
|
+
events?: Partial<Record<ProjectHotspotTrigger, ProjectHotspotAction>>;
|
|
1415
|
+
};
|
|
1416
|
+
declare function resolveHotspotAssets(hotspot: ProjectHotspotDefinition, baseUrl: string, sceneId: string, resolver?: AssetUrlResolver): ProjectHotspotDefinition;
|
|
1417
|
+
|
|
1418
|
+
type PanoProjectSceneDefinition = {
|
|
1419
|
+
id: string;
|
|
1420
|
+
title?: string;
|
|
1421
|
+
source: ({
|
|
1422
|
+
viewerUrl: string;
|
|
1423
|
+
viewerConfig?: never;
|
|
1424
|
+
} | {
|
|
1425
|
+
viewerConfig: ViewerConfig;
|
|
1426
|
+
viewerUrl?: never;
|
|
1427
|
+
}) & {
|
|
1428
|
+
baseUrl?: string;
|
|
1429
|
+
};
|
|
1430
|
+
initialView?: Partial<PanoViewerState>;
|
|
1431
|
+
viewLimits?: PanoViewLimits;
|
|
1432
|
+
hotspots?: ProjectHotspotDefinition[];
|
|
1433
|
+
};
|
|
1434
|
+
type PanoProjectDefinition = {
|
|
1435
|
+
schemaVersion: 1;
|
|
1436
|
+
title?: string;
|
|
1437
|
+
initialSceneId?: string;
|
|
1438
|
+
scenes: PanoProjectSceneDefinition[];
|
|
1439
|
+
popups?: ProjectPopupDefinition[];
|
|
1440
|
+
};
|
|
1441
|
+
type LoadedProjectScene = {
|
|
1442
|
+
scene: TileScene | SphereTileScene;
|
|
1443
|
+
title?: string;
|
|
1444
|
+
initialView?: PanoViewerState;
|
|
1445
|
+
hotspots: ProjectHotspotDefinition[];
|
|
1446
|
+
};
|
|
1447
|
+
type LoadedPanoProject = {
|
|
1448
|
+
title?: string;
|
|
1449
|
+
initialSceneId: string;
|
|
1450
|
+
scenes: LoadedProjectScene[];
|
|
1451
|
+
popups?: ProjectPopupDefinition[];
|
|
1452
|
+
};
|
|
1453
|
+
type LoadPanoProjectOptions = JsonRequestOptions & {
|
|
1454
|
+
/** Directory used for project-relative references. Required for object input. */
|
|
1455
|
+
baseUrl?: string;
|
|
1456
|
+
resolveAssetUrl?: AssetUrlResolver;
|
|
1457
|
+
resolvePopupAssetUrl?: PopupAssetUrlResolver;
|
|
1458
|
+
};
|
|
1459
|
+
/** Drafts permit empty scenes and unfinished popup titles/media; loading and export always validate strictly. */
|
|
1460
|
+
declare function parsePanoProject(value: unknown, options?: {
|
|
1461
|
+
draft?: boolean;
|
|
1462
|
+
}): PanoProjectDefinition;
|
|
1463
|
+
declare function loadPanoProject(source: string | PanoProjectDefinition, options?: LoadPanoProjectOptions): Promise<LoadedPanoProject>;
|
|
1464
|
+
|
|
1465
|
+
type ProjectHotspotClickEvent = {
|
|
1466
|
+
sceneId: string;
|
|
1467
|
+
hotspot: ProjectHotspotDefinition;
|
|
1468
|
+
interaction: HotspotInteractionEvent;
|
|
1469
|
+
defaultPrevented: boolean;
|
|
1470
|
+
preventDefault: () => void;
|
|
1471
|
+
};
|
|
1472
|
+
type ProjectHotspotEvent = ProjectHotspotClickEvent & {
|
|
1473
|
+
trigger: ProjectHotspotTrigger;
|
|
1474
|
+
};
|
|
1475
|
+
type ProjectCustomActionEvent = ProjectHotspotEvent & {
|
|
1476
|
+
action: ProjectCustomHotspotAction;
|
|
1477
|
+
};
|
|
1478
|
+
type ProjectPopupRequestEvent = {
|
|
1479
|
+
sceneId: string;
|
|
1480
|
+
hotspot: ProjectHotspotDefinition;
|
|
1481
|
+
popup: ProjectPopupDefinition;
|
|
1482
|
+
};
|
|
1483
|
+
type ProjectHotspotErrorEvent = {
|
|
1484
|
+
sceneId: string;
|
|
1485
|
+
hotspot: ProjectHotspotDefinition;
|
|
1486
|
+
error: unknown;
|
|
1487
|
+
trigger?: ProjectHotspotTrigger;
|
|
1488
|
+
};
|
|
1489
|
+
type ProjectHotspotRenderContext = {
|
|
1490
|
+
sceneId: string;
|
|
1491
|
+
playing: boolean;
|
|
1492
|
+
onClick: (event: HotspotInteractionEvent) => void;
|
|
1493
|
+
onHoverChange: (hovered: boolean, event: HotspotInteractionEvent) => void;
|
|
1494
|
+
togglePlayback: () => void;
|
|
1495
|
+
reportError: (error: unknown) => void;
|
|
1496
|
+
renderDefault: () => ReactNode;
|
|
1497
|
+
};
|
|
1498
|
+
type ProjectScenesProps = Omit<ScenesProps, "scenes" | "defaultActiveSceneId" | "renderHotspots"> & {
|
|
1499
|
+
project: LoadedPanoProject;
|
|
1500
|
+
onHotspotEvent?: (event: ProjectHotspotEvent) => void;
|
|
1501
|
+
onCustomAction?: (event: ProjectCustomActionEvent) => void | Promise<void>;
|
|
1502
|
+
onHotspotClick?: (event: ProjectHotspotClickEvent) => void;
|
|
1503
|
+
onPopupRequest?: (event: ProjectPopupRequestEvent) => void;
|
|
1504
|
+
onHotspotError?: (event: ProjectHotspotErrorEvent) => void;
|
|
1505
|
+
/** Return undefined for the default renderer, or null to hide this hotspot. */
|
|
1506
|
+
renderHotspot?: (hotspot: ProjectHotspotDefinition, context: ProjectHotspotRenderContext) => ReactNode;
|
|
1507
|
+
};
|
|
1508
|
+
declare function ProjectScenes({ project, activeSceneId, onActiveSceneIdChange, onSceneReady, onHotspotClick, onHotspotEvent, onHotspotError, onPopupRequest, onCustomAction, renderHotspot, ...options }: ProjectScenesProps): react.JSX.Element;
|
|
1509
|
+
|
|
1510
|
+
/** Options for automatic horizontal panorama rotation. */
|
|
1511
|
+
type AutoRotateProps = {
|
|
1512
|
+
/** Whether automatic rotation is active. Defaults to true. */
|
|
1513
|
+
enabled?: boolean;
|
|
1514
|
+
/** Rotation speed in degrees per second. Negative values rotate left. */
|
|
1515
|
+
speed?: number;
|
|
1516
|
+
/**
|
|
1517
|
+
* Rate at which rotation reaches its target speed, in degrees per second
|
|
1518
|
+
* squared. Use 0 to disable the speed ramp. Defaults to 18.
|
|
1519
|
+
*/
|
|
1520
|
+
acceleration?: number;
|
|
1521
|
+
/** Milliseconds to wait after enabling before rotation begins. */
|
|
1522
|
+
startDelay?: number;
|
|
1523
|
+
};
|
|
1524
|
+
/**
|
|
1525
|
+
* Adds automatic rotation to the nearest PanoViewer. Render one instance as a
|
|
1526
|
+
* child of PanoViewer, alongside its panorama source.
|
|
1527
|
+
*/
|
|
1528
|
+
declare function AutoRotate({ enabled, speed, acceleration, startDelay, }: AutoRotateProps): null;
|
|
1529
|
+
|
|
1530
|
+
type AudioPlaybackState = "playing" | "paused" | "ended" | "blocked";
|
|
1531
|
+
type AudioHotspotErrorEvent = {
|
|
1532
|
+
id: string;
|
|
1533
|
+
error: unknown;
|
|
1534
|
+
};
|
|
1535
|
+
type AudioHotspotProps = HotspotCommonProps & {
|
|
1536
|
+
src: string | string[];
|
|
1537
|
+
/** Container hints for extensionless sources such as blob URLs, in source order. */
|
|
1538
|
+
format?: string | string[];
|
|
1539
|
+
playing: boolean;
|
|
1540
|
+
loop?: boolean;
|
|
1541
|
+
muted?: boolean;
|
|
1542
|
+
volume?: number;
|
|
1543
|
+
/** Degrees of look-away before the source is silent. Defaults to 360 (no look attenuation). */
|
|
1544
|
+
range?: number;
|
|
1545
|
+
pauseWhenHidden?: boolean;
|
|
1546
|
+
/** Optional stopped-state image. When omitted, a built-in speaker icon is used. */
|
|
1547
|
+
icon?: string;
|
|
1548
|
+
/** Optional playing-state image. Falls back to `icon`, then the built-in playing icon. */
|
|
1549
|
+
playingIcon?: string;
|
|
1550
|
+
/** When false, no visual marker is rendered. Audio still plays. Defaults to true. */
|
|
1551
|
+
marker?: boolean;
|
|
1552
|
+
crossOrigin?: "" | "anonymous" | "use-credentials";
|
|
1553
|
+
onPlaybackStateChange?: (state: AudioPlaybackState) => void;
|
|
1554
|
+
onPlaybackError?: (error: unknown) => void;
|
|
1555
|
+
onEnded?: () => void;
|
|
1556
|
+
onError?: (event: AudioHotspotErrorEvent) => void;
|
|
1557
|
+
};
|
|
1558
|
+
declare function AudioHotspot({ id, src, format, playing, loop, muted, volume, range, pauseWhenHidden, icon, playingIcon, marker, crossOrigin, width, height, opacity, onPlaybackStateChange, onPlaybackError, onEnded, onError, ...anchorProps }: AudioHotspotProps): react.JSX.Element;
|
|
1559
|
+
|
|
1560
|
+
type BackgroundAudioSource = string | readonly string[];
|
|
1561
|
+
type BackgroundAudioErrorEvent = {
|
|
1562
|
+
error: unknown;
|
|
1563
|
+
};
|
|
1564
|
+
type BackgroundAudioProps = {
|
|
1565
|
+
/** Shared tour track when `sources` is omitted, or fallback when a scene has no entry. */
|
|
1566
|
+
src?: BackgroundAudioSource;
|
|
1567
|
+
/** Per-scene tracks keyed by `Scene.id`. Requires `sceneId`. */
|
|
1568
|
+
sources?: Readonly<Record<string, BackgroundAudioSource>>;
|
|
1569
|
+
/** Current scene id. Required when `sources` is set. */
|
|
1570
|
+
sceneId?: string;
|
|
1571
|
+
/**
|
|
1572
|
+
* Controlled playing state. When provided, the parent owns play/pause.
|
|
1573
|
+
* When omitted, the component manages its own state and imperative
|
|
1574
|
+
* `playBackgroundAudio` / `pauseBackgroundAudio` work directly.
|
|
1575
|
+
*/
|
|
1576
|
+
playing?: boolean;
|
|
1577
|
+
/** Initial playing state when `playing` is omitted. Defaults to false. */
|
|
1578
|
+
defaultPlaying?: boolean;
|
|
1579
|
+
/** Defaults to true. */
|
|
1580
|
+
loop?: boolean;
|
|
1581
|
+
muted?: boolean;
|
|
1582
|
+
volume?: number;
|
|
1583
|
+
pauseWhenHidden?: boolean;
|
|
1584
|
+
/** Crossfade duration when the resolved track changes. Defaults to 400; 0 is a hard cut. */
|
|
1585
|
+
fadeMs?: number;
|
|
1586
|
+
crossOrigin?: "" | "anonymous" | "use-credentials";
|
|
1587
|
+
onPlaybackStateChange?: (state: AudioPlaybackState) => void;
|
|
1588
|
+
onPlaybackError?: (error: unknown) => void;
|
|
1589
|
+
onEnded?: () => void;
|
|
1590
|
+
onError?: (event: BackgroundAudioErrorEvent) => void;
|
|
1591
|
+
};
|
|
1592
|
+
/**
|
|
1593
|
+
* Adds a non-spatial soundtrack to the nearest PanoViewer. Render one instance
|
|
1594
|
+
* as a child of PanoViewer, alongside Scenes or a panorama source — not inside
|
|
1595
|
+
* renderHotspots.
|
|
1596
|
+
*/
|
|
1597
|
+
declare function BackgroundAudio({ src, sources, sceneId, playing: controlledPlaying, defaultPlaying, loop, muted, volume, pauseWhenHidden, fadeMs, crossOrigin, onPlaybackStateChange, onPlaybackError, onEnded, onError, }: BackgroundAudioProps): null;
|
|
1598
|
+
|
|
1599
|
+
declare const PANO_FILTER_PRESETS: readonly ["none", "grayscale", "sepia", "vintage", "cool", "warm", "pencil", "coloredPencil", "crayon", "watercolor", "cartoon", "crosshatch"];
|
|
1600
|
+
type PanoFilterPreset = (typeof PANO_FILTER_PRESETS)[number];
|
|
1601
|
+
/** Row-major 4×5 RGBA matrix, applied in display (sRGB) space like an SVG color matrix. */
|
|
1602
|
+
type PanoColorMatrix = readonly [
|
|
1603
|
+
number,
|
|
1604
|
+
number,
|
|
1605
|
+
number,
|
|
1606
|
+
number,
|
|
1607
|
+
number,
|
|
1608
|
+
number,
|
|
1609
|
+
number,
|
|
1610
|
+
number,
|
|
1611
|
+
number,
|
|
1612
|
+
number,
|
|
1613
|
+
number,
|
|
1614
|
+
number,
|
|
1615
|
+
number,
|
|
1616
|
+
number,
|
|
1617
|
+
number,
|
|
1618
|
+
number,
|
|
1619
|
+
number,
|
|
1620
|
+
number,
|
|
1621
|
+
number,
|
|
1622
|
+
number
|
|
1623
|
+
];
|
|
1624
|
+
|
|
1625
|
+
type PanoFilterProps = {
|
|
1626
|
+
/** Built-in look. Defaults to `none` (identity). */
|
|
1627
|
+
preset?: PanoFilterPreset;
|
|
1628
|
+
/** Mix with the original panorama, 0–1. Defaults to 1. */
|
|
1629
|
+
intensity?: number;
|
|
1630
|
+
/** Display-space RGBA matrix applied after the artistic preset. */
|
|
1631
|
+
colorMatrix?: PanoColorMatrix | null;
|
|
1632
|
+
/** `all` also filters hotspot textures. HTML tooltips/chrome remain host-styled. */
|
|
1633
|
+
colorMatrixScope?: "panorama" | "all";
|
|
1634
|
+
/** When false, the panorama renders without a filter. Defaults to true. */
|
|
1635
|
+
enabled?: boolean;
|
|
1636
|
+
};
|
|
1637
|
+
/**
|
|
1638
|
+
* Applies a color or artistic filter to the panorama source of the nearest
|
|
1639
|
+
* PanoViewer. Render one instance as a child of PanoViewer. colorMatrixScope
|
|
1640
|
+
* can include hotspot textures; HTML chrome remains host-styled.
|
|
1641
|
+
*/
|
|
1642
|
+
declare function PanoFilter({ preset, intensity, enabled, colorMatrix, colorMatrixScope, }: PanoFilterProps): null;
|
|
1643
|
+
|
|
1644
|
+
type GyroTouchMode = "off" | "horizontaloffset" | "full" | "disablegyro";
|
|
1645
|
+
|
|
1646
|
+
type GyroHandle = {
|
|
1647
|
+
resetSensor: (yaw?: number, pitch?: number) => void;
|
|
1648
|
+
isAvailable: () => boolean;
|
|
1649
|
+
isEnabled: () => boolean;
|
|
1650
|
+
/**
|
|
1651
|
+
* Requests iOS sensor permission. Call this directly from a user gesture
|
|
1652
|
+
* before setting `enabled` to true.
|
|
1653
|
+
*/
|
|
1654
|
+
requestPermission: () => Promise<boolean>;
|
|
1655
|
+
};
|
|
1656
|
+
type GyroProps = {
|
|
1657
|
+
/** Whether device-orientation control is requested. Defaults to false. */
|
|
1658
|
+
enabled?: boolean;
|
|
1659
|
+
/** Whether device roll levels the camera. Defaults to true. */
|
|
1660
|
+
camroll?: boolean;
|
|
1661
|
+
/** Whether to follow compass-oriented headings. Defaults to false. */
|
|
1662
|
+
absolute?: boolean;
|
|
1663
|
+
/** Panorama yaw that represents North, in degrees. Defaults to 0. */
|
|
1664
|
+
north?: number;
|
|
1665
|
+
/** Sensor smoothing from 0 (none) to 0.99 (strong). Defaults to 0. */
|
|
1666
|
+
friction?: number;
|
|
1667
|
+
/** How touch dragging combines with gyro movement. Defaults to "full". */
|
|
1668
|
+
touchMode?: GyroTouchMode;
|
|
1669
|
+
/** Seconds used to blend from the current view when enabling. Defaults to 0.5. */
|
|
1670
|
+
softstart?: number;
|
|
1671
|
+
/** Allow capability detection on desktop-class devices. Defaults to false. */
|
|
1672
|
+
desktopSupport?: boolean;
|
|
1673
|
+
onAvailable?: () => void;
|
|
1674
|
+
onUnavailable?: () => void;
|
|
1675
|
+
onEnable?: () => void;
|
|
1676
|
+
onDisable?: () => void;
|
|
1677
|
+
onDenied?: () => void;
|
|
1678
|
+
};
|
|
1679
|
+
/**
|
|
1680
|
+
* Adds device-orientation navigation to the nearest PanoViewer.
|
|
1681
|
+
* Sensor access is opt-in and disabled by default.
|
|
1682
|
+
*/
|
|
1683
|
+
declare const Gyro: react.ForwardRefExoticComponent<GyroProps & react.RefAttributes<GyroHandle>>;
|
|
1684
|
+
|
|
1685
|
+
declare const WebVR: react.ForwardRefExoticComponent<WebVRProps & react.RefAttributes<WebVRHandle>>;
|
|
1686
|
+
|
|
1687
|
+
declare const DEFAULT_WEBVR_CHROME_APPEARANCE: Required<Omit<WebVRChromeAppearance, "setupTitle">>;
|
|
1688
|
+
|
|
1689
|
+
declare const WEBVR_PROFILE_IDS: readonly ["none", "cardboard-v1", "cardboard-v2", "gear-vr", "daydream"];
|
|
1690
|
+
declare const WEBVR_PROFILES: Record<WebVRProfileId, WebVRProfile>;
|
|
987
1691
|
|
|
988
1692
|
declare const DEFAULT_WEBVR_CURSOR_DWELL_MS = 1500;
|
|
989
1693
|
|
|
@@ -1119,140 +1823,6 @@ type TouchControlsProps = TouchControlsOptions;
|
|
|
1119
1823
|
*/
|
|
1120
1824
|
declare function TouchControls({ enabled, rotateSpeed, invert, pinchZoom, }: TouchControlsProps): null;
|
|
1121
1825
|
|
|
1122
|
-
type CubeFaceCode = "f" | "r" | "b" | "l" | "u" | "d";
|
|
1123
|
-
type TileAddress = {
|
|
1124
|
-
face: CubeFaceCode;
|
|
1125
|
-
level: number;
|
|
1126
|
-
row: number;
|
|
1127
|
-
col: number;
|
|
1128
|
-
faceSize: number;
|
|
1129
|
-
tileSize: number;
|
|
1130
|
-
width: number;
|
|
1131
|
-
height: number;
|
|
1132
|
-
};
|
|
1133
|
-
type TileMultiresConfig = {
|
|
1134
|
-
tileSize: number;
|
|
1135
|
-
/** Ascending face sizes. The first value maps to l1. */
|
|
1136
|
-
levels: number[];
|
|
1137
|
-
};
|
|
1138
|
-
type TileLoadProgress = {
|
|
1139
|
-
requested: number;
|
|
1140
|
-
loaded: number;
|
|
1141
|
-
failed: number;
|
|
1142
|
-
active: number;
|
|
1143
|
-
queued: number;
|
|
1144
|
-
};
|
|
1145
|
-
type TileLoadError = {
|
|
1146
|
-
address: TileAddress;
|
|
1147
|
-
url: string;
|
|
1148
|
-
error: unknown;
|
|
1149
|
-
};
|
|
1150
|
-
type TileProps = {
|
|
1151
|
-
baseUrl: string;
|
|
1152
|
-
/**
|
|
1153
|
-
* Tile size followed by ascending cube-face sizes (`TILESIZE,LEVELSIZE1,...`).
|
|
1154
|
-
* For krpano output, copy `image.cube.multires` from the XML.
|
|
1155
|
-
*/
|
|
1156
|
-
multires: string | TileMultiresConfig;
|
|
1157
|
-
/**
|
|
1158
|
-
* Preview atlas path. Relative paths resolve against `baseUrl`; root-absolute
|
|
1159
|
-
* and `http(s)` / `blob:` / `data:` URLs are used as-is. For krpano output,
|
|
1160
|
-
* copy `<preview url>` (often `preview.jpg` at the scene root). This package's
|
|
1161
|
-
* common cube atlas path is `previews/cube-vertical.webp`.
|
|
1162
|
-
*/
|
|
1163
|
-
previewUrl: string;
|
|
1164
|
-
/**
|
|
1165
|
-
* Face order in the vertical preview atlas, from top to bottom. Defaults to
|
|
1166
|
-
* `l/f/r/b/u/d`, matching krpano `preview.striporder` `LFRBUD`.
|
|
1167
|
-
*/
|
|
1168
|
-
previewFaceOrder?: readonly CubeFaceCode[];
|
|
1169
|
-
/**
|
|
1170
|
-
* Path relative to `baseUrl`. Defaults to
|
|
1171
|
-
* `tiles/%s/l%l/%v/l%l_%s_%h_%v.webp`. For krpano output, copy `<cube url>`
|
|
1172
|
-
* from the XML; krpano templates often use `%v_%h` instead of this default
|
|
1173
|
-
* `%h_%v`, so omitting `urlTemplate` requests the wrong files. Supports
|
|
1174
|
-
* krpano cube-tile `%s` and `%l` placeholders, horizontal `%h`/`%x`/`%u`/`%c`,
|
|
1175
|
-
* vertical `%v`/`%y`/`%w`/`%r`, and index padding such as `%0h` or `%00v`.
|
|
1176
|
-
*/
|
|
1177
|
-
urlTemplate?: string;
|
|
1178
|
-
/** Returns a path relative to `baseUrl`; takes precedence over `urlTemplate`. */
|
|
1179
|
-
resolveTileUrl?: (address: TileAddress) => string;
|
|
1180
|
-
maxTextureMemoryMb?: number;
|
|
1181
|
-
maxConcurrentLoads?: number;
|
|
1182
|
-
retryCount?: number;
|
|
1183
|
-
/**
|
|
1184
|
-
* `preview` loads only the preview atlas; `base` also preloads the visible
|
|
1185
|
-
* lowest-resolution tiles before full-resolution loading begins.
|
|
1186
|
-
*/
|
|
1187
|
-
loadMode?: "full" | "preview" | "base";
|
|
1188
|
-
/** Keeps the source mounted for preloading without drawing it. */
|
|
1189
|
-
visible?: boolean;
|
|
1190
|
-
/** Called when the preview atlas is ready for display. */
|
|
1191
|
-
onReady?: () => void;
|
|
1192
|
-
/** Called when the preview atlas cannot be loaded. */
|
|
1193
|
-
onPreviewError?: (error: unknown) => void;
|
|
1194
|
-
onLoadProgress?: (progress: TileLoadProgress) => void;
|
|
1195
|
-
onTileError?: (event: TileLoadError) => void;
|
|
1196
|
-
onLevelChange?: (level: number) => void;
|
|
1197
|
-
};
|
|
1198
|
-
|
|
1199
|
-
type SphereTileLevel = {
|
|
1200
|
-
width: number;
|
|
1201
|
-
height: number;
|
|
1202
|
-
};
|
|
1203
|
-
type SphereTileMultiresConfig = {
|
|
1204
|
-
tileSize: number;
|
|
1205
|
-
/** Ascending image dimensions. The first item maps to level 0. */
|
|
1206
|
-
levels: SphereTileLevel[];
|
|
1207
|
-
};
|
|
1208
|
-
type SphereTileAddress = {
|
|
1209
|
-
/** Zero-based logical level, column and row; URL indices add indexBase. */
|
|
1210
|
-
level: number;
|
|
1211
|
-
col: number;
|
|
1212
|
-
row: number;
|
|
1213
|
-
imageWidth: number;
|
|
1214
|
-
imageHeight: number;
|
|
1215
|
-
tileSize: number;
|
|
1216
|
-
/** Actual tile dimensions, including partial edge tiles. */
|
|
1217
|
-
width: number;
|
|
1218
|
-
height: number;
|
|
1219
|
-
};
|
|
1220
|
-
type SphereTileLoadError = {
|
|
1221
|
-
address: SphereTileAddress;
|
|
1222
|
-
url: string;
|
|
1223
|
-
error: unknown;
|
|
1224
|
-
};
|
|
1225
|
-
type SphereTileProps = {
|
|
1226
|
-
baseUrl: string;
|
|
1227
|
-
/** `512,500x250,1000x500,2000x1000` or explicit ascending dimensions. */
|
|
1228
|
-
multires: string | SphereTileMultiresConfig;
|
|
1229
|
-
/** A 2:1 equirectangular preview, resolved relative to baseUrl. */
|
|
1230
|
-
previewUrl: string;
|
|
1231
|
-
/** Defaults to `tiles/%l/%h_%v.webp`. No tile overlap. */
|
|
1232
|
-
urlTemplate?: string;
|
|
1233
|
-
/** URL indices start at 1 for krpano (default), or 0 for raw Sharp Deep Zoom. */
|
|
1234
|
-
indexBase?: 0 | 1;
|
|
1235
|
-
/** Takes precedence over urlTemplate and indexBase. Receives zero-based addresses. */
|
|
1236
|
-
resolveTileUrl?: (address: SphereTileAddress) => string;
|
|
1237
|
-
/** Horizontal source rotation in degrees. Defaults to 0. */
|
|
1238
|
-
yawOffset?: number;
|
|
1239
|
-
/** Tile cache budget in MiB. Defaults to 128. Preview memory is separate. */
|
|
1240
|
-
maxTextureMemoryMb?: number;
|
|
1241
|
-
/** Defaults to 4. */
|
|
1242
|
-
maxConcurrentLoads?: number;
|
|
1243
|
-
/** Retries after the initial attempt. Defaults to 1. */
|
|
1244
|
-
retryCount?: number;
|
|
1245
|
-
loadMode?: "full" | "preview" | "base";
|
|
1246
|
-
visible?: boolean;
|
|
1247
|
-
/** First paintable preview or tile is ready, even if the preview failed. */
|
|
1248
|
-
onReady?: () => void;
|
|
1249
|
-
onPreviewError?: (error: unknown) => void;
|
|
1250
|
-
onLoadProgress?: (progress: TileLoadProgress) => void;
|
|
1251
|
-
onTileError?: (event: SphereTileLoadError) => void;
|
|
1252
|
-
/** Zero-based selected level. */
|
|
1253
|
-
onLevelChange?: (level: number) => void;
|
|
1254
|
-
};
|
|
1255
|
-
|
|
1256
1826
|
declare function SphereTile({ multires, ...props }: SphereTileProps): react.JSX.Element;
|
|
1257
1827
|
|
|
1258
1828
|
type SphereProps = {
|
|
@@ -1306,114 +1876,38 @@ type PanoVideoProps = {
|
|
|
1306
1876
|
* Keep playback in the page. Defaults to true, including the WebKit and
|
|
1307
1877
|
* X5 attributes for iPhone Safari, WeChat, QQ, and UC.
|
|
1308
1878
|
*/
|
|
1309
|
-
playsInline?: boolean;
|
|
1310
|
-
preload?: "none" | "metadata" | "auto";
|
|
1311
|
-
crossOrigin?: "" | "anonymous" | "use-credentials";
|
|
1312
|
-
playbackRates?: readonly number[];
|
|
1313
|
-
/** Keeps the source mounted for preloading without drawing it. */
|
|
1314
|
-
visible?: boolean;
|
|
1315
|
-
onLoad?: () => void;
|
|
1316
|
-
onError?: (event: PanoVideoErrorEvent) => void;
|
|
1317
|
-
onPlaybackStateChange?: (state: VideoPlaybackState) => void;
|
|
1318
|
-
onEnded?: () => void;
|
|
1319
|
-
onVariantChange?: (id: string) => void;
|
|
1320
|
-
onTrackChange?: (id: string | null) => void;
|
|
1321
|
-
};
|
|
1322
|
-
/**
|
|
1323
|
-
* Equirectangular 360 video mapped onto the panorama sphere. Mount inside
|
|
1324
|
-
* PanoViewer. Default playback chrome and captions portal to the viewer overlay.
|
|
1325
|
-
*/
|
|
1326
|
-
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;
|
|
1327
|
-
|
|
1328
|
-
declare const DEFAULT_PANO_VIDEO_CONTROLS_APPEARANCE: Required<PanoVideoControlsAppearance>;
|
|
1329
|
-
type PanoVideoControlsProps = {
|
|
1330
|
-
appearance?: PanoVideoControlsAppearance;
|
|
1331
|
-
};
|
|
1332
|
-
/**
|
|
1333
|
-
* Claims the default playback chrome slot for a custom replacement.
|
|
1334
|
-
* Render inside PanoViewer when overriding the built-in controls.
|
|
1335
|
-
*/
|
|
1336
|
-
declare function PanoVideoControls({ appearance }: PanoVideoControlsProps): null;
|
|
1337
|
-
|
|
1338
|
-
declare const DEFAULT_PANO_VIDEO_PLAYBACK_RATES: readonly [0.5, 1, 1.25, 1.5, 2];
|
|
1339
|
-
|
|
1340
|
-
declare const DEFAULT_PANO_VIDEO_CAPTION_APPEARANCE: Required<PanoVideoCaptionAppearance>;
|
|
1341
|
-
|
|
1342
|
-
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";
|
|
1343
|
-
type SceneTransition = SceneTransitionPreset | {
|
|
1344
|
-
preset: SceneTransitionPreset;
|
|
1345
|
-
/** Overrides the preset default duration in seconds. */
|
|
1346
|
-
duration?: number;
|
|
1347
|
-
};
|
|
1348
|
-
|
|
1349
|
-
type SphereScene = {
|
|
1350
|
-
id: string;
|
|
1351
|
-
type: "sphere";
|
|
1352
|
-
src: string;
|
|
1353
|
-
previewUrl: string;
|
|
1354
|
-
yawOffset?: number;
|
|
1355
|
-
};
|
|
1356
|
-
type TileScene = Omit<TileProps, "loadMode" | "visible" | "onReady" | "onPreviewError" | "onLoadProgress" | "onTileError" | "onLevelChange"> & {
|
|
1357
|
-
id: string;
|
|
1358
|
-
type: "tile";
|
|
1359
|
-
};
|
|
1360
|
-
type SphereTileScene = Omit<SphereTileProps, "loadMode" | "visible" | "onReady" | "onPreviewError" | "onLoadProgress" | "onTileError" | "onLevelChange"> & {
|
|
1361
|
-
id: string;
|
|
1362
|
-
type: "sphereTile";
|
|
1363
|
-
};
|
|
1364
|
-
type Scene = SphereScene | TileScene | SphereTileScene;
|
|
1365
|
-
type SceneTransitionEndEvent = {
|
|
1366
|
-
previousSceneId: string;
|
|
1367
|
-
sceneId: string;
|
|
1368
|
-
preset: SceneTransitionPreset;
|
|
1369
|
-
};
|
|
1370
|
-
type SceneTransitionErrorEvent = {
|
|
1371
|
-
sceneId: string;
|
|
1372
|
-
error: unknown;
|
|
1373
|
-
};
|
|
1374
|
-
type ScenesProps = {
|
|
1375
|
-
scenes: readonly Scene[];
|
|
1376
|
-
/**
|
|
1377
|
-
* Controlled scene id. When provided, the parent owns the active scene.
|
|
1378
|
-
* Imperative `setScene` / `nextScene` / `previousScene` will call
|
|
1379
|
-
* `onActiveSceneIdChange` so the parent can update its state.
|
|
1380
|
-
*/
|
|
1381
|
-
activeSceneId?: string;
|
|
1382
|
-
/**
|
|
1383
|
-
* Uncontrolled initial scene id. Used when `activeSceneId` is omitted.
|
|
1384
|
-
* Imperative calls update the internal state directly.
|
|
1385
|
-
*/
|
|
1386
|
-
defaultActiveSceneId?: string;
|
|
1387
|
-
/** Called when imperative scene methods request a scene change in controlled mode. */
|
|
1388
|
-
onActiveSceneIdChange?: (id: string) => void;
|
|
1389
|
-
transition?: SceneTransition;
|
|
1390
|
-
/** Rendered only after a scene has finished transitioning in. */
|
|
1391
|
-
renderHotspots?: (scene: Scene) => ReactNode;
|
|
1392
|
-
/** First paintable scene, or an incoming scene taking over after snapshot capture.
|
|
1393
|
-
* The transition may still be running, and full detail may still be loading.
|
|
1394
|
-
* Safe to apply the incoming camera view here.
|
|
1395
|
-
*/
|
|
1396
|
-
onSceneReady?: (sceneId: string) => void;
|
|
1397
|
-
/**
|
|
1398
|
-
* Extra milliseconds to hold the outgoing snapshot after it is captured and the
|
|
1399
|
-
* incoming scene has switched to full detail. `0` (default) starts the blend
|
|
1400
|
-
* immediately and keeps loading detail during it. A positive value starts the
|
|
1401
|
-
* blend early when the current view is already sharp, otherwise it waits at
|
|
1402
|
-
* most this long. The wait is separate from the blend duration. Negative and
|
|
1403
|
-
* non-finite values are treated as `0`. `transition="none"` cuts over directly
|
|
1404
|
-
* once the same condition is met.
|
|
1405
|
-
*/
|
|
1406
|
-
transitionWaitForDetailMs?: number;
|
|
1407
|
-
onTransitionEnd?: (event: SceneTransitionEndEvent) => void;
|
|
1408
|
-
onTransitionError?: (event: SceneTransitionErrorEvent) => void;
|
|
1409
|
-
/** Viewer-wide budget shared by every tile scene. Defaults to 128 MiB. */
|
|
1410
|
-
maxTextureMemoryMb?: number;
|
|
1411
|
-
/** Viewer-wide tile request limit. Defaults to 4. */
|
|
1412
|
-
maxConcurrentTileLoads?: number;
|
|
1413
|
-
/** Maximum physical-pixel area of the outgoing GPU snapshot. */
|
|
1414
|
-
snapshotMaxPixels?: number;
|
|
1879
|
+
playsInline?: boolean;
|
|
1880
|
+
preload?: "none" | "metadata" | "auto";
|
|
1881
|
+
crossOrigin?: "" | "anonymous" | "use-credentials";
|
|
1882
|
+
playbackRates?: readonly number[];
|
|
1883
|
+
/** Keeps the source mounted for preloading without drawing it. */
|
|
1884
|
+
visible?: boolean;
|
|
1885
|
+
onLoad?: () => void;
|
|
1886
|
+
onError?: (event: PanoVideoErrorEvent) => void;
|
|
1887
|
+
onPlaybackStateChange?: (state: VideoPlaybackState) => void;
|
|
1888
|
+
onEnded?: () => void;
|
|
1889
|
+
onVariantChange?: (id: string) => void;
|
|
1890
|
+
onTrackChange?: (id: string | null) => void;
|
|
1415
1891
|
};
|
|
1416
|
-
|
|
1892
|
+
/**
|
|
1893
|
+
* Equirectangular 360 video mapped onto the panorama sphere. Mount inside
|
|
1894
|
+
* PanoViewer. Default playback chrome and captions portal to the viewer overlay.
|
|
1895
|
+
*/
|
|
1896
|
+
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;
|
|
1897
|
+
|
|
1898
|
+
declare const DEFAULT_PANO_VIDEO_CONTROLS_APPEARANCE: Required<PanoVideoControlsAppearance>;
|
|
1899
|
+
type PanoVideoControlsProps = {
|
|
1900
|
+
appearance?: PanoVideoControlsAppearance;
|
|
1901
|
+
};
|
|
1902
|
+
/**
|
|
1903
|
+
* Claims the default playback chrome slot for a custom replacement.
|
|
1904
|
+
* Render inside PanoViewer when overriding the built-in controls.
|
|
1905
|
+
*/
|
|
1906
|
+
declare function PanoVideoControls({ appearance }: PanoVideoControlsProps): null;
|
|
1907
|
+
|
|
1908
|
+
declare const DEFAULT_PANO_VIDEO_PLAYBACK_RATES: readonly [0.5, 1, 1.25, 1.5, 2];
|
|
1909
|
+
|
|
1910
|
+
declare const DEFAULT_PANO_VIDEO_CAPTION_APPEARANCE: Required<PanoVideoCaptionAppearance>;
|
|
1417
1911
|
|
|
1418
1912
|
type ScenesController = {
|
|
1419
1913
|
setScene: (id: string) => boolean;
|
|
@@ -1497,52 +1991,6 @@ type PolylineHotspotProps = Omit<HotspotCommonProps, "position" | "width" | "hei
|
|
|
1497
1991
|
declare function validatePolylineVertices(vertices: HotspotPosition[]): PolylineValidationIssue[];
|
|
1498
1992
|
declare function PolylineHotspot({ id, vertices, stroke, strokeWidth, strokeOpacity, strokeDashSize, strokeGapSize, renderOrder, draggable, onVerticesChange, onDragStart, onDragEnd, onInvalid, ...anchorProps }: PolylineHotspotProps): react.JSX.Element | null;
|
|
1499
1993
|
|
|
1500
|
-
type GraphicPaint = {
|
|
1501
|
-
fill?: string;
|
|
1502
|
-
stroke?: string;
|
|
1503
|
-
strokeWidth?: number;
|
|
1504
|
-
};
|
|
1505
|
-
type CircleGraphic = GraphicPaint & {
|
|
1506
|
-
kind: "circle";
|
|
1507
|
-
};
|
|
1508
|
-
type TriangleGraphic = GraphicPaint & {
|
|
1509
|
-
kind: "triangle";
|
|
1510
|
-
};
|
|
1511
|
-
type DiamondGraphic = GraphicPaint & {
|
|
1512
|
-
kind: "diamond";
|
|
1513
|
-
};
|
|
1514
|
-
type StarGraphic = GraphicPaint & {
|
|
1515
|
-
kind: "star";
|
|
1516
|
-
};
|
|
1517
|
-
type ArrowGraphic = GraphicPaint & {
|
|
1518
|
-
kind: "arrow";
|
|
1519
|
-
};
|
|
1520
|
-
type RectangleGraphic = GraphicPaint & {
|
|
1521
|
-
kind: "rectangle";
|
|
1522
|
-
/** Relative radius from 0 (square corners) to 0.5 (maximum rounded corners). */
|
|
1523
|
-
cornerRadius?: number;
|
|
1524
|
-
};
|
|
1525
|
-
type RingGraphic = GraphicPaint & {
|
|
1526
|
-
kind: "ring";
|
|
1527
|
-
innerRadius?: number;
|
|
1528
|
-
};
|
|
1529
|
-
type SvgGraphic = {
|
|
1530
|
-
kind: "svg";
|
|
1531
|
-
src: string;
|
|
1532
|
-
};
|
|
1533
|
-
type SvgPathGraphic = GraphicPaint & {
|
|
1534
|
-
kind: "path";
|
|
1535
|
-
path: string;
|
|
1536
|
-
viewBox: [x: number, y: number, width: number, height: number];
|
|
1537
|
-
};
|
|
1538
|
-
type GraphicDefinition = CircleGraphic | TriangleGraphic | DiamondGraphic | StarGraphic | ArrowGraphic | RectangleGraphic | RingGraphic | SvgGraphic | SvgPathGraphic;
|
|
1539
|
-
type GraphicHotspotProps = HotspotCommonProps & {
|
|
1540
|
-
graphic: GraphicDefinition;
|
|
1541
|
-
onLoad?: (texture: Texture) => void;
|
|
1542
|
-
onError?: (error: unknown) => void;
|
|
1543
|
-
};
|
|
1544
|
-
declare function GraphicHotspot(props: GraphicHotspotProps): react.JSX.Element;
|
|
1545
|
-
|
|
1546
1994
|
type SequenceFrameDirection = "horizontal" | "vertical";
|
|
1547
1995
|
type SequenceLoadProgress = {
|
|
1548
1996
|
id: string;
|
|
@@ -1578,61 +2026,6 @@ type SequenceHotspotProps = HotspotCommonProps & {
|
|
|
1578
2026
|
};
|
|
1579
2027
|
declare function SequenceHotspot({ id, src, frameCount: requestedFrameCount, frameDirection, playing, fps, loop, width, height, opacity, onFrameChange, onLoadProgress, onPlaybackStateChange, onEnded, onError, ...anchorProps }: SequenceHotspotProps): react.JSX.Element;
|
|
1580
2028
|
|
|
1581
|
-
type TextHotspotAlign = "left" | "center" | "right";
|
|
1582
|
-
type TextHotspotVerticalAlign = "top" | "middle" | "bottom";
|
|
1583
|
-
type TextHotspotWhiteSpace = "normal" | "nowrap";
|
|
1584
|
-
type TextHotspotFontStyle = "normal" | "italic";
|
|
1585
|
-
/** Serializable typography and panel paint for a text hotspot. */
|
|
1586
|
-
type TextHotspotStyle = {
|
|
1587
|
-
fontFamily?: string;
|
|
1588
|
-
/** Canvas pixels. Defaults to 96. */
|
|
1589
|
-
fontSize?: number;
|
|
1590
|
-
/** CSS font-weight. Defaults to 600. */
|
|
1591
|
-
fontWeight?: number | string;
|
|
1592
|
-
/** CSS font-style. Defaults to `"normal"`. */
|
|
1593
|
-
fontStyle?: TextHotspotFontStyle;
|
|
1594
|
-
color?: string;
|
|
1595
|
-
/** CSS color. An empty string skips the panel fill. */
|
|
1596
|
-
background?: string;
|
|
1597
|
-
backgroundOpacity?: number;
|
|
1598
|
-
/** Fraction of the texture's shorter side. */
|
|
1599
|
-
padding?: number;
|
|
1600
|
-
align?: TextHotspotAlign;
|
|
1601
|
-
verticalAlign?: TextHotspotVerticalAlign;
|
|
1602
|
-
lineHeight?: number;
|
|
1603
|
-
whiteSpace?: TextHotspotWhiteSpace;
|
|
1604
|
-
/** Fraction of the texture's shorter side, from 0 to 0.5. */
|
|
1605
|
-
borderRadius?: number;
|
|
1606
|
-
stroke?: string;
|
|
1607
|
-
strokeWidth?: number;
|
|
1608
|
-
};
|
|
1609
|
-
type TextHotspotProps = HotspotCommonProps & TextHotspotStyle & {
|
|
1610
|
-
text: string;
|
|
1611
|
-
onLoad?: (texture: Texture) => void;
|
|
1612
|
-
onError?: (error: unknown) => void;
|
|
1613
|
-
};
|
|
1614
|
-
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;
|
|
1615
|
-
|
|
1616
|
-
type IframePointerPolicy = "hotspot" | "content";
|
|
1617
|
-
type IframeHotspotProps = HotspotCommonProps & {
|
|
1618
|
-
src: string;
|
|
1619
|
-
/** Accessible iframe title. Falls back to ariaLabel. */
|
|
1620
|
-
title?: string;
|
|
1621
|
-
sandbox?: string;
|
|
1622
|
-
allow?: string;
|
|
1623
|
-
referrerPolicy?: IframeHTMLAttributes<HTMLIFrameElement>["referrerPolicy"];
|
|
1624
|
-
loading?: "eager" | "lazy";
|
|
1625
|
-
/**
|
|
1626
|
-
* `hotspot` lets panorama pointer events hit the WebGL plane.
|
|
1627
|
-
* `content` makes the embedded page interactive.
|
|
1628
|
-
*/
|
|
1629
|
-
pointerPolicy?: IframePointerPolicy;
|
|
1630
|
-
background?: string;
|
|
1631
|
-
onLoad?: () => void;
|
|
1632
|
-
onError?: (error: unknown) => void;
|
|
1633
|
-
};
|
|
1634
|
-
declare function IframeHotspot({ src, title, sandbox, allow, referrerPolicy, loading, pointerPolicy, background, opacity, width, height, onLoad, onError, interactive, pointerEvents, ...anchorProps }: IframeHotspotProps): react.JSX.Element;
|
|
1635
|
-
|
|
1636
2029
|
declare function Tile({ baseUrl, multires, previewUrl, previewFaceOrder, urlTemplate, resolveTileUrl, maxTextureMemoryMb, maxConcurrentLoads, retryCount, loadMode, visible, onReady, onPreviewError, onLoadProgress, onTileError, onLevelChange, }: TileProps): react.JSX.Element;
|
|
1637
2030
|
|
|
1638
2031
|
declare function normalizePanoYaw(yaw: number): number;
|
|
@@ -1644,118 +2037,4 @@ declare function vector3ToPanoPosition(vector: Pick<Vector3, "x" | "y" | "z">):
|
|
|
1644
2037
|
declare const DEFAULT_HOTSPOT_TOOLTIP_OFFSET = 12;
|
|
1645
2038
|
declare const DEFAULT_HOTSPOT_TOOLTIP_APPEARANCE: Required<HotspotTooltipAppearance>;
|
|
1646
2039
|
|
|
1647
|
-
|
|
1648
|
-
type HotspotDefinitionBase = {
|
|
1649
|
-
id: string;
|
|
1650
|
-
/** Human-readable label; use it as the source for the rendered ariaLabel. */
|
|
1651
|
-
label?: string;
|
|
1652
|
-
visible?: boolean;
|
|
1653
|
-
interactive?: boolean;
|
|
1654
|
-
/** Pointer hit-testing. `"none"` ignores mouse, touch, and pen. */
|
|
1655
|
-
pointerEvents?: HotspotPointerEvents;
|
|
1656
|
-
/** Canvas cursor while this hotspot is hovered. */
|
|
1657
|
-
cursor?: CSSProperties["cursor"];
|
|
1658
|
-
renderOrder?: number;
|
|
1659
|
-
tooltip?: string | HotspotTooltipContent;
|
|
1660
|
-
tooltipTrigger?: HotspotTooltipTrigger;
|
|
1661
|
-
tooltipPlacement?: HotspotTooltipPlacement;
|
|
1662
|
-
tooltipOffset?: number;
|
|
1663
|
-
tooltipAppearance?: HotspotTooltipAppearance;
|
|
1664
|
-
};
|
|
1665
|
-
/** Shared serializable fields for a hotspot anchored at one yaw/pitch point. */
|
|
1666
|
-
type PointHotspotDefinitionBase = HotspotDefinitionBase & {
|
|
1667
|
-
position: HotspotPosition;
|
|
1668
|
-
width?: number;
|
|
1669
|
-
height?: number;
|
|
1670
|
-
scale?: number;
|
|
1671
|
-
mode?: HotspotMode;
|
|
1672
|
-
distance?: number;
|
|
1673
|
-
scaleMode?: HotspotScaleMode;
|
|
1674
|
-
referenceFov?: number;
|
|
1675
|
-
rotation?: number;
|
|
1676
|
-
opacity?: number;
|
|
1677
|
-
};
|
|
1678
|
-
type ImageHotspotDefinition = PointHotspotDefinitionBase & {
|
|
1679
|
-
type: "image";
|
|
1680
|
-
src: string;
|
|
1681
|
-
};
|
|
1682
|
-
type GraphicHotspotDefinition = PointHotspotDefinitionBase & {
|
|
1683
|
-
type: "graphic";
|
|
1684
|
-
graphic: GraphicDefinition;
|
|
1685
|
-
};
|
|
1686
|
-
type SequenceHotspotDefinition = PointHotspotDefinitionBase & {
|
|
1687
|
-
type: "sequence";
|
|
1688
|
-
src: string;
|
|
1689
|
-
frameCount: number;
|
|
1690
|
-
frameDirection?: "horizontal" | "vertical";
|
|
1691
|
-
playing?: boolean;
|
|
1692
|
-
fps?: number;
|
|
1693
|
-
loop?: boolean;
|
|
1694
|
-
};
|
|
1695
|
-
type VideoHotspotDefinition = PointHotspotDefinitionBase & {
|
|
1696
|
-
type: "video";
|
|
1697
|
-
src: string;
|
|
1698
|
-
poster?: string;
|
|
1699
|
-
playing?: boolean;
|
|
1700
|
-
loop?: boolean;
|
|
1701
|
-
muted?: boolean;
|
|
1702
|
-
volume?: number;
|
|
1703
|
-
playsInline?: boolean;
|
|
1704
|
-
preload?: "none" | "metadata" | "auto";
|
|
1705
|
-
crossOrigin?: "" | "anonymous" | "use-credentials";
|
|
1706
|
-
};
|
|
1707
|
-
type AudioHotspotDefinition = PointHotspotDefinitionBase & {
|
|
1708
|
-
type: "audio";
|
|
1709
|
-
src: string | string[];
|
|
1710
|
-
playing?: boolean;
|
|
1711
|
-
loop?: boolean;
|
|
1712
|
-
muted?: boolean;
|
|
1713
|
-
volume?: number;
|
|
1714
|
-
pauseWhenHidden?: boolean;
|
|
1715
|
-
range?: number;
|
|
1716
|
-
icon?: string;
|
|
1717
|
-
playingIcon?: string;
|
|
1718
|
-
marker?: boolean;
|
|
1719
|
-
crossOrigin?: "" | "anonymous" | "use-credentials";
|
|
1720
|
-
};
|
|
1721
|
-
type TextHotspotDefinition = PointHotspotDefinitionBase & TextHotspotStyle & {
|
|
1722
|
-
type: "text";
|
|
1723
|
-
text: string;
|
|
1724
|
-
};
|
|
1725
|
-
type IframeHotspotDefinition = PointHotspotDefinitionBase & {
|
|
1726
|
-
type: "iframe";
|
|
1727
|
-
src: string;
|
|
1728
|
-
title?: string;
|
|
1729
|
-
sandbox?: string;
|
|
1730
|
-
allow?: string;
|
|
1731
|
-
referrerPolicy?: string;
|
|
1732
|
-
loading?: "eager" | "lazy";
|
|
1733
|
-
pointerPolicy?: IframePointerPolicy;
|
|
1734
|
-
background?: string;
|
|
1735
|
-
};
|
|
1736
|
-
type PolygonHotspotDefinition = HotspotDefinitionBase & {
|
|
1737
|
-
type: "polygon";
|
|
1738
|
-
vertices: HotspotPosition[];
|
|
1739
|
-
fill?: string;
|
|
1740
|
-
fillOpacity?: number;
|
|
1741
|
-
stroke?: string;
|
|
1742
|
-
strokeWidth?: number;
|
|
1743
|
-
strokeOpacity?: number;
|
|
1744
|
-
strokeDashSize?: number;
|
|
1745
|
-
strokeGapSize?: number;
|
|
1746
|
-
};
|
|
1747
|
-
/** An open path. This extends the original point and polygon hotspot categories. */
|
|
1748
|
-
type PolylineHotspotDefinition = HotspotDefinitionBase & {
|
|
1749
|
-
type: "polyline";
|
|
1750
|
-
vertices: HotspotPosition[];
|
|
1751
|
-
stroke?: string;
|
|
1752
|
-
strokeWidth?: number;
|
|
1753
|
-
strokeOpacity?: number;
|
|
1754
|
-
strokeDashSize?: number;
|
|
1755
|
-
strokeGapSize?: number;
|
|
1756
|
-
};
|
|
1757
|
-
type PointHotspotDefinition = ImageHotspotDefinition | GraphicHotspotDefinition | SequenceHotspotDefinition | VideoHotspotDefinition | AudioHotspotDefinition | TextHotspotDefinition | IframeHotspotDefinition;
|
|
1758
|
-
/** A serializable, discriminated hotspot collection item. */
|
|
1759
|
-
type HotspotDefinition = PointHotspotDefinition | PolygonHotspotDefinition | PolylineHotspotDefinition;
|
|
1760
|
-
|
|
1761
|
-
export { type ArrowGraphic, 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, 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, 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, type PanoEventBus, type PanoEventListener, type PanoEventMap, type PanoEventType, PanoEvents, type PanoEventsProps, PanoFilter, type PanoFilterPreset, type PanoFilterProps, type PanoMediaActivationControls, type PanoMediaActivationOptions, 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 RectangleGraphic, type RingGraphic, type Scene, 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 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, 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, usePanoViewer, validatePolygonVertices, validatePolylineVertices, vector3ToPanoPosition };
|
|
2040
|
+
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 JsonObject, type JsonRequestOptions, type JsonValue, 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, PanoOverlayPortalProvider, type PanoOverlayRenderContext, 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 PanoViewLimits, 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 PopupAssetUrlContext, type PopupAssetUrlResolver, type ProjectCustomActionEvent, type ProjectCustomHotspotAction, type ProjectHotspotAction, type ProjectHotspotClickEvent, type ProjectHotspotDefinition, type ProjectHotspotErrorEvent, type ProjectHotspotEvent, type ProjectHotspotRenderContext, type ProjectHotspotTrigger, type ProjectPopupBlock, type ProjectPopupDefinition, type ProjectPopupRequestEvent, 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, hotspotAction, loadPanoProject, loadSceneFromJson, normalizePanoPosition, normalizePanoYaw, panoPositionToVector3, parsePanoProject, projectHotspotTriggers, resolvePanoContextMenuEntries, resolveHotspotAssets as resolveProjectHotspotAssets, resolveProjectPopupAssets, sceneFromViewerConfig, setHotspotAction, unwrapPolygonVertices, usePanoEvents, usePanoModal, usePanoOverlay, usePanoViewer, validatePolygonVertices, validatePolylineVertices, vector3ToPanoPosition };
|