publ-echo 0.0.118 → 0.0.120

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.
@@ -36,7 +36,6 @@ var GridItem = function (_a) {
36
36
  var _o = useState(), dragStart = _o[0], setDragStart = _o[1];
37
37
  var _p = useState(false), isDragging = _p[0], setIsDragging = _p[1];
38
38
  var _q = useState(false), isResizing = _q[0], setIsResizing = _q[1];
39
- var _r = useState(false), pointerEventsNone = _r[0], setPointerEventsNone = _r[1];
40
39
  var elementRef = useRef(null);
41
40
  var isSelected = (_b = elementRef.current) === null || _b === void 0 ? void 0 : _b.classList.contains('react-grid-item-selected');
42
41
  useEffect(function () {
@@ -1,6 +1,6 @@
1
- import * as React from 'react';
2
- import type { ReactElement } from 'react';
3
- import { PropsWithChildren } from '../types';
4
- import { ReactGridLayoutProps } from './types';
1
+ import * as React from "react";
2
+ import type { ReactElement } from "react";
3
+ import { PropsWithChildren } from "../types";
4
+ import { ReactGridLayoutProps } from "./types";
5
5
  declare const ReactGridLayout: ({ children, ...props }: PropsWithChildren<ReactGridLayoutProps>) => React.ReactElement;
6
6
  export default ReactGridLayout;
@@ -30,27 +30,27 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
30
30
  return to.concat(ar || Array.prototype.slice.call(from));
31
31
  };
32
32
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
33
- import * as React from 'react';
34
- import { useState, useRef, useLayoutEffect } from 'react';
35
- import classNames from '../../external-lib/classnames';
36
- import { bottom, cloneLayoutItem, compact, getAllCollisions, getBoundingArea, getLayoutItem, moveElement, noop, synchronizeLayoutWithChildren, withLayoutItem, } from './utils/renderHelpers';
37
- import { calcGridColWidth, calcXY, resolveRowHeight, } from '../GridItem/utils/calculateUtils';
38
- import GridItem from '../GridItem/GridItem';
39
- import isEqual from '../../external-lib/lodash.isEqual';
40
- import { findAllChildrenCbIds, findBlockByBlockId, findDirectChildrenBlockIds, findDirectChildrenCbIds, findGroupBlocks, findParentGroupBlock, formatCbIdToBlockId, getBlockSpecificType, zIndexMap, } from './group';
41
- import GroupItem from '../GridItem/GroupItem';
42
- import OutsideClickHandler from '../GridItem/OutsideClickHandler';
43
- var layoutClassName = 'react-grid-layout';
33
+ import * as React from "react";
34
+ import { useState, useRef, useLayoutEffect } from "react";
35
+ import classNames from "../../external-lib/classnames";
36
+ import { bottom, cloneLayoutItem, compact, getAllCollisions, getBoundingArea, getLayoutItem, moveElement, noop, synchronizeLayoutWithChildren, withLayoutItem, } from "./utils/renderHelpers";
37
+ import { calcGridColWidth, calcXY, resolveRowHeight, } from "../GridItem/utils/calculateUtils";
38
+ import GridItem from "../GridItem/GridItem";
39
+ import isEqual from "../../external-lib/lodash.isEqual";
40
+ import { findAllChildrenCbIds, findBlockByBlockId, findDirectChildrenBlockIds, findDirectChildrenCbIds, findGroupBlocks, findParentGroupBlock, formatCbIdToBlockId, getBlockSpecificType, zIndexMap, } from "./group";
41
+ import GroupItem from "../GridItem/GroupItem";
42
+ import OutsideClickHandler from "../GridItem/OutsideClickHandler";
43
+ var layoutClassName = "react-grid-layout";
44
44
  var ReactGridLayout = function (_a) {
45
45
  var children = _a.children, props = __rest(_a, ["children"]);
46
- var sectionId = props.sectionId, _b = props.autoSize, autoSize = _b === void 0 ? true : _b, _c = props.cols, cols = _c === void 0 ? 12 : _c, _d = props.className, className = _d === void 0 ? '' : _d, _e = props.style, style = _e === void 0 ? {} : _e, _f = props.draggableHandle, draggableHandle = _f === void 0 ? '' : _f, _g = props.draggableCancel, draggableCancel = _g === void 0 ? '' : _g, _h = props.containerPadding, containerPadding = _h === void 0 ? undefined : _h, _j = props.rowHeight, rowHeight = _j === void 0 ? 150 : _j, _k = props.maxRows, maxRows = _k === void 0 ? Infinity : _k, _l = props.margin, margin = _l === void 0 ? [10, 10] : _l, _m = props.isBounded, isBounded = _m === void 0 ? false : _m, _o = props.isDraggable, isDraggable = _o === void 0 ? true : _o, _p = props.isResizable, isResizable = _p === void 0 ? true : _p, _q = props.allowOverlap, allowOverlap = _q === void 0 ? false : _q, _r = props.isDroppable, isDroppable = _r === void 0 ? false : _r, _s = props.useCSSTransforms, useCSSTransforms = _s === void 0 ? true : _s, _t = props.transformScale, transformScale = _t === void 0 ? 1 : _t, _u = props.compactType, compactType = _u === void 0 ? 'vertical' : _u, _v = props.preventCollision, preventCollision = _v === void 0 ? false : _v, _w = props.droppingItem, droppingItem = _w === void 0 ? {
47
- i: '__dropping-elem__',
46
+ var sectionId = props.sectionId, _b = props.autoSize, autoSize = _b === void 0 ? true : _b, _c = props.cols, cols = _c === void 0 ? 12 : _c, _d = props.className, className = _d === void 0 ? "" : _d, _e = props.style, style = _e === void 0 ? {} : _e, _f = props.draggableHandle, draggableHandle = _f === void 0 ? "" : _f, _g = props.draggableCancel, draggableCancel = _g === void 0 ? "" : _g, _h = props.containerPadding, containerPadding = _h === void 0 ? undefined : _h, _j = props.rowHeight, rowHeight = _j === void 0 ? 150 : _j, _k = props.maxRows, maxRows = _k === void 0 ? Infinity : _k, _l = props.margin, margin = _l === void 0 ? [10, 10] : _l, _m = props.isBounded, isBounded = _m === void 0 ? false : _m, _o = props.isDraggable, isDraggable = _o === void 0 ? true : _o, _p = props.isResizable, isResizable = _p === void 0 ? true : _p, _q = props.allowOverlap, allowOverlap = _q === void 0 ? false : _q, _r = props.isDroppable, isDroppable = _r === void 0 ? false : _r, _s = props.useCSSTransforms, useCSSTransforms = _s === void 0 ? true : _s, _t = props.transformScale, transformScale = _t === void 0 ? 1 : _t, _u = props.compactType, compactType = _u === void 0 ? "vertical" : _u, _v = props.preventCollision, preventCollision = _v === void 0 ? false : _v, _w = props.droppingItem, droppingItem = _w === void 0 ? {
47
+ i: "__dropping-elem__",
48
48
  h: 1,
49
49
  w: 1,
50
50
  } : _w, // TODO fix
51
51
  _x = props.resizeHandles, // TODO fix
52
- resizeHandles = _x === void 0 ? ['se'] : _x, _y = props.width, width = _y === void 0 ? 0 : _y, resizeHandle = props.resizeHandle, _z = props.isHiddenVisibility, isHiddenVisibility = _z === void 0 ? true : _z, innerRef = props.innerRef, minNbRow = props.minNbRow, customColWidth = props.customColWidth, blockStructure = props.blockStructure, onDoubleClickGroup = props.onDoubleClickGroup, _0 = props.editingGroupBlock, editingGroupBlock = _0 === void 0 ? 'ROOT' : _0, _1 = props.selectedGroupBlock, selectedGroupBlock = _1 === void 0 ? 'ROOT' : _1, onClickGroup = props.onClickGroup, bulkIds = props.bulkIds, onDoubleClickOutsideGroup = props.onDoubleClickOutsideGroup;
53
- var device = cols === 24 ? 'DESKTOP' : 'MOBILE';
52
+ resizeHandles = _x === void 0 ? ["se"] : _x, _y = props.width, width = _y === void 0 ? 0 : _y, resizeHandle = props.resizeHandle, _z = props.isHiddenVisibility, isHiddenVisibility = _z === void 0 ? true : _z, innerRef = props.innerRef, minNbRow = props.minNbRow, customColWidth = props.customColWidth, blockStructure = props.blockStructure, onDoubleClickGroup = props.onDoubleClickGroup, _0 = props.editingGroupBlock, editingGroupBlock = _0 === void 0 ? "ROOT" : _0, _1 = props.selectedGroupBlock, selectedGroupBlock = _1 === void 0 ? "ROOT" : _1, onClickGroup = props.onClickGroup, bulkIds = props.bulkIds, onDoubleClickOutsideGroup = props.onDoubleClickOutsideGroup;
53
+ var device = cols === 24 ? "DESKTOP" : "MOBILE";
54
54
  var _2 = useState(), activeDrag = _2[0], setActiveDrag = _2[1];
55
55
  var _3 = useState(), oldDragItem = _3[0], setOldDragItem = _3[1];
56
56
  var _4 = useState(), oldLayout = _4[0], setOldLayout = _4[1];
@@ -58,7 +58,7 @@ var ReactGridLayout = function (_a) {
58
58
  var _6 = useState(), droppingDOMNode = _6[0], setDroppingDOMNode = _6[1];
59
59
  var _7 = useState(), droppingPosition = _7[0], setDroppingPosition = _7[1];
60
60
  var _8 = useState(false), isMounted = _8[0], setIsMounted = _8[1];
61
- var editorMode = props.isDraggable && props.isResizable ? 'EDIT' : 'VIEW';
61
+ var editorMode = props.isDraggable && props.isResizable ? "EDIT" : "VIEW";
62
62
  var editableBlockIds = blockStructure
63
63
  ? findDirectChildrenCbIds(blockStructure, editingGroupBlock)
64
64
  : [];
@@ -78,12 +78,12 @@ var ReactGridLayout = function (_a) {
78
78
  }, []);
79
79
  useLayoutEffect(function () {
80
80
  if (props.layout && !Array.isArray(props.layout)) {
81
- console.error('Expecting layout to be an Array but got: ', props.layout);
81
+ console.error("Expecting layout to be an Array but got: ", props.layout);
82
82
  }
83
83
  setLayout(synchronizeLayoutWithChildren(props.layout || [], children, cols, compactType, allowOverlap));
84
84
  }, [props.layout]);
85
85
  useLayoutEffect(function () {
86
- var newLayout = synchronizeLayoutWithChildren(props.layout || layout, children, props.cols || cols, props.compactType || 'vertical', props.allowOverlap);
86
+ var newLayout = synchronizeLayoutWithChildren(props.layout || layout, children, props.cols || cols, props.compactType || "vertical", props.allowOverlap);
87
87
  setLayout(newLayout);
88
88
  }, [children]);
89
89
  var getPositionParams = function () {
@@ -112,7 +112,7 @@ var ReactGridLayout = function (_a) {
112
112
  return (biggerNbRow * resolveRowHeight(rowHeight, colWidth) +
113
113
  (biggerNbRow - 1) * margin[1] +
114
114
  containerPaddingY * 2 +
115
- 'px');
115
+ "px");
116
116
  };
117
117
  var getBackgroundHeight = function () {
118
118
  if (!autoSize)
@@ -126,12 +126,12 @@ var ReactGridLayout = function (_a) {
126
126
  (biggerNbRow - 1) * margin[1] +
127
127
  containerPaddingY * 2 -
128
128
  2 * margin[1] +
129
- 'px');
129
+ "px");
130
130
  };
131
131
  var getBackgroundWidth = function () {
132
132
  if (!autoSize)
133
133
  return;
134
- return width - margin[0] * 2 + 'px';
134
+ return width - margin[0] * 2 + "px";
135
135
  };
136
136
  /**
137
137
  * When dragging starts
@@ -520,7 +520,7 @@ var ReactGridLayout = function (_a) {
520
520
  // LINK: https://legacy.reactjs.org/docs/react-api.html
521
521
  var items = React.Children.toArray(children);
522
522
  var item = items.find(function (child) {
523
- var originalKey = String(child.key).split('.$');
523
+ var originalKey = String(child.key).split(".$");
524
524
  return originalKey[1] === l.i;
525
525
  });
526
526
  var isInBulk = blockStructure &&
@@ -528,7 +528,7 @@ var ReactGridLayout = function (_a) {
528
528
  if (!item) {
529
529
  return null;
530
530
  }
531
- return (_jsx(GridItem, { w: activeDrag.w, h: activeDrag.h, x: activeDrag.x, y: activeDrag.y, z: zIndexMap.ISDRAGGING, i: activeDrag.i, className: 'placeholder', containerWidth: width, cols: cols, margin: margin, containerPadding: containerPadding || margin, maxRows: maxRows, rowHeight: rowHeight, isDraggable: false, isResizable: false, isBounded: false, useCSSTransforms: useCSSTransforms, transformScale: transformScale, autoResize: !!l.autoResize, children: item && item }));
531
+ return (_jsx(GridItem, { w: activeDrag.w, h: activeDrag.h, x: activeDrag.x, y: activeDrag.y, z: zIndexMap.ISDRAGGING, i: activeDrag.i, className: "placeholder", containerWidth: width, cols: cols, margin: margin, containerPadding: containerPadding || margin, maxRows: maxRows, rowHeight: rowHeight, isDraggable: false, isResizable: false, isBounded: false, useCSSTransforms: useCSSTransforms, transformScale: transformScale, autoResize: !!l.autoResize, children: item && item }));
532
532
  };
533
533
  /**
534
534
  * Given a grid item, set its style attributes & surround in a <Draggable>.
@@ -543,10 +543,10 @@ var ReactGridLayout = function (_a) {
543
543
  if (!l) {
544
544
  return;
545
545
  }
546
- var draggable = typeof l.isDraggable === 'boolean'
546
+ var draggable = typeof l.isDraggable === "boolean"
547
547
  ? l.isDraggable
548
548
  : !l.static && isDraggable;
549
- var resizable = typeof l.isResizable === 'boolean'
549
+ var resizable = typeof l.isResizable === "boolean"
550
550
  ? l.isResizable
551
551
  : !l.static && isResizable;
552
552
  var resizeHandlesOptions = l.resizeHandles || resizeHandles;
@@ -554,7 +554,7 @@ var ReactGridLayout = function (_a) {
554
554
  var editable = editableBlockIds.includes(Number(l.i));
555
555
  var z = l.z || 0;
556
556
  var isInBulk = blockStructure && (bulkIds === null || bulkIds === void 0 ? void 0 : bulkIds.includes(formatCbIdToBlockId(Number(l.i))));
557
- var isRoot = editingGroupBlock === 'ROOT';
557
+ var isRoot = editingGroupBlock === "ROOT";
558
558
  var block = blockStructure
559
559
  ? findBlockByBlockId(blockStructure, formatCbIdToBlockId(Number(l.i)))
560
560
  : undefined;
@@ -564,11 +564,11 @@ var ReactGridLayout = function (_a) {
564
564
  if (!block) {
565
565
  return _jsx(_Fragment, { children: "NO-BLOCK-FOUND" });
566
566
  }
567
- var zOrder = (_a = block[device === 'DESKTOP' ? 'zOrderDesktopInternal' : 'zOrderMobileInternal']) !== null && _a !== void 0 ? _a : 0;
567
+ var zOrder = (_a = block[device === "DESKTOP" ? "zOrderDesktopInternal" : "zOrderMobileInternal"]) !== null && _a !== void 0 ? _a : 0;
568
568
  var isInsideOfEditingGroup = editingGroupAllChildren.includes(l.i);
569
569
  var editorZIndex = (function () {
570
570
  if (isRoot && isInBulk) {
571
- return z;
571
+ return zIndexMap.ROOT + z;
572
572
  }
573
573
  if (!isRoot && isInsideOfEditingGroup) {
574
574
  return zIndexMap.CB_IN_EDITING_GROUP + z;
@@ -584,16 +584,16 @@ var ReactGridLayout = function (_a) {
584
584
  }
585
585
  return z;
586
586
  })();
587
- var zIndex = editorMode === 'EDIT' ? editorZIndex : z;
587
+ var zIndex = editorMode === "EDIT" ? editorZIndex : z;
588
588
  return (_jsx(GridItem, { className: classNames({
589
- 'editable-grid-item': !isRoot && editable,
590
- 'not-editable-grid-item': !isRoot && !editable,
591
- 'bulk-child-item': isInBulk,
592
- 'outside-of-editing-group': !isInsideOfEditingGroup,
589
+ "editable-grid-item": !isRoot && editable,
590
+ "not-editable-grid-item": !editable,
591
+ "bulk-child-item": isInBulk,
592
+ "outside-of-editing-group": !isInsideOfEditingGroup,
593
593
  }), z: zIndex, zOrder: l.z, zOrderInternal: parent
594
- ? "".concat(parent[device === 'DESKTOP'
595
- ? 'zOrderDesktopInternal'
596
- : 'zOrderMobileInternal'], " > ").concat(zOrder)
594
+ ? "".concat(parent[device === "DESKTOP"
595
+ ? "zOrderDesktopInternal"
596
+ : "zOrderMobileInternal"], " > ").concat(zOrder)
597
597
  : zOrder.toString(), isDraggable: editable && !isInBulk, isResizable: editable && !isInBulk, 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, onFitToContent: onFitToContentHandler, isBounded: bounded, useCSSTransforms: useCSSTransforms && isMounted, usePercentages: !isMounted, transformScale: transformScale, w: l.w, h: l.h, x: l.x, y: l.y, 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, autoResize: !!l.autoResize, children: child }, l.i));
598
598
  };
599
599
  var onDragOverHandler = function (e) {
@@ -672,12 +672,12 @@ var ReactGridLayout = function (_a) {
672
672
  if (!groupItem) {
673
673
  return _jsx(_Fragment, {});
674
674
  }
675
- var internalZOrder = (_a = block[device === 'DESKTOP' ? 'zOrderDesktopInternal' : 'zOrderMobileInternal']) !== null && _a !== void 0 ? _a : 0;
675
+ var internalZOrder = (_a = block[device === "DESKTOP" ? "zOrderDesktopInternal" : "zOrderMobileInternal"]) !== null && _a !== void 0 ? _a : 0;
676
676
  var isEditingGroup = block.blockId === editingGroupBlock;
677
677
  var type = getBlockSpecificType(block);
678
- var isRoot = editingGroupBlock === 'ROOT';
678
+ var isRoot = editingGroupBlock === "ROOT";
679
679
  var isInBulk = bulkIds === null || bulkIds === void 0 ? void 0 : bulkIds.includes(block.blockId);
680
- var isBulk = block.blockId === 'BULK';
680
+ var isBulk = block.blockId === "BULK";
681
681
  var baseZ = (function () {
682
682
  if (isBulk) {
683
683
  // groupItem.z : 그룹 내 CB중 가장 큰 zorder
@@ -692,15 +692,15 @@ var ReactGridLayout = function (_a) {
692
692
  if (isEditingGroup) {
693
693
  return zIndexMap.EDITING_GROUP;
694
694
  }
695
- if (!isRoot && type === 'GROUP_BLOCK') {
695
+ if (!isRoot && type === "GROUP_BLOCK") {
696
696
  return zIndexMap.EDITABLE_GROUP + internalZOrder;
697
697
  }
698
- if (type === 'GROUP_BLOCK') {
699
- return zIndexMap.GROUP;
698
+ if (type === "GROUP_BLOCK") {
699
+ return zIndexMap.ROOT + internalZOrder;
700
700
  }
701
701
  return -1; // NOTE: ERROR
702
702
  })();
703
- var zIndex = editorMode === 'EDIT' ? baseZ : internalZOrder;
703
+ var zIndex = editorMode === "EDIT" ? baseZ : internalZOrder;
704
704
  var handleClick = function (e) {
705
705
  onClickGroup && onClickGroup(e, block.blockId, type);
706
706
  };
@@ -715,14 +715,14 @@ var ReactGridLayout = function (_a) {
715
715
  ? findParentGroupBlock(blockStructure, block.blockId)
716
716
  : null;
717
717
  return (_jsx(OutsideClickHandler, { onOutsideClick: onDoubleClickOutsideGroup, children: _jsx(GroupItem, { className: classNames({
718
- 'bulk-child-item': isInBulk,
719
- 'grid-bulk-block': block.blockId === 'BULK',
718
+ "bulk-child-item": isInBulk,
719
+ "grid-bulk-block": block.blockId === "BULK",
720
720
  editing: editingGroupBlock === block.blockId,
721
721
  selected: selectedGroupBlock === block.blockId,
722
722
  }), z: zIndex, minZ: groupItem.minZ, zOrder: internalZOrder, zOrderInternal: parent
723
- ? "".concat(parent[device === 'DESKTOP'
724
- ? 'zOrderDesktopInternal'
725
- : 'zOrderMobileInternal'], " > ").concat(internalZOrder)
723
+ ? "".concat(parent[device === "DESKTOP"
724
+ ? "zOrderDesktopInternal"
725
+ : "zOrderMobileInternal"], " > ").concat(internalZOrder)
726
726
  : internalZOrder.toString(), containerWidth: width, cols: cols, margin: margin, containerPadding: containerPadding || margin, maxRows: maxRows, rowHeight: rowHeight, cancel: draggableCancel, handle: draggableHandle, onDragStop: onDragStopGroupHandler, onDragStart: onDragStartHandler, onDrag: onDragHandler, onResizeStart: onResizeStartHandler, onResize: onResizeHandler, onResizeStop: onResizeStopHandler, onFitToContent: onFitToContentHandler, isDraggable: !viewOnly && !isEditingGroup && !isInBulk, isResizable: !viewOnly && !isEditingGroup && !isInBulk, isBounded: false, useCSSTransforms: useCSSTransforms && isMounted, usePercentages: !isMounted, transformScale: transformScale, w: groupItem.w, h: groupItem.h, x: groupItem.x, y: groupItem.y, i: block.blockId,
727
727
  // minH={l.minH}
728
728
  // minW={l.minW}
@@ -737,11 +737,11 @@ var ReactGridLayout = function (_a) {
737
737
  var currentGroupBlocks = blockStructure
738
738
  ? findGroupBlocks(blockStructure, editingGroupBlock)
739
739
  : [];
740
- return (_jsxs("div", { ref: innerRef, className: mergedClassName, style: mergedStyle, onDrop: isDroppable ? onDropHandler : noop, onDragLeave: isDroppable ? onDragLeaveHandler : noop, onDragEnter: isDroppable ? onDragEnterHandler : noop, onDragOver: isDroppable ? onDragOverHandler : noop, "data-grid-row-height": rowHeight, "data-grid-cols": cols, "data-section-id": sectionId, children: [currentGroupBlocks.map(function (each) { return processGroup(each); }), React.Children.map(children, function (child) { return processGridItem(child); }), placeholder(), activeDrag && _jsx("div", { className: 'grid-guide-line-center' }), activeDrag && (_jsx("div", { className: 'grid-placeholder', style: {
741
- marginTop: margin[1] + 'px',
742
- marginBottom: margin[1] + 'px',
743
- marginLeft: margin[0] + 'px',
744
- marginRight: margin[0] + 'px',
745
- }, children: _jsxs("svg", { xmlns: 'http://www.w3.org/2000/svg', width: getBackgroundWidth(), height: getBackgroundHeight(), children: [_jsx("defs", { children: _jsx("pattern", { id: 'grid-pattern', height: rowHeight + margin[1], width: colWidth + margin[0], patternUnits: 'userSpaceOnUse', children: _jsx("rect", { x: 0.5, y: 0.5, className: 'grid-pattern-rect', height: rowHeight, width: colWidth }) }) }), _jsx("rect", { width: width, height: '100%', fill: 'url(#grid-pattern)' })] }) }))] }));
740
+ return (_jsxs("div", { ref: innerRef, className: mergedClassName, style: mergedStyle, onDrop: isDroppable ? onDropHandler : noop, onDragLeave: isDroppable ? onDragLeaveHandler : noop, onDragEnter: isDroppable ? onDragEnterHandler : noop, onDragOver: isDroppable ? onDragOverHandler : noop, "data-grid-row-height": rowHeight, "data-grid-cols": cols, "data-section-id": sectionId, children: [currentGroupBlocks.map(function (each) { return processGroup(each); }), React.Children.map(children, function (child) { return processGridItem(child); }), placeholder(), activeDrag && _jsx("div", { className: "grid-guide-line-center" }), activeDrag && (_jsx("div", { className: "grid-placeholder", style: {
741
+ marginTop: margin[1] + "px",
742
+ marginBottom: margin[1] + "px",
743
+ marginLeft: margin[0] + "px",
744
+ marginRight: margin[0] + "px",
745
+ }, children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: getBackgroundWidth(), height: getBackgroundHeight(), children: [_jsx("defs", { children: _jsx("pattern", { id: "grid-pattern", height: rowHeight + margin[1], width: colWidth + margin[0], patternUnits: "userSpaceOnUse", children: _jsx("rect", { x: 0.5, y: 0.5, className: "grid-pattern-rect", height: rowHeight, width: colWidth }) }) }), _jsx("rect", { width: width, height: "100%", fill: "url(#grid-pattern)" })] }) }))] }));
746
746
  };
747
747
  export default ReactGridLayout;
@@ -1,4 +1,4 @@
1
- import { ResponsiveGridLayoutProps } from "./types";
2
- import { PropsWithChildren } from "../types";
1
+ import { ResponsiveGridLayoutProps } from './types';
2
+ import { PropsWithChildren } from '../types';
3
3
  export declare const ResponsiveGridLayout: ({ children, ...props }: PropsWithChildren<ResponsiveGridLayoutProps>) => React.ReactElement;
4
4
  export default ResponsiveGridLayout;
@@ -21,11 +21,11 @@ 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 { useLayoutEffect, useRef, useState } from "react";
25
- import { cloneLayout, noop, synchronizeLayoutWithChildren, } from "./utils/renderHelpers";
26
- import { findOrGenerateResponsiveLayout, getBreakpointFromWidth, getColsFromBreakpoint, } from "./utils/responsiveUtils";
27
- import isEqual from "../../external-lib/lodash.isEqual";
28
- import ReactGridLayout from "./ReactGridLayout";
24
+ import { useLayoutEffect, useRef, useState } from 'react';
25
+ import { cloneLayout, noop, synchronizeLayoutWithChildren, } from './utils/renderHelpers';
26
+ import { findOrGenerateResponsiveLayout, getBreakpointFromWidth, getColsFromBreakpoint, } from './utils/responsiveUtils';
27
+ import isEqual from '../../external-lib/lodash.isEqual';
28
+ import ReactGridLayout from './ReactGridLayout';
29
29
  /**
30
30
  * Get a value of margin or containerPadding.
31
31
  *
@@ -44,7 +44,7 @@ export var ResponsiveGridLayout = function (_a) {
44
44
  var breakpoint = getBreakpointFromWidth(breakpoints, width);
45
45
  var colNo = getColsFromBreakpoint(breakpoint, cols);
46
46
  var compactType = props.compactType;
47
- var initialLayout = findOrGenerateResponsiveLayout(layouts, breakpoints, breakpoint, breakpoint, colNo, compactType || "vertical", false);
47
+ var initialLayout = findOrGenerateResponsiveLayout(layouts, breakpoints, breakpoint, breakpoint, colNo, compactType || 'vertical', false);
48
48
  return {
49
49
  layout: initialLayout,
50
50
  layouts: layouts,
@@ -95,8 +95,8 @@ export var ResponsiveGridLayout = function (_a) {
95
95
  breakpoints[newBreakpoint] > breakpoints[lastBreakpoint];
96
96
  var isNewLayout = layouts[newBreakpoint] == null;
97
97
  var overlap = !!props.allowOverlap && (!isNewLayout || newBreakpointIsBiggerOrEqual); // allow resize overlap only if we are going into a larger screen
98
- var layout = findOrGenerateResponsiveLayout(newLayouts, breakpoints, newBreakpoint, lastBreakpoint, newCols, compactType || "vertical", overlap);
99
- layout = synchronizeLayoutWithChildren(layout, children, newCols, compactType || "vertical", overlap);
98
+ var layout = findOrGenerateResponsiveLayout(newLayouts, breakpoints, newBreakpoint, lastBreakpoint, newCols, compactType || 'vertical', overlap);
99
+ layout = synchronizeLayoutWithChildren(layout, children, newCols, compactType || 'vertical', overlap);
100
100
  newLayouts[newBreakpoint] = layout;
101
101
  setState({
102
102
  breakpoint: newBreakpoint,
@@ -12,34 +12,34 @@ export declare function getBlockSpecificType(block: Block): "ROOT" | "BULK" | "C
12
12
  export type SectionPedigree = RootBlock;
13
13
  export type Block = ComponentBlock | GroupBlock | RootBlock;
14
14
  export type ZOrder = {
15
- [platform in 'mobile' | 'desktop']: {
15
+ [platform in "mobile" | "desktop"]: {
16
16
  [componentBlockId: string]: number;
17
17
  };
18
18
  };
19
19
  export type ComponentBlock = {
20
20
  blockId: string;
21
- type: 'COMPONENT_BLOCK';
21
+ type: "COMPONENT_BLOCK";
22
22
  zOrderDesktopInternal: number | null;
23
23
  zOrderMobileInternal: number | null;
24
24
  componentBlockId: number;
25
25
  };
26
26
  export type GroupBlock = {
27
27
  blockId: string;
28
- type: 'GROUP_BLOCK';
28
+ type: "GROUP_BLOCK";
29
29
  zOrderDesktopInternal: number | null;
30
30
  zOrderMobileInternal: number | null;
31
31
  children: (ComponentBlock | GroupBlock)[];
32
32
  };
33
33
  export type RootBlock = {
34
- blockId: 'ROOT';
35
- type: 'GROUP_BLOCK';
34
+ blockId: "ROOT";
35
+ type: "GROUP_BLOCK";
36
36
  zOrderDesktopInternal: number | null;
37
37
  zOrderMobileInternal: number | null;
38
38
  children: (ComponentBlock | GroupBlock)[];
39
39
  };
40
40
  export type BulkBlockInternal = {
41
- blockId: 'BULK';
42
- type: 'GROUP_BLOCK';
41
+ blockId: "BULK";
42
+ type: "GROUP_BLOCK";
43
43
  zOrderDesktopInternal: number;
44
44
  zOrderMobileInternal: number;
45
45
  children: (ComponentBlock | GroupBlock)[];
@@ -15,27 +15,27 @@ export var zIndexMap = {
15
15
  EDITING_GROUP: 9000,
16
16
  GROUP: 5000,
17
17
  CB: 0,
18
- ROOT: 0, //?
18
+ ROOT: 20000, //?
19
19
  };
20
20
  export function getBlockSpecificType(block) {
21
- if (block.blockId === 'ROOT') {
22
- return 'ROOT';
21
+ if (block.blockId === "ROOT") {
22
+ return "ROOT";
23
23
  }
24
- if (block.blockId === 'BULK') {
25
- return 'BULK';
24
+ if (block.blockId === "BULK") {
25
+ return "BULK";
26
26
  }
27
27
  return block.type;
28
28
  }
29
29
  var deepClone = function (blocks) { return JSON.parse(JSON.stringify(blocks)); };
30
30
  var collectChildrenCbIds = function (block, depth) {
31
31
  var ids = [];
32
- if ('children' in block && block.children) {
32
+ if ("children" in block && block.children) {
33
33
  for (var _i = 0, _a = block.children; _i < _a.length; _i++) {
34
34
  var child = _a[_i];
35
- if (child.type === 'COMPONENT_BLOCK') {
35
+ if (child.type === "COMPONENT_BLOCK") {
36
36
  ids.push(child.componentBlockId);
37
37
  }
38
- if (depth === 'deep' && child.type === 'GROUP_BLOCK') {
38
+ if (depth === "deep" && child.type === "GROUP_BLOCK") {
39
39
  ids = ids.concat(collectChildrenCbIds(child, depth));
40
40
  }
41
41
  }
@@ -44,11 +44,11 @@ var collectChildrenCbIds = function (block, depth) {
44
44
  };
45
45
  var collectChildrenBlockIds = function (block, depth) {
46
46
  var ids = [];
47
- if ('children' in block && block.children) {
47
+ if ("children" in block && block.children) {
48
48
  for (var _i = 0, _a = block.children; _i < _a.length; _i++) {
49
49
  var child = _a[_i];
50
50
  ids.push(child.blockId);
51
- if (depth === 'deep') {
51
+ if (depth === "deep") {
52
52
  ids = ids.concat(collectChildrenBlockIds(child, depth));
53
53
  }
54
54
  }
@@ -56,10 +56,10 @@ var collectChildrenBlockIds = function (block, depth) {
56
56
  return ids;
57
57
  };
58
58
  export var findBlockByBlockId = function (block, blockId) {
59
- if (block.type !== 'GROUP_BLOCK' || block.children.length === 0) {
59
+ if (block.type !== "GROUP_BLOCK" || block.children.length === 0) {
60
60
  return null;
61
61
  }
62
- if (block.blockId === 'ROOT' && blockId === 'ROOT') {
62
+ if (block.blockId === "ROOT" && blockId === "ROOT") {
63
63
  return block;
64
64
  }
65
65
  for (var _i = 0, _a = block.children; _i < _a.length; _i++) {
@@ -67,7 +67,7 @@ export var findBlockByBlockId = function (block, blockId) {
67
67
  if (child.blockId === blockId) {
68
68
  return child;
69
69
  }
70
- if (child.type === 'GROUP_BLOCK' && child.children) {
70
+ if (child.type === "GROUP_BLOCK" && child.children) {
71
71
  var found = findBlockByBlockId(child, blockId);
72
72
  if (found) {
73
73
  return found;
@@ -78,31 +78,31 @@ export var findBlockByBlockId = function (block, blockId) {
78
78
  };
79
79
  export var findDirectChildrenCbIds = function (block, targetId) {
80
80
  var targetBlock = findBlockByBlockId(block, targetId);
81
- if (!targetBlock || targetBlock.type !== 'GROUP_BLOCK') {
81
+ if (!targetBlock || targetBlock.type !== "GROUP_BLOCK") {
82
82
  return [];
83
83
  }
84
- return collectChildrenCbIds(targetBlock, 'current');
84
+ return collectChildrenCbIds(targetBlock, "current");
85
85
  };
86
86
  export var findAllChildrenCbIds = function (block, targetId) {
87
87
  var targetBlock = findBlockByBlockId(block, targetId);
88
- if (!targetBlock || targetBlock.type !== 'GROUP_BLOCK') {
88
+ if (!targetBlock || targetBlock.type !== "GROUP_BLOCK") {
89
89
  return [];
90
90
  }
91
- return collectChildrenCbIds(targetBlock, 'deep');
91
+ return collectChildrenCbIds(targetBlock, "deep");
92
92
  };
93
93
  export var findAllChildrenBlockIds = function (block, targetId) {
94
94
  var targetBlock = findBlockByBlockId(block, targetId);
95
- if (!targetBlock || targetBlock.type !== 'GROUP_BLOCK') {
95
+ if (!targetBlock || targetBlock.type !== "GROUP_BLOCK") {
96
96
  return [];
97
97
  }
98
- return collectChildrenBlockIds(targetBlock, 'deep');
98
+ return collectChildrenBlockIds(targetBlock, "deep");
99
99
  };
100
100
  export var findDirectChildrenBlockIds = function (block, targetId) {
101
101
  var targetBlock = findBlockByBlockId(block, targetId);
102
- if (!targetBlock || targetBlock.type !== 'GROUP_BLOCK') {
102
+ if (!targetBlock || targetBlock.type !== "GROUP_BLOCK") {
103
103
  return [];
104
104
  }
105
- return collectChildrenBlockIds(targetBlock, 'current');
105
+ return collectChildrenBlockIds(targetBlock, "current");
106
106
  };
107
107
  // NOTE: 타겟과 하위 모두.
108
108
  export var findGroupBlocks = function (block, targetId) {
@@ -110,21 +110,21 @@ export var findGroupBlocks = function (block, targetId) {
110
110
  if (!targetBlock) {
111
111
  return [];
112
112
  }
113
- if (targetBlock.type !== 'GROUP_BLOCK') {
113
+ if (targetBlock.type !== "GROUP_BLOCK") {
114
114
  return [];
115
115
  }
116
- var groupBlocks = targetBlock.children.filter(function (child) { return child.type === 'GROUP_BLOCK'; });
117
- var bulkInTarget = targetBlock.children.find(function (block) { return block.blockId === 'BULK'; });
118
- if (bulkInTarget && bulkInTarget.type === 'GROUP_BLOCK') {
119
- var groupInBulk = bulkInTarget.children.filter(function (child) { return child.type === 'GROUP_BLOCK'; });
120
- if (targetBlock.blockId === 'ROOT') {
116
+ var groupBlocks = targetBlock.children.filter(function (child) { return child.type === "GROUP_BLOCK"; });
117
+ var bulkInTarget = targetBlock.children.find(function (block) { return block.blockId === "BULK"; });
118
+ if (bulkInTarget && bulkInTarget.type === "GROUP_BLOCK") {
119
+ var groupInBulk = bulkInTarget.children.filter(function (child) { return child.type === "GROUP_BLOCK"; });
120
+ if (targetBlock.blockId === "ROOT") {
121
121
  return groupBlocks.concat(groupInBulk);
122
122
  }
123
123
  if (groupInBulk && groupInBulk.length > 0) {
124
124
  return [targetBlock].concat(groupBlocks).concat(groupInBulk);
125
125
  }
126
126
  }
127
- if (targetBlock.blockId === 'ROOT') {
127
+ if (targetBlock.blockId === "ROOT") {
128
128
  return groupBlocks;
129
129
  }
130
130
  return [targetBlock].concat(groupBlocks);
@@ -180,16 +180,16 @@ export var addBulkToTarget = function (block, targetId, bulkBlockIds) {
180
180
  var blockCopy = deepClone(block);
181
181
  var targetBlock = findBlockByBlockId(blockCopy, targetId);
182
182
  if (!targetBlock ||
183
- targetBlock.type !== 'GROUP_BLOCK' ||
183
+ targetBlock.type !== "GROUP_BLOCK" ||
184
184
  !targetBlock.children) {
185
185
  return block;
186
186
  }
187
187
  var bulkBlocks = targetBlock.children.filter(function (child) {
188
- if (child.type === 'COMPONENT_BLOCK' &&
188
+ if (child.type === "COMPONENT_BLOCK" &&
189
189
  bulkBlockIds.includes(child.blockId.toString())) {
190
190
  return true;
191
191
  }
192
- if (child.type === 'GROUP_BLOCK' && bulkBlockIds.includes(child.blockId)) {
192
+ if (child.type === "GROUP_BLOCK" && bulkBlockIds.includes(child.blockId)) {
193
193
  return true;
194
194
  }
195
195
  return false;
@@ -212,8 +212,8 @@ export var addBulkToTarget = function (block, targetId, bulkBlockIds) {
212
212
  var zOrderMobileInternal = Math.max.apply(Math, zOrdersMobile);
213
213
  // Create the new bulkBlock
214
214
  var bulkBlock = {
215
- blockId: 'BULK',
216
- type: 'GROUP_BLOCK',
215
+ blockId: "BULK",
216
+ type: "GROUP_BLOCK",
217
217
  zOrderDesktopInternal: zOrderDesktopInternal,
218
218
  zOrderMobileInternal: zOrderMobileInternal,
219
219
  children: bulkBlocks,
@@ -226,7 +226,7 @@ function findPathHelper(current, targetBlockId) {
226
226
  if (current.blockId === targetBlockId) {
227
227
  return [current.blockId];
228
228
  }
229
- if ('children' in current && Array.isArray(current.children)) {
229
+ if ("children" in current && Array.isArray(current.children)) {
230
230
  for (var _i = 0, _a = current.children; _i < _a.length; _i++) {
231
231
  var child = _a[_i];
232
232
  var result = findPathHelper(child, targetBlockId);
@@ -239,7 +239,7 @@ function findPathHelper(current, targetBlockId) {
239
239
  }
240
240
  export function getBlockWorkDirPath(blockStructure, targetBlockId) {
241
241
  var path = findPathHelper(blockStructure, targetBlockId);
242
- return path ? '/' + path.join('/') : '';
242
+ return path ? "/" + path.join("/") : "";
243
243
  }
244
244
  export function formatBlockIdToCbId(blockId) {
245
245
  var match = blockId.match(/^CB_(\d+)$/);
@@ -284,22 +284,22 @@ export function formatCbIdToBlockId(cbId) {
284
284
  // };
285
285
  export function findParentGroupBlock(current, targetBlockId) {
286
286
  // 현재 블록이 그룹(또는 루트) 블록이고, 자식이 있다면 탐색합니다.
287
- if ('children' in current && Array.isArray(current.children)) {
287
+ if ("children" in current && Array.isArray(current.children)) {
288
288
  for (var _i = 0, _a = current.children; _i < _a.length; _i++) {
289
289
  var child = _a[_i];
290
290
  // 자식 중에 targetBlockId를 가진 블록이 있다면,
291
291
  if (child.blockId === targetBlockId) {
292
292
  // 현재 블록이 ROOT라면 부모가 ROOT이므로 null 반환
293
- if (current.blockId === 'ROOT') {
293
+ if (current.blockId === "ROOT") {
294
294
  return null;
295
295
  }
296
296
  // 그렇지 않다면 현재 블록이 부모 그룹 블록이므로 반환
297
- if (current.type === 'GROUP_BLOCK') {
297
+ if (current.type === "GROUP_BLOCK") {
298
298
  return current;
299
299
  }
300
300
  }
301
301
  // 만약 자식이 그룹 블록이라면 재귀적으로 탐색
302
- if (child.type === 'GROUP_BLOCK') {
302
+ if (child.type === "GROUP_BLOCK") {
303
303
  var found = findParentGroupBlock(child, targetBlockId);
304
304
  if (found !== null) {
305
305
  return found;
@@ -313,24 +313,24 @@ export function findParentGroupBlock(current, targetBlockId) {
313
313
  export function findOneComponentBlock(current, targetBlockId) {
314
314
  var targetBlock = findBlockByBlockId(current, targetBlockId);
315
315
  if (!targetBlock) {
316
- console.error('Target block not found');
316
+ console.error("Target block not found");
317
317
  return null;
318
318
  }
319
- if (targetBlock.type !== 'GROUP_BLOCK') {
320
- console.error('Target block is not a group block');
319
+ if (targetBlock.type !== "GROUP_BLOCK") {
320
+ console.error("Target block is not a group block");
321
321
  return null;
322
322
  }
323
323
  // 직속 하위에서 먼저 찾기
324
324
  for (var _i = 0, _a = targetBlock.children; _i < _a.length; _i++) {
325
325
  var child = _a[_i];
326
- if (child.type === 'COMPONENT_BLOCK') {
326
+ if (child.type === "COMPONENT_BLOCK") {
327
327
  return child.componentBlockId;
328
328
  }
329
329
  }
330
330
  // 직속 하위에 없다면 재귀적으로 찾기
331
331
  for (var _b = 0, _c = targetBlock.children; _b < _c.length; _b++) {
332
332
  var child = _c[_b];
333
- if (child.type === 'GROUP_BLOCK') {
333
+ if (child.type === "GROUP_BLOCK") {
334
334
  var found = findOneComponentBlock(child, child.blockId);
335
335
  if (found !== null) {
336
336
  return found;
@@ -1,6 +1,6 @@
1
- import React from "react";
2
- import { PropsWithChildren } from "../Draggable/types";
3
- import { ResizableProps } from "./types";
1
+ import React from 'react';
2
+ import { PropsWithChildren } from '../Draggable/types';
3
+ import { ResizableProps } from './types';
4
4
  type Props = ResizableProps;
5
5
  declare const Resizable: ({ children, axis, handleSize, lockAspectRatio, minConstraints, maxConstraints, resizeHandles, transformScale, isResizing, autoResize, colWidth, margin, ...props }: PropsWithChildren<Props>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
6
6
  export default Resizable;
@@ -31,12 +31,12 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
31
31
  };
32
32
  import { createElement as _createElement } from "react";
33
33
  import { jsx as _jsx } from "react/jsx-runtime";
34
- import React, { useEffect, useRef } from "react";
35
- import { cloneElement } from "./utils/cloneElement";
36
- import { DraggableCore } from "../Draggable";
37
- import classNames from "../../external-lib/classnames";
34
+ import React, { useEffect, useRef, } from 'react';
35
+ import { cloneElement } from './utils/cloneElement';
36
+ import { DraggableCore } from '../Draggable';
37
+ import classNames from '../../external-lib/classnames';
38
38
  var Resizable = function (_a) {
39
- var children = _a.children, _b = _a.axis, axis = _b === void 0 ? "both" : _b, _c = _a.handleSize, handleSize = _c === void 0 ? [20, 20] : _c, _d = _a.lockAspectRatio, lockAspectRatio = _d === void 0 ? false : _d, _e = _a.minConstraints, minConstraints = _e === void 0 ? [20, 20] : _e, _f = _a.maxConstraints, maxConstraints = _f === void 0 ? [Infinity, Infinity] : _f, _g = _a.resizeHandles, resizeHandles = _g === void 0 ? ["se"] : _g, _h = _a.transformScale, transformScale = _h === void 0 ? 1 : _h, isResizing = _a.isResizing, autoResize = _a.autoResize, colWidth = _a.colWidth, margin = _a.margin, props = __rest(_a, ["children", "axis", "handleSize", "lockAspectRatio", "minConstraints", "maxConstraints", "resizeHandles", "transformScale", "isResizing", "autoResize", "colWidth", "margin"]);
39
+ var children = _a.children, _b = _a.axis, axis = _b === void 0 ? 'both' : _b, _c = _a.handleSize, handleSize = _c === void 0 ? [20, 20] : _c, _d = _a.lockAspectRatio, lockAspectRatio = _d === void 0 ? false : _d, _e = _a.minConstraints, minConstraints = _e === void 0 ? [20, 20] : _e, _f = _a.maxConstraints, maxConstraints = _f === void 0 ? [Infinity, Infinity] : _f, _g = _a.resizeHandles, resizeHandles = _g === void 0 ? ['se'] : _g, _h = _a.transformScale, transformScale = _h === void 0 ? 1 : _h, isResizing = _a.isResizing, autoResize = _a.autoResize, colWidth = _a.colWidth, margin = _a.margin, props = __rest(_a, ["children", "axis", "handleSize", "lockAspectRatio", "minConstraints", "maxConstraints", "resizeHandles", "transformScale", "isResizing", "autoResize", "colWidth", "margin"]);
40
40
  var handleRefs = useRef({
41
41
  s: useRef(null),
42
42
  n: useRef(null),
@@ -87,7 +87,8 @@ var Resizable = function (_a) {
87
87
  else {
88
88
  extendedHeightRef.current = null;
89
89
  }
90
- if (shouldShrinkRef.current && (target.clientHeight < elementRef.current.clientHeight)) {
90
+ if (shouldShrinkRef.current &&
91
+ target.clientHeight < elementRef.current.clientHeight) {
91
92
  minHeight.current = target.clientHeight;
92
93
  }
93
94
  var minWidthStyle = target.computedStyleMap().get('min-width');
@@ -95,7 +96,7 @@ var Resizable = function (_a) {
95
96
  var minWidthBase = minWidthStyle.value;
96
97
  var minColWidth = (minWidthBase + margin[0]) / (colWidth + margin[0]);
97
98
  var minW = Math.ceil(minColWidth);
98
- var minWidthPx = (minW * colWidth) + ((minW - 1) * margin[0]);
99
+ var minWidthPx = minW * colWidth + (minW - 1) * margin[0];
99
100
  minWidth.current = Math.round(minWidthPx);
100
101
  }
101
102
  }, [isResizing, autoResize, children, elementRef]);
@@ -156,28 +157,28 @@ var Resizable = function (_a) {
156
157
  var resizableLeft = startPosition.current.left + (startSize.current.width - width);
157
158
  var resizableTop = startPosition.current.top + (startSize.current.height - height);
158
159
  if (deltaX < 0) {
159
- if (handleAxis === "nw" || handleAxis === "w" || handleAxis === "sw") {
160
+ if (handleAxis === 'nw' || handleAxis === 'w' || handleAxis === 'sw') {
160
161
  if (currentSumOfLeftAndWidth > startSumOfLeftAndWidth) {
161
162
  newLeft = Math.min(left, resizableLeft);
162
163
  }
163
164
  }
164
165
  }
165
166
  if (deltaY < 0) {
166
- if (handleAxis === "nw" || handleAxis === "n" || handleAxis === "ne") {
167
+ if (handleAxis === 'nw' || handleAxis === 'n' || handleAxis === 'ne') {
167
168
  if (currentSumOfTopAndHeight > startSumOfTopAndHeight) {
168
169
  newTop = Math.min(top, resizableTop);
169
170
  }
170
171
  }
171
172
  }
172
173
  if (deltaX > 0) {
173
- if (handleAxis === "nw" || handleAxis === "w" || handleAxis === "sw") {
174
+ if (handleAxis === 'nw' || handleAxis === 'w' || handleAxis === 'sw') {
174
175
  if (width >= minConstraints[0]) {
175
176
  newLeft = Math.max(left, resizableLeft);
176
177
  }
177
178
  }
178
179
  }
179
180
  if (deltaY > 0) {
180
- if (handleAxis === "nw" || handleAxis === "n" || handleAxis === "ne") {
181
+ if (handleAxis === 'nw' || handleAxis === 'n' || handleAxis === 'ne') {
181
182
  if (height >= minConstraints[1]) {
182
183
  newTop = Math.max(top, resizableTop);
183
184
  }
@@ -190,7 +191,7 @@ var Resizable = function (_a) {
190
191
  var _b, _c;
191
192
  var _d, _e, _f, _g, _h, _j;
192
193
  var node = _a.node, deltaX = _a.deltaX, deltaY = _a.deltaY;
193
- if (handlerName === "onResizeStart") {
194
+ if (handlerName === 'onResizeStart') {
194
195
  var position = { top: (_d = props.top) !== null && _d !== void 0 ? _d : 0, left: (_e = props.left) !== null && _e !== void 0 ? _e : 0 };
195
196
  startPosition.current = position;
196
197
  startSize.current = {
@@ -199,12 +200,12 @@ var Resizable = function (_a) {
199
200
  };
200
201
  resetData();
201
202
  }
202
- var canDragX = (axis === "both" || axis === "x") &&
203
- handleAxis !== "n" &&
204
- handleAxis !== "s";
205
- var canDragY = (axis === "both" || axis === "y") &&
206
- handleAxis !== "e" &&
207
- handleAxis !== "w";
203
+ var canDragX = (axis === 'both' || axis === 'x') &&
204
+ handleAxis !== 'n' &&
205
+ handleAxis !== 's';
206
+ var canDragY = (axis === 'both' || axis === 'y') &&
207
+ handleAxis !== 'e' &&
208
+ handleAxis !== 'w';
208
209
  if (!canDragX && !canDragY)
209
210
  return;
210
211
  var axisV = handleAxis[0];
@@ -222,21 +223,20 @@ var Resizable = function (_a) {
222
223
  // }
223
224
  // }
224
225
  lastHandleRectRef.current = handleRect;
225
- if (axisH === "w") {
226
+ if (axisH === 'w') {
226
227
  deltaX = -deltaX;
227
228
  }
228
- if (axisV === "n") {
229
+ if (axisV === 'n') {
229
230
  deltaY = -deltaY;
230
231
  }
231
- console.log(deltaX);
232
232
  var width = props.width + (canDragX ? deltaX / transformScale : 0);
233
233
  var height = props.height + (canDragY ? deltaY / transformScale : 0);
234
234
  var left = (_h = props === null || props === void 0 ? void 0 : props.left) !== null && _h !== void 0 ? _h : 0;
235
235
  var top = (_j = props === null || props === void 0 ? void 0 : props.top) !== null && _j !== void 0 ? _j : 0;
236
- if (axisV === "n") {
236
+ if (axisV === 'n') {
237
237
  top = top - deltaY;
238
238
  }
239
- if (axisH === "w") {
239
+ if (axisH === 'w') {
240
240
  left = left - deltaX;
241
241
  }
242
242
  _b = checkConstraints(width, height), width = _b[0], height = _b[1];
@@ -245,12 +245,12 @@ var Resizable = function (_a) {
245
245
  }
246
246
  _c = checkTopLeft(deltaX, deltaY, top, left, width, height, handleAxis), top = _c[0], left = _c[1];
247
247
  var isDimensionsChanged = width !== props.width || height !== props.height;
248
- var cb = typeof props[handlerName] === "function" ? props[handlerName] : null;
249
- var isCbSkipped = handlerName === "onResize" && !isDimensionsChanged;
248
+ var cb = typeof props[handlerName] === 'function' ? props[handlerName] : null;
249
+ var isCbSkipped = handlerName === 'onResize' && !isDimensionsChanged;
250
250
  if (cb && !isCbSkipped) {
251
251
  cb(e, { node: node, size: { width: width, height: height, top: top, left: left }, handle: handleAxis });
252
252
  }
253
- if (handlerName === "onResizeStop") {
253
+ if (handlerName === 'onResizeStop') {
254
254
  startPosition.current = null;
255
255
  startSize.current = null;
256
256
  resetData();
@@ -261,10 +261,10 @@ var Resizable = function (_a) {
261
261
  if (!handle) {
262
262
  return (_jsx("span", { className: "react-resizable-handle react-resizable-handle-".concat(handleAxis), ref: ref }));
263
263
  }
264
- if (typeof handle === "function") {
264
+ if (typeof handle === 'function') {
265
265
  return handle(handleAxis, ref);
266
266
  }
267
- var isDOMElement = typeof handle.type === "string";
267
+ var isDOMElement = typeof handle.type === 'string';
268
268
  var props = __assign({ ref: ref }, (isDOMElement ? {} : { handleAxis: handleAxis }));
269
269
  return React.cloneElement(handle, props);
270
270
  };
@@ -273,7 +273,7 @@ var Resizable = function (_a) {
273
273
  React.Children.map(children.props.children, function (child) { return child; })
274
274
  ], resizeHandles.map(function (handleAxis) {
275
275
  var ref = (handleRefs === null || handleRefs === void 0 ? void 0 : handleRefs.current) && handleRefs.current[handleAxis];
276
- return (_createElement(DraggableCore, __assign({}, draggableOpts, { nodeRef: ref, key: "resizableHandle-".concat(handleAxis), onStop: resizeHandler("onResizeStop", handleAxis), onStart: resizeHandler("onResizeStart", handleAxis), onDrag: resizeHandler("onResize", handleAxis) }), renderResizeHandle(handleAxis, ref)));
276
+ return (_createElement(DraggableCore, __assign({}, draggableOpts, { nodeRef: ref, key: "resizableHandle-".concat(handleAxis), onStop: resizeHandler('onResizeStop', handleAxis), onStart: resizeHandler('onResizeStart', handleAxis), onDrag: resizeHandler('onResize', handleAxis) }), renderResizeHandle(handleAxis, ref)));
277
277
  }), true) }));
278
278
  };
279
279
  function removeNorthHandle(axis) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "publ-echo",
3
- "version": "0.0.118",
3
+ "version": "0.0.120",
4
4
  "private": false,
5
5
  "main": "dist/lib/index.js",
6
6
  "types": "dist/lib/index.d.js",