publ-echo-test 0.0.63 → 0.0.65

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.
@@ -37,7 +37,7 @@ import { bottom, cloneLayoutItem, compact, getAllCollisions, getBoundingArea, ge
37
37
  import { calcGridColWidth, calcXY, resolveRowHeight, } from "../GridItem/utils/calculateUtils";
38
38
  import GridItem from "../GridItem/GridItem";
39
39
  import isEqual from "../../external-lib/lodash.isEqual";
40
- import { findAllChildrenButGroup, findAllChildrenIds, findChildrenIds, findGroupBlocks, getBlockSpecificType, zIndexMap } from "./group";
40
+ import { findAllChildrenButGroup, findAllChildrenComponentIds, findChildrenIds, findGroupBlocks, getBlockSpecificType, zIndexMap } from "./group";
41
41
  import GroupItem from "../GridItem/GroupItem";
42
42
  import OutsideClickHandler from "../GridItem/OutsideClickHandler";
43
43
  var layoutClassName = "react-grid-layout";
@@ -582,7 +582,7 @@ var ReactGridLayout = function (_a) {
582
582
  if (!blockStructure) {
583
583
  return;
584
584
  }
585
- var childrenIds = findAllChildrenIds(blockStructure, block.blockId);
585
+ var childrenIds = findAllChildrenComponentIds(blockStructure, block.blockId).map(function (i) { return i.toString(); });
586
586
  var groupItem = getBoundingArea(layout, childrenIds);
587
587
  // const draggable =
588
588
  // typeof l.isDraggable === "boolean"
@@ -633,7 +633,9 @@ var ReactGridLayout = function (_a) {
633
633
  isHiddenVisibility: isHiddenVisibility, customColWidth: colWidth, autoResize: false, children: _jsx("div", { onClick: handleClick, onDoubleClick: handleDoubleClick }) }, block.blockId) }));
634
634
  };
635
635
  var currentGroupBlocks = blockStructure ? findGroupBlocks(blockStructure, editingGroupBlock) : [];
636
- console.log(currentGroupBlocks);
636
+ console.log('currentBlocks: ', currentGroupBlocks);
637
+ console.log('blockStructure: ', blockStructure);
638
+ console.log('editingGroupBlock: ', editingGroupBlock);
637
639
  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: {
638
640
  marginTop: margin[1] + "px",
639
641
  marginBottom: margin[1] + "px",
@@ -43,6 +43,7 @@ export type BulkBlockInternal = {
43
43
  export declare const findBlockById: (blocks: Block[], blockId: string) => Block | null;
44
44
  export declare const findChildrenIds: (blockStructure: Block[], targetId: string) => string[];
45
45
  export declare const findAllChildrenIds: (blockStructure: Block[], targetId: string) => string[];
46
+ export declare const findAllChildrenComponentIds: (blockStructure: Block[], targetId: string) => number[];
46
47
  export declare const findAllParentGroups: (blockStructure: Block[], targetId: string) => GroupBlock[];
47
48
  export declare const findAllChildrenButGroup: (blockStructure: Block[], targetId: string) => string[];
48
49
  export declare const findGroupBlocks: (blockStructure: Block[], targetId: string) => GroupBlock[];
@@ -71,6 +71,23 @@ export var findAllChildrenIds = function (blockStructure, targetId) {
71
71
  var targetBlock = findBlockById(blockStructure, targetId);
72
72
  return targetBlock ? collectChildrenIds(targetBlock) : [];
73
73
  };
74
+ export var findAllChildrenComponentIds = function (blockStructure, targetId) {
75
+ var collectComponentIds = function (block) {
76
+ var ids = [];
77
+ if ('children' in block && block.children) {
78
+ for (var _i = 0, _a = block.children; _i < _a.length; _i++) {
79
+ var child = _a[_i];
80
+ if (child.type === 'COMPONENT_BLOCK') {
81
+ ids.push(child.componentBlockId);
82
+ }
83
+ ids = ids.concat(collectComponentIds(child));
84
+ }
85
+ }
86
+ return ids;
87
+ };
88
+ var targetBlock = findBlockById(blockStructure, targetId);
89
+ return targetBlock ? collectComponentIds(targetBlock) : [];
90
+ };
74
91
  export var findAllParentGroups = function (blockStructure, targetId) {
75
92
  var findParentGroups = function (blocks, id, parents) {
76
93
  if (parents === void 0) { parents = []; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "publ-echo-test",
3
- "version": "0.0.63",
3
+ "version": "0.0.65",
4
4
  "private": false,
5
5
  "main": "dist/lib/index.js",
6
6
  "types": "dist/lib/index.d.js",