@firestitch/content 12.3.0 → 12.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. package/app/consts/index.d.ts +1 -1
  2. package/app/consts/page-types.const.d.ts +5 -5
  3. package/app/enums/editor-type.d.ts +6 -6
  4. package/app/enums/index.d.ts +2 -2
  5. package/app/enums/page-type.enum.d.ts +6 -6
  6. package/app/injectors/content-config.injector.d.ts +2 -2
  7. package/app/injectors/index.d.ts +1 -1
  8. package/app/interfaces/content-config.d.ts +21 -21
  9. package/app/interfaces/content-layout.d.ts +10 -10
  10. package/app/interfaces/content-page.d.ts +14 -14
  11. package/app/interfaces/content-style.d.ts +4 -4
  12. package/app/interfaces/index.d.ts +4 -4
  13. package/app/modules/content/components/content/content.component.d.ts +25 -25
  14. package/app/modules/content/components/content/index.d.ts +1 -1
  15. package/app/modules/content/components/content-renderer/content-renderer.component.d.ts +24 -24
  16. package/app/modules/content/components/content-renderer/index.d.ts +1 -1
  17. package/app/modules/content/fs-content.module.d.ts +10 -10
  18. package/app/modules/content-layouts/components/content-layout/content-layout.component.d.ts +27 -27
  19. package/app/modules/content-layouts/components/content-layout/index.d.ts +1 -1
  20. package/app/modules/content-layouts/components/content-layout-editor/content-layout-editor.component.d.ts +50 -50
  21. package/app/modules/content-layouts/components/content-layout-editor/index.d.ts +1 -1
  22. package/app/modules/content-layouts/components/content-layouts/content-layouts.component.d.ts +21 -21
  23. package/app/modules/content-layouts/components/content-layouts/index.d.ts +1 -1
  24. package/app/modules/content-layouts/components/index.d.ts +3 -3
  25. package/app/modules/content-layouts/fs-content-layouts.module.d.ts +28 -28
  26. package/app/modules/content-pages/components/content-page/content-page.component.d.ts +32 -32
  27. package/app/modules/content-pages/components/content-page/index.d.ts +1 -1
  28. package/app/modules/content-pages/components/content-page-editor/content-page-editor.component.d.ts +52 -51
  29. package/app/modules/content-pages/components/content-page-editor/index.d.ts +1 -1
  30. package/app/modules/content-pages/components/content-pages/content-pages.component.d.ts +24 -24
  31. package/app/modules/content-pages/components/content-pages/index.d.ts +1 -1
  32. package/app/modules/content-pages/components/index.d.ts +3 -3
  33. package/app/modules/content-pages/fs-content-pages.module.d.ts +32 -31
  34. package/app/modules/content-style/components/content-style/content-style.component.d.ts +27 -27
  35. package/app/modules/content-style/components/content-style/index.d.ts +1 -1
  36. package/app/modules/content-style/fs-content-style.module.d.ts +14 -14
  37. package/app/modules/editor/components/editor/editor.component.d.ts +47 -47
  38. package/app/modules/editor/components/editor/index.d.ts +1 -1
  39. package/app/modules/editor/fs-content-editor.module.d.ts +23 -23
  40. package/app/modules/editor/index.d.ts +1 -1
  41. package/bundles/firestitch-content.umd.js +1345 -1334
  42. package/bundles/firestitch-content.umd.js.map +1 -1
  43. package/esm2015/app/consts/index.js +1 -1
  44. package/esm2015/app/consts/page-types.const.js +7 -7
  45. package/esm2015/app/enums/editor-type.js +7 -7
  46. package/esm2015/app/enums/index.js +3 -3
  47. package/esm2015/app/enums/page-type.enum.js +7 -7
  48. package/esm2015/app/injectors/content-config.injector.js +2 -2
  49. package/esm2015/app/injectors/index.js +1 -1
  50. package/esm2015/app/interfaces/content-config.js +1 -1
  51. package/esm2015/app/interfaces/content-layout.js +1 -1
  52. package/esm2015/app/interfaces/content-page.js +1 -1
  53. package/esm2015/app/interfaces/content-style.js +1 -1
  54. package/esm2015/app/interfaces/index.js +5 -5
  55. package/esm2015/app/modules/content/components/content/content.component.js +84 -84
  56. package/esm2015/app/modules/content/components/content/index.js +1 -1
  57. package/esm2015/app/modules/content/components/content-renderer/content-renderer.component.js +76 -76
  58. package/esm2015/app/modules/content/components/content-renderer/index.js +1 -1
  59. package/esm2015/app/modules/content/fs-content.module.js +32 -32
  60. package/esm2015/app/modules/content-layouts/components/content-layout/content-layout.component.js +71 -71
  61. package/esm2015/app/modules/content-layouts/components/content-layout/index.js +1 -1
  62. package/esm2015/app/modules/content-layouts/components/content-layout-editor/content-layout-editor.component.js +159 -159
  63. package/esm2015/app/modules/content-layouts/components/content-layout-editor/index.js +1 -1
  64. package/esm2015/app/modules/content-layouts/components/content-layouts/content-layouts.component.js +120 -120
  65. package/esm2015/app/modules/content-layouts/components/content-layouts/index.js +1 -1
  66. package/esm2015/app/modules/content-layouts/components/index.js +4 -4
  67. package/esm2015/app/modules/content-layouts/fs-content-layouts.module.js +103 -103
  68. package/esm2015/app/modules/content-pages/components/content-page/content-page.component.js +82 -82
  69. package/esm2015/app/modules/content-pages/components/content-page/index.js +1 -1
  70. package/esm2015/app/modules/content-pages/components/content-page-editor/content-page-editor.component.js +167 -163
  71. package/esm2015/app/modules/content-pages/components/content-page-editor/index.js +1 -1
  72. package/esm2015/app/modules/content-pages/components/content-pages/content-pages.component.js +129 -129
  73. package/esm2015/app/modules/content-pages/components/content-pages/index.js +1 -1
  74. package/esm2015/app/modules/content-pages/components/index.js +4 -4
  75. package/esm2015/app/modules/content-pages/fs-content-pages.module.js +117 -113
  76. package/esm2015/app/modules/content-style/components/content-style/content-style.component.js +70 -70
  77. package/esm2015/app/modules/content-style/components/content-style/index.js +1 -1
  78. package/esm2015/app/modules/content-style/fs-content-style.module.js +49 -49
  79. package/esm2015/app/modules/editor/components/editor/editor.component.js +144 -144
  80. package/esm2015/app/modules/editor/components/editor/index.js +1 -1
  81. package/esm2015/app/modules/editor/fs-content-editor.module.js +85 -85
  82. package/esm2015/app/modules/editor/index.js +1 -1
  83. package/esm2015/firestitch-content.js +4 -4
  84. package/esm2015/public_api.js +10 -10
  85. package/fesm2015/firestitch-content.js +1249 -1241
  86. package/fesm2015/firestitch-content.js.map +1 -1
  87. package/firestitch-content.d.ts +5 -5
  88. package/package.json +1 -1
  89. package/public_api.d.ts +10 -10
@@ -43,1291 +43,1299 @@ import { Subject, of, throwError, fromEvent } from 'rxjs';
43
43
  import { tap, switchMap, takeUntil, filter, map } from 'rxjs/operators';
44
44
  import * as i3$2 from '@firestitch/prompt';
45
45
  import { ItemType } from '@firestitch/filter';
46
+ import * as i12 from '@angular/material/tooltip';
47
+ import { MatTooltipModule } from '@angular/material/tooltip';
46
48
  import * as i6$1 from '@angular/material/core';
47
49
  import * as i1$1 from '@angular/platform-browser';
48
50
  import * as i2$3 from '@angular/router';
49
51
  import { NavigationEnd } from '@angular/router';
50
52
  import * as i3$4 from '@firestitch/html';
51
53
 
52
- var EditorType;
53
- (function (EditorType) {
54
- EditorType["Js"] = "js";
55
- EditorType["Html"] = "html";
56
- EditorType["Scss"] = "scss";
57
- EditorType["GlobalScss"] = "globalScss";
54
+ var EditorType;
55
+ (function (EditorType) {
56
+ EditorType["Js"] = "js";
57
+ EditorType["Html"] = "html";
58
+ EditorType["Scss"] = "scss";
59
+ EditorType["GlobalScss"] = "globalScss";
58
60
  })(EditorType || (EditorType = {}));
59
61
 
60
- var PageType;
61
- (function (PageType) {
62
- PageType["StandardPage"] = "standardPage";
63
- PageType["BlogPost"] = "blogPost";
64
- PageType["HomePage"] = "homePage";
65
- PageType["NotFoundPage"] = "notFoundPage";
62
+ var PageType;
63
+ (function (PageType) {
64
+ PageType["StandardPage"] = "standardPage";
65
+ PageType["BlogPost"] = "blogPost";
66
+ PageType["HomePage"] = "homePage";
67
+ PageType["NotFoundPage"] = "notFoundPage";
66
68
  })(PageType || (PageType = {}));
67
69
 
68
- class EditorComponent {
69
- constructor(_cdRef, _message) {
70
- this._cdRef = _cdRef;
71
- this._message = _message;
72
- this.showHtml = false;
73
- this.showScss = false;
74
- this.showJs = false;
75
- this.showGlobalScss = false;
76
- this.changed = new EventEmitter();
77
- this.focused = new EventEmitter();
78
- this.blured = new EventEmitter();
79
- this.changes = {};
80
- this.EditorType = EditorType;
81
- this.resizing = false;
82
- this._destroy$ = new Subject();
83
- }
84
- ngOnInit() {
85
- this.initTextEditors();
86
- this.initGlobalContentStyle();
87
- }
88
- ngOnDestroy() {
89
- this._destroy$.next();
90
- this._destroy$.complete();
91
- }
92
- change(type, value) {
93
- this.changed.emit({ type, value });
94
- this.changes[type] = value;
95
- }
96
- get hasChanges() {
97
- return Object.keys(this.changes)
98
- .filter((name) => !!this.changes[name])
99
- .length !== 0;
100
- }
101
- clearChange(type) {
102
- this.changes[type] = null;
103
- this._cdRef.markForCheck();
104
- }
105
- initTextEditors() {
106
- this.scssConfig = {
107
- tabSize: 2,
108
- language: 'scss',
109
- height: '100%',
110
- focus: () => {
111
- this.focused.emit(EditorType.Scss);
112
- },
113
- blur: () => {
114
- this.blured.emit(EditorType.Scss);
115
- },
116
- };
117
- this.jsConfig = {
118
- tabSize: 2,
119
- language: 'js',
120
- height: '100%',
121
- focus: () => {
122
- this.focused.emit(EditorType.Js);
123
- },
124
- blur: () => {
125
- this.blured.emit(EditorType.Js);
126
- },
127
- };
128
- this.htmlConfig = {
129
- tabSize: 2,
130
- language: 'html',
131
- height: '100%',
132
- focus: () => {
133
- this.focused.emit(EditorType.Html);
134
- },
135
- blur: () => {
136
- this.blured.emit(EditorType.Html);
137
- },
138
- };
139
- this.globalScssConfig = {
140
- tabSize: 2,
141
- language: 'scss',
142
- height: '100%',
143
- focus: () => {
144
- this.focused.emit(EditorType.GlobalScss);
145
- },
146
- blur: () => {
147
- this.blured.emit(EditorType.GlobalScss);
148
- },
149
- };
150
- }
151
- initGlobalContentStyle() {
152
- this.contentConfig.loadContentStyle()
153
- .subscribe((contentStyle) => {
154
- this.contentStyle = contentStyle || {};
155
- this._cdRef.markForCheck();
156
- });
157
- }
158
- saveGlobalScss() {
159
- return this.contentConfig.saveContentStyle(this.contentStyle)
160
- .pipe(tap(() => {
161
- this._message.success('Saved Changes');
162
- }));
163
- }
164
- }
165
- EditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: EditorComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i2.FsMessage }], target: i0.ɵɵFactoryTarget.Component });
166
- EditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: EditorComponent, selector: "app-editor", inputs: { showHtml: "showHtml", showScss: "showScss", showJs: "showJs", showGlobalScss: "showGlobalScss", html: "html", scss: "scss", js: "js", contentConfig: "contentConfig" }, outputs: { changed: "changed", focused: "focused", blured: "blured" }, ngImport: i0, template: "<as-split [unit]=\"'percent'\" [gutterSize]=\"25\"> \n <as-split-area [size]=\"70\" [visible]=\"showHtml\" [order]=\"1\">\n <div class=\"editor-container\">\n <fs-label>HTML {{changes.html ? '*' : ''}}</fs-label>\n <fs-text-editor \n [(ngModel)]=\"html\" \n name=\"html\"\n [fsModelChangeOptions]=\"{ debounce: 0 }\"\n (fsModelChange)=\"change(EditorType.Html, $event)\"\n [config]=\"htmlConfig\">\n </fs-text-editor> \n </div>\n </as-split-area>\n <as-split-area [size]=\"30\" [visible]=\"showScss\" [order]=\"2\">\n <div class=\"editor-container\">\n <fs-label>SCSS {{changes.scss ? '*' : ''}}</fs-label>\n <fs-text-editor \n [(ngModel)]=\"scss\" \n name=\"scss\"\n [fsModelChangeOptions]=\"{ debounce: 0 }\"\n (fsModelChange)=\"change(EditorType.Scss, $event)\"\n [config]=\"scssConfig\">\n </fs-text-editor> \n </div>\n </as-split-area>\n <as-split-area [size]=\"30\" [visible]=\"showJs\" [order]=\"3\">\n <div class=\"editor-container\">\n <fs-label>JS {{changes.js ? '*' : ''}}</fs-label>\n <fs-text-editor \n [(ngModel)]=\"js\" \n name=\"js\"\n [fsModelChangeOptions]=\"{ debounce: 0 }\"\n (fsModelChange)=\"change(EditorType.Js, $event)\"\n [config]=\"jsConfig\">\n </fs-text-editor> \n </div>\n </as-split-area>\n <as-split-area [size]=\"30\" [visible]=\"showGlobalScss\" [order]=\"4\">\n <div class=\"editor-container\">\n <fs-label>Global SCSS {{changes.globalScss ? '*' : ''}}</fs-label>\n <ng-container *fsSkeleton=\"contentStyle\">\n <fs-text-editor \n [(ngModel)]=\"contentStyle.scss\" \n name=\"globalScss\"\n [fsModelChangeOptions]=\"{ debounce: 300 }\"\n (fsModelChange)=\"change(EditorType.GlobalScss, $event)\"\n [config]=\"globalScssConfig\">\n </fs-text-editor> \n </ng-container> \n </div>\n </as-split-area>\n</as-split>\n", styles: [":host ::ng-deep .as-split-gutter{background-color:unset!important}.editor-container{height:100%;border-radius:5px;display:flex;flex-direction:column}.editor-container fs-text-editor{flex:1}\n"], components: [{ type: i2$1.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: i3.FsLabelComponent, selector: "fs-label" }, { type: i4.FsTextEditorComponent, selector: "fs-text-editor", inputs: ["config", "scrollable"], outputs: ["ready", "blur"] }], directives: [{ type: i2$1.SplitAreaDirective, selector: "as-split-area, [as-split-area]", inputs: ["order", "size", "minSize", "maxSize", "lockSize", "visible"], exportAs: ["asSplitArea"] }, { type: i9.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i9.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i5.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: i7.FsModelChangeDirective, selector: "[fsModelChange]", inputs: ["fsModelChangeOptions"], outputs: ["fsModelChange"] }, { type: i8.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
167
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: EditorComponent, decorators: [{
168
- type: Component,
169
- args: [{
170
- selector: 'app-editor',
171
- templateUrl: './editor.component.html',
172
- styleUrls: ['./editor.component.scss'],
173
- changeDetection: ChangeDetectionStrategy.OnPush,
174
- }]
175
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i2.FsMessage }]; }, propDecorators: { showHtml: [{
176
- type: Input
177
- }], showScss: [{
178
- type: Input
179
- }], showJs: [{
180
- type: Input
181
- }], showGlobalScss: [{
182
- type: Input
183
- }], html: [{
184
- type: Input
185
- }], scss: [{
186
- type: Input
187
- }], js: [{
188
- type: Input
189
- }], contentConfig: [{
190
- type: Input
191
- }], changed: [{
192
- type: Output
193
- }], focused: [{
194
- type: Output
195
- }], blured: [{
196
- type: Output
70
+ class EditorComponent {
71
+ constructor(_cdRef, _message) {
72
+ this._cdRef = _cdRef;
73
+ this._message = _message;
74
+ this.showHtml = false;
75
+ this.showScss = false;
76
+ this.showJs = false;
77
+ this.showGlobalScss = false;
78
+ this.changed = new EventEmitter();
79
+ this.focused = new EventEmitter();
80
+ this.blured = new EventEmitter();
81
+ this.changes = {};
82
+ this.EditorType = EditorType;
83
+ this.resizing = false;
84
+ this._destroy$ = new Subject();
85
+ }
86
+ ngOnInit() {
87
+ this.initTextEditors();
88
+ this.initGlobalContentStyle();
89
+ }
90
+ ngOnDestroy() {
91
+ this._destroy$.next();
92
+ this._destroy$.complete();
93
+ }
94
+ change(type, value) {
95
+ this.changed.emit({ type, value });
96
+ this.changes[type] = value;
97
+ }
98
+ get hasChanges() {
99
+ return Object.keys(this.changes)
100
+ .filter((name) => !!this.changes[name])
101
+ .length !== 0;
102
+ }
103
+ clearChange(type) {
104
+ this.changes[type] = null;
105
+ this._cdRef.markForCheck();
106
+ }
107
+ initTextEditors() {
108
+ this.scssConfig = {
109
+ tabSize: 2,
110
+ language: 'scss',
111
+ height: '100%',
112
+ focus: () => {
113
+ this.focused.emit(EditorType.Scss);
114
+ },
115
+ blur: () => {
116
+ this.blured.emit(EditorType.Scss);
117
+ },
118
+ };
119
+ this.jsConfig = {
120
+ tabSize: 2,
121
+ language: 'js',
122
+ height: '100%',
123
+ focus: () => {
124
+ this.focused.emit(EditorType.Js);
125
+ },
126
+ blur: () => {
127
+ this.blured.emit(EditorType.Js);
128
+ },
129
+ };
130
+ this.htmlConfig = {
131
+ tabSize: 2,
132
+ language: 'html',
133
+ height: '100%',
134
+ focus: () => {
135
+ this.focused.emit(EditorType.Html);
136
+ },
137
+ blur: () => {
138
+ this.blured.emit(EditorType.Html);
139
+ },
140
+ };
141
+ this.globalScssConfig = {
142
+ tabSize: 2,
143
+ language: 'scss',
144
+ height: '100%',
145
+ focus: () => {
146
+ this.focused.emit(EditorType.GlobalScss);
147
+ },
148
+ blur: () => {
149
+ this.blured.emit(EditorType.GlobalScss);
150
+ },
151
+ };
152
+ }
153
+ initGlobalContentStyle() {
154
+ this.contentConfig.loadContentStyle()
155
+ .subscribe((contentStyle) => {
156
+ this.contentStyle = contentStyle || {};
157
+ this._cdRef.markForCheck();
158
+ });
159
+ }
160
+ saveGlobalScss() {
161
+ return this.contentConfig.saveContentStyle(this.contentStyle)
162
+ .pipe(tap(() => {
163
+ this._message.success('Saved Changes');
164
+ }));
165
+ }
166
+ }
167
+ EditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: EditorComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i2.FsMessage }], target: i0.ɵɵFactoryTarget.Component });
168
+ EditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: EditorComponent, selector: "app-editor", inputs: { showHtml: "showHtml", showScss: "showScss", showJs: "showJs", showGlobalScss: "showGlobalScss", html: "html", scss: "scss", js: "js", contentConfig: "contentConfig" }, outputs: { changed: "changed", focused: "focused", blured: "blured" }, ngImport: i0, template: "<as-split [unit]=\"'percent'\" [gutterSize]=\"25\"> \n <as-split-area [size]=\"70\" [visible]=\"showHtml\" [order]=\"1\">\n <div class=\"editor-container\">\n <fs-label>HTML {{changes.html ? '*' : ''}}</fs-label>\n <fs-text-editor \n [(ngModel)]=\"html\" \n name=\"html\"\n [fsModelChangeOptions]=\"{ debounce: 0 }\"\n (fsModelChange)=\"change(EditorType.Html, $event)\"\n [config]=\"htmlConfig\">\n </fs-text-editor> \n </div>\n </as-split-area>\n <as-split-area [size]=\"30\" [visible]=\"showScss\" [order]=\"2\">\n <div class=\"editor-container\">\n <fs-label>SCSS {{changes.scss ? '*' : ''}}</fs-label>\n <fs-text-editor \n [(ngModel)]=\"scss\" \n name=\"scss\"\n [fsModelChangeOptions]=\"{ debounce: 0 }\"\n (fsModelChange)=\"change(EditorType.Scss, $event)\"\n [config]=\"scssConfig\">\n </fs-text-editor> \n </div>\n </as-split-area>\n <as-split-area [size]=\"30\" [visible]=\"showJs\" [order]=\"3\">\n <div class=\"editor-container\">\n <fs-label>JS {{changes.js ? '*' : ''}}</fs-label>\n <fs-text-editor \n [(ngModel)]=\"js\" \n name=\"js\"\n [fsModelChangeOptions]=\"{ debounce: 0 }\"\n (fsModelChange)=\"change(EditorType.Js, $event)\"\n [config]=\"jsConfig\">\n </fs-text-editor> \n </div>\n </as-split-area>\n <as-split-area [size]=\"30\" [visible]=\"showGlobalScss\" [order]=\"4\">\n <div class=\"editor-container\">\n <fs-label>Global SCSS {{changes.globalScss ? '*' : ''}}</fs-label>\n <ng-container *fsSkeleton=\"contentStyle\">\n <fs-text-editor \n [(ngModel)]=\"contentStyle.scss\" \n name=\"globalScss\"\n [fsModelChangeOptions]=\"{ debounce: 300 }\"\n (fsModelChange)=\"change(EditorType.GlobalScss, $event)\"\n [config]=\"globalScssConfig\">\n </fs-text-editor> \n </ng-container> \n </div>\n </as-split-area>\n</as-split>\n", styles: [":host ::ng-deep .as-split-gutter{background-color:unset!important}.editor-container{height:100%;border-radius:5px;display:flex;flex-direction:column}.editor-container fs-text-editor{flex:1}\n"], components: [{ type: i2$1.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: i3.FsLabelComponent, selector: "fs-label" }, { type: i4.FsTextEditorComponent, selector: "fs-text-editor", inputs: ["config", "scrollable"], outputs: ["ready", "blur"] }], directives: [{ type: i2$1.SplitAreaDirective, selector: "as-split-area, [as-split-area]", inputs: ["order", "size", "minSize", "maxSize", "lockSize", "visible"], exportAs: ["asSplitArea"] }, { type: i9.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i9.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i5.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: i7.FsModelChangeDirective, selector: "[fsModelChange]", inputs: ["fsModelChangeOptions"], outputs: ["fsModelChange"] }, { type: i8.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
169
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: EditorComponent, decorators: [{
170
+ type: Component,
171
+ args: [{
172
+ selector: 'app-editor',
173
+ templateUrl: './editor.component.html',
174
+ styleUrls: ['./editor.component.scss'],
175
+ changeDetection: ChangeDetectionStrategy.OnPush,
176
+ }]
177
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i2.FsMessage }]; }, propDecorators: { showHtml: [{
178
+ type: Input
179
+ }], showScss: [{
180
+ type: Input
181
+ }], showJs: [{
182
+ type: Input
183
+ }], showGlobalScss: [{
184
+ type: Input
185
+ }], html: [{
186
+ type: Input
187
+ }], scss: [{
188
+ type: Input
189
+ }], js: [{
190
+ type: Input
191
+ }], contentConfig: [{
192
+ type: Input
193
+ }], changed: [{
194
+ type: Output
195
+ }], focused: [{
196
+ type: Output
197
+ }], blured: [{
198
+ type: Output
197
199
  }] } });
198
200
 
199
- class FsContentEditorModule {
200
- }
201
- FsContentEditorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
202
- FsContentEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentEditorModule, declarations: [EditorComponent], imports: [CommonModule,
203
- FormsModule,
204
- MatDialogModule,
205
- MatButtonModule,
206
- MatTabsModule,
207
- MatIconModule,
208
- MatButtonToggleModule,
209
- FsListModule,
210
- FsFormModule,
211
- FsSkeletonModule,
212
- FsLabelModule,
213
- FsHtmlEditorModule,
214
- FsCommonModule,
215
- FsDialogModule,
216
- FsTextEditorModule,
217
- AngularSplitModule], exports: [EditorComponent] });
218
- FsContentEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentEditorModule, imports: [[
219
- CommonModule,
220
- FormsModule,
221
- MatDialogModule,
222
- MatButtonModule,
223
- MatTabsModule,
224
- MatIconModule,
225
- MatButtonToggleModule,
226
- FsListModule,
227
- FsFormModule,
228
- FsSkeletonModule,
229
- FsLabelModule,
230
- FsHtmlEditorModule,
231
- FsCommonModule,
232
- FsDialogModule,
233
- FsTextEditorModule,
234
- AngularSplitModule,
235
- ]] });
236
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentEditorModule, decorators: [{
237
- type: NgModule,
238
- args: [{
239
- imports: [
240
- CommonModule,
241
- FormsModule,
242
- MatDialogModule,
243
- MatButtonModule,
244
- MatTabsModule,
245
- MatIconModule,
246
- MatButtonToggleModule,
247
- FsListModule,
248
- FsFormModule,
249
- FsSkeletonModule,
250
- FsLabelModule,
251
- FsHtmlEditorModule,
252
- FsCommonModule,
253
- FsDialogModule,
254
- FsTextEditorModule,
255
- AngularSplitModule,
256
- ],
257
- exports: [
258
- EditorComponent,
259
- ],
260
- declarations: [
261
- EditorComponent,
262
- ],
263
- }]
201
+ class FsContentEditorModule {
202
+ }
203
+ FsContentEditorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
204
+ FsContentEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentEditorModule, declarations: [EditorComponent], imports: [CommonModule,
205
+ FormsModule,
206
+ MatDialogModule,
207
+ MatButtonModule,
208
+ MatTabsModule,
209
+ MatIconModule,
210
+ MatButtonToggleModule,
211
+ FsListModule,
212
+ FsFormModule,
213
+ FsSkeletonModule,
214
+ FsLabelModule,
215
+ FsHtmlEditorModule,
216
+ FsCommonModule,
217
+ FsDialogModule,
218
+ FsTextEditorModule,
219
+ AngularSplitModule], exports: [EditorComponent] });
220
+ FsContentEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentEditorModule, imports: [[
221
+ CommonModule,
222
+ FormsModule,
223
+ MatDialogModule,
224
+ MatButtonModule,
225
+ MatTabsModule,
226
+ MatIconModule,
227
+ MatButtonToggleModule,
228
+ FsListModule,
229
+ FsFormModule,
230
+ FsSkeletonModule,
231
+ FsLabelModule,
232
+ FsHtmlEditorModule,
233
+ FsCommonModule,
234
+ FsDialogModule,
235
+ FsTextEditorModule,
236
+ AngularSplitModule,
237
+ ]] });
238
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentEditorModule, decorators: [{
239
+ type: NgModule,
240
+ args: [{
241
+ imports: [
242
+ CommonModule,
243
+ FormsModule,
244
+ MatDialogModule,
245
+ MatButtonModule,
246
+ MatTabsModule,
247
+ MatIconModule,
248
+ MatButtonToggleModule,
249
+ FsListModule,
250
+ FsFormModule,
251
+ FsSkeletonModule,
252
+ FsLabelModule,
253
+ FsHtmlEditorModule,
254
+ FsCommonModule,
255
+ FsDialogModule,
256
+ FsTextEditorModule,
257
+ AngularSplitModule,
258
+ ],
259
+ exports: [
260
+ EditorComponent,
261
+ ],
262
+ declarations: [
263
+ EditorComponent,
264
+ ],
265
+ }]
264
266
  }] });
265
267
 
266
268
  const FS_CONTENT_CONFIG = new InjectionToken('fs-content-config');
267
269
 
268
- class ContentLayoutComponent {
269
- constructor(_config, _data, _dialogRef, _message, _cdRef) {
270
- this._config = _config;
271
- this._data = _data;
272
- this._dialogRef = _dialogRef;
273
- this._message = _message;
274
- this._cdRef = _cdRef;
275
- this.contentLayout = null;
276
- this.editors = { content: true, styles: true };
277
- this._destroy$ = new Subject();
278
- this.save = () => {
279
- return this._config.saveContentLayout(this.contentLayout)
280
- .pipe(tap((contentLayout) => {
281
- this._message.success('Saved Changes');
282
- this._dialogRef.close(contentLayout);
283
- }));
284
- };
285
- }
286
- ngOnInit() {
287
- this._fetchData();
288
- }
289
- ngOnDestroy() {
290
- this._destroy$.next();
291
- this._destroy$.complete();
292
- }
293
- _fetchData() {
294
- of(this._data.contentLayout)
295
- .pipe(switchMap((contentLayout) => {
296
- return of(contentLayout);
297
- }), takeUntil(this._destroy$))
298
- .subscribe((contentLayout) => {
299
- this.contentLayout = Object.assign({}, contentLayout);
300
- this._cdRef.markForCheck();
301
- });
302
- }
303
- }
304
- ContentLayoutComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentLayoutComponent, deps: [{ token: FS_CONTENT_CONFIG }, { token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }, { token: i2.FsMessage }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
305
- ContentLayoutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ContentLayoutComponent, selector: "ng-component", viewQueries: [{ propertyName: "textEditors", predicate: FsTextEditorComponent, descendants: true }], ngImport: i0, 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 <mat-label>Name</mat-label>\n <input\n matInput\n [(ngModel)]=\"contentLayout.name\"\n name=\"name\"\n required>\n </mat-form-field>\n <mat-form-field>\n <mat-label>Tag</mat-label>\n <input\n matInput\n [(ngModel)]=\"contentLayout.tag\"\n name=\"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$1.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileActionPlacement", "mobileWidth", "mode"] }, { type: i4$1.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i5.FsFormDialogActionsComponent, selector: "fs-form-dialog-actions", inputs: ["save", "create", "close", "done", "closeData", "name"] }], directives: [{ type: i8.FsSkeletonFormDirective, selector: "[fsSkeletonForm]", inputs: ["fsSkeletonForm", "fsSkeletonFormLines"] }, { type: i9.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i9.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i9.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5.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.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i4$1.MatLabel, selector: "mat-label" }, { type: i8$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: i9.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i9.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i9.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i9.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i5.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }, { type: i5.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.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
306
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentLayoutComponent, decorators: [{
307
- type: Component,
308
- args: [{
309
- templateUrl: './content-layout.component.html',
310
- styleUrls: ['./content-layout.component.scss'],
311
- changeDetection: ChangeDetectionStrategy.OnPush,
312
- }]
313
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
314
- type: Inject,
315
- args: [FS_CONTENT_CONFIG]
316
- }] }, { type: undefined, decorators: [{
317
- type: Inject,
318
- args: [MAT_DIALOG_DATA]
319
- }] }, { type: i1.MatDialogRef }, { type: i2.FsMessage }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { textEditors: [{
320
- type: ViewChildren,
321
- args: [FsTextEditorComponent]
270
+ class ContentLayoutComponent {
271
+ constructor(_config, _data, _dialogRef, _message, _cdRef) {
272
+ this._config = _config;
273
+ this._data = _data;
274
+ this._dialogRef = _dialogRef;
275
+ this._message = _message;
276
+ this._cdRef = _cdRef;
277
+ this.contentLayout = null;
278
+ this.editors = { content: true, styles: true };
279
+ this._destroy$ = new Subject();
280
+ this.save = () => {
281
+ return this._config.saveContentLayout(this.contentLayout)
282
+ .pipe(tap((contentLayout) => {
283
+ this._message.success('Saved Changes');
284
+ this._dialogRef.close(contentLayout);
285
+ }));
286
+ };
287
+ }
288
+ ngOnInit() {
289
+ this._fetchData();
290
+ }
291
+ ngOnDestroy() {
292
+ this._destroy$.next();
293
+ this._destroy$.complete();
294
+ }
295
+ _fetchData() {
296
+ of(this._data.contentLayout)
297
+ .pipe(switchMap((contentLayout) => {
298
+ return of(contentLayout);
299
+ }), takeUntil(this._destroy$))
300
+ .subscribe((contentLayout) => {
301
+ this.contentLayout = Object.assign({}, contentLayout);
302
+ this._cdRef.markForCheck();
303
+ });
304
+ }
305
+ }
306
+ ContentLayoutComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentLayoutComponent, deps: [{ token: FS_CONTENT_CONFIG }, { token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }, { token: i2.FsMessage }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
307
+ ContentLayoutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ContentLayoutComponent, selector: "ng-component", viewQueries: [{ propertyName: "textEditors", predicate: FsTextEditorComponent, descendants: true }], ngImport: i0, 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 <mat-label>Name</mat-label>\n <input\n matInput\n [(ngModel)]=\"contentLayout.name\"\n name=\"name\"\n required>\n </mat-form-field>\n <mat-form-field>\n <mat-label>Tag</mat-label>\n <input\n matInput\n [(ngModel)]=\"contentLayout.tag\"\n name=\"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$1.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileActionPlacement", "mobileWidth", "mode"] }, { type: i4$1.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i5.FsFormDialogActionsComponent, selector: "fs-form-dialog-actions", inputs: ["save", "create", "close", "done", "closeData", "name"] }], directives: [{ type: i8.FsSkeletonFormDirective, selector: "[fsSkeletonForm]", inputs: ["fsSkeletonForm", "fsSkeletonFormLines"] }, { type: i9.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i9.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i9.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5.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.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i4$1.MatLabel, selector: "mat-label" }, { type: i8$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: i9.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i9.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i9.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i9.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i5.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }, { type: i5.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.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
308
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentLayoutComponent, decorators: [{
309
+ type: Component,
310
+ args: [{
311
+ templateUrl: './content-layout.component.html',
312
+ styleUrls: ['./content-layout.component.scss'],
313
+ changeDetection: ChangeDetectionStrategy.OnPush,
314
+ }]
315
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
316
+ type: Inject,
317
+ args: [FS_CONTENT_CONFIG]
318
+ }] }, { type: undefined, decorators: [{
319
+ type: Inject,
320
+ args: [MAT_DIALOG_DATA]
321
+ }] }, { type: i1.MatDialogRef }, { type: i2.FsMessage }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { textEditors: [{
322
+ type: ViewChildren,
323
+ args: [FsTextEditorComponent]
322
324
  }] } });
323
325
 
324
- class ContentLayoutEditorComponent {
325
- constructor(_data, _dialogRef, _message, _dialog, _cdRef, _prompt) {
326
- this._data = _data;
327
- this._dialogRef = _dialogRef;
328
- this._message = _message;
329
- this._dialog = _dialog;
330
- this._cdRef = _cdRef;
331
- this._prompt = _prompt;
332
- this.EditorType = EditorType;
333
- this.focused = null;
334
- this.editors = {
335
- [EditorType.Html]: true,
336
- [EditorType.Scss]: true,
337
- [EditorType.GlobalScss]: false,
338
- };
339
- this._destroy$ = new Subject();
340
- this.save = () => {
341
- return of(null)
342
- .pipe(filter(() => this.focused), switchMap(() => {
343
- switch (this.focused) {
344
- case EditorType.Html:
345
- case EditorType.Scss:
346
- return this.saveContentPage();
347
- case EditorType.GlobalScss:
348
- return this.editor.saveGlobalScss();
349
- }
350
- return throwError('Invalid focus');
351
- }), tap(() => {
352
- this.editor.clearChange(this.focused);
353
- this._cdRef.markForCheck();
354
- }));
355
- };
356
- }
357
- ngOnInit() {
358
- this._dialogRef.addPanelClass('fs-content-editor-overlay-pane');
359
- this._dialogRef.disableClose = true;
360
- this.config = this._data.contentConfig;
361
- this._initContentLayout(this._data.contentLayout);
362
- this._initEscape();
363
- }
364
- editorToggleChange(event) {
365
- this.editors[event.value] = !this.editors[event.value];
366
- }
367
- ngOnDestroy() {
368
- this._destroy$.next();
369
- this._destroy$.complete();
370
- }
371
- _initContentLayout(contentLayout) {
372
- this.config.loadContentLayout(contentLayout.id)
373
- .subscribe((data) => {
374
- this.contentLayout = data;
375
- this._cdRef.markForCheck();
376
- });
377
- }
378
- editorFocused(type) {
379
- this.focused = type;
380
- }
381
- saveContentPage() {
382
- const names = {
383
- [EditorType.Scss]: 'styles',
384
- [EditorType.Html]: 'content',
385
- };
386
- const data = {
387
- id: this.contentLayout.id,
388
- [names[this.focused]]: this.editor.changes[this.focused],
389
- };
390
- return this.config.saveContentLayout(Object.assign({ id: this.contentLayout.id }, data))
391
- .pipe(tap(() => {
392
- this._message.success('Saved Changes');
393
- }));
394
- }
395
- close() {
396
- if (!this.editor.hasChanges) {
397
- return this._dialogRef.close();
398
- }
399
- this._prompt.confirm({
400
- dialogConfig: {
401
- width: null,
402
- },
403
- title: 'You have unsaved changes',
404
- template: 'What would you like to do with your changes?',
405
- buttons: [
406
- {
407
- label: 'Review Changes',
408
- value: 'review',
409
- },
410
- {
411
- label: 'Discard Changes',
412
- value: 'discard',
413
- },
414
- ],
415
- })
416
- .pipe(takeUntil(this._destroy$))
417
- .subscribe((value) => {
418
- if (value === 'discard') {
419
- this._dialogRef.close();
420
- }
421
- });
422
- }
423
- openSettings() {
424
- this._dialog.open(ContentLayoutComponent, {
425
- data: {
426
- contentLayout: this.contentLayout,
427
- },
428
- })
429
- .afterClosed()
430
- .pipe(takeUntil(this._destroy$))
431
- .subscribe((contentLayout) => {
432
- this.contentLayout = Object.assign(Object.assign({}, this.contentLayout), contentLayout);
433
- this._cdRef.markForCheck();
434
- });
435
- }
436
- _initEscape() {
437
- fromEvent(document, 'keydown')
438
- .pipe(filter((event) => event.code === 'Escape'), takeUntil(this._destroy$)).subscribe(() => {
439
- const dialogRef = this._dialog.openDialogs.reverse()[0];
440
- if ((dialogRef === null || dialogRef === void 0 ? void 0 : dialogRef.componentInstance) === this) {
441
- this.close();
442
- }
443
- });
444
- }
445
- }
446
- ContentLayoutEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentLayoutEditorComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }, { token: i2.FsMessage }, { token: i1.MatDialog }, { token: i0.ChangeDetectorRef }, { token: i3$2.FsPrompt }], target: i0.ɵɵFactoryTarget.Component });
447
- ContentLayoutEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ContentLayoutEditorComponent, selector: "ng-component", viewQueries: [{ propertyName: "editor", first: true, predicate: EditorComponent, descendants: true }], ngImport: i0, template: "<form fsForm [submit]=\"save\" [dirtySubmitButton]=\"false\" [confirm]=\"false\">\n <fs-dialog *fsSkeletonForm=\"contentLayout\">\n <h1 mat-dialog-title>\n <div class=\"title-container\">\n <div class=\"title\">\n Layout Editor\n <div class=\"small\">{{contentLayout.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 <app-editor\n [contentConfig]=\"config\"\n [showHtml]=\"editors.html\"\n [showScss]=\"editors.scss\"\n [showGlobalScss]=\"editors.globalScss\"\n [html]=\"contentLayout.content\"\n [scss]=\"contentLayout.styles\"\n (focused)=\"editorFocused($event)\">\n </app-editor>\n </div>\n\n <div mat-dialog-actions>\n <button \n mat-button\n color=\"primary\"\n (click)=\"close()\"\n type=\"button\"> \n Done \n </button>\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=\"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</form>", styles: ["::ng-deep .fs-content-editor-overlay-pane .mat-dialog-container{border-radius:0}form{height:100%}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 .toggles{display:flex;justify-content:flex-end;justify-self:baseline;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$1.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileActionPlacement", "mobileWidth", "mode"] }, { type: i5$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: i6.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: EditorComponent, selector: "app-editor", inputs: ["showHtml", "showScss", "showJs", "showGlobalScss", "html", "scss", "js", "contentConfig"], outputs: ["changed", "focused", "blured"] }, { type: i5$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i8$2.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.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i9.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i9.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5.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: i8.FsSkeletonFormDirective, selector: "[fsSkeletonForm]", inputs: ["fsSkeletonForm", "fsSkeletonFormLines"] }, { type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i5.FsButtonDirective, selector: "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", inputs: ["name", "dirtySubmit", "form"] }, { type: i8$2.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
448
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentLayoutEditorComponent, decorators: [{
449
- type: Component,
450
- args: [{
451
- templateUrl: './content-layout-editor.component.html',
452
- styleUrls: ['./content-layout-editor.component.scss'],
453
- changeDetection: ChangeDetectionStrategy.OnPush,
454
- }]
455
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
456
- type: Inject,
457
- args: [MAT_DIALOG_DATA]
458
- }] }, { type: i1.MatDialogRef }, { type: i2.FsMessage }, { type: i1.MatDialog }, { type: i0.ChangeDetectorRef }, { type: i3$2.FsPrompt }]; }, propDecorators: { editor: [{
459
- type: ViewChild,
460
- args: [EditorComponent]
326
+ class ContentLayoutEditorComponent {
327
+ constructor(_data, _dialogRef, _message, _dialog, _cdRef, _prompt) {
328
+ this._data = _data;
329
+ this._dialogRef = _dialogRef;
330
+ this._message = _message;
331
+ this._dialog = _dialog;
332
+ this._cdRef = _cdRef;
333
+ this._prompt = _prompt;
334
+ this.EditorType = EditorType;
335
+ this.focused = null;
336
+ this.editors = {
337
+ [EditorType.Html]: true,
338
+ [EditorType.Scss]: true,
339
+ [EditorType.GlobalScss]: false,
340
+ };
341
+ this._destroy$ = new Subject();
342
+ this.save = () => {
343
+ return of(null)
344
+ .pipe(filter(() => this.focused), switchMap(() => {
345
+ switch (this.focused) {
346
+ case EditorType.Html:
347
+ case EditorType.Scss:
348
+ return this.saveContentPage();
349
+ case EditorType.GlobalScss:
350
+ return this.editor.saveGlobalScss();
351
+ }
352
+ return throwError('Invalid focus');
353
+ }), tap(() => {
354
+ this.editor.clearChange(this.focused);
355
+ this._cdRef.markForCheck();
356
+ }));
357
+ };
358
+ }
359
+ ngOnInit() {
360
+ this._dialogRef.addPanelClass('fs-content-editor-overlay-pane');
361
+ this._dialogRef.disableClose = true;
362
+ this.config = this._data.contentConfig;
363
+ this._initContentLayout(this._data.contentLayout);
364
+ this._initEscape();
365
+ }
366
+ editorToggleChange(event) {
367
+ this.editors[event.value] = !this.editors[event.value];
368
+ }
369
+ ngOnDestroy() {
370
+ this._destroy$.next();
371
+ this._destroy$.complete();
372
+ }
373
+ _initContentLayout(contentLayout) {
374
+ this.config.loadContentLayout(contentLayout.id)
375
+ .subscribe((data) => {
376
+ this.contentLayout = data;
377
+ this._cdRef.markForCheck();
378
+ });
379
+ }
380
+ editorFocused(type) {
381
+ this.focused = type;
382
+ }
383
+ saveContentPage() {
384
+ const names = {
385
+ [EditorType.Scss]: 'styles',
386
+ [EditorType.Html]: 'content',
387
+ };
388
+ const data = {
389
+ id: this.contentLayout.id,
390
+ [names[this.focused]]: this.editor.changes[this.focused],
391
+ };
392
+ return this.config.saveContentLayout(Object.assign({ id: this.contentLayout.id }, data))
393
+ .pipe(tap(() => {
394
+ this._message.success('Saved Changes');
395
+ }));
396
+ }
397
+ close() {
398
+ if (!this.editor.hasChanges) {
399
+ return this._dialogRef.close();
400
+ }
401
+ this._prompt.confirm({
402
+ dialogConfig: {
403
+ width: null,
404
+ },
405
+ title: 'You have unsaved changes',
406
+ template: 'What would you like to do with your changes?',
407
+ buttons: [
408
+ {
409
+ label: 'Review Changes',
410
+ value: 'review',
411
+ },
412
+ {
413
+ label: 'Discard Changes',
414
+ value: 'discard',
415
+ },
416
+ ],
417
+ })
418
+ .pipe(takeUntil(this._destroy$))
419
+ .subscribe((value) => {
420
+ if (value === 'discard') {
421
+ this._dialogRef.close();
422
+ }
423
+ });
424
+ }
425
+ openSettings() {
426
+ this._dialog.open(ContentLayoutComponent, {
427
+ data: {
428
+ contentLayout: this.contentLayout,
429
+ },
430
+ })
431
+ .afterClosed()
432
+ .pipe(takeUntil(this._destroy$))
433
+ .subscribe((contentLayout) => {
434
+ this.contentLayout = Object.assign(Object.assign({}, this.contentLayout), contentLayout);
435
+ this._cdRef.markForCheck();
436
+ });
437
+ }
438
+ _initEscape() {
439
+ fromEvent(document, 'keydown')
440
+ .pipe(filter((event) => event.code === 'Escape'), takeUntil(this._destroy$)).subscribe(() => {
441
+ const dialogRef = this._dialog.openDialogs.reverse()[0];
442
+ if ((dialogRef === null || dialogRef === void 0 ? void 0 : dialogRef.componentInstance) === this) {
443
+ this.close();
444
+ }
445
+ });
446
+ }
447
+ }
448
+ ContentLayoutEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentLayoutEditorComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }, { token: i2.FsMessage }, { token: i1.MatDialog }, { token: i0.ChangeDetectorRef }, { token: i3$2.FsPrompt }], target: i0.ɵɵFactoryTarget.Component });
449
+ ContentLayoutEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ContentLayoutEditorComponent, selector: "ng-component", viewQueries: [{ propertyName: "editor", first: true, predicate: EditorComponent, descendants: true }], ngImport: i0, template: "<form fsForm [submit]=\"save\" [dirtySubmitButton]=\"false\" [confirm]=\"false\">\n <fs-dialog *fsSkeletonForm=\"contentLayout\">\n <h1 mat-dialog-title>\n <div class=\"title-container\">\n <div class=\"title\">\n Layout Editor\n <div class=\"small\">{{contentLayout.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 <app-editor\n [contentConfig]=\"config\"\n [showHtml]=\"editors.html\"\n [showScss]=\"editors.scss\"\n [showGlobalScss]=\"editors.globalScss\"\n [html]=\"contentLayout.content\"\n [scss]=\"contentLayout.styles\"\n (focused)=\"editorFocused($event)\">\n </app-editor>\n </div>\n\n <div mat-dialog-actions>\n <button \n mat-button\n color=\"primary\"\n (click)=\"close()\"\n type=\"button\"> \n Done \n </button>\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=\"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</form>", styles: ["::ng-deep .fs-content-editor-overlay-pane .mat-dialog-container{border-radius:0}form{height:100%}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 .toggles{display:flex;justify-content:flex-end;justify-self:baseline;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$1.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileActionPlacement", "mobileWidth", "mode"] }, { type: i5$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: i6.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: EditorComponent, selector: "app-editor", inputs: ["showHtml", "showScss", "showJs", "showGlobalScss", "html", "scss", "js", "contentConfig"], outputs: ["changed", "focused", "blured"] }, { type: i5$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i8$2.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.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i9.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i9.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5.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: i8.FsSkeletonFormDirective, selector: "[fsSkeletonForm]", inputs: ["fsSkeletonForm", "fsSkeletonFormLines"] }, { type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i5.FsButtonDirective, selector: "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", inputs: ["name", "dirtySubmit", "form"] }, { type: i8$2.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
450
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentLayoutEditorComponent, decorators: [{
451
+ type: Component,
452
+ args: [{
453
+ templateUrl: './content-layout-editor.component.html',
454
+ styleUrls: ['./content-layout-editor.component.scss'],
455
+ changeDetection: ChangeDetectionStrategy.OnPush,
456
+ }]
457
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
458
+ type: Inject,
459
+ args: [MAT_DIALOG_DATA]
460
+ }] }, { type: i1.MatDialogRef }, { type: i2.FsMessage }, { type: i1.MatDialog }, { type: i0.ChangeDetectorRef }, { type: i3$2.FsPrompt }]; }, propDecorators: { editor: [{
461
+ type: ViewChild,
462
+ args: [EditorComponent]
461
463
  }] } });
462
464
 
463
- class FsContentLayoutsComponent {
464
- constructor(_config, _dialog) {
465
- this._config = _config;
466
- this._dialog = _dialog;
467
- this._destroy$ = new Subject();
468
- }
469
- ngOnInit() {
470
- this._initListConfig();
471
- }
472
- openEditor(contentLayout) {
473
- this._dialog.open(ContentLayoutEditorComponent, {
474
- maxWidth: '100vw',
475
- width: '100%',
476
- height: '100%',
477
- data: {
478
- contentLayout,
479
- contentConfig: this._config,
480
- },
481
- })
482
- .afterClosed()
483
- .pipe(takeUntil(this._destroy$))
484
- .subscribe(() => {
485
- this.listComponent.reload();
486
- });
487
- }
488
- openLayout(contentLayout) {
489
- return this._dialog.open(ContentLayoutComponent, {
490
- data: {
491
- contentLayout,
492
- },
493
- })
494
- .afterClosed()
495
- .pipe(filter((_contentLayout) => !!_contentLayout), takeUntil(this._destroy$));
496
- }
497
- ngOnDestroy() {
498
- this._destroy$.next();
499
- this._destroy$.complete();
500
- }
501
- _initListConfig() {
502
- this.listConfig = {
503
- paging: false,
504
- filters: [
505
- {
506
- name: 'keyword',
507
- type: ItemType.Keyword,
508
- label: 'Search',
509
- },
510
- ],
511
- actions: [
512
- {
513
- label: 'Create',
514
- click: () => {
515
- this.openLayout({})
516
- .subscribe(() => {
517
- this.listComponent.reload();
518
- });
519
- },
520
- },
521
- ],
522
- rowActions: [
523
- {
524
- click: (data) => {
525
- return this._config.deleteContentLayout(data);
526
- },
527
- remove: {
528
- title: 'Confirm',
529
- template: 'Are you sure you would like to delete this record?',
530
- },
531
- menu: true,
532
- label: 'Delete',
533
- },
534
- ],
535
- fetch: (query) => {
536
- return this._config.loadContentLayouts(query)
537
- .pipe(map((contentLayouts) => {
538
- return { data: contentLayouts };
539
- }));
540
- },
541
- restore: {
542
- query: { state: 'deleted' },
543
- filterLabel: 'Show Deleted',
544
- menuLabel: 'Restore',
545
- reload: true,
546
- click: (row) => {
547
- return this._config.saveContentLayout({ id: row.id, state: 'active' });
548
- },
549
- },
550
- };
551
- }
552
- }
553
- FsContentLayoutsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentLayoutsComponent, deps: [{ token: FS_CONTENT_CONFIG }, { token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
554
- FsContentLayoutsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsContentLayoutsComponent, selector: "fs-content-layouts", viewQueries: [{ propertyName: "listComponent", first: true, predicate: FsListComponent, descendants: true }], ngImport: i0, 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$2.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }], directives: [{ type: i2$2.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i2$2.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }], pipes: { "fsDate": i3$3.FsDatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
555
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentLayoutsComponent, decorators: [{
556
- type: Component,
557
- args: [{
558
- selector: 'fs-content-layouts',
559
- templateUrl: './content-layouts.component.html',
560
- styleUrls: ['./content-layouts.component.scss'],
561
- changeDetection: ChangeDetectionStrategy.OnPush,
562
- }]
563
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
564
- type: Inject,
565
- args: [FS_CONTENT_CONFIG]
566
- }] }, { type: i1.MatDialog }]; }, propDecorators: { listComponent: [{
567
- type: ViewChild,
568
- args: [FsListComponent]
465
+ class FsContentLayoutsComponent {
466
+ constructor(_config, _dialog) {
467
+ this._config = _config;
468
+ this._dialog = _dialog;
469
+ this._destroy$ = new Subject();
470
+ }
471
+ ngOnInit() {
472
+ this._initListConfig();
473
+ }
474
+ openEditor(contentLayout) {
475
+ this._dialog.open(ContentLayoutEditorComponent, {
476
+ maxWidth: '100vw',
477
+ width: '100%',
478
+ height: '100%',
479
+ data: {
480
+ contentLayout,
481
+ contentConfig: this._config,
482
+ },
483
+ })
484
+ .afterClosed()
485
+ .pipe(takeUntil(this._destroy$))
486
+ .subscribe(() => {
487
+ this.listComponent.reload();
488
+ });
489
+ }
490
+ openLayout(contentLayout) {
491
+ return this._dialog.open(ContentLayoutComponent, {
492
+ data: {
493
+ contentLayout,
494
+ },
495
+ })
496
+ .afterClosed()
497
+ .pipe(filter((_contentLayout) => !!_contentLayout), takeUntil(this._destroy$));
498
+ }
499
+ ngOnDestroy() {
500
+ this._destroy$.next();
501
+ this._destroy$.complete();
502
+ }
503
+ _initListConfig() {
504
+ this.listConfig = {
505
+ paging: false,
506
+ filters: [
507
+ {
508
+ name: 'keyword',
509
+ type: ItemType.Keyword,
510
+ label: 'Search',
511
+ },
512
+ ],
513
+ actions: [
514
+ {
515
+ label: 'Create',
516
+ click: () => {
517
+ this.openLayout({})
518
+ .subscribe(() => {
519
+ this.listComponent.reload();
520
+ });
521
+ },
522
+ },
523
+ ],
524
+ rowActions: [
525
+ {
526
+ click: (data) => {
527
+ return this._config.deleteContentLayout(data);
528
+ },
529
+ remove: {
530
+ title: 'Confirm',
531
+ template: 'Are you sure you would like to delete this record?',
532
+ },
533
+ menu: true,
534
+ label: 'Delete',
535
+ },
536
+ ],
537
+ fetch: (query) => {
538
+ return this._config.loadContentLayouts(query)
539
+ .pipe(map((contentLayouts) => {
540
+ return { data: contentLayouts };
541
+ }));
542
+ },
543
+ restore: {
544
+ query: { state: 'deleted' },
545
+ filterLabel: 'Show Deleted',
546
+ menuLabel: 'Restore',
547
+ reload: true,
548
+ click: (row) => {
549
+ return this._config.saveContentLayout({ id: row.id, state: 'active' });
550
+ },
551
+ },
552
+ };
553
+ }
554
+ }
555
+ FsContentLayoutsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentLayoutsComponent, deps: [{ token: FS_CONTENT_CONFIG }, { token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
556
+ FsContentLayoutsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsContentLayoutsComponent, selector: "fs-content-layouts", viewQueries: [{ propertyName: "listComponent", first: true, predicate: FsListComponent, descendants: true }], ngImport: i0, 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$2.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }], directives: [{ type: i2$2.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i2$2.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }], pipes: { "fsDate": i3$3.FsDatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
557
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentLayoutsComponent, decorators: [{
558
+ type: Component,
559
+ args: [{
560
+ selector: 'fs-content-layouts',
561
+ templateUrl: './content-layouts.component.html',
562
+ styleUrls: ['./content-layouts.component.scss'],
563
+ changeDetection: ChangeDetectionStrategy.OnPush,
564
+ }]
565
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
566
+ type: Inject,
567
+ args: [FS_CONTENT_CONFIG]
568
+ }] }, { type: i1.MatDialog }]; }, propDecorators: { listComponent: [{
569
+ type: ViewChild,
570
+ args: [FsListComponent]
569
571
  }] } });
570
572
 
571
- class FsContentLayoutsModule {
572
- }
573
- FsContentLayoutsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentLayoutsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
574
- FsContentLayoutsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentLayoutsModule, declarations: [ContentLayoutComponent,
575
- FsContentLayoutsComponent,
576
- ContentLayoutEditorComponent], imports: [CommonModule,
577
- FormsModule,
578
- MatDialogModule,
579
- MatInputModule,
580
- MatFormFieldModule,
581
- MatButtonModule,
582
- MatTabsModule,
583
- MatIconModule,
584
- MatSelectModule,
585
- MatButtonToggleModule,
586
- FsListModule,
587
- FsDateModule,
588
- FsFormModule,
589
- FsLabelModule,
590
- FsSkeletonModule,
591
- FsHtmlEditorModule,
592
- FsDialogModule,
593
- FsTextEditorModule,
594
- FsContentEditorModule], exports: [FsContentLayoutsComponent] });
595
- FsContentLayoutsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentLayoutsModule, imports: [[
596
- CommonModule,
597
- FormsModule,
598
- MatDialogModule,
599
- MatInputModule,
600
- MatFormFieldModule,
601
- MatButtonModule,
602
- MatTabsModule,
603
- MatIconModule,
604
- MatSelectModule,
605
- MatButtonToggleModule,
606
- FsListModule,
607
- FsDateModule,
608
- FsFormModule,
609
- FsLabelModule,
610
- FsSkeletonModule,
611
- FsHtmlEditorModule,
612
- FsDialogModule,
613
- FsTextEditorModule,
614
- FsContentEditorModule,
615
- ]] });
616
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentLayoutsModule, decorators: [{
617
- type: NgModule,
618
- args: [{
619
- imports: [
620
- CommonModule,
621
- FormsModule,
622
- MatDialogModule,
623
- MatInputModule,
624
- MatFormFieldModule,
625
- MatButtonModule,
626
- MatTabsModule,
627
- MatIconModule,
628
- MatSelectModule,
629
- MatButtonToggleModule,
630
- FsListModule,
631
- FsDateModule,
632
- FsFormModule,
633
- FsLabelModule,
634
- FsSkeletonModule,
635
- FsHtmlEditorModule,
636
- FsDialogModule,
637
- FsTextEditorModule,
638
- FsContentEditorModule,
639
- ],
640
- exports: [
641
- FsContentLayoutsComponent,
642
- ],
643
- declarations: [
644
- ContentLayoutComponent,
645
- FsContentLayoutsComponent,
646
- ContentLayoutEditorComponent,
647
- ],
648
- }]
573
+ class FsContentLayoutsModule {
574
+ }
575
+ FsContentLayoutsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentLayoutsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
576
+ FsContentLayoutsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentLayoutsModule, declarations: [ContentLayoutComponent,
577
+ FsContentLayoutsComponent,
578
+ ContentLayoutEditorComponent], imports: [CommonModule,
579
+ FormsModule,
580
+ MatDialogModule,
581
+ MatInputModule,
582
+ MatFormFieldModule,
583
+ MatButtonModule,
584
+ MatTabsModule,
585
+ MatIconModule,
586
+ MatSelectModule,
587
+ MatButtonToggleModule,
588
+ FsListModule,
589
+ FsDateModule,
590
+ FsFormModule,
591
+ FsLabelModule,
592
+ FsSkeletonModule,
593
+ FsHtmlEditorModule,
594
+ FsDialogModule,
595
+ FsTextEditorModule,
596
+ FsContentEditorModule], exports: [FsContentLayoutsComponent] });
597
+ FsContentLayoutsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentLayoutsModule, imports: [[
598
+ CommonModule,
599
+ FormsModule,
600
+ MatDialogModule,
601
+ MatInputModule,
602
+ MatFormFieldModule,
603
+ MatButtonModule,
604
+ MatTabsModule,
605
+ MatIconModule,
606
+ MatSelectModule,
607
+ MatButtonToggleModule,
608
+ FsListModule,
609
+ FsDateModule,
610
+ FsFormModule,
611
+ FsLabelModule,
612
+ FsSkeletonModule,
613
+ FsHtmlEditorModule,
614
+ FsDialogModule,
615
+ FsTextEditorModule,
616
+ FsContentEditorModule,
617
+ ]] });
618
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentLayoutsModule, decorators: [{
619
+ type: NgModule,
620
+ args: [{
621
+ imports: [
622
+ CommonModule,
623
+ FormsModule,
624
+ MatDialogModule,
625
+ MatInputModule,
626
+ MatFormFieldModule,
627
+ MatButtonModule,
628
+ MatTabsModule,
629
+ MatIconModule,
630
+ MatSelectModule,
631
+ MatButtonToggleModule,
632
+ FsListModule,
633
+ FsDateModule,
634
+ FsFormModule,
635
+ FsLabelModule,
636
+ FsSkeletonModule,
637
+ FsHtmlEditorModule,
638
+ FsDialogModule,
639
+ FsTextEditorModule,
640
+ FsContentEditorModule,
641
+ ],
642
+ exports: [
643
+ FsContentLayoutsComponent,
644
+ ],
645
+ declarations: [
646
+ ContentLayoutComponent,
647
+ FsContentLayoutsComponent,
648
+ ContentLayoutEditorComponent,
649
+ ],
650
+ }]
649
651
  }] });
650
652
 
651
- const PageTypes = [
652
- { name: 'Standard Page', value: PageType.StandardPage },
653
- { name: 'Home Page', value: PageType.HomePage },
654
- { name: 'Not Found Page', value: PageType.NotFoundPage },
655
- { name: 'Blog Post', value: PageType.BlogPost },
653
+ const PageTypes = [
654
+ { name: 'Standard Page', value: PageType.StandardPage },
655
+ { name: 'Home Page', value: PageType.HomePage },
656
+ { name: 'Not Found Page', value: PageType.NotFoundPage },
657
+ { name: 'Blog Post', value: PageType.BlogPost },
656
658
  ];
657
659
 
658
- class ContentPageComponent {
659
- constructor(_config, _data, _dialogRef, _message, _cdRef) {
660
- this._config = _config;
661
- this._data = _data;
662
- this._dialogRef = _dialogRef;
663
- this._message = _message;
664
- this._cdRef = _cdRef;
665
- this.contentPage = null;
666
- this.PageTypes = PageTypes;
667
- this.editors = { content: true, styles: true };
668
- this._destroy$ = new Subject();
669
- this.save = () => {
670
- return this._config.saveContentPage(this.contentPage)
671
- .pipe(tap((contentPage) => {
672
- this._message.success('Saved Changes');
673
- this._dialogRef.close(contentPage);
674
- }));
675
- };
676
- }
677
- ngOnInit() {
678
- this._dialogRef.updateSize('600px');
679
- this._fetchData();
680
- }
681
- ngOnDestroy() {
682
- this._destroy$.next();
683
- this._destroy$.complete();
684
- }
685
- _fetchData() {
686
- this._config.loadContentLayouts()
687
- .subscribe((contentLayouts) => {
688
- this.contentLayouts = contentLayouts;
689
- this._cdRef.markForCheck();
690
- });
691
- of(this._data.contentPage)
692
- .pipe(switchMap((contentPage) => {
693
- return of(contentPage);
694
- }), takeUntil(this._destroy$))
695
- .subscribe((contentPage) => {
696
- this.contentPage = Object.assign({}, contentPage);
697
- this._cdRef.markForCheck();
698
- });
699
- }
700
- }
701
- ContentPageComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentPageComponent, deps: [{ token: FS_CONTENT_CONFIG }, { token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }, { token: i2.FsMessage }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
702
- ContentPageComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ContentPageComponent, selector: "ng-component", viewQueries: [{ propertyName: "textEditors", predicate: FsTextEditorComponent, descendants: true }], ngImport: i0, 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-label>Type</mat-label>\n <mat-select\n [(ngModel)]=\"contentPage.type\"\n name=\"type\"\n required>\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-label>Layout</mat-label>\n <mat-select\n [(ngModel)]=\"contentPage.contentLayoutId\"\n required\n name=\"contentLayoutId\">\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 <mat-label>Name</mat-label>\n <input\n matInput\n [(ngModel)]=\"contentPage.name\"\n name=\"name\"\n required>\n </mat-form-field>\n <mat-form-field>\n <mat-label>Path</mat-label>\n <input\n matInput\n [(ngModel)]=\"contentPage.path\"\n name=\"path\"\n required>\n </mat-form-field>\n <mat-form-field>\n <mat-label>Title</mat-label>\n <input\n matInput\n [(ngModel)]=\"contentPage.title\"\n name=\"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$1.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileActionPlacement", "mobileWidth", "mode"] }, { type: i4$1.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i5$2.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i6$1.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i5.FsFormDialogActionsComponent, selector: "fs-form-dialog-actions", inputs: ["save", "create", "close", "done", "closeData", "name"] }], directives: [{ type: i8.FsSkeletonFormDirective, selector: "[fsSkeletonForm]", inputs: ["fsSkeletonForm", "fsSkeletonFormLines"] }, { type: i9.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i9.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i9.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5.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.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i4$1.MatLabel, selector: "mat-label" }, { type: i9.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i9.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i9.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i5.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }, { type: i10.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i8$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: i9.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i5.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.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
703
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentPageComponent, decorators: [{
704
- type: Component,
705
- args: [{
706
- templateUrl: './content-page.component.html',
707
- styleUrls: ['./content-page.component.scss'],
708
- changeDetection: ChangeDetectionStrategy.OnPush,
709
- }]
710
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
711
- type: Inject,
712
- args: [FS_CONTENT_CONFIG]
713
- }] }, { type: undefined, decorators: [{
714
- type: Inject,
715
- args: [MAT_DIALOG_DATA]
716
- }] }, { type: i1.MatDialogRef }, { type: i2.FsMessage }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { textEditors: [{
717
- type: ViewChildren,
718
- args: [FsTextEditorComponent]
660
+ class ContentPageComponent {
661
+ constructor(_config, _data, _dialogRef, _message, _cdRef) {
662
+ this._config = _config;
663
+ this._data = _data;
664
+ this._dialogRef = _dialogRef;
665
+ this._message = _message;
666
+ this._cdRef = _cdRef;
667
+ this.contentPage = null;
668
+ this.PageTypes = PageTypes;
669
+ this.editors = { content: true, styles: true };
670
+ this._destroy$ = new Subject();
671
+ this.save = () => {
672
+ return this._config.saveContentPage(this.contentPage)
673
+ .pipe(tap((contentPage) => {
674
+ this._message.success('Saved Changes');
675
+ this._dialogRef.close(contentPage);
676
+ }));
677
+ };
678
+ }
679
+ ngOnInit() {
680
+ this._dialogRef.updateSize('600px');
681
+ this._fetchData();
682
+ }
683
+ ngOnDestroy() {
684
+ this._destroy$.next();
685
+ this._destroy$.complete();
686
+ }
687
+ _fetchData() {
688
+ this._config.loadContentLayouts()
689
+ .subscribe((contentLayouts) => {
690
+ this.contentLayouts = contentLayouts;
691
+ this._cdRef.markForCheck();
692
+ });
693
+ of(this._data.contentPage)
694
+ .pipe(switchMap((contentPage) => {
695
+ return of(contentPage);
696
+ }), takeUntil(this._destroy$))
697
+ .subscribe((contentPage) => {
698
+ this.contentPage = Object.assign({}, contentPage);
699
+ this._cdRef.markForCheck();
700
+ });
701
+ }
702
+ }
703
+ ContentPageComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentPageComponent, deps: [{ token: FS_CONTENT_CONFIG }, { token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }, { token: i2.FsMessage }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
704
+ ContentPageComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ContentPageComponent, selector: "ng-component", viewQueries: [{ propertyName: "textEditors", predicate: FsTextEditorComponent, descendants: true }], ngImport: i0, 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-label>Type</mat-label>\n <mat-select\n [(ngModel)]=\"contentPage.type\"\n name=\"type\"\n required>\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-label>Layout</mat-label>\n <mat-select\n [(ngModel)]=\"contentPage.contentLayoutId\"\n required\n name=\"contentLayoutId\">\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 <mat-label>Name</mat-label>\n <input\n matInput\n [(ngModel)]=\"contentPage.name\"\n name=\"name\"\n required>\n </mat-form-field>\n <mat-form-field>\n <mat-label>Path</mat-label>\n <input\n matInput\n [(ngModel)]=\"contentPage.path\"\n name=\"path\"\n required>\n </mat-form-field>\n <mat-form-field>\n <mat-label>Title</mat-label>\n <input\n matInput\n [(ngModel)]=\"contentPage.title\"\n name=\"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$1.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileActionPlacement", "mobileWidth", "mode"] }, { type: i4$1.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i5$2.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i6$1.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i5.FsFormDialogActionsComponent, selector: "fs-form-dialog-actions", inputs: ["save", "create", "close", "done", "closeData", "name"] }], directives: [{ type: i8.FsSkeletonFormDirective, selector: "[fsSkeletonForm]", inputs: ["fsSkeletonForm", "fsSkeletonFormLines"] }, { type: i9.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i9.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i9.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5.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.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i4$1.MatLabel, selector: "mat-label" }, { type: i9.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i9.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i9.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i5.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }, { type: i10.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i8$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: i9.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i5.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.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
705
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentPageComponent, decorators: [{
706
+ type: Component,
707
+ args: [{
708
+ templateUrl: './content-page.component.html',
709
+ styleUrls: ['./content-page.component.scss'],
710
+ changeDetection: ChangeDetectionStrategy.OnPush,
711
+ }]
712
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
713
+ type: Inject,
714
+ args: [FS_CONTENT_CONFIG]
715
+ }] }, { type: undefined, decorators: [{
716
+ type: Inject,
717
+ args: [MAT_DIALOG_DATA]
718
+ }] }, { type: i1.MatDialogRef }, { type: i2.FsMessage }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { textEditors: [{
719
+ type: ViewChildren,
720
+ args: [FsTextEditorComponent]
719
721
  }] } });
720
722
 
721
- class ContentPageEditorComponent {
722
- constructor(_data, _dialogRef, _message, _dialog, _cdRef, _prompt) {
723
- this._data = _data;
724
- this._dialogRef = _dialogRef;
725
- this._message = _message;
726
- this._dialog = _dialog;
727
- this._cdRef = _cdRef;
728
- this._prompt = _prompt;
729
- this.focused = null;
730
- this.resizing = false;
731
- this.editors = {
732
- [EditorType.Html]: true,
733
- [EditorType.Scss]: true,
734
- [EditorType.Js]: false,
735
- [EditorType.GlobalScss]: false,
736
- };
737
- this._destroy$ = new Subject();
738
- this.save = () => {
739
- return of(null)
740
- .pipe(filter(() => this.focused), switchMap(() => {
741
- switch (this.focused) {
742
- case EditorType.Js:
743
- case EditorType.Html:
744
- case EditorType.Scss:
745
- return this.saveContentPage();
746
- case EditorType.GlobalScss:
747
- return this.editor.saveGlobalScss();
748
- }
749
- return throwError('Invalid focus');
750
- }), tap(() => {
751
- this.editor.clearChange(this.focused);
752
- this._cdRef.markForCheck();
753
- }));
754
- };
755
- }
756
- ngOnInit() {
757
- this._dialogRef.addPanelClass('fs-content-editor-overlay-pane');
758
- this._dialogRef.disableClose = true;
759
- this.config = this._data.contentConfig;
760
- this._initContentPage(this._data.contentPage);
761
- this._initEscape();
762
- }
763
- editorToggleChange(event) {
764
- this.editors[event.value] = !this.editors[event.value];
765
- }
766
- ngOnDestroy() {
767
- this._destroy$.next();
768
- this._destroy$.complete();
769
- }
770
- _initContentPage(contentPage) {
771
- this.config.loadContentPage(contentPage.id)
772
- .subscribe((data) => {
773
- this.contentPage = data;
774
- this._cdRef.markForCheck();
775
- });
776
- }
777
- editorFocused(type) {
778
- this.focused = type;
779
- }
780
- saveContentPage() {
781
- const names = {
782
- [EditorType.Js]: 'js',
783
- [EditorType.Scss]: 'styles',
784
- [EditorType.Html]: 'content',
785
- };
786
- const data = {
787
- id: this.contentPage.id,
788
- [names[this.focused]]: this.editor.changes[this.focused],
789
- };
790
- return this.config.saveContentPage(Object.assign({ id: this.contentPage.id }, data))
791
- .pipe(tap(() => {
792
- this._message.success('Saved Changes');
793
- }));
794
- }
795
- close() {
796
- if (!this.editor.hasChanges) {
797
- return this._dialogRef.close();
798
- }
799
- this._prompt.confirm({
800
- dialogConfig: {
801
- width: null,
802
- },
803
- title: 'You have unsaved changes',
804
- template: 'What would you like to do with your changes?',
805
- buttons: [
806
- {
807
- label: 'Review Changes',
808
- value: 'review',
809
- },
810
- {
811
- label: 'Discard Changes',
812
- value: 'discard',
813
- },
814
- ],
815
- })
816
- .pipe(takeUntil(this._destroy$))
817
- .subscribe((value) => {
818
- if (value === 'discard') {
819
- this._dialogRef.close();
820
- }
821
- });
822
- }
823
- openSettings() {
824
- this._dialog.open(ContentPageComponent, {
825
- data: {
826
- contentPage: this.contentPage,
827
- },
828
- })
829
- .afterClosed()
830
- .pipe(takeUntil(this._destroy$))
831
- .subscribe((contentPage) => {
832
- this.contentPage = Object.assign(Object.assign({}, this.contentPage), contentPage);
833
- this._cdRef.markForCheck();
834
- });
835
- }
836
- _initEscape() {
837
- fromEvent(document, 'keydown')
838
- .pipe(filter((event) => event.code === 'Escape'), takeUntil(this._destroy$)).subscribe(() => {
839
- const dialogRef = this._dialog.openDialogs.reverse()[0];
840
- if ((dialogRef === null || dialogRef === void 0 ? void 0 : dialogRef.componentInstance) === this) {
841
- this.close();
842
- }
843
- });
844
- }
845
- }
846
- ContentPageEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentPageEditorComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }, { token: i2.FsMessage }, { token: i1.MatDialog }, { token: i0.ChangeDetectorRef }, { token: i3$2.FsPrompt }], target: i0.ɵɵFactoryTarget.Component });
847
- ContentPageEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ContentPageEditorComponent, selector: "ng-component", viewQueries: [{ propertyName: "editor", first: true, predicate: EditorComponent, descendants: true }], ngImport: i0, template: "<form fsForm [submit]=\"save\" [dirtySubmitButton]=\"false\" [confirm]=\"false\">\n <fs-dialog *fsSkeletonForm=\"contentPage\">\n <h1 mat-dialog-title>\n <div class=\"title-container\">\n <div class=\"title\">\n Page Editor\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 <app-editor\n [contentConfig]=\"config\"\n [showHtml]=\"editors.html\"\n [showJs]=\"editors.js\"\n [showScss]=\"editors.scss\"\n [showGlobalScss]=\"editors.globalScss\"\n [html]=\"contentPage.content\"\n [scss]=\"contentPage.styles\"\n [js]=\"contentPage.js\"\n (focused)=\"editorFocused($event)\">\n </app-editor>\n </div>\n\n <div mat-dialog-actions>\n <button \n mat-button\n color=\"primary\"\n (click)=\"close()\"\n type=\"button\"> \n Done \n </button>\n \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</form>", styles: ["::ng-deep .fs-content-editor-overlay-pane .mat-dialog-container{border-radius:0}form{height:100%}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}.title-container{display:flex;align-items:center}.title-container .title{flex:1}.title-container .title .small{line-height:normal}\n"], components: [{ type: i3$1.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileActionPlacement", "mobileWidth", "mode"] }, { type: i5$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: i6.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: EditorComponent, selector: "app-editor", inputs: ["showHtml", "showScss", "showJs", "showGlobalScss", "html", "scss", "js", "contentConfig"], outputs: ["changed", "focused", "blured"] }, { type: i5$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i8$2.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.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i9.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i9.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5.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: i8.FsSkeletonFormDirective, selector: "[fsSkeletonForm]", inputs: ["fsSkeletonForm", "fsSkeletonFormLines"] }, { type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i5.FsButtonDirective, selector: "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", inputs: ["name", "dirtySubmit", "form"] }, { type: i8$2.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
848
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentPageEditorComponent, decorators: [{
849
- type: Component,
850
- args: [{
851
- templateUrl: './content-page-editor.component.html',
852
- styleUrls: ['./content-page-editor.component.scss'],
853
- changeDetection: ChangeDetectionStrategy.OnPush,
854
- }]
855
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
856
- type: Inject,
857
- args: [MAT_DIALOG_DATA]
858
- }] }, { type: i1.MatDialogRef }, { type: i2.FsMessage }, { type: i1.MatDialog }, { type: i0.ChangeDetectorRef }, { type: i3$2.FsPrompt }]; }, propDecorators: { editor: [{
859
- type: ViewChild,
860
- args: [EditorComponent]
723
+ class ContentPageEditorComponent {
724
+ constructor(_data, _dialogRef, _message, _dialog, _cdRef, _prompt) {
725
+ this._data = _data;
726
+ this._dialogRef = _dialogRef;
727
+ this._message = _message;
728
+ this._dialog = _dialog;
729
+ this._cdRef = _cdRef;
730
+ this._prompt = _prompt;
731
+ this.focused = null;
732
+ this.resizing = false;
733
+ this.editors = {
734
+ [EditorType.Html]: true,
735
+ [EditorType.Scss]: true,
736
+ [EditorType.Js]: false,
737
+ [EditorType.GlobalScss]: false,
738
+ };
739
+ this._destroy$ = new Subject();
740
+ this.save = () => {
741
+ return of(null)
742
+ .pipe(filter(() => this.focused), switchMap(() => {
743
+ switch (this.focused) {
744
+ case EditorType.Js:
745
+ case EditorType.Html:
746
+ case EditorType.Scss:
747
+ return this.saveContentPage();
748
+ case EditorType.GlobalScss:
749
+ return this.editor.saveGlobalScss();
750
+ }
751
+ return throwError('Invalid focus');
752
+ }), tap(() => {
753
+ this.editor.clearChange(this.focused);
754
+ this._cdRef.markForCheck();
755
+ }));
756
+ };
757
+ }
758
+ get isMac() {
759
+ return navigator.platform.toUpperCase().indexOf('MAC') >= 0;
760
+ }
761
+ ngOnInit() {
762
+ this._dialogRef.addPanelClass('fs-content-editor-overlay-pane');
763
+ this._dialogRef.disableClose = true;
764
+ this.config = this._data.contentConfig;
765
+ this._initContentPage(this._data.contentPage);
766
+ this._initEscape();
767
+ }
768
+ editorToggleChange(event) {
769
+ this.editors[event.value] = !this.editors[event.value];
770
+ }
771
+ ngOnDestroy() {
772
+ this._destroy$.next();
773
+ this._destroy$.complete();
774
+ }
775
+ _initContentPage(contentPage) {
776
+ this.config.loadContentPage(contentPage.id)
777
+ .subscribe((data) => {
778
+ this.contentPage = data;
779
+ this._cdRef.markForCheck();
780
+ });
781
+ }
782
+ editorFocused(type) {
783
+ this.focused = type;
784
+ }
785
+ saveContentPage() {
786
+ const names = {
787
+ [EditorType.Js]: 'js',
788
+ [EditorType.Scss]: 'styles',
789
+ [EditorType.Html]: 'content',
790
+ };
791
+ const data = {
792
+ id: this.contentPage.id,
793
+ [names[this.focused]]: this.editor.changes[this.focused],
794
+ };
795
+ return this.config.saveContentPage(Object.assign({ id: this.contentPage.id }, data))
796
+ .pipe(tap(() => {
797
+ this._message.success('Saved Changes');
798
+ }));
799
+ }
800
+ close() {
801
+ if (!this.editor.hasChanges) {
802
+ return this._dialogRef.close();
803
+ }
804
+ this._prompt.confirm({
805
+ dialogConfig: {
806
+ width: null,
807
+ },
808
+ title: 'You have unsaved changes',
809
+ template: 'What would you like to do with your changes?',
810
+ buttons: [
811
+ {
812
+ label: 'Review Changes',
813
+ value: 'review',
814
+ },
815
+ {
816
+ label: 'Discard Changes',
817
+ value: 'discard',
818
+ },
819
+ ],
820
+ })
821
+ .pipe(takeUntil(this._destroy$))
822
+ .subscribe((value) => {
823
+ if (value === 'discard') {
824
+ this._dialogRef.close();
825
+ }
826
+ });
827
+ }
828
+ openSettings() {
829
+ this._dialog.open(ContentPageComponent, {
830
+ data: {
831
+ contentPage: this.contentPage,
832
+ },
833
+ })
834
+ .afterClosed()
835
+ .pipe(takeUntil(this._destroy$))
836
+ .subscribe((contentPage) => {
837
+ this.contentPage = Object.assign(Object.assign({}, this.contentPage), contentPage);
838
+ this._cdRef.markForCheck();
839
+ });
840
+ }
841
+ _initEscape() {
842
+ fromEvent(document, 'keydown')
843
+ .pipe(filter((event) => event.code === 'Escape'), takeUntil(this._destroy$)).subscribe(() => {
844
+ const dialogRef = this._dialog.openDialogs.reverse()[0];
845
+ if ((dialogRef === null || dialogRef === void 0 ? void 0 : dialogRef.componentInstance) === this) {
846
+ this.close();
847
+ }
848
+ });
849
+ }
850
+ }
851
+ ContentPageEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentPageEditorComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }, { token: i2.FsMessage }, { token: i1.MatDialog }, { token: i0.ChangeDetectorRef }, { token: i3$2.FsPrompt }], target: i0.ɵɵFactoryTarget.Component });
852
+ ContentPageEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ContentPageEditorComponent, selector: "ng-component", viewQueries: [{ propertyName: "editor", first: true, predicate: EditorComponent, descendants: true }], ngImport: i0, template: "<form fsForm [submit]=\"save\" [dirtySubmitButton]=\"false\" [confirm]=\"false\">\n <fs-dialog *fsSkeletonForm=\"contentPage\">\n <h1 mat-dialog-title>\n <div class=\"title-container\">\n <div class=\"title\">\n Page Editor\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\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\n <div class=\"actions\">\n <button \n mat-button\n [disabled]=\"!editor?.hasChanges\"\n [matTooltip]=\"isMac ? 'cmd+s' : 'ctrl+s'\"\n type=\"submit\"> \n Save\n </button>\n\n <button \n mat-button\n (click)=\"close()\"\n type=\"button\"> \n Done\n </button>\n </div>\n </div>\n </h1>\n <div mat-dialog-content>\n <app-editor\n [contentConfig]=\"config\"\n [showHtml]=\"editors.html\"\n [showJs]=\"editors.js\"\n [showScss]=\"editors.scss\"\n [showGlobalScss]=\"editors.globalScss\"\n [html]=\"contentPage.content\"\n [scss]=\"contentPage.styles\"\n [js]=\"contentPage.js\"\n (focused)=\"editorFocused($event)\">\n </app-editor>\n </div>\n </fs-dialog>\n</form>\n", styles: ["::ng-deep .fs-content-editor-overlay-pane .mat-dialog-container{border-radius:0}form{height:100%}fs-dialog{display:flex;height:100%;flex-direction:column}fs-dialog ::ng-deep .mat-dialog-content{max-height:none;flex:1;overflow:hidden}h1 .toggles{display:flex;justify-content:flex-end;justify-self:baseline;font-size:13px}h1 .actions{margin-left:30px}h1 .actions .mat-button{border:solid 1px rgba(0,0,0,.12);line-height:48px;margin-right:10px;font-weight:600}h1 .actions .mat-button:last-child{margin-right:0}.title-container{display:flex;align-items:center}.title-container .title{flex:1}.title-container .title .small{line-height:normal}\n"], components: [{ type: i3$1.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileActionPlacement", "mobileWidth", "mode"] }, { type: i5$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: i6.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i8$2.MatButtonToggle, selector: "mat-button-toggle", inputs: ["disableRipple", "aria-labelledby", "tabIndex", "appearance", "checked", "disabled", "id", "name", "aria-label", "value"], outputs: ["change"], exportAs: ["matButtonToggle"] }, { type: i5$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: EditorComponent, selector: "app-editor", inputs: ["showHtml", "showScss", "showJs", "showGlobalScss", "html", "scss", "js", "contentConfig"], outputs: ["changed", "focused", "blured"] }], directives: [{ type: i9.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i9.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i9.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5.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: i8.FsSkeletonFormDirective, selector: "[fsSkeletonForm]", inputs: ["fsSkeletonForm", "fsSkeletonFormLines"] }, { type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i8$2.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { type: i5.FsButtonDirective, selector: "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", inputs: ["name", "dirtySubmit", "form"] }, { type: i12.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
853
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentPageEditorComponent, decorators: [{
854
+ type: Component,
855
+ args: [{
856
+ templateUrl: './content-page-editor.component.html',
857
+ styleUrls: ['./content-page-editor.component.scss'],
858
+ changeDetection: ChangeDetectionStrategy.OnPush,
859
+ }]
860
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
861
+ type: Inject,
862
+ args: [MAT_DIALOG_DATA]
863
+ }] }, { type: i1.MatDialogRef }, { type: i2.FsMessage }, { type: i1.MatDialog }, { type: i0.ChangeDetectorRef }, { type: i3$2.FsPrompt }]; }, propDecorators: { editor: [{
864
+ type: ViewChild,
865
+ args: [EditorComponent]
861
866
  }] } });
862
867
 
863
- class FsContentPagesComponent {
864
- constructor(_config, _dialog) {
865
- this._config = _config;
866
- this._dialog = _dialog;
867
- this.pageTypes = index(PageTypes, 'value', 'name');
868
- this._destroy$ = new Subject();
869
- }
870
- ngOnInit() {
871
- this._initListConfig();
872
- }
873
- openEditor(contentPage) {
874
- this._dialog.open(ContentPageEditorComponent, {
875
- data: {
876
- contentPage,
877
- config: this._config,
878
- contentConfig: this._config,
879
- },
880
- maxWidth: '100vw',
881
- width: '100%',
882
- height: '100%',
883
- autoFocus: false,
884
- })
885
- .afterClosed()
886
- .pipe(takeUntil(this._destroy$))
887
- .subscribe(() => {
888
- this.listComponent.reload();
889
- });
890
- }
891
- ngOnDestroy() {
892
- this._destroy$.next();
893
- this._destroy$.complete();
894
- }
895
- openContentPage(contentPage) {
896
- return this._dialog.open(ContentPageComponent, {
897
- data: { contentPage },
898
- })
899
- .afterClosed()
900
- .pipe(takeUntil(this._destroy$));
901
- }
902
- _initListConfig() {
903
- this.listConfig = {
904
- filters: [
905
- {
906
- name: 'keyword',
907
- type: ItemType.Keyword,
908
- label: 'Search',
909
- },
910
- ],
911
- actions: [
912
- {
913
- label: 'Create',
914
- click: () => {
915
- this.openContentPage({
916
- type: PageType.StandardPage,
917
- })
918
- .pipe(filter((contentPage) => !!contentPage))
919
- .subscribe((contentPage) => {
920
- this.openEditor(contentPage);
921
- this.listComponent.reload();
922
- });
923
- },
924
- },
925
- ],
926
- rowActions: [
927
- {
928
- click: (data) => {
929
- return this._config.deleteContentPage(data);
930
- },
931
- remove: {
932
- title: 'Confirm',
933
- template: 'Are you sure you would like to delete this record?',
934
- },
935
- menu: true,
936
- label: 'Delete',
937
- },
938
- ],
939
- fetch: (query) => {
940
- return this._config.loadContentPages(query)
941
- .pipe(map((response) => {
942
- return { data: response.contentPages, paging: response.paging };
943
- }));
944
- },
945
- restore: {
946
- query: { state: 'deleted' },
947
- filterLabel: 'Show Deleted',
948
- menuLabel: 'Restore',
949
- reload: true,
950
- click: (row) => {
951
- return this._config.saveContentPage({ id: row.id, state: 'active' });
952
- },
953
- },
954
- };
955
- }
956
- }
957
- FsContentPagesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentPagesComponent, deps: [{ token: FS_CONTENT_CONFIG }, { token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
958
- FsContentPagesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsContentPagesComponent, selector: "fs-content-pages", inputs: { htmlEditorConfig: "htmlEditorConfig" }, viewQueries: [{ propertyName: "listComponent", first: true, predicate: FsListComponent, descendants: true }], ngImport: i0, 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=\"path\" title=\"Path\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n <a [href]=\"'/' + row.path\" target=\"_black\">/{{row.path}}</a>\n </ng-template>\n </fs-list-column>\n <fs-list-column name=\"type\" title=\"Type\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n {{pageTypes[row.type]}}\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: [":host ::ng-deep .modified,:host ::ng-deep .name{width:1%;white-space:nowrap}:host ::ng-deep .preview-content img{display:none}.preview-content{position:relative;max-height:100px;max-width:100%;overflow:hidden;-webkit-mask-image:-webkit-gradient(linear,left 60%,left bottom,from(black),to(rgba(0,0,0,0)))}\n"], components: [{ type: i2$2.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }], directives: [{ type: i2$2.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i2$2.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }], pipes: { "fsDate": i3$3.FsDatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
959
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentPagesComponent, decorators: [{
960
- type: Component,
961
- args: [{
962
- selector: 'fs-content-pages',
963
- templateUrl: './content-pages.component.html',
964
- styleUrls: ['./content-pages.component.scss'],
965
- changeDetection: ChangeDetectionStrategy.OnPush,
966
- }]
967
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
968
- type: Inject,
969
- args: [FS_CONTENT_CONFIG]
970
- }] }, { type: i1.MatDialog }]; }, propDecorators: { htmlEditorConfig: [{
971
- type: Input
972
- }], listComponent: [{
973
- type: ViewChild,
974
- args: [FsListComponent]
868
+ class FsContentPagesComponent {
869
+ constructor(_config, _dialog) {
870
+ this._config = _config;
871
+ this._dialog = _dialog;
872
+ this.pageTypes = index(PageTypes, 'value', 'name');
873
+ this._destroy$ = new Subject();
874
+ }
875
+ ngOnInit() {
876
+ this._initListConfig();
877
+ }
878
+ openEditor(contentPage) {
879
+ this._dialog.open(ContentPageEditorComponent, {
880
+ data: {
881
+ contentPage,
882
+ config: this._config,
883
+ contentConfig: this._config,
884
+ },
885
+ maxWidth: '100vw',
886
+ width: '100%',
887
+ height: '100%',
888
+ autoFocus: false,
889
+ })
890
+ .afterClosed()
891
+ .pipe(takeUntil(this._destroy$))
892
+ .subscribe(() => {
893
+ this.listComponent.reload();
894
+ });
895
+ }
896
+ ngOnDestroy() {
897
+ this._destroy$.next();
898
+ this._destroy$.complete();
899
+ }
900
+ openContentPage(contentPage) {
901
+ return this._dialog.open(ContentPageComponent, {
902
+ data: { contentPage },
903
+ })
904
+ .afterClosed()
905
+ .pipe(takeUntil(this._destroy$));
906
+ }
907
+ _initListConfig() {
908
+ this.listConfig = {
909
+ filters: [
910
+ {
911
+ name: 'keyword',
912
+ type: ItemType.Keyword,
913
+ label: 'Search',
914
+ },
915
+ ],
916
+ actions: [
917
+ {
918
+ label: 'Create',
919
+ click: () => {
920
+ this.openContentPage({
921
+ type: PageType.StandardPage,
922
+ })
923
+ .pipe(filter((contentPage) => !!contentPage))
924
+ .subscribe((contentPage) => {
925
+ this.openEditor(contentPage);
926
+ this.listComponent.reload();
927
+ });
928
+ },
929
+ },
930
+ ],
931
+ rowActions: [
932
+ {
933
+ click: (data) => {
934
+ return this._config.deleteContentPage(data);
935
+ },
936
+ remove: {
937
+ title: 'Confirm',
938
+ template: 'Are you sure you would like to delete this record?',
939
+ },
940
+ menu: true,
941
+ label: 'Delete',
942
+ },
943
+ ],
944
+ fetch: (query) => {
945
+ return this._config.loadContentPages(query)
946
+ .pipe(map((response) => {
947
+ return { data: response.contentPages, paging: response.paging };
948
+ }));
949
+ },
950
+ restore: {
951
+ query: { state: 'deleted' },
952
+ filterLabel: 'Show Deleted',
953
+ menuLabel: 'Restore',
954
+ reload: true,
955
+ click: (row) => {
956
+ return this._config.saveContentPage({ id: row.id, state: 'active' });
957
+ },
958
+ },
959
+ };
960
+ }
961
+ }
962
+ FsContentPagesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentPagesComponent, deps: [{ token: FS_CONTENT_CONFIG }, { token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
963
+ FsContentPagesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsContentPagesComponent, selector: "fs-content-pages", inputs: { htmlEditorConfig: "htmlEditorConfig" }, viewQueries: [{ propertyName: "listComponent", first: true, predicate: FsListComponent, descendants: true }], ngImport: i0, 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=\"path\" title=\"Path\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n <a [href]=\"'/' + row.path\" target=\"_black\">/{{row.path}}</a>\n </ng-template>\n </fs-list-column>\n <fs-list-column name=\"type\" title=\"Type\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n {{pageTypes[row.type]}}\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: [":host ::ng-deep .modified,:host ::ng-deep .name{width:1%;white-space:nowrap}:host ::ng-deep .preview-content img{display:none}.preview-content{position:relative;max-height:100px;max-width:100%;overflow:hidden;-webkit-mask-image:-webkit-gradient(linear,left 60%,left bottom,from(black),to(rgba(0,0,0,0)))}\n"], components: [{ type: i2$2.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }], directives: [{ type: i2$2.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i2$2.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }], pipes: { "fsDate": i3$3.FsDatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
964
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentPagesComponent, decorators: [{
965
+ type: Component,
966
+ args: [{
967
+ selector: 'fs-content-pages',
968
+ templateUrl: './content-pages.component.html',
969
+ styleUrls: ['./content-pages.component.scss'],
970
+ changeDetection: ChangeDetectionStrategy.OnPush,
971
+ }]
972
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
973
+ type: Inject,
974
+ args: [FS_CONTENT_CONFIG]
975
+ }] }, { type: i1.MatDialog }]; }, propDecorators: { htmlEditorConfig: [{
976
+ type: Input
977
+ }], listComponent: [{
978
+ type: ViewChild,
979
+ args: [FsListComponent]
975
980
  }] } });
976
981
 
977
- class FsContentPagesModule {
978
- static forRoot() {
979
- return {
980
- ngModule: FsContentPagesModule,
981
- };
982
- }
983
- }
984
- FsContentPagesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentPagesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
985
- FsContentPagesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentPagesModule, declarations: [FsContentPagesComponent,
986
- ContentPageComponent,
987
- ContentPageEditorComponent], imports: [CommonModule,
988
- FormsModule,
989
- MatDialogModule,
990
- MatInputModule,
991
- MatFormFieldModule,
992
- MatButtonModule,
993
- MatTabsModule,
994
- MatIconModule,
995
- MatSelectModule,
996
- MatButtonToggleModule,
997
- FsListModule,
998
- FsDateModule,
999
- FsCommonModule,
1000
- FsFormModule,
1001
- FsLabelModule,
1002
- FsSkeletonModule,
1003
- FsHtmlEditorModule,
1004
- FsDialogModule,
1005
- FsTextEditorModule,
1006
- FsContentEditorModule], exports: [FsContentPagesComponent] });
1007
- FsContentPagesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentPagesModule, imports: [[
1008
- CommonModule,
1009
- FormsModule,
1010
- MatDialogModule,
1011
- MatInputModule,
1012
- MatFormFieldModule,
1013
- MatButtonModule,
1014
- MatTabsModule,
1015
- MatIconModule,
1016
- MatSelectModule,
1017
- MatButtonToggleModule,
1018
- FsListModule,
1019
- FsDateModule,
1020
- FsCommonModule,
1021
- FsFormModule,
1022
- FsLabelModule,
1023
- FsSkeletonModule,
1024
- FsHtmlEditorModule,
1025
- FsDialogModule,
1026
- FsTextEditorModule,
1027
- FsContentEditorModule,
1028
- ]] });
1029
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentPagesModule, decorators: [{
1030
- type: NgModule,
1031
- args: [{
1032
- imports: [
1033
- CommonModule,
1034
- FormsModule,
1035
- MatDialogModule,
1036
- MatInputModule,
1037
- MatFormFieldModule,
1038
- MatButtonModule,
1039
- MatTabsModule,
1040
- MatIconModule,
1041
- MatSelectModule,
1042
- MatButtonToggleModule,
1043
- FsListModule,
1044
- FsDateModule,
1045
- FsCommonModule,
1046
- FsFormModule,
1047
- FsLabelModule,
1048
- FsSkeletonModule,
1049
- FsHtmlEditorModule,
1050
- FsDialogModule,
1051
- FsTextEditorModule,
1052
- FsContentEditorModule,
1053
- ],
1054
- exports: [
1055
- FsContentPagesComponent,
1056
- ],
1057
- declarations: [
1058
- FsContentPagesComponent,
1059
- ContentPageComponent,
1060
- ContentPageEditorComponent,
1061
- ],
1062
- }]
982
+ class FsContentPagesModule {
983
+ static forRoot() {
984
+ return {
985
+ ngModule: FsContentPagesModule,
986
+ };
987
+ }
988
+ }
989
+ FsContentPagesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentPagesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
990
+ FsContentPagesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentPagesModule, declarations: [FsContentPagesComponent,
991
+ ContentPageComponent,
992
+ ContentPageEditorComponent], imports: [CommonModule,
993
+ FormsModule,
994
+ MatDialogModule,
995
+ MatInputModule,
996
+ MatFormFieldModule,
997
+ MatButtonModule,
998
+ MatTabsModule,
999
+ MatIconModule,
1000
+ MatSelectModule,
1001
+ MatButtonToggleModule,
1002
+ MatTooltipModule,
1003
+ FsListModule,
1004
+ FsDateModule,
1005
+ FsCommonModule,
1006
+ FsFormModule,
1007
+ FsLabelModule,
1008
+ FsSkeletonModule,
1009
+ FsHtmlEditorModule,
1010
+ FsDialogModule,
1011
+ FsTextEditorModule,
1012
+ FsContentEditorModule], exports: [FsContentPagesComponent] });
1013
+ FsContentPagesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentPagesModule, imports: [[
1014
+ CommonModule,
1015
+ FormsModule,
1016
+ MatDialogModule,
1017
+ MatInputModule,
1018
+ MatFormFieldModule,
1019
+ MatButtonModule,
1020
+ MatTabsModule,
1021
+ MatIconModule,
1022
+ MatSelectModule,
1023
+ MatButtonToggleModule,
1024
+ MatTooltipModule,
1025
+ FsListModule,
1026
+ FsDateModule,
1027
+ FsCommonModule,
1028
+ FsFormModule,
1029
+ FsLabelModule,
1030
+ FsSkeletonModule,
1031
+ FsHtmlEditorModule,
1032
+ FsDialogModule,
1033
+ FsTextEditorModule,
1034
+ FsContentEditorModule,
1035
+ ]] });
1036
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentPagesModule, decorators: [{
1037
+ type: NgModule,
1038
+ args: [{
1039
+ imports: [
1040
+ CommonModule,
1041
+ FormsModule,
1042
+ MatDialogModule,
1043
+ MatInputModule,
1044
+ MatFormFieldModule,
1045
+ MatButtonModule,
1046
+ MatTabsModule,
1047
+ MatIconModule,
1048
+ MatSelectModule,
1049
+ MatButtonToggleModule,
1050
+ MatTooltipModule,
1051
+ FsListModule,
1052
+ FsDateModule,
1053
+ FsCommonModule,
1054
+ FsFormModule,
1055
+ FsLabelModule,
1056
+ FsSkeletonModule,
1057
+ FsHtmlEditorModule,
1058
+ FsDialogModule,
1059
+ FsTextEditorModule,
1060
+ FsContentEditorModule,
1061
+ ],
1062
+ exports: [
1063
+ FsContentPagesComponent,
1064
+ ],
1065
+ declarations: [
1066
+ FsContentPagesComponent,
1067
+ ContentPageComponent,
1068
+ ContentPageEditorComponent,
1069
+ ],
1070
+ }]
1063
1071
  }] });
1064
1072
 
1065
- class ContentStyleComponent {
1066
- constructor(_config, _message, _cdRef) {
1067
- this._config = _config;
1068
- this._message = _message;
1069
- this._cdRef = _cdRef;
1070
- this.height = '100%';
1071
- this.contentStyle = null;
1072
- this.styleConfig = {
1073
- tabSize: 2,
1074
- language: 'scss',
1075
- height: '100%',
1076
- };
1077
- this._destroy$ = new Subject();
1078
- }
1079
- ngOnInit() {
1080
- this.styleConfig.height = this.height;
1081
- this._config.loadContentStyle()
1082
- .subscribe((contentStyle) => {
1083
- this.contentStyle = contentStyle;
1084
- this._cdRef.markForCheck();
1085
- });
1086
- }
1087
- ngOnDestroy() {
1088
- this._destroy$.next();
1089
- this._destroy$.complete();
1090
- }
1091
- save() {
1092
- this._config.saveContentStyle(this.contentStyle)
1093
- .pipe(tap((contentStyle) => {
1094
- this.contentStyle = Object.assign(Object.assign({}, this.contentStyle), contentStyle);
1095
- this._cdRef.markForCheck();
1096
- this._message.success('Saved Changes');
1097
- })).subscribe();
1098
- }
1099
- }
1100
- ContentStyleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentStyleComponent, deps: [{ token: FS_CONTENT_CONFIG }, { token: i2.FsMessage }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1101
- ContentStyleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ContentStyleComponent, selector: "fs-content-style", inputs: { height: "height" }, viewQueries: [{ propertyName: "textEditors", first: true, predicate: FsTextEditorComponent, descendants: true }, { propertyName: "form", first: true, predicate: FsFormDirective, descendants: true }], ngImport: i0, 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: i4.FsTextEditorComponent, selector: "fs-text-editor", inputs: ["config", "scrollable"], outputs: ["ready", "blur"] }], directives: [{ type: i8.FsSkeletonFormDirective, selector: "[fsSkeletonForm]", inputs: ["fsSkeletonForm", "fsSkeletonFormLines"] }, { type: i9.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i9.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i7.FsModelChangeDirective, selector: "[fsModelChange]", inputs: ["fsModelChangeOptions"], outputs: ["fsModelChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1102
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentStyleComponent, decorators: [{
1103
- type: Component,
1104
- args: [{
1105
- selector: 'fs-content-style',
1106
- templateUrl: './content-style.component.html',
1107
- styleUrls: ['./content-style.component.scss'],
1108
- changeDetection: ChangeDetectionStrategy.OnPush,
1109
- }]
1110
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1111
- type: Inject,
1112
- args: [FS_CONTENT_CONFIG]
1113
- }] }, { type: i2.FsMessage }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { textEditors: [{
1114
- type: ViewChild,
1115
- args: [FsTextEditorComponent]
1116
- }], form: [{
1117
- type: ViewChild,
1118
- args: [FsFormDirective]
1119
- }], height: [{
1120
- type: Input
1073
+ class ContentStyleComponent {
1074
+ constructor(_config, _message, _cdRef) {
1075
+ this._config = _config;
1076
+ this._message = _message;
1077
+ this._cdRef = _cdRef;
1078
+ this.height = '100%';
1079
+ this.contentStyle = null;
1080
+ this.styleConfig = {
1081
+ tabSize: 2,
1082
+ language: 'scss',
1083
+ height: '100%',
1084
+ };
1085
+ this._destroy$ = new Subject();
1086
+ }
1087
+ ngOnInit() {
1088
+ this.styleConfig.height = this.height;
1089
+ this._config.loadContentStyle()
1090
+ .subscribe((contentStyle) => {
1091
+ this.contentStyle = contentStyle;
1092
+ this._cdRef.markForCheck();
1093
+ });
1094
+ }
1095
+ ngOnDestroy() {
1096
+ this._destroy$.next();
1097
+ this._destroy$.complete();
1098
+ }
1099
+ save() {
1100
+ this._config.saveContentStyle(this.contentStyle)
1101
+ .pipe(tap((contentStyle) => {
1102
+ this.contentStyle = Object.assign(Object.assign({}, this.contentStyle), contentStyle);
1103
+ this._cdRef.markForCheck();
1104
+ this._message.success('Saved Changes');
1105
+ })).subscribe();
1106
+ }
1107
+ }
1108
+ ContentStyleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentStyleComponent, deps: [{ token: FS_CONTENT_CONFIG }, { token: i2.FsMessage }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1109
+ ContentStyleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ContentStyleComponent, selector: "fs-content-style", inputs: { height: "height" }, viewQueries: [{ propertyName: "textEditors", first: true, predicate: FsTextEditorComponent, descendants: true }, { propertyName: "form", first: true, predicate: FsFormDirective, descendants: true }], ngImport: i0, 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: i4.FsTextEditorComponent, selector: "fs-text-editor", inputs: ["config", "scrollable"], outputs: ["ready", "blur"] }], directives: [{ type: i8.FsSkeletonFormDirective, selector: "[fsSkeletonForm]", inputs: ["fsSkeletonForm", "fsSkeletonFormLines"] }, { type: i9.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i9.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i7.FsModelChangeDirective, selector: "[fsModelChange]", inputs: ["fsModelChangeOptions"], outputs: ["fsModelChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1110
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentStyleComponent, decorators: [{
1111
+ type: Component,
1112
+ args: [{
1113
+ selector: 'fs-content-style',
1114
+ templateUrl: './content-style.component.html',
1115
+ styleUrls: ['./content-style.component.scss'],
1116
+ changeDetection: ChangeDetectionStrategy.OnPush,
1117
+ }]
1118
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1119
+ type: Inject,
1120
+ args: [FS_CONTENT_CONFIG]
1121
+ }] }, { type: i2.FsMessage }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { textEditors: [{
1122
+ type: ViewChild,
1123
+ args: [FsTextEditorComponent]
1124
+ }], form: [{
1125
+ type: ViewChild,
1126
+ args: [FsFormDirective]
1127
+ }], height: [{
1128
+ type: Input
1121
1129
  }] } });
1122
1130
 
1123
- class FsContentStyleModule {
1124
- }
1125
- FsContentStyleModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentStyleModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1126
- FsContentStyleModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentStyleModule, declarations: [ContentStyleComponent], imports: [CommonModule,
1127
- FormsModule,
1128
- MatButtonModule,
1129
- FsTextEditorModule,
1130
- FsSkeletonModule,
1131
- FsCommonModule,
1132
- FsContentEditorModule], exports: [ContentStyleComponent] });
1133
- FsContentStyleModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentStyleModule, imports: [[
1134
- CommonModule,
1135
- FormsModule,
1136
- MatButtonModule,
1137
- FsTextEditorModule,
1138
- FsSkeletonModule,
1139
- FsCommonModule,
1140
- FsContentEditorModule,
1141
- ]] });
1142
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentStyleModule, decorators: [{
1143
- type: NgModule,
1144
- args: [{
1145
- imports: [
1146
- CommonModule,
1147
- FormsModule,
1148
- MatButtonModule,
1149
- FsTextEditorModule,
1150
- FsSkeletonModule,
1151
- FsCommonModule,
1152
- FsContentEditorModule,
1153
- ],
1154
- exports: [
1155
- ContentStyleComponent,
1156
- ],
1157
- declarations: [
1158
- ContentStyleComponent,
1159
- ],
1160
- }]
1131
+ class FsContentStyleModule {
1132
+ }
1133
+ FsContentStyleModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentStyleModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1134
+ FsContentStyleModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentStyleModule, declarations: [ContentStyleComponent], imports: [CommonModule,
1135
+ FormsModule,
1136
+ MatButtonModule,
1137
+ FsTextEditorModule,
1138
+ FsSkeletonModule,
1139
+ FsCommonModule,
1140
+ FsContentEditorModule], exports: [ContentStyleComponent] });
1141
+ FsContentStyleModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentStyleModule, imports: [[
1142
+ CommonModule,
1143
+ FormsModule,
1144
+ MatButtonModule,
1145
+ FsTextEditorModule,
1146
+ FsSkeletonModule,
1147
+ FsCommonModule,
1148
+ FsContentEditorModule,
1149
+ ]] });
1150
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentStyleModule, decorators: [{
1151
+ type: NgModule,
1152
+ args: [{
1153
+ imports: [
1154
+ CommonModule,
1155
+ FormsModule,
1156
+ MatButtonModule,
1157
+ FsTextEditorModule,
1158
+ FsSkeletonModule,
1159
+ FsCommonModule,
1160
+ FsContentEditorModule,
1161
+ ],
1162
+ exports: [
1163
+ ContentStyleComponent,
1164
+ ],
1165
+ declarations: [
1166
+ ContentStyleComponent,
1167
+ ],
1168
+ }]
1161
1169
  }] });
1162
1170
 
1163
- class ContentRendererComponent {
1164
- constructor(_sanitizer, _router, _el, _htmlRenderer) {
1165
- this._sanitizer = _sanitizer;
1166
- this._router = _router;
1167
- this._el = _el;
1168
- this._htmlRenderer = _htmlRenderer;
1169
- this._destroy$ = new Subject();
1170
- }
1171
- ngOnInit() {
1172
- this._htmlRenderer.addStyle(this.contentPage.styles, { id: 'contentPageStyles' });
1173
- this.content = this._sanitizer.bypassSecurityTrustHtml(this.contentPage.content);
1174
- }
1175
- ngAfterViewChecked() {
1176
- this.registerHrefs();
1177
- if (this.contentPage.js) {
1178
- const script = document.createElement('script');
1179
- script.text = this.contentPage.js;
1180
- this.script.nativeElement.after(script);
1181
- }
1182
- }
1183
- registerHrefs() {
1184
- Array.from(this.el.querySelectorAll('a[href]'))
1185
- .filter((el) => {
1186
- return el.getAttribute('href').match(/^\//);
1187
- })
1188
- .forEach((el) => {
1189
- el.addEventListener('click', (event) => {
1190
- if (!event.shiftKey && !event.ctrlKey) {
1191
- event.preventDefault();
1192
- const href = el.getAttribute('href');
1193
- this._router.navigateByUrl(href);
1194
- }
1195
- });
1196
- });
1197
- }
1198
- get el() {
1199
- return this._el.nativeElement;
1200
- }
1201
- ngOnDestroy() {
1202
- this.removeStyles();
1203
- this._destroy$.next();
1204
- this._destroy$.complete();
1205
- }
1206
- removeStyles() {
1207
- const el = document.querySelector('#contentPageStyles');
1208
- if (el) {
1209
- el.remove();
1210
- }
1211
- }
1212
- }
1213
- ContentRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentRendererComponent, deps: [{ token: i1$1.DomSanitizer }, { token: i2$3.Router }, { token: i0.ElementRef }, { token: i3$4.HtmlRenderer }], target: i0.ɵɵFactoryTarget.Component });
1214
- ContentRendererComponent.ɵcmp = i0.ɵɵ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: ElementRef }], ngImport: i0, template: "<div *ngIf=\"content\" [innerHTML]=\"content\"></div>\n<span #script></span>", styles: [""], directives: [{ type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1215
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentRendererComponent, decorators: [{
1216
- type: Component,
1217
- args: [{
1218
- selector: 'fs-content-renderer',
1219
- templateUrl: './content-renderer.component.html',
1220
- styleUrls: ['./content-renderer.component.scss'],
1221
- changeDetection: ChangeDetectionStrategy.OnPush,
1222
- }]
1223
- }], ctorParameters: function () { return [{ type: i1$1.DomSanitizer }, { type: i2$3.Router }, { type: i0.ElementRef }, { type: i3$4.HtmlRenderer }]; }, propDecorators: { script: [{
1224
- type: ViewChild,
1225
- args: ['script', { read: ElementRef }]
1226
- }], contentPage: [{
1227
- type: Input
1171
+ class ContentRendererComponent {
1172
+ constructor(_sanitizer, _router, _el, _htmlRenderer) {
1173
+ this._sanitizer = _sanitizer;
1174
+ this._router = _router;
1175
+ this._el = _el;
1176
+ this._htmlRenderer = _htmlRenderer;
1177
+ this._destroy$ = new Subject();
1178
+ }
1179
+ ngOnInit() {
1180
+ this._htmlRenderer.addStyle(this.contentPage.styles, { id: 'contentPageStyles' });
1181
+ this.content = this._sanitizer.bypassSecurityTrustHtml(this.contentPage.content);
1182
+ }
1183
+ ngAfterViewChecked() {
1184
+ this.registerHrefs();
1185
+ if (this.contentPage.js) {
1186
+ const script = document.createElement('script');
1187
+ script.text = this.contentPage.js;
1188
+ this.script.nativeElement.after(script);
1189
+ }
1190
+ }
1191
+ registerHrefs() {
1192
+ Array.from(this.el.querySelectorAll('a[href]'))
1193
+ .filter((el) => {
1194
+ return el.getAttribute('href').match(/^\//);
1195
+ })
1196
+ .forEach((el) => {
1197
+ el.addEventListener('click', (event) => {
1198
+ if (!event.shiftKey && !event.ctrlKey) {
1199
+ event.preventDefault();
1200
+ const href = el.getAttribute('href');
1201
+ this._router.navigateByUrl(href);
1202
+ }
1203
+ });
1204
+ });
1205
+ }
1206
+ get el() {
1207
+ return this._el.nativeElement;
1208
+ }
1209
+ ngOnDestroy() {
1210
+ this.removeStyles();
1211
+ this._destroy$.next();
1212
+ this._destroy$.complete();
1213
+ }
1214
+ removeStyles() {
1215
+ const el = document.querySelector('#contentPageStyles');
1216
+ if (el) {
1217
+ el.remove();
1218
+ }
1219
+ }
1220
+ }
1221
+ ContentRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentRendererComponent, deps: [{ token: i1$1.DomSanitizer }, { token: i2$3.Router }, { token: i0.ElementRef }, { token: i3$4.HtmlRenderer }], target: i0.ɵɵFactoryTarget.Component });
1222
+ ContentRendererComponent.ɵcmp = i0.ɵɵ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: ElementRef }], ngImport: i0, template: "<div *ngIf=\"content\" [innerHTML]=\"content\"></div>\n<span #script></span>", styles: [""], directives: [{ type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1223
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentRendererComponent, decorators: [{
1224
+ type: Component,
1225
+ args: [{
1226
+ selector: 'fs-content-renderer',
1227
+ templateUrl: './content-renderer.component.html',
1228
+ styleUrls: ['./content-renderer.component.scss'],
1229
+ changeDetection: ChangeDetectionStrategy.OnPush,
1230
+ }]
1231
+ }], ctorParameters: function () { return [{ type: i1$1.DomSanitizer }, { type: i2$3.Router }, { type: i0.ElementRef }, { type: i3$4.HtmlRenderer }]; }, propDecorators: { script: [{
1232
+ type: ViewChild,
1233
+ args: ['script', { read: ElementRef }]
1234
+ }], contentPage: [{
1235
+ type: Input
1228
1236
  }] } });
1229
1237
 
1230
- class FsContentComponent {
1231
- constructor(_config, _title, _cdRef, _router, _el, _htmlRenderer) {
1232
- this._config = _config;
1233
- this._title = _title;
1234
- this._cdRef = _cdRef;
1235
- this._router = _router;
1236
- this._el = _el;
1237
- this._htmlRenderer = _htmlRenderer;
1238
- this._destroy$ = new Subject();
1239
- }
1240
- ngOnInit() {
1241
- this._initContent();
1242
- this._initStyles();
1243
- }
1244
- get el() {
1245
- return this._el.nativeElement;
1246
- }
1247
- ngOnDestroy() {
1248
- this._destroy$.next();
1249
- this._destroy$.complete();
1250
- this._title.setTitle('');
1251
- }
1252
- _initStyles() {
1253
- if (this._config.loadContentStyleCss) {
1254
- this._config.loadContentStyleCss()
1255
- .subscribe((styles) => {
1256
- this._htmlRenderer.addStyle(styles, { id: 'content-sytle' });
1257
- });
1258
- }
1259
- }
1260
- _initContent() {
1261
- this._loadContent();
1262
- this._router.events
1263
- .pipe(filter((e) => e instanceof NavigationEnd), takeUntil(this._destroy$))
1264
- .subscribe((e) => {
1265
- this._loadContent();
1266
- });
1267
- }
1268
- _loadContent() {
1269
- const path = window.location.pathname;
1270
- this._config.loadContent(path)
1271
- .subscribe((contentPage) => {
1272
- if (contentPage.title) {
1273
- this._title.setTitle(contentPage.title);
1274
- let ogTitleEl = document.querySelector('head meta[property="og:title"]');
1275
- if (!ogTitleEl) {
1276
- ogTitleEl = document.createElement('meta');
1277
- ogTitleEl.setAttribute('property', 'og:title');
1278
- document.getElementsByTagName('head')[0].appendChild(ogTitleEl);
1279
- }
1280
- ogTitleEl.setAttribute('content', contentPage.title);
1281
- }
1282
- this.contentPage = contentPage;
1283
- this._cdRef.markForCheck();
1284
- });
1285
- }
1286
- }
1287
- FsContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentComponent, deps: [{ token: FS_CONTENT_CONFIG }, { token: i1$1.Title }, { token: i0.ChangeDetectorRef }, { token: i2$3.Router }, { token: i0.ElementRef }, { token: i3$4.HtmlRenderer }], target: i0.ɵɵFactoryTarget.Component });
1288
- FsContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsContentComponent, selector: "fs-content", ngImport: i0, 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.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1289
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentComponent, decorators: [{
1290
- type: Component,
1291
- args: [{
1292
- selector: 'fs-content',
1293
- templateUrl: './content.component.html',
1294
- styleUrls: ['./content.component.scss'],
1295
- changeDetection: ChangeDetectionStrategy.OnPush,
1296
- }]
1297
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1298
- type: Inject,
1299
- args: [FS_CONTENT_CONFIG]
1238
+ class FsContentComponent {
1239
+ constructor(_config, _title, _cdRef, _router, _el, _htmlRenderer) {
1240
+ this._config = _config;
1241
+ this._title = _title;
1242
+ this._cdRef = _cdRef;
1243
+ this._router = _router;
1244
+ this._el = _el;
1245
+ this._htmlRenderer = _htmlRenderer;
1246
+ this._destroy$ = new Subject();
1247
+ }
1248
+ ngOnInit() {
1249
+ this._initContent();
1250
+ this._initStyles();
1251
+ }
1252
+ get el() {
1253
+ return this._el.nativeElement;
1254
+ }
1255
+ ngOnDestroy() {
1256
+ this._destroy$.next();
1257
+ this._destroy$.complete();
1258
+ this._title.setTitle('');
1259
+ }
1260
+ _initStyles() {
1261
+ if (this._config.loadContentStyleCss) {
1262
+ this._config.loadContentStyleCss()
1263
+ .subscribe((styles) => {
1264
+ this._htmlRenderer.addStyle(styles, { id: 'content-sytle' });
1265
+ });
1266
+ }
1267
+ }
1268
+ _initContent() {
1269
+ this._loadContent();
1270
+ this._router.events
1271
+ .pipe(filter((e) => e instanceof NavigationEnd), takeUntil(this._destroy$))
1272
+ .subscribe((e) => {
1273
+ this._loadContent();
1274
+ });
1275
+ }
1276
+ _loadContent() {
1277
+ const path = window.location.pathname;
1278
+ this._config.loadContent(path)
1279
+ .subscribe((contentPage) => {
1280
+ if (contentPage.title) {
1281
+ this._title.setTitle(contentPage.title);
1282
+ let ogTitleEl = document.querySelector('head meta[property="og:title"]');
1283
+ if (!ogTitleEl) {
1284
+ ogTitleEl = document.createElement('meta');
1285
+ ogTitleEl.setAttribute('property', 'og:title');
1286
+ document.getElementsByTagName('head')[0].appendChild(ogTitleEl);
1287
+ }
1288
+ ogTitleEl.setAttribute('content', contentPage.title);
1289
+ }
1290
+ this.contentPage = contentPage;
1291
+ this._cdRef.markForCheck();
1292
+ });
1293
+ }
1294
+ }
1295
+ FsContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentComponent, deps: [{ token: FS_CONTENT_CONFIG }, { token: i1$1.Title }, { token: i0.ChangeDetectorRef }, { token: i2$3.Router }, { token: i0.ElementRef }, { token: i3$4.HtmlRenderer }], target: i0.ɵɵFactoryTarget.Component });
1296
+ FsContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsContentComponent, selector: "fs-content", ngImport: i0, 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.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1297
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentComponent, decorators: [{
1298
+ type: Component,
1299
+ args: [{
1300
+ selector: 'fs-content',
1301
+ templateUrl: './content.component.html',
1302
+ styleUrls: ['./content.component.scss'],
1303
+ changeDetection: ChangeDetectionStrategy.OnPush,
1304
+ }]
1305
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1306
+ type: Inject,
1307
+ args: [FS_CONTENT_CONFIG]
1300
1308
  }] }, { type: i1$1.Title }, { type: i0.ChangeDetectorRef }, { type: i2$3.Router }, { type: i0.ElementRef }, { type: i3$4.HtmlRenderer }]; } });
1301
1309
 
1302
- class FsContentModule {
1303
- }
1304
- FsContentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1305
- FsContentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentModule, declarations: [FsContentComponent,
1306
- ContentRendererComponent], imports: [CommonModule,
1307
- FsHtmlEditorModule], exports: [FsContentComponent] });
1308
- FsContentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentModule, imports: [[
1309
- CommonModule,
1310
- FsHtmlEditorModule,
1311
- ]] });
1312
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentModule, decorators: [{
1313
- type: NgModule,
1314
- args: [{
1315
- imports: [
1316
- CommonModule,
1317
- FsHtmlEditorModule,
1318
- ],
1319
- exports: [
1320
- FsContentComponent,
1321
- ],
1322
- declarations: [
1323
- FsContentComponent,
1324
- ContentRendererComponent,
1325
- ],
1326
- }]
1310
+ class FsContentModule {
1311
+ }
1312
+ FsContentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1313
+ FsContentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentModule, declarations: [FsContentComponent,
1314
+ ContentRendererComponent], imports: [CommonModule,
1315
+ FsHtmlEditorModule], exports: [FsContentComponent] });
1316
+ FsContentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentModule, imports: [[
1317
+ CommonModule,
1318
+ FsHtmlEditorModule,
1319
+ ]] });
1320
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentModule, decorators: [{
1321
+ type: NgModule,
1322
+ args: [{
1323
+ imports: [
1324
+ CommonModule,
1325
+ FsHtmlEditorModule,
1326
+ ],
1327
+ exports: [
1328
+ FsContentComponent,
1329
+ ],
1330
+ declarations: [
1331
+ FsContentComponent,
1332
+ ContentRendererComponent,
1333
+ ],
1334
+ }]
1327
1335
  }] });
1328
1336
 
1329
- /**
1330
- * Generated bundle index. Do not edit.
1337
+ /**
1338
+ * Generated bundle index. Do not edit.
1331
1339
  */
1332
1340
 
1333
1341
  export { ContentStyleComponent, FS_CONTENT_CONFIG, FsContentComponent, FsContentLayoutsComponent, FsContentLayoutsModule, FsContentModule, FsContentPagesComponent, FsContentPagesModule, FsContentStyleModule };