publ-echo-test 0.0.112 → 0.0.113
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.
@@ -46,13 +46,13 @@ export declare const findAllChildrenIds: (blockStructure: Block[], targetId: str
|
|
46
46
|
export declare const findAllChildrenComponentIds: (blockStructure: Block[], targetId: string) => number[];
|
47
47
|
export declare const findAllParentGroups: (blockStructure: Block[], targetId: string) => GroupBlock[];
|
48
48
|
export declare const findGroupBlocks: (blockStructure: Block[], targetId: string) => GroupBlock[];
|
49
|
-
export declare const
|
49
|
+
export declare const findAllChildrenCbIds: (blockStructure: Block[]) => number[];
|
50
50
|
export declare const findParentGroupByGroupId: (blockStructure: Block[], targetId: string) => string | null;
|
51
51
|
export declare const addBlockToRoot: (blockStructure: Block[], newBlock: Block) => Block[];
|
52
|
-
export declare const addBulkToTarget: (blockStructure:
|
52
|
+
export declare const addBulkToTarget: (blockStructure: RootBlock, targetId: string, bulkIds: string[]) => RootBlock;
|
53
53
|
export declare const getBlockWorkDirPath: (blockStructure: Block[], blockId: string) => string | null;
|
54
54
|
export declare const getBlockIdByComponentId: (blockStructure: Block[], componentId: number) => string | null;
|
55
|
-
export declare const blockStructure:
|
55
|
+
export declare const blockStructure: RootBlock;
|
56
56
|
export declare const mapComponentBlockIdsToBlockIds: (blockStructure: Block[]) => {
|
57
57
|
CB_ID: Record<number, string>;
|
58
58
|
BLOCK_ID: Record<string, number>;
|
@@ -159,7 +159,7 @@ export var findGroupBlocks = function (blockStructure, targetId) {
|
|
159
159
|
}
|
160
160
|
return groupBlocks;
|
161
161
|
};
|
162
|
-
export var
|
162
|
+
export var findAllChildrenCbIds = function (blockStructure) {
|
163
163
|
var collectComponentBlockIds = function (blocks) {
|
164
164
|
var ids = [];
|
165
165
|
for (var _i = 0, blocks_3 = blocks; _i < blocks_3.length; _i++) {
|
@@ -205,7 +205,7 @@ export var addBlockToRoot = function (blockStructure, newBlock) {
|
|
205
205
|
export var addBulkToTarget = function (blockStructure, targetId, bulkIds // componentBlockId
|
206
206
|
) {
|
207
207
|
var structure = deepClone(blockStructure);
|
208
|
-
var targetBlock = findBlockByBlockId(structure, targetId);
|
208
|
+
var targetBlock = findBlockByBlockId(structure.children, targetId);
|
209
209
|
if (!targetBlock || targetBlock.type !== 'GROUP_BLOCK' || !targetBlock.children) {
|
210
210
|
return blockStructure;
|
211
211
|
}
|
@@ -220,8 +220,6 @@ export var addBulkToTarget = function (blockStructure, targetId, bulkIds // comp
|
|
220
220
|
});
|
221
221
|
if (bulkBlocks.length !== bulkIds.length) {
|
222
222
|
window.alert('Some bulkIds do not exist as children of the target block.');
|
223
|
-
console.log('bulkBLocks: ', bulkBlocks);
|
224
|
-
console.log('bulkIds: ', bulkIds);
|
225
223
|
return blockStructure;
|
226
224
|
}
|
227
225
|
if (bulkBlocks.length === 0) {
|
@@ -279,155 +277,153 @@ export var getBlockIdByComponentId = function (blockStructure, componentId) {
|
|
279
277
|
};
|
280
278
|
return findBlock(blockStructure);
|
281
279
|
};
|
282
|
-
export var blockStructure =
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
}
|
430
|
-
];
|
280
|
+
export var blockStructure = {
|
281
|
+
blockId: 'ROOT',
|
282
|
+
type: 'GROUP_BLOCK',
|
283
|
+
zOrderDesktopInternal: null,
|
284
|
+
zOrderMobileInternal: null,
|
285
|
+
children: [
|
286
|
+
{
|
287
|
+
blockId: 'GB_2',
|
288
|
+
type: 'GROUP_BLOCK',
|
289
|
+
zOrderDesktopInternal: null,
|
290
|
+
zOrderMobileInternal: null,
|
291
|
+
children: [
|
292
|
+
{
|
293
|
+
blockId: 'GB_3',
|
294
|
+
type: 'GROUP_BLOCK',
|
295
|
+
zOrderDesktopInternal: null,
|
296
|
+
zOrderMobileInternal: null,
|
297
|
+
children: [
|
298
|
+
{
|
299
|
+
blockId: 'CB_4',
|
300
|
+
type: 'COMPONENT_BLOCK',
|
301
|
+
zOrderDesktopInternal: null,
|
302
|
+
zOrderMobileInternal: null,
|
303
|
+
componentBlockId: 4
|
304
|
+
},
|
305
|
+
{
|
306
|
+
blockId: 'CB_5',
|
307
|
+
type: 'COMPONENT_BLOCK',
|
308
|
+
zOrderDesktopInternal: null,
|
309
|
+
zOrderMobileInternal: null,
|
310
|
+
componentBlockId: 5
|
311
|
+
},
|
312
|
+
{
|
313
|
+
blockId: 'GB_6',
|
314
|
+
type: 'GROUP_BLOCK',
|
315
|
+
zOrderDesktopInternal: null,
|
316
|
+
zOrderMobileInternal: null,
|
317
|
+
children: [
|
318
|
+
{
|
319
|
+
blockId: 'CB_7',
|
320
|
+
type: 'COMPONENT_BLOCK',
|
321
|
+
zOrderDesktopInternal: null,
|
322
|
+
zOrderMobileInternal: null,
|
323
|
+
componentBlockId: 7
|
324
|
+
},
|
325
|
+
{
|
326
|
+
blockId: 'CB_8',
|
327
|
+
type: 'COMPONENT_BLOCK',
|
328
|
+
zOrderDesktopInternal: null,
|
329
|
+
zOrderMobileInternal: null,
|
330
|
+
componentBlockId: 8
|
331
|
+
},
|
332
|
+
{
|
333
|
+
blockId: 'GB_9',
|
334
|
+
type: 'GROUP_BLOCK',
|
335
|
+
zOrderDesktopInternal: null,
|
336
|
+
zOrderMobileInternal: null,
|
337
|
+
children: [
|
338
|
+
{
|
339
|
+
blockId: 'CB_10',
|
340
|
+
type: 'COMPONENT_BLOCK',
|
341
|
+
zOrderDesktopInternal: null,
|
342
|
+
zOrderMobileInternal: null,
|
343
|
+
componentBlockId: 10
|
344
|
+
},
|
345
|
+
{
|
346
|
+
blockId: 'CB_11',
|
347
|
+
type: 'COMPONENT_BLOCK',
|
348
|
+
zOrderDesktopInternal: null,
|
349
|
+
zOrderMobileInternal: null,
|
350
|
+
componentBlockId: 11
|
351
|
+
}
|
352
|
+
]
|
353
|
+
}
|
354
|
+
]
|
355
|
+
}
|
356
|
+
]
|
357
|
+
},
|
358
|
+
{
|
359
|
+
blockId: 'GB_12',
|
360
|
+
type: 'GROUP_BLOCK',
|
361
|
+
zOrderDesktopInternal: null,
|
362
|
+
zOrderMobileInternal: null,
|
363
|
+
children: [
|
364
|
+
{
|
365
|
+
blockId: 'CB_13',
|
366
|
+
type: 'COMPONENT_BLOCK',
|
367
|
+
zOrderDesktopInternal: null,
|
368
|
+
zOrderMobileInternal: null,
|
369
|
+
componentBlockId: 13
|
370
|
+
},
|
371
|
+
{
|
372
|
+
blockId: 'CB_14',
|
373
|
+
type: 'COMPONENT_BLOCK',
|
374
|
+
zOrderDesktopInternal: null,
|
375
|
+
zOrderMobileInternal: null,
|
376
|
+
componentBlockId: 14
|
377
|
+
}
|
378
|
+
]
|
379
|
+
},
|
380
|
+
{
|
381
|
+
blockId: 'CB_15',
|
382
|
+
type: 'COMPONENT_BLOCK',
|
383
|
+
zOrderDesktopInternal: null,
|
384
|
+
zOrderMobileInternal: null,
|
385
|
+
componentBlockId: 15
|
386
|
+
},
|
387
|
+
{
|
388
|
+
blockId: 'CB_16',
|
389
|
+
type: 'COMPONENT_BLOCK',
|
390
|
+
zOrderDesktopInternal: null,
|
391
|
+
zOrderMobileInternal: null,
|
392
|
+
componentBlockId: 16
|
393
|
+
}
|
394
|
+
]
|
395
|
+
},
|
396
|
+
{
|
397
|
+
blockId: 'GB_17',
|
398
|
+
type: 'GROUP_BLOCK',
|
399
|
+
zOrderDesktopInternal: null,
|
400
|
+
zOrderMobileInternal: null,
|
401
|
+
children: [
|
402
|
+
{
|
403
|
+
blockId: 'CB_18',
|
404
|
+
type: 'COMPONENT_BLOCK',
|
405
|
+
zOrderDesktopInternal: null,
|
406
|
+
zOrderMobileInternal: null,
|
407
|
+
componentBlockId: 18
|
408
|
+
}
|
409
|
+
]
|
410
|
+
},
|
411
|
+
{
|
412
|
+
blockId: 'CB_19',
|
413
|
+
type: 'COMPONENT_BLOCK',
|
414
|
+
zOrderDesktopInternal: null,
|
415
|
+
zOrderMobileInternal: null,
|
416
|
+
componentBlockId: 19
|
417
|
+
},
|
418
|
+
{
|
419
|
+
blockId: 'CB_20',
|
420
|
+
type: 'COMPONENT_BLOCK',
|
421
|
+
zOrderDesktopInternal: null,
|
422
|
+
zOrderMobileInternal: null,
|
423
|
+
componentBlockId: 20
|
424
|
+
}
|
425
|
+
]
|
426
|
+
};
|
431
427
|
export var mapComponentBlockIdsToBlockIds = function (blockStructure) {
|
432
428
|
var cbToBlockMap = {};
|
433
429
|
var blockToCbMap = {};
|