@firestitch/content 12.3.0 → 12.3.1

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