@firestitch/content 13.0.4 → 13.0.6

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