publ-echo 0.0.82 → 0.0.83
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.
|
@@ -40,17 +40,17 @@ var GridItem = function (_a) {
|
|
|
40
40
|
var _p = useState(false), isResizing = _p[0], setIsResizing = _p[1];
|
|
41
41
|
var elementRef = useRef(null);
|
|
42
42
|
var gridItemHeight = useResizeObserver([isDragging, isResizing]).gridItemHeight;
|
|
43
|
-
var
|
|
43
|
+
var _q = useState(false), isHovered = _q[0], setIsHovered = _q[1];
|
|
44
44
|
useEffect(function () {
|
|
45
45
|
var node = elementRef.current;
|
|
46
46
|
if (!node) {
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
49
|
var handleMouseEnter = function () {
|
|
50
|
-
|
|
50
|
+
setIsHovered(true);
|
|
51
51
|
};
|
|
52
52
|
var handleMouseLeave = function () {
|
|
53
|
-
|
|
53
|
+
setIsHovered(false);
|
|
54
54
|
};
|
|
55
55
|
node.addEventListener('mouseenter', handleMouseEnter);
|
|
56
56
|
node.addEventListener('mouseleave', handleMouseLeave);
|
|
@@ -70,7 +70,7 @@ var GridItem = function (_a) {
|
|
|
70
70
|
if (!elementRef.current || !props.onContentSizeChange) {
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
|
-
if (
|
|
73
|
+
if (isHovered) {
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
76
|
var target = elementRef.current.querySelector(".cb-text-content");
|
|
@@ -86,7 +86,7 @@ var GridItem = function (_a) {
|
|
|
86
86
|
if (newClientHeight < containerHeight) {
|
|
87
87
|
return;
|
|
88
88
|
}
|
|
89
|
-
if (
|
|
89
|
+
if (isHovered) {
|
|
90
90
|
return;
|
|
91
91
|
}
|
|
92
92
|
;
|
|
@@ -97,14 +97,14 @@ var GridItem = function (_a) {
|
|
|
97
97
|
props.onContentSizeChange(props.i, { x: x, y: y, w: w, h: h });
|
|
98
98
|
});
|
|
99
99
|
observer.observe(target, { box: 'border-box' });
|
|
100
|
-
if (
|
|
100
|
+
if (isHovered) {
|
|
101
101
|
observer.disconnect();
|
|
102
102
|
}
|
|
103
103
|
;
|
|
104
104
|
return function () {
|
|
105
105
|
observer.disconnect();
|
|
106
106
|
};
|
|
107
|
-
}, [props.i, props.w, props.h, x, y, activeResizeObserver, isDragging, isResizing]);
|
|
107
|
+
}, [props.i, props.w, props.h, x, y, activeResizeObserver, isDragging, isResizing, isHovered]);
|
|
108
108
|
// const moveDroppingItem = (prevProps: GridItemProps) => {
|
|
109
109
|
// const { droppingPosition } = props;
|
|
110
110
|
// if (!droppingPosition) return;
|