publ-echo-test 0.0.234 → 0.0.235
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,10 @@ 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
146
|
var minWidth = Number(mutation.target.dataset.minWidth);
|
145
|
-
var minHeight = Number(mutation.target.dataset.minHeight);
|
147
|
+
var minHeight = Number(mutation.target.dataset.minHeight) + insetTop + insetBottom;
|
146
148
|
// If minWidth or minHeight is NaN, return early to prevent errors
|
147
149
|
if (isNaN(minWidth) || isNaN(minHeight)) {
|
148
150
|
return;
|
@@ -207,16 +209,20 @@ var GridItem = function (_a) {
|
|
207
209
|
}
|
208
210
|
var targetNode = (_a = elementRef.current) === null || _a === void 0 ? void 0 : _a.children[0].children[0].children[0];
|
209
211
|
if (!targetNode || isDragging || isResizing) {
|
212
|
+
console.log('cancelled 1');
|
210
213
|
return;
|
211
214
|
}
|
212
215
|
if (targetNode.id !== 'contentslist-box') {
|
216
|
+
console.log('cancelled 2');
|
213
217
|
return;
|
214
218
|
}
|
215
219
|
var minWidth = Number((_c = (_b = targetNode.dataset) === null || _b === void 0 ? void 0 : _b.minWidth) !== null && _c !== void 0 ? _c : 0);
|
216
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']);
|
217
223
|
var _f = calcWH(getPositionParams(), {
|
218
224
|
width: minWidth,
|
219
|
-
height: minHeight,
|
225
|
+
height: minHeight + insetTop + insetBottom,
|
220
226
|
}, x, y, 'e', props.w, props.h, false), w = _f.w, h = _f.h;
|
221
227
|
var prevW = props.w;
|
222
228
|
var prevH = props.h;
|
@@ -226,10 +232,11 @@ var GridItem = function (_a) {
|
|
226
232
|
if (prevH > h) {
|
227
233
|
h = prevH;
|
228
234
|
}
|
229
|
-
console.log('prevH:', prevH, 'h:', h, 'prevW:', prevW, 'w:', w);
|
230
235
|
if (prevH === h && prevW === w) {
|
236
|
+
console.log('cancelled 3');
|
231
237
|
return;
|
232
238
|
}
|
239
|
+
console.log('call onfitToContent');
|
233
240
|
props.onFitToContent &&
|
234
241
|
props.onFitToContent(i, w, h, x, y, { hasPaddingChanged: false });
|
235
242
|
}, [isSelected, autoResize, props.onFitToContent]);
|