@contentful/experiences-visual-editor-react 1.40.0-alpha-20250604T1545-078bcac.0 → 1.40.0-alpha-20250626T1127-cab6b9d.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 +7 -0
- package/dist/index.js.map +1 -1
- package/dist/renderApp.js +7 -0
- package/dist/renderApp.js.map +1 -1
- package/package.json +4 -4
package/dist/renderApp.js
CHANGED
|
@@ -45577,6 +45577,10 @@ const findOutermostCoordinates = (first, second) => {
|
|
|
45577
45577
|
left: Math.min(first.left, second.left),
|
|
45578
45578
|
};
|
|
45579
45579
|
};
|
|
45580
|
+
const isElementHidden = (rect) => {
|
|
45581
|
+
/** if the rect has no size and position, its element is not rendered in the DOM */
|
|
45582
|
+
return rect.width === 0 && rect.height === 0 && rect.x === 0 && rect.y === 0;
|
|
45583
|
+
};
|
|
45580
45584
|
const getElementCoordinates = (element) => {
|
|
45581
45585
|
const rect = element.getBoundingClientRect();
|
|
45582
45586
|
/**
|
|
@@ -49562,6 +49566,9 @@ const collectNodeCoordinates = (node, nodeToCoordinatesMap) => {
|
|
|
49562
49566
|
const selectedElement = document.querySelector(`[data-cf-node-id="${node.data.id}"]`);
|
|
49563
49567
|
if (selectedElement) {
|
|
49564
49568
|
const rect = getElementCoordinates(selectedElement);
|
|
49569
|
+
if (isElementHidden(rect)) {
|
|
49570
|
+
return;
|
|
49571
|
+
}
|
|
49565
49572
|
nodeToCoordinatesMap[node.data.id] = {
|
|
49566
49573
|
coordinates: {
|
|
49567
49574
|
x: rect.x + window.scrollX,
|