@firestitch/block-editor 12.2.1 → 12.2.2

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.
@@ -27,7 +27,6 @@ export declare class ArtboardComponent implements OnInit, AfterViewInit, OnDestr
27
27
  constructor(_el: ElementRef, _blockEditor: BlockEditorService, _cdRef: ChangeDetectorRef, _differs: IterableDiffers);
28
28
  get el(): any;
29
29
  ngOnInit(): void;
30
- blockChanged(block: Block<any>): void;
31
30
  ngAfterViewInit(): void;
32
31
  ngOnDestroy(): void;
33
32
  static ɵfac: i0.ɵɵFactoryDeclaration<ArtboardComponent, never>;
@@ -70,7 +70,6 @@ export declare class SidebarComponent implements OnInit, OnDestroy {
70
70
  layerUp(): void;
71
71
  layerDown(): void;
72
72
  reorderLayers(): void;
73
- blockChanged(block: Block<any>): void;
74
73
  inputFocus(event: any): void;
75
74
  ngOnDestroy(): void;
76
75
  validNumeric(value: any): boolean;
@@ -23,7 +23,6 @@ export declare class BlockEditorService implements OnDestroy {
23
23
  init(config: BlockEditorConfig): void;
24
24
  blockAdd(block: Block, newBlock?: boolean): void;
25
25
  blockUpload(block: Block, fsFile: FsFile, newBlock?: boolean): void;
26
- private _updateIndexesFor;
27
26
  blockRemove(block: Block): void;
28
27
  removeSelectedBlocks(): void;
29
28
  get blocks$(): Observable<Block[]>;
@@ -505,8 +505,16 @@
505
505
  this._destroy$.complete();
506
506
  };
507
507
  BlocksStore.prototype.init = function (config) {
508
+ var _this = this;
508
509
  this._config = config;
509
510
  this._setBlocks(this._config.blocks);
511
+ if (this._config.blockChanged) {
512
+ this.blockChanged$
513
+ .pipe(operators.groupBy(function (block) { return block.guid; }), operators.map(function (group) { return group.pipe(operators.debounceTime(250)); }), operators.mergeAll())
514
+ .subscribe(function (block) {
515
+ _this._config.blockChanged(block);
516
+ });
517
+ }
510
518
  };
511
519
  BlocksStore.prototype.blockExists = function (block) {
512
520
  var index = this.blocks.findIndex(function (b) {
@@ -547,9 +555,6 @@
547
555
  });
548
556
  };
549
557
  BlocksStore.prototype.blockChange = function (block) {
550
- if (this._config.blockChanged) {
551
- this._config.blockChanged(block);
552
- }
553
558
  this._dispatchEvent(EventType.Change, block);
554
559
  };
555
560
  BlocksStore.prototype.blockRemove = function (targetBlocks) {
@@ -676,12 +681,6 @@
676
681
  if (newBlock === void 0) { newBlock = false; }
677
682
  this._store.blockUpload(block, fsFile, false);
678
683
  };
679
- BlockEditorService.prototype._updateIndexesFor = function (blocks) {
680
- blocks.forEach(function (block, index) {
681
- block.index = index;
682
- });
683
- return blocks;
684
- };
685
684
  BlockEditorService.prototype.blockRemove = function (block) {
686
685
  this._store.blockRemove(block);
687
686
  };
@@ -1435,11 +1434,6 @@
1435
1434
  (_a = this._document.defaultView) === null || _a === void 0 ? void 0 : _a.scrollTo(0, 0);
1436
1435
  this._blockEditor.openReorderDialog();
1437
1436
  };
1438
- SidebarComponent.prototype.blockChanged = function (block) {
1439
- if (this.config.blockChanged) {
1440
- this.config.blockChanged(block);
1441
- }
1442
- };
1443
1437
  SidebarComponent.prototype.inputFocus = function (event) {
1444
1438
  event.target.select();
1445
1439
  };
@@ -1560,11 +1554,6 @@
1560
1554
  });
1561
1555
  });
1562
1556
  };
1563
- ArtboardComponent.prototype.blockChanged = function (block) {
1564
- if (this.config.blockChanged) {
1565
- this.config.blockChanged(block);
1566
- }
1567
- };
1568
1557
  ArtboardComponent.prototype.ngAfterViewInit = function () {
1569
1558
  // this.blockComponents.changes
1570
1559
  // .pipe(