@firestitch/block-editor 12.2.3 → 12.3.0
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/artboard/artboard.component.d.ts +3 -6
- package/app/components/block/block.component.d.ts +4 -2
- package/app/components/block-editor/block-editor.component.d.ts +1 -1
- package/app/components/font/font.component.d.ts +12 -0
- package/app/components/font/index.d.ts +1 -0
- package/app/components/index.d.ts +1 -0
- package/app/components/sidebar/sidebar.component.d.ts +12 -12
- package/app/fs-block-editor.module.d.ts +19 -17
- package/app/interfaces/block-editor-config.d.ts +1 -1
- package/app/interfaces/block.d.ts +11 -4
- package/app/interfaces/index.d.ts +2 -0
- package/app/services/block-editor.service.d.ts +9 -7
- package/app/services/google-font.service.d.ts +15 -0
- package/app/services/index.d.ts +1 -0
- package/bundles/firestitch-block-editor.umd.js +255 -139
- package/bundles/firestitch-block-editor.umd.js.map +1 -1
- package/esm2015/app/components/artboard/artboard.component.js +9 -24
- package/esm2015/app/components/block/block.component.js +53 -21
- package/esm2015/app/components/block-editor/block-editor.component.js +2 -2
- package/esm2015/app/components/font/font.component.js +32 -0
- package/esm2015/app/components/font/index.js +2 -0
- package/esm2015/app/components/index.js +2 -0
- package/esm2015/app/components/layers-reorder-dialog/layers-reorder-dialog.component.js +5 -6
- package/esm2015/app/components/sidebar/sidebar.component.js +59 -61
- package/esm2015/app/fs-block-editor.module.js +16 -3
- package/esm2015/app/interfaces/block-editor-config.js +1 -1
- package/esm2015/app/interfaces/block.js +1 -1
- package/esm2015/app/interfaces/index.js +3 -0
- package/esm2015/app/services/block-editor.service.js +15 -11
- package/esm2015/app/services/blocks-store.service.js +17 -7
- package/esm2015/app/services/google-font.service.js +38 -0
- package/esm2015/app/services/index.js +2 -1
- package/fesm2015/firestitch-block-editor.js +222 -123
- package/fesm2015/firestitch-block-editor.js.map +1 -1
- package/package.json +2 -3
|
@@ -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('@angular/material/checkbox'), require('@angular/material/tooltip'), require('@angular/material/select'), require('@angular/material/list'), require('@angular/cdk/drag-drop'), require('@firestitch/colorpicker'), require('@firestitch/file'), require('@firestitch/menu'), require('@firestitch/zoom-pan'), require('@firestitch/dialog'), require('rxjs/operators'), require('moveable'), require('rxjs'), require('@angular/material/dialog'), require('@firestitch/common'), require('@angular/material/divider'), require('@firestitch/prompt'), require('@angular/material/core')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@firestitch/block-editor', ['exports', '@angular/forms', '@angular/material/input', '@angular/core', '@angular/common', '@angular/material/button', '@angular/material/form-field', '@angular/material/icon', '@angular/material/checkbox', '@angular/material/tooltip', '@angular/material/select', '@angular/material/list', '@angular/cdk/drag-drop', '@firestitch/colorpicker', '@firestitch/file', '@firestitch/menu', '@firestitch/zoom-pan', '@firestitch/dialog', 'rxjs/operators', 'moveable', 'rxjs', '@angular/material/dialog', '@firestitch/common', '@angular/material/divider', '@firestitch/prompt', '@angular/material/core'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.firestitch = global.firestitch || {}, global.firestitch["block-editor"] = {}), global.ng.forms, global.ng.material.input, global.ng.core, global.ng.common, global.ng.material.button, global.ng.material.formField, global.ng.material.icon, global.ng.material.checkbox, global.ng.material.tooltip, global.ng.material.select, global.ng.material.list, global.ng.cdk.dragDrop, global.
|
|
5
|
-
})(this, (function (exports,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/forms'), require('@angular/material/input'), require('@angular/core'), require('@angular/common'), require('@angular/material/button'), require('@angular/material/form-field'), require('@angular/material/icon'), require('@angular/material/checkbox'), require('@angular/material/tooltip'), require('@angular/material/select'), require('@angular/material/list'), require('@angular/cdk/drag-drop'), require('@firestitch/colorpicker'), require('@firestitch/file'), require('@firestitch/menu'), require('@firestitch/zoom-pan'), require('@firestitch/dialog'), require('rxjs/operators'), require('moveable'), require('rxjs'), require('@angular/material/dialog'), require('@firestitch/common'), require('@angular/material/divider'), require('@angular/common/http'), require('@firestitch/prompt'), require('@angular/material/core'), require('@firestitch/autocomplete')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@firestitch/block-editor', ['exports', '@angular/forms', '@angular/material/input', '@angular/core', '@angular/common', '@angular/material/button', '@angular/material/form-field', '@angular/material/icon', '@angular/material/checkbox', '@angular/material/tooltip', '@angular/material/select', '@angular/material/list', '@angular/cdk/drag-drop', '@firestitch/colorpicker', '@firestitch/file', '@firestitch/menu', '@firestitch/zoom-pan', '@firestitch/dialog', 'rxjs/operators', 'moveable', 'rxjs', '@angular/material/dialog', '@firestitch/common', '@angular/material/divider', '@angular/common/http', '@firestitch/prompt', '@angular/material/core', '@firestitch/autocomplete'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.firestitch = global.firestitch || {}, global.firestitch["block-editor"] = {}), global.ng.forms, global.ng.material.input, global.ng.core, global.ng.common, global.ng.material.button, global.ng.material.formField, global.ng.material.icon, global.ng.material.checkbox, global.ng.material.tooltip, global.ng.material.select, global.ng.material.list, global.ng.cdk.dragDrop, global.i12, global.i3$1, global.menu, global.i2$2, global.i2, global.rxjs.operators, global.Moveable, global.rxjs, global.ng.material.dialog, global.common, global.ng.material.divider, global.ng.common.http, global.i2$1, global.ng.material.core, global.i10));
|
|
5
|
+
})(this, (function (exports, i16, i15, i0, i13, i6, i6$1, i3, i9, i14, i7$1, i4, i7, i12, i3$1, menu, i2$2, i2, operators, Moveable, rxjs, i1, common, i5, i1$1, i2$1, i8, i10) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -24,27 +24,29 @@
|
|
|
24
24
|
return Object.freeze(n);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
var
|
|
28
|
-
var
|
|
27
|
+
var i16__namespace = /*#__PURE__*/_interopNamespace(i16);
|
|
28
|
+
var i15__namespace = /*#__PURE__*/_interopNamespace(i15);
|
|
29
29
|
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
30
|
-
var
|
|
30
|
+
var i13__namespace = /*#__PURE__*/_interopNamespace(i13);
|
|
31
31
|
var i6__namespace = /*#__PURE__*/_interopNamespace(i6);
|
|
32
32
|
var i6__namespace$1 = /*#__PURE__*/_interopNamespace(i6$1);
|
|
33
33
|
var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
|
|
34
34
|
var i9__namespace = /*#__PURE__*/_interopNamespace(i9);
|
|
35
|
-
var
|
|
35
|
+
var i14__namespace = /*#__PURE__*/_interopNamespace(i14);
|
|
36
36
|
var i7__namespace$1 = /*#__PURE__*/_interopNamespace(i7$1);
|
|
37
37
|
var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
|
|
38
38
|
var i7__namespace = /*#__PURE__*/_interopNamespace(i7);
|
|
39
|
-
var
|
|
39
|
+
var i12__namespace = /*#__PURE__*/_interopNamespace(i12);
|
|
40
40
|
var i3__namespace$1 = /*#__PURE__*/_interopNamespace(i3$1);
|
|
41
41
|
var i2__namespace$2 = /*#__PURE__*/_interopNamespace(i2$2);
|
|
42
42
|
var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
|
|
43
43
|
var Moveable__default = /*#__PURE__*/_interopDefaultLegacy(Moveable);
|
|
44
44
|
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
|
45
45
|
var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
|
|
46
|
+
var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
|
|
46
47
|
var i2__namespace$1 = /*#__PURE__*/_interopNamespace(i2$1);
|
|
47
48
|
var i8__namespace = /*#__PURE__*/_interopNamespace(i8);
|
|
49
|
+
var i10__namespace = /*#__PURE__*/_interopNamespace(i10);
|
|
48
50
|
|
|
49
51
|
exports.BlockType = void 0;
|
|
50
52
|
(function (BlockType) {
|
|
@@ -97,14 +99,13 @@
|
|
|
97
99
|
return LayersReorderDialogComponent;
|
|
98
100
|
}());
|
|
99
101
|
LayersReorderDialogComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: LayersReorderDialogComponent, deps: [{ token: i1.MAT_DIALOG_DATA }, { token: i1__namespace.MatDialogRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
100
|
-
LayersReorderDialogComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: LayersReorderDialogComponent, selector: "ng-component", ngImport: i0__namespace, template: "<fs-dialog>\n <h1 mat-dialog-title><mat-icon>swap_vert</mat-icon> Reorder Fields</h1>\n <mat-dialog-content>\n <mat-list cdkDropList (cdkDropListDropped)=\"swapItems($event)\">\n <mat-divider></mat-divider>\n <ng-container *ngFor=\"let blockComponent of blockComponents\">\n <mat-list-item cdkDrag cdkDragLockAxis=\"y\">\n <mat-icon cdkDragHandle>drag_handle</mat-icon>\n <mat-icon>\n {{ blockTypeIcons[blockComponent.block.type] }}\n </mat-icon>\n <span class=\"block-label\">\n
|
|
102
|
+
LayersReorderDialogComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: LayersReorderDialogComponent, selector: "ng-component", ngImport: i0__namespace, template: "<fs-dialog>\n <h1 mat-dialog-title><mat-icon>swap_vert</mat-icon> Reorder Fields</h1>\n <mat-dialog-content>\n <mat-list cdkDropList (cdkDropListDropped)=\"swapItems($event)\">\n <mat-divider></mat-divider>\n <ng-container *ngFor=\"let blockComponent of blockComponents\">\n <mat-list-item cdkDrag cdkDragLockAxis=\"y\">\n <mat-icon cdkDragHandle>drag_handle</mat-icon>\n <mat-icon>\n {{ blockTypeIcons[blockComponent.block.type] }}\n </mat-icon>\n <span class=\"block-label\">\n {{ blockComponent.block.label || blockComponent.block.content || 'No Content'}} \n </span>\n </mat-list-item>\n <mat-divider></mat-divider>\n </ng-container>\n </mat-list>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-button color=\"primary\" (click)=\"done()\">Done</button>\n </mat-dialog-actions>\n</fs-dialog>\n", styles: ["h1{display:flex}.mat-icon{margin-right:20px}.block-label{min-width:200px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:1000px}.cdk-drag-preview{display:flex;padding-left:15px!important;background:#fff;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-preview ::ng-deep .mat-list-item-content{display:flex;flex-direction:row;align-items:center;font-size:16px}.cdk-drag-handle{cursor:grab}.cdk-drag-placeholder{opacity:.2}\n"], components: [{ type: i2__namespace.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: i3__namespace.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i4__namespace.MatList, selector: "mat-list, mat-action-list", inputs: ["disableRipple", "disabled"], exportAs: ["matList"] }, { type: i5__namespace.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { type: i4__namespace.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["disableRipple", "disabled"], exportAs: ["matListItem"] }, { type: i6__namespace.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i1__namespace.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1__namespace.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i7__namespace.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "id", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListAutoScrollDisabled", "cdkDropListOrientation", "cdkDropListLockAxis", "cdkDropListData", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { type: i13__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7__namespace.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragDisabled", "cdkDragStartDelay", "cdkDragLockAxis", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragBoundary", "cdkDragRootElement", "cdkDragPreviewContainer", "cdkDragData", "cdkDragFreeDragPosition"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { type: i7__namespace.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { type: i1__namespace.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
101
103
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: LayersReorderDialogComponent, decorators: [{
|
|
102
104
|
type: i0.Component,
|
|
103
105
|
args: [{
|
|
104
106
|
templateUrl: './layers-reorder-dialog.component.html',
|
|
105
|
-
styleUrls: [
|
|
106
|
-
|
|
107
|
-
]
|
|
107
|
+
styleUrls: ['./layers-reorder-dialog.component.scss'],
|
|
108
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
108
109
|
}]
|
|
109
110
|
}], ctorParameters: function () {
|
|
110
111
|
return [{ type: undefined, decorators: [{
|
|
@@ -548,8 +549,13 @@
|
|
|
548
549
|
if (initBlock) {
|
|
549
550
|
block = this._createBlock(block);
|
|
550
551
|
}
|
|
551
|
-
|
|
552
|
-
.pipe(operators.
|
|
552
|
+
rxjs.from(fsFile.imageInfo)
|
|
553
|
+
.pipe(operators.switchMap(function (imageInfo) {
|
|
554
|
+
var ratio = imageInfo.height / imageInfo.width;
|
|
555
|
+
block.width = _this._config.width * .4;
|
|
556
|
+
block.height = block.width * ratio;
|
|
557
|
+
return _this._config.blockUpload(block, fsFile.file);
|
|
558
|
+
}), operators.takeUntil(this._destroy$))
|
|
553
559
|
.subscribe(function (newBlock) {
|
|
554
560
|
_this._appendBlock(newBlock);
|
|
555
561
|
});
|
|
@@ -610,7 +616,13 @@
|
|
|
610
616
|
});
|
|
611
617
|
};
|
|
612
618
|
BlocksStore.prototype._createBlock = function (block) {
|
|
613
|
-
var newBlock = Object.assign(Object.assign({ shapeBottomLeft: 'round', shapeTopLeft: 'round', shapeTopRight: 'round', shapeBottomRight: 'round', verticalAlign: 'top', horizontalAlign: 'left' }, block), { guid: block.guid || common.guid('xxxxxxxxxxxx')
|
|
619
|
+
var newBlock = Object.assign(Object.assign({ shapeBottomLeft: 'round', shapeTopLeft: 'round', shapeTopRight: 'round', shapeBottomRight: 'round', verticalAlign: 'top', horizontalAlign: 'left' }, block), { guid: block.guid || common.guid('xxxxxxxxxxxx'), keepRatio: [
|
|
620
|
+
exports.BlockType.Checkbox,
|
|
621
|
+
exports.BlockType.RadioButton,
|
|
622
|
+
exports.BlockType.Image,
|
|
623
|
+
exports.BlockType.Pdf,
|
|
624
|
+
]
|
|
625
|
+
.indexOf(block.type) !== -1 });
|
|
614
626
|
var width = (this._config.width * .333).toFixed(2);
|
|
615
627
|
var height = width / 2;
|
|
616
628
|
if (newBlock.type === exports.BlockType.Rectangle) {
|
|
@@ -620,7 +632,6 @@
|
|
|
620
632
|
else if (newBlock.type === exports.BlockType.Checkbox || newBlock.type === exports.BlockType.RadioButton) {
|
|
621
633
|
width = .25;
|
|
622
634
|
height = .25;
|
|
623
|
-
newBlock.keepRatio = true;
|
|
624
635
|
}
|
|
625
636
|
else {
|
|
626
637
|
width = 2;
|
|
@@ -652,6 +663,7 @@
|
|
|
652
663
|
this._selectedBlocks$ = new rxjs.BehaviorSubject([]);
|
|
653
664
|
this._blockComponents = new Map();
|
|
654
665
|
this._destroy$ = new rxjs.Subject();
|
|
666
|
+
this._blockInited$ = new rxjs.Subject();
|
|
655
667
|
}
|
|
656
668
|
Object.defineProperty(BlockEditorService.prototype, "blockComponents", {
|
|
657
669
|
get: function () {
|
|
@@ -679,7 +691,7 @@
|
|
|
679
691
|
};
|
|
680
692
|
BlockEditorService.prototype.blockUpload = function (block, fsFile, newBlock) {
|
|
681
693
|
if (newBlock === void 0) { newBlock = false; }
|
|
682
|
-
this._store.blockUpload(block, fsFile,
|
|
694
|
+
this._store.blockUpload(block, fsFile, true);
|
|
683
695
|
};
|
|
684
696
|
BlockEditorService.prototype.blockRemove = function (block) {
|
|
685
697
|
this._store.blockRemove(block);
|
|
@@ -713,6 +725,13 @@
|
|
|
713
725
|
enumerable: false,
|
|
714
726
|
configurable: true
|
|
715
727
|
});
|
|
728
|
+
Object.defineProperty(BlockEditorService.prototype, "blockInited$", {
|
|
729
|
+
get: function () {
|
|
730
|
+
return this._blockInited$;
|
|
731
|
+
},
|
|
732
|
+
enumerable: false,
|
|
733
|
+
configurable: true
|
|
734
|
+
});
|
|
716
735
|
Object.defineProperty(BlockEditorService.prototype, "blockRemoved$", {
|
|
717
736
|
get: function () {
|
|
718
737
|
return this._store.blockRemoved$;
|
|
@@ -795,11 +814,11 @@
|
|
|
795
814
|
BlockEditorService.prototype.hasSelectionRange = function () {
|
|
796
815
|
return this._selectionRange && (this._selectionRange.baseOffset - this._selectionRange.focusOffset) > 0;
|
|
797
816
|
};
|
|
798
|
-
BlockEditorService.prototype.
|
|
817
|
+
BlockEditorService.prototype.initBlock = function (block, blockComponent) {
|
|
799
818
|
this._blockComponents.set(block, blockComponent);
|
|
800
|
-
this.
|
|
819
|
+
this._blockInited$.next(block);
|
|
801
820
|
};
|
|
802
|
-
BlockEditorService.prototype.
|
|
821
|
+
BlockEditorService.prototype.destroyBlock = function (block) {
|
|
803
822
|
this._blockComponents.delete(block);
|
|
804
823
|
};
|
|
805
824
|
BlockEditorService.prototype.registerContainer = function (container) {
|
|
@@ -811,10 +830,8 @@
|
|
|
811
830
|
BlockEditorService.prototype.openReorderDialog = function () {
|
|
812
831
|
var _this = this;
|
|
813
832
|
var blockComponents = this.blockComponents
|
|
814
|
-
.
|
|
815
|
-
|
|
816
|
-
})
|
|
817
|
-
.sort(function (blockCmpA, blockCmpB) { return (blockCmpA.block.tabIndex - blockCmpB.block.tabIndex); });
|
|
833
|
+
.sort(function (blockCmpA, blockCmpB) { return (blockCmpA.block.index - blockCmpB.block.index); })
|
|
834
|
+
.reverse();
|
|
818
835
|
this._dialog
|
|
819
836
|
.open(LayersReorderDialogComponent, {
|
|
820
837
|
data: {
|
|
@@ -824,8 +841,10 @@
|
|
|
824
841
|
.afterClosed()
|
|
825
842
|
.pipe(operators.filter(function (blockComponents) { return !!blockComponents; }), operators.takeUntil(this._destroy$))
|
|
826
843
|
.subscribe(function (blockComponents) {
|
|
827
|
-
blockComponents
|
|
828
|
-
|
|
844
|
+
blockComponents
|
|
845
|
+
.reverse()
|
|
846
|
+
.forEach(function (blockCmp, index) {
|
|
847
|
+
blockCmp.block.index = index;
|
|
829
848
|
_this._store.blockChange(blockCmp.block);
|
|
830
849
|
_this._store.updateTabIndex(index);
|
|
831
850
|
});
|
|
@@ -843,6 +862,39 @@
|
|
|
843
862
|
type: i0.Injectable
|
|
844
863
|
}], ctorParameters: function () { return [{ type: BlocksStore }, { type: i2__namespace.FsDialog }]; } });
|
|
845
864
|
|
|
865
|
+
var GoogleFontService = /** @class */ (function () {
|
|
866
|
+
function GoogleFontService(httpClient) {
|
|
867
|
+
this.httpClient = httpClient;
|
|
868
|
+
this._apiKey = 'AIzaSyAoT2RLzCSFUb148F4uLXyAuquAzjcjyGk';
|
|
869
|
+
}
|
|
870
|
+
GoogleFontService.prototype.loadFont = function (font) {
|
|
871
|
+
var link = document.createElement('link');
|
|
872
|
+
link.rel = 'stylesheet';
|
|
873
|
+
link.href = "https://fonts.googleapis.com/css2?family=" + font.family + "&family=Tangerine&display=swap";
|
|
874
|
+
document.getElementsByTagName('head')[0].appendChild(link);
|
|
875
|
+
};
|
|
876
|
+
GoogleFontService.prototype.getItems = function () {
|
|
877
|
+
if (this._fonts$) {
|
|
878
|
+
return this._fonts$.asObservable();
|
|
879
|
+
}
|
|
880
|
+
if (!this._apiKey) {
|
|
881
|
+
return rxjs.throwError("Error: api key was not provided to the google fonts service");
|
|
882
|
+
}
|
|
883
|
+
var url = "https://www.googleapis.com/webfonts/v1/webfonts?key=" + this._apiKey;
|
|
884
|
+
return this.httpClient.get(url)
|
|
885
|
+
.pipe(operators.map(function (response) { return response.items
|
|
886
|
+
.map(function (item) {
|
|
887
|
+
return { family: item.family };
|
|
888
|
+
}); }));
|
|
889
|
+
};
|
|
890
|
+
return GoogleFontService;
|
|
891
|
+
}());
|
|
892
|
+
GoogleFontService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: GoogleFontService, deps: [{ token: i1__namespace$1.HttpClient }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
893
|
+
GoogleFontService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: GoogleFontService });
|
|
894
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: GoogleFontService, decorators: [{
|
|
895
|
+
type: i0.Injectable
|
|
896
|
+
}], ctorParameters: function () { return [{ type: i1__namespace$1.HttpClient }]; } });
|
|
897
|
+
|
|
846
898
|
var FsBlockComponent = /** @class */ (function () {
|
|
847
899
|
function FsBlockComponent(_blockEditor, _elementRef, _cdRef) {
|
|
848
900
|
this._blockEditor = _blockEditor;
|
|
@@ -881,6 +933,18 @@
|
|
|
881
933
|
enumerable: false,
|
|
882
934
|
configurable: true
|
|
883
935
|
});
|
|
936
|
+
Object.defineProperty(FsBlockComponent.prototype, "boxShadow", {
|
|
937
|
+
get: function () {
|
|
938
|
+
if (!this.block.shadowColor) {
|
|
939
|
+
return null;
|
|
940
|
+
}
|
|
941
|
+
var shadowOpacity = ((Number(this.block.shadowOpacity || 100) / 100) * 255).toString(16).padStart(2, '0');
|
|
942
|
+
var shadow = this.block.shadowX + "pt " + (this.block.shadowY || 0) + "pt " + (this.block.shadowBlur || 0) + "pt " + (this.block.shadowSpread || 0) + "pt " + this.block.shadowColor + shadowOpacity;
|
|
943
|
+
return shadow;
|
|
944
|
+
},
|
|
945
|
+
enumerable: false,
|
|
946
|
+
configurable: true
|
|
947
|
+
});
|
|
884
948
|
Object.defineProperty(FsBlockComponent.prototype, "elementGuidelines", {
|
|
885
949
|
set: function (value) {
|
|
886
950
|
this.moveable.elementGuidelines = value;
|
|
@@ -901,7 +965,6 @@
|
|
|
901
965
|
},
|
|
902
966
|
set: function (value) {
|
|
903
967
|
this._transformable = value;
|
|
904
|
-
this.moveable.draggable = value;
|
|
905
968
|
this.moveable.resizable = value;
|
|
906
969
|
this.moveable.roundable = value;
|
|
907
970
|
this.moveable.rotatable = value;
|
|
@@ -972,6 +1035,12 @@
|
|
|
972
1035
|
var _this = this;
|
|
973
1036
|
this.unit = this._blockEditor.config.unit;
|
|
974
1037
|
this.content = this.block.content;
|
|
1038
|
+
this.block.shadowOpacity = this.block.shadowOpacity || 100;
|
|
1039
|
+
this._blockEditor.blockInited$
|
|
1040
|
+
.pipe(operators.takeUntil(this._destroy$))
|
|
1041
|
+
.subscribe(function () {
|
|
1042
|
+
_this._updateElementGuidelines();
|
|
1043
|
+
});
|
|
975
1044
|
this._blockEditor.blockChanged$
|
|
976
1045
|
.pipe(operators.filter(function (block) { return block === _this.block; }), operators.takeUntil(this._destroy$))
|
|
977
1046
|
.subscribe(function (block) {
|
|
@@ -980,6 +1049,7 @@
|
|
|
980
1049
|
_this.height = block.height;
|
|
981
1050
|
_this.top = block.top;
|
|
982
1051
|
_this.left = block.left;
|
|
1052
|
+
_this.rotate = _this.block.rotate;
|
|
983
1053
|
_this._cdRef.markForCheck();
|
|
984
1054
|
});
|
|
985
1055
|
};
|
|
@@ -993,7 +1063,8 @@
|
|
|
993
1063
|
_this.height = _this.block.height;
|
|
994
1064
|
_this.top = _this.block.top;
|
|
995
1065
|
_this.left = _this.block.left;
|
|
996
|
-
_this.
|
|
1066
|
+
_this.rotate = _this.block.rotate;
|
|
1067
|
+
_this._blockEditor.initBlock(_this.block, _this);
|
|
997
1068
|
});
|
|
998
1069
|
};
|
|
999
1070
|
FsBlockComponent.prototype.pxToIn = function (px) {
|
|
@@ -1004,6 +1075,9 @@
|
|
|
1004
1075
|
};
|
|
1005
1076
|
FsBlockComponent.prototype.deselect = function () {
|
|
1006
1077
|
this.transformable = false;
|
|
1078
|
+
this.disableContentEdit();
|
|
1079
|
+
};
|
|
1080
|
+
FsBlockComponent.prototype.disableContentEdit = function () {
|
|
1007
1081
|
this.editable = false;
|
|
1008
1082
|
};
|
|
1009
1083
|
FsBlockComponent.prototype.deselectContent = function () {
|
|
@@ -1024,7 +1098,7 @@
|
|
|
1024
1098
|
sel.addRange(range);
|
|
1025
1099
|
};
|
|
1026
1100
|
FsBlockComponent.prototype.ngOnDestroy = function () {
|
|
1027
|
-
this._blockEditor.
|
|
1101
|
+
this._blockEditor.destroyBlock(this.block);
|
|
1028
1102
|
this._destroy$.next();
|
|
1029
1103
|
this._destroy$.complete();
|
|
1030
1104
|
};
|
|
@@ -1039,12 +1113,18 @@
|
|
|
1039
1113
|
FsBlockComponent.prototype._triggerChanged = function () {
|
|
1040
1114
|
this._blockEditor.blockChange(this.block);
|
|
1041
1115
|
};
|
|
1116
|
+
FsBlockComponent.prototype._updateElementGuidelines = function () {
|
|
1117
|
+
var _this = this;
|
|
1118
|
+
this.moveable.elementGuidelines = this._blockEditor.blockComponents
|
|
1119
|
+
.map(function (blockComponent) { return blockComponent.el; })
|
|
1120
|
+
.filter(function (el) { return !el.isSameNode(_this.el); });
|
|
1121
|
+
};
|
|
1042
1122
|
FsBlockComponent.prototype._initMoveable = function () {
|
|
1043
1123
|
var _this = this;
|
|
1044
1124
|
this._moveable = new Moveable__default["default"](this._elementRef.nativeElement, {
|
|
1045
1125
|
target: this.el,
|
|
1046
1126
|
container: this._blockEditor.container,
|
|
1047
|
-
draggable:
|
|
1127
|
+
draggable: true,
|
|
1048
1128
|
resizable: false,
|
|
1049
1129
|
scalable: false,
|
|
1050
1130
|
rotatable: false,
|
|
@@ -1052,12 +1132,16 @@
|
|
|
1052
1132
|
origin: false,
|
|
1053
1133
|
keepRatio: this.block.keepRatio,
|
|
1054
1134
|
snappable: true,
|
|
1135
|
+
snapDirections: { left: true, top: true, right: true, bottom: true, center: true, middle: true },
|
|
1136
|
+
elementSnapDirections: { left: true, top: true, right: true, bottom: true, center: true, middle: true },
|
|
1055
1137
|
edge: false,
|
|
1056
1138
|
throttleDrag: 1,
|
|
1057
1139
|
throttleScale: 0.01,
|
|
1058
1140
|
throttleRotate: 1,
|
|
1059
1141
|
throttleResize: 1,
|
|
1142
|
+
snapDistFormat: function (v, type) { return "" + _this.round(v / 96, 2); },
|
|
1060
1143
|
});
|
|
1144
|
+
this._updateElementGuidelines();
|
|
1061
1145
|
this.moveable
|
|
1062
1146
|
.on('clip', function (e) {
|
|
1063
1147
|
_this.block.clipPath = e.clipStyle;
|
|
@@ -1066,7 +1150,7 @@
|
|
|
1066
1150
|
});
|
|
1067
1151
|
this.moveable
|
|
1068
1152
|
.on('dragStart', function () {
|
|
1069
|
-
_this.
|
|
1153
|
+
_this.disableContentEdit();
|
|
1070
1154
|
_this.transformating = true;
|
|
1071
1155
|
_this._cdRef.markForCheck();
|
|
1072
1156
|
})
|
|
@@ -1083,7 +1167,7 @@
|
|
|
1083
1167
|
_this._cdRef.markForCheck();
|
|
1084
1168
|
})
|
|
1085
1169
|
.on('resizeStart', function () {
|
|
1086
|
-
_this.
|
|
1170
|
+
_this.disableContentEdit();
|
|
1087
1171
|
_this.zoompan.disable();
|
|
1088
1172
|
_this.transformating = true;
|
|
1089
1173
|
_this._cdRef.markForCheck();
|
|
@@ -1123,23 +1207,30 @@
|
|
|
1123
1207
|
_this.transformating = false;
|
|
1124
1208
|
_this._cdRef.markForCheck();
|
|
1125
1209
|
})
|
|
1126
|
-
.on('rotateStart', function () {
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1210
|
+
.on('rotateStart', function (_a) {
|
|
1211
|
+
var inputEvent = _a.inputEvent;
|
|
1212
|
+
if (inputEvent) {
|
|
1213
|
+
_this.zoompan.disable();
|
|
1214
|
+
_this.disableContentEdit();
|
|
1215
|
+
_this.transformating = true;
|
|
1216
|
+
_this._cdRef.markForCheck();
|
|
1217
|
+
}
|
|
1132
1218
|
})
|
|
1133
1219
|
.on('rotate', function (_a) {
|
|
1134
|
-
var
|
|
1135
|
-
_this.block.rotate = _this._rotateStart + rotate;
|
|
1220
|
+
var inputEvent = _a.inputEvent, transform = _a.transform, rotation = _a.rotation;
|
|
1136
1221
|
_this.el.style.transform = transform;
|
|
1137
|
-
_this.
|
|
1138
|
-
|
|
1222
|
+
_this.block.rotate = rotation % 360;
|
|
1223
|
+
if (inputEvent) {
|
|
1224
|
+
_this._triggerChanged();
|
|
1225
|
+
_this.zoompan.enable();
|
|
1226
|
+
}
|
|
1139
1227
|
})
|
|
1140
|
-
.on('rotateEnd', function () {
|
|
1141
|
-
|
|
1142
|
-
|
|
1228
|
+
.on('rotateEnd', function (_a) {
|
|
1229
|
+
var inputEvent = _a.inputEvent;
|
|
1230
|
+
if (inputEvent) {
|
|
1231
|
+
_this.transformating = false;
|
|
1232
|
+
_this._cdRef.markForCheck();
|
|
1233
|
+
}
|
|
1143
1234
|
});
|
|
1144
1235
|
};
|
|
1145
1236
|
FsBlockComponent.prototype._initEvents = function () {
|
|
@@ -1185,7 +1276,7 @@
|
|
|
1185
1276
|
return FsBlockComponent;
|
|
1186
1277
|
}());
|
|
1187
1278
|
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 });
|
|
1188
|
-
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]=\"{ \n editable: editable, \n readonly: block.readonly,\n required: block.required\n }\">\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 +
|
|
1279
|
+
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]=\"{ \n editable: editable, \n readonly: block.readonly,\n required: block.required\n }\">\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.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.clipPath]=\"block.clipPath\"\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]=\"boxShadow\"\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;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__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i13__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i13__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i13__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
1189
1280
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockComponent, decorators: [{
|
|
1190
1281
|
type: i0.Component,
|
|
1191
1282
|
args: [{
|
|
@@ -1241,12 +1332,44 @@
|
|
|
1241
1332
|
{ value: BlockFormat.YYYYMMDD, name: 'YYYY/MM/DD', blockTypes: [exports.BlockType.Date] },
|
|
1242
1333
|
];
|
|
1243
1334
|
|
|
1335
|
+
var FontComponent = /** @class */ (function () {
|
|
1336
|
+
function FontComponent(_el, _googleFontService) {
|
|
1337
|
+
this._el = _el;
|
|
1338
|
+
this._googleFontService = _googleFontService;
|
|
1339
|
+
}
|
|
1340
|
+
FontComponent.prototype.ngOnInit = function () {
|
|
1341
|
+
var _this = this;
|
|
1342
|
+
var observer = new IntersectionObserver(function (entries) {
|
|
1343
|
+
if (entries[0].isIntersecting === true) {
|
|
1344
|
+
_this._googleFontService.loadFont(_this.font);
|
|
1345
|
+
}
|
|
1346
|
+
}, { threshold: [0] });
|
|
1347
|
+
observer.observe(this._el.nativeElement);
|
|
1348
|
+
};
|
|
1349
|
+
return FontComponent;
|
|
1350
|
+
}());
|
|
1351
|
+
FontComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FontComponent, deps: [{ token: i0__namespace.ElementRef }, { token: GoogleFontService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1352
|
+
FontComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FontComponent, selector: "app-font", inputs: { font: "font" }, ngImport: i0__namespace, template: "<div\n [style.fontFamily]=\"font.family\">\n {{font.family}}\n</div>\n", styles: [""], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
1353
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FontComponent, decorators: [{
|
|
1354
|
+
type: i0.Component,
|
|
1355
|
+
args: [{
|
|
1356
|
+
selector: 'app-font',
|
|
1357
|
+
templateUrl: 'font.component.html',
|
|
1358
|
+
styleUrls: ['font.component.scss'],
|
|
1359
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
1360
|
+
}]
|
|
1361
|
+
}], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: GoogleFontService }]; }, propDecorators: { font: [{
|
|
1362
|
+
type: i0.Input
|
|
1363
|
+
}] } });
|
|
1364
|
+
|
|
1244
1365
|
var SidebarComponent = /** @class */ (function () {
|
|
1245
|
-
function SidebarComponent(_el, _blockEditor, _cdRef, _prompt, _document) {
|
|
1366
|
+
function SidebarComponent(_el, _blockEditor, _cdRef, _prompt, _googleFontService, _document) {
|
|
1367
|
+
var _this = this;
|
|
1246
1368
|
this._el = _el;
|
|
1247
1369
|
this._blockEditor = _blockEditor;
|
|
1248
1370
|
this._cdRef = _cdRef;
|
|
1249
1371
|
this._prompt = _prompt;
|
|
1372
|
+
this._googleFontService = _googleFontService;
|
|
1250
1373
|
this._document = _document;
|
|
1251
1374
|
this.zoomCenter = new i0.EventEmitter();
|
|
1252
1375
|
this.BlockTypes = BlockTypes;
|
|
@@ -1255,6 +1378,12 @@
|
|
|
1255
1378
|
this.BlockType = exports.BlockType;
|
|
1256
1379
|
this.formats = [];
|
|
1257
1380
|
this._destroy$ = new rxjs.Subject();
|
|
1381
|
+
this.fontFetch = function (value) {
|
|
1382
|
+
return _this._googleFontService.getItems();
|
|
1383
|
+
};
|
|
1384
|
+
this.fontDisplayWith = function (value) {
|
|
1385
|
+
return value === null || value === void 0 ? void 0 : value.family;
|
|
1386
|
+
};
|
|
1258
1387
|
}
|
|
1259
1388
|
Object.defineProperty(SidebarComponent.prototype, "el", {
|
|
1260
1389
|
get: function () {
|
|
@@ -1280,6 +1409,9 @@
|
|
|
1280
1409
|
_this._cdRef.markForCheck();
|
|
1281
1410
|
});
|
|
1282
1411
|
};
|
|
1412
|
+
SidebarComponent.prototype.fontChanged = function (font) {
|
|
1413
|
+
this._blockEditor.selectedBlockComponentChangeProperty(font === null || font === void 0 ? void 0 : font.family, 'fontFamily');
|
|
1414
|
+
};
|
|
1283
1415
|
SidebarComponent.prototype.verticalAlignClick = function (value) {
|
|
1284
1416
|
this._blockEditor.selectedBlockComponentChangeProperty(value, 'verticalAlign');
|
|
1285
1417
|
};
|
|
@@ -1289,18 +1421,6 @@
|
|
|
1289
1421
|
SidebarComponent.prototype.fontColorChange = function (value) {
|
|
1290
1422
|
this._blockEditor.selectedBlockComponentChangeProperty(value, 'fontColor');
|
|
1291
1423
|
};
|
|
1292
|
-
SidebarComponent.prototype.lineHeightChange = function (value) {
|
|
1293
|
-
value = this.validNumeric(value) ? value : null;
|
|
1294
|
-
this._blockEditor.selectedBlockComponentChangeProperty(value, 'lineHeight');
|
|
1295
|
-
};
|
|
1296
|
-
SidebarComponent.prototype.fontSizeChange = function (value) {
|
|
1297
|
-
value = this.validNumeric(value) ? value : null;
|
|
1298
|
-
this._blockEditor.selectedBlockComponentChangeProperty(value, 'fontSize');
|
|
1299
|
-
};
|
|
1300
|
-
SidebarComponent.prototype.borderWidthChange = function (value) {
|
|
1301
|
-
value = this.validNumeric(value) ? value : null;
|
|
1302
|
-
this._blockEditor.selectedBlockComponentChangeProperty(value, 'borderWidth');
|
|
1303
|
-
};
|
|
1304
1424
|
SidebarComponent.prototype.italicClick = function () {
|
|
1305
1425
|
this._blockEditor.selectedBlockComponentChangeProperty(!this.block.italic, 'italic');
|
|
1306
1426
|
};
|
|
@@ -1310,40 +1430,31 @@
|
|
|
1310
1430
|
SidebarComponent.prototype.backgroundColorChange = function (value) {
|
|
1311
1431
|
this._blockEditor.selectedBlockComponentChangeProperty(value, 'backgroundColor');
|
|
1312
1432
|
};
|
|
1313
|
-
SidebarComponent.prototype.
|
|
1314
|
-
|
|
1315
|
-
this._blockEditor.selectedBlockComponentChangeProperty(value, 'width');
|
|
1316
|
-
};
|
|
1317
|
-
SidebarComponent.prototype.heightChange = function (value) {
|
|
1318
|
-
value = this.validNumeric(value) ? value : null;
|
|
1319
|
-
this._blockEditor.selectedBlockComponentChangeProperty(value, 'height');
|
|
1320
|
-
};
|
|
1321
|
-
SidebarComponent.prototype.topChange = function (value) {
|
|
1322
|
-
value = this.validNumeric(value) ? value : null;
|
|
1323
|
-
this._blockEditor.selectedBlockComponentChangeProperty(value, 'top');
|
|
1324
|
-
};
|
|
1325
|
-
SidebarComponent.prototype.leftChange = function (value) {
|
|
1326
|
-
value = this.validNumeric(value) ? value : null;
|
|
1327
|
-
this._blockEditor.selectedBlockComponentChangeProperty(value, 'left');
|
|
1328
|
-
};
|
|
1329
|
-
SidebarComponent.prototype.rotateChange = function (value) {
|
|
1330
|
-
value = this.validNumeric(value) ? value : null;
|
|
1331
|
-
this._blockEditor.selectedBlockComponentChangeProperty(value, 'rotate');
|
|
1332
|
-
};
|
|
1333
|
-
SidebarComponent.prototype.paddingChange = function (name, value) {
|
|
1334
|
-
value = this.validNumeric(value) ? value : null;
|
|
1335
|
-
this._blockEditor.selectedBlockComponentChangeProperty(value, 'padding');
|
|
1433
|
+
SidebarComponent.prototype.shadowColorChange = function (value) {
|
|
1434
|
+
this._blockEditor.selectedBlockComponentChangeProperty(value, 'shadowColor');
|
|
1336
1435
|
};
|
|
1337
1436
|
SidebarComponent.prototype.paddingAllChange = function (value) {
|
|
1437
|
+
var _this = this;
|
|
1338
1438
|
value = this.validNumeric(value) ? value : null;
|
|
1339
1439
|
this.block.paddingTop = value;
|
|
1340
1440
|
this.block.paddingLeft = value;
|
|
1341
1441
|
this.block.paddingBottom = value;
|
|
1342
1442
|
this.block.paddingRight = value;
|
|
1343
|
-
this.
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1443
|
+
this._blockEditor.selectedBlocks
|
|
1444
|
+
.forEach(function (block) {
|
|
1445
|
+
_this._blockEditor.blockChange(block);
|
|
1446
|
+
});
|
|
1447
|
+
};
|
|
1448
|
+
SidebarComponent.prototype.paddingKeypress = function (event, name) {
|
|
1449
|
+
this.block.padding = null;
|
|
1450
|
+
this.numericInputKeypress(event, name, 1);
|
|
1451
|
+
};
|
|
1452
|
+
SidebarComponent.prototype.paddingAllKeypress = function (event, unit) {
|
|
1453
|
+
if (unit === void 0) { unit = 1; }
|
|
1454
|
+
if (event.code === 'ArrowUp' || event.code === 'ArrowDown') {
|
|
1455
|
+
this.block.padding = common.round(Number(this.block.padding || 0) + ((event.code === 'ArrowDown' ? -1 : 1) * unit), 3);
|
|
1456
|
+
this.paddingAllChange(this.block.padding);
|
|
1457
|
+
}
|
|
1347
1458
|
};
|
|
1348
1459
|
SidebarComponent.prototype.borderColorChange = function (value) {
|
|
1349
1460
|
this._blockEditor.selectedBlockComponentChangeProperty(value, 'borderColor');
|
|
@@ -1358,6 +1469,10 @@
|
|
|
1358
1469
|
var value = this.block[name] === 'round' ? 'square' : 'round';
|
|
1359
1470
|
this._blockEditor.selectedBlockComponentChangeProperty(value, name);
|
|
1360
1471
|
};
|
|
1472
|
+
SidebarComponent.prototype.numberChange = function (value, name) {
|
|
1473
|
+
value = this.validNumeric(value) ? Number(value) : null;
|
|
1474
|
+
this._blockEditor.selectedBlockComponentChangeProperty(value, name);
|
|
1475
|
+
};
|
|
1361
1476
|
SidebarComponent.prototype.imageRemove = function () {
|
|
1362
1477
|
this._blockEditor.selectedBlockComponentChangeProperty(null, 'imageUrl');
|
|
1363
1478
|
};
|
|
@@ -1365,9 +1480,6 @@
|
|
|
1365
1480
|
this.clippable = !this.clippable;
|
|
1366
1481
|
this._blockEditor.selectedBlockComponentChangeProperty(this.clippable, 'clippable');
|
|
1367
1482
|
};
|
|
1368
|
-
SidebarComponent.prototype.shapeRadiusChange = function (value) {
|
|
1369
|
-
this._blockEditor.selectedBlockComponentChangeProperty(value, 'shapeRadius');
|
|
1370
|
-
};
|
|
1371
1483
|
SidebarComponent.prototype.blockChangeProperty = function (value, name) {
|
|
1372
1484
|
this._blockEditor.selectedBlockComponentChangeProperty(value, name);
|
|
1373
1485
|
};
|
|
@@ -1394,17 +1506,19 @@
|
|
|
1394
1506
|
}
|
|
1395
1507
|
};
|
|
1396
1508
|
SidebarComponent.prototype.blockUpload = function (type, fsFile) {
|
|
1397
|
-
this._blockEditor.blockUpload({
|
|
1398
|
-
type: type,
|
|
1399
|
-
}, fsFile, true);
|
|
1509
|
+
this._blockEditor.blockUpload({ type: type }, fsFile, true);
|
|
1400
1510
|
};
|
|
1401
1511
|
SidebarComponent.prototype.blockAdd = function (type) {
|
|
1402
1512
|
if (type === exports.BlockType.Pdf || type === exports.BlockType.Image) {
|
|
1403
1513
|
return;
|
|
1404
1514
|
}
|
|
1405
|
-
|
|
1515
|
+
var block = {
|
|
1406
1516
|
type: type,
|
|
1407
|
-
|
|
1517
|
+
shadowX: 2,
|
|
1518
|
+
shadowY: 2,
|
|
1519
|
+
shadowBlur: 4,
|
|
1520
|
+
};
|
|
1521
|
+
this._blockEditor.blockAdd(block, true);
|
|
1408
1522
|
};
|
|
1409
1523
|
SidebarComponent.prototype.layerMove = function (direction) {
|
|
1410
1524
|
var _this = this;
|
|
@@ -1438,6 +1552,13 @@
|
|
|
1438
1552
|
SidebarComponent.prototype.inputFocus = function (event) {
|
|
1439
1553
|
event.target.select();
|
|
1440
1554
|
};
|
|
1555
|
+
SidebarComponent.prototype.numericInputKeypress = function (event, name, unit) {
|
|
1556
|
+
if (unit === void 0) { unit = 1; }
|
|
1557
|
+
if (event.code === 'ArrowUp' || event.code === 'ArrowDown') {
|
|
1558
|
+
this.block[name] = common.round(Number(this.block[name] || 0) + ((event.code === 'ArrowDown' ? -1 : 1) * unit), 3);
|
|
1559
|
+
this._blockEditor.selectedBlockComponentChangeProperty(this.block[name], name);
|
|
1560
|
+
}
|
|
1561
|
+
};
|
|
1441
1562
|
SidebarComponent.prototype.ngOnDestroy = function () {
|
|
1442
1563
|
this._destroy$.next();
|
|
1443
1564
|
this._destroy$.complete();
|
|
@@ -1447,8 +1568,8 @@
|
|
|
1447
1568
|
};
|
|
1448
1569
|
return SidebarComponent;
|
|
1449
1570
|
}());
|
|
1450
|
-
SidebarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SidebarComponent, deps: [{ token: i0__namespace.ElementRef }, { token: BlockEditorService }, { token: i0__namespace.ChangeDetectorRef }, { token: i2__namespace$1.FsPrompt }, { token:
|
|
1451
|
-
SidebarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SidebarComponent, selector: "sidebar", inputs: { config: "config", blocks: "blocks" }, outputs: { zoomCenter: "zoomCenter" }, queries: [{ propertyName: "sidebarPanels", predicate: FsBlockEditorSidebarPanelDirective }], ngImport: i0__namespace, template: "<div class=\"sidebar\">\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-row\">\n <ng-container *ngFor=\"let blockType of BlockTypes\">\n <ng-container [ngSwitch]=\"blockType.value\">\n <ng-container *ngSwitchCase=\"BlockType.Pdf\">\n <ng-container *ngTemplateOutlet=\"addFile\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"BlockType.Image\">\n <ng-container *ngTemplateOutlet=\"addFile\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container *ngTemplateOutlet=\"addButton\"></ng-container>\n </ng-container>\n </ng-container>\n\n <ng-template #addFile>\n <fs-file (select)=\"blockUpload(blockType.value, $event)\" [accept]=\"blockType.accept\">\n <ng-container *ngTemplateOutlet=\"addButton\"></ng-container>\n </fs-file>\n </ng-template>\n\n <ng-template #addButton>\n <button\n type=\"button\"\n mat-icon-button\n [matTooltip]=\"'Add ' + blockType.name\"\n (click)=\"blockAdd(blockType.value)\">\n <mat-icon>{{blockType.icon}}</mat-icon>\n </button>\n </ng-template>\n </ng-container>\n </div>\n </div>\n\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-row\">\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n matTooltip=\"Reset zoom\"\n (click)=\"zoomCenter.emit()\">\n <mat-icon>crop_free</mat-icon>\n </button>\n <button\n class=\"reorder-layers\"\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"reorderLayers()\">\n <mat-icon>swap_vert</mat-icon>\n </button>\n <ng-container *ngIf=\"block\">\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"blockRemoveClick()\">\n <mat-icon>delete_outline</mat-icon>\n </button>\n <button\n class=\"layer-up\"\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"layerUp()\">\n <mat-icon>arrow_back</mat-icon>\n <mat-icon>layers</mat-icon>\n </button>\n <button\n class=\"layer-down\"\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"layerDown()\">\n <mat-icon>arrow_back</mat-icon>\n <mat-icon>layers</mat-icon>\n </button>\n </ng-container>\n </div>\n </div>\n <ng-container *ngIf=\"block\">\n <div class=\"sidebar-panel info-panel\">\n <div class=\"sidebar-label\">Info</div>\n <div class=\"sidebar-row\">\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.left\"\n name=\"left\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"leftChange($event)\">\n <span matPrefix>X</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.top\"\n name=\"top\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"topChange($event)\">\n <span matPrefix>Y</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.rotate || 0\"\n name=\"rotate\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"rotateChange($event)\">\n <span matPrefix>R</span>\n </mat-form-field>\n </div>\n\n <div class=\"sidebar-row\">\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.width\"\n name=\"width\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"widthChange($event)\">\n <span matPrefix>W</span>\n </mat-form-field>\n\n <div>\n <a (click)=\"toggleKeepRatio()\" class=\"keep-ratio\">\n <mat-icon>{{block.keepRatio ? 'lock_outline' : 'lock_open'}}</mat-icon>\n </a>\n </div>\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.height\"\n name=\"height\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"heightChange($event)\">\n <span matPrefix>H</span>\n </mat-form-field>\n </div>\n </div>\n <ng-container *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText || block.type === BlockType.RadioButton || block.type === BlockType.Checkbox || block.type === BlockType.Date || block.type === BlockType.Signature\">\n <div class=\"sidebar-panel block-form-panel\">\n <div class=\"sidebar-label\">\n <mat-icon>{{blockTypeIcons[block.type]}}</mat-icon>\n {{blockTypeNames[block.type]}}</div>\n <div class=\"sidebar-row\">\n\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <input\n matInput\n [ngModel]=\"block.label\"\n name=\"label\"\n placeholder=\"Label\"\n (ngModelChange)=\"blockChangeProperty($event, 'label')\">\n </mat-form-field>\n\n <ng-container *ngIf=\"block.type !== BlockType.Checkbox && block.type !== BlockType.RadioButton\">\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <textarea\n matInput\n [matTextareaAutosize]=\"true\"\n [ngModel]=\"block.description\"\n name=\"description\"\n placeholder=\"Description\"\n (ngModelChange)=\"blockChangeProperty($event, 'description')\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <mat-form-field\n *ngIf=\"formats.length\"\n class=\"form-field-padless-bottom full-width\">\n <mat-label>Format</mat-label>\n <mat-select\n [(ngModel)]=\"block.format\"\n name=\"format\"\n (ngModelChange)=\"blockChangeProperty($event, 'format')\">\n <mat-option [value]=\"null\">\n None\n </mat-option>\n <mat-option\n *ngFor=\"let item of formats\"\n [value]=\"item.value\">\n {{ item.name }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n\n <ng-container *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText || block.type === BlockType.Date\">\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <textarea\n matInput\n [matTextareaAutosize]=\"true\"\n [ngModel]=\"block.default\"\n name=\"default\"\n placeholder=\"Default\"\n (ngModelChange)=\"blockChangeProperty($event, 'default')\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <ng-container *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText\">\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <textarea\n matInput\n [matTextareaAutosize]=\"true\"\n [ngModel]=\"block.formula\"\n name=\"formula\"\n placeholder=\"Formula\"\n (ngModelChange)=\"blockChangeProperty($event, 'formula')\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <ng-container *ngIf=\"block.type === BlockType.RadioButton || block.type === BlockType.Checkbox\">\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <textarea\n matInput\n [matTextareaAutosize]=\"true\"\n [ngModel]=\"block.groupLabel\"\n name=\"groupLabel\"\n placeholder=\"Group Label\"\n (ngModelChange)=\"blockChangeProperty($event, 'groupLabel')\">\n </textarea>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <mat-label>Group Description</mat-label>\n <textarea\n matInput\n [matTextareaAutosize]=\"true\"\n [ngModel]=\"block.groupDescription\"\n name=\"groupDescription\"\n (ngModelChange)=\"blockChangeProperty($event, 'groupDescription')\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <input\n matInput\n [ngModel]=\"block.name\"\n name=\"name\"\n placeholder=\"Name\"\n (ngModelChange)=\"blockChangeProperty($event, 'name')\">\n </mat-form-field>\n\n <div class=\"form-field-options\">\n <mat-checkbox\n name=\"required\"\n [(ngModel)]=\"block.required\"\n (ngModelChange)=\"blockChangeProperty($event, 'required')\">\n Required\n </mat-checkbox>\n\n <mat-checkbox\n name=\"readonly\"\n [(ngModel)]=\"block.readonly\"\n (ngModelChange)=\"blockChangeProperty($event, 'readonly')\">\n Readonly\n </mat-checkbox>\n </div>\n </div>\n </div>\n </ng-container>\n <div class=\"sidebar-panel typography-panel\">\n <div class=\"sidebar-label\">Typography</div>\n <div class=\"sidebar-row\">\n <fs-color-picker-chip\n (changed)=\"fontColorChange($event)\"\n [color]=\"block.fontColor\">\n </fs-color-picker-chip>\n\n <mat-form-field class=\"form-field-padless font-size\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.fontSize\"\n name=\"fontSize\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"fontSizeChange($event)\"\n placeholder=\"Size\">\n <span matPrefix *ngIf=\"block.fontSize\">S</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless line-height\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.lineHeight\"\n name=\"lineHeight\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"lineHeightChange($event)\"\n placeholder=\"Line\">\n <span matPrefix *ngIf=\"block.lineHeight\">L</span>\n </mat-form-field>\n </div>\n\n <div class=\"sidebar-row style-row\">\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.bold }\"\n (click)=\"boldClick()\">\n <mat-icon>format_bold</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.italic }\"\n (click)=\"italicClick()\">\n <mat-icon>format_italic</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.underline }\"\n (click)=\"underlineClick()\">\n <mat-icon>format_underline</mat-icon>\n </button>\n </div>\n\n <div class=\"sidebar-row align-row\">\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.horizontalAlign === 'left' }\"\n (click)=\"horizontalAlignClick('left')\">\n <mat-icon>format_align_left</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.horizontalAlign === 'center' }\"\n (click)=\"horizontalAlignClick('center')\">\n <mat-icon>format_align_center</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.horizontalAlign === 'right' }\"\n (click)=\"horizontalAlignClick('right')\">\n <mat-icon>format_align_right</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.verticalAlign === 'top' }\"\n (click)=\"verticalAlignClick('top')\">\n <mat-icon>vertical_align_top</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.verticalAlign === 'center' }\"\n (click)=\"verticalAlignClick('center')\">\n <mat-icon>vertical_align_center</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.verticalAlign === 'bottom' }\"\n (click)=\"verticalAlignClick('bottom')\">\n <mat-icon>vertical_align_bottom</mat-icon>\n </button>\n </div>\n </div>\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Border</div>\n\n <div class=\"sidebar-row\">\n <fs-color-picker-chip\n (changed)=\"borderColorChange($event)\"\n [color]=\"block.borderColor\">\n </fs-color-picker-chip>\n\n <mat-form-field class=\"form-field-padless border-width\" floatLabel=\"never\">\n <input\n matInput\n [(ngModel)]=\"block.borderWidth\"\n name=\"borderWidth\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"borderWidthChange($event)\"\n placeholder=\"Width\">\n <span matPrefix *ngIf=\"block.borderWidth\">W</span>\n </mat-form-field>\n </div>\n </div>\n\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Shape</div>\n\n <div class=\"sidebar-row\">\n <fs-color-picker-chip\n (changed)=\"backgroundColorChange($event)\"\n [color]=\"block.backgroundColor\">\n </fs-color-picker-chip>\n\n <mat-form-field class=\"form-field-padless shape-radius\" floatLabel=\"never\">\n <input\n matInput\n [(ngModel)]=\"block.shapeRadius\"\n name=\"shapeRadius\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"shapeRadiusChange($event)\"\n placeholder=\"Radius\">\n <span matPrefix *ngIf=\"block.shapeRadius\">R</span>\n </mat-form-field>\n\n <div class=\"shape-corners\">\n <div\n class=\"shape-corner shape-corner-top-left\"\n [ngClass]=\"{ round: block.shapeTopLeft === 'round' }\"\n (click)=\"shapeRound('shapeTopLeft')\"></div>\n <div\n class=\"shape-corner shape-corner-top-right\"\n [ngClass]=\"{ round: block.shapeTopRight === 'round' }\"\n (click)=\"shapeRound('shapeTopRight')\"></div>\n <div\n class=\"shape-corner shape-corner-bottom-left\"\n [ngClass]=\"{ round: block.shapeBottomLeft === 'round' }\"\n (click)=\"shapeRound('shapeBottomLeft')\"></div>\n <div\n class=\"shape-corner shape-corner-bottom-right\"\n [ngClass]=\"{ round: block.shapeBottomRight === 'round' }\"\n (click)=\"shapeRound('shapeBottomRight')\"></div>\n </div>\n </div>\n </div>\n <ng-container *ngIf=\"block.type !== BlockType.Pdf\">\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Image</div>\n <div class=\"sidebar-row image-row\">\n <fs-file (select)=\"imageSelect($event)\">\n <button type=\"button\" mat-icon-button><mat-icon>cloud_upload</mat-icon></button>\n </fs-file>\n <ng-container *ngIf=\"block.imageUrl\">\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"imageRemove()\">\n <mat-icon>clear</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: clippable }\"\n (click)=\"imageClip()\">\n <mat-icon>crop</mat-icon>\n </button>\n </ng-container>\n </div>\n </div>\n </ng-container>\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Padding</div>\n <div class=\"sidebar-row padding-row\">\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.padding\"\n name=\"padding\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"paddingAllChange($event)\"\n placeholder=\"All\">\n <span matPrefix *ngIf=\"block.padding\">A</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingTop\"\n name=\"paddingTop\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"paddingChange('paddingTop',$event)\"\n placeholder=\"Top\">\n <span matPrefix *ngIf=\"block.paddingTop\">T</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingBottom\"\n name=\"paddingBottom\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"paddingChange('paddingBottom',$event)\"\n placeholder=\"Bottom\">\n <span matPrefix *ngIf=\"block.paddingBottom\">B</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingLeft\"\n name=\"paddingLeft\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"paddingChange('paddingLeft',$event)\"\n placeholder=\"Left\">\n <span matPrefix *ngIf=\"block.paddingLeft\">L</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingRight\"\n name=\"paddingRight\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"paddingChange('paddingRight',$event)\"\n placeholder=\"Right\">\n <span matPrefix *ngIf=\"block.paddingRight\">R</span>\n </mat-form-field>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngFor=\"let sidebarPanel of sidebarPanels\">\n <div div class=\"sidebar-panel\" *ngIf=\"sidebarPanel.show\">\n <div class=\"sidebar-label\">{{sidebarPanel.label}}</div>\n <ng-container\n [ngTemplateOutlet]=\"sidebarPanel.templateRef\"\n [ngTemplateOutletContext]=\"{ block: block }\"></ng-container>\n </div>\n </ng-container>\n</div>\n\n", styles: [".sidebar{width:285px;font-size:14px;height:100%;overflow:auto;background-color:#fff;padding:0 10px 10px;box-shadow:-1px 1px 4px 3px #0003;z-index:1;position:relative;box-sizing:border-box}.sidebar .sidebar-row{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center}.sidebar .sidebar-row fs-color-picker-chip{margin-left:6px}.sidebar .sidebar-row.padding-row{flex-wrap:unset}.sidebar .sidebar-row.padding-row ::ng-deep .mat-form-field{width:20%;min-width:0}.sidebar .sidebar-row.image-row{margin-bottom:-5px}.sidebar .sidebar-row ::ng-deep .mat-checkbox,.sidebar .sidebar-row ::ng-deep .mat-form-field{font-size:12px}.sidebar .sidebar-row>*:not(.mat-icon-button):not(fs-file){margin-right:11px}.sidebar .sidebar-row>*:not(.mat-icon-button):not(fs-file):last-child{margin-right:0}.sidebar .layer-up ::ng-deep .mat-button-wrapper,.sidebar .layer-down ::ng-deep .mat-button-wrapper{position:relative}.sidebar .layer-up ::ng-deep .mat-button-wrapper mat-icon:first-child,.sidebar .layer-down ::ng-deep .mat-button-wrapper mat-icon:first-child{position:absolute;transform:rotate(90deg) scale(.5);top:-7px;color:#fff}.sidebar .layer-down mat-icon:first-child{transform:rotate(270deg) scale(.6)}.sidebar .padding{width:45px}.sidebar .line-height,.sidebar .font-size,.sidebar .border-width{width:45px}.sidebar .shape-radius{width:50px}.sidebar .shape-corners{display:grid;grid-template-columns:1fr 1fr;grid-column-gap:1px;column-gap:1px;grid-row-gap:1px;row-gap:1px}.sidebar .shape-corners .shape-corner{height:13px;width:13px;background-color:#ccc;cursor:pointer}.sidebar .shape-corners .shape-corner.round.shape-corner-top-right{border-top-right-radius:50%}.sidebar .shape-corners .shape-corner.round.shape-corner-top-left{border-top-left-radius:50%}.sidebar .shape-corners .shape-corner.round.shape-corner-bottom-left{border-bottom-left-radius:50%}.sidebar .shape-corners .shape-corner.round.shape-corner-bottom-right{border-bottom-right-radius:50%}.sidebar button.toggle-button:not(.selected) mat-icon{color:#ccc}.sidebar .sidebar-panel{padding:10px}.sidebar .sidebar-panel+.sidebar-panel{border-top:1px solid #dadada}.sidebar .sidebar-panel.block-form-panel .sidebar-label{display:flex;align-items:center}.sidebar .sidebar-panel.block-form-panel .sidebar-label mat-icon{transform:scale(.8);color:inherit;margin-left:-5px}.sidebar .sidebar-panel.block-form-panel mat-form-field+mat-form-field{margin-top:12px}.sidebar .sidebar-panel.block-form-panel .form-field-options{margin-top:11px}.sidebar .sidebar-panel.block-form-panel .form-field-options mat-checkbox{display:block}.sidebar .sidebar-panel.block-form-panel .form-field-options mat-checkbox+mat-checkbox{margin-top:2px}.sidebar .sidebar-panel.info-panel .sidebar-row+.sidebar-row{margin-top:12px}.sidebar .sidebar-panel.info-panel .sidebar-row .mat-form-field{width:41px}.sidebar .sidebar-panel.typography-panel .style-row{margin-bottom:-10px}.sidebar .sidebar-panel.typography-panel .align-row{margin-bottom:-5px}.sidebar .sidebar-panel .sidebar-label{font-size:11px;margin-bottom:7px;color:#9e9e9e}.sidebar .sidebar-panel .keep-ratio{color:inherit;transform:scale(.85);display:block}.full-width{width:100%}:host ::ng-deep .mat-form-field-prefix{color:#9e9e9e;margin-right:3px;font-size:85%}\n"], components: [{ type: i3__namespace$1.FsFileComponent, selector: "fs-file", inputs: ["minHeight", "minWidth", "multiple", "capture", "allowClick", "allowDrop", "accept", "disabled", "imageWidth", "imageHeight", "imageQuality"], outputs: ["select", "error", "clicked", "declined"] }, { type: i6__namespace.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i3__namespace.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i6__namespace$1.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i7__namespace$1.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i8__namespace.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i9__namespace.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "id", "labelPosition", "name", "required", "checked", "disabled", "indeterminate", "aria-describedby", "value"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: i10__namespace.FsColorPickerChipComponent, selector: "fs-color-picker-chip", inputs: ["color"], outputs: ["changed"] }], directives: [{ type: i11__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i11__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i11__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i11__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i11__namespace.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i12__namespace.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i11__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i13__namespace.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i14__namespace.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i14__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i14__namespace.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i6__namespace$1.MatPrefix, selector: "[matPrefix]" }, { type: i13__namespace.MatTextareaAutosize, selector: "textarea[mat-autosize], textarea[matTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "matAutosizeMinRows", "matAutosizeMaxRows", "mat-autosize", "matTextareaAutosize"], exportAs: ["matTextareaAutosize"] }, { type: i6__namespace$1.MatLabel, selector: "mat-label" }, { type: i11__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
1571
|
+
SidebarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SidebarComponent, deps: [{ token: i0__namespace.ElementRef }, { token: BlockEditorService }, { token: i0__namespace.ChangeDetectorRef }, { token: i2__namespace$1.FsPrompt }, { token: GoogleFontService }, { token: i13.DOCUMENT }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1572
|
+
SidebarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SidebarComponent, selector: "sidebar", inputs: { config: "config", blocks: "blocks" }, outputs: { zoomCenter: "zoomCenter" }, queries: [{ propertyName: "sidebarPanels", predicate: FsBlockEditorSidebarPanelDirective }], ngImport: i0__namespace, template: "<div class=\"sidebar\">\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-row\">\n <ng-container *ngFor=\"let blockType of BlockTypes\">\n <ng-container [ngSwitch]=\"blockType.value\">\n <ng-container *ngSwitchCase=\"BlockType.Pdf\">\n <ng-container *ngTemplateOutlet=\"addFile\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"BlockType.Image\">\n <ng-container *ngTemplateOutlet=\"addFile\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container *ngTemplateOutlet=\"addButton\"></ng-container>\n </ng-container>\n </ng-container>\n\n <ng-template #addFile>\n <fs-file (select)=\"blockUpload(blockType.value, $event)\" [accept]=\"blockType.accept\">\n <ng-container *ngTemplateOutlet=\"addButton\"></ng-container>\n </fs-file>\n </ng-template>\n\n <ng-template #addButton>\n <button\n type=\"button\"\n mat-icon-button\n [matTooltip]=\"'Add ' + blockType.name\"\n (click)=\"blockAdd(blockType.value)\">\n <mat-icon>{{blockType.icon}}</mat-icon>\n </button>\n </ng-template>\n </ng-container>\n </div>\n </div>\n\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-row\">\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n matTooltip=\"Reset zoom\"\n (click)=\"zoomCenter.emit()\">\n <mat-icon>crop_free</mat-icon>\n </button>\n <button\n class=\"reorder-layers\"\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"reorderLayers()\">\n <mat-icon>swap_vert</mat-icon>\n </button>\n <ng-container *ngIf=\"block\">\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"blockRemoveClick()\">\n <mat-icon>delete_outline</mat-icon>\n </button>\n <button\n class=\"layer-up\"\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"layerUp()\">\n <mat-icon>arrow_back</mat-icon>\n <mat-icon>layers</mat-icon>\n </button>\n <button\n class=\"layer-down\"\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"layerDown()\">\n <mat-icon>arrow_back</mat-icon>\n <mat-icon>layers</mat-icon>\n </button>\n </ng-container>\n </div>\n </div>\n <ng-container *ngIf=\"block\">\n <div class=\"sidebar-panel info-panel\">\n <div class=\"sidebar-label\">Info</div>\n <div class=\"sidebar-row\">\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.left\"\n name=\"left\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'left', .01)\"\n (ngModelChange)=\"numberChange($event, 'left')\">\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 (keydown)=\"numericInputKeypress($event, 'top', .01)\"\n (ngModelChange)=\"numberChange($event, 'top')\">\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\"\n name=\"rotate\"\n (focus)=\"inputFocus($event)\" \n (keydown)=\"numericInputKeypress($event, 'rotate')\"\n (ngModelChange)=\"numberChange($event, 'rotate')\">\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 (keydown)=\"numericInputKeypress($event, 'width', .01)\"\n (ngModelChange)=\"numberChange($event, 'width')\">\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 (keydown)=\"numericInputKeypress($event, 'height', .01)\"\n (ngModelChange)=\"numberChange($event, 'height')\">\n <span matPrefix>H</span>\n </mat-form-field>\n </div>\n </div>\n <ng-container *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText || block.type === BlockType.RadioButton || block.type === BlockType.Checkbox || block.type === BlockType.Date || block.type === BlockType.Signature\">\n <div class=\"sidebar-panel block-form-panel\">\n <div class=\"sidebar-label\">\n <mat-icon>{{blockTypeIcons[block.type]}}</mat-icon>\n {{blockTypeNames[block.type]}}</div>\n <div class=\"sidebar-row\">\n\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <input\n matInput\n [ngModel]=\"block.label\"\n name=\"label\"\n placeholder=\"Label\"\n (ngModelChange)=\"blockChangeProperty($event, 'label')\">\n </mat-form-field>\n\n <ng-container *ngIf=\"block.type !== BlockType.Checkbox && block.type !== BlockType.RadioButton\">\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <textarea\n matInput\n [matTextareaAutosize]=\"true\"\n [ngModel]=\"block.description\"\n name=\"description\"\n placeholder=\"Description\"\n (ngModelChange)=\"blockChangeProperty($event, 'description')\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <mat-form-field\n *ngIf=\"formats.length\"\n class=\"form-field-padless-bottom full-width\">\n <mat-label>Format</mat-label>\n <mat-select\n [(ngModel)]=\"block.format\"\n name=\"format\"\n (ngModelChange)=\"blockChangeProperty($event, 'format')\">\n <mat-option [value]=\"null\">\n None\n </mat-option>\n <mat-option\n *ngFor=\"let item of formats\"\n [value]=\"item.value\">\n {{ item.name }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n\n <ng-container *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText || block.type === BlockType.Date\">\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <textarea\n matInput\n [matTextareaAutosize]=\"true\"\n [ngModel]=\"block.default\"\n name=\"default\"\n placeholder=\"Default\"\n (ngModelChange)=\"blockChangeProperty($event, 'default')\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <ng-container *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText\">\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <textarea\n matInput\n [matTextareaAutosize]=\"true\"\n [ngModel]=\"block.formula\"\n name=\"formula\"\n placeholder=\"Formula\"\n (ngModelChange)=\"blockChangeProperty($event, 'formula')\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <ng-container *ngIf=\"block.type === BlockType.RadioButton || block.type === BlockType.Checkbox\">\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <textarea\n matInput\n [matTextareaAutosize]=\"true\"\n [ngModel]=\"block.groupLabel\"\n name=\"groupLabel\"\n placeholder=\"Group Label\"\n (ngModelChange)=\"blockChangeProperty($event, 'groupLabel')\">\n </textarea>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <mat-label>Group Description</mat-label>\n <textarea\n matInput\n [matTextareaAutosize]=\"true\"\n [ngModel]=\"block.groupDescription\"\n name=\"groupDescription\"\n (ngModelChange)=\"blockChangeProperty($event, 'groupDescription')\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <input\n matInput\n [ngModel]=\"block.name\"\n name=\"name\"\n placeholder=\"Name\"\n (ngModelChange)=\"blockChangeProperty($event, 'name')\">\n </mat-form-field>\n\n <div class=\"form-field-options\">\n <mat-checkbox\n name=\"required\"\n [(ngModel)]=\"block.required\"\n (ngModelChange)=\"blockChangeProperty($event, 'required')\">\n Required\n </mat-checkbox>\n\n <mat-checkbox\n name=\"readonly\"\n [(ngModel)]=\"block.readonly\"\n (ngModelChange)=\"blockChangeProperty($event, 'readonly')\">\n Readonly\n </mat-checkbox>\n </div>\n </div>\n </div>\n </ng-container>\n <div class=\"sidebar-panel typography-panel\">\n <div class=\"sidebar-label\">Typography</div>\n <div class=\"sidebar-row\">\n <fs-autocomplete\n [fetch]=\"fontFetch\"\n [fetchOnFocus]=\"true\"\n [displayWith]=\"fontDisplayWith\"\n [ngModel]=\"block.fontFamily ? { family: block.fontFamily } : null\"\n placeholder=\"Font\"\n [panelClass]=\"'font-autocomplete-panel'\"\n (ngModelChange)=\"fontChanged($event)\"\n name=\"fontfamily\">\n <ng-template fsAutocompleteTemplate let-data=\"data\">\n <app-font [font]=\"data\"></app-font>\n </ng-template>\n </fs-autocomplete>\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 (keydown)=\"numericInputKeypress($event, 'fontSize')\"\n (ngModelChange)=\"numberChange($event, 'fontSize')\"\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 (keydown)=\"numericInputKeypress($event, 'lineHeight')\"\n (ngModelChange)=\"numberChange($event, 'lineHeight')\"\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 === 'justify' }\"\n (click)=\"horizontalAlignClick('justify')\">\n <mat-icon>format_align_justify</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 (keydown)=\"numericInputKeypress($event, 'borderWidth')\"\n (ngModelChange)=\"numberChange($event, 'borderWidth')\"\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 (keydown)=\"numericInputKeypress($event, 'shapeRadius', 1)\"\n (ngModelChange)=\"numberChange($event, 'shapeRadius')\"\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\n <div class=\"sidebar-panel shadow-panel\">\n <div class=\"sidebar-label\">Shadow</div>\n\n <div class=\"sidebar-row\">\n <fs-color-picker-chip\n (changed)=\"shadowColorChange($event)\"\n [color]=\"block.shadowColor\">\n </fs-color-picker-chip>\n\n <mat-form-field class=\"form-field-padless shadow-x\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shadowX\"\n name=\"shadowX\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'shadowX')\"\n (ngModelChange)=\"numberChange($event, 'shadowX')\">\n <span matPrefix>X</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless shadow-y\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shadowY\"\n name=\"shadowY\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'shadowY')\"\n (ngModelChange)=\"numberChange($event, 'shadowY')\">\n <span matPrefix>Y</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless shadow-blur\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shadowBlur\"\n name=\"shadowBlur\"\n placeholder=\"Blur\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'shadowBlur')\"\n (ngModelChange)=\"numberChange($event, 'shadowBlur')\">\n <span matPrefix *ngIf=\"block.shadowBlur\">B</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shadowSpread\"\n name=\"shadowSpread\"\n placeholder=\"Spread\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'shadowSpread')\"\n (ngModelChange)=\"numberChange($event, 'shadowSpread')\">\n <span matPrefix *ngIf=\"block.shadowSpread\">S</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shadowOpacity\"\n name=\"shadowOpacity\"\n placeholder=\"Opacity\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'shadowOpacity')\"\n (ngModelChange)=\"numberChange($event, 'shadowOpacity')\">\n <span matPrefix *ngIf=\"block.shadowOpacity\">O</span>\n </mat-form-field>\n </div>\n </div>\n\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 \n type=\"button\" \n mat-icon-button>\n <mat-icon>cloud_upload</mat-icon>\n </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 (keydown)=\"paddingAllKeypress($event, 1)\"\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 (keydown)=\"paddingKeypress($event, 'paddingTop')\"\n (ngModelChange)=\"numberChange($event, 'paddingTop')\"\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 (keydown)=\"paddingKeypress($event, 'paddingBottom')\"\n (ngModelChange)=\"numberChange($event, 'paddingBottom')\"\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 (keydown)=\"paddingKeypress($event, 'paddingLeft')\"\n (ngModelChange)=\"numberChange($event, 'paddingLeft')\"\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 (keydown)=\"paddingKeypress($event, 'paddingRight')\"\n (ngModelChange)=\"numberChange($event, 'paddingRight')\"\n placeholder=\"Right\">\n <span matPrefix *ngIf=\"block.paddingRight\">R</span>\n </mat-form-field>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngFor=\"let sidebarPanel of sidebarPanels\">\n <div div class=\"sidebar-panel\" *ngIf=\"sidebarPanel.show\">\n <div class=\"sidebar-label\">{{sidebarPanel.label}}</div>\n <ng-container\n [ngTemplateOutlet]=\"sidebarPanel.templateRef\"\n [ngTemplateOutletContext]=\"{ block: block }\"></ng-container>\n </div>\n </ng-container>\n</div>\n\n", styles: [".sidebar{width:285px;font-size:14px;height:100%;overflow:auto;background-color:#fff;padding:0 10px 10px;box-shadow:-1px 1px 4px 3px #0003;z-index:1;position:relative;box-sizing:border-box}.sidebar .sidebar-row{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center}.sidebar .sidebar-row+.sidebar-row{margin-top:12px}.sidebar .sidebar-row fs-color-picker-chip{margin-left:6px}.sidebar .sidebar-row.padding-row{flex-wrap:unset}.sidebar .sidebar-row.padding-row ::ng-deep .mat-form-field{width:20%;min-width:0}.sidebar .sidebar-row.image-row{margin-bottom:-5px}.sidebar .sidebar-row ::ng-deep .mat-checkbox,.sidebar .sidebar-row ::ng-deep .mat-form-field{font-size:12px}.sidebar .sidebar-row>*:not(.mat-icon-button):not(fs-file){margin-right:11px}.sidebar .sidebar-row>*:not(.mat-icon-button):not(fs-file):last-child{margin-right:0}.sidebar .layer-up ::ng-deep .mat-button-wrapper,.sidebar .layer-down ::ng-deep .mat-button-wrapper{position:relative}.sidebar .layer-up ::ng-deep .mat-button-wrapper mat-icon:first-child,.sidebar .layer-down ::ng-deep .mat-button-wrapper mat-icon:first-child{position:absolute;transform:rotate(90deg) scale(.5);top:-7px;color:#fff}.sidebar .layer-down mat-icon:first-child{transform:rotate(270deg) scale(.6)}.sidebar .padding{width:45px}.sidebar .line-height,.sidebar .font-size,.sidebar .border-width{width:45px}.sidebar .shape-radius{width:50px}.sidebar .shape-corners{display:grid;grid-template-columns:1fr 1fr;grid-column-gap:1px;column-gap:1px;grid-row-gap:1px;row-gap:1px}.sidebar .shape-corners .shape-corner{height:13px;width:13px;background-color:#ccc;cursor:pointer}.sidebar .shape-corners .shape-corner.round.shape-corner-top-right{border-top-right-radius:50%}.sidebar .shape-corners .shape-corner.round.shape-corner-top-left{border-top-left-radius:50%}.sidebar .shape-corners .shape-corner.round.shape-corner-bottom-left{border-bottom-left-radius:50%}.sidebar .shape-corners .shape-corner.round.shape-corner-bottom-right{border-bottom-right-radius:50%}.sidebar button.toggle-button:not(.selected) mat-icon{color:#ccc}.sidebar .sidebar-panel{padding:10px}.sidebar .sidebar-panel+.sidebar-panel{border-top:1px solid #dadada}.sidebar .sidebar-panel.block-form-panel .sidebar-label{display:flex;align-items:center}.sidebar .sidebar-panel.block-form-panel .sidebar-label mat-icon{transform:scale(.8);color:inherit;margin-left:-5px}.sidebar .sidebar-panel.block-form-panel mat-form-field+mat-form-field{margin-top:12px}.sidebar .sidebar-panel.block-form-panel .form-field-options{margin-top:11px}.sidebar .sidebar-panel.block-form-panel .form-field-options mat-checkbox{display:block}.sidebar .sidebar-panel.block-form-panel .form-field-options mat-checkbox+mat-checkbox{margin-top:2px}.sidebar .sidebar-panel.info-panel .mat-form-field{width:41px}.sidebar .sidebar-panel.shadow-panel .mat-form-field{width:41px}.sidebar .sidebar-panel.shadow-panel .mat-form-field.shadow-x,.sidebar .sidebar-panel.shadow-panel .mat-form-field.shadow-y,.sidebar .sidebar-panel.shadow-panel .mat-form-field.shadow-blur{width:26px}.sidebar .sidebar-panel.typography-panel fs-autocomplete{width:100%}.sidebar .sidebar-panel.typography-panel .style-row{margin-bottom:-10px}.sidebar .sidebar-panel.typography-panel .align-row{margin-bottom:-5px}.sidebar .sidebar-panel.typography-panel .align-row .mat-icon-button{width:35px;height:35px;line-height:35px}.sidebar .sidebar-panel .sidebar-label{font-size:11px;margin-bottom:7px;color:#9e9e9e}.sidebar .sidebar-panel .keep-ratio{color:inherit;transform:scale(.85);display:block}.full-width{width:100%}:host ::ng-deep .mat-form-field-prefix{color:#9e9e9e;margin-right:3px;font-size:85%}\n"], components: [{ type: i3__namespace$1.FsFileComponent, selector: "fs-file", inputs: ["minHeight", "minWidth", "orientate", "multiple", "capture", "allowClick", "allowDrop", "accept", "disabled", "imageWidth", "imageHeight", "imageQuality"], outputs: ["select", "error", "clicked", "declined"] }, { type: i6__namespace.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i3__namespace.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i6__namespace$1.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i7__namespace$1.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i8__namespace.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i9__namespace.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "id", "labelPosition", "name", "required", "checked", "disabled", "indeterminate", "aria-describedby", "value"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: i10__namespace.FsAutocompleteComponent, selector: "fs-autocomplete", inputs: ["fetch", "placeholder", "displayWith", "fetchOnFocus", "readonly", "required", "disabled", "appearance", "hint", "panelWidth", "panelClass", "showClear"], outputs: ["cleared", "opened", "closed"] }, { type: FontComponent, selector: "app-font", inputs: ["font"] }, { type: i12__namespace.FsColorPickerChipComponent, selector: "fs-color-picker-chip", inputs: ["color", "showClear"], outputs: ["changed"] }], directives: [{ type: i13__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i13__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i13__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i13__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i13__namespace.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i14__namespace.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i13__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i15__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: i16__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: i16__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i16__namespace.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i6__namespace$1.MatPrefix, selector: "[matPrefix]" }, { type: i15__namespace.MatTextareaAutosize, selector: "textarea[mat-autosize], textarea[matTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "matAutosizeMinRows", "matAutosizeMaxRows", "mat-autosize", "matTextareaAutosize"], exportAs: ["matTextareaAutosize"] }, { type: i6__namespace$1.MatLabel, selector: "mat-label" }, { type: i10__namespace.FsAutocompleteTemplateDirective, selector: "[fsAutocompleteTemplate]" }, { type: i13__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
1452
1573
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SidebarComponent, decorators: [{
|
|
1453
1574
|
type: i0.Component,
|
|
1454
1575
|
args: [{
|
|
@@ -1458,9 +1579,9 @@
|
|
|
1458
1579
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
1459
1580
|
}]
|
|
1460
1581
|
}], ctorParameters: function () {
|
|
1461
|
-
return [{ type: i0__namespace.ElementRef }, { type: BlockEditorService }, { type: i0__namespace.ChangeDetectorRef }, { type: i2__namespace$1.FsPrompt }, { type: undefined, decorators: [{
|
|
1582
|
+
return [{ type: i0__namespace.ElementRef }, { type: BlockEditorService }, { type: i0__namespace.ChangeDetectorRef }, { type: i2__namespace$1.FsPrompt }, { type: GoogleFontService }, { type: undefined, decorators: [{
|
|
1462
1583
|
type: i0.Inject,
|
|
1463
|
-
args: [
|
|
1584
|
+
args: [i13.DOCUMENT]
|
|
1464
1585
|
}] }];
|
|
1465
1586
|
}, propDecorators: { sidebarPanels: [{
|
|
1466
1587
|
type: i0.ContentChildren,
|
|
@@ -1496,14 +1617,12 @@
|
|
|
1496
1617
|
}], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }]; } });
|
|
1497
1618
|
|
|
1498
1619
|
var ArtboardComponent = /** @class */ (function () {
|
|
1499
|
-
function ArtboardComponent(_el, _blockEditor, _cdRef
|
|
1620
|
+
function ArtboardComponent(_el, _blockEditor, _cdRef) {
|
|
1500
1621
|
this._el = _el;
|
|
1501
1622
|
this._blockEditor = _blockEditor;
|
|
1502
1623
|
this._cdRef = _cdRef;
|
|
1503
|
-
this._differs = _differs;
|
|
1504
1624
|
this.blocks = [];
|
|
1505
1625
|
this._destroy$ = new rxjs.Subject();
|
|
1506
|
-
this._differ = _differs.find([]).create(null);
|
|
1507
1626
|
}
|
|
1508
1627
|
Object.defineProperty(ArtboardComponent.prototype, "el", {
|
|
1509
1628
|
get: function () {
|
|
@@ -1532,6 +1651,9 @@
|
|
|
1532
1651
|
rxjs.fromEvent(window, 'keydown')
|
|
1533
1652
|
.pipe(operators.filter(function (event) {
|
|
1534
1653
|
return ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].indexOf(event.key) !== -1;
|
|
1654
|
+
}), operators.filter(function () {
|
|
1655
|
+
var el = document.activeElement;
|
|
1656
|
+
return !(el instanceof HTMLInputElement || (el && el.classList.contains('content-editable')));
|
|
1535
1657
|
}), operators.takeUntil(this._destroy$))
|
|
1536
1658
|
.subscribe(function (event) {
|
|
1537
1659
|
event.preventDefault();
|
|
@@ -1552,34 +1674,18 @@
|
|
|
1552
1674
|
blockComponent.left = blockComponent.block.left + inchPixel;
|
|
1553
1675
|
break;
|
|
1554
1676
|
}
|
|
1677
|
+
_this._blockEditor.blockChange(blockComponent.block);
|
|
1555
1678
|
});
|
|
1556
1679
|
});
|
|
1557
1680
|
};
|
|
1558
|
-
ArtboardComponent.prototype.ngAfterViewInit = function () {
|
|
1559
|
-
// this.blockComponents.changes
|
|
1560
|
-
// .pipe(
|
|
1561
|
-
// takeUntil(this._destroy$),
|
|
1562
|
-
// )
|
|
1563
|
-
// .subscribe((changes) => {
|
|
1564
|
-
// const changeDiff = this._differ.diff(changes);
|
|
1565
|
-
// if (changeDiff) {
|
|
1566
|
-
// changeDiff.forEachAddedItem((change) => {
|
|
1567
|
-
// //this.blockAdded.emit(change.item);
|
|
1568
|
-
// });
|
|
1569
|
-
// changeDiff.forEachRemovedItem((change) => {
|
|
1570
|
-
// //this.blockRemoved.emit(change.item);
|
|
1571
|
-
// });
|
|
1572
|
-
// }
|
|
1573
|
-
// });
|
|
1574
|
-
};
|
|
1575
1681
|
ArtboardComponent.prototype.ngOnDestroy = function () {
|
|
1576
1682
|
this._destroy$.next();
|
|
1577
1683
|
this._destroy$.complete();
|
|
1578
1684
|
};
|
|
1579
1685
|
return ArtboardComponent;
|
|
1580
1686
|
}());
|
|
1581
|
-
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 }
|
|
1582
|
-
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;background-color:#fff}.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:
|
|
1687
|
+
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 }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1688
|
+
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;background-color:#fff}.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: i13__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i13__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
1583
1689
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ArtboardComponent, decorators: [{
|
|
1584
1690
|
type: i0.Component,
|
|
1585
1691
|
args: [{
|
|
@@ -1588,7 +1694,7 @@
|
|
|
1588
1694
|
styleUrls: ['artboard.component.scss'],
|
|
1589
1695
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
1590
1696
|
}]
|
|
1591
|
-
}], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: BlockEditorService }, { type: i0__namespace.ChangeDetectorRef }
|
|
1697
|
+
}], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: BlockEditorService }, { type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { sidebarPanels: [{
|
|
1592
1698
|
type: i0.ContentChildren,
|
|
1593
1699
|
args: [FsBlockEditorSidebarPanelDirective]
|
|
1594
1700
|
}], blockComponents: [{
|
|
@@ -1658,7 +1764,7 @@
|
|
|
1658
1764
|
FsBlockEditorComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsBlockEditorComponent, selector: "fs-block-editor", inputs: { config: "config" }, providers: [
|
|
1659
1765
|
BlockEditorService,
|
|
1660
1766
|
BlocksStore,
|
|
1661
|
-
], queries: [{ propertyName: "sidebarPanels", predicate: FsBlockEditorSidebarPanelDirective }], viewQueries: [{ propertyName: "zoompan", first: true, predicate: i2$2.FsZoomPanComponent, descendants: true, static: true }, { propertyName: "artboardContainer", first: true, predicate: ["artboardContainer"], descendants: true, static: true }, { propertyName: "sidebar", first: true, predicate: SidebarComponent, descendants: true, static: true }, { propertyName: "artboard", first: true, predicate: ArtboardComponent, descendants: true, read: i0.ElementRef }], ngImport: i0__namespace, template: "<div \n class=\"editor-container deselectable\"\n (mousedown)=\"editorContainerClick($event)\">\n <div\n
|
|
1767
|
+
], queries: [{ propertyName: "sidebarPanels", predicate: FsBlockEditorSidebarPanelDirective }], viewQueries: [{ propertyName: "zoompan", first: true, predicate: i2$2.FsZoomPanComponent, descendants: true, static: true }, { propertyName: "artboardContainer", first: true, predicate: ["artboardContainer"], descendants: true, static: true }, { propertyName: "sidebar", first: true, predicate: SidebarComponent, descendants: true, static: true }, { propertyName: "artboard", first: true, predicate: ArtboardComponent, descendants: true, read: i0.ElementRef }], ngImport: i0__namespace, template: "<div \n class=\"editor-container deselectable\"\n (mousedown)=\"editorContainerClick($event)\">\n <div\n #artboardContainer\n class=\"artboard-container deselectable\">\n <div #zoomPanContaner class=\"zoom-pan-container deselectable\">\n <fs-zoom-pan \n class=\"deselectable\"\n [zoomMax]=\"5\"\n [top]=\"10\">\n <ng-template fsZoomPanContent>\n <app-artboard \n [zoompan]=\"zoompan\"\n [config]=\"config\">\n </app-artboard>\n </ng-template>\n </fs-zoom-pan>\n </div>\n </div>\n <sidebar\n [config]=\"config\"\n [blocks]=\"blocks\"\n (zoomCenter)=\"zoomCenter()\">\n </sidebar>\n</div>\n", styles: [".editor-container{display:flex;flex-direction:row;position:relative;height:100%;background:#d8d8d8;overflow:hidden}.editor-container .artboard-container{display:flex;flex-grow:1;min-width:0}.editor-container .zoom-pan-container{flex:1}fs-zoom-pan{height:100%}\n"], components: [{ type: i2__namespace$2.FsZoomPanComponent, selector: "fs-zoom-pan", inputs: ["zoomMax", "zoomMin", "zoomDefault", "top", "left"], outputs: ["moved", "zoomed"] }, { type: ArtboardComponent, selector: "app-artboard", inputs: ["config", "zoompan"] }, { type: SidebarComponent, selector: "sidebar", inputs: ["config", "blocks"], outputs: ["zoomCenter"] }], directives: [{ type: i2__namespace$2.FsZoomPanContentDirective, selector: "[fsZoomPanContent]" }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
1662
1768
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockEditorComponent, decorators: [{
|
|
1663
1769
|
type: i0.Component,
|
|
1664
1770
|
args: [{
|
|
@@ -1707,61 +1813,67 @@
|
|
|
1707
1813
|
FsBlockEditorMarginDirective,
|
|
1708
1814
|
SidebarComponent,
|
|
1709
1815
|
ArtboardComponent,
|
|
1710
|
-
LayersReorderDialogComponent
|
|
1711
|
-
|
|
1816
|
+
LayersReorderDialogComponent,
|
|
1817
|
+
FontComponent], imports: [i13.CommonModule,
|
|
1818
|
+
i16.FormsModule,
|
|
1712
1819
|
i3.MatIconModule,
|
|
1713
1820
|
i6.MatButtonModule,
|
|
1714
|
-
|
|
1821
|
+
i15.MatInputModule,
|
|
1715
1822
|
i6$1.MatFormFieldModule,
|
|
1716
1823
|
i9.MatCheckboxModule,
|
|
1717
|
-
|
|
1824
|
+
i14.MatTooltipModule,
|
|
1718
1825
|
i7$1.MatSelectModule,
|
|
1719
1826
|
i4.MatListModule,
|
|
1720
1827
|
i7.DragDropModule,
|
|
1721
1828
|
i3$1.FsFileModule,
|
|
1722
|
-
|
|
1829
|
+
i12.FsColorPickerModule,
|
|
1723
1830
|
menu.FsMenuModule,
|
|
1724
1831
|
i2$2.FsZoomPanModule,
|
|
1832
|
+
i10.FsAutocompleteModule,
|
|
1725
1833
|
i2.FsDialogModule], exports: [FsBlockComponent,
|
|
1726
1834
|
FsBlockEditorComponent,
|
|
1727
1835
|
FsBlockEditorSidebarPanelDirective] });
|
|
1728
|
-
FsBlockEditorModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockEditorModule,
|
|
1729
|
-
|
|
1730
|
-
|
|
1836
|
+
FsBlockEditorModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockEditorModule, providers: [
|
|
1837
|
+
GoogleFontService,
|
|
1838
|
+
], imports: [[
|
|
1839
|
+
i13.CommonModule,
|
|
1840
|
+
i16.FormsModule,
|
|
1731
1841
|
i3.MatIconModule,
|
|
1732
1842
|
i6.MatButtonModule,
|
|
1733
|
-
|
|
1843
|
+
i15.MatInputModule,
|
|
1734
1844
|
i6$1.MatFormFieldModule,
|
|
1735
1845
|
i9.MatCheckboxModule,
|
|
1736
|
-
|
|
1846
|
+
i14.MatTooltipModule,
|
|
1737
1847
|
i7$1.MatSelectModule,
|
|
1738
1848
|
i4.MatListModule,
|
|
1739
1849
|
i7.DragDropModule,
|
|
1740
1850
|
i3$1.FsFileModule,
|
|
1741
|
-
|
|
1851
|
+
i12.FsColorPickerModule,
|
|
1742
1852
|
menu.FsMenuModule,
|
|
1743
1853
|
i2$2.FsZoomPanModule,
|
|
1854
|
+
i10.FsAutocompleteModule,
|
|
1744
1855
|
i2.FsDialogModule,
|
|
1745
1856
|
]] });
|
|
1746
1857
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockEditorModule, decorators: [{
|
|
1747
1858
|
type: i0.NgModule,
|
|
1748
1859
|
args: [{
|
|
1749
1860
|
imports: [
|
|
1750
|
-
|
|
1751
|
-
|
|
1861
|
+
i13.CommonModule,
|
|
1862
|
+
i16.FormsModule,
|
|
1752
1863
|
i3.MatIconModule,
|
|
1753
1864
|
i6.MatButtonModule,
|
|
1754
|
-
|
|
1865
|
+
i15.MatInputModule,
|
|
1755
1866
|
i6$1.MatFormFieldModule,
|
|
1756
1867
|
i9.MatCheckboxModule,
|
|
1757
|
-
|
|
1868
|
+
i14.MatTooltipModule,
|
|
1758
1869
|
i7$1.MatSelectModule,
|
|
1759
1870
|
i4.MatListModule,
|
|
1760
1871
|
i7.DragDropModule,
|
|
1761
1872
|
i3$1.FsFileModule,
|
|
1762
|
-
|
|
1873
|
+
i12.FsColorPickerModule,
|
|
1763
1874
|
menu.FsMenuModule,
|
|
1764
1875
|
i2$2.FsZoomPanModule,
|
|
1876
|
+
i10.FsAutocompleteModule,
|
|
1765
1877
|
i2.FsDialogModule,
|
|
1766
1878
|
],
|
|
1767
1879
|
exports: [
|
|
@@ -1777,7 +1889,11 @@
|
|
|
1777
1889
|
SidebarComponent,
|
|
1778
1890
|
ArtboardComponent,
|
|
1779
1891
|
LayersReorderDialogComponent,
|
|
1892
|
+
FontComponent,
|
|
1780
1893
|
],
|
|
1894
|
+
providers: [
|
|
1895
|
+
GoogleFontService,
|
|
1896
|
+
]
|
|
1781
1897
|
}]
|
|
1782
1898
|
}] });
|
|
1783
1899
|
|