@firestitch/block-editor 12.3.22 → 12.3.23

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,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('@angular/forms'), require('@angular/material/input'), require('@angular/cdk/drag-drop'), require('@angular/material/button'), require('@angular/material/checkbox'), require('@angular/material/form-field'), require('@angular/material/icon'), require('@angular/material/list'), require('@angular/material/select'), require('@angular/material/tooltip'), require('@firestitch/colorpicker'), require('@firestitch/dialog'), require('@firestitch/file'), require('@firestitch/menu'), require('@firestitch/zoom-pan'), require('@firestitch/autocomplete'), require('rxjs'), require('rxjs/operators'), require('@angular/common/http'), require('moveable'), require('@angular/material/dialog'), require('@firestitch/common'), require('@angular/material/divider'), require('@firestitch/api'), require('@firestitch/prompt'), require('@angular/material/core'), require('@angular/cdk/text-field')) :
3
- typeof define === 'function' && define.amd ? define('@firestitch/block-editor', ['exports', '@angular/common', '@angular/core', '@angular/forms', '@angular/material/input', '@angular/cdk/drag-drop', '@angular/material/button', '@angular/material/checkbox', '@angular/material/form-field', '@angular/material/icon', '@angular/material/list', '@angular/material/select', '@angular/material/tooltip', '@firestitch/colorpicker', '@firestitch/dialog', '@firestitch/file', '@firestitch/menu', '@firestitch/zoom-pan', '@firestitch/autocomplete', 'rxjs', 'rxjs/operators', '@angular/common/http', 'moveable', '@angular/material/dialog', '@firestitch/common', '@angular/material/divider', '@firestitch/api', '@firestitch/prompt', '@angular/material/core', '@angular/cdk/text-field'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.firestitch = global.firestitch || {}, global.firestitch["block-editor"] = {}), global.ng.common, global.ng.core, global.ng.forms, global.ng.material.input, global.ng.cdk.dragDrop, global.ng.material.button, global.ng.material.checkbox, global.ng.material.formField, global.ng.material.icon, global.ng.material.list, global.ng.material.select, global.ng.material.tooltip, global.i12, global.i2, global.i3$1, global.menu, global.i2$2, global.i10, global.rxjs, global.rxjs.operators, global.ng.common.http, global.Moveable, global.ng.material.dialog, global.common, global.ng.material.divider, global.i1$2, global.i2$1, global.ng.material.core, global.ng.cdk.textField));
5
- })(this, (function (exports, i13, i0, i16, i15, i7, i6, i9, i6$1, i3, i4, i7$1, i14, i12, i2, i3$1, menu, i2$2, i10, rxjs, operators, i1, Moveable, i1$1, common, i5, i1$2, i2$1, i8, i17) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('@angular/forms'), require('@angular/material/input'), require('@angular/cdk/drag-drop'), require('@angular/material/button'), require('@angular/material/checkbox'), require('@angular/material/form-field'), require('@angular/material/icon'), require('@angular/material/list'), require('@angular/material/select'), require('@angular/material/tooltip'), require('@firestitch/colorpicker'), require('@firestitch/dialog'), require('@firestitch/file'), require('@firestitch/menu'), require('@firestitch/zoom-pan'), require('@firestitch/autocomplete'), require('rxjs'), require('rxjs/operators'), require('@angular/common/http'), require('@firestitch/common'), require('moveable'), require('@angular/material/dialog'), require('@angular/material/divider'), require('@firestitch/api'), require('@firestitch/prompt'), require('@angular/material/core'), require('@angular/cdk/text-field')) :
3
+ typeof define === 'function' && define.amd ? define('@firestitch/block-editor', ['exports', '@angular/common', '@angular/core', '@angular/forms', '@angular/material/input', '@angular/cdk/drag-drop', '@angular/material/button', '@angular/material/checkbox', '@angular/material/form-field', '@angular/material/icon', '@angular/material/list', '@angular/material/select', '@angular/material/tooltip', '@firestitch/colorpicker', '@firestitch/dialog', '@firestitch/file', '@firestitch/menu', '@firestitch/zoom-pan', '@firestitch/autocomplete', 'rxjs', 'rxjs/operators', '@angular/common/http', '@firestitch/common', 'moveable', '@angular/material/dialog', '@angular/material/divider', '@firestitch/api', '@firestitch/prompt', '@angular/material/core', '@angular/cdk/text-field'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.firestitch = global.firestitch || {}, global.firestitch["block-editor"] = {}), global.ng.common, global.ng.core, global.ng.forms, global.ng.material.input, global.ng.cdk.dragDrop, global.ng.material.button, global.ng.material.checkbox, global.ng.material.formField, global.ng.material.icon, global.ng.material.list, global.ng.material.select, global.ng.material.tooltip, global.i12, global.i2, global.i3$1, global.menu, global.i2$2, global.i10, global.rxjs, global.rxjs.operators, global.ng.common.http, global.common, global.Moveable, global.ng.material.dialog, global.ng.material.divider, global.i1$2, global.i2$1, global.ng.material.core, global.ng.cdk.textField));
5
+ })(this, (function (exports, i13, i0, i16, i15, i7, i6, i9, i6$1, i3, i4, i7$1, i14, i12, i2, i3$1, menu, i2$2, i10, rxjs, operators, i1, common, Moveable, i1$1, i5, i1$2, i2$1, i8, i17) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -113,6 +113,48 @@
113
113
  type: i0.Input
114
114
  }] } });
115
115
 
116
+ var FsBlockEditorMarginDirective = /** @class */ (function () {
117
+ function FsBlockEditorMarginDirective(_elementRef) {
118
+ this._elementRef = _elementRef;
119
+ }
120
+ Object.defineProperty(FsBlockEditorMarginDirective.prototype, "element", {
121
+ get: function () {
122
+ return this._elementRef.nativeElement;
123
+ },
124
+ enumerable: false,
125
+ configurable: true
126
+ });
127
+ return FsBlockEditorMarginDirective;
128
+ }());
129
+ FsBlockEditorMarginDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockEditorMarginDirective, deps: [{ token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
130
+ FsBlockEditorMarginDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FsBlockEditorMarginDirective, selector: "[fsBlockEditorMargin]", ngImport: i0__namespace });
131
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockEditorMarginDirective, decorators: [{
132
+ type: i0.Directive,
133
+ args: [{
134
+ selector: '[fsBlockEditorMargin]'
135
+ }]
136
+ }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }]; } });
137
+
138
+ var FsBlockEditorSidebarPanelDirective = /** @class */ (function () {
139
+ function FsBlockEditorSidebarPanelDirective(templateRef) {
140
+ this.templateRef = templateRef;
141
+ this.show = true;
142
+ }
143
+ return FsBlockEditorSidebarPanelDirective;
144
+ }());
145
+ FsBlockEditorSidebarPanelDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockEditorSidebarPanelDirective, deps: [{ token: i0__namespace.TemplateRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
146
+ FsBlockEditorSidebarPanelDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FsBlockEditorSidebarPanelDirective, selector: "[fsBlockEditorSidebarPanel]", inputs: { label: "label", show: "show" }, ngImport: i0__namespace });
147
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockEditorSidebarPanelDirective, decorators: [{
148
+ type: i0.Directive,
149
+ args: [{
150
+ selector: '[fsBlockEditorSidebarPanel]'
151
+ }]
152
+ }], ctorParameters: function () { return [{ type: i0__namespace.TemplateRef }]; }, propDecorators: { label: [{
153
+ type: i0.Input
154
+ }], show: [{
155
+ type: i0.Input
156
+ }] } });
157
+
116
158
  exports.BlockType = void 0;
117
159
  (function (BlockType) {
118
160
  BlockType["Rectangle"] = "rectangle";
@@ -153,18 +195,18 @@
153
195
  this._init(_dialogData);
154
196
  }
155
197
  LayersReorderDialogComponent.prototype.swapItems = function (event) {
156
- i7.moveItemInArray(this.blockComponents, event.previousIndex, event.currentIndex);
198
+ i7.moveItemInArray(this.blocks, event.previousIndex, event.currentIndex);
157
199
  };
158
200
  LayersReorderDialogComponent.prototype.done = function () {
159
- this._dialogRef.close(this.blockComponents);
201
+ this._dialogRef.close(this.blocks);
160
202
  };
161
203
  LayersReorderDialogComponent.prototype._init = function (data) {
162
- this.blockComponents = data.blockComponents;
204
+ this.blocks = data.blocks;
163
205
  };
164
206
  return LayersReorderDialogComponent;
165
207
  }());
166
208
  LayersReorderDialogComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: LayersReorderDialogComponent, deps: [{ token: i1$1.MAT_DIALOG_DATA }, { token: i1__namespace$1.MatDialogRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
167
- LayersReorderDialogComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: LayersReorderDialogComponent, selector: "ng-component", ngImport: i0__namespace, template: "<fs-dialog>\n <h1 mat-dialog-title><mat-icon>swap_vert</mat-icon> Reorder Fields</h1>\n <mat-dialog-content>\n <mat-list cdkDropList (cdkDropListDropped)=\"swapItems($event)\">\n <mat-divider></mat-divider>\n <ng-container *ngFor=\"let blockComponent of blockComponents\">\n <mat-list-item cdkDrag cdkDragLockAxis=\"y\">\n <mat-icon cdkDragHandle>drag_handle</mat-icon>\n <mat-icon>\n {{ blockTypeIcons[blockComponent.block.type] }}\n </mat-icon>\n <span class=\"block-label\">\n {{ blockComponent.block.label || blockComponent.block.content || 'No Content'}} \n </span>\n </mat-list-item>\n <mat-divider></mat-divider>\n </ng-container>\n </mat-list>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-button color=\"primary\" (click)=\"done()\">Done</button>\n </mat-dialog-actions>\n</fs-dialog>\n", styles: ["h1{display:flex}.mat-icon{margin-right:20px}.block-label{min-width:200px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:1000px}.cdk-drag-preview{display:flex;padding-left:15px!important;background:#fff;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-preview ::ng-deep .mat-list-item-content{display:flex;flex-direction:row;align-items:center;font-size:16px}.cdk-drag-handle{cursor:grab}.cdk-drag-placeholder{opacity:.2}\n"], components: [{ type: i2__namespace.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: i3__namespace.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i4__namespace.MatList, selector: "mat-list, mat-action-list", inputs: ["disableRipple", "disabled"], exportAs: ["matList"] }, { type: i5__namespace.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { type: i4__namespace.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["disableRipple", "disabled"], exportAs: ["matListItem"] }, { type: i6__namespace.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i1__namespace$1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1__namespace$1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i7__namespace.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "id", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListAutoScrollDisabled", "cdkDropListOrientation", "cdkDropListLockAxis", "cdkDropListData", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { type: i13__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7__namespace.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragDisabled", "cdkDragStartDelay", "cdkDragLockAxis", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragBoundary", "cdkDragRootElement", "cdkDragPreviewContainer", "cdkDragData", "cdkDragFreeDragPosition"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { type: i7__namespace.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { type: i1__namespace$1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
209
+ LayersReorderDialogComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: LayersReorderDialogComponent, selector: "ng-component", ngImport: i0__namespace, template: "<fs-dialog>\n <h1 mat-dialog-title><mat-icon>swap_vert</mat-icon> Reorder Blocks</h1>\n <mat-dialog-content>\n <mat-list cdkDropList (cdkDropListDropped)=\"swapItems($event)\">\n <mat-divider></mat-divider>\n <ng-container *ngFor=\"let block of blocks\">\n <mat-list-item cdkDrag cdkDragLockAxis=\"y\">\n <mat-icon cdkDragHandle>drag_handle</mat-icon>\n <mat-icon>\n {{ blockTypeIcons[block.type] }}\n </mat-icon>\n <span class=\"block-label\">\n {{ block.label || block.content || 'No Content'}} \n </span>\n </mat-list-item>\n <mat-divider></mat-divider>\n </ng-container>\n </mat-list>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-button color=\"primary\" (click)=\"done()\">Done</button>\n </mat-dialog-actions>\n</fs-dialog>\n", styles: ["h1{display:flex}.mat-icon{margin-right:20px}.block-label{min-width:200px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:1000px}.cdk-drag-preview{display:flex;padding-left:15px!important;background:#fff;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-preview ::ng-deep .mat-list-item-content{display:flex;flex-direction:row;align-items:center;font-size:16px}.cdk-drag-handle{cursor:grab}.cdk-drag-placeholder{opacity:.2}\n"], components: [{ type: i2__namespace.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: i3__namespace.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i4__namespace.MatList, selector: "mat-list, mat-action-list", inputs: ["disableRipple", "disabled"], exportAs: ["matList"] }, { type: i5__namespace.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { type: i4__namespace.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["disableRipple", "disabled"], exportAs: ["matListItem"] }, { type: i6__namespace.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i1__namespace$1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1__namespace$1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i7__namespace.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "id", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListAutoScrollDisabled", "cdkDropListOrientation", "cdkDropListLockAxis", "cdkDropListData", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { type: i13__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7__namespace.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragDisabled", "cdkDragStartDelay", "cdkDragLockAxis", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragBoundary", "cdkDragRootElement", "cdkDragPreviewContainer", "cdkDragData", "cdkDragFreeDragPosition"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { type: i7__namespace.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { type: i1__namespace$1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
168
210
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: LayersReorderDialogComponent, decorators: [{
169
211
  type: i0.Component,
170
212
  args: [{
@@ -502,6 +544,7 @@
502
544
  EventType["Add"] = "add";
503
545
  EventType["Change"] = "change";
504
546
  EventType["Remove"] = "remove";
547
+ EventType["Update"] = "update";
505
548
  })(EventType || (EventType = {}));
506
549
  var BlocksStore = /** @class */ (function () {
507
550
  function BlocksStore() {
@@ -552,6 +595,20 @@
552
595
  enumerable: false,
553
596
  configurable: true
554
597
  });
598
+ Object.defineProperty(BlocksStore.prototype, "blockUpdated$", {
599
+ get: function () {
600
+ return this._eventBus$
601
+ .pipe(operators.filter(function (_k) {
602
+ var type = _k.type;
603
+ return type === EventType.Update;
604
+ }), operators.map(function (_k) {
605
+ var value = _k.value;
606
+ return value;
607
+ }));
608
+ },
609
+ enumerable: false,
610
+ configurable: true
611
+ });
555
612
  Object.defineProperty(BlocksStore.prototype, "blockRemoved$", {
556
613
  get: function () {
557
614
  return this._eventBus$
@@ -620,9 +677,7 @@
620
677
  return _this._config.blockUpload(block, fsFile.file);
621
678
  }), operators.tap(function (newBlock) {
622
679
  if (existing) {
623
- var blocks = _this._blocks$.getValue();
624
- blocks[blocks.indexOf(block)] = newBlock;
625
- _this._setBlocks(blocks);
680
+ _this.blockUpdate(Object.assign(Object.assign({}, block), newBlock));
626
681
  }
627
682
  else {
628
683
  _this._appendBlock(newBlock);
@@ -632,6 +687,9 @@
632
687
  BlocksStore.prototype.blockChange = function (block) {
633
688
  this._dispatchEvent(EventType.Change, block);
634
689
  };
690
+ BlocksStore.prototype.blockUpdate = function (block) {
691
+ this._dispatchEvent(EventType.Update, block);
692
+ };
635
693
  BlocksStore.prototype.blockRemove = function (targetBlocks) {
636
694
  var _this = this;
637
695
  var blocks = this.blocks;
@@ -741,15 +799,6 @@
741
799
  enumerable: false,
742
800
  configurable: true
743
801
  });
744
- Object.defineProperty(BlockEditorService.prototype, "selectedComponentBlocks", {
745
- get: function () {
746
- var _this = this;
747
- return this.blockComponents
748
- .filter(function (blockComponent) { return _this.selectedBlocks.indexOf(blockComponent.block) !== -1; });
749
- },
750
- enumerable: false,
751
- configurable: true
752
- });
753
802
  BlockEditorService.prototype.init = function (config) {
754
803
  this.config = config;
755
804
  this._store.init(Object.assign({}, this.config));
@@ -785,6 +834,13 @@
785
834
  enumerable: false,
786
835
  configurable: true
787
836
  });
837
+ Object.defineProperty(BlockEditorService.prototype, "blockUpdated$", {
838
+ get: function () {
839
+ return this._store.blockUpdated$;
840
+ },
841
+ enumerable: false,
842
+ configurable: true
843
+ });
788
844
  Object.defineProperty(BlockEditorService.prototype, "blockClippable$", {
789
845
  get: function () {
790
846
  return this._blockClippable$;
@@ -831,7 +887,7 @@
831
887
  this._store.blockChange(block);
832
888
  };
833
889
  BlockEditorService.prototype.isSelectedBlock = function (block) {
834
- return this.selectedBlocks.indexOf(block.block) !== -1;
890
+ return this.selectedBlocks.indexOf(block) !== -1;
835
891
  };
836
892
  BlockEditorService.prototype.indexOf = function (block) {
837
893
  return this.blocks.map(function (e) { return e.guid; }).indexOf(block.guid);
@@ -863,15 +919,6 @@
863
919
  return this._selectedBlocks$.getValue();
864
920
  },
865
921
  set: function (blocks) {
866
- this.blockComponents
867
- .forEach(function (blockComponent) {
868
- if (blocks.indexOf(blockComponent.block) !== -1) {
869
- blockComponent.select();
870
- }
871
- else {
872
- blockComponent.deselect();
873
- }
874
- });
875
922
  this._selectedBlocks$.next(blocks);
876
923
  if (this.config.blocksSelected) {
877
924
  this.config.blocksSelected(blocks);
@@ -909,23 +956,23 @@
909
956
  };
910
957
  BlockEditorService.prototype.openReorderDialog = function () {
911
958
  var _this = this;
912
- var blockComponents = this.blockComponents
913
- .sort(function (blockCmpA, blockCmpB) { return (blockCmpA.block.index - blockCmpB.block.index); })
959
+ var blocks = this.blocks
960
+ .sort(function (blockA, blockB) { return (blockA.index - blockB.index); })
914
961
  .reverse();
915
962
  this._dialog
916
963
  .open(LayersReorderDialogComponent, {
917
964
  data: {
918
- blockComponents: blockComponents,
965
+ blocks: blocks,
919
966
  }
920
967
  })
921
968
  .afterClosed()
922
- .pipe(operators.filter(function (blockComponents) { return !!blockComponents; }), operators.takeUntil(this._destroy$))
923
- .subscribe(function (blockComponents) {
924
- blockComponents
969
+ .pipe(operators.filter(function (blocks) { return !!blocks; }), operators.takeUntil(this._destroy$))
970
+ .subscribe(function (blocks) {
971
+ blocks
925
972
  .reverse()
926
- .forEach(function (blockCmp, index) {
927
- blockCmp.block.index = index;
928
- _this._store.blockChange(blockCmp.block);
973
+ .forEach(function (block, index) {
974
+ block.index = index;
975
+ _this._store.blockChange(block);
929
976
  _this._store.updateTabIndex(index);
930
977
  });
931
978
  });
@@ -970,6 +1017,23 @@
970
1017
  this._transformable = false;
971
1018
  this._destroy$ = new rxjs.Subject();
972
1019
  }
1020
+ Object.defineProperty(FsBlockComponent.prototype, "block", {
1021
+ get: function () {
1022
+ return this._block;
1023
+ },
1024
+ set: function (block) {
1025
+ this._block = block;
1026
+ this._block.resizable = !this.hasType([exports.BlockType.Checkbox, exports.BlockType.RadioButton]);
1027
+ this._block.rotatable = !this.hasType([exports.BlockType.Checkbox, exports.BlockType.RadioButton]);
1028
+ this._block.scalable = !this.hasType([exports.BlockType.Checkbox, exports.BlockType.RadioButton]);
1029
+ if (this.moveable) {
1030
+ this._updateMoveable();
1031
+ }
1032
+ },
1033
+ enumerable: false,
1034
+ configurable: true
1035
+ });
1036
+ ;
973
1037
  Object.defineProperty(FsBlockComponent.prototype, "el", {
974
1038
  get: function () {
975
1039
  return this.element.nativeElement;
@@ -984,6 +1048,9 @@
984
1048
  enumerable: false,
985
1049
  configurable: true
986
1050
  });
1051
+ FsBlockComponent.prototype.hasType = function (types) {
1052
+ return types.includes(this.block.type);
1053
+ };
987
1054
  Object.defineProperty(FsBlockComponent.prototype, "editable", {
988
1055
  get: function () {
989
1056
  return this._editable;
@@ -1137,13 +1204,8 @@
1137
1204
  return this._transformable;
1138
1205
  },
1139
1206
  set: function (value) {
1140
- if (this.block.lock) {
1141
- value = false;
1142
- }
1143
1207
  this._transformable = value;
1144
- this.moveable.resizable = value;
1145
- this.moveable.rotatable = value;
1146
- this.moveable.scalable = value;
1208
+ this._updateMoveable();
1147
1209
  },
1148
1210
  enumerable: false,
1149
1211
  configurable: true
@@ -1180,9 +1242,10 @@
1180
1242
  this.block.shadowOpacity = this.block.shadowOpacity || 100;
1181
1243
  this._initFonts();
1182
1244
  this._blockEditor.selectedBlocks$
1183
- .pipe(operators.takeUntil(this._destroy$))
1245
+ .pipe(operators.skip(1), operators.takeUntil(this._destroy$))
1184
1246
  .subscribe(function (blocks) {
1185
1247
  _this.selected = blocks.includes(_this.block);
1248
+ _this.transformable = true;
1186
1249
  _this._cdRef.markForCheck();
1187
1250
  });
1188
1251
  this._blockEditor.blockClippable$
@@ -1196,13 +1259,16 @@
1196
1259
  .subscribe(function () {
1197
1260
  _this._cdRef.markForCheck();
1198
1261
  });
1262
+ this._blockEditor.blockUpdated$
1263
+ .pipe(operators.filter(function (block) { return block.guid === _this.block.guid; }), operators.takeUntil(this._destroy$))
1264
+ .subscribe(function (block) {
1265
+ _this.block = block;
1266
+ _this._cdRef.markForCheck();
1267
+ });
1199
1268
  this._blockEditor.blockChanged$
1200
1269
  .pipe(operators.filter(function (block) { return block.guid === _this.block.guid; }), operators.takeUntil(this._destroy$))
1201
1270
  .subscribe(function (block) {
1202
- _this.block = Object.assign(Object.assign({}, _this.block), block);
1203
- _this.keepRatio = block.keepRatio;
1204
- _this.rotate = _this.block.rotate;
1205
- _this._updateMoveable();
1271
+ _this.block = block;
1206
1272
  _this._cdRef.markForCheck();
1207
1273
  });
1208
1274
  };
@@ -1227,9 +1293,6 @@
1227
1293
  FsBlockComponent.prototype.round = function (value, decimals) {
1228
1294
  return parseFloat(value.toFixed(decimals));
1229
1295
  };
1230
- FsBlockComponent.prototype.select = function () {
1231
- this.transformable = true;
1232
- };
1233
1296
  FsBlockComponent.prototype.deselect = function () {
1234
1297
  this.editable = false;
1235
1298
  this.clippable = false;
@@ -1249,7 +1312,7 @@
1249
1312
  }
1250
1313
  }
1251
1314
  };
1252
- FsBlockComponent.prototype.selectAll = function () {
1315
+ FsBlockComponent.prototype.selectTextAll = function () {
1253
1316
  var range = document.createRange();
1254
1317
  range.selectNodeContents(this.contentEditable.nativeElement);
1255
1318
  var sel = window.getSelection();
@@ -1276,11 +1339,12 @@
1276
1339
  .filter(function (el) { return !el.isSameNode(_this.el); });
1277
1340
  };
1278
1341
  FsBlockComponent.prototype._updateMoveable = function () {
1279
- this._moveable.draggable = !this.block.lock;
1280
- if (this.selected) {
1281
- this._moveable.resizable = !this.block.lock;
1282
- this._moveable.rotatable = !this.block.lock;
1283
- }
1342
+ var value = !this.block.lock && this.selected;
1343
+ this.keepRatio = this.block.keepRatio;
1344
+ this.rotate = this.block.rotate;
1345
+ this.moveable.resizable = this.block.resizable && value;
1346
+ this.moveable.rotatable = this.block.rotatable && value;
1347
+ this.moveable.scalable = this.block.scalable && value;
1284
1348
  };
1285
1349
  FsBlockComponent.prototype._initMoveable = function () {
1286
1350
  var _this = this;
@@ -1442,8 +1506,14 @@
1442
1506
  _this._triggerChanged();
1443
1507
  });
1444
1508
  rxjs.fromEvent(this.el, 'mousedown')
1445
- .pipe(operators.takeUntil(this._destroy$)).subscribe(function (event) {
1446
- if (!_this.block.lock) {
1509
+ .pipe(operators.takeUntil(this._destroy$))
1510
+ .subscribe(function (event) {
1511
+ if (_this.block.lock) {
1512
+ event.preventDefault();
1513
+ event.stopImmediatePropagation();
1514
+ event.stopPropagation();
1515
+ }
1516
+ else {
1447
1517
  _this.zoompan.disable();
1448
1518
  }
1449
1519
  if (!_this.moveable.clippable) {
@@ -1473,7 +1543,7 @@
1473
1543
  _this.editable = true;
1474
1544
  _this._cdRef.markForCheck();
1475
1545
  setTimeout(function () {
1476
- _this.selectAll();
1546
+ _this.selectTextAll();
1477
1547
  });
1478
1548
  }
1479
1549
  });
@@ -1486,7 +1556,7 @@
1486
1556
  return FsBlockComponent;
1487
1557
  }());
1488
1558
  FsBlockComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockComponent, deps: [{ token: BlockEditorService }, { token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }, { token: GoogleFontService }], target: i0__namespace.ɵɵFactoryTarget.Component });
1489
- FsBlockComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsBlockComponent, selector: "fs-block", inputs: { block: "block", html: "html", zoompan: "zoompan" }, host: { properties: { "class.transforming": "this.transformating" } }, viewQueries: [{ propertyName: "element", first: true, predicate: ["element"], descendants: true, static: true }, { propertyName: "contentElement", first: true, predicate: ["contentElement"], descendants: true, static: true }, { propertyName: "contentEditable", first: true, predicate: ["contentEditable"], descendants: true, static: true }], ngImport: i0__namespace, template: "<div\n #element\n [class]=\"'block ' + 'block-' + block.type\"\n [style.top]=\"styleTop\"\n [style.left]=\"styleLeft\"\n [style.width]=\"styleWidth\"\n [style.height]=\"styleHeight\"\n [ngClass]=\"{ \n editable: editable, \n readonly: block.readonly,\n required: block.required,\n lock: block.lock,\n selected: selected\n }\"\n [style.zIndex]=\"block.index\">\n <div\n #contentElement\n class=\"content\"\n [style.borderColor]=\"block.borderColor\"\n [style.borderWidth]=\"block.borderWidth ? block.borderWidth + 'pt' : ''\"\n [style.borderStyle]=\"block.borderColor ? 'solid' : 'dashed'\"\n [style.textAlign]=\"block.horizontalAlign\"\n [style.fontStyle]=\"block.italic ? 'italic' : ''\"\n [style.fontFamily]=\"block.fontFamily || ''\"\n [style.fontSize]=\"block.fontSize ? block.fontSize + 'pt' : ''\"\n [style.lineHeight]=\"block.lineHeight ? block.lineHeight + 'pt' : ''\"\n [style.color]=\"block.fontColor\"\n [style.fontWeight]=\"block.bold ? 'bold' : ''\"\n [style.textDecoration]=\"block.underline ? 'underline' : ''\"\n [style.paddingTop]=\"block.paddingTop ? block.paddingTop + 'in' : ''\"\n [style.paddingBottom]=\"block.paddingBottom ? block.paddingBottom + 'in' : ''\"\n [style.paddingLeft]=\"block.paddingLeft ? block.paddingLeft + 'in' : ''\"\n [style.paddingRight]=\"block.paddingRight ? block.paddingRight + 'in' : ''\"\n [style.backgroundColor]=\"block.backgroundColor\"\n [style.borderBottomLeftRadius]=\"block.shapeRadius && block.shapeBottomLeft === 'round' ? block.shapeRadius + '%' : ''\"\n [style.borderBottomRightRadius]=\"block.shapeRadius && block.shapeBottomRight === 'round' ? block.shapeRadius + '%' : ''\"\n [style.borderTopRightRadius]=\"block.shapeRadius && block.shapeTopRight === 'round' ? block.shapeRadius + '%' : ''\"\n [style.borderTopLeftRadius]=\"block.shapeRadius && block.shapeTopLeft === 'round' ? block.shapeRadius + '%' : ''\"\n [style.boxShadow]=\"styleBoxShadow\"\n [ngClass]=\"{\n 'editable': editable,\n 'vertical-align-center': block.verticalAlign === 'center',\n 'vertical-align-bottom': block.verticalAlign === 'bottom'\n }\">\n <ng-container [ngSwitch]=\"block.type\">\n <ng-container *ngIf=\"block.imageUrl && ((block.imageUrl | createImageUrl) | async) as src\">\n <img \n [style.opacity]=\"block.imageOpacity ? block.imageOpacity/100 : 1\"\n [src]=\"src\">\n </ng-container>\n\n </ng-container>\n <ng-container *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText || block.type === BlockType.RadioButton || block.type === BlockType.Checkbox || block.type === BlockType.Date\">\n {{block.label || block.name}}\n </ng-container>\n <div\n #contentEditable\n [contentEditable]=\"editable\"\n class=\"content-editable\"\n [innerHTML]=\"content\">\n </div>\n </div>\n <div class=\"outline\"></div>\n</div>\n", styles: [":host ::ng-deep .moveable-control{width:10px!important;height:10px!important;margin-top:-5px!important;margin-left:-5px!important}:host.transforming ::ng-deep .moveable-control,:host.transforming ::ng-deep .moveable-rotation{display:none}.block{position:absolute;display:block;outline:none;-webkit-user-select:none;user-select:none;cursor:pointer;box-sizing:border-box}.block.selected{border-color:#31a2ff95}.block.block-shorttext,.block.block-longtext,.block.block-date,.block.block-radiobutton,.block.block-signature,.block.block-checkbox{background-color:#aab5e1cc;color:#585555;font-size:12px}.block.block-radiobutton{border-radius:50%}.block.required{background-color:#f7adaa}.block .content-editable{outline:none;position:relative;margin:-1px}.block.editable .content-editable{cursor:text}.block .content{flex-direction:column;height:100%;display:flex;border:0px solid transparent;position:relative;box-sizing:border-box;overflow:hidden}.block .content fs-html-editor{width:100%}.block .content.vertical-align-center{justify-content:center}.block .content.vertical-align-bottom{justify-content:flex-end}.block .content img{width:100%;height:100%;position:absolute}.block.selected .outline,.block:hover .outline{border:1px solid rgba(68,170,255,.7);position:absolute;top:0;left:0;bottom:0;right:0}.block.selected.lock .outline,.block:hover.lock .outline{border-color:#e4181866;border-style:dashed}:host ::ng-deep fs-html-editor .bottom-line,:host ::ng-deep fs-html-editor .fr-toolbar{display:none!important}:host ::ng-deep fs-html-editor .fr-wrapper{background:none!important;border:none!important}:host ::ng-deep .moveable-line:not(.moveable-rotation-line):not(.moveable-guideline){background:transparent!important}\n"], directives: [{ type: i13__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i13__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i13__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i13__namespace.AsyncPipe, "createImageUrl": CreateImageUrlPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
1559
+ FsBlockComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsBlockComponent, selector: "fs-block", inputs: { block: "block", html: "html", zoompan: "zoompan" }, host: { properties: { "class.transforming": "this.transformating" } }, viewQueries: [{ propertyName: "element", first: true, predicate: ["element"], descendants: true, static: true }, { propertyName: "contentElement", first: true, predicate: ["contentElement"], descendants: true, static: true }, { propertyName: "contentEditable", first: true, predicate: ["contentEditable"], descendants: true, static: true }], ngImport: i0__namespace, template: "<div\n #element\n [class]=\"'block ' + 'block-' + block.type\"\n [style.top]=\"styleTop\"\n [style.left]=\"styleLeft\"\n [style.width]=\"styleWidth\"\n [style.height]=\"styleHeight\"\n [ngClass]=\"{ \n editable: editable, \n readonly: block.readonly,\n required: block.required,\n lock: block.lock,\n selected: selected\n }\"\n [style.zIndex]=\"block.index\">\n <div\n #contentElement\n class=\"content\"\n [style.borderColor]=\"block.borderColor\"\n [style.borderWidth]=\"block.borderWidth ? block.borderWidth + 'pt' : ''\"\n [style.borderStyle]=\"block.borderColor ? 'solid' : 'dashed'\"\n [style.textAlign]=\"block.horizontalAlign\"\n [style.fontStyle]=\"block.italic ? 'italic' : ''\"\n [style.fontFamily]=\"block.fontFamily || ''\"\n [style.fontSize]=\"block.fontSize ? block.fontSize + 'pt' : ''\"\n [style.lineHeight]=\"block.lineHeight ? block.lineHeight + 'pt' : ''\"\n [style.color]=\"block.fontColor\"\n [style.fontWeight]=\"block.bold ? 'bold' : ''\"\n [style.textDecoration]=\"block.underline ? 'underline' : ''\"\n [style.paddingTop]=\"block.paddingTop ? block.paddingTop + 'in' : ''\"\n [style.paddingBottom]=\"block.paddingBottom ? block.paddingBottom + 'in' : ''\"\n [style.paddingLeft]=\"block.paddingLeft ? block.paddingLeft + 'in' : ''\"\n [style.paddingRight]=\"block.paddingRight ? block.paddingRight + 'in' : ''\"\n [style.backgroundColor]=\"block.backgroundColor\"\n [style.borderBottomLeftRadius]=\"block.shapeRadius && block.shapeBottomLeft === 'round' ? block.shapeRadius + '%' : ''\"\n [style.borderBottomRightRadius]=\"block.shapeRadius && block.shapeBottomRight === 'round' ? block.shapeRadius + '%' : ''\"\n [style.borderTopRightRadius]=\"block.shapeRadius && block.shapeTopRight === 'round' ? block.shapeRadius + '%' : ''\"\n [style.borderTopLeftRadius]=\"block.shapeRadius && block.shapeTopLeft === 'round' ? block.shapeRadius + '%' : ''\"\n [style.boxShadow]=\"styleBoxShadow\"\n [ngClass]=\"{\n 'editable': editable,\n 'vertical-align-center': block.verticalAlign === 'center',\n 'vertical-align-bottom': block.verticalAlign === 'bottom'\n }\">\n <ng-container [ngSwitch]=\"block.type\">\n <ng-container *ngIf=\"block.imageUrl && ((block.imageUrl | createImageUrl) | async) as src\">\n <img \n [style.opacity]=\"block.imageOpacity ? block.imageOpacity/100 : 1\"\n [src]=\"src\">\n </ng-container>\n\n </ng-container>\n <ng-container *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText || block.type === BlockType.RadioButton || block.type === BlockType.Checkbox || block.type === BlockType.Date\">\n {{block.label || block.name}}\n </ng-container>\n <div\n #contentEditable\n [contentEditable]=\"editable\"\n class=\"content-editable\"\n [innerHTML]=\"content\">\n </div>\n </div>\n <div class=\"outline\"></div>\n</div>\n", styles: [":host ::ng-deep .moveable-control{width:10px!important;height:10px!important;margin-top:-5px!important;margin-left:-5px!important}:host.transforming ::ng-deep .moveable-control,:host.transforming ::ng-deep .moveable-rotation{display:none}.block{position:absolute;display:block;outline:none;-webkit-user-select:none;user-select:none;cursor:pointer;box-sizing:border-box}.block.selected{border-color:#31a2ff95}.block.block-shorttext,.block.block-longtext,.block.block-date,.block.block-radiobutton,.block.block-signature,.block.block-checkbox{background-color:#aab5e1cc;color:#585555;font-size:12px}.block.block-radiobutton{border-radius:50%}.block.required{background-color:#f7adaa}.block .content-editable{outline:none;position:relative;height:100%;width:100%;z-index:100}.block.editable .content-editable{cursor:text}.block .content{flex-direction:column;height:100%;display:flex;border:0px solid transparent;position:relative;box-sizing:border-box;overflow:hidden}.block .content fs-html-editor{width:100%}.block .content.vertical-align-center{justify-content:center}.block .content.vertical-align-bottom{justify-content:flex-end}.block .content img{width:100%;height:100%;position:absolute}.block.selected .outline,.block:hover .outline{border:1px solid rgba(68,170,255,.7);position:absolute;top:0;left:0;bottom:0;right:0;-webkit-user-select:none;user-select:none}.block.selected.lock .outline,.block:hover.lock .outline{border-color:#e4181866;border-style:dashed}:host ::ng-deep fs-html-editor .bottom-line,:host ::ng-deep fs-html-editor .fr-toolbar{display:none!important}:host ::ng-deep fs-html-editor .fr-wrapper{background:none!important;border:none!important}:host ::ng-deep .moveable-line:not(.moveable-rotation-line):not(.moveable-guideline){background:transparent!important}\n"], directives: [{ type: i13__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i13__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i13__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i13__namespace.AsyncPipe, "createImageUrl": CreateImageUrlPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
1490
1560
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockComponent, decorators: [{
1491
1561
  type: i0.Component,
1492
1562
  args: [{
@@ -1505,7 +1575,8 @@
1505
1575
  type: i0.ViewChild,
1506
1576
  args: ['contentEditable', { static: true }]
1507
1577
  }], block: [{
1508
- type: i0.Input
1578
+ type: i0.Input,
1579
+ args: ['block']
1509
1580
  }], html: [{
1510
1581
  type: i0.Input
1511
1582
  }], zoompan: [{
@@ -1515,48 +1586,6 @@
1515
1586
  args: ['class.transforming']
1516
1587
  }] } });
1517
1588
 
1518
- var FsBlockEditorSidebarPanelDirective = /** @class */ (function () {
1519
- function FsBlockEditorSidebarPanelDirective(templateRef) {
1520
- this.templateRef = templateRef;
1521
- this.show = true;
1522
- }
1523
- return FsBlockEditorSidebarPanelDirective;
1524
- }());
1525
- FsBlockEditorSidebarPanelDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockEditorSidebarPanelDirective, deps: [{ token: i0__namespace.TemplateRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
1526
- FsBlockEditorSidebarPanelDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FsBlockEditorSidebarPanelDirective, selector: "[fsBlockEditorSidebarPanel]", inputs: { label: "label", show: "show" }, ngImport: i0__namespace });
1527
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockEditorSidebarPanelDirective, decorators: [{
1528
- type: i0.Directive,
1529
- args: [{
1530
- selector: '[fsBlockEditorSidebarPanel]'
1531
- }]
1532
- }], ctorParameters: function () { return [{ type: i0__namespace.TemplateRef }]; }, propDecorators: { label: [{
1533
- type: i0.Input
1534
- }], show: [{
1535
- type: i0.Input
1536
- }] } });
1537
-
1538
- var FsBlockEditorMarginDirective = /** @class */ (function () {
1539
- function FsBlockEditorMarginDirective(_elementRef) {
1540
- this._elementRef = _elementRef;
1541
- }
1542
- Object.defineProperty(FsBlockEditorMarginDirective.prototype, "element", {
1543
- get: function () {
1544
- return this._elementRef.nativeElement;
1545
- },
1546
- enumerable: false,
1547
- configurable: true
1548
- });
1549
- return FsBlockEditorMarginDirective;
1550
- }());
1551
- FsBlockEditorMarginDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockEditorMarginDirective, deps: [{ token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
1552
- FsBlockEditorMarginDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FsBlockEditorMarginDirective, selector: "[fsBlockEditorMargin]", ngImport: i0__namespace });
1553
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockEditorMarginDirective, decorators: [{
1554
- type: i0.Directive,
1555
- args: [{
1556
- selector: '[fsBlockEditorMargin]'
1557
- }]
1558
- }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }]; } });
1559
-
1560
1589
  var BlockFormats = [
1561
1590
  { value: BlockFormat.Number, name: 'Number', blockTypes: [exports.BlockType.ShortText, exports.BlockType.LongText] },
1562
1591
  { value: BlockFormat.Currency, name: 'Currency', blockTypes: [exports.BlockType.ShortText, exports.BlockType.LongText] },
@@ -1721,20 +1750,20 @@
1721
1750
  };
1722
1751
  SidebarComponent.prototype.layerMove = function (direction) {
1723
1752
  var _this = this;
1724
- this._blockEditor.blockComponents.forEach(function (blockComponent) {
1725
- if (_this._blockEditor.isSelectedBlock(blockComponent)) {
1726
- blockComponent.block.index += (999 * direction);
1753
+ this._blockEditor.blocks.forEach(function (block) {
1754
+ if (_this._blockEditor.isSelectedBlock(block)) {
1755
+ block.index += (999 * direction);
1727
1756
  }
1728
1757
  });
1729
- var sorted = this._blockEditor.blockComponents.sort(function (a, b) {
1730
- return a.block.index > b.block.index ? 1 : -1;
1758
+ var sorted = this._blockEditor.blocks.sort(function (a, b) {
1759
+ return a.index > b.index ? 1 : -1;
1731
1760
  });
1732
- sorted.forEach(function (item, index) {
1733
- item.block.index = index;
1734
- item.markForCheck();
1761
+ sorted.forEach(function (block, index) {
1762
+ block.index = index;
1763
+ _this._blockEditor.blockChange(block);
1735
1764
  });
1736
1765
  if (this.config.blocksLevelChanged) {
1737
- this.config.blocksLevelChanged(sorted.map(function (item) { return item.block; }));
1766
+ this.config.blocksLevelChanged(sorted.map(function (block) { return block; }));
1738
1767
  }
1739
1768
  };
1740
1769
  SidebarComponent.prototype.layerUp = function () {
@@ -1835,23 +1864,23 @@
1835
1864
  .subscribe(function (event) {
1836
1865
  event.preventDefault();
1837
1866
  var inchPixel = 1 / 100;
1838
- _this._blockEditor.selectedComponentBlocks
1839
- .forEach(function (blockComponent) {
1867
+ _this._blockEditor.selectedBlocks
1868
+ .forEach(function (block) {
1840
1869
  switch (event.key) {
1841
1870
  case 'ArrowUp':
1842
- blockComponent.block.top = blockComponent.block.top - inchPixel;
1871
+ block.top = common.round(block.top - inchPixel, 2);
1843
1872
  break;
1844
1873
  case 'ArrowDown':
1845
- blockComponent.block.top = blockComponent.block.top + inchPixel;
1874
+ block.top = common.round(block.top + inchPixel, 2);
1846
1875
  break;
1847
1876
  case 'ArrowLeft':
1848
- blockComponent.block.left = blockComponent.block.left - inchPixel;
1877
+ block.left = common.round(block.left - inchPixel, 2);
1849
1878
  break;
1850
1879
  case 'ArrowRight':
1851
- blockComponent.block.left = blockComponent.block.left + inchPixel;
1880
+ block.left = common.round(block.left + inchPixel, 2);
1852
1881
  break;
1853
1882
  }
1854
- _this._blockEditor.blockChange(blockComponent.block);
1883
+ _this._blockEditor.blockChange(block);
1855
1884
  });
1856
1885
  });
1857
1886
  };