publ-echo-test 0.0.238 → 0.0.241

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.
@@ -141,8 +141,8 @@ var GridItem = function (_a) {
141
141
  var isSizeChanged = mutation.attributeName === 'data-min-width' || mutation.attributeName === 'data-min-height';
142
142
  var keepWidth = true;
143
143
  var hasPaddingChanged = false;
144
- var insetTop = Number(mutation.target.dataset['data-inset-top']);
145
- var insetBottom = Number(mutation.target.dataset['data-inset-bottom']);
144
+ var insetTop = Number(mutation.target.dataset.insetTop);
145
+ var insetBottom = Number(mutation.target.dataset.insetBottom);
146
146
  var minWidth = Number(mutation.target.dataset.minWidth);
147
147
  var minHeight = Number(mutation.target.dataset.minHeight) + insetTop + insetBottom;
148
148
  // If minWidth or minHeight is NaN, return early to prevent errors
@@ -203,7 +203,7 @@ var GridItem = function (_a) {
203
203
  };
204
204
  }, [autoResize, isSelected, isDragging, isResizing, props.w, props.h, x, y]);
205
205
  useEffect(function () {
206
- var _a, _b, _c, _d, _e;
206
+ var _a, _b, _c, _d, _e, _f;
207
207
  if (!isSelected || !autoResize) {
208
208
  return;
209
209
  }
@@ -218,13 +218,14 @@ var GridItem = function (_a) {
218
218
  }
219
219
  var minWidth = Number((_c = (_b = targetNode.dataset) === null || _b === void 0 ? void 0 : _b.minWidth) !== null && _c !== void 0 ? _c : 0);
220
220
  var minHeight = Number((_e = (_d = targetNode.dataset) === null || _d === void 0 ? void 0 : _d.minHeight) !== null && _e !== void 0 ? _e : 0);
221
- var insetTop = Number(targetNode.dataset['data-inset-top']);
222
- var insetBottom = Number(targetNode.dataset['data-inset-bottom']);
223
- console.log(targetNode.dataset);
224
- var _f = calcWH(getPositionParams(), {
221
+ var insetTop = Number(targetNode.dataset.insetTop);
222
+ var insetBottom = Number(targetNode.dataset.insetBottom);
223
+ console.log('ref', (_f = elementRef.current) === null || _f === void 0 ? void 0 : _f.children[0].children[0]);
224
+ console.log(targetNode);
225
+ var _g = calcWH(getPositionParams(), {
225
226
  width: minWidth,
226
227
  height: minHeight + insetTop + insetBottom,
227
- }, x, y, 'e', props.w, props.h, false), w = _f.w, h = _f.h;
228
+ }, x, y, 'e', props.w, props.h, false), w = _g.w, h = _g.h;
228
229
  var prevW = props.w;
229
230
  var prevH = props.h;
230
231
  if (prevW > w) {
@@ -240,7 +241,7 @@ var GridItem = function (_a) {
240
241
  console.log('call onfitToContent');
241
242
  props.onFitToContent &&
242
243
  props.onFitToContent(i, w, h, x, y, { hasPaddingChanged: false });
243
- }, []);
244
+ }, [isSelected]);
244
245
  // const moveDroppingItem = (prevProps: GridItemProps) => {
245
246
  // const { droppingPosition } = props;
246
247
  // if (!droppingPosition) return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "publ-echo-test",
3
- "version": "0.0.238",
3
+ "version": "0.0.241",
4
4
  "private": false,
5
5
  "main": "dist/lib/index.js",
6
6
  "types": "dist/lib/index.d.js",