publ-echo-test 0.0.95 → 0.0.97

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];
@@ -629,10 +628,11 @@ var ReactGridLayout = function (_a) {
629
628
  onDoubleClickGroup && onDoubleClickGroup(e, block.blockId, type);
630
629
  };
631
630
  return (_jsx(OutsideClickHandler, { onOutsideClick: onDoubleClickOutsideGroup, children: _jsx(GroupItem, { className: classNames({
631
+ 'bulk-child-item': isInBulk,
632
632
  'grid-bulk-block': block.blockId === 'BULK',
633
633
  'editing': editingGroupBlock === block.blockId,
634
634
  'selected': selectedGroupBlock === 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, 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,
636
636
  // minH={l.minH}
637
637
  // minW={l.minW}
638
638
  // maxH={l.maxH}
@@ -644,7 +644,6 @@ var ReactGridLayout = function (_a) {
644
644
  isHiddenVisibility: isHiddenVisibility, customColWidth: colWidth, autoResize: false, children: _jsx("div", { onClick: handleClick, onDoubleClick: handleDoubleClick }) }, block.blockId) }));
645
645
  };
646
646
  var currentGroupBlocks = blockStructure ? findGroupBlocks(blockStructure, editingGroupBlock) : [];
647
- console.log('currentGroupBlocks: ', currentGroupBlocks);
648
647
  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, 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: {
649
648
  marginTop: margin[1] + "px",
650
649
  marginBottom: margin[1] + "px",
@@ -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,18 @@ 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 accessibleBlocks = targetBlock.children.filter(function (child) {
455
+ if (blockIds.includes(child.blockId))
456
+ return true;
457
+ if ('children' in child && child.children) {
458
+ return child.children.some(function (grandChild) { return blockIds.includes(grandChild.blockId); });
459
+ }
460
+ return false;
461
+ });
462
+ return accessibleBlocks.map(function (block) { return block.blockId; });
463
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "publ-echo-test",
3
- "version": "0.0.95",
3
+ "version": "0.0.97",
4
4
  "private": false,
5
5
  "main": "dist/lib/index.js",
6
6
  "types": "dist/lib/index.d.js",