|
@@ -11,36 +11,32 @@ function blocksGroup({ data, id }, { prevBlockData }) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- if (!this.engine.extractedGroup[id]) {
|
|
|
- const { blocks, connections } = data.blocks.reduce(
|
|
|
- (acc, block, index) => {
|
|
|
- const nextBlock = data.blocks[index + 1]?.itemId;
|
|
|
-
|
|
|
- acc.blocks[block.itemId] = {
|
|
|
- label: block.id,
|
|
|
- data: block.data,
|
|
|
- id: nextBlock ? block.itemId : id,
|
|
|
- };
|
|
|
-
|
|
|
- if (nextBlock) {
|
|
|
- const outputId = `${block.itemId}-output-1`;
|
|
|
-
|
|
|
- if (!acc.connections[outputId]) {
|
|
|
- acc.connections[outputId] = [];
|
|
|
- }
|
|
|
- acc.connections[outputId].push(nextBlock);
|
|
|
- }
|
|
|
+ const { blocks, connections } = data.blocks.reduce(
|
|
|
+ (acc, block, index) => {
|
|
|
+ const nextBlock = data.blocks[index + 1]?.itemId;
|
|
|
|
|
|
- return acc;
|
|
|
- },
|
|
|
- { blocks: {}, connections: {} }
|
|
|
- );
|
|
|
+ acc.blocks[block.itemId] = {
|
|
|
+ label: block.id,
|
|
|
+ data: block.data,
|
|
|
+ id: nextBlock ? block.itemId : id,
|
|
|
+ };
|
|
|
|
|
|
- Object.assign(this.engine.blocks, blocks);
|
|
|
- Object.assign(this.engine.connectionsMap, connections);
|
|
|
+ if (nextBlock) {
|
|
|
+ const outputId = `${block.itemId}-output-1`;
|
|
|
|
|
|
- this.engine.extractedGroup[id] = true;
|
|
|
- }
|
|
|
+ if (!acc.connections[outputId]) {
|
|
|
+ acc.connections[outputId] = [];
|
|
|
+ }
|
|
|
+ acc.connections[outputId].push(nextBlock);
|
|
|
+ }
|
|
|
+
|
|
|
+ return acc;
|
|
|
+ },
|
|
|
+ { blocks: {}, connections: {} }
|
|
|
+ );
|
|
|
+
|
|
|
+ Object.assign(this.engine.blocks, blocks);
|
|
|
+ Object.assign(this.engine.connectionsMap, connections);
|
|
|
|
|
|
resolve({
|
|
|
data: prevBlockData,
|