@firestitch/block-editor 12.1.8 → 12.2.1

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) {
@@ -57,11 +62,57 @@
57
62
  var BlockFormat;
58
63
  (function (BlockFormat) {
59
64
  BlockFormat["Date"] = "date";
60
- BlockFormat["YYYYMMDD"] = "yyyy/MM/dd";
65
+ BlockFormat["YYYYMMDD"] = "YYYY/MM/DD";
61
66
  BlockFormat["Currency"] = "currency";
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,29 +431,223 @@
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", {
448
+ get: function () {
449
+ return __spreadArray([], __read(this._blocks$.getValue()));
450
+ },
451
+ enumerable: false,
452
+ configurable: true
453
+ });
454
+ Object.defineProperty(BlocksStore.prototype, "blocks$", {
394
455
  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
- ]);
456
+ return this._blocks$.asObservable();
402
457
  },
403
458
  enumerable: false,
404
459
  configurable: true
405
460
  });
461
+ Object.defineProperty(BlocksStore.prototype, "blockAdded$", {
462
+ get: function () {
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
+ }));
485
+ },
486
+ enumerable: false,
487
+ configurable: true
488
+ });
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) {
508
+ this._config = config;
509
+ this._setBlocks(this._config.blocks);
510
+ };
511
+ BlocksStore.prototype.blockExists = function (block) {
512
+ var index = this.blocks.findIndex(function (b) {
513
+ return b.guid === block.guid;
514
+ });
515
+ return index !== -1;
516
+ };
517
+ BlocksStore.prototype.blockAdd = function (block, initBlock) {
518
+ var _this = this;
519
+ if (initBlock === void 0) { initBlock = false; }
520
+ if (!this._config.blockAdd) {
521
+ console.warn('[BlockEditor] Config "blockAdd" is not defined');
522
+ return;
523
+ }
524
+ if (initBlock) {
525
+ block = this._createBlock(block);
526
+ }
527
+ this._config.blockAdd(block)
528
+ .pipe(operators.takeUntil(this._destroy$))
529
+ .subscribe(function (newBlock) {
530
+ _this._appendBlock(newBlock);
531
+ });
532
+ };
533
+ BlocksStore.prototype.blockUpload = function (block, fsFile, initBlock) {
534
+ var _this = this;
535
+ if (initBlock === void 0) { initBlock = false; }
536
+ if (!this._config.blockUpload) {
537
+ console.warn('[BlockEditor] Config "blockUpload" is not defined');
538
+ return;
539
+ }
540
+ if (initBlock) {
541
+ block = this._createBlock(block);
542
+ }
543
+ this._config.blockUpload(block, fsFile.file)
544
+ .pipe(operators.takeUntil(this._destroy$))
545
+ .subscribe(function (newBlock) {
546
+ _this._appendBlock(newBlock);
547
+ });
548
+ };
549
+ BlocksStore.prototype.blockChange = function (block) {
550
+ if (this._config.blockChanged) {
551
+ this._config.blockChanged(block);
552
+ }
553
+ this._dispatchEvent(EventType.Change, block);
554
+ };
555
+ BlocksStore.prototype.blockRemove = function (targetBlocks) {
556
+ var _this = this;
557
+ var blocks = this.blocks;
558
+ if (!Array.isArray(targetBlocks)) {
559
+ targetBlocks = [targetBlocks];
560
+ }
561
+ targetBlocks.forEach(function (block) {
562
+ var index = blocks
563
+ .findIndex(function (b) { return b.guid === block.guid; });
564
+ if (index !== -1) {
565
+ blocks.splice(index, 1);
566
+ _this._dispatchEvent(EventType.Remove, block);
567
+ }
568
+ });
569
+ this._setBlocks(blocks);
570
+ };
571
+ BlocksStore.prototype.isReordableBlock = function (block) {
572
+ return [
573
+ exports.BlockType.LongText,
574
+ exports.BlockType.ShortText,
575
+ exports.BlockType.RadioButton,
576
+ exports.BlockType.Checkbox,
577
+ exports.BlockType.Date,
578
+ exports.BlockType.Signature,
579
+ ].indexOf(block.type) > -1;
580
+ };
581
+ BlocksStore.prototype.updateTabIndex = function (index) {
582
+ this._lastTabIndex = index;
583
+ };
584
+ BlocksStore.prototype._setBlocks = function (blocks) {
585
+ var _this = this;
586
+ this._blocks$.next(__spreadArray([], __read(blocks)));
587
+ blocks
588
+ .filter(function (b) { return _this.isReordableBlock(b); })
589
+ .forEach(function (b) {
590
+ _this._lastTabIndex = Math.max(b.tabIndex, _this._lastTabIndex);
591
+ });
592
+ };
593
+ BlocksStore.prototype._appendBlock = function (block) {
594
+ var blocks = __spreadArray(__spreadArray([], __read(this.blocks)), [
595
+ block,
596
+ ]);
597
+ this._deduplicateIndexesFor(blocks);
598
+ this._setBlocks(blocks);
599
+ this._dispatchEvent(EventType.Add, block);
600
+ };
601
+ BlocksStore.prototype._dispatchEvent = function (type, value) {
602
+ this._eventBus$.next({
603
+ type: type,
604
+ value: value,
605
+ });
606
+ };
607
+ BlocksStore.prototype._createBlock = function (block) {
608
+ 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') });
609
+ var width = (this._config.width * .333).toFixed(2);
610
+ var height = width / 2;
611
+ if (newBlock.type === exports.BlockType.Rectangle) {
612
+ newBlock.borderColor = '#cccccc';
613
+ newBlock.borderWidth = 1;
614
+ }
615
+ else if (newBlock.type === exports.BlockType.Checkbox || newBlock.type === exports.BlockType.RadioButton) {
616
+ width = .25;
617
+ height = .25;
618
+ newBlock.keepRatio = true;
619
+ }
620
+ else {
621
+ width = 2;
622
+ height = .5;
623
+ }
624
+ if (this.isReordableBlock(newBlock)) {
625
+ newBlock.tabIndex = this._lastTabIndex + 1;
626
+ this.updateTabIndex(newBlock.tabIndex);
627
+ }
628
+ return Object.assign({ top: height, left: width, width: width, height: height }, newBlock);
629
+ };
630
+ BlocksStore.prototype._deduplicateIndexesFor = function (blocks) {
631
+ blocks.forEach(function (block, index) {
632
+ block.index = index;
633
+ });
634
+ };
635
+ return BlocksStore;
636
+ }());
637
+ BlocksStore.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BlocksStore, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
638
+ BlocksStore.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BlocksStore });
639
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BlocksStore, decorators: [{
640
+ type: i0.Injectable
641
+ }] });
642
+
643
+ var BlockEditorService = /** @class */ (function () {
644
+ function BlockEditorService(_store, _dialog) {
645
+ this._store = _store;
646
+ this._dialog = _dialog;
647
+ this._selectedBlocks$ = new rxjs.BehaviorSubject([]);
648
+ this._blockComponents = new Map();
649
+ this._destroy$ = new rxjs.Subject();
650
+ }
406
651
  Object.defineProperty(BlockEditorService.prototype, "blockComponents", {
407
652
  get: function () {
408
653
  return Array.from(this._blockComponents.values());
@@ -419,41 +664,17 @@
419
664
  enumerable: false,
420
665
  configurable: true
421
666
  });
422
- BlockEditorService.prototype.blockUpload = function (block, fsFile) {
423
- var _this = this;
424
- if (this.config.blockUpload) {
425
- this.config.blockUpload(block, fsFile.file)
426
- .pipe(operators.takeUntil(this._destroy$))
427
- .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();
437
- });
438
- }
667
+ BlockEditorService.prototype.init = function (config) {
668
+ this.config = config;
669
+ this._store.init(Object.assign({}, this.config));
439
670
  };
440
- BlockEditorService.prototype.blockAdd = function (block) {
441
- 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
- });
456
- }
671
+ BlockEditorService.prototype.blockAdd = function (block, newBlock) {
672
+ if (newBlock === void 0) { newBlock = false; }
673
+ this._store.blockAdd(block, newBlock);
674
+ };
675
+ BlockEditorService.prototype.blockUpload = function (block, fsFile, newBlock) {
676
+ if (newBlock === void 0) { newBlock = false; }
677
+ this._store.blockUpload(block, fsFile, false);
457
678
  };
458
679
  BlockEditorService.prototype._updateIndexesFor = function (blocks) {
459
680
  blocks.forEach(function (block, index) {
@@ -461,76 +682,55 @@
461
682
  });
462
683
  return blocks;
463
684
  };
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
- }
685
+ BlockEditorService.prototype.blockRemove = function (block) {
686
+ this._store.blockRemove(block);
482
687
  };
483
688
  BlockEditorService.prototype.removeSelectedBlocks = function () {
484
689
  var _this = this;
485
- this.selectedBlocks.forEach(function (block) {
486
- _this.removeBlock(block);
690
+ this.selectedBlocks
691
+ .forEach(function (block) {
692
+ _this.blockRemove(block);
487
693
  });
488
694
  this.selectedBlocks = [];
489
695
  };
490
696
  Object.defineProperty(BlockEditorService.prototype, "blocks$", {
491
697
  get: function () {
492
- return this._blocks$;
698
+ return this._store.blocks$;
493
699
  },
494
700
  enumerable: false,
495
701
  configurable: true
496
702
  });
497
703
  Object.defineProperty(BlockEditorService.prototype, "blockChanged$", {
498
704
  get: function () {
499
- return this._blockChanged$;
705
+ return this._store.blockChanged$;
500
706
  },
501
707
  enumerable: false,
502
708
  configurable: true
503
709
  });
504
- Object.defineProperty(BlockEditorService.prototype, "blockRemoved$", {
710
+ Object.defineProperty(BlockEditorService.prototype, "blockAdded$", {
505
711
  get: function () {
506
- return this._blockRemoved$;
712
+ return this._store.blockAdded$;
507
713
  },
508
714
  enumerable: false,
509
715
  configurable: true
510
716
  });
511
- Object.defineProperty(BlockEditorService.prototype, "blockAdded$", {
717
+ Object.defineProperty(BlockEditorService.prototype, "blockRemoved$", {
512
718
  get: function () {
513
- return this._blockAdded$;
719
+ return this._store.blockRemoved$;
514
720
  },
515
721
  enumerable: false,
516
722
  configurable: true
517
723
  });
518
- BlockEditorService.prototype.blockChange = function (block) {
519
- this._blockChanged$.next(block);
520
- if (this.config.blockChanged) {
521
- this.config.blockChanged(block);
522
- }
523
- };
524
724
  Object.defineProperty(BlockEditorService.prototype, "blocks", {
525
725
  get: function () {
526
- return this._blocks$.getValue();
527
- },
528
- set: function (blocks) {
529
- this._blocks$.next(blocks);
726
+ return this._store.blocks;
530
727
  },
531
728
  enumerable: false,
532
729
  configurable: true
533
730
  });
731
+ BlockEditorService.prototype.blockChange = function (block) {
732
+ this._store.blockChange(block);
733
+ };
534
734
  BlockEditorService.prototype.isSelectedBlock = function (block) {
535
735
  return this.selectedBlocks.indexOf(block.block) !== -1;
536
736
  };
@@ -539,27 +739,11 @@
539
739
  };
540
740
  BlockEditorService.prototype.selectedBlockComponentChangeProperty = function (value, name) {
541
741
  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
- }
742
+ this.selectedBlocks
743
+ .forEach(function (block) {
744
+ block[name] = value;
745
+ _this.blockChange(block);
746
+ });
563
747
  };
564
748
  Object.defineProperty(BlockEditorService.prototype, "selectedBlocks$", {
565
749
  get: function () {
@@ -615,14 +799,6 @@
615
799
  BlockEditorService.prototype.registerBlock = function (block, blockComponent) {
616
800
  this._blockComponents.set(block, blockComponent);
617
801
  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
802
  };
627
803
  BlockEditorService.prototype.unregisterBlock = function (block) {
628
804
  this._blockComponents.delete(block);
@@ -633,26 +809,27 @@
633
809
  BlockEditorService.prototype.registerMargin = function (margin) {
634
810
  this.margin = margin;
635
811
  };
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') });
812
+ BlockEditorService.prototype.openReorderDialog = function () {
813
+ var _this = this;
814
+ var reordableFields = this.blockComponents
815
+ .filter(function (blockCmp) {
816
+ return _this._store.isReordableBlock(blockCmp.block);
817
+ });
818
+ this._dialog
819
+ .open(LayersReorderDialogComponent, {
820
+ data: {
821
+ fields: reordableFields,
822
+ }
823
+ })
824
+ .afterClosed()
825
+ .pipe(operators.takeUntil(this._destroy$))
826
+ .subscribe(function (fields) {
827
+ fields.forEach(function (blockCmp, index) {
828
+ blockCmp.block.tabIndex = index;
829
+ _this._store.blockChange(blockCmp.block);
830
+ _this._store.updateTabIndex(index);
831
+ });
832
+ });
656
833
  };
657
834
  BlockEditorService.prototype.ngOnDestroy = function () {
658
835
  this._destroy$.next();
@@ -660,11 +837,11 @@
660
837
  };
661
838
  return BlockEditorService;
662
839
  }());
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 });
840
+ 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
841
  BlockEditorService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BlockEditorService });
665
842
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BlockEditorService, decorators: [{
666
843
  type: i0.Injectable
667
- }] });
844
+ }], ctorParameters: function () { return [{ type: BlocksStore }, { type: i2__namespace.FsDialog }]; } });
668
845
 
669
846
  var FsBlockComponent = /** @class */ (function () {
670
847
  function FsBlockComponent(_blockEditor, _elementRef, _cdRef) {
@@ -750,7 +927,8 @@
750
927
  });
751
928
  Object.defineProperty(FsBlockComponent.prototype, "top", {
752
929
  set: function (value) {
753
- this.element.nativeElement.style.top = "" + parseFloat(value) + this.unit;
930
+ this.block.top = parseFloat(value);
931
+ this.element.nativeElement.style.top = "" + this.block.top + this.unit;
754
932
  this.moveable.updateRect();
755
933
  },
756
934
  enumerable: false,
@@ -758,7 +936,8 @@
758
936
  });
759
937
  Object.defineProperty(FsBlockComponent.prototype, "left", {
760
938
  set: function (value) {
761
- this.element.nativeElement.style.left = "" + parseFloat(value) + this.unit;
939
+ this.block.left = parseFloat(value);
940
+ this.element.nativeElement.style.left = "" + this.block.left + this.unit;
762
941
  this.moveable.updateRect();
763
942
  },
764
943
  enumerable: false,
@@ -1055,18 +1234,6 @@
1055
1234
  type: i0.Input
1056
1235
  }] } });
1057
1236
 
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
1237
  var BlockFormats = [
1071
1238
  { value: BlockFormat.Number, name: 'Number', blockTypes: [exports.BlockType.ShortText, exports.BlockType.LongText] },
1072
1239
  { value: BlockFormat.Currency, name: 'Currency', blockTypes: [exports.BlockType.ShortText, exports.BlockType.LongText] },
@@ -1075,11 +1242,12 @@
1075
1242
  ];
1076
1243
 
1077
1244
  var SidebarComponent = /** @class */ (function () {
1078
- function SidebarComponent(_el, _blockEditor, _cdRef, _prompt) {
1245
+ function SidebarComponent(_el, _blockEditor, _cdRef, _prompt, _document) {
1079
1246
  this._el = _el;
1080
1247
  this._blockEditor = _blockEditor;
1081
1248
  this._cdRef = _cdRef;
1082
1249
  this._prompt = _prompt;
1250
+ this._document = _document;
1083
1251
  this.zoomCenter = new i0.EventEmitter();
1084
1252
  this.BlockTypes = BlockTypes;
1085
1253
  this.blockTypeNames = common.index(BlockTypes, 'value', 'name');
@@ -1225,20 +1393,18 @@
1225
1393
  });
1226
1394
  }
1227
1395
  };
1228
- SidebarComponent.prototype.blockUpload = function (blockType, fsFile) {
1229
- var block = this._blockEditor.sanitizeNewBlock({
1230
- type: blockType,
1231
- });
1232
- this._blockEditor.blockUpload(block, fsFile);
1396
+ SidebarComponent.prototype.blockUpload = function (type, fsFile) {
1397
+ this._blockEditor.blockUpload({
1398
+ type: type,
1399
+ }, fsFile, true);
1233
1400
  };
1234
1401
  SidebarComponent.prototype.blockAdd = function (type) {
1235
1402
  if (type === exports.BlockType.Pdf || type === exports.BlockType.Image) {
1236
1403
  return;
1237
1404
  }
1238
- var block = this._blockEditor.sanitizeNewBlock({
1405
+ this._blockEditor.blockAdd({
1239
1406
  type: type,
1240
- });
1241
- this._blockEditor.blockAdd(block);
1407
+ }, true);
1242
1408
  };
1243
1409
  SidebarComponent.prototype.layerMove = function (direction) {
1244
1410
  var _this = this;
@@ -1264,6 +1430,11 @@
1264
1430
  SidebarComponent.prototype.layerDown = function () {
1265
1431
  this.layerMove(-1);
1266
1432
  };
1433
+ SidebarComponent.prototype.reorderLayers = function () {
1434
+ var _a;
1435
+ (_a = this._document.defaultView) === null || _a === void 0 ? void 0 : _a.scrollTo(0, 0);
1436
+ this._blockEditor.openReorderDialog();
1437
+ };
1267
1438
  SidebarComponent.prototype.blockChanged = function (block) {
1268
1439
  if (this.config.blockChanged) {
1269
1440
  this.config.blockChanged(block);
@@ -1281,8 +1452,8 @@
1281
1452
  };
1282
1453
  return SidebarComponent;
1283
1454
  }());
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 });
1455
+ 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 });
1456
+ 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
1457
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SidebarComponent, decorators: [{
1287
1458
  type: i0.Component,
1288
1459
  args: [{
@@ -1291,7 +1462,12 @@
1291
1462
  styleUrls: ['sidebar.component.scss'],
1292
1463
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
1293
1464
  }]
1294
- }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: BlockEditorService }, { type: i0__namespace.ChangeDetectorRef }, { type: i2__namespace.FsPrompt }]; }, propDecorators: { sidebarPanels: [{
1465
+ }], ctorParameters: function () {
1466
+ return [{ type: i0__namespace.ElementRef }, { type: BlockEditorService }, { type: i0__namespace.ChangeDetectorRef }, { type: i2__namespace$1.FsPrompt }, { type: undefined, decorators: [{
1467
+ type: i0.Inject,
1468
+ args: [i11.DOCUMENT]
1469
+ }] }];
1470
+ }, propDecorators: { sidebarPanels: [{
1295
1471
  type: i0.ContentChildren,
1296
1472
  args: [FsBlockEditorSidebarPanelDirective]
1297
1473
  }], config: [{
@@ -1359,9 +1535,9 @@
1359
1535
  _this._cdRef.markForCheck();
1360
1536
  });
1361
1537
  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
- }))
1538
+ .pipe(operators.filter(function (event) {
1539
+ return ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].indexOf(event.key) !== -1;
1540
+ }), operators.takeUntil(this._destroy$))
1365
1541
  .subscribe(function (event) {
1366
1542
  event.preventDefault();
1367
1543
  var inchPixel = 1 / 100;
@@ -1462,8 +1638,7 @@
1462
1638
  FsBlockEditorComponent.prototype.ngOnInit = function () {
1463
1639
  var _this = this;
1464
1640
  this.config = Object.assign(Object.assign({}, this.config), { unit: 'in' });
1465
- this._blockEditor.blocks = this.config.blocks;
1466
- this._blockEditor.config = this.config;
1641
+ this._blockEditor.init(this.config);
1467
1642
  this._blockEditor.blocks$
1468
1643
  .pipe(operators.takeUntil(this._destroy$))
1469
1644
  .subscribe(function (blocks) {
@@ -1492,7 +1667,8 @@
1492
1667
  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
1668
  FsBlockEditorComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsBlockEditorComponent, selector: "fs-block-editor", inputs: { config: "config" }, providers: [
1494
1669
  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 });
1670
+ BlocksStore,
1671
+ ], 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
1672
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockEditorComponent, decorators: [{
1497
1673
  type: i0.Component,
1498
1674
  args: [{
@@ -1502,6 +1678,7 @@
1502
1678
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
1503
1679
  providers: [
1504
1680
  BlockEditorService,
1681
+ BlocksStore,
1505
1682
  ]
1506
1683
  }]
1507
1684
  }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: BlockEditorService }]; }, propDecorators: { sidebarPanels: [{
@@ -1509,7 +1686,7 @@
1509
1686
  args: [FsBlockEditorSidebarPanelDirective]
1510
1687
  }], zoompan: [{
1511
1688
  type: i0.ViewChild,
1512
- args: [i2$1.FsZoomPanComponent, { static: true }]
1689
+ args: [i2$2.FsZoomPanComponent, { static: true }]
1513
1690
  }], artboardContainer: [{
1514
1691
  type: i0.ViewChild,
1515
1692
  args: ['artboardContainer', { static: true }]
@@ -1539,35 +1716,42 @@
1539
1716
  FsBlockEditorSidebarPanelDirective,
1540
1717
  FsBlockEditorMarginDirective,
1541
1718
  SidebarComponent,
1542
- ArtboardComponent], imports: [i11.CommonModule,
1719
+ ArtboardComponent,
1720
+ LayersReorderDialogComponent], imports: [i11.CommonModule,
1543
1721
  i14.FormsModule,
1544
- i5.MatIconModule,
1545
- i4.MatButtonModule,
1722
+ i3.MatIconModule,
1723
+ i6.MatButtonModule,
1546
1724
  i13.MatInputModule,
1547
- i6.MatFormFieldModule,
1725
+ i6$1.MatFormFieldModule,
1548
1726
  i9.MatCheckboxModule,
1549
1727
  i12.MatTooltipModule,
1550
- i7.MatSelectModule,
1551
- i3.FsFileModule,
1728
+ i7$1.MatSelectModule,
1729
+ i4.MatListModule,
1730
+ i7.DragDropModule,
1731
+ i3$1.FsFileModule,
1552
1732
  i10.FsColorPickerModule,
1553
1733
  menu.FsMenuModule,
1554
- i2$1.FsZoomPanModule], exports: [FsBlockComponent,
1734
+ i2$2.FsZoomPanModule,
1735
+ i2.FsDialogModule], exports: [FsBlockComponent,
1555
1736
  FsBlockEditorComponent,
1556
1737
  FsBlockEditorSidebarPanelDirective] });
1557
1738
  FsBlockEditorModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockEditorModule, imports: [[
1558
1739
  i11.CommonModule,
1559
1740
  i14.FormsModule,
1560
- i5.MatIconModule,
1561
- i4.MatButtonModule,
1741
+ i3.MatIconModule,
1742
+ i6.MatButtonModule,
1562
1743
  i13.MatInputModule,
1563
- i6.MatFormFieldModule,
1744
+ i6$1.MatFormFieldModule,
1564
1745
  i9.MatCheckboxModule,
1565
1746
  i12.MatTooltipModule,
1566
- i7.MatSelectModule,
1567
- i3.FsFileModule,
1747
+ i7$1.MatSelectModule,
1748
+ i4.MatListModule,
1749
+ i7.DragDropModule,
1750
+ i3$1.FsFileModule,
1568
1751
  i10.FsColorPickerModule,
1569
1752
  menu.FsMenuModule,
1570
- i2$1.FsZoomPanModule,
1753
+ i2$2.FsZoomPanModule,
1754
+ i2.FsDialogModule,
1571
1755
  ]] });
1572
1756
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockEditorModule, decorators: [{
1573
1757
  type: i0.NgModule,
@@ -1575,17 +1759,20 @@
1575
1759
  imports: [
1576
1760
  i11.CommonModule,
1577
1761
  i14.FormsModule,
1578
- i5.MatIconModule,
1579
- i4.MatButtonModule,
1762
+ i3.MatIconModule,
1763
+ i6.MatButtonModule,
1580
1764
  i13.MatInputModule,
1581
- i6.MatFormFieldModule,
1765
+ i6$1.MatFormFieldModule,
1582
1766
  i9.MatCheckboxModule,
1583
1767
  i12.MatTooltipModule,
1584
- i7.MatSelectModule,
1585
- i3.FsFileModule,
1768
+ i7$1.MatSelectModule,
1769
+ i4.MatListModule,
1770
+ i7.DragDropModule,
1771
+ i3$1.FsFileModule,
1586
1772
  i10.FsColorPickerModule,
1587
1773
  menu.FsMenuModule,
1588
- i2$1.FsZoomPanModule,
1774
+ i2$2.FsZoomPanModule,
1775
+ i2.FsDialogModule,
1589
1776
  ],
1590
1777
  exports: [
1591
1778
  FsBlockComponent,
@@ -1599,6 +1786,7 @@
1599
1786
  FsBlockEditorMarginDirective,
1600
1787
  SidebarComponent,
1601
1788
  ArtboardComponent,
1789
+ LayersReorderDialogComponent,
1602
1790
  ],
1603
1791
  }]
1604
1792
  }] });