@firestitch/block-editor 12.2.0 → 12.2.1

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