publ-echo-test 0.0.64 → 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"
@@ -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.64",
3
+ "version": "0.0.65",
4
4
  "private": false,
5
5
  "main": "dist/lib/index.js",
6
6
  "types": "dist/lib/index.d.js",