publ-echo-test 0.0.97 → 0.0.99
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,28 @@ 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 (block) {
|
456
|
+
if ('children' in block && block.children) {
|
457
|
+
for (var _i = 0, _a = block.children; _i < _a.length; _i++) {
|
458
|
+
var child = _a[_i];
|
459
|
+
if (blockIds.includes(child.blockId)) {
|
460
|
+
result.add(block.blockId); // Add the direct parent of matching child
|
461
|
+
}
|
462
|
+
else {
|
463
|
+
traverse(child); // Continue deeper for nested matches
|
464
|
+
}
|
465
|
+
}
|
459
466
|
}
|
460
|
-
|
461
|
-
|
462
|
-
|
467
|
+
};
|
468
|
+
for (var _i = 0, _a = targetBlock.children; _i < _a.length; _i++) {
|
469
|
+
var child = _a[_i];
|
470
|
+
if (blockIds.includes(child.blockId)) {
|
471
|
+
result.add(child.blockId); // Add direct matches
|
472
|
+
}
|
473
|
+
else {
|
474
|
+
traverse(child); // Traverse deeper
|
475
|
+
}
|
476
|
+
}
|
477
|
+
return Array.from(result);
|
463
478
|
};
|