@firestitch/block-editor 12.1.9 → 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.
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/forms'), require('@angular/material/input'), require('@angular/core'), require('@angular/common'), require('@angular/material/button'), require('@angular/material/form-field'), require('@angular/material/icon'), require('@firestitch/colorpicker'), require('@firestitch/file'), require('@firestitch/menu'), require('@firestitch/zoom-pan'), require('rxjs/operators'), require('moveable'), require('rxjs'), require('@firestitch/common'), require('@firestitch/prompt'), require('@angular/material/select'), require('@angular/material/core'), require('@angular/material/checkbox'), require('@angular/material/tooltip')) :
3
- typeof define === 'function' && define.amd ? define('@firestitch/block-editor', ['exports', '@angular/forms', '@angular/material/input', '@angular/core', '@angular/common', '@angular/material/button', '@angular/material/form-field', '@angular/material/icon', '@firestitch/colorpicker', '@firestitch/file', '@firestitch/menu', '@firestitch/zoom-pan', 'rxjs/operators', 'moveable', 'rxjs', '@firestitch/common', '@firestitch/prompt', '@angular/material/select', '@angular/material/core', '@angular/material/checkbox', '@angular/material/tooltip'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.firestitch = global.firestitch || {}, global.firestitch["block-editor"] = {}), global.ng.forms, global.ng.material.input, global.ng.core, global.ng.common, global.ng.material.button, global.ng.material.formField, global.ng.material.icon, global.i10, global.i3, global.menu, global.i2$1, global.rxjs.operators, global.Moveable, global.rxjs, global.common, global.i2, global.ng.material.select, global.ng.material.core, global.ng.material.checkbox, global.ng.material.tooltip));
5
- })(this, (function (exports, i14, i13, i0, i11, i4, i6, i5, i10, i3, menu, i2$1, operators, Moveable, rxjs, common, i2, i7, i8, i9, i12) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/forms'), require('@angular/material/input'), require('@angular/core'), require('@angular/common'), require('@angular/material/button'), require('@angular/material/form-field'), require('@angular/material/icon'), require('@angular/material/checkbox'), require('@angular/material/tooltip'), require('@angular/material/select'), require('@angular/material/list'), require('@angular/cdk/drag-drop'), require('@firestitch/colorpicker'), require('@firestitch/file'), require('@firestitch/menu'), require('@firestitch/zoom-pan'), require('@firestitch/dialog'), require('rxjs/operators'), require('moveable'), require('rxjs'), require('@angular/material/dialog'), require('@firestitch/common'), require('@angular/material/divider'), require('@firestitch/prompt'), require('@angular/material/core')) :
3
+ typeof define === 'function' && define.amd ? define('@firestitch/block-editor', ['exports', '@angular/forms', '@angular/material/input', '@angular/core', '@angular/common', '@angular/material/button', '@angular/material/form-field', '@angular/material/icon', '@angular/material/checkbox', '@angular/material/tooltip', '@angular/material/select', '@angular/material/list', '@angular/cdk/drag-drop', '@firestitch/colorpicker', '@firestitch/file', '@firestitch/menu', '@firestitch/zoom-pan', '@firestitch/dialog', 'rxjs/operators', 'moveable', 'rxjs', '@angular/material/dialog', '@firestitch/common', '@angular/material/divider', '@firestitch/prompt', '@angular/material/core'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.firestitch = global.firestitch || {}, global.firestitch["block-editor"] = {}), global.ng.forms, global.ng.material.input, global.ng.core, global.ng.common, global.ng.material.button, global.ng.material.formField, global.ng.material.icon, global.ng.material.checkbox, global.ng.material.tooltip, global.ng.material.select, global.ng.material.list, global.ng.cdk.dragDrop, global.i10, global.i3$1, global.menu, global.i2$2, global.i2, global.rxjs.operators, global.Moveable, global.rxjs, global.ng.material.dialog, global.common, global.ng.material.divider, global.i2$1, global.ng.material.core));
5
+ })(this, (function (exports, i14, i13, i0, i11, i6, i6$1, i3, i9, i12, i7$1, i4, i7, i10, i3$1, menu, i2$2, i2, operators, Moveable, rxjs, i1, common, i5, i2$1, i8) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -28,18 +28,23 @@
28
28
  var i13__namespace = /*#__PURE__*/_interopNamespace(i13);
29
29
  var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
30
30
  var i11__namespace = /*#__PURE__*/_interopNamespace(i11);
31
- var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
32
31
  var i6__namespace = /*#__PURE__*/_interopNamespace(i6);
33
- var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
34
- var i10__namespace = /*#__PURE__*/_interopNamespace(i10);
32
+ var i6__namespace$1 = /*#__PURE__*/_interopNamespace(i6$1);
35
33
  var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
36
- var i2__namespace$1 = /*#__PURE__*/_interopNamespace(i2$1);
37
- var Moveable__default = /*#__PURE__*/_interopDefaultLegacy(Moveable);
38
- var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
39
- var i7__namespace = /*#__PURE__*/_interopNamespace(i7);
40
- var i8__namespace = /*#__PURE__*/_interopNamespace(i8);
41
34
  var i9__namespace = /*#__PURE__*/_interopNamespace(i9);
42
35
  var i12__namespace = /*#__PURE__*/_interopNamespace(i12);
36
+ var i7__namespace$1 = /*#__PURE__*/_interopNamespace(i7$1);
37
+ var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
38
+ var i7__namespace = /*#__PURE__*/_interopNamespace(i7);
39
+ var i10__namespace = /*#__PURE__*/_interopNamespace(i10);
40
+ var i3__namespace$1 = /*#__PURE__*/_interopNamespace(i3$1);
41
+ var i2__namespace$2 = /*#__PURE__*/_interopNamespace(i2$2);
42
+ var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
43
+ var Moveable__default = /*#__PURE__*/_interopDefaultLegacy(Moveable);
44
+ var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
45
+ var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
46
+ var i2__namespace$1 = /*#__PURE__*/_interopNamespace(i2$1);
47
+ var i8__namespace = /*#__PURE__*/_interopNamespace(i8);
43
48
 
44
49
  exports.BlockType = void 0;
45
50
  (function (BlockType) {
@@ -62,6 +67,52 @@
62
67
  BlockFormat["Number"] = "number";
63
68
  })(BlockFormat || (BlockFormat = {}));
64
69
 
70
+ var BlockTypes = [
71
+ { value: exports.BlockType.Rectangle, name: 'Rectangle', icon: 'crop_5_4' },
72
+ { value: exports.BlockType.ShortText, name: 'Short Text', icon: 'short_text' },
73
+ { value: exports.BlockType.LongText, name: 'Long Text', icon: 'subject' },
74
+ { value: exports.BlockType.RadioButton, name: 'Radio Button', icon: 'radio_button_checked' },
75
+ { value: exports.BlockType.Checkbox, name: 'Checkbox', icon: 'check_box' },
76
+ { value: exports.BlockType.Date, name: 'Date', icon: 'calendar_today' },
77
+ { value: exports.BlockType.Signature, name: 'Signature', icon: 'draw' },
78
+ { value: exports.BlockType.Image, name: 'Image', icon: 'image', accept: 'image/*' },
79
+ { value: exports.BlockType.Pdf, name: 'Pdf', icon: 'picture_as_pdf', accept: 'application/pdf' },
80
+ ];
81
+
82
+ var LayersReorderDialogComponent = /** @class */ (function () {
83
+ function LayersReorderDialogComponent(_dialogData, _dialogRef) {
84
+ this._dialogRef = _dialogRef;
85
+ this.blockTypeIcons = common.index(BlockTypes, 'value', 'icon');
86
+ this._init(_dialogData);
87
+ }
88
+ LayersReorderDialogComponent.prototype.swapItems = function (event) {
89
+ i7.moveItemInArray(this.fields, event.previousIndex, event.currentIndex);
90
+ };
91
+ LayersReorderDialogComponent.prototype.done = function () {
92
+ this._dialogRef.close(this.fields);
93
+ };
94
+ LayersReorderDialogComponent.prototype._init = function (data) {
95
+ this.fields = data.fields;
96
+ };
97
+ return LayersReorderDialogComponent;
98
+ }());
99
+ LayersReorderDialogComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: LayersReorderDialogComponent, deps: [{ token: i1.MAT_DIALOG_DATA }, { token: i1__namespace.MatDialogRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
100
+ 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 field of fields\">\n <mat-list-item cdkDrag cdkDragLockAxis=\"y\">\n <mat-icon cdkDragHandle>drag_handle</mat-icon>\n <mat-icon>\n {{ blockTypeIcons[field.block.type] }}\n </mat-icon>\n <span class=\"block-label\">\n {{ field.block.label || 'no label' }}\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}.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.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1__namespace.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: i11__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.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }] });
101
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: LayersReorderDialogComponent, decorators: [{
102
+ type: i0.Component,
103
+ args: [{
104
+ templateUrl: './layers-reorder-dialog.component.html',
105
+ styleUrls: [
106
+ './layers-reorder-dialog.component.scss',
107
+ ]
108
+ }]
109
+ }], ctorParameters: function () {
110
+ return [{ type: undefined, decorators: [{
111
+ type: i0.Inject,
112
+ args: [i1.MAT_DIALOG_DATA]
113
+ }] }, { type: i1__namespace.MatDialogRef }];
114
+ } });
115
+
65
116
  /*! *****************************************************************************
66
117
  Copyright (c) Microsoft Corporation.
67
118
 
@@ -380,157 +431,305 @@
380
431
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
381
432
  }
382
433
 
383
- var BlockEditorService = /** @class */ (function () {
384
- function BlockEditorService() {
385
- this._blockChanged$ = new rxjs.Subject();
386
- this._blockRemoved$ = new rxjs.Subject();
387
- this._blockAdded$ = new rxjs.Subject();
434
+ var EventType;
435
+ (function (EventType) {
436
+ EventType["Add"] = "add";
437
+ EventType["Change"] = "change";
438
+ EventType["Remove"] = "remove";
439
+ })(EventType || (EventType = {}));
440
+ var BlocksStore = /** @class */ (function () {
441
+ function BlocksStore() {
442
+ this._lastTabIndex = -1;
443
+ this._eventBus$ = new rxjs.Subject();
388
444
  this._blocks$ = new rxjs.BehaviorSubject([]);
389
- this._selectedBlocks$ = new rxjs.BehaviorSubject([]);
390
- this._blockComponents = new Map();
391
445
  this._destroy$ = new rxjs.Subject();
392
446
  }
393
- Object.defineProperty(BlockEditorService.prototype, "elementGuidelines", {
447
+ Object.defineProperty(BlocksStore.prototype, "blocks", {
394
448
  get: function () {
395
- return __spreadArray(__spreadArray([], __read(Array.from(this._blockComponents.values())
396
- .map(function (block) {
397
- return block.el;
398
- }))), [
399
- this.container,
400
- this.margin,
401
- ]);
449
+ return __spreadArray([], __read(this._blocks$.getValue()));
402
450
  },
403
451
  enumerable: false,
404
452
  configurable: true
405
453
  });
406
- Object.defineProperty(BlockEditorService.prototype, "blockComponents", {
454
+ Object.defineProperty(BlocksStore.prototype, "blocks$", {
407
455
  get: function () {
408
- return Array.from(this._blockComponents.values());
456
+ return this._blocks$.asObservable();
409
457
  },
410
458
  enumerable: false,
411
459
  configurable: true
412
460
  });
413
- Object.defineProperty(BlockEditorService.prototype, "selectedComponentBlocks", {
461
+ Object.defineProperty(BlocksStore.prototype, "blockAdded$", {
414
462
  get: function () {
415
- var _this = this;
416
- return this.blockComponents
417
- .filter(function (blockComponent) { return _this.selectedBlocks.indexOf(blockComponent.block) !== -1; });
463
+ return this._eventBus$
464
+ .pipe(operators.filter(function (_a) {
465
+ var type = _a.type;
466
+ return type === EventType.Add;
467
+ }), operators.map(function (_a) {
468
+ var value = _a.value;
469
+ return value;
470
+ }));
471
+ },
472
+ enumerable: false,
473
+ configurable: true
474
+ });
475
+ Object.defineProperty(BlocksStore.prototype, "blockChanged$", {
476
+ get: function () {
477
+ return this._eventBus$
478
+ .pipe(operators.filter(function (_a) {
479
+ var type = _a.type;
480
+ return type === EventType.Change;
481
+ }), operators.map(function (_a) {
482
+ var value = _a.value;
483
+ return value;
484
+ }));
418
485
  },
419
486
  enumerable: false,
420
487
  configurable: true
421
488
  });
422
- BlockEditorService.prototype.blockUpload = function (block, fsFile) {
489
+ Object.defineProperty(BlocksStore.prototype, "blockRemoved$", {
490
+ get: function () {
491
+ return this._eventBus$
492
+ .pipe(operators.filter(function (_a) {
493
+ var type = _a.type;
494
+ return type === EventType.Remove;
495
+ }), operators.map(function (_a) {
496
+ var value = _a.value;
497
+ return value;
498
+ }));
499
+ },
500
+ enumerable: false,
501
+ configurable: true
502
+ });
503
+ BlocksStore.prototype.ngOnDestroy = function () {
504
+ this._destroy$.next();
505
+ this._destroy$.complete();
506
+ };
507
+ BlocksStore.prototype.init = function (config) {
423
508
  var _this = this;
424
- if (this.config.blockUpload) {
425
- this.config.blockUpload(block, fsFile.file)
426
- .pipe(operators.takeUntil(this._destroy$))
509
+ this._config = config;
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())
427
514
  .subscribe(function (block) {
428
- var blocks = __spreadArray(__spreadArray([], __read(_this.blocks)), [
429
- block,
430
- ]);
431
- _this.blocks = _this._updateIndexesFor(blocks);
432
- _this._blockAdded$.next(block);
433
- if (_this.config.blockAdded) {
434
- _this.config.blockAdded(block);
435
- }
436
- //this._updateIndexes();
515
+ _this._config.blockChanged(block);
437
516
  });
438
517
  }
439
518
  };
440
- BlockEditorService.prototype.blockAdd = function (block) {
519
+ BlocksStore.prototype.blockExists = function (block) {
520
+ var index = this.blocks.findIndex(function (b) {
521
+ return b.guid === block.guid;
522
+ });
523
+ return index !== -1;
524
+ };
525
+ BlocksStore.prototype.blockAdd = function (block, initBlock) {
441
526
  var _this = this;
442
- if (this.config.blockAdd) {
443
- this.config.blockAdd(block)
444
- .pipe(operators.takeUntil(this._destroy$))
445
- .subscribe(function (block) {
446
- var blocks = __spreadArray(__spreadArray([], __read(_this.blocks)), [
447
- block,
448
- ]);
449
- _this.blocks = _this._updateIndexesFor(blocks);
450
- _this._blockAdded$.next(block);
451
- if (_this.config.blockAdded) {
452
- _this.config.blockAdded(block);
453
- }
454
- //this._updateIndexes();
455
- });
527
+ if (initBlock === void 0) { initBlock = false; }
528
+ if (!this._config.blockAdd) {
529
+ console.warn('[BlockEditor] Config "blockAdd" is not defined');
530
+ return;
456
531
  }
532
+ if (initBlock) {
533
+ block = this._createBlock(block);
534
+ }
535
+ this._config.blockAdd(block)
536
+ .pipe(operators.takeUntil(this._destroy$))
537
+ .subscribe(function (newBlock) {
538
+ _this._appendBlock(newBlock);
539
+ });
457
540
  };
458
- BlockEditorService.prototype._updateIndexesFor = function (blocks) {
541
+ BlocksStore.prototype.blockUpload = function (block, fsFile, initBlock) {
542
+ var _this = this;
543
+ if (initBlock === void 0) { initBlock = false; }
544
+ if (!this._config.blockUpload) {
545
+ console.warn('[BlockEditor] Config "blockUpload" is not defined');
546
+ return;
547
+ }
548
+ if (initBlock) {
549
+ block = this._createBlock(block);
550
+ }
551
+ this._config.blockUpload(block, fsFile.file)
552
+ .pipe(operators.takeUntil(this._destroy$))
553
+ .subscribe(function (newBlock) {
554
+ _this._appendBlock(newBlock);
555
+ });
556
+ };
557
+ BlocksStore.prototype.blockChange = function (block) {
558
+ this._dispatchEvent(EventType.Change, block);
559
+ };
560
+ BlocksStore.prototype.blockRemove = function (targetBlocks) {
561
+ var _this = this;
562
+ var blocks = this.blocks;
563
+ if (!Array.isArray(targetBlocks)) {
564
+ targetBlocks = [targetBlocks];
565
+ }
566
+ targetBlocks.forEach(function (block) {
567
+ var index = blocks
568
+ .findIndex(function (b) { return b.guid === block.guid; });
569
+ if (index !== -1) {
570
+ blocks.splice(index, 1);
571
+ _this._dispatchEvent(EventType.Remove, block);
572
+ }
573
+ });
574
+ this._setBlocks(blocks);
575
+ };
576
+ BlocksStore.prototype.isReordableBlock = function (block) {
577
+ return [
578
+ exports.BlockType.LongText,
579
+ exports.BlockType.ShortText,
580
+ exports.BlockType.RadioButton,
581
+ exports.BlockType.Checkbox,
582
+ exports.BlockType.Date,
583
+ exports.BlockType.Signature,
584
+ ].indexOf(block.type) > -1;
585
+ };
586
+ BlocksStore.prototype.updateTabIndex = function (index) {
587
+ this._lastTabIndex = index;
588
+ };
589
+ BlocksStore.prototype._setBlocks = function (blocks) {
590
+ var _this = this;
591
+ this._blocks$.next(__spreadArray([], __read(blocks)));
592
+ blocks
593
+ .filter(function (b) { return _this.isReordableBlock(b); })
594
+ .forEach(function (b) {
595
+ _this._lastTabIndex = Math.max(b.tabIndex, _this._lastTabIndex);
596
+ });
597
+ };
598
+ BlocksStore.prototype._appendBlock = function (block) {
599
+ var blocks = __spreadArray(__spreadArray([], __read(this.blocks)), [
600
+ block,
601
+ ]);
602
+ this._deduplicateIndexesFor(blocks);
603
+ this._setBlocks(blocks);
604
+ this._dispatchEvent(EventType.Add, block);
605
+ };
606
+ BlocksStore.prototype._dispatchEvent = function (type, value) {
607
+ this._eventBus$.next({
608
+ type: type,
609
+ value: value,
610
+ });
611
+ };
612
+ BlocksStore.prototype._createBlock = function (block) {
613
+ var newBlock = Object.assign(Object.assign({ shapeBottomLeft: 'round', shapeTopLeft: 'round', shapeTopRight: 'round', shapeBottomRight: 'round', verticalAlign: 'top', horizontalAlign: 'left' }, block), { guid: block.guid || common.guid('xxxxxxxxxxxx') });
614
+ var width = (this._config.width * .333).toFixed(2);
615
+ var height = width / 2;
616
+ if (newBlock.type === exports.BlockType.Rectangle) {
617
+ newBlock.borderColor = '#cccccc';
618
+ newBlock.borderWidth = 1;
619
+ }
620
+ else if (newBlock.type === exports.BlockType.Checkbox || newBlock.type === exports.BlockType.RadioButton) {
621
+ width = .25;
622
+ height = .25;
623
+ newBlock.keepRatio = true;
624
+ }
625
+ else {
626
+ width = 2;
627
+ height = .5;
628
+ }
629
+ if (this.isReordableBlock(newBlock)) {
630
+ newBlock.tabIndex = this._lastTabIndex + 1;
631
+ this.updateTabIndex(newBlock.tabIndex);
632
+ }
633
+ return Object.assign({ top: height, left: width, width: width, height: height }, newBlock);
634
+ };
635
+ BlocksStore.prototype._deduplicateIndexesFor = function (blocks) {
459
636
  blocks.forEach(function (block, index) {
460
637
  block.index = index;
461
638
  });
462
- return blocks;
463
- };
464
- // private _updateIndexes(): void {
465
- // const sort = this.blocks.slice().sort((a, b) => {
466
- // return a.index > b.index ? 1 : -1;
467
- // })
468
- // sort.forEach((block, index) => {
469
- // this.blocks.find((item) => {
470
- // return block.reference === item.reference;
471
- // }).index = index;
472
- // });
473
- // }
474
- BlockEditorService.prototype.removeBlock = function (block) {
475
- var index = this.indexOf(block);
476
- if (index !== -1) {
477
- var blocks = this.blocks;
478
- blocks.splice(index, 1);
479
- this.blocks = blocks;
480
- this._blockRemoved$.next(block);
481
- }
639
+ };
640
+ return BlocksStore;
641
+ }());
642
+ BlocksStore.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BlocksStore, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
643
+ BlocksStore.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BlocksStore });
644
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BlocksStore, decorators: [{
645
+ type: i0.Injectable
646
+ }] });
647
+
648
+ var BlockEditorService = /** @class */ (function () {
649
+ function BlockEditorService(_store, _dialog) {
650
+ this._store = _store;
651
+ this._dialog = _dialog;
652
+ this._selectedBlocks$ = new rxjs.BehaviorSubject([]);
653
+ this._blockComponents = new Map();
654
+ this._destroy$ = new rxjs.Subject();
655
+ }
656
+ Object.defineProperty(BlockEditorService.prototype, "blockComponents", {
657
+ get: function () {
658
+ return Array.from(this._blockComponents.values());
659
+ },
660
+ enumerable: false,
661
+ configurable: true
662
+ });
663
+ Object.defineProperty(BlockEditorService.prototype, "selectedComponentBlocks", {
664
+ get: function () {
665
+ var _this = this;
666
+ return this.blockComponents
667
+ .filter(function (blockComponent) { return _this.selectedBlocks.indexOf(blockComponent.block) !== -1; });
668
+ },
669
+ enumerable: false,
670
+ configurable: true
671
+ });
672
+ BlockEditorService.prototype.init = function (config) {
673
+ this.config = config;
674
+ this._store.init(Object.assign({}, this.config));
675
+ };
676
+ BlockEditorService.prototype.blockAdd = function (block, newBlock) {
677
+ if (newBlock === void 0) { newBlock = false; }
678
+ this._store.blockAdd(block, newBlock);
679
+ };
680
+ BlockEditorService.prototype.blockUpload = function (block, fsFile, newBlock) {
681
+ if (newBlock === void 0) { newBlock = false; }
682
+ this._store.blockUpload(block, fsFile, false);
683
+ };
684
+ BlockEditorService.prototype.blockRemove = function (block) {
685
+ this._store.blockRemove(block);
482
686
  };
483
687
  BlockEditorService.prototype.removeSelectedBlocks = function () {
484
688
  var _this = this;
485
- this.selectedBlocks.forEach(function (block) {
486
- _this.removeBlock(block);
689
+ this.selectedBlocks
690
+ .forEach(function (block) {
691
+ _this.blockRemove(block);
487
692
  });
488
693
  this.selectedBlocks = [];
489
694
  };
490
695
  Object.defineProperty(BlockEditorService.prototype, "blocks$", {
491
696
  get: function () {
492
- return this._blocks$;
697
+ return this._store.blocks$;
493
698
  },
494
699
  enumerable: false,
495
700
  configurable: true
496
701
  });
497
702
  Object.defineProperty(BlockEditorService.prototype, "blockChanged$", {
498
703
  get: function () {
499
- return this._blockChanged$;
704
+ return this._store.blockChanged$;
500
705
  },
501
706
  enumerable: false,
502
707
  configurable: true
503
708
  });
504
- Object.defineProperty(BlockEditorService.prototype, "blockRemoved$", {
709
+ Object.defineProperty(BlockEditorService.prototype, "blockAdded$", {
505
710
  get: function () {
506
- return this._blockRemoved$;
711
+ return this._store.blockAdded$;
507
712
  },
508
713
  enumerable: false,
509
714
  configurable: true
510
715
  });
511
- Object.defineProperty(BlockEditorService.prototype, "blockAdded$", {
716
+ Object.defineProperty(BlockEditorService.prototype, "blockRemoved$", {
512
717
  get: function () {
513
- return this._blockAdded$;
718
+ return this._store.blockRemoved$;
514
719
  },
515
720
  enumerable: false,
516
721
  configurable: true
517
722
  });
518
- BlockEditorService.prototype.blockChange = function (block) {
519
- this._blockChanged$.next(block);
520
- if (this.config.blockChanged) {
521
- this.config.blockChanged(block);
522
- }
523
- };
524
723
  Object.defineProperty(BlockEditorService.prototype, "blocks", {
525
724
  get: function () {
526
- return this._blocks$.getValue();
527
- },
528
- set: function (blocks) {
529
- this._blocks$.next(blocks);
725
+ return this._store.blocks;
530
726
  },
531
727
  enumerable: false,
532
728
  configurable: true
533
729
  });
730
+ BlockEditorService.prototype.blockChange = function (block) {
731
+ this._store.blockChange(block);
732
+ };
534
733
  BlockEditorService.prototype.isSelectedBlock = function (block) {
535
734
  return this.selectedBlocks.indexOf(block.block) !== -1;
536
735
  };
@@ -539,27 +738,11 @@
539
738
  };
540
739
  BlockEditorService.prototype.selectedBlockComponentChangeProperty = function (value, name) {
541
740
  var _this = this;
542
- if (name === 'index') {
543
- var blocks_1 = this.blocks;
544
- var affectedGUIDs_1 = this.selectedBlocks.map(function (block) { return block.guid; });
545
- blocks_1.forEach(function (block, index) {
546
- var guidIndex = affectedGUIDs_1.indexOf(block.guid);
547
- if (guidIndex !== -1) {
548
- blocks_1.splice(index, 1);
549
- blocks_1.splice(+value, 0, block);
550
- block.index = +value;
551
- _this.blockChange(block);
552
- }
553
- });
554
- this._updateIndexesFor(blocks_1);
555
- }
556
- else {
557
- this.selectedBlocks
558
- .forEach(function (block) {
559
- block[name] = value;
560
- _this.blockChange(block);
561
- });
562
- }
741
+ this.selectedBlocks
742
+ .forEach(function (block) {
743
+ block[name] = value;
744
+ _this.blockChange(block);
745
+ });
563
746
  };
564
747
  Object.defineProperty(BlockEditorService.prototype, "selectedBlocks$", {
565
748
  get: function () {
@@ -615,14 +798,6 @@
615
798
  BlockEditorService.prototype.registerBlock = function (block, blockComponent) {
616
799
  this._blockComponents.set(block, blockComponent);
617
800
  this.blockComponents.push(block);
618
- // Disabled for now
619
- // this.blockComponents.forEach((blockComponent: FsBlockComponent) => {
620
- // const blocks = this.elementGuidelines
621
- // .filter((el) => {
622
- // return !el.isSameNode(blockComponent.el);
623
- // });
624
- // blockComponent.elementGuidelines = blocks;
625
- // });
626
801
  };
627
802
  BlockEditorService.prototype.unregisterBlock = function (block) {
628
803
  this._blockComponents.delete(block);
@@ -633,26 +808,27 @@
633
808
  BlockEditorService.prototype.registerMargin = function (margin) {
634
809
  this.margin = margin;
635
810
  };
636
- BlockEditorService.prototype.sanitizeNewBlock = function (block) {
637
- var width = (this.config.width * .333).toFixed(2);
638
- var height = width / 2;
639
- if (block.type === exports.BlockType.Rectangle) {
640
- block.borderColor = '#cccccc';
641
- block.borderWidth = 1;
642
- }
643
- else if (block.type === exports.BlockType.Checkbox || block.type === exports.BlockType.RadioButton) {
644
- width = .25;
645
- height = .25;
646
- block.keepRatio = true;
647
- }
648
- else {
649
- width = 2;
650
- height = .5;
651
- }
652
- return this.sanitizeBlock(Object.assign({ top: height, left: width, width: width, height: height }, block));
653
- };
654
- BlockEditorService.prototype.sanitizeBlock = function (block) {
655
- return Object.assign(Object.assign({ shapeBottomLeft: 'round', shapeTopLeft: 'round', shapeTopRight: 'round', shapeBottomRight: 'round', verticalAlign: 'top', horizontalAlign: 'left' }, block), { guid: block.guid || common.guid('xxxxxxxxxxxx') });
811
+ BlockEditorService.prototype.openReorderDialog = function () {
812
+ var _this = this;
813
+ var reordableFields = this.blockComponents
814
+ .filter(function (blockCmp) {
815
+ return _this._store.isReordableBlock(blockCmp.block);
816
+ });
817
+ this._dialog
818
+ .open(LayersReorderDialogComponent, {
819
+ data: {
820
+ fields: reordableFields,
821
+ }
822
+ })
823
+ .afterClosed()
824
+ .pipe(operators.takeUntil(this._destroy$))
825
+ .subscribe(function (fields) {
826
+ fields.forEach(function (blockCmp, index) {
827
+ blockCmp.block.tabIndex = index;
828
+ _this._store.blockChange(blockCmp.block);
829
+ _this._store.updateTabIndex(index);
830
+ });
831
+ });
656
832
  };
657
833
  BlockEditorService.prototype.ngOnDestroy = function () {
658
834
  this._destroy$.next();
@@ -660,11 +836,11 @@
660
836
  };
661
837
  return BlockEditorService;
662
838
  }());
663
- BlockEditorService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BlockEditorService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
839
+ BlockEditorService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BlockEditorService, deps: [{ token: BlocksStore }, { token: i2__namespace.FsDialog }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
664
840
  BlockEditorService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BlockEditorService });
665
841
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BlockEditorService, decorators: [{
666
842
  type: i0.Injectable
667
- }] });
843
+ }], ctorParameters: function () { return [{ type: BlocksStore }, { type: i2__namespace.FsDialog }]; } });
668
844
 
669
845
  var FsBlockComponent = /** @class */ (function () {
670
846
  function FsBlockComponent(_blockEditor, _elementRef, _cdRef) {
@@ -750,7 +926,8 @@
750
926
  });
751
927
  Object.defineProperty(FsBlockComponent.prototype, "top", {
752
928
  set: function (value) {
753
- this.element.nativeElement.style.top = "" + parseFloat(value) + this.unit;
929
+ this.block.top = parseFloat(value);
930
+ this.element.nativeElement.style.top = "" + this.block.top + this.unit;
754
931
  this.moveable.updateRect();
755
932
  },
756
933
  enumerable: false,
@@ -758,7 +935,8 @@
758
935
  });
759
936
  Object.defineProperty(FsBlockComponent.prototype, "left", {
760
937
  set: function (value) {
761
- this.element.nativeElement.style.left = "" + parseFloat(value) + this.unit;
938
+ this.block.left = parseFloat(value);
939
+ this.element.nativeElement.style.left = "" + this.block.left + this.unit;
762
940
  this.moveable.updateRect();
763
941
  },
764
942
  enumerable: false,
@@ -1055,18 +1233,6 @@
1055
1233
  type: i0.Input
1056
1234
  }] } });
1057
1235
 
1058
- var BlockTypes = [
1059
- { value: exports.BlockType.Rectangle, name: 'Rectangle', icon: 'crop_5_4' },
1060
- { value: exports.BlockType.ShortText, name: 'Short Text', icon: 'short_text' },
1061
- { value: exports.BlockType.LongText, name: 'Long Text', icon: 'subject' },
1062
- { value: exports.BlockType.RadioButton, name: 'Radio Button', icon: 'radio_button_checked' },
1063
- { value: exports.BlockType.Checkbox, name: 'Checkbox', icon: 'check_box' },
1064
- { value: exports.BlockType.Date, name: 'Date', icon: 'calendar_today' },
1065
- { value: exports.BlockType.Signature, name: 'Signature', icon: 'draw' },
1066
- { value: exports.BlockType.Image, name: 'Image', icon: 'image', accept: 'image/*' },
1067
- { value: exports.BlockType.Pdf, name: 'Pdf', icon: 'picture_as_pdf', accept: 'application/pdf' },
1068
- ];
1069
-
1070
1236
  var BlockFormats = [
1071
1237
  { value: BlockFormat.Number, name: 'Number', blockTypes: [exports.BlockType.ShortText, exports.BlockType.LongText] },
1072
1238
  { value: BlockFormat.Currency, name: 'Currency', blockTypes: [exports.BlockType.ShortText, exports.BlockType.LongText] },
@@ -1075,11 +1241,12 @@
1075
1241
  ];
1076
1242
 
1077
1243
  var SidebarComponent = /** @class */ (function () {
1078
- function SidebarComponent(_el, _blockEditor, _cdRef, _prompt) {
1244
+ function SidebarComponent(_el, _blockEditor, _cdRef, _prompt, _document) {
1079
1245
  this._el = _el;
1080
1246
  this._blockEditor = _blockEditor;
1081
1247
  this._cdRef = _cdRef;
1082
1248
  this._prompt = _prompt;
1249
+ this._document = _document;
1083
1250
  this.zoomCenter = new i0.EventEmitter();
1084
1251
  this.BlockTypes = BlockTypes;
1085
1252
  this.blockTypeNames = common.index(BlockTypes, 'value', 'name');
@@ -1225,20 +1392,18 @@
1225
1392
  });
1226
1393
  }
1227
1394
  };
1228
- SidebarComponent.prototype.blockUpload = function (blockType, fsFile) {
1229
- var block = this._blockEditor.sanitizeNewBlock({
1230
- type: blockType,
1231
- });
1232
- this._blockEditor.blockUpload(block, fsFile);
1395
+ SidebarComponent.prototype.blockUpload = function (type, fsFile) {
1396
+ this._blockEditor.blockUpload({
1397
+ type: type,
1398
+ }, fsFile, true);
1233
1399
  };
1234
1400
  SidebarComponent.prototype.blockAdd = function (type) {
1235
1401
  if (type === exports.BlockType.Pdf || type === exports.BlockType.Image) {
1236
1402
  return;
1237
1403
  }
1238
- var block = this._blockEditor.sanitizeNewBlock({
1404
+ this._blockEditor.blockAdd({
1239
1405
  type: type,
1240
- });
1241
- this._blockEditor.blockAdd(block);
1406
+ }, true);
1242
1407
  };
1243
1408
  SidebarComponent.prototype.layerMove = function (direction) {
1244
1409
  var _this = this;
@@ -1264,10 +1429,10 @@
1264
1429
  SidebarComponent.prototype.layerDown = function () {
1265
1430
  this.layerMove(-1);
1266
1431
  };
1267
- SidebarComponent.prototype.blockChanged = function (block) {
1268
- if (this.config.blockChanged) {
1269
- this.config.blockChanged(block);
1270
- }
1432
+ SidebarComponent.prototype.reorderLayers = function () {
1433
+ var _a;
1434
+ (_a = this._document.defaultView) === null || _a === void 0 ? void 0 : _a.scrollTo(0, 0);
1435
+ this._blockEditor.openReorderDialog();
1271
1436
  };
1272
1437
  SidebarComponent.prototype.inputFocus = function (event) {
1273
1438
  event.target.select();
@@ -1281,8 +1446,8 @@
1281
1446
  };
1282
1447
  return SidebarComponent;
1283
1448
  }());
1284
- SidebarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SidebarComponent, deps: [{ token: i0__namespace.ElementRef }, { token: BlockEditorService }, { token: i0__namespace.ChangeDetectorRef }, { token: i2__namespace.FsPrompt }], target: i0__namespace.ɵɵFactoryTarget.Component });
1285
- SidebarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SidebarComponent, selector: "sidebar", inputs: { config: "config", blocks: "blocks" }, outputs: { zoomCenter: "zoomCenter" }, queries: [{ propertyName: "sidebarPanels", predicate: FsBlockEditorSidebarPanelDirective }], ngImport: i0__namespace, template: "<div class=\"sidebar\">\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-row\">\n <ng-container *ngFor=\"let blockType of BlockTypes\">\n <ng-container [ngSwitch]=\"blockType.value\">\n <ng-container *ngSwitchCase=\"BlockType.Pdf\">\n <ng-container *ngTemplateOutlet=\"addFile\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"BlockType.Image\">\n <ng-container *ngTemplateOutlet=\"addFile\"></ng-container>\n </ng-container> \n <ng-container *ngSwitchDefault>\n <ng-container *ngTemplateOutlet=\"addButton\"></ng-container>\n </ng-container>\n </ng-container>\n\n <ng-template #addFile>\n <fs-file (select)=\"blockUpload(blockType.value, $event)\" [accept]=\"blockType.accept\">\n <ng-container *ngTemplateOutlet=\"addButton\"></ng-container>\n </fs-file>\n </ng-template>\n\n <ng-template #addButton>\n <button \n type=\"button\"\n mat-icon-button\n [matTooltip]=\"'Add ' + blockType.name\"\n (click)=\"blockAdd(blockType.value)\">\n <mat-icon>{{blockType.icon}}</mat-icon>\n </button>\n </ng-template>\n </ng-container>\n </div>\n </div>\n\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-row\">\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n matTooltip=\"Reset zoom\"\n (click)=\"zoomCenter.emit()\">\n <mat-icon>crop_free</mat-icon>\n </button>\n <ng-container *ngIf=\"block\">\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"blockRemoveClick()\">\n <mat-icon>delete_outline</mat-icon>\n </button>\n <button\n class=\"layer-up\"\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"layerUp()\">\n <mat-icon>arrow_back</mat-icon>\n <mat-icon>layers</mat-icon>\n </button>\n <button\n class=\"layer-down\"\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"layerDown()\">\n <mat-icon>arrow_back</mat-icon>\n <mat-icon>layers</mat-icon>\n </button>\n </ng-container>\n </div>\n </div>\n <ng-container *ngIf=\"block\"> \n <div class=\"sidebar-panel info-panel\">\n <div class=\"sidebar-label\">Info</div>\n <div class=\"sidebar-row\">\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.left\"\n name=\"left\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"leftChange($event)\">\n <span matPrefix>X</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.top\"\n name=\"top\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"topChange($event)\">\n <span matPrefix>Y</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.rotate || 0\"\n name=\"rotate\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"rotateChange($event)\">\n <span matPrefix>R</span>\n </mat-form-field>\n </div>\n\n <div class=\"sidebar-row\">\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.width\"\n name=\"width\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"widthChange($event)\">\n <span matPrefix>W</span>\n </mat-form-field>\n\n <div>\n <a (click)=\"toggleKeepRatio()\" class=\"keep-ratio\">\n <mat-icon>{{block.keepRatio ? 'lock_outline' : 'lock_open'}}</mat-icon>\n </a>\n </div>\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.height\"\n name=\"height\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"heightChange($event)\">\n <span matPrefix>H</span>\n </mat-form-field>\n </div>\n </div>\n <ng-container *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText || block.type === BlockType.RadioButton || block.type === BlockType.Checkbox || block.type === BlockType.Date || block.type === BlockType.Signature\">\n <div class=\"sidebar-panel block-form-panel\">\n <div class=\"sidebar-label\">\n <mat-icon>{{blockTypeIcons[block.type]}}</mat-icon>\n {{blockTypeNames[block.type]}}</div>\n <div class=\"sidebar-row\">\n\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <input\n matInput\n [ngModel]=\"block.label\"\n name=\"label\"\n placeholder=\"Label\"\n (ngModelChange)=\"blockChangeProperty($event, 'label')\">\n </mat-form-field>\n\n <ng-container *ngIf=\"block.type !== BlockType.Checkbox && block.type !== BlockType.RadioButton\">\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <textarea\n matInput\n [matTextareaAutosize]=\"true\"\n [ngModel]=\"block.description\"\n name=\"description\"\n placeholder=\"Description\"\n (ngModelChange)=\"blockChangeProperty($event, 'description')\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <mat-form-field \n *ngIf=\"formats.length\"\n class=\"form-field-padless-bottom full-width\">\n <mat-label>Format</mat-label>\n <mat-select\n [(ngModel)]=\"block.format\"\n name=\"format\"\n (ngModelChange)=\"blockChangeProperty($event, 'format')\">\n <mat-option [value]=\"null\">\n None\n </mat-option> \n <mat-option\n *ngFor=\"let item of formats\"\n [value]=\"item.value\">\n {{ item.name }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n\n <ng-container *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText || block.type === BlockType.Date\">\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <textarea\n matInput\n [matTextareaAutosize]=\"true\"\n [ngModel]=\"block.default\"\n name=\"default\"\n placeholder=\"Default\"\n (ngModelChange)=\"blockChangeProperty($event, 'default')\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <ng-container *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText\">\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <textarea\n matInput\n [matTextareaAutosize]=\"true\"\n [ngModel]=\"block.formula\"\n name=\"formula\"\n placeholder=\"Formula\"\n (ngModelChange)=\"blockChangeProperty($event, 'formula')\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <ng-container *ngIf=\"block.type === BlockType.RadioButton || block.type === BlockType.Checkbox\">\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <textarea\n matInput\n [matTextareaAutosize]=\"true\"\n [ngModel]=\"block.groupLabel\"\n name=\"groupLabel\"\n placeholder=\"Group Label\"\n (ngModelChange)=\"blockChangeProperty($event, 'groupLabel')\">\n </textarea>\n </mat-form-field>\n \n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <mat-label>Group Description</mat-label>\n <textarea\n matInput\n [matTextareaAutosize]=\"true\"\n [ngModel]=\"block.groupDescription\"\n name=\"groupDescription\"\n (ngModelChange)=\"blockChangeProperty($event, 'groupDescription')\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <input\n matInput\n [ngModel]=\"block.name\"\n name=\"name\"\n placeholder=\"Name\"\n (ngModelChange)=\"blockChangeProperty($event, 'name')\">\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <mat-label>Index</mat-label>\n <input\n matInput\n [(ngModel)]=\"block.index\"\n name=\"index\"\n (ngModelChange)=\"blockChangeProperty($event, 'index')\">\n </mat-form-field>\n\n <div class=\"form-field-options\">\n <mat-checkbox \n name=\"required\" \n [(ngModel)]=\"block.required\"\n (ngModelChange)=\"blockChangeProperty($event, 'required')\">\n Required\n </mat-checkbox>\n\n <mat-checkbox \n name=\"readonly\" \n [(ngModel)]=\"block.readonly\"\n (ngModelChange)=\"blockChangeProperty($event, 'readonly')\">\n Readonly\n </mat-checkbox>\n </div>\n </div>\n </div>\n </ng-container>\n <div class=\"sidebar-panel typography-panel\">\n <div class=\"sidebar-label\">Typography</div>\n <div class=\"sidebar-row\">\n <fs-color-picker-chip\n (changed)=\"fontColorChange($event)\"\n [color]=\"block.fontColor\">\n </fs-color-picker-chip>\n\n <mat-form-field class=\"form-field-padless font-size\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.fontSize\"\n name=\"fontSize\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"fontSizeChange($event)\"\n placeholder=\"Size\">\n <span matPrefix *ngIf=\"block.fontSize\">S</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless line-height\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.lineHeight\"\n name=\"lineHeight\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"lineHeightChange($event)\"\n placeholder=\"Line\">\n <span matPrefix *ngIf=\"block.lineHeight\">L</span>\n </mat-form-field>\n </div>\n\n <div class=\"sidebar-row style-row\">\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.bold }\"\n (click)=\"boldClick()\">\n <mat-icon>format_bold</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.italic }\"\n (click)=\"italicClick()\">\n <mat-icon>format_italic</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.underline }\"\n (click)=\"underlineClick()\">\n <mat-icon>format_underline</mat-icon>\n </button>\n </div>\n\n <div class=\"sidebar-row align-row\">\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.horizontalAlign === 'left' }\"\n (click)=\"horizontalAlignClick('left')\">\n <mat-icon>format_align_left</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.horizontalAlign === 'center' }\"\n (click)=\"horizontalAlignClick('center')\">\n <mat-icon>format_align_center</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.horizontalAlign === 'right' }\"\n (click)=\"horizontalAlignClick('right')\">\n <mat-icon>format_align_right</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.verticalAlign === 'top' }\"\n (click)=\"verticalAlignClick('top')\">\n <mat-icon>vertical_align_top</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.verticalAlign === 'center' }\"\n (click)=\"verticalAlignClick('center')\">\n <mat-icon>vertical_align_center</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.verticalAlign === 'bottom' }\"\n (click)=\"verticalAlignClick('bottom')\">\n <mat-icon>vertical_align_bottom</mat-icon>\n </button>\n </div>\n </div>\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Border</div>\n\n <div class=\"sidebar-row\">\n <fs-color-picker-chip\n (changed)=\"borderColorChange($event)\"\n [color]=\"block.borderColor\">\n </fs-color-picker-chip>\n\n <mat-form-field class=\"form-field-padless border-width\" floatLabel=\"never\">\n <input\n matInput\n [(ngModel)]=\"block.borderWidth\"\n name=\"borderWidth\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"borderWidthChange($event)\"\n placeholder=\"Width\">\n <span matPrefix *ngIf=\"block.borderWidth\">W</span>\n </mat-form-field>\n </div>\n </div>\n\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Shape</div>\n\n <div class=\"sidebar-row\">\n <fs-color-picker-chip\n (changed)=\"backgroundColorChange($event)\"\n [color]=\"block.backgroundColor\">\n </fs-color-picker-chip>\n\n <mat-form-field class=\"form-field-padless shape-radius\" floatLabel=\"never\">\n <input\n matInput\n [(ngModel)]=\"block.shapeRadius\"\n name=\"shapeRadius\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"shapeRadiusChange($event)\"\n placeholder=\"Radius\">\n <span matPrefix *ngIf=\"block.shapeRadius\">R</span>\n </mat-form-field>\n\n <div class=\"shape-corners\">\n <div\n class=\"shape-corner shape-corner-top-left\"\n [ngClass]=\"{ round: block.shapeTopLeft === 'round' }\"\n (click)=\"shapeRound('shapeTopLeft')\"></div>\n <div\n class=\"shape-corner shape-corner-top-right\"\n [ngClass]=\"{ round: block.shapeTopRight === 'round' }\"\n (click)=\"shapeRound('shapeTopRight')\"></div>\n <div\n class=\"shape-corner shape-corner-bottom-left\"\n [ngClass]=\"{ round: block.shapeBottomLeft === 'round' }\"\n (click)=\"shapeRound('shapeBottomLeft')\"></div>\n <div\n class=\"shape-corner shape-corner-bottom-right\"\n [ngClass]=\"{ round: block.shapeBottomRight === 'round' }\"\n (click)=\"shapeRound('shapeBottomRight')\"></div>\n </div>\n </div>\n </div>\n <ng-container *ngIf=\"block.type !== BlockType.Pdf\">\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Image</div>\n <div class=\"sidebar-row image-row\">\n <fs-file (select)=\"imageSelect($event)\">\n <button type=\"button\" mat-icon-button><mat-icon>cloud_upload</mat-icon></button>\n </fs-file>\n <ng-container *ngIf=\"block.imageUrl\">\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"imageRemove()\">\n <mat-icon>clear</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: clippable }\"\n (click)=\"imageClip()\">\n <mat-icon>crop</mat-icon>\n </button>\n </ng-container>\n </div>\n </div>\n </ng-container>\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Padding</div>\n <div class=\"sidebar-row padding-row\">\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.padding\"\n name=\"padding\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"paddingAllChange($event)\"\n placeholder=\"All\">\n <span matPrefix *ngIf=\"block.padding\">A</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingTop\"\n name=\"paddingTop\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"paddingChange('paddingTop',$event)\"\n placeholder=\"Top\">\n <span matPrefix *ngIf=\"block.paddingTop\">T</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingBottom\"\n name=\"paddingBottom\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"paddingChange('paddingBottom',$event)\"\n placeholder=\"Bottom\">\n <span matPrefix *ngIf=\"block.paddingBottom\">B</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingLeft\"\n name=\"paddingLeft\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"paddingChange('paddingLeft',$event)\"\n placeholder=\"Left\">\n <span matPrefix *ngIf=\"block.paddingLeft\">L</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingRight\"\n name=\"paddingRight\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"paddingChange('paddingRight',$event)\"\n placeholder=\"Right\">\n <span matPrefix *ngIf=\"block.paddingRight\">R</span>\n </mat-form-field>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngFor=\"let sidebarPanel of sidebarPanels\">\n <div div class=\"sidebar-panel\" *ngIf=\"sidebarPanel.show\">\n <div class=\"sidebar-label\">{{sidebarPanel.label}}</div>\n <ng-container\n [ngTemplateOutlet]=\"sidebarPanel.templateRef\"\n [ngTemplateOutletContext]=\"{ block: block }\"></ng-container>\n </div>\n </ng-container>\n</div>\n\n", styles: [".sidebar{width:285px;font-size:14px;height:100%;overflow:auto;background-color:#fff;padding:0 10px 10px;box-shadow:-1px 1px 4px 3px #0003;z-index:1;position:relative;box-sizing:border-box}.sidebar .sidebar-row{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center}.sidebar .sidebar-row fs-color-picker-chip{margin-left:6px}.sidebar .sidebar-row.padding-row{flex-wrap:unset}.sidebar .sidebar-row.padding-row ::ng-deep .mat-form-field{width:20%;min-width:0}.sidebar .sidebar-row.image-row{margin-bottom:-5px}.sidebar .sidebar-row ::ng-deep .mat-checkbox,.sidebar .sidebar-row ::ng-deep .mat-form-field{font-size:12px}.sidebar .sidebar-row>*:not(.mat-icon-button):not(fs-file){margin-right:11px}.sidebar .sidebar-row>*:not(.mat-icon-button):not(fs-file):last-child{margin-right:0}.sidebar .layer-up ::ng-deep .mat-button-wrapper,.sidebar .layer-down ::ng-deep .mat-button-wrapper{position:relative}.sidebar .layer-up ::ng-deep .mat-button-wrapper mat-icon:first-child,.sidebar .layer-down ::ng-deep .mat-button-wrapper mat-icon:first-child{position:absolute;transform:rotate(90deg) scale(.5);top:-7px;color:#fff}.sidebar .layer-down mat-icon:first-child{transform:rotate(270deg) scale(.6)}.sidebar .padding{width:45px}.sidebar .line-height,.sidebar .font-size,.sidebar .border-width{width:45px}.sidebar .shape-radius{width:50px}.sidebar .shape-corners{display:grid;grid-template-columns:1fr 1fr;grid-column-gap:1px;column-gap:1px;grid-row-gap:1px;row-gap:1px}.sidebar .shape-corners .shape-corner{height:13px;width:13px;background-color:#ccc;cursor:pointer}.sidebar .shape-corners .shape-corner.round.shape-corner-top-right{border-top-right-radius:50%}.sidebar .shape-corners .shape-corner.round.shape-corner-top-left{border-top-left-radius:50%}.sidebar .shape-corners .shape-corner.round.shape-corner-bottom-left{border-bottom-left-radius:50%}.sidebar .shape-corners .shape-corner.round.shape-corner-bottom-right{border-bottom-right-radius:50%}.sidebar button.toggle-button:not(.selected) mat-icon{color:#ccc}.sidebar .sidebar-panel{padding:10px}.sidebar .sidebar-panel+.sidebar-panel{border-top:1px solid #dadada}.sidebar .sidebar-panel.block-form-panel .sidebar-label{display:flex;align-items:center}.sidebar .sidebar-panel.block-form-panel .sidebar-label mat-icon{transform:scale(.8);color:inherit;margin-left:-5px}.sidebar .sidebar-panel.block-form-panel mat-form-field+mat-form-field{margin-top:12px}.sidebar .sidebar-panel.block-form-panel .form-field-options{margin-top:11px}.sidebar .sidebar-panel.block-form-panel .form-field-options mat-checkbox{display:block}.sidebar .sidebar-panel.block-form-panel .form-field-options mat-checkbox+mat-checkbox{margin-top:2px}.sidebar .sidebar-panel.info-panel .sidebar-row+.sidebar-row{margin-top:12px}.sidebar .sidebar-panel.info-panel .sidebar-row .mat-form-field{width:41px}.sidebar .sidebar-panel.typography-panel .style-row{margin-bottom:-10px}.sidebar .sidebar-panel.typography-panel .align-row{margin-bottom:-5px}.sidebar .sidebar-panel .sidebar-label{font-size:11px;margin-bottom:7px;color:#9e9e9e}.sidebar .sidebar-panel .keep-ratio{color:inherit;transform:scale(.85);display:block}.full-width{width:100%}:host ::ng-deep .mat-form-field-prefix{color:#9e9e9e;margin-right:3px;font-size:85%}\n"], components: [{ type: i3__namespace.FsFileComponent, selector: "fs-file", inputs: ["minHeight", "minWidth", "multiple", "capture", "allowClick", "allowDrop", "accept", "disabled", "imageWidth", "imageHeight", "imageQuality"], outputs: ["select", "error", "clicked", "declined"] }, { type: i4__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"] }, { type: i5__namespace.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i6__namespace.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i7__namespace.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i8__namespace.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i9__namespace.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "id", "labelPosition", "name", "required", "checked", "disabled", "indeterminate", "aria-describedby", "value"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: i10__namespace.FsColorPickerChipComponent, selector: "fs-color-picker-chip", inputs: ["color"], outputs: ["changed"] }], directives: [{ type: i11__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i11__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i11__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i11__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i11__namespace.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i12__namespace.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i11__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i13__namespace.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i14__namespace.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i14__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i14__namespace.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i6__namespace.MatPrefix, selector: "[matPrefix]" }, { type: i13__namespace.MatTextareaAutosize, selector: "textarea[mat-autosize], textarea[matTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "matAutosizeMinRows", "matAutosizeMaxRows", "mat-autosize", "matTextareaAutosize"], exportAs: ["matTextareaAutosize"] }, { type: i6__namespace.MatLabel, selector: "mat-label" }, { type: i11__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
1449
+ SidebarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SidebarComponent, deps: [{ token: i0__namespace.ElementRef }, { token: BlockEditorService }, { token: i0__namespace.ChangeDetectorRef }, { token: i2__namespace$1.FsPrompt }, { token: i11.DOCUMENT }], target: i0__namespace.ɵɵFactoryTarget.Component });
1450
+ SidebarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SidebarComponent, selector: "sidebar", inputs: { config: "config", blocks: "blocks" }, outputs: { zoomCenter: "zoomCenter" }, queries: [{ propertyName: "sidebarPanels", predicate: FsBlockEditorSidebarPanelDirective }], ngImport: i0__namespace, template: "<div class=\"sidebar\">\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-row\">\n <ng-container *ngFor=\"let blockType of BlockTypes\">\n <ng-container [ngSwitch]=\"blockType.value\">\n <ng-container *ngSwitchCase=\"BlockType.Pdf\">\n <ng-container *ngTemplateOutlet=\"addFile\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"BlockType.Image\">\n <ng-container *ngTemplateOutlet=\"addFile\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container *ngTemplateOutlet=\"addButton\"></ng-container>\n </ng-container>\n </ng-container>\n\n <ng-template #addFile>\n <fs-file (select)=\"blockUpload(blockType.value, $event)\" [accept]=\"blockType.accept\">\n <ng-container *ngTemplateOutlet=\"addButton\"></ng-container>\n </fs-file>\n </ng-template>\n\n <ng-template #addButton>\n <button\n type=\"button\"\n mat-icon-button\n [matTooltip]=\"'Add ' + blockType.name\"\n (click)=\"blockAdd(blockType.value)\">\n <mat-icon>{{blockType.icon}}</mat-icon>\n </button>\n </ng-template>\n </ng-container>\n </div>\n </div>\n\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-row\">\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n matTooltip=\"Reset zoom\"\n (click)=\"zoomCenter.emit()\">\n <mat-icon>crop_free</mat-icon>\n </button>\n <button\n class=\"reorder-layers\"\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"reorderLayers()\">\n <mat-icon>swap_vert</mat-icon>\n </button>\n <ng-container *ngIf=\"block\">\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"blockRemoveClick()\">\n <mat-icon>delete_outline</mat-icon>\n </button>\n <button\n class=\"layer-up\"\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"layerUp()\">\n <mat-icon>arrow_back</mat-icon>\n <mat-icon>layers</mat-icon>\n </button>\n <button\n class=\"layer-down\"\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"layerDown()\">\n <mat-icon>arrow_back</mat-icon>\n <mat-icon>layers</mat-icon>\n </button>\n </ng-container>\n </div>\n </div>\n <ng-container *ngIf=\"block\">\n <div class=\"sidebar-panel info-panel\">\n <div class=\"sidebar-label\">Info</div>\n <div class=\"sidebar-row\">\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.left\"\n name=\"left\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"leftChange($event)\">\n <span matPrefix>X</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.top\"\n name=\"top\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"topChange($event)\">\n <span matPrefix>Y</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.rotate || 0\"\n name=\"rotate\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"rotateChange($event)\">\n <span matPrefix>R</span>\n </mat-form-field>\n </div>\n\n <div class=\"sidebar-row\">\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.width\"\n name=\"width\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"widthChange($event)\">\n <span matPrefix>W</span>\n </mat-form-field>\n\n <div>\n <a (click)=\"toggleKeepRatio()\" class=\"keep-ratio\">\n <mat-icon>{{block.keepRatio ? 'lock_outline' : 'lock_open'}}</mat-icon>\n </a>\n </div>\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.height\"\n name=\"height\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"heightChange($event)\">\n <span matPrefix>H</span>\n </mat-form-field>\n </div>\n </div>\n <ng-container *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText || block.type === BlockType.RadioButton || block.type === BlockType.Checkbox || block.type === BlockType.Date || block.type === BlockType.Signature\">\n <div class=\"sidebar-panel block-form-panel\">\n <div class=\"sidebar-label\">\n <mat-icon>{{blockTypeIcons[block.type]}}</mat-icon>\n {{blockTypeNames[block.type]}}</div>\n <div class=\"sidebar-row\">\n\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <input\n matInput\n [ngModel]=\"block.label\"\n name=\"label\"\n placeholder=\"Label\"\n (ngModelChange)=\"blockChangeProperty($event, 'label')\">\n </mat-form-field>\n\n <ng-container *ngIf=\"block.type !== BlockType.Checkbox && block.type !== BlockType.RadioButton\">\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <textarea\n matInput\n [matTextareaAutosize]=\"true\"\n [ngModel]=\"block.description\"\n name=\"description\"\n placeholder=\"Description\"\n (ngModelChange)=\"blockChangeProperty($event, 'description')\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <mat-form-field\n *ngIf=\"formats.length\"\n class=\"form-field-padless-bottom full-width\">\n <mat-label>Format</mat-label>\n <mat-select\n [(ngModel)]=\"block.format\"\n name=\"format\"\n (ngModelChange)=\"blockChangeProperty($event, 'format')\">\n <mat-option [value]=\"null\">\n None\n </mat-option>\n <mat-option\n *ngFor=\"let item of formats\"\n [value]=\"item.value\">\n {{ item.name }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n\n <ng-container *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText || block.type === BlockType.Date\">\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <textarea\n matInput\n [matTextareaAutosize]=\"true\"\n [ngModel]=\"block.default\"\n name=\"default\"\n placeholder=\"Default\"\n (ngModelChange)=\"blockChangeProperty($event, 'default')\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <ng-container *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText\">\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <textarea\n matInput\n [matTextareaAutosize]=\"true\"\n [ngModel]=\"block.formula\"\n name=\"formula\"\n placeholder=\"Formula\"\n (ngModelChange)=\"blockChangeProperty($event, 'formula')\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <ng-container *ngIf=\"block.type === BlockType.RadioButton || block.type === BlockType.Checkbox\">\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <textarea\n matInput\n [matTextareaAutosize]=\"true\"\n [ngModel]=\"block.groupLabel\"\n name=\"groupLabel\"\n placeholder=\"Group Label\"\n (ngModelChange)=\"blockChangeProperty($event, 'groupLabel')\">\n </textarea>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <mat-label>Group Description</mat-label>\n <textarea\n matInput\n [matTextareaAutosize]=\"true\"\n [ngModel]=\"block.groupDescription\"\n name=\"groupDescription\"\n (ngModelChange)=\"blockChangeProperty($event, 'groupDescription')\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <input\n matInput\n [ngModel]=\"block.name\"\n name=\"name\"\n placeholder=\"Name\"\n (ngModelChange)=\"blockChangeProperty($event, 'name')\">\n </mat-form-field>\n\n <div class=\"form-field-options\">\n <mat-checkbox\n name=\"required\"\n [(ngModel)]=\"block.required\"\n (ngModelChange)=\"blockChangeProperty($event, 'required')\">\n Required\n </mat-checkbox>\n\n <mat-checkbox\n name=\"readonly\"\n [(ngModel)]=\"block.readonly\"\n (ngModelChange)=\"blockChangeProperty($event, 'readonly')\">\n Readonly\n </mat-checkbox>\n </div>\n </div>\n </div>\n </ng-container>\n <div class=\"sidebar-panel typography-panel\">\n <div class=\"sidebar-label\">Typography</div>\n <div class=\"sidebar-row\">\n <fs-color-picker-chip\n (changed)=\"fontColorChange($event)\"\n [color]=\"block.fontColor\">\n </fs-color-picker-chip>\n\n <mat-form-field class=\"form-field-padless font-size\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.fontSize\"\n name=\"fontSize\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"fontSizeChange($event)\"\n placeholder=\"Size\">\n <span matPrefix *ngIf=\"block.fontSize\">S</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless line-height\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.lineHeight\"\n name=\"lineHeight\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"lineHeightChange($event)\"\n placeholder=\"Line\">\n <span matPrefix *ngIf=\"block.lineHeight\">L</span>\n </mat-form-field>\n </div>\n\n <div class=\"sidebar-row style-row\">\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.bold }\"\n (click)=\"boldClick()\">\n <mat-icon>format_bold</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.italic }\"\n (click)=\"italicClick()\">\n <mat-icon>format_italic</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.underline }\"\n (click)=\"underlineClick()\">\n <mat-icon>format_underline</mat-icon>\n </button>\n </div>\n\n <div class=\"sidebar-row align-row\">\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.horizontalAlign === 'left' }\"\n (click)=\"horizontalAlignClick('left')\">\n <mat-icon>format_align_left</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.horizontalAlign === 'center' }\"\n (click)=\"horizontalAlignClick('center')\">\n <mat-icon>format_align_center</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.horizontalAlign === 'right' }\"\n (click)=\"horizontalAlignClick('right')\">\n <mat-icon>format_align_right</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.verticalAlign === 'top' }\"\n (click)=\"verticalAlignClick('top')\">\n <mat-icon>vertical_align_top</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.verticalAlign === 'center' }\"\n (click)=\"verticalAlignClick('center')\">\n <mat-icon>vertical_align_center</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.verticalAlign === 'bottom' }\"\n (click)=\"verticalAlignClick('bottom')\">\n <mat-icon>vertical_align_bottom</mat-icon>\n </button>\n </div>\n </div>\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Border</div>\n\n <div class=\"sidebar-row\">\n <fs-color-picker-chip\n (changed)=\"borderColorChange($event)\"\n [color]=\"block.borderColor\">\n </fs-color-picker-chip>\n\n <mat-form-field class=\"form-field-padless border-width\" floatLabel=\"never\">\n <input\n matInput\n [(ngModel)]=\"block.borderWidth\"\n name=\"borderWidth\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"borderWidthChange($event)\"\n placeholder=\"Width\">\n <span matPrefix *ngIf=\"block.borderWidth\">W</span>\n </mat-form-field>\n </div>\n </div>\n\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Shape</div>\n\n <div class=\"sidebar-row\">\n <fs-color-picker-chip\n (changed)=\"backgroundColorChange($event)\"\n [color]=\"block.backgroundColor\">\n </fs-color-picker-chip>\n\n <mat-form-field class=\"form-field-padless shape-radius\" floatLabel=\"never\">\n <input\n matInput\n [(ngModel)]=\"block.shapeRadius\"\n name=\"shapeRadius\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"shapeRadiusChange($event)\"\n placeholder=\"Radius\">\n <span matPrefix *ngIf=\"block.shapeRadius\">R</span>\n </mat-form-field>\n\n <div class=\"shape-corners\">\n <div\n class=\"shape-corner shape-corner-top-left\"\n [ngClass]=\"{ round: block.shapeTopLeft === 'round' }\"\n (click)=\"shapeRound('shapeTopLeft')\"></div>\n <div\n class=\"shape-corner shape-corner-top-right\"\n [ngClass]=\"{ round: block.shapeTopRight === 'round' }\"\n (click)=\"shapeRound('shapeTopRight')\"></div>\n <div\n class=\"shape-corner shape-corner-bottom-left\"\n [ngClass]=\"{ round: block.shapeBottomLeft === 'round' }\"\n (click)=\"shapeRound('shapeBottomLeft')\"></div>\n <div\n class=\"shape-corner shape-corner-bottom-right\"\n [ngClass]=\"{ round: block.shapeBottomRight === 'round' }\"\n (click)=\"shapeRound('shapeBottomRight')\"></div>\n </div>\n </div>\n </div>\n <ng-container *ngIf=\"block.type !== BlockType.Pdf\">\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Image</div>\n <div class=\"sidebar-row image-row\">\n <fs-file (select)=\"imageSelect($event)\">\n <button type=\"button\" mat-icon-button><mat-icon>cloud_upload</mat-icon></button>\n </fs-file>\n <ng-container *ngIf=\"block.imageUrl\">\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"imageRemove()\">\n <mat-icon>clear</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: clippable }\"\n (click)=\"imageClip()\">\n <mat-icon>crop</mat-icon>\n </button>\n </ng-container>\n </div>\n </div>\n </ng-container>\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Padding</div>\n <div class=\"sidebar-row padding-row\">\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.padding\"\n name=\"padding\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"paddingAllChange($event)\"\n placeholder=\"All\">\n <span matPrefix *ngIf=\"block.padding\">A</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingTop\"\n name=\"paddingTop\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"paddingChange('paddingTop',$event)\"\n placeholder=\"Top\">\n <span matPrefix *ngIf=\"block.paddingTop\">T</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingBottom\"\n name=\"paddingBottom\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"paddingChange('paddingBottom',$event)\"\n placeholder=\"Bottom\">\n <span matPrefix *ngIf=\"block.paddingBottom\">B</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingLeft\"\n name=\"paddingLeft\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"paddingChange('paddingLeft',$event)\"\n placeholder=\"Left\">\n <span matPrefix *ngIf=\"block.paddingLeft\">L</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingRight\"\n name=\"paddingRight\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"paddingChange('paddingRight',$event)\"\n placeholder=\"Right\">\n <span matPrefix *ngIf=\"block.paddingRight\">R</span>\n </mat-form-field>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngFor=\"let sidebarPanel of sidebarPanels\">\n <div div class=\"sidebar-panel\" *ngIf=\"sidebarPanel.show\">\n <div class=\"sidebar-label\">{{sidebarPanel.label}}</div>\n <ng-container\n [ngTemplateOutlet]=\"sidebarPanel.templateRef\"\n [ngTemplateOutletContext]=\"{ block: block }\"></ng-container>\n </div>\n </ng-container>\n</div>\n\n", styles: [".sidebar{width:285px;font-size:14px;height:100%;overflow:auto;background-color:#fff;padding:0 10px 10px;box-shadow:-1px 1px 4px 3px #0003;z-index:1;position:relative;box-sizing:border-box}.sidebar .sidebar-row{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center}.sidebar .sidebar-row fs-color-picker-chip{margin-left:6px}.sidebar .sidebar-row.padding-row{flex-wrap:unset}.sidebar .sidebar-row.padding-row ::ng-deep .mat-form-field{width:20%;min-width:0}.sidebar .sidebar-row.image-row{margin-bottom:-5px}.sidebar .sidebar-row ::ng-deep .mat-checkbox,.sidebar .sidebar-row ::ng-deep .mat-form-field{font-size:12px}.sidebar .sidebar-row>*:not(.mat-icon-button):not(fs-file){margin-right:11px}.sidebar .sidebar-row>*:not(.mat-icon-button):not(fs-file):last-child{margin-right:0}.sidebar .layer-up ::ng-deep .mat-button-wrapper,.sidebar .layer-down ::ng-deep .mat-button-wrapper{position:relative}.sidebar .layer-up ::ng-deep .mat-button-wrapper mat-icon:first-child,.sidebar .layer-down ::ng-deep .mat-button-wrapper mat-icon:first-child{position:absolute;transform:rotate(90deg) scale(.5);top:-7px;color:#fff}.sidebar .layer-down mat-icon:first-child{transform:rotate(270deg) scale(.6)}.sidebar .padding{width:45px}.sidebar .line-height,.sidebar .font-size,.sidebar .border-width{width:45px}.sidebar .shape-radius{width:50px}.sidebar .shape-corners{display:grid;grid-template-columns:1fr 1fr;grid-column-gap:1px;column-gap:1px;grid-row-gap:1px;row-gap:1px}.sidebar .shape-corners .shape-corner{height:13px;width:13px;background-color:#ccc;cursor:pointer}.sidebar .shape-corners .shape-corner.round.shape-corner-top-right{border-top-right-radius:50%}.sidebar .shape-corners .shape-corner.round.shape-corner-top-left{border-top-left-radius:50%}.sidebar .shape-corners .shape-corner.round.shape-corner-bottom-left{border-bottom-left-radius:50%}.sidebar .shape-corners .shape-corner.round.shape-corner-bottom-right{border-bottom-right-radius:50%}.sidebar button.toggle-button:not(.selected) mat-icon{color:#ccc}.sidebar .sidebar-panel{padding:10px}.sidebar .sidebar-panel+.sidebar-panel{border-top:1px solid #dadada}.sidebar .sidebar-panel.block-form-panel .sidebar-label{display:flex;align-items:center}.sidebar .sidebar-panel.block-form-panel .sidebar-label mat-icon{transform:scale(.8);color:inherit;margin-left:-5px}.sidebar .sidebar-panel.block-form-panel mat-form-field+mat-form-field{margin-top:12px}.sidebar .sidebar-panel.block-form-panel .form-field-options{margin-top:11px}.sidebar .sidebar-panel.block-form-panel .form-field-options mat-checkbox{display:block}.sidebar .sidebar-panel.block-form-panel .form-field-options mat-checkbox+mat-checkbox{margin-top:2px}.sidebar .sidebar-panel.info-panel .sidebar-row+.sidebar-row{margin-top:12px}.sidebar .sidebar-panel.info-panel .sidebar-row .mat-form-field{width:41px}.sidebar .sidebar-panel.typography-panel .style-row{margin-bottom:-10px}.sidebar .sidebar-panel.typography-panel .align-row{margin-bottom:-5px}.sidebar .sidebar-panel .sidebar-label{font-size:11px;margin-bottom:7px;color:#9e9e9e}.sidebar .sidebar-panel .keep-ratio{color:inherit;transform:scale(.85);display:block}.full-width{width:100%}:host ::ng-deep .mat-form-field-prefix{color:#9e9e9e;margin-right:3px;font-size:85%}\n"], components: [{ type: i3__namespace$1.FsFileComponent, selector: "fs-file", inputs: ["minHeight", "minWidth", "multiple", "capture", "allowClick", "allowDrop", "accept", "disabled", "imageWidth", "imageHeight", "imageQuality"], outputs: ["select", "error", "clicked", "declined"] }, { 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"] }, { type: i3__namespace.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i6__namespace$1.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i7__namespace$1.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i8__namespace.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i9__namespace.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "id", "labelPosition", "name", "required", "checked", "disabled", "indeterminate", "aria-describedby", "value"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: i10__namespace.FsColorPickerChipComponent, selector: "fs-color-picker-chip", inputs: ["color"], outputs: ["changed"] }], directives: [{ type: i11__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i11__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i11__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i11__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i11__namespace.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i12__namespace.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i11__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i13__namespace.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i14__namespace.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i14__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i14__namespace.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i6__namespace$1.MatPrefix, selector: "[matPrefix]" }, { type: i13__namespace.MatTextareaAutosize, selector: "textarea[mat-autosize], textarea[matTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "matAutosizeMinRows", "matAutosizeMaxRows", "mat-autosize", "matTextareaAutosize"], exportAs: ["matTextareaAutosize"] }, { type: i6__namespace$1.MatLabel, selector: "mat-label" }, { type: i11__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
1286
1451
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SidebarComponent, decorators: [{
1287
1452
  type: i0.Component,
1288
1453
  args: [{
@@ -1291,7 +1456,12 @@
1291
1456
  styleUrls: ['sidebar.component.scss'],
1292
1457
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
1293
1458
  }]
1294
- }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: BlockEditorService }, { type: i0__namespace.ChangeDetectorRef }, { type: i2__namespace.FsPrompt }]; }, propDecorators: { sidebarPanels: [{
1459
+ }], ctorParameters: function () {
1460
+ return [{ type: i0__namespace.ElementRef }, { type: BlockEditorService }, { type: i0__namespace.ChangeDetectorRef }, { type: i2__namespace$1.FsPrompt }, { type: undefined, decorators: [{
1461
+ type: i0.Inject,
1462
+ args: [i11.DOCUMENT]
1463
+ }] }];
1464
+ }, propDecorators: { sidebarPanels: [{
1295
1465
  type: i0.ContentChildren,
1296
1466
  args: [FsBlockEditorSidebarPanelDirective]
1297
1467
  }], config: [{
@@ -1359,9 +1529,9 @@
1359
1529
  _this._cdRef.markForCheck();
1360
1530
  });
1361
1531
  rxjs.fromEvent(window, 'keydown')
1362
- .pipe(operators.takeUntil(this._destroy$), operators.filter(function (event) {
1363
- return !!event.key.match(/^Arrow/) && !!_this._blockEditor.selectedBlocks.length;
1364
- }))
1532
+ .pipe(operators.filter(function (event) {
1533
+ return ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].indexOf(event.key) !== -1;
1534
+ }), operators.takeUntil(this._destroy$))
1365
1535
  .subscribe(function (event) {
1366
1536
  event.preventDefault();
1367
1537
  var inchPixel = 1 / 100;
@@ -1384,11 +1554,6 @@
1384
1554
  });
1385
1555
  });
1386
1556
  };
1387
- ArtboardComponent.prototype.blockChanged = function (block) {
1388
- if (this.config.blockChanged) {
1389
- this.config.blockChanged(block);
1390
- }
1391
- };
1392
1557
  ArtboardComponent.prototype.ngAfterViewInit = function () {
1393
1558
  // this.blockComponents.changes
1394
1559
  // .pipe(
@@ -1462,8 +1627,7 @@
1462
1627
  FsBlockEditorComponent.prototype.ngOnInit = function () {
1463
1628
  var _this = this;
1464
1629
  this.config = Object.assign(Object.assign({}, this.config), { unit: 'in' });
1465
- this._blockEditor.blocks = this.config.blocks;
1466
- this._blockEditor.config = this.config;
1630
+ this._blockEditor.init(this.config);
1467
1631
  this._blockEditor.blocks$
1468
1632
  .pipe(operators.takeUntil(this._destroy$))
1469
1633
  .subscribe(function (blocks) {
@@ -1492,7 +1656,8 @@
1492
1656
  FsBlockEditorComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockEditorComponent, deps: [{ token: i0__namespace.ElementRef }, { token: BlockEditorService }], target: i0__namespace.ɵɵFactoryTarget.Component });
1493
1657
  FsBlockEditorComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsBlockEditorComponent, selector: "fs-block-editor", inputs: { config: "config" }, providers: [
1494
1658
  BlockEditorService,
1495
- ], queries: [{ propertyName: "sidebarPanels", predicate: FsBlockEditorSidebarPanelDirective }], viewQueries: [{ propertyName: "zoompan", first: true, predicate: i2$1.FsZoomPanComponent, descendants: true, static: true }, { propertyName: "artboardContainer", first: true, predicate: ["artboardContainer"], descendants: true, static: true }, { propertyName: "sidebar", first: true, predicate: SidebarComponent, descendants: true, static: true }, { propertyName: "artboard", first: true, predicate: ArtboardComponent, descendants: true, read: i0.ElementRef }], ngImport: i0__namespace, template: "<div \n class=\"editor-container deselectable\"\n (mousedown)=\"editorContainerClick($event)\">\n <div\n #artboardContainer\n class=\"artboard-container deselectable\">\n <div #zoomPanContaner class=\"zoom-pan-container deselectable\">\n <fs-zoom-pan \n class=\"deselectable\"\n [zoomMax]=\"5\"\n [top]=\"10\">\n <ng-template fsZoomPanContent>\n <app-artboard \n [zoompan]=\"zoompan\"\n [config]=\"config\">\n </app-artboard>\n </ng-template>\n </fs-zoom-pan>\n </div>\n </div>\n <sidebar\n [config]=\"config\"\n [blocks]=\"blocks\"\n (zoomCenter)=\"zoomCenter()\">\n </sidebar>\n</div>\n", styles: [".editor-container{display:flex;flex-direction:row;position:relative;height:100%;background:#d8d8d8;overflow:hidden}.editor-container .artboard-container{display:flex;flex-grow:1;min-width:0}.editor-container .zoom-pan-container{flex:1}fs-zoom-pan{height:100%}\n"], components: [{ type: i2__namespace$1.FsZoomPanComponent, selector: "fs-zoom-pan", inputs: ["zoomMax", "zoomMin", "zoomDefault", "top", "left"], outputs: ["moved", "zoomed"] }, { type: ArtboardComponent, selector: "app-artboard", inputs: ["config", "zoompan"] }, { type: SidebarComponent, selector: "sidebar", inputs: ["config", "blocks"], outputs: ["zoomCenter"] }], directives: [{ type: i2__namespace$1.FsZoomPanContentDirective, selector: "[fsZoomPanContent]" }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
1659
+ BlocksStore,
1660
+ ], queries: [{ propertyName: "sidebarPanels", predicate: FsBlockEditorSidebarPanelDirective }], viewQueries: [{ propertyName: "zoompan", first: true, predicate: i2$2.FsZoomPanComponent, descendants: true, static: true }, { propertyName: "artboardContainer", first: true, predicate: ["artboardContainer"], descendants: true, static: true }, { propertyName: "sidebar", first: true, predicate: SidebarComponent, descendants: true, static: true }, { propertyName: "artboard", first: true, predicate: ArtboardComponent, descendants: true, read: i0.ElementRef }], ngImport: i0__namespace, template: "<div \n class=\"editor-container deselectable\"\n (mousedown)=\"editorContainerClick($event)\">\n <div\n #artboardContainer\n class=\"artboard-container deselectable\">\n <div #zoomPanContaner class=\"zoom-pan-container deselectable\">\n <fs-zoom-pan \n class=\"deselectable\"\n [zoomMax]=\"5\"\n [top]=\"10\">\n <ng-template fsZoomPanContent>\n <app-artboard \n [zoompan]=\"zoompan\"\n [config]=\"config\">\n </app-artboard>\n </ng-template>\n </fs-zoom-pan>\n </div>\n </div>\n <sidebar\n [config]=\"config\"\n [blocks]=\"blocks\"\n (zoomCenter)=\"zoomCenter()\">\n </sidebar>\n</div>\n", styles: [".editor-container{display:flex;flex-direction:row;position:relative;height:100%;background:#d8d8d8;overflow:hidden}.editor-container .artboard-container{display:flex;flex-grow:1;min-width:0}.editor-container .zoom-pan-container{flex:1}fs-zoom-pan{height:100%}\n"], components: [{ type: i2__namespace$2.FsZoomPanComponent, selector: "fs-zoom-pan", inputs: ["zoomMax", "zoomMin", "zoomDefault", "top", "left"], outputs: ["moved", "zoomed"] }, { type: ArtboardComponent, selector: "app-artboard", inputs: ["config", "zoompan"] }, { type: SidebarComponent, selector: "sidebar", inputs: ["config", "blocks"], outputs: ["zoomCenter"] }], directives: [{ type: i2__namespace$2.FsZoomPanContentDirective, selector: "[fsZoomPanContent]" }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
1496
1661
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockEditorComponent, decorators: [{
1497
1662
  type: i0.Component,
1498
1663
  args: [{
@@ -1502,6 +1667,7 @@
1502
1667
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
1503
1668
  providers: [
1504
1669
  BlockEditorService,
1670
+ BlocksStore,
1505
1671
  ]
1506
1672
  }]
1507
1673
  }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: BlockEditorService }]; }, propDecorators: { sidebarPanels: [{
@@ -1509,7 +1675,7 @@
1509
1675
  args: [FsBlockEditorSidebarPanelDirective]
1510
1676
  }], zoompan: [{
1511
1677
  type: i0.ViewChild,
1512
- args: [i2$1.FsZoomPanComponent, { static: true }]
1678
+ args: [i2$2.FsZoomPanComponent, { static: true }]
1513
1679
  }], artboardContainer: [{
1514
1680
  type: i0.ViewChild,
1515
1681
  args: ['artboardContainer', { static: true }]
@@ -1539,35 +1705,42 @@
1539
1705
  FsBlockEditorSidebarPanelDirective,
1540
1706
  FsBlockEditorMarginDirective,
1541
1707
  SidebarComponent,
1542
- ArtboardComponent], imports: [i11.CommonModule,
1708
+ ArtboardComponent,
1709
+ LayersReorderDialogComponent], imports: [i11.CommonModule,
1543
1710
  i14.FormsModule,
1544
- i5.MatIconModule,
1545
- i4.MatButtonModule,
1711
+ i3.MatIconModule,
1712
+ i6.MatButtonModule,
1546
1713
  i13.MatInputModule,
1547
- i6.MatFormFieldModule,
1714
+ i6$1.MatFormFieldModule,
1548
1715
  i9.MatCheckboxModule,
1549
1716
  i12.MatTooltipModule,
1550
- i7.MatSelectModule,
1551
- i3.FsFileModule,
1717
+ i7$1.MatSelectModule,
1718
+ i4.MatListModule,
1719
+ i7.DragDropModule,
1720
+ i3$1.FsFileModule,
1552
1721
  i10.FsColorPickerModule,
1553
1722
  menu.FsMenuModule,
1554
- i2$1.FsZoomPanModule], exports: [FsBlockComponent,
1723
+ i2$2.FsZoomPanModule,
1724
+ i2.FsDialogModule], exports: [FsBlockComponent,
1555
1725
  FsBlockEditorComponent,
1556
1726
  FsBlockEditorSidebarPanelDirective] });
1557
1727
  FsBlockEditorModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockEditorModule, imports: [[
1558
1728
  i11.CommonModule,
1559
1729
  i14.FormsModule,
1560
- i5.MatIconModule,
1561
- i4.MatButtonModule,
1730
+ i3.MatIconModule,
1731
+ i6.MatButtonModule,
1562
1732
  i13.MatInputModule,
1563
- i6.MatFormFieldModule,
1733
+ i6$1.MatFormFieldModule,
1564
1734
  i9.MatCheckboxModule,
1565
1735
  i12.MatTooltipModule,
1566
- i7.MatSelectModule,
1567
- i3.FsFileModule,
1736
+ i7$1.MatSelectModule,
1737
+ i4.MatListModule,
1738
+ i7.DragDropModule,
1739
+ i3$1.FsFileModule,
1568
1740
  i10.FsColorPickerModule,
1569
1741
  menu.FsMenuModule,
1570
- i2$1.FsZoomPanModule,
1742
+ i2$2.FsZoomPanModule,
1743
+ i2.FsDialogModule,
1571
1744
  ]] });
1572
1745
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockEditorModule, decorators: [{
1573
1746
  type: i0.NgModule,
@@ -1575,17 +1748,20 @@
1575
1748
  imports: [
1576
1749
  i11.CommonModule,
1577
1750
  i14.FormsModule,
1578
- i5.MatIconModule,
1579
- i4.MatButtonModule,
1751
+ i3.MatIconModule,
1752
+ i6.MatButtonModule,
1580
1753
  i13.MatInputModule,
1581
- i6.MatFormFieldModule,
1754
+ i6$1.MatFormFieldModule,
1582
1755
  i9.MatCheckboxModule,
1583
1756
  i12.MatTooltipModule,
1584
- i7.MatSelectModule,
1585
- i3.FsFileModule,
1757
+ i7$1.MatSelectModule,
1758
+ i4.MatListModule,
1759
+ i7.DragDropModule,
1760
+ i3$1.FsFileModule,
1586
1761
  i10.FsColorPickerModule,
1587
1762
  menu.FsMenuModule,
1588
- i2$1.FsZoomPanModule,
1763
+ i2$2.FsZoomPanModule,
1764
+ i2.FsDialogModule,
1589
1765
  ],
1590
1766
  exports: [
1591
1767
  FsBlockComponent,
@@ -1599,6 +1775,7 @@
1599
1775
  FsBlockEditorMarginDirective,
1600
1776
  SidebarComponent,
1601
1777
  ArtboardComponent,
1778
+ LayersReorderDialogComponent,
1602
1779
  ],
1603
1780
  }]
1604
1781
  }] });