@firestitch/block-editor 12.0.1 → 12.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/app/components/artboard/artboard.component.d.ts +35 -0
  2. package/app/components/block/block.component.d.ts +19 -33
  3. package/app/components/block-editor/block-editor.component.d.ts +9 -18
  4. package/app/components/sidebar/sidebar.component.d.ts +27 -13
  5. package/app/consts/block-types.const.d.ts +12 -0
  6. package/app/consts/index.d.ts +1 -0
  7. package/app/enums/block-type.enum.d.ts +11 -0
  8. package/app/enums/index.d.ts +1 -0
  9. package/app/fs-block-editor.module.d.ts +14 -9
  10. package/app/interfaces/block-editor-config.d.ts +9 -7
  11. package/app/interfaces/block.d.ts +13 -2
  12. package/app/services/block-editor.service.d.ts +31 -13
  13. package/app/services/index.d.ts +1 -0
  14. package/bundles/firestitch-block-editor.umd.js +663 -584
  15. package/bundles/firestitch-block-editor.umd.js.map +1 -1
  16. package/esm2015/app/components/artboard/artboard.component.js +129 -0
  17. package/esm2015/app/components/block/block.component.js +166 -203
  18. package/esm2015/app/components/block-editor/block-editor.component.js +31 -89
  19. package/esm2015/app/components/sidebar/sidebar.component.js +113 -175
  20. package/esm2015/app/consts/block-types.const.js +13 -0
  21. package/esm2015/app/consts/index.js +2 -0
  22. package/esm2015/app/enums/block-type.enum.js +13 -0
  23. package/esm2015/app/enums/index.js +2 -0
  24. package/esm2015/app/fs-block-editor.module.js +22 -3
  25. package/esm2015/app/interfaces/block-editor-config.js +1 -1
  26. package/esm2015/app/interfaces/block.js +1 -1
  27. package/esm2015/app/services/block-editor.service.js +165 -33
  28. package/esm2015/app/services/index.js +2 -0
  29. package/esm2015/public_api.js +3 -4
  30. package/fesm2015/firestitch-block-editor.js +601 -477
  31. package/fesm2015/firestitch-block-editor.js.map +1 -1
  32. package/package.json +3 -2
  33. package/public_api.d.ts +2 -0
@@ -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('rxjs/operators'), require('moveable'), require('rxjs'), require('@firestitch/common')) :
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', 'rxjs/operators', 'moveable', 'rxjs', '@firestitch/common'], 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.i5, global.i6, global.rxjs.operators, global.Moveable, global.rxjs, global.common));
5
- })(this, (function (exports, i9, i8, i0, i7, i2, i4, i3, i5, i6, operators, Moveable, rxjs, common) { '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('@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/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/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.i8, global.i3, global.menu, global.i2$1, global.rxjs.operators, global.Moveable, global.rxjs, global.common, global.i2, global.ng.material.checkbox, global.ng.material.tooltip));
5
+ })(this, (function (exports, i12, i11, i0, i9, i4, i6, i5, i8, i3, menu, i2$1, operators, Moveable, rxjs, common, i2, i7, i10) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -24,16 +24,33 @@
24
24
  return Object.freeze(n);
25
25
  }
26
26
 
27
- var i9__namespace = /*#__PURE__*/_interopNamespace(i9);
28
- var i8__namespace = /*#__PURE__*/_interopNamespace(i8);
27
+ var i12__namespace = /*#__PURE__*/_interopNamespace(i12);
28
+ var i11__namespace = /*#__PURE__*/_interopNamespace(i11);
29
29
  var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
30
- var i7__namespace = /*#__PURE__*/_interopNamespace(i7);
31
- var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
30
+ var i9__namespace = /*#__PURE__*/_interopNamespace(i9);
32
31
  var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
33
- var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
34
- var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
35
32
  var i6__namespace = /*#__PURE__*/_interopNamespace(i6);
33
+ var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
34
+ var i8__namespace = /*#__PURE__*/_interopNamespace(i8);
35
+ var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
36
+ var i2__namespace$1 = /*#__PURE__*/_interopNamespace(i2$1);
36
37
  var Moveable__default = /*#__PURE__*/_interopDefaultLegacy(Moveable);
38
+ var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
39
+ var i7__namespace = /*#__PURE__*/_interopNamespace(i7);
40
+ var i10__namespace = /*#__PURE__*/_interopNamespace(i10);
41
+
42
+ exports.BlockType = void 0;
43
+ (function (BlockType) {
44
+ BlockType["Rectangle"] = "rectangle";
45
+ BlockType["ShortText"] = "shorttext";
46
+ BlockType["LongText"] = "longtext";
47
+ BlockType["Image"] = "image";
48
+ BlockType["RadioButton"] = "radiobutton";
49
+ BlockType["Checkbox"] = "checkbox";
50
+ BlockType["Signature"] = "signature";
51
+ BlockType["Pdf"] = "pdf";
52
+ BlockType["Date"] = "date";
53
+ })(exports.BlockType || (exports.BlockType = {}));
37
54
 
38
55
  /*! *****************************************************************************
39
56
  Copyright (c) Microsoft Corporation.
@@ -355,13 +372,18 @@
355
372
 
356
373
  var BlockEditorService = /** @class */ (function () {
357
374
  function BlockEditorService() {
358
- this.blockComponents = [];
375
+ this._blockChanged$ = new rxjs.Subject();
376
+ this._blockRemoved$ = new rxjs.Subject();
377
+ this._blockAdded$ = new rxjs.Subject();
359
378
  this._blocks$ = new rxjs.BehaviorSubject([]);
360
- this._selectedBlockComponents$ = new rxjs.BehaviorSubject([]);
379
+ this._selectedBlocks$ = new rxjs.BehaviorSubject([]);
380
+ this._blockComponents = new Map();
381
+ this._destroy$ = new rxjs.Subject();
361
382
  }
362
383
  Object.defineProperty(BlockEditorService.prototype, "elementGuidelines", {
363
384
  get: function () {
364
- return __spreadArray(__spreadArray([], __read(this.blockComponents.map(function (block) {
385
+ return __spreadArray(__spreadArray([], __read(Array.from(this._blockComponents.values())
386
+ .map(function (block) {
365
387
  return block.el;
366
388
  }))), [
367
389
  this.container,
@@ -371,16 +393,90 @@
371
393
  enumerable: false,
372
394
  configurable: true
373
395
  });
374
- BlockEditorService.prototype.addBlock = function (block) {
375
- this.blocks$.next(__spreadArray(__spreadArray([], __read(this.blocks)), [this.sanitizeBlock(block)]));
396
+ Object.defineProperty(BlockEditorService.prototype, "blockComponents", {
397
+ get: function () {
398
+ return Array.from(this._blockComponents.values());
399
+ },
400
+ enumerable: false,
401
+ configurable: true
402
+ });
403
+ Object.defineProperty(BlockEditorService.prototype, "selectedComponentBlocks", {
404
+ get: function () {
405
+ var _this = this;
406
+ return this.blockComponents
407
+ .filter(function (blockComponent) { return _this.selectedBlocks.indexOf(blockComponent.block) !== -1; });
408
+ },
409
+ enumerable: false,
410
+ configurable: true
411
+ });
412
+ BlockEditorService.prototype.blockUpload = function (block, fsFile) {
413
+ var _this = this;
414
+ if (this.config.blockUpload) {
415
+ this.config.blockUpload(block, fsFile.file)
416
+ .pipe(operators.takeUntil(this._destroy$))
417
+ .subscribe(function (block) {
418
+ var blocks = __spreadArray(__spreadArray([], __read(_this.blocks)), [
419
+ block,
420
+ ]);
421
+ _this.blocks = _this._updateIndexesFor(blocks);
422
+ _this._blockAdded$.next(block);
423
+ if (_this.config.blockAdded) {
424
+ _this.config.blockAdded(block);
425
+ }
426
+ //this._updateIndexes();
427
+ });
428
+ }
429
+ };
430
+ BlockEditorService.prototype.blockAdd = function (block) {
431
+ var _this = this;
432
+ if (this.config.blockAdd) {
433
+ this.config.blockAdd(block)
434
+ .pipe(operators.takeUntil(this._destroy$))
435
+ .subscribe(function (block) {
436
+ var blocks = __spreadArray(__spreadArray([], __read(_this.blocks)), [
437
+ block,
438
+ ]);
439
+ _this.blocks = _this._updateIndexesFor(blocks);
440
+ _this._blockAdded$.next(block);
441
+ if (_this.config.blockAdded) {
442
+ _this.config.blockAdded(block);
443
+ }
444
+ //this._updateIndexes();
445
+ });
446
+ }
376
447
  };
448
+ BlockEditorService.prototype._updateIndexesFor = function (blocks) {
449
+ blocks.forEach(function (block, index) {
450
+ block.index = index;
451
+ });
452
+ return blocks;
453
+ };
454
+ // private _updateIndexes(): void {
455
+ // const sort = this.blocks.slice().sort((a, b) => {
456
+ // return a.index > b.index ? 1 : -1;
457
+ // })
458
+ // sort.forEach((block, index) => {
459
+ // this.blocks.find((item) => {
460
+ // return block.reference === item.reference;
461
+ // }).index = index;
462
+ // });
463
+ // }
377
464
  BlockEditorService.prototype.removeBlock = function (block) {
378
465
  var index = this.indexOf(block);
379
466
  if (index !== -1) {
380
- this.blocks.splice(index, 1);
381
- this.blocks$.next(this.blocks);
467
+ var blocks = this.blocks;
468
+ blocks.splice(index, 1);
469
+ this.blocks = blocks;
470
+ this._blockRemoved$.next(block);
382
471
  }
383
472
  };
473
+ BlockEditorService.prototype.removeSelectedBlocks = function () {
474
+ var _this = this;
475
+ this.selectedBlocks.forEach(function (block) {
476
+ _this.removeBlock(block);
477
+ });
478
+ this.selectedBlocks = [];
479
+ };
384
480
  Object.defineProperty(BlockEditorService.prototype, "blocks$", {
385
481
  get: function () {
386
482
  return this._blocks$;
@@ -388,9 +484,36 @@
388
484
  enumerable: false,
389
485
  configurable: true
390
486
  });
487
+ Object.defineProperty(BlockEditorService.prototype, "blockChanged$", {
488
+ get: function () {
489
+ return this._blockChanged$;
490
+ },
491
+ enumerable: false,
492
+ configurable: true
493
+ });
494
+ Object.defineProperty(BlockEditorService.prototype, "blockRemoved$", {
495
+ get: function () {
496
+ return this._blockRemoved$;
497
+ },
498
+ enumerable: false,
499
+ configurable: true
500
+ });
501
+ Object.defineProperty(BlockEditorService.prototype, "blockAdded$", {
502
+ get: function () {
503
+ return this._blockAdded$;
504
+ },
505
+ enumerable: false,
506
+ configurable: true
507
+ });
508
+ BlockEditorService.prototype.blockChange = function (block) {
509
+ this._blockChanged$.next(block);
510
+ if (this.config.blockChanged) {
511
+ this.config.blockChanged(block);
512
+ }
513
+ };
391
514
  Object.defineProperty(BlockEditorService.prototype, "blocks", {
392
515
  get: function () {
393
- return this.blocks$.getValue();
516
+ return this._blocks$.getValue();
394
517
  },
395
518
  set: function (blocks) {
396
519
  this._blocks$.next(blocks);
@@ -399,35 +522,68 @@
399
522
  configurable: true
400
523
  });
401
524
  BlockEditorService.prototype.isSelectedBlock = function (block) {
402
- return this.selectedBlockComponents.indexOf(block) !== -1;
525
+ return this.selectedBlocks.indexOf(block.block) !== -1;
403
526
  };
404
527
  BlockEditorService.prototype.indexOf = function (block) {
405
528
  return this.blocks.map(function (e) { return e.reference; }).indexOf(block.reference);
406
529
  };
407
- Object.defineProperty(BlockEditorService.prototype, "selectedBlockComponents", {
408
- get: function () {
409
- return this._selectedBlockComponents$.getValue();
410
- },
411
- set: function (blocks) {
412
- this.blockComponents.forEach(function (block) {
413
- block.editable = false;
414
- block.transformable = blocks.indexOf(block) !== -1;
530
+ BlockEditorService.prototype.selectedBlockComponentChangeProperty = function (value, name) {
531
+ var _this = this;
532
+ if (name === 'index') {
533
+ var blocks_1 = this.blocks;
534
+ var affectedGUIDs_1 = this.selectedBlocks.map(function (block) { return block.guid; });
535
+ blocks_1.forEach(function (block, index) {
536
+ var guidIndex = affectedGUIDs_1.indexOf(block.guid);
537
+ if (guidIndex !== -1) {
538
+ blocks_1.splice(index, 1);
539
+ blocks_1.splice(+value, 0, block);
540
+ block.index = +value;
541
+ _this.blockChange(block);
542
+ }
543
+ });
544
+ this._updateIndexesFor(blocks_1);
545
+ }
546
+ else {
547
+ this.selectedBlocks
548
+ .forEach(function (block) {
549
+ block[name] = value;
550
+ _this.blockChange(block);
415
551
  });
416
- this._selectedBlockComponents$.next(blocks);
552
+ }
553
+ };
554
+ Object.defineProperty(BlockEditorService.prototype, "selectedBlocks$", {
555
+ get: function () {
556
+ return this._selectedBlocks$;
417
557
  },
418
558
  enumerable: false,
419
559
  configurable: true
420
560
  });
421
- Object.defineProperty(BlockEditorService.prototype, "selectedBlocks", {
422
- get: function () {
423
- return this.selectedBlockComponents.map(function (blockComponent) { return blockComponent.block; });
561
+ Object.defineProperty(BlockEditorService.prototype, "selectedBlock", {
562
+ set: function (block) {
563
+ this.selectedBlocks = [block];
424
564
  },
425
565
  enumerable: false,
426
566
  configurable: true
427
567
  });
428
- Object.defineProperty(BlockEditorService.prototype, "selectedBlockComponents$", {
568
+ Object.defineProperty(BlockEditorService.prototype, "selectedBlocks", {
429
569
  get: function () {
430
- return this._selectedBlockComponents$;
570
+ return this._selectedBlocks$.getValue();
571
+ },
572
+ set: function (blocks) {
573
+ this.blockComponents
574
+ .forEach(function (blockComponent) {
575
+ blockComponent.editable = false;
576
+ if (blocks.indexOf(blockComponent.block) !== -1) {
577
+ blockComponent.transformable = true;
578
+ }
579
+ else {
580
+ blockComponent.deselect();
581
+ }
582
+ });
583
+ this._selectedBlocks$.next(blocks);
584
+ if (this.config.blocksSelected) {
585
+ this.config.blocksSelected(blocks);
586
+ }
431
587
  },
432
588
  enumerable: false,
433
589
  configurable: true
@@ -446,16 +602,20 @@
446
602
  BlockEditorService.prototype.hasSelectionRange = function () {
447
603
  return this._selectionRange && (this._selectionRange.baseOffset - this._selectionRange.focusOffset) > 0;
448
604
  };
449
- BlockEditorService.prototype.registerBlock = function (block) {
450
- var _this = this;
605
+ BlockEditorService.prototype.registerBlock = function (block, blockComponent) {
606
+ this._blockComponents.set(block, blockComponent);
451
607
  this.blockComponents.push(block);
452
- this.blockComponents.forEach(function (item) {
453
- var blocks = _this.elementGuidelines
454
- .filter(function (el) {
455
- return !el.isSameNode(item.el);
456
- });
457
- item.elementGuidelines = blocks;
458
- });
608
+ // Disabled for now
609
+ // this.blockComponents.forEach((blockComponent: FsBlockComponent) => {
610
+ // const blocks = this.elementGuidelines
611
+ // .filter((el) => {
612
+ // return !el.isSameNode(blockComponent.el);
613
+ // });
614
+ // blockComponent.elementGuidelines = blocks;
615
+ // });
616
+ };
617
+ BlockEditorService.prototype.unregisterBlock = function (block) {
618
+ this._blockComponents.delete(block);
459
619
  };
460
620
  BlockEditorService.prototype.registerContainer = function (container) {
461
621
  this.container = container;
@@ -463,8 +623,17 @@
463
623
  BlockEditorService.prototype.registerMargin = function (margin) {
464
624
  this.margin = margin;
465
625
  };
626
+ BlockEditorService.prototype.sanitizeNewBlock = function (block) {
627
+ var width = (this.config.width * .333).toFixed(2);
628
+ var height = (this.config.height * .333).toFixed(2);
629
+ return this.sanitizeBlock(Object.assign({ top: height, left: width, width: height, height: width }, block));
630
+ };
466
631
  BlockEditorService.prototype.sanitizeBlock = function (block) {
467
- return Object.assign({ shapeBottomLeft: 'round', shapeTopLeft: 'round', shapeTopRight: 'round', shapeBottomRight: 'round', verticalAlign: 'top', horizontalAlign: 'left' }, block);
632
+ return Object.assign(Object.assign({ shapeBottomLeft: 'round', shapeTopLeft: 'round', shapeTopRight: 'round', shapeBottomRight: 'round', verticalAlign: 'top', horizontalAlign: 'left' }, block), { guid: block.guid || common.guid('xxxxxxxxxxxx') });
633
+ };
634
+ BlockEditorService.prototype.ngOnDestroy = function () {
635
+ this._destroy$.next();
636
+ this._destroy$.complete();
468
637
  };
469
638
  return BlockEditorService;
470
639
  }());
@@ -472,15 +641,17 @@
472
641
  BlockEditorService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BlockEditorService });
473
642
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BlockEditorService, decorators: [{
474
643
  type: i0.Injectable
475
- }], ctorParameters: function () { return []; } });
644
+ }] });
476
645
 
477
646
  var FsBlockComponent = /** @class */ (function () {
478
- function FsBlockComponent(_service, _elementRef, _cdRef) {
479
- this._service = _service;
647
+ function FsBlockComponent(_blockEditor, _elementRef, _cdRef) {
648
+ this._blockEditor = _blockEditor;
480
649
  this._elementRef = _elementRef;
481
650
  this._cdRef = _cdRef;
482
- this.changed = new i0.EventEmitter();
651
+ this.transformating = false;
652
+ this.BlockType = exports.BlockType;
483
653
  this._editable = false;
654
+ this._transformable = false;
484
655
  this._destroy$ = new rxjs.Subject();
485
656
  }
486
657
  Object.defineProperty(FsBlockComponent.prototype, "el", {
@@ -512,14 +683,14 @@
512
683
  });
513
684
  Object.defineProperty(FsBlockComponent.prototype, "elementGuidelines", {
514
685
  set: function (value) {
515
- this._moveable.elementGuidelines = value;
686
+ this.moveable.elementGuidelines = value;
516
687
  },
517
688
  enumerable: false,
518
689
  configurable: true
519
690
  });
520
691
  Object.defineProperty(FsBlockComponent.prototype, "clippable", {
521
692
  set: function (value) {
522
- this._moveable.clippable = value;
693
+ this.moveable.clippable = value;
523
694
  },
524
695
  enumerable: false,
525
696
  configurable: true
@@ -532,98 +703,48 @@
532
703
  this._transformable = value;
533
704
  this.moveable.draggable = value;
534
705
  this.moveable.resizable = value;
535
- this.moveable.draggable = value;
536
706
  this.moveable.roundable = value;
537
707
  this.moveable.rotatable = value;
538
708
  },
539
709
  enumerable: false,
540
710
  configurable: true
541
711
  });
542
- Object.defineProperty(FsBlockComponent.prototype, "lineHeight", {
543
- set: function (value) {
544
- this.block.lineHeight = value;
545
- this._triggerChanged();
546
- },
547
- enumerable: false,
548
- configurable: true
549
- });
550
- Object.defineProperty(FsBlockComponent.prototype, "borderWidth", {
551
- set: function (value) {
552
- this.block.borderWidth = value;
553
- this._triggerChanged();
554
- },
555
- enumerable: false,
556
- configurable: true
557
- });
558
- Object.defineProperty(FsBlockComponent.prototype, "fontSize", {
559
- set: function (value) {
560
- this.block.fontSize = value;
561
- this._triggerChanged();
562
- },
563
- enumerable: false,
564
- configurable: true
565
- });
566
- Object.defineProperty(FsBlockComponent.prototype, "backgroundColor", {
567
- set: function (value) {
568
- this.block.backgroundColor = value;
569
- this._triggerChanged();
570
- },
571
- enumerable: false,
572
- configurable: true
573
- });
574
712
  Object.defineProperty(FsBlockComponent.prototype, "width", {
575
713
  set: function (value) {
576
- this.block.width = parseFloat(value);
577
- this.element.nativeElement.style.width = "" + this.block.width + this.unit;
578
- this._moveable.updateRect();
579
- this._triggerChanged();
714
+ this.element.nativeElement.style.width = "" + parseFloat(value) + this.unit;
715
+ this.moveable.updateRect();
580
716
  },
581
717
  enumerable: false,
582
718
  configurable: true
583
719
  });
584
720
  Object.defineProperty(FsBlockComponent.prototype, "height", {
585
721
  set: function (value) {
586
- this.block.height = parseFloat(value);
587
- this.element.nativeElement.style.height = "" + this.block.height + this.unit;
588
- this._moveable.updateRect();
589
- this._triggerChanged();
722
+ this.element.nativeElement.style.height = "" + parseFloat(value) + this.unit;
723
+ this.moveable.updateRect();
590
724
  },
591
725
  enumerable: false,
592
726
  configurable: true
593
727
  });
594
728
  Object.defineProperty(FsBlockComponent.prototype, "top", {
595
729
  set: function (value) {
596
- this.block.top = parseFloat(value);
597
- this.element.nativeElement.style.top = "" + this.block.top + this.unit;
598
- this._moveable.updateRect();
599
- this._triggerChanged();
730
+ this.element.nativeElement.style.top = "" + parseFloat(value) + this.unit;
731
+ this.moveable.updateRect();
600
732
  },
601
733
  enumerable: false,
602
734
  configurable: true
603
735
  });
604
736
  Object.defineProperty(FsBlockComponent.prototype, "left", {
605
737
  set: function (value) {
606
- this.block.left = parseFloat(value);
607
- this.element.nativeElement.style.left = "" + this.block.left + this.unit;
608
- this._moveable.updateRect();
609
- this._triggerChanged();
738
+ this.element.nativeElement.style.left = "" + parseFloat(value) + this.unit;
739
+ this.moveable.updateRect();
610
740
  },
611
741
  enumerable: false,
612
742
  configurable: true
613
743
  });
614
744
  Object.defineProperty(FsBlockComponent.prototype, "rotate", {
615
745
  set: function (value) {
616
- this.block.rotate = parseFloat(value);
617
- this._moveable.request('rotatable', { rotate: this.block.rotate }, true);
618
- this._triggerChanged();
619
- },
620
- enumerable: false,
621
- configurable: true
622
- });
623
- Object.defineProperty(FsBlockComponent.prototype, "shapeRadius", {
624
- set: function (value) {
625
- this.block.shapeRadius = value;
626
- this._triggerChanged();
746
+ this.moveable.request('rotatable', { rotate: parseFloat(value) }, true);
747
+ this.moveable.updateRect();
627
748
  },
628
749
  enumerable: false,
629
750
  configurable: true
@@ -635,193 +756,137 @@
635
756
  enumerable: false,
636
757
  configurable: true
637
758
  });
638
- Object.defineProperty(FsBlockComponent.prototype, "borderColor", {
639
- set: function (value) {
640
- this.block.borderColor = value;
641
- this._triggerChanged();
642
- },
643
- enumerable: false,
644
- configurable: true
645
- });
646
- Object.defineProperty(FsBlockComponent.prototype, "paddingAll", {
759
+ Object.defineProperty(FsBlockComponent.prototype, "keepRatio", {
647
760
  set: function (value) {
648
- this.block.padding = value;
649
- this.block.paddingTop = null;
650
- this.block.paddingBottom = null;
651
- this.block.paddingLeft = null;
652
- this.block.paddingRight = null;
653
- this._triggerChanged();
761
+ this.moveable.keepRatio = value;
654
762
  },
655
763
  enumerable: false,
656
764
  configurable: true
657
765
  });
658
- FsBlockComponent.prototype.padding = function (name, value) {
659
- this.block[name] = value;
660
- this.block.padding = null;
661
- this._triggerChanged();
662
- };
663
- Object.defineProperty(FsBlockComponent.prototype, "imageUrl", {
664
- set: function (value) {
665
- this.block.imageUrl = value;
666
- this._triggerChanged();
667
- },
668
- enumerable: false,
669
- configurable: true
670
- });
671
- Object.defineProperty(FsBlockComponent.prototype, "fontColor", {
672
- set: function (value) {
673
- this.block.fontColor = value;
674
- this._triggerChanged();
675
- },
676
- enumerable: false,
677
- configurable: true
678
- });
679
- Object.defineProperty(FsBlockComponent.prototype, "verticalAlign", {
680
- set: function (value) {
681
- this.block.verticalAlign = value;
682
- this._triggerChanged();
683
- },
684
- enumerable: false,
685
- configurable: true
686
- });
687
- FsBlockComponent.prototype.shapeRound = function (name, value) {
688
- this.block[name] = value;
689
- this._triggerChanged();
690
- };
691
- Object.defineProperty(FsBlockComponent.prototype, "horizontalAlign", {
692
- set: function (value) {
693
- this.block.horizontalAlign = value;
694
- this._triggerChanged();
695
- },
696
- enumerable: false,
697
- configurable: true
698
- });
699
- Object.defineProperty(FsBlockComponent.prototype, "italic", {
700
- get: function () {
701
- return this.block.italic;
702
- },
703
- set: function (value) {
704
- this.block.italic = value;
705
- this._triggerChanged();
706
- },
707
- enumerable: false,
708
- configurable: true
709
- });
710
- Object.defineProperty(FsBlockComponent.prototype, "bold", {
711
- get: function () {
712
- return this.block.bold;
713
- },
714
- set: function (value) {
715
- this.block.bold = value;
716
- this._triggerChanged();
717
- },
718
- enumerable: false,
719
- configurable: true
720
- });
721
- Object.defineProperty(FsBlockComponent.prototype, "underline", {
722
- get: function () {
723
- return this.block.underline;
724
- },
725
- set: function (value) {
726
- this.block.underline = value;
727
- this._triggerChanged();
728
- },
729
- enumerable: false,
730
- configurable: true
731
- });
732
- FsBlockComponent.prototype.updateRect = function () {
733
- this.moveable.updateRect();
734
- };
735
766
  FsBlockComponent.prototype.markForCheck = function () {
736
767
  this._cdRef.markForCheck();
737
768
  };
738
769
  FsBlockComponent.prototype.ngOnInit = function () {
739
- this.block = this._service.sanitizeBlock(this.block);
740
- this.unit = this._service.config.unit;
770
+ var _this = this;
771
+ this.unit = this._blockEditor.config.unit;
741
772
  this.content = this.block.content;
773
+ this._blockEditor.blockChanged$
774
+ .pipe(operators.filter(function (block) { return block === _this.block; }), operators.takeUntil(this._destroy$))
775
+ .subscribe(function (block) {
776
+ _this.keepRatio = block.keepRatio;
777
+ _this.width = block.width;
778
+ _this.height = block.height;
779
+ _this.top = block.top;
780
+ _this.left = block.left;
781
+ _this._cdRef.markForCheck();
782
+ });
742
783
  };
743
784
  FsBlockComponent.prototype.ngAfterContentInit = function () {
744
785
  var _this = this;
745
- this.el.style.width = this.block.width + this.unit;
746
- this.el.style.height = this.block.height + this.unit;
747
- this.el.style.top = this.block.top + this.unit;
748
- this.el.style.left = this.block.left + this.unit;
749
- this._setTransform();
750
- rxjs.fromEvent(this.contentEditable.nativeElement, 'input')
751
- .pipe(operators.takeUntil(this._destroy$)).subscribe(function (event) {
752
- _this.block.content = event.target.innerHTML;
753
- _this._triggerChanged();
754
- });
755
- rxjs.fromEvent(this.el, 'mousedown')
756
- .pipe(operators.takeUntil(this._destroy$), operators.filter(function () { return !_this.block.readonly; })).subscribe(function (event) {
757
- if (_this.editable) {
758
- if (_this.contentElement.nativeElement.isSameNode(event.target)) {
759
- event.preventDefault();
760
- event.stopImmediatePropagation();
761
- event.stopPropagation();
762
- }
763
- }
764
- else {
765
- _this._service.selectedBlockComponents = [_this];
766
- }
786
+ setTimeout(function () {
787
+ _this._initEvents();
788
+ _this._initMoveable();
789
+ _this._setTransform();
790
+ _this.width = _this.block.width;
791
+ _this.height = _this.block.height;
792
+ _this.top = _this.block.top;
793
+ _this.left = _this.block.left;
794
+ _this._blockEditor.registerBlock(_this.block, _this);
767
795
  });
768
- rxjs.fromEvent(this.el, 'dblclick')
769
- .pipe(operators.filter(function () { return (!_this.editable); }), operators.takeUntil(this._destroy$))
770
- .subscribe(function (event) {
771
- if (_this.block.readonly) {
772
- event.preventDefault();
796
+ };
797
+ FsBlockComponent.prototype.pxToIn = function (px) {
798
+ return this.round(px / 96, 2);
799
+ };
800
+ FsBlockComponent.prototype.round = function (value, decimals) {
801
+ return parseFloat(value.toFixed(decimals));
802
+ };
803
+ FsBlockComponent.prototype.deselect = function () {
804
+ this.transformable = false;
805
+ this.editable = false;
806
+ };
807
+ FsBlockComponent.prototype.deselectContent = function () {
808
+ if (window.getSelection) {
809
+ if (window.getSelection().empty) {
810
+ window.getSelection().empty();
773
811
  }
774
- else {
775
- _this.editable = true;
776
- _this._cdRef.markForCheck();
777
- setTimeout(function () {
778
- _this.selectAll();
779
- });
812
+ else if (window.getSelection().removeAllRanges) {
813
+ window.getSelection().removeAllRanges();
780
814
  }
781
- });
815
+ }
816
+ };
817
+ FsBlockComponent.prototype.selectAll = function () {
818
+ var range = document.createRange();
819
+ range.selectNodeContents(this.contentEditable.nativeElement);
820
+ var sel = window.getSelection();
821
+ sel.removeAllRanges();
822
+ sel.addRange(range);
823
+ };
824
+ FsBlockComponent.prototype.ngOnDestroy = function () {
825
+ this._blockEditor.unregisterBlock(this.block);
826
+ this._destroy$.next();
827
+ this._destroy$.complete();
828
+ };
829
+ FsBlockComponent.prototype._setTransform = function (transforms) {
830
+ if (transforms === void 0) { transforms = []; }
831
+ transforms = transforms !== null && transforms !== void 0 ? transforms : [];
832
+ if (this.block.rotate) {
833
+ transforms.push("rotate(" + this.block.rotate + "deg)");
834
+ }
835
+ this.el.style.transform = transforms.join(' ');
836
+ };
837
+ FsBlockComponent.prototype._triggerChanged = function () {
838
+ this._blockEditor.blockChange(this.block);
839
+ };
840
+ FsBlockComponent.prototype._initMoveable = function () {
841
+ var _this = this;
782
842
  this._moveable = new Moveable__default["default"](this._elementRef.nativeElement, {
783
843
  target: this.el,
784
- container: this._service.container,
844
+ container: this._blockEditor.container,
785
845
  draggable: false,
786
846
  resizable: false,
787
847
  scalable: false,
788
848
  rotatable: false,
789
849
  warpable: false,
790
850
  origin: false,
791
- keepRatio: false,
851
+ keepRatio: this.block.keepRatio,
792
852
  snappable: true,
793
- snapHorizontal: true,
794
- snapVertical: true,
795
- snapCenter: true,
796
- snapElement: true,
797
853
  edge: false,
798
854
  throttleDrag: 1,
799
855
  throttleScale: 0.01,
800
856
  throttleRotate: 1,
801
857
  throttleResize: 1,
802
858
  });
803
- this._service.registerBlock(this);
804
- this._moveable
859
+ this.moveable
805
860
  .on('clip', function (e) {
806
861
  _this.block.clipPath = e.clipStyle;
807
862
  e.target.style.clipPath = e.clipStyle;
808
863
  _this._triggerChanged();
809
864
  });
810
- this._moveable.on('dragStart', function (_a) {
811
- var target = _a.target, clientX = _a.clientX, clientY = _a.clientY;
865
+ this.moveable
866
+ .on('dragStart', function () {
812
867
  _this.editable = false;
813
- }).on('drag', function (_a) {
868
+ _this.transformating = true;
869
+ _this._cdRef.markForCheck();
870
+ })
871
+ .on('drag', function (_a) {
814
872
  var target = _a.target, left = _a.left, top = _a.top;
815
873
  target.style.left = _this.pxToIn(left) + _this.unit;
816
874
  target.style.top = _this.pxToIn(top) + _this.unit;
817
875
  _this.block.top = _this.pxToIn(top);
818
876
  _this.block.left = _this.pxToIn(left);
819
877
  _this._triggerChanged();
820
- });
821
- this._moveable.on('resizeStart', function (_a) {
822
- var target = _a.target, clientX = _a.clientX, clientY = _a.clientY;
878
+ })
879
+ .on('dragEnd', function () {
880
+ _this.transformating = false;
881
+ _this._cdRef.markForCheck();
882
+ })
883
+ .on('resizeStart', function () {
823
884
  _this.editable = false;
824
- }).on('resize', function (_a) {
885
+ _this.zoompan.disable();
886
+ _this.transformating = true;
887
+ _this._cdRef.markForCheck();
888
+ })
889
+ .on('resize', function (_a) {
825
890
  var target = _a.target, width = _a.width, height = _a.height, dist = _a.dist, delta = _a.delta, direction = _a.direction;
826
891
  width = _this.pxToIn(width);
827
892
  height = _this.pxToIn(height);
@@ -842,7 +907,8 @@
842
907
  }
843
908
  _this._setTransform(["translate(" + transform[0] + "px, " + transform[1] + "px)"]);
844
909
  _this._triggerChanged();
845
- }).on('resizeEnd', function (_a) {
910
+ })
911
+ .on('resizeEnd', function (_a) {
846
912
  var target = _a.target;
847
913
  var matrix = new WebKitCSSMatrix(target.style.transform);
848
914
  _this.block.top = parseFloat(target.style.top) + _this.pxToIn(matrix.m42);
@@ -851,64 +917,73 @@
851
917
  target.style.left = _this.block.left + _this.unit;
852
918
  _this._setTransform();
853
919
  _this._triggerChanged();
854
- });
855
- this._moveable.on('rotateStart', function (_a) {
856
- var target = _a.target, clientX = _a.clientX, clientY = _a.clientY;
920
+ _this.zoompan.enable();
921
+ _this.transformating = false;
922
+ _this._cdRef.markForCheck();
923
+ })
924
+ .on('rotateStart', function () {
925
+ _this.zoompan.disable();
857
926
  _this.editable = false;
858
927
  _this._rotateStart = _this.block.rotate || 0;
859
- }).on('rotate', function (_a) {
928
+ _this.transformating = true;
929
+ _this._cdRef.markForCheck();
930
+ })
931
+ .on('rotate', function (_a) {
860
932
  var rotate = _a.rotate, transform = _a.transform;
861
933
  _this.block.rotate = _this._rotateStart + rotate;
862
934
  _this.el.style.transform = transform;
863
935
  _this._triggerChanged();
936
+ _this.zoompan.enable();
937
+ })
938
+ .on('rotateEnd', function () {
939
+ _this.transformating = false;
940
+ _this._cdRef.markForCheck();
864
941
  });
865
942
  };
866
- FsBlockComponent.prototype.pxToIn = function (px) {
867
- return this.round(px / 96, 2);
868
- };
869
- FsBlockComponent.prototype.round = function (value, decimals) {
870
- return parseFloat(value.toFixed(decimals));
871
- };
872
- FsBlockComponent.prototype.deselect = function () {
873
- this.transformable = false;
874
- this.editable = false;
875
- };
876
- FsBlockComponent.prototype.deselectContent = function () {
877
- if (window.getSelection) {
878
- if (window.getSelection().empty) {
879
- window.getSelection().empty();
943
+ FsBlockComponent.prototype._initEvents = function () {
944
+ var _this = this;
945
+ rxjs.fromEvent(this.contentEditable.nativeElement, 'input')
946
+ .pipe(operators.takeUntil(this._destroy$)).subscribe(function (event) {
947
+ _this.block.content = event.target.innerHTML;
948
+ _this._triggerChanged();
949
+ });
950
+ rxjs.fromEvent(this.el, 'mousedown')
951
+ .pipe(operators.takeUntil(this._destroy$), operators.filter(function () { return !_this.block.readonly; })).subscribe(function (event) {
952
+ _this.zoompan.disable();
953
+ if (_this.editable) {
954
+ if (_this.contentElement.nativeElement.isSameNode(event.target)) {
955
+ event.preventDefault();
956
+ event.stopImmediatePropagation();
957
+ event.stopPropagation();
958
+ }
880
959
  }
881
- else if (window.getSelection().removeAllRanges) {
882
- window.getSelection().removeAllRanges();
960
+ else {
961
+ _this._blockEditor.selectedBlock = _this.block;
883
962
  }
884
- }
885
- };
886
- FsBlockComponent.prototype.selectAll = function () {
887
- var range = document.createRange();
888
- range.selectNodeContents(this.contentEditable.nativeElement);
889
- var sel = window.getSelection();
890
- sel.removeAllRanges();
891
- sel.addRange(range);
892
- };
893
- FsBlockComponent.prototype.ngOnDestroy = function () {
894
- this._destroy$.next();
895
- this._destroy$.complete();
896
- };
897
- FsBlockComponent.prototype._setTransform = function (transforms) {
898
- if (transforms === void 0) { transforms = []; }
899
- transforms = transforms !== null && transforms !== void 0 ? transforms : [];
900
- if (this.block.rotate) {
901
- transforms.push("rotate(" + this.block.rotate + "deg)");
902
- }
903
- this.el.style.transform = transforms.join(' ');
904
- };
905
- FsBlockComponent.prototype._triggerChanged = function () {
906
- this.changed.emit(this.block);
963
+ });
964
+ rxjs.fromEvent(this.el, 'mouseup')
965
+ .pipe(operators.takeUntil(this._destroy$), operators.filter(function () { return !_this.block.readonly; })).subscribe(function () {
966
+ _this.zoompan.enable();
967
+ });
968
+ rxjs.fromEvent(this.el, 'dblclick')
969
+ .pipe(operators.filter(function () { return (!_this.editable); }), operators.takeUntil(this._destroy$))
970
+ .subscribe(function (event) {
971
+ if (_this.block.readonly) {
972
+ event.preventDefault();
973
+ }
974
+ else {
975
+ _this.editable = true;
976
+ _this._cdRef.markForCheck();
977
+ setTimeout(function () {
978
+ _this.selectAll();
979
+ });
980
+ }
981
+ });
907
982
  };
908
983
  return FsBlockComponent;
909
984
  }());
910
985
  FsBlockComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockComponent, deps: [{ token: BlockEditorService }, { token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
911
- FsBlockComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsBlockComponent, selector: "fs-block", inputs: { block: "block", html: "html" }, outputs: { changed: "changed" }, viewQueries: [{ propertyName: "element", first: true, predicate: ["element"], descendants: true, static: true }, { propertyName: "contentElement", first: true, predicate: ["contentElement"], descendants: true, static: true }, { propertyName: "contentEditable", first: true, predicate: ["contentEditable"], descendants: true, static: true }], ngImport: i0__namespace, template: "<div\n #element\n class=\"block\"\n [ngClass]=\"{ editable: editable, readonly: block.readonly }\">\n <div\n #contentElement\n class=\"content\"\n [style.zIndex]=\"block.index\"\n [style.borderColor]=\"block.borderColor\"\n [style.borderWidth]=\"block.borderWidth ? block.borderWidth + 'pt' : ''\"\n [style.borderStyle]=\"block.borderColor ? 'solid' : 'dashed'\"\n [style.textAlign]=\"block.horizontalAlign\"\n [style.fontStyle]=\"block.italic ? 'italic' : ''\"\n [style.fontSize]=\"block.fontSize ? block.fontSize + 'pt' : ''\"\n [style.lineHeight]=\"block.lineHeight ? block.lineHeight + 'pt' : ''\"\n [style.color]=\"block.fontColor\"\n [style.fontWeight]=\"block.bold ? 'bold' : ''\"\n [style.textDecoration]=\"block.underline ? 'underline' : ''\"\n [style.paddingTop]=\"block.paddingTop ? block.paddingTop + unit : ''\"\n [style.paddingBottom]=\"block.paddingBottom ? block.paddingBottom + unit : ''\"\n [style.paddingLeft]=\"block.paddingLeft ? block.paddingLeft + unit : ''\"\n [style.paddingRight]=\"block.paddingRight ? block.paddingRight + unit : ''\"\n [style.padding]=\"block.padding ? block.padding + unit : ''\"\n [style.clipPath]=\"block.clipPath\"\n [style.backgroundColor]=\"block.backgroundColor\"\n [style.borderBottomLeftRadius]=\"block.shapeRadius && block.shapeBottomLeft === 'round' ? block.shapeRadius + unit : ''\"\n [style.borderBottomRightRadius]=\"block.shapeRadius && block.shapeBottomRight === 'round' ? block.shapeRadius + unit : ''\"\n [style.borderTopRightRadius]=\"block.shapeRadius && block.shapeTopRight === 'round' ? block.shapeRadius + unit : ''\"\n [style.borderTopLeftRadius]=\"block.shapeRadius && block.shapeTopLeft === 'round' ? block.shapeRadius + unit : ''\"\n [ngClass]=\"{\n 'editable': editable,\n 'vertical-align-center': block.verticalAlign === 'center',\n 'vertical-align-bottom': block.verticalAlign === 'bottom'\n }\">\n <img [src]=\"block.imageUrl\" *ngIf=\"block.imageUrl\">\n <div\n #contentEditable\n [contentEditable]=\"editable\"\n class=\"content-editable\"\n [innerHTML]=\"content\">\n </div>\n </div>\n</div>\n", styles: [".block{position:absolute;display:block;outline:none;-webkit-user-select:none;user-select:none}.block:not(.readonly){cursor:pointer}.block .content-editable{outline:none;position:relative}.block.editable .content-editable{cursor:text}.block .content{flex-direction:column;height:100%;display:flex;border:1px dashed #c5c5c5;position:relative;box-sizing:border-box;overflow:hidden}.block .content fs-html-editor{width:100%}.block .content.vertical-align-center{justify-content:center}.block .content.vertical-align-bottom{justify-content:flex-end}.block .content img{width:100%;height:100%;position:absolute}:host ::ng-deep fs-html-editor .bottom-line,:host ::ng-deep fs-html-editor .fr-toolbar{display:none!important}:host ::ng-deep fs-html-editor .fr-wrapper{background:none!important;border:none!important}:host ::ng-deep .moveable-line:not(.moveable-rotation-line):not(.moveable-guideline){background:transparent!important}\n"], directives: [{ type: i7__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i7__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
986
+ FsBlockComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsBlockComponent, selector: "fs-block", inputs: { block: "block", html: "html", zoompan: "zoompan" }, host: { properties: { "class.transforming": "this.transformating" } }, viewQueries: [{ propertyName: "element", first: true, predicate: ["element"], descendants: true, static: true }, { propertyName: "contentElement", first: true, predicate: ["contentElement"], descendants: true, static: true }, { propertyName: "contentEditable", first: true, predicate: ["contentEditable"], descendants: true, static: true }], ngImport: i0__namespace, template: "<div\n #element\n [class]=\"'block ' + 'block-' + block.type\"\n [ngClass]=\"{ editable: editable, readonly: block.readonly }\">\n <div\n #contentElement\n class=\"content\"\n [style.zIndex]=\"block.index\"\n [style.borderColor]=\"block.borderColor\"\n [style.borderWidth]=\"block.borderWidth ? block.borderWidth + 'pt' : ''\"\n [style.borderStyle]=\"block.borderColor ? 'solid' : 'dashed'\"\n [style.textAlign]=\"block.horizontalAlign\"\n [style.fontStyle]=\"block.italic ? 'italic' : ''\"\n [style.fontSize]=\"block.fontSize ? block.fontSize + 'pt' : ''\"\n [style.lineHeight]=\"block.lineHeight ? block.lineHeight + 'pt' : ''\"\n [style.color]=\"block.fontColor\"\n [style.fontWeight]=\"block.bold ? 'bold' : ''\"\n [style.textDecoration]=\"block.underline ? 'underline' : ''\"\n [style.paddingTop]=\"block.paddingTop ? block.paddingTop + unit : ''\"\n [style.paddingBottom]=\"block.paddingBottom ? block.paddingBottom + unit : ''\"\n [style.paddingLeft]=\"block.paddingLeft ? block.paddingLeft + unit : ''\"\n [style.paddingRight]=\"block.paddingRight ? block.paddingRight + unit : ''\"\n [style.padding]=\"block.padding ? block.padding + unit : ''\"\n [style.clipPath]=\"block.clipPath\"\n [style.backgroundColor]=\"block.backgroundColor\"\n [style.borderBottomLeftRadius]=\"block.shapeRadius && block.shapeBottomLeft === 'round' ? block.shapeRadius + unit : ''\"\n [style.borderBottomRightRadius]=\"block.shapeRadius && block.shapeBottomRight === 'round' ? block.shapeRadius + unit : ''\"\n [style.borderTopRightRadius]=\"block.shapeRadius && block.shapeTopRight === 'round' ? block.shapeRadius + unit : ''\"\n [style.borderTopLeftRadius]=\"block.shapeRadius && block.shapeTopLeft === 'round' ? block.shapeRadius + unit : ''\"\n [ngClass]=\"{\n 'editable': editable,\n 'vertical-align-center': block.verticalAlign === 'center',\n 'vertical-align-bottom': block.verticalAlign === 'bottom'\n }\">\n <ng-container [ngSwitch]=\"block.type\">\n <ng-container *ngSwitchCase=\"BlockType.Pdf\">\n <img [src]=\"block.imageUrl\">\n </ng-container>\n <img [src]=\"block.imageUrl\" *ngIf=\"block.imageUrl\">\n </ng-container>\n <ng-container *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText || block.type === BlockType.RadioButton || block.type === BlockType.Checkbox || block.type === BlockType.Date\">\n {{block.label || block.name}}\n </ng-container>\n <div\n #contentEditable\n [contentEditable]=\"editable\"\n class=\"content-editable\"\n [innerHTML]=\"content\">\n </div>\n </div>\n</div>\n", styles: [":host ::ng-deep .moveable-control{width:10px!important;height:10px!important;margin-top:-5px!important;margin-left:-5px!important}:host.transforming ::ng-deep .moveable-control,:host.transforming ::ng-deep .moveable-rotation{display:none}.block{position:absolute;display:block;outline:none;-webkit-user-select:none;user-select:none}.block:not(.readonly){cursor:pointer}.block.block-shorttext,.block.block-longtext,.block.block-date,.block.block-radiobutton,.block.block-signature,.block.block-checkbox{background-color:#aab5e1cc;color:#585555;font-size:12px}.block .content-editable{outline:none;position:relative}.block.editable .content-editable{cursor:text}.block .content{flex-direction:column;height:100%;display:flex;border:1px dashed #c5c5c5;position:relative;box-sizing:border-box;overflow:hidden}.block .content fs-html-editor{width:100%}.block .content.vertical-align-center{justify-content:center}.block .content.vertical-align-bottom{justify-content:flex-end}.block .content img{width:100%;height:100%;position:absolute}:host ::ng-deep fs-html-editor .bottom-line,:host ::ng-deep fs-html-editor .fr-toolbar{display:none!important}:host ::ng-deep fs-html-editor .fr-wrapper{background:none!important;border:none!important}:host ::ng-deep .moveable-line:not(.moveable-rotation-line):not(.moveable-guideline){background:transparent!important}\n"], directives: [{ type: i9__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i9__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i9__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i9__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
912
987
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockComponent, decorators: [{
913
988
  type: i0.Component,
914
989
  args: [{
@@ -930,8 +1005,11 @@
930
1005
  type: i0.Input
931
1006
  }], html: [{
932
1007
  type: i0.Input
933
- }], changed: [{
934
- type: i0.Output
1008
+ }], zoompan: [{
1009
+ type: i0.Input
1010
+ }], transformating: [{
1011
+ type: i0.HostBinding,
1012
+ args: ['class.transforming']
935
1013
  }] } });
936
1014
 
937
1015
  var FsBlockEditorSidebarPanelDirective = /** @class */ (function () {
@@ -954,42 +1032,30 @@
954
1032
  type: i0.Input
955
1033
  }] } });
956
1034
 
957
- var FsBlockEditorMarginDirective = /** @class */ (function () {
958
- function FsBlockEditorMarginDirective(_elementRef) {
959
- this._elementRef = _elementRef;
960
- }
961
- Object.defineProperty(FsBlockEditorMarginDirective.prototype, "element", {
962
- get: function () {
963
- return this._elementRef.nativeElement;
964
- },
965
- enumerable: false,
966
- configurable: true
967
- });
968
- return FsBlockEditorMarginDirective;
969
- }());
970
- FsBlockEditorMarginDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockEditorMarginDirective, deps: [{ token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
971
- FsBlockEditorMarginDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FsBlockEditorMarginDirective, selector: "[fsBlockEditorMargin]", ngImport: i0__namespace });
972
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockEditorMarginDirective, decorators: [{
973
- type: i0.Directive,
974
- args: [{
975
- selector: '[fsBlockEditorMargin]'
976
- }]
977
- }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }]; } });
1035
+ var BlockTypes = [
1036
+ { value: exports.BlockType.Rectangle, name: 'Rectangle', icon: 'crop_5_4' },
1037
+ { value: exports.BlockType.ShortText, name: 'Short Text', icon: 'short_text' },
1038
+ { value: exports.BlockType.LongText, name: 'Long Text', icon: 'subject' },
1039
+ { value: exports.BlockType.RadioButton, name: 'Radio Button', icon: 'radio_button_checked' },
1040
+ { value: exports.BlockType.Checkbox, name: 'Checkbox', icon: 'check_box' },
1041
+ { value: exports.BlockType.Date, name: 'Date', icon: 'calendar_today' },
1042
+ { value: exports.BlockType.Signature, name: 'Signature', icon: 'draw' },
1043
+ { value: exports.BlockType.Image, name: 'Image', icon: 'image', accept: 'image/*' },
1044
+ { value: exports.BlockType.Pdf, name: 'Pdf', icon: 'picture_as_pdf', accept: 'application/pdf' },
1045
+ ];
978
1046
 
979
1047
  var SidebarComponent = /** @class */ (function () {
980
- function SidebarComponent(_el, _service, _cdRef) {
1048
+ function SidebarComponent(_el, _blockEditor, _cdRef, _prompt) {
981
1049
  this._el = _el;
982
- this._service = _service;
1050
+ this._blockEditor = _blockEditor;
983
1051
  this._cdRef = _cdRef;
1052
+ this._prompt = _prompt;
1053
+ this.zoomCenter = new i0.EventEmitter();
1054
+ this.BlockTypes = BlockTypes;
1055
+ this.blockTypeNames = common.index(BlockTypes, 'value', 'name');
1056
+ this.BlockType = exports.BlockType;
984
1057
  this._destroy$ = new rxjs.Subject();
985
1058
  }
986
- Object.defineProperty(SidebarComponent.prototype, "changeDetector", {
987
- get: function () {
988
- return this._cdRef;
989
- },
990
- enumerable: false,
991
- configurable: true
992
- });
993
1059
  Object.defineProperty(SidebarComponent.prototype, "el", {
994
1060
  get: function () {
995
1061
  return this._el.nativeElement;
@@ -999,234 +1065,156 @@
999
1065
  });
1000
1066
  SidebarComponent.prototype.ngOnInit = function () {
1001
1067
  var _this = this;
1002
- this._service.selectedBlockComponents$
1068
+ this._blockEditor.selectedBlocks$
1003
1069
  .pipe(operators.takeUntil(this._destroy$))
1004
1070
  .subscribe(function (blocks) {
1005
1071
  _this.clippable = false;
1006
- _this.block = blocks[0] ? blocks[0].block : null;
1007
- _this.changeDetector.markForCheck();
1008
- if (_this.config.blocksSelected) {
1009
- _this.config.blocksSelected(blocks.map(function (block) { return block.block; }));
1010
- }
1072
+ _this.block = blocks[0] ? blocks[0] : null;
1073
+ _this._cdRef.markForCheck();
1074
+ });
1075
+ this._blockEditor.blockChanged$
1076
+ .pipe(operators.filter(function (block) { return block === _this.block; }), operators.takeUntil(this._destroy$))
1077
+ .subscribe(function () {
1078
+ _this._cdRef.markForCheck();
1011
1079
  });
1012
1080
  };
1013
1081
  SidebarComponent.prototype.verticalAlignClick = function (value) {
1014
- this._service.selectedBlockComponents.forEach(function (block) {
1015
- block.verticalAlign = value;
1016
- });
1082
+ this._blockEditor.selectedBlockComponentChangeProperty(value, 'verticalAlign');
1017
1083
  };
1018
1084
  SidebarComponent.prototype.boldClick = function () {
1019
- this._service.selectedBlockComponents.forEach(function (block) {
1020
- block.bold = !block.bold;
1021
- });
1085
+ this._blockEditor.selectedBlockComponentChangeProperty(!this.block.bold, 'bold');
1022
1086
  };
1023
1087
  SidebarComponent.prototype.fontColorChange = function (value) {
1024
- this._service.selectedBlockComponents.forEach(function (block) {
1025
- block.fontColor = value;
1026
- });
1088
+ this._blockEditor.selectedBlockComponentChangeProperty(value, 'fontColor');
1027
1089
  };
1028
1090
  SidebarComponent.prototype.lineHeightChange = function (value) {
1029
- var _this = this;
1030
- this._service.selectedBlockComponents.forEach(function (block) {
1031
- if (_this.validNumeric(value)) {
1032
- block.lineHeight = value || null;
1033
- }
1034
- });
1091
+ value = this.validNumeric(value) ? value : null;
1092
+ this._blockEditor.selectedBlockComponentChangeProperty(value, 'lineHeight');
1035
1093
  };
1036
1094
  SidebarComponent.prototype.fontSizeChange = function (value) {
1037
- var _this = this;
1038
- this._service.selectedBlockComponents.forEach(function (block) {
1039
- if (_this.validNumeric(value)) {
1040
- block.fontSize = value || null;
1041
- }
1042
- });
1095
+ value = this.validNumeric(value) ? value : null;
1096
+ this._blockEditor.selectedBlockComponentChangeProperty(value, 'fontSize');
1043
1097
  };
1044
1098
  SidebarComponent.prototype.borderWidthChange = function (value) {
1045
- var _this = this;
1046
- this._service.selectedBlockComponents.forEach(function (block) {
1047
- if (_this.validNumeric(value)) {
1048
- block.borderWidth = value || null;
1049
- }
1050
- });
1099
+ value = this.validNumeric(value) ? value : null;
1100
+ this._blockEditor.selectedBlockComponentChangeProperty(value, 'borderWidth');
1051
1101
  };
1052
1102
  SidebarComponent.prototype.italicClick = function () {
1053
- this._service.selectedBlockComponents.forEach(function (block) {
1054
- block.italic = !block.italic;
1055
- });
1103
+ this._blockEditor.selectedBlockComponentChangeProperty(!this.block.italic, 'italic');
1056
1104
  };
1057
1105
  SidebarComponent.prototype.underlineClick = function () {
1058
- this._service.selectedBlockComponents.forEach(function (block) {
1059
- block.underline = !block.underline;
1060
- });
1106
+ this._blockEditor.selectedBlockComponentChangeProperty(!this.block.underline, 'underline');
1061
1107
  };
1062
1108
  SidebarComponent.prototype.backgroundColorChange = function (value) {
1063
- this._service.selectedBlockComponents.forEach(function (block) {
1064
- block.backgroundColor = value;
1065
- });
1109
+ this._blockEditor.selectedBlockComponentChangeProperty(value, 'backgroundColor');
1066
1110
  };
1067
1111
  SidebarComponent.prototype.widthChange = function (value) {
1068
- var _this = this;
1069
- this._service.selectedBlockComponents.forEach(function (block) {
1070
- if (_this.validNumeric(value)) {
1071
- block.width = value;
1072
- }
1073
- });
1112
+ value = this.validNumeric(value) ? value : null;
1113
+ this._blockEditor.selectedBlockComponentChangeProperty(value, 'width');
1074
1114
  };
1075
1115
  SidebarComponent.prototype.heightChange = function (value) {
1076
- var _this = this;
1077
- this._service.selectedBlockComponents.forEach(function (block) {
1078
- if (_this.validNumeric(value)) {
1079
- block.height = value;
1080
- }
1081
- });
1116
+ value = this.validNumeric(value) ? value : null;
1117
+ this._blockEditor.selectedBlockComponentChangeProperty(value, 'height');
1082
1118
  };
1083
1119
  SidebarComponent.prototype.topChange = function (value) {
1084
- var _this = this;
1085
- this._service.selectedBlockComponents.forEach(function (block) {
1086
- if (_this.validNumeric(value)) {
1087
- block.top = value;
1088
- }
1089
- });
1120
+ value = this.validNumeric(value) ? value : null;
1121
+ this._blockEditor.selectedBlockComponentChangeProperty(value, 'top');
1090
1122
  };
1091
1123
  SidebarComponent.prototype.leftChange = function (value) {
1092
- var _this = this;
1093
- this._service.selectedBlockComponents.forEach(function (block) {
1094
- if (_this.validNumeric(value)) {
1095
- block.left = value;
1096
- }
1097
- });
1124
+ value = this.validNumeric(value) ? value : null;
1125
+ this._blockEditor.selectedBlockComponentChangeProperty(value, 'left');
1098
1126
  };
1099
1127
  SidebarComponent.prototype.rotateChange = function (value) {
1100
- var _this = this;
1101
- this._service.selectedBlockComponents.forEach(function (block) {
1102
- if (_this.validNumeric(value)) {
1103
- block.rotate = value;
1104
- }
1105
- });
1128
+ value = this.validNumeric(value) ? value : null;
1129
+ this._blockEditor.selectedBlockComponentChangeProperty(value, 'rotate');
1106
1130
  };
1107
1131
  SidebarComponent.prototype.paddingChange = function (name, value) {
1108
- var _this = this;
1109
- this._service.selectedBlockComponents.forEach(function (block) {
1110
- if (_this.validNumeric(value)) {
1111
- block.padding(name, value || null);
1112
- }
1113
- });
1132
+ value = this.validNumeric(value) ? value : null;
1133
+ this._blockEditor.selectedBlockComponentChangeProperty(value, 'padding');
1114
1134
  };
1115
1135
  SidebarComponent.prototype.paddingAllChange = function (value) {
1116
- var _this = this;
1117
- this._service.selectedBlockComponents.forEach(function (block) {
1118
- if (_this.validNumeric(value)) {
1119
- block.paddingAll = value;
1120
- }
1121
- });
1136
+ value = this.validNumeric(value) ? value : null;
1137
+ this.block.paddingTop = value;
1138
+ this.block.paddingLeft = value;
1139
+ this.block.paddingBottom = value;
1140
+ this.block.paddingRight = value;
1141
+ this.paddingChange('top', value);
1142
+ this.paddingChange('left', value);
1143
+ this.paddingChange('right', value);
1144
+ this.paddingChange('bottom', value);
1122
1145
  };
1123
1146
  SidebarComponent.prototype.borderColorChange = function (value) {
1124
- this._service.selectedBlockComponents.forEach(function (block) {
1125
- block.borderColor = value;
1126
- });
1147
+ this._blockEditor.selectedBlockComponentChangeProperty(value, 'borderColor');
1148
+ };
1149
+ SidebarComponent.prototype.toggleKeepRatio = function () {
1150
+ this._blockEditor.selectedBlockComponentChangeProperty(!this.block.keepRatio, 'keepRatio');
1127
1151
  };
1128
1152
  SidebarComponent.prototype.horizontalAlignClick = function (value) {
1129
- this._service.selectedBlockComponents.forEach(function (block) {
1130
- block.horizontalAlign = value;
1131
- });
1153
+ this._blockEditor.selectedBlockComponentChangeProperty(value, 'horizontalAlign');
1132
1154
  };
1133
- SidebarComponent.prototype.shapeRound = function (value) {
1134
- this._service.selectedBlockComponents.forEach(function (block) {
1135
- block.shapeRound(value, block.block[value] === 'round' ? 'square' : 'round');
1136
- });
1155
+ SidebarComponent.prototype.shapeRound = function (name) {
1156
+ var value = this.block[name] === 'round' ? 'square' : 'round';
1157
+ this._blockEditor.selectedBlockComponentChangeProperty(value, name);
1137
1158
  };
1138
1159
  SidebarComponent.prototype.imageRemove = function () {
1139
- this._service.selectedBlockComponents.forEach(function (block) {
1140
- block.imageUrl = null;
1141
- });
1160
+ this._blockEditor.selectedBlockComponentChangeProperty(null, 'imageUrl');
1142
1161
  };
1143
1162
  SidebarComponent.prototype.imageClip = function () {
1144
- var _this = this;
1145
1163
  this.clippable = !this.clippable;
1146
- this._service.selectedBlockComponents.forEach(function (block) {
1147
- block.clippable = _this.clippable;
1148
- });
1164
+ this._blockEditor.selectedBlockComponentChangeProperty(this.clippable, 'clippable');
1149
1165
  };
1150
1166
  SidebarComponent.prototype.shapeRadiusChange = function (value) {
1151
- this._service.selectedBlockComponents.forEach(function (block) {
1152
- block.shapeRadius = value;
1153
- });
1167
+ this._blockEditor.selectedBlockComponentChangeProperty(value, 'shapeRadius');
1168
+ };
1169
+ SidebarComponent.prototype.blockChangeProperty = function (value, name) {
1170
+ this._blockEditor.selectedBlockComponentChangeProperty(value, name);
1154
1171
  };
1155
- SidebarComponent.prototype.fileSelect = function (fsFile) {
1172
+ SidebarComponent.prototype.imageSelect = function (fsFile) {
1156
1173
  var _this = this;
1157
- if (this.config.fileUpload) {
1158
- this.config.fileUpload(fsFile.file)
1174
+ if (this.config.imageUpload) {
1175
+ this.config.imageUpload(fsFile.file)
1159
1176
  .subscribe(function (value) {
1160
- _this._service.selectedBlockComponents.forEach(function (block) {
1161
- block.imageUrl = value;
1162
- });
1177
+ _this._blockEditor.selectedBlockComponentChangeProperty(value, 'imageUrl');
1163
1178
  });
1164
1179
  }
1165
1180
  };
1166
1181
  SidebarComponent.prototype.blockRemoveClick = function () {
1167
1182
  var _this = this;
1168
- if (this.config.blocksRemoved) {
1169
- this.config.blocksRemoved(this._service.selectedBlocks)
1170
- .pipe(operators.takeUntil(this._destroy$))
1183
+ if (this.config.blocksRemove) {
1184
+ this._prompt.confirm({
1185
+ title: 'Confirm',
1186
+ template: 'Are you sure your would like to delete this block?',
1187
+ })
1188
+ .pipe(operators.switchMap(function () { return _this.config.blocksRemove(_this._blockEditor.selectedBlocks); }), operators.takeUntil(this._destroy$))
1171
1189
  .subscribe(function () {
1172
- _this._service.selectedBlocks.forEach(function (block) {
1173
- _this._service.removeBlock(block);
1174
- });
1175
- _this._service.selectedBlockComponents = [];
1176
- });
1177
- }
1178
- };
1179
- SidebarComponent.prototype.blockAddClick = function () {
1180
- var _this = this;
1181
- var width = (this.config.width * .333).toFixed(2);
1182
- var height = (this.config.height * .333).toFixed(2);
1183
- var reference = common.guid();
1184
- var block = {
1185
- type: 'text',
1186
- reference: reference,
1187
- top: height,
1188
- left: width,
1189
- width: width,
1190
- height: height,
1191
- };
1192
- if (this.config.blockAdded) {
1193
- this.config.blockAdded(block)
1194
- .pipe(operators.takeUntil(this._destroy$))
1195
- .subscribe(function (block) {
1196
- _this.addBlock(block);
1197
- _this.changeDetector.markForCheck();
1198
- _this.blockAdded
1199
- .pipe(operators.take(1), operators.takeUntil(_this._destroy$))
1200
- .subscribe(function (blockComponent) {
1201
- _this._service.selectedBlockComponents = [blockComponent];
1202
- });
1190
+ _this._blockEditor.removeSelectedBlocks();
1203
1191
  });
1204
1192
  }
1205
1193
  };
1206
- SidebarComponent.prototype.addBlock = function (block) {
1207
- this._service.addBlock(block);
1208
- this._updateIndexes();
1209
- };
1210
- SidebarComponent.prototype._updateIndexes = function () {
1211
- var _this = this;
1212
- var sort = this.blocks.slice().sort(function (a, b) {
1213
- return a.index > b.index ? 1 : -1;
1194
+ SidebarComponent.prototype.blockUpload = function (blockType, fsFile) {
1195
+ var block = this._blockEditor.sanitizeNewBlock({
1196
+ type: blockType,
1214
1197
  });
1215
- sort.forEach(function (block, index) {
1216
- _this.blocks.find(function (item) {
1217
- return block.reference === item.reference;
1218
- }).index = index;
1198
+ this._blockEditor.blockUpload(block, fsFile);
1199
+ };
1200
+ SidebarComponent.prototype.blockAdd = function (type) {
1201
+ if (type === exports.BlockType.Pdf || type === exports.BlockType.Image) {
1202
+ return;
1203
+ }
1204
+ var block = this._blockEditor.sanitizeNewBlock({
1205
+ type: type,
1219
1206
  });
1207
+ this._blockEditor.blockAdd(block);
1220
1208
  };
1221
1209
  SidebarComponent.prototype.layerMove = function (direction) {
1222
1210
  var _this = this;
1223
- this._service.blockComponents.forEach(function (blockComponent) {
1224
- if (_this._service.isSelectedBlock(blockComponent)) {
1225
- blockComponent.block.index + (999 * direction);
1211
+ this._blockEditor.blockComponents.forEach(function (blockComponent) {
1212
+ if (_this._blockEditor.isSelectedBlock(blockComponent)) {
1213
+ blockComponent.block.index += (999 * direction);
1226
1214
  }
1227
1215
  });
1228
- var sorted = this._service.blockComponents.sort(function (a, b) {
1229
- return a.index > b.index ? 1 : -1;
1216
+ var sorted = this._blockEditor.blockComponents.sort(function (a, b) {
1217
+ return a.block.index > b.block.index ? 1 : -1;
1230
1218
  });
1231
1219
  sorted.forEach(function (item, index) {
1232
1220
  item.block.index = index;
@@ -1242,11 +1230,6 @@
1242
1230
  SidebarComponent.prototype.layerDown = function () {
1243
1231
  this.layerMove(-1);
1244
1232
  };
1245
- SidebarComponent.prototype.getBlock = function (reference) {
1246
- return this._service.blocks.find(function (block) {
1247
- return block.reference === reference;
1248
- });
1249
- };
1250
1233
  SidebarComponent.prototype.blockChanged = function (block) {
1251
1234
  if (this.config.blockChanged) {
1252
1235
  this.config.blockChanged(block);
@@ -1264,8 +1247,8 @@
1264
1247
  };
1265
1248
  return SidebarComponent;
1266
1249
  }());
1267
- 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 }], target: i0__namespace.ɵɵFactoryTarget.Component });
1268
- SidebarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SidebarComponent, selector: "sidebar", inputs: { config: "config", blocks: "blocks", blockAdded: "blockAdded" }, queries: [{ propertyName: "sidebarPanels", predicate: FsBlockEditorSidebarPanelDirective }], ngImport: i0__namespace, template: "<div class=\"sidebar mat-elevation-z2\">\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Tools</div>\n <div class=\"sidebar-row\">\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"blockAddClick()\">\n <mat-icon>add</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>clear</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.width\"\n name=\"width\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"widthChange($event)\">\n <span matPrefix>W</span>\n </mat-form-field>\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 <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 </div>\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 <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Image</div>\n <div class=\"sidebar-row image-row\">\n <fs-file (select)=\"fileSelect($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 <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", styles: [".sidebar{width:285px;font-size:14px;height:100%}.sidebar .sidebar-row{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center}.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-form-field-prefix,.sidebar .sidebar-row ::ng-deep .field-label{color:#a5a5a5;font-size:11px;margin-right:2px}.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(.6);top:-6px;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;border-bottom:1px solid #dadada}.sidebar .sidebar-panel.info-panel .sidebar-row{justify-content:space-evenly}.sidebar .sidebar-panel.info-panel .sidebar-row .mat-form-field{width:41px}.sidebar .sidebar-panel.info-panel .sidebar-row >{margin:0}.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:3px;color:#9e9e9e}\n"], components: [{ type: i2__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: i4__namespace.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i5__namespace.FsColorPickerChipComponent, selector: "fs-color-picker-chip", inputs: ["color"], outputs: ["changed"] }, { type: i6__namespace.FsFileComponent, selector: "fs-file", inputs: ["minHeight", "minWidth", "multiple", "capture", "allowClick", "allowDrop", "accept", "disabled", "imageWidth", "imageHeight", "imageQuality"], outputs: ["select", "error", "clicked", "declined"] }], directives: [{ type: i7__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i8__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: i9__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: i9__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i9__namespace.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i4__namespace.MatPrefix, selector: "[matPrefix]" }, { type: i7__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i7__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
1250
+ 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 });
1251
+ 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 mat-elevation-z2\">\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\">\n <div class=\"sidebar-panel form-field-panel\">\n <div class=\"sidebar-label\">{{blockTypeNames[block.type]}} Field</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 <ng-container *ngIf=\"block.type === BlockType.Date\">\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <input\n matInput\n [ngModel]=\"block.format\"\n name=\"format\"\n placeholder=\"Format\"\n (ngModelChange)=\"blockChangeProperty($event, 'format')\">\n </mat-form-field>\n </ng-container>\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}.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.form-field-panel mat-form-field+mat-form-field{margin-top:12px}.sidebar .sidebar-panel.form-field-panel .form-field-options{margin-top:11px}.sidebar .sidebar-panel.form-field-panel .form-field-options mat-checkbox{display:block}.sidebar .sidebar-panel.form-field-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:3px;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.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: i8__namespace.FsColorPickerChipComponent, selector: "fs-color-picker-chip", inputs: ["color"], outputs: ["changed"] }], directives: [{ type: i9__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i9__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i9__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i9__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i9__namespace.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i10__namespace.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i9__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i11__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: i12__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: i12__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i12__namespace.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i6__namespace.MatPrefix, selector: "[matPrefix]" }, { type: i11__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: i9__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
1269
1252
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SidebarComponent, decorators: [{
1270
1253
  type: i0.Component,
1271
1254
  args: [{
@@ -1274,55 +1257,82 @@
1274
1257
  styleUrls: ['sidebar.component.scss'],
1275
1258
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
1276
1259
  }]
1277
- }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: BlockEditorService }, { type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { sidebarPanels: [{
1260
+ }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: BlockEditorService }, { type: i0__namespace.ChangeDetectorRef }, { type: i2__namespace.FsPrompt }]; }, propDecorators: { sidebarPanels: [{
1278
1261
  type: i0.ContentChildren,
1279
1262
  args: [FsBlockEditorSidebarPanelDirective]
1280
1263
  }], config: [{
1281
1264
  type: i0.Input
1282
1265
  }], blocks: [{
1283
1266
  type: i0.Input
1284
- }], blockAdded: [{
1285
- type: i0.Input
1267
+ }], zoomCenter: [{
1268
+ type: i0.Output
1286
1269
  }] } });
1287
1270
 
1288
- var FsBlockEditorComponent = /** @class */ (function () {
1289
- function FsBlockEditorComponent(_el, _service, _cdRef, _differs) {
1271
+ var FsBlockEditorMarginDirective = /** @class */ (function () {
1272
+ function FsBlockEditorMarginDirective(_elementRef) {
1273
+ this._elementRef = _elementRef;
1274
+ }
1275
+ Object.defineProperty(FsBlockEditorMarginDirective.prototype, "element", {
1276
+ get: function () {
1277
+ return this._elementRef.nativeElement;
1278
+ },
1279
+ enumerable: false,
1280
+ configurable: true
1281
+ });
1282
+ return FsBlockEditorMarginDirective;
1283
+ }());
1284
+ FsBlockEditorMarginDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockEditorMarginDirective, deps: [{ token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
1285
+ FsBlockEditorMarginDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FsBlockEditorMarginDirective, selector: "[fsBlockEditorMargin]", ngImport: i0__namespace });
1286
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockEditorMarginDirective, decorators: [{
1287
+ type: i0.Directive,
1288
+ args: [{
1289
+ selector: '[fsBlockEditorMargin]'
1290
+ }]
1291
+ }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }]; } });
1292
+
1293
+ var ArtboardComponent = /** @class */ (function () {
1294
+ function ArtboardComponent(_el, _blockEditor, _cdRef, _differs) {
1290
1295
  this._el = _el;
1291
- this._service = _service;
1296
+ this._blockEditor = _blockEditor;
1292
1297
  this._cdRef = _cdRef;
1293
1298
  this._differs = _differs;
1294
- this.blockAdded = new i0.EventEmitter();
1295
- this.blockRemoved = new i0.EventEmitter();
1299
+ this.blocks = [];
1296
1300
  this._destroy$ = new rxjs.Subject();
1297
1301
  this._differ = _differs.find([]).create(null);
1298
1302
  }
1299
- Object.defineProperty(FsBlockEditorComponent.prototype, "el", {
1303
+ Object.defineProperty(ArtboardComponent.prototype, "el", {
1300
1304
  get: function () {
1301
1305
  return this._el.nativeElement;
1302
1306
  },
1303
1307
  enumerable: false,
1304
1308
  configurable: true
1305
1309
  });
1306
- FsBlockEditorComponent.prototype.ngOnInit = function () {
1310
+ ArtboardComponent.prototype.ngOnInit = function () {
1307
1311
  var _this = this;
1308
1312
  this.config = Object.assign(Object.assign({}, this.config), { unit: 'in' });
1309
- this._service.registerContainer(this.artboard.nativeElement);
1310
- this._service.registerMargin(this.marginContainer.nativeElement);
1311
- this._service.blocks = this.config.blocks;
1312
- this._service.config = this.config;
1313
- this._service.blocks$
1313
+ this._blockEditor.registerContainer(this.artboard.nativeElement);
1314
+ this._blockEditor.registerMargin(this.marginContainer.nativeElement);
1315
+ this._blockEditor.blocks$
1314
1316
  .pipe(operators.takeUntil(this._destroy$))
1315
1317
  .subscribe(function (blocks) {
1316
1318
  _this.blocks = blocks;
1319
+ _this._cdRef.markForCheck();
1320
+ });
1321
+ this._blockEditor.blockAdded$
1322
+ .pipe(operators.delay(300), operators.takeUntil(this._destroy$))
1323
+ .subscribe(function (block) {
1324
+ _this._blockEditor.selectedBlocks = [block];
1325
+ _this._cdRef.markForCheck();
1317
1326
  });
1318
1327
  rxjs.fromEvent(window, 'keydown')
1319
1328
  .pipe(operators.takeUntil(this._destroy$), operators.filter(function (event) {
1320
- return !!event.key.match(/^Arrow/) && !!_this._service.selectedBlockComponents.length;
1329
+ return !!event.key.match(/^Arrow/) && !!_this._blockEditor.selectedBlocks.length;
1321
1330
  }))
1322
1331
  .subscribe(function (event) {
1323
1332
  event.preventDefault();
1324
1333
  var inchPixel = 1 / 100;
1325
- _this._service.selectedBlockComponents.forEach(function (blockComponent) {
1334
+ _this._blockEditor.selectedComponentBlocks
1335
+ .forEach(function (blockComponent) {
1326
1336
  switch (event.key) {
1327
1337
  case 'ArrowUp':
1328
1338
  blockComponent.top = blockComponent.block.top - inchPixel;
@@ -1340,35 +1350,103 @@
1340
1350
  });
1341
1351
  });
1342
1352
  };
1343
- FsBlockEditorComponent.prototype.artboardClick = function (event) {
1344
- if (event.target.isSameNode(this.artboard.nativeElement) ||
1345
- event.target.isSameNode(this.artboardContainer.nativeElement)) {
1346
- this._service.selectedBlockComponents.forEach(function (block) {
1347
- block.deselect();
1348
- block.markForCheck();
1349
- });
1350
- this._service.selectedBlockComponents = [];
1351
- }
1352
- };
1353
- FsBlockEditorComponent.prototype.blockChanged = function (block) {
1354
- this.sidebar.changeDetector.markForCheck();
1353
+ ArtboardComponent.prototype.blockChanged = function (block) {
1355
1354
  if (this.config.blockChanged) {
1356
1355
  this.config.blockChanged(block);
1357
1356
  }
1358
1357
  };
1359
- FsBlockEditorComponent.prototype.ngAfterViewInit = function () {
1358
+ ArtboardComponent.prototype.ngAfterViewInit = function () {
1359
+ // this.blockComponents.changes
1360
+ // .pipe(
1361
+ // takeUntil(this._destroy$),
1362
+ // )
1363
+ // .subscribe((changes) => {
1364
+ // const changeDiff = this._differ.diff(changes);
1365
+ // if (changeDiff) {
1366
+ // changeDiff.forEachAddedItem((change) => {
1367
+ // //this.blockAdded.emit(change.item);
1368
+ // });
1369
+ // changeDiff.forEachRemovedItem((change) => {
1370
+ // //this.blockRemoved.emit(change.item);
1371
+ // });
1372
+ // }
1373
+ // });
1374
+ };
1375
+ ArtboardComponent.prototype.ngOnDestroy = function () {
1376
+ this._destroy$.next();
1377
+ this._destroy$.complete();
1378
+ };
1379
+ return ArtboardComponent;
1380
+ }());
1381
+ ArtboardComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ArtboardComponent, deps: [{ token: i0__namespace.ElementRef }, { token: BlockEditorService }, { token: i0__namespace.ChangeDetectorRef }, { token: i0__namespace.IterableDiffers }], target: i0__namespace.ɵɵFactoryTarget.Component });
1382
+ ArtboardComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ArtboardComponent, selector: "app-artboard", inputs: { config: "config", zoompan: "zoompan" }, queries: [{ propertyName: "sidebarPanels", predicate: FsBlockEditorSidebarPanelDirective }], viewQueries: [{ propertyName: "artboard", first: true, predicate: ["artboard"], descendants: true, static: true }, { propertyName: "marginContainer", first: true, predicate: ["marginContainer"], descendants: true, static: true }, { propertyName: "sidebar", first: true, predicate: SidebarComponent, descendants: true, static: true }, { propertyName: "blockComponents", predicate: FsBlockComponent, descendants: true }, { propertyName: "margins", predicate: FsBlockEditorMarginDirective, descendants: true }], ngImport: i0__namespace, template: "<div\n #artboard\n class=\"artboard mat-elevation-z4 deselectable\"\n [style.width]=\"config.width + config.unit\"\n [style.height]=\"config.height + config.unit\">\n <fs-block\n *ngFor=\"let block of blocks\"\n [zoompan]=\"zoompan\"\n [block]=\"block\">\n </fs-block>\n <div class=\"margin margin-top\" *ngIf=\"config.marginTop\" [style.top]=\"config.marginTop + 'in'\"></div>\n <div class=\"margin margin-left\" *ngIf=\"config.marginLeft\" [style.left]=\"config.marginLeft + 'in'\"></div>\n <div class=\"margin margin-bottom\" *ngIf=\"config.marginBottom\" [style.bottom]=\"config.marginBottom + 'in'\"></div>\n <div class=\"margin margin-right\" *ngIf=\"config.marginRight\" [style.right]=\"config.marginRight + 'in'\"></div>\n <div\n #marginContainer\n class=\"margin-container\"\n [style.top]=\"config.marginTop + 'in'\"\n [style.right]=\"config.marginRight + 'in'\"\n [style.bottom]=\"config.marginBottom + 'in'\"\n [style.left]=\"config.marginLeft + 'in'\">\n </div>\n</div> \n\n", styles: [".artboard{position:relative;display:inline-flex}.artboard .margin-container{position:absolute;z-index:-1}.artboard .margin{position:absolute;border-color:#ff85bd5e;border-style:dashed;border-width:0px}.artboard .margin.margin-top,.artboard .margin.margin-bottom{width:100%;border-top-width:1px}.artboard .margin.margin-left,.artboard .margin.margin-right{height:100%;border-left-width:1px}\n"], components: [{ type: FsBlockComponent, selector: "fs-block", inputs: ["block", "html", "zoompan"] }], directives: [{ type: i9__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i9__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
1383
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ArtboardComponent, decorators: [{
1384
+ type: i0.Component,
1385
+ args: [{
1386
+ selector: 'app-artboard',
1387
+ templateUrl: 'artboard.component.html',
1388
+ styleUrls: ['artboard.component.scss'],
1389
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
1390
+ }]
1391
+ }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: BlockEditorService }, { type: i0__namespace.ChangeDetectorRef }, { type: i0__namespace.IterableDiffers }]; }, propDecorators: { sidebarPanels: [{
1392
+ type: i0.ContentChildren,
1393
+ args: [FsBlockEditorSidebarPanelDirective]
1394
+ }], blockComponents: [{
1395
+ type: i0.ViewChildren,
1396
+ args: [FsBlockComponent]
1397
+ }], artboard: [{
1398
+ type: i0.ViewChild,
1399
+ args: ['artboard', { static: true }]
1400
+ }], marginContainer: [{
1401
+ type: i0.ViewChild,
1402
+ args: ['marginContainer', { static: true }]
1403
+ }], margins: [{
1404
+ type: i0.ViewChildren,
1405
+ args: [FsBlockEditorMarginDirective]
1406
+ }], sidebar: [{
1407
+ type: i0.ViewChild,
1408
+ args: [SidebarComponent, { static: true }]
1409
+ }], config: [{
1410
+ type: i0.Input
1411
+ }], zoompan: [{
1412
+ type: i0.Input
1413
+ }] } });
1414
+
1415
+ var FsBlockEditorComponent = /** @class */ (function () {
1416
+ function FsBlockEditorComponent(_el, _blockEditor) {
1417
+ this._el = _el;
1418
+ this._blockEditor = _blockEditor;
1419
+ this._destroy$ = new rxjs.Subject();
1420
+ }
1421
+ Object.defineProperty(FsBlockEditorComponent.prototype, "el", {
1422
+ get: function () {
1423
+ return this._el.nativeElement;
1424
+ },
1425
+ enumerable: false,
1426
+ configurable: true
1427
+ });
1428
+ FsBlockEditorComponent.prototype.ngOnInit = function () {
1360
1429
  var _this = this;
1361
- this.blockComponents.changes.subscribe(function (changes) {
1362
- var changeDiff = _this._differ.diff(changes);
1363
- if (changeDiff) {
1364
- changeDiff.forEachAddedItem(function (change) {
1365
- _this.blockAdded.emit(change.item);
1366
- });
1367
- changeDiff.forEachRemovedItem(function (change) {
1368
- _this.blockRemoved.emit(change.item);
1369
- });
1370
- }
1430
+ this.config = Object.assign(Object.assign({}, this.config), { unit: 'in' });
1431
+ this._blockEditor.blocks = this.config.blocks;
1432
+ this._blockEditor.config = this.config;
1433
+ this._blockEditor.blocks$
1434
+ .pipe(operators.takeUntil(this._destroy$))
1435
+ .subscribe(function (blocks) {
1436
+ _this.blocks = blocks;
1371
1437
  });
1438
+ setTimeout(function () {
1439
+ _this.zoomCenter();
1440
+ });
1441
+ };
1442
+ FsBlockEditorComponent.prototype.zoomCenter = function () {
1443
+ this.zoompan.center(this.artboard.nativeElement, { vertical: false });
1444
+ };
1445
+ FsBlockEditorComponent.prototype.artboardClick = function (event) {
1446
+ if (event.target.classList.contains('deselectable')) {
1447
+ this.zoompan.enable();
1448
+ this._blockEditor.selectedBlocks = [];
1449
+ }
1372
1450
  };
1373
1451
  FsBlockEditorComponent.prototype.ngOnDestroy = function () {
1374
1452
  this._destroy$.next();
@@ -1376,10 +1454,10 @@
1376
1454
  };
1377
1455
  return FsBlockEditorComponent;
1378
1456
  }());
1379
- 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 }, { token: i0__namespace.ChangeDetectorRef }, { token: i0__namespace.IterableDiffers }], target: i0__namespace.ɵɵFactoryTarget.Component });
1380
- FsBlockEditorComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsBlockEditorComponent, selector: "fs-block-editor", inputs: { config: "config" }, outputs: { blockAdded: "blockAdded", blockRemoved: "blockRemoved" }, providers: [
1457
+ 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 });
1458
+ FsBlockEditorComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsBlockEditorComponent, selector: "fs-block-editor", inputs: { config: "config" }, providers: [
1381
1459
  BlockEditorService,
1382
- ], queries: [{ propertyName: "sidebarPanels", predicate: FsBlockEditorSidebarPanelDirective }], viewQueries: [{ propertyName: "artboard", first: true, predicate: ["artboard"], descendants: true, static: true }, { propertyName: "marginContainer", first: true, predicate: ["marginContainer"], descendants: true, static: true }, { propertyName: "artboardContainer", first: true, predicate: ["artboardContainer"], descendants: true, static: true }, { propertyName: "sidebar", first: true, predicate: SidebarComponent, descendants: true, static: true }, { propertyName: "blockComponents", predicate: FsBlockComponent, descendants: true }, { propertyName: "margins", predicate: FsBlockEditorMarginDirective, descendants: true }], ngImport: i0__namespace, template: "<div class=\"editor-container\">\n <div\n #artboardContainer\n class=\"artboard-container\"\n (click)=\"artboardClick($event)\">\n <div\n #artboard\n class=\"artboard mat-elevation-z2\"\n [style.width]=\"config.width + config.unit\"\n [style.height]=\"config.height + config.unit\">\n <fs-block\n *ngFor=\"let block of blocks; trackBy\"\n [block]=\"block\"\n (changed)=\"blockChanged($event)\">\n </fs-block>\n <div class=\"margin margin-top\" *ngIf=\"config.marginTop\" [style.top]=\"config.marginTop + 'in'\"></div>\n <div class=\"margin margin-left\" *ngIf=\"config.marginLeft\" [style.left]=\"config.marginLeft + 'in'\"></div>\n <div class=\"margin margin-bottom\" *ngIf=\"config.marginBottom\" [style.bottom]=\"config.marginBottom + 'in'\"></div>\n <div class=\"margin margin-right\" *ngIf=\"config.marginRight\" [style.right]=\"config.marginRight + 'in'\"></div>\n <div\n #marginContainer\n class=\"margin-container\"\n [style.top]=\"config.marginTop + 'in'\"\n [style.right]=\"config.marginRight + 'in'\"\n [style.bottom]=\"config.marginBottom + 'in'\"\n [style.left]=\"config.marginLeft + 'in'\"></div>\n </div>\n </div>\n <sidebar\n [config]=\"config\"\n [blocks]=\"blocks\"\n [blockAdded]=\"blockAdded\">\n </sidebar>\n</div>\n", styles: [".editor-container{display:flex;flex-direction:row;position:relative}.editor-container .artboard-container{display:flex;flex-grow:1;justify-content:center;padding:25px;overflow:auto;min-width:0}.editor-container .artboard-container .artboard{position:relative}.editor-container .artboard-container .artboard .margin-container{position:absolute;z-index:-1}.editor-container .artboard-container .artboard .margin{position:absolute;border-color:#ff85bd5e;border-style:dashed;border-width:0px}.editor-container .artboard-container .artboard .margin.margin-top,.editor-container .artboard-container .artboard .margin.margin-bottom{width:100%;border-top-width:1px}.editor-container .artboard-container .artboard .margin.margin-left,.editor-container .artboard-container .artboard .margin.margin-right{height:100%;border-left-width:1px}\n"], components: [{ type: FsBlockComponent, selector: "fs-block", inputs: ["block", "html"], outputs: ["changed"] }, { type: SidebarComponent, selector: "sidebar", inputs: ["config", "blocks", "blockAdded"] }], directives: [{ type: i7__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
1460
+ ], 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 class=\"editor-container deselectable\">\n <div\n #artboardContainer\n class=\"artboard-container deselectable\"\n (mousedown)=\"artboardClick($event)\">\n <div #zoomPanContaner class=\"zoom-pan-container deselectable\">\n <fs-zoom-pan \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%}.editor-container .artboard-container{display:flex;flex-grow:1;min-width:0}.editor-container .zoom-pan-container{flex:1}\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 });
1383
1461
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockEditorComponent, decorators: [{
1384
1462
  type: i0.Component,
1385
1463
  args: [{
@@ -1391,33 +1469,23 @@
1391
1469
  BlockEditorService,
1392
1470
  ]
1393
1471
  }]
1394
- }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: BlockEditorService }, { type: i0__namespace.ChangeDetectorRef }, { type: i0__namespace.IterableDiffers }]; }, propDecorators: { sidebarPanels: [{
1472
+ }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: BlockEditorService }]; }, propDecorators: { sidebarPanels: [{
1395
1473
  type: i0.ContentChildren,
1396
1474
  args: [FsBlockEditorSidebarPanelDirective]
1397
- }], blockComponents: [{
1398
- type: i0.ViewChildren,
1399
- args: [FsBlockComponent]
1400
- }], artboard: [{
1401
- type: i0.ViewChild,
1402
- args: ['artboard', { static: true }]
1403
- }], marginContainer: [{
1475
+ }], zoompan: [{
1404
1476
  type: i0.ViewChild,
1405
- args: ['marginContainer', { static: true }]
1406
- }], margins: [{
1407
- type: i0.ViewChildren,
1408
- args: [FsBlockEditorMarginDirective]
1477
+ args: [i2$1.FsZoomPanComponent, { static: true }]
1409
1478
  }], artboardContainer: [{
1410
1479
  type: i0.ViewChild,
1411
1480
  args: ['artboardContainer', { static: true }]
1412
1481
  }], sidebar: [{
1413
1482
  type: i0.ViewChild,
1414
1483
  args: [SidebarComponent, { static: true }]
1484
+ }], artboard: [{
1485
+ type: i0.ViewChild,
1486
+ args: [ArtboardComponent, { read: i0.ElementRef }]
1415
1487
  }], config: [{
1416
1488
  type: i0.Input
1417
- }], blockAdded: [{
1418
- type: i0.Output
1419
- }], blockRemoved: [{
1420
- type: i0.Output
1421
1489
  }] } });
1422
1490
 
1423
1491
  var FsBlockEditorModule = /** @class */ (function () {
@@ -1435,38 +1503,51 @@
1435
1503
  FsBlockEditorComponent,
1436
1504
  FsBlockEditorSidebarPanelDirective,
1437
1505
  FsBlockEditorMarginDirective,
1438
- SidebarComponent], imports: [i7.CommonModule,
1439
- i9.FormsModule,
1440
- i3.MatIconModule,
1441
- i2.MatButtonModule,
1442
- i8.MatInputModule,
1443
- i4.MatFormFieldModule,
1444
- i6.FsFileModule,
1445
- i5.FsColorPickerModule], exports: [FsBlockComponent,
1506
+ SidebarComponent,
1507
+ ArtboardComponent], imports: [i9.CommonModule,
1508
+ i12.FormsModule,
1509
+ i5.MatIconModule,
1510
+ i4.MatButtonModule,
1511
+ i11.MatInputModule,
1512
+ i6.MatFormFieldModule,
1513
+ i7.MatCheckboxModule,
1514
+ i10.MatTooltipModule,
1515
+ i3.FsFileModule,
1516
+ i8.FsColorPickerModule,
1517
+ menu.FsMenuModule,
1518
+ i2$1.FsZoomPanModule], exports: [FsBlockComponent,
1446
1519
  FsBlockEditorComponent,
1447
1520
  FsBlockEditorSidebarPanelDirective] });
1448
1521
  FsBlockEditorModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockEditorModule, imports: [[
1449
- i7.CommonModule,
1450
- i9.FormsModule,
1451
- i3.MatIconModule,
1452
- i2.MatButtonModule,
1453
- i8.MatInputModule,
1454
- i4.MatFormFieldModule,
1455
- i6.FsFileModule,
1456
- i5.FsColorPickerModule,
1522
+ i9.CommonModule,
1523
+ i12.FormsModule,
1524
+ i5.MatIconModule,
1525
+ i4.MatButtonModule,
1526
+ i11.MatInputModule,
1527
+ i6.MatFormFieldModule,
1528
+ i7.MatCheckboxModule,
1529
+ i10.MatTooltipModule,
1530
+ i3.FsFileModule,
1531
+ i8.FsColorPickerModule,
1532
+ menu.FsMenuModule,
1533
+ i2$1.FsZoomPanModule,
1457
1534
  ]] });
1458
1535
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockEditorModule, decorators: [{
1459
1536
  type: i0.NgModule,
1460
1537
  args: [{
1461
1538
  imports: [
1462
- i7.CommonModule,
1463
- i9.FormsModule,
1464
- i3.MatIconModule,
1465
- i2.MatButtonModule,
1466
- i8.MatInputModule,
1467
- i4.MatFormFieldModule,
1468
- i6.FsFileModule,
1469
- i5.FsColorPickerModule,
1539
+ i9.CommonModule,
1540
+ i12.FormsModule,
1541
+ i5.MatIconModule,
1542
+ i4.MatButtonModule,
1543
+ i11.MatInputModule,
1544
+ i6.MatFormFieldModule,
1545
+ i7.MatCheckboxModule,
1546
+ i10.MatTooltipModule,
1547
+ i3.FsFileModule,
1548
+ i8.FsColorPickerModule,
1549
+ menu.FsMenuModule,
1550
+ i2$1.FsZoomPanModule,
1470
1551
  ],
1471
1552
  exports: [
1472
1553
  FsBlockComponent,
@@ -1479,18 +1560,16 @@
1479
1560
  FsBlockEditorSidebarPanelDirective,
1480
1561
  FsBlockEditorMarginDirective,
1481
1562
  SidebarComponent,
1563
+ ArtboardComponent,
1482
1564
  ],
1483
1565
  }]
1484
1566
  }] });
1485
1567
 
1486
- /*
1487
- * Public API Surface of fs-menu
1488
- */
1489
-
1490
1568
  /**
1491
1569
  * Generated bundle index. Do not edit.
1492
1570
  */
1493
1571
 
1572
+ exports.BlockTypes = BlockTypes;
1494
1573
  exports.FsBlockComponent = FsBlockComponent;
1495
1574
  exports.FsBlockEditorComponent = FsBlockEditorComponent;
1496
1575
  exports.FsBlockEditorModule = FsBlockEditorModule;