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