@firestitch/block-editor 12.4.6 → 14.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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/esm2020/app/components/artboard/artboard.component.mjs +87 -0
  31. package/esm2020/app/components/block/block.component.mjs +547 -0
  32. package/{esm2015/app/components/block/index.js → esm2020/app/components/block/index.mjs} +1 -1
  33. package/esm2020/app/components/block-editor/block-editor.component.mjs +82 -0
  34. package/esm2020/app/components/group/group-dialog.component.mjs +47 -0
  35. package/{esm2015/app/components/group/index.js → esm2020/app/components/group/index.mjs} +1 -1
  36. package/{esm2015/app/components/index.js → esm2020/app/components/index.mjs} +1 -1
  37. package/{esm2015/app/components/layers-reorder-dialog/index.js → esm2020/app/components/layers-reorder-dialog/index.mjs} +1 -1
  38. package/esm2020/app/components/layers-reorder-dialog/layers-reorder-dialog.component.mjs +42 -0
  39. package/{esm2015/app/components/sidebar/index.js → esm2020/app/components/sidebar/index.mjs} +1 -1
  40. package/esm2020/app/components/sidebar/sidebar.component.mjs +353 -0
  41. package/{esm2015/app/consts/block-formats.const.js → esm2020/app/consts/block-formats.const.mjs} +7 -7
  42. package/{esm2015/app/consts/block-types.const.js → esm2020/app/consts/block-types.const.mjs} +12 -12
  43. package/{esm2015/app/consts/index.js → esm2020/app/consts/index.mjs} +2 -2
  44. package/{esm2015/app/directives/block-editor-margin.directive.js → esm2020/app/directives/block-editor-margin.directive.mjs} +19 -19
  45. package/{esm2015/app/directives/block-editor-sidebar-panel.directive.js → esm2020/app/directives/block-editor-sidebar-panel.directive.mjs} +21 -21
  46. package/{esm2015/app/directives/index.js → esm2020/app/directives/index.mjs} +2 -2
  47. package/{esm2015/app/enums/block-format.enum.js → esm2020/app/enums/block-format.enum.mjs} +7 -7
  48. package/{esm2015/app/enums/block-type.enum.js → esm2020/app/enums/block-type.enum.mjs} +12 -12
  49. package/{esm2015/app/enums/index.js → esm2020/app/enums/index.mjs} +2 -2
  50. package/{esm2015/app/fs-block-editor.module.js → esm2020/app/fs-block-editor.module.mjs} +133 -135
  51. package/{esm2015/app/interfaces/block-editor-config.js → esm2020/app/interfaces/block-editor-config.mjs} +1 -1
  52. package/{esm2015/app/interfaces/block-group.js → esm2020/app/interfaces/block-group.mjs} +1 -1
  53. package/{esm2015/app/interfaces/block.js → esm2020/app/interfaces/block.mjs} +1 -1
  54. package/{esm2015/app/interfaces/index.js → esm2020/app/interfaces/index.mjs} +3 -3
  55. package/{esm2015/app/pipes/create-image-url.pipe.js → esm2020/app/pipes/create-image-url.pipe.mjs} +19 -19
  56. package/esm2020/app/services/block-editor.service.mjs +287 -0
  57. package/{esm2015/app/services/blocks-store.service.js → esm2020/app/services/blocks-store.service.mjs} +111 -111
  58. package/{esm2015/app/services/index.js → esm2020/app/services/index.mjs} +1 -1
  59. package/{esm2015/firestitch-block-editor.js → esm2020/firestitch-block-editor.mjs} +4 -4
  60. package/{esm2015/public_api.js → esm2020/public_api.mjs} +6 -6
  61. package/fesm2015/firestitch-block-editor.mjs +1652 -0
  62. package/fesm2015/firestitch-block-editor.mjs.map +1 -0
  63. package/fesm2020/firestitch-block-editor.mjs +1685 -0
  64. package/fesm2020/firestitch-block-editor.mjs.map +1 -0
  65. package/{firestitch-block-editor.d.ts → index.d.ts} +5 -5
  66. package/package.json +21 -8
  67. package/public_api.d.ts +8 -8
  68. package/bundles/firestitch-block-editor.umd.js +0 -2263
  69. package/bundles/firestitch-block-editor.umd.js.map +0 -1
  70. package/esm2015/app/components/artboard/artboard.component.js +0 -89
  71. package/esm2015/app/components/block/block.component.js +0 -553
  72. package/esm2015/app/components/block-editor/block-editor.component.js +0 -86
  73. package/esm2015/app/components/group/group-dialog.component.js +0 -48
  74. package/esm2015/app/components/layers-reorder-dialog/layers-reorder-dialog.component.js +0 -46
  75. package/esm2015/app/components/sidebar/sidebar.component.js +0 -349
  76. package/esm2015/app/services/block-editor.service.js +0 -265
  77. package/fesm2015/firestitch-block-editor.js +0 -1678
  78. package/fesm2015/firestitch-block-editor.js.map +0 -1
@@ -1,2263 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('@angular/forms'), require('@angular/cdk/drag-drop'), require('@angular/material/button'), require('@angular/material/checkbox'), require('@angular/material/form-field'), require('@angular/material/icon'), require('@angular/material/input'), require('@angular/material/list'), require('@angular/material/select'), require('@angular/material/tooltip'), require('@firestitch/autocomplete'), require('@firestitch/colorpicker'), require('@firestitch/dialog'), require('@firestitch/file'), require('@firestitch/font-picker'), require('@firestitch/form'), require('@firestitch/mask'), require('@firestitch/menu'), require('@firestitch/zoom-pan'), require('@angular/material/dialog'), require('@firestitch/common'), require('rxjs'), require('@angular/cdk/text-field'), require('rxjs/operators'), require('moveable'), require('@angular/material/divider'), require('@firestitch/prompt'), require('@firestitch/api'), require('@firestitch/clipboard'), require('@firestitch/message'), require('@angular/material/core')) :
3
- typeof define === 'function' && define.amd ? define('@firestitch/block-editor', ['exports', '@angular/common', '@angular/core', '@angular/forms', '@angular/cdk/drag-drop', '@angular/material/button', '@angular/material/checkbox', '@angular/material/form-field', '@angular/material/icon', '@angular/material/input', '@angular/material/list', '@angular/material/select', '@angular/material/tooltip', '@firestitch/autocomplete', '@firestitch/colorpicker', '@firestitch/dialog', '@firestitch/file', '@firestitch/font-picker', '@firestitch/form', '@firestitch/mask', '@firestitch/menu', '@firestitch/zoom-pan', '@angular/material/dialog', '@firestitch/common', 'rxjs', '@angular/cdk/text-field', 'rxjs/operators', 'moveable', '@angular/material/divider', '@firestitch/prompt', '@firestitch/api', '@firestitch/clipboard', '@firestitch/message', '@angular/material/core'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.firestitch = global.firestitch || {}, global.firestitch["block-editor"] = {}), global.ng.common, global.ng.core, global.ng.forms, global.ng.cdk.dragDrop, global.ng.material.button, global.ng.material.checkbox, global.ng.material.formField, global.ng.material.icon, global.ng.material.input, global.ng.material.list, global.ng.material.select, global.ng.material.tooltip, global.autocomplete, global.i14, global.i2, global.i6$1, global.i2$1, global.i6, global.i20, global.menu, global.i2$3, global.ng.material.dialog, global.common, global.rxjs, global.ng.cdk.textField, global.rxjs.operators, global.Moveable, global.ng.material.divider, global.i3$1, global.i1$1, global.i2$2, global.i3$2, global.ng.material.core));
5
- })(this, (function (exports, i17, i0, i5, i7$1, i4, i12, i9, i3, i7, i4$1, i10, i18, autocomplete, i14, i2, i6$1, i2$1, i6, i20, menu, i2$3, i1, common, rxjs, i8, operators, Moveable, i5$1, i3$1, i1$1, i2$2, i3$2, i11) { 'use strict';
6
-
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
-
9
- function _interopNamespace(e) {
10
- if (e && e.__esModule) return e;
11
- var n = Object.create(null);
12
- if (e) {
13
- Object.keys(e).forEach(function (k) {
14
- if (k !== 'default') {
15
- var d = Object.getOwnPropertyDescriptor(e, k);
16
- Object.defineProperty(n, k, d.get ? d : {
17
- enumerable: true,
18
- get: function () { return e[k]; }
19
- });
20
- }
21
- });
22
- }
23
- n["default"] = e;
24
- return Object.freeze(n);
25
- }
26
-
27
- var i17__namespace = /*#__PURE__*/_interopNamespace(i17);
28
- var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
29
- var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
30
- var i7__namespace$1 = /*#__PURE__*/_interopNamespace(i7$1);
31
- var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
32
- var i12__namespace = /*#__PURE__*/_interopNamespace(i12);
33
- var i9__namespace = /*#__PURE__*/_interopNamespace(i9);
34
- var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
35
- var i7__namespace = /*#__PURE__*/_interopNamespace(i7);
36
- var i4__namespace$1 = /*#__PURE__*/_interopNamespace(i4$1);
37
- var i10__namespace = /*#__PURE__*/_interopNamespace(i10);
38
- var i18__namespace = /*#__PURE__*/_interopNamespace(i18);
39
- var i14__namespace = /*#__PURE__*/_interopNamespace(i14);
40
- var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
41
- var i6__namespace$1 = /*#__PURE__*/_interopNamespace(i6$1);
42
- var i2__namespace$1 = /*#__PURE__*/_interopNamespace(i2$1);
43
- var i6__namespace = /*#__PURE__*/_interopNamespace(i6);
44
- var i20__namespace = /*#__PURE__*/_interopNamespace(i20);
45
- var i2__namespace$3 = /*#__PURE__*/_interopNamespace(i2$3);
46
- var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
47
- var i8__namespace = /*#__PURE__*/_interopNamespace(i8);
48
- var Moveable__default = /*#__PURE__*/_interopDefaultLegacy(Moveable);
49
- var i5__namespace$1 = /*#__PURE__*/_interopNamespace(i5$1);
50
- var i3__namespace$1 = /*#__PURE__*/_interopNamespace(i3$1);
51
- var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
52
- var i2__namespace$2 = /*#__PURE__*/_interopNamespace(i2$2);
53
- var i3__namespace$2 = /*#__PURE__*/_interopNamespace(i3$2);
54
- var i11__namespace = /*#__PURE__*/_interopNamespace(i11);
55
-
56
- var GroupDialogComponent = /** @class */ (function () {
57
- function GroupDialogComponent(_data, _dialogRef) {
58
- var _this = this;
59
- this._data = _data;
60
- this._dialogRef = _dialogRef;
61
- this.save = function () {
62
- if (_this.blockGroup.name) {
63
- }
64
- else {
65
- _this.blockGroup = Object.assign(Object.assign({}, _this.blockGroup), { name: common.guid() });
66
- _this._blockEditor.blockGroups.push(_this.blockGroup);
67
- }
68
- _this._dialogRef.close(_this.blockGroup);
69
- return rxjs.of(true);
70
- };
71
- }
72
- GroupDialogComponent.prototype.ngOnInit = function () {
73
- this._blockEditor = this._data.blockEditor;
74
- this.blockGroup = this._data.blockGroup || {};
75
- this.block = this._data.block;
76
- };
77
- return GroupDialogComponent;
78
- }());
79
- GroupDialogComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: GroupDialogComponent, deps: [{ token: i1.MAT_DIALOG_DATA }, { token: i1__namespace.MatDialogRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
80
- GroupDialogComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: GroupDialogComponent, selector: "ng-component", ngImport: i0__namespace, template: "<form fsForm [submit]=\"save\">\n <fs-dialog>\n <h1 mat-dialog-title>Group</h1>\n <mat-dialog-content>\n <mat-form-field class=\"full-width\">\n <textarea\n matInput\n [cdkTextareaAutosize]=\"true\"\n [(ngModel)]=\"blockGroup.label\"\n name=\"groupLabel\"\n [required]=\"true\"\n placeholder=\"Group Label\">\n </textarea>\n </mat-form-field>\n <mat-form-field class=\"full-width\">\n <mat-label>Group Description</mat-label>\n <textarea\n matInput\n [cdkTextareaAutosize]=\"true\"\n [(ngModel)]=\"blockGroup.description\"\n name=\"groupDescription\">\n </textarea>\n </mat-form-field> \n </mat-dialog-content>\n <mat-dialog-actions>\n <button \n mat-button \n type=\"submit\"\n color=\"primary\">\n Save\n </button>\n <button \n mat-button \n type=\"button\"\n mat-dialog-close>\n Cancel\n </button>\n </mat-dialog-actions>\n </fs-dialog>\n</form>", styles: [""], components: [{ type: i2__namespace.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: i9__namespace.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i4__namespace.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i5__namespace.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i5__namespace.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i5__namespace.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i6__namespace.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"] }, { type: i1__namespace.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1__namespace.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i7__namespace.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i8__namespace.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { type: i5__namespace.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i5__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5__namespace.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i6__namespace.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }, { type: i5__namespace.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i9__namespace.MatLabel, selector: "mat-label" }, { type: i6__namespace.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { type: i1__namespace.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i6__namespace.FsButtonDirective, selector: "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", inputs: ["name", "dirtySubmit", "form"] }, { type: i1__namespace.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
81
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: GroupDialogComponent, decorators: [{
82
- type: i0.Component,
83
- args: [{
84
- templateUrl: './group-dialog.component.html',
85
- styleUrls: ['./group-dialog.component.scss'],
86
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
87
- }]
88
- }], ctorParameters: function () {
89
- return [{ type: undefined, decorators: [{
90
- type: i0.Inject,
91
- args: [i1.MAT_DIALOG_DATA]
92
- }] }, { type: i1__namespace.MatDialogRef }];
93
- } });
94
-
95
- var FsBlockEditorMarginDirective = /** @class */ (function () {
96
- function FsBlockEditorMarginDirective(_elementRef) {
97
- this._elementRef = _elementRef;
98
- }
99
- Object.defineProperty(FsBlockEditorMarginDirective.prototype, "element", {
100
- get: function () {
101
- return this._elementRef.nativeElement;
102
- },
103
- enumerable: false,
104
- configurable: true
105
- });
106
- return FsBlockEditorMarginDirective;
107
- }());
108
- FsBlockEditorMarginDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockEditorMarginDirective, deps: [{ token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
109
- FsBlockEditorMarginDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FsBlockEditorMarginDirective, selector: "[fsBlockEditorMargin]", ngImport: i0__namespace });
110
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockEditorMarginDirective, decorators: [{
111
- type: i0.Directive,
112
- args: [{
113
- selector: '[fsBlockEditorMargin]'
114
- }]
115
- }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }]; } });
116
-
117
- var FsBlockEditorSidebarPanelDirective = /** @class */ (function () {
118
- function FsBlockEditorSidebarPanelDirective(templateRef) {
119
- this.templateRef = templateRef;
120
- this.show = true;
121
- }
122
- return FsBlockEditorSidebarPanelDirective;
123
- }());
124
- FsBlockEditorSidebarPanelDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockEditorSidebarPanelDirective, deps: [{ token: i0__namespace.TemplateRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
125
- FsBlockEditorSidebarPanelDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FsBlockEditorSidebarPanelDirective, selector: "[fsBlockEditorSidebarPanel]", inputs: { label: "label", show: "show" }, ngImport: i0__namespace });
126
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockEditorSidebarPanelDirective, decorators: [{
127
- type: i0.Directive,
128
- args: [{
129
- selector: '[fsBlockEditorSidebarPanel]',
130
- }]
131
- }], ctorParameters: function () { return [{ type: i0__namespace.TemplateRef }]; }, propDecorators: { label: [{
132
- type: i0.Input
133
- }], show: [{
134
- type: i0.Input
135
- }] } });
136
-
137
- exports.BlockType = void 0;
138
- (function (BlockType) {
139
- BlockType["Rectangle"] = "rectangle";
140
- BlockType["ShortText"] = "shorttext";
141
- BlockType["LongText"] = "longtext";
142
- BlockType["Image"] = "image";
143
- BlockType["RadioButton"] = "radiobutton";
144
- BlockType["Checkbox"] = "checkbox";
145
- BlockType["Signature"] = "signature";
146
- BlockType["Pdf"] = "pdf";
147
- BlockType["Date"] = "date";
148
- })(exports.BlockType || (exports.BlockType = {}));
149
-
150
- var BlockFormat;
151
- (function (BlockFormat) {
152
- BlockFormat["Date"] = "date";
153
- BlockFormat["YYYYMMDD"] = "YYYY/MM/DD";
154
- BlockFormat["Currency"] = "currency";
155
- BlockFormat["Number"] = "number";
156
- })(BlockFormat || (BlockFormat = {}));
157
-
158
- var BlockTypes = [
159
- { value: exports.BlockType.Rectangle, name: 'Rectangle', icon: 'crop_5_4', type: 'draw' },
160
- { value: exports.BlockType.ShortText, name: 'Short Text', icon: 'short_text', type: 'form' },
161
- { value: exports.BlockType.LongText, name: 'Long Text', icon: 'subject', type: 'form' },
162
- { value: exports.BlockType.RadioButton, name: 'Radio Button', icon: 'radio_button_checked', type: 'form' },
163
- { value: exports.BlockType.Checkbox, name: 'Checkbox', icon: 'check_box', type: 'form' },
164
- { value: exports.BlockType.Date, name: 'Date', icon: 'calendar_today', type: 'form' },
165
- { value: exports.BlockType.Signature, name: 'Signature', icon: 'draw', type: 'form' },
166
- { value: exports.BlockType.Image, name: 'Image', icon: 'image', accept: 'image/*', type: 'draw' },
167
- { value: exports.BlockType.Pdf, name: 'Pdf', icon: 'picture_as_pdf', accept: 'application/pdf', type: 'draw' },
168
- ];
169
-
170
- var BlockFormats = [
171
- { value: BlockFormat.Number, name: 'Number', blockTypes: [exports.BlockType.ShortText, exports.BlockType.LongText] },
172
- { value: BlockFormat.Currency, name: 'Currency', blockTypes: [exports.BlockType.ShortText, exports.BlockType.LongText] },
173
- { value: BlockFormat.Date, name: 'Date', blockTypes: [exports.BlockType.Date] },
174
- { value: BlockFormat.YYYYMMDD, name: 'YYYY/MM/DD', blockTypes: [exports.BlockType.Date] },
175
- ];
176
-
177
- var LayersReorderDialogComponent = /** @class */ (function () {
178
- function LayersReorderDialogComponent(_dialogData, _dialogRef) {
179
- this._dialogData = _dialogData;
180
- this._dialogRef = _dialogRef;
181
- this.blockTypeIcons = common.index(BlockTypes, 'value', 'icon');
182
- this._init(_dialogData);
183
- }
184
- LayersReorderDialogComponent.prototype.swapItems = function (event) {
185
- i7$1.moveItemInArray(this.blocks, event.previousIndex, event.currentIndex);
186
- };
187
- LayersReorderDialogComponent.prototype.done = function () {
188
- this._dialogRef.close(this.blocks.reverse());
189
- };
190
- LayersReorderDialogComponent.prototype._init = function (data) {
191
- this.blocks = data.blocks;
192
- };
193
- return LayersReorderDialogComponent;
194
- }());
195
- LayersReorderDialogComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: LayersReorderDialogComponent, deps: [{ token: i1.MAT_DIALOG_DATA }, { token: i1__namespace.MatDialogRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
196
- LayersReorderDialogComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: LayersReorderDialogComponent, selector: "ng-component", ngImport: i0__namespace, template: "<fs-dialog>\n <h1 mat-dialog-title><mat-icon>swap_vert</mat-icon> Reorder Blocks</h1>\n <mat-dialog-content>\n <mat-list cdkDropList (cdkDropListDropped)=\"swapItems($event)\">\n <mat-divider></mat-divider>\n <ng-container *ngFor=\"let block of blocks\">\n <mat-list-item cdkDrag cdkDragLockAxis=\"y\">\n <mat-icon cdkDragHandle>drag_handle</mat-icon>\n <mat-icon>\n {{ blockTypeIcons[block.type] }}\n </mat-icon>\n <span class=\"block-label\">\n {{ block.label || block.content || 'No Content'}} \n </span>\n </mat-list-item>\n <mat-divider></mat-divider>\n </ng-container>\n </mat-list>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-button color=\"primary\" (click)=\"done()\">Done</button>\n </mat-dialog-actions>\n</fs-dialog>\n", styles: ["h1{display:flex}.mat-icon{margin-right:20px}.block-label{min-width:200px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:1000px}.cdk-drag-preview{display:flex;padding-left:15px!important;background:#fff;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-preview ::ng-deep .mat-list-item-content{display:flex;flex-direction:row;align-items:center;font-size:16px}.cdk-drag-handle{cursor:grab}.cdk-drag-placeholder{opacity:.2}\n"], components: [{ type: i2__namespace.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: i3__namespace.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i4__namespace$1.MatList, selector: "mat-list, mat-action-list", inputs: ["disableRipple", "disabled"], exportAs: ["matList"] }, { type: i5__namespace$1.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { type: i4__namespace$1.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["disableRipple", "disabled"], exportAs: ["matListItem"] }, { type: i4__namespace.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i1__namespace.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1__namespace.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i7__namespace$1.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "id", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListAutoScrollDisabled", "cdkDropListOrientation", "cdkDropListLockAxis", "cdkDropListData", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { type: i17__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7__namespace$1.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragDisabled", "cdkDragStartDelay", "cdkDragLockAxis", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragBoundary", "cdkDragRootElement", "cdkDragPreviewContainer", "cdkDragData", "cdkDragFreeDragPosition"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { type: i7__namespace$1.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { type: i1__namespace.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i6__namespace.FsButtonDirective, selector: "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", inputs: ["name", "dirtySubmit", "form"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
197
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: LayersReorderDialogComponent, decorators: [{
198
- type: i0.Component,
199
- args: [{
200
- templateUrl: './layers-reorder-dialog.component.html',
201
- styleUrls: ['./layers-reorder-dialog.component.scss'],
202
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
203
- }]
204
- }], ctorParameters: function () {
205
- return [{ type: undefined, decorators: [{
206
- type: i0.Inject,
207
- args: [i1.MAT_DIALOG_DATA]
208
- }] }, { type: i1__namespace.MatDialogRef }];
209
- } });
210
-
211
- /*! *****************************************************************************
212
- Copyright (c) Microsoft Corporation.
213
-
214
- Permission to use, copy, modify, and/or distribute this software for any
215
- purpose with or without fee is hereby granted.
216
-
217
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
218
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
219
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
220
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
221
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
222
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
223
- PERFORMANCE OF THIS SOFTWARE.
224
- ***************************************************************************** */
225
- /* global Reflect, Promise */
226
- var extendStatics = function (d, b) {
227
- extendStatics = Object.setPrototypeOf ||
228
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
229
- function (d, b) { for (var p in b)
230
- if (Object.prototype.hasOwnProperty.call(b, p))
231
- d[p] = b[p]; };
232
- return extendStatics(d, b);
233
- };
234
- function __extends(d, b) {
235
- if (typeof b !== "function" && b !== null)
236
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
237
- extendStatics(d, b);
238
- function __() { this.constructor = d; }
239
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
240
- }
241
- var __assign = function () {
242
- __assign = Object.assign || function __assign(t) {
243
- for (var s, i = 1, n = arguments.length; i < n; i++) {
244
- s = arguments[i];
245
- for (var p in s)
246
- if (Object.prototype.hasOwnProperty.call(s, p))
247
- t[p] = s[p];
248
- }
249
- return t;
250
- };
251
- return __assign.apply(this, arguments);
252
- };
253
- function __rest(s, e) {
254
- var t = {};
255
- for (var p in s)
256
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
257
- t[p] = s[p];
258
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
259
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
260
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
261
- t[p[i]] = s[p[i]];
262
- }
263
- return t;
264
- }
265
- function __decorate(decorators, target, key, desc) {
266
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
267
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
268
- r = Reflect.decorate(decorators, target, key, desc);
269
- else
270
- for (var i = decorators.length - 1; i >= 0; i--)
271
- if (d = decorators[i])
272
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
273
- return c > 3 && r && Object.defineProperty(target, key, r), r;
274
- }
275
- function __param(paramIndex, decorator) {
276
- return function (target, key) { decorator(target, key, paramIndex); };
277
- }
278
- function __metadata(metadataKey, metadataValue) {
279
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
280
- return Reflect.metadata(metadataKey, metadataValue);
281
- }
282
- function __awaiter(thisArg, _arguments, P, generator) {
283
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
284
- return new (P || (P = Promise))(function (resolve, reject) {
285
- function fulfilled(value) { try {
286
- step(generator.next(value));
287
- }
288
- catch (e) {
289
- reject(e);
290
- } }
291
- function rejected(value) { try {
292
- step(generator["throw"](value));
293
- }
294
- catch (e) {
295
- reject(e);
296
- } }
297
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
298
- step((generator = generator.apply(thisArg, _arguments || [])).next());
299
- });
300
- }
301
- function __generator(thisArg, body) {
302
- var _ = { label: 0, sent: function () { if (t[0] & 1)
303
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
304
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
305
- function verb(n) { return function (v) { return step([n, v]); }; }
306
- function step(op) {
307
- if (f)
308
- throw new TypeError("Generator is already executing.");
309
- while (_)
310
- try {
311
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
312
- return t;
313
- if (y = 0, t)
314
- op = [op[0] & 2, t.value];
315
- switch (op[0]) {
316
- case 0:
317
- case 1:
318
- t = op;
319
- break;
320
- case 4:
321
- _.label++;
322
- return { value: op[1], done: false };
323
- case 5:
324
- _.label++;
325
- y = op[1];
326
- op = [0];
327
- continue;
328
- case 7:
329
- op = _.ops.pop();
330
- _.trys.pop();
331
- continue;
332
- default:
333
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
334
- _ = 0;
335
- continue;
336
- }
337
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
338
- _.label = op[1];
339
- break;
340
- }
341
- if (op[0] === 6 && _.label < t[1]) {
342
- _.label = t[1];
343
- t = op;
344
- break;
345
- }
346
- if (t && _.label < t[2]) {
347
- _.label = t[2];
348
- _.ops.push(op);
349
- break;
350
- }
351
- if (t[2])
352
- _.ops.pop();
353
- _.trys.pop();
354
- continue;
355
- }
356
- op = body.call(thisArg, _);
357
- }
358
- catch (e) {
359
- op = [6, e];
360
- y = 0;
361
- }
362
- finally {
363
- f = t = 0;
364
- }
365
- if (op[0] & 5)
366
- throw op[1];
367
- return { value: op[0] ? op[1] : void 0, done: true };
368
- }
369
- }
370
- var __createBinding = Object.create ? (function (o, m, k, k2) {
371
- if (k2 === undefined)
372
- k2 = k;
373
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
374
- }) : (function (o, m, k, k2) {
375
- if (k2 === undefined)
376
- k2 = k;
377
- o[k2] = m[k];
378
- });
379
- function __exportStar(m, o) {
380
- for (var p in m)
381
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
382
- __createBinding(o, m, p);
383
- }
384
- function __values(o) {
385
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
386
- if (m)
387
- return m.call(o);
388
- if (o && typeof o.length === "number")
389
- return {
390
- next: function () {
391
- if (o && i >= o.length)
392
- o = void 0;
393
- return { value: o && o[i++], done: !o };
394
- }
395
- };
396
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
397
- }
398
- function __read(o, n) {
399
- var m = typeof Symbol === "function" && o[Symbol.iterator];
400
- if (!m)
401
- return o;
402
- var i = m.call(o), r, ar = [], e;
403
- try {
404
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
405
- ar.push(r.value);
406
- }
407
- catch (error) {
408
- e = { error: error };
409
- }
410
- finally {
411
- try {
412
- if (r && !r.done && (m = i["return"]))
413
- m.call(i);
414
- }
415
- finally {
416
- if (e)
417
- throw e.error;
418
- }
419
- }
420
- return ar;
421
- }
422
- /** @deprecated */
423
- function __spread() {
424
- for (var ar = [], i = 0; i < arguments.length; i++)
425
- ar = ar.concat(__read(arguments[i]));
426
- return ar;
427
- }
428
- /** @deprecated */
429
- function __spreadArrays() {
430
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
431
- s += arguments[i].length;
432
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
433
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
434
- r[k] = a[j];
435
- return r;
436
- }
437
- function __spreadArray(to, from, pack) {
438
- if (pack || arguments.length === 2)
439
- for (var i = 0, l = from.length, ar; i < l; i++) {
440
- if (ar || !(i in from)) {
441
- if (!ar)
442
- ar = Array.prototype.slice.call(from, 0, i);
443
- ar[i] = from[i];
444
- }
445
- }
446
- return to.concat(ar || Array.prototype.slice.call(from));
447
- }
448
- function __await(v) {
449
- return this instanceof __await ? (this.v = v, this) : new __await(v);
450
- }
451
- function __asyncGenerator(thisArg, _arguments, generator) {
452
- if (!Symbol.asyncIterator)
453
- throw new TypeError("Symbol.asyncIterator is not defined.");
454
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
455
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
456
- function verb(n) { if (g[n])
457
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
458
- function resume(n, v) { try {
459
- step(g[n](v));
460
- }
461
- catch (e) {
462
- settle(q[0][3], e);
463
- } }
464
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
465
- function fulfill(value) { resume("next", value); }
466
- function reject(value) { resume("throw", value); }
467
- function settle(f, v) { if (f(v), q.shift(), q.length)
468
- resume(q[0][0], q[0][1]); }
469
- }
470
- function __asyncDelegator(o) {
471
- var i, p;
472
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
473
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
474
- }
475
- function __asyncValues(o) {
476
- if (!Symbol.asyncIterator)
477
- throw new TypeError("Symbol.asyncIterator is not defined.");
478
- var m = o[Symbol.asyncIterator], i;
479
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
480
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
481
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
482
- }
483
- function __makeTemplateObject(cooked, raw) {
484
- if (Object.defineProperty) {
485
- Object.defineProperty(cooked, "raw", { value: raw });
486
- }
487
- else {
488
- cooked.raw = raw;
489
- }
490
- return cooked;
491
- }
492
- ;
493
- var __setModuleDefault = Object.create ? (function (o, v) {
494
- Object.defineProperty(o, "default", { enumerable: true, value: v });
495
- }) : function (o, v) {
496
- o["default"] = v;
497
- };
498
- function __importStar(mod) {
499
- if (mod && mod.__esModule)
500
- return mod;
501
- var result = {};
502
- if (mod != null)
503
- for (var k in mod)
504
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
505
- __createBinding(result, mod, k);
506
- __setModuleDefault(result, mod);
507
- return result;
508
- }
509
- function __importDefault(mod) {
510
- return (mod && mod.__esModule) ? mod : { default: mod };
511
- }
512
- function __classPrivateFieldGet(receiver, state, kind, f) {
513
- if (kind === "a" && !f)
514
- throw new TypeError("Private accessor was defined without a getter");
515
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
516
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
517
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
518
- }
519
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
520
- if (kind === "m")
521
- throw new TypeError("Private method is not writable");
522
- if (kind === "a" && !f)
523
- throw new TypeError("Private accessor was defined without a setter");
524
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
525
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
526
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
527
- }
528
-
529
- var EventType;
530
- (function (EventType) {
531
- EventType["Add"] = "add";
532
- EventType["Change"] = "change";
533
- EventType["Remove"] = "remove";
534
- EventType["Update"] = "update";
535
- })(EventType || (EventType = {}));
536
- var BlocksStore = /** @class */ (function () {
537
- function BlocksStore() {
538
- this._eventBus$ = new rxjs.Subject();
539
- this._blocks$ = new rxjs.BehaviorSubject([]);
540
- this._destroy$ = new rxjs.Subject();
541
- }
542
- Object.defineProperty(BlocksStore.prototype, "blocks", {
543
- get: function () {
544
- return __spreadArray([], __read(this._blocks$.getValue()));
545
- },
546
- enumerable: false,
547
- configurable: true
548
- });
549
- Object.defineProperty(BlocksStore.prototype, "blocks$", {
550
- get: function () {
551
- return this._blocks$.asObservable();
552
- },
553
- enumerable: false,
554
- configurable: true
555
- });
556
- Object.defineProperty(BlocksStore.prototype, "blockAdded$", {
557
- get: function () {
558
- return this._eventBus$
559
- .pipe(operators.filter(function (_a) {
560
- var type = _a.type;
561
- return type === EventType.Add;
562
- }), operators.map(function (_a) {
563
- var value = _a.value;
564
- return value;
565
- }));
566
- },
567
- enumerable: false,
568
- configurable: true
569
- });
570
- Object.defineProperty(BlocksStore.prototype, "blockChanged$", {
571
- get: function () {
572
- return this._eventBus$
573
- .pipe(operators.filter(function (_a) {
574
- var type = _a.type;
575
- return type === EventType.Change;
576
- }), operators.map(function (_a) {
577
- var value = _a.value;
578
- return value;
579
- }));
580
- },
581
- enumerable: false,
582
- configurable: true
583
- });
584
- Object.defineProperty(BlocksStore.prototype, "blockUpdated$", {
585
- get: function () {
586
- return this._eventBus$
587
- .pipe(operators.filter(function (_a) {
588
- var type = _a.type;
589
- return type === EventType.Update;
590
- }), operators.map(function (_a) {
591
- var value = _a.value;
592
- return value;
593
- }));
594
- },
595
- enumerable: false,
596
- configurable: true
597
- });
598
- Object.defineProperty(BlocksStore.prototype, "blockRemoved$", {
599
- get: function () {
600
- return this._eventBus$
601
- .pipe(operators.filter(function (_a) {
602
- var type = _a.type;
603
- return type === EventType.Remove;
604
- }), operators.map(function (_a) {
605
- var value = _a.value;
606
- return value;
607
- }));
608
- },
609
- enumerable: false,
610
- configurable: true
611
- });
612
- BlocksStore.prototype.ngOnDestroy = function () {
613
- this._destroy$.next();
614
- this._destroy$.complete();
615
- };
616
- BlocksStore.prototype.init = function (blocks) {
617
- var _this = this;
618
- blocks
619
- .forEach(function (block) {
620
- _this._appendBlock(block);
621
- });
622
- };
623
- BlocksStore.prototype.blockExists = function (block) {
624
- var index = this.blocks.findIndex(function (b) {
625
- return b.guid === block.guid;
626
- });
627
- return index !== -1;
628
- };
629
- BlocksStore.prototype.blockAdd = function (block) {
630
- this._appendBlock(block);
631
- };
632
- BlocksStore.prototype.blockChange = function (block) {
633
- this._dispatchEvent(EventType.Change, block);
634
- };
635
- BlocksStore.prototype.blockUpdate = function (block) {
636
- this._dispatchEvent(EventType.Update, block);
637
- };
638
- BlocksStore.prototype.blockRemove = function (targetBlocks) {
639
- var _this = this;
640
- var blocks = this.blocks;
641
- if (!Array.isArray(targetBlocks)) {
642
- targetBlocks = [targetBlocks];
643
- }
644
- targetBlocks.forEach(function (block) {
645
- var index = blocks
646
- .findIndex(function (b) { return b.guid === block.guid; });
647
- if (index !== -1) {
648
- blocks.splice(index, 1);
649
- _this._dispatchEvent(EventType.Remove, block);
650
- }
651
- });
652
- this._setBlocks(blocks);
653
- };
654
- BlocksStore.prototype._setBlocks = function (blocks) {
655
- this._blocks$.next(__spreadArray([], __read(blocks)));
656
- };
657
- BlocksStore.prototype._appendBlock = function (block) {
658
- var blocks = __spreadArray(__spreadArray([], __read(this.blocks)), [
659
- block,
660
- ]);
661
- this._deduplicateIndexesFor(blocks);
662
- this._setBlocks(blocks);
663
- this._dispatchEvent(EventType.Add, block);
664
- };
665
- BlocksStore.prototype._dispatchEvent = function (type, value) {
666
- this._eventBus$.next({
667
- type: type,
668
- value: value,
669
- });
670
- };
671
- BlocksStore.prototype._deduplicateIndexesFor = function (blocks) {
672
- blocks.forEach(function (block, index) {
673
- block.index = index;
674
- });
675
- };
676
- return BlocksStore;
677
- }());
678
- BlocksStore.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BlocksStore, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
679
- BlocksStore.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BlocksStore });
680
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BlocksStore, decorators: [{
681
- type: i0.Injectable
682
- }] });
683
-
684
- var BlockEditorService = /** @class */ (function () {
685
- function BlockEditorService(_store, _dialog, _prompt) {
686
- this._store = _store;
687
- this._dialog = _dialog;
688
- this._prompt = _prompt;
689
- this.blockGroups = [];
690
- this._selectedBlocks$ = new rxjs.BehaviorSubject([]);
691
- this._blockComponents$ = new rxjs.BehaviorSubject([]);
692
- this._blockClippable$ = new rxjs.BehaviorSubject(null);
693
- this._destroy$ = new rxjs.Subject();
694
- }
695
- Object.defineProperty(BlockEditorService.prototype, "blockComponents$", {
696
- get: function () {
697
- return this._blockComponents$.asObservable();
698
- },
699
- enumerable: false,
700
- configurable: true
701
- });
702
- Object.defineProperty(BlockEditorService.prototype, "blockComponents", {
703
- set: function (blockComponents) {
704
- this._blockComponents$.next(blockComponents);
705
- },
706
- enumerable: false,
707
- configurable: true
708
- });
709
- BlockEditorService.prototype.init = function (config) {
710
- this.config = config;
711
- this._store.init(config.blocks);
712
- this._initBlockGroups();
713
- this._initBlockChange();
714
- };
715
- BlockEditorService.prototype.blockAdd = function (block) {
716
- var _this = this;
717
- if (!this.config.blockAdd) {
718
- console.warn('[BlockEditor] Config "blockAdd" is not defined');
719
- return;
720
- }
721
- block = this._initBlock(block);
722
- this.config.blockAdd(block)
723
- .pipe(operators.takeUntil(this._destroy$))
724
- .subscribe(function (newBlock) {
725
- _this._store.blockAdd(newBlock);
726
- });
727
- };
728
- BlockEditorService.prototype.blockUpload = function (block, fsFile) {
729
- var _this = this;
730
- if (!this.config.blockUpload) {
731
- return rxjs.throwError('[BlockEditor] Config "blockUpload" is not defined');
732
- }
733
- var existing = this._store.blockExists(block);
734
- if (!existing) {
735
- block = this._initBlock(block);
736
- }
737
- return rxjs.from(fsFile.imageInfo)
738
- .pipe(operators.switchMap(function (imageInfo) {
739
- if (!existing && (imageInfo === null || imageInfo === void 0 ? void 0 : imageInfo.height) && (imageInfo === null || imageInfo === void 0 ? void 0 : imageInfo.width)) {
740
- var ratio = imageInfo.height / imageInfo.width;
741
- block.width = _this.config.width * .4;
742
- block.height = block.width * ratio;
743
- }
744
- return _this.config.blockUpload(block, fsFile.file);
745
- }), operators.tap(function (newBlock) {
746
- if (existing) {
747
- _this._store.blockUpdate(Object.assign(Object.assign({}, block), newBlock));
748
- }
749
- else {
750
- _this.blockAdd(newBlock);
751
- }
752
- }), operators.takeUntil(this._destroy$));
753
- };
754
- BlockEditorService.prototype.blockRemove = function (block) {
755
- this._store.blockRemove(block);
756
- };
757
- Object.defineProperty(BlockEditorService.prototype, "blocks$", {
758
- get: function () {
759
- return this._store.blocks$;
760
- },
761
- enumerable: false,
762
- configurable: true
763
- });
764
- Object.defineProperty(BlockEditorService.prototype, "blockChanged$", {
765
- get: function () {
766
- return this._store.blockChanged$;
767
- },
768
- enumerable: false,
769
- configurable: true
770
- });
771
- Object.defineProperty(BlockEditorService.prototype, "blockUpdated$", {
772
- get: function () {
773
- return this._store.blockUpdated$;
774
- },
775
- enumerable: false,
776
- configurable: true
777
- });
778
- Object.defineProperty(BlockEditorService.prototype, "blockClippable$", {
779
- get: function () {
780
- return this._blockClippable$.asObservable();
781
- },
782
- enumerable: false,
783
- configurable: true
784
- });
785
- Object.defineProperty(BlockEditorService.prototype, "blockClippable", {
786
- set: function (value) {
787
- this._blockClippable$.next(value);
788
- },
789
- enumerable: false,
790
- configurable: true
791
- });
792
- Object.defineProperty(BlockEditorService.prototype, "blockAdded$", {
793
- get: function () {
794
- return this._store.blockAdded$;
795
- },
796
- enumerable: false,
797
- configurable: true
798
- });
799
- Object.defineProperty(BlockEditorService.prototype, "blockRemoved$", {
800
- get: function () {
801
- return this._store.blockRemoved$;
802
- },
803
- enumerable: false,
804
- configurable: true
805
- });
806
- Object.defineProperty(BlockEditorService.prototype, "blocks", {
807
- get: function () {
808
- return this._store.blocks;
809
- },
810
- enumerable: false,
811
- configurable: true
812
- });
813
- BlockEditorService.prototype.blockChange = function (block) {
814
- this._store.blockChange(block);
815
- };
816
- BlockEditorService.prototype.applyBlockGroup = function (block, blockGroup) {
817
- block.name = blockGroup === null || blockGroup === void 0 ? void 0 : blockGroup.name;
818
- block.description = blockGroup === null || blockGroup === void 0 ? void 0 : blockGroup.description;
819
- block.label = blockGroup === null || blockGroup === void 0 ? void 0 : blockGroup.label;
820
- this.blockChange(block);
821
- };
822
- BlockEditorService.prototype.isSelectedBlock = function (block) {
823
- return this.selectedBlocks.indexOf(block) !== -1;
824
- };
825
- BlockEditorService.prototype.indexOf = function (block) {
826
- return this.blocks.map(function (e) { return e.guid; }).indexOf(block.guid);
827
- };
828
- BlockEditorService.prototype.selectedBlockComponentChangeProperty = function (values) {
829
- var _this = this;
830
- this.selectedBlocks
831
- .forEach(function (block) {
832
- Object.keys(values)
833
- .forEach(function (name) {
834
- block[name] = values[name];
835
- });
836
- _this.blockChange(block);
837
- });
838
- };
839
- BlockEditorService.prototype.blockGroupChangeProperty = function (blockGroup, values) {
840
- var _this = this;
841
- this.blocks
842
- .filter(function (block) { return block.name === blockGroup.name; })
843
- .forEach(function (block) {
844
- Object.keys(values)
845
- .forEach(function (name) {
846
- block[name] = values[name];
847
- });
848
- _this.blockChange(block);
849
- });
850
- };
851
- Object.defineProperty(BlockEditorService.prototype, "selectedBlocks$", {
852
- get: function () {
853
- return this._selectedBlocks$;
854
- },
855
- enumerable: false,
856
- configurable: true
857
- });
858
- Object.defineProperty(BlockEditorService.prototype, "selectedBlock", {
859
- set: function (block) {
860
- this.selectedBlocks = [block];
861
- },
862
- enumerable: false,
863
- configurable: true
864
- });
865
- Object.defineProperty(BlockEditorService.prototype, "selectedBlocks", {
866
- get: function () {
867
- return this._selectedBlocks$.getValue();
868
- },
869
- set: function (blocks) {
870
- this._selectedBlocks$.next(blocks);
871
- if (this.config.blocksSelect) {
872
- this.config.blocksSelect(blocks);
873
- }
874
- },
875
- enumerable: false,
876
- configurable: true
877
- });
878
- BlockEditorService.prototype.saveSelection = function () {
879
- var selection = window.getSelection();
880
- this._selectionRange = selection.getRangeAt(0);
881
- };
882
- BlockEditorService.prototype.restoreSelection = function () {
883
- if (this._selectionRange) {
884
- var selection = window.getSelection();
885
- selection.removeAllRanges();
886
- selection.addRange(this._selectionRange);
887
- }
888
- };
889
- BlockEditorService.prototype.hasSelectionRange = function () {
890
- return this._selectionRange && (this._selectionRange.baseOffset - this._selectionRange.focusOffset) > 0;
891
- };
892
- BlockEditorService.prototype.registerContainer = function (container) {
893
- this.container = container;
894
- };
895
- BlockEditorService.prototype.registerMargin = function (margin) {
896
- this.margin = margin;
897
- };
898
- BlockEditorService.prototype.removeBlocks = function (blocks) {
899
- var _this = this;
900
- this._prompt.confirm({
901
- title: 'Confirm',
902
- template: 'Are you sure your would like to delete this block?',
903
- })
904
- .pipe(operators.switchMap(function () { return _this.config.blocksRemove ? _this.config.blocksRemove(blocks) : rxjs.throwError('config.blocksRemove is not configured'); }), operators.takeUntil(this._destroy$))
905
- .subscribe(function () {
906
- blocks.forEach(function (block) {
907
- _this.blockRemove(block);
908
- });
909
- _this.selectedBlocks = [];
910
- });
911
- };
912
- BlockEditorService.prototype.openReorderDialog = function () {
913
- var _this = this;
914
- var blocks = this.blocks
915
- .sort(function (blockA, blockB) { return (blockA.index - blockB.index); })
916
- .reverse();
917
- this._dialog
918
- .open(LayersReorderDialogComponent, {
919
- data: {
920
- blocks: blocks,
921
- },
922
- })
923
- .afterClosed()
924
- .pipe(operators.filter(function (b) { return !!b; }), operators.switchMap(function (b) { return _this.config.blocksReorder(b)
925
- .pipe(operators.mapTo(blocks)); }), operators.takeUntil(this._destroy$))
926
- .subscribe(function (b) {
927
- b
928
- .forEach(function (block, index) {
929
- block.index = index;
930
- });
931
- });
932
- };
933
- BlockEditorService.prototype.ngOnDestroy = function () {
934
- this._destroy$.next();
935
- this._destroy$.complete();
936
- };
937
- BlockEditorService.prototype._initBlockGroups = function () {
938
- this.blockGroups = Object.values(this._store.blocks
939
- .reduce(function (accum, block) {
940
- if (block.name) {
941
- var existing = accum[block.name] || {};
942
- accum[block.name] = {
943
- label: block.label || existing.label,
944
- description: block.description || existing.description,
945
- name: block.name,
946
- };
947
- }
948
- return accum;
949
- }, {}));
950
- };
951
- BlockEditorService.prototype._initBlockChange = function () {
952
- var _this = this;
953
- if (this.config.blockChange) {
954
- this.blockChanged$
955
- .pipe(operators.groupBy(function (block) { return (block.guid); }), operators.map(function (group) { return group.pipe(operators.debounceTime(250)); }), operators.mergeAll())
956
- .subscribe(function (block) {
957
- _this.config.blockChange(block);
958
- });
959
- }
960
- };
961
- BlockEditorService.prototype._initBlock = function (block) {
962
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
963
- var newBlock = Object.assign(Object.assign({}, block), { shapeBottomLeft: (_a = block.shapeBottomLeft) !== null && _a !== void 0 ? _a : 'round', shapeTopLeft: (_b = block.shapeTopLeft) !== null && _b !== void 0 ? _b : 'round', shapeTopRight: (_c = block.shapeTopRight) !== null && _c !== void 0 ? _c : 'round', shapeBottomRight: (_d = block.shapeBottomRight) !== null && _d !== void 0 ? _d : 'round', verticalAlign: (_e = block.verticalAlign) !== null && _e !== void 0 ? _e : 'top', horizontalAlign: (_f = block.horizontalAlign) !== null && _f !== void 0 ? _f : 'left', index: block.guid ? block.index : this._store.blocks.length, guid: block.guid || common.guid('xxxxxxxxxxxx'), keepRatio: (_g = block.keepRatio) !== null && _g !== void 0 ? _g : [
964
- exports.BlockType.Checkbox,
965
- exports.BlockType.RadioButton,
966
- exports.BlockType.Pdf,
967
- ]
968
- .indexOf(block.type) !== -1 });
969
- var width = (this.config.width * .333).toFixed(2);
970
- var height = width / 2;
971
- if (newBlock.type === exports.BlockType.Rectangle) {
972
- newBlock = Object.assign(Object.assign({}, newBlock), { borderColor: (_h = newBlock.borderColor) !== null && _h !== void 0 ? _h : '#cccccc', borderWidth: (_j = newBlock.borderWidth) !== null && _j !== void 0 ? _j : 1 });
973
- }
974
- else if (newBlock.type === exports.BlockType.Checkbox || newBlock.type === exports.BlockType.RadioButton) {
975
- width = .25;
976
- height = .25;
977
- }
978
- else {
979
- width = 2;
980
- height = .5;
981
- }
982
- //get max tabindex
983
- // newBlock.tabIndex = this._lastTabIndex + 1;
984
- // this.updateTabIndex(newBlock.tabIndex);
985
- return Object.assign({ top: height, left: width, width: width, height: height }, newBlock);
986
- };
987
- return BlockEditorService;
988
- }());
989
- BlockEditorService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BlockEditorService, deps: [{ token: BlocksStore }, { token: i2__namespace.FsDialog }, { token: i3__namespace$1.FsPrompt }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
990
- BlockEditorService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BlockEditorService });
991
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BlockEditorService, decorators: [{
992
- type: i0.Injectable
993
- }], ctorParameters: function () { return [{ type: BlocksStore }, { type: i2__namespace.FsDialog }, { type: i3__namespace$1.FsPrompt }]; } });
994
-
995
- var CreateImageUrlPipe = /** @class */ (function () {
996
- function CreateImageUrlPipe(_api) {
997
- this._api = _api;
998
- }
999
- CreateImageUrlPipe.prototype.transform = function (url) {
1000
- return this._api.createApiFile(url).safeDataUrl;
1001
- };
1002
- return CreateImageUrlPipe;
1003
- }());
1004
- CreateImageUrlPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CreateImageUrlPipe, deps: [{ token: i1__namespace$1.FsApi }], target: i0__namespace.ɵɵFactoryTarget.Pipe });
1005
- CreateImageUrlPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CreateImageUrlPipe, name: "createImageUrl" });
1006
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CreateImageUrlPipe, decorators: [{
1007
- type: i0.Pipe,
1008
- args: [{ name: 'createImageUrl' }]
1009
- }], ctorParameters: function () { return [{ type: i1__namespace$1.FsApi }]; } });
1010
-
1011
- var FsBlockComponent = /** @class */ (function () {
1012
- function FsBlockComponent(_blockEditor, _elementRef, _cdRef, _fontPickerService) {
1013
- this._blockEditor = _blockEditor;
1014
- this._elementRef = _elementRef;
1015
- this._cdRef = _cdRef;
1016
- this._fontPickerService = _fontPickerService;
1017
- this.transformating = false;
1018
- this.BlockType = exports.BlockType;
1019
- this._editable = false;
1020
- this._transformable = false;
1021
- this._destroy$ = new rxjs.Subject();
1022
- }
1023
- Object.defineProperty(FsBlockComponent.prototype, "block", {
1024
- get: function () {
1025
- return this._block;
1026
- },
1027
- set: function (block) {
1028
- var _this = this;
1029
- this._block = block;
1030
- this._block.resizable = !this.hasType([exports.BlockType.Checkbox, exports.BlockType.RadioButton]);
1031
- this._block.rotatable = !this.hasType([exports.BlockType.Checkbox, exports.BlockType.RadioButton]);
1032
- this._block.scalable = !this.hasType([exports.BlockType.Checkbox, exports.BlockType.RadioButton]);
1033
- if (this.moveable) {
1034
- this._updateMoveable();
1035
- }
1036
- this.typeForm = BlockTypes
1037
- .some(function (blockType) {
1038
- return blockType.type === 'form' && blockType.value === _this.block.type;
1039
- });
1040
- },
1041
- enumerable: false,
1042
- configurable: true
1043
- });
1044
- FsBlockComponent.prototype.keydown = function (event) {
1045
- if (this.selected) {
1046
- if (['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].indexOf(event.key) !== -1) {
1047
- this._move(event);
1048
- }
1049
- if (['Delete', 'Backspace'].indexOf(event.key) !== -1) {
1050
- this._delete(event);
1051
- }
1052
- }
1053
- };
1054
- Object.defineProperty(FsBlockComponent.prototype, "el", {
1055
- get: function () {
1056
- return this.element.nativeElement;
1057
- },
1058
- enumerable: false,
1059
- configurable: true
1060
- });
1061
- Object.defineProperty(FsBlockComponent.prototype, "moveable", {
1062
- get: function () {
1063
- return this._moveable;
1064
- },
1065
- enumerable: false,
1066
- configurable: true
1067
- });
1068
- FsBlockComponent.prototype.hasType = function (types) {
1069
- return types.includes(this.block.type);
1070
- };
1071
- Object.defineProperty(FsBlockComponent.prototype, "editable", {
1072
- get: function () {
1073
- return this._editable;
1074
- },
1075
- set: function (value) {
1076
- this._editable = value;
1077
- if (!value) {
1078
- this.deselectContent();
1079
- }
1080
- },
1081
- enumerable: false,
1082
- configurable: true
1083
- });
1084
- Object.defineProperty(FsBlockComponent.prototype, "styleTop", {
1085
- get: function () {
1086
- var top = this.block.top;
1087
- return "" + top + this.unit;
1088
- },
1089
- enumerable: false,
1090
- configurable: true
1091
- });
1092
- Object.defineProperty(FsBlockComponent.prototype, "styleLeft", {
1093
- get: function () {
1094
- var left = this.block.left;
1095
- return "" + left + this.unit;
1096
- },
1097
- enumerable: false,
1098
- configurable: true
1099
- });
1100
- Object.defineProperty(FsBlockComponent.prototype, "styleWidth", {
1101
- get: function () {
1102
- var width = this.block.width;
1103
- if (this.block.clipPath) {
1104
- width -= (this.block.width * this.block.clipPath.values[1] / 100) +
1105
- (this.block.width * this.block.clipPath.values[3] / 100);
1106
- }
1107
- return "" + width + this.unit;
1108
- },
1109
- enumerable: false,
1110
- configurable: true
1111
- });
1112
- Object.defineProperty(FsBlockComponent.prototype, "styleHeight", {
1113
- get: function () {
1114
- var height = this.block.height;
1115
- if (this.block.clipPath) {
1116
- height -= (this.block.height * this.block.clipPath.values[0] / 100) +
1117
- (this.block.height * this.block.clipPath.values[2] / 100);
1118
- }
1119
- return "" + height + this.unit;
1120
- },
1121
- enumerable: false,
1122
- configurable: true
1123
- });
1124
- Object.defineProperty(FsBlockComponent.prototype, "styleImageHeight", {
1125
- get: function () {
1126
- var height = this.block.height;
1127
- if (this.block.clipPath) {
1128
- var values = this.block.clipPath.values || {};
1129
- }
1130
- return "" + height + this.unit;
1131
- },
1132
- enumerable: false,
1133
- configurable: true
1134
- });
1135
- Object.defineProperty(FsBlockComponent.prototype, "styleImageWidth", {
1136
- get: function () {
1137
- var width = this.block.width;
1138
- if (this.block.clipPath) {
1139
- var values = this.block.clipPath.values || {};
1140
- }
1141
- return "" + width + this.unit;
1142
- },
1143
- enumerable: false,
1144
- configurable: true
1145
- });
1146
- Object.defineProperty(FsBlockComponent.prototype, "styleImageTop", {
1147
- get: function () {
1148
- var top = 0;
1149
- if (this.block.clipPath) {
1150
- var values = this.block.clipPath.values || {};
1151
- top = (values[0] / 100) * this.block.width * -1;
1152
- }
1153
- return "" + top + this.unit;
1154
- },
1155
- enumerable: false,
1156
- configurable: true
1157
- });
1158
- Object.defineProperty(FsBlockComponent.prototype, "styleImageLeft", {
1159
- get: function () {
1160
- var left = 0;
1161
- if (this.block.clipPath) {
1162
- var values = this.block.clipPath.values || {};
1163
- left = (values[3] / 100) * this.block.width * -1;
1164
- }
1165
- return "" + left + this.unit;
1166
- },
1167
- enumerable: false,
1168
- configurable: true
1169
- });
1170
- Object.defineProperty(FsBlockComponent.prototype, "styleClipPath", {
1171
- get: function () {
1172
- if (!this.block.clipPath) {
1173
- return null;
1174
- }
1175
- var values = this.block.clipPath.values || {};
1176
- var top = values[0] / 100 * this.block.height;
1177
- var right = (values[1]) / 100 * this.block.width;
1178
- var bottom = (values[2]) / 100 * this.block.height;
1179
- var left = values[3] / 100 * this.block.width;
1180
- var clipPath = "inset(" + top + this.unit + " " + right + this.unit + " " + bottom + this.unit + " " + left + this.unit + ")";
1181
- return clipPath;
1182
- },
1183
- enumerable: false,
1184
- configurable: true
1185
- });
1186
- Object.defineProperty(FsBlockComponent.prototype, "styleBoxShadow", {
1187
- get: function () {
1188
- if (!this.block.shadowColor) {
1189
- return null;
1190
- }
1191
- var shadow = this.block.shadowX + "pt " + (this.block.shadowY || 0) + "pt " + (this.block.shadowBlur || 0) + "pt " + (this.block.shadowSpread || 0) + "pt " + this.block.shadowColor;
1192
- return shadow;
1193
- },
1194
- enumerable: false,
1195
- configurable: true
1196
- });
1197
- Object.defineProperty(FsBlockComponent.prototype, "elementGuidelines", {
1198
- set: function (value) {
1199
- this.moveable.elementGuidelines = value;
1200
- },
1201
- enumerable: false,
1202
- configurable: true
1203
- });
1204
- Object.defineProperty(FsBlockComponent.prototype, "clippable", {
1205
- get: function () {
1206
- return !!this.moveable.clippable;
1207
- },
1208
- set: function (value) {
1209
- this.moveable.clippable = value;
1210
- if (this.selected) {
1211
- this.moveable.resizable = !value;
1212
- this.moveable.rotatable = !value;
1213
- this.moveable.scalable = !value;
1214
- }
1215
- },
1216
- enumerable: false,
1217
- configurable: true
1218
- });
1219
- Object.defineProperty(FsBlockComponent.prototype, "transformable", {
1220
- get: function () {
1221
- return this._transformable;
1222
- },
1223
- set: function (value) {
1224
- this._transformable = value;
1225
- this._updateMoveable();
1226
- },
1227
- enumerable: false,
1228
- configurable: true
1229
- });
1230
- Object.defineProperty(FsBlockComponent.prototype, "rotate", {
1231
- set: function (value) {
1232
- this.moveable.request('rotatable', { rotate: parseFloat(value) }, true);
1233
- this.moveable.updateRect();
1234
- },
1235
- enumerable: false,
1236
- configurable: true
1237
- });
1238
- Object.defineProperty(FsBlockComponent.prototype, "index", {
1239
- set: function (value) {
1240
- this.block.index = value;
1241
- },
1242
- enumerable: false,
1243
- configurable: true
1244
- });
1245
- Object.defineProperty(FsBlockComponent.prototype, "keepRatio", {
1246
- set: function (value) {
1247
- this.moveable.keepRatio = value;
1248
- },
1249
- enumerable: false,
1250
- configurable: true
1251
- });
1252
- FsBlockComponent.prototype.markForCheck = function () {
1253
- this._cdRef.markForCheck();
1254
- };
1255
- FsBlockComponent.prototype.ngOnInit = function () {
1256
- var _this = this;
1257
- this.unit = this._blockEditor.config.unit;
1258
- this.content = this.block.content;
1259
- this.block.shadowOpacity = this.block.shadowOpacity || 100;
1260
- this._blockEditor.selectedBlocks$
1261
- .pipe(operators.skip(1), operators.takeUntil(this._destroy$))
1262
- .subscribe(function (blocks) {
1263
- if (document.activeElement instanceof HTMLElement) {
1264
- document.activeElement.blur();
1265
- }
1266
- _this.selected = blocks
1267
- .some(function (block) { return block.guid === _this.block.guid; });
1268
- _this.transformable = true;
1269
- _this._cdRef.markForCheck();
1270
- });
1271
- this._blockEditor.blockClippable$
1272
- .pipe(operators.filter(function () { return _this.selected; }), operators.takeUntil(this._destroy$))
1273
- .subscribe(function (clippable) {
1274
- _this.clippable = clippable;
1275
- _this._cdRef.markForCheck();
1276
- });
1277
- this._blockEditor.blockAdded$
1278
- .pipe(operators.takeUntil(this._destroy$))
1279
- .subscribe(function () {
1280
- _this._cdRef.markForCheck();
1281
- });
1282
- this._blockEditor.blockUpdated$
1283
- .pipe(operators.filter(function (block) { return block.guid === _this.block.guid; }), operators.takeUntil(this._destroy$))
1284
- .subscribe(function (block) {
1285
- _this.block = block;
1286
- _this._cdRef.markForCheck();
1287
- });
1288
- this._blockEditor.blockChanged$
1289
- .pipe(operators.filter(function (block) { return block.guid === _this.block.guid; }), operators.takeUntil(this._destroy$))
1290
- .subscribe(function (block) {
1291
- _this.block = block;
1292
- _this._cdRef.markForCheck();
1293
- });
1294
- };
1295
- FsBlockComponent.prototype.ngAfterViewInit = function () {
1296
- var _this = this;
1297
- setTimeout(function () {
1298
- _this._initEvents();
1299
- _this._initFont();
1300
- _this._initMoveable();
1301
- _this._setTransform();
1302
- _this._initElementGuidelines();
1303
- _this.rotate = _this.block.rotate;
1304
- });
1305
- };
1306
- FsBlockComponent.prototype.pxToIn = function (px) {
1307
- return this.round(px / 96, 2);
1308
- };
1309
- FsBlockComponent.prototype.round = function (value, decimals) {
1310
- return parseFloat(value.toFixed(decimals));
1311
- };
1312
- FsBlockComponent.prototype.deselect = function () {
1313
- this.editable = false;
1314
- this.clippable = false;
1315
- this.transformable = false;
1316
- this.disableContentEdit();
1317
- };
1318
- FsBlockComponent.prototype.disableContentEdit = function () {
1319
- this.editable = false;
1320
- };
1321
- FsBlockComponent.prototype.deselectContent = function () {
1322
- if (window.getSelection) {
1323
- if (window.getSelection().empty) {
1324
- window.getSelection().empty();
1325
- }
1326
- else if (window.getSelection().removeAllRanges) {
1327
- window.getSelection().removeAllRanges();
1328
- }
1329
- }
1330
- };
1331
- FsBlockComponent.prototype.selectTextAll = function () {
1332
- var range = document.createRange();
1333
- range.selectNodeContents(this.contentEditable.nativeElement);
1334
- var sel = window.getSelection();
1335
- sel.removeAllRanges();
1336
- sel.addRange(range);
1337
- };
1338
- FsBlockComponent.prototype.ngOnDestroy = function () {
1339
- //this._blockEditor.destroyBlock(this.block);
1340
- this._destroy$.next();
1341
- this._destroy$.complete();
1342
- };
1343
- FsBlockComponent.prototype._setTransform = function (transforms) {
1344
- if (transforms === void 0) { transforms = []; }
1345
- transforms = transforms !== null && transforms !== void 0 ? transforms : [];
1346
- this.el.style.transform = transforms.join(' ');
1347
- };
1348
- FsBlockComponent.prototype._triggerChanged = function () {
1349
- this._blockEditor.blockChange(this.block);
1350
- };
1351
- FsBlockComponent.prototype._updateMoveable = function () {
1352
- var value = !this.block.lock && this.selected;
1353
- this.keepRatio = this.block.keepRatio;
1354
- this.rotate = this.block.rotate;
1355
- this.moveable.resizable = this.block.resizable && value;
1356
- this.moveable.rotatable = this.block.rotatable && value;
1357
- this.moveable.scalable = this.block.scalable && value;
1358
- };
1359
- FsBlockComponent.prototype._initElementGuidelines = function () {
1360
- var _this = this;
1361
- this._blockEditor.blockComponents$
1362
- .pipe(operators.takeUntil(this._destroy$))
1363
- .subscribe(function (blockComponents) {
1364
- _this.moveable.elementGuidelines = blockComponents
1365
- .filter(function (blockComponent) { return _this !== blockComponent; })
1366
- .map(function (blockComponent) { return blockComponent.el; });
1367
- });
1368
- };
1369
- FsBlockComponent.prototype._initMoveable = function () {
1370
- var _this = this;
1371
- this._moveable = new Moveable__default["default"](this._elementRef.nativeElement, {
1372
- target: this.el,
1373
- container: this._blockEditor.container,
1374
- draggable: true,
1375
- resizable: false,
1376
- scalable: false,
1377
- rotatable: false,
1378
- warpable: false,
1379
- origin: false,
1380
- clipRelative: true,
1381
- clipArea: true,
1382
- keepRatio: this.block.keepRatio,
1383
- snappable: true,
1384
- snapDirections: { left: true, top: true, right: true, bottom: true, center: true, middle: true },
1385
- elementSnapDirections: { left: true, top: true, right: true, bottom: true, center: true, middle: true },
1386
- edge: false,
1387
- throttleDrag: 1,
1388
- throttleScale: 0.01,
1389
- throttleRotate: 1,
1390
- throttleResize: 1,
1391
- snapDistFormat: function (v, type) { return "" + _this.round(v / 96, 2); },
1392
- });
1393
- this._updateMoveable();
1394
- this.moveable
1395
- .on('clip', function (e) {
1396
- _this.moveable.keepRatio = false;
1397
- e.target.style.clipPath = e.clipStyle;
1398
- _this.block.clipPath = {
1399
- type: 'inset',
1400
- values: e.clipStyles
1401
- .map(function (value) {
1402
- var n = Number(value.replace('%', ''));
1403
- return n > 0 ? n : 0;
1404
- }),
1405
- };
1406
- })
1407
- .on('clipEnd', function (e) {
1408
- _this.moveable.keepRatio = true;
1409
- e.target.style.clipPath = null;
1410
- _this._triggerChanged();
1411
- setTimeout(function () {
1412
- _this.moveable.updateRect();
1413
- }, 100);
1414
- })
1415
- .on('dragStart', function () {
1416
- _this.disableContentEdit();
1417
- _this.transformating = true;
1418
- _this._cdRef.markForCheck();
1419
- })
1420
- .on('drag', function (_c) {
1421
- var target = _c.target, left = _c.left, top = _c.top;
1422
- target.style.left = "" + _this.pxToIn(left) + _this.unit;
1423
- target.style.top = "" + _this.pxToIn(top) + _this.unit;
1424
- _this.block.top = _this.pxToIn(top);
1425
- _this.block.left = _this.pxToIn(left);
1426
- })
1427
- .on('dragEnd', function () {
1428
- _this.transformating = false;
1429
- _this._triggerChanged();
1430
- _this._cdRef.markForCheck();
1431
- })
1432
- .on('resizeStart', function () {
1433
- _this.disableContentEdit();
1434
- _this.zoompan.disable();
1435
- _this.transformating = true;
1436
- _this._cdRef.markForCheck();
1437
- })
1438
- .on('resize', function (_c) {
1439
- var target = _c.target, width = _c.width, height = _c.height, dist = _c.dist, delta = _c.delta, direction = _c.direction;
1440
- width = _this.pxToIn(width);
1441
- height = _this.pxToIn(height);
1442
- if (delta[0]) {
1443
- _this.block.width = width;
1444
- target.style.width = "" + width + _this.unit;
1445
- }
1446
- if (delta[1]) {
1447
- _this.block.height = height;
1448
- target.style.height = "" + height + _this.unit;
1449
- }
1450
- var transform = [0, 0];
1451
- if (direction[1] === -1) {
1452
- transform[1] = dist[1] * -1;
1453
- }
1454
- if (direction[0] === -1) {
1455
- transform[0] = dist[0] * -1;
1456
- }
1457
- _this._setTransform(["translate(" + transform[0] + "px, " + transform[1] + "px)"]);
1458
- })
1459
- .on('resizeEnd', function (_c) {
1460
- var target = _c.target;
1461
- var matrix = new WebKitCSSMatrix(target.style.transform);
1462
- _this.block.top = parseFloat(target.style.top) + _this.pxToIn(matrix.m42);
1463
- _this.block.left = parseFloat(target.style.left) + _this.pxToIn(matrix.m41);
1464
- _this._setTransform();
1465
- _this._triggerChanged();
1466
- _this.zoompan.enable();
1467
- _this.transformating = false;
1468
- _this._cdRef.markForCheck();
1469
- target.style.top = _this.block.top + "in";
1470
- target.style.left = _this.block.left + "in";
1471
- target.style.width = _this.block.width + "in";
1472
- target.style.height = _this.block.height + "in";
1473
- _this.moveable.updateRect();
1474
- })
1475
- .on('rotateStart', function (_c) {
1476
- var inputEvent = _c.inputEvent;
1477
- if (inputEvent) {
1478
- _this.zoompan.disable();
1479
- _this.disableContentEdit();
1480
- _this.transformating = true;
1481
- _this._cdRef.markForCheck();
1482
- }
1483
- })
1484
- .on('rotate', function (_c) {
1485
- var inputEvent = _c.inputEvent, transform = _c.transform, rotation = _c.rotation;
1486
- _this.el.style.transform = transform;
1487
- _this.block.rotate = rotation % 360;
1488
- if (inputEvent) {
1489
- _this.zoompan.enable();
1490
- }
1491
- })
1492
- .on('rotateEnd', function (_c) {
1493
- var inputEvent = _c.inputEvent;
1494
- if (inputEvent) {
1495
- _this.transformating = false;
1496
- _this._cdRef.markForCheck();
1497
- _this._triggerChanged();
1498
- }
1499
- });
1500
- };
1501
- FsBlockComponent.prototype._initFont = function () {
1502
- if (this.block.fontFamily) {
1503
- this._fontPickerService.importFont(this.block.fontFamily);
1504
- }
1505
- };
1506
- FsBlockComponent.prototype._initEvents = function () {
1507
- var _this = this;
1508
- rxjs.fromEvent(this.contentEditable.nativeElement, 'paste')
1509
- .pipe(operators.takeUntil(this._destroy$))
1510
- .subscribe(function (e) {
1511
- e.preventDefault();
1512
- var clipboardData = e.clipboardData;
1513
- var text = clipboardData.getData('Text');
1514
- var range = document.getSelection().getRangeAt(0);
1515
- range.deleteContents();
1516
- var textNode = document.createTextNode(text);
1517
- range.insertNode(textNode);
1518
- range.selectNodeContents(textNode);
1519
- range.collapse(false);
1520
- var selection = window.getSelection();
1521
- selection.removeAllRanges();
1522
- selection.addRange(range);
1523
- _this.block.content = _this.contentEditable.nativeElement.innerHTML;
1524
- _this._triggerChanged();
1525
- });
1526
- rxjs.fromEvent(this.contentEditable.nativeElement, 'input')
1527
- .pipe(operators.takeUntil(this._destroy$)).subscribe(function (event) {
1528
- _this.block.content = event.target.innerHTML;
1529
- _this._triggerChanged();
1530
- });
1531
- rxjs.fromEvent(this.el, 'mousedown')
1532
- .pipe(operators.takeUntil(this._destroy$))
1533
- .subscribe(function (event) {
1534
- if (_this.block.lock) {
1535
- event.preventDefault();
1536
- event.stopImmediatePropagation();
1537
- event.stopPropagation();
1538
- }
1539
- else {
1540
- _this.zoompan.disable();
1541
- }
1542
- if (!_this.moveable.clippable) {
1543
- if (_this.editable) {
1544
- if (_this.contentElement.nativeElement.isSameNode(event.target)) {
1545
- event.preventDefault();
1546
- event.stopImmediatePropagation();
1547
- event.stopPropagation();
1548
- }
1549
- }
1550
- else {
1551
- _this._blockEditor.selectedBlock = _this.block;
1552
- }
1553
- }
1554
- });
1555
- rxjs.fromEvent(this.el, 'mouseup')
1556
- .pipe(operators.takeUntil(this._destroy$)).subscribe(function () {
1557
- _this.zoompan.enable();
1558
- });
1559
- rxjs.fromEvent(this.el, 'dblclick')
1560
- .pipe(operators.filter(function () { return (!_this.editable); }), operators.takeUntil(this._destroy$))
1561
- .subscribe(function (event) {
1562
- if (_this.block.readonly) {
1563
- event.preventDefault();
1564
- }
1565
- else {
1566
- _this.editable = true;
1567
- _this._cdRef.markForCheck();
1568
- setTimeout(function () {
1569
- _this.selectTextAll();
1570
- });
1571
- }
1572
- });
1573
- };
1574
- FsBlockComponent.prototype._move = function (event) {
1575
- if (!this.selected ||
1576
- this.editable) {
1577
- return;
1578
- }
1579
- event.preventDefault();
1580
- var inchPixel = 1 / 100;
1581
- switch (event.key) {
1582
- case 'ArrowUp':
1583
- this.block.top = common.round(this.block.top - inchPixel, 2);
1584
- break;
1585
- case 'ArrowDown':
1586
- this.block.top = common.round(this.block.top + inchPixel, 2);
1587
- break;
1588
- case 'ArrowLeft':
1589
- this.block.left = common.round(this.block.left - inchPixel, 2);
1590
- break;
1591
- case 'ArrowRight':
1592
- this.block.left = common.round(this.block.left + inchPixel, 2);
1593
- break;
1594
- }
1595
- this._blockEditor.blockChange(this.block);
1596
- };
1597
- FsBlockComponent.prototype._delete = function (event) {
1598
- var _a, _b;
1599
- if (this.selected &&
1600
- !this.editable &&
1601
- ((_a = event.target) === null || _a === void 0 ? void 0 : _a.nodeName) !== 'INPUT' &&
1602
- ((_b = event.target) === null || _b === void 0 ? void 0 : _b.nodeName) !== 'TEXTAREA') {
1603
- event.preventDefault();
1604
- this._blockEditor.removeBlocks([this.block]);
1605
- }
1606
- };
1607
- return FsBlockComponent;
1608
- }());
1609
- FsBlockComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockComponent, deps: [{ token: BlockEditorService }, { token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }, { token: i2__namespace$1.FsFontPickerService }], target: i0__namespace.ɵɵFactoryTarget.Component });
1610
- FsBlockComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsBlockComponent, selector: "fs-block", inputs: { block: "block", html: "html", zoompan: "zoompan" }, host: { 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__namespace, 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;top:0;left:0;bottom:0;right:0;-webkit-user-select:none;user-select:none}.block.selected.lock .outline,.block:hover.lock .outline{border-color:#e4181866;border-style:dashed}:host ::ng-deep fs-html-editor .bottom-line,:host ::ng-deep fs-html-editor .fr-toolbar{display:none!important}:host ::ng-deep fs-html-editor .fr-wrapper{background:none!important;border:none!important}:host ::ng-deep .moveable-line:not(.moveable-rotation-line):not(.moveable-guideline){background:transparent!important}\n"], directives: [{ type: i17__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i17__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i17__namespace.AsyncPipe, "createImageUrl": CreateImageUrlPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
1611
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockComponent, decorators: [{
1612
- type: i0.Component,
1613
- args: [{
1614
- selector: 'fs-block',
1615
- templateUrl: './block.component.html',
1616
- styleUrls: ['./block.component.scss'],
1617
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
1618
- }]
1619
- }], ctorParameters: function () { return [{ type: BlockEditorService }, { type: i0__namespace.ElementRef }, { type: i0__namespace.ChangeDetectorRef }, { type: i2__namespace$1.FsFontPickerService }]; }, propDecorators: { element: [{
1620
- type: i0.ViewChild,
1621
- args: ['element', { static: true }]
1622
- }], contentElement: [{
1623
- type: i0.ViewChild,
1624
- args: ['contentElement', { static: true }]
1625
- }], contentEditable: [{
1626
- type: i0.ViewChild,
1627
- args: ['contentEditable', { static: true }]
1628
- }], block: [{
1629
- type: i0.Input,
1630
- args: ['block']
1631
- }], html: [{
1632
- type: i0.Input
1633
- }], zoompan: [{
1634
- type: i0.Input
1635
- }], transformating: [{
1636
- type: i0.HostBinding,
1637
- args: ['class.transforming']
1638
- }], keydown: [{
1639
- type: i0.HostListener,
1640
- args: ['document:keydown', ['$event']]
1641
- }] } });
1642
-
1643
- var SidebarComponent = /** @class */ (function () {
1644
- function SidebarComponent(_el, _blockEditor, _cdRef, _clipboard, _message, _prompt, _dialog, _document) {
1645
- var _this = this;
1646
- this._el = _el;
1647
- this._blockEditor = _blockEditor;
1648
- this._cdRef = _cdRef;
1649
- this._clipboard = _clipboard;
1650
- this._message = _message;
1651
- this._prompt = _prompt;
1652
- this._dialog = _dialog;
1653
- this._document = _document;
1654
- this.zoomCenter = new i0.EventEmitter();
1655
- this.BlockTypes = BlockTypes;
1656
- this.blockTypeNames = common.index(BlockTypes, 'value', 'name');
1657
- this.blockTypeIcons = common.index(BlockTypes, 'value', 'icon');
1658
- this.clippable = false;
1659
- this.BlockType = exports.BlockType;
1660
- this.formats = [];
1661
- this._destroy$ = new rxjs.Subject();
1662
- this.validate = function (formControl) {
1663
- if (_this._blockEditor.config.defaultValidation) {
1664
- return _this._blockEditor.config.defaultValidation(_this.block, formControl.value);
1665
- }
1666
- return rxjs.of(true);
1667
- };
1668
- }
1669
- Object.defineProperty(SidebarComponent.prototype, "el", {
1670
- get: function () {
1671
- return this._el.nativeElement;
1672
- },
1673
- enumerable: false,
1674
- configurable: true
1675
- });
1676
- Object.defineProperty(SidebarComponent.prototype, "blockGroups", {
1677
- get: function () {
1678
- return this._blockEditor.blockGroups;
1679
- },
1680
- enumerable: false,
1681
- configurable: true
1682
- });
1683
- Object.defineProperty(SidebarComponent.prototype, "blockTypeForm", {
1684
- get: function () {
1685
- return this.block.type === exports.BlockType.LongText ||
1686
- this.block.type === exports.BlockType.ShortText ||
1687
- this.block.type === exports.BlockType.RadioButton ||
1688
- this.block.type === exports.BlockType.Checkbox ||
1689
- this.block.type === exports.BlockType.Date ||
1690
- this.block.type === exports.BlockType.Signature;
1691
- },
1692
- enumerable: false,
1693
- configurable: true
1694
- });
1695
- SidebarComponent.prototype.ngOnInit = function () {
1696
- var _this = this;
1697
- this._blockEditor.selectedBlocks$
1698
- .pipe(operators.takeUntil(this._destroy$))
1699
- .subscribe(function (blocks) {
1700
- _this.block = blocks[0] ? blocks[0] : null;
1701
- _this.blockGroup = null;
1702
- if (_this.block) {
1703
- _this.formats = BlockFormats
1704
- .filter(function (blockFormat) { return (blockFormat.blockTypes.indexOf(_this.block.type) !== -1); });
1705
- if (_this.block.name) {
1706
- _this.blockGroup = _this._blockEditor.blockGroups
1707
- .find(function (blockGroup) {
1708
- return _this.block.name === blockGroup.name;
1709
- });
1710
- }
1711
- }
1712
- _this._cdRef.markForCheck();
1713
- });
1714
- this._blockEditor.blockChanged$
1715
- .pipe(operators.filter(function (block) { return block === _this.block; }), operators.takeUntil(this._destroy$))
1716
- .subscribe(function () {
1717
- _this._cdRef.markForCheck();
1718
- });
1719
- if (this._blockEditor.config.blocksReorder) {
1720
- this.blocksReordered = function () {
1721
- var _a;
1722
- (_a = _this._document.defaultView) === null || _a === void 0 ? void 0 : _a.scrollTo(0, 0);
1723
- _this._blockEditor.openReorderDialog();
1724
- };
1725
- }
1726
- };
1727
- SidebarComponent.prototype.blockGroupChange = function (blockGroup) {
1728
- this._blockEditor.applyBlockGroup(this.block, blockGroup);
1729
- };
1730
- SidebarComponent.prototype.blockRequired = function (value) {
1731
- var values = { required: value, readonly: false };
1732
- if (this.blockGroup) {
1733
- this._blockEditor.blockGroupChangeProperty(this.blockGroup, values);
1734
- }
1735
- else {
1736
- this.blockChangeProperty(values);
1737
- }
1738
- };
1739
- SidebarComponent.prototype.blockReadonly = function (value) {
1740
- var values = { readonly: value, required: false };
1741
- if (this.blockGroup) {
1742
- this._blockEditor.blockGroupChangeProperty(this.blockGroup, values);
1743
- }
1744
- else {
1745
- this.blockChangeProperty(values);
1746
- }
1747
- };
1748
- SidebarComponent.prototype.blockGroupEdit = function (event) {
1749
- var _this = this;
1750
- event.preventDefault();
1751
- event.stopImmediatePropagation();
1752
- this.blockGroupDialog(this.blockGroup)
1753
- .subscribe(function (blockGroup) {
1754
- _this._blockEditor.blocks
1755
- .filter(function (block) { return block.name === blockGroup.name; })
1756
- .forEach(function (block) {
1757
- _this._blockEditor.applyBlockGroup(block, blockGroup);
1758
- });
1759
- });
1760
- };
1761
- SidebarComponent.prototype.blockGroupCreate = function (event) {
1762
- var _this = this;
1763
- event.preventDefault();
1764
- event.stopImmediatePropagation();
1765
- this.blockGroupDialog()
1766
- .subscribe(function (blockGroup) {
1767
- _this._blockEditor.applyBlockGroup(_this.block, blockGroup);
1768
- _this.blockGroup = blockGroup;
1769
- _this._cdRef.markForCheck();
1770
- });
1771
- };
1772
- SidebarComponent.prototype.blockGroupDialog = function (blockGroup) {
1773
- return this._dialog.open(GroupDialogComponent, {
1774
- data: {
1775
- block: this.block,
1776
- blockEditor: this._blockEditor,
1777
- blockGroup: blockGroup,
1778
- },
1779
- })
1780
- .afterClosed()
1781
- .pipe(operators.filter(function (block) { return !!block; }), operators.takeUntil(this._destroy$));
1782
- };
1783
- SidebarComponent.prototype.fontChanged = function (font) {
1784
- this._blockEditor.selectedBlockComponentChangeProperty({ fontFamily: font });
1785
- };
1786
- SidebarComponent.prototype.verticalAlignClick = function (value) {
1787
- this._blockEditor.selectedBlockComponentChangeProperty({ verticalAlign: value });
1788
- };
1789
- SidebarComponent.prototype.boldClick = function () {
1790
- this._blockEditor.selectedBlockComponentChangeProperty({ bold: !this.block.bold });
1791
- };
1792
- SidebarComponent.prototype.toggleLock = function () {
1793
- this._blockEditor.selectedBlockComponentChangeProperty({ lock: !this.block.lock });
1794
- };
1795
- SidebarComponent.prototype.fontColorChange = function (value) {
1796
- this._blockEditor.selectedBlockComponentChangeProperty({ fontColor: value });
1797
- };
1798
- SidebarComponent.prototype.italicClick = function () {
1799
- this._blockEditor.selectedBlockComponentChangeProperty({ italic: !this.block.italic });
1800
- };
1801
- SidebarComponent.prototype.underlineClick = function () {
1802
- this._blockEditor.selectedBlockComponentChangeProperty({ underline: !this.block.underline });
1803
- };
1804
- SidebarComponent.prototype.backgroundColorChange = function (value) {
1805
- this._blockEditor.selectedBlockComponentChangeProperty({ backgroundColor: value });
1806
- };
1807
- SidebarComponent.prototype.shadowColorChange = function (value) {
1808
- this._blockEditor.selectedBlockComponentChangeProperty({ shadowColor: value });
1809
- };
1810
- SidebarComponent.prototype.paddingAllChange = function (value) {
1811
- var _this = this;
1812
- value = this.validNumeric(value) ? value : null;
1813
- this.block.paddingTop = value;
1814
- this.block.paddingLeft = value;
1815
- this.block.paddingBottom = value;
1816
- this.block.paddingRight = value;
1817
- this._blockEditor.selectedBlocks
1818
- .forEach(function (block) {
1819
- _this._blockEditor.blockChange(block);
1820
- });
1821
- };
1822
- SidebarComponent.prototype.paddingKeypress = function (event, name) {
1823
- this.block.padding = null;
1824
- this.numericInputKeypress(event, name);
1825
- };
1826
- SidebarComponent.prototype.paddingAllKeypress = function (event, unit) {
1827
- if (unit === void 0) { unit = .1; }
1828
- if (event.code === 'ArrowUp' || event.code === 'ArrowDown') {
1829
- this.block.padding = (this.block.padding) + ((event.code === 'ArrowDown' ? -1 : 1) * unit);
1830
- this.paddingAllChange(this.block.padding);
1831
- }
1832
- };
1833
- SidebarComponent.prototype.borderColorChange = function (value) {
1834
- this._blockEditor.selectedBlockComponentChangeProperty({ borderColor: value });
1835
- };
1836
- SidebarComponent.prototype.toggleKeepRatio = function () {
1837
- this._blockEditor.selectedBlockComponentChangeProperty({ keepRatio: !this.block.keepRatio });
1838
- };
1839
- SidebarComponent.prototype.horizontalAlignClick = function (value) {
1840
- this._blockEditor.selectedBlockComponentChangeProperty({ horizontalAlign: value });
1841
- };
1842
- SidebarComponent.prototype.shapeRound = function (name) {
1843
- var _b;
1844
- var value = this.block[name] === 'round' ? 'square' : 'round';
1845
- this._blockEditor.selectedBlockComponentChangeProperty((_b = {}, _b[name] = value, _b));
1846
- };
1847
- SidebarComponent.prototype.numberChange = function (value, name) {
1848
- var _b;
1849
- value = this.validNumeric(value) ? value : null;
1850
- this._blockEditor.selectedBlockComponentChangeProperty((_b = {}, _b[name] = value, _b));
1851
- };
1852
- SidebarComponent.prototype.imageRemove = function () {
1853
- this._blockEditor.selectedBlockComponentChangeProperty({ imageUrl: null });
1854
- };
1855
- SidebarComponent.prototype.imageClip = function () {
1856
- this.clippable = !this.clippable;
1857
- this._blockEditor.blockClippable = true;
1858
- };
1859
- SidebarComponent.prototype.blockChangeProperty = function (values) {
1860
- this._blockEditor.selectedBlockComponentChangeProperty(values);
1861
- };
1862
- SidebarComponent.prototype.blockDuplicateClick = function () {
1863
- var selectedBlock = this._blockEditor.selectedBlocks[0];
1864
- var block = Object.assign(Object.assign({}, selectedBlock), { id: null, data: null, guid: null, top: selectedBlock.top + selectedBlock.height + .1 });
1865
- this._blockEditor.blockAdd(block);
1866
- };
1867
- SidebarComponent.prototype.blockRemoveClick = function () {
1868
- this._blockEditor.removeBlocks(this._blockEditor.selectedBlocks);
1869
- };
1870
- SidebarComponent.prototype.blockUpload = function (block, fsFile) {
1871
- this._blockEditor.blockUpload(block, fsFile)
1872
- .subscribe();
1873
- };
1874
- SidebarComponent.prototype.blockAdd = function (type) {
1875
- if (type === exports.BlockType.Pdf || type === exports.BlockType.Image) {
1876
- return;
1877
- }
1878
- var block = {
1879
- type: type,
1880
- shadowX: 2,
1881
- shadowY: 2,
1882
- shadowBlur: 4,
1883
- };
1884
- this._blockEditor.blockAdd(block);
1885
- };
1886
- SidebarComponent.prototype.layerMove = function (direction) {
1887
- var _this = this;
1888
- this._blockEditor.blocks.forEach(function (block) {
1889
- if (_this._blockEditor.isSelectedBlock(block)) {
1890
- block.index += (999 * direction);
1891
- }
1892
- });
1893
- var sorted = this._blockEditor.blocks
1894
- .sort(function (a, b) {
1895
- return a.index > b.index ? 1 : -1;
1896
- });
1897
- sorted
1898
- .forEach(function (block, idx) {
1899
- block.index = idx;
1900
- _this._blockEditor.blockChange(block);
1901
- });
1902
- if (this.config.blocksLevelChanged) {
1903
- this.config.blocksLevelChanged(sorted.map(function (block) { return block; }));
1904
- }
1905
- };
1906
- SidebarComponent.prototype.exportBlocks = function () {
1907
- var blocks = JSON.stringify(this._blockEditor.blocks);
1908
- this._clipboard.copy(blocks, { showMessage: false });
1909
- this._message.success('Exported blocks to clipboard');
1910
- };
1911
- SidebarComponent.prototype.importBlocks = function () {
1912
- var _this = this;
1913
- this._prompt.input({
1914
- title: 'Import blocks',
1915
- })
1916
- .subscribe(function (blocks) {
1917
- blocks = JSON.parse(blocks);
1918
- blocks
1919
- .forEach(function (block) {
1920
- block = Object.assign(Object.assign({}, block), { guid: common.guid(), imageUrl: null });
1921
- _this._blockEditor.blockAdd(block);
1922
- });
1923
- _this._message
1924
- .success("Imported " + blocks.length + " " + (blocks.length === 1 ? 'block' : 'blocks'));
1925
- });
1926
- };
1927
- SidebarComponent.prototype.layerUp = function () {
1928
- this.layerMove(1);
1929
- };
1930
- SidebarComponent.prototype.layerDown = function () {
1931
- this.layerMove(-1);
1932
- };
1933
- SidebarComponent.prototype.inputFocus = function (event) {
1934
- event.target.select();
1935
- };
1936
- SidebarComponent.prototype.numericInputKeypress = function (event, name, unit) {
1937
- var _b;
1938
- if (unit === void 0) { unit = .1; }
1939
- if (event.code === 'ArrowUp' || event.code === 'ArrowDown') {
1940
- this.block[name] = common.round(Number(this.block[name] || 0) +
1941
- ((event.code === 'ArrowDown' ? -1 : 1) * unit), 3);
1942
- this._blockEditor.selectedBlockComponentChangeProperty((_b = {}, _b[name] = this.block[name], _b));
1943
- }
1944
- };
1945
- SidebarComponent.prototype.ngOnDestroy = function () {
1946
- this._destroy$.next();
1947
- this._destroy$.complete();
1948
- };
1949
- SidebarComponent.prototype.validNumeric = function (value) {
1950
- return !value || !!String(value).match(/^\d*\.?\d*$/);
1951
- };
1952
- return SidebarComponent;
1953
- }());
1954
- SidebarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SidebarComponent, deps: [{ token: i0__namespace.ElementRef }, { token: BlockEditorService }, { token: i0__namespace.ChangeDetectorRef }, { token: i2__namespace$2.FsClipboard }, { token: i3__namespace$2.FsMessage }, { token: i3__namespace$1.FsPrompt }, { token: i1__namespace.MatDialog }, { token: i17.DOCUMENT }], target: i0__namespace.ɵɵFactoryTarget.Component });
1955
- SidebarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SidebarComponent, selector: "sidebar", inputs: { config: "config", blocks: "blocks", zoompan: "zoompan" }, outputs: { zoomCenter: "zoomCenter" }, queries: [{ propertyName: "sidebarPanels", predicate: FsBlockEditorSidebarPanelDirective }], ngImport: i0__namespace, template: "<div class=\"sidebar\">\n <form fsForm>\n <div class=\"sidebar-panel\"> \n <div class=\"sidebar-label\">Elements</div>\n <div class=\"sidebar-row\">\n <ng-container *ngFor=\"let blockType of BlockTypes\">\n <ng-container *ngIf=\"blockType.type === 'draw'\">\n <ng-container [ngSwitch]=\"blockType.value\">\n <ng-container *ngSwitchCase=\"BlockType.Pdf\">\n <ng-container [ngTemplateOutlet]=\"addFile\" [ngTemplateOutletContext]=\"{ type: BlockType.Pdf }\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"BlockType.Image\">\n <ng-container [ngTemplateOutlet]=\"addFile\" [ngTemplateOutletContext]=\"{ type: BlockType.Rectangle }\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container \n [ngTemplateOutlet]=\"addButton\" \n [ngTemplateOutletContext]=\"{ blockType: blockType }\">\n </ng-container>\n </ng-container>\n </ng-container>\n\n <ng-template #addFile let-type=\"type\">\n <fs-file \n (select)=\"blockUpload({ type: type, keepRatio: true, borderWidth: 0 }, $event)\" \n [accept]=\"blockType.accept\">\n <ng-container [ngTemplateOutlet]=\"addButton\" [ngTemplateOutletContext]=\"{ blockType: blockType }\"></ng-container>\n </fs-file>\n </ng-template>\n </ng-container>\n </ng-container>\n </div>\n </div>\n\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Form</div>\n <div class=\"sidebar-row\">\n <ng-container *ngFor=\"let blockType of BlockTypes\">\n <ng-container *ngIf=\"blockType.type === 'form'\">\n <ng-container \n [ngTemplateOutlet]=\"addButton\" \n [ngTemplateOutletContext]=\"{ blockType: blockType }\">\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </div> \n\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Tools</div>\n <div class=\"sidebar-row\">\n <ng-container *ngIf=\"block\">\n <button\n class=\"layer-up\"\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"layerUp()\"\n [matTooltip]=\"'Increase layer'\">\n <mat-icon>arrow_back</mat-icon>\n <mat-icon>layers</mat-icon>\n </button>\n <button\n class=\"layer-down\"\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"layerDown()\"\n [matTooltip]=\"'Decrease layer'\">\n <mat-icon>arrow_back</mat-icon>\n <mat-icon>layers</mat-icon>\n </button>\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"toggleLock()\"\n [matTooltip]=\"block.lock ? 'Unlock' : 'Lock'\">\n <mat-icon>{{block.lock ? 'lock_outline' : 'lock_open'}}</mat-icon>\n </button>\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n [matTooltip]=\"'Duplicate block'\"\n (click)=\"blockDuplicateClick()\">\n <mat-icon>content_copy</mat-icon>\n </button>\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n [matTooltip]=\"'Delete block'\"\n (click)=\"blockRemoveClick()\">\n <mat-icon>delete_outline</mat-icon>\n </button> \n </ng-container>\n <ng-container *ngIf=\"blocksReordered\">\n <button\n class=\"reorder-layers\"\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"blocksReordered()\"\n [matTooltip]=\"'Reorder blocks'\">\n <mat-icon>swap_vert</mat-icon>\n </button>\n </ng-container>\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n matTooltip=\"Reset zoom\"\n (click)=\"zoomCenter.emit()\">\n <mat-icon>crop_free</mat-icon>\n </button>\n </div>\n </div>\n <ng-container *ngIf=\"block\">\n <div class=\"sidebar-panel info-panel\">\n <div class=\"sidebar-label\">Info</div>\n <div class=\"sidebar-row field-gap\">\n <mat-form-field class=\"form-field-padless form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.left\"\n name=\"left\"\n fsMaskNumber\n scale=\"5\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'left', .01)\"\n (ngModelChange)=\"numberChange($event, 'left')\">\n <span matPrefix>X</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.top\"\n name=\"top\"\n fsMaskNumber\n scale=\"5\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'top', .01)\"\n (ngModelChange)=\"numberChange($event, 'top')\">\n <span matPrefix>Y</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless form-field-prefix rotate\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.rotate\"\n name=\"rotate\"\n fsMaskNumber\n scale=\"5\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'rotate', 1)\"\n (ngModelChange)=\"numberChange($event, 'rotate')\">\n <span matPrefix>R</span>\n </mat-form-field>\n </div>\n\n <div class=\"sidebar-row field-gap\">\n <mat-form-field class=\"form-field-padless form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.width\"\n name=\"width\"\n fsMaskNumber\n scale=\"5\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'width', .01)\"\n (ngModelChange)=\"numberChange($event, 'width')\">\n <span matPrefix>W</span>\n </mat-form-field>\n\n <div>\n <a (click)=\"toggleKeepRatio()\" class=\"keep-ratio\">\n <mat-icon>{{block.keepRatio ? 'lock_outline' : 'lock_open'}}</mat-icon>\n </a>\n </div>\n <mat-form-field class=\"form-field-padless form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.height\"\n name=\"height\"\n fsMaskNumber\n scale=\"5\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'height', .01)\"\n (ngModelChange)=\"numberChange($event, 'height')\">\n <span matPrefix>H</span>\n </mat-form-field>\n </div>\n </div>\n <ng-container\n *ngIf=\"blockTypeForm\">\n <div class=\"sidebar-panel block-form-panel\">\n <div class=\"sidebar-label\">\n <mat-icon>{{blockTypeIcons[block.type]}}</mat-icon>\n {{blockTypeNames[block.type]}}\n </div>\n <div class=\"sidebar-row\">\n\n <ng-container *ngIf=\"block.type === BlockType.RadioButton; else nameField\">\n <div class=\"group-block\">\n <mat-form-field class=\"full-width\" class=\"full-width\">\n <mat-label>Group</mat-label>\n <mat-select\n [(ngModel)]=\"blockGroup\"\n (ngModelChange)=\"blockGroupChange($event)\"\n name=\"group\">\n <ng-container *ngIf=\"blockGroups.length\">\n <mat-option [value]=\"null\">\n None\n </mat-option>\n </ng-container>\n <mat-option\n *ngFor=\"let item of blockGroups\"\n [value]=\"item\">\n {{ item.label }}\n </mat-option>\n <mat-option \n [value]=\"null\"\n (click)=\"blockGroupCreate($event)\">\n Create Group\n </mat-option>\n </mat-select> \n </mat-form-field>\n <ng-container *ngIf=\"blockGroup\">\n <a \n (click)=\"blockGroupEdit($event)\">\n <mat-icon>edit</mat-icon>\n </a>\n </ng-container>\n </div>\n </ng-container>\n \n <mat-form-field class=\"full-width\">\n <input\n matInput\n [ngModel]=\"block.label\"\n name=\"label\"\n placeholder=\"Label\"\n (ngModelChange)=\"blockChangeProperty({ label: $event })\">\n </mat-form-field>\n\n <ng-container *ngIf=\"block.type !== BlockType.RadioButton\">\n <mat-form-field class=\"full-width\">\n <textarea\n matInput\n [cdkTextareaAutosize]=\"true\"\n [ngModel]=\"block.description\"\n name=\"description\"\n placeholder=\"Description\"\n (ngModelChange)=\"blockChangeProperty({ description: $event })\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <mat-form-field\n *ngIf=\"formats.length\"\n class=\"full-width\">\n <mat-label>Format</mat-label>\n <mat-select\n [(ngModel)]=\"block.format\"\n name=\"format\"\n (ngModelChange)=\"blockChangeProperty({ format: $event })\"> \n <mat-option [value]=\"null\">\n None\n </mat-option>\n <mat-option\n *ngFor=\"let item of formats\"\n [value]=\"item.value\">\n {{ item.name }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n\n <ng-container\n *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText || block.type === BlockType.Date\">\n <mat-form-field class=\"full-width\">\n <textarea\n matInput\n [cdkTextareaAutosize]=\"true\"\n [ngModel]=\"block.default\"\n name=\"default\"\n [validate]=\"validate\"\n placeholder=\"Default\"\n (ngModelChange)=\"blockChangeProperty({ default: $event })\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <ng-container *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText\">\n <mat-form-field class=\"full-width\">\n <textarea\n matInput\n [cdkTextareaAutosize]=\"true\"\n [ngModel]=\"block.formula\"\n name=\"formula\"\n placeholder=\"Formula\"\n (ngModelChange)=\"blockChangeProperty({ formula: $event })\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <ng-template #nameField>\n <mat-form-field class=\"full-width\">\n <input\n matInput\n [ngModel]=\"block.name\"\n name=\"name\"\n placeholder=\"Name\"\n (ngModelChange)=\"blockChangeProperty({ name: $event })\">\n </mat-form-field>\n </ng-template>\n\n <div class=\"form-field-options\">\n <mat-checkbox\n name=\"required\"\n [(ngModel)]=\"block.required\"\n (ngModelChange)=\"blockRequired($event)\">\n Required\n </mat-checkbox>\n\n <mat-checkbox\n name=\"readonly\"\n [(ngModel)]=\"block.readonly\"\n (ngModelChange)=\"blockReadonly($event)\">\n Readonly\n </mat-checkbox>\n </div>\n </div>\n </div>\n </ng-container>\n <ng-container *ngIf=\"block.type === BlockType.Rectangle || block.type === BlockType.Image || block.type === BlockType.Pdf\">\n <div class=\"sidebar-panel typography-panel\">\n <div class=\"sidebar-label\">Typography</div>\n <div class=\"sidebar-row field-gap\">\n <fs-font-picker \n [(ngModel)]=\"block.fontFamily\" \n (ngModelChange)=\"fontChanged($event)\"\n name=\"fontfamily\">\n </fs-font-picker>\n <fs-color-picker-chip\n (changed)=\"fontColorChange($event)\"\n [color]=\"block.fontColor\">\n </fs-color-picker-chip>\n\n <mat-form-field class=\"form-field-padless form-field-prefix font-size\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.fontSize\"\n name=\"fontSize\"\n fsMaskNumber\n scale=\"5\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'fontSize', 1)\"\n (ngModelChange)=\"numberChange($event, 'fontSize')\"\n placeholder=\"Size\">\n <span matPrefix *ngIf=\"block.fontSize\">S</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless form-field-prefix line-height\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.lineHeight\"\n name=\"lineHeight\"\n fsMaskNumber\n scale=\"5\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'lineHeight', 1)\"\n (ngModelChange)=\"numberChange($event, 'lineHeight')\"\n placeholder=\"Line\">\n <span matPrefix *ngIf=\"block.lineHeight\">L</span>\n </mat-form-field>\n\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.bold }\"\n (click)=\"boldClick()\">\n <mat-icon>format_bold</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.italic }\"\n (click)=\"italicClick()\">\n <mat-icon>format_italic</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.underline }\"\n (click)=\"underlineClick()\">\n <mat-icon>format_underline</mat-icon>\n </button>\n </div>\n\n <div class=\"sidebar-row align-row field-gap\">\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.horizontalAlign === 'left' }\"\n (click)=\"horizontalAlignClick('left')\">\n <mat-icon>format_align_left</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.horizontalAlign === 'center' }\"\n (click)=\"horizontalAlignClick('center')\">\n <mat-icon>format_align_center</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.horizontalAlign === 'justify' }\"\n (click)=\"horizontalAlignClick('justify')\">\n <mat-icon>format_align_justify</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.horizontalAlign === 'right' }\"\n (click)=\"horizontalAlignClick('right')\">\n <mat-icon>format_align_right</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.verticalAlign === 'top' }\"\n (click)=\"verticalAlignClick('top')\">\n <mat-icon>vertical_align_top</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.verticalAlign === 'center' }\"\n (click)=\"verticalAlignClick('center')\">\n <mat-icon>vertical_align_center</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.verticalAlign === 'bottom' }\"\n (click)=\"verticalAlignClick('bottom')\">\n <mat-icon>vertical_align_bottom</mat-icon>\n </button>\n </div>\n </div>\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Border</div>\n\n <div class=\"sidebar-row field-gap\">\n <fs-color-picker-chip\n (changed)=\"borderColorChange($event)\"\n [color]=\"block.borderColor\">\n </fs-color-picker-chip>\n\n <mat-form-field class=\"form-field-padless form-field-prefix border-width\" floatLabel=\"never\">\n <input\n matInput\n [(ngModel)]=\"block.borderWidth\"\n name=\"borderWidth\"\n fsMaskNumber\n scale=\"5\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'borderWidth', 1)\"\n (ngModelChange)=\"numberChange($event, 'borderWidth')\"\n placeholder=\"Width\">\n <span matPrefix *ngIf=\"block.borderWidth\">W</span>\n </mat-form-field>\n </div>\n </div>\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Shape</div>\n\n <div class=\"sidebar-row field-gap\">\n <fs-color-picker-chip\n (changed)=\"backgroundColorChange($event)\"\n [color]=\"block.backgroundColor\">\n </fs-color-picker-chip>\n\n <mat-form-field class=\"form-field-padless form-field-prefix shape-radius\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shapeRadius\"\n name=\"shapeRadius\"\n fsMaskNumber\n scale=\"5\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'shapeRadius', 1)\"\n (ngModelChange)=\"numberChange($event, 'shapeRadius')\"\n placeholder=\"Radius\">\n <span matPrefix *ngIf=\"block.shapeRadius\">R</span>\n </mat-form-field>\n\n <div class=\"shape-corners\">\n <div\n class=\"shape-corner shape-corner-top-left\"\n [ngClass]=\"{ round: block.shapeTopLeft === 'round' }\"\n (click)=\"shapeRound('shapeTopLeft')\"></div>\n <div\n class=\"shape-corner shape-corner-top-right\"\n [ngClass]=\"{ round: block.shapeTopRight === 'round' }\"\n (click)=\"shapeRound('shapeTopRight')\"></div>\n <div\n class=\"shape-corner shape-corner-bottom-left\"\n [ngClass]=\"{ round: block.shapeBottomLeft === 'round' }\"\n (click)=\"shapeRound('shapeBottomLeft')\"></div>\n <div\n class=\"shape-corner shape-corner-bottom-right\"\n [ngClass]=\"{ round: block.shapeBottomRight === 'round' }\"\n (click)=\"shapeRound('shapeBottomRight')\"></div>\n </div>\n </div>\n </div>\n <div class=\"sidebar-panel shadow-panel\">\n <div class=\"sidebar-label\">Shadow</div>\n\n <div class=\"sidebar-row field-gap\">\n <fs-color-picker-chip\n (changed)=\"shadowColorChange($event)\"\n [color]=\"block.shadowColor\">\n </fs-color-picker-chip>\n\n <mat-form-field class=\"form-field-padless form-field-prefix shadow-x\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shadowX\"\n name=\"shadowX\"\n fsMaskNumber\n scale=\"5\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'shadowX')\"\n (ngModelChange)=\"numberChange($event, 'shadowX')\">\n <span matPrefix>X</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless form-field-prefix shadow-y\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shadowY\"\n name=\"shadowY\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'shadowY')\"\n (ngModelChange)=\"numberChange($event, 'shadowY')\">\n <span matPrefix>Y</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless form-field-prefix shadow-blur\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shadowBlur\"\n name=\"shadowBlur\"\n placeholder=\"Blur\"\n fsMaskNumber\n scale=\"5\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'shadowBlur')\"\n (ngModelChange)=\"numberChange($event, 'shadowBlur')\">\n <span matPrefix *ngIf=\"block.shadowBlur\">B</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless form-field-prefix shadow-spread\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shadowSpread\"\n name=\"shadowSpread\"\n placeholder=\"Spread\"\n fsMaskNumber\n scale=\"5\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'shadowSpread')\"\n (ngModelChange)=\"numberChange($event, 'shadowSpread')\">\n <span matPrefix *ngIf=\"block.shadowSpread\">S</span>\n </mat-form-field>\n <!-- <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shadowOpacity\"\n name=\"shadowOpacity\"\n placeholder=\"Opacity\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'shadowOpacity')\"\n (ngModelChange)=\"numberChange($event, 'shadowOpacity')\">\n <span matPrefix *ngIf=\"block.shadowOpacity\">O</span>\n </mat-form-field> -->\n </div>\n </div>\n <ng-container *ngIf=\"block.type === BlockType.Rectangle\">\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Image</div>\n <div class=\"sidebar-row image-row\">\n <fs-file (select)=\"blockUpload(block, $event)\">\n <button\n type=\"button\"\n mat-icon-button>\n <mat-icon>cloud_upload</mat-icon>\n </button>\n </fs-file>\n <ng-container *ngIf=\"block.imageUrl\">\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"imageRemove()\">\n <mat-icon>clear</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: clippable }\"\n (click)=\"imageClip()\">\n <mat-icon>crop</mat-icon>\n </button>\n\n <mat-form-field class=\"form-field-padless opacity\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.imageOpacity\"\n fsMaskNumber\n scale=\"5\"\n name=\"imageOpacity\"\n placeholder=\"Opacity\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'imageOpacity', 1)\"\n (ngModelChange)=\"numberChange($event, 'imageOpacity')\">\n <span matPrefix *ngIf=\"block.imageOpacity\">O</span>\n </mat-form-field>\n </ng-container>\n </div>\n </div>\n </ng-container> \n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Padding</div>\n <div class=\"sidebar-row padding-row field-gap\">\n\n <mat-form-field class=\"form-field-padless form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [(ngModel)]=\"block.padding\"\n name=\"padding\"\n fsMaskNumber\n scale=\"5\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"paddingAllChange($event)\"\n (keydown)=\"paddingAllKeypress($event, 1)\"\n placeholder=\"All\">\n <span matPrefix *ngIf=\"block.padding\">A</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingTop\"\n name=\"paddingTop\"\n fsMaskNumber\n scale=\"5\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"paddingKeypress($event, 'paddingTop')\"\n (ngModelChange)=\"numberChange($event, 'paddingTop')\"\n placeholder=\"Top\">\n <span matPrefix *ngIf=\"block.paddingTop\">T</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingBottom\"\n name=\"paddingBottom\"\n fsMaskNumber\n scale=\"5\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"paddingKeypress($event, 'paddingBottom')\"\n (ngModelChange)=\"numberChange($event, 'paddingBottom')\"\n placeholder=\"Bottom\">\n <span matPrefix *ngIf=\"block.paddingBottom\">B</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingLeft\"\n name=\"paddingLeft\"\n fsMaskNumber\n scale=\"5\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"paddingKeypress($event, 'paddingLeft')\"\n (ngModelChange)=\"numberChange($event, 'paddingLeft')\"\n placeholder=\"Left\">\n <span matPrefix *ngIf=\"block.paddingLeft\">L</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless form-field-prefix\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingRight\"\n name=\"paddingRight\"\n fsMaskNumber\n scale=\"5\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"paddingKeypress($event, 'paddingRight')\"\n (ngModelChange)=\"numberChange($event, 'paddingRight')\"\n placeholder=\"Right\">\n <span matPrefix *ngIf=\"block.paddingRight\">R</span>\n </mat-form-field>\n </div>\n </div> \n </ng-container> \n </ng-container>\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Utilities</div>\n <div class=\"sidebar-row padding-row\">\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"exportBlocks()\"\n [matTooltip]=\"'Export blocks'\">\n <mat-icon>download</mat-icon>\n </button>\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"importBlocks()\"\n [matTooltip]=\"'Import blocks'\">\n <mat-icon>upload</mat-icon>\n </button>\n </div>\n </div> \n\n <ng-container *ngFor=\"let sidebarPanel of sidebarPanels\">\n <div div class=\"sidebar-panel\" *ngIf=\"sidebarPanel.show\">\n <div class=\"sidebar-label\">{{sidebarPanel.label}}</div>\n <ng-container\n [ngTemplateOutlet]=\"sidebarPanel.templateRef\"\n [ngTemplateOutletContext]=\"{ block: block }\"></ng-container>\n </div>\n </ng-container>\n </form>\n</div>\n<ng-template #addButton let-blockType=\"blockType\">\n <button\n type=\"button\"\n mat-icon-button\n [matTooltip]=\"'Add ' + blockType.name\"\n (click)=\"blockAdd(blockType.value)\">\n <mat-icon>{{blockType.icon}}</mat-icon>\n </button>\n</ng-template>", styles: [".sidebar{width:320px;font-size:14px;height:100%;overflow:auto;background-color:#fff;padding:0 10px 10px;box-shadow:0 1px 3px 1px #0003;z-index:1;position:relative;box-sizing:border-box}.sidebar form{height:100%}.sidebar .sidebar-row{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center}.sidebar .sidebar-row+.sidebar-row{margin-top:12px}.sidebar .sidebar-row fs-color-picker-chip{margin-left:6px}.sidebar .sidebar-row.padding-row{flex-wrap:unset}.sidebar .sidebar-row.padding-row ::ng-deep .mat-form-field{width:20%;min-width:0}.sidebar .sidebar-row.image-row{margin-bottom:-5px}.sidebar .sidebar-row.image-row .opacity{width:60px;margin-left:10px}.sidebar .sidebar-row ::ng-deep .mat-checkbox,.sidebar .sidebar-row ::ng-deep .mat-form-field{font-size:12px}.sidebar .sidebar-row.field-gap>*:not(.mat-icon-button):not(fs-file){margin-right:11px}.sidebar .sidebar-row.field-gap>*:not(.mat-icon-button):not(fs-file):last-child{margin-right:0}.sidebar .layer-up ::ng-deep .mat-button-wrapper,.sidebar .layer-down ::ng-deep .mat-button-wrapper{position:relative}.sidebar .layer-up ::ng-deep .mat-button-wrapper mat-icon:first-child,.sidebar .layer-down ::ng-deep .mat-button-wrapper mat-icon:first-child{position:absolute;transform:rotate(90deg) scale(.5);top:-7px;color:#fff}.sidebar .layer-down mat-icon:first-child{transform:rotate(270deg) scale(.6)}.sidebar .padding{width:45px}.sidebar .line-height,.sidebar .font-size{width:45px}.sidebar .border-width{width:50px}.sidebar .shape-radius{width:60px}.sidebar .shape-corners{display:grid;grid-template-columns:1fr 1fr;grid-column-gap:1px;column-gap:1px;grid-row-gap:1px;row-gap:1px}.sidebar .shape-corners .shape-corner{height:13px;width:13px;background-color:#ccc;cursor:pointer}.sidebar .shape-corners .shape-corner.round{background-color:#212121}.sidebar .shape-corners .shape-corner.round.shape-corner-top-right{border-top-right-radius:50%}.sidebar .shape-corners .shape-corner.round.shape-corner-top-left{border-top-left-radius:50%}.sidebar .shape-corners .shape-corner.round.shape-corner-bottom-left{border-bottom-left-radius:50%}.sidebar .shape-corners .shape-corner.round.shape-corner-bottom-right{border-bottom-right-radius:50%}.sidebar button.toggle-button:not(.selected) mat-icon{color:#ccc}.sidebar .group-block{width:100%;display:flex;align-items:center}.sidebar .group-block a{margin-left:5px;color:inherit}.sidebar .group-block a mat-icon{transform:scale(.8)}.sidebar .sidebar-panel{padding:10px}.sidebar .sidebar-panel+.sidebar-panel{border-top:1px solid #dadada}.sidebar .sidebar-panel.block-form-panel .sidebar-label{display:flex;align-items:center}.sidebar .sidebar-panel.block-form-panel .sidebar-label mat-icon{transform:scale(.8);color:inherit;margin-left:-5px}.sidebar .sidebar-panel.block-form-panel .form-field-options mat-checkbox{display:block}.sidebar .sidebar-panel.block-form-panel .form-field-options mat-checkbox+mat-checkbox{margin-top:2px}.sidebar .sidebar-panel.info-panel .mat-form-field{width:60px}.sidebar .sidebar-panel.info-panel .mat-form-field.rotate{width:50px}.sidebar .sidebar-panel.shadow-panel .mat-form-field{width:41px}.sidebar .sidebar-panel.shadow-panel .mat-form-field.shadow-x,.sidebar .sidebar-panel.shadow-panel .mat-form-field.shadow-y{width:40px}.sidebar .sidebar-panel.shadow-panel .mat-form-field.shadow-blur{width:50px}.sidebar .sidebar-panel.shadow-panel .mat-form-field.shadow-spread{width:60px}.sidebar .sidebar-panel.typography-panel fs-font-picker{width:100%}.sidebar .sidebar-panel.typography-panel .style-row{margin-bottom:-10px}.sidebar .sidebar-panel.typography-panel .align-row{margin-bottom:-5px}.sidebar .sidebar-panel.typography-panel .align-row .mat-icon-button{width:35px;height:35px;line-height:35px}.sidebar .sidebar-panel .sidebar-label{font-size:11px;margin-bottom:7px;color:#9e9e9e}.sidebar .sidebar-panel .keep-ratio{color:inherit;transform:scale(.85);display:block}.full-width{width:100%}:host ::ng-deep .mat-form-field-appearance-outline.form-field-prefix .mat-form-field-suffix,:host ::ng-deep .mat-form-field-appearance-outline.form-field-prefix .mat-form-field-prefix{top:0}:host ::ng-deep .mat-form-field-prefix{color:#9e9e9e;margin-right:3px;font-size:85%}\n"], components: [{ type: i6__namespace$1.FsFileComponent, selector: "fs-file", inputs: ["minHeight", "minWidth", "orientate", "multiple", "capture", "allowClick", "allowDrop", "accept", "disabled", "imageWidth", "imageHeight", "imageQuality"], outputs: ["select", "error", "clicked", "declined"] }, { type: i4__namespace.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i3__namespace.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i9__namespace.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i10__namespace.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i11__namespace.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i12__namespace.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "id", "labelPosition", "name", "required", "checked", "disabled", "indeterminate", "aria-describedby", "value"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: i2__namespace$1.FsFontPickerComponent, selector: "fs-font-picker" }, { type: i14__namespace.FsColorPickerChipComponent, selector: "fs-color-picker-chip", inputs: ["color", "showClear"], outputs: ["changed"] }], directives: [{ type: i5__namespace.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i5__namespace.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i5__namespace.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i6__namespace.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"] }, { type: i17__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i17__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i17__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i17__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i17__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i17__namespace.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i18__namespace.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i7__namespace.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i5__namespace.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i20__namespace.FsMaskNumberDirective, selector: "[fsMaskNumber]" }, { type: i5__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5__namespace.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i6__namespace.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { type: i9__namespace.MatPrefix, selector: "[matPrefix]" }, { type: i9__namespace.MatLabel, selector: "mat-label" }, { type: i8__namespace.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { type: i6__namespace.FsFormValidateDirective, selector: "[validate]", inputs: ["validate", "validateData", "validateOnSubmit"] }, { type: i17__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
1956
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SidebarComponent, decorators: [{
1957
- type: i0.Component,
1958
- args: [{
1959
- selector: 'sidebar',
1960
- templateUrl: './sidebar.component.html',
1961
- styleUrls: ['./sidebar.component.scss'],
1962
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
1963
- }]
1964
- }], ctorParameters: function () {
1965
- return [{ type: i0__namespace.ElementRef }, { type: BlockEditorService }, { type: i0__namespace.ChangeDetectorRef }, { type: i2__namespace$2.FsClipboard }, { type: i3__namespace$2.FsMessage }, { type: i3__namespace$1.FsPrompt }, { type: i1__namespace.MatDialog }, { type: undefined, decorators: [{
1966
- type: i0.Inject,
1967
- args: [i17.DOCUMENT]
1968
- }] }];
1969
- }, propDecorators: { sidebarPanels: [{
1970
- type: i0.ContentChildren,
1971
- args: [FsBlockEditorSidebarPanelDirective]
1972
- }], config: [{
1973
- type: i0.Input
1974
- }], blocks: [{
1975
- type: i0.Input
1976
- }], zoompan: [{
1977
- type: i0.Input
1978
- }], zoomCenter: [{
1979
- type: i0.Output
1980
- }] } });
1981
-
1982
- var ArtboardComponent = /** @class */ (function () {
1983
- function ArtboardComponent(_el, _blockEditor, _cdRef) {
1984
- this._el = _el;
1985
- this._blockEditor = _blockEditor;
1986
- this._cdRef = _cdRef;
1987
- this.blocks = [];
1988
- this._destroy$ = new rxjs.Subject();
1989
- }
1990
- Object.defineProperty(ArtboardComponent.prototype, "el", {
1991
- get: function () {
1992
- return this._el.nativeElement;
1993
- },
1994
- enumerable: false,
1995
- configurable: true
1996
- });
1997
- ArtboardComponent.prototype.ngOnInit = function () {
1998
- var _this = this;
1999
- this.config = Object.assign(Object.assign({}, this.config), { unit: 'in' });
2000
- this._blockEditor.registerContainer(this.artboard.nativeElement);
2001
- this._blockEditor.registerMargin(this.marginContainer.nativeElement);
2002
- this._blockEditor.blocks$
2003
- .pipe(operators.takeUntil(this._destroy$))
2004
- .subscribe(function (blocks) {
2005
- _this.blocks = blocks;
2006
- _this._cdRef.markForCheck();
2007
- });
2008
- this._blockEditor.blockAdded$
2009
- .pipe(operators.delay(300), operators.takeUntil(this._destroy$))
2010
- .subscribe(function (block) {
2011
- _this._blockEditor.selectedBlocks = [block];
2012
- _this._cdRef.markForCheck();
2013
- });
2014
- };
2015
- ArtboardComponent.prototype.ngAfterViewInit = function () {
2016
- var _this = this;
2017
- this.blockComponents
2018
- .changes
2019
- .pipe(operators.takeUntil(this._destroy$))
2020
- .subscribe(function () {
2021
- _this._blockEditor.blockComponents = _this.blockComponents.toArray();
2022
- });
2023
- this._blockEditor.blockComponents = this.blockComponents.toArray();
2024
- };
2025
- ArtboardComponent.prototype.ngOnDestroy = function () {
2026
- this._destroy$.next();
2027
- this._destroy$.complete();
2028
- };
2029
- return ArtboardComponent;
2030
- }());
2031
- ArtboardComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ArtboardComponent, deps: [{ token: i0__namespace.ElementRef }, { token: BlockEditorService }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
2032
- ArtboardComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ArtboardComponent, selector: "app-artboard", inputs: { config: "config", zoompan: "zoompan" }, queries: [{ propertyName: "sidebarPanels", predicate: FsBlockEditorSidebarPanelDirective }], viewQueries: [{ propertyName: "artboard", first: true, predicate: ["artboard"], descendants: true, static: true }, { propertyName: "marginContainer", first: true, predicate: ["marginContainer"], descendants: true, static: true }, { propertyName: "sidebar", first: true, predicate: SidebarComponent, descendants: true, static: true }, { propertyName: "blockComponents", predicate: FsBlockComponent, descendants: true }, { propertyName: "margins", predicate: FsBlockEditorMarginDirective, descendants: true }], ngImport: i0__namespace, template: "<div\n #artboard\n class=\"artboard mat-elevation-z4 deselectable\"\n [style.width]=\"config.width + config.unit\"\n [style.height]=\"config.height + config.unit\">\n <fs-block\n *ngFor=\"let block of blocks\"\n [zoompan]=\"zoompan\"\n [block]=\"block\">\n </fs-block>\n <div class=\"margin margin-top\" *ngIf=\"config.marginTop\" [style.top]=\"config.marginTop + 'in'\"></div>\n <div class=\"margin margin-left\" *ngIf=\"config.marginLeft\" [style.left]=\"config.marginLeft + 'in'\"></div>\n <div class=\"margin margin-bottom\" *ngIf=\"config.marginBottom\" [style.bottom]=\"config.marginBottom + 'in'\"></div>\n <div class=\"margin margin-right\" *ngIf=\"config.marginRight\" [style.right]=\"config.marginRight + 'in'\"></div>\n <div\n #marginContainer\n class=\"margin-container\"\n [style.top]=\"config.marginTop + 'in'\"\n [style.right]=\"config.marginRight + 'in'\"\n [style.bottom]=\"config.marginBottom + 'in'\"\n [style.left]=\"config.marginLeft + 'in'\">\n </div>\n</div> \n\n", styles: [".artboard{position:relative;display:inline-flex;background-color:#fff}.artboard .margin-container{position:absolute;z-index:-1}.artboard .margin{position:absolute;border-color:#ff85bd5e;border-style:dashed;border-width:0px}.artboard .margin.margin-top,.artboard .margin.margin-bottom{width:100%;border-top-width:1px}.artboard .margin.margin-left,.artboard .margin.margin-right{height:100%;border-left-width:1px}\n"], components: [{ type: FsBlockComponent, selector: "fs-block", inputs: ["block", "html", "zoompan"] }], directives: [{ type: i17__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i17__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
2033
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ArtboardComponent, decorators: [{
2034
- type: i0.Component,
2035
- args: [{
2036
- selector: 'app-artboard',
2037
- templateUrl: 'artboard.component.html',
2038
- styleUrls: ['artboard.component.scss'],
2039
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
2040
- }]
2041
- }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: BlockEditorService }, { type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { sidebarPanels: [{
2042
- type: i0.ContentChildren,
2043
- args: [FsBlockEditorSidebarPanelDirective]
2044
- }], blockComponents: [{
2045
- type: i0.ViewChildren,
2046
- args: [FsBlockComponent]
2047
- }], artboard: [{
2048
- type: i0.ViewChild,
2049
- args: ['artboard', { static: true }]
2050
- }], marginContainer: [{
2051
- type: i0.ViewChild,
2052
- args: ['marginContainer', { static: true }]
2053
- }], margins: [{
2054
- type: i0.ViewChildren,
2055
- args: [FsBlockEditorMarginDirective]
2056
- }], sidebar: [{
2057
- type: i0.ViewChild,
2058
- args: [SidebarComponent, { static: true }]
2059
- }], config: [{
2060
- type: i0.Input
2061
- }], zoompan: [{
2062
- type: i0.Input
2063
- }] } });
2064
-
2065
- var FsBlockEditorComponent = /** @class */ (function () {
2066
- function FsBlockEditorComponent(_el, _blockEditor) {
2067
- this._el = _el;
2068
- this._blockEditor = _blockEditor;
2069
- this._destroy$ = new rxjs.Subject();
2070
- }
2071
- Object.defineProperty(FsBlockEditorComponent.prototype, "el", {
2072
- get: function () {
2073
- return this._el.nativeElement;
2074
- },
2075
- enumerable: false,
2076
- configurable: true
2077
- });
2078
- FsBlockEditorComponent.prototype.ngOnInit = function () {
2079
- var _this = this;
2080
- this.config = Object.assign(Object.assign({}, this.config), { unit: 'in' });
2081
- this._blockEditor.init(this.config);
2082
- this._blockEditor.blocks$
2083
- .pipe(operators.takeUntil(this._destroy$))
2084
- .subscribe(function (blocks) {
2085
- _this.blocks = blocks;
2086
- });
2087
- setTimeout(function () {
2088
- _this.zoomCenter();
2089
- });
2090
- };
2091
- FsBlockEditorComponent.prototype.zoomCenter = function () {
2092
- this.zoompan.center(this.artboard.nativeElement, { vertical: false });
2093
- };
2094
- FsBlockEditorComponent.prototype.editorContainerClick = function (event) {
2095
- if (event.target.classList.contains('deselectable') ||
2096
- event.target.classList.contains('fs-zoom-pan-container')) {
2097
- this.zoompan.enable();
2098
- this._blockEditor.selectedBlocks = [];
2099
- }
2100
- };
2101
- FsBlockEditorComponent.prototype.ngOnDestroy = function () {
2102
- this._destroy$.next();
2103
- this._destroy$.complete();
2104
- };
2105
- return FsBlockEditorComponent;
2106
- }());
2107
- FsBlockEditorComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockEditorComponent, deps: [{ token: i0__namespace.ElementRef }, { token: BlockEditorService }], target: i0__namespace.ɵɵFactoryTarget.Component });
2108
- FsBlockEditorComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsBlockEditorComponent, selector: "fs-block-editor", inputs: { config: "config" }, providers: [
2109
- BlockEditorService,
2110
- BlocksStore,
2111
- ], queries: [{ propertyName: "sidebarPanels", predicate: FsBlockEditorSidebarPanelDirective }], viewQueries: [{ propertyName: "zoompan", first: true, predicate: i2$3.FsZoomPanComponent, descendants: true, static: true }, { propertyName: "artboardContainer", first: true, predicate: ["artboardContainer"], descendants: true, static: true }, { propertyName: "sidebar", first: true, predicate: SidebarComponent, descendants: true, static: true }, { propertyName: "artboard", first: true, predicate: ArtboardComponent, descendants: true, read: i0.ElementRef }], ngImport: i0__namespace, template: "<div \n class=\"editor-container deselectable\"\n (mousedown)=\"editorContainerClick($event)\">\n <div\n #artboardContainer\n class=\"artboard-container deselectable\">\n <div #zoomPanContaner class=\"zoom-pan-container deselectable\">\n <fs-zoom-pan \n class=\"deselectable\"\n [zoomMax]=\"5\"\n [top]=\"10\">\n <ng-template fsZoomPanContent>\n <app-artboard \n [zoompan]=\"zoompan\"\n [config]=\"config\">\n </app-artboard>\n </ng-template>\n </fs-zoom-pan>\n </div>\n </div>\n <sidebar\n [config]=\"config\"\n [blocks]=\"blocks\"\n (zoomCenter)=\"zoomCenter()\">\n </sidebar>\n</div>\n", styles: [".editor-container{display:flex;flex-direction:row;position:relative;height:100%;background:#d8d8d8;overflow:hidden}.editor-container .artboard-container{display:flex;flex-grow:1;min-width:0;border:1px solid #ececec}.editor-container .zoom-pan-container{flex:1}fs-zoom-pan{height:100%}\n"], components: [{ type: i2__namespace$3.FsZoomPanComponent, selector: "fs-zoom-pan", inputs: ["zoomMax", "zoomMin", "zoomDefault", "top", "left"], outputs: ["moved", "zoomed"] }, { type: ArtboardComponent, selector: "app-artboard", inputs: ["config", "zoompan"] }, { type: SidebarComponent, selector: "sidebar", inputs: ["config", "blocks", "zoompan"], outputs: ["zoomCenter"] }], directives: [{ type: i2__namespace$3.FsZoomPanContentDirective, selector: "[fsZoomPanContent]" }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
2112
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockEditorComponent, decorators: [{
2113
- type: i0.Component,
2114
- args: [{
2115
- selector: 'fs-block-editor',
2116
- templateUrl: './block-editor.component.html',
2117
- styleUrls: ['./block-editor.component.scss'],
2118
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
2119
- providers: [
2120
- BlockEditorService,
2121
- BlocksStore,
2122
- ],
2123
- }]
2124
- }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: BlockEditorService }]; }, propDecorators: { sidebarPanels: [{
2125
- type: i0.ContentChildren,
2126
- args: [FsBlockEditorSidebarPanelDirective]
2127
- }], zoompan: [{
2128
- type: i0.ViewChild,
2129
- args: [i2$3.FsZoomPanComponent, { static: true }]
2130
- }], artboardContainer: [{
2131
- type: i0.ViewChild,
2132
- args: ['artboardContainer', { static: true }]
2133
- }], sidebar: [{
2134
- type: i0.ViewChild,
2135
- args: [SidebarComponent, { static: true }]
2136
- }], artboard: [{
2137
- type: i0.ViewChild,
2138
- args: [ArtboardComponent, { read: i0.ElementRef }]
2139
- }], config: [{
2140
- type: i0.Input
2141
- }] } });
2142
-
2143
- var FsBlockEditorModule = /** @class */ (function () {
2144
- function FsBlockEditorModule() {
2145
- }
2146
- FsBlockEditorModule.forRoot = function () {
2147
- return {
2148
- ngModule: FsBlockEditorModule,
2149
- };
2150
- };
2151
- return FsBlockEditorModule;
2152
- }());
2153
- FsBlockEditorModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockEditorModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
2154
- FsBlockEditorModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockEditorModule, declarations: [FsBlockComponent,
2155
- FsBlockEditorComponent,
2156
- FsBlockEditorSidebarPanelDirective,
2157
- FsBlockEditorMarginDirective,
2158
- SidebarComponent,
2159
- ArtboardComponent,
2160
- LayersReorderDialogComponent,
2161
- CreateImageUrlPipe,
2162
- GroupDialogComponent], imports: [i17.CommonModule,
2163
- i5.FormsModule,
2164
- i7$1.DragDropModule,
2165
- i3.MatIconModule,
2166
- i4.MatButtonModule,
2167
- i7.MatInputModule,
2168
- i9.MatFormFieldModule,
2169
- i12.MatCheckboxModule,
2170
- i18.MatTooltipModule,
2171
- i10.MatSelectModule,
2172
- i4$1.MatListModule,
2173
- i6$1.FsFileModule,
2174
- i14.FsColorPickerModule,
2175
- menu.FsMenuModule,
2176
- i2$3.FsZoomPanModule,
2177
- i6.FsFormModule,
2178
- i20.FsMaskModule,
2179
- i2$1.FsFontPickerModule,
2180
- autocomplete.FsAutocompleteModule,
2181
- i2.FsDialogModule], exports: [FsBlockComponent,
2182
- FsBlockEditorComponent,
2183
- FsBlockEditorSidebarPanelDirective] });
2184
- FsBlockEditorModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockEditorModule, imports: [[
2185
- i17.CommonModule,
2186
- i5.FormsModule,
2187
- i7$1.DragDropModule,
2188
- i3.MatIconModule,
2189
- i4.MatButtonModule,
2190
- i7.MatInputModule,
2191
- i9.MatFormFieldModule,
2192
- i12.MatCheckboxModule,
2193
- i18.MatTooltipModule,
2194
- i10.MatSelectModule,
2195
- i4$1.MatListModule,
2196
- i6$1.FsFileModule,
2197
- i14.FsColorPickerModule,
2198
- menu.FsMenuModule,
2199
- i2$3.FsZoomPanModule,
2200
- i6.FsFormModule,
2201
- i20.FsMaskModule,
2202
- i2$1.FsFontPickerModule,
2203
- autocomplete.FsAutocompleteModule,
2204
- i2.FsDialogModule,
2205
- ]] });
2206
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockEditorModule, decorators: [{
2207
- type: i0.NgModule,
2208
- args: [{
2209
- imports: [
2210
- i17.CommonModule,
2211
- i5.FormsModule,
2212
- i7$1.DragDropModule,
2213
- i3.MatIconModule,
2214
- i4.MatButtonModule,
2215
- i7.MatInputModule,
2216
- i9.MatFormFieldModule,
2217
- i12.MatCheckboxModule,
2218
- i18.MatTooltipModule,
2219
- i10.MatSelectModule,
2220
- i4$1.MatListModule,
2221
- i6$1.FsFileModule,
2222
- i14.FsColorPickerModule,
2223
- menu.FsMenuModule,
2224
- i2$3.FsZoomPanModule,
2225
- i6.FsFormModule,
2226
- i20.FsMaskModule,
2227
- i2$1.FsFontPickerModule,
2228
- autocomplete.FsAutocompleteModule,
2229
- i2.FsDialogModule,
2230
- ],
2231
- exports: [
2232
- FsBlockComponent,
2233
- FsBlockEditorComponent,
2234
- FsBlockEditorSidebarPanelDirective,
2235
- ],
2236
- declarations: [
2237
- FsBlockComponent,
2238
- FsBlockEditorComponent,
2239
- FsBlockEditorSidebarPanelDirective,
2240
- FsBlockEditorMarginDirective,
2241
- SidebarComponent,
2242
- ArtboardComponent,
2243
- LayersReorderDialogComponent,
2244
- CreateImageUrlPipe,
2245
- GroupDialogComponent,
2246
- ],
2247
- }]
2248
- }] });
2249
-
2250
- /**
2251
- * Generated bundle index. Do not edit.
2252
- */
2253
-
2254
- exports.BlockTypes = BlockTypes;
2255
- exports.FsBlockComponent = FsBlockComponent;
2256
- exports.FsBlockEditorComponent = FsBlockEditorComponent;
2257
- exports.FsBlockEditorModule = FsBlockEditorModule;
2258
- exports.FsBlockEditorSidebarPanelDirective = FsBlockEditorSidebarPanelDirective;
2259
-
2260
- Object.defineProperty(exports, '__esModule', { value: true });
2261
-
2262
- }));
2263
- //# sourceMappingURL=firestitch-block-editor.umd.js.map