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