publ-echo 0.0.127 → 0.0.129
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.
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useRef, useState } from "react";
|
|
3
|
-
import { zIndexMap } from "../GridLayoutEditor/group";
|
|
4
3
|
var OutsideClickHandler = function (_a) {
|
|
5
4
|
var children = _a.children, onOutsideClick = _a.onOutsideClick, onMouseEnter = _a.onMouseEnter, onMouseLeave = _a.onMouseLeave;
|
|
6
5
|
var wrapperRef = useRef(null);
|
|
@@ -87,7 +86,7 @@ var OutsideClickHandler = function (_a) {
|
|
|
87
86
|
marginLeft: "".concat(width + shadowOffset - borderThickness, "px"),
|
|
88
87
|
marginTop: "-".concat(shadowOffset, "px"),
|
|
89
88
|
pointerEvents: "none",
|
|
90
|
-
zIndex:
|
|
89
|
+
zIndex: 0,
|
|
91
90
|
} }), _jsx("div", { className: "border-bottom", style: {
|
|
92
91
|
position: "absolute",
|
|
93
92
|
transform: childDimensions.transform,
|
|
@@ -97,7 +96,7 @@ var OutsideClickHandler = function (_a) {
|
|
|
97
96
|
marginLeft: "-".concat(shadowOffset, "px"),
|
|
98
97
|
marginTop: "".concat(height + shadowOffset - borderThickness, "px"),
|
|
99
98
|
pointerEvents: "none",
|
|
100
|
-
zIndex:
|
|
99
|
+
zIndex: 0,
|
|
101
100
|
} }), _jsx("div", { className: "border-left", style: {
|
|
102
101
|
position: "absolute",
|
|
103
102
|
transform: childDimensions.transform,
|
|
@@ -107,7 +106,7 @@ var OutsideClickHandler = function (_a) {
|
|
|
107
106
|
marginLeft: "-".concat(shadowOffset, "px"),
|
|
108
107
|
marginTop: "-".concat(shadowOffset, "px"),
|
|
109
108
|
pointerEvents: "none",
|
|
110
|
-
zIndex:
|
|
109
|
+
zIndex: 0,
|
|
111
110
|
} })] }))] }));
|
|
112
111
|
};
|
|
113
112
|
export default OutsideClickHandler;
|
|
@@ -555,29 +555,22 @@ var ReactGridLayout = function (_a) {
|
|
|
555
555
|
}
|
|
556
556
|
var zOrder = (_a = block[device === "DESKTOP" ? "zOrderDesktopInternal" : "zOrderMobileInternal"]) !== null && _a !== void 0 ? _a : 0;
|
|
557
557
|
var isInsideOfEditingGroup = editingGroupAllChildren.includes(l.i);
|
|
558
|
-
console.log("id", block.blockId, "isRoot", isRoot, "isBulk", isInBulk, "isInGroup", isInGroup, "isInsideOfEditingGroup", isInsideOfEditingGroup, "editable", editable);
|
|
559
558
|
var editorZIndex = (function () {
|
|
560
559
|
if (isRoot && isInBulk) {
|
|
561
|
-
console.log("1 : ", block.blockId);
|
|
562
560
|
return zIndexMap.ROOT + z;
|
|
563
561
|
}
|
|
564
562
|
if (!isRoot && isInsideOfEditingGroup) {
|
|
565
|
-
console.log("2 : ", block.blockId);
|
|
566
563
|
return zIndexMap.CB_IN_EDITING_GROUP + z;
|
|
567
564
|
}
|
|
568
565
|
if (isRoot && editable) {
|
|
569
|
-
console.log("3 : ", block.blockId);
|
|
570
566
|
return zIndexMap.ROOT + z;
|
|
571
567
|
}
|
|
572
568
|
if (isRoot && !editable) {
|
|
573
|
-
console.log("4 : ", block.blockId);
|
|
574
569
|
return zIndexMap.ROOT + z;
|
|
575
570
|
}
|
|
576
571
|
if (!editable) {
|
|
577
|
-
console.log("5 : ", block.blockId);
|
|
578
572
|
return z;
|
|
579
573
|
}
|
|
580
|
-
console.log("6 : ", block.blockId);
|
|
581
574
|
return z;
|
|
582
575
|
})();
|
|
583
576
|
var zIndex = editorMode === "EDIT" ? editorZIndex : z;
|
|
@@ -749,6 +742,41 @@ var ReactGridLayout = function (_a) {
|
|
|
749
742
|
var parent = blockStructure
|
|
750
743
|
? findParentGroupBlock(blockStructure, block.blockId)
|
|
751
744
|
: null;
|
|
745
|
+
// Check if a layout item overlaps any of the activeRows (vertical overlap)
|
|
746
|
+
var isOverlappingActiveRows = function (item) {
|
|
747
|
+
if ((activeBlock === null || activeBlock === void 0 ? void 0 : activeBlock.type) === "COMPONENT_BLOCK") {
|
|
748
|
+
if ((parsedSelectedBlockId === null || parsedSelectedBlockId === void 0 ? void 0 : parsedSelectedBlockId.cbId) === item.i) {
|
|
749
|
+
return false;
|
|
750
|
+
}
|
|
751
|
+
if (!(activeDragItemOrSelectedItem === null || activeDragItemOrSelectedItem === void 0 ? void 0 : activeDragItemOrSelectedItem.heightFitContent)) {
|
|
752
|
+
return false;
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
if ((activeBlock === null || activeBlock === void 0 ? void 0 : activeBlock.type) === "GROUP_BLOCK") {
|
|
756
|
+
var hasFitContentCB = getShowActiveRows(activeBlock, layout);
|
|
757
|
+
if (!hasFitContentCB) {
|
|
758
|
+
return false;
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
if (!activeRows || activeRows.length === 0) {
|
|
762
|
+
return false;
|
|
763
|
+
}
|
|
764
|
+
var minActive = Math.min.apply(Math, activeRows);
|
|
765
|
+
var maxActive = Math.max.apply(Math, activeRows);
|
|
766
|
+
var itemTop = item.y;
|
|
767
|
+
var itemBottom = item.y + item.h - 1;
|
|
768
|
+
// overlap if ranges [itemTop, itemBottom] and [minActive, maxActive] intersect
|
|
769
|
+
return !(itemBottom < minActive || itemTop > maxActive);
|
|
770
|
+
};
|
|
771
|
+
var overlapsActiveRows = isOverlappingActiveRows({
|
|
772
|
+
w: groupItem.w,
|
|
773
|
+
h: groupItem.h,
|
|
774
|
+
x: groupItem.x,
|
|
775
|
+
y: groupItem.y,
|
|
776
|
+
i: block.blockId,
|
|
777
|
+
});
|
|
778
|
+
var editable = editableBlockIds.includes(Number(block.blockId));
|
|
779
|
+
var showBlockData = editable && !isInBulk && overlapsActiveRows;
|
|
752
780
|
return (_jsx(OutsideClickHandler, { onOutsideClick: onDoubleClickOutsideGroup, onMouseEnter: function () {
|
|
753
781
|
setHoveredGroupId(block.blockId);
|
|
754
782
|
}, onMouseLeave: function () {
|
|
@@ -760,6 +788,7 @@ var ReactGridLayout = function (_a) {
|
|
|
760
788
|
"grid-bulk-block": block.blockId === "BULK",
|
|
761
789
|
editing: editingGroupBlock === block.blockId,
|
|
762
790
|
selected: selectedGroupBlock === block.blockId,
|
|
791
|
+
"show-block-data": showBlockData,
|
|
763
792
|
}), z: zIndex, minZ: groupItem.minZ, zOrder: internalZOrder, zOrderInternal: parent
|
|
764
793
|
? "".concat(parent[device === "DESKTOP"
|
|
765
794
|
? "zOrderDesktopInternal"
|