publ-echo-test 0.0.68 → 0.0.69
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.
@@ -185,13 +185,22 @@ export var addBlockToRoot = function (blockStructure, newBlock) {
|
|
185
185
|
return block;
|
186
186
|
});
|
187
187
|
};
|
188
|
-
export var addBulkToTarget = function (blockStructure, targetId, bulkIds
|
188
|
+
export var addBulkToTarget = function (blockStructure, targetId, bulkIds // componentBlockId
|
189
|
+
) {
|
189
190
|
var structure = deepClone(blockStructure);
|
190
191
|
var targetBlock = findBlockByBlockId(structure, targetId);
|
191
192
|
if (!targetBlock || targetBlock.type !== 'GROUP_BLOCK' || !targetBlock.children) {
|
192
193
|
return blockStructure;
|
193
194
|
}
|
194
|
-
var bulkBlocks = targetBlock.children.filter(function (child) {
|
195
|
+
var bulkBlocks = targetBlock.children.filter(function (child) {
|
196
|
+
if (child.type === 'COMPONENT_BLOCK' && bulkIds.includes(child.componentBlockId.toString())) {
|
197
|
+
return true;
|
198
|
+
}
|
199
|
+
if (child.type === 'GROUP_BLOCK' && bulkIds.includes(child.blockId)) {
|
200
|
+
return true;
|
201
|
+
}
|
202
|
+
return false;
|
203
|
+
});
|
195
204
|
if (bulkBlocks.length !== bulkIds.length) {
|
196
205
|
throw new Error("Some bulkIds do not exist as children of the target block.");
|
197
206
|
}
|