publ-echo 0.0.74 → 0.0.76

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.
@@ -21,7 +21,7 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  return t;
22
22
  };
23
23
  import { jsx as _jsx } from "react/jsx-runtime";
24
- import React, { useEffect, useLayoutEffect, useRef, useState } from "react";
24
+ import React, { useEffect, useRef, useState } from "react";
25
25
  import { DraggableCore } from "../Draggable";
26
26
  import classNames from "../../external-lib/classnames";
27
27
  import { calcGridColWidth, calcGridItemPosition, calcGridItemWHPx, calcWH, calcXY, calculateCharacterWidthInDiv, clamp, resolveRowHeight, } from "./utils/calculateUtils";
@@ -41,7 +41,11 @@ var GridItem = function (_a) {
41
41
  var elementRef = useRef(null);
42
42
  var _q = useResizeObserver([isDragging, isResizing]), gridItemHeight = _q.gridItemHeight, gridItemWidth = _q.gridItemWidth;
43
43
  var _r = useState(false), isHovered = _r[0], setIsHovered = _r[1];
44
- useLayoutEffect(function () {
44
+ var isHoveredRef = useRef(isHovered);
45
+ useEffect(function () {
46
+ isHoveredRef.current = isHovered;
47
+ }, [isHovered]);
48
+ useEffect(function () {
45
49
  var node = elementRef.current;
46
50
  if (!node) {
47
51
  return;
@@ -56,9 +60,6 @@ var GridItem = function (_a) {
56
60
  };
57
61
  }, []);
58
62
  useEffect(function () {
59
- if (isHovered) {
60
- return;
61
- }
62
63
  if (isDragging || isResizing) {
63
64
  return;
64
65
  }
@@ -77,6 +78,11 @@ var GridItem = function (_a) {
77
78
  if (newClientHeight < containerHeight) {
78
79
  return;
79
80
  }
81
+ console.log(isHoveredRef.current);
82
+ if (isHoveredRef.current) {
83
+ return;
84
+ }
85
+ ;
80
86
  var _d = calcWH(getPositionParams(), { width: newClientWidth, height: newClientHeight }, x, y, 'se', props.w, props.h), w = _d.w, h = _d.h;
81
87
  props.onContentSizeChange(props.i, { x: x, y: y, w: w, h: h });
82
88
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "publ-echo",
3
- "version": "0.0.74",
3
+ "version": "0.0.76",
4
4
  "private": false,
5
5
  "main": "dist/lib/index.js",
6
6
  "types": "dist/lib/index.d.js",