@firestitch/block-editor 12.3.3 → 12.3.5
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.
- package/app/components/block/block.component.d.ts +18 -9
- package/app/interfaces/block.d.ts +4 -1
- package/app/services/block-editor.service.d.ts +4 -1
- package/bundles/firestitch-block-editor.umd.js +195 -73
- package/bundles/firestitch-block-editor.umd.js.map +1 -1
- package/esm2015/app/components/artboard/artboard.component.js +5 -5
- package/esm2015/app/components/block/block.component.js +139 -55
- package/esm2015/app/components/sidebar/sidebar.component.js +2 -2
- package/esm2015/app/interfaces/block.js +1 -1
- package/esm2015/app/services/block-editor.service.js +9 -3
- package/esm2015/app/services/blocks-store.service.js +1 -1
- package/fesm2015/firestitch-block-editor.js +150 -60
- package/fesm2015/firestitch-block-editor.js.map +1 -1
- package/package.json +1 -1
|
@@ -295,6 +295,7 @@ class BlockEditorService {
|
|
|
295
295
|
this._dialog = _dialog;
|
|
296
296
|
this._selectedBlocks$ = new BehaviorSubject([]);
|
|
297
297
|
this._blockComponents = new Map();
|
|
298
|
+
this._blockClippable$ = new BehaviorSubject(null);
|
|
298
299
|
this._destroy$ = new Subject();
|
|
299
300
|
this._blockInited$ = new Subject();
|
|
300
301
|
}
|
|
@@ -331,6 +332,12 @@ class BlockEditorService {
|
|
|
331
332
|
get blockChanged$() {
|
|
332
333
|
return this._store.blockChanged$;
|
|
333
334
|
}
|
|
335
|
+
get blockClippable$() {
|
|
336
|
+
return this._blockClippable$;
|
|
337
|
+
}
|
|
338
|
+
set blockClippable(value) {
|
|
339
|
+
this._blockClippable$.next(value);
|
|
340
|
+
}
|
|
334
341
|
get blockAdded$() {
|
|
335
342
|
return this._store.blockAdded$;
|
|
336
343
|
}
|
|
@@ -368,9 +375,8 @@ class BlockEditorService {
|
|
|
368
375
|
set selectedBlocks(blocks) {
|
|
369
376
|
this.blockComponents
|
|
370
377
|
.forEach((blockComponent) => {
|
|
371
|
-
blockComponent.editable = false;
|
|
372
378
|
if (blocks.indexOf(blockComponent.block) !== -1) {
|
|
373
|
-
blockComponent.
|
|
379
|
+
blockComponent.select();
|
|
374
380
|
}
|
|
375
381
|
else {
|
|
376
382
|
blockComponent.deselect();
|
|
@@ -477,10 +483,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
477
483
|
}], ctorParameters: function () { return [{ type: i1$1.HttpClient }]; } });
|
|
478
484
|
|
|
479
485
|
class FsBlockComponent {
|
|
480
|
-
constructor(_blockEditor, _elementRef, _cdRef) {
|
|
486
|
+
constructor(_blockEditor, _elementRef, _cdRef, _googleFontService) {
|
|
481
487
|
this._blockEditor = _blockEditor;
|
|
482
488
|
this._elementRef = _elementRef;
|
|
483
489
|
this._cdRef = _cdRef;
|
|
490
|
+
this._googleFontService = _googleFontService;
|
|
484
491
|
this.transformating = false;
|
|
485
492
|
this.BlockType = BlockType;
|
|
486
493
|
this._editable = false;
|
|
@@ -496,11 +503,76 @@ class FsBlockComponent {
|
|
|
496
503
|
get editable() {
|
|
497
504
|
return this._editable;
|
|
498
505
|
}
|
|
499
|
-
get
|
|
506
|
+
get styleTop() {
|
|
507
|
+
let top = this.block.top;
|
|
508
|
+
return `${top}${this.unit}`;
|
|
509
|
+
}
|
|
510
|
+
get styleLeft() {
|
|
511
|
+
let left = this.block.left;
|
|
512
|
+
return `${left}${this.unit}`;
|
|
513
|
+
}
|
|
514
|
+
get styleWidth() {
|
|
515
|
+
let width = this.block.width;
|
|
516
|
+
if (this.block.clipPath) {
|
|
517
|
+
width -= (this.block.width * this.block.clipPath.values[1] / 100) + (this.block.width * this.block.clipPath.values[3] / 100);
|
|
518
|
+
}
|
|
519
|
+
return `${width}${this.unit}`;
|
|
520
|
+
}
|
|
521
|
+
get styleHeight() {
|
|
522
|
+
let height = this.block.height;
|
|
523
|
+
if (this.block.clipPath) {
|
|
524
|
+
height -= (this.block.height * this.block.clipPath.values[0] / 100) + (this.block.height * this.block.clipPath.values[2] / 100);
|
|
525
|
+
}
|
|
526
|
+
return `${height}${this.unit}`;
|
|
527
|
+
}
|
|
528
|
+
get styleImageHeight() {
|
|
529
|
+
let height = this.block.height;
|
|
530
|
+
if (this.block.clipPath) {
|
|
531
|
+
const values = this.block.clipPath.values || {};
|
|
532
|
+
//height += (values[0]/100 * height) + (values[2]/100 * height);
|
|
533
|
+
}
|
|
534
|
+
return `${height}${this.unit}`;
|
|
535
|
+
}
|
|
536
|
+
get styleImageWidth() {
|
|
537
|
+
let width = this.block.width;
|
|
538
|
+
if (this.block.clipPath) {
|
|
539
|
+
const values = this.block.clipPath.values || {};
|
|
540
|
+
//width += (values[1]/100 * width) + (values[3]/100 * width);
|
|
541
|
+
}
|
|
542
|
+
return `${width}${this.unit}`;
|
|
543
|
+
}
|
|
544
|
+
get styleImageTop() {
|
|
545
|
+
let top = 0;
|
|
546
|
+
if (this.block.clipPath) {
|
|
547
|
+
const values = this.block.clipPath.values || {};
|
|
548
|
+
top = (values[0] / 100) * this.block.width * -1;
|
|
549
|
+
}
|
|
550
|
+
return `${top}${this.unit}`;
|
|
551
|
+
}
|
|
552
|
+
get styleImageLeft() {
|
|
553
|
+
let left = 0;
|
|
554
|
+
if (this.block.clipPath) {
|
|
555
|
+
const values = this.block.clipPath.values || {};
|
|
556
|
+
left = (values[3] / 100) * this.block.width * -1;
|
|
557
|
+
}
|
|
558
|
+
return `${left}${this.unit}`;
|
|
559
|
+
}
|
|
560
|
+
get styleClipPath() {
|
|
561
|
+
if (!this.block.clipPath) {
|
|
562
|
+
return null;
|
|
563
|
+
}
|
|
564
|
+
const values = this.block.clipPath.values || {};
|
|
565
|
+
const top = values[0] / 100 * this.block.height;
|
|
566
|
+
const right = (values[1]) / 100 * this.block.width;
|
|
567
|
+
const bottom = (values[2]) / 100 * this.block.height;
|
|
568
|
+
const left = values[3] / 100 * this.block.width;
|
|
569
|
+
const clipPath = `inset(${top}${this.unit} ${right}${this.unit} ${bottom}${this.unit} ${left}${this.unit})`;
|
|
570
|
+
return clipPath;
|
|
571
|
+
}
|
|
572
|
+
get styleBoxShadow() {
|
|
500
573
|
if (!this.block.shadowColor) {
|
|
501
574
|
return null;
|
|
502
575
|
}
|
|
503
|
-
//const shadowOpacity = ((Number(this.block.shadowOpacity || 100) / 100) * 255).toString(16).padStart(2, '0');
|
|
504
576
|
const shadow = `${this.block.shadowX}pt ${(this.block.shadowY || 0)}pt ${(this.block.shadowBlur || 0)}pt ${(this.block.shadowSpread || 0)}pt ${this.block.shadowColor}`;
|
|
505
577
|
return shadow;
|
|
506
578
|
}
|
|
@@ -513,8 +585,19 @@ class FsBlockComponent {
|
|
|
513
585
|
this.deselectContent();
|
|
514
586
|
}
|
|
515
587
|
}
|
|
588
|
+
get isSelected() {
|
|
589
|
+
return this._blockEditor.selectedBlocks.includes(this.block);
|
|
590
|
+
}
|
|
591
|
+
get clippable() {
|
|
592
|
+
return !!this.moveable.clippable;
|
|
593
|
+
}
|
|
516
594
|
set clippable(value) {
|
|
517
595
|
this.moveable.clippable = value;
|
|
596
|
+
if (this.isSelected) {
|
|
597
|
+
this.moveable.resizable = !value;
|
|
598
|
+
this.moveable.rotatable = !value;
|
|
599
|
+
this.moveable.scalable = !value;
|
|
600
|
+
}
|
|
518
601
|
}
|
|
519
602
|
get transformable() {
|
|
520
603
|
return this._transformable;
|
|
@@ -522,26 +605,8 @@ class FsBlockComponent {
|
|
|
522
605
|
set transformable(value) {
|
|
523
606
|
this._transformable = value;
|
|
524
607
|
this.moveable.resizable = value;
|
|
525
|
-
this.moveable.roundable = value;
|
|
526
608
|
this.moveable.rotatable = value;
|
|
527
|
-
|
|
528
|
-
set width(value) {
|
|
529
|
-
this.element.nativeElement.style.width = `${parseFloat(value)}${this.unit}`;
|
|
530
|
-
this.moveable.updateRect();
|
|
531
|
-
}
|
|
532
|
-
set height(value) {
|
|
533
|
-
this.element.nativeElement.style.height = `${parseFloat(value)}${this.unit}`;
|
|
534
|
-
this.moveable.updateRect();
|
|
535
|
-
}
|
|
536
|
-
set top(value) {
|
|
537
|
-
this.block.top = parseFloat(value);
|
|
538
|
-
this.element.nativeElement.style.top = `${this.block.top}${this.unit}`;
|
|
539
|
-
this.moveable.updateRect();
|
|
540
|
-
}
|
|
541
|
-
set left(value) {
|
|
542
|
-
this.block.left = parseFloat(value);
|
|
543
|
-
this.element.nativeElement.style.left = `${this.block.left}${this.unit}`;
|
|
544
|
-
this.moveable.updateRect();
|
|
609
|
+
this.moveable.scalable = value;
|
|
545
610
|
}
|
|
546
611
|
set rotate(value) {
|
|
547
612
|
this.moveable.request('rotatable', { rotate: parseFloat(value) }, true);
|
|
@@ -558,18 +623,19 @@ class FsBlockComponent {
|
|
|
558
623
|
}
|
|
559
624
|
ngOnInit() {
|
|
560
625
|
this.unit = this._blockEditor.config.unit;
|
|
561
|
-
this.content = this.block.content;
|
|
562
626
|
this.block.shadowOpacity = this.block.shadowOpacity || 100;
|
|
627
|
+
this._initFonts();
|
|
628
|
+
this._blockEditor.blockClippable$
|
|
629
|
+
.pipe(filter(() => this.isSelected), takeUntil(this._destroy$))
|
|
630
|
+
.subscribe((clippable) => {
|
|
631
|
+
this.clippable = clippable;
|
|
632
|
+
this._cdRef.markForCheck();
|
|
633
|
+
});
|
|
563
634
|
this._blockEditor.blockChanged$
|
|
564
635
|
.pipe(filter((block) => block === this.block), takeUntil(this._destroy$))
|
|
565
636
|
.subscribe((block) => {
|
|
566
637
|
this.keepRatio = block.keepRatio;
|
|
567
|
-
this.width = block.width;
|
|
568
|
-
this.height = block.height;
|
|
569
|
-
this.top = block.top;
|
|
570
|
-
this.left = block.left;
|
|
571
638
|
this.rotate = this.block.rotate;
|
|
572
|
-
this.clippable = this.block.clippable;
|
|
573
639
|
this._cdRef.markForCheck();
|
|
574
640
|
});
|
|
575
641
|
}
|
|
@@ -578,10 +644,6 @@ class FsBlockComponent {
|
|
|
578
644
|
this._initEvents();
|
|
579
645
|
this._initMoveable();
|
|
580
646
|
this._setTransform();
|
|
581
|
-
this.width = this.block.width;
|
|
582
|
-
this.height = this.block.height;
|
|
583
|
-
this.top = this.block.top;
|
|
584
|
-
this.left = this.block.left;
|
|
585
647
|
this.rotate = this.block.rotate;
|
|
586
648
|
this._blockEditor.initBlock(this.block, this);
|
|
587
649
|
this._blockEditor.blockInited$
|
|
@@ -597,7 +659,12 @@ class FsBlockComponent {
|
|
|
597
659
|
round(value, decimals) {
|
|
598
660
|
return parseFloat(value.toFixed(decimals));
|
|
599
661
|
}
|
|
662
|
+
select() {
|
|
663
|
+
this.transformable = true;
|
|
664
|
+
}
|
|
600
665
|
deselect() {
|
|
666
|
+
this.editable = false;
|
|
667
|
+
this.clippable = false;
|
|
601
668
|
this.transformable = false;
|
|
602
669
|
this.disableContentEdit();
|
|
603
670
|
}
|
|
@@ -628,9 +695,6 @@ class FsBlockComponent {
|
|
|
628
695
|
}
|
|
629
696
|
_setTransform(transforms = []) {
|
|
630
697
|
transforms = transforms !== null && transforms !== void 0 ? transforms : [];
|
|
631
|
-
if (this.block.rotate) {
|
|
632
|
-
transforms.push(`rotate(${this.block.rotate}deg)`);
|
|
633
|
-
}
|
|
634
698
|
this.el.style.transform = transforms.join(' ');
|
|
635
699
|
}
|
|
636
700
|
_triggerChanged() {
|
|
@@ -651,6 +715,8 @@ class FsBlockComponent {
|
|
|
651
715
|
rotatable: false,
|
|
652
716
|
warpable: false,
|
|
653
717
|
origin: false,
|
|
718
|
+
clipRelative: true,
|
|
719
|
+
clipArea: true,
|
|
654
720
|
keepRatio: this.block.keepRatio,
|
|
655
721
|
snappable: true,
|
|
656
722
|
snapDirections: { left: true, top: true, right: true, bottom: true, center: true, middle: true },
|
|
@@ -665,9 +731,24 @@ class FsBlockComponent {
|
|
|
665
731
|
this._updateElementGuidelines();
|
|
666
732
|
this.moveable
|
|
667
733
|
.on('clip', (e) => {
|
|
668
|
-
this.
|
|
734
|
+
this.moveable.keepRatio = false;
|
|
669
735
|
e.target.style.clipPath = e.clipStyle;
|
|
736
|
+
this.block.clipPath = {
|
|
737
|
+
type: 'inset',
|
|
738
|
+
values: e.clipStyles
|
|
739
|
+
.map((value) => {
|
|
740
|
+
const number = Number(value.replace('%', ''));
|
|
741
|
+
return number > 0 ? number : 0;
|
|
742
|
+
}),
|
|
743
|
+
};
|
|
744
|
+
})
|
|
745
|
+
.on('clipEnd', (e) => {
|
|
746
|
+
this.moveable.keepRatio = true;
|
|
747
|
+
e.target.style.clipPath = null;
|
|
670
748
|
this._triggerChanged();
|
|
749
|
+
setTimeout(() => {
|
|
750
|
+
this.moveable.updateRect();
|
|
751
|
+
}, 100);
|
|
671
752
|
})
|
|
672
753
|
.on('dragStart', () => {
|
|
673
754
|
this.disableContentEdit();
|
|
@@ -679,10 +760,10 @@ class FsBlockComponent {
|
|
|
679
760
|
target.style.top = this.pxToIn(top) + this.unit;
|
|
680
761
|
this.block.top = this.pxToIn(top);
|
|
681
762
|
this.block.left = this.pxToIn(left);
|
|
682
|
-
this._triggerChanged();
|
|
683
763
|
})
|
|
684
764
|
.on('dragEnd', () => {
|
|
685
765
|
this.transformating = false;
|
|
766
|
+
this._triggerChanged();
|
|
686
767
|
this._cdRef.markForCheck();
|
|
687
768
|
})
|
|
688
769
|
.on('resizeStart', () => {
|
|
@@ -710,19 +791,21 @@ class FsBlockComponent {
|
|
|
710
791
|
transform[0] = dist[0] * -1;
|
|
711
792
|
}
|
|
712
793
|
this._setTransform([`translate(${transform[0]}px, ${transform[1]}px)`]);
|
|
713
|
-
this._triggerChanged();
|
|
714
794
|
})
|
|
715
795
|
.on('resizeEnd', ({ target }) => {
|
|
716
796
|
const matrix = new WebKitCSSMatrix(target.style.transform);
|
|
717
797
|
this.block.top = parseFloat(target.style.top) + this.pxToIn(matrix.m42);
|
|
718
798
|
this.block.left = parseFloat(target.style.left) + this.pxToIn(matrix.m41);
|
|
719
|
-
target.style.top = this.block.top + this.unit;
|
|
720
|
-
target.style.left = this.block.left + this.unit;
|
|
721
799
|
this._setTransform();
|
|
722
800
|
this._triggerChanged();
|
|
723
801
|
this.zoompan.enable();
|
|
724
802
|
this.transformating = false;
|
|
725
803
|
this._cdRef.markForCheck();
|
|
804
|
+
target.style.top = `${this.block.top}in`;
|
|
805
|
+
target.style.left = `${this.block.left}in`;
|
|
806
|
+
target.style.width = `${this.block.width}in`;
|
|
807
|
+
target.style.height = `${this.block.height}in`;
|
|
808
|
+
this.moveable.updateRect();
|
|
726
809
|
})
|
|
727
810
|
.on('rotateStart', ({ inputEvent }) => {
|
|
728
811
|
if (inputEvent) {
|
|
@@ -736,7 +819,6 @@ class FsBlockComponent {
|
|
|
736
819
|
this.el.style.transform = transform;
|
|
737
820
|
this.block.rotate = rotation % 360;
|
|
738
821
|
if (inputEvent) {
|
|
739
|
-
this._triggerChanged();
|
|
740
822
|
this.zoompan.enable();
|
|
741
823
|
}
|
|
742
824
|
})
|
|
@@ -744,27 +826,30 @@ class FsBlockComponent {
|
|
|
744
826
|
if (inputEvent) {
|
|
745
827
|
this.transformating = false;
|
|
746
828
|
this._cdRef.markForCheck();
|
|
829
|
+
this._triggerChanged();
|
|
747
830
|
}
|
|
748
831
|
});
|
|
749
832
|
}
|
|
750
833
|
_initEvents() {
|
|
751
834
|
fromEvent(this.contentEditable.nativeElement, 'input')
|
|
752
835
|
.pipe(takeUntil(this._destroy$)).subscribe((event) => {
|
|
753
|
-
this.block.content = event.target.
|
|
836
|
+
this.block.content = event.target.innerText;
|
|
754
837
|
this._triggerChanged();
|
|
755
838
|
});
|
|
756
839
|
fromEvent(this.el, 'mousedown')
|
|
757
840
|
.pipe(takeUntil(this._destroy$)).subscribe((event) => {
|
|
758
841
|
this.zoompan.disable();
|
|
759
|
-
if (this.
|
|
760
|
-
if (this.
|
|
761
|
-
event.
|
|
762
|
-
|
|
763
|
-
|
|
842
|
+
if (!this.moveable.clippable) {
|
|
843
|
+
if (this.editable) {
|
|
844
|
+
if (this.contentElement.nativeElement.isSameNode(event.target)) {
|
|
845
|
+
event.preventDefault();
|
|
846
|
+
event.stopImmediatePropagation();
|
|
847
|
+
event.stopPropagation();
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
else {
|
|
851
|
+
this._blockEditor.selectedBlock = this.block;
|
|
764
852
|
}
|
|
765
|
-
}
|
|
766
|
-
else {
|
|
767
|
-
this._blockEditor.selectedBlock = this.block;
|
|
768
853
|
}
|
|
769
854
|
});
|
|
770
855
|
fromEvent(this.el, 'mouseup')
|
|
@@ -786,9 +871,14 @@ class FsBlockComponent {
|
|
|
786
871
|
}
|
|
787
872
|
});
|
|
788
873
|
}
|
|
874
|
+
_initFonts() {
|
|
875
|
+
if (this.block.fontFamily) {
|
|
876
|
+
this._googleFontService.loadFont({ family: this.block.fontFamily });
|
|
877
|
+
}
|
|
878
|
+
}
|
|
789
879
|
}
|
|
790
|
-
FsBlockComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsBlockComponent, deps: [{ token: BlockEditorService }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
791
|
-
FsBlockComponent.ɵcmp = i0.ɵɵ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, template: "<div\n #element\n [class]=\"'block ' + 'block-' + block.type\"\n [ngClass]=\"{ \n editable: editable, \n readonly: block.readonly,\n required: block.required\n }\"\n [style.zIndex]=\"block.index\">\n <div\n #contentElement\n class=\"content\"\n [style.borderColor]=\"block.borderColor\"\n [style.borderWidth]=\"block.borderWidth ? block.borderWidth + 'pt' : ''\"\n [style.borderStyle]=\"block.borderColor ? 'solid' : 'dashed'\"\n [style.textAlign]=\"block.horizontalAlign\"\n [style.fontStyle]=\"block.italic ? 'italic' : ''\"\n [style.fontFamily]=\"block.fontFamily || ''\"\n [style.fontSize]=\"block.fontSize ? block.fontSize + 'pt' : ''\"\n [style.lineHeight]=\"block.lineHeight ? block.lineHeight + 'pt' : ''\"\n [style.color]=\"block.fontColor\"\n [style.fontWeight]=\"block.bold ? 'bold' : ''\"\n [style.textDecoration]=\"block.underline ? 'underline' : ''\"\n [style.paddingTop]=\"block.paddingTop ? block.paddingTop + 'pt' : ''\"\n [style.paddingBottom]=\"block.paddingBottom ? block.paddingBottom + 'pt' : ''\"\n [style.paddingLeft]=\"block.paddingLeft ? block.paddingLeft + 'pt' : ''\"\n [style.paddingRight]=\"block.paddingRight ? block.paddingRight + 'pt' : ''\"\n [style.
|
|
880
|
+
FsBlockComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsBlockComponent, deps: [{ token: BlockEditorService }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: GoogleFontService }], target: i0.ɵɵFactoryTarget.Component });
|
|
881
|
+
FsBlockComponent.ɵcmp = i0.ɵɵ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, template: "<div\n #element\n [class]=\"'block ' + 'block-' + block.type\"\n [style.top]=\"styleTop\"\n [style.left]=\"styleLeft\"\n [style.width]=\"styleWidth\"\n [style.height]=\"styleHeight\"\n [ngClass]=\"{ \n editable: editable, \n readonly: block.readonly,\n required: block.required\n }\"\n [style.zIndex]=\"block.index\">\n <div\n #contentElement\n class=\"content\"\n [style.borderColor]=\"block.borderColor\"\n [style.borderWidth]=\"block.borderWidth ? block.borderWidth + 'pt' : ''\"\n [style.borderStyle]=\"block.borderColor ? 'solid' : 'dashed'\"\n [style.textAlign]=\"block.horizontalAlign\"\n [style.fontStyle]=\"block.italic ? 'italic' : ''\"\n [style.fontFamily]=\"block.fontFamily || ''\"\n [style.fontSize]=\"block.fontSize ? block.fontSize + 'pt' : ''\"\n [style.lineHeight]=\"block.lineHeight ? block.lineHeight + 'pt' : ''\"\n [style.color]=\"block.fontColor\"\n [style.fontWeight]=\"block.bold ? 'bold' : ''\"\n [style.textDecoration]=\"block.underline ? 'underline' : ''\"\n [style.paddingTop]=\"block.paddingTop ? block.paddingTop + 'pt' : ''\"\n [style.paddingBottom]=\"block.paddingBottom ? block.paddingBottom + 'pt' : ''\"\n [style.paddingLeft]=\"block.paddingLeft ? block.paddingLeft + 'pt' : ''\"\n [style.paddingRight]=\"block.paddingRight ? block.paddingRight + 'pt' : ''\"\n [style.backgroundColor]=\"block.backgroundColor\"\n [style.borderBottomLeftRadius]=\"block.shapeRadius && block.shapeBottomLeft === 'round' ? block.shapeRadius + 'pt' : ''\"\n [style.borderBottomRightRadius]=\"block.shapeRadius && block.shapeBottomRight === 'round' ? block.shapeRadius + 'pt' : ''\"\n [style.borderTopRightRadius]=\"block.shapeRadius && block.shapeTopRight === 'round' ? block.shapeRadius + 'pt' : ''\"\n [style.borderTopLeftRadius]=\"block.shapeRadius && block.shapeTopLeft === 'round' ? block.shapeRadius + 'pt' : ''\"\n [style.boxShadow]=\"styleBoxShadow\"\n [ngClass]=\"{\n 'editable': editable,\n 'vertical-align-center': block.verticalAlign === 'center',\n 'vertical-align-bottom': block.verticalAlign === 'bottom'\n }\">\n <ng-container [ngSwitch]=\"block.type\">\n <ng-container *ngSwitchCase=\"BlockType.Pdf\">\n <img [src]=\"block.imageUrl\">\n </ng-container>\n <img \n *ngIf=\"block.imageUrl\" \n [style.clipPath]=\"styleClipPath\" \n [style.height]=\"styleImageHeight\" \n [style.width]=\"styleImageWidth\" \n [style.top]=\"styleImageTop\" \n [style.left]=\"styleImageLeft\" \n [src]=\"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]=\"block.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;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.block-radiobutton{border-radius:50%}.block.required{background-color:#f7adaa}.block .content-editable{outline:none;position:relative}.block.editable .content-editable{cursor:text}.block .content{flex-direction:column;height:100%;display:flex;border:0px solid transparent;position:relative;box-sizing:border-box;overflow:hidden}.block .content fs-html-editor{width:100%}.block .content.vertical-align-center{justify-content:center}.block .content.vertical-align-bottom{justify-content:flex-end}.block .content img{width:100%;height:100%;position:absolute}:host ::ng-deep fs-html-editor .bottom-line,:host ::ng-deep fs-html-editor .fr-toolbar{display:none!important}:host ::ng-deep fs-html-editor .fr-wrapper{background:none!important;border:none!important}:host ::ng-deep .moveable-line:not(.moveable-rotation-line):not(.moveable-guideline){background:transparent!important}\n"], directives: [{ type: i13.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i13.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i13.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i13.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
792
882
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsBlockComponent, decorators: [{
|
|
793
883
|
type: Component,
|
|
794
884
|
args: [{
|
|
@@ -797,7 +887,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
797
887
|
styleUrls: ['block.component.scss'],
|
|
798
888
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
799
889
|
}]
|
|
800
|
-
}], ctorParameters: function () { return [{ type: BlockEditorService }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { element: [{
|
|
890
|
+
}], ctorParameters: function () { return [{ type: BlockEditorService }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: GoogleFontService }]; }, propDecorators: { element: [{
|
|
801
891
|
type: ViewChild,
|
|
802
892
|
args: ['element', { static: true }]
|
|
803
893
|
}], contentElement: [{
|
|
@@ -979,7 +1069,7 @@ class SidebarComponent {
|
|
|
979
1069
|
}
|
|
980
1070
|
imageClip() {
|
|
981
1071
|
this.clippable = !this.clippable;
|
|
982
|
-
this._blockEditor.
|
|
1072
|
+
this._blockEditor.blockClippable = true;
|
|
983
1073
|
}
|
|
984
1074
|
blockChangeProperty(value, name) {
|
|
985
1075
|
this._blockEditor.selectedBlockComponentChangeProperty(value, name);
|
|
@@ -1146,16 +1236,16 @@ class ArtboardComponent {
|
|
|
1146
1236
|
.forEach((blockComponent) => {
|
|
1147
1237
|
switch (event.key) {
|
|
1148
1238
|
case 'ArrowUp':
|
|
1149
|
-
blockComponent.top = blockComponent.block.top - inchPixel;
|
|
1239
|
+
blockComponent.block.top = blockComponent.block.top - inchPixel;
|
|
1150
1240
|
break;
|
|
1151
1241
|
case 'ArrowDown':
|
|
1152
|
-
blockComponent.top = blockComponent.block.top + inchPixel;
|
|
1242
|
+
blockComponent.block.top = blockComponent.block.top + inchPixel;
|
|
1153
1243
|
break;
|
|
1154
1244
|
case 'ArrowLeft':
|
|
1155
|
-
blockComponent.left = blockComponent.block.left - inchPixel;
|
|
1245
|
+
blockComponent.block.left = blockComponent.block.left - inchPixel;
|
|
1156
1246
|
break;
|
|
1157
1247
|
case 'ArrowRight':
|
|
1158
|
-
blockComponent.left = blockComponent.block.left + inchPixel;
|
|
1248
|
+
blockComponent.block.left = blockComponent.block.left + inchPixel;
|
|
1159
1249
|
break;
|
|
1160
1250
|
}
|
|
1161
1251
|
this._blockEditor.blockChange(blockComponent.block);
|