publ-echo-test 0.0.99 → 0.0.101

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.
@@ -452,26 +452,29 @@ export var findAccessibleChildrenBlocks = function (blockStructure, targetGroupI
452
452
  return [];
453
453
  }
454
454
  var result = new Set();
455
- var traverse = function (block) {
455
+ var traverse = function (block, rootId) {
456
456
  if ('children' in block && block.children) {
457
457
  for (var _i = 0, _a = block.children; _i < _a.length; _i++) {
458
458
  var child = _a[_i];
459
459
  if (blockIds.includes(child.blockId)) {
460
- result.add(block.blockId); // Add the direct parent of matching child
460
+ result.add(rootId);
461
+ return true; // Stop traversal for this branch
461
462
  }
462
- else {
463
- traverse(child); // Continue deeper for nested matches
463
+ if (traverse(child, rootId)) {
464
+ result.add(rootId);
465
+ return true; // Stop traversal for this branch
464
466
  }
465
467
  }
466
468
  }
469
+ return false;
467
470
  };
468
471
  for (var _i = 0, _a = targetBlock.children; _i < _a.length; _i++) {
469
472
  var child = _a[_i];
470
473
  if (blockIds.includes(child.blockId)) {
471
- result.add(child.blockId); // Add direct matches
474
+ result.add(child.blockId);
472
475
  }
473
476
  else {
474
- traverse(child); // Traverse deeper
477
+ traverse(child, child.blockId);
475
478
  }
476
479
  }
477
480
  return Array.from(result);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "publ-echo-test",
3
- "version": "0.0.99",
3
+ "version": "0.0.101",
4
4
  "private": false,
5
5
  "main": "dist/lib/index.js",
6
6
  "types": "dist/lib/index.d.js",