@contentful/experiences-visual-editor-react 1.37.1-dev-20250430T0833-06bfee1.0 → 1.37.1-dev-20250513T0700-6e8c057.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/renderApp.js CHANGED
@@ -44512,6 +44512,23 @@ const transformBoundContentValue = (variables, entityStore, binding, resolveDesi
44512
44512
  }
44513
44513
  };
44514
44514
 
44515
+ function treeVisit(initialNode, onNode) {
44516
+ // returns last used index
44517
+ const _treeVisit = (currentNode, currentIndex, currentDepth) => {
44518
+ // Copy children in case of onNode removing it as we pass the node by reference
44519
+ const children = [...currentNode.children];
44520
+ onNode(currentNode, currentIndex, currentDepth);
44521
+ let nextAvailableIndex = currentIndex + 1;
44522
+ const lastUsedIndex = currentIndex;
44523
+ for (const child of children) {
44524
+ const lastUsedIndex = _treeVisit(child, nextAvailableIndex, currentDepth + 1);
44525
+ nextAvailableIndex = lastUsedIndex + 1;
44526
+ }
44527
+ return lastUsedIndex;
44528
+ };
44529
+ _treeVisit(initialNode, 0, 0);
44530
+ }
44531
+
44515
44532
  const getDataFromTree = (tree) => {
44516
44533
  let dataSource = {};
44517
44534
  let unboundValues = {};
@@ -45011,23 +45028,6 @@ var VisualEditorMode$1;
45011
45028
  VisualEditorMode["InjectScript"] = "injectScript";
45012
45029
  })(VisualEditorMode$1 || (VisualEditorMode$1 = {}));
45013
45030
 
45014
- function treeVisit$1(initialNode, onNode) {
45015
- // returns last used index
45016
- const _treeVisit = (currentNode, currentIndex, currentDepth) => {
45017
- // Copy children in case of onNode removing it as we pass the node by reference
45018
- const children = [...currentNode.children];
45019
- onNode(currentNode, currentIndex, currentDepth);
45020
- let nextAvailableIndex = currentIndex + 1;
45021
- const lastUsedIndex = currentIndex;
45022
- for (const child of children) {
45023
- const lastUsedIndex = _treeVisit(child, nextAvailableIndex, currentDepth + 1);
45024
- nextAvailableIndex = lastUsedIndex + 1;
45025
- }
45026
- return lastUsedIndex;
45027
- };
45028
- _treeVisit(initialNode, 0, 0);
45029
- }
45030
-
45031
45031
  class DeepReference {
45032
45032
  constructor({ path, dataSource }) {
45033
45033
  const { key, field, referentField } = parseDataSourcePathWithL1DeepBindings(path);
@@ -45065,7 +45065,7 @@ class DeepReference {
45065
45065
  }
45066
45066
  function gatherDeepReferencesFromTree(startingNode, dataSource) {
45067
45067
  const deepReferences = [];
45068
- treeVisit$1(startingNode, (node) => {
45068
+ treeVisit(startingNode, (node) => {
45069
45069
  if (!node.data.props)
45070
45070
  return;
45071
45071
  for (const [, variableMapping] of Object.entries(node.data.props)) {
@@ -56642,26 +56642,6 @@ function getTreeDiffs(tree1, tree2, originalTree) {
56642
56642
  return differences.filter((diff) => diff);
56643
56643
  }
56644
56644
 
56645
- /**
56646
- * @deprecated in favor of one in 'core' package
56647
- */
56648
- function treeVisit(initialNode, onNode) {
56649
- // returns last used index
56650
- const _treeVisit = (currentNode, currentIndex, currentDepth) => {
56651
- // Copy children in case of onNode removing it as we pass the node by reference
56652
- const children = [...currentNode.children];
56653
- onNode(currentNode, currentIndex, currentDepth);
56654
- let nextAvailableIndex = currentIndex + 1;
56655
- const lastUsedIndex = currentIndex;
56656
- for (const child of children) {
56657
- const lastUsedIndex = _treeVisit(child, nextAvailableIndex, currentDepth + 1);
56658
- nextAvailableIndex = lastUsedIndex + 1;
56659
- }
56660
- return lastUsedIndex;
56661
- };
56662
- _treeVisit(initialNode, 0, 0);
56663
- }
56664
-
56665
56645
  const useTreeStore = create$1((set, get) => ({
56666
56646
  tree: {
56667
56647
  root: {
@@ -60958,7 +60938,7 @@ const VisualEditorRoot = ({ experience }) => {
60958
60938
  }
60959
60939
  SimulateDnD$1.updateDrag(e.clientX, e.clientY);
60960
60940
  sendMessage(OUTGOING_EVENTS.MouseMove, {
60961
- clientX: e.pageX,
60941
+ clientX: e.pageX - window.scrollX,
60962
60942
  clientY: e.pageY - window.scrollY,
60963
60943
  });
60964
60944
  };
@@ -60966,8 +60946,7 @@ const VisualEditorRoot = ({ experience }) => {
60966
60946
  return () => {
60967
60947
  document.removeEventListener('mousemove', onMouseMove);
60968
60948
  };
60969
- // eslint-disable-next-line react-hooks/exhaustive-deps
60970
- }, []);
60949
+ }, [setHoveringZone, setMousePosition]);
60971
60950
  if (!initialized)
60972
60951
  return null;
60973
60952
  return React$1.createElement(RootRenderer, null);