@firestitch/block-editor 12.3.16 → 12.3.18

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