@ericchen1990/pano-view 3.5.0 → 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 +93 -0
- package/README.zh-CN.md +93 -0
- package/dist/data.cjs +202 -25
- package/dist/data.cjs.map +1 -1
- package/dist/data.d.mts +90 -8
- package/dist/data.d.ts +90 -8
- package/dist/data.mjs +202 -25
- package/dist/data.mjs.map +1 -1
- package/dist/index.cjs +1638 -1281
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +148 -11
- package/dist/index.d.ts +148 -11
- package/dist/index.mjs +1244 -883
- 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 +11 -3
package/dist/index.d.mts
CHANGED
|
@@ -2,6 +2,22 @@ import * as react from 'react';
|
|
|
2
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;
|
|
@@ -991,18 +1044,21 @@ type SphereTileProps = {
|
|
|
991
1044
|
onLevelChange?: (level: number) => void;
|
|
992
1045
|
};
|
|
993
1046
|
|
|
994
|
-
type
|
|
1047
|
+
type SceneViewOptions = {
|
|
1048
|
+
viewLimits?: PanoViewLimits;
|
|
1049
|
+
};
|
|
1050
|
+
type SphereScene = SceneViewOptions & {
|
|
995
1051
|
id: string;
|
|
996
1052
|
type: "sphere";
|
|
997
1053
|
src: string;
|
|
998
1054
|
previewUrl: string;
|
|
999
1055
|
yawOffset?: number;
|
|
1000
1056
|
};
|
|
1001
|
-
type TileScene = Omit<TileProps, "loadMode" | "visible" | "onReady" | "onPreviewError" | "onLoadProgress" | "onTileError" | "onLevelChange"> & {
|
|
1057
|
+
type TileScene = Omit<TileProps, "loadMode" | "visible" | "onReady" | "onPreviewError" | "onLoadProgress" | "onTileError" | "onLevelChange"> & SceneViewOptions & {
|
|
1002
1058
|
id: string;
|
|
1003
1059
|
type: "tile";
|
|
1004
1060
|
};
|
|
1005
|
-
type SphereTileScene = Omit<SphereTileProps, "loadMode" | "visible" | "onReady" | "onPreviewError" | "onLoadProgress" | "onTileError" | "onLevelChange"> & {
|
|
1061
|
+
type SphereTileScene = Omit<SphereTileProps, "loadMode" | "visible" | "onReady" | "onPreviewError" | "onLoadProgress" | "onTileError" | "onLevelChange"> & SceneViewOptions & {
|
|
1006
1062
|
id: string;
|
|
1007
1063
|
type: "sphereTile";
|
|
1008
1064
|
};
|
|
@@ -1081,6 +1137,37 @@ type LoadSceneFromJsonOptions = Omit<SceneFromViewerConfigOptions, "baseUrl"> &
|
|
|
1081
1137
|
declare function sceneFromViewerConfig(value: unknown, options: SceneFromViewerConfigOptions): TileScene | SphereTileScene;
|
|
1082
1138
|
declare function loadSceneFromJson(url: string, options: LoadSceneFromJsonOptions): Promise<TileScene | SphereTileScene>;
|
|
1083
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
|
+
|
|
1084
1171
|
type GraphicPaint = {
|
|
1085
1172
|
fill?: string;
|
|
1086
1173
|
stroke?: string;
|
|
@@ -1245,6 +1332,7 @@ type VideoHotspotDefinition = PointHotspotDefinitionBase & {
|
|
|
1245
1332
|
type AudioHotspotDefinition = PointHotspotDefinitionBase & {
|
|
1246
1333
|
type: "audio";
|
|
1247
1334
|
src: string | string[];
|
|
1335
|
+
format?: string | string[];
|
|
1248
1336
|
playing?: boolean;
|
|
1249
1337
|
loop?: boolean;
|
|
1250
1338
|
muted?: boolean;
|
|
@@ -1296,12 +1384,36 @@ type PointHotspotDefinition = ImageHotspotDefinition | GraphicHotspotDefinition
|
|
|
1296
1384
|
/** A serializable, discriminated hotspot collection item. */
|
|
1297
1385
|
type HotspotDefinition = PointHotspotDefinition | PolygonHotspotDefinition | PolylineHotspotDefinition;
|
|
1298
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
|
+
};
|
|
1299
1411
|
type ProjectHotspotDefinition = HotspotDefinition & {
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
};
|
|
1412
|
+
/** Legacy click fallback. events.click takes precedence. */
|
|
1413
|
+
action?: ProjectHotspotAction;
|
|
1414
|
+
events?: Partial<Record<ProjectHotspotTrigger, ProjectHotspotAction>>;
|
|
1304
1415
|
};
|
|
1416
|
+
declare function resolveHotspotAssets(hotspot: ProjectHotspotDefinition, baseUrl: string, sceneId: string, resolver?: AssetUrlResolver): ProjectHotspotDefinition;
|
|
1305
1417
|
|
|
1306
1418
|
type PanoProjectSceneDefinition = {
|
|
1307
1419
|
id: string;
|
|
@@ -1316,6 +1428,7 @@ type PanoProjectSceneDefinition = {
|
|
|
1316
1428
|
baseUrl?: string;
|
|
1317
1429
|
};
|
|
1318
1430
|
initialView?: Partial<PanoViewerState>;
|
|
1431
|
+
viewLimits?: PanoViewLimits;
|
|
1319
1432
|
hotspots?: ProjectHotspotDefinition[];
|
|
1320
1433
|
};
|
|
1321
1434
|
type PanoProjectDefinition = {
|
|
@@ -1323,6 +1436,7 @@ type PanoProjectDefinition = {
|
|
|
1323
1436
|
title?: string;
|
|
1324
1437
|
initialSceneId?: string;
|
|
1325
1438
|
scenes: PanoProjectSceneDefinition[];
|
|
1439
|
+
popups?: ProjectPopupDefinition[];
|
|
1326
1440
|
};
|
|
1327
1441
|
type LoadedProjectScene = {
|
|
1328
1442
|
scene: TileScene | SphereTileScene;
|
|
@@ -1334,13 +1448,18 @@ type LoadedPanoProject = {
|
|
|
1334
1448
|
title?: string;
|
|
1335
1449
|
initialSceneId: string;
|
|
1336
1450
|
scenes: LoadedProjectScene[];
|
|
1451
|
+
popups?: ProjectPopupDefinition[];
|
|
1337
1452
|
};
|
|
1338
1453
|
type LoadPanoProjectOptions = JsonRequestOptions & {
|
|
1339
1454
|
/** Directory used for project-relative references. Required for object input. */
|
|
1340
1455
|
baseUrl?: string;
|
|
1341
1456
|
resolveAssetUrl?: AssetUrlResolver;
|
|
1457
|
+
resolvePopupAssetUrl?: PopupAssetUrlResolver;
|
|
1342
1458
|
};
|
|
1343
|
-
|
|
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;
|
|
1344
1463
|
declare function loadPanoProject(source: string | PanoProjectDefinition, options?: LoadPanoProjectOptions): Promise<LoadedPanoProject>;
|
|
1345
1464
|
|
|
1346
1465
|
type ProjectHotspotClickEvent = {
|
|
@@ -1350,27 +1469,43 @@ type ProjectHotspotClickEvent = {
|
|
|
1350
1469
|
defaultPrevented: boolean;
|
|
1351
1470
|
preventDefault: () => void;
|
|
1352
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
|
+
};
|
|
1353
1483
|
type ProjectHotspotErrorEvent = {
|
|
1354
1484
|
sceneId: string;
|
|
1355
1485
|
hotspot: ProjectHotspotDefinition;
|
|
1356
1486
|
error: unknown;
|
|
1487
|
+
trigger?: ProjectHotspotTrigger;
|
|
1357
1488
|
};
|
|
1358
1489
|
type ProjectHotspotRenderContext = {
|
|
1359
1490
|
sceneId: string;
|
|
1360
1491
|
playing: boolean;
|
|
1361
1492
|
onClick: (event: HotspotInteractionEvent) => void;
|
|
1493
|
+
onHoverChange: (hovered: boolean, event: HotspotInteractionEvent) => void;
|
|
1362
1494
|
togglePlayback: () => void;
|
|
1363
1495
|
reportError: (error: unknown) => void;
|
|
1364
1496
|
renderDefault: () => ReactNode;
|
|
1365
1497
|
};
|
|
1366
1498
|
type ProjectScenesProps = Omit<ScenesProps, "scenes" | "defaultActiveSceneId" | "renderHotspots"> & {
|
|
1367
1499
|
project: LoadedPanoProject;
|
|
1500
|
+
onHotspotEvent?: (event: ProjectHotspotEvent) => void;
|
|
1501
|
+
onCustomAction?: (event: ProjectCustomActionEvent) => void | Promise<void>;
|
|
1368
1502
|
onHotspotClick?: (event: ProjectHotspotClickEvent) => void;
|
|
1503
|
+
onPopupRequest?: (event: ProjectPopupRequestEvent) => void;
|
|
1369
1504
|
onHotspotError?: (event: ProjectHotspotErrorEvent) => void;
|
|
1370
1505
|
/** Return undefined for the default renderer, or null to hide this hotspot. */
|
|
1371
1506
|
renderHotspot?: (hotspot: ProjectHotspotDefinition, context: ProjectHotspotRenderContext) => ReactNode;
|
|
1372
1507
|
};
|
|
1373
|
-
declare function ProjectScenes({ project, activeSceneId, onActiveSceneIdChange, onSceneReady, onHotspotClick, onHotspotError, renderHotspot, ...options }: ProjectScenesProps): react.JSX.Element;
|
|
1508
|
+
declare function ProjectScenes({ project, activeSceneId, onActiveSceneIdChange, onSceneReady, onHotspotClick, onHotspotEvent, onHotspotError, onPopupRequest, onCustomAction, renderHotspot, ...options }: ProjectScenesProps): react.JSX.Element;
|
|
1374
1509
|
|
|
1375
1510
|
/** Options for automatic horizontal panorama rotation. */
|
|
1376
1511
|
type AutoRotateProps = {
|
|
@@ -1399,6 +1534,8 @@ type AudioHotspotErrorEvent = {
|
|
|
1399
1534
|
};
|
|
1400
1535
|
type AudioHotspotProps = HotspotCommonProps & {
|
|
1401
1536
|
src: string | string[];
|
|
1537
|
+
/** Container hints for extensionless sources such as blob URLs, in source order. */
|
|
1538
|
+
format?: string | string[];
|
|
1402
1539
|
playing: boolean;
|
|
1403
1540
|
loop?: boolean;
|
|
1404
1541
|
muted?: boolean;
|
|
@@ -1418,7 +1555,7 @@ type AudioHotspotProps = HotspotCommonProps & {
|
|
|
1418
1555
|
onEnded?: () => void;
|
|
1419
1556
|
onError?: (event: AudioHotspotErrorEvent) => void;
|
|
1420
1557
|
};
|
|
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;
|
|
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;
|
|
1422
1559
|
|
|
1423
1560
|
type BackgroundAudioSource = string | readonly string[];
|
|
1424
1561
|
type BackgroundAudioErrorEvent = {
|
|
@@ -1900,4 +2037,4 @@ declare function vector3ToPanoPosition(vector: Pick<Vector3, "x" | "y" | "z">):
|
|
|
1900
2037
|
declare const DEFAULT_HOTSPOT_TOOLTIP_OFFSET = 12;
|
|
1901
2038
|
declare const DEFAULT_HOTSPOT_TOOLTIP_APPEARANCE: Required<HotspotTooltipAppearance>;
|
|
1902
2039
|
|
|
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 };
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,22 @@ import * as react from 'react';
|
|
|
2
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;
|
|
@@ -991,18 +1044,21 @@ type SphereTileProps = {
|
|
|
991
1044
|
onLevelChange?: (level: number) => void;
|
|
992
1045
|
};
|
|
993
1046
|
|
|
994
|
-
type
|
|
1047
|
+
type SceneViewOptions = {
|
|
1048
|
+
viewLimits?: PanoViewLimits;
|
|
1049
|
+
};
|
|
1050
|
+
type SphereScene = SceneViewOptions & {
|
|
995
1051
|
id: string;
|
|
996
1052
|
type: "sphere";
|
|
997
1053
|
src: string;
|
|
998
1054
|
previewUrl: string;
|
|
999
1055
|
yawOffset?: number;
|
|
1000
1056
|
};
|
|
1001
|
-
type TileScene = Omit<TileProps, "loadMode" | "visible" | "onReady" | "onPreviewError" | "onLoadProgress" | "onTileError" | "onLevelChange"> & {
|
|
1057
|
+
type TileScene = Omit<TileProps, "loadMode" | "visible" | "onReady" | "onPreviewError" | "onLoadProgress" | "onTileError" | "onLevelChange"> & SceneViewOptions & {
|
|
1002
1058
|
id: string;
|
|
1003
1059
|
type: "tile";
|
|
1004
1060
|
};
|
|
1005
|
-
type SphereTileScene = Omit<SphereTileProps, "loadMode" | "visible" | "onReady" | "onPreviewError" | "onLoadProgress" | "onTileError" | "onLevelChange"> & {
|
|
1061
|
+
type SphereTileScene = Omit<SphereTileProps, "loadMode" | "visible" | "onReady" | "onPreviewError" | "onLoadProgress" | "onTileError" | "onLevelChange"> & SceneViewOptions & {
|
|
1006
1062
|
id: string;
|
|
1007
1063
|
type: "sphereTile";
|
|
1008
1064
|
};
|
|
@@ -1081,6 +1137,37 @@ type LoadSceneFromJsonOptions = Omit<SceneFromViewerConfigOptions, "baseUrl"> &
|
|
|
1081
1137
|
declare function sceneFromViewerConfig(value: unknown, options: SceneFromViewerConfigOptions): TileScene | SphereTileScene;
|
|
1082
1138
|
declare function loadSceneFromJson(url: string, options: LoadSceneFromJsonOptions): Promise<TileScene | SphereTileScene>;
|
|
1083
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
|
+
|
|
1084
1171
|
type GraphicPaint = {
|
|
1085
1172
|
fill?: string;
|
|
1086
1173
|
stroke?: string;
|
|
@@ -1245,6 +1332,7 @@ type VideoHotspotDefinition = PointHotspotDefinitionBase & {
|
|
|
1245
1332
|
type AudioHotspotDefinition = PointHotspotDefinitionBase & {
|
|
1246
1333
|
type: "audio";
|
|
1247
1334
|
src: string | string[];
|
|
1335
|
+
format?: string | string[];
|
|
1248
1336
|
playing?: boolean;
|
|
1249
1337
|
loop?: boolean;
|
|
1250
1338
|
muted?: boolean;
|
|
@@ -1296,12 +1384,36 @@ type PointHotspotDefinition = ImageHotspotDefinition | GraphicHotspotDefinition
|
|
|
1296
1384
|
/** A serializable, discriminated hotspot collection item. */
|
|
1297
1385
|
type HotspotDefinition = PointHotspotDefinition | PolygonHotspotDefinition | PolylineHotspotDefinition;
|
|
1298
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
|
+
};
|
|
1299
1411
|
type ProjectHotspotDefinition = HotspotDefinition & {
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
};
|
|
1412
|
+
/** Legacy click fallback. events.click takes precedence. */
|
|
1413
|
+
action?: ProjectHotspotAction;
|
|
1414
|
+
events?: Partial<Record<ProjectHotspotTrigger, ProjectHotspotAction>>;
|
|
1304
1415
|
};
|
|
1416
|
+
declare function resolveHotspotAssets(hotspot: ProjectHotspotDefinition, baseUrl: string, sceneId: string, resolver?: AssetUrlResolver): ProjectHotspotDefinition;
|
|
1305
1417
|
|
|
1306
1418
|
type PanoProjectSceneDefinition = {
|
|
1307
1419
|
id: string;
|
|
@@ -1316,6 +1428,7 @@ type PanoProjectSceneDefinition = {
|
|
|
1316
1428
|
baseUrl?: string;
|
|
1317
1429
|
};
|
|
1318
1430
|
initialView?: Partial<PanoViewerState>;
|
|
1431
|
+
viewLimits?: PanoViewLimits;
|
|
1319
1432
|
hotspots?: ProjectHotspotDefinition[];
|
|
1320
1433
|
};
|
|
1321
1434
|
type PanoProjectDefinition = {
|
|
@@ -1323,6 +1436,7 @@ type PanoProjectDefinition = {
|
|
|
1323
1436
|
title?: string;
|
|
1324
1437
|
initialSceneId?: string;
|
|
1325
1438
|
scenes: PanoProjectSceneDefinition[];
|
|
1439
|
+
popups?: ProjectPopupDefinition[];
|
|
1326
1440
|
};
|
|
1327
1441
|
type LoadedProjectScene = {
|
|
1328
1442
|
scene: TileScene | SphereTileScene;
|
|
@@ -1334,13 +1448,18 @@ type LoadedPanoProject = {
|
|
|
1334
1448
|
title?: string;
|
|
1335
1449
|
initialSceneId: string;
|
|
1336
1450
|
scenes: LoadedProjectScene[];
|
|
1451
|
+
popups?: ProjectPopupDefinition[];
|
|
1337
1452
|
};
|
|
1338
1453
|
type LoadPanoProjectOptions = JsonRequestOptions & {
|
|
1339
1454
|
/** Directory used for project-relative references. Required for object input. */
|
|
1340
1455
|
baseUrl?: string;
|
|
1341
1456
|
resolveAssetUrl?: AssetUrlResolver;
|
|
1457
|
+
resolvePopupAssetUrl?: PopupAssetUrlResolver;
|
|
1342
1458
|
};
|
|
1343
|
-
|
|
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;
|
|
1344
1463
|
declare function loadPanoProject(source: string | PanoProjectDefinition, options?: LoadPanoProjectOptions): Promise<LoadedPanoProject>;
|
|
1345
1464
|
|
|
1346
1465
|
type ProjectHotspotClickEvent = {
|
|
@@ -1350,27 +1469,43 @@ type ProjectHotspotClickEvent = {
|
|
|
1350
1469
|
defaultPrevented: boolean;
|
|
1351
1470
|
preventDefault: () => void;
|
|
1352
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
|
+
};
|
|
1353
1483
|
type ProjectHotspotErrorEvent = {
|
|
1354
1484
|
sceneId: string;
|
|
1355
1485
|
hotspot: ProjectHotspotDefinition;
|
|
1356
1486
|
error: unknown;
|
|
1487
|
+
trigger?: ProjectHotspotTrigger;
|
|
1357
1488
|
};
|
|
1358
1489
|
type ProjectHotspotRenderContext = {
|
|
1359
1490
|
sceneId: string;
|
|
1360
1491
|
playing: boolean;
|
|
1361
1492
|
onClick: (event: HotspotInteractionEvent) => void;
|
|
1493
|
+
onHoverChange: (hovered: boolean, event: HotspotInteractionEvent) => void;
|
|
1362
1494
|
togglePlayback: () => void;
|
|
1363
1495
|
reportError: (error: unknown) => void;
|
|
1364
1496
|
renderDefault: () => ReactNode;
|
|
1365
1497
|
};
|
|
1366
1498
|
type ProjectScenesProps = Omit<ScenesProps, "scenes" | "defaultActiveSceneId" | "renderHotspots"> & {
|
|
1367
1499
|
project: LoadedPanoProject;
|
|
1500
|
+
onHotspotEvent?: (event: ProjectHotspotEvent) => void;
|
|
1501
|
+
onCustomAction?: (event: ProjectCustomActionEvent) => void | Promise<void>;
|
|
1368
1502
|
onHotspotClick?: (event: ProjectHotspotClickEvent) => void;
|
|
1503
|
+
onPopupRequest?: (event: ProjectPopupRequestEvent) => void;
|
|
1369
1504
|
onHotspotError?: (event: ProjectHotspotErrorEvent) => void;
|
|
1370
1505
|
/** Return undefined for the default renderer, or null to hide this hotspot. */
|
|
1371
1506
|
renderHotspot?: (hotspot: ProjectHotspotDefinition, context: ProjectHotspotRenderContext) => ReactNode;
|
|
1372
1507
|
};
|
|
1373
|
-
declare function ProjectScenes({ project, activeSceneId, onActiveSceneIdChange, onSceneReady, onHotspotClick, onHotspotError, renderHotspot, ...options }: ProjectScenesProps): react.JSX.Element;
|
|
1508
|
+
declare function ProjectScenes({ project, activeSceneId, onActiveSceneIdChange, onSceneReady, onHotspotClick, onHotspotEvent, onHotspotError, onPopupRequest, onCustomAction, renderHotspot, ...options }: ProjectScenesProps): react.JSX.Element;
|
|
1374
1509
|
|
|
1375
1510
|
/** Options for automatic horizontal panorama rotation. */
|
|
1376
1511
|
type AutoRotateProps = {
|
|
@@ -1399,6 +1534,8 @@ type AudioHotspotErrorEvent = {
|
|
|
1399
1534
|
};
|
|
1400
1535
|
type AudioHotspotProps = HotspotCommonProps & {
|
|
1401
1536
|
src: string | string[];
|
|
1537
|
+
/** Container hints for extensionless sources such as blob URLs, in source order. */
|
|
1538
|
+
format?: string | string[];
|
|
1402
1539
|
playing: boolean;
|
|
1403
1540
|
loop?: boolean;
|
|
1404
1541
|
muted?: boolean;
|
|
@@ -1418,7 +1555,7 @@ type AudioHotspotProps = HotspotCommonProps & {
|
|
|
1418
1555
|
onEnded?: () => void;
|
|
1419
1556
|
onError?: (event: AudioHotspotErrorEvent) => void;
|
|
1420
1557
|
};
|
|
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;
|
|
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;
|
|
1422
1559
|
|
|
1423
1560
|
type BackgroundAudioSource = string | readonly string[];
|
|
1424
1561
|
type BackgroundAudioErrorEvent = {
|
|
@@ -1900,4 +2037,4 @@ declare function vector3ToPanoPosition(vector: Pick<Vector3, "x" | "y" | "z">):
|
|
|
1900
2037
|
declare const DEFAULT_HOTSPOT_TOOLTIP_OFFSET = 12;
|
|
1901
2038
|
declare const DEFAULT_HOTSPOT_TOOLTIP_APPEARANCE: Required<HotspotTooltipAppearance>;
|
|
1902
2039
|
|
|
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 };
|
|
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 };
|