@firestitch/block-editor 13.0.0 → 14.0.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.
Files changed (67) hide show
  1. package/app/components/artboard/artboard.component.d.ts +32 -32
  2. package/app/components/block/block.component.d.ts +78 -78
  3. package/app/components/block/index.d.ts +1 -1
  4. package/app/components/block-editor/block-editor.component.d.ts +28 -28
  5. package/app/components/group/group-dialog.component.d.ts +17 -17
  6. package/app/components/group/index.d.ts +1 -1
  7. package/app/components/index.d.ts +1 -1
  8. package/app/components/layers-reorder-dialog/index.d.ts +1 -1
  9. package/app/components/layers-reorder-dialog/layers-reorder-dialog.component.d.ts +17 -17
  10. package/app/components/sidebar/index.d.ts +1 -1
  11. package/app/components/sidebar/sidebar.component.d.ts +93 -93
  12. package/app/consts/block-formats.const.d.ts +6 -6
  13. package/app/consts/block-types.const.d.ts +8 -8
  14. package/app/consts/index.d.ts +2 -2
  15. package/app/directives/block-editor-margin.directive.d.ts +9 -9
  16. package/app/directives/block-editor-sidebar-panel.directive.d.ts +10 -10
  17. package/app/directives/index.d.ts +2 -2
  18. package/app/enums/block-format.enum.d.ts +6 -6
  19. package/app/enums/block-type.enum.d.ts +11 -11
  20. package/app/enums/index.d.ts +2 -2
  21. package/app/fs-block-editor.module.d.ts +37 -37
  22. package/app/interfaces/block-editor-config.d.ts +20 -20
  23. package/app/interfaces/block-group.d.ts +5 -5
  24. package/app/interfaces/block.d.ts +66 -66
  25. package/app/interfaces/index.d.ts +3 -3
  26. package/app/pipes/create-image-url.pipe.d.ts +10 -10
  27. package/app/services/block-editor.service.d.ts +64 -64
  28. package/app/services/blocks-store.service.d.ts +28 -28
  29. package/app/services/index.d.ts +1 -1
  30. package/esm2020/app/components/artboard/artboard.component.mjs +86 -86
  31. package/esm2020/app/components/block/block.component.mjs +546 -546
  32. package/esm2020/app/components/block/index.mjs +1 -1
  33. package/esm2020/app/components/block-editor/block-editor.component.mjs +81 -81
  34. package/esm2020/app/components/group/group-dialog.component.mjs +46 -46
  35. package/esm2020/app/components/group/index.mjs +1 -1
  36. package/esm2020/app/components/index.mjs +1 -1
  37. package/esm2020/app/components/layers-reorder-dialog/index.mjs +1 -1
  38. package/esm2020/app/components/layers-reorder-dialog/layers-reorder-dialog.component.mjs +41 -41
  39. package/esm2020/app/components/sidebar/index.mjs +1 -1
  40. package/esm2020/app/components/sidebar/sidebar.component.mjs +353 -353
  41. package/esm2020/app/consts/block-formats.const.mjs +7 -7
  42. package/esm2020/app/consts/block-types.const.mjs +12 -12
  43. package/esm2020/app/consts/index.mjs +2 -2
  44. package/esm2020/app/directives/block-editor-margin.directive.mjs +18 -18
  45. package/esm2020/app/directives/block-editor-sidebar-panel.directive.mjs +20 -20
  46. package/esm2020/app/directives/index.mjs +2 -2
  47. package/esm2020/app/enums/block-format.enum.mjs +7 -7
  48. package/esm2020/app/enums/block-type.enum.mjs +12 -12
  49. package/esm2020/app/enums/index.mjs +2 -2
  50. package/esm2020/app/fs-block-editor.module.mjs +133 -135
  51. package/esm2020/app/interfaces/block-editor-config.mjs +1 -1
  52. package/esm2020/app/interfaces/block-group.mjs +1 -1
  53. package/esm2020/app/interfaces/block.mjs +1 -1
  54. package/esm2020/app/interfaces/index.mjs +3 -3
  55. package/esm2020/app/pipes/create-image-url.pipe.mjs +18 -18
  56. package/esm2020/app/services/block-editor.service.mjs +286 -286
  57. package/esm2020/app/services/blocks-store.service.mjs +110 -110
  58. package/esm2020/app/services/index.mjs +1 -1
  59. package/esm2020/firestitch-block-editor.mjs +4 -4
  60. package/esm2020/public_api.mjs +6 -6
  61. package/fesm2015/firestitch-block-editor.mjs +1586 -1588
  62. package/fesm2015/firestitch-block-editor.mjs.map +1 -1
  63. package/fesm2020/firestitch-block-editor.mjs +1619 -1621
  64. package/fesm2020/firestitch-block-editor.mjs.map +1 -1
  65. package/{firestitch-block-editor.d.ts → index.d.ts} +5 -5
  66. package/package.json +3 -3
  67. package/public_api.d.ts +8 -8
@@ -1,1653 +1,1651 @@
1
- import * as i17 from '@angular/common';
1
+ import * as i6$1 from '@angular/common';
2
2
  import { DOCUMENT, CommonModule } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
4
  import { Component, ChangeDetectionStrategy, Inject, Directive, Input, Injectable, Pipe, ViewChild, HostBinding, HostListener, EventEmitter, ContentChildren, Output, ViewChildren, ElementRef, NgModule } from '@angular/core';
5
- import * as i5 from '@angular/forms';
5
+ import * as i2 from '@angular/forms';
6
6
  import { FormsModule } from '@angular/forms';
7
- import * as i7$1 from '@angular/cdk/drag-drop';
7
+ import * as i3$1 from '@angular/cdk/drag-drop';
8
8
  import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
9
- import * as i4 from '@angular/material/button';
9
+ import * as i3 from '@angular/material/button';
10
10
  import { MatButtonModule } from '@angular/material/button';
11
- import * as i12 from '@angular/material/checkbox';
11
+ import * as i13 from '@angular/material/checkbox';
12
12
  import { MatCheckboxModule } from '@angular/material/checkbox';
13
- import * as i9 from '@angular/material/form-field';
13
+ import * as i11 from '@angular/material/form-field';
14
14
  import { MatFormFieldModule } from '@angular/material/form-field';
15
- import * as i3 from '@angular/material/icon';
15
+ import * as i4$1 from '@angular/material/icon';
16
16
  import { MatIconModule } from '@angular/material/icon';
17
- import * as i7 from '@angular/material/input';
17
+ import * as i6 from '@angular/material/input';
18
18
  import { MatInputModule } from '@angular/material/input';
19
- import * as i4$1 from '@angular/material/list';
19
+ import * as i6$2 from '@angular/material/list';
20
20
  import { MatListModule } from '@angular/material/list';
21
- import * as i10 from '@angular/material/select';
21
+ import * as i15 from '@angular/material/select';
22
22
  import { MatSelectModule } from '@angular/material/select';
23
- import * as i18 from '@angular/material/tooltip';
23
+ import * as i14 from '@angular/material/tooltip';
24
24
  import { MatTooltipModule } from '@angular/material/tooltip';
25
25
  import { FsAutocompleteModule } from '@firestitch/autocomplete';
26
- import * as i14 from '@firestitch/colorpicker';
26
+ import * as i18 from '@firestitch/colorpicker';
27
27
  import { FsColorPickerModule } from '@firestitch/colorpicker';
28
- import * as i2 from '@firestitch/dialog';
28
+ import * as i2$1 from '@firestitch/dialog';
29
29
  import { FsDialogModule } from '@firestitch/dialog';
30
- import * as i6$1 from '@firestitch/file';
30
+ import * as i17 from '@firestitch/file';
31
31
  import { FsFileModule } from '@firestitch/file';
32
- import * as i2$1 from '@firestitch/font-picker';
32
+ import * as i2$2 from '@firestitch/font-picker';
33
33
  import { FsFontPickerModule } from '@firestitch/font-picker';
34
- import * as i6 from '@firestitch/form';
34
+ import * as i7 from '@firestitch/form';
35
35
  import { FsFormModule } from '@firestitch/form';
36
36
  import * as i20 from '@firestitch/mask';
37
37
  import { FsMaskModule } from '@firestitch/mask';
38
38
  import { FsMenuModule } from '@firestitch/menu';
39
- import * as i2$3 from '@firestitch/zoom-pan';
39
+ import * as i2$4 from '@firestitch/zoom-pan';
40
40
  import { FsZoomPanComponent, FsZoomPanModule } from '@firestitch/zoom-pan';
41
41
  import * as i1 from '@angular/material/dialog';
42
42
  import { MAT_DIALOG_DATA } from '@angular/material/dialog';
43
43
  import { guid, index, round } from '@firestitch/common';
44
44
  import { of, Subject, BehaviorSubject, throwError, from, fromEvent } from 'rxjs';
45
- import * as i8 from '@angular/cdk/text-field';
45
+ import * as i4 from '@angular/cdk/text-field';
46
46
  import { filter, map, takeUntil, switchMap, tap, mapTo, groupBy, debounceTime, mergeAll, skip, delay } from 'rxjs/operators';
47
47
  import Moveable from 'moveable';
48
- import * as i5$1 from '@angular/material/divider';
49
- import * as i3$1 from '@firestitch/prompt';
48
+ import * as i7$1 from '@angular/material/divider';
49
+ import * as i3$2 from '@firestitch/prompt';
50
50
  import * as i1$1 from '@firestitch/api';
51
- import * as i2$2 from '@firestitch/clipboard';
52
- import * as i3$2 from '@firestitch/message';
53
- import * as i11 from '@angular/material/core';
51
+ import * as i2$3 from '@firestitch/clipboard';
52
+ import * as i3$3 from '@firestitch/message';
53
+ import * as i16 from '@angular/material/core';
54
54
 
55
- class GroupDialogComponent {
56
- constructor(_data, _dialogRef) {
57
- this._data = _data;
58
- this._dialogRef = _dialogRef;
59
- this.save = () => {
60
- if (this.blockGroup.name) {
61
- }
62
- else {
63
- this.blockGroup = Object.assign(Object.assign({}, this.blockGroup), { name: guid() });
64
- this._blockEditor.blockGroups.push(this.blockGroup);
65
- }
66
- this._dialogRef.close(this.blockGroup);
67
- return of(true);
68
- };
69
- }
70
- ngOnInit() {
71
- this._blockEditor = this._data.blockEditor;
72
- this.blockGroup = this._data.blockGroup || {};
73
- this.block = this._data.block;
74
- }
75
- }
76
- GroupDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: GroupDialogComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component });
77
- GroupDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: GroupDialogComponent, selector: "ng-component", ngImport: i0, template: "<form fsForm [submit]=\"save\">\n <fs-dialog>\n <h1 mat-dialog-title>Group</h1>\n <mat-dialog-content>\n <mat-form-field class=\"full-width\">\n <textarea\n matInput\n [cdkTextareaAutosize]=\"true\"\n [(ngModel)]=\"blockGroup.label\"\n name=\"groupLabel\"\n [required]=\"true\"\n placeholder=\"Group Label\">\n </textarea>\n </mat-form-field>\n <mat-form-field class=\"full-width\">\n <mat-label>Group Description</mat-label>\n <textarea\n matInput\n [cdkTextareaAutosize]=\"true\"\n [(ngModel)]=\"blockGroup.description\"\n name=\"groupDescription\">\n </textarea>\n </mat-form-field> \n </mat-dialog-content>\n <mat-dialog-actions>\n <button \n mat-button \n type=\"submit\"\n color=\"primary\">\n Save\n </button>\n <button \n mat-button \n type=\"button\"\n mat-dialog-close>\n Cancel\n </button>\n </mat-dialog-actions>\n </fs-dialog>\n</form>", styles: [""], components: [{ type: i2.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileButtonPlacement", "mobileWidth", "mode", "buttonLayout"] }, { type: i9.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i4.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: i5.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i5.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i5.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i6.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup", "deactivationGuard"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"], exportAs: ["fsForm"] }, { type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i7.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i8.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { type: i5.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: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i6.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }, { type: i5.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i9.MatLabel, selector: "mat-label" }, { type: i6.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i6.FsButtonDirective, selector: "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", inputs: ["name", "dirtySubmit", "form"] }, { type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
78
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: GroupDialogComponent, decorators: [{
79
- type: Component,
80
- args: [{ changeDetection: ChangeDetectionStrategy.OnPush, template: "<form fsForm [submit]=\"save\">\n <fs-dialog>\n <h1 mat-dialog-title>Group</h1>\n <mat-dialog-content>\n <mat-form-field class=\"full-width\">\n <textarea\n matInput\n [cdkTextareaAutosize]=\"true\"\n [(ngModel)]=\"blockGroup.label\"\n name=\"groupLabel\"\n [required]=\"true\"\n placeholder=\"Group Label\">\n </textarea>\n </mat-form-field>\n <mat-form-field class=\"full-width\">\n <mat-label>Group Description</mat-label>\n <textarea\n matInput\n [cdkTextareaAutosize]=\"true\"\n [(ngModel)]=\"blockGroup.description\"\n name=\"groupDescription\">\n </textarea>\n </mat-form-field> \n </mat-dialog-content>\n <mat-dialog-actions>\n <button \n mat-button \n type=\"submit\"\n color=\"primary\">\n Save\n </button>\n <button \n mat-button \n type=\"button\"\n mat-dialog-close>\n Cancel\n </button>\n </mat-dialog-actions>\n </fs-dialog>\n</form>", styles: [""] }]
81
- }], ctorParameters: function () {
82
- return [{ type: undefined, decorators: [{
83
- type: Inject,
84
- args: [MAT_DIALOG_DATA]
85
- }] }, { type: i1.MatDialogRef }];
55
+ class GroupDialogComponent {
56
+ constructor(_data, _dialogRef) {
57
+ this._data = _data;
58
+ this._dialogRef = _dialogRef;
59
+ this.save = () => {
60
+ if (this.blockGroup.name) {
61
+ }
62
+ else {
63
+ this.blockGroup = Object.assign(Object.assign({}, this.blockGroup), { name: guid() });
64
+ this._blockEditor.blockGroups.push(this.blockGroup);
65
+ }
66
+ this._dialogRef.close(this.blockGroup);
67
+ return of(true);
68
+ };
69
+ }
70
+ ngOnInit() {
71
+ this._blockEditor = this._data.blockEditor;
72
+ this.blockGroup = this._data.blockGroup || {};
73
+ this.block = this._data.block;
74
+ }
75
+ }
76
+ GroupDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: GroupDialogComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component });
77
+ GroupDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: GroupDialogComponent, selector: "ng-component", ngImport: i0, template: "<form fsForm [submit]=\"save\">\n <fs-dialog>\n <h1 mat-dialog-title>Group</h1>\n <mat-dialog-content>\n <mat-form-field class=\"full-width\">\n <textarea\n matInput\n [cdkTextareaAutosize]=\"true\"\n [(ngModel)]=\"blockGroup.label\"\n name=\"groupLabel\"\n [required]=\"true\"\n placeholder=\"Group Label\">\n </textarea>\n </mat-form-field>\n <mat-form-field class=\"full-width\">\n <mat-label>Group Description</mat-label>\n <textarea\n matInput\n [cdkTextareaAutosize]=\"true\"\n [(ngModel)]=\"blockGroup.description\"\n name=\"groupDescription\">\n </textarea>\n </mat-form-field> \n </mat-dialog-content>\n <mat-dialog-actions>\n <button \n mat-button \n type=\"submit\"\n color=\"primary\">\n Save\n </button>\n <button \n mat-button \n type=\"button\"\n mat-dialog-close>\n Cancel\n </button>\n </mat-dialog-actions>\n </fs-dialog>\n</form>", styles: [""], dependencies: [{ kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i3.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"] }, { kind: "directive", type: i4.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { kind: "component", type: i11.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i11.MatLabel, selector: "mat-label" }, { kind: "directive", type: i6.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i7.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup", "deactivationGuard"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"], exportAs: ["fsForm"] }, { kind: "directive", type: i7.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }, { kind: "directive", type: i7.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { kind: "directive", type: i7.FsButtonDirective, selector: "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", inputs: ["name", "dirtySubmit", "form"] }, { kind: "directive", type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i2$1.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileButtonPlacement", "mobileWidth", "mode", "buttonLayout"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
78
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: GroupDialogComponent, decorators: [{
79
+ type: Component,
80
+ args: [{ changeDetection: ChangeDetectionStrategy.OnPush, template: "<form fsForm [submit]=\"save\">\n <fs-dialog>\n <h1 mat-dialog-title>Group</h1>\n <mat-dialog-content>\n <mat-form-field class=\"full-width\">\n <textarea\n matInput\n [cdkTextareaAutosize]=\"true\"\n [(ngModel)]=\"blockGroup.label\"\n name=\"groupLabel\"\n [required]=\"true\"\n placeholder=\"Group Label\">\n </textarea>\n </mat-form-field>\n <mat-form-field class=\"full-width\">\n <mat-label>Group Description</mat-label>\n <textarea\n matInput\n [cdkTextareaAutosize]=\"true\"\n [(ngModel)]=\"blockGroup.description\"\n name=\"groupDescription\">\n </textarea>\n </mat-form-field> \n </mat-dialog-content>\n <mat-dialog-actions>\n <button \n mat-button \n type=\"submit\"\n color=\"primary\">\n Save\n </button>\n <button \n mat-button \n type=\"button\"\n mat-dialog-close>\n Cancel\n </button>\n </mat-dialog-actions>\n </fs-dialog>\n</form>" }]
81
+ }], ctorParameters: function () {
82
+ return [{ type: undefined, decorators: [{
83
+ type: Inject,
84
+ args: [MAT_DIALOG_DATA]
85
+ }] }, { type: i1.MatDialogRef }];
86
86
  } });
87
87
 
88
- class FsBlockEditorMarginDirective {
89
- constructor(_elementRef) {
90
- this._elementRef = _elementRef;
91
- }
92
- get element() {
93
- return this._elementRef.nativeElement;
94
- }
95
- }
96
- FsBlockEditorMarginDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsBlockEditorMarginDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
97
- FsBlockEditorMarginDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.4.0", type: FsBlockEditorMarginDirective, selector: "[fsBlockEditorMargin]", ngImport: i0 });
98
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsBlockEditorMarginDirective, decorators: [{
99
- type: Directive,
100
- args: [{
101
- selector: '[fsBlockEditorMargin]'
102
- }]
88
+ class FsBlockEditorMarginDirective {
89
+ constructor(_elementRef) {
90
+ this._elementRef = _elementRef;
91
+ }
92
+ get element() {
93
+ return this._elementRef.nativeElement;
94
+ }
95
+ }
96
+ FsBlockEditorMarginDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsBlockEditorMarginDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
97
+ FsBlockEditorMarginDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.3.0", type: FsBlockEditorMarginDirective, selector: "[fsBlockEditorMargin]", ngImport: i0 });
98
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsBlockEditorMarginDirective, decorators: [{
99
+ type: Directive,
100
+ args: [{
101
+ selector: '[fsBlockEditorMargin]'
102
+ }]
103
103
  }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
104
104
 
105
- class FsBlockEditorSidebarPanelDirective {
106
- constructor(templateRef) {
107
- this.templateRef = templateRef;
108
- this.show = true;
109
- }
110
- }
111
- FsBlockEditorSidebarPanelDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsBlockEditorSidebarPanelDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
112
- FsBlockEditorSidebarPanelDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.4.0", type: FsBlockEditorSidebarPanelDirective, selector: "[fsBlockEditorSidebarPanel]", inputs: { label: "label", show: "show" }, ngImport: i0 });
113
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsBlockEditorSidebarPanelDirective, decorators: [{
114
- type: Directive,
115
- args: [{
116
- selector: '[fsBlockEditorSidebarPanel]',
117
- }]
118
- }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; }, propDecorators: { label: [{
119
- type: Input
120
- }], show: [{
121
- type: Input
105
+ class FsBlockEditorSidebarPanelDirective {
106
+ constructor(templateRef) {
107
+ this.templateRef = templateRef;
108
+ this.show = true;
109
+ }
110
+ }
111
+ FsBlockEditorSidebarPanelDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsBlockEditorSidebarPanelDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
112
+ FsBlockEditorSidebarPanelDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.3.0", type: FsBlockEditorSidebarPanelDirective, selector: "[fsBlockEditorSidebarPanel]", inputs: { label: "label", show: "show" }, ngImport: i0 });
113
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsBlockEditorSidebarPanelDirective, decorators: [{
114
+ type: Directive,
115
+ args: [{
116
+ selector: '[fsBlockEditorSidebarPanel]',
117
+ }]
118
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; }, propDecorators: { label: [{
119
+ type: Input
120
+ }], show: [{
121
+ type: Input
122
122
  }] } });
123
123
 
124
- var BlockType;
125
- (function (BlockType) {
126
- BlockType["Rectangle"] = "rectangle";
127
- BlockType["ShortText"] = "shorttext";
128
- BlockType["LongText"] = "longtext";
129
- BlockType["Image"] = "image";
130
- BlockType["RadioButton"] = "radiobutton";
131
- BlockType["Checkbox"] = "checkbox";
132
- BlockType["Signature"] = "signature";
133
- BlockType["Pdf"] = "pdf";
134
- BlockType["Date"] = "date";
124
+ var BlockType;
125
+ (function (BlockType) {
126
+ BlockType["Rectangle"] = "rectangle";
127
+ BlockType["ShortText"] = "shorttext";
128
+ BlockType["LongText"] = "longtext";
129
+ BlockType["Image"] = "image";
130
+ BlockType["RadioButton"] = "radiobutton";
131
+ BlockType["Checkbox"] = "checkbox";
132
+ BlockType["Signature"] = "signature";
133
+ BlockType["Pdf"] = "pdf";
134
+ BlockType["Date"] = "date";
135
135
  })(BlockType || (BlockType = {}));
136
136
 
137
- var BlockFormat;
138
- (function (BlockFormat) {
139
- BlockFormat["Date"] = "date";
140
- BlockFormat["YYYYMMDD"] = "YYYY/MM/DD";
141
- BlockFormat["Currency"] = "currency";
142
- BlockFormat["Number"] = "number";
137
+ var BlockFormat;
138
+ (function (BlockFormat) {
139
+ BlockFormat["Date"] = "date";
140
+ BlockFormat["YYYYMMDD"] = "YYYY/MM/DD";
141
+ BlockFormat["Currency"] = "currency";
142
+ BlockFormat["Number"] = "number";
143
143
  })(BlockFormat || (BlockFormat = {}));
144
144
 
145
- const BlockTypes = [
146
- { value: BlockType.Rectangle, name: 'Rectangle', icon: 'crop_5_4', type: 'draw' },
147
- { value: BlockType.ShortText, name: 'Short Text', icon: 'short_text', type: 'form' },
148
- { value: BlockType.LongText, name: 'Long Text', icon: 'subject', type: 'form' },
149
- { value: BlockType.RadioButton, name: 'Radio Button', icon: 'radio_button_checked', type: 'form' },
150
- { value: BlockType.Checkbox, name: 'Checkbox', icon: 'check_box', type: 'form' },
151
- { value: BlockType.Date, name: 'Date', icon: 'calendar_today', type: 'form' },
152
- { value: BlockType.Signature, name: 'Signature', icon: 'draw', type: 'form' },
153
- { value: BlockType.Image, name: 'Image', icon: 'image', accept: 'image/*', type: 'draw' },
154
- { value: BlockType.Pdf, name: 'Pdf', icon: 'picture_as_pdf', accept: 'application/pdf', type: 'draw' },
145
+ const BlockTypes = [
146
+ { value: BlockType.Rectangle, name: 'Rectangle', icon: 'crop_5_4', type: 'draw' },
147
+ { value: BlockType.ShortText, name: 'Short Text', icon: 'short_text', type: 'form' },
148
+ { value: BlockType.LongText, name: 'Long Text', icon: 'subject', type: 'form' },
149
+ { value: BlockType.RadioButton, name: 'Radio Button', icon: 'radio_button_checked', type: 'form' },
150
+ { value: BlockType.Checkbox, name: 'Checkbox', icon: 'check_box', type: 'form' },
151
+ { value: BlockType.Date, name: 'Date', icon: 'calendar_today', type: 'form' },
152
+ { value: BlockType.Signature, name: 'Signature', icon: 'draw', type: 'form' },
153
+ { value: BlockType.Image, name: 'Image', icon: 'image', accept: 'image/*', type: 'draw' },
154
+ { value: BlockType.Pdf, name: 'Pdf', icon: 'picture_as_pdf', accept: 'application/pdf', type: 'draw' },
155
155
  ];
156
156
 
157
- const BlockFormats = [
158
- { value: BlockFormat.Number, name: 'Number', blockTypes: [BlockType.ShortText, BlockType.LongText] },
159
- { value: BlockFormat.Currency, name: 'Currency', blockTypes: [BlockType.ShortText, BlockType.LongText] },
160
- { value: BlockFormat.Date, name: 'Date', blockTypes: [BlockType.Date] },
161
- { value: BlockFormat.YYYYMMDD, name: 'YYYY/MM/DD', blockTypes: [BlockType.Date] },
157
+ const BlockFormats = [
158
+ { value: BlockFormat.Number, name: 'Number', blockTypes: [BlockType.ShortText, BlockType.LongText] },
159
+ { value: BlockFormat.Currency, name: 'Currency', blockTypes: [BlockType.ShortText, BlockType.LongText] },
160
+ { value: BlockFormat.Date, name: 'Date', blockTypes: [BlockType.Date] },
161
+ { value: BlockFormat.YYYYMMDD, name: 'YYYY/MM/DD', blockTypes: [BlockType.Date] },
162
162
  ];
163
163
 
164
- class LayersReorderDialogComponent {
165
- constructor(_dialogData, _dialogRef) {
166
- this._dialogData = _dialogData;
167
- this._dialogRef = _dialogRef;
168
- this.blockTypeIcons = index(BlockTypes, 'value', 'icon');
169
- this._init(_dialogData);
170
- }
171
- swapItems(event) {
172
- moveItemInArray(this.blocks, event.previousIndex, event.currentIndex);
173
- }
174
- done() {
175
- this._dialogRef.close(this.blocks.reverse());
176
- }
177
- _init(data) {
178
- this.blocks = data.blocks;
179
- }
180
- }
181
- LayersReorderDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: LayersReorderDialogComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component });
182
- LayersReorderDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: LayersReorderDialogComponent, selector: "ng-component", ngImport: i0, template: "<fs-dialog>\n <h1 mat-dialog-title><mat-icon>swap_vert</mat-icon> Reorder Blocks</h1>\n <mat-dialog-content>\n <mat-list cdkDropList (cdkDropListDropped)=\"swapItems($event)\">\n <mat-divider></mat-divider>\n <ng-container *ngFor=\"let block of blocks\">\n <mat-list-item cdkDrag cdkDragLockAxis=\"y\">\n <mat-icon cdkDragHandle>drag_handle</mat-icon>\n <mat-icon>\n {{ blockTypeIcons[block.type] }}\n </mat-icon>\n <span class=\"block-label\">\n {{ block.label || 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.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileButtonPlacement", "mobileWidth", "mode", "buttonLayout"] }, { type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i4$1.MatList, selector: "mat-list, mat-action-list", inputs: ["disableRipple", "disabled"], exportAs: ["matList"] }, { type: i5$1.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { type: i4$1.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["disableRipple", "disabled"], exportAs: ["matListItem"] }, { type: i4.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.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i7$1.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { type: i17.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7$1.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { type: i7$1.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i6.FsButtonDirective, selector: "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", inputs: ["name", "dirtySubmit", "form"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
183
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: LayersReorderDialogComponent, decorators: [{
184
- type: Component,
185
- args: [{ changeDetection: ChangeDetectionStrategy.OnPush, template: "<fs-dialog>\n <h1 mat-dialog-title><mat-icon>swap_vert</mat-icon> Reorder Blocks</h1>\n <mat-dialog-content>\n <mat-list cdkDropList (cdkDropListDropped)=\"swapItems($event)\">\n <mat-divider></mat-divider>\n <ng-container *ngFor=\"let block of blocks\">\n <mat-list-item cdkDrag cdkDragLockAxis=\"y\">\n <mat-icon cdkDragHandle>drag_handle</mat-icon>\n <mat-icon>\n {{ blockTypeIcons[block.type] }}\n </mat-icon>\n <span class=\"block-label\">\n {{ block.label || 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"] }]
186
- }], ctorParameters: function () {
187
- return [{ type: undefined, decorators: [{
188
- type: Inject,
189
- args: [MAT_DIALOG_DATA]
190
- }] }, { type: i1.MatDialogRef }];
164
+ class LayersReorderDialogComponent {
165
+ constructor(_dialogData, _dialogRef) {
166
+ this._dialogData = _dialogData;
167
+ this._dialogRef = _dialogRef;
168
+ this.blockTypeIcons = index(BlockTypes, 'value', 'icon');
169
+ this._init(_dialogData);
170
+ }
171
+ swapItems(event) {
172
+ moveItemInArray(this.blocks, event.previousIndex, event.currentIndex);
173
+ }
174
+ done() {
175
+ this._dialogRef.close(this.blocks.reverse());
176
+ }
177
+ _init(data) {
178
+ this.blocks = data.blocks;
179
+ }
180
+ }
181
+ LayersReorderDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LayersReorderDialogComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component });
182
+ LayersReorderDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: LayersReorderDialogComponent, selector: "ng-component", ngImport: i0, template: "<fs-dialog>\n <h1 mat-dialog-title><mat-icon>swap_vert</mat-icon> Reorder Blocks</h1>\n <mat-dialog-content>\n <mat-list cdkDropList (cdkDropListDropped)=\"swapItems($event)\">\n <mat-divider></mat-divider>\n <ng-container *ngFor=\"let block of blocks\">\n <mat-list-item cdkDrag cdkDragLockAxis=\"y\">\n <mat-icon cdkDragHandle>drag_handle</mat-icon>\n <mat-icon>\n {{ blockTypeIcons[block.type] }}\n </mat-icon>\n <span class=\"block-label\">\n {{ block.label || 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"], dependencies: [{ kind: "directive", type: i6$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3$1.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i3$1.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i3$1.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: i4$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3.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"] }, { kind: "component", type: i6$2.MatList, selector: "mat-list, mat-action-list", inputs: ["disableRipple", "disabled"], exportAs: ["matList"] }, { kind: "component", type: i6$2.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["disableRipple", "disabled"], exportAs: ["matListItem"] }, { kind: "component", type: i7$1.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "directive", type: i7.FsButtonDirective, selector: "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", inputs: ["name", "dirtySubmit", "form"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i2$1.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileButtonPlacement", "mobileWidth", "mode", "buttonLayout"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
183
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LayersReorderDialogComponent, decorators: [{
184
+ type: Component,
185
+ args: [{ changeDetection: ChangeDetectionStrategy.OnPush, template: "<fs-dialog>\n <h1 mat-dialog-title><mat-icon>swap_vert</mat-icon> Reorder Blocks</h1>\n <mat-dialog-content>\n <mat-list cdkDropList (cdkDropListDropped)=\"swapItems($event)\">\n <mat-divider></mat-divider>\n <ng-container *ngFor=\"let block of blocks\">\n <mat-list-item cdkDrag cdkDragLockAxis=\"y\">\n <mat-icon cdkDragHandle>drag_handle</mat-icon>\n <mat-icon>\n {{ blockTypeIcons[block.type] }}\n </mat-icon>\n <span class=\"block-label\">\n {{ block.label || 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"] }]
186
+ }], ctorParameters: function () {
187
+ return [{ type: undefined, decorators: [{
188
+ type: Inject,
189
+ args: [MAT_DIALOG_DATA]
190
+ }] }, { type: i1.MatDialogRef }];
191
191
  } });
192
192
 
193
- var EventType;
194
- (function (EventType) {
195
- EventType["Add"] = "add";
196
- EventType["Change"] = "change";
197
- EventType["Remove"] = "remove";
198
- EventType["Update"] = "update";
199
- })(EventType || (EventType = {}));
200
- class BlocksStore {
201
- constructor() {
202
- this._eventBus$ = new Subject();
203
- this._blocks$ = new BehaviorSubject([]);
204
- this._destroy$ = new Subject();
205
- }
206
- get blocks() {
207
- return [
208
- ...this._blocks$.getValue(),
209
- ];
210
- }
211
- get blocks$() {
212
- return this._blocks$.asObservable();
213
- }
214
- get blockAdded$() {
215
- return this._eventBus$
216
- .pipe(filter(({ type }) => type === EventType.Add), map(({ value }) => value));
217
- }
218
- get blockChanged$() {
219
- return this._eventBus$
220
- .pipe(filter(({ type }) => type === EventType.Change), map(({ value }) => value));
221
- }
222
- get blockUpdated$() {
223
- return this._eventBus$
224
- .pipe(filter(({ type }) => type === EventType.Update), map(({ value }) => value));
225
- }
226
- get blockRemoved$() {
227
- return this._eventBus$
228
- .pipe(filter(({ type }) => type === EventType.Remove), map(({ value }) => value));
229
- }
230
- ngOnDestroy() {
231
- this._destroy$.next();
232
- this._destroy$.complete();
233
- }
234
- init(blocks) {
235
- blocks
236
- .forEach((block) => {
237
- this._appendBlock(block);
238
- });
239
- }
240
- blockExists(block) {
241
- const index = this.blocks.findIndex((b) => {
242
- return b.guid === block.guid;
243
- });
244
- return index !== -1;
245
- }
246
- blockAdd(block) {
247
- this._appendBlock(block);
248
- }
249
- blockChange(block) {
250
- this._dispatchEvent(EventType.Change, block);
251
- }
252
- blockUpdate(block) {
253
- this._dispatchEvent(EventType.Update, block);
254
- }
255
- blockRemove(targetBlocks) {
256
- const blocks = this.blocks;
257
- if (!Array.isArray(targetBlocks)) {
258
- targetBlocks = [targetBlocks];
259
- }
260
- targetBlocks.forEach((block) => {
261
- const index = blocks
262
- .findIndex((b) => b.guid === block.guid);
263
- if (index !== -1) {
264
- blocks.splice(index, 1);
265
- this._dispatchEvent(EventType.Remove, block);
266
- }
267
- });
268
- this._setBlocks(blocks);
269
- }
270
- _setBlocks(blocks) {
271
- this._blocks$.next([...blocks]);
272
- }
273
- _appendBlock(block) {
274
- const blocks = [
275
- ...this.blocks,
276
- block,
277
- ];
278
- this._deduplicateIndexesFor(blocks);
279
- this._setBlocks(blocks);
280
- this._dispatchEvent(EventType.Add, block);
281
- }
282
- _dispatchEvent(type, value) {
283
- this._eventBus$.next({
284
- type,
285
- value,
286
- });
287
- }
288
- _deduplicateIndexesFor(blocks) {
289
- blocks.forEach((block, index) => {
290
- block.index = index;
291
- });
292
- }
293
- }
294
- BlocksStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: BlocksStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
295
- BlocksStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: BlocksStore });
296
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: BlocksStore, decorators: [{
297
- type: Injectable
193
+ var EventType;
194
+ (function (EventType) {
195
+ EventType["Add"] = "add";
196
+ EventType["Change"] = "change";
197
+ EventType["Remove"] = "remove";
198
+ EventType["Update"] = "update";
199
+ })(EventType || (EventType = {}));
200
+ class BlocksStore {
201
+ constructor() {
202
+ this._eventBus$ = new Subject();
203
+ this._blocks$ = new BehaviorSubject([]);
204
+ this._destroy$ = new Subject();
205
+ }
206
+ get blocks() {
207
+ return [
208
+ ...this._blocks$.getValue(),
209
+ ];
210
+ }
211
+ get blocks$() {
212
+ return this._blocks$.asObservable();
213
+ }
214
+ get blockAdded$() {
215
+ return this._eventBus$
216
+ .pipe(filter(({ type }) => type === EventType.Add), map(({ value }) => value));
217
+ }
218
+ get blockChanged$() {
219
+ return this._eventBus$
220
+ .pipe(filter(({ type }) => type === EventType.Change), map(({ value }) => value));
221
+ }
222
+ get blockUpdated$() {
223
+ return this._eventBus$
224
+ .pipe(filter(({ type }) => type === EventType.Update), map(({ value }) => value));
225
+ }
226
+ get blockRemoved$() {
227
+ return this._eventBus$
228
+ .pipe(filter(({ type }) => type === EventType.Remove), map(({ value }) => value));
229
+ }
230
+ ngOnDestroy() {
231
+ this._destroy$.next();
232
+ this._destroy$.complete();
233
+ }
234
+ init(blocks) {
235
+ blocks
236
+ .forEach((block) => {
237
+ this._appendBlock(block);
238
+ });
239
+ }
240
+ blockExists(block) {
241
+ const index = this.blocks.findIndex((b) => {
242
+ return b.guid === block.guid;
243
+ });
244
+ return index !== -1;
245
+ }
246
+ blockAdd(block) {
247
+ this._appendBlock(block);
248
+ }
249
+ blockChange(block) {
250
+ this._dispatchEvent(EventType.Change, block);
251
+ }
252
+ blockUpdate(block) {
253
+ this._dispatchEvent(EventType.Update, block);
254
+ }
255
+ blockRemove(targetBlocks) {
256
+ const blocks = this.blocks;
257
+ if (!Array.isArray(targetBlocks)) {
258
+ targetBlocks = [targetBlocks];
259
+ }
260
+ targetBlocks.forEach((block) => {
261
+ const index = blocks
262
+ .findIndex((b) => b.guid === block.guid);
263
+ if (index !== -1) {
264
+ blocks.splice(index, 1);
265
+ this._dispatchEvent(EventType.Remove, block);
266
+ }
267
+ });
268
+ this._setBlocks(blocks);
269
+ }
270
+ _setBlocks(blocks) {
271
+ this._blocks$.next([...blocks]);
272
+ }
273
+ _appendBlock(block) {
274
+ const blocks = [
275
+ ...this.blocks,
276
+ block,
277
+ ];
278
+ this._deduplicateIndexesFor(blocks);
279
+ this._setBlocks(blocks);
280
+ this._dispatchEvent(EventType.Add, block);
281
+ }
282
+ _dispatchEvent(type, value) {
283
+ this._eventBus$.next({
284
+ type,
285
+ value,
286
+ });
287
+ }
288
+ _deduplicateIndexesFor(blocks) {
289
+ blocks.forEach((block, index) => {
290
+ block.index = index;
291
+ });
292
+ }
293
+ }
294
+ BlocksStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: BlocksStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
295
+ BlocksStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: BlocksStore });
296
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: BlocksStore, decorators: [{
297
+ type: Injectable
298
298
  }] });
299
299
 
300
- class BlockEditorService {
301
- constructor(_store, _dialog, _prompt) {
302
- this._store = _store;
303
- this._dialog = _dialog;
304
- this._prompt = _prompt;
305
- this.blockGroups = [];
306
- this._selectedBlocks$ = new BehaviorSubject([]);
307
- this._blockComponents$ = new BehaviorSubject([]);
308
- this._blockClippable$ = new BehaviorSubject(null);
309
- this._destroy$ = new Subject();
310
- }
311
- get blockComponents$() {
312
- return this._blockComponents$.asObservable();
313
- }
314
- set blockComponents(blockComponents) {
315
- this._blockComponents$.next(blockComponents);
316
- }
317
- init(config) {
318
- this.config = config;
319
- this._store.init(config.blocks);
320
- this._initBlockGroups();
321
- this._initBlockChange();
322
- }
323
- blockAdd(block) {
324
- if (!this.config.blockAdd) {
325
- console.warn('[BlockEditor] Config "blockAdd" is not defined');
326
- return;
327
- }
328
- block = this._initBlock(block);
329
- this.config.blockAdd(block)
330
- .pipe(takeUntil(this._destroy$))
331
- .subscribe((newBlock) => {
332
- this._store.blockAdd(newBlock);
333
- });
334
- }
335
- blockUpload(block, fsFile) {
336
- if (!this.config.blockUpload) {
337
- return throwError('[BlockEditor] Config "blockUpload" is not defined');
338
- }
339
- const existing = this._store.blockExists(block);
340
- if (!existing) {
341
- block = this._initBlock(block);
342
- }
343
- return from(fsFile.imageInfo)
344
- .pipe(switchMap((imageInfo) => {
345
- if (!existing && (imageInfo === null || imageInfo === void 0 ? void 0 : imageInfo.height) && (imageInfo === null || imageInfo === void 0 ? void 0 : imageInfo.width)) {
346
- const ratio = imageInfo.height / imageInfo.width;
347
- block.width = this.config.width * .4;
348
- block.height = block.width * ratio;
349
- }
350
- return this.config.blockUpload(block, fsFile.file);
351
- }), tap((newBlock) => {
352
- if (existing) {
353
- this._store.blockUpdate(Object.assign(Object.assign({}, block), newBlock));
354
- }
355
- else {
356
- this.blockAdd(newBlock);
357
- }
358
- }), takeUntil(this._destroy$));
359
- }
360
- blockRemove(block) {
361
- this._store.blockRemove(block);
362
- }
363
- get blocks$() {
364
- return this._store.blocks$;
365
- }
366
- get blockChanged$() {
367
- return this._store.blockChanged$;
368
- }
369
- get blockUpdated$() {
370
- return this._store.blockUpdated$;
371
- }
372
- get blockClippable$() {
373
- return this._blockClippable$.asObservable();
374
- }
375
- set blockClippable(value) {
376
- this._blockClippable$.next(value);
377
- }
378
- get blockAdded$() {
379
- return this._store.blockAdded$;
380
- }
381
- get blockRemoved$() {
382
- return this._store.blockRemoved$;
383
- }
384
- get blocks() {
385
- return this._store.blocks;
386
- }
387
- blockChange(block) {
388
- this._store.blockChange(block);
389
- }
390
- applyBlockGroup(block, blockGroup) {
391
- block.name = blockGroup === null || blockGroup === void 0 ? void 0 : blockGroup.name;
392
- block.description = blockGroup === null || blockGroup === void 0 ? void 0 : blockGroup.description;
393
- block.label = blockGroup === null || blockGroup === void 0 ? void 0 : blockGroup.label;
394
- this.blockChange(block);
395
- }
396
- isSelectedBlock(block) {
397
- return this.selectedBlocks.indexOf(block) !== -1;
398
- }
399
- indexOf(block) {
400
- return this.blocks.map((e) => e.guid).indexOf(block.guid);
401
- }
402
- selectedBlockComponentChangeProperty(values) {
403
- this.selectedBlocks
404
- .forEach((block) => {
405
- Object.keys(values)
406
- .forEach((name) => {
407
- block[name] = values[name];
408
- });
409
- this.blockChange(block);
410
- });
411
- }
412
- blockGroupChangeProperty(blockGroup, values) {
413
- this.blocks
414
- .filter((block) => block.name === blockGroup.name)
415
- .forEach((block) => {
416
- Object.keys(values)
417
- .forEach((name) => {
418
- block[name] = values[name];
419
- });
420
- this.blockChange(block);
421
- });
422
- }
423
- get selectedBlocks$() {
424
- return this._selectedBlocks$;
425
- }
426
- set selectedBlock(block) {
427
- this.selectedBlocks = [block];
428
- }
429
- set selectedBlocks(blocks) {
430
- this._selectedBlocks$.next(blocks);
431
- if (this.config.blocksSelect) {
432
- this.config.blocksSelect(blocks);
433
- }
434
- }
435
- get selectedBlocks() {
436
- return this._selectedBlocks$.getValue();
437
- }
438
- saveSelection() {
439
- const selection = window.getSelection();
440
- this._selectionRange = selection.getRangeAt(0);
441
- }
442
- restoreSelection() {
443
- if (this._selectionRange) {
444
- const selection = window.getSelection();
445
- selection.removeAllRanges();
446
- selection.addRange(this._selectionRange);
447
- }
448
- }
449
- hasSelectionRange() {
450
- return this._selectionRange && (this._selectionRange.baseOffset - this._selectionRange.focusOffset) > 0;
451
- }
452
- registerContainer(container) {
453
- this.container = container;
454
- }
455
- registerMargin(margin) {
456
- this.margin = margin;
457
- }
458
- removeBlocks(blocks) {
459
- this._prompt.confirm({
460
- title: 'Confirm',
461
- template: 'Are you sure your would like to delete this block?',
462
- })
463
- .pipe(switchMap(() => this.config.blocksRemove ? this.config.blocksRemove(blocks) : throwError('config.blocksRemove is not configured')), takeUntil(this._destroy$))
464
- .subscribe(() => {
465
- blocks.forEach((block) => {
466
- this.blockRemove(block);
467
- });
468
- this.selectedBlocks = [];
469
- });
470
- }
471
- openReorderDialog() {
472
- const blocks = this.blocks
473
- .sort((blockA, blockB) => (blockA.index - blockB.index))
474
- .reverse();
475
- this._dialog
476
- .open(LayersReorderDialogComponent, {
477
- data: {
478
- blocks,
479
- },
480
- })
481
- .afterClosed()
482
- .pipe(filter((b) => !!b), switchMap((b) => this.config.blocksReorder(b)
483
- .pipe(mapTo(blocks))), takeUntil(this._destroy$))
484
- .subscribe((b) => {
485
- b
486
- .forEach((block, index) => {
487
- block.index = index;
488
- });
489
- });
490
- }
491
- ngOnDestroy() {
492
- this._destroy$.next();
493
- this._destroy$.complete();
494
- }
495
- _initBlockGroups() {
496
- this.blockGroups = Object.values(this._store.blocks
497
- .reduce((accum, block) => {
498
- if (block.name) {
499
- const existing = accum[block.name] || {};
500
- accum[block.name] = {
501
- label: block.label || existing.label,
502
- description: block.description || existing.description,
503
- name: block.name,
504
- };
505
- }
506
- return accum;
507
- }, {}));
508
- }
509
- _initBlockChange() {
510
- if (this.config.blockChange) {
511
- this.blockChanged$
512
- .pipe(groupBy((block) => (block.guid)), map((group) => group.pipe(debounceTime(250))), mergeAll())
513
- .subscribe((block) => {
514
- this.config.blockChange(block);
515
- });
516
- }
517
- }
518
- _initBlock(block) {
519
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
520
- let newBlock = Object.assign(Object.assign({}, block), { shapeBottomLeft: (_a = block.shapeBottomLeft) !== null && _a !== void 0 ? _a : 'round', shapeTopLeft: (_b = block.shapeTopLeft) !== null && _b !== void 0 ? _b : 'round', shapeTopRight: (_c = block.shapeTopRight) !== null && _c !== void 0 ? _c : 'round', shapeBottomRight: (_d = block.shapeBottomRight) !== null && _d !== void 0 ? _d : 'round', verticalAlign: (_e = block.verticalAlign) !== null && _e !== void 0 ? _e : 'top', horizontalAlign: (_f = block.horizontalAlign) !== null && _f !== void 0 ? _f : 'left', index: block.guid ? block.index : this._store.blocks.length, guid: block.guid || guid('xxxxxxxxxxxx'), keepRatio: (_g = block.keepRatio) !== null && _g !== void 0 ? _g : [
521
- BlockType.Checkbox,
522
- BlockType.RadioButton,
523
- BlockType.Pdf,
524
- ]
525
- .indexOf(block.type) !== -1 });
526
- let width = (this.config.width * .333).toFixed(2);
527
- let height = width / 2;
528
- if (newBlock.type === BlockType.Rectangle) {
529
- newBlock = Object.assign(Object.assign({}, newBlock), { borderColor: (_h = newBlock.borderColor) !== null && _h !== void 0 ? _h : '#cccccc', borderWidth: (_j = newBlock.borderWidth) !== null && _j !== void 0 ? _j : 1 });
530
- }
531
- else if (newBlock.type === BlockType.Checkbox || newBlock.type === BlockType.RadioButton) {
532
- width = .25;
533
- height = .25;
534
- }
535
- else {
536
- width = 2;
537
- height = .5;
538
- }
539
- //get max tabindex
540
- // newBlock.tabIndex = this._lastTabIndex + 1;
541
- // this.updateTabIndex(newBlock.tabIndex);
542
- return Object.assign({ top: height, left: width, width,
543
- height }, newBlock);
544
- }
545
- }
546
- BlockEditorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: BlockEditorService, deps: [{ token: BlocksStore }, { token: i2.FsDialog }, { token: i3$1.FsPrompt }], target: i0.ɵɵFactoryTarget.Injectable });
547
- BlockEditorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: BlockEditorService });
548
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: BlockEditorService, decorators: [{
549
- type: Injectable
550
- }], ctorParameters: function () { return [{ type: BlocksStore }, { type: i2.FsDialog }, { type: i3$1.FsPrompt }]; } });
300
+ class BlockEditorService {
301
+ constructor(_store, _dialog, _prompt) {
302
+ this._store = _store;
303
+ this._dialog = _dialog;
304
+ this._prompt = _prompt;
305
+ this.blockGroups = [];
306
+ this._selectedBlocks$ = new BehaviorSubject([]);
307
+ this._blockComponents$ = new BehaviorSubject([]);
308
+ this._blockClippable$ = new BehaviorSubject(null);
309
+ this._destroy$ = new Subject();
310
+ }
311
+ get blockComponents$() {
312
+ return this._blockComponents$.asObservable();
313
+ }
314
+ set blockComponents(blockComponents) {
315
+ this._blockComponents$.next(blockComponents);
316
+ }
317
+ init(config) {
318
+ this.config = config;
319
+ this._store.init(config.blocks);
320
+ this._initBlockGroups();
321
+ this._initBlockChange();
322
+ }
323
+ blockAdd(block) {
324
+ if (!this.config.blockAdd) {
325
+ console.warn('[BlockEditor] Config "blockAdd" is not defined');
326
+ return;
327
+ }
328
+ block = this._initBlock(block);
329
+ this.config.blockAdd(block)
330
+ .pipe(takeUntil(this._destroy$))
331
+ .subscribe((newBlock) => {
332
+ this._store.blockAdd(newBlock);
333
+ });
334
+ }
335
+ blockUpload(block, fsFile) {
336
+ if (!this.config.blockUpload) {
337
+ return throwError('[BlockEditor] Config "blockUpload" is not defined');
338
+ }
339
+ const existing = this._store.blockExists(block);
340
+ if (!existing) {
341
+ block = this._initBlock(block);
342
+ }
343
+ return from(fsFile.imageInfo)
344
+ .pipe(switchMap((imageInfo) => {
345
+ if (!existing && (imageInfo === null || imageInfo === void 0 ? void 0 : imageInfo.height) && (imageInfo === null || imageInfo === void 0 ? void 0 : imageInfo.width)) {
346
+ const ratio = imageInfo.height / imageInfo.width;
347
+ block.width = this.config.width * .4;
348
+ block.height = block.width * ratio;
349
+ }
350
+ return this.config.blockUpload(block, fsFile.file);
351
+ }), tap((newBlock) => {
352
+ if (existing) {
353
+ this._store.blockUpdate(Object.assign(Object.assign({}, block), newBlock));
354
+ }
355
+ else {
356
+ this.blockAdd(newBlock);
357
+ }
358
+ }), takeUntil(this._destroy$));
359
+ }
360
+ blockRemove(block) {
361
+ this._store.blockRemove(block);
362
+ }
363
+ get blocks$() {
364
+ return this._store.blocks$;
365
+ }
366
+ get blockChanged$() {
367
+ return this._store.blockChanged$;
368
+ }
369
+ get blockUpdated$() {
370
+ return this._store.blockUpdated$;
371
+ }
372
+ get blockClippable$() {
373
+ return this._blockClippable$.asObservable();
374
+ }
375
+ set blockClippable(value) {
376
+ this._blockClippable$.next(value);
377
+ }
378
+ get blockAdded$() {
379
+ return this._store.blockAdded$;
380
+ }
381
+ get blockRemoved$() {
382
+ return this._store.blockRemoved$;
383
+ }
384
+ get blocks() {
385
+ return this._store.blocks;
386
+ }
387
+ blockChange(block) {
388
+ this._store.blockChange(block);
389
+ }
390
+ applyBlockGroup(block, blockGroup) {
391
+ block.name = blockGroup === null || blockGroup === void 0 ? void 0 : blockGroup.name;
392
+ block.description = blockGroup === null || blockGroup === void 0 ? void 0 : blockGroup.description;
393
+ block.label = blockGroup === null || blockGroup === void 0 ? void 0 : blockGroup.label;
394
+ this.blockChange(block);
395
+ }
396
+ isSelectedBlock(block) {
397
+ return this.selectedBlocks.indexOf(block) !== -1;
398
+ }
399
+ indexOf(block) {
400
+ return this.blocks.map((e) => e.guid).indexOf(block.guid);
401
+ }
402
+ selectedBlockComponentChangeProperty(values) {
403
+ this.selectedBlocks
404
+ .forEach((block) => {
405
+ Object.keys(values)
406
+ .forEach((name) => {
407
+ block[name] = values[name];
408
+ });
409
+ this.blockChange(block);
410
+ });
411
+ }
412
+ blockGroupChangeProperty(blockGroup, values) {
413
+ this.blocks
414
+ .filter((block) => block.name === blockGroup.name)
415
+ .forEach((block) => {
416
+ Object.keys(values)
417
+ .forEach((name) => {
418
+ block[name] = values[name];
419
+ });
420
+ this.blockChange(block);
421
+ });
422
+ }
423
+ get selectedBlocks$() {
424
+ return this._selectedBlocks$;
425
+ }
426
+ set selectedBlock(block) {
427
+ this.selectedBlocks = [block];
428
+ }
429
+ set selectedBlocks(blocks) {
430
+ this._selectedBlocks$.next(blocks);
431
+ if (this.config.blocksSelect) {
432
+ this.config.blocksSelect(blocks);
433
+ }
434
+ }
435
+ get selectedBlocks() {
436
+ return this._selectedBlocks$.getValue();
437
+ }
438
+ saveSelection() {
439
+ const selection = window.getSelection();
440
+ this._selectionRange = selection.getRangeAt(0);
441
+ }
442
+ restoreSelection() {
443
+ if (this._selectionRange) {
444
+ const selection = window.getSelection();
445
+ selection.removeAllRanges();
446
+ selection.addRange(this._selectionRange);
447
+ }
448
+ }
449
+ hasSelectionRange() {
450
+ return this._selectionRange && (this._selectionRange.baseOffset - this._selectionRange.focusOffset) > 0;
451
+ }
452
+ registerContainer(container) {
453
+ this.container = container;
454
+ }
455
+ registerMargin(margin) {
456
+ this.margin = margin;
457
+ }
458
+ removeBlocks(blocks) {
459
+ this._prompt.confirm({
460
+ title: 'Confirm',
461
+ template: 'Are you sure your would like to delete this block?',
462
+ })
463
+ .pipe(switchMap(() => this.config.blocksRemove ? this.config.blocksRemove(blocks) : throwError('config.blocksRemove is not configured')), takeUntil(this._destroy$))
464
+ .subscribe(() => {
465
+ blocks.forEach((block) => {
466
+ this.blockRemove(block);
467
+ });
468
+ this.selectedBlocks = [];
469
+ });
470
+ }
471
+ openReorderDialog() {
472
+ const blocks = this.blocks
473
+ .sort((blockA, blockB) => (blockA.index - blockB.index))
474
+ .reverse();
475
+ this._dialog
476
+ .open(LayersReorderDialogComponent, {
477
+ data: {
478
+ blocks,
479
+ },
480
+ })
481
+ .afterClosed()
482
+ .pipe(filter((b) => !!b), switchMap((b) => this.config.blocksReorder(b)
483
+ .pipe(mapTo(blocks))), takeUntil(this._destroy$))
484
+ .subscribe((b) => {
485
+ b
486
+ .forEach((block, index) => {
487
+ block.index = index;
488
+ });
489
+ });
490
+ }
491
+ ngOnDestroy() {
492
+ this._destroy$.next();
493
+ this._destroy$.complete();
494
+ }
495
+ _initBlockGroups() {
496
+ this.blockGroups = Object.values(this._store.blocks
497
+ .reduce((accum, block) => {
498
+ if (block.name) {
499
+ const existing = accum[block.name] || {};
500
+ accum[block.name] = {
501
+ label: block.label || existing.label,
502
+ description: block.description || existing.description,
503
+ name: block.name,
504
+ };
505
+ }
506
+ return accum;
507
+ }, {}));
508
+ }
509
+ _initBlockChange() {
510
+ if (this.config.blockChange) {
511
+ this.blockChanged$
512
+ .pipe(groupBy((block) => (block.guid)), map((group) => group.pipe(debounceTime(250))), mergeAll())
513
+ .subscribe((block) => {
514
+ this.config.blockChange(block);
515
+ });
516
+ }
517
+ }
518
+ _initBlock(block) {
519
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
520
+ let newBlock = Object.assign(Object.assign({}, block), { shapeBottomLeft: (_a = block.shapeBottomLeft) !== null && _a !== void 0 ? _a : 'round', shapeTopLeft: (_b = block.shapeTopLeft) !== null && _b !== void 0 ? _b : 'round', shapeTopRight: (_c = block.shapeTopRight) !== null && _c !== void 0 ? _c : 'round', shapeBottomRight: (_d = block.shapeBottomRight) !== null && _d !== void 0 ? _d : 'round', verticalAlign: (_e = block.verticalAlign) !== null && _e !== void 0 ? _e : 'top', horizontalAlign: (_f = block.horizontalAlign) !== null && _f !== void 0 ? _f : 'left', index: block.guid ? block.index : this._store.blocks.length, guid: block.guid || guid('xxxxxxxxxxxx'), keepRatio: (_g = block.keepRatio) !== null && _g !== void 0 ? _g : [
521
+ BlockType.Checkbox,
522
+ BlockType.RadioButton,
523
+ BlockType.Pdf,
524
+ ]
525
+ .indexOf(block.type) !== -1 });
526
+ let width = (this.config.width * .333).toFixed(2);
527
+ let height = width / 2;
528
+ if (newBlock.type === BlockType.Rectangle) {
529
+ newBlock = Object.assign(Object.assign({}, newBlock), { borderColor: (_h = newBlock.borderColor) !== null && _h !== void 0 ? _h : '#cccccc', borderWidth: (_j = newBlock.borderWidth) !== null && _j !== void 0 ? _j : 1 });
530
+ }
531
+ else if (newBlock.type === BlockType.Checkbox || newBlock.type === BlockType.RadioButton) {
532
+ width = .25;
533
+ height = .25;
534
+ }
535
+ else {
536
+ width = 2;
537
+ height = .5;
538
+ }
539
+ //get max tabindex
540
+ // newBlock.tabIndex = this._lastTabIndex + 1;
541
+ // this.updateTabIndex(newBlock.tabIndex);
542
+ return Object.assign({ top: height, left: width, width,
543
+ height }, newBlock);
544
+ }
545
+ }
546
+ BlockEditorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: BlockEditorService, deps: [{ token: BlocksStore }, { token: i2$1.FsDialog }, { token: i3$2.FsPrompt }], target: i0.ɵɵFactoryTarget.Injectable });
547
+ BlockEditorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: BlockEditorService });
548
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: BlockEditorService, decorators: [{
549
+ type: Injectable
550
+ }], ctorParameters: function () { return [{ type: BlocksStore }, { type: i2$1.FsDialog }, { type: i3$2.FsPrompt }]; } });
551
551
 
552
- class CreateImageUrlPipe {
553
- constructor(_api) {
554
- this._api = _api;
555
- }
556
- transform(url) {
557
- return this._api.createApiFile(url).safeDataUrl;
558
- }
559
- }
560
- CreateImageUrlPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: CreateImageUrlPipe, deps: [{ token: i1$1.FsApi }], target: i0.ɵɵFactoryTarget.Pipe });
561
- CreateImageUrlPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: CreateImageUrlPipe, name: "createImageUrl" });
562
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: CreateImageUrlPipe, decorators: [{
563
- type: Pipe,
564
- args: [{ name: 'createImageUrl' }]
552
+ class CreateImageUrlPipe {
553
+ constructor(_api) {
554
+ this._api = _api;
555
+ }
556
+ transform(url) {
557
+ return this._api.createApiFile(url).safeDataUrl;
558
+ }
559
+ }
560
+ CreateImageUrlPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CreateImageUrlPipe, deps: [{ token: i1$1.FsApi }], target: i0.ɵɵFactoryTarget.Pipe });
561
+ CreateImageUrlPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: CreateImageUrlPipe, name: "createImageUrl" });
562
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CreateImageUrlPipe, decorators: [{
563
+ type: Pipe,
564
+ args: [{ name: 'createImageUrl' }]
565
565
  }], ctorParameters: function () { return [{ type: i1$1.FsApi }]; } });
566
566
 
567
- class FsBlockComponent {
568
- constructor(_blockEditor, _elementRef, _cdRef, _fontPickerService) {
569
- this._blockEditor = _blockEditor;
570
- this._elementRef = _elementRef;
571
- this._cdRef = _cdRef;
572
- this._fontPickerService = _fontPickerService;
573
- this.transformating = false;
574
- this.BlockType = BlockType;
575
- this._editable = false;
576
- this._transformable = false;
577
- this._destroy$ = new Subject();
578
- }
579
- set block(block) {
580
- this._block = block;
581
- this._block.resizable = !this.hasType([BlockType.Checkbox, BlockType.RadioButton]);
582
- this._block.rotatable = !this.hasType([BlockType.Checkbox, BlockType.RadioButton]);
583
- this._block.scalable = !this.hasType([BlockType.Checkbox, BlockType.RadioButton]);
584
- if (this.moveable) {
585
- this._updateMoveable();
586
- }
587
- this.typeForm = BlockTypes
588
- .some((blockType) => {
589
- return blockType.type === 'form' && blockType.value === this.block.type;
590
- });
591
- }
592
- get block() {
593
- return this._block;
594
- }
595
- keydown(event) {
596
- if (this.selected) {
597
- if (['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].indexOf(event.key) !== -1) {
598
- this._move(event);
599
- }
600
- if (['Delete', 'Backspace'].indexOf(event.key) !== -1) {
601
- this._delete(event);
602
- }
603
- }
604
- }
605
- get el() {
606
- return this.element.nativeElement;
607
- }
608
- get moveable() {
609
- return this._moveable;
610
- }
611
- hasType(types) {
612
- return types.includes(this.block.type);
613
- }
614
- get editable() {
615
- return this._editable;
616
- }
617
- set editable(value) {
618
- this._editable = value;
619
- if (!value) {
620
- this.deselectContent();
621
- }
622
- }
623
- get styleTop() {
624
- const top = this.block.top;
625
- return `${top}${this.unit}`;
626
- }
627
- get styleLeft() {
628
- const left = this.block.left;
629
- return `${left}${this.unit}`;
630
- }
631
- get styleWidth() {
632
- let width = this.block.width;
633
- if (this.block.clipPath) {
634
- width -= (this.block.width * this.block.clipPath.values[1] / 100) +
635
- (this.block.width * this.block.clipPath.values[3] / 100);
636
- }
637
- return `${width}${this.unit}`;
638
- }
639
- get styleHeight() {
640
- let height = this.block.height;
641
- if (this.block.clipPath) {
642
- height -= (this.block.height * this.block.clipPath.values[0] / 100) +
643
- (this.block.height * this.block.clipPath.values[2] / 100);
644
- }
645
- return `${height}${this.unit}`;
646
- }
647
- get styleImageHeight() {
648
- const height = this.block.height;
649
- if (this.block.clipPath) {
650
- const values = this.block.clipPath.values || {};
651
- }
652
- return `${height}${this.unit}`;
653
- }
654
- get styleImageWidth() {
655
- const width = this.block.width;
656
- if (this.block.clipPath) {
657
- const values = this.block.clipPath.values || {};
658
- }
659
- return `${width}${this.unit}`;
660
- }
661
- get styleImageTop() {
662
- let top = 0;
663
- if (this.block.clipPath) {
664
- const values = this.block.clipPath.values || {};
665
- top = (values[0] / 100) * this.block.width * -1;
666
- }
667
- return `${top}${this.unit}`;
668
- }
669
- get styleImageLeft() {
670
- let left = 0;
671
- if (this.block.clipPath) {
672
- const values = this.block.clipPath.values || {};
673
- left = (values[3] / 100) * this.block.width * -1;
674
- }
675
- return `${left}${this.unit}`;
676
- }
677
- get styleClipPath() {
678
- if (!this.block.clipPath) {
679
- return null;
680
- }
681
- const values = this.block.clipPath.values || {};
682
- const top = values[0] / 100 * this.block.height;
683
- const right = (values[1]) / 100 * this.block.width;
684
- const bottom = (values[2]) / 100 * this.block.height;
685
- const left = values[3] / 100 * this.block.width;
686
- const clipPath = `inset(${top}${this.unit} ${right}${this.unit} ${bottom}${this.unit} ${left}${this.unit})`;
687
- return clipPath;
688
- }
689
- get styleBoxShadow() {
690
- if (!this.block.shadowColor) {
691
- return null;
692
- }
693
- const shadow = `${this.block.shadowX}pt ${(this.block.shadowY || 0)}pt ${(this.block.shadowBlur || 0)}pt ${(this.block.shadowSpread || 0)}pt ${this.block.shadowColor}`;
694
- return shadow;
695
- }
696
- set elementGuidelines(value) {
697
- this.moveable.elementGuidelines = value;
698
- }
699
- get clippable() {
700
- return !!this.moveable.clippable;
701
- }
702
- set clippable(value) {
703
- this.moveable.clippable = value;
704
- if (this.selected) {
705
- this.moveable.resizable = !value;
706
- this.moveable.rotatable = !value;
707
- this.moveable.scalable = !value;
708
- }
709
- }
710
- get transformable() {
711
- return this._transformable;
712
- }
713
- set transformable(value) {
714
- this._transformable = value;
715
- this._updateMoveable();
716
- }
717
- set rotate(value) {
718
- this.moveable.request('rotatable', { rotate: parseFloat(value) }, true);
719
- this.moveable.updateRect();
720
- }
721
- set index(value) {
722
- this.block.index = value;
723
- }
724
- set keepRatio(value) {
725
- this.moveable.keepRatio = value;
726
- }
727
- markForCheck() {
728
- this._cdRef.markForCheck();
729
- }
730
- ngOnInit() {
731
- this.unit = this._blockEditor.config.unit;
732
- this.content = this.block.content;
733
- this.block.shadowOpacity = this.block.shadowOpacity || 100;
734
- this._blockEditor.selectedBlocks$
735
- .pipe(skip(1), takeUntil(this._destroy$))
736
- .subscribe((blocks) => {
737
- if (document.activeElement instanceof HTMLElement) {
738
- document.activeElement.blur();
739
- }
740
- this.selected = blocks
741
- .some((block) => block.guid === this.block.guid);
742
- this.transformable = true;
743
- this._cdRef.markForCheck();
744
- });
745
- this._blockEditor.blockClippable$
746
- .pipe(filter(() => this.selected), takeUntil(this._destroy$))
747
- .subscribe((clippable) => {
748
- this.clippable = clippable;
749
- this._cdRef.markForCheck();
750
- });
751
- this._blockEditor.blockAdded$
752
- .pipe(takeUntil(this._destroy$))
753
- .subscribe(() => {
754
- this._cdRef.markForCheck();
755
- });
756
- this._blockEditor.blockUpdated$
757
- .pipe(filter((block) => block.guid === this.block.guid), takeUntil(this._destroy$))
758
- .subscribe((block) => {
759
- this.block = block;
760
- this._cdRef.markForCheck();
761
- });
762
- this._blockEditor.blockChanged$
763
- .pipe(filter((block) => block.guid === this.block.guid), takeUntil(this._destroy$))
764
- .subscribe((block) => {
765
- this.block = block;
766
- this._cdRef.markForCheck();
767
- });
768
- }
769
- ngAfterViewInit() {
770
- setTimeout(() => {
771
- this._initEvents();
772
- this._initFont();
773
- this._initMoveable();
774
- this._setTransform();
775
- this._initElementGuidelines();
776
- this.rotate = this.block.rotate;
777
- });
778
- }
779
- pxToIn(px) {
780
- return this.round(px / 96, 2);
781
- }
782
- round(value, decimals) {
783
- return parseFloat(value.toFixed(decimals));
784
- }
785
- deselect() {
786
- this.editable = false;
787
- this.clippable = false;
788
- this.transformable = false;
789
- this.disableContentEdit();
790
- }
791
- disableContentEdit() {
792
- this.editable = false;
793
- }
794
- deselectContent() {
795
- if (window.getSelection) {
796
- if (window.getSelection().empty) {
797
- window.getSelection().empty();
798
- }
799
- else if (window.getSelection().removeAllRanges) {
800
- window.getSelection().removeAllRanges();
801
- }
802
- }
803
- }
804
- selectTextAll() {
805
- const range = document.createRange();
806
- range.selectNodeContents(this.contentEditable.nativeElement);
807
- const sel = window.getSelection();
808
- sel.removeAllRanges();
809
- sel.addRange(range);
810
- }
811
- ngOnDestroy() {
812
- //this._blockEditor.destroyBlock(this.block);
813
- this._destroy$.next();
814
- this._destroy$.complete();
815
- }
816
- _setTransform(transforms = []) {
817
- transforms = transforms !== null && transforms !== void 0 ? transforms : [];
818
- this.el.style.transform = transforms.join(' ');
819
- }
820
- _triggerChanged() {
821
- this._blockEditor.blockChange(this.block);
822
- }
823
- _updateMoveable() {
824
- const value = !this.block.lock && this.selected;
825
- this.keepRatio = this.block.keepRatio;
826
- this.rotate = this.block.rotate;
827
- this.moveable.resizable = this.block.resizable && value;
828
- this.moveable.rotatable = this.block.rotatable && value;
829
- this.moveable.scalable = this.block.scalable && value;
830
- }
831
- _initElementGuidelines() {
832
- this._blockEditor.blockComponents$
833
- .pipe(takeUntil(this._destroy$))
834
- .subscribe((blockComponents) => {
835
- this.moveable.elementGuidelines = blockComponents
836
- .filter((blockComponent) => this !== blockComponent)
837
- .map((blockComponent) => blockComponent.el);
838
- });
839
- }
840
- _initMoveable() {
841
- this._moveable = new Moveable(this._elementRef.nativeElement, {
842
- target: this.el,
843
- container: this._blockEditor.container,
844
- draggable: true,
845
- resizable: false,
846
- scalable: false,
847
- rotatable: false,
848
- warpable: false,
849
- origin: false,
850
- clipRelative: true,
851
- clipArea: true,
852
- keepRatio: this.block.keepRatio,
853
- snappable: true,
854
- snapDirections: { left: true, top: true, right: true, bottom: true, center: true, middle: true },
855
- elementSnapDirections: { left: true, top: true, right: true, bottom: true, center: true, middle: true },
856
- edge: false,
857
- throttleDrag: 1,
858
- throttleScale: 0.01,
859
- throttleRotate: 1,
860
- throttleResize: 1,
861
- snapDistFormat: (v, type) => `${this.round(v / 96, 2)}`,
862
- });
863
- this._updateMoveable();
864
- this.moveable
865
- .on('clip', (e) => {
866
- this.moveable.keepRatio = false;
867
- e.target.style.clipPath = e.clipStyle;
868
- this.block.clipPath = {
869
- type: 'inset',
870
- values: e.clipStyles
871
- .map((value) => {
872
- const n = Number(value.replace('%', ''));
873
- return n > 0 ? n : 0;
874
- }),
875
- };
876
- })
877
- .on('clipEnd', (e) => {
878
- this.moveable.keepRatio = true;
879
- e.target.style.clipPath = null;
880
- this._triggerChanged();
881
- setTimeout(() => {
882
- this.moveable.updateRect();
883
- }, 100);
884
- })
885
- .on('dragStart', () => {
886
- this.disableContentEdit();
887
- this.transformating = true;
888
- this._cdRef.markForCheck();
889
- })
890
- .on('drag', ({ target, left, top }) => {
891
- target.style.left = `${this.pxToIn(left)}${this.unit}`;
892
- target.style.top = `${this.pxToIn(top)}${this.unit}`;
893
- this.block.top = this.pxToIn(top);
894
- this.block.left = this.pxToIn(left);
895
- })
896
- .on('dragEnd', () => {
897
- this.transformating = false;
898
- this._triggerChanged();
899
- this._cdRef.markForCheck();
900
- })
901
- .on('resizeStart', () => {
902
- this.disableContentEdit();
903
- this.zoompan.disable();
904
- this.transformating = true;
905
- this._cdRef.markForCheck();
906
- })
907
- .on('resize', ({ target, width, height, dist, delta, direction }) => {
908
- width = this.pxToIn(width);
909
- height = this.pxToIn(height);
910
- if (delta[0]) {
911
- this.block.width = width;
912
- target.style.width = `${width}${this.unit}`;
913
- }
914
- if (delta[1]) {
915
- this.block.height = height;
916
- target.style.height = `${height}${this.unit}`;
917
- }
918
- const transform = [0, 0];
919
- if (direction[1] === -1) {
920
- transform[1] = dist[1] * -1;
921
- }
922
- if (direction[0] === -1) {
923
- transform[0] = dist[0] * -1;
924
- }
925
- this._setTransform([`translate(${transform[0]}px, ${transform[1]}px)`]);
926
- })
927
- .on('resizeEnd', ({ target }) => {
928
- const matrix = new WebKitCSSMatrix(target.style.transform);
929
- this.block.top = parseFloat(target.style.top) + this.pxToIn(matrix.m42);
930
- this.block.left = parseFloat(target.style.left) + this.pxToIn(matrix.m41);
931
- this._setTransform();
932
- this._triggerChanged();
933
- this.zoompan.enable();
934
- this.transformating = false;
935
- this._cdRef.markForCheck();
936
- target.style.top = `${this.block.top}in`;
937
- target.style.left = `${this.block.left}in`;
938
- target.style.width = `${this.block.width}in`;
939
- target.style.height = `${this.block.height}in`;
940
- this.moveable.updateRect();
941
- })
942
- .on('rotateStart', ({ inputEvent }) => {
943
- if (inputEvent) {
944
- this.zoompan.disable();
945
- this.disableContentEdit();
946
- this.transformating = true;
947
- this._cdRef.markForCheck();
948
- }
949
- })
950
- .on('rotate', ({ inputEvent, transform, rotation }) => {
951
- this.el.style.transform = transform;
952
- this.block.rotate = rotation % 360;
953
- if (inputEvent) {
954
- this.zoompan.enable();
955
- }
956
- })
957
- .on('rotateEnd', ({ inputEvent }) => {
958
- if (inputEvent) {
959
- this.transformating = false;
960
- this._cdRef.markForCheck();
961
- this._triggerChanged();
962
- }
963
- });
964
- }
965
- _initFont() {
966
- if (this.block.fontFamily) {
967
- this._fontPickerService.importFont(this.block.fontFamily);
968
- }
969
- }
970
- _initEvents() {
971
- fromEvent(this.contentEditable.nativeElement, 'paste')
972
- .pipe(takeUntil(this._destroy$))
973
- .subscribe((e) => {
974
- e.preventDefault();
975
- const clipboardData = e.clipboardData;
976
- const text = clipboardData.getData('Text');
977
- const range = document.getSelection().getRangeAt(0);
978
- range.deleteContents();
979
- const textNode = document.createTextNode(text);
980
- range.insertNode(textNode);
981
- range.selectNodeContents(textNode);
982
- range.collapse(false);
983
- const selection = window.getSelection();
984
- selection.removeAllRanges();
985
- selection.addRange(range);
986
- this.block.content = this.contentEditable.nativeElement.innerHTML;
987
- this._triggerChanged();
988
- });
989
- fromEvent(this.contentEditable.nativeElement, 'input')
990
- .pipe(takeUntil(this._destroy$)).subscribe((event) => {
991
- this.block.content = event.target.innerHTML;
992
- this._triggerChanged();
993
- });
994
- fromEvent(this.el, 'mousedown')
995
- .pipe(takeUntil(this._destroy$))
996
- .subscribe((event) => {
997
- if (this.block.lock) {
998
- event.preventDefault();
999
- event.stopImmediatePropagation();
1000
- event.stopPropagation();
1001
- }
1002
- else {
1003
- this.zoompan.disable();
1004
- }
1005
- if (!this.moveable.clippable) {
1006
- if (this.editable) {
1007
- if (this.contentElement.nativeElement.isSameNode(event.target)) {
1008
- event.preventDefault();
1009
- event.stopImmediatePropagation();
1010
- event.stopPropagation();
1011
- }
1012
- }
1013
- else {
1014
- this._blockEditor.selectedBlock = this.block;
1015
- }
1016
- }
1017
- });
1018
- fromEvent(this.el, 'mouseup')
1019
- .pipe(takeUntil(this._destroy$)).subscribe(() => {
1020
- this.zoompan.enable();
1021
- });
1022
- fromEvent(this.el, 'dblclick')
1023
- .pipe(filter(() => (!this.editable)), takeUntil(this._destroy$))
1024
- .subscribe((event) => {
1025
- if (this.block.readonly) {
1026
- event.preventDefault();
1027
- }
1028
- else {
1029
- this.editable = true;
1030
- this._cdRef.markForCheck();
1031
- setTimeout(() => {
1032
- this.selectTextAll();
1033
- });
1034
- }
1035
- });
1036
- }
1037
- _move(event) {
1038
- if (!this.selected ||
1039
- this.editable) {
1040
- return;
1041
- }
1042
- event.preventDefault();
1043
- const inchPixel = 1 / 100;
1044
- switch (event.key) {
1045
- case 'ArrowUp':
1046
- this.block.top = round(this.block.top - inchPixel, 2);
1047
- break;
1048
- case 'ArrowDown':
1049
- this.block.top = round(this.block.top + inchPixel, 2);
1050
- break;
1051
- case 'ArrowLeft':
1052
- this.block.left = round(this.block.left - inchPixel, 2);
1053
- break;
1054
- case 'ArrowRight':
1055
- this.block.left = round(this.block.left + inchPixel, 2);
1056
- break;
1057
- }
1058
- this._blockEditor.blockChange(this.block);
1059
- }
1060
- _delete(event) {
1061
- var _a, _b;
1062
- if (this.selected &&
1063
- !this.editable &&
1064
- ((_a = event.target) === null || _a === void 0 ? void 0 : _a.nodeName) !== 'INPUT' &&
1065
- ((_b = event.target) === null || _b === void 0 ? void 0 : _b.nodeName) !== 'TEXTAREA') {
1066
- event.preventDefault();
1067
- this._blockEditor.removeBlocks([this.block]);
1068
- }
1069
- }
1070
- }
1071
- FsBlockComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsBlockComponent, deps: [{ token: BlockEditorService }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i2$1.FsFontPickerService }], target: i0.ɵɵFactoryTarget.Component });
1072
- FsBlockComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: FsBlockComponent, selector: "fs-block", inputs: { block: "block", html: "html", zoompan: "zoompan" }, host: { listeners: { "document:keydown": "keydown($event)" }, properties: { "class.transforming": "this.transformating" } }, viewQueries: [{ propertyName: "element", first: true, predicate: ["element"], descendants: true, static: true }, { propertyName: "contentElement", first: true, predicate: ["contentElement"], descendants: true, static: true }, { propertyName: "contentEditable", first: true, predicate: ["contentEditable"], descendants: true, static: true }], ngImport: i0, template: "<div\n #element\n [class]=\"'block ' + 'block-' + block.type\"\n [style.top]=\"styleTop\"\n [style.left]=\"styleLeft\"\n [style.width]=\"styleWidth\"\n [style.height]=\"styleHeight\"\n [ngClass]=\"{ \n editable: editable, \n readonly: block.readonly,\n required: block.required,\n lock: block.lock,\n selected: selected\n }\"\n [style.zIndex]=\"block.index\">\n <div\n #contentElement\n class=\"content\"\n [style.borderColor]=\"block.borderColor\"\n [style.borderWidth]=\"block.borderWidth ? block.borderWidth + 'pt' : ''\"\n [style.borderStyle]=\"block.borderColor ? 'solid' : 'dashed'\"\n [style.textAlign]=\"block.horizontalAlign\"\n [style.fontStyle]=\"block.italic ? 'italic' : ''\"\n [style.fontFamily]=\"block.fontFamily || ''\"\n [style.fontSize]=\"block.fontSize ? block.fontSize + 'pt' : ''\"\n [style.lineHeight]=\"block.lineHeight ? block.lineHeight + 'pt' : ''\"\n [style.color]=\"block.fontColor\"\n [style.fontWeight]=\"block.bold ? 'bold' : ''\"\n [style.textDecoration]=\"block.underline ? 'underline' : ''\"\n [style.paddingTop]=\"block.paddingTop ? block.paddingTop + 'in' : ''\"\n [style.paddingBottom]=\"block.paddingBottom ? block.paddingBottom + 'in' : ''\"\n [style.paddingLeft]=\"block.paddingLeft ? block.paddingLeft + 'in' : ''\"\n [style.paddingRight]=\"block.paddingRight ? block.paddingRight + 'in' : ''\"\n [style.backgroundColor]=\"block.backgroundColor\"\n [style.borderBottomLeftRadius]=\"block.shapeRadius && block.shapeBottomLeft === 'round' ? block.shapeRadius + '%' : ''\"\n [style.borderBottomRightRadius]=\"block.shapeRadius && block.shapeBottomRight === 'round' ? block.shapeRadius + '%' : ''\"\n [style.borderTopRightRadius]=\"block.shapeRadius && block.shapeTopRight === 'round' ? block.shapeRadius + '%' : ''\"\n [style.borderTopLeftRadius]=\"block.shapeRadius && block.shapeTopLeft === 'round' ? block.shapeRadius + '%' : ''\"\n [style.boxShadow]=\"styleBoxShadow\"\n [ngClass]=\"{\n 'editable': editable,\n 'vertical-align-center': block.verticalAlign === 'center',\n 'vertical-align-bottom': block.verticalAlign === 'bottom'\n }\">\n <ng-container *ngIf=\"block.imageUrl && ((block.imageUrl | createImageUrl) | async) as src\">\n <img \n [style.opacity]=\"block.imageOpacity ? block.imageOpacity/100 : 1\"\n [src]=\"src\">\n </ng-container>\n <ng-container *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText || block.type === BlockType.Date\">\n {{block.label || block.name}}\n </ng-container>\n <div\n #contentEditable\n [contentEditable]=\"editable && !typeForm\"\n class=\"content-editable\"\n [innerHTML]=\"content\">\n </div>\n </div>\n <div class=\"outline\"></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;box-sizing:border-box}.block.selected{border-color:#31a2ff95}.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;z-index:100}.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}.block.selected .outline,.block:hover .outline{border:1px solid rgba(68,170,255,.7);position:absolute;inset:0;-webkit-user-select:none;user-select:none}.block.selected.lock .outline,.block:hover.lock .outline{border-color:#e4181866;border-style:dashed}: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: i17.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i17.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i17.AsyncPipe, "createImageUrl": CreateImageUrlPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1073
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsBlockComponent, decorators: [{
1074
- type: Component,
1075
- args: [{ selector: 'fs-block', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n #element\n [class]=\"'block ' + 'block-' + block.type\"\n [style.top]=\"styleTop\"\n [style.left]=\"styleLeft\"\n [style.width]=\"styleWidth\"\n [style.height]=\"styleHeight\"\n [ngClass]=\"{ \n editable: editable, \n readonly: block.readonly,\n required: block.required,\n lock: block.lock,\n selected: selected\n }\"\n [style.zIndex]=\"block.index\">\n <div\n #contentElement\n class=\"content\"\n [style.borderColor]=\"block.borderColor\"\n [style.borderWidth]=\"block.borderWidth ? block.borderWidth + 'pt' : ''\"\n [style.borderStyle]=\"block.borderColor ? 'solid' : 'dashed'\"\n [style.textAlign]=\"block.horizontalAlign\"\n [style.fontStyle]=\"block.italic ? 'italic' : ''\"\n [style.fontFamily]=\"block.fontFamily || ''\"\n [style.fontSize]=\"block.fontSize ? block.fontSize + 'pt' : ''\"\n [style.lineHeight]=\"block.lineHeight ? block.lineHeight + 'pt' : ''\"\n [style.color]=\"block.fontColor\"\n [style.fontWeight]=\"block.bold ? 'bold' : ''\"\n [style.textDecoration]=\"block.underline ? 'underline' : ''\"\n [style.paddingTop]=\"block.paddingTop ? block.paddingTop + 'in' : ''\"\n [style.paddingBottom]=\"block.paddingBottom ? block.paddingBottom + 'in' : ''\"\n [style.paddingLeft]=\"block.paddingLeft ? block.paddingLeft + 'in' : ''\"\n [style.paddingRight]=\"block.paddingRight ? block.paddingRight + 'in' : ''\"\n [style.backgroundColor]=\"block.backgroundColor\"\n [style.borderBottomLeftRadius]=\"block.shapeRadius && block.shapeBottomLeft === 'round' ? block.shapeRadius + '%' : ''\"\n [style.borderBottomRightRadius]=\"block.shapeRadius && block.shapeBottomRight === 'round' ? block.shapeRadius + '%' : ''\"\n [style.borderTopRightRadius]=\"block.shapeRadius && block.shapeTopRight === 'round' ? block.shapeRadius + '%' : ''\"\n [style.borderTopLeftRadius]=\"block.shapeRadius && block.shapeTopLeft === 'round' ? block.shapeRadius + '%' : ''\"\n [style.boxShadow]=\"styleBoxShadow\"\n [ngClass]=\"{\n 'editable': editable,\n 'vertical-align-center': block.verticalAlign === 'center',\n 'vertical-align-bottom': block.verticalAlign === 'bottom'\n }\">\n <ng-container *ngIf=\"block.imageUrl && ((block.imageUrl | createImageUrl) | async) as src\">\n <img \n [style.opacity]=\"block.imageOpacity ? block.imageOpacity/100 : 1\"\n [src]=\"src\">\n </ng-container>\n <ng-container *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText || block.type === BlockType.Date\">\n {{block.label || block.name}}\n </ng-container>\n <div\n #contentEditable\n [contentEditable]=\"editable && !typeForm\"\n class=\"content-editable\"\n [innerHTML]=\"content\">\n </div>\n </div>\n <div class=\"outline\"></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;box-sizing:border-box}.block.selected{border-color:#31a2ff95}.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;z-index:100}.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}.block.selected .outline,.block:hover .outline{border:1px solid rgba(68,170,255,.7);position:absolute;inset:0;-webkit-user-select:none;user-select:none}.block.selected.lock .outline,.block:hover.lock .outline{border-color:#e4181866;border-style:dashed}: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"] }]
1076
- }], ctorParameters: function () { return [{ type: BlockEditorService }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i2$1.FsFontPickerService }]; }, propDecorators: { element: [{
1077
- type: ViewChild,
1078
- args: ['element', { static: true }]
1079
- }], contentElement: [{
1080
- type: ViewChild,
1081
- args: ['contentElement', { static: true }]
1082
- }], contentEditable: [{
1083
- type: ViewChild,
1084
- args: ['contentEditable', { static: true }]
1085
- }], block: [{
1086
- type: Input,
1087
- args: ['block']
1088
- }], html: [{
1089
- type: Input
1090
- }], zoompan: [{
1091
- type: Input
1092
- }], transformating: [{
1093
- type: HostBinding,
1094
- args: ['class.transforming']
1095
- }], keydown: [{
1096
- type: HostListener,
1097
- args: ['document:keydown', ['$event']]
567
+ class FsBlockComponent {
568
+ constructor(_blockEditor, _elementRef, _cdRef, _fontPickerService) {
569
+ this._blockEditor = _blockEditor;
570
+ this._elementRef = _elementRef;
571
+ this._cdRef = _cdRef;
572
+ this._fontPickerService = _fontPickerService;
573
+ this.transformating = false;
574
+ this.BlockType = BlockType;
575
+ this._editable = false;
576
+ this._transformable = false;
577
+ this._destroy$ = new Subject();
578
+ }
579
+ set block(block) {
580
+ this._block = block;
581
+ this._block.resizable = !this.hasType([BlockType.Checkbox, BlockType.RadioButton]);
582
+ this._block.rotatable = !this.hasType([BlockType.Checkbox, BlockType.RadioButton]);
583
+ this._block.scalable = !this.hasType([BlockType.Checkbox, BlockType.RadioButton]);
584
+ if (this.moveable) {
585
+ this._updateMoveable();
586
+ }
587
+ this.typeForm = BlockTypes
588
+ .some((blockType) => {
589
+ return blockType.type === 'form' && blockType.value === this.block.type;
590
+ });
591
+ }
592
+ get block() {
593
+ return this._block;
594
+ }
595
+ keydown(event) {
596
+ if (this.selected) {
597
+ if (['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].indexOf(event.key) !== -1) {
598
+ this._move(event);
599
+ }
600
+ if (['Delete', 'Backspace'].indexOf(event.key) !== -1) {
601
+ this._delete(event);
602
+ }
603
+ }
604
+ }
605
+ get el() {
606
+ return this.element.nativeElement;
607
+ }
608
+ get moveable() {
609
+ return this._moveable;
610
+ }
611
+ hasType(types) {
612
+ return types.includes(this.block.type);
613
+ }
614
+ get editable() {
615
+ return this._editable;
616
+ }
617
+ set editable(value) {
618
+ this._editable = value;
619
+ if (!value) {
620
+ this.deselectContent();
621
+ }
622
+ }
623
+ get styleTop() {
624
+ const top = this.block.top;
625
+ return `${top}${this.unit}`;
626
+ }
627
+ get styleLeft() {
628
+ const left = this.block.left;
629
+ return `${left}${this.unit}`;
630
+ }
631
+ get styleWidth() {
632
+ let width = this.block.width;
633
+ if (this.block.clipPath) {
634
+ width -= (this.block.width * this.block.clipPath.values[1] / 100) +
635
+ (this.block.width * this.block.clipPath.values[3] / 100);
636
+ }
637
+ return `${width}${this.unit}`;
638
+ }
639
+ get styleHeight() {
640
+ let height = this.block.height;
641
+ if (this.block.clipPath) {
642
+ height -= (this.block.height * this.block.clipPath.values[0] / 100) +
643
+ (this.block.height * this.block.clipPath.values[2] / 100);
644
+ }
645
+ return `${height}${this.unit}`;
646
+ }
647
+ get styleImageHeight() {
648
+ const height = this.block.height;
649
+ if (this.block.clipPath) {
650
+ const values = this.block.clipPath.values || {};
651
+ }
652
+ return `${height}${this.unit}`;
653
+ }
654
+ get styleImageWidth() {
655
+ const width = this.block.width;
656
+ if (this.block.clipPath) {
657
+ const values = this.block.clipPath.values || {};
658
+ }
659
+ return `${width}${this.unit}`;
660
+ }
661
+ get styleImageTop() {
662
+ let top = 0;
663
+ if (this.block.clipPath) {
664
+ const values = this.block.clipPath.values || {};
665
+ top = (values[0] / 100) * this.block.width * -1;
666
+ }
667
+ return `${top}${this.unit}`;
668
+ }
669
+ get styleImageLeft() {
670
+ let left = 0;
671
+ if (this.block.clipPath) {
672
+ const values = this.block.clipPath.values || {};
673
+ left = (values[3] / 100) * this.block.width * -1;
674
+ }
675
+ return `${left}${this.unit}`;
676
+ }
677
+ get styleClipPath() {
678
+ if (!this.block.clipPath) {
679
+ return null;
680
+ }
681
+ const values = this.block.clipPath.values || {};
682
+ const top = values[0] / 100 * this.block.height;
683
+ const right = (values[1]) / 100 * this.block.width;
684
+ const bottom = (values[2]) / 100 * this.block.height;
685
+ const left = values[3] / 100 * this.block.width;
686
+ const clipPath = `inset(${top}${this.unit} ${right}${this.unit} ${bottom}${this.unit} ${left}${this.unit})`;
687
+ return clipPath;
688
+ }
689
+ get styleBoxShadow() {
690
+ if (!this.block.shadowColor) {
691
+ return null;
692
+ }
693
+ const shadow = `${this.block.shadowX}pt ${(this.block.shadowY || 0)}pt ${(this.block.shadowBlur || 0)}pt ${(this.block.shadowSpread || 0)}pt ${this.block.shadowColor}`;
694
+ return shadow;
695
+ }
696
+ set elementGuidelines(value) {
697
+ this.moveable.elementGuidelines = value;
698
+ }
699
+ get clippable() {
700
+ return !!this.moveable.clippable;
701
+ }
702
+ set clippable(value) {
703
+ this.moveable.clippable = value;
704
+ if (this.selected) {
705
+ this.moveable.resizable = !value;
706
+ this.moveable.rotatable = !value;
707
+ this.moveable.scalable = !value;
708
+ }
709
+ }
710
+ get transformable() {
711
+ return this._transformable;
712
+ }
713
+ set transformable(value) {
714
+ this._transformable = value;
715
+ this._updateMoveable();
716
+ }
717
+ set rotate(value) {
718
+ this.moveable.request('rotatable', { rotate: parseFloat(value) }, true);
719
+ this.moveable.updateRect();
720
+ }
721
+ set index(value) {
722
+ this.block.index = value;
723
+ }
724
+ set keepRatio(value) {
725
+ this.moveable.keepRatio = value;
726
+ }
727
+ markForCheck() {
728
+ this._cdRef.markForCheck();
729
+ }
730
+ ngOnInit() {
731
+ this.unit = this._blockEditor.config.unit;
732
+ this.content = this.block.content;
733
+ this.block.shadowOpacity = this.block.shadowOpacity || 100;
734
+ this._blockEditor.selectedBlocks$
735
+ .pipe(skip(1), takeUntil(this._destroy$))
736
+ .subscribe((blocks) => {
737
+ if (document.activeElement instanceof HTMLElement) {
738
+ document.activeElement.blur();
739
+ }
740
+ this.selected = blocks
741
+ .some((block) => block.guid === this.block.guid);
742
+ this.transformable = true;
743
+ this._cdRef.markForCheck();
744
+ });
745
+ this._blockEditor.blockClippable$
746
+ .pipe(filter(() => this.selected), takeUntil(this._destroy$))
747
+ .subscribe((clippable) => {
748
+ this.clippable = clippable;
749
+ this._cdRef.markForCheck();
750
+ });
751
+ this._blockEditor.blockAdded$
752
+ .pipe(takeUntil(this._destroy$))
753
+ .subscribe(() => {
754
+ this._cdRef.markForCheck();
755
+ });
756
+ this._blockEditor.blockUpdated$
757
+ .pipe(filter((block) => block.guid === this.block.guid), takeUntil(this._destroy$))
758
+ .subscribe((block) => {
759
+ this.block = block;
760
+ this._cdRef.markForCheck();
761
+ });
762
+ this._blockEditor.blockChanged$
763
+ .pipe(filter((block) => block.guid === this.block.guid), takeUntil(this._destroy$))
764
+ .subscribe((block) => {
765
+ this.block = block;
766
+ this._cdRef.markForCheck();
767
+ });
768
+ }
769
+ ngAfterViewInit() {
770
+ setTimeout(() => {
771
+ this._initEvents();
772
+ this._initFont();
773
+ this._initMoveable();
774
+ this._setTransform();
775
+ this._initElementGuidelines();
776
+ this.rotate = this.block.rotate;
777
+ });
778
+ }
779
+ pxToIn(px) {
780
+ return this.round(px / 96, 2);
781
+ }
782
+ round(value, decimals) {
783
+ return parseFloat(value.toFixed(decimals));
784
+ }
785
+ deselect() {
786
+ this.editable = false;
787
+ this.clippable = false;
788
+ this.transformable = false;
789
+ this.disableContentEdit();
790
+ }
791
+ disableContentEdit() {
792
+ this.editable = false;
793
+ }
794
+ deselectContent() {
795
+ if (window.getSelection) {
796
+ if (window.getSelection().empty) {
797
+ window.getSelection().empty();
798
+ }
799
+ else if (window.getSelection().removeAllRanges) {
800
+ window.getSelection().removeAllRanges();
801
+ }
802
+ }
803
+ }
804
+ selectTextAll() {
805
+ const range = document.createRange();
806
+ range.selectNodeContents(this.contentEditable.nativeElement);
807
+ const sel = window.getSelection();
808
+ sel.removeAllRanges();
809
+ sel.addRange(range);
810
+ }
811
+ ngOnDestroy() {
812
+ //this._blockEditor.destroyBlock(this.block);
813
+ this._destroy$.next();
814
+ this._destroy$.complete();
815
+ }
816
+ _setTransform(transforms = []) {
817
+ transforms = transforms !== null && transforms !== void 0 ? transforms : [];
818
+ this.el.style.transform = transforms.join(' ');
819
+ }
820
+ _triggerChanged() {
821
+ this._blockEditor.blockChange(this.block);
822
+ }
823
+ _updateMoveable() {
824
+ const value = !this.block.lock && this.selected;
825
+ this.keepRatio = this.block.keepRatio;
826
+ this.rotate = this.block.rotate;
827
+ this.moveable.resizable = this.block.resizable && value;
828
+ this.moveable.rotatable = this.block.rotatable && value;
829
+ this.moveable.scalable = this.block.scalable && value;
830
+ }
831
+ _initElementGuidelines() {
832
+ this._blockEditor.blockComponents$
833
+ .pipe(takeUntil(this._destroy$))
834
+ .subscribe((blockComponents) => {
835
+ this.moveable.elementGuidelines = blockComponents
836
+ .filter((blockComponent) => this !== blockComponent)
837
+ .map((blockComponent) => blockComponent.el);
838
+ });
839
+ }
840
+ _initMoveable() {
841
+ this._moveable = new Moveable(this._elementRef.nativeElement, {
842
+ target: this.el,
843
+ container: this._blockEditor.container,
844
+ draggable: true,
845
+ resizable: false,
846
+ scalable: false,
847
+ rotatable: false,
848
+ warpable: false,
849
+ origin: false,
850
+ clipRelative: true,
851
+ clipArea: true,
852
+ keepRatio: this.block.keepRatio,
853
+ snappable: true,
854
+ snapDirections: { left: true, top: true, right: true, bottom: true, center: true, middle: true },
855
+ elementSnapDirections: { left: true, top: true, right: true, bottom: true, center: true, middle: true },
856
+ edge: false,
857
+ throttleDrag: 1,
858
+ throttleScale: 0.01,
859
+ throttleRotate: 1,
860
+ throttleResize: 1,
861
+ snapDistFormat: (v, type) => `${this.round(v / 96, 2)}`,
862
+ });
863
+ this._updateMoveable();
864
+ this.moveable
865
+ .on('clip', (e) => {
866
+ this.moveable.keepRatio = false;
867
+ e.target.style.clipPath = e.clipStyle;
868
+ this.block.clipPath = {
869
+ type: 'inset',
870
+ values: e.clipStyles
871
+ .map((value) => {
872
+ const n = Number(value.replace('%', ''));
873
+ return n > 0 ? n : 0;
874
+ }),
875
+ };
876
+ })
877
+ .on('clipEnd', (e) => {
878
+ this.moveable.keepRatio = true;
879
+ e.target.style.clipPath = null;
880
+ this._triggerChanged();
881
+ setTimeout(() => {
882
+ this.moveable.updateRect();
883
+ }, 100);
884
+ })
885
+ .on('dragStart', () => {
886
+ this.disableContentEdit();
887
+ this.transformating = true;
888
+ this._cdRef.markForCheck();
889
+ })
890
+ .on('drag', ({ target, left, top }) => {
891
+ target.style.left = `${this.pxToIn(left)}${this.unit}`;
892
+ target.style.top = `${this.pxToIn(top)}${this.unit}`;
893
+ this.block.top = this.pxToIn(top);
894
+ this.block.left = this.pxToIn(left);
895
+ })
896
+ .on('dragEnd', () => {
897
+ this.transformating = false;
898
+ this._triggerChanged();
899
+ this._cdRef.markForCheck();
900
+ })
901
+ .on('resizeStart', () => {
902
+ this.disableContentEdit();
903
+ this.zoompan.disable();
904
+ this.transformating = true;
905
+ this._cdRef.markForCheck();
906
+ })
907
+ .on('resize', ({ target, width, height, dist, delta, direction }) => {
908
+ width = this.pxToIn(width);
909
+ height = this.pxToIn(height);
910
+ if (delta[0]) {
911
+ this.block.width = width;
912
+ target.style.width = `${width}${this.unit}`;
913
+ }
914
+ if (delta[1]) {
915
+ this.block.height = height;
916
+ target.style.height = `${height}${this.unit}`;
917
+ }
918
+ const transform = [0, 0];
919
+ if (direction[1] === -1) {
920
+ transform[1] = dist[1] * -1;
921
+ }
922
+ if (direction[0] === -1) {
923
+ transform[0] = dist[0] * -1;
924
+ }
925
+ this._setTransform([`translate(${transform[0]}px, ${transform[1]}px)`]);
926
+ })
927
+ .on('resizeEnd', ({ target }) => {
928
+ const matrix = new WebKitCSSMatrix(target.style.transform);
929
+ this.block.top = parseFloat(target.style.top) + this.pxToIn(matrix.m42);
930
+ this.block.left = parseFloat(target.style.left) + this.pxToIn(matrix.m41);
931
+ this._setTransform();
932
+ this._triggerChanged();
933
+ this.zoompan.enable();
934
+ this.transformating = false;
935
+ this._cdRef.markForCheck();
936
+ target.style.top = `${this.block.top}in`;
937
+ target.style.left = `${this.block.left}in`;
938
+ target.style.width = `${this.block.width}in`;
939
+ target.style.height = `${this.block.height}in`;
940
+ this.moveable.updateRect();
941
+ })
942
+ .on('rotateStart', ({ inputEvent }) => {
943
+ if (inputEvent) {
944
+ this.zoompan.disable();
945
+ this.disableContentEdit();
946
+ this.transformating = true;
947
+ this._cdRef.markForCheck();
948
+ }
949
+ })
950
+ .on('rotate', ({ inputEvent, transform, rotation }) => {
951
+ this.el.style.transform = transform;
952
+ this.block.rotate = rotation % 360;
953
+ if (inputEvent) {
954
+ this.zoompan.enable();
955
+ }
956
+ })
957
+ .on('rotateEnd', ({ inputEvent }) => {
958
+ if (inputEvent) {
959
+ this.transformating = false;
960
+ this._cdRef.markForCheck();
961
+ this._triggerChanged();
962
+ }
963
+ });
964
+ }
965
+ _initFont() {
966
+ if (this.block.fontFamily) {
967
+ this._fontPickerService.importFont(this.block.fontFamily);
968
+ }
969
+ }
970
+ _initEvents() {
971
+ fromEvent(this.contentEditable.nativeElement, 'paste')
972
+ .pipe(takeUntil(this._destroy$))
973
+ .subscribe((e) => {
974
+ e.preventDefault();
975
+ const clipboardData = e.clipboardData;
976
+ const text = clipboardData.getData('Text');
977
+ const range = document.getSelection().getRangeAt(0);
978
+ range.deleteContents();
979
+ const textNode = document.createTextNode(text);
980
+ range.insertNode(textNode);
981
+ range.selectNodeContents(textNode);
982
+ range.collapse(false);
983
+ const selection = window.getSelection();
984
+ selection.removeAllRanges();
985
+ selection.addRange(range);
986
+ this.block.content = this.contentEditable.nativeElement.innerHTML;
987
+ this._triggerChanged();
988
+ });
989
+ fromEvent(this.contentEditable.nativeElement, 'input')
990
+ .pipe(takeUntil(this._destroy$)).subscribe((event) => {
991
+ this.block.content = event.target.innerHTML;
992
+ this._triggerChanged();
993
+ });
994
+ fromEvent(this.el, 'mousedown')
995
+ .pipe(takeUntil(this._destroy$))
996
+ .subscribe((event) => {
997
+ if (this.block.lock) {
998
+ event.preventDefault();
999
+ event.stopImmediatePropagation();
1000
+ event.stopPropagation();
1001
+ }
1002
+ else {
1003
+ this.zoompan.disable();
1004
+ }
1005
+ if (!this.moveable.clippable) {
1006
+ if (this.editable) {
1007
+ if (this.contentElement.nativeElement.isSameNode(event.target)) {
1008
+ event.preventDefault();
1009
+ event.stopImmediatePropagation();
1010
+ event.stopPropagation();
1011
+ }
1012
+ }
1013
+ else {
1014
+ this._blockEditor.selectedBlock = this.block;
1015
+ }
1016
+ }
1017
+ });
1018
+ fromEvent(this.el, 'mouseup')
1019
+ .pipe(takeUntil(this._destroy$)).subscribe(() => {
1020
+ this.zoompan.enable();
1021
+ });
1022
+ fromEvent(this.el, 'dblclick')
1023
+ .pipe(filter(() => (!this.editable)), takeUntil(this._destroy$))
1024
+ .subscribe((event) => {
1025
+ if (this.block.readonly) {
1026
+ event.preventDefault();
1027
+ }
1028
+ else {
1029
+ this.editable = true;
1030
+ this._cdRef.markForCheck();
1031
+ setTimeout(() => {
1032
+ this.selectTextAll();
1033
+ });
1034
+ }
1035
+ });
1036
+ }
1037
+ _move(event) {
1038
+ if (!this.selected ||
1039
+ this.editable) {
1040
+ return;
1041
+ }
1042
+ event.preventDefault();
1043
+ const inchPixel = 1 / 100;
1044
+ switch (event.key) {
1045
+ case 'ArrowUp':
1046
+ this.block.top = round(this.block.top - inchPixel, 2);
1047
+ break;
1048
+ case 'ArrowDown':
1049
+ this.block.top = round(this.block.top + inchPixel, 2);
1050
+ break;
1051
+ case 'ArrowLeft':
1052
+ this.block.left = round(this.block.left - inchPixel, 2);
1053
+ break;
1054
+ case 'ArrowRight':
1055
+ this.block.left = round(this.block.left + inchPixel, 2);
1056
+ break;
1057
+ }
1058
+ this._blockEditor.blockChange(this.block);
1059
+ }
1060
+ _delete(event) {
1061
+ var _a, _b;
1062
+ if (this.selected &&
1063
+ !this.editable &&
1064
+ ((_a = event.target) === null || _a === void 0 ? void 0 : _a.nodeName) !== 'INPUT' &&
1065
+ ((_b = event.target) === null || _b === void 0 ? void 0 : _b.nodeName) !== 'TEXTAREA') {
1066
+ event.preventDefault();
1067
+ this._blockEditor.removeBlocks([this.block]);
1068
+ }
1069
+ }
1070
+ }
1071
+ FsBlockComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsBlockComponent, deps: [{ token: BlockEditorService }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i2$2.FsFontPickerService }], target: i0.ɵɵFactoryTarget.Component });
1072
+ FsBlockComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: FsBlockComponent, selector: "fs-block", inputs: { block: "block", html: "html", zoompan: "zoompan" }, host: { listeners: { "document:keydown": "keydown($event)" }, properties: { "class.transforming": "this.transformating" } }, viewQueries: [{ propertyName: "element", first: true, predicate: ["element"], descendants: true, static: true }, { propertyName: "contentElement", first: true, predicate: ["contentElement"], descendants: true, static: true }, { propertyName: "contentEditable", first: true, predicate: ["contentEditable"], descendants: true, static: true }], ngImport: i0, template: "<div\n #element\n [class]=\"'block ' + 'block-' + block.type\"\n [style.top]=\"styleTop\"\n [style.left]=\"styleLeft\"\n [style.width]=\"styleWidth\"\n [style.height]=\"styleHeight\"\n [ngClass]=\"{ \n editable: editable, \n readonly: block.readonly,\n required: block.required,\n lock: block.lock,\n selected: selected\n }\"\n [style.zIndex]=\"block.index\">\n <div\n #contentElement\n class=\"content\"\n [style.borderColor]=\"block.borderColor\"\n [style.borderWidth]=\"block.borderWidth ? block.borderWidth + 'pt' : ''\"\n [style.borderStyle]=\"block.borderColor ? 'solid' : 'dashed'\"\n [style.textAlign]=\"block.horizontalAlign\"\n [style.fontStyle]=\"block.italic ? 'italic' : ''\"\n [style.fontFamily]=\"block.fontFamily || ''\"\n [style.fontSize]=\"block.fontSize ? block.fontSize + 'pt' : ''\"\n [style.lineHeight]=\"block.lineHeight ? block.lineHeight + 'pt' : ''\"\n [style.color]=\"block.fontColor\"\n [style.fontWeight]=\"block.bold ? 'bold' : ''\"\n [style.textDecoration]=\"block.underline ? 'underline' : ''\"\n [style.paddingTop]=\"block.paddingTop ? block.paddingTop + 'in' : ''\"\n [style.paddingBottom]=\"block.paddingBottom ? block.paddingBottom + 'in' : ''\"\n [style.paddingLeft]=\"block.paddingLeft ? block.paddingLeft + 'in' : ''\"\n [style.paddingRight]=\"block.paddingRight ? block.paddingRight + 'in' : ''\"\n [style.backgroundColor]=\"block.backgroundColor\"\n [style.borderBottomLeftRadius]=\"block.shapeRadius && block.shapeBottomLeft === 'round' ? block.shapeRadius + '%' : ''\"\n [style.borderBottomRightRadius]=\"block.shapeRadius && block.shapeBottomRight === 'round' ? block.shapeRadius + '%' : ''\"\n [style.borderTopRightRadius]=\"block.shapeRadius && block.shapeTopRight === 'round' ? block.shapeRadius + '%' : ''\"\n [style.borderTopLeftRadius]=\"block.shapeRadius && block.shapeTopLeft === 'round' ? block.shapeRadius + '%' : ''\"\n [style.boxShadow]=\"styleBoxShadow\"\n [ngClass]=\"{\n 'editable': editable,\n 'vertical-align-center': block.verticalAlign === 'center',\n 'vertical-align-bottom': block.verticalAlign === 'bottom'\n }\">\n <ng-container *ngIf=\"block.imageUrl && ((block.imageUrl | createImageUrl) | async) as src\">\n <img \n [style.opacity]=\"block.imageOpacity ? block.imageOpacity/100 : 1\"\n [src]=\"src\">\n </ng-container>\n <ng-container *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText || block.type === BlockType.Date\">\n {{block.label || block.name}}\n </ng-container>\n <div\n #contentEditable\n [contentEditable]=\"editable && !typeForm\"\n class=\"content-editable\"\n [innerHTML]=\"content\">\n </div>\n </div>\n <div class=\"outline\"></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;box-sizing:border-box}.block.selected{border-color:#31a2ff95}.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;z-index:100}.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}.block.selected .outline,.block:hover .outline{border:1px solid rgba(68,170,255,.7);position:absolute;inset:0;-webkit-user-select:none;user-select:none}.block.selected.lock .outline,.block:hover.lock .outline{border-color:#e4181866;border-style:dashed}: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"], dependencies: [{ kind: "directive", type: i6$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i6$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i6$1.AsyncPipe, name: "async" }, { kind: "pipe", type: CreateImageUrlPipe, name: "createImageUrl" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1073
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsBlockComponent, decorators: [{
1074
+ type: Component,
1075
+ args: [{ selector: 'fs-block', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n #element\n [class]=\"'block ' + 'block-' + block.type\"\n [style.top]=\"styleTop\"\n [style.left]=\"styleLeft\"\n [style.width]=\"styleWidth\"\n [style.height]=\"styleHeight\"\n [ngClass]=\"{ \n editable: editable, \n readonly: block.readonly,\n required: block.required,\n lock: block.lock,\n selected: selected\n }\"\n [style.zIndex]=\"block.index\">\n <div\n #contentElement\n class=\"content\"\n [style.borderColor]=\"block.borderColor\"\n [style.borderWidth]=\"block.borderWidth ? block.borderWidth + 'pt' : ''\"\n [style.borderStyle]=\"block.borderColor ? 'solid' : 'dashed'\"\n [style.textAlign]=\"block.horizontalAlign\"\n [style.fontStyle]=\"block.italic ? 'italic' : ''\"\n [style.fontFamily]=\"block.fontFamily || ''\"\n [style.fontSize]=\"block.fontSize ? block.fontSize + 'pt' : ''\"\n [style.lineHeight]=\"block.lineHeight ? block.lineHeight + 'pt' : ''\"\n [style.color]=\"block.fontColor\"\n [style.fontWeight]=\"block.bold ? 'bold' : ''\"\n [style.textDecoration]=\"block.underline ? 'underline' : ''\"\n [style.paddingTop]=\"block.paddingTop ? block.paddingTop + 'in' : ''\"\n [style.paddingBottom]=\"block.paddingBottom ? block.paddingBottom + 'in' : ''\"\n [style.paddingLeft]=\"block.paddingLeft ? block.paddingLeft + 'in' : ''\"\n [style.paddingRight]=\"block.paddingRight ? block.paddingRight + 'in' : ''\"\n [style.backgroundColor]=\"block.backgroundColor\"\n [style.borderBottomLeftRadius]=\"block.shapeRadius && block.shapeBottomLeft === 'round' ? block.shapeRadius + '%' : ''\"\n [style.borderBottomRightRadius]=\"block.shapeRadius && block.shapeBottomRight === 'round' ? block.shapeRadius + '%' : ''\"\n [style.borderTopRightRadius]=\"block.shapeRadius && block.shapeTopRight === 'round' ? block.shapeRadius + '%' : ''\"\n [style.borderTopLeftRadius]=\"block.shapeRadius && block.shapeTopLeft === 'round' ? block.shapeRadius + '%' : ''\"\n [style.boxShadow]=\"styleBoxShadow\"\n [ngClass]=\"{\n 'editable': editable,\n 'vertical-align-center': block.verticalAlign === 'center',\n 'vertical-align-bottom': block.verticalAlign === 'bottom'\n }\">\n <ng-container *ngIf=\"block.imageUrl && ((block.imageUrl | createImageUrl) | async) as src\">\n <img \n [style.opacity]=\"block.imageOpacity ? block.imageOpacity/100 : 1\"\n [src]=\"src\">\n </ng-container>\n <ng-container *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText || block.type === BlockType.Date\">\n {{block.label || block.name}}\n </ng-container>\n <div\n #contentEditable\n [contentEditable]=\"editable && !typeForm\"\n class=\"content-editable\"\n [innerHTML]=\"content\">\n </div>\n </div>\n <div class=\"outline\"></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;box-sizing:border-box}.block.selected{border-color:#31a2ff95}.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;z-index:100}.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}.block.selected .outline,.block:hover .outline{border:1px solid rgba(68,170,255,.7);position:absolute;inset:0;-webkit-user-select:none;user-select:none}.block.selected.lock .outline,.block:hover.lock .outline{border-color:#e4181866;border-style:dashed}: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"] }]
1076
+ }], ctorParameters: function () { return [{ type: BlockEditorService }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i2$2.FsFontPickerService }]; }, propDecorators: { element: [{
1077
+ type: ViewChild,
1078
+ args: ['element', { static: true }]
1079
+ }], contentElement: [{
1080
+ type: ViewChild,
1081
+ args: ['contentElement', { static: true }]
1082
+ }], contentEditable: [{
1083
+ type: ViewChild,
1084
+ args: ['contentEditable', { static: true }]
1085
+ }], block: [{
1086
+ type: Input,
1087
+ args: ['block']
1088
+ }], html: [{
1089
+ type: Input
1090
+ }], zoompan: [{
1091
+ type: Input
1092
+ }], transformating: [{
1093
+ type: HostBinding,
1094
+ args: ['class.transforming']
1095
+ }], keydown: [{
1096
+ type: HostListener,
1097
+ args: ['document:keydown', ['$event']]
1098
1098
  }] } });
1099
1099
 
1100
- class SidebarComponent {
1101
- constructor(_el, _blockEditor, _cdRef, _clipboard, _message, _prompt, _dialog, _document) {
1102
- this._el = _el;
1103
- this._blockEditor = _blockEditor;
1104
- this._cdRef = _cdRef;
1105
- this._clipboard = _clipboard;
1106
- this._message = _message;
1107
- this._prompt = _prompt;
1108
- this._dialog = _dialog;
1109
- this._document = _document;
1110
- this.zoomCenter = new EventEmitter();
1111
- this.BlockTypes = BlockTypes;
1112
- this.blockTypeNames = index(BlockTypes, 'value', 'name');
1113
- this.blockTypeIcons = index(BlockTypes, 'value', 'icon');
1114
- this.clippable = false;
1115
- this.BlockType = BlockType;
1116
- this.formats = [];
1117
- this._destroy$ = new Subject();
1118
- this.validate = (formControl) => {
1119
- if (this._blockEditor.config.defaultValidation) {
1120
- return this._blockEditor.config.defaultValidation(this.block, formControl.value);
1121
- }
1122
- return of(true);
1123
- };
1124
- }
1125
- get el() {
1126
- return this._el.nativeElement;
1127
- }
1128
- get blockGroups() {
1129
- return this._blockEditor.blockGroups;
1130
- }
1131
- get blockTypeForm() {
1132
- return this.block.type === BlockType.LongText ||
1133
- this.block.type === BlockType.ShortText ||
1134
- this.block.type === BlockType.RadioButton ||
1135
- this.block.type === BlockType.Checkbox ||
1136
- this.block.type === BlockType.Date ||
1137
- this.block.type === BlockType.Signature;
1138
- }
1139
- ngOnInit() {
1140
- this._blockEditor.selectedBlocks$
1141
- .pipe(takeUntil(this._destroy$))
1142
- .subscribe((blocks) => {
1143
- this.block = blocks[0] ? blocks[0] : null;
1144
- this.blockGroup = null;
1145
- if (this.block) {
1146
- this.formats = BlockFormats
1147
- .filter((blockFormat) => (blockFormat.blockTypes.indexOf(this.block.type) !== -1));
1148
- if (this.block.name) {
1149
- this.blockGroup = this._blockEditor.blockGroups
1150
- .find((blockGroup) => {
1151
- return this.block.name === blockGroup.name;
1152
- });
1153
- }
1154
- }
1155
- this._cdRef.markForCheck();
1156
- });
1157
- this._blockEditor.blockChanged$
1158
- .pipe(filter((block) => block === this.block), takeUntil(this._destroy$))
1159
- .subscribe(() => {
1160
- this._cdRef.markForCheck();
1161
- });
1162
- if (this._blockEditor.config.blocksReorder) {
1163
- this.blocksReordered = () => {
1164
- var _a;
1165
- (_a = this._document.defaultView) === null || _a === void 0 ? void 0 : _a.scrollTo(0, 0);
1166
- this._blockEditor.openReorderDialog();
1167
- };
1168
- }
1169
- }
1170
- blockGroupChange(blockGroup) {
1171
- this._blockEditor.applyBlockGroup(this.block, blockGroup);
1172
- }
1173
- blockRequired(value) {
1174
- const values = { required: value, readonly: false };
1175
- if (this.blockGroup) {
1176
- this._blockEditor.blockGroupChangeProperty(this.blockGroup, values);
1177
- }
1178
- else {
1179
- this.blockChangeProperty(values);
1180
- }
1181
- }
1182
- blockReadonly(value) {
1183
- const values = { readonly: value, required: false };
1184
- if (this.blockGroup) {
1185
- this._blockEditor.blockGroupChangeProperty(this.blockGroup, values);
1186
- }
1187
- else {
1188
- this.blockChangeProperty(values);
1189
- }
1190
- }
1191
- blockGroupEdit(event) {
1192
- event.preventDefault();
1193
- event.stopImmediatePropagation();
1194
- this.blockGroupDialog(this.blockGroup)
1195
- .subscribe((blockGroup) => {
1196
- this._blockEditor.blocks
1197
- .filter((block) => block.name === blockGroup.name)
1198
- .forEach((block) => {
1199
- this._blockEditor.applyBlockGroup(block, blockGroup);
1200
- });
1201
- });
1202
- }
1203
- blockGroupCreate(event) {
1204
- event.preventDefault();
1205
- event.stopImmediatePropagation();
1206
- this.blockGroupDialog()
1207
- .subscribe((blockGroup) => {
1208
- this._blockEditor.applyBlockGroup(this.block, blockGroup);
1209
- this.blockGroup = blockGroup;
1210
- this._cdRef.markForCheck();
1211
- });
1212
- }
1213
- blockGroupDialog(blockGroup) {
1214
- return this._dialog.open(GroupDialogComponent, {
1215
- data: {
1216
- block: this.block,
1217
- blockEditor: this._blockEditor,
1218
- blockGroup,
1219
- },
1220
- })
1221
- .afterClosed()
1222
- .pipe(filter((block) => !!block), takeUntil(this._destroy$));
1223
- }
1224
- fontChanged(font) {
1225
- this._blockEditor.selectedBlockComponentChangeProperty({ fontFamily: font });
1226
- }
1227
- verticalAlignClick(value) {
1228
- this._blockEditor.selectedBlockComponentChangeProperty({ verticalAlign: value });
1229
- }
1230
- boldClick() {
1231
- this._blockEditor.selectedBlockComponentChangeProperty({ bold: !this.block.bold });
1232
- }
1233
- toggleLock() {
1234
- this._blockEditor.selectedBlockComponentChangeProperty({ lock: !this.block.lock });
1235
- }
1236
- fontColorChange(value) {
1237
- this._blockEditor.selectedBlockComponentChangeProperty({ fontColor: value });
1238
- }
1239
- italicClick() {
1240
- this._blockEditor.selectedBlockComponentChangeProperty({ italic: !this.block.italic });
1241
- }
1242
- underlineClick() {
1243
- this._blockEditor.selectedBlockComponentChangeProperty({ underline: !this.block.underline });
1244
- }
1245
- backgroundColorChange(value) {
1246
- this._blockEditor.selectedBlockComponentChangeProperty({ backgroundColor: value });
1247
- }
1248
- shadowColorChange(value) {
1249
- this._blockEditor.selectedBlockComponentChangeProperty({ shadowColor: value });
1250
- }
1251
- paddingAllChange(value) {
1252
- value = this.validNumeric(value) ? value : null;
1253
- this.block.paddingTop = value;
1254
- this.block.paddingLeft = value;
1255
- this.block.paddingBottom = value;
1256
- this.block.paddingRight = value;
1257
- this._blockEditor.selectedBlocks
1258
- .forEach((block) => {
1259
- this._blockEditor.blockChange(block);
1260
- });
1261
- }
1262
- paddingKeypress(event, name) {
1263
- this.block.padding = null;
1264
- this.numericInputKeypress(event, name);
1265
- }
1266
- paddingAllKeypress(event, unit = .1) {
1267
- if (event.code === 'ArrowUp' || event.code === 'ArrowDown') {
1268
- this.block.padding = (this.block.padding) + ((event.code === 'ArrowDown' ? -1 : 1) * unit);
1269
- this.paddingAllChange(this.block.padding);
1270
- }
1271
- }
1272
- borderColorChange(value) {
1273
- this._blockEditor.selectedBlockComponentChangeProperty({ borderColor: value });
1274
- }
1275
- toggleKeepRatio() {
1276
- this._blockEditor.selectedBlockComponentChangeProperty({ keepRatio: !this.block.keepRatio });
1277
- }
1278
- horizontalAlignClick(value) {
1279
- this._blockEditor.selectedBlockComponentChangeProperty({ horizontalAlign: value });
1280
- }
1281
- shapeRound(name) {
1282
- const value = this.block[name] === 'round' ? 'square' : 'round';
1283
- this._blockEditor.selectedBlockComponentChangeProperty({ [name]: value });
1284
- }
1285
- numberChange(value, name) {
1286
- value = this.validNumeric(value) ? value : null;
1287
- this._blockEditor.selectedBlockComponentChangeProperty({ [name]: value });
1288
- }
1289
- imageRemove() {
1290
- this._blockEditor.selectedBlockComponentChangeProperty({ imageUrl: null });
1291
- }
1292
- imageClip() {
1293
- this.clippable = !this.clippable;
1294
- this._blockEditor.blockClippable = true;
1295
- }
1296
- blockChangeProperty(values) {
1297
- this._blockEditor.selectedBlockComponentChangeProperty(values);
1298
- }
1299
- blockDuplicateClick() {
1300
- const selectedBlock = this._blockEditor.selectedBlocks[0];
1301
- const block = Object.assign(Object.assign({}, selectedBlock), { id: null, data: null, guid: null, top: selectedBlock.top + selectedBlock.height + .1 });
1302
- this._blockEditor.blockAdd(block);
1303
- }
1304
- blockRemoveClick() {
1305
- this._blockEditor.removeBlocks(this._blockEditor.selectedBlocks);
1306
- }
1307
- blockUpload(block, fsFile) {
1308
- this._blockEditor.blockUpload(block, fsFile)
1309
- .subscribe();
1310
- }
1311
- blockAdd(type) {
1312
- if (type === BlockType.Pdf || type === BlockType.Image) {
1313
- return;
1314
- }
1315
- const block = {
1316
- type,
1317
- shadowX: 2,
1318
- shadowY: 2,
1319
- shadowBlur: 4,
1320
- };
1321
- this._blockEditor.blockAdd(block);
1322
- }
1323
- layerMove(direction) {
1324
- this._blockEditor.blocks.forEach((block) => {
1325
- if (this._blockEditor.isSelectedBlock(block)) {
1326
- block.index += (999 * direction);
1327
- }
1328
- });
1329
- const sorted = this._blockEditor.blocks
1330
- .sort((a, b) => {
1331
- return a.index > b.index ? 1 : -1;
1332
- });
1333
- sorted
1334
- .forEach((block, idx) => {
1335
- block.index = idx;
1336
- this._blockEditor.blockChange(block);
1337
- });
1338
- if (this.config.blocksLevelChanged) {
1339
- this.config.blocksLevelChanged(sorted.map((block) => block));
1340
- }
1341
- }
1342
- exportBlocks() {
1343
- const blocks = JSON.stringify(this._blockEditor.blocks);
1344
- this._clipboard.copy(blocks, { showMessage: false });
1345
- this._message.success('Exported blocks to clipboard');
1346
- }
1347
- importBlocks() {
1348
- this._prompt.input({
1349
- title: 'Import blocks',
1350
- })
1351
- .subscribe((blocks) => {
1352
- blocks = JSON.parse(blocks);
1353
- blocks
1354
- .forEach((block) => {
1355
- block = Object.assign(Object.assign({}, block), { guid: guid(), imageUrl: null });
1356
- this._blockEditor.blockAdd(block);
1357
- });
1358
- this._message
1359
- .success(`Imported ${blocks.length} ${blocks.length === 1 ? 'block' : 'blocks'}`);
1360
- });
1361
- }
1362
- layerUp() {
1363
- this.layerMove(1);
1364
- }
1365
- layerDown() {
1366
- this.layerMove(-1);
1367
- }
1368
- inputFocus(event) {
1369
- event.target.select();
1370
- }
1371
- numericInputKeypress(event, name, unit = .1) {
1372
- if (event.code === 'ArrowUp' || event.code === 'ArrowDown') {
1373
- this.block[name] = round(Number(this.block[name] || 0) +
1374
- ((event.code === 'ArrowDown' ? -1 : 1) * unit), 3);
1375
- this._blockEditor.selectedBlockComponentChangeProperty({ [name]: this.block[name] });
1376
- }
1377
- }
1378
- ngOnDestroy() {
1379
- this._destroy$.next();
1380
- this._destroy$.complete();
1381
- }
1382
- validNumeric(value) {
1383
- return !value || !!String(value).match(/^\d*\.?\d*$/);
1384
- }
1385
- }
1386
- SidebarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SidebarComponent, deps: [{ token: i0.ElementRef }, { token: BlockEditorService }, { token: i0.ChangeDetectorRef }, { token: i2$2.FsClipboard }, { token: i3$2.FsMessage }, { token: i3$1.FsPrompt }, { token: i1.MatDialog }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component });
1387
- SidebarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SidebarComponent, selector: "sidebar", inputs: { config: "config", blocks: "blocks", zoompan: "zoompan" }, outputs: { zoomCenter: "zoomCenter" }, queries: [{ propertyName: "sidebarPanels", predicate: FsBlockEditorSidebarPanelDirective }], ngImport: i0, template: "<div class=\"sidebar\">\n <form fsForm>\n <div class=\"sidebar-panel\"> \n <div class=\"sidebar-label\">Elements</div>\n <div class=\"sidebar-row\">\n <ng-container *ngFor=\"let blockType of BlockTypes\">\n <ng-container *ngIf=\"blockType.type === 'draw'\">\n <ng-container [ngSwitch]=\"blockType.value\">\n <ng-container *ngSwitchCase=\"BlockType.Pdf\">\n <ng-container [ngTemplateOutlet]=\"addFile\" [ngTemplateOutletContext]=\"{ type: BlockType.Pdf }\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"BlockType.Image\">\n <ng-container [ngTemplateOutlet]=\"addFile\" [ngTemplateOutletContext]=\"{ type: BlockType.Rectangle }\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container \n [ngTemplateOutlet]=\"addButton\" \n [ngTemplateOutletContext]=\"{ blockType: blockType }\">\n </ng-container>\n </ng-container>\n </ng-container>\n\n <ng-template #addFile let-type=\"type\">\n <fs-file \n (select)=\"blockUpload({ type: type, keepRatio: true, borderWidth: 0 }, $event)\" \n [accept]=\"blockType.accept\">\n <ng-container [ngTemplateOutlet]=\"addButton\" [ngTemplateOutletContext]=\"{ blockType: blockType }\"></ng-container>\n </fs-file>\n </ng-template>\n </ng-container>\n </ng-container>\n </div>\n </div>\n\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Form</div>\n <div class=\"sidebar-row\">\n <ng-container *ngFor=\"let blockType of BlockTypes\">\n <ng-container *ngIf=\"blockType.type === 'form'\">\n <ng-container \n [ngTemplateOutlet]=\"addButton\" \n [ngTemplateOutletContext]=\"{ blockType: blockType }\">\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </div> \n\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Tools</div>\n <div class=\"sidebar-row\">\n <ng-container *ngIf=\"block\">\n <button\n class=\"layer-up\"\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"layerUp()\"\n [matTooltip]=\"'Increase layer'\">\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 [matTooltip]=\"'Decrease layer'\">\n <mat-icon>arrow_back</mat-icon>\n <mat-icon>layers</mat-icon>\n </button>\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"toggleLock()\"\n [matTooltip]=\"block.lock ? 'Unlock' : 'Lock'\">\n <mat-icon>{{block.lock ? 'lock_outline' : 'lock_open'}}</mat-icon>\n </button>\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n [matTooltip]=\"'Duplicate block'\"\n (click)=\"blockDuplicateClick()\">\n <mat-icon>content_copy</mat-icon>\n </button>\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n [matTooltip]=\"'Delete block'\"\n (click)=\"blockRemoveClick()\">\n <mat-icon>delete_outline</mat-icon>\n </button> \n </ng-container>\n <ng-container *ngIf=\"blocksReordered\">\n <button\n class=\"reorder-layers\"\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"blocksReordered()\"\n [matTooltip]=\"'Reorder blocks'\">\n <mat-icon>swap_vert</mat-icon>\n </button>\n </ng-container>\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 </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 field-gap\">\n <mat-form-field class=\"form-field-padless form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.left\"\n name=\"left\"\n fsMaskNumber\n [scale]=\"5\"\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 form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.top\"\n name=\"top\"\n fsMaskNumber\n [scale]=\"5\"\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 form-field-prefix rotate\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.rotate\"\n name=\"rotate\"\n fsMaskNumber\n [scale]=\"5\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'rotate', 1)\"\n (ngModelChange)=\"numberChange($event, 'rotate')\">\n <span matPrefix>R</span>\n </mat-form-field>\n </div>\n\n <div class=\"sidebar-row field-gap\">\n <mat-form-field class=\"form-field-padless form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.width\"\n name=\"width\"\n fsMaskNumber\n [scale]=\"5\"\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 form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.height\"\n name=\"height\"\n fsMaskNumber\n [scale]=\"5\"\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\n *ngIf=\"blockTypeForm\">\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]}}\n </div>\n <div class=\"sidebar-row\">\n\n <ng-container *ngIf=\"block.type === BlockType.RadioButton; else nameField\">\n <div class=\"group-block\">\n <mat-form-field class=\"full-width\" class=\"full-width\">\n <mat-label>Group</mat-label>\n <mat-select\n [(ngModel)]=\"blockGroup\"\n (ngModelChange)=\"blockGroupChange($event)\"\n name=\"group\">\n <ng-container *ngIf=\"blockGroups.length\">\n <mat-option [value]=\"null\">\n None\n </mat-option>\n </ng-container>\n <mat-option\n *ngFor=\"let item of blockGroups\"\n [value]=\"item\">\n {{ item.label }}\n </mat-option>\n <mat-option \n [value]=\"null\"\n (click)=\"blockGroupCreate($event)\">\n Create Group\n </mat-option>\n </mat-select> \n </mat-form-field>\n <ng-container *ngIf=\"blockGroup\">\n <a \n (click)=\"blockGroupEdit($event)\">\n <mat-icon>edit</mat-icon>\n </a>\n </ng-container>\n </div>\n </ng-container>\n \n <mat-form-field class=\"full-width\">\n <input\n matInput\n [ngModel]=\"block.label\"\n name=\"label\"\n placeholder=\"Label\"\n (ngModelChange)=\"blockChangeProperty({ label: $event })\">\n </mat-form-field>\n\n <ng-container *ngIf=\"block.type !== BlockType.RadioButton\">\n <mat-form-field class=\"full-width\">\n <textarea\n matInput\n [cdkTextareaAutosize]=\"true\"\n [ngModel]=\"block.description\"\n name=\"description\"\n placeholder=\"Description\"\n (ngModelChange)=\"blockChangeProperty({ description: $event })\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <mat-form-field\n *ngIf=\"formats.length\"\n class=\"full-width\">\n <mat-label>Format</mat-label>\n <mat-select\n [(ngModel)]=\"block.format\"\n name=\"format\"\n (ngModelChange)=\"blockChangeProperty({ format: $event })\"> \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\n *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText || block.type === BlockType.Date\">\n <mat-form-field class=\"full-width\">\n <textarea\n matInput\n [cdkTextareaAutosize]=\"true\"\n [ngModel]=\"block.default\"\n name=\"default\"\n [validate]=\"validate\"\n placeholder=\"Default\"\n (ngModelChange)=\"blockChangeProperty({ default: $event })\">\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=\"full-width\">\n <textarea\n matInput\n [cdkTextareaAutosize]=\"true\"\n [ngModel]=\"block.formula\"\n name=\"formula\"\n placeholder=\"Formula\"\n (ngModelChange)=\"blockChangeProperty({ formula: $event })\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <ng-template #nameField>\n <mat-form-field class=\"full-width\">\n <input\n matInput\n [ngModel]=\"block.name\"\n name=\"name\"\n placeholder=\"Name\"\n (ngModelChange)=\"blockChangeProperty({ name: $event })\">\n </mat-form-field>\n </ng-template>\n\n <div class=\"form-field-options\">\n <mat-checkbox\n name=\"required\"\n [(ngModel)]=\"block.required\"\n (ngModelChange)=\"blockRequired($event)\">\n Required\n </mat-checkbox>\n\n <mat-checkbox\n name=\"readonly\"\n [(ngModel)]=\"block.readonly\"\n (ngModelChange)=\"blockReadonly($event)\">\n Readonly\n </mat-checkbox>\n </div>\n </div>\n </div>\n </ng-container>\n <ng-container *ngIf=\"block.type === BlockType.Rectangle || block.type === BlockType.Image || block.type === BlockType.Pdf\">\n <div class=\"sidebar-panel typography-panel\">\n <div class=\"sidebar-label\">Typography</div>\n <div class=\"sidebar-row field-gap\">\n <fs-font-picker \n [(ngModel)]=\"block.fontFamily\" \n (ngModelChange)=\"fontChanged($event)\"\n name=\"fontfamily\">\n </fs-font-picker>\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 form-field-prefix font-size\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.fontSize\"\n name=\"fontSize\"\n fsMaskNumber\n [scale]=\"5\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'fontSize', 1)\"\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 form-field-prefix line-height\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.lineHeight\"\n name=\"lineHeight\"\n fsMaskNumber\n [scale]=\"5\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'lineHeight', 1)\"\n (ngModelChange)=\"numberChange($event, 'lineHeight')\"\n placeholder=\"Line\">\n <span matPrefix *ngIf=\"block.lineHeight\">L</span>\n </mat-form-field>\n\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 field-gap\">\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 field-gap\">\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 form-field-prefix border-width\" floatLabel=\"never\">\n <input\n matInput\n [(ngModel)]=\"block.borderWidth\"\n name=\"borderWidth\"\n fsMaskNumber\n [scale]=\"5\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'borderWidth', 1)\"\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 <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Shape</div>\n\n <div class=\"sidebar-row field-gap\">\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 form-field-prefix shape-radius\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shapeRadius\"\n name=\"shapeRadius\"\n fsMaskNumber\n [scale]=\"5\"\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 <div class=\"sidebar-panel shadow-panel\">\n <div class=\"sidebar-label\">Shadow</div>\n\n <div class=\"sidebar-row field-gap\">\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 form-field-prefix shadow-x\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shadowX\"\n name=\"shadowX\"\n fsMaskNumber\n [scale]=\"5\"\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 form-field-prefix 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 form-field-prefix shadow-blur\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shadowBlur\"\n name=\"shadowBlur\"\n placeholder=\"Blur\"\n fsMaskNumber\n [scale]=\"5\"\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 form-field-prefix shadow-spread\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shadowSpread\"\n name=\"shadowSpread\"\n placeholder=\"Spread\"\n fsMaskNumber\n [scale]=\"5\"\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 <ng-container *ngIf=\"block.type === BlockType.Rectangle\">\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Image</div>\n <div class=\"sidebar-row image-row\">\n <fs-file (select)=\"blockUpload(block, $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\n <mat-form-field class=\"form-field-padless opacity\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.imageOpacity\"\n fsMaskNumber\n [scale]=\"5\"\n name=\"imageOpacity\"\n placeholder=\"Opacity\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'imageOpacity', 1)\"\n (ngModelChange)=\"numberChange($event, 'imageOpacity')\">\n <span matPrefix *ngIf=\"block.imageOpacity\">O</span>\n </mat-form-field>\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 field-gap\">\n\n <mat-form-field class=\"form-field-padless form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [(ngModel)]=\"block.padding\"\n name=\"padding\"\n fsMaskNumber\n [scale]=\"5\"\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 form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingTop\"\n name=\"paddingTop\"\n fsMaskNumber\n [scale]=\"5\"\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 form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingBottom\"\n name=\"paddingBottom\"\n fsMaskNumber\n [scale]=\"5\"\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 form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingLeft\"\n name=\"paddingLeft\"\n fsMaskNumber\n [scale]=\"5\"\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 form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingRight\"\n name=\"paddingRight\"\n fsMaskNumber\n [scale]=\"5\"\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 </ng-container>\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Utilities</div>\n <div class=\"sidebar-row padding-row\">\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"exportBlocks()\"\n [matTooltip]=\"'Export blocks'\">\n <mat-icon>download</mat-icon>\n </button>\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"importBlocks()\"\n [matTooltip]=\"'Import blocks'\">\n <mat-icon>upload</mat-icon>\n </button>\n </div>\n </div> \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 </form>\n</div>\n<ng-template #addButton let-blockType=\"blockType\">\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>", styles: [".sidebar{width:320px;font-size:14px;height:100%;overflow:auto;background-color:#fff;padding:0 10px 10px;box-shadow:0 1px 3px 1px #0003;z-index:1;position:relative;box-sizing:border-box}.sidebar form{height:100%}.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.image-row .opacity{width:60px;margin-left:10px}.sidebar .sidebar-row ::ng-deep .mat-checkbox,.sidebar .sidebar-row ::ng-deep .mat-form-field{font-size:12px}.sidebar .sidebar-row.field-gap>*:not(.mat-icon-button):not(fs-file){margin-right:11px}.sidebar .sidebar-row.field-gap>*: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,.sidebar .line-height,.sidebar .font-size{width:45px}.sidebar .border-width{width:50px}.sidebar .shape-radius{width:60px}.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{background-color:#212121}.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 .group-block{width:100%;display:flex;align-items:center}.sidebar .group-block a{margin-left:5px;color:inherit}.sidebar .group-block a mat-icon{transform:scale(.8)}.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 .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:60px}.sidebar .sidebar-panel.info-panel .mat-form-field.rotate{width:50px}.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{width:40px}.sidebar .sidebar-panel.shadow-panel .mat-form-field.shadow-blur{width:50px}.sidebar .sidebar-panel.shadow-panel .mat-form-field.shadow-spread{width:60px}.sidebar .sidebar-panel.typography-panel fs-font-picker{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-appearance-outline.form-field-prefix .mat-form-field-suffix,:host ::ng-deep .mat-form-field-appearance-outline.form-field-prefix .mat-form-field-prefix{top:0}:host ::ng-deep .mat-form-field-prefix{color:#9e9e9e;margin-right:3px;font-size:85%}\n"], components: [{ type: i6$1.FsFileComponent, selector: "fs-file", inputs: ["minHeight", "minWidth", "orientate", "multiple", "capture", "allowClick", "allowDrop", "accept", "disabled", "imageWidth", "imageHeight", "imageQuality"], outputs: ["select", "error", "beforeProcessing", "clicked", "declined"] }, { type: i4.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.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i9.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i10.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i11.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i12.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: i2$1.FsFontPickerComponent, selector: "fs-font-picker" }, { type: i14.FsColorPickerChipComponent, selector: "fs-color-picker-chip", inputs: ["color", "showClear"], outputs: ["changed"] }], directives: [{ type: i5.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i5.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i5.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i6.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup", "deactivationGuard"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"], exportAs: ["fsForm"] }, { type: i17.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i17.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i17.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i17.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i17.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i17.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i18.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i7.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i5.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: i20.FsMaskNumberDirective, selector: "[fsMaskNumber]" }, { type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i6.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { type: i9.MatPrefix, selector: "[matPrefix]" }, { type: i9.MatLabel, selector: "mat-label" }, { type: i8.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { type: i6.FsFormValidateDirective, selector: "[validate]", inputs: ["validate", "validateData", "validateOnSubmit"] }, { type: i17.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1388
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SidebarComponent, decorators: [{
1389
- type: Component,
1390
- args: [{ selector: 'sidebar', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"sidebar\">\n <form fsForm>\n <div class=\"sidebar-panel\"> \n <div class=\"sidebar-label\">Elements</div>\n <div class=\"sidebar-row\">\n <ng-container *ngFor=\"let blockType of BlockTypes\">\n <ng-container *ngIf=\"blockType.type === 'draw'\">\n <ng-container [ngSwitch]=\"blockType.value\">\n <ng-container *ngSwitchCase=\"BlockType.Pdf\">\n <ng-container [ngTemplateOutlet]=\"addFile\" [ngTemplateOutletContext]=\"{ type: BlockType.Pdf }\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"BlockType.Image\">\n <ng-container [ngTemplateOutlet]=\"addFile\" [ngTemplateOutletContext]=\"{ type: BlockType.Rectangle }\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container \n [ngTemplateOutlet]=\"addButton\" \n [ngTemplateOutletContext]=\"{ blockType: blockType }\">\n </ng-container>\n </ng-container>\n </ng-container>\n\n <ng-template #addFile let-type=\"type\">\n <fs-file \n (select)=\"blockUpload({ type: type, keepRatio: true, borderWidth: 0 }, $event)\" \n [accept]=\"blockType.accept\">\n <ng-container [ngTemplateOutlet]=\"addButton\" [ngTemplateOutletContext]=\"{ blockType: blockType }\"></ng-container>\n </fs-file>\n </ng-template>\n </ng-container>\n </ng-container>\n </div>\n </div>\n\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Form</div>\n <div class=\"sidebar-row\">\n <ng-container *ngFor=\"let blockType of BlockTypes\">\n <ng-container *ngIf=\"blockType.type === 'form'\">\n <ng-container \n [ngTemplateOutlet]=\"addButton\" \n [ngTemplateOutletContext]=\"{ blockType: blockType }\">\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </div> \n\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Tools</div>\n <div class=\"sidebar-row\">\n <ng-container *ngIf=\"block\">\n <button\n class=\"layer-up\"\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"layerUp()\"\n [matTooltip]=\"'Increase layer'\">\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 [matTooltip]=\"'Decrease layer'\">\n <mat-icon>arrow_back</mat-icon>\n <mat-icon>layers</mat-icon>\n </button>\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"toggleLock()\"\n [matTooltip]=\"block.lock ? 'Unlock' : 'Lock'\">\n <mat-icon>{{block.lock ? 'lock_outline' : 'lock_open'}}</mat-icon>\n </button>\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n [matTooltip]=\"'Duplicate block'\"\n (click)=\"blockDuplicateClick()\">\n <mat-icon>content_copy</mat-icon>\n </button>\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n [matTooltip]=\"'Delete block'\"\n (click)=\"blockRemoveClick()\">\n <mat-icon>delete_outline</mat-icon>\n </button> \n </ng-container>\n <ng-container *ngIf=\"blocksReordered\">\n <button\n class=\"reorder-layers\"\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"blocksReordered()\"\n [matTooltip]=\"'Reorder blocks'\">\n <mat-icon>swap_vert</mat-icon>\n </button>\n </ng-container>\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 </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 field-gap\">\n <mat-form-field class=\"form-field-padless form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.left\"\n name=\"left\"\n fsMaskNumber\n [scale]=\"5\"\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 form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.top\"\n name=\"top\"\n fsMaskNumber\n [scale]=\"5\"\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 form-field-prefix rotate\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.rotate\"\n name=\"rotate\"\n fsMaskNumber\n [scale]=\"5\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'rotate', 1)\"\n (ngModelChange)=\"numberChange($event, 'rotate')\">\n <span matPrefix>R</span>\n </mat-form-field>\n </div>\n\n <div class=\"sidebar-row field-gap\">\n <mat-form-field class=\"form-field-padless form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.width\"\n name=\"width\"\n fsMaskNumber\n [scale]=\"5\"\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 form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.height\"\n name=\"height\"\n fsMaskNumber\n [scale]=\"5\"\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\n *ngIf=\"blockTypeForm\">\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]}}\n </div>\n <div class=\"sidebar-row\">\n\n <ng-container *ngIf=\"block.type === BlockType.RadioButton; else nameField\">\n <div class=\"group-block\">\n <mat-form-field class=\"full-width\" class=\"full-width\">\n <mat-label>Group</mat-label>\n <mat-select\n [(ngModel)]=\"blockGroup\"\n (ngModelChange)=\"blockGroupChange($event)\"\n name=\"group\">\n <ng-container *ngIf=\"blockGroups.length\">\n <mat-option [value]=\"null\">\n None\n </mat-option>\n </ng-container>\n <mat-option\n *ngFor=\"let item of blockGroups\"\n [value]=\"item\">\n {{ item.label }}\n </mat-option>\n <mat-option \n [value]=\"null\"\n (click)=\"blockGroupCreate($event)\">\n Create Group\n </mat-option>\n </mat-select> \n </mat-form-field>\n <ng-container *ngIf=\"blockGroup\">\n <a \n (click)=\"blockGroupEdit($event)\">\n <mat-icon>edit</mat-icon>\n </a>\n </ng-container>\n </div>\n </ng-container>\n \n <mat-form-field class=\"full-width\">\n <input\n matInput\n [ngModel]=\"block.label\"\n name=\"label\"\n placeholder=\"Label\"\n (ngModelChange)=\"blockChangeProperty({ label: $event })\">\n </mat-form-field>\n\n <ng-container *ngIf=\"block.type !== BlockType.RadioButton\">\n <mat-form-field class=\"full-width\">\n <textarea\n matInput\n [cdkTextareaAutosize]=\"true\"\n [ngModel]=\"block.description\"\n name=\"description\"\n placeholder=\"Description\"\n (ngModelChange)=\"blockChangeProperty({ description: $event })\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <mat-form-field\n *ngIf=\"formats.length\"\n class=\"full-width\">\n <mat-label>Format</mat-label>\n <mat-select\n [(ngModel)]=\"block.format\"\n name=\"format\"\n (ngModelChange)=\"blockChangeProperty({ format: $event })\"> \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\n *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText || block.type === BlockType.Date\">\n <mat-form-field class=\"full-width\">\n <textarea\n matInput\n [cdkTextareaAutosize]=\"true\"\n [ngModel]=\"block.default\"\n name=\"default\"\n [validate]=\"validate\"\n placeholder=\"Default\"\n (ngModelChange)=\"blockChangeProperty({ default: $event })\">\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=\"full-width\">\n <textarea\n matInput\n [cdkTextareaAutosize]=\"true\"\n [ngModel]=\"block.formula\"\n name=\"formula\"\n placeholder=\"Formula\"\n (ngModelChange)=\"blockChangeProperty({ formula: $event })\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <ng-template #nameField>\n <mat-form-field class=\"full-width\">\n <input\n matInput\n [ngModel]=\"block.name\"\n name=\"name\"\n placeholder=\"Name\"\n (ngModelChange)=\"blockChangeProperty({ name: $event })\">\n </mat-form-field>\n </ng-template>\n\n <div class=\"form-field-options\">\n <mat-checkbox\n name=\"required\"\n [(ngModel)]=\"block.required\"\n (ngModelChange)=\"blockRequired($event)\">\n Required\n </mat-checkbox>\n\n <mat-checkbox\n name=\"readonly\"\n [(ngModel)]=\"block.readonly\"\n (ngModelChange)=\"blockReadonly($event)\">\n Readonly\n </mat-checkbox>\n </div>\n </div>\n </div>\n </ng-container>\n <ng-container *ngIf=\"block.type === BlockType.Rectangle || block.type === BlockType.Image || block.type === BlockType.Pdf\">\n <div class=\"sidebar-panel typography-panel\">\n <div class=\"sidebar-label\">Typography</div>\n <div class=\"sidebar-row field-gap\">\n <fs-font-picker \n [(ngModel)]=\"block.fontFamily\" \n (ngModelChange)=\"fontChanged($event)\"\n name=\"fontfamily\">\n </fs-font-picker>\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 form-field-prefix font-size\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.fontSize\"\n name=\"fontSize\"\n fsMaskNumber\n [scale]=\"5\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'fontSize', 1)\"\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 form-field-prefix line-height\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.lineHeight\"\n name=\"lineHeight\"\n fsMaskNumber\n [scale]=\"5\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'lineHeight', 1)\"\n (ngModelChange)=\"numberChange($event, 'lineHeight')\"\n placeholder=\"Line\">\n <span matPrefix *ngIf=\"block.lineHeight\">L</span>\n </mat-form-field>\n\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 field-gap\">\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 field-gap\">\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 form-field-prefix border-width\" floatLabel=\"never\">\n <input\n matInput\n [(ngModel)]=\"block.borderWidth\"\n name=\"borderWidth\"\n fsMaskNumber\n [scale]=\"5\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'borderWidth', 1)\"\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 <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Shape</div>\n\n <div class=\"sidebar-row field-gap\">\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 form-field-prefix shape-radius\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shapeRadius\"\n name=\"shapeRadius\"\n fsMaskNumber\n [scale]=\"5\"\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 <div class=\"sidebar-panel shadow-panel\">\n <div class=\"sidebar-label\">Shadow</div>\n\n <div class=\"sidebar-row field-gap\">\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 form-field-prefix shadow-x\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shadowX\"\n name=\"shadowX\"\n fsMaskNumber\n [scale]=\"5\"\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 form-field-prefix 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 form-field-prefix shadow-blur\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shadowBlur\"\n name=\"shadowBlur\"\n placeholder=\"Blur\"\n fsMaskNumber\n [scale]=\"5\"\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 form-field-prefix shadow-spread\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shadowSpread\"\n name=\"shadowSpread\"\n placeholder=\"Spread\"\n fsMaskNumber\n [scale]=\"5\"\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 <ng-container *ngIf=\"block.type === BlockType.Rectangle\">\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Image</div>\n <div class=\"sidebar-row image-row\">\n <fs-file (select)=\"blockUpload(block, $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\n <mat-form-field class=\"form-field-padless opacity\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.imageOpacity\"\n fsMaskNumber\n [scale]=\"5\"\n name=\"imageOpacity\"\n placeholder=\"Opacity\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'imageOpacity', 1)\"\n (ngModelChange)=\"numberChange($event, 'imageOpacity')\">\n <span matPrefix *ngIf=\"block.imageOpacity\">O</span>\n </mat-form-field>\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 field-gap\">\n\n <mat-form-field class=\"form-field-padless form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [(ngModel)]=\"block.padding\"\n name=\"padding\"\n fsMaskNumber\n [scale]=\"5\"\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 form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingTop\"\n name=\"paddingTop\"\n fsMaskNumber\n [scale]=\"5\"\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 form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingBottom\"\n name=\"paddingBottom\"\n fsMaskNumber\n [scale]=\"5\"\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 form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingLeft\"\n name=\"paddingLeft\"\n fsMaskNumber\n [scale]=\"5\"\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 form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingRight\"\n name=\"paddingRight\"\n fsMaskNumber\n [scale]=\"5\"\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 </ng-container>\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Utilities</div>\n <div class=\"sidebar-row padding-row\">\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"exportBlocks()\"\n [matTooltip]=\"'Export blocks'\">\n <mat-icon>download</mat-icon>\n </button>\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"importBlocks()\"\n [matTooltip]=\"'Import blocks'\">\n <mat-icon>upload</mat-icon>\n </button>\n </div>\n </div> \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 </form>\n</div>\n<ng-template #addButton let-blockType=\"blockType\">\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>", styles: [".sidebar{width:320px;font-size:14px;height:100%;overflow:auto;background-color:#fff;padding:0 10px 10px;box-shadow:0 1px 3px 1px #0003;z-index:1;position:relative;box-sizing:border-box}.sidebar form{height:100%}.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.image-row .opacity{width:60px;margin-left:10px}.sidebar .sidebar-row ::ng-deep .mat-checkbox,.sidebar .sidebar-row ::ng-deep .mat-form-field{font-size:12px}.sidebar .sidebar-row.field-gap>*:not(.mat-icon-button):not(fs-file){margin-right:11px}.sidebar .sidebar-row.field-gap>*: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,.sidebar .line-height,.sidebar .font-size{width:45px}.sidebar .border-width{width:50px}.sidebar .shape-radius{width:60px}.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{background-color:#212121}.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 .group-block{width:100%;display:flex;align-items:center}.sidebar .group-block a{margin-left:5px;color:inherit}.sidebar .group-block a mat-icon{transform:scale(.8)}.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 .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:60px}.sidebar .sidebar-panel.info-panel .mat-form-field.rotate{width:50px}.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{width:40px}.sidebar .sidebar-panel.shadow-panel .mat-form-field.shadow-blur{width:50px}.sidebar .sidebar-panel.shadow-panel .mat-form-field.shadow-spread{width:60px}.sidebar .sidebar-panel.typography-panel fs-font-picker{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-appearance-outline.form-field-prefix .mat-form-field-suffix,:host ::ng-deep .mat-form-field-appearance-outline.form-field-prefix .mat-form-field-prefix{top:0}:host ::ng-deep .mat-form-field-prefix{color:#9e9e9e;margin-right:3px;font-size:85%}\n"] }]
1391
- }], ctorParameters: function () {
1392
- return [{ type: i0.ElementRef }, { type: BlockEditorService }, { type: i0.ChangeDetectorRef }, { type: i2$2.FsClipboard }, { type: i3$2.FsMessage }, { type: i3$1.FsPrompt }, { type: i1.MatDialog }, { type: undefined, decorators: [{
1393
- type: Inject,
1394
- args: [DOCUMENT]
1395
- }] }];
1396
- }, propDecorators: { sidebarPanels: [{
1397
- type: ContentChildren,
1398
- args: [FsBlockEditorSidebarPanelDirective]
1399
- }], config: [{
1400
- type: Input
1401
- }], blocks: [{
1402
- type: Input
1403
- }], zoompan: [{
1404
- type: Input
1405
- }], zoomCenter: [{
1406
- type: Output
1100
+ class SidebarComponent {
1101
+ constructor(_el, _blockEditor, _cdRef, _clipboard, _message, _prompt, _dialog, _document) {
1102
+ this._el = _el;
1103
+ this._blockEditor = _blockEditor;
1104
+ this._cdRef = _cdRef;
1105
+ this._clipboard = _clipboard;
1106
+ this._message = _message;
1107
+ this._prompt = _prompt;
1108
+ this._dialog = _dialog;
1109
+ this._document = _document;
1110
+ this.zoomCenter = new EventEmitter();
1111
+ this.BlockTypes = BlockTypes;
1112
+ this.blockTypeNames = index(BlockTypes, 'value', 'name');
1113
+ this.blockTypeIcons = index(BlockTypes, 'value', 'icon');
1114
+ this.clippable = false;
1115
+ this.BlockType = BlockType;
1116
+ this.formats = [];
1117
+ this._destroy$ = new Subject();
1118
+ this.validate = (formControl) => {
1119
+ if (this._blockEditor.config.defaultValidation) {
1120
+ return this._blockEditor.config.defaultValidation(this.block, formControl.value);
1121
+ }
1122
+ return of(true);
1123
+ };
1124
+ }
1125
+ get el() {
1126
+ return this._el.nativeElement;
1127
+ }
1128
+ get blockGroups() {
1129
+ return this._blockEditor.blockGroups;
1130
+ }
1131
+ get blockTypeForm() {
1132
+ return this.block.type === BlockType.LongText ||
1133
+ this.block.type === BlockType.ShortText ||
1134
+ this.block.type === BlockType.RadioButton ||
1135
+ this.block.type === BlockType.Checkbox ||
1136
+ this.block.type === BlockType.Date ||
1137
+ this.block.type === BlockType.Signature;
1138
+ }
1139
+ ngOnInit() {
1140
+ this._blockEditor.selectedBlocks$
1141
+ .pipe(takeUntil(this._destroy$))
1142
+ .subscribe((blocks) => {
1143
+ this.block = blocks[0] ? blocks[0] : null;
1144
+ this.blockGroup = null;
1145
+ if (this.block) {
1146
+ this.formats = BlockFormats
1147
+ .filter((blockFormat) => (blockFormat.blockTypes.indexOf(this.block.type) !== -1));
1148
+ if (this.block.name) {
1149
+ this.blockGroup = this._blockEditor.blockGroups
1150
+ .find((blockGroup) => {
1151
+ return this.block.name === blockGroup.name;
1152
+ });
1153
+ }
1154
+ }
1155
+ this._cdRef.markForCheck();
1156
+ });
1157
+ this._blockEditor.blockChanged$
1158
+ .pipe(filter((block) => block === this.block), takeUntil(this._destroy$))
1159
+ .subscribe(() => {
1160
+ this._cdRef.markForCheck();
1161
+ });
1162
+ if (this._blockEditor.config.blocksReorder) {
1163
+ this.blocksReordered = () => {
1164
+ var _a;
1165
+ (_a = this._document.defaultView) === null || _a === void 0 ? void 0 : _a.scrollTo(0, 0);
1166
+ this._blockEditor.openReorderDialog();
1167
+ };
1168
+ }
1169
+ }
1170
+ blockGroupChange(blockGroup) {
1171
+ this._blockEditor.applyBlockGroup(this.block, blockGroup);
1172
+ }
1173
+ blockRequired(value) {
1174
+ const values = { required: value, readonly: false };
1175
+ if (this.blockGroup) {
1176
+ this._blockEditor.blockGroupChangeProperty(this.blockGroup, values);
1177
+ }
1178
+ else {
1179
+ this.blockChangeProperty(values);
1180
+ }
1181
+ }
1182
+ blockReadonly(value) {
1183
+ const values = { readonly: value, required: false };
1184
+ if (this.blockGroup) {
1185
+ this._blockEditor.blockGroupChangeProperty(this.blockGroup, values);
1186
+ }
1187
+ else {
1188
+ this.blockChangeProperty(values);
1189
+ }
1190
+ }
1191
+ blockGroupEdit(event) {
1192
+ event.preventDefault();
1193
+ event.stopImmediatePropagation();
1194
+ this.blockGroupDialog(this.blockGroup)
1195
+ .subscribe((blockGroup) => {
1196
+ this._blockEditor.blocks
1197
+ .filter((block) => block.name === blockGroup.name)
1198
+ .forEach((block) => {
1199
+ this._blockEditor.applyBlockGroup(block, blockGroup);
1200
+ });
1201
+ });
1202
+ }
1203
+ blockGroupCreate(event) {
1204
+ event.preventDefault();
1205
+ event.stopImmediatePropagation();
1206
+ this.blockGroupDialog()
1207
+ .subscribe((blockGroup) => {
1208
+ this._blockEditor.applyBlockGroup(this.block, blockGroup);
1209
+ this.blockGroup = blockGroup;
1210
+ this._cdRef.markForCheck();
1211
+ });
1212
+ }
1213
+ blockGroupDialog(blockGroup) {
1214
+ return this._dialog.open(GroupDialogComponent, {
1215
+ data: {
1216
+ block: this.block,
1217
+ blockEditor: this._blockEditor,
1218
+ blockGroup,
1219
+ },
1220
+ })
1221
+ .afterClosed()
1222
+ .pipe(filter((block) => !!block), takeUntil(this._destroy$));
1223
+ }
1224
+ fontChanged(font) {
1225
+ this._blockEditor.selectedBlockComponentChangeProperty({ fontFamily: font });
1226
+ }
1227
+ verticalAlignClick(value) {
1228
+ this._blockEditor.selectedBlockComponentChangeProperty({ verticalAlign: value });
1229
+ }
1230
+ boldClick() {
1231
+ this._blockEditor.selectedBlockComponentChangeProperty({ bold: !this.block.bold });
1232
+ }
1233
+ toggleLock() {
1234
+ this._blockEditor.selectedBlockComponentChangeProperty({ lock: !this.block.lock });
1235
+ }
1236
+ fontColorChange(value) {
1237
+ this._blockEditor.selectedBlockComponentChangeProperty({ fontColor: value });
1238
+ }
1239
+ italicClick() {
1240
+ this._blockEditor.selectedBlockComponentChangeProperty({ italic: !this.block.italic });
1241
+ }
1242
+ underlineClick() {
1243
+ this._blockEditor.selectedBlockComponentChangeProperty({ underline: !this.block.underline });
1244
+ }
1245
+ backgroundColorChange(value) {
1246
+ this._blockEditor.selectedBlockComponentChangeProperty({ backgroundColor: value });
1247
+ }
1248
+ shadowColorChange(value) {
1249
+ this._blockEditor.selectedBlockComponentChangeProperty({ shadowColor: value });
1250
+ }
1251
+ paddingAllChange(value) {
1252
+ value = this.validNumeric(value) ? value : null;
1253
+ this.block.paddingTop = value;
1254
+ this.block.paddingLeft = value;
1255
+ this.block.paddingBottom = value;
1256
+ this.block.paddingRight = value;
1257
+ this._blockEditor.selectedBlocks
1258
+ .forEach((block) => {
1259
+ this._blockEditor.blockChange(block);
1260
+ });
1261
+ }
1262
+ paddingKeypress(event, name) {
1263
+ this.block.padding = null;
1264
+ this.numericInputKeypress(event, name);
1265
+ }
1266
+ paddingAllKeypress(event, unit = .1) {
1267
+ if (event.code === 'ArrowUp' || event.code === 'ArrowDown') {
1268
+ this.block.padding = (this.block.padding) + ((event.code === 'ArrowDown' ? -1 : 1) * unit);
1269
+ this.paddingAllChange(this.block.padding);
1270
+ }
1271
+ }
1272
+ borderColorChange(value) {
1273
+ this._blockEditor.selectedBlockComponentChangeProperty({ borderColor: value });
1274
+ }
1275
+ toggleKeepRatio() {
1276
+ this._blockEditor.selectedBlockComponentChangeProperty({ keepRatio: !this.block.keepRatio });
1277
+ }
1278
+ horizontalAlignClick(value) {
1279
+ this._blockEditor.selectedBlockComponentChangeProperty({ horizontalAlign: value });
1280
+ }
1281
+ shapeRound(name) {
1282
+ const value = this.block[name] === 'round' ? 'square' : 'round';
1283
+ this._blockEditor.selectedBlockComponentChangeProperty({ [name]: value });
1284
+ }
1285
+ numberChange(value, name) {
1286
+ value = this.validNumeric(value) ? value : null;
1287
+ this._blockEditor.selectedBlockComponentChangeProperty({ [name]: value });
1288
+ }
1289
+ imageRemove() {
1290
+ this._blockEditor.selectedBlockComponentChangeProperty({ imageUrl: null });
1291
+ }
1292
+ imageClip() {
1293
+ this.clippable = !this.clippable;
1294
+ this._blockEditor.blockClippable = true;
1295
+ }
1296
+ blockChangeProperty(values) {
1297
+ this._blockEditor.selectedBlockComponentChangeProperty(values);
1298
+ }
1299
+ blockDuplicateClick() {
1300
+ const selectedBlock = this._blockEditor.selectedBlocks[0];
1301
+ const block = Object.assign(Object.assign({}, selectedBlock), { id: null, data: null, guid: null, top: selectedBlock.top + selectedBlock.height + .1 });
1302
+ this._blockEditor.blockAdd(block);
1303
+ }
1304
+ blockRemoveClick() {
1305
+ this._blockEditor.removeBlocks(this._blockEditor.selectedBlocks);
1306
+ }
1307
+ blockUpload(block, fsFile) {
1308
+ this._blockEditor.blockUpload(block, fsFile)
1309
+ .subscribe();
1310
+ }
1311
+ blockAdd(type) {
1312
+ if (type === BlockType.Pdf || type === BlockType.Image) {
1313
+ return;
1314
+ }
1315
+ const block = {
1316
+ type,
1317
+ shadowX: 2,
1318
+ shadowY: 2,
1319
+ shadowBlur: 4,
1320
+ };
1321
+ this._blockEditor.blockAdd(block);
1322
+ }
1323
+ layerMove(direction) {
1324
+ this._blockEditor.blocks.forEach((block) => {
1325
+ if (this._blockEditor.isSelectedBlock(block)) {
1326
+ block.index += (999 * direction);
1327
+ }
1328
+ });
1329
+ const sorted = this._blockEditor.blocks
1330
+ .sort((a, b) => {
1331
+ return a.index > b.index ? 1 : -1;
1332
+ });
1333
+ sorted
1334
+ .forEach((block, idx) => {
1335
+ block.index = idx;
1336
+ this._blockEditor.blockChange(block);
1337
+ });
1338
+ if (this.config.blocksLevelChanged) {
1339
+ this.config.blocksLevelChanged(sorted.map((block) => block));
1340
+ }
1341
+ }
1342
+ exportBlocks() {
1343
+ const blocks = JSON.stringify(this._blockEditor.blocks);
1344
+ this._clipboard.copy(blocks, { showMessage: false });
1345
+ this._message.success('Exported blocks to clipboard');
1346
+ }
1347
+ importBlocks() {
1348
+ this._prompt.input({
1349
+ title: 'Import blocks',
1350
+ })
1351
+ .subscribe((blocks) => {
1352
+ blocks = JSON.parse(blocks);
1353
+ blocks
1354
+ .forEach((block) => {
1355
+ block = Object.assign(Object.assign({}, block), { guid: guid(), imageUrl: null });
1356
+ this._blockEditor.blockAdd(block);
1357
+ });
1358
+ this._message
1359
+ .success(`Imported ${blocks.length} ${blocks.length === 1 ? 'block' : 'blocks'}`);
1360
+ });
1361
+ }
1362
+ layerUp() {
1363
+ this.layerMove(1);
1364
+ }
1365
+ layerDown() {
1366
+ this.layerMove(-1);
1367
+ }
1368
+ inputFocus(event) {
1369
+ event.target.select();
1370
+ }
1371
+ numericInputKeypress(event, name, unit = .1) {
1372
+ if (event.code === 'ArrowUp' || event.code === 'ArrowDown') {
1373
+ this.block[name] = round(Number(this.block[name] || 0) +
1374
+ ((event.code === 'ArrowDown' ? -1 : 1) * unit), 3);
1375
+ this._blockEditor.selectedBlockComponentChangeProperty({ [name]: this.block[name] });
1376
+ }
1377
+ }
1378
+ ngOnDestroy() {
1379
+ this._destroy$.next();
1380
+ this._destroy$.complete();
1381
+ }
1382
+ validNumeric(value) {
1383
+ return !value || !!String(value).match(/^\d*\.?\d*$/);
1384
+ }
1385
+ }
1386
+ SidebarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SidebarComponent, deps: [{ token: i0.ElementRef }, { token: BlockEditorService }, { token: i0.ChangeDetectorRef }, { token: i2$3.FsClipboard }, { token: i3$3.FsMessage }, { token: i3$2.FsPrompt }, { token: i1.MatDialog }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component });
1387
+ SidebarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: SidebarComponent, selector: "sidebar", inputs: { config: "config", blocks: "blocks", zoompan: "zoompan" }, outputs: { zoomCenter: "zoomCenter" }, queries: [{ propertyName: "sidebarPanels", predicate: FsBlockEditorSidebarPanelDirective }], ngImport: i0, template: "<div class=\"sidebar\">\n <form fsForm>\n <div class=\"sidebar-panel\"> \n <div class=\"sidebar-label\">Elements</div>\n <div class=\"sidebar-row\">\n <ng-container *ngFor=\"let blockType of BlockTypes\">\n <ng-container *ngIf=\"blockType.type === 'draw'\">\n <ng-container [ngSwitch]=\"blockType.value\">\n <ng-container *ngSwitchCase=\"BlockType.Pdf\">\n <ng-container [ngTemplateOutlet]=\"addFile\" [ngTemplateOutletContext]=\"{ type: BlockType.Pdf }\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"BlockType.Image\">\n <ng-container [ngTemplateOutlet]=\"addFile\" [ngTemplateOutletContext]=\"{ type: BlockType.Rectangle }\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container \n [ngTemplateOutlet]=\"addButton\" \n [ngTemplateOutletContext]=\"{ blockType: blockType }\">\n </ng-container>\n </ng-container>\n </ng-container>\n\n <ng-template #addFile let-type=\"type\">\n <fs-file \n (select)=\"blockUpload({ type: type, keepRatio: true, borderWidth: 0 }, $event)\" \n [accept]=\"blockType.accept\">\n <ng-container [ngTemplateOutlet]=\"addButton\" [ngTemplateOutletContext]=\"{ blockType: blockType }\"></ng-container>\n </fs-file>\n </ng-template>\n </ng-container>\n </ng-container>\n </div>\n </div>\n\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Form</div>\n <div class=\"sidebar-row\">\n <ng-container *ngFor=\"let blockType of BlockTypes\">\n <ng-container *ngIf=\"blockType.type === 'form'\">\n <ng-container \n [ngTemplateOutlet]=\"addButton\" \n [ngTemplateOutletContext]=\"{ blockType: blockType }\">\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </div> \n\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Tools</div>\n <div class=\"sidebar-row\">\n <ng-container *ngIf=\"block\">\n <button\n class=\"layer-up\"\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"layerUp()\"\n [matTooltip]=\"'Increase layer'\">\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 [matTooltip]=\"'Decrease layer'\">\n <mat-icon>arrow_back</mat-icon>\n <mat-icon>layers</mat-icon>\n </button>\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"toggleLock()\"\n [matTooltip]=\"block.lock ? 'Unlock' : 'Lock'\">\n <mat-icon>{{block.lock ? 'lock_outline' : 'lock_open'}}</mat-icon>\n </button>\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n [matTooltip]=\"'Duplicate block'\"\n (click)=\"blockDuplicateClick()\">\n <mat-icon>content_copy</mat-icon>\n </button>\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n [matTooltip]=\"'Delete block'\"\n (click)=\"blockRemoveClick()\">\n <mat-icon>delete_outline</mat-icon>\n </button> \n </ng-container>\n <ng-container *ngIf=\"blocksReordered\">\n <button\n class=\"reorder-layers\"\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"blocksReordered()\"\n [matTooltip]=\"'Reorder blocks'\">\n <mat-icon>swap_vert</mat-icon>\n </button>\n </ng-container>\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 </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 field-gap\">\n <mat-form-field class=\"form-field-padless form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.left\"\n name=\"left\"\n fsMaskNumber\n [scale]=\"5\"\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 form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.top\"\n name=\"top\"\n fsMaskNumber\n [scale]=\"5\"\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 form-field-prefix rotate\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.rotate\"\n name=\"rotate\"\n fsMaskNumber\n [scale]=\"5\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'rotate', 1)\"\n (ngModelChange)=\"numberChange($event, 'rotate')\">\n <span matPrefix>R</span>\n </mat-form-field>\n </div>\n\n <div class=\"sidebar-row field-gap\">\n <mat-form-field class=\"form-field-padless form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.width\"\n name=\"width\"\n fsMaskNumber\n [scale]=\"5\"\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 form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.height\"\n name=\"height\"\n fsMaskNumber\n [scale]=\"5\"\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\n *ngIf=\"blockTypeForm\">\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]}}\n </div>\n <div class=\"sidebar-row\">\n\n <ng-container *ngIf=\"block.type === BlockType.RadioButton; else nameField\">\n <div class=\"group-block\">\n <mat-form-field class=\"full-width\" class=\"full-width\">\n <mat-label>Group</mat-label>\n <mat-select\n [(ngModel)]=\"blockGroup\"\n (ngModelChange)=\"blockGroupChange($event)\"\n name=\"group\">\n <ng-container *ngIf=\"blockGroups.length\">\n <mat-option [value]=\"null\">\n None\n </mat-option>\n </ng-container>\n <mat-option\n *ngFor=\"let item of blockGroups\"\n [value]=\"item\">\n {{ item.label }}\n </mat-option>\n <mat-option \n [value]=\"null\"\n (click)=\"blockGroupCreate($event)\">\n Create Group\n </mat-option>\n </mat-select> \n </mat-form-field>\n <ng-container *ngIf=\"blockGroup\">\n <a \n (click)=\"blockGroupEdit($event)\">\n <mat-icon>edit</mat-icon>\n </a>\n </ng-container>\n </div>\n </ng-container>\n \n <mat-form-field class=\"full-width\">\n <input\n matInput\n [ngModel]=\"block.label\"\n name=\"label\"\n placeholder=\"Label\"\n (ngModelChange)=\"blockChangeProperty({ label: $event })\">\n </mat-form-field>\n\n <ng-container *ngIf=\"block.type !== BlockType.RadioButton\">\n <mat-form-field class=\"full-width\">\n <textarea\n matInput\n [cdkTextareaAutosize]=\"true\"\n [ngModel]=\"block.description\"\n name=\"description\"\n placeholder=\"Description\"\n (ngModelChange)=\"blockChangeProperty({ description: $event })\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <mat-form-field\n *ngIf=\"formats.length\"\n class=\"full-width\">\n <mat-label>Format</mat-label>\n <mat-select\n [(ngModel)]=\"block.format\"\n name=\"format\"\n (ngModelChange)=\"blockChangeProperty({ format: $event })\"> \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\n *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText || block.type === BlockType.Date\">\n <mat-form-field class=\"full-width\">\n <textarea\n matInput\n [cdkTextareaAutosize]=\"true\"\n [ngModel]=\"block.default\"\n name=\"default\"\n [validate]=\"validate\"\n placeholder=\"Default\"\n (ngModelChange)=\"blockChangeProperty({ default: $event })\">\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=\"full-width\">\n <textarea\n matInput\n [cdkTextareaAutosize]=\"true\"\n [ngModel]=\"block.formula\"\n name=\"formula\"\n placeholder=\"Formula\"\n (ngModelChange)=\"blockChangeProperty({ formula: $event })\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <ng-template #nameField>\n <mat-form-field class=\"full-width\">\n <input\n matInput\n [ngModel]=\"block.name\"\n name=\"name\"\n placeholder=\"Name\"\n (ngModelChange)=\"blockChangeProperty({ name: $event })\">\n </mat-form-field>\n </ng-template>\n\n <div class=\"form-field-options\">\n <mat-checkbox\n name=\"required\"\n [(ngModel)]=\"block.required\"\n (ngModelChange)=\"blockRequired($event)\">\n Required\n </mat-checkbox>\n\n <mat-checkbox\n name=\"readonly\"\n [(ngModel)]=\"block.readonly\"\n (ngModelChange)=\"blockReadonly($event)\">\n Readonly\n </mat-checkbox>\n </div>\n </div>\n </div>\n </ng-container>\n <ng-container *ngIf=\"block.type === BlockType.Rectangle || block.type === BlockType.Image || block.type === BlockType.Pdf\">\n <div class=\"sidebar-panel typography-panel\">\n <div class=\"sidebar-label\">Typography</div>\n <div class=\"sidebar-row field-gap\">\n <fs-font-picker \n [(ngModel)]=\"block.fontFamily\" \n (ngModelChange)=\"fontChanged($event)\"\n name=\"fontfamily\">\n </fs-font-picker>\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 form-field-prefix font-size\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.fontSize\"\n name=\"fontSize\"\n fsMaskNumber\n [scale]=\"5\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'fontSize', 1)\"\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 form-field-prefix line-height\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.lineHeight\"\n name=\"lineHeight\"\n fsMaskNumber\n [scale]=\"5\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'lineHeight', 1)\"\n (ngModelChange)=\"numberChange($event, 'lineHeight')\"\n placeholder=\"Line\">\n <span matPrefix *ngIf=\"block.lineHeight\">L</span>\n </mat-form-field>\n\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 field-gap\">\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 field-gap\">\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 form-field-prefix border-width\" floatLabel=\"never\">\n <input\n matInput\n [(ngModel)]=\"block.borderWidth\"\n name=\"borderWidth\"\n fsMaskNumber\n [scale]=\"5\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'borderWidth', 1)\"\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 <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Shape</div>\n\n <div class=\"sidebar-row field-gap\">\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 form-field-prefix shape-radius\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shapeRadius\"\n name=\"shapeRadius\"\n fsMaskNumber\n [scale]=\"5\"\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 <div class=\"sidebar-panel shadow-panel\">\n <div class=\"sidebar-label\">Shadow</div>\n\n <div class=\"sidebar-row field-gap\">\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 form-field-prefix shadow-x\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shadowX\"\n name=\"shadowX\"\n fsMaskNumber\n [scale]=\"5\"\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 form-field-prefix 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 form-field-prefix shadow-blur\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shadowBlur\"\n name=\"shadowBlur\"\n placeholder=\"Blur\"\n fsMaskNumber\n [scale]=\"5\"\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 form-field-prefix shadow-spread\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shadowSpread\"\n name=\"shadowSpread\"\n placeholder=\"Spread\"\n fsMaskNumber\n [scale]=\"5\"\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 <ng-container *ngIf=\"block.type === BlockType.Rectangle\">\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Image</div>\n <div class=\"sidebar-row image-row\">\n <fs-file (select)=\"blockUpload(block, $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\n <mat-form-field class=\"form-field-padless opacity\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.imageOpacity\"\n fsMaskNumber\n [scale]=\"5\"\n name=\"imageOpacity\"\n placeholder=\"Opacity\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'imageOpacity', 1)\"\n (ngModelChange)=\"numberChange($event, 'imageOpacity')\">\n <span matPrefix *ngIf=\"block.imageOpacity\">O</span>\n </mat-form-field>\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 field-gap\">\n\n <mat-form-field class=\"form-field-padless form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [(ngModel)]=\"block.padding\"\n name=\"padding\"\n fsMaskNumber\n [scale]=\"5\"\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 form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingTop\"\n name=\"paddingTop\"\n fsMaskNumber\n [scale]=\"5\"\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 form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingBottom\"\n name=\"paddingBottom\"\n fsMaskNumber\n [scale]=\"5\"\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 form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingLeft\"\n name=\"paddingLeft\"\n fsMaskNumber\n [scale]=\"5\"\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 form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingRight\"\n name=\"paddingRight\"\n fsMaskNumber\n [scale]=\"5\"\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 </ng-container>\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Utilities</div>\n <div class=\"sidebar-row padding-row\">\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"exportBlocks()\"\n [matTooltip]=\"'Export blocks'\">\n <mat-icon>download</mat-icon>\n </button>\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"importBlocks()\"\n [matTooltip]=\"'Import blocks'\">\n <mat-icon>upload</mat-icon>\n </button>\n </div>\n </div> \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 </form>\n</div>\n<ng-template #addButton let-blockType=\"blockType\">\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>", styles: [".sidebar{width:320px;font-size:14px;height:100%;overflow:auto;background-color:#fff;padding:0 10px 10px;box-shadow:0 1px 3px 1px #0003;z-index:1;position:relative;box-sizing:border-box}.sidebar form{height:100%}.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.image-row .opacity{width:60px;margin-left:10px}.sidebar .sidebar-row ::ng-deep .mat-checkbox,.sidebar .sidebar-row ::ng-deep .mat-form-field{font-size:12px}.sidebar .sidebar-row.field-gap>*:not(.mat-icon-button):not(fs-file){margin-right:11px}.sidebar .sidebar-row.field-gap>*: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,.sidebar .line-height,.sidebar .font-size{width:45px}.sidebar .border-width{width:50px}.sidebar .shape-radius{width:60px}.sidebar .shape-corners{display:grid;grid-template-columns:1fr 1fr;column-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{background-color:#212121}.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 .group-block{width:100%;display:flex;align-items:center}.sidebar .group-block a{margin-left:5px;color:inherit}.sidebar .group-block a mat-icon{transform:scale(.8)}.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 .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:60px}.sidebar .sidebar-panel.info-panel .mat-form-field.rotate{width:50px}.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{width:40px}.sidebar .sidebar-panel.shadow-panel .mat-form-field.shadow-blur{width:50px}.sidebar .sidebar-panel.shadow-panel .mat-form-field.shadow-spread{width:60px}.sidebar .sidebar-panel.typography-panel fs-font-picker{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-appearance-outline.form-field-prefix .mat-form-field-suffix,:host ::ng-deep .mat-form-field-appearance-outline.form-field-prefix .mat-form-field-prefix{top:0}:host ::ng-deep .mat-form-field-prefix{color:#9e9e9e;margin-right:3px;font-size:85%}\n"], dependencies: [{ kind: "directive", type: i6$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i6$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i6$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i6$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i6$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i6$1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i4$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3.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"] }, { kind: "directive", type: i4.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { kind: "component", type: i11.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i11.MatLabel, selector: "mat-label" }, { kind: "directive", type: i11.MatPrefix, selector: "[matPrefix]" }, { kind: "directive", type: i6.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i13.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "directive", type: i14.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: i15.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i16.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i17.FsFileComponent, selector: "fs-file", inputs: ["minHeight", "minWidth", "orientate", "multiple", "capture", "allowClick", "allowDrop", "accept", "disabled", "imageWidth", "imageHeight", "imageQuality"], outputs: ["select", "error", "beforeProcessing", "clicked", "declined"] }, { kind: "component", type: i18.FsColorPickerChipComponent, selector: "fs-color-picker-chip", inputs: ["color", "showClear"], outputs: ["changed"] }, { kind: "directive", type: i7.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup", "deactivationGuard"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"], exportAs: ["fsForm"] }, { kind: "directive", type: i7.FsFormValidateDirective, selector: "[validate]", inputs: ["validate", "validateData", "validateOnSubmit"] }, { kind: "directive", type: i7.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { kind: "directive", type: i20.FsMaskNumberDirective, selector: "[fsMaskNumber]" }, { kind: "component", type: i2$2.FsFontPickerComponent, selector: "fs-font-picker" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1388
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SidebarComponent, decorators: [{
1389
+ type: Component,
1390
+ args: [{ selector: 'sidebar', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"sidebar\">\n <form fsForm>\n <div class=\"sidebar-panel\"> \n <div class=\"sidebar-label\">Elements</div>\n <div class=\"sidebar-row\">\n <ng-container *ngFor=\"let blockType of BlockTypes\">\n <ng-container *ngIf=\"blockType.type === 'draw'\">\n <ng-container [ngSwitch]=\"blockType.value\">\n <ng-container *ngSwitchCase=\"BlockType.Pdf\">\n <ng-container [ngTemplateOutlet]=\"addFile\" [ngTemplateOutletContext]=\"{ type: BlockType.Pdf }\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"BlockType.Image\">\n <ng-container [ngTemplateOutlet]=\"addFile\" [ngTemplateOutletContext]=\"{ type: BlockType.Rectangle }\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container \n [ngTemplateOutlet]=\"addButton\" \n [ngTemplateOutletContext]=\"{ blockType: blockType }\">\n </ng-container>\n </ng-container>\n </ng-container>\n\n <ng-template #addFile let-type=\"type\">\n <fs-file \n (select)=\"blockUpload({ type: type, keepRatio: true, borderWidth: 0 }, $event)\" \n [accept]=\"blockType.accept\">\n <ng-container [ngTemplateOutlet]=\"addButton\" [ngTemplateOutletContext]=\"{ blockType: blockType }\"></ng-container>\n </fs-file>\n </ng-template>\n </ng-container>\n </ng-container>\n </div>\n </div>\n\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Form</div>\n <div class=\"sidebar-row\">\n <ng-container *ngFor=\"let blockType of BlockTypes\">\n <ng-container *ngIf=\"blockType.type === 'form'\">\n <ng-container \n [ngTemplateOutlet]=\"addButton\" \n [ngTemplateOutletContext]=\"{ blockType: blockType }\">\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </div> \n\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Tools</div>\n <div class=\"sidebar-row\">\n <ng-container *ngIf=\"block\">\n <button\n class=\"layer-up\"\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"layerUp()\"\n [matTooltip]=\"'Increase layer'\">\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 [matTooltip]=\"'Decrease layer'\">\n <mat-icon>arrow_back</mat-icon>\n <mat-icon>layers</mat-icon>\n </button>\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"toggleLock()\"\n [matTooltip]=\"block.lock ? 'Unlock' : 'Lock'\">\n <mat-icon>{{block.lock ? 'lock_outline' : 'lock_open'}}</mat-icon>\n </button>\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n [matTooltip]=\"'Duplicate block'\"\n (click)=\"blockDuplicateClick()\">\n <mat-icon>content_copy</mat-icon>\n </button>\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n [matTooltip]=\"'Delete block'\"\n (click)=\"blockRemoveClick()\">\n <mat-icon>delete_outline</mat-icon>\n </button> \n </ng-container>\n <ng-container *ngIf=\"blocksReordered\">\n <button\n class=\"reorder-layers\"\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"blocksReordered()\"\n [matTooltip]=\"'Reorder blocks'\">\n <mat-icon>swap_vert</mat-icon>\n </button>\n </ng-container>\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 </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 field-gap\">\n <mat-form-field class=\"form-field-padless form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.left\"\n name=\"left\"\n fsMaskNumber\n [scale]=\"5\"\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 form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.top\"\n name=\"top\"\n fsMaskNumber\n [scale]=\"5\"\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 form-field-prefix rotate\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.rotate\"\n name=\"rotate\"\n fsMaskNumber\n [scale]=\"5\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'rotate', 1)\"\n (ngModelChange)=\"numberChange($event, 'rotate')\">\n <span matPrefix>R</span>\n </mat-form-field>\n </div>\n\n <div class=\"sidebar-row field-gap\">\n <mat-form-field class=\"form-field-padless form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.width\"\n name=\"width\"\n fsMaskNumber\n [scale]=\"5\"\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 form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.height\"\n name=\"height\"\n fsMaskNumber\n [scale]=\"5\"\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\n *ngIf=\"blockTypeForm\">\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]}}\n </div>\n <div class=\"sidebar-row\">\n\n <ng-container *ngIf=\"block.type === BlockType.RadioButton; else nameField\">\n <div class=\"group-block\">\n <mat-form-field class=\"full-width\" class=\"full-width\">\n <mat-label>Group</mat-label>\n <mat-select\n [(ngModel)]=\"blockGroup\"\n (ngModelChange)=\"blockGroupChange($event)\"\n name=\"group\">\n <ng-container *ngIf=\"blockGroups.length\">\n <mat-option [value]=\"null\">\n None\n </mat-option>\n </ng-container>\n <mat-option\n *ngFor=\"let item of blockGroups\"\n [value]=\"item\">\n {{ item.label }}\n </mat-option>\n <mat-option \n [value]=\"null\"\n (click)=\"blockGroupCreate($event)\">\n Create Group\n </mat-option>\n </mat-select> \n </mat-form-field>\n <ng-container *ngIf=\"blockGroup\">\n <a \n (click)=\"blockGroupEdit($event)\">\n <mat-icon>edit</mat-icon>\n </a>\n </ng-container>\n </div>\n </ng-container>\n \n <mat-form-field class=\"full-width\">\n <input\n matInput\n [ngModel]=\"block.label\"\n name=\"label\"\n placeholder=\"Label\"\n (ngModelChange)=\"blockChangeProperty({ label: $event })\">\n </mat-form-field>\n\n <ng-container *ngIf=\"block.type !== BlockType.RadioButton\">\n <mat-form-field class=\"full-width\">\n <textarea\n matInput\n [cdkTextareaAutosize]=\"true\"\n [ngModel]=\"block.description\"\n name=\"description\"\n placeholder=\"Description\"\n (ngModelChange)=\"blockChangeProperty({ description: $event })\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <mat-form-field\n *ngIf=\"formats.length\"\n class=\"full-width\">\n <mat-label>Format</mat-label>\n <mat-select\n [(ngModel)]=\"block.format\"\n name=\"format\"\n (ngModelChange)=\"blockChangeProperty({ format: $event })\"> \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\n *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText || block.type === BlockType.Date\">\n <mat-form-field class=\"full-width\">\n <textarea\n matInput\n [cdkTextareaAutosize]=\"true\"\n [ngModel]=\"block.default\"\n name=\"default\"\n [validate]=\"validate\"\n placeholder=\"Default\"\n (ngModelChange)=\"blockChangeProperty({ default: $event })\">\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=\"full-width\">\n <textarea\n matInput\n [cdkTextareaAutosize]=\"true\"\n [ngModel]=\"block.formula\"\n name=\"formula\"\n placeholder=\"Formula\"\n (ngModelChange)=\"blockChangeProperty({ formula: $event })\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <ng-template #nameField>\n <mat-form-field class=\"full-width\">\n <input\n matInput\n [ngModel]=\"block.name\"\n name=\"name\"\n placeholder=\"Name\"\n (ngModelChange)=\"blockChangeProperty({ name: $event })\">\n </mat-form-field>\n </ng-template>\n\n <div class=\"form-field-options\">\n <mat-checkbox\n name=\"required\"\n [(ngModel)]=\"block.required\"\n (ngModelChange)=\"blockRequired($event)\">\n Required\n </mat-checkbox>\n\n <mat-checkbox\n name=\"readonly\"\n [(ngModel)]=\"block.readonly\"\n (ngModelChange)=\"blockReadonly($event)\">\n Readonly\n </mat-checkbox>\n </div>\n </div>\n </div>\n </ng-container>\n <ng-container *ngIf=\"block.type === BlockType.Rectangle || block.type === BlockType.Image || block.type === BlockType.Pdf\">\n <div class=\"sidebar-panel typography-panel\">\n <div class=\"sidebar-label\">Typography</div>\n <div class=\"sidebar-row field-gap\">\n <fs-font-picker \n [(ngModel)]=\"block.fontFamily\" \n (ngModelChange)=\"fontChanged($event)\"\n name=\"fontfamily\">\n </fs-font-picker>\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 form-field-prefix font-size\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.fontSize\"\n name=\"fontSize\"\n fsMaskNumber\n [scale]=\"5\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'fontSize', 1)\"\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 form-field-prefix line-height\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.lineHeight\"\n name=\"lineHeight\"\n fsMaskNumber\n [scale]=\"5\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'lineHeight', 1)\"\n (ngModelChange)=\"numberChange($event, 'lineHeight')\"\n placeholder=\"Line\">\n <span matPrefix *ngIf=\"block.lineHeight\">L</span>\n </mat-form-field>\n\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 field-gap\">\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 field-gap\">\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 form-field-prefix border-width\" floatLabel=\"never\">\n <input\n matInput\n [(ngModel)]=\"block.borderWidth\"\n name=\"borderWidth\"\n fsMaskNumber\n [scale]=\"5\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'borderWidth', 1)\"\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 <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Shape</div>\n\n <div class=\"sidebar-row field-gap\">\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 form-field-prefix shape-radius\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shapeRadius\"\n name=\"shapeRadius\"\n fsMaskNumber\n [scale]=\"5\"\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 <div class=\"sidebar-panel shadow-panel\">\n <div class=\"sidebar-label\">Shadow</div>\n\n <div class=\"sidebar-row field-gap\">\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 form-field-prefix shadow-x\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shadowX\"\n name=\"shadowX\"\n fsMaskNumber\n [scale]=\"5\"\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 form-field-prefix 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 form-field-prefix shadow-blur\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shadowBlur\"\n name=\"shadowBlur\"\n placeholder=\"Blur\"\n fsMaskNumber\n [scale]=\"5\"\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 form-field-prefix shadow-spread\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shadowSpread\"\n name=\"shadowSpread\"\n placeholder=\"Spread\"\n fsMaskNumber\n [scale]=\"5\"\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 <ng-container *ngIf=\"block.type === BlockType.Rectangle\">\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Image</div>\n <div class=\"sidebar-row image-row\">\n <fs-file (select)=\"blockUpload(block, $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\n <mat-form-field class=\"form-field-padless opacity\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.imageOpacity\"\n fsMaskNumber\n [scale]=\"5\"\n name=\"imageOpacity\"\n placeholder=\"Opacity\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'imageOpacity', 1)\"\n (ngModelChange)=\"numberChange($event, 'imageOpacity')\">\n <span matPrefix *ngIf=\"block.imageOpacity\">O</span>\n </mat-form-field>\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 field-gap\">\n\n <mat-form-field class=\"form-field-padless form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [(ngModel)]=\"block.padding\"\n name=\"padding\"\n fsMaskNumber\n [scale]=\"5\"\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 form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingTop\"\n name=\"paddingTop\"\n fsMaskNumber\n [scale]=\"5\"\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 form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingBottom\"\n name=\"paddingBottom\"\n fsMaskNumber\n [scale]=\"5\"\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 form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingLeft\"\n name=\"paddingLeft\"\n fsMaskNumber\n [scale]=\"5\"\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 form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingRight\"\n name=\"paddingRight\"\n fsMaskNumber\n [scale]=\"5\"\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 </ng-container>\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Utilities</div>\n <div class=\"sidebar-row padding-row\">\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"exportBlocks()\"\n [matTooltip]=\"'Export blocks'\">\n <mat-icon>download</mat-icon>\n </button>\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"importBlocks()\"\n [matTooltip]=\"'Import blocks'\">\n <mat-icon>upload</mat-icon>\n </button>\n </div>\n </div> \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 </form>\n</div>\n<ng-template #addButton let-blockType=\"blockType\">\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>", styles: [".sidebar{width:320px;font-size:14px;height:100%;overflow:auto;background-color:#fff;padding:0 10px 10px;box-shadow:0 1px 3px 1px #0003;z-index:1;position:relative;box-sizing:border-box}.sidebar form{height:100%}.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.image-row .opacity{width:60px;margin-left:10px}.sidebar .sidebar-row ::ng-deep .mat-checkbox,.sidebar .sidebar-row ::ng-deep .mat-form-field{font-size:12px}.sidebar .sidebar-row.field-gap>*:not(.mat-icon-button):not(fs-file){margin-right:11px}.sidebar .sidebar-row.field-gap>*: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,.sidebar .line-height,.sidebar .font-size{width:45px}.sidebar .border-width{width:50px}.sidebar .shape-radius{width:60px}.sidebar .shape-corners{display:grid;grid-template-columns:1fr 1fr;column-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{background-color:#212121}.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 .group-block{width:100%;display:flex;align-items:center}.sidebar .group-block a{margin-left:5px;color:inherit}.sidebar .group-block a mat-icon{transform:scale(.8)}.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 .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:60px}.sidebar .sidebar-panel.info-panel .mat-form-field.rotate{width:50px}.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{width:40px}.sidebar .sidebar-panel.shadow-panel .mat-form-field.shadow-blur{width:50px}.sidebar .sidebar-panel.shadow-panel .mat-form-field.shadow-spread{width:60px}.sidebar .sidebar-panel.typography-panel fs-font-picker{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-appearance-outline.form-field-prefix .mat-form-field-suffix,:host ::ng-deep .mat-form-field-appearance-outline.form-field-prefix .mat-form-field-prefix{top:0}:host ::ng-deep .mat-form-field-prefix{color:#9e9e9e;margin-right:3px;font-size:85%}\n"] }]
1391
+ }], ctorParameters: function () {
1392
+ return [{ type: i0.ElementRef }, { type: BlockEditorService }, { type: i0.ChangeDetectorRef }, { type: i2$3.FsClipboard }, { type: i3$3.FsMessage }, { type: i3$2.FsPrompt }, { type: i1.MatDialog }, { type: undefined, decorators: [{
1393
+ type: Inject,
1394
+ args: [DOCUMENT]
1395
+ }] }];
1396
+ }, propDecorators: { sidebarPanels: [{
1397
+ type: ContentChildren,
1398
+ args: [FsBlockEditorSidebarPanelDirective]
1399
+ }], config: [{
1400
+ type: Input
1401
+ }], blocks: [{
1402
+ type: Input
1403
+ }], zoompan: [{
1404
+ type: Input
1405
+ }], zoomCenter: [{
1406
+ type: Output
1407
1407
  }] } });
1408
1408
 
1409
- class ArtboardComponent {
1410
- constructor(_el, _blockEditor, _cdRef) {
1411
- this._el = _el;
1412
- this._blockEditor = _blockEditor;
1413
- this._cdRef = _cdRef;
1414
- this.blocks = [];
1415
- this._destroy$ = new Subject();
1416
- }
1417
- get el() {
1418
- return this._el.nativeElement;
1419
- }
1420
- ngOnInit() {
1421
- this.config = Object.assign(Object.assign({}, this.config), { unit: 'in' });
1422
- this._blockEditor.registerContainer(this.artboard.nativeElement);
1423
- this._blockEditor.registerMargin(this.marginContainer.nativeElement);
1424
- this._blockEditor.blocks$
1425
- .pipe(takeUntil(this._destroy$))
1426
- .subscribe((blocks) => {
1427
- this.blocks = blocks;
1428
- this._cdRef.markForCheck();
1429
- });
1430
- this._blockEditor.blockAdded$
1431
- .pipe(delay(300), takeUntil(this._destroy$))
1432
- .subscribe((block) => {
1433
- this._blockEditor.selectedBlocks = [block];
1434
- this._cdRef.markForCheck();
1435
- });
1436
- }
1437
- ngAfterViewInit() {
1438
- this.blockComponents
1439
- .changes
1440
- .pipe(takeUntil(this._destroy$))
1441
- .subscribe(() => {
1442
- this._blockEditor.blockComponents = this.blockComponents.toArray();
1443
- });
1444
- this._blockEditor.blockComponents = this.blockComponents.toArray();
1445
- }
1446
- ngOnDestroy() {
1447
- this._destroy$.next();
1448
- this._destroy$.complete();
1449
- }
1450
- }
1451
- ArtboardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ArtboardComponent, deps: [{ token: i0.ElementRef }, { token: BlockEditorService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1452
- ArtboardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", 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, 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: i17.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i17.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1453
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ArtboardComponent, decorators: [{
1454
- type: Component,
1455
- args: [{ selector: 'app-artboard', changeDetection: ChangeDetectionStrategy.OnPush, 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"] }]
1456
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: BlockEditorService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { sidebarPanels: [{
1457
- type: ContentChildren,
1458
- args: [FsBlockEditorSidebarPanelDirective]
1459
- }], blockComponents: [{
1460
- type: ViewChildren,
1461
- args: [FsBlockComponent]
1462
- }], artboard: [{
1463
- type: ViewChild,
1464
- args: ['artboard', { static: true }]
1465
- }], marginContainer: [{
1466
- type: ViewChild,
1467
- args: ['marginContainer', { static: true }]
1468
- }], margins: [{
1469
- type: ViewChildren,
1470
- args: [FsBlockEditorMarginDirective]
1471
- }], sidebar: [{
1472
- type: ViewChild,
1473
- args: [SidebarComponent, { static: true }]
1474
- }], config: [{
1475
- type: Input
1476
- }], zoompan: [{
1477
- type: Input
1409
+ class ArtboardComponent {
1410
+ constructor(_el, _blockEditor, _cdRef) {
1411
+ this._el = _el;
1412
+ this._blockEditor = _blockEditor;
1413
+ this._cdRef = _cdRef;
1414
+ this.blocks = [];
1415
+ this._destroy$ = new Subject();
1416
+ }
1417
+ get el() {
1418
+ return this._el.nativeElement;
1419
+ }
1420
+ ngOnInit() {
1421
+ this.config = Object.assign(Object.assign({}, this.config), { unit: 'in' });
1422
+ this._blockEditor.registerContainer(this.artboard.nativeElement);
1423
+ this._blockEditor.registerMargin(this.marginContainer.nativeElement);
1424
+ this._blockEditor.blocks$
1425
+ .pipe(takeUntil(this._destroy$))
1426
+ .subscribe((blocks) => {
1427
+ this.blocks = blocks;
1428
+ this._cdRef.markForCheck();
1429
+ });
1430
+ this._blockEditor.blockAdded$
1431
+ .pipe(delay(300), takeUntil(this._destroy$))
1432
+ .subscribe((block) => {
1433
+ this._blockEditor.selectedBlocks = [block];
1434
+ this._cdRef.markForCheck();
1435
+ });
1436
+ }
1437
+ ngAfterViewInit() {
1438
+ this.blockComponents
1439
+ .changes
1440
+ .pipe(takeUntil(this._destroy$))
1441
+ .subscribe(() => {
1442
+ this._blockEditor.blockComponents = this.blockComponents.toArray();
1443
+ });
1444
+ this._blockEditor.blockComponents = this.blockComponents.toArray();
1445
+ }
1446
+ ngOnDestroy() {
1447
+ this._destroy$.next();
1448
+ this._destroy$.complete();
1449
+ }
1450
+ }
1451
+ ArtboardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ArtboardComponent, deps: [{ token: i0.ElementRef }, { token: BlockEditorService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1452
+ ArtboardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", 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, 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"], dependencies: [{ kind: "directive", type: i6$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i6$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: FsBlockComponent, selector: "fs-block", inputs: ["block", "html", "zoompan"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1453
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ArtboardComponent, decorators: [{
1454
+ type: Component,
1455
+ args: [{ selector: 'app-artboard', changeDetection: ChangeDetectionStrategy.OnPush, 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"] }]
1456
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: BlockEditorService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { sidebarPanels: [{
1457
+ type: ContentChildren,
1458
+ args: [FsBlockEditorSidebarPanelDirective]
1459
+ }], blockComponents: [{
1460
+ type: ViewChildren,
1461
+ args: [FsBlockComponent]
1462
+ }], artboard: [{
1463
+ type: ViewChild,
1464
+ args: ['artboard', { static: true }]
1465
+ }], marginContainer: [{
1466
+ type: ViewChild,
1467
+ args: ['marginContainer', { static: true }]
1468
+ }], margins: [{
1469
+ type: ViewChildren,
1470
+ args: [FsBlockEditorMarginDirective]
1471
+ }], sidebar: [{
1472
+ type: ViewChild,
1473
+ args: [SidebarComponent, { static: true }]
1474
+ }], config: [{
1475
+ type: Input
1476
+ }], zoompan: [{
1477
+ type: Input
1478
1478
  }] } });
1479
1479
 
1480
- class FsBlockEditorComponent {
1481
- constructor(_el, _blockEditor) {
1482
- this._el = _el;
1483
- this._blockEditor = _blockEditor;
1484
- this._destroy$ = new Subject();
1485
- }
1486
- get el() {
1487
- return this._el.nativeElement;
1488
- }
1489
- ngOnInit() {
1490
- this.config = Object.assign(Object.assign({}, this.config), { unit: 'in' });
1491
- this._blockEditor.init(this.config);
1492
- this._blockEditor.blocks$
1493
- .pipe(takeUntil(this._destroy$))
1494
- .subscribe((blocks) => {
1495
- this.blocks = blocks;
1496
- });
1497
- setTimeout(() => {
1498
- this.zoomCenter();
1499
- });
1500
- }
1501
- zoomCenter() {
1502
- }
1503
- editorContainerClick(event) {
1504
- if (event.target.classList.contains('deselectable') ||
1505
- event.target.classList.contains('fs-zoom-pan-container')) {
1506
- this.zoompan.enable();
1507
- this._blockEditor.selectedBlocks = [];
1508
- }
1509
- }
1510
- ngOnDestroy() {
1511
- this._destroy$.next();
1512
- this._destroy$.complete();
1513
- }
1514
- }
1515
- FsBlockEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsBlockEditorComponent, deps: [{ token: i0.ElementRef }, { token: BlockEditorService }], target: i0.ɵɵFactoryTarget.Component });
1516
- FsBlockEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: FsBlockEditorComponent, selector: "fs-block-editor", inputs: { config: "config" }, providers: [
1517
- BlockEditorService,
1518
- BlocksStore,
1519
- ], queries: [{ propertyName: "sidebarPanels", predicate: FsBlockEditorSidebarPanelDirective }], viewQueries: [{ propertyName: "zoompan", first: true, predicate: 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: ElementRef }], ngImport: i0, 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;border:1px solid #ececec}.editor-container .zoom-pan-container{flex:1}fs-zoom-pan{height:100%}\n"], components: [{ type: i2$3.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", "zoompan"], outputs: ["zoomCenter"] }], directives: [{ type: i2$3.FsZoomPanContentDirective, selector: "[fsZoomPanContent]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1520
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsBlockEditorComponent, decorators: [{
1521
- type: Component,
1522
- args: [{ selector: 'fs-block-editor', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
1523
- BlockEditorService,
1524
- BlocksStore,
1525
- ], 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;border:1px solid #ececec}.editor-container .zoom-pan-container{flex:1}fs-zoom-pan{height:100%}\n"] }]
1526
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: BlockEditorService }]; }, propDecorators: { sidebarPanels: [{
1527
- type: ContentChildren,
1528
- args: [FsBlockEditorSidebarPanelDirective]
1529
- }], zoompan: [{
1530
- type: ViewChild,
1531
- args: [FsZoomPanComponent, { static: true }]
1532
- }], artboardContainer: [{
1533
- type: ViewChild,
1534
- args: ['artboardContainer', { static: true }]
1535
- }], sidebar: [{
1536
- type: ViewChild,
1537
- args: [SidebarComponent, { static: true }]
1538
- }], artboard: [{
1539
- type: ViewChild,
1540
- args: [ArtboardComponent, { read: ElementRef }]
1541
- }], config: [{
1542
- type: Input
1480
+ class FsBlockEditorComponent {
1481
+ constructor(_el, _blockEditor) {
1482
+ this._el = _el;
1483
+ this._blockEditor = _blockEditor;
1484
+ this._destroy$ = new Subject();
1485
+ }
1486
+ get el() {
1487
+ return this._el.nativeElement;
1488
+ }
1489
+ ngOnInit() {
1490
+ this.config = Object.assign(Object.assign({}, this.config), { unit: 'in' });
1491
+ this._blockEditor.init(this.config);
1492
+ this._blockEditor.blocks$
1493
+ .pipe(takeUntil(this._destroy$))
1494
+ .subscribe((blocks) => {
1495
+ this.blocks = blocks;
1496
+ });
1497
+ setTimeout(() => {
1498
+ this.zoomCenter();
1499
+ });
1500
+ }
1501
+ zoomCenter() {
1502
+ }
1503
+ editorContainerClick(event) {
1504
+ if (event.target.classList.contains('deselectable') ||
1505
+ event.target.classList.contains('fs-zoom-pan-container')) {
1506
+ this.zoompan.enable();
1507
+ this._blockEditor.selectedBlocks = [];
1508
+ }
1509
+ }
1510
+ ngOnDestroy() {
1511
+ this._destroy$.next();
1512
+ this._destroy$.complete();
1513
+ }
1514
+ }
1515
+ FsBlockEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsBlockEditorComponent, deps: [{ token: i0.ElementRef }, { token: BlockEditorService }], target: i0.ɵɵFactoryTarget.Component });
1516
+ FsBlockEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: FsBlockEditorComponent, selector: "fs-block-editor", inputs: { config: "config" }, providers: [
1517
+ BlockEditorService,
1518
+ BlocksStore,
1519
+ ], queries: [{ propertyName: "sidebarPanels", predicate: FsBlockEditorSidebarPanelDirective }], viewQueries: [{ propertyName: "zoompan", first: true, predicate: 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: ElementRef }], ngImport: i0, 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;border:1px solid #ececec}.editor-container .zoom-pan-container{flex:1}fs-zoom-pan{height:100%}\n"], dependencies: [{ kind: "component", type: i2$4.FsZoomPanComponent, selector: "fs-zoom-pan", inputs: ["zoomMax", "zoomMin", "zoomDefault", "top", "left"], outputs: ["moved", "zoomed"] }, { kind: "directive", type: i2$4.FsZoomPanContentDirective, selector: "[fsZoomPanContent]" }, { kind: "component", type: SidebarComponent, selector: "sidebar", inputs: ["config", "blocks", "zoompan"], outputs: ["zoomCenter"] }, { kind: "component", type: ArtboardComponent, selector: "app-artboard", inputs: ["config", "zoompan"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1520
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsBlockEditorComponent, decorators: [{
1521
+ type: Component,
1522
+ args: [{ selector: 'fs-block-editor', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
1523
+ BlockEditorService,
1524
+ BlocksStore,
1525
+ ], 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;border:1px solid #ececec}.editor-container .zoom-pan-container{flex:1}fs-zoom-pan{height:100%}\n"] }]
1526
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: BlockEditorService }]; }, propDecorators: { sidebarPanels: [{
1527
+ type: ContentChildren,
1528
+ args: [FsBlockEditorSidebarPanelDirective]
1529
+ }], zoompan: [{
1530
+ type: ViewChild,
1531
+ args: [FsZoomPanComponent, { static: true }]
1532
+ }], artboardContainer: [{
1533
+ type: ViewChild,
1534
+ args: ['artboardContainer', { static: true }]
1535
+ }], sidebar: [{
1536
+ type: ViewChild,
1537
+ args: [SidebarComponent, { static: true }]
1538
+ }], artboard: [{
1539
+ type: ViewChild,
1540
+ args: [ArtboardComponent, { read: ElementRef }]
1541
+ }], config: [{
1542
+ type: Input
1543
1543
  }] } });
1544
1544
 
1545
- class FsBlockEditorModule {
1546
- static forRoot() {
1547
- return {
1548
- ngModule: FsBlockEditorModule,
1549
- };
1550
- }
1551
- }
1552
- FsBlockEditorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsBlockEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1553
- FsBlockEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsBlockEditorModule, declarations: [FsBlockComponent,
1554
- FsBlockEditorComponent,
1555
- FsBlockEditorSidebarPanelDirective,
1556
- FsBlockEditorMarginDirective,
1557
- SidebarComponent,
1558
- ArtboardComponent,
1559
- LayersReorderDialogComponent,
1560
- CreateImageUrlPipe,
1561
- GroupDialogComponent], imports: [CommonModule,
1562
- FormsModule,
1563
- DragDropModule,
1564
- MatIconModule,
1565
- MatButtonModule,
1566
- MatInputModule,
1567
- MatFormFieldModule,
1568
- MatCheckboxModule,
1569
- MatTooltipModule,
1570
- MatSelectModule,
1571
- MatListModule,
1572
- FsFileModule,
1573
- FsColorPickerModule,
1574
- FsMenuModule,
1575
- FsZoomPanModule,
1576
- FsFormModule,
1577
- FsMaskModule,
1578
- FsFontPickerModule,
1579
- FsAutocompleteModule,
1580
- FsDialogModule], exports: [FsBlockComponent,
1581
- FsBlockEditorComponent,
1582
- FsBlockEditorSidebarPanelDirective] });
1583
- FsBlockEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsBlockEditorModule, imports: [[
1584
- CommonModule,
1585
- FormsModule,
1586
- DragDropModule,
1587
- MatIconModule,
1588
- MatButtonModule,
1589
- MatInputModule,
1590
- MatFormFieldModule,
1591
- MatCheckboxModule,
1592
- MatTooltipModule,
1593
- MatSelectModule,
1594
- MatListModule,
1595
- FsFileModule,
1596
- FsColorPickerModule,
1597
- FsMenuModule,
1598
- FsZoomPanModule,
1599
- FsFormModule,
1600
- FsMaskModule,
1601
- FsFontPickerModule,
1602
- FsAutocompleteModule,
1603
- FsDialogModule,
1604
- ]] });
1605
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsBlockEditorModule, decorators: [{
1606
- type: NgModule,
1607
- args: [{
1608
- imports: [
1609
- CommonModule,
1610
- FormsModule,
1611
- DragDropModule,
1612
- MatIconModule,
1613
- MatButtonModule,
1614
- MatInputModule,
1615
- MatFormFieldModule,
1616
- MatCheckboxModule,
1617
- MatTooltipModule,
1618
- MatSelectModule,
1619
- MatListModule,
1620
- FsFileModule,
1621
- FsColorPickerModule,
1622
- FsMenuModule,
1623
- FsZoomPanModule,
1624
- FsFormModule,
1625
- FsMaskModule,
1626
- FsFontPickerModule,
1627
- FsAutocompleteModule,
1628
- FsDialogModule,
1629
- ],
1630
- exports: [
1631
- FsBlockComponent,
1632
- FsBlockEditorComponent,
1633
- FsBlockEditorSidebarPanelDirective,
1634
- ],
1635
- declarations: [
1636
- FsBlockComponent,
1637
- FsBlockEditorComponent,
1638
- FsBlockEditorSidebarPanelDirective,
1639
- FsBlockEditorMarginDirective,
1640
- SidebarComponent,
1641
- ArtboardComponent,
1642
- LayersReorderDialogComponent,
1643
- CreateImageUrlPipe,
1644
- GroupDialogComponent,
1645
- ],
1646
- }]
1545
+ class FsBlockEditorModule {
1546
+ static forRoot() {
1547
+ return {
1548
+ ngModule: FsBlockEditorModule,
1549
+ };
1550
+ }
1551
+ }
1552
+ FsBlockEditorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsBlockEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1553
+ FsBlockEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: FsBlockEditorModule, declarations: [FsBlockComponent,
1554
+ FsBlockEditorComponent,
1555
+ FsBlockEditorSidebarPanelDirective,
1556
+ FsBlockEditorMarginDirective,
1557
+ SidebarComponent,
1558
+ ArtboardComponent,
1559
+ LayersReorderDialogComponent,
1560
+ CreateImageUrlPipe,
1561
+ GroupDialogComponent], imports: [CommonModule,
1562
+ FormsModule,
1563
+ DragDropModule,
1564
+ MatIconModule,
1565
+ MatButtonModule,
1566
+ MatInputModule,
1567
+ MatFormFieldModule,
1568
+ MatCheckboxModule,
1569
+ MatTooltipModule,
1570
+ MatSelectModule,
1571
+ MatListModule,
1572
+ FsFileModule,
1573
+ FsColorPickerModule,
1574
+ FsMenuModule,
1575
+ FsZoomPanModule,
1576
+ FsFormModule,
1577
+ FsMaskModule,
1578
+ FsFontPickerModule,
1579
+ FsAutocompleteModule,
1580
+ FsDialogModule], exports: [FsBlockComponent,
1581
+ FsBlockEditorComponent,
1582
+ FsBlockEditorSidebarPanelDirective] });
1583
+ FsBlockEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsBlockEditorModule, imports: [CommonModule,
1584
+ FormsModule,
1585
+ DragDropModule,
1586
+ MatIconModule,
1587
+ MatButtonModule,
1588
+ MatInputModule,
1589
+ MatFormFieldModule,
1590
+ MatCheckboxModule,
1591
+ MatTooltipModule,
1592
+ MatSelectModule,
1593
+ MatListModule,
1594
+ FsFileModule,
1595
+ FsColorPickerModule,
1596
+ FsMenuModule,
1597
+ FsZoomPanModule,
1598
+ FsFormModule,
1599
+ FsMaskModule,
1600
+ FsFontPickerModule,
1601
+ FsAutocompleteModule,
1602
+ FsDialogModule] });
1603
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsBlockEditorModule, decorators: [{
1604
+ type: NgModule,
1605
+ args: [{
1606
+ imports: [
1607
+ CommonModule,
1608
+ FormsModule,
1609
+ DragDropModule,
1610
+ MatIconModule,
1611
+ MatButtonModule,
1612
+ MatInputModule,
1613
+ MatFormFieldModule,
1614
+ MatCheckboxModule,
1615
+ MatTooltipModule,
1616
+ MatSelectModule,
1617
+ MatListModule,
1618
+ FsFileModule,
1619
+ FsColorPickerModule,
1620
+ FsMenuModule,
1621
+ FsZoomPanModule,
1622
+ FsFormModule,
1623
+ FsMaskModule,
1624
+ FsFontPickerModule,
1625
+ FsAutocompleteModule,
1626
+ FsDialogModule,
1627
+ ],
1628
+ exports: [
1629
+ FsBlockComponent,
1630
+ FsBlockEditorComponent,
1631
+ FsBlockEditorSidebarPanelDirective,
1632
+ ],
1633
+ declarations: [
1634
+ FsBlockComponent,
1635
+ FsBlockEditorComponent,
1636
+ FsBlockEditorSidebarPanelDirective,
1637
+ FsBlockEditorMarginDirective,
1638
+ SidebarComponent,
1639
+ ArtboardComponent,
1640
+ LayersReorderDialogComponent,
1641
+ CreateImageUrlPipe,
1642
+ GroupDialogComponent,
1643
+ ],
1644
+ }]
1647
1645
  }] });
1648
1646
 
1649
- /**
1650
- * Generated bundle index. Do not edit.
1647
+ /**
1648
+ * Generated bundle index. Do not edit.
1651
1649
  */
1652
1650
 
1653
1651
  export { BlockType, BlockTypes, FsBlockComponent, FsBlockEditorComponent, FsBlockEditorModule, FsBlockEditorSidebarPanelDirective };