@firestitch/block-editor 12.2.4 → 12.3.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 (34) hide show
  1. package/app/components/block/block.component.d.ts +4 -2
  2. package/app/components/block-editor/block-editor.component.d.ts +1 -1
  3. package/app/components/font/font.component.d.ts +12 -0
  4. package/app/components/font/index.d.ts +1 -0
  5. package/app/components/index.d.ts +1 -0
  6. package/app/components/sidebar/sidebar.component.d.ts +12 -12
  7. package/app/fs-block-editor.module.d.ts +19 -17
  8. package/app/interfaces/block-editor-config.d.ts +1 -1
  9. package/app/interfaces/block.d.ts +11 -4
  10. package/app/interfaces/index.d.ts +2 -0
  11. package/app/services/block-editor.service.d.ts +9 -7
  12. package/app/services/google-font.service.d.ts +15 -0
  13. package/app/services/index.d.ts +1 -0
  14. package/bundles/firestitch-block-editor.umd.js +251 -117
  15. package/bundles/firestitch-block-editor.umd.js.map +1 -1
  16. package/esm2015/app/components/artboard/artboard.component.js +4 -1
  17. package/esm2015/app/components/block/block.component.js +53 -21
  18. package/esm2015/app/components/block-editor/block-editor.component.js +2 -2
  19. package/esm2015/app/components/font/font.component.js +32 -0
  20. package/esm2015/app/components/font/index.js +2 -0
  21. package/esm2015/app/components/index.js +2 -0
  22. package/esm2015/app/components/layers-reorder-dialog/layers-reorder-dialog.component.js +5 -6
  23. package/esm2015/app/components/sidebar/sidebar.component.js +59 -61
  24. package/esm2015/app/fs-block-editor.module.js +16 -3
  25. package/esm2015/app/interfaces/block-editor-config.js +1 -1
  26. package/esm2015/app/interfaces/block.js +1 -1
  27. package/esm2015/app/interfaces/index.js +3 -0
  28. package/esm2015/app/services/block-editor.service.js +15 -11
  29. package/esm2015/app/services/blocks-store.service.js +17 -7
  30. package/esm2015/app/services/google-font.service.js +38 -0
  31. package/esm2015/app/services/index.js +2 -1
  32. package/fesm2015/firestitch-block-editor.js +218 -101
  33. package/fesm2015/firestitch-block-editor.js.map +1 -1
  34. package/package.json +2 -3
@@ -1,10 +1,10 @@
1
- import * as i14 from '@angular/forms';
1
+ import * as i16 from '@angular/forms';
2
2
  import { FormsModule } from '@angular/forms';
3
- import * as i13 from '@angular/material/input';
3
+ import * as i15 from '@angular/material/input';
4
4
  import { MatInputModule } from '@angular/material/input';
5
5
  import * as i0 from '@angular/core';
6
- import { Injectable, Component, Inject, ChangeDetectionStrategy, ViewChild, Input, HostBinding, Directive, EventEmitter, ContentChildren, Output, ViewChildren, ElementRef, NgModule } from '@angular/core';
7
- import * as i11 from '@angular/common';
6
+ import { Injectable, Component, ChangeDetectionStrategy, Inject, ViewChild, Input, HostBinding, Directive, EventEmitter, ContentChildren, Output, ViewChildren, ElementRef, NgModule } from '@angular/core';
7
+ import * as i13 from '@angular/common';
8
8
  import { DOCUMENT, CommonModule } from '@angular/common';
9
9
  import * as i6 from '@angular/material/button';
10
10
  import { MatButtonModule } from '@angular/material/button';
@@ -14,7 +14,7 @@ import * as i3 from '@angular/material/icon';
14
14
  import { MatIconModule } from '@angular/material/icon';
15
15
  import * as i9 from '@angular/material/checkbox';
16
16
  import { MatCheckboxModule } from '@angular/material/checkbox';
17
- import * as i12 from '@angular/material/tooltip';
17
+ import * as i14 from '@angular/material/tooltip';
18
18
  import { MatTooltipModule } from '@angular/material/tooltip';
19
19
  import * as i7$1 from '@angular/material/select';
20
20
  import { MatSelectModule } from '@angular/material/select';
@@ -22,7 +22,7 @@ import * as i4 from '@angular/material/list';
22
22
  import { MatListModule } from '@angular/material/list';
23
23
  import * as i7 from '@angular/cdk/drag-drop';
24
24
  import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
25
- import * as i10 from '@firestitch/colorpicker';
25
+ import * as i12 from '@firestitch/colorpicker';
26
26
  import { FsColorPickerModule } from '@firestitch/colorpicker';
27
27
  import * as i3$1 from '@firestitch/file';
28
28
  import { FsFileModule } from '@firestitch/file';
@@ -33,13 +33,16 @@ import * as i2 from '@firestitch/dialog';
33
33
  import { FsDialogModule } from '@firestitch/dialog';
34
34
  import { filter, map, groupBy, debounceTime, mergeAll, takeUntil, switchMap, delay } from 'rxjs/operators';
35
35
  import Moveable from 'moveable';
36
- import { Subject, BehaviorSubject, fromEvent } from 'rxjs';
37
- import { guid, index } from '@firestitch/common';
36
+ import { Subject, BehaviorSubject, from, throwError, fromEvent } from 'rxjs';
37
+ import { guid, index, round } from '@firestitch/common';
38
38
  import * as i1 from '@angular/material/dialog';
39
39
  import { MAT_DIALOG_DATA } from '@angular/material/dialog';
40
40
  import * as i5 from '@angular/material/divider';
41
+ import * as i1$1 from '@angular/common/http';
41
42
  import * as i2$1 from '@firestitch/prompt';
42
43
  import * as i8 from '@angular/material/core';
44
+ import * as i10 from '@firestitch/autocomplete';
45
+ import { FsAutocompleteModule } from '@firestitch/autocomplete';
43
46
 
44
47
  var BlockType;
45
48
  (function (BlockType) {
@@ -130,8 +133,13 @@ class BlocksStore {
130
133
  if (initBlock) {
131
134
  block = this._createBlock(block);
132
135
  }
133
- this._config.blockUpload(block, fsFile.file)
134
- .pipe(takeUntil(this._destroy$))
136
+ from(fsFile.imageInfo)
137
+ .pipe(switchMap((imageInfo) => {
138
+ const ratio = imageInfo.height / imageInfo.width;
139
+ block.width = this._config.width * .4;
140
+ block.height = block.width * ratio;
141
+ return this._config.blockUpload(block, fsFile.file);
142
+ }), takeUntil(this._destroy$))
135
143
  .subscribe((newBlock) => {
136
144
  this._appendBlock(newBlock);
137
145
  });
@@ -191,7 +199,13 @@ class BlocksStore {
191
199
  });
192
200
  }
193
201
  _createBlock(block) {
194
- const newBlock = Object.assign(Object.assign({ shapeBottomLeft: 'round', shapeTopLeft: 'round', shapeTopRight: 'round', shapeBottomRight: 'round', verticalAlign: 'top', horizontalAlign: 'left' }, block), { guid: block.guid || guid('xxxxxxxxxxxx') });
202
+ const newBlock = Object.assign(Object.assign({ shapeBottomLeft: 'round', shapeTopLeft: 'round', shapeTopRight: 'round', shapeBottomRight: 'round', verticalAlign: 'top', horizontalAlign: 'left' }, block), { guid: block.guid || guid('xxxxxxxxxxxx'), keepRatio: [
203
+ BlockType.Checkbox,
204
+ BlockType.RadioButton,
205
+ BlockType.Image,
206
+ BlockType.Pdf,
207
+ ]
208
+ .indexOf(block.type) !== -1 });
195
209
  let width = (this._config.width * .333).toFixed(2);
196
210
  let height = width / 2;
197
211
  if (newBlock.type === BlockType.Rectangle) {
@@ -201,7 +215,6 @@ class BlocksStore {
201
215
  else if (newBlock.type === BlockType.Checkbox || newBlock.type === BlockType.RadioButton) {
202
216
  width = .25;
203
217
  height = .25;
204
- newBlock.keepRatio = true;
205
218
  }
206
219
  else {
207
220
  width = 2;
@@ -263,14 +276,13 @@ class LayersReorderDialogComponent {
263
276
  }
264
277
  }
265
278
  LayersReorderDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: LayersReorderDialogComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component });
266
- LayersReorderDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: LayersReorderDialogComponent, selector: "ng-component", ngImport: i0, template: "<fs-dialog>\n <h1 mat-dialog-title><mat-icon>swap_vert</mat-icon> Reorder Fields</h1>\n <mat-dialog-content>\n <mat-list cdkDropList (cdkDropListDropped)=\"swapItems($event)\">\n <mat-divider></mat-divider>\n <ng-container *ngFor=\"let blockComponent of blockComponents\">\n <mat-list-item cdkDrag cdkDragLockAxis=\"y\">\n <mat-icon cdkDragHandle>drag_handle</mat-icon>\n <mat-icon>\n {{ blockTypeIcons[blockComponent.block.type] }}\n </mat-icon>\n <span class=\"block-label\">\n {{ blockComponent.block.label || 'no label' }}\n </span>\n </mat-list-item>\n <mat-divider></mat-divider>\n </ng-container>\n </mat-list>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-button color=\"primary\" (click)=\"done()\">Done</button>\n </mat-dialog-actions>\n</fs-dialog>\n", styles: ["h1{display:flex}.mat-icon{margin-right:20px}.block-label{min-width:200px}.cdk-drag-preview{display:flex;padding-left:15px!important;background:#fff;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-preview ::ng-deep .mat-list-item-content{display:flex;flex-direction:row;align-items:center;font-size:16px}.cdk-drag-handle{cursor:grab}.cdk-drag-placeholder{opacity:.2}\n"], components: [{ type: i2.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i4.MatList, selector: "mat-list, mat-action-list", inputs: ["disableRipple", "disabled"], exportAs: ["matList"] }, { type: i5.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { type: i4.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["disableRipple", "disabled"], exportAs: ["matListItem"] }, { type: i6.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i7.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "id", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListAutoScrollDisabled", "cdkDropListOrientation", "cdkDropListLockAxis", "cdkDropListData", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { type: i11.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragDisabled", "cdkDragStartDelay", "cdkDragLockAxis", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragBoundary", "cdkDragRootElement", "cdkDragPreviewContainer", "cdkDragData", "cdkDragFreeDragPosition"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { type: i7.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }] });
279
+ LayersReorderDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: LayersReorderDialogComponent, selector: "ng-component", ngImport: i0, template: "<fs-dialog>\n <h1 mat-dialog-title><mat-icon>swap_vert</mat-icon> Reorder Fields</h1>\n <mat-dialog-content>\n <mat-list cdkDropList (cdkDropListDropped)=\"swapItems($event)\">\n <mat-divider></mat-divider>\n <ng-container *ngFor=\"let blockComponent of blockComponents\">\n <mat-list-item cdkDrag cdkDragLockAxis=\"y\">\n <mat-icon cdkDragHandle>drag_handle</mat-icon>\n <mat-icon>\n {{ blockTypeIcons[blockComponent.block.type] }}\n </mat-icon>\n <span class=\"block-label\">\n {{ blockComponent.block.label || blockComponent.block.content || 'No Content'}} \n </span>\n </mat-list-item>\n <mat-divider></mat-divider>\n </ng-container>\n </mat-list>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-button color=\"primary\" (click)=\"done()\">Done</button>\n </mat-dialog-actions>\n</fs-dialog>\n", styles: ["h1{display:flex}.mat-icon{margin-right:20px}.block-label{min-width:200px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:1000px}.cdk-drag-preview{display:flex;padding-left:15px!important;background:#fff;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-preview ::ng-deep .mat-list-item-content{display:flex;flex-direction:row;align-items:center;font-size:16px}.cdk-drag-handle{cursor:grab}.cdk-drag-placeholder{opacity:.2}\n"], components: [{ type: i2.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i4.MatList, selector: "mat-list, mat-action-list", inputs: ["disableRipple", "disabled"], exportAs: ["matList"] }, { type: i5.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { type: i4.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["disableRipple", "disabled"], exportAs: ["matListItem"] }, { type: i6.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i7.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "id", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListAutoScrollDisabled", "cdkDropListOrientation", "cdkDropListLockAxis", "cdkDropListData", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { type: i13.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragDisabled", "cdkDragStartDelay", "cdkDragLockAxis", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragBoundary", "cdkDragRootElement", "cdkDragPreviewContainer", "cdkDragData", "cdkDragFreeDragPosition"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { type: i7.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
267
280
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: LayersReorderDialogComponent, decorators: [{
268
281
  type: Component,
269
282
  args: [{
270
283
  templateUrl: './layers-reorder-dialog.component.html',
271
- styleUrls: [
272
- './layers-reorder-dialog.component.scss',
273
- ]
284
+ styleUrls: ['./layers-reorder-dialog.component.scss'],
285
+ changeDetection: ChangeDetectionStrategy.OnPush,
274
286
  }]
275
287
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
276
288
  type: Inject,
@@ -284,6 +296,7 @@ class BlockEditorService {
284
296
  this._selectedBlocks$ = new BehaviorSubject([]);
285
297
  this._blockComponents = new Map();
286
298
  this._destroy$ = new Subject();
299
+ this._blockInited$ = new Subject();
287
300
  }
288
301
  get blockComponents() {
289
302
  return Array.from(this._blockComponents.values());
@@ -300,7 +313,7 @@ class BlockEditorService {
300
313
  this._store.blockAdd(block, newBlock);
301
314
  }
302
315
  blockUpload(block, fsFile, newBlock = false) {
303
- this._store.blockUpload(block, fsFile, false);
316
+ this._store.blockUpload(block, fsFile, true);
304
317
  }
305
318
  blockRemove(block) {
306
319
  this._store.blockRemove(block);
@@ -321,6 +334,9 @@ class BlockEditorService {
321
334
  get blockAdded$() {
322
335
  return this._store.blockAdded$;
323
336
  }
337
+ get blockInited$() {
338
+ return this._blockInited$;
339
+ }
324
340
  get blockRemoved$() {
325
341
  return this._store.blockRemoved$;
326
342
  }
@@ -382,11 +398,11 @@ class BlockEditorService {
382
398
  hasSelectionRange() {
383
399
  return this._selectionRange && (this._selectionRange.baseOffset - this._selectionRange.focusOffset) > 0;
384
400
  }
385
- registerBlock(block, blockComponent) {
401
+ initBlock(block, blockComponent) {
386
402
  this._blockComponents.set(block, blockComponent);
387
- this.blockComponents.push(block);
403
+ this._blockInited$.next(block);
388
404
  }
389
- unregisterBlock(block) {
405
+ destroyBlock(block) {
390
406
  this._blockComponents.delete(block);
391
407
  }
392
408
  registerContainer(container) {
@@ -397,10 +413,8 @@ class BlockEditorService {
397
413
  }
398
414
  openReorderDialog() {
399
415
  const blockComponents = this.blockComponents
400
- .filter((blockCmp) => {
401
- return this._store.isReordableBlock(blockCmp.block);
402
- })
403
- .sort((blockCmpA, blockCmpB) => (blockCmpA.block.tabIndex - blockCmpB.block.tabIndex));
416
+ .sort((blockCmpA, blockCmpB) => (blockCmpA.block.index - blockCmpB.block.index))
417
+ .reverse();
404
418
  this._dialog
405
419
  .open(LayersReorderDialogComponent, {
406
420
  data: {
@@ -410,8 +424,10 @@ class BlockEditorService {
410
424
  .afterClosed()
411
425
  .pipe(filter((blockComponents) => !!blockComponents), takeUntil(this._destroy$))
412
426
  .subscribe((blockComponents) => {
413
- blockComponents.forEach((blockCmp, index) => {
414
- blockCmp.block.tabIndex = index;
427
+ blockComponents
428
+ .reverse()
429
+ .forEach((blockCmp, index) => {
430
+ blockCmp.block.index = index;
415
431
  this._store.blockChange(blockCmp.block);
416
432
  this._store.updateTabIndex(index);
417
433
  });
@@ -428,6 +444,38 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
428
444
  type: Injectable
429
445
  }], ctorParameters: function () { return [{ type: BlocksStore }, { type: i2.FsDialog }]; } });
430
446
 
447
+ class GoogleFontService {
448
+ constructor(httpClient) {
449
+ this.httpClient = httpClient;
450
+ this._apiKey = 'AIzaSyAoT2RLzCSFUb148F4uLXyAuquAzjcjyGk';
451
+ }
452
+ loadFont(font) {
453
+ var link = document.createElement('link');
454
+ link.rel = 'stylesheet';
455
+ link.href = `https://fonts.googleapis.com/css2?family=${font.family}&family=Tangerine&display=swap`;
456
+ document.getElementsByTagName('head')[0].appendChild(link);
457
+ }
458
+ getItems() {
459
+ if (this._fonts$) {
460
+ return this._fonts$.asObservable();
461
+ }
462
+ if (!this._apiKey) {
463
+ return throwError(`Error: api key was not provided to the google fonts service`);
464
+ }
465
+ const url = `https://www.googleapis.com/webfonts/v1/webfonts?key=${this._apiKey}`;
466
+ return this.httpClient.get(url)
467
+ .pipe(map((response) => response.items
468
+ .map((item) => {
469
+ return { family: item.family };
470
+ })));
471
+ }
472
+ }
473
+ GoogleFontService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: GoogleFontService, deps: [{ token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
474
+ GoogleFontService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: GoogleFontService });
475
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: GoogleFontService, decorators: [{
476
+ type: Injectable
477
+ }], ctorParameters: function () { return [{ type: i1$1.HttpClient }]; } });
478
+
431
479
  class FsBlockComponent {
432
480
  constructor(_blockEditor, _elementRef, _cdRef) {
433
481
  this._blockEditor = _blockEditor;
@@ -448,6 +496,14 @@ class FsBlockComponent {
448
496
  get editable() {
449
497
  return this._editable;
450
498
  }
499
+ get boxShadow() {
500
+ if (!this.block.shadowColor) {
501
+ return null;
502
+ }
503
+ const shadowOpacity = ((Number(this.block.shadowOpacity || 100) / 100) * 255).toString(16).padStart(2, '0');
504
+ const shadow = `${this.block.shadowX}pt ${(this.block.shadowY || 0)}pt ${(this.block.shadowBlur || 0)}pt ${(this.block.shadowSpread || 0)}pt ${this.block.shadowColor}${shadowOpacity}`;
505
+ return shadow;
506
+ }
451
507
  set elementGuidelines(value) {
452
508
  this.moveable.elementGuidelines = value;
453
509
  }
@@ -465,7 +521,6 @@ class FsBlockComponent {
465
521
  }
466
522
  set transformable(value) {
467
523
  this._transformable = value;
468
- this.moveable.draggable = value;
469
524
  this.moveable.resizable = value;
470
525
  this.moveable.roundable = value;
471
526
  this.moveable.rotatable = value;
@@ -504,6 +559,12 @@ class FsBlockComponent {
504
559
  ngOnInit() {
505
560
  this.unit = this._blockEditor.config.unit;
506
561
  this.content = this.block.content;
562
+ this.block.shadowOpacity = this.block.shadowOpacity || 100;
563
+ this._blockEditor.blockInited$
564
+ .pipe(takeUntil(this._destroy$))
565
+ .subscribe(() => {
566
+ this._updateElementGuidelines();
567
+ });
507
568
  this._blockEditor.blockChanged$
508
569
  .pipe(filter((block) => block === this.block), takeUntil(this._destroy$))
509
570
  .subscribe((block) => {
@@ -512,6 +573,7 @@ class FsBlockComponent {
512
573
  this.height = block.height;
513
574
  this.top = block.top;
514
575
  this.left = block.left;
576
+ this.rotate = this.block.rotate;
515
577
  this._cdRef.markForCheck();
516
578
  });
517
579
  }
@@ -524,7 +586,8 @@ class FsBlockComponent {
524
586
  this.height = this.block.height;
525
587
  this.top = this.block.top;
526
588
  this.left = this.block.left;
527
- this._blockEditor.registerBlock(this.block, this);
589
+ this.rotate = this.block.rotate;
590
+ this._blockEditor.initBlock(this.block, this);
528
591
  });
529
592
  }
530
593
  pxToIn(px) {
@@ -535,6 +598,9 @@ class FsBlockComponent {
535
598
  }
536
599
  deselect() {
537
600
  this.transformable = false;
601
+ this.disableContentEdit();
602
+ }
603
+ disableContentEdit() {
538
604
  this.editable = false;
539
605
  }
540
606
  deselectContent() {
@@ -555,7 +621,7 @@ class FsBlockComponent {
555
621
  sel.addRange(range);
556
622
  }
557
623
  ngOnDestroy() {
558
- this._blockEditor.unregisterBlock(this.block);
624
+ this._blockEditor.destroyBlock(this.block);
559
625
  this._destroy$.next();
560
626
  this._destroy$.complete();
561
627
  }
@@ -569,11 +635,16 @@ class FsBlockComponent {
569
635
  _triggerChanged() {
570
636
  this._blockEditor.blockChange(this.block);
571
637
  }
638
+ _updateElementGuidelines() {
639
+ this.moveable.elementGuidelines = this._blockEditor.blockComponents
640
+ .map((blockComponent) => blockComponent.el)
641
+ .filter((el) => !el.isSameNode(this.el));
642
+ }
572
643
  _initMoveable() {
573
644
  this._moveable = new Moveable(this._elementRef.nativeElement, {
574
645
  target: this.el,
575
646
  container: this._blockEditor.container,
576
- draggable: false,
647
+ draggable: true,
577
648
  resizable: false,
578
649
  scalable: false,
579
650
  rotatable: false,
@@ -581,12 +652,16 @@ class FsBlockComponent {
581
652
  origin: false,
582
653
  keepRatio: this.block.keepRatio,
583
654
  snappable: true,
655
+ snapDirections: { left: true, top: true, right: true, bottom: true, center: true, middle: true },
656
+ elementSnapDirections: { left: true, top: true, right: true, bottom: true, center: true, middle: true },
584
657
  edge: false,
585
658
  throttleDrag: 1,
586
659
  throttleScale: 0.01,
587
660
  throttleRotate: 1,
588
661
  throttleResize: 1,
662
+ snapDistFormat: (v, type) => `${this.round(v / 96, 2)}`,
589
663
  });
664
+ this._updateElementGuidelines();
590
665
  this.moveable
591
666
  .on('clip', (e) => {
592
667
  this.block.clipPath = e.clipStyle;
@@ -595,7 +670,7 @@ class FsBlockComponent {
595
670
  });
596
671
  this.moveable
597
672
  .on('dragStart', () => {
598
- this.editable = false;
673
+ this.disableContentEdit();
599
674
  this.transformating = true;
600
675
  this._cdRef.markForCheck();
601
676
  })
@@ -611,7 +686,7 @@ class FsBlockComponent {
611
686
  this._cdRef.markForCheck();
612
687
  })
613
688
  .on('resizeStart', () => {
614
- this.editable = false;
689
+ this.disableContentEdit();
615
690
  this.zoompan.disable();
616
691
  this.transformating = true;
617
692
  this._cdRef.markForCheck();
@@ -649,22 +724,27 @@ class FsBlockComponent {
649
724
  this.transformating = false;
650
725
  this._cdRef.markForCheck();
651
726
  })
652
- .on('rotateStart', () => {
653
- this.zoompan.disable();
654
- this.editable = false;
655
- this._rotateStart = this.block.rotate || 0;
656
- this.transformating = true;
657
- this._cdRef.markForCheck();
727
+ .on('rotateStart', ({ inputEvent }) => {
728
+ if (inputEvent) {
729
+ this.zoompan.disable();
730
+ this.disableContentEdit();
731
+ this.transformating = true;
732
+ this._cdRef.markForCheck();
733
+ }
658
734
  })
659
- .on('rotate', ({ rotate, transform }) => {
660
- this.block.rotate = this._rotateStart + rotate;
735
+ .on('rotate', ({ inputEvent, transform, rotation }) => {
661
736
  this.el.style.transform = transform;
662
- this._triggerChanged();
663
- this.zoompan.enable();
737
+ this.block.rotate = rotation % 360;
738
+ if (inputEvent) {
739
+ this._triggerChanged();
740
+ this.zoompan.enable();
741
+ }
664
742
  })
665
- .on('rotateEnd', () => {
666
- this.transformating = false;
667
- this._cdRef.markForCheck();
743
+ .on('rotateEnd', ({ inputEvent }) => {
744
+ if (inputEvent) {
745
+ this.transformating = false;
746
+ this._cdRef.markForCheck();
747
+ }
668
748
  });
669
749
  }
670
750
  _initEvents() {
@@ -708,7 +788,7 @@ class FsBlockComponent {
708
788
  }
709
789
  }
710
790
  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 });
711
- FsBlockComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsBlockComponent, selector: "fs-block", inputs: { block: "block", html: "html", zoompan: "zoompan" }, host: { properties: { "class.transforming": "this.transformating" } }, viewQueries: [{ propertyName: "element", first: true, predicate: ["element"], descendants: true, static: true }, { propertyName: "contentElement", first: true, predicate: ["contentElement"], descendants: true, static: true }, { propertyName: "contentEditable", first: true, predicate: ["contentEditable"], descendants: true, static: true }], ngImport: i0, template: "<div\n #element\n [class]=\"'block ' + 'block-' + block.type\"\n [ngClass]=\"{ \n editable: editable, \n readonly: block.readonly,\n required: block.required\n }\">\n <div\n #contentElement\n class=\"content\"\n [style.zIndex]=\"block.index\"\n [style.borderColor]=\"block.borderColor\"\n [style.borderWidth]=\"block.borderWidth ? block.borderWidth + 'pt' : ''\"\n [style.borderStyle]=\"block.borderColor ? 'solid' : 'dashed'\"\n [style.textAlign]=\"block.horizontalAlign\"\n [style.fontStyle]=\"block.italic ? 'italic' : ''\"\n [style.fontSize]=\"block.fontSize ? block.fontSize + 'pt' : ''\"\n [style.lineHeight]=\"block.lineHeight ? block.lineHeight + 'pt' : ''\"\n [style.color]=\"block.fontColor\"\n [style.fontWeight]=\"block.bold ? 'bold' : ''\"\n [style.textDecoration]=\"block.underline ? 'underline' : ''\"\n [style.paddingTop]=\"block.paddingTop ? block.paddingTop + unit : ''\"\n [style.paddingBottom]=\"block.paddingBottom ? block.paddingBottom + unit : ''\"\n [style.paddingLeft]=\"block.paddingLeft ? block.paddingLeft + unit : ''\"\n [style.paddingRight]=\"block.paddingRight ? block.paddingRight + unit : ''\"\n [style.padding]=\"block.padding ? block.padding + unit : ''\"\n [style.clipPath]=\"block.clipPath\"\n [style.backgroundColor]=\"block.backgroundColor\"\n [style.borderBottomLeftRadius]=\"block.shapeRadius && block.shapeBottomLeft === 'round' ? block.shapeRadius + unit : ''\"\n [style.borderBottomRightRadius]=\"block.shapeRadius && block.shapeBottomRight === 'round' ? block.shapeRadius + unit : ''\"\n [style.borderTopRightRadius]=\"block.shapeRadius && block.shapeTopRight === 'round' ? block.shapeRadius + unit : ''\"\n [style.borderTopLeftRadius]=\"block.shapeRadius && block.shapeTopLeft === 'round' ? block.shapeRadius + unit : ''\"\n [ngClass]=\"{\n 'editable': editable,\n 'vertical-align-center': block.verticalAlign === 'center',\n 'vertical-align-bottom': block.verticalAlign === 'bottom'\n }\">\n <ng-container [ngSwitch]=\"block.type\">\n <ng-container *ngSwitchCase=\"BlockType.Pdf\">\n <img [src]=\"block.imageUrl\">\n </ng-container>\n <img [src]=\"block.imageUrl\" *ngIf=\"block.imageUrl\">\n </ng-container>\n <ng-container *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText || block.type === BlockType.RadioButton || block.type === BlockType.Checkbox || block.type === BlockType.Date\">\n {{block.label || block.name}}\n </ng-container>\n <div\n #contentEditable\n [contentEditable]=\"editable\"\n class=\"content-editable\"\n [innerHTML]=\"content\">\n </div>\n </div>\n</div>\n", styles: [":host ::ng-deep .moveable-control{width:10px!important;height:10px!important;margin-top:-5px!important;margin-left:-5px!important}:host.transforming ::ng-deep .moveable-control,:host.transforming ::ng-deep .moveable-rotation{display:none}.block{position:absolute;display:block;outline:none;-webkit-user-select:none;user-select:none;cursor:pointer}.block.block-shorttext,.block.block-longtext,.block.block-date,.block.block-radiobutton,.block.block-signature,.block.block-checkbox{background-color:#aab5e1cc;color:#585555;font-size:12px}.block.block-radiobutton{border-radius:50%}.block.required{background-color:#f7adaa}.block .content-editable{outline:none;position:relative}.block.editable .content-editable{cursor:text}.block .content{flex-direction:column;height:100%;display:flex;border:1px solid transparent;position:relative;box-sizing:border-box;overflow:hidden}.block .content fs-html-editor{width:100%}.block .content.vertical-align-center{justify-content:center}.block .content.vertical-align-bottom{justify-content:flex-end}.block .content img{width:100%;height:100%;position:absolute}:host ::ng-deep fs-html-editor .bottom-line,:host ::ng-deep fs-html-editor .fr-toolbar{display:none!important}:host ::ng-deep fs-html-editor .fr-wrapper{background:none!important;border:none!important}:host ::ng-deep .moveable-line:not(.moveable-rotation-line):not(.moveable-guideline){background:transparent!important}\n"], directives: [{ type: i11.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i11.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i11.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i11.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
791
+ FsBlockComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsBlockComponent, selector: "fs-block", inputs: { block: "block", html: "html", zoompan: "zoompan" }, host: { properties: { "class.transforming": "this.transformating" } }, viewQueries: [{ propertyName: "element", first: true, predicate: ["element"], descendants: true, static: true }, { propertyName: "contentElement", first: true, predicate: ["contentElement"], descendants: true, static: true }, { propertyName: "contentEditable", first: true, predicate: ["contentEditable"], descendants: true, static: true }], ngImport: i0, template: "<div\n #element\n [class]=\"'block ' + 'block-' + block.type\"\n [ngClass]=\"{ \n editable: editable, \n readonly: block.readonly,\n required: block.required\n }\">\n <div\n #contentElement\n class=\"content\"\n [style.zIndex]=\"block.index\"\n [style.borderColor]=\"block.borderColor\"\n [style.borderWidth]=\"block.borderWidth ? block.borderWidth + 'pt' : ''\"\n [style.borderStyle]=\"block.borderColor ? 'solid' : 'dashed'\"\n [style.textAlign]=\"block.horizontalAlign\"\n [style.fontStyle]=\"block.italic ? 'italic' : ''\"\n [style.fontFamily]=\"block.fontFamily || ''\"\n [style.fontSize]=\"block.fontSize ? block.fontSize + 'pt' : ''\"\n [style.lineHeight]=\"block.lineHeight ? block.lineHeight + 'pt' : ''\"\n [style.color]=\"block.fontColor\"\n [style.fontWeight]=\"block.bold ? 'bold' : ''\"\n [style.textDecoration]=\"block.underline ? 'underline' : ''\"\n [style.paddingTop]=\"block.paddingTop ? block.paddingTop + 'pt' : ''\"\n [style.paddingBottom]=\"block.paddingBottom ? block.paddingBottom + 'pt' : ''\"\n [style.paddingLeft]=\"block.paddingLeft ? block.paddingLeft + 'pt' : ''\"\n [style.paddingRight]=\"block.paddingRight ? block.paddingRight + 'pt' : ''\"\n [style.clipPath]=\"block.clipPath\"\n [style.backgroundColor]=\"block.backgroundColor\"\n [style.borderBottomLeftRadius]=\"block.shapeRadius && block.shapeBottomLeft === 'round' ? block.shapeRadius + 'pt' : ''\"\n [style.borderBottomRightRadius]=\"block.shapeRadius && block.shapeBottomRight === 'round' ? block.shapeRadius + 'pt' : ''\"\n [style.borderTopRightRadius]=\"block.shapeRadius && block.shapeTopRight === 'round' ? block.shapeRadius + 'pt' : ''\"\n [style.borderTopLeftRadius]=\"block.shapeRadius && block.shapeTopLeft === 'round' ? block.shapeRadius + 'pt' : ''\"\n [style.boxShadow]=\"boxShadow\"\n [ngClass]=\"{\n 'editable': editable,\n 'vertical-align-center': block.verticalAlign === 'center',\n 'vertical-align-bottom': block.verticalAlign === 'bottom'\n }\">\n <ng-container [ngSwitch]=\"block.type\">\n <ng-container *ngSwitchCase=\"BlockType.Pdf\">\n <img [src]=\"block.imageUrl\">\n </ng-container>\n <img [src]=\"block.imageUrl\" *ngIf=\"block.imageUrl\">\n </ng-container>\n <ng-container *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText || block.type === BlockType.RadioButton || block.type === BlockType.Checkbox || block.type === BlockType.Date\">\n {{block.label || block.name}}\n </ng-container>\n <div\n #contentEditable\n [contentEditable]=\"editable\"\n class=\"content-editable\"\n [innerHTML]=\"content\">\n </div>\n </div>\n</div>\n", styles: [":host ::ng-deep .moveable-control{width:10px!important;height:10px!important;margin-top:-5px!important;margin-left:-5px!important}:host.transforming ::ng-deep .moveable-control,:host.transforming ::ng-deep .moveable-rotation{display:none}.block{position:absolute;display:block;outline:none;-webkit-user-select:none;user-select:none;cursor:pointer}.block.block-shorttext,.block.block-longtext,.block.block-date,.block.block-radiobutton,.block.block-signature,.block.block-checkbox{background-color:#aab5e1cc;color:#585555;font-size:12px}.block.block-radiobutton{border-radius:50%}.block.required{background-color:#f7adaa}.block .content-editable{outline:none;position:relative}.block.editable .content-editable{cursor:text}.block .content{flex-direction:column;height:100%;display:flex;border:0px solid transparent;position:relative;box-sizing:border-box;overflow:hidden}.block .content fs-html-editor{width:100%}.block .content.vertical-align-center{justify-content:center}.block .content.vertical-align-bottom{justify-content:flex-end}.block .content img{width:100%;height:100%;position:absolute}:host ::ng-deep fs-html-editor .bottom-line,:host ::ng-deep fs-html-editor .fr-toolbar{display:none!important}:host ::ng-deep fs-html-editor .fr-wrapper{background:none!important;border:none!important}:host ::ng-deep .moveable-line:not(.moveable-rotation-line):not(.moveable-guideline){background:transparent!important}\n"], directives: [{ type: i13.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i13.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i13.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i13.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
712
792
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsBlockComponent, decorators: [{
713
793
  type: Component,
714
794
  args: [{
@@ -763,12 +843,41 @@ const BlockFormats = [
763
843
  { value: BlockFormat.YYYYMMDD, name: 'YYYY/MM/DD', blockTypes: [BlockType.Date] },
764
844
  ];
765
845
 
846
+ class FontComponent {
847
+ constructor(_el, _googleFontService) {
848
+ this._el = _el;
849
+ this._googleFontService = _googleFontService;
850
+ }
851
+ ngOnInit() {
852
+ var observer = new IntersectionObserver((entries) => {
853
+ if (entries[0].isIntersecting === true) {
854
+ this._googleFontService.loadFont(this.font);
855
+ }
856
+ }, { threshold: [0] });
857
+ observer.observe(this._el.nativeElement);
858
+ }
859
+ }
860
+ FontComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FontComponent, deps: [{ token: i0.ElementRef }, { token: GoogleFontService }], target: i0.ɵɵFactoryTarget.Component });
861
+ FontComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FontComponent, selector: "app-font", inputs: { font: "font" }, ngImport: i0, template: "<div\n [style.fontFamily]=\"font.family\">\n {{font.family}}\n</div>\n", styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush });
862
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FontComponent, decorators: [{
863
+ type: Component,
864
+ args: [{
865
+ selector: 'app-font',
866
+ templateUrl: 'font.component.html',
867
+ styleUrls: ['font.component.scss'],
868
+ changeDetection: ChangeDetectionStrategy.OnPush,
869
+ }]
870
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: GoogleFontService }]; }, propDecorators: { font: [{
871
+ type: Input
872
+ }] } });
873
+
766
874
  class SidebarComponent {
767
- constructor(_el, _blockEditor, _cdRef, _prompt, _document) {
875
+ constructor(_el, _blockEditor, _cdRef, _prompt, _googleFontService, _document) {
768
876
  this._el = _el;
769
877
  this._blockEditor = _blockEditor;
770
878
  this._cdRef = _cdRef;
771
879
  this._prompt = _prompt;
880
+ this._googleFontService = _googleFontService;
772
881
  this._document = _document;
773
882
  this.zoomCenter = new EventEmitter();
774
883
  this.BlockTypes = BlockTypes;
@@ -777,6 +886,12 @@ class SidebarComponent {
777
886
  this.BlockType = BlockType;
778
887
  this.formats = [];
779
888
  this._destroy$ = new Subject();
889
+ this.fontFetch = (value) => {
890
+ return this._googleFontService.getItems();
891
+ };
892
+ this.fontDisplayWith = (value) => {
893
+ return value === null || value === void 0 ? void 0 : value.family;
894
+ };
780
895
  }
781
896
  get el() {
782
897
  return this._el.nativeElement;
@@ -797,6 +912,9 @@ class SidebarComponent {
797
912
  this._cdRef.markForCheck();
798
913
  });
799
914
  }
915
+ fontChanged(font) {
916
+ this._blockEditor.selectedBlockComponentChangeProperty(font === null || font === void 0 ? void 0 : font.family, 'fontFamily');
917
+ }
800
918
  verticalAlignClick(value) {
801
919
  this._blockEditor.selectedBlockComponentChangeProperty(value, 'verticalAlign');
802
920
  }
@@ -806,18 +924,6 @@ class SidebarComponent {
806
924
  fontColorChange(value) {
807
925
  this._blockEditor.selectedBlockComponentChangeProperty(value, 'fontColor');
808
926
  }
809
- lineHeightChange(value) {
810
- value = this.validNumeric(value) ? value : null;
811
- this._blockEditor.selectedBlockComponentChangeProperty(value, 'lineHeight');
812
- }
813
- fontSizeChange(value) {
814
- value = this.validNumeric(value) ? value : null;
815
- this._blockEditor.selectedBlockComponentChangeProperty(value, 'fontSize');
816
- }
817
- borderWidthChange(value) {
818
- value = this.validNumeric(value) ? value : null;
819
- this._blockEditor.selectedBlockComponentChangeProperty(value, 'borderWidth');
820
- }
821
927
  italicClick() {
822
928
  this._blockEditor.selectedBlockComponentChangeProperty(!this.block.italic, 'italic');
823
929
  }
@@ -827,29 +933,8 @@ class SidebarComponent {
827
933
  backgroundColorChange(value) {
828
934
  this._blockEditor.selectedBlockComponentChangeProperty(value, 'backgroundColor');
829
935
  }
830
- widthChange(value) {
831
- value = this.validNumeric(value) ? value : null;
832
- this._blockEditor.selectedBlockComponentChangeProperty(value, 'width');
833
- }
834
- heightChange(value) {
835
- value = this.validNumeric(value) ? value : null;
836
- this._blockEditor.selectedBlockComponentChangeProperty(value, 'height');
837
- }
838
- topChange(value) {
839
- value = this.validNumeric(value) ? value : null;
840
- this._blockEditor.selectedBlockComponentChangeProperty(value, 'top');
841
- }
842
- leftChange(value) {
843
- value = this.validNumeric(value) ? value : null;
844
- this._blockEditor.selectedBlockComponentChangeProperty(value, 'left');
845
- }
846
- rotateChange(value) {
847
- value = this.validNumeric(value) ? value : null;
848
- this._blockEditor.selectedBlockComponentChangeProperty(value, 'rotate');
849
- }
850
- paddingChange(name, value) {
851
- value = this.validNumeric(value) ? value : null;
852
- this._blockEditor.selectedBlockComponentChangeProperty(value, 'padding');
936
+ shadowColorChange(value) {
937
+ this._blockEditor.selectedBlockComponentChangeProperty(value, 'shadowColor');
853
938
  }
854
939
  paddingAllChange(value) {
855
940
  value = this.validNumeric(value) ? value : null;
@@ -857,10 +942,20 @@ class SidebarComponent {
857
942
  this.block.paddingLeft = value;
858
943
  this.block.paddingBottom = value;
859
944
  this.block.paddingRight = value;
860
- this.paddingChange('top', value);
861
- this.paddingChange('left', value);
862
- this.paddingChange('right', value);
863
- this.paddingChange('bottom', value);
945
+ this._blockEditor.selectedBlocks
946
+ .forEach((block) => {
947
+ this._blockEditor.blockChange(block);
948
+ });
949
+ }
950
+ paddingKeypress(event, name) {
951
+ this.block.padding = null;
952
+ this.numericInputKeypress(event, name, 1);
953
+ }
954
+ paddingAllKeypress(event, unit = 1) {
955
+ if (event.code === 'ArrowUp' || event.code === 'ArrowDown') {
956
+ this.block.padding = round(Number(this.block.padding || 0) + ((event.code === 'ArrowDown' ? -1 : 1) * unit), 3);
957
+ this.paddingAllChange(this.block.padding);
958
+ }
864
959
  }
865
960
  borderColorChange(value) {
866
961
  this._blockEditor.selectedBlockComponentChangeProperty(value, 'borderColor');
@@ -875,6 +970,10 @@ class SidebarComponent {
875
970
  const value = this.block[name] === 'round' ? 'square' : 'round';
876
971
  this._blockEditor.selectedBlockComponentChangeProperty(value, name);
877
972
  }
973
+ numberChange(value, name) {
974
+ value = this.validNumeric(value) ? Number(value) : null;
975
+ this._blockEditor.selectedBlockComponentChangeProperty(value, name);
976
+ }
878
977
  imageRemove() {
879
978
  this._blockEditor.selectedBlockComponentChangeProperty(null, 'imageUrl');
880
979
  }
@@ -882,9 +981,6 @@ class SidebarComponent {
882
981
  this.clippable = !this.clippable;
883
982
  this._blockEditor.selectedBlockComponentChangeProperty(this.clippable, 'clippable');
884
983
  }
885
- shapeRadiusChange(value) {
886
- this._blockEditor.selectedBlockComponentChangeProperty(value, 'shapeRadius');
887
- }
888
984
  blockChangeProperty(value, name) {
889
985
  this._blockEditor.selectedBlockComponentChangeProperty(value, name);
890
986
  }
@@ -909,17 +1005,19 @@ class SidebarComponent {
909
1005
  }
910
1006
  }
911
1007
  blockUpload(type, fsFile) {
912
- this._blockEditor.blockUpload({
913
- type,
914
- }, fsFile, true);
1008
+ this._blockEditor.blockUpload({ type }, fsFile, true);
915
1009
  }
916
1010
  blockAdd(type) {
917
1011
  if (type === BlockType.Pdf || type === BlockType.Image) {
918
1012
  return;
919
1013
  }
920
- this._blockEditor.blockAdd({
1014
+ const block = {
921
1015
  type,
922
- }, true);
1016
+ shadowX: 2,
1017
+ shadowY: 2,
1018
+ shadowBlur: 4,
1019
+ };
1020
+ this._blockEditor.blockAdd(block, true);
923
1021
  }
924
1022
  layerMove(direction) {
925
1023
  this._blockEditor.blockComponents.forEach((blockComponent) => {
@@ -952,6 +1050,12 @@ class SidebarComponent {
952
1050
  inputFocus(event) {
953
1051
  event.target.select();
954
1052
  }
1053
+ numericInputKeypress(event, name, unit = 1) {
1054
+ if (event.code === 'ArrowUp' || event.code === 'ArrowDown') {
1055
+ this.block[name] = round(Number(this.block[name] || 0) + ((event.code === 'ArrowDown' ? -1 : 1) * unit), 3);
1056
+ this._blockEditor.selectedBlockComponentChangeProperty(this.block[name], name);
1057
+ }
1058
+ }
955
1059
  ngOnDestroy() {
956
1060
  this._destroy$.next();
957
1061
  this._destroy$.complete();
@@ -960,8 +1064,8 @@ class SidebarComponent {
960
1064
  return !value || !!String(value).match(/^\d*\.?\d*$/);
961
1065
  }
962
1066
  }
963
- 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 }, { token: i2$1.FsPrompt }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component });
964
- SidebarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SidebarComponent, selector: "sidebar", inputs: { config: "config", blocks: "blocks" }, outputs: { zoomCenter: "zoomCenter" }, queries: [{ propertyName: "sidebarPanels", predicate: FsBlockEditorSidebarPanelDirective }], ngImport: i0, template: "<div class=\"sidebar\">\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-row\">\n <ng-container *ngFor=\"let blockType of BlockTypes\">\n <ng-container [ngSwitch]=\"blockType.value\">\n <ng-container *ngSwitchCase=\"BlockType.Pdf\">\n <ng-container *ngTemplateOutlet=\"addFile\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"BlockType.Image\">\n <ng-container *ngTemplateOutlet=\"addFile\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container *ngTemplateOutlet=\"addButton\"></ng-container>\n </ng-container>\n </ng-container>\n\n <ng-template #addFile>\n <fs-file (select)=\"blockUpload(blockType.value, $event)\" [accept]=\"blockType.accept\">\n <ng-container *ngTemplateOutlet=\"addButton\"></ng-container>\n </fs-file>\n </ng-template>\n\n <ng-template #addButton>\n <button\n type=\"button\"\n mat-icon-button\n [matTooltip]=\"'Add ' + blockType.name\"\n (click)=\"blockAdd(blockType.value)\">\n <mat-icon>{{blockType.icon}}</mat-icon>\n </button>\n </ng-template>\n </ng-container>\n </div>\n </div>\n\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-row\">\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n matTooltip=\"Reset zoom\"\n (click)=\"zoomCenter.emit()\">\n <mat-icon>crop_free</mat-icon>\n </button>\n <button\n class=\"reorder-layers\"\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"reorderLayers()\">\n <mat-icon>swap_vert</mat-icon>\n </button>\n <ng-container *ngIf=\"block\">\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"blockRemoveClick()\">\n <mat-icon>delete_outline</mat-icon>\n </button>\n <button\n class=\"layer-up\"\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"layerUp()\">\n <mat-icon>arrow_back</mat-icon>\n <mat-icon>layers</mat-icon>\n </button>\n <button\n class=\"layer-down\"\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"layerDown()\">\n <mat-icon>arrow_back</mat-icon>\n <mat-icon>layers</mat-icon>\n </button>\n </ng-container>\n </div>\n </div>\n <ng-container *ngIf=\"block\">\n <div class=\"sidebar-panel info-panel\">\n <div class=\"sidebar-label\">Info</div>\n <div class=\"sidebar-row\">\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.left\"\n name=\"left\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"leftChange($event)\">\n <span matPrefix>X</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.top\"\n name=\"top\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"topChange($event)\">\n <span matPrefix>Y</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.rotate || 0\"\n name=\"rotate\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"rotateChange($event)\">\n <span matPrefix>R</span>\n </mat-form-field>\n </div>\n\n <div class=\"sidebar-row\">\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.width\"\n name=\"width\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"widthChange($event)\">\n <span matPrefix>W</span>\n </mat-form-field>\n\n <div>\n <a (click)=\"toggleKeepRatio()\" class=\"keep-ratio\">\n <mat-icon>{{block.keepRatio ? 'lock_outline' : 'lock_open'}}</mat-icon>\n </a>\n </div>\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.height\"\n name=\"height\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"heightChange($event)\">\n <span matPrefix>H</span>\n </mat-form-field>\n </div>\n </div>\n <ng-container *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText || block.type === BlockType.RadioButton || block.type === BlockType.Checkbox || block.type === BlockType.Date || block.type === BlockType.Signature\">\n <div class=\"sidebar-panel block-form-panel\">\n <div class=\"sidebar-label\">\n <mat-icon>{{blockTypeIcons[block.type]}}</mat-icon>\n {{blockTypeNames[block.type]}}</div>\n <div class=\"sidebar-row\">\n\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <input\n matInput\n [ngModel]=\"block.label\"\n name=\"label\"\n placeholder=\"Label\"\n (ngModelChange)=\"blockChangeProperty($event, 'label')\">\n </mat-form-field>\n\n <ng-container *ngIf=\"block.type !== BlockType.Checkbox && block.type !== BlockType.RadioButton\">\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <textarea\n matInput\n [matTextareaAutosize]=\"true\"\n [ngModel]=\"block.description\"\n name=\"description\"\n placeholder=\"Description\"\n (ngModelChange)=\"blockChangeProperty($event, 'description')\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <mat-form-field\n *ngIf=\"formats.length\"\n class=\"form-field-padless-bottom full-width\">\n <mat-label>Format</mat-label>\n <mat-select\n [(ngModel)]=\"block.format\"\n name=\"format\"\n (ngModelChange)=\"blockChangeProperty($event, 'format')\">\n <mat-option [value]=\"null\">\n None\n </mat-option>\n <mat-option\n *ngFor=\"let item of formats\"\n [value]=\"item.value\">\n {{ item.name }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n\n <ng-container *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText || block.type === BlockType.Date\">\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <textarea\n matInput\n [matTextareaAutosize]=\"true\"\n [ngModel]=\"block.default\"\n name=\"default\"\n placeholder=\"Default\"\n (ngModelChange)=\"blockChangeProperty($event, 'default')\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <ng-container *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText\">\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <textarea\n matInput\n [matTextareaAutosize]=\"true\"\n [ngModel]=\"block.formula\"\n name=\"formula\"\n placeholder=\"Formula\"\n (ngModelChange)=\"blockChangeProperty($event, 'formula')\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <ng-container *ngIf=\"block.type === BlockType.RadioButton || block.type === BlockType.Checkbox\">\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <textarea\n matInput\n [matTextareaAutosize]=\"true\"\n [ngModel]=\"block.groupLabel\"\n name=\"groupLabel\"\n placeholder=\"Group Label\"\n (ngModelChange)=\"blockChangeProperty($event, 'groupLabel')\">\n </textarea>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <mat-label>Group Description</mat-label>\n <textarea\n matInput\n [matTextareaAutosize]=\"true\"\n [ngModel]=\"block.groupDescription\"\n name=\"groupDescription\"\n (ngModelChange)=\"blockChangeProperty($event, 'groupDescription')\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <input\n matInput\n [ngModel]=\"block.name\"\n name=\"name\"\n placeholder=\"Name\"\n (ngModelChange)=\"blockChangeProperty($event, 'name')\">\n </mat-form-field>\n\n <div class=\"form-field-options\">\n <mat-checkbox\n name=\"required\"\n [(ngModel)]=\"block.required\"\n (ngModelChange)=\"blockChangeProperty($event, 'required')\">\n Required\n </mat-checkbox>\n\n <mat-checkbox\n name=\"readonly\"\n [(ngModel)]=\"block.readonly\"\n (ngModelChange)=\"blockChangeProperty($event, 'readonly')\">\n Readonly\n </mat-checkbox>\n </div>\n </div>\n </div>\n </ng-container>\n <div class=\"sidebar-panel typography-panel\">\n <div class=\"sidebar-label\">Typography</div>\n <div class=\"sidebar-row\">\n <fs-color-picker-chip\n (changed)=\"fontColorChange($event)\"\n [color]=\"block.fontColor\">\n </fs-color-picker-chip>\n\n <mat-form-field class=\"form-field-padless font-size\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.fontSize\"\n name=\"fontSize\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"fontSizeChange($event)\"\n placeholder=\"Size\">\n <span matPrefix *ngIf=\"block.fontSize\">S</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless line-height\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.lineHeight\"\n name=\"lineHeight\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"lineHeightChange($event)\"\n placeholder=\"Line\">\n <span matPrefix *ngIf=\"block.lineHeight\">L</span>\n </mat-form-field>\n </div>\n\n <div class=\"sidebar-row style-row\">\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.bold }\"\n (click)=\"boldClick()\">\n <mat-icon>format_bold</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.italic }\"\n (click)=\"italicClick()\">\n <mat-icon>format_italic</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.underline }\"\n (click)=\"underlineClick()\">\n <mat-icon>format_underline</mat-icon>\n </button>\n </div>\n\n <div class=\"sidebar-row align-row\">\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.horizontalAlign === 'left' }\"\n (click)=\"horizontalAlignClick('left')\">\n <mat-icon>format_align_left</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.horizontalAlign === 'center' }\"\n (click)=\"horizontalAlignClick('center')\">\n <mat-icon>format_align_center</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.horizontalAlign === 'right' }\"\n (click)=\"horizontalAlignClick('right')\">\n <mat-icon>format_align_right</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.verticalAlign === 'top' }\"\n (click)=\"verticalAlignClick('top')\">\n <mat-icon>vertical_align_top</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.verticalAlign === 'center' }\"\n (click)=\"verticalAlignClick('center')\">\n <mat-icon>vertical_align_center</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.verticalAlign === 'bottom' }\"\n (click)=\"verticalAlignClick('bottom')\">\n <mat-icon>vertical_align_bottom</mat-icon>\n </button>\n </div>\n </div>\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Border</div>\n\n <div class=\"sidebar-row\">\n <fs-color-picker-chip\n (changed)=\"borderColorChange($event)\"\n [color]=\"block.borderColor\">\n </fs-color-picker-chip>\n\n <mat-form-field class=\"form-field-padless border-width\" floatLabel=\"never\">\n <input\n matInput\n [(ngModel)]=\"block.borderWidth\"\n name=\"borderWidth\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"borderWidthChange($event)\"\n placeholder=\"Width\">\n <span matPrefix *ngIf=\"block.borderWidth\">W</span>\n </mat-form-field>\n </div>\n </div>\n\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Shape</div>\n\n <div class=\"sidebar-row\">\n <fs-color-picker-chip\n (changed)=\"backgroundColorChange($event)\"\n [color]=\"block.backgroundColor\">\n </fs-color-picker-chip>\n\n <mat-form-field class=\"form-field-padless shape-radius\" floatLabel=\"never\">\n <input\n matInput\n [(ngModel)]=\"block.shapeRadius\"\n name=\"shapeRadius\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"shapeRadiusChange($event)\"\n placeholder=\"Radius\">\n <span matPrefix *ngIf=\"block.shapeRadius\">R</span>\n </mat-form-field>\n\n <div class=\"shape-corners\">\n <div\n class=\"shape-corner shape-corner-top-left\"\n [ngClass]=\"{ round: block.shapeTopLeft === 'round' }\"\n (click)=\"shapeRound('shapeTopLeft')\"></div>\n <div\n class=\"shape-corner shape-corner-top-right\"\n [ngClass]=\"{ round: block.shapeTopRight === 'round' }\"\n (click)=\"shapeRound('shapeTopRight')\"></div>\n <div\n class=\"shape-corner shape-corner-bottom-left\"\n [ngClass]=\"{ round: block.shapeBottomLeft === 'round' }\"\n (click)=\"shapeRound('shapeBottomLeft')\"></div>\n <div\n class=\"shape-corner shape-corner-bottom-right\"\n [ngClass]=\"{ round: block.shapeBottomRight === 'round' }\"\n (click)=\"shapeRound('shapeBottomRight')\"></div>\n </div>\n </div>\n </div>\n <ng-container *ngIf=\"block.type !== BlockType.Pdf\">\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Image</div>\n <div class=\"sidebar-row image-row\">\n <fs-file (select)=\"imageSelect($event)\">\n <button type=\"button\" mat-icon-button><mat-icon>cloud_upload</mat-icon></button>\n </fs-file>\n <ng-container *ngIf=\"block.imageUrl\">\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"imageRemove()\">\n <mat-icon>clear</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: clippable }\"\n (click)=\"imageClip()\">\n <mat-icon>crop</mat-icon>\n </button>\n </ng-container>\n </div>\n </div>\n </ng-container>\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Padding</div>\n <div class=\"sidebar-row padding-row\">\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.padding\"\n name=\"padding\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"paddingAllChange($event)\"\n placeholder=\"All\">\n <span matPrefix *ngIf=\"block.padding\">A</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingTop\"\n name=\"paddingTop\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"paddingChange('paddingTop',$event)\"\n placeholder=\"Top\">\n <span matPrefix *ngIf=\"block.paddingTop\">T</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingBottom\"\n name=\"paddingBottom\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"paddingChange('paddingBottom',$event)\"\n placeholder=\"Bottom\">\n <span matPrefix *ngIf=\"block.paddingBottom\">B</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingLeft\"\n name=\"paddingLeft\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"paddingChange('paddingLeft',$event)\"\n placeholder=\"Left\">\n <span matPrefix *ngIf=\"block.paddingLeft\">L</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingRight\"\n name=\"paddingRight\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"paddingChange('paddingRight',$event)\"\n placeholder=\"Right\">\n <span matPrefix *ngIf=\"block.paddingRight\">R</span>\n </mat-form-field>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngFor=\"let sidebarPanel of sidebarPanels\">\n <div div class=\"sidebar-panel\" *ngIf=\"sidebarPanel.show\">\n <div class=\"sidebar-label\">{{sidebarPanel.label}}</div>\n <ng-container\n [ngTemplateOutlet]=\"sidebarPanel.templateRef\"\n [ngTemplateOutletContext]=\"{ block: block }\"></ng-container>\n </div>\n </ng-container>\n</div>\n\n", styles: [".sidebar{width:285px;font-size:14px;height:100%;overflow:auto;background-color:#fff;padding:0 10px 10px;box-shadow:-1px 1px 4px 3px #0003;z-index:1;position:relative;box-sizing:border-box}.sidebar .sidebar-row{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center}.sidebar .sidebar-row fs-color-picker-chip{margin-left:6px}.sidebar .sidebar-row.padding-row{flex-wrap:unset}.sidebar .sidebar-row.padding-row ::ng-deep .mat-form-field{width:20%;min-width:0}.sidebar .sidebar-row.image-row{margin-bottom:-5px}.sidebar .sidebar-row ::ng-deep .mat-checkbox,.sidebar .sidebar-row ::ng-deep .mat-form-field{font-size:12px}.sidebar .sidebar-row>*:not(.mat-icon-button):not(fs-file){margin-right:11px}.sidebar .sidebar-row>*:not(.mat-icon-button):not(fs-file):last-child{margin-right:0}.sidebar .layer-up ::ng-deep .mat-button-wrapper,.sidebar .layer-down ::ng-deep .mat-button-wrapper{position:relative}.sidebar .layer-up ::ng-deep .mat-button-wrapper mat-icon:first-child,.sidebar .layer-down ::ng-deep .mat-button-wrapper mat-icon:first-child{position:absolute;transform:rotate(90deg) scale(.5);top:-7px;color:#fff}.sidebar .layer-down mat-icon:first-child{transform:rotate(270deg) scale(.6)}.sidebar .padding{width:45px}.sidebar .line-height,.sidebar .font-size,.sidebar .border-width{width:45px}.sidebar .shape-radius{width:50px}.sidebar .shape-corners{display:grid;grid-template-columns:1fr 1fr;grid-column-gap:1px;column-gap:1px;grid-row-gap:1px;row-gap:1px}.sidebar .shape-corners .shape-corner{height:13px;width:13px;background-color:#ccc;cursor:pointer}.sidebar .shape-corners .shape-corner.round.shape-corner-top-right{border-top-right-radius:50%}.sidebar .shape-corners .shape-corner.round.shape-corner-top-left{border-top-left-radius:50%}.sidebar .shape-corners .shape-corner.round.shape-corner-bottom-left{border-bottom-left-radius:50%}.sidebar .shape-corners .shape-corner.round.shape-corner-bottom-right{border-bottom-right-radius:50%}.sidebar button.toggle-button:not(.selected) mat-icon{color:#ccc}.sidebar .sidebar-panel{padding:10px}.sidebar .sidebar-panel+.sidebar-panel{border-top:1px solid #dadada}.sidebar .sidebar-panel.block-form-panel .sidebar-label{display:flex;align-items:center}.sidebar .sidebar-panel.block-form-panel .sidebar-label mat-icon{transform:scale(.8);color:inherit;margin-left:-5px}.sidebar .sidebar-panel.block-form-panel mat-form-field+mat-form-field{margin-top:12px}.sidebar .sidebar-panel.block-form-panel .form-field-options{margin-top:11px}.sidebar .sidebar-panel.block-form-panel .form-field-options mat-checkbox{display:block}.sidebar .sidebar-panel.block-form-panel .form-field-options mat-checkbox+mat-checkbox{margin-top:2px}.sidebar .sidebar-panel.info-panel .sidebar-row+.sidebar-row{margin-top:12px}.sidebar .sidebar-panel.info-panel .sidebar-row .mat-form-field{width:41px}.sidebar .sidebar-panel.typography-panel .style-row{margin-bottom:-10px}.sidebar .sidebar-panel.typography-panel .align-row{margin-bottom:-5px}.sidebar .sidebar-panel .sidebar-label{font-size:11px;margin-bottom:7px;color:#9e9e9e}.sidebar .sidebar-panel .keep-ratio{color:inherit;transform:scale(.85);display:block}.full-width{width:100%}:host ::ng-deep .mat-form-field-prefix{color:#9e9e9e;margin-right:3px;font-size:85%}\n"], components: [{ type: i3$1.FsFileComponent, selector: "fs-file", inputs: ["minHeight", "minWidth", "multiple", "capture", "allowClick", "allowDrop", "accept", "disabled", "imageWidth", "imageHeight", "imageQuality"], outputs: ["select", "error", "clicked", "declined"] }, { type: i6.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: i6$1.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i7$1.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i8.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i9.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "id", "labelPosition", "name", "required", "checked", "disabled", "indeterminate", "aria-describedby", "value"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: i10.FsColorPickerChipComponent, selector: "fs-color-picker-chip", inputs: ["color"], outputs: ["changed"] }], directives: [{ type: i11.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i11.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i11.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i11.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i11.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i12.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i11.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i13.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i14.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i14.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i14.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i6$1.MatPrefix, selector: "[matPrefix]" }, { type: i13.MatTextareaAutosize, selector: "textarea[mat-autosize], textarea[matTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "matAutosizeMinRows", "matAutosizeMaxRows", "mat-autosize", "matTextareaAutosize"], exportAs: ["matTextareaAutosize"] }, { type: i6$1.MatLabel, selector: "mat-label" }, { type: i11.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1067
+ 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 }, { token: i2$1.FsPrompt }, { token: GoogleFontService }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component });
1068
+ SidebarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SidebarComponent, selector: "sidebar", inputs: { config: "config", blocks: "blocks" }, outputs: { zoomCenter: "zoomCenter" }, queries: [{ propertyName: "sidebarPanels", predicate: FsBlockEditorSidebarPanelDirective }], ngImport: i0, template: "<div class=\"sidebar\">\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-row\">\n <ng-container *ngFor=\"let blockType of BlockTypes\">\n <ng-container [ngSwitch]=\"blockType.value\">\n <ng-container *ngSwitchCase=\"BlockType.Pdf\">\n <ng-container *ngTemplateOutlet=\"addFile\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"BlockType.Image\">\n <ng-container *ngTemplateOutlet=\"addFile\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container *ngTemplateOutlet=\"addButton\"></ng-container>\n </ng-container>\n </ng-container>\n\n <ng-template #addFile>\n <fs-file (select)=\"blockUpload(blockType.value, $event)\" [accept]=\"blockType.accept\">\n <ng-container *ngTemplateOutlet=\"addButton\"></ng-container>\n </fs-file>\n </ng-template>\n\n <ng-template #addButton>\n <button\n type=\"button\"\n mat-icon-button\n [matTooltip]=\"'Add ' + blockType.name\"\n (click)=\"blockAdd(blockType.value)\">\n <mat-icon>{{blockType.icon}}</mat-icon>\n </button>\n </ng-template>\n </ng-container>\n </div>\n </div>\n\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-row\">\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n matTooltip=\"Reset zoom\"\n (click)=\"zoomCenter.emit()\">\n <mat-icon>crop_free</mat-icon>\n </button>\n <button\n class=\"reorder-layers\"\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"reorderLayers()\">\n <mat-icon>swap_vert</mat-icon>\n </button>\n <ng-container *ngIf=\"block\">\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"blockRemoveClick()\">\n <mat-icon>delete_outline</mat-icon>\n </button>\n <button\n class=\"layer-up\"\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"layerUp()\">\n <mat-icon>arrow_back</mat-icon>\n <mat-icon>layers</mat-icon>\n </button>\n <button\n class=\"layer-down\"\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"layerDown()\">\n <mat-icon>arrow_back</mat-icon>\n <mat-icon>layers</mat-icon>\n </button>\n </ng-container>\n </div>\n </div>\n <ng-container *ngIf=\"block\">\n <div class=\"sidebar-panel info-panel\">\n <div class=\"sidebar-label\">Info</div>\n <div class=\"sidebar-row\">\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.left\"\n name=\"left\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'left', .01)\"\n (ngModelChange)=\"numberChange($event, 'left')\">\n <span matPrefix>X</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.top\"\n name=\"top\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'top', .01)\"\n (ngModelChange)=\"numberChange($event, 'top')\">\n <span matPrefix>Y</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.rotate\"\n name=\"rotate\"\n (focus)=\"inputFocus($event)\" \n (keydown)=\"numericInputKeypress($event, 'rotate')\"\n (ngModelChange)=\"numberChange($event, 'rotate')\">\n <span matPrefix>R</span>\n </mat-form-field>\n </div>\n\n <div class=\"sidebar-row\">\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.width\"\n name=\"width\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'width', .01)\"\n (ngModelChange)=\"numberChange($event, 'width')\">\n <span matPrefix>W</span>\n </mat-form-field>\n\n <div>\n <a (click)=\"toggleKeepRatio()\" class=\"keep-ratio\">\n <mat-icon>{{block.keepRatio ? 'lock_outline' : 'lock_open'}}</mat-icon>\n </a>\n </div>\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.height\"\n name=\"height\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'height', .01)\"\n (ngModelChange)=\"numberChange($event, 'height')\">\n <span matPrefix>H</span>\n </mat-form-field>\n </div>\n </div>\n <ng-container *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText || block.type === BlockType.RadioButton || block.type === BlockType.Checkbox || block.type === BlockType.Date || block.type === BlockType.Signature\">\n <div class=\"sidebar-panel block-form-panel\">\n <div class=\"sidebar-label\">\n <mat-icon>{{blockTypeIcons[block.type]}}</mat-icon>\n {{blockTypeNames[block.type]}}</div>\n <div class=\"sidebar-row\">\n\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <input\n matInput\n [ngModel]=\"block.label\"\n name=\"label\"\n placeholder=\"Label\"\n (ngModelChange)=\"blockChangeProperty($event, 'label')\">\n </mat-form-field>\n\n <ng-container *ngIf=\"block.type !== BlockType.Checkbox && block.type !== BlockType.RadioButton\">\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <textarea\n matInput\n [matTextareaAutosize]=\"true\"\n [ngModel]=\"block.description\"\n name=\"description\"\n placeholder=\"Description\"\n (ngModelChange)=\"blockChangeProperty($event, 'description')\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <mat-form-field\n *ngIf=\"formats.length\"\n class=\"form-field-padless-bottom full-width\">\n <mat-label>Format</mat-label>\n <mat-select\n [(ngModel)]=\"block.format\"\n name=\"format\"\n (ngModelChange)=\"blockChangeProperty($event, 'format')\">\n <mat-option [value]=\"null\">\n None\n </mat-option>\n <mat-option\n *ngFor=\"let item of formats\"\n [value]=\"item.value\">\n {{ item.name }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n\n <ng-container *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText || block.type === BlockType.Date\">\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <textarea\n matInput\n [matTextareaAutosize]=\"true\"\n [ngModel]=\"block.default\"\n name=\"default\"\n placeholder=\"Default\"\n (ngModelChange)=\"blockChangeProperty($event, 'default')\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <ng-container *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText\">\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <textarea\n matInput\n [matTextareaAutosize]=\"true\"\n [ngModel]=\"block.formula\"\n name=\"formula\"\n placeholder=\"Formula\"\n (ngModelChange)=\"blockChangeProperty($event, 'formula')\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <ng-container *ngIf=\"block.type === BlockType.RadioButton || block.type === BlockType.Checkbox\">\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <textarea\n matInput\n [matTextareaAutosize]=\"true\"\n [ngModel]=\"block.groupLabel\"\n name=\"groupLabel\"\n placeholder=\"Group Label\"\n (ngModelChange)=\"blockChangeProperty($event, 'groupLabel')\">\n </textarea>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <mat-label>Group Description</mat-label>\n <textarea\n matInput\n [matTextareaAutosize]=\"true\"\n [ngModel]=\"block.groupDescription\"\n name=\"groupDescription\"\n (ngModelChange)=\"blockChangeProperty($event, 'groupDescription')\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <mat-form-field class=\"form-field-padless-bottom full-width\">\n <input\n matInput\n [ngModel]=\"block.name\"\n name=\"name\"\n placeholder=\"Name\"\n (ngModelChange)=\"blockChangeProperty($event, 'name')\">\n </mat-form-field>\n\n <div class=\"form-field-options\">\n <mat-checkbox\n name=\"required\"\n [(ngModel)]=\"block.required\"\n (ngModelChange)=\"blockChangeProperty($event, 'required')\">\n Required\n </mat-checkbox>\n\n <mat-checkbox\n name=\"readonly\"\n [(ngModel)]=\"block.readonly\"\n (ngModelChange)=\"blockChangeProperty($event, 'readonly')\">\n Readonly\n </mat-checkbox>\n </div>\n </div>\n </div>\n </ng-container>\n <div class=\"sidebar-panel typography-panel\">\n <div class=\"sidebar-label\">Typography</div>\n <div class=\"sidebar-row\">\n <fs-autocomplete\n [fetch]=\"fontFetch\"\n [fetchOnFocus]=\"true\"\n [displayWith]=\"fontDisplayWith\"\n [ngModel]=\"block.fontFamily ? { family: block.fontFamily } : null\"\n placeholder=\"Font\"\n [panelClass]=\"'font-autocomplete-panel'\"\n (ngModelChange)=\"fontChanged($event)\"\n name=\"fontfamily\">\n <ng-template fsAutocompleteTemplate let-data=\"data\">\n <app-font [font]=\"data\"></app-font>\n </ng-template>\n </fs-autocomplete>\n <fs-color-picker-chip\n (changed)=\"fontColorChange($event)\"\n [color]=\"block.fontColor\">\n </fs-color-picker-chip>\n\n <mat-form-field class=\"form-field-padless font-size\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.fontSize\"\n name=\"fontSize\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'fontSize')\"\n (ngModelChange)=\"numberChange($event, 'fontSize')\"\n placeholder=\"Size\">\n <span matPrefix *ngIf=\"block.fontSize\">S</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless line-height\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.lineHeight\"\n name=\"lineHeight\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'lineHeight')\"\n (ngModelChange)=\"numberChange($event, 'lineHeight')\"\n placeholder=\"Line\">\n <span matPrefix *ngIf=\"block.lineHeight\">L</span>\n </mat-form-field>\n </div>\n\n <div class=\"sidebar-row style-row\">\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.bold }\"\n (click)=\"boldClick()\">\n <mat-icon>format_bold</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.italic }\"\n (click)=\"italicClick()\">\n <mat-icon>format_italic</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.underline }\"\n (click)=\"underlineClick()\">\n <mat-icon>format_underline</mat-icon>\n </button>\n </div>\n\n <div class=\"sidebar-row align-row\">\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.horizontalAlign === 'left' }\"\n (click)=\"horizontalAlignClick('left')\">\n <mat-icon>format_align_left</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.horizontalAlign === 'center' }\"\n (click)=\"horizontalAlignClick('center')\">\n <mat-icon>format_align_center</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.horizontalAlign === 'justify' }\"\n (click)=\"horizontalAlignClick('justify')\">\n <mat-icon>format_align_justify</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.horizontalAlign === 'right' }\"\n (click)=\"horizontalAlignClick('right')\">\n <mat-icon>format_align_right</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.verticalAlign === 'top' }\"\n (click)=\"verticalAlignClick('top')\">\n <mat-icon>vertical_align_top</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.verticalAlign === 'center' }\"\n (click)=\"verticalAlignClick('center')\">\n <mat-icon>vertical_align_center</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.verticalAlign === 'bottom' }\"\n (click)=\"verticalAlignClick('bottom')\">\n <mat-icon>vertical_align_bottom</mat-icon>\n </button>\n </div>\n </div>\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Border</div>\n\n <div class=\"sidebar-row\">\n <fs-color-picker-chip\n (changed)=\"borderColorChange($event)\"\n [color]=\"block.borderColor\">\n </fs-color-picker-chip>\n\n <mat-form-field class=\"form-field-padless border-width\" floatLabel=\"never\">\n <input\n matInput\n [(ngModel)]=\"block.borderWidth\"\n name=\"borderWidth\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'borderWidth')\"\n (ngModelChange)=\"numberChange($event, 'borderWidth')\"\n placeholder=\"Width\">\n <span matPrefix *ngIf=\"block.borderWidth\">W</span>\n </mat-form-field>\n </div>\n </div>\n\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Shape</div>\n\n <div class=\"sidebar-row\">\n <fs-color-picker-chip\n (changed)=\"backgroundColorChange($event)\"\n [color]=\"block.backgroundColor\">\n </fs-color-picker-chip>\n\n <mat-form-field class=\"form-field-padless shape-radius\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shapeRadius\"\n name=\"shapeRadius\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'shapeRadius', 1)\"\n (ngModelChange)=\"numberChange($event, 'shapeRadius')\"\n placeholder=\"Radius\">\n <span matPrefix *ngIf=\"block.shapeRadius\">R</span>\n </mat-form-field>\n\n <div class=\"shape-corners\">\n <div\n class=\"shape-corner shape-corner-top-left\"\n [ngClass]=\"{ round: block.shapeTopLeft === 'round' }\"\n (click)=\"shapeRound('shapeTopLeft')\"></div>\n <div\n class=\"shape-corner shape-corner-top-right\"\n [ngClass]=\"{ round: block.shapeTopRight === 'round' }\"\n (click)=\"shapeRound('shapeTopRight')\"></div>\n <div\n class=\"shape-corner shape-corner-bottom-left\"\n [ngClass]=\"{ round: block.shapeBottomLeft === 'round' }\"\n (click)=\"shapeRound('shapeBottomLeft')\"></div>\n <div\n class=\"shape-corner shape-corner-bottom-right\"\n [ngClass]=\"{ round: block.shapeBottomRight === 'round' }\"\n (click)=\"shapeRound('shapeBottomRight')\"></div>\n </div>\n </div>\n </div>\n\n <div class=\"sidebar-panel shadow-panel\">\n <div class=\"sidebar-label\">Shadow</div>\n\n <div class=\"sidebar-row\">\n <fs-color-picker-chip\n (changed)=\"shadowColorChange($event)\"\n [color]=\"block.shadowColor\">\n </fs-color-picker-chip>\n\n <mat-form-field class=\"form-field-padless shadow-x\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shadowX\"\n name=\"shadowX\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'shadowX')\"\n (ngModelChange)=\"numberChange($event, 'shadowX')\">\n <span matPrefix>X</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless shadow-y\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shadowY\"\n name=\"shadowY\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'shadowY')\"\n (ngModelChange)=\"numberChange($event, 'shadowY')\">\n <span matPrefix>Y</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless shadow-blur\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shadowBlur\"\n name=\"shadowBlur\"\n placeholder=\"Blur\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'shadowBlur')\"\n (ngModelChange)=\"numberChange($event, 'shadowBlur')\">\n <span matPrefix *ngIf=\"block.shadowBlur\">B</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shadowSpread\"\n name=\"shadowSpread\"\n placeholder=\"Spread\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'shadowSpread')\"\n (ngModelChange)=\"numberChange($event, 'shadowSpread')\">\n <span matPrefix *ngIf=\"block.shadowSpread\">S</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shadowOpacity\"\n name=\"shadowOpacity\"\n placeholder=\"Opacity\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'shadowOpacity')\"\n (ngModelChange)=\"numberChange($event, 'shadowOpacity')\">\n <span matPrefix *ngIf=\"block.shadowOpacity\">O</span>\n </mat-form-field>\n </div>\n </div>\n\n <ng-container *ngIf=\"block.type !== BlockType.Pdf\">\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Image</div>\n <div class=\"sidebar-row image-row\">\n <fs-file (select)=\"imageSelect($event)\">\n <button \n type=\"button\" \n mat-icon-button>\n <mat-icon>cloud_upload</mat-icon>\n </button>\n </fs-file>\n <ng-container *ngIf=\"block.imageUrl\">\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"imageRemove()\">\n <mat-icon>clear</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: clippable }\"\n (click)=\"imageClip()\">\n <mat-icon>crop</mat-icon>\n </button>\n </ng-container>\n </div>\n </div>\n </ng-container>\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Padding</div>\n <div class=\"sidebar-row padding-row\">\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [(ngModel)]=\"block.padding\"\n name=\"padding\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"paddingAllChange($event)\"\n (keydown)=\"paddingAllKeypress($event, 1)\"\n placeholder=\"All\">\n <span matPrefix *ngIf=\"block.padding\">A</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingTop\"\n name=\"paddingTop\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"paddingKeypress($event, 'paddingTop')\"\n (ngModelChange)=\"numberChange($event, 'paddingTop')\"\n placeholder=\"Top\">\n <span matPrefix *ngIf=\"block.paddingTop\">T</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingBottom\"\n name=\"paddingBottom\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"paddingKeypress($event, 'paddingBottom')\"\n (ngModelChange)=\"numberChange($event, 'paddingBottom')\"\n placeholder=\"Bottom\">\n <span matPrefix *ngIf=\"block.paddingBottom\">B</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingLeft\"\n name=\"paddingLeft\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"paddingKeypress($event, 'paddingLeft')\"\n (ngModelChange)=\"numberChange($event, 'paddingLeft')\"\n placeholder=\"Left\">\n <span matPrefix *ngIf=\"block.paddingLeft\">L</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingRight\"\n name=\"paddingRight\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"paddingKeypress($event, 'paddingRight')\"\n (ngModelChange)=\"numberChange($event, 'paddingRight')\"\n placeholder=\"Right\">\n <span matPrefix *ngIf=\"block.paddingRight\">R</span>\n </mat-form-field>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngFor=\"let sidebarPanel of sidebarPanels\">\n <div div class=\"sidebar-panel\" *ngIf=\"sidebarPanel.show\">\n <div class=\"sidebar-label\">{{sidebarPanel.label}}</div>\n <ng-container\n [ngTemplateOutlet]=\"sidebarPanel.templateRef\"\n [ngTemplateOutletContext]=\"{ block: block }\"></ng-container>\n </div>\n </ng-container>\n</div>\n\n", styles: [".sidebar{width:285px;font-size:14px;height:100%;overflow:auto;background-color:#fff;padding:0 10px 10px;box-shadow:-1px 1px 4px 3px #0003;z-index:1;position:relative;box-sizing:border-box}.sidebar .sidebar-row{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center}.sidebar .sidebar-row+.sidebar-row{margin-top:12px}.sidebar .sidebar-row fs-color-picker-chip{margin-left:6px}.sidebar .sidebar-row.padding-row{flex-wrap:unset}.sidebar .sidebar-row.padding-row ::ng-deep .mat-form-field{width:20%;min-width:0}.sidebar .sidebar-row.image-row{margin-bottom:-5px}.sidebar .sidebar-row ::ng-deep .mat-checkbox,.sidebar .sidebar-row ::ng-deep .mat-form-field{font-size:12px}.sidebar .sidebar-row>*:not(.mat-icon-button):not(fs-file){margin-right:11px}.sidebar .sidebar-row>*:not(.mat-icon-button):not(fs-file):last-child{margin-right:0}.sidebar .layer-up ::ng-deep .mat-button-wrapper,.sidebar .layer-down ::ng-deep .mat-button-wrapper{position:relative}.sidebar .layer-up ::ng-deep .mat-button-wrapper mat-icon:first-child,.sidebar .layer-down ::ng-deep .mat-button-wrapper mat-icon:first-child{position:absolute;transform:rotate(90deg) scale(.5);top:-7px;color:#fff}.sidebar .layer-down mat-icon:first-child{transform:rotate(270deg) scale(.6)}.sidebar .padding{width:45px}.sidebar .line-height,.sidebar .font-size,.sidebar .border-width{width:45px}.sidebar .shape-radius{width:50px}.sidebar .shape-corners{display:grid;grid-template-columns:1fr 1fr;grid-column-gap:1px;column-gap:1px;grid-row-gap:1px;row-gap:1px}.sidebar .shape-corners .shape-corner{height:13px;width:13px;background-color:#ccc;cursor:pointer}.sidebar .shape-corners .shape-corner.round.shape-corner-top-right{border-top-right-radius:50%}.sidebar .shape-corners .shape-corner.round.shape-corner-top-left{border-top-left-radius:50%}.sidebar .shape-corners .shape-corner.round.shape-corner-bottom-left{border-bottom-left-radius:50%}.sidebar .shape-corners .shape-corner.round.shape-corner-bottom-right{border-bottom-right-radius:50%}.sidebar button.toggle-button:not(.selected) mat-icon{color:#ccc}.sidebar .sidebar-panel{padding:10px}.sidebar .sidebar-panel+.sidebar-panel{border-top:1px solid #dadada}.sidebar .sidebar-panel.block-form-panel .sidebar-label{display:flex;align-items:center}.sidebar .sidebar-panel.block-form-panel .sidebar-label mat-icon{transform:scale(.8);color:inherit;margin-left:-5px}.sidebar .sidebar-panel.block-form-panel mat-form-field+mat-form-field{margin-top:12px}.sidebar .sidebar-panel.block-form-panel .form-field-options{margin-top:11px}.sidebar .sidebar-panel.block-form-panel .form-field-options mat-checkbox{display:block}.sidebar .sidebar-panel.block-form-panel .form-field-options mat-checkbox+mat-checkbox{margin-top:2px}.sidebar .sidebar-panel.info-panel .mat-form-field{width:41px}.sidebar .sidebar-panel.shadow-panel .mat-form-field{width:41px}.sidebar .sidebar-panel.shadow-panel .mat-form-field.shadow-x,.sidebar .sidebar-panel.shadow-panel .mat-form-field.shadow-y,.sidebar .sidebar-panel.shadow-panel .mat-form-field.shadow-blur{width:26px}.sidebar .sidebar-panel.typography-panel fs-autocomplete{width:100%}.sidebar .sidebar-panel.typography-panel .style-row{margin-bottom:-10px}.sidebar .sidebar-panel.typography-panel .align-row{margin-bottom:-5px}.sidebar .sidebar-panel.typography-panel .align-row .mat-icon-button{width:35px;height:35px;line-height:35px}.sidebar .sidebar-panel .sidebar-label{font-size:11px;margin-bottom:7px;color:#9e9e9e}.sidebar .sidebar-panel .keep-ratio{color:inherit;transform:scale(.85);display:block}.full-width{width:100%}:host ::ng-deep .mat-form-field-prefix{color:#9e9e9e;margin-right:3px;font-size:85%}\n"], components: [{ type: i3$1.FsFileComponent, selector: "fs-file", inputs: ["minHeight", "minWidth", "orientate", "multiple", "capture", "allowClick", "allowDrop", "accept", "disabled", "imageWidth", "imageHeight", "imageQuality"], outputs: ["select", "error", "clicked", "declined"] }, { type: i6.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: i6$1.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i7$1.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i8.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i9.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "id", "labelPosition", "name", "required", "checked", "disabled", "indeterminate", "aria-describedby", "value"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: i10.FsAutocompleteComponent, selector: "fs-autocomplete", inputs: ["fetch", "placeholder", "displayWith", "fetchOnFocus", "readonly", "required", "disabled", "appearance", "hint", "panelWidth", "panelClass", "showClear"], outputs: ["cleared", "opened", "closed"] }, { type: FontComponent, selector: "app-font", inputs: ["font"] }, { type: i12.FsColorPickerChipComponent, selector: "fs-color-picker-chip", inputs: ["color", "showClear"], outputs: ["changed"] }], directives: [{ type: i13.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i13.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i13.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i13.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i13.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i14.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i13.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i15.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i16.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i16.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i16.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i6$1.MatPrefix, selector: "[matPrefix]" }, { type: i15.MatTextareaAutosize, selector: "textarea[mat-autosize], textarea[matTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "matAutosizeMinRows", "matAutosizeMaxRows", "mat-autosize", "matTextareaAutosize"], exportAs: ["matTextareaAutosize"] }, { type: i6$1.MatLabel, selector: "mat-label" }, { type: i10.FsAutocompleteTemplateDirective, selector: "[fsAutocompleteTemplate]" }, { type: i13.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
965
1069
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SidebarComponent, decorators: [{
966
1070
  type: Component,
967
1071
  args: [{
@@ -970,7 +1074,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
970
1074
  styleUrls: ['sidebar.component.scss'],
971
1075
  changeDetection: ChangeDetectionStrategy.OnPush,
972
1076
  }]
973
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: BlockEditorService }, { type: i0.ChangeDetectorRef }, { type: i2$1.FsPrompt }, { type: undefined, decorators: [{
1077
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: BlockEditorService }, { type: i0.ChangeDetectorRef }, { type: i2$1.FsPrompt }, { type: GoogleFontService }, { type: undefined, decorators: [{
974
1078
  type: Inject,
975
1079
  args: [DOCUMENT]
976
1080
  }] }]; }, propDecorators: { sidebarPanels: [{
@@ -1031,6 +1135,9 @@ class ArtboardComponent {
1031
1135
  fromEvent(window, 'keydown')
1032
1136
  .pipe(filter((event) => {
1033
1137
  return ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].indexOf(event.key) !== -1;
1138
+ }), filter(() => {
1139
+ const el = document.activeElement;
1140
+ return !(el instanceof HTMLInputElement || (el && el.classList.contains('content-editable')));
1034
1141
  }), takeUntil(this._destroy$))
1035
1142
  .subscribe((event) => {
1036
1143
  event.preventDefault();
@@ -1061,7 +1168,7 @@ class ArtboardComponent {
1061
1168
  }
1062
1169
  }
1063
1170
  ArtboardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ArtboardComponent, deps: [{ token: i0.ElementRef }, { token: BlockEditorService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1064
- ArtboardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ArtboardComponent, selector: "app-artboard", inputs: { config: "config", zoompan: "zoompan" }, queries: [{ propertyName: "sidebarPanels", predicate: FsBlockEditorSidebarPanelDirective }], viewQueries: [{ propertyName: "artboard", first: true, predicate: ["artboard"], descendants: true, static: true }, { propertyName: "marginContainer", first: true, predicate: ["marginContainer"], descendants: true, static: true }, { propertyName: "sidebar", first: true, predicate: SidebarComponent, descendants: true, static: true }, { propertyName: "blockComponents", predicate: FsBlockComponent, descendants: true }, { propertyName: "margins", predicate: FsBlockEditorMarginDirective, descendants: true }], ngImport: i0, template: "<div\n #artboard\n class=\"artboard mat-elevation-z4 deselectable\"\n [style.width]=\"config.width + config.unit\"\n [style.height]=\"config.height + config.unit\">\n <fs-block\n *ngFor=\"let block of blocks\"\n [zoompan]=\"zoompan\"\n [block]=\"block\">\n </fs-block>\n <div class=\"margin margin-top\" *ngIf=\"config.marginTop\" [style.top]=\"config.marginTop + 'in'\"></div>\n <div class=\"margin margin-left\" *ngIf=\"config.marginLeft\" [style.left]=\"config.marginLeft + 'in'\"></div>\n <div class=\"margin margin-bottom\" *ngIf=\"config.marginBottom\" [style.bottom]=\"config.marginBottom + 'in'\"></div>\n <div class=\"margin margin-right\" *ngIf=\"config.marginRight\" [style.right]=\"config.marginRight + 'in'\"></div>\n <div\n #marginContainer\n class=\"margin-container\"\n [style.top]=\"config.marginTop + 'in'\"\n [style.right]=\"config.marginRight + 'in'\"\n [style.bottom]=\"config.marginBottom + 'in'\"\n [style.left]=\"config.marginLeft + 'in'\">\n </div>\n</div> \n\n", styles: [".artboard{position:relative;display:inline-flex;background-color:#fff}.artboard .margin-container{position:absolute;z-index:-1}.artboard .margin{position:absolute;border-color:#ff85bd5e;border-style:dashed;border-width:0px}.artboard .margin.margin-top,.artboard .margin.margin-bottom{width:100%;border-top-width:1px}.artboard .margin.margin-left,.artboard .margin.margin-right{height:100%;border-left-width:1px}\n"], components: [{ type: FsBlockComponent, selector: "fs-block", inputs: ["block", "html", "zoompan"] }], directives: [{ type: i11.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i11.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1171
+ ArtboardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ArtboardComponent, selector: "app-artboard", inputs: { config: "config", zoompan: "zoompan" }, queries: [{ propertyName: "sidebarPanels", predicate: FsBlockEditorSidebarPanelDirective }], viewQueries: [{ propertyName: "artboard", first: true, predicate: ["artboard"], descendants: true, static: true }, { propertyName: "marginContainer", first: true, predicate: ["marginContainer"], descendants: true, static: true }, { propertyName: "sidebar", first: true, predicate: SidebarComponent, descendants: true, static: true }, { propertyName: "blockComponents", predicate: FsBlockComponent, descendants: true }, { propertyName: "margins", predicate: FsBlockEditorMarginDirective, descendants: true }], ngImport: i0, template: "<div\n #artboard\n class=\"artboard mat-elevation-z4 deselectable\"\n [style.width]=\"config.width + config.unit\"\n [style.height]=\"config.height + config.unit\">\n <fs-block\n *ngFor=\"let block of blocks\"\n [zoompan]=\"zoompan\"\n [block]=\"block\">\n </fs-block>\n <div class=\"margin margin-top\" *ngIf=\"config.marginTop\" [style.top]=\"config.marginTop + 'in'\"></div>\n <div class=\"margin margin-left\" *ngIf=\"config.marginLeft\" [style.left]=\"config.marginLeft + 'in'\"></div>\n <div class=\"margin margin-bottom\" *ngIf=\"config.marginBottom\" [style.bottom]=\"config.marginBottom + 'in'\"></div>\n <div class=\"margin margin-right\" *ngIf=\"config.marginRight\" [style.right]=\"config.marginRight + 'in'\"></div>\n <div\n #marginContainer\n class=\"margin-container\"\n [style.top]=\"config.marginTop + 'in'\"\n [style.right]=\"config.marginRight + 'in'\"\n [style.bottom]=\"config.marginBottom + 'in'\"\n [style.left]=\"config.marginLeft + 'in'\">\n </div>\n</div> \n\n", styles: [".artboard{position:relative;display:inline-flex;background-color:#fff}.artboard .margin-container{position:absolute;z-index:-1}.artboard .margin{position:absolute;border-color:#ff85bd5e;border-style:dashed;border-width:0px}.artboard .margin.margin-top,.artboard .margin.margin-bottom{width:100%;border-top-width:1px}.artboard .margin.margin-left,.artboard .margin.margin-right{height:100%;border-left-width:1px}\n"], components: [{ type: FsBlockComponent, selector: "fs-block", inputs: ["block", "html", "zoompan"] }], directives: [{ type: i13.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i13.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1065
1172
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ArtboardComponent, decorators: [{
1066
1173
  type: Component,
1067
1174
  args: [{
@@ -1134,7 +1241,7 @@ FsBlockEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", v
1134
1241
  FsBlockEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsBlockEditorComponent, selector: "fs-block-editor", inputs: { config: "config" }, providers: [
1135
1242
  BlockEditorService,
1136
1243
  BlocksStore,
1137
- ], queries: [{ propertyName: "sidebarPanels", predicate: FsBlockEditorSidebarPanelDirective }], viewQueries: [{ propertyName: "zoompan", first: true, predicate: FsZoomPanComponent, descendants: true, static: true }, { propertyName: "artboardContainer", first: true, predicate: ["artboardContainer"], descendants: true, static: true }, { propertyName: "sidebar", first: true, predicate: SidebarComponent, descendants: true, static: true }, { propertyName: "artboard", first: true, predicate: ArtboardComponent, descendants: true, read: ElementRef }], ngImport: i0, template: "<div \n class=\"editor-container deselectable\"\n (mousedown)=\"editorContainerClick($event)\">\n <div\n #artboardContainer\n class=\"artboard-container deselectable\">\n <div #zoomPanContaner class=\"zoom-pan-container deselectable\">\n <fs-zoom-pan \n class=\"deselectable\"\n [zoomMax]=\"5\"\n [top]=\"10\">\n <ng-template fsZoomPanContent>\n <app-artboard \n [zoompan]=\"zoompan\"\n [config]=\"config\">\n </app-artboard>\n </ng-template>\n </fs-zoom-pan>\n </div>\n </div>\n <sidebar\n [config]=\"config\"\n [blocks]=\"blocks\"\n (zoomCenter)=\"zoomCenter()\">\n </sidebar>\n</div>\n", styles: [".editor-container{display:flex;flex-direction:row;position:relative;height:100%;background:#d8d8d8;overflow:hidden}.editor-container .artboard-container{display:flex;flex-grow:1;min-width:0}.editor-container .zoom-pan-container{flex:1}fs-zoom-pan{height:100%}\n"], components: [{ type: i2$2.FsZoomPanComponent, selector: "fs-zoom-pan", inputs: ["zoomMax", "zoomMin", "zoomDefault", "top", "left"], outputs: ["moved", "zoomed"] }, { type: ArtboardComponent, selector: "app-artboard", inputs: ["config", "zoompan"] }, { type: SidebarComponent, selector: "sidebar", inputs: ["config", "blocks"], outputs: ["zoomCenter"] }], directives: [{ type: i2$2.FsZoomPanContentDirective, selector: "[fsZoomPanContent]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1244
+ ], queries: [{ propertyName: "sidebarPanels", predicate: FsBlockEditorSidebarPanelDirective }], viewQueries: [{ propertyName: "zoompan", first: true, predicate: FsZoomPanComponent, descendants: true, static: true }, { propertyName: "artboardContainer", first: true, predicate: ["artboardContainer"], descendants: true, static: true }, { propertyName: "sidebar", first: true, predicate: SidebarComponent, descendants: true, static: true }, { propertyName: "artboard", first: true, predicate: ArtboardComponent, descendants: true, read: ElementRef }], ngImport: i0, template: "<div \n class=\"editor-container deselectable\"\n (mousedown)=\"editorContainerClick($event)\">\n <div\n #artboardContainer\n class=\"artboard-container deselectable\">\n <div #zoomPanContaner class=\"zoom-pan-container deselectable\">\n <fs-zoom-pan \n class=\"deselectable\"\n [zoomMax]=\"5\"\n [top]=\"10\">\n <ng-template fsZoomPanContent>\n <app-artboard \n [zoompan]=\"zoompan\"\n [config]=\"config\">\n </app-artboard>\n </ng-template>\n </fs-zoom-pan>\n </div>\n </div>\n <sidebar\n [config]=\"config\"\n [blocks]=\"blocks\"\n (zoomCenter)=\"zoomCenter()\">\n </sidebar>\n</div>\n", styles: [".editor-container{display:flex;flex-direction:row;position:relative;height:100%;background:#d8d8d8;overflow:hidden}.editor-container .artboard-container{display:flex;flex-grow:1;min-width:0}.editor-container .zoom-pan-container{flex:1}fs-zoom-pan{height:100%}\n"], components: [{ type: i2$2.FsZoomPanComponent, selector: "fs-zoom-pan", inputs: ["zoomMax", "zoomMin", "zoomDefault", "top", "left"], outputs: ["moved", "zoomed"] }, { type: ArtboardComponent, selector: "app-artboard", inputs: ["config", "zoompan"] }, { type: SidebarComponent, selector: "sidebar", inputs: ["config", "blocks"], outputs: ["zoomCenter"] }], directives: [{ type: i2$2.FsZoomPanContentDirective, selector: "[fsZoomPanContent]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1138
1245
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsBlockEditorComponent, decorators: [{
1139
1246
  type: Component,
1140
1247
  args: [{
@@ -1180,7 +1287,8 @@ FsBlockEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", ver
1180
1287
  FsBlockEditorMarginDirective,
1181
1288
  SidebarComponent,
1182
1289
  ArtboardComponent,
1183
- LayersReorderDialogComponent], imports: [CommonModule,
1290
+ LayersReorderDialogComponent,
1291
+ FontComponent], imports: [CommonModule,
1184
1292
  FormsModule,
1185
1293
  MatIconModule,
1186
1294
  MatButtonModule,
@@ -1195,10 +1303,13 @@ FsBlockEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", ver
1195
1303
  FsColorPickerModule,
1196
1304
  FsMenuModule,
1197
1305
  FsZoomPanModule,
1306
+ FsAutocompleteModule,
1198
1307
  FsDialogModule], exports: [FsBlockComponent,
1199
1308
  FsBlockEditorComponent,
1200
1309
  FsBlockEditorSidebarPanelDirective] });
1201
- FsBlockEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsBlockEditorModule, imports: [[
1310
+ FsBlockEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsBlockEditorModule, providers: [
1311
+ GoogleFontService,
1312
+ ], imports: [[
1202
1313
  CommonModule,
1203
1314
  FormsModule,
1204
1315
  MatIconModule,
@@ -1214,6 +1325,7 @@ FsBlockEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", ver
1214
1325
  FsColorPickerModule,
1215
1326
  FsMenuModule,
1216
1327
  FsZoomPanModule,
1328
+ FsAutocompleteModule,
1217
1329
  FsDialogModule,
1218
1330
  ]] });
1219
1331
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsBlockEditorModule, decorators: [{
@@ -1235,6 +1347,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
1235
1347
  FsColorPickerModule,
1236
1348
  FsMenuModule,
1237
1349
  FsZoomPanModule,
1350
+ FsAutocompleteModule,
1238
1351
  FsDialogModule,
1239
1352
  ],
1240
1353
  exports: [
@@ -1250,7 +1363,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
1250
1363
  SidebarComponent,
1251
1364
  ArtboardComponent,
1252
1365
  LayersReorderDialogComponent,
1366
+ FontComponent,
1253
1367
  ],
1368
+ providers: [
1369
+ GoogleFontService,
1370
+ ]
1254
1371
  }]
1255
1372
  }] });
1256
1373