publ-echo-test 0.0.97 → 0.0.98
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.
@@ -451,13 +451,24 @@ export var findAccessibleChildrenBlocks = function (blockStructure, targetGroupI
|
|
451
451
|
if (!targetBlock || !('children' in targetBlock) || !targetBlock.children) {
|
452
452
|
return [];
|
453
453
|
}
|
454
|
-
var
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
454
|
+
var result = new Set();
|
455
|
+
var traverse = function (children) {
|
456
|
+
for (var _i = 0, children_1 = children; _i < children_1.length; _i++) {
|
457
|
+
var child = children_1[_i];
|
458
|
+
if (blockIds.includes(child.blockId)) {
|
459
|
+
result.add(child.blockId);
|
460
|
+
}
|
461
|
+
else if ('children' in child && child.children) {
|
462
|
+
var hasMatch = child.children.some(function (grandChild) {
|
463
|
+
return blockIds.includes(grandChild.blockId);
|
464
|
+
});
|
465
|
+
if (hasMatch) {
|
466
|
+
result.add(child.blockId);
|
467
|
+
}
|
468
|
+
traverse(child.children); // Continue traversing deeper
|
469
|
+
}
|
459
470
|
}
|
460
|
-
|
461
|
-
|
462
|
-
return
|
471
|
+
};
|
472
|
+
traverse(targetBlock.children);
|
473
|
+
return Array.from(result);
|
463
474
|
};
|