@firestitch/block-editor 9.0.10 → 12.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/components/block/block.component.d.ts +3 -6
- package/app/components/block-editor/block-editor.component.d.ts +9 -2
- package/app/components/sidebar/sidebar.component.d.ts +5 -2
- package/app/directives/block-editor-margin.directive.d.ts +3 -0
- package/app/directives/block-editor-sidebar-panel.directive.d.ts +3 -0
- package/app/fs-block-editor.module.d.ts +17 -0
- package/app/interfaces/block.d.ts +0 -1
- package/app/services/block-editor.service.d.ts +3 -0
- package/bundles/firestitch-block-editor.umd.js +489 -372
- package/bundles/firestitch-block-editor.umd.js.map +1 -1
- package/esm2015/app/components/block/block.component.js +34 -64
- package/esm2015/app/components/block-editor/block-editor.component.js +67 -57
- package/esm2015/app/components/sidebar/sidebar.component.js +37 -46
- package/esm2015/app/directives/block-editor-margin.directive.js +13 -15
- package/esm2015/app/directives/block-editor-sidebar-panel.directive.js +16 -22
- package/esm2015/app/fs-block-editor.module.js +49 -27
- package/esm2015/app/interfaces/block-editor-config.js +2 -1
- package/esm2015/app/interfaces/block.js +2 -1
- package/esm2015/app/services/block-editor.service.js +9 -9
- package/esm2015/firestitch-block-editor.js +1 -4
- package/esm2015/public_api.js +1 -1
- package/fesm2015/firestitch-block-editor.js +203 -217
- package/fesm2015/firestitch-block-editor.js.map +1 -1
- package/firestitch-block-editor.d.ts +1 -3
- package/package.json +5 -12
- package/bundles/firestitch-block-editor.umd.min.js +0 -2
- package/bundles/firestitch-block-editor.umd.min.js.map +0 -1
- package/esm5/app/components/block/block.component.js +0 -498
- package/esm5/app/components/block-editor/block-editor.component.js +0 -137
- package/esm5/app/components/sidebar/sidebar.component.js +0 -334
- package/esm5/app/directives/block-editor-margin.directive.js +0 -26
- package/esm5/app/directives/block-editor-sidebar-panel.directive.js +0 -28
- package/esm5/app/fs-block-editor.module.js +0 -57
- package/esm5/app/interfaces/block-editor-config.js +0 -1
- package/esm5/app/interfaces/block.js +0 -1
- package/esm5/app/services/block-editor.service.js +0 -124
- package/esm5/firestitch-block-editor.js +0 -8
- package/esm5/public_api.js +0 -8
- package/fesm5/firestitch-block-editor.js +0 -1177
- package/fesm5/firestitch-block-editor.js.map +0 -1
- package/firestitch-block-editor.metadata.json +0 -1
|
@@ -1,20 +1,27 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as i9 from '@angular/forms';
|
|
2
2
|
import { FormsModule } from '@angular/forms';
|
|
3
|
+
import * as i8 from '@angular/material/input';
|
|
3
4
|
import { MatInputModule } from '@angular/material/input';
|
|
4
|
-
import
|
|
5
|
+
import * as i0 from '@angular/core';
|
|
6
|
+
import { Injectable, EventEmitter, Component, ChangeDetectionStrategy, ViewChild, Input, Output, Directive, ContentChildren, ViewChildren, NgModule } from '@angular/core';
|
|
7
|
+
import * as i7 from '@angular/common';
|
|
5
8
|
import { CommonModule } from '@angular/common';
|
|
9
|
+
import * as i2 from '@angular/material/button';
|
|
6
10
|
import { MatButtonModule } from '@angular/material/button';
|
|
11
|
+
import * as i4 from '@angular/material/form-field';
|
|
7
12
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
13
|
+
import * as i3 from '@angular/material/icon';
|
|
8
14
|
import { MatIconModule } from '@angular/material/icon';
|
|
9
|
-
import
|
|
15
|
+
import * as i5 from '@firestitch/colorpicker';
|
|
10
16
|
import { FsColorPickerModule } from '@firestitch/colorpicker';
|
|
17
|
+
import * as i6 from '@firestitch/file';
|
|
11
18
|
import { FsFileModule } from '@firestitch/file';
|
|
12
19
|
import { takeUntil, filter, take } from 'rxjs/operators';
|
|
13
20
|
import Moveable from 'moveable';
|
|
14
21
|
import { BehaviorSubject, Subject, fromEvent } from 'rxjs';
|
|
15
22
|
import { guid } from '@firestitch/common';
|
|
16
23
|
|
|
17
|
-
|
|
24
|
+
class BlockEditorService {
|
|
18
25
|
constructor() {
|
|
19
26
|
this.blockComponents = [];
|
|
20
27
|
this._blocks$ = new BehaviorSubject([]);
|
|
@@ -103,21 +110,20 @@ let BlockEditorService = class BlockEditorService {
|
|
|
103
110
|
sanitizeBlock(block) {
|
|
104
111
|
return Object.assign({ shapeBottomLeft: 'round', shapeTopLeft: 'round', shapeTopRight: 'round', shapeBottomRight: 'round', verticalAlign: 'top', horizontalAlign: 'left' }, block);
|
|
105
112
|
}
|
|
106
|
-
}
|
|
107
|
-
BlockEditorService =
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
113
|
+
}
|
|
114
|
+
BlockEditorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BlockEditorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
115
|
+
BlockEditorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BlockEditorService });
|
|
116
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BlockEditorService, decorators: [{
|
|
117
|
+
type: Injectable
|
|
118
|
+
}], ctorParameters: function () { return []; } });
|
|
111
119
|
|
|
112
|
-
|
|
120
|
+
class FsBlockComponent {
|
|
113
121
|
constructor(_service, _elementRef, _cdRef) {
|
|
114
122
|
this._service = _service;
|
|
115
123
|
this._elementRef = _elementRef;
|
|
116
124
|
this._cdRef = _cdRef;
|
|
117
125
|
this.changed = new EventEmitter();
|
|
118
|
-
this.htmlConfig = {};
|
|
119
126
|
this._editable = false;
|
|
120
|
-
this._selectedElements = [];
|
|
121
127
|
this._destroy$ = new Subject();
|
|
122
128
|
}
|
|
123
129
|
get el() {
|
|
@@ -272,16 +278,6 @@ let FsBlockComponent = class FsBlockComponent {
|
|
|
272
278
|
this.block = this._service.sanitizeBlock(this.block);
|
|
273
279
|
this.unit = this._service.config.unit;
|
|
274
280
|
this.content = this.block.content;
|
|
275
|
-
this.htmlConfig = {
|
|
276
|
-
autofocus: false,
|
|
277
|
-
froalaConfig: {}
|
|
278
|
-
};
|
|
279
|
-
}
|
|
280
|
-
saveSelectedElements() {
|
|
281
|
-
this._selectedElements = this.htmlEditor.editor.selection.blocks();
|
|
282
|
-
}
|
|
283
|
-
clearSelectedElements() {
|
|
284
|
-
this._selectedElements = [];
|
|
285
281
|
}
|
|
286
282
|
ngAfterContentInit() {
|
|
287
283
|
this.el.style.width = this.block.width + this.unit;
|
|
@@ -430,7 +426,7 @@ let FsBlockComponent = class FsBlockComponent {
|
|
|
430
426
|
this._destroy$.complete();
|
|
431
427
|
}
|
|
432
428
|
_setTransform(transforms = []) {
|
|
433
|
-
transforms =
|
|
429
|
+
transforms = transforms !== null && transforms !== void 0 ? transforms : [];
|
|
434
430
|
if (this.block.rotate) {
|
|
435
431
|
transforms.push(`rotate(${this.block.rotate}deg)`);
|
|
436
432
|
}
|
|
@@ -439,95 +435,71 @@ let FsBlockComponent = class FsBlockComponent {
|
|
|
439
435
|
_triggerChanged() {
|
|
440
436
|
this.changed.emit(this.block);
|
|
441
437
|
}
|
|
442
|
-
}
|
|
443
|
-
FsBlockComponent
|
|
444
|
-
{ type:
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
],
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
Input(),
|
|
470
|
-
__metadata("design:type", String)
|
|
471
|
-
], FsBlockComponent.prototype, "html", void 0);
|
|
472
|
-
__decorate([
|
|
473
|
-
Output(),
|
|
474
|
-
__metadata("design:type", Object)
|
|
475
|
-
], FsBlockComponent.prototype, "changed", void 0);
|
|
476
|
-
FsBlockComponent = __decorate([
|
|
477
|
-
Component({
|
|
478
|
-
selector: 'fs-block',
|
|
479
|
-
template: "<div\n #element\n class=\"block\"\n [ngClass]=\"{ editable: editable }\">\n <div\n #contentElement\n class=\"content\"\n [style.zIndex]=\"block.index\"\n [style.borderColor]=\"block.borderColor\"\n [style.borderWidth]=\"block.borderWidth ? block.borderWidth + 'pt' : ''\"\n [style.borderStyle]=\"block.borderColor ? 'solid' : 'dashed'\"\n [style.textAlign]=\"block.horizontalAlign\"\n [style.fontStyle]=\"block.italic ? 'italic' : ''\"\n [style.fontSize]=\"block.fontSize ? block.fontSize + 'pt' : ''\"\n [style.lineHeight]=\"block.lineHeight ? block.lineHeight + 'pt' : ''\"\n [style.color]=\"block.fontColor\"\n [style.fontWeight]=\"block.bold ? 'bold' : ''\"\n [style.textDecoration]=\"block.underline ? 'underline' : ''\"\n [style.paddingTop]=\"block.paddingTop ? block.paddingTop + unit : ''\"\n [style.paddingBottom]=\"block.paddingBottom ? block.paddingBottom + unit : ''\"\n [style.paddingLeft]=\"block.paddingLeft ? block.paddingLeft + unit : ''\"\n [style.paddingRight]=\"block.paddingRight ? block.paddingRight + unit : ''\"\n [style.padding]=\"block.padding ? block.padding + unit : ''\"\n [style.clipPath]=\"block.clipPath\"\n [style.backgroundColor]=\"block.backgroundColor\"\n [style.borderBottomLeftRadius]=\"block.shapeRadius && block.shapeBottomLeft === 'round' ? block.shapeRadius + unit : ''\"\n [style.borderBottomRightRadius]=\"block.shapeRadius && block.shapeBottomRight === 'round' ? block.shapeRadius + unit : ''\"\n [style.borderTopRightRadius]=\"block.shapeRadius && block.shapeTopRight === 'round' ? block.shapeRadius + unit : ''\"\n [style.borderTopLeftRadius]=\"block.shapeRadius && block.shapeTopLeft === 'round' ? block.shapeRadius + unit : ''\"\n [ngClass]=\"{\n 'editable': editable,\n 'vertical-align-center': block.verticalAlign === 'center',\n 'vertical-align-bottom': block.verticalAlign === 'bottom'\n }\">\n <img [src]=\"block.imageUrl\" *ngIf=\"block.imageUrl\">\n <div\n #contentEditable\n [contentEditable]=\"editable\"\n class=\"content-editable\"\n [innerHTML]=\"content\">\n </div>\n </div>\n</div>\n",
|
|
480
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
481
|
-
styles: [".block{position:absolute;display:block;outline:0;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.block .content-editable{outline:0;position:relative}.block.editable .content-editable{cursor:text}.block .content{flex-direction:column;height:100%;display:flex;border:1px dashed #c5c5c5;position:relative;box-sizing:border-box;overflow:hidden}.block .content fs-html-editor{width:100%}.block .content.vertical-align-center{justify-content:center}.block .content.vertical-align-bottom{justify-content:flex-end}.block .content img{width:100%;height:100%;position:absolute}:host ::ng-deep fs-html-editor .bottom-line,:host ::ng-deep fs-html-editor .fr-toolbar{display:none!important}:host ::ng-deep fs-html-editor .fr-wrapper{background:0 0!important;border:none!important}:host ::ng-deep .moveable-line:not(.moveable-rotation-line):not(.moveable-guideline){background:0 0!important}"]
|
|
482
|
-
}),
|
|
483
|
-
__metadata("design:paramtypes", [BlockEditorService,
|
|
484
|
-
ElementRef,
|
|
485
|
-
ChangeDetectorRef])
|
|
486
|
-
], FsBlockComponent);
|
|
438
|
+
}
|
|
439
|
+
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 });
|
|
440
|
+
FsBlockComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsBlockComponent, selector: "fs-block", inputs: { block: "block", html: "html" }, outputs: { changed: "changed" }, viewQueries: [{ propertyName: "element", first: true, predicate: ["element"], descendants: true, static: true }, { propertyName: "contentElement", first: true, predicate: ["contentElement"], descendants: true, static: true }, { propertyName: "contentEditable", first: true, predicate: ["contentEditable"], descendants: true, static: true }], ngImport: i0, template: "<div\n #element\n class=\"block\"\n [ngClass]=\"{ editable: editable, readonly: block.readonly }\">\n <div\n #contentElement\n class=\"content\"\n [style.zIndex]=\"block.index\"\n [style.borderColor]=\"block.borderColor\"\n [style.borderWidth]=\"block.borderWidth ? block.borderWidth + 'pt' : ''\"\n [style.borderStyle]=\"block.borderColor ? 'solid' : 'dashed'\"\n [style.textAlign]=\"block.horizontalAlign\"\n [style.fontStyle]=\"block.italic ? 'italic' : ''\"\n [style.fontSize]=\"block.fontSize ? block.fontSize + 'pt' : ''\"\n [style.lineHeight]=\"block.lineHeight ? block.lineHeight + 'pt' : ''\"\n [style.color]=\"block.fontColor\"\n [style.fontWeight]=\"block.bold ? 'bold' : ''\"\n [style.textDecoration]=\"block.underline ? 'underline' : ''\"\n [style.paddingTop]=\"block.paddingTop ? block.paddingTop + unit : ''\"\n [style.paddingBottom]=\"block.paddingBottom ? block.paddingBottom + unit : ''\"\n [style.paddingLeft]=\"block.paddingLeft ? block.paddingLeft + unit : ''\"\n [style.paddingRight]=\"block.paddingRight ? block.paddingRight + unit : ''\"\n [style.padding]=\"block.padding ? block.padding + unit : ''\"\n [style.clipPath]=\"block.clipPath\"\n [style.backgroundColor]=\"block.backgroundColor\"\n [style.borderBottomLeftRadius]=\"block.shapeRadius && block.shapeBottomLeft === 'round' ? block.shapeRadius + unit : ''\"\n [style.borderBottomRightRadius]=\"block.shapeRadius && block.shapeBottomRight === 'round' ? block.shapeRadius + unit : ''\"\n [style.borderTopRightRadius]=\"block.shapeRadius && block.shapeTopRight === 'round' ? block.shapeRadius + unit : ''\"\n [style.borderTopLeftRadius]=\"block.shapeRadius && block.shapeTopLeft === 'round' ? block.shapeRadius + unit : ''\"\n [ngClass]=\"{\n 'editable': editable,\n 'vertical-align-center': block.verticalAlign === 'center',\n 'vertical-align-bottom': block.verticalAlign === 'bottom'\n }\">\n <img [src]=\"block.imageUrl\" *ngIf=\"block.imageUrl\">\n <div\n #contentEditable\n [contentEditable]=\"editable\"\n class=\"content-editable\"\n [innerHTML]=\"content\">\n </div>\n </div>\n</div>\n", styles: [".block{position:absolute;display:block;outline:none;-webkit-user-select:none;user-select:none}.block:not(.readonly){cursor:pointer}.block .content-editable{outline:none;position:relative}.block.editable .content-editable{cursor:text}.block .content{flex-direction:column;height:100%;display:flex;border:1px dashed #c5c5c5;position:relative;box-sizing:border-box;overflow:hidden}.block .content fs-html-editor{width:100%}.block .content.vertical-align-center{justify-content:center}.block .content.vertical-align-bottom{justify-content:flex-end}.block .content img{width:100%;height:100%;position:absolute}:host ::ng-deep fs-html-editor .bottom-line,:host ::ng-deep fs-html-editor .fr-toolbar{display:none!important}:host ::ng-deep fs-html-editor .fr-wrapper{background:none!important;border:none!important}:host ::ng-deep .moveable-line:not(.moveable-rotation-line):not(.moveable-guideline){background:transparent!important}\n"], directives: [{ type: i7.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
441
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsBlockComponent, decorators: [{
|
|
442
|
+
type: Component,
|
|
443
|
+
args: [{
|
|
444
|
+
selector: 'fs-block',
|
|
445
|
+
templateUrl: 'block.component.html',
|
|
446
|
+
styleUrls: ['block.component.scss'],
|
|
447
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
448
|
+
}]
|
|
449
|
+
}], ctorParameters: function () { return [{ type: BlockEditorService }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { element: [{
|
|
450
|
+
type: ViewChild,
|
|
451
|
+
args: ['element', { static: true }]
|
|
452
|
+
}], contentElement: [{
|
|
453
|
+
type: ViewChild,
|
|
454
|
+
args: ['contentElement', { static: true }]
|
|
455
|
+
}], contentEditable: [{
|
|
456
|
+
type: ViewChild,
|
|
457
|
+
args: ['contentEditable', { static: true }]
|
|
458
|
+
}], block: [{
|
|
459
|
+
type: Input
|
|
460
|
+
}], html: [{
|
|
461
|
+
type: Input
|
|
462
|
+
}], changed: [{
|
|
463
|
+
type: Output
|
|
464
|
+
}] } });
|
|
487
465
|
|
|
488
|
-
|
|
466
|
+
class FsBlockEditorSidebarPanelDirective {
|
|
489
467
|
constructor(templateRef) {
|
|
490
468
|
this.templateRef = templateRef;
|
|
491
469
|
this.show = true;
|
|
492
470
|
}
|
|
493
|
-
}
|
|
494
|
-
FsBlockEditorSidebarPanelDirective
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
]
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
Directive({
|
|
507
|
-
selector: '[fsBlockEditorSidebarPanel]'
|
|
508
|
-
}),
|
|
509
|
-
__metadata("design:paramtypes", [TemplateRef])
|
|
510
|
-
], FsBlockEditorSidebarPanelDirective);
|
|
471
|
+
}
|
|
472
|
+
FsBlockEditorSidebarPanelDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsBlockEditorSidebarPanelDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
473
|
+
FsBlockEditorSidebarPanelDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FsBlockEditorSidebarPanelDirective, selector: "[fsBlockEditorSidebarPanel]", inputs: { label: "label", show: "show" }, ngImport: i0 });
|
|
474
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsBlockEditorSidebarPanelDirective, decorators: [{
|
|
475
|
+
type: Directive,
|
|
476
|
+
args: [{
|
|
477
|
+
selector: '[fsBlockEditorSidebarPanel]'
|
|
478
|
+
}]
|
|
479
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; }, propDecorators: { label: [{
|
|
480
|
+
type: Input
|
|
481
|
+
}], show: [{
|
|
482
|
+
type: Input
|
|
483
|
+
}] } });
|
|
511
484
|
|
|
512
|
-
|
|
485
|
+
class FsBlockEditorMarginDirective {
|
|
513
486
|
constructor(_elementRef) {
|
|
514
487
|
this._elementRef = _elementRef;
|
|
515
488
|
}
|
|
516
489
|
get element() {
|
|
517
490
|
return this._elementRef.nativeElement;
|
|
518
491
|
}
|
|
519
|
-
}
|
|
520
|
-
FsBlockEditorMarginDirective
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
], FsBlockEditorMarginDirective);
|
|
492
|
+
}
|
|
493
|
+
FsBlockEditorMarginDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsBlockEditorMarginDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
494
|
+
FsBlockEditorMarginDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FsBlockEditorMarginDirective, selector: "[fsBlockEditorMargin]", ngImport: i0 });
|
|
495
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsBlockEditorMarginDirective, decorators: [{
|
|
496
|
+
type: Directive,
|
|
497
|
+
args: [{
|
|
498
|
+
selector: '[fsBlockEditorMargin]'
|
|
499
|
+
}]
|
|
500
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
|
|
529
501
|
|
|
530
|
-
|
|
502
|
+
class SidebarComponent {
|
|
531
503
|
constructor(_el, _service, _cdRef) {
|
|
532
504
|
this._el = _el;
|
|
533
505
|
this._service = _service;
|
|
@@ -723,15 +695,10 @@ let SidebarComponent = class SidebarComponent {
|
|
|
723
695
|
.subscribe((block) => {
|
|
724
696
|
this.addBlock(block);
|
|
725
697
|
this.changeDetector.markForCheck();
|
|
726
|
-
this.
|
|
698
|
+
this.blockAdded
|
|
727
699
|
.pipe(take(1), takeUntil(this._destroy$))
|
|
728
|
-
.subscribe((
|
|
729
|
-
|
|
730
|
-
return item.block.reference === reference;
|
|
731
|
-
});
|
|
732
|
-
if (blockComponent) {
|
|
733
|
-
this._service.selectedBlockComponents = [blockComponent];
|
|
734
|
-
}
|
|
700
|
+
.subscribe((blockComponent) => {
|
|
701
|
+
this._service.selectedBlockComponents = [blockComponent];
|
|
735
702
|
});
|
|
736
703
|
});
|
|
737
704
|
}
|
|
@@ -793,46 +760,38 @@ let SidebarComponent = class SidebarComponent {
|
|
|
793
760
|
validNumeric(value) {
|
|
794
761
|
return !value || !!String(value).match(/^\d*\.?\d*$/);
|
|
795
762
|
}
|
|
796
|
-
}
|
|
797
|
-
SidebarComponent
|
|
798
|
-
{ type: ElementRef },
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
]
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
], SidebarComponent.prototype, "blockComponents", void 0);
|
|
818
|
-
SidebarComponent = __decorate([
|
|
819
|
-
Component({
|
|
820
|
-
selector: 'sidebar',
|
|
821
|
-
template: "<div class=\"sidebar mat-elevation-z2\">\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Tools</div>\n <div class=\"sidebar-row\">\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"blockAddClick()\">\n <mat-icon>add</mat-icon>\n </button>\n <ng-container *ngIf=\"block\">\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"blockRemoveClick()\">\n <mat-icon>clear</mat-icon>\n </button>\n <button\n class=\"layer-up\"\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"layerUp()\">\n <mat-icon>arrow_back</mat-icon>\n <mat-icon>layers</mat-icon>\n </button>\n <button\n class=\"layer-down\"\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"layerDown()\">\n <mat-icon>arrow_back</mat-icon>\n <mat-icon>layers</mat-icon>\n </button>\n </ng-container>\n </div>\n </div>\n <ng-container *ngIf=\"block\">\n <div class=\"sidebar-panel info-panel\">\n <div class=\"sidebar-label\">Info</div>\n <div class=\"sidebar-row\">\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.width\"\n name=\"width\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"widthChange($event)\">\n <span matPrefix>W</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.height\"\n name=\"height\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"heightChange($event)\">\n <span matPrefix>H</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.left\"\n name=\"left\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"leftChange($event)\">\n <span matPrefix>X</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.top\"\n name=\"top\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"topChange($event)\">\n <span matPrefix>Y</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.rotate || 0\"\n name=\"rotate\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"rotateChange($event)\">\n <span matPrefix>R</span>\n </mat-form-field>\n </div>\n </div>\n <div class=\"sidebar-panel typography-panel\">\n <div class=\"sidebar-label\">Typography</div>\n <div class=\"sidebar-row\">\n <fs-color-picker-chip\n (changed)=\"fontColorChange($event)\"\n [color]=\"block.fontColor\">\n </fs-color-picker-chip>\n\n <mat-form-field class=\"form-field-padless font-size\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.fontSize\"\n name=\"fontSize\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"fontSizeChange($event)\"\n placeholder=\"Size\">\n <span matPrefix *ngIf=\"block.fontSize\">S</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless line-height\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.lineHeight\"\n name=\"lineHeight\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"lineHeightChange($event)\"\n placeholder=\"Line\">\n <span matPrefix *ngIf=\"block.lineHeight\">L</span>\n </mat-form-field>\n </div>\n\n <div class=\"sidebar-row style-row\">\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.bold }\"\n (click)=\"boldClick()\">\n <mat-icon>format_bold</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.italic }\"\n (click)=\"italicClick()\">\n <mat-icon>format_italic</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.underline }\"\n (click)=\"underlineClick()\">\n <mat-icon>format_underline</mat-icon>\n </button>\n </div>\n\n <div class=\"sidebar-row align-row\">\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.horizontalAlign === 'left' }\"\n (click)=\"horizontalAlignClick('left')\">\n <mat-icon>format_align_left</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.horizontalAlign === 'center' }\"\n (click)=\"horizontalAlignClick('center')\">\n <mat-icon>format_align_center</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.horizontalAlign === 'right' }\"\n (click)=\"horizontalAlignClick('right')\">\n <mat-icon>format_align_right</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.verticalAlign === 'top' }\"\n (click)=\"verticalAlignClick('top')\">\n <mat-icon>vertical_align_top</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.verticalAlign === 'center' }\"\n (click)=\"verticalAlignClick('center')\">\n <mat-icon>vertical_align_center</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.verticalAlign === 'bottom' }\"\n (click)=\"verticalAlignClick('bottom')\">\n <mat-icon>vertical_align_bottom</mat-icon>\n </button>\n </div>\n </div>\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Border</div>\n\n <div class=\"sidebar-row\">\n <fs-color-picker-chip\n (changed)=\"borderColorChange($event)\"\n [color]=\"block.borderColor\">\n </fs-color-picker-chip>\n\n <mat-form-field class=\"form-field-padless border-width\" floatLabel=\"never\">\n <input\n matInput\n [(ngModel)]=\"block.borderWidth\"\n name=\"borderWidth\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"borderWidthChange($event)\"\n placeholder=\"Width\">\n <span matPrefix *ngIf=\"block.borderWidth\">W</span>\n </mat-form-field>\n </div>\n </div>\n\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Shape</div>\n\n <div class=\"sidebar-row\">\n <fs-color-picker-chip\n (changed)=\"backgroundColorChange($event)\"\n [color]=\"block.backgroundColor\">\n </fs-color-picker-chip>\n\n <mat-form-field class=\"form-field-padless shape-radius\" floatLabel=\"never\">\n <input\n matInput\n [(ngModel)]=\"block.shapeRadius\"\n name=\"shapeRadius\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"shapeRadiusChange($event)\"\n placeholder=\"Radius\">\n <span matPrefix *ngIf=\"block.shapeRadius\">R</span>\n </mat-form-field>\n\n <div class=\"shape-corners\">\n <div\n class=\"shape-corner shape-corner-top-left\"\n [ngClass]=\"{ round: block.shapeTopLeft === 'round' }\"\n (click)=\"shapeRound('shapeTopLeft')\"></div>\n <div\n class=\"shape-corner shape-corner-top-right\"\n [ngClass]=\"{ round: block.shapeTopRight === 'round' }\"\n (click)=\"shapeRound('shapeTopRight')\"></div>\n <div\n class=\"shape-corner shape-corner-bottom-left\"\n [ngClass]=\"{ round: block.shapeBottomLeft === 'round' }\"\n (click)=\"shapeRound('shapeBottomLeft')\"></div>\n <div\n class=\"shape-corner shape-corner-bottom-right\"\n [ngClass]=\"{ round: block.shapeBottomRight === 'round' }\"\n (click)=\"shapeRound('shapeBottomRight')\"></div>\n </div>\n </div>\n </div>\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Image</div>\n <div class=\"sidebar-row image-row\">\n <fs-file (select)=\"fileSelect($event)\">\n <button type=\"button\" mat-icon-button><mat-icon>cloud_upload</mat-icon></button>\n </fs-file>\n <ng-container *ngIf=\"block.imageUrl\">\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"imageRemove()\">\n <mat-icon>clear</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: clippable }\"\n (click)=\"imageClip()\">\n <mat-icon>crop</mat-icon>\n </button>\n </ng-container>\n </div>\n </div>\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Padding</div>\n <div class=\"sidebar-row padding-row\">\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.padding\"\n name=\"padding\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"paddingAllChange($event)\"\n placeholder=\"All\">\n <span matPrefix *ngIf=\"block.padding\">A</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingTop\"\n name=\"paddingTop\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"paddingChange('paddingTop',$event)\"\n placeholder=\"Top\">\n <span matPrefix *ngIf=\"block.paddingTop\">T</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingBottom\"\n name=\"paddingBottom\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"paddingChange('paddingBottom',$event)\"\n placeholder=\"Bottom\">\n <span matPrefix *ngIf=\"block.paddingBottom\">B</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingLeft\"\n name=\"paddingLeft\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"paddingChange('paddingLeft',$event)\"\n placeholder=\"Left\">\n <span matPrefix *ngIf=\"block.paddingLeft\">L</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingRight\"\n name=\"paddingRight\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"paddingChange('paddingRight',$event)\"\n placeholder=\"Right\">\n <span matPrefix *ngIf=\"block.paddingRight\">R</span>\n </mat-form-field>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngFor=\"let sidebarPanel of sidebarPanels\">\n <div div class=\"sidebar-panel\" *ngIf=\"sidebarPanel.show\">\n <div class=\"sidebar-label\">{{sidebarPanel.label}}</div>\n <ng-container\n [ngTemplateOutlet]=\"sidebarPanel.templateRef\"\n [ngTemplateOutletContext]=\"{ block: block }\"></ng-container>\n </div>\n </ng-container>\n</div>\n",
|
|
822
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
823
|
-
styles: [".sidebar{width:285px;font-size:14px;height:100%}.sidebar .sidebar-row{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center}.sidebar .sidebar-row.padding-row{flex-wrap:unset}.sidebar .sidebar-row.padding-row ::ng-deep .mat-form-field{width:20%;min-width:0}.sidebar .sidebar-row.image-row{margin-bottom:-5px}.sidebar .sidebar-row ::ng-deep .field-label,.sidebar .sidebar-row ::ng-deep .mat-form-field-prefix{color:#a5a5a5;font-size:11px;margin-right:2px}.sidebar .sidebar-row ::ng-deep .mat-form-field{font-size:12px}.sidebar .sidebar-row>:not(.mat-icon-button):not(fs-file){margin-right:11px}.sidebar .sidebar-row>:not(.mat-icon-button):not(fs-file):last-child{margin-right:0}.sidebar .layer-down ::ng-deep .mat-button-wrapper,.sidebar .layer-up ::ng-deep .mat-button-wrapper{position:relative}.sidebar .layer-down ::ng-deep .mat-button-wrapper mat-icon:first-child,.sidebar .layer-up ::ng-deep .mat-button-wrapper mat-icon:first-child{position:absolute;transform:rotate(90deg) scale(.6);top:-6px;color:#fff}.sidebar .layer-down mat-icon:first-child{transform:rotate(270deg) scale(.6)}.sidebar .border-width,.sidebar .font-size,.sidebar .line-height,.sidebar .padding{width:45px}.sidebar .shape-radius{width:50px}.sidebar .shape-corners{display:-ms-grid;display:grid;-ms-grid-columns:1fr 1fr;grid-template-columns:1fr 1fr;-moz-column-gap:1px;column-gap:1px;row-gap:1px}.sidebar .shape-corners .shape-corner{height:13px;width:13px;background-color:#ccc;cursor:pointer}.sidebar .shape-corners .shape-corner.round.shape-corner-top-right{border-top-right-radius:50%}.sidebar .shape-corners .shape-corner.round.shape-corner-top-left{border-top-left-radius:50%}.sidebar .shape-corners .shape-corner.round.shape-corner-bottom-left{border-bottom-left-radius:50%}.sidebar .shape-corners .shape-corner.round.shape-corner-bottom-right{border-bottom-right-radius:50%}.sidebar button.toggle-button:not(.selected) mat-icon{color:#ccc}.sidebar .sidebar-panel{padding:10px;border-bottom:1px solid #dadada}.sidebar .sidebar-panel.info-panel .sidebar-row{justify-content:space-evenly}.sidebar .sidebar-panel.info-panel .sidebar-row .mat-form-field{width:41px}.sidebar .sidebar-panel.info-panel .sidebar-row>{margin:0}.sidebar .sidebar-panel.typography-panel .style-row{margin-bottom:-10px}.sidebar .sidebar-panel.typography-panel .align-row{margin-bottom:-5px}.sidebar .sidebar-panel .sidebar-label{font-size:11px;margin-bottom:3px;color:#9e9e9e}"]
|
|
824
|
-
}),
|
|
825
|
-
__metadata("design:paramtypes", [ElementRef,
|
|
826
|
-
BlockEditorService,
|
|
827
|
-
ChangeDetectorRef])
|
|
828
|
-
], SidebarComponent);
|
|
763
|
+
}
|
|
764
|
+
SidebarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SidebarComponent, deps: [{ token: i0.ElementRef }, { token: BlockEditorService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
765
|
+
SidebarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SidebarComponent, selector: "sidebar", inputs: { config: "config", blocks: "blocks", blockAdded: "blockAdded" }, queries: [{ propertyName: "sidebarPanels", predicate: FsBlockEditorSidebarPanelDirective }], ngImport: i0, template: "<div class=\"sidebar mat-elevation-z2\">\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Tools</div>\n <div class=\"sidebar-row\">\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"blockAddClick()\">\n <mat-icon>add</mat-icon>\n </button>\n <ng-container *ngIf=\"block\">\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"blockRemoveClick()\">\n <mat-icon>clear</mat-icon>\n </button>\n <button\n class=\"layer-up\"\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"layerUp()\">\n <mat-icon>arrow_back</mat-icon>\n <mat-icon>layers</mat-icon>\n </button>\n <button\n class=\"layer-down\"\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"layerDown()\">\n <mat-icon>arrow_back</mat-icon>\n <mat-icon>layers</mat-icon>\n </button>\n </ng-container>\n </div>\n </div>\n <ng-container *ngIf=\"block\">\n <div class=\"sidebar-panel info-panel\">\n <div class=\"sidebar-label\">Info</div>\n <div class=\"sidebar-row\">\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.width\"\n name=\"width\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"widthChange($event)\">\n <span matPrefix>W</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.height\"\n name=\"height\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"heightChange($event)\">\n <span matPrefix>H</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.left\"\n name=\"left\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"leftChange($event)\">\n <span matPrefix>X</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.top\"\n name=\"top\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"topChange($event)\">\n <span matPrefix>Y</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.rotate || 0\"\n name=\"rotate\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"rotateChange($event)\">\n <span matPrefix>R</span>\n </mat-form-field>\n </div>\n </div>\n <div class=\"sidebar-panel typography-panel\">\n <div class=\"sidebar-label\">Typography</div>\n <div class=\"sidebar-row\">\n <fs-color-picker-chip\n (changed)=\"fontColorChange($event)\"\n [color]=\"block.fontColor\">\n </fs-color-picker-chip>\n\n <mat-form-field class=\"form-field-padless font-size\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.fontSize\"\n name=\"fontSize\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"fontSizeChange($event)\"\n placeholder=\"Size\">\n <span matPrefix *ngIf=\"block.fontSize\">S</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless line-height\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.lineHeight\"\n name=\"lineHeight\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"lineHeightChange($event)\"\n placeholder=\"Line\">\n <span matPrefix *ngIf=\"block.lineHeight\">L</span>\n </mat-form-field>\n </div>\n\n <div class=\"sidebar-row style-row\">\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.bold }\"\n (click)=\"boldClick()\">\n <mat-icon>format_bold</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.italic }\"\n (click)=\"italicClick()\">\n <mat-icon>format_italic</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.underline }\"\n (click)=\"underlineClick()\">\n <mat-icon>format_underline</mat-icon>\n </button>\n </div>\n\n <div class=\"sidebar-row align-row\">\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.horizontalAlign === 'left' }\"\n (click)=\"horizontalAlignClick('left')\">\n <mat-icon>format_align_left</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.horizontalAlign === 'center' }\"\n (click)=\"horizontalAlignClick('center')\">\n <mat-icon>format_align_center</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.horizontalAlign === 'right' }\"\n (click)=\"horizontalAlignClick('right')\">\n <mat-icon>format_align_right</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.verticalAlign === 'top' }\"\n (click)=\"verticalAlignClick('top')\">\n <mat-icon>vertical_align_top</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.verticalAlign === 'center' }\"\n (click)=\"verticalAlignClick('center')\">\n <mat-icon>vertical_align_center</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.verticalAlign === 'bottom' }\"\n (click)=\"verticalAlignClick('bottom')\">\n <mat-icon>vertical_align_bottom</mat-icon>\n </button>\n </div>\n </div>\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Border</div>\n\n <div class=\"sidebar-row\">\n <fs-color-picker-chip\n (changed)=\"borderColorChange($event)\"\n [color]=\"block.borderColor\">\n </fs-color-picker-chip>\n\n <mat-form-field class=\"form-field-padless border-width\" floatLabel=\"never\">\n <input\n matInput\n [(ngModel)]=\"block.borderWidth\"\n name=\"borderWidth\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"borderWidthChange($event)\"\n placeholder=\"Width\">\n <span matPrefix *ngIf=\"block.borderWidth\">W</span>\n </mat-form-field>\n </div>\n </div>\n\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Shape</div>\n\n <div class=\"sidebar-row\">\n <fs-color-picker-chip\n (changed)=\"backgroundColorChange($event)\"\n [color]=\"block.backgroundColor\">\n </fs-color-picker-chip>\n\n <mat-form-field class=\"form-field-padless shape-radius\" floatLabel=\"never\">\n <input\n matInput\n [(ngModel)]=\"block.shapeRadius\"\n name=\"shapeRadius\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"shapeRadiusChange($event)\"\n placeholder=\"Radius\">\n <span matPrefix *ngIf=\"block.shapeRadius\">R</span>\n </mat-form-field>\n\n <div class=\"shape-corners\">\n <div\n class=\"shape-corner shape-corner-top-left\"\n [ngClass]=\"{ round: block.shapeTopLeft === 'round' }\"\n (click)=\"shapeRound('shapeTopLeft')\"></div>\n <div\n class=\"shape-corner shape-corner-top-right\"\n [ngClass]=\"{ round: block.shapeTopRight === 'round' }\"\n (click)=\"shapeRound('shapeTopRight')\"></div>\n <div\n class=\"shape-corner shape-corner-bottom-left\"\n [ngClass]=\"{ round: block.shapeBottomLeft === 'round' }\"\n (click)=\"shapeRound('shapeBottomLeft')\"></div>\n <div\n class=\"shape-corner shape-corner-bottom-right\"\n [ngClass]=\"{ round: block.shapeBottomRight === 'round' }\"\n (click)=\"shapeRound('shapeBottomRight')\"></div>\n </div>\n </div>\n </div>\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Image</div>\n <div class=\"sidebar-row image-row\">\n <fs-file (select)=\"fileSelect($event)\">\n <button type=\"button\" mat-icon-button><mat-icon>cloud_upload</mat-icon></button>\n </fs-file>\n <ng-container *ngIf=\"block.imageUrl\">\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"imageRemove()\">\n <mat-icon>clear</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: clippable }\"\n (click)=\"imageClip()\">\n <mat-icon>crop</mat-icon>\n </button>\n </ng-container>\n </div>\n </div>\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Padding</div>\n <div class=\"sidebar-row padding-row\">\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.padding\"\n name=\"padding\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"paddingAllChange($event)\"\n placeholder=\"All\">\n <span matPrefix *ngIf=\"block.padding\">A</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingTop\"\n name=\"paddingTop\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"paddingChange('paddingTop',$event)\"\n placeholder=\"Top\">\n <span matPrefix *ngIf=\"block.paddingTop\">T</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingBottom\"\n name=\"paddingBottom\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"paddingChange('paddingBottom',$event)\"\n placeholder=\"Bottom\">\n <span matPrefix *ngIf=\"block.paddingBottom\">B</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingLeft\"\n name=\"paddingLeft\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"paddingChange('paddingLeft',$event)\"\n placeholder=\"Left\">\n <span matPrefix *ngIf=\"block.paddingLeft\">L</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingRight\"\n name=\"paddingRight\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"paddingChange('paddingRight',$event)\"\n placeholder=\"Right\">\n <span matPrefix *ngIf=\"block.paddingRight\">R</span>\n </mat-form-field>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngFor=\"let sidebarPanel of sidebarPanels\">\n <div div class=\"sidebar-panel\" *ngIf=\"sidebarPanel.show\">\n <div class=\"sidebar-label\">{{sidebarPanel.label}}</div>\n <ng-container\n [ngTemplateOutlet]=\"sidebarPanel.templateRef\"\n [ngTemplateOutletContext]=\"{ block: block }\"></ng-container>\n </div>\n </ng-container>\n</div>\n", styles: [".sidebar{width:285px;font-size:14px;height:100%}.sidebar .sidebar-row{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center}.sidebar .sidebar-row.padding-row{flex-wrap:unset}.sidebar .sidebar-row.padding-row ::ng-deep .mat-form-field{width:20%;min-width:0}.sidebar .sidebar-row.image-row{margin-bottom:-5px}.sidebar .sidebar-row ::ng-deep .mat-form-field-prefix,.sidebar .sidebar-row ::ng-deep .field-label{color:#a5a5a5;font-size:11px;margin-right:2px}.sidebar .sidebar-row ::ng-deep .mat-form-field{font-size:12px}.sidebar .sidebar-row>*:not(.mat-icon-button):not(fs-file){margin-right:11px}.sidebar .sidebar-row>*:not(.mat-icon-button):not(fs-file):last-child{margin-right:0}.sidebar .layer-up ::ng-deep .mat-button-wrapper,.sidebar .layer-down ::ng-deep .mat-button-wrapper{position:relative}.sidebar .layer-up ::ng-deep .mat-button-wrapper mat-icon:first-child,.sidebar .layer-down ::ng-deep .mat-button-wrapper mat-icon:first-child{position:absolute;transform:rotate(90deg) scale(.6);top:-6px;color:#fff}.sidebar .layer-down mat-icon:first-child{transform:rotate(270deg) scale(.6)}.sidebar .padding{width:45px}.sidebar .line-height,.sidebar .font-size,.sidebar .border-width{width:45px}.sidebar .shape-radius{width:50px}.sidebar .shape-corners{display:grid;grid-template-columns:1fr 1fr;grid-column-gap:1px;column-gap:1px;grid-row-gap:1px;row-gap:1px}.sidebar .shape-corners .shape-corner{height:13px;width:13px;background-color:#ccc;cursor:pointer}.sidebar .shape-corners .shape-corner.round.shape-corner-top-right{border-top-right-radius:50%}.sidebar .shape-corners .shape-corner.round.shape-corner-top-left{border-top-left-radius:50%}.sidebar .shape-corners .shape-corner.round.shape-corner-bottom-left{border-bottom-left-radius:50%}.sidebar .shape-corners .shape-corner.round.shape-corner-bottom-right{border-bottom-right-radius:50%}.sidebar button.toggle-button:not(.selected) mat-icon{color:#ccc}.sidebar .sidebar-panel{padding:10px;border-bottom:1px solid #dadada}.sidebar .sidebar-panel.info-panel .sidebar-row{justify-content:space-evenly}.sidebar .sidebar-panel.info-panel .sidebar-row .mat-form-field{width:41px}.sidebar .sidebar-panel.info-panel .sidebar-row >{margin:0}.sidebar .sidebar-panel.typography-panel .style-row{margin-bottom:-10px}.sidebar .sidebar-panel.typography-panel .align-row{margin-bottom:-5px}.sidebar .sidebar-panel .sidebar-label{font-size:11px;margin-bottom:3px;color:#9e9e9e}\n"], components: [{ type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i4.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i5.FsColorPickerChipComponent, selector: "fs-color-picker-chip", inputs: ["color"], outputs: ["changed"] }, { type: i6.FsFileComponent, selector: "fs-file", inputs: ["minHeight", "minWidth", "multiple", "capture", "allowClick", "allowDrop", "accept", "disabled", "imageWidth", "imageHeight", "imageQuality"], outputs: ["select", "error", "clicked", "declined"] }], directives: [{ type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i8.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i9.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i9.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i9.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i4.MatPrefix, selector: "[matPrefix]" }, { type: i7.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i7.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
766
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SidebarComponent, decorators: [{
|
|
767
|
+
type: Component,
|
|
768
|
+
args: [{
|
|
769
|
+
selector: 'sidebar',
|
|
770
|
+
templateUrl: 'sidebar.component.html',
|
|
771
|
+
styleUrls: ['sidebar.component.scss'],
|
|
772
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
773
|
+
}]
|
|
774
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: BlockEditorService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { sidebarPanels: [{
|
|
775
|
+
type: ContentChildren,
|
|
776
|
+
args: [FsBlockEditorSidebarPanelDirective]
|
|
777
|
+
}], config: [{
|
|
778
|
+
type: Input
|
|
779
|
+
}], blocks: [{
|
|
780
|
+
type: Input
|
|
781
|
+
}], blockAdded: [{
|
|
782
|
+
type: Input
|
|
783
|
+
}] } });
|
|
829
784
|
|
|
830
|
-
|
|
831
|
-
constructor(_el, _service, _cdRef) {
|
|
785
|
+
class FsBlockEditorComponent {
|
|
786
|
+
constructor(_el, _service, _cdRef, _differs) {
|
|
832
787
|
this._el = _el;
|
|
833
788
|
this._service = _service;
|
|
834
789
|
this._cdRef = _cdRef;
|
|
790
|
+
this._differs = _differs;
|
|
791
|
+
this.blockAdded = new EventEmitter();
|
|
792
|
+
this.blockRemoved = new EventEmitter();
|
|
835
793
|
this._destroy$ = new Subject();
|
|
794
|
+
this._differ = _differs.find([]).create(null);
|
|
836
795
|
}
|
|
837
796
|
get el() {
|
|
838
797
|
return this._el.nativeElement;
|
|
@@ -890,99 +849,126 @@ let FsBlockEditorComponent = class FsBlockEditorComponent {
|
|
|
890
849
|
}
|
|
891
850
|
}
|
|
892
851
|
ngAfterViewInit() {
|
|
852
|
+
this.blockComponents.changes.subscribe((changes) => {
|
|
853
|
+
const changeDiff = this._differ.diff(changes);
|
|
854
|
+
if (changeDiff) {
|
|
855
|
+
changeDiff.forEachAddedItem((change) => {
|
|
856
|
+
this.blockAdded.emit(change.item);
|
|
857
|
+
});
|
|
858
|
+
changeDiff.forEachRemovedItem((change) => {
|
|
859
|
+
this.blockRemoved.emit(change.item);
|
|
860
|
+
});
|
|
861
|
+
}
|
|
862
|
+
});
|
|
893
863
|
}
|
|
894
864
|
ngOnDestroy() {
|
|
895
865
|
this._destroy$.next();
|
|
896
866
|
this._destroy$.complete();
|
|
897
867
|
}
|
|
898
|
-
}
|
|
899
|
-
FsBlockEditorComponent
|
|
900
|
-
|
|
901
|
-
{ type: BlockEditorService },
|
|
902
|
-
{ type: ChangeDetectorRef }
|
|
903
|
-
];
|
|
904
|
-
__decorate([
|
|
905
|
-
ContentChildren(FsBlockEditorSidebarPanelDirective),
|
|
906
|
-
__metadata("design:type", QueryList)
|
|
907
|
-
], FsBlockEditorComponent.prototype, "sidebarPanels", void 0);
|
|
908
|
-
__decorate([
|
|
909
|
-
ViewChildren(FsBlockComponent),
|
|
910
|
-
__metadata("design:type", QueryList)
|
|
911
|
-
], FsBlockEditorComponent.prototype, "blockComponents", void 0);
|
|
912
|
-
__decorate([
|
|
913
|
-
ViewChild('artboard', { static: true }),
|
|
914
|
-
__metadata("design:type", ElementRef)
|
|
915
|
-
], FsBlockEditorComponent.prototype, "artboard", void 0);
|
|
916
|
-
__decorate([
|
|
917
|
-
ViewChild('marginContainer', { static: true }),
|
|
918
|
-
__metadata("design:type", ElementRef)
|
|
919
|
-
], FsBlockEditorComponent.prototype, "marginContainer", void 0);
|
|
920
|
-
__decorate([
|
|
921
|
-
ViewChildren(FsBlockEditorMarginDirective),
|
|
922
|
-
__metadata("design:type", QueryList)
|
|
923
|
-
], FsBlockEditorComponent.prototype, "margins", void 0);
|
|
924
|
-
__decorate([
|
|
925
|
-
ViewChild('artboardContainer', { static: true }),
|
|
926
|
-
__metadata("design:type", ElementRef)
|
|
927
|
-
], FsBlockEditorComponent.prototype, "artboardContainer", void 0);
|
|
928
|
-
__decorate([
|
|
929
|
-
ViewChild(SidebarComponent, { static: true }),
|
|
930
|
-
__metadata("design:type", SidebarComponent)
|
|
931
|
-
], FsBlockEditorComponent.prototype, "sidebar", void 0);
|
|
932
|
-
__decorate([
|
|
933
|
-
Input(),
|
|
934
|
-
__metadata("design:type", Object)
|
|
935
|
-
], FsBlockEditorComponent.prototype, "config", void 0);
|
|
936
|
-
FsBlockEditorComponent = __decorate([
|
|
937
|
-
Component({
|
|
938
|
-
selector: 'fs-block-editor',
|
|
939
|
-
template: "<div class=\"editor-container\">\n <div\n #artboardContainer\n class=\"artboard-container\"\n (click)=\"artboardClick($event)\">\n <div\n #artboard\n class=\"artboard mat-elevation-z2\"\n [style.width]=\"config.width + config.unit\"\n [style.height]=\"config.height + config.unit\">\n <fs-block\n *ngFor=\"let block of blocks; trackBy\"\n [block]=\"block\"\n (changed)=\"blockChanged($event)\">\n </fs-block>\n <div class=\"margin margin-top\" *ngIf=\"config.marginTop\" [style.top]=\"config.marginTop + 'in'\"></div>\n <div class=\"margin margin-left\" *ngIf=\"config.marginLeft\" [style.left]=\"config.marginLeft + 'in'\"></div>\n <div class=\"margin margin-bottom\" *ngIf=\"config.marginBottom\" [style.bottom]=\"config.marginBottom + 'in'\"></div>\n <div class=\"margin margin-right\" *ngIf=\"config.marginRight\" [style.right]=\"config.marginRight + 'in'\"></div>\n <div\n #marginContainer\n class=\"margin-container\"\n [style.top]=\"config.marginTop + 'in'\"\n [style.right]=\"config.marginRight + 'in'\"\n [style.bottom]=\"config.marginBottom + 'in'\"\n [style.left]=\"config.marginLeft + 'in'\"></div>\n </div>\n </div>\n <sidebar\n [config]=\"config\"\n [blocks]=\"blocks\"\n [blockComponents]=\"blockComponents\">\n </sidebar>\n</div>\n",
|
|
940
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
941
|
-
providers: [
|
|
942
|
-
BlockEditorService,
|
|
943
|
-
],
|
|
944
|
-
styles: [".editor-container{display:flex;flex-direction:row;position:relative}.editor-container .artboard-container{display:flex;flex-grow:1;justify-content:center;padding:25px;overflow:auto;min-width:0}.editor-container .artboard-container .artboard{position:relative}.editor-container .artboard-container .artboard .margin-container{position:absolute;z-index:-1}.editor-container .artboard-container .artboard .margin{position:absolute;border:0 dashed #ff85bd5e}.editor-container .artboard-container .artboard .margin.margin-bottom,.editor-container .artboard-container .artboard .margin.margin-top{width:100%;border-top-width:1px}.editor-container .artboard-container .artboard .margin.margin-left,.editor-container .artboard-container .artboard .margin.margin-right{height:100%;border-left-width:1px}"]
|
|
945
|
-
}),
|
|
946
|
-
__metadata("design:paramtypes", [ElementRef,
|
|
868
|
+
}
|
|
869
|
+
FsBlockEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsBlockEditorComponent, deps: [{ token: i0.ElementRef }, { token: BlockEditorService }, { token: i0.ChangeDetectorRef }, { token: i0.IterableDiffers }], target: i0.ɵɵFactoryTarget.Component });
|
|
870
|
+
FsBlockEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsBlockEditorComponent, selector: "fs-block-editor", inputs: { config: "config" }, outputs: { blockAdded: "blockAdded", blockRemoved: "blockRemoved" }, providers: [
|
|
947
871
|
BlockEditorService,
|
|
948
|
-
|
|
949
|
-
|
|
872
|
+
], queries: [{ propertyName: "sidebarPanels", predicate: FsBlockEditorSidebarPanelDirective }], viewQueries: [{ propertyName: "artboard", first: true, predicate: ["artboard"], descendants: true, static: true }, { propertyName: "marginContainer", first: true, predicate: ["marginContainer"], descendants: true, static: true }, { propertyName: "artboardContainer", first: true, predicate: ["artboardContainer"], descendants: true, static: true }, { propertyName: "sidebar", first: true, predicate: SidebarComponent, descendants: true, static: true }, { propertyName: "blockComponents", predicate: FsBlockComponent, descendants: true }, { propertyName: "margins", predicate: FsBlockEditorMarginDirective, descendants: true }], ngImport: i0, template: "<div class=\"editor-container\">\n <div\n #artboardContainer\n class=\"artboard-container\"\n (click)=\"artboardClick($event)\">\n <div\n #artboard\n class=\"artboard mat-elevation-z2\"\n [style.width]=\"config.width + config.unit\"\n [style.height]=\"config.height + config.unit\">\n <fs-block\n *ngFor=\"let block of blocks; trackBy\"\n [block]=\"block\"\n (changed)=\"blockChanged($event)\">\n </fs-block>\n <div class=\"margin margin-top\" *ngIf=\"config.marginTop\" [style.top]=\"config.marginTop + 'in'\"></div>\n <div class=\"margin margin-left\" *ngIf=\"config.marginLeft\" [style.left]=\"config.marginLeft + 'in'\"></div>\n <div class=\"margin margin-bottom\" *ngIf=\"config.marginBottom\" [style.bottom]=\"config.marginBottom + 'in'\"></div>\n <div class=\"margin margin-right\" *ngIf=\"config.marginRight\" [style.right]=\"config.marginRight + 'in'\"></div>\n <div\n #marginContainer\n class=\"margin-container\"\n [style.top]=\"config.marginTop + 'in'\"\n [style.right]=\"config.marginRight + 'in'\"\n [style.bottom]=\"config.marginBottom + 'in'\"\n [style.left]=\"config.marginLeft + 'in'\"></div>\n </div>\n </div>\n <sidebar\n [config]=\"config\"\n [blocks]=\"blocks\"\n [blockAdded]=\"blockAdded\">\n </sidebar>\n</div>\n", styles: [".editor-container{display:flex;flex-direction:row;position:relative}.editor-container .artboard-container{display:flex;flex-grow:1;justify-content:center;padding:25px;overflow:auto;min-width:0}.editor-container .artboard-container .artboard{position:relative}.editor-container .artboard-container .artboard .margin-container{position:absolute;z-index:-1}.editor-container .artboard-container .artboard .margin{position:absolute;border-color:#ff85bd5e;border-style:dashed;border-width:0px}.editor-container .artboard-container .artboard .margin.margin-top,.editor-container .artboard-container .artboard .margin.margin-bottom{width:100%;border-top-width:1px}.editor-container .artboard-container .artboard .margin.margin-left,.editor-container .artboard-container .artboard .margin.margin-right{height:100%;border-left-width:1px}\n"], components: [{ type: FsBlockComponent, selector: "fs-block", inputs: ["block", "html"], outputs: ["changed"] }, { type: SidebarComponent, selector: "sidebar", inputs: ["config", "blocks", "blockAdded"] }], directives: [{ type: i7.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
873
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsBlockEditorComponent, decorators: [{
|
|
874
|
+
type: Component,
|
|
875
|
+
args: [{
|
|
876
|
+
selector: 'fs-block-editor',
|
|
877
|
+
templateUrl: 'block-editor.component.html',
|
|
878
|
+
styleUrls: ['block-editor.component.scss'],
|
|
879
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
880
|
+
providers: [
|
|
881
|
+
BlockEditorService,
|
|
882
|
+
]
|
|
883
|
+
}]
|
|
884
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: BlockEditorService }, { type: i0.ChangeDetectorRef }, { type: i0.IterableDiffers }]; }, propDecorators: { sidebarPanels: [{
|
|
885
|
+
type: ContentChildren,
|
|
886
|
+
args: [FsBlockEditorSidebarPanelDirective]
|
|
887
|
+
}], blockComponents: [{
|
|
888
|
+
type: ViewChildren,
|
|
889
|
+
args: [FsBlockComponent]
|
|
890
|
+
}], artboard: [{
|
|
891
|
+
type: ViewChild,
|
|
892
|
+
args: ['artboard', { static: true }]
|
|
893
|
+
}], marginContainer: [{
|
|
894
|
+
type: ViewChild,
|
|
895
|
+
args: ['marginContainer', { static: true }]
|
|
896
|
+
}], margins: [{
|
|
897
|
+
type: ViewChildren,
|
|
898
|
+
args: [FsBlockEditorMarginDirective]
|
|
899
|
+
}], artboardContainer: [{
|
|
900
|
+
type: ViewChild,
|
|
901
|
+
args: ['artboardContainer', { static: true }]
|
|
902
|
+
}], sidebar: [{
|
|
903
|
+
type: ViewChild,
|
|
904
|
+
args: [SidebarComponent, { static: true }]
|
|
905
|
+
}], config: [{
|
|
906
|
+
type: Input
|
|
907
|
+
}], blockAdded: [{
|
|
908
|
+
type: Output
|
|
909
|
+
}], blockRemoved: [{
|
|
910
|
+
type: Output
|
|
911
|
+
}] } });
|
|
950
912
|
|
|
951
|
-
|
|
952
|
-
let FsBlockEditorModule = FsBlockEditorModule_1 = class FsBlockEditorModule {
|
|
913
|
+
class FsBlockEditorModule {
|
|
953
914
|
static forRoot() {
|
|
954
915
|
return {
|
|
955
|
-
ngModule:
|
|
916
|
+
ngModule: FsBlockEditorModule,
|
|
956
917
|
};
|
|
957
918
|
}
|
|
958
|
-
}
|
|
959
|
-
FsBlockEditorModule =
|
|
960
|
-
|
|
961
|
-
|
|
919
|
+
}
|
|
920
|
+
FsBlockEditorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsBlockEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
921
|
+
FsBlockEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsBlockEditorModule, declarations: [FsBlockComponent,
|
|
922
|
+
FsBlockEditorComponent,
|
|
923
|
+
FsBlockEditorSidebarPanelDirective,
|
|
924
|
+
FsBlockEditorMarginDirective,
|
|
925
|
+
SidebarComponent], imports: [CommonModule,
|
|
926
|
+
FormsModule,
|
|
927
|
+
MatIconModule,
|
|
928
|
+
MatButtonModule,
|
|
929
|
+
MatInputModule,
|
|
930
|
+
MatFormFieldModule,
|
|
931
|
+
FsFileModule,
|
|
932
|
+
FsColorPickerModule], exports: [FsBlockComponent,
|
|
933
|
+
FsBlockEditorComponent,
|
|
934
|
+
FsBlockEditorSidebarPanelDirective] });
|
|
935
|
+
FsBlockEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsBlockEditorModule, imports: [[
|
|
962
936
|
CommonModule,
|
|
963
937
|
FormsModule,
|
|
964
938
|
MatIconModule,
|
|
965
939
|
MatButtonModule,
|
|
966
940
|
MatInputModule,
|
|
967
941
|
MatFormFieldModule,
|
|
968
|
-
FsHtmlEditorModule,
|
|
969
942
|
FsFileModule,
|
|
970
943
|
FsColorPickerModule,
|
|
971
|
-
]
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
944
|
+
]] });
|
|
945
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsBlockEditorModule, decorators: [{
|
|
946
|
+
type: NgModule,
|
|
947
|
+
args: [{
|
|
948
|
+
imports: [
|
|
949
|
+
CommonModule,
|
|
950
|
+
FormsModule,
|
|
951
|
+
MatIconModule,
|
|
952
|
+
MatButtonModule,
|
|
953
|
+
MatInputModule,
|
|
954
|
+
MatFormFieldModule,
|
|
955
|
+
FsFileModule,
|
|
956
|
+
FsColorPickerModule,
|
|
957
|
+
],
|
|
958
|
+
exports: [
|
|
959
|
+
FsBlockComponent,
|
|
960
|
+
FsBlockEditorComponent,
|
|
961
|
+
FsBlockEditorSidebarPanelDirective,
|
|
962
|
+
],
|
|
963
|
+
declarations: [
|
|
964
|
+
FsBlockComponent,
|
|
965
|
+
FsBlockEditorComponent,
|
|
966
|
+
FsBlockEditorSidebarPanelDirective,
|
|
967
|
+
FsBlockEditorMarginDirective,
|
|
968
|
+
SidebarComponent,
|
|
969
|
+
],
|
|
970
|
+
}]
|
|
971
|
+
}] });
|
|
986
972
|
|
|
987
973
|
/*
|
|
988
974
|
* Public API Surface of fs-menu
|
|
@@ -992,5 +978,5 @@ FsBlockEditorModule = FsBlockEditorModule_1 = __decorate([
|
|
|
992
978
|
* Generated bundle index. Do not edit.
|
|
993
979
|
*/
|
|
994
980
|
|
|
995
|
-
export { FsBlockComponent, FsBlockEditorComponent, FsBlockEditorModule, FsBlockEditorSidebarPanelDirective
|
|
981
|
+
export { FsBlockComponent, FsBlockEditorComponent, FsBlockEditorModule, FsBlockEditorSidebarPanelDirective };
|
|
996
982
|
//# sourceMappingURL=firestitch-block-editor.js.map
|