publ-echo 0.0.69 → 0.0.71

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.
@@ -32,6 +32,7 @@ import { shouldAutoResize, shouldBlockResize } from "./utils/autoResizeUtils";
32
32
  var GridItem = function (_a) {
33
33
  var children = _a.children, props = __rest(_a, ["children"]);
34
34
  var resizeHandle = props.resizeHandle, cols = props.cols, isDraggable = props.isDraggable, _b = props.transformScale, transformScale = _b === void 0 ? 1 : _b, isResizable = props.isResizable, useCSSTransforms = props.useCSSTransforms, className = props.className, _c = props.cancel, cancel = _c === void 0 ? "" : _c, _d = props.handle, handle = _d === void 0 ? "" : _d, x = props.x, y = props.y, z = props.z, w = props.w, h = props.h, _e = props.minH, minH = _e === void 0 ? 1 : _e, _f = props.minW, minW = _f === void 0 ? 1 : _f, _g = props.maxH, maxH = _g === void 0 ? Infinity : _g, _h = props.maxW, maxW = _h === void 0 ? Infinity : _h, i = props.i, _j = props.isHiddenVisibility, isHiddenVisibility = _j === void 0 ? false : _j, containerWidth = props.containerWidth, customColWidth = props.customColWidth, rowHeight = props.rowHeight, activeResizeObserver = props.activeResizeObserver;
35
+ console.log(i, activeResizeObserver);
35
36
  var shouldAutoShrink = useRef({ shouldAutoShrink: false, initialHeight: 0 });
36
37
  var _k = useState(), resizing = _k[0], setResizing = _k[1];
37
38
  var _l = useState(), dragging = _l[0], setDragging = _l[1];
@@ -40,6 +41,9 @@ var GridItem = function (_a) {
40
41
  var _p = useState(false), isResizing = _p[0], setIsResizing = _p[1];
41
42
  var elementRef = useRef(null);
42
43
  var _q = useResizeObserver([isDragging, isResizing]), contentHeight = _q.contentHeight, contentWidth = _q.contentWidth, gridItemHeight = _q.gridItemHeight, gridItemWidth = _q.gridItemWidth;
44
+ if (activeResizeObserver) {
45
+ console.log('h,w: ', contentHeight, contentWidth);
46
+ }
43
47
  useEffect(function () {
44
48
  if (isDragging || isResizing) {
45
49
  return;
@@ -59,16 +63,8 @@ var GridItem = function (_a) {
59
63
  if (newClientHeight < containerHeight) {
60
64
  return;
61
65
  }
62
- // let { w, h } = calcWH(
63
- // getPositionParams(),
64
- // { width: newClientWidth, height: newClientHeight },
65
- // x,
66
- // y,
67
- // 'se',
68
- // props.w,
69
- // props.h
70
- // );
71
- // props.onContentSizeChange(props.i, { x, y, w, h });
66
+ var _d = calcWH(getPositionParams(), { width: newClientWidth, height: newClientHeight }, x, y, 'se', props.w, props.h), w = _d.w, h = _d.h;
67
+ props.onContentSizeChange(props.i, { x: x, y: y, w: w, h: h });
72
68
  });
73
69
  observer.observe(elementRef.current.children[0].children[0].children[0], { box: 'border-box' });
74
70
  return function () {
@@ -338,7 +334,6 @@ var GridItem = function (_a) {
338
334
  callbackData.size.height = contentHeight;
339
335
  }
340
336
  if (shouldResize !== 'EXPAND' && shouldBlock === 'BLOCK-WIDTH') {
341
- // console.log('hold width', contentSize)
342
337
  callbackData.size.width = contentWidth;
343
338
  }
344
339
  if (shouldResize === 'EXPAND') {
@@ -362,6 +357,10 @@ var GridItem = function (_a) {
362
357
  callbackData.handle = 'se';
363
358
  }
364
359
  }
360
+ if (activeResizeObserver) {
361
+ console.log('shouldResize', shouldResize);
362
+ console.log('shouldBlock', shouldBlock);
363
+ }
365
364
  onResizeHandler(e, callbackData, "onResize");
366
365
  };
367
366
  /**
@@ -393,6 +393,10 @@ var ReactGridLayout = function (_a) {
393
393
  : !l.static && isResizable;
394
394
  var resizeHandlesOptions = l.resizeHandles || resizeHandles;
395
395
  var bounded = draggable && isBounded && l.isBounded !== false;
396
+ console.log('------');
397
+ console.log('i', l.i);
398
+ console.log('child.props.className', child.props.className);
399
+ console.log('------');
396
400
  return (_jsx(GridItem, { className: "i-am-grid-item", containerWidth: width, cols: cols, margin: margin, containerPadding: containerPadding || margin, maxRows: maxRows, rowHeight: rowHeight, cancel: draggableCancel, handle: draggableHandle, onDragStop: onDragStopHandler, onDragStart: onDragStartHandler, onDrag: onDragHandler, onResizeStart: onResizeStartHandler, onResize: onResizeHandler, onResizeStop: onResizeStopHandler, onContentSizeChange: onContentSizeChange, isDraggable: draggable, isResizable: resizable, isBounded: bounded, useCSSTransforms: useCSSTransforms && isMounted, usePercentages: !isMounted, transformScale: transformScale, w: l.w, h: l.h, x: l.x, y: l.y, z: l.z || 0, i: l.i, minH: l.minH, minW: l.minW, maxH: l.maxH, maxW: l.maxW, static: l.static, droppingPosition: isDroppingItem ? droppingPosition : undefined, resizeHandles: resizeHandlesOptions, resizeHandle: resizeHandle, isHiddenVisibility: isHiddenVisibility, customColWidth: colWidth, activeResizeObserver: child.props.className === 'react-grid-item-selected', children: child }, l.i));
397
401
  };
398
402
  var onDragOverHandler = function (e) {
@@ -19,6 +19,7 @@ export type LayoutItem = {
19
19
  isResizable?: boolean;
20
20
  resizeHandles?: ResizeHandleAxis[];
21
21
  isBounded?: boolean;
22
+ autoExpandOnContentChanged?: boolean;
22
23
  groupLayouts?: LayoutItem[];
23
24
  };
24
25
  export type Layout = LayoutItem[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "publ-echo",
3
- "version": "0.0.69",
3
+ "version": "0.0.71",
4
4
  "private": false,
5
5
  "main": "dist/lib/index.js",
6
6
  "types": "dist/lib/index.d.js",