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 findAllComponentBlockIds: (blockStructure: Block[]) => number[];
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: Block[], targetId: string, bulkIds: string[]) => Block[];
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: Block[];
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 findAllComponentBlockIds = function (blockStructure) {
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
- blockId: 'ROOT',
285
- type: 'GROUP_BLOCK',
286
- zOrderDesktopInternal: null,
287
- zOrderMobileInternal: null,
288
- children: [
289
- {
290
- blockId: 'GB_2',
291
- type: 'GROUP_BLOCK',
292
- zOrderDesktopInternal: null,
293
- zOrderMobileInternal: null,
294
- children: [
295
- {
296
- blockId: 'GB_3',
297
- type: 'GROUP_BLOCK',
298
- zOrderDesktopInternal: null,
299
- zOrderMobileInternal: null,
300
- children: [
301
- {
302
- blockId: 'CB_4',
303
- type: 'COMPONENT_BLOCK',
304
- zOrderDesktopInternal: null,
305
- zOrderMobileInternal: null,
306
- componentBlockId: 4
307
- },
308
- {
309
- blockId: 'CB_5',
310
- type: 'COMPONENT_BLOCK',
311
- zOrderDesktopInternal: null,
312
- zOrderMobileInternal: null,
313
- componentBlockId: 5
314
- },
315
- {
316
- blockId: 'GB_6',
317
- type: 'GROUP_BLOCK',
318
- zOrderDesktopInternal: null,
319
- zOrderMobileInternal: null,
320
- children: [
321
- {
322
- blockId: 'CB_7',
323
- type: 'COMPONENT_BLOCK',
324
- zOrderDesktopInternal: null,
325
- zOrderMobileInternal: null,
326
- componentBlockId: 7
327
- },
328
- {
329
- blockId: 'CB_8',
330
- type: 'COMPONENT_BLOCK',
331
- zOrderDesktopInternal: null,
332
- zOrderMobileInternal: null,
333
- componentBlockId: 8
334
- },
335
- {
336
- blockId: 'GB_9',
337
- type: 'GROUP_BLOCK',
338
- zOrderDesktopInternal: null,
339
- zOrderMobileInternal: null,
340
- children: [
341
- {
342
- blockId: 'CB_10',
343
- type: 'COMPONENT_BLOCK',
344
- zOrderDesktopInternal: null,
345
- zOrderMobileInternal: null,
346
- componentBlockId: 10
347
- },
348
- {
349
- blockId: 'CB_11',
350
- type: 'COMPONENT_BLOCK',
351
- zOrderDesktopInternal: null,
352
- zOrderMobileInternal: null,
353
- componentBlockId: 11
354
- }
355
- ]
356
- }
357
- ]
358
- }
359
- ]
360
- },
361
- {
362
- blockId: 'GB_12',
363
- type: 'GROUP_BLOCK',
364
- zOrderDesktopInternal: null,
365
- zOrderMobileInternal: null,
366
- children: [
367
- {
368
- blockId: 'CB_13',
369
- type: 'COMPONENT_BLOCK',
370
- zOrderDesktopInternal: null,
371
- zOrderMobileInternal: null,
372
- componentBlockId: 13
373
- },
374
- {
375
- blockId: 'CB_14',
376
- type: 'COMPONENT_BLOCK',
377
- zOrderDesktopInternal: null,
378
- zOrderMobileInternal: null,
379
- componentBlockId: 14
380
- }
381
- ]
382
- },
383
- {
384
- blockId: 'CB_15',
385
- type: 'COMPONENT_BLOCK',
386
- zOrderDesktopInternal: null,
387
- zOrderMobileInternal: null,
388
- componentBlockId: 15
389
- },
390
- {
391
- blockId: 'CB_16',
392
- type: 'COMPONENT_BLOCK',
393
- zOrderDesktopInternal: null,
394
- zOrderMobileInternal: null,
395
- componentBlockId: 16
396
- }
397
- ]
398
- },
399
- {
400
- blockId: 'GB_17',
401
- type: 'GROUP_BLOCK',
402
- zOrderDesktopInternal: null,
403
- zOrderMobileInternal: null,
404
- children: [
405
- {
406
- blockId: 'CB_18',
407
- type: 'COMPONENT_BLOCK',
408
- zOrderDesktopInternal: null,
409
- zOrderMobileInternal: null,
410
- componentBlockId: 18
411
- }
412
- ]
413
- },
414
- {
415
- blockId: 'CB_19',
416
- type: 'COMPONENT_BLOCK',
417
- zOrderDesktopInternal: null,
418
- zOrderMobileInternal: null,
419
- componentBlockId: 19
420
- },
421
- {
422
- blockId: 'CB_20',
423
- type: 'COMPONENT_BLOCK',
424
- zOrderDesktopInternal: null,
425
- zOrderMobileInternal: null,
426
- componentBlockId: 20
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 = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "publ-echo-test",
3
- "version": "0.0.112",
3
+ "version": "0.0.113",
4
4
  "private": false,
5
5
  "main": "dist/lib/index.js",
6
6
  "types": "dist/lib/index.d.js",