@firestitch/block-editor 12.3.3 → 12.3.4
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 +14 -6
- 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 +184 -65
- 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 +127 -46
- 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 +139 -52
- 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();
|
|
@@ -496,11 +502,76 @@ class FsBlockComponent {
|
|
|
496
502
|
get editable() {
|
|
497
503
|
return this._editable;
|
|
498
504
|
}
|
|
499
|
-
get
|
|
505
|
+
get styleTop() {
|
|
506
|
+
let top = this.block.top;
|
|
507
|
+
return `${top}${this.unit}`;
|
|
508
|
+
}
|
|
509
|
+
get styleLeft() {
|
|
510
|
+
let left = this.block.left;
|
|
511
|
+
return `${left}${this.unit}`;
|
|
512
|
+
}
|
|
513
|
+
get styleWidth() {
|
|
514
|
+
let width = this.block.width;
|
|
515
|
+
if (this.block.clipPath) {
|
|
516
|
+
width -= (this.block.width * this.block.clipPath.values[1] / 100) + (this.block.width * this.block.clipPath.values[3] / 100);
|
|
517
|
+
}
|
|
518
|
+
return `${width}${this.unit}`;
|
|
519
|
+
}
|
|
520
|
+
get styleHeight() {
|
|
521
|
+
let height = this.block.height;
|
|
522
|
+
if (this.block.clipPath) {
|
|
523
|
+
height -= (this.block.height * this.block.clipPath.values[0] / 100) + (this.block.height * this.block.clipPath.values[2] / 100);
|
|
524
|
+
}
|
|
525
|
+
return `${height}${this.unit}`;
|
|
526
|
+
}
|
|
527
|
+
get styleImageHeight() {
|
|
528
|
+
let height = this.block.height;
|
|
529
|
+
if (this.block.clipPath) {
|
|
530
|
+
const values = this.block.clipPath.values || {};
|
|
531
|
+
//height += (values[0]/100 * height) + (values[2]/100 * height);
|
|
532
|
+
}
|
|
533
|
+
return `${height}${this.unit}`;
|
|
534
|
+
}
|
|
535
|
+
get styleImageWidth() {
|
|
536
|
+
let width = this.block.width;
|
|
537
|
+
if (this.block.clipPath) {
|
|
538
|
+
const values = this.block.clipPath.values || {};
|
|
539
|
+
//width += (values[1]/100 * width) + (values[3]/100 * width);
|
|
540
|
+
}
|
|
541
|
+
return `${width}${this.unit}`;
|
|
542
|
+
}
|
|
543
|
+
get styleImageTop() {
|
|
544
|
+
let top = 0;
|
|
545
|
+
if (this.block.clipPath) {
|
|
546
|
+
const values = this.block.clipPath.values || {};
|
|
547
|
+
top = (values[0] / 100) * this.block.width * -1;
|
|
548
|
+
}
|
|
549
|
+
return `${top}${this.unit}`;
|
|
550
|
+
}
|
|
551
|
+
get styleImageLeft() {
|
|
552
|
+
let left = 0;
|
|
553
|
+
if (this.block.clipPath) {
|
|
554
|
+
const values = this.block.clipPath.values || {};
|
|
555
|
+
left = (values[3] / 100) * this.block.width * -1;
|
|
556
|
+
}
|
|
557
|
+
return `${left}${this.unit}`;
|
|
558
|
+
}
|
|
559
|
+
get styleClipPath() {
|
|
560
|
+
if (!this.block.clipPath) {
|
|
561
|
+
return null;
|
|
562
|
+
}
|
|
563
|
+
const values = this.block.clipPath.values || {};
|
|
564
|
+
const top = values[0] / 100 * this.block.height;
|
|
565
|
+
const right = (values[1]) / 100 * this.block.width;
|
|
566
|
+
const bottom = (values[2]) / 100 * this.block.height;
|
|
567
|
+
const left = values[3] / 100 * this.block.width;
|
|
568
|
+
const clipPath = `inset(${top}${this.unit} ${right}${this.unit} ${bottom}${this.unit} ${left}${this.unit})`;
|
|
569
|
+
return clipPath;
|
|
570
|
+
}
|
|
571
|
+
get styleBoxShadow() {
|
|
500
572
|
if (!this.block.shadowColor) {
|
|
501
573
|
return null;
|
|
502
574
|
}
|
|
503
|
-
//const shadowOpacity = ((Number(this.block.shadowOpacity || 100) / 100) * 255).toString(16).padStart(2, '0');
|
|
504
575
|
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
576
|
return shadow;
|
|
506
577
|
}
|
|
@@ -513,8 +584,19 @@ class FsBlockComponent {
|
|
|
513
584
|
this.deselectContent();
|
|
514
585
|
}
|
|
515
586
|
}
|
|
587
|
+
get isSelected() {
|
|
588
|
+
return this._blockEditor.selectedBlocks.includes(this.block);
|
|
589
|
+
}
|
|
590
|
+
get clippable() {
|
|
591
|
+
return !!this.moveable.clippable;
|
|
592
|
+
}
|
|
516
593
|
set clippable(value) {
|
|
517
594
|
this.moveable.clippable = value;
|
|
595
|
+
if (this.isSelected) {
|
|
596
|
+
this.moveable.resizable = !value;
|
|
597
|
+
this.moveable.rotatable = !value;
|
|
598
|
+
this.moveable.scalable = !value;
|
|
599
|
+
}
|
|
518
600
|
}
|
|
519
601
|
get transformable() {
|
|
520
602
|
return this._transformable;
|
|
@@ -522,26 +604,8 @@ class FsBlockComponent {
|
|
|
522
604
|
set transformable(value) {
|
|
523
605
|
this._transformable = value;
|
|
524
606
|
this.moveable.resizable = value;
|
|
525
|
-
this.moveable.roundable = value;
|
|
526
607
|
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();
|
|
608
|
+
this.moveable.scalable = value;
|
|
545
609
|
}
|
|
546
610
|
set rotate(value) {
|
|
547
611
|
this.moveable.request('rotatable', { rotate: parseFloat(value) }, true);
|
|
@@ -560,16 +624,17 @@ class FsBlockComponent {
|
|
|
560
624
|
this.unit = this._blockEditor.config.unit;
|
|
561
625
|
this.content = this.block.content;
|
|
562
626
|
this.block.shadowOpacity = this.block.shadowOpacity || 100;
|
|
627
|
+
this._blockEditor.blockClippable$
|
|
628
|
+
.pipe(filter(() => this.isSelected), takeUntil(this._destroy$))
|
|
629
|
+
.subscribe((clippable) => {
|
|
630
|
+
this.clippable = clippable;
|
|
631
|
+
this._cdRef.markForCheck();
|
|
632
|
+
});
|
|
563
633
|
this._blockEditor.blockChanged$
|
|
564
634
|
.pipe(filter((block) => block === this.block), takeUntil(this._destroy$))
|
|
565
635
|
.subscribe((block) => {
|
|
566
636
|
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
637
|
this.rotate = this.block.rotate;
|
|
572
|
-
this.clippable = this.block.clippable;
|
|
573
638
|
this._cdRef.markForCheck();
|
|
574
639
|
});
|
|
575
640
|
}
|
|
@@ -578,10 +643,6 @@ class FsBlockComponent {
|
|
|
578
643
|
this._initEvents();
|
|
579
644
|
this._initMoveable();
|
|
580
645
|
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
646
|
this.rotate = this.block.rotate;
|
|
586
647
|
this._blockEditor.initBlock(this.block, this);
|
|
587
648
|
this._blockEditor.blockInited$
|
|
@@ -597,7 +658,12 @@ class FsBlockComponent {
|
|
|
597
658
|
round(value, decimals) {
|
|
598
659
|
return parseFloat(value.toFixed(decimals));
|
|
599
660
|
}
|
|
661
|
+
select() {
|
|
662
|
+
this.transformable = true;
|
|
663
|
+
}
|
|
600
664
|
deselect() {
|
|
665
|
+
this.editable = false;
|
|
666
|
+
this.clippable = false;
|
|
601
667
|
this.transformable = false;
|
|
602
668
|
this.disableContentEdit();
|
|
603
669
|
}
|
|
@@ -651,6 +717,8 @@ class FsBlockComponent {
|
|
|
651
717
|
rotatable: false,
|
|
652
718
|
warpable: false,
|
|
653
719
|
origin: false,
|
|
720
|
+
clipRelative: true,
|
|
721
|
+
clipArea: true,
|
|
654
722
|
keepRatio: this.block.keepRatio,
|
|
655
723
|
snappable: true,
|
|
656
724
|
snapDirections: { left: true, top: true, right: true, bottom: true, center: true, middle: true },
|
|
@@ -665,9 +733,24 @@ class FsBlockComponent {
|
|
|
665
733
|
this._updateElementGuidelines();
|
|
666
734
|
this.moveable
|
|
667
735
|
.on('clip', (e) => {
|
|
668
|
-
this.
|
|
736
|
+
this.moveable.keepRatio = false;
|
|
669
737
|
e.target.style.clipPath = e.clipStyle;
|
|
738
|
+
this.block.clipPath = {
|
|
739
|
+
type: 'inset',
|
|
740
|
+
values: e.clipStyles
|
|
741
|
+
.map((value) => {
|
|
742
|
+
const number = Number(value.replace('%', ''));
|
|
743
|
+
return number > 0 ? number : 0;
|
|
744
|
+
}),
|
|
745
|
+
};
|
|
746
|
+
})
|
|
747
|
+
.on('clipEnd', (e) => {
|
|
748
|
+
this.moveable.keepRatio = true;
|
|
749
|
+
e.target.style.clipPath = null;
|
|
670
750
|
this._triggerChanged();
|
|
751
|
+
setTimeout(() => {
|
|
752
|
+
this.moveable.updateRect();
|
|
753
|
+
}, 100);
|
|
671
754
|
})
|
|
672
755
|
.on('dragStart', () => {
|
|
673
756
|
this.disableContentEdit();
|
|
@@ -679,10 +762,10 @@ class FsBlockComponent {
|
|
|
679
762
|
target.style.top = this.pxToIn(top) + this.unit;
|
|
680
763
|
this.block.top = this.pxToIn(top);
|
|
681
764
|
this.block.left = this.pxToIn(left);
|
|
682
|
-
this._triggerChanged();
|
|
683
765
|
})
|
|
684
766
|
.on('dragEnd', () => {
|
|
685
767
|
this.transformating = false;
|
|
768
|
+
this._triggerChanged();
|
|
686
769
|
this._cdRef.markForCheck();
|
|
687
770
|
})
|
|
688
771
|
.on('resizeStart', () => {
|
|
@@ -710,19 +793,21 @@ class FsBlockComponent {
|
|
|
710
793
|
transform[0] = dist[0] * -1;
|
|
711
794
|
}
|
|
712
795
|
this._setTransform([`translate(${transform[0]}px, ${transform[1]}px)`]);
|
|
713
|
-
this._triggerChanged();
|
|
714
796
|
})
|
|
715
797
|
.on('resizeEnd', ({ target }) => {
|
|
716
798
|
const matrix = new WebKitCSSMatrix(target.style.transform);
|
|
717
799
|
this.block.top = parseFloat(target.style.top) + this.pxToIn(matrix.m42);
|
|
718
800
|
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
801
|
this._setTransform();
|
|
722
802
|
this._triggerChanged();
|
|
723
803
|
this.zoompan.enable();
|
|
724
804
|
this.transformating = false;
|
|
725
805
|
this._cdRef.markForCheck();
|
|
806
|
+
target.style.top = `${this.block.top}in`;
|
|
807
|
+
target.style.left = `${this.block.left}in`;
|
|
808
|
+
target.style.width = `${this.block.width}in`;
|
|
809
|
+
target.style.height = `${this.block.height}in`;
|
|
810
|
+
this.moveable.updateRect();
|
|
726
811
|
})
|
|
727
812
|
.on('rotateStart', ({ inputEvent }) => {
|
|
728
813
|
if (inputEvent) {
|
|
@@ -736,7 +821,6 @@ class FsBlockComponent {
|
|
|
736
821
|
this.el.style.transform = transform;
|
|
737
822
|
this.block.rotate = rotation % 360;
|
|
738
823
|
if (inputEvent) {
|
|
739
|
-
this._triggerChanged();
|
|
740
824
|
this.zoompan.enable();
|
|
741
825
|
}
|
|
742
826
|
})
|
|
@@ -744,6 +828,7 @@ class FsBlockComponent {
|
|
|
744
828
|
if (inputEvent) {
|
|
745
829
|
this.transformating = false;
|
|
746
830
|
this._cdRef.markForCheck();
|
|
831
|
+
this._triggerChanged();
|
|
747
832
|
}
|
|
748
833
|
});
|
|
749
834
|
}
|
|
@@ -756,15 +841,17 @@ class FsBlockComponent {
|
|
|
756
841
|
fromEvent(this.el, 'mousedown')
|
|
757
842
|
.pipe(takeUntil(this._destroy$)).subscribe((event) => {
|
|
758
843
|
this.zoompan.disable();
|
|
759
|
-
if (this.
|
|
760
|
-
if (this.
|
|
761
|
-
event.
|
|
762
|
-
|
|
763
|
-
|
|
844
|
+
if (!this.moveable.clippable) {
|
|
845
|
+
if (this.editable) {
|
|
846
|
+
if (this.contentElement.nativeElement.isSameNode(event.target)) {
|
|
847
|
+
event.preventDefault();
|
|
848
|
+
event.stopImmediatePropagation();
|
|
849
|
+
event.stopPropagation();
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
else {
|
|
853
|
+
this._blockEditor.selectedBlock = this.block;
|
|
764
854
|
}
|
|
765
|
-
}
|
|
766
|
-
else {
|
|
767
|
-
this._blockEditor.selectedBlock = this.block;
|
|
768
855
|
}
|
|
769
856
|
});
|
|
770
857
|
fromEvent(this.el, 'mouseup')
|
|
@@ -788,7 +875,7 @@ class FsBlockComponent {
|
|
|
788
875
|
}
|
|
789
876
|
}
|
|
790
877
|
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.
|
|
878
|
+
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]=\"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
879
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsBlockComponent, decorators: [{
|
|
793
880
|
type: Component,
|
|
794
881
|
args: [{
|
|
@@ -979,7 +1066,7 @@ class SidebarComponent {
|
|
|
979
1066
|
}
|
|
980
1067
|
imageClip() {
|
|
981
1068
|
this.clippable = !this.clippable;
|
|
982
|
-
this._blockEditor.
|
|
1069
|
+
this._blockEditor.blockClippable = true;
|
|
983
1070
|
}
|
|
984
1071
|
blockChangeProperty(value, name) {
|
|
985
1072
|
this._blockEditor.selectedBlockComponentChangeProperty(value, name);
|
|
@@ -1146,16 +1233,16 @@ class ArtboardComponent {
|
|
|
1146
1233
|
.forEach((blockComponent) => {
|
|
1147
1234
|
switch (event.key) {
|
|
1148
1235
|
case 'ArrowUp':
|
|
1149
|
-
blockComponent.top = blockComponent.block.top - inchPixel;
|
|
1236
|
+
blockComponent.block.top = blockComponent.block.top - inchPixel;
|
|
1150
1237
|
break;
|
|
1151
1238
|
case 'ArrowDown':
|
|
1152
|
-
blockComponent.top = blockComponent.block.top + inchPixel;
|
|
1239
|
+
blockComponent.block.top = blockComponent.block.top + inchPixel;
|
|
1153
1240
|
break;
|
|
1154
1241
|
case 'ArrowLeft':
|
|
1155
|
-
blockComponent.left = blockComponent.block.left - inchPixel;
|
|
1242
|
+
blockComponent.block.left = blockComponent.block.left - inchPixel;
|
|
1156
1243
|
break;
|
|
1157
1244
|
case 'ArrowRight':
|
|
1158
|
-
blockComponent.left = blockComponent.block.left + inchPixel;
|
|
1245
|
+
blockComponent.block.left = blockComponent.block.left + inchPixel;
|
|
1159
1246
|
break;
|
|
1160
1247
|
}
|
|
1161
1248
|
this._blockEditor.blockChange(blockComponent.block);
|