publ-echo-test 0.0.62 → 0.0.63
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.
@@ -50,4 +50,5 @@ export declare const findAllComponentBlockIds: (blockStructure: Block[]) => stri
|
|
50
50
|
export declare const findParentGroupByGroupId: (blockStructure: Block[], targetId: string) => string | null;
|
51
51
|
export declare const addBlockToRoot: (blockStructure: Block[], newBlock: Block) => Block[];
|
52
52
|
export declare const addBulkToTarget: (blockStructure: Block[], targetId: string, bulkIds: string[]) => Block[];
|
53
|
+
export declare const getBlockWorkDirPath: (blockStructure: Block[], blockId: string) => string | null;
|
53
54
|
export declare const blockStructure: Block[];
|
@@ -194,6 +194,26 @@ export var addBulkToTarget = function (blockStructure, targetId, bulkIds) {
|
|
194
194
|
targetBlock.children.push(bulkBlock);
|
195
195
|
return structure;
|
196
196
|
};
|
197
|
+
export var getBlockWorkDirPath = function (blockStructure, blockId) {
|
198
|
+
var findPath = function (blocks, id, path) {
|
199
|
+
for (var _i = 0, blocks_5 = blocks; _i < blocks_5.length; _i++) {
|
200
|
+
var block = blocks_5[_i];
|
201
|
+
var currentPath = __spreadArray(__spreadArray([], path, true), [block.blockId], false);
|
202
|
+
if (block.blockId === id) {
|
203
|
+
return currentPath;
|
204
|
+
}
|
205
|
+
if ('children' in block && block.children) {
|
206
|
+
var result = findPath(block.children, id, currentPath);
|
207
|
+
if (result) {
|
208
|
+
return result;
|
209
|
+
}
|
210
|
+
}
|
211
|
+
}
|
212
|
+
return null;
|
213
|
+
};
|
214
|
+
var path = findPath(blockStructure, blockId, ['']);
|
215
|
+
return path ? path.join('/') : null;
|
216
|
+
};
|
197
217
|
export var blockStructure = [
|
198
218
|
{
|
199
219
|
blockId: 'ROOT',
|