@firestitch/block-editor 9.0.11 → 12.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/app/components/block/block.component.d.ts +78 -75
  2. package/app/components/block-editor/block-editor.component.d.ts +37 -34
  3. package/app/components/sidebar/sidebar.component.d.ts +61 -58
  4. package/app/directives/block-editor-margin.directive.d.ts +9 -6
  5. package/app/directives/block-editor-sidebar-panel.directive.d.ts +10 -7
  6. package/app/fs-block-editor.module.d.ts +22 -4
  7. package/app/interfaces/block-editor-config.d.ts +18 -18
  8. package/app/interfaces/block.d.ts +37 -37
  9. package/app/services/block-editor.service.d.ts +36 -33
  10. package/bundles/firestitch-block-editor.umd.js +1491 -1377
  11. package/bundles/firestitch-block-editor.umd.js.map +1 -1
  12. package/esm2015/app/components/block/block.component.js +370 -384
  13. package/esm2015/app/components/block-editor/block-editor.component.js +141 -156
  14. package/esm2015/app/components/sidebar/sidebar.component.js +299 -303
  15. package/esm2015/app/directives/block-editor-margin.directive.js +19 -21
  16. package/esm2015/app/directives/block-editor-sidebar-panel.directive.js +21 -27
  17. package/esm2015/app/fs-block-editor.module.js +79 -53
  18. package/esm2015/app/interfaces/block-editor-config.js +2 -1
  19. package/esm2015/app/interfaces/block.js +2 -1
  20. package/esm2015/app/services/block-editor.service.js +99 -99
  21. package/esm2015/firestitch-block-editor.js +5 -8
  22. package/esm2015/public_api.js +8 -8
  23. package/fesm2015/firestitch-block-editor.js +975 -990
  24. package/fesm2015/firestitch-block-editor.js.map +1 -1
  25. package/firestitch-block-editor.d.ts +5 -7
  26. package/package.json +7 -10
  27. package/public_api.d.ts +6 -6
  28. package/bundles/firestitch-block-editor.umd.min.js +0 -2
  29. package/bundles/firestitch-block-editor.umd.min.js.map +0 -1
  30. package/esm5/app/components/block/block.component.js +0 -498
  31. package/esm5/app/components/block-editor/block-editor.component.js +0 -163
  32. package/esm5/app/components/sidebar/sidebar.component.js +0 -329
  33. package/esm5/app/directives/block-editor-margin.directive.js +0 -26
  34. package/esm5/app/directives/block-editor-sidebar-panel.directive.js +0 -28
  35. package/esm5/app/fs-block-editor.module.js +0 -57
  36. package/esm5/app/interfaces/block-editor-config.js +0 -1
  37. package/esm5/app/interfaces/block.js +0 -1
  38. package/esm5/app/services/block-editor.service.js +0 -124
  39. package/esm5/firestitch-block-editor.js +0 -8
  40. package/esm5/public_api.js +0 -8
  41. package/fesm5/firestitch-block-editor.js +0 -1198
  42. package/fesm5/firestitch-block-editor.js.map +0 -1
  43. package/firestitch-block-editor.metadata.json +0 -1
@@ -1,1016 +1,1001 @@
1
- import { __decorate, __metadata } from 'tslib';
1
+ import * as i9 from '@angular/forms';
2
2
  import { FormsModule } from '@angular/forms';
3
+ import * as i8 from '@angular/material/input';
3
4
  import { MatInputModule } from '@angular/material/input';
4
- import { Injectable, EventEmitter, ElementRef, ChangeDetectorRef, ViewChild, Input, Output, Component, ChangeDetectionStrategy, TemplateRef, Directive, ContentChildren, QueryList, IterableDiffers, ViewChildren, NgModule } from '@angular/core';
5
+ import * as i0 from '@angular/core';
6
+ import { Injectable, EventEmitter, Component, ChangeDetectionStrategy, ViewChild, Input, Output, Directive, ContentChildren, ViewChildren, NgModule } from '@angular/core';
7
+ import * as i7 from '@angular/common';
5
8
  import { CommonModule } from '@angular/common';
9
+ import * as i2 from '@angular/material/button';
6
10
  import { MatButtonModule } from '@angular/material/button';
11
+ import * as i4 from '@angular/material/form-field';
7
12
  import { MatFormFieldModule } from '@angular/material/form-field';
13
+ import * as i3 from '@angular/material/icon';
8
14
  import { MatIconModule } from '@angular/material/icon';
9
15
  import { FsHtmlEditorComponent, FsHtmlEditorModule } from '@firestitch/html-editor';
16
+ import * as i5 from '@firestitch/colorpicker';
10
17
  import { FsColorPickerModule } from '@firestitch/colorpicker';
18
+ import * as i6 from '@firestitch/file';
11
19
  import { FsFileModule } from '@firestitch/file';
12
20
  import { takeUntil, filter, take } from 'rxjs/operators';
13
21
  import Moveable from 'moveable';
14
22
  import { BehaviorSubject, Subject, fromEvent } from 'rxjs';
15
23
  import { guid } from '@firestitch/common';
16
24
 
17
- let BlockEditorService = class BlockEditorService {
18
- constructor() {
19
- this.blockComponents = [];
20
- this._blocks$ = new BehaviorSubject([]);
21
- this._selectedBlockComponents$ = new BehaviorSubject([]);
22
- }
23
- get elementGuidelines() {
24
- return [
25
- ...this.blockComponents.map((block) => {
26
- return block.el;
27
- }),
28
- this.container,
29
- this.margin,
30
- ];
31
- }
32
- addBlock(block) {
33
- this.blocks$.next([...this.blocks, this.sanitizeBlock(block)]);
34
- }
35
- removeBlock(block) {
36
- const index = this.indexOf(block);
37
- if (index !== -1) {
38
- this.blocks.splice(index, 1);
39
- this.blocks$.next(this.blocks);
40
- }
41
- }
42
- get blocks$() {
43
- return this._blocks$;
44
- }
45
- get blocks() {
46
- return this.blocks$.getValue();
47
- }
48
- set blocks(blocks) {
49
- this._blocks$.next(blocks);
50
- }
51
- isSelectedBlock(block) {
52
- return this.selectedBlockComponents.indexOf(block) !== -1;
53
- }
54
- indexOf(block) {
55
- return this.blocks.map((e) => e.reference).indexOf(block.reference);
56
- }
57
- set selectedBlockComponents(blocks) {
58
- this.blockComponents.forEach((block) => {
59
- block.editable = false;
60
- block.transformable = blocks.indexOf(block) !== -1;
61
- });
62
- this._selectedBlockComponents$.next(blocks);
63
- }
64
- get selectedBlockComponents() {
65
- return this._selectedBlockComponents$.getValue();
66
- }
67
- get selectedBlocks() {
68
- return this.selectedBlockComponents.map((blockComponent) => blockComponent.block);
69
- }
70
- get selectedBlockComponents$() {
71
- return this._selectedBlockComponents$;
72
- }
73
- saveSelection() {
74
- const selection = window.getSelection();
75
- this._selectionRange = selection.getRangeAt(0);
76
- }
77
- restoreSelection() {
78
- if (this._selectionRange) {
79
- const selection = window.getSelection();
80
- selection.removeAllRanges();
81
- selection.addRange(this._selectionRange);
82
- }
83
- }
84
- hasSelectionRange() {
85
- return this._selectionRange && (this._selectionRange.baseOffset - this._selectionRange.focusOffset) > 0;
86
- }
87
- registerBlock(block) {
88
- this.blockComponents.push(block);
89
- this.blockComponents.forEach((item) => {
90
- const blocks = this.elementGuidelines
91
- .filter((el) => {
92
- return !el.isSameNode(item.el);
93
- });
94
- item.elementGuidelines = blocks;
95
- });
96
- }
97
- registerContainer(container) {
98
- this.container = container;
99
- }
100
- registerMargin(margin) {
101
- this.margin = margin;
102
- }
103
- sanitizeBlock(block) {
104
- return Object.assign({ shapeBottomLeft: 'round', shapeTopLeft: 'round', shapeTopRight: 'round', shapeBottomRight: 'round', verticalAlign: 'top', horizontalAlign: 'left' }, block);
105
- }
106
- };
107
- BlockEditorService = __decorate([
108
- Injectable(),
109
- __metadata("design:paramtypes", [])
110
- ], BlockEditorService);
25
+ class BlockEditorService {
26
+ constructor() {
27
+ this.blockComponents = [];
28
+ this._blocks$ = new BehaviorSubject([]);
29
+ this._selectedBlockComponents$ = new BehaviorSubject([]);
30
+ }
31
+ get elementGuidelines() {
32
+ return [
33
+ ...this.blockComponents.map((block) => {
34
+ return block.el;
35
+ }),
36
+ this.container,
37
+ this.margin,
38
+ ];
39
+ }
40
+ addBlock(block) {
41
+ this.blocks$.next([...this.blocks, this.sanitizeBlock(block)]);
42
+ }
43
+ removeBlock(block) {
44
+ const index = this.indexOf(block);
45
+ if (index !== -1) {
46
+ this.blocks.splice(index, 1);
47
+ this.blocks$.next(this.blocks);
48
+ }
49
+ }
50
+ get blocks$() {
51
+ return this._blocks$;
52
+ }
53
+ get blocks() {
54
+ return this.blocks$.getValue();
55
+ }
56
+ set blocks(blocks) {
57
+ this._blocks$.next(blocks);
58
+ }
59
+ isSelectedBlock(block) {
60
+ return this.selectedBlockComponents.indexOf(block) !== -1;
61
+ }
62
+ indexOf(block) {
63
+ return this.blocks.map((e) => e.reference).indexOf(block.reference);
64
+ }
65
+ set selectedBlockComponents(blocks) {
66
+ this.blockComponents.forEach((block) => {
67
+ block.editable = false;
68
+ block.transformable = blocks.indexOf(block) !== -1;
69
+ });
70
+ this._selectedBlockComponents$.next(blocks);
71
+ }
72
+ get selectedBlockComponents() {
73
+ return this._selectedBlockComponents$.getValue();
74
+ }
75
+ get selectedBlocks() {
76
+ return this.selectedBlockComponents.map((blockComponent) => blockComponent.block);
77
+ }
78
+ get selectedBlockComponents$() {
79
+ return this._selectedBlockComponents$;
80
+ }
81
+ saveSelection() {
82
+ const selection = window.getSelection();
83
+ this._selectionRange = selection.getRangeAt(0);
84
+ }
85
+ restoreSelection() {
86
+ if (this._selectionRange) {
87
+ const selection = window.getSelection();
88
+ selection.removeAllRanges();
89
+ selection.addRange(this._selectionRange);
90
+ }
91
+ }
92
+ hasSelectionRange() {
93
+ return this._selectionRange && (this._selectionRange.baseOffset - this._selectionRange.focusOffset) > 0;
94
+ }
95
+ registerBlock(block) {
96
+ this.blockComponents.push(block);
97
+ this.blockComponents.forEach((item) => {
98
+ const blocks = this.elementGuidelines
99
+ .filter((el) => {
100
+ return !el.isSameNode(item.el);
101
+ });
102
+ item.elementGuidelines = blocks;
103
+ });
104
+ }
105
+ registerContainer(container) {
106
+ this.container = container;
107
+ }
108
+ registerMargin(margin) {
109
+ this.margin = margin;
110
+ }
111
+ sanitizeBlock(block) {
112
+ return Object.assign({ shapeBottomLeft: 'round', shapeTopLeft: 'round', shapeTopRight: 'round', shapeBottomRight: 'round', verticalAlign: 'top', horizontalAlign: 'left' }, block);
113
+ }
114
+ }
115
+ BlockEditorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BlockEditorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
116
+ BlockEditorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BlockEditorService });
117
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BlockEditorService, decorators: [{
118
+ type: Injectable
119
+ }], ctorParameters: function () { return []; } });
111
120
 
112
- let FsBlockComponent = class FsBlockComponent {
113
- constructor(_service, _elementRef, _cdRef) {
114
- this._service = _service;
115
- this._elementRef = _elementRef;
116
- this._cdRef = _cdRef;
117
- this.changed = new EventEmitter();
118
- this.htmlConfig = {};
119
- this._editable = false;
120
- this._selectedElements = [];
121
- this._destroy$ = new Subject();
122
- }
123
- get el() {
124
- return this.element.nativeElement;
125
- }
126
- get moveable() {
127
- return this._moveable;
128
- }
129
- get editable() {
130
- return this._editable;
131
- }
132
- set elementGuidelines(value) {
133
- this._moveable.elementGuidelines = value;
134
- }
135
- set editable(value) {
136
- this._editable = value;
137
- if (!value) {
138
- this.deselectContent();
139
- }
140
- }
141
- set clippable(value) {
142
- this._moveable.clippable = value;
143
- }
144
- get transformable() {
145
- return this._transformable;
146
- }
147
- set transformable(value) {
148
- this._transformable = value;
149
- this.moveable.draggable = value;
150
- this.moveable.resizable = value;
151
- this.moveable.draggable = value;
152
- this.moveable.roundable = value;
153
- this.moveable.rotatable = value;
154
- }
155
- set lineHeight(value) {
156
- this.block.lineHeight = value;
157
- this._triggerChanged();
158
- }
159
- set borderWidth(value) {
160
- this.block.borderWidth = value;
161
- this._triggerChanged();
162
- }
163
- set fontSize(value) {
164
- this.block.fontSize = value;
165
- this._triggerChanged();
166
- }
167
- set backgroundColor(value) {
168
- this.block.backgroundColor = value;
169
- this._triggerChanged();
170
- }
171
- set width(value) {
172
- this.block.width = parseFloat(value);
173
- this.element.nativeElement.style.width = `${this.block.width}${this.unit}`;
174
- this._moveable.updateRect();
175
- this._triggerChanged();
176
- }
177
- set height(value) {
178
- this.block.height = parseFloat(value);
179
- this.element.nativeElement.style.height = `${this.block.height}${this.unit}`;
180
- this._moveable.updateRect();
181
- this._triggerChanged();
182
- }
183
- set top(value) {
184
- this.block.top = parseFloat(value);
185
- this.element.nativeElement.style.top = `${this.block.top}${this.unit}`;
186
- this._moveable.updateRect();
187
- this._triggerChanged();
188
- }
189
- set left(value) {
190
- this.block.left = parseFloat(value);
191
- this.element.nativeElement.style.left = `${this.block.left}${this.unit}`;
192
- this._moveable.updateRect();
193
- this._triggerChanged();
194
- }
195
- set rotate(value) {
196
- this.block.rotate = parseFloat(value);
197
- this._moveable.request('rotatable', { rotate: this.block.rotate }, true);
198
- this._triggerChanged();
199
- }
200
- set shapeRadius(value) {
201
- this.block.shapeRadius = value;
202
- this._triggerChanged();
203
- }
204
- set index(value) {
205
- this.block.index = value;
206
- }
207
- set borderColor(value) {
208
- this.block.borderColor = value;
209
- this._triggerChanged();
210
- }
211
- set paddingAll(value) {
212
- this.block.padding = value;
213
- this.block.paddingTop = null;
214
- this.block.paddingBottom = null;
215
- this.block.paddingLeft = null;
216
- this.block.paddingRight = null;
217
- this._triggerChanged();
218
- }
219
- padding(name, value) {
220
- this.block[name] = value;
221
- this.block.padding = null;
222
- this._triggerChanged();
223
- }
224
- set imageUrl(value) {
225
- this.block.imageUrl = value;
226
- this._triggerChanged();
227
- }
228
- set fontColor(value) {
229
- this.block.fontColor = value;
230
- this._triggerChanged();
231
- }
232
- set verticalAlign(value) {
233
- this.block.verticalAlign = value;
234
- this._triggerChanged();
235
- }
236
- shapeRound(name, value) {
237
- this.block[name] = value;
238
- this._triggerChanged();
239
- }
240
- set horizontalAlign(value) {
241
- this.block.horizontalAlign = value;
242
- this._triggerChanged();
243
- }
244
- set italic(value) {
245
- this.block.italic = value;
246
- this._triggerChanged();
247
- }
248
- get italic() {
249
- return this.block.italic;
250
- }
251
- set bold(value) {
252
- this.block.bold = value;
253
- this._triggerChanged();
254
- }
255
- get bold() {
256
- return this.block.bold;
257
- }
258
- set underline(value) {
259
- this.block.underline = value;
260
- this._triggerChanged();
261
- }
262
- get underline() {
263
- return this.block.underline;
264
- }
265
- updateRect() {
266
- this.moveable.updateRect();
267
- }
268
- markForCheck() {
269
- this._cdRef.markForCheck();
270
- }
271
- ngOnInit() {
272
- this.block = this._service.sanitizeBlock(this.block);
273
- this.unit = this._service.config.unit;
274
- this.content = this.block.content;
275
- this.htmlConfig = {
276
- autofocus: false,
277
- froalaConfig: {}
278
- };
279
- }
280
- saveSelectedElements() {
281
- this._selectedElements = this.htmlEditor.editor.selection.blocks();
282
- }
283
- clearSelectedElements() {
284
- this._selectedElements = [];
285
- }
286
- ngAfterContentInit() {
287
- this.el.style.width = this.block.width + this.unit;
288
- this.el.style.height = this.block.height + this.unit;
289
- this.el.style.top = this.block.top + this.unit;
290
- this.el.style.left = this.block.left + this.unit;
291
- this._setTransform();
292
- fromEvent(this.contentEditable.nativeElement, 'input')
293
- .pipe(takeUntil(this._destroy$)).subscribe((event) => {
294
- this.block.content = event.target.innerHTML;
295
- this._triggerChanged();
296
- });
297
- fromEvent(this.el, 'mousedown')
298
- .pipe(takeUntil(this._destroy$), filter(() => !this.block.readonly)).subscribe((event) => {
299
- if (this.editable) {
300
- if (this.contentElement.nativeElement.isSameNode(event.target)) {
301
- event.preventDefault();
302
- event.stopImmediatePropagation();
303
- event.stopPropagation();
304
- }
305
- }
306
- else {
307
- this._service.selectedBlockComponents = [this];
308
- }
309
- });
310
- fromEvent(this.el, 'dblclick')
311
- .pipe(filter(() => (!this.editable)), takeUntil(this._destroy$))
312
- .subscribe((event) => {
313
- if (this.block.readonly) {
314
- event.preventDefault();
315
- }
316
- else {
317
- this.editable = true;
318
- this._cdRef.markForCheck();
319
- setTimeout(() => {
320
- this.selectAll();
321
- });
322
- }
323
- });
324
- this._moveable = new Moveable(this._elementRef.nativeElement, {
325
- target: this.el,
326
- container: this._service.container,
327
- draggable: false,
328
- resizable: false,
329
- scalable: false,
330
- rotatable: false,
331
- warpable: false,
332
- origin: false,
333
- keepRatio: false,
334
- snappable: true,
335
- snapHorizontal: true,
336
- snapVertical: true,
337
- snapCenter: true,
338
- snapElement: true,
339
- edge: false,
340
- throttleDrag: 1,
341
- throttleScale: 0.01,
342
- throttleRotate: 1,
343
- throttleResize: 1,
344
- });
345
- this._service.registerBlock(this);
346
- this._moveable
347
- .on('clip', e => {
348
- this.block.clipPath = e.clipStyle;
349
- e.target.style.clipPath = e.clipStyle;
350
- this._triggerChanged();
351
- });
352
- this._moveable.on('dragStart', ({ target, clientX, clientY }) => {
353
- this.editable = false;
354
- }).on('drag', ({ target, left, top }) => {
355
- target.style.left = this.pxToIn(left) + this.unit;
356
- target.style.top = this.pxToIn(top) + this.unit;
357
- this.block.top = this.pxToIn(top);
358
- this.block.left = this.pxToIn(left);
359
- this._triggerChanged();
360
- });
361
- this._moveable.on('resizeStart', ({ target, clientX, clientY }) => {
362
- this.editable = false;
363
- }).on('resize', ({ target, width, height, dist, delta, direction }) => {
364
- width = this.pxToIn(width);
365
- height = this.pxToIn(height);
366
- if (delta[0]) {
367
- this.block.width = width;
368
- target.style.width = width + this.unit;
369
- }
370
- if (delta[1]) {
371
- this.block.height = height;
372
- target.style.height = height + this.unit;
373
- }
374
- const transform = [0, 0];
375
- if (direction[1] === -1) {
376
- transform[1] = dist[1] * -1;
377
- }
378
- if (direction[0] === -1) {
379
- transform[0] = dist[0] * -1;
380
- }
381
- this._setTransform([`translate(${transform[0]}px, ${transform[1]}px)`]);
382
- this._triggerChanged();
383
- }).on('resizeEnd', ({ target }) => {
384
- const matrix = new WebKitCSSMatrix(target.style.transform);
385
- this.block.top = parseFloat(target.style.top) + this.pxToIn(matrix.m42);
386
- this.block.left = parseFloat(target.style.left) + this.pxToIn(matrix.m41);
387
- target.style.top = this.block.top + this.unit;
388
- target.style.left = this.block.left + this.unit;
389
- this._setTransform();
390
- this._triggerChanged();
391
- });
392
- this._moveable.on('rotateStart', ({ target, clientX, clientY }) => {
393
- this.editable = false;
394
- this._rotateStart = this.block.rotate || 0;
395
- }).on('rotate', ({ rotate, transform }) => {
396
- this.block.rotate = this._rotateStart + rotate;
397
- this.el.style.transform = transform;
398
- this._triggerChanged();
399
- });
400
- }
401
- pxToIn(px) {
402
- return this.round(px / 96, 2);
403
- }
404
- round(value, decimals) {
405
- return parseFloat(value.toFixed(decimals));
406
- }
407
- deselect() {
408
- this.transformable = false;
409
- this.editable = false;
410
- }
411
- deselectContent() {
412
- if (window.getSelection) {
413
- if (window.getSelection().empty) {
414
- window.getSelection().empty();
415
- }
416
- else if (window.getSelection().removeAllRanges) {
417
- window.getSelection().removeAllRanges();
418
- }
419
- }
420
- }
421
- selectAll() {
422
- const range = document.createRange();
423
- range.selectNodeContents(this.contentEditable.nativeElement);
424
- const sel = window.getSelection();
425
- sel.removeAllRanges();
426
- sel.addRange(range);
427
- }
428
- ngOnDestroy() {
429
- this._destroy$.next();
430
- this._destroy$.complete();
431
- }
432
- _setTransform(transforms = []) {
433
- transforms = (transforms !== null && transforms !== void 0 ? transforms : []);
434
- if (this.block.rotate) {
435
- transforms.push(`rotate(${this.block.rotate}deg)`);
436
- }
437
- this.el.style.transform = transforms.join(' ');
438
- }
439
- _triggerChanged() {
440
- this.changed.emit(this.block);
441
- }
442
- };
443
- FsBlockComponent.ctorParameters = () => [
444
- { type: BlockEditorService },
445
- { type: ElementRef },
446
- { type: ChangeDetectorRef }
447
- ];
448
- __decorate([
449
- ViewChild('element', { static: true }),
450
- __metadata("design:type", ElementRef)
451
- ], FsBlockComponent.prototype, "element", void 0);
452
- __decorate([
453
- ViewChild('contentElement', { static: true }),
454
- __metadata("design:type", ElementRef)
455
- ], FsBlockComponent.prototype, "contentElement", void 0);
456
- __decorate([
457
- ViewChild('contentEditable', { static: true }),
458
- __metadata("design:type", ElementRef)
459
- ], FsBlockComponent.prototype, "contentEditable", void 0);
460
- __decorate([
461
- ViewChild(FsHtmlEditorComponent),
462
- __metadata("design:type", FsHtmlEditorComponent)
463
- ], FsBlockComponent.prototype, "htmlEditor", void 0);
464
- __decorate([
465
- Input(),
466
- __metadata("design:type", Object)
467
- ], FsBlockComponent.prototype, "block", void 0);
468
- __decorate([
469
- Input(),
470
- __metadata("design:type", String)
471
- ], FsBlockComponent.prototype, "html", void 0);
472
- __decorate([
473
- Output(),
474
- __metadata("design:type", Object)
475
- ], FsBlockComponent.prototype, "changed", void 0);
476
- FsBlockComponent = __decorate([
477
- Component({
478
- selector: 'fs-block',
479
- template: "<div\n #element\n class=\"block\"\n [ngClass]=\"{ editable: editable, readonly: block.readonly }\">\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 <img [src]=\"block.imageUrl\" *ngIf=\"block.imageUrl\">\n <div\n #contentEditable\n [contentEditable]=\"editable\"\n class=\"content-editable\"\n [innerHTML]=\"content\">\n </div>\n </div>\n</div>\n",
480
- changeDetection: ChangeDetectionStrategy.OnPush,
481
- styles: [".block{position:absolute;display:block;outline:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.block:not(.readonly){cursor:pointer}.block .content-editable{outline:0;position:relative}.block.editable .content-editable{cursor:text}.block .content{flex-direction:column;height:100%;display:flex;border:1px dashed #c5c5c5;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:0 0!important;border:none!important}:host ::ng-deep .moveable-line:not(.moveable-rotation-line):not(.moveable-guideline){background:0 0!important}"]
482
- }),
483
- __metadata("design:paramtypes", [BlockEditorService,
484
- ElementRef,
485
- ChangeDetectorRef])
486
- ], FsBlockComponent);
121
+ class FsBlockComponent {
122
+ constructor(_service, _elementRef, _cdRef) {
123
+ this._service = _service;
124
+ this._elementRef = _elementRef;
125
+ this._cdRef = _cdRef;
126
+ this.changed = new EventEmitter();
127
+ this.htmlConfig = {};
128
+ this._editable = false;
129
+ this._selectedElements = [];
130
+ this._destroy$ = new Subject();
131
+ }
132
+ get el() {
133
+ return this.element.nativeElement;
134
+ }
135
+ get moveable() {
136
+ return this._moveable;
137
+ }
138
+ get editable() {
139
+ return this._editable;
140
+ }
141
+ set elementGuidelines(value) {
142
+ this._moveable.elementGuidelines = value;
143
+ }
144
+ set editable(value) {
145
+ this._editable = value;
146
+ if (!value) {
147
+ this.deselectContent();
148
+ }
149
+ }
150
+ set clippable(value) {
151
+ this._moveable.clippable = value;
152
+ }
153
+ get transformable() {
154
+ return this._transformable;
155
+ }
156
+ set transformable(value) {
157
+ this._transformable = value;
158
+ this.moveable.draggable = value;
159
+ this.moveable.resizable = value;
160
+ this.moveable.draggable = value;
161
+ this.moveable.roundable = value;
162
+ this.moveable.rotatable = value;
163
+ }
164
+ set lineHeight(value) {
165
+ this.block.lineHeight = value;
166
+ this._triggerChanged();
167
+ }
168
+ set borderWidth(value) {
169
+ this.block.borderWidth = value;
170
+ this._triggerChanged();
171
+ }
172
+ set fontSize(value) {
173
+ this.block.fontSize = value;
174
+ this._triggerChanged();
175
+ }
176
+ set backgroundColor(value) {
177
+ this.block.backgroundColor = value;
178
+ this._triggerChanged();
179
+ }
180
+ set width(value) {
181
+ this.block.width = parseFloat(value);
182
+ this.element.nativeElement.style.width = `${this.block.width}${this.unit}`;
183
+ this._moveable.updateRect();
184
+ this._triggerChanged();
185
+ }
186
+ set height(value) {
187
+ this.block.height = parseFloat(value);
188
+ this.element.nativeElement.style.height = `${this.block.height}${this.unit}`;
189
+ this._moveable.updateRect();
190
+ this._triggerChanged();
191
+ }
192
+ set top(value) {
193
+ this.block.top = parseFloat(value);
194
+ this.element.nativeElement.style.top = `${this.block.top}${this.unit}`;
195
+ this._moveable.updateRect();
196
+ this._triggerChanged();
197
+ }
198
+ set left(value) {
199
+ this.block.left = parseFloat(value);
200
+ this.element.nativeElement.style.left = `${this.block.left}${this.unit}`;
201
+ this._moveable.updateRect();
202
+ this._triggerChanged();
203
+ }
204
+ set rotate(value) {
205
+ this.block.rotate = parseFloat(value);
206
+ this._moveable.request('rotatable', { rotate: this.block.rotate }, true);
207
+ this._triggerChanged();
208
+ }
209
+ set shapeRadius(value) {
210
+ this.block.shapeRadius = value;
211
+ this._triggerChanged();
212
+ }
213
+ set index(value) {
214
+ this.block.index = value;
215
+ }
216
+ set borderColor(value) {
217
+ this.block.borderColor = value;
218
+ this._triggerChanged();
219
+ }
220
+ set paddingAll(value) {
221
+ this.block.padding = value;
222
+ this.block.paddingTop = null;
223
+ this.block.paddingBottom = null;
224
+ this.block.paddingLeft = null;
225
+ this.block.paddingRight = null;
226
+ this._triggerChanged();
227
+ }
228
+ padding(name, value) {
229
+ this.block[name] = value;
230
+ this.block.padding = null;
231
+ this._triggerChanged();
232
+ }
233
+ set imageUrl(value) {
234
+ this.block.imageUrl = value;
235
+ this._triggerChanged();
236
+ }
237
+ set fontColor(value) {
238
+ this.block.fontColor = value;
239
+ this._triggerChanged();
240
+ }
241
+ set verticalAlign(value) {
242
+ this.block.verticalAlign = value;
243
+ this._triggerChanged();
244
+ }
245
+ shapeRound(name, value) {
246
+ this.block[name] = value;
247
+ this._triggerChanged();
248
+ }
249
+ set horizontalAlign(value) {
250
+ this.block.horizontalAlign = value;
251
+ this._triggerChanged();
252
+ }
253
+ set italic(value) {
254
+ this.block.italic = value;
255
+ this._triggerChanged();
256
+ }
257
+ get italic() {
258
+ return this.block.italic;
259
+ }
260
+ set bold(value) {
261
+ this.block.bold = value;
262
+ this._triggerChanged();
263
+ }
264
+ get bold() {
265
+ return this.block.bold;
266
+ }
267
+ set underline(value) {
268
+ this.block.underline = value;
269
+ this._triggerChanged();
270
+ }
271
+ get underline() {
272
+ return this.block.underline;
273
+ }
274
+ updateRect() {
275
+ this.moveable.updateRect();
276
+ }
277
+ markForCheck() {
278
+ this._cdRef.markForCheck();
279
+ }
280
+ ngOnInit() {
281
+ this.block = this._service.sanitizeBlock(this.block);
282
+ this.unit = this._service.config.unit;
283
+ this.content = this.block.content;
284
+ this.htmlConfig = {
285
+ autofocus: false,
286
+ froalaConfig: {}
287
+ };
288
+ }
289
+ saveSelectedElements() {
290
+ this._selectedElements = this.htmlEditor.editor.selection.blocks();
291
+ }
292
+ clearSelectedElements() {
293
+ this._selectedElements = [];
294
+ }
295
+ ngAfterContentInit() {
296
+ this.el.style.width = this.block.width + this.unit;
297
+ this.el.style.height = this.block.height + this.unit;
298
+ this.el.style.top = this.block.top + this.unit;
299
+ this.el.style.left = this.block.left + this.unit;
300
+ this._setTransform();
301
+ fromEvent(this.contentEditable.nativeElement, 'input')
302
+ .pipe(takeUntil(this._destroy$)).subscribe((event) => {
303
+ this.block.content = event.target.innerHTML;
304
+ this._triggerChanged();
305
+ });
306
+ fromEvent(this.el, 'mousedown')
307
+ .pipe(takeUntil(this._destroy$), filter(() => !this.block.readonly)).subscribe((event) => {
308
+ if (this.editable) {
309
+ if (this.contentElement.nativeElement.isSameNode(event.target)) {
310
+ event.preventDefault();
311
+ event.stopImmediatePropagation();
312
+ event.stopPropagation();
313
+ }
314
+ }
315
+ else {
316
+ this._service.selectedBlockComponents = [this];
317
+ }
318
+ });
319
+ fromEvent(this.el, 'dblclick')
320
+ .pipe(filter(() => (!this.editable)), takeUntil(this._destroy$))
321
+ .subscribe((event) => {
322
+ if (this.block.readonly) {
323
+ event.preventDefault();
324
+ }
325
+ else {
326
+ this.editable = true;
327
+ this._cdRef.markForCheck();
328
+ setTimeout(() => {
329
+ this.selectAll();
330
+ });
331
+ }
332
+ });
333
+ this._moveable = new Moveable(this._elementRef.nativeElement, {
334
+ target: this.el,
335
+ container: this._service.container,
336
+ draggable: false,
337
+ resizable: false,
338
+ scalable: false,
339
+ rotatable: false,
340
+ warpable: false,
341
+ origin: false,
342
+ keepRatio: false,
343
+ snappable: true,
344
+ snapHorizontal: true,
345
+ snapVertical: true,
346
+ snapCenter: true,
347
+ snapElement: true,
348
+ edge: false,
349
+ throttleDrag: 1,
350
+ throttleScale: 0.01,
351
+ throttleRotate: 1,
352
+ throttleResize: 1,
353
+ });
354
+ this._service.registerBlock(this);
355
+ this._moveable
356
+ .on('clip', e => {
357
+ this.block.clipPath = e.clipStyle;
358
+ e.target.style.clipPath = e.clipStyle;
359
+ this._triggerChanged();
360
+ });
361
+ this._moveable.on('dragStart', ({ target, clientX, clientY }) => {
362
+ this.editable = false;
363
+ }).on('drag', ({ target, left, top }) => {
364
+ target.style.left = this.pxToIn(left) + this.unit;
365
+ target.style.top = this.pxToIn(top) + this.unit;
366
+ this.block.top = this.pxToIn(top);
367
+ this.block.left = this.pxToIn(left);
368
+ this._triggerChanged();
369
+ });
370
+ this._moveable.on('resizeStart', ({ target, clientX, clientY }) => {
371
+ this.editable = false;
372
+ }).on('resize', ({ target, width, height, dist, delta, direction }) => {
373
+ width = this.pxToIn(width);
374
+ height = this.pxToIn(height);
375
+ if (delta[0]) {
376
+ this.block.width = width;
377
+ target.style.width = width + this.unit;
378
+ }
379
+ if (delta[1]) {
380
+ this.block.height = height;
381
+ target.style.height = height + this.unit;
382
+ }
383
+ const transform = [0, 0];
384
+ if (direction[1] === -1) {
385
+ transform[1] = dist[1] * -1;
386
+ }
387
+ if (direction[0] === -1) {
388
+ transform[0] = dist[0] * -1;
389
+ }
390
+ this._setTransform([`translate(${transform[0]}px, ${transform[1]}px)`]);
391
+ this._triggerChanged();
392
+ }).on('resizeEnd', ({ target }) => {
393
+ const matrix = new WebKitCSSMatrix(target.style.transform);
394
+ this.block.top = parseFloat(target.style.top) + this.pxToIn(matrix.m42);
395
+ this.block.left = parseFloat(target.style.left) + this.pxToIn(matrix.m41);
396
+ target.style.top = this.block.top + this.unit;
397
+ target.style.left = this.block.left + this.unit;
398
+ this._setTransform();
399
+ this._triggerChanged();
400
+ });
401
+ this._moveable.on('rotateStart', ({ target, clientX, clientY }) => {
402
+ this.editable = false;
403
+ this._rotateStart = this.block.rotate || 0;
404
+ }).on('rotate', ({ rotate, transform }) => {
405
+ this.block.rotate = this._rotateStart + rotate;
406
+ this.el.style.transform = transform;
407
+ this._triggerChanged();
408
+ });
409
+ }
410
+ pxToIn(px) {
411
+ return this.round(px / 96, 2);
412
+ }
413
+ round(value, decimals) {
414
+ return parseFloat(value.toFixed(decimals));
415
+ }
416
+ deselect() {
417
+ this.transformable = false;
418
+ this.editable = false;
419
+ }
420
+ deselectContent() {
421
+ if (window.getSelection) {
422
+ if (window.getSelection().empty) {
423
+ window.getSelection().empty();
424
+ }
425
+ else if (window.getSelection().removeAllRanges) {
426
+ window.getSelection().removeAllRanges();
427
+ }
428
+ }
429
+ }
430
+ selectAll() {
431
+ const range = document.createRange();
432
+ range.selectNodeContents(this.contentEditable.nativeElement);
433
+ const sel = window.getSelection();
434
+ sel.removeAllRanges();
435
+ sel.addRange(range);
436
+ }
437
+ ngOnDestroy() {
438
+ this._destroy$.next();
439
+ this._destroy$.complete();
440
+ }
441
+ _setTransform(transforms = []) {
442
+ transforms = transforms !== null && transforms !== void 0 ? transforms : [];
443
+ if (this.block.rotate) {
444
+ transforms.push(`rotate(${this.block.rotate}deg)`);
445
+ }
446
+ this.el.style.transform = transforms.join(' ');
447
+ }
448
+ _triggerChanged() {
449
+ this.changed.emit(this.block);
450
+ }
451
+ }
452
+ FsBlockComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsBlockComponent, deps: [{ token: BlockEditorService }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
453
+ FsBlockComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsBlockComponent, selector: "fs-block", inputs: { block: "block", html: "html" }, outputs: { changed: "changed" }, 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 }, { propertyName: "htmlEditor", first: true, predicate: FsHtmlEditorComponent, descendants: true }], ngImport: i0, template: "<div\n #element\n class=\"block\"\n [ngClass]=\"{ editable: editable, readonly: block.readonly }\">\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 <img [src]=\"block.imageUrl\" *ngIf=\"block.imageUrl\">\n <div\n #contentEditable\n [contentEditable]=\"editable\"\n class=\"content-editable\"\n [innerHTML]=\"content\">\n </div>\n </div>\n</div>\n", styles: [".block{position:absolute;display:block;outline:none;-webkit-user-select:none;user-select:none}.block:not(.readonly){cursor:pointer}.block .content-editable{outline:none;position:relative}.block.editable .content-editable{cursor:text}.block .content{flex-direction:column;height:100%;display:flex;border:1px dashed #c5c5c5;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: i7.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
454
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsBlockComponent, decorators: [{
455
+ type: Component,
456
+ args: [{
457
+ selector: 'fs-block',
458
+ templateUrl: 'block.component.html',
459
+ styleUrls: ['block.component.scss'],
460
+ changeDetection: ChangeDetectionStrategy.OnPush,
461
+ }]
462
+ }], ctorParameters: function () { return [{ type: BlockEditorService }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { element: [{
463
+ type: ViewChild,
464
+ args: ['element', { static: true }]
465
+ }], contentElement: [{
466
+ type: ViewChild,
467
+ args: ['contentElement', { static: true }]
468
+ }], contentEditable: [{
469
+ type: ViewChild,
470
+ args: ['contentEditable', { static: true }]
471
+ }], htmlEditor: [{
472
+ type: ViewChild,
473
+ args: [FsHtmlEditorComponent]
474
+ }], block: [{
475
+ type: Input
476
+ }], html: [{
477
+ type: Input
478
+ }], changed: [{
479
+ type: Output
480
+ }] } });
487
481
 
488
- let FsBlockEditorSidebarPanelDirective = class FsBlockEditorSidebarPanelDirective {
489
- constructor(templateRef) {
490
- this.templateRef = templateRef;
491
- this.show = true;
492
- }
493
- };
494
- FsBlockEditorSidebarPanelDirective.ctorParameters = () => [
495
- { type: TemplateRef }
496
- ];
497
- __decorate([
498
- Input(),
499
- __metadata("design:type", String)
500
- ], FsBlockEditorSidebarPanelDirective.prototype, "label", void 0);
501
- __decorate([
502
- Input(),
503
- __metadata("design:type", Object)
504
- ], FsBlockEditorSidebarPanelDirective.prototype, "show", void 0);
505
- FsBlockEditorSidebarPanelDirective = __decorate([
506
- Directive({
507
- selector: '[fsBlockEditorSidebarPanel]'
508
- }),
509
- __metadata("design:paramtypes", [TemplateRef])
510
- ], FsBlockEditorSidebarPanelDirective);
482
+ class FsBlockEditorSidebarPanelDirective {
483
+ constructor(templateRef) {
484
+ this.templateRef = templateRef;
485
+ this.show = true;
486
+ }
487
+ }
488
+ FsBlockEditorSidebarPanelDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsBlockEditorSidebarPanelDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
489
+ FsBlockEditorSidebarPanelDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FsBlockEditorSidebarPanelDirective, selector: "[fsBlockEditorSidebarPanel]", inputs: { label: "label", show: "show" }, ngImport: i0 });
490
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsBlockEditorSidebarPanelDirective, decorators: [{
491
+ type: Directive,
492
+ args: [{
493
+ selector: '[fsBlockEditorSidebarPanel]'
494
+ }]
495
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; }, propDecorators: { label: [{
496
+ type: Input
497
+ }], show: [{
498
+ type: Input
499
+ }] } });
511
500
 
512
- let FsBlockEditorMarginDirective = class FsBlockEditorMarginDirective {
513
- constructor(_elementRef) {
514
- this._elementRef = _elementRef;
515
- }
516
- get element() {
517
- return this._elementRef.nativeElement;
518
- }
519
- };
520
- FsBlockEditorMarginDirective.ctorParameters = () => [
521
- { type: ElementRef }
522
- ];
523
- FsBlockEditorMarginDirective = __decorate([
524
- Directive({
525
- selector: '[fsBlockEditorMargin]'
526
- }),
527
- __metadata("design:paramtypes", [ElementRef])
528
- ], FsBlockEditorMarginDirective);
501
+ class FsBlockEditorMarginDirective {
502
+ constructor(_elementRef) {
503
+ this._elementRef = _elementRef;
504
+ }
505
+ get element() {
506
+ return this._elementRef.nativeElement;
507
+ }
508
+ }
509
+ FsBlockEditorMarginDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsBlockEditorMarginDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
510
+ FsBlockEditorMarginDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FsBlockEditorMarginDirective, selector: "[fsBlockEditorMargin]", ngImport: i0 });
511
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsBlockEditorMarginDirective, decorators: [{
512
+ type: Directive,
513
+ args: [{
514
+ selector: '[fsBlockEditorMargin]'
515
+ }]
516
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
529
517
 
530
- let SidebarComponent = class SidebarComponent {
531
- constructor(_el, _service, _cdRef) {
532
- this._el = _el;
533
- this._service = _service;
534
- this._cdRef = _cdRef;
535
- this._destroy$ = new Subject();
536
- }
537
- get changeDetector() {
538
- return this._cdRef;
539
- }
540
- get el() {
541
- return this._el.nativeElement;
542
- }
543
- ngOnInit() {
544
- this._service.selectedBlockComponents$
545
- .pipe(takeUntil(this._destroy$))
546
- .subscribe((blocks) => {
547
- this.clippable = false;
548
- this.block = blocks[0] ? blocks[0].block : null;
549
- this.changeDetector.markForCheck();
550
- if (this.config.blocksSelected) {
551
- this.config.blocksSelected(blocks.map((block) => block.block));
552
- }
553
- });
554
- }
555
- verticalAlignClick(value) {
556
- this._service.selectedBlockComponents.forEach((block) => {
557
- block.verticalAlign = value;
558
- });
559
- }
560
- boldClick() {
561
- this._service.selectedBlockComponents.forEach((block) => {
562
- block.bold = !block.bold;
563
- });
564
- }
565
- fontColorChange(value) {
566
- this._service.selectedBlockComponents.forEach((block) => {
567
- block.fontColor = value;
568
- });
569
- }
570
- lineHeightChange(value) {
571
- this._service.selectedBlockComponents.forEach((block) => {
572
- if (this.validNumeric(value)) {
573
- block.lineHeight = value || null;
574
- }
575
- });
576
- }
577
- fontSizeChange(value) {
578
- this._service.selectedBlockComponents.forEach((block) => {
579
- if (this.validNumeric(value)) {
580
- block.fontSize = value || null;
581
- }
582
- });
583
- }
584
- borderWidthChange(value) {
585
- this._service.selectedBlockComponents.forEach((block) => {
586
- if (this.validNumeric(value)) {
587
- block.borderWidth = value || null;
588
- }
589
- });
590
- }
591
- italicClick() {
592
- this._service.selectedBlockComponents.forEach((block) => {
593
- block.italic = !block.italic;
594
- });
595
- }
596
- underlineClick() {
597
- this._service.selectedBlockComponents.forEach((block) => {
598
- block.underline = !block.underline;
599
- });
600
- }
601
- backgroundColorChange(value) {
602
- this._service.selectedBlockComponents.forEach((block) => {
603
- block.backgroundColor = value;
604
- });
605
- }
606
- widthChange(value) {
607
- this._service.selectedBlockComponents.forEach((block) => {
608
- if (this.validNumeric(value)) {
609
- block.width = value;
610
- }
611
- });
612
- }
613
- heightChange(value) {
614
- this._service.selectedBlockComponents.forEach((block) => {
615
- if (this.validNumeric(value)) {
616
- block.height = value;
617
- }
618
- });
619
- }
620
- topChange(value) {
621
- this._service.selectedBlockComponents.forEach((block) => {
622
- if (this.validNumeric(value)) {
623
- block.top = value;
624
- }
625
- });
626
- }
627
- leftChange(value) {
628
- this._service.selectedBlockComponents.forEach((block) => {
629
- if (this.validNumeric(value)) {
630
- block.left = value;
631
- }
632
- });
633
- }
634
- rotateChange(value) {
635
- this._service.selectedBlockComponents.forEach((block) => {
636
- if (this.validNumeric(value)) {
637
- block.rotate = value;
638
- }
639
- });
640
- }
641
- paddingChange(name, value) {
642
- this._service.selectedBlockComponents.forEach((block) => {
643
- if (this.validNumeric(value)) {
644
- block.padding(name, value || null);
645
- }
646
- });
647
- }
648
- paddingAllChange(value) {
649
- this._service.selectedBlockComponents.forEach((block) => {
650
- if (this.validNumeric(value)) {
651
- block.paddingAll = value;
652
- }
653
- });
654
- }
655
- borderColorChange(value) {
656
- this._service.selectedBlockComponents.forEach((block) => {
657
- block.borderColor = value;
658
- });
659
- }
660
- horizontalAlignClick(value) {
661
- this._service.selectedBlockComponents.forEach((block) => {
662
- block.horizontalAlign = value;
663
- });
664
- }
665
- shapeRound(value) {
666
- this._service.selectedBlockComponents.forEach((block) => {
667
- block.shapeRound(value, block.block[value] === 'round' ? 'square' : 'round');
668
- });
669
- }
670
- imageRemove() {
671
- this._service.selectedBlockComponents.forEach((block) => {
672
- block.imageUrl = null;
673
- });
674
- }
675
- imageClip() {
676
- this.clippable = !this.clippable;
677
- this._service.selectedBlockComponents.forEach((block) => {
678
- block.clippable = this.clippable;
679
- });
680
- }
681
- shapeRadiusChange(value) {
682
- this._service.selectedBlockComponents.forEach((block) => {
683
- block.shapeRadius = value;
684
- });
685
- }
686
- fileSelect(fsFile) {
687
- if (this.config.fileUpload) {
688
- this.config.fileUpload(fsFile.file)
689
- .subscribe((value) => {
690
- this._service.selectedBlockComponents.forEach((block) => {
691
- block.imageUrl = value;
692
- });
693
- });
694
- }
695
- }
696
- blockRemoveClick() {
697
- if (this.config.blocksRemoved) {
698
- this.config.blocksRemoved(this._service.selectedBlocks)
699
- .pipe(takeUntil(this._destroy$))
700
- .subscribe(() => {
701
- this._service.selectedBlocks.forEach((block) => {
702
- this._service.removeBlock(block);
703
- });
704
- this._service.selectedBlockComponents = [];
705
- });
706
- }
707
- }
708
- blockAddClick() {
709
- const width = (this.config.width * .333).toFixed(2);
710
- const height = (this.config.height * .333).toFixed(2);
711
- const reference = guid();
712
- const block = {
713
- type: 'text',
714
- reference,
715
- top: height,
716
- left: width,
717
- width: width,
718
- height: height,
719
- };
720
- if (this.config.blockAdded) {
721
- this.config.blockAdded(block)
722
- .pipe(takeUntil(this._destroy$))
723
- .subscribe((block) => {
724
- this.addBlock(block);
725
- this.changeDetector.markForCheck();
726
- this.blockAdded
727
- .pipe(take(1), takeUntil(this._destroy$))
728
- .subscribe((blockComponent) => {
729
- this._service.selectedBlockComponents = [blockComponent];
730
- });
731
- });
732
- }
733
- }
734
- addBlock(block) {
735
- this._service.addBlock(block);
736
- this._updateIndexes();
737
- }
738
- _updateIndexes() {
739
- const sort = this.blocks.slice().sort((a, b) => {
740
- return a.index > b.index ? 1 : -1;
741
- });
742
- sort.forEach((block, index) => {
743
- this.blocks.find((item) => {
744
- return block.reference === item.reference;
745
- }).index = index;
746
- });
747
- }
748
- layerMove(direction) {
749
- this._service.blockComponents.forEach((blockComponent) => {
750
- if (this._service.isSelectedBlock(blockComponent)) {
751
- blockComponent.block.index + (999 * direction);
752
- }
753
- });
754
- const sorted = this._service.blockComponents.sort((a, b) => {
755
- return a.index > b.index ? 1 : -1;
756
- });
757
- sorted.forEach((item, index) => {
758
- item.block.index = index;
759
- item.markForCheck();
760
- });
761
- if (this.config.blocksLevelChanged) {
762
- this.config.blocksLevelChanged(sorted.map((item) => item.block));
763
- }
764
- }
765
- layerUp() {
766
- this.layerMove(1);
767
- }
768
- layerDown() {
769
- this.layerMove(-1);
770
- }
771
- getBlock(reference) {
772
- return this._service.blocks.find((block) => {
773
- return block.reference === reference;
774
- });
775
- }
776
- blockChanged(block) {
777
- if (this.config.blockChanged) {
778
- this.config.blockChanged(block);
779
- }
780
- }
781
- inputFocus(event) {
782
- event.target.select();
783
- }
784
- ngOnDestroy() {
785
- this._destroy$.next();
786
- this._destroy$.complete();
787
- }
788
- validNumeric(value) {
789
- return !value || !!String(value).match(/^\d*\.?\d*$/);
790
- }
791
- };
792
- SidebarComponent.ctorParameters = () => [
793
- { type: ElementRef },
794
- { type: BlockEditorService },
795
- { type: ChangeDetectorRef }
796
- ];
797
- __decorate([
798
- ContentChildren(FsBlockEditorSidebarPanelDirective),
799
- __metadata("design:type", QueryList)
800
- ], SidebarComponent.prototype, "sidebarPanels", void 0);
801
- __decorate([
802
- Input(),
803
- __metadata("design:type", Object)
804
- ], SidebarComponent.prototype, "config", void 0);
805
- __decorate([
806
- Input(),
807
- __metadata("design:type", Object)
808
- ], SidebarComponent.prototype, "blocks", void 0);
809
- __decorate([
810
- Input(),
811
- __metadata("design:type", EventEmitter)
812
- ], SidebarComponent.prototype, "blockAdded", void 0);
813
- SidebarComponent = __decorate([
814
- Component({
815
- selector: 'sidebar',
816
- template: "<div class=\"sidebar mat-elevation-z2\">\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Tools</div>\n <div class=\"sidebar-row\">\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"blockAddClick()\">\n <mat-icon>add</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>clear</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.width\"\n name=\"width\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"widthChange($event)\">\n <span matPrefix>W</span>\n </mat-form-field>\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 <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 </div>\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 <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Image</div>\n <div class=\"sidebar-row image-row\">\n <fs-file (select)=\"fileSelect($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 <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",
817
- changeDetection: ChangeDetectionStrategy.OnPush,
818
- styles: [".sidebar{width:285px;font-size:14px;height:100%}.sidebar .sidebar-row{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center}.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 .field-label,.sidebar .sidebar-row ::ng-deep .mat-form-field-prefix{color:#a5a5a5;font-size:11px;margin-right:2px}.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-down ::ng-deep .mat-button-wrapper,.sidebar .layer-up ::ng-deep .mat-button-wrapper{position:relative}.sidebar .layer-down ::ng-deep .mat-button-wrapper mat-icon:first-child,.sidebar .layer-up ::ng-deep .mat-button-wrapper mat-icon:first-child{position:absolute;transform:rotate(90deg) scale(.6);top:-6px;color:#fff}.sidebar .layer-down mat-icon:first-child{transform:rotate(270deg) scale(.6)}.sidebar .border-width,.sidebar .font-size,.sidebar .line-height,.sidebar .padding{width:45px}.sidebar .shape-radius{width:50px}.sidebar .shape-corners{display:-ms-grid;display:grid;-ms-grid-columns:1fr 1fr;grid-template-columns:1fr 1fr;-moz-column-gap:1px;column-gap:1px;row-gap:1px}.sidebar .shape-corners .shape-corner{height:13px;width:13px;background-color:#ccc;cursor:pointer}.sidebar .shape-corners .shape-corner.round.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;border-bottom:1px solid #dadada}.sidebar .sidebar-panel.info-panel .sidebar-row{justify-content:space-evenly}.sidebar .sidebar-panel.info-panel .sidebar-row .mat-form-field{width:41px}.sidebar .sidebar-panel.info-panel .sidebar-row>{margin:0}.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:3px;color:#9e9e9e}"]
819
- }),
820
- __metadata("design:paramtypes", [ElementRef,
821
- BlockEditorService,
822
- ChangeDetectorRef])
823
- ], SidebarComponent);
518
+ class SidebarComponent {
519
+ constructor(_el, _service, _cdRef) {
520
+ this._el = _el;
521
+ this._service = _service;
522
+ this._cdRef = _cdRef;
523
+ this._destroy$ = new Subject();
524
+ }
525
+ get changeDetector() {
526
+ return this._cdRef;
527
+ }
528
+ get el() {
529
+ return this._el.nativeElement;
530
+ }
531
+ ngOnInit() {
532
+ this._service.selectedBlockComponents$
533
+ .pipe(takeUntil(this._destroy$))
534
+ .subscribe((blocks) => {
535
+ this.clippable = false;
536
+ this.block = blocks[0] ? blocks[0].block : null;
537
+ this.changeDetector.markForCheck();
538
+ if (this.config.blocksSelected) {
539
+ this.config.blocksSelected(blocks.map((block) => block.block));
540
+ }
541
+ });
542
+ }
543
+ verticalAlignClick(value) {
544
+ this._service.selectedBlockComponents.forEach((block) => {
545
+ block.verticalAlign = value;
546
+ });
547
+ }
548
+ boldClick() {
549
+ this._service.selectedBlockComponents.forEach((block) => {
550
+ block.bold = !block.bold;
551
+ });
552
+ }
553
+ fontColorChange(value) {
554
+ this._service.selectedBlockComponents.forEach((block) => {
555
+ block.fontColor = value;
556
+ });
557
+ }
558
+ lineHeightChange(value) {
559
+ this._service.selectedBlockComponents.forEach((block) => {
560
+ if (this.validNumeric(value)) {
561
+ block.lineHeight = value || null;
562
+ }
563
+ });
564
+ }
565
+ fontSizeChange(value) {
566
+ this._service.selectedBlockComponents.forEach((block) => {
567
+ if (this.validNumeric(value)) {
568
+ block.fontSize = value || null;
569
+ }
570
+ });
571
+ }
572
+ borderWidthChange(value) {
573
+ this._service.selectedBlockComponents.forEach((block) => {
574
+ if (this.validNumeric(value)) {
575
+ block.borderWidth = value || null;
576
+ }
577
+ });
578
+ }
579
+ italicClick() {
580
+ this._service.selectedBlockComponents.forEach((block) => {
581
+ block.italic = !block.italic;
582
+ });
583
+ }
584
+ underlineClick() {
585
+ this._service.selectedBlockComponents.forEach((block) => {
586
+ block.underline = !block.underline;
587
+ });
588
+ }
589
+ backgroundColorChange(value) {
590
+ this._service.selectedBlockComponents.forEach((block) => {
591
+ block.backgroundColor = value;
592
+ });
593
+ }
594
+ widthChange(value) {
595
+ this._service.selectedBlockComponents.forEach((block) => {
596
+ if (this.validNumeric(value)) {
597
+ block.width = value;
598
+ }
599
+ });
600
+ }
601
+ heightChange(value) {
602
+ this._service.selectedBlockComponents.forEach((block) => {
603
+ if (this.validNumeric(value)) {
604
+ block.height = value;
605
+ }
606
+ });
607
+ }
608
+ topChange(value) {
609
+ this._service.selectedBlockComponents.forEach((block) => {
610
+ if (this.validNumeric(value)) {
611
+ block.top = value;
612
+ }
613
+ });
614
+ }
615
+ leftChange(value) {
616
+ this._service.selectedBlockComponents.forEach((block) => {
617
+ if (this.validNumeric(value)) {
618
+ block.left = value;
619
+ }
620
+ });
621
+ }
622
+ rotateChange(value) {
623
+ this._service.selectedBlockComponents.forEach((block) => {
624
+ if (this.validNumeric(value)) {
625
+ block.rotate = value;
626
+ }
627
+ });
628
+ }
629
+ paddingChange(name, value) {
630
+ this._service.selectedBlockComponents.forEach((block) => {
631
+ if (this.validNumeric(value)) {
632
+ block.padding(name, value || null);
633
+ }
634
+ });
635
+ }
636
+ paddingAllChange(value) {
637
+ this._service.selectedBlockComponents.forEach((block) => {
638
+ if (this.validNumeric(value)) {
639
+ block.paddingAll = value;
640
+ }
641
+ });
642
+ }
643
+ borderColorChange(value) {
644
+ this._service.selectedBlockComponents.forEach((block) => {
645
+ block.borderColor = value;
646
+ });
647
+ }
648
+ horizontalAlignClick(value) {
649
+ this._service.selectedBlockComponents.forEach((block) => {
650
+ block.horizontalAlign = value;
651
+ });
652
+ }
653
+ shapeRound(value) {
654
+ this._service.selectedBlockComponents.forEach((block) => {
655
+ block.shapeRound(value, block.block[value] === 'round' ? 'square' : 'round');
656
+ });
657
+ }
658
+ imageRemove() {
659
+ this._service.selectedBlockComponents.forEach((block) => {
660
+ block.imageUrl = null;
661
+ });
662
+ }
663
+ imageClip() {
664
+ this.clippable = !this.clippable;
665
+ this._service.selectedBlockComponents.forEach((block) => {
666
+ block.clippable = this.clippable;
667
+ });
668
+ }
669
+ shapeRadiusChange(value) {
670
+ this._service.selectedBlockComponents.forEach((block) => {
671
+ block.shapeRadius = value;
672
+ });
673
+ }
674
+ fileSelect(fsFile) {
675
+ if (this.config.fileUpload) {
676
+ this.config.fileUpload(fsFile.file)
677
+ .subscribe((value) => {
678
+ this._service.selectedBlockComponents.forEach((block) => {
679
+ block.imageUrl = value;
680
+ });
681
+ });
682
+ }
683
+ }
684
+ blockRemoveClick() {
685
+ if (this.config.blocksRemoved) {
686
+ this.config.blocksRemoved(this._service.selectedBlocks)
687
+ .pipe(takeUntil(this._destroy$))
688
+ .subscribe(() => {
689
+ this._service.selectedBlocks.forEach((block) => {
690
+ this._service.removeBlock(block);
691
+ });
692
+ this._service.selectedBlockComponents = [];
693
+ });
694
+ }
695
+ }
696
+ blockAddClick() {
697
+ const width = (this.config.width * .333).toFixed(2);
698
+ const height = (this.config.height * .333).toFixed(2);
699
+ const reference = guid();
700
+ const block = {
701
+ type: 'text',
702
+ reference,
703
+ top: height,
704
+ left: width,
705
+ width: width,
706
+ height: height,
707
+ };
708
+ if (this.config.blockAdded) {
709
+ this.config.blockAdded(block)
710
+ .pipe(takeUntil(this._destroy$))
711
+ .subscribe((block) => {
712
+ this.addBlock(block);
713
+ this.changeDetector.markForCheck();
714
+ this.blockAdded
715
+ .pipe(take(1), takeUntil(this._destroy$))
716
+ .subscribe((blockComponent) => {
717
+ this._service.selectedBlockComponents = [blockComponent];
718
+ });
719
+ });
720
+ }
721
+ }
722
+ addBlock(block) {
723
+ this._service.addBlock(block);
724
+ this._updateIndexes();
725
+ }
726
+ _updateIndexes() {
727
+ const sort = this.blocks.slice().sort((a, b) => {
728
+ return a.index > b.index ? 1 : -1;
729
+ });
730
+ sort.forEach((block, index) => {
731
+ this.blocks.find((item) => {
732
+ return block.reference === item.reference;
733
+ }).index = index;
734
+ });
735
+ }
736
+ layerMove(direction) {
737
+ this._service.blockComponents.forEach((blockComponent) => {
738
+ if (this._service.isSelectedBlock(blockComponent)) {
739
+ blockComponent.block.index + (999 * direction);
740
+ }
741
+ });
742
+ const sorted = this._service.blockComponents.sort((a, b) => {
743
+ return a.index > b.index ? 1 : -1;
744
+ });
745
+ sorted.forEach((item, index) => {
746
+ item.block.index = index;
747
+ item.markForCheck();
748
+ });
749
+ if (this.config.blocksLevelChanged) {
750
+ this.config.blocksLevelChanged(sorted.map((item) => item.block));
751
+ }
752
+ }
753
+ layerUp() {
754
+ this.layerMove(1);
755
+ }
756
+ layerDown() {
757
+ this.layerMove(-1);
758
+ }
759
+ getBlock(reference) {
760
+ return this._service.blocks.find((block) => {
761
+ return block.reference === reference;
762
+ });
763
+ }
764
+ blockChanged(block) {
765
+ if (this.config.blockChanged) {
766
+ this.config.blockChanged(block);
767
+ }
768
+ }
769
+ inputFocus(event) {
770
+ event.target.select();
771
+ }
772
+ ngOnDestroy() {
773
+ this._destroy$.next();
774
+ this._destroy$.complete();
775
+ }
776
+ validNumeric(value) {
777
+ return !value || !!String(value).match(/^\d*\.?\d*$/);
778
+ }
779
+ }
780
+ SidebarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SidebarComponent, deps: [{ token: i0.ElementRef }, { token: BlockEditorService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
781
+ SidebarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SidebarComponent, selector: "sidebar", inputs: { config: "config", blocks: "blocks", blockAdded: "blockAdded" }, queries: [{ propertyName: "sidebarPanels", predicate: FsBlockEditorSidebarPanelDirective }], ngImport: i0, template: "<div class=\"sidebar mat-elevation-z2\">\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Tools</div>\n <div class=\"sidebar-row\">\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"blockAddClick()\">\n <mat-icon>add</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>clear</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.width\"\n name=\"width\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"widthChange($event)\">\n <span matPrefix>W</span>\n </mat-form-field>\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 <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 </div>\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 <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Image</div>\n <div class=\"sidebar-row image-row\">\n <fs-file (select)=\"fileSelect($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 <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", styles: [".sidebar{width:285px;font-size:14px;height:100%}.sidebar .sidebar-row{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center}.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-form-field-prefix,.sidebar .sidebar-row ::ng-deep .field-label{color:#a5a5a5;font-size:11px;margin-right:2px}.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(.6);top:-6px;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;border-bottom:1px solid #dadada}.sidebar .sidebar-panel.info-panel .sidebar-row{justify-content:space-evenly}.sidebar .sidebar-panel.info-panel .sidebar-row .mat-form-field{width:41px}.sidebar .sidebar-panel.info-panel .sidebar-row >{margin:0}.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:3px;color:#9e9e9e}\n"], components: [{ type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i4.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i5.FsColorPickerChipComponent, selector: "fs-color-picker-chip", inputs: ["color"], outputs: ["changed"] }, { type: i6.FsFileComponent, selector: "fs-file", inputs: ["minHeight", "minWidth", "multiple", "capture", "allowClick", "allowDrop", "accept", "disabled", "imageWidth", "imageHeight", "imageQuality"], outputs: ["select", "error", "clicked", "declined"] }], directives: [{ type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i8.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: i9.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: i9.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i9.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i4.MatPrefix, selector: "[matPrefix]" }, { type: i7.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i7.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
782
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SidebarComponent, decorators: [{
783
+ type: Component,
784
+ args: [{
785
+ selector: 'sidebar',
786
+ templateUrl: 'sidebar.component.html',
787
+ styleUrls: ['sidebar.component.scss'],
788
+ changeDetection: ChangeDetectionStrategy.OnPush,
789
+ }]
790
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: BlockEditorService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { sidebarPanels: [{
791
+ type: ContentChildren,
792
+ args: [FsBlockEditorSidebarPanelDirective]
793
+ }], config: [{
794
+ type: Input
795
+ }], blocks: [{
796
+ type: Input
797
+ }], blockAdded: [{
798
+ type: Input
799
+ }] } });
824
800
 
825
- let FsBlockEditorComponent = class FsBlockEditorComponent {
826
- constructor(_el, _service, _cdRef, _differs) {
827
- this._el = _el;
828
- this._service = _service;
829
- this._cdRef = _cdRef;
830
- this._differs = _differs;
831
- this.blockAdded = new EventEmitter();
832
- this.blockRemoved = new EventEmitter();
833
- this._destroy$ = new Subject();
834
- this._differ = _differs.find([]).create(null);
835
- }
836
- get el() {
837
- return this._el.nativeElement;
838
- }
839
- ngOnInit() {
840
- this.config = Object.assign(Object.assign({}, this.config), { unit: 'in' });
841
- this._service.registerContainer(this.artboard.nativeElement);
842
- this._service.registerMargin(this.marginContainer.nativeElement);
843
- this._service.blocks = this.config.blocks;
844
- this._service.config = this.config;
845
- this._service.blocks$
846
- .pipe(takeUntil(this._destroy$))
847
- .subscribe((blocks) => {
848
- this.blocks = blocks;
849
- });
850
- fromEvent(window, 'keydown')
851
- .pipe(takeUntil(this._destroy$), filter((event) => {
852
- return !!event.key.match(/^Arrow/) && !!this._service.selectedBlockComponents.length;
853
- }))
854
- .subscribe((event) => {
855
- event.preventDefault();
856
- const inchPixel = 1 / 100;
857
- this._service.selectedBlockComponents.forEach((blockComponent) => {
858
- switch (event.key) {
859
- case 'ArrowUp':
860
- blockComponent.top = blockComponent.block.top - inchPixel;
861
- break;
862
- case 'ArrowDown':
863
- blockComponent.top = blockComponent.block.top + inchPixel;
864
- break;
865
- case 'ArrowLeft':
866
- blockComponent.left = blockComponent.block.left - inchPixel;
867
- break;
868
- case 'ArrowRight':
869
- blockComponent.left = blockComponent.block.left + inchPixel;
870
- break;
871
- }
872
- });
873
- });
874
- }
875
- artboardClick(event) {
876
- if (event.target.isSameNode(this.artboard.nativeElement) ||
877
- event.target.isSameNode(this.artboardContainer.nativeElement)) {
878
- this._service.selectedBlockComponents.forEach((block) => {
879
- block.deselect();
880
- block.markForCheck();
881
- });
882
- this._service.selectedBlockComponents = [];
883
- }
884
- }
885
- blockChanged(block) {
886
- this.sidebar.changeDetector.markForCheck();
887
- if (this.config.blockChanged) {
888
- this.config.blockChanged(block);
889
- }
890
- }
891
- ngAfterViewInit() {
892
- this.blockComponents.changes.subscribe((changes) => {
893
- const changeDiff = this._differ.diff(changes);
894
- if (changeDiff) {
895
- changeDiff.forEachAddedItem((change) => {
896
- this.blockAdded.emit(change.item);
897
- });
898
- changeDiff.forEachRemovedItem((change) => {
899
- this.blockRemoved.emit(change.item);
900
- });
901
- }
902
- });
903
- }
904
- ngOnDestroy() {
905
- this._destroy$.next();
906
- this._destroy$.complete();
907
- }
908
- };
909
- FsBlockEditorComponent.ctorParameters = () => [
910
- { type: ElementRef },
911
- { type: BlockEditorService },
912
- { type: ChangeDetectorRef },
913
- { type: IterableDiffers }
914
- ];
915
- __decorate([
916
- ContentChildren(FsBlockEditorSidebarPanelDirective),
917
- __metadata("design:type", QueryList)
918
- ], FsBlockEditorComponent.prototype, "sidebarPanels", void 0);
919
- __decorate([
920
- ViewChildren(FsBlockComponent),
921
- __metadata("design:type", QueryList)
922
- ], FsBlockEditorComponent.prototype, "blockComponents", void 0);
923
- __decorate([
924
- ViewChild('artboard', { static: true }),
925
- __metadata("design:type", ElementRef)
926
- ], FsBlockEditorComponent.prototype, "artboard", void 0);
927
- __decorate([
928
- ViewChild('marginContainer', { static: true }),
929
- __metadata("design:type", ElementRef)
930
- ], FsBlockEditorComponent.prototype, "marginContainer", void 0);
931
- __decorate([
932
- ViewChildren(FsBlockEditorMarginDirective),
933
- __metadata("design:type", QueryList)
934
- ], FsBlockEditorComponent.prototype, "margins", void 0);
935
- __decorate([
936
- ViewChild('artboardContainer', { static: true }),
937
- __metadata("design:type", ElementRef)
938
- ], FsBlockEditorComponent.prototype, "artboardContainer", void 0);
939
- __decorate([
940
- ViewChild(SidebarComponent, { static: true }),
941
- __metadata("design:type", SidebarComponent)
942
- ], FsBlockEditorComponent.prototype, "sidebar", void 0);
943
- __decorate([
944
- Input(),
945
- __metadata("design:type", Object)
946
- ], FsBlockEditorComponent.prototype, "config", void 0);
947
- __decorate([
948
- Output(),
949
- __metadata("design:type", Object)
950
- ], FsBlockEditorComponent.prototype, "blockAdded", void 0);
951
- __decorate([
952
- Output(),
953
- __metadata("design:type", Object)
954
- ], FsBlockEditorComponent.prototype, "blockRemoved", void 0);
955
- FsBlockEditorComponent = __decorate([
956
- Component({
957
- selector: 'fs-block-editor',
958
- template: "<div class=\"editor-container\">\n <div\n #artboardContainer\n class=\"artboard-container\"\n (click)=\"artboardClick($event)\">\n <div\n #artboard\n class=\"artboard mat-elevation-z2\"\n [style.width]=\"config.width + config.unit\"\n [style.height]=\"config.height + config.unit\">\n <fs-block\n *ngFor=\"let block of blocks; trackBy\"\n [block]=\"block\"\n (changed)=\"blockChanged($event)\">\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'\"></div>\n </div>\n </div>\n <sidebar\n [config]=\"config\"\n [blocks]=\"blocks\"\n [blockAdded]=\"blockAdded\">\n </sidebar>\n</div>\n",
959
- changeDetection: ChangeDetectionStrategy.OnPush,
960
- providers: [
961
- BlockEditorService,
962
- ],
963
- styles: [".editor-container{display:flex;flex-direction:row;position:relative}.editor-container .artboard-container{display:flex;flex-grow:1;justify-content:center;padding:25px;overflow:auto;min-width:0}.editor-container .artboard-container .artboard{position:relative}.editor-container .artboard-container .artboard .margin-container{position:absolute;z-index:-1}.editor-container .artboard-container .artboard .margin{position:absolute;border:0 dashed #ff85bd5e}.editor-container .artboard-container .artboard .margin.margin-bottom,.editor-container .artboard-container .artboard .margin.margin-top{width:100%;border-top-width:1px}.editor-container .artboard-container .artboard .margin.margin-left,.editor-container .artboard-container .artboard .margin.margin-right{height:100%;border-left-width:1px}"]
964
- }),
965
- __metadata("design:paramtypes", [ElementRef,
966
- BlockEditorService,
967
- ChangeDetectorRef,
968
- IterableDiffers])
969
- ], FsBlockEditorComponent);
801
+ class FsBlockEditorComponent {
802
+ constructor(_el, _service, _cdRef, _differs) {
803
+ this._el = _el;
804
+ this._service = _service;
805
+ this._cdRef = _cdRef;
806
+ this._differs = _differs;
807
+ this.blockAdded = new EventEmitter();
808
+ this.blockRemoved = new EventEmitter();
809
+ this._destroy$ = new Subject();
810
+ this._differ = _differs.find([]).create(null);
811
+ }
812
+ get el() {
813
+ return this._el.nativeElement;
814
+ }
815
+ ngOnInit() {
816
+ this.config = Object.assign(Object.assign({}, this.config), { unit: 'in' });
817
+ this._service.registerContainer(this.artboard.nativeElement);
818
+ this._service.registerMargin(this.marginContainer.nativeElement);
819
+ this._service.blocks = this.config.blocks;
820
+ this._service.config = this.config;
821
+ this._service.blocks$
822
+ .pipe(takeUntil(this._destroy$))
823
+ .subscribe((blocks) => {
824
+ this.blocks = blocks;
825
+ });
826
+ fromEvent(window, 'keydown')
827
+ .pipe(takeUntil(this._destroy$), filter((event) => {
828
+ return !!event.key.match(/^Arrow/) && !!this._service.selectedBlockComponents.length;
829
+ }))
830
+ .subscribe((event) => {
831
+ event.preventDefault();
832
+ const inchPixel = 1 / 100;
833
+ this._service.selectedBlockComponents.forEach((blockComponent) => {
834
+ switch (event.key) {
835
+ case 'ArrowUp':
836
+ blockComponent.top = blockComponent.block.top - inchPixel;
837
+ break;
838
+ case 'ArrowDown':
839
+ blockComponent.top = blockComponent.block.top + inchPixel;
840
+ break;
841
+ case 'ArrowLeft':
842
+ blockComponent.left = blockComponent.block.left - inchPixel;
843
+ break;
844
+ case 'ArrowRight':
845
+ blockComponent.left = blockComponent.block.left + inchPixel;
846
+ break;
847
+ }
848
+ });
849
+ });
850
+ }
851
+ artboardClick(event) {
852
+ if (event.target.isSameNode(this.artboard.nativeElement) ||
853
+ event.target.isSameNode(this.artboardContainer.nativeElement)) {
854
+ this._service.selectedBlockComponents.forEach((block) => {
855
+ block.deselect();
856
+ block.markForCheck();
857
+ });
858
+ this._service.selectedBlockComponents = [];
859
+ }
860
+ }
861
+ blockChanged(block) {
862
+ this.sidebar.changeDetector.markForCheck();
863
+ if (this.config.blockChanged) {
864
+ this.config.blockChanged(block);
865
+ }
866
+ }
867
+ ngAfterViewInit() {
868
+ this.blockComponents.changes.subscribe((changes) => {
869
+ const changeDiff = this._differ.diff(changes);
870
+ if (changeDiff) {
871
+ changeDiff.forEachAddedItem((change) => {
872
+ this.blockAdded.emit(change.item);
873
+ });
874
+ changeDiff.forEachRemovedItem((change) => {
875
+ this.blockRemoved.emit(change.item);
876
+ });
877
+ }
878
+ });
879
+ }
880
+ ngOnDestroy() {
881
+ this._destroy$.next();
882
+ this._destroy$.complete();
883
+ }
884
+ }
885
+ FsBlockEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsBlockEditorComponent, deps: [{ token: i0.ElementRef }, { token: BlockEditorService }, { token: i0.ChangeDetectorRef }, { token: i0.IterableDiffers }], target: i0.ɵɵFactoryTarget.Component });
886
+ FsBlockEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsBlockEditorComponent, selector: "fs-block-editor", inputs: { config: "config" }, outputs: { blockAdded: "blockAdded", blockRemoved: "blockRemoved" }, providers: [
887
+ BlockEditorService,
888
+ ], 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: "artboardContainer", first: true, predicate: ["artboardContainer"], descendants: true, static: true }, { propertyName: "sidebar", first: true, predicate: SidebarComponent, descendants: true, static: true }, { propertyName: "blockComponents", predicate: FsBlockComponent, descendants: true }, { propertyName: "margins", predicate: FsBlockEditorMarginDirective, descendants: true }], ngImport: i0, template: "<div class=\"editor-container\">\n <div\n #artboardContainer\n class=\"artboard-container\"\n (click)=\"artboardClick($event)\">\n <div\n #artboard\n class=\"artboard mat-elevation-z2\"\n [style.width]=\"config.width + config.unit\"\n [style.height]=\"config.height + config.unit\">\n <fs-block\n *ngFor=\"let block of blocks; trackBy\"\n [block]=\"block\"\n (changed)=\"blockChanged($event)\">\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'\"></div>\n </div>\n </div>\n <sidebar\n [config]=\"config\"\n [blocks]=\"blocks\"\n [blockAdded]=\"blockAdded\">\n </sidebar>\n</div>\n", styles: [".editor-container{display:flex;flex-direction:row;position:relative}.editor-container .artboard-container{display:flex;flex-grow:1;justify-content:center;padding:25px;overflow:auto;min-width:0}.editor-container .artboard-container .artboard{position:relative}.editor-container .artboard-container .artboard .margin-container{position:absolute;z-index:-1}.editor-container .artboard-container .artboard .margin{position:absolute;border-color:#ff85bd5e;border-style:dashed;border-width:0px}.editor-container .artboard-container .artboard .margin.margin-top,.editor-container .artboard-container .artboard .margin.margin-bottom{width:100%;border-top-width:1px}.editor-container .artboard-container .artboard .margin.margin-left,.editor-container .artboard-container .artboard .margin.margin-right{height:100%;border-left-width:1px}\n"], components: [{ type: FsBlockComponent, selector: "fs-block", inputs: ["block", "html"], outputs: ["changed"] }, { type: SidebarComponent, selector: "sidebar", inputs: ["config", "blocks", "blockAdded"] }], directives: [{ type: i7.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
889
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsBlockEditorComponent, decorators: [{
890
+ type: Component,
891
+ args: [{
892
+ selector: 'fs-block-editor',
893
+ templateUrl: 'block-editor.component.html',
894
+ styleUrls: ['block-editor.component.scss'],
895
+ changeDetection: ChangeDetectionStrategy.OnPush,
896
+ providers: [
897
+ BlockEditorService,
898
+ ]
899
+ }]
900
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: BlockEditorService }, { type: i0.ChangeDetectorRef }, { type: i0.IterableDiffers }]; }, propDecorators: { sidebarPanels: [{
901
+ type: ContentChildren,
902
+ args: [FsBlockEditorSidebarPanelDirective]
903
+ }], blockComponents: [{
904
+ type: ViewChildren,
905
+ args: [FsBlockComponent]
906
+ }], artboard: [{
907
+ type: ViewChild,
908
+ args: ['artboard', { static: true }]
909
+ }], marginContainer: [{
910
+ type: ViewChild,
911
+ args: ['marginContainer', { static: true }]
912
+ }], margins: [{
913
+ type: ViewChildren,
914
+ args: [FsBlockEditorMarginDirective]
915
+ }], artboardContainer: [{
916
+ type: ViewChild,
917
+ args: ['artboardContainer', { static: true }]
918
+ }], sidebar: [{
919
+ type: ViewChild,
920
+ args: [SidebarComponent, { static: true }]
921
+ }], config: [{
922
+ type: Input
923
+ }], blockAdded: [{
924
+ type: Output
925
+ }], blockRemoved: [{
926
+ type: Output
927
+ }] } });
970
928
 
971
- var FsBlockEditorModule_1;
972
- let FsBlockEditorModule = FsBlockEditorModule_1 = class FsBlockEditorModule {
973
- static forRoot() {
974
- return {
975
- ngModule: FsBlockEditorModule_1,
976
- };
977
- }
978
- };
979
- FsBlockEditorModule = FsBlockEditorModule_1 = __decorate([
980
- NgModule({
981
- imports: [
982
- CommonModule,
983
- FormsModule,
984
- MatIconModule,
985
- MatButtonModule,
986
- MatInputModule,
987
- MatFormFieldModule,
988
- FsHtmlEditorModule,
989
- FsFileModule,
990
- FsColorPickerModule,
991
- ],
992
- exports: [
993
- FsBlockComponent,
994
- FsBlockEditorComponent,
995
- FsBlockEditorSidebarPanelDirective,
996
- ],
997
- declarations: [
998
- FsBlockComponent,
999
- FsBlockEditorComponent,
1000
- FsBlockEditorSidebarPanelDirective,
1001
- FsBlockEditorMarginDirective,
1002
- SidebarComponent,
1003
- ],
1004
- })
1005
- ], FsBlockEditorModule);
929
+ class FsBlockEditorModule {
930
+ static forRoot() {
931
+ return {
932
+ ngModule: FsBlockEditorModule,
933
+ };
934
+ }
935
+ }
936
+ FsBlockEditorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsBlockEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
937
+ FsBlockEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsBlockEditorModule, declarations: [FsBlockComponent,
938
+ FsBlockEditorComponent,
939
+ FsBlockEditorSidebarPanelDirective,
940
+ FsBlockEditorMarginDirective,
941
+ SidebarComponent], imports: [CommonModule,
942
+ FormsModule,
943
+ MatIconModule,
944
+ MatButtonModule,
945
+ MatInputModule,
946
+ MatFormFieldModule,
947
+ FsHtmlEditorModule,
948
+ FsFileModule,
949
+ FsColorPickerModule], exports: [FsBlockComponent,
950
+ FsBlockEditorComponent,
951
+ FsBlockEditorSidebarPanelDirective] });
952
+ FsBlockEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsBlockEditorModule, imports: [[
953
+ CommonModule,
954
+ FormsModule,
955
+ MatIconModule,
956
+ MatButtonModule,
957
+ MatInputModule,
958
+ MatFormFieldModule,
959
+ FsHtmlEditorModule,
960
+ FsFileModule,
961
+ FsColorPickerModule,
962
+ ]] });
963
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsBlockEditorModule, decorators: [{
964
+ type: NgModule,
965
+ args: [{
966
+ imports: [
967
+ CommonModule,
968
+ FormsModule,
969
+ MatIconModule,
970
+ MatButtonModule,
971
+ MatInputModule,
972
+ MatFormFieldModule,
973
+ FsHtmlEditorModule,
974
+ FsFileModule,
975
+ FsColorPickerModule,
976
+ ],
977
+ exports: [
978
+ FsBlockComponent,
979
+ FsBlockEditorComponent,
980
+ FsBlockEditorSidebarPanelDirective,
981
+ ],
982
+ declarations: [
983
+ FsBlockComponent,
984
+ FsBlockEditorComponent,
985
+ FsBlockEditorSidebarPanelDirective,
986
+ FsBlockEditorMarginDirective,
987
+ SidebarComponent,
988
+ ],
989
+ }]
990
+ }] });
1006
991
 
1007
- /*
1008
- * Public API Surface of fs-menu
992
+ /*
993
+ * Public API Surface of fs-menu
1009
994
  */
1010
995
 
1011
- /**
1012
- * Generated bundle index. Do not edit.
996
+ /**
997
+ * Generated bundle index. Do not edit.
1013
998
  */
1014
999
 
1015
- export { FsBlockComponent, FsBlockEditorComponent, FsBlockEditorModule, FsBlockEditorSidebarPanelDirective, BlockEditorService as ɵa, FsBlockEditorMarginDirective as ɵb, SidebarComponent as ɵc };
1000
+ export { FsBlockComponent, FsBlockEditorComponent, FsBlockEditorModule, FsBlockEditorSidebarPanelDirective };
1016
1001
  //# sourceMappingURL=firestitch-block-editor.js.map