@ericchen1990/pano-view 4.0.1 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +94 -15
- package/README.zh-CN.md +71 -8
- package/dist/data.cjs +4 -0
- package/dist/data.cjs.map +1 -1
- package/dist/data.d.mts +5 -0
- package/dist/data.d.ts +5 -0
- package/dist/data.mjs +4 -0
- package/dist/data.mjs.map +1 -1
- package/dist/index.cjs +6494 -2650
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +319 -120
- package/dist/index.d.ts +319 -120
- package/dist/index.mjs +6576 -2688
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +47 -3
- package/dist/ui/styles.css +3 -0
- package/dist/ui.cjs +31 -11
- package/dist/ui.cjs.map +1 -1
- package/dist/ui.d.mts +4 -3
- package/dist/ui.d.ts +4 -3
- package/dist/ui.mjs +33 -13
- package/dist/ui.mjs.map +1 -1
- package/docs/dialogs.md +74 -2
- package/docs/dialogs.zh-CN.md +80 -2
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { CSSProperties, ReactNode, ComponentPropsWithoutRef, IframeHTMLAttributes,
|
|
2
|
+
import { CSSProperties, ReactNode, Ref, RefObject, ComponentPropsWithoutRef, IframeHTMLAttributes, ComponentProps } from 'react';
|
|
3
3
|
import { Texture, ColorRepresentation, Vector3 } from 'three';
|
|
4
4
|
|
|
5
5
|
/** Camera-center limits in degrees. A yaw min greater than max crosses ±180°. */
|
|
@@ -34,6 +34,7 @@ type HotspotPosition = {
|
|
|
34
34
|
type HotspotMode = "surface" | "billboard";
|
|
35
35
|
/** Whether a hotspot grows with panorama zoom or preserves its screen size. */
|
|
36
36
|
type HotspotScaleMode = "fov" | "fixed";
|
|
37
|
+
type HotspotTooltipScaleMode = "inherit" | HotspotScaleMode;
|
|
37
38
|
type HotspotInputSource = "pointer" | "keyboard";
|
|
38
39
|
type HotspotInteractionEvent = {
|
|
39
40
|
id: string;
|
|
@@ -87,6 +88,10 @@ type HotspotCommonProps = {
|
|
|
87
88
|
tooltipTrigger?: HotspotTooltipTrigger;
|
|
88
89
|
/** Screen direction for the tooltip. Defaults to `"top"`. */
|
|
89
90
|
tooltipPlacement?: HotspotTooltipPlacement;
|
|
91
|
+
/** Defaults to billboard, independently of the hotspot orientation. */
|
|
92
|
+
tooltipMode?: HotspotMode;
|
|
93
|
+
/** Defaults to inherit. Surface tooltips always scale with FOV. */
|
|
94
|
+
tooltipScaleMode?: HotspotTooltipScaleMode;
|
|
90
95
|
/**
|
|
91
96
|
* Screen-space gap in CSS pixels between the hotspot edge and the tooltip.
|
|
92
97
|
* Defaults to 12.
|
|
@@ -107,9 +112,9 @@ type HotspotCommonProps = {
|
|
|
107
112
|
* when needed so the full hotspot remains inside the panorama shell.
|
|
108
113
|
*/
|
|
109
114
|
distance?: number;
|
|
110
|
-
/**
|
|
115
|
+
/** Billboard defaults to fixed. Surface always uses fov, ignoring fixed. */
|
|
111
116
|
scaleMode?: HotspotScaleMode;
|
|
112
|
-
/** Reference FOV
|
|
117
|
+
/** Reference FOV for fixed hotspot size and tooltip styling. Defaults to 75. */
|
|
113
118
|
referenceFov?: number;
|
|
114
119
|
/** Clockwise rotation around the hotspot normal in degrees. */
|
|
115
120
|
rotation?: number;
|
|
@@ -234,117 +239,11 @@ declare function cycleSceneId(scenes: readonly {
|
|
|
234
239
|
*/
|
|
235
240
|
declare function KeyboardControls({ enabled, keys, rotateSpeed, zoomSpeed, shiftMultiplier, invert, fovSpeed, onPreviousScene, onNextScene, }: KeyboardControlsProps): null;
|
|
236
241
|
|
|
237
|
-
type
|
|
238
|
-
type
|
|
239
|
-
|
|
240
|
-
source: "
|
|
241
|
-
|
|
242
|
-
};
|
|
243
|
-
type VideoHotspotProps = HotspotCommonProps & {
|
|
244
|
-
src: string;
|
|
245
|
-
playing: boolean;
|
|
246
|
-
poster?: string;
|
|
247
|
-
loop?: boolean;
|
|
248
|
-
muted?: boolean;
|
|
249
|
-
volume?: number;
|
|
250
|
-
/**
|
|
251
|
-
* Keep playback in the page. Defaults to true, including the WebKit and
|
|
252
|
-
* X5 attributes for iPhone Safari, WeChat, QQ, and UC.
|
|
253
|
-
*/
|
|
254
|
-
playsInline?: boolean;
|
|
255
|
-
preload?: "none" | "metadata" | "auto";
|
|
256
|
-
crossOrigin?: "" | "anonymous" | "use-credentials";
|
|
257
|
-
onPlaybackStateChange?: (state: VideoPlaybackState) => void;
|
|
258
|
-
onPlaybackError?: (error: unknown) => void;
|
|
259
|
-
onEnded?: () => void;
|
|
260
|
-
onError?: (event: VideoHotspotErrorEvent) => void;
|
|
261
|
-
};
|
|
262
|
-
declare function VideoHotspot({ id, src, playing, poster, loop, muted, volume, playsInline, preload, crossOrigin, width, height, opacity, onPlaybackStateChange, onPlaybackError, onEnded, onError, ...anchorProps }: VideoHotspotProps): react.JSX.Element;
|
|
263
|
-
|
|
264
|
-
type PanoVideoSource = {
|
|
265
|
-
src: string;
|
|
266
|
-
type?: string;
|
|
267
|
-
};
|
|
268
|
-
type PanoVideoVariant = {
|
|
269
|
-
id: string;
|
|
270
|
-
label: string;
|
|
271
|
-
poster?: string;
|
|
272
|
-
sources: readonly PanoVideoSource[];
|
|
273
|
-
};
|
|
274
|
-
type PanoVideoTrackKind = "subtitles" | "captions";
|
|
275
|
-
type PanoVideoTrack = {
|
|
276
|
-
/** Defaults to `srcLang`. */
|
|
277
|
-
id?: string;
|
|
278
|
-
src: string;
|
|
279
|
-
srcLang: string;
|
|
280
|
-
label: string;
|
|
281
|
-
kind?: PanoVideoTrackKind;
|
|
282
|
-
default?: boolean;
|
|
283
|
-
};
|
|
284
|
-
type PanoVideoCaptionAppearance = {
|
|
285
|
-
color?: string;
|
|
286
|
-
background?: string;
|
|
287
|
-
fontSize?: number | string;
|
|
288
|
-
fontFamily?: string;
|
|
289
|
-
fontWeight?: CSSProperties["fontWeight"];
|
|
290
|
-
textShadow?: string;
|
|
291
|
-
padding?: string;
|
|
292
|
-
borderRadius?: number | string;
|
|
293
|
-
maxWidth?: number | string;
|
|
294
|
-
bottom?: number | string;
|
|
295
|
-
lineHeight?: number | string;
|
|
296
|
-
};
|
|
297
|
-
type PanoVideoControlsAppearance = {
|
|
298
|
-
background?: string;
|
|
299
|
-
color?: string;
|
|
300
|
-
accent?: string;
|
|
301
|
-
borderRadius?: number | string;
|
|
302
|
-
fontSize?: number | string;
|
|
303
|
-
padding?: string;
|
|
304
|
-
};
|
|
305
|
-
type PanoVideoErrorSource = "poster" | "video" | "track";
|
|
306
|
-
type PanoVideoErrorEvent = {
|
|
307
|
-
source: PanoVideoErrorSource;
|
|
308
|
-
error: unknown;
|
|
309
|
-
};
|
|
310
|
-
type PanoVideoPlaybackSnapshot = {
|
|
311
|
-
ready: boolean;
|
|
312
|
-
playing: boolean;
|
|
313
|
-
blocked: boolean;
|
|
314
|
-
ended: boolean;
|
|
315
|
-
currentTime: number;
|
|
316
|
-
duration: number;
|
|
317
|
-
volume: number;
|
|
318
|
-
/** False when the element ignores `volume` (iOS Safari). Mute still works. */
|
|
319
|
-
volumeAdjustable: boolean;
|
|
320
|
-
muted: boolean;
|
|
321
|
-
playbackRate: number;
|
|
322
|
-
variantId: string;
|
|
323
|
-
variants: readonly PanoVideoVariant[];
|
|
324
|
-
trackId: string | null;
|
|
325
|
-
tracks: readonly PanoVideoTrack[];
|
|
326
|
-
captionText: string;
|
|
327
|
-
captionAppearance: Required<PanoVideoCaptionAppearance>;
|
|
328
|
-
captionsEnabled: boolean;
|
|
329
|
-
playbackRates: readonly number[];
|
|
330
|
-
playbackState: VideoPlaybackState;
|
|
331
|
-
};
|
|
332
|
-
type PanoVideoController = {
|
|
333
|
-
subscribe: (onStoreChange: () => void) => () => void;
|
|
334
|
-
getSnapshot: () => PanoVideoPlaybackSnapshot;
|
|
335
|
-
play: () => Promise<void>;
|
|
336
|
-
pause: () => void;
|
|
337
|
-
togglePlay: () => void;
|
|
338
|
-
seek: (time: number) => void;
|
|
339
|
-
setVolume: (volume: number) => void;
|
|
340
|
-
setMuted: (muted: boolean) => void;
|
|
341
|
-
toggleMuted: () => void;
|
|
342
|
-
setPlaybackRate: (rate: number) => void;
|
|
343
|
-
setVariantId: (id: string) => void;
|
|
344
|
-
setTrackId: (id: string | null) => void;
|
|
345
|
-
setCaptionAppearance: (appearance: Partial<PanoVideoCaptionAppearance>) => void;
|
|
346
|
-
};
|
|
347
|
-
|
|
242
|
+
type WebVRInteractionMode = "auto" | "gaze" | "pointer";
|
|
243
|
+
type WebVRInputState = Readonly<{
|
|
244
|
+
mode: "gaze" | "pointer" | "paused" | null;
|
|
245
|
+
source: "head" | "controller" | "hand" | "system" | null;
|
|
246
|
+
}>;
|
|
348
247
|
type WebVRMode = "webxr" | "mobilevr" | "fake";
|
|
349
248
|
type WebVRProfileId = "none" | "cardboard-v1" | "cardboard-v2" | "gear-vr" | "daydream";
|
|
350
249
|
type WebVRProfile = {
|
|
@@ -377,11 +276,14 @@ type WebVRChromeAppearance = {
|
|
|
377
276
|
};
|
|
378
277
|
type WebVRChrome = boolean | WebVRChromeAppearance;
|
|
379
278
|
type WebVRState = {
|
|
279
|
+
input?: WebVRInputState;
|
|
380
280
|
available: boolean;
|
|
381
281
|
enabled: boolean;
|
|
382
282
|
mode: WebVRMode | null;
|
|
383
283
|
};
|
|
384
284
|
type WebVRProps = {
|
|
285
|
+
/** Input policy; auto uses explicit selection in WebXR and dwell in fallback VR. */
|
|
286
|
+
interactionMode?: WebVRInteractionMode;
|
|
385
287
|
/**
|
|
386
288
|
* Mount the built-in session chrome (Exit VR / MobileVR Setup). Defaults to
|
|
387
289
|
* true. Enter VR is not rendered; host apps drive entry through the handle
|
|
@@ -451,7 +353,8 @@ type WebVRProps = {
|
|
|
451
353
|
wakelock?: boolean;
|
|
452
354
|
/**
|
|
453
355
|
* Lock the mouse in simulated desktop VR so movement looks around with
|
|
454
|
-
* no visible cursor.
|
|
356
|
+
* no visible cursor. Right-click to release; left-click the view to re-lock.
|
|
357
|
+
* While unlocked, the reticle and gaze actions are paused. Defaults to true.
|
|
455
358
|
*/
|
|
456
359
|
mousePointerLock?: boolean;
|
|
457
360
|
onAvailable?: () => void;
|
|
@@ -471,7 +374,7 @@ type WebVRHandle = {
|
|
|
471
374
|
getState: () => WebVRState;
|
|
472
375
|
subscribe: (onStoreChange: () => void) => () => void;
|
|
473
376
|
requestPermission: () => Promise<boolean>;
|
|
474
|
-
/**
|
|
377
|
+
/** Reset the active fallback mode, or both modes outside VR; explicit props still apply. */
|
|
475
378
|
resetSettings: () => void;
|
|
476
379
|
};
|
|
477
380
|
type WebVRSettings = {
|
|
@@ -479,6 +382,147 @@ type WebVRSettings = {
|
|
|
479
382
|
profileId: WebVRProfileId;
|
|
480
383
|
};
|
|
481
384
|
|
|
385
|
+
type PanoSpatialControlAdapter = {
|
|
386
|
+
/** Degrees. Update the existing model viewing controls, not the panorama camera. */
|
|
387
|
+
rotateBy?: (yaw: number, pitch: number) => void;
|
|
388
|
+
/** Multiplicative viewing scale; values above one zoom in. */
|
|
389
|
+
zoomBy?: (factor: number) => void;
|
|
390
|
+
resetView?: () => void;
|
|
391
|
+
canExecute?: (action: string) => boolean;
|
|
392
|
+
/** Canvas frames must be copied after the host renderer finishes rendering. */
|
|
393
|
+
subscribeFrame?: (invalidate: () => void) => () => void;
|
|
394
|
+
/** A texture must belong to this viewer's WebGL context. */
|
|
395
|
+
texture?: Texture;
|
|
396
|
+
};
|
|
397
|
+
|
|
398
|
+
type PanoMediaController = Pick<PanoVideoController, "subscribe" | "play" | "pause" | "seek" | "setVolume" | "setMuted"> & {
|
|
399
|
+
getSnapshot: () => Pick<PanoVideoPlaybackSnapshot, "ready" | "playing" | "currentTime" | "duration" | "volume" | "volumeAdjustable" | "muted">;
|
|
400
|
+
};
|
|
401
|
+
type PanoControlAction = {
|
|
402
|
+
id: string;
|
|
403
|
+
label: string;
|
|
404
|
+
icon?: ReactNode;
|
|
405
|
+
disabled?: boolean;
|
|
406
|
+
enabled?: () => boolean;
|
|
407
|
+
activate?: () => void;
|
|
408
|
+
update?: (seconds: number) => void;
|
|
409
|
+
repeatIntervalMs?: number;
|
|
410
|
+
end?: () => void;
|
|
411
|
+
};
|
|
412
|
+
|
|
413
|
+
type VideoPlaybackState = "playing" | "paused" | "ended" | "blocked";
|
|
414
|
+
type VideoHotspotErrorEvent = {
|
|
415
|
+
id: string;
|
|
416
|
+
source: "poster" | "video";
|
|
417
|
+
error: unknown;
|
|
418
|
+
};
|
|
419
|
+
type VideoHotspotProps = HotspotCommonProps & {
|
|
420
|
+
ref?: Ref<PanoMediaController>;
|
|
421
|
+
src: string;
|
|
422
|
+
playing: boolean;
|
|
423
|
+
poster?: string;
|
|
424
|
+
loop?: boolean;
|
|
425
|
+
/** Defaults to false so manually started playback includes audio. */
|
|
426
|
+
muted?: boolean;
|
|
427
|
+
volume?: number;
|
|
428
|
+
/**
|
|
429
|
+
* Keep playback in the page. Defaults to true, including the WebKit and
|
|
430
|
+
* X5 attributes for iPhone Safari, WeChat, QQ, and UC.
|
|
431
|
+
*/
|
|
432
|
+
playsInline?: boolean;
|
|
433
|
+
preload?: "none" | "metadata" | "auto";
|
|
434
|
+
crossOrigin?: "" | "anonymous" | "use-credentials";
|
|
435
|
+
onPlaybackStateChange?: (state: VideoPlaybackState) => void;
|
|
436
|
+
onPlaybackError?: (error: unknown) => void;
|
|
437
|
+
onEnded?: () => void;
|
|
438
|
+
onError?: (event: VideoHotspotErrorEvent) => void;
|
|
439
|
+
};
|
|
440
|
+
declare function VideoHotspot({ ref, id, src, playing, poster, loop, muted, volume, playsInline, preload, crossOrigin, width, height, opacity, onPlaybackStateChange, onPlaybackError, onEnded, onError, ...anchorProps }: VideoHotspotProps): react.JSX.Element;
|
|
441
|
+
|
|
442
|
+
type PanoVideoSource = {
|
|
443
|
+
src: string;
|
|
444
|
+
type?: string;
|
|
445
|
+
};
|
|
446
|
+
type PanoVideoVariant = {
|
|
447
|
+
id: string;
|
|
448
|
+
label: string;
|
|
449
|
+
poster?: string;
|
|
450
|
+
sources: readonly PanoVideoSource[];
|
|
451
|
+
};
|
|
452
|
+
type PanoVideoTrackKind = "subtitles" | "captions";
|
|
453
|
+
type PanoVideoTrack = {
|
|
454
|
+
/** Defaults to `srcLang`. */
|
|
455
|
+
id?: string;
|
|
456
|
+
src: string;
|
|
457
|
+
srcLang: string;
|
|
458
|
+
label: string;
|
|
459
|
+
kind?: PanoVideoTrackKind;
|
|
460
|
+
default?: boolean;
|
|
461
|
+
};
|
|
462
|
+
type PanoVideoCaptionAppearance = {
|
|
463
|
+
color?: string;
|
|
464
|
+
background?: string;
|
|
465
|
+
fontSize?: number | string;
|
|
466
|
+
fontFamily?: string;
|
|
467
|
+
fontWeight?: CSSProperties["fontWeight"];
|
|
468
|
+
textShadow?: string;
|
|
469
|
+
padding?: string;
|
|
470
|
+
borderRadius?: number | string;
|
|
471
|
+
maxWidth?: number | string;
|
|
472
|
+
bottom?: number | string;
|
|
473
|
+
lineHeight?: number | string;
|
|
474
|
+
};
|
|
475
|
+
type PanoVideoControlsAppearance = {
|
|
476
|
+
background?: string;
|
|
477
|
+
color?: string;
|
|
478
|
+
accent?: string;
|
|
479
|
+
borderRadius?: number | string;
|
|
480
|
+
fontSize?: number | string;
|
|
481
|
+
padding?: string;
|
|
482
|
+
};
|
|
483
|
+
type PanoVideoErrorSource = "poster" | "video" | "track";
|
|
484
|
+
type PanoVideoErrorEvent = {
|
|
485
|
+
source: PanoVideoErrorSource;
|
|
486
|
+
error: unknown;
|
|
487
|
+
};
|
|
488
|
+
type PanoVideoPlaybackSnapshot = {
|
|
489
|
+
ready: boolean;
|
|
490
|
+
playing: boolean;
|
|
491
|
+
blocked: boolean;
|
|
492
|
+
ended: boolean;
|
|
493
|
+
currentTime: number;
|
|
494
|
+
duration: number;
|
|
495
|
+
volume: number;
|
|
496
|
+
/** False when the element ignores `volume` (iOS Safari). Mute still works. */
|
|
497
|
+
volumeAdjustable: boolean;
|
|
498
|
+
muted: boolean;
|
|
499
|
+
playbackRate: number;
|
|
500
|
+
variantId: string;
|
|
501
|
+
variants: readonly PanoVideoVariant[];
|
|
502
|
+
trackId: string | null;
|
|
503
|
+
tracks: readonly PanoVideoTrack[];
|
|
504
|
+
captionText: string;
|
|
505
|
+
captionAppearance: Required<PanoVideoCaptionAppearance>;
|
|
506
|
+
captionsEnabled: boolean;
|
|
507
|
+
playbackRates: readonly number[];
|
|
508
|
+
playbackState: VideoPlaybackState;
|
|
509
|
+
};
|
|
510
|
+
type PanoVideoController = {
|
|
511
|
+
subscribe: (onStoreChange: () => void) => () => void;
|
|
512
|
+
getSnapshot: () => PanoVideoPlaybackSnapshot;
|
|
513
|
+
play: () => Promise<void>;
|
|
514
|
+
pause: () => void;
|
|
515
|
+
togglePlay: () => void;
|
|
516
|
+
seek: (time: number) => void;
|
|
517
|
+
setVolume: (volume: number) => void;
|
|
518
|
+
setMuted: (muted: boolean) => void;
|
|
519
|
+
toggleMuted: () => void;
|
|
520
|
+
setPlaybackRate: (rate: number) => void;
|
|
521
|
+
setVariantId: (id: string) => void;
|
|
522
|
+
setTrackId: (id: string | null) => void;
|
|
523
|
+
setCaptionAppearance: (appearance: Partial<PanoVideoCaptionAppearance>) => void;
|
|
524
|
+
};
|
|
525
|
+
|
|
482
526
|
type PanoViewerState = {
|
|
483
527
|
/** Horizontal look angle in degrees. Positive values look right. */
|
|
484
528
|
yaw: number;
|
|
@@ -837,7 +881,9 @@ type PanoOverlayProps = {
|
|
|
837
881
|
/**
|
|
838
882
|
* Screen-plane DOM UI for PanoViewer. Place it as a direct child of PanoViewer
|
|
839
883
|
* (or inside a Fragment under PanoViewer). It stays outside the panorama sphere
|
|
840
|
-
* and remains visible in fullscreen
|
|
884
|
+
* and remains visible in fullscreen, but is hidden during VR sessions. Dialogs
|
|
885
|
+
* portaled to the viewer host can still render spatially. Interactive children
|
|
886
|
+
* need `pointerEvents: "auto"`.
|
|
841
887
|
*/
|
|
842
888
|
declare function PanoOverlay({ children }: PanoOverlayProps): react.JSX.Element;
|
|
843
889
|
/** Read inside PanoOverlay, renderOverlay, or their DOM descendants. */
|
|
@@ -849,6 +895,61 @@ declare function PanoOverlayPortalProvider({ container, children, }: {
|
|
|
849
895
|
container: HTMLDivElement | null;
|
|
850
896
|
children: ReactNode;
|
|
851
897
|
}): react.JSX.Element;
|
|
898
|
+
/** Shared portal/ref adapter for package and third-party dialogs. */
|
|
899
|
+
declare function usePanoDialogSurface({ open, onOpenChange, scrollTargetRef, }: {
|
|
900
|
+
open: boolean;
|
|
901
|
+
onOpenChange: (open: boolean) => void;
|
|
902
|
+
scrollTargetRef?: RefObject<HTMLElement | null>;
|
|
903
|
+
}): {
|
|
904
|
+
presentation: "screen" | "spatial";
|
|
905
|
+
contentRef: (node: HTMLElement | null) => void;
|
|
906
|
+
onInteractOutside: (event: {
|
|
907
|
+
detail: {
|
|
908
|
+
originalEvent: Event;
|
|
909
|
+
};
|
|
910
|
+
preventDefault: () => void;
|
|
911
|
+
}) => void;
|
|
912
|
+
visibleRect: {
|
|
913
|
+
left: number;
|
|
914
|
+
top: number;
|
|
915
|
+
width: number;
|
|
916
|
+
height: number;
|
|
917
|
+
};
|
|
918
|
+
/** Stable viewer-local portal target; null until the DOM has mounted. */
|
|
919
|
+
portalContainer: HTMLDivElement | null;
|
|
920
|
+
/** Available viewer space in CSS pixels, independent of nested portal targets. */
|
|
921
|
+
size: {
|
|
922
|
+
width: number;
|
|
923
|
+
height: number;
|
|
924
|
+
};
|
|
925
|
+
isFullscreen: boolean;
|
|
926
|
+
};
|
|
927
|
+
declare function usePanoSpatialControls(ref: RefObject<HTMLElement | null>, adapter: PanoSpatialControlAdapter): void;
|
|
928
|
+
/** @internal Shared by ESM/CJS dialog parts; owned by the viewer runtime. */
|
|
929
|
+
declare const PanoDialogSurfaceContext: react.Context<{
|
|
930
|
+
presentation: "screen" | "spatial";
|
|
931
|
+
contentRef: (node: HTMLElement | null) => void;
|
|
932
|
+
onInteractOutside: (event: {
|
|
933
|
+
detail: {
|
|
934
|
+
originalEvent: Event;
|
|
935
|
+
};
|
|
936
|
+
preventDefault: () => void;
|
|
937
|
+
}) => void;
|
|
938
|
+
visibleRect: {
|
|
939
|
+
left: number;
|
|
940
|
+
top: number;
|
|
941
|
+
width: number;
|
|
942
|
+
height: number;
|
|
943
|
+
};
|
|
944
|
+
/** Stable viewer-local portal target; null until the DOM has mounted. */
|
|
945
|
+
portalContainer: HTMLDivElement | null;
|
|
946
|
+
/** Available viewer space in CSS pixels, independent of nested portal targets. */
|
|
947
|
+
size: {
|
|
948
|
+
width: number;
|
|
949
|
+
height: number;
|
|
950
|
+
};
|
|
951
|
+
isFullscreen: boolean;
|
|
952
|
+
} | null>;
|
|
852
953
|
|
|
853
954
|
type PanoViewerProps = Omit<ComponentPropsWithoutRef<"div">, "children" | "onChange" | "contextMenu"> & {
|
|
854
955
|
children?: ReactNode;
|
|
@@ -888,7 +989,7 @@ type PanoViewerProps = Omit<ComponentPropsWithoutRef<"div">, "children" | "onCha
|
|
|
888
989
|
/** Canvas pixel ratio. Defaults to a capped range of 1–2. */
|
|
889
990
|
dpr?: number | [number, number];
|
|
890
991
|
};
|
|
891
|
-
declare const PanoViewer: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "children" | "
|
|
992
|
+
declare const PanoViewer: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "children" | "contextMenu" | "onChange"> & {
|
|
892
993
|
children?: ReactNode;
|
|
893
994
|
/** Viewer-local DOM UI, rendered outside the Three.js tree, including in fullscreen. */
|
|
894
995
|
renderOverlay?: (context: PanoOverlayRenderContext) => ReactNode;
|
|
@@ -1353,6 +1454,10 @@ type HotspotDefinitionBase = {
|
|
|
1353
1454
|
tooltip?: string | HotspotTooltipContent;
|
|
1354
1455
|
tooltipTrigger?: HotspotTooltipTrigger;
|
|
1355
1456
|
tooltipPlacement?: HotspotTooltipPlacement;
|
|
1457
|
+
/** Defaults to billboard, independently of the hotspot orientation. */
|
|
1458
|
+
tooltipMode?: HotspotMode;
|
|
1459
|
+
/** Defaults to inherit. Surface tooltips always scale with FOV. */
|
|
1460
|
+
tooltipScaleMode?: HotspotTooltipScaleMode;
|
|
1356
1461
|
tooltipOffset?: number;
|
|
1357
1462
|
tooltipAppearance?: HotspotTooltipAppearance;
|
|
1358
1463
|
};
|
|
@@ -1948,6 +2053,9 @@ type PanoSceneMenuAppearance = {
|
|
|
1948
2053
|
gap?: number | string;
|
|
1949
2054
|
borderRadius?: number | string;
|
|
1950
2055
|
selectionColor?: string;
|
|
2056
|
+
/** Hover and keyboard-focus border color. Defaults to `"#7dd3fc"`. */
|
|
2057
|
+
focusColor?: string;
|
|
2058
|
+
/** Shared active/hover/focus border width in pixels. Defaults to 2. */
|
|
1951
2059
|
selectionWidth?: number;
|
|
1952
2060
|
labelBackground?: string;
|
|
1953
2061
|
labelColor?: string;
|
|
@@ -1961,6 +2069,10 @@ type PanoSceneMenuProps = {
|
|
|
1961
2069
|
items: readonly PanoSceneMenuItem[];
|
|
1962
2070
|
activeId?: string | null;
|
|
1963
2071
|
onSelect?: (id: string) => void;
|
|
2072
|
+
/** Show an icon for scenes successfully displayed by this viewer. Defaults to false. */
|
|
2073
|
+
showVisited?: boolean;
|
|
2074
|
+
/** Accessible description for visited scenes; never rendered as visible text. */
|
|
2075
|
+
visitedLabel?: string;
|
|
1964
2076
|
/**
|
|
1965
2077
|
* Screen anchor. Defaults to bottom, centered on that edge, with a 12px inset.
|
|
1966
2078
|
* Corner `axis` chooses a horizontal or vertical strip.
|
|
@@ -2004,7 +2116,7 @@ type PanoSceneMenuProps = {
|
|
|
2004
2116
|
toggle?: PanoOverlayToggle;
|
|
2005
2117
|
};
|
|
2006
2118
|
declare const DEFAULT_PANO_SCENE_MENU_APPEARANCE: Required<PanoSceneMenuAppearance>;
|
|
2007
|
-
declare function PanoSceneMenu({ items, activeId, onSelect, anchor, width, height, collapsible, defaultExpanded, expanded: expandedProp, onExpandedChange, showArrows, loop, dragMotion: dragMotionProp, appearance, className, style, label, previousLabel, nextLabel, expandLabel, collapseLabel, toggle, }: PanoSceneMenuProps): react.JSX.Element;
|
|
2119
|
+
declare function PanoSceneMenu({ items, activeId, onSelect, showVisited, visitedLabel, anchor, width, height, collapsible, defaultExpanded, expanded: expandedProp, onExpandedChange, showArrows, loop, dragMotion: dragMotionProp, appearance, className, style, label, previousLabel, nextLabel, expandLabel, collapseLabel, toggle, }: PanoSceneMenuProps): react.JSX.Element;
|
|
2008
2120
|
|
|
2009
2121
|
type ViewInteractionSource = "mouse" | "touch" | "keyboard";
|
|
2010
2122
|
type PanoWheelEvent = {
|
|
@@ -2484,4 +2596,91 @@ declare function containerPointToImage(point: MapPoint, viewport: MapViewport):
|
|
|
2484
2596
|
/** Clockwise degrees from image up for a vector in container space. */
|
|
2485
2597
|
declare function headingFromVector(dx: number, dy: number): number;
|
|
2486
2598
|
|
|
2487
|
-
|
|
2599
|
+
declare function PanoControlButton({ action, children, ...props }: Omit<ComponentProps<"button">, "ref"> & {
|
|
2600
|
+
action: PanoControlAction;
|
|
2601
|
+
}): react.JSX.Element | null;
|
|
2602
|
+
type PanoControlGroupProps = Omit<ComponentProps<"div">, "children"> & {
|
|
2603
|
+
actions: readonly PanoControlAction[];
|
|
2604
|
+
children?: (actions: readonly PanoControlAction[]) => ReactNode;
|
|
2605
|
+
};
|
|
2606
|
+
declare function PanoControlGroup({ actions, children, ...props }: PanoControlGroupProps): react.JSX.Element | null;
|
|
2607
|
+
type Options = Omit<PanoControlGroupProps, "actions"> & {
|
|
2608
|
+
actions?: readonly (string | PanoControlAction)[];
|
|
2609
|
+
};
|
|
2610
|
+
declare function PanoMediaControls({ controller, seekSpeed, volumeSpeed, actions, ...props }: Options & {
|
|
2611
|
+
controller: PanoMediaController | null;
|
|
2612
|
+
seekSpeed?: number;
|
|
2613
|
+
volumeSpeed?: number;
|
|
2614
|
+
}): react.JSX.Element;
|
|
2615
|
+
declare function PanoModelControls({ adapter, rotateSpeed, zoomSpeed, actions, ...props }: Options & {
|
|
2616
|
+
adapter: PanoSpatialControlAdapter;
|
|
2617
|
+
rotateSpeed?: number;
|
|
2618
|
+
zoomSpeed?: number;
|
|
2619
|
+
}): react.JSX.Element;
|
|
2620
|
+
declare function PanoScrollControls({ targetRef, speed, repeatIntervalMs, actions, ...props }: Options & {
|
|
2621
|
+
targetRef: RefObject<HTMLElement | null>;
|
|
2622
|
+
speed?: number;
|
|
2623
|
+
repeatIntervalMs?: number;
|
|
2624
|
+
}): react.ReactPortal | null;
|
|
2625
|
+
type PanoSpatialControlsProps = {
|
|
2626
|
+
children: ReactNode;
|
|
2627
|
+
position?: {
|
|
2628
|
+
yaw: number;
|
|
2629
|
+
pitch: number;
|
|
2630
|
+
};
|
|
2631
|
+
width?: number;
|
|
2632
|
+
distance?: number;
|
|
2633
|
+
className?: string;
|
|
2634
|
+
style?: ComponentProps<"div">["style"];
|
|
2635
|
+
};
|
|
2636
|
+
/** Render inside PanoOverlay. The measured DOM stays in the viewer's fullscreen host. */
|
|
2637
|
+
declare function PanoSpatialControls({ children, position, width, distance, className, style, }: PanoSpatialControlsProps): react.ReactPortal | null;
|
|
2638
|
+
|
|
2639
|
+
/** Adapts an existing media element without owning its source or playback lifetime. */
|
|
2640
|
+
declare function usePanoMediaController(ref: RefObject<HTMLMediaElement | null>): PanoMediaController;
|
|
2641
|
+
|
|
2642
|
+
type WebVRSceneMenuAppearance = {
|
|
2643
|
+
controlColor?: string;
|
|
2644
|
+
controlBackground?: string;
|
|
2645
|
+
controlOpacity?: number;
|
|
2646
|
+
selectionColor?: string;
|
|
2647
|
+
focusColor?: string;
|
|
2648
|
+
/** Shared selected/gaze/focus outline width in reference pixels. Defaults to 4; range 0–8. */
|
|
2649
|
+
selectionWidth?: number;
|
|
2650
|
+
borderRadius?: number;
|
|
2651
|
+
labelColor?: string;
|
|
2652
|
+
labelBackground?: string;
|
|
2653
|
+
fontSize?: number;
|
|
2654
|
+
labelPlacement?: "center" | "bottom";
|
|
2655
|
+
};
|
|
2656
|
+
declare const DEFAULT_WEBVR_SCENE_MENU_APPEARANCE: Required<WebVRSceneMenuAppearance>;
|
|
2657
|
+
type WebVRSceneMenuProps = {
|
|
2658
|
+
items: readonly PanoSceneMenuItem[];
|
|
2659
|
+
activeId?: string | null;
|
|
2660
|
+
onSelect?: (id: string) => void;
|
|
2661
|
+
/** Show an icon for scenes successfully displayed by this viewer. Defaults to false. */
|
|
2662
|
+
showVisited?: boolean;
|
|
2663
|
+
/** Accessible description for visited scenes; never rendered as visible text. */
|
|
2664
|
+
visitedLabel?: string;
|
|
2665
|
+
/** Defaults to the original compact curved grid. */
|
|
2666
|
+
layout?: "compact" | "flat" | "arc";
|
|
2667
|
+
/** All mode grows the row count and ignores rows. Defaults to paged. */
|
|
2668
|
+
displayMode?: "paged" | "all";
|
|
2669
|
+
/** Arc coverage in degrees, 60–360. Defaults to 180. */
|
|
2670
|
+
arcAngle?: number;
|
|
2671
|
+
columns?: number;
|
|
2672
|
+
rows?: number;
|
|
2673
|
+
loop?: boolean;
|
|
2674
|
+
closeOnSelect?: boolean;
|
|
2675
|
+
follow?: boolean;
|
|
2676
|
+
navigationPitch?: number;
|
|
2677
|
+
distance?: number;
|
|
2678
|
+
scale?: number;
|
|
2679
|
+
fadeDurationMs?: number;
|
|
2680
|
+
showTitles?: boolean;
|
|
2681
|
+
appearance?: WebVRSceneMenuAppearance;
|
|
2682
|
+
};
|
|
2683
|
+
/** Native spatial UI. Mount beside WebVR and Scenes inside PanoViewer. */
|
|
2684
|
+
declare function WebVRSceneMenu(props: WebVRSceneMenuProps): react.JSX.Element | null;
|
|
2685
|
+
|
|
2686
|
+
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_SCENE_MENU_APPEARANCE, DEFAULT_PANO_VIDEO_CAPTION_APPEARANCE, DEFAULT_PANO_VIDEO_CONTROLS_APPEARANCE, DEFAULT_PANO_VIDEO_PLAYBACK_RATES, DEFAULT_WEBVR_CHROME_APPEARANCE, DEFAULT_WEBVR_CURSOR_DWELL_MS, DEFAULT_WEBVR_SCENE_MENU_APPEARANCE, type DiamondGraphic, EMPTY_WEBVR_STATE, 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 HotspotTooltipScaleMode, 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, PANO_OVERLAY_ALIGNS, 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 PanoControlAction, PanoControlButton, PanoControlGroup, type PanoControlGroupProps, type PanoCursor, type PanoCursors, PanoDataError, type PanoDataErrorCode, PanoDialogSurfaceContext, type PanoDragMotion, type PanoEventBus, type PanoEventListener, type PanoEventMap, type PanoEventType, PanoEvents, type PanoEventsProps, PanoFilter, type PanoFilterPreset, type PanoFilterProps, PanoMap, type PanoMapControlsDefinition, type PanoMapDefinition, type PanoMapDialogPresentation, type PanoMapEditChange, type PanoMapGradientStop, PanoMapOverlay, type PanoMapOverlayProps, type PanoMapPanelPresentation, type PanoMapPresentation, type PanoMapProps, type PanoMapSectorDefinition, type PanoMapSectorGradient, type PanoMapSpotDefinition, type PanoMediaActivationControls, type PanoMediaActivationOptions, type PanoMediaController, PanoMediaControls, PanoModelControls, PanoOverlay, type PanoOverlayAlign, type PanoOverlayAnchor, type PanoOverlayAxis, type PanoOverlayChevron, type PanoOverlayCollapseEdge, type PanoOverlayContentAlign, type PanoOverlayInset, PanoOverlayPortalProvider, type PanoOverlayProps, type PanoOverlayRenderContext, type PanoOverlayToggle, type PanoOverlayToggleState, type PanoProjectDefinition, type PanoProjectSceneDefinition, type PanoResizeEvent, PanoSceneMenu, type PanoSceneMenuAppearance, type PanoSceneMenuItem, type PanoSceneMenuLabelAlign, type PanoSceneMenuProps, PanoScrollControls, type PanoSpatialControlAdapter, PanoSpatialControls, type PanoSpatialControlsProps, 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 ResolvedOverlayAnchor, 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 WebVRFrameRate, type WebVRHandle, type WebVRInputState, type WebVRInteractionMode, type WebVRMode, type WebVRProfile, type WebVRProfileId, type WebVRProps, WebVRSceneMenu, type WebVRSceneMenuAppearance, type WebVRSceneMenuProps, type WebVRSettings, type WebVRState, clampPanoPitch, composePanoContextMenuItems, containRect, containerPointToImage, createDefaultPanoContextMenuItems, createPanoContextMenuPresets, cycleSceneId, headingFromVector, horizontalFov, hotspotAction, imagePointToContainer, isOverlayCorner, loadPanoProject, loadSceneFromJson, normalizePanoPosition, normalizePanoYaw, panoPositionToVector3, parseOverlayAnchor, parsePanoMap, parsePanoProject, projectHotspotTriggers, resolveOverlayAnchor, resolveOverlayToggleIcon, resolvePanoContextMenuEntries, resolvePanoMapAssets, resolveHotspotAssets as resolveProjectHotspotAssets, resolveProjectPopupAssets, sceneFromViewerConfig, sectorRotation, setHotspotAction, unwrapPolygonVertices, usePanoDialogSurface, usePanoEvents, usePanoMediaController, usePanoModal, usePanoOverlay, usePanoSpatialControls, usePanoViewer, validatePolygonVertices, validatePolylineVertices, vector3ToPanoPosition };
|