publ-echo-test 0.0.133 → 0.0.134
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.
@@ -228,21 +228,18 @@ export var addBulkToTarget = function (block, targetId, bulkBlockIds) {
|
|
228
228
|
targetBlock.children.push(bulkBlock);
|
229
229
|
return blockCopy;
|
230
230
|
};
|
231
|
-
var
|
231
|
+
var findWorkDirPath = function (block, id, path) {
|
232
232
|
if (block.type === 'COMPONENT_BLOCK') {
|
233
233
|
return null;
|
234
234
|
}
|
235
235
|
for (var _i = 0, _a = block.children; _i < _a.length; _i++) {
|
236
236
|
var child = _a[_i];
|
237
|
-
var currentPath = __spreadArray(__spreadArray([], path, true), [child.blockId], false);
|
238
|
-
if (child.type === 'COMPONENT_BLOCK') {
|
239
|
-
return currentPath;
|
240
|
-
}
|
237
|
+
var currentPath = child.type === 'COMPONENT_BLOCK' ? path : __spreadArray(__spreadArray([], path, true), [child.blockId], false);
|
241
238
|
if (child.blockId === id) {
|
242
239
|
return currentPath;
|
243
240
|
}
|
244
241
|
if ('children' in child && child.children) {
|
245
|
-
var result =
|
242
|
+
var result = findWorkDirPath(child, id, currentPath);
|
246
243
|
if (result) {
|
247
244
|
return result;
|
248
245
|
}
|
@@ -251,7 +248,7 @@ var findPath = function (block, id, path) {
|
|
251
248
|
return null;
|
252
249
|
};
|
253
250
|
export var getBlockWorkDirPath = function (block, blockId) {
|
254
|
-
var path =
|
251
|
+
var path = findWorkDirPath(block, blockId, ['/ROOT']);
|
255
252
|
return path ? path.join('/') : null;
|
256
253
|
};
|
257
254
|
export function formatBlockIdToCbId(blockId) {
|