@firestitch/block-editor 12.2.3 → 12.2.4

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.
@@ -1,4 +1,4 @@
1
- import { AfterViewInit, ChangeDetectorRef, ElementRef, IterableDiffers, OnDestroy, OnInit, QueryList } from '@angular/core';
1
+ import { ChangeDetectorRef, ElementRef, OnDestroy, OnInit, QueryList } from '@angular/core';
2
2
  import { FsZoomPanComponent } from '@firestitch/zoom-pan';
3
3
  import { BlockEditorConfig } from '../../interfaces/block-editor-config';
4
4
  import { FsBlockComponent } from '../block/block.component';
@@ -8,11 +8,10 @@ import { FsBlockEditorSidebarPanelDirective } from '../../directives/block-edito
8
8
  import { FsBlockEditorMarginDirective } from '../../directives/block-editor-margin.directive';
9
9
  import { SidebarComponent } from '../sidebar/sidebar.component';
10
10
  import * as i0 from "@angular/core";
11
- export declare class ArtboardComponent implements OnInit, AfterViewInit, OnDestroy {
11
+ export declare class ArtboardComponent implements OnInit, OnDestroy {
12
12
  private _el;
13
13
  private _blockEditor;
14
14
  private _cdRef;
15
- private _differs;
16
15
  sidebarPanels: QueryList<FsBlockEditorSidebarPanelDirective>;
17
16
  blockComponents: QueryList<FsBlockComponent>;
18
17
  artboard: ElementRef;
@@ -22,12 +21,10 @@ export declare class ArtboardComponent implements OnInit, AfterViewInit, OnDestr
22
21
  config: BlockEditorConfig;
23
22
  zoompan: FsZoomPanComponent;
24
23
  blocks: Block[];
25
- private _differ;
26
24
  private _destroy$;
27
- constructor(_el: ElementRef, _blockEditor: BlockEditorService, _cdRef: ChangeDetectorRef, _differs: IterableDiffers);
25
+ constructor(_el: ElementRef, _blockEditor: BlockEditorService, _cdRef: ChangeDetectorRef);
28
26
  get el(): any;
29
27
  ngOnInit(): void;
30
- ngAfterViewInit(): void;
31
28
  ngOnDestroy(): void;
32
29
  static ɵfac: i0.ɵɵFactoryDeclaration<ArtboardComponent, never>;
33
30
  static ɵcmp: i0.ɵɵComponentDeclaration<ArtboardComponent, "app-artboard", never, { "config": "config"; "zoompan": "zoompan"; }, {}, ["sidebarPanels"], never>;
@@ -1496,14 +1496,12 @@
1496
1496
  }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }]; } });
1497
1497
 
1498
1498
  var ArtboardComponent = /** @class */ (function () {
1499
- function ArtboardComponent(_el, _blockEditor, _cdRef, _differs) {
1499
+ function ArtboardComponent(_el, _blockEditor, _cdRef) {
1500
1500
  this._el = _el;
1501
1501
  this._blockEditor = _blockEditor;
1502
1502
  this._cdRef = _cdRef;
1503
- this._differs = _differs;
1504
1503
  this.blocks = [];
1505
1504
  this._destroy$ = new rxjs.Subject();
1506
- this._differ = _differs.find([]).create(null);
1507
1505
  }
1508
1506
  Object.defineProperty(ArtboardComponent.prototype, "el", {
1509
1507
  get: function () {
@@ -1552,33 +1550,17 @@
1552
1550
  blockComponent.left = blockComponent.block.left + inchPixel;
1553
1551
  break;
1554
1552
  }
1553
+ _this._blockEditor.blockChange(blockComponent.block);
1555
1554
  });
1556
1555
  });
1557
1556
  };
1558
- ArtboardComponent.prototype.ngAfterViewInit = function () {
1559
- // this.blockComponents.changes
1560
- // .pipe(
1561
- // takeUntil(this._destroy$),
1562
- // )
1563
- // .subscribe((changes) => {
1564
- // const changeDiff = this._differ.diff(changes);
1565
- // if (changeDiff) {
1566
- // changeDiff.forEachAddedItem((change) => {
1567
- // //this.blockAdded.emit(change.item);
1568
- // });
1569
- // changeDiff.forEachRemovedItem((change) => {
1570
- // //this.blockRemoved.emit(change.item);
1571
- // });
1572
- // }
1573
- // });
1574
- };
1575
1557
  ArtboardComponent.prototype.ngOnDestroy = function () {
1576
1558
  this._destroy$.next();
1577
1559
  this._destroy$.complete();
1578
1560
  };
1579
1561
  return ArtboardComponent;
1580
1562
  }());
1581
- ArtboardComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ArtboardComponent, deps: [{ token: i0__namespace.ElementRef }, { token: BlockEditorService }, { token: i0__namespace.ChangeDetectorRef }, { token: i0__namespace.IterableDiffers }], target: i0__namespace.ɵɵFactoryTarget.Component });
1563
+ ArtboardComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ArtboardComponent, deps: [{ token: i0__namespace.ElementRef }, { token: BlockEditorService }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
1582
1564
  ArtboardComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ArtboardComponent, selector: "app-artboard", inputs: { config: "config", zoompan: "zoompan" }, queries: [{ propertyName: "sidebarPanels", predicate: FsBlockEditorSidebarPanelDirective }], viewQueries: [{ propertyName: "artboard", first: true, predicate: ["artboard"], descendants: true, static: true }, { propertyName: "marginContainer", first: true, predicate: ["marginContainer"], descendants: true, static: true }, { propertyName: "sidebar", first: true, predicate: SidebarComponent, descendants: true, static: true }, { propertyName: "blockComponents", predicate: FsBlockComponent, descendants: true }, { propertyName: "margins", predicate: FsBlockEditorMarginDirective, descendants: true }], ngImport: i0__namespace, template: "<div\n #artboard\n class=\"artboard mat-elevation-z4 deselectable\"\n [style.width]=\"config.width + config.unit\"\n [style.height]=\"config.height + config.unit\">\n <fs-block\n *ngFor=\"let block of blocks\"\n [zoompan]=\"zoompan\"\n [block]=\"block\">\n </fs-block>\n <div class=\"margin margin-top\" *ngIf=\"config.marginTop\" [style.top]=\"config.marginTop + 'in'\"></div>\n <div class=\"margin margin-left\" *ngIf=\"config.marginLeft\" [style.left]=\"config.marginLeft + 'in'\"></div>\n <div class=\"margin margin-bottom\" *ngIf=\"config.marginBottom\" [style.bottom]=\"config.marginBottom + 'in'\"></div>\n <div class=\"margin margin-right\" *ngIf=\"config.marginRight\" [style.right]=\"config.marginRight + 'in'\"></div>\n <div\n #marginContainer\n class=\"margin-container\"\n [style.top]=\"config.marginTop + 'in'\"\n [style.right]=\"config.marginRight + 'in'\"\n [style.bottom]=\"config.marginBottom + 'in'\"\n [style.left]=\"config.marginLeft + 'in'\">\n </div>\n</div> \n\n", styles: [".artboard{position:relative;display:inline-flex;background-color:#fff}.artboard .margin-container{position:absolute;z-index:-1}.artboard .margin{position:absolute;border-color:#ff85bd5e;border-style:dashed;border-width:0px}.artboard .margin.margin-top,.artboard .margin.margin-bottom{width:100%;border-top-width:1px}.artboard .margin.margin-left,.artboard .margin.margin-right{height:100%;border-left-width:1px}\n"], components: [{ type: FsBlockComponent, selector: "fs-block", inputs: ["block", "html", "zoompan"] }], directives: [{ type: i11__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i11__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
1583
1565
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ArtboardComponent, decorators: [{
1584
1566
  type: i0.Component,
@@ -1588,7 +1570,7 @@
1588
1570
  styleUrls: ['artboard.component.scss'],
1589
1571
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
1590
1572
  }]
1591
- }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: BlockEditorService }, { type: i0__namespace.ChangeDetectorRef }, { type: i0__namespace.IterableDiffers }]; }, propDecorators: { sidebarPanels: [{
1573
+ }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: BlockEditorService }, { type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { sidebarPanels: [{
1592
1574
  type: i0.ContentChildren,
1593
1575
  args: [FsBlockEditorSidebarPanelDirective]
1594
1576
  }], blockComponents: [{