@firestitch/content 12.2.1 → 12.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. package/app/interfaces/content-config.d.ts +5 -5
  2. package/app/interfaces/content-page.d.ts +1 -0
  3. package/app/interfaces/content-style.d.ts +4 -0
  4. package/app/interfaces/index.d.ts +2 -1
  5. package/app/modules/content/components/content/content.component.d.ts +7 -3
  6. package/app/modules/content/components/content-renderer/content-renderer.component.d.ts +11 -9
  7. package/app/modules/content-layouts/components/content-layouts/content-layouts.component.d.ts +3 -2
  8. package/app/modules/content-pages/components/content-pages/content-pages.component.d.ts +2 -0
  9. package/app/modules/content-style/components/content-style/content-style.component.d.ts +27 -0
  10. package/app/modules/content-style/components/content-style/index.d.ts +1 -0
  11. package/app/modules/content-style/fs-content-style.module.d.ts +14 -0
  12. package/app/modules/editor/components/editor/editor.component.d.ts +33 -22
  13. package/app/modules/editor/fs-content-editor.module.d.ts +8 -5
  14. package/bundles/firestitch-content.umd.js +635 -521
  15. package/bundles/firestitch-content.umd.js.map +1 -1
  16. package/esm2015/app/interfaces/content-config.js +1 -1
  17. package/esm2015/app/interfaces/content-page.js +1 -1
  18. package/esm2015/app/interfaces/content-style.js +2 -0
  19. package/esm2015/app/interfaces/index.js +3 -2
  20. package/esm2015/app/modules/content/components/content/content.component.js +35 -20
  21. package/esm2015/app/modules/content/components/content-renderer/content-renderer.component.js +21 -19
  22. package/esm2015/app/modules/content-layouts/components/content-layouts/content-layouts.component.js +22 -18
  23. package/esm2015/app/modules/content-pages/components/content-pages/content-pages.component.js +20 -11
  24. package/esm2015/app/modules/content-pages/fs-content-pages.module.js +1 -1
  25. package/esm2015/app/modules/content-style/components/content-style/content-style.component.js +71 -0
  26. package/esm2015/app/modules/content-style/components/content-style/index.js +2 -0
  27. package/esm2015/app/modules/content-style/fs-content-style.module.js +50 -0
  28. package/esm2015/app/modules/editor/components/editor/editor.component.js +78 -107
  29. package/esm2015/app/modules/editor/fs-content-editor.module.js +19 -7
  30. package/esm2015/public_api.js +5 -3
  31. package/fesm2015/firestitch-content.js +449 -339
  32. package/fesm2015/firestitch-content.js.map +1 -1
  33. package/package.json +6 -5
  34. package/public_api.d.ts +5 -3
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('@angular/forms'), require('@angular/material/button'), require('@angular/material/button-toggle'), require('@angular/material/dialog'), require('@angular/material/form-field'), require('@angular/material/icon'), require('@angular/material/input'), require('@angular/material/select'), require('@angular/material/tabs'), require('@firestitch/date'), require('@firestitch/dialog'), require('@firestitch/form'), require('@firestitch/html-editor'), require('@firestitch/label'), require('@firestitch/list'), require('@firestitch/skeleton'), require('@firestitch/text-editor'), require('rxjs'), require('rxjs/operators'), require('@firestitch/message'), require('@angular/material/core'), require('@firestitch/common'), require('@firestitch/filter'), require('@angular/router'), require('@angular/platform-browser')) :
3
- typeof define === 'function' && define.amd ? define('@firestitch/content', ['exports', '@angular/common', '@angular/core', '@angular/forms', '@angular/material/button', '@angular/material/button-toggle', '@angular/material/dialog', '@angular/material/form-field', '@angular/material/icon', '@angular/material/input', '@angular/material/select', '@angular/material/tabs', '@firestitch/date', '@firestitch/dialog', '@firestitch/form', '@firestitch/html-editor', '@firestitch/label', '@firestitch/list', '@firestitch/skeleton', '@firestitch/text-editor', 'rxjs', 'rxjs/operators', '@firestitch/message', '@angular/material/core', '@firestitch/common', '@firestitch/filter', '@angular/router', '@angular/platform-browser'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.firestitch = global.firestitch || {}, global.firestitch.content = {}), global.ng.common, global.ng.core, global.ng.forms, global.ng.material.button, global.ng.material.buttonToggle, global.ng.material.dialog, global.ng.material.formField, global.ng.material.icon, global.ng.material.input, global.ng.material.select, global.ng.material.tabs, global.i3$1, global.i3, global.i7$1, global.htmlEditor, global.i6$1, global.i2$1, global.i8, global.i7, global.rxjs, global.rxjs.operators, global.i2, global.ng.material.core, global.common, global.filter, global.ng.router, global.ng.platformBrowser));
5
- })(this, (function (exports, i10, i0, i9, i4$1, i9$1, i1, i4, i5$1, i11, i5, tabs, i3$1, i3, i7$1, htmlEditor, i6$1, i2$1, i8, i7, rxjs, operators, i2, i6, common, filter, i2$2, i1$1) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('@angular/forms'), require('@angular/material/button'), require('@angular/material/dialog'), require('@angular/material/form-field'), require('@angular/material/input'), require('@angular/material/tabs'), require('@firestitch/date'), require('@firestitch/dialog'), require('@firestitch/form'), require('@firestitch/html-editor'), require('@firestitch/list'), require('@firestitch/text-editor'), require('@angular/material/button-toggle'), require('@angular/material/icon'), require('@angular/material/select'), require('@firestitch/label'), require('@firestitch/skeleton'), require('@firestitch/common'), require('angular-split'), require('rxjs'), require('rxjs/operators'), require('@firestitch/message'), require('@firestitch/filter'), require('@angular/material/core'), require('@angular/router'), require('@angular/platform-browser'), require('@firestitch/body')) :
3
+ typeof define === 'function' && define.amd ? define('@firestitch/content', ['exports', '@angular/common', '@angular/core', '@angular/forms', '@angular/material/button', '@angular/material/dialog', '@angular/material/form-field', '@angular/material/input', '@angular/material/tabs', '@firestitch/date', '@firestitch/dialog', '@firestitch/form', '@firestitch/html-editor', '@firestitch/list', '@firestitch/text-editor', '@angular/material/button-toggle', '@angular/material/icon', '@angular/material/select', '@firestitch/label', '@firestitch/skeleton', '@firestitch/common', 'angular-split', 'rxjs', 'rxjs/operators', '@firestitch/message', '@firestitch/filter', '@angular/material/core', '@angular/router', '@angular/platform-browser', '@firestitch/body'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.firestitch = global.firestitch || {}, global.firestitch.content = {}), global.ng.common, global.ng.core, global.ng.forms, global.ng.material.button, global.ng.material.dialog, global.ng.material.formField, global.ng.material.input, global.ng.material.tabs, global.i3$1, global.i3, global.i5$1, global.htmlEditor, global.i2$1, global.i8, global.ng.material.buttonToggle, global.ng.material.icon, global.ng.material.select, global.i7, global.i13, global.i12, global.i6, global.rxjs, global.rxjs.operators, global.i2, global.filter, global.ng.material.core, global.ng.router, global.ng.platformBrowser, global.i3$2));
5
+ })(this, (function (exports, i10$1, i0, i7$1, i4, i1, i4$1, i8$1, tabs, i3$1, i3, i5$1, htmlEditor, i2$1, i8, i10, i5, i5$2, i7, i13, i12, i6, rxjs, operators, i2, filter, i6$1, i2$2, i1$1, i3$2) { 'use strict';
6
6
 
7
7
  function _interopNamespace(e) {
8
8
  if (e && e.__esModule) return e;
@@ -22,98 +22,261 @@
22
22
  return Object.freeze(n);
23
23
  }
24
24
 
25
- var i10__namespace = /*#__PURE__*/_interopNamespace(i10);
25
+ var i10__namespace$1 = /*#__PURE__*/_interopNamespace(i10$1);
26
26
  var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
27
- var i9__namespace = /*#__PURE__*/_interopNamespace(i9);
28
- var i4__namespace$1 = /*#__PURE__*/_interopNamespace(i4$1);
29
- var i9__namespace$1 = /*#__PURE__*/_interopNamespace(i9$1);
30
- var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
27
+ var i7__namespace$1 = /*#__PURE__*/_interopNamespace(i7$1);
31
28
  var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
32
- var i5__namespace$1 = /*#__PURE__*/_interopNamespace(i5$1);
33
- var i11__namespace = /*#__PURE__*/_interopNamespace(i11);
34
- var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
29
+ var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
30
+ var i4__namespace$1 = /*#__PURE__*/_interopNamespace(i4$1);
31
+ var i8__namespace$1 = /*#__PURE__*/_interopNamespace(i8$1);
35
32
  var i3__namespace$1 = /*#__PURE__*/_interopNamespace(i3$1);
36
33
  var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
37
- var i7__namespace = /*#__PURE__*/_interopNamespace(i7$1);
38
- var i6__namespace$1 = /*#__PURE__*/_interopNamespace(i6$1);
34
+ var i5__namespace$1 = /*#__PURE__*/_interopNamespace(i5$1);
39
35
  var i2__namespace$1 = /*#__PURE__*/_interopNamespace(i2$1);
40
36
  var i8__namespace = /*#__PURE__*/_interopNamespace(i8);
41
- var i7__namespace$1 = /*#__PURE__*/_interopNamespace(i7);
42
- var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
37
+ var i10__namespace = /*#__PURE__*/_interopNamespace(i10);
38
+ var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
39
+ var i5__namespace$2 = /*#__PURE__*/_interopNamespace(i5$2);
40
+ var i7__namespace = /*#__PURE__*/_interopNamespace(i7);
41
+ var i13__namespace = /*#__PURE__*/_interopNamespace(i13);
42
+ var i12__namespace = /*#__PURE__*/_interopNamespace(i12);
43
43
  var i6__namespace = /*#__PURE__*/_interopNamespace(i6);
44
+ var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
45
+ var i6__namespace$1 = /*#__PURE__*/_interopNamespace(i6$1);
44
46
  var i2__namespace$2 = /*#__PURE__*/_interopNamespace(i2$2);
45
47
  var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
48
+ var i3__namespace$2 = /*#__PURE__*/_interopNamespace(i3$2);
46
49
 
47
- var PageType;
48
- (function (PageType) {
49
- PageType["StandardPage"] = "standardPage";
50
- PageType["BlogPost"] = "blogPost";
51
- PageType["HomePage"] = "homePage";
52
- PageType["NotFoundPage"] = "notFoundPage";
53
- })(PageType || (PageType = {}));
50
+ var EditorComponent = /** @class */ (function () {
51
+ function EditorComponent(_data, _dialogRef, _message, _cdRef) {
52
+ this._data = _data;
53
+ this._dialogRef = _dialogRef;
54
+ this._message = _message;
55
+ this._cdRef = _cdRef;
56
+ this.resizing = false;
57
+ this.editors = {
58
+ html: true,
59
+ scss: true,
60
+ js: false,
61
+ globalScss: false,
62
+ };
63
+ this._destroy$ = new rxjs.Subject();
64
+ }
65
+ EditorComponent.prototype.ngOnInit = function () {
66
+ this._dialogRef.addPanelClass('fs-content-editor-overlay-pane');
67
+ this.title = this._data.title;
68
+ this.contentPage = this._data.contentPage;
69
+ this._config = this._data.contentConfig;
70
+ this._save = this._data.save;
71
+ this.initTextEditors();
72
+ this.initGlobalContentStyle();
73
+ };
74
+ EditorComponent.prototype.editorToggleChange = function (event) {
75
+ this.editors[event.value] = !this.editors[event.value];
76
+ };
77
+ EditorComponent.prototype.ngOnDestroy = function () {
78
+ this._destroy$.next();
79
+ this._destroy$.complete();
80
+ };
81
+ EditorComponent.prototype.globalScssChange = function () {
82
+ var _this = this;
83
+ this._config.saveContentStyle(this.contentStyle)
84
+ .subscribe(function (contentStyle) {
85
+ _this.contentStyle = contentStyle;
86
+ _this._message.success('Saved Changes');
87
+ _this._cdRef.markForCheck();
88
+ });
89
+ };
90
+ EditorComponent.prototype.initTextEditors = function () {
91
+ this.scssConfig = {
92
+ tabSize: 2,
93
+ language: 'scss',
94
+ height: '100%',
95
+ };
96
+ this.jsConfig = {
97
+ tabSize: 2,
98
+ language: 'js',
99
+ height: '100%',
100
+ };
101
+ this.htmlConfig = {
102
+ tabSize: 2,
103
+ language: 'html',
104
+ height: '100%',
105
+ };
106
+ this.globalScssConfig = {
107
+ tabSize: 2,
108
+ language: 'scss',
109
+ height: '100%',
110
+ };
111
+ };
112
+ EditorComponent.prototype.initGlobalContentStyle = function () {
113
+ var _this = this;
114
+ this._config.loadContentStyle()
115
+ .subscribe(function (contentStyle) {
116
+ _this.contentStyle = contentStyle;
117
+ _this._cdRef.markForCheck();
118
+ });
119
+ };
120
+ EditorComponent.prototype.saveContentPage = function () {
121
+ var _this = this;
122
+ this._save({
123
+ id: this.contentPage.id,
124
+ styles: this.contentPage.styles,
125
+ content: this.contentPage.content,
126
+ js: this.contentPage.js,
127
+ })
128
+ .pipe(operators.tap(function (contentPage) {
129
+ _this.contentPage = Object.assign(Object.assign({}, _this.contentPage), contentPage);
130
+ _this._cdRef.markForCheck();
131
+ _this._message.success('Saved Changes');
132
+ }))
133
+ .subscribe();
134
+ };
135
+ EditorComponent.prototype.openSettings = function () {
136
+ var _this = this;
137
+ this._data.openSettings(this.contentPage)
138
+ .pipe(operators.takeUntil(this._destroy$))
139
+ .subscribe(function (contentPage) {
140
+ _this.contentPage = Object.assign(Object.assign({}, _this.contentPage), contentPage);
141
+ _this._cdRef.markForCheck();
142
+ });
143
+ };
144
+ return EditorComponent;
145
+ }());
146
+ EditorComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: EditorComponent, deps: [{ token: i1.MAT_DIALOG_DATA }, { token: i1__namespace.MatDialogRef }, { token: i2__namespace.FsMessage }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
147
+ EditorComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: EditorComponent, selector: "ng-component", ngImport: i0__namespace, template: "<fs-dialog>\n <h1 mat-dialog-title>\n <div class=\"title-container\">\n <div class=\"title\">\n {{title}}\n <div class=\"small\">{{contentPage.name}}</div> \n </div>\n <a\n (click)=\"openSettings()\"\n mat-icon-button>\n <mat-icon>settings</mat-icon>\n </a> \n </div>\n </h1>\n <div mat-dialog-content>\n <div class=\"container\">\n <as-split [unit]=\"'percent'\" [gutterSize]=\"25\"> \n <as-split-area [size]=\"70\" [visible]=\"editors.html\" [order]=\"1\">\n <div class=\"editor-container\">\n <fs-label>HTML</fs-label>\n <fs-text-editor \n [(ngModel)]=\"contentPage.content\" \n name=\"html\"\n [fsModelChangeOptions]=\"{ debounce: 300 }\"\n (fsModelChange)=\"saveContentPage()\"\n [config]=\"htmlConfig\">\n </fs-text-editor> \n </div>\n </as-split-area>\n <as-split-area [size]=\"30\" [visible]=\"editors.scss\" [order]=\"2\">\n <div class=\"editor-container\">\n <fs-label>SCSS</fs-label>\n <fs-text-editor \n [(ngModel)]=\"contentPage.styles\" \n name=\"scss\"\n [fsModelChangeOptions]=\"{ debounce: 300 }\"\n (fsModelChange)=\"saveContentPage()\"\n [config]=\"scssConfig\">\n </fs-text-editor> \n </div>\n </as-split-area>\n <as-split-area [size]=\"30\" [visible]=\"editors.js\" [order]=\"3\">\n <div class=\"editor-container\">\n <fs-label>JS</fs-label>\n <fs-text-editor \n [(ngModel)]=\"contentPage.js\" \n name=\"js\"\n [fsModelChangeOptions]=\"{ debounce: 300 }\"\n (fsModelChange)=\"saveContentPage()\"\n [config]=\"jsConfig\">\n </fs-text-editor> \n </div>\n </as-split-area>\n <as-split-area [size]=\"30\" [visible]=\"editors.globalScss\" [order]=\"4\">\n <div class=\"editor-container\">\n <fs-label>Global SCSS</fs-label>\n <ng-container *fsSkeleton=\"contentStyle\">\n <fs-text-editor \n [(ngModel)]=\"contentStyle.scss\" \n name=\"globalScss\"\n [fsModelChangeOptions]=\"{ debounce: 300 }\"\n (fsModelChange)=\"globalScssChange()\"\n [config]=\"globalScssConfig\">\n </fs-text-editor> \n </ng-container> \n </div>\n </as-split-area>\n </as-split>\n </div>\n </div>\n\n <div mat-dialog-actions>\n <fs-form-dialog-actions\n [save]=\"false\"\n [done]=\"true\">\n </fs-form-dialog-actions>\n <div class=\"toggles\">\n <mat-button-toggle-group multiple>\n <mat-button-toggle value=\"html\" [checked]=\"editors.html\" (change)=\"editorToggleChange($event)\">HTML</mat-button-toggle>\n <mat-button-toggle value=\"scss\" [checked]=\"editors.scss\" (change)=\"editorToggleChange($event)\">SCSS</mat-button-toggle>\n <mat-button-toggle value=\"js\" [checked]=\"editors.js\" (change)=\"editorToggleChange($event)\">JS</mat-button-toggle>\n <mat-button-toggle value=\"globalScss\" [checked]=\"editors.globalScss\" (change)=\"editorToggleChange($event)\">Global SCSS</mat-button-toggle>\n </mat-button-toggle-group> \n </div>\n </div>\n</fs-dialog>\n\n", styles: ["::ng-deep .fs-content-editor-overlay-pane .mat-dialog-container{border-radius:0}:host ::ng-deep .as-split-gutter{background-color:unset!important}fs-dialog{display:flex;height:100%;flex-direction:column}fs-dialog ::ng-deep .mat-dialog-content{max-height:none;flex:1;overflow:hidden}.mat-dialog-actions fs-form-dialog-actions{width:auto}.mat-dialog-actions .toggles{display:flex;justify-content:flex-end;justify-self:baseline;flex:1}.container{height:100%;display:flex;flex-direction:column}.editor-container{height:100%;border-radius:5px;display:flex;flex-direction:column}.editor-container fs-text-editor{flex:1}.title-container{display:flex;align-items:center}.title-container .title{flex:1}.title-container .title .small{line-height:normal}\n"], components: [{ type: i3__namespace.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileActionPlacement", "mobileWidth", "mode"] }, { type: i4__namespace.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab], a[mat-mini-fab], a[mat-stroked-button], a[mat-flat-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }, { type: i5__namespace.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i6__namespace.SplitComponent, selector: "as-split", inputs: ["direction", "unit", "gutterSize", "gutterStep", "restrictMove", "useTransition", "disabled", "dir", "gutterDblClickDuration", "gutterClickDeltaPx", "gutterAriaLabel"], outputs: ["transitionEnd", "dragStart", "dragEnd", "gutterClick", "gutterDblClick"], exportAs: ["asSplit"] }, { type: i7__namespace.FsLabelComponent, selector: "fs-label" }, { type: i8__namespace.FsTextEditorComponent, selector: "fs-text-editor", inputs: ["config", "scrollable"], outputs: ["ready", "blur"] }, { type: i5__namespace$1.FsFormDialogActionsComponent, selector: "fs-form-dialog-actions", inputs: ["save", "create", "close", "done", "closeData", "name"] }, { type: i10__namespace.MatButtonToggle, selector: "mat-button-toggle", inputs: ["disableRipple", "aria-labelledby", "tabIndex", "appearance", "checked", "disabled", "id", "name", "aria-label", "value"], outputs: ["change"], exportAs: ["matButtonToggle"] }], directives: [{ type: i1__namespace.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1__namespace.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i6__namespace.SplitAreaDirective, selector: "as-split-area, [as-split-area]", inputs: ["order", "size", "minSize", "maxSize", "lockSize", "visible"], exportAs: ["asSplitArea"] }, { type: i7__namespace$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i7__namespace$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i5__namespace$1.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { type: i12__namespace.FsModelChangeDirective, selector: "[fsModelChange]", inputs: ["fsModelChangeOptions"], outputs: ["fsModelChange"] }, { type: i13__namespace.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { type: i1__namespace.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i10__namespace.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
148
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: EditorComponent, decorators: [{
149
+ type: i0.Component,
150
+ args: [{
151
+ templateUrl: './editor.component.html',
152
+ styleUrls: ['./editor.component.scss'],
153
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
154
+ }]
155
+ }], ctorParameters: function () {
156
+ return [{ type: undefined, decorators: [{
157
+ type: i0.Inject,
158
+ args: [i1.MAT_DIALOG_DATA]
159
+ }] }, { type: i1__namespace.MatDialogRef }, { type: i2__namespace.FsMessage }, { type: i0__namespace.ChangeDetectorRef }];
160
+ } });
54
161
 
55
- var PageTypes = [
56
- { name: 'Standard Page', value: PageType.StandardPage },
57
- { name: 'Home Page', value: PageType.HomePage },
58
- { name: 'Not Found Page', value: PageType.NotFoundPage },
59
- { name: 'Blog Post', value: PageType.BlogPost },
60
- ];
162
+ var FsContentEditorModule = /** @class */ (function () {
163
+ function FsContentEditorModule() {
164
+ }
165
+ return FsContentEditorModule;
166
+ }());
167
+ FsContentEditorModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsContentEditorModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
168
+ FsContentEditorModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsContentEditorModule, declarations: [EditorComponent], imports: [i10$1.CommonModule,
169
+ i7$1.FormsModule,
170
+ i1.MatDialogModule,
171
+ i4.MatButtonModule,
172
+ tabs.MatTabsModule,
173
+ i5.MatIconModule,
174
+ i10.MatButtonToggleModule,
175
+ i2$1.FsListModule,
176
+ i5$1.FsFormModule,
177
+ i13.FsSkeletonModule,
178
+ i7.FsLabelModule,
179
+ htmlEditor.FsHtmlEditorModule,
180
+ i12.FsCommonModule,
181
+ i3.FsDialogModule,
182
+ i8.FsTextEditorModule,
183
+ i6.AngularSplitModule], exports: [EditorComponent] });
184
+ FsContentEditorModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsContentEditorModule, imports: [[
185
+ i10$1.CommonModule,
186
+ i7$1.FormsModule,
187
+ i1.MatDialogModule,
188
+ i4.MatButtonModule,
189
+ tabs.MatTabsModule,
190
+ i5.MatIconModule,
191
+ i10.MatButtonToggleModule,
192
+ i2$1.FsListModule,
193
+ i5$1.FsFormModule,
194
+ i13.FsSkeletonModule,
195
+ i7.FsLabelModule,
196
+ htmlEditor.FsHtmlEditorModule,
197
+ i12.FsCommonModule,
198
+ i3.FsDialogModule,
199
+ i8.FsTextEditorModule,
200
+ i6.AngularSplitModule,
201
+ ]] });
202
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsContentEditorModule, decorators: [{
203
+ type: i0.NgModule,
204
+ args: [{
205
+ imports: [
206
+ i10$1.CommonModule,
207
+ i7$1.FormsModule,
208
+ i1.MatDialogModule,
209
+ i4.MatButtonModule,
210
+ tabs.MatTabsModule,
211
+ i5.MatIconModule,
212
+ i10.MatButtonToggleModule,
213
+ i2$1.FsListModule,
214
+ i5$1.FsFormModule,
215
+ i13.FsSkeletonModule,
216
+ i7.FsLabelModule,
217
+ htmlEditor.FsHtmlEditorModule,
218
+ i12.FsCommonModule,
219
+ i3.FsDialogModule,
220
+ i8.FsTextEditorModule,
221
+ i6.AngularSplitModule,
222
+ ],
223
+ exports: [
224
+ EditorComponent,
225
+ ],
226
+ declarations: [
227
+ EditorComponent,
228
+ ],
229
+ }]
230
+ }] });
61
231
 
62
232
  var FS_CONTENT_CONFIG = new i0.InjectionToken('fs-content-config');
63
233
 
64
- var ContentPageComponent = /** @class */ (function () {
65
- function ContentPageComponent(_config, _data, _dialogRef, _message, _cdRef) {
234
+ var ContentLayoutComponent = /** @class */ (function () {
235
+ function ContentLayoutComponent(_config, _data, _dialogRef, _message, _cdRef) {
66
236
  var _this = this;
67
237
  this._config = _config;
68
238
  this._data = _data;
69
239
  this._dialogRef = _dialogRef;
70
240
  this._message = _message;
71
241
  this._cdRef = _cdRef;
72
- this.contentPage = null;
73
- this.PageTypes = PageTypes;
242
+ this.contentLayout = null;
74
243
  this.editors = { content: true, styles: true };
75
244
  this._destroy$ = new rxjs.Subject();
76
245
  this.save = function () {
77
- return _this._config.saveContentPage(_this.contentPage)
78
- .pipe(operators.tap(function (contentPage) {
246
+ return _this._config.saveContentLayout(_this.contentLayout)
247
+ .pipe(operators.tap(function (contentLayout) {
79
248
  _this._message.success('Saved Changes');
80
- _this._dialogRef.close(contentPage);
249
+ _this._dialogRef.close(contentLayout);
81
250
  }));
82
251
  };
83
252
  }
84
- ContentPageComponent.prototype.ngOnInit = function () {
85
- this._dialogRef.updateSize('600px');
253
+ ContentLayoutComponent.prototype.ngOnInit = function () {
86
254
  this._fetchData();
87
255
  };
88
- ContentPageComponent.prototype.ngOnDestroy = function () {
256
+ ContentLayoutComponent.prototype.ngOnDestroy = function () {
89
257
  this._destroy$.next();
90
258
  this._destroy$.complete();
91
259
  };
92
- ContentPageComponent.prototype._fetchData = function () {
260
+ ContentLayoutComponent.prototype._fetchData = function () {
93
261
  var _this = this;
94
- this._config.loadContentLayouts()
95
- .subscribe(function (contentLayouts) {
96
- _this.contentLayouts = contentLayouts;
97
- _this._cdRef.markForCheck();
98
- });
99
- rxjs.of(this._data.contentPage)
100
- .pipe(operators.switchMap(function (contentPage) {
101
- return rxjs.of(contentPage);
262
+ rxjs.of(this._data.contentLayout)
263
+ .pipe(operators.switchMap(function (contentLayout) {
264
+ return rxjs.of(contentLayout);
102
265
  }), operators.takeUntil(this._destroy$))
103
- .subscribe(function (contentPage) {
104
- _this.contentPage = Object.assign({}, contentPage);
266
+ .subscribe(function (contentLayout) {
267
+ _this.contentLayout = Object.assign({}, contentLayout);
105
268
  _this._cdRef.markForCheck();
106
269
  });
107
270
  };
108
- return ContentPageComponent;
271
+ return ContentLayoutComponent;
109
272
  }());
110
- ContentPageComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ContentPageComponent, deps: [{ token: FS_CONTENT_CONFIG }, { token: i1.MAT_DIALOG_DATA }, { token: i1__namespace.MatDialogRef }, { token: i2__namespace.FsMessage }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
111
- ContentPageComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ContentPageComponent, selector: "ng-component", viewQueries: [{ propertyName: "textEditors", predicate: i7.FsTextEditorComponent, descendants: true }], ngImport: i0__namespace, template: "<form fsForm [submit]=\"save\" *fsSkeletonForm=\"contentPage\">\n <fs-dialog>\n <h1 mat-dialog-title>{{contentPage.id ? 'Page' : 'Create Page'}}</h1>\n <div mat-dialog-content>\n <div class=\"fs-column\">\n <mat-form-field>\n <mat-select\n [(ngModel)]=\"contentPage.type\"\n name=\"type\"\n required\n placeholder=\"Type\">\n <mat-option\n *ngFor=\"let item of PageTypes\"\n [value]=\"item.value\">\n {{ item.name }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n <mat-form-field *ngIf=\"contentLayouts\">\n <mat-select\n [(ngModel)]=\"contentPage.contentLayoutId\"\n required\n name=\"contentLayoutId\"\n placeholder=\"Layout\">\n <mat-option\n *ngFor=\"let item of contentLayouts\"\n [value]=\"item.id\">\n {{ item.name }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n <mat-form-field>\n <input\n matInput\n [(ngModel)]=\"contentPage.name\"\n name=\"name\"\n required\n placeholder=\"Name\">\n </mat-form-field>\n <mat-form-field>\n <input\n matInput\n [(ngModel)]=\"contentPage.path\"\n name=\"path\"\n required\n placeholder=\"Path\">\n </mat-form-field>\n <mat-form-field>\n <input\n matInput\n [(ngModel)]=\"contentPage.title\"\n name=\"title\"\n placeholder=\"Title\">\n </mat-form-field>\n </div>\n </div>\n\n <div mat-dialog-actions>\n <fs-form-dialog-actions>\n </fs-form-dialog-actions>\n </div>\n </fs-dialog>\n</form>\n", styles: [""], components: [{ type: i3__namespace.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileActionPlacement", "mobileWidth", "mode"] }, { type: i4__namespace.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i5__namespace.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i6__namespace.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i7__namespace.FsFormDialogActionsComponent, selector: "fs-form-dialog-actions", inputs: ["save", "create", "close", "done", "closeData", "name"] }], directives: [{ type: i8__namespace.FsSkeletonFormDirective, selector: "[fsSkeletonForm]", inputs: ["fsSkeletonForm", "fsSkeletonFormLines"] }, { type: i9__namespace.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i9__namespace.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i9__namespace.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i7__namespace.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup", "deactivationGuard"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"], exportAs: ["fsForm"] }, { type: i1__namespace.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1__namespace.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i9__namespace.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i9__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i9__namespace.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i7__namespace.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }, { type: i10__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i11__namespace.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i9__namespace.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i7__namespace.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { type: i1__namespace.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
112
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ContentPageComponent, decorators: [{
273
+ ContentLayoutComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ContentLayoutComponent, deps: [{ token: FS_CONTENT_CONFIG }, { token: i1.MAT_DIALOG_DATA }, { token: i1__namespace.MatDialogRef }, { token: i2__namespace.FsMessage }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
274
+ ContentLayoutComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ContentLayoutComponent, selector: "ng-component", viewQueries: [{ propertyName: "textEditors", predicate: i8.FsTextEditorComponent, descendants: true }], ngImport: i0__namespace, template: "<form fsForm [submit]=\"save\" *fsSkeletonForm=\"contentLayout\">\n <fs-dialog>\n <h1 mat-dialog-title>{{contentLayout.id ? 'Layout' : 'Layout Page'}}</h1>\n <div mat-dialog-content>\n <div class=\"fs-column\">\n <mat-form-field>\n <input\n matInput\n [(ngModel)]=\"contentLayout.name\"\n name=\"name\"\n required\n placeholder=\"Name\">\n </mat-form-field>\n <mat-form-field>\n <input\n matInput\n [(ngModel)]=\"contentLayout.tag\"\n name=\"tag\"\n placeholder=\"Tag\">\n </mat-form-field>\n </div>\n </div>\n\n <div mat-dialog-actions>\n <fs-form-dialog-actions>\n </fs-form-dialog-actions>\n </div>\n </fs-dialog>\n</form>\n", styles: [""], components: [{ type: i3__namespace.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileActionPlacement", "mobileWidth", "mode"] }, { type: i4__namespace$1.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i5__namespace$1.FsFormDialogActionsComponent, selector: "fs-form-dialog-actions", inputs: ["save", "create", "close", "done", "closeData", "name"] }], directives: [{ type: i13__namespace.FsSkeletonFormDirective, selector: "[fsSkeletonForm]", inputs: ["fsSkeletonForm", "fsSkeletonFormLines"] }, { type: i7__namespace$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i7__namespace$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i7__namespace$1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5__namespace$1.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup", "deactivationGuard"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"], exportAs: ["fsForm"] }, { type: i1__namespace.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1__namespace.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i8__namespace$1.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: i7__namespace$1.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: i7__namespace$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i7__namespace$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i7__namespace$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i5__namespace$1.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }, { type: i5__namespace$1.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { type: i1__namespace.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
275
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ContentLayoutComponent, decorators: [{
113
276
  type: i0.Component,
114
277
  args: [{
115
- templateUrl: './content-page.component.html',
116
- styleUrls: ['./content-page.component.scss'],
278
+ templateUrl: './content-layout.component.html',
279
+ styleUrls: ['./content-layout.component.scss'],
117
280
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
118
281
  }]
119
282
  }], ctorParameters: function () {
@@ -126,216 +289,298 @@
126
289
  }] }, { type: i1__namespace.MatDialogRef }, { type: i2__namespace.FsMessage }, { type: i0__namespace.ChangeDetectorRef }];
127
290
  }, propDecorators: { textEditors: [{
128
291
  type: i0.ViewChildren,
129
- args: [i7.FsTextEditorComponent]
292
+ args: [i8.FsTextEditorComponent]
130
293
  }] } });
131
294
 
132
- var EditorComponent = /** @class */ (function () {
133
- function EditorComponent(_data, _dialogRef, _dialog, _message, _cdRef) {
134
- var _this = this;
135
- this._data = _data;
136
- this._dialogRef = _dialogRef;
295
+ var FsContentLayoutsComponent = /** @class */ (function () {
296
+ function FsContentLayoutsComponent(_config, _dialog) {
297
+ this._config = _config;
137
298
  this._dialog = _dialog;
138
- this._message = _message;
139
- this._cdRef = _cdRef;
140
- this.resizing = false;
141
- this.editors = { content: true, styles: true };
142
299
  this._destroy$ = new rxjs.Subject();
143
- this.save = function () {
144
- return _this._config.saveContentPage({
145
- id: _this.contentPage.id,
146
- styles: _this.contentPage.styles,
147
- content: _this.contentPage.content,
148
- })
149
- .pipe(operators.tap(function (contentPage) {
150
- _this.contentPage = Object.assign(Object.assign({}, _this.contentPage), contentPage);
151
- _this._cdRef.markForCheck();
152
- _this._message.success('Saved Changes');
153
- }));
154
- };
155
300
  }
156
- EditorComponent.prototype.ngOnInit = function () {
157
- this.contentPage = this._data.contentPage;
158
- this._config = this._data.config;
159
- this._initSeparator();
160
- };
161
- EditorComponent.prototype.editorToggleChange = function (event) {
162
- this.editors[event.value] = !this.editors[event.value];
163
- this.updateEditorLayouts();
164
- };
165
- EditorComponent.prototype.updateEditorLayouts = function () {
166
- var _this = this;
167
- setTimeout(function () {
168
- if (_this.editors.content) {
169
- _this.contentEditor.updateLayout();
170
- }
171
- if (_this.editors.styles) {
172
- _this.styleEditor.updateLayout();
173
- }
174
- });
175
- };
176
- EditorComponent.prototype.ngOnDestroy = function () {
177
- this._destroy$.next();
178
- this._destroy$.complete();
179
- };
180
- EditorComponent.prototype.stylesChanged = function () {
181
- this.form.triggerSubmit();
182
- };
183
- EditorComponent.prototype.contentChanged = function () {
184
- this.form.triggerSubmit();
301
+ FsContentLayoutsComponent.prototype.ngOnInit = function () {
302
+ this._initListConfig();
185
303
  };
186
- EditorComponent.prototype.openSettings = function () {
304
+ FsContentLayoutsComponent.prototype.openEditor = function (contentLayout) {
187
305
  var _this = this;
188
- this._dialog.open(ContentPageComponent, {
306
+ this._dialog.open(EditorComponent, {
307
+ maxWidth: '100vw',
308
+ width: '100%',
309
+ height: '100%',
189
310
  data: {
190
- contentPage: this.contentPage,
311
+ contentPage: contentLayout,
312
+ title: 'Layout',
313
+ contentConfig: this._config,
314
+ save: function (data) {
315
+ return _this._config.saveContentLayout(Object.assign({ id: contentLayout.id }, data));
316
+ },
317
+ openSettings: function (data) {
318
+ return _this.openLayout(data);
319
+ },
191
320
  },
192
321
  })
193
322
  .afterClosed()
194
323
  .pipe(operators.takeUntil(this._destroy$))
195
- .subscribe(function (contentPage) {
196
- _this.contentPage = Object.assign(Object.assign({}, _this.contentPage), contentPage);
197
- _this._cdRef.markForCheck();
324
+ .subscribe(function () {
325
+ _this.listComponent.reload();
198
326
  });
199
327
  };
200
- EditorComponent.prototype._initSeparator = function () {
201
- var _this = this;
202
- rxjs.fromEvent(this.separator.nativeElement, 'mousedown')
203
- .pipe(operators.takeUntil(this._destroy$))
204
- .subscribe(function (e) {
205
- _this._moveSeparator(e);
206
- });
328
+ FsContentLayoutsComponent.prototype.openLayout = function (contentLayout) {
329
+ return this._dialog.open(ContentLayoutComponent, {
330
+ data: {
331
+ contentLayout: contentLayout,
332
+ },
333
+ })
334
+ .afterClosed()
335
+ .pipe(operators.filter(function (_contentLayout) { return !!_contentLayout; }), operators.takeUntil(this._destroy$));
207
336
  };
208
- EditorComponent.prototype._moveSeparator = function (separatorEvent) {
337
+ FsContentLayoutsComponent.prototype.ngOnDestroy = function () {
338
+ this._destroy$.next();
339
+ this._destroy$.complete();
340
+ };
341
+ FsContentLayoutsComponent.prototype._initListConfig = function () {
209
342
  var _this = this;
210
- var mouseDown = {
211
- clientX: separatorEvent.clientX,
212
- clientY: separatorEvent.clientY,
213
- offsetLeft: Number(this.separator.nativeElement.offsetLeft),
214
- offsetTop: Number(this.separator.nativeElement.offsetTop),
215
- firstWidth: Number(this.contentContainer.nativeElement.offsetWidth),
216
- secondWidth: Number(this.styleContainer.nativeElement.offsetWidth),
343
+ this.listConfig = {
344
+ paging: false,
345
+ filters: [
346
+ {
347
+ name: 'keyword',
348
+ type: filter.ItemType.Keyword,
349
+ label: 'Search',
350
+ },
351
+ ],
352
+ actions: [
353
+ {
354
+ label: 'Create',
355
+ click: function () {
356
+ _this.openLayout({})
357
+ .subscribe(function () {
358
+ _this.listComponent.reload();
359
+ });
360
+ },
361
+ },
362
+ ],
363
+ rowActions: [
364
+ {
365
+ click: function (data) {
366
+ return _this._config.deleteContentLayout(data);
367
+ },
368
+ remove: {
369
+ title: 'Confirm',
370
+ template: 'Are you sure you would like to delete this record?',
371
+ },
372
+ menu: true,
373
+ label: 'Delete',
374
+ },
375
+ ],
376
+ fetch: function (query) {
377
+ return _this._config.loadContentLayouts(query)
378
+ .pipe(operators.map(function (contentLayouts) {
379
+ return { data: contentLayouts };
380
+ }));
381
+ },
382
+ restore: {
383
+ query: { state: 'deleted' },
384
+ filterLabel: 'Show Deleted',
385
+ menuLabel: 'Restore',
386
+ reload: true,
387
+ click: function (row) {
388
+ return _this._config.saveContentLayout({ id: row.id, state: 'active' });
389
+ },
390
+ },
217
391
  };
218
- this.resizing = true;
219
- this._cdRef.markForCheck();
220
- rxjs.fromEvent(document, 'mousemove')
221
- .pipe(operators.finalize(function () {
222
- mouseDown = null;
223
- _this.resizing = false;
224
- _this._cdRef.markForCheck();
225
- _this.updateEditorLayouts();
226
- }), operators.takeUntil(rxjs.fromEvent(this.separator.nativeElement, 'mouseup')
227
- .pipe(operators.take(1), operators.takeUntil(this._destroy$))), operators.takeUntil(this._destroy$))
228
- .subscribe(function (e) {
229
- var delta = { x: e.clientX - mouseDown.clientX,
230
- y: e.clientY - mouseDown.clientY };
231
- delta.x = Math.min(Math.max(delta.x, -mouseDown.firstWidth), mouseDown.secondWidth);
232
- _this.separator.nativeElement.style.left = mouseDown.offsetLeft + delta.x + "px";
233
- _this.contentContainer.nativeElement.style.width = mouseDown.firstWidth + delta.x + "px";
234
- _this.styleContainer.nativeElement.style.width = mouseDown.secondWidth - delta.x + "px";
235
- });
236
392
  };
237
- return EditorComponent;
393
+ return FsContentLayoutsComponent;
238
394
  }());
239
- EditorComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: EditorComponent, deps: [{ token: i1.MAT_DIALOG_DATA }, { token: i1__namespace.MatDialogRef }, { token: i1__namespace.MatDialog }, { token: i2__namespace.FsMessage }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
240
- EditorComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: EditorComponent, selector: "ng-component", viewQueries: [{ propertyName: "form", first: true, predicate: i7$1.FsFormDirective, descendants: true }, { propertyName: "styleEditor", first: true, predicate: ["styleEditor"], descendants: true }, { propertyName: "contentEditor", first: true, predicate: ["contentEditor"], descendants: true }, { propertyName: "separator", first: true, predicate: ["separator"], descendants: true, read: i0.ElementRef, static: true }, { propertyName: "contentContainer", first: true, predicate: ["contentContainer"], descendants: true, read: i0.ElementRef, static: true }, { propertyName: "styleContainer", first: true, predicate: ["styleContainer"], descendants: true, read: i0.ElementRef, static: true }], ngImport: i0__namespace, template: "<form fsForm [submit]=\"save\">\n <fs-dialog>\n <h1 mat-dialog-title>\n <div class=\"title-container\">\n <div class=\"title\">\n Page\n <div class=\"small\">{{contentPage.name}}</div> \n </div>\n <a\n (click)=\"openSettings()\"\n mat-icon-button>\n <mat-icon>settings</mat-icon>\n </a> \n </div>\n </h1>\n <div mat-dialog-content>\n <div class=\"container\">\n <div class=\"editors\" [ngClass]=\"{ resizing: resizing, 'separator-enabled': editors.styles && editors.content }\">\n <div #contentContainer class=\"editor editor-content\" [ngClass]=\"{ 'content-enabled': editors.content }\">\n <fs-label>Content</fs-label>\n <div class=\"editor-container\">\n <fs-text-editor \n #contentEditor\n [(ngModel)]=\"contentPage.content\" \n (blur)=\"contentChanged()\"\n name=\"content\"\n [config]=\"{ tabSize: 2, language: 'html' }\">\n </fs-text-editor> \n </div>\n </div>\n <div \n #separator\n class=\"separator\">\n <mat-icon>drag_indicator</mat-icon>\n </div>\n <div \n #styleContainer \n class=\"editor editor-styles\" \n [ngClass]=\"{ 'styles-enabled': editors.styles }\"\n [style.width]=\"'600px'\">\n <fs-label>Styles</fs-label>\n <div class=\"editor-container\">\n <fs-text-editor \n #styleEditor\n [(ngModel)]=\"contentPage.styles\" \n (blur)=\"stylesChanged()\"\n name=\"styles\"\n [config]=\"{ tabSize: 2, language: 'scss' }\">\n </fs-text-editor> \n </div>\n </div> \n </div>\n </div>\n </div>\n\n <div mat-dialog-actions>\n <fs-form-dialog-actions\n [save]=\"false\"\n [done]=\"true\">\n </fs-form-dialog-actions>\n <div class=\"toggles\">\n <mat-button-toggle-group multiple>\n <mat-button-toggle value=\"content\" [checked]=\"editors.content\" (change)=\"editorToggleChange($event)\">Content</mat-button-toggle>\n <mat-button-toggle value=\"styles\" [checked]=\"editors.styles\" (change)=\"editorToggleChange($event)\">Styles</mat-button-toggle>\n </mat-button-toggle-group> \n </div>\n </div>\n </fs-dialog>\n</form>\n\n", styles: ["form{display:block;height:100%}form fs-dialog{display:flex;flex-direction:column;height:100%}form ::ng-deep .mat-dialog-content{max-height:none;flex:1}.mat-dialog-actions fs-form-dialog-actions{width:auto}.mat-dialog-actions .toggles{display:flex;justify-content:flex-end;justify-self:baseline;flex:1}.container{height:100%;display:flex;flex-direction:column}.editors{width:5000px;max-width:100%;height:100%;display:flex;min-height:0}.editors:not(.separator-enabled) .separator{display:none}.editors:not(.separator-enabled) .editor{width:100%!important}.editors .separator{display:flex;align-items:center;justify-content:center;cursor:col-resize;background-color:#fff;width:40px;height:100%;-webkit-user-select:none;user-select:none;flex-shrink:0}.editors .editor{height:100%;display:flex;min-width:0;width:100%;flex-direction:column}.editors .editor.editor-styles:not(.styles-enabled),.editors .editor.editor-content:not(.content-enabled){display:none}.editors .editor .editor-container{height:100%;overflow:hidden;background:#1E1E1E;border-radius:5px}.editors .editor .editor-container fs-text-editor{display:block}.editors .editor+.editor{margin-left:20px}.editors .editor fs-label{background-color:#fff;padding-bottom:5px}.title-container{display:flex;align-items:center}.title-container .title{flex:1}.title-container .title .small{line-height:normal}\n"], components: [{ type: i3__namespace.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileActionPlacement", "mobileWidth", "mode"] }, { type: i4__namespace$1.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab], a[mat-mini-fab], a[mat-stroked-button], a[mat-flat-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }, { type: i5__namespace$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i6__namespace$1.FsLabelComponent, selector: "fs-label" }, { type: i7__namespace$1.FsTextEditorComponent, selector: "fs-text-editor", inputs: ["config", "scrollable"], outputs: ["init", "blur"] }, { type: i7__namespace.FsFormDialogActionsComponent, selector: "fs-form-dialog-actions", inputs: ["save", "create", "close", "done", "closeData", "name"] }, { type: i9__namespace$1.MatButtonToggle, selector: "mat-button-toggle", inputs: ["disableRipple", "aria-labelledby", "tabIndex", "appearance", "checked", "disabled", "id", "name", "aria-label", "value"], outputs: ["change"], exportAs: ["matButtonToggle"] }], directives: [{ type: i9__namespace.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i9__namespace.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i9__namespace.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i7__namespace.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup", "deactivationGuard"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"], exportAs: ["fsForm"] }, { type: i1__namespace.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1__namespace.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i10__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i9__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i9__namespace.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i7__namespace.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { type: i1__namespace.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i9__namespace$1.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
241
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: EditorComponent, decorators: [{
395
+ FsContentLayoutsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsContentLayoutsComponent, deps: [{ token: FS_CONTENT_CONFIG }, { token: i1__namespace.MatDialog }], target: i0__namespace.ɵɵFactoryTarget.Component });
396
+ FsContentLayoutsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsContentLayoutsComponent, selector: "fs-content-layouts", viewQueries: [{ propertyName: "listComponent", first: true, predicate: i2$1.FsListComponent, descendants: true }], ngImport: i0__namespace, template: "<fs-list [config]=\"listConfig\">\n <fs-list-column name=\"name\" title=\"Name\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n <a (click)=\"openEditor(row)\">{{row.name}}</a>\n </ng-template>\n </fs-list-column>\n <fs-list-column name=\"modify_date\" title=\"Modified\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.modifyDate | fsDate: 'date-time-yearless'}}\n </ng-template>\n </fs-list-column>\n</fs-list>\n", styles: [""], components: [{ type: i2__namespace$1.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }], directives: [{ type: i2__namespace$1.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i2__namespace$1.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }], pipes: { "fsDate": i3__namespace$1.FsDatePipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
397
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsContentLayoutsComponent, decorators: [{
242
398
  type: i0.Component,
243
399
  args: [{
244
- templateUrl: './editor.component.html',
245
- styleUrls: ['./editor.component.scss'],
400
+ selector: 'fs-content-layouts',
401
+ templateUrl: './content-layouts.component.html',
402
+ styleUrls: ['./content-layouts.component.scss'],
246
403
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
247
404
  }]
248
405
  }], ctorParameters: function () {
249
406
  return [{ type: undefined, decorators: [{
250
407
  type: i0.Inject,
251
- args: [i1.MAT_DIALOG_DATA]
252
- }] }, { type: i1__namespace.MatDialogRef }, { type: i1__namespace.MatDialog }, { type: i2__namespace.FsMessage }, { type: i0__namespace.ChangeDetectorRef }];
253
- }, propDecorators: { form: [{
254
- type: i0.ViewChild,
255
- args: [i7$1.FsFormDirective]
256
- }], styleEditor: [{
257
- type: i0.ViewChild,
258
- args: ['styleEditor']
259
- }], contentEditor: [{
260
- type: i0.ViewChild,
261
- args: ['contentEditor']
262
- }], separator: [{
263
- type: i0.ViewChild,
264
- args: ['separator', { static: true, read: i0.ElementRef }]
265
- }], contentContainer: [{
266
- type: i0.ViewChild,
267
- args: ['contentContainer', { static: true, read: i0.ElementRef }]
268
- }], styleContainer: [{
408
+ args: [FS_CONTENT_CONFIG]
409
+ }] }, { type: i1__namespace.MatDialog }];
410
+ }, propDecorators: { listComponent: [{
269
411
  type: i0.ViewChild,
270
- args: ['styleContainer', { static: true, read: i0.ElementRef }]
412
+ args: [i2$1.FsListComponent]
271
413
  }] } });
272
414
 
273
- var FsContentEditorModule = /** @class */ (function () {
274
- function FsContentEditorModule() {
415
+ var FsContentLayoutsModule = /** @class */ (function () {
416
+ function FsContentLayoutsModule() {
275
417
  }
276
- return FsContentEditorModule;
418
+ return FsContentLayoutsModule;
277
419
  }());
278
- FsContentEditorModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsContentEditorModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
279
- FsContentEditorModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsContentEditorModule, declarations: [EditorComponent], imports: [i10.CommonModule,
280
- i9.FormsModule,
420
+ FsContentLayoutsModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsContentLayoutsModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
421
+ FsContentLayoutsModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsContentLayoutsModule, declarations: [ContentLayoutComponent,
422
+ FsContentLayoutsComponent], imports: [i10$1.CommonModule,
423
+ i7$1.FormsModule,
281
424
  i1.MatDialogModule,
282
- i4$1.MatButtonModule,
425
+ i8$1.MatInputModule,
426
+ i4$1.MatFormFieldModule,
427
+ i4.MatButtonModule,
283
428
  tabs.MatTabsModule,
284
- i5$1.MatIconModule,
285
- i9$1.MatButtonToggleModule,
429
+ i5.MatIconModule,
430
+ i5$2.MatSelectModule,
431
+ i10.MatButtonToggleModule,
286
432
  i2$1.FsListModule,
287
- i7$1.FsFormModule,
288
- i6$1.FsLabelModule,
433
+ i3$1.FsDateModule,
434
+ i5$1.FsFormModule,
435
+ i7.FsLabelModule,
436
+ i13.FsSkeletonModule,
289
437
  htmlEditor.FsHtmlEditorModule,
290
438
  i3.FsDialogModule,
291
- i7.FsTextEditorModule], exports: [EditorComponent] });
292
- FsContentEditorModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsContentEditorModule, imports: [[
293
- i10.CommonModule,
294
- i9.FormsModule,
439
+ i8.FsTextEditorModule,
440
+ FsContentEditorModule], exports: [FsContentLayoutsComponent] });
441
+ FsContentLayoutsModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsContentLayoutsModule, imports: [[
442
+ i10$1.CommonModule,
443
+ i7$1.FormsModule,
295
444
  i1.MatDialogModule,
296
- i4$1.MatButtonModule,
445
+ i8$1.MatInputModule,
446
+ i4$1.MatFormFieldModule,
447
+ i4.MatButtonModule,
297
448
  tabs.MatTabsModule,
298
- i5$1.MatIconModule,
299
- i9$1.MatButtonToggleModule,
449
+ i5.MatIconModule,
450
+ i5$2.MatSelectModule,
451
+ i10.MatButtonToggleModule,
300
452
  i2$1.FsListModule,
301
- i7$1.FsFormModule,
302
- i6$1.FsLabelModule,
453
+ i3$1.FsDateModule,
454
+ i5$1.FsFormModule,
455
+ i7.FsLabelModule,
456
+ i13.FsSkeletonModule,
303
457
  htmlEditor.FsHtmlEditorModule,
304
458
  i3.FsDialogModule,
305
- i7.FsTextEditorModule,
459
+ i8.FsTextEditorModule,
460
+ FsContentEditorModule,
306
461
  ]] });
307
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsContentEditorModule, decorators: [{
462
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsContentLayoutsModule, decorators: [{
308
463
  type: i0.NgModule,
309
464
  args: [{
310
- imports: [
311
- i10.CommonModule,
312
- i9.FormsModule,
313
- i1.MatDialogModule,
314
- i4$1.MatButtonModule,
315
- tabs.MatTabsModule,
316
- i5$1.MatIconModule,
317
- i9$1.MatButtonToggleModule,
318
- i2$1.FsListModule,
319
- i7$1.FsFormModule,
320
- i6$1.FsLabelModule,
321
- htmlEditor.FsHtmlEditorModule,
322
- i3.FsDialogModule,
323
- i7.FsTextEditorModule,
324
- ],
325
- exports: [
326
- EditorComponent,
327
- ],
328
- declarations: [
329
- EditorComponent,
330
- ],
465
+ imports: [
466
+ i10$1.CommonModule,
467
+ i7$1.FormsModule,
468
+ i1.MatDialogModule,
469
+ i8$1.MatInputModule,
470
+ i4$1.MatFormFieldModule,
471
+ i4.MatButtonModule,
472
+ tabs.MatTabsModule,
473
+ i5.MatIconModule,
474
+ i5$2.MatSelectModule,
475
+ i10.MatButtonToggleModule,
476
+ i2$1.FsListModule,
477
+ i3$1.FsDateModule,
478
+ i5$1.FsFormModule,
479
+ i7.FsLabelModule,
480
+ i13.FsSkeletonModule,
481
+ htmlEditor.FsHtmlEditorModule,
482
+ i3.FsDialogModule,
483
+ i8.FsTextEditorModule,
484
+ FsContentEditorModule,
485
+ ],
486
+ exports: [
487
+ FsContentLayoutsComponent,
488
+ ],
489
+ declarations: [
490
+ ContentLayoutComponent,
491
+ FsContentLayoutsComponent,
492
+ ],
493
+ }]
494
+ }] });
495
+
496
+ var PageType;
497
+ (function (PageType) {
498
+ PageType["StandardPage"] = "standardPage";
499
+ PageType["BlogPost"] = "blogPost";
500
+ PageType["HomePage"] = "homePage";
501
+ PageType["NotFoundPage"] = "notFoundPage";
502
+ })(PageType || (PageType = {}));
503
+
504
+ var PageTypes = [
505
+ { name: 'Standard Page', value: PageType.StandardPage },
506
+ { name: 'Home Page', value: PageType.HomePage },
507
+ { name: 'Not Found Page', value: PageType.NotFoundPage },
508
+ { name: 'Blog Post', value: PageType.BlogPost },
509
+ ];
510
+
511
+ var ContentPageComponent = /** @class */ (function () {
512
+ function ContentPageComponent(_config, _data, _dialogRef, _message, _cdRef) {
513
+ var _this = this;
514
+ this._config = _config;
515
+ this._data = _data;
516
+ this._dialogRef = _dialogRef;
517
+ this._message = _message;
518
+ this._cdRef = _cdRef;
519
+ this.contentPage = null;
520
+ this.PageTypes = PageTypes;
521
+ this.editors = { content: true, styles: true };
522
+ this._destroy$ = new rxjs.Subject();
523
+ this.save = function () {
524
+ return _this._config.saveContentPage(_this.contentPage)
525
+ .pipe(operators.tap(function (contentPage) {
526
+ _this._message.success('Saved Changes');
527
+ _this._dialogRef.close(contentPage);
528
+ }));
529
+ };
530
+ }
531
+ ContentPageComponent.prototype.ngOnInit = function () {
532
+ this._dialogRef.updateSize('600px');
533
+ this._fetchData();
534
+ };
535
+ ContentPageComponent.prototype.ngOnDestroy = function () {
536
+ this._destroy$.next();
537
+ this._destroy$.complete();
538
+ };
539
+ ContentPageComponent.prototype._fetchData = function () {
540
+ var _this = this;
541
+ this._config.loadContentLayouts()
542
+ .subscribe(function (contentLayouts) {
543
+ _this.contentLayouts = contentLayouts;
544
+ _this._cdRef.markForCheck();
545
+ });
546
+ rxjs.of(this._data.contentPage)
547
+ .pipe(operators.switchMap(function (contentPage) {
548
+ return rxjs.of(contentPage);
549
+ }), operators.takeUntil(this._destroy$))
550
+ .subscribe(function (contentPage) {
551
+ _this.contentPage = Object.assign({}, contentPage);
552
+ _this._cdRef.markForCheck();
553
+ });
554
+ };
555
+ return ContentPageComponent;
556
+ }());
557
+ ContentPageComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ContentPageComponent, deps: [{ token: FS_CONTENT_CONFIG }, { token: i1.MAT_DIALOG_DATA }, { token: i1__namespace.MatDialogRef }, { token: i2__namespace.FsMessage }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
558
+ ContentPageComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ContentPageComponent, selector: "ng-component", viewQueries: [{ propertyName: "textEditors", predicate: i8.FsTextEditorComponent, descendants: true }], ngImport: i0__namespace, template: "<form fsForm [submit]=\"save\" *fsSkeletonForm=\"contentPage\">\n <fs-dialog>\n <h1 mat-dialog-title>{{contentPage.id ? 'Page' : 'Create Page'}}</h1>\n <div mat-dialog-content>\n <div class=\"fs-column\">\n <mat-form-field>\n <mat-select\n [(ngModel)]=\"contentPage.type\"\n name=\"type\"\n required\n placeholder=\"Type\">\n <mat-option\n *ngFor=\"let item of PageTypes\"\n [value]=\"item.value\">\n {{ item.name }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n <mat-form-field *ngIf=\"contentLayouts\">\n <mat-select\n [(ngModel)]=\"contentPage.contentLayoutId\"\n required\n name=\"contentLayoutId\"\n placeholder=\"Layout\">\n <mat-option\n *ngFor=\"let item of contentLayouts\"\n [value]=\"item.id\">\n {{ item.name }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n <mat-form-field>\n <input\n matInput\n [(ngModel)]=\"contentPage.name\"\n name=\"name\"\n required\n placeholder=\"Name\">\n </mat-form-field>\n <mat-form-field>\n <input\n matInput\n [(ngModel)]=\"contentPage.path\"\n name=\"path\"\n required\n placeholder=\"Path\">\n </mat-form-field>\n <mat-form-field>\n <input\n matInput\n [(ngModel)]=\"contentPage.title\"\n name=\"title\"\n placeholder=\"Title\">\n </mat-form-field>\n </div>\n </div>\n\n <div mat-dialog-actions>\n <fs-form-dialog-actions>\n </fs-form-dialog-actions>\n </div>\n </fs-dialog>\n</form>\n", styles: [""], components: [{ type: i3__namespace.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileActionPlacement", "mobileWidth", "mode"] }, { type: i4__namespace$1.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i5__namespace$2.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i6__namespace$1.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i5__namespace$1.FsFormDialogActionsComponent, selector: "fs-form-dialog-actions", inputs: ["save", "create", "close", "done", "closeData", "name"] }], directives: [{ type: i13__namespace.FsSkeletonFormDirective, selector: "[fsSkeletonForm]", inputs: ["fsSkeletonForm", "fsSkeletonFormLines"] }, { type: i7__namespace$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i7__namespace$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i7__namespace$1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5__namespace$1.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup", "deactivationGuard"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"], exportAs: ["fsForm"] }, { type: i1__namespace.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1__namespace.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i7__namespace$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i7__namespace$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i7__namespace$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i5__namespace$1.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }, { type: i10__namespace$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i8__namespace$1.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: i7__namespace$1.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: i5__namespace$1.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { type: i1__namespace.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
559
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ContentPageComponent, decorators: [{
560
+ type: i0.Component,
561
+ args: [{
562
+ templateUrl: './content-page.component.html',
563
+ styleUrls: ['./content-page.component.scss'],
564
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
331
565
  }]
332
- }] });
566
+ }], ctorParameters: function () {
567
+ return [{ type: undefined, decorators: [{
568
+ type: i0.Inject,
569
+ args: [FS_CONTENT_CONFIG]
570
+ }] }, { type: undefined, decorators: [{
571
+ type: i0.Inject,
572
+ args: [i1.MAT_DIALOG_DATA]
573
+ }] }, { type: i1__namespace.MatDialogRef }, { type: i2__namespace.FsMessage }, { type: i0__namespace.ChangeDetectorRef }];
574
+ }, propDecorators: { textEditors: [{
575
+ type: i0.ViewChildren,
576
+ args: [i8.FsTextEditorComponent]
577
+ }] } });
333
578
 
334
579
  var FsContentPagesComponent = /** @class */ (function () {
335
580
  function FsContentPagesComponent(_config, _dialog) {
336
581
  this._config = _config;
337
582
  this._dialog = _dialog;
338
- this.pageTypes = common.index(PageTypes, 'value', 'name');
583
+ this.pageTypes = i12.index(PageTypes, 'value', 'name');
339
584
  this._destroy$ = new rxjs.Subject();
340
585
  }
341
586
  FsContentPagesComponent.prototype.ngOnInit = function () {
@@ -347,9 +592,16 @@
347
592
  data: {
348
593
  contentPage: contentPage,
349
594
  config: this._config,
595
+ title: 'Page',
596
+ contentConfig: this._config,
597
+ save: function (data) {
598
+ return _this._config.saveContentPage(data);
599
+ },
600
+ openSettings: function (data) {
601
+ return _this.openContentPage(data);
602
+ },
350
603
  },
351
604
  maxWidth: '100vw',
352
- maxHeight: '100vw',
353
605
  width: '100%',
354
606
  height: '100%',
355
607
  autoFocus: false,
@@ -364,6 +616,13 @@
364
616
  this._destroy$.next();
365
617
  this._destroy$.complete();
366
618
  };
619
+ FsContentPagesComponent.prototype.openContentPage = function (contentPage) {
620
+ return this._dialog.open(ContentPageComponent, {
621
+ data: { contentPage: contentPage },
622
+ })
623
+ .afterClosed()
624
+ .pipe(operators.takeUntil(this._destroy$));
625
+ };
367
626
  FsContentPagesComponent.prototype._initListConfig = function () {
368
627
  var _this = this;
369
628
  this.listConfig = {
@@ -378,15 +637,10 @@
378
637
  {
379
638
  label: 'Create',
380
639
  click: function () {
381
- _this._dialog.open(ContentPageComponent, {
382
- data: {
383
- contentPage: {
384
- type: PageType.StandardPage,
385
- },
386
- },
640
+ _this.openContentPage({
641
+ type: PageType.StandardPage,
387
642
  })
388
- .afterClosed()
389
- .pipe(operators.filter(function (contentPage) { return !!contentPage; }), operators.takeUntil(_this._destroy$))
643
+ .pipe(operators.filter(function (contentPage) { return !!contentPage; }))
390
644
  .subscribe(function (contentPage) {
391
645
  _this.openEditor(contentPage);
392
646
  _this.listComponent.reload();
@@ -460,68 +714,68 @@
460
714
  }());
461
715
  FsContentPagesModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsContentPagesModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
462
716
  FsContentPagesModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsContentPagesModule, declarations: [FsContentPagesComponent,
463
- ContentPageComponent], imports: [i10.CommonModule,
464
- i9.FormsModule,
717
+ ContentPageComponent], imports: [i10$1.CommonModule,
718
+ i7$1.FormsModule,
465
719
  i1.MatDialogModule,
466
- i11.MatInputModule,
467
- i4.MatFormFieldModule,
468
- i4$1.MatButtonModule,
720
+ i8$1.MatInputModule,
721
+ i4$1.MatFormFieldModule,
722
+ i4.MatButtonModule,
469
723
  tabs.MatTabsModule,
470
- i5$1.MatIconModule,
471
- i5.MatSelectModule,
472
- i9$1.MatButtonToggleModule,
724
+ i5.MatIconModule,
725
+ i5$2.MatSelectModule,
726
+ i10.MatButtonToggleModule,
473
727
  i2$1.FsListModule,
474
728
  i3$1.FsDateModule,
475
- i7$1.FsFormModule,
476
- i6$1.FsLabelModule,
477
- i8.FsSkeletonModule,
729
+ i5$1.FsFormModule,
730
+ i7.FsLabelModule,
731
+ i13.FsSkeletonModule,
478
732
  htmlEditor.FsHtmlEditorModule,
479
733
  i3.FsDialogModule,
480
- i7.FsTextEditorModule,
734
+ i8.FsTextEditorModule,
481
735
  FsContentEditorModule], exports: [FsContentPagesComponent] });
482
736
  FsContentPagesModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsContentPagesModule, imports: [[
483
- i10.CommonModule,
484
- i9.FormsModule,
737
+ i10$1.CommonModule,
738
+ i7$1.FormsModule,
485
739
  i1.MatDialogModule,
486
- i11.MatInputModule,
487
- i4.MatFormFieldModule,
488
- i4$1.MatButtonModule,
740
+ i8$1.MatInputModule,
741
+ i4$1.MatFormFieldModule,
742
+ i4.MatButtonModule,
489
743
  tabs.MatTabsModule,
490
- i5$1.MatIconModule,
491
- i5.MatSelectModule,
492
- i9$1.MatButtonToggleModule,
744
+ i5.MatIconModule,
745
+ i5$2.MatSelectModule,
746
+ i10.MatButtonToggleModule,
493
747
  i2$1.FsListModule,
494
748
  i3$1.FsDateModule,
495
- i7$1.FsFormModule,
496
- i6$1.FsLabelModule,
497
- i8.FsSkeletonModule,
749
+ i5$1.FsFormModule,
750
+ i7.FsLabelModule,
751
+ i13.FsSkeletonModule,
498
752
  htmlEditor.FsHtmlEditorModule,
499
753
  i3.FsDialogModule,
500
- i7.FsTextEditorModule,
754
+ i8.FsTextEditorModule,
501
755
  FsContentEditorModule,
502
756
  ]] });
503
757
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsContentPagesModule, decorators: [{
504
758
  type: i0.NgModule,
505
759
  args: [{
506
760
  imports: [
507
- i10.CommonModule,
508
- i9.FormsModule,
761
+ i10$1.CommonModule,
762
+ i7$1.FormsModule,
509
763
  i1.MatDialogModule,
510
- i11.MatInputModule,
511
- i4.MatFormFieldModule,
512
- i4$1.MatButtonModule,
764
+ i8$1.MatInputModule,
765
+ i4$1.MatFormFieldModule,
766
+ i4.MatButtonModule,
513
767
  tabs.MatTabsModule,
514
- i5$1.MatIconModule,
515
- i5.MatSelectModule,
516
- i9$1.MatButtonToggleModule,
768
+ i5.MatIconModule,
769
+ i5$2.MatSelectModule,
770
+ i10.MatButtonToggleModule,
517
771
  i2$1.FsListModule,
518
772
  i3$1.FsDateModule,
519
- i7$1.FsFormModule,
520
- i6$1.FsLabelModule,
521
- i8.FsSkeletonModule,
773
+ i5$1.FsFormModule,
774
+ i7.FsLabelModule,
775
+ i13.FsSkeletonModule,
522
776
  htmlEditor.FsHtmlEditorModule,
523
777
  i3.FsDialogModule,
524
- i7.FsTextEditorModule,
778
+ i8.FsTextEditorModule,
525
779
  FsContentEditorModule,
526
780
  ],
527
781
  exports: [
@@ -534,290 +788,131 @@
534
788
  }]
535
789
  }] });
536
790
 
537
- var ContentLayoutComponent = /** @class */ (function () {
538
- function ContentLayoutComponent(_config, _data, _dialogRef, _message, _cdRef) {
539
- var _this = this;
791
+ var ContentStyleComponent = /** @class */ (function () {
792
+ function ContentStyleComponent(_config, _message, _cdRef) {
540
793
  this._config = _config;
541
- this._data = _data;
542
- this._dialogRef = _dialogRef;
543
794
  this._message = _message;
544
795
  this._cdRef = _cdRef;
545
- this.contentLayout = null;
546
- this.editors = { content: true, styles: true };
547
- this._destroy$ = new rxjs.Subject();
548
- this.save = function () {
549
- return _this._config.saveContentLayout(_this.contentLayout)
550
- .pipe(operators.tap(function (contentLayout) {
551
- _this._message.success('Saved Changes');
552
- _this._dialogRef.close(contentLayout);
553
- }));
796
+ this.height = '100%';
797
+ this.contentStyle = null;
798
+ this.styleConfig = {
799
+ tabSize: 2,
800
+ language: 'scss',
801
+ height: '100%',
554
802
  };
555
- }
556
- ContentLayoutComponent.prototype.ngOnInit = function () {
557
- this._fetchData();
558
- };
559
- ContentLayoutComponent.prototype.ngOnDestroy = function () {
560
- this._destroy$.next();
561
- this._destroy$.complete();
562
- };
563
- ContentLayoutComponent.prototype._fetchData = function () {
564
- var _this = this;
565
- rxjs.of(this._data.contentLayout)
566
- .pipe(operators.switchMap(function (contentLayout) {
567
- return rxjs.of(contentLayout);
568
- }), operators.takeUntil(this._destroy$))
569
- .subscribe(function (contentLayout) {
570
- _this.contentLayout = Object.assign({}, contentLayout);
571
- _this._cdRef.markForCheck();
572
- });
573
- };
574
- return ContentLayoutComponent;
575
- }());
576
- ContentLayoutComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ContentLayoutComponent, deps: [{ token: FS_CONTENT_CONFIG }, { token: i1.MAT_DIALOG_DATA }, { token: i1__namespace.MatDialogRef }, { token: i2__namespace.FsMessage }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
577
- ContentLayoutComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ContentLayoutComponent, selector: "ng-component", viewQueries: [{ propertyName: "textEditors", predicate: i7.FsTextEditorComponent, descendants: true }], ngImport: i0__namespace, template: "<form fsForm [submit]=\"save\" *fsSkeletonForm=\"contentLayout\">\n <fs-dialog>\n <h1 mat-dialog-title>{{contentLayout.id ? 'Layout' : 'Layout Page'}}</h1>\n <div mat-dialog-content>\n <div class=\"fs-column\">\n <mat-form-field>\n <input\n matInput\n [(ngModel)]=\"contentLayout.name\"\n name=\"name\"\n required\n placeholder=\"Name\">\n </mat-form-field>\n <mat-form-field>\n <input\n matInput\n [(ngModel)]=\"contentLayout.tag\"\n name=\"tag\"\n placeholder=\"Tag\">\n </mat-form-field>\n </div>\n </div>\n\n <div mat-dialog-actions>\n <fs-form-dialog-actions>\n </fs-form-dialog-actions>\n </div>\n </fs-dialog>\n</form>\n", styles: [""], components: [{ type: i3__namespace.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileActionPlacement", "mobileWidth", "mode"] }, { type: i4__namespace.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i7__namespace.FsFormDialogActionsComponent, selector: "fs-form-dialog-actions", inputs: ["save", "create", "close", "done", "closeData", "name"] }], directives: [{ type: i8__namespace.FsSkeletonFormDirective, selector: "[fsSkeletonForm]", inputs: ["fsSkeletonForm", "fsSkeletonFormLines"] }, { type: i9__namespace.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i9__namespace.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i9__namespace.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i7__namespace.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup", "deactivationGuard"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"], exportAs: ["fsForm"] }, { type: i1__namespace.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1__namespace.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i11__namespace.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i9__namespace.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i9__namespace.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i9__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i9__namespace.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i7__namespace.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }, { type: i7__namespace.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { type: i1__namespace.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
578
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ContentLayoutComponent, decorators: [{
579
- type: i0.Component,
580
- args: [{
581
- templateUrl: './content-layout.component.html',
582
- styleUrls: ['./content-layout.component.scss'],
583
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
584
- }]
585
- }], ctorParameters: function () {
586
- return [{ type: undefined, decorators: [{
587
- type: i0.Inject,
588
- args: [FS_CONTENT_CONFIG]
589
- }] }, { type: undefined, decorators: [{
590
- type: i0.Inject,
591
- args: [i1.MAT_DIALOG_DATA]
592
- }] }, { type: i1__namespace.MatDialogRef }, { type: i2__namespace.FsMessage }, { type: i0__namespace.ChangeDetectorRef }];
593
- }, propDecorators: { textEditors: [{
594
- type: i0.ViewChildren,
595
- args: [i7.FsTextEditorComponent]
596
- }] } });
597
-
598
- var FsContentLayoutsComponent = /** @class */ (function () {
599
- function FsContentLayoutsComponent(_config, _dialog) {
600
- this._config = _config;
601
- this._dialog = _dialog;
602
803
  this._destroy$ = new rxjs.Subject();
603
804
  }
604
- FsContentLayoutsComponent.prototype.ngOnInit = function () {
605
- this._initListConfig();
606
- };
607
- FsContentLayoutsComponent.prototype.openEditor = function (contentLayout) {
608
- var _this = this;
609
- this._dialog.open(EditorComponent, {
610
- maxWidth: null,
611
- maxHeight: null,
612
- data: {
613
- styles: contentLayout.styles,
614
- content: contentLayout.content,
615
- save: function (data) {
616
- return _this._config.saveContentLayout(Object.assign({ id: contentLayout.id }, data));
617
- },
618
- },
619
- })
620
- .afterClosed()
621
- .pipe(operators.takeUntil(this._destroy$))
622
- .subscribe(function () {
623
- _this.listComponent.reload();
624
- });
625
- };
626
- FsContentLayoutsComponent.prototype.openLayout = function (contentLayout) {
805
+ ContentStyleComponent.prototype.ngOnInit = function () {
627
806
  var _this = this;
628
- this._dialog.open(ContentLayoutComponent, {
629
- data: {
630
- contentLayout: contentLayout,
631
- },
632
- })
633
- .afterClosed()
634
- .pipe(operators.filter(function (_contentLayout) { return !!_contentLayout; }), operators.takeUntil(this._destroy$))
635
- .subscribe(function () {
636
- _this.listComponent.reload();
807
+ this.styleConfig.height = this.height;
808
+ this._config.loadContentStyle()
809
+ .subscribe(function (contentStyle) {
810
+ _this.contentStyle = contentStyle;
811
+ _this._cdRef.markForCheck();
637
812
  });
638
813
  };
639
- FsContentLayoutsComponent.prototype.ngOnDestroy = function () {
814
+ ContentStyleComponent.prototype.ngOnDestroy = function () {
640
815
  this._destroy$.next();
641
816
  this._destroy$.complete();
642
817
  };
643
- FsContentLayoutsComponent.prototype._initListConfig = function () {
818
+ ContentStyleComponent.prototype.save = function () {
644
819
  var _this = this;
645
- this.listConfig = {
646
- paging: false,
647
- filters: [
648
- {
649
- name: 'keyword',
650
- type: filter.ItemType.Keyword,
651
- label: 'Search',
652
- },
653
- ],
654
- actions: [
655
- {
656
- label: 'Create',
657
- click: function () {
658
- _this.openLayout({});
659
- },
660
- },
661
- ],
662
- rowActions: [
663
- {
664
- click: function (data) {
665
- return _this._config.deleteContentLayout(data);
666
- },
667
- remove: {
668
- title: 'Confirm',
669
- template: 'Are you sure you would like to delete this record?',
670
- },
671
- menu: true,
672
- label: 'Delete',
673
- },
674
- ],
675
- fetch: function (query) {
676
- return _this._config.loadContentLayouts(query)
677
- .pipe(operators.map(function (contentLayouts) {
678
- return { data: contentLayouts };
679
- }));
680
- },
681
- restore: {
682
- query: { state: 'deleted' },
683
- filterLabel: 'Show Deleted',
684
- menuLabel: 'Restore',
685
- reload: true,
686
- click: function (row) {
687
- return _this._config.saveContentLayout({ id: row.id, state: 'active' });
688
- },
689
- },
690
- };
820
+ this._config.saveContentStyle(this.contentStyle)
821
+ .pipe(operators.tap(function (contentStyle) {
822
+ _this.contentStyle = Object.assign(Object.assign({}, _this.contentStyle), contentStyle);
823
+ _this._cdRef.markForCheck();
824
+ _this._message.success('Saved Changes');
825
+ })).subscribe();
691
826
  };
692
- return FsContentLayoutsComponent;
827
+ return ContentStyleComponent;
693
828
  }());
694
- FsContentLayoutsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsContentLayoutsComponent, deps: [{ token: FS_CONTENT_CONFIG }, { token: i1__namespace.MatDialog }], target: i0__namespace.ɵɵFactoryTarget.Component });
695
- FsContentLayoutsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsContentLayoutsComponent, selector: "fs-content-layouts", viewQueries: [{ propertyName: "listComponent", first: true, predicate: i2$1.FsListComponent, descendants: true }], ngImport: i0__namespace, template: "<fs-list [config]=\"listConfig\">\n <fs-list-column name=\"design\" width=\"1%\">\n <ng-template fs-list-cell let-row=\"row\">\n <a (click)=\"openEditor(row)\"><mat-icon>design_services</mat-icon></a>\n </ng-template>\n </fs-list-column>\n <fs-list-column name=\"name\" title=\"Name\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n <a (click)=\"openLayout(row)\">{{row.name}}</a>\n </ng-template>\n </fs-list-column>\n <fs-list-column name=\"modify_date\" title=\"Modified\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.modifyDate | fsDate: 'date-time-yearless'}}\n </ng-template>\n </fs-list-column>\n</fs-list>\n", styles: [""], components: [{ type: i2__namespace$1.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { type: i5__namespace$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i2__namespace$1.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i2__namespace$1.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }], pipes: { "fsDate": i3__namespace$1.FsDatePipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
696
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsContentLayoutsComponent, decorators: [{
829
+ ContentStyleComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ContentStyleComponent, deps: [{ token: FS_CONTENT_CONFIG }, { token: i2__namespace.FsMessage }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
830
+ ContentStyleComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ContentStyleComponent, selector: "fs-content-style", inputs: { height: "height" }, viewQueries: [{ propertyName: "textEditors", first: true, predicate: i8.FsTextEditorComponent, descendants: true }, { propertyName: "form", first: true, predicate: i5$1.FsFormDirective, descendants: true }], ngImport: i0__namespace, template: "<ng-container *fsSkeletonForm=\"contentStyle\">\n <fs-text-editor \n [(ngModel)]=\"contentStyle.scss\" \n name=\"contentStyle\"\n [fsModelChangeOptions]=\"{ debounce: 300 }\"\n (fsModelChange)=\"save()\"\n [config]=\"styleConfig\">\n </fs-text-editor> \n</ng-container>\n", styles: [""], components: [{ type: i8__namespace.FsTextEditorComponent, selector: "fs-text-editor", inputs: ["config", "scrollable"], outputs: ["ready", "blur"] }], directives: [{ type: i13__namespace.FsSkeletonFormDirective, selector: "[fsSkeletonForm]", inputs: ["fsSkeletonForm", "fsSkeletonFormLines"] }, { type: i7__namespace$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i7__namespace$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i12__namespace.FsModelChangeDirective, selector: "[fsModelChange]", inputs: ["fsModelChangeOptions"], outputs: ["fsModelChange"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
831
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ContentStyleComponent, decorators: [{
697
832
  type: i0.Component,
698
833
  args: [{
699
- selector: 'fs-content-layouts',
700
- templateUrl: './content-layouts.component.html',
701
- styleUrls: ['./content-layouts.component.scss'],
834
+ selector: 'fs-content-style',
835
+ templateUrl: './content-style.component.html',
836
+ styleUrls: ['./content-style.component.scss'],
702
837
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
703
838
  }]
704
839
  }], ctorParameters: function () {
705
840
  return [{ type: undefined, decorators: [{
706
841
  type: i0.Inject,
707
842
  args: [FS_CONTENT_CONFIG]
708
- }] }, { type: i1__namespace.MatDialog }];
709
- }, propDecorators: { listComponent: [{
843
+ }] }, { type: i2__namespace.FsMessage }, { type: i0__namespace.ChangeDetectorRef }];
844
+ }, propDecorators: { textEditors: [{
710
845
  type: i0.ViewChild,
711
- args: [i2$1.FsListComponent]
846
+ args: [i8.FsTextEditorComponent]
847
+ }], form: [{
848
+ type: i0.ViewChild,
849
+ args: [i5$1.FsFormDirective]
850
+ }], height: [{
851
+ type: i0.Input
712
852
  }] } });
713
853
 
714
- var FsContentLayoutsModule = /** @class */ (function () {
715
- function FsContentLayoutsModule() {
854
+ var FsContentStyleModule = /** @class */ (function () {
855
+ function FsContentStyleModule() {
716
856
  }
717
- return FsContentLayoutsModule;
857
+ return FsContentStyleModule;
718
858
  }());
719
- FsContentLayoutsModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsContentLayoutsModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
720
- FsContentLayoutsModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsContentLayoutsModule, declarations: [ContentLayoutComponent,
721
- FsContentLayoutsComponent], imports: [i10.CommonModule,
722
- i9.FormsModule,
723
- i1.MatDialogModule,
724
- i11.MatInputModule,
725
- i4.MatFormFieldModule,
726
- i4$1.MatButtonModule,
727
- tabs.MatTabsModule,
728
- i5$1.MatIconModule,
729
- i5.MatSelectModule,
730
- i9$1.MatButtonToggleModule,
731
- i2$1.FsListModule,
732
- i3$1.FsDateModule,
733
- i7$1.FsFormModule,
734
- i6$1.FsLabelModule,
735
- i8.FsSkeletonModule,
736
- htmlEditor.FsHtmlEditorModule,
737
- i3.FsDialogModule,
738
- i7.FsTextEditorModule,
739
- FsContentEditorModule], exports: [FsContentLayoutsComponent] });
740
- FsContentLayoutsModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsContentLayoutsModule, imports: [[
741
- i10.CommonModule,
742
- i9.FormsModule,
743
- i1.MatDialogModule,
744
- i11.MatInputModule,
745
- i4.MatFormFieldModule,
746
- i4$1.MatButtonModule,
747
- tabs.MatTabsModule,
748
- i5$1.MatIconModule,
749
- i5.MatSelectModule,
750
- i9$1.MatButtonToggleModule,
751
- i2$1.FsListModule,
752
- i3$1.FsDateModule,
753
- i7$1.FsFormModule,
754
- i6$1.FsLabelModule,
755
- i8.FsSkeletonModule,
756
- htmlEditor.FsHtmlEditorModule,
757
- i3.FsDialogModule,
758
- i7.FsTextEditorModule,
859
+ FsContentStyleModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsContentStyleModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
860
+ FsContentStyleModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsContentStyleModule, declarations: [ContentStyleComponent], imports: [i10$1.CommonModule,
861
+ i7$1.FormsModule,
862
+ i4.MatButtonModule,
863
+ i8.FsTextEditorModule,
864
+ i13.FsSkeletonModule,
865
+ i12.FsCommonModule,
866
+ FsContentEditorModule], exports: [ContentStyleComponent] });
867
+ FsContentStyleModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsContentStyleModule, imports: [[
868
+ i10$1.CommonModule,
869
+ i7$1.FormsModule,
870
+ i4.MatButtonModule,
871
+ i8.FsTextEditorModule,
872
+ i13.FsSkeletonModule,
873
+ i12.FsCommonModule,
759
874
  FsContentEditorModule,
760
875
  ]] });
761
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsContentLayoutsModule, decorators: [{
876
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsContentStyleModule, decorators: [{
762
877
  type: i0.NgModule,
763
878
  args: [{
764
879
  imports: [
765
- i10.CommonModule,
766
- i9.FormsModule,
767
- i1.MatDialogModule,
768
- i11.MatInputModule,
769
- i4.MatFormFieldModule,
770
- i4$1.MatButtonModule,
771
- tabs.MatTabsModule,
772
- i5$1.MatIconModule,
773
- i5.MatSelectModule,
774
- i9$1.MatButtonToggleModule,
775
- i2$1.FsListModule,
776
- i3$1.FsDateModule,
777
- i7$1.FsFormModule,
778
- i6$1.FsLabelModule,
779
- i8.FsSkeletonModule,
780
- htmlEditor.FsHtmlEditorModule,
781
- i3.FsDialogModule,
782
- i7.FsTextEditorModule,
880
+ i10$1.CommonModule,
881
+ i7$1.FormsModule,
882
+ i4.MatButtonModule,
883
+ i8.FsTextEditorModule,
884
+ i13.FsSkeletonModule,
885
+ i12.FsCommonModule,
783
886
  FsContentEditorModule,
784
887
  ],
785
888
  exports: [
786
- FsContentLayoutsComponent,
889
+ ContentStyleComponent,
787
890
  ],
788
891
  declarations: [
789
- ContentLayoutComponent,
790
- FsContentLayoutsComponent,
892
+ ContentStyleComponent,
791
893
  ],
792
894
  }]
793
895
  }] });
794
896
 
795
897
  var ContentRendererComponent = /** @class */ (function () {
796
- function ContentRendererComponent(_sanitizer, _router, _el) {
898
+ function ContentRendererComponent(_sanitizer, _router, _el, _htmlRenderer) {
797
899
  this._sanitizer = _sanitizer;
798
900
  this._router = _router;
799
901
  this._el = _el;
902
+ this._htmlRenderer = _htmlRenderer;
800
903
  this._destroy$ = new rxjs.Subject();
801
904
  }
802
- Object.defineProperty(ContentRendererComponent.prototype, "contentPage", {
803
- set: function (contentPage) {
804
- if (contentPage) {
805
- this.content = this._sanitizer.bypassSecurityTrustHtml(contentPage.content);
806
- this.styles = contentPage.styles;
807
- }
808
- },
809
- enumerable: false,
810
- configurable: true
811
- });
905
+ ContentRendererComponent.prototype.ngOnInit = function () {
906
+ this._htmlRenderer.addStyle(this.contentPage.styles, { id: 'contentPageStyles' });
907
+ this.content = this._sanitizer.bypassSecurityTrustHtml(this.contentPage.content);
908
+ };
812
909
  ContentRendererComponent.prototype.ngAfterViewChecked = function () {
813
- var el = document.querySelector('#contentPageStyles');
814
- if (!el) {
815
- el = document.createElement('style');
816
- el.setAttribute('id', 'contentPageStyles');
817
- document.getElementsByTagName('head')[0].appendChild(el);
818
- }
819
- el.innerHTML = this.styles;
820
910
  this.registerHrefs();
911
+ if (this.contentPage.js) {
912
+ var script = document.createElement('script');
913
+ script.text = this.contentPage.js;
914
+ this.script.nativeElement.after(script);
915
+ }
821
916
  };
822
917
  ContentRendererComponent.prototype.registerHrefs = function () {
823
918
  var _this = this;
@@ -855,8 +950,8 @@
855
950
  };
856
951
  return ContentRendererComponent;
857
952
  }());
858
- ContentRendererComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ContentRendererComponent, deps: [{ token: i1__namespace$1.DomSanitizer }, { token: i2__namespace$2.Router }, { token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
859
- ContentRendererComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ContentRendererComponent, selector: "fs-content-renderer", inputs: { contentPage: "contentPage" }, ngImport: i0__namespace, template: "<div *ngIf=\"content\" [innerHTML]=\"content\"></div>\n", styles: [""], directives: [{ type: i10__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
953
+ ContentRendererComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ContentRendererComponent, deps: [{ token: i1__namespace$1.DomSanitizer }, { token: i2__namespace$2.Router }, { token: i0__namespace.ElementRef }, { token: i3__namespace$2.HtmlRenderer }], target: i0__namespace.ɵɵFactoryTarget.Component });
954
+ ContentRendererComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ContentRendererComponent, selector: "fs-content-renderer", inputs: { contentPage: "contentPage" }, viewQueries: [{ propertyName: "script", first: true, predicate: ["script"], descendants: true, read: i0.ElementRef }], ngImport: i0__namespace, template: "<div *ngIf=\"content\" [innerHTML]=\"content\"></div>\n<span #script></span>", styles: [""], directives: [{ type: i10__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
860
955
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ContentRendererComponent, decorators: [{
861
956
  type: i0.Component,
862
957
  args: [{
@@ -865,29 +960,58 @@
865
960
  styleUrls: ['./content-renderer.component.scss'],
866
961
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
867
962
  }]
868
- }], ctorParameters: function () { return [{ type: i1__namespace$1.DomSanitizer }, { type: i2__namespace$2.Router }, { type: i0__namespace.ElementRef }]; }, propDecorators: { contentPage: [{
963
+ }], ctorParameters: function () { return [{ type: i1__namespace$1.DomSanitizer }, { type: i2__namespace$2.Router }, { type: i0__namespace.ElementRef }, { type: i3__namespace$2.HtmlRenderer }]; }, propDecorators: { script: [{
964
+ type: i0.ViewChild,
965
+ args: ['script', { read: i0.ElementRef }]
966
+ }], contentPage: [{
869
967
  type: i0.Input
870
968
  }] } });
871
969
 
872
970
  var FsContentComponent = /** @class */ (function () {
873
- function FsContentComponent(_config, _title, _cdRef, _router, _el) {
971
+ function FsContentComponent(_config, _title, _cdRef, _router, _el, _htmlRenderer) {
874
972
  this._config = _config;
875
973
  this._title = _title;
876
974
  this._cdRef = _cdRef;
877
975
  this._router = _router;
878
976
  this._el = _el;
977
+ this._htmlRenderer = _htmlRenderer;
879
978
  this._destroy$ = new rxjs.Subject();
880
979
  }
881
980
  FsContentComponent.prototype.ngOnInit = function () {
981
+ this._initContent();
982
+ this._initStyles();
983
+ };
984
+ Object.defineProperty(FsContentComponent.prototype, "el", {
985
+ get: function () {
986
+ return this._el.nativeElement;
987
+ },
988
+ enumerable: false,
989
+ configurable: true
990
+ });
991
+ FsContentComponent.prototype.ngOnDestroy = function () {
992
+ this._destroy$.next();
993
+ this._destroy$.complete();
994
+ this._title.setTitle('');
995
+ };
996
+ FsContentComponent.prototype._initStyles = function () {
997
+ var _this = this;
998
+ if (this._config.loadContentStyleCss) {
999
+ this._config.loadContentStyleCss()
1000
+ .subscribe(function (styles) {
1001
+ _this._htmlRenderer.addStyle(styles, { id: 'content-sytle' });
1002
+ });
1003
+ }
1004
+ };
1005
+ FsContentComponent.prototype._initContent = function () {
882
1006
  var _this = this;
883
- this.load();
1007
+ this._loadContent();
884
1008
  this._router.events
885
1009
  .pipe(operators.filter(function (e) { return e instanceof i2$2.NavigationEnd; }), operators.takeUntil(this._destroy$))
886
- .subscribe(function () {
887
- _this.load();
1010
+ .subscribe(function (e) {
1011
+ _this._loadContent();
888
1012
  });
889
1013
  };
890
- FsContentComponent.prototype.load = function () {
1014
+ FsContentComponent.prototype._loadContent = function () {
891
1015
  var _this = this;
892
1016
  var path = window.location.pathname;
893
1017
  this._config.loadContent(path)
@@ -906,22 +1030,10 @@
906
1030
  _this._cdRef.markForCheck();
907
1031
  });
908
1032
  };
909
- Object.defineProperty(FsContentComponent.prototype, "el", {
910
- get: function () {
911
- return this._el.nativeElement;
912
- },
913
- enumerable: false,
914
- configurable: true
915
- });
916
- FsContentComponent.prototype.ngOnDestroy = function () {
917
- this._destroy$.next();
918
- this._destroy$.complete();
919
- this._title.setTitle('');
920
- };
921
1033
  return FsContentComponent;
922
1034
  }());
923
- FsContentComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsContentComponent, deps: [{ token: FS_CONTENT_CONFIG }, { token: i1__namespace$1.Title }, { token: i0__namespace.ChangeDetectorRef }, { token: i2__namespace$2.Router }, { token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
924
- FsContentComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsContentComponent, selector: "fs-content", ngImport: i0__namespace, template: "<fs-content-renderer *ngIf=\"contentPage\" [contentPage]=\"contentPage\"></fs-content-renderer>", styles: [""], components: [{ type: ContentRendererComponent, selector: "fs-content-renderer", inputs: ["contentPage"] }], directives: [{ type: i10__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
1035
+ FsContentComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsContentComponent, deps: [{ token: FS_CONTENT_CONFIG }, { token: i1__namespace$1.Title }, { token: i0__namespace.ChangeDetectorRef }, { token: i2__namespace$2.Router }, { token: i0__namespace.ElementRef }, { token: i3__namespace$2.HtmlRenderer }], target: i0__namespace.ɵɵFactoryTarget.Component });
1036
+ FsContentComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsContentComponent, selector: "fs-content", ngImport: i0__namespace, template: "<ng-container *ngIf=\"contentPage\">\n <fs-content-renderer [contentPage]=\"contentPage\"></fs-content-renderer>\n</ng-container>", styles: [""], components: [{ type: ContentRendererComponent, selector: "fs-content-renderer", inputs: ["contentPage"] }], directives: [{ type: i10__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
925
1037
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsContentComponent, decorators: [{
926
1038
  type: i0.Component,
927
1039
  args: [{
@@ -934,7 +1046,7 @@
934
1046
  return [{ type: undefined, decorators: [{
935
1047
  type: i0.Inject,
936
1048
  args: [FS_CONTENT_CONFIG]
937
- }] }, { type: i1__namespace$1.Title }, { type: i0__namespace.ChangeDetectorRef }, { type: i2__namespace$2.Router }, { type: i0__namespace.ElementRef }];
1049
+ }] }, { type: i1__namespace$1.Title }, { type: i0__namespace.ChangeDetectorRef }, { type: i2__namespace$2.Router }, { type: i0__namespace.ElementRef }, { type: i3__namespace$2.HtmlRenderer }];
938
1050
  } });
939
1051
 
940
1052
  var FsContentModule = /** @class */ (function () {
@@ -944,17 +1056,17 @@
944
1056
  }());
945
1057
  FsContentModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsContentModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
946
1058
  FsContentModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsContentModule, declarations: [FsContentComponent,
947
- ContentRendererComponent], imports: [i10.CommonModule,
1059
+ ContentRendererComponent], imports: [i10$1.CommonModule,
948
1060
  htmlEditor.FsHtmlEditorModule], exports: [FsContentComponent] });
949
1061
  FsContentModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsContentModule, imports: [[
950
- i10.CommonModule,
1062
+ i10$1.CommonModule,
951
1063
  htmlEditor.FsHtmlEditorModule,
952
1064
  ]] });
953
1065
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsContentModule, decorators: [{
954
1066
  type: i0.NgModule,
955
1067
  args: [{
956
1068
  imports: [
957
- i10.CommonModule,
1069
+ i10$1.CommonModule,
958
1070
  htmlEditor.FsHtmlEditorModule,
959
1071
  ],
960
1072
  exports: [
@@ -971,6 +1083,7 @@
971
1083
  * Generated bundle index. Do not edit.
972
1084
  */
973
1085
 
1086
+ exports.ContentStyleComponent = ContentStyleComponent;
974
1087
  exports.FS_CONTENT_CONFIG = FS_CONTENT_CONFIG;
975
1088
  exports.FsContentComponent = FsContentComponent;
976
1089
  exports.FsContentLayoutsComponent = FsContentLayoutsComponent;
@@ -978,6 +1091,7 @@
978
1091
  exports.FsContentModule = FsContentModule;
979
1092
  exports.FsContentPagesComponent = FsContentPagesComponent;
980
1093
  exports.FsContentPagesModule = FsContentPagesModule;
1094
+ exports.FsContentStyleModule = FsContentStyleModule;
981
1095
 
982
1096
  Object.defineProperty(exports, '__esModule', { value: true });
983
1097