@firestitch/content 12.3.5 → 13.0.1

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