@ericchen1990/pano-view 2.2.0 → 2.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -460,7 +460,8 @@ type PanoViewerProps = Omit<ComponentPropsWithoutRef<"div">, "children" | "onCha
460
460
  * Default context menu. `true` / omit mounts Reset view + Fullscreen;
461
461
  * `false` skips the default instance; an object merges appearance and
462
462
  * may use `items` (full replace, supports preset ids), or `prepend` /
463
- * `append` to keep the defaults and add entries.
463
+ * `append` to keep the defaults and add entries. The browser's native
464
+ * context menu is always suppressed on the viewer, including overlays.
464
465
  */
465
466
  contextMenu?: boolean | PanoContextMenuProps;
466
467
  onViewChange?: (view: PanoViewerState) => void;
@@ -486,7 +487,8 @@ declare const PanoViewer: react.ForwardRefExoticComponent<Omit<Omit<react.Detail
486
487
  * Default context menu. `true` / omit mounts Reset view + Fullscreen;
487
488
  * `false` skips the default instance; an object merges appearance and
488
489
  * may use `items` (full replace, supports preset ids), or `prepend` /
489
- * `append` to keep the defaults and add entries.
490
+ * `append` to keep the defaults and add entries. The browser's native
491
+ * context menu is always suppressed on the viewer, including overlays.
490
492
  */
491
493
  contextMenu?: boolean | PanoContextMenuProps;
492
494
  onViewChange?: (view: PanoViewerState) => void;
package/dist/index.d.ts CHANGED
@@ -460,7 +460,8 @@ type PanoViewerProps = Omit<ComponentPropsWithoutRef<"div">, "children" | "onCha
460
460
  * Default context menu. `true` / omit mounts Reset view + Fullscreen;
461
461
  * `false` skips the default instance; an object merges appearance and
462
462
  * may use `items` (full replace, supports preset ids), or `prepend` /
463
- * `append` to keep the defaults and add entries.
463
+ * `append` to keep the defaults and add entries. The browser's native
464
+ * context menu is always suppressed on the viewer, including overlays.
464
465
  */
465
466
  contextMenu?: boolean | PanoContextMenuProps;
466
467
  onViewChange?: (view: PanoViewerState) => void;
@@ -486,7 +487,8 @@ declare const PanoViewer: react.ForwardRefExoticComponent<Omit<Omit<react.Detail
486
487
  * Default context menu. `true` / omit mounts Reset view + Fullscreen;
487
488
  * `false` skips the default instance; an object merges appearance and
488
489
  * may use `items` (full replace, supports preset ids), or `prepend` /
489
- * `append` to keep the defaults and add entries.
490
+ * `append` to keep the defaults and add entries. The browser's native
491
+ * context menu is always suppressed on the viewer, including overlays.
490
492
  */
491
493
  contextMenu?: boolean | PanoContextMenuProps;
492
494
  onViewChange?: (view: PanoViewerState) => void;
package/dist/index.mjs CHANGED
@@ -4576,6 +4576,19 @@ var PanoViewer = forwardRef2(
4576
4576
  syncFullscreen();
4577
4577
  return subscribeFullscreenChange(syncFullscreen);
4578
4578
  }, []);
4579
+ useEffect12(() => {
4580
+ const root = rootRef.current;
4581
+ if (!root) {
4582
+ return;
4583
+ }
4584
+ const suppressNativeContextMenu = (event) => {
4585
+ event.preventDefault();
4586
+ };
4587
+ root.addEventListener("contextmenu", suppressNativeContextMenu, true);
4588
+ return () => {
4589
+ root.removeEventListener("contextmenu", suppressNativeContextMenu, true);
4590
+ };
4591
+ }, []);
4579
4592
  const contextMenuActions = useMemo7(
4580
4593
  () => ({
4581
4594
  reset: () => {