@contentful/experiences-visual-editor-react 3.0.1-dev-20250807T0745-c928267.0 → 3.1.0-dev-20250807T0841-78e6af6.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/dist/index.js CHANGED
@@ -2869,6 +2869,7 @@ const OUTGOING_EVENTS = {
2869
2869
  SDKFeatures: 'sdkFeatures',
2870
2870
  RequestEntities: 'REQUEST_ENTITIES',
2871
2871
  CanvasGeometryUpdated: 'canvasGeometryUpdated',
2872
+ CanvasPan: 'canvasPan',
2872
2873
  };
2873
2874
  const INCOMING_EVENTS = {
2874
2875
  RequestEditorMode: 'requestEditorMode',
@@ -4931,6 +4932,22 @@ const useCanvasGeometryUpdates = ({ tree }) => {
4931
4932
  isCurrent = false;
4932
4933
  };
4933
4934
  }, [allImages, loadedImages, debouncedUpdateGeometry]);
4935
+ // Delegate scrolling to the canvas
4936
+ useEffect(() => {
4937
+ const onWheel = (e) => {
4938
+ e.preventDefault();
4939
+ sendMessage(OUTGOING_EVENTS.CanvasPan, {
4940
+ ctrlKey: e.ctrlKey,
4941
+ metaKey: e.metaKey,
4942
+ clientX: e.clientX,
4943
+ clientY: e.clientY,
4944
+ deltaX: e.deltaX,
4945
+ deltaY: e.deltaY,
4946
+ });
4947
+ };
4948
+ document.addEventListener('wheel', onWheel, { passive: false });
4949
+ return () => document.removeEventListener('wheel', onWheel);
4950
+ }, []);
4934
4951
  };
4935
4952
 
4936
4953
  const RootRenderer = ({ inMemoryEntitiesStore }) => {