publ-echo-test 0.0.96 → 0.0.98
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.
@@ -57,7 +57,6 @@ var ReactGridLayout = function (_a) {
|
|
57
57
|
var _6 = useState(), droppingDOMNode = _6[0], setDroppingDOMNode = _6[1];
|
58
58
|
var _7 = useState(), droppingPosition = _7[0], setDroppingPosition = _7[1];
|
59
59
|
var _8 = useState(false), isMounted = _8[0], setIsMounted = _8[1];
|
60
|
-
// const [selectedGroup, setSelectedGroup] = useState<string>('1');
|
61
60
|
var editableItems = blockStructure ? findChildrenComponentIds(blockStructure, editingGroupBlock) : [];
|
62
61
|
var editingGroupAllChildren = (blockStructure && editingGroupBlock) ? findAllChildrenComponentIds(blockStructure, editingGroupBlock).map(function (i) { return i.toString(); }) : [];
|
63
62
|
var _9 = useState([]), oldGroupChildren = _9[0], setOldGroupChildren = _9[1];
|
@@ -633,7 +632,7 @@ var ReactGridLayout = function (_a) {
|
|
633
632
|
'grid-bulk-block': block.blockId === 'BULK',
|
634
633
|
'editing': editingGroupBlock === block.blockId,
|
635
634
|
'selected': selectedGroupBlock === block.blockId
|
636
|
-
}), 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, isDraggable: !viewOnly && !isEditingGroup, isResizable: !viewOnly && !isEditingGroup, isBounded: false, useCSSTransforms: useCSSTransforms && isMounted, usePercentages: !isMounted, transformScale: transformScale, w: groupItem.w, h: groupItem.h, x: groupItem.x, y: groupItem.y, z: z, i: block.blockId,
|
635
|
+
}), 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, 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, z: z, i: block.blockId,
|
637
636
|
// minH={l.minH}
|
638
637
|
// minW={l.minW}
|
639
638
|
// maxH={l.maxH}
|
@@ -57,3 +57,4 @@ export declare const mapComponentBlockIdsToBlockIds: (blockStructure: Block[]) =
|
|
57
57
|
CB_ID: Record<number, string>;
|
58
58
|
BLOCK_ID: Record<string, number>;
|
59
59
|
};
|
60
|
+
export declare const findAccessibleChildrenBlocks: (blockStructure: Block[], targetGroupId: string, blockIds: string[]) => string[];
|
@@ -446,3 +446,29 @@ export var mapComponentBlockIdsToBlockIds = function (blockStructure) {
|
|
446
446
|
traverse(blockStructure);
|
447
447
|
return { CB_ID: cbToBlockMap, BLOCK_ID: blockToCbMap };
|
448
448
|
};
|
449
|
+
export var findAccessibleChildrenBlocks = function (blockStructure, targetGroupId, blockIds) {
|
450
|
+
var targetBlock = findBlockByBlockId(blockStructure, targetGroupId);
|
451
|
+
if (!targetBlock || !('children' in targetBlock) || !targetBlock.children) {
|
452
|
+
return [];
|
453
|
+
}
|
454
|
+
var result = new Set();
|
455
|
+
var traverse = function (children) {
|
456
|
+
for (var _i = 0, children_1 = children; _i < children_1.length; _i++) {
|
457
|
+
var child = children_1[_i];
|
458
|
+
if (blockIds.includes(child.blockId)) {
|
459
|
+
result.add(child.blockId);
|
460
|
+
}
|
461
|
+
else if ('children' in child && child.children) {
|
462
|
+
var hasMatch = child.children.some(function (grandChild) {
|
463
|
+
return blockIds.includes(grandChild.blockId);
|
464
|
+
});
|
465
|
+
if (hasMatch) {
|
466
|
+
result.add(child.blockId);
|
467
|
+
}
|
468
|
+
traverse(child.children); // Continue traversing deeper
|
469
|
+
}
|
470
|
+
}
|
471
|
+
};
|
472
|
+
traverse(targetBlock.children);
|
473
|
+
return Array.from(result);
|
474
|
+
};
|